fansunited-frontend-components 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BattleOfFans.js +512 -469
- package/Betslip.js +1 -1
- package/ChanceGame.js +1 -1
- package/ClassicQuizPlay.js +2 -2
- package/CollectLead.js +1 -1
- package/CompetitionStatistics.js +1 -1
- package/CompetitorCard.js +1 -1
- package/Discussion.js +1 -1
- package/EitherOrPlay.js +2 -2
- package/EventCard.js +1 -1
- package/EventGamePlay.js +2 -2
- package/Leaderboard.js +1 -1
- package/List.js +4 -4
- package/MatchQuizPlay.js +2 -2
- package/Odds.js +1 -1
- package/PersonalityQuizPlay.js +2 -2
- package/PickThePair.js +1 -1
- package/PlayerOfTheMatch.js +805 -857
- package/PollVote.js +2 -2
- package/Predictor.js +1 -1
- package/ProfileStats.d.ts +4 -0
- package/ProfileStats.d.ts.map +1 -0
- package/ProfileStats.js +2781 -0
- package/README.md +65 -4
- package/Standings.js +1 -1
- package/TopX.js +1 -1
- package/chunks/index-CLJiQKNv.js +4 -0
- package/chunks/index-D6-V3WrE.js +4 -0
- package/chunks/index-Dt38wFLo.js +4 -0
- package/chunks/index-Ehvd1Qmz.js +4 -0
- package/chunks/index-QtarvzAb.js +4 -0
- package/chunks/index-kffkFNES.js +4 -0
- package/chunks/{main-DdL0UekL.js → main-BnuQygIM.js} +1853 -1783
- package/chunks/main-BpGmqCTf.js +2142 -0
- package/chunks/main-C0PSUCR_.js +3027 -0
- package/chunks/{main-LEE8n2cG.js → main-CfdOHNHz.js} +1268 -1203
- package/chunks/{main-D_QDfmAw.js → main-PpLP-LeG.js} +1797 -1753
- package/chunks/{main-C7X4dM_P.js → main-p1Qbq-Fw.js} +1532 -1483
- package/chunks/{withVersionStamp-Cck3fT4t.js → withVersionStamp-C1gbpK3-.js} +1 -1
- package/components.d.ts +2 -1
- package/components.d.ts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +11 -9
- package/package.json +6 -2
- package/chunks/index-BNl8scz6.js +0 -4
- package/chunks/index-CSa2JU4m.js +0 -4
- package/chunks/index-Cd1dg0KI.js +0 -4
- package/chunks/index-Cei2fzi7.js +0 -4
- package/chunks/index-Cxb4wEJU.js +0 -4
- package/chunks/index-w1LGN5dz.js +0 -4
- package/chunks/main-07vzblS8.js +0 -2091
- package/chunks/main-DmBfwyb4.js +0 -2992
package/BattleOfFans.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as l, Fragment as
|
|
2
|
-
import { space as
|
|
3
|
-
import
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { useDisableCache as
|
|
6
|
-
import { a as
|
|
7
|
-
import { keyframes as
|
|
8
|
-
import { EmojiEventsIcon as
|
|
1
|
+
import { jsx as l, Fragment as Pt, jsxs as b } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { space as dt, radius as ut, LeadForm as An, BrandedArea as Vn, Notification as _n, WidgetPortal as Hn } from "fansunited-frontend-core/ui/emotion";
|
|
3
|
+
import un, { useState as A, useRef as pn, useEffect as gt, useMemo as q, useCallback as Ut } from "react";
|
|
4
|
+
import { useTranslation as bt } from "react-i18next";
|
|
5
|
+
import { useDisableCache as jn, extractSdkError as $t, getSportsApiCredentials as Gn, hexColor as mn, fetchSearchEntitiesByIds as qn, contrastRatio as ht, standsOut as Et, cdnAssets as Un, initialsOf as Yn, useIsRtl as Tt, useIntlLocale as fn, useIsMobile as Xn, useColors as Kn, stripHtmlTags as Jn } from "fansunited-frontend-core";
|
|
6
|
+
import { a as gn, u as Qn, O as Zn } from "./chunks/OddsSkeleton-DP5Yfqpr.js";
|
|
7
|
+
import { keyframes as rt, css as d } from "@emotion/react";
|
|
8
|
+
import { EmojiEventsIcon as te, CheckIcon as ne, LockOutlinedIcon as ee } from "fansunited-frontend-core/ui/icons";
|
|
9
9
|
import "fansunited-sdk-esm/enums";
|
|
10
|
-
import { w as
|
|
10
|
+
import { w as oe } from "./chunks/withVersionStamp-C1gbpK3-.js";
|
|
11
11
|
const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
12
12
|
fontPrimary: "var(--fu-ucrc-font-primary)",
|
|
13
13
|
fontSecondary: "var(--fu-ucrc-font-secondary)",
|
|
@@ -24,25 +24,25 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
24
24
|
shadow: "rgba(var(--fu-ucrc-shadow-channel) / var(--fu-ucrc-shadow-opacity))",
|
|
25
25
|
trophy: "var(--fu-ucrc-warning-plain-color)",
|
|
26
26
|
trophyOn: "var(--bof-trophy-on)",
|
|
27
|
-
spaceXs:
|
|
28
|
-
spaceSm:
|
|
29
|
-
spaceMd:
|
|
30
|
-
spaceLg:
|
|
31
|
-
radiusSm:
|
|
32
|
-
radiusMd:
|
|
33
|
-
radiusLg:
|
|
34
|
-
radiusFull:
|
|
27
|
+
spaceXs: dt("xs"),
|
|
28
|
+
spaceSm: dt("sm"),
|
|
29
|
+
spaceMd: dt("md"),
|
|
30
|
+
spaceLg: dt("lg"),
|
|
31
|
+
radiusSm: ut("sm"),
|
|
32
|
+
radiusMd: ut("md"),
|
|
33
|
+
radiusLg: ut("lg"),
|
|
34
|
+
radiusFull: ut("full"),
|
|
35
35
|
fill: "var(--bof-fill)",
|
|
36
36
|
on: "var(--bof-on)",
|
|
37
37
|
ink: "var(--bof-ink)",
|
|
38
38
|
/** The side colour mixed into the card, at `--bof-tint`. */
|
|
39
39
|
tint: "color-mix(in srgb, var(--bof-fill) var(--bof-tint), var(--fu-ucrc-surface))"
|
|
40
|
-
},
|
|
40
|
+
}, ot = {
|
|
41
41
|
logo: "drop-shadow(0 3px 6px rgba(0,0,0,0.18))",
|
|
42
42
|
winnerLogo: "drop-shadow(0 8px 14px rgba(0,0,0,0.35))",
|
|
43
43
|
winnerHeadshot: "0 10px 22px -10px rgba(0,0,0,0.5)",
|
|
44
44
|
trophy: "0 4px 10px -3px rgba(0,0,0,0.45)"
|
|
45
|
-
},
|
|
45
|
+
}, re = "@media (prefers-reduced-motion: reduce)", tt = {
|
|
46
46
|
pad: 24,
|
|
47
47
|
arenaBar: 238,
|
|
48
48
|
arenaFill: 324,
|
|
@@ -72,7 +72,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
72
72
|
trophy: 40,
|
|
73
73
|
trophyRing: 3,
|
|
74
74
|
slant: 4
|
|
75
|
-
},
|
|
75
|
+
}, nt = {
|
|
76
76
|
pad: 16,
|
|
77
77
|
arenaBar: 196,
|
|
78
78
|
arenaFill: 264,
|
|
@@ -102,18 +102,18 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
102
102
|
trophy: 28,
|
|
103
103
|
trophyRing: 2,
|
|
104
104
|
slant: 3
|
|
105
|
-
},
|
|
105
|
+
}, Ct = 76, I = ([t, n]) => ({
|
|
106
106
|
fontSize: s(t),
|
|
107
107
|
lineHeight: n / t
|
|
108
|
-
}),
|
|
108
|
+
}), wt = rt({
|
|
109
109
|
"0%, 100%": { opacity: 1 },
|
|
110
110
|
"50%": { opacity: 0.45 }
|
|
111
|
-
}),
|
|
111
|
+
}), Yt = {
|
|
112
112
|
margin: 0,
|
|
113
113
|
fontFamily: i.fontPrimary,
|
|
114
114
|
fontWeight: 700,
|
|
115
115
|
letterSpacing: "-0.01em"
|
|
116
|
-
},
|
|
116
|
+
}, Xt = (t, n) => ({
|
|
117
117
|
root: d({
|
|
118
118
|
fontSize: "1em",
|
|
119
119
|
boxSizing: "border-box",
|
|
@@ -129,7 +129,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
129
129
|
boxShadow: `0 1px 2px 0 ${i.shadow}, 0 2px 4px 0 ${i.shadow}`,
|
|
130
130
|
"--bof-tint": "10%",
|
|
131
131
|
".dark &": { "--bof-tint": "26%" },
|
|
132
|
-
[
|
|
132
|
+
[re]: {
|
|
133
133
|
"& *, & *::before, & *::after": {
|
|
134
134
|
animation: "none !important",
|
|
135
135
|
transition: "none !important"
|
|
@@ -159,7 +159,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
159
159
|
}),
|
|
160
160
|
// Title and open subtitle can be poll (CMS) text, in any language.
|
|
161
161
|
title: d({
|
|
162
|
-
...
|
|
162
|
+
...Yt,
|
|
163
163
|
unicodeBidi: "plaintext",
|
|
164
164
|
...I(n ? [22, 28] : [28, 34])
|
|
165
165
|
}),
|
|
@@ -205,7 +205,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
205
205
|
arenaSkeleton: d({
|
|
206
206
|
borderRadius: i.radiusMd,
|
|
207
207
|
backgroundColor: i.inner,
|
|
208
|
-
animation: `${
|
|
208
|
+
animation: `${wt} 1.5s ease-in-out infinite`
|
|
209
209
|
}),
|
|
210
210
|
resultsSkeleton: d({
|
|
211
211
|
height: s(t.pctBar[1] + (n ? 8 : 10) + t.bar),
|
|
@@ -223,14 +223,14 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
223
223
|
height: s(t.bar),
|
|
224
224
|
borderRadius: i.radiusFull,
|
|
225
225
|
backgroundColor: i.track,
|
|
226
|
-
animation: `${
|
|
226
|
+
animation: `${wt} 1.5s ease-in-out infinite`
|
|
227
227
|
}),
|
|
228
228
|
titleSkeleton: d({
|
|
229
229
|
width: s(n ? 170 : 220),
|
|
230
230
|
height: s(n ? 28 : 34),
|
|
231
231
|
borderRadius: i.radiusSm,
|
|
232
232
|
backgroundColor: i.inner,
|
|
233
|
-
animation: `${
|
|
233
|
+
animation: `${wt} 1.5s ease-in-out infinite`
|
|
234
234
|
}),
|
|
235
235
|
message: d({
|
|
236
236
|
display: "flex",
|
|
@@ -244,7 +244,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
244
244
|
padding: i.spaceLg,
|
|
245
245
|
boxSizing: "border-box"
|
|
246
246
|
}),
|
|
247
|
-
messageTitle: d({ ...
|
|
247
|
+
messageTitle: d({ ...Yt, ...I([18, 24]) }),
|
|
248
248
|
messageText: d({ margin: 0, color: i.dim, ...I([14, 20]) }),
|
|
249
249
|
retry: d({
|
|
250
250
|
marginTop: s(8, 15),
|
|
@@ -263,7 +263,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
263
263
|
outlineOffset: "2px"
|
|
264
264
|
}
|
|
265
265
|
})
|
|
266
|
-
}),
|
|
266
|
+
}), Kt = (t) => ({
|
|
267
267
|
root: d(
|
|
268
268
|
t ? {
|
|
269
269
|
width: "100%",
|
|
@@ -325,39 +325,39 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
325
325
|
fontSize: s(20),
|
|
326
326
|
color: i.dim
|
|
327
327
|
})
|
|
328
|
-
}), y = { d:
|
|
328
|
+
}), y = { d: Xt(tt, !1), m: Xt(nt, !0) }, Y = { d: Kt(!1), m: Kt(!0) }, ie = "battle-of-fans", se = "voting_ends_at", ae = "voting_starts_at", Jt = 5 * 6e4, le = 15e3, Qt = { team: "team", player: "player" }, ce = (t) => {
|
|
329
329
|
var r;
|
|
330
330
|
const n = (((r = t.context) == null ? void 0 : r.tags) ?? []).filter(
|
|
331
|
-
(o) => !!(o != null && o.id) && !!
|
|
331
|
+
(o) => !!(o != null && o.id) && !!Qt[(o.type ?? "").toLowerCase()]
|
|
332
332
|
), e = t.options ?? [];
|
|
333
333
|
return n.length !== e.length && console.warn(
|
|
334
334
|
`BattleOfFans: poll ${t.id} has ${e.length} options and ${n.length} team/player tags; using the first ${Math.min(n.length, e.length)}.`
|
|
335
335
|
), e.slice(0, n.length).map((o, a) => ({
|
|
336
336
|
optionId: o.id,
|
|
337
337
|
entityId: n[a].id,
|
|
338
|
-
kind:
|
|
338
|
+
kind: Qt[n[a].type.toLowerCase()],
|
|
339
339
|
title: o.title ?? ""
|
|
340
340
|
}));
|
|
341
|
-
},
|
|
341
|
+
}, de = (t) => t.split("-")[0].toUpperCase(), ue = (t, n) => {
|
|
342
342
|
var o, a;
|
|
343
343
|
if (!t) return null;
|
|
344
|
-
const e =
|
|
344
|
+
const e = de(n);
|
|
345
345
|
return (((a = (o = t.translations) == null ? void 0 : o.find(
|
|
346
346
|
(u) => {
|
|
347
347
|
var m;
|
|
348
348
|
return ((m = u.language) == null ? void 0 : m.toUpperCase()) === e;
|
|
349
349
|
}
|
|
350
350
|
)) == null ? void 0 : a.name) ?? t.name ?? "").trim() || null;
|
|
351
|
-
},
|
|
351
|
+
}, pe = (t, n) => {
|
|
352
352
|
var e, r;
|
|
353
353
|
return ((r = (e = t == null ? void 0 : t.assets) == null ? void 0 : e.find((o) => o.key === (n === "team" ? "LOGO" : "HEADSHOT"))) == null ? void 0 : r.value) ?? null;
|
|
354
|
-
},
|
|
354
|
+
}, hn = (t) => {
|
|
355
355
|
var n, e;
|
|
356
356
|
return ((e = (n = t == null ? void 0 : t.related) == null ? void 0 : n.find((r) => {
|
|
357
357
|
var o;
|
|
358
358
|
return ((o = r.relationship) == null ? void 0 : o.toUpperCase()) === "TEAM";
|
|
359
359
|
})) == null ? void 0 : e.related_id) ?? null;
|
|
360
|
-
},
|
|
360
|
+
}, me = (t, n) => {
|
|
361
361
|
var r;
|
|
362
362
|
const e = (r = t == null ? void 0 : t.metadata) == null ? void 0 : r.branding;
|
|
363
363
|
return [
|
|
@@ -365,15 +365,15 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
365
365
|
e == null ? void 0 : e.secondary_color,
|
|
366
366
|
e == null ? void 0 : e.tertiary_color
|
|
367
367
|
].map((o) => n(o)).filter((o) => !!o);
|
|
368
|
-
},
|
|
369
|
-
const a = n.get(o.entityId), u = o.kind === "player" ? n.get(
|
|
368
|
+
}, fe = (t, n, e, r) => t.map((o) => {
|
|
369
|
+
const a = n.get(o.entityId), u = o.kind === "player" ? n.get(hn(a) ?? "") : a;
|
|
370
370
|
return {
|
|
371
371
|
...o,
|
|
372
|
-
name:
|
|
373
|
-
image:
|
|
374
|
-
brand:
|
|
372
|
+
name: ue(a, e) ?? o.title,
|
|
373
|
+
image: pe(a, o.kind),
|
|
374
|
+
brand: me(u, r)
|
|
375
375
|
};
|
|
376
|
-
}),
|
|
376
|
+
}), ge = (t) => {
|
|
377
377
|
const n = t.reduce((u, m) => u + Math.max(0, m), 0);
|
|
378
378
|
if (n === 0) return t.map(() => 0);
|
|
379
379
|
const e = t.map((u) => Math.max(0, u) / n * 100), r = e.map(Math.floor);
|
|
@@ -384,14 +384,14 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
384
384
|
r[u] += 1, o -= 1;
|
|
385
385
|
}
|
|
386
386
|
return r;
|
|
387
|
-
},
|
|
387
|
+
}, he = (t) => {
|
|
388
388
|
const n = Math.max(...t);
|
|
389
389
|
return n > 0 && t.filter((r) => r === n).length === 1 ? t.indexOf(n) : null;
|
|
390
|
-
},
|
|
390
|
+
}, Zt = (t) => {
|
|
391
391
|
if (!t) return null;
|
|
392
392
|
const n = Date.parse(t);
|
|
393
393
|
return Number.isNaN(n) ? null : n;
|
|
394
|
-
},
|
|
394
|
+
}, tn = (t, n) => {
|
|
395
395
|
const e = Math.max(0, Math.floor((t - n) / 1e3));
|
|
396
396
|
return {
|
|
397
397
|
days: Math.floor(e / 86400),
|
|
@@ -399,12 +399,12 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
399
399
|
minutes: Math.floor(e % 3600 / 60),
|
|
400
400
|
seconds: e % 60
|
|
401
401
|
};
|
|
402
|
-
},
|
|
403
|
-
const o = /* @__PURE__ */ new Map(), a =
|
|
402
|
+
}, be = [401, 403, 404], ye = async (t, n, e, r) => {
|
|
403
|
+
const o = /* @__PURE__ */ new Map(), a = Gn(t);
|
|
404
404
|
if (!a) return o;
|
|
405
405
|
const u = async (c) => {
|
|
406
406
|
if (!c.length) return;
|
|
407
|
-
(await
|
|
407
|
+
(await qn(
|
|
408
408
|
a,
|
|
409
409
|
c,
|
|
410
410
|
{
|
|
@@ -415,75 +415,75 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
415
415
|
).catch(() => [])).forEach((p) => p.id && o.set(p.id, p));
|
|
416
416
|
};
|
|
417
417
|
await u(n.map((c) => c.entityId));
|
|
418
|
-
const m = n.filter((c) => c.kind === "player").map((c) =>
|
|
418
|
+
const m = n.filter((c) => c.kind === "player").map((c) => hn(o.get(c.entityId))).filter((c) => !!c && !o.has(c));
|
|
419
419
|
return await u(m), o;
|
|
420
|
-
},
|
|
420
|
+
}, xe = (t) => {
|
|
421
421
|
var n;
|
|
422
422
|
return t != null && t.id ? ((n = t.optionIds) == null ? void 0 : n[0]) ?? t.optionId ?? null : null;
|
|
423
|
-
},
|
|
424
|
-
var
|
|
425
|
-
const { entityId: n, sdk: e, language: r, userIsLoggedIn: o } = t, a =
|
|
426
|
-
|
|
423
|
+
}, ke = (t) => {
|
|
424
|
+
var st, H;
|
|
425
|
+
const { entityId: n, sdk: e, language: r, userIsLoggedIn: o } = t, a = jn(), [u, m] = A("loading"), [c, f] = A(null), [p, g] = A(0), [F, B] = A(!1), [X, T] = A(!1), [U, $] = A(null), S = pn(t.callbacks);
|
|
426
|
+
S.current = t.callbacks, gt(() => {
|
|
427
427
|
const C = new AbortController();
|
|
428
|
-
let
|
|
429
|
-
return m("loading"),
|
|
430
|
-
let
|
|
428
|
+
let x = !1;
|
|
429
|
+
return m("loading"), T(!1), (async () => {
|
|
430
|
+
let v;
|
|
431
431
|
try {
|
|
432
|
-
|
|
433
|
-
} catch (
|
|
434
|
-
if (
|
|
432
|
+
v = await e.voting.getPollById(n, a);
|
|
433
|
+
} catch (P) {
|
|
434
|
+
if (x) return;
|
|
435
435
|
m(
|
|
436
|
-
|
|
436
|
+
$t(P, e).code === 404 ? "notFound" : "error"
|
|
437
437
|
);
|
|
438
438
|
return;
|
|
439
439
|
}
|
|
440
|
-
const w =
|
|
440
|
+
const w = v != null && v.id && (v.type ?? "").toLowerCase() === ie ? ce(v) : [];
|
|
441
441
|
if (w.length < 2) {
|
|
442
|
-
|
|
442
|
+
x || m("notFound");
|
|
443
443
|
return;
|
|
444
444
|
}
|
|
445
|
-
const
|
|
446
|
-
if (
|
|
445
|
+
const D = v.authRequirement === "REGISTERED" && !o ? Promise.resolve(null) : e.voting.getMyPollVote(n).catch((P) => {
|
|
446
|
+
if (be.includes($t(P, e).code))
|
|
447
447
|
return null;
|
|
448
|
-
throw
|
|
448
|
+
throw P;
|
|
449
449
|
});
|
|
450
450
|
try {
|
|
451
|
-
const [
|
|
452
|
-
|
|
453
|
-
|
|
451
|
+
const [P, et] = await Promise.all([
|
|
452
|
+
D,
|
|
453
|
+
ye(e, w, C.signal, a)
|
|
454
454
|
]);
|
|
455
|
-
if (
|
|
455
|
+
if (x) return;
|
|
456
456
|
f({
|
|
457
|
-
poll:
|
|
457
|
+
poll: v,
|
|
458
458
|
refs: w,
|
|
459
|
-
entities:
|
|
460
|
-
votedOptionId:
|
|
459
|
+
entities: et,
|
|
460
|
+
votedOptionId: xe(P)
|
|
461
461
|
}), m("ready");
|
|
462
462
|
} catch {
|
|
463
|
-
|
|
463
|
+
x || m("error");
|
|
464
464
|
}
|
|
465
465
|
})(), () => {
|
|
466
|
-
|
|
466
|
+
x = !0, C.abort();
|
|
467
467
|
};
|
|
468
468
|
}, [n, e, a, o, p]);
|
|
469
|
-
const
|
|
470
|
-
() => c ?
|
|
469
|
+
const it = q(
|
|
470
|
+
() => c ? fe(c.refs, c.entities, r, mn) : [],
|
|
471
471
|
[c, r]
|
|
472
|
-
),
|
|
472
|
+
), E = q(
|
|
473
473
|
() => c ? c.refs.map(
|
|
474
474
|
(C) => {
|
|
475
|
-
var
|
|
476
|
-
return ((
|
|
475
|
+
var x;
|
|
476
|
+
return ((x = c.poll.options.find((M) => M.id === C.optionId)) == null ? void 0 : x.votes) ?? 0;
|
|
477
477
|
}
|
|
478
478
|
) : [],
|
|
479
479
|
[c]
|
|
480
|
-
),
|
|
480
|
+
), z = Ut(
|
|
481
481
|
async (C) => {
|
|
482
|
-
var
|
|
483
|
-
if (!(!c ||
|
|
484
|
-
|
|
482
|
+
var x, M;
|
|
483
|
+
if (!(!c || F || c.votedOptionId)) {
|
|
484
|
+
B(!0);
|
|
485
485
|
try {
|
|
486
|
-
const
|
|
486
|
+
const v = await e.voting.voteForPoll(n, C);
|
|
487
487
|
f(
|
|
488
488
|
(w) => w && {
|
|
489
489
|
...w,
|
|
@@ -492,149 +492,150 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
492
492
|
...w.poll,
|
|
493
493
|
totalVotes: (w.poll.totalVotes ?? 0) + 1,
|
|
494
494
|
options: w.poll.options.map(
|
|
495
|
-
(
|
|
495
|
+
(N) => N.id === C ? { ...N, votes: (N.votes ?? 0) + 1 } : N
|
|
496
496
|
)
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
|
-
), (M = (
|
|
500
|
-
} catch (
|
|
501
|
-
const { code: w, message:
|
|
502
|
-
w === 401 || w === 403 ?
|
|
499
|
+
), (M = (x = S.current) == null ? void 0 : x.onFinish) == null || M.call(x, v);
|
|
500
|
+
} catch (v) {
|
|
501
|
+
const { code: w, message: N } = $t(v, e);
|
|
502
|
+
w === 401 || w === 403 ? T(!0) : $(N);
|
|
503
503
|
} finally {
|
|
504
|
-
|
|
504
|
+
B(!1);
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
507
|
},
|
|
508
|
-
[n, e, c,
|
|
509
|
-
),
|
|
508
|
+
[n, e, c, F]
|
|
509
|
+
), L = Ut(() => {
|
|
510
510
|
e.voting.getPollById(n, a).then(
|
|
511
511
|
(C) => f(
|
|
512
|
-
(
|
|
512
|
+
(x) => x && (C != null && C.id) ? { ...x, poll: C } : x
|
|
513
513
|
)
|
|
514
514
|
).catch(() => {
|
|
515
515
|
});
|
|
516
|
-
}, [n, e, a]),
|
|
516
|
+
}, [n, e, a]), O = (c == null ? void 0 : c.poll) ?? null;
|
|
517
517
|
return {
|
|
518
518
|
status: u,
|
|
519
|
-
poll:
|
|
520
|
-
sides:
|
|
521
|
-
votes:
|
|
519
|
+
poll: O,
|
|
520
|
+
sides: it,
|
|
521
|
+
votes: E,
|
|
522
522
|
votedOptionId: (c == null ? void 0 : c.votedOptionId) ?? null,
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
523
|
+
startMs: Zt((st = O == null ? void 0 : O.customFields) == null ? void 0 : st[ae]),
|
|
524
|
+
endMs: Zt((H = O == null ? void 0 : O.customFields) == null ? void 0 : H[se]),
|
|
525
|
+
signInRequired: X || (O == null ? void 0 : O.authRequirement) === "REGISTERED" && !o,
|
|
526
|
+
submitting: F,
|
|
527
|
+
voteError: U,
|
|
527
528
|
clearVoteError: () => $(null),
|
|
528
|
-
vote:
|
|
529
|
-
retry: () =>
|
|
530
|
-
refresh:
|
|
529
|
+
vote: z,
|
|
530
|
+
retry: () => g((C) => C + 1),
|
|
531
|
+
refresh: L
|
|
531
532
|
};
|
|
532
|
-
},
|
|
533
|
-
const { t: n } =
|
|
534
|
-
return
|
|
533
|
+
}, Se = (t) => {
|
|
534
|
+
const { t: n } = bt("common");
|
|
535
|
+
return q(
|
|
535
536
|
() => (e, r) => {
|
|
536
537
|
const o = t == null ? void 0 : t[e];
|
|
537
538
|
return typeof o == "string" && o.trim() ? o : n(`battleOfFans.${e}`, r ?? {});
|
|
538
539
|
},
|
|
539
540
|
[t, n]
|
|
540
541
|
);
|
|
541
|
-
},
|
|
542
|
-
const [n, e] =
|
|
543
|
-
return
|
|
542
|
+
}, Ie = (t) => {
|
|
543
|
+
const [n, e] = A(() => Date.now()), r = t !== null && n >= t;
|
|
544
|
+
return gt(() => {
|
|
544
545
|
if (t === null || r) return;
|
|
545
546
|
const o = setInterval(() => e(Date.now()), 1e3);
|
|
546
547
|
return () => clearInterval(o);
|
|
547
548
|
}, [t, r]), n;
|
|
548
|
-
},
|
|
549
|
-
const n =
|
|
549
|
+
}, nn = (t) => {
|
|
550
|
+
const n = mn(t);
|
|
550
551
|
if (!n) return null;
|
|
551
552
|
const [e, r, o] = [1, 3, 5].map(
|
|
552
553
|
(c) => parseInt(n.slice(c, c + 2), 16) / 255
|
|
553
554
|
), a = Math.max(e, r, o), u = a - Math.min(e, r, o);
|
|
554
555
|
return u < 0.12 ? null : ((a === e ? (r - o) / u % 6 : a === r ? (o - e) / u + 2 : (e - r) / u + 4) * 60 + 360) % 360;
|
|
555
|
-
},
|
|
556
|
-
if (!
|
|
557
|
-
const e =
|
|
558
|
-
if (e === null || r === null) return (
|
|
556
|
+
}, Q = (t, n) => {
|
|
557
|
+
if (!Et(t, n)) return !0;
|
|
558
|
+
const e = nn(t), r = nn(n);
|
|
559
|
+
if (e === null || r === null) return (ht(t, n) ?? 1) < 2;
|
|
559
560
|
const o = Math.abs(e - r);
|
|
560
561
|
return Math.min(o, 360 - o) < 35;
|
|
561
|
-
},
|
|
562
|
+
}, ve = (t, n) => {
|
|
562
563
|
const e = [n.primary, n.text, ...n.extras], r = t.map(
|
|
563
|
-
(a) => a.filter((u) =>
|
|
564
|
+
(a) => a.filter((u) => Et(u, n.surface))
|
|
564
565
|
), o = r.map(
|
|
565
566
|
(a, u) => a[0] ?? e[u % e.length]
|
|
566
567
|
);
|
|
567
568
|
for (let a = 1; a < o.length; a += 1) {
|
|
568
569
|
const u = o.slice(0, a);
|
|
569
|
-
if (!u.some((p) =>
|
|
570
|
-
const m = r[a].slice(1).find((p) => !u.some((
|
|
570
|
+
if (!u.some((p) => Q(p, o[a]))) continue;
|
|
571
|
+
const m = r[a].slice(1).find((p) => !u.some((g) => Q(g, p)));
|
|
571
572
|
if (m) {
|
|
572
573
|
o[a] = m;
|
|
573
574
|
continue;
|
|
574
575
|
}
|
|
575
576
|
let c = !1;
|
|
576
577
|
for (let p = 0; p < a && !c; p += 1) {
|
|
577
|
-
if (!
|
|
578
|
-
const
|
|
579
|
-
(
|
|
578
|
+
if (!Q(o[p], o[a])) continue;
|
|
579
|
+
const g = r[p].slice(1).find(
|
|
580
|
+
(F) => o.slice(0, a + 1).every((B, X) => X === p || !Q(B, F))
|
|
580
581
|
);
|
|
581
|
-
|
|
582
|
+
g && (o[p] = g), c = !o.slice(0, a).some((F) => Q(F, o[a]));
|
|
582
583
|
}
|
|
583
584
|
if (c) continue;
|
|
584
|
-
const f = e.find((p) => !u.some((
|
|
585
|
-
f && u.some((p) => !
|
|
585
|
+
const f = e.find((p) => !u.some((g) => Q(g, p)));
|
|
586
|
+
f && u.some((p) => !Et(p, o[a])) && (o[a] = f);
|
|
586
587
|
}
|
|
587
588
|
return o;
|
|
588
|
-
},
|
|
589
|
-
if ((
|
|
589
|
+
}, bn = (t, n) => {
|
|
590
|
+
if ((ht(n.onPrimary, t) ?? 21) >= 4.5)
|
|
590
591
|
return n.onPrimary;
|
|
591
592
|
const e = [n.onPrimary, n.text, n.surface];
|
|
592
593
|
let r = e[0], o = -1;
|
|
593
594
|
for (const a of e) {
|
|
594
|
-
const u =
|
|
595
|
+
const u = ht(a, t) ?? -1;
|
|
595
596
|
u > o && (r = a, o = u);
|
|
596
597
|
}
|
|
597
598
|
return r;
|
|
598
|
-
},
|
|
599
|
+
}, $e = (t, n, e = 3) => (ht(t, n.surface) ?? 21) >= e ? t : n.text, Ce = (t, n) => ve(t, n).map((e) => ({
|
|
599
600
|
fill: e,
|
|
600
|
-
on:
|
|
601
|
-
ink:
|
|
602
|
-
})),
|
|
601
|
+
on: bn(e, n),
|
|
602
|
+
ink: $e(e, n)
|
|
603
|
+
})), we = (t, n, e) => Math.max(n, Math.min(e, t)), We = (t, n) => {
|
|
603
604
|
const e = t.length, r = 100 / e;
|
|
604
605
|
if (t.every((c) => c === 0)) return t.map(() => r);
|
|
605
606
|
const o = r * (n || e > 2 ? 0.8 : 0.6), a = t.map((c) => Math.max(c, o)), u = a.reduce((c, f) => c + f, 0) - 100, m = a.reduce((c, f) => c + (f - o), 0);
|
|
606
607
|
return a.map((c) => m > 0 ? c - (c - o) / m * u : r);
|
|
607
|
-
},
|
|
608
|
-
const o = t.length, a = e ?
|
|
608
|
+
}, Re = (t, n, e, r) => {
|
|
609
|
+
const o = t.length, a = e ? we(t[n], r ? 60 : 56, r ? 68 : 74) : 64, u = 100 - a, c = t.filter((f, p) => p !== n).reduce((f, p) => f + p, 0);
|
|
609
610
|
return t.map((f, p) => p === n ? a : !e || c === 0 ? u / (o - 1) : f / c * u);
|
|
610
|
-
},
|
|
611
|
+
}, Fe = (t) => {
|
|
611
612
|
const n = [];
|
|
612
613
|
let e = 0;
|
|
613
614
|
for (let r = 0; r < t.length - 1; r += 1)
|
|
614
615
|
e += t[r], n.push(e);
|
|
615
616
|
return n;
|
|
616
|
-
},
|
|
617
|
-
const o = (
|
|
617
|
+
}, Ee = (t) => `${Math.round(t * 100) / 100}%`, Oe = (t, n, e, r) => {
|
|
618
|
+
const o = (g) => Ee(r ? 100 - g : g), a = n === 0 ? null : t[n - 1], u = n === t.length ? null : t[n], m = o(a === null ? 0 : a + e), c = o(a === null ? 0 : a - e), f = o(u === null ? 100 : u + e), p = o(u === null ? 100 : u - e);
|
|
618
619
|
return `polygon(${m} 0, ${f} 0, ${p} 100%, ${c} 100%)`;
|
|
619
|
-
},
|
|
620
|
+
}, pt = "cubic-bezier(.2,.8,.2,1)", Pe = rt({ from: { clipPath: "var(--bof-from)" } }), Ot = rt({ from: { opacity: 0, transform: "translateY(10px)" } }), Te = rt({ to: { transform: "rotate(360deg)" } }), yn = rt({
|
|
620
621
|
"0%": { transform: "scale(.92)", opacity: 0 },
|
|
621
622
|
"60%": { transform: "scale(1.03)" },
|
|
622
623
|
"100%": { transform: "scale(1)", opacity: 1 }
|
|
623
|
-
}),
|
|
624
|
+
}), V = { fontFamily: i.fontPrimary, fontWeight: 700 }, Wt = ([t, n]) => ({
|
|
624
625
|
fontSize: `min(${s(t)}, 30cqi)`,
|
|
625
626
|
lineHeight: n / t
|
|
626
|
-
}),
|
|
627
|
+
}), en = (t) => ({
|
|
627
628
|
paddingInlineStart: `calc(${s(t)} + var(--bof-pad-start, 0%))`,
|
|
628
629
|
paddingInlineEnd: `calc(${s(t)} + var(--bof-pad-end, 0%))`
|
|
629
|
-
}),
|
|
630
|
+
}), Rt = { overflowWrap: "anywhere", maxWidth: "100%" }, Ft = ([t, n]) => ({
|
|
630
631
|
fontSize: `min(${s(t)}, 18cqi)`,
|
|
631
632
|
lineHeight: n / t
|
|
632
|
-
}),
|
|
633
|
+
}), mt = { unicodeBidi: "plaintext" }, ft = {
|
|
633
634
|
display: "-webkit-box",
|
|
634
635
|
WebkitLineClamp: 2,
|
|
635
636
|
WebkitBoxOrient: "vertical",
|
|
636
637
|
overflow: "hidden"
|
|
637
|
-
},
|
|
638
|
+
}, on = (t, n) => ({
|
|
638
639
|
boxSizing: "border-box",
|
|
639
640
|
height: s(t, n),
|
|
640
641
|
padding: `0 min(${s(20, n)}, 6cqi)`,
|
|
@@ -656,8 +657,8 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
656
657
|
outline: `2px solid ${i.focus}`,
|
|
657
658
|
outlineOffset: "2px"
|
|
658
659
|
}
|
|
659
|
-
}),
|
|
660
|
-
vote: d(
|
|
660
|
+
}), xn = (t, n, e) => ({
|
|
661
|
+
vote: d(on(t, n), e, {
|
|
661
662
|
backgroundColor: i.fill,
|
|
662
663
|
color: i.on,
|
|
663
664
|
cursor: "pointer",
|
|
@@ -670,15 +671,15 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
670
671
|
"&:active:not(:disabled)": { transform: "translateY(0)" },
|
|
671
672
|
"&:disabled": { cursor: "default", opacity: 0.7 }
|
|
672
673
|
}),
|
|
673
|
-
thanks: d(
|
|
674
|
+
thanks: d(on(t, n), e, {
|
|
674
675
|
padding: `0 ${s(12, n)}`,
|
|
675
676
|
border: `2px solid ${i.ink}`,
|
|
676
677
|
backgroundColor: i.surface,
|
|
677
678
|
color: i.ink,
|
|
678
|
-
animation: `${
|
|
679
|
+
animation: `${yn} .35s ease-out`
|
|
679
680
|
}),
|
|
680
681
|
icon: d({ fontSize: "1.25em", flexShrink: 0 })
|
|
681
|
-
}),
|
|
682
|
+
}), Le = (t) => {
|
|
682
683
|
const n = (a) => ({
|
|
683
684
|
display: "block",
|
|
684
685
|
width: `min(${s(a)}, 100%)`,
|
|
@@ -708,22 +709,22 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
708
709
|
alignItems: "center",
|
|
709
710
|
justifyContent: "center",
|
|
710
711
|
fontSize: s(a * 0.36),
|
|
711
|
-
...
|
|
712
|
+
...V,
|
|
712
713
|
color: i.text,
|
|
713
714
|
backgroundColor: i.surface,
|
|
714
715
|
border: `${i.borderSize} solid ${i.border}`
|
|
715
716
|
}), o = (a, u) => d(n(a), { objectFit: "contain", filter: u });
|
|
716
717
|
return {
|
|
717
718
|
side: {
|
|
718
|
-
logo: o(t.img,
|
|
719
|
+
logo: o(t.img, ot.logo),
|
|
719
720
|
headshot: e(t.img, `${s(t.trophyRing)} solid ${i.fill}`),
|
|
720
721
|
initials: r(t.img)
|
|
721
722
|
},
|
|
722
723
|
winner: {
|
|
723
|
-
logo: o(t.winImg,
|
|
724
|
+
logo: o(t.winImg, ot.winnerLogo),
|
|
724
725
|
headshot: d(
|
|
725
726
|
e(t.winImg, `${s(t.trophyRing + 1)} solid ${i.on}`),
|
|
726
|
-
{ boxShadow:
|
|
727
|
+
{ boxShadow: ot.winnerHeadshot }
|
|
727
728
|
),
|
|
728
729
|
initials: r(t.winImg)
|
|
729
730
|
},
|
|
@@ -733,17 +734,17 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
733
734
|
initials: r(t.loserImg)
|
|
734
735
|
},
|
|
735
736
|
row: {
|
|
736
|
-
logo: o(44,
|
|
737
|
+
logo: o(44, ot.logo),
|
|
737
738
|
headshot: e(44, `2px solid ${i.fill}`),
|
|
738
739
|
initials: r(44)
|
|
739
740
|
}
|
|
740
741
|
};
|
|
741
|
-
},
|
|
742
|
+
}, Me = [
|
|
742
743
|
"top-left",
|
|
743
744
|
"top-right",
|
|
744
745
|
"bottom-left",
|
|
745
746
|
"bottom-right"
|
|
746
|
-
],
|
|
747
|
+
], kn = (t) => {
|
|
747
748
|
const n = {
|
|
748
749
|
position: "absolute",
|
|
749
750
|
width: s(t.trophy),
|
|
@@ -753,20 +754,20 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
753
754
|
border: `${s(t.trophyRing)} solid ${i.on}`,
|
|
754
755
|
backgroundColor: i.trophy,
|
|
755
756
|
color: i.trophyOn,
|
|
756
|
-
boxShadow:
|
|
757
|
+
boxShadow: ot.trophy,
|
|
757
758
|
display: "flex",
|
|
758
759
|
alignItems: "center",
|
|
759
760
|
justifyContent: "center",
|
|
760
761
|
fontSize: "1em",
|
|
761
|
-
animation: `${
|
|
762
|
+
animation: `${yn} .5s .55s ease-out both`
|
|
762
763
|
}, e = (o, a) => {
|
|
763
764
|
const [u, m] = o.split("-"), c = a ? m === "left" ? "right" : "left" : m;
|
|
764
765
|
return d(n, { [u]: s(-4), [c]: s(-4) });
|
|
765
766
|
}, r = {};
|
|
766
|
-
for (const o of
|
|
767
|
+
for (const o of Me)
|
|
767
768
|
r[`${o}|ltr`] = e(o, !1), r[`${o}|rtl`] = e(o, !0);
|
|
768
769
|
return { at: r, icon: d({ fontSize: s(t.trophy * 0.5) }) };
|
|
769
|
-
},
|
|
770
|
+
}, rn = (t, n) => {
|
|
770
771
|
const e = (a) => d({
|
|
771
772
|
position: "relative",
|
|
772
773
|
height: s(a),
|
|
@@ -781,13 +782,13 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
781
782
|
boxSizing: "border-box",
|
|
782
783
|
containerType: "inline-size",
|
|
783
784
|
paddingBlock: s(t.colPad[0]),
|
|
784
|
-
...
|
|
785
|
+
...en(t.colPad[1]),
|
|
785
786
|
display: "flex",
|
|
786
787
|
flexDirection: "column",
|
|
787
788
|
alignItems: "center",
|
|
788
789
|
justifyContent: "center",
|
|
789
790
|
gap: s(a),
|
|
790
|
-
transition: `flex-basis .6s ${
|
|
791
|
+
transition: `flex-basis .6s ${pt}`
|
|
791
792
|
}), o = n ? { width: "100%" } : { minWidth: `min(${s(180, t.btnFont)}, 100%)`, maxWidth: "100%" };
|
|
792
793
|
return {
|
|
793
794
|
bar: e(t.arenaBar),
|
|
@@ -799,7 +800,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
799
800
|
position: "absolute",
|
|
800
801
|
inset: 0,
|
|
801
802
|
backgroundColor: i.tint,
|
|
802
|
-
transition: `clip-path .6s ${
|
|
803
|
+
transition: `clip-path .6s ${pt}, background-color .3s`
|
|
803
804
|
}),
|
|
804
805
|
layerNeutral: d({
|
|
805
806
|
position: "absolute",
|
|
@@ -810,7 +811,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
810
811
|
position: "absolute",
|
|
811
812
|
inset: 0,
|
|
812
813
|
backgroundColor: i.fill,
|
|
813
|
-
animation: `${
|
|
814
|
+
animation: `${Pe} .9s ${pt} both`
|
|
814
815
|
}),
|
|
815
816
|
column: r(t.colGap),
|
|
816
817
|
columnFill: r(10),
|
|
@@ -830,17 +831,17 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
830
831
|
} : {}
|
|
831
832
|
),
|
|
832
833
|
name: d({
|
|
833
|
-
...
|
|
834
|
-
|
|
835
|
-
...
|
|
836
|
-
...
|
|
837
|
-
...
|
|
834
|
+
...V,
|
|
835
|
+
...Ft(t.name),
|
|
836
|
+
...mt,
|
|
837
|
+
...ft,
|
|
838
|
+
...Rt,
|
|
838
839
|
textAlign: "center",
|
|
839
840
|
textWrap: "balance"
|
|
840
841
|
}),
|
|
841
842
|
pct: d({
|
|
842
|
-
...
|
|
843
|
-
...
|
|
843
|
+
...V,
|
|
844
|
+
...Wt(t.pctFill),
|
|
844
845
|
color: i.ink,
|
|
845
846
|
fontVariantNumeric: "tabular-nums"
|
|
846
847
|
}),
|
|
@@ -858,7 +859,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
858
859
|
display: "flex",
|
|
859
860
|
justifyContent: "center"
|
|
860
861
|
}),
|
|
861
|
-
...
|
|
862
|
+
...xn(t.btnH, t.btnFont, o),
|
|
862
863
|
// Winner panel
|
|
863
864
|
winColumn: d({
|
|
864
865
|
position: "relative",
|
|
@@ -867,8 +868,8 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
867
868
|
boxSizing: "border-box",
|
|
868
869
|
containerType: "inline-size",
|
|
869
870
|
paddingBlock: s(n ? 12 : 24),
|
|
870
|
-
...
|
|
871
|
-
transition: `flex-basis .6s ${
|
|
871
|
+
...en(n ? 12 : 24),
|
|
872
|
+
transition: `flex-basis .6s ${pt}`,
|
|
872
873
|
display: "flex",
|
|
873
874
|
alignItems: "center",
|
|
874
875
|
justifyContent: "center"
|
|
@@ -882,7 +883,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
882
883
|
textAlign: n ? "center" : "start",
|
|
883
884
|
color: i.on,
|
|
884
885
|
minWidth: 0,
|
|
885
|
-
animation: `${
|
|
886
|
+
animation: `${Ot} .6s .25s ease-out both`
|
|
886
887
|
}),
|
|
887
888
|
winWrap: d({
|
|
888
889
|
position: "relative",
|
|
@@ -902,7 +903,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
902
903
|
pointerEvents: "none",
|
|
903
904
|
background: `repeating-conic-gradient(from 0deg, color-mix(in srgb, ${i.on} 12%, transparent) 0deg 9deg, transparent 9deg 18deg), radial-gradient(circle closest-side, color-mix(in srgb, ${i.on} 24%, transparent) 0%, transparent 72%)`,
|
|
904
905
|
maskImage: "radial-gradient(circle closest-side, #000 28%, transparent 100%)",
|
|
905
|
-
animation: `${
|
|
906
|
+
animation: `${Te} 80s linear infinite`
|
|
906
907
|
}),
|
|
907
908
|
winText: d({
|
|
908
909
|
minWidth: 0,
|
|
@@ -917,11 +918,11 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
917
918
|
...I(t.eyebrow)
|
|
918
919
|
}),
|
|
919
920
|
winName: d({
|
|
920
|
-
...
|
|
921
|
-
|
|
922
|
-
...
|
|
923
|
-
...
|
|
924
|
-
...
|
|
921
|
+
...V,
|
|
922
|
+
...Ft(t.winName),
|
|
923
|
+
...mt,
|
|
924
|
+
...ft,
|
|
925
|
+
...Rt,
|
|
925
926
|
letterSpacing: "-0.01em",
|
|
926
927
|
textWrap: "balance"
|
|
927
928
|
}),
|
|
@@ -940,8 +941,8 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
940
941
|
}
|
|
941
942
|
),
|
|
942
943
|
winPct: d({
|
|
943
|
-
...
|
|
944
|
-
...
|
|
944
|
+
...V,
|
|
945
|
+
...Wt(t.winPct),
|
|
945
946
|
fontVariantNumeric: "tabular-nums"
|
|
946
947
|
}),
|
|
947
948
|
ofVotes: d({ fontWeight: 500, ...I([14, 20]) }),
|
|
@@ -953,7 +954,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
953
954
|
gap: s(6),
|
|
954
955
|
textAlign: "center",
|
|
955
956
|
minWidth: 0,
|
|
956
|
-
animation: `${
|
|
957
|
+
animation: `${Ot} .6s .4s ease-out both`
|
|
957
958
|
}),
|
|
958
959
|
loserSlot: d({
|
|
959
960
|
width: "100%",
|
|
@@ -964,23 +965,23 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
964
965
|
filter: "grayscale(1) opacity(0.7)"
|
|
965
966
|
}),
|
|
966
967
|
loserName: d({
|
|
967
|
-
...
|
|
968
|
-
|
|
969
|
-
...
|
|
970
|
-
...
|
|
971
|
-
...
|
|
968
|
+
...V,
|
|
969
|
+
...Ft(t.loserName),
|
|
970
|
+
...mt,
|
|
971
|
+
...ft,
|
|
972
|
+
...Rt,
|
|
972
973
|
paddingTop: s(2),
|
|
973
974
|
textWrap: "balance"
|
|
974
975
|
}),
|
|
975
976
|
loserPct: d({
|
|
976
|
-
...
|
|
977
|
-
...
|
|
977
|
+
...V,
|
|
978
|
+
...Wt(t.loserPct),
|
|
978
979
|
fontVariantNumeric: "tabular-nums"
|
|
979
980
|
}),
|
|
980
|
-
img:
|
|
981
|
-
trophy:
|
|
981
|
+
img: Le(t),
|
|
982
|
+
trophy: kn(t)
|
|
982
983
|
};
|
|
983
|
-
},
|
|
984
|
+
}, Ne = () => ({
|
|
984
985
|
shell: d({
|
|
985
986
|
display: "flex",
|
|
986
987
|
flexDirection: "column",
|
|
@@ -992,7 +993,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
992
993
|
}),
|
|
993
994
|
row: d({
|
|
994
995
|
position: "relative",
|
|
995
|
-
height: s(
|
|
996
|
+
height: s(Ct),
|
|
996
997
|
boxSizing: "border-box",
|
|
997
998
|
padding: `0 ${s(12)}`,
|
|
998
999
|
display: "flex",
|
|
@@ -1002,7 +1003,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1002
1003
|
}),
|
|
1003
1004
|
rowNeutral: d({
|
|
1004
1005
|
position: "relative",
|
|
1005
|
-
height: s(
|
|
1006
|
+
height: s(Ct),
|
|
1006
1007
|
boxSizing: "border-box",
|
|
1007
1008
|
padding: `0 ${s(12)}`,
|
|
1008
1009
|
display: "flex",
|
|
@@ -1011,7 +1012,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1011
1012
|
}),
|
|
1012
1013
|
rowWinner: d({
|
|
1013
1014
|
position: "relative",
|
|
1014
|
-
height: s(
|
|
1015
|
+
height: s(Ct),
|
|
1015
1016
|
boxSizing: "border-box",
|
|
1016
1017
|
padding: `0 ${s(12)}`,
|
|
1017
1018
|
display: "flex",
|
|
@@ -1019,40 +1020,40 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1019
1020
|
gap: s(12),
|
|
1020
1021
|
backgroundColor: i.fill,
|
|
1021
1022
|
color: i.on,
|
|
1022
|
-
animation: `${
|
|
1023
|
+
animation: `${Ot} .6s ease-out both`
|
|
1023
1024
|
}),
|
|
1024
1025
|
greyed: d({ filter: "grayscale(1) opacity(0.7)", display: "flex" }),
|
|
1025
1026
|
imgWrap: d({ position: "relative", display: "flex", flexShrink: 0 }),
|
|
1026
1027
|
name: d({
|
|
1027
|
-
...
|
|
1028
|
+
...V,
|
|
1028
1029
|
...I([15, 20]),
|
|
1029
|
-
...
|
|
1030
|
-
...
|
|
1030
|
+
...mt,
|
|
1031
|
+
...ft,
|
|
1031
1032
|
flex: 1,
|
|
1032
1033
|
minWidth: 0
|
|
1033
1034
|
}),
|
|
1034
1035
|
pct: d({
|
|
1035
|
-
...
|
|
1036
|
+
...V,
|
|
1036
1037
|
...I([20, 24]),
|
|
1037
1038
|
color: i.ink,
|
|
1038
1039
|
fontVariantNumeric: "tabular-nums",
|
|
1039
1040
|
flexShrink: 0
|
|
1040
1041
|
}),
|
|
1041
1042
|
pctOn: d({
|
|
1042
|
-
...
|
|
1043
|
+
...V,
|
|
1043
1044
|
...I([20, 24]),
|
|
1044
1045
|
fontVariantNumeric: "tabular-nums",
|
|
1045
1046
|
flexShrink: 0
|
|
1046
1047
|
}),
|
|
1047
1048
|
action: d({ width: s(104), flexShrink: 0, display: "flex" }),
|
|
1048
|
-
...
|
|
1049
|
-
trophy:
|
|
1050
|
-
}),
|
|
1051
|
-
const [o, a] =
|
|
1052
|
-
return t.kind === "player" ? /* @__PURE__ */ l("div", { css:
|
|
1049
|
+
...xn(40, 14, { width: "100%" }),
|
|
1050
|
+
trophy: kn({ trophy: 22, trophyRing: 2 })
|
|
1051
|
+
}), h = { d: rn(tt, !1), m: rn(nt, !0) }, R = Ne(), Z = ({ side: t, layout: n, variant: e, language: r }) => {
|
|
1052
|
+
const [o, a] = A(null), u = t.image && o !== t.image ? t.image : null;
|
|
1053
|
+
return t.kind === "player" ? /* @__PURE__ */ l("div", { css: h[n].img[e].headshot, "aria-hidden": "true", children: /* @__PURE__ */ l(
|
|
1053
1054
|
"img",
|
|
1054
1055
|
{
|
|
1055
|
-
src: u ??
|
|
1056
|
+
src: u ?? Un.playerPlaceholder,
|
|
1056
1057
|
alt: "",
|
|
1057
1058
|
loading: "lazy",
|
|
1058
1059
|
decoding: "async",
|
|
@@ -1061,37 +1062,37 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1061
1062
|
) }) : u ? /* @__PURE__ */ l(
|
|
1062
1063
|
"img",
|
|
1063
1064
|
{
|
|
1064
|
-
css:
|
|
1065
|
+
css: h[n].img[e].logo,
|
|
1065
1066
|
src: u,
|
|
1066
1067
|
alt: "",
|
|
1067
1068
|
loading: "lazy",
|
|
1068
1069
|
decoding: "async",
|
|
1069
1070
|
onError: () => a(u)
|
|
1070
1071
|
}
|
|
1071
|
-
) : /* @__PURE__ */ l("div", { css:
|
|
1072
|
-
},
|
|
1073
|
-
const r = `${t}|${
|
|
1072
|
+
) : /* @__PURE__ */ l("div", { css: h[n].img[e].initials, "aria-hidden": "true", children: Yn(t.name, r) });
|
|
1073
|
+
}, Sn = ({ position: t, layout: n, row: e }) => {
|
|
1074
|
+
const r = `${t}|${Tt() ? "rtl" : "ltr"}`;
|
|
1074
1075
|
return /* @__PURE__ */ l(
|
|
1075
1076
|
"div",
|
|
1076
1077
|
{
|
|
1077
|
-
css: e ?
|
|
1078
|
+
css: e ? R.trophy.at[r] : h[n].trophy.at[r],
|
|
1078
1079
|
"aria-hidden": "true",
|
|
1079
1080
|
children: /* @__PURE__ */ l(
|
|
1080
|
-
|
|
1081
|
+
te,
|
|
1081
1082
|
{
|
|
1082
|
-
css: e ?
|
|
1083
|
+
css: e ? R.trophy.icon : h[n].trophy.icon
|
|
1083
1084
|
}
|
|
1084
1085
|
)
|
|
1085
1086
|
}
|
|
1086
1087
|
);
|
|
1087
|
-
},
|
|
1088
|
+
}, De = (t) => {
|
|
1088
1089
|
if (t != null && t.onClick) return t.onClick;
|
|
1089
1090
|
const n = t == null ? void 0 : t.url;
|
|
1090
1091
|
if (n)
|
|
1091
1092
|
return () => {
|
|
1092
1093
|
((t == null ? void 0 : t.target) ?? "_self") === "_blank" ? window.open(n, "_blank") : window.location.href = n;
|
|
1093
1094
|
};
|
|
1094
|
-
},
|
|
1095
|
+
}, In = ({
|
|
1095
1096
|
state: t,
|
|
1096
1097
|
layout: n,
|
|
1097
1098
|
row: e,
|
|
@@ -1100,51 +1101,51 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1100
1101
|
onVote: a
|
|
1101
1102
|
}) => {
|
|
1102
1103
|
if (t === "signIn") {
|
|
1103
|
-
if (o != null && o.component) return /* @__PURE__ */ l(
|
|
1104
|
-
const u =
|
|
1104
|
+
if (o != null && o.component) return /* @__PURE__ */ l(Pt, { children: o.component });
|
|
1105
|
+
const u = De(o);
|
|
1105
1106
|
return /* @__PURE__ */ l(
|
|
1106
1107
|
"button",
|
|
1107
1108
|
{
|
|
1108
1109
|
type: "button",
|
|
1109
|
-
css: e ?
|
|
1110
|
+
css: e ? R.vote : h[n].vote,
|
|
1110
1111
|
disabled: !u,
|
|
1111
1112
|
onClick: u,
|
|
1112
1113
|
children: /* @__PURE__ */ l("span", { children: (o == null ? void 0 : o.defaultLabel) || r.signIn })
|
|
1113
1114
|
}
|
|
1114
1115
|
);
|
|
1115
1116
|
}
|
|
1116
|
-
return t === "chosen" ? /* @__PURE__ */ b("div", { css: e ?
|
|
1117
|
-
/* @__PURE__ */ l(
|
|
1117
|
+
return t === "chosen" ? /* @__PURE__ */ b("div", { css: e ? R.thanks : h[n].thanks, role: "status", children: [
|
|
1118
|
+
/* @__PURE__ */ l(ne, { css: h.d.icon }),
|
|
1118
1119
|
/* @__PURE__ */ l("span", { children: r.thankYou })
|
|
1119
1120
|
] }) : t === "locked" ? null : /* @__PURE__ */ l(
|
|
1120
1121
|
"button",
|
|
1121
1122
|
{
|
|
1122
1123
|
type: "button",
|
|
1123
|
-
css: e ?
|
|
1124
|
+
css: e ? R.vote : h[n].vote,
|
|
1124
1125
|
"aria-label": r.voteFor,
|
|
1125
|
-
disabled: t === "submitting",
|
|
1126
|
+
disabled: t === "submitting" || t === "upcoming",
|
|
1126
1127
|
onClick: a,
|
|
1127
1128
|
children: /* @__PURE__ */ l("span", { children: r.vote })
|
|
1128
1129
|
}
|
|
1129
1130
|
);
|
|
1130
|
-
},
|
|
1131
|
+
}, _ = (t, n) => ({
|
|
1131
1132
|
"--bof-fill": t.fill,
|
|
1132
1133
|
"--bof-on": t.on,
|
|
1133
1134
|
"--bof-ink": t.ink,
|
|
1134
1135
|
...n ? { "--bof-from": n } : {}
|
|
1135
|
-
}),
|
|
1136
|
-
...
|
|
1136
|
+
}), Lt = (t, n) => ({
|
|
1137
|
+
..._(t.colours[n]),
|
|
1137
1138
|
flex: `0 0 ${t.widths[n]}%`,
|
|
1138
1139
|
"--bof-pad-start": n > 0 ? `${t.slant}%` : "0%",
|
|
1139
1140
|
"--bof-pad-end": n < t.sides.length - 1 ? `${t.slant}%` : "0%"
|
|
1140
|
-
}),
|
|
1141
|
+
}), vn = (t, n) => ({
|
|
1141
1142
|
vote: t.label("vote"),
|
|
1142
1143
|
voteFor: t.label("voteFor", { name: n.name }),
|
|
1143
1144
|
thankYou: t.label("thankYou"),
|
|
1144
1145
|
signIn: t.label("signIn")
|
|
1145
|
-
}),
|
|
1146
|
+
}), Be = ({ view: t }) => /* @__PURE__ */ l("div", { css: R.shell, role: "group", "aria-label": t.splitLabel ?? void 0, children: t.sides.map((n, e) => {
|
|
1146
1147
|
const r = t.winner === e, o = t.winner !== null && !r, a = /* @__PURE__ */ l(
|
|
1147
|
-
|
|
1148
|
+
Z,
|
|
1148
1149
|
{
|
|
1149
1150
|
side: n,
|
|
1150
1151
|
layout: "m",
|
|
@@ -1155,22 +1156,22 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1155
1156
|
return /* @__PURE__ */ b(
|
|
1156
1157
|
"div",
|
|
1157
1158
|
{
|
|
1158
|
-
css: r ?
|
|
1159
|
-
style:
|
|
1159
|
+
css: r ? R.rowWinner : t.lit[e] && !o ? R.row : R.rowNeutral,
|
|
1160
|
+
style: _(t.colours[e]),
|
|
1160
1161
|
children: [
|
|
1161
|
-
/* @__PURE__ */ b("div", { css:
|
|
1162
|
-
o ? /* @__PURE__ */ l("div", { css:
|
|
1163
|
-
r && t.showTrophy && /* @__PURE__ */ l(
|
|
1162
|
+
/* @__PURE__ */ b("div", { css: R.imgWrap, children: [
|
|
1163
|
+
o ? /* @__PURE__ */ l("div", { css: R.greyed, children: a }) : a,
|
|
1164
|
+
r && t.showTrophy && /* @__PURE__ */ l(Sn, { position: t.trophyPosition, layout: "m", row: !0 })
|
|
1164
1165
|
] }),
|
|
1165
|
-
/* @__PURE__ */ l("div", { css:
|
|
1166
|
-
t.fill && t.percents[e] !== null && /* @__PURE__ */ l("div", { css: r ?
|
|
1167
|
-
!t.ended && /* @__PURE__ */ l("div", { css:
|
|
1168
|
-
|
|
1166
|
+
/* @__PURE__ */ l("div", { css: R.name, children: n.name }),
|
|
1167
|
+
t.fill && t.percents[e] !== null && /* @__PURE__ */ l("div", { css: r ? R.pctOn : R.pct, children: t.percents[e] }),
|
|
1168
|
+
!t.ended && /* @__PURE__ */ l("div", { css: R.action, children: /* @__PURE__ */ l(
|
|
1169
|
+
In,
|
|
1169
1170
|
{
|
|
1170
1171
|
state: t.actions[e],
|
|
1171
1172
|
layout: "m",
|
|
1172
1173
|
row: !0,
|
|
1173
|
-
labels:
|
|
1174
|
+
labels: vn(t, n),
|
|
1174
1175
|
signInCTA: t.signInCTA,
|
|
1175
1176
|
onVote: () => t.onVote(e)
|
|
1176
1177
|
}
|
|
@@ -1179,16 +1180,16 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1179
1180
|
},
|
|
1180
1181
|
n.optionId
|
|
1181
1182
|
);
|
|
1182
|
-
}) }),
|
|
1183
|
+
}) }), ze = ({
|
|
1183
1184
|
view: t,
|
|
1184
1185
|
index: n
|
|
1185
1186
|
}) => {
|
|
1186
1187
|
const e = t.sides[n];
|
|
1187
|
-
return /* @__PURE__ */ l("div", { css:
|
|
1188
|
-
/* @__PURE__ */ b("div", { css:
|
|
1189
|
-
/* @__PURE__ */ l("div", { css:
|
|
1188
|
+
return /* @__PURE__ */ l("div", { css: h[t.layout].winColumn, style: Lt(t, n), children: /* @__PURE__ */ b("div", { css: h[t.layout].winContent, children: [
|
|
1189
|
+
/* @__PURE__ */ b("div", { css: h[t.layout].winWrap, children: [
|
|
1190
|
+
/* @__PURE__ */ l("div", { css: h[t.layout].rays, "aria-hidden": "true" }),
|
|
1190
1191
|
/* @__PURE__ */ l(
|
|
1191
|
-
|
|
1192
|
+
Z,
|
|
1192
1193
|
{
|
|
1193
1194
|
side: e,
|
|
1194
1195
|
layout: t.layout,
|
|
@@ -1197,7 +1198,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1197
1198
|
}
|
|
1198
1199
|
),
|
|
1199
1200
|
t.showTrophy && /* @__PURE__ */ l(
|
|
1200
|
-
|
|
1201
|
+
Sn,
|
|
1201
1202
|
{
|
|
1202
1203
|
position: t.trophyPosition,
|
|
1203
1204
|
layout: t.layout,
|
|
@@ -1205,23 +1206,23 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1205
1206
|
}
|
|
1206
1207
|
)
|
|
1207
1208
|
] }),
|
|
1208
|
-
/* @__PURE__ */ b("div", { css:
|
|
1209
|
-
/* @__PURE__ */ l("div", { css:
|
|
1210
|
-
/* @__PURE__ */ l("div", { css:
|
|
1211
|
-
t.fill && t.percents[n] !== null && /* @__PURE__ */ b("div", { css:
|
|
1212
|
-
/* @__PURE__ */ l("span", { css:
|
|
1213
|
-
/* @__PURE__ */ l("span", { css:
|
|
1209
|
+
/* @__PURE__ */ b("div", { css: h[t.layout].winText, children: [
|
|
1210
|
+
/* @__PURE__ */ l("div", { css: h[t.layout].eyebrow, children: t.label("winner") }),
|
|
1211
|
+
/* @__PURE__ */ l("div", { css: h[t.layout].winName, children: e.name }),
|
|
1212
|
+
t.fill && t.percents[n] !== null && /* @__PURE__ */ b("div", { css: h[t.layout].winPctRow, children: [
|
|
1213
|
+
/* @__PURE__ */ l("span", { css: h[t.layout].winPct, children: t.percents[n] }),
|
|
1214
|
+
/* @__PURE__ */ l("span", { css: h[t.layout].ofVotes, children: t.label("ofTheVotes") })
|
|
1214
1215
|
] })
|
|
1215
1216
|
] })
|
|
1216
1217
|
] }) });
|
|
1217
|
-
},
|
|
1218
|
+
}, Ae = ({
|
|
1218
1219
|
view: t,
|
|
1219
1220
|
index: n
|
|
1220
1221
|
}) => {
|
|
1221
1222
|
const e = t.sides[n];
|
|
1222
|
-
return /* @__PURE__ */ l("div", { css:
|
|
1223
|
-
/* @__PURE__ */ l("div", { css:
|
|
1224
|
-
|
|
1223
|
+
return /* @__PURE__ */ l("div", { css: h[t.layout].winColumn, style: Lt(t, n), children: /* @__PURE__ */ b("div", { css: h[t.layout].loserContent, children: [
|
|
1224
|
+
/* @__PURE__ */ l("div", { css: h[t.layout].loserSlot, children: /* @__PURE__ */ l(
|
|
1225
|
+
Z,
|
|
1225
1226
|
{
|
|
1226
1227
|
side: e,
|
|
1227
1228
|
layout: t.layout,
|
|
@@ -1229,10 +1230,10 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1229
1230
|
language: t.language
|
|
1230
1231
|
}
|
|
1231
1232
|
) }),
|
|
1232
|
-
/* @__PURE__ */ l("div", { css:
|
|
1233
|
-
t.fill && t.percents[n] !== null && /* @__PURE__ */ l("div", { css:
|
|
1233
|
+
/* @__PURE__ */ l("div", { css: h[t.layout].loserName, children: e.name }),
|
|
1234
|
+
t.fill && t.percents[n] !== null && /* @__PURE__ */ l("div", { css: h[t.layout].loserPct, children: t.percents[n] })
|
|
1234
1235
|
] }) });
|
|
1235
|
-
},
|
|
1236
|
+
}, Ve = ({
|
|
1236
1237
|
view: t,
|
|
1237
1238
|
index: n
|
|
1238
1239
|
}) => {
|
|
@@ -1240,11 +1241,11 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1240
1241
|
return /* @__PURE__ */ b(
|
|
1241
1242
|
"div",
|
|
1242
1243
|
{
|
|
1243
|
-
css: t.fill ?
|
|
1244
|
-
style:
|
|
1244
|
+
css: t.fill ? h[t.layout].columnFill : h[t.layout].column,
|
|
1245
|
+
style: Lt(t, n),
|
|
1245
1246
|
children: [
|
|
1246
|
-
/* @__PURE__ */ l("div", { css:
|
|
1247
|
-
|
|
1247
|
+
/* @__PURE__ */ l("div", { css: h[t.layout].imgSlot, children: /* @__PURE__ */ l(
|
|
1248
|
+
Z,
|
|
1248
1249
|
{
|
|
1249
1250
|
side: e,
|
|
1250
1251
|
layout: t.layout,
|
|
@@ -1252,19 +1253,19 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1252
1253
|
language: t.language
|
|
1253
1254
|
}
|
|
1254
1255
|
) }),
|
|
1255
|
-
/* @__PURE__ */ l("div", { css:
|
|
1256
|
-
t.fill && t.percents[n] !== null && /* @__PURE__ */ l("div", { css:
|
|
1256
|
+
/* @__PURE__ */ l("div", { css: h[t.layout].nameBox, children: /* @__PURE__ */ l("div", { css: h[t.layout].name, children: e.name }) }),
|
|
1257
|
+
t.fill && t.percents[n] !== null && /* @__PURE__ */ l("div", { css: h[t.layout].pct, children: t.percents[n] }),
|
|
1257
1258
|
!t.ended && /* @__PURE__ */ l(
|
|
1258
1259
|
"div",
|
|
1259
1260
|
{
|
|
1260
|
-
css: t.fill ?
|
|
1261
|
+
css: t.fill ? h[t.layout].actionFill : h[t.layout].action,
|
|
1261
1262
|
children: /* @__PURE__ */ l(
|
|
1262
|
-
|
|
1263
|
+
In,
|
|
1263
1264
|
{
|
|
1264
1265
|
state: t.actions[n],
|
|
1265
1266
|
layout: t.layout,
|
|
1266
1267
|
row: !1,
|
|
1267
|
-
labels:
|
|
1268
|
+
labels: vn(t, e),
|
|
1268
1269
|
signInCTA: t.signInCTA,
|
|
1269
1270
|
onVote: () => t.onVote(n)
|
|
1270
1271
|
}
|
|
@@ -1274,23 +1275,23 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1274
1275
|
]
|
|
1275
1276
|
}
|
|
1276
1277
|
);
|
|
1277
|
-
},
|
|
1278
|
-
if (t.rows) return /* @__PURE__ */ l(
|
|
1278
|
+
}, _e = ({ view: t }) => {
|
|
1279
|
+
if (t.rows) return /* @__PURE__ */ l(Be, { view: t });
|
|
1279
1280
|
const n = t.winner;
|
|
1280
1281
|
return /* @__PURE__ */ b(
|
|
1281
1282
|
"div",
|
|
1282
1283
|
{
|
|
1283
|
-
css: t.fill ?
|
|
1284
|
+
css: t.fill ? h[t.layout].fill : h[t.layout].bar,
|
|
1284
1285
|
role: "group",
|
|
1285
1286
|
"aria-label": t.splitLabel ?? void 0,
|
|
1286
1287
|
children: [
|
|
1287
1288
|
n !== null ? /* @__PURE__ */ l(
|
|
1288
1289
|
"div",
|
|
1289
1290
|
{
|
|
1290
|
-
css:
|
|
1291
|
+
css: h[t.layout].layerWinner,
|
|
1291
1292
|
"aria-hidden": "true",
|
|
1292
1293
|
style: {
|
|
1293
|
-
...
|
|
1294
|
+
..._(t.colours[n], t.evenClips[n]),
|
|
1294
1295
|
clipPath: t.clips[n]
|
|
1295
1296
|
}
|
|
1296
1297
|
},
|
|
@@ -1298,71 +1299,80 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1298
1299
|
) : t.sides.map((e, r) => /* @__PURE__ */ l(
|
|
1299
1300
|
"div",
|
|
1300
1301
|
{
|
|
1301
|
-
css: t.lit[r] ?
|
|
1302
|
+
css: t.lit[r] ? h[t.layout].layer : h[t.layout].layerNeutral,
|
|
1302
1303
|
"aria-hidden": "true",
|
|
1303
|
-
style: { ...
|
|
1304
|
+
style: { ..._(t.colours[r]), clipPath: t.clips[r] }
|
|
1304
1305
|
},
|
|
1305
1306
|
e.optionId
|
|
1306
1307
|
)),
|
|
1307
1308
|
t.sides.map(
|
|
1308
|
-
(e, r) => n === null ? /* @__PURE__ */ l(
|
|
1309
|
+
(e, r) => n === null ? /* @__PURE__ */ l(Ve, { view: t, index: r }, e.optionId) : r === n ? /* @__PURE__ */ l(ze, { view: t, index: r }, e.optionId) : /* @__PURE__ */ l(Ae, { view: t, index: r }, e.optionId)
|
|
1309
1310
|
)
|
|
1310
1311
|
]
|
|
1311
1312
|
}
|
|
1312
1313
|
);
|
|
1313
|
-
},
|
|
1314
|
-
const
|
|
1315
|
-
() => new Intl.NumberFormat(
|
|
1314
|
+
}, He = ({ layout: t, label: n, caption: e, left: r }) => {
|
|
1315
|
+
const o = fn(), a = q(
|
|
1316
|
+
() => new Intl.NumberFormat(o, {
|
|
1316
1317
|
minimumIntegerDigits: 2,
|
|
1317
1318
|
useGrouping: !1
|
|
1318
1319
|
}),
|
|
1319
|
-
[
|
|
1320
|
-
),
|
|
1321
|
-
{ value:
|
|
1322
|
-
{ value:
|
|
1323
|
-
{ value:
|
|
1324
|
-
{ value:
|
|
1320
|
+
[o]
|
|
1321
|
+
), u = [
|
|
1322
|
+
{ value: r.days, caption: n("days") },
|
|
1323
|
+
{ value: r.hours, caption: n("hours") },
|
|
1324
|
+
{ value: r.minutes, caption: n("minutes") },
|
|
1325
|
+
{ value: r.seconds, caption: n("seconds") }
|
|
1325
1326
|
];
|
|
1326
|
-
return /* @__PURE__ */ b("div", { css:
|
|
1327
|
-
/* @__PURE__ */ l("div", { css:
|
|
1328
|
-
/* @__PURE__ */ l("div", { css:
|
|
1329
|
-
t === "d" &&
|
|
1330
|
-
/* @__PURE__ */ b("div", { css:
|
|
1331
|
-
/* @__PURE__ */ l("div", { css:
|
|
1332
|
-
/* @__PURE__ */ l("div", { css:
|
|
1327
|
+
return /* @__PURE__ */ b("div", { css: Y[t].root, children: [
|
|
1328
|
+
/* @__PURE__ */ l("div", { css: Y[t].label, children: e }),
|
|
1329
|
+
/* @__PURE__ */ l("div", { css: Y[t].units, children: u.map((m, c) => /* @__PURE__ */ b(un.Fragment, { children: [
|
|
1330
|
+
t === "d" && c > 0 && /* @__PURE__ */ l("div", { css: Y.d.colon, "aria-hidden": "true", children: ":" }),
|
|
1331
|
+
/* @__PURE__ */ b("div", { css: Y[t].unit, children: [
|
|
1332
|
+
/* @__PURE__ */ l("div", { css: Y[t].value, children: a.format(m.value) }),
|
|
1333
|
+
/* @__PURE__ */ l("div", { css: Y[t].caption, children: m.caption })
|
|
1333
1334
|
] })
|
|
1334
|
-
] },
|
|
1335
|
+
] }, c)) })
|
|
1335
1336
|
] });
|
|
1336
|
-
},
|
|
1337
|
+
}, je = ({
|
|
1337
1338
|
layout: t,
|
|
1338
1339
|
label: n,
|
|
1339
1340
|
title: e,
|
|
1340
1341
|
openSubtitle: r,
|
|
1341
1342
|
ended: o,
|
|
1342
1343
|
draw: a,
|
|
1343
|
-
|
|
1344
|
+
upcoming: u,
|
|
1345
|
+
left: m
|
|
1344
1346
|
}) => {
|
|
1345
|
-
const
|
|
1347
|
+
const c = [
|
|
1346
1348
|
{ key: "open", text: r, on: !o },
|
|
1347
1349
|
{ key: "ended", text: n("endedSubtitle"), on: o && !a },
|
|
1348
1350
|
{ key: "draw", text: n("drawSubtitle"), on: o && a }
|
|
1349
|
-
],
|
|
1351
|
+
], f = o ? /* @__PURE__ */ l("div", { css: y[t].pill, children: n("votingEnded") }) : m ? /* @__PURE__ */ l(
|
|
1352
|
+
He,
|
|
1353
|
+
{
|
|
1354
|
+
layout: t,
|
|
1355
|
+
label: n,
|
|
1356
|
+
caption: n(u ? "votingStartsIn" : "votingEndsIn"),
|
|
1357
|
+
left: m
|
|
1358
|
+
}
|
|
1359
|
+
) : u ? /* @__PURE__ */ l("div", { css: y[t].pill, children: n("votingStartsSoon") }) : null;
|
|
1350
1360
|
return /* @__PURE__ */ b("div", { css: y[t].header, children: [
|
|
1351
1361
|
/* @__PURE__ */ b("div", { css: y[t].titles, children: [
|
|
1352
1362
|
/* @__PURE__ */ l("h2", { css: y[t].title, children: e }),
|
|
1353
|
-
/* @__PURE__ */ l("div", { css: y[t].subtitles, children:
|
|
1363
|
+
/* @__PURE__ */ l("div", { css: y[t].subtitles, children: c.map((p) => /* @__PURE__ */ l(
|
|
1354
1364
|
"p",
|
|
1355
1365
|
{
|
|
1356
|
-
css:
|
|
1357
|
-
"aria-hidden": !
|
|
1358
|
-
children:
|
|
1366
|
+
css: p.on ? y[t].subtitle : y[t].subtitleHidden,
|
|
1367
|
+
"aria-hidden": !p.on,
|
|
1368
|
+
children: p.text
|
|
1359
1369
|
},
|
|
1360
|
-
|
|
1370
|
+
p.key
|
|
1361
1371
|
)) })
|
|
1362
1372
|
] }),
|
|
1363
|
-
t === "m" ?
|
|
1373
|
+
t === "m" ? f && /* @__PURE__ */ l("div", { css: y.m.status, children: f }) : f
|
|
1364
1374
|
] });
|
|
1365
|
-
},
|
|
1375
|
+
}, sn = (t) => ({
|
|
1366
1376
|
fontSize: "1em",
|
|
1367
1377
|
display: "flex",
|
|
1368
1378
|
flexDirection: "column",
|
|
@@ -1370,16 +1380,16 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1370
1380
|
gap: t ? i.spaceMd : i.spaceLg,
|
|
1371
1381
|
padding: t ? i.spaceMd : `${s(32)} ${i.spaceLg}`,
|
|
1372
1382
|
borderRadius: i.radiusMd
|
|
1373
|
-
}),
|
|
1383
|
+
}), an = (t) => d({
|
|
1374
1384
|
flexShrink: 0,
|
|
1375
1385
|
width: "2px",
|
|
1376
1386
|
height: s(32),
|
|
1377
1387
|
backgroundColor: i.border,
|
|
1378
1388
|
transform: `skewX(${t ? 14 : -14}deg)`
|
|
1379
|
-
}),
|
|
1380
|
-
panel: d(
|
|
1389
|
+
}), ln = (t) => ({
|
|
1390
|
+
panel: d(sn(t), { backgroundColor: i.inner }),
|
|
1381
1391
|
// "after": the panel takes the picked side's tint.
|
|
1382
|
-
panelPicked: d(
|
|
1392
|
+
panelPicked: d(sn(t), { backgroundColor: i.tint }),
|
|
1383
1393
|
intro: d({
|
|
1384
1394
|
display: "flex",
|
|
1385
1395
|
flexDirection: "column",
|
|
@@ -1441,11 +1451,11 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1441
1451
|
backgroundColor: i.surface,
|
|
1442
1452
|
border: `${i.borderSize} solid ${i.border}`
|
|
1443
1453
|
})
|
|
1444
|
-
}),
|
|
1445
|
-
var
|
|
1446
|
-
const { layout: n, poll: e, sides: r, colours: o, picked: a } = t, { t: u } =
|
|
1454
|
+
}), j = { d: ln(!1), m: ln(!0) }, Ge = { ltr: an(!1), rtl: an(!0) }, qe = (t) => {
|
|
1455
|
+
var g;
|
|
1456
|
+
const { layout: n, poll: e, sides: r, colours: o, picked: a } = t, { t: u } = bt("common"), m = Tt(), c = a !== null ? r[a] : null, f = e.labels, p = c ? /* @__PURE__ */ b("div", { css: j[n].pick, children: [
|
|
1447
1457
|
/* @__PURE__ */ l(
|
|
1448
|
-
|
|
1458
|
+
Z,
|
|
1449
1459
|
{
|
|
1450
1460
|
side: c,
|
|
1451
1461
|
layout: n,
|
|
@@ -1453,39 +1463,39 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1453
1463
|
language: t.language
|
|
1454
1464
|
}
|
|
1455
1465
|
),
|
|
1456
|
-
/* @__PURE__ */ l("p", { css:
|
|
1457
|
-
] }) : /* @__PURE__ */ l("div", { css:
|
|
1458
|
-
|
|
1459
|
-
/* @__PURE__ */ l("span", { style:
|
|
1460
|
-
|
|
1466
|
+
/* @__PURE__ */ l("p", { css: j[n].pickName, children: c.name })
|
|
1467
|
+
] }) : /* @__PURE__ */ l("div", { css: j[n].sides, "aria-hidden": "true", children: r.map((F, B) => /* @__PURE__ */ b(un.Fragment, { children: [
|
|
1468
|
+
B > 0 && /* @__PURE__ */ l("span", { css: Ge[m ? "rtl" : "ltr"] }),
|
|
1469
|
+
/* @__PURE__ */ l("span", { style: _(o[B]), children: /* @__PURE__ */ l(
|
|
1470
|
+
Z,
|
|
1461
1471
|
{
|
|
1462
|
-
side:
|
|
1472
|
+
side: F,
|
|
1463
1473
|
layout: n,
|
|
1464
1474
|
variant: "row",
|
|
1465
1475
|
language: t.language
|
|
1466
1476
|
}
|
|
1467
1477
|
) })
|
|
1468
|
-
] },
|
|
1478
|
+
] }, F.optionId)) });
|
|
1469
1479
|
return /* @__PURE__ */ b(
|
|
1470
1480
|
"div",
|
|
1471
1481
|
{
|
|
1472
|
-
css: c ?
|
|
1482
|
+
css: c ? j[n].panelPicked : j[n].panel,
|
|
1473
1483
|
style: a !== null ? {
|
|
1474
|
-
...
|
|
1484
|
+
..._(o[a]),
|
|
1475
1485
|
"--fu-ucrc-primary-on-primary": o[a].on
|
|
1476
1486
|
} : void 0,
|
|
1477
1487
|
children: [
|
|
1478
|
-
/* @__PURE__ */ b("div", { css:
|
|
1488
|
+
/* @__PURE__ */ b("div", { css: j[n].intro, children: [
|
|
1479
1489
|
p,
|
|
1480
|
-
/* @__PURE__ */ l("h3", { css:
|
|
1481
|
-
/* @__PURE__ */ l("p", { css:
|
|
1490
|
+
/* @__PURE__ */ l("h3", { css: j[n].title, children: (f == null ? void 0 : f.leadTitle) || u("leads.header.title") }),
|
|
1491
|
+
/* @__PURE__ */ l("p", { css: j[n].description, children: (f == null ? void 0 : f.leadDescription) || u("leads.header.description") })
|
|
1482
1492
|
] }),
|
|
1483
|
-
/* @__PURE__ */ l("div", { css:
|
|
1484
|
-
|
|
1493
|
+
/* @__PURE__ */ l("div", { css: j[n].form, children: /* @__PURE__ */ l(
|
|
1494
|
+
An,
|
|
1485
1495
|
{
|
|
1486
1496
|
sdk: t.sdk,
|
|
1487
1497
|
brandingColors: c ? { primaryColor: o[a].fill } : void 0,
|
|
1488
|
-
brandingUrls: (
|
|
1498
|
+
brandingUrls: (g = e.branding) == null ? void 0 : g.urls,
|
|
1489
1499
|
fields: t.leads.fields,
|
|
1490
1500
|
campaignId: t.leads.campaignId,
|
|
1491
1501
|
campaignName: t.leads.campaignName,
|
|
@@ -1508,7 +1518,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1508
1518
|
]
|
|
1509
1519
|
}
|
|
1510
1520
|
);
|
|
1511
|
-
},
|
|
1521
|
+
}, cn = (t) => {
|
|
1512
1522
|
const n = {
|
|
1513
1523
|
flex: 1,
|
|
1514
1524
|
fontFamily: i.fontPrimary,
|
|
@@ -1571,7 +1581,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1571
1581
|
backgroundColor: i.track
|
|
1572
1582
|
})
|
|
1573
1583
|
};
|
|
1574
|
-
}, W = { d:
|
|
1584
|
+
}, W = { d: cn(tt), m: cn(nt) }, Ue = ({
|
|
1575
1585
|
layout: t,
|
|
1576
1586
|
label: n,
|
|
1577
1587
|
colours: e,
|
|
@@ -1583,7 +1593,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1583
1593
|
if (o.some((p) => p === null))
|
|
1584
1594
|
return /* @__PURE__ */ b("div", { css: W[t].root, children: [
|
|
1585
1595
|
/* @__PURE__ */ b("div", { css: W[t].lock, children: [
|
|
1586
|
-
/* @__PURE__ */ l(
|
|
1596
|
+
/* @__PURE__ */ l(ee, { css: W[t].lockIcon }),
|
|
1587
1597
|
/* @__PURE__ */ l("span", { children: n("voteToSeeResults") })
|
|
1588
1598
|
] }),
|
|
1589
1599
|
/* @__PURE__ */ l("div", { css: W[t].track, "aria-hidden": "true" })
|
|
@@ -1591,17 +1601,17 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1591
1601
|
const m = r.length, c = r.every((p) => p === 0) ? r.map(() => 1) : r, f = m - 1;
|
|
1592
1602
|
return /* @__PURE__ */ b("div", { css: W[t].root, children: [
|
|
1593
1603
|
m === 2 ? /* @__PURE__ */ b("div", { css: W[t].labels, children: [
|
|
1594
|
-
/* @__PURE__ */ l("div", { css: W[t].pct, style:
|
|
1604
|
+
/* @__PURE__ */ l("div", { css: W[t].pct, style: _(e[0]), children: o[0] }),
|
|
1595
1605
|
a && /* @__PURE__ */ l("div", { css: W[t].caption, children: n("finalResult") }),
|
|
1596
|
-
/* @__PURE__ */ l("div", { css: W[t].pctEnd, style:
|
|
1597
|
-
] }) : /* @__PURE__ */ l("div", { css: W[t].labels, children: o.map((p,
|
|
1606
|
+
/* @__PURE__ */ l("div", { css: W[t].pctEnd, style: _(e[1]), children: o[1] })
|
|
1607
|
+
] }) : /* @__PURE__ */ l("div", { css: W[t].labels, children: o.map((p, g) => /* @__PURE__ */ l(
|
|
1598
1608
|
"div",
|
|
1599
1609
|
{
|
|
1600
1610
|
css: W[t].cell,
|
|
1601
|
-
style: { ...
|
|
1611
|
+
style: { ..._(e[g]), flex: `${c[g]} 1 0%` },
|
|
1602
1612
|
children: p
|
|
1603
1613
|
},
|
|
1604
|
-
|
|
1614
|
+
g
|
|
1605
1615
|
)) }),
|
|
1606
1616
|
/* @__PURE__ */ l(
|
|
1607
1617
|
"div",
|
|
@@ -1609,66 +1619,71 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1609
1619
|
css: W[t].bar,
|
|
1610
1620
|
role: "img",
|
|
1611
1621
|
"aria-label": u ?? void 0,
|
|
1612
|
-
children: e.map((p,
|
|
1622
|
+
children: e.map((p, g) => /* @__PURE__ */ l(
|
|
1613
1623
|
"div",
|
|
1614
1624
|
{
|
|
1615
|
-
css:
|
|
1616
|
-
style: { ...
|
|
1625
|
+
css: g === 0 ? W[t].segFirst : g === f ? W[t].segLast : W[t].segMid,
|
|
1626
|
+
style: { ..._(p), flex: `${c[g]} 1 0%` }
|
|
1617
1627
|
},
|
|
1618
|
-
|
|
1628
|
+
g
|
|
1619
1629
|
))
|
|
1620
1630
|
}
|
|
1621
1631
|
)
|
|
1622
1632
|
] });
|
|
1623
|
-
},
|
|
1633
|
+
}, Ye = { d: s(90), m: s(120) }, $n = { d: s(tt.arenaFill), m: s(nt.arenaFill) }, Xe = { d: s(tt.arenaBar), m: s(nt.arenaBar) }, Ke = ({ layout: t, fill: n, odds: e, banner: r }) => /* @__PURE__ */ b("div", { css: y[t].root, "aria-busy": "true", children: [
|
|
1634
|
+
r,
|
|
1624
1635
|
/* @__PURE__ */ b("div", { css: y[t].body, children: [
|
|
1625
|
-
/* @__PURE__ */ l("div", { css: y[t].header, style: { minHeight:
|
|
1636
|
+
/* @__PURE__ */ l("div", { css: y[t].header, style: { minHeight: Ye[t] }, children: /* @__PURE__ */ l("div", { css: y[t].titleSkeleton }) }),
|
|
1626
1637
|
n ? /* @__PURE__ */ l(
|
|
1627
1638
|
"div",
|
|
1628
1639
|
{
|
|
1629
1640
|
css: y[t].arenaSkeleton,
|
|
1630
|
-
style: { height:
|
|
1641
|
+
style: { height: $n[t] }
|
|
1631
1642
|
}
|
|
1632
|
-
) : /* @__PURE__ */ b(
|
|
1643
|
+
) : /* @__PURE__ */ b(Pt, { children: [
|
|
1633
1644
|
/* @__PURE__ */ l(
|
|
1634
1645
|
"div",
|
|
1635
1646
|
{
|
|
1636
1647
|
css: y[t].arenaSkeleton,
|
|
1637
|
-
style: { height:
|
|
1648
|
+
style: { height: Xe[t] }
|
|
1638
1649
|
}
|
|
1639
1650
|
),
|
|
1640
1651
|
/* @__PURE__ */ l("div", { css: y[t].resultsSkeleton, children: /* @__PURE__ */ l("div", { css: y[t].barSkeleton }) })
|
|
1641
1652
|
] })
|
|
1642
1653
|
] }),
|
|
1643
|
-
e && /* @__PURE__ */ l("div", { css: y[t].oddsSlot, children: /* @__PURE__ */ l(
|
|
1644
|
-
] }),
|
|
1654
|
+
e && /* @__PURE__ */ l("div", { css: y[t].oddsSlot, children: /* @__PURE__ */ l(gn, { size: t === "m" ? "dense" : "default" }) })
|
|
1655
|
+
] }), Je = ({
|
|
1645
1656
|
layout: t,
|
|
1646
1657
|
label: n,
|
|
1647
1658
|
kind: e,
|
|
1648
|
-
onRetry: r
|
|
1659
|
+
onRetry: r,
|
|
1660
|
+
banner: o
|
|
1649
1661
|
}) => {
|
|
1650
|
-
const { t:
|
|
1651
|
-
return /* @__PURE__ */
|
|
1652
|
-
|
|
1653
|
-
/* @__PURE__ */ b(
|
|
1654
|
-
"div",
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
},
|
|
1671
|
-
|
|
1662
|
+
const { t: a } = bt("common"), u = e === "notFound" ? n("notAvailableTitle") : a("common.error.title"), m = e === "notFound" ? n("notAvailableMessage") : a("common.error.message");
|
|
1663
|
+
return /* @__PURE__ */ b("div", { css: y[t].root, children: [
|
|
1664
|
+
o,
|
|
1665
|
+
/* @__PURE__ */ b("div", { css: y[t].body, children: [
|
|
1666
|
+
/* @__PURE__ */ l("div", { css: y[t].header, children: /* @__PURE__ */ l("h2", { css: y[t].title, children: n("title") }) }),
|
|
1667
|
+
/* @__PURE__ */ b(
|
|
1668
|
+
"div",
|
|
1669
|
+
{
|
|
1670
|
+
css: y[t].message,
|
|
1671
|
+
style: { minHeight: $n[t] },
|
|
1672
|
+
role: "alert",
|
|
1673
|
+
children: [
|
|
1674
|
+
/* @__PURE__ */ l("h3", { css: y[t].messageTitle, children: u }),
|
|
1675
|
+
/* @__PURE__ */ l("p", { css: y[t].messageText, children: m }),
|
|
1676
|
+
e === "error" && /* @__PURE__ */ l("button", { type: "button", css: y[t].retry, onClick: r, children: a("common.retry") })
|
|
1677
|
+
]
|
|
1678
|
+
}
|
|
1679
|
+
)
|
|
1680
|
+
] })
|
|
1681
|
+
] });
|
|
1682
|
+
}, dn = (t, n, e) => {
|
|
1683
|
+
const r = Fe(t);
|
|
1684
|
+
return t.map((o, a) => Oe(r, a, n, e));
|
|
1685
|
+
}, Qe = (t) => {
|
|
1686
|
+
var At, Vt, _t, Ht, jt, Gt, qt;
|
|
1672
1687
|
const {
|
|
1673
1688
|
sdk: n,
|
|
1674
1689
|
language: e,
|
|
@@ -1678,39 +1693,48 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1678
1693
|
trophyPosition: u = "bottom-right",
|
|
1679
1694
|
showOdds: m = !1,
|
|
1680
1695
|
odds: c
|
|
1681
|
-
} = t, { t: f } =
|
|
1696
|
+
} = t, { t: f } = bt("common"), p = Se(t.labels), g = Xn() ? "m" : "d", F = g === "m" ? nt : tt, B = Tt(), X = fn(), T = Kn(), U = r === "background", $ = ke({
|
|
1682
1697
|
entityId: t.entityId,
|
|
1683
1698
|
sdk: n,
|
|
1684
1699
|
language: e,
|
|
1685
1700
|
userIsLoggedIn: t.userIsLoggedIn,
|
|
1686
1701
|
callbacks: t.callbacks
|
|
1687
|
-
}), { sides:
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1702
|
+
}), { sides: S, votes: it, poll: E, startMs: z, endMs: L } = $, [O, st] = A(!1), [H, C] = A(null), x = z !== null ? z + Jt : null, M = Ie(
|
|
1703
|
+
x !== null && L !== null ? Math.max(x, L) : x ?? L
|
|
1704
|
+
), v = (E == null ? void 0 : E.status) === "INACTIVE" && z !== null && M < z + Jt && (L === null || z < L), w = v && M >= (z ?? 0), N = L !== null && M >= L, D = !!E && !v && (E.status !== "ACTIVE" || N), { refresh: P } = $;
|
|
1705
|
+
gt(() => {
|
|
1706
|
+
if (!w) return;
|
|
1707
|
+
P();
|
|
1708
|
+
const k = setInterval(P, le);
|
|
1709
|
+
return () => clearInterval(k);
|
|
1710
|
+
}, [w, P]);
|
|
1711
|
+
const et = pn(!1);
|
|
1712
|
+
gt(() => {
|
|
1713
|
+
E && (N ? et.current && (et.current = !1, P()) : et.current = !0);
|
|
1714
|
+
}, [E, N, P]);
|
|
1715
|
+
const at = q(
|
|
1692
1716
|
() => {
|
|
1693
|
-
var
|
|
1717
|
+
var k, G;
|
|
1694
1718
|
return {
|
|
1695
|
-
surface:
|
|
1696
|
-
text:
|
|
1697
|
-
primary:
|
|
1698
|
-
onPrimary:
|
|
1719
|
+
surface: T.surface,
|
|
1720
|
+
text: T.textPrimary,
|
|
1721
|
+
primary: T.palette.primary.plainColor,
|
|
1722
|
+
onPrimary: T.palette.primary.onPrimary,
|
|
1699
1723
|
extras: [
|
|
1700
|
-
(
|
|
1701
|
-
(
|
|
1702
|
-
].filter((
|
|
1724
|
+
(k = T.palette.success) == null ? void 0 : k.plainColor,
|
|
1725
|
+
(G = T.palette.warning) == null ? void 0 : G.plainColor
|
|
1726
|
+
].filter((zn) => !!zn)
|
|
1703
1727
|
};
|
|
1704
1728
|
},
|
|
1705
|
-
[
|
|
1706
|
-
),
|
|
1707
|
-
((
|
|
1708
|
-
|
|
1709
|
-
),
|
|
1729
|
+
[T]
|
|
1730
|
+
), Mt = q(() => S.map((k) => k.brand), [S]), yt = q(() => Ce(Mt, at), [Mt, at]), Cn = bn(
|
|
1731
|
+
((At = T.palette.warning) == null ? void 0 : At.plainColor) ?? at.primary,
|
|
1732
|
+
at
|
|
1733
|
+
), K = c == null ? void 0 : c.eventId, xt = m && !!K && S.length === 2 && S.every((k) => k.kind === "team"), wn = m && !!K, { odds: Wn, loading: Rn } = Qn(
|
|
1710
1734
|
n,
|
|
1711
|
-
|
|
1735
|
+
xt && K ? [K] : [],
|
|
1712
1736
|
{
|
|
1713
|
-
enabled:
|
|
1737
|
+
enabled: xt,
|
|
1714
1738
|
markets: [(c == null ? void 0 : c.market) ?? "FT_1X2"],
|
|
1715
1739
|
sport: "FOOTBALL",
|
|
1716
1740
|
pollingIntervalMs: c == null ? void 0 : c.pollingInterval,
|
|
@@ -1718,123 +1742,142 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1718
1742
|
affiliateId: c == null ? void 0 : c.affiliateId,
|
|
1719
1743
|
affiliateIds: c == null ? void 0 : c.affiliateIds
|
|
1720
1744
|
}
|
|
1721
|
-
),
|
|
1722
|
-
() => new Intl.NumberFormat(
|
|
1745
|
+
), Nt = K ? Wn.get(K) : void 0, Fn = q(
|
|
1746
|
+
() => new Intl.NumberFormat(X, {
|
|
1723
1747
|
style: "percent",
|
|
1724
1748
|
maximumFractionDigits: 0
|
|
1725
1749
|
}),
|
|
1726
|
-
[
|
|
1727
|
-
)
|
|
1750
|
+
[X]
|
|
1751
|
+
), kt = t.brandedAreaImage ? /* @__PURE__ */ l(
|
|
1752
|
+
Vn,
|
|
1753
|
+
{
|
|
1754
|
+
backgroundImage: t.brandedAreaImage,
|
|
1755
|
+
link: t.brandedAreaLink,
|
|
1756
|
+
height: "150px",
|
|
1757
|
+
minHeight: "120px"
|
|
1758
|
+
}
|
|
1759
|
+
) : null;
|
|
1728
1760
|
if ($.status === "loading")
|
|
1729
|
-
return /* @__PURE__ */ l(He, { layout: h, fill: _, odds: yn });
|
|
1730
|
-
if ($.status !== "ready" || !O)
|
|
1731
1761
|
return /* @__PURE__ */ l(
|
|
1732
|
-
|
|
1762
|
+
Ke,
|
|
1733
1763
|
{
|
|
1734
|
-
layout:
|
|
1764
|
+
layout: g,
|
|
1765
|
+
fill: U,
|
|
1766
|
+
odds: wn,
|
|
1767
|
+
banner: kt
|
|
1768
|
+
}
|
|
1769
|
+
);
|
|
1770
|
+
if ($.status !== "ready" || !E)
|
|
1771
|
+
return /* @__PURE__ */ l(
|
|
1772
|
+
Je,
|
|
1773
|
+
{
|
|
1774
|
+
layout: g,
|
|
1735
1775
|
label: p,
|
|
1736
1776
|
kind: $.status === "notFound" ? "notFound" : "error",
|
|
1737
|
-
onRetry: $.retry
|
|
1777
|
+
onRetry: $.retry,
|
|
1778
|
+
banner: kt
|
|
1738
1779
|
}
|
|
1739
1780
|
);
|
|
1740
|
-
const
|
|
1741
|
-
(
|
|
1742
|
-
),
|
|
1743
|
-
(
|
|
1744
|
-
),
|
|
1745
|
-
|
|
1746
|
-
},
|
|
1747
|
-
|
|
1748
|
-
},
|
|
1781
|
+
const lt = ge(it), ct = D ? he(it) : null, En = D && ct === null, J = S.findIndex(
|
|
1782
|
+
(k) => k.optionId === $.votedOptionId
|
|
1783
|
+
), St = D || o || J >= 0, It = lt.map(
|
|
1784
|
+
(k) => St ? Fn.format(k / 100) : null
|
|
1785
|
+
), On = g === "m" && S.length > 2, Dt = S.map(() => 100 / S.length), Bt = ct !== null ? Re(lt, ct, U, g === "m") : U && St ? We(lt, g === "m") : Dt, Pn = S.map((k, G) => D || J < 0 || J === G), Tn = S.map((k, G) => v ? "upcoming" : J === G ? "chosen" : J >= 0 ? "locked" : $.signInRequired ? "signIn" : $.submitting ? "submitting" : "open"), vt = E.authRequirement === "LEAD" && !O && !D && !v && J < 0 ? (Vt = t.leads) == null ? void 0 : Vt.position : void 0, Ln = vt === "before" || vt === "after" && H !== null, Mn = (k) => {
|
|
1786
|
+
vt === "after" ? C(k) : $.vote(S[k].optionId);
|
|
1787
|
+
}, Nn = async () => {
|
|
1788
|
+
st(!0), H !== null && (await $.vote(S[H].optionId), C(null));
|
|
1789
|
+
}, zt = St ? `${p("voteSplit")}: ${S.map((k, G) => `${k.name} ${It[G]}`).join(", ")}` : null, Dn = S.every((k) => k.kind === "player"), Bn = v ? w || z === null ? null : tn(z, M) : L !== null && !D ? tn(L, M) : null;
|
|
1749
1790
|
return /* @__PURE__ */ b(
|
|
1750
1791
|
"div",
|
|
1751
1792
|
{
|
|
1752
|
-
css: y[
|
|
1753
|
-
style: { "--bof-trophy-on":
|
|
1793
|
+
css: y[g].root,
|
|
1794
|
+
style: { "--bof-trophy-on": Cn },
|
|
1754
1795
|
children: [
|
|
1755
|
-
|
|
1796
|
+
kt,
|
|
1797
|
+
/* @__PURE__ */ b("div", { css: y[g].body, children: [
|
|
1756
1798
|
/* @__PURE__ */ l(
|
|
1757
|
-
|
|
1799
|
+
je,
|
|
1758
1800
|
{
|
|
1759
|
-
layout:
|
|
1801
|
+
layout: g,
|
|
1760
1802
|
label: p,
|
|
1761
|
-
title: ((
|
|
1762
|
-
openSubtitle: ((
|
|
1763
|
-
ended:
|
|
1764
|
-
draw:
|
|
1765
|
-
|
|
1803
|
+
title: ((Ht = (_t = t.labels) == null ? void 0 : _t.title) == null ? void 0 : Ht.trim()) || ((jt = E.title) == null ? void 0 : jt.trim()) || p("title"),
|
|
1804
|
+
openSubtitle: ((qt = (Gt = t.labels) == null ? void 0 : Gt.subtitle) == null ? void 0 : qt.trim()) || Jn(E.description ?? null).trim() || p(Dn ? "subtitlePlayers" : "subtitleTeams"),
|
|
1805
|
+
ended: D,
|
|
1806
|
+
draw: En,
|
|
1807
|
+
upcoming: v,
|
|
1808
|
+
left: Bn
|
|
1766
1809
|
}
|
|
1767
1810
|
),
|
|
1768
|
-
|
|
1769
|
-
|
|
1811
|
+
Ln && t.leads ? /* @__PURE__ */ l(
|
|
1812
|
+
qe,
|
|
1770
1813
|
{
|
|
1771
|
-
layout:
|
|
1814
|
+
layout: g,
|
|
1772
1815
|
sdk: n,
|
|
1773
|
-
poll:
|
|
1816
|
+
poll: E,
|
|
1774
1817
|
leads: t.leads,
|
|
1775
|
-
sides:
|
|
1776
|
-
colours:
|
|
1777
|
-
picked:
|
|
1818
|
+
sides: S,
|
|
1819
|
+
colours: yt,
|
|
1820
|
+
picked: H,
|
|
1778
1821
|
language: e,
|
|
1779
|
-
continueLabel:
|
|
1780
|
-
onContinue:
|
|
1822
|
+
continueLabel: H !== null ? p("voteFor", { name: S[H].name }) : f("poll.buttons.continue"),
|
|
1823
|
+
onContinue: Nn,
|
|
1781
1824
|
submitting: $.submitting
|
|
1782
1825
|
}
|
|
1783
|
-
) : /* @__PURE__ */ b(
|
|
1826
|
+
) : /* @__PURE__ */ b(Pt, { children: [
|
|
1784
1827
|
/* @__PURE__ */ l(
|
|
1785
|
-
|
|
1828
|
+
_e,
|
|
1786
1829
|
{
|
|
1787
1830
|
view: {
|
|
1788
|
-
layout:
|
|
1789
|
-
fill:
|
|
1790
|
-
rows:
|
|
1791
|
-
sides:
|
|
1792
|
-
colours:
|
|
1793
|
-
percents:
|
|
1794
|
-
ended:
|
|
1795
|
-
winner:
|
|
1796
|
-
lit:
|
|
1797
|
-
widths:
|
|
1798
|
-
clips:
|
|
1799
|
-
slant:
|
|
1800
|
-
evenClips:
|
|
1801
|
-
actions:
|
|
1831
|
+
layout: g,
|
|
1832
|
+
fill: U,
|
|
1833
|
+
rows: On,
|
|
1834
|
+
sides: S,
|
|
1835
|
+
colours: yt,
|
|
1836
|
+
percents: It,
|
|
1837
|
+
ended: D,
|
|
1838
|
+
winner: ct,
|
|
1839
|
+
lit: Pn,
|
|
1840
|
+
widths: Bt,
|
|
1841
|
+
clips: dn(Bt, F.slant, B),
|
|
1842
|
+
slant: F.slant,
|
|
1843
|
+
evenClips: dn(Dt, F.slant, B),
|
|
1844
|
+
actions: Tn,
|
|
1802
1845
|
showTrophy: a,
|
|
1803
1846
|
trophyPosition: u,
|
|
1804
1847
|
language: e,
|
|
1805
1848
|
label: p,
|
|
1806
|
-
splitLabel:
|
|
1849
|
+
splitLabel: zt,
|
|
1807
1850
|
signInCTA: t.signInCTA,
|
|
1808
|
-
onVote:
|
|
1851
|
+
onVote: Mn
|
|
1809
1852
|
}
|
|
1810
1853
|
}
|
|
1811
1854
|
),
|
|
1812
|
-
!
|
|
1813
|
-
|
|
1855
|
+
!U && /* @__PURE__ */ l(
|
|
1856
|
+
Ue,
|
|
1814
1857
|
{
|
|
1815
|
-
layout:
|
|
1858
|
+
layout: g,
|
|
1816
1859
|
label: p,
|
|
1817
|
-
colours:
|
|
1818
|
-
shares:
|
|
1819
|
-
percents:
|
|
1820
|
-
ended:
|
|
1821
|
-
splitLabel:
|
|
1860
|
+
colours: yt,
|
|
1861
|
+
shares: lt,
|
|
1862
|
+
percents: It,
|
|
1863
|
+
ended: D,
|
|
1864
|
+
splitLabel: zt
|
|
1822
1865
|
}
|
|
1823
1866
|
)
|
|
1824
1867
|
] })
|
|
1825
1868
|
] }),
|
|
1826
|
-
|
|
1827
|
-
|
|
1869
|
+
Nt ? /* @__PURE__ */ l(
|
|
1870
|
+
Zn,
|
|
1828
1871
|
{
|
|
1829
|
-
odds:
|
|
1872
|
+
odds: Nt,
|
|
1830
1873
|
market: (c == null ? void 0 : c.market) ?? "FT_1X2",
|
|
1831
|
-
size:
|
|
1874
|
+
size: g === "m" ? "dense" : "default",
|
|
1832
1875
|
mode: c == null ? void 0 : c.mode,
|
|
1833
1876
|
flashInterval: c == null ? void 0 : c.flashInterval
|
|
1834
1877
|
}
|
|
1835
|
-
) :
|
|
1878
|
+
) : xt && Rn && /* @__PURE__ */ l("div", { css: y[g].oddsSlot, children: /* @__PURE__ */ l(gn, { size: g === "m" ? "dense" : "default" }) }),
|
|
1836
1879
|
/* @__PURE__ */ l(
|
|
1837
|
-
|
|
1880
|
+
_n,
|
|
1838
1881
|
{
|
|
1839
1882
|
notification: {
|
|
1840
1883
|
open: !!$.voteError,
|
|
@@ -1848,20 +1891,20 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1848
1891
|
]
|
|
1849
1892
|
}
|
|
1850
1893
|
);
|
|
1851
|
-
},
|
|
1894
|
+
}, Ze = (t) => {
|
|
1852
1895
|
var n;
|
|
1853
1896
|
return /* @__PURE__ */ l(
|
|
1854
|
-
|
|
1897
|
+
Hn,
|
|
1855
1898
|
{
|
|
1856
1899
|
packageName: "battle-of-fans",
|
|
1857
1900
|
language: t.language,
|
|
1858
1901
|
themeOptions: t.themeOptions,
|
|
1859
1902
|
disableCache: t.disableCache,
|
|
1860
1903
|
leadPhoneCountryCode: (n = t.leads) == null ? void 0 : n.phoneCountryCode,
|
|
1861
|
-
children: /* @__PURE__ */ l(
|
|
1904
|
+
children: /* @__PURE__ */ l(Qe, { ...t })
|
|
1862
1905
|
}
|
|
1863
1906
|
);
|
|
1864
|
-
},
|
|
1907
|
+
}, uo = oe(Ze);
|
|
1865
1908
|
export {
|
|
1866
|
-
|
|
1909
|
+
uo as BattleOfFans
|
|
1867
1910
|
};
|