@streamlayer/react 0.29.9 → 0.29.11

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