@streamlayer/react 0.32.2 → 0.32.4
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/gamification-feature.js +1 -1
- package/lib/dist/cjs/gamification-feature.js +1 -1
- package/lib/dist/cjs/masters.js +1 -1
- package/lib/dist/es/gamification-feature.js +220 -212
- package/lib/dist/es/masters.js +1 -1
- package/lib/dist/style.css +1 -1
- package/lib/es/gamification-feature.js +245 -237
- package/lib/style.css +1 -1
- package/package.json +6 -6
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsxs as m, jsx as s, Fragment as
|
|
2
|
-
import { s as r, n as
|
|
3
|
-
import { useStore as
|
|
1
|
+
import { jsxs as m, jsx as s, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
+
import { s as r, n as j } from "./index4.js";
|
|
3
|
+
import { useStore as C } from "@nanostores/react";
|
|
4
4
|
import { o as Ne, r as te, w as Re, A as Qe, O as Ue, a as K, n as _e, d as Pe } from "./masters2.js";
|
|
5
|
-
import { QuestionType as
|
|
6
|
-
import { useState as V, useCallback as F, useMemo as
|
|
5
|
+
import { QuestionType as x, QuestionStatus as w, QuestionImages as Q, PickHistoryStatus as P } from "@streamlayer/sdk-web-types";
|
|
6
|
+
import { useState as V, useCallback as F, useMemo as L, createElement as H, PureComponent as ye } from "react";
|
|
7
7
|
import { d as Ae } from "./index3.js";
|
|
8
8
|
import "react-countup";
|
|
9
9
|
import { CountdownCircleTimer as qe } from "react-countdown-circle-timer";
|
|
10
|
-
import { E } from "./index2.js";
|
|
10
|
+
import { E as b } from "./index2.js";
|
|
11
11
|
import "@streamlayer/sdk-web-interfaces";
|
|
12
12
|
import "@streamlayer/sdk-web-notifications";
|
|
13
13
|
import "./useStreamLayerApp.js";
|
|
@@ -20,7 +20,7 @@ const Ye = /* @__PURE__ */ r("div")({
|
|
|
20
20
|
name: "QuestionTypeWrap",
|
|
21
21
|
class: "qyktpt0",
|
|
22
22
|
propsAsIs: !1
|
|
23
|
-
}), Ve = () =>
|
|
23
|
+
}), Ve = () => j, Fe = /* @__PURE__ */ r(Ve())({
|
|
24
24
|
name: "QuestionTypeIcon",
|
|
25
25
|
class: "q951jdx",
|
|
26
26
|
propsAsIs: !0
|
|
@@ -32,7 +32,7 @@ const Ye = /* @__PURE__ */ r("div")({
|
|
|
32
32
|
name: "CloseButton",
|
|
33
33
|
class: "c1ao1jtv",
|
|
34
34
|
propsAsIs: !1
|
|
35
|
-
}),
|
|
35
|
+
}), Ge = () => j, Ze = /* @__PURE__ */ r(Ge())({
|
|
36
36
|
name: "CloseIcon",
|
|
37
37
|
class: "cvsl7l3",
|
|
38
38
|
propsAsIs: !0
|
|
@@ -43,14 +43,14 @@ const Ye = /* @__PURE__ */ r("div")({
|
|
|
43
43
|
(i == null ? void 0 : i.iconName) && /* @__PURE__ */ s(
|
|
44
44
|
Fe,
|
|
45
45
|
{
|
|
46
|
-
"data-type-trivia": e ===
|
|
47
|
-
"data-type-poll": e ===
|
|
46
|
+
"data-type-trivia": e === x.TRIVIA,
|
|
47
|
+
"data-type-poll": e === x.POLL,
|
|
48
48
|
name: i.iconName
|
|
49
49
|
}
|
|
50
50
|
),
|
|
51
51
|
(i == null ? void 0 : i.label) && /* @__PURE__ */ s(Be, { children: i.label })
|
|
52
52
|
] }),
|
|
53
|
-
/* @__PURE__ */ s(He, { onClick: t, children: /* @__PURE__ */ s(
|
|
53
|
+
/* @__PURE__ */ s(He, { onClick: t, children: /* @__PURE__ */ s(Ze, { name: "icon-cross" }) })
|
|
54
54
|
] });
|
|
55
55
|
}, De = (e) => e.split(/\s+/).map((t) => t[0]).join("").toUpperCase(), Se = (e) => e ? e.toLocaleString("en-US") : "0", Je = (e) => e.toLocaleDateString("en-US", {
|
|
56
56
|
weekday: "short",
|
|
@@ -86,7 +86,7 @@ const Ye = /* @__PURE__ */ r("div")({
|
|
|
86
86
|
name: "Title",
|
|
87
87
|
class: "t8s05oq",
|
|
88
88
|
propsAsIs: !1
|
|
89
|
-
}),
|
|
89
|
+
}), q = ({ indicator: e, title: t }) => /* @__PURE__ */ m(st, { children: [
|
|
90
90
|
/* @__PURE__ */ s(it, { children: e }),
|
|
91
91
|
/* @__PURE__ */ s(ot, { children: t })
|
|
92
92
|
] }), rt = /* @__PURE__ */ r("div")({
|
|
@@ -199,17 +199,17 @@ const Ye = /* @__PURE__ */ r("div")({
|
|
|
199
199
|
/* @__PURE__ */ s(re, { indicator: o || 0, title: "Global rank" })
|
|
200
200
|
] }),
|
|
201
201
|
/* @__PURE__ */ m(Nt, { children: [
|
|
202
|
-
/* @__PURE__ */ s(
|
|
203
|
-
/* @__PURE__ */ s(
|
|
204
|
-
/* @__PURE__ */ s(
|
|
205
|
-
/* @__PURE__ */ s(
|
|
202
|
+
/* @__PURE__ */ s(q, { indicator: u || 0, title: "Win streak" }),
|
|
203
|
+
/* @__PURE__ */ s(q, { indicator: p || 0, title: "Correct" }),
|
|
204
|
+
/* @__PURE__ */ s(q, { indicator: I || 0, title: "Incorrect" }),
|
|
205
|
+
/* @__PURE__ */ s(q, { indicator: `${h || 0}%`, title: "Succ. rate" })
|
|
206
206
|
] })
|
|
207
207
|
] })
|
|
208
208
|
] }), Dt = /* @__PURE__ */ r("div")({
|
|
209
209
|
name: "SponsorLogoWrap",
|
|
210
210
|
class: "s8p5v5z",
|
|
211
211
|
propsAsIs: !1
|
|
212
|
-
}), St = () =>
|
|
212
|
+
}), St = () => j, zt = /* @__PURE__ */ r(St())({
|
|
213
213
|
name: "SponsorLogo",
|
|
214
214
|
class: "s755yti",
|
|
215
215
|
propsAsIs: !0
|
|
@@ -225,19 +225,19 @@ const Ye = /* @__PURE__ */ r("div")({
|
|
|
225
225
|
name: "Title",
|
|
226
226
|
class: "ty221rx",
|
|
227
227
|
propsAsIs: !1
|
|
228
|
-
}),
|
|
228
|
+
}), kt = /* @__PURE__ */ r("div")({
|
|
229
229
|
name: "Description",
|
|
230
230
|
class: "dlaj9xp",
|
|
231
231
|
propsAsIs: !1
|
|
232
|
-
}),
|
|
233
|
-
/* @__PURE__ */ s(
|
|
232
|
+
}), Ct = ({ title: e, description: t }) => /* @__PURE__ */ m(Ot, { children: [
|
|
233
|
+
/* @__PURE__ */ s(j, { name: "icon-check-circle" }),
|
|
234
234
|
/* @__PURE__ */ s(jt, { children: e }),
|
|
235
|
-
/* @__PURE__ */ s(
|
|
236
|
-
] }),
|
|
235
|
+
/* @__PURE__ */ s(kt, { children: t })
|
|
236
|
+
] }), Lt = /* @__PURE__ */ r("div")({
|
|
237
237
|
name: "Container",
|
|
238
238
|
class: "c16sbdnm",
|
|
239
239
|
propsAsIs: !1
|
|
240
|
-
}),
|
|
240
|
+
}), bt = () => j, wt = /* @__PURE__ */ r(bt())({
|
|
241
241
|
name: "IconPrediction",
|
|
242
242
|
class: "ibhorgl",
|
|
243
243
|
propsAsIs: !0
|
|
@@ -253,7 +253,7 @@ const Ye = /* @__PURE__ */ r("div")({
|
|
|
253
253
|
name: "FeedbackTitle",
|
|
254
254
|
class: "f1913njx",
|
|
255
255
|
propsAsIs: !1
|
|
256
|
-
}),
|
|
256
|
+
}), G = /* @__PURE__ */ r("span")({
|
|
257
257
|
name: "FeedbackDescription",
|
|
258
258
|
class: "fzfk69z",
|
|
259
259
|
propsAsIs: !1
|
|
@@ -269,27 +269,27 @@ const Ye = /* @__PURE__ */ r("div")({
|
|
|
269
269
|
hasCorrectAnswer: o,
|
|
270
270
|
questionStatus: u
|
|
271
271
|
}) => {
|
|
272
|
-
const p = n && (i ===
|
|
273
|
-
if (!p && u !==
|
|
272
|
+
const p = n && (i === x.TRIVIA || i === x.PREDICTION);
|
|
273
|
+
if (!p && u !== w.RESOLVED || u === w.RESOLVED && i === x.PREDICTION && !n)
|
|
274
274
|
return null;
|
|
275
|
-
const I = i ===
|
|
276
|
-
return /* @__PURE__ */ m(
|
|
277
|
-
u ===
|
|
278
|
-
/* @__PURE__ */ s(ae, { children: /* @__PURE__ */ s(
|
|
275
|
+
const I = i === x.PREDICTION && !o, c = t ? "correct" : "incorrect", h = t ? e.correctFeedback : e.incorrectFeedback;
|
|
276
|
+
return /* @__PURE__ */ m(Lt, { "data-isPrediction": I, children: [
|
|
277
|
+
u === w.RESOLVED && i === x.TRIVIA && !n && /* @__PURE__ */ m($, { children: [
|
|
278
|
+
/* @__PURE__ */ s(ae, { children: /* @__PURE__ */ s(j, { name: "questionExpired" }) }),
|
|
279
279
|
/* @__PURE__ */ m("div", { children: [
|
|
280
|
-
/* @__PURE__ */ s(le, { children: /* @__PURE__ */ s(
|
|
280
|
+
/* @__PURE__ */ s(le, { children: /* @__PURE__ */ s(G, { children: "Question Expired" }) }),
|
|
281
281
|
/* @__PURE__ */ s($t, { children: "You can still answer to see if you're correct, but no points are awarded for expired questions." })
|
|
282
282
|
] })
|
|
283
283
|
] }),
|
|
284
|
-
p && I && /* @__PURE__ */ m(
|
|
285
|
-
/* @__PURE__ */ s(
|
|
286
|
-
/* @__PURE__ */ s(
|
|
284
|
+
p && I && /* @__PURE__ */ m($, { children: [
|
|
285
|
+
/* @__PURE__ */ s(wt, { name: "icon-prediction" }),
|
|
286
|
+
/* @__PURE__ */ s(G, { children: "Stay tuned to see if your prediction was correct." })
|
|
287
287
|
] }),
|
|
288
|
-
p && o && /* @__PURE__ */ m(
|
|
289
|
-
/* @__PURE__ */ s(ae, { "data-feedbackType": c, children: /* @__PURE__ */ s(
|
|
288
|
+
p && o && /* @__PURE__ */ m($, { children: [
|
|
289
|
+
/* @__PURE__ */ s(ae, { "data-feedbackType": c, children: /* @__PURE__ */ s(j, { name: c }) }),
|
|
290
290
|
/* @__PURE__ */ s("div", { children: /* @__PURE__ */ m(le, { children: [
|
|
291
291
|
/* @__PURE__ */ s(Et, { "data-feedbackType": c, children: h == null ? void 0 : h.title }),
|
|
292
|
-
/* @__PURE__ */ s(
|
|
292
|
+
/* @__PURE__ */ s(G, { children: h == null ? void 0 : h.description })
|
|
293
293
|
] }) })
|
|
294
294
|
] })
|
|
295
295
|
] });
|
|
@@ -337,7 +337,7 @@ const Ye = /* @__PURE__ */ r("div")({
|
|
|
337
337
|
name: "IconDefault",
|
|
338
338
|
class: "i1grrgwj",
|
|
339
339
|
propsAsIs: !0
|
|
340
|
-
}),
|
|
340
|
+
}), Gt = () => xe, Zt = /* @__PURE__ */ r(Gt())({
|
|
341
341
|
name: "IconCircle",
|
|
342
342
|
class: "ibemyq8",
|
|
343
343
|
propsAsIs: !0
|
|
@@ -353,33 +353,33 @@ const Ye = /* @__PURE__ */ r("div")({
|
|
|
353
353
|
name: "Percentage",
|
|
354
354
|
class: "p17ajcu2",
|
|
355
355
|
propsAsIs: !1
|
|
356
|
-
}), en = () =>
|
|
356
|
+
}), en = () => j, tn = /* @__PURE__ */ r(en())({
|
|
357
357
|
name: "CheckIcon",
|
|
358
358
|
class: "cu9kmlb",
|
|
359
359
|
propsAsIs: !0
|
|
360
360
|
}), ce = {
|
|
361
|
-
[
|
|
362
|
-
[
|
|
363
|
-
[
|
|
364
|
-
[
|
|
365
|
-
[
|
|
361
|
+
[Q.CENTERED]: (e) => /* @__PURE__ */ s(Ht, { alt: "option-icon", src: e }),
|
|
362
|
+
[Q.TRANSPARENT]: (e) => /* @__PURE__ */ s(Vt, { children: /* @__PURE__ */ s(Ft, { style: { backgroundImage: `url(${e})` } }) }),
|
|
363
|
+
[Q.ROUNDED]: (e) => /* @__PURE__ */ s(Zt, { alt: "option-icon", src: e }),
|
|
364
|
+
[Q.NONE]: () => null,
|
|
365
|
+
[Q.UNSET]: () => null
|
|
366
366
|
}, nn = ({ questionType: e, hasCorrectAnswer: t, correct: n, youVoted: i, questionVoted: o }) => {
|
|
367
|
-
if (e ===
|
|
367
|
+
if (e === x.POLL && i)
|
|
368
368
|
return "correct";
|
|
369
|
-
if (e ===
|
|
369
|
+
if (e === x.PREDICTION) {
|
|
370
370
|
if (t && o)
|
|
371
371
|
return i ? n ? "correct" : "incorrect" : "unset";
|
|
372
372
|
if (i)
|
|
373
373
|
return "correct";
|
|
374
374
|
}
|
|
375
|
-
return e ===
|
|
375
|
+
return e === x.TRIVIA && o && i ? n ? "correct" : "incorrect" : "unset";
|
|
376
376
|
}, sn = ({
|
|
377
377
|
questionType: e,
|
|
378
378
|
questionVoted: t,
|
|
379
379
|
correct: n,
|
|
380
380
|
hasCorrectAnswer: i,
|
|
381
381
|
questionStatus: o
|
|
382
|
-
}) => e ===
|
|
382
|
+
}) => e === x.TRIVIA ? t && n : e === x.PREDICTION ? t && n && i || o === w.RESOLVED && n : !1, on = (e) => {
|
|
383
383
|
var t;
|
|
384
384
|
const {
|
|
385
385
|
// option props
|
|
@@ -393,28 +393,28 @@ const Ye = /* @__PURE__ */ r("div")({
|
|
|
393
393
|
questionVoted: c,
|
|
394
394
|
// ToDo: Figure out why imageMode is not in the response, and delete default value
|
|
395
395
|
imageMode: h,
|
|
396
|
-
answerTimeExpired:
|
|
397
|
-
questionStatus:
|
|
396
|
+
answerTimeExpired: A,
|
|
397
|
+
questionStatus: S,
|
|
398
398
|
isLoading: N,
|
|
399
|
-
questionType:
|
|
400
|
-
correct:
|
|
399
|
+
questionType: T,
|
|
400
|
+
correct: D,
|
|
401
401
|
hasCorrectAnswer: a
|
|
402
|
-
} = e, l = nn(e), d = sn({ questionType:
|
|
402
|
+
} = e, l = nn(e), d = sn({ questionType: T, questionVoted: c, correct: D, hasCorrectAnswer: a, questionStatus: S }), g = S === w.RESOLVED && T === x.PREDICTION, f = c || g;
|
|
403
403
|
return /* @__PURE__ */ m(
|
|
404
404
|
qt,
|
|
405
405
|
{
|
|
406
406
|
value: n,
|
|
407
407
|
"data-selected": I,
|
|
408
408
|
"data-answerState": l,
|
|
409
|
-
disabled: c || N ||
|
|
409
|
+
disabled: c || N || A || g,
|
|
410
410
|
"data-isNotChecked": c && !I && l !== "incorrect",
|
|
411
411
|
onClick: p,
|
|
412
412
|
children: [
|
|
413
|
-
/* @__PURE__ */ s(Yt, { "data-answerState": l, style: { width: `${
|
|
413
|
+
/* @__PURE__ */ s(Yt, { "data-answerState": l, style: { width: `${f ? u : 0}%` } }),
|
|
414
414
|
/* @__PURE__ */ m(Wt, { children: [
|
|
415
415
|
i && h && ((t = ce[h]) == null ? void 0 : t.call(ce, i)),
|
|
416
416
|
/* @__PURE__ */ s(Jt, { children: o }),
|
|
417
|
-
|
|
417
|
+
f && /* @__PURE__ */ m(Kt, { children: [
|
|
418
418
|
d && /* @__PURE__ */ s(tn, { name: "selected" }),
|
|
419
419
|
/* @__PURE__ */ s(Xt, { children: /* @__PURE__ */ s(Ae, { value: u, suffix: "%" }) })
|
|
420
420
|
] })
|
|
@@ -422,11 +422,11 @@ const Ye = /* @__PURE__ */ r("div")({
|
|
|
422
422
|
]
|
|
423
423
|
}
|
|
424
424
|
);
|
|
425
|
-
}, rn = [
|
|
425
|
+
}, rn = [b.PRIMARY_GREEN1, b.SECONDARY_RED1, b.SECONDARY_RED1, b.NEUTRALS_GRAY3], an = [10, 10, 1, 0], ln = /* @__PURE__ */ r("div")({
|
|
426
426
|
name: "RemainingTime",
|
|
427
427
|
class: "r165427",
|
|
428
428
|
propsAsIs: !1
|
|
429
|
-
}), cn =
|
|
429
|
+
}), cn = b.SECONDARY_GREEN6, de = b.SECONDARY_RED3, dn = b.NEUTRALS_GRAY3, un = ({
|
|
430
430
|
isPlaying: e = !0,
|
|
431
431
|
duration: t = 30,
|
|
432
432
|
onTimerExpired: n
|
|
@@ -465,7 +465,7 @@ const Ye = /* @__PURE__ */ r("div")({
|
|
|
465
465
|
name: "Title",
|
|
466
466
|
class: "t1l3ucjp",
|
|
467
467
|
propsAsIs: !1
|
|
468
|
-
}), hn = () =>
|
|
468
|
+
}), hn = () => j, gn = /* @__PURE__ */ r(hn())({
|
|
469
469
|
name: "WinIcon",
|
|
470
470
|
class: "wx7j799",
|
|
471
471
|
propsAsIs: !0
|
|
@@ -492,7 +492,7 @@ const Ye = /* @__PURE__ */ r("div")({
|
|
|
492
492
|
}) => /* @__PURE__ */ m(pn, { children: [
|
|
493
493
|
/* @__PURE__ */ m(mn, { children: [
|
|
494
494
|
e && /* @__PURE__ */ s(In, { children: e }),
|
|
495
|
-
t !== void 0 && o !==
|
|
495
|
+
t !== void 0 && o !== x.POLL && /* @__PURE__ */ m($, { children: [
|
|
496
496
|
/* @__PURE__ */ s(gn, { name: "icon-trophy" }),
|
|
497
497
|
/* @__PURE__ */ m(fn, { children: [
|
|
498
498
|
/* @__PURE__ */ s(Mn, { children: /* @__PURE__ */ s(Ae, { value: t }) }),
|
|
@@ -503,43 +503,51 @@ const Ye = /* @__PURE__ */ r("div")({
|
|
|
503
503
|
i && /* @__PURE__ */ s(un, { isPlaying: n, onTimerExpired: p, duration: u })
|
|
504
504
|
] }), yn = ({ openedQuestion: e, isLoading: t, vote: n, close: i }) => {
|
|
505
505
|
var o, u;
|
|
506
|
-
const p = e.subject, I = e.type, c = (o = e.options) == null ? void 0 : o.options, [h,
|
|
506
|
+
const p = e.subject, I = e.type, c = (o = e.options) == null ? void 0 : o.options, [h, A] = V(!1), [S, N] = V(""), T = e == null ? void 0 : e.id, D = F(
|
|
507
507
|
async (v) => {
|
|
508
|
-
if (
|
|
509
|
-
const
|
|
510
|
-
N(
|
|
508
|
+
if (T) {
|
|
509
|
+
const O = v.currentTarget.value;
|
|
510
|
+
N(O), await n(T, O);
|
|
511
511
|
}
|
|
512
512
|
},
|
|
513
|
-
[
|
|
513
|
+
[T, N, n]
|
|
514
514
|
), a = F(() => {
|
|
515
|
-
|
|
516
|
-
}, [i]), l =
|
|
515
|
+
A(!0), setTimeout(i, 3e3);
|
|
516
|
+
}, [i]), l = L(
|
|
517
517
|
() => e == null ? void 0 : e.answers.find((v) => v.youVoted === !0),
|
|
518
518
|
[e]
|
|
519
|
-
), d =
|
|
519
|
+
), d = L(
|
|
520
520
|
() => !!(e != null && e.answers.find((v) => v.correct === !0)),
|
|
521
521
|
[e]
|
|
522
|
-
), g =
|
|
523
|
-
|
|
522
|
+
), g = L(
|
|
523
|
+
() => e == null ? void 0 : e.answers.find((v) => v.correct === !0),
|
|
524
|
+
[e]
|
|
525
|
+
), f = L(() => e ? e.answers.map((v) => {
|
|
526
|
+
var O;
|
|
524
527
|
return {
|
|
525
528
|
...v,
|
|
526
529
|
questionVoted: !!l,
|
|
527
|
-
youSelected:
|
|
530
|
+
youSelected: S === v.id,
|
|
528
531
|
isLoading: t,
|
|
529
532
|
hasCorrectAnswer: d,
|
|
530
533
|
questionType: e.type,
|
|
531
534
|
answerTimeExpired: h,
|
|
532
535
|
questionStatus: e.status,
|
|
533
|
-
imageMode: (
|
|
536
|
+
imageMode: (O = e.appearance) == null ? void 0 : O.images,
|
|
534
537
|
// ToDo: Figure out why imageMode is not in the response
|
|
535
|
-
onVote:
|
|
538
|
+
onVote: D
|
|
536
539
|
};
|
|
537
|
-
}) : [], [d, h, t, e, l,
|
|
540
|
+
}) : [], [d, h, t, e, l, D, S]), z = c && (c.case === "trivia" || c.case === "prediction") ? c.value : void 0, M = L(() => {
|
|
541
|
+
if (e.status === w.RESOLVED)
|
|
542
|
+
return 0;
|
|
543
|
+
if (!h)
|
|
544
|
+
return l ? l.correct ? l.points : 0 : g == null ? void 0 : g.points;
|
|
545
|
+
}, [h, l, g, e.status]), y = L(() => h ? "Time expired" : e.type === x.POLL ? "Time remaining" : l ? "You won" : "To win", [h, e.type, l]);
|
|
538
546
|
return /* @__PURE__ */ s(te, { "data-question-header": "true", children: /* @__PURE__ */ s(Qt, { children: /* @__PURE__ */ m(Ut, { children: [
|
|
539
|
-
|
|
547
|
+
z && /* @__PURE__ */ s(
|
|
540
548
|
Rt,
|
|
541
549
|
{
|
|
542
|
-
feedbackMessages:
|
|
550
|
+
feedbackMessages: z,
|
|
543
551
|
questionVoted: !!l,
|
|
544
552
|
questionVotedCorrectly: l == null ? void 0 : l.correct,
|
|
545
553
|
questionType: I,
|
|
@@ -547,11 +555,11 @@ const Ye = /* @__PURE__ */ r("div")({
|
|
|
547
555
|
questionStatus: e.status
|
|
548
556
|
}
|
|
549
557
|
),
|
|
550
|
-
e.type !==
|
|
558
|
+
e.type !== x.PREDICTION && /* @__PURE__ */ s(
|
|
551
559
|
Nn,
|
|
552
560
|
{
|
|
553
|
-
title:
|
|
554
|
-
points:
|
|
561
|
+
title: y,
|
|
562
|
+
points: M,
|
|
555
563
|
onTimerExpired: a,
|
|
556
564
|
questionType: e.type,
|
|
557
565
|
isTimer: !t,
|
|
@@ -560,14 +568,14 @@ const Ye = /* @__PURE__ */ r("div")({
|
|
|
560
568
|
}
|
|
561
569
|
),
|
|
562
570
|
h ? /* @__PURE__ */ s(
|
|
563
|
-
|
|
571
|
+
Ct,
|
|
564
572
|
{
|
|
565
573
|
title: "More to come...",
|
|
566
574
|
description: "Watch for additional enhanced stream interactive experience."
|
|
567
575
|
}
|
|
568
|
-
) : /* @__PURE__ */ m(
|
|
569
|
-
/* @__PURE__ */ s(_t, { "data-isPrediction": e.type ===
|
|
570
|
-
/* @__PURE__ */ s(Pt, { children:
|
|
576
|
+
) : /* @__PURE__ */ m($, { children: [
|
|
577
|
+
/* @__PURE__ */ s(_t, { "data-isPrediction": e.type === x.PREDICTION, children: p }),
|
|
578
|
+
/* @__PURE__ */ s(Pt, { children: f.map((v) => /* @__PURE__ */ s(on, { ...v }, v.id)) })
|
|
571
579
|
] })
|
|
572
580
|
] }) }) });
|
|
573
581
|
}, An = /* @__PURE__ */ r("div")({
|
|
@@ -595,7 +603,7 @@ const Ye = /* @__PURE__ */ r("div")({
|
|
|
595
603
|
class: "i1gfjeu5",
|
|
596
604
|
propsAsIs: !1
|
|
597
605
|
}), Oe = ({ created: e, image: t, title: n, instantView: i }) => {
|
|
598
|
-
const o =
|
|
606
|
+
const o = L(() => {
|
|
599
607
|
if (e) {
|
|
600
608
|
const p = new Date(e);
|
|
601
609
|
if (Xe(p))
|
|
@@ -627,25 +635,25 @@ const Ye = /* @__PURE__ */ r("div")({
|
|
|
627
635
|
name: "WebLinkBtn",
|
|
628
636
|
class: "w19zie3h",
|
|
629
637
|
propsAsIs: !1
|
|
630
|
-
}),
|
|
638
|
+
}), kn = ({ instantView: e, ...t }) => /* @__PURE__ */ m(On, { children: [
|
|
631
639
|
/* @__PURE__ */ s(Oe, { instantView: e, ...t }),
|
|
632
640
|
(e == null ? void 0 : e.webLink) && /* @__PURE__ */ m(jn, { href: e == null ? void 0 : e.webLink.url, target: "_blank", children: [
|
|
633
641
|
"Explore more of the Masters History",
|
|
634
|
-
/* @__PURE__ */ s(
|
|
642
|
+
/* @__PURE__ */ s(j, { name: "icon-external-link" })
|
|
635
643
|
] })
|
|
636
|
-
] }),
|
|
644
|
+
] }), Cn = /* @__PURE__ */ r("div")({
|
|
637
645
|
name: "QuestionContainer",
|
|
638
646
|
class: "qdri6g3",
|
|
639
647
|
propsAsIs: !1
|
|
640
|
-
}),
|
|
648
|
+
}), Ln = ({
|
|
641
649
|
openedQuestion: e
|
|
642
650
|
}) => {
|
|
643
651
|
var t;
|
|
644
|
-
return ((t = e == null ? void 0 : e.attributes) == null ? void 0 : t.attributes.case) === "insight" ? /* @__PURE__ */ s(
|
|
652
|
+
return ((t = e == null ? void 0 : e.attributes) == null ? void 0 : t.attributes.case) === "insight" ? /* @__PURE__ */ s(kn, {
|
|
645
653
|
created: e.attributes.created,
|
|
646
654
|
...e.attributes.attributes.value
|
|
647
655
|
}) : null;
|
|
648
|
-
},
|
|
656
|
+
}, bn = ({
|
|
649
657
|
extendedQuestion: e,
|
|
650
658
|
vote: t,
|
|
651
659
|
close: n
|
|
@@ -660,23 +668,23 @@ const Ye = /* @__PURE__ */ r("div")({
|
|
|
660
668
|
openedQuestion: o,
|
|
661
669
|
isLoading: !!i
|
|
662
670
|
}) : null;
|
|
663
|
-
},
|
|
671
|
+
}, wn = ({
|
|
664
672
|
gamification: e
|
|
665
673
|
}) => {
|
|
666
674
|
var t;
|
|
667
|
-
const n =
|
|
675
|
+
const n = C(e.openedQuestion.$store), i = C(e.openedQuestion.$extendedStore);
|
|
668
676
|
if (!n)
|
|
669
677
|
return null;
|
|
670
678
|
const o = n.type;
|
|
671
|
-
return /* @__PURE__ */ m(
|
|
679
|
+
return /* @__PURE__ */ m(Cn, {
|
|
672
680
|
children: [/* @__PURE__ */ s(Te, {
|
|
673
681
|
close: e.closeQuestion,
|
|
674
|
-
type: ((t = n.attributes) == null ? void 0 : t.type) ||
|
|
675
|
-
}), o === "question" && /* @__PURE__ */ s(
|
|
682
|
+
type: ((t = n.attributes) == null ? void 0 : t.type) || x.UNSET
|
|
683
|
+
}), o === "question" && /* @__PURE__ */ s(bn, {
|
|
676
684
|
vote: e.submitAnswer,
|
|
677
685
|
close: e.closeQuestion,
|
|
678
686
|
extendedQuestion: i
|
|
679
|
-
}), o !== "question" && /* @__PURE__ */ s(
|
|
687
|
+
}), o !== "question" && /* @__PURE__ */ s(Ln, {
|
|
680
688
|
openedQuestion: n
|
|
681
689
|
}), /* @__PURE__ */ s(xt, {
|
|
682
690
|
sponsorLogo: ""
|
|
@@ -754,7 +762,7 @@ function qn(e, t) {
|
|
|
754
762
|
return !1;
|
|
755
763
|
return !0;
|
|
756
764
|
}
|
|
757
|
-
function
|
|
765
|
+
function Z(e, t) {
|
|
758
766
|
t === void 0 && (t = qn);
|
|
759
767
|
var n, i = [], o, u = !1;
|
|
760
768
|
function p() {
|
|
@@ -790,94 +798,94 @@ function ge(e) {
|
|
|
790
798
|
}
|
|
791
799
|
return J;
|
|
792
800
|
}
|
|
793
|
-
var
|
|
801
|
+
var E = null;
|
|
794
802
|
function fe(e) {
|
|
795
|
-
if (e === void 0 && (e = !1),
|
|
803
|
+
if (e === void 0 && (e = !1), E === null || e) {
|
|
796
804
|
var t = document.createElement("div"), n = t.style;
|
|
797
805
|
n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
|
|
798
806
|
var i = document.createElement("div"), o = i.style;
|
|
799
|
-
return o.width = "100px", o.height = "100px", t.appendChild(i), document.body.appendChild(t), t.scrollLeft > 0 ?
|
|
807
|
+
return o.width = "100px", o.height = "100px", t.appendChild(i), document.body.appendChild(t), t.scrollLeft > 0 ? E = "positive-descending" : (t.scrollLeft = 1, t.scrollLeft === 0 ? E = "negative" : E = "positive-ascending"), document.body.removeChild(t), E;
|
|
800
808
|
}
|
|
801
|
-
return
|
|
809
|
+
return E;
|
|
802
810
|
}
|
|
803
811
|
var Vn = 150, Fn = function(t, n) {
|
|
804
812
|
return t;
|
|
805
813
|
};
|
|
806
814
|
function Bn(e) {
|
|
807
|
-
var t, n = e.getItemOffset, i = e.getEstimatedTotalSize, o = e.getItemSize, u = e.getOffsetForIndexAndAlignment, p = e.getStartIndexForOffset, I = e.getStopIndexForStartIndex, c = e.initInstanceProps, h = e.shouldResetStyleCacheOnItemSizeChange,
|
|
808
|
-
return t = /* @__PURE__ */ function(
|
|
809
|
-
_n(N,
|
|
810
|
-
function N(
|
|
815
|
+
var t, n = e.getItemOffset, i = e.getEstimatedTotalSize, o = e.getItemSize, u = e.getOffsetForIndexAndAlignment, p = e.getStartIndexForOffset, I = e.getStopIndexForStartIndex, c = e.initInstanceProps, h = e.shouldResetStyleCacheOnItemSizeChange, A = e.validateProps;
|
|
816
|
+
return t = /* @__PURE__ */ function(S) {
|
|
817
|
+
_n(N, S);
|
|
818
|
+
function N(D) {
|
|
811
819
|
var a;
|
|
812
|
-
return a =
|
|
820
|
+
return a = S.call(this, D) || this, a._instanceProps = c(a.props, pe(a)), a._outerRef = void 0, a._resetIsScrollingTimeoutId = null, a.state = {
|
|
813
821
|
instance: pe(a),
|
|
814
822
|
isScrolling: !1,
|
|
815
823
|
scrollDirection: "forward",
|
|
816
824
|
scrollOffset: typeof a.props.initialScrollOffset == "number" ? a.props.initialScrollOffset : 0,
|
|
817
825
|
scrollUpdateWasRequested: !1
|
|
818
|
-
}, a._callOnItemsRendered = void 0, a._callOnItemsRendered =
|
|
826
|
+
}, a._callOnItemsRendered = void 0, a._callOnItemsRendered = Z(function(l, d, g, f) {
|
|
819
827
|
return a.props.onItemsRendered({
|
|
820
828
|
overscanStartIndex: l,
|
|
821
829
|
overscanStopIndex: d,
|
|
822
830
|
visibleStartIndex: g,
|
|
823
|
-
visibleStopIndex:
|
|
831
|
+
visibleStopIndex: f
|
|
824
832
|
});
|
|
825
|
-
}), a._callOnScroll = void 0, a._callOnScroll =
|
|
833
|
+
}), a._callOnScroll = void 0, a._callOnScroll = Z(function(l, d, g) {
|
|
826
834
|
return a.props.onScroll({
|
|
827
835
|
scrollDirection: l,
|
|
828
836
|
scrollOffset: d,
|
|
829
837
|
scrollUpdateWasRequested: g
|
|
830
838
|
});
|
|
831
839
|
}), a._getItemStyle = void 0, a._getItemStyle = function(l) {
|
|
832
|
-
var d = a.props, g = d.direction,
|
|
833
|
-
if (
|
|
834
|
-
|
|
840
|
+
var d = a.props, g = d.direction, f = d.itemSize, z = d.layout, M = a._getItemStyleCache(h && f, h && z, h && g), y;
|
|
841
|
+
if (M.hasOwnProperty(l))
|
|
842
|
+
y = M[l];
|
|
835
843
|
else {
|
|
836
|
-
var
|
|
837
|
-
|
|
844
|
+
var v = n(a.props, l, a._instanceProps), O = o(a.props, l, a._instanceProps), k = g === "horizontal" || z === "horizontal", U = g === "rtl", _ = k ? v : 0;
|
|
845
|
+
M[l] = y = {
|
|
838
846
|
position: "absolute",
|
|
839
|
-
left:
|
|
840
|
-
right:
|
|
841
|
-
top:
|
|
842
|
-
height:
|
|
843
|
-
width:
|
|
847
|
+
left: U ? void 0 : _,
|
|
848
|
+
right: U ? _ : void 0,
|
|
849
|
+
top: k ? 0 : v,
|
|
850
|
+
height: k ? "100%" : O,
|
|
851
|
+
width: k ? O : "100%"
|
|
844
852
|
};
|
|
845
853
|
}
|
|
846
|
-
return
|
|
847
|
-
}, a._getItemStyleCache = void 0, a._getItemStyleCache =
|
|
854
|
+
return y;
|
|
855
|
+
}, a._getItemStyleCache = void 0, a._getItemStyleCache = Z(function(l, d, g) {
|
|
848
856
|
return {};
|
|
849
857
|
}), a._onScrollHorizontal = function(l) {
|
|
850
|
-
var d = l.currentTarget, g = d.clientWidth,
|
|
851
|
-
a.setState(function(
|
|
852
|
-
if (
|
|
858
|
+
var d = l.currentTarget, g = d.clientWidth, f = d.scrollLeft, z = d.scrollWidth;
|
|
859
|
+
a.setState(function(M) {
|
|
860
|
+
if (M.scrollOffset === f)
|
|
853
861
|
return null;
|
|
854
|
-
var
|
|
855
|
-
if (
|
|
862
|
+
var y = a.props.direction, v = f;
|
|
863
|
+
if (y === "rtl")
|
|
856
864
|
switch (fe()) {
|
|
857
865
|
case "negative":
|
|
858
|
-
|
|
866
|
+
v = -f;
|
|
859
867
|
break;
|
|
860
868
|
case "positive-descending":
|
|
861
|
-
|
|
869
|
+
v = z - g - f;
|
|
862
870
|
break;
|
|
863
871
|
}
|
|
864
|
-
return
|
|
872
|
+
return v = Math.max(0, Math.min(v, z - g)), {
|
|
865
873
|
isScrolling: !0,
|
|
866
|
-
scrollDirection:
|
|
867
|
-
scrollOffset:
|
|
874
|
+
scrollDirection: M.scrollOffset < f ? "forward" : "backward",
|
|
875
|
+
scrollOffset: v,
|
|
868
876
|
scrollUpdateWasRequested: !1
|
|
869
877
|
};
|
|
870
878
|
}, a._resetIsScrollingDebounced);
|
|
871
879
|
}, a._onScrollVertical = function(l) {
|
|
872
|
-
var d = l.currentTarget, g = d.clientHeight,
|
|
873
|
-
a.setState(function(
|
|
874
|
-
if (
|
|
880
|
+
var d = l.currentTarget, g = d.clientHeight, f = d.scrollHeight, z = d.scrollTop;
|
|
881
|
+
a.setState(function(M) {
|
|
882
|
+
if (M.scrollOffset === z)
|
|
875
883
|
return null;
|
|
876
|
-
var
|
|
884
|
+
var y = Math.max(0, Math.min(z, f - g));
|
|
877
885
|
return {
|
|
878
886
|
isScrolling: !0,
|
|
879
|
-
scrollDirection:
|
|
880
|
-
scrollOffset:
|
|
887
|
+
scrollDirection: M.scrollOffset < y ? "forward" : "backward",
|
|
888
|
+
scrollOffset: y,
|
|
881
889
|
scrollUpdateWasRequested: !1
|
|
882
890
|
};
|
|
883
891
|
}, a._resetIsScrollingDebounced);
|
|
@@ -895,10 +903,10 @@ function Bn(e) {
|
|
|
895
903
|
}, a;
|
|
896
904
|
}
|
|
897
905
|
N.getDerivedStateFromProps = function(a, l) {
|
|
898
|
-
return Hn(a, l),
|
|
906
|
+
return Hn(a, l), A(a), null;
|
|
899
907
|
};
|
|
900
|
-
var
|
|
901
|
-
return
|
|
908
|
+
var T = N.prototype;
|
|
909
|
+
return T.scrollTo = function(a) {
|
|
902
910
|
a = Math.max(0, a), this.setState(function(l) {
|
|
903
911
|
return l.scrollOffset === a ? null : {
|
|
904
912
|
scrollDirection: l.scrollOffset < a ? "forward" : "backward",
|
|
@@ -906,101 +914,101 @@ function Bn(e) {
|
|
|
906
914
|
scrollUpdateWasRequested: !0
|
|
907
915
|
};
|
|
908
916
|
}, this._resetIsScrollingDebounced);
|
|
909
|
-
},
|
|
917
|
+
}, T.scrollToItem = function(a, l) {
|
|
910
918
|
l === void 0 && (l = "auto");
|
|
911
|
-
var d = this.props, g = d.itemCount,
|
|
919
|
+
var d = this.props, g = d.itemCount, f = d.layout, z = this.state.scrollOffset;
|
|
912
920
|
a = Math.max(0, Math.min(a, g - 1));
|
|
913
|
-
var
|
|
921
|
+
var M = 0;
|
|
914
922
|
if (this._outerRef) {
|
|
915
|
-
var
|
|
916
|
-
|
|
923
|
+
var y = this._outerRef;
|
|
924
|
+
f === "vertical" ? M = y.scrollWidth > y.clientWidth ? ge() : 0 : M = y.scrollHeight > y.clientHeight ? ge() : 0;
|
|
917
925
|
}
|
|
918
|
-
this.scrollTo(u(this.props, a, l,
|
|
919
|
-
},
|
|
926
|
+
this.scrollTo(u(this.props, a, l, z, this._instanceProps, M));
|
|
927
|
+
}, T.componentDidMount = function() {
|
|
920
928
|
var a = this.props, l = a.direction, d = a.initialScrollOffset, g = a.layout;
|
|
921
929
|
if (typeof d == "number" && this._outerRef != null) {
|
|
922
|
-
var
|
|
923
|
-
l === "horizontal" || g === "horizontal" ?
|
|
930
|
+
var f = this._outerRef;
|
|
931
|
+
l === "horizontal" || g === "horizontal" ? f.scrollLeft = d : f.scrollTop = d;
|
|
924
932
|
}
|
|
925
933
|
this._callPropsCallbacks();
|
|
926
|
-
},
|
|
927
|
-
var a = this.props, l = a.direction, d = a.layout, g = this.state,
|
|
928
|
-
if (
|
|
929
|
-
var
|
|
934
|
+
}, T.componentDidUpdate = function() {
|
|
935
|
+
var a = this.props, l = a.direction, d = a.layout, g = this.state, f = g.scrollOffset, z = g.scrollUpdateWasRequested;
|
|
936
|
+
if (z && this._outerRef != null) {
|
|
937
|
+
var M = this._outerRef;
|
|
930
938
|
if (l === "horizontal" || d === "horizontal")
|
|
931
939
|
if (l === "rtl")
|
|
932
940
|
switch (fe()) {
|
|
933
941
|
case "negative":
|
|
934
|
-
|
|
942
|
+
M.scrollLeft = -f;
|
|
935
943
|
break;
|
|
936
944
|
case "positive-ascending":
|
|
937
|
-
|
|
945
|
+
M.scrollLeft = f;
|
|
938
946
|
break;
|
|
939
947
|
default:
|
|
940
|
-
var
|
|
941
|
-
|
|
948
|
+
var y = M.clientWidth, v = M.scrollWidth;
|
|
949
|
+
M.scrollLeft = v - y - f;
|
|
942
950
|
break;
|
|
943
951
|
}
|
|
944
952
|
else
|
|
945
|
-
|
|
953
|
+
M.scrollLeft = f;
|
|
946
954
|
else
|
|
947
|
-
|
|
955
|
+
M.scrollTop = f;
|
|
948
956
|
}
|
|
949
957
|
this._callPropsCallbacks();
|
|
950
|
-
},
|
|
958
|
+
}, T.componentWillUnmount = function() {
|
|
951
959
|
this._resetIsScrollingTimeoutId !== null && he(this._resetIsScrollingTimeoutId);
|
|
952
|
-
},
|
|
953
|
-
var a = this.props, l = a.children, d = a.className, g = a.direction,
|
|
954
|
-
if (
|
|
955
|
-
for (var
|
|
960
|
+
}, T.render = function() {
|
|
961
|
+
var a = this.props, l = a.children, d = a.className, g = a.direction, f = a.height, z = a.innerRef, M = a.innerElementType, y = a.innerTagName, v = a.itemCount, O = a.itemData, k = a.itemKey, U = k === void 0 ? Fn : k, _ = a.layout, je = a.outerElementType, ke = a.outerTagName, Ce = a.style, Le = a.useIsScrolling, be = a.width, ne = this.state.isScrolling, B = g === "horizontal" || _ === "horizontal", we = B ? this._onScrollHorizontal : this._onScrollVertical, se = this._getRangeToRender(), Ee = se[0], $e = se[1], ie = [];
|
|
962
|
+
if (v > 0)
|
|
963
|
+
for (var R = Ee; R <= $e; R++)
|
|
956
964
|
ie.push(H(l, {
|
|
957
|
-
data:
|
|
958
|
-
key:
|
|
959
|
-
index:
|
|
960
|
-
isScrolling:
|
|
961
|
-
style: this._getItemStyle(
|
|
965
|
+
data: O,
|
|
966
|
+
key: U(R, O),
|
|
967
|
+
index: R,
|
|
968
|
+
isScrolling: Le ? ne : void 0,
|
|
969
|
+
style: this._getItemStyle(R)
|
|
962
970
|
}));
|
|
963
971
|
var oe = i(this.props, this._instanceProps);
|
|
964
|
-
return H(je ||
|
|
972
|
+
return H(je || ke || "div", {
|
|
965
973
|
className: d,
|
|
966
|
-
onScroll:
|
|
974
|
+
onScroll: we,
|
|
967
975
|
ref: this._outerRefSetter,
|
|
968
976
|
style: X({
|
|
969
977
|
position: "relative",
|
|
970
|
-
height:
|
|
971
|
-
width:
|
|
978
|
+
height: f,
|
|
979
|
+
width: be,
|
|
972
980
|
overflow: "auto",
|
|
973
981
|
WebkitOverflowScrolling: "touch",
|
|
974
982
|
willChange: "transform",
|
|
975
983
|
direction: g
|
|
976
|
-
},
|
|
977
|
-
}, H(
|
|
984
|
+
}, Ce)
|
|
985
|
+
}, H(M || y || "div", {
|
|
978
986
|
children: ie,
|
|
979
|
-
ref:
|
|
987
|
+
ref: z,
|
|
980
988
|
style: {
|
|
981
989
|
height: B ? "100%" : oe,
|
|
982
990
|
pointerEvents: ne ? "none" : void 0,
|
|
983
991
|
width: B ? oe : "100%"
|
|
984
992
|
}
|
|
985
993
|
}));
|
|
986
|
-
},
|
|
994
|
+
}, T._callPropsCallbacks = function() {
|
|
987
995
|
if (typeof this.props.onItemsRendered == "function") {
|
|
988
996
|
var a = this.props.itemCount;
|
|
989
997
|
if (a > 0) {
|
|
990
|
-
var l = this._getRangeToRender(), d = l[0], g = l[1],
|
|
991
|
-
this._callOnItemsRendered(d, g,
|
|
998
|
+
var l = this._getRangeToRender(), d = l[0], g = l[1], f = l[2], z = l[3];
|
|
999
|
+
this._callOnItemsRendered(d, g, f, z);
|
|
992
1000
|
}
|
|
993
1001
|
}
|
|
994
1002
|
if (typeof this.props.onScroll == "function") {
|
|
995
|
-
var
|
|
996
|
-
this._callOnScroll(
|
|
1003
|
+
var M = this.state, y = M.scrollDirection, v = M.scrollOffset, O = M.scrollUpdateWasRequested;
|
|
1004
|
+
this._callOnScroll(y, v, O);
|
|
997
1005
|
}
|
|
998
|
-
},
|
|
999
|
-
var a = this.props, l = a.itemCount, d = a.overscanCount, g = this.state,
|
|
1006
|
+
}, T._getRangeToRender = function() {
|
|
1007
|
+
var a = this.props, l = a.itemCount, d = a.overscanCount, g = this.state, f = g.isScrolling, z = g.scrollDirection, M = g.scrollOffset;
|
|
1000
1008
|
if (l === 0)
|
|
1001
1009
|
return [0, 0, 0, 0];
|
|
1002
|
-
var
|
|
1003
|
-
return [Math.max(0,
|
|
1010
|
+
var y = p(this.props, M, this._instanceProps), v = I(this.props, y, M, this._instanceProps), O = !f || z === "backward" ? Math.max(1, d) : 1, k = !f || z === "forward" ? Math.max(1, d) : 1;
|
|
1011
|
+
return [Math.max(0, y - O), Math.max(0, Math.min(l - 1, v + k)), y, v];
|
|
1004
1012
|
}, N;
|
|
1005
1013
|
}(ye), t.defaultProps = {
|
|
1006
1014
|
direction: "ltr",
|
|
@@ -1012,7 +1020,7 @@ function Bn(e) {
|
|
|
1012
1020
|
}
|
|
1013
1021
|
var Hn = function(t, n) {
|
|
1014
1022
|
t.children, t.direction, t.height, t.layout, t.innerTagName, t.outerTagName, t.width, n.instance;
|
|
1015
|
-
},
|
|
1023
|
+
}, Gn = /* @__PURE__ */ Bn({
|
|
1016
1024
|
getItemOffset: function(t, n) {
|
|
1017
1025
|
var i = t.itemSize;
|
|
1018
1026
|
return n * i;
|
|
@@ -1026,15 +1034,15 @@ var Hn = function(t, n) {
|
|
|
1026
1034
|
return i * n;
|
|
1027
1035
|
},
|
|
1028
1036
|
getOffsetForIndexAndAlignment: function(t, n, i, o, u, p) {
|
|
1029
|
-
var I = t.direction, c = t.height, h = t.itemCount,
|
|
1030
|
-
switch (i === "smart" && (o >= d -
|
|
1037
|
+
var I = t.direction, c = t.height, h = t.itemCount, A = t.itemSize, S = t.layout, N = t.width, T = I === "horizontal" || S === "horizontal", D = T ? N : c, a = Math.max(0, h * A - D), l = Math.min(a, n * A), d = Math.max(0, n * A - D + A + p);
|
|
1038
|
+
switch (i === "smart" && (o >= d - D && o <= l + D ? i = "auto" : i = "center"), i) {
|
|
1031
1039
|
case "start":
|
|
1032
1040
|
return l;
|
|
1033
1041
|
case "end":
|
|
1034
1042
|
return d;
|
|
1035
1043
|
case "center": {
|
|
1036
1044
|
var g = Math.round(d + (l - d) / 2);
|
|
1037
|
-
return g < Math.ceil(
|
|
1045
|
+
return g < Math.ceil(D / 2) ? 0 : g > a + Math.floor(D / 2) ? a : g;
|
|
1038
1046
|
}
|
|
1039
1047
|
case "auto":
|
|
1040
1048
|
default:
|
|
@@ -1046,10 +1054,10 @@ var Hn = function(t, n) {
|
|
|
1046
1054
|
return Math.max(0, Math.min(i - 1, Math.floor(n / o)));
|
|
1047
1055
|
},
|
|
1048
1056
|
getStopIndexForStartIndex: function(t, n, i) {
|
|
1049
|
-
var o = t.direction, u = t.height, p = t.itemCount, I = t.itemSize, c = t.layout, h = t.width,
|
|
1057
|
+
var o = t.direction, u = t.height, p = t.itemCount, I = t.itemSize, c = t.layout, h = t.width, A = o === "horizontal" || c === "horizontal", S = n * I, N = A ? h : u, T = Math.ceil((N + i - S) / I);
|
|
1050
1058
|
return Math.max(0, Math.min(
|
|
1051
1059
|
p - 1,
|
|
1052
|
-
n +
|
|
1060
|
+
n + T - 1
|
|
1053
1061
|
// -1 is because stop index is inclusive
|
|
1054
1062
|
));
|
|
1055
1063
|
},
|
|
@@ -1060,25 +1068,25 @@ var Hn = function(t, n) {
|
|
|
1060
1068
|
t.itemSize;
|
|
1061
1069
|
}
|
|
1062
1070
|
});
|
|
1063
|
-
function
|
|
1071
|
+
function Zn(e) {
|
|
1064
1072
|
var t = e.lastRenderedStartIndex, n = e.lastRenderedStopIndex, i = e.startIndex, o = e.stopIndex;
|
|
1065
1073
|
return !(i > n || o < t);
|
|
1066
1074
|
}
|
|
1067
1075
|
function Jn(e) {
|
|
1068
1076
|
for (var t = e.isItemLoaded, n = e.itemCount, i = e.minimumBatchSize, o = e.startIndex, u = e.stopIndex, p = [], I = null, c = null, h = o; h <= u; h++) {
|
|
1069
|
-
var
|
|
1070
|
-
|
|
1077
|
+
var A = t(h);
|
|
1078
|
+
A ? c !== null && (p.push(I, c), I = c = null) : (c = h, I === null && (I = h));
|
|
1071
1079
|
}
|
|
1072
1080
|
if (c !== null) {
|
|
1073
|
-
for (var
|
|
1081
|
+
for (var S = Math.min(Math.max(c, I + i - 1), n - 1), N = c + 1; N <= S && !t(N); N++)
|
|
1074
1082
|
c = N;
|
|
1075
1083
|
p.push(I, c);
|
|
1076
1084
|
}
|
|
1077
1085
|
if (p.length)
|
|
1078
1086
|
for (; p[1] - p[0] + 1 < i && p[0] > 0; ) {
|
|
1079
|
-
var
|
|
1080
|
-
if (!t(
|
|
1081
|
-
p[0] =
|
|
1087
|
+
var T = p[0] - 1;
|
|
1088
|
+
if (!t(T))
|
|
1089
|
+
p[0] = T;
|
|
1082
1090
|
else
|
|
1083
1091
|
break;
|
|
1084
1092
|
}
|
|
@@ -1120,8 +1128,8 @@ var Kn = function(e, t) {
|
|
|
1120
1128
|
for (var p = arguments.length, I = Array(p), c = 0; c < p; c++)
|
|
1121
1129
|
I[c] = arguments[c];
|
|
1122
1130
|
return u = (i = (o = Me(this, (n = t.__proto__ || Object.getPrototypeOf(t)).call.apply(n, [this].concat(I))), o), o._lastRenderedStartIndex = -1, o._lastRenderedStopIndex = -1, o._memoizedUnloadedRanges = [], o._onItemsRendered = function(h) {
|
|
1123
|
-
var
|
|
1124
|
-
o._lastRenderedStartIndex =
|
|
1131
|
+
var A = h.visibleStartIndex, S = h.visibleStopIndex;
|
|
1132
|
+
o._lastRenderedStartIndex = A, o._lastRenderedStopIndex = S, o._ensureRowsLoaded(A, S);
|
|
1125
1133
|
}, o._setRef = function(h) {
|
|
1126
1134
|
o._listRef = h;
|
|
1127
1135
|
}, i), Me(o, u);
|
|
@@ -1148,32 +1156,32 @@ var Kn = function(e, t) {
|
|
|
1148
1156
|
}, {
|
|
1149
1157
|
key: "_ensureRowsLoaded",
|
|
1150
1158
|
value: function(i, o) {
|
|
1151
|
-
var u = this.props, p = u.isItemLoaded, I = u.itemCount, c = u.minimumBatchSize, h = c === void 0 ? 10 : c,
|
|
1159
|
+
var u = this.props, p = u.isItemLoaded, I = u.itemCount, c = u.minimumBatchSize, h = c === void 0 ? 10 : c, A = u.threshold, S = A === void 0 ? 15 : A, N = Jn({
|
|
1152
1160
|
isItemLoaded: p,
|
|
1153
1161
|
itemCount: I,
|
|
1154
1162
|
minimumBatchSize: h,
|
|
1155
|
-
startIndex: Math.max(0, i -
|
|
1156
|
-
stopIndex: Math.min(I - 1, o +
|
|
1163
|
+
startIndex: Math.max(0, i - S),
|
|
1164
|
+
stopIndex: Math.min(I - 1, o + S)
|
|
1157
1165
|
});
|
|
1158
|
-
(this._memoizedUnloadedRanges.length !== N.length || this._memoizedUnloadedRanges.some(function(
|
|
1159
|
-
return N[
|
|
1166
|
+
(this._memoizedUnloadedRanges.length !== N.length || this._memoizedUnloadedRanges.some(function(T, D) {
|
|
1167
|
+
return N[D] !== T;
|
|
1160
1168
|
})) && (this._memoizedUnloadedRanges = N, this._loadUnloadedRanges(N));
|
|
1161
1169
|
}
|
|
1162
1170
|
}, {
|
|
1163
1171
|
key: "_loadUnloadedRanges",
|
|
1164
1172
|
value: function(i) {
|
|
1165
1173
|
for (var o = this, u = this.props.loadMoreItems || this.props.loadMoreRows, p = function(h) {
|
|
1166
|
-
var
|
|
1174
|
+
var A = i[h], S = i[h + 1], N = u(A, S);
|
|
1167
1175
|
N != null && N.then(function() {
|
|
1168
|
-
if (
|
|
1176
|
+
if (Zn({
|
|
1169
1177
|
lastRenderedStartIndex: o._lastRenderedStartIndex,
|
|
1170
1178
|
lastRenderedStopIndex: o._lastRenderedStopIndex,
|
|
1171
|
-
startIndex:
|
|
1172
|
-
stopIndex:
|
|
1179
|
+
startIndex: A,
|
|
1180
|
+
stopIndex: S
|
|
1173
1181
|
})) {
|
|
1174
1182
|
if (o._listRef == null)
|
|
1175
1183
|
return;
|
|
1176
|
-
typeof o._listRef.resetAfterIndex == "function" ? o._listRef.resetAfterIndex(
|
|
1184
|
+
typeof o._listRef.resetAfterIndex == "function" ? o._listRef.resetAfterIndex(A, !0) : (typeof o._listRef._getItemStyleCache == "function" && o._listRef._getItemStyleCache(-1), o._listRef.forceUpdate());
|
|
1177
1185
|
}
|
|
1178
1186
|
});
|
|
1179
1187
|
}, I = 0; I < i.length; I += 2)
|
|
@@ -1209,7 +1217,7 @@ const ns = /* @__PURE__ */ r("div")({
|
|
|
1209
1217
|
name: "Name",
|
|
1210
1218
|
class: "njsrqgr",
|
|
1211
1219
|
propsAsIs: !1
|
|
1212
|
-
}), cs = () =>
|
|
1220
|
+
}), cs = () => j, ds = /* @__PURE__ */ r(cs())({
|
|
1213
1221
|
name: "CurrentUserBadge",
|
|
1214
1222
|
class: "c17uc4zr",
|
|
1215
1223
|
propsAsIs: !0
|
|
@@ -1247,7 +1255,7 @@ const ns = /* @__PURE__ */ r("div")({
|
|
|
1247
1255
|
itemCount: e.length + 1,
|
|
1248
1256
|
loadMoreItems: i,
|
|
1249
1257
|
children: ({ onItemsRendered: p, ref: I }) => /* @__PURE__ */ s(ps, { children: /* @__PURE__ */ s(
|
|
1250
|
-
|
|
1258
|
+
Gn,
|
|
1251
1259
|
{
|
|
1252
1260
|
itemSize: 56,
|
|
1253
1261
|
onItemsRendered: p,
|
|
@@ -1269,7 +1277,7 @@ const ns = /* @__PURE__ */ r("div")({
|
|
|
1269
1277
|
) })
|
|
1270
1278
|
}
|
|
1271
1279
|
) }), Is = ({ deepLink: e }) => {
|
|
1272
|
-
const { data: t } =
|
|
1280
|
+
const { data: t } = C(e.$store), n = t == null ? void 0 : t.url, i = e.desktopLink;
|
|
1273
1281
|
return /* @__PURE__ */ s(
|
|
1274
1282
|
Ue,
|
|
1275
1283
|
{
|
|
@@ -1291,7 +1299,7 @@ const ns = /* @__PURE__ */ r("div")({
|
|
|
1291
1299
|
}
|
|
1292
1300
|
);
|
|
1293
1301
|
}, hs = ({ gamification: e }) => {
|
|
1294
|
-
const { data: t } =
|
|
1302
|
+
const { data: t } = C(e.leaderboardList.$store);
|
|
1295
1303
|
return t != null && t.length ? /* @__PURE__ */ s(
|
|
1296
1304
|
ms,
|
|
1297
1305
|
{
|
|
@@ -1317,11 +1325,11 @@ const ns = /* @__PURE__ */ r("div")({
|
|
|
1317
1325
|
name: "QuestionAction",
|
|
1318
1326
|
class: "q105uluy",
|
|
1319
1327
|
propsAsIs: !1
|
|
1320
|
-
}), Ns = () =>
|
|
1328
|
+
}), Ns = () => j, Y = /* @__PURE__ */ r(Ns())({
|
|
1321
1329
|
name: "QuestionActionIcon",
|
|
1322
1330
|
class: "q1fa0b9h",
|
|
1323
1331
|
propsAsIs: !0
|
|
1324
|
-
}), ys = () =>
|
|
1332
|
+
}), ys = () => j, As = /* @__PURE__ */ r(ys())({
|
|
1325
1333
|
name: "QuestionTypeIcon",
|
|
1326
1334
|
class: "qxlt78s",
|
|
1327
1335
|
propsAsIs: !0
|
|
@@ -1338,10 +1346,10 @@ const ns = /* @__PURE__ */ r("div")({
|
|
|
1338
1346
|
class: "p1pba9p1",
|
|
1339
1347
|
propsAsIs: !1
|
|
1340
1348
|
}), zs = {
|
|
1341
|
-
[
|
|
1342
|
-
[
|
|
1343
|
-
[
|
|
1344
|
-
[
|
|
1349
|
+
[P.LOST]: /* @__PURE__ */ s(Y, { name: "incorrectVoted" }),
|
|
1350
|
+
[P.WON]: /* @__PURE__ */ s(Y, { name: "icon-check" }),
|
|
1351
|
+
[P.UNSET]: /* @__PURE__ */ s(Y, { name: "icon-arrow" }),
|
|
1352
|
+
[P.DNP]: /* @__PURE__ */ s(Y, { name: "icon-arrow" })
|
|
1345
1353
|
}, xs = ({
|
|
1346
1354
|
questionId: e,
|
|
1347
1355
|
questionType: t,
|
|
@@ -1358,14 +1366,14 @@ const ns = /* @__PURE__ */ r("div")({
|
|
|
1358
1366
|
/* @__PURE__ */ s(
|
|
1359
1367
|
As,
|
|
1360
1368
|
{
|
|
1361
|
-
"data-type-trivia": t ===
|
|
1362
|
-
"data-type-poll": t ===
|
|
1369
|
+
"data-type-trivia": t === x.TRIVIA,
|
|
1370
|
+
"data-type-poll": t === x.POLL,
|
|
1363
1371
|
name: I.iconName
|
|
1364
1372
|
}
|
|
1365
1373
|
),
|
|
1366
1374
|
/* @__PURE__ */ m(Ts, { children: [
|
|
1367
1375
|
I.label,
|
|
1368
|
-
t ===
|
|
1376
|
+
t === x.TRIVIA && n === w.RESOLVED && " • Expired"
|
|
1369
1377
|
] })
|
|
1370
1378
|
] }),
|
|
1371
1379
|
/* @__PURE__ */ s(Ms, { children: i || "" })
|
|
@@ -1380,18 +1388,18 @@ const ns = /* @__PURE__ */ r("div")({
|
|
|
1380
1388
|
name: "ActionBtn",
|
|
1381
1389
|
class: "a10g1iik",
|
|
1382
1390
|
propsAsIs: !1
|
|
1383
|
-
}),
|
|
1391
|
+
}), ks = ({
|
|
1384
1392
|
openInsight: e,
|
|
1385
1393
|
questionId: t,
|
|
1386
1394
|
...n
|
|
1387
1395
|
}) => /* @__PURE__ */ m(Os, { children: [
|
|
1388
1396
|
/* @__PURE__ */ s(Oe, { questionId: t, ...n }),
|
|
1389
1397
|
e && /* @__PURE__ */ s(js, { onClick: () => e(t), children: "View Insight" })
|
|
1390
|
-
] }),
|
|
1398
|
+
] }), Cs = /* @__PURE__ */ r("div")({
|
|
1391
1399
|
name: "QuestionsContainer",
|
|
1392
1400
|
class: "qvghv3l",
|
|
1393
1401
|
propsAsIs: !1
|
|
1394
|
-
}),
|
|
1402
|
+
}), Ls = ({ questions: e, openQuestion: t }) => /* @__PURE__ */ s(Cs, { children: e == null ? void 0 : e.map((n) => {
|
|
1395
1403
|
var i, o;
|
|
1396
1404
|
if (n.type === "question" && ((i = n.attributes) == null ? void 0 : i.attributes.case) === "question") {
|
|
1397
1405
|
const u = n.attributes.attributes.value;
|
|
@@ -1399,15 +1407,15 @@ const ns = /* @__PURE__ */ r("div")({
|
|
|
1399
1407
|
}
|
|
1400
1408
|
if (n.type === "insight" && ((o = n.attributes) == null ? void 0 : o.attributes.case) === "insight") {
|
|
1401
1409
|
const u = n.attributes.attributes.value;
|
|
1402
|
-
return /* @__PURE__ */ s(
|
|
1410
|
+
return /* @__PURE__ */ s(ks, { openInsight: t, ...u }, u.questionId);
|
|
1403
1411
|
}
|
|
1404
1412
|
return null;
|
|
1405
|
-
}) }),
|
|
1406
|
-
const n =
|
|
1407
|
-
return n != null && n.data ? /* @__PURE__ */ s(
|
|
1408
|
-
},
|
|
1413
|
+
}) }), bs = ({ store: e, openQuestion: t }) => {
|
|
1414
|
+
const n = C(e);
|
|
1415
|
+
return n != null && n.data ? /* @__PURE__ */ s(Ls, { openQuestion: t, questions: n.data }) : /* @__PURE__ */ s("div", { children: "wait questions..." });
|
|
1416
|
+
}, ws = ({ userSummary: e }) => {
|
|
1409
1417
|
var t, n;
|
|
1410
|
-
const i =
|
|
1418
|
+
const i = C(e.getStore());
|
|
1411
1419
|
return (t = i.data) != null && t.summary ? /* @__PURE__ */ s(ze, { ...i.data.summary, successRate: (n = i.data.percentage) == null ? void 0 : n.correct }) : /* @__PURE__ */ s("div", { children: "wait user..." });
|
|
1412
1420
|
}, Es = ({
|
|
1413
1421
|
gamification: e
|
|
@@ -1433,11 +1441,11 @@ const ns = /* @__PURE__ */ r("div")({
|
|
|
1433
1441
|
style: {
|
|
1434
1442
|
paddingTop: "12px"
|
|
1435
1443
|
},
|
|
1436
|
-
children: /* @__PURE__ */ s(
|
|
1444
|
+
children: /* @__PURE__ */ s(ws, {
|
|
1437
1445
|
userSummary: e.userSummary
|
|
1438
1446
|
})
|
|
1439
1447
|
}), /* @__PURE__ */ s(_e, {
|
|
1440
|
-
children: /* @__PURE__ */ s(
|
|
1448
|
+
children: /* @__PURE__ */ s(bs, {
|
|
1441
1449
|
openQuestion: e.openQuestion,
|
|
1442
1450
|
store: e.feedList.getStore()
|
|
1443
1451
|
})
|
|
@@ -1467,11 +1475,11 @@ const ns = /* @__PURE__ */ r("div")({
|
|
|
1467
1475
|
gamification: e,
|
|
1468
1476
|
className: t
|
|
1469
1477
|
}) => {
|
|
1470
|
-
const n =
|
|
1471
|
-
return /* @__PURE__ */ m(
|
|
1478
|
+
const n = C(e.openedQuestion.$store), i = C(e.openedUser);
|
|
1479
|
+
return /* @__PURE__ */ m($, {
|
|
1472
1480
|
children: [n && /* @__PURE__ */ s(ve, {
|
|
1473
1481
|
className: t,
|
|
1474
|
-
children: /* @__PURE__ */ s(
|
|
1482
|
+
children: /* @__PURE__ */ s(wn, {
|
|
1475
1483
|
gamification: e
|
|
1476
1484
|
})
|
|
1477
1485
|
}), i && /* @__PURE__ */ s(ve, {
|