fansunited-frontend-components 0.0.92 → 0.0.94

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.
Files changed (139) hide show
  1. package/Betslip.js +1 -1
  2. package/ChanceGame.js +139 -146
  3. package/ClassicQuizPlay.js +1 -1
  4. package/CollectLead.js +14 -20
  5. package/CompetitionStatistics.js +27 -27
  6. package/CompetitorCard.js +895 -891
  7. package/Discussion.js +1 -1
  8. package/EitherOrPlay.js +1 -1
  9. package/EventCard.js +1494 -1571
  10. package/EventGamePlay.js +1 -1
  11. package/Leaderboard.js +249 -257
  12. package/List.js +319 -436
  13. package/MatchQuizPlay.js +1 -1
  14. package/Odds.js +30 -30
  15. package/PersonalityQuizPlay.js +1 -1
  16. package/PickThePair.js +627 -693
  17. package/PlayerOfTheMatch.js +256 -279
  18. package/PollVote.js +1 -1
  19. package/Predictor.js +19443 -2
  20. package/README.md +2 -1
  21. package/Standings.js +94 -99
  22. package/TopX.js +5871 -6988
  23. package/chunks/ChanceGameEmbedVariant-C3NGwvTF.js +21 -0
  24. package/chunks/OddsSkeleton-Bav8FHHN.js +26 -0
  25. package/chunks/{OddsStrip-B159Nivm.js → OddsStrip-CviVfQI4.js} +51 -53
  26. package/chunks/{PickOneOfX-D9qlxKTD.js → PickOneOfX-a6Dv0-rR.js} +210 -212
  27. package/chunks/index-B1d9q8fX.js +4 -0
  28. package/chunks/index-BP0pvFJ4.js +4 -0
  29. package/chunks/index-CHZyL_g_.js +4 -0
  30. package/chunks/index-CeCUdRmF.js +4 -0
  31. package/chunks/index-Ckyyw-I8.js +4 -0
  32. package/chunks/index-DGvCP5G8.js +4 -0
  33. package/chunks/index-yjMVOgwO.js +4 -0
  34. package/chunks/{main-CcPVuc5G.js → main-CFwRpvUi.js} +219 -238
  35. package/chunks/{main-By2Fg4Us.js → main-D9tFZv2q.js} +272 -309
  36. package/chunks/{main-Db4YC1C9.js → main-Dj4Manb5.js} +386 -407
  37. package/chunks/{main-BhONg691.js → main-DjiQz1dv.js} +764 -1125
  38. package/chunks/{main-BoLNJccN.js → main-Dys2_Jt2.js} +1625 -1954
  39. package/chunks/{main-JAewg2VD.js → main-dwV_55lz.js} +409 -432
  40. package/chunks/main-eAQMCxQ7.js +1949 -0
  41. package/chunks/{main-CWfREbUv.js → main-gexg6lc-.js} +959 -977
  42. package/index.js +40 -44
  43. package/package.json +13 -5
  44. package/chunks/AccessTime-B7Q_InTi.js +0 -10
  45. package/chunks/AlertMessage-CTbc9daZ.js +0 -318
  46. package/chunks/Avatar-Ve0m4ut_.js +0 -353
  47. package/chunks/Button-x1sQVMH2.js +0 -665
  48. package/chunks/Card-DfxnA3Cz.js +0 -196
  49. package/chunks/CardActions-TMBAbk8a.js +0 -140
  50. package/chunks/CardContent-CLQHztIU.js +0 -106
  51. package/chunks/ChanceGameEmbedVariant-C3TKbPI4.js +0 -913
  52. package/chunks/CheckCircle-DW1VzjQO.js +0 -8
  53. package/chunks/Chip-BUoNpinI.js +0 -365
  54. package/chunks/CircularProgress-D88LgW2V.js +0 -317
  55. package/chunks/Close-BxLZcPtb.js +0 -9
  56. package/chunks/Close-DVx6f5-e.js +0 -8
  57. package/chunks/CollectLeadForm-DtUFKk99.js +0 -3419
  58. package/chunks/ConsentsList-BcIMKviP.js +0 -339
  59. package/chunks/DirectionScope-CK0duYt8.js +0 -36
  60. package/chunks/Divider-D_ALv2uC.js +0 -166
  61. package/chunks/Edit-CiKqhDom.js +0 -99
  62. package/chunks/EmojiEvents-BYoxruEl.js +0 -8
  63. package/chunks/FavoriteBorder-YhT6RHv5.js +0 -11
  64. package/chunks/FormControl-BNG04EhC.js +0 -656
  65. package/chunks/FormControlContext-Ct0huDDM.js +0 -6
  66. package/chunks/FormLabel-Bl7hTa8O.js +0 -130
  67. package/chunks/GlobalStyles-PokSS9bO.js +0 -12
  68. package/chunks/InlineSpinner-BhKW6lxZ.js +0 -28
  69. package/chunks/Input-B7kPqO0b.js +0 -391
  70. package/chunks/KeyboardArrowDown-OGGGLEnE.js +0 -8
  71. package/chunks/KeyboardArrowRight-DN7qrp17.js +0 -11
  72. package/chunks/KeyboardArrowUp-jvN5m_A0.js +0 -8
  73. package/chunks/Link-brb09X-6.js +0 -319
  74. package/chunks/ListItemButton-BFG5QJbo.js +0 -1151
  75. package/chunks/ModalClose-D3i-AyMB.js +0 -153
  76. package/chunks/ModalDialog-Be6w76fh.js +0 -880
  77. package/chunks/NotFoundSkeleton-BHRVG8yg.js +0 -83
  78. package/chunks/Notification-CC66HKXb.js +0 -614
  79. package/chunks/OddsSkeleton-BBOVhfsn.js +0 -137
  80. package/chunks/OverlayScoreStateSkeleton-D5rnBJ_w.js +0 -154
  81. package/chunks/OverlayScoreStateWrapperSkeleton-CTXzD0bm.js +0 -81
  82. package/chunks/OverlaySignInSkeleton-T8A_9Tco.js +0 -518
  83. package/chunks/OverlaySkeleton-y02LRXZy.js +0 -1193
  84. package/chunks/Person-BD-IO4aX.js +0 -8
  85. package/chunks/PersonOutline-Nxl_9g9S.js +0 -8
  86. package/chunks/Popper-CGfJHTbM.js +0 -1263
  87. package/chunks/Portal-DQQSLiON.js +0 -74
  88. package/chunks/Portal-X8O64KaQ.js +0 -66
  89. package/chunks/Predictor-BJBBwZ6R.js +0 -19513
  90. package/chunks/PrizeCard-B2tBhY45.js +0 -36400
  91. package/chunks/Search-jaDXe8g7.js +0 -14
  92. package/chunks/Select-CzBMHr7z.js +0 -1165
  93. package/chunks/Sheet-x-YGYOYz.js +0 -132
  94. package/chunks/SignInCta-3NFxIOuf.js +0 -79
  95. package/chunks/Spinner-_5U881sC.js +0 -39
  96. package/chunks/SportsSoccer-DLUgspA-.js +0 -20
  97. package/chunks/Stack-CDpKA1D-.js +0 -169
  98. package/chunks/StandardContentSkeleton-DaZftDxZ.js +0 -57
  99. package/chunks/Table-IJ9-D2DF.js +0 -394
  100. package/chunks/Tabs-iyOvjGfd.js +0 -1084
  101. package/chunks/Textarea-Dv_Z4l5j.js +0 -475
  102. package/chunks/TimerOutlined-jNsK__Zz.js +0 -8
  103. package/chunks/Tooltip-clSjN1oC.js +0 -535
  104. package/chunks/Typography-BsucZNXl.js +0 -775
  105. package/chunks/areArraysEqual-B3mXtHvh.js +0 -6
  106. package/chunks/colorInversionUtils-AoR_6ghW.js +0 -347
  107. package/chunks/createSvgIcon-BWoHeNkc.js +0 -2813
  108. package/chunks/createSvgIcon-DBkOhFdn.js +0 -206
  109. package/chunks/dividerClasses-BkQMLbsL.js +0 -9
  110. package/chunks/elementAcceptingRef-DjUfkpLB.js +0 -25
  111. package/chunks/enums-B1lTCQvC.js +0 -15
  112. package/chunks/formLabelClasses-N0g8NZ67.js +0 -9
  113. package/chunks/getReactElementRef-B3MFPBbS.js +0 -21
  114. package/chunks/helpers-CKFwVhwj.js +0 -558
  115. package/chunks/index-Bg5jypgn.js +0 -11
  116. package/chunks/index-Bnad45hB.js +0 -4
  117. package/chunks/index-C6rtfeRX.js +0 -4
  118. package/chunks/index-CFc0WTOi.js +0 -848
  119. package/chunks/index-C_kf8WZI.js +0 -4
  120. package/chunks/index-CaVpDbdC.js +0 -4
  121. package/chunks/index-DJJVbXn_.js +0 -4
  122. package/chunks/index-DQO7VDRC.js +0 -4
  123. package/chunks/index-Kgehqf8J.js +0 -4
  124. package/chunks/main-W_W6YBtr.js +0 -3280
  125. package/chunks/ownerWindow-PI509BpA.js +0 -7
  126. package/chunks/searchEntities-SJcoznz0.js +0 -38
  127. package/chunks/sportsEvents-CGX-WkNB.js +0 -27
  128. package/chunks/useButton-C9taTgFS.js +0 -106
  129. package/chunks/useConsents-BLhgfEDf.js +0 -1168
  130. package/chunks/useControlled-BYdyS7Pn.js +0 -31
  131. package/chunks/useEmbedCode-DCWnWGak.js +0 -31
  132. package/chunks/useEventCallback-C9W0M_8l.js +0 -14
  133. package/chunks/useForwardedInput-CkAnayh_.js +0 -180
  134. package/chunks/useImageVariant-B62O7iLC.js +0 -15
  135. package/chunks/useInfoPage-BHdgKdme.js +0 -50
  136. package/chunks/useParticipationDraft-Brnd_p3w.js +0 -307
  137. package/chunks/useSwitch-DLSSqtcZ.js +0 -66
  138. package/chunks/variantColorInheritance-DZr7CNx6.js +0 -30
  139. package/chunks/visuallyHidden-B8J7BVSJ.js +0 -14
package/Leaderboard.js CHANGED
@@ -1,39 +1,31 @@
1
- import { jsxs as E, jsx as l, Fragment as ce } from "react/jsx-runtime";
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 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-B2tBhY45.js";
4
- import { createPortal as Ae } from "react-dom";
5
- import { A as J } from "./chunks/AlertMessage-CTbc9daZ.js";
6
- import { F as Re } from "./chunks/FormLabel-Bl7hTa8O.js";
7
- import { T as L } from "./chunks/Typography-BsucZNXl.js";
8
- import { S as Le, a as Ie } from "./chunks/Select-CzBMHr7z.js";
9
- import { P as ee } from "./chunks/Person-BD-IO4aX.js";
10
- import { h as U, a as Me } from "./chunks/helpers-CKFwVhwj.js";
11
- import { S as ze } from "./chunks/Spinner-_5U881sC.js";
12
- import { S as Be } from "./chunks/Sheet-x-YGYOYz.js";
13
- import { T as Fe } from "./chunks/Table-IJ9-D2DF.js";
14
- import { A as te } from "./chunks/Avatar-Ve0m4ut_.js";
15
- import { D as H } from "./chunks/DirectionScope-CK0duYt8.js";
16
- import { I as k, B as re } from "./chunks/Button-x1sQVMH2.js";
17
- import { C as Ue, a as $e } from "./chunks/chevrons-right-CXSpQt9w.js";
18
- import { C as Qe } from "./chunks/chevron-left-CxfCSZcr.js";
19
- import { C as He } from "./chunks/chevron-right-BEQMacFn.js";
20
- const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()).join(" "), _e = ({
1
+ import { jsxs as R, jsx as a, Fragment as ce } from "react/jsx-runtime";
2
+ import z, { useState as B, useEffect as Q, useCallback as he, useMemo as D } from "react";
3
+ import { useTheme as me, Box as I, FormLabel as fe, Typography as L, Select as ge, Option as be, Sheet as ye, Table as xe, Avatar as J, IconButton as H, Button as ee } from "@mui/joy";
4
+ import { useTranslation as X } from "react-i18next";
5
+ import { useConstantContext as Ce, ConstantsContext as ve, useColors as G, useCornerRadius as de, useFontFamily as W, useSpacingScale as j, useInternalTheme as ue, isExtraSmall as Te, hexToRgb as U, Spinner as Pe, stripHtmlTags as we, DirectionalIcon as k, AlertMessage as te, getLanguageDirection as Se, initializeI18n as Re, applyDirectionToMount as Ee, widgetCacheKey as Ae, createWidgetCache as Le, ContainerProvider as Ie, ThemeProvider as Me, ConstantsProvider as ze } from "fansunited-frontend-core";
6
+ import re from "@mui/icons-material/Person";
7
+ import { C as Be, a as Fe } from "./chunks/chevrons-right-CXSpQt9w.js";
8
+ import { C as Ue } from "./chunks/chevron-left-CxfCSZcr.js";
9
+ import { C as $e } from "./chunks/chevron-right-BEQMacFn.js";
10
+ import { CacheProvider as Qe } from "@emotion/react";
11
+ import { createPortal as He } from "react-dom";
12
+ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()).join(" "), Oe = ({
21
13
  options: e,
22
14
  selectedId: t,
23
15
  onChange: o
24
16
  }) => {
25
- const { t: r } = X(), { shadowRootElement: a } = fe(he), h = ge(), v = G(), y = de(), d = O().primary, c = j(), C = v.textColor, p = {
17
+ const { t: r } = X(), { shadowRootElement: l } = Ce(ve), f = me(), v = G(), y = de(), d = W().primary, c = j(), C = v.textColor, p = {
26
18
  background: {
27
- surface: h.colorSchemes.light.palette.background.surface,
28
- popup: h.colorSchemes.light.palette.background.popup
19
+ surface: f.colorSchemes.light.palette.background.surface,
20
+ popup: f.colorSchemes.light.palette.background.popup
29
21
  },
30
22
  neutral: {
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
23
+ outlinedBorder: f.colorSchemes.light.palette.neutral.outlinedBorder,
24
+ outlinedColor: f.colorSchemes.light.palette.neutral.outlinedColor,
25
+ outlinedHoverBg: f.colorSchemes.light.palette.neutral.outlinedHoverBg,
26
+ plainActiveBg: f.colorSchemes.light.palette.neutral.plainActiveBg,
27
+ plainHoverBg: f.colorSchemes.light.palette.neutral.plainHoverBg,
28
+ plainHoverColor: f.colorSchemes.light.palette.neutral.plainHoverColor
37
29
  }
38
30
  }, x = {
39
31
  flexShrink: 0,
@@ -48,7 +40,7 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
48
40
  borderRadius: y.sm,
49
41
  px: c["2xs"],
50
42
  py: c["3xs"]
51
- }, A = (g) => /* @__PURE__ */ E(
43
+ }, E = (g) => /* @__PURE__ */ R(
52
44
  I,
53
45
  {
54
46
  sx: {
@@ -59,8 +51,8 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
59
51
  gap: c.sm
60
52
  },
61
53
  children: [
62
- /* @__PURE__ */ l("span", { children: g.label }),
63
- g.type && /* @__PURE__ */ l(I, { sx: x, children: ke(g.type) })
54
+ /* @__PURE__ */ a("span", { children: g.label }),
55
+ g.type && /* @__PURE__ */ a(I, { sx: x, children: ke(g.type) })
64
56
  ]
65
57
  }
66
58
  ), P = {
@@ -76,7 +68,7 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
76
68
  }
77
69
  },
78
70
  listbox: {
79
- container: a,
71
+ container: l,
80
72
  sx: {
81
73
  zIndex: 10,
82
74
  bgcolor: p.background.popup,
@@ -102,16 +94,16 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
102
94
  color: `${p.neutral.outlinedColor} !important`
103
95
  }
104
96
  };
105
- return /* @__PURE__ */ E(I, { sx: { display: "flex", flexDirection: "column", gap: c["2xs"] }, children: [
106
- /* @__PURE__ */ l(
107
- Re,
97
+ return /* @__PURE__ */ R(I, { sx: { display: "flex", flexDirection: "column", gap: c["2xs"] }, children: [
98
+ /* @__PURE__ */ a(
99
+ fe,
108
100
  {
109
101
  sx: {
110
102
  color: `${C} !important`,
111
103
  fontFamily: d,
112
104
  fontSize: "0.875em"
113
105
  },
114
- children: /* @__PURE__ */ l(
106
+ children: /* @__PURE__ */ a(
115
107
  L,
116
108
  {
117
109
  sx: {
@@ -124,18 +116,18 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
124
116
  )
125
117
  }
126
118
  ),
127
- /* @__PURE__ */ l(
128
- Le,
119
+ /* @__PURE__ */ a(
120
+ ge,
129
121
  {
130
122
  value: t,
131
- onChange: (g, S) => S && o(S),
123
+ onChange: (g, w) => w && o(w),
132
124
  slotProps: P,
133
125
  renderValue: (g) => {
134
126
  if (!g) return null;
135
- const S = e.find((m) => m.id === g.value);
136
- return S ? A(S) : g.label;
127
+ const w = e.find((h) => h.id === g.value);
128
+ return w ? E(w) : g.label;
137
129
  },
138
- children: e.map((g) => /* @__PURE__ */ l(Ie, { value: g.id, sx: u, children: A(g) }, g.id))
130
+ children: e.map((g) => /* @__PURE__ */ a(be, { value: g.id, sx: u, children: E(g) }, g.id))
139
131
  }
140
132
  )
141
133
  ] });
@@ -144,16 +136,16 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
144
136
  userRank: t,
145
137
  showHeading: o,
146
138
  title: r,
147
- description: a,
148
- isSplitVariant: h,
139
+ description: l,
140
+ isSplitVariant: f,
149
141
  brandingColors: v,
150
142
  rankStyles: y
151
143
  }) => {
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 = {
144
+ 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, E = C.textColor, P = W().primary, u = W().secondary, g = de(), w = j(), h = Te(), i = C.surfaceVariant, n = c.colorSchemes.light.palette.primary.onPrimary, m = C.outlineEnabledBorder, s = {
153
145
  leaderboardContainer: {
154
146
  display: "flex",
155
147
  flexDirection: "column",
156
- gap: S.md
148
+ gap: w.md
157
149
  },
158
150
  leaderboardTitle: {
159
151
  fontFamily: P,
@@ -167,7 +159,7 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
167
159
  tableContainer: {
168
160
  overflowX: "auto",
169
161
  borderRadius: g.md,
170
- border: `1px solid ${f}`
162
+ border: `1px solid ${m}`
171
163
  },
172
164
  table: {
173
165
  backgroundColor: i,
@@ -184,7 +176,7 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
184
176
  fontWeight: 600,
185
177
  fontSize: "0.875em",
186
178
  textAlign: "center",
187
- borderBottom: `1px solid ${f}`
179
+ borderBottom: `1px solid ${m}`
188
180
  }
189
181
  },
190
182
  headerCellPosition: {
@@ -237,7 +229,7 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
237
229
  nameCell: {
238
230
  display: "flex",
239
231
  alignItems: "center",
240
- gap: S.sm
232
+ gap: w.sm
241
233
  },
242
234
  leaderboardAvatar: {
243
235
  width: "32px",
@@ -277,16 +269,16 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
277
269
  fontSize: "1.25em",
278
270
  color: x,
279
271
  textAlign: "center",
280
- marginY: S.md
272
+ marginY: w.md
281
273
  }
282
274
  };
283
275
  if (!e)
284
- return /* @__PURE__ */ l(ze, { my: 10 });
276
+ return /* @__PURE__ */ a(Pe, { my: 10 });
285
277
  if (e.length === 0)
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(
278
+ return /* @__PURE__ */ a(L, { level: "body-lg", sx: s.noLeaderboardText, children: d("leaderboard.noLeaderboardAvailable") });
279
+ const T = t, S = T == null ? void 0 : T.profileId, F = S && e.some((b) => b.profileId === S);
280
+ return /* @__PURE__ */ R(I, { sx: s.leaderboardContainer, children: [
281
+ o && /* @__PURE__ */ R(
290
282
  I,
291
283
  {
292
284
  sx: {
@@ -296,7 +288,7 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
296
288
  textAlign: "center"
297
289
  },
298
290
  children: [
299
- /* @__PURE__ */ l(
291
+ /* @__PURE__ */ a(
300
292
  L,
301
293
  {
302
294
  level: "body-sm",
@@ -306,24 +298,24 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
306
298
  letterSpacing: "1px",
307
299
  textTransform: "uppercase",
308
300
  fontSize: "0.75em",
309
- color: A,
301
+ color: E,
310
302
  opacity: "60%",
311
303
  fontFamily: u
312
304
  },
313
305
  children: d("leaderboard.heading")
314
306
  }
315
307
  ),
316
- /* @__PURE__ */ E(
308
+ /* @__PURE__ */ R(
317
309
  I,
318
310
  {
319
311
  sx: {
320
312
  display: "flex",
321
313
  flexDirection: "column",
322
- gap: S["3xs"]
314
+ gap: w["3xs"]
323
315
  },
324
316
  children: [
325
- r && /* @__PURE__ */ l(L, { level: "h4", sx: s.leaderboardTitle, children: r }),
326
- a && /* @__PURE__ */ l(
317
+ r && /* @__PURE__ */ a(L, { level: "h4", sx: s.leaderboardTitle, children: r }),
318
+ l && /* @__PURE__ */ a(
327
319
  L,
328
320
  {
329
321
  sx: {
@@ -331,11 +323,11 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
331
323
  lineHeight: "140%",
332
324
  letterSpacing: "0.15px",
333
325
  fontSize: "1.25em",
334
- color: A,
326
+ color: E,
335
327
  opacity: "60%",
336
328
  fontFamily: P
337
329
  },
338
- children: Me(a)
330
+ children: we(l)
339
331
  }
340
332
  )
341
333
  ]
@@ -344,8 +336,8 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
344
336
  ]
345
337
  }
346
338
  ),
347
- /* @__PURE__ */ l(Be, { sx: s.tableContainer, children: /* @__PURE__ */ E(
348
- Fe,
339
+ /* @__PURE__ */ a(ye, { sx: s.tableContainer, children: /* @__PURE__ */ R(
340
+ xe,
349
341
  {
350
342
  variant: "outlined",
351
343
  hoverRow: !1,
@@ -353,43 +345,43 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
353
345
  size: "sm",
354
346
  sx: s.table,
355
347
  children: [
356
- /* @__PURE__ */ l("thead", { children: /* @__PURE__ */ E("tr", { 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") })
348
+ /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ R("tr", { children: [
349
+ /* @__PURE__ */ a("th", { style: s.headerCellPosition, children: h || f ? "" : d("leaderboard.position") }),
350
+ /* @__PURE__ */ a("th", { style: s.headerCellName, children: d("leaderboard.name") }),
351
+ /* @__PURE__ */ a("th", { style: s.headerCellPoints, children: h || f ? "🎯" : d("leaderboard.points") })
360
352
  ] }) }),
361
- /* @__PURE__ */ E("tbody", { children: [
362
- T && !F && /* @__PURE__ */ E("tr", { style: s.userRow, children: [
363
- /* @__PURE__ */ l("td", { style: s.tableCellPosition, children: /* @__PURE__ */ E(L, { sx: s.positionText, children: [
353
+ /* @__PURE__ */ R("tbody", { children: [
354
+ T && !F && /* @__PURE__ */ R("tr", { style: s.userRow, children: [
355
+ /* @__PURE__ */ a("td", { style: s.tableCellPosition, children: /* @__PURE__ */ R(L, { sx: s.positionText, children: [
364
356
  "#",
365
357
  T.position
366
358
  ] }) }),
367
- /* @__PURE__ */ l("td", { style: s.tableCellName, children: /* @__PURE__ */ E(I, { sx: s.nameCell, children: [
368
- /* @__PURE__ */ l(te, { sx: s.leaderboardAvatar, children: /* @__PURE__ */ l(ee, { sx: s.avatarIcon }) }),
369
- /* @__PURE__ */ l(L, { sx: s.nameText, children: d("leaderboard.you") })
359
+ /* @__PURE__ */ a("td", { style: s.tableCellName, children: /* @__PURE__ */ R(I, { sx: s.nameCell, children: [
360
+ /* @__PURE__ */ a(J, { sx: s.leaderboardAvatar, children: /* @__PURE__ */ a(re, { sx: s.avatarIcon }) }),
361
+ /* @__PURE__ */ a(L, { sx: s.nameText, children: d("leaderboard.you") })
370
362
  ] }) }),
371
- /* @__PURE__ */ l("td", { style: s.tableCellPoints, children: /* @__PURE__ */ l(L, { sx: s.pointsText, children: T.points }) })
363
+ /* @__PURE__ */ a("td", { style: s.tableCellPoints, children: /* @__PURE__ */ a(L, { sx: s.pointsText, children: T.points }) })
372
364
  ] }),
373
- e.map((b, R) => {
374
- var V, Y, q, K;
375
- const M = w === b.profileId, pe = M ? s.userRow : y == null ? void 0 : y[R + 1];
376
- return /* @__PURE__ */ E("tr", { style: pe, children: [
377
- /* @__PURE__ */ l("td", { style: s.tableCellPosition, children: /* @__PURE__ */ E(L, { sx: s.positionText, children: [
365
+ e.map((b, A) => {
366
+ var V, Y, K, q;
367
+ const M = S === b.profileId, pe = M ? s.userRow : y == null ? void 0 : y[A + 1];
368
+ return /* @__PURE__ */ R("tr", { style: pe, children: [
369
+ /* @__PURE__ */ a("td", { style: s.tableCellPosition, children: /* @__PURE__ */ R(L, { sx: s.positionText, children: [
378
370
  "#",
379
371
  b.position
380
372
  ] }) }),
381
- /* @__PURE__ */ l("td", { style: s.tableCellName, children: /* @__PURE__ */ E(I, { sx: s.nameCell, children: [
382
- /* @__PURE__ */ l(
383
- te,
373
+ /* @__PURE__ */ a("td", { style: s.tableCellName, children: /* @__PURE__ */ R(I, { sx: s.nameCell, children: [
374
+ /* @__PURE__ */ a(
375
+ J,
384
376
  {
385
377
  src: ((V = b.profileModel) == null ? void 0 : V.avatar) || void 0,
386
378
  sx: s.leaderboardAvatar,
387
- children: (Y = b.profileModel) != null && Y.avatar ? /* @__PURE__ */ l(ce, {}) : /* @__PURE__ */ l(ee, { sx: s.avatarIcon })
379
+ children: (Y = b.profileModel) != null && Y.avatar ? /* @__PURE__ */ a(ce, {}) : /* @__PURE__ */ a(re, { sx: s.avatarIcon })
388
380
  }
389
381
  ),
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") })
382
+ /* @__PURE__ */ a(L, { sx: s.nameText, children: M ? d("leaderboard.you") : ((K = b.profileModel) == null ? void 0 : K.nickname) || ((q = b.profileModel) == null ? void 0 : q.name) || d("leaderboard.anonymous") })
391
383
  ] }) }),
392
- /* @__PURE__ */ l("td", { style: s.tableCellPoints, children: /* @__PURE__ */ l(L, { sx: s.pointsText, children: b.points }) })
384
+ /* @__PURE__ */ a("td", { style: s.tableCellPoints, children: /* @__PURE__ */ a(L, { sx: s.pointsText, children: b.points }) })
393
385
  ] }, b.profileId);
394
386
  })
395
387
  ] })
@@ -397,13 +389,13 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
397
389
  }
398
390
  ) })
399
391
  ] });
400
- }, Oe = ({
392
+ }, We = ({
401
393
  count: e = 10,
402
394
  page: t = 1,
403
395
  onChange: o,
404
396
  siblingCount: r = 1,
405
- boundaryCount: a = 1,
406
- showFirstButton: h = !0,
397
+ boundaryCount: l = 1,
398
+ showFirstButton: f = !0,
407
399
  showLastButton: v = !0,
408
400
  size: y = "md",
409
401
  disabled: d = !1,
@@ -412,23 +404,23 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
412
404
  const C = ue(), p = (i) => {
413
405
  o && i >= 1 && i <= e && o(i);
414
406
  }, x = (i, n) => {
415
- const f = [];
416
- for (let s = i; s <= n; s++) f.push(s);
417
- return f;
407
+ const m = [];
408
+ for (let s = i; s <= n; s++) m.push(s);
409
+ return m;
418
410
  }, P = (() => {
419
411
  if (e <= 0) return [];
420
- const i = x(1, Math.min(a, e)), n = x(
421
- Math.max(e - a + 1, a + 1),
412
+ const i = x(1, Math.min(l, e)), n = x(
413
+ Math.max(e - l + 1, l + 1),
422
414
  e
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
- T.push(w);
427
- s < e - a && T.push("ellipsis-end");
428
- for (const w of n)
429
- T.includes(w) || T.push(w);
415
+ ), m = Math.max(l + 1, t - r), s = Math.min(e - l, t + r), T = [...i];
416
+ if (m > l + 1 && T.push("ellipsis-start"), m <= s)
417
+ for (let S = m; S <= s; S++)
418
+ T.push(S);
419
+ s < e - l && T.push("ellipsis-end");
420
+ for (const S of n)
421
+ T.includes(S) || T.push(S);
430
422
  return T;
431
- })(), u = y === "sm" ? "sm" : y === "lg" ? "lg" : "md", g = y === "sm" ? 16 : y === "lg" ? 24 : 20, S = (i = !1) => {
423
+ })(), u = y === "sm" ? "sm" : y === "lg" ? "lg" : "md", g = y === "sm" ? 16 : y === "lg" ? 24 : 20, w = (i = !1) => {
432
424
  if (!c)
433
425
  return {
434
426
  borderRadius: "8px",
@@ -458,7 +450,7 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
458
450
  opacity: 0.5
459
451
  }
460
452
  };
461
- }, m = () => {
453
+ }, h = () => {
462
454
  if (!c)
463
455
  return {
464
456
  borderRadius: "8px",
@@ -487,7 +479,7 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
487
479
  }
488
480
  };
489
481
  };
490
- return /* @__PURE__ */ E(
482
+ return /* @__PURE__ */ R(
491
483
  I,
492
484
  {
493
485
  sx: {
@@ -497,41 +489,41 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
497
489
  flexWrap: "wrap"
498
490
  },
499
491
  children: [
500
- h && /* @__PURE__ */ l(
501
- k,
492
+ f && /* @__PURE__ */ a(
493
+ H,
502
494
  {
503
495
  size: u,
504
496
  variant: "plain",
505
497
  color: "neutral",
506
498
  onClick: () => p(1),
507
499
  disabled: d || t === 1,
508
- sx: m(),
509
- children: /* @__PURE__ */ l(H, { children: /* @__PURE__ */ l(Ue, { size: g }) })
500
+ sx: h(),
501
+ children: /* @__PURE__ */ a(k, { children: /* @__PURE__ */ a(Be, { size: g }) })
510
502
  }
511
503
  ),
512
- /* @__PURE__ */ l(
513
- k,
504
+ /* @__PURE__ */ a(
505
+ H,
514
506
  {
515
507
  size: u,
516
508
  variant: "plain",
517
509
  color: "neutral",
518
510
  onClick: () => p(t - 1),
519
511
  disabled: d || t === 1,
520
- sx: m(),
521
- children: /* @__PURE__ */ l(H, { children: /* @__PURE__ */ l(Qe, { size: g }) })
512
+ sx: h(),
513
+ children: /* @__PURE__ */ a(k, { children: /* @__PURE__ */ a(Ue, { size: g }) })
522
514
  }
523
515
  ),
524
516
  P.map((i, n) => {
525
517
  if (typeof i == "string" && i.startsWith("ellipsis"))
526
- return /* @__PURE__ */ l(
527
- re,
518
+ return /* @__PURE__ */ a(
519
+ ee,
528
520
  {
529
521
  size: u,
530
522
  variant: "plain",
531
523
  color: "neutral",
532
524
  disabled: !0,
533
525
  sx: {
534
- ...S(!1),
526
+ ...w(!1),
535
527
  cursor: "default",
536
528
  "&.Mui-disabled": c ? {
537
529
  backgroundColor: "transparent",
@@ -546,43 +538,43 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
546
538
  },
547
539
  `${i}-${n}`
548
540
  );
549
- const f = i === t;
550
- return /* @__PURE__ */ l(
551
- re,
541
+ const m = i === t;
542
+ return /* @__PURE__ */ a(
543
+ ee,
552
544
  {
553
545
  size: u,
554
- variant: f ? "solid" : "plain",
546
+ variant: m ? "solid" : "plain",
555
547
  color: "neutral",
556
548
  onClick: () => p(i),
557
549
  disabled: d,
558
- sx: S(f),
550
+ sx: w(m),
559
551
  children: i
560
552
  },
561
553
  i
562
554
  );
563
555
  }),
564
- /* @__PURE__ */ l(
565
- k,
556
+ /* @__PURE__ */ a(
557
+ H,
566
558
  {
567
559
  size: u,
568
560
  variant: "plain",
569
561
  color: "neutral",
570
562
  onClick: () => p(t + 1),
571
563
  disabled: d || t === e,
572
- sx: m(),
573
- children: /* @__PURE__ */ l(H, { children: /* @__PURE__ */ l(He, { size: g }) })
564
+ sx: h(),
565
+ children: /* @__PURE__ */ a(k, { children: /* @__PURE__ */ a($e, { size: g }) })
574
566
  }
575
567
  ),
576
- v && /* @__PURE__ */ l(
577
- k,
568
+ v && /* @__PURE__ */ a(
569
+ H,
578
570
  {
579
571
  size: u,
580
572
  variant: "plain",
581
573
  color: "neutral",
582
574
  onClick: () => p(e),
583
575
  disabled: d || t === e,
584
- sx: m(),
585
- children: /* @__PURE__ */ l(H, { children: /* @__PURE__ */ l($e, { size: g }) })
576
+ sx: h(),
577
+ children: /* @__PURE__ */ a(k, { children: /* @__PURE__ */ a(Fe, { size: g }) })
586
578
  }
587
579
  )
588
580
  ]
@@ -598,77 +590,77 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
598
590
  profileId: t.profileId,
599
591
  profileModel: t.profileModel,
600
592
  points: t.points
601
- })), We = async (e) => {
593
+ })), _e = async (e) => {
602
594
  try {
603
595
  return await e.profile.getOwn().getInfo();
604
596
  } catch {
605
597
  return null;
606
598
  }
607
599
  }, oe = async (e, t) => e.length === 0 ? [] : (await t.topX.getGames({ gameIds: e })).data.map((r) => {
608
- var a;
600
+ var l;
609
601
  return {
610
602
  id: r.id,
611
603
  title: r.title,
612
604
  description: r.description || null,
613
- branding: ((a = r.branding) == null ? void 0 : a.colors) || null
605
+ branding: ((l = r.branding) == null ? void 0 : l.colors) || null
614
606
  };
615
607
  }), ne = async (e, t) => e.length === 0 ? [] : (await t.matchQuiz.getGames({ gameIds: e })).data.map((r) => {
616
- var a;
608
+ var l;
617
609
  return {
618
610
  id: r.id,
619
611
  title: r.title,
620
612
  description: r.description || null,
621
- branding: ((a = r.branding) == null ? void 0 : a.colors) || null
613
+ branding: ((l = r.branding) == null ? void 0 : l.colors) || null
622
614
  };
623
- }), ae = async (e, t) => e.length === 0 ? [] : (await t.loyalty.getTemplates()).data.filter((r) => e.includes(r.id)).map((r) => {
624
- var a;
615
+ }), le = async (e, t) => e.length === 0 ? [] : (await t.loyalty.getTemplates()).data.filter((r) => e.includes(r.id)).map((r) => {
616
+ var l;
625
617
  return {
626
618
  id: r.id,
627
619
  title: r.title || r.name,
628
620
  description: r.description || null,
629
- branding: ((a = r.branding) == null ? void 0 : a.colors) || null
621
+ branding: ((l = r.branding) == null ? void 0 : l.colors) || null
630
622
  };
631
- }), le = async (e, t) => e.length === 0 ? [] : (await t.miniGames.getClassicQuizzes({
623
+ }), ae = async (e, t) => e.length === 0 ? [] : (await t.miniGames.getClassicQuizzes({
632
624
  classicQuizIds: e,
633
625
  limit: e.length
634
626
  })).data.map((r) => {
635
- var a;
627
+ var l;
636
628
  return {
637
629
  id: r.id,
638
630
  title: r.title || r.name,
639
631
  description: r.description || null,
640
- branding: ((a = r.branding) == null ? void 0 : a.colors) || null
632
+ branding: ((l = r.branding) == null ? void 0 : l.colors) || null
641
633
  };
642
634
  }), Xe = async (e, t, o, r) => {
643
- const a = await t.loyalty.getLeaderboardForGame(e, { page: o, limit: r });
635
+ const l = await t.loyalty.getLeaderboardForGame(e, { page: o, limit: r });
644
636
  return {
645
- leaderboard: N(a.data),
646
- pagination: Z(a.meta.pagination)
637
+ leaderboard: N(l.data),
638
+ pagination: Z(l.meta.pagination)
647
639
  };
648
640
  }, Ge = async (e, t, o, r) => {
649
- const a = await t.loyalty.getLeaderboard(
641
+ const l = await t.loyalty.getLeaderboard(
650
642
  e,
651
643
  { page: o, limit: r }
652
644
  );
653
645
  return {
654
- leaderboard: N(a.data),
655
- pagination: Z(a.meta.pagination)
646
+ leaderboard: N(l.data),
647
+ pagination: Z(l.meta.pagination)
656
648
  };
657
- }, W = async (e, t, o, r) => {
658
- const a = await t.miniGames.getLeaderboardForClassicQuizzes({
649
+ }, _ = async (e, t, o, r) => {
650
+ const l = await t.miniGames.getLeaderboardForClassicQuizzes({
659
651
  classicQuizIds: e,
660
652
  page: o,
661
653
  limit: r
662
654
  });
663
655
  return {
664
- leaderboard: N(a.data),
665
- pagination: Z(a.meta.pagination)
656
+ leaderboard: N(l.data),
657
+ pagination: Z(l.meta.pagination)
666
658
  };
667
659
  }, 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);
660
+ const l = e.type.toUpperCase();
661
+ return l === "TOP_X" || l === "MATCH_QUIZ" ? Xe(e.id, t, o, r) : l === "TEMPLATE" ? Ge(e.id, t, o, r) : _([e.id], t, o, r);
670
662
  }, 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;
663
+ const f = o.toUpperCase() === "TEMPLATE" ? { rankType: "TEMPLATE", leaderboardIds: [e] } : { rankType: "GAME", gameType: o.toUpperCase(), leaderboardIds: [e] }, d = (await t.loyalty.getOwnRankings(f, !0)).data[0] ?? null;
672
664
  return d ? {
673
665
  position: d.position,
674
666
  profileId: r,
@@ -676,54 +668,54 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
676
668
  points: d.points
677
669
  } : null;
678
670
  }, Ze = async (e, t, o) => {
679
- const h = (await t.miniGames.getClassicQuizzesUserRanking(
671
+ const f = (await t.miniGames.getClassicQuizzesUserRanking(
680
672
  o,
681
673
  void 0,
682
674
  !0
683
675
  )).data.find((v) => v.classicQuizId === e) ?? null;
684
- return h ? {
685
- position: h.position,
676
+ return f ? {
677
+ position: f.position,
686
678
  profileId: o,
687
679
  profileModel: null,
688
- points: h.points
680
+ points: f.points
689
681
  } : null;
690
682
  }, Ne = (e, t, o) => {
691
683
  const r = e.type.toUpperCase();
692
684
  return r === "TOP_X" || r === "MATCH_QUIZ" || r === "TEMPLATE" ? je(e.id, t, e.type, o) : Ze(e.id, t, o);
693
685
  }, 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(
686
+ const [l, f] = B({}), [v, y] = B(null), [d, c] = B(!1), [C, p] = B(!1), [x, E] = B(
695
687
  null
696
688
  ), [P, u] = B(null);
697
689
  Q(() => {
698
- const m = {
690
+ const h = {
699
691
  topX: e.filter((n) => n.type.toUpperCase() === "TOP_X").map((n) => n.id),
700
692
  matchQuiz: e.filter((n) => n.type.toUpperCase() === "MATCH_QUIZ").map((n) => n.id),
701
693
  template: e.filter((n) => n.type.toUpperCase() === "TEMPLATE").map((n) => n.id),
702
694
  classicQuiz: e.filter((n) => n.type.toUpperCase() === "CLASSIC_QUIZ").map((n) => n.id)
703
695
  }, i = (n) => n.catch(() => []);
704
696
  Promise.all([
705
- i(oe(m.topX, t)),
706
- i(ne(m.matchQuiz, t)),
707
- i(ae(m.template, t)),
708
- i(le(m.classicQuiz, t))
697
+ i(oe(h.topX, t)),
698
+ i(ne(h.matchQuiz, t)),
699
+ i(le(h.template, t)),
700
+ i(ae(h.classicQuiz, t))
709
701
  ]).then((n) => {
710
- const f = {};
702
+ const m = {};
711
703
  n.flat().forEach((s) => {
712
- f[s.id] = s;
713
- }), h(f);
704
+ m[s.id] = s;
705
+ }), f(m);
714
706
  });
715
707
  }, [e, t]), Q(() => {
716
- We(t).then(A);
708
+ _e(t).then(E);
717
709
  }, [t]), Q(() => {
718
710
  if (!o || !x) {
719
711
  u(null);
720
712
  return;
721
713
  }
722
- let m = !1, i;
714
+ let h = !1, i;
723
715
  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;
716
+ const n = e.map((m) => m.id);
717
+ i = t.miniGames.getClassicQuizzesUserRanking(x.id, void 0, !0).then((m) => {
718
+ const T = m.data.find((S) => n.includes(S.classicQuizId)) ?? null;
727
719
  return T ? {
728
720
  position: T.position,
729
721
  profileId: x.id,
@@ -732,77 +724,77 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
732
724
  } : null;
733
725
  });
734
726
  } else {
735
- const n = e.find((f) => f.id === o);
727
+ const n = e.find((m) => m.id === o);
736
728
  if (!n) return;
737
729
  i = Ne(n, t, x.id);
738
730
  }
739
731
  return i.then((n) => {
740
- m || u(n);
732
+ h || u(n);
741
733
  }).catch(() => {
742
- m || u(null);
734
+ h || u(null);
743
735
  }), () => {
744
- m = !0;
736
+ h = !0;
745
737
  };
746
738
  }, [o, e, t, x]), Q(() => {
747
739
  if (!o) return;
748
- let m = !1;
740
+ let h = !1;
749
741
  return c(!0), p(!1), y(null), (async () => {
750
742
  try {
751
743
  const n = e.length > 1 && e.every((b) => b.type.toUpperCase() === "CLASSIC_QUIZ");
752
744
  if (o === $ && n) {
753
- const b = e.map((M) => M.id), R = await W(
745
+ const b = e.map((M) => M.id), A = await _(
754
746
  b,
755
747
  t,
756
748
  1,
757
749
  r
758
750
  );
759
- m || y({
751
+ h || y({
760
752
  id: $,
761
753
  title: $,
762
754
  description: null,
763
755
  branding: null,
764
- ...R
756
+ ...A
765
757
  });
766
758
  return;
767
759
  }
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),
760
+ const m = e.find((b) => b.id === o);
761
+ if (!m) return;
762
+ const s = m.type.toUpperCase(), T = s === "TOP_X" ? oe([o], t) : s === "MATCH_QUIZ" ? ne([o], t) : s === "TEMPLATE" ? le([o], t) : ae([o], t), [S, F] = await Promise.all([
763
+ ie(m, t, 1, r),
772
764
  T.catch(() => [])
773
765
  ]);
774
- if (!m) {
766
+ if (!h) {
775
767
  const b = F[0];
776
768
  y({
777
769
  id: o,
778
770
  title: (b == null ? void 0 : b.title) || o,
779
771
  description: (b == null ? void 0 : b.description) || null,
780
772
  branding: (b == null ? void 0 : b.branding) || null,
781
- ...w
773
+ ...S
782
774
  });
783
775
  }
784
776
  } catch (n) {
785
- console.error("Failed to fetch leaderboard:", n), m || p(!0);
777
+ console.error("Failed to fetch leaderboard:", n), h || p(!0);
786
778
  } finally {
787
- m || c(!1);
779
+ h || c(!1);
788
780
  }
789
781
  })(), () => {
790
- m = !0;
782
+ h = !0;
791
783
  };
792
784
  }, [o, e, t, r]);
793
- const g = me(
794
- async (m) => {
785
+ const g = he(
786
+ async (h) => {
795
787
  if (o) {
796
788
  c(!0);
797
789
  try {
798
790
  let i;
799
791
  if (o === $) {
800
- const n = e.map((f) => f.id);
801
- i = await W(n, t, m, r);
792
+ const n = e.map((m) => m.id);
793
+ i = await _(n, t, h, r);
802
794
  } else {
803
- const n = e.find((f) => f.id === o);
795
+ const n = e.find((m) => m.id === o);
804
796
  if (!n) return;
805
- i = await ie(n, t, m, r);
797
+ i = await ie(n, t, h, r);
806
798
  }
807
799
  y((n) => n ? { ...n, ...i } : null);
808
800
  } catch (i) {
@@ -813,78 +805,78 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
813
805
  }
814
806
  },
815
807
  [o, e, t, r]
816
- ), S = Object.fromEntries(
817
- Object.entries(a).map(([m, i]) => [m, i.title])
808
+ ), w = Object.fromEntries(
809
+ Object.entries(l).map(([h, i]) => [h, i.title])
818
810
  );
819
- return { data: v, entityTitles: S, loading: d, error: C, setPage: g, userRank: P };
820
- }, _ = "ALL", se = ["TOP_X", "MATCH_QUIZ", "TEMPLATE", "CLASSIC_QUIZ"], Ye = (e, t) => {
811
+ return { data: v, entityTitles: w, loading: d, error: C, setPage: g, userRank: P };
812
+ }, O = "ALL", se = ["TOP_X", "MATCH_QUIZ", "TEMPLATE", "CLASSIC_QUIZ"], Ye = (e, t) => {
821
813
  if (!Array.isArray(e) || e.length === 0)
822
814
  return "The 'entities' setting is required and must be a non-empty array.";
823
815
  const o = /* @__PURE__ */ new Set();
824
816
  for (let r = 0; r < e.length; r++) {
825
- const a = e[r];
826
- if (!a || typeof a != "object")
817
+ const l = e[r];
818
+ if (!l || typeof l != "object")
827
819
  return `Entity at index ${r} must be an object with 'id' and 'type' fields.`;
828
- if (!a.id || typeof a.id != "string")
820
+ if (!l.id || typeof l.id != "string")
829
821
  return `Entity at index ${r} is missing a required 'id' string field.`;
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")
822
+ if (o.has(l.id))
823
+ return `Duplicate entity id '${l.id}' found at index ${r}. Each entity must have a unique id.`;
824
+ if (o.add(l.id), !l.type || typeof l.type != "string")
833
825
  return `Entity at index ${r} is missing a required 'type' string field.`;
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).`;
826
+ if (!se.includes(l.type.toUpperCase()))
827
+ return `Entity at index ${r} has an invalid type '${l.type}'. Valid values are: ${se.join(", ")} (case-insensitive).`;
836
828
  }
837
829
  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
- }, qe = ({
830
+ }, Ke = ({
839
831
  entities: e,
840
832
  sdk: t,
841
833
  pageSize: o,
842
834
  rankStyles: r,
843
- showOverallOnly: a = !1,
844
- showHeading: h = !0
835
+ showOverallOnly: l = !1,
836
+ showHeading: f = !0
845
837
  }) => {
846
838
  var b;
847
839
  const { t: v } = X(), y = j(), d = G().surface, c = D(
848
840
  () => Ye(e, o),
849
841
  [e, o]
850
842
  ), C = D(
851
- () => !c && e.length > 1 && e.every((R) => R.type.toUpperCase() === "CLASSIC_QUIZ"),
843
+ () => !c && e.length > 1 && e.every((A) => A.type.toUpperCase() === "CLASSIC_QUIZ"),
852
844
  [e, c]
853
- ), p = a && C, x = C ? _ : ((b = e[0]) == null ? void 0 : b.id) || "", [A, P] = B(x);
845
+ ), p = l && C, x = C ? O : ((b = e[0]) == null ? void 0 : b.id) || "", [E, P] = B(x);
854
846
  Q(() => {
855
- A === _ || e.some((M) => M.id === A) || P(x);
847
+ E === O || e.some((M) => M.id === E) || P(x);
856
848
  }, [e]);
857
- const { data: u, entityTitles: g, loading: S, error: m, setPage: i, userRank: n } = Ve(
849
+ const { data: u, entityTitles: g, loading: w, error: h, setPage: i, userRank: n } = Ve(
858
850
  c ? [] : e,
859
851
  t,
860
- c ? "" : A,
852
+ c ? "" : E,
861
853
  o
862
- ), f = D(() => {
854
+ ), m = D(() => {
863
855
  if (c) return [];
864
- const R = [];
865
- return C && R.push({ id: _, label: v("leaderboard.overall") }), e.forEach((M) => {
866
- R.push({
856
+ const A = [];
857
+ return C && A.push({ id: O, label: v("leaderboard.overall") }), e.forEach((M) => {
858
+ A.push({
867
859
  id: M.id,
868
860
  label: g[M.id] ?? "",
869
861
  type: M.type.toUpperCase()
870
862
  });
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
- return c ? /* @__PURE__ */ l(
874
- J,
863
+ }), A;
864
+ }, [e, C, v, g, c]), s = e.every((A) => g[A.id] !== void 0), T = !c && !p && (e.length > 1 || C) && s, S = (u == null ? void 0 : u.pagination) || null, F = E === O ? v("leaderboard.overall") : (u == null ? void 0 : u.title) || null;
865
+ return c ? /* @__PURE__ */ a(
866
+ te,
875
867
  {
876
868
  variant: "error",
877
869
  title: "Configuration Error",
878
870
  message: c
879
871
  }
880
- ) : m ? /* @__PURE__ */ l(
881
- J,
872
+ ) : h ? /* @__PURE__ */ a(
873
+ te,
882
874
  {
883
875
  variant: "error",
884
876
  title: "Failed to Load Leaderboard",
885
877
  message: "One or more entity IDs could not be found. Please verify the provided IDs and try again."
886
878
  }
887
- ) : /* @__PURE__ */ E(
879
+ ) : /* @__PURE__ */ R(
888
880
  I,
889
881
  {
890
882
  sx: {
@@ -895,79 +887,79 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
895
887
  padding: y.md
896
888
  },
897
889
  children: [
898
- T && /* @__PURE__ */ l(
899
- _e,
890
+ T && /* @__PURE__ */ a(
891
+ Oe,
900
892
  {
901
- options: f,
902
- selectedId: A,
893
+ options: m,
894
+ selectedId: E,
903
895
  onChange: P
904
896
  }
905
897
  ),
906
- /* @__PURE__ */ l(
898
+ /* @__PURE__ */ a(
907
899
  De,
908
900
  {
909
- leaderboard: S ? null : (u == null ? void 0 : u.leaderboard) || null,
910
- userRank: S ? null : n,
911
- showHeading: h && !T,
901
+ leaderboard: w ? null : (u == null ? void 0 : u.leaderboard) || null,
902
+ userRank: w ? null : n,
903
+ showHeading: f && !T,
912
904
  title: F,
913
905
  description: (u == null ? void 0 : u.description) || null,
914
906
  brandingColors: (u == null ? void 0 : u.branding) || null,
915
907
  rankStyles: r
916
908
  }
917
909
  ),
918
- !S && w && w.totalPages > 1 && /* @__PURE__ */ l(
919
- Oe,
910
+ !w && S && S.totalPages > 1 && /* @__PURE__ */ a(
911
+ We,
920
912
  {
921
- count: w.totalPages,
922
- page: w.currentPage,
913
+ count: S.totalPages,
914
+ page: S.currentPage,
923
915
  onChange: i
924
916
  }
925
917
  )
926
918
  ]
927
919
  }
928
920
  );
929
- }, Ke = (e) => {
921
+ }, qe = (e) => {
930
922
  var P;
931
- const [t, o] = z.useState(!1), [r, a] = z.useState(!1), h = ye(e.language), v = z.useRef(
923
+ const [t, o] = z.useState(!1), [r, l] = z.useState(!1), f = Se(e.language), v = z.useRef(
932
924
  `leaderboard-shadow-root-${Math.random().toString(36).substring(2, 11)}`
933
925
  ), y = z.useRef(null), d = z.useRef(null), c = z.useRef(null), [C, p] = z.useState(null);
934
926
  z.useEffect(() => {
935
- xe(e.language || "en").finally(() => a(!0));
927
+ Re(e.language || "en").finally(() => l(!0));
936
928
  }, [e.language]), z.useEffect(() => {
937
929
  if (!y.current) return;
938
930
  y.current.shadowRoot ? (d.current = y.current.shadowRoot, c.current = d.current.getElementById(
939
931
  v.current
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);
932
+ ), 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)), Ee(c.current, f);
933
+ const u = Ae("leaderboard", f);
942
934
  return p(
943
- (g) => (g == null ? void 0 : g.key) === u ? g : ve(
935
+ (g) => (g == null ? void 0 : g.key) === u ? g : Le(
944
936
  "leaderboard",
945
937
  d.current,
946
- h
938
+ f
947
939
  )
948
940
  ), o(!0), () => {
949
941
  o(!1);
950
942
  };
951
- }, [h]);
952
- const x = /* @__PURE__ */ l(I, { ref: y, lang: e.language || "en" }), A = t && r && c.current && C ? Ae(
943
+ }, [f]);
944
+ const x = /* @__PURE__ */ a(I, { ref: y, lang: e.language || "en" }), E = t && r && c.current && C ? He(
953
945
  // Keyed on the cache, not on `direction`: it must change in the same
954
946
  // render that adopts the new cache, or CssVarsProvider writes its CSS
955
947
  // variables into the outgoing cache and never repeats.
956
- /* @__PURE__ */ l(Te, { value: C, children: /* @__PURE__ */ l(Pe, { containerRef: y, children: /* @__PURE__ */ l(
957
- Se,
948
+ /* @__PURE__ */ a(Qe, { value: C, children: /* @__PURE__ */ a(Ie, { containerRef: y, children: /* @__PURE__ */ a(
949
+ Me,
958
950
  {
959
951
  customTheme: e.themeOptions,
960
952
  mode: (P = e.themeOptions) == null ? void 0 : P.mode,
961
953
  shadowRootElement: c.current,
962
- direction: h,
963
- children: /* @__PURE__ */ l(
964
- we,
954
+ direction: f,
955
+ children: /* @__PURE__ */ a(
956
+ ze,
965
957
  {
966
958
  shadowRootElement: c.current,
967
959
  leadPhoneCountryCode: null,
968
960
  language: e.language,
969
961
  optionsLayout: null,
970
- direction: h,
962
+ direction: f,
971
963
  children: e.children
972
964
  }
973
965
  )
@@ -975,11 +967,11 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
975
967
  ) }) }, C.key),
976
968
  c.current
977
969
  ) : null;
978
- return /* @__PURE__ */ E(ce, { children: [
970
+ return /* @__PURE__ */ R(ce, { children: [
979
971
  x,
980
- A
972
+ E
981
973
  ] });
982
- }, Je = (e) => /* @__PURE__ */ l(Ke, { ...e, children: /* @__PURE__ */ l(qe, { ...e }) }), xt = Je;
974
+ }, Je = (e) => /* @__PURE__ */ a(qe, { ...e, children: /* @__PURE__ */ a(Ke, { ...e }) }), ut = Je;
983
975
  export {
984
- xt as Leaderboard
976
+ ut as Leaderboard
985
977
  };