@streamlayer/react 0.30.4 → 0.30.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/gamification-feature.js +1 -1
- package/lib/cjs/masters2.js +2 -2
- package/lib/dist/cjs/gamification-feature.js +1 -1
- package/lib/dist/cjs/masters.js +3 -3
- package/lib/dist/es/gamification-feature.js +157 -152
- package/lib/dist/es/masters.js +32 -26
- package/lib/dist/style.css +1 -1
- package/lib/es/gamification-feature.js +249 -244
- package/lib/es/masters2.js +304 -298
- package/lib/style.css +1 -1
- package/package.json +7 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as p, jsx as s, Fragment as b } from "react/jsx-runtime";
|
|
2
2
|
import { s as o, i as j } from "./index3.js";
|
|
3
|
-
import { useStore as
|
|
3
|
+
import { useStore as k } from "@nanostores/react";
|
|
4
4
|
import { o as Ne, r as te, w as $e, A as Re, O as Qe, a as K, n as Ue, d as _e } from "./masters2.js";
|
|
5
5
|
import { useState as R, useCallback as F, useMemo as W, createElement as H, PureComponent as Ae } from "react";
|
|
6
6
|
import { QuestionType as x, QuestionStatus as Q, QuestionImages as $, PickHistoryStatus as q } from "@streamlayer/sdk-web-types";
|
|
@@ -38,8 +38,8 @@ const Ve = /* @__PURE__ */ o("div")({
|
|
|
38
38
|
propsAsIs: !0
|
|
39
39
|
}), De = ({ type: e, close: t, label: n }) => {
|
|
40
40
|
const i = e ? Ne[e] : { label: n, iconName: void 0 };
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ p(Ve, { children: [
|
|
42
|
+
/* @__PURE__ */ p(Fe, { children: [
|
|
43
43
|
(i == null ? void 0 : i.iconName) && /* @__PURE__ */ s(He, { name: i.iconName }),
|
|
44
44
|
(i == null ? void 0 : i.label) && /* @__PURE__ */ s(Ze, { children: i.label })
|
|
45
45
|
] }),
|
|
@@ -57,7 +57,7 @@ const Ve = /* @__PURE__ */ o("div")({
|
|
|
57
57
|
name: "Indicator",
|
|
58
58
|
class: "i1fbnvpb",
|
|
59
59
|
propsAsIs: !1
|
|
60
|
-
}), oe = ({ indicator: e, title: t }) => /* @__PURE__ */
|
|
60
|
+
}), oe = ({ indicator: e, title: t }) => /* @__PURE__ */ p(Xe, { children: [
|
|
61
61
|
/* @__PURE__ */ s(et, { children: t }),
|
|
62
62
|
/* @__PURE__ */ s(tt, { children: e })
|
|
63
63
|
] }), nt = /* @__PURE__ */ o("div")({
|
|
@@ -72,7 +72,7 @@ const Ve = /* @__PURE__ */ o("div")({
|
|
|
72
72
|
name: "Title",
|
|
73
73
|
class: "t8s05oq",
|
|
74
74
|
propsAsIs: !1
|
|
75
|
-
}), Y = ({ indicator: e, title: t }) => /* @__PURE__ */
|
|
75
|
+
}), Y = ({ indicator: e, title: t }) => /* @__PURE__ */ p(nt, { children: [
|
|
76
76
|
/* @__PURE__ */ s(st, { children: e }),
|
|
77
77
|
/* @__PURE__ */ s(it, { children: t })
|
|
78
78
|
] }), rt = /* @__PURE__ */ o("div")({
|
|
@@ -150,28 +150,28 @@ const Ve = /* @__PURE__ */ o("div")({
|
|
|
150
150
|
friendsRank: i,
|
|
151
151
|
rank: r,
|
|
152
152
|
streak: I,
|
|
153
|
-
correct:
|
|
154
|
-
incorrect:
|
|
153
|
+
correct: u,
|
|
154
|
+
incorrect: m,
|
|
155
155
|
inTop: d,
|
|
156
156
|
successRate: h
|
|
157
|
-
}) => /* @__PURE__ */
|
|
158
|
-
/* @__PURE__ */ s(ot, { children: /* @__PURE__ */
|
|
159
|
-
/* @__PURE__ */
|
|
157
|
+
}) => /* @__PURE__ */ p(rt, { children: [
|
|
158
|
+
/* @__PURE__ */ s(ot, { children: /* @__PURE__ */ p(lt, { children: [
|
|
159
|
+
/* @__PURE__ */ p(At, { children: [
|
|
160
160
|
e && /* @__PURE__ */ s(ct, { alt: "avatar", src: e }),
|
|
161
161
|
!e && /* @__PURE__ */ s(Nt, { children: ye(t || "") })
|
|
162
162
|
] }),
|
|
163
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ p(dt, { children: [
|
|
164
164
|
/* @__PURE__ */ s(ut, { children: t }),
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ p(pt, { children: [
|
|
166
|
+
/* @__PURE__ */ p(It, { children: [
|
|
167
167
|
/* @__PURE__ */ s(mt, { alt: "rank-icon", src: yt }),
|
|
168
|
-
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ p(ht, { children: [
|
|
169
169
|
Te(n),
|
|
170
170
|
/* @__PURE__ */ s(ft, { children: "PTS" })
|
|
171
171
|
] })
|
|
172
172
|
] }),
|
|
173
173
|
/* @__PURE__ */ s(gt, {}),
|
|
174
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ p("div", { children: [
|
|
175
175
|
"TOP ",
|
|
176
176
|
d || 0,
|
|
177
177
|
"%"
|
|
@@ -179,15 +179,15 @@ const Ve = /* @__PURE__ */ o("div")({
|
|
|
179
179
|
] })
|
|
180
180
|
] })
|
|
181
181
|
] }) }),
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ p(at, { children: [
|
|
183
|
+
/* @__PURE__ */ p(Mt, { children: [
|
|
184
184
|
/* @__PURE__ */ s(oe, { indicator: i || 0, title: "Friends rank" }),
|
|
185
185
|
/* @__PURE__ */ s(oe, { indicator: r || 0, title: "Global rank" })
|
|
186
186
|
] }),
|
|
187
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ p(vt, { children: [
|
|
188
188
|
/* @__PURE__ */ s(Y, { indicator: I || 0, title: "Win streak" }),
|
|
189
|
-
/* @__PURE__ */ s(Y, { indicator:
|
|
190
|
-
/* @__PURE__ */ s(Y, { indicator:
|
|
189
|
+
/* @__PURE__ */ s(Y, { indicator: u || 0, title: "Correct" }),
|
|
190
|
+
/* @__PURE__ */ s(Y, { indicator: m || 0, title: "Incorrect" }),
|
|
191
191
|
/* @__PURE__ */ s(Y, { indicator: `${h || 0}%`, title: "Succ. rate" })
|
|
192
192
|
] })
|
|
193
193
|
] })
|
|
@@ -203,7 +203,7 @@ const Ve = /* @__PURE__ */ o("div")({
|
|
|
203
203
|
name: "Description",
|
|
204
204
|
class: "dlaj9xp",
|
|
205
205
|
propsAsIs: !1
|
|
206
|
-
}), zt = ({ title: e, description: t }) => /* @__PURE__ */
|
|
206
|
+
}), zt = ({ title: e, description: t }) => /* @__PURE__ */ p(Tt, { children: [
|
|
207
207
|
/* @__PURE__ */ s(j, { name: "icon-check-circle" }),
|
|
208
208
|
/* @__PURE__ */ s(Dt, { children: e }),
|
|
209
209
|
/* @__PURE__ */ s(St, { children: t })
|
|
@@ -223,7 +223,7 @@ const Ve = /* @__PURE__ */ o("div")({
|
|
|
223
223
|
name: "FeedbackHeader",
|
|
224
224
|
class: "f455ozj",
|
|
225
225
|
propsAsIs: !1
|
|
226
|
-
}),
|
|
226
|
+
}), Ct = /* @__PURE__ */ o("span")({
|
|
227
227
|
name: "FeedbackTitle",
|
|
228
228
|
class: "f1913njx",
|
|
229
229
|
propsAsIs: !1
|
|
@@ -231,11 +231,11 @@ const Ve = /* @__PURE__ */ o("div")({
|
|
|
231
231
|
name: "FeedbackDescription",
|
|
232
232
|
class: "fzfk69z",
|
|
233
233
|
propsAsIs: !1
|
|
234
|
-
}),
|
|
234
|
+
}), kt = /* @__PURE__ */ o("div")({
|
|
235
235
|
name: "FeedbackText",
|
|
236
236
|
class: "fx87qaj",
|
|
237
237
|
propsAsIs: !1
|
|
238
|
-
}),
|
|
238
|
+
}), wt = ({
|
|
239
239
|
feedbackMessages: e,
|
|
240
240
|
questionVotedCorrectly: t,
|
|
241
241
|
questionVoted: n,
|
|
@@ -243,26 +243,26 @@ const Ve = /* @__PURE__ */ o("div")({
|
|
|
243
243
|
hasCorrectAnswer: r,
|
|
244
244
|
questionStatus: I
|
|
245
245
|
}) => {
|
|
246
|
-
const
|
|
247
|
-
if (!
|
|
246
|
+
const u = n && (i === x.TRIVIA || i === x.PREDICTION);
|
|
247
|
+
if (!u && I !== Q.RESOLVED)
|
|
248
248
|
return null;
|
|
249
|
-
const
|
|
250
|
-
return /* @__PURE__ */
|
|
251
|
-
I === Q.RESOLVED && i === x.TRIVIA && !n && /* @__PURE__ */
|
|
249
|
+
const m = i === x.PREDICTION && !r, d = t ? "correct" : "incorrect", h = t ? e.correctFeedback : e.incorrectFeedback;
|
|
250
|
+
return /* @__PURE__ */ p(xt, { "data-isPrediction": m, children: [
|
|
251
|
+
I === Q.RESOLVED && i === x.TRIVIA && !n && /* @__PURE__ */ p(b, { children: [
|
|
252
252
|
/* @__PURE__ */ s(ae, { children: /* @__PURE__ */ s(j, { name: "questionExpired" }) }),
|
|
253
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ p("div", { children: [
|
|
254
254
|
/* @__PURE__ */ s(le, { children: /* @__PURE__ */ s(Z, { children: "Question Expired" }) }),
|
|
255
|
-
/* @__PURE__ */ s(
|
|
255
|
+
/* @__PURE__ */ s(kt, { children: "You can still answer to see if you're correct, but no points are awarded for expired questions." })
|
|
256
256
|
] })
|
|
257
257
|
] }),
|
|
258
|
-
|
|
258
|
+
u && m && /* @__PURE__ */ p(b, { children: [
|
|
259
259
|
/* @__PURE__ */ s(Ot, { name: "icon-prediction" }),
|
|
260
260
|
/* @__PURE__ */ s(Z, { children: "Stay tuned to see if your prediction was correct." })
|
|
261
261
|
] }),
|
|
262
|
-
|
|
262
|
+
u && r && /* @__PURE__ */ p(b, { children: [
|
|
263
263
|
/* @__PURE__ */ s(ae, { "data-feedbackType": d, children: /* @__PURE__ */ s(j, { name: d }) }),
|
|
264
|
-
/* @__PURE__ */ s("div", { children: /* @__PURE__ */
|
|
265
|
-
/* @__PURE__ */ s(
|
|
264
|
+
/* @__PURE__ */ s("div", { children: /* @__PURE__ */ p(le, { children: [
|
|
265
|
+
/* @__PURE__ */ s(Ct, { "data-feedbackType": d, children: h == null ? void 0 : h.title }),
|
|
266
266
|
/* @__PURE__ */ s(Z, { children: h == null ? void 0 : h.description })
|
|
267
267
|
] }) })
|
|
268
268
|
] })
|
|
@@ -362,8 +362,8 @@ const Ve = /* @__PURE__ */ o("div")({
|
|
|
362
362
|
text: r,
|
|
363
363
|
percentageDecimal: I,
|
|
364
364
|
// extra props
|
|
365
|
-
onVote:
|
|
366
|
-
youSelected:
|
|
365
|
+
onVote: u,
|
|
366
|
+
youSelected: m,
|
|
367
367
|
questionVoted: d,
|
|
368
368
|
// ToDo: Figure out why imageMode is not in the response, and delete default value
|
|
369
369
|
imageMode: h,
|
|
@@ -374,22 +374,22 @@ const Ve = /* @__PURE__ */ o("div")({
|
|
|
374
374
|
correct: T,
|
|
375
375
|
hasCorrectAnswer: a
|
|
376
376
|
} = e, l = Jt(e), c = Kt({ questionType: y, questionVoted: d, correct: T, hasCorrectAnswer: a, questionStatus: D }), f = d || D === Q.RESOLVED && y === x.PREDICTION;
|
|
377
|
-
return /* @__PURE__ */
|
|
377
|
+
return /* @__PURE__ */ p(
|
|
378
378
|
Rt,
|
|
379
379
|
{
|
|
380
380
|
value: n,
|
|
381
|
-
"data-selected":
|
|
381
|
+
"data-selected": m,
|
|
382
382
|
"data-answerState": l,
|
|
383
383
|
disabled: d || N || A,
|
|
384
|
-
onClick:
|
|
384
|
+
onClick: u,
|
|
385
385
|
children: [
|
|
386
386
|
f && /* @__PURE__ */ s(Qt, { "data-answerState": l, style: { width: `${I}%` } }),
|
|
387
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ p(Ut, { children: [
|
|
388
388
|
i && h && ((t = ce[h]) == null ? void 0 : t.call(ce, i)),
|
|
389
389
|
/* @__PURE__ */ s(Ft, { children: r }),
|
|
390
|
-
f && /* @__PURE__ */
|
|
390
|
+
f && /* @__PURE__ */ p(Bt, { children: [
|
|
391
391
|
c && /* @__PURE__ */ s(Gt, { name: "selected" }),
|
|
392
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ p(Ht, { children: [
|
|
393
393
|
I,
|
|
394
394
|
"%"
|
|
395
395
|
] })
|
|
@@ -411,9 +411,9 @@ const Ve = /* @__PURE__ */ o("div")({
|
|
|
411
411
|
remainingTime: d
|
|
412
412
|
}) => /* @__PURE__ */ s(nn, {
|
|
413
413
|
children: d
|
|
414
|
-
}),
|
|
414
|
+
}), u = F(() => {
|
|
415
415
|
n == null || n(), r(rn);
|
|
416
|
-
}, [n, r]),
|
|
416
|
+
}, [n, r]), m = F((d) => {
|
|
417
417
|
d === 10 && r(de);
|
|
418
418
|
}, [r]);
|
|
419
419
|
return /* @__PURE__ */ s(We, {
|
|
@@ -425,8 +425,8 @@ const Ve = /* @__PURE__ */ o("div")({
|
|
|
425
425
|
strokeWidth: 2,
|
|
426
426
|
trailStrokeWidth: 2,
|
|
427
427
|
trailColor: i,
|
|
428
|
-
onComplete:
|
|
429
|
-
onUpdate:
|
|
428
|
+
onComplete: u,
|
|
429
|
+
onUpdate: m,
|
|
430
430
|
children: I
|
|
431
431
|
});
|
|
432
432
|
}, an = /* @__PURE__ */ o("div")({
|
|
@@ -457,12 +457,12 @@ const Ve = /* @__PURE__ */ o("div")({
|
|
|
457
457
|
name: "PointsUnits",
|
|
458
458
|
class: "pe5g05h",
|
|
459
459
|
propsAsIs: !1
|
|
460
|
-
}), hn = ({ title: e, points: t, isPlayingTimer: n, isTimer: i, onTimerExpired: r }) => /* @__PURE__ */
|
|
461
|
-
/* @__PURE__ */
|
|
460
|
+
}), hn = ({ title: e, points: t, isPlayingTimer: n, isTimer: i, onTimerExpired: r }) => /* @__PURE__ */ p(an, { children: [
|
|
461
|
+
/* @__PURE__ */ p(ln, { children: [
|
|
462
462
|
e && /* @__PURE__ */ s(cn, { children: e }),
|
|
463
|
-
t !== void 0 && /* @__PURE__ */
|
|
463
|
+
t !== void 0 && /* @__PURE__ */ p(b, { children: [
|
|
464
464
|
/* @__PURE__ */ s(un, { name: "icon-trophy" }),
|
|
465
|
-
/* @__PURE__ */
|
|
465
|
+
/* @__PURE__ */ p(pn, { children: [
|
|
466
466
|
/* @__PURE__ */ s(mn, { children: t }),
|
|
467
467
|
/* @__PURE__ */ s(In, { children: "PTS" })
|
|
468
468
|
] })
|
|
@@ -471,7 +471,7 @@ const Ve = /* @__PURE__ */ o("div")({
|
|
|
471
471
|
i && /* @__PURE__ */ s(on, { isPlaying: n, onTimerExpired: r })
|
|
472
472
|
] }), fn = ({ openedQuestion: e, vote: t, close: n }) => {
|
|
473
473
|
var i;
|
|
474
|
-
const r = e.subject, I = e.type,
|
|
474
|
+
const r = e.subject, I = e.type, u = (i = e.options) == null ? void 0 : i.options, [m, d] = R(!1), [h, A] = R(!1), [D, N] = R(""), y = e == null ? void 0 : e.id, T = F(
|
|
475
475
|
async (v) => {
|
|
476
476
|
if (y) {
|
|
477
477
|
const g = v.currentTarget.value;
|
|
@@ -496,16 +496,16 @@ const Ve = /* @__PURE__ */ o("div")({
|
|
|
496
496
|
isLoading: h,
|
|
497
497
|
hasCorrectAnswer: c,
|
|
498
498
|
questionType: e.type,
|
|
499
|
-
answerTimeExpired:
|
|
499
|
+
answerTimeExpired: m,
|
|
500
500
|
questionStatus: e.status,
|
|
501
501
|
imageMode: (g = e.appearance) == null ? void 0 : g.images,
|
|
502
502
|
// ToDo: Figure out why imageMode is not in the response
|
|
503
503
|
onVote: T
|
|
504
504
|
};
|
|
505
|
-
}) : [], [c,
|
|
506
|
-
return /* @__PURE__ */ s(te, { "data-question-header": "true", children: /* @__PURE__ */ s(bt, { children: /* @__PURE__ */
|
|
505
|
+
}) : [], [c, m, h, e, l, T, D]), M = u && (u.case === "trivia" || u.case === "prediction") ? u.value : void 0;
|
|
506
|
+
return /* @__PURE__ */ s(te, { "data-question-header": "true", children: /* @__PURE__ */ s(bt, { children: /* @__PURE__ */ p(Et, { children: [
|
|
507
507
|
M && /* @__PURE__ */ s(
|
|
508
|
-
|
|
508
|
+
wt,
|
|
509
509
|
{
|
|
510
510
|
feedbackMessages: M,
|
|
511
511
|
questionVoted: !!l,
|
|
@@ -515,23 +515,23 @@ const Ve = /* @__PURE__ */ o("div")({
|
|
|
515
515
|
questionStatus: e.status
|
|
516
516
|
}
|
|
517
517
|
),
|
|
518
|
-
/* @__PURE__ */ s(
|
|
518
|
+
e.type !== x.PREDICTION && /* @__PURE__ */ s(
|
|
519
519
|
hn,
|
|
520
520
|
{
|
|
521
|
-
title:
|
|
522
|
-
points:
|
|
521
|
+
title: m ? "Time expired" : "To win",
|
|
522
|
+
points: m ? void 0 : 100,
|
|
523
523
|
onTimerExpired: a,
|
|
524
524
|
isTimer: !0
|
|
525
525
|
}
|
|
526
526
|
),
|
|
527
|
-
|
|
527
|
+
m ? /* @__PURE__ */ s(
|
|
528
528
|
zt,
|
|
529
529
|
{
|
|
530
530
|
title: "More to come...",
|
|
531
531
|
description: "Watch for additional enhanced stream interactive experience."
|
|
532
532
|
}
|
|
533
|
-
) : /* @__PURE__ */
|
|
534
|
-
/* @__PURE__ */ s(Lt, { children: r }),
|
|
533
|
+
) : /* @__PURE__ */ p(b, { children: [
|
|
534
|
+
/* @__PURE__ */ s(Lt, { "data-isPrediction": e.type === x.PREDICTION, children: r }),
|
|
535
535
|
/* @__PURE__ */ s($t, { children: f.map((v) => /* @__PURE__ */ s(Xt, { ...v }, v.id)) })
|
|
536
536
|
] })
|
|
537
537
|
] }) }) });
|
|
@@ -555,57 +555,62 @@ const Ve = /* @__PURE__ */ o("div")({
|
|
|
555
555
|
name: "DateWrap",
|
|
556
556
|
class: "dd3lh3p",
|
|
557
557
|
propsAsIs: !1
|
|
558
|
-
}),
|
|
559
|
-
|
|
558
|
+
}), yn = /* @__PURE__ */ o("img")({
|
|
559
|
+
name: "Image",
|
|
560
|
+
class: "i1gfjeu5",
|
|
561
|
+
propsAsIs: !1
|
|
562
|
+
}), xe = ({ created: e, image: t, title: n, instantView: i }) => {
|
|
563
|
+
const r = W(() => {
|
|
560
564
|
if (e) {
|
|
561
|
-
const
|
|
562
|
-
if (qe(
|
|
565
|
+
const u = new Date(e);
|
|
566
|
+
if (qe(u))
|
|
563
567
|
return {
|
|
564
|
-
date: Ye(
|
|
565
|
-
time: Pe(
|
|
568
|
+
date: Ye(u),
|
|
569
|
+
time: Pe(u)
|
|
566
570
|
};
|
|
567
571
|
}
|
|
568
572
|
return null;
|
|
569
|
-
}, [e]);
|
|
570
|
-
return /* @__PURE__ */
|
|
571
|
-
|
|
572
|
-
|
|
573
|
+
}, [e]), I = (i == null ? void 0 : i.image) || t;
|
|
574
|
+
return /* @__PURE__ */ p(gn, { children: [
|
|
575
|
+
r && /* @__PURE__ */ p(An, { children: [
|
|
576
|
+
r.date,
|
|
573
577
|
" · ",
|
|
574
|
-
|
|
578
|
+
r.time
|
|
575
579
|
] }),
|
|
576
|
-
(
|
|
577
|
-
/* @__PURE__ */
|
|
578
|
-
|
|
579
|
-
/* @__PURE__ */ s(
|
|
580
|
+
(i == null ? void 0 : i.video) && /* @__PURE__ */ s($e, { source: i.video.url, poster: i.video.thumbnailUrl }),
|
|
581
|
+
I && /* @__PURE__ */ s(yn, { src: I }),
|
|
582
|
+
/* @__PURE__ */ p(Mn, { children: [
|
|
583
|
+
/* @__PURE__ */ s(vn, { children: (i == null ? void 0 : i.heading) || n }),
|
|
584
|
+
/* @__PURE__ */ s(Nn, { children: i == null ? void 0 : i.body })
|
|
580
585
|
] })
|
|
581
586
|
] });
|
|
582
|
-
},
|
|
587
|
+
}, Tn = /* @__PURE__ */ o("div")({
|
|
583
588
|
name: "Container",
|
|
584
589
|
class: "c1euiow",
|
|
585
590
|
propsAsIs: !1
|
|
586
|
-
}),
|
|
591
|
+
}), Dn = /* @__PURE__ */ o("a")({
|
|
587
592
|
name: "WebLinkBtn",
|
|
588
593
|
class: "w19zie3h",
|
|
589
594
|
propsAsIs: !1
|
|
590
|
-
}),
|
|
595
|
+
}), Sn = ({ instantView: e, ...t }) => /* @__PURE__ */ p(Tn, { children: [
|
|
591
596
|
/* @__PURE__ */ s(xe, { instantView: e, ...t }),
|
|
592
|
-
(e == null ? void 0 : e.webLink) && /* @__PURE__ */
|
|
597
|
+
(e == null ? void 0 : e.webLink) && /* @__PURE__ */ p(Dn, { href: e == null ? void 0 : e.webLink.url, target: "_blank", children: [
|
|
593
598
|
"Explore more of the Masters History",
|
|
594
599
|
/* @__PURE__ */ s(j, { name: "icon-external-link" })
|
|
595
600
|
] })
|
|
596
|
-
] }),
|
|
601
|
+
] }), zn = /* @__PURE__ */ o("div")({
|
|
597
602
|
name: "QuestionContainer",
|
|
598
603
|
class: "qdri6g3",
|
|
599
604
|
propsAsIs: !1
|
|
600
|
-
}),
|
|
605
|
+
}), xn = ({
|
|
601
606
|
openedQuestion: e
|
|
602
607
|
}) => {
|
|
603
608
|
var t;
|
|
604
|
-
return ((t = e == null ? void 0 : e.attributes) == null ? void 0 : t.attributes.case) === "insight" ? /* @__PURE__ */ s(
|
|
609
|
+
return ((t = e == null ? void 0 : e.attributes) == null ? void 0 : t.attributes.case) === "insight" ? /* @__PURE__ */ s(Sn, {
|
|
605
610
|
created: e.attributes.created,
|
|
606
611
|
...e.attributes.attributes.value
|
|
607
612
|
}) : null;
|
|
608
|
-
},
|
|
613
|
+
}, jn = ({
|
|
609
614
|
extendedQuestion: e,
|
|
610
615
|
vote: t,
|
|
611
616
|
close: n
|
|
@@ -619,27 +624,27 @@ const Ve = /* @__PURE__ */ o("div")({
|
|
|
619
624
|
close: n,
|
|
620
625
|
openedQuestion: r
|
|
621
626
|
}) : null;
|
|
622
|
-
},
|
|
627
|
+
}, On = ({
|
|
623
628
|
gamification: e
|
|
624
629
|
}) => {
|
|
625
630
|
var t;
|
|
626
|
-
const n =
|
|
631
|
+
const n = k(e.openedQuestion.$store), i = k(e.openedQuestion.$extendedStore);
|
|
627
632
|
if (!n)
|
|
628
633
|
return null;
|
|
629
634
|
const r = n.type;
|
|
630
|
-
return /* @__PURE__ */
|
|
635
|
+
return /* @__PURE__ */ p(zn, {
|
|
631
636
|
children: [/* @__PURE__ */ s(De, {
|
|
632
637
|
close: e.closeQuestion,
|
|
633
638
|
type: ((t = n.attributes) == null ? void 0 : t.type) || x.UNSET
|
|
634
|
-
}), r === "question" && /* @__PURE__ */ s(
|
|
639
|
+
}), r === "question" && /* @__PURE__ */ s(jn, {
|
|
635
640
|
vote: e.submitAnswer,
|
|
636
641
|
close: e.closeQuestion,
|
|
637
642
|
extendedQuestion: i
|
|
638
|
-
}), r !== "question" && /* @__PURE__ */ s(
|
|
643
|
+
}), r !== "question" && /* @__PURE__ */ s(xn, {
|
|
639
644
|
openedQuestion: n
|
|
640
645
|
})]
|
|
641
646
|
});
|
|
642
|
-
},
|
|
647
|
+
}, Cn = /* @__PURE__ */ o("div")({
|
|
643
648
|
name: "Container",
|
|
644
649
|
class: "c115qtkr",
|
|
645
650
|
propsAsIs: !1
|
|
@@ -651,13 +656,13 @@ const Ve = /* @__PURE__ */ o("div")({
|
|
|
651
656
|
name: "Button",
|
|
652
657
|
class: "b1umzux0",
|
|
653
658
|
propsAsIs: !1
|
|
654
|
-
}),
|
|
659
|
+
}), bn = /* @__PURE__ */ o("span")({
|
|
655
660
|
name: "Title",
|
|
656
661
|
class: "tspsaas",
|
|
657
662
|
propsAsIs: !1
|
|
658
663
|
});
|
|
659
664
|
var V = /* @__PURE__ */ ((e) => (e.HOME = "home", e.LEADERBOARD = "leaderboard", e))(V || {});
|
|
660
|
-
const ue = ({ title: e, active: t, onClick: n }) => /* @__PURE__ */ s(wn, { onClick: n, "data-selected": t, children: /* @__PURE__ */ s(
|
|
665
|
+
const ue = ({ title: e, active: t, onClick: n }) => /* @__PURE__ */ s(wn, { onClick: n, "data-selected": t, children: /* @__PURE__ */ s(bn, { children: e }) }), En = ({ activePage: e = "home", toggleActivePage: t }) => /* @__PURE__ */ s(Cn, { children: /* @__PURE__ */ p(kn, { "data-position": e === "home" ? "left" : "right", children: [
|
|
661
666
|
/* @__PURE__ */ s(ue, { title: "Home", active: e === "home", onClick: () => t(
|
|
662
667
|
"home"
|
|
663
668
|
/* HOME */
|
|
@@ -694,34 +699,34 @@ function ee(e, t) {
|
|
|
694
699
|
return i.__proto__ = r, i;
|
|
695
700
|
}, ee(e, t);
|
|
696
701
|
}
|
|
697
|
-
function
|
|
702
|
+
function Ln(e, t) {
|
|
698
703
|
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, ee(e, t);
|
|
699
704
|
}
|
|
700
705
|
var me = Number.isNaN || function(t) {
|
|
701
706
|
return typeof t == "number" && t !== t;
|
|
702
707
|
};
|
|
703
|
-
function
|
|
708
|
+
function $n(e, t) {
|
|
704
709
|
return !!(e === t || me(e) && me(t));
|
|
705
710
|
}
|
|
706
|
-
function
|
|
711
|
+
function Rn(e, t) {
|
|
707
712
|
if (e.length !== t.length)
|
|
708
713
|
return !1;
|
|
709
714
|
for (var n = 0; n < e.length; n++)
|
|
710
|
-
if (
|
|
715
|
+
if (!$n(e[n], t[n]))
|
|
711
716
|
return !1;
|
|
712
717
|
return !0;
|
|
713
718
|
}
|
|
714
719
|
function G(e, t) {
|
|
715
|
-
t === void 0 && (t =
|
|
720
|
+
t === void 0 && (t = Rn);
|
|
716
721
|
var n, i = [], r, I = !1;
|
|
717
|
-
function
|
|
718
|
-
for (var
|
|
719
|
-
|
|
720
|
-
return I && n === this && t(
|
|
722
|
+
function u() {
|
|
723
|
+
for (var m = [], d = 0; d < arguments.length; d++)
|
|
724
|
+
m[d] = arguments[d];
|
|
725
|
+
return I && n === this && t(m, i) || (r = e.apply(this, m), I = !0, n = this, i = m), r;
|
|
721
726
|
}
|
|
722
|
-
return
|
|
727
|
+
return u;
|
|
723
728
|
}
|
|
724
|
-
var
|
|
729
|
+
var Qn = typeof performance == "object" && typeof performance.now == "function", Ie = Qn ? function() {
|
|
725
730
|
return performance.now();
|
|
726
731
|
} : function() {
|
|
727
732
|
return Date.now();
|
|
@@ -729,7 +734,7 @@ var Rn = typeof performance == "object" && typeof performance.now == "function",
|
|
|
729
734
|
function he(e) {
|
|
730
735
|
cancelAnimationFrame(e.id);
|
|
731
736
|
}
|
|
732
|
-
function
|
|
737
|
+
function Un(e, t) {
|
|
733
738
|
var n = Ie();
|
|
734
739
|
function i() {
|
|
735
740
|
Ie() - n >= t ? e.call(null) : r.id = requestAnimationFrame(i);
|
|
@@ -747,23 +752,23 @@ function fe(e) {
|
|
|
747
752
|
}
|
|
748
753
|
return J;
|
|
749
754
|
}
|
|
750
|
-
var
|
|
755
|
+
var w = null;
|
|
751
756
|
function ge(e) {
|
|
752
|
-
if (e === void 0 && (e = !1),
|
|
757
|
+
if (e === void 0 && (e = !1), w === null || e) {
|
|
753
758
|
var t = document.createElement("div"), n = t.style;
|
|
754
759
|
n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
|
|
755
760
|
var i = document.createElement("div"), r = i.style;
|
|
756
|
-
return r.width = "100px", r.height = "100px", t.appendChild(i), document.body.appendChild(t), t.scrollLeft > 0 ?
|
|
761
|
+
return r.width = "100px", r.height = "100px", t.appendChild(i), document.body.appendChild(t), t.scrollLeft > 0 ? w = "positive-descending" : (t.scrollLeft = 1, t.scrollLeft === 0 ? w = "negative" : w = "positive-ascending"), document.body.removeChild(t), w;
|
|
757
762
|
}
|
|
758
|
-
return
|
|
763
|
+
return w;
|
|
759
764
|
}
|
|
760
|
-
var
|
|
765
|
+
var _n = 150, qn = function(t, n) {
|
|
761
766
|
return t;
|
|
762
767
|
};
|
|
763
|
-
function
|
|
764
|
-
var t, n = e.getItemOffset, i = e.getEstimatedTotalSize, r = e.getItemSize, I = e.getOffsetForIndexAndAlignment,
|
|
768
|
+
function Yn(e) {
|
|
769
|
+
var t, n = e.getItemOffset, i = e.getEstimatedTotalSize, r = e.getItemSize, I = e.getOffsetForIndexAndAlignment, u = e.getStartIndexForOffset, m = e.getStopIndexForStartIndex, d = e.initInstanceProps, h = e.shouldResetStyleCacheOnItemSizeChange, A = e.validateProps;
|
|
765
770
|
return t = /* @__PURE__ */ function(D) {
|
|
766
|
-
|
|
771
|
+
Ln(N, D);
|
|
767
772
|
function N(T) {
|
|
768
773
|
var a;
|
|
769
774
|
return a = D.call(this, T) || this, a._instanceProps = d(a.props, pe(a)), a._outerRef = void 0, a._resetIsScrollingTimeoutId = null, a.state = {
|
|
@@ -790,14 +795,14 @@ function qn(e) {
|
|
|
790
795
|
if (g.hasOwnProperty(l))
|
|
791
796
|
S = g[l];
|
|
792
797
|
else {
|
|
793
|
-
var z = n(a.props, l, a._instanceProps), O = r(a.props, l, a._instanceProps),
|
|
798
|
+
var z = n(a.props, l, a._instanceProps), O = r(a.props, l, a._instanceProps), C = f === "horizontal" || v === "horizontal", U = f === "rtl", _ = C ? z : 0;
|
|
794
799
|
g[l] = S = {
|
|
795
800
|
position: "absolute",
|
|
796
801
|
left: U ? void 0 : _,
|
|
797
802
|
right: U ? _ : void 0,
|
|
798
|
-
top:
|
|
799
|
-
height:
|
|
800
|
-
width:
|
|
803
|
+
top: C ? 0 : z,
|
|
804
|
+
height: C ? "100%" : O,
|
|
805
|
+
width: C ? O : "100%"
|
|
801
806
|
};
|
|
802
807
|
}
|
|
803
808
|
return S;
|
|
@@ -842,7 +847,7 @@ function qn(e) {
|
|
|
842
847
|
var c = a.props.outerRef;
|
|
843
848
|
a._outerRef = l, typeof c == "function" ? c(l) : c != null && typeof c == "object" && c.hasOwnProperty("current") && (c.current = l);
|
|
844
849
|
}, a._resetIsScrollingDebounced = function() {
|
|
845
|
-
a._resetIsScrollingTimeoutId !== null && he(a._resetIsScrollingTimeoutId), a._resetIsScrollingTimeoutId =
|
|
850
|
+
a._resetIsScrollingTimeoutId !== null && he(a._resetIsScrollingTimeoutId), a._resetIsScrollingTimeoutId = Un(a._resetIsScrolling, _n);
|
|
846
851
|
}, a._resetIsScrolling = function() {
|
|
847
852
|
a._resetIsScrollingTimeoutId = null, a.setState({
|
|
848
853
|
isScrolling: !1
|
|
@@ -852,7 +857,7 @@ function qn(e) {
|
|
|
852
857
|
}, a;
|
|
853
858
|
}
|
|
854
859
|
N.getDerivedStateFromProps = function(a, l) {
|
|
855
|
-
return
|
|
860
|
+
return Pn(a, l), A(a), null;
|
|
856
861
|
};
|
|
857
862
|
var y = N.prototype;
|
|
858
863
|
return y.scrollTo = function(a) {
|
|
@@ -907,14 +912,14 @@ function qn(e) {
|
|
|
907
912
|
}, y.componentWillUnmount = function() {
|
|
908
913
|
this._resetIsScrollingTimeoutId !== null && he(this._resetIsScrollingTimeoutId);
|
|
909
914
|
}, y.render = function() {
|
|
910
|
-
var a = this.props, l = a.children, c = a.className, f = a.direction, M = a.height, v = a.innerRef, g = a.innerElementType, S = a.innerTagName, z = a.itemCount, O = a.itemData,
|
|
915
|
+
var a = this.props, l = a.children, c = a.className, f = a.direction, M = a.height, v = a.innerRef, g = a.innerElementType, S = a.innerTagName, z = a.itemCount, O = a.itemData, C = a.itemKey, U = C === void 0 ? qn : C, _ = a.layout, je = a.outerElementType, Oe = a.outerTagName, Ce = a.style, ke = a.useIsScrolling, we = a.width, ne = this.state.isScrolling, B = f === "horizontal" || _ === "horizontal", be = B ? this._onScrollHorizontal : this._onScrollVertical, se = this._getRangeToRender(), Ee = se[0], Le = se[1], ie = [];
|
|
911
916
|
if (z > 0)
|
|
912
917
|
for (var L = Ee; L <= Le; L++)
|
|
913
918
|
ie.push(H(l, {
|
|
914
919
|
data: O,
|
|
915
920
|
key: U(L, O),
|
|
916
921
|
index: L,
|
|
917
|
-
isScrolling:
|
|
922
|
+
isScrolling: ke ? ne : void 0,
|
|
918
923
|
style: this._getItemStyle(L)
|
|
919
924
|
}));
|
|
920
925
|
var re = i(this.props, this._instanceProps);
|
|
@@ -925,12 +930,12 @@ function qn(e) {
|
|
|
925
930
|
style: X({
|
|
926
931
|
position: "relative",
|
|
927
932
|
height: M,
|
|
928
|
-
width:
|
|
933
|
+
width: we,
|
|
929
934
|
overflow: "auto",
|
|
930
935
|
WebkitOverflowScrolling: "touch",
|
|
931
936
|
willChange: "transform",
|
|
932
937
|
direction: f
|
|
933
|
-
},
|
|
938
|
+
}, Ce)
|
|
934
939
|
}, H(g || S || "div", {
|
|
935
940
|
children: ie,
|
|
936
941
|
ref: v,
|
|
@@ -956,8 +961,8 @@ function qn(e) {
|
|
|
956
961
|
var a = this.props, l = a.itemCount, c = a.overscanCount, f = this.state, M = f.isScrolling, v = f.scrollDirection, g = f.scrollOffset;
|
|
957
962
|
if (l === 0)
|
|
958
963
|
return [0, 0, 0, 0];
|
|
959
|
-
var S =
|
|
960
|
-
return [Math.max(0, S - O), Math.max(0, Math.min(l - 1, z +
|
|
964
|
+
var S = u(this.props, g, this._instanceProps), z = m(this.props, S, g, this._instanceProps), O = !M || v === "backward" ? Math.max(1, c) : 1, C = !M || v === "forward" ? Math.max(1, c) : 1;
|
|
965
|
+
return [Math.max(0, S - O), Math.max(0, Math.min(l - 1, z + C)), S, z];
|
|
961
966
|
}, N;
|
|
962
967
|
}(Ae), t.defaultProps = {
|
|
963
968
|
direction: "ltr",
|
|
@@ -967,9 +972,9 @@ function qn(e) {
|
|
|
967
972
|
useIsScrolling: !1
|
|
968
973
|
}, t;
|
|
969
974
|
}
|
|
970
|
-
var
|
|
975
|
+
var Pn = function(t, n) {
|
|
971
976
|
t.children, t.direction, t.height, t.layout, t.innerTagName, t.outerTagName, t.width, n.instance;
|
|
972
|
-
},
|
|
977
|
+
}, Wn = /* @__PURE__ */ Yn({
|
|
973
978
|
getItemOffset: function(t, n) {
|
|
974
979
|
var i = t.itemSize;
|
|
975
980
|
return n * i;
|
|
@@ -982,8 +987,8 @@ var Yn = function(t, n) {
|
|
|
982
987
|
var n = t.itemCount, i = t.itemSize;
|
|
983
988
|
return i * n;
|
|
984
989
|
},
|
|
985
|
-
getOffsetForIndexAndAlignment: function(t, n, i, r, I,
|
|
986
|
-
var
|
|
990
|
+
getOffsetForIndexAndAlignment: function(t, n, i, r, I, u) {
|
|
991
|
+
var m = t.direction, d = t.height, h = t.itemCount, A = t.itemSize, D = t.layout, N = t.width, y = m === "horizontal" || D === "horizontal", T = y ? N : d, a = Math.max(0, h * A - T), l = Math.min(a, n * A), c = Math.max(0, n * A - T + A + u);
|
|
987
992
|
switch (i === "smart" && (r >= c - T && r <= l + T ? i = "auto" : i = "center"), i) {
|
|
988
993
|
case "start":
|
|
989
994
|
return l;
|
|
@@ -1003,9 +1008,9 @@ var Yn = function(t, n) {
|
|
|
1003
1008
|
return Math.max(0, Math.min(i - 1, Math.floor(n / r)));
|
|
1004
1009
|
},
|
|
1005
1010
|
getStopIndexForStartIndex: function(t, n, i) {
|
|
1006
|
-
var r = t.direction, I = t.height,
|
|
1011
|
+
var r = t.direction, I = t.height, u = t.itemCount, m = t.itemSize, d = t.layout, h = t.width, A = r === "horizontal" || d === "horizontal", D = n * m, N = A ? h : I, y = Math.ceil((N + i - D) / m);
|
|
1007
1012
|
return Math.max(0, Math.min(
|
|
1008
|
-
|
|
1013
|
+
u - 1,
|
|
1009
1014
|
n + y - 1
|
|
1010
1015
|
// -1 is because stop index is inclusive
|
|
1011
1016
|
));
|
|
@@ -1017,34 +1022,34 @@ var Yn = function(t, n) {
|
|
|
1017
1022
|
t.itemSize;
|
|
1018
1023
|
}
|
|
1019
1024
|
});
|
|
1020
|
-
function
|
|
1025
|
+
function Vn(e) {
|
|
1021
1026
|
var t = e.lastRenderedStartIndex, n = e.lastRenderedStopIndex, i = e.startIndex, r = e.stopIndex;
|
|
1022
1027
|
return !(i > n || r < t);
|
|
1023
1028
|
}
|
|
1024
|
-
function
|
|
1025
|
-
for (var t = e.isItemLoaded, n = e.itemCount, i = e.minimumBatchSize, r = e.startIndex, I = e.stopIndex,
|
|
1029
|
+
function Fn(e) {
|
|
1030
|
+
for (var t = e.isItemLoaded, n = e.itemCount, i = e.minimumBatchSize, r = e.startIndex, I = e.stopIndex, u = [], m = null, d = null, h = r; h <= I; h++) {
|
|
1026
1031
|
var A = t(h);
|
|
1027
|
-
A ? d !== null && (
|
|
1032
|
+
A ? d !== null && (u.push(m, d), m = d = null) : (d = h, m === null && (m = h));
|
|
1028
1033
|
}
|
|
1029
1034
|
if (d !== null) {
|
|
1030
|
-
for (var D = Math.min(Math.max(d,
|
|
1035
|
+
for (var D = Math.min(Math.max(d, m + i - 1), n - 1), N = d + 1; N <= D && !t(N); N++)
|
|
1031
1036
|
d = N;
|
|
1032
|
-
|
|
1037
|
+
u.push(m, d);
|
|
1033
1038
|
}
|
|
1034
|
-
if (
|
|
1035
|
-
for (;
|
|
1036
|
-
var y =
|
|
1039
|
+
if (u.length)
|
|
1040
|
+
for (; u[1] - u[0] + 1 < i && u[0] > 0; ) {
|
|
1041
|
+
var y = u[0] - 1;
|
|
1037
1042
|
if (!t(y))
|
|
1038
|
-
|
|
1043
|
+
u[0] = y;
|
|
1039
1044
|
else
|
|
1040
1045
|
break;
|
|
1041
1046
|
}
|
|
1042
|
-
return
|
|
1047
|
+
return u;
|
|
1043
1048
|
}
|
|
1044
|
-
var
|
|
1049
|
+
var Bn = function(e, t) {
|
|
1045
1050
|
if (!(e instanceof t))
|
|
1046
1051
|
throw new TypeError("Cannot call a class as a function");
|
|
1047
|
-
},
|
|
1052
|
+
}, Hn = function() {
|
|
1048
1053
|
function e(t, n) {
|
|
1049
1054
|
for (var i = 0; i < n.length; i++) {
|
|
1050
1055
|
var r = n[i];
|
|
@@ -1054,7 +1059,7 @@ var Fn = function(e, t) {
|
|
|
1054
1059
|
return function(t, n, i) {
|
|
1055
1060
|
return n && e(t.prototype, n), i && e(t, i), t;
|
|
1056
1061
|
};
|
|
1057
|
-
}(),
|
|
1062
|
+
}(), Zn = function(e, t) {
|
|
1058
1063
|
if (typeof t != "function" && t !== null)
|
|
1059
1064
|
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
|
|
1060
1065
|
e.prototype = Object.create(t && t.prototype, {
|
|
@@ -1069,21 +1074,21 @@ var Fn = function(e, t) {
|
|
|
1069
1074
|
if (!e)
|
|
1070
1075
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1071
1076
|
return t && (typeof t == "object" || typeof t == "function") ? t : e;
|
|
1072
|
-
},
|
|
1073
|
-
|
|
1077
|
+
}, Gn = function(e) {
|
|
1078
|
+
Zn(t, e);
|
|
1074
1079
|
function t() {
|
|
1075
1080
|
var n, i, r, I;
|
|
1076
|
-
|
|
1077
|
-
for (var
|
|
1078
|
-
|
|
1079
|
-
return I = (i = (r = Me(this, (n = t.__proto__ || Object.getPrototypeOf(t)).call.apply(n, [this].concat(
|
|
1081
|
+
Bn(this, t);
|
|
1082
|
+
for (var u = arguments.length, m = Array(u), d = 0; d < u; d++)
|
|
1083
|
+
m[d] = arguments[d];
|
|
1084
|
+
return I = (i = (r = Me(this, (n = t.__proto__ || Object.getPrototypeOf(t)).call.apply(n, [this].concat(m))), r), r._lastRenderedStartIndex = -1, r._lastRenderedStopIndex = -1, r._memoizedUnloadedRanges = [], r._onItemsRendered = function(h) {
|
|
1080
1085
|
var A = h.visibleStartIndex, D = h.visibleStopIndex;
|
|
1081
1086
|
r._lastRenderedStartIndex = A, r._lastRenderedStopIndex = D, r._ensureRowsLoaded(A, D);
|
|
1082
1087
|
}, r._setRef = function(h) {
|
|
1083
1088
|
r._listRef = h;
|
|
1084
1089
|
}, i), Me(r, I);
|
|
1085
1090
|
}
|
|
1086
|
-
return
|
|
1091
|
+
return Hn(t, [{
|
|
1087
1092
|
key: "resetloadMoreItemsCache",
|
|
1088
1093
|
value: function() {
|
|
1089
1094
|
var i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
|
|
@@ -1105,12 +1110,12 @@ var Fn = function(e, t) {
|
|
|
1105
1110
|
}, {
|
|
1106
1111
|
key: "_ensureRowsLoaded",
|
|
1107
1112
|
value: function(i, r) {
|
|
1108
|
-
var I = this.props,
|
|
1109
|
-
isItemLoaded:
|
|
1110
|
-
itemCount:
|
|
1113
|
+
var I = this.props, u = I.isItemLoaded, m = I.itemCount, d = I.minimumBatchSize, h = d === void 0 ? 10 : d, A = I.threshold, D = A === void 0 ? 15 : A, N = Fn({
|
|
1114
|
+
isItemLoaded: u,
|
|
1115
|
+
itemCount: m,
|
|
1111
1116
|
minimumBatchSize: h,
|
|
1112
1117
|
startIndex: Math.max(0, i - D),
|
|
1113
|
-
stopIndex: Math.min(
|
|
1118
|
+
stopIndex: Math.min(m - 1, r + D)
|
|
1114
1119
|
});
|
|
1115
1120
|
(this._memoizedUnloadedRanges.length !== N.length || this._memoizedUnloadedRanges.some(function(y, T) {
|
|
1116
1121
|
return N[T] !== y;
|
|
@@ -1119,10 +1124,10 @@ var Fn = function(e, t) {
|
|
|
1119
1124
|
}, {
|
|
1120
1125
|
key: "_loadUnloadedRanges",
|
|
1121
1126
|
value: function(i) {
|
|
1122
|
-
for (var r = this, I = this.props.loadMoreItems || this.props.loadMoreRows,
|
|
1127
|
+
for (var r = this, I = this.props.loadMoreItems || this.props.loadMoreRows, u = function(h) {
|
|
1123
1128
|
var A = i[h], D = i[h + 1], N = I(A, D);
|
|
1124
1129
|
N != null && N.then(function() {
|
|
1125
|
-
if (
|
|
1130
|
+
if (Vn({
|
|
1126
1131
|
lastRenderedStartIndex: r._lastRenderedStartIndex,
|
|
1127
1132
|
lastRenderedStopIndex: r._lastRenderedStopIndex,
|
|
1128
1133
|
startIndex: A,
|
|
@@ -1133,87 +1138,87 @@ var Fn = function(e, t) {
|
|
|
1133
1138
|
typeof r._listRef.resetAfterIndex == "function" ? r._listRef.resetAfterIndex(A, !0) : (typeof r._listRef._getItemStyleCache == "function" && r._listRef._getItemStyleCache(-1), r._listRef.forceUpdate());
|
|
1134
1139
|
}
|
|
1135
1140
|
});
|
|
1136
|
-
},
|
|
1137
|
-
m
|
|
1141
|
+
}, m = 0; m < i.length; m += 2)
|
|
1142
|
+
u(m);
|
|
1138
1143
|
}
|
|
1139
1144
|
}]), t;
|
|
1140
1145
|
}(Ae);
|
|
1141
|
-
const
|
|
1146
|
+
const Jn = /* @__PURE__ */ o("div")({
|
|
1142
1147
|
name: "Container",
|
|
1143
1148
|
class: "culdu4a",
|
|
1144
1149
|
propsAsIs: !1
|
|
1145
|
-
}),
|
|
1150
|
+
}), Kn = /* @__PURE__ */ o("div")({
|
|
1146
1151
|
name: "Position",
|
|
1147
1152
|
class: "pwf8e69",
|
|
1148
1153
|
propsAsIs: !1
|
|
1149
|
-
}),
|
|
1154
|
+
}), Xn = /* @__PURE__ */ o("img")({
|
|
1150
1155
|
name: "Avatar",
|
|
1151
1156
|
class: "atf4yh4",
|
|
1152
1157
|
propsAsIs: !1
|
|
1153
|
-
}),
|
|
1158
|
+
}), es = /* @__PURE__ */ o("div")({
|
|
1154
1159
|
name: "AvatarPlaceholder",
|
|
1155
1160
|
class: "a1dg29ja",
|
|
1156
1161
|
propsAsIs: !1
|
|
1157
|
-
}),
|
|
1162
|
+
}), ts = /* @__PURE__ */ o("div")({
|
|
1158
1163
|
name: "Content",
|
|
1159
1164
|
class: "c10a68rc",
|
|
1160
1165
|
propsAsIs: !1
|
|
1161
|
-
}),
|
|
1166
|
+
}), ns = /* @__PURE__ */ o("div")({
|
|
1162
1167
|
name: "NameContainer",
|
|
1163
1168
|
class: "nc4kck5",
|
|
1164
1169
|
propsAsIs: !1
|
|
1165
|
-
}),
|
|
1170
|
+
}), ss = /* @__PURE__ */ o("span")({
|
|
1166
1171
|
name: "Name",
|
|
1167
1172
|
class: "njsrqgr",
|
|
1168
1173
|
propsAsIs: !1
|
|
1169
|
-
}),
|
|
1174
|
+
}), is = () => j, rs = /* @__PURE__ */ o(is())({
|
|
1170
1175
|
name: "CurrentUserBadge",
|
|
1171
1176
|
class: "c17uc4zr",
|
|
1172
1177
|
propsAsIs: !0
|
|
1173
|
-
}),
|
|
1178
|
+
}), os = ({
|
|
1174
1179
|
rank: e,
|
|
1175
1180
|
avatar: t,
|
|
1176
1181
|
name: n,
|
|
1177
1182
|
points: i,
|
|
1178
1183
|
isCurrentUser: r,
|
|
1179
1184
|
openItemDetail: I,
|
|
1180
|
-
style:
|
|
1181
|
-
}) => /* @__PURE__ */
|
|
1182
|
-
/* @__PURE__ */ s(
|
|
1183
|
-
/* @__PURE__ */
|
|
1184
|
-
t ? /* @__PURE__ */ s(
|
|
1185
|
-
/* @__PURE__ */
|
|
1186
|
-
/* @__PURE__ */ s(
|
|
1187
|
-
r && /* @__PURE__ */ s(
|
|
1185
|
+
style: u
|
|
1186
|
+
}) => /* @__PURE__ */ p(Jn, { onClick: I, style: u, children: [
|
|
1187
|
+
/* @__PURE__ */ s(Kn, { children: e || 0 }),
|
|
1188
|
+
/* @__PURE__ */ p(ts, { children: [
|
|
1189
|
+
t ? /* @__PURE__ */ s(Xn, { alt: "leaderboard-item-avatar", src: t }) : /* @__PURE__ */ s(es, { children: ye(n || "") }),
|
|
1190
|
+
/* @__PURE__ */ p(ns, { children: [
|
|
1191
|
+
/* @__PURE__ */ s(ss, { children: n || "" }),
|
|
1192
|
+
r && /* @__PURE__ */ s(rs, { name: "icon-star" })
|
|
1188
1193
|
] })
|
|
1189
1194
|
] }),
|
|
1190
1195
|
/* @__PURE__ */ s("div", { children: Te(i) })
|
|
1191
|
-
] }),
|
|
1196
|
+
] }), as = /* @__PURE__ */ o("div")({
|
|
1192
1197
|
name: "ScrollContainer",
|
|
1193
1198
|
class: "s13d8sg6",
|
|
1194
1199
|
propsAsIs: !1
|
|
1195
|
-
}),
|
|
1200
|
+
}), ls = ({
|
|
1196
1201
|
items: e,
|
|
1197
1202
|
currentUserId: t,
|
|
1198
1203
|
openItemDetail: n,
|
|
1199
1204
|
fetchMore: i
|
|
1200
1205
|
}) => /* @__PURE__ */ s(Re, { children: ({ width: r, height: I }) => /* @__PURE__ */ s(
|
|
1201
|
-
|
|
1206
|
+
Gn,
|
|
1202
1207
|
{
|
|
1203
|
-
isItemLoaded: (
|
|
1208
|
+
isItemLoaded: (u) => u < e.length,
|
|
1204
1209
|
itemCount: e.length + 1,
|
|
1205
1210
|
loadMoreItems: i,
|
|
1206
|
-
children: ({ onItemsRendered:
|
|
1207
|
-
|
|
1211
|
+
children: ({ onItemsRendered: u, ref: m }) => /* @__PURE__ */ s(as, { children: /* @__PURE__ */ s(
|
|
1212
|
+
Wn,
|
|
1208
1213
|
{
|
|
1209
1214
|
itemSize: 56,
|
|
1210
|
-
onItemsRendered:
|
|
1211
|
-
ref:
|
|
1215
|
+
onItemsRendered: u,
|
|
1216
|
+
ref: m,
|
|
1212
1217
|
itemCount: e.length,
|
|
1213
1218
|
width: r,
|
|
1214
1219
|
height: I,
|
|
1215
1220
|
children: ({ index: d, style: h }) => /* @__PURE__ */ s(
|
|
1216
|
-
|
|
1221
|
+
os,
|
|
1217
1222
|
{
|
|
1218
1223
|
style: { ...h, maxHeight: 48 },
|
|
1219
1224
|
...e[d],
|
|
@@ -1225,8 +1230,8 @@ const Gn = /* @__PURE__ */ o("div")({
|
|
|
1225
1230
|
}
|
|
1226
1231
|
) })
|
|
1227
1232
|
}
|
|
1228
|
-
) }),
|
|
1229
|
-
const { data: t } =
|
|
1233
|
+
) }), cs = ({ deepLink: e }) => {
|
|
1234
|
+
const { data: t } = k(e.$store);
|
|
1230
1235
|
return /* @__PURE__ */ s(
|
|
1231
1236
|
Qe,
|
|
1232
1237
|
{
|
|
@@ -1247,123 +1252,123 @@ const Gn = /* @__PURE__ */ o("div")({
|
|
|
1247
1252
|
inviteCardSubtext: "Invite and compete against your friends for the top spot on the leaderboard."
|
|
1248
1253
|
}
|
|
1249
1254
|
);
|
|
1250
|
-
},
|
|
1251
|
-
const { data: t } =
|
|
1255
|
+
}, ds = ({ gamification: e }) => {
|
|
1256
|
+
const { data: t } = k(e.leaderboardList.$store);
|
|
1252
1257
|
return t != null && t.length ? /* @__PURE__ */ s(
|
|
1253
|
-
|
|
1258
|
+
ls,
|
|
1254
1259
|
{
|
|
1255
1260
|
fetchMore: e.leaderboardList.fetchMore,
|
|
1256
1261
|
items: t,
|
|
1257
1262
|
openItemDetail: e.openUser,
|
|
1258
1263
|
currentUserId: e.currentUserId.get()
|
|
1259
1264
|
}
|
|
1260
|
-
) : /* @__PURE__ */ s(
|
|
1261
|
-
},
|
|
1265
|
+
) : /* @__PURE__ */ s(cs, { deepLink: e.deepLink });
|
|
1266
|
+
}, us = /* @__PURE__ */ o("div")({
|
|
1262
1267
|
name: "QuestionItem",
|
|
1263
1268
|
class: "q1w97g3p",
|
|
1264
1269
|
propsAsIs: !1
|
|
1265
|
-
}),
|
|
1270
|
+
}), ps = /* @__PURE__ */ o("div")({
|
|
1266
1271
|
name: "QuestionCaption",
|
|
1267
1272
|
class: "q2sl39u",
|
|
1268
1273
|
propsAsIs: !1
|
|
1269
|
-
}),
|
|
1274
|
+
}), ms = /* @__PURE__ */ o("div")({
|
|
1270
1275
|
name: "QuestionBody",
|
|
1271
1276
|
class: "qd5h0uc",
|
|
1272
1277
|
propsAsIs: !1
|
|
1273
|
-
}),
|
|
1278
|
+
}), Is = /* @__PURE__ */ o("div")({
|
|
1274
1279
|
name: "QuestionAction",
|
|
1275
1280
|
class: "q105uluy",
|
|
1276
1281
|
propsAsIs: !1
|
|
1277
|
-
}),
|
|
1282
|
+
}), hs = () => j, P = /* @__PURE__ */ o(hs())({
|
|
1278
1283
|
name: "QuestionActionIcon",
|
|
1279
1284
|
class: "q1fa0b9h",
|
|
1280
1285
|
propsAsIs: !0
|
|
1281
|
-
}),
|
|
1286
|
+
}), fs = () => j, gs = /* @__PURE__ */ o(fs())({
|
|
1282
1287
|
name: "QuestionTypeIcon",
|
|
1283
1288
|
class: "qxlt78s",
|
|
1284
1289
|
propsAsIs: !0
|
|
1285
|
-
}),
|
|
1290
|
+
}), Ms = /* @__PURE__ */ o("div")({
|
|
1286
1291
|
name: "QuestionTypeLabel",
|
|
1287
1292
|
class: "qmg0vkx",
|
|
1288
1293
|
propsAsIs: !1
|
|
1289
|
-
}),
|
|
1294
|
+
}), vs = /* @__PURE__ */ o("div")({
|
|
1290
1295
|
name: "QuestionContent",
|
|
1291
1296
|
class: "q1uz5j1g",
|
|
1292
1297
|
propsAsIs: !1
|
|
1293
|
-
}),
|
|
1298
|
+
}), Ns = /* @__PURE__ */ o("button")({
|
|
1294
1299
|
name: "PlayButton",
|
|
1295
1300
|
class: "p1pba9p1",
|
|
1296
1301
|
propsAsIs: !1
|
|
1297
|
-
}),
|
|
1302
|
+
}), As = {
|
|
1298
1303
|
[q.LOST]: /* @__PURE__ */ s(P, { name: "icon-cross" }),
|
|
1299
1304
|
[q.WON]: /* @__PURE__ */ s(P, { name: "icon-check" }),
|
|
1300
1305
|
[q.UNSET]: /* @__PURE__ */ s(P, { name: "icon-arrow" }),
|
|
1301
1306
|
[q.DNP]: /* @__PURE__ */ s(P, { name: "icon-arrow" })
|
|
1302
|
-
},
|
|
1307
|
+
}, ys = ({
|
|
1303
1308
|
questionId: e,
|
|
1304
1309
|
questionType: t,
|
|
1305
1310
|
questionStatus: n,
|
|
1306
1311
|
subject: i,
|
|
1307
1312
|
openForVoting: r,
|
|
1308
1313
|
openQuestion: I,
|
|
1309
|
-
status:
|
|
1314
|
+
status: u
|
|
1310
1315
|
}) => {
|
|
1311
|
-
const
|
|
1312
|
-
return
|
|
1313
|
-
/* @__PURE__ */
|
|
1314
|
-
/* @__PURE__ */
|
|
1315
|
-
/* @__PURE__ */ s(
|
|
1316
|
-
/* @__PURE__ */
|
|
1317
|
-
|
|
1316
|
+
const m = Ne[t], d = As[u];
|
|
1317
|
+
return m ? /* @__PURE__ */ p(us, { onClick: () => I == null ? void 0 : I(e), children: [
|
|
1318
|
+
/* @__PURE__ */ p(vs, { children: [
|
|
1319
|
+
/* @__PURE__ */ p(ps, { children: [
|
|
1320
|
+
/* @__PURE__ */ s(gs, { name: m.iconName }),
|
|
1321
|
+
/* @__PURE__ */ p(Ms, { children: [
|
|
1322
|
+
m.label,
|
|
1318
1323
|
t === x.TRIVIA && n === Q.RESOLVED && " • Expired"
|
|
1319
1324
|
] })
|
|
1320
1325
|
] }),
|
|
1321
|
-
/* @__PURE__ */ s(
|
|
1326
|
+
/* @__PURE__ */ s(ms, { children: i || "" })
|
|
1322
1327
|
] }),
|
|
1323
|
-
/* @__PURE__ */ s(
|
|
1328
|
+
/* @__PURE__ */ s(Is, { children: r ? /* @__PURE__ */ s(Ns, { children: "Play" }) : d })
|
|
1324
1329
|
] }) : null;
|
|
1325
|
-
},
|
|
1330
|
+
}, Ts = /* @__PURE__ */ o("div")({
|
|
1326
1331
|
name: "Container",
|
|
1327
1332
|
class: "cll3md7",
|
|
1328
1333
|
propsAsIs: !1
|
|
1329
|
-
}),
|
|
1334
|
+
}), Ds = /* @__PURE__ */ o("button")({
|
|
1330
1335
|
name: "ActionBtn",
|
|
1331
1336
|
class: "a10g1iik",
|
|
1332
1337
|
propsAsIs: !1
|
|
1333
|
-
}),
|
|
1338
|
+
}), Ss = ({
|
|
1334
1339
|
openInsight: e,
|
|
1335
1340
|
questionId: t,
|
|
1336
1341
|
...n
|
|
1337
|
-
}) => /* @__PURE__ */
|
|
1342
|
+
}) => /* @__PURE__ */ p(Ts, { children: [
|
|
1338
1343
|
/* @__PURE__ */ s(xe, { questionId: t, ...n }),
|
|
1339
|
-
e && /* @__PURE__ */ s(
|
|
1340
|
-
] }),
|
|
1344
|
+
e && /* @__PURE__ */ s(Ds, { onClick: () => e(t), children: "View Insight" })
|
|
1345
|
+
] }), zs = /* @__PURE__ */ o("div")({
|
|
1341
1346
|
name: "QuestionsContainer",
|
|
1342
1347
|
class: "qvghv3l",
|
|
1343
1348
|
propsAsIs: !1
|
|
1344
|
-
}),
|
|
1349
|
+
}), xs = ({ questions: e, openQuestion: t }) => /* @__PURE__ */ s(zs, { children: e == null ? void 0 : e.map((n) => {
|
|
1345
1350
|
var i, r;
|
|
1346
1351
|
if (n.type === "question" && ((i = n.attributes) == null ? void 0 : i.attributes.case) === "question") {
|
|
1347
1352
|
const I = n.attributes.attributes.value;
|
|
1348
|
-
return /* @__PURE__ */ s(
|
|
1353
|
+
return /* @__PURE__ */ s(ys, { openQuestion: t, ...I }, I.questionId);
|
|
1349
1354
|
}
|
|
1350
1355
|
if (n.type === "insight" && ((r = n.attributes) == null ? void 0 : r.attributes.case) === "insight") {
|
|
1351
1356
|
const I = n.attributes.attributes.value;
|
|
1352
|
-
return /* @__PURE__ */ s(
|
|
1357
|
+
return /* @__PURE__ */ s(Ss, { openInsight: t, ...I }, I.questionId);
|
|
1353
1358
|
}
|
|
1354
1359
|
return null;
|
|
1355
|
-
}) }),
|
|
1356
|
-
const n =
|
|
1357
|
-
return n != null && n.data ? /* @__PURE__ */ s(
|
|
1358
|
-
},
|
|
1360
|
+
}) }), js = ({ store: e, openQuestion: t }) => {
|
|
1361
|
+
const n = k(e);
|
|
1362
|
+
return n != null && n.data ? /* @__PURE__ */ s(xs, { openQuestion: t, questions: n.data }) : /* @__PURE__ */ s("div", { children: "wait questions..." });
|
|
1363
|
+
}, Os = ({ userSummary: e }) => {
|
|
1359
1364
|
var t, n;
|
|
1360
|
-
const i =
|
|
1365
|
+
const i = k(e.getStore());
|
|
1361
1366
|
return (t = i.data) != null && t.summary ? /* @__PURE__ */ s(Se, { ...i.data.summary, successRate: (n = i.data.percentage) == null ? void 0 : n.correct }) : /* @__PURE__ */ s("div", { children: "wait user..." });
|
|
1362
|
-
},
|
|
1367
|
+
}, Cs = ({
|
|
1363
1368
|
gamification: e
|
|
1364
1369
|
}) => {
|
|
1365
1370
|
const [t, n] = R(V.HOME);
|
|
1366
|
-
return /* @__PURE__ */
|
|
1371
|
+
return /* @__PURE__ */ p("div", {
|
|
1367
1372
|
style: {
|
|
1368
1373
|
height: "100%",
|
|
1369
1374
|
display: "flex",
|
|
@@ -1374,27 +1379,27 @@ const Gn = /* @__PURE__ */ o("div")({
|
|
|
1374
1379
|
style: {
|
|
1375
1380
|
paddingBottom: "4px"
|
|
1376
1381
|
},
|
|
1377
|
-
children: /* @__PURE__ */ s(
|
|
1382
|
+
children: /* @__PURE__ */ s(En, {
|
|
1378
1383
|
activePage: t,
|
|
1379
1384
|
toggleActivePage: n
|
|
1380
1385
|
})
|
|
1381
|
-
}), t === V.HOME && /* @__PURE__ */
|
|
1386
|
+
}), t === V.HOME && /* @__PURE__ */ p(te, {
|
|
1382
1387
|
children: [/* @__PURE__ */ s(K, {
|
|
1383
1388
|
style: {
|
|
1384
1389
|
paddingTop: "12px"
|
|
1385
1390
|
},
|
|
1386
|
-
children: /* @__PURE__ */ s(
|
|
1391
|
+
children: /* @__PURE__ */ s(Os, {
|
|
1387
1392
|
userSummary: e.userSummary
|
|
1388
1393
|
})
|
|
1389
1394
|
}), /* @__PURE__ */ s(Ue, {
|
|
1390
|
-
children: /* @__PURE__ */ s(
|
|
1395
|
+
children: /* @__PURE__ */ s(js, {
|
|
1391
1396
|
openQuestion: e.openQuestion,
|
|
1392
1397
|
store: e.feedList.getStore()
|
|
1393
1398
|
})
|
|
1394
1399
|
})]
|
|
1395
1400
|
}), t === V.LEADERBOARD && /* @__PURE__ */ s("div", {
|
|
1396
1401
|
className: "c1bp9dj2",
|
|
1397
|
-
children: /* @__PURE__ */ s(
|
|
1402
|
+
children: /* @__PURE__ */ s(ds, {
|
|
1398
1403
|
gamification: e
|
|
1399
1404
|
})
|
|
1400
1405
|
})]
|
|
@@ -1407,45 +1412,45 @@ const Gn = /* @__PURE__ */ o("div")({
|
|
|
1407
1412
|
name: "UserContainer",
|
|
1408
1413
|
class: "u14zaal4",
|
|
1409
1414
|
propsAsIs: !1
|
|
1410
|
-
}),
|
|
1415
|
+
}), bs = ({
|
|
1411
1416
|
correct: e,
|
|
1412
1417
|
incorrect: t
|
|
1413
1418
|
}) => {
|
|
1414
1419
|
const n = e + t;
|
|
1415
1420
|
return n === 0 ? 0 : Math.round(e / n * 100);
|
|
1416
|
-
},
|
|
1421
|
+
}, Hs = ({
|
|
1417
1422
|
gamification: e,
|
|
1418
1423
|
className: t
|
|
1419
1424
|
}) => {
|
|
1420
|
-
const n =
|
|
1421
|
-
return /* @__PURE__ */
|
|
1425
|
+
const n = k(e.openedQuestion.$store), i = k(e.openedUser);
|
|
1426
|
+
return /* @__PURE__ */ p(b, {
|
|
1422
1427
|
children: [n && /* @__PURE__ */ s(ve, {
|
|
1423
1428
|
className: t,
|
|
1424
|
-
children: /* @__PURE__ */ s(
|
|
1429
|
+
children: /* @__PURE__ */ s(On, {
|
|
1425
1430
|
gamification: e
|
|
1426
1431
|
})
|
|
1427
1432
|
}), i && /* @__PURE__ */ s(ve, {
|
|
1428
1433
|
className: t,
|
|
1429
|
-
children: /* @__PURE__ */
|
|
1434
|
+
children: /* @__PURE__ */ p(ws, {
|
|
1430
1435
|
children: [/* @__PURE__ */ s(De, {
|
|
1431
1436
|
label: "Friend's Rank",
|
|
1432
1437
|
close: e.closeUser
|
|
1433
1438
|
}), /* @__PURE__ */ s(K, {
|
|
1434
1439
|
children: /* @__PURE__ */ s(Se, {
|
|
1435
1440
|
...i,
|
|
1436
|
-
successRate:
|
|
1441
|
+
successRate: bs(i)
|
|
1437
1442
|
})
|
|
1438
1443
|
})]
|
|
1439
1444
|
})
|
|
1440
1445
|
}), /* @__PURE__ */ s(te, {
|
|
1441
1446
|
className: t,
|
|
1442
1447
|
"data-nav": "true",
|
|
1443
|
-
children: /* @__PURE__ */ s(
|
|
1448
|
+
children: /* @__PURE__ */ s(Cs, {
|
|
1444
1449
|
gamification: e
|
|
1445
1450
|
})
|
|
1446
1451
|
})]
|
|
1447
1452
|
});
|
|
1448
1453
|
};
|
|
1449
1454
|
export {
|
|
1450
|
-
|
|
1455
|
+
Hs as default
|
|
1451
1456
|
};
|