@streamlayer/react 0.28.3 → 0.28.5

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.
@@ -0,0 +1,2700 @@
1
+ import { jsxs as S, jsx as m, Fragment as Se } from "react/jsx-runtime";
2
+ import { s as y, e as J } from "./index-05d85ab5.js";
3
+ import { useStore as ie } from "@nanostores/react";
4
+ import { o as Mt, r as At, w as Et, e as Tt, n as nt, f as Yt } from "./masters-0748e717.js";
5
+ import { useState as Ie, useCallback as qe, useMemo as ke, Component as Wt, createElement as ve, PureComponent as Nt } from "react";
6
+ import { QuestionType as W, QuestionImages as ue, QuestionStatus as Je, PickHistoryStatus as Te } from "@streamlayer/sdk-web-types";
7
+ import { e as vt, a as _t } from "./common-0311b835.js";
8
+ import { CountdownCircleTimer as Vt } from "react-countdown-circle-timer";
9
+ import { E as de } from "./index-0d23b24e.js";
10
+ import "@streamlayer/sdk-web-interfaces";
11
+ import "@streamlayer/sdk-web-notifications";
12
+ import "./es/useStreamLayerApp.js";
13
+ import "@streamlayer/sdk-web";
14
+ const Ht = () => J, Gt = () => J, Zt = /* @__PURE__ */ y("div")({
15
+ name: "a",
16
+ class: "acysrl1",
17
+ propsAsIs: !1
18
+ }), Jt = /* @__PURE__ */ y("div")({
19
+ name: "l",
20
+ class: "lo57cjm",
21
+ propsAsIs: !1
22
+ }), Kt = /* @__PURE__ */ y(Ht())({
23
+ name: "p",
24
+ class: "p14kwh4y",
25
+ propsAsIs: !0
26
+ }), Xt = /* @__PURE__ */ y("span")({
27
+ name: "s",
28
+ class: "sxun7sq",
29
+ propsAsIs: !1
30
+ }), er = /* @__PURE__ */ y("button")({
31
+ name: "c",
32
+ class: "c1i8ida8",
33
+ propsAsIs: !1
34
+ }), tr = /* @__PURE__ */ y(Gt())({
35
+ name: "g",
36
+ class: "g1m0xfmw",
37
+ propsAsIs: !0
38
+ }), St = ({ type: n, close: i, label: a }) => {
39
+ const c = n ? Mt[n] : { label: a, iconName: void 0 };
40
+ return /* @__PURE__ */ S(Zt, { children: [
41
+ /* @__PURE__ */ S(Jt, { children: [
42
+ (c == null ? void 0 : c.iconName) && /* @__PURE__ */ m(Kt, { name: c.iconName }),
43
+ (c == null ? void 0 : c.label) && /* @__PURE__ */ m(Xt, { children: c.label })
44
+ ] }),
45
+ /* @__PURE__ */ m(er, { onClick: i, children: /* @__PURE__ */ m(tr, { name: "icon-cross" }) })
46
+ ] });
47
+ };
48
+ const rr = /* @__PURE__ */ y("div")({
49
+ name: "t",
50
+ class: "taj61ja",
51
+ propsAsIs: !1
52
+ }), ir = /* @__PURE__ */ y("div")({
53
+ name: "r",
54
+ class: "r19fxewd",
55
+ propsAsIs: !1
56
+ }), nr = /* @__PURE__ */ y("div")({
57
+ name: "i",
58
+ class: "i1whkbqh",
59
+ propsAsIs: !1
60
+ }), st = ({ indicator: n, title: i }) => /* @__PURE__ */ S(rr, { children: [
61
+ /* @__PURE__ */ m(ir, { children: i }),
62
+ /* @__PURE__ */ m(nr, { children: n })
63
+ ] });
64
+ const sr = /* @__PURE__ */ y("div")({
65
+ name: "i",
66
+ class: "i4lbhzs",
67
+ propsAsIs: !1
68
+ }), or = /* @__PURE__ */ y("div")({
69
+ name: "o",
70
+ class: "ordquhq",
71
+ propsAsIs: !1
72
+ }), ar = /* @__PURE__ */ y("div")({
73
+ name: "n",
74
+ class: "nwzed99",
75
+ propsAsIs: !1
76
+ }), Ne = ({ indicator: n, title: i }) => /* @__PURE__ */ S(sr, { children: [
77
+ /* @__PURE__ */ m(or, { children: n }),
78
+ /* @__PURE__ */ m(ar, { children: i })
79
+ ] });
80
+ const lr = /* @__PURE__ */ y("div")({
81
+ name: "o",
82
+ class: "o15y0waw",
83
+ propsAsIs: !1
84
+ }), cr = /* @__PURE__ */ y("div")({
85
+ name: "i",
86
+ class: "ihjewwf",
87
+ propsAsIs: !1
88
+ }), ur = /* @__PURE__ */ y("div")({
89
+ name: "n",
90
+ class: "n10e9lv8",
91
+ propsAsIs: !1
92
+ }), dr = /* @__PURE__ */ y("div")({
93
+ name: "r",
94
+ class: "r13bxv",
95
+ propsAsIs: !1
96
+ }), hr = /* @__PURE__ */ y("img")({
97
+ name: "a",
98
+ class: "a1fi59c9",
99
+ propsAsIs: !1
100
+ }), pr = /* @__PURE__ */ y("div")({
101
+ name: "s",
102
+ class: "s1kkihge",
103
+ propsAsIs: !1
104
+ }), fr = /* @__PURE__ */ y("div")({
105
+ name: "c",
106
+ class: "cy4f4t",
107
+ propsAsIs: !1
108
+ }), mr = /* @__PURE__ */ y("div")({
109
+ name: "p",
110
+ class: "p18cnlx1",
111
+ propsAsIs: !1
112
+ }), gr = /* @__PURE__ */ y("img")({
113
+ name: "l",
114
+ class: "lboqgs5",
115
+ propsAsIs: !1
116
+ }), yr = /* @__PURE__ */ y("div")({
117
+ name: "d",
118
+ class: "d1oaal4",
119
+ propsAsIs: !1
120
+ }), Ir = /* @__PURE__ */ y("div")({
121
+ name: "x",
122
+ class: "x1yzgo0u",
123
+ propsAsIs: !1
124
+ }), xr = /* @__PURE__ */ y("div")({
125
+ name: "f",
126
+ class: "f1l9i8s8",
127
+ propsAsIs: !1
128
+ }), wr = /* @__PURE__ */ y("div")({
129
+ name: "g",
130
+ class: "g4cgl4u",
131
+ propsAsIs: !1
132
+ }), Mr = /* @__PURE__ */ y("div")({
133
+ name: "h",
134
+ class: "h1qn1tmd",
135
+ propsAsIs: !1
136
+ }), Ar = /* @__PURE__ */ y("div")({
137
+ name: "u",
138
+ class: "u1gsbhq4",
139
+ propsAsIs: !1
140
+ }), Er = /* @__PURE__ */ y("div")({
141
+ name: "m",
142
+ class: "mvj8oco",
143
+ propsAsIs: !1
144
+ }), Tr = /* @__PURE__ */ y("button")({
145
+ name: "v",
146
+ class: "viqiaf2",
147
+ propsAsIs: !1
148
+ }), Nr = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=", zt = ({
149
+ avatar: n,
150
+ name: i,
151
+ points: a,
152
+ friendsRank: c,
153
+ rank: u,
154
+ streak: g,
155
+ correct: f,
156
+ incorrect: o,
157
+ inTop: w,
158
+ average: N
159
+ }) => /* @__PURE__ */ S(lr, { children: [
160
+ /* @__PURE__ */ m(cr, { children: /* @__PURE__ */ S(dr, { children: [
161
+ /* @__PURE__ */ S(Tr, { children: [
162
+ n && /* @__PURE__ */ m(hr, { alt: "avatar", src: n }),
163
+ !n && /* @__PURE__ */ m(Er, { children: vt(i || "") })
164
+ ] }),
165
+ /* @__PURE__ */ S(pr, { children: [
166
+ /* @__PURE__ */ m(fr, { children: i }),
167
+ /* @__PURE__ */ S(mr, { children: [
168
+ /* @__PURE__ */ S(yr, { children: [
169
+ /* @__PURE__ */ m(gr, { alt: "rank-icon", src: Nr }),
170
+ /* @__PURE__ */ S(Ir, { children: [
171
+ _t(a),
172
+ /* @__PURE__ */ m(xr, { children: "PTS" })
173
+ ] })
174
+ ] }),
175
+ /* @__PURE__ */ m(wr, {}),
176
+ /* @__PURE__ */ S("div", { children: [
177
+ "TOP ",
178
+ w || 0,
179
+ "%"
180
+ ] })
181
+ ] })
182
+ ] })
183
+ ] }) }),
184
+ /* @__PURE__ */ S(ur, { children: [
185
+ /* @__PURE__ */ S(Mr, { children: [
186
+ /* @__PURE__ */ m(st, { indicator: c || 0, title: "Friends rank" }),
187
+ /* @__PURE__ */ m(st, { indicator: u || 0, title: "Global rank" })
188
+ ] }),
189
+ /* @__PURE__ */ S(Ar, { children: [
190
+ /* @__PURE__ */ m(Ne, { indicator: g || 0, title: "Win streak" }),
191
+ /* @__PURE__ */ m(Ne, { indicator: f || 0, title: "Correct" }),
192
+ /* @__PURE__ */ m(Ne, { indicator: o || 0, title: "Incorrect" }),
193
+ /* @__PURE__ */ m(Ne, { indicator: `${N || 0}%`, title: "Succ. rate" })
194
+ ] })
195
+ ] })
196
+ ] });
197
+ const vr = () => J, _r = /* @__PURE__ */ y("div")({
198
+ name: "c",
199
+ class: "ciyeb68",
200
+ propsAsIs: !1
201
+ }), Sr = /* @__PURE__ */ y(vr())({
202
+ name: "n",
203
+ class: "nfic4xc",
204
+ propsAsIs: !0
205
+ }), zr = /* @__PURE__ */ y("div")({
206
+ name: "d",
207
+ class: "d1pd1p66",
208
+ propsAsIs: !1
209
+ }), Dr = /* @__PURE__ */ y("div")({
210
+ name: "p",
211
+ class: "p132yxcv",
212
+ propsAsIs: !1
213
+ }), br = /* @__PURE__ */ y("span")({
214
+ name: "l",
215
+ class: "l4a8aw",
216
+ propsAsIs: !1
217
+ }), ot = /* @__PURE__ */ y("span")({
218
+ name: "g",
219
+ class: "gzdx7pk",
220
+ propsAsIs: !1
221
+ }), Or = ({
222
+ feedbackMessages: n,
223
+ questionVotedCorrectly: i,
224
+ questionVoted: a,
225
+ questionType: c,
226
+ hasCorrectAnswer: u
227
+ }) => {
228
+ if (!(a && (c === W.TRIVIA || c === W.PREDICTION)))
229
+ return null;
230
+ const g = c === W.PREDICTION && !u, f = i ? "correct" : "incorrect", o = i ? n.correctFeedback : n.incorrectFeedback;
231
+ return /* @__PURE__ */ S(_r, { "data-isPrediction": g, children: [
232
+ g && /* @__PURE__ */ S(Se, { children: [
233
+ /* @__PURE__ */ m(Sr, { name: "icon-prediction" }),
234
+ /* @__PURE__ */ m(ot, { children: "Stay tuned to see if your prediction was correct." })
235
+ ] }),
236
+ u && /* @__PURE__ */ S(Se, { children: [
237
+ /* @__PURE__ */ m(zr, { "data-feedbackType": f, children: /* @__PURE__ */ m(J, { name: f }) }),
238
+ /* @__PURE__ */ m("div", { children: /* @__PURE__ */ S(Dr, { children: [
239
+ /* @__PURE__ */ m(br, { "data-feedbackType": f, children: o == null ? void 0 : o.title }),
240
+ /* @__PURE__ */ m(ot, { children: o == null ? void 0 : o.description })
241
+ ] }) })
242
+ ] })
243
+ ] });
244
+ };
245
+ const Br = /* @__PURE__ */ y("div")({
246
+ name: "o",
247
+ class: "olc1eph",
248
+ propsAsIs: !1
249
+ }), Lr = /* @__PURE__ */ y("div")({
250
+ name: "n",
251
+ class: "n1yoh29a",
252
+ propsAsIs: !1
253
+ }), Cr = /* @__PURE__ */ y("div")({
254
+ name: "p",
255
+ class: "pjkr5mb",
256
+ propsAsIs: !1
257
+ }), Rr = /* @__PURE__ */ y("div")({
258
+ name: "r",
259
+ class: "r82wnnx",
260
+ propsAsIs: !1
261
+ });
262
+ const kr = () => Dt, Ur = () => Dt, jr = () => J, Fr = /* @__PURE__ */ y("button")({
263
+ name: "c",
264
+ class: "cpm4u8k",
265
+ propsAsIs: !1
266
+ }), $r = /* @__PURE__ */ y("div")({
267
+ name: "l",
268
+ class: "lwfomc3",
269
+ propsAsIs: !1
270
+ }), Qr = /* @__PURE__ */ y("span")({
271
+ name: "d",
272
+ class: "dmltvg2",
273
+ propsAsIs: !1
274
+ }), Pr = /* @__PURE__ */ y("div")({
275
+ name: "s",
276
+ class: "stfjpqz",
277
+ propsAsIs: !1
278
+ }), qr = /* @__PURE__ */ y("div")({
279
+ name: "p",
280
+ class: "p198m24r",
281
+ propsAsIs: !1
282
+ }), Dt = /* @__PURE__ */ y("img")({
283
+ name: "r",
284
+ class: "rbq5eu7",
285
+ propsAsIs: !1
286
+ }), Yr = /* @__PURE__ */ y(kr())({
287
+ name: "g",
288
+ class: "g1iv6oeb",
289
+ propsAsIs: !0
290
+ }), Wr = /* @__PURE__ */ y(Ur())({
291
+ name: "h",
292
+ class: "h1qtxlqc",
293
+ propsAsIs: !0
294
+ }), Vr = /* @__PURE__ */ y("span")({
295
+ name: "u",
296
+ class: "udm736q",
297
+ propsAsIs: !1
298
+ }), Hr = /* @__PURE__ */ y("span")({
299
+ name: "b",
300
+ class: "b1da34tx",
301
+ propsAsIs: !1
302
+ }), Gr = /* @__PURE__ */ y("span")({
303
+ name: "x",
304
+ class: "x1dqwq83",
305
+ propsAsIs: !1
306
+ }), Zr = /* @__PURE__ */ y(jr())({
307
+ name: "v",
308
+ class: "v10s9my2",
309
+ propsAsIs: !0
310
+ }), at = {
311
+ [ue.CENTERED]: (n) => /* @__PURE__ */ m(Yr, { alt: "option-icon", src: n }),
312
+ [ue.TRANSPARENT]: (n) => /* @__PURE__ */ m(Pr, { children: /* @__PURE__ */ m(qr, { style: { backgroundImage: `url(${n})` } }) }),
313
+ [ue.ROUNDED]: (n) => /* @__PURE__ */ m(Wr, { alt: "option-icon", src: n }),
314
+ [ue.NONE]: () => null,
315
+ [ue.UNSET]: () => null
316
+ }, Jr = ({ questionType: n, hasCorrectAnswer: i, correct: a, youVoted: c, questionVoted: u }) => {
317
+ if (n === W.POLL && c)
318
+ return "correct";
319
+ if (n === W.PREDICTION) {
320
+ if (i && u)
321
+ return c ? a ? "correct" : "incorrect" : a ? "correct" : "unset";
322
+ if (c)
323
+ return "correct";
324
+ }
325
+ return n === W.TRIVIA && u ? c ? a ? "correct" : "incorrect" : a ? "correct" : "unset" : "unset";
326
+ }, Kr = ({
327
+ questionType: n,
328
+ questionVoted: i,
329
+ correct: a,
330
+ hasCorrectAnswer: c,
331
+ questionStatus: u
332
+ }) => n === W.TRIVIA ? i && a : n === W.PREDICTION ? i && a && c || u === Je.RESOLVED && a : !1, Xr = (n) => {
333
+ var i;
334
+ const {
335
+ // option props
336
+ id: a,
337
+ icon: c,
338
+ text: u,
339
+ percentageDecimal: g,
340
+ // extra props
341
+ onVote: f,
342
+ youSelected: o,
343
+ questionVoted: w,
344
+ // ToDo: Figure out why imageMode is not in the response, and delete default value
345
+ imageMode: N = ue.ROUNDED,
346
+ answerTimeExpired: v,
347
+ questionStatus: _,
348
+ isLoading: I,
349
+ questionType: E,
350
+ correct: T,
351
+ hasCorrectAnswer: h
352
+ } = n, M = Jr(n), x = Kr({ questionType: E, questionVoted: w, correct: T, hasCorrectAnswer: h, questionStatus: _ }), A = w || _ === Je.RESOLVED && E === W.PREDICTION;
353
+ return /* @__PURE__ */ S(
354
+ Fr,
355
+ {
356
+ value: a,
357
+ "data-selected": o,
358
+ "data-answerState": M,
359
+ disabled: w || I || v,
360
+ onClick: f,
361
+ children: [
362
+ A && /* @__PURE__ */ m($r, { "data-answerState": M, style: { width: `${g}%` } }),
363
+ /* @__PURE__ */ S(Qr, { children: [
364
+ c && ((i = at[N]) == null ? void 0 : i.call(at, c)),
365
+ /* @__PURE__ */ m(Vr, { children: u }),
366
+ A && /* @__PURE__ */ S(Hr, { children: [
367
+ x && /* @__PURE__ */ m(Zr, { name: "selected" }),
368
+ /* @__PURE__ */ S(Gr, { children: [
369
+ g,
370
+ "%"
371
+ ] })
372
+ ] })
373
+ ] })
374
+ ]
375
+ }
376
+ );
377
+ };
378
+ const ei = [de.PRIMARY_GREEN1, de.SECONDARY_RED1, de.SECONDARY_RED1], ti = [10, 10, 0], ri = /* @__PURE__ */ y("div")({
379
+ name: "A",
380
+ class: "a1f928zy",
381
+ propsAsIs: !1
382
+ }), ii = de.SECONDARY_GREEN6, lt = de.SECONDARY_RED3, ni = de.NEUTRALS_GRAY3, si = ({
383
+ isPlaying: n = !0,
384
+ duration: i = 30,
385
+ onTimerExpired: a
386
+ }) => {
387
+ const [c, u] = Ie(i > 10 ? ii : lt), g = ({
388
+ remainingTime: w
389
+ }) => /* @__PURE__ */ m(ri, {
390
+ children: w
391
+ }), f = qe(() => {
392
+ a == null || a(), u(ni);
393
+ }, [a, u]), o = qe((w) => {
394
+ w === 10 && u(lt);
395
+ }, [u]);
396
+ return /* @__PURE__ */ m(Vt, {
397
+ isPlaying: n,
398
+ duration: i,
399
+ colors: ei,
400
+ colorsTime: ti,
401
+ size: 32,
402
+ strokeWidth: 2,
403
+ trailStrokeWidth: 2,
404
+ trailColor: c,
405
+ onComplete: f,
406
+ onUpdate: o,
407
+ children: g
408
+ });
409
+ };
410
+ const oi = () => J, ai = /* @__PURE__ */ y("div")({
411
+ name: "a",
412
+ class: "a1r7f3z4",
413
+ propsAsIs: !1
414
+ }), li = /* @__PURE__ */ y("div")({
415
+ name: "s",
416
+ class: "sblndl",
417
+ propsAsIs: !1
418
+ }), ci = /* @__PURE__ */ y("div")({
419
+ name: "l",
420
+ class: "l7ka1tv",
421
+ propsAsIs: !1
422
+ }), ui = /* @__PURE__ */ y(oi())({
423
+ name: "p",
424
+ class: "p1edlxt3",
425
+ propsAsIs: !0
426
+ }), di = /* @__PURE__ */ y("div")({
427
+ name: "g",
428
+ class: "ghm08u2",
429
+ propsAsIs: !1
430
+ }), hi = /* @__PURE__ */ y("span")({
431
+ name: "c",
432
+ class: "c12nsh46",
433
+ propsAsIs: !1
434
+ }), pi = /* @__PURE__ */ y("span")({
435
+ name: "d",
436
+ class: "dlr9eoc",
437
+ propsAsIs: !1
438
+ }), fi = ({ title: n, points: i, isPlayingTimer: a, isTimer: c, onTimerExpired: u }) => /* @__PURE__ */ S(ai, { children: [
439
+ /* @__PURE__ */ S(li, { children: [
440
+ n && /* @__PURE__ */ m(ci, { children: n }),
441
+ i !== void 0 && /* @__PURE__ */ S(Se, { children: [
442
+ /* @__PURE__ */ m(ui, { name: "icon-trophy" }),
443
+ /* @__PURE__ */ S(di, { children: [
444
+ /* @__PURE__ */ m(hi, { children: i }),
445
+ /* @__PURE__ */ m(pi, { children: "PTS" })
446
+ ] })
447
+ ] })
448
+ ] }),
449
+ c && /* @__PURE__ */ m(si, { isPlaying: a, onTimerExpired: u })
450
+ ] }), mi = ({ openedQuestion: n, vote: i }) => {
451
+ var a;
452
+ const c = n.subject, u = n.type, g = (a = n.options) == null ? void 0 : a.options, [f, o] = Ie(!1), [w, N] = Ie(!1), [v, _] = Ie(""), I = n == null ? void 0 : n.id, E = qe(
453
+ async (A) => {
454
+ if (I) {
455
+ const z = A.currentTarget.value;
456
+ _(z), N(!0), await i(I, z), N(!1);
457
+ }
458
+ },
459
+ [I, _, i]
460
+ ), T = ke(
461
+ () => n == null ? void 0 : n.answers.find((A) => A.youVoted === !0),
462
+ [n]
463
+ ), h = ke(
464
+ () => !!(n != null && n.answers.find((A) => A.correct === !0)),
465
+ [n]
466
+ ), M = ke(() => n ? n.answers.map((A) => ({
467
+ ...A,
468
+ questionVoted: !!T,
469
+ youSelected: v === A.id,
470
+ isLoading: w,
471
+ hasCorrectAnswer: h,
472
+ questionType: n.type,
473
+ answerTimeExpired: f,
474
+ questionStatus: n.status,
475
+ // ToDo: Figure out why imageMode is not in the response
476
+ onVote: E
477
+ })) : [], [h, f, w, n, T, E, v]), x = g && (g.case === "trivia" || g.case === "prediction") ? g.value : void 0;
478
+ return /* @__PURE__ */ m(At, { "data-question-header": "true", children: /* @__PURE__ */ m(Br, { children: /* @__PURE__ */ S(Lr, { children: [
479
+ x && /* @__PURE__ */ m(
480
+ Or,
481
+ {
482
+ feedbackMessages: x,
483
+ questionVoted: !!T,
484
+ questionVotedCorrectly: T == null ? void 0 : T.correct,
485
+ questionType: u,
486
+ hasCorrectAnswer: h
487
+ }
488
+ ),
489
+ /* @__PURE__ */ m(
490
+ fi,
491
+ {
492
+ title: f ? "Expired" : "To win",
493
+ points: f ? void 0 : 100,
494
+ onTimerExpired: () => o(!0),
495
+ isTimer: !0
496
+ }
497
+ ),
498
+ /* @__PURE__ */ m(Cr, { children: c }),
499
+ /* @__PURE__ */ m(Rr, { children: M.map((A) => /* @__PURE__ */ m(Xr, { ...A }, A.id)) })
500
+ ] }) }) });
501
+ };
502
+ const gi = /* @__PURE__ */ y("div")({
503
+ name: "e",
504
+ class: "e18unvw4",
505
+ propsAsIs: !1
506
+ }), yi = /* @__PURE__ */ y("div")({
507
+ name: "r",
508
+ class: "rs0uvk8",
509
+ propsAsIs: !1
510
+ }), Ii = /* @__PURE__ */ y("h3")({
511
+ name: "n",
512
+ class: "n1hem4g7",
513
+ propsAsIs: !1
514
+ }), xi = /* @__PURE__ */ y("div")({
515
+ name: "i",
516
+ class: "i193lbwv",
517
+ propsAsIs: !1
518
+ }), wi = /* @__PURE__ */ y("a")({
519
+ name: "a",
520
+ class: "a1dka9qs",
521
+ propsAsIs: !1
522
+ }), Mi = /* @__PURE__ */ y("div")({
523
+ name: "l",
524
+ class: "l1un98tk",
525
+ propsAsIs: !1
526
+ }), Ai = ({
527
+ created: n,
528
+ title: i,
529
+ instantView: a
530
+ }) => {
531
+ const c = new Date(n), u = c.toLocaleDateString("en-US", {
532
+ weekday: "short",
533
+ month: "short",
534
+ day: "numeric"
535
+ }), g = c.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit" });
536
+ return /* @__PURE__ */ S(gi, { children: [
537
+ /* @__PURE__ */ S(Mi, { children: [
538
+ u,
539
+ "・",
540
+ g
541
+ ] }),
542
+ (a == null ? void 0 : a.video) && /* @__PURE__ */ m(Et, { source: a.video.url, poster: a.video.thumbnailUrl }),
543
+ /* @__PURE__ */ S(yi, { children: [
544
+ /* @__PURE__ */ m(Ii, { children: (a == null ? void 0 : a.heading) || i }),
545
+ /* @__PURE__ */ m(xi, { children: a == null ? void 0 : a.body }),
546
+ (a == null ? void 0 : a.webLink) && /* @__PURE__ */ S(wi, { href: a == null ? void 0 : a.webLink.url, target: "_blank", children: [
547
+ "Explore more of the Masters History",
548
+ /* @__PURE__ */ m(J, { name: "icon-external-link" })
549
+ ] })
550
+ ] })
551
+ ] });
552
+ };
553
+ const Ei = /* @__PURE__ */ y("div")({
554
+ name: "d",
555
+ class: "dk8r1eq",
556
+ propsAsIs: !1
557
+ }), Ti = ({
558
+ openedQuestion: n
559
+ }) => {
560
+ var i;
561
+ return ((i = n == null ? void 0 : n.attributes) == null ? void 0 : i.attributes.case) === "insight" ? /* @__PURE__ */ m(Ai, {
562
+ created: n.attributes.created,
563
+ ...n.attributes.attributes.value
564
+ }) : null;
565
+ }, Ni = ({
566
+ extendedQuestion: n,
567
+ vote: i
568
+ }) => {
569
+ const {
570
+ loading: a,
571
+ data: c
572
+ } = n;
573
+ return !a && c ? /* @__PURE__ */ m(mi, {
574
+ vote: i,
575
+ openedQuestion: c
576
+ }) : null;
577
+ }, vi = ({
578
+ gamification: n
579
+ }) => {
580
+ var i;
581
+ const a = ie(n.openedQuestion.$store), c = ie(n.openedQuestion.$extendedStore);
582
+ if (!a)
583
+ return null;
584
+ const u = a.type;
585
+ return /* @__PURE__ */ S(Ei, {
586
+ children: [/* @__PURE__ */ m(St, {
587
+ close: n.closeQuestion,
588
+ type: ((i = a.attributes) == null ? void 0 : i.type) || W.UNSET
589
+ }), u === "question" && /* @__PURE__ */ m(Ni, {
590
+ vote: n.submitAnswer,
591
+ extendedQuestion: c
592
+ }), u !== "question" && /* @__PURE__ */ m(Ti, {
593
+ openedQuestion: a
594
+ })]
595
+ });
596
+ };
597
+ const _i = /* @__PURE__ */ y("div")({
598
+ name: "t",
599
+ class: "tcim9sm",
600
+ propsAsIs: !1
601
+ }), Si = /* @__PURE__ */ y("div")({
602
+ name: "e",
603
+ class: "e8wco6o",
604
+ propsAsIs: !1
605
+ }), zi = /* @__PURE__ */ y("button")({
606
+ name: "n",
607
+ class: "n1ardwzl",
608
+ propsAsIs: !1
609
+ }), Di = /* @__PURE__ */ y("span")({
610
+ name: "i",
611
+ class: "i1vk8ojx",
612
+ propsAsIs: !1
613
+ });
614
+ var ye = /* @__PURE__ */ ((n) => (n.HOME = "home", n.LEADERBOARD = "leaderboard", n))(ye || {});
615
+ const ct = ({ title: n, active: i, onClick: a }) => /* @__PURE__ */ m(zi, { onClick: a, "data-selected": i, children: /* @__PURE__ */ m(Di, { children: n }) }), bi = ({ activePage: n = "home", toggleActivePage: i }) => /* @__PURE__ */ m(_i, { children: /* @__PURE__ */ S(Si, { "data-position": n === "home" ? "left" : "right", children: [
616
+ /* @__PURE__ */ m(ct, { title: "Home", active: n === "home", onClick: () => i(
617
+ "home"
618
+ /* HOME */
619
+ ) }),
620
+ /* @__PURE__ */ m(
621
+ ct,
622
+ {
623
+ title: "Leader Board",
624
+ active: n === "leaderboard",
625
+ onClick: () => i(
626
+ "leaderboard"
627
+ /* LEADERBOARD */
628
+ )
629
+ }
630
+ )
631
+ ] }) });
632
+ var bt = {}, Ot = {}, ze = {};
633
+ ze.byteLength = Li;
634
+ ze.toByteArray = Ri;
635
+ ze.fromByteArray = ji;
636
+ var Z = [], Q = [], Oi = typeof Uint8Array < "u" ? Uint8Array : Array, Ue = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
637
+ for (var le = 0, Bi = Ue.length; le < Bi; ++le)
638
+ Z[le] = Ue[le], Q[Ue.charCodeAt(le)] = le;
639
+ Q["-".charCodeAt(0)] = 62;
640
+ Q["_".charCodeAt(0)] = 63;
641
+ function Bt(n) {
642
+ var i = n.length;
643
+ if (i % 4 > 0)
644
+ throw new Error("Invalid string. Length must be a multiple of 4");
645
+ var a = n.indexOf("=");
646
+ a === -1 && (a = i);
647
+ var c = a === i ? 0 : 4 - a % 4;
648
+ return [a, c];
649
+ }
650
+ function Li(n) {
651
+ var i = Bt(n), a = i[0], c = i[1];
652
+ return (a + c) * 3 / 4 - c;
653
+ }
654
+ function Ci(n, i, a) {
655
+ return (i + a) * 3 / 4 - a;
656
+ }
657
+ function Ri(n) {
658
+ var i, a = Bt(n), c = a[0], u = a[1], g = new Oi(Ci(n, c, u)), f = 0, o = u > 0 ? c - 4 : c, w;
659
+ for (w = 0; w < o; w += 4)
660
+ i = Q[n.charCodeAt(w)] << 18 | Q[n.charCodeAt(w + 1)] << 12 | Q[n.charCodeAt(w + 2)] << 6 | Q[n.charCodeAt(w + 3)], g[f++] = i >> 16 & 255, g[f++] = i >> 8 & 255, g[f++] = i & 255;
661
+ return u === 2 && (i = Q[n.charCodeAt(w)] << 2 | Q[n.charCodeAt(w + 1)] >> 4, g[f++] = i & 255), u === 1 && (i = Q[n.charCodeAt(w)] << 10 | Q[n.charCodeAt(w + 1)] << 4 | Q[n.charCodeAt(w + 2)] >> 2, g[f++] = i >> 8 & 255, g[f++] = i & 255), g;
662
+ }
663
+ function ki(n) {
664
+ return Z[n >> 18 & 63] + Z[n >> 12 & 63] + Z[n >> 6 & 63] + Z[n & 63];
665
+ }
666
+ function Ui(n, i, a) {
667
+ for (var c, u = [], g = i; g < a; g += 3)
668
+ c = (n[g] << 16 & 16711680) + (n[g + 1] << 8 & 65280) + (n[g + 2] & 255), u.push(ki(c));
669
+ return u.join("");
670
+ }
671
+ function ji(n) {
672
+ for (var i, a = n.length, c = a % 3, u = [], g = 16383, f = 0, o = a - c; f < o; f += g)
673
+ u.push(Ui(n, f, f + g > o ? o : f + g));
674
+ return c === 1 ? (i = n[a - 1], u.push(
675
+ Z[i >> 2] + Z[i << 4 & 63] + "=="
676
+ )) : c === 2 && (i = (n[a - 2] << 8) + n[a - 1], u.push(
677
+ Z[i >> 10] + Z[i >> 4 & 63] + Z[i << 2 & 63] + "="
678
+ )), u.join("");
679
+ }
680
+ var Ke = {};
681
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
682
+ Ke.read = function(n, i, a, c, u) {
683
+ var g, f, o = u * 8 - c - 1, w = (1 << o) - 1, N = w >> 1, v = -7, _ = a ? u - 1 : 0, I = a ? -1 : 1, E = n[i + _];
684
+ for (_ += I, g = E & (1 << -v) - 1, E >>= -v, v += o; v > 0; g = g * 256 + n[i + _], _ += I, v -= 8)
685
+ ;
686
+ for (f = g & (1 << -v) - 1, g >>= -v, v += c; v > 0; f = f * 256 + n[i + _], _ += I, v -= 8)
687
+ ;
688
+ if (g === 0)
689
+ g = 1 - N;
690
+ else {
691
+ if (g === w)
692
+ return f ? NaN : (E ? -1 : 1) * (1 / 0);
693
+ f = f + Math.pow(2, c), g = g - N;
694
+ }
695
+ return (E ? -1 : 1) * f * Math.pow(2, g - c);
696
+ };
697
+ Ke.write = function(n, i, a, c, u, g) {
698
+ var f, o, w, N = g * 8 - u - 1, v = (1 << N) - 1, _ = v >> 1, I = u === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, E = c ? 0 : g - 1, T = c ? 1 : -1, h = i < 0 || i === 0 && 1 / i < 0 ? 1 : 0;
699
+ for (i = Math.abs(i), isNaN(i) || i === 1 / 0 ? (o = isNaN(i) ? 1 : 0, f = v) : (f = Math.floor(Math.log(i) / Math.LN2), i * (w = Math.pow(2, -f)) < 1 && (f--, w *= 2), f + _ >= 1 ? i += I / w : i += I * Math.pow(2, 1 - _), i * w >= 2 && (f++, w /= 2), f + _ >= v ? (o = 0, f = v) : f + _ >= 1 ? (o = (i * w - 1) * Math.pow(2, u), f = f + _) : (o = i * Math.pow(2, _ - 1) * Math.pow(2, u), f = 0)); u >= 8; n[a + E] = o & 255, E += T, o /= 256, u -= 8)
700
+ ;
701
+ for (f = f << u | o, N += u; N > 0; n[a + E] = f & 255, E += T, f /= 256, N -= 8)
702
+ ;
703
+ n[a + E - T] |= h * 128;
704
+ };
705
+ /*!
706
+ * The buffer module from node.js, for the browser.
707
+ *
708
+ * @author Feross Aboukhadijeh <https://feross.org>
709
+ * @license MIT
710
+ */
711
+ (function(n) {
712
+ const i = ze, a = Ke, c = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
713
+ n.Buffer = o, n.SlowBuffer = A, n.INSPECT_MAX_BYTES = 50;
714
+ const u = 2147483647;
715
+ n.kMaxLength = u, o.TYPED_ARRAY_SUPPORT = g(), !o.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
716
+ "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
717
+ );
718
+ function g() {
719
+ try {
720
+ const r = new Uint8Array(1), e = { foo: function() {
721
+ return 42;
722
+ } };
723
+ return Object.setPrototypeOf(e, Uint8Array.prototype), Object.setPrototypeOf(r, e), r.foo() === 42;
724
+ } catch {
725
+ return !1;
726
+ }
727
+ }
728
+ Object.defineProperty(o.prototype, "parent", {
729
+ enumerable: !0,
730
+ get: function() {
731
+ if (o.isBuffer(this))
732
+ return this.buffer;
733
+ }
734
+ }), Object.defineProperty(o.prototype, "offset", {
735
+ enumerable: !0,
736
+ get: function() {
737
+ if (o.isBuffer(this))
738
+ return this.byteOffset;
739
+ }
740
+ });
741
+ function f(r) {
742
+ if (r > u)
743
+ throw new RangeError('The value "' + r + '" is invalid for option "size"');
744
+ const e = new Uint8Array(r);
745
+ return Object.setPrototypeOf(e, o.prototype), e;
746
+ }
747
+ function o(r, e, t) {
748
+ if (typeof r == "number") {
749
+ if (typeof e == "string")
750
+ throw new TypeError(
751
+ 'The "string" argument must be of type string. Received type number'
752
+ );
753
+ return _(r);
754
+ }
755
+ return w(r, e, t);
756
+ }
757
+ o.poolSize = 8192;
758
+ function w(r, e, t) {
759
+ if (typeof r == "string")
760
+ return I(r, e);
761
+ if (ArrayBuffer.isView(r))
762
+ return T(r);
763
+ if (r == null)
764
+ throw new TypeError(
765
+ "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof r
766
+ );
767
+ if (V(r, ArrayBuffer) || r && V(r.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (V(r, SharedArrayBuffer) || r && V(r.buffer, SharedArrayBuffer)))
768
+ return h(r, e, t);
769
+ if (typeof r == "number")
770
+ throw new TypeError(
771
+ 'The "value" argument must not be of type number. Received type number'
772
+ );
773
+ const s = r.valueOf && r.valueOf();
774
+ if (s != null && s !== r)
775
+ return o.from(s, e, t);
776
+ const l = M(r);
777
+ if (l)
778
+ return l;
779
+ if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof r[Symbol.toPrimitive] == "function")
780
+ return o.from(r[Symbol.toPrimitive]("string"), e, t);
781
+ throw new TypeError(
782
+ "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof r
783
+ );
784
+ }
785
+ o.from = function(r, e, t) {
786
+ return w(r, e, t);
787
+ }, Object.setPrototypeOf(o.prototype, Uint8Array.prototype), Object.setPrototypeOf(o, Uint8Array);
788
+ function N(r) {
789
+ if (typeof r != "number")
790
+ throw new TypeError('"size" argument must be of type number');
791
+ if (r < 0)
792
+ throw new RangeError('The value "' + r + '" is invalid for option "size"');
793
+ }
794
+ function v(r, e, t) {
795
+ return N(r), r <= 0 ? f(r) : e !== void 0 ? typeof t == "string" ? f(r).fill(e, t) : f(r).fill(e) : f(r);
796
+ }
797
+ o.alloc = function(r, e, t) {
798
+ return v(r, e, t);
799
+ };
800
+ function _(r) {
801
+ return N(r), f(r < 0 ? 0 : x(r) | 0);
802
+ }
803
+ o.allocUnsafe = function(r) {
804
+ return _(r);
805
+ }, o.allocUnsafeSlow = function(r) {
806
+ return _(r);
807
+ };
808
+ function I(r, e) {
809
+ if ((typeof e != "string" || e === "") && (e = "utf8"), !o.isEncoding(e))
810
+ throw new TypeError("Unknown encoding: " + e);
811
+ const t = z(r, e) | 0;
812
+ let s = f(t);
813
+ const l = s.write(r, e);
814
+ return l !== t && (s = s.slice(0, l)), s;
815
+ }
816
+ function E(r) {
817
+ const e = r.length < 0 ? 0 : x(r.length) | 0, t = f(e);
818
+ for (let s = 0; s < e; s += 1)
819
+ t[s] = r[s] & 255;
820
+ return t;
821
+ }
822
+ function T(r) {
823
+ if (V(r, Uint8Array)) {
824
+ const e = new Uint8Array(r);
825
+ return h(e.buffer, e.byteOffset, e.byteLength);
826
+ }
827
+ return E(r);
828
+ }
829
+ function h(r, e, t) {
830
+ if (e < 0 || r.byteLength < e)
831
+ throw new RangeError('"offset" is outside of buffer bounds');
832
+ if (r.byteLength < e + (t || 0))
833
+ throw new RangeError('"length" is outside of buffer bounds');
834
+ let s;
835
+ return e === void 0 && t === void 0 ? s = new Uint8Array(r) : t === void 0 ? s = new Uint8Array(r, e) : s = new Uint8Array(r, e, t), Object.setPrototypeOf(s, o.prototype), s;
836
+ }
837
+ function M(r) {
838
+ if (o.isBuffer(r)) {
839
+ const e = x(r.length) | 0, t = f(e);
840
+ return t.length === 0 || r.copy(t, 0, 0, e), t;
841
+ }
842
+ if (r.length !== void 0)
843
+ return typeof r.length != "number" || Re(r.length) ? f(0) : E(r);
844
+ if (r.type === "Buffer" && Array.isArray(r.data))
845
+ return E(r.data);
846
+ }
847
+ function x(r) {
848
+ if (r >= u)
849
+ throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + u.toString(16) + " bytes");
850
+ return r | 0;
851
+ }
852
+ function A(r) {
853
+ return +r != r && (r = 0), o.alloc(+r);
854
+ }
855
+ o.isBuffer = function(e) {
856
+ return e != null && e._isBuffer === !0 && e !== o.prototype;
857
+ }, o.compare = function(e, t) {
858
+ if (V(e, Uint8Array) && (e = o.from(e, e.offset, e.byteLength)), V(t, Uint8Array) && (t = o.from(t, t.offset, t.byteLength)), !o.isBuffer(e) || !o.isBuffer(t))
859
+ throw new TypeError(
860
+ 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
861
+ );
862
+ if (e === t)
863
+ return 0;
864
+ let s = e.length, l = t.length;
865
+ for (let d = 0, p = Math.min(s, l); d < p; ++d)
866
+ if (e[d] !== t[d]) {
867
+ s = e[d], l = t[d];
868
+ break;
869
+ }
870
+ return s < l ? -1 : l < s ? 1 : 0;
871
+ }, o.isEncoding = function(e) {
872
+ switch (String(e).toLowerCase()) {
873
+ case "hex":
874
+ case "utf8":
875
+ case "utf-8":
876
+ case "ascii":
877
+ case "latin1":
878
+ case "binary":
879
+ case "base64":
880
+ case "ucs2":
881
+ case "ucs-2":
882
+ case "utf16le":
883
+ case "utf-16le":
884
+ return !0;
885
+ default:
886
+ return !1;
887
+ }
888
+ }, o.concat = function(e, t) {
889
+ if (!Array.isArray(e))
890
+ throw new TypeError('"list" argument must be an Array of Buffers');
891
+ if (e.length === 0)
892
+ return o.alloc(0);
893
+ let s;
894
+ if (t === void 0)
895
+ for (t = 0, s = 0; s < e.length; ++s)
896
+ t += e[s].length;
897
+ const l = o.allocUnsafe(t);
898
+ let d = 0;
899
+ for (s = 0; s < e.length; ++s) {
900
+ let p = e[s];
901
+ if (V(p, Uint8Array))
902
+ d + p.length > l.length ? (o.isBuffer(p) || (p = o.from(p)), p.copy(l, d)) : Uint8Array.prototype.set.call(
903
+ l,
904
+ p,
905
+ d
906
+ );
907
+ else if (o.isBuffer(p))
908
+ p.copy(l, d);
909
+ else
910
+ throw new TypeError('"list" argument must be an Array of Buffers');
911
+ d += p.length;
912
+ }
913
+ return l;
914
+ };
915
+ function z(r, e) {
916
+ if (o.isBuffer(r))
917
+ return r.length;
918
+ if (ArrayBuffer.isView(r) || V(r, ArrayBuffer))
919
+ return r.byteLength;
920
+ if (typeof r != "string")
921
+ throw new TypeError(
922
+ 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof r
923
+ );
924
+ const t = r.length, s = arguments.length > 2 && arguments[2] === !0;
925
+ if (!s && t === 0)
926
+ return 0;
927
+ let l = !1;
928
+ for (; ; )
929
+ switch (e) {
930
+ case "ascii":
931
+ case "latin1":
932
+ case "binary":
933
+ return t;
934
+ case "utf8":
935
+ case "utf-8":
936
+ return Ce(r).length;
937
+ case "ucs2":
938
+ case "ucs-2":
939
+ case "utf16le":
940
+ case "utf-16le":
941
+ return t * 2;
942
+ case "hex":
943
+ return t >>> 1;
944
+ case "base64":
945
+ return it(r).length;
946
+ default:
947
+ if (l)
948
+ return s ? -1 : Ce(r).length;
949
+ e = ("" + e).toLowerCase(), l = !0;
950
+ }
951
+ }
952
+ o.byteLength = z;
953
+ function O(r, e, t) {
954
+ let s = !1;
955
+ if ((e === void 0 || e < 0) && (e = 0), e > this.length || ((t === void 0 || t > this.length) && (t = this.length), t <= 0) || (t >>>= 0, e >>>= 0, t <= e))
956
+ return "";
957
+ for (r || (r = "utf8"); ; )
958
+ switch (r) {
959
+ case "hex":
960
+ return Be(this, e, t);
961
+ case "utf8":
962
+ case "utf-8":
963
+ return xe(this, e, t);
964
+ case "ascii":
965
+ return Me(this, e, t);
966
+ case "latin1":
967
+ case "binary":
968
+ return pe(this, e, t);
969
+ case "base64":
970
+ return be(this, e, t);
971
+ case "ucs2":
972
+ case "ucs-2":
973
+ case "utf16le":
974
+ case "utf-16le":
975
+ return Ae(this, e, t);
976
+ default:
977
+ if (s)
978
+ throw new TypeError("Unknown encoding: " + r);
979
+ r = (r + "").toLowerCase(), s = !0;
980
+ }
981
+ }
982
+ o.prototype._isBuffer = !0;
983
+ function D(r, e, t) {
984
+ const s = r[e];
985
+ r[e] = r[t], r[t] = s;
986
+ }
987
+ o.prototype.swap16 = function() {
988
+ const e = this.length;
989
+ if (e % 2 !== 0)
990
+ throw new RangeError("Buffer size must be a multiple of 16-bits");
991
+ for (let t = 0; t < e; t += 2)
992
+ D(this, t, t + 1);
993
+ return this;
994
+ }, o.prototype.swap32 = function() {
995
+ const e = this.length;
996
+ if (e % 4 !== 0)
997
+ throw new RangeError("Buffer size must be a multiple of 32-bits");
998
+ for (let t = 0; t < e; t += 4)
999
+ D(this, t, t + 3), D(this, t + 1, t + 2);
1000
+ return this;
1001
+ }, o.prototype.swap64 = function() {
1002
+ const e = this.length;
1003
+ if (e % 8 !== 0)
1004
+ throw new RangeError("Buffer size must be a multiple of 64-bits");
1005
+ for (let t = 0; t < e; t += 8)
1006
+ D(this, t, t + 7), D(this, t + 1, t + 6), D(this, t + 2, t + 5), D(this, t + 3, t + 4);
1007
+ return this;
1008
+ }, o.prototype.toString = function() {
1009
+ const e = this.length;
1010
+ return e === 0 ? "" : arguments.length === 0 ? xe(this, 0, e) : O.apply(this, arguments);
1011
+ }, o.prototype.toLocaleString = o.prototype.toString, o.prototype.equals = function(e) {
1012
+ if (!o.isBuffer(e))
1013
+ throw new TypeError("Argument must be a Buffer");
1014
+ return this === e ? !0 : o.compare(this, e) === 0;
1015
+ }, o.prototype.inspect = function() {
1016
+ let e = "";
1017
+ const t = n.INSPECT_MAX_BYTES;
1018
+ return e = this.toString("hex", 0, t).replace(/(.{2})/g, "$1 ").trim(), this.length > t && (e += " ... "), "<Buffer " + e + ">";
1019
+ }, c && (o.prototype[c] = o.prototype.inspect), o.prototype.compare = function(e, t, s, l, d) {
1020
+ if (V(e, Uint8Array) && (e = o.from(e, e.offset, e.byteLength)), !o.isBuffer(e))
1021
+ throw new TypeError(
1022
+ 'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof e
1023
+ );
1024
+ if (t === void 0 && (t = 0), s === void 0 && (s = e ? e.length : 0), l === void 0 && (l = 0), d === void 0 && (d = this.length), t < 0 || s > e.length || l < 0 || d > this.length)
1025
+ throw new RangeError("out of range index");
1026
+ if (l >= d && t >= s)
1027
+ return 0;
1028
+ if (l >= d)
1029
+ return -1;
1030
+ if (t >= s)
1031
+ return 1;
1032
+ if (t >>>= 0, s >>>= 0, l >>>= 0, d >>>= 0, this === e)
1033
+ return 0;
1034
+ let p = d - l, b = s - t;
1035
+ const R = Math.min(p, b), C = this.slice(l, d), k = e.slice(t, s);
1036
+ for (let B = 0; B < R; ++B)
1037
+ if (C[B] !== k[B]) {
1038
+ p = C[B], b = k[B];
1039
+ break;
1040
+ }
1041
+ return p < b ? -1 : b < p ? 1 : 0;
1042
+ };
1043
+ function L(r, e, t, s, l) {
1044
+ if (r.length === 0)
1045
+ return -1;
1046
+ if (typeof t == "string" ? (s = t, t = 0) : t > 2147483647 ? t = 2147483647 : t < -2147483648 && (t = -2147483648), t = +t, Re(t) && (t = l ? 0 : r.length - 1), t < 0 && (t = r.length + t), t >= r.length) {
1047
+ if (l)
1048
+ return -1;
1049
+ t = r.length - 1;
1050
+ } else if (t < 0)
1051
+ if (l)
1052
+ t = 0;
1053
+ else
1054
+ return -1;
1055
+ if (typeof e == "string" && (e = o.from(e, s)), o.isBuffer(e))
1056
+ return e.length === 0 ? -1 : j(r, e, t, s, l);
1057
+ if (typeof e == "number")
1058
+ return e = e & 255, typeof Uint8Array.prototype.indexOf == "function" ? l ? Uint8Array.prototype.indexOf.call(r, e, t) : Uint8Array.prototype.lastIndexOf.call(r, e, t) : j(r, [e], t, s, l);
1059
+ throw new TypeError("val must be string, number or Buffer");
1060
+ }
1061
+ function j(r, e, t, s, l) {
1062
+ let d = 1, p = r.length, b = e.length;
1063
+ if (s !== void 0 && (s = String(s).toLowerCase(), s === "ucs2" || s === "ucs-2" || s === "utf16le" || s === "utf-16le")) {
1064
+ if (r.length < 2 || e.length < 2)
1065
+ return -1;
1066
+ d = 2, p /= 2, b /= 2, t /= 2;
1067
+ }
1068
+ function R(k, B) {
1069
+ return d === 1 ? k[B] : k.readUInt16BE(B * d);
1070
+ }
1071
+ let C;
1072
+ if (l) {
1073
+ let k = -1;
1074
+ for (C = t; C < p; C++)
1075
+ if (R(r, C) === R(e, k === -1 ? 0 : C - k)) {
1076
+ if (k === -1 && (k = C), C - k + 1 === b)
1077
+ return k * d;
1078
+ } else
1079
+ k !== -1 && (C -= C - k), k = -1;
1080
+ } else
1081
+ for (t + b > p && (t = p - b), C = t; C >= 0; C--) {
1082
+ let k = !0;
1083
+ for (let B = 0; B < b; B++)
1084
+ if (R(r, C + B) !== R(e, B)) {
1085
+ k = !1;
1086
+ break;
1087
+ }
1088
+ if (k)
1089
+ return C;
1090
+ }
1091
+ return -1;
1092
+ }
1093
+ o.prototype.includes = function(e, t, s) {
1094
+ return this.indexOf(e, t, s) !== -1;
1095
+ }, o.prototype.indexOf = function(e, t, s) {
1096
+ return L(this, e, t, s, !0);
1097
+ }, o.prototype.lastIndexOf = function(e, t, s) {
1098
+ return L(this, e, t, s, !1);
1099
+ };
1100
+ function q(r, e, t, s) {
1101
+ t = Number(t) || 0;
1102
+ const l = r.length - t;
1103
+ s ? (s = Number(s), s > l && (s = l)) : s = l;
1104
+ const d = e.length;
1105
+ s > d / 2 && (s = d / 2);
1106
+ let p;
1107
+ for (p = 0; p < s; ++p) {
1108
+ const b = parseInt(e.substr(p * 2, 2), 16);
1109
+ if (Re(b))
1110
+ return p;
1111
+ r[t + p] = b;
1112
+ }
1113
+ return p;
1114
+ }
1115
+ function Y(r, e, t, s) {
1116
+ return Ee(Ce(e, r.length - t), r, t, s);
1117
+ }
1118
+ function ne(r, e, t, s) {
1119
+ return Ee($t(e), r, t, s);
1120
+ }
1121
+ function se(r, e, t, s) {
1122
+ return Ee(it(e), r, t, s);
1123
+ }
1124
+ function De(r, e, t, s) {
1125
+ return Ee(Qt(e, r.length - t), r, t, s);
1126
+ }
1127
+ o.prototype.write = function(e, t, s, l) {
1128
+ if (t === void 0)
1129
+ l = "utf8", s = this.length, t = 0;
1130
+ else if (s === void 0 && typeof t == "string")
1131
+ l = t, s = this.length, t = 0;
1132
+ else if (isFinite(t))
1133
+ t = t >>> 0, isFinite(s) ? (s = s >>> 0, l === void 0 && (l = "utf8")) : (l = s, s = void 0);
1134
+ else
1135
+ throw new Error(
1136
+ "Buffer.write(string, encoding, offset[, length]) is no longer supported"
1137
+ );
1138
+ const d = this.length - t;
1139
+ if ((s === void 0 || s > d) && (s = d), e.length > 0 && (s < 0 || t < 0) || t > this.length)
1140
+ throw new RangeError("Attempt to write outside buffer bounds");
1141
+ l || (l = "utf8");
1142
+ let p = !1;
1143
+ for (; ; )
1144
+ switch (l) {
1145
+ case "hex":
1146
+ return q(this, e, t, s);
1147
+ case "utf8":
1148
+ case "utf-8":
1149
+ return Y(this, e, t, s);
1150
+ case "ascii":
1151
+ case "latin1":
1152
+ case "binary":
1153
+ return ne(this, e, t, s);
1154
+ case "base64":
1155
+ return se(this, e, t, s);
1156
+ case "ucs2":
1157
+ case "ucs-2":
1158
+ case "utf16le":
1159
+ case "utf-16le":
1160
+ return De(this, e, t, s);
1161
+ default:
1162
+ if (p)
1163
+ throw new TypeError("Unknown encoding: " + l);
1164
+ l = ("" + l).toLowerCase(), p = !0;
1165
+ }
1166
+ }, o.prototype.toJSON = function() {
1167
+ return {
1168
+ type: "Buffer",
1169
+ data: Array.prototype.slice.call(this._arr || this, 0)
1170
+ };
1171
+ };
1172
+ function be(r, e, t) {
1173
+ return e === 0 && t === r.length ? i.fromByteArray(r) : i.fromByteArray(r.slice(e, t));
1174
+ }
1175
+ function xe(r, e, t) {
1176
+ t = Math.min(r.length, t);
1177
+ const s = [];
1178
+ let l = e;
1179
+ for (; l < t; ) {
1180
+ const d = r[l];
1181
+ let p = null, b = d > 239 ? 4 : d > 223 ? 3 : d > 191 ? 2 : 1;
1182
+ if (l + b <= t) {
1183
+ let R, C, k, B;
1184
+ switch (b) {
1185
+ case 1:
1186
+ d < 128 && (p = d);
1187
+ break;
1188
+ case 2:
1189
+ R = r[l + 1], (R & 192) === 128 && (B = (d & 31) << 6 | R & 63, B > 127 && (p = B));
1190
+ break;
1191
+ case 3:
1192
+ R = r[l + 1], C = r[l + 2], (R & 192) === 128 && (C & 192) === 128 && (B = (d & 15) << 12 | (R & 63) << 6 | C & 63, B > 2047 && (B < 55296 || B > 57343) && (p = B));
1193
+ break;
1194
+ case 4:
1195
+ R = r[l + 1], C = r[l + 2], k = r[l + 3], (R & 192) === 128 && (C & 192) === 128 && (k & 192) === 128 && (B = (d & 15) << 18 | (R & 63) << 12 | (C & 63) << 6 | k & 63, B > 65535 && B < 1114112 && (p = B));
1196
+ }
1197
+ }
1198
+ p === null ? (p = 65533, b = 1) : p > 65535 && (p -= 65536, s.push(p >>> 10 & 1023 | 55296), p = 56320 | p & 1023), s.push(p), l += b;
1199
+ }
1200
+ return Oe(s);
1201
+ }
1202
+ const we = 4096;
1203
+ function Oe(r) {
1204
+ const e = r.length;
1205
+ if (e <= we)
1206
+ return String.fromCharCode.apply(String, r);
1207
+ let t = "", s = 0;
1208
+ for (; s < e; )
1209
+ t += String.fromCharCode.apply(
1210
+ String,
1211
+ r.slice(s, s += we)
1212
+ );
1213
+ return t;
1214
+ }
1215
+ function Me(r, e, t) {
1216
+ let s = "";
1217
+ t = Math.min(r.length, t);
1218
+ for (let l = e; l < t; ++l)
1219
+ s += String.fromCharCode(r[l] & 127);
1220
+ return s;
1221
+ }
1222
+ function pe(r, e, t) {
1223
+ let s = "";
1224
+ t = Math.min(r.length, t);
1225
+ for (let l = e; l < t; ++l)
1226
+ s += String.fromCharCode(r[l]);
1227
+ return s;
1228
+ }
1229
+ function Be(r, e, t) {
1230
+ const s = r.length;
1231
+ (!e || e < 0) && (e = 0), (!t || t < 0 || t > s) && (t = s);
1232
+ let l = "";
1233
+ for (let d = e; d < t; ++d)
1234
+ l += Pt[r[d]];
1235
+ return l;
1236
+ }
1237
+ function Ae(r, e, t) {
1238
+ const s = r.slice(e, t);
1239
+ let l = "";
1240
+ for (let d = 0; d < s.length - 1; d += 2)
1241
+ l += String.fromCharCode(s[d] + s[d + 1] * 256);
1242
+ return l;
1243
+ }
1244
+ o.prototype.slice = function(e, t) {
1245
+ const s = this.length;
1246
+ e = ~~e, t = t === void 0 ? s : ~~t, e < 0 ? (e += s, e < 0 && (e = 0)) : e > s && (e = s), t < 0 ? (t += s, t < 0 && (t = 0)) : t > s && (t = s), t < e && (t = e);
1247
+ const l = this.subarray(e, t);
1248
+ return Object.setPrototypeOf(l, o.prototype), l;
1249
+ };
1250
+ function F(r, e, t) {
1251
+ if (r % 1 !== 0 || r < 0)
1252
+ throw new RangeError("offset is not uint");
1253
+ if (r + e > t)
1254
+ throw new RangeError("Trying to access beyond buffer length");
1255
+ }
1256
+ o.prototype.readUintLE = o.prototype.readUIntLE = function(e, t, s) {
1257
+ e = e >>> 0, t = t >>> 0, s || F(e, t, this.length);
1258
+ let l = this[e], d = 1, p = 0;
1259
+ for (; ++p < t && (d *= 256); )
1260
+ l += this[e + p] * d;
1261
+ return l;
1262
+ }, o.prototype.readUintBE = o.prototype.readUIntBE = function(e, t, s) {
1263
+ e = e >>> 0, t = t >>> 0, s || F(e, t, this.length);
1264
+ let l = this[e + --t], d = 1;
1265
+ for (; t > 0 && (d *= 256); )
1266
+ l += this[e + --t] * d;
1267
+ return l;
1268
+ }, o.prototype.readUint8 = o.prototype.readUInt8 = function(e, t) {
1269
+ return e = e >>> 0, t || F(e, 1, this.length), this[e];
1270
+ }, o.prototype.readUint16LE = o.prototype.readUInt16LE = function(e, t) {
1271
+ return e = e >>> 0, t || F(e, 2, this.length), this[e] | this[e + 1] << 8;
1272
+ }, o.prototype.readUint16BE = o.prototype.readUInt16BE = function(e, t) {
1273
+ return e = e >>> 0, t || F(e, 2, this.length), this[e] << 8 | this[e + 1];
1274
+ }, o.prototype.readUint32LE = o.prototype.readUInt32LE = function(e, t) {
1275
+ return e = e >>> 0, t || F(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + this[e + 3] * 16777216;
1276
+ }, o.prototype.readUint32BE = o.prototype.readUInt32BE = function(e, t) {
1277
+ return e = e >>> 0, t || F(e, 4, this.length), this[e] * 16777216 + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]);
1278
+ }, o.prototype.readBigUInt64LE = te(function(e) {
1279
+ e = e >>> 0, ae(e, "offset");
1280
+ const t = this[e], s = this[e + 7];
1281
+ (t === void 0 || s === void 0) && ge(e, this.length - 8);
1282
+ const l = t + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + this[++e] * 2 ** 24, d = this[++e] + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + s * 2 ** 24;
1283
+ return BigInt(l) + (BigInt(d) << BigInt(32));
1284
+ }), o.prototype.readBigUInt64BE = te(function(e) {
1285
+ e = e >>> 0, ae(e, "offset");
1286
+ const t = this[e], s = this[e + 7];
1287
+ (t === void 0 || s === void 0) && ge(e, this.length - 8);
1288
+ const l = t * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e], d = this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + s;
1289
+ return (BigInt(l) << BigInt(32)) + BigInt(d);
1290
+ }), o.prototype.readIntLE = function(e, t, s) {
1291
+ e = e >>> 0, t = t >>> 0, s || F(e, t, this.length);
1292
+ let l = this[e], d = 1, p = 0;
1293
+ for (; ++p < t && (d *= 256); )
1294
+ l += this[e + p] * d;
1295
+ return d *= 128, l >= d && (l -= Math.pow(2, 8 * t)), l;
1296
+ }, o.prototype.readIntBE = function(e, t, s) {
1297
+ e = e >>> 0, t = t >>> 0, s || F(e, t, this.length);
1298
+ let l = t, d = 1, p = this[e + --l];
1299
+ for (; l > 0 && (d *= 256); )
1300
+ p += this[e + --l] * d;
1301
+ return d *= 128, p >= d && (p -= Math.pow(2, 8 * t)), p;
1302
+ }, o.prototype.readInt8 = function(e, t) {
1303
+ return e = e >>> 0, t || F(e, 1, this.length), this[e] & 128 ? (255 - this[e] + 1) * -1 : this[e];
1304
+ }, o.prototype.readInt16LE = function(e, t) {
1305
+ e = e >>> 0, t || F(e, 2, this.length);
1306
+ const s = this[e] | this[e + 1] << 8;
1307
+ return s & 32768 ? s | 4294901760 : s;
1308
+ }, o.prototype.readInt16BE = function(e, t) {
1309
+ e = e >>> 0, t || F(e, 2, this.length);
1310
+ const s = this[e + 1] | this[e] << 8;
1311
+ return s & 32768 ? s | 4294901760 : s;
1312
+ }, o.prototype.readInt32LE = function(e, t) {
1313
+ return e = e >>> 0, t || F(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
1314
+ }, o.prototype.readInt32BE = function(e, t) {
1315
+ return e = e >>> 0, t || F(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
1316
+ }, o.prototype.readBigInt64LE = te(function(e) {
1317
+ e = e >>> 0, ae(e, "offset");
1318
+ const t = this[e], s = this[e + 7];
1319
+ (t === void 0 || s === void 0) && ge(e, this.length - 8);
1320
+ const l = this[e + 4] + this[e + 5] * 2 ** 8 + this[e + 6] * 2 ** 16 + (s << 24);
1321
+ return (BigInt(l) << BigInt(32)) + BigInt(t + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + this[++e] * 2 ** 24);
1322
+ }), o.prototype.readBigInt64BE = te(function(e) {
1323
+ e = e >>> 0, ae(e, "offset");
1324
+ const t = this[e], s = this[e + 7];
1325
+ (t === void 0 || s === void 0) && ge(e, this.length - 8);
1326
+ const l = (t << 24) + // Overflow
1327
+ this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e];
1328
+ return (BigInt(l) << BigInt(32)) + BigInt(this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + s);
1329
+ }), o.prototype.readFloatLE = function(e, t) {
1330
+ return e = e >>> 0, t || F(e, 4, this.length), a.read(this, e, !0, 23, 4);
1331
+ }, o.prototype.readFloatBE = function(e, t) {
1332
+ return e = e >>> 0, t || F(e, 4, this.length), a.read(this, e, !1, 23, 4);
1333
+ }, o.prototype.readDoubleLE = function(e, t) {
1334
+ return e = e >>> 0, t || F(e, 8, this.length), a.read(this, e, !0, 52, 8);
1335
+ }, o.prototype.readDoubleBE = function(e, t) {
1336
+ return e = e >>> 0, t || F(e, 8, this.length), a.read(this, e, !1, 52, 8);
1337
+ };
1338
+ function $(r, e, t, s, l, d) {
1339
+ if (!o.isBuffer(r))
1340
+ throw new TypeError('"buffer" argument must be a Buffer instance');
1341
+ if (e > l || e < d)
1342
+ throw new RangeError('"value" argument is out of bounds');
1343
+ if (t + s > r.length)
1344
+ throw new RangeError("Index out of range");
1345
+ }
1346
+ o.prototype.writeUintLE = o.prototype.writeUIntLE = function(e, t, s, l) {
1347
+ if (e = +e, t = t >>> 0, s = s >>> 0, !l) {
1348
+ const b = Math.pow(2, 8 * s) - 1;
1349
+ $(this, e, t, s, b, 0);
1350
+ }
1351
+ let d = 1, p = 0;
1352
+ for (this[t] = e & 255; ++p < s && (d *= 256); )
1353
+ this[t + p] = e / d & 255;
1354
+ return t + s;
1355
+ }, o.prototype.writeUintBE = o.prototype.writeUIntBE = function(e, t, s, l) {
1356
+ if (e = +e, t = t >>> 0, s = s >>> 0, !l) {
1357
+ const b = Math.pow(2, 8 * s) - 1;
1358
+ $(this, e, t, s, b, 0);
1359
+ }
1360
+ let d = s - 1, p = 1;
1361
+ for (this[t + d] = e & 255; --d >= 0 && (p *= 256); )
1362
+ this[t + d] = e / p & 255;
1363
+ return t + s;
1364
+ }, o.prototype.writeUint8 = o.prototype.writeUInt8 = function(e, t, s) {
1365
+ return e = +e, t = t >>> 0, s || $(this, e, t, 1, 255, 0), this[t] = e & 255, t + 1;
1366
+ }, o.prototype.writeUint16LE = o.prototype.writeUInt16LE = function(e, t, s) {
1367
+ return e = +e, t = t >>> 0, s || $(this, e, t, 2, 65535, 0), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
1368
+ }, o.prototype.writeUint16BE = o.prototype.writeUInt16BE = function(e, t, s) {
1369
+ return e = +e, t = t >>> 0, s || $(this, e, t, 2, 65535, 0), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
1370
+ }, o.prototype.writeUint32LE = o.prototype.writeUInt32LE = function(e, t, s) {
1371
+ return e = +e, t = t >>> 0, s || $(this, e, t, 4, 4294967295, 0), this[t + 3] = e >>> 24, this[t + 2] = e >>> 16, this[t + 1] = e >>> 8, this[t] = e & 255, t + 4;
1372
+ }, o.prototype.writeUint32BE = o.prototype.writeUInt32BE = function(e, t, s) {
1373
+ return e = +e, t = t >>> 0, s || $(this, e, t, 4, 4294967295, 0), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = e & 255, t + 4;
1374
+ };
1375
+ function fe(r, e, t, s, l) {
1376
+ rt(e, s, l, r, t, 7);
1377
+ let d = Number(e & BigInt(4294967295));
1378
+ r[t++] = d, d = d >> 8, r[t++] = d, d = d >> 8, r[t++] = d, d = d >> 8, r[t++] = d;
1379
+ let p = Number(e >> BigInt(32) & BigInt(4294967295));
1380
+ return r[t++] = p, p = p >> 8, r[t++] = p, p = p >> 8, r[t++] = p, p = p >> 8, r[t++] = p, t;
1381
+ }
1382
+ function ee(r, e, t, s, l) {
1383
+ rt(e, s, l, r, t, 7);
1384
+ let d = Number(e & BigInt(4294967295));
1385
+ r[t + 7] = d, d = d >> 8, r[t + 6] = d, d = d >> 8, r[t + 5] = d, d = d >> 8, r[t + 4] = d;
1386
+ let p = Number(e >> BigInt(32) & BigInt(4294967295));
1387
+ return r[t + 3] = p, p = p >> 8, r[t + 2] = p, p = p >> 8, r[t + 1] = p, p = p >> 8, r[t] = p, t + 8;
1388
+ }
1389
+ o.prototype.writeBigUInt64LE = te(function(e, t = 0) {
1390
+ return fe(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
1391
+ }), o.prototype.writeBigUInt64BE = te(function(e, t = 0) {
1392
+ return ee(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
1393
+ }), o.prototype.writeIntLE = function(e, t, s, l) {
1394
+ if (e = +e, t = t >>> 0, !l) {
1395
+ const R = Math.pow(2, 8 * s - 1);
1396
+ $(this, e, t, s, R - 1, -R);
1397
+ }
1398
+ let d = 0, p = 1, b = 0;
1399
+ for (this[t] = e & 255; ++d < s && (p *= 256); )
1400
+ e < 0 && b === 0 && this[t + d - 1] !== 0 && (b = 1), this[t + d] = (e / p >> 0) - b & 255;
1401
+ return t + s;
1402
+ }, o.prototype.writeIntBE = function(e, t, s, l) {
1403
+ if (e = +e, t = t >>> 0, !l) {
1404
+ const R = Math.pow(2, 8 * s - 1);
1405
+ $(this, e, t, s, R - 1, -R);
1406
+ }
1407
+ let d = s - 1, p = 1, b = 0;
1408
+ for (this[t + d] = e & 255; --d >= 0 && (p *= 256); )
1409
+ e < 0 && b === 0 && this[t + d + 1] !== 0 && (b = 1), this[t + d] = (e / p >> 0) - b & 255;
1410
+ return t + s;
1411
+ }, o.prototype.writeInt8 = function(e, t, s) {
1412
+ return e = +e, t = t >>> 0, s || $(this, e, t, 1, 127, -128), e < 0 && (e = 255 + e + 1), this[t] = e & 255, t + 1;
1413
+ }, o.prototype.writeInt16LE = function(e, t, s) {
1414
+ return e = +e, t = t >>> 0, s || $(this, e, t, 2, 32767, -32768), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
1415
+ }, o.prototype.writeInt16BE = function(e, t, s) {
1416
+ return e = +e, t = t >>> 0, s || $(this, e, t, 2, 32767, -32768), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
1417
+ }, o.prototype.writeInt32LE = function(e, t, s) {
1418
+ return e = +e, t = t >>> 0, s || $(this, e, t, 4, 2147483647, -2147483648), this[t] = e & 255, this[t + 1] = e >>> 8, this[t + 2] = e >>> 16, this[t + 3] = e >>> 24, t + 4;
1419
+ }, o.prototype.writeInt32BE = function(e, t, s) {
1420
+ return e = +e, t = t >>> 0, s || $(this, e, t, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = e & 255, t + 4;
1421
+ }, o.prototype.writeBigInt64LE = te(function(e, t = 0) {
1422
+ return fe(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
1423
+ }), o.prototype.writeBigInt64BE = te(function(e, t = 0) {
1424
+ return ee(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
1425
+ });
1426
+ function me(r, e, t, s, l, d) {
1427
+ if (t + s > r.length)
1428
+ throw new RangeError("Index out of range");
1429
+ if (t < 0)
1430
+ throw new RangeError("Index out of range");
1431
+ }
1432
+ function Xe(r, e, t, s, l) {
1433
+ return e = +e, t = t >>> 0, l || me(r, e, t, 4), a.write(r, e, t, s, 23, 4), t + 4;
1434
+ }
1435
+ o.prototype.writeFloatLE = function(e, t, s) {
1436
+ return Xe(this, e, t, !0, s);
1437
+ }, o.prototype.writeFloatBE = function(e, t, s) {
1438
+ return Xe(this, e, t, !1, s);
1439
+ };
1440
+ function et(r, e, t, s, l) {
1441
+ return e = +e, t = t >>> 0, l || me(r, e, t, 8), a.write(r, e, t, s, 52, 8), t + 8;
1442
+ }
1443
+ o.prototype.writeDoubleLE = function(e, t, s) {
1444
+ return et(this, e, t, !0, s);
1445
+ }, o.prototype.writeDoubleBE = function(e, t, s) {
1446
+ return et(this, e, t, !1, s);
1447
+ }, o.prototype.copy = function(e, t, s, l) {
1448
+ if (!o.isBuffer(e))
1449
+ throw new TypeError("argument should be a Buffer");
1450
+ if (s || (s = 0), !l && l !== 0 && (l = this.length), t >= e.length && (t = e.length), t || (t = 0), l > 0 && l < s && (l = s), l === s || e.length === 0 || this.length === 0)
1451
+ return 0;
1452
+ if (t < 0)
1453
+ throw new RangeError("targetStart out of bounds");
1454
+ if (s < 0 || s >= this.length)
1455
+ throw new RangeError("Index out of range");
1456
+ if (l < 0)
1457
+ throw new RangeError("sourceEnd out of bounds");
1458
+ l > this.length && (l = this.length), e.length - t < l - s && (l = e.length - t + s);
1459
+ const d = l - s;
1460
+ return this === e && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(t, s, l) : Uint8Array.prototype.set.call(
1461
+ e,
1462
+ this.subarray(s, l),
1463
+ t
1464
+ ), d;
1465
+ }, o.prototype.fill = function(e, t, s, l) {
1466
+ if (typeof e == "string") {
1467
+ if (typeof t == "string" ? (l = t, t = 0, s = this.length) : typeof s == "string" && (l = s, s = this.length), l !== void 0 && typeof l != "string")
1468
+ throw new TypeError("encoding must be a string");
1469
+ if (typeof l == "string" && !o.isEncoding(l))
1470
+ throw new TypeError("Unknown encoding: " + l);
1471
+ if (e.length === 1) {
1472
+ const p = e.charCodeAt(0);
1473
+ (l === "utf8" && p < 128 || l === "latin1") && (e = p);
1474
+ }
1475
+ } else
1476
+ typeof e == "number" ? e = e & 255 : typeof e == "boolean" && (e = Number(e));
1477
+ if (t < 0 || this.length < t || this.length < s)
1478
+ throw new RangeError("Out of range index");
1479
+ if (s <= t)
1480
+ return this;
1481
+ t = t >>> 0, s = s === void 0 ? this.length : s >>> 0, e || (e = 0);
1482
+ let d;
1483
+ if (typeof e == "number")
1484
+ for (d = t; d < s; ++d)
1485
+ this[d] = e;
1486
+ else {
1487
+ const p = o.isBuffer(e) ? e : o.from(e, l), b = p.length;
1488
+ if (b === 0)
1489
+ throw new TypeError('The value "' + e + '" is invalid for argument "value"');
1490
+ for (d = 0; d < s - t; ++d)
1491
+ this[d + t] = p[d % b];
1492
+ }
1493
+ return this;
1494
+ };
1495
+ const oe = {};
1496
+ function Le(r, e, t) {
1497
+ oe[r] = class extends t {
1498
+ constructor() {
1499
+ super(), Object.defineProperty(this, "message", {
1500
+ value: e.apply(this, arguments),
1501
+ writable: !0,
1502
+ configurable: !0
1503
+ }), this.name = `${this.name} [${r}]`, this.stack, delete this.name;
1504
+ }
1505
+ get code() {
1506
+ return r;
1507
+ }
1508
+ set code(l) {
1509
+ Object.defineProperty(this, "code", {
1510
+ configurable: !0,
1511
+ enumerable: !0,
1512
+ value: l,
1513
+ writable: !0
1514
+ });
1515
+ }
1516
+ toString() {
1517
+ return `${this.name} [${r}]: ${this.message}`;
1518
+ }
1519
+ };
1520
+ }
1521
+ Le(
1522
+ "ERR_BUFFER_OUT_OF_BOUNDS",
1523
+ function(r) {
1524
+ return r ? `${r} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
1525
+ },
1526
+ RangeError
1527
+ ), Le(
1528
+ "ERR_INVALID_ARG_TYPE",
1529
+ function(r, e) {
1530
+ return `The "${r}" argument must be of type number. Received type ${typeof e}`;
1531
+ },
1532
+ TypeError
1533
+ ), Le(
1534
+ "ERR_OUT_OF_RANGE",
1535
+ function(r, e, t) {
1536
+ let s = `The value of "${r}" is out of range.`, l = t;
1537
+ return Number.isInteger(t) && Math.abs(t) > 2 ** 32 ? l = tt(String(t)) : typeof t == "bigint" && (l = String(t), (t > BigInt(2) ** BigInt(32) || t < -(BigInt(2) ** BigInt(32))) && (l = tt(l)), l += "n"), s += ` It must be ${e}. Received ${l}`, s;
1538
+ },
1539
+ RangeError
1540
+ );
1541
+ function tt(r) {
1542
+ let e = "", t = r.length;
1543
+ const s = r[0] === "-" ? 1 : 0;
1544
+ for (; t >= s + 4; t -= 3)
1545
+ e = `_${r.slice(t - 3, t)}${e}`;
1546
+ return `${r.slice(0, t)}${e}`;
1547
+ }
1548
+ function Ut(r, e, t) {
1549
+ ae(e, "offset"), (r[e] === void 0 || r[e + t] === void 0) && ge(e, r.length - (t + 1));
1550
+ }
1551
+ function rt(r, e, t, s, l, d) {
1552
+ if (r > t || r < e) {
1553
+ const p = typeof e == "bigint" ? "n" : "";
1554
+ let b;
1555
+ throw d > 3 ? e === 0 || e === BigInt(0) ? b = `>= 0${p} and < 2${p} ** ${(d + 1) * 8}${p}` : b = `>= -(2${p} ** ${(d + 1) * 8 - 1}${p}) and < 2 ** ${(d + 1) * 8 - 1}${p}` : b = `>= ${e}${p} and <= ${t}${p}`, new oe.ERR_OUT_OF_RANGE("value", b, r);
1556
+ }
1557
+ Ut(s, l, d);
1558
+ }
1559
+ function ae(r, e) {
1560
+ if (typeof r != "number")
1561
+ throw new oe.ERR_INVALID_ARG_TYPE(e, "number", r);
1562
+ }
1563
+ function ge(r, e, t) {
1564
+ throw Math.floor(r) !== r ? (ae(r, t), new oe.ERR_OUT_OF_RANGE(t || "offset", "an integer", r)) : e < 0 ? new oe.ERR_BUFFER_OUT_OF_BOUNDS() : new oe.ERR_OUT_OF_RANGE(
1565
+ t || "offset",
1566
+ `>= ${t ? 1 : 0} and <= ${e}`,
1567
+ r
1568
+ );
1569
+ }
1570
+ const jt = /[^+/0-9A-Za-z-_]/g;
1571
+ function Ft(r) {
1572
+ if (r = r.split("=")[0], r = r.trim().replace(jt, ""), r.length < 2)
1573
+ return "";
1574
+ for (; r.length % 4 !== 0; )
1575
+ r = r + "=";
1576
+ return r;
1577
+ }
1578
+ function Ce(r, e) {
1579
+ e = e || 1 / 0;
1580
+ let t;
1581
+ const s = r.length;
1582
+ let l = null;
1583
+ const d = [];
1584
+ for (let p = 0; p < s; ++p) {
1585
+ if (t = r.charCodeAt(p), t > 55295 && t < 57344) {
1586
+ if (!l) {
1587
+ if (t > 56319) {
1588
+ (e -= 3) > -1 && d.push(239, 191, 189);
1589
+ continue;
1590
+ } else if (p + 1 === s) {
1591
+ (e -= 3) > -1 && d.push(239, 191, 189);
1592
+ continue;
1593
+ }
1594
+ l = t;
1595
+ continue;
1596
+ }
1597
+ if (t < 56320) {
1598
+ (e -= 3) > -1 && d.push(239, 191, 189), l = t;
1599
+ continue;
1600
+ }
1601
+ t = (l - 55296 << 10 | t - 56320) + 65536;
1602
+ } else
1603
+ l && (e -= 3) > -1 && d.push(239, 191, 189);
1604
+ if (l = null, t < 128) {
1605
+ if ((e -= 1) < 0)
1606
+ break;
1607
+ d.push(t);
1608
+ } else if (t < 2048) {
1609
+ if ((e -= 2) < 0)
1610
+ break;
1611
+ d.push(
1612
+ t >> 6 | 192,
1613
+ t & 63 | 128
1614
+ );
1615
+ } else if (t < 65536) {
1616
+ if ((e -= 3) < 0)
1617
+ break;
1618
+ d.push(
1619
+ t >> 12 | 224,
1620
+ t >> 6 & 63 | 128,
1621
+ t & 63 | 128
1622
+ );
1623
+ } else if (t < 1114112) {
1624
+ if ((e -= 4) < 0)
1625
+ break;
1626
+ d.push(
1627
+ t >> 18 | 240,
1628
+ t >> 12 & 63 | 128,
1629
+ t >> 6 & 63 | 128,
1630
+ t & 63 | 128
1631
+ );
1632
+ } else
1633
+ throw new Error("Invalid code point");
1634
+ }
1635
+ return d;
1636
+ }
1637
+ function $t(r) {
1638
+ const e = [];
1639
+ for (let t = 0; t < r.length; ++t)
1640
+ e.push(r.charCodeAt(t) & 255);
1641
+ return e;
1642
+ }
1643
+ function Qt(r, e) {
1644
+ let t, s, l;
1645
+ const d = [];
1646
+ for (let p = 0; p < r.length && !((e -= 2) < 0); ++p)
1647
+ t = r.charCodeAt(p), s = t >> 8, l = t % 256, d.push(l), d.push(s);
1648
+ return d;
1649
+ }
1650
+ function it(r) {
1651
+ return i.toByteArray(Ft(r));
1652
+ }
1653
+ function Ee(r, e, t, s) {
1654
+ let l;
1655
+ for (l = 0; l < s && !(l + t >= e.length || l >= r.length); ++l)
1656
+ e[l + t] = r[l];
1657
+ return l;
1658
+ }
1659
+ function V(r, e) {
1660
+ return r instanceof e || r != null && r.constructor != null && r.constructor.name != null && r.constructor.name === e.name;
1661
+ }
1662
+ function Re(r) {
1663
+ return r !== r;
1664
+ }
1665
+ const Pt = function() {
1666
+ const r = "0123456789abcdef", e = new Array(256);
1667
+ for (let t = 0; t < 16; ++t) {
1668
+ const s = t * 16;
1669
+ for (let l = 0; l < 16; ++l)
1670
+ e[s + l] = r[t] + r[l];
1671
+ }
1672
+ return e;
1673
+ }();
1674
+ function te(r) {
1675
+ return typeof BigInt > "u" ? qt : r;
1676
+ }
1677
+ function qt() {
1678
+ throw new Error("BigInt not supported");
1679
+ }
1680
+ })(Ot);
1681
+ var Lt = { exports: {} }, U = Lt.exports = {}, H, G;
1682
+ function Ye() {
1683
+ throw new Error("setTimeout has not been defined");
1684
+ }
1685
+ function We() {
1686
+ throw new Error("clearTimeout has not been defined");
1687
+ }
1688
+ (function() {
1689
+ try {
1690
+ typeof setTimeout == "function" ? H = setTimeout : H = Ye;
1691
+ } catch {
1692
+ H = Ye;
1693
+ }
1694
+ try {
1695
+ typeof clearTimeout == "function" ? G = clearTimeout : G = We;
1696
+ } catch {
1697
+ G = We;
1698
+ }
1699
+ })();
1700
+ function Ct(n) {
1701
+ if (H === setTimeout)
1702
+ return setTimeout(n, 0);
1703
+ if ((H === Ye || !H) && setTimeout)
1704
+ return H = setTimeout, setTimeout(n, 0);
1705
+ try {
1706
+ return H(n, 0);
1707
+ } catch {
1708
+ try {
1709
+ return H.call(null, n, 0);
1710
+ } catch {
1711
+ return H.call(this, n, 0);
1712
+ }
1713
+ }
1714
+ }
1715
+ function Fi(n) {
1716
+ if (G === clearTimeout)
1717
+ return clearTimeout(n);
1718
+ if ((G === We || !G) && clearTimeout)
1719
+ return G = clearTimeout, clearTimeout(n);
1720
+ try {
1721
+ return G(n);
1722
+ } catch {
1723
+ try {
1724
+ return G.call(null, n);
1725
+ } catch {
1726
+ return G.call(this, n);
1727
+ }
1728
+ }
1729
+ }
1730
+ var K = [], he = !1, re, _e = -1;
1731
+ function $i() {
1732
+ !he || !re || (he = !1, re.length ? K = re.concat(K) : _e = -1, K.length && Rt());
1733
+ }
1734
+ function Rt() {
1735
+ if (!he) {
1736
+ var n = Ct($i);
1737
+ he = !0;
1738
+ for (var i = K.length; i; ) {
1739
+ for (re = K, K = []; ++_e < i; )
1740
+ re && re[_e].run();
1741
+ _e = -1, i = K.length;
1742
+ }
1743
+ re = null, he = !1, Fi(n);
1744
+ }
1745
+ }
1746
+ U.nextTick = function(n) {
1747
+ var i = new Array(arguments.length - 1);
1748
+ if (arguments.length > 1)
1749
+ for (var a = 1; a < arguments.length; a++)
1750
+ i[a - 1] = arguments[a];
1751
+ K.push(new kt(n, i)), K.length === 1 && !he && Ct(Rt);
1752
+ };
1753
+ function kt(n, i) {
1754
+ this.fun = n, this.array = i;
1755
+ }
1756
+ kt.prototype.run = function() {
1757
+ this.fun.apply(null, this.array);
1758
+ };
1759
+ U.title = "browser";
1760
+ U.browser = !0;
1761
+ U.env = {};
1762
+ U.argv = [];
1763
+ U.version = "";
1764
+ U.versions = {};
1765
+ function X() {
1766
+ }
1767
+ U.on = X;
1768
+ U.addListener = X;
1769
+ U.once = X;
1770
+ U.off = X;
1771
+ U.removeListener = X;
1772
+ U.removeAllListeners = X;
1773
+ U.emit = X;
1774
+ U.prependListener = X;
1775
+ U.prependOnceListener = X;
1776
+ U.listeners = function(n) {
1777
+ return [];
1778
+ };
1779
+ U.binding = function(n) {
1780
+ throw new Error("process.binding is not supported");
1781
+ };
1782
+ U.cwd = function() {
1783
+ return "/";
1784
+ };
1785
+ U.chdir = function(n) {
1786
+ throw new Error("process.chdir is not supported");
1787
+ };
1788
+ U.umask = function() {
1789
+ return 0;
1790
+ };
1791
+ var Qi = Lt.exports;
1792
+ (function(n) {
1793
+ Object.defineProperty(n, Symbol.toStringTag, { value: "Module" });
1794
+ const i = Ot, a = Qi, c = (f) => f && f.__esModule ? f : { default: f }, u = c(a), g = globalThis || void 0 || self;
1795
+ Object.defineProperty(n, "Buffer", { enumerable: !0, get: () => i.Buffer }), Object.defineProperty(n, "process", { enumerable: !0, get: () => u.default }), n.global = g;
1796
+ })(bt);
1797
+ let P;
1798
+ typeof window < "u" ? P = window : typeof self < "u" ? P = self : P = bt.global;
1799
+ let Ve = null, He = null;
1800
+ const ut = 20, je = P.clearTimeout, dt = P.setTimeout, Fe = P.cancelAnimationFrame || P.mozCancelAnimationFrame || P.webkitCancelAnimationFrame, ht = P.requestAnimationFrame || P.mozRequestAnimationFrame || P.webkitRequestAnimationFrame;
1801
+ Fe == null || ht == null ? (Ve = je, He = function(i) {
1802
+ return dt(i, ut);
1803
+ }) : (Ve = function([i, a]) {
1804
+ Fe(i), je(a);
1805
+ }, He = function(i) {
1806
+ const a = ht(function() {
1807
+ je(c), i();
1808
+ }), c = dt(function() {
1809
+ Fe(a), i();
1810
+ }, ut);
1811
+ return [a, c];
1812
+ });
1813
+ function Pi(n) {
1814
+ let i, a, c, u, g, f, o;
1815
+ const w = typeof document < "u" && document.attachEvent;
1816
+ if (!w) {
1817
+ f = function(x) {
1818
+ const A = x.__resizeTriggers__, z = A.firstElementChild, O = A.lastElementChild, D = z.firstElementChild;
1819
+ O.scrollLeft = O.scrollWidth, O.scrollTop = O.scrollHeight, D.style.width = z.offsetWidth + 1 + "px", D.style.height = z.offsetHeight + 1 + "px", z.scrollLeft = z.scrollWidth, z.scrollTop = z.scrollHeight;
1820
+ }, g = function(x) {
1821
+ return x.offsetWidth !== x.__resizeLast__.width || x.offsetHeight !== x.__resizeLast__.height;
1822
+ }, o = function(x) {
1823
+ if (x.target.className && typeof x.target.className.indexOf == "function" && x.target.className.indexOf("contract-trigger") < 0 && x.target.className.indexOf("expand-trigger") < 0)
1824
+ return;
1825
+ const A = this;
1826
+ f(this), this.__resizeRAF__ && Ve(this.__resizeRAF__), this.__resizeRAF__ = He(function() {
1827
+ g(A) && (A.__resizeLast__.width = A.offsetWidth, A.__resizeLast__.height = A.offsetHeight, A.__resizeListeners__.forEach(function(D) {
1828
+ D.call(A, x);
1829
+ }));
1830
+ });
1831
+ };
1832
+ let I = !1, E = "";
1833
+ c = "animationstart";
1834
+ const T = "Webkit Moz O ms".split(" ");
1835
+ let h = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), M = "";
1836
+ {
1837
+ const x = document.createElement("fakeelement");
1838
+ if (x.style.animationName !== void 0 && (I = !0), I === !1) {
1839
+ for (let A = 0; A < T.length; A++)
1840
+ if (x.style[T[A] + "AnimationName"] !== void 0) {
1841
+ M = T[A], E = "-" + M.toLowerCase() + "-", c = h[A], I = !0;
1842
+ break;
1843
+ }
1844
+ }
1845
+ }
1846
+ a = "resizeanim", i = "@" + E + "keyframes " + a + " { from { opacity: 0; } to { opacity: 0; } } ", u = E + "animation: 1ms " + a + "; ";
1847
+ }
1848
+ const N = function(I) {
1849
+ if (!I.getElementById("detectElementResize")) {
1850
+ const E = (i || "") + ".resize-triggers { " + (u || "") + '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%; }', T = I.head || I.getElementsByTagName("head")[0], h = I.createElement("style");
1851
+ h.id = "detectElementResize", h.type = "text/css", n != null && h.setAttribute("nonce", n), h.styleSheet ? h.styleSheet.cssText = E : h.appendChild(I.createTextNode(E)), T.appendChild(h);
1852
+ }
1853
+ };
1854
+ return {
1855
+ addResizeListener: function(I, E) {
1856
+ if (w)
1857
+ I.attachEvent("onresize", E);
1858
+ else {
1859
+ if (!I.__resizeTriggers__) {
1860
+ const T = I.ownerDocument, h = P.getComputedStyle(I);
1861
+ h && h.position === "static" && (I.style.position = "relative"), N(T), I.__resizeLast__ = {}, I.__resizeListeners__ = [], (I.__resizeTriggers__ = T.createElement("div")).className = "resize-triggers";
1862
+ const M = T.createElement("div");
1863
+ M.className = "expand-trigger", M.appendChild(T.createElement("div"));
1864
+ const x = T.createElement("div");
1865
+ x.className = "contract-trigger", I.__resizeTriggers__.appendChild(M), I.__resizeTriggers__.appendChild(x), I.appendChild(I.__resizeTriggers__), f(I), I.addEventListener("scroll", o, !0), c && (I.__resizeTriggers__.__animationListener__ = function(z) {
1866
+ z.animationName === a && f(I);
1867
+ }, I.__resizeTriggers__.addEventListener(c, I.__resizeTriggers__.__animationListener__));
1868
+ }
1869
+ I.__resizeListeners__.push(E);
1870
+ }
1871
+ },
1872
+ removeResizeListener: function(I, E) {
1873
+ if (w)
1874
+ I.detachEvent("onresize", E);
1875
+ else if (I.__resizeListeners__.splice(I.__resizeListeners__.indexOf(E), 1), !I.__resizeListeners__.length) {
1876
+ I.removeEventListener("scroll", o, !0), I.__resizeTriggers__.__animationListener__ && (I.__resizeTriggers__.removeEventListener(c, I.__resizeTriggers__.__animationListener__), I.__resizeTriggers__.__animationListener__ = null);
1877
+ try {
1878
+ I.__resizeTriggers__ = !I.removeChild(I.__resizeTriggers__);
1879
+ } catch {
1880
+ }
1881
+ }
1882
+ }
1883
+ };
1884
+ }
1885
+ class qi extends Wt {
1886
+ constructor(...i) {
1887
+ super(...i), this.state = {
1888
+ height: this.props.defaultHeight || 0,
1889
+ scaledHeight: this.props.defaultHeight || 0,
1890
+ scaledWidth: this.props.defaultWidth || 0,
1891
+ width: this.props.defaultWidth || 0
1892
+ }, this._autoSizer = null, this._detectElementResize = null, this._parentNode = null, this._resizeObserver = null, this._timeoutId = null, this._onResize = () => {
1893
+ this._timeoutId = null;
1894
+ const {
1895
+ disableHeight: a,
1896
+ disableWidth: c,
1897
+ onResize: u
1898
+ } = this.props;
1899
+ if (this._parentNode) {
1900
+ var g, f, o, w;
1901
+ const N = window.getComputedStyle(this._parentNode) || {}, v = parseFloat((g = N.paddingLeft) !== null && g !== void 0 ? g : "0"), _ = parseFloat((f = N.paddingRight) !== null && f !== void 0 ? f : "0"), I = parseFloat((o = N.paddingTop) !== null && o !== void 0 ? o : "0"), E = parseFloat((w = N.paddingBottom) !== null && w !== void 0 ? w : "0"), T = this._parentNode.getBoundingClientRect(), h = T.height - I - E, M = T.width - v - _, x = this._parentNode.offsetHeight - I - E, A = this._parentNode.offsetWidth - v - _;
1902
+ (!a && (this.state.height !== x || this.state.scaledHeight !== h) || !c && (this.state.width !== A || this.state.scaledWidth !== M)) && (this.setState({
1903
+ height: x,
1904
+ width: A,
1905
+ scaledHeight: h,
1906
+ scaledWidth: M
1907
+ }), typeof u == "function" && u({
1908
+ height: x,
1909
+ scaledHeight: h,
1910
+ scaledWidth: M,
1911
+ width: A
1912
+ }));
1913
+ }
1914
+ }, this._setRef = (a) => {
1915
+ this._autoSizer = a;
1916
+ };
1917
+ }
1918
+ componentDidMount() {
1919
+ const {
1920
+ nonce: i
1921
+ } = this.props;
1922
+ 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(() => {
1923
+ this._timeoutId = setTimeout(this._onResize, 0);
1924
+ }), this._resizeObserver.observe(this._parentNode)) : (this._detectElementResize = Pi(i), this._detectElementResize.addResizeListener(this._parentNode, this._onResize)), this._onResize()));
1925
+ }
1926
+ componentWillUnmount() {
1927
+ 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()));
1928
+ }
1929
+ render() {
1930
+ const {
1931
+ children: i,
1932
+ defaultHeight: a,
1933
+ defaultWidth: c,
1934
+ disableHeight: u = !1,
1935
+ disableWidth: g = !1,
1936
+ nonce: f,
1937
+ onResize: o,
1938
+ style: w = {},
1939
+ tagName: N = "div",
1940
+ ...v
1941
+ } = this.props, {
1942
+ height: _,
1943
+ scaledHeight: I,
1944
+ scaledWidth: E,
1945
+ width: T
1946
+ } = this.state, h = {
1947
+ overflow: "visible"
1948
+ }, M = {};
1949
+ let x = !1;
1950
+ return u || (_ === 0 && (x = !0), h.height = 0, M.height = _, M.scaledHeight = I), g || (T === 0 && (x = !0), h.width = 0, M.width = T, M.scaledWidth = E), ve(N, {
1951
+ ref: this._setRef,
1952
+ style: {
1953
+ ...h,
1954
+ ...w
1955
+ },
1956
+ ...v
1957
+ }, !x && i(M));
1958
+ }
1959
+ }
1960
+ function Ge() {
1961
+ return Ge = Object.assign ? Object.assign.bind() : function(n) {
1962
+ for (var i = 1; i < arguments.length; i++) {
1963
+ var a = arguments[i];
1964
+ for (var c in a)
1965
+ Object.prototype.hasOwnProperty.call(a, c) && (n[c] = a[c]);
1966
+ }
1967
+ return n;
1968
+ }, Ge.apply(this, arguments);
1969
+ }
1970
+ function pt(n) {
1971
+ if (n === void 0)
1972
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1973
+ return n;
1974
+ }
1975
+ function Ze(n, i) {
1976
+ return Ze = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(c, u) {
1977
+ return c.__proto__ = u, c;
1978
+ }, Ze(n, i);
1979
+ }
1980
+ function Yi(n, i) {
1981
+ n.prototype = Object.create(i.prototype), n.prototype.constructor = n, Ze(n, i);
1982
+ }
1983
+ var ft = Number.isNaN || function(i) {
1984
+ return typeof i == "number" && i !== i;
1985
+ };
1986
+ function Wi(n, i) {
1987
+ return !!(n === i || ft(n) && ft(i));
1988
+ }
1989
+ function Vi(n, i) {
1990
+ if (n.length !== i.length)
1991
+ return !1;
1992
+ for (var a = 0; a < n.length; a++)
1993
+ if (!Wi(n[a], i[a]))
1994
+ return !1;
1995
+ return !0;
1996
+ }
1997
+ function $e(n, i) {
1998
+ i === void 0 && (i = Vi);
1999
+ var a, c = [], u, g = !1;
2000
+ function f() {
2001
+ for (var o = [], w = 0; w < arguments.length; w++)
2002
+ o[w] = arguments[w];
2003
+ return g && a === this && i(o, c) || (u = n.apply(this, o), g = !0, a = this, c = o), u;
2004
+ }
2005
+ return f;
2006
+ }
2007
+ var Hi = typeof performance == "object" && typeof performance.now == "function", mt = Hi ? function() {
2008
+ return performance.now();
2009
+ } : function() {
2010
+ return Date.now();
2011
+ };
2012
+ function gt(n) {
2013
+ cancelAnimationFrame(n.id);
2014
+ }
2015
+ function Gi(n, i) {
2016
+ var a = mt();
2017
+ function c() {
2018
+ mt() - a >= i ? n.call(null) : u.id = requestAnimationFrame(c);
2019
+ }
2020
+ var u = {
2021
+ id: requestAnimationFrame(c)
2022
+ };
2023
+ return u;
2024
+ }
2025
+ var Qe = -1;
2026
+ function yt(n) {
2027
+ if (n === void 0 && (n = !1), Qe === -1 || n) {
2028
+ var i = document.createElement("div"), a = i.style;
2029
+ a.width = "50px", a.height = "50px", a.overflow = "scroll", document.body.appendChild(i), Qe = i.offsetWidth - i.clientWidth, document.body.removeChild(i);
2030
+ }
2031
+ return Qe;
2032
+ }
2033
+ var ce = null;
2034
+ function It(n) {
2035
+ if (n === void 0 && (n = !1), ce === null || n) {
2036
+ var i = document.createElement("div"), a = i.style;
2037
+ a.width = "50px", a.height = "50px", a.overflow = "scroll", a.direction = "rtl";
2038
+ var c = document.createElement("div"), u = c.style;
2039
+ return u.width = "100px", u.height = "100px", i.appendChild(c), document.body.appendChild(i), i.scrollLeft > 0 ? ce = "positive-descending" : (i.scrollLeft = 1, i.scrollLeft === 0 ? ce = "negative" : ce = "positive-ascending"), document.body.removeChild(i), ce;
2040
+ }
2041
+ return ce;
2042
+ }
2043
+ var Zi = 150, Ji = function(i, a) {
2044
+ return i;
2045
+ };
2046
+ function Ki(n) {
2047
+ var i, a = n.getItemOffset, c = n.getEstimatedTotalSize, u = n.getItemSize, g = n.getOffsetForIndexAndAlignment, f = n.getStartIndexForOffset, o = n.getStopIndexForStartIndex, w = n.initInstanceProps, N = n.shouldResetStyleCacheOnItemSizeChange, v = n.validateProps;
2048
+ return i = /* @__PURE__ */ function(_) {
2049
+ Yi(I, _);
2050
+ function I(T) {
2051
+ var h;
2052
+ return h = _.call(this, T) || this, h._instanceProps = w(h.props, pt(h)), h._outerRef = void 0, h._resetIsScrollingTimeoutId = null, h.state = {
2053
+ instance: pt(h),
2054
+ isScrolling: !1,
2055
+ scrollDirection: "forward",
2056
+ scrollOffset: typeof h.props.initialScrollOffset == "number" ? h.props.initialScrollOffset : 0,
2057
+ scrollUpdateWasRequested: !1
2058
+ }, h._callOnItemsRendered = void 0, h._callOnItemsRendered = $e(function(M, x, A, z) {
2059
+ return h.props.onItemsRendered({
2060
+ overscanStartIndex: M,
2061
+ overscanStopIndex: x,
2062
+ visibleStartIndex: A,
2063
+ visibleStopIndex: z
2064
+ });
2065
+ }), h._callOnScroll = void 0, h._callOnScroll = $e(function(M, x, A) {
2066
+ return h.props.onScroll({
2067
+ scrollDirection: M,
2068
+ scrollOffset: x,
2069
+ scrollUpdateWasRequested: A
2070
+ });
2071
+ }), h._getItemStyle = void 0, h._getItemStyle = function(M) {
2072
+ var x = h.props, A = x.direction, z = x.itemSize, O = x.layout, D = h._getItemStyleCache(N && z, N && O, N && A), L;
2073
+ if (D.hasOwnProperty(M))
2074
+ L = D[M];
2075
+ else {
2076
+ var j = a(h.props, M, h._instanceProps), q = u(h.props, M, h._instanceProps), Y = A === "horizontal" || O === "horizontal", ne = A === "rtl", se = Y ? j : 0;
2077
+ D[M] = L = {
2078
+ position: "absolute",
2079
+ left: ne ? void 0 : se,
2080
+ right: ne ? se : void 0,
2081
+ top: Y ? 0 : j,
2082
+ height: Y ? "100%" : q,
2083
+ width: Y ? q : "100%"
2084
+ };
2085
+ }
2086
+ return L;
2087
+ }, h._getItemStyleCache = void 0, h._getItemStyleCache = $e(function(M, x, A) {
2088
+ return {};
2089
+ }), h._onScrollHorizontal = function(M) {
2090
+ var x = M.currentTarget, A = x.clientWidth, z = x.scrollLeft, O = x.scrollWidth;
2091
+ h.setState(function(D) {
2092
+ if (D.scrollOffset === z)
2093
+ return null;
2094
+ var L = h.props.direction, j = z;
2095
+ if (L === "rtl")
2096
+ switch (It()) {
2097
+ case "negative":
2098
+ j = -z;
2099
+ break;
2100
+ case "positive-descending":
2101
+ j = O - A - z;
2102
+ break;
2103
+ }
2104
+ return j = Math.max(0, Math.min(j, O - A)), {
2105
+ isScrolling: !0,
2106
+ scrollDirection: D.scrollOffset < z ? "forward" : "backward",
2107
+ scrollOffset: j,
2108
+ scrollUpdateWasRequested: !1
2109
+ };
2110
+ }, h._resetIsScrollingDebounced);
2111
+ }, h._onScrollVertical = function(M) {
2112
+ var x = M.currentTarget, A = x.clientHeight, z = x.scrollHeight, O = x.scrollTop;
2113
+ h.setState(function(D) {
2114
+ if (D.scrollOffset === O)
2115
+ return null;
2116
+ var L = Math.max(0, Math.min(O, z - A));
2117
+ return {
2118
+ isScrolling: !0,
2119
+ scrollDirection: D.scrollOffset < L ? "forward" : "backward",
2120
+ scrollOffset: L,
2121
+ scrollUpdateWasRequested: !1
2122
+ };
2123
+ }, h._resetIsScrollingDebounced);
2124
+ }, h._outerRefSetter = function(M) {
2125
+ var x = h.props.outerRef;
2126
+ h._outerRef = M, typeof x == "function" ? x(M) : x != null && typeof x == "object" && x.hasOwnProperty("current") && (x.current = M);
2127
+ }, h._resetIsScrollingDebounced = function() {
2128
+ h._resetIsScrollingTimeoutId !== null && gt(h._resetIsScrollingTimeoutId), h._resetIsScrollingTimeoutId = Gi(h._resetIsScrolling, Zi);
2129
+ }, h._resetIsScrolling = function() {
2130
+ h._resetIsScrollingTimeoutId = null, h.setState({
2131
+ isScrolling: !1
2132
+ }, function() {
2133
+ h._getItemStyleCache(-1, null);
2134
+ });
2135
+ }, h;
2136
+ }
2137
+ I.getDerivedStateFromProps = function(h, M) {
2138
+ return Xi(h, M), v(h), null;
2139
+ };
2140
+ var E = I.prototype;
2141
+ return E.scrollTo = function(h) {
2142
+ h = Math.max(0, h), this.setState(function(M) {
2143
+ return M.scrollOffset === h ? null : {
2144
+ scrollDirection: M.scrollOffset < h ? "forward" : "backward",
2145
+ scrollOffset: h,
2146
+ scrollUpdateWasRequested: !0
2147
+ };
2148
+ }, this._resetIsScrollingDebounced);
2149
+ }, E.scrollToItem = function(h, M) {
2150
+ M === void 0 && (M = "auto");
2151
+ var x = this.props, A = x.itemCount, z = x.layout, O = this.state.scrollOffset;
2152
+ h = Math.max(0, Math.min(h, A - 1));
2153
+ var D = 0;
2154
+ if (this._outerRef) {
2155
+ var L = this._outerRef;
2156
+ z === "vertical" ? D = L.scrollWidth > L.clientWidth ? yt() : 0 : D = L.scrollHeight > L.clientHeight ? yt() : 0;
2157
+ }
2158
+ this.scrollTo(g(this.props, h, M, O, this._instanceProps, D));
2159
+ }, E.componentDidMount = function() {
2160
+ var h = this.props, M = h.direction, x = h.initialScrollOffset, A = h.layout;
2161
+ if (typeof x == "number" && this._outerRef != null) {
2162
+ var z = this._outerRef;
2163
+ M === "horizontal" || A === "horizontal" ? z.scrollLeft = x : z.scrollTop = x;
2164
+ }
2165
+ this._callPropsCallbacks();
2166
+ }, E.componentDidUpdate = function() {
2167
+ var h = this.props, M = h.direction, x = h.layout, A = this.state, z = A.scrollOffset, O = A.scrollUpdateWasRequested;
2168
+ if (O && this._outerRef != null) {
2169
+ var D = this._outerRef;
2170
+ if (M === "horizontal" || x === "horizontal")
2171
+ if (M === "rtl")
2172
+ switch (It()) {
2173
+ case "negative":
2174
+ D.scrollLeft = -z;
2175
+ break;
2176
+ case "positive-ascending":
2177
+ D.scrollLeft = z;
2178
+ break;
2179
+ default:
2180
+ var L = D.clientWidth, j = D.scrollWidth;
2181
+ D.scrollLeft = j - L - z;
2182
+ break;
2183
+ }
2184
+ else
2185
+ D.scrollLeft = z;
2186
+ else
2187
+ D.scrollTop = z;
2188
+ }
2189
+ this._callPropsCallbacks();
2190
+ }, E.componentWillUnmount = function() {
2191
+ this._resetIsScrollingTimeoutId !== null && gt(this._resetIsScrollingTimeoutId);
2192
+ }, E.render = function() {
2193
+ var h = this.props, M = h.children, x = h.className, A = h.direction, z = h.height, O = h.innerRef, D = h.innerElementType, L = h.innerTagName, j = h.itemCount, q = h.itemData, Y = h.itemKey, ne = Y === void 0 ? Ji : Y, se = h.layout, De = h.outerElementType, be = h.outerTagName, xe = h.style, we = h.useIsScrolling, Oe = h.width, Me = this.state.isScrolling, pe = A === "horizontal" || se === "horizontal", Be = pe ? this._onScrollHorizontal : this._onScrollVertical, Ae = this._getRangeToRender(), F = Ae[0], $ = Ae[1], fe = [];
2194
+ if (j > 0)
2195
+ for (var ee = F; ee <= $; ee++)
2196
+ fe.push(ve(M, {
2197
+ data: q,
2198
+ key: ne(ee, q),
2199
+ index: ee,
2200
+ isScrolling: we ? Me : void 0,
2201
+ style: this._getItemStyle(ee)
2202
+ }));
2203
+ var me = c(this.props, this._instanceProps);
2204
+ return ve(De || be || "div", {
2205
+ className: x,
2206
+ onScroll: Be,
2207
+ ref: this._outerRefSetter,
2208
+ style: Ge({
2209
+ position: "relative",
2210
+ height: z,
2211
+ width: Oe,
2212
+ overflow: "auto",
2213
+ WebkitOverflowScrolling: "touch",
2214
+ willChange: "transform",
2215
+ direction: A
2216
+ }, xe)
2217
+ }, ve(D || L || "div", {
2218
+ children: fe,
2219
+ ref: O,
2220
+ style: {
2221
+ height: pe ? "100%" : me,
2222
+ pointerEvents: Me ? "none" : void 0,
2223
+ width: pe ? me : "100%"
2224
+ }
2225
+ }));
2226
+ }, E._callPropsCallbacks = function() {
2227
+ if (typeof this.props.onItemsRendered == "function") {
2228
+ var h = this.props.itemCount;
2229
+ if (h > 0) {
2230
+ var M = this._getRangeToRender(), x = M[0], A = M[1], z = M[2], O = M[3];
2231
+ this._callOnItemsRendered(x, A, z, O);
2232
+ }
2233
+ }
2234
+ if (typeof this.props.onScroll == "function") {
2235
+ var D = this.state, L = D.scrollDirection, j = D.scrollOffset, q = D.scrollUpdateWasRequested;
2236
+ this._callOnScroll(L, j, q);
2237
+ }
2238
+ }, E._getRangeToRender = function() {
2239
+ var h = this.props, M = h.itemCount, x = h.overscanCount, A = this.state, z = A.isScrolling, O = A.scrollDirection, D = A.scrollOffset;
2240
+ if (M === 0)
2241
+ return [0, 0, 0, 0];
2242
+ var L = f(this.props, D, this._instanceProps), j = o(this.props, L, D, this._instanceProps), q = !z || O === "backward" ? Math.max(1, x) : 1, Y = !z || O === "forward" ? Math.max(1, x) : 1;
2243
+ return [Math.max(0, L - q), Math.max(0, Math.min(M - 1, j + Y)), L, j];
2244
+ }, I;
2245
+ }(Nt), i.defaultProps = {
2246
+ direction: "ltr",
2247
+ itemData: void 0,
2248
+ layout: "vertical",
2249
+ overscanCount: 2,
2250
+ useIsScrolling: !1
2251
+ }, i;
2252
+ }
2253
+ var Xi = function(i, a) {
2254
+ i.children, i.direction, i.height, i.layout, i.innerTagName, i.outerTagName, i.width, a.instance;
2255
+ }, en = /* @__PURE__ */ Ki({
2256
+ getItemOffset: function(i, a) {
2257
+ var c = i.itemSize;
2258
+ return a * c;
2259
+ },
2260
+ getItemSize: function(i, a) {
2261
+ var c = i.itemSize;
2262
+ return c;
2263
+ },
2264
+ getEstimatedTotalSize: function(i) {
2265
+ var a = i.itemCount, c = i.itemSize;
2266
+ return c * a;
2267
+ },
2268
+ getOffsetForIndexAndAlignment: function(i, a, c, u, g, f) {
2269
+ var o = i.direction, w = i.height, N = i.itemCount, v = i.itemSize, _ = i.layout, I = i.width, E = o === "horizontal" || _ === "horizontal", T = E ? I : w, h = Math.max(0, N * v - T), M = Math.min(h, a * v), x = Math.max(0, a * v - T + v + f);
2270
+ switch (c === "smart" && (u >= x - T && u <= M + T ? c = "auto" : c = "center"), c) {
2271
+ case "start":
2272
+ return M;
2273
+ case "end":
2274
+ return x;
2275
+ case "center": {
2276
+ var A = Math.round(x + (M - x) / 2);
2277
+ return A < Math.ceil(T / 2) ? 0 : A > h + Math.floor(T / 2) ? h : A;
2278
+ }
2279
+ case "auto":
2280
+ default:
2281
+ return u >= x && u <= M ? u : u < x ? x : M;
2282
+ }
2283
+ },
2284
+ getStartIndexForOffset: function(i, a) {
2285
+ var c = i.itemCount, u = i.itemSize;
2286
+ return Math.max(0, Math.min(c - 1, Math.floor(a / u)));
2287
+ },
2288
+ getStopIndexForStartIndex: function(i, a, c) {
2289
+ var u = i.direction, g = i.height, f = i.itemCount, o = i.itemSize, w = i.layout, N = i.width, v = u === "horizontal" || w === "horizontal", _ = a * o, I = v ? N : g, E = Math.ceil((I + c - _) / o);
2290
+ return Math.max(0, Math.min(
2291
+ f - 1,
2292
+ a + E - 1
2293
+ // -1 is because stop index is inclusive
2294
+ ));
2295
+ },
2296
+ initInstanceProps: function(i) {
2297
+ },
2298
+ shouldResetStyleCacheOnItemSizeChange: !0,
2299
+ validateProps: function(i) {
2300
+ i.itemSize;
2301
+ }
2302
+ });
2303
+ function tn(n) {
2304
+ var i = n.lastRenderedStartIndex, a = n.lastRenderedStopIndex, c = n.startIndex, u = n.stopIndex;
2305
+ return !(c > a || u < i);
2306
+ }
2307
+ function rn(n) {
2308
+ for (var i = n.isItemLoaded, a = n.itemCount, c = n.minimumBatchSize, u = n.startIndex, g = n.stopIndex, f = [], o = null, w = null, N = u; N <= g; N++) {
2309
+ var v = i(N);
2310
+ v ? w !== null && (f.push(o, w), o = w = null) : (w = N, o === null && (o = N));
2311
+ }
2312
+ if (w !== null) {
2313
+ for (var _ = Math.min(Math.max(w, o + c - 1), a - 1), I = w + 1; I <= _ && !i(I); I++)
2314
+ w = I;
2315
+ f.push(o, w);
2316
+ }
2317
+ if (f.length)
2318
+ for (; f[1] - f[0] + 1 < c && f[0] > 0; ) {
2319
+ var E = f[0] - 1;
2320
+ if (!i(E))
2321
+ f[0] = E;
2322
+ else
2323
+ break;
2324
+ }
2325
+ return f;
2326
+ }
2327
+ var nn = function(n, i) {
2328
+ if (!(n instanceof i))
2329
+ throw new TypeError("Cannot call a class as a function");
2330
+ }, sn = function() {
2331
+ function n(i, a) {
2332
+ for (var c = 0; c < a.length; c++) {
2333
+ var u = a[c];
2334
+ u.enumerable = u.enumerable || !1, u.configurable = !0, "value" in u && (u.writable = !0), Object.defineProperty(i, u.key, u);
2335
+ }
2336
+ }
2337
+ return function(i, a, c) {
2338
+ return a && n(i.prototype, a), c && n(i, c), i;
2339
+ };
2340
+ }(), on = function(n, i) {
2341
+ if (typeof i != "function" && i !== null)
2342
+ throw new TypeError("Super expression must either be null or a function, not " + typeof i);
2343
+ n.prototype = Object.create(i && i.prototype, {
2344
+ constructor: {
2345
+ value: n,
2346
+ enumerable: !1,
2347
+ writable: !0,
2348
+ configurable: !0
2349
+ }
2350
+ }), i && (Object.setPrototypeOf ? Object.setPrototypeOf(n, i) : n.__proto__ = i);
2351
+ }, xt = function(n, i) {
2352
+ if (!n)
2353
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2354
+ return i && (typeof i == "object" || typeof i == "function") ? i : n;
2355
+ }, an = function(n) {
2356
+ on(i, n);
2357
+ function i() {
2358
+ var a, c, u, g;
2359
+ nn(this, i);
2360
+ for (var f = arguments.length, o = Array(f), w = 0; w < f; w++)
2361
+ o[w] = arguments[w];
2362
+ return g = (c = (u = xt(this, (a = i.__proto__ || Object.getPrototypeOf(i)).call.apply(a, [this].concat(o))), u), u._lastRenderedStartIndex = -1, u._lastRenderedStopIndex = -1, u._memoizedUnloadedRanges = [], u._onItemsRendered = function(N) {
2363
+ var v = N.visibleStartIndex, _ = N.visibleStopIndex;
2364
+ u._lastRenderedStartIndex = v, u._lastRenderedStopIndex = _, u._ensureRowsLoaded(v, _);
2365
+ }, u._setRef = function(N) {
2366
+ u._listRef = N;
2367
+ }, c), xt(u, g);
2368
+ }
2369
+ return sn(i, [{
2370
+ key: "resetloadMoreItemsCache",
2371
+ value: function() {
2372
+ var c = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
2373
+ this._memoizedUnloadedRanges = [], c && this._ensureRowsLoaded(this._lastRenderedStartIndex, this._lastRenderedStopIndex);
2374
+ }
2375
+ }, {
2376
+ key: "componentDidMount",
2377
+ value: function() {
2378
+ }
2379
+ }, {
2380
+ key: "render",
2381
+ value: function() {
2382
+ var c = this.props.children;
2383
+ return c({
2384
+ onItemsRendered: this._onItemsRendered,
2385
+ ref: this._setRef
2386
+ });
2387
+ }
2388
+ }, {
2389
+ key: "_ensureRowsLoaded",
2390
+ value: function(c, u) {
2391
+ var g = this.props, f = g.isItemLoaded, o = g.itemCount, w = g.minimumBatchSize, N = w === void 0 ? 10 : w, v = g.threshold, _ = v === void 0 ? 15 : v, I = rn({
2392
+ isItemLoaded: f,
2393
+ itemCount: o,
2394
+ minimumBatchSize: N,
2395
+ startIndex: Math.max(0, c - _),
2396
+ stopIndex: Math.min(o - 1, u + _)
2397
+ });
2398
+ (this._memoizedUnloadedRanges.length !== I.length || this._memoizedUnloadedRanges.some(function(E, T) {
2399
+ return I[T] !== E;
2400
+ })) && (this._memoizedUnloadedRanges = I, this._loadUnloadedRanges(I));
2401
+ }
2402
+ }, {
2403
+ key: "_loadUnloadedRanges",
2404
+ value: function(c) {
2405
+ for (var u = this, g = this.props.loadMoreItems || this.props.loadMoreRows, f = function(N) {
2406
+ var v = c[N], _ = c[N + 1], I = g(v, _);
2407
+ I != null && I.then(function() {
2408
+ if (tn({
2409
+ lastRenderedStartIndex: u._lastRenderedStartIndex,
2410
+ lastRenderedStopIndex: u._lastRenderedStopIndex,
2411
+ startIndex: v,
2412
+ stopIndex: _
2413
+ })) {
2414
+ if (u._listRef == null)
2415
+ return;
2416
+ typeof u._listRef.resetAfterIndex == "function" ? u._listRef.resetAfterIndex(v, !0) : (typeof u._listRef._getItemStyleCache == "function" && u._listRef._getItemStyleCache(-1), u._listRef.forceUpdate());
2417
+ }
2418
+ });
2419
+ }, o = 0; o < c.length; o += 2)
2420
+ f(o);
2421
+ }
2422
+ }]), i;
2423
+ }(Nt);
2424
+ const ln = () => J, cn = /* @__PURE__ */ y("div")({
2425
+ name: "a",
2426
+ class: "a1w9zony",
2427
+ propsAsIs: !1
2428
+ }), un = /* @__PURE__ */ y("div")({
2429
+ name: "l",
2430
+ class: "l16qcfv8",
2431
+ propsAsIs: !1
2432
+ }), dn = /* @__PURE__ */ y("img")({
2433
+ name: "p",
2434
+ class: "p1gmcc5f",
2435
+ propsAsIs: !1
2436
+ }), hn = /* @__PURE__ */ y("div")({
2437
+ name: "s",
2438
+ class: "s1doddh0",
2439
+ propsAsIs: !1
2440
+ }), pn = /* @__PURE__ */ y("div")({
2441
+ name: "c",
2442
+ class: "c1js9xhe",
2443
+ propsAsIs: !1
2444
+ }), fn = /* @__PURE__ */ y("div")({
2445
+ name: "d",
2446
+ class: "d1tmnqsh",
2447
+ propsAsIs: !1
2448
+ }), mn = /* @__PURE__ */ y("span")({
2449
+ name: "g",
2450
+ class: "gi9h87j",
2451
+ propsAsIs: !1
2452
+ }), gn = /* @__PURE__ */ y(ln())({
2453
+ name: "x",
2454
+ class: "x13mk3z6",
2455
+ propsAsIs: !0
2456
+ }), yn = ({
2457
+ rank: n,
2458
+ avatar: i,
2459
+ name: a,
2460
+ points: c,
2461
+ isCurrentUser: u,
2462
+ openItemDetail: g,
2463
+ style: f
2464
+ }) => /* @__PURE__ */ S(cn, { onClick: g, style: f, children: [
2465
+ /* @__PURE__ */ m(un, { children: n || 0 }),
2466
+ /* @__PURE__ */ S(pn, { children: [
2467
+ i ? /* @__PURE__ */ m(dn, { alt: "leaderboard-item-avatar", src: i }) : /* @__PURE__ */ m(hn, { children: vt(a || "") }),
2468
+ /* @__PURE__ */ S(fn, { children: [
2469
+ /* @__PURE__ */ m(mn, { children: a || "" }),
2470
+ u && /* @__PURE__ */ m(gn, { name: "icon-star" })
2471
+ ] })
2472
+ ] }),
2473
+ /* @__PURE__ */ m("div", { children: _t(c) })
2474
+ ] }), In = ({ items: n, openItemDetail: i, fetchMore: a }) => /* @__PURE__ */ m(qi, { children: ({ width: c, height: u }) => /* @__PURE__ */ m(
2475
+ an,
2476
+ {
2477
+ isItemLoaded: (g) => g < n.length,
2478
+ itemCount: n.length + 1,
2479
+ loadMoreItems: a,
2480
+ children: ({ onItemsRendered: g, ref: f }) => /* @__PURE__ */ m(
2481
+ en,
2482
+ {
2483
+ itemSize: 56,
2484
+ onItemsRendered: g,
2485
+ ref: f,
2486
+ itemCount: n.length,
2487
+ width: c,
2488
+ height: u,
2489
+ children: ({ index: o, style: w }) => /* @__PURE__ */ m(
2490
+ yn,
2491
+ {
2492
+ style: { ...w, maxHeight: 48 },
2493
+ ...n[o],
2494
+ openItemDetail: () => i(n[o].userId)
2495
+ },
2496
+ n[o].userId
2497
+ )
2498
+ }
2499
+ )
2500
+ }
2501
+ ) }), xn = ({ leaderboardList: n, openUser: i }) => {
2502
+ const { data: a } = ie(n.$store);
2503
+ return /* @__PURE__ */ m(In, { fetchMore: n.fetchMore, items: a, openItemDetail: i });
2504
+ };
2505
+ const wn = /* @__PURE__ */ y("button")({
2506
+ name: "a",
2507
+ class: "akly9h2",
2508
+ propsAsIs: !1
2509
+ }), Mn = /* @__PURE__ */ y("span")({
2510
+ name: "e",
2511
+ class: "eptoiz9",
2512
+ propsAsIs: !1
2513
+ }), An = ({ disabled: n, variant: i = "primary", onClick: a, children: c, ...u }) => /* @__PURE__ */ m(wn, { onClick: a, disabled: n, "data-variant": i, ...u, children: /* @__PURE__ */ m(Mn, { children: c }) });
2514
+ const En = () => J, Tn = () => J, Nn = /* @__PURE__ */ y("div")({
2515
+ name: "s",
2516
+ class: "s1lblda3",
2517
+ propsAsIs: !1
2518
+ }), vn = /* @__PURE__ */ y("div")({
2519
+ name: "a",
2520
+ class: "ascvb2g",
2521
+ propsAsIs: !1
2522
+ }), _n = /* @__PURE__ */ y("div")({
2523
+ name: "p",
2524
+ class: "p17rl8zy",
2525
+ propsAsIs: !1
2526
+ }), Sn = /* @__PURE__ */ y("div")({
2527
+ name: "l",
2528
+ class: "l1vvttbn",
2529
+ propsAsIs: !1
2530
+ }), Pe = /* @__PURE__ */ y(En())({
2531
+ name: "c",
2532
+ class: "c6fk2ph",
2533
+ propsAsIs: !0
2534
+ }), zn = /* @__PURE__ */ y(Tn())({
2535
+ name: "d",
2536
+ class: "d1rdm136",
2537
+ propsAsIs: !0
2538
+ }), Dn = /* @__PURE__ */ y("div")({
2539
+ name: "f",
2540
+ class: "fwqnnel",
2541
+ propsAsIs: !1
2542
+ }), bn = /* @__PURE__ */ y("div")({
2543
+ name: "u",
2544
+ class: "ucyxnlg",
2545
+ propsAsIs: !1
2546
+ }), On = {
2547
+ [Te.LOST]: /* @__PURE__ */ m(Pe, { name: "icon-cross" }),
2548
+ [Te.WON]: /* @__PURE__ */ m(Pe, { name: "icon-check" }),
2549
+ [Te.UNSET]: void 0,
2550
+ [Te.DNP]: /* @__PURE__ */ m(Pe, { name: "icon-arrow" })
2551
+ }, Bn = ({
2552
+ questionId: n,
2553
+ questionType: i,
2554
+ questionStatus: a,
2555
+ subject: c,
2556
+ openForVoting: u,
2557
+ openQuestion: g,
2558
+ status: f
2559
+ }) => {
2560
+ const o = Mt[i], w = On[f];
2561
+ return o ? /* @__PURE__ */ S(Nn, { onClick: () => g == null ? void 0 : g(n), children: [
2562
+ /* @__PURE__ */ S(bn, { children: [
2563
+ /* @__PURE__ */ S(vn, { children: [
2564
+ /* @__PURE__ */ m(zn, { name: o.iconName }),
2565
+ /* @__PURE__ */ S(Dn, { children: [
2566
+ o.label,
2567
+ i === W.TRIVIA && a === Je.RESOLVED && " • Expired"
2568
+ ] })
2569
+ ] }),
2570
+ /* @__PURE__ */ m(_n, { children: c || "" })
2571
+ ] }),
2572
+ /* @__PURE__ */ m(Sn, { children: w || (u ? /* @__PURE__ */ m(An, { children: "Play" }) : null) })
2573
+ ] }) : null;
2574
+ };
2575
+ const Ln = /* @__PURE__ */ y("div")({
2576
+ name: "e",
2577
+ class: "e1jcgove",
2578
+ propsAsIs: !1
2579
+ }), Cn = /* @__PURE__ */ y("div")({
2580
+ name: "t",
2581
+ class: "t1bwp7hh",
2582
+ propsAsIs: !1
2583
+ }), Rn = /* @__PURE__ */ y("div")({
2584
+ name: "i",
2585
+ class: "i1xav4cl",
2586
+ propsAsIs: !1
2587
+ }), kn = /* @__PURE__ */ y("h3")({
2588
+ name: "n",
2589
+ class: "n3qb30y",
2590
+ propsAsIs: !1
2591
+ }), Un = /* @__PURE__ */ y("div")({
2592
+ name: "a",
2593
+ class: "ap5d9g7",
2594
+ propsAsIs: !1
2595
+ }), jn = /* @__PURE__ */ y("button")({
2596
+ name: "l",
2597
+ class: "lvdbmlu",
2598
+ propsAsIs: !1
2599
+ }), Fn = ({
2600
+ title: n,
2601
+ instantView: i,
2602
+ openInsight: a,
2603
+ questionId: c
2604
+ }) => {
2605
+ const u = /* @__PURE__ */ new Date(), g = u.toLocaleDateString("en-US", {
2606
+ weekday: "short",
2607
+ month: "short",
2608
+ day: "numeric"
2609
+ }), f = u.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit" });
2610
+ return /* @__PURE__ */ S(Ln, { children: [
2611
+ /* @__PURE__ */ S(Cn, { children: [
2612
+ g,
2613
+ "・",
2614
+ f
2615
+ ] }),
2616
+ (i == null ? void 0 : i.video) && /* @__PURE__ */ m(Et, { source: i.video.url, poster: i.video.thumbnailUrl }),
2617
+ /* @__PURE__ */ S(Rn, { children: [
2618
+ /* @__PURE__ */ m(kn, { children: (i == null ? void 0 : i.heading) || n }),
2619
+ /* @__PURE__ */ m(Un, { children: i == null ? void 0 : i.body }),
2620
+ a && /* @__PURE__ */ m(jn, { onClick: () => a(c), children: "View Insight" })
2621
+ ] })
2622
+ ] });
2623
+ };
2624
+ const $n = /* @__PURE__ */ y("div")({
2625
+ name: "t",
2626
+ class: "t19vr3p1",
2627
+ propsAsIs: !1
2628
+ }), Qn = ({ questions: n, openQuestion: i }) => /* @__PURE__ */ m($n, { children: n == null ? void 0 : n.map((a) => {
2629
+ var c, u;
2630
+ if (a.type === "question" && ((c = a.attributes) == null ? void 0 : c.attributes.case) === "question") {
2631
+ const g = a.attributes.attributes.value;
2632
+ return /* @__PURE__ */ m(Bn, { openQuestion: i, ...g }, g.questionId);
2633
+ }
2634
+ if (a.type === "insight" && ((u = a.attributes) == null ? void 0 : u.attributes.case) === "insight") {
2635
+ const g = a.attributes.attributes.value;
2636
+ return /* @__PURE__ */ m(Fn, { openInsight: i, ...g }, g.questionId);
2637
+ }
2638
+ return null;
2639
+ }) }), Pn = ({ store: n, openQuestion: i }) => {
2640
+ const a = ie(n);
2641
+ return a != null && a.data ? /* @__PURE__ */ m(Qn, { openQuestion: i, questions: a.data }) : /* @__PURE__ */ m("div", { children: "wait questions..." });
2642
+ }, qn = ({ userSummary: n }) => {
2643
+ var i;
2644
+ const a = ie(n.getStore());
2645
+ return (i = a.data) != null && i.summary ? /* @__PURE__ */ m(zt, { ...a.data.summary, ...a.data.percentage }) : /* @__PURE__ */ m("div", { children: "wait user..." });
2646
+ }, Yn = ({ gamification: n }) => {
2647
+ const [i, a] = Ie(ye.HOME);
2648
+ return /* @__PURE__ */ S("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
2649
+ /* @__PURE__ */ S(Tt, { children: [
2650
+ /* @__PURE__ */ m(bi, { activePage: i, toggleActivePage: a }),
2651
+ i === ye.HOME && /* @__PURE__ */ m(qn, { userSummary: n.userSummary })
2652
+ ] }),
2653
+ i === ye.HOME && /* @__PURE__ */ m(nt, { children: /* @__PURE__ */ m(Pn, { openQuestion: n.openQuestion, store: n.feedList.getStore() }) }),
2654
+ i === ye.LEADERBOARD && /* @__PURE__ */ m(nt, { style: { flex: "1 1 auto", paddingTop: 0, paddingBottom: 0 }, children: /* @__PURE__ */ m(xn, { openUser: n.openUser, leaderboardList: n.leaderboardList }) })
2655
+ ] });
2656
+ };
2657
+ const Wn = () => Yt, wt = /* @__PURE__ */ y(Wn())({
2658
+ name: "m",
2659
+ class: "m1ph66cs",
2660
+ propsAsIs: !0
2661
+ }), Vn = /* @__PURE__ */ y("div")({
2662
+ name: "x",
2663
+ class: "xorme7i",
2664
+ propsAsIs: !1
2665
+ }), ls = ({
2666
+ gamification: n,
2667
+ className: i
2668
+ }) => {
2669
+ const a = ie(n.openedQuestion.$store), c = ie(n.openedUser);
2670
+ return /* @__PURE__ */ S(Se, {
2671
+ children: [a && /* @__PURE__ */ m(wt, {
2672
+ className: i,
2673
+ children: /* @__PURE__ */ m(vi, {
2674
+ gamification: n
2675
+ })
2676
+ }), c && /* @__PURE__ */ m(wt, {
2677
+ className: i,
2678
+ children: /* @__PURE__ */ S(Vn, {
2679
+ children: [/* @__PURE__ */ m(St, {
2680
+ label: "Friend's Rank",
2681
+ close: n.closeUser
2682
+ }), /* @__PURE__ */ m(Tt, {
2683
+ children: /* @__PURE__ */ m(zt, {
2684
+ ...c
2685
+ })
2686
+ })]
2687
+ })
2688
+ }), /* @__PURE__ */ m(At, {
2689
+ className: i,
2690
+ "data-nav": "true",
2691
+ children: /* @__PURE__ */ m(Yn, {
2692
+ gamification: n
2693
+ })
2694
+ })]
2695
+ });
2696
+ };
2697
+ export {
2698
+ ls as GamificationOverlay,
2699
+ ls as default
2700
+ };