@streamlayer/react 0.29.11 → 0.30.1
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/cjs/app.js +1 -0
- package/lib/cjs/auth.js +1 -1
- package/lib/cjs/gamification-feature.js +1 -0
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index2.js +4 -0
- package/lib/cjs/index3.js +1 -0
- package/lib/cjs/masters.js +1 -1
- package/lib/cjs/masters2.js +6 -0
- package/lib/cjs/points.js +1 -1
- package/lib/dist/cjs/gamification-feature.js +1 -0
- package/lib/dist/cjs/index.js +1 -0
- package/lib/dist/cjs/masters.js +297 -1
- package/lib/dist/es/gamification-feature.js +1463 -0
- package/lib/dist/es/index.js +9 -0
- package/lib/dist/es/masters.js +26797 -7
- package/lib/dist/index.d.ts +7 -5
- package/lib/dist/style.css +1 -196
- package/lib/{app-e4b43a5c.js → es/app.js} +5 -5
- package/lib/es/auth.js +2 -2
- package/lib/es/gamification-feature.js +1409 -0
- package/lib/es/index.js +2 -2
- package/lib/{index-0d23b24e.js → es/index2.js} +15 -15
- package/lib/es/index3.js +151 -0
- package/lib/es/masters.js +5 -4
- package/lib/es/masters2.js +2433 -0
- package/lib/es/points.js +51 -42
- package/lib/style.css +1 -1
- package/package.json +10 -10
- package/lib/app-c9828ece.cjs +0 -1
- package/lib/dist/index-56687fbe.cjs +0 -1
- package/lib/dist/index-b7b397b9.js +0 -1740
- package/lib/dist/masters-791400ce.js +0 -20468
- package/lib/dist/masters-8c3bc143.cjs +0 -29
- package/lib/index-60fabb42.cjs +0 -6
- package/lib/index-81810ce0.js +0 -950
- package/lib/index-89c19a6e.cjs +0 -4
- package/lib/index-9a1075fa.cjs +0 -1
- package/lib/index-d3a5d095.js +0 -2851
- package/lib/masters-a0c5967c.js +0 -693
- package/lib/masters-b0b09591.cjs +0 -1
- /package/lib/{common-f34b9d88.cjs → cjs/common.js} +0 -0
- /package/lib/{common-2d2a3ba3.js → es/common.js} +0 -0
|
@@ -0,0 +1,1463 @@
|
|
|
1
|
+
import { jsxs as I, jsx as r, Fragment as E } from "react/jsx-runtime";
|
|
2
|
+
import { s as a, i as j, o as De, a as Se, b as ze, Q as x, c as q, d as $, E as L, r as xe, e as Ye, f as We, n as Fe, w as Ve, u as w, A as Be, O as He, P as F, g as Ge, h as ee, j as Ze, k as Je } from "./masters.js";
|
|
3
|
+
import U, { useRef as C, useState as R, useCallback as P, useEffect as Ke, useLayoutEffect as Xe, useMemo as B, createElement as G, PureComponent as je } from "react";
|
|
4
|
+
const et = /* @__PURE__ */ a("div")({
|
|
5
|
+
name: "Container",
|
|
6
|
+
class: "c1vwopgc",
|
|
7
|
+
propsAsIs: !1
|
|
8
|
+
}), tt = /* @__PURE__ */ a("div")({
|
|
9
|
+
name: "QuestionTypeWrap",
|
|
10
|
+
class: "qyktpt0",
|
|
11
|
+
propsAsIs: !1
|
|
12
|
+
}), nt = () => j, st = /* @__PURE__ */ a(nt())({
|
|
13
|
+
name: "QuestionTypeIcon",
|
|
14
|
+
class: "q951jdx",
|
|
15
|
+
propsAsIs: !0
|
|
16
|
+
}), it = /* @__PURE__ */ a("span")({
|
|
17
|
+
name: "QuestionTypeTitle",
|
|
18
|
+
class: "qss5f0e",
|
|
19
|
+
propsAsIs: !1
|
|
20
|
+
}), rt = /* @__PURE__ */ a("button")({
|
|
21
|
+
name: "CloseButton",
|
|
22
|
+
class: "c1ao1jtv",
|
|
23
|
+
propsAsIs: !1
|
|
24
|
+
}), ot = () => j, at = /* @__PURE__ */ a(ot())({
|
|
25
|
+
name: "CloseIcon",
|
|
26
|
+
class: "cvsl7l3",
|
|
27
|
+
propsAsIs: !0
|
|
28
|
+
}), ke = ({ type: e, close: t, label: n }) => {
|
|
29
|
+
const s = e ? De[e] : { label: n, iconName: void 0 };
|
|
30
|
+
return /* @__PURE__ */ I(et, { children: [
|
|
31
|
+
/* @__PURE__ */ I(tt, { children: [
|
|
32
|
+
(s == null ? void 0 : s.iconName) && /* @__PURE__ */ r(st, { name: s.iconName }),
|
|
33
|
+
(s == null ? void 0 : s.label) && /* @__PURE__ */ r(it, { children: s.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: "c1zy8a",
|
|
40
|
+
propsAsIs: !1
|
|
41
|
+
}), ct = /* @__PURE__ */ a("div")({
|
|
42
|
+
name: "Title",
|
|
43
|
+
class: "t1vih9p5",
|
|
44
|
+
propsAsIs: !1
|
|
45
|
+
}), dt = /* @__PURE__ */ a("div")({
|
|
46
|
+
name: "Indicator",
|
|
47
|
+
class: "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: "ctmhwyc",
|
|
55
|
+
propsAsIs: !1
|
|
56
|
+
}), pt = /* @__PURE__ */ a("div")({
|
|
57
|
+
name: "Indicator",
|
|
58
|
+
class: "i1jri200",
|
|
59
|
+
propsAsIs: !1
|
|
60
|
+
}), mt = /* @__PURE__ */ a("div")({
|
|
61
|
+
name: "Title",
|
|
62
|
+
class: "t8s05oq",
|
|
63
|
+
propsAsIs: !1
|
|
64
|
+
}), V = ({ 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: "c1yrpn9o",
|
|
70
|
+
propsAsIs: !1
|
|
71
|
+
}), It = /* @__PURE__ */ a("div")({
|
|
72
|
+
name: "TopInfo",
|
|
73
|
+
class: "t17fwahh",
|
|
74
|
+
propsAsIs: !1
|
|
75
|
+
}), ft = /* @__PURE__ */ a("div")({
|
|
76
|
+
name: "BottomInfo",
|
|
77
|
+
class: "by6w7e9",
|
|
78
|
+
propsAsIs: !1
|
|
79
|
+
}), gt = /* @__PURE__ */ a("div")({
|
|
80
|
+
name: "User",
|
|
81
|
+
class: "u1g7arbm",
|
|
82
|
+
propsAsIs: !1
|
|
83
|
+
}), Mt = /* @__PURE__ */ a("img")({
|
|
84
|
+
name: "Avatar",
|
|
85
|
+
class: "a1ldeata",
|
|
86
|
+
propsAsIs: !1
|
|
87
|
+
}), vt = /* @__PURE__ */ a("div")({
|
|
88
|
+
name: "UserInfo",
|
|
89
|
+
class: "u10d4koz",
|
|
90
|
+
propsAsIs: !1
|
|
91
|
+
}), yt = /* @__PURE__ */ a("div")({
|
|
92
|
+
name: "UserName",
|
|
93
|
+
class: "u1q6roj0",
|
|
94
|
+
propsAsIs: !1
|
|
95
|
+
}), Nt = /* @__PURE__ */ a("div")({
|
|
96
|
+
name: "UserRating",
|
|
97
|
+
class: "ui0m425",
|
|
98
|
+
propsAsIs: !1
|
|
99
|
+
}), At = /* @__PURE__ */ a("img")({
|
|
100
|
+
name: "TrophyIcon",
|
|
101
|
+
class: "t1el3mrn",
|
|
102
|
+
propsAsIs: !1
|
|
103
|
+
}), Tt = /* @__PURE__ */ a("div")({
|
|
104
|
+
name: "Rts",
|
|
105
|
+
class: "r2vgnxv",
|
|
106
|
+
propsAsIs: !1
|
|
107
|
+
}), Dt = /* @__PURE__ */ a("div")({
|
|
108
|
+
name: "RtsIndicator",
|
|
109
|
+
class: "roqn06j",
|
|
110
|
+
propsAsIs: !1
|
|
111
|
+
}), St = /* @__PURE__ */ a("div")({
|
|
112
|
+
name: "RtsLabel",
|
|
113
|
+
class: "r15adx7c",
|
|
114
|
+
propsAsIs: !1
|
|
115
|
+
}), zt = /* @__PURE__ */ a("div")({
|
|
116
|
+
name: "Divider",
|
|
117
|
+
class: "dv59lta",
|
|
118
|
+
propsAsIs: !1
|
|
119
|
+
}), xt = /* @__PURE__ */ a("div")({
|
|
120
|
+
name: "Ranks",
|
|
121
|
+
class: "r55lotb",
|
|
122
|
+
propsAsIs: !1
|
|
123
|
+
}), jt = /* @__PURE__ */ a("div")({
|
|
124
|
+
name: "Statistics",
|
|
125
|
+
class: "s1knfgqt",
|
|
126
|
+
propsAsIs: !1
|
|
127
|
+
}), kt = /* @__PURE__ */ a("div")({
|
|
128
|
+
name: "AvatarPlaceholder",
|
|
129
|
+
class: "a1mqo824",
|
|
130
|
+
propsAsIs: !1
|
|
131
|
+
}), Ot = /* @__PURE__ */ a("button")({
|
|
132
|
+
name: "UserAccountBtn",
|
|
133
|
+
class: "uxareh6",
|
|
134
|
+
propsAsIs: !1
|
|
135
|
+
}), wt = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=", Oe = ({
|
|
136
|
+
avatar: e,
|
|
137
|
+
name: t,
|
|
138
|
+
points: n,
|
|
139
|
+
friendsRank: s,
|
|
140
|
+
rank: i,
|
|
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(Ot, { 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(Nt, { children: [
|
|
155
|
+
/* @__PURE__ */ I(Tt, { children: [
|
|
156
|
+
/* @__PURE__ */ r(At, { alt: "rank-icon", src: wt }),
|
|
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: s || 0, title: "Friends rank" }),
|
|
174
|
+
/* @__PURE__ */ r(ae, { indicator: i || 0, title: "Global rank" })
|
|
175
|
+
] }),
|
|
176
|
+
/* @__PURE__ */ I(jt, { children: [
|
|
177
|
+
/* @__PURE__ */ r(V, { indicator: c || 0, title: "Win streak" }),
|
|
178
|
+
/* @__PURE__ */ r(V, { indicator: l || 0, title: "Correct" }),
|
|
179
|
+
/* @__PURE__ */ r(V, { indicator: m || 0, title: "Incorrect" }),
|
|
180
|
+
/* @__PURE__ */ r(V, { indicator: `${f || 0}%`, title: "Succ. rate" })
|
|
181
|
+
] })
|
|
182
|
+
] })
|
|
183
|
+
] }), Ct = /* @__PURE__ */ a("div")({
|
|
184
|
+
name: "Container",
|
|
185
|
+
class: "c38csyt",
|
|
186
|
+
propsAsIs: !1
|
|
187
|
+
}), bt = /* @__PURE__ */ a("div")({
|
|
188
|
+
name: "Title",
|
|
189
|
+
class: "ty221rx",
|
|
190
|
+
propsAsIs: !1
|
|
191
|
+
}), $t = /* @__PURE__ */ a("div")({
|
|
192
|
+
name: "Description",
|
|
193
|
+
class: "dlaj9xp",
|
|
194
|
+
propsAsIs: !1
|
|
195
|
+
}), Et = ({ title: e, description: t }) => /* @__PURE__ */ I(Ct, { children: [
|
|
196
|
+
/* @__PURE__ */ r(j, { name: "icon-check-circle" }),
|
|
197
|
+
/* @__PURE__ */ r(bt, { children: e }),
|
|
198
|
+
/* @__PURE__ */ r($t, { children: t })
|
|
199
|
+
] }), Lt = /* @__PURE__ */ a("div")({
|
|
200
|
+
name: "Container",
|
|
201
|
+
class: "c16sbdnm",
|
|
202
|
+
propsAsIs: !1
|
|
203
|
+
}), Rt = () => j, Qt = /* @__PURE__ */ a(Rt())({
|
|
204
|
+
name: "IconPrediction",
|
|
205
|
+
class: "ibhorgl",
|
|
206
|
+
propsAsIs: !0
|
|
207
|
+
}), le = /* @__PURE__ */ a("div")({
|
|
208
|
+
name: "FeedbackIconWrap",
|
|
209
|
+
class: "f1g20ja7",
|
|
210
|
+
propsAsIs: !1
|
|
211
|
+
}), ce = /* @__PURE__ */ a("div")({
|
|
212
|
+
name: "FeedbackHeader",
|
|
213
|
+
class: "f455ozj",
|
|
214
|
+
propsAsIs: !1
|
|
215
|
+
}), Ut = /* @__PURE__ */ a("span")({
|
|
216
|
+
name: "FeedbackTitle",
|
|
217
|
+
class: "f1913njx",
|
|
218
|
+
propsAsIs: !1
|
|
219
|
+
}), Z = /* @__PURE__ */ a("span")({
|
|
220
|
+
name: "FeedbackDescription",
|
|
221
|
+
class: "fzfk69z",
|
|
222
|
+
propsAsIs: !1
|
|
223
|
+
}), _t = /* @__PURE__ */ a("div")({
|
|
224
|
+
name: "FeedbackText",
|
|
225
|
+
class: "fx87qaj",
|
|
226
|
+
propsAsIs: !1
|
|
227
|
+
}), qt = ({
|
|
228
|
+
feedbackMessages: e,
|
|
229
|
+
questionVotedCorrectly: t,
|
|
230
|
+
questionVoted: n,
|
|
231
|
+
questionType: s,
|
|
232
|
+
hasCorrectAnswer: i,
|
|
233
|
+
questionStatus: c
|
|
234
|
+
}) => {
|
|
235
|
+
const l = n && (s === x.TRIVIA || s === x.PREDICTION);
|
|
236
|
+
if (!l && c !== q.RESOLVED)
|
|
237
|
+
return null;
|
|
238
|
+
const m = s === x.PREDICTION && !i, d = t ? "correct" : "incorrect", f = t ? e.correctFeedback : e.incorrectFeedback;
|
|
239
|
+
return /* @__PURE__ */ I(Lt, { "data-isPrediction": m, children: [
|
|
240
|
+
c === q.RESOLVED && s === x.TRIVIA && !n && /* @__PURE__ */ I(E, { children: [
|
|
241
|
+
/* @__PURE__ */ r(le, { children: /* @__PURE__ */ r(j, { name: "questionExpired" }) }),
|
|
242
|
+
/* @__PURE__ */ I("div", { children: [
|
|
243
|
+
/* @__PURE__ */ r(ce, { children: /* @__PURE__ */ r(Z, { children: "Question Expired" }) }),
|
|
244
|
+
/* @__PURE__ */ r(_t, { 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(E, { children: [
|
|
248
|
+
/* @__PURE__ */ r(Qt, { name: "icon-prediction" }),
|
|
249
|
+
/* @__PURE__ */ r(Z, { children: "Stay tuned to see if your prediction was correct." })
|
|
250
|
+
] }),
|
|
251
|
+
l && i && /* @__PURE__ */ I(E, { children: [
|
|
252
|
+
/* @__PURE__ */ r(le, { "data-feedbackType": d, children: /* @__PURE__ */ r(j, { name: d }) }),
|
|
253
|
+
/* @__PURE__ */ r("div", { children: /* @__PURE__ */ I(ce, { children: [
|
|
254
|
+
/* @__PURE__ */ r(Ut, { "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
|
+
}, Pt = /* @__PURE__ */ a("div")({
|
|
260
|
+
name: "Container",
|
|
261
|
+
class: "c14ielyq",
|
|
262
|
+
propsAsIs: !1
|
|
263
|
+
}), Yt = /* @__PURE__ */ a("div")({
|
|
264
|
+
name: "Content",
|
|
265
|
+
class: "c1tlqx57",
|
|
266
|
+
propsAsIs: !1
|
|
267
|
+
}), Wt = /* @__PURE__ */ a("div")({
|
|
268
|
+
name: "Title",
|
|
269
|
+
class: "t1hq58md",
|
|
270
|
+
propsAsIs: !1
|
|
271
|
+
}), Ft = /* @__PURE__ */ a("div")({
|
|
272
|
+
name: "Options",
|
|
273
|
+
class: "o1c8nxcx",
|
|
274
|
+
propsAsIs: !1
|
|
275
|
+
}), Vt = /* @__PURE__ */ a("button")({
|
|
276
|
+
name: "ButtonContainer",
|
|
277
|
+
class: "b1b6dl8t",
|
|
278
|
+
propsAsIs: !1
|
|
279
|
+
}), Bt = /* @__PURE__ */ a("div")({
|
|
280
|
+
name: "ButtonPct",
|
|
281
|
+
class: "b4iik8i",
|
|
282
|
+
propsAsIs: !1
|
|
283
|
+
}), Ht = /* @__PURE__ */ a("span")({
|
|
284
|
+
name: "ButtonBody",
|
|
285
|
+
class: "b1gq1lnf",
|
|
286
|
+
propsAsIs: !1
|
|
287
|
+
}), Gt = /* @__PURE__ */ a("div")({
|
|
288
|
+
name: "IconContainer",
|
|
289
|
+
class: "i1j65z51",
|
|
290
|
+
propsAsIs: !1
|
|
291
|
+
}), Zt = /* @__PURE__ */ a("div")({
|
|
292
|
+
name: "IconWrap",
|
|
293
|
+
class: "i19tpfua",
|
|
294
|
+
propsAsIs: !1
|
|
295
|
+
}), we = /* @__PURE__ */ a("img")({
|
|
296
|
+
name: "Icon",
|
|
297
|
+
class: "i1tubmma",
|
|
298
|
+
propsAsIs: !1
|
|
299
|
+
}), Jt = () => we, Kt = /* @__PURE__ */ a(Jt())({
|
|
300
|
+
name: "IconDefault",
|
|
301
|
+
class: "i1grrgwj",
|
|
302
|
+
propsAsIs: !0
|
|
303
|
+
}), Xt = () => we, en = /* @__PURE__ */ a(Xt())({
|
|
304
|
+
name: "IconCircle",
|
|
305
|
+
class: "ibemyq8",
|
|
306
|
+
propsAsIs: !0
|
|
307
|
+
}), tn = /* @__PURE__ */ a("span")({
|
|
308
|
+
name: "Title",
|
|
309
|
+
class: "t1dceht",
|
|
310
|
+
propsAsIs: !1
|
|
311
|
+
}), nn = /* @__PURE__ */ a("span")({
|
|
312
|
+
name: "Indicators",
|
|
313
|
+
class: "i116q4vq",
|
|
314
|
+
propsAsIs: !1
|
|
315
|
+
}), sn = /* @__PURE__ */ a("span")({
|
|
316
|
+
name: "Percentage",
|
|
317
|
+
class: "p17ajcu2",
|
|
318
|
+
propsAsIs: !1
|
|
319
|
+
}), rn = () => j, on = /* @__PURE__ */ a(rn())({
|
|
320
|
+
name: "CheckIcon",
|
|
321
|
+
class: "cu9kmlb",
|
|
322
|
+
propsAsIs: !0
|
|
323
|
+
}), de = {
|
|
324
|
+
[$.CENTERED]: (e) => /* @__PURE__ */ r(Kt, { alt: "option-icon", src: e }),
|
|
325
|
+
[$.TRANSPARENT]: (e) => /* @__PURE__ */ r(Gt, { children: /* @__PURE__ */ r(Zt, { style: { backgroundImage: `url(${e})` } }) }),
|
|
326
|
+
[$.ROUNDED]: (e) => /* @__PURE__ */ r(en, { alt: "option-icon", src: e }),
|
|
327
|
+
[$.NONE]: () => null,
|
|
328
|
+
[$.UNSET]: () => null
|
|
329
|
+
}, an = ({ questionType: e, hasCorrectAnswer: t, correct: n, youVoted: s, questionVoted: i }) => {
|
|
330
|
+
if (e === x.POLL && s)
|
|
331
|
+
return "correct";
|
|
332
|
+
if (e === x.PREDICTION) {
|
|
333
|
+
if (t && i)
|
|
334
|
+
return s ? n ? "correct" : "incorrect" : n ? "correct" : "unset";
|
|
335
|
+
if (s)
|
|
336
|
+
return "correct";
|
|
337
|
+
}
|
|
338
|
+
return e === x.TRIVIA && i ? s ? n ? "correct" : "incorrect" : n ? "correct" : "unset" : "unset";
|
|
339
|
+
}, ln = ({
|
|
340
|
+
questionType: e,
|
|
341
|
+
questionVoted: t,
|
|
342
|
+
correct: n,
|
|
343
|
+
hasCorrectAnswer: s,
|
|
344
|
+
questionStatus: i
|
|
345
|
+
}) => e === x.TRIVIA ? t && n : e === x.PREDICTION ? t && n && s || i === q.RESOLVED && n : !1, cn = (e) => {
|
|
346
|
+
var t;
|
|
347
|
+
const {
|
|
348
|
+
// option props
|
|
349
|
+
id: n,
|
|
350
|
+
icon: s,
|
|
351
|
+
text: i,
|
|
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 = $.ROUNDED,
|
|
359
|
+
answerTimeExpired: A,
|
|
360
|
+
questionStatus: v,
|
|
361
|
+
isLoading: g,
|
|
362
|
+
questionType: T,
|
|
363
|
+
correct: D,
|
|
364
|
+
hasCorrectAnswer: o
|
|
365
|
+
} = e, u = an(e), p = ln({ questionType: T, questionVoted: d, correct: D, hasCorrectAnswer: o, questionStatus: v }), h = d || v === q.RESOLVED && T === x.PREDICTION;
|
|
366
|
+
return /* @__PURE__ */ I(
|
|
367
|
+
Vt,
|
|
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(Bt, { "data-answerState": u, style: { width: `${c}%` } }),
|
|
376
|
+
/* @__PURE__ */ I(Ht, { children: [
|
|
377
|
+
s && ((t = de[f]) == null ? void 0 : t.call(de, s)),
|
|
378
|
+
/* @__PURE__ */ r(tn, { children: i }),
|
|
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: s = 0, onComplete: i, onUpdate: c }) => {
|
|
392
|
+
let [l, m] = R(n), d = C(0), f = C(n), A = C(n * -1e3), v = C(null), g = C(null), T = C(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 N = f.current + (s === 0 ? y : (y / s | 0) * s), S = f.current + y, z = typeof t == "number" && S >= t;
|
|
401
|
+
m(z ? t : N), z || (v.current = requestAnimationFrame(D));
|
|
402
|
+
}, o = () => {
|
|
403
|
+
v.current && cancelAnimationFrame(v.current), T.current && clearTimeout(T.current), g.current = null;
|
|
404
|
+
}, u = P((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 } = (i == null ? void 0 : i(A.current / 1e3)) || {};
|
|
413
|
+
p && (T.current = setTimeout(() => u(M), h * 1e3));
|
|
414
|
+
}
|
|
415
|
+
}, [l, t]), ue(() => (e && (v.current = requestAnimationFrame(D)), o), [e, t, s]), { elapsedTime: l, reset: u };
|
|
416
|
+
}, un = (e, t, n) => {
|
|
417
|
+
let s = e / 2, i = t / 2, c = s - i, l = 2 * c, m = n === "clockwise" ? "1,0" : "0,1", d = 2 * Math.PI * c;
|
|
418
|
+
return { path: `m ${s},${i} 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%" }, Ce = (e, t, n, s, i) => {
|
|
420
|
+
if (s === 0)
|
|
421
|
+
return t;
|
|
422
|
+
let c = (i ? s - e : e) / s;
|
|
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, (s, i, c, l) => `#${i}${i}${c}${c}${l}${l}`).substring(1).match(/.{2}/g)) == null ? void 0 : t.map((s) => parseInt(s, 16))) != null ? n : [];
|
|
427
|
+
}, hn = (e, t) => {
|
|
428
|
+
var n;
|
|
429
|
+
let { colors: s, colorsTime: i, isSmoothColorTransition: c = !0 } = e;
|
|
430
|
+
if (typeof s == "string")
|
|
431
|
+
return s;
|
|
432
|
+
let l = (n = i == null ? void 0 : i.findIndex((g, T) => g >= t && t >= i[T + 1])) != null ? n : -1;
|
|
433
|
+
if (!i || l === -1)
|
|
434
|
+
return s[0];
|
|
435
|
+
if (!c)
|
|
436
|
+
return s[l];
|
|
437
|
+
let m = i[l] - t, d = i[l] - i[l + 1], f = me(s[l]), A = me(s[l + 1]), v = !!e.isGrowing;
|
|
438
|
+
return `rgb(${f.map((g, T) => Ce(m, g, A[T] - g, d, v) | 0).join(",")})`;
|
|
439
|
+
}, In = (e) => {
|
|
440
|
+
let { duration: t, initialRemainingTime: n, updateInterval: s, size: i = 180, strokeWidth: c = 12, trailStrokeWidth: l, isPlaying: m = !1, isGrowing: d = !1, rotation: f = "clockwise", onComplete: A, onUpdate: v } = e, g = C(), T = Math.max(c, l ?? 0), { path: D, pathLength: o } = un(i, T, f), { elapsedTime: u } = dn({ isPlaying: m, duration: t, startAt: pe(t, n), updateInterval: s, 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: N, newInitialRemainingTime: S } = (M = A(h)) != null ? M : {};
|
|
446
|
+
if (y)
|
|
447
|
+
return { shouldRepeat: y, delay: N, 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: i, stroke: hn(e, p), strokeDashoffset: Ce(u, 0, o, t, d), strokeWidth: c };
|
|
450
|
+
}, be = (e) => {
|
|
451
|
+
let { children: t, strokeLinecap: n, trailColor: s, trailStrokeWidth: i } = e, { path: c, pathLength: l, stroke: m, strokeDashoffset: d, remainingTime: f, elapsedTime: A, size: v, strokeWidth: g } = In(e);
|
|
452
|
+
return U.createElement("div", { style: pn(v) }, U.createElement("svg", { viewBox: `0 0 ${v} ${v}`, width: v, height: v, xmlns: "http://www.w3.org/2000/svg" }, U.createElement("path", { d: c, fill: "none", stroke: s ?? "#d9d9d9", strokeWidth: i ?? g }), U.createElement("path", { d: c, fill: "none", stroke: m, strokeLinecap: n ?? "round", strokeWidth: g, strokeDasharray: l, strokeDashoffset: d })), typeof t == "function" && U.createElement("div", { style: mn }, t({ remainingTime: f, elapsedTime: A, color: m })));
|
|
453
|
+
};
|
|
454
|
+
be.displayName = "CountdownCircleTimer";
|
|
455
|
+
const fn = [L.PRIMARY_GREEN1, L.SECONDARY_RED1, L.SECONDARY_RED1], gn = [10, 10, 0], Mn = /* @__PURE__ */ a("div")({
|
|
456
|
+
name: "RemainingTime",
|
|
457
|
+
class: "r165427",
|
|
458
|
+
propsAsIs: !1
|
|
459
|
+
}), vn = L.SECONDARY_GREEN6, he = L.SECONDARY_RED3, yn = L.NEUTRALS_GRAY3, Nn = ({
|
|
460
|
+
isPlaying: e = !0,
|
|
461
|
+
duration: t = 30,
|
|
462
|
+
onTimerExpired: n
|
|
463
|
+
}) => {
|
|
464
|
+
const [s, i] = R(t > 10 ? vn : he), c = ({
|
|
465
|
+
remainingTime: d
|
|
466
|
+
}) => /* @__PURE__ */ r(Mn, {
|
|
467
|
+
children: d
|
|
468
|
+
}), l = P(() => {
|
|
469
|
+
n == null || n(), i(yn);
|
|
470
|
+
}, [n, i]), m = P((d) => {
|
|
471
|
+
d === 10 && i(he);
|
|
472
|
+
}, [i]);
|
|
473
|
+
return /* @__PURE__ */ r(be, {
|
|
474
|
+
isPlaying: e,
|
|
475
|
+
duration: t,
|
|
476
|
+
colors: fn,
|
|
477
|
+
colorsTime: gn,
|
|
478
|
+
size: 32,
|
|
479
|
+
strokeWidth: 2,
|
|
480
|
+
trailStrokeWidth: 2,
|
|
481
|
+
trailColor: s,
|
|
482
|
+
onComplete: l,
|
|
483
|
+
onUpdate: m,
|
|
484
|
+
children: c
|
|
485
|
+
});
|
|
486
|
+
}, An = /* @__PURE__ */ a("div")({
|
|
487
|
+
name: "WinBarContainer",
|
|
488
|
+
class: "wie6cqo",
|
|
489
|
+
propsAsIs: !1
|
|
490
|
+
}), Tn = /* @__PURE__ */ a("div")({
|
|
491
|
+
name: "Content",
|
|
492
|
+
class: "cgizw4u",
|
|
493
|
+
propsAsIs: !1
|
|
494
|
+
}), Dn = /* @__PURE__ */ a("div")({
|
|
495
|
+
name: "Title",
|
|
496
|
+
class: "t1l3ucjp",
|
|
497
|
+
propsAsIs: !1
|
|
498
|
+
}), Sn = () => j, zn = /* @__PURE__ */ a(Sn())({
|
|
499
|
+
name: "WinIcon",
|
|
500
|
+
class: "wx7j799",
|
|
501
|
+
propsAsIs: !0
|
|
502
|
+
}), xn = /* @__PURE__ */ a("div")({
|
|
503
|
+
name: "Points",
|
|
504
|
+
class: "p4lwuj0",
|
|
505
|
+
propsAsIs: !1
|
|
506
|
+
}), jn = /* @__PURE__ */ a("span")({
|
|
507
|
+
name: "PointsCount",
|
|
508
|
+
class: "po9i64o",
|
|
509
|
+
propsAsIs: !1
|
|
510
|
+
}), kn = /* @__PURE__ */ a("span")({
|
|
511
|
+
name: "PointsUnits",
|
|
512
|
+
class: "pe5g05h",
|
|
513
|
+
propsAsIs: !1
|
|
514
|
+
}), On = ({ title: e, points: t, isPlayingTimer: n, isTimer: s, onTimerExpired: i }) => /* @__PURE__ */ I(An, { children: [
|
|
515
|
+
/* @__PURE__ */ I(Tn, { children: [
|
|
516
|
+
e && /* @__PURE__ */ r(Dn, { children: e }),
|
|
517
|
+
t !== void 0 && /* @__PURE__ */ I(E, { children: [
|
|
518
|
+
/* @__PURE__ */ r(zn, { name: "icon-trophy" }),
|
|
519
|
+
/* @__PURE__ */ I(xn, { children: [
|
|
520
|
+
/* @__PURE__ */ r(jn, { children: t }),
|
|
521
|
+
/* @__PURE__ */ r(kn, { children: "PTS" })
|
|
522
|
+
] })
|
|
523
|
+
] })
|
|
524
|
+
] }),
|
|
525
|
+
s && /* @__PURE__ */ r(Nn, { isPlaying: n, onTimerExpired: i })
|
|
526
|
+
] }), wn = ({ openedQuestion: e, vote: t, close: n }) => {
|
|
527
|
+
var s;
|
|
528
|
+
const i = e.subject, c = e.type, l = (s = e.options) == null ? void 0 : s.options, [m, d] = R(!1), [f, A] = R(!1), [v, g] = R(""), T = e == null ? void 0 : e.id, D = P(
|
|
529
|
+
async (y) => {
|
|
530
|
+
if (T) {
|
|
531
|
+
const N = y.currentTarget.value;
|
|
532
|
+
g(N), A(!0), await t(T, N), A(!1);
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
[T, g, t]
|
|
536
|
+
), o = P(() => {
|
|
537
|
+
d(!0), setTimeout(n, 3e3);
|
|
538
|
+
}, [n]), u = B(
|
|
539
|
+
() => e == null ? void 0 : e.answers.find((y) => y.youVoted === !0),
|
|
540
|
+
[e]
|
|
541
|
+
), p = B(
|
|
542
|
+
() => !!(e != null && e.answers.find((y) => y.correct === !0)),
|
|
543
|
+
[e]
|
|
544
|
+
), h = B(() => 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(Pt, { children: /* @__PURE__ */ I(Yt, { children: [
|
|
557
|
+
M && /* @__PURE__ */ r(
|
|
558
|
+
qt,
|
|
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
|
+
On,
|
|
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
|
+
Et,
|
|
579
|
+
{
|
|
580
|
+
title: "More to come...",
|
|
581
|
+
description: "Watch for additional enhanced stream interactive experience."
|
|
582
|
+
}
|
|
583
|
+
) : /* @__PURE__ */ I(E, { children: [
|
|
584
|
+
/* @__PURE__ */ r(Wt, { children: i }),
|
|
585
|
+
/* @__PURE__ */ r(Ft, { children: h.map((y) => /* @__PURE__ */ r(cn, { ...y }, y.id)) })
|
|
586
|
+
] })
|
|
587
|
+
] }) }) });
|
|
588
|
+
}, Cn = /* @__PURE__ */ a("div")({
|
|
589
|
+
name: "Container",
|
|
590
|
+
class: "cgn5uen",
|
|
591
|
+
propsAsIs: !1
|
|
592
|
+
}), bn = /* @__PURE__ */ a("div")({
|
|
593
|
+
name: "Content",
|
|
594
|
+
class: "c1px8nt6",
|
|
595
|
+
propsAsIs: !1
|
|
596
|
+
}), $n = /* @__PURE__ */ a("h3")({
|
|
597
|
+
name: "Title",
|
|
598
|
+
class: "t5et2jt",
|
|
599
|
+
propsAsIs: !1
|
|
600
|
+
}), En = /* @__PURE__ */ a("div")({
|
|
601
|
+
name: "Description",
|
|
602
|
+
class: "d1i2kpk2",
|
|
603
|
+
propsAsIs: !1
|
|
604
|
+
}), Ln = /* @__PURE__ */ a("div")({
|
|
605
|
+
name: "DateWrap",
|
|
606
|
+
class: "dd3lh3p",
|
|
607
|
+
propsAsIs: !1
|
|
608
|
+
}), $e = ({ created: e, title: t, instantView: n }) => {
|
|
609
|
+
const s = B(() => {
|
|
610
|
+
if (e) {
|
|
611
|
+
const i = new Date(e);
|
|
612
|
+
if (Ye(i))
|
|
613
|
+
return {
|
|
614
|
+
date: We(i),
|
|
615
|
+
time: Fe(i)
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
return null;
|
|
619
|
+
}, [e]);
|
|
620
|
+
return /* @__PURE__ */ I(Cn, { children: [
|
|
621
|
+
s && /* @__PURE__ */ I(Ln, { children: [
|
|
622
|
+
s.date,
|
|
623
|
+
" · ",
|
|
624
|
+
s.time
|
|
625
|
+
] }),
|
|
626
|
+
(n == null ? void 0 : n.video) && /* @__PURE__ */ r(Ve, { source: n.video.url, poster: n.video.thumbnailUrl }),
|
|
627
|
+
/* @__PURE__ */ I(bn, { children: [
|
|
628
|
+
/* @__PURE__ */ r($n, { children: (n == null ? void 0 : n.heading) || t }),
|
|
629
|
+
/* @__PURE__ */ r(En, { children: n == null ? void 0 : n.body })
|
|
630
|
+
] })
|
|
631
|
+
] });
|
|
632
|
+
}, Rn = /* @__PURE__ */ a("div")({
|
|
633
|
+
name: "Container",
|
|
634
|
+
class: "c1euiow",
|
|
635
|
+
propsAsIs: !1
|
|
636
|
+
}), Qn = /* @__PURE__ */ a("a")({
|
|
637
|
+
name: "WebLinkBtn",
|
|
638
|
+
class: "w19zie3h",
|
|
639
|
+
propsAsIs: !1
|
|
640
|
+
}), Un = ({ instantView: e, ...t }) => /* @__PURE__ */ I(Rn, { children: [
|
|
641
|
+
/* @__PURE__ */ r($e, { instantView: e, ...t }),
|
|
642
|
+
(e == null ? void 0 : e.webLink) && /* @__PURE__ */ I(Qn, { href: e == null ? void 0 : e.webLink.url, target: "_blank", children: [
|
|
643
|
+
"Explore more of the Masters History",
|
|
644
|
+
/* @__PURE__ */ r(j, { name: "icon-external-link" })
|
|
645
|
+
] })
|
|
646
|
+
] }), _n = /* @__PURE__ */ a("div")({
|
|
647
|
+
name: "QuestionContainer",
|
|
648
|
+
class: "qdri6g3",
|
|
649
|
+
propsAsIs: !1
|
|
650
|
+
}), qn = ({
|
|
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(Un, {
|
|
655
|
+
created: e.attributes.created,
|
|
656
|
+
...e.attributes.attributes.value
|
|
657
|
+
}) : null;
|
|
658
|
+
}, Pn = ({
|
|
659
|
+
extendedQuestion: e,
|
|
660
|
+
vote: t,
|
|
661
|
+
close: n
|
|
662
|
+
}) => {
|
|
663
|
+
const {
|
|
664
|
+
loading: s,
|
|
665
|
+
data: i
|
|
666
|
+
} = e;
|
|
667
|
+
return !s && i ? /* @__PURE__ */ r(wn, {
|
|
668
|
+
vote: t,
|
|
669
|
+
close: n,
|
|
670
|
+
openedQuestion: i
|
|
671
|
+
}) : null;
|
|
672
|
+
}, Yn = ({
|
|
673
|
+
gamification: e
|
|
674
|
+
}) => {
|
|
675
|
+
var t;
|
|
676
|
+
const n = w(e.openedQuestion.$store), s = w(e.openedQuestion.$extendedStore);
|
|
677
|
+
if (!n)
|
|
678
|
+
return null;
|
|
679
|
+
const i = n.type;
|
|
680
|
+
return /* @__PURE__ */ I(_n, {
|
|
681
|
+
children: [/* @__PURE__ */ r(ke, {
|
|
682
|
+
close: e.closeQuestion,
|
|
683
|
+
type: ((t = n.attributes) == null ? void 0 : t.type) || x.UNSET
|
|
684
|
+
}), i === "question" && /* @__PURE__ */ r(Pn, {
|
|
685
|
+
vote: e.submitAnswer,
|
|
686
|
+
close: e.closeQuestion,
|
|
687
|
+
extendedQuestion: s
|
|
688
|
+
}), i !== "question" && /* @__PURE__ */ r(qn, {
|
|
689
|
+
openedQuestion: n
|
|
690
|
+
})]
|
|
691
|
+
});
|
|
692
|
+
}, Wn = /* @__PURE__ */ a("div")({
|
|
693
|
+
name: "Container",
|
|
694
|
+
class: "c115qtkr",
|
|
695
|
+
propsAsIs: !1
|
|
696
|
+
}), Fn = /* @__PURE__ */ a("div")({
|
|
697
|
+
name: "STabs",
|
|
698
|
+
class: "sxnslc8",
|
|
699
|
+
propsAsIs: !1
|
|
700
|
+
}), Vn = /* @__PURE__ */ a("button")({
|
|
701
|
+
name: "Button",
|
|
702
|
+
class: "b1umzux0",
|
|
703
|
+
propsAsIs: !1
|
|
704
|
+
}), Bn = /* @__PURE__ */ a("span")({
|
|
705
|
+
name: "Title",
|
|
706
|
+
class: "tspsaas",
|
|
707
|
+
propsAsIs: !1
|
|
708
|
+
});
|
|
709
|
+
var _ = /* @__PURE__ */ ((e) => (e.HOME = "home", e.LEADERBOARD = "leaderboard", e))(_ || {});
|
|
710
|
+
const Ie = ({ title: e, active: t, onClick: n }) => /* @__PURE__ */ r(Vn, { onClick: n, "data-selected": t, children: /* @__PURE__ */ r(Bn, { 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 s in n)
|
|
732
|
+
Object.prototype.hasOwnProperty.call(n, s) && (e[s] = n[s]);
|
|
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(s, i) {
|
|
744
|
+
return s.__proto__ = i, s;
|
|
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, s = [], i, 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, s) || (i = e.apply(this, m), c = !0, n = this, s = m), i;
|
|
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 s() {
|
|
785
|
+
Me() - n >= t ? e.call(null) : i.id = requestAnimationFrame(s);
|
|
786
|
+
}
|
|
787
|
+
var i = {
|
|
788
|
+
id: requestAnimationFrame(s)
|
|
789
|
+
};
|
|
790
|
+
return i;
|
|
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 b = null;
|
|
801
|
+
function Ne(e) {
|
|
802
|
+
if (e === void 0 && (e = !1), b === 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 s = document.createElement("div"), i = s.style;
|
|
806
|
+
return i.width = "100px", i.height = "100px", t.appendChild(s), document.body.appendChild(t), t.scrollLeft > 0 ? b = "positive-descending" : (t.scrollLeft = 1, t.scrollLeft === 0 ? b = "negative" : b = "positive-ascending"), document.body.removeChild(t), b;
|
|
807
|
+
}
|
|
808
|
+
return b;
|
|
809
|
+
}
|
|
810
|
+
var es = 150, ts = function(t, n) {
|
|
811
|
+
return t;
|
|
812
|
+
};
|
|
813
|
+
function ns(e) {
|
|
814
|
+
var t, n = e.getItemOffset, s = e.getEstimatedTotalSize, i = 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, N = o._getItemStyleCache(f && M, f && y, f && h), S;
|
|
840
|
+
if (N.hasOwnProperty(u))
|
|
841
|
+
S = N[u];
|
|
842
|
+
else {
|
|
843
|
+
var z = n(o.props, u, o._instanceProps), k = i(o.props, u, o._instanceProps), O = h === "horizontal" || y === "horizontal", Y = h === "rtl", W = O ? z : 0;
|
|
844
|
+
N[u] = S = {
|
|
845
|
+
position: "absolute",
|
|
846
|
+
left: Y ? void 0 : W,
|
|
847
|
+
right: Y ? W : void 0,
|
|
848
|
+
top: O ? 0 : z,
|
|
849
|
+
height: O ? "100%" : k,
|
|
850
|
+
width: O ? 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(N) {
|
|
859
|
+
if (N.scrollOffset === M)
|
|
860
|
+
return null;
|
|
861
|
+
var S = o.props.direction, z = M;
|
|
862
|
+
if (S === "rtl")
|
|
863
|
+
switch (Ne()) {
|
|
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: N.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(N) {
|
|
881
|
+
if (N.scrollOffset === y)
|
|
882
|
+
return null;
|
|
883
|
+
var S = Math.max(0, Math.min(y, M - h));
|
|
884
|
+
return {
|
|
885
|
+
isScrolling: !0,
|
|
886
|
+
scrollDirection: N.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, es);
|
|
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 ss(o, u), A(o), null;
|
|
906
|
+
};
|
|
907
|
+
var T = g.prototype;
|
|
908
|
+
return T.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
|
+
}, T.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 N = 0;
|
|
921
|
+
if (this._outerRef) {
|
|
922
|
+
var S = this._outerRef;
|
|
923
|
+
M === "vertical" ? N = S.scrollWidth > S.clientWidth ? ye() : 0 : N = S.scrollHeight > S.clientHeight ? ye() : 0;
|
|
924
|
+
}
|
|
925
|
+
this.scrollTo(c(this.props, o, u, y, this._instanceProps, N));
|
|
926
|
+
}, T.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
|
+
}, T.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 N = this._outerRef;
|
|
937
|
+
if (u === "horizontal" || p === "horizontal")
|
|
938
|
+
if (u === "rtl")
|
|
939
|
+
switch (Ne()) {
|
|
940
|
+
case "negative":
|
|
941
|
+
N.scrollLeft = -M;
|
|
942
|
+
break;
|
|
943
|
+
case "positive-ascending":
|
|
944
|
+
N.scrollLeft = M;
|
|
945
|
+
break;
|
|
946
|
+
default:
|
|
947
|
+
var S = N.clientWidth, z = N.scrollWidth;
|
|
948
|
+
N.scrollLeft = z - S - M;
|
|
949
|
+
break;
|
|
950
|
+
}
|
|
951
|
+
else
|
|
952
|
+
N.scrollLeft = M;
|
|
953
|
+
else
|
|
954
|
+
N.scrollTop = M;
|
|
955
|
+
}
|
|
956
|
+
this._callPropsCallbacks();
|
|
957
|
+
}, T.componentWillUnmount = function() {
|
|
958
|
+
this._resetIsScrollingTimeoutId !== null && ve(this._resetIsScrollingTimeoutId);
|
|
959
|
+
}, T.render = function() {
|
|
960
|
+
var o = this.props, u = o.children, p = o.className, h = o.direction, M = o.height, y = o.innerRef, N = o.innerElementType, S = o.innerTagName, z = o.itemCount, k = o.itemData, O = o.itemKey, Y = O === void 0 ? ts : O, W = o.layout, Ee = o.outerElementType, Le = o.outerTagName, Re = o.style, Qe = o.useIsScrolling, Ue = o.width, se = this.state.isScrolling, H = h === "horizontal" || W === "horizontal", _e = H ? this._onScrollHorizontal : this._onScrollVertical, ie = this._getRangeToRender(), qe = ie[0], Pe = ie[1], re = [];
|
|
961
|
+
if (z > 0)
|
|
962
|
+
for (var Q = qe; Q <= Pe; Q++)
|
|
963
|
+
re.push(G(u, {
|
|
964
|
+
data: k,
|
|
965
|
+
key: Y(Q, k),
|
|
966
|
+
index: Q,
|
|
967
|
+
isScrolling: Qe ? se : void 0,
|
|
968
|
+
style: this._getItemStyle(Q)
|
|
969
|
+
}));
|
|
970
|
+
var oe = s(this.props, this._instanceProps);
|
|
971
|
+
return G(Ee || Le || "div", {
|
|
972
|
+
className: p,
|
|
973
|
+
onScroll: _e,
|
|
974
|
+
ref: this._outerRefSetter,
|
|
975
|
+
style: te({
|
|
976
|
+
position: "relative",
|
|
977
|
+
height: M,
|
|
978
|
+
width: Ue,
|
|
979
|
+
overflow: "auto",
|
|
980
|
+
WebkitOverflowScrolling: "touch",
|
|
981
|
+
willChange: "transform",
|
|
982
|
+
direction: h
|
|
983
|
+
}, Re)
|
|
984
|
+
}, G(N || S || "div", {
|
|
985
|
+
children: re,
|
|
986
|
+
ref: y,
|
|
987
|
+
style: {
|
|
988
|
+
height: H ? "100%" : oe,
|
|
989
|
+
pointerEvents: se ? "none" : void 0,
|
|
990
|
+
width: H ? oe : "100%"
|
|
991
|
+
}
|
|
992
|
+
}));
|
|
993
|
+
}, T._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 N = this.state, S = N.scrollDirection, z = N.scrollOffset, k = N.scrollUpdateWasRequested;
|
|
1003
|
+
this._callOnScroll(S, z, k);
|
|
1004
|
+
}
|
|
1005
|
+
}, T._getRangeToRender = function() {
|
|
1006
|
+
var o = this.props, u = o.itemCount, p = o.overscanCount, h = this.state, M = h.isScrolling, y = h.scrollDirection, N = h.scrollOffset;
|
|
1007
|
+
if (u === 0)
|
|
1008
|
+
return [0, 0, 0, 0];
|
|
1009
|
+
var S = l(this.props, N, this._instanceProps), z = m(this.props, S, N, this._instanceProps), k = !M || y === "backward" ? Math.max(1, p) : 1, O = !M || y === "forward" ? Math.max(1, p) : 1;
|
|
1010
|
+
return [Math.max(0, S - k), Math.max(0, Math.min(u - 1, z + O)), S, z];
|
|
1011
|
+
}, g;
|
|
1012
|
+
}(je), t.defaultProps = {
|
|
1013
|
+
direction: "ltr",
|
|
1014
|
+
itemData: void 0,
|
|
1015
|
+
layout: "vertical",
|
|
1016
|
+
overscanCount: 2,
|
|
1017
|
+
useIsScrolling: !1
|
|
1018
|
+
}, t;
|
|
1019
|
+
}
|
|
1020
|
+
var ss = function(t, n) {
|
|
1021
|
+
t.children, t.direction, t.height, t.layout, t.innerTagName, t.outerTagName, t.width, n.instance;
|
|
1022
|
+
}, is = /* @__PURE__ */ ns({
|
|
1023
|
+
getItemOffset: function(t, n) {
|
|
1024
|
+
var s = t.itemSize;
|
|
1025
|
+
return n * s;
|
|
1026
|
+
},
|
|
1027
|
+
getItemSize: function(t, n) {
|
|
1028
|
+
var s = t.itemSize;
|
|
1029
|
+
return s;
|
|
1030
|
+
},
|
|
1031
|
+
getEstimatedTotalSize: function(t) {
|
|
1032
|
+
var n = t.itemCount, s = t.itemSize;
|
|
1033
|
+
return s * n;
|
|
1034
|
+
},
|
|
1035
|
+
getOffsetForIndexAndAlignment: function(t, n, s, i, c, l) {
|
|
1036
|
+
var m = t.direction, d = t.height, f = t.itemCount, A = t.itemSize, v = t.layout, g = t.width, T = m === "horizontal" || v === "horizontal", D = T ? 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 (s === "smart" && (i >= p - D && i <= u + D ? s = "auto" : s = "center"), s) {
|
|
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 i >= p && i <= u ? i : i < p ? p : u;
|
|
1049
|
+
}
|
|
1050
|
+
},
|
|
1051
|
+
getStartIndexForOffset: function(t, n) {
|
|
1052
|
+
var s = t.itemCount, i = t.itemSize;
|
|
1053
|
+
return Math.max(0, Math.min(s - 1, Math.floor(n / i)));
|
|
1054
|
+
},
|
|
1055
|
+
getStopIndexForStartIndex: function(t, n, s) {
|
|
1056
|
+
var i = t.direction, c = t.height, l = t.itemCount, m = t.itemSize, d = t.layout, f = t.width, A = i === "horizontal" || d === "horizontal", v = n * m, g = A ? f : c, T = Math.ceil((g + s - v) / m);
|
|
1057
|
+
return Math.max(0, Math.min(
|
|
1058
|
+
l - 1,
|
|
1059
|
+
n + T - 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 rs(e) {
|
|
1071
|
+
var t = e.lastRenderedStartIndex, n = e.lastRenderedStopIndex, s = e.startIndex, i = e.stopIndex;
|
|
1072
|
+
return !(s > n || i < t);
|
|
1073
|
+
}
|
|
1074
|
+
function os(e) {
|
|
1075
|
+
for (var t = e.isItemLoaded, n = e.itemCount, s = e.minimumBatchSize, i = e.startIndex, c = e.stopIndex, l = [], m = null, d = null, f = i; 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 + s - 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 < s && l[0] > 0; ) {
|
|
1086
|
+
var T = l[0] - 1;
|
|
1087
|
+
if (!t(T))
|
|
1088
|
+
l[0] = T;
|
|
1089
|
+
else
|
|
1090
|
+
break;
|
|
1091
|
+
}
|
|
1092
|
+
return l;
|
|
1093
|
+
}
|
|
1094
|
+
var as = function(e, t) {
|
|
1095
|
+
if (!(e instanceof t))
|
|
1096
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1097
|
+
}, ls = function() {
|
|
1098
|
+
function e(t, n) {
|
|
1099
|
+
for (var s = 0; s < n.length; s++) {
|
|
1100
|
+
var i = n[s];
|
|
1101
|
+
i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(t, i.key, i);
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
return function(t, n, s) {
|
|
1105
|
+
return n && e(t.prototype, n), s && e(t, s), t;
|
|
1106
|
+
};
|
|
1107
|
+
}(), cs = 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
|
+
}, ds = function(e) {
|
|
1123
|
+
cs(t, e);
|
|
1124
|
+
function t() {
|
|
1125
|
+
var n, s, i, c;
|
|
1126
|
+
as(this, t);
|
|
1127
|
+
for (var l = arguments.length, m = Array(l), d = 0; d < l; d++)
|
|
1128
|
+
m[d] = arguments[d];
|
|
1129
|
+
return c = (s = (i = Ae(this, (n = t.__proto__ || Object.getPrototypeOf(t)).call.apply(n, [this].concat(m))), i), i._lastRenderedStartIndex = -1, i._lastRenderedStopIndex = -1, i._memoizedUnloadedRanges = [], i._onItemsRendered = function(f) {
|
|
1130
|
+
var A = f.visibleStartIndex, v = f.visibleStopIndex;
|
|
1131
|
+
i._lastRenderedStartIndex = A, i._lastRenderedStopIndex = v, i._ensureRowsLoaded(A, v);
|
|
1132
|
+
}, i._setRef = function(f) {
|
|
1133
|
+
i._listRef = f;
|
|
1134
|
+
}, s), Ae(i, c);
|
|
1135
|
+
}
|
|
1136
|
+
return ls(t, [{
|
|
1137
|
+
key: "resetloadMoreItemsCache",
|
|
1138
|
+
value: function() {
|
|
1139
|
+
var s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
|
|
1140
|
+
this._memoizedUnloadedRanges = [], s && this._ensureRowsLoaded(this._lastRenderedStartIndex, this._lastRenderedStopIndex);
|
|
1141
|
+
}
|
|
1142
|
+
}, {
|
|
1143
|
+
key: "componentDidMount",
|
|
1144
|
+
value: function() {
|
|
1145
|
+
}
|
|
1146
|
+
}, {
|
|
1147
|
+
key: "render",
|
|
1148
|
+
value: function() {
|
|
1149
|
+
var s = this.props.children;
|
|
1150
|
+
return s({
|
|
1151
|
+
onItemsRendered: this._onItemsRendered,
|
|
1152
|
+
ref: this._setRef
|
|
1153
|
+
});
|
|
1154
|
+
}
|
|
1155
|
+
}, {
|
|
1156
|
+
key: "_ensureRowsLoaded",
|
|
1157
|
+
value: function(s, i) {
|
|
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 = os({
|
|
1159
|
+
isItemLoaded: l,
|
|
1160
|
+
itemCount: m,
|
|
1161
|
+
minimumBatchSize: f,
|
|
1162
|
+
startIndex: Math.max(0, s - v),
|
|
1163
|
+
stopIndex: Math.min(m - 1, i + v)
|
|
1164
|
+
});
|
|
1165
|
+
(this._memoizedUnloadedRanges.length !== g.length || this._memoizedUnloadedRanges.some(function(T, D) {
|
|
1166
|
+
return g[D] !== T;
|
|
1167
|
+
})) && (this._memoizedUnloadedRanges = g, this._loadUnloadedRanges(g));
|
|
1168
|
+
}
|
|
1169
|
+
}, {
|
|
1170
|
+
key: "_loadUnloadedRanges",
|
|
1171
|
+
value: function(s) {
|
|
1172
|
+
for (var i = this, c = this.props.loadMoreItems || this.props.loadMoreRows, l = function(f) {
|
|
1173
|
+
var A = s[f], v = s[f + 1], g = c(A, v);
|
|
1174
|
+
g != null && g.then(function() {
|
|
1175
|
+
if (rs({
|
|
1176
|
+
lastRenderedStartIndex: i._lastRenderedStartIndex,
|
|
1177
|
+
lastRenderedStopIndex: i._lastRenderedStopIndex,
|
|
1178
|
+
startIndex: A,
|
|
1179
|
+
stopIndex: v
|
|
1180
|
+
})) {
|
|
1181
|
+
if (i._listRef == null)
|
|
1182
|
+
return;
|
|
1183
|
+
typeof i._listRef.resetAfterIndex == "function" ? i._listRef.resetAfterIndex(A, !0) : (typeof i._listRef._getItemStyleCache == "function" && i._listRef._getItemStyleCache(-1), i._listRef.forceUpdate());
|
|
1184
|
+
}
|
|
1185
|
+
});
|
|
1186
|
+
}, m = 0; m < s.length; m += 2)
|
|
1187
|
+
l(m);
|
|
1188
|
+
}
|
|
1189
|
+
}]), t;
|
|
1190
|
+
}(je);
|
|
1191
|
+
const us = /* @__PURE__ */ a("div")({
|
|
1192
|
+
name: "Container",
|
|
1193
|
+
class: "culdu4a",
|
|
1194
|
+
propsAsIs: !1
|
|
1195
|
+
}), ps = /* @__PURE__ */ a("div")({
|
|
1196
|
+
name: "Position",
|
|
1197
|
+
class: "pwf8e69",
|
|
1198
|
+
propsAsIs: !1
|
|
1199
|
+
}), ms = /* @__PURE__ */ a("img")({
|
|
1200
|
+
name: "Avatar",
|
|
1201
|
+
class: "atf4yh4",
|
|
1202
|
+
propsAsIs: !1
|
|
1203
|
+
}), hs = /* @__PURE__ */ a("div")({
|
|
1204
|
+
name: "AvatarPlaceholder",
|
|
1205
|
+
class: "a1dg29ja",
|
|
1206
|
+
propsAsIs: !1
|
|
1207
|
+
}), Is = /* @__PURE__ */ a("div")({
|
|
1208
|
+
name: "Content",
|
|
1209
|
+
class: "c10a68rc",
|
|
1210
|
+
propsAsIs: !1
|
|
1211
|
+
}), fs = /* @__PURE__ */ a("div")({
|
|
1212
|
+
name: "NameContainer",
|
|
1213
|
+
class: "nc4kck5",
|
|
1214
|
+
propsAsIs: !1
|
|
1215
|
+
}), gs = /* @__PURE__ */ a("span")({
|
|
1216
|
+
name: "Name",
|
|
1217
|
+
class: "njsrqgr",
|
|
1218
|
+
propsAsIs: !1
|
|
1219
|
+
}), Ms = () => j, vs = /* @__PURE__ */ a(Ms())({
|
|
1220
|
+
name: "CurrentUserBadge",
|
|
1221
|
+
class: "c17uc4zr",
|
|
1222
|
+
propsAsIs: !0
|
|
1223
|
+
}), ys = ({
|
|
1224
|
+
rank: e,
|
|
1225
|
+
avatar: t,
|
|
1226
|
+
name: n,
|
|
1227
|
+
points: s,
|
|
1228
|
+
isCurrentUser: i,
|
|
1229
|
+
openItemDetail: c,
|
|
1230
|
+
style: l
|
|
1231
|
+
}) => /* @__PURE__ */ I(us, { onClick: c, style: l, children: [
|
|
1232
|
+
/* @__PURE__ */ r(ps, { children: e || 0 }),
|
|
1233
|
+
/* @__PURE__ */ I(Is, { children: [
|
|
1234
|
+
t ? /* @__PURE__ */ r(ms, { alt: "leaderboard-item-avatar", src: t }) : /* @__PURE__ */ r(hs, { children: Se(n || "") }),
|
|
1235
|
+
/* @__PURE__ */ I(fs, { children: [
|
|
1236
|
+
/* @__PURE__ */ r(gs, { children: n || "" }),
|
|
1237
|
+
i && /* @__PURE__ */ r(vs, { name: "icon-star" })
|
|
1238
|
+
] })
|
|
1239
|
+
] }),
|
|
1240
|
+
/* @__PURE__ */ r("div", { children: ze(s) })
|
|
1241
|
+
] }), Ns = ({
|
|
1242
|
+
items: e,
|
|
1243
|
+
currentUserId: t,
|
|
1244
|
+
openItemDetail: n,
|
|
1245
|
+
fetchMore: s
|
|
1246
|
+
}) => /* @__PURE__ */ r(Be, { children: ({ width: i, height: c }) => /* @__PURE__ */ r(
|
|
1247
|
+
ds,
|
|
1248
|
+
{
|
|
1249
|
+
isItemLoaded: (l) => l < e.length,
|
|
1250
|
+
itemCount: e.length + 1,
|
|
1251
|
+
loadMoreItems: s,
|
|
1252
|
+
children: ({ onItemsRendered: l, ref: m }) => /* @__PURE__ */ r(
|
|
1253
|
+
is,
|
|
1254
|
+
{
|
|
1255
|
+
itemSize: 56,
|
|
1256
|
+
onItemsRendered: l,
|
|
1257
|
+
ref: m,
|
|
1258
|
+
itemCount: e.length,
|
|
1259
|
+
width: i,
|
|
1260
|
+
height: c,
|
|
1261
|
+
children: ({ index: d, style: f }) => /* @__PURE__ */ r(
|
|
1262
|
+
ys,
|
|
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
|
+
) }), As = ({ deepLink: e }) => {
|
|
1275
|
+
const { data: t } = w(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
|
+
}, Ts = ({ gamification: e }) => {
|
|
1297
|
+
const { data: t } = w(e.leaderboardList.$store);
|
|
1298
|
+
return t != null && t.length ? /* @__PURE__ */ r(
|
|
1299
|
+
Ns,
|
|
1300
|
+
{
|
|
1301
|
+
fetchMore: e.leaderboardList.fetchMore,
|
|
1302
|
+
items: t,
|
|
1303
|
+
openItemDetail: e.openUser,
|
|
1304
|
+
currentUserId: e.currentUserId.get()
|
|
1305
|
+
}
|
|
1306
|
+
) : /* @__PURE__ */ r(As, { deepLink: e.deepLink });
|
|
1307
|
+
}, Ds = /* @__PURE__ */ a("div")({
|
|
1308
|
+
name: "QuestionItem",
|
|
1309
|
+
class: "q1w97g3p",
|
|
1310
|
+
propsAsIs: !1
|
|
1311
|
+
}), Ss = /* @__PURE__ */ a("div")({
|
|
1312
|
+
name: "QuestionCaption",
|
|
1313
|
+
class: "q2sl39u",
|
|
1314
|
+
propsAsIs: !1
|
|
1315
|
+
}), zs = /* @__PURE__ */ a("div")({
|
|
1316
|
+
name: "QuestionBody",
|
|
1317
|
+
class: "qd5h0uc",
|
|
1318
|
+
propsAsIs: !1
|
|
1319
|
+
}), xs = /* @__PURE__ */ a("div")({
|
|
1320
|
+
name: "QuestionAction",
|
|
1321
|
+
class: "q105uluy",
|
|
1322
|
+
propsAsIs: !1
|
|
1323
|
+
}), js = () => j, X = /* @__PURE__ */ a(js())({
|
|
1324
|
+
name: "QuestionActionIcon",
|
|
1325
|
+
class: "q1fa0b9h",
|
|
1326
|
+
propsAsIs: !0
|
|
1327
|
+
}), ks = () => j, Os = /* @__PURE__ */ a(ks())({
|
|
1328
|
+
name: "QuestionTypeIcon",
|
|
1329
|
+
class: "qxlt78s",
|
|
1330
|
+
propsAsIs: !0
|
|
1331
|
+
}), ws = /* @__PURE__ */ a("div")({
|
|
1332
|
+
name: "QuestionTypeLabel",
|
|
1333
|
+
class: "qmg0vkx",
|
|
1334
|
+
propsAsIs: !1
|
|
1335
|
+
}), Cs = /* @__PURE__ */ a("div")({
|
|
1336
|
+
name: "QuestionContent",
|
|
1337
|
+
class: "q1uz5j1g",
|
|
1338
|
+
propsAsIs: !1
|
|
1339
|
+
}), bs = {
|
|
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
|
+
}, $s = ({
|
|
1345
|
+
questionId: e,
|
|
1346
|
+
questionType: t,
|
|
1347
|
+
questionStatus: n,
|
|
1348
|
+
subject: s,
|
|
1349
|
+
openForVoting: i,
|
|
1350
|
+
openQuestion: c,
|
|
1351
|
+
status: l
|
|
1352
|
+
}) => {
|
|
1353
|
+
const m = De[t], d = bs[l];
|
|
1354
|
+
return m ? /* @__PURE__ */ I(Ds, { onClick: () => c == null ? void 0 : c(e), children: [
|
|
1355
|
+
/* @__PURE__ */ I(Cs, { children: [
|
|
1356
|
+
/* @__PURE__ */ I(Ss, { children: [
|
|
1357
|
+
/* @__PURE__ */ r(Os, { name: m.iconName }),
|
|
1358
|
+
/* @__PURE__ */ I(ws, { children: [
|
|
1359
|
+
m.label,
|
|
1360
|
+
t === x.TRIVIA && n === q.RESOLVED && " • Expired"
|
|
1361
|
+
] })
|
|
1362
|
+
] }),
|
|
1363
|
+
/* @__PURE__ */ r(zs, { children: s || "" })
|
|
1364
|
+
] }),
|
|
1365
|
+
/* @__PURE__ */ r(xs, { children: d || (i ? /* @__PURE__ */ r(Ge, { children: "Play" }) : null) })
|
|
1366
|
+
] }) : null;
|
|
1367
|
+
}, Es = /* @__PURE__ */ a("div")({
|
|
1368
|
+
name: "Container",
|
|
1369
|
+
class: "cll3md7",
|
|
1370
|
+
propsAsIs: !1
|
|
1371
|
+
}), Ls = /* @__PURE__ */ a("button")({
|
|
1372
|
+
name: "ActionBtn",
|
|
1373
|
+
class: "a10g1iik",
|
|
1374
|
+
propsAsIs: !1
|
|
1375
|
+
}), Rs = ({
|
|
1376
|
+
openInsight: e,
|
|
1377
|
+
questionId: t,
|
|
1378
|
+
...n
|
|
1379
|
+
}) => /* @__PURE__ */ I(Es, { children: [
|
|
1380
|
+
/* @__PURE__ */ r($e, { questionId: t, ...n }),
|
|
1381
|
+
e && /* @__PURE__ */ r(Ls, { onClick: () => e(t), children: "View Insight" })
|
|
1382
|
+
] }), Qs = /* @__PURE__ */ a("div")({
|
|
1383
|
+
name: "QuestionsContainer",
|
|
1384
|
+
class: "qvghv3l",
|
|
1385
|
+
propsAsIs: !1
|
|
1386
|
+
}), Us = ({ questions: e, openQuestion: t }) => /* @__PURE__ */ r(Qs, { children: e == null ? void 0 : e.map((n) => {
|
|
1387
|
+
var s, i;
|
|
1388
|
+
if (n.type === "question" && ((s = n.attributes) == null ? void 0 : s.attributes.case) === "question") {
|
|
1389
|
+
const c = n.attributes.attributes.value;
|
|
1390
|
+
return /* @__PURE__ */ r($s, { openQuestion: t, ...c }, c.questionId);
|
|
1391
|
+
}
|
|
1392
|
+
if (n.type === "insight" && ((i = n.attributes) == null ? void 0 : i.attributes.case) === "insight") {
|
|
1393
|
+
const c = n.attributes.attributes.value;
|
|
1394
|
+
return /* @__PURE__ */ r(Rs, { openInsight: t, ...c }, c.questionId);
|
|
1395
|
+
}
|
|
1396
|
+
return null;
|
|
1397
|
+
}) }), _s = ({ store: e, openQuestion: t }) => {
|
|
1398
|
+
const n = w(e);
|
|
1399
|
+
return n != null && n.data ? /* @__PURE__ */ r(Us, { openQuestion: t, questions: n.data }) : /* @__PURE__ */ r("div", { children: "wait questions..." });
|
|
1400
|
+
}, qs = ({ userSummary: e }) => {
|
|
1401
|
+
var t, n;
|
|
1402
|
+
const s = w(e.getStore());
|
|
1403
|
+
return (t = s.data) != null && t.summary ? /* @__PURE__ */ r(Oe, { ...s.data.summary, successRate: (n = s.data.percentage) == null ? void 0 : n.correct }) : /* @__PURE__ */ r("div", { children: "wait user..." });
|
|
1404
|
+
}, Ps = ({ gamification: e }) => {
|
|
1405
|
+
const [t, n] = R(_.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 === _.HOME && /* @__PURE__ */ r(qs, { userSummary: e.userSummary })
|
|
1410
|
+
] }),
|
|
1411
|
+
t === _.HOME && /* @__PURE__ */ r(Ze, { children: /* @__PURE__ */ r(_s, { openQuestion: e.openQuestion, store: e.feedList.getStore() }) }),
|
|
1412
|
+
t === _.LEADERBOARD && /* @__PURE__ */ r(ee, { style: { flex: "1 1 auto", paddingTop: 0, paddingBottom: 0 }, children: /* @__PURE__ */ r(Ts, { gamification: e }) })
|
|
1413
|
+
] });
|
|
1414
|
+
}, Ys = () => Je, Te = /* @__PURE__ */ a(Ys())({
|
|
1415
|
+
name: "OpenedContainer",
|
|
1416
|
+
class: "oar61gl",
|
|
1417
|
+
propsAsIs: !0
|
|
1418
|
+
}), Ws = /* @__PURE__ */ a("div")({
|
|
1419
|
+
name: "UserContainer",
|
|
1420
|
+
class: "u14zaal4",
|
|
1421
|
+
propsAsIs: !1
|
|
1422
|
+
}), Fs = ({
|
|
1423
|
+
correct: e,
|
|
1424
|
+
incorrect: t
|
|
1425
|
+
}) => {
|
|
1426
|
+
const n = e + t;
|
|
1427
|
+
return n === 0 ? 0 : Math.round(e / n * 100);
|
|
1428
|
+
}, Gs = ({
|
|
1429
|
+
gamification: e,
|
|
1430
|
+
className: t
|
|
1431
|
+
}) => {
|
|
1432
|
+
const n = w(e.openedQuestion.$store), s = w(e.openedUser);
|
|
1433
|
+
return /* @__PURE__ */ I(E, {
|
|
1434
|
+
children: [n && /* @__PURE__ */ r(Te, {
|
|
1435
|
+
className: t,
|
|
1436
|
+
children: /* @__PURE__ */ r(Yn, {
|
|
1437
|
+
gamification: e
|
|
1438
|
+
})
|
|
1439
|
+
}), s && /* @__PURE__ */ r(Te, {
|
|
1440
|
+
className: t,
|
|
1441
|
+
children: /* @__PURE__ */ I(Ws, {
|
|
1442
|
+
children: [/* @__PURE__ */ r(ke, {
|
|
1443
|
+
label: "Friend's Rank",
|
|
1444
|
+
close: e.closeUser
|
|
1445
|
+
}), /* @__PURE__ */ r(ee, {
|
|
1446
|
+
children: /* @__PURE__ */ r(Oe, {
|
|
1447
|
+
...s,
|
|
1448
|
+
successRate: Fs(s)
|
|
1449
|
+
})
|
|
1450
|
+
})]
|
|
1451
|
+
})
|
|
1452
|
+
}), /* @__PURE__ */ r(xe, {
|
|
1453
|
+
className: t,
|
|
1454
|
+
"data-nav": "true",
|
|
1455
|
+
children: /* @__PURE__ */ r(Ps, {
|
|
1456
|
+
gamification: e
|
|
1457
|
+
})
|
|
1458
|
+
})]
|
|
1459
|
+
});
|
|
1460
|
+
};
|
|
1461
|
+
export {
|
|
1462
|
+
Gs as default
|
|
1463
|
+
};
|