@streamlayer/react 0.29.10 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/masters.d.ts +1 -0
- package/lib/{app-c9828ece.cjs → app-36051bbe.cjs} +1 -1
- package/lib/{app-e4b43a5c.js → app-c53bb384.js} +5 -5
- package/lib/cjs/auth.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/masters.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/dist/cjs/masters.js +1 -1
- package/lib/dist/es/masters.js +1 -1
- package/lib/dist/index-bcabe854.js +1464 -0
- package/lib/dist/index-f504e8d3.cjs +1 -0
- package/lib/dist/index.d.ts +1 -0
- package/lib/dist/masters-3c9c6ffe.js +26765 -0
- package/lib/dist/masters-fe5f1486.cjs +297 -0
- package/lib/dist/style.css +1 -193
- package/lib/es/auth.js +2 -2
- package/lib/es/index.js +2 -2
- package/lib/es/masters.js +5 -4
- package/lib/es/points.js +40 -40
- package/lib/index-15f61ac8.js +151 -0
- package/lib/index-565f26fb.cjs +1 -0
- package/lib/{index-0d23b24e.js → index-89366251.js} +5 -5
- package/lib/index-af5c5738.cjs +1 -0
- package/lib/{index-89c19a6e.cjs → index-dd93a61a.cjs} +2 -2
- package/lib/index-e26b3493.js +1410 -0
- package/lib/masters-bf25c11c.js +2415 -0
- package/lib/masters-f135002d.cjs +6 -0
- package/lib/style.css +1 -1
- package/package.json +4 -4
- package/lib/dist/index-5d2b7e7a.cjs +0 -1
- package/lib/dist/index-b48a730f.js +0 -1710
- package/lib/dist/masters-187c9707.js +0 -20454
- package/lib/dist/masters-9e88aaec.cjs +0 -29
- package/lib/index-3f5c6152.cjs +0 -6
- package/lib/index-616b0bcd.js +0 -936
- package/lib/index-66ccd267.js +0 -2821
- package/lib/index-b0206045.cjs +0 -1
- package/lib/masters-1b02c80d.cjs +0 -1
- package/lib/masters-5752c805.js +0 -693
|
@@ -0,0 +1,1464 @@
|
|
|
1
|
+
import { jsxs as I, jsx as r, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
+
import { s as a, i as C, o as De, a as Se, b as ze, Q as x, c as P, d as b, E, r as xe, e as Ye, f as We, n as Fe, w as Be, u as O, A as Ve, O as He, P as F, g as Ge, h as ee, j as Ze, x as Je } from "./masters-3c9c6ffe.js";
|
|
3
|
+
import Q, { useRef as w, useState as L, useCallback as q, useEffect as Ke, useLayoutEffect as Xe, useMemo as V, createElement as G, PureComponent as Ce } from "react";
|
|
4
|
+
const et = /* @__PURE__ */ a("div")({
|
|
5
|
+
name: "Container",
|
|
6
|
+
class: "Container_c1vwopgc",
|
|
7
|
+
propsAsIs: !1
|
|
8
|
+
}), tt = /* @__PURE__ */ a("div")({
|
|
9
|
+
name: "QuestionTypeWrap",
|
|
10
|
+
class: "QuestionTypeWrap_qyktpt0",
|
|
11
|
+
propsAsIs: !1
|
|
12
|
+
}), nt = () => C, it = /* @__PURE__ */ a(nt())({
|
|
13
|
+
name: "QuestionTypeIcon",
|
|
14
|
+
class: "QuestionTypeIcon_q951jdx",
|
|
15
|
+
propsAsIs: !0
|
|
16
|
+
}), st = /* @__PURE__ */ a("span")({
|
|
17
|
+
name: "QuestionTypeTitle",
|
|
18
|
+
class: "QuestionTypeTitle_qss5f0e",
|
|
19
|
+
propsAsIs: !1
|
|
20
|
+
}), rt = /* @__PURE__ */ a("button")({
|
|
21
|
+
name: "CloseButton",
|
|
22
|
+
class: "CloseButton_c1ao1jtv",
|
|
23
|
+
propsAsIs: !1
|
|
24
|
+
}), ot = () => C, at = /* @__PURE__ */ a(ot())({
|
|
25
|
+
name: "CloseIcon",
|
|
26
|
+
class: "CloseIcon_cvsl7l3",
|
|
27
|
+
propsAsIs: !0
|
|
28
|
+
}), ke = ({ type: e, close: t, label: n }) => {
|
|
29
|
+
const i = e ? De[e] : { label: n, iconName: void 0 };
|
|
30
|
+
return /* @__PURE__ */ I(et, { children: [
|
|
31
|
+
/* @__PURE__ */ I(tt, { children: [
|
|
32
|
+
(i == null ? void 0 : i.iconName) && /* @__PURE__ */ r(it, { name: i.iconName }),
|
|
33
|
+
(i == null ? void 0 : i.label) && /* @__PURE__ */ r(st, { children: i.label })
|
|
34
|
+
] }),
|
|
35
|
+
/* @__PURE__ */ r(rt, { onClick: t, children: /* @__PURE__ */ r(at, { name: "icon-cross" }) })
|
|
36
|
+
] });
|
|
37
|
+
}, lt = /* @__PURE__ */ a("div")({
|
|
38
|
+
name: "Container",
|
|
39
|
+
class: "Container_c1zy8a",
|
|
40
|
+
propsAsIs: !1
|
|
41
|
+
}), ct = /* @__PURE__ */ a("div")({
|
|
42
|
+
name: "Title",
|
|
43
|
+
class: "Title_t1vih9p5",
|
|
44
|
+
propsAsIs: !1
|
|
45
|
+
}), dt = /* @__PURE__ */ a("div")({
|
|
46
|
+
name: "Indicator",
|
|
47
|
+
class: "Indicator_i1fbnvpb",
|
|
48
|
+
propsAsIs: !1
|
|
49
|
+
}), ae = ({ indicator: e, title: t }) => /* @__PURE__ */ I(lt, { children: [
|
|
50
|
+
/* @__PURE__ */ r(ct, { children: t }),
|
|
51
|
+
/* @__PURE__ */ r(dt, { children: e })
|
|
52
|
+
] }), ut = /* @__PURE__ */ a("div")({
|
|
53
|
+
name: "Container",
|
|
54
|
+
class: "Container_ctmhwyc",
|
|
55
|
+
propsAsIs: !1
|
|
56
|
+
}), pt = /* @__PURE__ */ a("div")({
|
|
57
|
+
name: "Indicator",
|
|
58
|
+
class: "Indicator_i1jri200",
|
|
59
|
+
propsAsIs: !1
|
|
60
|
+
}), mt = /* @__PURE__ */ a("div")({
|
|
61
|
+
name: "Title",
|
|
62
|
+
class: "Title_t8s05oq",
|
|
63
|
+
propsAsIs: !1
|
|
64
|
+
}), B = ({ indicator: e, title: t }) => /* @__PURE__ */ I(ut, { children: [
|
|
65
|
+
/* @__PURE__ */ r(pt, { children: e }),
|
|
66
|
+
/* @__PURE__ */ r(mt, { children: t })
|
|
67
|
+
] }), ht = /* @__PURE__ */ a("div")({
|
|
68
|
+
name: "Container",
|
|
69
|
+
class: "Container_c1yrpn9o",
|
|
70
|
+
propsAsIs: !1
|
|
71
|
+
}), It = /* @__PURE__ */ a("div")({
|
|
72
|
+
name: "TopInfo",
|
|
73
|
+
class: "TopInfo_t17fwahh",
|
|
74
|
+
propsAsIs: !1
|
|
75
|
+
}), ft = /* @__PURE__ */ a("div")({
|
|
76
|
+
name: "BottomInfo",
|
|
77
|
+
class: "BottomInfo_by6w7e9",
|
|
78
|
+
propsAsIs: !1
|
|
79
|
+
}), gt = /* @__PURE__ */ a("div")({
|
|
80
|
+
name: "User",
|
|
81
|
+
class: "User_u1g7arbm",
|
|
82
|
+
propsAsIs: !1
|
|
83
|
+
}), Mt = /* @__PURE__ */ a("img")({
|
|
84
|
+
name: "Avatar",
|
|
85
|
+
class: "Avatar_a1ldeata",
|
|
86
|
+
propsAsIs: !1
|
|
87
|
+
}), vt = /* @__PURE__ */ a("div")({
|
|
88
|
+
name: "UserInfo",
|
|
89
|
+
class: "UserInfo_u10d4koz",
|
|
90
|
+
propsAsIs: !1
|
|
91
|
+
}), yt = /* @__PURE__ */ a("div")({
|
|
92
|
+
name: "UserName",
|
|
93
|
+
class: "UserName_u1q6roj0",
|
|
94
|
+
propsAsIs: !1
|
|
95
|
+
}), Tt = /* @__PURE__ */ a("div")({
|
|
96
|
+
name: "UserRating",
|
|
97
|
+
class: "UserRating_ui0m425",
|
|
98
|
+
propsAsIs: !1
|
|
99
|
+
}), At = /* @__PURE__ */ a("img")({
|
|
100
|
+
name: "TrophyIcon",
|
|
101
|
+
class: "TrophyIcon_t1el3mrn",
|
|
102
|
+
propsAsIs: !1
|
|
103
|
+
}), Nt = /* @__PURE__ */ a("div")({
|
|
104
|
+
name: "Rts",
|
|
105
|
+
class: "Rts_r2vgnxv",
|
|
106
|
+
propsAsIs: !1
|
|
107
|
+
}), Dt = /* @__PURE__ */ a("div")({
|
|
108
|
+
name: "RtsIndicator",
|
|
109
|
+
class: "RtsIndicator_roqn06j",
|
|
110
|
+
propsAsIs: !1
|
|
111
|
+
}), St = /* @__PURE__ */ a("div")({
|
|
112
|
+
name: "RtsLabel",
|
|
113
|
+
class: "RtsLabel_r15adx7c",
|
|
114
|
+
propsAsIs: !1
|
|
115
|
+
}), zt = /* @__PURE__ */ a("div")({
|
|
116
|
+
name: "Divider",
|
|
117
|
+
class: "Divider_dv59lta",
|
|
118
|
+
propsAsIs: !1
|
|
119
|
+
}), xt = /* @__PURE__ */ a("div")({
|
|
120
|
+
name: "Ranks",
|
|
121
|
+
class: "Ranks_r55lotb",
|
|
122
|
+
propsAsIs: !1
|
|
123
|
+
}), Ct = /* @__PURE__ */ a("div")({
|
|
124
|
+
name: "Statistics",
|
|
125
|
+
class: "Statistics_s1knfgqt",
|
|
126
|
+
propsAsIs: !1
|
|
127
|
+
}), kt = /* @__PURE__ */ a("div")({
|
|
128
|
+
name: "AvatarPlaceholder",
|
|
129
|
+
class: "AvatarPlaceholder_a1mqo824",
|
|
130
|
+
propsAsIs: !1
|
|
131
|
+
}), jt = /* @__PURE__ */ a("button")({
|
|
132
|
+
name: "UserAccountBtn",
|
|
133
|
+
class: "UserAccountBtn_uxareh6",
|
|
134
|
+
propsAsIs: !1
|
|
135
|
+
}), Ot = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=", je = ({
|
|
136
|
+
avatar: e,
|
|
137
|
+
name: t,
|
|
138
|
+
points: n,
|
|
139
|
+
friendsRank: i,
|
|
140
|
+
rank: s,
|
|
141
|
+
streak: c,
|
|
142
|
+
correct: l,
|
|
143
|
+
incorrect: m,
|
|
144
|
+
inTop: d,
|
|
145
|
+
successRate: f
|
|
146
|
+
}) => /* @__PURE__ */ I(ht, { children: [
|
|
147
|
+
/* @__PURE__ */ r(It, { children: /* @__PURE__ */ I(gt, { children: [
|
|
148
|
+
/* @__PURE__ */ I(jt, { children: [
|
|
149
|
+
e && /* @__PURE__ */ r(Mt, { alt: "avatar", src: e }),
|
|
150
|
+
!e && /* @__PURE__ */ r(kt, { children: Se(t || "") })
|
|
151
|
+
] }),
|
|
152
|
+
/* @__PURE__ */ I(vt, { children: [
|
|
153
|
+
/* @__PURE__ */ r(yt, { children: t }),
|
|
154
|
+
/* @__PURE__ */ I(Tt, { children: [
|
|
155
|
+
/* @__PURE__ */ I(Nt, { children: [
|
|
156
|
+
/* @__PURE__ */ r(At, { alt: "rank-icon", src: Ot }),
|
|
157
|
+
/* @__PURE__ */ I(Dt, { children: [
|
|
158
|
+
ze(n),
|
|
159
|
+
/* @__PURE__ */ r(St, { children: "PTS" })
|
|
160
|
+
] })
|
|
161
|
+
] }),
|
|
162
|
+
/* @__PURE__ */ r(zt, {}),
|
|
163
|
+
/* @__PURE__ */ I("div", { children: [
|
|
164
|
+
"TOP ",
|
|
165
|
+
d || 0,
|
|
166
|
+
"%"
|
|
167
|
+
] })
|
|
168
|
+
] })
|
|
169
|
+
] })
|
|
170
|
+
] }) }),
|
|
171
|
+
/* @__PURE__ */ I(ft, { children: [
|
|
172
|
+
/* @__PURE__ */ I(xt, { children: [
|
|
173
|
+
/* @__PURE__ */ r(ae, { indicator: i || 0, title: "Friends rank" }),
|
|
174
|
+
/* @__PURE__ */ r(ae, { indicator: s || 0, title: "Global rank" })
|
|
175
|
+
] }),
|
|
176
|
+
/* @__PURE__ */ I(Ct, { children: [
|
|
177
|
+
/* @__PURE__ */ r(B, { indicator: c || 0, title: "Win streak" }),
|
|
178
|
+
/* @__PURE__ */ r(B, { indicator: l || 0, title: "Correct" }),
|
|
179
|
+
/* @__PURE__ */ r(B, { indicator: m || 0, title: "Incorrect" }),
|
|
180
|
+
/* @__PURE__ */ r(B, { indicator: `${f || 0}%`, title: "Succ. rate" })
|
|
181
|
+
] })
|
|
182
|
+
] })
|
|
183
|
+
] }), wt = /* @__PURE__ */ a("div")({
|
|
184
|
+
name: "Container",
|
|
185
|
+
class: "Container_c38csyt",
|
|
186
|
+
propsAsIs: !1
|
|
187
|
+
}), _t = /* @__PURE__ */ a("div")({
|
|
188
|
+
name: "Title",
|
|
189
|
+
class: "Title_ty221rx",
|
|
190
|
+
propsAsIs: !1
|
|
191
|
+
}), bt = /* @__PURE__ */ a("div")({
|
|
192
|
+
name: "Description",
|
|
193
|
+
class: "Description_dlaj9xp",
|
|
194
|
+
propsAsIs: !1
|
|
195
|
+
}), $t = ({ title: e, description: t }) => /* @__PURE__ */ I(wt, { children: [
|
|
196
|
+
/* @__PURE__ */ r(C, { name: "icon-check-circle" }),
|
|
197
|
+
/* @__PURE__ */ r(_t, { children: e }),
|
|
198
|
+
/* @__PURE__ */ r(bt, { children: t })
|
|
199
|
+
] }), Et = /* @__PURE__ */ a("div")({
|
|
200
|
+
name: "Container",
|
|
201
|
+
class: "Container_c16sbdnm",
|
|
202
|
+
propsAsIs: !1
|
|
203
|
+
}), Lt = () => C, Rt = /* @__PURE__ */ a(Lt())({
|
|
204
|
+
name: "IconPrediction",
|
|
205
|
+
class: "IconPrediction_ibhorgl",
|
|
206
|
+
propsAsIs: !0
|
|
207
|
+
}), le = /* @__PURE__ */ a("div")({
|
|
208
|
+
name: "FeedbackIconWrap",
|
|
209
|
+
class: "FeedbackIconWrap_f1g20ja7",
|
|
210
|
+
propsAsIs: !1
|
|
211
|
+
}), ce = /* @__PURE__ */ a("div")({
|
|
212
|
+
name: "FeedbackHeader",
|
|
213
|
+
class: "FeedbackHeader_f455ozj",
|
|
214
|
+
propsAsIs: !1
|
|
215
|
+
}), Qt = /* @__PURE__ */ a("span")({
|
|
216
|
+
name: "FeedbackTitle",
|
|
217
|
+
class: "FeedbackTitle_f1913njx",
|
|
218
|
+
propsAsIs: !1
|
|
219
|
+
}), Z = /* @__PURE__ */ a("span")({
|
|
220
|
+
name: "FeedbackDescription",
|
|
221
|
+
class: "FeedbackDescription_fzfk69z",
|
|
222
|
+
propsAsIs: !1
|
|
223
|
+
}), Ut = /* @__PURE__ */ a("div")({
|
|
224
|
+
name: "FeedbackText",
|
|
225
|
+
class: "FeedbackText_fx87qaj",
|
|
226
|
+
propsAsIs: !1
|
|
227
|
+
}), Pt = ({
|
|
228
|
+
feedbackMessages: e,
|
|
229
|
+
questionVotedCorrectly: t,
|
|
230
|
+
questionVoted: n,
|
|
231
|
+
questionType: i,
|
|
232
|
+
hasCorrectAnswer: s,
|
|
233
|
+
questionStatus: c
|
|
234
|
+
}) => {
|
|
235
|
+
const l = n && (i === x.TRIVIA || i === x.PREDICTION);
|
|
236
|
+
if (!l && c !== P.RESOLVED)
|
|
237
|
+
return null;
|
|
238
|
+
const m = i === x.PREDICTION && !s, d = t ? "correct" : "incorrect", f = t ? e.correctFeedback : e.incorrectFeedback;
|
|
239
|
+
return /* @__PURE__ */ I(Et, { "data-isPrediction": m, children: [
|
|
240
|
+
c === P.RESOLVED && i === x.TRIVIA && !n && /* @__PURE__ */ I($, { children: [
|
|
241
|
+
/* @__PURE__ */ r(le, { children: /* @__PURE__ */ r(C, { name: "questionExpired" }) }),
|
|
242
|
+
/* @__PURE__ */ I("div", { children: [
|
|
243
|
+
/* @__PURE__ */ r(ce, { children: /* @__PURE__ */ r(Z, { children: "Question Expired" }) }),
|
|
244
|
+
/* @__PURE__ */ r(Ut, { children: "You can still answer to see if you're correct, but no points are awarded for expired questions." })
|
|
245
|
+
] })
|
|
246
|
+
] }),
|
|
247
|
+
l && m && /* @__PURE__ */ I($, { children: [
|
|
248
|
+
/* @__PURE__ */ r(Rt, { name: "icon-prediction" }),
|
|
249
|
+
/* @__PURE__ */ r(Z, { children: "Stay tuned to see if your prediction was correct." })
|
|
250
|
+
] }),
|
|
251
|
+
l && s && /* @__PURE__ */ I($, { children: [
|
|
252
|
+
/* @__PURE__ */ r(le, { "data-feedbackType": d, children: /* @__PURE__ */ r(C, { name: d }) }),
|
|
253
|
+
/* @__PURE__ */ r("div", { children: /* @__PURE__ */ I(ce, { children: [
|
|
254
|
+
/* @__PURE__ */ r(Qt, { "data-feedbackType": d, children: f == null ? void 0 : f.title }),
|
|
255
|
+
/* @__PURE__ */ r(Z, { children: f == null ? void 0 : f.description })
|
|
256
|
+
] }) })
|
|
257
|
+
] })
|
|
258
|
+
] });
|
|
259
|
+
}, qt = /* @__PURE__ */ a("div")({
|
|
260
|
+
name: "Container",
|
|
261
|
+
class: "Container_c14ielyq",
|
|
262
|
+
propsAsIs: !1
|
|
263
|
+
}), Yt = /* @__PURE__ */ a("div")({
|
|
264
|
+
name: "Content",
|
|
265
|
+
class: "Content_c1tlqx57",
|
|
266
|
+
propsAsIs: !1
|
|
267
|
+
}), Wt = /* @__PURE__ */ a("div")({
|
|
268
|
+
name: "Title",
|
|
269
|
+
class: "Title_t1hq58md",
|
|
270
|
+
propsAsIs: !1
|
|
271
|
+
}), Ft = /* @__PURE__ */ a("div")({
|
|
272
|
+
name: "Options",
|
|
273
|
+
class: "Options_o1c8nxcx",
|
|
274
|
+
propsAsIs: !1
|
|
275
|
+
}), Bt = /* @__PURE__ */ a("button")({
|
|
276
|
+
name: "ButtonContainer",
|
|
277
|
+
class: "ButtonContainer_b1b6dl8t",
|
|
278
|
+
propsAsIs: !1
|
|
279
|
+
}), Vt = /* @__PURE__ */ a("div")({
|
|
280
|
+
name: "ButtonPct",
|
|
281
|
+
class: "ButtonPct_b4iik8i",
|
|
282
|
+
propsAsIs: !1
|
|
283
|
+
}), Ht = /* @__PURE__ */ a("span")({
|
|
284
|
+
name: "ButtonBody",
|
|
285
|
+
class: "ButtonBody_b1gq1lnf",
|
|
286
|
+
propsAsIs: !1
|
|
287
|
+
}), Gt = /* @__PURE__ */ a("div")({
|
|
288
|
+
name: "IconContainer",
|
|
289
|
+
class: "IconContainer_i1j65z51",
|
|
290
|
+
propsAsIs: !1
|
|
291
|
+
}), Zt = /* @__PURE__ */ a("div")({
|
|
292
|
+
name: "IconWrap",
|
|
293
|
+
class: "IconWrap_i19tpfua",
|
|
294
|
+
propsAsIs: !1
|
|
295
|
+
}), Oe = /* @__PURE__ */ a("img")({
|
|
296
|
+
name: "Icon",
|
|
297
|
+
class: "Icon_i1tubmma",
|
|
298
|
+
propsAsIs: !1
|
|
299
|
+
}), Jt = () => Oe, Kt = /* @__PURE__ */ a(Jt())({
|
|
300
|
+
name: "IconDefault",
|
|
301
|
+
class: "IconDefault_i1grrgwj",
|
|
302
|
+
propsAsIs: !0
|
|
303
|
+
}), Xt = () => Oe, en = /* @__PURE__ */ a(Xt())({
|
|
304
|
+
name: "IconCircle",
|
|
305
|
+
class: "IconCircle_ibemyq8",
|
|
306
|
+
propsAsIs: !0
|
|
307
|
+
}), tn = /* @__PURE__ */ a("span")({
|
|
308
|
+
name: "Title",
|
|
309
|
+
class: "Title_t1dceht",
|
|
310
|
+
propsAsIs: !1
|
|
311
|
+
}), nn = /* @__PURE__ */ a("span")({
|
|
312
|
+
name: "Indicators",
|
|
313
|
+
class: "Indicators_i116q4vq",
|
|
314
|
+
propsAsIs: !1
|
|
315
|
+
}), sn = /* @__PURE__ */ a("span")({
|
|
316
|
+
name: "Percentage",
|
|
317
|
+
class: "Percentage_p17ajcu2",
|
|
318
|
+
propsAsIs: !1
|
|
319
|
+
}), rn = () => C, on = /* @__PURE__ */ a(rn())({
|
|
320
|
+
name: "CheckIcon",
|
|
321
|
+
class: "CheckIcon_cu9kmlb",
|
|
322
|
+
propsAsIs: !0
|
|
323
|
+
}), de = {
|
|
324
|
+
[b.CENTERED]: (e) => /* @__PURE__ */ r(Kt, { alt: "option-icon", src: e }),
|
|
325
|
+
[b.TRANSPARENT]: (e) => /* @__PURE__ */ r(Gt, { children: /* @__PURE__ */ r(Zt, { style: { backgroundImage: `url(${e})` } }) }),
|
|
326
|
+
[b.ROUNDED]: (e) => /* @__PURE__ */ r(en, { alt: "option-icon", src: e }),
|
|
327
|
+
[b.NONE]: () => null,
|
|
328
|
+
[b.UNSET]: () => null
|
|
329
|
+
}, an = ({ questionType: e, hasCorrectAnswer: t, correct: n, youVoted: i, questionVoted: s }) => {
|
|
330
|
+
if (e === x.POLL && i)
|
|
331
|
+
return "correct";
|
|
332
|
+
if (e === x.PREDICTION) {
|
|
333
|
+
if (t && s)
|
|
334
|
+
return i ? n ? "correct" : "incorrect" : n ? "correct" : "unset";
|
|
335
|
+
if (i)
|
|
336
|
+
return "correct";
|
|
337
|
+
}
|
|
338
|
+
return e === x.TRIVIA && s ? i ? n ? "correct" : "incorrect" : n ? "correct" : "unset" : "unset";
|
|
339
|
+
}, ln = ({
|
|
340
|
+
questionType: e,
|
|
341
|
+
questionVoted: t,
|
|
342
|
+
correct: n,
|
|
343
|
+
hasCorrectAnswer: i,
|
|
344
|
+
questionStatus: s
|
|
345
|
+
}) => e === x.TRIVIA ? t && n : e === x.PREDICTION ? t && n && i || s === P.RESOLVED && n : !1, cn = (e) => {
|
|
346
|
+
var t;
|
|
347
|
+
const {
|
|
348
|
+
// option props
|
|
349
|
+
id: n,
|
|
350
|
+
icon: i,
|
|
351
|
+
text: s,
|
|
352
|
+
percentageDecimal: c,
|
|
353
|
+
// extra props
|
|
354
|
+
onVote: l,
|
|
355
|
+
youSelected: m,
|
|
356
|
+
questionVoted: d,
|
|
357
|
+
// ToDo: Figure out why imageMode is not in the response, and delete default value
|
|
358
|
+
imageMode: f = b.ROUNDED,
|
|
359
|
+
answerTimeExpired: A,
|
|
360
|
+
questionStatus: v,
|
|
361
|
+
isLoading: g,
|
|
362
|
+
questionType: N,
|
|
363
|
+
correct: D,
|
|
364
|
+
hasCorrectAnswer: o
|
|
365
|
+
} = e, u = an(e), p = ln({ questionType: N, questionVoted: d, correct: D, hasCorrectAnswer: o, questionStatus: v }), h = d || v === P.RESOLVED && N === x.PREDICTION;
|
|
366
|
+
return /* @__PURE__ */ I(
|
|
367
|
+
Bt,
|
|
368
|
+
{
|
|
369
|
+
value: n,
|
|
370
|
+
"data-selected": m,
|
|
371
|
+
"data-answerState": u,
|
|
372
|
+
disabled: d || g || A,
|
|
373
|
+
onClick: l,
|
|
374
|
+
children: [
|
|
375
|
+
h && /* @__PURE__ */ r(Vt, { "data-answerState": u, style: { width: `${c}%` } }),
|
|
376
|
+
/* @__PURE__ */ I(Ht, { children: [
|
|
377
|
+
i && ((t = de[f]) == null ? void 0 : t.call(de, i)),
|
|
378
|
+
/* @__PURE__ */ r(tn, { children: s }),
|
|
379
|
+
h && /* @__PURE__ */ I(nn, { children: [
|
|
380
|
+
p && /* @__PURE__ */ r(on, { name: "selected" }),
|
|
381
|
+
/* @__PURE__ */ I(sn, { children: [
|
|
382
|
+
c,
|
|
383
|
+
"%"
|
|
384
|
+
] })
|
|
385
|
+
] })
|
|
386
|
+
] })
|
|
387
|
+
]
|
|
388
|
+
}
|
|
389
|
+
);
|
|
390
|
+
};
|
|
391
|
+
var ue = typeof window > "u" ? Ke : Xe, dn = ({ isPlaying: e, duration: t, startAt: n = 0, updateInterval: i = 0, onComplete: s, onUpdate: c }) => {
|
|
392
|
+
let [l, m] = L(n), d = w(0), f = w(n), A = w(n * -1e3), v = w(null), g = w(null), N = w(null), D = (p) => {
|
|
393
|
+
let h = p / 1e3;
|
|
394
|
+
if (g.current === null) {
|
|
395
|
+
g.current = h, v.current = requestAnimationFrame(D);
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
let M = h - g.current, y = d.current + M;
|
|
399
|
+
g.current = h, d.current = y;
|
|
400
|
+
let T = f.current + (i === 0 ? y : (y / i | 0) * i), S = f.current + y, z = typeof t == "number" && S >= t;
|
|
401
|
+
m(z ? t : T), z || (v.current = requestAnimationFrame(D));
|
|
402
|
+
}, o = () => {
|
|
403
|
+
v.current && cancelAnimationFrame(v.current), N.current && clearTimeout(N.current), g.current = null;
|
|
404
|
+
}, u = q((p) => {
|
|
405
|
+
o(), d.current = 0;
|
|
406
|
+
let h = typeof p == "number" ? p : n;
|
|
407
|
+
f.current = h, m(h), e && (v.current = requestAnimationFrame(D));
|
|
408
|
+
}, [e, n]);
|
|
409
|
+
return ue(() => {
|
|
410
|
+
if (c == null || c(l), t && l >= t) {
|
|
411
|
+
A.current += t * 1e3;
|
|
412
|
+
let { shouldRepeat: p = !1, delay: h = 0, newStartAt: M } = (s == null ? void 0 : s(A.current / 1e3)) || {};
|
|
413
|
+
p && (N.current = setTimeout(() => u(M), h * 1e3));
|
|
414
|
+
}
|
|
415
|
+
}, [l, t]), ue(() => (e && (v.current = requestAnimationFrame(D)), o), [e, t, i]), { elapsedTime: l, reset: u };
|
|
416
|
+
}, un = (e, t, n) => {
|
|
417
|
+
let i = e / 2, s = t / 2, c = i - s, l = 2 * c, m = n === "clockwise" ? "1,0" : "0,1", d = 2 * Math.PI * c;
|
|
418
|
+
return { path: `m ${i},${s} a ${c},${c} 0 ${m} 0,${l} a ${c},${c} 0 ${m} 0,-${l}`, pathLength: d };
|
|
419
|
+
}, pe = (e, t) => e === 0 || e === t ? 0 : typeof t == "number" ? e - t : 0, pn = (e) => ({ position: "relative", width: e, height: e }), mn = { display: "flex", justifyContent: "center", alignItems: "center", position: "absolute", left: 0, top: 0, width: "100%", height: "100%" }, we = (e, t, n, i, s) => {
|
|
420
|
+
if (i === 0)
|
|
421
|
+
return t;
|
|
422
|
+
let c = (s ? i - e : e) / i;
|
|
423
|
+
return t + n * c;
|
|
424
|
+
}, me = (e) => {
|
|
425
|
+
var t, n;
|
|
426
|
+
return (n = (t = e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (i, s, c, l) => `#${s}${s}${c}${c}${l}${l}`).substring(1).match(/.{2}/g)) == null ? void 0 : t.map((i) => parseInt(i, 16))) != null ? n : [];
|
|
427
|
+
}, hn = (e, t) => {
|
|
428
|
+
var n;
|
|
429
|
+
let { colors: i, colorsTime: s, isSmoothColorTransition: c = !0 } = e;
|
|
430
|
+
if (typeof i == "string")
|
|
431
|
+
return i;
|
|
432
|
+
let l = (n = s == null ? void 0 : s.findIndex((g, N) => g >= t && t >= s[N + 1])) != null ? n : -1;
|
|
433
|
+
if (!s || l === -1)
|
|
434
|
+
return i[0];
|
|
435
|
+
if (!c)
|
|
436
|
+
return i[l];
|
|
437
|
+
let m = s[l] - t, d = s[l] - s[l + 1], f = me(i[l]), A = me(i[l + 1]), v = !!e.isGrowing;
|
|
438
|
+
return `rgb(${f.map((g, N) => we(m, g, A[N] - g, d, v) | 0).join(",")})`;
|
|
439
|
+
}, In = (e) => {
|
|
440
|
+
let { duration: t, initialRemainingTime: n, updateInterval: i, size: s = 180, strokeWidth: c = 12, trailStrokeWidth: l, isPlaying: m = !1, isGrowing: d = !1, rotation: f = "clockwise", onComplete: A, onUpdate: v } = e, g = w(), N = Math.max(c, l ?? 0), { path: D, pathLength: o } = un(s, N, f), { elapsedTime: u } = dn({ isPlaying: m, duration: t, startAt: pe(t, n), updateInterval: i, onUpdate: typeof v == "function" ? (h) => {
|
|
441
|
+
let M = Math.ceil(t - h);
|
|
442
|
+
M !== g.current && (g.current = M, v(M));
|
|
443
|
+
} : void 0, onComplete: typeof A == "function" ? (h) => {
|
|
444
|
+
var M;
|
|
445
|
+
let { shouldRepeat: y, delay: T, newInitialRemainingTime: S } = (M = A(h)) != null ? M : {};
|
|
446
|
+
if (y)
|
|
447
|
+
return { shouldRepeat: y, delay: T, newStartAt: pe(t, S) };
|
|
448
|
+
} : void 0 }), p = t - u;
|
|
449
|
+
return { elapsedTime: u, path: D, pathLength: o, remainingTime: Math.ceil(p), rotation: f, size: s, stroke: hn(e, p), strokeDashoffset: we(u, 0, o, t, d), strokeWidth: c };
|
|
450
|
+
}, _e = (e) => {
|
|
451
|
+
let { children: t, strokeLinecap: n, trailColor: i, trailStrokeWidth: s } = e, { path: c, pathLength: l, stroke: m, strokeDashoffset: d, remainingTime: f, elapsedTime: A, size: v, strokeWidth: g } = In(e);
|
|
452
|
+
return Q.createElement("div", { style: pn(v) }, Q.createElement("svg", { viewBox: `0 0 ${v} ${v}`, width: v, height: v, xmlns: "http://www.w3.org/2000/svg" }, Q.createElement("path", { d: c, fill: "none", stroke: i ?? "#d9d9d9", strokeWidth: s ?? g }), Q.createElement("path", { d: c, fill: "none", stroke: m, strokeLinecap: n ?? "round", strokeWidth: g, strokeDasharray: l, strokeDashoffset: d })), typeof t == "function" && Q.createElement("div", { style: mn }, t({ remainingTime: f, elapsedTime: A, color: m })));
|
|
453
|
+
};
|
|
454
|
+
_e.displayName = "CountdownCircleTimer";
|
|
455
|
+
const fn = [E.PRIMARY_GREEN1, E.SECONDARY_RED1, E.SECONDARY_RED1], gn = [10, 10, 0], Mn = /* @__PURE__ */ a("div")({
|
|
456
|
+
name: "RemainingTime",
|
|
457
|
+
class: "RemainingTime_r165427",
|
|
458
|
+
propsAsIs: !1
|
|
459
|
+
}), vn = E.SECONDARY_GREEN6, he = E.SECONDARY_RED3, yn = E.NEUTRALS_GRAY3, Tn = ({
|
|
460
|
+
isPlaying: e = !0,
|
|
461
|
+
duration: t = 30,
|
|
462
|
+
onTimerExpired: n
|
|
463
|
+
}) => {
|
|
464
|
+
const [i, s] = L(t > 10 ? vn : he), c = ({
|
|
465
|
+
remainingTime: d
|
|
466
|
+
}) => /* @__PURE__ */ r(Mn, {
|
|
467
|
+
children: d
|
|
468
|
+
}), l = q(() => {
|
|
469
|
+
n == null || n(), s(yn);
|
|
470
|
+
}, [n, s]), m = q((d) => {
|
|
471
|
+
d === 10 && s(he);
|
|
472
|
+
}, [s]);
|
|
473
|
+
return /* @__PURE__ */ r(_e, {
|
|
474
|
+
isPlaying: e,
|
|
475
|
+
duration: t,
|
|
476
|
+
colors: fn,
|
|
477
|
+
colorsTime: gn,
|
|
478
|
+
size: 32,
|
|
479
|
+
strokeWidth: 2,
|
|
480
|
+
trailStrokeWidth: 2,
|
|
481
|
+
trailColor: i,
|
|
482
|
+
onComplete: l,
|
|
483
|
+
onUpdate: m,
|
|
484
|
+
children: c
|
|
485
|
+
});
|
|
486
|
+
}, An = /* @__PURE__ */ a("div")({
|
|
487
|
+
name: "WinBarContainer",
|
|
488
|
+
class: "WinBarContainer_wie6cqo",
|
|
489
|
+
propsAsIs: !1
|
|
490
|
+
}), Nn = /* @__PURE__ */ a("div")({
|
|
491
|
+
name: "Content",
|
|
492
|
+
class: "Content_cgizw4u",
|
|
493
|
+
propsAsIs: !1
|
|
494
|
+
}), Dn = /* @__PURE__ */ a("div")({
|
|
495
|
+
name: "Title",
|
|
496
|
+
class: "Title_t1l3ucjp",
|
|
497
|
+
propsAsIs: !1
|
|
498
|
+
}), Sn = () => C, zn = /* @__PURE__ */ a(Sn())({
|
|
499
|
+
name: "WinIcon",
|
|
500
|
+
class: "WinIcon_wx7j799",
|
|
501
|
+
propsAsIs: !0
|
|
502
|
+
}), xn = /* @__PURE__ */ a("div")({
|
|
503
|
+
name: "Points",
|
|
504
|
+
class: "Points_p4lwuj0",
|
|
505
|
+
propsAsIs: !1
|
|
506
|
+
}), Cn = /* @__PURE__ */ a("span")({
|
|
507
|
+
name: "PointsCount",
|
|
508
|
+
class: "PointsCount_po9i64o",
|
|
509
|
+
propsAsIs: !1
|
|
510
|
+
}), kn = /* @__PURE__ */ a("span")({
|
|
511
|
+
name: "PointsUnits",
|
|
512
|
+
class: "PointsUnits_pe5g05h",
|
|
513
|
+
propsAsIs: !1
|
|
514
|
+
}), jn = ({ title: e, points: t, isPlayingTimer: n, isTimer: i, onTimerExpired: s }) => /* @__PURE__ */ I(An, { children: [
|
|
515
|
+
/* @__PURE__ */ I(Nn, { children: [
|
|
516
|
+
e && /* @__PURE__ */ r(Dn, { children: e }),
|
|
517
|
+
t !== void 0 && /* @__PURE__ */ I($, { children: [
|
|
518
|
+
/* @__PURE__ */ r(zn, { name: "icon-trophy" }),
|
|
519
|
+
/* @__PURE__ */ I(xn, { children: [
|
|
520
|
+
/* @__PURE__ */ r(Cn, { children: t }),
|
|
521
|
+
/* @__PURE__ */ r(kn, { children: "PTS" })
|
|
522
|
+
] })
|
|
523
|
+
] })
|
|
524
|
+
] }),
|
|
525
|
+
i && /* @__PURE__ */ r(Tn, { isPlaying: n, onTimerExpired: s })
|
|
526
|
+
] }), On = ({ openedQuestion: e, vote: t, close: n }) => {
|
|
527
|
+
var i;
|
|
528
|
+
const s = e.subject, c = e.type, l = (i = e.options) == null ? void 0 : i.options, [m, d] = L(!1), [f, A] = L(!1), [v, g] = L(""), N = e == null ? void 0 : e.id, D = q(
|
|
529
|
+
async (y) => {
|
|
530
|
+
if (N) {
|
|
531
|
+
const T = y.currentTarget.value;
|
|
532
|
+
g(T), A(!0), await t(N, T), A(!1);
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
[N, g, t]
|
|
536
|
+
), o = q(() => {
|
|
537
|
+
d(!0), setTimeout(n, 3e3);
|
|
538
|
+
}, [n]), u = V(
|
|
539
|
+
() => e == null ? void 0 : e.answers.find((y) => y.youVoted === !0),
|
|
540
|
+
[e]
|
|
541
|
+
), p = V(
|
|
542
|
+
() => !!(e != null && e.answers.find((y) => y.correct === !0)),
|
|
543
|
+
[e]
|
|
544
|
+
), h = V(() => e ? e.answers.map((y) => ({
|
|
545
|
+
...y,
|
|
546
|
+
questionVoted: !!u,
|
|
547
|
+
youSelected: v === y.id,
|
|
548
|
+
isLoading: f,
|
|
549
|
+
hasCorrectAnswer: p,
|
|
550
|
+
questionType: e.type,
|
|
551
|
+
answerTimeExpired: m,
|
|
552
|
+
questionStatus: e.status,
|
|
553
|
+
// ToDo: Figure out why imageMode is not in the response
|
|
554
|
+
onVote: D
|
|
555
|
+
})) : [], [p, m, f, e, u, D, v]), M = l && (l.case === "trivia" || l.case === "prediction") ? l.value : void 0;
|
|
556
|
+
return /* @__PURE__ */ r(xe, { "data-question-header": "true", children: /* @__PURE__ */ r(qt, { children: /* @__PURE__ */ I(Yt, { children: [
|
|
557
|
+
M && /* @__PURE__ */ r(
|
|
558
|
+
Pt,
|
|
559
|
+
{
|
|
560
|
+
feedbackMessages: M,
|
|
561
|
+
questionVoted: !!u,
|
|
562
|
+
questionVotedCorrectly: u == null ? void 0 : u.correct,
|
|
563
|
+
questionType: c,
|
|
564
|
+
hasCorrectAnswer: p,
|
|
565
|
+
questionStatus: e.status
|
|
566
|
+
}
|
|
567
|
+
),
|
|
568
|
+
/* @__PURE__ */ r(
|
|
569
|
+
jn,
|
|
570
|
+
{
|
|
571
|
+
title: m ? "Time expired" : "To win",
|
|
572
|
+
points: m ? void 0 : 100,
|
|
573
|
+
onTimerExpired: o,
|
|
574
|
+
isTimer: !0
|
|
575
|
+
}
|
|
576
|
+
),
|
|
577
|
+
m ? /* @__PURE__ */ r(
|
|
578
|
+
$t,
|
|
579
|
+
{
|
|
580
|
+
title: "More to come...",
|
|
581
|
+
description: "Watch for additional enhanced stream interactive experience."
|
|
582
|
+
}
|
|
583
|
+
) : /* @__PURE__ */ I($, { children: [
|
|
584
|
+
/* @__PURE__ */ r(Wt, { children: s }),
|
|
585
|
+
/* @__PURE__ */ r(Ft, { children: h.map((y) => /* @__PURE__ */ r(cn, { ...y }, y.id)) })
|
|
586
|
+
] })
|
|
587
|
+
] }) }) });
|
|
588
|
+
}, wn = /* @__PURE__ */ a("div")({
|
|
589
|
+
name: "Container",
|
|
590
|
+
class: "Container_cgn5uen",
|
|
591
|
+
propsAsIs: !1
|
|
592
|
+
}), _n = /* @__PURE__ */ a("div")({
|
|
593
|
+
name: "Content",
|
|
594
|
+
class: "Content_c1px8nt6",
|
|
595
|
+
propsAsIs: !1
|
|
596
|
+
}), bn = /* @__PURE__ */ a("h3")({
|
|
597
|
+
name: "Title",
|
|
598
|
+
class: "Title_t5et2jt",
|
|
599
|
+
propsAsIs: !1
|
|
600
|
+
}), $n = /* @__PURE__ */ a("div")({
|
|
601
|
+
name: "Description",
|
|
602
|
+
class: "Description_d1i2kpk2",
|
|
603
|
+
propsAsIs: !1
|
|
604
|
+
}), En = /* @__PURE__ */ a("div")({
|
|
605
|
+
name: "DateWrap",
|
|
606
|
+
class: "DateWrap_dd3lh3p",
|
|
607
|
+
propsAsIs: !1
|
|
608
|
+
}), be = ({ created: e, title: t, instantView: n }) => {
|
|
609
|
+
const i = V(() => {
|
|
610
|
+
if (e) {
|
|
611
|
+
const s = new Date(e);
|
|
612
|
+
if (Ye(s))
|
|
613
|
+
return {
|
|
614
|
+
date: We(s),
|
|
615
|
+
time: Fe(s)
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
return null;
|
|
619
|
+
}, [e]);
|
|
620
|
+
return /* @__PURE__ */ I(wn, { children: [
|
|
621
|
+
i && /* @__PURE__ */ I(En, { children: [
|
|
622
|
+
i.date,
|
|
623
|
+
" · ",
|
|
624
|
+
i.time
|
|
625
|
+
] }),
|
|
626
|
+
(n == null ? void 0 : n.video) && /* @__PURE__ */ r(Be, { source: n.video.url, poster: n.video.thumbnailUrl }),
|
|
627
|
+
/* @__PURE__ */ I(_n, { children: [
|
|
628
|
+
/* @__PURE__ */ r(bn, { children: (n == null ? void 0 : n.heading) || t }),
|
|
629
|
+
/* @__PURE__ */ r($n, { children: n == null ? void 0 : n.body })
|
|
630
|
+
] })
|
|
631
|
+
] });
|
|
632
|
+
}, Ln = /* @__PURE__ */ a("div")({
|
|
633
|
+
name: "Container",
|
|
634
|
+
class: "Container_c1euiow",
|
|
635
|
+
propsAsIs: !1
|
|
636
|
+
}), Rn = /* @__PURE__ */ a("a")({
|
|
637
|
+
name: "WebLinkBtn",
|
|
638
|
+
class: "WebLinkBtn_w19zie3h",
|
|
639
|
+
propsAsIs: !1
|
|
640
|
+
}), Qn = ({ instantView: e, ...t }) => /* @__PURE__ */ I(Ln, { children: [
|
|
641
|
+
/* @__PURE__ */ r(be, { instantView: e, ...t }),
|
|
642
|
+
(e == null ? void 0 : e.webLink) && /* @__PURE__ */ I(Rn, { href: e == null ? void 0 : e.webLink.url, target: "_blank", children: [
|
|
643
|
+
"Explore more of the Masters History",
|
|
644
|
+
/* @__PURE__ */ r(C, { name: "icon-external-link" })
|
|
645
|
+
] })
|
|
646
|
+
] }), Un = /* @__PURE__ */ a("div")({
|
|
647
|
+
name: "QuestionContainer",
|
|
648
|
+
class: "QuestionContainer_qdri6g3",
|
|
649
|
+
propsAsIs: !1
|
|
650
|
+
}), Pn = ({
|
|
651
|
+
openedQuestion: e
|
|
652
|
+
}) => {
|
|
653
|
+
var t;
|
|
654
|
+
return ((t = e == null ? void 0 : e.attributes) == null ? void 0 : t.attributes.case) === "insight" ? /* @__PURE__ */ r(Qn, {
|
|
655
|
+
created: e.attributes.created,
|
|
656
|
+
...e.attributes.attributes.value
|
|
657
|
+
}) : null;
|
|
658
|
+
}, qn = ({
|
|
659
|
+
extendedQuestion: e,
|
|
660
|
+
vote: t,
|
|
661
|
+
close: n
|
|
662
|
+
}) => {
|
|
663
|
+
const {
|
|
664
|
+
loading: i,
|
|
665
|
+
data: s
|
|
666
|
+
} = e;
|
|
667
|
+
return !i && s ? /* @__PURE__ */ r(On, {
|
|
668
|
+
vote: t,
|
|
669
|
+
close: n,
|
|
670
|
+
openedQuestion: s
|
|
671
|
+
}) : null;
|
|
672
|
+
}, Yn = ({
|
|
673
|
+
gamification: e
|
|
674
|
+
}) => {
|
|
675
|
+
var t;
|
|
676
|
+
const n = O(e.openedQuestion.$store), i = O(e.openedQuestion.$extendedStore);
|
|
677
|
+
if (!n)
|
|
678
|
+
return null;
|
|
679
|
+
const s = n.type;
|
|
680
|
+
return /* @__PURE__ */ I(Un, {
|
|
681
|
+
children: [/* @__PURE__ */ r(ke, {
|
|
682
|
+
close: e.closeQuestion,
|
|
683
|
+
type: ((t = n.attributes) == null ? void 0 : t.type) || x.UNSET
|
|
684
|
+
}), s === "question" && /* @__PURE__ */ r(qn, {
|
|
685
|
+
vote: e.submitAnswer,
|
|
686
|
+
close: e.closeQuestion,
|
|
687
|
+
extendedQuestion: i
|
|
688
|
+
}), s !== "question" && /* @__PURE__ */ r(Pn, {
|
|
689
|
+
openedQuestion: n
|
|
690
|
+
})]
|
|
691
|
+
});
|
|
692
|
+
}, Wn = /* @__PURE__ */ a("div")({
|
|
693
|
+
name: "Container",
|
|
694
|
+
class: "Container_c115qtkr",
|
|
695
|
+
propsAsIs: !1
|
|
696
|
+
}), Fn = /* @__PURE__ */ a("div")({
|
|
697
|
+
name: "STabs",
|
|
698
|
+
class: "STabs_sxnslc8",
|
|
699
|
+
propsAsIs: !1
|
|
700
|
+
}), Bn = /* @__PURE__ */ a("button")({
|
|
701
|
+
name: "Button",
|
|
702
|
+
class: "Button_b1umzux0",
|
|
703
|
+
propsAsIs: !1
|
|
704
|
+
}), Vn = /* @__PURE__ */ a("span")({
|
|
705
|
+
name: "Title",
|
|
706
|
+
class: "Title_tspsaas",
|
|
707
|
+
propsAsIs: !1
|
|
708
|
+
});
|
|
709
|
+
var U = /* @__PURE__ */ ((e) => (e.HOME = "home", e.LEADERBOARD = "leaderboard", e))(U || {});
|
|
710
|
+
const Ie = ({ title: e, active: t, onClick: n }) => /* @__PURE__ */ r(Bn, { onClick: n, "data-selected": t, children: /* @__PURE__ */ r(Vn, { children: e }) }), Hn = ({ activePage: e = "home", toggleActivePage: t }) => /* @__PURE__ */ r(Wn, { children: /* @__PURE__ */ I(Fn, { "data-position": e === "home" ? "left" : "right", children: [
|
|
711
|
+
/* @__PURE__ */ r(Ie, { title: "Home", active: e === "home", onClick: () => t(
|
|
712
|
+
"home"
|
|
713
|
+
/* HOME */
|
|
714
|
+
) }),
|
|
715
|
+
/* @__PURE__ */ r(
|
|
716
|
+
Ie,
|
|
717
|
+
{
|
|
718
|
+
title: "Leader Board",
|
|
719
|
+
active: e === "leaderboard",
|
|
720
|
+
onClick: () => t(
|
|
721
|
+
"leaderboard"
|
|
722
|
+
/* LEADERBOARD */
|
|
723
|
+
)
|
|
724
|
+
}
|
|
725
|
+
)
|
|
726
|
+
] }) });
|
|
727
|
+
function te() {
|
|
728
|
+
return te = Object.assign ? Object.assign.bind() : function(e) {
|
|
729
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
730
|
+
var n = arguments[t];
|
|
731
|
+
for (var i in n)
|
|
732
|
+
Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
|
|
733
|
+
}
|
|
734
|
+
return e;
|
|
735
|
+
}, te.apply(this, arguments);
|
|
736
|
+
}
|
|
737
|
+
function fe(e) {
|
|
738
|
+
if (e === void 0)
|
|
739
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
740
|
+
return e;
|
|
741
|
+
}
|
|
742
|
+
function ne(e, t) {
|
|
743
|
+
return ne = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(i, s) {
|
|
744
|
+
return i.__proto__ = s, i;
|
|
745
|
+
}, ne(e, t);
|
|
746
|
+
}
|
|
747
|
+
function Gn(e, t) {
|
|
748
|
+
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, ne(e, t);
|
|
749
|
+
}
|
|
750
|
+
var ge = Number.isNaN || function(t) {
|
|
751
|
+
return typeof t == "number" && t !== t;
|
|
752
|
+
};
|
|
753
|
+
function Zn(e, t) {
|
|
754
|
+
return !!(e === t || ge(e) && ge(t));
|
|
755
|
+
}
|
|
756
|
+
function Jn(e, t) {
|
|
757
|
+
if (e.length !== t.length)
|
|
758
|
+
return !1;
|
|
759
|
+
for (var n = 0; n < e.length; n++)
|
|
760
|
+
if (!Zn(e[n], t[n]))
|
|
761
|
+
return !1;
|
|
762
|
+
return !0;
|
|
763
|
+
}
|
|
764
|
+
function J(e, t) {
|
|
765
|
+
t === void 0 && (t = Jn);
|
|
766
|
+
var n, i = [], s, c = !1;
|
|
767
|
+
function l() {
|
|
768
|
+
for (var m = [], d = 0; d < arguments.length; d++)
|
|
769
|
+
m[d] = arguments[d];
|
|
770
|
+
return c && n === this && t(m, i) || (s = e.apply(this, m), c = !0, n = this, i = m), s;
|
|
771
|
+
}
|
|
772
|
+
return l;
|
|
773
|
+
}
|
|
774
|
+
var Kn = typeof performance == "object" && typeof performance.now == "function", Me = Kn ? function() {
|
|
775
|
+
return performance.now();
|
|
776
|
+
} : function() {
|
|
777
|
+
return Date.now();
|
|
778
|
+
};
|
|
779
|
+
function ve(e) {
|
|
780
|
+
cancelAnimationFrame(e.id);
|
|
781
|
+
}
|
|
782
|
+
function Xn(e, t) {
|
|
783
|
+
var n = Me();
|
|
784
|
+
function i() {
|
|
785
|
+
Me() - n >= t ? e.call(null) : s.id = requestAnimationFrame(i);
|
|
786
|
+
}
|
|
787
|
+
var s = {
|
|
788
|
+
id: requestAnimationFrame(i)
|
|
789
|
+
};
|
|
790
|
+
return s;
|
|
791
|
+
}
|
|
792
|
+
var K = -1;
|
|
793
|
+
function ye(e) {
|
|
794
|
+
if (e === void 0 && (e = !1), K === -1 || e) {
|
|
795
|
+
var t = document.createElement("div"), n = t.style;
|
|
796
|
+
n.width = "50px", n.height = "50px", n.overflow = "scroll", document.body.appendChild(t), K = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
|
|
797
|
+
}
|
|
798
|
+
return K;
|
|
799
|
+
}
|
|
800
|
+
var _ = null;
|
|
801
|
+
function Te(e) {
|
|
802
|
+
if (e === void 0 && (e = !1), _ === null || e) {
|
|
803
|
+
var t = document.createElement("div"), n = t.style;
|
|
804
|
+
n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
|
|
805
|
+
var i = document.createElement("div"), s = i.style;
|
|
806
|
+
return s.width = "100px", s.height = "100px", t.appendChild(i), document.body.appendChild(t), t.scrollLeft > 0 ? _ = "positive-descending" : (t.scrollLeft = 1, t.scrollLeft === 0 ? _ = "negative" : _ = "positive-ascending"), document.body.removeChild(t), _;
|
|
807
|
+
}
|
|
808
|
+
return _;
|
|
809
|
+
}
|
|
810
|
+
var ei = 150, ti = function(t, n) {
|
|
811
|
+
return t;
|
|
812
|
+
};
|
|
813
|
+
function ni(e) {
|
|
814
|
+
var t, n = e.getItemOffset, i = e.getEstimatedTotalSize, s = e.getItemSize, c = e.getOffsetForIndexAndAlignment, l = e.getStartIndexForOffset, m = e.getStopIndexForStartIndex, d = e.initInstanceProps, f = e.shouldResetStyleCacheOnItemSizeChange, A = e.validateProps;
|
|
815
|
+
return t = /* @__PURE__ */ function(v) {
|
|
816
|
+
Gn(g, v);
|
|
817
|
+
function g(D) {
|
|
818
|
+
var o;
|
|
819
|
+
return o = v.call(this, D) || this, o._instanceProps = d(o.props, fe(o)), o._outerRef = void 0, o._resetIsScrollingTimeoutId = null, o.state = {
|
|
820
|
+
instance: fe(o),
|
|
821
|
+
isScrolling: !1,
|
|
822
|
+
scrollDirection: "forward",
|
|
823
|
+
scrollOffset: typeof o.props.initialScrollOffset == "number" ? o.props.initialScrollOffset : 0,
|
|
824
|
+
scrollUpdateWasRequested: !1
|
|
825
|
+
}, o._callOnItemsRendered = void 0, o._callOnItemsRendered = J(function(u, p, h, M) {
|
|
826
|
+
return o.props.onItemsRendered({
|
|
827
|
+
overscanStartIndex: u,
|
|
828
|
+
overscanStopIndex: p,
|
|
829
|
+
visibleStartIndex: h,
|
|
830
|
+
visibleStopIndex: M
|
|
831
|
+
});
|
|
832
|
+
}), o._callOnScroll = void 0, o._callOnScroll = J(function(u, p, h) {
|
|
833
|
+
return o.props.onScroll({
|
|
834
|
+
scrollDirection: u,
|
|
835
|
+
scrollOffset: p,
|
|
836
|
+
scrollUpdateWasRequested: h
|
|
837
|
+
});
|
|
838
|
+
}), o._getItemStyle = void 0, o._getItemStyle = function(u) {
|
|
839
|
+
var p = o.props, h = p.direction, M = p.itemSize, y = p.layout, T = o._getItemStyleCache(f && M, f && y, f && h), S;
|
|
840
|
+
if (T.hasOwnProperty(u))
|
|
841
|
+
S = T[u];
|
|
842
|
+
else {
|
|
843
|
+
var z = n(o.props, u, o._instanceProps), k = s(o.props, u, o._instanceProps), j = h === "horizontal" || y === "horizontal", Y = h === "rtl", W = j ? z : 0;
|
|
844
|
+
T[u] = S = {
|
|
845
|
+
position: "absolute",
|
|
846
|
+
left: Y ? void 0 : W,
|
|
847
|
+
right: Y ? W : void 0,
|
|
848
|
+
top: j ? 0 : z,
|
|
849
|
+
height: j ? "100%" : k,
|
|
850
|
+
width: j ? k : "100%"
|
|
851
|
+
};
|
|
852
|
+
}
|
|
853
|
+
return S;
|
|
854
|
+
}, o._getItemStyleCache = void 0, o._getItemStyleCache = J(function(u, p, h) {
|
|
855
|
+
return {};
|
|
856
|
+
}), o._onScrollHorizontal = function(u) {
|
|
857
|
+
var p = u.currentTarget, h = p.clientWidth, M = p.scrollLeft, y = p.scrollWidth;
|
|
858
|
+
o.setState(function(T) {
|
|
859
|
+
if (T.scrollOffset === M)
|
|
860
|
+
return null;
|
|
861
|
+
var S = o.props.direction, z = M;
|
|
862
|
+
if (S === "rtl")
|
|
863
|
+
switch (Te()) {
|
|
864
|
+
case "negative":
|
|
865
|
+
z = -M;
|
|
866
|
+
break;
|
|
867
|
+
case "positive-descending":
|
|
868
|
+
z = y - h - M;
|
|
869
|
+
break;
|
|
870
|
+
}
|
|
871
|
+
return z = Math.max(0, Math.min(z, y - h)), {
|
|
872
|
+
isScrolling: !0,
|
|
873
|
+
scrollDirection: T.scrollOffset < M ? "forward" : "backward",
|
|
874
|
+
scrollOffset: z,
|
|
875
|
+
scrollUpdateWasRequested: !1
|
|
876
|
+
};
|
|
877
|
+
}, o._resetIsScrollingDebounced);
|
|
878
|
+
}, o._onScrollVertical = function(u) {
|
|
879
|
+
var p = u.currentTarget, h = p.clientHeight, M = p.scrollHeight, y = p.scrollTop;
|
|
880
|
+
o.setState(function(T) {
|
|
881
|
+
if (T.scrollOffset === y)
|
|
882
|
+
return null;
|
|
883
|
+
var S = Math.max(0, Math.min(y, M - h));
|
|
884
|
+
return {
|
|
885
|
+
isScrolling: !0,
|
|
886
|
+
scrollDirection: T.scrollOffset < S ? "forward" : "backward",
|
|
887
|
+
scrollOffset: S,
|
|
888
|
+
scrollUpdateWasRequested: !1
|
|
889
|
+
};
|
|
890
|
+
}, o._resetIsScrollingDebounced);
|
|
891
|
+
}, o._outerRefSetter = function(u) {
|
|
892
|
+
var p = o.props.outerRef;
|
|
893
|
+
o._outerRef = u, typeof p == "function" ? p(u) : p != null && typeof p == "object" && p.hasOwnProperty("current") && (p.current = u);
|
|
894
|
+
}, o._resetIsScrollingDebounced = function() {
|
|
895
|
+
o._resetIsScrollingTimeoutId !== null && ve(o._resetIsScrollingTimeoutId), o._resetIsScrollingTimeoutId = Xn(o._resetIsScrolling, ei);
|
|
896
|
+
}, o._resetIsScrolling = function() {
|
|
897
|
+
o._resetIsScrollingTimeoutId = null, o.setState({
|
|
898
|
+
isScrolling: !1
|
|
899
|
+
}, function() {
|
|
900
|
+
o._getItemStyleCache(-1, null);
|
|
901
|
+
});
|
|
902
|
+
}, o;
|
|
903
|
+
}
|
|
904
|
+
g.getDerivedStateFromProps = function(o, u) {
|
|
905
|
+
return ii(o, u), A(o), null;
|
|
906
|
+
};
|
|
907
|
+
var N = g.prototype;
|
|
908
|
+
return N.scrollTo = function(o) {
|
|
909
|
+
o = Math.max(0, o), this.setState(function(u) {
|
|
910
|
+
return u.scrollOffset === o ? null : {
|
|
911
|
+
scrollDirection: u.scrollOffset < o ? "forward" : "backward",
|
|
912
|
+
scrollOffset: o,
|
|
913
|
+
scrollUpdateWasRequested: !0
|
|
914
|
+
};
|
|
915
|
+
}, this._resetIsScrollingDebounced);
|
|
916
|
+
}, N.scrollToItem = function(o, u) {
|
|
917
|
+
u === void 0 && (u = "auto");
|
|
918
|
+
var p = this.props, h = p.itemCount, M = p.layout, y = this.state.scrollOffset;
|
|
919
|
+
o = Math.max(0, Math.min(o, h - 1));
|
|
920
|
+
var T = 0;
|
|
921
|
+
if (this._outerRef) {
|
|
922
|
+
var S = this._outerRef;
|
|
923
|
+
M === "vertical" ? T = S.scrollWidth > S.clientWidth ? ye() : 0 : T = S.scrollHeight > S.clientHeight ? ye() : 0;
|
|
924
|
+
}
|
|
925
|
+
this.scrollTo(c(this.props, o, u, y, this._instanceProps, T));
|
|
926
|
+
}, N.componentDidMount = function() {
|
|
927
|
+
var o = this.props, u = o.direction, p = o.initialScrollOffset, h = o.layout;
|
|
928
|
+
if (typeof p == "number" && this._outerRef != null) {
|
|
929
|
+
var M = this._outerRef;
|
|
930
|
+
u === "horizontal" || h === "horizontal" ? M.scrollLeft = p : M.scrollTop = p;
|
|
931
|
+
}
|
|
932
|
+
this._callPropsCallbacks();
|
|
933
|
+
}, N.componentDidUpdate = function() {
|
|
934
|
+
var o = this.props, u = o.direction, p = o.layout, h = this.state, M = h.scrollOffset, y = h.scrollUpdateWasRequested;
|
|
935
|
+
if (y && this._outerRef != null) {
|
|
936
|
+
var T = this._outerRef;
|
|
937
|
+
if (u === "horizontal" || p === "horizontal")
|
|
938
|
+
if (u === "rtl")
|
|
939
|
+
switch (Te()) {
|
|
940
|
+
case "negative":
|
|
941
|
+
T.scrollLeft = -M;
|
|
942
|
+
break;
|
|
943
|
+
case "positive-ascending":
|
|
944
|
+
T.scrollLeft = M;
|
|
945
|
+
break;
|
|
946
|
+
default:
|
|
947
|
+
var S = T.clientWidth, z = T.scrollWidth;
|
|
948
|
+
T.scrollLeft = z - S - M;
|
|
949
|
+
break;
|
|
950
|
+
}
|
|
951
|
+
else
|
|
952
|
+
T.scrollLeft = M;
|
|
953
|
+
else
|
|
954
|
+
T.scrollTop = M;
|
|
955
|
+
}
|
|
956
|
+
this._callPropsCallbacks();
|
|
957
|
+
}, N.componentWillUnmount = function() {
|
|
958
|
+
this._resetIsScrollingTimeoutId !== null && ve(this._resetIsScrollingTimeoutId);
|
|
959
|
+
}, N.render = function() {
|
|
960
|
+
var o = this.props, u = o.children, p = o.className, h = o.direction, M = o.height, y = o.innerRef, T = o.innerElementType, S = o.innerTagName, z = o.itemCount, k = o.itemData, j = o.itemKey, Y = j === void 0 ? ti : j, W = o.layout, $e = o.outerElementType, Ee = o.outerTagName, Le = o.style, Re = o.useIsScrolling, Qe = o.width, ie = this.state.isScrolling, H = h === "horizontal" || W === "horizontal", Ue = H ? this._onScrollHorizontal : this._onScrollVertical, se = this._getRangeToRender(), Pe = se[0], qe = se[1], re = [];
|
|
961
|
+
if (z > 0)
|
|
962
|
+
for (var R = Pe; R <= qe; R++)
|
|
963
|
+
re.push(G(u, {
|
|
964
|
+
data: k,
|
|
965
|
+
key: Y(R, k),
|
|
966
|
+
index: R,
|
|
967
|
+
isScrolling: Re ? ie : void 0,
|
|
968
|
+
style: this._getItemStyle(R)
|
|
969
|
+
}));
|
|
970
|
+
var oe = i(this.props, this._instanceProps);
|
|
971
|
+
return G($e || Ee || "div", {
|
|
972
|
+
className: p,
|
|
973
|
+
onScroll: Ue,
|
|
974
|
+
ref: this._outerRefSetter,
|
|
975
|
+
style: te({
|
|
976
|
+
position: "relative",
|
|
977
|
+
height: M,
|
|
978
|
+
width: Qe,
|
|
979
|
+
overflow: "auto",
|
|
980
|
+
WebkitOverflowScrolling: "touch",
|
|
981
|
+
willChange: "transform",
|
|
982
|
+
direction: h
|
|
983
|
+
}, Le)
|
|
984
|
+
}, G(T || S || "div", {
|
|
985
|
+
children: re,
|
|
986
|
+
ref: y,
|
|
987
|
+
style: {
|
|
988
|
+
height: H ? "100%" : oe,
|
|
989
|
+
pointerEvents: ie ? "none" : void 0,
|
|
990
|
+
width: H ? oe : "100%"
|
|
991
|
+
}
|
|
992
|
+
}));
|
|
993
|
+
}, N._callPropsCallbacks = function() {
|
|
994
|
+
if (typeof this.props.onItemsRendered == "function") {
|
|
995
|
+
var o = this.props.itemCount;
|
|
996
|
+
if (o > 0) {
|
|
997
|
+
var u = this._getRangeToRender(), p = u[0], h = u[1], M = u[2], y = u[3];
|
|
998
|
+
this._callOnItemsRendered(p, h, M, y);
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
if (typeof this.props.onScroll == "function") {
|
|
1002
|
+
var T = this.state, S = T.scrollDirection, z = T.scrollOffset, k = T.scrollUpdateWasRequested;
|
|
1003
|
+
this._callOnScroll(S, z, k);
|
|
1004
|
+
}
|
|
1005
|
+
}, N._getRangeToRender = function() {
|
|
1006
|
+
var o = this.props, u = o.itemCount, p = o.overscanCount, h = this.state, M = h.isScrolling, y = h.scrollDirection, T = h.scrollOffset;
|
|
1007
|
+
if (u === 0)
|
|
1008
|
+
return [0, 0, 0, 0];
|
|
1009
|
+
var S = l(this.props, T, this._instanceProps), z = m(this.props, S, T, this._instanceProps), k = !M || y === "backward" ? Math.max(1, p) : 1, j = !M || y === "forward" ? Math.max(1, p) : 1;
|
|
1010
|
+
return [Math.max(0, S - k), Math.max(0, Math.min(u - 1, z + j)), S, z];
|
|
1011
|
+
}, g;
|
|
1012
|
+
}(Ce), t.defaultProps = {
|
|
1013
|
+
direction: "ltr",
|
|
1014
|
+
itemData: void 0,
|
|
1015
|
+
layout: "vertical",
|
|
1016
|
+
overscanCount: 2,
|
|
1017
|
+
useIsScrolling: !1
|
|
1018
|
+
}, t;
|
|
1019
|
+
}
|
|
1020
|
+
var ii = function(t, n) {
|
|
1021
|
+
t.children, t.direction, t.height, t.layout, t.innerTagName, t.outerTagName, t.width, n.instance;
|
|
1022
|
+
}, si = /* @__PURE__ */ ni({
|
|
1023
|
+
getItemOffset: function(t, n) {
|
|
1024
|
+
var i = t.itemSize;
|
|
1025
|
+
return n * i;
|
|
1026
|
+
},
|
|
1027
|
+
getItemSize: function(t, n) {
|
|
1028
|
+
var i = t.itemSize;
|
|
1029
|
+
return i;
|
|
1030
|
+
},
|
|
1031
|
+
getEstimatedTotalSize: function(t) {
|
|
1032
|
+
var n = t.itemCount, i = t.itemSize;
|
|
1033
|
+
return i * n;
|
|
1034
|
+
},
|
|
1035
|
+
getOffsetForIndexAndAlignment: function(t, n, i, s, c, l) {
|
|
1036
|
+
var m = t.direction, d = t.height, f = t.itemCount, A = t.itemSize, v = t.layout, g = t.width, N = m === "horizontal" || v === "horizontal", D = N ? g : d, o = Math.max(0, f * A - D), u = Math.min(o, n * A), p = Math.max(0, n * A - D + A + l);
|
|
1037
|
+
switch (i === "smart" && (s >= p - D && s <= u + D ? i = "auto" : i = "center"), i) {
|
|
1038
|
+
case "start":
|
|
1039
|
+
return u;
|
|
1040
|
+
case "end":
|
|
1041
|
+
return p;
|
|
1042
|
+
case "center": {
|
|
1043
|
+
var h = Math.round(p + (u - p) / 2);
|
|
1044
|
+
return h < Math.ceil(D / 2) ? 0 : h > o + Math.floor(D / 2) ? o : h;
|
|
1045
|
+
}
|
|
1046
|
+
case "auto":
|
|
1047
|
+
default:
|
|
1048
|
+
return s >= p && s <= u ? s : s < p ? p : u;
|
|
1049
|
+
}
|
|
1050
|
+
},
|
|
1051
|
+
getStartIndexForOffset: function(t, n) {
|
|
1052
|
+
var i = t.itemCount, s = t.itemSize;
|
|
1053
|
+
return Math.max(0, Math.min(i - 1, Math.floor(n / s)));
|
|
1054
|
+
},
|
|
1055
|
+
getStopIndexForStartIndex: function(t, n, i) {
|
|
1056
|
+
var s = t.direction, c = t.height, l = t.itemCount, m = t.itemSize, d = t.layout, f = t.width, A = s === "horizontal" || d === "horizontal", v = n * m, g = A ? f : c, N = Math.ceil((g + i - v) / m);
|
|
1057
|
+
return Math.max(0, Math.min(
|
|
1058
|
+
l - 1,
|
|
1059
|
+
n + N - 1
|
|
1060
|
+
// -1 is because stop index is inclusive
|
|
1061
|
+
));
|
|
1062
|
+
},
|
|
1063
|
+
initInstanceProps: function(t) {
|
|
1064
|
+
},
|
|
1065
|
+
shouldResetStyleCacheOnItemSizeChange: !0,
|
|
1066
|
+
validateProps: function(t) {
|
|
1067
|
+
t.itemSize;
|
|
1068
|
+
}
|
|
1069
|
+
});
|
|
1070
|
+
function ri(e) {
|
|
1071
|
+
var t = e.lastRenderedStartIndex, n = e.lastRenderedStopIndex, i = e.startIndex, s = e.stopIndex;
|
|
1072
|
+
return !(i > n || s < t);
|
|
1073
|
+
}
|
|
1074
|
+
function oi(e) {
|
|
1075
|
+
for (var t = e.isItemLoaded, n = e.itemCount, i = e.minimumBatchSize, s = e.startIndex, c = e.stopIndex, l = [], m = null, d = null, f = s; f <= c; f++) {
|
|
1076
|
+
var A = t(f);
|
|
1077
|
+
A ? d !== null && (l.push(m, d), m = d = null) : (d = f, m === null && (m = f));
|
|
1078
|
+
}
|
|
1079
|
+
if (d !== null) {
|
|
1080
|
+
for (var v = Math.min(Math.max(d, m + i - 1), n - 1), g = d + 1; g <= v && !t(g); g++)
|
|
1081
|
+
d = g;
|
|
1082
|
+
l.push(m, d);
|
|
1083
|
+
}
|
|
1084
|
+
if (l.length)
|
|
1085
|
+
for (; l[1] - l[0] + 1 < i && l[0] > 0; ) {
|
|
1086
|
+
var N = l[0] - 1;
|
|
1087
|
+
if (!t(N))
|
|
1088
|
+
l[0] = N;
|
|
1089
|
+
else
|
|
1090
|
+
break;
|
|
1091
|
+
}
|
|
1092
|
+
return l;
|
|
1093
|
+
}
|
|
1094
|
+
var ai = function(e, t) {
|
|
1095
|
+
if (!(e instanceof t))
|
|
1096
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1097
|
+
}, li = function() {
|
|
1098
|
+
function e(t, n) {
|
|
1099
|
+
for (var i = 0; i < n.length; i++) {
|
|
1100
|
+
var s = n[i];
|
|
1101
|
+
s.enumerable = s.enumerable || !1, s.configurable = !0, "value" in s && (s.writable = !0), Object.defineProperty(t, s.key, s);
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
return function(t, n, i) {
|
|
1105
|
+
return n && e(t.prototype, n), i && e(t, i), t;
|
|
1106
|
+
};
|
|
1107
|
+
}(), ci = function(e, t) {
|
|
1108
|
+
if (typeof t != "function" && t !== null)
|
|
1109
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
|
|
1110
|
+
e.prototype = Object.create(t && t.prototype, {
|
|
1111
|
+
constructor: {
|
|
1112
|
+
value: e,
|
|
1113
|
+
enumerable: !1,
|
|
1114
|
+
writable: !0,
|
|
1115
|
+
configurable: !0
|
|
1116
|
+
}
|
|
1117
|
+
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
|
|
1118
|
+
}, Ae = function(e, t) {
|
|
1119
|
+
if (!e)
|
|
1120
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1121
|
+
return t && (typeof t == "object" || typeof t == "function") ? t : e;
|
|
1122
|
+
}, di = function(e) {
|
|
1123
|
+
ci(t, e);
|
|
1124
|
+
function t() {
|
|
1125
|
+
var n, i, s, c;
|
|
1126
|
+
ai(this, t);
|
|
1127
|
+
for (var l = arguments.length, m = Array(l), d = 0; d < l; d++)
|
|
1128
|
+
m[d] = arguments[d];
|
|
1129
|
+
return c = (i = (s = Ae(this, (n = t.__proto__ || Object.getPrototypeOf(t)).call.apply(n, [this].concat(m))), s), s._lastRenderedStartIndex = -1, s._lastRenderedStopIndex = -1, s._memoizedUnloadedRanges = [], s._onItemsRendered = function(f) {
|
|
1130
|
+
var A = f.visibleStartIndex, v = f.visibleStopIndex;
|
|
1131
|
+
s._lastRenderedStartIndex = A, s._lastRenderedStopIndex = v, s._ensureRowsLoaded(A, v);
|
|
1132
|
+
}, s._setRef = function(f) {
|
|
1133
|
+
s._listRef = f;
|
|
1134
|
+
}, i), Ae(s, c);
|
|
1135
|
+
}
|
|
1136
|
+
return li(t, [{
|
|
1137
|
+
key: "resetloadMoreItemsCache",
|
|
1138
|
+
value: function() {
|
|
1139
|
+
var i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
|
|
1140
|
+
this._memoizedUnloadedRanges = [], i && this._ensureRowsLoaded(this._lastRenderedStartIndex, this._lastRenderedStopIndex);
|
|
1141
|
+
}
|
|
1142
|
+
}, {
|
|
1143
|
+
key: "componentDidMount",
|
|
1144
|
+
value: function() {
|
|
1145
|
+
}
|
|
1146
|
+
}, {
|
|
1147
|
+
key: "render",
|
|
1148
|
+
value: function() {
|
|
1149
|
+
var i = this.props.children;
|
|
1150
|
+
return i({
|
|
1151
|
+
onItemsRendered: this._onItemsRendered,
|
|
1152
|
+
ref: this._setRef
|
|
1153
|
+
});
|
|
1154
|
+
}
|
|
1155
|
+
}, {
|
|
1156
|
+
key: "_ensureRowsLoaded",
|
|
1157
|
+
value: function(i, s) {
|
|
1158
|
+
var c = this.props, l = c.isItemLoaded, m = c.itemCount, d = c.minimumBatchSize, f = d === void 0 ? 10 : d, A = c.threshold, v = A === void 0 ? 15 : A, g = oi({
|
|
1159
|
+
isItemLoaded: l,
|
|
1160
|
+
itemCount: m,
|
|
1161
|
+
minimumBatchSize: f,
|
|
1162
|
+
startIndex: Math.max(0, i - v),
|
|
1163
|
+
stopIndex: Math.min(m - 1, s + v)
|
|
1164
|
+
});
|
|
1165
|
+
(this._memoizedUnloadedRanges.length !== g.length || this._memoizedUnloadedRanges.some(function(N, D) {
|
|
1166
|
+
return g[D] !== N;
|
|
1167
|
+
})) && (this._memoizedUnloadedRanges = g, this._loadUnloadedRanges(g));
|
|
1168
|
+
}
|
|
1169
|
+
}, {
|
|
1170
|
+
key: "_loadUnloadedRanges",
|
|
1171
|
+
value: function(i) {
|
|
1172
|
+
for (var s = this, c = this.props.loadMoreItems || this.props.loadMoreRows, l = function(f) {
|
|
1173
|
+
var A = i[f], v = i[f + 1], g = c(A, v);
|
|
1174
|
+
g != null && g.then(function() {
|
|
1175
|
+
if (ri({
|
|
1176
|
+
lastRenderedStartIndex: s._lastRenderedStartIndex,
|
|
1177
|
+
lastRenderedStopIndex: s._lastRenderedStopIndex,
|
|
1178
|
+
startIndex: A,
|
|
1179
|
+
stopIndex: v
|
|
1180
|
+
})) {
|
|
1181
|
+
if (s._listRef == null)
|
|
1182
|
+
return;
|
|
1183
|
+
typeof s._listRef.resetAfterIndex == "function" ? s._listRef.resetAfterIndex(A, !0) : (typeof s._listRef._getItemStyleCache == "function" && s._listRef._getItemStyleCache(-1), s._listRef.forceUpdate());
|
|
1184
|
+
}
|
|
1185
|
+
});
|
|
1186
|
+
}, m = 0; m < i.length; m += 2)
|
|
1187
|
+
l(m);
|
|
1188
|
+
}
|
|
1189
|
+
}]), t;
|
|
1190
|
+
}(Ce);
|
|
1191
|
+
const ui = /* @__PURE__ */ a("div")({
|
|
1192
|
+
name: "Container",
|
|
1193
|
+
class: "Container_culdu4a",
|
|
1194
|
+
propsAsIs: !1
|
|
1195
|
+
}), pi = /* @__PURE__ */ a("div")({
|
|
1196
|
+
name: "Position",
|
|
1197
|
+
class: "Position_pwf8e69",
|
|
1198
|
+
propsAsIs: !1
|
|
1199
|
+
}), mi = /* @__PURE__ */ a("img")({
|
|
1200
|
+
name: "Avatar",
|
|
1201
|
+
class: "Avatar_atf4yh4",
|
|
1202
|
+
propsAsIs: !1
|
|
1203
|
+
}), hi = /* @__PURE__ */ a("div")({
|
|
1204
|
+
name: "AvatarPlaceholder",
|
|
1205
|
+
class: "AvatarPlaceholder_a1dg29ja",
|
|
1206
|
+
propsAsIs: !1
|
|
1207
|
+
}), Ii = /* @__PURE__ */ a("div")({
|
|
1208
|
+
name: "Content",
|
|
1209
|
+
class: "Content_c10a68rc",
|
|
1210
|
+
propsAsIs: !1
|
|
1211
|
+
}), fi = /* @__PURE__ */ a("div")({
|
|
1212
|
+
name: "NameContainer",
|
|
1213
|
+
class: "NameContainer_nc4kck5",
|
|
1214
|
+
propsAsIs: !1
|
|
1215
|
+
}), gi = /* @__PURE__ */ a("span")({
|
|
1216
|
+
name: "Name",
|
|
1217
|
+
class: "Name_njsrqgr",
|
|
1218
|
+
propsAsIs: !1
|
|
1219
|
+
}), Mi = () => C, vi = /* @__PURE__ */ a(Mi())({
|
|
1220
|
+
name: "CurrentUserBadge",
|
|
1221
|
+
class: "CurrentUserBadge_c17uc4zr",
|
|
1222
|
+
propsAsIs: !0
|
|
1223
|
+
}), yi = ({
|
|
1224
|
+
rank: e,
|
|
1225
|
+
avatar: t,
|
|
1226
|
+
name: n,
|
|
1227
|
+
points: i,
|
|
1228
|
+
isCurrentUser: s,
|
|
1229
|
+
openItemDetail: c,
|
|
1230
|
+
style: l
|
|
1231
|
+
}) => /* @__PURE__ */ I(ui, { onClick: c, style: l, children: [
|
|
1232
|
+
/* @__PURE__ */ r(pi, { children: e || 0 }),
|
|
1233
|
+
/* @__PURE__ */ I(Ii, { children: [
|
|
1234
|
+
t ? /* @__PURE__ */ r(mi, { alt: "leaderboard-item-avatar", src: t }) : /* @__PURE__ */ r(hi, { children: Se(n || "") }),
|
|
1235
|
+
/* @__PURE__ */ I(fi, { children: [
|
|
1236
|
+
/* @__PURE__ */ r(gi, { children: n || "" }),
|
|
1237
|
+
s && /* @__PURE__ */ r(vi, { name: "icon-star" })
|
|
1238
|
+
] })
|
|
1239
|
+
] }),
|
|
1240
|
+
/* @__PURE__ */ r("div", { children: ze(i) })
|
|
1241
|
+
] }), Ti = ({
|
|
1242
|
+
items: e,
|
|
1243
|
+
currentUserId: t,
|
|
1244
|
+
openItemDetail: n,
|
|
1245
|
+
fetchMore: i
|
|
1246
|
+
}) => /* @__PURE__ */ r(Ve, { children: ({ width: s, height: c }) => /* @__PURE__ */ r(
|
|
1247
|
+
di,
|
|
1248
|
+
{
|
|
1249
|
+
isItemLoaded: (l) => l < e.length,
|
|
1250
|
+
itemCount: e.length + 1,
|
|
1251
|
+
loadMoreItems: i,
|
|
1252
|
+
children: ({ onItemsRendered: l, ref: m }) => /* @__PURE__ */ r(
|
|
1253
|
+
si,
|
|
1254
|
+
{
|
|
1255
|
+
itemSize: 56,
|
|
1256
|
+
onItemsRendered: l,
|
|
1257
|
+
ref: m,
|
|
1258
|
+
itemCount: e.length,
|
|
1259
|
+
width: s,
|
|
1260
|
+
height: c,
|
|
1261
|
+
children: ({ index: d, style: f }) => /* @__PURE__ */ r(
|
|
1262
|
+
yi,
|
|
1263
|
+
{
|
|
1264
|
+
style: { ...f, maxHeight: 48 },
|
|
1265
|
+
...e[d],
|
|
1266
|
+
openItemDetail: () => n(e[d].userId),
|
|
1267
|
+
isCurrentUser: !!t && t === e[d].userId
|
|
1268
|
+
},
|
|
1269
|
+
e[d].userId
|
|
1270
|
+
)
|
|
1271
|
+
}
|
|
1272
|
+
)
|
|
1273
|
+
}
|
|
1274
|
+
) }), Ai = ({ deepLink: e }) => {
|
|
1275
|
+
const { data: t } = O(e.$store);
|
|
1276
|
+
return /* @__PURE__ */ r(
|
|
1277
|
+
He,
|
|
1278
|
+
{
|
|
1279
|
+
inviteLink: t == null ? void 0 : t.url,
|
|
1280
|
+
socialLinks: [
|
|
1281
|
+
{
|
|
1282
|
+
icon: "icon-facebook",
|
|
1283
|
+
link: "https://www.facebook.com/TheMasters",
|
|
1284
|
+
label: "Facebook"
|
|
1285
|
+
},
|
|
1286
|
+
{
|
|
1287
|
+
icon: "icon-twitter",
|
|
1288
|
+
link: "https://twitter.com/@TheMasters",
|
|
1289
|
+
label: "X"
|
|
1290
|
+
}
|
|
1291
|
+
],
|
|
1292
|
+
inviteCardTitle: "It’s more fun with friends",
|
|
1293
|
+
inviteCardSubtext: "Invite and compete against your friends for the top spot on the leaderboard."
|
|
1294
|
+
}
|
|
1295
|
+
);
|
|
1296
|
+
}, Ni = ({ gamification: e }) => {
|
|
1297
|
+
const { data: t } = O(e.leaderboardList.$store);
|
|
1298
|
+
return t != null && t.length ? /* @__PURE__ */ r(
|
|
1299
|
+
Ti,
|
|
1300
|
+
{
|
|
1301
|
+
fetchMore: e.leaderboardList.fetchMore,
|
|
1302
|
+
items: t,
|
|
1303
|
+
openItemDetail: e.openUser,
|
|
1304
|
+
currentUserId: e.currentUserId.get()
|
|
1305
|
+
}
|
|
1306
|
+
) : /* @__PURE__ */ r(Ai, { deepLink: e.deepLink });
|
|
1307
|
+
}, Di = /* @__PURE__ */ a("div")({
|
|
1308
|
+
name: "QuestionItem",
|
|
1309
|
+
class: "QuestionItem_q1w97g3p",
|
|
1310
|
+
propsAsIs: !1
|
|
1311
|
+
}), Si = /* @__PURE__ */ a("div")({
|
|
1312
|
+
name: "QuestionCaption",
|
|
1313
|
+
class: "QuestionCaption_q2sl39u",
|
|
1314
|
+
propsAsIs: !1
|
|
1315
|
+
}), zi = /* @__PURE__ */ a("div")({
|
|
1316
|
+
name: "QuestionBody",
|
|
1317
|
+
class: "QuestionBody_qd5h0uc",
|
|
1318
|
+
propsAsIs: !1
|
|
1319
|
+
}), xi = /* @__PURE__ */ a("div")({
|
|
1320
|
+
name: "QuestionAction",
|
|
1321
|
+
class: "QuestionAction_q105uluy",
|
|
1322
|
+
propsAsIs: !1
|
|
1323
|
+
}), Ci = () => C, X = /* @__PURE__ */ a(Ci())({
|
|
1324
|
+
name: "QuestionActionIcon",
|
|
1325
|
+
class: "QuestionActionIcon_q1fa0b9h",
|
|
1326
|
+
propsAsIs: !0
|
|
1327
|
+
}), ki = () => C, ji = /* @__PURE__ */ a(ki())({
|
|
1328
|
+
name: "QuestionTypeIcon",
|
|
1329
|
+
class: "QuestionTypeIcon_qxlt78s",
|
|
1330
|
+
propsAsIs: !0
|
|
1331
|
+
}), Oi = /* @__PURE__ */ a("div")({
|
|
1332
|
+
name: "QuestionTypeLabel",
|
|
1333
|
+
class: "QuestionTypeLabel_qmg0vkx",
|
|
1334
|
+
propsAsIs: !1
|
|
1335
|
+
}), wi = /* @__PURE__ */ a("div")({
|
|
1336
|
+
name: "QuestionContent",
|
|
1337
|
+
class: "QuestionContent_q1uz5j1g",
|
|
1338
|
+
propsAsIs: !1
|
|
1339
|
+
}), _i = {
|
|
1340
|
+
[F.LOST]: /* @__PURE__ */ r(X, { name: "icon-cross" }),
|
|
1341
|
+
[F.WON]: /* @__PURE__ */ r(X, { name: "icon-check" }),
|
|
1342
|
+
[F.UNSET]: void 0,
|
|
1343
|
+
[F.DNP]: /* @__PURE__ */ r(X, { name: "icon-arrow" })
|
|
1344
|
+
}, bi = ({
|
|
1345
|
+
questionId: e,
|
|
1346
|
+
questionType: t,
|
|
1347
|
+
questionStatus: n,
|
|
1348
|
+
subject: i,
|
|
1349
|
+
openForVoting: s,
|
|
1350
|
+
openQuestion: c,
|
|
1351
|
+
status: l
|
|
1352
|
+
}) => {
|
|
1353
|
+
const m = De[t], d = _i[l];
|
|
1354
|
+
return m ? /* @__PURE__ */ I(Di, { onClick: () => c == null ? void 0 : c(e), children: [
|
|
1355
|
+
/* @__PURE__ */ I(wi, { children: [
|
|
1356
|
+
/* @__PURE__ */ I(Si, { children: [
|
|
1357
|
+
/* @__PURE__ */ r(ji, { name: m.iconName }),
|
|
1358
|
+
/* @__PURE__ */ I(Oi, { children: [
|
|
1359
|
+
m.label,
|
|
1360
|
+
t === x.TRIVIA && n === P.RESOLVED && " • Expired"
|
|
1361
|
+
] })
|
|
1362
|
+
] }),
|
|
1363
|
+
/* @__PURE__ */ r(zi, { children: i || "" })
|
|
1364
|
+
] }),
|
|
1365
|
+
/* @__PURE__ */ r(xi, { children: d || (s ? /* @__PURE__ */ r(Ge, { children: "Play" }) : null) })
|
|
1366
|
+
] }) : null;
|
|
1367
|
+
}, $i = /* @__PURE__ */ a("div")({
|
|
1368
|
+
name: "Container",
|
|
1369
|
+
class: "Container_cll3md7",
|
|
1370
|
+
propsAsIs: !1
|
|
1371
|
+
}), Ei = /* @__PURE__ */ a("button")({
|
|
1372
|
+
name: "ActionBtn",
|
|
1373
|
+
class: "ActionBtn_a10g1iik",
|
|
1374
|
+
propsAsIs: !1
|
|
1375
|
+
}), Li = ({
|
|
1376
|
+
openInsight: e,
|
|
1377
|
+
questionId: t,
|
|
1378
|
+
...n
|
|
1379
|
+
}) => /* @__PURE__ */ I($i, { children: [
|
|
1380
|
+
/* @__PURE__ */ r(be, { questionId: t, ...n }),
|
|
1381
|
+
e && /* @__PURE__ */ r(Ei, { onClick: () => e(t), children: "View Insight" })
|
|
1382
|
+
] }), Ri = /* @__PURE__ */ a("div")({
|
|
1383
|
+
name: "QuestionsContainer",
|
|
1384
|
+
class: "QuestionsContainer_qvghv3l",
|
|
1385
|
+
propsAsIs: !1
|
|
1386
|
+
}), Qi = ({ questions: e, openQuestion: t }) => /* @__PURE__ */ r(Ri, { children: e == null ? void 0 : e.map((n) => {
|
|
1387
|
+
var i, s;
|
|
1388
|
+
if (n.type === "question" && ((i = n.attributes) == null ? void 0 : i.attributes.case) === "question") {
|
|
1389
|
+
const c = n.attributes.attributes.value;
|
|
1390
|
+
return /* @__PURE__ */ r(bi, { openQuestion: t, ...c }, c.questionId);
|
|
1391
|
+
}
|
|
1392
|
+
if (n.type === "insight" && ((s = n.attributes) == null ? void 0 : s.attributes.case) === "insight") {
|
|
1393
|
+
const c = n.attributes.attributes.value;
|
|
1394
|
+
return /* @__PURE__ */ r(Li, { openInsight: t, ...c }, c.questionId);
|
|
1395
|
+
}
|
|
1396
|
+
return null;
|
|
1397
|
+
}) }), Ui = ({ store: e, openQuestion: t }) => {
|
|
1398
|
+
const n = O(e);
|
|
1399
|
+
return n != null && n.data ? /* @__PURE__ */ r(Qi, { openQuestion: t, questions: n.data }) : /* @__PURE__ */ r("div", { children: "wait questions..." });
|
|
1400
|
+
}, Pi = ({ userSummary: e }) => {
|
|
1401
|
+
var t, n;
|
|
1402
|
+
const i = O(e.getStore());
|
|
1403
|
+
return (t = i.data) != null && t.summary ? /* @__PURE__ */ r(je, { ...i.data.summary, successRate: (n = i.data.percentage) == null ? void 0 : n.correct }) : /* @__PURE__ */ r("div", { children: "wait user..." });
|
|
1404
|
+
}, qi = ({ gamification: e }) => {
|
|
1405
|
+
const [t, n] = L(U.HOME);
|
|
1406
|
+
return /* @__PURE__ */ I("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
|
|
1407
|
+
/* @__PURE__ */ I(ee, { children: [
|
|
1408
|
+
/* @__PURE__ */ r(Hn, { activePage: t, toggleActivePage: n }),
|
|
1409
|
+
t === U.HOME && /* @__PURE__ */ r(Pi, { userSummary: e.userSummary })
|
|
1410
|
+
] }),
|
|
1411
|
+
t === U.HOME && /* @__PURE__ */ r(Ze, { children: /* @__PURE__ */ r(Ui, { openQuestion: e.openQuestion, store: e.feedList.getStore() }) }),
|
|
1412
|
+
t === U.LEADERBOARD && /* @__PURE__ */ r(ee, { style: { flex: "1 1 auto", paddingTop: 0, paddingBottom: 0 }, children: /* @__PURE__ */ r(Ni, { gamification: e }) })
|
|
1413
|
+
] });
|
|
1414
|
+
}, Yi = () => Je, Ne = /* @__PURE__ */ a(Yi())({
|
|
1415
|
+
name: "OpenedContainer",
|
|
1416
|
+
class: "OpenedContainer_oar61gl",
|
|
1417
|
+
propsAsIs: !0
|
|
1418
|
+
}), Wi = /* @__PURE__ */ a("div")({
|
|
1419
|
+
name: "UserContainer",
|
|
1420
|
+
class: "UserContainer_u14zaal4",
|
|
1421
|
+
propsAsIs: !1
|
|
1422
|
+
}), Fi = ({
|
|
1423
|
+
correct: e,
|
|
1424
|
+
incorrect: t
|
|
1425
|
+
}) => {
|
|
1426
|
+
const n = e + t;
|
|
1427
|
+
return n === 0 ? 0 : Math.round(e / n * 100);
|
|
1428
|
+
}, Gi = ({
|
|
1429
|
+
gamification: e,
|
|
1430
|
+
className: t
|
|
1431
|
+
}) => {
|
|
1432
|
+
const n = O(e.openedQuestion.$store), i = O(e.openedUser);
|
|
1433
|
+
return /* @__PURE__ */ I($, {
|
|
1434
|
+
children: [n && /* @__PURE__ */ r(Ne, {
|
|
1435
|
+
className: t,
|
|
1436
|
+
children: /* @__PURE__ */ r(Yn, {
|
|
1437
|
+
gamification: e
|
|
1438
|
+
})
|
|
1439
|
+
}), i && /* @__PURE__ */ r(Ne, {
|
|
1440
|
+
className: t,
|
|
1441
|
+
children: /* @__PURE__ */ I(Wi, {
|
|
1442
|
+
children: [/* @__PURE__ */ r(ke, {
|
|
1443
|
+
label: "Friend's Rank",
|
|
1444
|
+
close: e.closeUser
|
|
1445
|
+
}), /* @__PURE__ */ r(ee, {
|
|
1446
|
+
children: /* @__PURE__ */ r(je, {
|
|
1447
|
+
...i,
|
|
1448
|
+
successRate: Fi(i)
|
|
1449
|
+
})
|
|
1450
|
+
})]
|
|
1451
|
+
})
|
|
1452
|
+
}), /* @__PURE__ */ r(xe, {
|
|
1453
|
+
className: t,
|
|
1454
|
+
"data-nav": "true",
|
|
1455
|
+
children: /* @__PURE__ */ r(qi, {
|
|
1456
|
+
gamification: e
|
|
1457
|
+
})
|
|
1458
|
+
})]
|
|
1459
|
+
});
|
|
1460
|
+
};
|
|
1461
|
+
export {
|
|
1462
|
+
Gi as GamificationOverlay,
|
|
1463
|
+
Gi as default
|
|
1464
|
+
};
|