fansunited-widgets-cdn 0.0.85 → 0.0.86-RC1

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 (75) hide show
  1. package/chunks/Alert-CuOsmojH.js +149 -0
  2. package/chunks/AspectRatio-D3Sgxj7p.js +125 -0
  3. package/chunks/Avatar-BTsEKfhc.js +186 -0
  4. package/chunks/Button-BV7YIFkS.js +858 -0
  5. package/chunks/Card-DRIT0wtY.js +129 -0
  6. package/chunks/CardContent-CD-WZh1l.js +60 -0
  7. package/chunks/ChevronRight-BrCKlr3T.js +11 -0
  8. package/chunks/Chip-6HLNTHMI.js +281 -0
  9. package/chunks/ClassicQuizWrapper-t04e9_6c.js +4883 -0
  10. package/chunks/CollectLeadForm-DtmR2Vuf-B_3JkHJC.js +1560 -0
  11. package/chunks/CollectLeadWrapper-CVAVswua.js +1294 -0
  12. package/chunks/DialogActions-C5kAgHal.js +45 -0
  13. package/chunks/DialogContent-MIXff4nd.js +60 -0
  14. package/chunks/EitherOrById-CAo8gPjm.js +1496 -0
  15. package/chunks/EitherOrPreviewWrapper-DFi2bviS.js +47 -0
  16. package/chunks/Error-DhQL89pn-BwTV1meb.js +418 -0
  17. package/chunks/EventGameWrapper-BxyLL3eA.js +7633 -0
  18. package/chunks/Grid-Dpv_ZL23.js +279 -0
  19. package/chunks/IconButton-Lt9Xks7c.js +207 -0
  20. package/chunks/Link-DLuj1USf.js +228 -0
  21. package/chunks/List-DLPlZGTP.js +397 -0
  22. package/chunks/ListItemDecorator-CE2eQLip.js +1882 -0
  23. package/chunks/MatchPredictionContainer-Ct6gXvLw.js +751 -0
  24. package/chunks/MatchQuizWrapper-Fu6RfWVn.js +11046 -0
  25. package/chunks/ModalDialog-Ci3hulZA.js +619 -0
  26. package/chunks/NotFoundSkeleton-BYJTzYJR-Be3R34nS.js +2764 -0
  27. package/chunks/OverlayLeadAfterCollection-DnqztPJ5-CpELr0AC.js +896 -0
  28. package/chunks/OverlayScoreStateSkeleton-C9FUhcnd-DMFELrvA.js +146 -0
  29. package/chunks/PersonalityQuizWrapper-MpUK4n3Y.js +34374 -0
  30. package/chunks/PlayerOfTheMatch-D4vuR7pz.js +1406 -0
  31. package/chunks/PollWrapper-CzKj8xxE.js +4198 -0
  32. package/chunks/Portal-BWqqFvVm-TuHZWjxn.js +12717 -0
  33. package/chunks/Portal-DA1mxzSo.js +41 -0
  34. package/chunks/PreviewQuizById-WWS_LyJR.js +4864 -0
  35. package/chunks/Select-p_cHpLhi.js +3418 -0
  36. package/chunks/Sheet-BaCzogZK.js +167 -0
  37. package/chunks/Snackbar-DHxnbCA3.js +358 -0
  38. package/chunks/Stack-Dgf2LXN0.js +117 -0
  39. package/chunks/Tabs-CSu_cWNi.js +784 -0
  40. package/chunks/TeamNextMatchPrediction-C7HilNqW.js +6 -0
  41. package/chunks/Tutorial-DFNZxmAx.js +427 -0
  42. package/chunks/createLucideIcon-B6NxpYkb.js +79 -0
  43. package/chunks/createSvgIcon-7h7XC877.js +119 -0
  44. package/chunks/createSvgIcon-DVA0KIUd.js +2490 -0
  45. package/chunks/dataAttributeParser-CF9vxaVN.js +28 -0
  46. package/chunks/default-quiz-bg-CTzaADn7.js +4 -0
  47. package/chunks/getReactElementRef-BD-S8A24.js +25 -0
  48. package/chunks/index-24AwmTVJ.js +85 -0
  49. package/chunks/index-3vJS8JzK.js +63 -0
  50. package/chunks/index-BSD7mvEU.js +57 -0
  51. package/chunks/index-BU6iona7.js +57 -0
  52. package/chunks/index-BqCHiyI6.js +59 -0
  53. package/chunks/index-C5qRf4TV.js +20 -0
  54. package/chunks/index-C9MpfjqV.js +35 -0
  55. package/chunks/index-CMmQs5A5.js +56 -0
  56. package/chunks/index-CicEY2Jv.js +5 -0
  57. package/chunks/index-DNeawo0R.js +17 -0
  58. package/chunks/index-DePIySlY.js +29 -0
  59. package/chunks/index-DoRYU_1L.js +41 -0
  60. package/chunks/index-DvgG9XJj.js +20 -0
  61. package/chunks/index-QpZE-92Y.js +33 -0
  62. package/chunks/index-rgFj976B.js +17 -0
  63. package/chunks/index-tzsdMoo-.js +16 -0
  64. package/chunks/index.es-CHqz6mjo.js +6162 -0
  65. package/chunks/init-BEkECL0v.js +32 -0
  66. package/chunks/main-XP7dqk6g.js +39843 -0
  67. package/chunks/resolveProps-BfYZubfk.js +37 -0
  68. package/chunks/users-D_xgC4iQ.js +16 -0
  69. package/chunks/variantColorInheritance-DI3wUohX.js +28 -0
  70. package/fu-widgets-loader.es.js +76 -0
  71. package/fu-widgets-loader.js +1 -0
  72. package/fu-widgets.es.js +4 -0
  73. package/fu-widgets.iife.js +621 -682
  74. package/manifest.json +84 -0
  75. package/package.json +9 -2
@@ -0,0 +1,1496 @@
1
+ import { r, v as ue, _ as be, w as R, x as me, y as xe, j as e, z as oe, D as ge, E as Oe, F as Fe, G as _e, B as C, t as c, a as De, u as ve, C as Ae, H as $e, e as Ue, f as He, o as Ke } from "./main-XP7dqk6g.js";
2
+ import { u as Ve } from "./index-24AwmTVJ.js";
3
+ import { C as Q } from "./Card-DRIT0wtY.js";
4
+ import { u as We, T as p, B as Ce } from "./Button-BV7YIFkS.js";
5
+ import { b as Be, c as Re, C as qe, M as Je, a as Ze } from "./ModalDialog-Ci3hulZA.js";
6
+ import { S as Ye, I as Qe } from "./IconButton-Lt9Xks7c.js";
7
+ import { C as Xe, F as J, a as Z, A as eo, b as oo, L as lo, c as ze, d as ao } from "./ListItemDecorator-CE2eQLip.js";
8
+ import { g as no, D as to } from "./DialogContent-MIXff4nd.js";
9
+ import { a as so, C as ro } from "./CardContent-CD-WZh1l.js";
10
+ import { D as io } from "./DialogActions-C5kAgHal.js";
11
+ import { u as Ge, I as ae, S as fe, a as je, L as co } from "./Select-p_cHpLhi.js";
12
+ import { c as se } from "./createSvgIcon-DVA0KIUd.js";
13
+ import { I as ho, e as U, a as Y, C as pe, g as po, F as uo, b as E, c as bo, d as mo, G as H, T as xo } from "./Tutorial-DFNZxmAx.js";
14
+ import { A as go } from "./Alert-CuOsmojH.js";
15
+ import { S as B } from "./Stack-Dgf2LXN0.js";
16
+ import { A as ke } from "./AspectRatio-D3Sgxj7p.js";
17
+ import { c as re } from "./createLucideIcon-B6NxpYkb.js";
18
+ import { g as vo, S as Me } from "./Sheet-BaCzogZK.js";
19
+ const Co = ["component", "children", "variant", "color", "level", "slots", "slotProps"], yo = (l) => {
20
+ const {
21
+ level: a,
22
+ color: n,
23
+ variant: s
24
+ } = l, i = {
25
+ root: ["root", a, n && `color${oe(n)}`, s && `variant${oe(s)}`]
26
+ };
27
+ return ge(i, no, {});
28
+ }, So = xe("h2", {
29
+ name: "JoyDialogTitle",
30
+ slot: "Root",
31
+ overridesResolver: (l, a) => a.root
32
+ })(({
33
+ theme: l,
34
+ ownerState: a
35
+ }) => {
36
+ var n, s;
37
+ const i = a.level !== "inherit" ? (n = l.typography[a.level]) == null ? void 0 : n.lineHeight : "1";
38
+ return R({
39
+ "--Icon-fontSize": `calc(1em * ${i})`
40
+ }, a.color && {
41
+ "--Icon-color": "currentColor"
42
+ }, {
43
+ display: "flex",
44
+ gap: "clamp(4px, 0.375em, 0.75rem)",
45
+ margin: "var(--unstable_DialogTitle-margin, 0px)"
46
+ }, a.level && a.level !== "inherit" && l.typography[a.level], {
47
+ color: "inherit"
48
+ }, a.variant && R({
49
+ borderRadius: l.vars.radius.xs,
50
+ paddingBlock: "min(0.1em, 4px)",
51
+ paddingInline: "0.25em"
52
+ }, (s = l.variants[a.variant]) == null ? void 0 : s[a.color]), {
53
+ [`.${so.root} > &`]: {
54
+ "--unstable_DialogTitle-margin": "var(--Card-padding) 0"
55
+ }
56
+ });
57
+ }), fo = {
58
+ sm: "title-md",
59
+ md: "title-lg",
60
+ lg: "h4"
61
+ }, jo = /* @__PURE__ */ r.forwardRef(function(a, n) {
62
+ const s = ue({
63
+ props: a,
64
+ name: "JoyDialogTitle"
65
+ }), i = r.useContext(Be), d = r.useContext(Re), {
66
+ component: t = "h2",
67
+ children: o,
68
+ variant: u,
69
+ color: x,
70
+ level: T = fo[i || "md"],
71
+ slots: h = {},
72
+ slotProps: y = {}
73
+ } = s, L = be(s, Co), S = a.color || (u ? x ?? "neutral" : x), b = R({}, L, {
74
+ component: t,
75
+ slots: h,
76
+ slotProps: y
77
+ }), P = R({}, s, {
78
+ component: t,
79
+ color: S,
80
+ variant: u,
81
+ level: T
82
+ }), G = yo(P), [k, I] = me("root", {
83
+ ref: n,
84
+ className: G.root,
85
+ elementType: So,
86
+ externalForwardedProps: b,
87
+ ownerState: P,
88
+ additionalProps: {
89
+ id: d == null ? void 0 : d.labelledBy
90
+ }
91
+ });
92
+ return /* @__PURE__ */ e.jsx(k, R({}, I, {
93
+ children: o
94
+ }));
95
+ }), Mo = ["className", "children", "component", "inset", "orientation", "role", "slots", "slotProps"], To = (l) => {
96
+ const {
97
+ orientation: a,
98
+ inset: n
99
+ } = l, s = {
100
+ root: ["root", a, n && `inset${oe(n)}`]
101
+ };
102
+ return ge(s, vo, {});
103
+ }, Lo = xe("hr", {
104
+ name: "JoyDivider",
105
+ slot: "Root",
106
+ overridesResolver: (l, a) => a.root
107
+ })(({
108
+ theme: l,
109
+ ownerState: a
110
+ }) => R({
111
+ "--Divider-thickness": "1px",
112
+ "--Divider-lineColor": l.vars.palette.divider
113
+ }, a.inset === "none" && {
114
+ "--_Divider-inset": "0px"
115
+ }, a.inset === "context" && {
116
+ "--_Divider-inset": "var(--Divider-inset, 0px)"
117
+ }, {
118
+ margin: "initial",
119
+ // reset margin for `hr` tag
120
+ marginInline: a.orientation === "vertical" ? "initial" : "var(--_Divider-inset)",
121
+ marginBlock: a.orientation === "vertical" ? "var(--_Divider-inset)" : "initial",
122
+ position: "relative",
123
+ alignSelf: "stretch",
124
+ flexShrink: 0
125
+ }, a.children ? R({
126
+ "--Divider-gap": l.spacing(1),
127
+ "--Divider-childPosition": "50%",
128
+ display: "flex",
129
+ flexDirection: a.orientation === "vertical" ? "column" : "row",
130
+ alignItems: "center",
131
+ whiteSpace: "nowrap",
132
+ textAlign: "center",
133
+ border: 0
134
+ }, l.typography["body-sm"], {
135
+ "&::before, &::after": {
136
+ position: "relative",
137
+ inlineSize: a.orientation === "vertical" ? "var(--Divider-thickness)" : "initial",
138
+ blockSize: a.orientation === "vertical" ? "initial" : "var(--Divider-thickness)",
139
+ backgroundColor: "var(--Divider-lineColor)",
140
+ // use logical size + background is better than border because they work with gradient.
141
+ content: '""'
142
+ },
143
+ "&::before": {
144
+ marginInlineEnd: a.orientation === "vertical" ? "initial" : "min(var(--Divider-childPosition) * 999, var(--Divider-gap))",
145
+ marginBlockEnd: a.orientation === "vertical" ? "min(var(--Divider-childPosition) * 999, var(--Divider-gap))" : "initial",
146
+ flexBasis: "var(--Divider-childPosition)"
147
+ },
148
+ "&::after": {
149
+ marginInlineStart: a.orientation === "vertical" ? "initial" : "min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))",
150
+ marginBlockStart: a.orientation === "vertical" ? "min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))" : "initial",
151
+ flexBasis: "calc(100% - var(--Divider-childPosition))"
152
+ }
153
+ }) : {
154
+ border: "none",
155
+ // reset the border for `hr` tag
156
+ listStyle: "none",
157
+ backgroundColor: "var(--Divider-lineColor)",
158
+ // use logical size + background is better than border because they work with gradient.
159
+ inlineSize: a.orientation === "vertical" ? "var(--Divider-thickness)" : "initial",
160
+ blockSize: a.orientation === "vertical" ? "initial" : "var(--Divider-thickness)"
161
+ })), Ee = /* @__PURE__ */ r.forwardRef(function(a, n) {
162
+ const s = ue({
163
+ props: a,
164
+ name: "JoyDivider"
165
+ }), {
166
+ className: i,
167
+ children: d,
168
+ component: t = d != null ? "div" : "hr",
169
+ inset: o,
170
+ orientation: u = "horizontal",
171
+ role: x = t !== "hr" ? "separator" : void 0,
172
+ slots: T = {},
173
+ slotProps: h = {}
174
+ } = s, y = be(s, Mo), L = R({}, s, {
175
+ inset: o,
176
+ role: x,
177
+ orientation: u,
178
+ component: t
179
+ }), S = To(L), b = R({}, y, {
180
+ component: t,
181
+ slots: T,
182
+ slotProps: h
183
+ }), [P, G] = me("root", {
184
+ ref: n,
185
+ className: Oe(S.root, i),
186
+ elementType: Lo,
187
+ externalForwardedProps: b,
188
+ ownerState: L,
189
+ additionalProps: R({
190
+ as: t,
191
+ role: x
192
+ }, x === "separator" && u === "vertical" && {
193
+ // The implicit aria-orientation of separator is 'horizontal'
194
+ // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/separator_role
195
+ "aria-orientation": "vertical"
196
+ })
197
+ });
198
+ return /* @__PURE__ */ e.jsx(P, R({}, G, {
199
+ children: d
200
+ }));
201
+ });
202
+ Ee.muiName = "Divider";
203
+ function Po(l) {
204
+ return Fe("MuiModalClose", l);
205
+ }
206
+ _e("MuiModalClose", ["root", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "variantPlain", "variantOutlined", "variantSoft", "variantSolid", "sizeSm", "sizeMd", "sizeLg"]);
207
+ var Te;
208
+ const Io = ["component", "color", "variant", "size", "onClick", "slots", "slotProps"], No = (l) => {
209
+ const {
210
+ variant: a,
211
+ color: n,
212
+ disabled: s,
213
+ focusVisible: i,
214
+ size: d
215
+ } = l, t = {
216
+ root: ["root", s && "disabled", i && "focusVisible", a && `variant${oe(a)}`, n && `color${oe(n)}`, d && `size${oe(d)}`]
217
+ };
218
+ return ge(t, Po, {});
219
+ }, Do = xe(Ye, {
220
+ name: "JoyModalClose",
221
+ slot: "Root",
222
+ overridesResolver: (l, a) => a.root
223
+ })(({
224
+ ownerState: l,
225
+ theme: a
226
+ }) => {
227
+ var n;
228
+ return R({}, l.size === "sm" && {
229
+ "--IconButton-size": "1.75rem"
230
+ }, l.size === "md" && {
231
+ "--IconButton-size": "2rem"
232
+ }, l.size === "lg" && {
233
+ "--IconButton-size": "2.25rem"
234
+ }, {
235
+ position: "absolute",
236
+ zIndex: 1,
237
+ // stay on top of the title in case it is positioned relatively
238
+ top: "var(--ModalClose-inset, 0.625rem)",
239
+ right: "var(--ModalClose-inset, 0.625rem)",
240
+ borderRadius: `var(--ModalClose-radius, ${a.vars.radius.sm})`
241
+ }, !((n = a.variants[l.variant]) != null && (n = n[l.color]) != null && n.backgroundColor) && {
242
+ color: a.vars.palette.text.secondary
243
+ });
244
+ }), Ao = {
245
+ plain: "plain",
246
+ outlined: "plain",
247
+ soft: "soft",
248
+ solid: "solid"
249
+ }, Bo = /* @__PURE__ */ r.forwardRef(function(a, n) {
250
+ var s, i, d, t, o, u;
251
+ const x = ue({
252
+ props: a,
253
+ name: "JoyModalClose"
254
+ }), {
255
+ component: T = "button",
256
+ color: h = "neutral",
257
+ variant: y = "plain",
258
+ size: L = "md",
259
+ onClick: S,
260
+ slots: b = {},
261
+ slotProps: P = {}
262
+ } = x, G = be(x, Io), k = r.useContext(qe), I = r.useContext(Re), m = (s = (i = a.variant) != null ? i : Ao[I == null ? void 0 : I.variant]) != null ? s : y, f = (d = (t = a.color) != null ? t : I == null ? void 0 : I.color) != null ? d : h, j = r.useContext(Be), M = (o = (u = a.size) != null ? u : j) != null ? o : L, {
263
+ focusVisible: z,
264
+ getRootProps: K
265
+ } = We(R({}, x, {
266
+ rootRef: n
267
+ })), W = R({}, x, {
268
+ color: f,
269
+ component: T,
270
+ variant: m,
271
+ size: M,
272
+ focusVisible: z
273
+ }), q = No(W), [V, le] = me("root", {
274
+ ref: n,
275
+ elementType: Do,
276
+ getSlotProps: K,
277
+ externalForwardedProps: R({
278
+ onClick: (X) => {
279
+ k == null || k(X, "closeClick"), S == null || S(X);
280
+ }
281
+ }, G, {
282
+ component: T,
283
+ slots: b,
284
+ slotProps: P
285
+ }),
286
+ className: q.root,
287
+ ownerState: W
288
+ });
289
+ return /* @__PURE__ */ e.jsx(V, R({}, le, {
290
+ children: Te || (Te = /* @__PURE__ */ e.jsx(Xe, {}))
291
+ }));
292
+ });
293
+ /**
294
+ * @license lucide-react v0.474.0 - ISC
295
+ *
296
+ * This source code is licensed under the ISC license.
297
+ * See the LICENSE file in the root directory of this source tree.
298
+ */
299
+ const Ro = [
300
+ [
301
+ "path",
302
+ {
303
+ d: "M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",
304
+ key: "1vdc57"
305
+ }
306
+ ],
307
+ ["path", { d: "M5 21h14", key: "11awu3" }]
308
+ ], Le = re("Crown", Ro);
309
+ /**
310
+ * @license lucide-react v0.474.0 - ISC
311
+ *
312
+ * This source code is licensed under the ISC license.
313
+ * See the LICENSE file in the root directory of this source tree.
314
+ */
315
+ const zo = [
316
+ [
317
+ "path",
318
+ {
319
+ d: "M7.21 15 2.66 7.14a2 2 0 0 1 .13-2.2L4.4 2.8A2 2 0 0 1 6 2h12a2 2 0 0 1 1.6.8l1.6 2.14a2 2 0 0 1 .14 2.2L16.79 15",
320
+ key: "143lza"
321
+ }
322
+ ],
323
+ ["path", { d: "M11 12 5.12 2.2", key: "qhuxz6" }],
324
+ ["path", { d: "m13 12 5.88-9.8", key: "hbye0f" }],
325
+ ["path", { d: "M8 7h8", key: "i86dvs" }],
326
+ ["circle", { cx: "12", cy: "17", r: "5", key: "qbz8iq" }],
327
+ ["path", { d: "M12 18v-2h-.5", key: "fawc4q" }]
328
+ ], Go = re("Medal", zo);
329
+ /**
330
+ * @license lucide-react v0.474.0 - ISC
331
+ *
332
+ * This source code is licensed under the ISC license.
333
+ * See the LICENSE file in the root directory of this source tree.
334
+ */
335
+ const ko = [
336
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
337
+ ["circle", { cx: "12", cy: "12", r: "6", key: "1vlfrh" }],
338
+ ["circle", { cx: "12", cy: "12", r: "2", key: "1c9p78" }]
339
+ ], Eo = re("Target", ko);
340
+ /**
341
+ * @license lucide-react v0.474.0 - ISC
342
+ *
343
+ * This source code is licensed under the ISC license.
344
+ * See the LICENSE file in the root directory of this source tree.
345
+ */
346
+ const wo = [
347
+ ["line", { x1: "10", x2: "14", y1: "2", y2: "2", key: "14vaq8" }],
348
+ ["line", { x1: "12", x2: "15", y1: "14", y2: "11", key: "17fdiu" }],
349
+ ["circle", { cx: "12", cy: "14", r: "8", key: "1e1u0o" }]
350
+ ], Oo = re("Timer", wo);
351
+ /**
352
+ * @license lucide-react v0.474.0 - ISC
353
+ *
354
+ * This source code is licensed under the ISC license.
355
+ * See the LICENSE file in the root directory of this source tree.
356
+ */
357
+ const Fo = [
358
+ ["path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6", key: "17hqa7" }],
359
+ ["path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18", key: "lmptdp" }],
360
+ ["path", { d: "M4 22h16", key: "57wxv0" }],
361
+ ["path", { d: "M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22", key: "1nw9bq" }],
362
+ ["path", { d: "M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22", key: "1np0yb" }],
363
+ ["path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z", key: "u46fv3" }]
364
+ ], _o = re("Trophy", Fo), $o = (l) => l ? l.some((a) => a.toLowerCase() === "prize") : !1, ne = {
365
+ mainCard: {
366
+ my: 2,
367
+ p: 2,
368
+ textAlign: "center",
369
+ background: "linear-gradient(135deg, var(--joy-palette-primary-400), var(--joy-palette-primary-600), var(--joy-palette-primary-700))",
370
+ position: "relative",
371
+ overflow: "hidden",
372
+ borderRadius: "sm"
373
+ },
374
+ mainCardOverlay: {
375
+ position: "absolute",
376
+ top: 0,
377
+ left: 0,
378
+ right: 0,
379
+ bottom: 0,
380
+ background: "linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.2) 100%)",
381
+ zIndex: 0
382
+ },
383
+ contentWrapper: {
384
+ position: "relative",
385
+ zIndex: 1
386
+ },
387
+ title: {
388
+ color: "white",
389
+ textShadow: "0 2px 7px rgba(0,0,0,0.2)",
390
+ mb: 1
391
+ },
392
+ description: {
393
+ color: "white",
394
+ opacity: 0.9
395
+ }
396
+ }, Uo = c("prize.title"), Ho = c("prize.description"), Ko = c("prize.cta"), Vo = c("prize.termsAndConditions"), Wo = c("common.close"), qo = ({ title: l = Uo, description: a = Ho, cta: n = Ko, rules: s = "" }) => {
397
+ const [i, d] = r.useState(!1), t = Ge(), o = Ve(t.breakpoints.down("sm"));
398
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
399
+ /* @__PURE__ */ e.jsxs(Q, { variant: "soft", color: "success", sx: ne.mainCard, children: [
400
+ /* @__PURE__ */ e.jsx(C, { style: ne.mainCardOverlay }),
401
+ /* @__PURE__ */ e.jsxs(C, { sx: ne.contentWrapper, children: [
402
+ /* @__PURE__ */ e.jsx(p, { level: "h4", sx: ne.title, children: l }),
403
+ /* @__PURE__ */ e.jsx(p, { level: "body-sm", sx: ne.description, children: a }),
404
+ /* @__PURE__ */ e.jsx(p, { level: "body-xs", textColor: "white", mt: 2, sx: { cursor: "pointer" }, onClick: () => d(!0), children: n })
405
+ ] })
406
+ ] }),
407
+ /* @__PURE__ */ e.jsx(Je, { open: i, onClose: () => d(!1), children: /* @__PURE__ */ e.jsxs(Ze, { layout: o ? "fullscreen" : "center", children: [
408
+ /* @__PURE__ */ e.jsx(Bo, {}),
409
+ /* @__PURE__ */ e.jsx(jo, { children: Vo }),
410
+ /* @__PURE__ */ e.jsx(to, { children: /* @__PURE__ */ e.jsx("div", { dangerouslySetInnerHTML: { __html: s } }) }),
411
+ /* @__PURE__ */ e.jsx(io, { children: /* @__PURE__ */ e.jsx(Ce, { variant: "soft", color: "neutral", onClick: () => d(!1), children: Wo }) })
412
+ ] }) })
413
+ ] });
414
+ }, ce = [
415
+ { code: "AD", label: "Andorra", phone: "376" },
416
+ {
417
+ code: "AE",
418
+ label: "United Arab Emirates",
419
+ phone: "971"
420
+ },
421
+ { code: "AF", label: "Afghanistan", phone: "93" },
422
+ {
423
+ code: "AG",
424
+ label: "Antigua and Barbuda",
425
+ phone: "1-268"
426
+ },
427
+ { code: "AI", label: "Anguilla", phone: "1-264" },
428
+ { code: "AL", label: "Albania", phone: "355" },
429
+ { code: "AM", label: "Armenia", phone: "374" },
430
+ { code: "AO", label: "Angola", phone: "244" },
431
+ { code: "AQ", label: "Antarctica", phone: "672" },
432
+ { code: "AR", label: "Argentina", phone: "54" },
433
+ { code: "AS", label: "American Samoa", phone: "1-684" },
434
+ { code: "AT", label: "Austria", phone: "43" },
435
+ {
436
+ code: "AU",
437
+ label: "Australia",
438
+ phone: "61",
439
+ suggested: !0
440
+ },
441
+ { code: "AW", label: "Aruba", phone: "297" },
442
+ { code: "AX", label: "Alland Islands", phone: "358" },
443
+ { code: "AZ", label: "Azerbaijan", phone: "994" },
444
+ {
445
+ code: "BA",
446
+ label: "Bosnia and Herzegovina",
447
+ phone: "387"
448
+ },
449
+ { code: "BB", label: "Barbados", phone: "1-246" },
450
+ { code: "BD", label: "Bangladesh", phone: "880" },
451
+ { code: "BE", label: "Belgium", phone: "32" },
452
+ { code: "BF", label: "Burkina Faso", phone: "226" },
453
+ { code: "BG", label: "Bulgaria", phone: "359" },
454
+ { code: "BH", label: "Bahrain", phone: "973" },
455
+ { code: "BI", label: "Burundi", phone: "257" },
456
+ { code: "BJ", label: "Benin", phone: "229" },
457
+ { code: "BL", label: "Saint Barthelemy", phone: "590" },
458
+ { code: "BM", label: "Bermuda", phone: "1-441" },
459
+ { code: "BN", label: "Brunei Darussalam", phone: "673" },
460
+ { code: "BO", label: "Bolivia", phone: "591" },
461
+ { code: "BR", label: "Brazil", phone: "55" },
462
+ { code: "BS", label: "Bahamas", phone: "1-242" },
463
+ { code: "BT", label: "Bhutan", phone: "975" },
464
+ { code: "BV", label: "Bouvet Island", phone: "47" },
465
+ { code: "BW", label: "Botswana", phone: "267" },
466
+ { code: "BY", label: "Belarus", phone: "375" },
467
+ { code: "BZ", label: "Belize", phone: "501" },
468
+ {
469
+ code: "CA",
470
+ label: "Canada",
471
+ phone: "1",
472
+ suggested: !0
473
+ },
474
+ {
475
+ code: "CC",
476
+ label: "Cocos (Keeling) Islands",
477
+ phone: "61"
478
+ },
479
+ {
480
+ code: "CD",
481
+ label: "Congo, Democratic Republic of the",
482
+ phone: "243"
483
+ },
484
+ {
485
+ code: "CF",
486
+ label: "Central African Republic",
487
+ phone: "236"
488
+ },
489
+ {
490
+ code: "CG",
491
+ label: "Congo, Republic of the",
492
+ phone: "242"
493
+ },
494
+ { code: "CH", label: "Switzerland", phone: "41" },
495
+ { code: "CI", label: "Cote d'Ivoire", phone: "225" },
496
+ { code: "CK", label: "Cook Islands", phone: "682" },
497
+ { code: "CL", label: "Chile", phone: "56" },
498
+ { code: "CM", label: "Cameroon", phone: "237" },
499
+ { code: "CN", label: "China", phone: "86" },
500
+ { code: "CO", label: "Colombia", phone: "57" },
501
+ { code: "CR", label: "Costa Rica", phone: "506" },
502
+ { code: "CU", label: "Cuba", phone: "53" },
503
+ { code: "CV", label: "Cape Verde", phone: "238" },
504
+ { code: "CW", label: "Curacao", phone: "599" },
505
+ { code: "CX", label: "Christmas Island", phone: "61" },
506
+ { code: "CY", label: "Cyprus", phone: "357" },
507
+ { code: "CZ", label: "Czech Republic", phone: "420" },
508
+ {
509
+ code: "DE",
510
+ label: "Germany",
511
+ phone: "49",
512
+ suggested: !0
513
+ },
514
+ { code: "DJ", label: "Djibouti", phone: "253" },
515
+ { code: "DK", label: "Denmark", phone: "45" },
516
+ { code: "DM", label: "Dominica", phone: "1-767" },
517
+ {
518
+ code: "DO",
519
+ label: "Dominican Republic",
520
+ phone: "1-809"
521
+ },
522
+ { code: "DZ", label: "Algeria", phone: "213" },
523
+ { code: "EC", label: "Ecuador", phone: "593" },
524
+ { code: "EE", label: "Estonia", phone: "372" },
525
+ { code: "EG", label: "Egypt", phone: "20" },
526
+ { code: "EH", label: "Western Sahara", phone: "212" },
527
+ { code: "ER", label: "Eritrea", phone: "291" },
528
+ { code: "ES", label: "Spain", phone: "34" },
529
+ { code: "ET", label: "Ethiopia", phone: "251" },
530
+ { code: "FI", label: "Finland", phone: "358" },
531
+ { code: "FJ", label: "Fiji", phone: "679" },
532
+ {
533
+ code: "FK",
534
+ label: "Falkland Islands (Malvinas)",
535
+ phone: "500"
536
+ },
537
+ {
538
+ code: "FM",
539
+ label: "Micronesia, Federated States of",
540
+ phone: "691"
541
+ },
542
+ { code: "FO", label: "Faroe Islands", phone: "298" },
543
+ {
544
+ code: "FR",
545
+ label: "France",
546
+ phone: "33",
547
+ suggested: !0
548
+ },
549
+ { code: "GA", label: "Gabon", phone: "241" },
550
+ { code: "GB", label: "United Kingdom", phone: "44" },
551
+ { code: "GD", label: "Grenada", phone: "1-473" },
552
+ { code: "GE", label: "Georgia", phone: "995" },
553
+ { code: "GF", label: "French Guiana", phone: "594" },
554
+ { code: "GG", label: "Guernsey", phone: "44" },
555
+ { code: "GH", label: "Ghana", phone: "233" },
556
+ { code: "GI", label: "Gibraltar", phone: "350" },
557
+ { code: "GL", label: "Greenland", phone: "299" },
558
+ { code: "GM", label: "Gambia", phone: "220" },
559
+ { code: "GN", label: "Guinea", phone: "224" },
560
+ { code: "GP", label: "Guadeloupe", phone: "590" },
561
+ { code: "GQ", label: "Equatorial Guinea", phone: "240" },
562
+ { code: "GR", label: "Greece", phone: "30" },
563
+ {
564
+ code: "GS",
565
+ label: "South Georgia and the South Sandwich Islands",
566
+ phone: "500"
567
+ },
568
+ { code: "GT", label: "Guatemala", phone: "502" },
569
+ { code: "GU", label: "Guam", phone: "1-671" },
570
+ { code: "GW", label: "Guinea-Bissau", phone: "245" },
571
+ { code: "GY", label: "Guyana", phone: "592" },
572
+ { code: "HK", label: "Hong Kong", phone: "852" },
573
+ {
574
+ code: "HM",
575
+ label: "Heard Island and McDonald Islands",
576
+ phone: "672"
577
+ },
578
+ { code: "HN", label: "Honduras", phone: "504" },
579
+ { code: "HR", label: "Croatia", phone: "385" },
580
+ { code: "HT", label: "Haiti", phone: "509" },
581
+ { code: "HU", label: "Hungary", phone: "36" },
582
+ { code: "ID", label: "Indonesia", phone: "62" },
583
+ { code: "IE", label: "Ireland", phone: "353" },
584
+ { code: "IL", label: "Israel", phone: "972" },
585
+ { code: "IM", label: "Isle of Man", phone: "44" },
586
+ { code: "IN", label: "India", phone: "91" },
587
+ {
588
+ code: "IO",
589
+ label: "British Indian Ocean Territory",
590
+ phone: "246"
591
+ },
592
+ { code: "IQ", label: "Iraq", phone: "964" },
593
+ {
594
+ code: "IR",
595
+ label: "Iran, Islamic Republic of",
596
+ phone: "98"
597
+ },
598
+ { code: "IS", label: "Iceland", phone: "354" },
599
+ { code: "IT", label: "Italy", phone: "39" },
600
+ { code: "JE", label: "Jersey", phone: "44" },
601
+ { code: "JM", label: "Jamaica", phone: "1-876" },
602
+ { code: "JO", label: "Jordan", phone: "962" },
603
+ {
604
+ code: "JP",
605
+ label: "Japan",
606
+ phone: "81",
607
+ suggested: !0
608
+ },
609
+ { code: "KE", label: "Kenya", phone: "254" },
610
+ { code: "KG", label: "Kyrgyzstan", phone: "996" },
611
+ { code: "KH", label: "Cambodia", phone: "855" },
612
+ { code: "KI", label: "Kiribati", phone: "686" },
613
+ { code: "KM", label: "Comoros", phone: "269" },
614
+ {
615
+ code: "KN",
616
+ label: "Saint Kitts and Nevis",
617
+ phone: "1-869"
618
+ },
619
+ {
620
+ code: "KP",
621
+ label: "Korea, Democratic People's Republic of",
622
+ phone: "850"
623
+ },
624
+ { code: "KR", label: "Korea, Republic of", phone: "82" },
625
+ { code: "KW", label: "Kuwait", phone: "965" },
626
+ { code: "KY", label: "Cayman Islands", phone: "1-345" },
627
+ { code: "KZ", label: "Kazakhstan", phone: "7" },
628
+ {
629
+ code: "LA",
630
+ label: "Lao People's Democratic Republic",
631
+ phone: "856"
632
+ },
633
+ { code: "LB", label: "Lebanon", phone: "961" },
634
+ { code: "LC", label: "Saint Lucia", phone: "1-758" },
635
+ { code: "LI", label: "Liechtenstein", phone: "423" },
636
+ { code: "LK", label: "Sri Lanka", phone: "94" },
637
+ { code: "LR", label: "Liberia", phone: "231" },
638
+ { code: "LS", label: "Lesotho", phone: "266" },
639
+ { code: "LT", label: "Lithuania", phone: "370" },
640
+ { code: "LU", label: "Luxembourg", phone: "352" },
641
+ { code: "LV", label: "Latvia", phone: "371" },
642
+ { code: "LY", label: "Libya", phone: "218" },
643
+ { code: "MA", label: "Morocco", phone: "212" },
644
+ { code: "MC", label: "Monaco", phone: "377" },
645
+ {
646
+ code: "MD",
647
+ label: "Moldova, Republic of",
648
+ phone: "373"
649
+ },
650
+ { code: "ME", label: "Montenegro", phone: "382" },
651
+ {
652
+ code: "MF",
653
+ label: "Saint Martin (French part)",
654
+ phone: "590"
655
+ },
656
+ { code: "MG", label: "Madagascar", phone: "261" },
657
+ { code: "MH", label: "Marshall Islands", phone: "692" },
658
+ {
659
+ code: "MK",
660
+ label: "Macedonia, the Former Yugoslav Republic of",
661
+ phone: "389"
662
+ },
663
+ { code: "ML", label: "Mali", phone: "223" },
664
+ { code: "MM", label: "Myanmar", phone: "95" },
665
+ { code: "MN", label: "Mongolia", phone: "976" },
666
+ { code: "MO", label: "Macao", phone: "853" },
667
+ {
668
+ code: "MP",
669
+ label: "Northern Mariana Islands",
670
+ phone: "1-670"
671
+ },
672
+ { code: "MQ", label: "Martinique", phone: "596" },
673
+ { code: "MR", label: "Mauritania", phone: "222" },
674
+ { code: "MS", label: "Montserrat", phone: "1-664" },
675
+ { code: "MT", label: "Malta", phone: "356" },
676
+ { code: "MU", label: "Mauritius", phone: "230" },
677
+ { code: "MV", label: "Maldives", phone: "960" },
678
+ { code: "MW", label: "Malawi", phone: "265" },
679
+ { code: "MX", label: "Mexico", phone: "52" },
680
+ { code: "MY", label: "Malaysia", phone: "60" },
681
+ { code: "MZ", label: "Mozambique", phone: "258" },
682
+ { code: "NA", label: "Namibia", phone: "264" },
683
+ { code: "NC", label: "New Caledonia", phone: "687" },
684
+ { code: "NE", label: "Niger", phone: "227" },
685
+ { code: "NF", label: "Norfolk Island", phone: "672" },
686
+ { code: "NG", label: "Nigeria", phone: "234" },
687
+ { code: "NI", label: "Nicaragua", phone: "505" },
688
+ { code: "NL", label: "Netherlands", phone: "31" },
689
+ { code: "NO", label: "Norway", phone: "47" },
690
+ { code: "NP", label: "Nepal", phone: "977" },
691
+ { code: "NR", label: "Nauru", phone: "674" },
692
+ { code: "NU", label: "Niue", phone: "683" },
693
+ { code: "NZ", label: "New Zealand", phone: "64" },
694
+ { code: "OM", label: "Oman", phone: "968" },
695
+ { code: "PA", label: "Panama", phone: "507" },
696
+ { code: "PE", label: "Peru", phone: "51" },
697
+ { code: "PF", label: "French Polynesia", phone: "689" },
698
+ { code: "PG", label: "Papua New Guinea", phone: "675" },
699
+ { code: "PH", label: "Philippines", phone: "63" },
700
+ { code: "PK", label: "Pakistan", phone: "92" },
701
+ { code: "PL", label: "Poland", phone: "48" },
702
+ {
703
+ code: "PM",
704
+ label: "Saint Pierre and Miquelon",
705
+ phone: "508"
706
+ },
707
+ { code: "PN", label: "Pitcairn", phone: "870" },
708
+ { code: "PR", label: "Puerto Rico", phone: "1" },
709
+ {
710
+ code: "PS",
711
+ label: "Palestine, State of",
712
+ phone: "970"
713
+ },
714
+ { code: "PT", label: "Portugal", phone: "351" },
715
+ { code: "PW", label: "Palau", phone: "680" },
716
+ { code: "PY", label: "Paraguay", phone: "595" },
717
+ { code: "QA", label: "Qatar", phone: "974" },
718
+ { code: "RE", label: "Reunion", phone: "262" },
719
+ { code: "RO", label: "Romania", phone: "40" },
720
+ { code: "RS", label: "Serbia", phone: "381" },
721
+ { code: "RU", label: "Russian Federation", phone: "7" },
722
+ { code: "RW", label: "Rwanda", phone: "250" },
723
+ { code: "SA", label: "Saudi Arabia", phone: "966" },
724
+ { code: "SB", label: "Solomon Islands", phone: "677" },
725
+ { code: "SC", label: "Seychelles", phone: "248" },
726
+ { code: "SD", label: "Sudan", phone: "249" },
727
+ { code: "SE", label: "Sweden", phone: "46" },
728
+ { code: "SG", label: "Singapore", phone: "65" },
729
+ { code: "SH", label: "Saint Helena", phone: "290" },
730
+ { code: "SI", label: "Slovenia", phone: "386" },
731
+ {
732
+ code: "SJ",
733
+ label: "Svalbard and Jan Mayen",
734
+ phone: "47"
735
+ },
736
+ { code: "SK", label: "Slovakia", phone: "421" },
737
+ { code: "SL", label: "Sierra Leone", phone: "232" },
738
+ { code: "SM", label: "San Marino", phone: "378" },
739
+ { code: "SN", label: "Senegal", phone: "221" },
740
+ { code: "SO", label: "Somalia", phone: "252" },
741
+ { code: "SR", label: "Suriname", phone: "597" },
742
+ { code: "SS", label: "South Sudan", phone: "211" },
743
+ {
744
+ code: "ST",
745
+ label: "Sao Tome and Principe",
746
+ phone: "239"
747
+ },
748
+ { code: "SV", label: "El Salvador", phone: "503" },
749
+ {
750
+ code: "SX",
751
+ label: "Sint Maarten (Dutch part)",
752
+ phone: "1-721"
753
+ },
754
+ {
755
+ code: "SY",
756
+ label: "Syrian Arab Republic",
757
+ phone: "963"
758
+ },
759
+ { code: "SZ", label: "Swaziland", phone: "268" },
760
+ {
761
+ code: "TC",
762
+ label: "Turks and Caicos Islands",
763
+ phone: "1-649"
764
+ },
765
+ { code: "TD", label: "Chad", phone: "235" },
766
+ {
767
+ code: "TF",
768
+ label: "French Southern Territories",
769
+ phone: "262"
770
+ },
771
+ { code: "TG", label: "Togo", phone: "228" },
772
+ { code: "TH", label: "Thailand", phone: "66" },
773
+ { code: "TJ", label: "Tajikistan", phone: "992" },
774
+ { code: "TK", label: "Tokelau", phone: "690" },
775
+ { code: "TL", label: "Timor-Leste", phone: "670" },
776
+ { code: "TM", label: "Turkmenistan", phone: "993" },
777
+ { code: "TN", label: "Tunisia", phone: "216" },
778
+ { code: "TO", label: "Tonga", phone: "676" },
779
+ { code: "TR", label: "Turkey", phone: "90" },
780
+ {
781
+ code: "TT",
782
+ label: "Trinidad and Tobago",
783
+ phone: "1-868"
784
+ },
785
+ { code: "TV", label: "Tuvalu", phone: "688" },
786
+ {
787
+ code: "TW",
788
+ label: "Taiwan",
789
+ phone: "886"
790
+ },
791
+ {
792
+ code: "TZ",
793
+ label: "United Republic of Tanzania",
794
+ phone: "255"
795
+ },
796
+ { code: "UA", label: "Ukraine", phone: "380" },
797
+ { code: "UG", label: "Uganda", phone: "256" },
798
+ {
799
+ code: "US",
800
+ label: "United States",
801
+ phone: "1",
802
+ suggested: !0
803
+ },
804
+ { code: "UY", label: "Uruguay", phone: "598" },
805
+ { code: "UZ", label: "Uzbekistan", phone: "998" },
806
+ {
807
+ code: "VA",
808
+ label: "Holy See (Vatican City State)",
809
+ phone: "379"
810
+ },
811
+ {
812
+ code: "VC",
813
+ label: "Saint Vincent and the Grenadines",
814
+ phone: "1-784"
815
+ },
816
+ { code: "VE", label: "Venezuela", phone: "58" },
817
+ {
818
+ code: "VG",
819
+ label: "British Virgin Islands",
820
+ phone: "1-284"
821
+ },
822
+ {
823
+ code: "VI",
824
+ label: "US Virgin Islands",
825
+ phone: "1-340"
826
+ },
827
+ { code: "VN", label: "Vietnam", phone: "84" },
828
+ { code: "VU", label: "Vanuatu", phone: "678" },
829
+ { code: "WF", label: "Wallis and Futuna", phone: "681" },
830
+ { code: "WS", label: "Samoa", phone: "685" },
831
+ { code: "XK", label: "Kosovo", phone: "383" },
832
+ { code: "YE", label: "Yemen", phone: "967" },
833
+ { code: "YT", label: "Mayotte", phone: "262" },
834
+ { code: "ZA", label: "South Africa", phone: "27" },
835
+ { code: "ZM", label: "Zambia", phone: "260" },
836
+ { code: "ZW", label: "Zimbabwe", phone: "263" }
837
+ ], te = {
838
+ phoneContainer: {
839
+ display: "flex",
840
+ gap: 1
841
+ },
842
+ countrySelect: {
843
+ width: "45%"
844
+ },
845
+ phoneInput: {
846
+ width: "55%"
847
+ },
848
+ listItemContent: {
849
+ fontSize: "sm"
850
+ },
851
+ submitButton: {
852
+ mt: 2
853
+ }
854
+ }, we = se(/* @__PURE__ */ e.jsx("path", {
855
+ d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"
856
+ }), "CheckCircle"), Jo = se(/* @__PURE__ */ e.jsx("path", {
857
+ d: "M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"
858
+ }), "Warning"), Zo = (l) => {
859
+ switch (l) {
860
+ case "success":
861
+ return /* @__PURE__ */ e.jsx(we, {});
862
+ case "error":
863
+ return /* @__PURE__ */ e.jsx(Jo, {});
864
+ case "info":
865
+ return /* @__PURE__ */ e.jsx(ho, {});
866
+ }
867
+ }, Yo = (l) => {
868
+ switch (l) {
869
+ case "success":
870
+ return "success";
871
+ case "error":
872
+ return "danger";
873
+ case "info":
874
+ return "primary";
875
+ }
876
+ }, Pe = ({ variant: l, title: a, message: n, description: s }) => {
877
+ const i = Yo(l);
878
+ return /* @__PURE__ */ e.jsx(
879
+ go,
880
+ {
881
+ variant: "soft",
882
+ color: i,
883
+ startDecorator: Zo(l),
884
+ sx: {
885
+ alignItems: "flex-start",
886
+ gap: 1,
887
+ borderRadius: "sm"
888
+ },
889
+ children: /* @__PURE__ */ e.jsxs("div", { children: [
890
+ a && /* @__PURE__ */ e.jsx(p, { level: "title-md", color: i, fontWeight: "bold", children: a }),
891
+ /* @__PURE__ */ e.jsx(p, { level: "body-sm", children: n }),
892
+ s && /* @__PURE__ */ e.jsx(p, { level: "body-xs", sx: { mt: 1 }, children: s })
893
+ ] })
894
+ }
895
+ );
896
+ }, Qo = [
897
+ { value: "male", label: c("leads.form.genderOptions.male") },
898
+ { value: "female", label: c("leads.form.genderOptions.female") },
899
+ { value: "other", label: c("leads.form.genderOptions.other") },
900
+ { value: "prefer_not_to_say", label: c("leads.form.genderOptions.notSay") }
901
+ ], Xo = ({
902
+ fields: l = ["fullName", "email"],
903
+ campaignId: a = "",
904
+ campaignName: n = "",
905
+ contentType: s = "",
906
+ contentId: i = "",
907
+ contentName: d = "",
908
+ customFields: t = {},
909
+ onSuccess: o,
910
+ submitButtonCta: u,
911
+ leadSuccessTitle: x,
912
+ leadSuccessDescription: T
913
+ }) => {
914
+ const [h, y] = r.useState({
915
+ firstName: "",
916
+ lastName: "",
917
+ fullName: "",
918
+ email: "",
919
+ gender: "",
920
+ country: "",
921
+ phoneCountryCode: ce[75],
922
+ // Default country for phone
923
+ phoneNumber: ""
924
+ }), [L, S] = r.useState(!1), [b, P] = r.useState(!1), [G, k] = r.useState(""), I = De(), m = (v) => (D) => {
925
+ y((O) => ({
926
+ ...O,
927
+ [v]: D.target.value
928
+ }));
929
+ }, f = (v, D) => {
930
+ y((O) => ({
931
+ ...O,
932
+ phoneCountryCode: D || ce[0]
933
+ }));
934
+ }, j = (v, D) => {
935
+ y((O) => ({
936
+ ...O,
937
+ country: D || ""
938
+ }));
939
+ }, M = (v, D) => {
940
+ y((O) => ({
941
+ ...O,
942
+ gender: D || ""
943
+ }));
944
+ }, z = async (v) => {
945
+ v.preventDefault(), k("");
946
+ const D = {
947
+ firstName: h.firstName,
948
+ lastName: h.lastName,
949
+ fullName: h.fullName,
950
+ email: h.email,
951
+ gender: h.gender,
952
+ country: h.country,
953
+ phoneCountryCode: "+" + h.phoneCountryCode.phone,
954
+ phoneNumber: h.phoneNumber,
955
+ campaignId: a,
956
+ campaignName: n,
957
+ contentType: s,
958
+ contentId: i,
959
+ contentName: d,
960
+ customFields: t
961
+ }, O = ["firstName", "lastName", "fullName", "email", "gender", "country", "phoneCountryCode", "phoneNumber"], ie = Object.fromEntries(
962
+ Object.entries(D).map(([F, $]) => O.includes(F) ? l.includes(F) && $ !== "" && $ !== null ? [F, $] : [F, null] : [F, $])
963
+ );
964
+ S(!0);
965
+ try {
966
+ await I.profile.collectLead(ie), P(!0), o && o();
967
+ } catch (F) {
968
+ const $ = F instanceof Error ? F.message : "An error occurred while submitting your entry. Please try again.";
969
+ k($);
970
+ } finally {
971
+ S(!1);
972
+ }
973
+ }, K = c("leads.form.fullName"), W = c("leads.form.fullNamePlaceholder"), q = c("leads.form.firstName"), V = c("leads.form.firstNamePlaceholder"), le = c("leads.form.lastName"), X = c("leads.form.lastNamePlaceholder"), de = c("leads.form.email"), he = c("leads.form.gender"), A = c("leads.form.genderPlaceholder"), g = c("leads.form.country"), N = c("leads.form.countryPlaceholder"), w = c("leads.form.phone"), _ = c("leads.form.phonePlaceholder"), ee = u ?? c("leads.buttons.submit");
974
+ return /* @__PURE__ */ e.jsx("form", { onSubmit: z, children: /* @__PURE__ */ e.jsxs(B, { spacing: 2, children: [
975
+ l.includes("fullName") && /* @__PURE__ */ e.jsxs(J, { required: !0, disabled: b, children: [
976
+ /* @__PURE__ */ e.jsx(Z, { children: K }),
977
+ /* @__PURE__ */ e.jsx(ae, { value: h.fullName, onChange: m("fullName"), placeholder: W })
978
+ ] }),
979
+ l.includes("firstName") && /* @__PURE__ */ e.jsxs(J, { required: !0, disabled: b, children: [
980
+ /* @__PURE__ */ e.jsx(Z, { children: q }),
981
+ /* @__PURE__ */ e.jsx(ae, { value: h.firstName, onChange: m("firstName"), placeholder: V })
982
+ ] }),
983
+ l.includes("lastName") && /* @__PURE__ */ e.jsxs(J, { required: !0, disabled: b, children: [
984
+ /* @__PURE__ */ e.jsx(Z, { children: le }),
985
+ /* @__PURE__ */ e.jsx(ae, { value: h.lastName, onChange: m("lastName"), placeholder: X })
986
+ ] }),
987
+ l.includes("email") && /* @__PURE__ */ e.jsxs(J, { required: !0, disabled: b, children: [
988
+ /* @__PURE__ */ e.jsx(Z, { children: de }),
989
+ /* @__PURE__ */ e.jsx(ae, { type: "email", value: h.email, onChange: m("email"), placeholder: "your.email@example.com" })
990
+ ] }),
991
+ l.includes("gender") && /* @__PURE__ */ e.jsxs(J, { disabled: b, children: [
992
+ /* @__PURE__ */ e.jsx(Z, { children: he }),
993
+ /* @__PURE__ */ e.jsx(fe, { value: h.gender, onChange: M, placeholder: A, children: Qo.map((v) => /* @__PURE__ */ e.jsx(je, { value: v.value, children: v.label }, v.value)) })
994
+ ] }),
995
+ l.includes("country") && /* @__PURE__ */ e.jsxs(J, { required: !0, disabled: b, children: [
996
+ /* @__PURE__ */ e.jsx(Z, { children: g }),
997
+ /* @__PURE__ */ e.jsx(fe, { value: h.country, onChange: j, placeholder: N, children: ce.map((v) => /* @__PURE__ */ e.jsx(je, { value: v.code, children: v.label }, v.code)) })
998
+ ] }),
999
+ (l.includes("phoneCountryCode") || l.includes("phoneNumber")) && /* @__PURE__ */ e.jsxs(J, { required: !0, disabled: b, children: [
1000
+ /* @__PURE__ */ e.jsx(Z, { children: w }),
1001
+ /* @__PURE__ */ e.jsxs(C, { sx: te.phoneContainer, children: [
1002
+ l.includes("phoneCountryCode") && /* @__PURE__ */ e.jsx(
1003
+ eo,
1004
+ {
1005
+ value: h.phoneCountryCode,
1006
+ onChange: f,
1007
+ slotProps: {
1008
+ input: {
1009
+ autoComplete: "new-password"
1010
+ }
1011
+ },
1012
+ sx: te.countrySelect,
1013
+ options: ce,
1014
+ autoHighlight: !0,
1015
+ getOptionLabel: (v) => `+${v.phone}`,
1016
+ renderOption: (v, D) => /* @__PURE__ */ e.jsxs(oo, { ...v, children: [
1017
+ /* @__PURE__ */ e.jsx(lo, { children: /* @__PURE__ */ e.jsx(
1018
+ "img",
1019
+ {
1020
+ loading: "lazy",
1021
+ width: "20",
1022
+ srcSet: `https://flagcdn.com/w40/${D.code.toLowerCase()}.png 2x`,
1023
+ src: `https://flagcdn.com/w20/${D.code.toLowerCase()}.png`,
1024
+ alt: ""
1025
+ }
1026
+ ) }),
1027
+ /* @__PURE__ */ e.jsxs(ze, { sx: te.listItemContent, children: [
1028
+ D.label,
1029
+ /* @__PURE__ */ e.jsxs(p, { level: "body-xs", children: [
1030
+ "+",
1031
+ D.phone
1032
+ ] })
1033
+ ] })
1034
+ ] })
1035
+ }
1036
+ ),
1037
+ l.includes("phoneNumber") && /* @__PURE__ */ e.jsx(
1038
+ ae,
1039
+ {
1040
+ value: h.phoneNumber,
1041
+ onChange: m("phoneNumber"),
1042
+ placeholder: _,
1043
+ sx: te.phoneInput
1044
+ }
1045
+ )
1046
+ ] })
1047
+ ] }),
1048
+ G && /* @__PURE__ */ e.jsx(Pe, { variant: "error", message: G }),
1049
+ b ? /* @__PURE__ */ e.jsx(
1050
+ Pe,
1051
+ {
1052
+ variant: "success",
1053
+ title: x ?? c("leads.success.title"),
1054
+ description: T ?? c("leads.success.description")
1055
+ }
1056
+ ) : /* @__PURE__ */ e.jsx(Ce, { type: "submit", loading: L, size: "lg", sx: te.submitButton, children: ee })
1057
+ ] }) });
1058
+ };
1059
+ function Ie({
1060
+ contentType: l,
1061
+ contentId: a,
1062
+ contentName: n,
1063
+ campaignId: s,
1064
+ campaignName: i,
1065
+ onSuccess: d,
1066
+ fields: t = ["fullName", "email"],
1067
+ leadTitle: o,
1068
+ leadDescription: u,
1069
+ leadCta: x,
1070
+ leadSuccessTitle: T,
1071
+ leadSuccessDescription: h
1072
+ }) {
1073
+ const y = o ?? c("leads.header.title"), L = u ?? c("leads.header.description"), S = x ?? c("leads.buttons.submit"), b = T ?? c("leads.success.title"), P = h ?? c("leads.success.description");
1074
+ return /* @__PURE__ */ e.jsxs(B, { spacing: 2, children: [
1075
+ /* @__PURE__ */ e.jsxs(C, { children: [
1076
+ /* @__PURE__ */ e.jsx(p, { level: "h4", children: y }),
1077
+ /* @__PURE__ */ e.jsx(p, { level: "body-sm", children: L })
1078
+ ] }),
1079
+ /* @__PURE__ */ e.jsx(
1080
+ Xo,
1081
+ {
1082
+ campaignId: s,
1083
+ campaignName: i,
1084
+ contentName: n,
1085
+ contentType: l,
1086
+ contentId: a,
1087
+ onSuccess: d,
1088
+ fields: t,
1089
+ submitButtonCta: S,
1090
+ leadSuccessTitle: b,
1091
+ leadSuccessDescription: P
1092
+ }
1093
+ )
1094
+ ] });
1095
+ }
1096
+ const el = se(/* @__PURE__ */ e.jsx("path", {
1097
+ d: "M9.01 14H2v2h7.01v3L13 15l-3.99-4zm5.98-1v-3H22V8h-7.01V5L11 9z"
1098
+ }), "CompareArrows"), ol = se(/* @__PURE__ */ e.jsx("path", {
1099
+ d: "M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3m-4.4 15.55-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05"
1100
+ }), "FavoriteBorder"), ll = se(/* @__PURE__ */ e.jsx("path", {
1101
+ d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"
1102
+ }), "Cancel"), Ne = ({ option: l, selected: a, feedback: n, onSelect: s, pairId: i }) => {
1103
+ var t;
1104
+ const d = (o) => n.selectedOption === l.id ? n.isCorrect ? `linear-gradient(to top, ${o.palette.success[900]}EE, ${o.palette.success[800]}CC 50%, ${o.palette.success[900]}00 100%)` : `linear-gradient(to top, ${o.palette.danger[900]}EE, ${o.palette.danger[800]}CC 50%, ${o.palette.danger[900]}00 100%)` : "linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0) 200px)";
1105
+ return /* @__PURE__ */ e.jsx(
1106
+ C,
1107
+ {
1108
+ sx: {
1109
+ ...Y.optionWrapper,
1110
+ ...U.wrapper,
1111
+ cursor: a ? "default" : "pointer"
1112
+ },
1113
+ onClick: () => !a && s(i, l.id),
1114
+ children: /* @__PURE__ */ e.jsx(ke, { ratio: "16/9", children: /* @__PURE__ */ e.jsxs(Q, { sx: U.card, children: [
1115
+ /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsx(C, { component: "img", src: (t = l.images) == null ? void 0 : t.main, alt: l.label, sx: U.image }) }),
1116
+ /* @__PURE__ */ e.jsx(
1117
+ pe,
1118
+ {
1119
+ sx: {
1120
+ ...U.overlay,
1121
+ background: (o) => d(o)
1122
+ }
1123
+ }
1124
+ ),
1125
+ n.selectedOption === l.id && /* @__PURE__ */ e.jsx(C, { sx: U.iconWrapper, children: n.isCorrect ? /* @__PURE__ */ e.jsx(
1126
+ we,
1127
+ {
1128
+ sx: {
1129
+ ...U.icon,
1130
+ color: "success.500"
1131
+ }
1132
+ }
1133
+ ) : /* @__PURE__ */ e.jsx(
1134
+ ll,
1135
+ {
1136
+ sx: {
1137
+ ...U.icon,
1138
+ color: "danger.500"
1139
+ }
1140
+ }
1141
+ ) }),
1142
+ /* @__PURE__ */ e.jsx(ro, { sx: U.content, children: /* @__PURE__ */ e.jsx(p, { level: "body-lg", sx: U.label, children: l.label }) })
1143
+ ] }) })
1144
+ }
1145
+ );
1146
+ }, al = ({ time: l, maxTime: a }) => {
1147
+ const [n, s] = r.useState(a), { t: i } = ve(), d = i("common.labels.sec");
1148
+ return r.useEffect(() => {
1149
+ const t = setTimeout(() => {
1150
+ s(l);
1151
+ }, 50);
1152
+ return () => clearTimeout(t);
1153
+ }, [l]), /* @__PURE__ */ e.jsxs(C, { sx: { mb: 2 }, children: [
1154
+ /* @__PURE__ */ e.jsxs(B, { direction: "row", justifyContent: "space-between", alignItems: "center", mb: 0.5, children: [
1155
+ /* @__PURE__ */ e.jsx(Oo, { size: 18 }),
1156
+ /* @__PURE__ */ e.jsxs(p, { level: "body-sm", textColor: n <= 3 ? "warning.500" : "text.primary", children: [
1157
+ n,
1158
+ d
1159
+ ] })
1160
+ ] }),
1161
+ /* @__PURE__ */ e.jsx(C, { sx: Y.timerProgressWrapper, children: /* @__PURE__ */ e.jsx(
1162
+ C,
1163
+ {
1164
+ sx: {
1165
+ ...Y.timerProgress,
1166
+ width: `${n / a * 100}%`,
1167
+ bgcolor: n <= 3 ? "warning.500" : "primary.500"
1168
+ }
1169
+ }
1170
+ ) })
1171
+ ] });
1172
+ }, nl = ({ currentPair: l, timer: a, selected: n, maxTime: s, feedback: i, onSelect: d, stepInfo: t }) => {
1173
+ const [o, u] = r.useState(0), [x, T] = r.useState(!1), [h, y] = r.useState(0), [L, S] = r.useState(0), { t: b } = ve(), P = b("common.labels.or"), G = b("common.labels.point", { count: o });
1174
+ r.useEffect(() => {
1175
+ if (t != null && t.currentPoints && t.currentPoints > o) {
1176
+ y(t.currentPoints - o), T(!0), S((j) => j + 1);
1177
+ const f = setTimeout(() => T(!1), 1e3);
1178
+ return u(t.currentPoints), () => clearTimeout(f);
1179
+ }
1180
+ }, [t == null ? void 0 : t.currentPoints, o]);
1181
+ const k = () => {
1182
+ const f = [], j = (t == null ? void 0 : t.currentLives) ?? 3;
1183
+ for (let M = 0; M < j; M++)
1184
+ f.push(/* @__PURE__ */ e.jsx(uo, { color: "primary", sx: { height: 20 } }, `life-${M}`));
1185
+ for (let M = j; M < 3; M++)
1186
+ f.push(/* @__PURE__ */ e.jsx(ol, { sx: { height: 20 } }, `empty-${M}`));
1187
+ return f;
1188
+ }, I = () => {
1189
+ const f = [], j = (t == null ? void 0 : t.currentStreak) ?? 0, M = Math.min(j, 5);
1190
+ for (let z = 0; z < 5; z++)
1191
+ f.push(/* @__PURE__ */ e.jsx(C, { sx: po(M, z) }, `streak-${z}`));
1192
+ return f;
1193
+ }, m = () => /* @__PURE__ */ e.jsxs(B, { direction: "column", alignItems: "center", gap: 0.75, sx: Y.dividerWrapper, children: [
1194
+ /* @__PURE__ */ e.jsx(Qe, { variant: "outlined", color: "neutral", size: "sm", sx: Y.dividerButton, children: /* @__PURE__ */ e.jsx(el, { color: "primary", sx: { fontSize: "1.2em" } }) }),
1195
+ /* @__PURE__ */ e.jsx(p, { sx: Y.dividerText, children: P })
1196
+ ] });
1197
+ return l ? /* @__PURE__ */ e.jsxs(C, { children: [
1198
+ l && /* @__PURE__ */ e.jsx(al, { time: a, maxTime: s }, `timer-${l.pairId}`),
1199
+ /* @__PURE__ */ e.jsxs(B, { direction: { xs: "column", sm: "row" }, alignItems: "center", spacing: 1, sx: { mb: 2 }, children: [
1200
+ /* @__PURE__ */ e.jsx(C, { sx: { width: { xs: "100%", sm: "calc(50% - 20px)" } }, children: /* @__PURE__ */ e.jsx(
1201
+ Ne,
1202
+ {
1203
+ option: l.optionOne,
1204
+ selected: n,
1205
+ feedback: i,
1206
+ onSelect: d,
1207
+ pairId: l.pairId
1208
+ }
1209
+ ) }),
1210
+ m(),
1211
+ /* @__PURE__ */ e.jsx(C, { sx: { width: { xs: "100%", sm: "calc(50% - 20px)" } }, children: /* @__PURE__ */ e.jsx(
1212
+ Ne,
1213
+ {
1214
+ option: l.optionTwo,
1215
+ selected: n,
1216
+ feedback: i,
1217
+ onSelect: d,
1218
+ pairId: l.pairId
1219
+ }
1220
+ ) })
1221
+ ] }),
1222
+ /* @__PURE__ */ e.jsxs(C, { children: [
1223
+ /* @__PURE__ */ e.jsx(B, { direction: "row", spacing: 1, sx: { mb: 1 }, children: I() }),
1224
+ /* @__PURE__ */ e.jsxs(B, { direction: "row", justifyContent: "space-between", alignItems: "center", children: [
1225
+ /* @__PURE__ */ e.jsx(C, { children: k() }),
1226
+ /* @__PURE__ */ e.jsxs(B, { direction: "row", spacing: 1, alignItems: "center", children: [
1227
+ /* @__PURE__ */ e.jsxs(p, { children: [
1228
+ G,
1229
+ ":"
1230
+ ] }),
1231
+ /* @__PURE__ */ e.jsxs(p, { level: "h4", sx: { position: "relative" }, children: [
1232
+ o,
1233
+ x && /* @__PURE__ */ e.jsxs(p, { sx: Y.pointsAdded, children: [
1234
+ "+",
1235
+ h
1236
+ ] }, L)
1237
+ ] })
1238
+ ] })
1239
+ ] })
1240
+ ] })
1241
+ ] }) : null;
1242
+ }, tl = ({ stepInfo: l, game: a, sdk: n }) => {
1243
+ const [s, i] = r.useState(null), [d, t] = r.useState(!0), o = Ge(), { t: u } = ve(), x = u("eitherOr.buttons.playAgain"), T = u("common.labels.leaderboard"), h = u("eitherOr.personalBest"), y = u("eitherOr.yourScore"), L = (l == null ? void 0 : l.currentPoints) ?? 0, [S, b] = r.useState(0), [P, G] = r.useState(null), k = S === L;
1244
+ return r.useEffect(() => {
1245
+ (async () => {
1246
+ try {
1247
+ if (!a || !l) throw "Game or stepInfo is missing";
1248
+ const m = await n.getEitherOrResults(a.id);
1249
+ if (L > 0) {
1250
+ const j = [...m.standings], M = {
1251
+ userId: "current",
1252
+ userModel: {
1253
+ id: "current",
1254
+ name: u("common.labels.me"),
1255
+ nickname: null,
1256
+ avatar: null,
1257
+ anonymous: !0
1258
+ },
1259
+ personalBest: L
1260
+ }, z = j.findIndex((K) => K.personalBest < L);
1261
+ z >= 0 && z < 50 && (j.splice(z, 0, M), m.standings = j);
1262
+ }
1263
+ const f = await n.getMyEitherOrStats(a.id);
1264
+ b(f.personalBest ?? 0), G(f.betterThan ?? 0), i(m);
1265
+ } catch (m) {
1266
+ console.error("Failed to fetch results:", m);
1267
+ } finally {
1268
+ t(!1);
1269
+ }
1270
+ })();
1271
+ }, [l, a, n]), d ? /* @__PURE__ */ e.jsx(C, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ e.jsx(Ae, { size: "lg" }) }) : !a || !l ? null : /* @__PURE__ */ e.jsx(C, { sx: { maxWidth: 1200, margin: "0 auto" }, children: /* @__PURE__ */ e.jsxs(C, { sx: E.wrapper, children: [
1272
+ /* @__PURE__ */ e.jsxs(Q, { variant: "soft", sx: E.mainCard, children: [
1273
+ /* @__PURE__ */ e.jsx(C, { sx: E.fieldPattern }),
1274
+ /* @__PURE__ */ e.jsxs(B, { spacing: 4, sx: E.mainContent, children: [
1275
+ /* @__PURE__ */ e.jsxs(B, { spacing: 1, alignItems: "center", children: [
1276
+ /* @__PURE__ */ e.jsxs(B, { direction: "row", alignItems: "center", spacing: 1, sx: E.scoreSection, children: [
1277
+ /* @__PURE__ */ e.jsx(Eo, { size: 28 }),
1278
+ /* @__PURE__ */ e.jsx(p, { level: "h3", children: y })
1279
+ ] }),
1280
+ /* @__PURE__ */ e.jsx(p, { level: "h1", sx: E.scoreValue, children: l.currentPoints })
1281
+ ] }),
1282
+ /* @__PURE__ */ e.jsx(Ee, {}),
1283
+ /* @__PURE__ */ e.jsxs(B, { spacing: 2, sx: E.statsSection, children: [
1284
+ k && /* @__PURE__ */ e.jsxs(Me, { variant: "soft", sx: E.statsCard, children: [
1285
+ /* @__PURE__ */ e.jsxs(B, { direction: "row", alignItems: "center", spacing: 1, children: [
1286
+ /* @__PURE__ */ e.jsx(_o, { size: 20, color: o.vars.palette.warning[400] }),
1287
+ /* @__PURE__ */ e.jsx(p, { level: "title-md", children: u("eitherOr.personalBestImprovedTitle") })
1288
+ ] }),
1289
+ /* @__PURE__ */ e.jsx(p, { level: "body-md", textAlign: "center", children: u("eitherOr.personalBestImprovedSubtitle") })
1290
+ ] }),
1291
+ S > 0 && /* @__PURE__ */ e.jsxs(Me, { variant: "soft", sx: E.statsCard, children: [
1292
+ /* @__PURE__ */ e.jsxs(B, { direction: "row", alignItems: "center", spacing: 1, children: [
1293
+ /* @__PURE__ */ e.jsx(Le, { size: 20, color: o.vars.palette.warning[400] }),
1294
+ /* @__PURE__ */ e.jsx(p, { level: "title-md", children: h })
1295
+ ] }),
1296
+ /* @__PURE__ */ e.jsx(p, { level: "body-md", textAlign: "center", children: u("eitherOr.betterThanLabel", { points: S, percentile: P }) })
1297
+ ] })
1298
+ ] })
1299
+ ] })
1300
+ ] }),
1301
+ (s == null ? void 0 : s.standings) && /* @__PURE__ */ e.jsxs(Q, { variant: "outlined", sx: E.leaderboardCard, children: [
1302
+ /* @__PURE__ */ e.jsxs(B, { direction: "row", alignItems: "center", spacing: 1, sx: { mb: 2 }, children: [
1303
+ /* @__PURE__ */ e.jsx(Le, { size: 24, color: o.vars.palette.warning[400] }),
1304
+ /* @__PURE__ */ e.jsx(p, { level: "h4", children: T })
1305
+ ] }),
1306
+ /* @__PURE__ */ e.jsx(co, { children: s.standings.slice(0, 50).map((I, m) => {
1307
+ var f, j;
1308
+ return /* @__PURE__ */ e.jsx(ao, { sx: E.getLeaderboardItemStyles, children: /* @__PURE__ */ e.jsx(ze, { children: /* @__PURE__ */ e.jsxs(B, { direction: "row", alignItems: "center", spacing: 2, children: [
1309
+ m < 3 ? /* @__PURE__ */ e.jsx(Go, { size: 20, color: bo(m)(o) }) : /* @__PURE__ */ e.jsx(p, { sx: E.rankNumber, children: m + 1 }),
1310
+ /* @__PURE__ */ e.jsx(p, { sx: { flex: 1 }, children: ((f = I.userModel) == null ? void 0 : f.nickname) || ((j = I.userModel) == null ? void 0 : j.name) || "Anonymous" }),
1311
+ /* @__PURE__ */ e.jsx(p, { sx: mo(m < 3), children: I.personalBest })
1312
+ ] }) }) }, I.userId);
1313
+ }) })
1314
+ ] }),
1315
+ /* @__PURE__ */ e.jsx(Ce, { variant: "outlined", color: "neutral", fullWidth: !0, onClick: () => window.location.reload(), sx: E.actionButton, children: x })
1316
+ ] }) });
1317
+ }, sl = ({ gameId: l, sdk: a, onComplete: n, defaultImagePlaceholderUrl: s, signInCTA: i }) => {
1318
+ const [d, t] = r.useState(H.LOADING), [o, u] = r.useState(null), [x, T] = r.useState(null), [h, y] = r.useState(null), [L, S] = r.useState(10), [b, P] = r.useState(null), [G, k] = r.useState({
1319
+ isCorrect: null,
1320
+ selectedOption: null
1321
+ }), [I, m] = r.useState(!1), [f, j] = r.useState(!1), { position: M, fields: z, campaignId: K, campaignName: W } = $e(), { isAuthenticated: q } = Ue();
1322
+ r.useEffect(() => {
1323
+ (() => {
1324
+ try {
1325
+ a.getEitherOrById(l, !0).then((g) => {
1326
+ u(g), m(!g.authRequirement || g.authRequirement !== "LEAD" || g.authRequirement === "LEAD" && M === "after");
1327
+ const w = g.authRequirement === "REGISTERED" && !q;
1328
+ j(w), t(H.TUTORIAL);
1329
+ }).catch((g) => {
1330
+ console.error(g), t(null);
1331
+ });
1332
+ } catch (g) {
1333
+ return console.warn("Failed to fetch game:", g), "";
1334
+ }
1335
+ })();
1336
+ }, [l, a, M]), r.useEffect(() => {
1337
+ if (o) {
1338
+ const A = o.authRequirement === "REGISTERED" && !q;
1339
+ j(A);
1340
+ }
1341
+ }, [o, q]);
1342
+ const V = r.useCallback(() => ({
1343
+ onTimerTick: (N) => {
1344
+ S(N);
1345
+ },
1346
+ onElapsedResponse: (N) => {
1347
+ S(10), T(N.steps.find((w) => !w.played) || null), y(N), N.currentLives === 0 && t(H.RESULTS);
1348
+ }
1349
+ }), []), le = r.useCallback(async () => {
1350
+ try {
1351
+ const A = await a.participateInEitherOr(l, null, V());
1352
+ y(A), T(A.steps.find((g) => !g.played) || null), t(H.PLAYING);
1353
+ } catch (A) {
1354
+ console.error("Failed to start game:", A);
1355
+ }
1356
+ }, [l, a, V]), X = r.useCallback(
1357
+ async (A, g) => {
1358
+ if (!b) {
1359
+ P(g);
1360
+ try {
1361
+ const N = await a.participateInEitherOr(l, { pair: A, answer: g }, V()), w = N.steps.find((_) => _.pairId === A);
1362
+ k({
1363
+ isCorrect: (w == null ? void 0 : w.correct) ?? !1,
1364
+ selectedOption: g
1365
+ }), y(N), setTimeout(() => {
1366
+ const _ = N.steps.find((ee) => !ee.played);
1367
+ _ ? (T(_), P(null), k({ isCorrect: null, selectedOption: null })) : (t(H.RESULTS), n && n(N.currentPoints));
1368
+ }, 1e3);
1369
+ } catch (N) {
1370
+ console.error("Failed to submit answer:", N), P(null);
1371
+ }
1372
+ }
1373
+ },
1374
+ [l, a, b, V, n]
1375
+ ), de = () => {
1376
+ m(!0);
1377
+ }, he = () => {
1378
+ var A, g, N, w, _, ee, v, D, O, ie, F, $, ye, Se;
1379
+ switch (d) {
1380
+ case H.LOADING:
1381
+ return /* @__PURE__ */ e.jsx(C, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: 400, children: /* @__PURE__ */ e.jsx(Ae, {}) });
1382
+ case H.TUTORIAL:
1383
+ return !I && (o == null ? void 0 : o.authRequirement) === "LEAD" && M === "before" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1384
+ ((A = o == null ? void 0 : o.images) == null ? void 0 : A.main) && /* @__PURE__ */ e.jsx(ke, { ratio: 16 / 9, children: /* @__PURE__ */ e.jsx(Q, { sx: { borderColor: "divider", "&:hover": { borderColor: "divider" } }, children: /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsx(
1385
+ "img",
1386
+ {
1387
+ src: o.images.main,
1388
+ srcSet: `${o.images.main} 1x, ${o.images.main} 2x`,
1389
+ loading: "lazy",
1390
+ alt: o.title
1391
+ }
1392
+ ) }) }) }),
1393
+ $o(o.flags) && /* @__PURE__ */ e.jsx(
1394
+ qo,
1395
+ {
1396
+ title: ((g = o.labels) == null ? void 0 : g.prizeCardTitle) ?? c("prize.title"),
1397
+ description: ((N = o.labels) == null ? void 0 : N.prizeCardDescription) ?? c("prize.description"),
1398
+ cta: ((w = o.labels) == null ? void 0 : w.prizeCta) ?? c("prize.cta"),
1399
+ rules: o.rules
1400
+ }
1401
+ ),
1402
+ /* @__PURE__ */ e.jsx(
1403
+ Ie,
1404
+ {
1405
+ onSuccess: de,
1406
+ contentType: "either-or",
1407
+ contentId: o.id,
1408
+ contentName: o.title,
1409
+ campaignId: K,
1410
+ campaignName: W,
1411
+ fields: z,
1412
+ leadTitle: (_ = o.labels) == null ? void 0 : _.leadTitle,
1413
+ leadDescription: (ee = o.labels) == null ? void 0 : ee.leadDescription,
1414
+ leadCta: (v = o.labels) == null ? void 0 : v.leadCta,
1415
+ leadSuccessTitle: (D = o.labels) == null ? void 0 : D.leadSuccessTitle,
1416
+ leadSuccessDescription: (O = o.labels) == null ? void 0 : O.leadSuccessDescription
1417
+ }
1418
+ )
1419
+ ] }) : /* @__PURE__ */ e.jsx(xo, { onStart: le, game: o, signInCTA: i, showSignInCTA: f });
1420
+ case H.PLAYING:
1421
+ return /* @__PURE__ */ e.jsx(
1422
+ nl,
1423
+ {
1424
+ currentPair: x,
1425
+ timer: L,
1426
+ maxTime: (o == null ? void 0 : o.time) ?? 10,
1427
+ selected: b,
1428
+ feedback: G,
1429
+ onSelect: X,
1430
+ stepInfo: h
1431
+ }
1432
+ );
1433
+ case H.RESULTS:
1434
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1435
+ M === "after" && (o == null ? void 0 : o.authRequirement) === "LEAD" && /* @__PURE__ */ e.jsx(Q, { sx: { mb: 3 }, children: /* @__PURE__ */ e.jsx(
1436
+ Ie,
1437
+ {
1438
+ contentType: "either-or",
1439
+ contentId: o == null ? void 0 : o.id,
1440
+ contentName: o == null ? void 0 : o.title,
1441
+ fields: z,
1442
+ campaignId: K,
1443
+ campaignName: W,
1444
+ leadTitle: (ie = o == null ? void 0 : o.labels) == null ? void 0 : ie.leadTitle,
1445
+ leadDescription: (F = o == null ? void 0 : o.labels) == null ? void 0 : F.leadDescription,
1446
+ leadCta: ($ = o == null ? void 0 : o.labels) == null ? void 0 : $.leadCta,
1447
+ leadSuccessTitle: (ye = o == null ? void 0 : o.labels) == null ? void 0 : ye.leadSuccessTitle,
1448
+ leadSuccessDescription: (Se = o == null ? void 0 : o.labels) == null ? void 0 : Se.leadSuccessDescription
1449
+ }
1450
+ ) }),
1451
+ /* @__PURE__ */ e.jsx(tl, { stepInfo: h, game: o, sdk: a })
1452
+ ] });
1453
+ }
1454
+ };
1455
+ if (d !== null)
1456
+ return /* @__PURE__ */ e.jsxs(
1457
+ Q,
1458
+ {
1459
+ variant: "outlined",
1460
+ sx: {
1461
+ borderColor: "divider",
1462
+ "&:hover": { borderColor: "divider" },
1463
+ backgroundImage: s ? `url(${s})` : "none",
1464
+ backgroundRepeat: "no-repeat",
1465
+ backgroundSize: "cover",
1466
+ backgroundPosition: "center"
1467
+ },
1468
+ children: [
1469
+ (o == null ? void 0 : o.title) && /* @__PURE__ */ e.jsx(p, { level: "h3", textAlign: "center", sx: { mb: 2 }, children: o.title }),
1470
+ he()
1471
+ ]
1472
+ }
1473
+ );
1474
+ }, rl = ({ initialGameId: l }) => {
1475
+ const a = De(), { defaultImagePlaceholderUrl: n } = He(), s = Ke();
1476
+ return /* @__PURE__ */ e.jsx(
1477
+ sl,
1478
+ {
1479
+ gameId: l,
1480
+ sdk: a.miniGames,
1481
+ onComplete: (i) => {
1482
+ console.info("Game completed with score:", i);
1483
+ },
1484
+ defaultImagePlaceholderUrl: n,
1485
+ signInCTA: s
1486
+ }
1487
+ );
1488
+ }, Ll = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1489
+ __proto__: null,
1490
+ default: rl
1491
+ }, Symbol.toStringTag, { value: "Module" }));
1492
+ export {
1493
+ rl as E,
1494
+ Bo as M,
1495
+ Ll as a
1496
+ };