@streamlayer/react 0.33.3 → 0.33.5
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.
|
@@ -2,13 +2,13 @@ import { jsxs as p, jsx as s, Fragment as L } from "react/jsx-runtime";
|
|
|
2
2
|
import { s as o, r as w } from "./index4.js";
|
|
3
3
|
import { useStore as _ } from "@nanostores/react";
|
|
4
4
|
import { o as Ee, r as Ie, w as We, u as Le, A as Fe, O as Be, c as He, a as de, n as Ge, f as Ze } from "./masters2.js";
|
|
5
|
-
import { QuestionType as y, QuestionStatus as
|
|
6
|
-
import { useState as
|
|
5
|
+
import { QuestionType as y, QuestionStatus as $, QuestionImages as B, PickHistoryStatus as X } from "@streamlayer/sdk-web-types";
|
|
6
|
+
import { useState as R, useCallback as q, useEffect as fe, useMemo as E, createElement as oe, PureComponent as Re, useRef as ue, useTransition as Je } from "react";
|
|
7
7
|
import { d as pe } from "./index3.js";
|
|
8
8
|
import "react-countup";
|
|
9
9
|
import { CountdownCircleTimer as Ke } from "react-countdown-circle-timer";
|
|
10
10
|
import { E as P } from "./index2.js";
|
|
11
|
-
import
|
|
11
|
+
import $e from "lodash.throttle";
|
|
12
12
|
import "@streamlayer/sdk-web-interfaces";
|
|
13
13
|
import "@streamlayer/sdk-web-notifications";
|
|
14
14
|
import "./useStreamLayerApp.js";
|
|
@@ -53,11 +53,11 @@ const Xe = /* @__PURE__ */ o("div")({
|
|
|
53
53
|
] }),
|
|
54
54
|
/* @__PURE__ */ s(it, { onClick: t, children: /* @__PURE__ */ s(ot, { name: "icon-cross" }) })
|
|
55
55
|
] });
|
|
56
|
-
}, Ue = (e) => e.split(/\s+/).map((t) => t[0]).join("").toUpperCase(), Pe = (e) => e ? e.toLocaleString("en-US") : "0",
|
|
56
|
+
}, Ue = (e) => e.split(/\s+/).map((t) => t[0]).join("").toUpperCase(), Pe = (e) => e ? e.toLocaleString("en-US") : "0", ve = (e) => e.toLocaleDateString("en-US", {
|
|
57
57
|
weekday: "short",
|
|
58
58
|
month: "short",
|
|
59
59
|
day: "numeric"
|
|
60
|
-
}),
|
|
60
|
+
}), ge = (e) => e.toLocaleTimeString("en-US", {
|
|
61
61
|
hour: "2-digit",
|
|
62
62
|
minute: "2-digit"
|
|
63
63
|
}), Me = (e) => !isNaN(e.getTime()), at = /* @__PURE__ */ o("div")({
|
|
@@ -106,11 +106,11 @@ const Xe = /* @__PURE__ */ o("div")({
|
|
|
106
106
|
name: "User",
|
|
107
107
|
class: "u1g7arbm",
|
|
108
108
|
propsAsIs: !1
|
|
109
|
-
}),
|
|
109
|
+
}), vt = /* @__PURE__ */ o("img")({
|
|
110
110
|
name: "Avatar",
|
|
111
111
|
class: "a1ldeata",
|
|
112
112
|
propsAsIs: !1
|
|
113
|
-
}),
|
|
113
|
+
}), gt = /* @__PURE__ */ o("div")({
|
|
114
114
|
name: "UserInfo",
|
|
115
115
|
class: "u10d4koz",
|
|
116
116
|
propsAsIs: !1
|
|
@@ -164,18 +164,18 @@ const Xe = /* @__PURE__ */ o("div")({
|
|
|
164
164
|
points: n,
|
|
165
165
|
friendsRank: i,
|
|
166
166
|
rank: r,
|
|
167
|
-
streak:
|
|
168
|
-
correct:
|
|
167
|
+
streak: m,
|
|
168
|
+
correct: d,
|
|
169
169
|
incorrect: l,
|
|
170
|
-
inTop:
|
|
170
|
+
inTop: c,
|
|
171
171
|
successRate: I
|
|
172
172
|
}) => /* @__PURE__ */ p(mt, { children: [
|
|
173
173
|
/* @__PURE__ */ s(ht, { children: /* @__PURE__ */ p(ft, { children: [
|
|
174
174
|
/* @__PURE__ */ p(bt, { children: [
|
|
175
|
-
e && /* @__PURE__ */ s(
|
|
175
|
+
e && /* @__PURE__ */ s(vt, { alt: "avatar", src: e }),
|
|
176
176
|
!e && /* @__PURE__ */ s(Ot, { children: Ue(t || "") })
|
|
177
177
|
] }),
|
|
178
|
-
/* @__PURE__ */ p(
|
|
178
|
+
/* @__PURE__ */ p(gt, { children: [
|
|
179
179
|
/* @__PURE__ */ s(Mt, { children: t }),
|
|
180
180
|
/* @__PURE__ */ p(Tt, { children: [
|
|
181
181
|
/* @__PURE__ */ p(At, { children: [
|
|
@@ -188,7 +188,7 @@ const Xe = /* @__PURE__ */ o("div")({
|
|
|
188
188
|
/* @__PURE__ */ s(St, {}),
|
|
189
189
|
/* @__PURE__ */ p("div", { children: [
|
|
190
190
|
"TOP ",
|
|
191
|
-
|
|
191
|
+
c || 0,
|
|
192
192
|
"%"
|
|
193
193
|
] })
|
|
194
194
|
] })
|
|
@@ -200,8 +200,8 @@ const Xe = /* @__PURE__ */ o("div")({
|
|
|
200
200
|
/* @__PURE__ */ s(Ae, { indicator: r || 0, title: "Global rank" })
|
|
201
201
|
] }),
|
|
202
202
|
/* @__PURE__ */ p(xt, { children: [
|
|
203
|
-
/* @__PURE__ */ s(ee, { indicator:
|
|
204
|
-
/* @__PURE__ */ s(ee, { indicator:
|
|
203
|
+
/* @__PURE__ */ s(ee, { indicator: m || 0, title: "Win streak" }),
|
|
204
|
+
/* @__PURE__ */ s(ee, { indicator: d || 0, title: "Correct" }),
|
|
205
205
|
/* @__PURE__ */ s(ee, { indicator: l || 0, title: "Incorrect" }),
|
|
206
206
|
/* @__PURE__ */ s(ee, { indicator: `${I || 0}%`, title: "Succ. rate" })
|
|
207
207
|
] })
|
|
@@ -222,18 +222,18 @@ const Xe = /* @__PURE__ */ o("div")({
|
|
|
222
222
|
name: "Container",
|
|
223
223
|
class: "c38csyt",
|
|
224
224
|
propsAsIs: !1
|
|
225
|
-
}),
|
|
225
|
+
}), Rt = /* @__PURE__ */ o("div")({
|
|
226
226
|
name: "Title",
|
|
227
227
|
class: "ty221rx",
|
|
228
228
|
propsAsIs: !1
|
|
229
|
-
}),
|
|
229
|
+
}), $t = /* @__PURE__ */ o("div")({
|
|
230
230
|
name: "Description",
|
|
231
231
|
class: "dlaj9xp",
|
|
232
232
|
propsAsIs: !1
|
|
233
233
|
}), Qt = ({ title: e, description: t }) => /* @__PURE__ */ p(Lt, { children: [
|
|
234
234
|
/* @__PURE__ */ s(w, { name: "icon-check-circle" }),
|
|
235
|
-
/* @__PURE__ */ s(
|
|
236
|
-
/* @__PURE__ */ s(
|
|
235
|
+
/* @__PURE__ */ s(Rt, { children: e }),
|
|
236
|
+
/* @__PURE__ */ s($t, { children: t })
|
|
237
237
|
] }), Ut = /* @__PURE__ */ o("div")({
|
|
238
238
|
name: "Container",
|
|
239
239
|
class: "c16sbdnm",
|
|
@@ -268,20 +268,20 @@ const Xe = /* @__PURE__ */ o("div")({
|
|
|
268
268
|
questionVoted: n,
|
|
269
269
|
questionType: i,
|
|
270
270
|
hasCorrectAnswer: r,
|
|
271
|
-
questionStatus:
|
|
272
|
-
showExpiredNotification:
|
|
271
|
+
questionStatus: m,
|
|
272
|
+
showExpiredNotification: d,
|
|
273
273
|
showClosedNotificationTrivia: l,
|
|
274
|
-
votedInCurrentRender:
|
|
274
|
+
votedInCurrentRender: c,
|
|
275
275
|
votedAfterQuestionClosed: I,
|
|
276
|
-
enteredAnActiveQuestion:
|
|
276
|
+
enteredAnActiveQuestion: v,
|
|
277
277
|
marketClosed: S
|
|
278
278
|
}) => {
|
|
279
|
-
const
|
|
280
|
-
if (!
|
|
279
|
+
const g = n && (i === y.TRIVIA || i === y.PREDICTION) && c && m !== $.RESOLVED, N = i === y.PREDICTION && !r, z = S && i === y.PREDICTION && !n && !v || i === y.PREDICTION && I && c && v, a = g && N, h = g && r, u = i === y.PREDICTION && n && c && r, f = n && i === y.POLL && c;
|
|
280
|
+
if (!d && !l && !a && !h && !z && !f && !u)
|
|
281
281
|
return null;
|
|
282
282
|
const M = t ? "correct" : "incorrect", D = t ? e == null ? void 0 : e.correctFeedback : e == null ? void 0 : e.incorrectFeedback;
|
|
283
283
|
return /* @__PURE__ */ p(Ut, { "data-isPrediction": N, children: [
|
|
284
|
-
|
|
284
|
+
d && /* @__PURE__ */ p(L, { children: [
|
|
285
285
|
/* @__PURE__ */ s(H, { children: /* @__PURE__ */ s(w, { name: "questionExpired" }) }),
|
|
286
286
|
/* @__PURE__ */ p("div", { children: [
|
|
287
287
|
/* @__PURE__ */ s(te, { children: /* @__PURE__ */ s(Y, { children: "Question Expired" }) }),
|
|
@@ -408,22 +408,22 @@ const Xe = /* @__PURE__ */ o("div")({
|
|
|
408
408
|
correct: n,
|
|
409
409
|
hasCorrectAnswer: i,
|
|
410
410
|
questionStatus: r
|
|
411
|
-
}) => e === y.TRIVIA ? t && n : e === y.PREDICTION ? t && n && i || r ===
|
|
411
|
+
}) => e === y.TRIVIA ? t && n : e === y.PREDICTION ? t && n && i || r === $.RESOLVED && n : !1, pn = (e) => {
|
|
412
412
|
var t;
|
|
413
413
|
const {
|
|
414
414
|
// option props
|
|
415
415
|
id: n,
|
|
416
416
|
icon: i,
|
|
417
417
|
text: r,
|
|
418
|
-
percentageDecimal:
|
|
419
|
-
points:
|
|
418
|
+
percentageDecimal: m,
|
|
419
|
+
points: d,
|
|
420
420
|
// extra props
|
|
421
421
|
onVote: l,
|
|
422
|
-
markThatVoted:
|
|
422
|
+
markThatVoted: c,
|
|
423
423
|
youSelected: I,
|
|
424
|
-
questionVoted:
|
|
424
|
+
questionVoted: v,
|
|
425
425
|
imageMode: S,
|
|
426
|
-
answerTimeExpired:
|
|
426
|
+
answerTimeExpired: g,
|
|
427
427
|
questionStatus: N,
|
|
428
428
|
isLoading: z,
|
|
429
429
|
questionType: a,
|
|
@@ -432,32 +432,32 @@ const Xe = /* @__PURE__ */ o("div")({
|
|
|
432
432
|
votedAfterQuestionClosed: f,
|
|
433
433
|
enteredAnActiveQuestion: M,
|
|
434
434
|
marketClosed: D
|
|
435
|
-
} = e, T = dn(e), x = un({ questionType: a, questionVoted:
|
|
435
|
+
} = e, T = dn(e), x = un({ questionType: a, questionVoted: v, correct: h, hasCorrectAnswer: u, questionStatus: N }), O = D && a === y.PREDICTION, k = v || O, A = a === y.PREDICTION && !v && N !== $.RESOLVED;
|
|
436
436
|
return /* @__PURE__ */ p(
|
|
437
437
|
Ht,
|
|
438
438
|
{
|
|
439
439
|
value: n,
|
|
440
440
|
"data-selected": I,
|
|
441
441
|
"data-answerState": T,
|
|
442
|
-
disabled:
|
|
443
|
-
"data-isNotChecked":
|
|
442
|
+
disabled: v || z || g || O && !M || O && M && f,
|
|
443
|
+
"data-isNotChecked": v && !I && T !== "incorrect",
|
|
444
444
|
onClick: (b) => {
|
|
445
|
-
|
|
446
|
-
a === y.PREDICTION ? D : N ===
|
|
445
|
+
c(
|
|
446
|
+
a === y.PREDICTION ? D : N === $.RESOLVED
|
|
447
447
|
), l(b);
|
|
448
448
|
},
|
|
449
449
|
children: [
|
|
450
|
-
/* @__PURE__ */ s(Gt, { "data-answerState": T, style: { width: `${k ?
|
|
450
|
+
/* @__PURE__ */ s(Gt, { "data-answerState": T, style: { width: `${k ? m : 0}%` } }),
|
|
451
451
|
/* @__PURE__ */ p(Zt, { children: [
|
|
452
452
|
i && S && ((t = ye[S]) == null ? void 0 : t.call(ye, i)),
|
|
453
453
|
/* @__PURE__ */ s(sn, { children: r }),
|
|
454
454
|
A && /* @__PURE__ */ p("div", { children: [
|
|
455
|
-
/* @__PURE__ */ s(pe, { value:
|
|
455
|
+
/* @__PURE__ */ s(pe, { value: d }),
|
|
456
456
|
/* @__PURE__ */ s(on, { children: "pts" })
|
|
457
457
|
] }),
|
|
458
458
|
k && /* @__PURE__ */ p(rn, { children: [
|
|
459
459
|
x && /* @__PURE__ */ s(cn, { name: "selected" }),
|
|
460
|
-
/* @__PURE__ */ s(an, { children: /* @__PURE__ */ s(pe, { value:
|
|
460
|
+
/* @__PURE__ */ s(an, { children: /* @__PURE__ */ s(pe, { value: m, suffix: "%" }) })
|
|
461
461
|
] })
|
|
462
462
|
] })
|
|
463
463
|
]
|
|
@@ -467,19 +467,19 @@ const Xe = /* @__PURE__ */ o("div")({
|
|
|
467
467
|
name: "RemainingTime",
|
|
468
468
|
class: "r165427",
|
|
469
469
|
propsAsIs: !1
|
|
470
|
-
}), fn = P.SECONDARY_GREEN6, De = P.SECONDARY_RED3,
|
|
470
|
+
}), fn = P.SECONDARY_GREEN6, De = P.SECONDARY_RED3, vn = P.NEUTRALS_GRAY3, gn = ({
|
|
471
471
|
isPlaying: e = !0,
|
|
472
472
|
duration: t = 30,
|
|
473
473
|
onTimerExpired: n
|
|
474
474
|
}) => {
|
|
475
|
-
const [i, r] =
|
|
476
|
-
remainingTime:
|
|
475
|
+
const [i, r] = R(t > 10 ? fn : De), m = ({
|
|
476
|
+
remainingTime: c
|
|
477
477
|
}) => /* @__PURE__ */ s(In, {
|
|
478
|
-
children:
|
|
479
|
-
}),
|
|
480
|
-
n == null || n(), r(
|
|
481
|
-
}, [n, r]), l = q((
|
|
482
|
-
|
|
478
|
+
children: c
|
|
479
|
+
}), d = q(() => {
|
|
480
|
+
n == null || n(), r(vn);
|
|
481
|
+
}, [n, r]), l = q((c) => {
|
|
482
|
+
c === 10 && r(De);
|
|
483
483
|
}, [r]);
|
|
484
484
|
return /* @__PURE__ */ s(Ke, {
|
|
485
485
|
isPlaying: e,
|
|
@@ -490,9 +490,9 @@ const Xe = /* @__PURE__ */ o("div")({
|
|
|
490
490
|
strokeWidth: 2,
|
|
491
491
|
trailStrokeWidth: 2,
|
|
492
492
|
trailColor: i,
|
|
493
|
-
onComplete:
|
|
493
|
+
onComplete: d,
|
|
494
494
|
onUpdate: l,
|
|
495
|
-
children:
|
|
495
|
+
children: m
|
|
496
496
|
});
|
|
497
497
|
}, Mn = /* @__PURE__ */ o("div")({
|
|
498
498
|
name: "WinBarContainer",
|
|
@@ -528,8 +528,8 @@ const Xe = /* @__PURE__ */ o("div")({
|
|
|
528
528
|
isPlayingTimer: n,
|
|
529
529
|
isTimer: i,
|
|
530
530
|
questionType: r,
|
|
531
|
-
timerDuration:
|
|
532
|
-
onTimerExpired:
|
|
531
|
+
timerDuration: m,
|
|
532
|
+
onTimerExpired: d
|
|
533
533
|
}) => /* @__PURE__ */ p(Mn, { "data-centeredItems": r === y.PREDICTION, children: [
|
|
534
534
|
/* @__PURE__ */ p(Tn, { children: [
|
|
535
535
|
e && /* @__PURE__ */ s(Nn, { children: e }),
|
|
@@ -541,15 +541,15 @@ const Xe = /* @__PURE__ */ o("div")({
|
|
|
541
541
|
] })
|
|
542
542
|
] })
|
|
543
543
|
] }),
|
|
544
|
-
i && r !== y.PREDICTION && /* @__PURE__ */ s(
|
|
544
|
+
i && r !== y.PREDICTION && /* @__PURE__ */ s(gn, { isPlaying: n, onTimerExpired: d, duration: m })
|
|
545
545
|
] }), On = ({ openedQuestion: e, isLoading: t, vote: n, close: i }) => {
|
|
546
|
-
var r,
|
|
547
|
-
const
|
|
546
|
+
var r, m;
|
|
547
|
+
const d = e.subject, l = e.type, c = e.status, I = (r = e.options) == null ? void 0 : r.options, v = e.marketClosed, [S, g] = R(!1), [N, z] = R(!1), [a, h] = R(!0), [u, f] = R(!1), [M, D] = R(""), T = e == null ? void 0 : e.id;
|
|
548
548
|
fe(() => {
|
|
549
|
-
l === y.PREDICTION ?
|
|
549
|
+
l === y.PREDICTION ? v && h(!1) : c === $.RESOLVED && h(!1);
|
|
550
550
|
}, []);
|
|
551
551
|
const x = q((C) => {
|
|
552
|
-
z(C),
|
|
552
|
+
z(C), g(!0);
|
|
553
553
|
}, []), O = q(
|
|
554
554
|
async (C) => {
|
|
555
555
|
if (T) {
|
|
@@ -579,7 +579,7 @@ const Xe = /* @__PURE__ */ o("div")({
|
|
|
579
579
|
hasCorrectAnswer: b,
|
|
580
580
|
questionType: e.type,
|
|
581
581
|
answerTimeExpired: u,
|
|
582
|
-
questionStatus:
|
|
582
|
+
questionStatus: c,
|
|
583
583
|
imageMode: (U = e.appearance) == null ? void 0 : U.images,
|
|
584
584
|
onVote: O
|
|
585
585
|
};
|
|
@@ -589,23 +589,23 @@ const Xe = /* @__PURE__ */ o("div")({
|
|
|
589
589
|
t,
|
|
590
590
|
e,
|
|
591
591
|
A,
|
|
592
|
-
|
|
592
|
+
c,
|
|
593
593
|
O,
|
|
594
594
|
M
|
|
595
|
-
]), ie = I && (I.case === "trivia" || I.case === "prediction") ? I.value : void 0, Q =
|
|
595
|
+
]), ie = I && (I.case === "trivia" || I.case === "prediction") ? I.value : void 0, Q = c === $.RESOLVED && l === y.TRIVIA && !A && !a, Z = l === y.TRIVIA && N && S && a, J = E(() => l === y.PREDICTION ? !!(A && !b || A && b && j != null && j.youVoted) : !0, [l, A, b, j]), K = E(() => {
|
|
596
596
|
if (l === y.PREDICTION && A && (!b || b && j != null && j.youVoted))
|
|
597
597
|
return A.points;
|
|
598
598
|
if (!(Q || u))
|
|
599
|
-
return
|
|
599
|
+
return c === $.RESOLVED ? 0 : A ? A.correct ? A.points : 0 : j == null ? void 0 : j.points;
|
|
600
600
|
}, [
|
|
601
601
|
u,
|
|
602
602
|
A,
|
|
603
603
|
j,
|
|
604
|
-
|
|
604
|
+
c,
|
|
605
605
|
Q,
|
|
606
606
|
l,
|
|
607
607
|
b
|
|
608
|
-
]), W = E(() => l === y.PREDICTION && A ? b ? b && j != null && j.youVoted ? "You won" : "" : "To win" : Q || u ? "Time expired" : l === y.POLL ? "Time remaining" : A ? "You won" : "To win", [u, l, A, Q, b, j]), re = A || Q || Z || l === y.TRIVIA &&
|
|
608
|
+
]), W = E(() => l === y.PREDICTION && A ? b ? b && j != null && j.youVoted ? "You won" : "" : "To win" : Q || u ? "Time expired" : l === y.POLL ? "Time remaining" : A ? "You won" : "To win", [u, l, A, Q, b, j]), re = A || Q || Z || l === y.TRIVIA && c === $.RESOLVED && a;
|
|
609
609
|
return /* @__PURE__ */ s(Ie, { "data-question-header": "true", children: /* @__PURE__ */ s(Vt, { children: /* @__PURE__ */ p(Wt, { children: [
|
|
610
610
|
/* @__PURE__ */ s(
|
|
611
611
|
Yt,
|
|
@@ -615,13 +615,13 @@ const Xe = /* @__PURE__ */ o("div")({
|
|
|
615
615
|
questionVotedCorrectly: A == null ? void 0 : A.correct,
|
|
616
616
|
questionType: l,
|
|
617
617
|
hasCorrectAnswer: b,
|
|
618
|
-
questionStatus:
|
|
618
|
+
questionStatus: c,
|
|
619
619
|
showExpiredNotification: Q,
|
|
620
620
|
showClosedNotificationTrivia: Z,
|
|
621
621
|
votedInCurrentRender: S,
|
|
622
622
|
votedAfterQuestionClosed: N,
|
|
623
623
|
enteredAnActiveQuestion: a,
|
|
624
|
-
marketClosed:
|
|
624
|
+
marketClosed: v
|
|
625
625
|
}
|
|
626
626
|
),
|
|
627
627
|
J && /* @__PURE__ */ s(
|
|
@@ -633,7 +633,7 @@ const Xe = /* @__PURE__ */ o("div")({
|
|
|
633
633
|
questionType: e.type,
|
|
634
634
|
isTimer: !t,
|
|
635
635
|
isPlayingTimer: !A,
|
|
636
|
-
timerDuration: re ? 0 : Number(((
|
|
636
|
+
timerDuration: re ? 0 : Number(((m = e == null ? void 0 : e.appearance) == null ? void 0 : m.autoHideInterval) || "30")
|
|
637
637
|
}
|
|
638
638
|
),
|
|
639
639
|
u ? /* @__PURE__ */ s(
|
|
@@ -643,7 +643,7 @@ const Xe = /* @__PURE__ */ o("div")({
|
|
|
643
643
|
description: "Watch for additional enhanced stream interactive experience."
|
|
644
644
|
}
|
|
645
645
|
) : /* @__PURE__ */ p(L, { children: [
|
|
646
|
-
/* @__PURE__ */ s(Ft, { "data-withoutWinBar": !J, children:
|
|
646
|
+
/* @__PURE__ */ s(Ft, { "data-withoutWinBar": !J, children: d }),
|
|
647
647
|
/* @__PURE__ */ s(Bt, { children: se.map((C) => /* @__PURE__ */ s(
|
|
648
648
|
pn,
|
|
649
649
|
{
|
|
@@ -651,7 +651,7 @@ const Xe = /* @__PURE__ */ o("div")({
|
|
|
651
651
|
markThatVoted: x,
|
|
652
652
|
votedAfterQuestionClosed: N,
|
|
653
653
|
enteredAnActiveQuestion: a,
|
|
654
|
-
marketClosed:
|
|
654
|
+
marketClosed: v
|
|
655
655
|
},
|
|
656
656
|
C.id
|
|
657
657
|
)) })
|
|
@@ -686,43 +686,44 @@ const Xe = /* @__PURE__ */ o("div")({
|
|
|
686
686
|
image: t,
|
|
687
687
|
title: n,
|
|
688
688
|
isPickHistory: i,
|
|
689
|
-
instantView: r
|
|
689
|
+
instantView: r,
|
|
690
|
+
notification: m
|
|
690
691
|
}) => {
|
|
691
|
-
const
|
|
692
|
+
const d = E(() => {
|
|
692
693
|
if (e) {
|
|
693
|
-
const
|
|
694
|
-
if (Me(
|
|
694
|
+
const c = new Date(e);
|
|
695
|
+
if (Me(c))
|
|
695
696
|
return {
|
|
696
|
-
date:
|
|
697
|
-
time:
|
|
697
|
+
date: ve(c),
|
|
698
|
+
time: ge(c)
|
|
698
699
|
};
|
|
699
700
|
}
|
|
700
701
|
return null;
|
|
701
|
-
}, [e]),
|
|
702
|
+
}, [e]), l = (r == null ? void 0 : r.image) || t;
|
|
702
703
|
return /* @__PURE__ */ p(bn, { children: [
|
|
703
|
-
|
|
704
|
-
|
|
704
|
+
d && /* @__PURE__ */ p(kn, { children: [
|
|
705
|
+
d.date,
|
|
705
706
|
" · ",
|
|
706
|
-
|
|
707
|
+
d.time
|
|
707
708
|
] }),
|
|
708
709
|
(r == null ? void 0 : r.video) && /* @__PURE__ */ s(We, { source: r.video.url, poster: r.video.thumbnailUrl }),
|
|
709
|
-
|
|
710
|
+
l && !(r != null && r.video) && /* @__PURE__ */ s(En, { src: l }),
|
|
710
711
|
/* @__PURE__ */ p(Cn, { children: [
|
|
711
712
|
/* @__PURE__ */ s(jn, { children: i ? n : r == null ? void 0 : r.heading }),
|
|
712
|
-
|
|
713
|
+
/* @__PURE__ */ s(wn, { children: i ? m == null ? void 0 : m.body : r == null ? void 0 : r.body })
|
|
713
714
|
] })
|
|
714
715
|
] });
|
|
715
716
|
}, Ln = /* @__PURE__ */ o("div")({
|
|
716
717
|
name: "Container",
|
|
717
718
|
class: "c1euiow",
|
|
718
719
|
propsAsIs: !1
|
|
719
|
-
}),
|
|
720
|
+
}), Rn = /* @__PURE__ */ o("a")({
|
|
720
721
|
name: "WebLinkBtn",
|
|
721
722
|
class: "w19zie3h",
|
|
722
723
|
propsAsIs: !1
|
|
723
|
-
}),
|
|
724
|
+
}), $n = ({ instantView: e, ...t }) => /* @__PURE__ */ p(Ln, { children: [
|
|
724
725
|
/* @__PURE__ */ s(Ye, { instantView: e, ...t }),
|
|
725
|
-
(e == null ? void 0 : e.webLink) && /* @__PURE__ */ p(
|
|
726
|
+
(e == null ? void 0 : e.webLink) && /* @__PURE__ */ p(Rn, { href: e == null ? void 0 : e.webLink.url, target: "_blank", children: [
|
|
726
727
|
e == null ? void 0 : e.webLink.label,
|
|
727
728
|
/* @__PURE__ */ s(w, { name: "icon-external-link" })
|
|
728
729
|
] })
|
|
@@ -744,8 +745,8 @@ const Xe = /* @__PURE__ */ o("div")({
|
|
|
744
745
|
const i = new Date(e);
|
|
745
746
|
if (Me(i))
|
|
746
747
|
return {
|
|
747
|
-
date:
|
|
748
|
-
time:
|
|
748
|
+
date: ve(i),
|
|
749
|
+
time: ge(i)
|
|
749
750
|
};
|
|
750
751
|
}
|
|
751
752
|
return null;
|
|
@@ -767,7 +768,7 @@ const Xe = /* @__PURE__ */ o("div")({
|
|
|
767
768
|
openedQuestion: e
|
|
768
769
|
}) => {
|
|
769
770
|
var t, n;
|
|
770
|
-
return ((t = e == null ? void 0 : e.attributes) == null ? void 0 : t.attributes.case) === "insight" ? /* @__PURE__ */ s(
|
|
771
|
+
return ((t = e == null ? void 0 : e.attributes) == null ? void 0 : t.attributes.case) === "insight" ? /* @__PURE__ */ s($n, {
|
|
771
772
|
created: e.attributes.created,
|
|
772
773
|
...e.attributes.attributes.value
|
|
773
774
|
}) : ((n = e == null ? void 0 : e.attributes) == null ? void 0 : n.attributes.case) === "tweet" ? /* @__PURE__ */ s(qn, {
|
|
@@ -885,13 +886,13 @@ function Xn(e, t) {
|
|
|
885
886
|
}
|
|
886
887
|
function le(e, t) {
|
|
887
888
|
t === void 0 && (t = Xn);
|
|
888
|
-
var n, i = [], r,
|
|
889
|
-
function
|
|
890
|
-
for (var l = [],
|
|
891
|
-
l[
|
|
892
|
-
return
|
|
889
|
+
var n, i = [], r, m = !1;
|
|
890
|
+
function d() {
|
|
891
|
+
for (var l = [], c = 0; c < arguments.length; c++)
|
|
892
|
+
l[c] = arguments[c];
|
|
893
|
+
return m && n === this && t(l, i) || (r = e.apply(this, l), m = !0, n = this, i = l), r;
|
|
893
894
|
}
|
|
894
|
-
return
|
|
895
|
+
return d;
|
|
895
896
|
}
|
|
896
897
|
var es = typeof performance == "object" && typeof performance.now == "function", Oe = es ? function() {
|
|
897
898
|
return performance.now();
|
|
@@ -933,12 +934,12 @@ var ns = 150, ss = function(t, n) {
|
|
|
933
934
|
return t;
|
|
934
935
|
};
|
|
935
936
|
function is(e) {
|
|
936
|
-
var t, n = e.getItemOffset, i = e.getEstimatedTotalSize, r = e.getItemSize,
|
|
937
|
+
var t, n = e.getItemOffset, i = e.getEstimatedTotalSize, r = e.getItemSize, m = e.getOffsetForIndexAndAlignment, d = e.getStartIndexForOffset, l = e.getStopIndexForStartIndex, c = e.initInstanceProps, I = e.shouldResetStyleCacheOnItemSizeChange, v = e.validateProps;
|
|
937
938
|
return t = /* @__PURE__ */ function(S) {
|
|
938
|
-
Jn(
|
|
939
|
-
function
|
|
939
|
+
Jn(g, S);
|
|
940
|
+
function g(z) {
|
|
940
941
|
var a;
|
|
941
|
-
return a = S.call(this, z) || this, a._instanceProps =
|
|
942
|
+
return a = S.call(this, z) || this, a._instanceProps = c(a.props, ze(a)), a._outerRef = void 0, a._resetIsScrollingTimeoutId = null, a.state = {
|
|
942
943
|
instance: ze(a),
|
|
943
944
|
isScrolling: !1,
|
|
944
945
|
scrollDirection: "forward",
|
|
@@ -1023,10 +1024,10 @@ function is(e) {
|
|
|
1023
1024
|
});
|
|
1024
1025
|
}, a;
|
|
1025
1026
|
}
|
|
1026
|
-
|
|
1027
|
-
return rs(a, h),
|
|
1027
|
+
g.getDerivedStateFromProps = function(a, h) {
|
|
1028
|
+
return rs(a, h), v(a), null;
|
|
1028
1029
|
};
|
|
1029
|
-
var N =
|
|
1030
|
+
var N = g.prototype;
|
|
1030
1031
|
return N.scrollTo = function(a) {
|
|
1031
1032
|
a = Math.max(0, a), this.setState(function(h) {
|
|
1032
1033
|
return h.scrollOffset === a ? null : {
|
|
@@ -1044,7 +1045,7 @@ function is(e) {
|
|
|
1044
1045
|
var x = this._outerRef;
|
|
1045
1046
|
M === "vertical" ? T = x.scrollWidth > x.clientWidth ? Ce() : 0 : T = x.scrollHeight > x.clientHeight ? Ce() : 0;
|
|
1046
1047
|
}
|
|
1047
|
-
this.scrollTo(
|
|
1048
|
+
this.scrollTo(m(this.props, a, h, D, this._instanceProps, T));
|
|
1048
1049
|
}, N.componentDidMount = function() {
|
|
1049
1050
|
var a = this.props, h = a.direction, u = a.initialScrollOffset, f = a.layout;
|
|
1050
1051
|
if (typeof u == "number" && this._outerRef != null) {
|
|
@@ -1128,10 +1129,10 @@ function is(e) {
|
|
|
1128
1129
|
var a = this.props, h = a.itemCount, u = a.overscanCount, f = this.state, M = f.isScrolling, D = f.scrollDirection, T = f.scrollOffset;
|
|
1129
1130
|
if (h === 0)
|
|
1130
1131
|
return [0, 0, 0, 0];
|
|
1131
|
-
var x =
|
|
1132
|
+
var x = d(this.props, T, this._instanceProps), O = l(this.props, x, T, this._instanceProps), k = !M || D === "backward" ? Math.max(1, u) : 1, A = !M || D === "forward" ? Math.max(1, u) : 1;
|
|
1132
1133
|
return [Math.max(0, x - k), Math.max(0, Math.min(h - 1, O + A)), x, O];
|
|
1133
|
-
},
|
|
1134
|
-
}(
|
|
1134
|
+
}, g;
|
|
1135
|
+
}(Re), t.defaultProps = {
|
|
1135
1136
|
direction: "ltr",
|
|
1136
1137
|
itemData: void 0,
|
|
1137
1138
|
layout: "vertical",
|
|
@@ -1154,8 +1155,8 @@ var rs = function(t, n) {
|
|
|
1154
1155
|
var n = t.itemCount, i = t.itemSize;
|
|
1155
1156
|
return i * n;
|
|
1156
1157
|
},
|
|
1157
|
-
getOffsetForIndexAndAlignment: function(t, n, i, r,
|
|
1158
|
-
var l = t.direction,
|
|
1158
|
+
getOffsetForIndexAndAlignment: function(t, n, i, r, m, d) {
|
|
1159
|
+
var l = t.direction, c = t.height, I = t.itemCount, v = t.itemSize, S = t.layout, g = t.width, N = l === "horizontal" || S === "horizontal", z = N ? g : c, a = Math.max(0, I * v - z), h = Math.min(a, n * v), u = Math.max(0, n * v - z + v + d);
|
|
1159
1160
|
switch (i === "smart" && (r >= u - z && r <= h + z ? i = "auto" : i = "center"), i) {
|
|
1160
1161
|
case "start":
|
|
1161
1162
|
return h;
|
|
@@ -1175,9 +1176,9 @@ var rs = function(t, n) {
|
|
|
1175
1176
|
return Math.max(0, Math.min(i - 1, Math.floor(n / r)));
|
|
1176
1177
|
},
|
|
1177
1178
|
getStopIndexForStartIndex: function(t, n, i) {
|
|
1178
|
-
var r = t.direction,
|
|
1179
|
+
var r = t.direction, m = t.height, d = t.itemCount, l = t.itemSize, c = t.layout, I = t.width, v = r === "horizontal" || c === "horizontal", S = n * l, g = v ? I : m, N = Math.ceil((g + i - S) / l);
|
|
1179
1180
|
return Math.max(0, Math.min(
|
|
1180
|
-
|
|
1181
|
+
d - 1,
|
|
1181
1182
|
n + N - 1
|
|
1182
1183
|
// -1 is because stop index is inclusive
|
|
1183
1184
|
));
|
|
@@ -1194,24 +1195,24 @@ function as(e) {
|
|
|
1194
1195
|
return !(i > n || r < t);
|
|
1195
1196
|
}
|
|
1196
1197
|
function ls(e) {
|
|
1197
|
-
for (var t = e.isItemLoaded, n = e.itemCount, i = e.minimumBatchSize, r = e.startIndex,
|
|
1198
|
-
var
|
|
1199
|
-
|
|
1198
|
+
for (var t = e.isItemLoaded, n = e.itemCount, i = e.minimumBatchSize, r = e.startIndex, m = e.stopIndex, d = [], l = null, c = null, I = r; I <= m; I++) {
|
|
1199
|
+
var v = t(I);
|
|
1200
|
+
v ? c !== null && (d.push(l, c), l = c = null) : (c = I, l === null && (l = I));
|
|
1200
1201
|
}
|
|
1201
|
-
if (
|
|
1202
|
-
for (var S = Math.min(Math.max(
|
|
1203
|
-
|
|
1204
|
-
|
|
1202
|
+
if (c !== null) {
|
|
1203
|
+
for (var S = Math.min(Math.max(c, l + i - 1), n - 1), g = c + 1; g <= S && !t(g); g++)
|
|
1204
|
+
c = g;
|
|
1205
|
+
d.push(l, c);
|
|
1205
1206
|
}
|
|
1206
|
-
if (
|
|
1207
|
-
for (;
|
|
1208
|
-
var N =
|
|
1207
|
+
if (d.length)
|
|
1208
|
+
for (; d[1] - d[0] + 1 < i && d[0] > 0; ) {
|
|
1209
|
+
var N = d[0] - 1;
|
|
1209
1210
|
if (!t(N))
|
|
1210
|
-
|
|
1211
|
+
d[0] = N;
|
|
1211
1212
|
else
|
|
1212
1213
|
break;
|
|
1213
1214
|
}
|
|
1214
|
-
return
|
|
1215
|
+
return d;
|
|
1215
1216
|
}
|
|
1216
1217
|
var cs = function(e, t) {
|
|
1217
1218
|
if (!(e instanceof t))
|
|
@@ -1244,16 +1245,16 @@ var cs = function(e, t) {
|
|
|
1244
1245
|
}, ps = function(e) {
|
|
1245
1246
|
us(t, e);
|
|
1246
1247
|
function t() {
|
|
1247
|
-
var n, i, r,
|
|
1248
|
+
var n, i, r, m;
|
|
1248
1249
|
cs(this, t);
|
|
1249
|
-
for (var
|
|
1250
|
-
l[
|
|
1251
|
-
return
|
|
1252
|
-
var
|
|
1253
|
-
r._lastRenderedStartIndex =
|
|
1250
|
+
for (var d = arguments.length, l = Array(d), c = 0; c < d; c++)
|
|
1251
|
+
l[c] = arguments[c];
|
|
1252
|
+
return m = (i = (r = we(this, (n = t.__proto__ || Object.getPrototypeOf(t)).call.apply(n, [this].concat(l))), r), r._lastRenderedStartIndex = -1, r._lastRenderedStopIndex = -1, r._memoizedUnloadedRanges = [], r._onItemsRendered = function(I) {
|
|
1253
|
+
var v = I.visibleStartIndex, S = I.visibleStopIndex;
|
|
1254
|
+
r._lastRenderedStartIndex = v, r._lastRenderedStopIndex = S, r._ensureRowsLoaded(v, S);
|
|
1254
1255
|
}, r._setRef = function(I) {
|
|
1255
1256
|
r._listRef = I;
|
|
1256
|
-
}, i), we(r,
|
|
1257
|
+
}, i), we(r, m);
|
|
1257
1258
|
}
|
|
1258
1259
|
return ds(t, [{
|
|
1259
1260
|
key: "resetloadMoreItemsCache",
|
|
@@ -1277,39 +1278,39 @@ var cs = function(e, t) {
|
|
|
1277
1278
|
}, {
|
|
1278
1279
|
key: "_ensureRowsLoaded",
|
|
1279
1280
|
value: function(i, r) {
|
|
1280
|
-
var
|
|
1281
|
-
isItemLoaded:
|
|
1281
|
+
var m = this.props, d = m.isItemLoaded, l = m.itemCount, c = m.minimumBatchSize, I = c === void 0 ? 10 : c, v = m.threshold, S = v === void 0 ? 15 : v, g = ls({
|
|
1282
|
+
isItemLoaded: d,
|
|
1282
1283
|
itemCount: l,
|
|
1283
1284
|
minimumBatchSize: I,
|
|
1284
1285
|
startIndex: Math.max(0, i - S),
|
|
1285
1286
|
stopIndex: Math.min(l - 1, r + S)
|
|
1286
1287
|
});
|
|
1287
|
-
(this._memoizedUnloadedRanges.length !==
|
|
1288
|
-
return
|
|
1289
|
-
})) && (this._memoizedUnloadedRanges =
|
|
1288
|
+
(this._memoizedUnloadedRanges.length !== g.length || this._memoizedUnloadedRanges.some(function(N, z) {
|
|
1289
|
+
return g[z] !== N;
|
|
1290
|
+
})) && (this._memoizedUnloadedRanges = g, this._loadUnloadedRanges(g));
|
|
1290
1291
|
}
|
|
1291
1292
|
}, {
|
|
1292
1293
|
key: "_loadUnloadedRanges",
|
|
1293
1294
|
value: function(i) {
|
|
1294
|
-
for (var r = this,
|
|
1295
|
-
var
|
|
1296
|
-
|
|
1295
|
+
for (var r = this, m = this.props.loadMoreItems || this.props.loadMoreRows, d = function(I) {
|
|
1296
|
+
var v = i[I], S = i[I + 1], g = m(v, S);
|
|
1297
|
+
g != null && g.then(function() {
|
|
1297
1298
|
if (as({
|
|
1298
1299
|
lastRenderedStartIndex: r._lastRenderedStartIndex,
|
|
1299
1300
|
lastRenderedStopIndex: r._lastRenderedStopIndex,
|
|
1300
|
-
startIndex:
|
|
1301
|
+
startIndex: v,
|
|
1301
1302
|
stopIndex: S
|
|
1302
1303
|
})) {
|
|
1303
1304
|
if (r._listRef == null)
|
|
1304
1305
|
return;
|
|
1305
|
-
typeof r._listRef.resetAfterIndex == "function" ? r._listRef.resetAfterIndex(
|
|
1306
|
+
typeof r._listRef.resetAfterIndex == "function" ? r._listRef.resetAfterIndex(v, !0) : (typeof r._listRef._getItemStyleCache == "function" && r._listRef._getItemStyleCache(-1), r._listRef.forceUpdate());
|
|
1306
1307
|
}
|
|
1307
1308
|
});
|
|
1308
1309
|
}, l = 0; l < i.length; l += 2)
|
|
1309
|
-
|
|
1310
|
+
d(l);
|
|
1310
1311
|
}
|
|
1311
1312
|
}]), t;
|
|
1312
|
-
}(
|
|
1313
|
+
}(Re);
|
|
1313
1314
|
const ms = /* @__PURE__ */ o("div")({
|
|
1314
1315
|
name: "Container",
|
|
1315
1316
|
class: "culdu4a",
|
|
@@ -1326,11 +1327,11 @@ const ms = /* @__PURE__ */ o("div")({
|
|
|
1326
1327
|
name: "AvatarPlaceholder",
|
|
1327
1328
|
class: "a1dg29ja",
|
|
1328
1329
|
propsAsIs: !1
|
|
1329
|
-
}),
|
|
1330
|
+
}), vs = /* @__PURE__ */ o("div")({
|
|
1330
1331
|
name: "Content",
|
|
1331
1332
|
class: "c10a68rc",
|
|
1332
1333
|
propsAsIs: !1
|
|
1333
|
-
}),
|
|
1334
|
+
}), gs = /* @__PURE__ */ o("div")({
|
|
1334
1335
|
name: "NameContainer",
|
|
1335
1336
|
class: "nc4kck5",
|
|
1336
1337
|
propsAsIs: !1
|
|
@@ -1348,13 +1349,13 @@ const ms = /* @__PURE__ */ o("div")({
|
|
|
1348
1349
|
name: n,
|
|
1349
1350
|
points: i,
|
|
1350
1351
|
isCurrentUser: r,
|
|
1351
|
-
openItemDetail:
|
|
1352
|
-
style:
|
|
1353
|
-
}) => /* @__PURE__ */ p(ms, { onClick:
|
|
1352
|
+
openItemDetail: m,
|
|
1353
|
+
style: d
|
|
1354
|
+
}) => /* @__PURE__ */ p(ms, { onClick: m, style: d, children: [
|
|
1354
1355
|
/* @__PURE__ */ s(hs, { children: e || 0 }),
|
|
1355
|
-
/* @__PURE__ */ p(
|
|
1356
|
+
/* @__PURE__ */ p(vs, { children: [
|
|
1356
1357
|
t ? /* @__PURE__ */ s(Is, { alt: "leaderboard-item-avatar", src: t }) : /* @__PURE__ */ s(fs, { children: Ue(n || "") }),
|
|
1357
|
-
/* @__PURE__ */ p(
|
|
1358
|
+
/* @__PURE__ */ p(gs, { children: [
|
|
1358
1359
|
/* @__PURE__ */ s(Ms, { children: n || "" }),
|
|
1359
1360
|
r && /* @__PURE__ */ s(Ns, { name: "icon-star" })
|
|
1360
1361
|
] })
|
|
@@ -1370,26 +1371,26 @@ const ms = /* @__PURE__ */ o("div")({
|
|
|
1370
1371
|
openItemDetail: n,
|
|
1371
1372
|
fetchMore: i,
|
|
1372
1373
|
onScroll: r
|
|
1373
|
-
}) => /* @__PURE__ */ s(Fe, { children: ({ width:
|
|
1374
|
+
}) => /* @__PURE__ */ s(Fe, { children: ({ width: m, height: d }) => /* @__PURE__ */ s(
|
|
1374
1375
|
ps,
|
|
1375
1376
|
{
|
|
1376
1377
|
isItemLoaded: (l) => l < e.length,
|
|
1377
1378
|
itemCount: e.length + 1,
|
|
1378
1379
|
loadMoreItems: i,
|
|
1379
|
-
children: ({ onItemsRendered: l, ref:
|
|
1380
|
+
children: ({ onItemsRendered: l, ref: c }) => /* @__PURE__ */ s(ys, { children: /* @__PURE__ */ s(
|
|
1380
1381
|
os,
|
|
1381
1382
|
{
|
|
1382
1383
|
itemSize: 56,
|
|
1383
1384
|
onScroll: r,
|
|
1384
1385
|
onItemsRendered: l,
|
|
1385
|
-
ref:
|
|
1386
|
+
ref: c,
|
|
1386
1387
|
itemCount: e.length,
|
|
1387
|
-
width:
|
|
1388
|
-
height:
|
|
1389
|
-
children: ({ index: I, style:
|
|
1388
|
+
width: m,
|
|
1389
|
+
height: d,
|
|
1390
|
+
children: ({ index: I, style: v }) => /* @__PURE__ */ s(
|
|
1390
1391
|
As,
|
|
1391
1392
|
{
|
|
1392
|
-
style: { ...
|
|
1393
|
+
style: { ...v, maxHeight: 48 },
|
|
1393
1394
|
...e[I],
|
|
1394
1395
|
openItemDetail: () => n(e[I].userId),
|
|
1395
1396
|
isCurrentUser: !!t && t === e[I].userId
|
|
@@ -1423,8 +1424,8 @@ const ms = /* @__PURE__ */ o("div")({
|
|
|
1423
1424
|
);
|
|
1424
1425
|
}, zs = ({ gamification: e, hideTabs: t }) => {
|
|
1425
1426
|
const { data: n } = _(e.leaderboardList.$store), i = ue(0), r = q(
|
|
1426
|
-
|
|
1427
|
-
Math.abs(i.current -
|
|
1427
|
+
$e((m) => {
|
|
1428
|
+
Math.abs(i.current - m.scrollOffset) < 112 || (i.current = m.scrollOffset, t(m.scrollOffset !== 0 && m.scrollDirection === "forward"));
|
|
1428
1429
|
}, 200),
|
|
1429
1430
|
[t]
|
|
1430
1431
|
);
|
|
@@ -1470,11 +1471,11 @@ const ms = /* @__PURE__ */ o("div")({
|
|
|
1470
1471
|
name: "QuestionContent",
|
|
1471
1472
|
class: "q1uz5j1g",
|
|
1472
1473
|
propsAsIs: !1
|
|
1473
|
-
}),
|
|
1474
|
+
}), Rs = /* @__PURE__ */ o("button")({
|
|
1474
1475
|
name: "PlayButton",
|
|
1475
1476
|
class: "p1pba9p1",
|
|
1476
1477
|
propsAsIs: !1
|
|
1477
|
-
}),
|
|
1478
|
+
}), $s = {
|
|
1478
1479
|
[X.LOST]: /* @__PURE__ */ s(ne, { name: "incorrectVoted" }),
|
|
1479
1480
|
[X.WON]: /* @__PURE__ */ s(ne, { name: "icon-check" }),
|
|
1480
1481
|
[X.UNSET]: /* @__PURE__ */ s(ne, { name: "icon-arrow" }),
|
|
@@ -1485,11 +1486,11 @@ const ms = /* @__PURE__ */ o("div")({
|
|
|
1485
1486
|
questionStatus: n,
|
|
1486
1487
|
subject: i,
|
|
1487
1488
|
openForVoting: r,
|
|
1488
|
-
openQuestion:
|
|
1489
|
-
status:
|
|
1489
|
+
openQuestion: m,
|
|
1490
|
+
status: d
|
|
1490
1491
|
}) => {
|
|
1491
|
-
const l = Ee[t],
|
|
1492
|
-
return l ? /* @__PURE__ */ p(xs, { onClick: () =>
|
|
1492
|
+
const l = Ee[t], c = $s[d];
|
|
1493
|
+
return l ? /* @__PURE__ */ p(xs, { onClick: () => m == null ? void 0 : m(e), children: [
|
|
1493
1494
|
/* @__PURE__ */ p(Ls, { children: [
|
|
1494
1495
|
/* @__PURE__ */ p(Os, { children: [
|
|
1495
1496
|
/* @__PURE__ */ s(
|
|
@@ -1502,12 +1503,12 @@ const ms = /* @__PURE__ */ o("div")({
|
|
|
1502
1503
|
),
|
|
1503
1504
|
/* @__PURE__ */ p(Es, { children: [
|
|
1504
1505
|
l.label,
|
|
1505
|
-
t === y.TRIVIA && n ===
|
|
1506
|
+
t === y.TRIVIA && n === $.RESOLVED && " • Expired"
|
|
1506
1507
|
] })
|
|
1507
1508
|
] }),
|
|
1508
1509
|
/* @__PURE__ */ s(bs, { children: i || "" })
|
|
1509
1510
|
] }),
|
|
1510
|
-
/* @__PURE__ */ s(Cs, { children: r ? /* @__PURE__ */ s(
|
|
1511
|
+
/* @__PURE__ */ s(Cs, { children: r ? /* @__PURE__ */ s(Rs, { children: "Play" }) : c })
|
|
1511
1512
|
] }) : null;
|
|
1512
1513
|
}, Us = /* @__PURE__ */ o("div")({
|
|
1513
1514
|
name: "Container",
|
|
@@ -1550,8 +1551,8 @@ const ms = /* @__PURE__ */ o("div")({
|
|
|
1550
1551
|
const r = new Date(t);
|
|
1551
1552
|
if (Me(r))
|
|
1552
1553
|
return {
|
|
1553
|
-
date:
|
|
1554
|
-
time:
|
|
1554
|
+
date: ve(r),
|
|
1555
|
+
time: ge(r)
|
|
1555
1556
|
};
|
|
1556
1557
|
}
|
|
1557
1558
|
return null;
|
|
@@ -1571,18 +1572,18 @@ const ms = /* @__PURE__ */ o("div")({
|
|
|
1571
1572
|
class: "qvghv3l",
|
|
1572
1573
|
propsAsIs: !1
|
|
1573
1574
|
}), Gs = ({ questions: e, openQuestion: t }) => /* @__PURE__ */ s(Hs, { children: e == null ? void 0 : e.map((n) => {
|
|
1574
|
-
var i, r,
|
|
1575
|
+
var i, r, m;
|
|
1575
1576
|
if (n.type === "question" && ((i = n.attributes) == null ? void 0 : i.attributes.case) === "question") {
|
|
1576
|
-
const
|
|
1577
|
-
return /* @__PURE__ */ s(Qs, { openQuestion: t, ...
|
|
1577
|
+
const d = n.attributes.attributes.value;
|
|
1578
|
+
return /* @__PURE__ */ s(Qs, { openQuestion: t, ...d }, d.questionId);
|
|
1578
1579
|
}
|
|
1579
1580
|
if (n.type === "insight" && ((r = n.attributes) == null ? void 0 : r.attributes.case) === "insight") {
|
|
1580
|
-
const
|
|
1581
|
-
return /* @__PURE__ */ s(qs, { openInsight: t, ...
|
|
1581
|
+
const d = n.attributes.attributes.value, l = n.attributes.created;
|
|
1582
|
+
return /* @__PURE__ */ s(qs, { openInsight: t, ...d, created: l }, d.questionId);
|
|
1582
1583
|
}
|
|
1583
|
-
if (n.type === "tweet" && ((
|
|
1584
|
-
const
|
|
1585
|
-
return /* @__PURE__ */ s(Bs, { openTweet: t, ...
|
|
1584
|
+
if (n.type === "tweet" && ((m = n.attributes) == null ? void 0 : m.attributes.case) === "tweet") {
|
|
1585
|
+
const d = n.attributes.attributes.value, l = n.attributes.id, c = n.attributes.created;
|
|
1586
|
+
return /* @__PURE__ */ s(Bs, { openTweet: t, ...d, tweetId: l, created: c }, l);
|
|
1586
1587
|
}
|
|
1587
1588
|
return null;
|
|
1588
1589
|
}) }), Zs = ({ store: e, openQuestion: t }) => {
|
|
@@ -1590,10 +1591,10 @@ const ms = /* @__PURE__ */ o("div")({
|
|
|
1590
1591
|
return n != null && n.data ? /* @__PURE__ */ s(Gs, { openQuestion: t, questions: n.data }) : /* @__PURE__ */ s("div", { children: "wait questions..." });
|
|
1591
1592
|
}, Js = ({ userSummary: e }) => {
|
|
1592
1593
|
var t;
|
|
1593
|
-
const [n, i] =
|
|
1594
|
+
const [n, i] = R(void 0);
|
|
1594
1595
|
return fe(() => {
|
|
1595
|
-
const r = e.subscribe((
|
|
1596
|
-
|
|
1596
|
+
const r = e.subscribe((m) => {
|
|
1597
|
+
m != null && m.data && i(m.data);
|
|
1597
1598
|
});
|
|
1598
1599
|
return () => {
|
|
1599
1600
|
r();
|
|
@@ -1602,30 +1603,30 @@ const ms = /* @__PURE__ */ o("div")({
|
|
|
1602
1603
|
}, Ks = ({
|
|
1603
1604
|
gamification: e
|
|
1604
1605
|
}) => {
|
|
1605
|
-
const [t, n] =
|
|
1606
|
-
|
|
1607
|
-
},
|
|
1608
|
-
|
|
1609
|
-
}, S = q(
|
|
1610
|
-
const
|
|
1611
|
-
if (!
|
|
1606
|
+
const [t, n] = R(!1), [i, r] = R(G.HOME), m = ue(null), d = ue(0), [l, c] = Je(), I = (g) => {
|
|
1607
|
+
c(() => r(g));
|
|
1608
|
+
}, v = (g) => {
|
|
1609
|
+
c(() => n(g));
|
|
1610
|
+
}, S = q($e(() => {
|
|
1611
|
+
const g = m.current;
|
|
1612
|
+
if (!g)
|
|
1612
1613
|
return;
|
|
1613
1614
|
const {
|
|
1614
1615
|
scrollTop: N
|
|
1615
|
-
} =
|
|
1616
|
+
} = g;
|
|
1616
1617
|
if (N === 0) {
|
|
1617
|
-
|
|
1618
|
+
d.current = 0, v(!1);
|
|
1618
1619
|
return;
|
|
1619
1620
|
}
|
|
1620
|
-
if (Math.abs(
|
|
1621
|
+
if (Math.abs(d.current - N) < 112)
|
|
1621
1622
|
return;
|
|
1622
|
-
const z =
|
|
1623
|
-
|
|
1623
|
+
const z = d.current < N ? "forward" : "backward";
|
|
1624
|
+
d.current = N, v(z === "forward");
|
|
1624
1625
|
}, 200), []);
|
|
1625
1626
|
return fe(() => {
|
|
1626
|
-
const
|
|
1627
|
-
return
|
|
1628
|
-
|
|
1627
|
+
const g = m.current;
|
|
1628
|
+
return g ? (i === G.HOME && g.addEventListener("scroll", S), () => {
|
|
1629
|
+
g.removeEventListener("scroll", S);
|
|
1629
1630
|
}) : () => {
|
|
1630
1631
|
};
|
|
1631
1632
|
}, [i, S]), /* @__PURE__ */ p("div", {
|
|
@@ -1646,7 +1647,7 @@ const ms = /* @__PURE__ */ o("div")({
|
|
|
1646
1647
|
toggleActivePage: I
|
|
1647
1648
|
})
|
|
1648
1649
|
}), i === G.HOME && /* @__PURE__ */ p(Ie, {
|
|
1649
|
-
ref:
|
|
1650
|
+
ref: m,
|
|
1650
1651
|
children: [/* @__PURE__ */ s(de, {
|
|
1651
1652
|
style: {
|
|
1652
1653
|
paddingTop: "12px"
|
|
@@ -1664,7 +1665,7 @@ const ms = /* @__PURE__ */ o("div")({
|
|
|
1664
1665
|
className: "c1bp9dj2",
|
|
1665
1666
|
children: /* @__PURE__ */ s(zs, {
|
|
1666
1667
|
gamification: e,
|
|
1667
|
-
hideTabs:
|
|
1668
|
+
hideTabs: v
|
|
1668
1669
|
})
|
|
1669
1670
|
})]
|
|
1670
1671
|
});
|
|
@@ -1682,7 +1683,7 @@ const ms = /* @__PURE__ */ o("div")({
|
|
|
1682
1683
|
}) => {
|
|
1683
1684
|
const n = e + t;
|
|
1684
1685
|
return n === 0 ? 0 : Math.round(e / n * 100);
|
|
1685
|
-
},
|
|
1686
|
+
}, vi = ({
|
|
1686
1687
|
gamification: e,
|
|
1687
1688
|
className: t
|
|
1688
1689
|
}) => {
|
|
@@ -1716,5 +1717,5 @@ const ms = /* @__PURE__ */ o("div")({
|
|
|
1716
1717
|
});
|
|
1717
1718
|
};
|
|
1718
1719
|
export {
|
|
1719
|
-
|
|
1720
|
+
vi as default
|
|
1720
1721
|
};
|