@streamlayer/react 0.32.8 → 0.32.9
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.
|
@@ -154,7 +154,7 @@ const it = /* @__PURE__ */ a("div")({
|
|
|
154
154
|
rank: r,
|
|
155
155
|
streak: c,
|
|
156
156
|
correct: l,
|
|
157
|
-
incorrect:
|
|
157
|
+
incorrect: p,
|
|
158
158
|
inTop: d,
|
|
159
159
|
successRate: f
|
|
160
160
|
}) => /* @__PURE__ */ h(gt, { children: [
|
|
@@ -190,7 +190,7 @@ const it = /* @__PURE__ */ a("div")({
|
|
|
190
190
|
/* @__PURE__ */ h(jt, { children: [
|
|
191
191
|
/* @__PURE__ */ s(Z, { indicator: c || 0, title: "Win streak" }),
|
|
192
192
|
/* @__PURE__ */ s(Z, { indicator: l || 0, title: "Correct" }),
|
|
193
|
-
/* @__PURE__ */ s(Z, { indicator:
|
|
193
|
+
/* @__PURE__ */ s(Z, { indicator: p || 0, title: "Incorrect" }),
|
|
194
194
|
/* @__PURE__ */ s(Z, { indicator: `${f || 0}%`, title: "Succ. rate" })
|
|
195
195
|
] })
|
|
196
196
|
] })
|
|
@@ -258,11 +258,11 @@ const it = /* @__PURE__ */ a("div")({
|
|
|
258
258
|
hasCorrectAnswer: r,
|
|
259
259
|
questionStatus: c,
|
|
260
260
|
votedInCurrentRender: l,
|
|
261
|
-
votedAfterQuestionClosed:
|
|
261
|
+
votedAfterQuestionClosed: p,
|
|
262
262
|
enteredAnActiveQuestion: d
|
|
263
263
|
}) => {
|
|
264
|
-
const f = n && (i === x.TRIVIA || i === x.PREDICTION) && l && c !== L.RESOLVED, A = i === x.PREDICTION && !r, M = c === L.RESOLVED && i === x.TRIVIA && !n && !d, v = i === x.TRIVIA &&
|
|
265
|
-
if (!M && !v && !D && !o && !N && !
|
|
264
|
+
const f = n && (i === x.TRIVIA || i === x.PREDICTION) && l && c !== L.RESOLVED, A = i === x.PREDICTION && !r, M = c === L.RESOLVED && i === x.TRIVIA && !n && !d, v = i === x.TRIVIA && p && l && d, N = c === L.RESOLVED && i === x.PREDICTION && !n && !d || i === x.PREDICTION && p && l && d, D = f && A, o = f && r, m = n && i === x.POLL && l;
|
|
265
|
+
if (!M && !v && !D && !o && !N && !m)
|
|
266
266
|
return null;
|
|
267
267
|
const u = t ? "correct" : "incorrect", I = t ? e == null ? void 0 : e.correctFeedback : e == null ? void 0 : e.incorrectFeedback;
|
|
268
268
|
return /* @__PURE__ */ h(Yt, { "data-isPrediction": A, children: [
|
|
@@ -291,7 +291,7 @@ const it = /* @__PURE__ */ a("div")({
|
|
|
291
291
|
/* @__PURE__ */ s(Vt, { name: "icon-prediction" }),
|
|
292
292
|
/* @__PURE__ */ s(_, { children: "Stay tuned to see if your prediction was correct." })
|
|
293
293
|
] }),
|
|
294
|
-
|
|
294
|
+
m && /* @__PURE__ */ h(b, { children: [
|
|
295
295
|
/* @__PURE__ */ s(H, { "data-feedbackType": "correct", children: /* @__PURE__ */ s(k, { name: "correct" }) }),
|
|
296
296
|
/* @__PURE__ */ s(_, { children: "That's for answering. Please stay tuned for the next question." })
|
|
297
297
|
] }),
|
|
@@ -399,7 +399,7 @@ const it = /* @__PURE__ */ a("div")({
|
|
|
399
399
|
percentageDecimal: c,
|
|
400
400
|
// extra props
|
|
401
401
|
onVote: l,
|
|
402
|
-
markThatVoted:
|
|
402
|
+
markThatVoted: p,
|
|
403
403
|
youSelected: d,
|
|
404
404
|
questionVoted: f,
|
|
405
405
|
// ToDo: Figure out why imageMode is not in the response, and delete default value
|
|
@@ -409,10 +409,10 @@ const it = /* @__PURE__ */ a("div")({
|
|
|
409
409
|
isLoading: N,
|
|
410
410
|
questionType: D,
|
|
411
411
|
correct: o,
|
|
412
|
-
hasCorrectAnswer:
|
|
412
|
+
hasCorrectAnswer: m,
|
|
413
413
|
votedAfterQuestionClosed: u,
|
|
414
414
|
enteredAnActiveQuestion: I
|
|
415
|
-
} = e, g = mn(e), z = hn({ questionType: D, questionVoted: f, correct: o, hasCorrectAnswer:
|
|
415
|
+
} = e, g = mn(e), z = hn({ questionType: D, questionVoted: f, correct: o, hasCorrectAnswer: m, questionStatus: v }), y = v === L.RESOLVED && D === x.PREDICTION, S = f || y;
|
|
416
416
|
return /* @__PURE__ */ h(
|
|
417
417
|
Kt,
|
|
418
418
|
{
|
|
@@ -422,7 +422,7 @@ const it = /* @__PURE__ */ a("div")({
|
|
|
422
422
|
disabled: f || N || M || y && !I || y && I && u,
|
|
423
423
|
"data-isNotChecked": f && !d && g !== "incorrect",
|
|
424
424
|
onClick: (T) => {
|
|
425
|
-
|
|
425
|
+
p(v === L.RESOLVED), l(T);
|
|
426
426
|
},
|
|
427
427
|
children: [
|
|
428
428
|
/* @__PURE__ */ s(Xt, { "data-answerState": g, style: { width: `${S ? c : 0}%` } }),
|
|
@@ -439,7 +439,7 @@ const it = /* @__PURE__ */ a("div")({
|
|
|
439
439
|
);
|
|
440
440
|
};
|
|
441
441
|
var Ae = typeof window > "u" ? ue : nt, fn = ({ isPlaying: e, duration: t, startAt: n = 0, updateInterval: i = 0, onComplete: r, onUpdate: c }) => {
|
|
442
|
-
let [l,
|
|
442
|
+
let [l, p] = $(n), d = R(0), f = R(n), A = R(n * -1e3), M = R(null), v = R(null), N = R(null), D = (u) => {
|
|
443
443
|
let I = u / 1e3;
|
|
444
444
|
if (v.current === null) {
|
|
445
445
|
v.current = I, M.current = requestAnimationFrame(D);
|
|
@@ -448,24 +448,24 @@ var Ae = typeof window > "u" ? ue : nt, fn = ({ isPlaying: e, duration: t, start
|
|
|
448
448
|
let g = I - v.current, z = d.current + g;
|
|
449
449
|
v.current = I, d.current = z;
|
|
450
450
|
let y = f.current + (i === 0 ? z : (z / i | 0) * i), S = f.current + z, T = typeof t == "number" && S >= t;
|
|
451
|
-
|
|
451
|
+
p(T ? t : y), T || (M.current = requestAnimationFrame(D));
|
|
452
452
|
}, o = () => {
|
|
453
453
|
M.current && cancelAnimationFrame(M.current), N.current && clearTimeout(N.current), v.current = null;
|
|
454
|
-
},
|
|
454
|
+
}, m = W((u) => {
|
|
455
455
|
o(), d.current = 0;
|
|
456
456
|
let I = typeof u == "number" ? u : n;
|
|
457
|
-
f.current = I,
|
|
457
|
+
f.current = I, p(I), e && (M.current = requestAnimationFrame(D));
|
|
458
458
|
}, [e, n]);
|
|
459
459
|
return Ae(() => {
|
|
460
460
|
if (c == null || c(l), t && l >= t) {
|
|
461
461
|
A.current += t * 1e3;
|
|
462
462
|
let { shouldRepeat: u = !1, delay: I = 0, newStartAt: g } = (r == null ? void 0 : r(A.current / 1e3)) || {};
|
|
463
|
-
u && (N.current = setTimeout(() =>
|
|
463
|
+
u && (N.current = setTimeout(() => m(g), I * 1e3));
|
|
464
464
|
}
|
|
465
|
-
}, [l, t]), Ae(() => (e && (M.current = requestAnimationFrame(D)), o), [e, t, i]), { elapsedTime: l, reset:
|
|
465
|
+
}, [l, t]), Ae(() => (e && (M.current = requestAnimationFrame(D)), o), [e, t, i]), { elapsedTime: l, reset: m };
|
|
466
466
|
}, gn = (e, t, n) => {
|
|
467
|
-
let i = e / 2, r = t / 2, c = i - r, l = 2 * c,
|
|
468
|
-
return { path: `m ${i},${r} a ${c},${c} 0 ${
|
|
467
|
+
let i = e / 2, r = t / 2, c = i - r, l = 2 * c, p = n === "clockwise" ? "1,0" : "0,1", d = 2 * Math.PI * c;
|
|
468
|
+
return { path: `m ${i},${r} a ${c},${c} 0 ${p} 0,${l} a ${c},${c} 0 ${p} 0,-${l}`, pathLength: d };
|
|
469
469
|
}, Te = (e, t) => e === 0 || e === t ? 0 : typeof t == "number" ? e - t : 0, vn = (e) => ({ position: "relative", width: e, height: e }), Mn = { display: "flex", justifyContent: "center", alignItems: "center", position: "absolute", left: 0, top: 0, width: "100%", height: "100%" }, Ye = (e, t, n, i, r) => {
|
|
470
470
|
if (i === 0)
|
|
471
471
|
return t;
|
|
@@ -484,10 +484,10 @@ var Ae = typeof window > "u" ? ue : nt, fn = ({ isPlaying: e, duration: t, start
|
|
|
484
484
|
return i[0];
|
|
485
485
|
if (!c)
|
|
486
486
|
return i[l];
|
|
487
|
-
let
|
|
488
|
-
return `rgb(${f.map((v, N) => Ye(
|
|
487
|
+
let p = r[l] - t, d = r[l] - r[l + 1], f = Ne(i[l]), A = Ne(i[l + 1]), M = !!e.isGrowing;
|
|
488
|
+
return `rgb(${f.map((v, N) => Ye(p, v, A[N] - v, d, M) | 0).join(",")})`;
|
|
489
489
|
}, An = (e) => {
|
|
490
|
-
let { duration: t, initialRemainingTime: n, updateInterval: i, size: r = 180, strokeWidth: c = 12, trailStrokeWidth: l, isPlaying:
|
|
490
|
+
let { duration: t, initialRemainingTime: n, updateInterval: i, size: r = 180, strokeWidth: c = 12, trailStrokeWidth: l, isPlaying: p = !1, isGrowing: d = !1, rotation: f = "clockwise", onComplete: A, onUpdate: M } = e, v = R(), N = Math.max(c, l ?? 0), { path: D, pathLength: o } = gn(r, N, f), { elapsedTime: m } = fn({ isPlaying: p, duration: t, startAt: Te(t, n), updateInterval: i, onUpdate: typeof M == "function" ? (I) => {
|
|
491
491
|
let g = Math.ceil(t - I);
|
|
492
492
|
g !== v.current && (v.current = g, M(g));
|
|
493
493
|
} : void 0, onComplete: typeof A == "function" ? (I) => {
|
|
@@ -495,11 +495,11 @@ var Ae = typeof window > "u" ? ue : nt, fn = ({ isPlaying: e, duration: t, start
|
|
|
495
495
|
let { shouldRepeat: z, delay: y, newInitialRemainingTime: S } = (g = A(I)) != null ? g : {};
|
|
496
496
|
if (z)
|
|
497
497
|
return { shouldRepeat: z, delay: y, newStartAt: Te(t, S) };
|
|
498
|
-
} : void 0 }), u = t -
|
|
499
|
-
return { elapsedTime:
|
|
498
|
+
} : void 0 }), u = t - m;
|
|
499
|
+
return { elapsedTime: m, path: D, pathLength: o, remainingTime: Math.ceil(u), rotation: f, size: r, stroke: yn(e, u), strokeDashoffset: Ye(m, 0, o, t, d), strokeWidth: c };
|
|
500
500
|
}, We = (e) => {
|
|
501
|
-
let { children: t, strokeLinecap: n, trailColor: i, trailStrokeWidth: r } = e, { path: c, pathLength: l, stroke:
|
|
502
|
-
return B.createElement("div", { style: vn(M) }, B.createElement("svg", { viewBox: `0 0 ${M} ${M}`, width: M, height: M, xmlns: "http://www.w3.org/2000/svg" }, B.createElement("path", { d: c, fill: "none", stroke: i ?? "#d9d9d9", strokeWidth: r ?? v }), B.createElement("path", { d: c, fill: "none", stroke:
|
|
501
|
+
let { children: t, strokeLinecap: n, trailColor: i, trailStrokeWidth: r } = e, { path: c, pathLength: l, stroke: p, strokeDashoffset: d, remainingTime: f, elapsedTime: A, size: M, strokeWidth: v } = An(e);
|
|
502
|
+
return B.createElement("div", { style: vn(M) }, B.createElement("svg", { viewBox: `0 0 ${M} ${M}`, width: M, height: M, xmlns: "http://www.w3.org/2000/svg" }, B.createElement("path", { d: c, fill: "none", stroke: i ?? "#d9d9d9", strokeWidth: r ?? v }), B.createElement("path", { d: c, fill: "none", stroke: p, strokeLinecap: n ?? "round", strokeWidth: v, strokeDasharray: l, strokeDashoffset: d })), typeof t == "function" && B.createElement("div", { style: Mn }, t({ remainingTime: f, elapsedTime: A, color: p })));
|
|
503
503
|
};
|
|
504
504
|
We.displayName = "CountdownCircleTimer";
|
|
505
505
|
const Tn = [Q.PRIMARY_GREEN1, Q.SECONDARY_RED1, Q.SECONDARY_RED1, Q.NEUTRALS_GRAY3], Nn = [10, 10, 1, 0], Dn = /* @__PURE__ */ a("div")({
|
|
@@ -517,7 +517,7 @@ const Tn = [Q.PRIMARY_GREEN1, Q.SECONDARY_RED1, Q.SECONDARY_RED1, Q.NEUTRALS_GRA
|
|
|
517
517
|
children: d
|
|
518
518
|
}), l = W(() => {
|
|
519
519
|
n == null || n(), r(zn);
|
|
520
|
-
}, [n, r]),
|
|
520
|
+
}, [n, r]), p = W((d) => {
|
|
521
521
|
d === 10 && r(De);
|
|
522
522
|
}, [r]);
|
|
523
523
|
return /* @__PURE__ */ s(We, {
|
|
@@ -530,7 +530,7 @@ const Tn = [Q.PRIMARY_GREEN1, Q.SECONDARY_RED1, Q.SECONDARY_RED1, Q.NEUTRALS_GRA
|
|
|
530
530
|
trailStrokeWidth: 2,
|
|
531
531
|
trailColor: i,
|
|
532
532
|
onComplete: l,
|
|
533
|
-
onUpdate:
|
|
533
|
+
onUpdate: p,
|
|
534
534
|
children: c
|
|
535
535
|
});
|
|
536
536
|
}, On = /* @__PURE__ */ a("div")({
|
|
@@ -583,7 +583,7 @@ const Tn = [Q.PRIMARY_GREEN1, Q.SECONDARY_RED1, Q.SECONDARY_RED1, Q.NEUTRALS_GRA
|
|
|
583
583
|
i && /* @__PURE__ */ s(xn, { isPlaying: n, onTimerExpired: l, duration: c })
|
|
584
584
|
] }), Rn = ({ openedQuestion: e, isLoading: t, vote: n, close: i }) => {
|
|
585
585
|
var r, c;
|
|
586
|
-
const l = e.subject,
|
|
586
|
+
const l = e.subject, p = e.type, d = (r = e.options) == null ? void 0 : r.options, [f, A] = $(!1), [M, v] = $(!1), [N, D] = $(!0), [o, m] = $(!1), [u, I] = $(""), g = e == null ? void 0 : e.id;
|
|
587
587
|
ue(() => {
|
|
588
588
|
e.status === L.RESOLVED && D(!1);
|
|
589
589
|
}, []);
|
|
@@ -598,7 +598,7 @@ const Tn = [Q.PRIMARY_GREEN1, Q.SECONDARY_RED1, Q.SECONDARY_RED1, Q.NEUTRALS_GRA
|
|
|
598
598
|
},
|
|
599
599
|
[g, I, n]
|
|
600
600
|
), S = W(() => {
|
|
601
|
-
|
|
601
|
+
m(!0), setTimeout(i, 3e3);
|
|
602
602
|
}, [i]), T = C(
|
|
603
603
|
() => e == null ? void 0 : e.answers.find((O) => O.youVoted === !0),
|
|
604
604
|
[e]
|
|
@@ -635,7 +635,7 @@ const Tn = [Q.PRIMARY_GREEN1, Q.SECONDARY_RED1, Q.SECONDARY_RED1, Q.NEUTRALS_GRA
|
|
|
635
635
|
feedbackMessages: P,
|
|
636
636
|
questionVoted: !!T,
|
|
637
637
|
questionVotedCorrectly: T == null ? void 0 : T.correct,
|
|
638
|
-
questionType:
|
|
638
|
+
questionType: p,
|
|
639
639
|
hasCorrectAnswer: w,
|
|
640
640
|
questionStatus: e.status,
|
|
641
641
|
votedInCurrentRender: f,
|
|
@@ -699,29 +699,35 @@ const Tn = [Q.PRIMARY_GREEN1, Q.SECONDARY_RED1, Q.SECONDARY_RED1, Q.NEUTRALS_GRA
|
|
|
699
699
|
name: "Image",
|
|
700
700
|
class: "i1gfjeu5",
|
|
701
701
|
propsAsIs: !1
|
|
702
|
-
}), Ve = ({
|
|
703
|
-
|
|
702
|
+
}), Ve = ({
|
|
703
|
+
created: e,
|
|
704
|
+
image: t,
|
|
705
|
+
title: n,
|
|
706
|
+
isPickHistory: i,
|
|
707
|
+
instantView: r
|
|
708
|
+
}) => {
|
|
709
|
+
const c = C(() => {
|
|
704
710
|
if (e) {
|
|
705
|
-
const
|
|
706
|
-
if (he(
|
|
711
|
+
const p = new Date(e);
|
|
712
|
+
if (he(p))
|
|
707
713
|
return {
|
|
708
|
-
date: pe(
|
|
709
|
-
time: me(
|
|
714
|
+
date: pe(p),
|
|
715
|
+
time: me(p)
|
|
710
716
|
};
|
|
711
717
|
}
|
|
712
718
|
return null;
|
|
713
|
-
}, [e]),
|
|
719
|
+
}, [e]), l = (r == null ? void 0 : r.image) || t;
|
|
714
720
|
return /* @__PURE__ */ h(Qn, { children: [
|
|
715
|
-
|
|
716
|
-
|
|
721
|
+
c && /* @__PURE__ */ h(_n, { children: [
|
|
722
|
+
c.date,
|
|
717
723
|
" · ",
|
|
718
|
-
|
|
724
|
+
c.time
|
|
719
725
|
] }),
|
|
720
|
-
(
|
|
721
|
-
|
|
726
|
+
(r == null ? void 0 : r.video) && /* @__PURE__ */ s(Ze, { source: r.video.url, poster: r.video.thumbnailUrl }),
|
|
727
|
+
l && !(r != null && r.video) && /* @__PURE__ */ s(Yn, { src: l }),
|
|
722
728
|
/* @__PURE__ */ h(Un, { children: [
|
|
723
|
-
/* @__PURE__ */ s(qn, { children:
|
|
724
|
-
/* @__PURE__ */ s(Pn, { children:
|
|
729
|
+
/* @__PURE__ */ s(qn, { children: i ? n : r == null ? void 0 : r.heading }),
|
|
730
|
+
!i && /* @__PURE__ */ s(Pn, { children: r == null ? void 0 : r.body })
|
|
725
731
|
] })
|
|
726
732
|
] });
|
|
727
733
|
}, Wn = /* @__PURE__ */ a("div")({
|
|
@@ -899,9 +905,9 @@ function re(e, t) {
|
|
|
899
905
|
t === void 0 && (t = li);
|
|
900
906
|
var n, i = [], r, c = !1;
|
|
901
907
|
function l() {
|
|
902
|
-
for (var
|
|
903
|
-
|
|
904
|
-
return c && n === this && t(
|
|
908
|
+
for (var p = [], d = 0; d < arguments.length; d++)
|
|
909
|
+
p[d] = arguments[d];
|
|
910
|
+
return c && n === this && t(p, i) || (r = e.apply(this, p), c = !0, n = this, i = p), r;
|
|
905
911
|
}
|
|
906
912
|
return l;
|
|
907
913
|
}
|
|
@@ -945,7 +951,7 @@ var ui = 150, pi = function(t, n) {
|
|
|
945
951
|
return t;
|
|
946
952
|
};
|
|
947
953
|
function mi(e) {
|
|
948
|
-
var t, n = e.getItemOffset, i = e.getEstimatedTotalSize, r = e.getItemSize, c = e.getOffsetForIndexAndAlignment, l = e.getStartIndexForOffset,
|
|
954
|
+
var t, n = e.getItemOffset, i = e.getEstimatedTotalSize, r = e.getItemSize, c = e.getOffsetForIndexAndAlignment, l = e.getStartIndexForOffset, p = e.getStopIndexForStartIndex, d = e.initInstanceProps, f = e.shouldResetStyleCacheOnItemSizeChange, A = e.validateProps;
|
|
949
955
|
return t = /* @__PURE__ */ function(M) {
|
|
950
956
|
oi(v, M);
|
|
951
957
|
function v(D) {
|
|
@@ -956,26 +962,26 @@ function mi(e) {
|
|
|
956
962
|
scrollDirection: "forward",
|
|
957
963
|
scrollOffset: typeof o.props.initialScrollOffset == "number" ? o.props.initialScrollOffset : 0,
|
|
958
964
|
scrollUpdateWasRequested: !1
|
|
959
|
-
}, o._callOnItemsRendered = void 0, o._callOnItemsRendered = re(function(
|
|
965
|
+
}, o._callOnItemsRendered = void 0, o._callOnItemsRendered = re(function(m, u, I, g) {
|
|
960
966
|
return o.props.onItemsRendered({
|
|
961
|
-
overscanStartIndex:
|
|
967
|
+
overscanStartIndex: m,
|
|
962
968
|
overscanStopIndex: u,
|
|
963
969
|
visibleStartIndex: I,
|
|
964
970
|
visibleStopIndex: g
|
|
965
971
|
});
|
|
966
|
-
}), o._callOnScroll = void 0, o._callOnScroll = re(function(
|
|
972
|
+
}), o._callOnScroll = void 0, o._callOnScroll = re(function(m, u, I) {
|
|
967
973
|
return o.props.onScroll({
|
|
968
|
-
scrollDirection:
|
|
974
|
+
scrollDirection: m,
|
|
969
975
|
scrollOffset: u,
|
|
970
976
|
scrollUpdateWasRequested: I
|
|
971
977
|
});
|
|
972
|
-
}), o._getItemStyle = void 0, o._getItemStyle = function(
|
|
978
|
+
}), o._getItemStyle = void 0, o._getItemStyle = function(m) {
|
|
973
979
|
var u = o.props, I = u.direction, g = u.itemSize, z = u.layout, y = o._getItemStyleCache(f && g, f && z, f && I), S;
|
|
974
|
-
if (y.hasOwnProperty(
|
|
975
|
-
S = y[
|
|
980
|
+
if (y.hasOwnProperty(m))
|
|
981
|
+
S = y[m];
|
|
976
982
|
else {
|
|
977
|
-
var T = n(o.props,
|
|
978
|
-
y[
|
|
983
|
+
var T = n(o.props, m, o._instanceProps), w = r(o.props, m, o._instanceProps), j = I === "horizontal" || z === "horizontal", q = I === "rtl", P = j ? T : 0;
|
|
984
|
+
y[m] = S = {
|
|
979
985
|
position: "absolute",
|
|
980
986
|
left: q ? void 0 : P,
|
|
981
987
|
right: q ? P : void 0,
|
|
@@ -985,10 +991,10 @@ function mi(e) {
|
|
|
985
991
|
};
|
|
986
992
|
}
|
|
987
993
|
return S;
|
|
988
|
-
}, o._getItemStyleCache = void 0, o._getItemStyleCache = re(function(
|
|
994
|
+
}, o._getItemStyleCache = void 0, o._getItemStyleCache = re(function(m, u, I) {
|
|
989
995
|
return {};
|
|
990
|
-
}), o._onScrollHorizontal = function(
|
|
991
|
-
var u =
|
|
996
|
+
}), o._onScrollHorizontal = function(m) {
|
|
997
|
+
var u = m.currentTarget, I = u.clientWidth, g = u.scrollLeft, z = u.scrollWidth;
|
|
992
998
|
o.setState(function(y) {
|
|
993
999
|
if (y.scrollOffset === g)
|
|
994
1000
|
return null;
|
|
@@ -1009,8 +1015,8 @@ function mi(e) {
|
|
|
1009
1015
|
scrollUpdateWasRequested: !1
|
|
1010
1016
|
};
|
|
1011
1017
|
}, o._resetIsScrollingDebounced);
|
|
1012
|
-
}, o._onScrollVertical = function(
|
|
1013
|
-
var u =
|
|
1018
|
+
}, o._onScrollVertical = function(m) {
|
|
1019
|
+
var u = m.currentTarget, I = u.clientHeight, g = u.scrollHeight, z = u.scrollTop;
|
|
1014
1020
|
o.setState(function(y) {
|
|
1015
1021
|
if (y.scrollOffset === z)
|
|
1016
1022
|
return null;
|
|
@@ -1022,9 +1028,9 @@ function mi(e) {
|
|
|
1022
1028
|
scrollUpdateWasRequested: !1
|
|
1023
1029
|
};
|
|
1024
1030
|
}, o._resetIsScrollingDebounced);
|
|
1025
|
-
}, o._outerRefSetter = function(
|
|
1031
|
+
}, o._outerRefSetter = function(m) {
|
|
1026
1032
|
var u = o.props.outerRef;
|
|
1027
|
-
o._outerRef =
|
|
1033
|
+
o._outerRef = m, typeof u == "function" ? u(m) : u != null && typeof u == "object" && u.hasOwnProperty("current") && (u.current = m);
|
|
1028
1034
|
}, o._resetIsScrollingDebounced = function() {
|
|
1029
1035
|
o._resetIsScrollingTimeoutId !== null && ke(o._resetIsScrollingTimeoutId), o._resetIsScrollingTimeoutId = di(o._resetIsScrolling, ui);
|
|
1030
1036
|
}, o._resetIsScrolling = function() {
|
|
@@ -1035,20 +1041,20 @@ function mi(e) {
|
|
|
1035
1041
|
});
|
|
1036
1042
|
}, o;
|
|
1037
1043
|
}
|
|
1038
|
-
v.getDerivedStateFromProps = function(o,
|
|
1039
|
-
return hi(o,
|
|
1044
|
+
v.getDerivedStateFromProps = function(o, m) {
|
|
1045
|
+
return hi(o, m), A(o), null;
|
|
1040
1046
|
};
|
|
1041
1047
|
var N = v.prototype;
|
|
1042
1048
|
return N.scrollTo = function(o) {
|
|
1043
|
-
o = Math.max(0, o), this.setState(function(
|
|
1044
|
-
return
|
|
1045
|
-
scrollDirection:
|
|
1049
|
+
o = Math.max(0, o), this.setState(function(m) {
|
|
1050
|
+
return m.scrollOffset === o ? null : {
|
|
1051
|
+
scrollDirection: m.scrollOffset < o ? "forward" : "backward",
|
|
1046
1052
|
scrollOffset: o,
|
|
1047
1053
|
scrollUpdateWasRequested: !0
|
|
1048
1054
|
};
|
|
1049
1055
|
}, this._resetIsScrollingDebounced);
|
|
1050
|
-
}, N.scrollToItem = function(o,
|
|
1051
|
-
|
|
1056
|
+
}, N.scrollToItem = function(o, m) {
|
|
1057
|
+
m === void 0 && (m = "auto");
|
|
1052
1058
|
var u = this.props, I = u.itemCount, g = u.layout, z = this.state.scrollOffset;
|
|
1053
1059
|
o = Math.max(0, Math.min(o, I - 1));
|
|
1054
1060
|
var y = 0;
|
|
@@ -1056,20 +1062,20 @@ function mi(e) {
|
|
|
1056
1062
|
var S = this._outerRef;
|
|
1057
1063
|
g === "vertical" ? y = S.scrollWidth > S.clientWidth ? we() : 0 : y = S.scrollHeight > S.clientHeight ? we() : 0;
|
|
1058
1064
|
}
|
|
1059
|
-
this.scrollTo(c(this.props, o,
|
|
1065
|
+
this.scrollTo(c(this.props, o, m, z, this._instanceProps, y));
|
|
1060
1066
|
}, N.componentDidMount = function() {
|
|
1061
|
-
var o = this.props,
|
|
1067
|
+
var o = this.props, m = o.direction, u = o.initialScrollOffset, I = o.layout;
|
|
1062
1068
|
if (typeof u == "number" && this._outerRef != null) {
|
|
1063
1069
|
var g = this._outerRef;
|
|
1064
|
-
|
|
1070
|
+
m === "horizontal" || I === "horizontal" ? g.scrollLeft = u : g.scrollTop = u;
|
|
1065
1071
|
}
|
|
1066
1072
|
this._callPropsCallbacks();
|
|
1067
1073
|
}, N.componentDidUpdate = function() {
|
|
1068
|
-
var o = this.props,
|
|
1074
|
+
var o = this.props, m = o.direction, u = o.layout, I = this.state, g = I.scrollOffset, z = I.scrollUpdateWasRequested;
|
|
1069
1075
|
if (z && this._outerRef != null) {
|
|
1070
1076
|
var y = this._outerRef;
|
|
1071
|
-
if (
|
|
1072
|
-
if (
|
|
1077
|
+
if (m === "horizontal" || u === "horizontal")
|
|
1078
|
+
if (m === "rtl")
|
|
1073
1079
|
switch (je()) {
|
|
1074
1080
|
case "negative":
|
|
1075
1081
|
y.scrollLeft = -g;
|
|
@@ -1091,10 +1097,10 @@ function mi(e) {
|
|
|
1091
1097
|
}, N.componentWillUnmount = function() {
|
|
1092
1098
|
this._resetIsScrollingTimeoutId !== null && ke(this._resetIsScrollingTimeoutId);
|
|
1093
1099
|
}, N.render = function() {
|
|
1094
|
-
var o = this.props,
|
|
1100
|
+
var o = this.props, m = o.children, u = o.className, I = o.direction, g = o.height, z = o.innerRef, y = o.innerElementType, S = o.innerTagName, T = o.itemCount, w = o.itemData, j = o.itemKey, q = j === void 0 ? pi : j, P = o.layout, ee = o.outerElementType, te = o.outerTagName, O = o.style, E = o.useIsScrolling, Fe = o.width, Ie = this.state.isScrolling, ne = I === "horizontal" || P === "horizontal", Be = ne ? this._onScrollHorizontal : this._onScrollVertical, fe = this._getRangeToRender(), He = fe[0], Ge = fe[1], ge = [];
|
|
1095
1101
|
if (T > 0)
|
|
1096
1102
|
for (var V = He; V <= Ge; V++)
|
|
1097
|
-
ge.push(ie(
|
|
1103
|
+
ge.push(ie(m, {
|
|
1098
1104
|
data: w,
|
|
1099
1105
|
key: q(V, w),
|
|
1100
1106
|
index: V,
|
|
@@ -1128,7 +1134,7 @@ function mi(e) {
|
|
|
1128
1134
|
if (typeof this.props.onItemsRendered == "function") {
|
|
1129
1135
|
var o = this.props.itemCount;
|
|
1130
1136
|
if (o > 0) {
|
|
1131
|
-
var
|
|
1137
|
+
var m = this._getRangeToRender(), u = m[0], I = m[1], g = m[2], z = m[3];
|
|
1132
1138
|
this._callOnItemsRendered(u, I, g, z);
|
|
1133
1139
|
}
|
|
1134
1140
|
}
|
|
@@ -1137,11 +1143,11 @@ function mi(e) {
|
|
|
1137
1143
|
this._callOnScroll(S, T, w);
|
|
1138
1144
|
}
|
|
1139
1145
|
}, N._getRangeToRender = function() {
|
|
1140
|
-
var o = this.props,
|
|
1141
|
-
if (
|
|
1146
|
+
var o = this.props, m = o.itemCount, u = o.overscanCount, I = this.state, g = I.isScrolling, z = I.scrollDirection, y = I.scrollOffset;
|
|
1147
|
+
if (m === 0)
|
|
1142
1148
|
return [0, 0, 0, 0];
|
|
1143
|
-
var S = l(this.props, y, this._instanceProps), T =
|
|
1144
|
-
return [Math.max(0, S - w), Math.max(0, Math.min(
|
|
1149
|
+
var S = l(this.props, y, this._instanceProps), T = p(this.props, S, y, this._instanceProps), w = !g || z === "backward" ? Math.max(1, u) : 1, j = !g || z === "forward" ? Math.max(1, u) : 1;
|
|
1150
|
+
return [Math.max(0, S - w), Math.max(0, Math.min(m - 1, T + j)), S, T];
|
|
1145
1151
|
}, v;
|
|
1146
1152
|
}(Re), t.defaultProps = {
|
|
1147
1153
|
direction: "ltr",
|
|
@@ -1167,19 +1173,19 @@ var hi = function(t, n) {
|
|
|
1167
1173
|
return i * n;
|
|
1168
1174
|
},
|
|
1169
1175
|
getOffsetForIndexAndAlignment: function(t, n, i, r, c, l) {
|
|
1170
|
-
var
|
|
1171
|
-
switch (i === "smart" && (r >= u - D && r <=
|
|
1176
|
+
var p = t.direction, d = t.height, f = t.itemCount, A = t.itemSize, M = t.layout, v = t.width, N = p === "horizontal" || M === "horizontal", D = N ? v : d, o = Math.max(0, f * A - D), m = Math.min(o, n * A), u = Math.max(0, n * A - D + A + l);
|
|
1177
|
+
switch (i === "smart" && (r >= u - D && r <= m + D ? i = "auto" : i = "center"), i) {
|
|
1172
1178
|
case "start":
|
|
1173
|
-
return
|
|
1179
|
+
return m;
|
|
1174
1180
|
case "end":
|
|
1175
1181
|
return u;
|
|
1176
1182
|
case "center": {
|
|
1177
|
-
var I = Math.round(u + (
|
|
1183
|
+
var I = Math.round(u + (m - u) / 2);
|
|
1178
1184
|
return I < Math.ceil(D / 2) ? 0 : I > o + Math.floor(D / 2) ? o : I;
|
|
1179
1185
|
}
|
|
1180
1186
|
case "auto":
|
|
1181
1187
|
default:
|
|
1182
|
-
return r >= u && r <=
|
|
1188
|
+
return r >= u && r <= m ? r : r < u ? u : m;
|
|
1183
1189
|
}
|
|
1184
1190
|
},
|
|
1185
1191
|
getStartIndexForOffset: function(t, n) {
|
|
@@ -1187,7 +1193,7 @@ var hi = function(t, n) {
|
|
|
1187
1193
|
return Math.max(0, Math.min(i - 1, Math.floor(n / r)));
|
|
1188
1194
|
},
|
|
1189
1195
|
getStopIndexForStartIndex: function(t, n, i) {
|
|
1190
|
-
var r = t.direction, c = t.height, l = t.itemCount,
|
|
1196
|
+
var r = t.direction, c = t.height, l = t.itemCount, p = t.itemSize, d = t.layout, f = t.width, A = r === "horizontal" || d === "horizontal", M = n * p, v = A ? f : c, N = Math.ceil((v + i - M) / p);
|
|
1191
1197
|
return Math.max(0, Math.min(
|
|
1192
1198
|
l - 1,
|
|
1193
1199
|
n + N - 1
|
|
@@ -1206,14 +1212,14 @@ function fi(e) {
|
|
|
1206
1212
|
return !(i > n || r < t);
|
|
1207
1213
|
}
|
|
1208
1214
|
function gi(e) {
|
|
1209
|
-
for (var t = e.isItemLoaded, n = e.itemCount, i = e.minimumBatchSize, r = e.startIndex, c = e.stopIndex, l = [],
|
|
1215
|
+
for (var t = e.isItemLoaded, n = e.itemCount, i = e.minimumBatchSize, r = e.startIndex, c = e.stopIndex, l = [], p = null, d = null, f = r; f <= c; f++) {
|
|
1210
1216
|
var A = t(f);
|
|
1211
|
-
A ? d !== null && (l.push(
|
|
1217
|
+
A ? d !== null && (l.push(p, d), p = d = null) : (d = f, p === null && (p = f));
|
|
1212
1218
|
}
|
|
1213
1219
|
if (d !== null) {
|
|
1214
|
-
for (var M = Math.min(Math.max(d,
|
|
1220
|
+
for (var M = Math.min(Math.max(d, p + i - 1), n - 1), v = d + 1; v <= M && !t(v); v++)
|
|
1215
1221
|
d = v;
|
|
1216
|
-
l.push(
|
|
1222
|
+
l.push(p, d);
|
|
1217
1223
|
}
|
|
1218
1224
|
if (l.length)
|
|
1219
1225
|
for (; l[1] - l[0] + 1 < i && l[0] > 0; ) {
|
|
@@ -1258,9 +1264,9 @@ var vi = function(e, t) {
|
|
|
1258
1264
|
function t() {
|
|
1259
1265
|
var n, i, r, c;
|
|
1260
1266
|
vi(this, t);
|
|
1261
|
-
for (var l = arguments.length,
|
|
1262
|
-
|
|
1263
|
-
return c = (i = (r = be(this, (n = t.__proto__ || Object.getPrototypeOf(t)).call.apply(n, [this].concat(
|
|
1267
|
+
for (var l = arguments.length, p = Array(l), d = 0; d < l; d++)
|
|
1268
|
+
p[d] = arguments[d];
|
|
1269
|
+
return c = (i = (r = be(this, (n = t.__proto__ || Object.getPrototypeOf(t)).call.apply(n, [this].concat(p))), r), r._lastRenderedStartIndex = -1, r._lastRenderedStopIndex = -1, r._memoizedUnloadedRanges = [], r._onItemsRendered = function(f) {
|
|
1264
1270
|
var A = f.visibleStartIndex, M = f.visibleStopIndex;
|
|
1265
1271
|
r._lastRenderedStartIndex = A, r._lastRenderedStopIndex = M, r._ensureRowsLoaded(A, M);
|
|
1266
1272
|
}, r._setRef = function(f) {
|
|
@@ -1289,12 +1295,12 @@ var vi = function(e, t) {
|
|
|
1289
1295
|
}, {
|
|
1290
1296
|
key: "_ensureRowsLoaded",
|
|
1291
1297
|
value: function(i, r) {
|
|
1292
|
-
var c = this.props, l = c.isItemLoaded,
|
|
1298
|
+
var c = this.props, l = c.isItemLoaded, p = c.itemCount, d = c.minimumBatchSize, f = d === void 0 ? 10 : d, A = c.threshold, M = A === void 0 ? 15 : A, v = gi({
|
|
1293
1299
|
isItemLoaded: l,
|
|
1294
|
-
itemCount:
|
|
1300
|
+
itemCount: p,
|
|
1295
1301
|
minimumBatchSize: f,
|
|
1296
1302
|
startIndex: Math.max(0, i - M),
|
|
1297
|
-
stopIndex: Math.min(
|
|
1303
|
+
stopIndex: Math.min(p - 1, r + M)
|
|
1298
1304
|
});
|
|
1299
1305
|
(this._memoizedUnloadedRanges.length !== v.length || this._memoizedUnloadedRanges.some(function(N, D) {
|
|
1300
1306
|
return v[D] !== N;
|
|
@@ -1317,8 +1323,8 @@ var vi = function(e, t) {
|
|
|
1317
1323
|
typeof r._listRef.resetAfterIndex == "function" ? r._listRef.resetAfterIndex(A, !0) : (typeof r._listRef._getItemStyleCache == "function" && r._listRef._getItemStyleCache(-1), r._listRef.forceUpdate());
|
|
1318
1324
|
}
|
|
1319
1325
|
});
|
|
1320
|
-
},
|
|
1321
|
-
l(
|
|
1326
|
+
}, p = 0; p < i.length; p += 2)
|
|
1327
|
+
l(p);
|
|
1322
1328
|
}
|
|
1323
1329
|
}]), t;
|
|
1324
1330
|
}(Re);
|
|
@@ -1387,12 +1393,12 @@ const Ti = /* @__PURE__ */ a("div")({
|
|
|
1387
1393
|
isItemLoaded: (l) => l < e.length,
|
|
1388
1394
|
itemCount: e.length + 1,
|
|
1389
1395
|
loadMoreItems: i,
|
|
1390
|
-
children: ({ onItemsRendered: l, ref:
|
|
1396
|
+
children: ({ onItemsRendered: l, ref: p }) => /* @__PURE__ */ s(bi, { children: /* @__PURE__ */ s(
|
|
1391
1397
|
Ii,
|
|
1392
1398
|
{
|
|
1393
1399
|
itemSize: 56,
|
|
1394
1400
|
onItemsRendered: l,
|
|
1395
|
-
ref:
|
|
1401
|
+
ref: p,
|
|
1396
1402
|
itemCount: e.length,
|
|
1397
1403
|
width: r,
|
|
1398
1404
|
height: c,
|
|
@@ -1492,8 +1498,8 @@ const Ti = /* @__PURE__ */ a("div")({
|
|
|
1492
1498
|
openQuestion: c,
|
|
1493
1499
|
status: l
|
|
1494
1500
|
}) => {
|
|
1495
|
-
const
|
|
1496
|
-
return
|
|
1501
|
+
const p = $e[t], d = Fi[l];
|
|
1502
|
+
return p ? /* @__PURE__ */ h(Ei, { onClick: () => c == null ? void 0 : c(e), children: [
|
|
1497
1503
|
/* @__PURE__ */ h(Wi, { children: [
|
|
1498
1504
|
/* @__PURE__ */ h(Ri, { children: [
|
|
1499
1505
|
/* @__PURE__ */ s(
|
|
@@ -1501,11 +1507,11 @@ const Ti = /* @__PURE__ */ a("div")({
|
|
|
1501
1507
|
{
|
|
1502
1508
|
"data-type-trivia": t === x.TRIVIA,
|
|
1503
1509
|
"data-type-poll": t === x.POLL,
|
|
1504
|
-
name:
|
|
1510
|
+
name: p.iconName
|
|
1505
1511
|
}
|
|
1506
1512
|
),
|
|
1507
1513
|
/* @__PURE__ */ h(Yi, { children: [
|
|
1508
|
-
|
|
1514
|
+
p.label,
|
|
1509
1515
|
t === x.TRIVIA && n === L.RESOLVED && " • Expired"
|
|
1510
1516
|
] })
|
|
1511
1517
|
] }),
|
|
@@ -1526,7 +1532,7 @@ const Ti = /* @__PURE__ */ a("div")({
|
|
|
1526
1532
|
questionId: t,
|
|
1527
1533
|
...n
|
|
1528
1534
|
}) => /* @__PURE__ */ h(Hi, { children: [
|
|
1529
|
-
/* @__PURE__ */ s(Ve, { questionId: t, ...n }),
|
|
1535
|
+
/* @__PURE__ */ s(Ve, { questionId: t, ...n, isPickHistory: !0 }),
|
|
1530
1536
|
e && /* @__PURE__ */ s(Gi, { onClick: () => e(t), children: "View Insight" })
|
|
1531
1537
|
] }), Ji = /* @__PURE__ */ a("div")({
|
|
1532
1538
|
name: "Container",
|
|
@@ -1585,8 +1591,8 @@ const Ti = /* @__PURE__ */ a("div")({
|
|
|
1585
1591
|
return /* @__PURE__ */ s(Zi, { openInsight: t, ...l }, l.questionId);
|
|
1586
1592
|
}
|
|
1587
1593
|
if (n.type === "tweet" && ((c = n.attributes) == null ? void 0 : c.attributes.case) === "tweet") {
|
|
1588
|
-
const l = n.attributes.attributes.value,
|
|
1589
|
-
return /* @__PURE__ */ s(ns, { openTweet: t, ...l, tweetId:
|
|
1594
|
+
const l = n.attributes.attributes.value, p = n.attributes.id, d = n.attributes.created;
|
|
1595
|
+
return /* @__PURE__ */ s(ns, { openTweet: t, ...l, tweetId: p, created: d }, p);
|
|
1590
1596
|
}
|
|
1591
1597
|
return null;
|
|
1592
1598
|
}) }), rs = ({ store: e, openQuestion: t }) => {
|