@streamlayer/react 0.28.5 → 0.29.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/cjs/masters.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/common-2d2a3ba3.js +15 -0
- package/lib/common-f34b9d88.cjs +1 -0
- package/lib/dist/cjs/masters.js +1 -0
- package/lib/dist/cjs/package.json +1 -0
- package/lib/dist/es/masters.js +9 -0
- package/lib/dist/es/package.json +1 -0
- package/lib/dist/index-990a941f.cjs +1 -0
- package/lib/dist/index-fb783640.js +1565 -0
- package/lib/dist/index.d.ts +1530 -0
- package/lib/dist/masters-228cfe7f.cjs +29 -0
- package/lib/dist/masters-6908212b.js +20057 -0
- package/lib/dist/style.css +140 -0
- package/lib/es/masters.js +1 -1
- package/lib/es/points.js +1 -1
- package/lib/{index-5beb8b30.js → index-7a48e98e.js} +909 -933
- package/lib/index-9fd382fe.cjs +6 -0
- package/lib/{masters-0748e717.js → masters-aed3ad5f.js} +1 -1
- package/lib/{masters-13b0f21d.cjs → masters-b1364fa3.cjs} +1 -1
- package/lib/masters.d.ts +4 -0
- package/lib/style.css +1 -1
- package/package.json +5 -5
- package/lib/common-0311b835.js +0 -5
- package/lib/common-dc2f2d4f.cjs +0 -1
- package/lib/index-a4c9d828.cjs +0 -6
|
@@ -0,0 +1,1565 @@
|
|
|
1
|
+
import { jsxs as N, jsx as a, Fragment as H } from "react/jsx-runtime";
|
|
2
|
+
import { s as o, e as w, o as Oe, a as Ee, i as ke, Q as x, b as L, c as re, E as C, r as be, d as Ze, f as Je, n as Ke, w as Xe, u as b, g as et, P, h as je, j as de, k as tt } from "./masters-6908212b.js";
|
|
3
|
+
import U, { useRef as k, useState as R, useCallback as B, useEffect as st, useLayoutEffect as nt, useMemo as F, Component as it, createElement as V, PureComponent as Le } from "react";
|
|
4
|
+
const rt = () => w, at = () => w, ot = /* @__PURE__ */ o("div")({
|
|
5
|
+
name: "a",
|
|
6
|
+
class: "acysrl1",
|
|
7
|
+
propsAsIs: !1
|
|
8
|
+
}), lt = /* @__PURE__ */ o("div")({
|
|
9
|
+
name: "l",
|
|
10
|
+
class: "lo57cjm",
|
|
11
|
+
propsAsIs: !1
|
|
12
|
+
}), ct = /* @__PURE__ */ o(rt())({
|
|
13
|
+
name: "p",
|
|
14
|
+
class: "p14kwh4y",
|
|
15
|
+
propsAsIs: !0
|
|
16
|
+
}), dt = /* @__PURE__ */ o("span")({
|
|
17
|
+
name: "s",
|
|
18
|
+
class: "sxun7sq",
|
|
19
|
+
propsAsIs: !1
|
|
20
|
+
}), ut = /* @__PURE__ */ o("button")({
|
|
21
|
+
name: "c",
|
|
22
|
+
class: "c1i8ida8",
|
|
23
|
+
propsAsIs: !1
|
|
24
|
+
}), pt = /* @__PURE__ */ o(at())({
|
|
25
|
+
name: "g",
|
|
26
|
+
class: "g1m0xfmw",
|
|
27
|
+
propsAsIs: !0
|
|
28
|
+
}), Ce = ({ type: t, close: e, label: s }) => {
|
|
29
|
+
const n = t ? Oe[t] : { label: s, iconName: void 0 };
|
|
30
|
+
return /* @__PURE__ */ N(ot, { children: [
|
|
31
|
+
/* @__PURE__ */ N(lt, { children: [
|
|
32
|
+
(n == null ? void 0 : n.iconName) && /* @__PURE__ */ a(ct, { name: n.iconName }),
|
|
33
|
+
(n == null ? void 0 : n.label) && /* @__PURE__ */ a(dt, { children: n.label })
|
|
34
|
+
] }),
|
|
35
|
+
/* @__PURE__ */ a(ut, { onClick: e, children: /* @__PURE__ */ a(pt, { name: "icon-cross" }) })
|
|
36
|
+
] });
|
|
37
|
+
};
|
|
38
|
+
const ht = /* @__PURE__ */ o("div")({
|
|
39
|
+
name: "t",
|
|
40
|
+
class: "taj61ja",
|
|
41
|
+
propsAsIs: !1
|
|
42
|
+
}), mt = /* @__PURE__ */ o("div")({
|
|
43
|
+
name: "r",
|
|
44
|
+
class: "r19fxewd",
|
|
45
|
+
propsAsIs: !1
|
|
46
|
+
}), ft = /* @__PURE__ */ o("div")({
|
|
47
|
+
name: "i",
|
|
48
|
+
class: "i1whkbqh",
|
|
49
|
+
propsAsIs: !1
|
|
50
|
+
}), ue = ({ indicator: t, title: e }) => /* @__PURE__ */ N(ht, { children: [
|
|
51
|
+
/* @__PURE__ */ a(mt, { children: e }),
|
|
52
|
+
/* @__PURE__ */ a(ft, { children: t })
|
|
53
|
+
] });
|
|
54
|
+
const gt = /* @__PURE__ */ o("div")({
|
|
55
|
+
name: "i",
|
|
56
|
+
class: "i4lbhzs",
|
|
57
|
+
propsAsIs: !1
|
|
58
|
+
}), It = /* @__PURE__ */ o("div")({
|
|
59
|
+
name: "o",
|
|
60
|
+
class: "ordquhq",
|
|
61
|
+
propsAsIs: !1
|
|
62
|
+
}), vt = /* @__PURE__ */ o("div")({
|
|
63
|
+
name: "n",
|
|
64
|
+
class: "nwzed99",
|
|
65
|
+
propsAsIs: !1
|
|
66
|
+
}), W = ({ indicator: t, title: e }) => /* @__PURE__ */ N(gt, { children: [
|
|
67
|
+
/* @__PURE__ */ a(It, { children: t }),
|
|
68
|
+
/* @__PURE__ */ a(vt, { children: e })
|
|
69
|
+
] });
|
|
70
|
+
const Mt = /* @__PURE__ */ o("div")({
|
|
71
|
+
name: "o",
|
|
72
|
+
class: "o15y0waw",
|
|
73
|
+
propsAsIs: !1
|
|
74
|
+
}), yt = /* @__PURE__ */ o("div")({
|
|
75
|
+
name: "i",
|
|
76
|
+
class: "ihjewwf",
|
|
77
|
+
propsAsIs: !1
|
|
78
|
+
}), Nt = /* @__PURE__ */ o("div")({
|
|
79
|
+
name: "n",
|
|
80
|
+
class: "n10e9lv8",
|
|
81
|
+
propsAsIs: !1
|
|
82
|
+
}), zt = /* @__PURE__ */ o("div")({
|
|
83
|
+
name: "r",
|
|
84
|
+
class: "r13bxv",
|
|
85
|
+
propsAsIs: !1
|
|
86
|
+
}), _t = /* @__PURE__ */ o("img")({
|
|
87
|
+
name: "a",
|
|
88
|
+
class: "a1fi59c9",
|
|
89
|
+
propsAsIs: !1
|
|
90
|
+
}), Tt = /* @__PURE__ */ o("div")({
|
|
91
|
+
name: "s",
|
|
92
|
+
class: "s1kkihge",
|
|
93
|
+
propsAsIs: !1
|
|
94
|
+
}), At = /* @__PURE__ */ o("div")({
|
|
95
|
+
name: "c",
|
|
96
|
+
class: "cy4f4t",
|
|
97
|
+
propsAsIs: !1
|
|
98
|
+
}), St = /* @__PURE__ */ o("div")({
|
|
99
|
+
name: "p",
|
|
100
|
+
class: "p18cnlx1",
|
|
101
|
+
propsAsIs: !1
|
|
102
|
+
}), Dt = /* @__PURE__ */ o("img")({
|
|
103
|
+
name: "l",
|
|
104
|
+
class: "lboqgs5",
|
|
105
|
+
propsAsIs: !1
|
|
106
|
+
}), xt = /* @__PURE__ */ o("div")({
|
|
107
|
+
name: "d",
|
|
108
|
+
class: "d1oaal4",
|
|
109
|
+
propsAsIs: !1
|
|
110
|
+
}), wt = /* @__PURE__ */ o("div")({
|
|
111
|
+
name: "x",
|
|
112
|
+
class: "x1yzgo0u",
|
|
113
|
+
propsAsIs: !1
|
|
114
|
+
}), Ot = /* @__PURE__ */ o("div")({
|
|
115
|
+
name: "f",
|
|
116
|
+
class: "f1l9i8s8",
|
|
117
|
+
propsAsIs: !1
|
|
118
|
+
}), Et = /* @__PURE__ */ o("div")({
|
|
119
|
+
name: "g",
|
|
120
|
+
class: "g4cgl4u",
|
|
121
|
+
propsAsIs: !1
|
|
122
|
+
}), kt = /* @__PURE__ */ o("div")({
|
|
123
|
+
name: "h",
|
|
124
|
+
class: "h1qn1tmd",
|
|
125
|
+
propsAsIs: !1
|
|
126
|
+
}), bt = /* @__PURE__ */ o("div")({
|
|
127
|
+
name: "u",
|
|
128
|
+
class: "u1gsbhq4",
|
|
129
|
+
propsAsIs: !1
|
|
130
|
+
}), jt = /* @__PURE__ */ o("div")({
|
|
131
|
+
name: "m",
|
|
132
|
+
class: "mvj8oco",
|
|
133
|
+
propsAsIs: !1
|
|
134
|
+
}), Lt = /* @__PURE__ */ o("button")({
|
|
135
|
+
name: "v",
|
|
136
|
+
class: "viqiaf2",
|
|
137
|
+
propsAsIs: !1
|
|
138
|
+
}), Ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=", Re = ({
|
|
139
|
+
avatar: t,
|
|
140
|
+
name: e,
|
|
141
|
+
points: s,
|
|
142
|
+
friendsRank: n,
|
|
143
|
+
rank: i,
|
|
144
|
+
streak: u,
|
|
145
|
+
correct: p,
|
|
146
|
+
incorrect: m,
|
|
147
|
+
inTop: f,
|
|
148
|
+
average: M
|
|
149
|
+
}) => /* @__PURE__ */ N(Mt, { children: [
|
|
150
|
+
/* @__PURE__ */ a(yt, { children: /* @__PURE__ */ N(zt, { children: [
|
|
151
|
+
/* @__PURE__ */ N(Lt, { children: [
|
|
152
|
+
t && /* @__PURE__ */ a(_t, { alt: "avatar", src: t }),
|
|
153
|
+
!t && /* @__PURE__ */ a(jt, { children: Ee(e || "") })
|
|
154
|
+
] }),
|
|
155
|
+
/* @__PURE__ */ N(Tt, { children: [
|
|
156
|
+
/* @__PURE__ */ a(At, { children: e }),
|
|
157
|
+
/* @__PURE__ */ N(St, { children: [
|
|
158
|
+
/* @__PURE__ */ N(xt, { children: [
|
|
159
|
+
/* @__PURE__ */ a(Dt, { alt: "rank-icon", src: Ct }),
|
|
160
|
+
/* @__PURE__ */ N(wt, { children: [
|
|
161
|
+
ke(s),
|
|
162
|
+
/* @__PURE__ */ a(Ot, { children: "PTS" })
|
|
163
|
+
] })
|
|
164
|
+
] }),
|
|
165
|
+
/* @__PURE__ */ a(Et, {}),
|
|
166
|
+
/* @__PURE__ */ N("div", { children: [
|
|
167
|
+
"TOP ",
|
|
168
|
+
f || 0,
|
|
169
|
+
"%"
|
|
170
|
+
] })
|
|
171
|
+
] })
|
|
172
|
+
] })
|
|
173
|
+
] }) }),
|
|
174
|
+
/* @__PURE__ */ N(Nt, { children: [
|
|
175
|
+
/* @__PURE__ */ N(kt, { children: [
|
|
176
|
+
/* @__PURE__ */ a(ue, { indicator: n || 0, title: "Friends rank" }),
|
|
177
|
+
/* @__PURE__ */ a(ue, { indicator: i || 0, title: "Global rank" })
|
|
178
|
+
] }),
|
|
179
|
+
/* @__PURE__ */ N(bt, { children: [
|
|
180
|
+
/* @__PURE__ */ a(W, { indicator: u || 0, title: "Win streak" }),
|
|
181
|
+
/* @__PURE__ */ a(W, { indicator: p || 0, title: "Correct" }),
|
|
182
|
+
/* @__PURE__ */ a(W, { indicator: m || 0, title: "Incorrect" }),
|
|
183
|
+
/* @__PURE__ */ a(W, { indicator: `${M || 0}%`, title: "Succ. rate" })
|
|
184
|
+
] })
|
|
185
|
+
] })
|
|
186
|
+
] });
|
|
187
|
+
const Rt = () => w, $t = /* @__PURE__ */ o("div")({
|
|
188
|
+
name: "c",
|
|
189
|
+
class: "ciyeb68",
|
|
190
|
+
propsAsIs: !1
|
|
191
|
+
}), Ut = /* @__PURE__ */ o(Rt())({
|
|
192
|
+
name: "n",
|
|
193
|
+
class: "nfic4xc",
|
|
194
|
+
propsAsIs: !0
|
|
195
|
+
}), Qt = /* @__PURE__ */ o("div")({
|
|
196
|
+
name: "d",
|
|
197
|
+
class: "d1pd1p66",
|
|
198
|
+
propsAsIs: !1
|
|
199
|
+
}), qt = /* @__PURE__ */ o("div")({
|
|
200
|
+
name: "p",
|
|
201
|
+
class: "p132yxcv",
|
|
202
|
+
propsAsIs: !1
|
|
203
|
+
}), Yt = /* @__PURE__ */ o("span")({
|
|
204
|
+
name: "l",
|
|
205
|
+
class: "l4a8aw",
|
|
206
|
+
propsAsIs: !1
|
|
207
|
+
}), pe = /* @__PURE__ */ o("span")({
|
|
208
|
+
name: "g",
|
|
209
|
+
class: "gzdx7pk",
|
|
210
|
+
propsAsIs: !1
|
|
211
|
+
}), Pt = ({
|
|
212
|
+
feedbackMessages: t,
|
|
213
|
+
questionVotedCorrectly: e,
|
|
214
|
+
questionVoted: s,
|
|
215
|
+
questionType: n,
|
|
216
|
+
hasCorrectAnswer: i
|
|
217
|
+
}) => {
|
|
218
|
+
if (!(s && (n === x.TRIVIA || n === x.PREDICTION)))
|
|
219
|
+
return null;
|
|
220
|
+
const u = n === x.PREDICTION && !i, p = e ? "correct" : "incorrect", m = e ? t.correctFeedback : t.incorrectFeedback;
|
|
221
|
+
return /* @__PURE__ */ N($t, { "data-isPrediction": u, children: [
|
|
222
|
+
u && /* @__PURE__ */ N(H, { children: [
|
|
223
|
+
/* @__PURE__ */ a(Ut, { name: "icon-prediction" }),
|
|
224
|
+
/* @__PURE__ */ a(pe, { children: "Stay tuned to see if your prediction was correct." })
|
|
225
|
+
] }),
|
|
226
|
+
i && /* @__PURE__ */ N(H, { children: [
|
|
227
|
+
/* @__PURE__ */ a(Qt, { "data-feedbackType": p, children: /* @__PURE__ */ a(w, { name: p }) }),
|
|
228
|
+
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ N(qt, { children: [
|
|
229
|
+
/* @__PURE__ */ a(Yt, { "data-feedbackType": p, children: m == null ? void 0 : m.title }),
|
|
230
|
+
/* @__PURE__ */ a(pe, { children: m == null ? void 0 : m.description })
|
|
231
|
+
] }) })
|
|
232
|
+
] })
|
|
233
|
+
] });
|
|
234
|
+
};
|
|
235
|
+
const Wt = /* @__PURE__ */ o("div")({
|
|
236
|
+
name: "o",
|
|
237
|
+
class: "olc1eph",
|
|
238
|
+
propsAsIs: !1
|
|
239
|
+
}), Ft = /* @__PURE__ */ o("div")({
|
|
240
|
+
name: "n",
|
|
241
|
+
class: "n1yoh29a",
|
|
242
|
+
propsAsIs: !1
|
|
243
|
+
}), Vt = /* @__PURE__ */ o("div")({
|
|
244
|
+
name: "p",
|
|
245
|
+
class: "pjkr5mb",
|
|
246
|
+
propsAsIs: !1
|
|
247
|
+
}), Ht = /* @__PURE__ */ o("div")({
|
|
248
|
+
name: "r",
|
|
249
|
+
class: "r82wnnx",
|
|
250
|
+
propsAsIs: !1
|
|
251
|
+
});
|
|
252
|
+
const Bt = () => $e, Gt = () => $e, Zt = () => w, Jt = /* @__PURE__ */ o("button")({
|
|
253
|
+
name: "c",
|
|
254
|
+
class: "cpm4u8k",
|
|
255
|
+
propsAsIs: !1
|
|
256
|
+
}), Kt = /* @__PURE__ */ o("div")({
|
|
257
|
+
name: "l",
|
|
258
|
+
class: "lwfomc3",
|
|
259
|
+
propsAsIs: !1
|
|
260
|
+
}), Xt = /* @__PURE__ */ o("span")({
|
|
261
|
+
name: "d",
|
|
262
|
+
class: "dmltvg2",
|
|
263
|
+
propsAsIs: !1
|
|
264
|
+
}), es = /* @__PURE__ */ o("div")({
|
|
265
|
+
name: "s",
|
|
266
|
+
class: "stfjpqz",
|
|
267
|
+
propsAsIs: !1
|
|
268
|
+
}), ts = /* @__PURE__ */ o("div")({
|
|
269
|
+
name: "p",
|
|
270
|
+
class: "p198m24r",
|
|
271
|
+
propsAsIs: !1
|
|
272
|
+
}), $e = /* @__PURE__ */ o("img")({
|
|
273
|
+
name: "r",
|
|
274
|
+
class: "rbq5eu7",
|
|
275
|
+
propsAsIs: !1
|
|
276
|
+
}), ss = /* @__PURE__ */ o(Bt())({
|
|
277
|
+
name: "g",
|
|
278
|
+
class: "g1iv6oeb",
|
|
279
|
+
propsAsIs: !0
|
|
280
|
+
}), ns = /* @__PURE__ */ o(Gt())({
|
|
281
|
+
name: "h",
|
|
282
|
+
class: "h1qtxlqc",
|
|
283
|
+
propsAsIs: !0
|
|
284
|
+
}), is = /* @__PURE__ */ o("span")({
|
|
285
|
+
name: "u",
|
|
286
|
+
class: "udm736q",
|
|
287
|
+
propsAsIs: !1
|
|
288
|
+
}), rs = /* @__PURE__ */ o("span")({
|
|
289
|
+
name: "b",
|
|
290
|
+
class: "b1da34tx",
|
|
291
|
+
propsAsIs: !1
|
|
292
|
+
}), as = /* @__PURE__ */ o("span")({
|
|
293
|
+
name: "x",
|
|
294
|
+
class: "x1dqwq83",
|
|
295
|
+
propsAsIs: !1
|
|
296
|
+
}), os = /* @__PURE__ */ o(Zt())({
|
|
297
|
+
name: "v",
|
|
298
|
+
class: "v10s9my2",
|
|
299
|
+
propsAsIs: !0
|
|
300
|
+
}), he = {
|
|
301
|
+
[L.CENTERED]: (t) => /* @__PURE__ */ a(ss, { alt: "option-icon", src: t }),
|
|
302
|
+
[L.TRANSPARENT]: (t) => /* @__PURE__ */ a(es, { children: /* @__PURE__ */ a(ts, { style: { backgroundImage: `url(${t})` } }) }),
|
|
303
|
+
[L.ROUNDED]: (t) => /* @__PURE__ */ a(ns, { alt: "option-icon", src: t }),
|
|
304
|
+
[L.NONE]: () => null,
|
|
305
|
+
[L.UNSET]: () => null
|
|
306
|
+
}, ls = ({ questionType: t, hasCorrectAnswer: e, correct: s, youVoted: n, questionVoted: i }) => {
|
|
307
|
+
if (t === x.POLL && n)
|
|
308
|
+
return "correct";
|
|
309
|
+
if (t === x.PREDICTION) {
|
|
310
|
+
if (e && i)
|
|
311
|
+
return n ? s ? "correct" : "incorrect" : s ? "correct" : "unset";
|
|
312
|
+
if (n)
|
|
313
|
+
return "correct";
|
|
314
|
+
}
|
|
315
|
+
return t === x.TRIVIA && i ? n ? s ? "correct" : "incorrect" : s ? "correct" : "unset" : "unset";
|
|
316
|
+
}, cs = ({
|
|
317
|
+
questionType: t,
|
|
318
|
+
questionVoted: e,
|
|
319
|
+
correct: s,
|
|
320
|
+
hasCorrectAnswer: n,
|
|
321
|
+
questionStatus: i
|
|
322
|
+
}) => t === x.TRIVIA ? e && s : t === x.PREDICTION ? e && s && n || i === re.RESOLVED && s : !1, ds = (t) => {
|
|
323
|
+
var e;
|
|
324
|
+
const {
|
|
325
|
+
// option props
|
|
326
|
+
id: s,
|
|
327
|
+
icon: n,
|
|
328
|
+
text: i,
|
|
329
|
+
percentageDecimal: u,
|
|
330
|
+
// extra props
|
|
331
|
+
onVote: p,
|
|
332
|
+
youSelected: m,
|
|
333
|
+
questionVoted: f,
|
|
334
|
+
// ToDo: Figure out why imageMode is not in the response, and delete default value
|
|
335
|
+
imageMode: M = L.ROUNDED,
|
|
336
|
+
answerTimeExpired: z,
|
|
337
|
+
questionStatus: y,
|
|
338
|
+
isLoading: l,
|
|
339
|
+
questionType: v,
|
|
340
|
+
correct: I,
|
|
341
|
+
hasCorrectAnswer: r
|
|
342
|
+
} = t, h = ls(t), c = cs({ questionType: v, questionVoted: f, correct: I, hasCorrectAnswer: r, questionStatus: y }), d = f || y === re.RESOLVED && v === x.PREDICTION;
|
|
343
|
+
return /* @__PURE__ */ N(
|
|
344
|
+
Jt,
|
|
345
|
+
{
|
|
346
|
+
value: s,
|
|
347
|
+
"data-selected": m,
|
|
348
|
+
"data-answerState": h,
|
|
349
|
+
disabled: f || l || z,
|
|
350
|
+
onClick: p,
|
|
351
|
+
children: [
|
|
352
|
+
d && /* @__PURE__ */ a(Kt, { "data-answerState": h, style: { width: `${u}%` } }),
|
|
353
|
+
/* @__PURE__ */ N(Xt, { children: [
|
|
354
|
+
n && ((e = he[M]) == null ? void 0 : e.call(he, n)),
|
|
355
|
+
/* @__PURE__ */ a(is, { children: i }),
|
|
356
|
+
d && /* @__PURE__ */ N(rs, { children: [
|
|
357
|
+
c && /* @__PURE__ */ a(os, { name: "selected" }),
|
|
358
|
+
/* @__PURE__ */ N(as, { children: [
|
|
359
|
+
u,
|
|
360
|
+
"%"
|
|
361
|
+
] })
|
|
362
|
+
] })
|
|
363
|
+
] })
|
|
364
|
+
]
|
|
365
|
+
}
|
|
366
|
+
);
|
|
367
|
+
};
|
|
368
|
+
var me = typeof window > "u" ? st : nt, us = ({ isPlaying: t, duration: e, startAt: s = 0, updateInterval: n = 0, onComplete: i, onUpdate: u }) => {
|
|
369
|
+
let [p, m] = R(s), f = k(0), M = k(s), z = k(s * -1e3), y = k(null), l = k(null), v = k(null), I = (c) => {
|
|
370
|
+
let d = c / 1e3;
|
|
371
|
+
if (l.current === null) {
|
|
372
|
+
l.current = d, y.current = requestAnimationFrame(I);
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
let g = d - l.current, T = f.current + g;
|
|
376
|
+
l.current = d, f.current = T;
|
|
377
|
+
let _ = M.current + (n === 0 ? T : (T / n | 0) * n), A = M.current + T, S = typeof e == "number" && A >= e;
|
|
378
|
+
m(S ? e : _), S || (y.current = requestAnimationFrame(I));
|
|
379
|
+
}, r = () => {
|
|
380
|
+
y.current && cancelAnimationFrame(y.current), v.current && clearTimeout(v.current), l.current = null;
|
|
381
|
+
}, h = B((c) => {
|
|
382
|
+
r(), f.current = 0;
|
|
383
|
+
let d = typeof c == "number" ? c : s;
|
|
384
|
+
M.current = d, m(d), t && (y.current = requestAnimationFrame(I));
|
|
385
|
+
}, [t, s]);
|
|
386
|
+
return me(() => {
|
|
387
|
+
if (u == null || u(p), e && p >= e) {
|
|
388
|
+
z.current += e * 1e3;
|
|
389
|
+
let { shouldRepeat: c = !1, delay: d = 0, newStartAt: g } = (i == null ? void 0 : i(z.current / 1e3)) || {};
|
|
390
|
+
c && (v.current = setTimeout(() => h(g), d * 1e3));
|
|
391
|
+
}
|
|
392
|
+
}, [p, e]), me(() => (t && (y.current = requestAnimationFrame(I)), r), [t, e, n]), { elapsedTime: p, reset: h };
|
|
393
|
+
}, ps = (t, e, s) => {
|
|
394
|
+
let n = t / 2, i = e / 2, u = n - i, p = 2 * u, m = s === "clockwise" ? "1,0" : "0,1", f = 2 * Math.PI * u;
|
|
395
|
+
return { path: `m ${n},${i} a ${u},${u} 0 ${m} 0,${p} a ${u},${u} 0 ${m} 0,-${p}`, pathLength: f };
|
|
396
|
+
}, fe = (t, e) => t === 0 || t === e ? 0 : typeof e == "number" ? t - e : 0, hs = (t) => ({ position: "relative", width: t, height: t }), ms = { display: "flex", justifyContent: "center", alignItems: "center", position: "absolute", left: 0, top: 0, width: "100%", height: "100%" }, Ue = (t, e, s, n, i) => {
|
|
397
|
+
if (n === 0)
|
|
398
|
+
return e;
|
|
399
|
+
let u = (i ? n - t : t) / n;
|
|
400
|
+
return e + s * u;
|
|
401
|
+
}, ge = (t) => {
|
|
402
|
+
var e, s;
|
|
403
|
+
return (s = (e = t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (n, i, u, p) => `#${i}${i}${u}${u}${p}${p}`).substring(1).match(/.{2}/g)) == null ? void 0 : e.map((n) => parseInt(n, 16))) != null ? s : [];
|
|
404
|
+
}, fs = (t, e) => {
|
|
405
|
+
var s;
|
|
406
|
+
let { colors: n, colorsTime: i, isSmoothColorTransition: u = !0 } = t;
|
|
407
|
+
if (typeof n == "string")
|
|
408
|
+
return n;
|
|
409
|
+
let p = (s = i == null ? void 0 : i.findIndex((l, v) => l >= e && e >= i[v + 1])) != null ? s : -1;
|
|
410
|
+
if (!i || p === -1)
|
|
411
|
+
return n[0];
|
|
412
|
+
if (!u)
|
|
413
|
+
return n[p];
|
|
414
|
+
let m = i[p] - e, f = i[p] - i[p + 1], M = ge(n[p]), z = ge(n[p + 1]), y = !!t.isGrowing;
|
|
415
|
+
return `rgb(${M.map((l, v) => Ue(m, l, z[v] - l, f, y) | 0).join(",")})`;
|
|
416
|
+
}, gs = (t) => {
|
|
417
|
+
let { duration: e, initialRemainingTime: s, updateInterval: n, size: i = 180, strokeWidth: u = 12, trailStrokeWidth: p, isPlaying: m = !1, isGrowing: f = !1, rotation: M = "clockwise", onComplete: z, onUpdate: y } = t, l = k(), v = Math.max(u, p ?? 0), { path: I, pathLength: r } = ps(i, v, M), { elapsedTime: h } = us({ isPlaying: m, duration: e, startAt: fe(e, s), updateInterval: n, onUpdate: typeof y == "function" ? (d) => {
|
|
418
|
+
let g = Math.ceil(e - d);
|
|
419
|
+
g !== l.current && (l.current = g, y(g));
|
|
420
|
+
} : void 0, onComplete: typeof z == "function" ? (d) => {
|
|
421
|
+
var g;
|
|
422
|
+
let { shouldRepeat: T, delay: _, newInitialRemainingTime: A } = (g = z(d)) != null ? g : {};
|
|
423
|
+
if (T)
|
|
424
|
+
return { shouldRepeat: T, delay: _, newStartAt: fe(e, A) };
|
|
425
|
+
} : void 0 }), c = e - h;
|
|
426
|
+
return { elapsedTime: h, path: I, pathLength: r, remainingTime: Math.ceil(c), rotation: M, size: i, stroke: fs(t, c), strokeDashoffset: Ue(h, 0, r, e, f), strokeWidth: u };
|
|
427
|
+
}, Qe = (t) => {
|
|
428
|
+
let { children: e, strokeLinecap: s, trailColor: n, trailStrokeWidth: i } = t, { path: u, pathLength: p, stroke: m, strokeDashoffset: f, remainingTime: M, elapsedTime: z, size: y, strokeWidth: l } = gs(t);
|
|
429
|
+
return U.createElement("div", { style: hs(y) }, U.createElement("svg", { viewBox: `0 0 ${y} ${y}`, width: y, height: y, xmlns: "http://www.w3.org/2000/svg" }, U.createElement("path", { d: u, fill: "none", stroke: n ?? "#d9d9d9", strokeWidth: i ?? l }), U.createElement("path", { d: u, fill: "none", stroke: m, strokeLinecap: s ?? "round", strokeWidth: l, strokeDasharray: p, strokeDashoffset: f })), typeof e == "function" && U.createElement("div", { style: ms }, e({ remainingTime: M, elapsedTime: z, color: m })));
|
|
430
|
+
};
|
|
431
|
+
Qe.displayName = "CountdownCircleTimer";
|
|
432
|
+
const Is = [C.PRIMARY_GREEN1, C.SECONDARY_RED1, C.SECONDARY_RED1], vs = [10, 10, 0], Ms = /* @__PURE__ */ o("div")({
|
|
433
|
+
name: "A",
|
|
434
|
+
class: "a1f928zy",
|
|
435
|
+
propsAsIs: !1
|
|
436
|
+
}), ys = C.SECONDARY_GREEN6, Ie = C.SECONDARY_RED3, Ns = C.NEUTRALS_GRAY3, zs = ({
|
|
437
|
+
isPlaying: t = !0,
|
|
438
|
+
duration: e = 30,
|
|
439
|
+
onTimerExpired: s
|
|
440
|
+
}) => {
|
|
441
|
+
const [n, i] = R(e > 10 ? ys : Ie), u = ({
|
|
442
|
+
remainingTime: f
|
|
443
|
+
}) => /* @__PURE__ */ a(Ms, {
|
|
444
|
+
children: f
|
|
445
|
+
}), p = B(() => {
|
|
446
|
+
s == null || s(), i(Ns);
|
|
447
|
+
}, [s, i]), m = B((f) => {
|
|
448
|
+
f === 10 && i(Ie);
|
|
449
|
+
}, [i]);
|
|
450
|
+
return /* @__PURE__ */ a(Qe, {
|
|
451
|
+
isPlaying: t,
|
|
452
|
+
duration: e,
|
|
453
|
+
colors: Is,
|
|
454
|
+
colorsTime: vs,
|
|
455
|
+
size: 32,
|
|
456
|
+
strokeWidth: 2,
|
|
457
|
+
trailStrokeWidth: 2,
|
|
458
|
+
trailColor: n,
|
|
459
|
+
onComplete: p,
|
|
460
|
+
onUpdate: m,
|
|
461
|
+
children: u
|
|
462
|
+
});
|
|
463
|
+
};
|
|
464
|
+
const _s = () => w, Ts = /* @__PURE__ */ o("div")({
|
|
465
|
+
name: "a",
|
|
466
|
+
class: "a1r7f3z4",
|
|
467
|
+
propsAsIs: !1
|
|
468
|
+
}), As = /* @__PURE__ */ o("div")({
|
|
469
|
+
name: "s",
|
|
470
|
+
class: "sblndl",
|
|
471
|
+
propsAsIs: !1
|
|
472
|
+
}), Ss = /* @__PURE__ */ o("div")({
|
|
473
|
+
name: "l",
|
|
474
|
+
class: "l7ka1tv",
|
|
475
|
+
propsAsIs: !1
|
|
476
|
+
}), Ds = /* @__PURE__ */ o(_s())({
|
|
477
|
+
name: "p",
|
|
478
|
+
class: "p1edlxt3",
|
|
479
|
+
propsAsIs: !0
|
|
480
|
+
}), xs = /* @__PURE__ */ o("div")({
|
|
481
|
+
name: "g",
|
|
482
|
+
class: "ghm08u2",
|
|
483
|
+
propsAsIs: !1
|
|
484
|
+
}), ws = /* @__PURE__ */ o("span")({
|
|
485
|
+
name: "c",
|
|
486
|
+
class: "c12nsh46",
|
|
487
|
+
propsAsIs: !1
|
|
488
|
+
}), Os = /* @__PURE__ */ o("span")({
|
|
489
|
+
name: "d",
|
|
490
|
+
class: "dlr9eoc",
|
|
491
|
+
propsAsIs: !1
|
|
492
|
+
}), Es = ({ title: t, points: e, isPlayingTimer: s, isTimer: n, onTimerExpired: i }) => /* @__PURE__ */ N(Ts, { children: [
|
|
493
|
+
/* @__PURE__ */ N(As, { children: [
|
|
494
|
+
t && /* @__PURE__ */ a(Ss, { children: t }),
|
|
495
|
+
e !== void 0 && /* @__PURE__ */ N(H, { children: [
|
|
496
|
+
/* @__PURE__ */ a(Ds, { name: "icon-trophy" }),
|
|
497
|
+
/* @__PURE__ */ N(xs, { children: [
|
|
498
|
+
/* @__PURE__ */ a(ws, { children: e }),
|
|
499
|
+
/* @__PURE__ */ a(Os, { children: "PTS" })
|
|
500
|
+
] })
|
|
501
|
+
] })
|
|
502
|
+
] }),
|
|
503
|
+
n && /* @__PURE__ */ a(zs, { isPlaying: s, onTimerExpired: i })
|
|
504
|
+
] }), ks = ({ openedQuestion: t, vote: e }) => {
|
|
505
|
+
var s;
|
|
506
|
+
const n = t.subject, i = t.type, u = (s = t.options) == null ? void 0 : s.options, [p, m] = R(!1), [f, M] = R(!1), [z, y] = R(""), l = t == null ? void 0 : t.id, v = B(
|
|
507
|
+
async (d) => {
|
|
508
|
+
if (l) {
|
|
509
|
+
const g = d.currentTarget.value;
|
|
510
|
+
y(g), M(!0), await e(l, g), M(!1);
|
|
511
|
+
}
|
|
512
|
+
},
|
|
513
|
+
[l, y, e]
|
|
514
|
+
), I = F(
|
|
515
|
+
() => t == null ? void 0 : t.answers.find((d) => d.youVoted === !0),
|
|
516
|
+
[t]
|
|
517
|
+
), r = F(
|
|
518
|
+
() => !!(t != null && t.answers.find((d) => d.correct === !0)),
|
|
519
|
+
[t]
|
|
520
|
+
), h = F(() => t ? t.answers.map((d) => ({
|
|
521
|
+
...d,
|
|
522
|
+
questionVoted: !!I,
|
|
523
|
+
youSelected: z === d.id,
|
|
524
|
+
isLoading: f,
|
|
525
|
+
hasCorrectAnswer: r,
|
|
526
|
+
questionType: t.type,
|
|
527
|
+
answerTimeExpired: p,
|
|
528
|
+
questionStatus: t.status,
|
|
529
|
+
// ToDo: Figure out why imageMode is not in the response
|
|
530
|
+
onVote: v
|
|
531
|
+
})) : [], [r, p, f, t, I, v, z]), c = u && (u.case === "trivia" || u.case === "prediction") ? u.value : void 0;
|
|
532
|
+
return /* @__PURE__ */ a(be, { "data-question-header": "true", children: /* @__PURE__ */ a(Wt, { children: /* @__PURE__ */ N(Ft, { children: [
|
|
533
|
+
c && /* @__PURE__ */ a(
|
|
534
|
+
Pt,
|
|
535
|
+
{
|
|
536
|
+
feedbackMessages: c,
|
|
537
|
+
questionVoted: !!I,
|
|
538
|
+
questionVotedCorrectly: I == null ? void 0 : I.correct,
|
|
539
|
+
questionType: i,
|
|
540
|
+
hasCorrectAnswer: r
|
|
541
|
+
}
|
|
542
|
+
),
|
|
543
|
+
/* @__PURE__ */ a(
|
|
544
|
+
Es,
|
|
545
|
+
{
|
|
546
|
+
title: p ? "Expired" : "To win",
|
|
547
|
+
points: p ? void 0 : 100,
|
|
548
|
+
onTimerExpired: () => m(!0),
|
|
549
|
+
isTimer: !0
|
|
550
|
+
}
|
|
551
|
+
),
|
|
552
|
+
/* @__PURE__ */ a(Vt, { children: n }),
|
|
553
|
+
/* @__PURE__ */ a(Ht, { children: h.map((d) => /* @__PURE__ */ a(ds, { ...d }, d.id)) })
|
|
554
|
+
] }) }) });
|
|
555
|
+
};
|
|
556
|
+
const bs = /* @__PURE__ */ o("div")({
|
|
557
|
+
name: "e",
|
|
558
|
+
class: "e1eio0mt",
|
|
559
|
+
propsAsIs: !1
|
|
560
|
+
}), js = /* @__PURE__ */ o("div")({
|
|
561
|
+
name: "i",
|
|
562
|
+
class: "iigl87b",
|
|
563
|
+
propsAsIs: !1
|
|
564
|
+
}), Ls = /* @__PURE__ */ o("h3")({
|
|
565
|
+
name: "n",
|
|
566
|
+
class: "n1o2cwub",
|
|
567
|
+
propsAsIs: !1
|
|
568
|
+
}), Cs = /* @__PURE__ */ o("div")({
|
|
569
|
+
name: "r",
|
|
570
|
+
class: "r3uxe45",
|
|
571
|
+
propsAsIs: !1
|
|
572
|
+
}), Rs = /* @__PURE__ */ o("div")({
|
|
573
|
+
name: "l",
|
|
574
|
+
class: "lrqius",
|
|
575
|
+
propsAsIs: !1
|
|
576
|
+
}), qe = ({ created: t, title: e, instantView: s }) => {
|
|
577
|
+
const n = F(() => {
|
|
578
|
+
if (t) {
|
|
579
|
+
const i = new Date(t);
|
|
580
|
+
if (Ze(i))
|
|
581
|
+
return {
|
|
582
|
+
date: Je(i),
|
|
583
|
+
time: Ke(i)
|
|
584
|
+
};
|
|
585
|
+
}
|
|
586
|
+
return null;
|
|
587
|
+
}, [t]);
|
|
588
|
+
return /* @__PURE__ */ N(bs, { children: [
|
|
589
|
+
n && /* @__PURE__ */ N(Rs, { children: [
|
|
590
|
+
n.date,
|
|
591
|
+
" · ",
|
|
592
|
+
n.time
|
|
593
|
+
] }),
|
|
594
|
+
(s == null ? void 0 : s.video) && /* @__PURE__ */ a(Xe, { source: s.video.url, poster: s.video.thumbnailUrl }),
|
|
595
|
+
/* @__PURE__ */ N(js, { children: [
|
|
596
|
+
/* @__PURE__ */ a(Ls, { children: (s == null ? void 0 : s.heading) || e }),
|
|
597
|
+
/* @__PURE__ */ a(Cs, { children: s == null ? void 0 : s.body })
|
|
598
|
+
] })
|
|
599
|
+
] });
|
|
600
|
+
};
|
|
601
|
+
const $s = /* @__PURE__ */ o("div")({
|
|
602
|
+
name: "o",
|
|
603
|
+
class: "o18unvw4",
|
|
604
|
+
propsAsIs: !1
|
|
605
|
+
}), Us = /* @__PURE__ */ o("a")({
|
|
606
|
+
name: "n",
|
|
607
|
+
class: "ns0uvk8",
|
|
608
|
+
propsAsIs: !1
|
|
609
|
+
}), Qs = ({ instantView: t, ...e }) => /* @__PURE__ */ N($s, { children: [
|
|
610
|
+
/* @__PURE__ */ a(qe, { instantView: t, ...e }),
|
|
611
|
+
(t == null ? void 0 : t.webLink) && /* @__PURE__ */ N(Us, { href: t == null ? void 0 : t.webLink.url, target: "_blank", children: [
|
|
612
|
+
"Explore more of the Masters History",
|
|
613
|
+
/* @__PURE__ */ a(w, { name: "icon-external-link" })
|
|
614
|
+
] })
|
|
615
|
+
] });
|
|
616
|
+
const qs = /* @__PURE__ */ o("div")({
|
|
617
|
+
name: "d",
|
|
618
|
+
class: "dk8r1eq",
|
|
619
|
+
propsAsIs: !1
|
|
620
|
+
}), Ys = ({
|
|
621
|
+
openedQuestion: t
|
|
622
|
+
}) => {
|
|
623
|
+
var e;
|
|
624
|
+
return ((e = t == null ? void 0 : t.attributes) == null ? void 0 : e.attributes.case) === "insight" ? /* @__PURE__ */ a(Qs, {
|
|
625
|
+
created: t.attributes.created,
|
|
626
|
+
...t.attributes.attributes.value
|
|
627
|
+
}) : null;
|
|
628
|
+
}, Ps = ({
|
|
629
|
+
extendedQuestion: t,
|
|
630
|
+
vote: e
|
|
631
|
+
}) => {
|
|
632
|
+
const {
|
|
633
|
+
loading: s,
|
|
634
|
+
data: n
|
|
635
|
+
} = t;
|
|
636
|
+
return !s && n ? /* @__PURE__ */ a(ks, {
|
|
637
|
+
vote: e,
|
|
638
|
+
openedQuestion: n
|
|
639
|
+
}) : null;
|
|
640
|
+
}, Ws = ({
|
|
641
|
+
gamification: t
|
|
642
|
+
}) => {
|
|
643
|
+
var e;
|
|
644
|
+
const s = b(t.openedQuestion.$store), n = b(t.openedQuestion.$extendedStore);
|
|
645
|
+
if (!s)
|
|
646
|
+
return null;
|
|
647
|
+
const i = s.type;
|
|
648
|
+
return /* @__PURE__ */ N(qs, {
|
|
649
|
+
children: [/* @__PURE__ */ a(Ce, {
|
|
650
|
+
close: t.closeQuestion,
|
|
651
|
+
type: ((e = s.attributes) == null ? void 0 : e.type) || x.UNSET
|
|
652
|
+
}), i === "question" && /* @__PURE__ */ a(Ps, {
|
|
653
|
+
vote: t.submitAnswer,
|
|
654
|
+
extendedQuestion: n
|
|
655
|
+
}), i !== "question" && /* @__PURE__ */ a(Ys, {
|
|
656
|
+
openedQuestion: s
|
|
657
|
+
})]
|
|
658
|
+
});
|
|
659
|
+
};
|
|
660
|
+
const Fs = /* @__PURE__ */ o("div")({
|
|
661
|
+
name: "t",
|
|
662
|
+
class: "tcim9sm",
|
|
663
|
+
propsAsIs: !1
|
|
664
|
+
}), Vs = /* @__PURE__ */ o("div")({
|
|
665
|
+
name: "e",
|
|
666
|
+
class: "e8wco6o",
|
|
667
|
+
propsAsIs: !1
|
|
668
|
+
}), Hs = /* @__PURE__ */ o("button")({
|
|
669
|
+
name: "n",
|
|
670
|
+
class: "n1ardwzl",
|
|
671
|
+
propsAsIs: !1
|
|
672
|
+
}), Bs = /* @__PURE__ */ o("span")({
|
|
673
|
+
name: "i",
|
|
674
|
+
class: "i1vk8ojx",
|
|
675
|
+
propsAsIs: !1
|
|
676
|
+
});
|
|
677
|
+
var Q = /* @__PURE__ */ ((t) => (t.HOME = "home", t.LEADERBOARD = "leaderboard", t))(Q || {});
|
|
678
|
+
const ve = ({ title: t, active: e, onClick: s }) => /* @__PURE__ */ a(Hs, { onClick: s, "data-selected": e, children: /* @__PURE__ */ a(Bs, { children: t }) }), Gs = ({ activePage: t = "home", toggleActivePage: e }) => /* @__PURE__ */ a(Fs, { children: /* @__PURE__ */ N(Vs, { "data-position": t === "home" ? "left" : "right", children: [
|
|
679
|
+
/* @__PURE__ */ a(ve, { title: "Home", active: t === "home", onClick: () => e(
|
|
680
|
+
"home"
|
|
681
|
+
/* HOME */
|
|
682
|
+
) }),
|
|
683
|
+
/* @__PURE__ */ a(
|
|
684
|
+
ve,
|
|
685
|
+
{
|
|
686
|
+
title: "Leader Board",
|
|
687
|
+
active: t === "leaderboard",
|
|
688
|
+
onClick: () => e(
|
|
689
|
+
"leaderboard"
|
|
690
|
+
/* LEADERBOARD */
|
|
691
|
+
)
|
|
692
|
+
}
|
|
693
|
+
)
|
|
694
|
+
] }) });
|
|
695
|
+
let D;
|
|
696
|
+
typeof window < "u" ? D = window : typeof self < "u" ? D = self : D = et.global;
|
|
697
|
+
let te = null, se = null;
|
|
698
|
+
const Me = 20, Z = D.clearTimeout, ye = D.setTimeout, J = D.cancelAnimationFrame || D.mozCancelAnimationFrame || D.webkitCancelAnimationFrame, Ne = D.requestAnimationFrame || D.mozRequestAnimationFrame || D.webkitRequestAnimationFrame;
|
|
699
|
+
J == null || Ne == null ? (te = Z, se = function(e) {
|
|
700
|
+
return ye(e, Me);
|
|
701
|
+
}) : (te = function([e, s]) {
|
|
702
|
+
J(e), Z(s);
|
|
703
|
+
}, se = function(e) {
|
|
704
|
+
const s = Ne(function() {
|
|
705
|
+
Z(n), e();
|
|
706
|
+
}), n = ye(function() {
|
|
707
|
+
J(s), e();
|
|
708
|
+
}, Me);
|
|
709
|
+
return [s, n];
|
|
710
|
+
});
|
|
711
|
+
function Zs(t) {
|
|
712
|
+
let e, s, n, i, u, p, m;
|
|
713
|
+
const f = typeof document < "u" && document.attachEvent;
|
|
714
|
+
if (!f) {
|
|
715
|
+
p = function(c) {
|
|
716
|
+
const d = c.__resizeTriggers__, g = d.firstElementChild, T = d.lastElementChild, _ = g.firstElementChild;
|
|
717
|
+
T.scrollLeft = T.scrollWidth, T.scrollTop = T.scrollHeight, _.style.width = g.offsetWidth + 1 + "px", _.style.height = g.offsetHeight + 1 + "px", g.scrollLeft = g.scrollWidth, g.scrollTop = g.scrollHeight;
|
|
718
|
+
}, u = function(c) {
|
|
719
|
+
return c.offsetWidth !== c.__resizeLast__.width || c.offsetHeight !== c.__resizeLast__.height;
|
|
720
|
+
}, m = function(c) {
|
|
721
|
+
if (c.target.className && typeof c.target.className.indexOf == "function" && c.target.className.indexOf("contract-trigger") < 0 && c.target.className.indexOf("expand-trigger") < 0)
|
|
722
|
+
return;
|
|
723
|
+
const d = this;
|
|
724
|
+
p(this), this.__resizeRAF__ && te(this.__resizeRAF__), this.__resizeRAF__ = se(function() {
|
|
725
|
+
u(d) && (d.__resizeLast__.width = d.offsetWidth, d.__resizeLast__.height = d.offsetHeight, d.__resizeListeners__.forEach(function(_) {
|
|
726
|
+
_.call(d, c);
|
|
727
|
+
}));
|
|
728
|
+
});
|
|
729
|
+
};
|
|
730
|
+
let l = !1, v = "";
|
|
731
|
+
n = "animationstart";
|
|
732
|
+
const I = "Webkit Moz O ms".split(" ");
|
|
733
|
+
let r = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), h = "";
|
|
734
|
+
{
|
|
735
|
+
const c = document.createElement("fakeelement");
|
|
736
|
+
if (c.style.animationName !== void 0 && (l = !0), l === !1) {
|
|
737
|
+
for (let d = 0; d < I.length; d++)
|
|
738
|
+
if (c.style[I[d] + "AnimationName"] !== void 0) {
|
|
739
|
+
h = I[d], v = "-" + h.toLowerCase() + "-", n = r[d], l = !0;
|
|
740
|
+
break;
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
s = "resizeanim", e = "@" + v + "keyframes " + s + " { from { opacity: 0; } to { opacity: 0; } } ", i = v + "animation: 1ms " + s + "; ";
|
|
745
|
+
}
|
|
746
|
+
const M = function(l) {
|
|
747
|
+
if (!l.getElementById("detectElementResize")) {
|
|
748
|
+
const v = (e || "") + ".resize-triggers { " + (i || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', I = l.head || l.getElementsByTagName("head")[0], r = l.createElement("style");
|
|
749
|
+
r.id = "detectElementResize", r.type = "text/css", t != null && r.setAttribute("nonce", t), r.styleSheet ? r.styleSheet.cssText = v : r.appendChild(l.createTextNode(v)), I.appendChild(r);
|
|
750
|
+
}
|
|
751
|
+
};
|
|
752
|
+
return {
|
|
753
|
+
addResizeListener: function(l, v) {
|
|
754
|
+
if (f)
|
|
755
|
+
l.attachEvent("onresize", v);
|
|
756
|
+
else {
|
|
757
|
+
if (!l.__resizeTriggers__) {
|
|
758
|
+
const I = l.ownerDocument, r = D.getComputedStyle(l);
|
|
759
|
+
r && r.position === "static" && (l.style.position = "relative"), M(I), l.__resizeLast__ = {}, l.__resizeListeners__ = [], (l.__resizeTriggers__ = I.createElement("div")).className = "resize-triggers";
|
|
760
|
+
const h = I.createElement("div");
|
|
761
|
+
h.className = "expand-trigger", h.appendChild(I.createElement("div"));
|
|
762
|
+
const c = I.createElement("div");
|
|
763
|
+
c.className = "contract-trigger", l.__resizeTriggers__.appendChild(h), l.__resizeTriggers__.appendChild(c), l.appendChild(l.__resizeTriggers__), p(l), l.addEventListener("scroll", m, !0), n && (l.__resizeTriggers__.__animationListener__ = function(g) {
|
|
764
|
+
g.animationName === s && p(l);
|
|
765
|
+
}, l.__resizeTriggers__.addEventListener(n, l.__resizeTriggers__.__animationListener__));
|
|
766
|
+
}
|
|
767
|
+
l.__resizeListeners__.push(v);
|
|
768
|
+
}
|
|
769
|
+
},
|
|
770
|
+
removeResizeListener: function(l, v) {
|
|
771
|
+
if (f)
|
|
772
|
+
l.detachEvent("onresize", v);
|
|
773
|
+
else if (l.__resizeListeners__.splice(l.__resizeListeners__.indexOf(v), 1), !l.__resizeListeners__.length) {
|
|
774
|
+
l.removeEventListener("scroll", m, !0), l.__resizeTriggers__.__animationListener__ && (l.__resizeTriggers__.removeEventListener(n, l.__resizeTriggers__.__animationListener__), l.__resizeTriggers__.__animationListener__ = null);
|
|
775
|
+
try {
|
|
776
|
+
l.__resizeTriggers__ = !l.removeChild(l.__resizeTriggers__);
|
|
777
|
+
} catch {
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
class Js extends it {
|
|
784
|
+
constructor(...e) {
|
|
785
|
+
super(...e), this.state = {
|
|
786
|
+
height: this.props.defaultHeight || 0,
|
|
787
|
+
scaledHeight: this.props.defaultHeight || 0,
|
|
788
|
+
scaledWidth: this.props.defaultWidth || 0,
|
|
789
|
+
width: this.props.defaultWidth || 0
|
|
790
|
+
}, this._autoSizer = null, this._detectElementResize = null, this._parentNode = null, this._resizeObserver = null, this._timeoutId = null, this._onResize = () => {
|
|
791
|
+
this._timeoutId = null;
|
|
792
|
+
const {
|
|
793
|
+
disableHeight: s,
|
|
794
|
+
disableWidth: n,
|
|
795
|
+
onResize: i
|
|
796
|
+
} = this.props;
|
|
797
|
+
if (this._parentNode) {
|
|
798
|
+
var u, p, m, f;
|
|
799
|
+
const M = window.getComputedStyle(this._parentNode) || {}, z = parseFloat((u = M.paddingLeft) !== null && u !== void 0 ? u : "0"), y = parseFloat((p = M.paddingRight) !== null && p !== void 0 ? p : "0"), l = parseFloat((m = M.paddingTop) !== null && m !== void 0 ? m : "0"), v = parseFloat((f = M.paddingBottom) !== null && f !== void 0 ? f : "0"), I = this._parentNode.getBoundingClientRect(), r = I.height - l - v, h = I.width - z - y, c = this._parentNode.offsetHeight - l - v, d = this._parentNode.offsetWidth - z - y;
|
|
800
|
+
(!s && (this.state.height !== c || this.state.scaledHeight !== r) || !n && (this.state.width !== d || this.state.scaledWidth !== h)) && (this.setState({
|
|
801
|
+
height: c,
|
|
802
|
+
width: d,
|
|
803
|
+
scaledHeight: r,
|
|
804
|
+
scaledWidth: h
|
|
805
|
+
}), typeof i == "function" && i({
|
|
806
|
+
height: c,
|
|
807
|
+
scaledHeight: r,
|
|
808
|
+
scaledWidth: h,
|
|
809
|
+
width: d
|
|
810
|
+
}));
|
|
811
|
+
}
|
|
812
|
+
}, this._setRef = (s) => {
|
|
813
|
+
this._autoSizer = s;
|
|
814
|
+
};
|
|
815
|
+
}
|
|
816
|
+
componentDidMount() {
|
|
817
|
+
const {
|
|
818
|
+
nonce: e
|
|
819
|
+
} = this.props;
|
|
820
|
+
this._autoSizer && this._autoSizer.parentNode && this._autoSizer.parentNode.ownerDocument && this._autoSizer.parentNode.ownerDocument.defaultView && this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement && (this._parentNode = this._autoSizer.parentNode, this._parentNode != null && (typeof ResizeObserver < "u" ? (this._resizeObserver = new ResizeObserver(() => {
|
|
821
|
+
this._timeoutId = setTimeout(this._onResize, 0);
|
|
822
|
+
}), this._resizeObserver.observe(this._parentNode)) : (this._detectElementResize = Zs(e), this._detectElementResize.addResizeListener(this._parentNode, this._onResize)), this._onResize()));
|
|
823
|
+
}
|
|
824
|
+
componentWillUnmount() {
|
|
825
|
+
this._parentNode && (this._detectElementResize && this._detectElementResize.removeResizeListener(this._parentNode, this._onResize), this._timeoutId !== null && clearTimeout(this._timeoutId), this._resizeObserver && (this._resizeObserver.observe(this._parentNode), this._resizeObserver.disconnect()));
|
|
826
|
+
}
|
|
827
|
+
render() {
|
|
828
|
+
const {
|
|
829
|
+
children: e,
|
|
830
|
+
defaultHeight: s,
|
|
831
|
+
defaultWidth: n,
|
|
832
|
+
disableHeight: i = !1,
|
|
833
|
+
disableWidth: u = !1,
|
|
834
|
+
nonce: p,
|
|
835
|
+
onResize: m,
|
|
836
|
+
style: f = {},
|
|
837
|
+
tagName: M = "div",
|
|
838
|
+
...z
|
|
839
|
+
} = this.props, {
|
|
840
|
+
height: y,
|
|
841
|
+
scaledHeight: l,
|
|
842
|
+
scaledWidth: v,
|
|
843
|
+
width: I
|
|
844
|
+
} = this.state, r = {
|
|
845
|
+
overflow: "visible"
|
|
846
|
+
}, h = {};
|
|
847
|
+
let c = !1;
|
|
848
|
+
return i || (y === 0 && (c = !0), r.height = 0, h.height = y, h.scaledHeight = l), u || (I === 0 && (c = !0), r.width = 0, h.width = I, h.scaledWidth = v), V(M, {
|
|
849
|
+
ref: this._setRef,
|
|
850
|
+
style: {
|
|
851
|
+
...r,
|
|
852
|
+
...f
|
|
853
|
+
},
|
|
854
|
+
...z
|
|
855
|
+
}, !c && e(h));
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
function ne() {
|
|
859
|
+
return ne = Object.assign ? Object.assign.bind() : function(t) {
|
|
860
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
861
|
+
var s = arguments[e];
|
|
862
|
+
for (var n in s)
|
|
863
|
+
Object.prototype.hasOwnProperty.call(s, n) && (t[n] = s[n]);
|
|
864
|
+
}
|
|
865
|
+
return t;
|
|
866
|
+
}, ne.apply(this, arguments);
|
|
867
|
+
}
|
|
868
|
+
function ze(t) {
|
|
869
|
+
if (t === void 0)
|
|
870
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
871
|
+
return t;
|
|
872
|
+
}
|
|
873
|
+
function ie(t, e) {
|
|
874
|
+
return ie = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, i) {
|
|
875
|
+
return n.__proto__ = i, n;
|
|
876
|
+
}, ie(t, e);
|
|
877
|
+
}
|
|
878
|
+
function Ks(t, e) {
|
|
879
|
+
t.prototype = Object.create(e.prototype), t.prototype.constructor = t, ie(t, e);
|
|
880
|
+
}
|
|
881
|
+
var _e = Number.isNaN || function(e) {
|
|
882
|
+
return typeof e == "number" && e !== e;
|
|
883
|
+
};
|
|
884
|
+
function Xs(t, e) {
|
|
885
|
+
return !!(t === e || _e(t) && _e(e));
|
|
886
|
+
}
|
|
887
|
+
function en(t, e) {
|
|
888
|
+
if (t.length !== e.length)
|
|
889
|
+
return !1;
|
|
890
|
+
for (var s = 0; s < t.length; s++)
|
|
891
|
+
if (!Xs(t[s], e[s]))
|
|
892
|
+
return !1;
|
|
893
|
+
return !0;
|
|
894
|
+
}
|
|
895
|
+
function K(t, e) {
|
|
896
|
+
e === void 0 && (e = en);
|
|
897
|
+
var s, n = [], i, u = !1;
|
|
898
|
+
function p() {
|
|
899
|
+
for (var m = [], f = 0; f < arguments.length; f++)
|
|
900
|
+
m[f] = arguments[f];
|
|
901
|
+
return u && s === this && e(m, n) || (i = t.apply(this, m), u = !0, s = this, n = m), i;
|
|
902
|
+
}
|
|
903
|
+
return p;
|
|
904
|
+
}
|
|
905
|
+
var tn = typeof performance == "object" && typeof performance.now == "function", Te = tn ? function() {
|
|
906
|
+
return performance.now();
|
|
907
|
+
} : function() {
|
|
908
|
+
return Date.now();
|
|
909
|
+
};
|
|
910
|
+
function Ae(t) {
|
|
911
|
+
cancelAnimationFrame(t.id);
|
|
912
|
+
}
|
|
913
|
+
function sn(t, e) {
|
|
914
|
+
var s = Te();
|
|
915
|
+
function n() {
|
|
916
|
+
Te() - s >= e ? t.call(null) : i.id = requestAnimationFrame(n);
|
|
917
|
+
}
|
|
918
|
+
var i = {
|
|
919
|
+
id: requestAnimationFrame(n)
|
|
920
|
+
};
|
|
921
|
+
return i;
|
|
922
|
+
}
|
|
923
|
+
var X = -1;
|
|
924
|
+
function Se(t) {
|
|
925
|
+
if (t === void 0 && (t = !1), X === -1 || t) {
|
|
926
|
+
var e = document.createElement("div"), s = e.style;
|
|
927
|
+
s.width = "50px", s.height = "50px", s.overflow = "scroll", document.body.appendChild(e), X = e.offsetWidth - e.clientWidth, document.body.removeChild(e);
|
|
928
|
+
}
|
|
929
|
+
return X;
|
|
930
|
+
}
|
|
931
|
+
var j = null;
|
|
932
|
+
function De(t) {
|
|
933
|
+
if (t === void 0 && (t = !1), j === null || t) {
|
|
934
|
+
var e = document.createElement("div"), s = e.style;
|
|
935
|
+
s.width = "50px", s.height = "50px", s.overflow = "scroll", s.direction = "rtl";
|
|
936
|
+
var n = document.createElement("div"), i = n.style;
|
|
937
|
+
return i.width = "100px", i.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? j = "positive-descending" : (e.scrollLeft = 1, e.scrollLeft === 0 ? j = "negative" : j = "positive-ascending"), document.body.removeChild(e), j;
|
|
938
|
+
}
|
|
939
|
+
return j;
|
|
940
|
+
}
|
|
941
|
+
var nn = 150, rn = function(e, s) {
|
|
942
|
+
return e;
|
|
943
|
+
};
|
|
944
|
+
function an(t) {
|
|
945
|
+
var e, s = t.getItemOffset, n = t.getEstimatedTotalSize, i = t.getItemSize, u = t.getOffsetForIndexAndAlignment, p = t.getStartIndexForOffset, m = t.getStopIndexForStartIndex, f = t.initInstanceProps, M = t.shouldResetStyleCacheOnItemSizeChange, z = t.validateProps;
|
|
946
|
+
return e = /* @__PURE__ */ function(y) {
|
|
947
|
+
Ks(l, y);
|
|
948
|
+
function l(I) {
|
|
949
|
+
var r;
|
|
950
|
+
return r = y.call(this, I) || this, r._instanceProps = f(r.props, ze(r)), r._outerRef = void 0, r._resetIsScrollingTimeoutId = null, r.state = {
|
|
951
|
+
instance: ze(r),
|
|
952
|
+
isScrolling: !1,
|
|
953
|
+
scrollDirection: "forward",
|
|
954
|
+
scrollOffset: typeof r.props.initialScrollOffset == "number" ? r.props.initialScrollOffset : 0,
|
|
955
|
+
scrollUpdateWasRequested: !1
|
|
956
|
+
}, r._callOnItemsRendered = void 0, r._callOnItemsRendered = K(function(h, c, d, g) {
|
|
957
|
+
return r.props.onItemsRendered({
|
|
958
|
+
overscanStartIndex: h,
|
|
959
|
+
overscanStopIndex: c,
|
|
960
|
+
visibleStartIndex: d,
|
|
961
|
+
visibleStopIndex: g
|
|
962
|
+
});
|
|
963
|
+
}), r._callOnScroll = void 0, r._callOnScroll = K(function(h, c, d) {
|
|
964
|
+
return r.props.onScroll({
|
|
965
|
+
scrollDirection: h,
|
|
966
|
+
scrollOffset: c,
|
|
967
|
+
scrollUpdateWasRequested: d
|
|
968
|
+
});
|
|
969
|
+
}), r._getItemStyle = void 0, r._getItemStyle = function(h) {
|
|
970
|
+
var c = r.props, d = c.direction, g = c.itemSize, T = c.layout, _ = r._getItemStyleCache(M && g, M && T, M && d), A;
|
|
971
|
+
if (_.hasOwnProperty(h))
|
|
972
|
+
A = _[h];
|
|
973
|
+
else {
|
|
974
|
+
var S = s(r.props, h, r._instanceProps), O = i(r.props, h, r._instanceProps), E = d === "horizontal" || T === "horizontal", q = d === "rtl", Y = E ? S : 0;
|
|
975
|
+
_[h] = A = {
|
|
976
|
+
position: "absolute",
|
|
977
|
+
left: q ? void 0 : Y,
|
|
978
|
+
right: q ? Y : void 0,
|
|
979
|
+
top: E ? 0 : S,
|
|
980
|
+
height: E ? "100%" : O,
|
|
981
|
+
width: E ? O : "100%"
|
|
982
|
+
};
|
|
983
|
+
}
|
|
984
|
+
return A;
|
|
985
|
+
}, r._getItemStyleCache = void 0, r._getItemStyleCache = K(function(h, c, d) {
|
|
986
|
+
return {};
|
|
987
|
+
}), r._onScrollHorizontal = function(h) {
|
|
988
|
+
var c = h.currentTarget, d = c.clientWidth, g = c.scrollLeft, T = c.scrollWidth;
|
|
989
|
+
r.setState(function(_) {
|
|
990
|
+
if (_.scrollOffset === g)
|
|
991
|
+
return null;
|
|
992
|
+
var A = r.props.direction, S = g;
|
|
993
|
+
if (A === "rtl")
|
|
994
|
+
switch (De()) {
|
|
995
|
+
case "negative":
|
|
996
|
+
S = -g;
|
|
997
|
+
break;
|
|
998
|
+
case "positive-descending":
|
|
999
|
+
S = T - d - g;
|
|
1000
|
+
break;
|
|
1001
|
+
}
|
|
1002
|
+
return S = Math.max(0, Math.min(S, T - d)), {
|
|
1003
|
+
isScrolling: !0,
|
|
1004
|
+
scrollDirection: _.scrollOffset < g ? "forward" : "backward",
|
|
1005
|
+
scrollOffset: S,
|
|
1006
|
+
scrollUpdateWasRequested: !1
|
|
1007
|
+
};
|
|
1008
|
+
}, r._resetIsScrollingDebounced);
|
|
1009
|
+
}, r._onScrollVertical = function(h) {
|
|
1010
|
+
var c = h.currentTarget, d = c.clientHeight, g = c.scrollHeight, T = c.scrollTop;
|
|
1011
|
+
r.setState(function(_) {
|
|
1012
|
+
if (_.scrollOffset === T)
|
|
1013
|
+
return null;
|
|
1014
|
+
var A = Math.max(0, Math.min(T, g - d));
|
|
1015
|
+
return {
|
|
1016
|
+
isScrolling: !0,
|
|
1017
|
+
scrollDirection: _.scrollOffset < A ? "forward" : "backward",
|
|
1018
|
+
scrollOffset: A,
|
|
1019
|
+
scrollUpdateWasRequested: !1
|
|
1020
|
+
};
|
|
1021
|
+
}, r._resetIsScrollingDebounced);
|
|
1022
|
+
}, r._outerRefSetter = function(h) {
|
|
1023
|
+
var c = r.props.outerRef;
|
|
1024
|
+
r._outerRef = h, typeof c == "function" ? c(h) : c != null && typeof c == "object" && c.hasOwnProperty("current") && (c.current = h);
|
|
1025
|
+
}, r._resetIsScrollingDebounced = function() {
|
|
1026
|
+
r._resetIsScrollingTimeoutId !== null && Ae(r._resetIsScrollingTimeoutId), r._resetIsScrollingTimeoutId = sn(r._resetIsScrolling, nn);
|
|
1027
|
+
}, r._resetIsScrolling = function() {
|
|
1028
|
+
r._resetIsScrollingTimeoutId = null, r.setState({
|
|
1029
|
+
isScrolling: !1
|
|
1030
|
+
}, function() {
|
|
1031
|
+
r._getItemStyleCache(-1, null);
|
|
1032
|
+
});
|
|
1033
|
+
}, r;
|
|
1034
|
+
}
|
|
1035
|
+
l.getDerivedStateFromProps = function(r, h) {
|
|
1036
|
+
return on(r, h), z(r), null;
|
|
1037
|
+
};
|
|
1038
|
+
var v = l.prototype;
|
|
1039
|
+
return v.scrollTo = function(r) {
|
|
1040
|
+
r = Math.max(0, r), this.setState(function(h) {
|
|
1041
|
+
return h.scrollOffset === r ? null : {
|
|
1042
|
+
scrollDirection: h.scrollOffset < r ? "forward" : "backward",
|
|
1043
|
+
scrollOffset: r,
|
|
1044
|
+
scrollUpdateWasRequested: !0
|
|
1045
|
+
};
|
|
1046
|
+
}, this._resetIsScrollingDebounced);
|
|
1047
|
+
}, v.scrollToItem = function(r, h) {
|
|
1048
|
+
h === void 0 && (h = "auto");
|
|
1049
|
+
var c = this.props, d = c.itemCount, g = c.layout, T = this.state.scrollOffset;
|
|
1050
|
+
r = Math.max(0, Math.min(r, d - 1));
|
|
1051
|
+
var _ = 0;
|
|
1052
|
+
if (this._outerRef) {
|
|
1053
|
+
var A = this._outerRef;
|
|
1054
|
+
g === "vertical" ? _ = A.scrollWidth > A.clientWidth ? Se() : 0 : _ = A.scrollHeight > A.clientHeight ? Se() : 0;
|
|
1055
|
+
}
|
|
1056
|
+
this.scrollTo(u(this.props, r, h, T, this._instanceProps, _));
|
|
1057
|
+
}, v.componentDidMount = function() {
|
|
1058
|
+
var r = this.props, h = r.direction, c = r.initialScrollOffset, d = r.layout;
|
|
1059
|
+
if (typeof c == "number" && this._outerRef != null) {
|
|
1060
|
+
var g = this._outerRef;
|
|
1061
|
+
h === "horizontal" || d === "horizontal" ? g.scrollLeft = c : g.scrollTop = c;
|
|
1062
|
+
}
|
|
1063
|
+
this._callPropsCallbacks();
|
|
1064
|
+
}, v.componentDidUpdate = function() {
|
|
1065
|
+
var r = this.props, h = r.direction, c = r.layout, d = this.state, g = d.scrollOffset, T = d.scrollUpdateWasRequested;
|
|
1066
|
+
if (T && this._outerRef != null) {
|
|
1067
|
+
var _ = this._outerRef;
|
|
1068
|
+
if (h === "horizontal" || c === "horizontal")
|
|
1069
|
+
if (h === "rtl")
|
|
1070
|
+
switch (De()) {
|
|
1071
|
+
case "negative":
|
|
1072
|
+
_.scrollLeft = -g;
|
|
1073
|
+
break;
|
|
1074
|
+
case "positive-ascending":
|
|
1075
|
+
_.scrollLeft = g;
|
|
1076
|
+
break;
|
|
1077
|
+
default:
|
|
1078
|
+
var A = _.clientWidth, S = _.scrollWidth;
|
|
1079
|
+
_.scrollLeft = S - A - g;
|
|
1080
|
+
break;
|
|
1081
|
+
}
|
|
1082
|
+
else
|
|
1083
|
+
_.scrollLeft = g;
|
|
1084
|
+
else
|
|
1085
|
+
_.scrollTop = g;
|
|
1086
|
+
}
|
|
1087
|
+
this._callPropsCallbacks();
|
|
1088
|
+
}, v.componentWillUnmount = function() {
|
|
1089
|
+
this._resetIsScrollingTimeoutId !== null && Ae(this._resetIsScrollingTimeoutId);
|
|
1090
|
+
}, v.render = function() {
|
|
1091
|
+
var r = this.props, h = r.children, c = r.className, d = r.direction, g = r.height, T = r.innerRef, _ = r.innerElementType, A = r.innerTagName, S = r.itemCount, O = r.itemData, E = r.itemKey, q = E === void 0 ? rn : E, Y = r.layout, Ye = r.outerElementType, Pe = r.outerTagName, We = r.style, Fe = r.useIsScrolling, Ve = r.width, ae = this.state.isScrolling, G = d === "horizontal" || Y === "horizontal", He = G ? this._onScrollHorizontal : this._onScrollVertical, oe = this._getRangeToRender(), Be = oe[0], Ge = oe[1], le = [];
|
|
1092
|
+
if (S > 0)
|
|
1093
|
+
for (var $ = Be; $ <= Ge; $++)
|
|
1094
|
+
le.push(V(h, {
|
|
1095
|
+
data: O,
|
|
1096
|
+
key: q($, O),
|
|
1097
|
+
index: $,
|
|
1098
|
+
isScrolling: Fe ? ae : void 0,
|
|
1099
|
+
style: this._getItemStyle($)
|
|
1100
|
+
}));
|
|
1101
|
+
var ce = n(this.props, this._instanceProps);
|
|
1102
|
+
return V(Ye || Pe || "div", {
|
|
1103
|
+
className: c,
|
|
1104
|
+
onScroll: He,
|
|
1105
|
+
ref: this._outerRefSetter,
|
|
1106
|
+
style: ne({
|
|
1107
|
+
position: "relative",
|
|
1108
|
+
height: g,
|
|
1109
|
+
width: Ve,
|
|
1110
|
+
overflow: "auto",
|
|
1111
|
+
WebkitOverflowScrolling: "touch",
|
|
1112
|
+
willChange: "transform",
|
|
1113
|
+
direction: d
|
|
1114
|
+
}, We)
|
|
1115
|
+
}, V(_ || A || "div", {
|
|
1116
|
+
children: le,
|
|
1117
|
+
ref: T,
|
|
1118
|
+
style: {
|
|
1119
|
+
height: G ? "100%" : ce,
|
|
1120
|
+
pointerEvents: ae ? "none" : void 0,
|
|
1121
|
+
width: G ? ce : "100%"
|
|
1122
|
+
}
|
|
1123
|
+
}));
|
|
1124
|
+
}, v._callPropsCallbacks = function() {
|
|
1125
|
+
if (typeof this.props.onItemsRendered == "function") {
|
|
1126
|
+
var r = this.props.itemCount;
|
|
1127
|
+
if (r > 0) {
|
|
1128
|
+
var h = this._getRangeToRender(), c = h[0], d = h[1], g = h[2], T = h[3];
|
|
1129
|
+
this._callOnItemsRendered(c, d, g, T);
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
if (typeof this.props.onScroll == "function") {
|
|
1133
|
+
var _ = this.state, A = _.scrollDirection, S = _.scrollOffset, O = _.scrollUpdateWasRequested;
|
|
1134
|
+
this._callOnScroll(A, S, O);
|
|
1135
|
+
}
|
|
1136
|
+
}, v._getRangeToRender = function() {
|
|
1137
|
+
var r = this.props, h = r.itemCount, c = r.overscanCount, d = this.state, g = d.isScrolling, T = d.scrollDirection, _ = d.scrollOffset;
|
|
1138
|
+
if (h === 0)
|
|
1139
|
+
return [0, 0, 0, 0];
|
|
1140
|
+
var A = p(this.props, _, this._instanceProps), S = m(this.props, A, _, this._instanceProps), O = !g || T === "backward" ? Math.max(1, c) : 1, E = !g || T === "forward" ? Math.max(1, c) : 1;
|
|
1141
|
+
return [Math.max(0, A - O), Math.max(0, Math.min(h - 1, S + E)), A, S];
|
|
1142
|
+
}, l;
|
|
1143
|
+
}(Le), e.defaultProps = {
|
|
1144
|
+
direction: "ltr",
|
|
1145
|
+
itemData: void 0,
|
|
1146
|
+
layout: "vertical",
|
|
1147
|
+
overscanCount: 2,
|
|
1148
|
+
useIsScrolling: !1
|
|
1149
|
+
}, e;
|
|
1150
|
+
}
|
|
1151
|
+
var on = function(e, s) {
|
|
1152
|
+
e.children, e.direction, e.height, e.layout, e.innerTagName, e.outerTagName, e.width, s.instance;
|
|
1153
|
+
}, ln = /* @__PURE__ */ an({
|
|
1154
|
+
getItemOffset: function(e, s) {
|
|
1155
|
+
var n = e.itemSize;
|
|
1156
|
+
return s * n;
|
|
1157
|
+
},
|
|
1158
|
+
getItemSize: function(e, s) {
|
|
1159
|
+
var n = e.itemSize;
|
|
1160
|
+
return n;
|
|
1161
|
+
},
|
|
1162
|
+
getEstimatedTotalSize: function(e) {
|
|
1163
|
+
var s = e.itemCount, n = e.itemSize;
|
|
1164
|
+
return n * s;
|
|
1165
|
+
},
|
|
1166
|
+
getOffsetForIndexAndAlignment: function(e, s, n, i, u, p) {
|
|
1167
|
+
var m = e.direction, f = e.height, M = e.itemCount, z = e.itemSize, y = e.layout, l = e.width, v = m === "horizontal" || y === "horizontal", I = v ? l : f, r = Math.max(0, M * z - I), h = Math.min(r, s * z), c = Math.max(0, s * z - I + z + p);
|
|
1168
|
+
switch (n === "smart" && (i >= c - I && i <= h + I ? n = "auto" : n = "center"), n) {
|
|
1169
|
+
case "start":
|
|
1170
|
+
return h;
|
|
1171
|
+
case "end":
|
|
1172
|
+
return c;
|
|
1173
|
+
case "center": {
|
|
1174
|
+
var d = Math.round(c + (h - c) / 2);
|
|
1175
|
+
return d < Math.ceil(I / 2) ? 0 : d > r + Math.floor(I / 2) ? r : d;
|
|
1176
|
+
}
|
|
1177
|
+
case "auto":
|
|
1178
|
+
default:
|
|
1179
|
+
return i >= c && i <= h ? i : i < c ? c : h;
|
|
1180
|
+
}
|
|
1181
|
+
},
|
|
1182
|
+
getStartIndexForOffset: function(e, s) {
|
|
1183
|
+
var n = e.itemCount, i = e.itemSize;
|
|
1184
|
+
return Math.max(0, Math.min(n - 1, Math.floor(s / i)));
|
|
1185
|
+
},
|
|
1186
|
+
getStopIndexForStartIndex: function(e, s, n) {
|
|
1187
|
+
var i = e.direction, u = e.height, p = e.itemCount, m = e.itemSize, f = e.layout, M = e.width, z = i === "horizontal" || f === "horizontal", y = s * m, l = z ? M : u, v = Math.ceil((l + n - y) / m);
|
|
1188
|
+
return Math.max(0, Math.min(
|
|
1189
|
+
p - 1,
|
|
1190
|
+
s + v - 1
|
|
1191
|
+
// -1 is because stop index is inclusive
|
|
1192
|
+
));
|
|
1193
|
+
},
|
|
1194
|
+
initInstanceProps: function(e) {
|
|
1195
|
+
},
|
|
1196
|
+
shouldResetStyleCacheOnItemSizeChange: !0,
|
|
1197
|
+
validateProps: function(e) {
|
|
1198
|
+
e.itemSize;
|
|
1199
|
+
}
|
|
1200
|
+
});
|
|
1201
|
+
function cn(t) {
|
|
1202
|
+
var e = t.lastRenderedStartIndex, s = t.lastRenderedStopIndex, n = t.startIndex, i = t.stopIndex;
|
|
1203
|
+
return !(n > s || i < e);
|
|
1204
|
+
}
|
|
1205
|
+
function dn(t) {
|
|
1206
|
+
for (var e = t.isItemLoaded, s = t.itemCount, n = t.minimumBatchSize, i = t.startIndex, u = t.stopIndex, p = [], m = null, f = null, M = i; M <= u; M++) {
|
|
1207
|
+
var z = e(M);
|
|
1208
|
+
z ? f !== null && (p.push(m, f), m = f = null) : (f = M, m === null && (m = M));
|
|
1209
|
+
}
|
|
1210
|
+
if (f !== null) {
|
|
1211
|
+
for (var y = Math.min(Math.max(f, m + n - 1), s - 1), l = f + 1; l <= y && !e(l); l++)
|
|
1212
|
+
f = l;
|
|
1213
|
+
p.push(m, f);
|
|
1214
|
+
}
|
|
1215
|
+
if (p.length)
|
|
1216
|
+
for (; p[1] - p[0] + 1 < n && p[0] > 0; ) {
|
|
1217
|
+
var v = p[0] - 1;
|
|
1218
|
+
if (!e(v))
|
|
1219
|
+
p[0] = v;
|
|
1220
|
+
else
|
|
1221
|
+
break;
|
|
1222
|
+
}
|
|
1223
|
+
return p;
|
|
1224
|
+
}
|
|
1225
|
+
var un = function(t, e) {
|
|
1226
|
+
if (!(t instanceof e))
|
|
1227
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1228
|
+
}, pn = function() {
|
|
1229
|
+
function t(e, s) {
|
|
1230
|
+
for (var n = 0; n < s.length; n++) {
|
|
1231
|
+
var i = s[n];
|
|
1232
|
+
i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i);
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
return function(e, s, n) {
|
|
1236
|
+
return s && t(e.prototype, s), n && t(e, n), e;
|
|
1237
|
+
};
|
|
1238
|
+
}(), hn = function(t, e) {
|
|
1239
|
+
if (typeof e != "function" && e !== null)
|
|
1240
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
1241
|
+
t.prototype = Object.create(e && e.prototype, {
|
|
1242
|
+
constructor: {
|
|
1243
|
+
value: t,
|
|
1244
|
+
enumerable: !1,
|
|
1245
|
+
writable: !0,
|
|
1246
|
+
configurable: !0
|
|
1247
|
+
}
|
|
1248
|
+
}), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
|
|
1249
|
+
}, xe = function(t, e) {
|
|
1250
|
+
if (!t)
|
|
1251
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1252
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
1253
|
+
}, mn = function(t) {
|
|
1254
|
+
hn(e, t);
|
|
1255
|
+
function e() {
|
|
1256
|
+
var s, n, i, u;
|
|
1257
|
+
un(this, e);
|
|
1258
|
+
for (var p = arguments.length, m = Array(p), f = 0; f < p; f++)
|
|
1259
|
+
m[f] = arguments[f];
|
|
1260
|
+
return u = (n = (i = xe(this, (s = e.__proto__ || Object.getPrototypeOf(e)).call.apply(s, [this].concat(m))), i), i._lastRenderedStartIndex = -1, i._lastRenderedStopIndex = -1, i._memoizedUnloadedRanges = [], i._onItemsRendered = function(M) {
|
|
1261
|
+
var z = M.visibleStartIndex, y = M.visibleStopIndex;
|
|
1262
|
+
i._lastRenderedStartIndex = z, i._lastRenderedStopIndex = y, i._ensureRowsLoaded(z, y);
|
|
1263
|
+
}, i._setRef = function(M) {
|
|
1264
|
+
i._listRef = M;
|
|
1265
|
+
}, n), xe(i, u);
|
|
1266
|
+
}
|
|
1267
|
+
return pn(e, [{
|
|
1268
|
+
key: "resetloadMoreItemsCache",
|
|
1269
|
+
value: function() {
|
|
1270
|
+
var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
|
|
1271
|
+
this._memoizedUnloadedRanges = [], n && this._ensureRowsLoaded(this._lastRenderedStartIndex, this._lastRenderedStopIndex);
|
|
1272
|
+
}
|
|
1273
|
+
}, {
|
|
1274
|
+
key: "componentDidMount",
|
|
1275
|
+
value: function() {
|
|
1276
|
+
}
|
|
1277
|
+
}, {
|
|
1278
|
+
key: "render",
|
|
1279
|
+
value: function() {
|
|
1280
|
+
var n = this.props.children;
|
|
1281
|
+
return n({
|
|
1282
|
+
onItemsRendered: this._onItemsRendered,
|
|
1283
|
+
ref: this._setRef
|
|
1284
|
+
});
|
|
1285
|
+
}
|
|
1286
|
+
}, {
|
|
1287
|
+
key: "_ensureRowsLoaded",
|
|
1288
|
+
value: function(n, i) {
|
|
1289
|
+
var u = this.props, p = u.isItemLoaded, m = u.itemCount, f = u.minimumBatchSize, M = f === void 0 ? 10 : f, z = u.threshold, y = z === void 0 ? 15 : z, l = dn({
|
|
1290
|
+
isItemLoaded: p,
|
|
1291
|
+
itemCount: m,
|
|
1292
|
+
minimumBatchSize: M,
|
|
1293
|
+
startIndex: Math.max(0, n - y),
|
|
1294
|
+
stopIndex: Math.min(m - 1, i + y)
|
|
1295
|
+
});
|
|
1296
|
+
(this._memoizedUnloadedRanges.length !== l.length || this._memoizedUnloadedRanges.some(function(v, I) {
|
|
1297
|
+
return l[I] !== v;
|
|
1298
|
+
})) && (this._memoizedUnloadedRanges = l, this._loadUnloadedRanges(l));
|
|
1299
|
+
}
|
|
1300
|
+
}, {
|
|
1301
|
+
key: "_loadUnloadedRanges",
|
|
1302
|
+
value: function(n) {
|
|
1303
|
+
for (var i = this, u = this.props.loadMoreItems || this.props.loadMoreRows, p = function(M) {
|
|
1304
|
+
var z = n[M], y = n[M + 1], l = u(z, y);
|
|
1305
|
+
l != null && l.then(function() {
|
|
1306
|
+
if (cn({
|
|
1307
|
+
lastRenderedStartIndex: i._lastRenderedStartIndex,
|
|
1308
|
+
lastRenderedStopIndex: i._lastRenderedStopIndex,
|
|
1309
|
+
startIndex: z,
|
|
1310
|
+
stopIndex: y
|
|
1311
|
+
})) {
|
|
1312
|
+
if (i._listRef == null)
|
|
1313
|
+
return;
|
|
1314
|
+
typeof i._listRef.resetAfterIndex == "function" ? i._listRef.resetAfterIndex(z, !0) : (typeof i._listRef._getItemStyleCache == "function" && i._listRef._getItemStyleCache(-1), i._listRef.forceUpdate());
|
|
1315
|
+
}
|
|
1316
|
+
});
|
|
1317
|
+
}, m = 0; m < n.length; m += 2)
|
|
1318
|
+
p(m);
|
|
1319
|
+
}
|
|
1320
|
+
}]), e;
|
|
1321
|
+
}(Le);
|
|
1322
|
+
const fn = () => w, gn = /* @__PURE__ */ o("div")({
|
|
1323
|
+
name: "a",
|
|
1324
|
+
class: "a1w9zony",
|
|
1325
|
+
propsAsIs: !1
|
|
1326
|
+
}), In = /* @__PURE__ */ o("div")({
|
|
1327
|
+
name: "l",
|
|
1328
|
+
class: "l16qcfv8",
|
|
1329
|
+
propsAsIs: !1
|
|
1330
|
+
}), vn = /* @__PURE__ */ o("img")({
|
|
1331
|
+
name: "p",
|
|
1332
|
+
class: "p1gmcc5f",
|
|
1333
|
+
propsAsIs: !1
|
|
1334
|
+
}), Mn = /* @__PURE__ */ o("div")({
|
|
1335
|
+
name: "s",
|
|
1336
|
+
class: "s1doddh0",
|
|
1337
|
+
propsAsIs: !1
|
|
1338
|
+
}), yn = /* @__PURE__ */ o("div")({
|
|
1339
|
+
name: "c",
|
|
1340
|
+
class: "c1js9xhe",
|
|
1341
|
+
propsAsIs: !1
|
|
1342
|
+
}), Nn = /* @__PURE__ */ o("div")({
|
|
1343
|
+
name: "d",
|
|
1344
|
+
class: "d1tmnqsh",
|
|
1345
|
+
propsAsIs: !1
|
|
1346
|
+
}), zn = /* @__PURE__ */ o("span")({
|
|
1347
|
+
name: "g",
|
|
1348
|
+
class: "gi9h87j",
|
|
1349
|
+
propsAsIs: !1
|
|
1350
|
+
}), _n = /* @__PURE__ */ o(fn())({
|
|
1351
|
+
name: "x",
|
|
1352
|
+
class: "x13mk3z6",
|
|
1353
|
+
propsAsIs: !0
|
|
1354
|
+
}), Tn = ({
|
|
1355
|
+
rank: t,
|
|
1356
|
+
avatar: e,
|
|
1357
|
+
name: s,
|
|
1358
|
+
points: n,
|
|
1359
|
+
isCurrentUser: i,
|
|
1360
|
+
openItemDetail: u,
|
|
1361
|
+
style: p
|
|
1362
|
+
}) => /* @__PURE__ */ N(gn, { onClick: u, style: p, children: [
|
|
1363
|
+
/* @__PURE__ */ a(In, { children: t || 0 }),
|
|
1364
|
+
/* @__PURE__ */ N(yn, { children: [
|
|
1365
|
+
e ? /* @__PURE__ */ a(vn, { alt: "leaderboard-item-avatar", src: e }) : /* @__PURE__ */ a(Mn, { children: Ee(s || "") }),
|
|
1366
|
+
/* @__PURE__ */ N(Nn, { children: [
|
|
1367
|
+
/* @__PURE__ */ a(zn, { children: s || "" }),
|
|
1368
|
+
i && /* @__PURE__ */ a(_n, { name: "icon-star" })
|
|
1369
|
+
] })
|
|
1370
|
+
] }),
|
|
1371
|
+
/* @__PURE__ */ a("div", { children: ke(n) })
|
|
1372
|
+
] }), An = ({ items: t, openItemDetail: e, fetchMore: s }) => /* @__PURE__ */ a(Js, { children: ({ width: n, height: i }) => /* @__PURE__ */ a(
|
|
1373
|
+
mn,
|
|
1374
|
+
{
|
|
1375
|
+
isItemLoaded: (u) => u < t.length,
|
|
1376
|
+
itemCount: t.length + 1,
|
|
1377
|
+
loadMoreItems: s,
|
|
1378
|
+
children: ({ onItemsRendered: u, ref: p }) => /* @__PURE__ */ a(
|
|
1379
|
+
ln,
|
|
1380
|
+
{
|
|
1381
|
+
itemSize: 56,
|
|
1382
|
+
onItemsRendered: u,
|
|
1383
|
+
ref: p,
|
|
1384
|
+
itemCount: t.length,
|
|
1385
|
+
width: n,
|
|
1386
|
+
height: i,
|
|
1387
|
+
children: ({ index: m, style: f }) => /* @__PURE__ */ a(
|
|
1388
|
+
Tn,
|
|
1389
|
+
{
|
|
1390
|
+
style: { ...f, maxHeight: 48 },
|
|
1391
|
+
...t[m],
|
|
1392
|
+
openItemDetail: () => e(t[m].userId)
|
|
1393
|
+
},
|
|
1394
|
+
t[m].userId
|
|
1395
|
+
)
|
|
1396
|
+
}
|
|
1397
|
+
)
|
|
1398
|
+
}
|
|
1399
|
+
) }), Sn = ({ leaderboardList: t, openUser: e }) => {
|
|
1400
|
+
const { data: s } = b(t.$store);
|
|
1401
|
+
return /* @__PURE__ */ a(An, { fetchMore: t.fetchMore, items: s, openItemDetail: e });
|
|
1402
|
+
};
|
|
1403
|
+
const Dn = /* @__PURE__ */ o("button")({
|
|
1404
|
+
name: "a",
|
|
1405
|
+
class: "akly9h2",
|
|
1406
|
+
propsAsIs: !1
|
|
1407
|
+
}), xn = /* @__PURE__ */ o("span")({
|
|
1408
|
+
name: "e",
|
|
1409
|
+
class: "eptoiz9",
|
|
1410
|
+
propsAsIs: !1
|
|
1411
|
+
}), wn = ({ disabled: t, variant: e = "primary", onClick: s, children: n, ...i }) => /* @__PURE__ */ a(Dn, { onClick: s, disabled: t, "data-variant": e, ...i, children: /* @__PURE__ */ a(xn, { children: n }) });
|
|
1412
|
+
const On = () => w, En = () => w, kn = /* @__PURE__ */ o("div")({
|
|
1413
|
+
name: "s",
|
|
1414
|
+
class: "s1lblda3",
|
|
1415
|
+
propsAsIs: !1
|
|
1416
|
+
}), bn = /* @__PURE__ */ o("div")({
|
|
1417
|
+
name: "a",
|
|
1418
|
+
class: "ascvb2g",
|
|
1419
|
+
propsAsIs: !1
|
|
1420
|
+
}), jn = /* @__PURE__ */ o("div")({
|
|
1421
|
+
name: "p",
|
|
1422
|
+
class: "p17rl8zy",
|
|
1423
|
+
propsAsIs: !1
|
|
1424
|
+
}), Ln = /* @__PURE__ */ o("div")({
|
|
1425
|
+
name: "l",
|
|
1426
|
+
class: "l1vvttbn",
|
|
1427
|
+
propsAsIs: !1
|
|
1428
|
+
}), ee = /* @__PURE__ */ o(On())({
|
|
1429
|
+
name: "c",
|
|
1430
|
+
class: "c6fk2ph",
|
|
1431
|
+
propsAsIs: !0
|
|
1432
|
+
}), Cn = /* @__PURE__ */ o(En())({
|
|
1433
|
+
name: "d",
|
|
1434
|
+
class: "d1rdm136",
|
|
1435
|
+
propsAsIs: !0
|
|
1436
|
+
}), Rn = /* @__PURE__ */ o("div")({
|
|
1437
|
+
name: "f",
|
|
1438
|
+
class: "fwqnnel",
|
|
1439
|
+
propsAsIs: !1
|
|
1440
|
+
}), $n = /* @__PURE__ */ o("div")({
|
|
1441
|
+
name: "u",
|
|
1442
|
+
class: "ucyxnlg",
|
|
1443
|
+
propsAsIs: !1
|
|
1444
|
+
}), Un = {
|
|
1445
|
+
[P.LOST]: /* @__PURE__ */ a(ee, { name: "icon-cross" }),
|
|
1446
|
+
[P.WON]: /* @__PURE__ */ a(ee, { name: "icon-check" }),
|
|
1447
|
+
[P.UNSET]: void 0,
|
|
1448
|
+
[P.DNP]: /* @__PURE__ */ a(ee, { name: "icon-arrow" })
|
|
1449
|
+
}, Qn = ({
|
|
1450
|
+
questionId: t,
|
|
1451
|
+
questionType: e,
|
|
1452
|
+
questionStatus: s,
|
|
1453
|
+
subject: n,
|
|
1454
|
+
openForVoting: i,
|
|
1455
|
+
openQuestion: u,
|
|
1456
|
+
status: p
|
|
1457
|
+
}) => {
|
|
1458
|
+
const m = Oe[e], f = Un[p];
|
|
1459
|
+
return m ? /* @__PURE__ */ N(kn, { onClick: () => u == null ? void 0 : u(t), children: [
|
|
1460
|
+
/* @__PURE__ */ N($n, { children: [
|
|
1461
|
+
/* @__PURE__ */ N(bn, { children: [
|
|
1462
|
+
/* @__PURE__ */ a(Cn, { name: m.iconName }),
|
|
1463
|
+
/* @__PURE__ */ N(Rn, { children: [
|
|
1464
|
+
m.label,
|
|
1465
|
+
e === x.TRIVIA && s === re.RESOLVED && " • Expired"
|
|
1466
|
+
] })
|
|
1467
|
+
] }),
|
|
1468
|
+
/* @__PURE__ */ a(jn, { children: n || "" })
|
|
1469
|
+
] }),
|
|
1470
|
+
/* @__PURE__ */ a(Ln, { children: f || (i ? /* @__PURE__ */ a(wn, { children: "Play" }) : null) })
|
|
1471
|
+
] }) : null;
|
|
1472
|
+
};
|
|
1473
|
+
const qn = /* @__PURE__ */ o("div")({
|
|
1474
|
+
name: "n",
|
|
1475
|
+
class: "n1jcgove",
|
|
1476
|
+
propsAsIs: !1
|
|
1477
|
+
}), Yn = /* @__PURE__ */ o("button")({
|
|
1478
|
+
name: "l",
|
|
1479
|
+
class: "l1bwp7hh",
|
|
1480
|
+
propsAsIs: !1
|
|
1481
|
+
}), Pn = ({
|
|
1482
|
+
openInsight: t,
|
|
1483
|
+
questionId: e,
|
|
1484
|
+
...s
|
|
1485
|
+
}) => /* @__PURE__ */ N(qn, { children: [
|
|
1486
|
+
/* @__PURE__ */ a(qe, { questionId: e, ...s }),
|
|
1487
|
+
t && /* @__PURE__ */ a(Yn, { onClick: () => t(e), children: "View Insight" })
|
|
1488
|
+
] });
|
|
1489
|
+
const Wn = /* @__PURE__ */ o("div")({
|
|
1490
|
+
name: "t",
|
|
1491
|
+
class: "t19vr3p1",
|
|
1492
|
+
propsAsIs: !1
|
|
1493
|
+
}), Fn = ({ questions: t, openQuestion: e }) => /* @__PURE__ */ a(Wn, { children: t == null ? void 0 : t.map((s) => {
|
|
1494
|
+
var n, i;
|
|
1495
|
+
if (s.type === "question" && ((n = s.attributes) == null ? void 0 : n.attributes.case) === "question") {
|
|
1496
|
+
const u = s.attributes.attributes.value;
|
|
1497
|
+
return /* @__PURE__ */ a(Qn, { openQuestion: e, ...u }, u.questionId);
|
|
1498
|
+
}
|
|
1499
|
+
if (s.type === "insight" && ((i = s.attributes) == null ? void 0 : i.attributes.case) === "insight") {
|
|
1500
|
+
const u = s.attributes.attributes.value;
|
|
1501
|
+
return /* @__PURE__ */ a(Pn, { openInsight: e, ...u }, u.questionId);
|
|
1502
|
+
}
|
|
1503
|
+
return null;
|
|
1504
|
+
}) }), Vn = ({ store: t, openQuestion: e }) => {
|
|
1505
|
+
const s = b(t);
|
|
1506
|
+
return s != null && s.data ? /* @__PURE__ */ a(Fn, { openQuestion: e, questions: s.data }) : /* @__PURE__ */ a("div", { children: "wait questions..." });
|
|
1507
|
+
}, Hn = ({ userSummary: t }) => {
|
|
1508
|
+
var e;
|
|
1509
|
+
const s = b(t.getStore());
|
|
1510
|
+
return (e = s.data) != null && e.summary ? /* @__PURE__ */ a(Re, { ...s.data.summary, ...s.data.percentage }) : /* @__PURE__ */ a("div", { children: "wait user..." });
|
|
1511
|
+
}, Bn = ({ gamification: t }) => {
|
|
1512
|
+
const [e, s] = R(Q.HOME);
|
|
1513
|
+
return /* @__PURE__ */ N("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
|
|
1514
|
+
/* @__PURE__ */ N(je, { children: [
|
|
1515
|
+
/* @__PURE__ */ a(Gs, { activePage: e, toggleActivePage: s }),
|
|
1516
|
+
e === Q.HOME && /* @__PURE__ */ a(Hn, { userSummary: t.userSummary })
|
|
1517
|
+
] }),
|
|
1518
|
+
e === Q.HOME && /* @__PURE__ */ a(de, { children: /* @__PURE__ */ a(Vn, { openQuestion: t.openQuestion, store: t.feedList.getStore() }) }),
|
|
1519
|
+
e === Q.LEADERBOARD && /* @__PURE__ */ a(de, { style: { flex: "1 1 auto", paddingTop: 0, paddingBottom: 0 }, children: /* @__PURE__ */ a(Sn, { openUser: t.openUser, leaderboardList: t.leaderboardList }) })
|
|
1520
|
+
] });
|
|
1521
|
+
};
|
|
1522
|
+
const Gn = () => tt, we = /* @__PURE__ */ o(Gn())({
|
|
1523
|
+
name: "e",
|
|
1524
|
+
class: "e1ph66cs",
|
|
1525
|
+
propsAsIs: !0
|
|
1526
|
+
}), Zn = /* @__PURE__ */ o("div")({
|
|
1527
|
+
name: "x",
|
|
1528
|
+
class: "xorme7i",
|
|
1529
|
+
propsAsIs: !1
|
|
1530
|
+
}), ei = ({
|
|
1531
|
+
gamification: t,
|
|
1532
|
+
className: e
|
|
1533
|
+
}) => {
|
|
1534
|
+
const s = b(t.openedQuestion.$store), n = b(t.openedUser);
|
|
1535
|
+
return /* @__PURE__ */ N(H, {
|
|
1536
|
+
children: [s && /* @__PURE__ */ a(we, {
|
|
1537
|
+
className: e,
|
|
1538
|
+
children: /* @__PURE__ */ a(Ws, {
|
|
1539
|
+
gamification: t
|
|
1540
|
+
})
|
|
1541
|
+
}), n && /* @__PURE__ */ a(we, {
|
|
1542
|
+
className: e,
|
|
1543
|
+
children: /* @__PURE__ */ N(Zn, {
|
|
1544
|
+
children: [/* @__PURE__ */ a(Ce, {
|
|
1545
|
+
label: "Friend's Rank",
|
|
1546
|
+
close: t.closeUser
|
|
1547
|
+
}), /* @__PURE__ */ a(je, {
|
|
1548
|
+
children: /* @__PURE__ */ a(Re, {
|
|
1549
|
+
...n
|
|
1550
|
+
})
|
|
1551
|
+
})]
|
|
1552
|
+
})
|
|
1553
|
+
}), /* @__PURE__ */ a(be, {
|
|
1554
|
+
className: e,
|
|
1555
|
+
"data-nav": "true",
|
|
1556
|
+
children: /* @__PURE__ */ a(Bn, {
|
|
1557
|
+
gamification: t
|
|
1558
|
+
})
|
|
1559
|
+
})]
|
|
1560
|
+
});
|
|
1561
|
+
};
|
|
1562
|
+
export {
|
|
1563
|
+
ei as GamificationOverlay,
|
|
1564
|
+
ei as default
|
|
1565
|
+
};
|