fansunited-frontend-components 0.0.89 → 0.0.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Betslip.js +1 -1
- package/ChanceGame.js +10 -10
- package/ClassicQuizPlay.js +1 -1
- package/CollectLead.js +7 -7
- package/CompetitionStatistics.js +5 -5
- package/CompetitorCard.js +10 -10
- package/Discussion.js +1 -1
- package/EitherOrPlay.js +1 -1
- package/EventCard.js +17 -17
- package/EventGamePlay.js +1 -1
- package/Leaderboard.js +251 -251
- package/List.js +15 -15
- package/MatchQuizPlay.js +1 -1
- package/Odds.js +3 -3
- package/PersonalityQuizPlay.js +1 -1
- package/PickThePair.js +11 -11
- package/PlayerOfTheMatch.js +22 -22
- package/PollVote.js +1 -1
- package/Predictor.js +1 -1
- package/Standings.js +10 -10
- package/TopX.js +402 -400
- package/chunks/{AccessTime-C0zbWECY.js → AccessTime-BVP1qnmC.js} +1 -1
- package/chunks/{AlertMessage-CieUTNsw.js → AlertMessage-aNev3ob9.js} +6 -6
- package/chunks/{Avatar-5aOX2Vb1.js → Avatar-Ck9sDlUF.js} +3 -3
- package/chunks/{Button-3riWYmL7.js → Button-C5sVDXUr.js} +4 -4
- package/chunks/{Card-ByCnCChk.js → Card-DMO0MtFg.js} +3 -3
- package/chunks/{CardActions-b3pAJZRO.js → CardActions-CniskUBs.js} +6 -6
- package/chunks/{CardContent-CnyZ1WVy.js → CardContent-DSmkIh5e.js} +2 -2
- package/chunks/{ChanceGameEmbedVariant-cWHucFuB.js → ChanceGameEmbedVariant-C9U7q27r.js} +10 -10
- package/chunks/{CheckCircle-WUucf55H.js → CheckCircle-BLQUgEFO.js} +1 -1
- package/chunks/{Chip-BILKBLRO.js → Chip-CbmpDsTx.js} +4 -4
- package/chunks/{CircularProgress-Dfx_fE8L.js → CircularProgress-BCucLg2A.js} +2 -2
- package/chunks/{Close-C-YXDM7Y.js → Close-BJaeWPmO.js} +1 -1
- package/chunks/{Close-D1Qu6Zr7.js → Close-Bn_Gk4s2.js} +1 -1
- package/chunks/{CollectLeadForm-BfrhOCqn.js → CollectLeadForm-e59gRdao.js} +21 -21
- package/chunks/{ConsentsList-DkWpnlLW.js → ConsentsList-ByAN0_kp.js} +6 -6
- package/chunks/{DirectionScope-eDYFWvxN.js → DirectionScope-Ty03Pl0K.js} +1 -1
- package/chunks/{Divider-pZCe2d20.js → Divider-D-SATYZX.js} +3 -3
- package/chunks/{Edit-NHQMon6F.js → Edit-uzcXQ0W4.js} +4 -4
- package/chunks/{EmojiEvents-DXh-xemn.js → EmojiEvents-DzZMpyj0.js} +1 -1
- package/chunks/{FavoriteBorder-CQrHuIk5.js → FavoriteBorder-Dz8YRmah.js} +1 -1
- package/chunks/{FormControl-DttxxDyJ.js → FormControl-CApGuvy1.js} +4 -4
- package/chunks/{FormLabel-D3_mG4D1.js → FormLabel-BhUVGv0u.js} +3 -3
- package/chunks/{GlobalStyles-CafmeGDq.js → GlobalStyles-BiXuRSRs.js} +1 -1
- package/chunks/{InlineSpinner-DkC1XUc7.js → InlineSpinner-BIQuuKyA.js} +2 -2
- package/chunks/{Input-ksZwfsfA.js → Input-C1c9bTgf.js} +4 -4
- package/chunks/{KeyboardArrowDown-Ctf2n_n8.js → KeyboardArrowDown-BBL6SAyg.js} +1 -1
- package/chunks/{KeyboardArrowRight-CfETLrEt.js → KeyboardArrowRight-DQMFvDqL.js} +1 -1
- package/chunks/{Link-CjxMesIg.js → Link-IhyfKeZX.js} +3 -3
- package/chunks/{ListItemButton-O4Zqw3zP.js → ListItemButton-C6H1ykg-.js} +4 -4
- package/chunks/{ModalClose-Btz9Kn0q.js → ModalClose-COLCM3hQ.js} +6 -6
- package/chunks/{ModalDialog-BF_s4rug.js → ModalDialog-19Yt0pTv.js} +6 -6
- package/chunks/{NotFoundSkeleton-D2Yx2gZV.js → NotFoundSkeleton-B7aXpJX0.js} +2 -2
- package/chunks/{Notification-rNcLeEkz.js → Notification-DPPIzFpw.js} +7 -7
- package/chunks/{OddsSkeleton-C6M4oCTF.js → OddsSkeleton-BdKCmc4R.js} +3 -3
- package/chunks/{OddsStrip-XQfQiBhM.js → OddsStrip-c9Y8VgmW.js} +4 -4
- package/chunks/{OverlayScoreStateSkeleton-w9-f7MPj.js → OverlayScoreStateSkeleton-CGiMhlGz.js} +4 -4
- package/chunks/{OverlayScoreStateWrapperSkeleton-B9O-4AU_.js → OverlayScoreStateWrapperSkeleton-mzBPgf_P.js} +1 -1
- package/chunks/{OverlaySignInSkeleton-Clq-LJjf.js → OverlaySignInSkeleton-DnxRxCfU.js} +4 -4
- package/chunks/{OverlaySkeleton-yDtGLLaG.js → OverlaySkeleton-bXtFE1Y6.js} +9 -9
- package/chunks/{Person-DWyYenEx.js → Person-CuxlprBB.js} +1 -1
- package/chunks/{PersonOutline-DJJGMjkg.js → PersonOutline-BViWQgNV.js} +1 -1
- package/chunks/{PickOneOfX-BZ-IEEEH.js → PickOneOfX-DbBYeZnU.js} +3 -3
- package/chunks/{Popper-Wp7BQGU_.js → Popper-B-W5OzQt.js} +3 -3
- package/chunks/{Portal-Dw20M2LG.js → Portal-C1ku1V2Y.js} +2 -2
- package/chunks/{Portal-Beqgjlza.js → Portal-C49jCyHC.js} +1 -1
- package/chunks/{Predictor-BbQ-o3tU.js → Predictor-DGjo_dOB.js} +3643 -3294
- package/chunks/{PrizeCard-Cb1YuuYM.js → PrizeCard-BIJVHmYW.js} +240 -192
- package/chunks/{Search-BOtjWnG5.js → Search-RBBj-3Z1.js} +1 -1
- package/chunks/{Select-DXJCZ6D3.js → Select-Be-2TLJx.js} +7 -7
- package/chunks/{Sheet-MP2rgW4b.js → Sheet-DHMJRANx.js} +3 -3
- package/chunks/{SignInCta-DWtXHD9B.js → SignInCta-Bz6nl2c-.js} +3 -3
- package/chunks/{Spinner-pC2OM4AI.js → Spinner-DQytYdCL.js} +2 -2
- package/chunks/{SportsSoccer-C3JxFjui.js → SportsSoccer-Dwp9CkcQ.js} +1 -1
- package/chunks/{Stack-CU4pq5Q5.js → Stack-Dx-77BoB.js} +2 -2
- package/chunks/{StandardContentSkeleton-Qg1eXOB-.js → StandardContentSkeleton-DV_CkaNl.js} +1 -1
- package/chunks/{Table-hk72eRqw.js → Table-D3ou_zxz.js} +2 -2
- package/chunks/{Tabs-DiWLN-D7.js → Tabs-D32XKc8G.js} +5 -5
- package/chunks/{Textarea-BhxhPabe.js → Textarea-HrQcjIXY.js} +3 -3
- package/chunks/{TimerOutlined-CRwZ7isE.js → TimerOutlined-mHIHDBDv.js} +1 -1
- package/chunks/{Tooltip-D3L0qTul.js → Tooltip-iozKqko2.js} +5 -5
- package/chunks/{Typography-nBRgZwsp.js → Typography-CHHyHOvn.js} +1 -1
- package/chunks/{colorInversionUtils-BhmtNPM2.js → colorInversionUtils-CJrDu9ZF.js} +1 -1
- package/chunks/{createSvgIcon-C8SzTn0h.js → createSvgIcon-D7NSIoD-.js} +1 -1
- package/chunks/{createSvgIcon-y3WkUldr.js → createSvgIcon-DVhK14Wp.js} +2 -2
- package/chunks/{dividerClasses-B-2pg9aw.js → dividerClasses-CpWiK9X3.js} +1 -1
- package/chunks/{elementAcceptingRef-Bdcp531Z.js → elementAcceptingRef-B8Ay5UA0.js} +1 -1
- package/chunks/{formLabelClasses-CECx8x_t.js → formLabelClasses-Bb77PWNt.js} +1 -1
- package/chunks/{helpers-BX3cctTx.js → helpers-BjZ558HQ.js} +1 -1
- package/chunks/index-BKdbemPX.js +4 -0
- package/chunks/index-BL8osWuT.js +4 -0
- package/chunks/index-BXktLXqU.js +4 -0
- package/chunks/index-BoKBAjSl.js +4 -0
- package/chunks/index-DhEpZQT8.js +4 -0
- package/chunks/{index-DP3Xa63T.js → index-DzjRMnaE.js} +1 -1
- package/chunks/index-WsrzdqEQ.js +4 -0
- package/chunks/index-ibZpQ0KD.js +4 -0
- package/chunks/{main-DKeA0imc.js → main-BV-r09In.js} +22 -22
- package/chunks/{main-Cj_sNGwd.js → main-BgDvdmc8.js} +30 -30
- package/chunks/{main-DVStQO7c.js → main-CA5G2ZQX.js} +28 -28
- package/chunks/{main-B7xsd2jd.js → main-DSQ1vaFe.js} +34 -34
- package/chunks/{main-DZzxaZiR.js → main-D_Rq1xVm.js} +25 -25
- package/chunks/{main-Dh0w2gH9.js → main-DcPlB4Wk.js} +19 -19
- package/chunks/{main-BG-hwFMf.js → main-Ig2neK0P.js} +18 -18
- package/chunks/{main-CqifYDEd.js → main-bAzdlcP_.js} +3 -3
- package/chunks/{useButton-CbtwvfQQ.js → useButton-BdGcfaoz.js} +3 -3
- package/chunks/{useConsents-DdPK793X.js → useConsents-6ZATswQ4.js} +12 -12
- package/chunks/{useEventCallback-KK900PzE.js → useEventCallback-D-FE-RIP.js} +1 -1
- package/chunks/{useForwardedInput-Emz99PzK.js → useForwardedInput-DFaOgtZp.js} +2 -2
- package/chunks/{useImageVariant-DPC_XqjI.js → useImageVariant-B_dj28Qx.js} +1 -1
- package/chunks/{useParticipationDraft-DEWbYjqA.js → useParticipationDraft-BO1gUTVy.js} +6 -6
- package/chunks/{useSwitch-ZW00ibaC.js → useSwitch-DeOFp4Ck.js} +3 -3
- package/index.js +4 -4
- package/package.json +2 -2
- package/chunks/index-2ImPs9d7.js +0 -4
- package/chunks/index-CitKdUxn.js +0 -4
- package/chunks/index-CyKc-9u8.js +0 -4
- package/chunks/index-D7bJ5A4g.js +0 -4
- package/chunks/index-DWXxfmN5.js +0 -4
- package/chunks/index-DcTq5zsy.js +0 -4
- package/chunks/index-Ddsiaelf.js +0 -4
package/Leaderboard.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import { jsxs as E, jsx as l, Fragment as ce } from "react/jsx-runtime";
|
|
2
2
|
import z, { useState as B, useEffect as Q, useCallback as me, useMemo as D } from "react";
|
|
3
|
-
import { a as X, b as fe, v as he, x as ge, g as G, f as de, u as O, d as j, B as
|
|
3
|
+
import { a as X, b as fe, v as he, x as ge, g as G, f as de, u as O, d as j, B as I, c as ue, m as be, p as ye, o as xe, q as Ce, r as ve, C as Te, s as Pe, E as Se, t as we, w as Ee } from "./chunks/PrizeCard-BIJVHmYW.js";
|
|
4
4
|
import { createPortal as Ae } from "react-dom";
|
|
5
|
-
import { A as J } from "./chunks/AlertMessage-
|
|
6
|
-
import { F as
|
|
7
|
-
import { T as
|
|
8
|
-
import { S as
|
|
9
|
-
import { P as ee } from "./chunks/Person-
|
|
10
|
-
import { h as U, a as Me } from "./chunks/helpers-
|
|
11
|
-
import { S as ze } from "./chunks/Spinner-
|
|
12
|
-
import { S as Be } from "./chunks/Sheet-
|
|
13
|
-
import { T as Fe } from "./chunks/Table-
|
|
14
|
-
import { A as te } from "./chunks/Avatar-
|
|
15
|
-
import { D as H } from "./chunks/DirectionScope-
|
|
16
|
-
import { I as k, B as re } from "./chunks/Button-
|
|
5
|
+
import { A as J } from "./chunks/AlertMessage-aNev3ob9.js";
|
|
6
|
+
import { F as Re } from "./chunks/FormLabel-BhUVGv0u.js";
|
|
7
|
+
import { T as L } from "./chunks/Typography-CHHyHOvn.js";
|
|
8
|
+
import { S as Le, a as Ie } from "./chunks/Select-Be-2TLJx.js";
|
|
9
|
+
import { P as ee } from "./chunks/Person-CuxlprBB.js";
|
|
10
|
+
import { h as U, a as Me } from "./chunks/helpers-BjZ558HQ.js";
|
|
11
|
+
import { S as ze } from "./chunks/Spinner-DQytYdCL.js";
|
|
12
|
+
import { S as Be } from "./chunks/Sheet-DHMJRANx.js";
|
|
13
|
+
import { T as Fe } from "./chunks/Table-D3ou_zxz.js";
|
|
14
|
+
import { A as te } from "./chunks/Avatar-Ck9sDlUF.js";
|
|
15
|
+
import { D as H } from "./chunks/DirectionScope-Ty03Pl0K.js";
|
|
16
|
+
import { I as k, B as re } from "./chunks/Button-C5sVDXUr.js";
|
|
17
17
|
import { C as Ue, a as $e } from "./chunks/chevrons-right-CXSpQt9w.js";
|
|
18
18
|
import { C as Qe } from "./chunks/chevron-left-CxfCSZcr.js";
|
|
19
19
|
import { C as He } from "./chunks/chevron-right-BEQMacFn.js";
|
|
20
20
|
const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()).join(" "), _e = ({
|
|
21
21
|
options: e,
|
|
22
22
|
selectedId: t,
|
|
23
|
-
onChange:
|
|
23
|
+
onChange: o
|
|
24
24
|
}) => {
|
|
25
|
-
const { t: r } = X(), { shadowRootElement:
|
|
25
|
+
const { t: r } = X(), { shadowRootElement: a } = fe(he), h = ge(), v = G(), y = de(), d = O().primary, c = j(), C = v.textColor, p = {
|
|
26
26
|
background: {
|
|
27
|
-
surface:
|
|
28
|
-
popup:
|
|
27
|
+
surface: h.colorSchemes.light.palette.background.surface,
|
|
28
|
+
popup: h.colorSchemes.light.palette.background.popup
|
|
29
29
|
},
|
|
30
30
|
neutral: {
|
|
31
|
-
outlinedBorder:
|
|
32
|
-
outlinedColor:
|
|
33
|
-
outlinedHoverBg:
|
|
34
|
-
plainActiveBg:
|
|
35
|
-
plainHoverBg:
|
|
36
|
-
plainHoverColor:
|
|
31
|
+
outlinedBorder: h.colorSchemes.light.palette.neutral.outlinedBorder,
|
|
32
|
+
outlinedColor: h.colorSchemes.light.palette.neutral.outlinedColor,
|
|
33
|
+
outlinedHoverBg: h.colorSchemes.light.palette.neutral.outlinedHoverBg,
|
|
34
|
+
plainActiveBg: h.colorSchemes.light.palette.neutral.plainActiveBg,
|
|
35
|
+
plainHoverBg: h.colorSchemes.light.palette.neutral.plainHoverBg,
|
|
36
|
+
plainHoverColor: h.colorSchemes.light.palette.neutral.plainHoverColor
|
|
37
37
|
}
|
|
38
38
|
}, x = {
|
|
39
39
|
flexShrink: 0,
|
|
40
|
-
fontFamily:
|
|
40
|
+
fontFamily: d,
|
|
41
41
|
fontSize: "0.65em",
|
|
42
42
|
fontWeight: 600,
|
|
43
43
|
letterSpacing: "0.05em",
|
|
@@ -45,11 +45,11 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
45
45
|
color: p.neutral.outlinedColor,
|
|
46
46
|
bgcolor: p.neutral.plainHoverBg,
|
|
47
47
|
border: `1px solid ${p.neutral.outlinedBorder}`,
|
|
48
|
-
borderRadius:
|
|
48
|
+
borderRadius: y.sm,
|
|
49
49
|
px: c["2xs"],
|
|
50
50
|
py: c["3xs"]
|
|
51
51
|
}, A = (g) => /* @__PURE__ */ E(
|
|
52
|
-
|
|
52
|
+
I,
|
|
53
53
|
{
|
|
54
54
|
sx: {
|
|
55
55
|
display: "flex",
|
|
@@ -60,14 +60,14 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
60
60
|
},
|
|
61
61
|
children: [
|
|
62
62
|
/* @__PURE__ */ l("span", { children: g.label }),
|
|
63
|
-
g.type && /* @__PURE__ */ l(
|
|
63
|
+
g.type && /* @__PURE__ */ l(I, { sx: x, children: ke(g.type) })
|
|
64
64
|
]
|
|
65
65
|
}
|
|
66
66
|
), P = {
|
|
67
67
|
root: {
|
|
68
68
|
sx: {
|
|
69
|
-
fontFamily:
|
|
70
|
-
borderRadius:
|
|
69
|
+
fontFamily: d,
|
|
70
|
+
borderRadius: y.sm,
|
|
71
71
|
bgcolor: p.background.surface,
|
|
72
72
|
borderColor: p.neutral.outlinedBorder,
|
|
73
73
|
color: p.neutral.outlinedColor,
|
|
@@ -76,17 +76,17 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
listbox: {
|
|
79
|
-
container:
|
|
79
|
+
container: a,
|
|
80
80
|
sx: {
|
|
81
81
|
zIndex: 10,
|
|
82
82
|
bgcolor: p.background.popup,
|
|
83
83
|
border: `1px solid ${p.neutral.outlinedBorder}`,
|
|
84
|
-
borderRadius:
|
|
84
|
+
borderRadius: y.sm,
|
|
85
85
|
boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1)"
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
}, u = {
|
|
89
|
-
fontFamily:
|
|
89
|
+
fontFamily: d,
|
|
90
90
|
color: `${p.neutral.outlinedColor} !important`,
|
|
91
91
|
bgcolor: "transparent",
|
|
92
92
|
"&:hover": {
|
|
@@ -102,20 +102,20 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
102
102
|
color: `${p.neutral.outlinedColor} !important`
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
|
-
return /* @__PURE__ */ E(
|
|
105
|
+
return /* @__PURE__ */ E(I, { sx: { display: "flex", flexDirection: "column", gap: c["2xs"] }, children: [
|
|
106
106
|
/* @__PURE__ */ l(
|
|
107
|
-
|
|
107
|
+
Re,
|
|
108
108
|
{
|
|
109
109
|
sx: {
|
|
110
110
|
color: `${C} !important`,
|
|
111
|
-
fontFamily:
|
|
111
|
+
fontFamily: d,
|
|
112
112
|
fontSize: "0.875em"
|
|
113
113
|
},
|
|
114
114
|
children: /* @__PURE__ */ l(
|
|
115
|
-
|
|
115
|
+
L,
|
|
116
116
|
{
|
|
117
117
|
sx: {
|
|
118
|
-
fontFamily:
|
|
118
|
+
fontFamily: d,
|
|
119
119
|
fontSize: "0.875em",
|
|
120
120
|
color: C
|
|
121
121
|
},
|
|
@@ -125,31 +125,31 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
125
125
|
}
|
|
126
126
|
),
|
|
127
127
|
/* @__PURE__ */ l(
|
|
128
|
-
|
|
128
|
+
Le,
|
|
129
129
|
{
|
|
130
130
|
value: t,
|
|
131
|
-
onChange: (g, S) => S &&
|
|
131
|
+
onChange: (g, S) => S && o(S),
|
|
132
132
|
slotProps: P,
|
|
133
133
|
renderValue: (g) => {
|
|
134
134
|
if (!g) return null;
|
|
135
|
-
const S = e.find((
|
|
135
|
+
const S = e.find((m) => m.id === g.value);
|
|
136
136
|
return S ? A(S) : g.label;
|
|
137
137
|
},
|
|
138
|
-
children: e.map((g) => /* @__PURE__ */ l(
|
|
138
|
+
children: e.map((g) => /* @__PURE__ */ l(Ie, { value: g.id, sx: u, children: A(g) }, g.id))
|
|
139
139
|
}
|
|
140
140
|
)
|
|
141
141
|
] });
|
|
142
142
|
}, De = ({
|
|
143
143
|
leaderboard: e,
|
|
144
144
|
userRank: t,
|
|
145
|
-
showHeading:
|
|
145
|
+
showHeading: o,
|
|
146
146
|
title: r,
|
|
147
|
-
description:
|
|
148
|
-
isSplitVariant:
|
|
147
|
+
description: a,
|
|
148
|
+
isSplitVariant: h,
|
|
149
149
|
brandingColors: v,
|
|
150
|
-
rankStyles:
|
|
150
|
+
rankStyles: y
|
|
151
151
|
}) => {
|
|
152
|
-
const { t:
|
|
152
|
+
const { t: d } = X(), c = ue(), C = G(), p = (v == null ? void 0 : v.primaryColor) || C.palette.primary.plainColor, x = (v == null ? void 0 : v.contentColor) || C.textColor, A = C.textColor, P = O().primary, u = O().secondary, g = de(), S = j(), m = be(), i = C.surfaceVariant, n = c.colorSchemes.light.palette.primary.onPrimary, f = C.outlineEnabledBorder, s = {
|
|
153
153
|
leaderboardContainer: {
|
|
154
154
|
display: "flex",
|
|
155
155
|
flexDirection: "column",
|
|
@@ -167,7 +167,7 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
167
167
|
tableContainer: {
|
|
168
168
|
overflowX: "auto",
|
|
169
169
|
borderRadius: g.md,
|
|
170
|
-
border: `1px solid ${
|
|
170
|
+
border: `1px solid ${f}`
|
|
171
171
|
},
|
|
172
172
|
table: {
|
|
173
173
|
backgroundColor: i,
|
|
@@ -184,7 +184,7 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
184
184
|
fontWeight: 600,
|
|
185
185
|
fontSize: "0.875em",
|
|
186
186
|
textAlign: "center",
|
|
187
|
-
borderBottom: `1px solid ${
|
|
187
|
+
borderBottom: `1px solid ${f}`
|
|
188
188
|
}
|
|
189
189
|
},
|
|
190
190
|
headerCellPosition: {
|
|
@@ -283,11 +283,11 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
283
283
|
if (!e)
|
|
284
284
|
return /* @__PURE__ */ l(ze, { my: 10 });
|
|
285
285
|
if (e.length === 0)
|
|
286
|
-
return /* @__PURE__ */ l(
|
|
287
|
-
const T = t, w = T == null ? void 0 : T.profileId, F = w && e.some((
|
|
288
|
-
return /* @__PURE__ */ E(
|
|
289
|
-
|
|
290
|
-
|
|
286
|
+
return /* @__PURE__ */ l(L, { level: "body-lg", sx: s.noLeaderboardText, children: d("leaderboard.noLeaderboardAvailable") });
|
|
287
|
+
const T = t, w = T == null ? void 0 : T.profileId, F = w && e.some((b) => b.profileId === w);
|
|
288
|
+
return /* @__PURE__ */ E(I, { sx: s.leaderboardContainer, children: [
|
|
289
|
+
o && /* @__PURE__ */ E(
|
|
290
|
+
I,
|
|
291
291
|
{
|
|
292
292
|
sx: {
|
|
293
293
|
display: "flex",
|
|
@@ -297,7 +297,7 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
297
297
|
},
|
|
298
298
|
children: [
|
|
299
299
|
/* @__PURE__ */ l(
|
|
300
|
-
|
|
300
|
+
L,
|
|
301
301
|
{
|
|
302
302
|
level: "body-sm",
|
|
303
303
|
sx: {
|
|
@@ -310,11 +310,11 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
310
310
|
opacity: "60%",
|
|
311
311
|
fontFamily: u
|
|
312
312
|
},
|
|
313
|
-
children:
|
|
313
|
+
children: d("leaderboard.heading")
|
|
314
314
|
}
|
|
315
315
|
),
|
|
316
316
|
/* @__PURE__ */ E(
|
|
317
|
-
|
|
317
|
+
I,
|
|
318
318
|
{
|
|
319
319
|
sx: {
|
|
320
320
|
display: "flex",
|
|
@@ -322,9 +322,9 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
322
322
|
gap: S["3xs"]
|
|
323
323
|
},
|
|
324
324
|
children: [
|
|
325
|
-
r && /* @__PURE__ */ l(
|
|
326
|
-
|
|
327
|
-
|
|
325
|
+
r && /* @__PURE__ */ l(L, { level: "h4", sx: s.leaderboardTitle, children: r }),
|
|
326
|
+
a && /* @__PURE__ */ l(
|
|
327
|
+
L,
|
|
328
328
|
{
|
|
329
329
|
sx: {
|
|
330
330
|
fontWeight: 400,
|
|
@@ -335,7 +335,7 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
335
335
|
opacity: "60%",
|
|
336
336
|
fontFamily: P
|
|
337
337
|
},
|
|
338
|
-
children: Me(
|
|
338
|
+
children: Me(a)
|
|
339
339
|
}
|
|
340
340
|
)
|
|
341
341
|
]
|
|
@@ -354,43 +354,43 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
354
354
|
sx: s.table,
|
|
355
355
|
children: [
|
|
356
356
|
/* @__PURE__ */ l("thead", { children: /* @__PURE__ */ E("tr", { children: [
|
|
357
|
-
/* @__PURE__ */ l("th", { style: s.headerCellPosition, children:
|
|
358
|
-
/* @__PURE__ */ l("th", { style: s.headerCellName, children:
|
|
359
|
-
/* @__PURE__ */ l("th", { style: s.headerCellPoints, children:
|
|
357
|
+
/* @__PURE__ */ l("th", { style: s.headerCellPosition, children: m || h ? "" : d("leaderboard.position") }),
|
|
358
|
+
/* @__PURE__ */ l("th", { style: s.headerCellName, children: d("leaderboard.name") }),
|
|
359
|
+
/* @__PURE__ */ l("th", { style: s.headerCellPoints, children: m || h ? "🎯" : d("leaderboard.points") })
|
|
360
360
|
] }) }),
|
|
361
361
|
/* @__PURE__ */ E("tbody", { children: [
|
|
362
362
|
T && !F && /* @__PURE__ */ E("tr", { style: s.userRow, children: [
|
|
363
|
-
/* @__PURE__ */ l("td", { style: s.tableCellPosition, children: /* @__PURE__ */ E(
|
|
363
|
+
/* @__PURE__ */ l("td", { style: s.tableCellPosition, children: /* @__PURE__ */ E(L, { sx: s.positionText, children: [
|
|
364
364
|
"#",
|
|
365
365
|
T.position
|
|
366
366
|
] }) }),
|
|
367
|
-
/* @__PURE__ */ l("td", { style: s.tableCellName, children: /* @__PURE__ */ E(
|
|
367
|
+
/* @__PURE__ */ l("td", { style: s.tableCellName, children: /* @__PURE__ */ E(I, { sx: s.nameCell, children: [
|
|
368
368
|
/* @__PURE__ */ l(te, { sx: s.leaderboardAvatar, children: /* @__PURE__ */ l(ee, { sx: s.avatarIcon }) }),
|
|
369
|
-
/* @__PURE__ */ l(
|
|
369
|
+
/* @__PURE__ */ l(L, { sx: s.nameText, children: d("leaderboard.you") })
|
|
370
370
|
] }) }),
|
|
371
|
-
/* @__PURE__ */ l("td", { style: s.tableCellPoints, children: /* @__PURE__ */ l(
|
|
371
|
+
/* @__PURE__ */ l("td", { style: s.tableCellPoints, children: /* @__PURE__ */ l(L, { sx: s.pointsText, children: T.points }) })
|
|
372
372
|
] }),
|
|
373
|
-
e.map((
|
|
373
|
+
e.map((b, R) => {
|
|
374
374
|
var V, Y, q, K;
|
|
375
|
-
const M = w ===
|
|
375
|
+
const M = w === b.profileId, pe = M ? s.userRow : y == null ? void 0 : y[R + 1];
|
|
376
376
|
return /* @__PURE__ */ E("tr", { style: pe, children: [
|
|
377
|
-
/* @__PURE__ */ l("td", { style: s.tableCellPosition, children: /* @__PURE__ */ E(
|
|
377
|
+
/* @__PURE__ */ l("td", { style: s.tableCellPosition, children: /* @__PURE__ */ E(L, { sx: s.positionText, children: [
|
|
378
378
|
"#",
|
|
379
|
-
|
|
379
|
+
b.position
|
|
380
380
|
] }) }),
|
|
381
|
-
/* @__PURE__ */ l("td", { style: s.tableCellName, children: /* @__PURE__ */ E(
|
|
381
|
+
/* @__PURE__ */ l("td", { style: s.tableCellName, children: /* @__PURE__ */ E(I, { sx: s.nameCell, children: [
|
|
382
382
|
/* @__PURE__ */ l(
|
|
383
383
|
te,
|
|
384
384
|
{
|
|
385
|
-
src: ((V =
|
|
385
|
+
src: ((V = b.profileModel) == null ? void 0 : V.avatar) || void 0,
|
|
386
386
|
sx: s.leaderboardAvatar,
|
|
387
|
-
children: (Y =
|
|
387
|
+
children: (Y = b.profileModel) != null && Y.avatar ? /* @__PURE__ */ l(ce, {}) : /* @__PURE__ */ l(ee, { sx: s.avatarIcon })
|
|
388
388
|
}
|
|
389
389
|
),
|
|
390
|
-
/* @__PURE__ */ l(
|
|
390
|
+
/* @__PURE__ */ l(L, { sx: s.nameText, children: M ? d("leaderboard.you") : ((q = b.profileModel) == null ? void 0 : q.nickname) || ((K = b.profileModel) == null ? void 0 : K.name) || d("leaderboard.anonymous") })
|
|
391
391
|
] }) }),
|
|
392
|
-
/* @__PURE__ */ l("td", { style: s.tableCellPoints, children: /* @__PURE__ */ l(
|
|
393
|
-
] },
|
|
392
|
+
/* @__PURE__ */ l("td", { style: s.tableCellPoints, children: /* @__PURE__ */ l(L, { sx: s.pointsText, children: b.points }) })
|
|
393
|
+
] }, b.profileId);
|
|
394
394
|
})
|
|
395
395
|
] })
|
|
396
396
|
]
|
|
@@ -400,35 +400,35 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
400
400
|
}, Oe = ({
|
|
401
401
|
count: e = 10,
|
|
402
402
|
page: t = 1,
|
|
403
|
-
onChange:
|
|
403
|
+
onChange: o,
|
|
404
404
|
siblingCount: r = 1,
|
|
405
|
-
boundaryCount:
|
|
406
|
-
showFirstButton:
|
|
405
|
+
boundaryCount: a = 1,
|
|
406
|
+
showFirstButton: h = !0,
|
|
407
407
|
showLastButton: v = !0,
|
|
408
|
-
size:
|
|
409
|
-
disabled:
|
|
408
|
+
size: y = "md",
|
|
409
|
+
disabled: d = !1,
|
|
410
410
|
isOverlayVariant: c = !1
|
|
411
411
|
}) => {
|
|
412
412
|
const C = ue(), p = (i) => {
|
|
413
|
-
|
|
413
|
+
o && i >= 1 && i <= e && o(i);
|
|
414
414
|
}, x = (i, n) => {
|
|
415
|
-
const
|
|
416
|
-
for (let s = i; s <= n; s++)
|
|
417
|
-
return
|
|
415
|
+
const f = [];
|
|
416
|
+
for (let s = i; s <= n; s++) f.push(s);
|
|
417
|
+
return f;
|
|
418
418
|
}, P = (() => {
|
|
419
419
|
if (e <= 0) return [];
|
|
420
|
-
const i = x(1, Math.min(
|
|
421
|
-
Math.max(e -
|
|
420
|
+
const i = x(1, Math.min(a, e)), n = x(
|
|
421
|
+
Math.max(e - a + 1, a + 1),
|
|
422
422
|
e
|
|
423
|
-
),
|
|
424
|
-
if (
|
|
425
|
-
for (let w =
|
|
423
|
+
), f = Math.max(a + 1, t - r), s = Math.min(e - a, t + r), T = [...i];
|
|
424
|
+
if (f > a + 1 && T.push("ellipsis-start"), f <= s)
|
|
425
|
+
for (let w = f; w <= s; w++)
|
|
426
426
|
T.push(w);
|
|
427
|
-
s < e -
|
|
427
|
+
s < e - a && T.push("ellipsis-end");
|
|
428
428
|
for (const w of n)
|
|
429
429
|
T.includes(w) || T.push(w);
|
|
430
430
|
return T;
|
|
431
|
-
})(), u =
|
|
431
|
+
})(), u = y === "sm" ? "sm" : y === "lg" ? "lg" : "md", g = y === "sm" ? 16 : y === "lg" ? 24 : 20, S = (i = !1) => {
|
|
432
432
|
if (!c)
|
|
433
433
|
return {
|
|
434
434
|
borderRadius: "8px",
|
|
@@ -458,7 +458,7 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
458
458
|
opacity: 0.5
|
|
459
459
|
}
|
|
460
460
|
};
|
|
461
|
-
},
|
|
461
|
+
}, m = () => {
|
|
462
462
|
if (!c)
|
|
463
463
|
return {
|
|
464
464
|
borderRadius: "8px",
|
|
@@ -488,7 +488,7 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
488
488
|
};
|
|
489
489
|
};
|
|
490
490
|
return /* @__PURE__ */ E(
|
|
491
|
-
|
|
491
|
+
I,
|
|
492
492
|
{
|
|
493
493
|
sx: {
|
|
494
494
|
display: "flex",
|
|
@@ -497,15 +497,15 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
497
497
|
flexWrap: "wrap"
|
|
498
498
|
},
|
|
499
499
|
children: [
|
|
500
|
-
|
|
500
|
+
h && /* @__PURE__ */ l(
|
|
501
501
|
k,
|
|
502
502
|
{
|
|
503
503
|
size: u,
|
|
504
504
|
variant: "plain",
|
|
505
505
|
color: "neutral",
|
|
506
506
|
onClick: () => p(1),
|
|
507
|
-
disabled:
|
|
508
|
-
sx:
|
|
507
|
+
disabled: d || t === 1,
|
|
508
|
+
sx: m(),
|
|
509
509
|
children: /* @__PURE__ */ l(H, { children: /* @__PURE__ */ l(Ue, { size: g }) })
|
|
510
510
|
}
|
|
511
511
|
),
|
|
@@ -516,8 +516,8 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
516
516
|
variant: "plain",
|
|
517
517
|
color: "neutral",
|
|
518
518
|
onClick: () => p(t - 1),
|
|
519
|
-
disabled:
|
|
520
|
-
sx:
|
|
519
|
+
disabled: d || t === 1,
|
|
520
|
+
sx: m(),
|
|
521
521
|
children: /* @__PURE__ */ l(H, { children: /* @__PURE__ */ l(Qe, { size: g }) })
|
|
522
522
|
}
|
|
523
523
|
),
|
|
@@ -546,16 +546,16 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
546
546
|
},
|
|
547
547
|
`${i}-${n}`
|
|
548
548
|
);
|
|
549
|
-
const
|
|
549
|
+
const f = i === t;
|
|
550
550
|
return /* @__PURE__ */ l(
|
|
551
551
|
re,
|
|
552
552
|
{
|
|
553
553
|
size: u,
|
|
554
|
-
variant:
|
|
554
|
+
variant: f ? "solid" : "plain",
|
|
555
555
|
color: "neutral",
|
|
556
556
|
onClick: () => p(i),
|
|
557
|
-
disabled:
|
|
558
|
-
sx: S(
|
|
557
|
+
disabled: d,
|
|
558
|
+
sx: S(f),
|
|
559
559
|
children: i
|
|
560
560
|
},
|
|
561
561
|
i
|
|
@@ -568,8 +568,8 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
568
568
|
variant: "plain",
|
|
569
569
|
color: "neutral",
|
|
570
570
|
onClick: () => p(t + 1),
|
|
571
|
-
disabled:
|
|
572
|
-
sx:
|
|
571
|
+
disabled: d || t === e,
|
|
572
|
+
sx: m(),
|
|
573
573
|
children: /* @__PURE__ */ l(H, { children: /* @__PURE__ */ l(He, { size: g }) })
|
|
574
574
|
}
|
|
575
575
|
),
|
|
@@ -580,8 +580,8 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
580
580
|
variant: "plain",
|
|
581
581
|
color: "neutral",
|
|
582
582
|
onClick: () => p(e),
|
|
583
|
-
disabled:
|
|
584
|
-
sx:
|
|
583
|
+
disabled: d || t === e,
|
|
584
|
+
sx: m(),
|
|
585
585
|
children: /* @__PURE__ */ l(H, { children: /* @__PURE__ */ l($e, { size: g }) })
|
|
586
586
|
}
|
|
587
587
|
)
|
|
@@ -605,125 +605,125 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
605
605
|
return null;
|
|
606
606
|
}
|
|
607
607
|
}, oe = async (e, t) => e.length === 0 ? [] : (await t.topX.getGames({ gameIds: e })).data.map((r) => {
|
|
608
|
-
var
|
|
608
|
+
var a;
|
|
609
609
|
return {
|
|
610
610
|
id: r.id,
|
|
611
611
|
title: r.title,
|
|
612
612
|
description: r.description || null,
|
|
613
|
-
branding: ((
|
|
613
|
+
branding: ((a = r.branding) == null ? void 0 : a.colors) || null
|
|
614
614
|
};
|
|
615
615
|
}), ne = async (e, t) => e.length === 0 ? [] : (await t.matchQuiz.getGames({ gameIds: e })).data.map((r) => {
|
|
616
|
-
var
|
|
616
|
+
var a;
|
|
617
617
|
return {
|
|
618
618
|
id: r.id,
|
|
619
619
|
title: r.title,
|
|
620
620
|
description: r.description || null,
|
|
621
|
-
branding: ((
|
|
621
|
+
branding: ((a = r.branding) == null ? void 0 : a.colors) || null
|
|
622
622
|
};
|
|
623
623
|
}), ae = async (e, t) => e.length === 0 ? [] : (await t.loyalty.getTemplates()).data.filter((r) => e.includes(r.id)).map((r) => {
|
|
624
|
-
var
|
|
624
|
+
var a;
|
|
625
625
|
return {
|
|
626
626
|
id: r.id,
|
|
627
627
|
title: r.title || r.name,
|
|
628
628
|
description: r.description || null,
|
|
629
|
-
branding: ((
|
|
629
|
+
branding: ((a = r.branding) == null ? void 0 : a.colors) || null
|
|
630
630
|
};
|
|
631
631
|
}), le = async (e, t) => e.length === 0 ? [] : (await t.miniGames.getClassicQuizzes({
|
|
632
632
|
classicQuizIds: e,
|
|
633
633
|
limit: e.length
|
|
634
634
|
})).data.map((r) => {
|
|
635
|
-
var
|
|
635
|
+
var a;
|
|
636
636
|
return {
|
|
637
637
|
id: r.id,
|
|
638
638
|
title: r.title || r.name,
|
|
639
639
|
description: r.description || null,
|
|
640
|
-
branding: ((
|
|
640
|
+
branding: ((a = r.branding) == null ? void 0 : a.colors) || null
|
|
641
641
|
};
|
|
642
|
-
}), Xe = async (e, t,
|
|
643
|
-
const
|
|
642
|
+
}), Xe = async (e, t, o, r) => {
|
|
643
|
+
const a = await t.loyalty.getLeaderboardForGame(e, { page: o, limit: r });
|
|
644
644
|
return {
|
|
645
|
-
leaderboard: N(
|
|
646
|
-
pagination: Z(
|
|
645
|
+
leaderboard: N(a.data),
|
|
646
|
+
pagination: Z(a.meta.pagination)
|
|
647
647
|
};
|
|
648
|
-
}, Ge = async (e, t,
|
|
649
|
-
const
|
|
648
|
+
}, Ge = async (e, t, o, r) => {
|
|
649
|
+
const a = await t.loyalty.getLeaderboard(
|
|
650
650
|
e,
|
|
651
|
-
{ page:
|
|
651
|
+
{ page: o, limit: r }
|
|
652
652
|
);
|
|
653
653
|
return {
|
|
654
|
-
leaderboard: N(
|
|
655
|
-
pagination: Z(
|
|
654
|
+
leaderboard: N(a.data),
|
|
655
|
+
pagination: Z(a.meta.pagination)
|
|
656
656
|
};
|
|
657
|
-
}, W = async (e, t,
|
|
658
|
-
const
|
|
657
|
+
}, W = async (e, t, o, r) => {
|
|
658
|
+
const a = await t.miniGames.getLeaderboardForClassicQuizzes({
|
|
659
659
|
classicQuizIds: e,
|
|
660
|
-
page:
|
|
660
|
+
page: o,
|
|
661
661
|
limit: r
|
|
662
662
|
});
|
|
663
663
|
return {
|
|
664
|
-
leaderboard: N(
|
|
665
|
-
pagination: Z(
|
|
664
|
+
leaderboard: N(a.data),
|
|
665
|
+
pagination: Z(a.meta.pagination)
|
|
666
666
|
};
|
|
667
|
-
}, ie = (e, t,
|
|
668
|
-
const
|
|
669
|
-
return
|
|
670
|
-
}, je = async (e, t,
|
|
671
|
-
const
|
|
667
|
+
}, ie = (e, t, o, r) => {
|
|
668
|
+
const a = e.type.toUpperCase();
|
|
669
|
+
return a === "TOP_X" || a === "MATCH_QUIZ" ? Xe(e.id, t, o, r) : a === "TEMPLATE" ? Ge(e.id, t, o, r) : W([e.id], t, o, r);
|
|
670
|
+
}, je = async (e, t, o, r) => {
|
|
671
|
+
const h = o.toUpperCase() === "TEMPLATE" ? { rankType: "TEMPLATE", leaderboardIds: [e] } : { rankType: "GAME", gameType: o.toUpperCase(), leaderboardIds: [e] }, d = (await t.loyalty.getOwnRankings(h, !0)).data[0] ?? null;
|
|
672
672
|
return d ? {
|
|
673
673
|
position: d.position,
|
|
674
|
-
profileId:
|
|
675
|
-
profileModel:
|
|
674
|
+
profileId: r,
|
|
675
|
+
profileModel: null,
|
|
676
676
|
points: d.points
|
|
677
677
|
} : null;
|
|
678
|
-
}, Ze = async (e, t,
|
|
679
|
-
const
|
|
680
|
-
|
|
678
|
+
}, Ze = async (e, t, o) => {
|
|
679
|
+
const h = (await t.miniGames.getClassicQuizzesUserRanking(
|
|
680
|
+
o,
|
|
681
681
|
void 0,
|
|
682
682
|
!0
|
|
683
683
|
)).data.find((v) => v.classicQuizId === e) ?? null;
|
|
684
|
-
return
|
|
685
|
-
position:
|
|
686
|
-
profileId:
|
|
684
|
+
return h ? {
|
|
685
|
+
position: h.position,
|
|
686
|
+
profileId: o,
|
|
687
687
|
profileModel: null,
|
|
688
|
-
points:
|
|
688
|
+
points: h.points
|
|
689
689
|
} : null;
|
|
690
|
-
}, Ne = (e, t,
|
|
690
|
+
}, Ne = (e, t, o) => {
|
|
691
691
|
const r = e.type.toUpperCase();
|
|
692
|
-
return r === "TOP_X" || r === "MATCH_QUIZ" || r === "TEMPLATE" ? je(e.id, t, e.type) : Ze(e.id, t,
|
|
693
|
-
}, Ve = (e, t,
|
|
694
|
-
const [
|
|
692
|
+
return r === "TOP_X" || r === "MATCH_QUIZ" || r === "TEMPLATE" ? je(e.id, t, e.type, o) : Ze(e.id, t, o);
|
|
693
|
+
}, Ve = (e, t, o, r = 10) => {
|
|
694
|
+
const [a, h] = B({}), [v, y] = B(null), [d, c] = B(!1), [C, p] = B(!1), [x, A] = B(
|
|
695
695
|
null
|
|
696
696
|
), [P, u] = B(null);
|
|
697
697
|
Q(() => {
|
|
698
|
-
const
|
|
698
|
+
const m = {
|
|
699
699
|
topX: e.filter((n) => n.type.toUpperCase() === "TOP_X").map((n) => n.id),
|
|
700
700
|
matchQuiz: e.filter((n) => n.type.toUpperCase() === "MATCH_QUIZ").map((n) => n.id),
|
|
701
701
|
template: e.filter((n) => n.type.toUpperCase() === "TEMPLATE").map((n) => n.id),
|
|
702
702
|
classicQuiz: e.filter((n) => n.type.toUpperCase() === "CLASSIC_QUIZ").map((n) => n.id)
|
|
703
703
|
}, i = (n) => n.catch(() => []);
|
|
704
704
|
Promise.all([
|
|
705
|
-
i(oe(
|
|
706
|
-
i(ne(
|
|
707
|
-
i(ae(
|
|
708
|
-
i(le(
|
|
705
|
+
i(oe(m.topX, t)),
|
|
706
|
+
i(ne(m.matchQuiz, t)),
|
|
707
|
+
i(ae(m.template, t)),
|
|
708
|
+
i(le(m.classicQuiz, t))
|
|
709
709
|
]).then((n) => {
|
|
710
|
-
const
|
|
710
|
+
const f = {};
|
|
711
711
|
n.flat().forEach((s) => {
|
|
712
|
-
|
|
713
|
-
}),
|
|
712
|
+
f[s.id] = s;
|
|
713
|
+
}), h(f);
|
|
714
714
|
});
|
|
715
715
|
}, [e, t]), Q(() => {
|
|
716
716
|
We(t).then(A);
|
|
717
717
|
}, [t]), Q(() => {
|
|
718
|
-
if (!
|
|
718
|
+
if (!o || !x) {
|
|
719
719
|
u(null);
|
|
720
720
|
return;
|
|
721
721
|
}
|
|
722
|
-
let
|
|
723
|
-
if (
|
|
724
|
-
const n = e.map((
|
|
725
|
-
i = t.miniGames.getClassicQuizzesUserRanking(x.id, void 0, !0).then((
|
|
726
|
-
const T =
|
|
722
|
+
let m = !1, i;
|
|
723
|
+
if (o === $) {
|
|
724
|
+
const n = e.map((f) => f.id);
|
|
725
|
+
i = t.miniGames.getClassicQuizzesUserRanking(x.id, void 0, !0).then((f) => {
|
|
726
|
+
const T = f.data.find((w) => n.includes(w.classicQuizId)) ?? null;
|
|
727
727
|
return T ? {
|
|
728
728
|
position: T.position,
|
|
729
729
|
profileId: x.id,
|
|
@@ -732,79 +732,79 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
732
732
|
} : null;
|
|
733
733
|
});
|
|
734
734
|
} else {
|
|
735
|
-
const n = e.find((
|
|
735
|
+
const n = e.find((f) => f.id === o);
|
|
736
736
|
if (!n) return;
|
|
737
737
|
i = Ne(n, t, x.id);
|
|
738
738
|
}
|
|
739
739
|
return i.then((n) => {
|
|
740
|
-
|
|
740
|
+
m || u(n);
|
|
741
741
|
}).catch(() => {
|
|
742
|
-
|
|
742
|
+
m || u(null);
|
|
743
743
|
}), () => {
|
|
744
|
-
|
|
744
|
+
m = !0;
|
|
745
745
|
};
|
|
746
|
-
}, [
|
|
747
|
-
if (!
|
|
748
|
-
let
|
|
749
|
-
return c(!0), p(!1),
|
|
746
|
+
}, [o, e, t, x]), Q(() => {
|
|
747
|
+
if (!o) return;
|
|
748
|
+
let m = !1;
|
|
749
|
+
return c(!0), p(!1), y(null), (async () => {
|
|
750
750
|
try {
|
|
751
|
-
const n = e.length > 1 && e.every((
|
|
752
|
-
if (
|
|
753
|
-
const
|
|
754
|
-
|
|
751
|
+
const n = e.length > 1 && e.every((b) => b.type.toUpperCase() === "CLASSIC_QUIZ");
|
|
752
|
+
if (o === $ && n) {
|
|
753
|
+
const b = e.map((M) => M.id), R = await W(
|
|
754
|
+
b,
|
|
755
755
|
t,
|
|
756
756
|
1,
|
|
757
757
|
r
|
|
758
758
|
);
|
|
759
|
-
|
|
759
|
+
m || y({
|
|
760
760
|
id: $,
|
|
761
761
|
title: $,
|
|
762
762
|
description: null,
|
|
763
763
|
branding: null,
|
|
764
|
-
...
|
|
764
|
+
...R
|
|
765
765
|
});
|
|
766
766
|
return;
|
|
767
767
|
}
|
|
768
|
-
const
|
|
769
|
-
if (!
|
|
770
|
-
const s =
|
|
771
|
-
ie(
|
|
768
|
+
const f = e.find((b) => b.id === o);
|
|
769
|
+
if (!f) return;
|
|
770
|
+
const s = f.type.toUpperCase(), T = s === "TOP_X" ? oe([o], t) : s === "MATCH_QUIZ" ? ne([o], t) : s === "TEMPLATE" ? ae([o], t) : le([o], t), [w, F] = await Promise.all([
|
|
771
|
+
ie(f, t, 1, r),
|
|
772
772
|
T.catch(() => [])
|
|
773
773
|
]);
|
|
774
|
-
if (!
|
|
775
|
-
const
|
|
776
|
-
|
|
777
|
-
id:
|
|
778
|
-
title: (
|
|
779
|
-
description: (
|
|
780
|
-
branding: (
|
|
774
|
+
if (!m) {
|
|
775
|
+
const b = F[0];
|
|
776
|
+
y({
|
|
777
|
+
id: o,
|
|
778
|
+
title: (b == null ? void 0 : b.title) || o,
|
|
779
|
+
description: (b == null ? void 0 : b.description) || null,
|
|
780
|
+
branding: (b == null ? void 0 : b.branding) || null,
|
|
781
781
|
...w
|
|
782
782
|
});
|
|
783
783
|
}
|
|
784
784
|
} catch (n) {
|
|
785
|
-
console.error("Failed to fetch leaderboard:", n),
|
|
785
|
+
console.error("Failed to fetch leaderboard:", n), m || p(!0);
|
|
786
786
|
} finally {
|
|
787
|
-
|
|
787
|
+
m || c(!1);
|
|
788
788
|
}
|
|
789
789
|
})(), () => {
|
|
790
|
-
|
|
790
|
+
m = !0;
|
|
791
791
|
};
|
|
792
|
-
}, [
|
|
792
|
+
}, [o, e, t, r]);
|
|
793
793
|
const g = me(
|
|
794
|
-
async (
|
|
795
|
-
if (
|
|
794
|
+
async (m) => {
|
|
795
|
+
if (o) {
|
|
796
796
|
c(!0);
|
|
797
797
|
try {
|
|
798
798
|
let i;
|
|
799
|
-
if (
|
|
800
|
-
const n = e.map((
|
|
801
|
-
i = await W(n, t,
|
|
799
|
+
if (o === $) {
|
|
800
|
+
const n = e.map((f) => f.id);
|
|
801
|
+
i = await W(n, t, m, r);
|
|
802
802
|
} else {
|
|
803
|
-
const n = e.find((
|
|
803
|
+
const n = e.find((f) => f.id === o);
|
|
804
804
|
if (!n) return;
|
|
805
|
-
i = await ie(n, t,
|
|
805
|
+
i = await ie(n, t, m, r);
|
|
806
806
|
}
|
|
807
|
-
|
|
807
|
+
y((n) => n ? { ...n, ...i } : null);
|
|
808
808
|
} catch (i) {
|
|
809
809
|
console.error("Failed to fetch page:", i);
|
|
810
810
|
} finally {
|
|
@@ -812,64 +812,64 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
812
812
|
}
|
|
813
813
|
}
|
|
814
814
|
},
|
|
815
|
-
[
|
|
815
|
+
[o, e, t, r]
|
|
816
816
|
), S = Object.fromEntries(
|
|
817
|
-
Object.entries(
|
|
817
|
+
Object.entries(a).map(([m, i]) => [m, i.title])
|
|
818
818
|
);
|
|
819
|
-
return { data: v, entityTitles: S, loading:
|
|
819
|
+
return { data: v, entityTitles: S, loading: d, error: C, setPage: g, userRank: P };
|
|
820
820
|
}, _ = "ALL", se = ["TOP_X", "MATCH_QUIZ", "TEMPLATE", "CLASSIC_QUIZ"], Ye = (e, t) => {
|
|
821
821
|
if (!Array.isArray(e) || e.length === 0)
|
|
822
822
|
return "The 'entities' setting is required and must be a non-empty array.";
|
|
823
|
-
const
|
|
823
|
+
const o = /* @__PURE__ */ new Set();
|
|
824
824
|
for (let r = 0; r < e.length; r++) {
|
|
825
|
-
const
|
|
826
|
-
if (!
|
|
825
|
+
const a = e[r];
|
|
826
|
+
if (!a || typeof a != "object")
|
|
827
827
|
return `Entity at index ${r} must be an object with 'id' and 'type' fields.`;
|
|
828
|
-
if (!
|
|
828
|
+
if (!a.id || typeof a.id != "string")
|
|
829
829
|
return `Entity at index ${r} is missing a required 'id' string field.`;
|
|
830
|
-
if (
|
|
831
|
-
return `Duplicate entity id '${
|
|
832
|
-
if (
|
|
830
|
+
if (o.has(a.id))
|
|
831
|
+
return `Duplicate entity id '${a.id}' found at index ${r}. Each entity must have a unique id.`;
|
|
832
|
+
if (o.add(a.id), !a.type || typeof a.type != "string")
|
|
833
833
|
return `Entity at index ${r} is missing a required 'type' string field.`;
|
|
834
|
-
if (!se.includes(
|
|
835
|
-
return `Entity at index ${r} has an invalid type '${
|
|
834
|
+
if (!se.includes(a.type.toUpperCase()))
|
|
835
|
+
return `Entity at index ${r} has an invalid type '${a.type}'. Valid values are: ${se.join(", ")} (case-insensitive).`;
|
|
836
836
|
}
|
|
837
837
|
return t !== void 0 && (typeof t != "number" || !Number.isInteger(t) || t < 1 || t > 50) ? "The 'pageSize' setting must be an integer between 1 and 50." : null;
|
|
838
838
|
}, qe = ({
|
|
839
839
|
entities: e,
|
|
840
840
|
sdk: t,
|
|
841
|
-
pageSize:
|
|
841
|
+
pageSize: o,
|
|
842
842
|
rankStyles: r,
|
|
843
|
-
showOverallOnly:
|
|
844
|
-
showHeading:
|
|
843
|
+
showOverallOnly: a = !1,
|
|
844
|
+
showHeading: h = !0
|
|
845
845
|
}) => {
|
|
846
|
-
var
|
|
847
|
-
const { t: v } = X(),
|
|
848
|
-
() => Ye(e,
|
|
849
|
-
[e,
|
|
846
|
+
var b;
|
|
847
|
+
const { t: v } = X(), y = j(), d = G().surface, c = D(
|
|
848
|
+
() => Ye(e, o),
|
|
849
|
+
[e, o]
|
|
850
850
|
), C = D(
|
|
851
|
-
() => !c && e.length > 1 && e.every((
|
|
851
|
+
() => !c && e.length > 1 && e.every((R) => R.type.toUpperCase() === "CLASSIC_QUIZ"),
|
|
852
852
|
[e, c]
|
|
853
|
-
), p =
|
|
853
|
+
), p = a && C, x = C ? _ : ((b = e[0]) == null ? void 0 : b.id) || "", [A, P] = B(x);
|
|
854
854
|
Q(() => {
|
|
855
855
|
A === _ || e.some((M) => M.id === A) || P(x);
|
|
856
856
|
}, [e]);
|
|
857
|
-
const { data: u, entityTitles: g, loading: S, error:
|
|
857
|
+
const { data: u, entityTitles: g, loading: S, error: m, setPage: i, userRank: n } = Ve(
|
|
858
858
|
c ? [] : e,
|
|
859
859
|
t,
|
|
860
860
|
c ? "" : A,
|
|
861
|
-
|
|
862
|
-
),
|
|
861
|
+
o
|
|
862
|
+
), f = D(() => {
|
|
863
863
|
if (c) return [];
|
|
864
|
-
const
|
|
865
|
-
return C &&
|
|
866
|
-
|
|
864
|
+
const R = [];
|
|
865
|
+
return C && R.push({ id: _, label: v("leaderboard.overall") }), e.forEach((M) => {
|
|
866
|
+
R.push({
|
|
867
867
|
id: M.id,
|
|
868
868
|
label: g[M.id] ?? "",
|
|
869
869
|
type: M.type.toUpperCase()
|
|
870
870
|
});
|
|
871
|
-
}),
|
|
872
|
-
}, [e, C, v, g, c]), s = e.every((
|
|
871
|
+
}), R;
|
|
872
|
+
}, [e, C, v, g, c]), s = e.every((R) => g[R.id] !== void 0), T = !c && !p && (e.length > 1 || C) && s, w = (u == null ? void 0 : u.pagination) || null, F = A === _ ? v("leaderboard.overall") : (u == null ? void 0 : u.title) || null;
|
|
873
873
|
return c ? /* @__PURE__ */ l(
|
|
874
874
|
J,
|
|
875
875
|
{
|
|
@@ -877,7 +877,7 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
877
877
|
title: "Configuration Error",
|
|
878
878
|
message: c
|
|
879
879
|
}
|
|
880
|
-
) :
|
|
880
|
+
) : m ? /* @__PURE__ */ l(
|
|
881
881
|
J,
|
|
882
882
|
{
|
|
883
883
|
variant: "error",
|
|
@@ -885,20 +885,20 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
885
885
|
message: "One or more entity IDs could not be found. Please verify the provided IDs and try again."
|
|
886
886
|
}
|
|
887
887
|
) : /* @__PURE__ */ E(
|
|
888
|
-
|
|
888
|
+
I,
|
|
889
889
|
{
|
|
890
890
|
sx: {
|
|
891
891
|
display: "flex",
|
|
892
892
|
flexDirection: "column",
|
|
893
|
-
gap:
|
|
894
|
-
backgroundColor:
|
|
895
|
-
padding:
|
|
893
|
+
gap: y.md,
|
|
894
|
+
backgroundColor: d,
|
|
895
|
+
padding: y.md
|
|
896
896
|
},
|
|
897
897
|
children: [
|
|
898
898
|
T && /* @__PURE__ */ l(
|
|
899
899
|
_e,
|
|
900
900
|
{
|
|
901
|
-
options:
|
|
901
|
+
options: f,
|
|
902
902
|
selectedId: A,
|
|
903
903
|
onChange: P
|
|
904
904
|
}
|
|
@@ -908,7 +908,7 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
908
908
|
{
|
|
909
909
|
leaderboard: S ? null : (u == null ? void 0 : u.leaderboard) || null,
|
|
910
910
|
userRank: S ? null : n,
|
|
911
|
-
showHeading:
|
|
911
|
+
showHeading: h && !T,
|
|
912
912
|
title: F,
|
|
913
913
|
description: (u == null ? void 0 : u.description) || null,
|
|
914
914
|
brandingColors: (u == null ? void 0 : u.branding) || null,
|
|
@@ -928,38 +928,38 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
928
928
|
);
|
|
929
929
|
}, Ke = (e) => {
|
|
930
930
|
var P;
|
|
931
|
-
const [t,
|
|
931
|
+
const [t, o] = z.useState(!1), [r, a] = z.useState(!1), h = ye(e.language), v = z.useRef(
|
|
932
932
|
`leaderboard-shadow-root-${Math.random().toString(36).substring(2, 11)}`
|
|
933
|
-
),
|
|
933
|
+
), y = z.useRef(null), d = z.useRef(null), c = z.useRef(null), [C, p] = z.useState(null);
|
|
934
934
|
z.useEffect(() => {
|
|
935
|
-
xe(e.language || "en").finally(() =>
|
|
935
|
+
xe(e.language || "en").finally(() => a(!0));
|
|
936
936
|
}, [e.language]), z.useEffect(() => {
|
|
937
|
-
if (!
|
|
938
|
-
|
|
937
|
+
if (!y.current) return;
|
|
938
|
+
y.current.shadowRoot ? (d.current = y.current.shadowRoot, c.current = d.current.getElementById(
|
|
939
939
|
v.current
|
|
940
|
-
), c.current || (c.current = document.createElement("div"), c.current.id = v.current,
|
|
941
|
-
const u = Ee("leaderboard",
|
|
940
|
+
), c.current || (c.current = document.createElement("div"), c.current.id = v.current, d.current.appendChild(c.current))) : (d.current = y.current.attachShadow({ mode: "open" }), c.current = document.createElement("div"), c.current.id = v.current, d.current.appendChild(c.current)), Ce(c.current, h);
|
|
941
|
+
const u = Ee("leaderboard", h);
|
|
942
942
|
return p(
|
|
943
943
|
(g) => (g == null ? void 0 : g.key) === u ? g : ve(
|
|
944
944
|
"leaderboard",
|
|
945
|
-
|
|
946
|
-
|
|
945
|
+
d.current,
|
|
946
|
+
h
|
|
947
947
|
)
|
|
948
|
-
),
|
|
949
|
-
|
|
948
|
+
), o(!0), () => {
|
|
949
|
+
o(!1);
|
|
950
950
|
};
|
|
951
|
-
}, [
|
|
952
|
-
const x = /* @__PURE__ */ l(
|
|
951
|
+
}, [h]);
|
|
952
|
+
const x = /* @__PURE__ */ l(I, { ref: y, lang: e.language || "en" }), A = t && r && c.current && C ? Ae(
|
|
953
953
|
// Keyed on the cache, not on `direction`: it must change in the same
|
|
954
954
|
// render that adopts the new cache, or CssVarsProvider writes its CSS
|
|
955
955
|
// variables into the outgoing cache and never repeats.
|
|
956
|
-
/* @__PURE__ */ l(Te, { value: C, children: /* @__PURE__ */ l(Pe, { containerRef:
|
|
956
|
+
/* @__PURE__ */ l(Te, { value: C, children: /* @__PURE__ */ l(Pe, { containerRef: y, children: /* @__PURE__ */ l(
|
|
957
957
|
Se,
|
|
958
958
|
{
|
|
959
959
|
customTheme: e.themeOptions,
|
|
960
960
|
mode: (P = e.themeOptions) == null ? void 0 : P.mode,
|
|
961
961
|
shadowRootElement: c.current,
|
|
962
|
-
direction:
|
|
962
|
+
direction: h,
|
|
963
963
|
children: /* @__PURE__ */ l(
|
|
964
964
|
we,
|
|
965
965
|
{
|
|
@@ -967,7 +967,7 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
967
967
|
leadPhoneCountryCode: null,
|
|
968
968
|
language: e.language,
|
|
969
969
|
optionsLayout: null,
|
|
970
|
-
direction:
|
|
970
|
+
direction: h,
|
|
971
971
|
children: e.children
|
|
972
972
|
}
|
|
973
973
|
)
|