fansunited-frontend-components 0.0.98 → 0.0.99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/Betslip.js +2 -2
  2. package/ChanceGame.js +958 -1464
  3. package/ClassicQuizPlay.js +2 -2
  4. package/CollectLead.js +1 -1
  5. package/CompetitionStatistics.js +2042 -2215
  6. package/CompetitorCard.js +4225 -5079
  7. package/Discussion.js +2 -2
  8. package/EitherOrPlay.js +2 -2
  9. package/EventCard.js +6010 -7547
  10. package/EventGamePlay.js +2 -2
  11. package/Leaderboard.js +546 -849
  12. package/List.js +227 -218
  13. package/MatchQuizPlay.js +2 -2
  14. package/Odds.js +50 -42
  15. package/PersonalityQuizPlay.js +2 -2
  16. package/PickThePair.js +2 -2
  17. package/PlayerOfTheMatch.js +285 -269
  18. package/PollVote.js +2 -2
  19. package/Predictor.js +80 -127
  20. package/README.md +1 -1
  21. package/Standings.js +991 -1324
  22. package/TopX.js +1120 -1167
  23. package/chunks/{ChanceGameEmbedVariant-CVys-3Zh.js → ChanceGameEmbedVariant-DM9eLG5s.js} +2 -2
  24. package/chunks/CheckCircle-I1FktW5Y.js +13 -0
  25. package/chunks/OddsSkeleton-DP5Yfqpr.js +522 -0
  26. package/chunks/Person-CXRqyF4E.js +11 -0
  27. package/chunks/PickOneOfX-DET4ZhjV.js +3117 -0
  28. package/chunks/Search-CIXthh0D.js +17 -0
  29. package/chunks/TimerOutlined-D-WA_vpE.js +8 -0
  30. package/chunks/WorkspacePremiumOutlined-DUXVgJlF.js +136 -0
  31. package/chunks/{chevrons-right-CXSpQt9w.js → chevrons-right-HWKW2c4I.js} +24 -4
  32. package/chunks/index-BENM3N_w.js +4 -0
  33. package/chunks/index-BRxAV693.js +4 -0
  34. package/chunks/index-BXYTsvIX.js +4 -0
  35. package/chunks/index-C0ilols1.js +4 -0
  36. package/chunks/index-D7VhczXH.js +4 -0
  37. package/chunks/index-DKwvdw9t.js +4 -0
  38. package/chunks/index-DZN-AITW.js +4 -0
  39. package/chunks/main-B2sDRFF4.js +2184 -0
  40. package/chunks/main-CzfWaEQP.js +4869 -0
  41. package/chunks/main-DFNl3g_U.js +4910 -0
  42. package/chunks/{main-65WcUqAl.js → main-DLwnvntz.js} +600 -593
  43. package/chunks/main-DiBlJBNb.js +1956 -0
  44. package/chunks/main-DxvBjXsd.js +1775 -0
  45. package/chunks/main-S8_NDSiY.js +3209 -0
  46. package/chunks/main-lBgr8Liq.js +6571 -0
  47. package/chunks/{withVersionStamp-T8seRk9h.js → withVersionStamp-BsLyhvNA.js} +1 -1
  48. package/package.json +2 -2
  49. package/chunks/OddsSkeleton-ClJE2xhR.js +0 -26
  50. package/chunks/OddsStrip-BnSp5TXa.js +0 -383
  51. package/chunks/PickOneOfX-DaJtkbCw.js +0 -4206
  52. package/chunks/chevron-left-CxfCSZcr.js +0 -13
  53. package/chunks/chevron-right-BEQMacFn.js +0 -13
  54. package/chunks/index-Aq5MbUB9.js +0 -4
  55. package/chunks/index-BBQm_8LD.js +0 -4
  56. package/chunks/index-BC_sWWgc.js +0 -4
  57. package/chunks/index-DXKDJ1Vp.js +0 -4
  58. package/chunks/index-DjT5NrbA.js +0 -4
  59. package/chunks/index-DvLRehH6.js +0 -4
  60. package/chunks/index-aIMaxR-p.js +0 -4
  61. package/chunks/main-52Wff7qC.js +0 -11441
  62. package/chunks/main-B58mi9jx.js +0 -5622
  63. package/chunks/main-BIdXUTZS.js +0 -7308
  64. package/chunks/main-DD-NEzC7.js +0 -8241
  65. package/chunks/main-DUnfJPzY.js +0 -3608
  66. package/chunks/main-DpCBqqg_.js +0 -1950
  67. package/chunks/main-Drznt1ak.js +0 -1790
  68. package/chunks/users-wbJRbqW8.js +0 -16
  69. package/chunks/x-CK4GYo7T.js +0 -14
@@ -1,2583 +1,2410 @@
1
- import { jsx as r, jsxs as y, Fragment as ye } from "react/jsx-runtime";
2
- import L, { useState as ee, useEffect as pe, useMemo as le } from "react";
3
- import { Box as m, GlobalStyles as tt } from "@mui/joy";
4
- import { fetchSearchEntitiesByIds as ot, useDisableCache as nt, useColors as rt, useFontFamily as st, useCornerRadius as it, useCurrentThemeMode as at, hexToRgb as lt, toIntlLocale as dt, isMobile as xe, isExtraSmall as ct, Spinner as ut, getLanguageDirection as pt, initializeI18n as mt, applyDirectionToMount as ht, widgetCacheKey as gt, createWidgetCache as ft, ContainerProvider as yt, ThemeProvider as xt, ConstantsProvider as bt } from "fansunited-frontend-core";
5
- import { useTranslation as wt } from "react-i18next";
6
- import { O as Ct, a as St } from "./chunks/OddsStrip-BnSp5TXa.js";
1
+ import { jsx as n, jsxs as g, Fragment as fe } from "@emotion/react/jsx-runtime";
2
+ import { Spinner as Et, WidgetPortal as Mt } from "fansunited-frontend-core/ui/emotion";
3
+ import P, { useState as de, useEffect as Ee, useMemo as Ie } from "react";
4
+ import { css as d, keyframes as zt } from "@emotion/react";
5
+ import { fetchSearchEntitiesByIds as Lt, useDisableCache as Dt, useColors as At, useCurrentThemeMode as Pt, hexToRgb as Ft, toIntlLocale as Wt, useIsRtl as Ot, DirectionalIcon as Xe, isMobile as _e, isDesktop as Bt, isExtraSmall as Nt } from "fansunited-frontend-core";
6
+ import { useTranslation as Gt } from "react-i18next";
7
+ import { ChevronLeft as Ht, ChevronRight as jt, Tv as Ut } from "fansunited-frontend-core/ui/icons/lucide";
8
+ import { O as Vt, u as Kt } from "./chunks/OddsSkeleton-DP5Yfqpr.js";
7
9
  import "fansunited-sdk-esm/enums";
8
- import { c as vt } from "./chunks/createLucideIcon-YBRjY5Kl.js";
9
- import { CacheProvider as It } from "@emotion/react";
10
- import { createPortal as $t } from "react-dom";
11
- import { w as Tt } from "./chunks/withVersionStamp-T8seRk9h.js";
12
- /**
13
- * @license lucide-react v0.454.0 - ISC
14
- *
15
- * This source code is licensed under the ISC license.
16
- * See the LICENSE file in the root directory of this source tree.
17
- */
18
- const kt = vt("Tv", [
19
- ["rect", { width: "20", height: "15", x: "2", y: "7", rx: "2", ry: "2", key: "10ag99" }],
20
- ["polyline", { points: "17 2 12 7 7 2", key: "11pgbg" }]
21
- ]), Oe = "https://sports.fansunitedapi.com/v1", Fe = (e) => {
10
+ import { w as Xt } from "./chunks/withVersionStamp-BsLyhvNA.js";
11
+ const wt = "https://sports.fansunitedapi.com/v1", vt = (e) => {
22
12
  try {
23
13
  const t = e.helpers.getSDKConfiguration();
24
14
  return !(t != null && t.apiKey) || !(t != null && t.clientId) ? null : { apiKey: t.apiKey, clientId: t.clientId };
25
15
  } catch {
26
16
  return null;
27
17
  }
28
- }, Ne = (e) => {
29
- const t = Fe(e);
18
+ }, Ct = (e) => {
19
+ const t = vt(e);
30
20
  return t ? new URLSearchParams({ key: t.apiKey, client_id: t.clientId }) : null;
31
- }, _t = async (e, t, o, s, i = !1) => {
32
- const a = Ne(e);
33
- if (!a || !t) return null;
34
- o && a.set("season_id", o), i && a.set("disable_cache", String(Date.now()));
35
- const c = await fetch(
36
- `${Oe}/competitions/${encodeURIComponent(t)}?${a.toString()}`,
37
- { signal: s }
21
+ }, Yt = async (e, t, r, l, c = !1) => {
22
+ const s = Ct(e);
23
+ if (!s || !t) return null;
24
+ r && s.set("season_id", r), c && s.set("disable_cache", String(Date.now()));
25
+ const m = await fetch(
26
+ `${wt}/competitions/${encodeURIComponent(t)}?${s.toString()}`,
27
+ { signal: l }
38
28
  );
39
- if (!c.ok) throw new Error(`Sports API responded ${c.status}`);
40
- const l = await c.json(), d = (l == null ? void 0 : l.data) ?? l;
41
- return d != null && d.id ? d : null;
42
- }, Rt = async (e, t, o, s = !1) => {
43
- var a;
44
- const i = Ne(e);
45
- if (!i) return null;
46
- s && i.set("disable_cache", String(Date.now()));
29
+ if (!m.ok) throw new Error(`Sports API responded ${m.status}`);
30
+ const u = await m.json(), a = (u == null ? void 0 : u.data) ?? u;
31
+ return a != null && a.id ? a : null;
32
+ }, qt = async (e, t, r, l = !1) => {
33
+ var s;
34
+ const c = Ct(e);
35
+ if (!c) return null;
36
+ l && c.set("disable_cache", String(Date.now()));
47
37
  try {
48
- const c = await fetch(
49
- `${Oe}/events/${encodeURIComponent(t)}?${i.toString()}`,
50
- { signal: o }
38
+ const m = await fetch(
39
+ `${wt}/events/${encodeURIComponent(t)}?${c.toString()}`,
40
+ { signal: r }
51
41
  );
52
- if (!c.ok) return null;
53
- const l = await c.json(), d = (a = (l == null ? void 0 : l.data) ?? l) == null ? void 0 : a.event;
54
- return d != null && d.id ? d : null;
42
+ if (!m.ok) return null;
43
+ const u = await m.json(), a = (s = (u == null ? void 0 : u.data) ?? u) == null ? void 0 : s.event;
44
+ return a != null && a.id ? a : null;
55
45
  } catch {
56
46
  return null;
57
47
  }
58
- }, Et = async (e, t, o, s = !1) => {
59
- const i = /* @__PURE__ */ new Map(), a = Fe(e);
60
- return !a || t.length === 0 || (await ot(a, t, {
61
- signal: o,
48
+ }, Jt = async (e, t, r, l = !1) => {
49
+ const c = /* @__PURE__ */ new Map(), s = vt(e);
50
+ return !s || t.length === 0 || (await Lt(s, t, {
51
+ signal: r,
62
52
  partial: !0,
63
- disableCache: s
64
- })).forEach((l) => i.set(l.id, l)), i;
65
- }, Mt = ["1_15", "16_30", "31_45", "46_60", "61_75", "76_90"], be = (e) => {
53
+ disableCache: l
54
+ })).forEach((u) => c.set(u.id, u)), c;
55
+ }, Qt = ["1_15", "16_30", "31_45", "46_60", "61_75", "76_90"], Fe = (e) => {
66
56
  const t = /* @__PURE__ */ new Map();
67
- return (e ?? []).forEach((o) => {
68
- o.key && o.value != null && t.set(o.key.toLowerCase(), o.value);
57
+ return (e ?? []).forEach((r) => {
58
+ r.key && r.value != null && t.set(r.key.toLowerCase(), r.value);
69
59
  }), t;
70
- }, Q = (e, t) => {
71
- const o = e.get(t);
72
- if (o == null || o === "") return null;
73
- const s = Number(o);
74
- return Number.isFinite(s) ? s : null;
75
- }, N = (e, t) => Q(e, t) ?? 0, zt = [
60
+ }, ae = (e, t) => {
61
+ const r = e.get(t);
62
+ if (r == null || r === "") return null;
63
+ const l = Number(r);
64
+ return Number.isFinite(l) ? l : null;
65
+ }, j = (e, t) => ae(e, t) ?? 0, Zt = [
76
66
  [/POSTPON/, "postponed"],
77
67
  [/CANCEL/, "cancelled"],
78
68
  [/INTERRUPT|SUSPEND/, "interrupted"],
79
69
  [/ABANDON/, "abandoned"]
80
- ], Be = (e) => {
81
- var o;
70
+ ], xt = (e) => {
71
+ var r;
82
72
  const t = `${(e == null ? void 0 : e.type) ?? ""} ${(e == null ? void 0 : e.code) ?? ""} ${(e == null ? void 0 : e.sub_type) ?? ""}`.toUpperCase();
83
- return ((o = zt.find(([s]) => s.test(t))) == null ? void 0 : o[1]) ?? null;
84
- }, Ge = (e) => {
85
- if (Be(e)) return "CANCELLED";
73
+ return ((r = Zt.find(([l]) => l.test(t))) == null ? void 0 : r[1]) ?? null;
74
+ }, St = (e) => {
75
+ if (xt(e)) return "CANCELLED";
86
76
  const t = `${(e == null ? void 0 : e.type) ?? ""} ${(e == null ? void 0 : e.code) ?? ""}`.toUpperCase();
87
77
  return /(FINISH|ENDED|CLOSED|AFTER_)/.test(t) ? "FINISHED" : /(LIVE|PROGRESS|INPLAY|IN_PLAY|HALF|PERIOD)/.test(t) ? "LIVE" : "UPCOMING";
88
- }, At = {
78
+ }, eo = {
89
79
  "1st_half": 0,
90
80
  "2nd_half": 45,
91
81
  extra_time: 90,
92
82
  extra_time_1: 90,
93
83
  extra_time_2: 105
94
- }, Lt = (e) => {
95
- var i, a;
96
- const t = (((i = e.status) == null ? void 0 : i.sub_type) ?? "").toLowerCase(), o = At[t], s = ((a = e.timing) == null ? void 0 : a.current_minute) ?? 0;
97
- return o === void 0 || s <= 0 ? null : o + s;
98
- }, me = (e, t) => {
99
- const o = (e.score ?? []).find((a) => a.key === t);
100
- if (!o || o.competitor_one == null || o.competitor_two == null)
84
+ }, to = (e) => {
85
+ var c, s;
86
+ const t = (((c = e.status) == null ? void 0 : c.sub_type) ?? "").toLowerCase(), r = eo[t], l = ((s = e.timing) == null ? void 0 : s.current_minute) ?? 0;
87
+ return r === void 0 || l <= 0 ? null : r + l;
88
+ }, Me = (e, t) => {
89
+ const r = (e.score ?? []).find((s) => s.key === t);
90
+ if (!r || r.competitor_one == null || r.competitor_two == null)
101
91
  return null;
102
- const s = Number(o.competitor_one), i = Number(o.competitor_two);
103
- return Number.isFinite(s) && Number.isFinite(i) ? [s, i] : null;
104
- }, Ee = (e) => {
105
- const t = be(e == null ? void 0 : e.stats);
92
+ const l = Number(r.competitor_one), c = Number(r.competitor_two);
93
+ return Number.isFinite(l) && Number.isFinite(c) ? [l, c] : null;
94
+ }, Ye = (e) => {
95
+ const t = Fe(e == null ? void 0 : e.stats);
106
96
  return {
107
97
  id: (e == null ? void 0 : e.id) ?? "",
108
- yellowCards: Q(t, "yellow_cards"),
109
- redCards: Q(t, "red_cards"),
110
- shotsOnTarget: Q(t, "shots_on_target"),
111
- possession: Q(t, "ball_possession_percentage"),
112
- corners: Q(t, "corners"),
113
- goalsByPeriod: Mt.map((o) => N(t, `goals_${o}`))
98
+ yellowCards: ae(t, "yellow_cards"),
99
+ redCards: ae(t, "red_cards"),
100
+ shotsOnTarget: ae(t, "shots_on_target"),
101
+ possession: ae(t, "ball_possession_percentage"),
102
+ corners: ae(t, "corners"),
103
+ goalsByPeriod: Qt.map((r) => j(t, `goals_${r}`))
114
104
  };
115
- }, Pt = 3 * 24 * 60 * 60 * 1e3, Dt = (e, t) => {
116
- const o = t.filter((a) => !!a.id).map((a) => {
117
- const c = /* @__PURE__ */ new Set();
118
- (a.groups ?? []).forEach(
119
- (u) => (u.standings ?? []).forEach((h) => h.competitor_id && c.add(h.competitor_id))
105
+ }, oo = 3 * 24 * 60 * 60 * 1e3, ro = (e, t) => {
106
+ const r = t.filter((s) => !!s.id).map((s) => {
107
+ const m = /* @__PURE__ */ new Set();
108
+ (s.groups ?? []).forEach(
109
+ (h) => (h.standings ?? []).forEach((b) => b.competitor_id && m.add(b.competitor_id))
120
110
  );
121
- const l = Date.parse(a.start_date ?? ""), d = Date.parse(a.end_date ?? "") + 24 * 60 * 60 * 1e3;
122
- return { id: a.id, teams: c, from: l, to: d };
123
- }), s = (a, c) => !Number.isFinite(a.from) || !Number.isFinite(a.to) ? 1 / 0 : c < a.from ? a.from - c : c > a.to ? c - a.to : 0, i = /* @__PURE__ */ new Map();
124
- return e.forEach((a) => {
125
- var b, g, $, S, W;
126
- if ((b = a.round) != null && b.stage_id) {
127
- i.set(a, a.round.stage_id);
111
+ const u = Date.parse(s.start_date ?? ""), a = Date.parse(s.end_date ?? "") + 24 * 60 * 60 * 1e3;
112
+ return { id: s.id, teams: m, from: u, to: a };
113
+ }), l = (s, m) => !Number.isFinite(s.from) || !Number.isFinite(s.to) ? 1 / 0 : m < s.from ? s.from - m : m > s.to ? m - s.to : 0, c = /* @__PURE__ */ new Map();
114
+ return e.forEach((s) => {
115
+ var w, y, _, D, E;
116
+ if ((w = s.round) != null && w.stage_id) {
117
+ c.set(s, s.round.stage_id);
128
118
  return;
129
119
  }
130
- if (o.length <= 1) {
131
- i.set(a, ((g = o[0]) == null ? void 0 : g.id) ?? null);
120
+ if (r.length <= 1) {
121
+ c.set(s, ((y = r[0]) == null ? void 0 : y.id) ?? null);
132
122
  return;
133
123
  }
134
- const c = Date.parse((($ = a.timing) == null ? void 0 : $.start_time) ?? ""), l = ((S = a.competitor_one) == null ? void 0 : S.id) ?? "", d = ((W = a.competitor_two) == null ? void 0 : W.id) ?? "", u = (k) => s(k, c) <= Pt, h = o.filter((k) => k.teams.has(l) && k.teams.has(d) && u(k)).sort((k, M) => k.teams.size - M.teams.size)[0];
135
- if (h) {
136
- i.set(a, h.id);
124
+ const m = Date.parse(((_ = s.timing) == null ? void 0 : _.start_time) ?? ""), u = ((D = s.competitor_one) == null ? void 0 : D.id) ?? "", a = ((E = s.competitor_two) == null ? void 0 : E.id) ?? "", h = (x) => l(x, m) <= oo, b = r.filter((x) => x.teams.has(u) && x.teams.has(a) && h(x)).sort((x, R) => x.teams.size - R.teams.size)[0];
125
+ if (b) {
126
+ c.set(s, b.id);
137
127
  return;
138
128
  }
139
- const f = (k) => [...k].sort((M, O) => s(M, c) - s(O, c))[0], C = f(o.filter((k) => k.teams.size === 0 || u(k))) ?? f(o);
140
- i.set(a, (C == null ? void 0 : C.id) ?? null);
141
- }), i;
142
- }, Wt = (e, t, o) => {
143
- var a, c;
144
- const s = Ge(e.status), i = s === "FINISHED" || s === "LIVE";
129
+ const f = (x) => [...x].sort((R, $) => l(R, m) - l($, m))[0], S = f(r.filter((x) => x.teams.size === 0 || h(x))) ?? f(r);
130
+ c.set(s, (S == null ? void 0 : S.id) ?? null);
131
+ }), c;
132
+ }, so = (e, t, r) => {
133
+ var s, m;
134
+ const l = St(e.status), c = l === "FINISHED" || l === "LIVE";
145
135
  return {
146
136
  id: e.id ?? "",
147
- status: s,
148
- start: ((a = e.timing) == null ? void 0 : a.start_time) ?? "",
149
- stageId: o,
137
+ status: l,
138
+ start: ((s = e.timing) == null ? void 0 : s.start_time) ?? "",
139
+ stageId: r,
150
140
  round: t,
151
- home: Ee(e.competitor_one),
152
- away: Ee(e.competitor_two),
153
- fullTime: i ? me(e, "result") ?? me(e, "full_time") ?? [0, 0] : null,
154
- halfTime: i ? me(e, "half_time") : null,
155
- liveMinute: s === "LIVE" ? Lt(e) : null,
156
- notPlayedReason: Be(e.status),
157
- isHalfTime: s === "LIVE" && (((c = e.status) == null ? void 0 : c.sub_type) ?? "").toLowerCase() === "halftime"
141
+ home: Ye(e.competitor_one),
142
+ away: Ye(e.competitor_two),
143
+ fullTime: c ? Me(e, "result") ?? Me(e, "full_time") ?? [0, 0] : null,
144
+ halfTime: c ? Me(e, "half_time") : null,
145
+ liveMinute: l === "LIVE" ? to(e) : null,
146
+ notPlayedReason: xt(e.status),
147
+ isHalfTime: l === "LIVE" && (((m = e.status) == null ? void 0 : m.sub_type) ?? "").toLowerCase() === "halftime"
158
148
  };
159
- }, Ot = (e) => {
149
+ }, no = (e) => {
160
150
  const t = /* @__PURE__ */ new Map();
161
- e.forEach((s) => {
162
- var l, d;
163
- const i = ((l = s.round) == null ? void 0 : l.id) ?? "", a = ((d = s.timing) == null ? void 0 : d.start_time) ?? "", c = t.get(i);
164
- (c === void 0 || a < c) && t.set(i, a);
151
+ e.forEach((l) => {
152
+ var u, a;
153
+ const c = ((u = l.round) == null ? void 0 : u.id) ?? "", s = ((a = l.timing) == null ? void 0 : a.start_time) ?? "", m = t.get(c);
154
+ (m === void 0 || s < m) && t.set(c, s);
165
155
  });
166
- const o = new Map(
167
- Array.from(t.entries()).sort((s, i) => s[1].localeCompare(i[1])).map(([s], i) => [s, i + 1])
156
+ const r = new Map(
157
+ Array.from(t.entries()).sort((l, c) => l[1].localeCompare(c[1])).map(([l], c) => [l, c + 1])
168
158
  );
169
159
  return new Map(
170
- e.map((s) => {
171
- var i, a;
160
+ e.map((l) => {
161
+ var c, s;
172
162
  return [
173
- s,
174
- ((i = s.round) == null ? void 0 : i.matchday) ?? o.get(((a = s.round) == null ? void 0 : a.id) ?? "") ?? 1
163
+ l,
164
+ ((c = l.round) == null ? void 0 : c.matchday) ?? r.get(((s = l.round) == null ? void 0 : s.id) ?? "") ?? 1
175
165
  ];
176
166
  })
177
167
  );
178
- }, Me = (e) => {
179
- const t = be(e.statistics);
168
+ }, qe = (e) => {
169
+ const t = Fe(e.statistics);
180
170
  return {
181
171
  teamId: e.team_id ?? "",
182
- matchesPlayed: N(t, "matches_played"),
183
- won: N(t, "won"),
184
- draw: N(t, "draw"),
185
- lost: N(t, "lost"),
186
- homeWon: N(t, "home_won"),
187
- awayWon: N(t, "away_won"),
188
- goalsScored: N(t, "goals_scored"),
189
- goalsAllowed: N(t, "goals_allowed"),
190
- avgTotalGoals: Q(t, "avg_total_goals")
172
+ matchesPlayed: j(t, "matches_played"),
173
+ won: j(t, "won"),
174
+ draw: j(t, "draw"),
175
+ lost: j(t, "lost"),
176
+ homeWon: j(t, "home_won"),
177
+ awayWon: j(t, "away_won"),
178
+ goalsScored: j(t, "goals_scored"),
179
+ goalsAllowed: j(t, "goals_allowed"),
180
+ avgTotalGoals: ae(t, "avg_total_goals")
191
181
  };
192
- }, Ft = (e) => {
193
- const t = be(e.statistics);
182
+ }, io = (e) => {
183
+ const t = Fe(e.statistics);
194
184
  return {
195
185
  athleteId: e.athlete_id ?? "",
196
186
  teamId: e.team_id ?? "",
197
- goals: N(t, "goals"),
198
- assists: N(t, "assists"),
199
- minutes: N(t, "minutes"),
200
- appearances: N(t, "appearances"),
201
- yellowCards: N(t, "yellow_cards"),
202
- redCards: N(t, "red_cards"),
203
- cleanSheets: N(t, "clean_sheets")
187
+ goals: j(t, "goals"),
188
+ assists: j(t, "assists"),
189
+ minutes: j(t, "minutes"),
190
+ appearances: j(t, "appearances"),
191
+ yellowCards: j(t, "yellow_cards"),
192
+ redCards: j(t, "red_cards"),
193
+ cleanSheets: j(t, "clean_sheets")
204
194
  };
205
- }, Nt = (e, t, o) => {
206
- const s = e.season, i = ((s == null ? void 0 : s.events) ?? []).filter((g) => !!g.id).map((g) => {
207
- const $ = o.get(g.id);
208
- if (!$) return g;
209
- const S = (W, k) => W && typeof W == "object" ? W : k;
195
+ }, ao = (e, t, r) => {
196
+ const l = e.season, c = ((l == null ? void 0 : l.events) ?? []).filter((y) => !!y.id).map((y) => {
197
+ const _ = r.get(y.id);
198
+ if (!_) return y;
199
+ const D = (E, x) => E && typeof E == "object" ? E : x;
210
200
  return {
211
- ...g,
212
- ...$,
213
- round: g.round ?? $.round,
214
- competitor_one: S($.competitor_one, g.competitor_one),
215
- competitor_two: S($.competitor_two, g.competitor_two)
201
+ ...y,
202
+ ..._,
203
+ round: y.round ?? _.round,
204
+ competitor_one: D(_.competitor_one, y.competitor_one),
205
+ competitor_two: D(_.competitor_two, y.competitor_two)
216
206
  };
217
- }), a = (s == null ? void 0 : s.stages) ?? [], c = Dt(i, a), l = t ? i.filter((g) => c.get(g) === t) : i, d = Ot(l), u = new Set(l.map((g) => c.get(g))), h = a.filter((g) => !!g.id && u.has(g.id)).map((g) => ({
218
- id: g.id,
219
- nameId: g.stage_name_id || null,
220
- order: g.order ?? 0
221
- })).sort((g, $) => g.order - $.order), f = /* @__PURE__ */ new Map(), C = (s == null ? void 0 : s.team_stats) ?? [], b = t || null;
222
- return C.filter((g) => (g.stage_id ?? null) === b).forEach((g) => g.team_id && f.set(g.team_id, Me(g))), t && f.size === 0 && C.filter((g) => g.stage_id == null).forEach((g) => g.team_id && f.set(g.team_id, Me(g))), {
207
+ }), s = (l == null ? void 0 : l.stages) ?? [], m = ro(c, s), u = t ? c.filter((y) => m.get(y) === t) : c, a = no(u), h = new Set(u.map((y) => m.get(y))), b = s.filter((y) => !!y.id && h.has(y.id)).map((y) => ({
208
+ id: y.id,
209
+ nameId: y.stage_name_id || null,
210
+ order: y.order ?? 0
211
+ })).sort((y, _) => y.order - _.order), f = /* @__PURE__ */ new Map(), S = (l == null ? void 0 : l.team_stats) ?? [], w = t || null;
212
+ return S.filter((y) => (y.stage_id ?? null) === w).forEach((y) => y.team_id && f.set(y.team_id, qe(y))), t && f.size === 0 && S.filter((y) => y.stage_id == null).forEach((y) => y.team_id && f.set(y.team_id, qe(y))), {
223
213
  id: e.id ?? "",
224
214
  sport: e.sport ?? null,
225
215
  season: {
226
- id: (s == null ? void 0 : s.id) ?? null,
227
- name: (s == null ? void 0 : s.name) ?? null,
228
- startDate: (s == null ? void 0 : s.start_date) ?? null,
229
- endDate: (s == null ? void 0 : s.end_date) ?? null
216
+ id: (l == null ? void 0 : l.id) ?? null,
217
+ name: (l == null ? void 0 : l.name) ?? null,
218
+ startDate: (l == null ? void 0 : l.start_date) ?? null,
219
+ endDate: (l == null ? void 0 : l.end_date) ?? null
230
220
  },
231
- matches: l.map((g) => Wt(g, d.get(g) ?? 1, c.get(g) ?? null)),
232
- stages: h,
221
+ matches: u.map((y) => so(y, a.get(y) ?? 1, m.get(y) ?? null)),
222
+ stages: b,
233
223
  teamStats: f,
234
- athletes: ((s == null ? void 0 : s.athlete_stats) ?? []).filter((g) => !!g.athlete_id && (g.statistics ?? []).length > 0).map(Ft)
224
+ athletes: ((l == null ? void 0 : l.athlete_stats) ?? []).filter((y) => !!y.athlete_id && (y.statistics ?? []).length > 0).map(io)
235
225
  };
236
- }, Bt = (e) => (e ?? "").split("-")[0].toUpperCase(), Gt = (e, t, o) => {
237
- const s = Bt(t), i = (a, c) => {
238
- var l, d, u;
239
- return ((u = (d = (l = e.get(a)) == null ? void 0 : l.assets) == null ? void 0 : d.find((h) => h.key === c)) == null ? void 0 : u.value) ?? null;
226
+ }, lo = (e) => (e ?? "").split("-")[0].toUpperCase(), co = (e, t, r) => {
227
+ const l = lo(t), c = (s, m) => {
228
+ var u, a, h;
229
+ return ((h = (a = (u = e.get(s)) == null ? void 0 : u.assets) == null ? void 0 : a.find((b) => b.key === m)) == null ? void 0 : h.value) ?? null;
240
230
  };
241
231
  return {
242
- has: (a) => e.has(a),
243
- name: (a) => {
244
- var d, u;
245
- const c = e.get(a);
246
- return c && (((u = (d = c.translations) == null ? void 0 : d.find(
247
- (h) => {
232
+ has: (s) => e.has(s),
233
+ name: (s) => {
234
+ var a, h;
235
+ const m = e.get(s);
236
+ return m && (((h = (a = m.translations) == null ? void 0 : a.find(
237
+ (b) => {
248
238
  var f;
249
- return ((f = h.language) == null ? void 0 : f.toUpperCase()) === s;
239
+ return ((f = b.language) == null ? void 0 : f.toUpperCase()) === l;
250
240
  }
251
- )) == null ? void 0 : u.name) || c.name) || o;
241
+ )) == null ? void 0 : h.name) || m.name) || r;
252
242
  },
253
- logo: (a) => i(a, "LOGO"),
254
- photo: (a) => i(a, "HEADSHOT"),
255
- position: (a) => {
256
- var c;
257
- return ((c = e.get(a)) == null ? void 0 : c.position) ?? null;
243
+ logo: (s) => c(s, "LOGO"),
244
+ photo: (s) => c(s, "HEADSHOT"),
245
+ position: (s) => {
246
+ var m;
247
+ return ((m = e.get(s)) == null ? void 0 : m.position) ?? null;
258
248
  }
259
249
  };
260
- }, jt = 4 * 60 * 60 * 1e3, Ht = (e) => {
261
- var o, s, i, a, c, l, d, u, h;
262
- const t = new Set(((o = e.meta) == null ? void 0 : o.entity_ids) ?? []);
263
- return e.id && t.add(e.id), (i = (s = e.season) == null ? void 0 : s.stages) == null || i.forEach((f) => f.stage_name_id && t.add(f.stage_name_id)), (c = (a = e.season) == null ? void 0 : a.events) == null || c.forEach((f) => {
264
- var C, b;
265
- (C = f.competitor_one) != null && C.id && t.add(f.competitor_one.id), (b = f.competitor_two) != null && b.id && t.add(f.competitor_two.id);
266
- }), (d = (l = e.season) == null ? void 0 : l.team_stats) == null || d.forEach((f) => f.team_id && t.add(f.team_id)), (h = (u = e.season) == null ? void 0 : u.athlete_stats) == null || h.forEach((f) => {
250
+ }, uo = 4 * 60 * 60 * 1e3, po = (e) => {
251
+ var r, l, c, s, m, u, a, h, b;
252
+ const t = new Set(((r = e.meta) == null ? void 0 : r.entity_ids) ?? []);
253
+ return e.id && t.add(e.id), (c = (l = e.season) == null ? void 0 : l.stages) == null || c.forEach((f) => f.stage_name_id && t.add(f.stage_name_id)), (m = (s = e.season) == null ? void 0 : s.events) == null || m.forEach((f) => {
254
+ var S, w;
255
+ (S = f.competitor_one) != null && S.id && t.add(f.competitor_one.id), (w = f.competitor_two) != null && w.id && t.add(f.competitor_two.id);
256
+ }), (a = (u = e.season) == null ? void 0 : u.team_stats) == null || a.forEach((f) => f.team_id && t.add(f.team_id)), (b = (h = e.season) == null ? void 0 : h.athlete_stats) == null || b.forEach((f) => {
267
257
  f.athlete_id && t.add(f.athlete_id), f.team_id && t.add(f.team_id);
268
258
  }), Array.from(t);
269
- }, Ut = (e, t) => {
270
- var i;
271
- const o = Ge(e.status);
272
- if (o === "LIVE") return !0;
273
- if (o !== "UPCOMING") return !1;
274
- const s = Date.parse(((i = e.timing) == null ? void 0 : i.start_time) ?? "");
275
- return Number.isFinite(s) && s <= t && t - s < jt;
276
- }, Kt = (e, t, o, s, i) => {
277
- const { seasonId: a, stageId: c, liveRefresh: l, refreshInterval: d } = i, [u, h] = ee(null), [f, C] = ee(
259
+ }, mo = (e, t) => {
260
+ var c;
261
+ const r = St(e.status);
262
+ if (r === "LIVE") return !0;
263
+ if (r !== "UPCOMING") return !1;
264
+ const l = Date.parse(((c = e.timing) == null ? void 0 : c.start_time) ?? "");
265
+ return Number.isFinite(l) && l <= t && t - l < uo;
266
+ }, ho = (e, t, r, l, c) => {
267
+ const { seasonId: s, stageId: m, liveRefresh: u, refreshInterval: a } = c, [h, b] = de(null), [f, S] = de(
278
268
  () => /* @__PURE__ */ new Map()
279
- ), [b, g] = ee(
269
+ ), [w, y] = de(
280
270
  () => /* @__PURE__ */ new Map()
281
- ), [$, S] = ee(!0), [W, k] = ee(!1), M = nt();
282
- pe(() => {
271
+ ), [_, D] = de(!0), [E, x] = de(!1), R = Dt();
272
+ Ee(() => {
283
273
  if (!e || !t) {
284
- S(!1);
274
+ D(!1);
285
275
  return;
286
276
  }
287
- const z = new AbortController();
288
- return S(!0), k(!1), g(/* @__PURE__ */ new Map()), (async () => {
277
+ const A = new AbortController();
278
+ return D(!0), x(!1), y(/* @__PURE__ */ new Map()), (async () => {
289
279
  try {
290
- const T = await _t(
280
+ const M = await Yt(
291
281
  e,
292
282
  t,
293
- a,
294
- z.signal,
295
- M
283
+ s,
284
+ A.signal,
285
+ R
296
286
  );
297
- if (z.signal.aborted) return;
298
- const j = T ? await Et(
287
+ if (A.signal.aborted) return;
288
+ const p = M ? await Jt(
299
289
  e,
300
- Ht(T),
301
- z.signal,
302
- M
290
+ po(M),
291
+ A.signal,
292
+ R
303
293
  ) : /* @__PURE__ */ new Map();
304
- if (z.signal.aborted) return;
305
- h(T), C(j);
306
- } catch (T) {
307
- if (z.signal.aborted || (T == null ? void 0 : T.name) === "AbortError")
294
+ if (A.signal.aborted) return;
295
+ b(M), S(p);
296
+ } catch (M) {
297
+ if (A.signal.aborted || (M == null ? void 0 : M.name) === "AbortError")
308
298
  return;
309
- h(null), k(!0);
299
+ b(null), x(!0);
310
300
  } finally {
311
- z.signal.aborted || S(!1);
301
+ A.signal.aborted || D(!1);
312
302
  }
313
- })(), () => z.abort();
314
- }, [e, t, a, M]);
315
- const [O, _] = ee(() => Date.now());
316
- pe(() => {
317
- if (!u || !l) return;
318
- const z = setInterval(() => _(Date.now()), 6e4);
319
- return () => clearInterval(z);
320
- }, [u, l]);
321
- const R = le(() => {
322
- var z;
323
- return !u || !l || d <= 0 ? "" : (((z = u.season) == null ? void 0 : z.events) ?? []).map((T) => T.id ? b.get(T.id) ?? T : T).filter((T) => T.id && Ut(T, O)).map((T) => T.id).join(",");
324
- }, [u, b, l, d, O]);
325
- pe(() => {
326
- if (!R) return;
327
- const z = R.split(","), T = new AbortController(), U = setInterval(async () => {
328
- const p = await Promise.all(
329
- z.map(
330
- (I) => Rt(e, I, T.signal, M)
303
+ })(), () => A.abort();
304
+ }, [e, t, s, R]);
305
+ const [$, W] = de(() => Date.now());
306
+ Ee(() => {
307
+ if (!h || !u) return;
308
+ const A = setInterval(() => W(Date.now()), 6e4);
309
+ return () => clearInterval(A);
310
+ }, [h, u]);
311
+ const L = Ie(() => {
312
+ var A;
313
+ return !h || !u || a <= 0 ? "" : (((A = h.season) == null ? void 0 : A.events) ?? []).map((M) => M.id ? w.get(M.id) ?? M : M).filter((M) => M.id && mo(M, $)).map((M) => M.id).join(",");
314
+ }, [h, w, u, a, $]);
315
+ Ee(() => {
316
+ if (!L) return;
317
+ const A = L.split(","), M = new AbortController(), k = setInterval(async () => {
318
+ const I = await Promise.all(
319
+ A.map(
320
+ (G) => qt(e, G, M.signal, R)
331
321
  )
332
322
  );
333
- T.signal.aborted || g((I) => {
334
- const v = new Map(I);
335
- return p.forEach((P) => (P == null ? void 0 : P.id) && v.set(P.id, P)), v;
323
+ M.signal.aborted || y((G) => {
324
+ const J = new Map(G);
325
+ return I.forEach((H) => (H == null ? void 0 : H.id) && J.set(H.id, H)), J;
336
326
  });
337
- }, d);
327
+ }, a);
338
328
  return () => {
339
- T.abort(), clearInterval(U);
329
+ M.abort(), clearInterval(k);
340
330
  };
341
- }, [e, R, d, M]);
342
- const E = le(
343
- () => u ? Nt(u, c, b) : null,
344
- [u, c, b]
345
- ), A = le(
346
- () => Gt(f, o, s),
347
- [f, o, s]
331
+ }, [e, L, a, R]);
332
+ const z = Ie(
333
+ () => h ? ao(h, m, w) : null,
334
+ [h, m, w]
335
+ ), U = Ie(
336
+ () => co(f, r, l),
337
+ [f, r, l]
348
338
  );
349
- return { data: E, competitionId: (u == null ? void 0 : u.id) ?? t, entities: A, loading: $, error: W };
350
- }, n = (e, t = 16) => `${Math.round(e / t * 1e4) / 1e4}em`, F = () => {
351
- const e = rt(), t = st(), o = it(), s = at() === "dark", i = (c, l) => `rgba(${lt(c)}, ${l})`, a = e.palette.primary.plainColor;
352
- return {
353
- fonts: t,
354
- radius: o,
355
- alpha: i,
356
- colors: {
357
- surface: e.surface,
358
- onSurface: e.onSurface,
359
- variant: e.surfaceVariant,
360
- border: e.outlineEnabledBorder,
361
- text: e.textPrimary,
362
- body: e.textBody,
363
- dim: i(e.textSecondary, 0.62),
364
- primary: a,
365
- primaryContainer: e.palette.primary.primaryContainer,
366
- onPrimary: e.palette.primary.onPrimary,
367
- success: e.palette.success.plainColor,
368
- danger: e.palette.danger.plainColor,
369
- tint: i(a, s ? 0.14 : 0.08),
370
- tint2: i(a, s ? 0.26 : 0.16),
371
- // Card colours are the real-world card colour, not a theme accent.
372
- yellowCard: "#F5C400"
373
- }
374
- };
375
- }, we = (e) => e.status === "FINISHED" && !!e.fullTime, de = (e) => e.fullTime ? e.fullTime[0] + e.fullTime[1] : 0, ze = (e, t, o) => e.filter(
376
- (s) => (s.home.id === t || s.away.id === t) && s.start < o
377
- ).sort((s, i) => i.start.localeCompare(s.start)).slice(0, 5).reverse().map((s) => {
378
- const i = s.home.id === t, [a, c] = s.fullTime, l = i ? a : c, d = i ? c : a;
379
- return { match: s, isHome: i, result: l > d ? "W" : l < d ? "L" : "D" };
380
- }), Vt = (e) => {
339
+ return { data: z, competitionId: (h == null ? void 0 : h.id) ?? t, entities: U, loading: _, error: E };
340
+ }, o = (e, t = 16) => `${Math.round(e / t * 1e4) / 1e4}em`, i = {
341
+ surface: "var(--fu-ucrc-surface)",
342
+ onSurface: "var(--fu-ucrc-on-surface)",
343
+ variant: "var(--fu-ucrc-surface-variant)",
344
+ border: "var(--fu-ucrc-outline-enabled-border)",
345
+ text: "var(--fu-ucrc-text-primary)",
346
+ body: "var(--fu-ucrc-text-body)",
347
+ dim: "var(--fu-ucrc-cs-dim)",
348
+ primary: "var(--fu-ucrc-primary-plain-color)",
349
+ primaryContainer: "var(--fu-ucrc-primary-primary-container)",
350
+ onPrimary: "var(--fu-ucrc-primary-on-primary)",
351
+ success: "var(--fu-ucrc-success-plain-color)",
352
+ danger: "var(--fu-ucrc-danger-plain-color)",
353
+ tint: "var(--fu-ucrc-cs-tint)",
354
+ tint2: "var(--fu-ucrc-cs-tint2)",
355
+ // Card colours are the real-world card colour, not a theme accent.
356
+ yellowCard: "#F5C400",
357
+ fontPrimary: "var(--fu-ucrc-font-primary)",
358
+ fontSecondary: "var(--fu-ucrc-font-secondary)",
359
+ radiusXs: "var(--fu-ucrc-radius-xs)",
360
+ radiusSm: "var(--fu-ucrc-radius-sm)",
361
+ radiusMd: "var(--fu-ucrc-radius-md)",
362
+ radiusFull: "var(--fu-ucrc-radius-full)"
363
+ }, go = () => {
364
+ const e = At(), t = Pt() === "dark", r = e.palette.primary.plainColor, l = e.textSecondary;
365
+ return P.useMemo(() => {
366
+ const c = (s, m) => `rgba(${Ft(s)}, ${m})`;
367
+ return {
368
+ "--fu-ucrc-cs-dim": c(l, 0.62),
369
+ "--fu-ucrc-cs-tint": c(r, t ? 0.14 : 0.08),
370
+ "--fu-ucrc-cs-tint2": c(r, t ? 0.26 : 0.16)
371
+ };
372
+ }, [r, l, t]);
373
+ }, We = (e) => e.status === "FINISHED" && !!e.fullTime, $e = (e) => e.fullTime ? e.fullTime[0] + e.fullTime[1] : 0, Je = (e, t, r) => e.filter(
374
+ (l) => (l.home.id === t || l.away.id === t) && l.start < r
375
+ ).sort((l, c) => c.start.localeCompare(l.start)).slice(0, 5).reverse().map((l) => {
376
+ const c = l.home.id === t, [s, m] = l.fullTime, u = c ? s : m, a = c ? m : s;
377
+ return { match: l, isHome: c, result: u > a ? "W" : u < a ? "L" : "D" };
378
+ }), fo = (e) => {
381
379
  const t = /* @__PURE__ */ new Map();
382
- return e.forEach((o) => {
383
- const [s, i] = o.fullTime;
380
+ return e.forEach((r) => {
381
+ const [l, c] = r.fullTime;
384
382
  [
385
- { side: o.home, conceded: i },
386
- { side: o.away, conceded: s }
387
- ].forEach(({ side: a, conceded: c }) => {
388
- const l = t.get(a.id) ?? { cleanSheets: 0, yellowCards: 0, redCards: 0 };
389
- c === 0 && (l.cleanSheets += 1), l.yellowCards += a.yellowCards ?? 0, l.redCards += a.redCards ?? 0, t.set(a.id, l);
383
+ { side: r.home, conceded: c },
384
+ { side: r.away, conceded: l }
385
+ ].forEach(({ side: s, conceded: m }) => {
386
+ const u = t.get(s.id) ?? { cleanSheets: 0, yellowCards: 0, redCards: 0 };
387
+ m === 0 && (u.cleanSheets += 1), u.yellowCards += s.yellowCards ?? 0, u.redCards += s.redCards ?? 0, t.set(s.id, u);
390
388
  });
391
389
  }), t;
392
- }, Yt = (e, t) => e.find(
393
- (o) => o.id !== t.id && (o.home.id === t.home.id && o.away.id === t.away.id || o.home.id === t.away.id && o.away.id === t.home.id)
394
- ) ?? null, G = (e, t) => t ? Math.round(e / t * 100) : 0, Xt = (e) => {
395
- const t = e.filter(we), o = (d) => t.reduce((u, h) => u + d(h), 0), s = o(de), i = t.filter((d) => d.fullTime[0] > d.fullTime[1]).length, a = t.filter((d) => d.fullTime[1] > d.fullTime[0]).length, c = o((d) => d.halfTime ? d.halfTime[0] + d.halfTime[1] : 0), l = [0, 1, 2, 3, 4, 5].map(
396
- (d) => o((u) => (u.home.goalsByPeriod[d] ?? 0) + (u.away.goalsByPeriod[d] ?? 0))
390
+ }, yo = (e, t) => e.find(
391
+ (r) => r.id !== t.id && (r.home.id === t.home.id && r.away.id === t.away.id || r.home.id === t.away.id && r.away.id === t.home.id)
392
+ ) ?? null, Y = (e, t) => t ? Math.round(e / t * 100) : 0, bo = (e) => {
393
+ const t = e.filter(We), r = (a) => t.reduce((h, b) => h + a(b), 0), l = r($e), c = t.filter((a) => a.fullTime[0] > a.fullTime[1]).length, s = t.filter((a) => a.fullTime[1] > a.fullTime[0]).length, m = r((a) => a.halfTime ? a.halfTime[0] + a.halfTime[1] : 0), u = [0, 1, 2, 3, 4, 5].map(
394
+ (a) => r((h) => (h.home.goalsByPeriod[a] ?? 0) + (h.away.goalsByPeriod[a] ?? 0))
397
395
  );
398
396
  return {
399
397
  total: e.length,
400
398
  played: t.length,
401
- goals: s,
402
- homeWins: i,
403
- awayWins: a,
404
- draws: t.length - i - a,
405
- firstHalfGoals: c,
406
- secondHalfGoals: s - c,
407
- goalsByPeriod: l,
408
- yellowCards: o((d) => (d.home.yellowCards ?? 0) + (d.away.yellowCards ?? 0)),
409
- redCards: o((d) => (d.home.redCards ?? 0) + (d.away.redCards ?? 0)),
410
- shotsOnTarget: o((d) => (d.home.shotsOnTarget ?? 0) + (d.away.shotsOnTarget ?? 0)),
411
- corners: o((d) => (d.home.corners ?? 0) + (d.away.corners ?? 0)),
412
- bothScored: t.filter((d) => d.fullTime[0] > 0 && d.fullTime[1] > 0).length,
413
- goalless: t.filter((d) => de(d) === 0).length,
414
- over: (d) => t.filter((u) => de(u) > d).length
399
+ goals: l,
400
+ homeWins: c,
401
+ awayWins: s,
402
+ draws: t.length - c - s,
403
+ firstHalfGoals: m,
404
+ secondHalfGoals: l - m,
405
+ goalsByPeriod: u,
406
+ yellowCards: r((a) => (a.home.yellowCards ?? 0) + (a.away.yellowCards ?? 0)),
407
+ redCards: r((a) => (a.home.redCards ?? 0) + (a.away.redCards ?? 0)),
408
+ shotsOnTarget: r((a) => (a.home.shotsOnTarget ?? 0) + (a.away.shotsOnTarget ?? 0)),
409
+ corners: r((a) => (a.home.corners ?? 0) + (a.away.corners ?? 0)),
410
+ bothScored: t.filter((a) => a.fullTime[0] > 0 && a.fullTime[1] > 0).length,
411
+ goalless: t.filter((a) => $e(a) === 0).length,
412
+ over: (a) => t.filter((h) => $e(h) > a).length
415
413
  };
416
- }, qt = 10, je = {
414
+ }, wo = 10, kt = {
417
415
  scorers: (e) => e.goals,
418
416
  assists: (e) => e.assists,
419
417
  contributions: (e) => e.goals + e.assists,
420
418
  cleanSheets: (e) => e.cleanSheets,
421
419
  minutes: (e) => e.minutes,
422
420
  cards: (e) => e.yellowCards + e.redCards
423
- }, he = Object.keys(je), Jt = (e, t) => {
424
- const o = je[t];
425
- return e.map((i) => ({ athlete: i, value: o(i) })).filter((i) => i.value > 0).sort(
426
- (i, a) => a.value - i.value || (t === "cards" ? a.athlete.redCards - i.athlete.redCards : t === "minutes" ? 0 : i.athlete.minutes - a.athlete.minutes)
427
- ).slice(0, qt).map((i, a, c) => {
428
- let l = a + 1;
429
- for (; l > 1 && c[l - 2].value === i.value; ) l -= 1;
430
- const d = a > 0 && c[a - 1].value === i.value || a < c.length - 1 && c[a + 1].value === i.value;
431
- return { ...i, rank: d ? `${l}=` : `${l}` };
421
+ }, ze = Object.keys(kt), vo = (e, t) => {
422
+ const r = kt[t];
423
+ return e.map((c) => ({ athlete: c, value: r(c) })).filter((c) => c.value > 0).sort(
424
+ (c, s) => s.value - c.value || (t === "cards" ? s.athlete.redCards - c.athlete.redCards : t === "minutes" ? 0 : c.athlete.minutes - s.athlete.minutes)
425
+ ).slice(0, wo).map((c, s, m) => {
426
+ let u = s + 1;
427
+ for (; u > 1 && m[u - 2].value === c.value; ) u -= 1;
428
+ const a = s > 0 && m[s - 1].value === c.value || s < m.length - 1 && m[s + 1].value === c.value;
429
+ return { ...c, rank: a ? `${u}=` : `${u}` };
432
430
  });
433
- }, V = (e, t, o = 1) => [...e].sort((s, i) => o * (t(i) - t(s)))[0], Qt = (e) => Array.from(e.values()), Zt = (e) => {
434
- const t = dt(e), o = /* @__PURE__ */ new Map();
431
+ }, Z = (e, t, r = 1) => [...e].sort((l, c) => r * (t(c) - t(l)))[0], Co = (e) => Array.from(e.values()), xo = (e) => {
432
+ const t = Wt(e), r = /* @__PURE__ */ new Map();
435
433
  return {
436
- date: (s, i) => {
437
- const a = new Date(s);
438
- return Number.isNaN(a.getTime()) ? "" : a.toLocaleDateString(t, i);
434
+ date: (l, c) => {
435
+ const s = new Date(l);
436
+ return Number.isNaN(s.getTime()) ? "" : s.toLocaleDateString(t, c);
439
437
  },
440
- time: (s) => {
441
- const i = new Date(s);
442
- return Number.isNaN(i.getTime()) ? "" : i.toLocaleTimeString(t, { hour: "2-digit", minute: "2-digit" });
438
+ time: (l) => {
439
+ const c = new Date(l);
440
+ return Number.isNaN(c.getTime()) ? "" : c.toLocaleTimeString(t, { hour: "2-digit", minute: "2-digit" });
443
441
  },
444
- decimal: (s, i) => {
445
- let a = o.get(i);
446
- return a || (a = new Intl.NumberFormat(t, {
447
- minimumFractionDigits: i,
448
- maximumFractionDigits: i
449
- }), o.set(i, a)), a.format(Number.isFinite(s) ? s : 0);
442
+ decimal: (l, c) => {
443
+ let s = r.get(c);
444
+ return s || (s = new Intl.NumberFormat(t, {
445
+ minimumFractionDigits: c,
446
+ maximumFractionDigits: c
447
+ }), r.set(c, s)), s.format(Number.isFinite(l) ? l : 0);
450
448
  }
451
449
  };
452
- }, eo = (e, t) => t ? e.replace(
450
+ }, So = (e, t) => t ? e.replace(
453
451
  /\{\{\s*(\w+)\s*\}\}/g,
454
- (o, s) => s in t ? String(t[s]) : o
455
- ) : e, to = (e) => {
456
- const { t } = wt("common");
457
- return le(
458
- () => (o, s) => {
459
- const i = e == null ? void 0 : e[o];
460
- return typeof i == "string" && i.trim() ? eo(i, s) : t(`competitionStatistics.${o}`, s ?? {});
452
+ (r, l) => l in t ? String(t[l]) : r
453
+ ) : e, ko = (e) => {
454
+ const { t } = Gt("common");
455
+ return Ie(
456
+ () => (r, l) => {
457
+ const c = e == null ? void 0 : e[r];
458
+ return typeof c == "string" && c.trim() ? So(c, l) : t(`competitionStatistics.${r}`, l ?? {});
461
459
  },
462
460
  [e, t]
463
461
  );
464
- }, w = ({
462
+ }, C = ({
465
463
  size: e,
466
464
  font: t = "primary",
467
- weight: o,
468
- color: s,
469
- upper: i,
470
- cms: a,
471
- ellipsis: c,
472
- parentSize: l = 16,
473
- component: d = "span",
474
- sx: u,
475
- children: h
476
- }) => {
477
- const { fonts: f } = F();
478
- return /* @__PURE__ */ r(
479
- m,
480
- {
481
- component: d,
482
- sx: [
483
- {
484
- fontSize: n(e, l),
485
- fontFamily: t === "primary" ? f.primary : f.secondary,
486
- ...o ? { fontWeight: o } : {},
487
- ...s ? { color: s } : {},
488
- ...i ? { textTransform: "uppercase", letterSpacing: n(0.5, e) } : {},
489
- ...a ? { unicodeBidi: "plaintext" } : {},
490
- ...c ? { whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" } : {}
491
- },
492
- ...Array.isArray(u) ? u : [u]
493
- ],
494
- children: h
495
- }
496
- );
497
- }, H = ({
465
+ weight: r,
466
+ color: l,
467
+ upper: c,
468
+ cms: s,
469
+ ellipsis: m,
470
+ parentSize: u = 16,
471
+ component: a = "span",
472
+ className: h,
473
+ style: b,
474
+ children: f
475
+ }) => /* @__PURE__ */ n(
476
+ a,
477
+ {
478
+ className: h,
479
+ style: {
480
+ fontSize: o(e, u),
481
+ fontFamily: t === "primary" ? i.fontPrimary : i.fontSecondary,
482
+ fontWeight: r,
483
+ color: l,
484
+ ...c ? { textTransform: "uppercase", letterSpacing: o(0.5, e) } : {},
485
+ ...s ? { unicodeBidi: "plaintext" } : {},
486
+ ...m ? { whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" } : {},
487
+ ...b
488
+ },
489
+ children: f
490
+ }
491
+ ), V = ({
498
492
  url: e,
499
493
  size: t,
500
- sx: o
501
- }) => e ? /* @__PURE__ */ r(
502
- m,
494
+ className: r
495
+ }) => e ? /* @__PURE__ */ n(
496
+ "div",
503
497
  {
504
- sx: [
505
- {
506
- width: n(t),
507
- height: n(t),
508
- flexShrink: 0,
509
- backgroundImage: `url("${e}")`,
510
- backgroundSize: "contain",
511
- backgroundRepeat: "no-repeat",
512
- backgroundPosition: "center"
513
- },
514
- ...Array.isArray(o) ? o : [o]
515
- ]
516
- }
517
- ) : null, Z = ({ sx: e, ...t }) => {
518
- const { colors: o, radius: s } = F();
519
- return /* @__PURE__ */ r(
520
- m,
521
- {
522
- ...t,
523
- sx: [
524
- {
525
- backgroundColor: o.surface,
526
- border: `1px solid ${o.border}`,
527
- borderRadius: s.md
528
- },
529
- ...Array.isArray(e) ? e : [e]
530
- ]
498
+ className: r,
499
+ style: {
500
+ width: o(t),
501
+ height: o(t),
502
+ flexShrink: 0,
503
+ backgroundImage: `url("${e}")`,
504
+ backgroundSize: "contain",
505
+ backgroundRepeat: "no-repeat",
506
+ backgroundPosition: "center"
531
507
  }
532
- );
533
- }, He = ({ children: e }) => {
534
- const { colors: t } = F();
535
- return /* @__PURE__ */ r(w, { size: 13, weight: 700, upper: !0, color: t.text, sx: { padding: `0 ${n(2, 13)}` }, children: e });
536
- }, q = ({
537
- size: e = 11,
538
- children: t,
539
- sx: o
540
- }) => {
541
- const { colors: s } = F();
542
- return /* @__PURE__ */ r(w, { size: e, font: "secondary", weight: 700, upper: !0, color: s.dim, sx: o, children: t });
543
- }, Ue = L.createContext(null), oo = Ue.Provider, Y = () => {
544
- const e = L.useContext(Ue);
508
+ }
509
+ ) : null, me = d({
510
+ backgroundColor: i.surface,
511
+ border: `1px solid ${i.border}`,
512
+ borderRadius: i.radiusMd
513
+ }), Oe = { textDecoration: "none", color: "inherit" }, It = ({ children: e }) => /* @__PURE__ */ n(C, { size: 13, weight: 700, upper: !0, color: i.text, style: { padding: `0 ${o(2, 13)}` }, children: e }), se = ({ size: e = 11, className: t, style: r, children: l }) => /* @__PURE__ */ n(
514
+ C,
515
+ {
516
+ size: e,
517
+ font: "secondary",
518
+ weight: 700,
519
+ upper: !0,
520
+ color: i.dim,
521
+ className: t,
522
+ style: r,
523
+ children: l
524
+ }
525
+ ), $t = P.createContext(null), Io = $t.Provider, oe = () => {
526
+ const e = P.useContext($t);
545
527
  if (!e) throw new Error("useWidget must be used inside WidgetProvider");
546
528
  return e;
547
- }, no = () => {
548
- var g;
549
- const { colors: e, radius: t } = F(), { data: o, competitionId: s, entities: i, finished: a, label: c, fmt: l } = Y(), d = a.length, u = o.matches.length, h = G(d, u), f = (g = o.matches.filter(($) => $.status === "UPCOMING" || $.status === "LIVE").sort(($, S) => $.round - S.round)[0]) == null ? void 0 : g.round, C = {
529
+ }, ee = {
530
+ root: d(me, {
531
+ padding: `${o(12)} ${o(16)}`,
532
+ display: "flex",
533
+ alignItems: "center",
534
+ gap: o(12),
535
+ flexWrap: "wrap"
536
+ }),
537
+ titleBlock: d({ minWidth: 0, flex: `1 1 ${o(200)}` }),
538
+ titleRow: d({ display: "flex", alignItems: "center", gap: o(8), flexWrap: "wrap" }),
539
+ season: d({
540
+ backgroundColor: i.tint,
541
+ borderRadius: i.radiusFull,
542
+ padding: `${o(3, 10)} ${o(8, 10)}`
543
+ }),
544
+ progressBlock: d({ flex: `1 1 ${o(220)}`, minWidth: 0 }),
545
+ progressCaption: d({
546
+ display: "flex",
547
+ justifyContent: "space-between",
548
+ marginBottom: o(5, 11)
549
+ }),
550
+ played: d({ color: i.text }),
551
+ track: d({
552
+ height: o(6),
553
+ borderRadius: i.radiusFull,
554
+ backgroundColor: i.variant,
555
+ overflow: "hidden"
556
+ }),
557
+ fill: d({ height: "100%", backgroundColor: i.primary, borderRadius: i.radiusFull })
558
+ }, $o = () => {
559
+ var S;
560
+ const { data: e, competitionId: t, entities: r, finished: l, label: c, fmt: s } = oe(), m = l.length, u = e.matches.length, a = Y(m, u), h = (S = e.matches.filter((w) => w.status === "UPCOMING" || w.status === "LIVE").sort((w, y) => w.round - y.round)[0]) == null ? void 0 : S.round, b = {
550
561
  day: "numeric",
551
562
  month: "short",
552
563
  year: "numeric"
553
- }, b = o.season.startDate && o.season.endDate ? `${l.date(o.season.startDate, C)} – ${l.date(o.season.endDate, C)}` : "";
554
- return /* @__PURE__ */ y(
555
- Z,
556
- {
557
- sx: {
558
- padding: `${n(12)} ${n(16)}`,
559
- display: "flex",
560
- alignItems: "center",
561
- gap: n(12),
562
- flexWrap: "wrap"
563
- },
564
- children: [
565
- /* @__PURE__ */ r(H, { url: i.logo(s), size: 40 }),
566
- /* @__PURE__ */ y(m, { sx: { minWidth: 0, flex: `1 1 ${n(200)}` }, children: [
567
- /* @__PURE__ */ y(m, { sx: { display: "flex", alignItems: "center", gap: n(8), flexWrap: "wrap" }, children: [
568
- /* @__PURE__ */ r(w, { size: 17, weight: 700, color: e.text, cms: !0, children: i.name(s) }),
569
- o.season.name ? /* @__PURE__ */ r(
570
- w,
571
- {
572
- size: 10,
573
- weight: 600,
574
- color: e.primary,
575
- sx: {
576
- backgroundColor: e.tint,
577
- borderRadius: t.full,
578
- padding: `${n(3, 10)} ${n(8, 10)}`
579
- },
580
- children: o.season.name
581
- }
582
- ) : null
583
- ] }),
584
- b ? /* @__PURE__ */ r(
585
- w,
586
- {
587
- component: "div",
588
- size: 11,
589
- font: "secondary",
590
- color: e.dim,
591
- sx: { marginTop: n(2, 11) },
592
- children: b
593
- }
594
- ) : null
595
- ] }),
596
- /* @__PURE__ */ y(m, { sx: { flex: `1 1 ${n(220)}`, minWidth: 0 }, children: [
597
- /* @__PURE__ */ y(
598
- w,
599
- {
600
- component: "div",
601
- size: 11,
602
- font: "secondary",
603
- color: e.dim,
604
- sx: {
605
- display: "flex",
606
- justifyContent: "space-between",
607
- marginBottom: n(5, 11)
608
- },
609
- children: [
610
- /* @__PURE__ */ r("span", { children: f !== void 0 ? c("upcomingRound", { round: f }) : c("seasonFinished") }),
611
- /* @__PURE__ */ y("span", { children: [
612
- /* @__PURE__ */ r(m, { component: "b", sx: { color: e.text }, children: d }),
613
- " ",
614
- c("seasonProgress", {
615
- matches: c("matchesCount", { count: u }),
616
- pct: h
617
- })
618
- ] })
619
- ]
620
- }
621
- ),
622
- /* @__PURE__ */ r(
623
- m,
624
- {
625
- sx: {
626
- height: n(6),
627
- borderRadius: t.full,
628
- backgroundColor: e.variant,
629
- overflow: "hidden"
630
- },
631
- children: /* @__PURE__ */ r(
632
- m,
633
- {
634
- sx: {
635
- height: "100%",
636
- width: `${h}%`,
637
- backgroundColor: e.primary,
638
- borderRadius: t.full
639
- }
640
- }
641
- )
642
- }
643
- )
644
- ] })
645
- ]
646
- }
647
- );
648
- }, ro = {
564
+ }, f = e.season.startDate && e.season.endDate ? `${s.date(e.season.startDate, b)} – ${s.date(e.season.endDate, b)}` : "";
565
+ return /* @__PURE__ */ g("div", { css: ee.root, children: [
566
+ /* @__PURE__ */ n(V, { url: r.logo(t), size: 40 }),
567
+ /* @__PURE__ */ g("div", { css: ee.titleBlock, children: [
568
+ /* @__PURE__ */ g("div", { css: ee.titleRow, children: [
569
+ /* @__PURE__ */ n(C, { size: 17, weight: 700, color: i.text, cms: !0, children: r.name(t) }),
570
+ e.season.name ? /* @__PURE__ */ n(C, { size: 10, weight: 600, color: i.primary, css: ee.season, children: e.season.name }) : null
571
+ ] }),
572
+ f ? /* @__PURE__ */ n(
573
+ C,
574
+ {
575
+ component: "div",
576
+ size: 11,
577
+ font: "secondary",
578
+ color: i.dim,
579
+ style: { marginTop: o(2, 11) },
580
+ children: f
581
+ }
582
+ ) : null
583
+ ] }),
584
+ /* @__PURE__ */ g("div", { css: ee.progressBlock, children: [
585
+ /* @__PURE__ */ g(
586
+ C,
587
+ {
588
+ component: "div",
589
+ size: 11,
590
+ font: "secondary",
591
+ color: i.dim,
592
+ css: ee.progressCaption,
593
+ children: [
594
+ /* @__PURE__ */ n("span", { children: h !== void 0 ? c("upcomingRound", { round: h }) : c("seasonFinished") }),
595
+ /* @__PURE__ */ g("span", { children: [
596
+ /* @__PURE__ */ n("b", { css: ee.played, children: m }),
597
+ " ",
598
+ c("seasonProgress", {
599
+ matches: c("matchesCount", { count: u }),
600
+ pct: a
601
+ })
602
+ ] })
603
+ ]
604
+ }
605
+ ),
606
+ /* @__PURE__ */ n("div", { css: ee.track, children: /* @__PURE__ */ n("div", { css: ee.fill, style: { width: `${a}%` } }) })
607
+ ] })
608
+ ] });
609
+ }, To = {
649
610
  match: "matchId",
650
611
  team: "competitorId",
651
612
  player: "athleteId"
652
- }, ce = (e) => {
613
+ }, Te = (e) => {
653
614
  var t;
654
615
  return !!(e != null && e.onClick || (t = e == null ? void 0 : e.url) != null && t.trim());
655
- }, fe = (e, t, o) => {
656
- var c;
657
- if (!ce(e)) return null;
658
- const s = ((c = e == null ? void 0 : e.url) == null ? void 0 : c.trim()) ?? "", i = encodeURIComponent(o);
616
+ }, De = (e, t, r) => {
617
+ var m;
618
+ if (!Te(e)) return null;
619
+ const l = ((m = e == null ? void 0 : e.url) == null ? void 0 : m.trim()) ?? "", c = encodeURIComponent(r);
659
620
  return {
660
- href: s ? s.replace(
621
+ href: l ? l.replace(
661
622
  /\{(\w+)\}/g,
662
- (l, d) => d === "id" || d === ro[t] ? i : l
623
+ (u, a) => a === "id" || a === To[t] ? c : u
663
624
  ) : null,
664
625
  target: (e == null ? void 0 : e.target) ?? void 0,
665
- onClick: e != null && e.onClick ? (l) => {
666
- var d;
667
- l.stopPropagation(), l.preventDefault(), (d = e.onClick) == null || d.call(e, o);
668
- } : (l) => l.stopPropagation()
626
+ onClick: e != null && e.onClick ? (u) => {
627
+ var a;
628
+ u.stopPropagation(), u.preventDefault(), (a = e.onClick) == null || a.call(e, r);
629
+ } : (u) => u.stopPropagation()
669
630
  };
670
- }, te = (e, t) => Math.round(e.minutes / t), J = (e, t) => t("matchesCount", { count: e.appearances }), oe = (e, t) => t("minutesCount", { count: e.minutes }), Ke = {
631
+ }, Qe = (e) => d({
632
+ position: "absolute",
633
+ top: 0,
634
+ bottom: 0,
635
+ ...e ? { left: 0 } : { right: 0 },
636
+ width: o(56),
637
+ display: "flex",
638
+ alignItems: "center",
639
+ justifyContent: e ? "flex-start" : "flex-end",
640
+ padding: `0 ${o(6)}`,
641
+ border: "none",
642
+ cursor: "pointer",
643
+ color: i.text,
644
+ fontSize: o(16),
645
+ background: `linear-gradient(to ${e ? "right" : "left"}, ${i.surface} 55%, transparent)`
646
+ }), Ze = d({
647
+ display: "flex",
648
+ overflowX: "auto",
649
+ scrollbarWidth: "none",
650
+ "&::-webkit-scrollbar": { display: "none" }
651
+ }), ve = {
652
+ frame: {
653
+ pill: d({
654
+ position: "relative",
655
+ overflow: "hidden",
656
+ backgroundColor: i.surface,
657
+ border: `1px solid ${i.border}`,
658
+ borderRadius: i.radiusFull
659
+ }),
660
+ row: d({ position: "relative", borderBottom: `1px solid ${i.border}` })
661
+ },
662
+ scroller: {
663
+ pill: d(Ze, { padding: o(3) }),
664
+ row: d(Ze, { padding: `${o(10)} ${o(16)}` })
665
+ },
666
+ start: Qe(!0),
667
+ end: Qe(!1)
668
+ }, Ae = ({ variant: e, gap: t, role: r, children: l }) => {
669
+ const c = P.useRef(null), s = Ot(), [m, u] = P.useState({ start: !1, end: !1 }), a = P.useCallback(() => {
670
+ const b = c.current;
671
+ if (!b) return;
672
+ const f = Math.abs(b.scrollLeft), S = b.scrollWidth - b.clientWidth, w = f > 1, y = f < S - 1;
673
+ u((_) => _.start === w && _.end === y ? _ : { start: w, end: y });
674
+ }, []);
675
+ P.useLayoutEffect(a), P.useEffect(() => {
676
+ if (!c.current) return;
677
+ const b = new ResizeObserver(a);
678
+ return b.observe(c.current), () => b.disconnect();
679
+ }, [a]);
680
+ const h = (b) => {
681
+ const f = c.current;
682
+ if (!f) return;
683
+ const S = f.clientWidth * 0.75 * (b ? 1 : -1);
684
+ f.scrollBy({ left: s ? -S : S, behavior: "smooth" });
685
+ };
686
+ return /* @__PURE__ */ g("div", { css: ve.frame[e], children: [
687
+ /* @__PURE__ */ n(
688
+ "div",
689
+ {
690
+ ref: c,
691
+ role: r,
692
+ onScroll: a,
693
+ css: ve.scroller[e],
694
+ style: { gap: o(t) },
695
+ children: l
696
+ }
697
+ ),
698
+ m.start ? /* @__PURE__ */ n("button", { type: "button", tabIndex: -1, "aria-hidden": !0, onClick: () => h(!1), css: ve.start, children: /* @__PURE__ */ n(Xe, { children: /* @__PURE__ */ n(Ht, { size: "1em" }) }) }) : null,
699
+ m.end ? /* @__PURE__ */ n("button", { type: "button", tabIndex: -1, "aria-hidden": !0, onClick: () => h(!0), css: ve.end, children: /* @__PURE__ */ n(Xe, { children: /* @__PURE__ */ n(jt, { size: "1em" }) }) }) : null
700
+ ] });
701
+ }, ue = (e, t) => Math.round(e.minutes / t), ne = (e, t) => t("matchesCount", { count: e.appearances }), pe = (e, t) => t("minutesCount", { count: e.minutes }), Tt = {
671
702
  scorers: {
672
703
  title: "scorers",
673
704
  unit: "unitGoals",
674
- secondary: (e, t, o) => [J(e, o), oe(e, o), o("goalEvery", { count: te(e, t) })],
675
- chips: (e, t, o) => [J(e, o), oe(e, o), o("goalRate", { count: te(e, t) })]
705
+ secondary: (e, t, r) => [ne(e, r), pe(e, r), r("goalEvery", { count: ue(e, t) })],
706
+ chips: (e, t, r) => [ne(e, r), pe(e, r), r("goalRate", { count: ue(e, t) })]
676
707
  },
677
708
  assists: {
678
709
  title: "assists",
679
710
  unit: "unitAssists",
680
- secondary: (e, t, o) => [J(e, o), oe(e, o), o("assistEvery", { count: te(e, t) })],
681
- chips: (e, t, o) => [J(e, o), oe(e, o), o("assistRate", { count: te(e, t) })]
711
+ secondary: (e, t, r) => [ne(e, r), pe(e, r), r("assistEvery", { count: ue(e, t) })],
712
+ chips: (e, t, r) => [ne(e, r), pe(e, r), r("assistRate", { count: ue(e, t) })]
682
713
  },
683
714
  contributions: {
684
715
  title: "contributions",
685
716
  unit: "unitContributions",
686
- secondary: (e, t, o) => [
687
- o("goalsCount", { count: e.goals }),
688
- o("assistsCount", { count: e.assists }),
689
- o("contributionEvery", { count: te(e, t) })
717
+ secondary: (e, t, r) => [
718
+ r("goalsCount", { count: e.goals }),
719
+ r("assistsCount", { count: e.assists }),
720
+ r("contributionEvery", { count: ue(e, t) })
690
721
  ],
691
- chips: (e, t, o) => [
692
- o("goalsShort", { count: e.goals }),
693
- o("assistsShort", { count: e.assists }),
694
- o("contributionRate", { count: te(e, t) })
722
+ chips: (e, t, r) => [
723
+ r("goalsShort", { count: e.goals }),
724
+ r("assistsShort", { count: e.assists }),
725
+ r("contributionRate", { count: ue(e, t) })
695
726
  ]
696
727
  },
697
728
  cleanSheets: {
698
729
  title: "cleanSheets",
699
730
  unit: "unitMatches",
700
- secondary: (e, t, o) => [J(e, o), oe(e, o)],
701
- chips: (e, t, o) => [J(e, o), oe(e, o)]
731
+ secondary: (e, t, r) => [ne(e, r), pe(e, r)],
732
+ chips: (e, t, r) => [ne(e, r), pe(e, r)]
702
733
  },
703
734
  minutes: {
704
735
  title: "mostMinutes",
705
736
  unit: "unitMinutes",
706
- secondary: (e, t, o) => [
707
- J(e, o),
708
- o("minutesPerMatch", { count: e.appearances ? Math.round(t / e.appearances) : 0 })
737
+ secondary: (e, t, r) => [
738
+ ne(e, r),
739
+ r("minutesPerMatch", { count: e.appearances ? Math.round(t / e.appearances) : 0 })
709
740
  ],
710
- chips: (e, t, o) => [
711
- J(e, o),
712
- o("minutesPerMatch", { count: e.appearances ? Math.round(t / e.appearances) : 0 })
741
+ chips: (e, t, r) => [
742
+ ne(e, r),
743
+ r("minutesPerMatch", { count: e.appearances ? Math.round(t / e.appearances) : 0 })
713
744
  ]
714
745
  },
715
746
  cards: {
716
747
  title: "mostCards",
717
748
  unit: "unitCards",
718
- secondary: (e, t, o) => [
719
- o("yellowCount", { count: e.yellowCards }),
720
- o("redCount", { count: e.redCards })
749
+ secondary: (e, t, r) => [
750
+ r("yellowCount", { count: e.yellowCards }),
751
+ r("redCount", { count: e.redCards })
721
752
  ],
722
- chips: (e, t, o) => [
723
- o("yellowCount", { count: e.yellowCards }),
724
- o("redCount", { count: e.redCards })
753
+ chips: (e, t, r) => [
754
+ r("yellowCount", { count: e.yellowCards }),
755
+ r("redCount", { count: e.redCards })
725
756
  ]
726
757
  }
727
- }, so = {
758
+ }, _o = {
728
759
  goalkeeper: "goalkeeper",
729
760
  defender: "defender",
730
761
  midfielder: "midfielder",
731
762
  forward: "forward"
732
- }, Ae = ({ photo: e, initial: t, size: o, badge: s, teamLogo: i, hero: a }) => {
733
- const { colors: c } = F(), l = a ? 22 : 12;
734
- return /* @__PURE__ */ y(
735
- m,
736
- {
737
- sx: {
738
- position: "relative",
739
- flexShrink: 0,
740
- ...a ? {} : { width: n(o), height: n(o) }
741
- },
742
- children: [
743
- /* @__PURE__ */ r(
744
- w,
745
- {
746
- component: "div",
747
- size: l,
748
- weight: 700,
749
- color: c.dim,
750
- sx: {
751
- width: n(o, l),
752
- height: n(o, l),
753
- borderRadius: "50%",
754
- backgroundColor: a ? c.surface : c.variant,
755
- ...a ? { border: `2px solid ${c.primary}` } : {},
756
- display: "flex",
757
- alignItems: "center",
758
- justifyContent: "center",
759
- overflow: "hidden",
760
- ...e ? {
761
- backgroundImage: `url("${e}")`,
762
- backgroundSize: "cover",
763
- backgroundPosition: "top center"
764
- } : {}
765
- },
766
- children: e ? null : t
767
- }
768
- ),
769
- i ? /* @__PURE__ */ r(
770
- m,
771
- {
772
- sx: {
773
- position: "absolute",
774
- right: n(-4),
775
- bottom: n(a ? -2 : -3),
776
- width: n(s),
777
- height: n(s),
778
- borderRadius: "50%",
779
- backgroundColor: c.surface,
780
- border: `1px solid ${c.border}`,
781
- backgroundImage: `url("${i}")`,
782
- backgroundSize: "70%",
783
- backgroundRepeat: "no-repeat",
784
- backgroundPosition: "center"
785
- }
786
- }
787
- ) : null
788
- ]
789
- }
790
- );
791
- }, io = ({ category: e }) => {
792
- var W, k, M, O;
793
- const { colors: t, radius: o, fonts: s } = F(), { data: i, entities: a, label: c, props: l } = Y(), [d, u] = L.useState(!1), h = Ke[e], f = L.useMemo(() => Jt(i.athletes, e), [i.athletes, e]), C = Math.min(10, Math.max(1, Math.round(l.playerRankingsRows ?? 5))), b = f.slice(0, d ? 10 : C), g = ce(l.playerCTA), $ = (_) => {
794
- const R = _.athlete.athleteId, E = a.name(R), A = so[a.position(R) ?? ""];
795
- return {
796
- id: R,
797
- name: E,
798
- photo: a.photo(R),
799
- initial: E.trim().charAt(0),
800
- team: a.name(_.athlete.teamId),
801
- teamLogo: a.logo(_.athlete.teamId),
802
- position: A ? c(A) : "",
803
- cta: fe(l.playerCTA, "player", R)
804
- };
805
- }, S = b[0] ? $(b[0]) : null;
806
- return /* @__PURE__ */ y(
807
- m,
808
- {
809
- sx: {
810
- backgroundColor: t.surface,
811
- border: `1px solid ${t.border}`,
812
- borderRadius: o.md,
813
- overflow: "hidden",
814
- display: "flex",
815
- flexDirection: "column"
816
- },
817
- children: [
818
- /* @__PURE__ */ r(
819
- w,
820
- {
821
- component: "div",
822
- size: 11,
823
- font: "secondary",
824
- weight: 700,
825
- upper: !0,
826
- color: t.dim,
827
- sx: { padding: `${n(10, 11)} ${n(14, 11)} 0` },
828
- children: c(h.title)
829
- }
830
- ),
831
- S && b[0] ? /* @__PURE__ */ y(
832
- m,
833
- {
834
- component: (W = S.cta) != null && W.href ? "a" : "div",
835
- href: ((k = S.cta) == null ? void 0 : k.href) ?? void 0,
836
- target: (M = S.cta) == null ? void 0 : M.target,
837
- onClick: (O = S.cta) == null ? void 0 : O.onClick,
838
- sx: {
839
- margin: n(10),
840
- padding: n(12),
841
- borderRadius: `calc(${o.md} - 2px)`,
842
- background: `linear-gradient(135deg, ${t.tint2}, ${t.tint})`,
843
- display: "flex",
844
- alignItems: "center",
845
- gap: n(12),
846
- cursor: g ? "pointer" : "default",
847
- textDecoration: "none",
848
- color: "inherit"
849
- },
850
- children: [
851
- /* @__PURE__ */ r(
852
- Ae,
853
- {
854
- photo: S.photo,
855
- initial: S.initial,
856
- size: 60,
857
- badge: 24,
858
- teamLogo: S.teamLogo,
859
- hero: !0
860
- }
861
- ),
862
- /* @__PURE__ */ y(m, { sx: { flex: 1, minWidth: 0 }, children: [
863
- /* @__PURE__ */ r(w, { component: "div", size: 15, weight: 700, color: t.text, ellipsis: !0, cms: !0, children: S.name }),
864
- /* @__PURE__ */ r(
865
- w,
866
- {
867
- component: "div",
868
- size: 11,
869
- font: "secondary",
870
- color: t.dim,
871
- ellipsis: !0,
872
- cms: !0,
873
- sx: { marginTop: n(2, 11) },
874
- children: [S.team, S.position].filter(Boolean).join(" · ")
875
- }
876
- ),
877
- /* @__PURE__ */ r(m, { sx: { display: "flex", gap: n(4), flexWrap: "wrap", marginTop: n(6) }, children: h.chips(b[0].athlete, b[0].value, c).map((_) => /* @__PURE__ */ r(
878
- w,
879
- {
880
- size: 10,
881
- font: "secondary",
882
- weight: 600,
883
- color: t.body,
884
- sx: {
885
- backgroundColor: t.surface,
886
- borderRadius: o.full,
887
- padding: `${n(2, 10)} ${n(7, 10)}`
888
- },
889
- children: _
890
- },
891
- _
892
- )) })
893
- ] }),
894
- /* @__PURE__ */ y(m, { sx: { textAlign: "right", flexShrink: 0 }, children: [
895
- /* @__PURE__ */ r(w, { component: "div", size: 32, weight: 700, color: t.primary, sx: { lineHeight: 1 }, children: b[0].value }),
896
- /* @__PURE__ */ r(
897
- w,
898
- {
899
- component: "div",
900
- size: 10,
901
- font: "secondary",
902
- upper: !0,
903
- color: t.dim,
904
- sx: { marginTop: n(3, 10) },
905
- children: c(h.unit)
906
- }
907
- )
908
- ] })
909
- ]
910
- }
911
- ) : null,
912
- b.slice(1).map((_) => {
913
- var E, A, z, T;
914
- const R = $(_);
915
- return /* @__PURE__ */ y(
916
- m,
917
- {
918
- component: (E = R.cta) != null && E.href ? "a" : "div",
919
- href: ((A = R.cta) == null ? void 0 : A.href) ?? void 0,
920
- target: (z = R.cta) == null ? void 0 : z.target,
921
- onClick: (T = R.cta) == null ? void 0 : T.onClick,
922
- sx: {
923
- display: "grid",
924
- gridTemplateColumns: `${n(28)} ${n(32)} minmax(0,1fr) auto`,
925
- alignItems: "center",
926
- gap: n(10),
927
- padding: `${n(8)} ${n(14)}`,
928
- borderTop: `1px solid ${t.border}`,
929
- cursor: g ? "pointer" : "default",
930
- textDecoration: "none",
931
- color: "inherit",
932
- "&:hover": { backgroundColor: g ? t.onSurface : "transparent" }
933
- },
934
- children: [
935
- /* @__PURE__ */ r(w, { size: 12, font: "secondary", weight: 700, color: t.dim, children: _.rank }),
936
- /* @__PURE__ */ r(Ae, { photo: R.photo, initial: R.initial, size: 32, badge: 16, teamLogo: R.teamLogo }),
937
- /* @__PURE__ */ y(m, { sx: { minWidth: 0 }, children: [
938
- /* @__PURE__ */ r(w, { component: "div", size: 13, weight: 600, color: t.text, ellipsis: !0, cms: !0, children: R.name }),
939
- /* @__PURE__ */ r(w, { component: "div", size: 11, font: "secondary", color: t.dim, ellipsis: !0, children: h.secondary(_.athlete, _.value, c).join(" · ") })
940
- ] }),
941
- /* @__PURE__ */ r(w, { size: 16, weight: 700, color: t.primary, children: _.value })
942
- ]
943
- },
944
- R.id
945
- );
946
- }),
947
- f.length > C ? /* @__PURE__ */ r(
948
- m,
949
- {
950
- component: "button",
951
- type: "button",
952
- onClick: () => u(!d),
953
- sx: {
954
- border: "none",
955
- borderTop: `1px solid ${t.border}`,
956
- background: "transparent",
957
- cursor: "pointer",
958
- padding: n(9, 12),
959
- fontFamily: s.secondary,
960
- fontSize: n(12),
961
- fontWeight: 700,
962
- color: t.primary
963
- },
964
- children: d ? c("showLess") : c("showAll", { count: f.length })
965
- }
966
- ) : null
967
- ]
968
- }
969
- );
970
- }, ao = () => {
971
- const { colors: e, radius: t, fonts: o } = F(), { label: s, props: i } = Y(), a = xe(), [c, l] = L.useState(0), d = i.playerRankingsLayout ?? "auto", u = d === "tabs" || d === "auto" && a, h = u ? [he[c]] : he;
972
- return /* @__PURE__ */ y(m, { sx: { display: "flex", flexDirection: "column", gap: n(10) }, children: [
973
- /* @__PURE__ */ r(He, { children: s("leadersTitle") }),
974
- u ? /* @__PURE__ */ r(
975
- m,
763
+ }, et = (e) => d({
764
+ borderRadius: "50%",
765
+ backgroundColor: e ? i.surface : i.variant,
766
+ ...e ? { border: `2px solid ${i.primary}` } : {},
767
+ display: "flex",
768
+ alignItems: "center",
769
+ justifyContent: "center",
770
+ overflow: "hidden"
771
+ }), tt = (e) => d({
772
+ ...Oe,
773
+ margin: o(10),
774
+ padding: o(12),
775
+ borderRadius: `calc(${i.radiusMd} - 2px)`,
776
+ background: `linear-gradient(135deg, ${i.tint2}, ${i.tint})`,
777
+ display: "flex",
778
+ alignItems: "center",
779
+ gap: o(12),
780
+ cursor: e ? "pointer" : "default"
781
+ }), ot = (e) => d({
782
+ ...Oe,
783
+ display: "grid",
784
+ gridTemplateColumns: `${o(28)} ${o(32)} minmax(0,1fr) auto`,
785
+ alignItems: "center",
786
+ gap: o(10),
787
+ padding: `${o(8)} ${o(14)}`,
788
+ borderTop: `1px solid ${i.border}`,
789
+ cursor: e ? "pointer" : "default",
790
+ "&:hover": { backgroundColor: e ? i.onSurface : "transparent" }
791
+ }), rt = (e) => d({
792
+ flex: "1 0 auto",
793
+ whiteSpace: "nowrap",
794
+ border: "none",
795
+ cursor: "pointer",
796
+ borderRadius: i.radiusFull,
797
+ padding: `${o(6, 12)} ${o(12, 12)}`,
798
+ fontFamily: i.fontPrimary,
799
+ fontSize: o(12),
800
+ fontWeight: 700,
801
+ backgroundColor: e ? i.primary : "transparent",
802
+ color: e ? i.onPrimary : i.dim
803
+ }), B = {
804
+ avatar: d({ position: "relative", flexShrink: 0 }),
805
+ portrait: { hero: et(!0), plain: et(!1) },
806
+ teamBadge: d({
807
+ position: "absolute",
808
+ right: o(-4),
809
+ borderRadius: "50%",
810
+ backgroundColor: i.surface,
811
+ border: `1px solid ${i.border}`,
812
+ backgroundSize: "70%",
813
+ backgroundRepeat: "no-repeat",
814
+ backgroundPosition: "center"
815
+ }),
816
+ card: d({
817
+ backgroundColor: i.surface,
818
+ border: `1px solid ${i.border}`,
819
+ borderRadius: i.radiusMd,
820
+ overflow: "hidden",
821
+ display: "flex",
822
+ flexDirection: "column"
823
+ }),
824
+ hero: { interactive: tt(!0), plain: tt(!1) },
825
+ heroText: d({ flex: 1, minWidth: 0 }),
826
+ chips: d({ display: "flex", gap: o(4), flexWrap: "wrap", marginTop: o(6) }),
827
+ chip: d({
828
+ backgroundColor: i.surface,
829
+ borderRadius: i.radiusFull,
830
+ padding: `${o(2, 10)} ${o(7, 10)}`
831
+ }),
832
+ heroValue: d({ textAlign: "right", flexShrink: 0 }),
833
+ row: { interactive: ot(!0), plain: ot(!1) },
834
+ rowText: d({ minWidth: 0 }),
835
+ showAll: d({
836
+ border: "none",
837
+ borderTop: `1px solid ${i.border}`,
838
+ background: "transparent",
839
+ cursor: "pointer",
840
+ padding: o(9, 12),
841
+ fontFamily: i.fontSecondary,
842
+ fontSize: o(12),
843
+ fontWeight: 700,
844
+ color: i.primary
845
+ }),
846
+ section: d({ display: "flex", flexDirection: "column", gap: o(10) }),
847
+ tab: { on: rt(!0), off: rt(!1) },
848
+ grid: d({ display: "grid", gap: o(12) })
849
+ }, st = ({ photo: e, initial: t, size: r, badge: l, teamLogo: c, hero: s }) => {
850
+ const m = s ? 22 : 12;
851
+ return /* @__PURE__ */ g("div", { css: B.avatar, style: s ? void 0 : { width: o(r), height: o(r) }, children: [
852
+ /* @__PURE__ */ n(
853
+ C,
976
854
  {
977
- sx: {
978
- display: "flex",
979
- gap: n(4),
980
- overflowX: "auto",
981
- padding: n(3),
982
- backgroundColor: e.surface,
983
- border: `1px solid ${e.border}`,
984
- borderRadius: t.full
855
+ component: "div",
856
+ size: m,
857
+ weight: 700,
858
+ color: i.dim,
859
+ css: s ? B.portrait.hero : B.portrait.plain,
860
+ style: {
861
+ width: o(r, m),
862
+ height: o(r, m),
863
+ ...e ? {
864
+ backgroundImage: `url("${e}")`,
865
+ backgroundSize: "cover",
866
+ backgroundPosition: "top center"
867
+ } : {}
985
868
  },
986
- children: he.map((f, C) => {
987
- const b = C === c;
988
- return /* @__PURE__ */ r(
989
- m,
990
- {
991
- component: "button",
992
- type: "button",
993
- onClick: () => l(C),
994
- sx: {
995
- flex: "1 0 auto",
996
- whiteSpace: "nowrap",
997
- border: "none",
998
- cursor: "pointer",
999
- borderRadius: t.full,
1000
- padding: `${n(6, 12)} ${n(12, 12)}`,
1001
- fontFamily: o.primary,
1002
- fontSize: n(12),
1003
- fontWeight: 700,
1004
- backgroundColor: b ? e.primary : "transparent",
1005
- color: b ? e.onPrimary : e.dim
1006
- },
1007
- children: s(Ke[f].title)
1008
- },
1009
- f
1010
- );
1011
- })
869
+ children: e ? null : t
1012
870
  }
1013
- ) : null,
1014
- /* @__PURE__ */ r(
1015
- m,
871
+ ),
872
+ c ? /* @__PURE__ */ n(
873
+ "div",
1016
874
  {
1017
- sx: {
1018
- display: "grid",
1019
- gridTemplateColumns: u ? "1fr" : `repeat(auto-fit,minmax(${n(300)},1fr))`,
1020
- gap: n(12)
1021
- },
1022
- children: h.map((f) => /* @__PURE__ */ r(io, { category: f }, f))
875
+ css: B.teamBadge,
876
+ style: {
877
+ bottom: o(s ? -2 : -3),
878
+ width: o(l),
879
+ height: o(l),
880
+ backgroundImage: `url("${c}")`
881
+ }
1023
882
  }
1024
- )
883
+ ) : null
1025
884
  ] });
1026
- }, B = ({ label: e, home: t, away: o, percent: s, format: i }) => {
1027
- const { colors: a, radius: c } = F(), l = t ?? 0, d = o ?? 0, u = l + d || 1, h = s ? Math.round(l) : l, f = s ? Math.round(d) : d, C = (b) => b == null ? "–" : s ? `${Math.round(b)}%` : i ? i(b) : String(b);
1028
- return /* @__PURE__ */ y(
1029
- m,
1030
- {
1031
- sx: {
1032
- display: "grid",
1033
- gridTemplateColumns: `${n(44)} 1fr ${n(44)}`,
1034
- alignItems: "center",
1035
- gap: n(12)
1036
- },
1037
- children: [
1038
- /* @__PURE__ */ r(
1039
- w,
1040
- {
1041
- size: 14,
1042
- weight: 700,
1043
- font: "secondary",
1044
- color: h > f ? a.text : a.dim,
1045
- sx: { textAlign: "right" },
1046
- children: C(t)
1047
- }
1048
- ),
1049
- /* @__PURE__ */ y(m, { sx: { display: "flex", flexDirection: "column", gap: n(4) }, children: [
1050
- /* @__PURE__ */ r(w, { size: 10, font: "secondary", upper: !0, color: a.dim, sx: { textAlign: "center" }, children: e }),
1051
- /* @__PURE__ */ y(m, { sx: { display: "flex", gap: n(2), height: n(6) }, children: [
1052
- /* @__PURE__ */ r(
1053
- m,
885
+ }, Ro = ({ category: e }) => {
886
+ var _, D, E, x;
887
+ const { data: t, entities: r, label: l, props: c } = oe(), [s, m] = P.useState(!1), u = Tt[e], a = P.useMemo(() => vo(t.athletes, e), [t.athletes, e]), h = Math.min(10, Math.max(1, Math.round(c.playerRankingsRows ?? 5))), b = a.slice(0, s ? 10 : h), f = Te(c.playerCTA), S = (R) => {
888
+ const $ = R.athlete.athleteId, W = r.name($), L = _o[r.position($) ?? ""];
889
+ return {
890
+ id: $,
891
+ name: W,
892
+ photo: r.photo($),
893
+ initial: W.trim().charAt(0),
894
+ team: r.name(R.athlete.teamId),
895
+ teamLogo: r.logo(R.athlete.teamId),
896
+ position: L ? l(L) : "",
897
+ cta: De(c.playerCTA, "player", $)
898
+ };
899
+ }, w = b[0] ? S(b[0]) : null, y = (_ = w == null ? void 0 : w.cta) != null && _.href ? "a" : "div";
900
+ return /* @__PURE__ */ g("div", { css: B.card, children: [
901
+ /* @__PURE__ */ n(
902
+ C,
903
+ {
904
+ component: "div",
905
+ size: 11,
906
+ font: "secondary",
907
+ weight: 700,
908
+ upper: !0,
909
+ color: i.dim,
910
+ style: { padding: `${o(10, 11)} ${o(14, 11)} 0` },
911
+ children: l(u.title)
912
+ }
913
+ ),
914
+ w && b[0] ? /* @__PURE__ */ g(
915
+ y,
916
+ {
917
+ href: ((D = w.cta) == null ? void 0 : D.href) ?? void 0,
918
+ target: (E = w.cta) == null ? void 0 : E.target,
919
+ onClick: (x = w.cta) == null ? void 0 : x.onClick,
920
+ css: f ? B.hero.interactive : B.hero.plain,
921
+ children: [
922
+ /* @__PURE__ */ n(
923
+ st,
924
+ {
925
+ photo: w.photo,
926
+ initial: w.initial,
927
+ size: 60,
928
+ badge: 24,
929
+ teamLogo: w.teamLogo,
930
+ hero: !0
931
+ }
932
+ ),
933
+ /* @__PURE__ */ g("div", { css: B.heroText, children: [
934
+ /* @__PURE__ */ n(C, { component: "div", size: 15, weight: 700, color: i.text, ellipsis: !0, cms: !0, children: w.name }),
935
+ /* @__PURE__ */ n(
936
+ C,
1054
937
  {
1055
- sx: {
1056
- flex: 1,
1057
- display: "flex",
1058
- justifyContent: "flex-end",
1059
- backgroundColor: a.variant,
1060
- borderRadius: `${c.full} 0 0 ${c.full}`,
1061
- overflow: "hidden"
1062
- },
1063
- children: /* @__PURE__ */ r(m, { sx: { width: `${G(l, u)}%`, backgroundColor: a.primary } })
938
+ component: "div",
939
+ size: 11,
940
+ font: "secondary",
941
+ color: i.dim,
942
+ ellipsis: !0,
943
+ cms: !0,
944
+ style: { marginTop: o(2, 11) },
945
+ children: [w.team, w.position].filter(Boolean).join(" · ")
1064
946
  }
1065
947
  ),
1066
- /* @__PURE__ */ r(
1067
- m,
948
+ /* @__PURE__ */ n("div", { css: B.chips, children: u.chips(b[0].athlete, b[0].value, l).map((R) => /* @__PURE__ */ n(
949
+ C,
950
+ {
951
+ size: 10,
952
+ font: "secondary",
953
+ weight: 600,
954
+ color: i.body,
955
+ css: B.chip,
956
+ children: R
957
+ },
958
+ R
959
+ )) })
960
+ ] }),
961
+ /* @__PURE__ */ g("div", { css: B.heroValue, children: [
962
+ /* @__PURE__ */ n(C, { component: "div", size: 32, weight: 700, color: i.primary, style: { lineHeight: 1 }, children: b[0].value }),
963
+ /* @__PURE__ */ n(
964
+ C,
1068
965
  {
1069
- sx: {
1070
- flex: 1,
1071
- backgroundColor: a.variant,
1072
- borderRadius: `0 ${c.full} ${c.full} 0`,
1073
- overflow: "hidden"
1074
- },
1075
- children: /* @__PURE__ */ r(
1076
- m,
1077
- {
1078
- sx: {
1079
- width: `${G(d, u)}%`,
1080
- height: "100%",
1081
- backgroundColor: a.primaryContainer
1082
- }
1083
- }
1084
- )
966
+ component: "div",
967
+ size: 10,
968
+ font: "secondary",
969
+ upper: !0,
970
+ color: i.dim,
971
+ style: { marginTop: o(3, 10) },
972
+ children: l(u.unit)
1085
973
  }
1086
974
  )
1087
975
  ] })
1088
- ] }),
1089
- /* @__PURE__ */ r(w, { size: 14, weight: 700, font: "secondary", color: f > h ? a.text : a.dim, children: C(o) })
1090
- ]
1091
- }
1092
- );
1093
- }, lo = [0, 15, 30, 45, 60, 75, 90], co = 5.5, uo = ({
1094
- x: e,
1095
- top: t,
1096
- logo: o,
1097
- color: s
1098
- }) => {
1099
- const { colors: i } = F();
1100
- return /* @__PURE__ */ r(
1101
- m,
1102
- {
1103
- sx: {
1104
- position: "absolute",
1105
- left: `${e}%`,
1106
- top: t ? "22%" : "78%",
1107
- transform: "translate(-50%,-50%)",
1108
- display: "flex"
1109
- },
1110
- children: /* @__PURE__ */ y(
1111
- m,
976
+ ]
977
+ }
978
+ ) : null,
979
+ b.slice(1).map((R) => {
980
+ var L, z, U, A;
981
+ const $ = S(R), W = (L = $.cta) != null && L.href ? "a" : "div";
982
+ return /* @__PURE__ */ g(
983
+ W,
1112
984
  {
1113
- sx: {
1114
- position: "relative",
1115
- width: n(26),
1116
- height: n(26),
1117
- borderRadius: "50%",
1118
- backgroundColor: i.surface,
1119
- border: `2px solid ${s}`,
1120
- boxShadow: "0 1px 3px rgba(0,0,0,.18)",
1121
- display: "flex",
1122
- alignItems: "center",
1123
- justifyContent: "center"
1124
- },
985
+ href: ((z = $.cta) == null ? void 0 : z.href) ?? void 0,
986
+ target: (U = $.cta) == null ? void 0 : U.target,
987
+ onClick: (A = $.cta) == null ? void 0 : A.onClick,
988
+ css: f ? B.row.interactive : B.row.plain,
1125
989
  children: [
1126
- o ? /* @__PURE__ */ r(
1127
- m,
1128
- {
1129
- component: "img",
1130
- src: o,
1131
- alt: "",
1132
- sx: { width: n(18), height: n(18), objectFit: "contain", display: "block" }
1133
- }
1134
- ) : null,
1135
- /* @__PURE__ */ r(
1136
- m,
1137
- {
1138
- sx: {
1139
- position: "absolute",
1140
- right: n(-6),
1141
- bottom: n(-6),
1142
- width: n(14),
1143
- height: n(14),
1144
- borderRadius: "50%",
1145
- backgroundColor: i.surface,
1146
- border: `1px solid ${i.border}`,
1147
- display: "flex",
1148
- alignItems: "center",
1149
- justifyContent: "center",
1150
- color: i.text
1151
- },
1152
- children: /* @__PURE__ */ y(
1153
- "svg",
1154
- {
1155
- width: "0.5625em",
1156
- height: "0.5625em",
1157
- viewBox: "0 0 24 24",
1158
- fill: "none",
1159
- stroke: "currentColor",
1160
- strokeWidth: "2.4",
1161
- strokeLinecap: "round",
1162
- strokeLinejoin: "round",
1163
- children: [
1164
- /* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "10" }),
1165
- /* @__PURE__ */ r("path", { d: "m12 7 4.5 3.3-1.7 5.4H9.2L7.5 10.3z" })
1166
- ]
1167
- }
1168
- )
1169
- }
1170
- )
990
+ /* @__PURE__ */ n(C, { size: 12, font: "secondary", weight: 700, color: i.dim, children: R.rank }),
991
+ /* @__PURE__ */ n(st, { photo: $.photo, initial: $.initial, size: 32, badge: 16, teamLogo: $.teamLogo }),
992
+ /* @__PURE__ */ g("div", { css: B.rowText, children: [
993
+ /* @__PURE__ */ n(C, { component: "div", size: 13, weight: 600, color: i.text, ellipsis: !0, cms: !0, children: $.name }),
994
+ /* @__PURE__ */ n(C, { component: "div", size: 11, font: "secondary", color: i.dim, ellipsis: !0, children: u.secondary(R.athlete, R.value, l).join(" · ") })
995
+ ] }),
996
+ /* @__PURE__ */ n(C, { size: 16, weight: 700, color: i.primary, children: R.value })
1171
997
  ]
1172
- }
1173
- )
1174
- }
1175
- );
1176
- }, po = ({ match: e }) => {
1177
- const { colors: t } = F(), { entities: o, label: s } = Y(), i = o.logo(e.home.id), a = o.logo(e.away.id), [c, l] = e.fullTime ?? [0, 0], d = [];
1178
- return e.home.goalsByPeriod.forEach((u, h) => {
1179
- const f = (g, $) => (h * 15 + 7.5 + ($ - (g - 1) / 2) * co) / 90 * 100, C = e.home.goalsByPeriod[h] ?? 0, b = e.away.goalsByPeriod[h] ?? 0;
1180
- for (let g = 0; g < C; g += 1) d.push({ x: f(C, g), top: !0, key: `h${h}-${g}` });
1181
- for (let g = 0; g < b; g += 1) d.push({ x: f(b, g), top: !1, key: `a${h}-${g}` });
1182
- }), /* @__PURE__ */ y(ye, { children: [
1183
- /* @__PURE__ */ r(B, { label: s("possession"), home: e.home.possession, away: e.away.possession, percent: !0 }),
1184
- /* @__PURE__ */ r(B, { label: s("shotsOnTarget"), home: e.home.shotsOnTarget, away: e.away.shotsOnTarget }),
1185
- /* @__PURE__ */ r(B, { label: s("corners"), home: e.home.corners, away: e.away.corners }),
1186
- /* @__PURE__ */ r(B, { label: s("yellowCards"), home: e.home.yellowCards, away: e.away.yellowCards }),
1187
- /* @__PURE__ */ r(B, { label: s("redCards"), home: e.home.redCards, away: e.away.redCards }),
1188
- /* @__PURE__ */ y(
1189
- m,
998
+ },
999
+ $.id
1000
+ );
1001
+ }),
1002
+ a.length > h ? /* @__PURE__ */ n("button", { type: "button", onClick: () => m(!s), css: B.showAll, children: s ? l("showLess") : l("showAll", { count: a.length }) }) : null
1003
+ ] });
1004
+ }, Eo = () => {
1005
+ const { label: e, props: t } = oe(), r = _e(), [l, c] = P.useState(0), s = t.playerRankingsLayout ?? "auto", m = s === "tabs" || s === "auto" && r, u = m ? [ze[l]] : ze;
1006
+ return /* @__PURE__ */ g("div", { css: B.section, children: [
1007
+ /* @__PURE__ */ n(It, { children: e("leadersTitle") }),
1008
+ m ? /* @__PURE__ */ n(Ae, { variant: "pill", gap: 4, children: ze.map((a, h) => /* @__PURE__ */ n(
1009
+ "button",
1010
+ {
1011
+ type: "button",
1012
+ onClick: () => c(h),
1013
+ css: h === l ? B.tab.on : B.tab.off,
1014
+ children: e(Tt[a].title)
1015
+ },
1016
+ a
1017
+ )) }) : null,
1018
+ /* @__PURE__ */ n(
1019
+ "div",
1190
1020
  {
1191
- sx: {
1192
- display: "grid",
1193
- gridTemplateColumns: `${n(44)} 1fr ${n(44)}`,
1194
- alignItems: "center",
1195
- gap: n(12),
1196
- marginTop: n(4)
1021
+ css: B.grid,
1022
+ style: {
1023
+ gridTemplateColumns: m ? "1fr" : `repeat(auto-fit,minmax(${o(300)},1fr))`
1197
1024
  },
1198
- children: [
1199
- /* @__PURE__ */ r(H, { url: i, size: 30, sx: { justifySelf: "end" } }),
1200
- /* @__PURE__ */ y(m, { sx: { position: "relative", height: n(84), gridColumn: 2 }, children: [
1201
- /* @__PURE__ */ r(
1202
- m,
1025
+ children: u.map((a) => /* @__PURE__ */ n(Ro, { category: a }, a))
1026
+ }
1027
+ )
1028
+ ] });
1029
+ }, ie = {
1030
+ root: d({
1031
+ display: "grid",
1032
+ gridTemplateColumns: `${o(44)} 1fr ${o(44)}`,
1033
+ alignItems: "center",
1034
+ gap: o(12)
1035
+ }),
1036
+ homeValue: d({ textAlign: "right" }),
1037
+ middle: d({ display: "flex", flexDirection: "column", gap: o(4) }),
1038
+ bars: d({ display: "flex", gap: o(2), height: o(6) }),
1039
+ homeTrack: d({
1040
+ flex: 1,
1041
+ display: "flex",
1042
+ justifyContent: "flex-end",
1043
+ backgroundColor: i.variant,
1044
+ borderRadius: `${i.radiusFull} 0 0 ${i.radiusFull}`,
1045
+ overflow: "hidden"
1046
+ }),
1047
+ homeFill: d({ backgroundColor: i.primary }),
1048
+ awayTrack: d({
1049
+ flex: 1,
1050
+ backgroundColor: i.variant,
1051
+ borderRadius: `0 ${i.radiusFull} ${i.radiusFull} 0`,
1052
+ overflow: "hidden"
1053
+ }),
1054
+ awayFill: d({ height: "100%", backgroundColor: i.primaryContainer })
1055
+ }, K = ({ label: e, home: t, away: r, percent: l, format: c }) => {
1056
+ const s = t ?? 0, m = r ?? 0, u = s + m || 1, a = l ? Math.round(s) : s, h = l ? Math.round(m) : m, b = (f) => f == null ? "–" : l ? `${Math.round(f)}%` : c ? c(f) : String(f);
1057
+ return /* @__PURE__ */ g("div", { css: ie.root, children: [
1058
+ /* @__PURE__ */ n(
1059
+ C,
1060
+ {
1061
+ size: 14,
1062
+ weight: 700,
1063
+ font: "secondary",
1064
+ color: a > h ? i.text : i.dim,
1065
+ css: ie.homeValue,
1066
+ children: b(t)
1067
+ }
1068
+ ),
1069
+ /* @__PURE__ */ g("div", { css: ie.middle, children: [
1070
+ /* @__PURE__ */ n(C, { size: 10, font: "secondary", upper: !0, color: i.dim, style: { textAlign: "center" }, children: e }),
1071
+ /* @__PURE__ */ g("div", { css: ie.bars, children: [
1072
+ /* @__PURE__ */ n("div", { css: ie.homeTrack, children: /* @__PURE__ */ n("div", { css: ie.homeFill, style: { width: `${Y(s, u)}%` } }) }),
1073
+ /* @__PURE__ */ n("div", { css: ie.awayTrack, children: /* @__PURE__ */ n("div", { css: ie.awayFill, style: { width: `${Y(m, u)}%` } }) })
1074
+ ] })
1075
+ ] }),
1076
+ /* @__PURE__ */ n(C, { size: 14, weight: 700, font: "secondary", color: h > a ? i.text : i.dim, children: b(r) })
1077
+ ] });
1078
+ }, Mo = [0, 15, 30, 45, 60, 75, 90], zo = 5.5, Pe = (e) => ({ "--fu-ucrc-cs-x": `${e}%` }), q = {
1079
+ mark: d({
1080
+ position: "absolute",
1081
+ left: "var(--fu-ucrc-cs-x)",
1082
+ transform: "translate(-50%,-50%)",
1083
+ display: "flex"
1084
+ }),
1085
+ ring: d({
1086
+ position: "relative",
1087
+ width: o(26),
1088
+ height: o(26),
1089
+ borderRadius: "50%",
1090
+ backgroundColor: i.surface,
1091
+ borderWidth: "2px",
1092
+ borderStyle: "solid",
1093
+ boxShadow: "0 1px 3px rgba(0,0,0,.18)",
1094
+ display: "flex",
1095
+ alignItems: "center",
1096
+ justifyContent: "center"
1097
+ }),
1098
+ logo: d({ width: o(18), height: o(18), objectFit: "contain", display: "block" }),
1099
+ ball: d({
1100
+ position: "absolute",
1101
+ right: o(-6),
1102
+ bottom: o(-6),
1103
+ width: o(14),
1104
+ height: o(14),
1105
+ borderRadius: "50%",
1106
+ backgroundColor: i.surface,
1107
+ border: `1px solid ${i.border}`,
1108
+ display: "flex",
1109
+ alignItems: "center",
1110
+ justifyContent: "center",
1111
+ color: i.text
1112
+ }),
1113
+ timeline: d({
1114
+ display: "grid",
1115
+ gridTemplateColumns: `${o(44)} 1fr ${o(44)}`,
1116
+ alignItems: "center",
1117
+ gap: o(12),
1118
+ marginTop: o(4)
1119
+ }),
1120
+ homeCrest: d({ justifySelf: "end" }),
1121
+ awayCrest: d({ justifySelf: "start", gridColumn: 3 }),
1122
+ track: d({ position: "relative", height: o(84), gridColumn: 2 }),
1123
+ axis: d({
1124
+ position: "absolute",
1125
+ left: 0,
1126
+ right: 0,
1127
+ top: "50%",
1128
+ height: "2px",
1129
+ backgroundColor: i.border,
1130
+ transform: "translateY(-50%)"
1131
+ }),
1132
+ tick: d({
1133
+ position: "absolute",
1134
+ left: "var(--fu-ucrc-cs-x)",
1135
+ top: "50%",
1136
+ transform: "translate(-50%,-50%)",
1137
+ borderRadius: "1px"
1138
+ }),
1139
+ tickLabel: d({
1140
+ position: "absolute",
1141
+ left: "var(--fu-ucrc-cs-x)",
1142
+ bottom: 0,
1143
+ transform: "translateX(-50%)",
1144
+ whiteSpace: "nowrap"
1145
+ }),
1146
+ noGoals: d({
1147
+ position: "absolute",
1148
+ left: "50%",
1149
+ top: o(14, 11),
1150
+ transform: "translateX(-50%)"
1151
+ })
1152
+ }, Lo = ({
1153
+ x: e,
1154
+ top: t,
1155
+ logo: r,
1156
+ color: l
1157
+ }) => /* @__PURE__ */ n("div", { css: q.mark, style: { ...Pe(e), top: t ? "22%" : "78%" }, children: /* @__PURE__ */ g("div", { css: q.ring, style: { borderColor: l }, children: [
1158
+ r ? /* @__PURE__ */ n("img", { src: r, alt: "", css: q.logo }) : null,
1159
+ /* @__PURE__ */ n("div", { css: q.ball, children: /* @__PURE__ */ g(
1160
+ "svg",
1161
+ {
1162
+ width: "0.5625em",
1163
+ height: "0.5625em",
1164
+ viewBox: "0 0 24 24",
1165
+ fill: "none",
1166
+ stroke: "currentColor",
1167
+ strokeWidth: "2.4",
1168
+ strokeLinecap: "round",
1169
+ strokeLinejoin: "round",
1170
+ children: [
1171
+ /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "10" }),
1172
+ /* @__PURE__ */ n("path", { d: "m12 7 4.5 3.3-1.7 5.4H9.2L7.5 10.3z" })
1173
+ ]
1174
+ }
1175
+ ) })
1176
+ ] }) }), Do = ({ match: e }) => {
1177
+ const { entities: t, label: r } = oe(), l = t.logo(e.home.id), c = t.logo(e.away.id), [s, m] = e.fullTime ?? [0, 0], u = [];
1178
+ return e.home.goalsByPeriod.forEach((a, h) => {
1179
+ const b = (w, y) => (h * 15 + 7.5 + (y - (w - 1) / 2) * zo) / 90 * 100, f = e.home.goalsByPeriod[h] ?? 0, S = e.away.goalsByPeriod[h] ?? 0;
1180
+ for (let w = 0; w < f; w += 1) u.push({ x: b(f, w), top: !0, key: `h${h}-${w}` });
1181
+ for (let w = 0; w < S; w += 1) u.push({ x: b(S, w), top: !1, key: `a${h}-${w}` });
1182
+ }), /* @__PURE__ */ g(fe, { children: [
1183
+ /* @__PURE__ */ n(K, { label: r("possession"), home: e.home.possession, away: e.away.possession, percent: !0 }),
1184
+ /* @__PURE__ */ n(K, { label: r("shotsOnTarget"), home: e.home.shotsOnTarget, away: e.away.shotsOnTarget }),
1185
+ /* @__PURE__ */ n(K, { label: r("corners"), home: e.home.corners, away: e.away.corners }),
1186
+ /* @__PURE__ */ n(K, { label: r("yellowCards"), home: e.home.yellowCards, away: e.away.yellowCards }),
1187
+ /* @__PURE__ */ n(K, { label: r("redCards"), home: e.home.redCards, away: e.away.redCards }),
1188
+ /* @__PURE__ */ g("div", { css: q.timeline, children: [
1189
+ /* @__PURE__ */ n(V, { url: l, size: 30, css: q.homeCrest }),
1190
+ /* @__PURE__ */ g("div", { css: q.track, children: [
1191
+ /* @__PURE__ */ n("div", { css: q.axis }),
1192
+ Mo.map((a) => {
1193
+ const h = a === 45, b = h ? i.text : i.dim;
1194
+ return /* @__PURE__ */ g(P.Fragment, { children: [
1195
+ /* @__PURE__ */ n(
1196
+ "div",
1203
1197
  {
1204
- sx: {
1205
- position: "absolute",
1206
- left: 0,
1207
- right: 0,
1208
- top: "50%",
1209
- height: "2px",
1210
- backgroundColor: t.border,
1211
- transform: "translateY(-50%)"
1198
+ css: q.tick,
1199
+ style: {
1200
+ ...Pe(a / 90 * 100),
1201
+ width: h ? "2px" : "1px",
1202
+ height: o(h ? 14 : 8),
1203
+ backgroundColor: b
1212
1204
  }
1213
1205
  }
1214
1206
  ),
1215
- lo.map((u) => {
1216
- const h = u === 45, f = h ? t.text : t.dim;
1217
- return /* @__PURE__ */ y(L.Fragment, { children: [
1218
- /* @__PURE__ */ r(
1219
- m,
1220
- {
1221
- sx: {
1222
- position: "absolute",
1223
- left: `${u / 90 * 100}%`,
1224
- top: "50%",
1225
- transform: "translate(-50%,-50%)",
1226
- width: h ? "2px" : "1px",
1227
- height: n(h ? 14 : 8),
1228
- backgroundColor: f,
1229
- borderRadius: "1px"
1230
- }
1231
- }
1232
- ),
1233
- /* @__PURE__ */ r(
1234
- w,
1235
- {
1236
- size: 10,
1237
- font: "secondary",
1238
- weight: h ? 700 : 400,
1239
- color: f,
1240
- sx: {
1241
- position: "absolute",
1242
- left: `${u / 90 * 100}%`,
1243
- bottom: 0,
1244
- transform: "translateX(-50%)",
1245
- whiteSpace: "nowrap"
1246
- },
1247
- children: h ? s("halfTimeShort") : s("minuteTick", { minute: u })
1248
- }
1249
- )
1250
- ] }, u);
1251
- }),
1252
- d.map((u) => /* @__PURE__ */ r(
1253
- uo,
1254
- {
1255
- x: u.x,
1256
- top: u.top,
1257
- logo: u.top ? i : a,
1258
- color: u.top ? t.primary : t.primaryContainer
1259
- },
1260
- u.key
1261
- )),
1262
- c + l === 0 ? /* @__PURE__ */ r(
1263
- w,
1207
+ /* @__PURE__ */ n(
1208
+ C,
1264
1209
  {
1265
- size: 11,
1210
+ size: 10,
1266
1211
  font: "secondary",
1267
- color: t.dim,
1268
- sx: {
1269
- position: "absolute",
1270
- left: "50%",
1271
- top: n(14, 11),
1272
- transform: "translateX(-50%)"
1273
- },
1274
- children: s("noGoals")
1212
+ weight: h ? 700 : 400,
1213
+ color: b,
1214
+ css: q.tickLabel,
1215
+ style: Pe(a / 90 * 100),
1216
+ children: h ? r("halfTimeShort") : r("minuteTick", { minute: a })
1275
1217
  }
1276
- ) : null
1277
- ] }),
1278
- /* @__PURE__ */ r(H, { url: a, size: 30, sx: { justifySelf: "start", gridColumn: 3 } })
1279
- ]
1280
- }
1281
- )
1218
+ )
1219
+ ] }, a);
1220
+ }),
1221
+ u.map((a) => /* @__PURE__ */ n(
1222
+ Lo,
1223
+ {
1224
+ x: a.x,
1225
+ top: a.top,
1226
+ logo: a.top ? l : c,
1227
+ color: a.top ? i.primary : i.primaryContainer
1228
+ },
1229
+ a.key
1230
+ )),
1231
+ s + m === 0 ? /* @__PURE__ */ n(
1232
+ C,
1233
+ {
1234
+ size: 11,
1235
+ font: "secondary",
1236
+ color: i.dim,
1237
+ css: q.noGoals,
1238
+ children: r("noGoals")
1239
+ }
1240
+ ) : null
1241
+ ] }),
1242
+ /* @__PURE__ */ n(V, { url: c, size: 30, css: q.awayCrest })
1243
+ ] })
1282
1244
  ] });
1283
- }, mo = { W: "formWin", D: "formDraw", L: "formLoss" }, Le = ({ entry: e, side: t }) => {
1284
- const { colors: o, radius: s } = F(), { entities: i, label: a, fmt: c } = Y(), [l, d] = L.useState(!1), { match: u, result: h } = e, f = { W: o.success, D: o.variant, L: o.danger }[h], C = t === "away" ? { right: n(-4) } : { left: n(-4) }, b = t === "away" ? { right: n(10) } : { left: n(10) }, [g, $] = u.fullTime ?? [0, 0], S = (W, k) => /* @__PURE__ */ y(
1285
- m,
1286
- {
1287
- sx: {
1288
- display: "flex",
1289
- alignItems: "center",
1290
- gap: n(6),
1291
- minWidth: 0,
1292
- ...k ? { flexDirection: "row-reverse" } : {}
1293
- },
1294
- children: [
1295
- /* @__PURE__ */ r(H, { url: i.logo(W), size: 22 }),
1296
- /* @__PURE__ */ r(w, { size: 12, weight: 600, ellipsis: !0, cms: !0, sx: k ? { textAlign: "end" } : void 0, children: i.name(W) })
1297
- ]
1298
- }
1299
- );
1300
- return /* @__PURE__ */ y(
1301
- m,
1245
+ }, Ao = { W: "formWin", D: "formDraw", L: "formLoss" }, Po = { W: i.success, D: i.variant, L: i.danger }, nt = (e) => d({
1246
+ position: "absolute",
1247
+ bottom: `calc(100% + ${o(10)})`,
1248
+ ...e === "away" ? { right: o(-4) } : { left: o(-4) },
1249
+ zIndex: 50,
1250
+ width: o(240),
1251
+ backgroundColor: i.surface,
1252
+ color: i.text,
1253
+ borderRadius: i.radiusSm,
1254
+ padding: `${o(8)} ${o(10)}`,
1255
+ boxShadow: "0 6px 20px rgba(33,33,33,.18)",
1256
+ display: "flex",
1257
+ flexDirection: "column",
1258
+ gap: o(6),
1259
+ pointerEvents: "none"
1260
+ }), it = (e) => d({
1261
+ position: "absolute",
1262
+ top: "100%",
1263
+ ...e === "away" ? { right: o(10) } : { left: o(10) },
1264
+ border: `${o(6)} solid transparent`,
1265
+ borderTopColor: i.surface
1266
+ }), at = (e) => d({
1267
+ display: "flex",
1268
+ alignItems: "center",
1269
+ gap: o(6),
1270
+ minWidth: 0,
1271
+ ...e ? { flexDirection: "row-reverse" } : {}
1272
+ }), lt = (e) => d({
1273
+ width: o(e, 11),
1274
+ height: o(e, 11),
1275
+ borderRadius: `calc(${i.radiusSm} - 2px)`,
1276
+ display: "inline-flex",
1277
+ alignItems: "center",
1278
+ justifyContent: "center",
1279
+ cursor: "help",
1280
+ outlineOffset: "1px"
1281
+ }), te = {
1282
+ root: d({ position: "relative", display: "flex" }),
1283
+ badge: { regular: lt(24), compact: lt(20) },
1284
+ tooltip: { home: nt("home"), away: nt("away") },
1285
+ arrow: { home: it("home"), away: it("away") },
1286
+ teams: d({
1287
+ display: "grid",
1288
+ gridTemplateColumns: "minmax(0,1fr) auto minmax(0,1fr)",
1289
+ alignItems: "center",
1290
+ gap: o(8)
1291
+ }),
1292
+ teamCell: { home: at(!1), away: at(!0) },
1293
+ alignEnd: d({ textAlign: "end" })
1294
+ }, Fo = ({ entry: e, side: t, compact: r }) => {
1295
+ const { entities: l, label: c, fmt: s } = oe(), [m, u] = P.useState(!1), { match: a, result: h } = e, [b, f] = a.fullTime ?? [0, 0], S = (w, y) => /* @__PURE__ */ g("div", { css: y ? te.teamCell.away : te.teamCell.home, children: [
1296
+ /* @__PURE__ */ n(V, { url: l.logo(w), size: 22 }),
1297
+ /* @__PURE__ */ n(C, { size: 12, weight: 600, ellipsis: !0, cms: !0, css: y ? te.alignEnd : void 0, children: l.name(w) })
1298
+ ] });
1299
+ return /* @__PURE__ */ g(
1300
+ "div",
1302
1301
  {
1303
- onMouseEnter: () => d(!0),
1304
- onMouseLeave: () => d(!1),
1305
- sx: { position: "relative", display: "flex" },
1302
+ onMouseEnter: () => u(!0),
1303
+ onMouseLeave: () => u(!1),
1304
+ css: te.root,
1306
1305
  children: [
1307
- /* @__PURE__ */ r(
1308
- w,
1306
+ /* @__PURE__ */ n(
1307
+ C,
1309
1308
  {
1310
1309
  size: 11,
1311
1310
  font: "secondary",
1312
1311
  weight: 700,
1313
- color: h === "D" ? o.body : o.onPrimary,
1314
- sx: {
1315
- width: n(24, 11),
1316
- height: n(24, 11),
1317
- borderRadius: `calc(${s.sm} - 2px)`,
1318
- display: "inline-flex",
1319
- alignItems: "center",
1320
- justifyContent: "center",
1321
- backgroundColor: f,
1322
- cursor: "help",
1323
- outline: `2px solid ${l ? o.primary : "transparent"}`,
1324
- outlineOffset: "1px"
1312
+ color: h === "D" ? i.body : i.onPrimary,
1313
+ css: r ? te.badge.compact : te.badge.regular,
1314
+ style: {
1315
+ backgroundColor: Po[h],
1316
+ outline: `2px solid ${m ? i.primary : "transparent"}`
1325
1317
  },
1326
- children: a(mo[h])
1318
+ children: c(Ao[h])
1327
1319
  }
1328
1320
  ),
1329
- l ? /* @__PURE__ */ y(
1330
- m,
1331
- {
1332
- sx: {
1333
- position: "absolute",
1334
- bottom: `calc(100% + ${n(10)})`,
1335
- ...C,
1336
- zIndex: 50,
1337
- width: n(240),
1338
- backgroundColor: o.surface,
1339
- color: o.text,
1340
- borderRadius: s.sm,
1341
- padding: `${n(8)} ${n(10)}`,
1342
- boxShadow: "0 6px 20px rgba(33,33,33,.18)",
1343
- display: "flex",
1344
- flexDirection: "column",
1345
- gap: n(6),
1346
- pointerEvents: "none"
1347
- },
1348
- children: [
1349
- /* @__PURE__ */ r(w, { size: 11, font: "secondary", weight: 500, color: o.dim, sx: { textAlign: "center" }, children: a("formMeta", {
1350
- round: u.round,
1351
- date: c.date(u.start, { day: "numeric", month: "long", year: "numeric" })
1352
- }) }),
1353
- /* @__PURE__ */ y(
1354
- m,
1355
- {
1356
- sx: {
1357
- display: "grid",
1358
- gridTemplateColumns: "minmax(0,1fr) auto minmax(0,1fr)",
1359
- alignItems: "center",
1360
- gap: n(8)
1361
- },
1362
- children: [
1363
- S(u.home.id, !1),
1364
- /* @__PURE__ */ r(w, { size: 15, weight: 700, sx: { whiteSpace: "nowrap", fontVariantNumeric: "tabular-nums" }, children: `${g} – ${$}` }),
1365
- S(u.away.id, !0)
1366
- ]
1367
- }
1368
- ),
1369
- /* @__PURE__ */ r(
1370
- m,
1371
- {
1372
- component: "span",
1373
- sx: {
1374
- position: "absolute",
1375
- top: "100%",
1376
- ...b,
1377
- border: `${n(6)} solid transparent`,
1378
- borderTopColor: o.surface
1379
- }
1380
- }
1381
- )
1382
- ]
1383
- }
1384
- ) : null
1385
- ]
1386
- }
1387
- );
1388
- }, ho = ({ match: e }) => {
1389
- var g, $;
1390
- const { colors: t } = F(), { data: o, entities: s, finished: i, tally: a, label: c, fmt: l } = Y(), d = o.teamStats.get(e.home.id), u = o.teamStats.get(e.away.id), h = Yt(i, e), f = ze(i, e.home.id, e.start), C = ze(i, e.away.id, e.start), b = (S) => l.decimal(S, 1);
1391
- return /* @__PURE__ */ y(ye, { children: [
1392
- /* @__PURE__ */ y(
1393
- m,
1394
- {
1395
- sx: {
1396
- display: "grid",
1397
- gridTemplateColumns: `${n(44)} 1fr ${n(44)}`,
1398
- alignItems: "center",
1399
- gap: n(12)
1400
- },
1401
- children: [
1402
- /* @__PURE__ */ r(H, { url: s.logo(e.home.id), size: 30, sx: { justifySelf: "end" } }),
1403
- /* @__PURE__ */ y(
1404
- m,
1321
+ m ? /* @__PURE__ */ g("div", { css: te.tooltip[t], children: [
1322
+ /* @__PURE__ */ n(
1323
+ C,
1405
1324
  {
1406
- sx: {
1407
- gridColumn: 2,
1408
- display: "flex",
1409
- justifyContent: "space-between",
1410
- alignItems: "center",
1411
- gap: n(12)
1412
- },
1413
- children: [
1414
- /* @__PURE__ */ r(m, { sx: { display: "flex", gap: n(4) }, children: f.map((S) => /* @__PURE__ */ r(Le, { entry: S, side: "home" }, S.match.id)) }),
1415
- /* @__PURE__ */ r(w, { size: 10, font: "secondary", upper: !0, color: t.dim, sx: { textAlign: "center" }, children: c("formLast5") }),
1416
- /* @__PURE__ */ r(m, { sx: { display: "flex", gap: n(4) }, children: C.map((S) => /* @__PURE__ */ r(Le, { entry: S, side: "away" }, S.match.id)) })
1417
- ]
1325
+ size: 11,
1326
+ font: "secondary",
1327
+ weight: 500,
1328
+ color: i.dim,
1329
+ style: { textAlign: "center" },
1330
+ children: c("formMeta", {
1331
+ round: a.round,
1332
+ date: s.date(a.start, { day: "numeric", month: "long", year: "numeric" })
1333
+ })
1418
1334
  }
1419
1335
  ),
1420
- /* @__PURE__ */ r(
1421
- H,
1422
- {
1423
- url: s.logo(e.away.id),
1424
- size: 30,
1425
- sx: { justifySelf: "start", gridColumn: 3 }
1426
- }
1427
- )
1428
- ]
1429
- }
1430
- ),
1431
- /* @__PURE__ */ r(B, { label: c("wins"), home: (d == null ? void 0 : d.won) ?? null, away: (u == null ? void 0 : u.won) ?? null }),
1432
- /* @__PURE__ */ r(B, { label: c("draws"), home: (d == null ? void 0 : d.draw) ?? null, away: (u == null ? void 0 : u.draw) ?? null }),
1433
- /* @__PURE__ */ r(B, { label: c("losses"), home: (d == null ? void 0 : d.lost) ?? null, away: (u == null ? void 0 : u.lost) ?? null }),
1434
- /* @__PURE__ */ r(B, { label: c("goalsScored"), home: (d == null ? void 0 : d.goalsScored) ?? null, away: (u == null ? void 0 : u.goalsScored) ?? null }),
1435
- /* @__PURE__ */ r(B, { label: c("goalsConceded"), home: (d == null ? void 0 : d.goalsAllowed) ?? null, away: (u == null ? void 0 : u.goalsAllowed) ?? null }),
1436
- /* @__PURE__ */ r(
1437
- B,
1336
+ /* @__PURE__ */ g("div", { css: te.teams, children: [
1337
+ S(a.home.id, !1),
1338
+ /* @__PURE__ */ n(
1339
+ C,
1340
+ {
1341
+ size: 15,
1342
+ weight: 700,
1343
+ style: { whiteSpace: "nowrap", fontVariantNumeric: "tabular-nums" },
1344
+ children: `${b} – ${f}`
1345
+ }
1346
+ ),
1347
+ S(a.away.id, !0)
1348
+ ] }),
1349
+ /* @__PURE__ */ n("span", { css: te.arrow[t] })
1350
+ ] }) : null
1351
+ ]
1352
+ }
1353
+ );
1354
+ }, X = {
1355
+ form: d({
1356
+ display: "grid",
1357
+ gridTemplateColumns: `${o(44)} 1fr ${o(44)}`,
1358
+ alignItems: "center",
1359
+ gap: o(12)
1360
+ }),
1361
+ homeCrest: d({ justifySelf: "end" }),
1362
+ awayCrest: d({ justifySelf: "start", gridColumn: 3 }),
1363
+ formRow: d({
1364
+ gridColumn: 2,
1365
+ display: "flex",
1366
+ justifyContent: "space-between",
1367
+ alignItems: "center",
1368
+ gap: o(12)
1369
+ }),
1370
+ badges: d({ display: "flex", gap: o(4) }),
1371
+ // Narrow: the label on its own line, each team's crest beside its badges.
1372
+ formStacked: d({ display: "flex", flexDirection: "column", alignItems: "center", gap: o(8) }),
1373
+ formLine: d({
1374
+ alignSelf: "stretch",
1375
+ display: "flex",
1376
+ justifyContent: "space-between",
1377
+ alignItems: "center",
1378
+ gap: o(8)
1379
+ }),
1380
+ side: d({ display: "flex", alignItems: "center", gap: o(6) }),
1381
+ strong: d({ color: i.text }),
1382
+ cms: d({ unicodeBidi: "plaintext" })
1383
+ }, Wo = ({ match: e }) => {
1384
+ var D, E;
1385
+ const { data: t, entities: r, finished: l, tally: c, label: s, fmt: m } = oe(), u = t.teamStats.get(e.home.id), a = t.teamStats.get(e.away.id), h = yo(l, e), b = Je(l, e.home.id, e.start), f = Je(l, e.away.id, e.start), S = (x) => m.decimal(x, 1), w = _e(), y = /* @__PURE__ */ n(C, { size: 10, font: "secondary", upper: !0, color: i.dim, style: { textAlign: "center" }, children: s("formLast5") }), _ = (x, R) => /* @__PURE__ */ n("div", { css: X.badges, children: x.map(($) => /* @__PURE__ */ n(Fo, { entry: $, side: R, compact: w }, $.match.id)) });
1386
+ return /* @__PURE__ */ g(fe, { children: [
1387
+ w ? /* @__PURE__ */ g("div", { css: X.formStacked, children: [
1388
+ y,
1389
+ /* @__PURE__ */ g("div", { css: X.formLine, children: [
1390
+ /* @__PURE__ */ g("div", { css: X.side, children: [
1391
+ /* @__PURE__ */ n(V, { url: r.logo(e.home.id), size: 20 }),
1392
+ _(b, "home")
1393
+ ] }),
1394
+ /* @__PURE__ */ g("div", { css: X.side, children: [
1395
+ _(f, "away"),
1396
+ /* @__PURE__ */ n(V, { url: r.logo(e.away.id), size: 20 })
1397
+ ] })
1398
+ ] })
1399
+ ] }) : /* @__PURE__ */ g("div", { css: X.form, children: [
1400
+ /* @__PURE__ */ n(V, { url: r.logo(e.home.id), size: 30, css: X.homeCrest }),
1401
+ /* @__PURE__ */ g("div", { css: X.formRow, children: [
1402
+ _(b, "home"),
1403
+ y,
1404
+ _(f, "away")
1405
+ ] }),
1406
+ /* @__PURE__ */ n(V, { url: r.logo(e.away.id), size: 30, css: X.awayCrest })
1407
+ ] }),
1408
+ /* @__PURE__ */ n(K, { label: s("wins"), home: (u == null ? void 0 : u.won) ?? null, away: (a == null ? void 0 : a.won) ?? null }),
1409
+ /* @__PURE__ */ n(K, { label: s("draws"), home: (u == null ? void 0 : u.draw) ?? null, away: (a == null ? void 0 : a.draw) ?? null }),
1410
+ /* @__PURE__ */ n(K, { label: s("losses"), home: (u == null ? void 0 : u.lost) ?? null, away: (a == null ? void 0 : a.lost) ?? null }),
1411
+ /* @__PURE__ */ n(K, { label: s("goalsScored"), home: (u == null ? void 0 : u.goalsScored) ?? null, away: (a == null ? void 0 : a.goalsScored) ?? null }),
1412
+ /* @__PURE__ */ n(K, { label: s("goalsConceded"), home: (u == null ? void 0 : u.goalsAllowed) ?? null, away: (a == null ? void 0 : a.goalsAllowed) ?? null }),
1413
+ /* @__PURE__ */ n(
1414
+ K,
1438
1415
  {
1439
- label: c("goalsPerMatch"),
1440
- home: (d == null ? void 0 : d.avgTotalGoals) != null ? Number(d.avgTotalGoals.toFixed(1)) : null,
1441
- away: (u == null ? void 0 : u.avgTotalGoals) != null ? Number(u.avgTotalGoals.toFixed(1)) : null,
1442
- format: b
1416
+ label: s("goalsPerMatch"),
1417
+ home: (u == null ? void 0 : u.avgTotalGoals) != null ? Number(u.avgTotalGoals.toFixed(1)) : null,
1418
+ away: (a == null ? void 0 : a.avgTotalGoals) != null ? Number(a.avgTotalGoals.toFixed(1)) : null,
1419
+ format: S
1443
1420
  }
1444
1421
  ),
1445
- /* @__PURE__ */ r(B, { label: c("homeAwayWins"), home: (d == null ? void 0 : d.homeWon) ?? null, away: (u == null ? void 0 : u.awayWon) ?? null }),
1446
- /* @__PURE__ */ r(
1447
- B,
1422
+ /* @__PURE__ */ n(K, { label: s("homeAwayWins"), home: (u == null ? void 0 : u.homeWon) ?? null, away: (a == null ? void 0 : a.awayWon) ?? null }),
1423
+ /* @__PURE__ */ n(
1424
+ K,
1448
1425
  {
1449
- label: c("cleanSheets"),
1450
- home: ((g = a.get(e.home.id)) == null ? void 0 : g.cleanSheets) ?? 0,
1451
- away: (($ = a.get(e.away.id)) == null ? void 0 : $.cleanSheets) ?? 0
1426
+ label: s("cleanSheets"),
1427
+ home: ((D = c.get(e.home.id)) == null ? void 0 : D.cleanSheets) ?? 0,
1428
+ away: ((E = c.get(e.away.id)) == null ? void 0 : E.cleanSheets) ?? 0
1452
1429
  }
1453
1430
  ),
1454
- h != null && h.fullTime ? /* @__PURE__ */ y(w, { component: "div", size: 11, font: "secondary", color: t.dim, children: [
1455
- c("previousMeeting"),
1431
+ h != null && h.fullTime ? /* @__PURE__ */ g(C, { component: "div", size: 11, font: "secondary", color: i.dim, children: [
1432
+ s("previousMeeting"),
1456
1433
  " ",
1457
- /* @__PURE__ */ y(m, { component: "b", sx: { color: t.text }, children: [
1458
- /* @__PURE__ */ r(m, { component: "span", sx: { unicodeBidi: "plaintext" }, children: s.name(h.home.id) }),
1434
+ /* @__PURE__ */ g("b", { css: X.strong, children: [
1435
+ /* @__PURE__ */ n("span", { css: X.cms, children: r.name(h.home.id) }),
1459
1436
  " ",
1460
1437
  `${h.fullTime[0]}:${h.fullTime[1]}`,
1461
1438
  " ",
1462
- /* @__PURE__ */ r(m, { component: "span", sx: { unicodeBidi: "plaintext" }, children: s.name(h.away.id) }),
1439
+ /* @__PURE__ */ n("span", { css: X.cms, children: r.name(h.away.id) }),
1463
1440
  " ",
1464
- c("previousMeetingRound", { round: h.round })
1441
+ s("previousMeetingRound", { round: h.round })
1465
1442
  ] })
1466
1443
  ] }) : null
1467
1444
  ] });
1468
- }, go = ({ match: e, odds: t, open: o, onToggle: s }) => {
1469
- var j, U, p, I, v;
1470
- const { colors: i, radius: a } = F(), { entities: c, label: l, fmt: d, props: u } = Y(), h = (j = u.callbacks) == null ? void 0 : j.onBroadcastClick, f = e.status === "FINISHED", C = e.status === "LIVE", [b, g] = e.fullTime ?? [0, 0], $ = f && b > g, S = f && g > b, W = f && b === g, k = e.status === "CANCELLED", M = !k, O = !f && !k, _ = C ? e.liveMinute !== null ? l("liveMinute", { minute: e.liveMinute }) : e.isHalfTime ? l("halfTimeShort") : l("live") : d.time(e.start), R = xe(), E = (u.showOdds ?? !1) && !R && (e.status === "UPCOMING" || C), A = t ? /* @__PURE__ */ r(
1471
- Ct,
1445
+ }, Oo = zt({
1446
+ "0%, 100%": { opacity: 1, transform: "scale(1)" },
1447
+ "50%": { opacity: 0.4, transform: "scale(.7)" }
1448
+ }), Bo = (e, t) => d({
1449
+ display: "grid",
1450
+ alignItems: "center",
1451
+ columnGap: o(8),
1452
+ rowGap: o(6),
1453
+ // Minus the 3px accent border, so the rail lines up with the day header's text.
1454
+ padding: `${o(6)} ${o(16)} ${o(6)} calc(${o(16)} - 3px)`,
1455
+ cursor: e ? "pointer" : "default",
1456
+ borderLeft: `3px solid ${t ? i.danger : "transparent"}`,
1457
+ // Not onSurface: that is the day-header and detail fill, so a hovered row would merge into it.
1458
+ ...e ? { "&:hover": { backgroundColor: i.tint } } : {}
1459
+ }), _t = {};
1460
+ for (const e of [0, 1]) for (const t of [0, 1]) _t[`${e}${t}`] = Bo(!!e, !!t);
1461
+ const ct = (e) => d({
1462
+ letterSpacing: o(1, 15),
1463
+ backgroundColor: e ? i.onSurface : "transparent",
1464
+ borderRadius: i.radiusSm,
1465
+ padding: `${o(3, 15)} ${o(8, 15)}`,
1466
+ whiteSpace: "nowrap"
1467
+ }), F = {
1468
+ item: d({ borderBottom: `1px solid ${i.border}` }),
1469
+ rail: d({ display: "flex", alignItems: "center", gap: o(6), whiteSpace: "nowrap" }),
1470
+ liveDot: d({
1471
+ width: o(7),
1472
+ height: o(7),
1473
+ borderRadius: "50%",
1474
+ backgroundColor: i.danger,
1475
+ animation: `${Oo} 1s ease-in-out infinite`
1476
+ }),
1477
+ broadcast: d({
1478
+ display: "inline-flex",
1479
+ alignItems: "center",
1480
+ justifyContent: "center",
1481
+ padding: 0,
1482
+ border: "none",
1483
+ background: "transparent",
1484
+ cursor: "pointer",
1485
+ fontSize: o(16),
1486
+ color: i.dim,
1487
+ "&:hover": { color: i.primary }
1488
+ }),
1489
+ home: d({
1490
+ display: "flex",
1491
+ alignItems: "center",
1492
+ justifyContent: "flex-end",
1493
+ gap: o(8),
1494
+ minWidth: 0
1495
+ }),
1496
+ away: d({ display: "flex", alignItems: "center", gap: o(8), minWidth: 0 }),
1497
+ alignRight: d({ textAlign: "right" }),
1498
+ scoreColumn: d({
1499
+ display: "flex",
1500
+ flexDirection: "column",
1501
+ alignItems: "center",
1502
+ minWidth: o(56)
1503
+ }),
1504
+ notPlayed: d({
1505
+ backgroundColor: i.onSurface,
1506
+ borderRadius: i.radiusSm,
1507
+ padding: `${o(5, 11)} ${o(8, 11)}`,
1508
+ whiteSpace: "nowrap"
1509
+ }),
1510
+ score: { filled: ct(!0), empty: ct(!1) },
1511
+ oddsInline: d({ minWidth: 0, cursor: "default" }),
1512
+ chevron: d({
1513
+ width: o(16),
1514
+ height: o(16),
1515
+ color: i.dim,
1516
+ transition: "transform .2s"
1517
+ }),
1518
+ oddsBelow: d({
1519
+ display: "flex",
1520
+ justifyContent: "center",
1521
+ marginTop: o(4),
1522
+ cursor: "default"
1523
+ }),
1524
+ oddsBelowInner: d({ width: "100%", maxWidth: o(300) }),
1525
+ // Narrow rows: the teams stack, each with its own score at the line's end.
1526
+ railStack: d({ display: "flex", flexDirection: "column", alignItems: "flex-start", gap: o(4) }),
1527
+ railTime: d({ display: "flex", alignItems: "center", gap: o(6), whiteSpace: "nowrap" }),
1528
+ stack: d({ display: "flex", flexDirection: "column", gap: o(4), minWidth: 0 }),
1529
+ line: d({ display: "flex", alignItems: "center", gap: o(8), height: o(24), minWidth: 0 }),
1530
+ scoreStack: d({
1531
+ display: "flex",
1532
+ flexDirection: "column",
1533
+ alignItems: "center",
1534
+ gap: o(4),
1535
+ minWidth: o(28),
1536
+ backgroundColor: i.onSurface,
1537
+ borderRadius: i.radiusSm,
1538
+ padding: `0 ${o(8)}`
1539
+ }),
1540
+ scoreLine: d({ display: "flex", alignItems: "center", height: o(24) }),
1541
+ oddsStacked: d({ display: "flex", marginTop: o(4), cursor: "default" }),
1542
+ detail: d({
1543
+ padding: `${o(6)} ${o(16)} ${o(16)}`,
1544
+ display: "flex",
1545
+ flexDirection: "column",
1546
+ gap: o(14),
1547
+ backgroundColor: i.onSurface,
1548
+ borderTop: `1px solid ${i.border}`
1549
+ })
1550
+ }, No = ({ match: e, odds: t, open: r, onToggle: l }) => {
1551
+ var ye, be, he, we, ce;
1552
+ const { entities: c, label: s, fmt: m, props: u } = oe(), a = (ye = u.callbacks) == null ? void 0 : ye.onBroadcastClick, h = e.status === "FINISHED", b = e.status === "LIVE", [f, S] = e.fullTime ?? [0, 0], w = h && f > S, y = h && S > f, _ = h && f === S, D = e.status === "CANCELLED", E = !D, x = !h && !D, R = b ? e.liveMinute !== null ? s("liveMinute", { minute: e.liveMinute }) : e.isHalfTime ? s("halfTimeShort") : s("live") : m.time(e.start), $ = _e(), W = Bt(), L = (u.showOdds ?? !1) && W && (e.status === "UPCOMING" || b), z = t ? /* @__PURE__ */ n(
1553
+ Vt,
1472
1554
  {
1473
1555
  odds: t,
1474
- market: ((U = u.odds) == null ? void 0 : U.market) ?? "FT_1X2",
1556
+ market: ((be = u.odds) == null ? void 0 : be.market) ?? "FT_1X2",
1475
1557
  size: "compact",
1476
1558
  bare: !0,
1477
- mode: ((p = u.odds) == null ? void 0 : p.mode) ?? "default",
1478
- flashInterval: (I = u.odds) == null ? void 0 : I.flashInterval,
1479
- onSelect: (v = u.callbacks) == null ? void 0 : v.onAddToBetslip
1559
+ mode: ((he = u.odds) == null ? void 0 : he.mode) ?? "default",
1560
+ flashInterval: (we = u.odds) == null ? void 0 : we.flashInterval,
1561
+ onSelect: (ce = u.callbacks) == null ? void 0 : ce.onAddToBetslip
1480
1562
  }
1481
- ) : null, z = {
1563
+ ) : null, U = {
1482
1564
  // A price click must not toggle the row.
1483
- onClick: (P) => P.stopPropagation(),
1484
- onKeyDown: (P) => P.stopPropagation()
1485
- }, T = (P, K, ne, X) => /* @__PURE__ */ r(
1486
- w,
1565
+ onClick: (O) => O.stopPropagation(),
1566
+ onKeyDown: (O) => O.stopPropagation()
1567
+ }, A = (O, re, ge, Re) => /* @__PURE__ */ n(
1568
+ C,
1487
1569
  {
1488
1570
  size: 14,
1489
- weight: K ? 700 : 500,
1490
- color: ne && !W ? i.dim : i.text,
1571
+ weight: re ? 700 : 500,
1572
+ color: ge && !_ ? i.dim : i.text,
1491
1573
  ellipsis: !0,
1492
1574
  cms: !0,
1493
- sx: X ? { textAlign: "right" } : void 0,
1494
- children: c.name(P)
1575
+ css: Re ? F.alignRight : void 0,
1576
+ children: c.name(O)
1495
1577
  }
1496
- );
1497
- return /* @__PURE__ */ y(m, { sx: { borderBottom: `1px solid ${i.border}` }, children: [
1498
- /* @__PURE__ */ y(
1499
- m,
1578
+ ), M = h || b, p = /* @__PURE__ */ g(fe, { children: [
1579
+ b ? /* @__PURE__ */ n("span", { css: F.liveDot }) : null,
1580
+ /* @__PURE__ */ n(C, { size: 13, font: "secondary", weight: 700, color: b ? i.danger : i.text, children: R })
1581
+ ] }), k = a && e.status === "UPCOMING" ? /* @__PURE__ */ n(
1582
+ "button",
1583
+ {
1584
+ type: "button",
1585
+ "aria-label": s("watchOnTv"),
1586
+ title: s("watchOnTv"),
1587
+ onClick: (O) => {
1588
+ O.stopPropagation(), a(e.id);
1589
+ },
1590
+ onKeyDown: (O) => O.stopPropagation(),
1591
+ css: F.broadcast,
1592
+ children: /* @__PURE__ */ n(Ut, { size: "1em", "aria-hidden": !0 })
1593
+ }
1594
+ ) : null, I = D && e.notPlayedReason ? /* @__PURE__ */ n(C, { size: 11, font: "secondary", weight: 700, upper: !0, color: i.dim, css: F.notPlayed, children: s(e.notPlayedReason) }) : null, G = /* @__PURE__ */ n(
1595
+ "svg",
1596
+ {
1597
+ viewBox: "0 0 24 24",
1598
+ fill: "none",
1599
+ stroke: "currentColor",
1600
+ strokeWidth: "2",
1601
+ strokeLinecap: "round",
1602
+ strokeLinejoin: "round",
1603
+ css: F.chevron,
1604
+ style: {
1605
+ // Hidden, not removed, so the teams stay aligned with the expandable rows.
1606
+ visibility: E ? "visible" : "hidden",
1607
+ transform: r ? "rotate(180deg)" : "rotate(0)"
1608
+ },
1609
+ children: /* @__PURE__ */ n("path", { d: "m6 9 6 6 6-6" })
1610
+ }
1611
+ ), J = $ ? [x ? o(64) : null, "minmax(0,1fr)", M || I ? "auto" : null, o(20)] : [
1612
+ x ? o(a ? 80 : 60) : null,
1613
+ "minmax(0,1fr) auto minmax(0,1fr)",
1614
+ L ? o(300) : null,
1615
+ o(20)
1616
+ ], H = /* @__PURE__ */ g(fe, { children: [
1617
+ x ? /* @__PURE__ */ g("div", { css: F.railStack, children: [
1618
+ /* @__PURE__ */ n("div", { css: F.railTime, children: p }),
1619
+ k
1620
+ ] }) : null,
1621
+ /* @__PURE__ */ n("div", { css: F.stack, children: [e.home.id, e.away.id].map((O, re) => /* @__PURE__ */ g("div", { css: F.line, children: [
1622
+ /* @__PURE__ */ n(V, { url: c.logo(O), size: 20 }),
1623
+ A(O, re === 0 ? w : y, re === 0 ? y : w, !1)
1624
+ ] }, O)) }),
1625
+ I ?? (M ? /* @__PURE__ */ n("div", { css: F.scoreStack, children: [
1626
+ [f, w],
1627
+ [S, y]
1628
+ ].map(([O, re], ge) => /* @__PURE__ */ n("div", { css: F.scoreLine, children: /* @__PURE__ */ n(C, { size: 15, weight: 700, color: h && !_ && !re ? i.dim : i.text, children: O }) }, ge)) }) : null),
1629
+ G,
1630
+ z ? /* @__PURE__ */ n(
1631
+ "div",
1632
+ {
1633
+ ...U,
1634
+ css: F.oddsStacked,
1635
+ style: { gridColumn: `${x ? 2 : 1} / -1` },
1636
+ children: /* @__PURE__ */ n("div", { css: F.oddsBelowInner, children: z })
1637
+ }
1638
+ ) : null
1639
+ ] }), le = /* @__PURE__ */ g(fe, { children: [
1640
+ x ? /* @__PURE__ */ g("div", { css: F.rail, children: [
1641
+ p,
1642
+ k
1643
+ ] }) : null,
1644
+ /* @__PURE__ */ g("div", { css: F.home, children: [
1645
+ A(e.home.id, w, y, !0),
1646
+ /* @__PURE__ */ n(V, { url: c.logo(e.home.id), size: 24 })
1647
+ ] }),
1648
+ /* @__PURE__ */ g("div", { css: F.scoreColumn, children: [
1649
+ I ?? /* @__PURE__ */ n(
1650
+ C,
1651
+ {
1652
+ size: 15,
1653
+ weight: 700,
1654
+ color: i.text,
1655
+ css: M ? F.score.filled : F.score.empty,
1656
+ children: M ? `${f} : ${S}` : "–"
1657
+ }
1658
+ ),
1659
+ M && e.halfTime ? /* @__PURE__ */ n(C, { size: 10, font: "secondary", color: i.dim, style: { marginTop: o(2, 10) }, children: `(${e.halfTime[0]}:${e.halfTime[1]})` }) : null
1660
+ ] }),
1661
+ /* @__PURE__ */ g("div", { css: F.away, children: [
1662
+ /* @__PURE__ */ n(V, { url: c.logo(e.away.id), size: 24 }),
1663
+ A(e.away.id, y, w, !1)
1664
+ ] }),
1665
+ L ? /* @__PURE__ */ n("div", { ...U, css: F.oddsInline, children: z }) : null,
1666
+ G,
1667
+ z && !L ? /* @__PURE__ */ n(
1668
+ "div",
1500
1669
  {
1501
- ...M ? {
1670
+ ...U,
1671
+ css: F.oddsBelow,
1672
+ style: { gridColumn: x ? "2 / 5" : "1 / 4" },
1673
+ children: /* @__PURE__ */ n("div", { css: F.oddsBelowInner, children: z })
1674
+ }
1675
+ ) : null
1676
+ ] });
1677
+ return /* @__PURE__ */ g("div", { css: F.item, children: [
1678
+ /* @__PURE__ */ n(
1679
+ "div",
1680
+ {
1681
+ ...E ? {
1502
1682
  role: "button",
1503
- "aria-expanded": o,
1683
+ "aria-expanded": r,
1504
1684
  tabIndex: 0,
1505
- onClick: s,
1506
- onKeyDown: (P) => {
1507
- (P.key === "Enter" || P.key === " ") && (P.preventDefault(), s());
1685
+ onClick: l,
1686
+ onKeyDown: (O) => {
1687
+ (O.key === "Enter" || O.key === " ") && (O.preventDefault(), l());
1508
1688
  }
1509
1689
  } : {},
1510
- sx: {
1511
- display: "grid",
1512
- gridTemplateColumns: [
1513
- O ? n(h ? 80 : 60) : null,
1514
- "minmax(0,1fr) auto minmax(0,1fr)",
1515
- E ? n(300) : null,
1516
- n(20)
1517
- ].filter(Boolean).join(" "),
1518
- alignItems: "center",
1519
- columnGap: n(8),
1520
- rowGap: n(6),
1521
- // Minus the 3px accent border, so the rail lines up with the day header's text.
1522
- padding: `${n(6)} ${n(16)} ${n(6)} calc(${n(16)} - 3px)`,
1523
- cursor: M ? "pointer" : "default",
1524
- backgroundColor: o ? i.onSurface : "transparent",
1525
- borderLeft: `3px solid ${C ? i.danger : "transparent"}`,
1526
- // Not onSurface: that is the day-header fill, so a hovered row would merge into it.
1527
- ...M ? {
1528
- "&:hover": {
1529
- backgroundColor: o ? i.onSurface : i.tint
1530
- }
1531
- } : {}
1532
- },
1533
- children: [
1534
- O ? /* @__PURE__ */ y(
1535
- m,
1536
- {
1537
- sx: {
1538
- display: "flex",
1539
- alignItems: "center",
1540
- gap: n(6),
1541
- whiteSpace: "nowrap"
1542
- },
1543
- children: [
1544
- C ? /* @__PURE__ */ r(
1545
- m,
1546
- {
1547
- component: "span",
1548
- sx: {
1549
- width: n(7),
1550
- height: n(7),
1551
- borderRadius: "50%",
1552
- backgroundColor: i.danger,
1553
- animation: "cs-pulse 1s ease-in-out infinite"
1554
- }
1555
- }
1556
- ) : null,
1557
- /* @__PURE__ */ r(
1558
- w,
1559
- {
1560
- size: 13,
1561
- font: "secondary",
1562
- weight: 700,
1563
- color: C ? i.danger : i.text,
1564
- children: _
1565
- }
1566
- ),
1567
- h && e.status === "UPCOMING" ? /* @__PURE__ */ r(
1568
- m,
1569
- {
1570
- component: "button",
1571
- type: "button",
1572
- "aria-label": l("watchOnTv"),
1573
- title: l("watchOnTv"),
1574
- onClick: (P) => {
1575
- P.stopPropagation(), h(e.id);
1576
- },
1577
- onKeyDown: (P) => P.stopPropagation(),
1578
- sx: {
1579
- display: "inline-flex",
1580
- alignItems: "center",
1581
- justifyContent: "center",
1582
- padding: 0,
1583
- border: "none",
1584
- background: "transparent",
1585
- cursor: "pointer",
1586
- fontSize: n(16),
1587
- color: i.dim,
1588
- "&:hover": { color: i.primary }
1589
- },
1590
- children: /* @__PURE__ */ r(kt, { size: "1em", "aria-hidden": !0 })
1591
- }
1592
- ) : null
1593
- ]
1594
- }
1595
- ) : null,
1596
- /* @__PURE__ */ y(
1597
- m,
1598
- {
1599
- sx: {
1600
- display: "flex",
1601
- alignItems: "center",
1602
- justifyContent: "flex-end",
1603
- gap: n(8),
1604
- minWidth: 0
1605
- },
1606
- children: [
1607
- T(e.home.id, $, S, !0),
1608
- /* @__PURE__ */ r(H, { url: c.logo(e.home.id), size: 24 })
1609
- ]
1610
- }
1611
- ),
1612
- /* @__PURE__ */ y(
1613
- m,
1614
- {
1615
- sx: {
1616
- display: "flex",
1617
- flexDirection: "column",
1618
- alignItems: "center",
1619
- minWidth: n(56)
1620
- },
1621
- children: [
1622
- k && e.notPlayedReason ? /* @__PURE__ */ r(
1623
- w,
1624
- {
1625
- size: 11,
1626
- font: "secondary",
1627
- weight: 700,
1628
- upper: !0,
1629
- color: i.dim,
1630
- sx: {
1631
- backgroundColor: i.onSurface,
1632
- borderRadius: a.sm,
1633
- padding: `${n(5, 11)} ${n(8, 11)}`,
1634
- whiteSpace: "nowrap"
1635
- },
1636
- children: l(e.notPlayedReason)
1637
- }
1638
- ) : /* @__PURE__ */ r(
1639
- w,
1640
- {
1641
- size: 15,
1642
- weight: 700,
1643
- color: i.text,
1644
- sx: {
1645
- letterSpacing: n(1, 15),
1646
- backgroundColor: f || C ? i.onSurface : "transparent",
1647
- borderRadius: a.sm,
1648
- padding: `${n(3, 15)} ${n(8, 15)}`,
1649
- whiteSpace: "nowrap"
1650
- },
1651
- children: f || C ? `${b} : ${g}` : "–"
1652
- }
1653
- ),
1654
- (f || C) && e.halfTime ? /* @__PURE__ */ r(
1655
- w,
1656
- {
1657
- size: 10,
1658
- font: "secondary",
1659
- color: i.dim,
1660
- sx: { marginTop: n(2, 10) },
1661
- children: `(${e.halfTime[0]}:${e.halfTime[1]})`
1662
- }
1663
- ) : null
1664
- ]
1665
- }
1666
- ),
1667
- /* @__PURE__ */ y(
1668
- m,
1669
- {
1670
- sx: {
1671
- display: "flex",
1672
- alignItems: "center",
1673
- gap: n(8),
1674
- minWidth: 0
1675
- },
1676
- children: [
1677
- /* @__PURE__ */ r(H, { url: c.logo(e.away.id), size: 24 }),
1678
- T(e.away.id, S, $, !1)
1679
- ]
1680
- }
1681
- ),
1682
- E ? /* @__PURE__ */ r(m, { ...z, sx: { minWidth: 0, cursor: "default" }, children: A }) : null,
1683
- /* @__PURE__ */ r(
1684
- m,
1685
- {
1686
- component: "svg",
1687
- viewBox: "0 0 24 24",
1688
- fill: "none",
1689
- stroke: "currentColor",
1690
- strokeWidth: "2",
1691
- strokeLinecap: "round",
1692
- strokeLinejoin: "round",
1693
- sx: {
1694
- width: n(16),
1695
- height: n(16),
1696
- color: i.dim,
1697
- // Hidden, not removed, so the teams stay aligned with the expandable rows.
1698
- visibility: M ? "visible" : "hidden",
1699
- transform: o ? "rotate(180deg)" : "rotate(0)",
1700
- transition: "transform .2s"
1701
- },
1702
- children: /* @__PURE__ */ r("path", { d: "m6 9 6 6 6-6" })
1703
- }
1704
- ),
1705
- A && !E ? /* @__PURE__ */ r(
1706
- m,
1707
- {
1708
- ...z,
1709
- sx: {
1710
- gridColumn: O ? "2 / 5" : "1 / 4",
1711
- display: "flex",
1712
- justifyContent: "center",
1713
- cursor: "default"
1714
- },
1715
- children: /* @__PURE__ */ r(m, { sx: { width: "100%", maxWidth: n(300) }, children: A })
1716
- }
1717
- ) : null
1718
- ]
1690
+ css: _t[`${+E}${+b}`],
1691
+ style: { gridTemplateColumns: J.filter(Boolean).join(" ") },
1692
+ children: $ ? H : le
1719
1693
  }
1720
1694
  ),
1721
- o && M ? /* @__PURE__ */ r(
1722
- m,
1723
- {
1724
- sx: {
1725
- padding: `${n(6)} ${n(16)} ${n(16)}`,
1726
- display: "flex",
1727
- flexDirection: "column",
1728
- gap: n(14),
1729
- backgroundColor: i.onSurface,
1730
- borderTop: `1px solid ${i.border}`
1731
- },
1732
- children: f || C ? /* @__PURE__ */ r(po, { match: e }) : /* @__PURE__ */ r(ho, { match: e })
1733
- }
1734
- ) : null
1695
+ r && E ? /* @__PURE__ */ n("div", { css: F.detail, children: h || b ? /* @__PURE__ */ n(Do, { match: e }) : /* @__PURE__ */ n(Wo, { match: e }) }) : null
1735
1696
  ] });
1736
- }, Pe = (e, t) => e.start.localeCompare(t.start), fo = (e) => e.status === "UPCOMING" || e.status === "LIVE", yo = () => {
1737
- var ve, Ie, $e, Te, ke, _e;
1738
- const { colors: e, radius: t, fonts: o } = F(), { sdk: s, data: i, entities: a, label: c, fmt: l, props: d } = Y(), [u, h] = L.useState("upcoming"), [f, C] = L.useState(null), [b, g] = L.useState(null), [$, S] = L.useState(null), [W, k] = L.useState(null), [M, O] = L.useState(null), _ = u === "upcoming", R = (x) => fo(x) === _, E = i.matches.filter(R).sort(Pe), A = i.stages.filter(
1739
- (x) => E.some((D) => D.stageId === x.id)
1740
- ), z = _ ? A : [...A].reverse(), T = z.length > 1, j = _ ? f : b, U = (ve = _ ? E[0] : E[E.length - 1]) == null ? void 0 : ve.stageId, p = T ? z.some((x) => x.id === j) ? j : U ?? z[0].id : null, I = (x) => !T || x.stageId === p, v = Array.from(
1741
- new Set(E.filter(I).map((x) => x.round))
1742
- ).sort((x, D) => x - D), P = _ ? v : [...v].reverse(), K = _ ? $ : W, ne = K !== null && v.includes(K) ? K : _ ? v[0] : v[v.length - 1], X = i.matches.filter((x) => x.round === ne && I(x)).sort(Pe), re = X.filter(R), Ve = L.useMemo(
1743
- () => re.filter((x) => x.status === "UPCOMING" || x.status === "LIVE").map((x) => x.id),
1744
- [re]
1745
- ), { odds: Ye } = St(s, Ve, {
1746
- enabled: d.showOdds ?? !1,
1747
- markets: [((Ie = d.odds) == null ? void 0 : Ie.market) ?? "FT_1X2"],
1748
- sport: i.sport,
1749
- pollingIntervalMs: ($e = d.odds) == null ? void 0 : $e.pollingInterval,
1750
- operators: (Te = d.odds) == null ? void 0 : Te.operators,
1751
- affiliateId: (ke = d.odds) == null ? void 0 : ke.affiliateId,
1752
- affiliateIds: (_e = d.odds) == null ? void 0 : _e.affiliateIds
1753
- }), Ce = (x) => l.date(x, { day: "numeric", month: "short" }), Xe = X.length ? c("roundSummary", {
1754
- from: Ce(X[0].start),
1755
- to: Ce(X[X.length - 1].start),
1756
- matches: c("matchesCount", { count: X.length })
1757
- }) : "", ue = [];
1758
- re.forEach((x) => {
1759
- const D = l.date(x.start, {
1697
+ }, dt = (e, t) => e.start.localeCompare(t.start), Go = (e) => e.status === "UPCOMING" || e.status === "LIVE", ut = (e) => d({
1698
+ border: "none",
1699
+ cursor: "pointer",
1700
+ borderRadius: i.radiusFull,
1701
+ padding: `${o(7, 13)} ${o(14, 13)}`,
1702
+ fontFamily: i.fontPrimary,
1703
+ fontSize: o(13),
1704
+ fontWeight: 700,
1705
+ backgroundColor: e ? i.surface : "transparent",
1706
+ color: e ? i.text : i.dim,
1707
+ boxShadow: e ? "0 1px 2px rgba(0,0,0,.12)" : "none"
1708
+ }), pt = (e) => d({
1709
+ flexShrink: 0,
1710
+ border: "none",
1711
+ cursor: "pointer",
1712
+ borderRadius: i.radiusFull,
1713
+ padding: `${o(6, 12)} ${o(12, 12)}`,
1714
+ fontFamily: i.fontPrimary,
1715
+ fontSize: o(12),
1716
+ fontWeight: 700,
1717
+ lineHeight: 1,
1718
+ textTransform: "uppercase",
1719
+ letterSpacing: "0.025em",
1720
+ whiteSpace: "nowrap",
1721
+ unicodeBidi: "plaintext",
1722
+ backgroundColor: e ? i.primary : "transparent",
1723
+ color: e ? i.onPrimary : i.dim,
1724
+ "&:hover": e ? {} : { backgroundColor: i.variant, color: i.primary }
1725
+ }), mt = (e) => d({
1726
+ flexShrink: 0,
1727
+ border: `1px solid ${e ? i.primary : i.border}`,
1728
+ cursor: "pointer",
1729
+ borderRadius: i.radiusFull,
1730
+ padding: `${o(5, 12)} ${o(12, 12)}`,
1731
+ fontFamily: i.fontSecondary,
1732
+ fontSize: o(12),
1733
+ fontWeight: 700,
1734
+ backgroundColor: e ? i.primary : i.surface,
1735
+ color: e ? i.onPrimary : i.body,
1736
+ whiteSpace: "nowrap"
1737
+ }), Q = {
1738
+ root: d(me, { overflow: "hidden" }),
1739
+ toolbar: d({
1740
+ display: "flex",
1741
+ alignItems: "center",
1742
+ justifyContent: "space-between",
1743
+ gap: o(12),
1744
+ padding: `${o(12)} ${o(16)}`,
1745
+ borderBottom: `1px solid ${i.border}`,
1746
+ flexWrap: "wrap"
1747
+ }),
1748
+ tabs: d({
1749
+ display: "flex",
1750
+ gap: o(4),
1751
+ padding: o(3),
1752
+ backgroundColor: i.onSurface,
1753
+ borderRadius: i.radiusFull
1754
+ }),
1755
+ tab: { on: ut(!0), off: ut(!1) },
1756
+ stage: { on: pt(!0), off: pt(!1) },
1757
+ round: { on: mt(!0), off: mt(!1) },
1758
+ day: d({
1759
+ padding: `${o(8, 11)} ${o(16, 11)} ${o(4, 11)}`,
1760
+ backgroundColor: i.onSurface
1761
+ }),
1762
+ empty: d({ padding: o(24, 14), textAlign: "center" })
1763
+ }, Ho = () => {
1764
+ var Ne, Ge, He, je, Ue, Ve;
1765
+ const { sdk: e, data: t, entities: r, label: l, fmt: c, props: s } = oe(), [m, u] = P.useState("upcoming"), [a, h] = P.useState(null), [b, f] = P.useState(null), [S, w] = P.useState(null), [y, _] = P.useState(null), [D, E] = P.useState(null), x = m === "upcoming", R = (v) => Go(v) === x, $ = t.matches.filter(R).sort(dt), W = t.stages.filter(
1766
+ (v) => $.some((N) => N.stageId === v.id)
1767
+ ), L = x ? W : [...W].reverse(), z = L.length > 1, U = x ? a : b, A = (Ne = x ? $[0] : $[$.length - 1]) == null ? void 0 : Ne.stageId, M = z ? L.some((v) => v.id === U) ? U : A ?? L[0].id : null, p = (v) => !z || v.stageId === M, k = Array.from(
1768
+ new Set($.filter(p).map((v) => v.round))
1769
+ ).sort((v, N) => v - N), I = x ? k : [...k].reverse(), G = x ? S : y, J = G !== null && k.includes(G) ? G : x ? k[0] : k[k.length - 1], H = t.matches.filter((v) => v.round === J && p(v)).sort(dt), le = H.filter(R), ye = P.useMemo(
1770
+ () => le.filter((v) => v.status === "UPCOMING" || v.status === "LIVE").map((v) => v.id),
1771
+ [le]
1772
+ ), { odds: be } = Kt(e, ye, {
1773
+ enabled: s.showOdds ?? !1,
1774
+ markets: [((Ge = s.odds) == null ? void 0 : Ge.market) ?? "FT_1X2"],
1775
+ sport: t.sport,
1776
+ pollingIntervalMs: (He = s.odds) == null ? void 0 : He.pollingInterval,
1777
+ operators: (je = s.odds) == null ? void 0 : je.operators,
1778
+ affiliateId: (Ue = s.odds) == null ? void 0 : Ue.affiliateId,
1779
+ affiliateIds: (Ve = s.odds) == null ? void 0 : Ve.affiliateIds
1780
+ }), he = (v) => c.date(v, { day: "numeric", month: "short" }), we = H.length ? l("roundSummary", {
1781
+ from: he(H[0].start),
1782
+ to: he(H[H.length - 1].start),
1783
+ matches: l("matchesCount", { count: H.length })
1784
+ }) : "", ce = [];
1785
+ le.forEach((v) => {
1786
+ const N = c.date(v.start, {
1760
1787
  weekday: "long",
1761
1788
  day: "numeric",
1762
1789
  month: "long"
1763
- }), Re = ue.find((et) => et.label === D);
1764
- Re ? Re.rows.push(x) : ue.push({ label: D, rows: [x] });
1790
+ }), Ke = ce.find((Rt) => Rt.label === N);
1791
+ Ke ? Ke.rows.push(v) : ce.push({ label: N, rows: [v] });
1765
1792
  });
1766
- const qe = (x) => {
1767
- h(x), O(null);
1768
- }, Je = (x) => {
1769
- _ ? S(x) : k(x), O(null);
1770
- }, Qe = (x) => {
1771
- _ ? (C(x), S(null)) : (g(x), k(null)), O(null);
1772
- }, Ze = (x) => x.nameId && a.has(x.nameId) ? a.name(x.nameId) : c("stage", { number: i.stages.indexOf(x) + 1 }), Se = (x) => {
1773
- const D = u === x;
1774
- return /* @__PURE__ */ r(
1775
- m,
1776
- {
1777
- component: "button",
1778
- type: "button",
1779
- onClick: () => qe(x),
1780
- sx: {
1781
- border: "none",
1782
- cursor: "pointer",
1783
- borderRadius: t.full,
1784
- padding: `${n(7, 13)} ${n(14, 13)}`,
1785
- fontFamily: o.primary,
1786
- fontSize: n(13),
1787
- fontWeight: 700,
1788
- backgroundColor: D ? e.surface : "transparent",
1789
- color: D ? e.text : e.dim,
1790
- boxShadow: D ? "0 1px 2px rgba(0,0,0,.12)" : "none"
1791
- },
1792
- children: c(x)
1793
- }
1794
- );
1795
- };
1796
- return /* @__PURE__ */ y(Z, { sx: { overflow: "hidden" }, children: [
1797
- /* @__PURE__ */ y(
1798
- m,
1799
- {
1800
- sx: {
1801
- display: "flex",
1802
- alignItems: "center",
1803
- justifyContent: "space-between",
1804
- gap: n(12),
1805
- padding: `${n(12)} ${n(16)}`,
1806
- borderBottom: `1px solid ${e.border}`,
1807
- flexWrap: "wrap"
1808
- },
1809
- children: [
1810
- /* @__PURE__ */ y(
1811
- m,
1812
- {
1813
- sx: {
1814
- display: "flex",
1815
- gap: n(4),
1816
- padding: n(3),
1817
- backgroundColor: e.onSurface,
1818
- borderRadius: t.full
1819
- },
1820
- children: [
1821
- Se("upcoming"),
1822
- Se("results")
1823
- ]
1824
- }
1825
- ),
1826
- /* @__PURE__ */ r(w, { size: 11, font: "secondary", color: e.dim, children: Xe })
1827
- ]
1828
- }
1829
- ),
1830
- T ? (
1793
+ const O = (v) => {
1794
+ u(v), E(null);
1795
+ }, re = (v) => {
1796
+ x ? w(v) : _(v), E(null);
1797
+ }, ge = (v) => {
1798
+ x ? (h(v), w(null)) : (f(v), _(null)), E(null);
1799
+ }, Re = (v) => v.nameId && r.has(v.nameId) ? r.name(v.nameId) : l("stage", { number: t.stages.indexOf(v) + 1 }), Be = (v) => /* @__PURE__ */ n(
1800
+ "button",
1801
+ {
1802
+ type: "button",
1803
+ onClick: () => O(v),
1804
+ css: m === v ? Q.tab.on : Q.tab.off,
1805
+ children: l(v)
1806
+ }
1807
+ );
1808
+ return /* @__PURE__ */ g("div", { css: Q.root, children: [
1809
+ /* @__PURE__ */ g("div", { css: Q.toolbar, children: [
1810
+ /* @__PURE__ */ g("div", { css: Q.tabs, children: [
1811
+ Be("upcoming"),
1812
+ Be("results")
1813
+ ] }),
1814
+ /* @__PURE__ */ n(C, { size: 11, font: "secondary", color: i.dim, children: we })
1815
+ ] }),
1816
+ z ? (
1831
1817
  // Pills styled like the Standings stage tabs.
1832
- /* @__PURE__ */ r(
1833
- m,
1834
- {
1835
- role: "tablist",
1836
- sx: {
1837
- display: "flex",
1838
- gap: n(4),
1839
- overflowX: "auto",
1840
- padding: `${n(10)} ${n(16)}`,
1841
- borderBottom: `1px solid ${e.border}`,
1842
- scrollbarWidth: "none",
1843
- "&::-webkit-scrollbar": { display: "none" }
1818
+ /* @__PURE__ */ n(Ae, { variant: "row", gap: 4, role: "tablist", children: L.map((v) => {
1819
+ const N = v.id === M;
1820
+ return /* @__PURE__ */ n(
1821
+ "button",
1822
+ {
1823
+ type: "button",
1824
+ role: "tab",
1825
+ "aria-selected": N,
1826
+ onClick: () => ge(v.id),
1827
+ css: N ? Q.stage.on : Q.stage.off,
1828
+ children: Re(v)
1844
1829
  },
1845
- children: z.map((x) => {
1846
- const D = x.id === p;
1847
- return /* @__PURE__ */ r(
1848
- m,
1849
- {
1850
- component: "button",
1851
- type: "button",
1852
- role: "tab",
1853
- "aria-selected": D,
1854
- onClick: () => Qe(x.id),
1855
- sx: {
1856
- flexShrink: 0,
1857
- border: "none",
1858
- cursor: "pointer",
1859
- borderRadius: t.full,
1860
- padding: `${n(6, 12)} ${n(12, 12)}`,
1861
- fontFamily: o.primary,
1862
- fontSize: n(12),
1863
- fontWeight: 700,
1864
- lineHeight: 1,
1865
- textTransform: "uppercase",
1866
- letterSpacing: "0.025em",
1867
- whiteSpace: "nowrap",
1868
- unicodeBidi: "plaintext",
1869
- backgroundColor: D ? e.primary : "transparent",
1870
- color: D ? e.onPrimary : e.dim,
1871
- "&:hover": D ? {} : { backgroundColor: e.variant, color: e.primary }
1872
- },
1873
- children: Ze(x)
1874
- },
1875
- x.id
1876
- );
1877
- })
1878
- }
1879
- )
1830
+ v.id
1831
+ );
1832
+ }) })
1880
1833
  ) : null,
1881
- P.length > (T ? 1 : 0) ? /* @__PURE__ */ r(
1882
- m,
1834
+ I.length > (z ? 1 : 0) ? /* @__PURE__ */ n(Ae, { variant: "row", gap: 6, children: I.map((v) => /* @__PURE__ */ n(
1835
+ "button",
1883
1836
  {
1884
- sx: {
1885
- display: "flex",
1886
- gap: n(6),
1887
- overflowX: "auto",
1888
- padding: `${n(10)} ${n(16)}`,
1889
- borderBottom: `1px solid ${e.border}`,
1890
- scrollbarWidth: "none",
1891
- "&::-webkit-scrollbar": { display: "none" }
1892
- },
1893
- children: P.map((x) => {
1894
- const D = x === ne;
1895
- return /* @__PURE__ */ r(
1896
- m,
1897
- {
1898
- component: "button",
1899
- type: "button",
1900
- onClick: () => Je(x),
1901
- sx: {
1902
- flexShrink: 0,
1903
- border: `1px solid ${D ? e.primary : e.border}`,
1904
- cursor: "pointer",
1905
- borderRadius: t.full,
1906
- padding: `${n(5, 12)} ${n(12, 12)}`,
1907
- fontFamily: o.secondary,
1908
- fontSize: n(12),
1909
- fontWeight: 700,
1910
- backgroundColor: D ? e.primary : e.surface,
1911
- color: D ? e.onPrimary : e.body,
1912
- whiteSpace: "nowrap"
1913
- },
1914
- children: c("round", { round: x })
1915
- },
1916
- x
1917
- );
1918
- })
1919
- }
1920
- ) : null,
1921
- ue.map((x) => /* @__PURE__ */ y(L.Fragment, { children: [
1922
- /* @__PURE__ */ r(
1923
- w,
1837
+ type: "button",
1838
+ onClick: () => re(v),
1839
+ css: v === J ? Q.round.on : Q.round.off,
1840
+ children: l("round", { round: v })
1841
+ },
1842
+ v
1843
+ )) }) : null,
1844
+ ce.map((v) => /* @__PURE__ */ g(P.Fragment, { children: [
1845
+ /* @__PURE__ */ n(
1846
+ C,
1924
1847
  {
1925
1848
  component: "div",
1926
1849
  size: 11,
1927
1850
  font: "secondary",
1928
1851
  weight: 700,
1929
1852
  upper: !0,
1930
- color: e.dim,
1931
- sx: {
1932
- padding: `${n(8, 11)} ${n(16, 11)} ${n(4, 11)}`,
1933
- backgroundColor: e.onSurface
1934
- },
1935
- children: x.label
1853
+ color: i.dim,
1854
+ css: Q.day,
1855
+ children: v.label
1936
1856
  }
1937
1857
  ),
1938
- x.rows.map((D) => /* @__PURE__ */ r(
1939
- go,
1858
+ v.rows.map((N) => /* @__PURE__ */ n(
1859
+ No,
1940
1860
  {
1941
- match: D,
1942
- odds: Ye.get(D.id) ?? null,
1943
- open: M === D.id,
1944
- onToggle: () => O(M === D.id ? null : D.id)
1861
+ match: N,
1862
+ odds: be.get(N.id) ?? null,
1863
+ open: D === N.id,
1864
+ onToggle: () => E(D === N.id ? null : N.id)
1945
1865
  },
1946
- D.id
1866
+ N.id
1947
1867
  ))
1948
- ] }, x.label)),
1949
- re.length === 0 ? /* @__PURE__ */ r(
1950
- w,
1868
+ ] }, v.label)),
1869
+ le.length === 0 ? /* @__PURE__ */ n(
1870
+ C,
1951
1871
  {
1952
1872
  component: "div",
1953
1873
  size: 14,
1954
1874
  font: "secondary",
1955
- color: e.dim,
1956
- sx: { padding: n(24, 14), textAlign: "center" },
1957
- children: E.length > 0 ? c("noMatches") : c(_ ? "noUpcomingMatches" : "noResultsYet")
1875
+ color: i.dim,
1876
+ css: Q.empty,
1877
+ children: $.length > 0 ? l("noMatches") : l(x ? "noUpcomingMatches" : "noResultsYet")
1958
1878
  }
1959
1879
  ) : null
1960
1880
  ] });
1961
- }, De = ["1-15'", "16-30'", "31-45'", "46-60'", "61-75'", "76-90'"], ge = `repeat(auto-fit,minmax(${n(280)},1fr))`, se = ({ children: e }) => /* @__PURE__ */ r(
1962
- Z,
1963
- {
1964
- sx: {
1965
- padding: `${n(14)} ${n(16)}`,
1966
- display: "flex",
1967
- flexDirection: "column",
1968
- gap: n(10)
1969
- },
1970
- children: e
1971
- }
1972
- ), We = ({
1881
+ }, ht = ["1-15'", "16-30'", "31-45'", "46-60'", "61-75'", "76-90'"], Le = d({
1882
+ display: "grid",
1883
+ gridTemplateColumns: `repeat(auto-fit,minmax(${o(280)},1fr))`,
1884
+ gap: o(12)
1885
+ }), Ce = (e, t, r) => d(me, Oe, {
1886
+ padding: e,
1887
+ display: "flex",
1888
+ ...t ? { flexDirection: "column", gap: o(8) } : { alignItems: "center", gap: o(10) },
1889
+ cursor: r ? "pointer" : "default",
1890
+ "&:hover": { backgroundColor: r ? i.onSurface : i.surface }
1891
+ }), gt = `${o(12)} ${o(14)}`, ft = `${o(12)} ${o(16)}`, T = {
1892
+ section: d({ display: "flex", flexDirection: "column", gap: o(12) }),
1893
+ panel: d(me, {
1894
+ padding: `${o(14)} ${o(16)}`,
1895
+ display: "flex",
1896
+ flexDirection: "column",
1897
+ gap: o(10)
1898
+ }),
1899
+ bar: d({ display: "flex", borderRadius: i.radiusFull, overflow: "hidden", gap: "2px" }),
1900
+ tile: d({
1901
+ backgroundColor: i.onSurface,
1902
+ borderRadius: `calc(${i.radiusMd} - 2px)`,
1903
+ padding: o(12),
1904
+ display: "flex",
1905
+ alignItems: "center",
1906
+ gap: o(10)
1907
+ }),
1908
+ tileIcon: d({
1909
+ width: o(34),
1910
+ height: o(34),
1911
+ borderRadius: "50%",
1912
+ backgroundColor: i.tint,
1913
+ color: i.primary,
1914
+ display: "flex",
1915
+ alignItems: "center",
1916
+ justifyContent: "center",
1917
+ flexShrink: 0,
1918
+ "& svg": { width: o(18), height: o(18) }
1919
+ }),
1920
+ kpis: d({
1921
+ display: "grid",
1922
+ gridTemplateColumns: `repeat(auto-fit,minmax(${o(150)},1fr))`,
1923
+ gap: o(12)
1924
+ }),
1925
+ kpi: d(me, {
1926
+ padding: `${o(14)} ${o(16)}`,
1927
+ display: "flex",
1928
+ flexDirection: "column",
1929
+ gap: o(4)
1930
+ }),
1931
+ outcomes: d({ display: "grid", gridTemplateColumns: "repeat(3,1fr)", gap: o(8) }),
1932
+ outcome: d({
1933
+ display: "flex",
1934
+ flexDirection: "column",
1935
+ gap: o(2),
1936
+ textAlign: "left",
1937
+ borderLeft: "3px solid var(--fu-ucrc-cs-accent)",
1938
+ paddingLeft: o(8)
1939
+ }),
1940
+ timingHeader: d({
1941
+ display: "flex",
1942
+ justifyContent: "space-between",
1943
+ alignItems: "baseline",
1944
+ gap: o(8)
1945
+ }),
1946
+ strong: d({ color: i.text }),
1947
+ periods: d({
1948
+ display: "grid",
1949
+ gridTemplateColumns: "repeat(6,1fr)",
1950
+ gap: o(6),
1951
+ alignItems: "end",
1952
+ height: o(72)
1953
+ }),
1954
+ period: d({
1955
+ display: "flex",
1956
+ flexDirection: "column",
1957
+ alignItems: "center",
1958
+ gap: o(3),
1959
+ height: "100%",
1960
+ justifyContent: "flex-end"
1961
+ }),
1962
+ periodBar: d({ width: "100%", borderRadius: `${i.radiusXs} ${i.radiusXs} 0 0` }),
1963
+ periodLabels: d({ display: "grid", gridTemplateColumns: "repeat(6,1fr)", gap: o(6) }),
1964
+ over: d({
1965
+ display: "grid",
1966
+ gridTemplateColumns: `${o(150)} 1fr ${o(44)}`,
1967
+ alignItems: "center",
1968
+ gap: o(10)
1969
+ }),
1970
+ overTrack: d({
1971
+ height: o(8),
1972
+ borderRadius: i.radiusFull,
1973
+ backgroundColor: i.variant,
1974
+ overflow: "hidden"
1975
+ }),
1976
+ overFill: d({ height: "100%", backgroundColor: i.primary, borderRadius: i.radiusFull }),
1977
+ alignRight: d({ textAlign: "right" }),
1978
+ averages: d({ display: "grid", gridTemplateColumns: "repeat(2,1fr)", gap: o(8) }),
1979
+ halves: d({ display: "flex", alignItems: "baseline", gap: o(4) }),
1980
+ totalCards: d({
1981
+ display: "flex",
1982
+ alignItems: "center",
1983
+ justifyContent: "space-between",
1984
+ gap: o(12),
1985
+ borderTop: `1px solid ${i.border}`,
1986
+ paddingTop: o(12),
1987
+ flexWrap: "wrap"
1988
+ }),
1989
+ cardCounts: d({ display: "flex", gap: o(20) }),
1990
+ cardCount: d({ display: "flex", alignItems: "center", gap: o(10) }),
1991
+ cardIcon: d({ position: "relative", width: o(22), height: o(26), flexShrink: 0 }),
1992
+ cardBack: d({
1993
+ position: "absolute",
1994
+ left: 0,
1995
+ top: o(4),
1996
+ width: o(14),
1997
+ height: o(20),
1998
+ borderRadius: "3px",
1999
+ opacity: 0.45,
2000
+ transform: "rotate(-12deg)"
2001
+ }),
2002
+ cardFront: d({
2003
+ position: "absolute",
2004
+ left: o(6),
2005
+ top: 0,
2006
+ width: o(14),
2007
+ height: o(20),
2008
+ borderRadius: "3px",
2009
+ boxShadow: "0 1px 3px rgba(0,0,0,.2)"
2010
+ }),
2011
+ callouts: d({
2012
+ display: "grid",
2013
+ gridTemplateColumns: "repeat(12, minmax(0, 1fr))",
2014
+ gap: o(12)
2015
+ }),
2016
+ callout: {
2017
+ interactive: Ce(gt, !1, !0),
2018
+ plain: Ce(gt, !1, !1)
2019
+ },
2020
+ calloutText: d({ minWidth: 0, flex: 1 }),
2021
+ calloutValue: d({ textAlign: "right", flexShrink: 0 }),
2022
+ record: {
2023
+ interactive: Ce(ft, !0, !0),
2024
+ plain: Ce(ft, !0, !1)
2025
+ },
2026
+ recordTeams: d({
2027
+ display: "grid",
2028
+ gridTemplateColumns: "minmax(0,1fr) auto minmax(0,1fr)",
2029
+ alignItems: "center",
2030
+ gap: o(8)
2031
+ }),
2032
+ recordHome: d({
2033
+ display: "flex",
2034
+ alignItems: "center",
2035
+ justifyContent: "flex-end",
2036
+ gap: o(8),
2037
+ minWidth: 0
2038
+ }),
2039
+ recordAway: d({ display: "flex", alignItems: "center", gap: o(8), minWidth: 0 }),
2040
+ recordScore: d({
2041
+ letterSpacing: o(1, 18),
2042
+ backgroundColor: i.onSurface,
2043
+ borderRadius: i.radiusSm,
2044
+ padding: `${o(4, 18)} ${o(10, 18)}`
2045
+ })
2046
+ }, xe = ({ children: e }) => /* @__PURE__ */ n("div", { css: T.panel, children: e }), yt = ({
1973
2047
  widths: e,
1974
2048
  height: t
1975
- }) => {
1976
- const { radius: o } = F();
1977
- return /* @__PURE__ */ r(
1978
- m,
1979
- {
1980
- sx: {
1981
- display: "flex",
1982
- height: n(t),
1983
- borderRadius: o.full,
1984
- overflow: "hidden",
1985
- gap: "2px"
1986
- },
1987
- children: e.map((s, i) => /* @__PURE__ */ r(m, { sx: { width: `${s.w}%`, backgroundColor: s.color } }, i))
1988
- }
1989
- );
1990
- }, ie = ({
2049
+ }) => /* @__PURE__ */ n("div", { css: T.bar, style: { height: o(t) }, children: e.map((r, l) => /* @__PURE__ */ n("div", { style: { width: `${r.w}%`, backgroundColor: r.color } }, l)) }), Se = ({
1991
2050
  icon: e,
1992
2051
  caption: t,
1993
- children: o
1994
- }) => {
1995
- const { colors: s, radius: i } = F();
1996
- return /* @__PURE__ */ y(
1997
- m,
1998
- {
1999
- sx: {
2000
- backgroundColor: s.onSurface,
2001
- borderRadius: `calc(${i.md} - 2px)`,
2002
- padding: n(12),
2003
- display: "flex",
2004
- alignItems: "center",
2005
- gap: n(10)
2006
- },
2007
- children: [
2008
- /* @__PURE__ */ r(
2009
- m,
2010
- {
2011
- component: "span",
2012
- sx: {
2013
- width: n(34),
2014
- height: n(34),
2015
- borderRadius: "50%",
2016
- backgroundColor: s.tint,
2017
- color: s.primary,
2018
- display: "flex",
2019
- alignItems: "center",
2020
- justifyContent: "center",
2021
- flexShrink: 0,
2022
- "& svg": { width: n(18), height: n(18) }
2023
- },
2024
- children: e
2025
- }
2026
- ),
2027
- /* @__PURE__ */ y(m, { children: [
2028
- o,
2029
- /* @__PURE__ */ r(w, { component: "div", size: 10, font: "secondary", color: s.dim, sx: { marginTop: n(3, 10) }, children: t })
2030
- ] })
2031
- ]
2032
- }
2033
- );
2034
- }, ae = {
2052
+ children: r
2053
+ }) => /* @__PURE__ */ g("div", { css: T.tile, children: [
2054
+ /* @__PURE__ */ n("span", { css: T.tileIcon, children: e }),
2055
+ /* @__PURE__ */ g("div", { children: [
2056
+ r,
2057
+ /* @__PURE__ */ n(C, { component: "div", size: 10, font: "secondary", color: i.dim, style: { marginTop: o(3, 10) }, children: t })
2058
+ ] })
2059
+ ] }), ke = {
2035
2060
  viewBox: "0 0 24 24",
2036
2061
  fill: "none",
2037
2062
  stroke: "currentColor",
2038
2063
  strokeWidth: 2,
2039
2064
  strokeLinecap: "round",
2040
2065
  strokeLinejoin: "round"
2041
- }, xo = 4, bo = (e, t, o, s) => {
2042
- if (s) return 12;
2043
- if (o) return e === t - 1 && t % 2 === 1 ? 12 : 6;
2044
- const i = Math.min(t, xo), a = e < i ? i : t - i;
2045
- return Math.floor(12 / a);
2046
- }, wo = () => {
2047
- const { colors: e, radius: t } = F(), o = xe(), s = ct(), { data: i, entities: a, tally: c, label: l, fmt: d, props: u } = Y(), h = L.useMemo(() => Xt(i.matches), [i.matches]), f = h.played, C = (p) => l("ofMatches", { value: p, matches: l("matchesCount", { count: f }) }), b = (p) => d.decimal(f ? p / f : 0, 1), g = (p, I = 22) => /* @__PURE__ */ r(w, { size: I, weight: 700, color: e.text, sx: { lineHeight: 1 }, children: p }), $ = [
2066
+ }, jo = 4, Uo = (e, t, r, l) => {
2067
+ if (l) return 12;
2068
+ if (r) return e === t - 1 && t % 2 === 1 ? 12 : 6;
2069
+ const c = Math.min(t, jo), s = e < c ? c : t - c;
2070
+ return Math.floor(12 / s);
2071
+ }, Vo = () => {
2072
+ const e = _e(), t = Nt(), { data: r, entities: l, tally: c, label: s, fmt: m, props: u } = oe(), a = P.useMemo(() => bo(r.matches), [r.matches]), h = a.played, b = (p) => s("ofMatches", { value: p, matches: s("matchesCount", { count: h }) }), f = (p) => m.decimal(h ? p / h : 0, 1), S = (p, k = 22) => /* @__PURE__ */ n(C, { size: k, weight: 700, color: i.text, style: { lineHeight: 1 }, children: p }), w = [
2048
2073
  {
2049
- label: l("matchesPlayed"),
2050
- value: f,
2051
- sub: l("remaining", { count: h.total - f })
2074
+ label: s("matchesPlayed"),
2075
+ value: h,
2076
+ sub: s("remaining", { count: a.total - h })
2052
2077
  },
2053
2078
  {
2054
- label: l("totalGoals"),
2055
- value: h.goals,
2056
- sub: l("goalsPerMatchValue", { value: d.decimal(f ? h.goals / f : 0, 2) })
2079
+ label: s("totalGoals"),
2080
+ value: a.goals,
2081
+ sub: s("goalsPerMatchValue", { value: m.decimal(h ? a.goals / h : 0, 2) })
2057
2082
  },
2058
- { label: l("homeWins"), value: `${G(h.homeWins, f)}%`, sub: C(h.homeWins) },
2083
+ { label: s("homeWins"), value: `${Y(a.homeWins, h)}%`, sub: b(a.homeWins) },
2059
2084
  {
2060
- label: l("bothTeamsScored"),
2061
- value: `${G(h.bothScored, f)}%`,
2062
- sub: l("bttsSummary", {
2063
- matches: l("matchesCount", { count: h.bothScored }),
2064
- goalless: h.goalless
2085
+ label: s("bothTeamsScored"),
2086
+ value: `${Y(a.bothScored, h)}%`,
2087
+ sub: s("bttsSummary", {
2088
+ matches: s("matchesCount", { count: a.bothScored }),
2089
+ goalless: a.goalless
2065
2090
  })
2066
2091
  }
2067
- ], S = [
2068
- { label: l("homeWin"), n: h.homeWins, color: e.primary },
2069
- { label: l("draw"), n: h.draws, color: e.border },
2070
- { label: l("awayWin"), n: h.awayWins, color: e.primaryContainer }
2071
- ], W = Math.max(...h.goalsByPeriod, 1), k = [
2092
+ ], y = [
2093
+ { label: s("homeWin"), n: a.homeWins, color: i.primary },
2094
+ { label: s("draw"), n: a.draws, color: i.border },
2095
+ { label: s("awayWin"), n: a.awayWins, color: i.primaryContainer }
2096
+ ], _ = Math.max(...a.goalsByPeriod, 1), D = [
2072
2097
  ...[1.5, 2.5, 3.5].map((p) => ({
2073
2098
  // "Over 1.5" reads better as the whole number it means: 2+.
2074
- label: l("goalsOrMore", { count: Math.ceil(p) }),
2075
- pct: G(h.over(p), f)
2099
+ label: s("goalsOrMore", { count: Math.ceil(p) }),
2100
+ pct: Y(a.over(p), h)
2076
2101
  })),
2077
- { label: l("bothTeamsScored"), pct: G(h.bothScored, f) },
2078
- { label: l("goallessDraw"), pct: G(h.goalless, f) }
2079
- ], M = Qt(i.teamStats), O = Array.from(c.keys()), _ = ce(u.teamCTA), R = [], E = (p, I, v, P, K) => {
2080
- I !== void 0 && R.push({ label: l(p), teamId: v(I), value: P(I), unit: K(I) });
2102
+ { label: s("bothTeamsScored"), pct: Y(a.bothScored, h) },
2103
+ { label: s("goallessDraw"), pct: Y(a.goalless, h) }
2104
+ ], E = Co(r.teamStats), x = Array.from(c.keys()), R = Te(u.teamCTA), $ = [], W = (p, k, I, G, J) => {
2105
+ k !== void 0 && $.push({ label: s(p), teamId: I(k), value: G(k), unit: J(k) });
2081
2106
  };
2082
- E("mostWins", V(M, (p) => p.won), (p) => p.teamId, (p) => p.won, (p) => l("unitWins", { count: p.won })), E("bestAttack", V(M, (p) => p.goalsScored), (p) => p.teamId, (p) => p.goalsScored, () => l("unitGoals")), E("bestDefence", V(M, (p) => p.goalsAllowed, -1), (p) => p.teamId, (p) => p.goalsAllowed, (p) => l("unitConceded", { count: p.goalsAllowed })), E(
2107
+ W("mostWins", Z(E, (p) => p.won), (p) => p.teamId, (p) => p.won, (p) => s("unitWins", { count: p.won })), W("bestAttack", Z(E, (p) => p.goalsScored), (p) => p.teamId, (p) => p.goalsScored, () => s("unitGoals")), W("bestDefence", Z(E, (p) => p.goalsAllowed, -1), (p) => p.teamId, (p) => p.goalsAllowed, (p) => s("unitConceded", { count: p.goalsAllowed })), W(
2083
2108
  "cleanSheets",
2084
- V(O, (p) => {
2085
- var I;
2086
- return ((I = c.get(p)) == null ? void 0 : I.cleanSheets) ?? 0;
2109
+ Z(x, (p) => {
2110
+ var k;
2111
+ return ((k = c.get(p)) == null ? void 0 : k.cleanSheets) ?? 0;
2087
2112
  }),
2088
2113
  (p) => p,
2089
2114
  (p) => {
2090
- var I;
2091
- return ((I = c.get(p)) == null ? void 0 : I.cleanSheets) ?? 0;
2115
+ var k;
2116
+ return ((k = c.get(p)) == null ? void 0 : k.cleanSheets) ?? 0;
2092
2117
  },
2093
- () => l("unitMatches")
2094
- ), E("bestHome", V(M, (p) => p.homeWon), (p) => p.teamId, (p) => p.homeWon, (p) => l("unitWins", { count: p.homeWon })), E("bestAway", V(M, (p) => p.awayWon), (p) => p.teamId, (p) => p.awayWon, (p) => l("unitWins", { count: p.awayWon })), E(
2118
+ () => s("unitMatches")
2119
+ ), W("bestHome", Z(E, (p) => p.homeWon), (p) => p.teamId, (p) => p.homeWon, (p) => s("unitWins", { count: p.homeWon })), W("bestAway", Z(E, (p) => p.awayWon), (p) => p.teamId, (p) => p.awayWon, (p) => s("unitWins", { count: p.awayWon })), W(
2095
2120
  "mostCards",
2096
- V(O, (p) => {
2097
- var I, v;
2098
- return (((I = c.get(p)) == null ? void 0 : I.yellowCards) ?? 0) + (((v = c.get(p)) == null ? void 0 : v.redCards) ?? 0);
2121
+ Z(x, (p) => {
2122
+ var k, I;
2123
+ return (((k = c.get(p)) == null ? void 0 : k.yellowCards) ?? 0) + (((I = c.get(p)) == null ? void 0 : I.redCards) ?? 0);
2099
2124
  }),
2100
2125
  (p) => p,
2101
2126
  (p) => {
2102
- var I, v;
2103
- return (((I = c.get(p)) == null ? void 0 : I.yellowCards) ?? 0) + (((v = c.get(p)) == null ? void 0 : v.redCards) ?? 0);
2127
+ var k, I;
2128
+ return (((k = c.get(p)) == null ? void 0 : k.yellowCards) ?? 0) + (((I = c.get(p)) == null ? void 0 : I.redCards) ?? 0);
2104
2129
  },
2105
2130
  (p) => {
2106
- var I, v;
2107
- return `${l("yellowCount", { count: ((I = c.get(p)) == null ? void 0 : I.yellowCards) ?? 0 })} · ${l("redCount", {
2108
- count: ((v = c.get(p)) == null ? void 0 : v.redCards) ?? 0
2131
+ var k, I;
2132
+ return `${s("yellowCount", { count: ((k = c.get(p)) == null ? void 0 : k.yellowCards) ?? 0 })} · ${s("redCount", {
2133
+ count: ((I = c.get(p)) == null ? void 0 : I.redCards) ?? 0
2109
2134
  })}`;
2110
2135
  }
2111
2136
  );
2112
- const A = i.matches.filter(we), z = [], T = V(A, de), j = V(A, (p) => Math.abs(p.fullTime[0] - p.fullTime[1]));
2113
- T && z.push({ label: l("highestScoring"), match: T }), j && z.push({ label: l("biggestWin"), match: j });
2114
- const U = ce(u.matchCTA);
2115
- return /* @__PURE__ */ y(m, { sx: { display: "flex", flexDirection: "column", gap: n(12) }, children: [
2116
- /* @__PURE__ */ r(He, { children: l("seasonTitle") }),
2117
- /* @__PURE__ */ r(m, { sx: { display: "grid", gridTemplateColumns: `repeat(auto-fit,minmax(${n(150)},1fr))`, gap: n(12) }, children: $.map((p) => /* @__PURE__ */ y(
2118
- Z,
2119
- {
2120
- sx: { padding: `${n(14)} ${n(16)}`, display: "flex", flexDirection: "column", gap: n(4) },
2121
- children: [
2122
- /* @__PURE__ */ r(q, { size: 10, children: p.label }),
2123
- /* @__PURE__ */ r(w, { size: 28, weight: 700, color: e.primary, sx: { lineHeight: 1 }, children: p.value }),
2124
- /* @__PURE__ */ r(w, { size: 11, font: "secondary", color: e.dim, children: p.sub })
2125
- ]
2126
- },
2127
- p.label
2128
- )) }),
2129
- /* @__PURE__ */ y(m, { sx: { display: "grid", gridTemplateColumns: ge, gap: n(12) }, children: [
2130
- /* @__PURE__ */ y(se, { children: [
2131
- /* @__PURE__ */ r(q, { children: l("outcomeTitle") }),
2132
- /* @__PURE__ */ r(We, { height: 14, widths: S.map((p) => ({ w: G(p.n, f), color: p.color })) }),
2133
- /* @__PURE__ */ r(m, { sx: { display: "grid", gridTemplateColumns: "repeat(3,1fr)", gap: n(8) }, children: S.map((p) => /* @__PURE__ */ y(
2134
- m,
2137
+ const L = r.matches.filter(We), z = [], U = Z(L, $e), A = Z(L, (p) => Math.abs(p.fullTime[0] - p.fullTime[1]));
2138
+ U && z.push({ label: s("highestScoring"), match: U }), A && z.push({ label: s("biggestWin"), match: A });
2139
+ const M = Te(u.matchCTA);
2140
+ return /* @__PURE__ */ g("div", { css: T.section, children: [
2141
+ /* @__PURE__ */ n(It, { children: s("seasonTitle") }),
2142
+ /* @__PURE__ */ n("div", { css: T.kpis, children: w.map((p) => /* @__PURE__ */ g("div", { css: T.kpi, children: [
2143
+ /* @__PURE__ */ n(se, { size: 10, children: p.label }),
2144
+ /* @__PURE__ */ n(C, { size: 28, weight: 700, color: i.primary, style: { lineHeight: 1 }, children: p.value }),
2145
+ /* @__PURE__ */ n(C, { size: 11, font: "secondary", color: i.dim, children: p.sub })
2146
+ ] }, p.label)) }),
2147
+ /* @__PURE__ */ g("div", { css: Le, children: [
2148
+ /* @__PURE__ */ g(xe, { children: [
2149
+ /* @__PURE__ */ n(se, { children: s("outcomeTitle") }),
2150
+ /* @__PURE__ */ n(yt, { height: 14, widths: y.map((p) => ({ w: Y(p.n, h), color: p.color })) }),
2151
+ /* @__PURE__ */ n("div", { css: T.outcomes, children: y.map((p) => /* @__PURE__ */ g(
2152
+ "div",
2135
2153
  {
2136
- sx: {
2137
- display: "flex",
2138
- flexDirection: "column",
2139
- gap: n(2),
2140
- textAlign: "left",
2141
- borderLeft: `3px solid ${p.color}`,
2142
- paddingLeft: n(8)
2143
- },
2154
+ css: T.outcome,
2155
+ style: { "--fu-ucrc-cs-accent": p.color },
2144
2156
  children: [
2145
- g(`${G(p.n, f)}%`),
2146
- /* @__PURE__ */ r(w, { size: 11, font: "secondary", color: e.dim, sx: { marginTop: n(3, 11) }, children: p.label }),
2147
- /* @__PURE__ */ r(w, { size: 11, font: "secondary", color: e.body, children: C(p.n) })
2157
+ S(`${Y(p.n, h)}%`),
2158
+ /* @__PURE__ */ n(C, { size: 11, font: "secondary", color: i.dim, style: { marginTop: o(3, 11) }, children: p.label }),
2159
+ /* @__PURE__ */ n(C, { size: 11, font: "secondary", color: i.body, children: b(p.n) })
2148
2160
  ]
2149
2161
  },
2150
2162
  p.label
2151
2163
  )) })
2152
2164
  ] }),
2153
- /* @__PURE__ */ y(se, { children: [
2154
- /* @__PURE__ */ y(m, { sx: { display: "flex", justifyContent: "space-between", alignItems: "baseline", gap: n(8) }, children: [
2155
- /* @__PURE__ */ r(q, { children: l("goalTimingTitle") }),
2156
- /* @__PURE__ */ y(w, { size: 11, font: "secondary", color: e.dim, children: [
2157
- l("firstHalf"),
2165
+ /* @__PURE__ */ g(xe, { children: [
2166
+ /* @__PURE__ */ g("div", { css: T.timingHeader, children: [
2167
+ /* @__PURE__ */ n(se, { children: s("goalTimingTitle") }),
2168
+ /* @__PURE__ */ g(C, { size: 11, font: "secondary", color: i.dim, children: [
2169
+ s("firstHalf"),
2158
2170
  " ",
2159
- /* @__PURE__ */ r(m, { component: "b", sx: { color: e.text }, children: h.firstHalfGoals }),
2171
+ /* @__PURE__ */ n("b", { css: T.strong, children: a.firstHalfGoals }),
2172
+ " ·",
2160
2173
  " ",
2161
- "· ",
2162
- l("secondHalf"),
2174
+ s("secondHalf"),
2163
2175
  " ",
2164
- /* @__PURE__ */ r(m, { component: "b", sx: { color: e.text }, children: h.secondHalfGoals })
2176
+ /* @__PURE__ */ n("b", { css: T.strong, children: a.secondHalfGoals })
2165
2177
  ] })
2166
2178
  ] }),
2167
- /* @__PURE__ */ r(
2168
- We,
2179
+ /* @__PURE__ */ n(
2180
+ yt,
2169
2181
  {
2170
2182
  height: 8,
2171
2183
  widths: [
2172
- { w: G(h.firstHalfGoals, h.goals), color: e.primaryContainer },
2173
- { w: G(h.secondHalfGoals, h.goals), color: e.primary }
2184
+ { w: Y(a.firstHalfGoals, a.goals), color: i.primaryContainer },
2185
+ { w: Y(a.secondHalfGoals, a.goals), color: i.primary }
2174
2186
  ]
2175
2187
  }
2176
2188
  ),
2177
- /* @__PURE__ */ r(
2178
- m,
2189
+ /* @__PURE__ */ n("div", { css: T.periods, children: a.goalsByPeriod.map((p, k) => /* @__PURE__ */ g("div", { css: T.period, children: [
2190
+ /* @__PURE__ */ n(C, { size: 11, font: "secondary", weight: 700, color: i.text, children: p }),
2191
+ /* @__PURE__ */ n(
2192
+ "div",
2193
+ {
2194
+ css: T.periodBar,
2195
+ style: {
2196
+ height: o(Math.max(6, Math.round(p / _ * 56))),
2197
+ backgroundColor: p === _ ? i.primary : i.tint2
2198
+ }
2199
+ }
2200
+ )
2201
+ ] }, ht[k])) }),
2202
+ /* @__PURE__ */ n("div", { css: T.periodLabels, children: ht.map((p) => /* @__PURE__ */ n(
2203
+ C,
2179
2204
  {
2180
- sx: {
2181
- display: "grid",
2182
- gridTemplateColumns: "repeat(6,1fr)",
2183
- gap: n(6),
2184
- alignItems: "end",
2185
- height: n(72)
2186
- },
2187
- children: h.goalsByPeriod.map((p, I) => /* @__PURE__ */ y(
2188
- m,
2189
- {
2190
- sx: {
2191
- display: "flex",
2192
- flexDirection: "column",
2193
- alignItems: "center",
2194
- gap: n(3),
2195
- height: "100%",
2196
- justifyContent: "flex-end"
2197
- },
2198
- children: [
2199
- /* @__PURE__ */ r(w, { size: 11, font: "secondary", weight: 700, color: e.text, children: p }),
2200
- /* @__PURE__ */ r(
2201
- m,
2202
- {
2203
- sx: {
2204
- width: "100%",
2205
- height: n(Math.max(6, Math.round(p / W * 56))),
2206
- borderRadius: `${t.xs} ${t.xs} 0 0`,
2207
- backgroundColor: p === W ? e.primary : e.tint2
2208
- }
2209
- }
2210
- )
2211
- ]
2212
- },
2213
- De[I]
2214
- ))
2215
- }
2216
- ),
2217
- /* @__PURE__ */ r(m, { sx: { display: "grid", gridTemplateColumns: "repeat(6,1fr)", gap: n(6) }, children: De.map((p) => /* @__PURE__ */ r(w, { size: 10, font: "secondary", color: e.dim, sx: { textAlign: "center", unicodeBidi: "isolate" }, children: p }, p)) })
2205
+ size: 10,
2206
+ font: "secondary",
2207
+ color: i.dim,
2208
+ style: { textAlign: "center", unicodeBidi: "isolate" },
2209
+ children: p
2210
+ },
2211
+ p
2212
+ )) })
2218
2213
  ] })
2219
2214
  ] }),
2220
- /* @__PURE__ */ y(m, { sx: { display: "grid", gridTemplateColumns: ge, gap: n(12) }, children: [
2221
- /* @__PURE__ */ y(se, { children: [
2222
- /* @__PURE__ */ r(q, { children: l("scoringTitle") }),
2223
- k.map((p) => /* @__PURE__ */ y(
2224
- m,
2225
- {
2226
- sx: {
2227
- display: "grid",
2228
- gridTemplateColumns: `${n(150)} 1fr ${n(44)}`,
2229
- alignItems: "center",
2230
- gap: n(10)
2231
- },
2232
- children: [
2233
- /* @__PURE__ */ r(w, { size: 12, font: "secondary", weight: 500, color: e.body, ellipsis: !0, children: p.label }),
2234
- /* @__PURE__ */ r(m, { sx: { height: n(8), borderRadius: t.full, backgroundColor: e.variant, overflow: "hidden" }, children: /* @__PURE__ */ r(m, { sx: { height: "100%", width: `${p.pct}%`, backgroundColor: e.primary, borderRadius: t.full } }) }),
2235
- /* @__PURE__ */ r(w, { size: 12, font: "secondary", weight: 700, color: e.text, sx: { textAlign: "right" }, children: `${p.pct}%` })
2236
- ]
2237
- },
2238
- p.label
2239
- ))
2215
+ /* @__PURE__ */ g("div", { css: Le, children: [
2216
+ /* @__PURE__ */ g(xe, { children: [
2217
+ /* @__PURE__ */ n(se, { children: s("scoringTitle") }),
2218
+ D.map((p) => /* @__PURE__ */ g("div", { css: T.over, children: [
2219
+ /* @__PURE__ */ n(C, { size: 12, font: "secondary", weight: 500, color: i.body, ellipsis: !0, children: p.label }),
2220
+ /* @__PURE__ */ n("div", { css: T.overTrack, children: /* @__PURE__ */ n("div", { css: T.overFill, style: { width: `${p.pct}%` } }) }),
2221
+ /* @__PURE__ */ n(C, { size: 12, font: "secondary", weight: 700, color: i.text, css: T.alignRight, children: `${p.pct}%` })
2222
+ ] }, p.label))
2240
2223
  ] }),
2241
- /* @__PURE__ */ y(se, { children: [
2242
- /* @__PURE__ */ r(q, { children: l("averagesTitle") }),
2243
- /* @__PURE__ */ y(m, { sx: { display: "grid", gridTemplateColumns: "repeat(2,1fr)", gap: n(8) }, children: [
2244
- /* @__PURE__ */ r(
2245
- ie,
2224
+ /* @__PURE__ */ g(xe, { children: [
2225
+ /* @__PURE__ */ n(se, { children: s("averagesTitle") }),
2226
+ /* @__PURE__ */ g("div", { css: T.averages, children: [
2227
+ /* @__PURE__ */ n(
2228
+ Se,
2246
2229
  {
2247
- caption: l("avgShotsOnTarget"),
2248
- icon: /* @__PURE__ */ y("svg", { ...ae, children: [
2249
- /* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "10" }),
2250
- /* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "6" }),
2251
- /* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "2" })
2230
+ caption: s("avgShotsOnTarget"),
2231
+ icon: /* @__PURE__ */ g("svg", { ...ke, children: [
2232
+ /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "10" }),
2233
+ /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "6" }),
2234
+ /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "2" })
2252
2235
  ] }),
2253
- children: g(b(h.shotsOnTarget))
2236
+ children: S(f(a.shotsOnTarget))
2254
2237
  }
2255
2238
  ),
2256
- /* @__PURE__ */ r(
2257
- ie,
2239
+ /* @__PURE__ */ n(
2240
+ Se,
2258
2241
  {
2259
- caption: l("avgCorners"),
2260
- icon: /* @__PURE__ */ y("svg", { ...ae, children: [
2261
- /* @__PURE__ */ r("path", { d: "M4 22V4" }),
2262
- /* @__PURE__ */ r("path", { d: "M4 4h12l-3 4 3 4H4" }),
2263
- /* @__PURE__ */ r("path", { d: "M2 22h6" })
2242
+ caption: s("avgCorners"),
2243
+ icon: /* @__PURE__ */ g("svg", { ...ke, children: [
2244
+ /* @__PURE__ */ n("path", { d: "M4 22V4" }),
2245
+ /* @__PURE__ */ n("path", { d: "M4 4h12l-3 4 3 4H4" }),
2246
+ /* @__PURE__ */ n("path", { d: "M2 22h6" })
2264
2247
  ] }),
2265
- children: g(b(h.corners))
2248
+ children: S(f(a.corners))
2266
2249
  }
2267
2250
  ),
2268
- /* @__PURE__ */ r(
2269
- ie,
2251
+ /* @__PURE__ */ n(
2252
+ Se,
2270
2253
  {
2271
- caption: l("avgCards"),
2272
- icon: /* @__PURE__ */ r("svg", { ...ae, children: /* @__PURE__ */ r("rect", { x: "6", y: "3", width: "12", height: "18", rx: "2" }) }),
2273
- children: g(b(h.yellowCards + h.redCards))
2254
+ caption: s("avgCards"),
2255
+ icon: /* @__PURE__ */ n("svg", { ...ke, children: /* @__PURE__ */ n("rect", { x: "6", y: "3", width: "12", height: "18", rx: "2" }) }),
2256
+ children: S(f(a.yellowCards + a.redCards))
2274
2257
  }
2275
2258
  ),
2276
- /* @__PURE__ */ r(
2277
- ie,
2259
+ /* @__PURE__ */ n(
2260
+ Se,
2278
2261
  {
2279
- caption: l("avgGoalsByHalf"),
2280
- icon: /* @__PURE__ */ y("svg", { ...ae, children: [
2281
- /* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "10" }),
2282
- /* @__PURE__ */ r("path", { d: "M12 2a10 10 0 0 1 0 20z", fill: "currentColor", stroke: "none", opacity: ".35" }),
2283
- /* @__PURE__ */ r("path", { d: "M12 2v20" })
2262
+ caption: s("avgGoalsByHalf"),
2263
+ icon: /* @__PURE__ */ g("svg", { ...ke, children: [
2264
+ /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "10" }),
2265
+ /* @__PURE__ */ n("path", { d: "M12 2a10 10 0 0 1 0 20z", fill: "currentColor", stroke: "none", opacity: ".35" }),
2266
+ /* @__PURE__ */ n("path", { d: "M12 2v20" })
2284
2267
  ] }),
2285
- children: /* @__PURE__ */ y(m, { sx: { display: "flex", alignItems: "baseline", gap: n(4) }, children: [
2286
- g(b(h.firstHalfGoals)),
2287
- /* @__PURE__ */ r(w, { size: 11, font: "secondary", color: e.dim, children: "/" }),
2288
- g(b(h.secondHalfGoals))
2268
+ children: /* @__PURE__ */ g("div", { css: T.halves, children: [
2269
+ S(f(a.firstHalfGoals)),
2270
+ /* @__PURE__ */ n(C, { size: 11, font: "secondary", color: i.dim, children: "/" }),
2271
+ S(f(a.secondHalfGoals))
2289
2272
  ] })
2290
2273
  }
2291
2274
  )
2292
2275
  ] }),
2293
- /* @__PURE__ */ y(
2294
- m,
2295
- {
2296
- sx: {
2297
- display: "flex",
2298
- alignItems: "center",
2299
- justifyContent: "space-between",
2300
- gap: n(12),
2301
- borderTop: `1px solid ${e.border}`,
2302
- paddingTop: n(12),
2303
- flexWrap: "wrap"
2304
- },
2305
- children: [
2306
- /* @__PURE__ */ r(q, { children: l("totalCards") }),
2307
- /* @__PURE__ */ r(m, { sx: { display: "flex", gap: n(20) }, children: [
2308
- { n: h.yellowCards, color: e.yellowCard, key: "yellow" },
2309
- { n: h.redCards, color: e.danger, key: "red" }
2310
- ].map((p) => /* @__PURE__ */ y(m, { sx: { display: "flex", alignItems: "center", gap: n(10) }, children: [
2311
- /* @__PURE__ */ y(m, { component: "span", sx: { position: "relative", width: n(22), height: n(26), flexShrink: 0 }, children: [
2312
- /* @__PURE__ */ r(
2313
- m,
2314
- {
2315
- component: "span",
2316
- sx: {
2317
- position: "absolute",
2318
- left: 0,
2319
- top: n(4),
2320
- width: n(14),
2321
- height: n(20),
2322
- borderRadius: "3px",
2323
- backgroundColor: p.color,
2324
- opacity: 0.45,
2325
- transform: "rotate(-12deg)"
2326
- }
2327
- }
2328
- ),
2329
- /* @__PURE__ */ r(
2330
- m,
2331
- {
2332
- component: "span",
2333
- sx: {
2334
- position: "absolute",
2335
- left: n(6),
2336
- top: 0,
2337
- width: n(14),
2338
- height: n(20),
2339
- borderRadius: "3px",
2340
- backgroundColor: p.color,
2341
- boxShadow: "0 1px 3px rgba(0,0,0,.2)"
2342
- }
2343
- }
2344
- )
2345
- ] }),
2346
- g(p.n, 20)
2347
- ] }, p.key)) })
2348
- ]
2349
- }
2350
- )
2276
+ /* @__PURE__ */ g("div", { css: T.totalCards, children: [
2277
+ /* @__PURE__ */ n(se, { children: s("totalCards") }),
2278
+ /* @__PURE__ */ n("div", { css: T.cardCounts, children: [
2279
+ { n: a.yellowCards, color: i.yellowCard, key: "yellow" },
2280
+ { n: a.redCards, color: i.danger, key: "red" }
2281
+ ].map((p) => /* @__PURE__ */ g("div", { css: T.cardCount, children: [
2282
+ /* @__PURE__ */ g("span", { css: T.cardIcon, children: [
2283
+ /* @__PURE__ */ n("span", { css: T.cardBack, style: { backgroundColor: p.color } }),
2284
+ /* @__PURE__ */ n("span", { css: T.cardFront, style: { backgroundColor: p.color } })
2285
+ ] }),
2286
+ S(p.n, 20)
2287
+ ] }, p.key)) })
2288
+ ] })
2351
2289
  ] })
2352
2290
  ] }),
2353
- R.length ? /* @__PURE__ */ r(
2354
- m,
2355
- {
2356
- sx: {
2357
- display: "grid",
2358
- gridTemplateColumns: "repeat(12, minmax(0, 1fr))",
2359
- gap: n(12)
2291
+ $.length ? /* @__PURE__ */ n("div", { css: T.callouts, children: $.map((p, k) => {
2292
+ const I = De(u.teamCTA, "team", p.teamId), G = I != null && I.href ? "a" : "div";
2293
+ return /* @__PURE__ */ g(
2294
+ G,
2295
+ {
2296
+ href: (I == null ? void 0 : I.href) ?? void 0,
2297
+ target: I == null ? void 0 : I.target,
2298
+ onClick: I == null ? void 0 : I.onClick,
2299
+ css: R ? T.callout.interactive : T.callout.plain,
2300
+ style: { gridColumn: `span ${Uo(k, $.length, e, t)}` },
2301
+ children: [
2302
+ /* @__PURE__ */ n(V, { url: l.logo(p.teamId), size: 36 }),
2303
+ /* @__PURE__ */ g("div", { css: T.calloutText, children: [
2304
+ /* @__PURE__ */ n(se, { size: 10, style: { display: "block" }, children: p.label }),
2305
+ /* @__PURE__ */ n(C, { component: "div", size: 13, weight: 700, color: i.text, ellipsis: !0, cms: !0, children: l.name(p.teamId) })
2306
+ ] }),
2307
+ /* @__PURE__ */ g("div", { css: T.calloutValue, children: [
2308
+ /* @__PURE__ */ n(C, { component: "div", size: 22, weight: 700, color: i.primary, style: { lineHeight: 1 }, children: p.value }),
2309
+ /* @__PURE__ */ n(
2310
+ C,
2311
+ {
2312
+ component: "div",
2313
+ size: 10,
2314
+ font: "secondary",
2315
+ color: i.dim,
2316
+ style: { marginTop: o(2, 10) },
2317
+ children: p.unit
2318
+ }
2319
+ )
2320
+ ] })
2321
+ ]
2360
2322
  },
2361
- children: R.map((p, I) => {
2362
- const v = fe(u.teamCTA, "team", p.teamId);
2363
- return /* @__PURE__ */ y(
2364
- Z,
2365
- {
2366
- component: v != null && v.href ? "a" : "div",
2367
- href: (v == null ? void 0 : v.href) ?? void 0,
2368
- target: v == null ? void 0 : v.target,
2369
- onClick: v == null ? void 0 : v.onClick,
2370
- sx: {
2371
- padding: `${n(12)} ${n(14)}`,
2372
- display: "flex",
2373
- alignItems: "center",
2374
- gap: n(10),
2375
- cursor: _ ? "pointer" : "default",
2376
- gridColumn: `span ${bo(I, R.length, o, s)}`,
2377
- textDecoration: "none",
2378
- color: "inherit",
2379
- "&:hover": { backgroundColor: _ ? e.onSurface : e.surface }
2380
- },
2381
- children: [
2382
- /* @__PURE__ */ r(H, { url: a.logo(p.teamId), size: 36 }),
2383
- /* @__PURE__ */ y(m, { sx: { minWidth: 0, flex: 1 }, children: [
2384
- /* @__PURE__ */ r(q, { size: 10, sx: { display: "block" }, children: p.label }),
2385
- /* @__PURE__ */ r(w, { component: "div", size: 13, weight: 700, color: e.text, ellipsis: !0, cms: !0, children: a.name(p.teamId) })
2386
- ] }),
2387
- /* @__PURE__ */ y(m, { sx: { textAlign: "right", flexShrink: 0 }, children: [
2388
- /* @__PURE__ */ r(w, { component: "div", size: 22, weight: 700, color: e.primary, sx: { lineHeight: 1 }, children: p.value }),
2389
- /* @__PURE__ */ r(w, { component: "div", size: 10, font: "secondary", color: e.dim, sx: { marginTop: n(2, 10) }, children: p.unit })
2390
- ] })
2391
- ]
2392
- },
2393
- p.label
2394
- );
2395
- })
2396
- }
2397
- ) : null,
2398
- z.length ? /* @__PURE__ */ r(m, { sx: { display: "grid", gridTemplateColumns: ge, gap: n(12) }, children: z.map(({ label: p, match: I }) => {
2399
- const v = fe(u.matchCTA, "match", I.id), [P, K] = I.fullTime ?? [0, 0];
2400
- return /* @__PURE__ */ y(
2401
- Z,
2323
+ p.label
2324
+ );
2325
+ }) }) : null,
2326
+ z.length ? /* @__PURE__ */ n("div", { css: Le, children: z.map(({ label: p, match: k }) => {
2327
+ const I = De(u.matchCTA, "match", k.id), [G, J] = k.fullTime ?? [0, 0], H = I != null && I.href ? "a" : "div";
2328
+ return /* @__PURE__ */ g(
2329
+ H,
2402
2330
  {
2403
- component: v != null && v.href ? "a" : "div",
2404
- href: (v == null ? void 0 : v.href) ?? void 0,
2405
- target: v == null ? void 0 : v.target,
2406
- onClick: v == null ? void 0 : v.onClick,
2407
- sx: {
2408
- padding: `${n(12)} ${n(16)}`,
2409
- display: "flex",
2410
- flexDirection: "column",
2411
- gap: n(8),
2412
- cursor: U ? "pointer" : "default",
2413
- textDecoration: "none",
2414
- color: "inherit",
2415
- "&:hover": { backgroundColor: U ? e.onSurface : e.surface }
2416
- },
2331
+ href: (I == null ? void 0 : I.href) ?? void 0,
2332
+ target: I == null ? void 0 : I.target,
2333
+ onClick: I == null ? void 0 : I.onClick,
2334
+ css: M ? T.record.interactive : T.record.plain,
2417
2335
  children: [
2418
- /* @__PURE__ */ y(q, { size: 10, sx: { display: "flex", justifyContent: "space-between" }, children: [
2419
- /* @__PURE__ */ r("span", { children: p }),
2420
- /* @__PURE__ */ r("span", { children: l("recordRound", {
2421
- round: I.round,
2422
- date: d.date(I.start, { day: "2-digit", month: "2-digit" })
2336
+ /* @__PURE__ */ g(se, { size: 10, style: { display: "flex", justifyContent: "space-between" }, children: [
2337
+ /* @__PURE__ */ n("span", { children: p }),
2338
+ /* @__PURE__ */ n("span", { children: s("recordRound", {
2339
+ round: k.round,
2340
+ date: m.date(k.start, { day: "2-digit", month: "2-digit" })
2423
2341
  }) })
2424
2342
  ] }),
2425
- /* @__PURE__ */ y(
2426
- m,
2427
- {
2428
- sx: {
2429
- display: "grid",
2430
- gridTemplateColumns: "minmax(0,1fr) auto minmax(0,1fr)",
2431
- alignItems: "center",
2432
- gap: n(8)
2433
- },
2434
- children: [
2435
- /* @__PURE__ */ y(m, { sx: { display: "flex", alignItems: "center", justifyContent: "flex-end", gap: n(8), minWidth: 0 }, children: [
2436
- /* @__PURE__ */ r(w, { size: 13, weight: 600, color: e.text, ellipsis: !0, cms: !0, children: a.name(I.home.id) }),
2437
- /* @__PURE__ */ r(H, { url: a.logo(I.home.id), size: 28 })
2438
- ] }),
2439
- /* @__PURE__ */ r(
2440
- w,
2441
- {
2442
- size: 18,
2443
- weight: 700,
2444
- color: e.text,
2445
- sx: {
2446
- letterSpacing: n(1, 18),
2447
- backgroundColor: e.onSurface,
2448
- borderRadius: t.sm,
2449
- padding: `${n(4, 18)} ${n(10, 18)}`
2450
- },
2451
- children: `${P} : ${K}`
2452
- }
2453
- ),
2454
- /* @__PURE__ */ y(m, { sx: { display: "flex", alignItems: "center", gap: n(8), minWidth: 0 }, children: [
2455
- /* @__PURE__ */ r(H, { url: a.logo(I.away.id), size: 28 }),
2456
- /* @__PURE__ */ r(w, { size: 13, weight: 600, color: e.text, ellipsis: !0, cms: !0, children: a.name(I.away.id) })
2457
- ] })
2458
- ]
2459
- }
2460
- )
2343
+ /* @__PURE__ */ g("div", { css: T.recordTeams, children: [
2344
+ /* @__PURE__ */ g("div", { css: T.recordHome, children: [
2345
+ /* @__PURE__ */ n(C, { size: 13, weight: 600, color: i.text, ellipsis: !0, cms: !0, children: l.name(k.home.id) }),
2346
+ /* @__PURE__ */ n(V, { url: l.logo(k.home.id), size: 28 })
2347
+ ] }),
2348
+ /* @__PURE__ */ n(C, { size: 18, weight: 700, color: i.text, css: T.recordScore, children: `${G} : ${J}` }),
2349
+ /* @__PURE__ */ g("div", { css: T.recordAway, children: [
2350
+ /* @__PURE__ */ n(V, { url: l.logo(k.away.id), size: 28 }),
2351
+ /* @__PURE__ */ n(C, { size: 13, weight: 600, color: i.text, ellipsis: !0, cms: !0, children: l.name(k.away.id) })
2352
+ ] })
2353
+ ] })
2461
2354
  ]
2462
2355
  },
2463
2356
  p
2464
2357
  );
2465
2358
  }) }) : null
2466
2359
  ] });
2467
- }, Co = ["header", "matches", "players", "season"], So = 3e4, vo = (e) => {
2360
+ }, Ko = ["header", "matches", "players", "season"], Xo = 3e4, bt = {
2361
+ root: d({
2362
+ fontSize: "1em",
2363
+ fontFamily: i.fontPrimary,
2364
+ color: i.text,
2365
+ lineHeight: "normal",
2366
+ display: "flex",
2367
+ flexDirection: "column",
2368
+ gap: o(16)
2369
+ }),
2370
+ message: d(me, { padding: o(24) })
2371
+ }, Yo = (e) => {
2468
2372
  const {
2469
2373
  entityId: t,
2470
- sdk: o,
2471
- language: s,
2472
- seasonId: i,
2473
- stageId: a,
2474
- sections: c = Co,
2475
- liveRefresh: l = !0,
2476
- refreshInterval: d = So,
2477
- labels: u
2478
- } = e, { colors: h, fonts: f } = F(), C = to(u), b = L.useMemo(() => Zt(s), [s]), { data: g, competitionId: $, entities: S, loading: W, error: k } = Kt(
2479
- o,
2374
+ sdk: r,
2375
+ language: l,
2376
+ seasonId: c,
2377
+ stageId: s,
2378
+ sections: m = Ko,
2379
+ liveRefresh: u = !0,
2380
+ refreshInterval: a = Xo,
2381
+ labels: h
2382
+ } = e, b = go(), f = ko(h), S = P.useMemo(() => xo(l), [l]), { data: w, competitionId: y, entities: _, loading: D, error: E } = ho(
2383
+ r,
2480
2384
  t,
2481
- s,
2385
+ l,
2482
2386
  "–",
2483
- { seasonId: i, stageId: a, liveRefresh: l, refreshInterval: d }
2484
- ), M = L.useMemo(() => g ? g.matches.filter(we) : [], [g]), O = L.useMemo(() => Vt(M), [M]), _ = Array.from(new Set(c)), R = (A) => /* @__PURE__ */ r(Z, { sx: { padding: n(24) }, children: /* @__PURE__ */ r(w, { component: "div", size: 14, font: "secondary", color: h.dim, sx: { textAlign: "center" }, children: A }) });
2485
- let E;
2486
- return W ? E = /* @__PURE__ */ r(ut, { my: 10 }) : k ? E = R(C("loadFailed")) : !g || g.matches.length === 0 ? E = R(C("noData")) : E = /* @__PURE__ */ r(
2487
- oo,
2488
- {
2489
- value: { sdk: o, data: g, competitionId: $, entities: S, finished: M, tally: O, label: C, fmt: b, props: e },
2490
- children: _.map((A) => A === "header" ? /* @__PURE__ */ r(no, {}, A) : A === "matches" ? /* @__PURE__ */ r(yo, {}, A) : A === "players" ? g.athletes.length ? /* @__PURE__ */ r(ao, {}, A) : null : A === "season" ? /* @__PURE__ */ r(wo, {}, A) : null)
2491
- }
2492
- ), /* @__PURE__ */ r(
2493
- m,
2494
- {
2495
- sx: {
2496
- fontSize: "1em",
2497
- fontFamily: f.primary,
2498
- color: h.text,
2499
- lineHeight: "normal",
2500
- display: "flex",
2501
- flexDirection: "column",
2502
- gap: n(16)
2503
- },
2504
- children: E
2505
- }
2506
- );
2507
- }, Io = (e) => {
2508
- const [t, o] = L.useState(!1), [s, i] = L.useState(!1), a = pt(e.language), c = L.useRef(
2509
- `competition-statistics-shadow-root-${Math.random().toString(36).substring(2, 11)}`
2510
- ), l = L.useRef(null), d = L.useRef(null), u = L.useRef(null), [h, f] = L.useState(null);
2511
- L.useEffect(() => {
2512
- mt(e.language || "en").finally(() => i(!0));
2513
- }, [e.language]), L.useEffect(() => {
2514
- if (!l.current) return;
2515
- l.current.shadowRoot ? (d.current = l.current.shadowRoot, u.current = d.current.getElementById(
2516
- c.current
2517
- ), u.current || (u.current = document.createElement("div"), u.current.id = c.current, u.current.style.height = "100%", d.current.appendChild(u.current))) : (d.current = l.current.attachShadow({ mode: "open" }), u.current = document.createElement("div"), u.current.id = c.current, u.current.style.height = "100%", d.current.appendChild(u.current)), ht(u.current, a);
2518
- const $ = gt("competition-statistics", a);
2519
- return f(
2520
- (S) => (S == null ? void 0 : S.key) === $ ? S : ft(
2521
- "competition-statistics",
2522
- d.current,
2523
- a
2524
- )
2525
- ), o(!0), () => {
2526
- o(!1);
2527
- };
2528
- }, [a]);
2529
- const C = e.themeOptions, b = /* @__PURE__ */ r(
2530
- m,
2387
+ { seasonId: c, stageId: s, liveRefresh: u, refreshInterval: a }
2388
+ ), x = P.useMemo(() => w ? w.matches.filter(We) : [], [w]), R = P.useMemo(() => fo(x), [x]), $ = Array.from(new Set(m)), W = (z) => /* @__PURE__ */ n("div", { css: bt.message, children: /* @__PURE__ */ n(C, { component: "div", size: 14, font: "secondary", color: i.dim, style: { textAlign: "center" }, children: z }) });
2389
+ let L;
2390
+ return D ? L = /* @__PURE__ */ n(Et, { marginBlock: "5em" }) : E ? L = W(f("loadFailed")) : !w || w.matches.length === 0 ? L = W(f("noData")) : L = /* @__PURE__ */ n(
2391
+ Io,
2531
2392
  {
2532
- ref: l,
2533
- lang: e.language || "en",
2534
- sx: { height: "100%", display: "block" }
2393
+ value: { sdk: r, data: w, competitionId: y, entities: _, finished: x, tally: R, label: f, fmt: S, props: e },
2394
+ children: $.map((z) => z === "header" ? /* @__PURE__ */ n($o, {}, z) : z === "matches" ? /* @__PURE__ */ n(Ho, {}, z) : z === "players" ? w.athletes.length ? /* @__PURE__ */ n(Eo, {}, z) : null : z === "season" ? /* @__PURE__ */ n(Vo, {}, z) : null)
2535
2395
  }
2536
- ), g = t && s && u.current && h ? $t(
2537
- // Keyed on the cache, not on `direction`: it must change in the same render that adopts
2538
- // the new cache, or CssVarsProvider writes its CSS variables into the outgoing cache and
2539
- // never repeats.
2540
- /* @__PURE__ */ r(It, { value: h, children: /* @__PURE__ */ r(yt, { containerRef: l, children: /* @__PURE__ */ r(
2541
- xt,
2542
- {
2543
- customTheme: C,
2544
- mode: C == null ? void 0 : C.mode,
2545
- shadowRootElement: u.current,
2546
- direction: a,
2547
- children: /* @__PURE__ */ y(
2548
- bt,
2549
- {
2550
- shadowRootElement: u.current,
2551
- leadPhoneCountryCode: null,
2552
- language: e.language,
2553
- optionsLayout: null,
2554
- direction: a,
2555
- disableCache: e.disableCache ?? !1,
2556
- children: [
2557
- /* @__PURE__ */ r(
2558
- tt,
2559
- {
2560
- styles: {
2561
- "@keyframes cs-pulse": {
2562
- "0%, 100%": { opacity: 1, transform: "scale(1)" },
2563
- "50%": { opacity: 0.4, transform: "scale(.7)" }
2564
- }
2565
- }
2566
- }
2567
- ),
2568
- e.children
2569
- ]
2570
- }
2571
- )
2572
- }
2573
- ) }) }, h.key),
2574
- u.current
2575
- ) : null;
2576
- return /* @__PURE__ */ y(ye, { children: [
2577
- b,
2578
- g
2579
- ] });
2580
- }, $o = (e) => /* @__PURE__ */ r(Io, { ...e, children: /* @__PURE__ */ r(vo, { ...e }) }), Wo = Tt($o);
2396
+ ), /* @__PURE__ */ n("div", { css: bt.root, style: b, children: L });
2397
+ }, qo = (e) => /* @__PURE__ */ n(
2398
+ Mt,
2399
+ {
2400
+ packageName: "competition-statistics",
2401
+ language: e.language,
2402
+ themeOptions: e.themeOptions,
2403
+ disableCache: e.disableCache,
2404
+ fillHeight: !0,
2405
+ children: /* @__PURE__ */ n(Yo, { ...e })
2406
+ }
2407
+ ), ar = Xt(qo);
2581
2408
  export {
2582
- Wo as CompetitionStatistics
2409
+ ar as CompetitionStatistics
2583
2410
  };