fansunited-frontend-components 0.0.97 → 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 +4281 -4919
  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-BkiEu_79.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
package/Standings.js CHANGED
@@ -1,17 +1,17 @@
1
- import { jsxs as C, jsx as r, Fragment as _ } from "react/jsx-runtime";
2
- import E, { useState as N, useEffect as ge, useMemo as G, useRef as ve } from "react";
3
- import { Box as S, Typography as L, Chip as Ee, Sheet as he, Table as Pe, Tabs as ye, TabList as xe, Tab as Se, TabPanel as be } from "@mui/joy";
4
- import { useTranslation as Y } from "react-i18next";
5
- import { hexToRgb as ee, useDisableCache as Ce, extractSdkErrorMessage as Fe, useColors as D, useFontFamily as P, useSpacingScale as $, toIntlLocale as q, bidiIsolate as V, useCornerRadius as j, useConstantContext as Ke, ConstantsContext as Ae, useIsRtl as Oe, InlineSpinner as Ne, Spinner as ze, getLanguageDirection as Ie, initializeI18n as Me, applyDirectionToMount as $e, widgetCacheKey as Ue, createWidgetCache as We, ContainerProvider as Be, ThemeProvider as _e, ConstantsProvider as He } from "fansunited-frontend-core";
6
- import { MatchFilters as de } from "fansunited-sdk-esm/models";
7
- import Ge from "@mui/icons-material/EmojiEvents";
8
- import { createPortal as we } from "react-dom";
9
- import { CacheProvider as je } from "@emotion/react";
10
- import { w as Ze } from "./chunks/withVersionStamp-BkiEu_79.js";
11
- const Ve = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").trim().replace(
1
+ import { jsxs as S, jsx as s, Fragment as Z } from "@emotion/react/jsx-runtime";
2
+ import { InlineSpinner as nt, Spinner as ot, WidgetPortal as rt } from "fansunited-frontend-core/ui/emotion";
3
+ import Ie, { useState as K, useEffect as Be, useMemo as j, useRef as _e, useId as at } from "react";
4
+ import { css as a } from "@emotion/react";
5
+ import { useTranslation as oe } from "react-i18next";
6
+ import { hexToRgb as He, useDisableCache as Ge, extractSdkErrorMessage as st, useColors as je, toIntlLocale as ue, bidiIsolate as te, useConstantContext as lt, ConstantsContext as it, useIsRtl as Ve } from "fansunited-frontend-core";
7
+ import { MatchFilters as we } from "fansunited-sdk-esm/models";
8
+ import { EmojiEventsIcon as ct } from "fansunited-frontend-core/ui/icons";
9
+ import { createPortal as dt } from "react-dom";
10
+ import { w as ut } from "./chunks/withVersionStamp-BsLyhvNA.js";
11
+ const pt = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").trim().replace(
12
12
  /\S+/g,
13
13
  (n) => n.charAt(0).toUpperCase() + n.slice(1).toLowerCase()
14
- ), Ye = [
14
+ ), mt = [
15
15
  "championsLeague",
16
16
  "championsLeagueQual",
17
17
  "europaLeague",
@@ -29,10 +29,10 @@ const Ve = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " "
29
29
  "championshipGroup",
30
30
  "europaClGroup",
31
31
  "relegationGroup"
32
- ], te = (e) => e.toLowerCase().replace(/[^a-z0-9]/g, ""), Qe = Ye.reduce(
33
- (e, t) => (e[te(t)] = t, e),
32
+ ], fe = (e) => e.toLowerCase().replace(/[^a-z0-9]/g, ""), ft = mt.reduce(
33
+ (e, t) => (e[fe(t)] = t, e),
34
34
  {}
35
- ), ke = (e) => Qe[te(e)] ?? null, Xe = {
35
+ ), Ze = (e) => ft[fe(e)] ?? null, gt = {
36
36
  championsLeague: "primary",
37
37
  championshipGroup: "primary",
38
38
  playOffs: "primary",
@@ -50,386 +50,397 @@ const Ve = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " "
50
50
  relegationPlayOffs: "warning",
51
51
  relegationGroup: "warning",
52
52
  relegation: "danger"
53
- }, qe = {
53
+ }, ht = {
54
54
  primary: 0,
55
55
  success: 1,
56
56
  warning: 2,
57
57
  danger: 3
58
- }, Je = (e, t) => t === 0 ? e : `rgba(${ee(e)}, ${Math.max(0.25, 1 - t * 0.25)})`, et = (e, t) => {
59
- const n = te(e);
58
+ }, yt = (e, t) => t === 0 ? e : `rgba(${He(e)}, ${Math.max(0.25, 1 - t * 0.25)})`, bt = (e, t) => {
59
+ const n = fe(e);
60
60
  return n.includes("relegation") ? n.includes("playoff") || n.includes("group") ? "warning" : "danger" : t ? "primary" : "success";
61
- }, tt = (e, t, n) => {
62
- const o = /* @__PURE__ */ new Map();
63
- if (e.forEach((d, u) => {
64
- if (!d) return;
65
- const p = o.get(d);
66
- p ? p.push(u) : o.set(d, [u]);
67
- }), !o.size) return [];
68
- const a = (d) => {
69
- const u = o.get(d) ?? [];
70
- return u.reduce((p, h) => p + h, 0) / u.length;
71
- }, l = Array.from(o.keys()).sort(
72
- (d, u) => a(d) - a(u)
73
- ), c = l.map((d) => ke(d)), i = l.map((d, u) => {
74
- const p = c[u];
75
- return p ? Xe[p] : et(d, u === 0);
76
- }), f = /* @__PURE__ */ new Map(), s = l.map((d, u) => {
77
- const p = i[u], h = f.get(p) ?? 0;
78
- return f.set(p, h + 1), Je(t[p], h);
61
+ }, St = (e, t, n) => {
62
+ const r = /* @__PURE__ */ new Map();
63
+ if (e.forEach((c, d) => {
64
+ if (!c) return;
65
+ const i = r.get(c);
66
+ i ? i.push(d) : r.set(c, [d]);
67
+ }), !r.size) return [];
68
+ const l = (c) => {
69
+ const d = r.get(c) ?? [];
70
+ return d.reduce((i, h) => i + h, 0) / d.length;
71
+ }, p = Array.from(r.keys()).sort(
72
+ (c, d) => l(c) - l(d)
73
+ ), m = p.map((c) => Ze(c)), u = p.map((c, d) => {
74
+ const i = m[d];
75
+ return i ? gt[i] : bt(c, d === 0);
76
+ }), f = /* @__PURE__ */ new Map(), g = p.map((c, d) => {
77
+ const i = u[d], h = f.get(i) ?? 0;
78
+ return f.set(i, h + 1), yt(t[i], h);
79
79
  });
80
- return l.map((d, u) => {
81
- const p = c[u], h = p ? n == null ? void 0 : n[p] : void 0;
80
+ return p.map((c, d) => {
81
+ const i = m[d], h = i ? n == null ? void 0 : n[i] : void 0;
82
82
  return {
83
- key: d,
84
- color: h ?? s[u],
85
- label: Ve(d),
86
- tierRank: qe[i[u]]
83
+ key: c,
84
+ color: h ?? g[d],
85
+ label: pt(c),
86
+ tierRank: ht[u[d]]
87
87
  };
88
- }).sort((d, u) => d.tierRank - u.tierRank).map(({ key: d, color: u, label: p }) => ({ key: d, color: u, label: p }));
89
- }, nt = (e, t) => {
88
+ }).sort((c, d) => c.tierRank - d.tierRank).map(({ key: c, color: d, label: i }) => ({ key: c, color: d, label: i }));
89
+ }, xt = (e, t) => {
90
90
  var n;
91
91
  if (!e) return [];
92
92
  if (t) {
93
- const o = (n = e.stages) == null ? void 0 : n.find((a) => a.id === t);
94
- return o && o.type === "standing" ? [o] : [];
93
+ const r = (n = e.stages) == null ? void 0 : n.find((l) => l.id === t);
94
+ return r && r.type === "standing" ? [r] : [];
95
95
  }
96
- return (e.stages ?? []).filter((o) => o.type === "standing");
97
- }, Le = (e) => {
96
+ return (e.stages ?? []).filter((r) => r.type === "standing");
97
+ }, Xe = (e) => {
98
98
  var t;
99
99
  return ((t = e == null ? void 0 : e.find((n) => n.key === "LOGO")) == null ? void 0 : t.value) ?? null;
100
- }, M = (e, t) => {
101
- const n = e.find((o) => {
102
- var a;
103
- return ((a = o.key) == null ? void 0 : a.toLowerCase()) === t;
100
+ }, z = (e, t) => {
101
+ const n = e.find((r) => {
102
+ var l;
103
+ return ((l = r.key) == null ? void 0 : l.toLowerCase()) === t;
104
104
  });
105
105
  return n && Number(n.value) || 0;
106
- }, ot = (e, t) => e.some((n) => {
107
- var o;
108
- return ((o = n.key) == null ? void 0 : o.toLowerCase()) === t;
109
- }), rt = (e) => {
110
- const t = M(e, "goals_for"), n = M(e, "goals_against"), o = M(e, "played"), a = M(e, "won");
106
+ }, vt = (e, t) => e.some((n) => {
107
+ var r;
108
+ return ((r = n.key) == null ? void 0 : r.toLowerCase()) === t;
109
+ }), wt = (e) => {
110
+ const t = z(e, "goals_for"), n = z(e, "goals_against"), r = z(e, "played"), l = z(e, "won");
111
111
  return {
112
- played: o,
113
- won: a,
114
- drawn: M(e, "drawn"),
115
- lost: M(e, "lost"),
112
+ played: r,
113
+ won: l,
114
+ drawn: z(e, "drawn"),
115
+ lost: z(e, "lost"),
116
116
  goalsFor: t,
117
117
  goalsAgainst: n,
118
118
  // Derived rather than trusting the (possibly absent) goals_difference stat key.
119
119
  goalsDifference: t - n,
120
- points: M(e, "points"),
121
- winPercentage: o > 0 ? a / o : 0
120
+ points: z(e, "points"),
121
+ winPercentage: r > 0 ? l / r : 0
122
122
  };
123
- }, at = (e, t) => t == null ? null : e === t ? "same" : e < t ? "up" : "down", st = (e, t) => {
124
- var a;
125
- const n = e.competitorModel, o = e.rank ?? 0;
123
+ }, kt = (e, t) => t == null ? null : e === t ? "same" : e < t ? "up" : "down", Ct = (e, t) => {
124
+ var l;
125
+ const n = e.competitorModel, r = e.rank ?? 0;
126
126
  return {
127
127
  competitorId: e.competitorId,
128
- rank: o,
128
+ rank: r,
129
129
  lastRank: e.lastRank,
130
- rankChange: at(o, e.lastRank),
130
+ rankChange: kt(r, e.lastRank),
131
131
  teamName: (n == null ? void 0 : n.name) ?? t,
132
132
  teamShortName: (n == null ? void 0 : n.shortName) ?? null,
133
- logoUrl: Le(n == null ? void 0 : n.assets),
134
- stats: rt(e.stats ?? []),
135
- zoneKey: ((a = e.rules) == null ? void 0 : a[0]) ?? null
133
+ logoUrl: Xe(n == null ? void 0 : n.assets),
134
+ stats: wt(e.stats ?? []),
135
+ zoneKey: ((l = e.rules) == null ? void 0 : l[0]) ?? null
136
136
  };
137
- }, lt = (e, t, n) => {
137
+ }, Lt = (e, t, n) => {
138
138
  if (t == null && n == null) return e;
139
- const o = e.map((f) => f.rank ?? 0);
140
- if (!o.length) return e;
141
- const a = Math.min(...o), l = Math.max(...o), c = Math.max(t ?? a, a), i = Math.min(n ?? l, l);
139
+ const r = e.map((f) => f.rank ?? 0);
140
+ if (!r.length) return e;
141
+ const l = Math.min(...r), p = Math.max(...r), m = Math.max(t ?? l, l), u = Math.min(n ?? p, p);
142
142
  return e.filter((f) => {
143
- const s = f.rank ?? 0;
144
- return s >= c && s <= i;
143
+ const g = f.rank ?? 0;
144
+ return g >= m && g <= u;
145
145
  });
146
- }, it = (e, t, n, o, a, l) => {
147
- const c = lt(e.standings ?? [], a, l), i = c.map((d) => st(d, o)), f = tt(
148
- i.map((d) => d.zoneKey),
146
+ }, Dt = (e, t, n, r, l, p) => {
147
+ const m = Lt(e.standings ?? [], l, p), u = m.map((c) => Ct(c, r)), f = St(
148
+ u.map((c) => c.zoneKey),
149
149
  t,
150
150
  n
151
- ), s = c.some(
152
- (d) => ot(d.stats ?? [], "points")
151
+ ), g = m.some(
152
+ (c) => vt(c.stats ?? [], "points")
153
153
  );
154
- return { id: e.id, name: e.name, rows: i, zones: f, hasPoints: s };
155
- }, ct = (e) => e ? {
154
+ return { id: e.id, name: e.name, rows: u, zones: f, hasPoints: g };
155
+ }, Tt = (e) => e ? {
156
156
  name: e.name ?? null,
157
157
  year: e.year ?? null,
158
158
  startDate: e.startDate ?? null,
159
159
  endDate: e.endDate ?? null
160
- } : null, dt = (e, t, n, o, a, l, c) => {
161
- var s;
162
- const i = e.groups ?? [], f = a && a.length ? i.filter(
163
- (d) => d.id !== null && a.includes(d.id)
164
- ) : i;
160
+ } : null, $t = (e, t, n, r, l, p, m) => {
161
+ var g;
162
+ const u = e.groups ?? [], f = l && l.length ? u.filter(
163
+ (c) => c.id !== null && l.includes(c.id)
164
+ ) : u;
165
165
  return {
166
166
  id: e.id,
167
- name: ((s = e.stageNameModel) == null ? void 0 : s.name) ?? null,
167
+ name: ((g = e.stageNameModel) == null ? void 0 : g.name) ?? null,
168
168
  startDate: e.startDate ?? null,
169
169
  endDate: e.endDate ?? null,
170
170
  groups: f.map(
171
- (d) => it(
172
- d,
171
+ (c) => Dt(
172
+ c,
173
173
  t,
174
174
  n,
175
- o,
176
- l,
177
- c
175
+ r,
176
+ p,
177
+ m
178
178
  )
179
179
  )
180
180
  };
181
- }, ut = (e, t, n, o, a, l, c, i) => {
182
- const s = nt(e.season, i).map(
183
- (d) => dt(
184
- d,
181
+ }, Ft = (e, t, n, r, l, p, m, u) => {
182
+ const g = xt(e.season, u).map(
183
+ (c) => $t(
184
+ c,
185
185
  t,
186
186
  n,
187
- o,
188
- a,
187
+ r,
189
188
  l,
190
- c
189
+ p,
190
+ m
191
191
  )
192
192
  );
193
193
  return {
194
194
  competitionId: e.id,
195
195
  competitionName: e.name ?? e.shortName ?? e.id,
196
196
  sport: e.sport ?? null,
197
- logoUrl: Le(e.assets),
198
- season: ct(e.season),
199
- stageFound: s.length > 0,
200
- stages: s
197
+ logoUrl: Xe(e.assets),
198
+ season: Tt(e.season),
199
+ stageFound: g.length > 0,
200
+ stages: g
201
201
  };
202
- }, mt = (e, t, n, o, a, l, c, i, f) => {
203
- const [s, d] = N(null), [u, p] = N(!0), [h, b] = N(null), x = Ce();
204
- return ge(() => {
202
+ }, Pt = (e, t, n, r, l, p, m, u, f) => {
203
+ const [g, c] = K(null), [d, i] = K(!0), [h, w] = K(null), x = Ge();
204
+ return Be(() => {
205
205
  if (!e || !t) return;
206
- let m = !1;
207
- return p(!0), b(null), t.sports.getCompetitionById(
206
+ let k = !1;
207
+ return i(!0), w(null), t.sports.getCompetitionById(
208
208
  e,
209
- c ? { seasonId: c } : void 0,
209
+ m ? { seasonId: m } : void 0,
210
210
  x
211
- ).then((w) => {
212
- m || d(w);
213
- }).catch((w) => {
214
- m || b(Fe(w, t));
211
+ ).then((b) => {
212
+ k || c(b);
213
+ }).catch((b) => {
214
+ k || w(st(b, t));
215
215
  }).finally(() => {
216
- m || p(!1);
216
+ k || i(!1);
217
217
  }), () => {
218
- m = !0;
218
+ k = !0;
219
219
  };
220
- }, [e, t, c, x]), { data: G(() => s ? ut(
221
- s,
220
+ }, [e, t, m, x]), { data: j(() => g ? Ft(
221
+ g,
222
222
  n,
223
- a,
224
- o,
225
223
  l,
226
- i == null ? void 0 : i.startRank,
227
- i == null ? void 0 : i.endRank,
224
+ r,
225
+ p,
226
+ u == null ? void 0 : u.startRank,
227
+ u == null ? void 0 : u.endRank,
228
228
  f
229
229
  ) : null, [
230
- s,
230
+ g,
231
231
  n,
232
- a,
233
- o,
234
232
  l,
235
- i == null ? void 0 : i.startRank,
236
- i == null ? void 0 : i.endRank,
233
+ r,
234
+ p,
235
+ u == null ? void 0 : u.startRank,
236
+ u == null ? void 0 : u.endRank,
237
237
  f
238
- ]), loading: u, error: h };
239
- }, pt = 50, ft = (e, t) => e > t ? "win" : e < t ? "loss" : "draw", gt = (e, t) => {
240
- var f, s;
241
- const n = e.homeTeam.id === t, o = e.scores, a = Number(((f = o == null ? void 0 : o.ftScore) == null ? void 0 : f.homeGoals) ?? 0), l = Number(((s = o == null ? void 0 : o.ftScore) == null ? void 0 : s.awayGoals) ?? 0), c = n ? a : l, i = n ? l : a;
238
+ ]), loading: d, error: h };
239
+ }, At = 50, Rt = (e, t) => e > t ? "win" : e < t ? "loss" : "draw", Kt = (e, t) => {
240
+ var f, g;
241
+ const n = e.homeTeam.id === t, r = e.scores, l = Number(((f = r == null ? void 0 : r.ftScore) == null ? void 0 : f.homeGoals) ?? 0), p = Number(((g = r == null ? void 0 : r.ftScore) == null ? void 0 : g.awayGoals) ?? 0), m = n ? l : p, u = n ? p : l;
242
242
  return {
243
- result: ft(c, i),
243
+ result: Rt(m, u),
244
244
  isHome: n,
245
245
  opponentId: n ? e.awayTeam.id : e.homeTeam.id,
246
- teamScore: c,
247
- opponentScore: i,
246
+ teamScore: m,
247
+ opponentScore: u,
248
248
  kickoffAt: e.kickoffAt
249
249
  };
250
- }, ue = 12, ht = (e, t) => {
250
+ }, ke = 12, zt = (e, t) => {
251
251
  const n = new Date(e);
252
252
  return n.setUTCHours(n.getUTCHours() + t), n.toISOString().replace(/\.\d{3}Z$/, "Z");
253
- }, me = (e, t) => {
253
+ }, Ce = (e, t) => {
254
254
  if (!e) return null;
255
- const a = `${e.slice(0, 10)}T${t === "start" ? "00:00:00" : "23:59:59"}Z`;
256
- return ht(
257
- a,
258
- t === "start" ? -ue : ue
255
+ const l = `${e.slice(0, 10)}T${t === "start" ? "00:00:00" : "23:59:59"}Z`;
256
+ return zt(
257
+ l,
258
+ t === "start" ? -ke : ke
259
259
  );
260
- }, yt = (e) => e.map(
260
+ }, Ot = (e) => e.map(
261
261
  (t) => `${t.stageId}:${t.teamIds.join(",")}:${t.fromDate ?? ""}:${t.toDate ?? ""}`
262
- ).join("|"), xt = async (e, t, n, o) => {
263
- var f, s;
264
- const a = {
262
+ ).join("|"), Mt = async (e, t, n, r) => {
263
+ var f, g;
264
+ const l = {
265
265
  competitionIds: [n],
266
266
  status: "finished",
267
267
  sortField: "date",
268
268
  sortOrder: "desc",
269
- limit: pt,
270
- fromDate: me(t.fromDate, "start"),
271
- toDate: me(t.toDate, "end")
272
- }, l = await e.football.getMatches(
273
- new de({ ...a, page: 1 }),
274
- o
275
- ), c = [...l.data ?? []], i = ((s = (f = l.meta) == null ? void 0 : f.pagination) == null ? void 0 : s.numberOfPages) ?? 1;
276
- return i > 1 && (await Promise.all(
269
+ limit: At,
270
+ fromDate: Ce(t.fromDate, "start"),
271
+ toDate: Ce(t.toDate, "end")
272
+ }, p = await e.football.getMatches(
273
+ new we({ ...l, page: 1 }),
274
+ r
275
+ ), m = [...p.data ?? []], u = ((g = (f = p.meta) == null ? void 0 : f.pagination) == null ? void 0 : g.numberOfPages) ?? 1;
276
+ return u > 1 && (await Promise.all(
277
277
  Array.from(
278
- { length: i - 1 },
279
- (u, p) => e.football.getMatches(
280
- new de({ ...a, page: p + 2 }),
281
- o
278
+ { length: u - 1 },
279
+ (d, i) => e.football.getMatches(
280
+ new we({ ...l, page: i + 2 }),
281
+ r
282
282
  ).then((h) => h.data ?? []).catch(() => [])
283
283
  )
284
- )).forEach((u) => c.push(...u)), c;
285
- }, St = (e, t, n, o) => {
286
- const [a, l] = N({}), [c, i] = N(!1), f = Ce(), s = yt(t);
287
- return ge(() => {
288
- if (!o || !t.length) {
289
- l({}), i(!1);
284
+ )).forEach((d) => m.push(...d)), m;
285
+ }, Nt = (e, t, n, r) => {
286
+ const [l, p] = K({}), [m, u] = K(!1), f = Ge(), g = Ot(t);
287
+ return Be(() => {
288
+ if (!r || !t.length) {
289
+ p({}), u(!1);
290
290
  return;
291
291
  }
292
- let d = !1;
293
- return i(!0), Promise.all(
292
+ let c = !1;
293
+ return u(!0), Promise.all(
294
294
  t.map(
295
- (u) => xt(e, u, n, f).then((p) => [u.stageId, u.teamIds, p]).catch(
296
- () => [u.stageId, u.teamIds, []]
295
+ (d) => Mt(e, d, n, f).then((i) => [d.stageId, d.teamIds, i]).catch(
296
+ () => [d.stageId, d.teamIds, []]
297
297
  )
298
298
  )
299
- ).then((u) => {
300
- if (d) return;
301
- const p = {};
302
- u.forEach(([h, b, x]) => {
303
- const g = {};
304
- b.forEach((m) => {
305
- g[m] = x.filter(
306
- (w) => w.homeTeam.id === m || w.awayTeam.id === m
307
- ).slice(0, 5).map((w) => gt(w, m));
308
- }), p[h] = g;
309
- }), l(p), i(!1);
299
+ ).then((d) => {
300
+ if (c) return;
301
+ const i = {};
302
+ d.forEach(([h, w, x]) => {
303
+ const v = {};
304
+ w.forEach((k) => {
305
+ v[k] = x.filter(
306
+ (b) => b.homeTeam.id === k || b.awayTeam.id === k
307
+ ).slice(0, 5).map((b) => Kt(b, k));
308
+ }), i[h] = v;
309
+ }), p(i), u(!1);
310
310
  }), () => {
311
- d = !0;
311
+ c = !0;
312
312
  };
313
- }, [e, s, n, o, f]), { formByStageAndTeam: a, loading: c };
314
- }, pe = (e, t) => {
313
+ }, [e, g, n, r, f]), { formByStageAndTeam: l, loading: m };
314
+ }, o = {
315
+ surface: "var(--fu-ucrc-surface)",
316
+ surfaceVariant: "var(--fu-ucrc-surface-variant)",
317
+ text: "var(--fu-ucrc-text-primary)",
318
+ textSecondary: "var(--fu-ucrc-text-secondary)",
319
+ textBody: "var(--fu-ucrc-text-body)",
320
+ border: "var(--fu-ucrc-outline-enabled-border)",
321
+ primary: "var(--fu-ucrc-primary-plain-color)",
322
+ onPrimary: "var(--fu-ucrc-primary-on-primary)",
323
+ success: "var(--fu-ucrc-success-plain-color)",
324
+ danger: "var(--fu-ucrc-danger-plain-color)",
325
+ neutral: "var(--fu-ucrc-neutral-plain-color)",
326
+ // What Joy's Sheet and Table/Tabs painted their own text with, before any child set a colour.
327
+ outlinedText: "var(--fu-ucrc-neutral-outlined-color)",
328
+ plainText: "var(--fu-ucrc-neutral-plain-color)",
329
+ primary08: "var(--fu-ucrc-st-primary-08)",
330
+ fontPrimary: "var(--fu-ucrc-font-primary)",
331
+ fontSecondary: "var(--fu-ucrc-font-secondary)",
332
+ fontBody: "var(--fu-ucrc-font-body)",
333
+ radiusSm: "var(--fu-ucrc-radius-sm)",
334
+ radiusMd: "var(--fu-ucrc-radius-md)",
335
+ radiusFull: "var(--fu-ucrc-radius-full)",
336
+ spaceXs: "var(--fu-ucrc-space-xs)",
337
+ spaceSm: "var(--fu-ucrc-space-sm)",
338
+ spaceMd: "var(--fu-ucrc-space-md)",
339
+ spaceLg: "var(--fu-ucrc-space-lg)"
340
+ }, Et = () => {
341
+ const e = je().palette.primary.plainColor;
342
+ return Ie.useMemo(
343
+ () => ({ "--fu-ucrc-st-primary-08": `rgba(${He(e)}, 0.08)` }),
344
+ [e]
345
+ );
346
+ }, ne = { margin: 0, lineHeight: 1.5 }, F = { margin: 0 }, Qe = {
347
+ position: "relative",
348
+ fontSize: "1em",
349
+ fontWeight: 400,
350
+ lineHeight: 1.5,
351
+ color: o.outlinedText,
352
+ backgroundColor: o.surface,
353
+ border: `1px solid ${o.border}`,
354
+ overflow: "hidden"
355
+ }, Le = (e, t) => {
315
356
  if (!e) return null;
316
357
  const n = new Date(e);
317
- return Number.isNaN(n.getTime()) ? null : n.toLocaleDateString(q(t), {
358
+ return Number.isNaN(n.getTime()) ? null : n.toLocaleDateString(ue(t), {
318
359
  day: "numeric",
319
360
  month: "short",
320
361
  year: "numeric"
321
362
  });
322
- }, bt = ({
363
+ }, P = {
364
+ root: a({
365
+ display: "flex",
366
+ alignItems: "center",
367
+ gap: o.spaceSm,
368
+ // Matches the group/stage tabs' and ZoneLegend's own padding so the header,
369
+ // the tab pills, and the legend all read as the same consistent band.
370
+ padding: `${o.spaceSm} ${o.spaceMd}`,
371
+ borderBottom: `1px solid ${o.border}`,
372
+ backgroundColor: o.surface
373
+ }),
374
+ logo: a({ width: "36px", height: "36px", objectFit: "contain", flexShrink: 0 }),
375
+ placeholder: a({
376
+ width: "36px",
377
+ height: "36px",
378
+ borderRadius: "6px",
379
+ backgroundColor: o.surfaceVariant,
380
+ display: "flex",
381
+ alignItems: "center",
382
+ justifyContent: "center",
383
+ flexShrink: 0,
384
+ overflow: "hidden"
385
+ }),
386
+ body: a({ minWidth: 0 }),
387
+ titleRow: a({ display: "flex", alignItems: "center", gap: o.spaceXs, flexWrap: "wrap" }),
388
+ title: a(ne, {
389
+ fontFamily: o.fontPrimary,
390
+ fontWeight: 700,
391
+ fontSize: "1.0625em",
392
+ color: o.text
393
+ }),
394
+ // Joy's small Chip, in px as it computed (its sizes were rem).
395
+ badge: a({
396
+ position: "relative",
397
+ display: "inline-flex",
398
+ alignItems: "center",
399
+ justifyContent: "center",
400
+ boxSizing: "border-box",
401
+ minHeight: "20px",
402
+ padding: "0 6px",
403
+ borderRadius: "24px",
404
+ verticalAlign: "middle",
405
+ whiteSpace: "nowrap",
406
+ lineHeight: 1.5,
407
+ fontFamily: o.fontPrimary,
408
+ fontSize: "0.625em",
409
+ fontWeight: 600,
410
+ color: o.primary,
411
+ backgroundColor: o.primary08
412
+ }),
413
+ badgeLabel: a({
414
+ display: "inline-block",
415
+ minWidth: 0,
416
+ flexGrow: 1,
417
+ overflow: "hidden",
418
+ textOverflow: "ellipsis"
419
+ }),
420
+ subtitle: a(ne, {
421
+ fontFamily: o.fontSecondary,
422
+ fontSize: "0.6875em",
423
+ color: o.textSecondary,
424
+ marginTop: "2px"
425
+ })
426
+ }, Wt = ({
323
427
  title: e,
324
428
  logoUrl: t,
325
429
  season: n,
326
- language: o
430
+ language: r
327
431
  }) => {
328
- const a = D(), l = P(), c = $(), i = pe((n == null ? void 0 : n.startDate) ?? null, o), f = pe((n == null ? void 0 : n.endDate) ?? null, o), s = i && f ? `${i} – ${f}` : null, d = (n == null ? void 0 : n.year) ?? (n == null ? void 0 : n.name) ?? null;
329
- return /* @__PURE__ */ C(
330
- S,
331
- {
332
- sx: {
333
- display: "flex",
334
- alignItems: "center",
335
- gap: c.sm,
336
- // Matches the group/stage tabs' and ZoneLegend's own padding so the header,
337
- // the tab pills, and the legend all read as the same consistent band.
338
- paddingLeft: c.md,
339
- paddingRight: c.md,
340
- paddingTop: c.sm,
341
- paddingBottom: c.sm,
342
- borderBottom: `1px solid ${a.outlineEnabledBorder}`,
343
- backgroundColor: a.surface
344
- },
345
- children: [
346
- t ? /* @__PURE__ */ r(
347
- S,
348
- {
349
- component: "img",
350
- src: t,
351
- alt: e,
352
- sx: { width: 36, height: 36, objectFit: "contain", flexShrink: 0 }
353
- }
354
- ) : /* @__PURE__ */ r(
355
- S,
356
- {
357
- sx: {
358
- width: 36,
359
- height: 36,
360
- borderRadius: "6px",
361
- backgroundColor: a.surfaceVariant,
362
- display: "flex",
363
- alignItems: "center",
364
- justifyContent: "center",
365
- flexShrink: 0,
366
- overflow: "hidden"
367
- },
368
- children: /* @__PURE__ */ r(
369
- Ge,
370
- {
371
- sx: { fontSize: "1.25em", color: a.textSecondary }
372
- }
373
- )
374
- }
375
- ),
376
- /* @__PURE__ */ C(S, { sx: { minWidth: 0 }, children: [
377
- /* @__PURE__ */ C(
378
- S,
379
- {
380
- sx: {
381
- display: "flex",
382
- alignItems: "center",
383
- gap: c.xs,
384
- flexWrap: "wrap"
385
- },
386
- children: [
387
- /* @__PURE__ */ r(
388
- L,
389
- {
390
- sx: {
391
- fontFamily: l.primary,
392
- fontWeight: 700,
393
- fontSize: "1.0625em",
394
- color: a.textPrimary
395
- },
396
- children: e
397
- }
398
- ),
399
- d && /* @__PURE__ */ r(
400
- Ee,
401
- {
402
- size: "sm",
403
- sx: {
404
- fontFamily: l.primary,
405
- fontSize: "0.625em",
406
- fontWeight: 600,
407
- color: a.palette.primary.plainColor,
408
- backgroundColor: `rgba(${ee(a.palette.primary.plainColor)}, 0.08)`
409
- },
410
- children: d
411
- }
412
- )
413
- ]
414
- }
415
- ),
416
- s && /* @__PURE__ */ r(
417
- L,
418
- {
419
- sx: {
420
- fontFamily: l.secondary,
421
- fontSize: "0.6875em",
422
- color: a.textSecondary,
423
- marginTop: "2px"
424
- },
425
- children: s
426
- }
427
- )
428
- ] })
429
- ]
430
- }
431
- );
432
- }, J = [
432
+ const l = Le((n == null ? void 0 : n.startDate) ?? null, r), p = Le((n == null ? void 0 : n.endDate) ?? null, r), m = l && p ? `${l} – ${p}` : null, u = (n == null ? void 0 : n.year) ?? (n == null ? void 0 : n.name) ?? null;
433
+ return /* @__PURE__ */ S("div", { css: P.root, children: [
434
+ t ? /* @__PURE__ */ s("img", { src: t, alt: e, css: P.logo }) : /* @__PURE__ */ s("div", { css: P.placeholder, children: /* @__PURE__ */ s(ct, { size: "1.25em", color: o.textSecondary }) }),
435
+ /* @__PURE__ */ S("div", { css: P.body, children: [
436
+ /* @__PURE__ */ S("div", { css: P.titleRow, children: [
437
+ /* @__PURE__ */ s("p", { css: P.title, children: e }),
438
+ u && /* @__PURE__ */ s("div", { css: P.badge, children: /* @__PURE__ */ s("span", { css: P.badgeLabel, children: u }) })
439
+ ] }),
440
+ m && /* @__PURE__ */ s("p", { css: P.subtitle, children: m })
441
+ ] })
442
+ ] });
443
+ }, pe = [
433
444
  {
434
445
  key: "played",
435
446
  shortLabelKey: "standings.columns.playedShort",
@@ -470,7 +481,7 @@ const Ve = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " "
470
481
  shortLabelKey: "standings.columns.form",
471
482
  fullLabelKey: "standings.columns.form"
472
483
  }
473
- ], Ct = [
484
+ ], Ut = [
474
485
  {
475
486
  key: "goalsFor",
476
487
  shortLabelKey: "standings.columns.goalsForShort",
@@ -486,323 +497,278 @@ const Ve = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " "
486
497
  shortLabelKey: "standings.columns.goalsDifferenceShort",
487
498
  fullLabelKey: "standings.columns.goalsDifference"
488
499
  }
489
- ], wt = [
490
- ...J.slice(0, 5),
491
- ...Ct,
492
- ...J.slice(5)
493
- ], kt = {
500
+ ], It = [
501
+ ...pe.slice(0, 5),
502
+ ...Ut,
503
+ ...pe.slice(5)
504
+ ], Bt = {
494
505
  hockey: ["drawn", "form"],
495
506
  // No ties, no goal-based scoring (points are the score itself, not a standings-only
496
507
  // stat), and no match-event data yet — leaves just played/won/lost/points.
497
508
  basketball: ["drawn", "form", "goals", "goalsFor", "goalsAgainst", "goalsDifference"]
498
- }, Lt = (e, t, n = !0) => {
499
- const o = new Set(
500
- t ? kt[t.toLowerCase()] ?? [] : []
501
- );
502
- return o.add(n ? "winPercentage" : "points"), (!e || e.length === 0 ? J : wt.filter((l) => e.includes(l.key))).filter((l) => !o.has(l.key));
503
- }, Rt = ({ rankChange: e }) => {
504
- const t = D();
505
- if (e === null || e === "same")
506
- return /* @__PURE__ */ r(_, {});
507
- const n = e === "up" ? "▲" : "▼", o = e === "up" ? t.palette.success.plainColor : t.palette.danger.plainColor;
508
- return /* @__PURE__ */ r(
509
- S,
510
- {
511
- component: "span",
512
- sx: {
513
- fontSize: "0.5625em",
514
- fontWeight: 700,
515
- color: o,
516
- lineHeight: 1.4
517
- },
518
- children: n
519
- }
520
- );
521
- }, Dt = ({ row: e, highlighted: t, compact: n }) => {
522
- const o = D(), a = P(), l = $(), c = n ? 22 : 28, i = (e.teamShortName ?? e.teamName).slice(0, 2).toUpperCase();
523
- return /* @__PURE__ */ C(
524
- S,
525
- {
526
- sx: {
527
- display: "flex",
528
- alignItems: "center",
529
- gap: l.xs,
530
- minWidth: 0,
531
- // Caps the whole cell (avatar + name) so a long name actually has something to
532
- // shrink against and ellipsis, instead of just growing the table's own column
533
- // width — table-layout:auto (used everywhere this renders) otherwise sizes the
534
- // column to fit the content instead of the content to fit the column, which is
535
- // exactly what let a long name (e.g. "Bosnia and Herzegovina") blow out a
536
- // compact overview card's fixed-width grid tile and push its stat columns out
537
- // of view.
538
- maxWidth: n ? "90px" : "160px"
539
- },
540
- children: [
541
- e.logoUrl ? /* @__PURE__ */ r(
542
- S,
543
- {
544
- component: "img",
545
- src: e.logoUrl,
546
- alt: e.teamName,
547
- sx: {
548
- width: c,
549
- height: c,
550
- objectFit: "contain",
551
- flexShrink: 0
552
- }
553
- }
554
- ) : /* @__PURE__ */ r(
555
- S,
556
- {
557
- sx: {
558
- width: c,
559
- height: c,
560
- display: "flex",
561
- alignItems: "center",
562
- justifyContent: "center",
563
- borderRadius: "4px",
564
- backgroundColor: o.surfaceVariant,
565
- color: o.textSecondary,
566
- fontFamily: a.primary,
567
- fontSize: "0.4375em",
568
- fontWeight: 700,
569
- lineHeight: 1,
570
- flexShrink: 0
571
- },
572
- children: i
573
- }
574
- ),
575
- /* @__PURE__ */ r(
576
- L,
577
- {
578
- sx: {
579
- fontFamily: a.primary,
580
- fontSize: n ? "0.6875em" : "0.8125em",
581
- fontWeight: t ? 700 : 500,
582
- color: t ? o.palette.primary.plainColor : o.textPrimary,
583
- overflow: "hidden",
584
- textOverflow: "ellipsis",
585
- whiteSpace: "nowrap",
586
- minWidth: 0
587
- },
588
- children: e.teamName
589
- }
590
- )
591
- ]
592
- }
509
+ }, _t = (e, t, n = !0) => {
510
+ const r = new Set(
511
+ t ? Bt[t.toLowerCase()] ?? [] : []
593
512
  );
594
- }, Tt = ({ stats: e }) => {
595
- const t = D(), n = P(), o = e.goalsDifference > 0 ? t.palette.success.plainColor : e.goalsDifference < 0 ? t.palette.danger.plainColor : t.textSecondary, a = e.goalsDifference > 0 ? V(`+${e.goalsDifference}`) : V(e.goalsDifference);
596
- return /* @__PURE__ */ C(
597
- S,
598
- {
599
- sx: {
600
- display: "flex",
601
- flexDirection: "column",
602
- alignItems: "center",
603
- gap: "1px",
604
- lineHeight: 1.2
605
- },
606
- children: [
607
- /* @__PURE__ */ C(
608
- L,
609
- {
610
- sx: {
611
- fontFamily: n.secondary,
612
- fontSize: "0.6875em",
613
- color: t.textSecondary
614
- },
615
- children: [
616
- e.goalsFor,
617
- "·",
618
- e.goalsAgainst
619
- ]
620
- }
621
- ),
622
- /* @__PURE__ */ r(
623
- L,
624
- {
625
- sx: {
626
- fontFamily: n.primary,
627
- fontSize: "0.6875em",
628
- fontWeight: 700,
629
- color: o
630
- },
631
- children: a
632
- }
633
- )
634
- ]
635
- }
636
- );
637
- }, fe = 200, vt = (e, t) => {
513
+ return r.add(n ? "winPercentage" : "points"), (!e || e.length === 0 ? pe : It.filter((p) => e.includes(p.key))).filter((p) => !r.has(p.key));
514
+ }, De = a({ fontSize: "0.5625em", fontWeight: 700, lineHeight: 1.4 }), Te = {
515
+ up: a(De, { color: o.success }),
516
+ down: a(De, { color: o.danger })
517
+ }, Ht = ({ rankChange: e }) => e === null || e === "same" ? /* @__PURE__ */ s(Z, {}) : e === "up" ? /* @__PURE__ */ s("span", { css: Te.up, children: "▲" }) : /* @__PURE__ */ s("span", { css: Te.down, children: "▼" }), $e = a({
518
+ display: "flex",
519
+ alignItems: "center",
520
+ gap: o.spaceXs,
521
+ minWidth: 0,
522
+ // Caps the whole cell (avatar + name) so a long name actually has something to
523
+ // shrink against and ellipsis, instead of just growing the table's own column
524
+ // width — table-layout:auto (used everywhere this renders) otherwise sizes the
525
+ // column to fit the content instead of the content to fit the column, which is
526
+ // exactly what let a long name (e.g. "Bosnia and Herzegovina") blow out a
527
+ // compact overview card's fixed-width grid tile and push its stat columns out
528
+ // of view.
529
+ maxWidth: "160px"
530
+ }), Fe = a({ width: "28px", height: "28px", objectFit: "contain", flexShrink: 0 }), Pe = a({
531
+ width: "28px",
532
+ height: "28px",
533
+ display: "flex",
534
+ alignItems: "center",
535
+ justifyContent: "center",
536
+ borderRadius: "4px",
537
+ backgroundColor: o.surfaceVariant,
538
+ color: o.textSecondary,
539
+ fontFamily: o.fontPrimary,
540
+ fontSize: "0.4375em",
541
+ fontWeight: 700,
542
+ lineHeight: 1,
543
+ flexShrink: 0
544
+ }), Y = a(F, {
545
+ fontFamily: o.fontPrimary,
546
+ fontSize: "0.8125em",
547
+ fontWeight: 500,
548
+ color: o.text,
549
+ overflow: "hidden",
550
+ textOverflow: "ellipsis",
551
+ whiteSpace: "nowrap",
552
+ minWidth: 0
553
+ }), Ae = { width: "22px", height: "22px" }, q = {
554
+ root: { regular: $e, compact: a($e, { maxWidth: "90px" }) },
555
+ logo: { regular: Fe, compact: a(Fe, Ae) },
556
+ initials: { regular: Pe, compact: a(Pe, Ae) },
557
+ name: {
558
+ regular: Y,
559
+ compact: a(Y, { fontSize: "0.6875em" }),
560
+ highlighted: a(Y, { fontWeight: 700, color: o.primary }),
561
+ highlightedCompact: a(Y, { fontSize: "0.6875em", fontWeight: 700, color: o.primary })
562
+ }
563
+ }, Gt = ({ row: e, highlighted: t, compact: n }) => {
564
+ const r = n ? "compact" : "regular", l = t ? n ? "highlightedCompact" : "highlighted" : r;
565
+ return /* @__PURE__ */ S("div", { css: q.root[r], children: [
566
+ e.logoUrl ? /* @__PURE__ */ s("img", { src: e.logoUrl, alt: e.teamName, css: q.logo[r] }) : /* @__PURE__ */ s("div", { css: q.initials[r], children: (e.teamShortName ?? e.teamName).slice(0, 2).toUpperCase() }),
567
+ /* @__PURE__ */ s("p", { css: q.name[l], children: e.teamName })
568
+ ] });
569
+ }, le = a(F, { fontFamily: o.fontPrimary, fontSize: "0.6875em", fontWeight: 700 }), I = {
570
+ root: a({ display: "flex", flexDirection: "column", alignItems: "center", gap: "1px", lineHeight: 1.2 }),
571
+ totals: a(F, { fontFamily: o.fontSecondary, fontSize: "0.6875em", color: o.textSecondary }),
572
+ positive: a(le, { color: o.success }),
573
+ negative: a(le, { color: o.danger }),
574
+ even: a(le, { color: o.textSecondary })
575
+ }, jt = ({ stats: e }) => {
576
+ const t = e.goalsDifference;
577
+ return /* @__PURE__ */ S("div", { css: I.root, children: [
578
+ /* @__PURE__ */ S("p", { css: I.totals, children: [
579
+ e.goalsFor,
580
+ "·",
581
+ e.goalsAgainst
582
+ ] }),
583
+ /* @__PURE__ */ s("p", { css: t > 0 ? I.positive : t < 0 ? I.negative : I.even, children: t > 0 ? te(`+${t}`) : te(t) })
584
+ ] });
585
+ }, Re = 200, Vt = (e, t) => {
638
586
  const n = new Date(e);
639
587
  if (Number.isNaN(n.getTime())) return "";
640
- const o = n.toLocaleDateString(q(t), {
588
+ const r = n.toLocaleDateString(ue(t), {
641
589
  day: "numeric",
642
590
  month: "short",
643
591
  year: "numeric"
644
- }), a = n.toLocaleTimeString(q(t), {
592
+ }), l = n.toLocaleTimeString(ue(t), {
645
593
  hour: "2-digit",
646
594
  minute: "2-digit"
647
595
  });
648
- return `${o} · ${a}`;
649
- }, Et = ({
596
+ return `${r} · ${l}`;
597
+ }, ie = a({ width: "9px", height: "9px", borderRadius: "50%" }), Ke = a(F, {
598
+ fontFamily: o.fontPrimary,
599
+ fontWeight: 600,
600
+ fontSize: "0.8125em",
601
+ color: o.text,
602
+ whiteSpace: "nowrap"
603
+ }), T = {
604
+ center: a({ display: "flex", justifyContent: "center" }),
605
+ empty: a(F, {
606
+ fontFamily: o.fontSecondary,
607
+ fontSize: "0.75em",
608
+ color: o.textSecondary,
609
+ textAlign: "center"
610
+ }),
611
+ dots: a({ display: "flex", gap: "3px", justifyContent: "center" }),
612
+ anchor: a({ display: "inline-flex", cursor: "pointer" }),
613
+ win: a(ie, { backgroundColor: o.success }),
614
+ loss: a(ie, { backgroundColor: o.danger }),
615
+ draw: a(ie, { backgroundColor: o.neutral }),
616
+ tooltip: a({
617
+ position: "fixed",
618
+ // A variable, so the RTL plugin still flips it to `right`; `tipInset` is mirrored to match.
619
+ left: "var(--fu-st-tip-x)",
620
+ transform: "translate(-50%, -100%)",
621
+ zIndex: 9999,
622
+ display: "flex",
623
+ flexDirection: "column",
624
+ alignItems: "center",
625
+ gap: "4px",
626
+ padding: "8px 12px",
627
+ width: "max-content",
628
+ borderRadius: o.radiusSm,
629
+ backgroundColor: o.surface,
630
+ border: `1px solid ${o.border}`,
631
+ boxShadow: "0 6px 20px rgba(0, 0, 0, 0.16)",
632
+ fontSize: "1em",
633
+ pointerEvents: "none"
634
+ }),
635
+ kickoff: a(F, {
636
+ fontFamily: o.fontSecondary,
637
+ fontSize: "0.6875em",
638
+ color: o.textSecondary,
639
+ whiteSpace: "nowrap"
640
+ }),
641
+ match: a({ display: "flex", alignItems: "center", gap: "6px" }),
642
+ teamName: Ke,
643
+ score: a(Ke, { fontWeight: 700 }),
644
+ logo: a({ width: "16px", height: "16px", objectFit: "contain", flexShrink: 0 })
645
+ }, Zt = ({
650
646
  teamName: e,
651
647
  teamLogoUrl: t,
652
648
  matches: n,
653
- loading: o
649
+ loading: r
654
650
  }) => {
655
- const { t: a, i18n: l } = Y("common"), c = D(), i = P(), f = j(), { shadowRootElement: s } = Ke(Ae), d = Oe(), [u, p] = N(null), h = ve([]), b = [...n].reverse();
656
- if (o)
657
- return /* @__PURE__ */ r(S, { sx: { display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ r(Ne, {}) });
658
- if (!b.length)
659
- return /* @__PURE__ */ r(
660
- L,
651
+ const { t: l, i18n: p } = oe("common"), { shadowRootElement: m } = lt(it), u = Ve(), [f, g] = K(null), c = _e([]), d = [...n].reverse();
652
+ if (r)
653
+ return /* @__PURE__ */ s("div", { css: T.center, children: /* @__PURE__ */ s(nt, {}) });
654
+ if (!d.length)
655
+ return /* @__PURE__ */ s("p", { css: T.empty, children: l("standings.formNotAvailable") });
656
+ const i = (b) => {
657
+ const D = c.current[b];
658
+ D && g({ index: b, rect: D.getBoundingClientRect() });
659
+ }, h = f ? d[f.index] : null, w = f ? f.rect.left + f.rect.width / 2 : 0, x = typeof window < "u" ? Math.max(
660
+ Re / 2 + 8,
661
+ Math.min(w, window.innerWidth - Re / 2 - 8)
662
+ ) : w, v = u && typeof window < "u" ? window.innerWidth - x : x, k = f ? f.rect.top - 8 : 0;
663
+ return /* @__PURE__ */ S("div", { css: T.dots, onMouseLeave: () => g(null), children: [
664
+ d.map((b, D) => /* @__PURE__ */ s(
665
+ "span",
661
666
  {
662
- sx: {
663
- fontFamily: i.secondary,
664
- fontSize: "0.75em",
665
- color: c.textSecondary,
666
- textAlign: "center"
667
+ ref: (O) => {
668
+ c.current[D] = O;
667
669
  },
668
- children: a("standings.formNotAvailable")
669
- }
670
- );
671
- const x = (T) => T === "win" ? c.palette.success.plainColor : T === "loss" ? c.palette.danger.plainColor : c.palette.neutral.plainColor, g = (T) => {
672
- const y = h.current[T];
673
- y && p({ index: T, rect: y.getBoundingClientRect() });
674
- }, m = u ? b[u.index] : null, w = u ? u.rect.left + u.rect.width / 2 : 0, R = typeof window < "u" ? Math.max(
675
- fe / 2 + 8,
676
- Math.min(w, window.innerWidth - fe / 2 - 8)
677
- ) : w, k = d && typeof window < "u" ? window.innerWidth - R : R, F = u ? u.rect.top - 8 : 0, z = {
678
- fontFamily: i.primary,
679
- fontWeight: 600,
680
- fontSize: "0.8125em",
681
- color: c.textPrimary,
682
- whiteSpace: "nowrap"
683
- }, I = {
684
- width: 16,
685
- height: 16,
686
- objectFit: "contain",
687
- flexShrink: 0
688
- };
689
- return /* @__PURE__ */ C(
690
- S,
691
- {
692
- sx: { display: "flex", gap: "3px", justifyContent: "center" },
693
- onMouseLeave: () => p(null),
694
- children: [
695
- b.map((T, y) => /* @__PURE__ */ r(
696
- S,
697
- {
698
- component: "span",
699
- ref: (K) => {
700
- h.current[y] = K;
701
- },
702
- sx: { display: "inline-flex", cursor: "pointer" },
703
- onMouseEnter: () => g(y),
704
- children: /* @__PURE__ */ r(
705
- S,
706
- {
707
- sx: {
708
- width: 9,
709
- height: 9,
710
- borderRadius: "50%",
711
- backgroundColor: x(T.result)
712
- }
713
- }
714
- )
715
- },
716
- y
717
- )),
718
- u && m && we(
719
- /* @__PURE__ */ r(
720
- S,
721
- {
722
- sx: {
723
- position: "fixed",
724
- left: `${k}px`,
725
- top: `${F}px`,
726
- transform: "translate(-50%, -100%)",
727
- zIndex: 9999,
728
- display: "flex",
729
- flexDirection: "column",
730
- alignItems: "center",
731
- gap: "4px",
732
- padding: "8px 12px",
733
- width: "max-content",
734
- borderRadius: f.sm,
735
- backgroundColor: c.surface,
736
- border: `1px solid ${c.outlineEnabledBorder}`,
737
- boxShadow: "0 6px 20px rgba(0, 0, 0, 0.16)",
738
- fontSize: "1em",
739
- pointerEvents: "none"
740
- },
741
- children: (() => {
742
- const T = m.isHome ? e : m.opponentName, y = m.isHome ? m.opponentName : e, K = m.isHome ? t : m.opponentLogoUrl, U = m.isHome ? m.opponentLogoUrl : t, H = m.isHome ? m.teamScore : m.opponentScore, Q = m.isHome ? m.opponentScore : m.teamScore;
743
- return /* @__PURE__ */ C(_, { children: [
744
- /* @__PURE__ */ r(
745
- L,
746
- {
747
- sx: {
748
- fontFamily: i.secondary,
749
- fontSize: "0.6875em",
750
- color: c.textSecondary,
751
- whiteSpace: "nowrap"
752
- },
753
- children: vt(m.kickoffAt, l.language)
754
- }
755
- ),
756
- /* @__PURE__ */ C(S, { sx: { display: "flex", alignItems: "center", gap: "6px" }, children: [
757
- /* @__PURE__ */ r(L, { sx: z, children: T }),
758
- K && /* @__PURE__ */ r(S, { component: "img", src: K, sx: I }),
759
- /* @__PURE__ */ C(
760
- L,
761
- {
762
- sx: {
763
- fontFamily: i.primary,
764
- fontWeight: 700,
765
- fontSize: "0.8125em",
766
- color: c.textPrimary,
767
- whiteSpace: "nowrap"
768
- },
769
- children: [
770
- H,
771
- " : ",
772
- Q
773
- ]
774
- }
775
- ),
776
- U && /* @__PURE__ */ r(S, { component: "img", src: U, sx: I }),
777
- /* @__PURE__ */ r(L, { sx: z, children: y })
778
- ] })
779
- ] });
780
- })()
781
- }
782
- ),
783
- s ?? document.body
784
- )
785
- ]
670
+ css: T.anchor,
671
+ onMouseEnter: () => i(D),
672
+ children: /* @__PURE__ */ s("div", { css: T[b.result] })
673
+ },
674
+ D
675
+ )),
676
+ f && h && dt(
677
+ /* @__PURE__ */ s(
678
+ "div",
679
+ {
680
+ css: T.tooltip,
681
+ style: { "--fu-st-tip-x": `${v}px`, top: `${k}px` },
682
+ children: (() => {
683
+ const b = h.isHome, D = b ? e : h.opponentName, O = b ? h.opponentName : e, U = b ? t : h.opponentLogoUrl, X = b ? h.opponentLogoUrl : t, y = b ? h.teamScore : h.opponentScore, M = b ? h.opponentScore : h.teamScore;
684
+ return /* @__PURE__ */ S(Z, { children: [
685
+ /* @__PURE__ */ s("p", { css: T.kickoff, children: Vt(h.kickoffAt, p.language) }),
686
+ /* @__PURE__ */ S("div", { css: T.match, children: [
687
+ /* @__PURE__ */ s("p", { css: T.teamName, children: D }),
688
+ U && /* @__PURE__ */ s("img", { src: U, css: T.logo }),
689
+ /* @__PURE__ */ S("p", { css: T.score, children: [
690
+ y,
691
+ " : ",
692
+ M
693
+ ] }),
694
+ X && /* @__PURE__ */ s("img", { src: X, css: T.logo }),
695
+ /* @__PURE__ */ s("p", { css: T.teamName, children: O })
696
+ ] })
697
+ ] });
698
+ })()
699
+ }
700
+ ),
701
+ m ?? document.body
702
+ )
703
+ ] });
704
+ }, B = a({ height: "32px", padding: "10px 6px", borderBottom: `1px solid ${o.border}` }), ze = a({ width: "4px", height: "100%", minHeight: "44px" }), Oe = a(F, {
705
+ fontFamily: o.fontPrimary,
706
+ fontWeight: 700,
707
+ fontSize: "0.8125em",
708
+ color: o.text,
709
+ textAlign: "right"
710
+ }), Me = a(F, {
711
+ fontFamily: o.fontSecondary,
712
+ fontSize: "0.75em",
713
+ color: o.textBody,
714
+ textAlign: "center"
715
+ }), Ne = a(F, {
716
+ fontFamily: o.fontPrimary,
717
+ fontWeight: 700,
718
+ fontSize: "0.875em",
719
+ color: o.primary,
720
+ textAlign: "center"
721
+ }), W = a(F, {
722
+ fontFamily: o.fontPrimary,
723
+ fontSize: "0.75em",
724
+ fontWeight: 700,
725
+ textAlign: "center"
726
+ }), _ = { fontSize: "0.6875em" }, H = (e) => ({ row: e, last: a(e, { borderBottom: "none" }) }), L = {
727
+ highlighted: a({ backgroundColor: o.primary08 }),
728
+ cell: H(B),
729
+ zoneCell: H(a(B, { width: "4px", padding: 0 })),
730
+ rankCell: H(a(B, { padding: "10px 4px", textAlign: "center" })),
731
+ teamCell: H(a(B, { textAlign: "start" })),
732
+ goalsCell: H(a(B, { padding: "8px 6px" })),
733
+ zoneBar: { regular: ze, compact: a(ze, { minHeight: "30px" }) },
734
+ // Unconditional — every row, every group, whether showRankChange is on or off, uses
735
+ // this exact same fixed two-column layout. The badge slot's width is part of the grid
736
+ // template, not the badge's own rendered content, so the digit sits in the identical
737
+ // position in every single row, always.
738
+ rankGrid: a({
739
+ display: "inline-grid",
740
+ gridTemplateColumns: "auto 10px",
741
+ alignItems: "center",
742
+ columnGap: "3px"
743
+ }),
744
+ rank: { regular: Oe, compact: a(Oe, _) },
745
+ stat: { regular: Me, compact: a(Me, _) },
746
+ headline: { regular: Ne, compact: a(Ne, { fontSize: "0.75em" }) },
747
+ difference: {
748
+ regular: {
749
+ positive: a(W, { color: o.success }),
750
+ negative: a(W, { color: o.danger }),
751
+ even: a(W, { color: o.textSecondary })
752
+ },
753
+ compact: {
754
+ positive: a(W, _, { color: o.success }),
755
+ negative: a(W, _, { color: o.danger }),
756
+ even: a(W, _, { color: o.textSecondary })
786
757
  }
787
- );
788
- }, Pt = ({
758
+ }
759
+ }, Xt = (e) => e.toFixed(3).replace(/^0(?=\.)/, ""), Qt = ({
789
760
  row: e,
790
761
  zone: t,
791
762
  columns: n,
792
- showRankChange: o,
793
- highlighted: a,
794
- compact: l,
795
- isLast: c = !1,
796
- form: i,
763
+ showRankChange: r,
764
+ highlighted: l,
765
+ compact: p,
766
+ isLast: m = !1,
767
+ form: u,
797
768
  formLoading: f
798
769
  }) => {
799
- const s = D(), d = P(), u = c ? "none" : `1px solid ${s.outlineEnabledBorder}`, p = {
800
- fontFamily: d.secondary,
801
- fontSize: l ? "0.6875em" : "0.75em",
802
- color: s.textBody,
803
- textAlign: "center"
804
- }, h = (m) => {
805
- switch (m) {
770
+ const g = p ? "compact" : "regular", c = m ? "last" : "row", d = (i) => {
771
+ switch (i) {
806
772
  case "played":
807
773
  return e.stats.played;
808
774
  case "won":
@@ -823,658 +789,422 @@ const Ve = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " "
823
789
  default:
824
790
  return e.stats.points;
825
791
  }
826
- }, b = (m) => m.toFixed(3).replace(/^0(?=\.)/, ""), x = (m) => m > 0 ? s.palette.success.plainColor : m < 0 ? s.palette.danger.plainColor : s.textSecondary, g = (m) => m > 0 ? V(`+${m}`) : V(m);
827
- return /* @__PURE__ */ C(
828
- "tr",
829
- {
830
- style: a ? {
831
- backgroundColor: `rgba(${ee(s.palette.primary.plainColor)}, 0.08)`
832
- } : void 0,
833
- children: [
834
- /* @__PURE__ */ r("td", { style: { width: 4, padding: 0, borderBottom: u }, children: /* @__PURE__ */ r(
835
- S,
836
- {
837
- sx: {
838
- width: "4px",
839
- height: "100%",
840
- minHeight: l ? 30 : 44,
841
- backgroundColor: (t == null ? void 0 : t.color) ?? "transparent"
842
- }
843
- }
844
- ) }),
845
- /* @__PURE__ */ r("td", { style: { padding: "10px 4px", textAlign: "center", borderBottom: u }, children: /* @__PURE__ */ C(
846
- S,
847
- {
848
- sx: {
849
- display: "inline-grid",
850
- gridTemplateColumns: "auto 10px",
851
- alignItems: "center",
852
- columnGap: "3px"
853
- },
854
- children: [
855
- /* @__PURE__ */ r(
856
- L,
857
- {
858
- sx: {
859
- fontFamily: d.primary,
860
- fontWeight: 700,
861
- fontSize: l ? "0.6875em" : "0.8125em",
862
- color: s.textPrimary,
863
- textAlign: "right"
864
- },
865
- children: e.rank
866
- }
867
- ),
868
- o && /* @__PURE__ */ r(Rt, { rankChange: e.rankChange })
869
- ]
870
- }
871
- ) }),
872
- /* @__PURE__ */ r("td", { style: { padding: "10px 6px", textAlign: "start", borderBottom: u }, children: /* @__PURE__ */ r(Dt, { row: e, highlighted: a, compact: l }) }),
873
- n.map((m) => {
874
- if (m.key === "goals")
875
- return /* @__PURE__ */ r("td", { style: { padding: "8px 6px", borderBottom: u }, children: /* @__PURE__ */ r(Tt, { stats: e.stats }) }, m.key);
876
- if (m.key === "goalsDifference") {
877
- const R = e.stats.goalsDifference;
878
- return /* @__PURE__ */ r("td", { style: { padding: "10px 6px", borderBottom: u }, children: /* @__PURE__ */ r(
879
- L,
880
- {
881
- sx: {
882
- fontFamily: d.primary,
883
- fontSize: l ? "0.6875em" : "0.75em",
884
- fontWeight: 700,
885
- color: x(R),
886
- textAlign: "center"
887
- },
888
- children: g(R)
889
- }
890
- ) }, m.key);
891
- }
892
- if (m.key === "form")
893
- return /* @__PURE__ */ r("td", { style: { padding: "10px 6px", borderBottom: u }, children: /* @__PURE__ */ r(
894
- Et,
895
- {
896
- teamName: e.teamName,
897
- teamLogoUrl: e.logoUrl,
898
- matches: i ?? [],
899
- loading: !!f
900
- }
901
- ) }, m.key);
902
- const w = m.key === "points" || m.key === "winPercentage";
903
- return /* @__PURE__ */ r("td", { style: { padding: "10px 6px", borderBottom: u }, children: /* @__PURE__ */ r(
904
- L,
905
- {
906
- sx: w ? {
907
- fontFamily: d.primary,
908
- fontWeight: 700,
909
- fontSize: l ? "0.75em" : "0.875em",
910
- color: s.palette.primary.plainColor,
911
- textAlign: "center"
912
- } : p,
913
- children: m.key === "winPercentage" ? b(h(m.key)) : h(m.key)
914
- }
915
- ) }, m.key);
916
- })
917
- ]
918
- }
919
- );
920
- }, Ft = ({ colSpan: e }) => {
921
- const t = D();
922
- return /* @__PURE__ */ r("tr", { children: /* @__PURE__ */ r(
923
- "td",
924
- {
925
- colSpan: e,
926
- style: {
927
- height: 1,
928
- padding: 0,
929
- backgroundColor: t.outlineEnabledBorder,
930
- border: "none"
792
+ };
793
+ return /* @__PURE__ */ S("tr", { css: l ? L.highlighted : void 0, children: [
794
+ /* @__PURE__ */ s("td", { css: L.zoneCell[c], children: /* @__PURE__ */ s("div", { css: L.zoneBar[g], style: { backgroundColor: (t == null ? void 0 : t.color) ?? "transparent" } }) }),
795
+ /* @__PURE__ */ s("td", { css: L.rankCell[c], children: /* @__PURE__ */ S("div", { css: L.rankGrid, children: [
796
+ /* @__PURE__ */ s("p", { css: L.rank[g], children: e.rank }),
797
+ r && /* @__PURE__ */ s(Ht, { rankChange: e.rankChange })
798
+ ] }) }),
799
+ /* @__PURE__ */ s("td", { css: L.teamCell[c], children: /* @__PURE__ */ s(Gt, { row: e, highlighted: l, compact: p }) }),
800
+ n.map((i) => {
801
+ if (i.key === "goals")
802
+ return /* @__PURE__ */ s("td", { css: L.goalsCell[c], children: /* @__PURE__ */ s(jt, { stats: e.stats }) }, i.key);
803
+ if (i.key === "goalsDifference") {
804
+ const w = e.stats.goalsDifference, x = w > 0 ? "positive" : w < 0 ? "negative" : "even";
805
+ return /* @__PURE__ */ s("td", { css: L.cell[c], children: /* @__PURE__ */ s("p", { css: L.difference[g][x], children: w > 0 ? te(`+${w}`) : te(w) }) }, i.key);
931
806
  }
932
- }
933
- ) });
934
- }, Re = ({ zones: e, zoneLabels: t }) => {
935
- const { t: n } = Y("common"), o = D(), a = P(), l = $();
936
- return e.length ? /* @__PURE__ */ r(
937
- S,
938
- {
939
- sx: {
940
- display: "flex",
941
- flexWrap: "wrap",
942
- gap: `${l.xs} ${l.md}`,
943
- padding: `${l.sm} ${l.md}`,
944
- borderTop: `1px solid ${o.outlineEnabledBorder}`,
945
- backgroundColor: o.surface,
946
- fontSize: "1em"
947
- },
948
- children: e.map((c) => {
949
- const i = ke(c.key), s = (i ? t == null ? void 0 : t[i] : void 0) ?? (i ? n(`standings.rules.${i}`, c.label) : c.label);
950
- return /* @__PURE__ */ C(
951
- S,
807
+ if (i.key === "form")
808
+ return /* @__PURE__ */ s("td", { css: L.cell[c], children: /* @__PURE__ */ s(
809
+ Zt,
952
810
  {
953
- sx: { display: "flex", alignItems: "center", gap: "6px" },
954
- children: [
955
- /* @__PURE__ */ r(
956
- S,
957
- {
958
- sx: {
959
- width: 9,
960
- height: 9,
961
- borderRadius: "50%",
962
- flexShrink: 0,
963
- backgroundColor: c.color
964
- }
965
- }
966
- ),
967
- /* @__PURE__ */ r(
968
- L,
969
- {
970
- sx: {
971
- fontFamily: a.secondary,
972
- fontSize: "0.6875em",
973
- color: o.textSecondary
974
- },
975
- children: s
976
- }
977
- )
978
- ]
979
- },
980
- c.key
981
- );
982
- })
983
- }
984
- ) : null;
985
- }, ne = ({
811
+ teamName: e.teamName,
812
+ teamLogoUrl: e.logoUrl,
813
+ matches: u ?? [],
814
+ loading: !!f
815
+ }
816
+ ) }, i.key);
817
+ const h = i.key === "points" || i.key === "winPercentage";
818
+ return /* @__PURE__ */ s("td", { css: L.cell[c], children: /* @__PURE__ */ s("p", { css: h ? L.headline[g] : L.stat[g], children: i.key === "winPercentage" ? Xt(d(i.key)) : d(i.key) }) }, i.key);
819
+ })
820
+ ] });
821
+ }, Yt = a({ height: "1px", padding: 0, backgroundColor: o.border, border: "none" }), qt = ({ colSpan: e }) => /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s("td", { colSpan: e, css: Yt }) }), J = {
822
+ root: a({
823
+ display: "flex",
824
+ flexWrap: "wrap",
825
+ gap: `${o.spaceXs} ${o.spaceMd}`,
826
+ padding: `${o.spaceSm} ${o.spaceMd}`,
827
+ borderTop: `1px solid ${o.border}`,
828
+ backgroundColor: o.surface,
829
+ fontSize: "1em"
830
+ }),
831
+ item: a({ display: "flex", alignItems: "center", gap: "6px" }),
832
+ dot: a({ width: "9px", height: "9px", borderRadius: "50%", flexShrink: 0 }),
833
+ label: a(ne, { fontFamily: o.fontSecondary, fontSize: "0.6875em", color: o.textSecondary })
834
+ }, Ye = ({ zones: e, zoneLabels: t }) => {
835
+ const { t: n } = oe("common");
836
+ return e.length ? /* @__PURE__ */ s("div", { css: J.root, children: e.map((r) => {
837
+ const l = Ze(r.key), m = (l ? t == null ? void 0 : t[l] : void 0) ?? (l ? n(`standings.rules.${l}`, r.label) : r.label);
838
+ return /* @__PURE__ */ S("div", { css: J.item, children: [
839
+ /* @__PURE__ */ s("div", { css: J.dot, style: { backgroundColor: r.color } }),
840
+ /* @__PURE__ */ s("p", { css: J.label, children: m })
841
+ ] }, r.key);
842
+ }) }) : null;
843
+ }, Ee = a(Qe, {
844
+ fontFamily: o.fontBody,
845
+ borderRadius: `0 0 ${o.radiusMd} ${o.radiusMd}`
846
+ }), ee = a({
847
+ height: "32px",
848
+ padding: 0,
849
+ textAlign: "left",
850
+ verticalAlign: "bottom",
851
+ overflow: "hidden",
852
+ whiteSpace: "nowrap",
853
+ textOverflow: "ellipsis",
854
+ borderBottom: `1px solid ${o.border}`
855
+ }), V = a({
856
+ display: "flex",
857
+ alignItems: "center",
858
+ justifyContent: "center",
859
+ padding: "0.625em 0.375em",
860
+ color: o.textSecondary,
861
+ fontFamily: o.fontPrimary,
862
+ fontWeight: 600,
863
+ fontSize: "0.625em",
864
+ textTransform: "uppercase",
865
+ letterSpacing: "0.5px",
866
+ whiteSpace: "nowrap"
867
+ }), ce = { padding: "0.375em" }, me = { justifyContent: "flex-start" }, We = a(V, me, {
868
+ textTransform: "none",
869
+ letterSpacing: "normal",
870
+ fontSize: "0.6875em",
871
+ fontWeight: 700,
872
+ color: o.text
873
+ }), C = {
874
+ sheet: { tab: Ee, card: a(Ee, { borderRadius: o.radiusMd }) },
875
+ scroll: a({ overflowX: "auto" }),
876
+ // Joy's plain Table.
877
+ table: a({
878
+ width: "100%",
879
+ borderSpacing: 0,
880
+ borderCollapse: "separate",
881
+ fontFamily: o.fontBody,
882
+ fontSize: "1em",
883
+ fontWeight: 500,
884
+ lineHeight: 1.5,
885
+ color: o.plainText,
886
+ tableLayout: "auto"
887
+ }),
888
+ th: ee,
889
+ zoneTh: a(ee, { width: "4px" }),
890
+ teamTh: { regular: a(ee, { minWidth: "160px" }), compact: a(ee, { minWidth: "90px" }) },
891
+ label: { regular: V, compact: a(V, ce) },
892
+ startLabel: { regular: a(V, me), compact: a(V, me, ce) },
893
+ groupLabel: { regular: We, compact: a(We, ce) },
894
+ // Same fixed two-column grid as every rank cell below, always — so "#" lines up with
895
+ // the digits exactly, unconditionally.
896
+ rankGrid: a({ display: "inline-grid", gridTemplateColumns: "auto 10px", columnGap: "3px" }),
897
+ hash: a({ textAlign: "end" })
898
+ }, ge = ({
986
899
  group: e,
987
900
  columns: t,
988
901
  showRankChange: n = !1,
989
- showLegend: o = !0,
990
- highlightedCompetitorIds: a,
991
- compact: l = !1,
992
- groupLabel: c,
993
- zoneLabels: i,
902
+ showLegend: r = !0,
903
+ highlightedCompetitorIds: l,
904
+ compact: p = !1,
905
+ groupLabel: m,
906
+ zoneLabels: u,
994
907
  formByTeamId: f,
995
- formLoading: s,
996
- sport: d
908
+ formLoading: g,
909
+ sport: c
997
910
  }) => {
998
- const { t: u } = Y("common"), p = D(), h = P(), b = j(), x = Lt(t, d, e.hasPoints), g = new Map(e.zones.map((k) => [k.key, k])), m = 3 + x.length, w = {
999
- backgroundColor: "transparent",
1000
- borderBottom: `1px solid ${p.outlineEnabledBorder}`,
1001
- padding: 0
1002
- }, R = (k = "center") => ({
911
+ const { t: d } = oe("common"), i = _t(t, c, e.hasPoints), h = new Map(e.zones.map((v) => [v.key, v])), w = 3 + i.length, x = p ? "compact" : "regular";
912
+ return /* @__PURE__ */ S("div", { css: m ? C.sheet.card : C.sheet.tab, children: [
913
+ /* @__PURE__ */ s("div", { css: C.scroll, children: /* @__PURE__ */ S("table", { css: C.table, children: [
914
+ /* @__PURE__ */ s("thead", { children: /* @__PURE__ */ S("tr", { children: [
915
+ m ? /* @__PURE__ */ s("th", { colSpan: 3, css: C.teamTh[x], children: /* @__PURE__ */ s("div", { css: C.groupLabel[x], children: m }) }) : /* @__PURE__ */ S(Z, { children: [
916
+ /* @__PURE__ */ s("th", { css: C.zoneTh }),
917
+ /* @__PURE__ */ s("th", { css: C.th, title: d("leaderboard.position"), children: /* @__PURE__ */ s("div", { css: C.label[x], children: /* @__PURE__ */ S("div", { css: C.rankGrid, children: [
918
+ /* @__PURE__ */ s("span", { css: C.hash, children: "#" }),
919
+ /* @__PURE__ */ s("span", {})
920
+ ] }) }) }),
921
+ /* @__PURE__ */ s("th", { css: C.teamTh[x], children: /* @__PURE__ */ s("div", { css: C.startLabel[x], children: d("standings.columns.team") }) })
922
+ ] }),
923
+ i.map((v) => /* @__PURE__ */ s("th", { css: C.th, title: d(v.fullLabelKey), children: /* @__PURE__ */ s("div", { css: C.label[x], children: d(v.shortLabelKey) }) }, v.key))
924
+ ] }) }),
925
+ /* @__PURE__ */ s("tbody", { children: e.rows.map((v, k) => {
926
+ const b = k > 0 ? e.rows[k - 1].zoneKey : null, D = k > 0 && b !== v.zoneKey;
927
+ return /* @__PURE__ */ S(Ie.Fragment, { children: [
928
+ D && /* @__PURE__ */ s(qt, { colSpan: w }),
929
+ /* @__PURE__ */ s(
930
+ Qt,
931
+ {
932
+ row: v,
933
+ zone: v.zoneKey ? h.get(v.zoneKey) : void 0,
934
+ columns: i,
935
+ showRankChange: n,
936
+ highlighted: !!(l != null && l.includes(v.competitorId)),
937
+ compact: p,
938
+ isLast: k === e.rows.length - 1,
939
+ form: f == null ? void 0 : f[v.competitorId],
940
+ formLoading: g
941
+ }
942
+ )
943
+ ] }, v.competitorId);
944
+ }) })
945
+ ] }) }),
946
+ r && /* @__PURE__ */ s(Ye, { zones: e.zones, zoneLabels: u })
947
+ ] });
948
+ }, Ue = a({
949
+ position: "relative",
950
+ display: "flex",
951
+ alignItems: "center",
952
+ justifyContent: "center",
953
+ flex: "0 0 auto",
954
+ boxSizing: "border-box",
955
+ minWidth: 0,
956
+ margin: 0,
957
+ padding: "0.375em 0.75em",
958
+ border: "1px solid transparent",
959
+ borderRadius: o.radiusFull,
960
+ fontFamily: o.fontPrimary,
961
+ fontWeight: 700,
962
+ fontSize: "0.75em",
963
+ lineHeight: 1,
964
+ textTransform: "uppercase",
965
+ letterSpacing: "0.025em",
966
+ whiteSpace: "nowrap",
967
+ cursor: "pointer",
968
+ WebkitTapHighlightColor: "transparent",
969
+ "&:focus-visible": {
970
+ outline: "2px solid var(--fu-ucrc-focus-visible)",
971
+ outlineOffset: "2px",
972
+ zIndex: 1
973
+ }
974
+ }), G = {
975
+ // Joy's Tabs and TabPanel.
976
+ root: a({
977
+ position: "relative",
1003
978
  display: "flex",
1004
- alignItems: "center",
1005
- justifyContent: k === "left" ? "flex-start" : "center",
1006
- padding: l ? "0.375em" : "0.625em 0.375em",
1007
- color: p.textSecondary,
1008
- fontFamily: h.primary,
1009
- fontWeight: 600,
1010
- fontSize: "0.625em",
1011
- textTransform: "uppercase",
1012
- letterSpacing: "0.5px",
1013
- whiteSpace: "nowrap"
1014
- });
1015
- return /* @__PURE__ */ C(
1016
- he,
1017
- {
1018
- variant: "outlined",
1019
- sx: {
1020
- fontSize: "1em",
1021
- borderRadius: c ? b.md : `0 0 ${b.md} ${b.md}`,
1022
- overflow: "hidden",
1023
- backgroundColor: p.surface,
1024
- borderColor: p.outlineEnabledBorder
979
+ flexDirection: "column",
980
+ fontFamily: o.fontBody,
981
+ fontSize: "1em",
982
+ lineHeight: 1.5,
983
+ color: o.plainText
984
+ }),
985
+ list: a({
986
+ position: "relative",
987
+ zIndex: 1,
988
+ display: "flex",
989
+ boxSizing: "border-box",
990
+ gap: "0.25em",
991
+ // Matches SeasonHeader's and ZoneLegend's own padding so the header, the tab
992
+ // bar, and the legend all read as the same consistent band.
993
+ padding: `${o.spaceSm} ${o.spaceMd}`,
994
+ overflowX: "auto",
995
+ scrollbarWidth: "none",
996
+ // Joy's divider: the neutral channel at 20% (16% in dark mode).
997
+ boxShadow: "inset 0 -1px rgba(var(--fu-ucrc-neutral-main-channel) / 0.2)",
998
+ ".dark &": { boxShadow: "inset 0 -1px rgba(var(--fu-ucrc-neutral-main-channel) / 0.16)" }
999
+ }),
1000
+ panel: a({ flexGrow: 1 }),
1001
+ on: a(Ue, { color: o.onPrimary, backgroundColor: o.primary }),
1002
+ off: a(Ue, {
1003
+ color: o.textSecondary,
1004
+ backgroundColor: "transparent",
1005
+ "&:hover": { color: o.primary, backgroundColor: o.surfaceVariant }
1006
+ })
1007
+ }, qe = ({ labels: e, children: t }) => {
1008
+ const n = Ve(), r = at(), [l, p] = K(0), [m, u] = K(0), f = _e([]), g = (d) => {
1009
+ var h;
1010
+ const i = (d + e.length) % e.length;
1011
+ u(i), (h = f.current[i]) == null || h.focus();
1012
+ }, c = (d) => {
1013
+ const i = n ? "ArrowLeft" : "ArrowRight", h = n ? "ArrowRight" : "ArrowLeft", w = {
1014
+ [i]: m + 1,
1015
+ [h]: m - 1,
1016
+ Home: 0,
1017
+ End: e.length - 1
1018
+ }[d.key];
1019
+ w !== void 0 && (d.preventDefault(), g(w));
1020
+ };
1021
+ return /* @__PURE__ */ S("div", { css: G.root, children: [
1022
+ /* @__PURE__ */ s("div", { role: "tablist", "aria-orientation": "horizontal", css: G.list, onKeyDown: c, children: e.map((d, i) => /* @__PURE__ */ s(
1023
+ "button",
1024
+ {
1025
+ ref: (h) => {
1026
+ f.current[i] = h;
1027
+ },
1028
+ type: "button",
1029
+ role: "tab",
1030
+ id: `${r}-tab-${i}`,
1031
+ "aria-selected": i === l,
1032
+ "aria-controls": `${r}-panel-${i}`,
1033
+ tabIndex: i === m ? 0 : -1,
1034
+ css: i === l ? G.on : G.off,
1035
+ onFocus: () => u(i),
1036
+ onClick: () => {
1037
+ p(i), g(i);
1038
+ },
1039
+ children: d
1025
1040
  },
1026
- children: [
1027
- /* @__PURE__ */ r(S, { sx: { overflowX: "auto" }, children: /* @__PURE__ */ C(
1028
- Pe,
1029
- {
1030
- variant: "plain",
1031
- borderAxis: "none",
1032
- size: "sm",
1033
- sx: {
1034
- fontSize: "1em",
1035
- tableLayout: "auto",
1036
- "--TableCell-paddingX": "6px",
1037
- "--TableCell-paddingY": "5px",
1038
- // Joy enforces a ~32px minimum height per cell via this variable —
1039
- // neutralise it for header cells so their height comes purely from the
1040
- // inner flex box's own padding (headerLabelSx) instead.
1041
- "& thead th": {
1042
- "--unstable-TableCell-height": "0px",
1043
- minHeight: 0
1044
- }
1045
- },
1046
- children: [
1047
- /* @__PURE__ */ r("thead", { children: /* @__PURE__ */ C("tr", { children: [
1048
- c ? /* @__PURE__ */ r(
1049
- "th",
1050
- {
1051
- colSpan: 3,
1052
- style: { ...w, minWidth: l ? 90 : 160 },
1053
- children: /* @__PURE__ */ r(
1054
- S,
1055
- {
1056
- sx: {
1057
- ...R("left"),
1058
- textTransform: "none",
1059
- letterSpacing: "normal",
1060
- fontSize: "0.6875em",
1061
- fontWeight: 700,
1062
- color: p.textPrimary
1063
- },
1064
- children: c
1065
- }
1066
- )
1067
- }
1068
- ) : /* @__PURE__ */ C(_, { children: [
1069
- /* @__PURE__ */ r("th", { style: { ...w, width: 4, padding: 0 } }),
1070
- /* @__PURE__ */ r("th", { style: w, title: u("leaderboard.position"), children: /* @__PURE__ */ r(S, { sx: R(), children: /* @__PURE__ */ C(
1071
- S,
1072
- {
1073
- sx: {
1074
- display: "inline-grid",
1075
- gridTemplateColumns: "auto 10px",
1076
- columnGap: "3px"
1077
- },
1078
- children: [
1079
- /* @__PURE__ */ r("span", { style: { textAlign: "end" }, children: "#" }),
1080
- /* @__PURE__ */ r("span", {})
1081
- ]
1082
- }
1083
- ) }) }),
1084
- /* @__PURE__ */ r("th", { style: { ...w, minWidth: l ? 90 : 160 }, children: /* @__PURE__ */ r(S, { sx: R("left"), children: u("standings.columns.team") }) })
1085
- ] }),
1086
- x.map((k) => /* @__PURE__ */ r(
1087
- "th",
1088
- {
1089
- style: w,
1090
- title: u(k.fullLabelKey),
1091
- children: /* @__PURE__ */ r(S, { sx: R(), children: u(k.shortLabelKey) })
1092
- },
1093
- k.key
1094
- ))
1095
- ] }) }),
1096
- /* @__PURE__ */ r("tbody", { children: e.rows.map((k, F) => {
1097
- const z = F > 0 ? e.rows[F - 1].zoneKey : null, I = F > 0 && z !== k.zoneKey;
1098
- return /* @__PURE__ */ C(E.Fragment, { children: [
1099
- I && /* @__PURE__ */ r(Ft, { colSpan: m }),
1100
- /* @__PURE__ */ r(
1101
- Pt,
1102
- {
1103
- row: k,
1104
- zone: k.zoneKey ? g.get(k.zoneKey) : void 0,
1105
- columns: x,
1106
- showRankChange: n,
1107
- highlighted: !!(a != null && a.includes(k.competitorId)),
1108
- compact: l,
1109
- isLast: F === e.rows.length - 1,
1110
- form: f == null ? void 0 : f[k.competitorId],
1111
- formLoading: s
1112
- }
1113
- )
1114
- ] }, k.competitorId);
1115
- }) })
1116
- ]
1117
- }
1118
- ) }),
1119
- o && /* @__PURE__ */ r(Re, { zones: e.zones, zoneLabels: i })
1120
- ]
1121
- }
1122
- );
1123
- }, Kt = ({
1124
- groups: e,
1125
- columns: t,
1126
- showRankChange: n,
1127
- showLegend: o,
1128
- highlightedCompetitorIds: a,
1129
- zoneLabels: l,
1130
- formByTeamId: c,
1131
- formLoading: i,
1132
- sport: f
1133
- }) => {
1134
- const s = D(), d = P(), u = j(), p = $(), [h, b] = N(0);
1135
- return /* @__PURE__ */ C(
1136
- ye,
1137
- {
1138
- value: h,
1139
- onChange: (x, g) => b(g),
1140
- sx: { fontSize: "1em", backgroundColor: "transparent" },
1141
- children: [
1142
- /* @__PURE__ */ r(
1143
- xe,
1144
- {
1145
- variant: "plain",
1146
- sx: {
1147
- fontSize: "1em",
1148
- overflowX: "auto",
1149
- scrollbarWidth: "none",
1150
- backgroundColor: "transparent",
1151
- borderRadius: 0,
1152
- gap: "0.25em",
1153
- // Matches SeasonHeader's and ZoneLegend's own padding so the header, the tab
1154
- // bar, and the legend all read as the same consistent band.
1155
- paddingLeft: p.md,
1156
- paddingRight: p.md,
1157
- paddingTop: p.sm,
1158
- paddingBottom: p.sm,
1159
- "--ListItem-radius": "0px"
1160
- },
1161
- children: e.map((x, g) => /* @__PURE__ */ r(
1162
- Se,
1163
- {
1164
- variant: "plain",
1165
- color: "neutral",
1166
- disableIndicator: !0,
1167
- sx: {
1168
- fontFamily: d.primary,
1169
- fontWeight: 700,
1170
- fontSize: "0.75em",
1171
- textTransform: "uppercase",
1172
- letterSpacing: "0.025em",
1173
- whiteSpace: "nowrap",
1174
- flex: "0 0 auto",
1175
- borderRadius: u.full,
1176
- padding: "0.375em 0.75em",
1177
- // Joy's Tab/ListItemButton bases apply their own line-height and a
1178
- // --ListItem/--Tab minHeight that padding alone doesn't override —
1179
- // same root cause as the table header fix. Without this the pill ends
1180
- // up visibly taller than the plain-text tabs next to it.
1181
- lineHeight: 1,
1182
- minHeight: "auto",
1183
- minBlockSize: "auto",
1184
- color: g === h ? s.palette.primary.onPrimary : s.textSecondary,
1185
- // Joy's default selected/hover state fills the tab with its own soft
1186
- // background — override with higher specificity ("&&") so the active
1187
- // pill uses the primary colour solidly, matching the design.
1188
- "&&": {
1189
- backgroundColor: g === h ? s.palette.primary.plainColor : "transparent"
1190
- },
1191
- "&&:hover": {
1192
- backgroundColor: g === h ? s.palette.primary.plainColor : s.surfaceVariant,
1193
- color: g === h ? s.palette.primary.onPrimary : s.palette.primary.plainColor
1194
- }
1195
- },
1196
- children: x.name ?? `#${g + 1}`
1197
- },
1198
- x.id ?? x.name ?? g
1199
- ))
1200
- }
1201
- ),
1202
- e.map((x, g) => /* @__PURE__ */ r(
1203
- be,
1204
- {
1205
- value: g,
1206
- sx: { padding: 0, fontSize: "1em" },
1207
- children: /* @__PURE__ */ r(
1208
- ne,
1209
- {
1210
- group: x,
1211
- columns: t,
1212
- showRankChange: n,
1213
- showLegend: o,
1214
- highlightedCompetitorIds: a,
1215
- zoneLabels: l,
1216
- formByTeamId: c,
1217
- formLoading: i,
1218
- sport: f
1219
- }
1220
- )
1221
- },
1222
- x.id ?? x.name ?? g
1223
- ))
1224
- ]
1225
- }
1226
- );
1227
- }, At = [
1041
+ i
1042
+ )) }),
1043
+ e.map((d, i) => /* @__PURE__ */ s(
1044
+ "div",
1045
+ {
1046
+ role: "tabpanel",
1047
+ id: `${r}-panel-${i}`,
1048
+ "aria-labelledby": `${r}-tab-${i}`,
1049
+ hidden: i !== l,
1050
+ css: G.panel,
1051
+ children: i === l && t(i)
1052
+ },
1053
+ i
1054
+ ))
1055
+ ] });
1056
+ }, Jt = ({ groups: e, ...t }) => /* @__PURE__ */ s(qe, { labels: e.map((n, r) => n.name ?? `#${r + 1}`), children: (n) => /* @__PURE__ */ s(ge, { group: e[n], ...t }) }), en = [
1228
1057
  "won",
1229
1058
  "drawn",
1230
1059
  "lost",
1231
1060
  "points"
1232
- ], Ot = ({
1061
+ ], tn = ({
1233
1062
  group: e,
1234
1063
  columns: t,
1235
1064
  highlightedCompetitorIds: n,
1236
- formByTeamId: o,
1237
- formLoading: a,
1238
- sport: l
1239
- }) => /* @__PURE__ */ r(
1240
- ne,
1065
+ formByTeamId: r,
1066
+ formLoading: l,
1067
+ sport: p
1068
+ }) => /* @__PURE__ */ s(
1069
+ ge,
1241
1070
  {
1242
1071
  group: e,
1243
- columns: t ?? At,
1072
+ columns: t ?? en,
1244
1073
  showLegend: !1,
1245
1074
  highlightedCompetitorIds: n,
1246
1075
  groupLabel: e.name ?? void 0,
1247
- formByTeamId: o,
1248
- formLoading: a,
1249
- sport: l,
1076
+ formByTeamId: r,
1077
+ formLoading: l,
1078
+ sport: p,
1250
1079
  compact: !0
1251
1080
  }
1252
- ), Nt = (e) => {
1081
+ ), nn = (e) => {
1253
1082
  const t = /* @__PURE__ */ new Set(), n = [];
1254
- return e.forEach((o) => {
1255
- o.zones.forEach((a) => {
1256
- t.has(a.key) || (t.add(a.key), n.push(a));
1083
+ return e.forEach((r) => {
1084
+ r.zones.forEach((l) => {
1085
+ t.has(l.key) || (t.add(l.key), n.push(l));
1257
1086
  });
1258
1087
  }), n;
1259
- }, De = ({
1088
+ }, on = a({
1089
+ display: "grid",
1090
+ gridTemplateColumns: "repeat(auto-fill, minmax(200px, 1fr))",
1091
+ gap: o.spaceSm,
1092
+ padding: o.spaceSm
1093
+ }), Je = ({
1260
1094
  groups: e,
1261
1095
  groupsView: t,
1262
1096
  columns: n,
1263
- showRankChange: o,
1264
- showLegend: a,
1265
- highlightedCompetitorIds: l,
1266
- zoneLabels: c,
1267
- formByTeamId: i,
1097
+ showRankChange: r,
1098
+ showLegend: l,
1099
+ highlightedCompetitorIds: p,
1100
+ zoneLabels: m,
1101
+ formByTeamId: u,
1268
1102
  formLoading: f,
1269
- sport: s
1270
- }) => {
1271
- const d = $();
1272
- return e.length <= 1 ? /* @__PURE__ */ r(
1273
- ne,
1274
- {
1275
- group: e[0],
1276
- columns: n,
1277
- showRankChange: o,
1278
- showLegend: a,
1279
- highlightedCompetitorIds: l,
1280
- zoneLabels: c,
1281
- formByTeamId: i,
1282
- formLoading: f,
1283
- sport: s
1284
- }
1285
- ) : t === "detailed" ? /* @__PURE__ */ r(
1286
- Kt,
1103
+ sport: g
1104
+ }) => e.length <= 1 ? /* @__PURE__ */ s(
1105
+ ge,
1106
+ {
1107
+ group: e[0],
1108
+ columns: n,
1109
+ showRankChange: r,
1110
+ showLegend: l,
1111
+ highlightedCompetitorIds: p,
1112
+ zoneLabels: m,
1113
+ formByTeamId: u,
1114
+ formLoading: f,
1115
+ sport: g
1116
+ }
1117
+ ) : t === "detailed" ? /* @__PURE__ */ s(
1118
+ Jt,
1119
+ {
1120
+ groups: e,
1121
+ columns: n,
1122
+ showRankChange: r,
1123
+ showLegend: l,
1124
+ highlightedCompetitorIds: p,
1125
+ zoneLabels: m,
1126
+ formByTeamId: u,
1127
+ formLoading: f,
1128
+ sport: g
1129
+ }
1130
+ ) : /* @__PURE__ */ S(Z, { children: [
1131
+ /* @__PURE__ */ s("div", { css: on, children: e.map((c, d) => /* @__PURE__ */ s(
1132
+ tn,
1287
1133
  {
1288
- groups: e,
1134
+ group: c,
1289
1135
  columns: n,
1290
- showRankChange: o,
1291
- showLegend: a,
1292
- highlightedCompetitorIds: l,
1293
- zoneLabels: c,
1294
- formByTeamId: i,
1136
+ highlightedCompetitorIds: p,
1137
+ formByTeamId: u,
1295
1138
  formLoading: f,
1296
- sport: s
1297
- }
1298
- ) : /* @__PURE__ */ C(_, { children: [
1299
- /* @__PURE__ */ r(
1300
- S,
1301
- {
1302
- sx: {
1303
- display: "grid",
1304
- gridTemplateColumns: "repeat(auto-fill, minmax(200px, 1fr))",
1305
- gap: d.sm,
1306
- padding: d.sm
1307
- },
1308
- children: e.map((u, p) => /* @__PURE__ */ r(
1309
- Ot,
1310
- {
1311
- group: u,
1312
- columns: n,
1313
- highlightedCompetitorIds: l,
1314
- formByTeamId: i,
1315
- formLoading: f,
1316
- sport: s
1317
- },
1318
- u.id ?? u.name ?? p
1319
- ))
1320
- }
1321
- ),
1322
- a && /* @__PURE__ */ r(Re, { zones: Nt(e), zoneLabels: c })
1323
- ] });
1324
- }, zt = ({
1325
- stages: e,
1326
- groupsView: t,
1327
- columns: n,
1328
- showRankChange: o,
1329
- showLegend: a,
1330
- highlightedCompetitorIds: l,
1331
- zoneLabels: c,
1332
- formByStageId: i,
1333
- formLoading: f,
1334
- sport: s
1335
- }) => {
1336
- const d = D(), u = P(), p = j(), h = $(), [b, x] = N(0);
1337
- return /* @__PURE__ */ C(
1338
- ye,
1339
- {
1340
- value: b,
1341
- onChange: (g, m) => x(m),
1342
- sx: { fontSize: "1em", backgroundColor: "transparent" },
1343
- children: [
1344
- /* @__PURE__ */ r(
1345
- xe,
1346
- {
1347
- variant: "plain",
1348
- sx: {
1349
- fontSize: "1em",
1350
- overflowX: "auto",
1351
- scrollbarWidth: "none",
1352
- backgroundColor: "transparent",
1353
- borderRadius: 0,
1354
- gap: "0.25em",
1355
- // Matches SeasonHeader's and ZoneLegend's own padding so the header, the tab
1356
- // bar, and the legend all read as the same consistent band.
1357
- paddingLeft: h.md,
1358
- paddingRight: h.md,
1359
- paddingTop: h.sm,
1360
- paddingBottom: h.sm,
1361
- "--ListItem-radius": "0px"
1362
- },
1363
- children: e.map((g, m) => /* @__PURE__ */ r(
1364
- Se,
1365
- {
1366
- variant: "plain",
1367
- color: "neutral",
1368
- disableIndicator: !0,
1369
- sx: {
1370
- fontFamily: u.primary,
1371
- fontWeight: 700,
1372
- fontSize: "0.75em",
1373
- textTransform: "uppercase",
1374
- letterSpacing: "0.025em",
1375
- whiteSpace: "nowrap",
1376
- flex: "0 0 auto",
1377
- borderRadius: p.full,
1378
- padding: "0.375em 0.75em",
1379
- // Joy's Tab/ListItemButton bases apply their own line-height and a
1380
- // --ListItem/--Tab minHeight that padding alone doesn't override —
1381
- // same root cause as the table header fix. Without this the pill ends
1382
- // up visibly taller than the plain-text tabs next to it.
1383
- lineHeight: 1,
1384
- minHeight: "auto",
1385
- minBlockSize: "auto",
1386
- color: m === b ? d.palette.primary.onPrimary : d.textSecondary,
1387
- // Joy's default selected/hover state fills the tab with its own soft
1388
- // background — override with higher specificity ("&&") so the active
1389
- // pill uses the primary colour solidly, matching the design.
1390
- "&&": {
1391
- backgroundColor: m === b ? d.palette.primary.plainColor : "transparent"
1392
- },
1393
- "&&:hover": {
1394
- backgroundColor: m === b ? d.palette.primary.plainColor : d.surfaceVariant,
1395
- color: m === b ? d.palette.primary.onPrimary : d.palette.primary.plainColor
1396
- }
1397
- },
1398
- children: g.name ?? `#${m + 1}`
1399
- },
1400
- g.id
1401
- ))
1402
- }
1403
- ),
1404
- e.map((g, m) => /* @__PURE__ */ r(
1405
- be,
1406
- {
1407
- value: m,
1408
- sx: { padding: 0, fontSize: "1em" },
1409
- children: /* @__PURE__ */ r(
1410
- De,
1411
- {
1412
- groups: g.groups,
1413
- groupsView: t,
1414
- columns: n,
1415
- showRankChange: o,
1416
- showLegend: a,
1417
- highlightedCompetitorIds: l,
1418
- zoneLabels: c,
1419
- formByTeamId: (i == null ? void 0 : i[g.id]) ?? {},
1420
- formLoading: f,
1421
- sport: s
1422
- }
1423
- )
1424
- },
1425
- g.id
1426
- ))
1427
- ]
1428
- }
1429
- );
1430
- }, It = ({
1139
+ sport: g
1140
+ },
1141
+ c.id ?? c.name ?? d
1142
+ )) }),
1143
+ l && /* @__PURE__ */ s(Ye, { zones: nn(e), zoneLabels: m })
1144
+ ] }), rn = ({ stages: e, formByStageId: t, ...n }) => /* @__PURE__ */ s(qe, { labels: e.map((r, l) => r.name ?? `#${l + 1}`), children: (r) => /* @__PURE__ */ s(
1145
+ Je,
1146
+ {
1147
+ groups: e[r].groups,
1148
+ formByTeamId: (t == null ? void 0 : t[e[r].id]) ?? {},
1149
+ ...n
1150
+ }
1151
+ ) }), de = {
1152
+ root: a(Qe, { fontFamily: o.fontPrimary, borderRadius: o.radiusMd }),
1153
+ message: a(ne, {
1154
+ fontFamily: o.fontSecondary,
1155
+ fontSize: "1em",
1156
+ color: o.textSecondary,
1157
+ textAlign: "center",
1158
+ padding: o.spaceLg
1159
+ })
1160
+ }, an = ({
1431
1161
  entityId: e,
1432
1162
  sdk: t,
1433
1163
  language: n,
1434
- stageId: o,
1435
- showHeader: a = !0,
1436
- showRankChange: l = !0,
1437
- showLegend: c = !0,
1438
- highlightedCompetitorIds: i,
1164
+ stageId: r,
1165
+ showHeader: l = !0,
1166
+ showRankChange: p = !0,
1167
+ showLegend: m = !0,
1168
+ highlightedCompetitorIds: u,
1439
1169
  zoneColors: f,
1440
- zoneLabels: s,
1441
- columns: d,
1442
- groupsView: u = "overview",
1443
- groupIds: p,
1170
+ zoneLabels: g,
1171
+ columns: c,
1172
+ groupsView: d = "overview",
1173
+ groupIds: i,
1444
1174
  seasonId: h,
1445
- range: b
1175
+ range: w
1446
1176
  }) => {
1447
- var ce;
1448
- const { t: x } = Y("common"), g = D(), m = P(), w = j(), R = $(), { success: k, primary: F, warning: z, danger: I } = g.palette, T = G(
1177
+ var ve;
1178
+ const { t: x } = oe("common"), v = je(), k = Et(), { success: b, primary: D, warning: O, danger: U } = v.palette, X = j(
1449
1179
  () => ({
1450
- success: k.plainColor,
1451
- primary: F.plainColor,
1452
- warning: z.plainColor,
1453
- danger: I.plainColor
1180
+ success: b.plainColor,
1181
+ primary: D.plainColor,
1182
+ warning: O.plainColor,
1183
+ danger: U.plainColor
1454
1184
  }),
1455
1185
  [
1456
- k.plainColor,
1457
- F.plainColor,
1458
- z.plainColor,
1459
- I.plainColor
1186
+ b.plainColor,
1187
+ D.plainColor,
1188
+ O.plainColor,
1189
+ U.plainColor
1460
1190
  ]
1461
- ), { data: y, loading: K, error: U } = mt(
1191
+ ), { data: y, loading: M, error: re } = Pt(
1462
1192
  e,
1463
1193
  t,
1464
- T,
1194
+ X,
1465
1195
  x("standings.unknownTeam"),
1466
1196
  f,
1467
- p,
1197
+ i,
1468
1198
  h,
1469
- b,
1470
- o
1471
- ), H = !d || d.includes("form"), Q = ((ce = y == null ? void 0 : y.sport) == null ? void 0 : ce.toLowerCase()) === "football", Te = G(() => !y || !H ? [] : y.stages.map((v) => {
1472
- var W, O;
1199
+ w,
1200
+ r
1201
+ ), ae = !c || c.includes("form"), et = ((ve = y == null ? void 0 : y.sport) == null ? void 0 : ve.toLowerCase()) === "football", tt = j(() => !y || !ae ? [] : y.stages.map(($) => {
1202
+ var N, R;
1473
1203
  const A = /* @__PURE__ */ new Set();
1474
- return v.groups.forEach(
1475
- (X) => X.rows.forEach((Z) => A.add(Z.competitorId))
1204
+ return $.groups.forEach(
1205
+ (se) => se.rows.forEach((Q) => A.add(Q.competitorId))
1476
1206
  ), {
1477
- stageId: v.id,
1207
+ stageId: $.id,
1478
1208
  teamIds: Array.from(A),
1479
1209
  // Some stages don't carry their own startDate/endDate (empty string, not
1480
1210
  // null/undefined — hence `||` rather than `??`) — fall back to the season's,
@@ -1482,163 +1212,100 @@ const Ve = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " "
1482
1212
  // missing, default the upper bound to today rather than sending no `toDate` at
1483
1213
  // all, which would let "last 5 matches" spill into a later season. Date-only, so
1484
1214
  // the value (and useTeamsForm's effect key) doesn't change on every render.
1485
- fromDate: v.startDate || ((W = y.season) == null ? void 0 : W.startDate) || null,
1486
- toDate: v.endDate || ((O = y.season) == null ? void 0 : O.endDate) || (/* @__PURE__ */ new Date()).toISOString().slice(0, 10)
1215
+ fromDate: $.startDate || ((N = y.season) == null ? void 0 : N.startDate) || null,
1216
+ toDate: $.endDate || ((R = y.season) == null ? void 0 : R.endDate) || (/* @__PURE__ */ new Date()).toISOString().slice(0, 10)
1487
1217
  };
1488
- }), [y, H]), oe = G(() => {
1489
- const v = /* @__PURE__ */ new Map();
1218
+ }), [y, ae]), he = j(() => {
1219
+ const $ = /* @__PURE__ */ new Map();
1490
1220
  return y == null || y.stages.forEach(
1491
1221
  (A) => A.groups.forEach(
1492
- (W) => W.rows.forEach((O) => {
1493
- v.set(O.competitorId, {
1494
- name: O.teamName,
1495
- logoUrl: O.logoUrl
1222
+ (N) => N.rows.forEach((R) => {
1223
+ $.set(R.competitorId, {
1224
+ name: R.teamName,
1225
+ logoUrl: R.logoUrl
1496
1226
  });
1497
1227
  })
1498
1228
  )
1499
- ), v;
1500
- }, [y]), { formByStageAndTeam: re, loading: ae } = St(t, Te, e, H && Q), se = G(() => {
1501
- const v = x("standings.unknownTeam");
1229
+ ), $;
1230
+ }, [y]), { formByStageAndTeam: ye, loading: be } = Nt(t, tt, e, ae && et), Se = j(() => {
1231
+ const $ = x("standings.unknownTeam");
1502
1232
  return Object.fromEntries(
1503
- Object.entries(re).map(([A, W]) => [
1233
+ Object.entries(ye).map(([A, N]) => [
1504
1234
  A,
1505
1235
  Object.fromEntries(
1506
- Object.entries(W).map(([O, X]) => [
1507
- O,
1508
- X.map((Z) => {
1509
- const B = oe.get(Z.opponentId);
1236
+ Object.entries(N).map(([R, se]) => [
1237
+ R,
1238
+ se.map((Q) => {
1239
+ const E = he.get(Q.opponentId);
1510
1240
  return {
1511
- ...Z,
1512
- opponentName: (B == null ? void 0 : B.name) ?? v,
1513
- opponentLogoUrl: (B == null ? void 0 : B.logoUrl) ?? null
1241
+ ...Q,
1242
+ opponentName: (E == null ? void 0 : E.name) ?? $,
1243
+ opponentLogoUrl: (E == null ? void 0 : E.logoUrl) ?? null
1514
1244
  };
1515
1245
  })
1516
1246
  ])
1517
1247
  )
1518
1248
  ])
1519
1249
  );
1520
- }, [re, oe, x]), le = !y || y.stages.every(
1521
- (v) => v.groups.every((A) => A.rows.length === 0)
1522
- ), ie = {
1523
- fontFamily: m.secondary,
1524
- fontSize: "1em",
1525
- color: g.textSecondary,
1526
- textAlign: "center",
1527
- padding: R.lg
1528
- };
1529
- return /* @__PURE__ */ C(
1530
- he,
1531
- {
1532
- variant: "outlined",
1533
- sx: {
1534
- fontSize: "1em",
1535
- fontFamily: m.primary,
1536
- borderRadius: w.md,
1537
- overflow: "hidden",
1538
- backgroundColor: g.surface,
1539
- borderColor: g.outlineEnabledBorder
1540
- },
1541
- children: [
1542
- K && /* @__PURE__ */ r(ze, { my: 10 }),
1543
- !K && U && /* @__PURE__ */ r(L, { sx: ie, children: x("standings.loadFailed") }),
1544
- !K && !U && le && /* @__PURE__ */ r(L, { sx: ie, children: x("standings.noStandingsAvailable") }),
1545
- !K && !U && y && !le && /* @__PURE__ */ C(_, { children: [
1546
- a && /* @__PURE__ */ r(
1547
- bt,
1548
- {
1549
- title: y.competitionName,
1550
- logoUrl: y.logoUrl,
1551
- season: y.season,
1552
- language: n
1553
- }
1554
- ),
1555
- y.stages.length > 1 ? /* @__PURE__ */ r(
1556
- zt,
1557
- {
1558
- stages: y.stages,
1559
- groupsView: u,
1560
- columns: d,
1561
- showRankChange: l,
1562
- showLegend: c,
1563
- highlightedCompetitorIds: i,
1564
- zoneLabels: s,
1565
- formByStageId: se,
1566
- formLoading: ae,
1567
- sport: y.sport
1568
- }
1569
- ) : /* @__PURE__ */ r(
1570
- De,
1571
- {
1572
- groups: y.stages[0].groups,
1573
- groupsView: u,
1574
- columns: d,
1575
- showRankChange: l,
1576
- showLegend: c,
1577
- highlightedCompetitorIds: i,
1578
- zoneLabels: s,
1579
- formByTeamId: se[y.stages[0].id] ?? {},
1580
- formLoading: ae,
1581
- sport: y.sport
1582
- }
1583
- )
1584
- ] })
1585
- ]
1586
- }
1250
+ }, [ye, he, x]), xe = !y || y.stages.every(
1251
+ ($) => $.groups.every((A) => A.rows.length === 0)
1587
1252
  );
1588
- }, Mt = (e) => {
1589
- const [t, n] = E.useState(!1), [o, a] = E.useState(!1), l = Ie(e.language), c = E.useRef(
1590
- `$standings-shadow-root-${Math.random().toString(36).substring(2, 11)}`
1591
- ), i = E.useRef(null), f = E.useRef(null), s = E.useRef(null), [d, u] = E.useState(null);
1592
- E.useEffect(() => {
1593
- Me(e.language || "en").finally(() => a(!0));
1594
- }, [e.language]), E.useEffect(() => {
1595
- if (!i.current) return;
1596
- i.current.shadowRoot ? (f.current = i.current.shadowRoot, s.current = f.current.getElementById(
1597
- c.current
1598
- ), s.current || (s.current = document.createElement("div"), s.current.id = c.current, s.current.style.height = "100%", f.current.appendChild(s.current))) : (f.current = i.current.attachShadow({ mode: "open" }), s.current = document.createElement("div"), s.current.id = c.current, s.current.style.height = "100%", f.current.appendChild(s.current)), $e(s.current, l);
1599
- const x = Ue("standings", l);
1600
- return u(
1601
- (g) => (g == null ? void 0 : g.key) === x ? g : We(
1602
- "standings",
1603
- f.current,
1604
- l
1253
+ return /* @__PURE__ */ S("div", { css: de.root, style: k, children: [
1254
+ M && /* @__PURE__ */ s(ot, { marginBlock: "80px" }),
1255
+ !M && re && /* @__PURE__ */ s("p", { css: de.message, children: x("standings.loadFailed") }),
1256
+ !M && !re && xe && /* @__PURE__ */ s("p", { css: de.message, children: x("standings.noStandingsAvailable") }),
1257
+ !M && !re && y && !xe && /* @__PURE__ */ S(Z, { children: [
1258
+ l && /* @__PURE__ */ s(
1259
+ Wt,
1260
+ {
1261
+ title: y.competitionName,
1262
+ logoUrl: y.logoUrl,
1263
+ season: y.season,
1264
+ language: n
1265
+ }
1266
+ ),
1267
+ y.stages.length > 1 ? /* @__PURE__ */ s(
1268
+ rn,
1269
+ {
1270
+ stages: y.stages,
1271
+ groupsView: d,
1272
+ columns: c,
1273
+ showRankChange: p,
1274
+ showLegend: m,
1275
+ highlightedCompetitorIds: u,
1276
+ zoneLabels: g,
1277
+ formByStageId: Se,
1278
+ formLoading: be,
1279
+ sport: y.sport
1280
+ }
1281
+ ) : /* @__PURE__ */ s(
1282
+ Je,
1283
+ {
1284
+ groups: y.stages[0].groups,
1285
+ groupsView: d,
1286
+ columns: c,
1287
+ showRankChange: p,
1288
+ showLegend: m,
1289
+ highlightedCompetitorIds: u,
1290
+ zoneLabels: g,
1291
+ formByTeamId: Se[y.stages[0].id] ?? {},
1292
+ formLoading: be,
1293
+ sport: y.sport
1294
+ }
1605
1295
  )
1606
- ), n(!0), () => {
1607
- n(!1);
1608
- };
1609
- }, [l]);
1610
- const p = e.themeOptions, h = /* @__PURE__ */ r(S, { ref: i, lang: e.language || "en", sx: { height: "100%", display: "block" } }), b = t && o && s.current && d ? we(
1611
- // Keyed on the cache, not on `direction`: it must change in the same
1612
- // render that adopts the new cache, or CssVarsProvider writes its CSS
1613
- // variables into the outgoing cache and never repeats.
1614
- /* @__PURE__ */ r(je, { value: d, children: /* @__PURE__ */ r(Be, { containerRef: i, children: /* @__PURE__ */ r(
1615
- _e,
1616
- {
1617
- customTheme: p,
1618
- mode: p == null ? void 0 : p.mode,
1619
- shadowRootElement: s.current,
1620
- direction: l,
1621
- children: /* @__PURE__ */ r(
1622
- He,
1623
- {
1624
- shadowRootElement: s.current,
1625
- leadPhoneCountryCode: null,
1626
- language: e.language,
1627
- optionsLayout: null,
1628
- direction: l,
1629
- disableCache: e.disableCache ?? !1,
1630
- children: e.children
1631
- }
1632
- )
1633
- }
1634
- ) }) }, d.key),
1635
- s.current
1636
- ) : null;
1637
- return /* @__PURE__ */ C(_, { children: [
1638
- h,
1639
- b
1296
+ ] })
1640
1297
  ] });
1641
- }, $t = (e) => /* @__PURE__ */ r(Mt, { ...e, children: /* @__PURE__ */ r(It, { ...e }) }), Qt = Ze($t);
1298
+ }, sn = (e) => /* @__PURE__ */ s(
1299
+ rt,
1300
+ {
1301
+ packageName: "standings",
1302
+ language: e.language,
1303
+ themeOptions: e.themeOptions,
1304
+ disableCache: e.disableCache,
1305
+ fillHeight: !0,
1306
+ children: /* @__PURE__ */ s(an, { ...e })
1307
+ }
1308
+ ), bn = ut(sn);
1642
1309
  export {
1643
- Qt as Standings
1310
+ bn as Standings
1644
1311
  };