fansunited-frontend-components 1.1.1 → 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 +427 -404
- 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 +61 -2
- 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-CzdDF1rG.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
|
|
2
|
-
import { space as dt, radius as ut, LeadForm as
|
|
3
|
-
import
|
|
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
4
|
import { useTranslation as bt } from "react-i18next";
|
|
5
|
-
import { useDisableCache as
|
|
6
|
-
import { a as
|
|
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
7
|
import { keyframes as rt, css as d } from "@emotion/react";
|
|
8
|
-
import { EmojiEventsIcon as
|
|
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)",
|
|
@@ -42,7 +42,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
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,
|
|
@@ -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,30 +325,30 @@ 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
|
-
), e.slice(0, n.length).map((o,
|
|
335
|
+
), e.slice(0, n.length).map((o, a) => ({
|
|
336
336
|
optionId: o.id,
|
|
337
|
-
entityId: n[
|
|
338
|
-
kind:
|
|
337
|
+
entityId: n[a].id,
|
|
338
|
+
kind: Qt[n[a].type.toLowerCase()],
|
|
339
339
|
title: o.title ?? ""
|
|
340
340
|
}));
|
|
341
|
-
},
|
|
342
|
-
var o,
|
|
341
|
+
}, de = (t) => t.split("-")[0].toUpperCase(), ue = (t, n) => {
|
|
342
|
+
var o, a;
|
|
343
343
|
if (!t) return null;
|
|
344
|
-
const e =
|
|
345
|
-
return (((
|
|
344
|
+
const e = de(n);
|
|
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
|
-
)) == null ? void 0 :
|
|
351
|
-
},
|
|
350
|
+
)) == null ? void 0 : a.name) ?? t.name ?? "").trim() || null;
|
|
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) => {
|
|
@@ -357,7 +357,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
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,33 +365,33 @@ 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
|
|
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);
|
|
380
380
|
let o = 100 - r.reduce((u, m) => u + m, 0);
|
|
381
|
-
const
|
|
382
|
-
for (const { i: u } of
|
|
381
|
+
const a = e.map((u, m) => ({ i: m, rest: u - Math.floor(u) })).sort((u, m) => m.rest - u.rest || u.i - m.i);
|
|
382
|
+
for (const { i: u } of a) {
|
|
383
383
|
if (o <= 0) break;
|
|
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,13 +399,13 @@ 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(),
|
|
404
|
-
if (!
|
|
402
|
+
}, be = [401, 403, 404], ye = async (t, n, e, r) => {
|
|
403
|
+
const o = /* @__PURE__ */ new Map(), a = Gn(t);
|
|
404
|
+
if (!a) return o;
|
|
405
405
|
const u = async (c) => {
|
|
406
406
|
if (!c.length) return;
|
|
407
|
-
(await
|
|
408
|
-
|
|
407
|
+
(await qn(
|
|
408
|
+
a,
|
|
409
409
|
c,
|
|
410
410
|
{
|
|
411
411
|
signal: e,
|
|
@@ -417,47 +417,47 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
417
417
|
await u(n.map((c) => c.entityId));
|
|
418
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
|
-
},
|
|
423
|
+
}, ke = (t) => {
|
|
424
424
|
var st, H;
|
|
425
|
-
const { entityId: n, sdk: e, language: r, userIsLoggedIn: o } = t,
|
|
426
|
-
S.current = t.callbacks,
|
|
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
428
|
let x = !1;
|
|
429
429
|
return m("loading"), T(!1), (async () => {
|
|
430
430
|
let v;
|
|
431
431
|
try {
|
|
432
|
-
v = await e.voting.getPollById(n,
|
|
432
|
+
v = await e.voting.getPollById(n, a);
|
|
433
433
|
} catch (P) {
|
|
434
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 = v != null && v.id && (v.type ?? "").toLowerCase() ===
|
|
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
445
|
const D = v.authRequirement === "REGISTERED" && !o ? Promise.resolve(null) : e.voting.getMyPollVote(n).catch((P) => {
|
|
446
|
-
if (
|
|
446
|
+
if (be.includes($t(P, e).code))
|
|
447
447
|
return null;
|
|
448
448
|
throw P;
|
|
449
449
|
});
|
|
450
450
|
try {
|
|
451
451
|
const [P, et] = await Promise.all([
|
|
452
452
|
D,
|
|
453
|
-
|
|
453
|
+
ye(e, w, C.signal, a)
|
|
454
454
|
]);
|
|
455
455
|
if (x) return;
|
|
456
456
|
f({
|
|
457
457
|
poll: v,
|
|
458
458
|
refs: w,
|
|
459
459
|
entities: et,
|
|
460
|
-
votedOptionId:
|
|
460
|
+
votedOptionId: xe(P)
|
|
461
461
|
}), m("ready");
|
|
462
462
|
} catch {
|
|
463
463
|
x || m("error");
|
|
@@ -465,9 +465,9 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
465
465
|
})(), () => {
|
|
466
466
|
x = !0, C.abort();
|
|
467
467
|
};
|
|
468
|
-
}, [n, e,
|
|
468
|
+
}, [n, e, a, o, p]);
|
|
469
469
|
const it = q(
|
|
470
|
-
() => c ?
|
|
470
|
+
() => c ? fe(c.refs, c.entities, r, mn) : [],
|
|
471
471
|
[c, r]
|
|
472
472
|
), E = q(
|
|
473
473
|
() => c ? c.refs.map(
|
|
@@ -477,7 +477,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
477
477
|
}
|
|
478
478
|
) : [],
|
|
479
479
|
[c]
|
|
480
|
-
), z =
|
|
480
|
+
), z = Ut(
|
|
481
481
|
async (C) => {
|
|
482
482
|
var x, M;
|
|
483
483
|
if (!(!c || F || c.votedOptionId)) {
|
|
@@ -498,7 +498,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
498
498
|
}
|
|
499
499
|
), (M = (x = S.current) == null ? void 0 : x.onFinish) == null || M.call(x, v);
|
|
500
500
|
} catch (v) {
|
|
501
|
-
const { code: w, message: N } =
|
|
501
|
+
const { code: w, message: N } = $t(v, e);
|
|
502
502
|
w === 401 || w === 403 ? T(!0) : $(N);
|
|
503
503
|
} finally {
|
|
504
504
|
B(!1);
|
|
@@ -506,31 +506,31 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
506
506
|
}
|
|
507
507
|
},
|
|
508
508
|
[n, e, c, F]
|
|
509
|
-
), L =
|
|
510
|
-
e.voting.getPollById(n,
|
|
509
|
+
), L = Ut(() => {
|
|
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,
|
|
516
|
+
}, [n, e, a]), O = (c == null ? void 0 : c.poll) ?? null;
|
|
517
517
|
return {
|
|
518
518
|
status: u,
|
|
519
519
|
poll: O,
|
|
520
520
|
sides: it,
|
|
521
521
|
votes: E,
|
|
522
522
|
votedOptionId: (c == null ? void 0 : c.votedOptionId) ?? null,
|
|
523
|
-
startMs:
|
|
524
|
-
endMs:
|
|
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
525
|
signInRequired: X || (O == null ? void 0 : O.authRequirement) === "REGISTERED" && !o,
|
|
526
526
|
submitting: F,
|
|
527
527
|
voteError: U,
|
|
528
528
|
clearVoteError: () => $(null),
|
|
529
529
|
vote: z,
|
|
530
|
-
retry: () =>
|
|
530
|
+
retry: () => g((C) => C + 1),
|
|
531
531
|
refresh: L
|
|
532
532
|
};
|
|
533
|
-
},
|
|
533
|
+
}, Se = (t) => {
|
|
534
534
|
const { t: n } = bt("common");
|
|
535
535
|
return q(
|
|
536
536
|
() => (e, r) => {
|
|
@@ -539,95 +539,95 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
539
539
|
},
|
|
540
540
|
[t, n]
|
|
541
541
|
);
|
|
542
|
-
},
|
|
542
|
+
}, Ie = (t) => {
|
|
543
543
|
const [n, e] = A(() => Date.now()), r = t !== null && n >= t;
|
|
544
|
-
return
|
|
544
|
+
return gt(() => {
|
|
545
545
|
if (t === null || r) return;
|
|
546
546
|
const o = setInterval(() => e(Date.now()), 1e3);
|
|
547
547
|
return () => clearInterval(o);
|
|
548
548
|
}, [t, r]), n;
|
|
549
|
-
},
|
|
550
|
-
const n =
|
|
549
|
+
}, nn = (t) => {
|
|
550
|
+
const n = mn(t);
|
|
551
551
|
if (!n) return null;
|
|
552
552
|
const [e, r, o] = [1, 3, 5].map(
|
|
553
553
|
(c) => parseInt(n.slice(c, c + 2), 16) / 255
|
|
554
|
-
),
|
|
555
|
-
return u < 0.12 ? null : ((
|
|
554
|
+
), a = Math.max(e, r, o), u = a - Math.min(e, r, o);
|
|
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;
|
|
556
556
|
}, Q = (t, n) => {
|
|
557
|
-
if (!
|
|
558
|
-
const e =
|
|
559
|
-
if (e === null || r === null) return (
|
|
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;
|
|
560
560
|
const o = Math.abs(e - r);
|
|
561
561
|
return Math.min(o, 360 - o) < 35;
|
|
562
|
-
},
|
|
562
|
+
}, ve = (t, n) => {
|
|
563
563
|
const e = [n.primary, n.text, ...n.extras], r = t.map(
|
|
564
|
-
(
|
|
564
|
+
(a) => a.filter((u) => Et(u, n.surface))
|
|
565
565
|
), o = r.map(
|
|
566
|
-
(
|
|
566
|
+
(a, u) => a[0] ?? e[u % e.length]
|
|
567
567
|
);
|
|
568
|
-
for (let
|
|
569
|
-
const u = o.slice(0,
|
|
570
|
-
if (!u.some((p) => Q(p, o[
|
|
571
|
-
const m = r[
|
|
568
|
+
for (let a = 1; a < o.length; a += 1) {
|
|
569
|
+
const u = o.slice(0, a);
|
|
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)));
|
|
572
572
|
if (m) {
|
|
573
|
-
o[
|
|
573
|
+
o[a] = m;
|
|
574
574
|
continue;
|
|
575
575
|
}
|
|
576
576
|
let c = !1;
|
|
577
|
-
for (let p = 0; p <
|
|
578
|
-
if (!Q(o[p], o[
|
|
579
|
-
const
|
|
580
|
-
(F) => o.slice(0,
|
|
577
|
+
for (let p = 0; p < a && !c; p += 1) {
|
|
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))
|
|
581
581
|
);
|
|
582
|
-
|
|
582
|
+
g && (o[p] = g), c = !o.slice(0, a).some((F) => Q(F, o[a]));
|
|
583
583
|
}
|
|
584
584
|
if (c) continue;
|
|
585
|
-
const f = e.find((p) => !u.some((
|
|
586
|
-
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);
|
|
587
587
|
}
|
|
588
588
|
return o;
|
|
589
|
-
},
|
|
590
|
-
if ((
|
|
589
|
+
}, bn = (t, n) => {
|
|
590
|
+
if ((ht(n.onPrimary, t) ?? 21) >= 4.5)
|
|
591
591
|
return n.onPrimary;
|
|
592
592
|
const e = [n.onPrimary, n.text, n.surface];
|
|
593
593
|
let r = e[0], o = -1;
|
|
594
|
-
for (const
|
|
595
|
-
const u =
|
|
596
|
-
u > o && (r =
|
|
594
|
+
for (const a of e) {
|
|
595
|
+
const u = ht(a, t) ?? -1;
|
|
596
|
+
u > o && (r = a, o = u);
|
|
597
597
|
}
|
|
598
598
|
return r;
|
|
599
|
-
},
|
|
599
|
+
}, $e = (t, n, e = 3) => (ht(t, n.surface) ?? 21) >= e ? t : n.text, Ce = (t, n) => ve(t, n).map((e) => ({
|
|
600
600
|
fill: e,
|
|
601
|
-
on:
|
|
602
|
-
ink:
|
|
603
|
-
})),
|
|
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) => {
|
|
604
604
|
const e = t.length, r = 100 / e;
|
|
605
605
|
if (t.every((c) => c === 0)) return t.map(() => r);
|
|
606
|
-
const o = r * (n || e > 2 ? 0.8 : 0.6),
|
|
607
|
-
return
|
|
608
|
-
},
|
|
609
|
-
const o = t.length,
|
|
610
|
-
return t.map((f, p) => p === n ?
|
|
611
|
-
},
|
|
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);
|
|
607
|
+
return a.map((c) => m > 0 ? c - (c - o) / m * u : r);
|
|
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);
|
|
610
|
+
return t.map((f, p) => p === n ? a : !e || c === 0 ? u / (o - 1) : f / c * u);
|
|
611
|
+
}, Fe = (t) => {
|
|
612
612
|
const n = [];
|
|
613
613
|
let e = 0;
|
|
614
614
|
for (let r = 0; r < t.length - 1; r += 1)
|
|
615
615
|
e += t[r], n.push(e);
|
|
616
616
|
return n;
|
|
617
|
-
},
|
|
618
|
-
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);
|
|
619
619
|
return `polygon(${m} 0, ${f} 0, ${p} 100%, ${c} 100%)`;
|
|
620
|
-
}, pt = "cubic-bezier(.2,.8,.2,1)",
|
|
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({
|
|
621
621
|
"0%": { transform: "scale(.92)", opacity: 0 },
|
|
622
622
|
"60%": { transform: "scale(1.03)" },
|
|
623
623
|
"100%": { transform: "scale(1)", opacity: 1 }
|
|
624
|
-
}), V = { fontFamily: i.fontPrimary, fontWeight: 700 },
|
|
624
|
+
}), V = { fontFamily: i.fontPrimary, fontWeight: 700 }, Wt = ([t, n]) => ({
|
|
625
625
|
fontSize: `min(${s(t)}, 30cqi)`,
|
|
626
626
|
lineHeight: n / t
|
|
627
|
-
}),
|
|
627
|
+
}), en = (t) => ({
|
|
628
628
|
paddingInlineStart: `calc(${s(t)} + var(--bof-pad-start, 0%))`,
|
|
629
629
|
paddingInlineEnd: `calc(${s(t)} + var(--bof-pad-end, 0%))`
|
|
630
|
-
}),
|
|
630
|
+
}), Rt = { overflowWrap: "anywhere", maxWidth: "100%" }, Ft = ([t, n]) => ({
|
|
631
631
|
fontSize: `min(${s(t)}, 18cqi)`,
|
|
632
632
|
lineHeight: n / t
|
|
633
633
|
}), mt = { unicodeBidi: "plaintext" }, ft = {
|
|
@@ -635,7 +635,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
635
635
|
WebkitLineClamp: 2,
|
|
636
636
|
WebkitBoxOrient: "vertical",
|
|
637
637
|
overflow: "hidden"
|
|
638
|
-
},
|
|
638
|
+
}, on = (t, n) => ({
|
|
639
639
|
boxSizing: "border-box",
|
|
640
640
|
height: s(t, n),
|
|
641
641
|
padding: `0 min(${s(20, n)}, 6cqi)`,
|
|
@@ -657,8 +657,8 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
657
657
|
outline: `2px solid ${i.focus}`,
|
|
658
658
|
outlineOffset: "2px"
|
|
659
659
|
}
|
|
660
|
-
}),
|
|
661
|
-
vote: d(
|
|
660
|
+
}), xn = (t, n, e) => ({
|
|
661
|
+
vote: d(on(t, n), e, {
|
|
662
662
|
backgroundColor: i.fill,
|
|
663
663
|
color: i.on,
|
|
664
664
|
cursor: "pointer",
|
|
@@ -671,22 +671,22 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
671
671
|
"&:active:not(:disabled)": { transform: "translateY(0)" },
|
|
672
672
|
"&:disabled": { cursor: "default", opacity: 0.7 }
|
|
673
673
|
}),
|
|
674
|
-
thanks: d(
|
|
674
|
+
thanks: d(on(t, n), e, {
|
|
675
675
|
padding: `0 ${s(12, n)}`,
|
|
676
676
|
border: `2px solid ${i.ink}`,
|
|
677
677
|
backgroundColor: i.surface,
|
|
678
678
|
color: i.ink,
|
|
679
|
-
animation: `${
|
|
679
|
+
animation: `${yn} .35s ease-out`
|
|
680
680
|
}),
|
|
681
681
|
icon: d({ fontSize: "1.25em", flexShrink: 0 })
|
|
682
|
-
}),
|
|
683
|
-
const n = (
|
|
682
|
+
}), Le = (t) => {
|
|
683
|
+
const n = (a) => ({
|
|
684
684
|
display: "block",
|
|
685
|
-
width: `min(${s(
|
|
685
|
+
width: `min(${s(a)}, 100%)`,
|
|
686
686
|
height: "auto",
|
|
687
687
|
aspectRatio: "1",
|
|
688
688
|
flexShrink: 0
|
|
689
|
-
}), e = (
|
|
689
|
+
}), e = (a, u) => d(n(a), {
|
|
690
690
|
boxSizing: "border-box",
|
|
691
691
|
borderRadius: "50%",
|
|
692
692
|
overflow: "hidden",
|
|
@@ -699,21 +699,21 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
699
699
|
objectFit: "cover",
|
|
700
700
|
objectPosition: "top"
|
|
701
701
|
}
|
|
702
|
-
}), r = (
|
|
702
|
+
}), r = (a) => d({
|
|
703
703
|
flexShrink: 0,
|
|
704
|
-
width: `min(${s(
|
|
704
|
+
width: `min(${s(a, a * 0.36)}, 100%)`,
|
|
705
705
|
aspectRatio: "1",
|
|
706
706
|
boxSizing: "border-box",
|
|
707
707
|
borderRadius: "50%",
|
|
708
708
|
display: "flex",
|
|
709
709
|
alignItems: "center",
|
|
710
710
|
justifyContent: "center",
|
|
711
|
-
fontSize: s(
|
|
711
|
+
fontSize: s(a * 0.36),
|
|
712
712
|
...V,
|
|
713
713
|
color: i.text,
|
|
714
714
|
backgroundColor: i.surface,
|
|
715
715
|
border: `${i.borderSize} solid ${i.border}`
|
|
716
|
-
}), o = (
|
|
716
|
+
}), o = (a, u) => d(n(a), { objectFit: "contain", filter: u });
|
|
717
717
|
return {
|
|
718
718
|
side: {
|
|
719
719
|
logo: o(t.img, ot.logo),
|
|
@@ -739,12 +739,12 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
739
739
|
initials: r(44)
|
|
740
740
|
}
|
|
741
741
|
};
|
|
742
|
-
},
|
|
742
|
+
}, Me = [
|
|
743
743
|
"top-left",
|
|
744
744
|
"top-right",
|
|
745
745
|
"bottom-left",
|
|
746
746
|
"bottom-right"
|
|
747
|
-
],
|
|
747
|
+
], kn = (t) => {
|
|
748
748
|
const n = {
|
|
749
749
|
position: "absolute",
|
|
750
750
|
width: s(t.trophy),
|
|
@@ -759,35 +759,35 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
759
759
|
alignItems: "center",
|
|
760
760
|
justifyContent: "center",
|
|
761
761
|
fontSize: "1em",
|
|
762
|
-
animation: `${
|
|
763
|
-
}, e = (o,
|
|
764
|
-
const [u, m] = o.split("-"), c =
|
|
762
|
+
animation: `${yn} .5s .55s ease-out both`
|
|
763
|
+
}, e = (o, a) => {
|
|
764
|
+
const [u, m] = o.split("-"), c = a ? m === "left" ? "right" : "left" : m;
|
|
765
765
|
return d(n, { [u]: s(-4), [c]: s(-4) });
|
|
766
766
|
}, r = {};
|
|
767
|
-
for (const o of
|
|
767
|
+
for (const o of Me)
|
|
768
768
|
r[`${o}|ltr`] = e(o, !1), r[`${o}|rtl`] = e(o, !0);
|
|
769
769
|
return { at: r, icon: d({ fontSize: s(t.trophy * 0.5) }) };
|
|
770
|
-
},
|
|
771
|
-
const e = (
|
|
770
|
+
}, rn = (t, n) => {
|
|
771
|
+
const e = (a) => d({
|
|
772
772
|
position: "relative",
|
|
773
|
-
height: s(
|
|
773
|
+
height: s(a),
|
|
774
774
|
display: "flex",
|
|
775
775
|
overflow: "hidden",
|
|
776
776
|
borderRadius: i.radiusMd,
|
|
777
777
|
backgroundColor: i.inner
|
|
778
|
-
}), r = (
|
|
778
|
+
}), r = (a) => d({
|
|
779
779
|
position: "relative",
|
|
780
780
|
zIndex: 1,
|
|
781
781
|
minWidth: 0,
|
|
782
782
|
boxSizing: "border-box",
|
|
783
783
|
containerType: "inline-size",
|
|
784
784
|
paddingBlock: s(t.colPad[0]),
|
|
785
|
-
...
|
|
785
|
+
...en(t.colPad[1]),
|
|
786
786
|
display: "flex",
|
|
787
787
|
flexDirection: "column",
|
|
788
788
|
alignItems: "center",
|
|
789
789
|
justifyContent: "center",
|
|
790
|
-
gap: s(
|
|
790
|
+
gap: s(a),
|
|
791
791
|
transition: `flex-basis .6s ${pt}`
|
|
792
792
|
}), o = n ? { width: "100%" } : { minWidth: `min(${s(180, t.btnFont)}, 100%)`, maxWidth: "100%" };
|
|
793
793
|
return {
|
|
@@ -811,7 +811,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
811
811
|
position: "absolute",
|
|
812
812
|
inset: 0,
|
|
813
813
|
backgroundColor: i.fill,
|
|
814
|
-
animation: `${
|
|
814
|
+
animation: `${Pe} .9s ${pt} both`
|
|
815
815
|
}),
|
|
816
816
|
column: r(t.colGap),
|
|
817
817
|
columnFill: r(10),
|
|
@@ -832,16 +832,16 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
832
832
|
),
|
|
833
833
|
name: d({
|
|
834
834
|
...V,
|
|
835
|
-
...
|
|
835
|
+
...Ft(t.name),
|
|
836
836
|
...mt,
|
|
837
837
|
...ft,
|
|
838
|
-
...
|
|
838
|
+
...Rt,
|
|
839
839
|
textAlign: "center",
|
|
840
840
|
textWrap: "balance"
|
|
841
841
|
}),
|
|
842
842
|
pct: d({
|
|
843
843
|
...V,
|
|
844
|
-
...
|
|
844
|
+
...Wt(t.pctFill),
|
|
845
845
|
color: i.ink,
|
|
846
846
|
fontVariantNumeric: "tabular-nums"
|
|
847
847
|
}),
|
|
@@ -859,7 +859,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
859
859
|
display: "flex",
|
|
860
860
|
justifyContent: "center"
|
|
861
861
|
}),
|
|
862
|
-
...
|
|
862
|
+
...xn(t.btnH, t.btnFont, o),
|
|
863
863
|
// Winner panel
|
|
864
864
|
winColumn: d({
|
|
865
865
|
position: "relative",
|
|
@@ -868,7 +868,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
868
868
|
boxSizing: "border-box",
|
|
869
869
|
containerType: "inline-size",
|
|
870
870
|
paddingBlock: s(n ? 12 : 24),
|
|
871
|
-
...
|
|
871
|
+
...en(n ? 12 : 24),
|
|
872
872
|
transition: `flex-basis .6s ${pt}`,
|
|
873
873
|
display: "flex",
|
|
874
874
|
alignItems: "center",
|
|
@@ -883,7 +883,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
883
883
|
textAlign: n ? "center" : "start",
|
|
884
884
|
color: i.on,
|
|
885
885
|
minWidth: 0,
|
|
886
|
-
animation: `${
|
|
886
|
+
animation: `${Ot} .6s .25s ease-out both`
|
|
887
887
|
}),
|
|
888
888
|
winWrap: d({
|
|
889
889
|
position: "relative",
|
|
@@ -903,7 +903,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
903
903
|
pointerEvents: "none",
|
|
904
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%)`,
|
|
905
905
|
maskImage: "radial-gradient(circle closest-side, #000 28%, transparent 100%)",
|
|
906
|
-
animation: `${
|
|
906
|
+
animation: `${Te} 80s linear infinite`
|
|
907
907
|
}),
|
|
908
908
|
winText: d({
|
|
909
909
|
minWidth: 0,
|
|
@@ -919,10 +919,10 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
919
919
|
}),
|
|
920
920
|
winName: d({
|
|
921
921
|
...V,
|
|
922
|
-
...
|
|
922
|
+
...Ft(t.winName),
|
|
923
923
|
...mt,
|
|
924
924
|
...ft,
|
|
925
|
-
...
|
|
925
|
+
...Rt,
|
|
926
926
|
letterSpacing: "-0.01em",
|
|
927
927
|
textWrap: "balance"
|
|
928
928
|
}),
|
|
@@ -942,7 +942,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
942
942
|
),
|
|
943
943
|
winPct: d({
|
|
944
944
|
...V,
|
|
945
|
-
...
|
|
945
|
+
...Wt(t.winPct),
|
|
946
946
|
fontVariantNumeric: "tabular-nums"
|
|
947
947
|
}),
|
|
948
948
|
ofVotes: d({ fontWeight: 500, ...I([14, 20]) }),
|
|
@@ -954,7 +954,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
954
954
|
gap: s(6),
|
|
955
955
|
textAlign: "center",
|
|
956
956
|
minWidth: 0,
|
|
957
|
-
animation: `${
|
|
957
|
+
animation: `${Ot} .6s .4s ease-out both`
|
|
958
958
|
}),
|
|
959
959
|
loserSlot: d({
|
|
960
960
|
width: "100%",
|
|
@@ -966,22 +966,22 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
966
966
|
}),
|
|
967
967
|
loserName: d({
|
|
968
968
|
...V,
|
|
969
|
-
...
|
|
969
|
+
...Ft(t.loserName),
|
|
970
970
|
...mt,
|
|
971
971
|
...ft,
|
|
972
|
-
...
|
|
972
|
+
...Rt,
|
|
973
973
|
paddingTop: s(2),
|
|
974
974
|
textWrap: "balance"
|
|
975
975
|
}),
|
|
976
976
|
loserPct: d({
|
|
977
977
|
...V,
|
|
978
|
-
...
|
|
978
|
+
...Wt(t.loserPct),
|
|
979
979
|
fontVariantNumeric: "tabular-nums"
|
|
980
980
|
}),
|
|
981
|
-
img:
|
|
982
|
-
trophy:
|
|
981
|
+
img: Le(t),
|
|
982
|
+
trophy: kn(t)
|
|
983
983
|
};
|
|
984
|
-
},
|
|
984
|
+
}, Ne = () => ({
|
|
985
985
|
shell: d({
|
|
986
986
|
display: "flex",
|
|
987
987
|
flexDirection: "column",
|
|
@@ -993,7 +993,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
993
993
|
}),
|
|
994
994
|
row: d({
|
|
995
995
|
position: "relative",
|
|
996
|
-
height: s(
|
|
996
|
+
height: s(Ct),
|
|
997
997
|
boxSizing: "border-box",
|
|
998
998
|
padding: `0 ${s(12)}`,
|
|
999
999
|
display: "flex",
|
|
@@ -1003,7 +1003,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1003
1003
|
}),
|
|
1004
1004
|
rowNeutral: d({
|
|
1005
1005
|
position: "relative",
|
|
1006
|
-
height: s(
|
|
1006
|
+
height: s(Ct),
|
|
1007
1007
|
boxSizing: "border-box",
|
|
1008
1008
|
padding: `0 ${s(12)}`,
|
|
1009
1009
|
display: "flex",
|
|
@@ -1012,7 +1012,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1012
1012
|
}),
|
|
1013
1013
|
rowWinner: d({
|
|
1014
1014
|
position: "relative",
|
|
1015
|
-
height: s(
|
|
1015
|
+
height: s(Ct),
|
|
1016
1016
|
boxSizing: "border-box",
|
|
1017
1017
|
padding: `0 ${s(12)}`,
|
|
1018
1018
|
display: "flex",
|
|
@@ -1020,7 +1020,7 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1020
1020
|
gap: s(12),
|
|
1021
1021
|
backgroundColor: i.fill,
|
|
1022
1022
|
color: i.on,
|
|
1023
|
-
animation: `${
|
|
1023
|
+
animation: `${Ot} .6s ease-out both`
|
|
1024
1024
|
}),
|
|
1025
1025
|
greyed: d({ filter: "grayscale(1) opacity(0.7)", display: "flex" }),
|
|
1026
1026
|
imgWrap: d({ position: "relative", display: "flex", flexShrink: 0 }),
|
|
@@ -1046,86 +1046,86 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1046
1046
|
flexShrink: 0
|
|
1047
1047
|
}),
|
|
1048
1048
|
action: d({ width: s(104), flexShrink: 0, display: "flex" }),
|
|
1049
|
-
...
|
|
1050
|
-
trophy:
|
|
1051
|
-
}),
|
|
1052
|
-
const [o,
|
|
1053
|
-
return t.kind === "player" ? /* @__PURE__ */
|
|
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(
|
|
1054
1054
|
"img",
|
|
1055
1055
|
{
|
|
1056
|
-
src: u ??
|
|
1056
|
+
src: u ?? Un.playerPlaceholder,
|
|
1057
1057
|
alt: "",
|
|
1058
1058
|
loading: "lazy",
|
|
1059
1059
|
decoding: "async",
|
|
1060
|
-
onError: () => u &&
|
|
1060
|
+
onError: () => u && a(u)
|
|
1061
1061
|
}
|
|
1062
|
-
) }) : u ? /* @__PURE__ */
|
|
1062
|
+
) }) : u ? /* @__PURE__ */ l(
|
|
1063
1063
|
"img",
|
|
1064
1064
|
{
|
|
1065
|
-
css:
|
|
1065
|
+
css: h[n].img[e].logo,
|
|
1066
1066
|
src: u,
|
|
1067
1067
|
alt: "",
|
|
1068
1068
|
loading: "lazy",
|
|
1069
1069
|
decoding: "async",
|
|
1070
|
-
onError: () =>
|
|
1070
|
+
onError: () => a(u)
|
|
1071
1071
|
}
|
|
1072
|
-
) : /* @__PURE__ */
|
|
1073
|
-
},
|
|
1074
|
-
const r = `${t}|${
|
|
1075
|
-
return /* @__PURE__ */
|
|
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"}`;
|
|
1075
|
+
return /* @__PURE__ */ l(
|
|
1076
1076
|
"div",
|
|
1077
1077
|
{
|
|
1078
|
-
css: e ? R.trophy.at[r] :
|
|
1078
|
+
css: e ? R.trophy.at[r] : h[n].trophy.at[r],
|
|
1079
1079
|
"aria-hidden": "true",
|
|
1080
|
-
children: /* @__PURE__ */
|
|
1081
|
-
|
|
1080
|
+
children: /* @__PURE__ */ l(
|
|
1081
|
+
te,
|
|
1082
1082
|
{
|
|
1083
|
-
css: e ? R.trophy.icon :
|
|
1083
|
+
css: e ? R.trophy.icon : h[n].trophy.icon
|
|
1084
1084
|
}
|
|
1085
1085
|
)
|
|
1086
1086
|
}
|
|
1087
1087
|
);
|
|
1088
|
-
},
|
|
1088
|
+
}, De = (t) => {
|
|
1089
1089
|
if (t != null && t.onClick) return t.onClick;
|
|
1090
1090
|
const n = t == null ? void 0 : t.url;
|
|
1091
1091
|
if (n)
|
|
1092
1092
|
return () => {
|
|
1093
1093
|
((t == null ? void 0 : t.target) ?? "_self") === "_blank" ? window.open(n, "_blank") : window.location.href = n;
|
|
1094
1094
|
};
|
|
1095
|
-
},
|
|
1095
|
+
}, In = ({
|
|
1096
1096
|
state: t,
|
|
1097
1097
|
layout: n,
|
|
1098
1098
|
row: e,
|
|
1099
1099
|
labels: r,
|
|
1100
1100
|
signInCTA: o,
|
|
1101
|
-
onVote:
|
|
1101
|
+
onVote: a
|
|
1102
1102
|
}) => {
|
|
1103
1103
|
if (t === "signIn") {
|
|
1104
|
-
if (o != null && o.component) return /* @__PURE__ */
|
|
1105
|
-
const u =
|
|
1106
|
-
return /* @__PURE__ */
|
|
1104
|
+
if (o != null && o.component) return /* @__PURE__ */ l(Pt, { children: o.component });
|
|
1105
|
+
const u = De(o);
|
|
1106
|
+
return /* @__PURE__ */ l(
|
|
1107
1107
|
"button",
|
|
1108
1108
|
{
|
|
1109
1109
|
type: "button",
|
|
1110
|
-
css: e ? R.vote :
|
|
1110
|
+
css: e ? R.vote : h[n].vote,
|
|
1111
1111
|
disabled: !u,
|
|
1112
1112
|
onClick: u,
|
|
1113
|
-
children: /* @__PURE__ */
|
|
1113
|
+
children: /* @__PURE__ */ l("span", { children: (o == null ? void 0 : o.defaultLabel) || r.signIn })
|
|
1114
1114
|
}
|
|
1115
1115
|
);
|
|
1116
1116
|
}
|
|
1117
|
-
return t === "chosen" ? /* @__PURE__ */ b("div", { css: e ? R.thanks :
|
|
1118
|
-
/* @__PURE__ */
|
|
1119
|
-
/* @__PURE__ */
|
|
1120
|
-
] }) : t === "locked" ? null : /* @__PURE__ */
|
|
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 }),
|
|
1119
|
+
/* @__PURE__ */ l("span", { children: r.thankYou })
|
|
1120
|
+
] }) : t === "locked" ? null : /* @__PURE__ */ l(
|
|
1121
1121
|
"button",
|
|
1122
1122
|
{
|
|
1123
1123
|
type: "button",
|
|
1124
|
-
css: e ? R.vote :
|
|
1124
|
+
css: e ? R.vote : h[n].vote,
|
|
1125
1125
|
"aria-label": r.voteFor,
|
|
1126
1126
|
disabled: t === "submitting" || t === "upcoming",
|
|
1127
|
-
onClick:
|
|
1128
|
-
children: /* @__PURE__ */
|
|
1127
|
+
onClick: a,
|
|
1128
|
+
children: /* @__PURE__ */ l("span", { children: r.vote })
|
|
1129
1129
|
}
|
|
1130
1130
|
);
|
|
1131
1131
|
}, _ = (t, n) => ({
|
|
@@ -1133,18 +1133,18 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1133
1133
|
"--bof-on": t.on,
|
|
1134
1134
|
"--bof-ink": t.ink,
|
|
1135
1135
|
...n ? { "--bof-from": n } : {}
|
|
1136
|
-
}),
|
|
1136
|
+
}), Lt = (t, n) => ({
|
|
1137
1137
|
..._(t.colours[n]),
|
|
1138
1138
|
flex: `0 0 ${t.widths[n]}%`,
|
|
1139
1139
|
"--bof-pad-start": n > 0 ? `${t.slant}%` : "0%",
|
|
1140
1140
|
"--bof-pad-end": n < t.sides.length - 1 ? `${t.slant}%` : "0%"
|
|
1141
|
-
}),
|
|
1141
|
+
}), vn = (t, n) => ({
|
|
1142
1142
|
vote: t.label("vote"),
|
|
1143
1143
|
voteFor: t.label("voteFor", { name: n.name }),
|
|
1144
1144
|
thankYou: t.label("thankYou"),
|
|
1145
1145
|
signIn: t.label("signIn")
|
|
1146
|
-
}),
|
|
1147
|
-
const r = t.winner === e, o = t.winner !== null && !r,
|
|
1146
|
+
}), Be = ({ view: t }) => /* @__PURE__ */ l("div", { css: R.shell, role: "group", "aria-label": t.splitLabel ?? void 0, children: t.sides.map((n, e) => {
|
|
1147
|
+
const r = t.winner === e, o = t.winner !== null && !r, a = /* @__PURE__ */ l(
|
|
1148
1148
|
Z,
|
|
1149
1149
|
{
|
|
1150
1150
|
side: n,
|
|
@@ -1160,18 +1160,18 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1160
1160
|
style: _(t.colours[e]),
|
|
1161
1161
|
children: [
|
|
1162
1162
|
/* @__PURE__ */ b("div", { css: R.imgWrap, children: [
|
|
1163
|
-
o ? /* @__PURE__ */
|
|
1164
|
-
r && t.showTrophy && /* @__PURE__ */
|
|
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 })
|
|
1165
1165
|
] }),
|
|
1166
|
-
/* @__PURE__ */
|
|
1167
|
-
t.fill && t.percents[e] !== null && /* @__PURE__ */
|
|
1168
|
-
!t.ended && /* @__PURE__ */
|
|
1169
|
-
|
|
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,
|
|
1170
1170
|
{
|
|
1171
1171
|
state: t.actions[e],
|
|
1172
1172
|
layout: "m",
|
|
1173
1173
|
row: !0,
|
|
1174
|
-
labels:
|
|
1174
|
+
labels: vn(t, n),
|
|
1175
1175
|
signInCTA: t.signInCTA,
|
|
1176
1176
|
onVote: () => t.onVote(e)
|
|
1177
1177
|
}
|
|
@@ -1180,15 +1180,15 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1180
1180
|
},
|
|
1181
1181
|
n.optionId
|
|
1182
1182
|
);
|
|
1183
|
-
}) }),
|
|
1183
|
+
}) }), ze = ({
|
|
1184
1184
|
view: t,
|
|
1185
1185
|
index: n
|
|
1186
1186
|
}) => {
|
|
1187
1187
|
const e = t.sides[n];
|
|
1188
|
-
return /* @__PURE__ */
|
|
1189
|
-
/* @__PURE__ */ b("div", { css:
|
|
1190
|
-
/* @__PURE__ */
|
|
1191
|
-
/* @__PURE__ */
|
|
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" }),
|
|
1191
|
+
/* @__PURE__ */ l(
|
|
1192
1192
|
Z,
|
|
1193
1193
|
{
|
|
1194
1194
|
side: e,
|
|
@@ -1197,8 +1197,8 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1197
1197
|
language: t.language
|
|
1198
1198
|
}
|
|
1199
1199
|
),
|
|
1200
|
-
t.showTrophy && /* @__PURE__ */
|
|
1201
|
-
|
|
1200
|
+
t.showTrophy && /* @__PURE__ */ l(
|
|
1201
|
+
Sn,
|
|
1202
1202
|
{
|
|
1203
1203
|
position: t.trophyPosition,
|
|
1204
1204
|
layout: t.layout,
|
|
@@ -1206,22 +1206,22 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1206
1206
|
}
|
|
1207
1207
|
)
|
|
1208
1208
|
] }),
|
|
1209
|
-
/* @__PURE__ */ b("div", { css:
|
|
1210
|
-
/* @__PURE__ */
|
|
1211
|
-
/* @__PURE__ */
|
|
1212
|
-
t.fill && t.percents[n] !== null && /* @__PURE__ */ b("div", { css:
|
|
1213
|
-
/* @__PURE__ */
|
|
1214
|
-
/* @__PURE__ */
|
|
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") })
|
|
1215
1215
|
] })
|
|
1216
1216
|
] })
|
|
1217
1217
|
] }) });
|
|
1218
|
-
},
|
|
1218
|
+
}, Ae = ({
|
|
1219
1219
|
view: t,
|
|
1220
1220
|
index: n
|
|
1221
1221
|
}) => {
|
|
1222
1222
|
const e = t.sides[n];
|
|
1223
|
-
return /* @__PURE__ */
|
|
1224
|
-
/* @__PURE__ */
|
|
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
1225
|
Z,
|
|
1226
1226
|
{
|
|
1227
1227
|
side: e,
|
|
@@ -1230,10 +1230,10 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1230
1230
|
language: t.language
|
|
1231
1231
|
}
|
|
1232
1232
|
) }),
|
|
1233
|
-
/* @__PURE__ */
|
|
1234
|
-
t.fill && t.percents[n] !== null && /* @__PURE__ */
|
|
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] })
|
|
1235
1235
|
] }) });
|
|
1236
|
-
},
|
|
1236
|
+
}, Ve = ({
|
|
1237
1237
|
view: t,
|
|
1238
1238
|
index: n
|
|
1239
1239
|
}) => {
|
|
@@ -1241,10 +1241,10 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1241
1241
|
return /* @__PURE__ */ b(
|
|
1242
1242
|
"div",
|
|
1243
1243
|
{
|
|
1244
|
-
css: t.fill ?
|
|
1245
|
-
style:
|
|
1244
|
+
css: t.fill ? h[t.layout].columnFill : h[t.layout].column,
|
|
1245
|
+
style: Lt(t, n),
|
|
1246
1246
|
children: [
|
|
1247
|
-
/* @__PURE__ */
|
|
1247
|
+
/* @__PURE__ */ l("div", { css: h[t.layout].imgSlot, children: /* @__PURE__ */ l(
|
|
1248
1248
|
Z,
|
|
1249
1249
|
{
|
|
1250
1250
|
side: e,
|
|
@@ -1253,19 +1253,19 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1253
1253
|
language: t.language
|
|
1254
1254
|
}
|
|
1255
1255
|
) }),
|
|
1256
|
-
/* @__PURE__ */
|
|
1257
|
-
t.fill && t.percents[n] !== null && /* @__PURE__ */
|
|
1258
|
-
!t.ended && /* @__PURE__ */
|
|
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] }),
|
|
1258
|
+
!t.ended && /* @__PURE__ */ l(
|
|
1259
1259
|
"div",
|
|
1260
1260
|
{
|
|
1261
|
-
css: t.fill ?
|
|
1262
|
-
children: /* @__PURE__ */
|
|
1263
|
-
|
|
1261
|
+
css: t.fill ? h[t.layout].actionFill : h[t.layout].action,
|
|
1262
|
+
children: /* @__PURE__ */ l(
|
|
1263
|
+
In,
|
|
1264
1264
|
{
|
|
1265
1265
|
state: t.actions[n],
|
|
1266
1266
|
layout: t.layout,
|
|
1267
1267
|
row: !1,
|
|
1268
|
-
labels:
|
|
1268
|
+
labels: vn(t, e),
|
|
1269
1269
|
signInCTA: t.signInCTA,
|
|
1270
1270
|
onVote: () => t.onVote(n)
|
|
1271
1271
|
}
|
|
@@ -1275,20 +1275,20 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1275
1275
|
]
|
|
1276
1276
|
}
|
|
1277
1277
|
);
|
|
1278
|
-
},
|
|
1279
|
-
if (t.rows) return /* @__PURE__ */
|
|
1278
|
+
}, _e = ({ view: t }) => {
|
|
1279
|
+
if (t.rows) return /* @__PURE__ */ l(Be, { view: t });
|
|
1280
1280
|
const n = t.winner;
|
|
1281
1281
|
return /* @__PURE__ */ b(
|
|
1282
1282
|
"div",
|
|
1283
1283
|
{
|
|
1284
|
-
css: t.fill ?
|
|
1284
|
+
css: t.fill ? h[t.layout].fill : h[t.layout].bar,
|
|
1285
1285
|
role: "group",
|
|
1286
1286
|
"aria-label": t.splitLabel ?? void 0,
|
|
1287
1287
|
children: [
|
|
1288
|
-
n !== null ? /* @__PURE__ */
|
|
1288
|
+
n !== null ? /* @__PURE__ */ l(
|
|
1289
1289
|
"div",
|
|
1290
1290
|
{
|
|
1291
|
-
css:
|
|
1291
|
+
css: h[t.layout].layerWinner,
|
|
1292
1292
|
"aria-hidden": "true",
|
|
1293
1293
|
style: {
|
|
1294
1294
|
..._(t.colours[n], t.evenClips[n]),
|
|
@@ -1296,23 +1296,23 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1296
1296
|
}
|
|
1297
1297
|
},
|
|
1298
1298
|
"winner"
|
|
1299
|
-
) : t.sides.map((e, r) => /* @__PURE__ */
|
|
1299
|
+
) : t.sides.map((e, r) => /* @__PURE__ */ l(
|
|
1300
1300
|
"div",
|
|
1301
1301
|
{
|
|
1302
|
-
css: t.lit[r] ?
|
|
1302
|
+
css: t.lit[r] ? h[t.layout].layer : h[t.layout].layerNeutral,
|
|
1303
1303
|
"aria-hidden": "true",
|
|
1304
1304
|
style: { ..._(t.colours[r]), clipPath: t.clips[r] }
|
|
1305
1305
|
},
|
|
1306
1306
|
e.optionId
|
|
1307
1307
|
)),
|
|
1308
1308
|
t.sides.map(
|
|
1309
|
-
(e, r) => n === null ? /* @__PURE__ */
|
|
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)
|
|
1310
1310
|
)
|
|
1311
1311
|
]
|
|
1312
1312
|
}
|
|
1313
1313
|
);
|
|
1314
|
-
},
|
|
1315
|
-
const o =
|
|
1314
|
+
}, He = ({ layout: t, label: n, caption: e, left: r }) => {
|
|
1315
|
+
const o = fn(), a = q(
|
|
1316
1316
|
() => new Intl.NumberFormat(o, {
|
|
1317
1317
|
minimumIntegerDigits: 2,
|
|
1318
1318
|
useGrouping: !1
|
|
@@ -1325,42 +1325,42 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1325
1325
|
{ value: r.seconds, caption: n("seconds") }
|
|
1326
1326
|
];
|
|
1327
1327
|
return /* @__PURE__ */ b("div", { css: Y[t].root, children: [
|
|
1328
|
-
/* @__PURE__ */
|
|
1329
|
-
/* @__PURE__ */
|
|
1330
|
-
t === "d" && c > 0 && /* @__PURE__ */
|
|
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
1331
|
/* @__PURE__ */ b("div", { css: Y[t].unit, children: [
|
|
1332
|
-
/* @__PURE__ */
|
|
1333
|
-
/* @__PURE__ */
|
|
1332
|
+
/* @__PURE__ */ l("div", { css: Y[t].value, children: a.format(m.value) }),
|
|
1333
|
+
/* @__PURE__ */ l("div", { css: Y[t].caption, children: m.caption })
|
|
1334
1334
|
] })
|
|
1335
1335
|
] }, c)) })
|
|
1336
1336
|
] });
|
|
1337
|
-
},
|
|
1337
|
+
}, je = ({
|
|
1338
1338
|
layout: t,
|
|
1339
1339
|
label: n,
|
|
1340
1340
|
title: e,
|
|
1341
1341
|
openSubtitle: r,
|
|
1342
1342
|
ended: o,
|
|
1343
|
-
draw:
|
|
1343
|
+
draw: a,
|
|
1344
1344
|
upcoming: u,
|
|
1345
1345
|
left: m
|
|
1346
1346
|
}) => {
|
|
1347
1347
|
const c = [
|
|
1348
1348
|
{ key: "open", text: r, on: !o },
|
|
1349
|
-
{ key: "ended", text: n("endedSubtitle"), on: o && !
|
|
1350
|
-
{ key: "draw", text: n("drawSubtitle"), on: o &&
|
|
1351
|
-
], f = o ? /* @__PURE__ */
|
|
1352
|
-
|
|
1349
|
+
{ key: "ended", text: n("endedSubtitle"), on: o && !a },
|
|
1350
|
+
{ key: "draw", text: n("drawSubtitle"), on: o && a }
|
|
1351
|
+
], f = o ? /* @__PURE__ */ l("div", { css: y[t].pill, children: n("votingEnded") }) : m ? /* @__PURE__ */ l(
|
|
1352
|
+
He,
|
|
1353
1353
|
{
|
|
1354
1354
|
layout: t,
|
|
1355
1355
|
label: n,
|
|
1356
1356
|
caption: n(u ? "votingStartsIn" : "votingEndsIn"),
|
|
1357
1357
|
left: m
|
|
1358
1358
|
}
|
|
1359
|
-
) : u ? /* @__PURE__ */
|
|
1359
|
+
) : u ? /* @__PURE__ */ l("div", { css: y[t].pill, children: n("votingStartsSoon") }) : null;
|
|
1360
1360
|
return /* @__PURE__ */ b("div", { css: y[t].header, children: [
|
|
1361
1361
|
/* @__PURE__ */ b("div", { css: y[t].titles, children: [
|
|
1362
|
-
/* @__PURE__ */
|
|
1363
|
-
/* @__PURE__ */
|
|
1362
|
+
/* @__PURE__ */ l("h2", { css: y[t].title, children: e }),
|
|
1363
|
+
/* @__PURE__ */ l("div", { css: y[t].subtitles, children: c.map((p) => /* @__PURE__ */ l(
|
|
1364
1364
|
"p",
|
|
1365
1365
|
{
|
|
1366
1366
|
css: p.on ? y[t].subtitle : y[t].subtitleHidden,
|
|
@@ -1370,9 +1370,9 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1370
1370
|
p.key
|
|
1371
1371
|
)) })
|
|
1372
1372
|
] }),
|
|
1373
|
-
t === "m" ? f && /* @__PURE__ */
|
|
1373
|
+
t === "m" ? f && /* @__PURE__ */ l("div", { css: y.m.status, children: f }) : f
|
|
1374
1374
|
] });
|
|
1375
|
-
},
|
|
1375
|
+
}, sn = (t) => ({
|
|
1376
1376
|
fontSize: "1em",
|
|
1377
1377
|
display: "flex",
|
|
1378
1378
|
flexDirection: "column",
|
|
@@ -1380,16 +1380,16 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1380
1380
|
gap: t ? i.spaceMd : i.spaceLg,
|
|
1381
1381
|
padding: t ? i.spaceMd : `${s(32)} ${i.spaceLg}`,
|
|
1382
1382
|
borderRadius: i.radiusMd
|
|
1383
|
-
}),
|
|
1383
|
+
}), an = (t) => d({
|
|
1384
1384
|
flexShrink: 0,
|
|
1385
1385
|
width: "2px",
|
|
1386
1386
|
height: s(32),
|
|
1387
1387
|
backgroundColor: i.border,
|
|
1388
1388
|
transform: `skewX(${t ? 14 : -14}deg)`
|
|
1389
|
-
}),
|
|
1390
|
-
panel: d(
|
|
1389
|
+
}), ln = (t) => ({
|
|
1390
|
+
panel: d(sn(t), { backgroundColor: i.inner }),
|
|
1391
1391
|
// "after": the panel takes the picked side's tint.
|
|
1392
|
-
panelPicked: d(
|
|
1392
|
+
panelPicked: d(sn(t), { backgroundColor: i.tint }),
|
|
1393
1393
|
intro: d({
|
|
1394
1394
|
display: "flex",
|
|
1395
1395
|
flexDirection: "column",
|
|
@@ -1451,10 +1451,10 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1451
1451
|
backgroundColor: i.surface,
|
|
1452
1452
|
border: `${i.borderSize} solid ${i.border}`
|
|
1453
1453
|
})
|
|
1454
|
-
}), j = { d:
|
|
1455
|
-
var
|
|
1456
|
-
const { layout: n, poll: e, sides: r, colours: o, picked:
|
|
1457
|
-
/* @__PURE__ */
|
|
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: [
|
|
1457
|
+
/* @__PURE__ */ l(
|
|
1458
1458
|
Z,
|
|
1459
1459
|
{
|
|
1460
1460
|
side: c,
|
|
@@ -1463,10 +1463,10 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1463
1463
|
language: t.language
|
|
1464
1464
|
}
|
|
1465
1465
|
),
|
|
1466
|
-
/* @__PURE__ */
|
|
1467
|
-
] }) : /* @__PURE__ */
|
|
1468
|
-
B > 0 && /* @__PURE__ */
|
|
1469
|
-
/* @__PURE__ */
|
|
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
1470
|
Z,
|
|
1471
1471
|
{
|
|
1472
1472
|
side: F,
|
|
@@ -1480,22 +1480,22 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1480
1480
|
"div",
|
|
1481
1481
|
{
|
|
1482
1482
|
css: c ? j[n].panelPicked : j[n].panel,
|
|
1483
|
-
style:
|
|
1484
|
-
..._(o[
|
|
1485
|
-
"--fu-ucrc-primary-on-primary": o[
|
|
1483
|
+
style: a !== null ? {
|
|
1484
|
+
..._(o[a]),
|
|
1485
|
+
"--fu-ucrc-primary-on-primary": o[a].on
|
|
1486
1486
|
} : void 0,
|
|
1487
1487
|
children: [
|
|
1488
1488
|
/* @__PURE__ */ b("div", { css: j[n].intro, children: [
|
|
1489
1489
|
p,
|
|
1490
|
-
/* @__PURE__ */
|
|
1491
|
-
/* @__PURE__ */
|
|
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") })
|
|
1492
1492
|
] }),
|
|
1493
|
-
/* @__PURE__ */
|
|
1494
|
-
|
|
1493
|
+
/* @__PURE__ */ l("div", { css: j[n].form, children: /* @__PURE__ */ l(
|
|
1494
|
+
An,
|
|
1495
1495
|
{
|
|
1496
1496
|
sdk: t.sdk,
|
|
1497
|
-
brandingColors: c ? { primaryColor: o[
|
|
1498
|
-
brandingUrls: (
|
|
1497
|
+
brandingColors: c ? { primaryColor: o[a].fill } : void 0,
|
|
1498
|
+
brandingUrls: (g = e.branding) == null ? void 0 : g.urls,
|
|
1499
1499
|
fields: t.leads.fields,
|
|
1500
1500
|
campaignId: t.leads.campaignId,
|
|
1501
1501
|
campaignName: t.leads.campaignName,
|
|
@@ -1518,17 +1518,17 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1518
1518
|
]
|
|
1519
1519
|
}
|
|
1520
1520
|
);
|
|
1521
|
-
},
|
|
1521
|
+
}, cn = (t) => {
|
|
1522
1522
|
const n = {
|
|
1523
1523
|
flex: 1,
|
|
1524
1524
|
fontFamily: i.fontPrimary,
|
|
1525
1525
|
fontWeight: 700,
|
|
1526
1526
|
fontVariantNumeric: "tabular-nums",
|
|
1527
1527
|
...I(t.pctBar)
|
|
1528
|
-
}, e = (
|
|
1528
|
+
}, e = (a) => d({
|
|
1529
1529
|
minWidth: s(t.bar),
|
|
1530
1530
|
backgroundColor: i.fill,
|
|
1531
|
-
borderRadius:
|
|
1531
|
+
borderRadius: a,
|
|
1532
1532
|
transition: "flex-grow .6s cubic-bezier(.2,.8,.2,1)"
|
|
1533
1533
|
}), r = i.radiusFull, o = s(3);
|
|
1534
1534
|
return {
|
|
@@ -1581,130 +1581,135 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1581
1581
|
backgroundColor: i.track
|
|
1582
1582
|
})
|
|
1583
1583
|
};
|
|
1584
|
-
}, W = { d:
|
|
1584
|
+
}, W = { d: cn(tt), m: cn(nt) }, Ue = ({
|
|
1585
1585
|
layout: t,
|
|
1586
1586
|
label: n,
|
|
1587
1587
|
colours: e,
|
|
1588
1588
|
shares: r,
|
|
1589
1589
|
percents: o,
|
|
1590
|
-
ended:
|
|
1590
|
+
ended: a,
|
|
1591
1591
|
splitLabel: u
|
|
1592
1592
|
}) => {
|
|
1593
1593
|
if (o.some((p) => p === null))
|
|
1594
1594
|
return /* @__PURE__ */ b("div", { css: W[t].root, children: [
|
|
1595
1595
|
/* @__PURE__ */ b("div", { css: W[t].lock, children: [
|
|
1596
|
-
/* @__PURE__ */
|
|
1597
|
-
/* @__PURE__ */
|
|
1596
|
+
/* @__PURE__ */ l(ee, { css: W[t].lockIcon }),
|
|
1597
|
+
/* @__PURE__ */ l("span", { children: n("voteToSeeResults") })
|
|
1598
1598
|
] }),
|
|
1599
|
-
/* @__PURE__ */
|
|
1599
|
+
/* @__PURE__ */ l("div", { css: W[t].track, "aria-hidden": "true" })
|
|
1600
1600
|
] });
|
|
1601
1601
|
const m = r.length, c = r.every((p) => p === 0) ? r.map(() => 1) : r, f = m - 1;
|
|
1602
1602
|
return /* @__PURE__ */ b("div", { css: W[t].root, children: [
|
|
1603
1603
|
m === 2 ? /* @__PURE__ */ b("div", { css: W[t].labels, children: [
|
|
1604
|
-
/* @__PURE__ */
|
|
1605
|
-
|
|
1606
|
-
/* @__PURE__ */
|
|
1607
|
-
] }) : /* @__PURE__ */
|
|
1604
|
+
/* @__PURE__ */ l("div", { css: W[t].pct, style: _(e[0]), children: o[0] }),
|
|
1605
|
+
a && /* @__PURE__ */ l("div", { css: W[t].caption, children: n("finalResult") }),
|
|
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(
|
|
1608
1608
|
"div",
|
|
1609
1609
|
{
|
|
1610
1610
|
css: W[t].cell,
|
|
1611
|
-
style: { ..._(e[
|
|
1611
|
+
style: { ..._(e[g]), flex: `${c[g]} 1 0%` },
|
|
1612
1612
|
children: p
|
|
1613
1613
|
},
|
|
1614
|
-
|
|
1614
|
+
g
|
|
1615
1615
|
)) }),
|
|
1616
|
-
/* @__PURE__ */
|
|
1616
|
+
/* @__PURE__ */ l(
|
|
1617
1617
|
"div",
|
|
1618
1618
|
{
|
|
1619
1619
|
css: W[t].bar,
|
|
1620
1620
|
role: "img",
|
|
1621
1621
|
"aria-label": u ?? void 0,
|
|
1622
|
-
children: e.map((p,
|
|
1622
|
+
children: e.map((p, g) => /* @__PURE__ */ l(
|
|
1623
1623
|
"div",
|
|
1624
1624
|
{
|
|
1625
|
-
css:
|
|
1626
|
-
style: { ..._(p), flex: `${c[
|
|
1625
|
+
css: g === 0 ? W[t].segFirst : g === f ? W[t].segLast : W[t].segMid,
|
|
1626
|
+
style: { ..._(p), flex: `${c[g]} 1 0%` }
|
|
1627
1627
|
},
|
|
1628
|
-
|
|
1628
|
+
g
|
|
1629
1629
|
))
|
|
1630
1630
|
}
|
|
1631
1631
|
)
|
|
1632
1632
|
] });
|
|
1633
|
-
},
|
|
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,
|
|
1634
1635
|
/* @__PURE__ */ b("div", { css: y[t].body, children: [
|
|
1635
|
-
/* @__PURE__ */
|
|
1636
|
-
n ? /* @__PURE__ */
|
|
1636
|
+
/* @__PURE__ */ l("div", { css: y[t].header, style: { minHeight: Ye[t] }, children: /* @__PURE__ */ l("div", { css: y[t].titleSkeleton }) }),
|
|
1637
|
+
n ? /* @__PURE__ */ l(
|
|
1637
1638
|
"div",
|
|
1638
1639
|
{
|
|
1639
1640
|
css: y[t].arenaSkeleton,
|
|
1640
|
-
style: { height:
|
|
1641
|
+
style: { height: $n[t] }
|
|
1641
1642
|
}
|
|
1642
|
-
) : /* @__PURE__ */ b(
|
|
1643
|
-
/* @__PURE__ */
|
|
1643
|
+
) : /* @__PURE__ */ b(Pt, { children: [
|
|
1644
|
+
/* @__PURE__ */ l(
|
|
1644
1645
|
"div",
|
|
1645
1646
|
{
|
|
1646
1647
|
css: y[t].arenaSkeleton,
|
|
1647
|
-
style: { height:
|
|
1648
|
+
style: { height: Xe[t] }
|
|
1648
1649
|
}
|
|
1649
1650
|
),
|
|
1650
|
-
/* @__PURE__ */
|
|
1651
|
+
/* @__PURE__ */ l("div", { css: y[t].resultsSkeleton, children: /* @__PURE__ */ l("div", { css: y[t].barSkeleton }) })
|
|
1651
1652
|
] })
|
|
1652
1653
|
] }),
|
|
1653
|
-
e && /* @__PURE__ */
|
|
1654
|
-
] }),
|
|
1654
|
+
e && /* @__PURE__ */ l("div", { css: y[t].oddsSlot, children: /* @__PURE__ */ l(gn, { size: t === "m" ? "dense" : "default" }) })
|
|
1655
|
+
] }), Je = ({
|
|
1655
1656
|
layout: t,
|
|
1656
1657
|
label: n,
|
|
1657
1658
|
kind: e,
|
|
1658
|
-
onRetry: r
|
|
1659
|
+
onRetry: r,
|
|
1660
|
+
banner: o
|
|
1659
1661
|
}) => {
|
|
1660
|
-
const { t:
|
|
1661
|
-
return /* @__PURE__ */
|
|
1662
|
-
|
|
1663
|
-
/* @__PURE__ */ b(
|
|
1664
|
-
"div",
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
},
|
|
1681
|
-
|
|
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;
|
|
1682
1687
|
const {
|
|
1683
1688
|
sdk: n,
|
|
1684
1689
|
language: e,
|
|
1685
1690
|
progressDisplay: r = "bar",
|
|
1686
1691
|
showResultsBeforeVote: o = !0,
|
|
1687
|
-
showTrophy:
|
|
1692
|
+
showTrophy: a = !0,
|
|
1688
1693
|
trophyPosition: u = "bottom-right",
|
|
1689
1694
|
showOdds: m = !1,
|
|
1690
1695
|
odds: c
|
|
1691
|
-
} = t, { t: f } = bt("common"), p =
|
|
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({
|
|
1692
1697
|
entityId: t.entityId,
|
|
1693
1698
|
sdk: n,
|
|
1694
1699
|
language: e,
|
|
1695
1700
|
userIsLoggedIn: t.userIsLoggedIn,
|
|
1696
1701
|
callbacks: t.callbacks
|
|
1697
|
-
}), { sides: S, votes: it, poll: E, startMs: z, endMs: L } = $, [O, st] = A(!1), [H, C] = A(null), x = z !== null ? z +
|
|
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(
|
|
1698
1703
|
x !== null && L !== null ? Math.max(x, L) : x ?? L
|
|
1699
|
-
), v = (E == null ? void 0 : E.status) === "INACTIVE" && z !== null && M < z +
|
|
1700
|
-
|
|
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(() => {
|
|
1701
1706
|
if (!w) return;
|
|
1702
1707
|
P();
|
|
1703
|
-
const k = setInterval(P,
|
|
1708
|
+
const k = setInterval(P, le);
|
|
1704
1709
|
return () => clearInterval(k);
|
|
1705
1710
|
}, [w, P]);
|
|
1706
|
-
const et =
|
|
1707
|
-
|
|
1711
|
+
const et = pn(!1);
|
|
1712
|
+
gt(() => {
|
|
1708
1713
|
E && (N ? et.current && (et.current = !1, P()) : et.current = !0);
|
|
1709
1714
|
}, [E, N, P]);
|
|
1710
1715
|
const at = q(
|
|
@@ -1718,14 +1723,14 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1718
1723
|
extras: [
|
|
1719
1724
|
(k = T.palette.success) == null ? void 0 : k.plainColor,
|
|
1720
1725
|
(G = T.palette.warning) == null ? void 0 : G.plainColor
|
|
1721
|
-
].filter((
|
|
1726
|
+
].filter((zn) => !!zn)
|
|
1722
1727
|
};
|
|
1723
1728
|
},
|
|
1724
1729
|
[T]
|
|
1725
|
-
),
|
|
1726
|
-
((
|
|
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,
|
|
1727
1732
|
at
|
|
1728
|
-
), K = c == null ? void 0 : c.eventId, xt = m && !!K && S.length === 2 && S.every((k) => k.kind === "team"),
|
|
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(
|
|
1729
1734
|
n,
|
|
1730
1735
|
xt && K ? [K] : [],
|
|
1731
1736
|
{
|
|
@@ -1737,58 +1742,76 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1737
1742
|
affiliateId: c == null ? void 0 : c.affiliateId,
|
|
1738
1743
|
affiliateIds: c == null ? void 0 : c.affiliateIds
|
|
1739
1744
|
}
|
|
1740
|
-
),
|
|
1745
|
+
), Nt = K ? Wn.get(K) : void 0, Fn = q(
|
|
1741
1746
|
() => new Intl.NumberFormat(X, {
|
|
1742
1747
|
style: "percent",
|
|
1743
1748
|
maximumFractionDigits: 0
|
|
1744
1749
|
}),
|
|
1745
1750
|
[X]
|
|
1746
|
-
)
|
|
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;
|
|
1747
1760
|
if ($.status === "loading")
|
|
1748
|
-
return /* @__PURE__ */
|
|
1761
|
+
return /* @__PURE__ */ l(
|
|
1762
|
+
Ke,
|
|
1763
|
+
{
|
|
1764
|
+
layout: g,
|
|
1765
|
+
fill: U,
|
|
1766
|
+
odds: wn,
|
|
1767
|
+
banner: kt
|
|
1768
|
+
}
|
|
1769
|
+
);
|
|
1749
1770
|
if ($.status !== "ready" || !E)
|
|
1750
|
-
return /* @__PURE__ */
|
|
1751
|
-
|
|
1771
|
+
return /* @__PURE__ */ l(
|
|
1772
|
+
Je,
|
|
1752
1773
|
{
|
|
1753
|
-
layout:
|
|
1774
|
+
layout: g,
|
|
1754
1775
|
label: p,
|
|
1755
1776
|
kind: $.status === "notFound" ? "notFound" : "error",
|
|
1756
|
-
onRetry: $.retry
|
|
1777
|
+
onRetry: $.retry,
|
|
1778
|
+
banner: kt
|
|
1757
1779
|
}
|
|
1758
1780
|
);
|
|
1759
|
-
const lt =
|
|
1781
|
+
const lt = ge(it), ct = D ? he(it) : null, En = D && ct === null, J = S.findIndex(
|
|
1760
1782
|
(k) => k.optionId === $.votedOptionId
|
|
1761
|
-
),
|
|
1762
|
-
(k) =>
|
|
1763
|
-
),
|
|
1764
|
-
|
|
1765
|
-
},
|
|
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 () => {
|
|
1766
1788
|
st(!0), H !== null && (await $.vote(S[H].optionId), C(null));
|
|
1767
|
-
},
|
|
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;
|
|
1768
1790
|
return /* @__PURE__ */ b(
|
|
1769
1791
|
"div",
|
|
1770
1792
|
{
|
|
1771
|
-
css: y[
|
|
1772
|
-
style: { "--bof-trophy-on":
|
|
1793
|
+
css: y[g].root,
|
|
1794
|
+
style: { "--bof-trophy-on": Cn },
|
|
1773
1795
|
children: [
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1796
|
+
kt,
|
|
1797
|
+
/* @__PURE__ */ b("div", { css: y[g].body, children: [
|
|
1798
|
+
/* @__PURE__ */ l(
|
|
1799
|
+
je,
|
|
1777
1800
|
{
|
|
1778
|
-
layout:
|
|
1801
|
+
layout: g,
|
|
1779
1802
|
label: p,
|
|
1780
|
-
title: ((
|
|
1781
|
-
openSubtitle: ((
|
|
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"),
|
|
1782
1805
|
ended: D,
|
|
1783
|
-
draw:
|
|
1806
|
+
draw: En,
|
|
1784
1807
|
upcoming: v,
|
|
1785
|
-
left:
|
|
1808
|
+
left: Bn
|
|
1786
1809
|
}
|
|
1787
1810
|
),
|
|
1788
|
-
|
|
1789
|
-
|
|
1811
|
+
Ln && t.leads ? /* @__PURE__ */ l(
|
|
1812
|
+
qe,
|
|
1790
1813
|
{
|
|
1791
|
-
layout:
|
|
1814
|
+
layout: g,
|
|
1792
1815
|
sdk: n,
|
|
1793
1816
|
poll: E,
|
|
1794
1817
|
leads: t.leads,
|
|
@@ -1797,64 +1820,64 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1797
1820
|
picked: H,
|
|
1798
1821
|
language: e,
|
|
1799
1822
|
continueLabel: H !== null ? p("voteFor", { name: S[H].name }) : f("poll.buttons.continue"),
|
|
1800
|
-
onContinue:
|
|
1823
|
+
onContinue: Nn,
|
|
1801
1824
|
submitting: $.submitting
|
|
1802
1825
|
}
|
|
1803
|
-
) : /* @__PURE__ */ b(
|
|
1804
|
-
/* @__PURE__ */
|
|
1805
|
-
|
|
1826
|
+
) : /* @__PURE__ */ b(Pt, { children: [
|
|
1827
|
+
/* @__PURE__ */ l(
|
|
1828
|
+
_e,
|
|
1806
1829
|
{
|
|
1807
1830
|
view: {
|
|
1808
|
-
layout:
|
|
1831
|
+
layout: g,
|
|
1809
1832
|
fill: U,
|
|
1810
|
-
rows:
|
|
1833
|
+
rows: On,
|
|
1811
1834
|
sides: S,
|
|
1812
1835
|
colours: yt,
|
|
1813
|
-
percents:
|
|
1836
|
+
percents: It,
|
|
1814
1837
|
ended: D,
|
|
1815
1838
|
winner: ct,
|
|
1816
|
-
lit:
|
|
1817
|
-
widths:
|
|
1818
|
-
clips:
|
|
1839
|
+
lit: Pn,
|
|
1840
|
+
widths: Bt,
|
|
1841
|
+
clips: dn(Bt, F.slant, B),
|
|
1819
1842
|
slant: F.slant,
|
|
1820
|
-
evenClips:
|
|
1821
|
-
actions:
|
|
1822
|
-
showTrophy:
|
|
1843
|
+
evenClips: dn(Dt, F.slant, B),
|
|
1844
|
+
actions: Tn,
|
|
1845
|
+
showTrophy: a,
|
|
1823
1846
|
trophyPosition: u,
|
|
1824
1847
|
language: e,
|
|
1825
1848
|
label: p,
|
|
1826
|
-
splitLabel:
|
|
1849
|
+
splitLabel: zt,
|
|
1827
1850
|
signInCTA: t.signInCTA,
|
|
1828
|
-
onVote:
|
|
1851
|
+
onVote: Mn
|
|
1829
1852
|
}
|
|
1830
1853
|
}
|
|
1831
1854
|
),
|
|
1832
|
-
!U && /* @__PURE__ */
|
|
1833
|
-
|
|
1855
|
+
!U && /* @__PURE__ */ l(
|
|
1856
|
+
Ue,
|
|
1834
1857
|
{
|
|
1835
|
-
layout:
|
|
1858
|
+
layout: g,
|
|
1836
1859
|
label: p,
|
|
1837
1860
|
colours: yt,
|
|
1838
1861
|
shares: lt,
|
|
1839
|
-
percents:
|
|
1862
|
+
percents: It,
|
|
1840
1863
|
ended: D,
|
|
1841
|
-
splitLabel:
|
|
1864
|
+
splitLabel: zt
|
|
1842
1865
|
}
|
|
1843
1866
|
)
|
|
1844
1867
|
] })
|
|
1845
1868
|
] }),
|
|
1846
|
-
|
|
1847
|
-
|
|
1869
|
+
Nt ? /* @__PURE__ */ l(
|
|
1870
|
+
Zn,
|
|
1848
1871
|
{
|
|
1849
|
-
odds:
|
|
1872
|
+
odds: Nt,
|
|
1850
1873
|
market: (c == null ? void 0 : c.market) ?? "FT_1X2",
|
|
1851
|
-
size:
|
|
1874
|
+
size: g === "m" ? "dense" : "default",
|
|
1852
1875
|
mode: c == null ? void 0 : c.mode,
|
|
1853
1876
|
flashInterval: c == null ? void 0 : c.flashInterval
|
|
1854
1877
|
}
|
|
1855
|
-
) : xt &&
|
|
1856
|
-
/* @__PURE__ */
|
|
1857
|
-
|
|
1878
|
+
) : xt && Rn && /* @__PURE__ */ l("div", { css: y[g].oddsSlot, children: /* @__PURE__ */ l(gn, { size: g === "m" ? "dense" : "default" }) }),
|
|
1879
|
+
/* @__PURE__ */ l(
|
|
1880
|
+
_n,
|
|
1858
1881
|
{
|
|
1859
1882
|
notification: {
|
|
1860
1883
|
open: !!$.voteError,
|
|
@@ -1868,20 +1891,20 @@ const s = (t, n = 16) => `${Math.round(t / n * 1e4) / 1e4}em`, i = {
|
|
|
1868
1891
|
]
|
|
1869
1892
|
}
|
|
1870
1893
|
);
|
|
1871
|
-
},
|
|
1894
|
+
}, Ze = (t) => {
|
|
1872
1895
|
var n;
|
|
1873
|
-
return /* @__PURE__ */
|
|
1874
|
-
|
|
1896
|
+
return /* @__PURE__ */ l(
|
|
1897
|
+
Hn,
|
|
1875
1898
|
{
|
|
1876
1899
|
packageName: "battle-of-fans",
|
|
1877
1900
|
language: t.language,
|
|
1878
1901
|
themeOptions: t.themeOptions,
|
|
1879
1902
|
disableCache: t.disableCache,
|
|
1880
1903
|
leadPhoneCountryCode: (n = t.leads) == null ? void 0 : n.phoneCountryCode,
|
|
1881
|
-
children: /* @__PURE__ */
|
|
1904
|
+
children: /* @__PURE__ */ l(Qe, { ...t })
|
|
1882
1905
|
}
|
|
1883
1906
|
);
|
|
1884
|
-
},
|
|
1907
|
+
}, uo = oe(Ze);
|
|
1885
1908
|
export {
|
|
1886
|
-
|
|
1909
|
+
uo as BattleOfFans
|
|
1887
1910
|
};
|