@pitvox/partner-react 0.7.22 → 0.7.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,52 +1,57 @@
1
1
  import { jsx as n, jsxs as l, Fragment as B } from "react/jsx-runtime";
2
- import { createContext as He, useMemo as T, useContext as je, useState as E, useCallback as K, useRef as Ve, useEffect as We } from "react";
3
- import { useQueryClient as O, QueryClient as Ke, QueryClientProvider as Oe, useQuery as $, useMutation as Y, useQueries as xe } from "@tanstack/react-query";
4
- const ae = He(null), Ge = "https://cdn.pitvox.com", ze = "https://pitvox.com";
5
- let te = null;
6
- function Rt({
2
+ import { createContext as Qe, useMemo as T, useContext as Ye, useState as E, useEffect as $e, useCallback as H, useRef as Ze } from "react";
3
+ import { useQueryClient as V, QueryClient as Je, QueryClientProvider as Xe, useQuery as R, useMutation as G, useQueries as be } from "@tanstack/react-query";
4
+ import en from "react-markdown";
5
+ const oe = Qe(null), nn = "https://cdn.pitvox.com", tn = "https://pitvox.com";
6
+ let se = null;
7
+ function Zt({
7
8
  partnerSlug: e = null,
8
- cdnUrl: t = Ge,
9
- pitvoxUrl: r = ze,
9
+ cdnUrl: t = nn,
10
+ pitvoxUrl: r = tn,
10
11
  getSteamId: s,
11
12
  onRegister: a,
12
- onWithdraw: i,
13
- onFetchNotifications: o,
13
+ onWithdraw: o,
14
+ onFetchNotifications: i,
14
15
  onMarkNotificationRead: d,
15
16
  onMarkAllNotificationsRead: p,
16
17
  onFetchServerPassword: c,
17
- children: u
18
+ onEnterPromotion: u,
19
+ onWithdrawPromotionEntry: v,
20
+ children: f
18
21
  }) {
19
- const v = T(() => ({
22
+ const h = T(() => ({
20
23
  partnerSlug: e,
21
24
  cdnUrl: t.replace(/\/$/, ""),
22
25
  pitvoxUrl: r.replace(/\/$/, ""),
23
26
  getSteamId: s || (() => null),
24
27
  onRegister: a || null,
25
- onWithdraw: i || null,
26
- onFetchNotifications: o || null,
28
+ onWithdraw: o || null,
29
+ onFetchNotifications: i || null,
27
30
  onMarkNotificationRead: d || null,
28
31
  onMarkAllNotificationsRead: p || null,
29
- onFetchServerPassword: c || null
30
- }), [e, t, r, s, a, i, o, d, p, c]);
31
- let f = !1;
32
+ onFetchServerPassword: c || null,
33
+ onEnterPromotion: u || null,
34
+ onWithdrawPromotionEntry: v || null
35
+ }), [e, t, r, s, a, o, i, d, p, c, u, v]);
36
+ let y = !1;
32
37
  try {
33
- O(), f = !0;
38
+ V(), y = !0;
34
39
  } catch {
35
- f = !1;
40
+ y = !1;
36
41
  }
37
- return f ? /* @__PURE__ */ n(ae.Provider, { value: v, children: u }) : (te || (te = new Ke({
42
+ return y ? /* @__PURE__ */ n(oe.Provider, { value: h, children: f }) : (se || (se = new Je({
38
43
  defaultOptions: {
39
44
  queries: { staleTime: 6e4 }
40
45
  }
41
- })), /* @__PURE__ */ n(Oe, { client: te, children: /* @__PURE__ */ n(ae.Provider, { value: v, children: u }) }));
46
+ })), /* @__PURE__ */ n(Xe, { client: se, children: /* @__PURE__ */ n(oe.Provider, { value: h, children: f }) }));
42
47
  }
43
- function L() {
44
- const e = je(ae);
48
+ function S() {
49
+ const e = Ye(oe);
45
50
  if (!e)
46
51
  throw new Error("usePitVox must be used within a <PitVoxPartnerProvider>");
47
52
  return e;
48
53
  }
49
- async function D(e, t) {
54
+ async function M(e, t) {
50
55
  const r = await fetch(`${e}/${t}`);
51
56
  if (!r.ok) {
52
57
  if (r.status === 404 || r.status === 403) return null;
@@ -54,18 +59,18 @@ async function D(e, t) {
54
59
  }
55
60
  return r.json();
56
61
  }
57
- function ie(e, t, r, ...s) {
62
+ function de(e, t, r, ...s) {
58
63
  const a = ["leaderboards"];
59
64
  return e && a.push(`partners/${e}`), t && a.push(t), r && a.push(`v/${r}`), [...a, ...s].join("/");
60
65
  }
61
- function Qe(e, t, r, s) {
66
+ function rn(e, t, r, s) {
62
67
  const a = s || "default";
63
68
  return e ? `laps/partners/${e}/${t}/${r}/${a}.json` : `laps/${t}/${r}/${a}.json`;
64
69
  }
65
- function ye(e, t) {
70
+ function Te(e, t) {
66
71
  return e ? `laps/partners/${e}/${t}/index.json` : `laps/${t}/index.json`;
67
72
  }
68
- function Ye(e) {
73
+ function sn(e) {
69
74
  return e ? `recent-laps/partners/${e}.json` : "recent-laps.json";
70
75
  }
71
76
  function q(e) {
@@ -76,19 +81,19 @@ function q(e) {
76
81
  function F(e) {
77
82
  return !e && e !== 0 ? "-" : e >= 6e4 ? q(e) : (e / 1e3).toFixed(3);
78
83
  }
79
- function _(e) {
84
+ function I(e) {
80
85
  if (!e) return "";
81
86
  let t = e;
82
87
  return t.startsWith("ks_") && (t = t.slice(3)), t.split("_").map((r) => r.charAt(0).toUpperCase() + r.slice(1)).join(" ");
83
88
  }
84
- function V(e, t, r) {
89
+ function z(e, t, r) {
85
90
  if (!e) return "";
86
- const s = e.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" "), a = r === "acc" || !r && (t == null ? void 0 : t.toLowerCase()) === "track config";
91
+ const s = e.split("_").map((i) => i.charAt(0).toUpperCase() + i.slice(1)).join(" "), a = r === "acc" || !r && (t == null ? void 0 : t.toLowerCase()) === "track config";
87
92
  if (!t || t === "default" || a) return s;
88
- const i = t.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" ");
89
- return `${s} ${i}`;
93
+ const o = t.split("_").map((i) => i.charAt(0).toUpperCase() + i.slice(1)).join(" ");
94
+ return `${s} ${o}`;
90
95
  }
91
- function G(e) {
96
+ function Q(e) {
92
97
  if (!e) return "-";
93
98
  try {
94
99
  return new Date(e).toLocaleDateString("en-GB", {
@@ -100,7 +105,7 @@ function G(e) {
100
105
  return "-";
101
106
  }
102
107
  }
103
- function oe(e) {
108
+ function pe(e) {
104
109
  if (!e) return "";
105
110
  const t = Date.now() - new Date(e).getTime(), r = Math.floor(t / 1e3);
106
111
  if (r < 60) return "Just now";
@@ -108,17 +113,17 @@ function oe(e) {
108
113
  if (s < 60) return `${s}m ago`;
109
114
  const a = Math.floor(s / 60);
110
115
  if (a < 24) return `${a}h ago`;
111
- const i = Math.floor(a / 24);
112
- return i < 30 ? `${i}d ago` : G(e);
116
+ const o = Math.floor(a / 24);
117
+ return o < 30 ? `${o}d ago` : Q(e);
113
118
  }
114
- function Tt(e) {
119
+ function Jt(e) {
115
120
  return e == null ? "" : `${e >= 0 ? "+" : "-"}${(Math.abs(e) / 1e3).toFixed(3)}`;
116
121
  }
117
- function Ze(e, t) {
118
- const { type: r, title: s, trackId: a, trackLayout: i, carId: o, game: d, data: p } = e, c = typeof p == "string" ? JSON.parse(p) : p, u = a ? V(a, i, d) : null, v = o ? _(o) : null, f = [u, v].filter(Boolean).join(" — ");
122
+ function an(e, t) {
123
+ const { type: r, title: s, trackId: a, trackLayout: o, carId: i, game: d, data: p } = e, c = typeof p == "string" ? JSON.parse(p) : p, u = a ? z(a, o, d) : null, v = i ? I(i) : null, f = [u, v].filter(Boolean).join(" — ");
119
124
  return r === "RECORD_BEATEN" && f ? `${c != null && c.beatenBySteamId && t ? t(c.beatenBySteamId).displayName : "Someone"} beat your record on ${f}` : r === "RECORD_SET" && f ? `You set a new record on ${f}` : s || "New notification";
120
125
  }
121
- function ke(e) {
126
+ function Re(e) {
122
127
  return e ? {
123
128
  E: "Eco",
124
129
  RD: "Road",
@@ -132,119 +137,119 @@ function ke(e) {
132
137
  S: "Soft"
133
138
  }[e] || e : "Unknown";
134
139
  }
135
- function we(e) {
140
+ function Me(e) {
136
141
  if (!e) return "-";
137
142
  const t = Number(e);
138
143
  return isNaN(t) ? "-" : t % 1 ? `${t.toFixed(1)}L` : `${t}L`;
139
144
  }
140
- function Je(e = {}) {
145
+ function on(e = {}) {
141
146
  var p, c, u, v, f, h;
142
- const { cdnUrl: t, partnerSlug: r } = L(), { game: s, gameVersion: a } = e, i = ie(r, null, null, "index.json"), o = $({
147
+ const { cdnUrl: t, partnerSlug: r } = S(), { game: s, gameVersion: a } = e, o = de(r, null, null, "index.json"), i = R({
143
148
  queryKey: ["pitvox", "leaderboards", r, "index"],
144
- queryFn: () => D(t, i),
149
+ queryFn: () => M(t, o),
145
150
  staleTime: 3e4,
146
151
  refetchInterval: 3e4
147
152
  }), d = T(() => {
148
- var m;
149
- if (!((m = o.data) != null && m.tracks)) return [];
150
- let k = o.data.tracks;
151
- return s && (k = k.filter((g) => g.game === s)), a && (k = k.filter((g) => g.gameVersion === a)), k.map((g) => ({
152
- id: g.trackId,
153
- layout: g.layout,
154
- game: g.game,
155
- gameVersion: g.gameVersion,
156
- displayName: V(g.trackId, g.layout, g.game),
157
- driverCount: g.driverCount || 0,
158
- carCount: g.carCount || 0,
159
- record: g.recordHolder ? {
160
- visibleId: g.recordHolder.steamId || g.recordHolder.userId,
161
- carId: g.recordHolder.carId,
162
- carDisplayName: _(g.recordHolder.carId),
163
- lapTimeMs: g.recordHolder.lapTimeMs,
164
- timestamp: g.recordHolder.recordedAt
153
+ var x;
154
+ if (!((x = i.data) != null && x.tracks)) return [];
155
+ let y = i.data.tracks;
156
+ return s && (y = y.filter((m) => m.game === s)), a && (y = y.filter((m) => m.gameVersion === a)), y.map((m) => ({
157
+ id: m.trackId,
158
+ layout: m.layout,
159
+ game: m.game,
160
+ gameVersion: m.gameVersion,
161
+ displayName: z(m.trackId, m.layout, m.game),
162
+ driverCount: m.driverCount || 0,
163
+ carCount: m.carCount || 0,
164
+ record: m.recordHolder ? {
165
+ visibleId: m.recordHolder.steamId || m.recordHolder.userId,
166
+ carId: m.recordHolder.carId,
167
+ carDisplayName: I(m.recordHolder.carId),
168
+ lapTimeMs: m.recordHolder.lapTimeMs,
169
+ timestamp: m.recordHolder.recordedAt
165
170
  } : null,
166
- recordByTag: g.recordByTag || null
171
+ recordByTag: m.recordByTag || null
167
172
  }));
168
- }, [(p = o.data) == null ? void 0 : p.tracks, s, a]);
173
+ }, [(p = i.data) == null ? void 0 : p.tracks, s, a]);
169
174
  return {
170
- ...o,
175
+ ...i,
171
176
  data: d,
172
- partner: ((c = o.data) == null ? void 0 : c.partner) || null,
173
- generatedAt: (u = o.data) == null ? void 0 : u.generatedAt,
174
- totalLaps: ((v = o.data) == null ? void 0 : v.totalLaps) || 0,
175
- totalUsers: ((f = o.data) == null ? void 0 : f.totalUsers) || 0,
176
- versions: ((h = o.data) == null ? void 0 : h.versions) || {}
177
+ partner: ((c = i.data) == null ? void 0 : c.partner) || null,
178
+ generatedAt: (u = i.data) == null ? void 0 : u.generatedAt,
179
+ totalLaps: ((v = i.data) == null ? void 0 : v.totalLaps) || 0,
180
+ totalUsers: ((f = i.data) == null ? void 0 : f.totalUsers) || 0,
181
+ versions: ((h = i.data) == null ? void 0 : h.versions) || {}
177
182
  };
178
183
  }
179
- function Xe(e, t, r = {}) {
180
- const { cdnUrl: s, partnerSlug: a } = L(), { carId: i, game: o, gameVersion: d } = r, p = t || "default", c = ie(a, o, d, `tracks/${e}/${p}.json`), { data: u, isLoading: v, error: f } = $({
181
- queryKey: ["pitvox", "leaderboards", a, "track", e, p, o, d],
182
- queryFn: () => D(s, c),
184
+ function ln(e, t, r = {}) {
185
+ const { cdnUrl: s, partnerSlug: a } = S(), { carId: o, game: i, gameVersion: d } = r, p = t || "default", c = de(a, i, d, `tracks/${e}/${p}.json`), { data: u, isLoading: v, error: f } = R({
186
+ queryKey: ["pitvox", "leaderboards", a, "track", e, p, i, d],
187
+ queryFn: () => M(s, c),
183
188
  enabled: !!e,
184
189
  staleTime: 3e4,
185
190
  refetchInterval: 3e4
186
191
  });
187
192
  return { data: T(() => {
188
193
  if (!(u != null && u.entries)) return [];
189
- let k = u.entries;
190
- if (o && (k = k.filter((m) => m.game === o)), !i) {
191
- const m = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
192
- for (const b of k) {
193
- const x = b.steamId || b.userId;
194
- g.has(b.carId) || g.set(b.carId, /* @__PURE__ */ new Set()), g.get(b.carId).add(x), (!m.has(b.carId) || b.lapTimeMs < m.get(b.carId).lapTimeMs) && m.set(b.carId, b);
194
+ let y = u.entries;
195
+ if (i && (y = y.filter((x) => x.game === i)), !o) {
196
+ const x = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
197
+ for (const b of y) {
198
+ const g = b.steamId || b.userId;
199
+ m.has(b.carId) || m.set(b.carId, /* @__PURE__ */ new Set()), m.get(b.carId).add(g), (!x.has(b.carId) || b.lapTimeMs < x.get(b.carId).lapTimeMs) && x.set(b.carId, b);
195
200
  }
196
- return Array.from(m.values()).map((b) => {
197
- var x;
198
- return { ...b, driverCount: ((x = g.get(b.carId)) == null ? void 0 : x.size) || 0 };
199
- }).sort((b, x) => b.lapTimeMs - x.lapTimeMs);
201
+ return Array.from(x.values()).map((b) => {
202
+ var g;
203
+ return { ...b, driverCount: ((g = m.get(b.carId)) == null ? void 0 : g.size) || 0 };
204
+ }).sort((b, g) => b.lapTimeMs - g.lapTimeMs);
200
205
  }
201
- return k.filter((m) => m.carId === i).sort((m, g) => m.lapTimeMs - g.lapTimeMs);
202
- }, [u == null ? void 0 : u.entries, i, o]), isLoading: v, error: f };
203
- }
204
- function en(e, t, r, s, a = {}) {
205
- var m, g;
206
- const { cdnUrl: i, partnerSlug: o } = L(), { showInvalid: d = !1, game: p, gameVersion: c } = a, u = e && t ? Qe(o, e, t, r) : null, f = $({
207
- queryKey: ["pitvox", "laps", o, e, t, r || "default"],
208
- queryFn: () => D(i, u),
206
+ return y.filter((x) => x.carId === o).sort((x, m) => x.lapTimeMs - m.lapTimeMs);
207
+ }, [u == null ? void 0 : u.entries, o, i]), isLoading: v, error: f };
208
+ }
209
+ function cn(e, t, r, s, a = {}) {
210
+ var x, m;
211
+ const { cdnUrl: o, partnerSlug: i } = S(), { showInvalid: d = !1, game: p, gameVersion: c } = a, u = e && t ? rn(i, e, t, r) : null, f = R({
212
+ queryKey: ["pitvox", "laps", i, e, t, r || "default"],
213
+ queryFn: () => M(o, u),
209
214
  enabled: !!e && !!t,
210
215
  staleTime: 3e4,
211
216
  refetchInterval: 3e4
212
217
  }), h = T(() => {
213
218
  var b;
214
- return (b = f.data) != null && b.laps ? f.data.laps.filter((x) => !(x.carId !== s || p && x.game !== p || c && x.gameVersion !== c || !d && !x.isValid)).sort((x, w) => x.lapTimeMs - w.lapTimeMs) : [];
215
- }, [(m = f.data) == null ? void 0 : m.laps, s, p, c, d]), k = T(() => {
219
+ return (b = f.data) != null && b.laps ? f.data.laps.filter((g) => !(g.carId !== s || p && g.game !== p || c && g.gameVersion !== c || !d && !g.isValid)).sort((g, k) => g.lapTimeMs - k.lapTimeMs) : [];
220
+ }, [(x = f.data) == null ? void 0 : x.laps, s, p, c, d]), y = T(() => {
216
221
  const b = h.filter((N) => N.isValid && N.sector1Ms && N.sector2Ms && N.sector3Ms);
217
222
  if (b.length < 2) return null;
218
- const x = Math.min(...b.map((N) => N.sector1Ms)), w = Math.min(...b.map((N) => N.sector2Ms)), C = Math.min(...b.map((N) => N.sector3Ms)), M = x + w + C, P = Math.min(...b.map((N) => N.lapTimeMs));
219
- return M >= P ? null : { lapTimeMs: M, sector1Ms: x, sector2Ms: w, sector3Ms: C };
223
+ const g = Math.min(...b.map((N) => N.sector1Ms)), k = Math.min(...b.map((N) => N.sector2Ms)), C = Math.min(...b.map((N) => N.sector3Ms)), P = g + k + C, A = Math.min(...b.map((N) => N.lapTimeMs));
224
+ return P >= A ? null : { lapTimeMs: P, sector1Ms: g, sector2Ms: k, sector3Ms: C };
220
225
  }, [h]);
221
226
  return {
222
227
  ...f,
223
228
  data: h,
224
- driverName: ((g = f.data) == null ? void 0 : g.driverName) || "Driver",
225
- theoreticalBest: k
229
+ driverName: ((m = f.data) == null ? void 0 : m.driverName) || "Driver",
230
+ theoreticalBest: y
226
231
  };
227
232
  }
228
- function Ce() {
229
- const { cdnUrl: e } = L(), { data: t } = $({
233
+ function ue() {
234
+ const { cdnUrl: e } = S(), { data: t } = R({
230
235
  queryKey: ["pitvox", "users", "index"],
231
- queryFn: () => D(e, "users/index.json"),
236
+ queryFn: () => M(e, "users/index.json"),
232
237
  staleTime: 5 * 6e4,
233
238
  gcTime: 30 * 6e4
234
239
  }), r = (t == null ? void 0 : t.users) || {};
235
240
  return (s, a) => {
236
- const i = r[s];
241
+ const o = r[s];
237
242
  return {
238
- displayName: (i == null ? void 0 : i.displayName) || a || s || "Unknown",
239
- avatarUrl: (i == null ? void 0 : i.avatarUrl) || null,
240
- affiliations: (i == null ? void 0 : i.affiliations) || []
243
+ displayName: (o == null ? void 0 : o.displayName) || a || s || "Unknown",
244
+ avatarUrl: (o == null ? void 0 : o.avatarUrl) || null,
245
+ affiliations: (o == null ? void 0 : o.affiliations) || []
241
246
  };
242
247
  };
243
248
  }
244
- function $t(e = "evo") {
245
- const { cdnUrl: t } = L(), { data: r } = $({
249
+ function Xt(e = "evo") {
250
+ const { cdnUrl: t } = S(), { data: r } = R({
246
251
  queryKey: ["pitvox", "cars", e],
247
- queryFn: () => D(t, `cars/${e}.json`),
252
+ queryFn: () => M(t, `cars/${e}.json`),
248
253
  staleTime: 5 * 6e4,
249
254
  gcTime: 30 * 6e4
250
255
  });
@@ -255,153 +260,153 @@ function $t(e = "evo") {
255
260
  tagLabels: (r == null ? void 0 : r.tagLabels) || {}
256
261
  };
257
262
  }
258
- function Mt() {
259
- var a, i;
260
- const { cdnUrl: e, partnerSlug: t } = L(), r = Ye(t), s = $({
263
+ function er() {
264
+ var a, o;
265
+ const { cdnUrl: e, partnerSlug: t } = S(), r = sn(t), s = R({
261
266
  queryKey: ["pitvox", "recentLaps", t],
262
- queryFn: () => D(e, r),
267
+ queryFn: () => M(e, r),
263
268
  staleTime: 3e4,
264
269
  refetchInterval: 3e4,
265
270
  gcTime: 10 * 6e4
266
271
  });
267
272
  return {
268
273
  groups: ((a = s.data) == null ? void 0 : a.groups) || [],
269
- generatedAt: ((i = s.data) == null ? void 0 : i.generatedAt) || null,
274
+ generatedAt: ((o = s.data) == null ? void 0 : o.generatedAt) || null,
270
275
  isLoading: s.isLoading
271
276
  };
272
277
  }
273
- function Dt(e, t) {
274
- return Xe(e, null, { carId: t });
278
+ function nr(e, t) {
279
+ return ln(e, null, { carId: t });
275
280
  }
276
- function At() {
277
- const { cdnUrl: e, partnerSlug: t } = L();
278
- return $({
281
+ function tr() {
282
+ const { cdnUrl: e, partnerSlug: t } = S();
283
+ return R({
279
284
  queryKey: ["pitvox", "competitions", t],
280
285
  queryFn: async () => {
281
- const r = await D(e, "competitions/index.json");
286
+ const r = await M(e, "competitions/index.json");
282
287
  return r != null && r.competitions ? t ? r.competitions.filter((s) => s.partnerSlug === t) : r.competitions : [];
283
288
  },
284
289
  staleTime: 6e4
285
290
  });
286
291
  }
287
- function Se(e, t = {}) {
288
- const r = L(), s = t.partnerSlug || r.partnerSlug;
289
- return $({
292
+ function Pe(e, t = {}) {
293
+ const r = S(), s = t.partnerSlug || r.partnerSlug;
294
+ return R({
290
295
  queryKey: ["pitvox", "competition", s, e, "config"],
291
- queryFn: () => D(r.cdnUrl, `competitions/${s}/${e}/config.json`),
296
+ queryFn: () => M(r.cdnUrl, `competitions/${s}/${e}/config.json`),
292
297
  enabled: !!s && !!e,
293
298
  staleTime: 6e4
294
299
  });
295
300
  }
296
- function Le(e, t = {}) {
297
- const r = L(), s = t.partnerSlug || r.partnerSlug;
298
- return $({
301
+ function De(e, t = {}) {
302
+ const r = S(), s = t.partnerSlug || r.partnerSlug;
303
+ return R({
299
304
  queryKey: ["pitvox", "competition", s, e, "standings"],
300
- queryFn: () => D(r.cdnUrl, `competitions/${s}/${e}/standings.json`),
305
+ queryFn: () => M(r.cdnUrl, `competitions/${s}/${e}/standings.json`),
301
306
  enabled: !!s && !!e,
302
307
  staleTime: 6e4
303
308
  });
304
309
  }
305
- function nn(e, t, r = {}) {
306
- const s = L(), a = r.partnerSlug || s.partnerSlug;
307
- return $({
310
+ function dn(e, t, r = {}) {
311
+ const s = S(), a = r.partnerSlug || s.partnerSlug;
312
+ return R({
308
313
  queryKey: ["pitvox", "competition", a, e, "round", t],
309
- queryFn: () => D(s.cdnUrl, `competitions/${a}/${e}/rounds/${t}.json`),
314
+ queryFn: () => M(s.cdnUrl, `competitions/${a}/${e}/rounds/${t}.json`),
310
315
  enabled: !!a && !!e && t != null,
311
316
  staleTime: 6e4
312
317
  });
313
318
  }
314
- function tn(e, t = [], r = {}) {
315
- const s = L(), a = r.partnerSlug || s.partnerSlug;
316
- return $({
319
+ function pn(e, t = [], r = {}) {
320
+ const s = S(), a = r.partnerSlug || s.partnerSlug;
321
+ return R({
317
322
  queryKey: ["pitvox", "competition", a, e, "allRounds", t],
318
323
  queryFn: async () => (await Promise.all(
319
324
  t.map(
320
- (o) => D(s.cdnUrl, `competitions/${a}/${e}/rounds/${o}.json`).catch(() => null)
325
+ (i) => M(s.cdnUrl, `competitions/${a}/${e}/rounds/${i}.json`).catch(() => null)
321
326
  )
322
327
  )).filter(Boolean),
323
328
  enabled: !!a && !!e && t.length > 0,
324
329
  staleTime: 6e4
325
330
  });
326
331
  }
327
- function rn(e, t = {}) {
328
- const r = L(), s = t.partnerSlug || r.partnerSlug;
329
- return $({
332
+ function un(e, t = {}) {
333
+ const r = S(), s = t.partnerSlug || r.partnerSlug;
334
+ return R({
330
335
  queryKey: ["pitvox", "competition", s, e, "leaderboard"],
331
- queryFn: () => D(r.cdnUrl, `competitions/${s}/${e}/leaderboard.json`).catch(() => null),
336
+ queryFn: () => M(r.cdnUrl, `competitions/${s}/${e}/leaderboard.json`).catch(() => null),
332
337
  enabled: !!s && !!e,
333
338
  staleTime: 6e4
334
339
  });
335
340
  }
336
- function sn(e, t, r = {}) {
337
- const s = L(), a = r.partnerSlug || s.partnerSlug;
338
- return $({
341
+ function hn(e, t, r = {}) {
342
+ const s = S(), a = r.partnerSlug || s.partnerSlug;
343
+ return R({
339
344
  queryKey: ["pitvox", "competition", a, e, "round", t, "leaderboard"],
340
- queryFn: () => D(s.cdnUrl, `competitions/${a}/${e}/rounds/${t}/leaderboard.json`).catch(() => null),
345
+ queryFn: () => M(s.cdnUrl, `competitions/${a}/${e}/rounds/${t}/leaderboard.json`).catch(() => null),
341
346
  enabled: !!a && !!e && t != null,
342
347
  staleTime: 6e4
343
348
  });
344
349
  }
345
- function an(e, t, r = {}) {
346
- const s = L(), a = r.partnerSlug || s.partnerSlug;
347
- return $({
350
+ function mn(e, t, r = {}) {
351
+ const s = S(), a = r.partnerSlug || s.partnerSlug;
352
+ return R({
348
353
  queryKey: ["pitvox", "competition", a, e, "round", t, "laps"],
349
- queryFn: () => D(s.cdnUrl, `competitions/${a}/${e}/rounds/${t}/laps.json`).catch(() => null),
354
+ queryFn: () => M(s.cdnUrl, `competitions/${a}/${e}/rounds/${t}/laps.json`).catch(() => null),
350
355
  enabled: !!a && !!e && t != null,
351
356
  staleTime: 6e4
352
357
  });
353
358
  }
354
- function on(e, t, r = {}) {
355
- const s = L(), a = r.partnerSlug || s.partnerSlug;
356
- return $({
359
+ function vn(e, t, r = {}) {
360
+ const s = S(), a = r.partnerSlug || s.partnerSlug;
361
+ return R({
357
362
  queryKey: ["pitvox", "competition", a, e, "round", t, "positions"],
358
- queryFn: () => D(s.cdnUrl, `competitions/${a}/${e}/rounds/${t}/positions.json`).catch(() => null),
363
+ queryFn: () => M(s.cdnUrl, `competitions/${a}/${e}/rounds/${t}/positions.json`).catch(() => null),
359
364
  enabled: (r.enabled ?? !0) && !!a && !!e && t != null,
360
365
  staleTime: 6e4
361
366
  });
362
367
  }
363
- function Re(e, t = {}) {
364
- const r = L(), s = t.partnerSlug || r.partnerSlug;
365
- return $({
368
+ function Ae(e, t = {}) {
369
+ const r = S(), s = t.partnerSlug || r.partnerSlug;
370
+ return R({
366
371
  queryKey: ["pitvox", "competition", s, e, "entrylist"],
367
- queryFn: () => D(r.cdnUrl, `competitions/${s}/${e}/entrylist.json`),
372
+ queryFn: () => M(r.cdnUrl, `competitions/${s}/${e}/entrylist.json`),
368
373
  enabled: !!s && !!e,
369
374
  staleTime: 6e4
370
375
  });
371
376
  }
372
- function le(e) {
373
- const { cdnUrl: t, partnerSlug: r, getSteamId: s } = L(), a = s();
374
- return $({
377
+ function he(e) {
378
+ const { cdnUrl: t, partnerSlug: r, getSteamId: s } = S(), a = s();
379
+ return R({
375
380
  queryKey: ["pitvox", "registration", r, e, a],
376
381
  queryFn: async () => {
377
382
  var p;
378
- const i = await fetch(`${t}/competitions/${r}/${e}/entrylist.json`);
379
- if (!i.ok) return { isRegistered: !1, entryList: null };
380
- const o = await i.json();
381
- return { isRegistered: !!a && ((p = o.drivers) == null ? void 0 : p.some((c) => c.steamId === a)), entryList: o };
383
+ const o = await fetch(`${t}/competitions/${r}/${e}/entrylist.json`);
384
+ if (!o.ok) return { isRegistered: !1, entryList: null };
385
+ const i = await o.json();
386
+ return { isRegistered: !!a && ((p = i.drivers) == null ? void 0 : p.some((c) => c.steamId === a)), entryList: i };
382
387
  },
383
388
  enabled: !!e,
384
389
  staleTime: 6e4
385
390
  });
386
391
  }
387
- function Te(e) {
388
- const { onRegister: t, partnerSlug: r, getSteamId: s } = L(), a = O(), i = Ce();
389
- return Y({
390
- mutationFn: (o) => {
392
+ function Ee(e) {
393
+ const { onRegister: t, partnerSlug: r, getSteamId: s } = S(), a = V(), o = ue();
394
+ return G({
395
+ mutationFn: (i) => {
391
396
  if (!t)
392
397
  throw new Error(
393
398
  "No onRegister callback provided to PitVoxPartnerProvider. Provide onRegister for in-app registration, or use useRegistrationUrl() to link to pitvox.com."
394
399
  );
395
- return t(e, o);
400
+ return t(e, i);
396
401
  },
397
402
  onSuccess: () => {
398
- const o = s();
403
+ const i = s();
399
404
  if (a.setQueriesData(
400
405
  { queryKey: ["pitvox", "registration", r, e] },
401
406
  (d) => d ? { ...d, isRegistered: !0 } : { isRegistered: !0, entryList: null }
402
- ), o) {
403
- const d = i(o), p = {
404
- steamId: o,
407
+ ), i) {
408
+ const d = o(i), p = {
409
+ steamId: i,
405
410
  displayName: d.displayName,
406
411
  avatarUrl: d.avatarUrl
407
412
  };
@@ -409,89 +414,598 @@ function Te(e) {
409
414
  { queryKey: ["pitvox", "competition", r, e, "entrylist"] },
410
415
  (c) => {
411
416
  var v;
412
- return c ? ((v = c.drivers) == null ? void 0 : v.some((f) => f.steamId === o)) ? c : { ...c, drivers: [...c.drivers || [], p] } : { drivers: [p] };
417
+ return c ? ((v = c.drivers) == null ? void 0 : v.some((f) => f.steamId === i)) ? c : { ...c, drivers: [...c.drivers || [], p] } : { drivers: [p] };
413
418
  }
414
419
  );
415
420
  }
416
421
  }
417
422
  });
418
423
  }
419
- function $e(e) {
420
- const { onWithdraw: t, partnerSlug: r, getSteamId: s } = L(), a = O();
421
- return Y({
422
- mutationFn: (i) => {
424
+ function Be(e) {
425
+ const { onWithdraw: t, partnerSlug: r, getSteamId: s } = S(), a = V();
426
+ return G({
427
+ mutationFn: (o) => {
423
428
  if (!t)
424
429
  throw new Error(
425
430
  "No onWithdraw callback provided to PitVoxPartnerProvider. Provide onWithdraw for in-app withdrawal, or use useRegistrationUrl() to link to pitvox.com."
426
431
  );
427
- const o = i || s();
428
- if (!o) throw new Error("No Steam ID available");
429
- return t(e, o);
432
+ const i = o || s();
433
+ if (!i) throw new Error("No Steam ID available");
434
+ return t(e, i);
430
435
  },
431
436
  onSuccess: () => {
432
- const i = s();
437
+ const o = s();
433
438
  a.setQueriesData(
434
439
  { queryKey: ["pitvox", "registration", r, e] },
435
- (o) => o ? { ...o, isRegistered: !1 } : { isRegistered: !1, entryList: null }
436
- ), i && a.setQueriesData(
440
+ (i) => i ? { ...i, isRegistered: !1 } : { isRegistered: !1, entryList: null }
441
+ ), o && a.setQueriesData(
437
442
  { queryKey: ["pitvox", "competition", r, e, "entrylist"] },
438
- (o) => o != null && o.drivers ? { ...o, drivers: o.drivers.filter((d) => d.steamId !== i) } : o
443
+ (i) => i != null && i.drivers ? { ...i, drivers: i.drivers.filter((d) => d.steamId !== o) } : i
439
444
  );
440
445
  }
441
446
  });
442
447
  }
443
- function ce() {
444
- const { onRegister: e, onWithdraw: t } = L(), r = !!(e && t);
448
+ function me() {
449
+ const { onRegister: e, onWithdraw: t } = S(), r = !!(e && t);
445
450
  return { isPowerMode: r, isBasicMode: !r };
446
451
  }
447
- function de(e) {
448
- const { pitvoxUrl: t, partnerSlug: r } = L();
452
+ function ve(e) {
453
+ const { pitvoxUrl: t, partnerSlug: r } = S();
449
454
  return `${t}/p/${r}/competitions/${e}/register`;
450
455
  }
451
- function ln(e, t) {
456
+ function J(e, t = /* @__PURE__ */ new Date()) {
457
+ var r;
458
+ return e.winnersAnnouncedAt || (r = e.winners) != null && r.length ? "winners" : e.opensAt && t < new Date(e.opensAt) ? "upcoming" : e.closesAt && t >= new Date(e.closesAt) ? "closed" : "open";
459
+ }
460
+ const xn = {
461
+ upcoming: "Opens soon",
462
+ open: "Open",
463
+ closed: "Closed",
464
+ winners: "Winners announced"
465
+ };
466
+ function gn() {
467
+ const { cdnUrl: e, partnerSlug: t } = S();
468
+ return R({
469
+ queryKey: ["pitvox", "promotions", t],
470
+ queryFn: async () => {
471
+ const r = await M(e, "promotions/index.json");
472
+ return r != null && r.promotions ? t ? r.promotions.filter((s) => s.partnerSlug === t) : r.promotions : [];
473
+ },
474
+ staleTime: 6e4
475
+ });
476
+ }
477
+ function fn(e, t = {}) {
478
+ const r = S(), s = t.partnerSlug || r.partnerSlug;
479
+ return R({
480
+ queryKey: ["pitvox", "promotion", s, e, "config"],
481
+ queryFn: () => M(r.cdnUrl, `promotions/${s}/${e}/config.json`),
482
+ enabled: !!s && !!e,
483
+ staleTime: 6e4
484
+ });
485
+ }
486
+ function Nn(e, t = {}) {
487
+ const r = S(), s = t.partnerSlug || r.partnerSlug;
488
+ return R({
489
+ queryKey: ["pitvox", "promotion", s, e, "entrylist"],
490
+ queryFn: () => M(r.cdnUrl, `promotions/${s}/${e}/entrylist.json`),
491
+ enabled: !!s && !!e,
492
+ staleTime: 6e4
493
+ });
494
+ }
495
+ function yn(e) {
496
+ const { cdnUrl: t, partnerSlug: r, getSteamId: s } = S(), a = s();
497
+ return R({
498
+ queryKey: ["pitvox", "promotionEntry", r, e, a],
499
+ queryFn: async () => {
500
+ var d;
501
+ const o = await M(t, `promotions/${r}/${e}/entrylist.json`);
502
+ return o ? { isEntered: !!a && ((d = o.entrants) == null ? void 0 : d.some((p) => p.steamId === a)), entryList: o } : { isEntered: !1, entryList: null };
503
+ },
504
+ enabled: !!e,
505
+ staleTime: 6e4
506
+ });
507
+ }
508
+ function bn(e) {
509
+ const { onEnterPromotion: t, partnerSlug: r, getSteamId: s } = S(), a = V(), o = ue();
510
+ return G({
511
+ mutationFn: (i) => {
512
+ if (!t)
513
+ throw new Error(
514
+ "No onEnterPromotion callback provided to PitVoxPartnerProvider. Provide onEnterPromotion for in-app entry, or use usePromotionUrl() to link to pitvox.com."
515
+ );
516
+ return t(e, i);
517
+ },
518
+ onSuccess: () => {
519
+ const i = s();
520
+ if (a.setQueriesData(
521
+ { queryKey: ["pitvox", "promotionEntry", r, e] },
522
+ (d) => d ? { ...d, isEntered: !0 } : { isEntered: !0, entryList: null }
523
+ ), i) {
524
+ const d = o(i), p = {
525
+ steamId: i,
526
+ displayName: d.displayName,
527
+ avatarUrl: d.avatarUrl
528
+ };
529
+ a.setQueriesData(
530
+ { queryKey: ["pitvox", "promotion", r, e, "entrylist"] },
531
+ (c) => {
532
+ var f;
533
+ if (!c) return { entrants: [p], count: 1 };
534
+ if ((f = c.entrants) == null ? void 0 : f.some((h) => h.steamId === i)) return c;
535
+ const v = [...c.entrants || [], p];
536
+ return { ...c, entrants: v, count: v.length };
537
+ }
538
+ );
539
+ }
540
+ }
541
+ });
542
+ }
543
+ function wn(e) {
544
+ const { onWithdrawPromotionEntry: t, partnerSlug: r, getSteamId: s } = S(), a = V();
545
+ return G({
546
+ mutationFn: (o) => {
547
+ if (!t)
548
+ throw new Error(
549
+ "No onWithdrawPromotionEntry callback provided to PitVoxPartnerProvider. Provide onWithdrawPromotionEntry for in-app withdrawal, or use usePromotionUrl() to link to pitvox.com."
550
+ );
551
+ const i = o || s();
552
+ if (!i) throw new Error("No Steam ID available");
553
+ return t(e, i);
554
+ },
555
+ onSuccess: () => {
556
+ const o = s();
557
+ a.setQueriesData(
558
+ { queryKey: ["pitvox", "promotionEntry", r, e] },
559
+ (i) => i ? { ...i, isEntered: !1 } : { isEntered: !1, entryList: null }
560
+ ), o && a.setQueriesData(
561
+ { queryKey: ["pitvox", "promotion", r, e, "entrylist"] },
562
+ (i) => {
563
+ if (!(i != null && i.entrants)) return i;
564
+ const d = i.entrants.filter((p) => p.steamId !== o);
565
+ return { ...i, entrants: d, count: d.length };
566
+ }
567
+ );
568
+ }
569
+ });
570
+ }
571
+ function kn() {
572
+ const { onEnterPromotion: e, onWithdrawPromotionEntry: t } = S(), r = !!(e && t);
573
+ return { isPowerMode: r, isBasicMode: !r };
574
+ }
575
+ function Cn(e) {
576
+ const { pitvoxUrl: t, partnerSlug: r } = S();
577
+ return `${t}/p/${r}/promotions/${e}`;
578
+ }
579
+ const Sn = {
580
+ GBR: "🇬🇧",
581
+ DEU: "🇩🇪",
582
+ NLD: "🇳🇱",
583
+ SWE: "🇸🇪",
584
+ ESP: "🇪🇸",
585
+ ZAF: "🇿🇦",
586
+ FRA: "🇫🇷",
587
+ ITA: "🇮🇹",
588
+ USA: "🇺🇸",
589
+ AUS: "🇦🇺",
590
+ BRA: "🇧🇷",
591
+ JPN: "🇯🇵",
592
+ CAN: "🇨🇦",
593
+ POL: "🇵🇱",
594
+ AUT: "🇦🇹",
595
+ BEL: "🇧🇪",
596
+ PRT: "🇵🇹",
597
+ NOR: "🇳🇴",
598
+ DNK: "🇩🇰",
599
+ FIN: "🇫🇮",
600
+ IRL: "🇮🇪",
601
+ CHE: "🇨🇭",
602
+ NZL: "🇳🇿",
603
+ MEX: "🇲🇽",
604
+ ARG: "🇦🇷",
605
+ CZE: "🇨🇿",
606
+ HUN: "🇭🇺",
607
+ RUS: "🇷🇺",
608
+ TUR: "🇹🇷",
609
+ KOR: "🇰🇷"
610
+ }, xe = ["🥇", "🥈", "🥉"], Ln = {
611
+ championship: "Championship",
612
+ series: "Series",
613
+ event: "Event",
614
+ hotlap: "Hotlap"
615
+ }, $n = ["PRACTICE", "QUALIFYING", "RACE"];
616
+ function we(e) {
617
+ const t = $n.indexOf(e);
618
+ if (t >= 0) return t;
619
+ const r = e.match(/^PRACTICE_(\d+)$/);
620
+ return r ? 100 + parseInt(r[1]) : 999;
621
+ }
622
+ function X(e) {
623
+ const t = e.match(/^PRACTICE_(\d+)$/);
624
+ return t ? `P${t[1]}` : e;
625
+ }
626
+ function ge({ position: e }) {
627
+ return /* @__PURE__ */ n("span", { className: e === 1 ? "pvx-rank pvx-rank--gold" : e === 2 ? "pvx-rank pvx-rank--silver" : e === 3 ? "pvx-rank pvx-rank--bronze" : "pvx-rank", children: e });
628
+ }
629
+ function ee({ nation: e }) {
630
+ const t = e && Sn[e];
631
+ return t ? /* @__PURE__ */ n("span", { className: "pvx-nation-flag", title: e, children: t }) : null;
632
+ }
633
+ function Tn({ sessions: e, activeSession: t, onSelect: r }) {
634
+ if (!e || e.length <= 1) return null;
635
+ const s = [...e].sort(
636
+ (a, o) => we(a.type) - we(o.type)
637
+ );
638
+ return /* @__PURE__ */ n("div", { className: "pvx-session-tabs", children: s.map((a) => /* @__PURE__ */ n(
639
+ "button",
640
+ {
641
+ onClick: () => r(a.type),
642
+ className: `pvx-session-tab ${t === a.type ? "pvx-session-tab--active" : ""}`,
643
+ children: X(a.type)
644
+ },
645
+ a.type
646
+ )) });
647
+ }
648
+ function Rn({ type: e }) {
649
+ return /* @__PURE__ */ n("span", { className: `pvx-comp-badge pvx-comp-badge--${e}`, children: Ln[e] || e });
650
+ }
651
+ function ae({ children: e, variant: t = "default" }) {
652
+ return /* @__PURE__ */ n("span", { className: `pvx-info-pill ${t !== "default" ? `pvx-info-pill--${t}` : ""}`, children: e });
653
+ }
654
+ function Mn(e) {
655
+ if (!e) return "TBD";
656
+ const t = new Date(e);
657
+ if (isNaN(t)) return "TBD";
658
+ const r = t.toLocaleDateString("en-GB", { weekday: "short", day: "numeric", month: "short" }), s = t.toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit" });
659
+ return `${r} • ${s}`;
660
+ }
661
+ function Pn(e) {
662
+ return e.reduce((t, r) => {
663
+ var s;
664
+ return (s = r.splits) != null && s.length ? t ? t.map((a, o) => {
665
+ const i = r.splits[o];
666
+ return i && i < a ? i : a;
667
+ }) : [...r.splits] : t;
668
+ }, null);
669
+ }
670
+ function W({ message: e = "Loading..." }) {
671
+ return /* @__PURE__ */ n("div", { className: "pvx-loading", children: e });
672
+ }
673
+ function _({ message: e = "No data available." }) {
674
+ return /* @__PURE__ */ n("div", { className: "pvx-empty", children: /* @__PURE__ */ n("p", { children: e }) });
675
+ }
676
+ const Ue = 3;
677
+ function O(e) {
678
+ if (!e) return !1;
679
+ if (e.closesAt) {
680
+ const t = new Date(e.closesAt).getTime();
681
+ if (!Number.isNaN(t)) return Date.now() >= t;
682
+ }
683
+ return !!e.isClosed;
684
+ }
685
+ function Dn(e) {
686
+ const t = e == null ? void 0 : e.rounds;
687
+ return t != null && t.length ? e.type === "hotlap" ? t.every((r) => O(r)) : t.every((r) => r.isFinalized) : !1;
688
+ }
689
+ function An(e) {
690
+ const t = e == null ? void 0 : e.rounds;
691
+ if (!(t != null && t.length)) return null;
692
+ let r = null;
693
+ for (const s of t) {
694
+ if (!s.startTime) continue;
695
+ const a = new Date(s.startTime);
696
+ isNaN(a) || (!r || a > r) && (r = a);
697
+ }
698
+ return r;
699
+ }
700
+ function _e(e, t = Ue) {
701
+ if (!Dn(e)) return "active";
702
+ const r = An(e);
703
+ if (!r) return "recently-completed";
704
+ const s = t * 24 * 60 * 60 * 1e3;
705
+ return Date.now() - r.getTime() <= s ? "recently-completed" : "archived";
706
+ }
707
+ function rr(e, t, r = Ue) {
708
+ if (!(e != null && e.length)) return [];
709
+ const s = new Set(Array.isArray(t) ? t : [t]);
710
+ return e.filter((a) => s.has(_e(a, r)));
711
+ }
712
+ function En(e, t = 3) {
713
+ const r = e == null ? void 0 : e.standings;
714
+ return Array.isArray(r) ? [...r].sort((s, a) => (s.position ?? 999) - (a.position ?? 999)).slice(0, t) : [];
715
+ }
716
+ const Bn = {
717
+ giveaway: "Giveaway"
718
+ };
719
+ function Ie({ promotion: e, status: t }) {
720
+ const r = t || J(e);
721
+ return /* @__PURE__ */ n("span", { className: `pvx-promo-status pvx-promo-status--${r}`, children: xn[r] || r });
722
+ }
723
+ function Fe({ type: e }) {
724
+ return /* @__PURE__ */ n("span", { className: `pvx-promo-type pvx-promo-type--${e || "giveaway"}`, children: Bn[e] || e });
725
+ }
726
+ function K(e) {
727
+ if (!e) return "";
728
+ const t = new Date(e);
729
+ if (isNaN(t)) return "";
730
+ const r = t.toLocaleDateString(void 0, { weekday: "short", day: "numeric", month: "short" }), s = t.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit" });
731
+ return `${r} ${s}`;
732
+ }
733
+ function Un(e, t) {
734
+ const r = t || J(e);
735
+ return r === "upcoming" ? `Entries open ${K(e.opensAt)}` : r === "open" && e.closesAt ? `Entries close ${K(e.closesAt)}` : r === "open" ? "Entries open now" : r === "closed" ? `Entries closed ${K(e.closesAt)}` : null;
736
+ }
737
+ function le({ className: e }) {
738
+ return /* @__PURE__ */ l(
739
+ "svg",
740
+ {
741
+ className: e,
742
+ xmlns: "http://www.w3.org/2000/svg",
743
+ viewBox: "0 0 24 24",
744
+ fill: "none",
745
+ stroke: "currentColor",
746
+ strokeWidth: "2",
747
+ strokeLinecap: "round",
748
+ strokeLinejoin: "round",
749
+ children: [
750
+ /* @__PURE__ */ n("rect", { x: "3", y: "8", width: "18", height: "4", rx: "1" }),
751
+ /* @__PURE__ */ n("path", { d: "M12 8v13" }),
752
+ /* @__PURE__ */ n("path", { d: "M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7" }),
753
+ /* @__PURE__ */ n("path", { d: "M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5" })
754
+ ]
755
+ }
756
+ );
757
+ }
758
+ function _n({ promotions: e, isLoading: t, onSelect: r, className: s }) {
759
+ if (t)
760
+ return /* @__PURE__ */ n(W, { message: "Loading promotions..." });
761
+ if (!(e != null && e.length))
762
+ return /* @__PURE__ */ n(_, { message: "No promotions running right now." });
763
+ const a = e.length === 1 ? "pvx-promo-grid--single" : e.length === 2 ? "pvx-promo-grid--pair" : "";
764
+ return /* @__PURE__ */ n("div", { className: `pvx-promo-grid ${a} ${s || ""}`, children: e.map((o) => /* @__PURE__ */ n(In, { promo: o, onSelect: r }, o.id)) });
765
+ }
766
+ function In({ promo: e, onSelect: t }) {
767
+ const { cdnUrl: r } = S(), s = e.posterCdnPath ? `${r}/${e.posterCdnPath}` : null, a = J(e), o = Un(e, a);
768
+ return /* @__PURE__ */ l(
769
+ "div",
770
+ {
771
+ className: "pvx-promo-card",
772
+ role: "button",
773
+ tabIndex: 0,
774
+ onClick: () => t == null ? void 0 : t(e.id),
775
+ onKeyDown: (i) => {
776
+ (i.key === "Enter" || i.key === " ") && (i.preventDefault(), t == null || t(e.id));
777
+ },
778
+ children: [
779
+ /* @__PURE__ */ n("div", { className: "pvx-promo-card-poster", children: s ? /* @__PURE__ */ n("img", { src: s, alt: e.title, className: "pvx-promo-card-poster-img" }) : /* @__PURE__ */ n("div", { className: "pvx-promo-card-poster-placeholder", children: /* @__PURE__ */ n(le, { className: "pvx-promo-gift-icon" }) }) }),
780
+ /* @__PURE__ */ l("div", { className: "pvx-promo-card-body", children: [
781
+ /* @__PURE__ */ l("div", { className: "pvx-promo-card-badges", children: [
782
+ /* @__PURE__ */ n(Ie, { promotion: e, status: a }),
783
+ /* @__PURE__ */ n(Fe, { type: e.type }),
784
+ e.game && /* @__PURE__ */ n("span", { className: "pvx-promo-game", children: e.game })
785
+ ] }),
786
+ /* @__PURE__ */ n("h3", { className: "pvx-promo-card-title", children: e.title }),
787
+ e.prizeDescription && /* @__PURE__ */ n("p", { className: "pvx-promo-card-prize", children: e.prizeDescription }),
788
+ /* @__PURE__ */ l("div", { className: "pvx-promo-card-meta", children: [
789
+ o && /* @__PURE__ */ n("span", { children: o }),
790
+ /* @__PURE__ */ l("span", { children: [
791
+ e.entryCount,
792
+ " ",
793
+ e.entryCount === 1 ? "entry" : "entries",
794
+ e.maxEntrants ? ` / ${e.maxEntrants}` : ""
795
+ ] })
796
+ ] })
797
+ ] })
798
+ ]
799
+ }
800
+ );
801
+ }
802
+ function Fn({
803
+ promotionId: e,
804
+ driverData: t,
805
+ className: r,
806
+ children: s
807
+ }) {
808
+ const { data: a, isLoading: o } = yn(e), { isPowerMode: i } = kn(), d = Cn(e), p = bn(e), c = wn(e), u = (a == null ? void 0 : a.isEntered) || !1, v = o || p.isPending || c.isPending, f = p.error || c.error || null, h = () => {
809
+ i && p.mutate(t || {});
810
+ }, y = () => {
811
+ i && c.mutate();
812
+ };
813
+ return typeof s == "function" ? s({ isEntered: u, isLoading: v, enter: h, withdraw: y, error: f, isPowerMode: i, promotionUrl: d }) : i ? /* @__PURE__ */ n(
814
+ "button",
815
+ {
816
+ className: `pvx-promo-enter-btn ${r || ""}`,
817
+ onClick: u ? y : h,
818
+ disabled: v,
819
+ children: v ? "Loading..." : u ? "Withdraw Entry" : "Enter Giveaway"
820
+ }
821
+ ) : /* @__PURE__ */ n(
822
+ "a",
823
+ {
824
+ href: d,
825
+ target: "_blank",
826
+ rel: "noopener noreferrer",
827
+ className: `pvx-promo-enter-link ${r || ""}`,
828
+ children: u ? "View Entry" : "Enter on PitVox"
829
+ }
830
+ );
831
+ }
832
+ function qn({ promotionId: e, driverData: t, onBack: r, className: s }) {
833
+ const { cdnUrl: a, getSteamId: o } = S(), { data: i, isLoading: d } = fn(e), { data: p } = Nn(e);
834
+ if (d)
835
+ return /* @__PURE__ */ n(W, { message: "Loading promotion..." });
836
+ if (!i)
837
+ return /* @__PURE__ */ n(_, { message: "Promotion not found." });
838
+ const c = J(i), u = i.winners || [], v = (p == null ? void 0 : p.entrants) || [], f = v.length || i.entryCount || 0, h = i.maxEntrants && f >= i.maxEntrants, y = i.posterCdnPath ? `${a}/${i.posterCdnPath}` : null, x = o();
839
+ return /* @__PURE__ */ l("div", { className: `pvx-promo-detail ${s || ""}`, children: [
840
+ r && /* @__PURE__ */ n("button", { type: "button", className: "pvx-promo-back", onClick: r, children: "← All promotions" }),
841
+ y && /* @__PURE__ */ n("div", { className: "pvx-promo-detail-poster", children: /* @__PURE__ */ n("img", { src: y, alt: i.title }) }),
842
+ /* @__PURE__ */ l("div", { className: "pvx-promo-detail-header", children: [
843
+ /* @__PURE__ */ l("div", { className: "pvx-promo-card-badges", children: [
844
+ /* @__PURE__ */ n(Ie, { promotion: i, status: c }),
845
+ /* @__PURE__ */ n(Fe, { type: i.type }),
846
+ i.game && /* @__PURE__ */ n("span", { className: "pvx-promo-game", children: i.game })
847
+ ] }),
848
+ /* @__PURE__ */ n("h2", { className: "pvx-promo-detail-title", children: i.title }),
849
+ i.prizeDescription && /* @__PURE__ */ n("p", { className: "pvx-promo-detail-prize", children: i.prizeDescription }),
850
+ /* @__PURE__ */ l("div", { className: "pvx-promo-detail-meta", children: [
851
+ i.opensAt && c === "upcoming" && /* @__PURE__ */ l("span", { children: [
852
+ "Opens ",
853
+ K(i.opensAt)
854
+ ] }),
855
+ i.closesAt && /* @__PURE__ */ l("span", { children: [
856
+ c === "open" || c === "upcoming" ? "Closes" : "Closed",
857
+ " ",
858
+ K(i.closesAt)
859
+ ] }),
860
+ /* @__PURE__ */ l("span", { children: [
861
+ f,
862
+ " ",
863
+ f === 1 ? "entry" : "entries",
864
+ i.maxEntrants ? ` / ${i.maxEntrants}` : ""
865
+ ] })
866
+ ] })
867
+ ] }),
868
+ u.length > 0 && /* @__PURE__ */ l("div", { className: "pvx-promo-winners", children: [
869
+ /* @__PURE__ */ n("h3", { className: "pvx-promo-section-title", children: u.length === 1 ? "Winner" : "Winners" }),
870
+ /* @__PURE__ */ n("div", { className: "pvx-promo-winners-list", children: u.map((m) => /* @__PURE__ */ l("div", { className: "pvx-promo-winner", children: [
871
+ m.avatarUrl ? /* @__PURE__ */ n("img", { src: m.avatarUrl, alt: "", className: "pvx-promo-avatar pvx-promo-avatar--lg" }) : /* @__PURE__ */ n("div", { className: "pvx-promo-avatar pvx-promo-avatar--lg pvx-promo-avatar--placeholder", children: /* @__PURE__ */ n(le, { className: "pvx-promo-avatar-glyph" }) }),
872
+ /* @__PURE__ */ n("span", { className: "pvx-promo-winner-name", children: m.displayName })
873
+ ] }, m.steamId)) })
874
+ ] }),
875
+ /* @__PURE__ */ l("div", { className: "pvx-promo-action", children: [
876
+ c === "upcoming" && /* @__PURE__ */ l("p", { className: "pvx-promo-action-note", children: [
877
+ "Entries aren't open yet — come back ",
878
+ i.opensAt ? K(i.opensAt) : "soon",
879
+ "."
880
+ ] }),
881
+ (c === "closed" || c === "winners") && /* @__PURE__ */ l("p", { className: "pvx-promo-action-note", children: [
882
+ "Entries have closed.",
883
+ c === "closed" && " Winners will be announced here once the draw is done."
884
+ ] }),
885
+ c === "open" && !x && /* @__PURE__ */ n("p", { className: "pvx-promo-action-note", children: "Sign in with Steam to enter this giveaway." }),
886
+ c === "open" && x && /* @__PURE__ */ n(Fn, { promotionId: e, driverData: t, children: ({ isEntered: m, isLoading: b, enter: g, withdraw: k, error: C, isPowerMode: P, promotionUrl: A }) => /* @__PURE__ */ l("div", { className: "pvx-promo-action-row", children: [
887
+ /* @__PURE__ */ l("div", { className: "pvx-promo-action-text", children: [
888
+ C && /* @__PURE__ */ n("p", { className: "pvx-promo-error", children: C.message }),
889
+ /* @__PURE__ */ n("p", { className: "pvx-promo-action-note", children: m ? "✓ You're in the draw." : h ? "This giveaway is full." : "One click and you're in the draw." }),
890
+ !m && !h && /* @__PURE__ */ n("p", { className: "pvx-promo-disclosure", children: "Entering displays your Steam name and avatar publicly; winners are announced by name." })
891
+ ] }),
892
+ P ? /* @__PURE__ */ n(
893
+ "button",
894
+ {
895
+ type: "button",
896
+ className: m ? "pvx-promo-withdraw-btn" : "pvx-promo-enter-btn",
897
+ onClick: m ? k : g,
898
+ disabled: b || !m && h,
899
+ children: b ? "Loading..." : m ? "Withdraw Entry" : "Enter Giveaway"
900
+ }
901
+ ) : /* @__PURE__ */ n(
902
+ "a",
903
+ {
904
+ href: A,
905
+ target: "_blank",
906
+ rel: "noopener noreferrer",
907
+ className: "pvx-promo-enter-link",
908
+ children: m ? "View Entry" : "Enter on PitVox"
909
+ }
910
+ )
911
+ ] }) })
912
+ ] }),
913
+ i.description && /* @__PURE__ */ n("div", { className: "pvx-promo-description", children: /* @__PURE__ */ n(en, { children: i.description }) }),
914
+ v.length > 0 && /* @__PURE__ */ l("div", { className: "pvx-promo-entrants", children: [
915
+ /* @__PURE__ */ l("h3", { className: "pvx-promo-section-title", children: [
916
+ "Entrants ",
917
+ /* @__PURE__ */ l("span", { className: "pvx-promo-section-count", children: [
918
+ "(",
919
+ v.length,
920
+ ")"
921
+ ] })
922
+ ] }),
923
+ /* @__PURE__ */ n("div", { className: "pvx-promo-entrants-grid", children: v.map((m) => /* @__PURE__ */ l("div", { className: "pvx-promo-entrant", children: [
924
+ m.avatarUrl ? /* @__PURE__ */ n("img", { src: m.avatarUrl, alt: "", className: "pvx-promo-avatar" }) : /* @__PURE__ */ n("div", { className: "pvx-promo-avatar pvx-promo-avatar--placeholder", children: /* @__PURE__ */ n(le, { className: "pvx-promo-avatar-glyph" }) }),
925
+ /* @__PURE__ */ n("span", { className: "pvx-promo-entrant-name", title: m.displayName, children: m.displayName })
926
+ ] }, m.steamId)) })
927
+ ] })
928
+ ] });
929
+ }
930
+ const ce = "promotion";
931
+ function ke() {
932
+ return typeof window > "u" ? null : new URLSearchParams(window.location.search).get(ce);
933
+ }
934
+ function sr({ title: e = "Promotions", driverData: t, className: r }) {
935
+ const { data: s = [], isLoading: a } = gn(), [o, i] = E(ke);
936
+ $e(() => {
937
+ const p = () => i(ke());
938
+ return window.addEventListener("popstate", p), () => window.removeEventListener("popstate", p);
939
+ }, []);
940
+ const d = H((p) => {
941
+ if (i(p), typeof window < "u") {
942
+ const c = new URL(window.location.href);
943
+ p ? c.searchParams.set(ce, p) : c.searchParams.delete(ce), window.history.pushState({}, "", c);
944
+ }
945
+ }, []);
946
+ return /* @__PURE__ */ l("div", { className: `pvx-promo-explorer ${r || ""}`, children: [
947
+ e && /* @__PURE__ */ n("h1", { className: "pvx-promo-explorer-title", children: e }),
948
+ o ? /* @__PURE__ */ n(
949
+ qn,
950
+ {
951
+ promotionId: o,
952
+ driverData: t,
953
+ onBack: () => d(null)
954
+ }
955
+ ) : /* @__PURE__ */ n(
956
+ _n,
957
+ {
958
+ promotions: s,
959
+ isLoading: a,
960
+ onSelect: d
961
+ }
962
+ )
963
+ ] });
964
+ }
965
+ function Wn(e, t) {
452
966
  for (const r of t)
453
967
  if (r.tags.includes(e)) return r.id;
454
968
  return "other";
455
969
  }
456
- function Me(e, t, r = []) {
970
+ function qe(e, t, r = []) {
457
971
  if (t.size === 0) return !0;
458
972
  const s = {};
459
973
  for (const a of t) {
460
- const i = ln(a, r);
461
- s[i] || (s[i] = []), s[i].push(a);
974
+ const o = Wn(a, r);
975
+ s[o] || (s[o] = []), s[o].push(a);
462
976
  }
463
977
  for (const a of Object.values(s))
464
- if (!a.some((i) => e.includes(i))) return !1;
978
+ if (!a.some((o) => e.includes(o))) return !1;
465
979
  return !0;
466
980
  }
467
- function De(e, t) {
468
- const [r, s] = E(/* @__PURE__ */ new Set()), a = e !== void 0, i = a ? e : r, o = K((p) => {
469
- const c = new Set(i);
981
+ function We(e, t) {
982
+ const [r, s] = E(/* @__PURE__ */ new Set()), a = e !== void 0, o = a ? e : r, i = H((p) => {
983
+ const c = new Set(o);
470
984
  c.has(p) ? c.delete(p) : c.add(p), a && t ? t(c) : s(c);
471
- }, [i, a, t]), d = K(() => {
985
+ }, [o, a, t]), d = H(() => {
472
986
  a && t ? t(/* @__PURE__ */ new Set()) : s(/* @__PURE__ */ new Set());
473
987
  }, [a, t]);
474
- return { activeTags: i, toggle: o, clear: d };
988
+ return { activeTags: o, toggle: i, clear: d };
475
989
  }
476
- function Z(e) {
477
- const [t, r] = E(e), s = K((a) => {
990
+ function ne(e) {
991
+ const [t, r] = E(e), s = H((a) => {
478
992
  r(
479
- (i) => i.key === a ? { key: a, dir: i.dir === "asc" ? "desc" : "asc" } : { key: a, dir: a.includes("timestamp") || a.includes("Date") ? "desc" : "asc" }
993
+ (o) => o.key === a ? { key: a, dir: o.dir === "asc" ? "desc" : "asc" } : { key: a, dir: a.includes("timestamp") || a.includes("Date") ? "desc" : "asc" }
480
994
  );
481
995
  }, []);
482
996
  return [t, s];
483
997
  }
484
- function J(e, t, r) {
998
+ function te(e, t, r) {
485
999
  return [...e].sort((s, a) => {
486
- const i = r(s, t.key), o = r(a, t.key);
487
- if (i == null && o == null) return 0;
488
- if (i == null) return 1;
489
- if (o == null) return -1;
490
- const d = typeof i == "string" ? i.localeCompare(o) : i - o;
1000
+ const o = r(s, t.key), i = r(a, t.key);
1001
+ if (o == null && i == null) return 0;
1002
+ if (o == null) return 1;
1003
+ if (i == null) return -1;
1004
+ const d = typeof o == "string" ? o.localeCompare(i) : o - i;
491
1005
  return t.dir === "desc" ? -d : d;
492
1006
  });
493
1007
  }
494
- function Ae(e, t = !1) {
1008
+ function je(e, t = !1) {
495
1009
  const r = t ? e == null ? void 0 : e.filter((s) => s.isValid) : e;
496
1010
  return r != null && r.length ? {
497
1011
  s1: Math.min(...r.map((s) => s.sector1Ms).filter(Boolean)),
@@ -499,10 +1013,10 @@ function Ae(e, t = !1) {
499
1013
  s3: Math.min(...r.map((s) => s.sector3Ms).filter(Boolean))
500
1014
  } : null;
501
1015
  }
502
- function cn({ active: e, dir: t }) {
1016
+ function jn({ active: e, dir: t }) {
503
1017
  return e ? t === "asc" ? /* @__PURE__ */ n("svg", { className: "pvx-sort-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 15.75l7.5-7.5 7.5 7.5" }) }) : /* @__PURE__ */ n("svg", { className: "pvx-sort-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" }) }) : /* @__PURE__ */ n("svg", { className: "pvx-sort-icon pvx-sort-icon--inactive", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 9l4-4 4 4M16 15l-4 4-4-4" }) });
504
1018
  }
505
- function I({ label: e, sortKey: t, config: r, onSort: s, className: a = "" }) {
1019
+ function U({ label: e, sortKey: t, config: r, onSort: s, className: a = "" }) {
506
1020
  return /* @__PURE__ */ n(
507
1021
  "th",
508
1022
  {
@@ -510,24 +1024,24 @@ function I({ label: e, sortKey: t, config: r, onSort: s, className: a = "" }) {
510
1024
  onClick: () => s(t),
511
1025
  children: /* @__PURE__ */ l("span", { className: "pvx-th-inner", children: [
512
1026
  e,
513
- /* @__PURE__ */ n(cn, { active: r.key === t, dir: r.dir })
1027
+ /* @__PURE__ */ n(jn, { active: r.key === t, dir: r.dir })
514
1028
  ] })
515
1029
  }
516
1030
  );
517
1031
  }
518
- function X({ userId: e, getUserDisplay: t }) {
1032
+ function re({ userId: e, getUserDisplay: t }) {
519
1033
  const { displayName: r, avatarUrl: s } = t(e);
520
1034
  return /* @__PURE__ */ l("span", { className: "pvx-driver", children: [
521
1035
  s ? /* @__PURE__ */ n("img", { src: s, alt: "", className: "pvx-driver-avatar" }) : /* @__PURE__ */ n("span", { className: "pvx-driver-avatar pvx-driver-avatar--placeholder" }),
522
1036
  /* @__PURE__ */ n("span", { className: "pvx-driver-name", children: r })
523
1037
  ] });
524
1038
  }
525
- function pe({ rank: e, podium: t = !1 }) {
1039
+ function fe({ rank: e, podium: t = !1 }) {
526
1040
  return /* @__PURE__ */ n("span", { className: t ? e === 1 ? "pvx-rank pvx-rank--gold" : e === 2 ? "pvx-rank pvx-rank--silver" : e === 3 ? "pvx-rank pvx-rank--bronze" : "pvx-rank" : "pvx-rank", children: e });
527
1041
  }
528
- function Pe({ availableTags: e, activeTags: t, onToggle: r, onClear: s, categories: a = [], tagLabels: i = {} }) {
1042
+ function Ve({ availableTags: e, activeTags: t, onToggle: r, onClear: s, categories: a = [], tagLabels: o = {} }) {
529
1043
  if (!e || e.length < 2) return null;
530
- const o = a.map((d) => ({ id: d.id, tags: d.tags.filter((p) => e.includes(p)) })).filter((d) => d.tags.length > 0);
1044
+ const i = a.map((d) => ({ id: d.id, tags: d.tags.filter((p) => e.includes(p)) })).filter((d) => d.tags.length > 0);
531
1045
  return /* @__PURE__ */ l("div", { className: "pvx-tag-bar", children: [
532
1046
  /* @__PURE__ */ n(
533
1047
  "button",
@@ -537,21 +1051,21 @@ function Pe({ availableTags: e, activeTags: t, onToggle: r, onClear: s, categori
537
1051
  children: "All"
538
1052
  }
539
1053
  ),
540
- o.map((d, p) => /* @__PURE__ */ l("span", { className: "contents", children: [
1054
+ i.map((d, p) => /* @__PURE__ */ l("span", { className: "contents", children: [
541
1055
  p > 0 && /* @__PURE__ */ n("span", { className: "pvx-tag-separator" }),
542
1056
  d.tags.map((c) => /* @__PURE__ */ n(
543
1057
  "button",
544
1058
  {
545
1059
  onClick: () => r(c),
546
1060
  className: `pvx-tag ${t.has(c) ? "pvx-tag--active" : ""}`,
547
- children: i[c] || c
1061
+ children: o[c] || c
548
1062
  },
549
1063
  c
550
1064
  ))
551
1065
  ] }, d.id))
552
1066
  ] });
553
1067
  }
554
- function ue({ segments: e }) {
1068
+ function Ne({ segments: e }) {
555
1069
  return /* @__PURE__ */ n("nav", { className: "pvx-breadcrumb", "aria-label": "Breadcrumb", children: /* @__PURE__ */ n("ol", { className: "pvx-breadcrumb-list", children: e.map((t, r) => {
556
1070
  const s = r === e.length - 1;
557
1071
  return /* @__PURE__ */ l("li", { className: "pvx-breadcrumb-item", children: [
@@ -560,70 +1074,70 @@ function ue({ segments: e }) {
560
1074
  ] }, t.key);
561
1075
  }) }) });
562
1076
  }
563
- function z({ message: e }) {
1077
+ function Y({ message: e }) {
564
1078
  return /* @__PURE__ */ l("div", { className: "pvx-empty", children: [
565
1079
  /* @__PURE__ */ n("svg", { className: "pvx-empty-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.5 18.75h-9m9 0a3 3 0 013 3h-15a3 3 0 013-3m9 0v-4.5A3.375 3.375 0 0013.125 10.875h-2.25A3.375 3.375 0 007.5 14.25v4.5" }) }),
566
1080
  /* @__PURE__ */ n("p", { children: e })
567
1081
  ] });
568
1082
  }
569
- function Q() {
1083
+ function Z() {
570
1084
  return /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading..." });
571
1085
  }
572
- function dn() {
1086
+ function Vn() {
573
1087
  return /* @__PURE__ */ n("svg", { className: "pvx-icon pvx-icon--valid", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 12.75l6 6 9-13.5" }) });
574
1088
  }
575
- function pn() {
1089
+ function Kn() {
576
1090
  return /* @__PURE__ */ n("svg", { className: "pvx-icon pvx-icon--invalid", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) });
577
1091
  }
578
- function Pt({ tracks: e, isLoading: t, carMetadata: r, getUserDisplay: s, onTrackSelect: a, tags: i, onTagChange: o }) {
579
- const [d, p] = Z({ key: "record.timestamp", dir: "desc" }), { activeTags: c, toggle: u, clear: v } = De(i, o), f = T(() => {
580
- var g;
581
- if (!((g = r == null ? void 0 : r.tags) != null && g.length)) return [];
582
- const m = /* @__PURE__ */ new Set();
1092
+ function ar({ tracks: e, isLoading: t, carMetadata: r, getUserDisplay: s, onTrackSelect: a, tags: o, onTagChange: i }) {
1093
+ const [d, p] = ne({ key: "record.timestamp", dir: "desc" }), { activeTags: c, toggle: u, clear: v } = We(o, i), f = T(() => {
1094
+ var m;
1095
+ if (!((m = r == null ? void 0 : r.tags) != null && m.length)) return [];
1096
+ const x = /* @__PURE__ */ new Set();
583
1097
  for (const b of e || [])
584
- b.recordByTag && Object.keys(b.recordByTag).forEach((x) => m.add(x));
585
- return r.tags.filter((b) => m.has(b));
586
- }, [e, r]), h = T(() => e ? c.size === 0 ? e : e.map((m) => {
587
- var x, w;
588
- if (!m.recordByTag) return null;
589
- let g = null;
1098
+ b.recordByTag && Object.keys(b.recordByTag).forEach((g) => x.add(g));
1099
+ return r.tags.filter((b) => x.has(b));
1100
+ }, [e, r]), h = T(() => e ? c.size === 0 ? e : e.map((x) => {
1101
+ var g, k;
1102
+ if (!x.recordByTag) return null;
1103
+ let m = null;
590
1104
  const b = /* @__PURE__ */ new Set();
591
- for (const C of Object.values(m.recordByTag)) {
1105
+ for (const C of Object.values(x.recordByTag)) {
592
1106
  if (b.has(C.carId)) continue;
593
1107
  b.add(C.carId);
594
- const M = ((w = (x = r == null ? void 0 : r.cars) == null ? void 0 : x[C.carId]) == null ? void 0 : w.tags) || [];
595
- Me(M, c, r == null ? void 0 : r.categories) && (!g || C.lapTimeMs < g.lapTimeMs) && (g = C);
1108
+ const P = ((k = (g = r == null ? void 0 : r.cars) == null ? void 0 : g[C.carId]) == null ? void 0 : k.tags) || [];
1109
+ qe(P, c, r == null ? void 0 : r.categories) && (!m || C.lapTimeMs < m.lapTimeMs) && (m = C);
596
1110
  }
597
- return g ? {
598
- ...m,
1111
+ return m ? {
1112
+ ...x,
599
1113
  record: {
600
- visibleId: g.steamId || g.identifier,
601
- carId: g.carId,
602
- carDisplayName: _(g.carId),
603
- lapTimeMs: g.lapTimeMs,
604
- timestamp: g.recordedAt
1114
+ visibleId: m.steamId || m.identifier,
1115
+ carId: m.carId,
1116
+ carDisplayName: I(m.carId),
1117
+ lapTimeMs: m.lapTimeMs,
1118
+ timestamp: m.recordedAt
605
1119
  }
606
1120
  } : null;
607
- }).filter(Boolean) : [], [e, c, r]), k = T(() => J(h, d, (m, g) => {
608
- var b, x;
609
- switch (g) {
1121
+ }).filter(Boolean) : [], [e, c, r]), y = T(() => te(h, d, (x, m) => {
1122
+ var b, g;
1123
+ switch (m) {
610
1124
  case "displayName":
611
- return m.displayName;
1125
+ return x.displayName;
612
1126
  case "record.lapTimeMs":
613
- return (b = m.record) == null ? void 0 : b.lapTimeMs;
1127
+ return (b = x.record) == null ? void 0 : b.lapTimeMs;
614
1128
  case "driverCount":
615
- return m.driverCount || 0;
1129
+ return x.driverCount || 0;
616
1130
  case "carCount":
617
- return m.carCount || 0;
1131
+ return x.carCount || 0;
618
1132
  case "record.timestamp":
619
1133
  default:
620
- return (x = m.record) != null && x.timestamp ? new Date(m.record.timestamp).getTime() : 0;
1134
+ return (g = x.record) != null && g.timestamp ? new Date(x.record.timestamp).getTime() : 0;
621
1135
  }
622
1136
  }), [h, d]);
623
- return t ? /* @__PURE__ */ n(Q, {}) : e != null && e.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
1137
+ return t ? /* @__PURE__ */ n(Z, {}) : e != null && e.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
624
1138
  /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n("h2", { className: "pvx-card-title", children: "Track Records" }) }),
625
1139
  /* @__PURE__ */ n(
626
- Pe,
1140
+ Ve,
627
1141
  {
628
1142
  availableTags: f,
629
1143
  activeTags: c,
@@ -635,69 +1149,69 @@ function Pt({ tracks: e, isLoading: t, carMetadata: r, getUserDisplay: s, onTrac
635
1149
  ),
636
1150
  /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
637
1151
  /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
638
- /* @__PURE__ */ n(I, { label: "Track", sortKey: "displayName", config: d, onSort: p }),
1152
+ /* @__PURE__ */ n(U, { label: "Track", sortKey: "displayName", config: d, onSort: p }),
639
1153
  /* @__PURE__ */ n("th", { className: "pvx-th", children: "Record Holder" }),
640
1154
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Car" }),
641
- /* @__PURE__ */ n(I, { label: "Lap Time", sortKey: "record.lapTimeMs", config: d, onSort: p }),
642
- /* @__PURE__ */ n(I, { label: "Drivers", sortKey: "driverCount", config: d, onSort: p, className: "pvx-hidden-below-md" }),
643
- /* @__PURE__ */ n(I, { label: "Cars", sortKey: "carCount", config: d, onSort: p, className: "pvx-hidden-below-lg" }),
644
- /* @__PURE__ */ n(I, { label: "Date", sortKey: "record.timestamp", config: d, onSort: p, className: "pvx-hidden-below-xl" })
1155
+ /* @__PURE__ */ n(U, { label: "Lap Time", sortKey: "record.lapTimeMs", config: d, onSort: p }),
1156
+ /* @__PURE__ */ n(U, { label: "Drivers", sortKey: "driverCount", config: d, onSort: p, className: "pvx-hidden-below-md" }),
1157
+ /* @__PURE__ */ n(U, { label: "Cars", sortKey: "carCount", config: d, onSort: p, className: "pvx-hidden-below-lg" }),
1158
+ /* @__PURE__ */ n(U, { label: "Date", sortKey: "record.timestamp", config: d, onSort: p, className: "pvx-hidden-below-xl" })
645
1159
  ] }) }),
646
- /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: k.map((m) => {
647
- var g, b, x;
1160
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: y.map((x) => {
1161
+ var m, b, g;
648
1162
  return /* @__PURE__ */ l(
649
1163
  "tr",
650
1164
  {
651
1165
  className: "pvx-row pvx-row--clickable",
652
- onClick: () => a(m.id, m.layout),
1166
+ onClick: () => a(x.id, x.layout),
653
1167
  children: [
654
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: m.displayName }),
655
- /* @__PURE__ */ n("td", { className: "pvx-td", children: (g = m.record) != null && g.visibleId ? /* @__PURE__ */ n(X, { userId: m.record.visibleId, getUserDisplay: s }) : "-" }),
656
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-lg", children: ((b = m.record) == null ? void 0 : b.carDisplayName) || "-" }),
657
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: m.record ? q(m.record.lapTimeMs) : "-" }),
658
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: m.driverCount || "-" }),
659
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: m.carCount || "-" }),
660
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: (x = m.record) != null && x.timestamp ? G(m.record.timestamp) : "-" })
1168
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: x.displayName }),
1169
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: (m = x.record) != null && m.visibleId ? /* @__PURE__ */ n(re, { userId: x.record.visibleId, getUserDisplay: s }) : "-" }),
1170
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-lg", children: ((b = x.record) == null ? void 0 : b.carDisplayName) || "-" }),
1171
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: x.record ? q(x.record.lapTimeMs) : "-" }),
1172
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: x.driverCount || "-" }),
1173
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: x.carCount || "-" }),
1174
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: (g = x.record) != null && g.timestamp ? Q(x.record.timestamp) : "-" })
661
1175
  ]
662
1176
  },
663
- `${m.id}|${m.layout || ""}`
1177
+ `${x.id}|${x.layout || ""}`
664
1178
  );
665
1179
  }) })
666
1180
  ] }) })
667
- ] }) : /* @__PURE__ */ n(z, { message: "No lap times recorded yet." });
668
- }
669
- function Bt({ entries: e, isLoading: t, track: r, carMetadata: s, getUserDisplay: a, onCarSelect: i, onNavigate: o, tags: d, onTagChange: p }) {
670
- const [c, u] = Z({ key: "lapTimeMs", dir: "asc" }), { activeTags: v, toggle: f, clear: h } = De(d, p), k = T(() => {
671
- var w, C, M;
672
- if (!e || !((w = s == null ? void 0 : s.tags) != null && w.length)) return [];
673
- const x = /* @__PURE__ */ new Set();
674
- for (const P of e)
675
- (((M = (C = s.cars) == null ? void 0 : C[P.carId]) == null ? void 0 : M.tags) || []).forEach((S) => x.add(S));
676
- return s.tags.filter((P) => x.has(P));
677
- }, [e, s]), m = T(() => e ? v.size === 0 ? e : e.filter((x) => {
678
- var C, M;
679
- const w = ((M = (C = s == null ? void 0 : s.cars) == null ? void 0 : C[x.carId]) == null ? void 0 : M.tags) || [];
680
- return Me(w, v, s == null ? void 0 : s.categories);
681
- }) : [], [e, v, s]), g = T(() => J(m, c, (x, w) => {
682
- switch (w) {
1181
+ ] }) : /* @__PURE__ */ n(Y, { message: "No lap times recorded yet." });
1182
+ }
1183
+ function ir({ entries: e, isLoading: t, track: r, carMetadata: s, getUserDisplay: a, onCarSelect: o, onNavigate: i, tags: d, onTagChange: p }) {
1184
+ const [c, u] = ne({ key: "lapTimeMs", dir: "asc" }), { activeTags: v, toggle: f, clear: h } = We(d, p), y = T(() => {
1185
+ var k, C, P;
1186
+ if (!e || !((k = s == null ? void 0 : s.tags) != null && k.length)) return [];
1187
+ const g = /* @__PURE__ */ new Set();
1188
+ for (const A of e)
1189
+ (((P = (C = s.cars) == null ? void 0 : C[A.carId]) == null ? void 0 : P.tags) || []).forEach((L) => g.add(L));
1190
+ return s.tags.filter((A) => g.has(A));
1191
+ }, [e, s]), x = T(() => e ? v.size === 0 ? e : e.filter((g) => {
1192
+ var C, P;
1193
+ const k = ((P = (C = s == null ? void 0 : s.cars) == null ? void 0 : C[g.carId]) == null ? void 0 : P.tags) || [];
1194
+ return qe(k, v, s == null ? void 0 : s.categories);
1195
+ }) : [], [e, v, s]), m = T(() => te(x, c, (g, k) => {
1196
+ switch (k) {
683
1197
  case "carId":
684
- return _(x.carId);
1198
+ return I(g.carId);
685
1199
  case "driverCount":
686
- return x.driverCount || 0;
1200
+ return g.driverCount || 0;
687
1201
  case "lapTimeMs":
688
1202
  default:
689
- return x.lapTimeMs;
1203
+ return g.lapTimeMs;
690
1204
  }
691
- }), [m, c]), b = [
692
- { key: "tracks", label: "Tracks", onClick: () => o("tracks") },
1205
+ }), [x, c]), b = [
1206
+ { key: "tracks", label: "Tracks", onClick: () => i("tracks") },
693
1207
  { key: "track", label: r.displayName }
694
1208
  ];
695
- return t ? /* @__PURE__ */ n(Q, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
696
- /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(ue, { segments: b }) }),
1209
+ return t ? /* @__PURE__ */ n(Z, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
1210
+ /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(Ne, { segments: b }) }),
697
1211
  /* @__PURE__ */ n(
698
- Pe,
1212
+ Ve,
699
1213
  {
700
- availableTags: k,
1214
+ availableTags: y,
701
1215
  activeTags: v,
702
1216
  onToggle: f,
703
1217
  onClear: h,
@@ -708,34 +1222,34 @@ function Bt({ entries: e, isLoading: t, track: r, carMetadata: s, getUserDisplay
708
1222
  e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
709
1223
  /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
710
1224
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
711
- /* @__PURE__ */ n(I, { label: "Car", sortKey: "carId", config: c, onSort: u }),
1225
+ /* @__PURE__ */ n(U, { label: "Car", sortKey: "carId", config: c, onSort: u }),
712
1226
  /* @__PURE__ */ n("th", { className: "pvx-th", children: "Record Holder" }),
713
- /* @__PURE__ */ n(I, { label: "Lap Time", sortKey: "lapTimeMs", config: c, onSort: u }),
714
- /* @__PURE__ */ n(I, { label: "Drivers", sortKey: "driverCount", config: c, onSort: u, className: "pvx-hidden-below-md" }),
1227
+ /* @__PURE__ */ n(U, { label: "Lap Time", sortKey: "lapTimeMs", config: c, onSort: u }),
1228
+ /* @__PURE__ */ n(U, { label: "Drivers", sortKey: "driverCount", config: c, onSort: u, className: "pvx-hidden-below-md" }),
715
1229
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Date" })
716
1230
  ] }) }),
717
- /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: g.map((x, w) => /* @__PURE__ */ l(
1231
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: m.map((g, k) => /* @__PURE__ */ l(
718
1232
  "tr",
719
1233
  {
720
1234
  className: "pvx-row pvx-row--clickable",
721
- onClick: () => i(x.carId),
1235
+ onClick: () => o(g.carId),
722
1236
  children: [
723
- /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(pe, { rank: w + 1, podium: !0 }) }),
724
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: _(x.carId) }),
725
- /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(X, { userId: x.steamId || x.userId, getUserDisplay: a }) }),
726
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: q(x.lapTimeMs) }),
727
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: x.driverCount || "-" }),
728
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-lg", children: x.recordedAt ? G(x.recordedAt) : "-" })
1237
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(fe, { rank: k + 1, podium: !0 }) }),
1238
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: I(g.carId) }),
1239
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(re, { userId: g.steamId || g.userId, getUserDisplay: a }) }),
1240
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: q(g.lapTimeMs) }),
1241
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: g.driverCount || "-" }),
1242
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-lg", children: g.recordedAt ? Q(g.recordedAt) : "-" })
729
1243
  ]
730
1244
  },
731
- x.carId
1245
+ g.carId
732
1246
  )) })
733
- ] }) }) : /* @__PURE__ */ n(z, { message: "No lap times for this track yet." })
1247
+ ] }) }) : /* @__PURE__ */ n(Y, { message: "No lap times for this track yet." })
734
1248
  ] });
735
1249
  }
736
- function It({ entries: e, isLoading: t, track: r, carId: s, getUserDisplay: a, onDriverSelect: i, onNavigate: o, highlightId: d }) {
737
- const [p, c] = Z({ key: "lapTimeMs", dir: "asc" }), u = T(() => Ae(e), [e]), v = T(() => J(e || [], p, (h, k) => {
738
- switch (k) {
1250
+ function or({ entries: e, isLoading: t, track: r, carId: s, getUserDisplay: a, onDriverSelect: o, onNavigate: i, highlightId: d }) {
1251
+ const [p, c] = ne({ key: "lapTimeMs", dir: "asc" }), u = T(() => je(e), [e]), v = T(() => te(e || [], p, (h, y) => {
1252
+ switch (y) {
739
1253
  case "userId":
740
1254
  return a(h.steamId || h.userId).displayName;
741
1255
  case "lapCount":
@@ -745,73 +1259,73 @@ function It({ entries: e, isLoading: t, track: r, carId: s, getUserDisplay: a, o
745
1259
  return h.lapTimeMs;
746
1260
  }
747
1261
  }), [e, p, a]), f = [
748
- { key: "tracks", label: "Tracks", onClick: () => o("tracks") },
749
- { key: "track", label: r.displayName, onClick: () => o("track") },
750
- { key: "car", label: _(s) }
1262
+ { key: "tracks", label: "Tracks", onClick: () => i("tracks") },
1263
+ { key: "track", label: r.displayName, onClick: () => i("track") },
1264
+ { key: "car", label: I(s) }
751
1265
  ];
752
- return t ? /* @__PURE__ */ n(Q, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
753
- /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(ue, { segments: f }) }),
1266
+ return t ? /* @__PURE__ */ n(Z, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
1267
+ /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(Ne, { segments: f }) }),
754
1268
  e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
755
1269
  /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
756
1270
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
757
- /* @__PURE__ */ n(I, { label: "Driver", sortKey: "userId", config: p, onSort: c }),
758
- /* @__PURE__ */ n(I, { label: "Lap Time", sortKey: "lapTimeMs", config: p, onSort: c }),
1271
+ /* @__PURE__ */ n(U, { label: "Driver", sortKey: "userId", config: p, onSort: c }),
1272
+ /* @__PURE__ */ n(U, { label: "Lap Time", sortKey: "lapTimeMs", config: p, onSort: c }),
759
1273
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
760
1274
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
761
1275
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" }),
762
1276
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Tyre" }),
763
1277
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Fuel" }),
764
- /* @__PURE__ */ n(I, { label: "Laps", sortKey: "lapCount", config: p, onSort: c, className: "pvx-hidden-below-lg" }),
1278
+ /* @__PURE__ */ n(U, { label: "Laps", sortKey: "lapCount", config: p, onSort: c, className: "pvx-hidden-below-lg" }),
765
1279
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
766
1280
  ] }) }),
767
- /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: v.map((h, k) => {
768
- const m = k + 1, g = h.steamId || h.userId, b = u && h.sector1Ms === u.s1, x = u && h.sector2Ms === u.s2, w = u && h.sector3Ms === u.s3;
1281
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: v.map((h, y) => {
1282
+ const x = y + 1, m = h.steamId || h.userId, b = u && h.sector1Ms === u.s1, g = u && h.sector2Ms === u.s2, k = u && h.sector3Ms === u.s3;
769
1283
  return /* @__PURE__ */ l(
770
1284
  "tr",
771
1285
  {
772
- className: `pvx-row pvx-row--clickable ${d && g === d ? "pvx-row--highlight" : m <= 3 ? "pvx-row--podium" : ""}`,
773
- onClick: () => i(g),
1286
+ className: `pvx-row pvx-row--clickable ${d && m === d ? "pvx-row--highlight" : x <= 3 ? "pvx-row--podium" : ""}`,
1287
+ onClick: () => o(m),
774
1288
  children: [
775
- /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(pe, { rank: m, podium: !0 }) }),
776
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(X, { userId: g, getUserDisplay: a }) }),
1289
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(fe, { rank: x, podium: !0 }) }),
1290
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(re, { userId: m, getUserDisplay: a }) }),
777
1291
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: q(h.lapTimeMs) }),
778
1292
  /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${b ? "pvx-td--best-sector" : ""}`, children: F(h.sector1Ms) }),
779
- /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${x ? "pvx-td--best-sector" : ""}`, children: F(h.sector2Ms) }),
780
- /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${w ? "pvx-td--best-sector" : ""}`, children: F(h.sector3Ms) }),
781
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: ke(h.tyreCompound), children: h.tyreCompound || "-" }),
782
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-xl", children: we(h.startingFuelL) }),
1293
+ /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${g ? "pvx-td--best-sector" : ""}`, children: F(h.sector2Ms) }),
1294
+ /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${k ? "pvx-td--best-sector" : ""}`, children: F(h.sector3Ms) }),
1295
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: Re(h.tyreCompound), children: h.tyreCompound || "-" }),
1296
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-xl", children: Me(h.startingFuelL) }),
783
1297
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: h.lapCount || "-" }),
784
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: h.recordedAt ? G(h.recordedAt) : "-" })
1298
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: h.recordedAt ? Q(h.recordedAt) : "-" })
785
1299
  ]
786
1300
  },
787
- g
1301
+ m
788
1302
  );
789
1303
  }) })
790
- ] }) }) : /* @__PURE__ */ n(z, { message: "No lap times for this car yet." })
1304
+ ] }) }) : /* @__PURE__ */ n(Y, { message: "No lap times for this car yet." })
791
1305
  ] });
792
1306
  }
793
- function Et({ userId: e, track: t, carId: r, game: s, gameVersion: a, showInvalid: i, getUserDisplay: o, onToggleInvalid: d, onNavigate: p }) {
794
- const { data: c, driverName: u, theoreticalBest: v, isLoading: f } = en(e, t.id, t.layout, r, { showInvalid: i, game: s, gameVersion: a }), { displayName: h, avatarUrl: k } = o(e, u), m = T(() => Ae(c, !0), [c]), g = T(() => {
795
- const x = (c == null ? void 0 : c.filter((w) => w.isValid)) || [];
796
- return x.length ? Math.min(...x.map((w) => w.lapTimeMs)) : null;
1307
+ function lr({ userId: e, track: t, carId: r, game: s, gameVersion: a, showInvalid: o, getUserDisplay: i, onToggleInvalid: d, onNavigate: p }) {
1308
+ const { data: c, driverName: u, theoreticalBest: v, isLoading: f } = cn(e, t.id, t.layout, r, { showInvalid: o, game: s, gameVersion: a }), { displayName: h, avatarUrl: y } = i(e, u), x = T(() => je(c, !0), [c]), m = T(() => {
1309
+ const g = (c == null ? void 0 : c.filter((k) => k.isValid)) || [];
1310
+ return g.length ? Math.min(...g.map((k) => k.lapTimeMs)) : null;
797
1311
  }, [c]), b = [
798
1312
  { key: "tracks", label: "Tracks", onClick: () => p("tracks") },
799
1313
  { key: "track", label: t.displayName, onClick: () => p("track") },
800
- { key: "car", label: _(r), onClick: () => p("car") },
1314
+ { key: "car", label: I(r), onClick: () => p("car") },
801
1315
  { key: "driver", label: h }
802
1316
  ];
803
- return f ? /* @__PURE__ */ n(Q, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
1317
+ return f ? /* @__PURE__ */ n(Z, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
804
1318
  /* @__PURE__ */ l("div", { className: "pvx-card-header pvx-card-header--split", children: [
805
1319
  /* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
806
- /* @__PURE__ */ n(ue, { segments: b }),
807
- k ? /* @__PURE__ */ n("img", { src: k, alt: "", className: "pvx-driver-avatar pvx-driver-avatar--lg" }) : /* @__PURE__ */ n("span", { className: "pvx-driver-avatar pvx-driver-avatar--lg pvx-driver-avatar--placeholder" })
1320
+ /* @__PURE__ */ n(Ne, { segments: b }),
1321
+ y ? /* @__PURE__ */ n("img", { src: y, alt: "", className: "pvx-driver-avatar pvx-driver-avatar--lg" }) : /* @__PURE__ */ n("span", { className: "pvx-driver-avatar pvx-driver-avatar--lg pvx-driver-avatar--placeholder" })
808
1322
  ] }),
809
1323
  /* @__PURE__ */ l("label", { className: "pvx-checkbox-label", children: [
810
1324
  /* @__PURE__ */ n(
811
1325
  "input",
812
1326
  {
813
1327
  type: "checkbox",
814
- checked: i,
1328
+ checked: o,
815
1329
  onChange: d,
816
1330
  className: "pvx-checkbox"
817
1331
  }
@@ -845,27 +1359,27 @@ function Et({ userId: e, track: t, carId: r, game: s, gameVersion: a, showInvali
845
1359
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Fuel" }),
846
1360
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
847
1361
  ] }) }),
848
- /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: c.map((x, w) => {
849
- const C = x.isValid && x.lapTimeMs === g, M = m && x.isValid && x.sector1Ms === m.s1, P = m && x.isValid && x.sector2Ms === m.s2, N = m && x.isValid && x.sector3Ms === m.s3;
850
- let S = "pvx-row";
851
- return x.isValid || (S += " pvx-row--invalid"), C && (S += " pvx-row--personal-best"), /* @__PURE__ */ l("tr", { className: S, children: [
852
- /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n("span", { className: `pvx-rank ${C ? "pvx-rank--gold" : ""}`, children: w + 1 }) }),
853
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-md", children: x.lapNumber || "-" }),
854
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: q(x.lapTimeMs) }),
855
- /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${M ? "pvx-td--best-sector" : ""}`, children: F(x.sector1Ms) }),
856
- /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${P ? "pvx-td--best-sector" : ""}`, children: F(x.sector2Ms) }),
857
- /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${N ? "pvx-td--best-sector" : ""}`, children: F(x.sector3Ms) }),
858
- /* @__PURE__ */ n("td", { className: "pvx-td", title: x.isValid ? void 0 : x.invalidReason || "Invalid", children: x.isValid ? /* @__PURE__ */ n(dn, {}) : /* @__PURE__ */ n(pn, {}) }),
859
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: ke(x.tyreCompound), children: x.tyreCompound || "-" }),
860
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: we(x.startingFuelL) }),
861
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: G(x.timestamp) })
862
- ] }, x.id);
1362
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: c.map((g, k) => {
1363
+ const C = g.isValid && g.lapTimeMs === m, P = x && g.isValid && g.sector1Ms === x.s1, A = x && g.isValid && g.sector2Ms === x.s2, N = x && g.isValid && g.sector3Ms === x.s3;
1364
+ let L = "pvx-row";
1365
+ return g.isValid || (L += " pvx-row--invalid"), C && (L += " pvx-row--personal-best"), /* @__PURE__ */ l("tr", { className: L, children: [
1366
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n("span", { className: `pvx-rank ${C ? "pvx-rank--gold" : ""}`, children: k + 1 }) }),
1367
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-md", children: g.lapNumber || "-" }),
1368
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: q(g.lapTimeMs) }),
1369
+ /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${P ? "pvx-td--best-sector" : ""}`, children: F(g.sector1Ms) }),
1370
+ /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${A ? "pvx-td--best-sector" : ""}`, children: F(g.sector2Ms) }),
1371
+ /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${N ? "pvx-td--best-sector" : ""}`, children: F(g.sector3Ms) }),
1372
+ /* @__PURE__ */ n("td", { className: "pvx-td", title: g.isValid ? void 0 : g.invalidReason || "Invalid", children: g.isValid ? /* @__PURE__ */ n(Vn, {}) : /* @__PURE__ */ n(Kn, {}) }),
1373
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: Re(g.tyreCompound), children: g.tyreCompound || "-" }),
1374
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: Me(g.startingFuelL) }),
1375
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: Q(g.timestamp) })
1376
+ ] }, g.id);
863
1377
  }) })
864
- ] }) }) : /* @__PURE__ */ n(z, { message: i ? "No laps recorded for this combination." : 'No valid laps. Try enabling "Show invalid laps".' })
1378
+ ] }) }) : /* @__PURE__ */ n(Y, { message: o ? "No laps recorded for this combination." : 'No valid laps. Try enabling "Show invalid laps".' })
865
1379
  ] });
866
1380
  }
867
- function _t({ drivers: e, isLoading: t, getUserDisplay: r, game: s, gameVersion: a, onComboSelect: i }) {
868
- const [o, d] = Z({ key: "rank", dir: "asc" }), [p, c] = E(null), u = T(() => e ? J(e, o, (f, h) => {
1381
+ function cr({ drivers: e, isLoading: t, getUserDisplay: r, game: s, gameVersion: a, onComboSelect: o }) {
1382
+ const [i, d] = ne({ key: "rank", dir: "asc" }), [p, c] = E(null), u = T(() => e ? te(e, i, (f, h) => {
869
1383
  switch (h) {
870
1384
  case "rating":
871
1385
  return f.rating;
@@ -877,10 +1391,10 @@ function _t({ drivers: e, isLoading: t, getUserDisplay: r, game: s, gameVersion:
877
1391
  default:
878
1392
  return f.rank;
879
1393
  }
880
- }) : [], [e, o]);
881
- if (t) return /* @__PURE__ */ n(Q, {});
1394
+ }) : [], [e, i]);
1395
+ if (t) return /* @__PURE__ */ n(Z, {});
882
1396
  if (!(e != null && e.length))
883
- return /* @__PURE__ */ n("div", { className: "pvx-card", children: /* @__PURE__ */ n(z, { message: "Not enough data for rankings yet." }) });
1397
+ return /* @__PURE__ */ n("div", { className: "pvx-card", children: /* @__PURE__ */ n(Y, { message: "Not enough data for rankings yet." }) });
884
1398
  const v = 5;
885
1399
  return /* @__PURE__ */ l("div", { className: "pvx-card", children: [
886
1400
  /* @__PURE__ */ l("div", { className: "pvx-card-header pvx-rankings-header", children: [
@@ -900,16 +1414,16 @@ function _t({ drivers: e, isLoading: t, getUserDisplay: r, game: s, gameVersion:
900
1414
  ] }),
901
1415
  /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
902
1416
  /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
903
- /* @__PURE__ */ n(I, { label: "#", sortKey: "rank", config: o, onSort: d, className: "pvx-th--narrow" }),
1417
+ /* @__PURE__ */ n(U, { label: "#", sortKey: "rank", config: i, onSort: d, className: "pvx-th--narrow" }),
904
1418
  /* @__PURE__ */ n("th", { className: "pvx-th", children: "Driver" }),
905
- /* @__PURE__ */ n(I, { label: "Rating", sortKey: "rating", config: o, onSort: d }),
906
- /* @__PURE__ */ n(I, { label: "Cars", sortKey: "distinctCars", config: o, onSort: d, className: "pvx-hidden-below-sm" }),
907
- /* @__PURE__ */ n(I, { label: "Combos", sortKey: "comboCount", config: o, onSort: d, className: "pvx-hidden-below-sm" })
1419
+ /* @__PURE__ */ n(U, { label: "Rating", sortKey: "rating", config: i, onSort: d }),
1420
+ /* @__PURE__ */ n(U, { label: "Cars", sortKey: "distinctCars", config: i, onSort: d, className: "pvx-hidden-below-sm" }),
1421
+ /* @__PURE__ */ n(U, { label: "Combos", sortKey: "comboCount", config: i, onSort: d, className: "pvx-hidden-below-sm" })
908
1422
  ] }) }),
909
1423
  /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: u.map((f) => {
910
1424
  const h = p === f.identifier;
911
1425
  return /* @__PURE__ */ n(
912
- un,
1426
+ Hn,
913
1427
  {
914
1428
  driver: f,
915
1429
  getUserDisplay: r,
@@ -918,7 +1432,7 @@ function _t({ drivers: e, isLoading: t, getUserDisplay: r, game: s, gameVersion:
918
1432
  colCount: v,
919
1433
  game: s,
920
1434
  gameVersion: a,
921
- onComboSelect: i
1435
+ onComboSelect: o
922
1436
  },
923
1437
  f.identifier
924
1438
  );
@@ -926,7 +1440,7 @@ function _t({ drivers: e, isLoading: t, getUserDisplay: r, game: s, gameVersion:
926
1440
  ] }) })
927
1441
  ] });
928
1442
  }
929
- function un({ driver: e, getUserDisplay: t, isExpanded: r, onToggle: s, colCount: a, game: i, gameVersion: o, onComboSelect: d }) {
1443
+ function Hn({ driver: e, getUserDisplay: t, isExpanded: r, onToggle: s, colCount: a, game: o, gameVersion: i, onComboSelect: d }) {
930
1444
  const p = e.identifier;
931
1445
  return /* @__PURE__ */ l(B, { children: [
932
1446
  /* @__PURE__ */ l(
@@ -935,8 +1449,8 @@ function un({ driver: e, getUserDisplay: t, isExpanded: r, onToggle: s, colCount
935
1449
  className: `pvx-row pvx-row--clickable ${e.rank <= 3 ? "pvx-row--podium" : ""}`,
936
1450
  onClick: s,
937
1451
  children: [
938
- /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(pe, { rank: e.rank, podium: !0 }) }),
939
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(X, { userId: p, getUserDisplay: t }) }),
1452
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(fe, { rank: e.rank, podium: !0 }) }),
1453
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(re, { userId: p, getUserDisplay: t }) }),
940
1454
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: e.rating.toFixed(1) }),
941
1455
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: e.distinctCars || "-" }),
942
1456
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: /* @__PURE__ */ l("span", { className: "pvx-rankings-combo-count", children: [
@@ -947,7 +1461,7 @@ function un({ driver: e, getUserDisplay: t, isExpanded: r, onToggle: s, colCount
947
1461
  }
948
1462
  ),
949
1463
  r && e.combos && /* @__PURE__ */ n("tr", { children: /* @__PURE__ */ n("td", { colSpan: a, className: "pvx-rankings-combos-cell", children: /* @__PURE__ */ n("div", { className: "pvx-rankings-combos", children: e.combos.map((c, u) => {
950
- const v = c.layout ? `${c.trackId}|${c.layout}` : c.trackId, f = d ? () => d({ track: v, car: c.carId, highlight: p, game: i, gameVersion: o }) : void 0;
1464
+ const v = c.layout ? `${c.trackId}|${c.layout}` : c.trackId, f = d ? () => d({ track: v, car: c.carId, highlight: p, game: o, gameVersion: i }) : void 0;
951
1465
  return /* @__PURE__ */ l(
952
1466
  "div",
953
1467
  {
@@ -956,8 +1470,8 @@ function un({ driver: e, getUserDisplay: t, isExpanded: r, onToggle: s, colCount
956
1470
  role: f ? "button" : void 0,
957
1471
  children: [
958
1472
  /* @__PURE__ */ l("div", { className: "pvx-rankings-combo-info", children: [
959
- /* @__PURE__ */ n("p", { className: "pvx-rankings-combo-track", children: V(c.trackId, c.layout, i) }),
960
- /* @__PURE__ */ n("p", { className: "pvx-rankings-combo-car", children: _(c.carId) })
1473
+ /* @__PURE__ */ n("p", { className: "pvx-rankings-combo-track", children: z(c.trackId, c.layout, o) }),
1474
+ /* @__PURE__ */ n("p", { className: "pvx-rankings-combo-car", children: I(c.carId) })
961
1475
  ] }),
962
1476
  /* @__PURE__ */ l("div", { className: "pvx-rankings-combo-stats", children: [
963
1477
  /* @__PURE__ */ n("p", { className: "pvx-rankings-combo-time", children: q(c.lapTimeMs) }),
@@ -980,155 +1494,18 @@ function un({ driver: e, getUserDisplay: t, isExpanded: r, onToggle: s, colCount
980
1494
  }) }) }) })
981
1495
  ] });
982
1496
  }
983
- const hn = {
984
- GBR: "🇬🇧",
985
- DEU: "🇩🇪",
986
- NLD: "🇳🇱",
987
- SWE: "🇸🇪",
988
- ESP: "🇪🇸",
989
- ZAF: "🇿🇦",
990
- FRA: "🇫🇷",
991
- ITA: "🇮🇹",
992
- USA: "🇺🇸",
993
- AUS: "🇦🇺",
994
- BRA: "🇧🇷",
995
- JPN: "🇯🇵",
996
- CAN: "🇨🇦",
997
- POL: "🇵🇱",
998
- AUT: "🇦🇹",
999
- BEL: "🇧🇪",
1000
- PRT: "🇵🇹",
1001
- NOR: "🇳🇴",
1002
- DNK: "🇩🇰",
1003
- FIN: "🇫🇮",
1004
- IRL: "🇮🇪",
1005
- CHE: "🇨🇭",
1006
- NZL: "🇳🇿",
1007
- MEX: "🇲🇽",
1008
- ARG: "🇦🇷",
1009
- CZE: "🇨🇿",
1010
- HUN: "🇭🇺",
1011
- RUS: "🇷🇺",
1012
- TUR: "🇹🇷",
1013
- KOR: "🇰🇷"
1014
- }, he = ["🥇", "🥈", "🥉"], mn = {
1015
- championship: "Championship",
1016
- series: "Series",
1017
- event: "Event",
1018
- hotlap: "Hotlap"
1019
- }, vn = ["PRACTICE", "QUALIFYING", "RACE"];
1020
- function ge(e) {
1021
- const t = vn.indexOf(e);
1022
- if (t >= 0) return t;
1023
- const r = e.match(/^PRACTICE_(\d+)$/);
1024
- return r ? 100 + parseInt(r[1]) : 999;
1025
- }
1026
- function ee(e) {
1027
- const t = e.match(/^PRACTICE_(\d+)$/);
1028
- return t ? `P${t[1]}` : e;
1029
- }
1030
- function me({ position: e }) {
1031
- return /* @__PURE__ */ n("span", { className: e === 1 ? "pvx-rank pvx-rank--gold" : e === 2 ? "pvx-rank pvx-rank--silver" : e === 3 ? "pvx-rank pvx-rank--bronze" : "pvx-rank", children: e });
1032
- }
1033
- function ne({ nation: e }) {
1034
- const t = e && hn[e];
1035
- return t ? /* @__PURE__ */ n("span", { className: "pvx-nation-flag", title: e, children: t }) : null;
1036
- }
1037
- function xn({ sessions: e, activeSession: t, onSelect: r }) {
1038
- if (!e || e.length <= 1) return null;
1039
- const s = [...e].sort(
1040
- (a, i) => ge(a.type) - ge(i.type)
1041
- );
1042
- return /* @__PURE__ */ n("div", { className: "pvx-session-tabs", children: s.map((a) => /* @__PURE__ */ n(
1043
- "button",
1044
- {
1045
- onClick: () => r(a.type),
1046
- className: `pvx-session-tab ${t === a.type ? "pvx-session-tab--active" : ""}`,
1047
- children: ee(a.type)
1048
- },
1049
- a.type
1050
- )) });
1051
- }
1052
- function gn({ type: e }) {
1053
- return /* @__PURE__ */ n("span", { className: `pvx-comp-badge pvx-comp-badge--${e}`, children: mn[e] || e });
1054
- }
1055
- function re({ children: e, variant: t = "default" }) {
1056
- return /* @__PURE__ */ n("span", { className: `pvx-info-pill ${t !== "default" ? `pvx-info-pill--${t}` : ""}`, children: e });
1057
- }
1058
- function fn(e) {
1059
- if (!e) return "TBD";
1060
- const t = new Date(e);
1061
- if (isNaN(t)) return "TBD";
1062
- const r = t.toLocaleDateString("en-GB", { weekday: "short", day: "numeric", month: "short" }), s = t.toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit" });
1063
- return `${r} • ${s}`;
1064
- }
1065
- function Nn(e) {
1066
- return e.reduce((t, r) => {
1067
- var s;
1068
- return (s = r.splits) != null && s.length ? t ? t.map((a, i) => {
1069
- const o = r.splits[i];
1070
- return o && o < a ? o : a;
1071
- }) : [...r.splits] : t;
1072
- }, null);
1073
- }
1074
- function W({ message: e = "Loading..." }) {
1075
- return /* @__PURE__ */ n("div", { className: "pvx-loading", children: e });
1076
- }
1077
- function U({ message: e = "No data available." }) {
1078
- return /* @__PURE__ */ n("div", { className: "pvx-empty", children: /* @__PURE__ */ n("p", { children: e }) });
1079
- }
1080
- const Be = 3;
1081
- function j(e) {
1082
- if (!e) return !1;
1083
- if (e.closesAt) {
1084
- const t = new Date(e.closesAt).getTime();
1085
- if (!Number.isNaN(t)) return Date.now() >= t;
1086
- }
1087
- return !!e.isClosed;
1088
- }
1089
- function bn(e) {
1090
- const t = e == null ? void 0 : e.rounds;
1091
- return t != null && t.length ? e.type === "hotlap" ? t.every((r) => j(r)) : t.every((r) => r.isFinalized) : !1;
1092
- }
1093
- function yn(e) {
1094
- const t = e == null ? void 0 : e.rounds;
1095
- if (!(t != null && t.length)) return null;
1096
- let r = null;
1097
- for (const s of t) {
1098
- if (!s.startTime) continue;
1099
- const a = new Date(s.startTime);
1100
- isNaN(a) || (!r || a > r) && (r = a);
1101
- }
1102
- return r;
1103
- }
1104
- function Ie(e, t = Be) {
1105
- if (!bn(e)) return "active";
1106
- const r = yn(e);
1107
- if (!r) return "recently-completed";
1108
- const s = t * 24 * 60 * 60 * 1e3;
1109
- return Date.now() - r.getTime() <= s ? "recently-completed" : "archived";
1110
- }
1111
- function Ut(e, t, r = Be) {
1112
- if (!(e != null && e.length)) return [];
1113
- const s = new Set(Array.isArray(t) ? t : [t]);
1114
- return e.filter((a) => s.has(Ie(a, r)));
1115
- }
1116
- function kn(e, t = 3) {
1117
- const r = e == null ? void 0 : e.standings;
1118
- return Array.isArray(r) ? [...r].sort((s, a) => (s.position ?? 999) - (a.position ?? 999)).slice(0, t) : [];
1119
- }
1120
- function wn({ competitionId: e, topN: t = 3, label: r = "Completed", className: s }) {
1121
- const { data: a } = Le(e), i = kn(a, t);
1497
+ function On({ competitionId: e, topN: t = 3, label: r = "Completed", className: s }) {
1498
+ const { data: a } = De(e), o = En(a, t);
1122
1499
  return /* @__PURE__ */ l("div", { className: `pvx-comp-completed-badge ${s || ""}`, children: [
1123
1500
  /* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-label", children: r }),
1124
- i.length > 0 && /* @__PURE__ */ n("ol", { className: "pvx-comp-completed-badge-podium", children: i.map((o, d) => /* @__PURE__ */ l("li", { className: "pvx-comp-completed-badge-driver", children: [
1125
- /* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-medal", "aria-hidden": "true", children: he[d] || "" }),
1126
- /* @__PURE__ */ n(ne, { nation: o.nation }),
1127
- /* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-name", children: o.driverName })
1128
- ] }, o.driverId || d)) })
1501
+ o.length > 0 && /* @__PURE__ */ n("ol", { className: "pvx-comp-completed-badge-podium", children: o.map((i, d) => /* @__PURE__ */ l("li", { className: "pvx-comp-completed-badge-driver", children: [
1502
+ /* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-medal", "aria-hidden": "true", children: xe[d] || "" }),
1503
+ /* @__PURE__ */ n(ee, { nation: i.nation }),
1504
+ /* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-name", children: i.driverName })
1505
+ ] }, i.driverId || d)) })
1129
1506
  ] });
1130
1507
  }
1131
- const Cn = {
1508
+ const Gn = {
1132
1509
  GameModeSelectionWeatherType_CLEAR: "Clear",
1133
1510
  GameModeSelectionWeatherType_SCATTERED_CLOUDS: "Scattered Clouds",
1134
1511
  GameModeSelectionWeatherType_BROKEN_CLOUDS: "Broken Clouds",
@@ -1137,7 +1514,7 @@ const Cn = {
1137
1514
  GameModeSelectionWeatherType_DAMP: "Damp",
1138
1515
  GameModeSelectionWeatherType_RAIN: "Rain",
1139
1516
  GameModeSelectionWeatherType_HEAVY_RAIN: "Heavy Rain"
1140
- }, Sn = {
1517
+ }, zn = {
1141
1518
  viewBox: "0 0 24 24",
1142
1519
  fill: "none",
1143
1520
  stroke: "currentColor",
@@ -1145,7 +1522,7 @@ const Cn = {
1145
1522
  strokeLinecap: "round",
1146
1523
  strokeLinejoin: "round"
1147
1524
  };
1148
- function Ln() {
1525
+ function Qn() {
1149
1526
  return /* @__PURE__ */ l(B, { children: [
1150
1527
  /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "4" }),
1151
1528
  /* @__PURE__ */ n("path", { d: "M12 2v2" }),
@@ -1158,7 +1535,7 @@ function Ln() {
1158
1535
  /* @__PURE__ */ n("path", { d: "m19.07 4.93-1.41 1.41" })
1159
1536
  ] });
1160
1537
  }
1161
- function Rn() {
1538
+ function Yn() {
1162
1539
  return /* @__PURE__ */ l(B, { children: [
1163
1540
  /* @__PURE__ */ n("path", { d: "M12 2v2" }),
1164
1541
  /* @__PURE__ */ n("path", { d: "m4.93 4.93 1.41 1.41" }),
@@ -1168,16 +1545,16 @@ function Rn() {
1168
1545
  /* @__PURE__ */ n("path", { d: "M13 22H7a5 5 0 1 1 4.9-6H13a3 3 0 0 1 0 6Z" })
1169
1546
  ] });
1170
1547
  }
1171
- function Tn() {
1548
+ function Zn() {
1172
1549
  return /* @__PURE__ */ l(B, { children: [
1173
1550
  /* @__PURE__ */ n("path", { d: "M17.5 21H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z" }),
1174
1551
  /* @__PURE__ */ n("path", { d: "M22 10a3 3 0 0 0-3-3h-2.207a5.502 5.502 0 0 0-10.702.5" })
1175
1552
  ] });
1176
1553
  }
1177
- function $n() {
1554
+ function Jn() {
1178
1555
  return /* @__PURE__ */ n("path", { d: "M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z" });
1179
1556
  }
1180
- function Mn() {
1557
+ function Xn() {
1181
1558
  return /* @__PURE__ */ l(B, { children: [
1182
1559
  /* @__PURE__ */ n("path", { d: "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242" }),
1183
1560
  /* @__PURE__ */ n("path", { d: "M8 19v1" }),
@@ -1188,14 +1565,14 @@ function Mn() {
1188
1565
  /* @__PURE__ */ n("path", { d: "M12 16v1" })
1189
1566
  ] });
1190
1567
  }
1191
- function Dn() {
1568
+ function et() {
1192
1569
  return /* @__PURE__ */ l(B, { children: [
1193
1570
  /* @__PURE__ */ n("path", { d: "M16 17H7" }),
1194
1571
  /* @__PURE__ */ n("path", { d: "M17 21H9" }),
1195
1572
  /* @__PURE__ */ n("path", { d: "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242" })
1196
1573
  ] });
1197
1574
  }
1198
- function An() {
1575
+ function nt() {
1199
1576
  return /* @__PURE__ */ l(B, { children: [
1200
1577
  /* @__PURE__ */ n("path", { d: "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242" }),
1201
1578
  /* @__PURE__ */ n("path", { d: "M16 14v6" }),
@@ -1203,7 +1580,7 @@ function An() {
1203
1580
  /* @__PURE__ */ n("path", { d: "M12 16v6" })
1204
1581
  ] });
1205
1582
  }
1206
- function Pn() {
1583
+ function tt() {
1207
1584
  return /* @__PURE__ */ l(B, { children: [
1208
1585
  /* @__PURE__ */ n("path", { d: "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242" }),
1209
1586
  /* @__PURE__ */ n("path", { d: "m9.2 22 3-7" }),
@@ -1211,29 +1588,29 @@ function Pn() {
1211
1588
  /* @__PURE__ */ n("path", { d: "m17 13-3 7" })
1212
1589
  ] });
1213
1590
  }
1214
- const Bn = {
1215
- GameModeSelectionWeatherType_CLEAR: Ln,
1216
- GameModeSelectionWeatherType_SCATTERED_CLOUDS: Rn,
1217
- GameModeSelectionWeatherType_BROKEN_CLOUDS: Tn,
1218
- GameModeSelectionWeatherType_OVERCAST: $n,
1219
- GameModeSelectionWeatherType_DRIZZLE: Mn,
1220
- GameModeSelectionWeatherType_DAMP: Dn,
1221
- GameModeSelectionWeatherType_RAIN: An,
1222
- GameModeSelectionWeatherType_HEAVY_RAIN: Pn
1591
+ const rt = {
1592
+ GameModeSelectionWeatherType_CLEAR: Qn,
1593
+ GameModeSelectionWeatherType_SCATTERED_CLOUDS: Yn,
1594
+ GameModeSelectionWeatherType_BROKEN_CLOUDS: Zn,
1595
+ GameModeSelectionWeatherType_OVERCAST: Jn,
1596
+ GameModeSelectionWeatherType_DRIZZLE: Xn,
1597
+ GameModeSelectionWeatherType_DAMP: et,
1598
+ GameModeSelectionWeatherType_RAIN: nt,
1599
+ GameModeSelectionWeatherType_HEAVY_RAIN: tt
1223
1600
  };
1224
- function In({ weatherType: e, weatherBehaviour: t, className: r }) {
1225
- const s = e ? Bn[e] : null;
1601
+ function st({ weatherType: e, weatherBehaviour: t, className: r }) {
1602
+ const s = e ? rt[e] : null;
1226
1603
  if (!s) return null;
1227
- const a = Cn[e] || e, i = t === "GameModeSelectionWeatherBehaviour_DYNAMIC", o = i ? `${a} · Dynamic` : a;
1604
+ const a = Gn[e] || e, o = t === "GameModeSelectionWeatherBehaviour_DYNAMIC", i = o ? `${a} · Dynamic` : a;
1228
1605
  return /* @__PURE__ */ l(
1229
1606
  "span",
1230
1607
  {
1231
1608
  className: `pvx-weather-icon ${r || ""}`.trim(),
1232
- title: o,
1233
- "aria-label": o,
1609
+ title: i,
1610
+ "aria-label": i,
1234
1611
  children: [
1235
- /* @__PURE__ */ n("svg", { className: "pvx-weather-icon-main", ...Sn, children: /* @__PURE__ */ n(s, {}) }),
1236
- i && /* @__PURE__ */ n("span", { className: "pvx-weather-icon-dynamic", "aria-hidden": "true", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
1612
+ /* @__PURE__ */ n("svg", { className: "pvx-weather-icon-main", ...zn, children: /* @__PURE__ */ n(s, {}) }),
1613
+ o && /* @__PURE__ */ n("span", { className: "pvx-weather-icon-dynamic", "aria-hidden": "true", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
1237
1614
  /* @__PURE__ */ n("path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }),
1238
1615
  /* @__PURE__ */ n("path", { d: "M21 3v5h-5" }),
1239
1616
  /* @__PURE__ */ n("path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }),
@@ -1243,14 +1620,14 @@ function In({ weatherType: e, weatherBehaviour: t, className: r }) {
1243
1620
  }
1244
1621
  );
1245
1622
  }
1246
- function Ft({ competitions: e, isLoading: t, onSelect: r, onRegister: s, className: a }) {
1247
- return t ? /* @__PURE__ */ n(W, { message: "Loading competitions..." }) : e != null && e.length ? /* @__PURE__ */ n("div", { className: `pvx-comp-grid ${a || ""}`, children: e.map((i) => /* @__PURE__ */ n(En, { comp: i, onSelect: r, onRegister: s || r }, i.id)) }) : /* @__PURE__ */ n(U, { message: "No competitions available." });
1623
+ function dr({ competitions: e, isLoading: t, onSelect: r, onRegister: s, className: a }) {
1624
+ return t ? /* @__PURE__ */ n(W, { message: "Loading competitions..." }) : e != null && e.length ? /* @__PURE__ */ n("div", { className: `pvx-comp-grid ${a || ""}`, children: e.map((o) => /* @__PURE__ */ n(at, { comp: o, onSelect: r, onRegister: s || r }, o.id)) }) : /* @__PURE__ */ n(_, { message: "No competitions available." });
1248
1625
  }
1249
- function En({ comp: e, onSelect: t, onRegister: r }) {
1250
- var P, N, S, y, A;
1251
- const { cdnUrl: s } = L(), a = e.posterCdnPath ? `${s}/${e.posterCdnPath}` : null, i = e.registration, o = (i == null ? void 0 : i.currentCount) || 0, d = i == null ? void 0 : i.maxParticipants, p = d && o >= d, c = (i == null ? void 0 : i.deadline) && new Date(i.deadline) < /* @__PURE__ */ new Date(), u = (i == null ? void 0 : i.isOpen) && !c && !p, v = /* @__PURE__ */ new Date(), f = (P = e.rounds) == null ? void 0 : P.find(
1252
- (R) => R.startTime && new Date(R.startTime) <= v && !j(R)
1253
- ), h = f || ((N = e.rounds) == null ? void 0 : N.find((R) => R.startTime && new Date(R.startTime) >= v)), k = !!f, m = ((S = e.rounds) == null ? void 0 : S.length) || 0, g = e.type === "hotlap", b = g && m > 1, x = g ? ((y = e.rounds) == null ? void 0 : y.filter(j).length) || 0 : ((A = e.rounds) == null ? void 0 : A.filter((R) => R.isFinalized).length) || 0, w = Ie(e), C = w === "recently-completed" || w === "archived", M = e.type === "championship";
1626
+ function at({ comp: e, onSelect: t, onRegister: r }) {
1627
+ var A, N, L, w, D;
1628
+ const { cdnUrl: s } = S(), a = e.posterCdnPath ? `${s}/${e.posterCdnPath}` : null, o = e.registration, i = (o == null ? void 0 : o.currentCount) || 0, d = o == null ? void 0 : o.maxParticipants, p = d && i >= d, c = (o == null ? void 0 : o.deadline) && new Date(o.deadline) < /* @__PURE__ */ new Date(), u = (o == null ? void 0 : o.isOpen) && !c && !p, v = /* @__PURE__ */ new Date(), f = (A = e.rounds) == null ? void 0 : A.find(
1629
+ ($) => $.startTime && new Date($.startTime) <= v && !O($)
1630
+ ), h = f || ((N = e.rounds) == null ? void 0 : N.find(($) => $.startTime && new Date($.startTime) >= v)), y = !!f, x = ((L = e.rounds) == null ? void 0 : L.length) || 0, m = e.type === "hotlap", b = m && x > 1, g = m ? ((w = e.rounds) == null ? void 0 : w.filter(O).length) || 0 : ((D = e.rounds) == null ? void 0 : D.filter(($) => $.isFinalized).length) || 0, k = _e(e), C = k === "recently-completed" || k === "archived", P = e.type === "championship";
1254
1631
  return /* @__PURE__ */ l(
1255
1632
  "div",
1256
1633
  {
@@ -1258,59 +1635,59 @@ function En({ comp: e, onSelect: t, onRegister: r }) {
1258
1635
  onClick: () => t(e.id),
1259
1636
  role: "button",
1260
1637
  tabIndex: 0,
1261
- onKeyDown: (R) => {
1262
- (R.key === "Enter" || R.key === " ") && (R.preventDefault(), t(e.id));
1638
+ onKeyDown: ($) => {
1639
+ ($.key === "Enter" || $.key === " ") && ($.preventDefault(), t(e.id));
1263
1640
  },
1264
1641
  children: [
1265
- /* @__PURE__ */ n("div", { className: "pvx-comp-card-poster", children: a ? /* @__PURE__ */ n("img", { src: a, alt: e.name, className: "pvx-comp-card-poster-img" }) : /* @__PURE__ */ n("div", { className: "pvx-comp-card-poster-placeholder", children: /* @__PURE__ */ n(Un, {}) }) }),
1642
+ /* @__PURE__ */ n("div", { className: "pvx-comp-card-poster", children: a ? /* @__PURE__ */ n("img", { src: a, alt: e.name, className: "pvx-comp-card-poster-img" }) : /* @__PURE__ */ n("div", { className: "pvx-comp-card-poster-placeholder", children: /* @__PURE__ */ n(ot, {}) }) }),
1266
1643
  /* @__PURE__ */ l("div", { className: "pvx-comp-card-body", children: [
1267
1644
  /* @__PURE__ */ n("h3", { className: "pvx-comp-card-title", children: e.name }),
1268
1645
  e.description && /* @__PURE__ */ n("p", { className: "pvx-comp-card-desc", children: e.description }),
1269
1646
  /* @__PURE__ */ l("div", { className: "pvx-comp-card-pills", children: [
1270
- /* @__PURE__ */ n(gn, { type: e.type }),
1271
- e.game && /* @__PURE__ */ n(re, { children: e.game.toUpperCase() }),
1272
- e.formatDescription && e.formatDescription.split(", ").map((R, H) => /* @__PURE__ */ n(re, { variant: "format", children: R }, H))
1647
+ /* @__PURE__ */ n(Rn, { type: e.type }),
1648
+ e.game && /* @__PURE__ */ n(ae, { children: e.game.toUpperCase() }),
1649
+ e.formatDescription && e.formatDescription.split(", ").map(($, j) => /* @__PURE__ */ n(ae, { variant: "format", children: $ }, j))
1273
1650
  ] }),
1274
- e.carsDescription && /* @__PURE__ */ n("div", { className: "pvx-comp-card-pills", children: e.carsDescription.split(", ").map((R, H) => /* @__PURE__ */ n(re, { children: R }, H)) }),
1651
+ e.carsDescription && /* @__PURE__ */ n("div", { className: "pvx-comp-card-pills", children: e.carsDescription.split(", ").map(($, j) => /* @__PURE__ */ n(ae, { children: $ }, j)) }),
1275
1652
  /* @__PURE__ */ l("div", { className: "pvx-comp-card-schedule", children: [
1276
1653
  h ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
1277
- /* @__PURE__ */ n("span", { className: "pvx-comp-card-schedule-label", children: k ? "Live:" : "Next:" }),
1654
+ /* @__PURE__ */ n("span", { className: "pvx-comp-card-schedule-label", children: y ? "Live:" : "Next:" }),
1278
1655
  " ",
1279
1656
  (e.type !== "hotlap" || b) && `R${h.roundNumber} `,
1280
1657
  h.track || "TBD",
1281
1658
  " · ",
1282
- fn(h.startTime),
1659
+ Mn(h.startTime),
1283
1660
  (h.weatherType || e.weatherType) && /* @__PURE__ */ l(B, { children: [
1284
1661
  " ",
1285
1662
  /* @__PURE__ */ n(
1286
- In,
1663
+ st,
1287
1664
  {
1288
1665
  weatherType: h.weatherType || e.weatherType,
1289
1666
  weatherBehaviour: h.weatherBehaviour || e.weatherBehaviour
1290
1667
  }
1291
1668
  )
1292
1669
  ] })
1293
- ] }) : m > 0 ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
1294
- x,
1670
+ ] }) : x > 0 ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
1671
+ g,
1295
1672
  "/",
1296
- m,
1673
+ x,
1297
1674
  " rounds completed"
1298
1675
  ] }) : null,
1299
- m > 0 && /* @__PURE__ */ l("span", { className: "pvx-comp-card-round-count", children: [
1300
- m,
1676
+ x > 0 && /* @__PURE__ */ l("span", { className: "pvx-comp-card-round-count", children: [
1677
+ x,
1301
1678
  " round",
1302
- m !== 1 ? "s" : ""
1679
+ x !== 1 ? "s" : ""
1303
1680
  ] })
1304
1681
  ] }),
1305
- C && (M || b) && /* @__PURE__ */ n(wn, { competitionId: e.id }),
1306
- i && !C && /* @__PURE__ */ n(
1307
- _n,
1682
+ C && (P || b) && /* @__PURE__ */ n(On, { competitionId: e.id }),
1683
+ o && !C && /* @__PURE__ */ n(
1684
+ it,
1308
1685
  {
1309
1686
  competitionId: e.id,
1310
1687
  regOpen: u,
1311
1688
  isFull: p,
1312
1689
  deadlinePassed: c,
1313
- regCount: o,
1690
+ regCount: i,
1314
1691
  regMax: d,
1315
1692
  onRegister: r
1316
1693
  }
@@ -1320,13 +1697,13 @@ function En({ comp: e, onSelect: t, onRegister: r }) {
1320
1697
  }
1321
1698
  );
1322
1699
  }
1323
- function _n({ competitionId: e, regOpen: t, isFull: r, deadlinePassed: s, regCount: a, regMax: i, onRegister: o }) {
1324
- const { isPowerMode: d } = ce(), p = de(e), { data: c } = le(e), u = (c == null ? void 0 : c.isRegistered) || !1, v = i ? a / i * 100 : 0, f = v >= 100 ? "full" : v >= 75 ? "warning" : "ok";
1700
+ function it({ competitionId: e, regOpen: t, isFull: r, deadlinePassed: s, regCount: a, regMax: o, onRegister: i }) {
1701
+ const { isPowerMode: d } = me(), p = ve(e), { data: c } = he(e), u = (c == null ? void 0 : c.isRegistered) || !1, v = o ? a / o * 100 : 0, f = v >= 100 ? "full" : v >= 75 ? "warning" : "ok";
1325
1702
  return /* @__PURE__ */ l("div", { className: "pvx-comp-card-reg", children: [
1326
1703
  /* @__PURE__ */ n("div", { className: "pvx-comp-card-reg-info", children: /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${f}`, children: [
1327
1704
  a,
1328
1705
  "/",
1329
- i || "∞",
1706
+ o || "∞",
1330
1707
  " drivers"
1331
1708
  ] }) }),
1332
1709
  /* @__PURE__ */ n("div", { className: "pvx-comp-card-reg-action", children: u ? /* @__PURE__ */ n(
@@ -1334,7 +1711,7 @@ function _n({ competitionId: e, regOpen: t, isFull: r, deadlinePassed: s, regCou
1334
1711
  {
1335
1712
  className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--registered",
1336
1713
  onClick: (h) => {
1337
- h.stopPropagation(), o(e);
1714
+ h.stopPropagation(), i(e);
1338
1715
  },
1339
1716
  children: "✓ Registered"
1340
1717
  }
@@ -1343,7 +1720,7 @@ function _n({ competitionId: e, regOpen: t, isFull: r, deadlinePassed: s, regCou
1343
1720
  {
1344
1721
  className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--open",
1345
1722
  onClick: (h) => {
1346
- h.stopPropagation(), o(e);
1723
+ h.stopPropagation(), i(e);
1347
1724
  },
1348
1725
  children: "Register"
1349
1726
  }
@@ -1360,7 +1737,7 @@ function _n({ competitionId: e, regOpen: t, isFull: r, deadlinePassed: s, regCou
1360
1737
  ) : /* @__PURE__ */ n("span", { className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--closed", children: r ? "Full" : "Closed" }) })
1361
1738
  ] });
1362
1739
  }
1363
- function Un() {
1740
+ function ot() {
1364
1741
  return /* @__PURE__ */ l("svg", { className: "pvx-comp-trophy-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
1365
1742
  /* @__PURE__ */ n("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
1366
1743
  /* @__PURE__ */ n("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
@@ -1370,23 +1747,23 @@ function Un() {
1370
1747
  /* @__PURE__ */ n("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
1371
1748
  ] });
1372
1749
  }
1373
- function Fn({ competitionId: e, className: t }) {
1750
+ function lt({ competitionId: e, className: t }) {
1374
1751
  var c, u, v;
1375
- const { data: r, isLoading: s } = Le(e), { data: a, isLoading: i } = Se(e);
1376
- if (s || i)
1752
+ const { data: r, isLoading: s } = De(e), { data: a, isLoading: o } = Pe(e);
1753
+ if (s || o)
1377
1754
  return /* @__PURE__ */ n(W, { message: "Loading standings..." });
1378
1755
  if (!((c = r == null ? void 0 : r.standings) != null && c.length))
1379
- return /* @__PURE__ */ n(U, { message: "No standings data yet. Results will appear once rounds are finalised." });
1380
- const o = (a == null ? void 0 : a.type) === "hotlap", d = o ? ((u = a == null ? void 0 : a.rounds) == null ? void 0 : u.filter(j)) || [] : ((v = a == null ? void 0 : a.rounds) == null ? void 0 : v.filter((f) => f.isFinalized)) || [], p = r.roundsClosed ?? r.roundsCompleted ?? 0;
1756
+ return /* @__PURE__ */ n(_, { message: "No standings data yet. Results will appear once rounds are finalised." });
1757
+ const i = (a == null ? void 0 : a.type) === "hotlap", d = i ? ((u = a == null ? void 0 : a.rounds) == null ? void 0 : u.filter(O)) || [] : ((v = a == null ? void 0 : a.rounds) == null ? void 0 : v.filter((f) => f.isFinalized)) || [], p = r.roundsClosed ?? r.roundsCompleted ?? 0;
1381
1758
  return /* @__PURE__ */ l("div", { className: `pvx-card ${t || ""}`, children: [
1382
1759
  /* @__PURE__ */ n("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
1383
- /* @__PURE__ */ n("h3", { className: "pvx-card-title", children: o ? "Overall Standings" : "Championship Standings" }),
1760
+ /* @__PURE__ */ n("h3", { className: "pvx-card-title", children: i ? "Overall Standings" : "Championship Standings" }),
1384
1761
  /* @__PURE__ */ l("span", { className: "pvx-standings-subtitle", children: [
1385
1762
  "After ",
1386
1763
  p,
1387
1764
  " round",
1388
1765
  p !== 1 ? "s" : "",
1389
- o ? " closed" : "",
1766
+ i ? " closed" : "",
1390
1767
  r.countingRounds > 0 && ` (best ${r.countingRounds} count)`
1391
1768
  ] })
1392
1769
  ] }) }),
@@ -1411,7 +1788,7 @@ function Fn({ competitionId: e, className: t }) {
1411
1788
  ))
1412
1789
  ] }) }),
1413
1790
  /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: r.standings.map((f) => /* @__PURE__ */ n(
1414
- qn,
1791
+ ct,
1415
1792
  {
1416
1793
  driver: f,
1417
1794
  columnRounds: d
@@ -1421,19 +1798,19 @@ function Fn({ competitionId: e, className: t }) {
1421
1798
  ] }) })
1422
1799
  ] });
1423
1800
  }
1424
- function qn({ driver: e, columnRounds: t }) {
1425
- var o, d, p;
1801
+ function ct({ driver: e, columnRounds: t }) {
1802
+ var i, d, p;
1426
1803
  const r = e.position <= 3, s = new Map(
1427
- ((o = e.roundResults) == null ? void 0 : o.map((c) => [c.roundNumber, c])) || []
1428
- ), a = ((d = e.roundResults) == null ? void 0 : d.filter((c) => c.position === 1).length) || 0, i = ((p = e.roundResults) == null ? void 0 : p.filter((c) => c.position <= 3).length) || 0;
1804
+ ((i = e.roundResults) == null ? void 0 : i.map((c) => [c.roundNumber, c])) || []
1805
+ ), a = ((d = e.roundResults) == null ? void 0 : d.filter((c) => c.position === 1).length) || 0, o = ((p = e.roundResults) == null ? void 0 : p.filter((c) => c.position <= 3).length) || 0;
1429
1806
  return /* @__PURE__ */ l("tr", { className: `pvx-row ${r ? "pvx-row--podium" : ""}`, children: [
1430
- /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(me, { position: e.position }) }),
1807
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(ge, { position: e.position }) }),
1431
1808
  /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
1432
- /* @__PURE__ */ n(ne, { nation: e.nation }),
1809
+ /* @__PURE__ */ n(ee, { nation: e.nation }),
1433
1810
  e.driverName
1434
1811
  ] }),
1435
1812
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: a || "-" }),
1436
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: i || "-" }),
1813
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: o || "-" }),
1437
1814
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-standings-total", children: e.totalPoints }),
1438
1815
  t.map((c) => {
1439
1816
  const u = s.get(c.roundNumber), v = u == null ? void 0 : u.dropped;
@@ -1454,7 +1831,7 @@ function qn({ driver: e, columnRounds: t }) {
1454
1831
  })
1455
1832
  ] });
1456
1833
  }
1457
- const fe = [
1834
+ const Ce = [
1458
1835
  "#f59e0b",
1459
1836
  "#3b82f6",
1460
1837
  "#ef4444",
@@ -1480,109 +1857,109 @@ const fe = [
1480
1857
  "#f87171",
1481
1858
  "#38bdf8"
1482
1859
  ];
1483
- function Hn(e, t) {
1860
+ function dt(e, t) {
1484
1861
  return e.map((r) => ({
1485
1862
  driverName: r.driverName,
1486
1863
  carClass: r.carClass,
1487
1864
  positions: r.positions.map((s, a) => {
1488
- const o = e.filter((d) => d.positions[a] != null).sort((d, p) => d.positions[a] - p.positions[a]).findIndex((d) => d.driverName === r.driverName);
1489
- return o === -1 ? null : o + 1;
1865
+ const i = e.filter((d) => d.positions[a] != null).sort((d, p) => d.positions[a] - p.positions[a]).findIndex((d) => d.driverName === r.driverName);
1866
+ return i === -1 ? null : i + 1;
1490
1867
  })
1491
1868
  }));
1492
1869
  }
1493
- function jn({ title: e, drivers: t, timingPoints: r }) {
1494
- const [s, a] = E(() => /* @__PURE__ */ new Set()), i = K((N) => {
1495
- a((S) => {
1496
- const y = new Set(S);
1497
- return y.has(N) ? y.delete(N) : y.add(N), y;
1870
+ function pt({ title: e, drivers: t, timingPoints: r }) {
1871
+ const [s, a] = E(() => /* @__PURE__ */ new Set()), o = H((N) => {
1872
+ a((L) => {
1873
+ const w = new Set(L);
1874
+ return w.has(N) ? w.delete(N) : w.add(N), w;
1498
1875
  });
1499
- }, []), { series: o, maxPos: d } = T(() => {
1876
+ }, []), { series: i, maxPos: d } = T(() => {
1500
1877
  let N = 1;
1501
- return { series: t.map((y, A) => {
1502
- for (const R of y.positions) R != null && R > N && (N = R);
1503
- return { ...y, colour: fe[A % fe.length] };
1878
+ return { series: t.map((w, D) => {
1879
+ for (const $ of w.positions) $ != null && $ > N && (N = $);
1880
+ return { ...w, colour: Ce[D % Ce.length] };
1504
1881
  }), maxPos: N };
1505
1882
  }, [t]);
1506
- if (!o.length || r.length < 2)
1883
+ if (!i.length || r.length < 2)
1507
1884
  return /* @__PURE__ */ l("div", { className: "pvx-positions-empty", children: [
1508
1885
  "No position data for ",
1509
1886
  e || "this race",
1510
1887
  "."
1511
1888
  ] });
1512
- const p = 800, c = 34, u = 12, v = 12, f = 22, h = 34, k = p - c - u, m = Math.max(f * (d - 1), f), g = v + m + h, b = r.length, x = (N) => c + (b === 1 ? 0 : N / (b - 1) * k), w = (N) => v + (d === 1 ? 0 : (N - 1) / (d - 1) * m), C = (N) => {
1513
- const S = [];
1514
- let y = [];
1515
- return N.forEach((A, R) => {
1516
- A == null ? y.length && (S.push(y), y = []) : y.push([x(R), w(A)]);
1517
- }), y.length && S.push(y), S;
1518
- }, M = s.size > 0, P = Math.ceil(b / 24);
1889
+ const p = 800, c = 34, u = 12, v = 12, f = 22, h = 34, y = p - c - u, x = Math.max(f * (d - 1), f), m = v + x + h, b = r.length, g = (N) => c + (b === 1 ? 0 : N / (b - 1) * y), k = (N) => v + (d === 1 ? 0 : (N - 1) / (d - 1) * x), C = (N) => {
1890
+ const L = [];
1891
+ let w = [];
1892
+ return N.forEach((D, $) => {
1893
+ D == null ? w.length && (L.push(w), w = []) : w.push([g($), k(D)]);
1894
+ }), w.length && L.push(w), L;
1895
+ }, P = s.size > 0, A = Math.ceil(b / 24);
1519
1896
  return /* @__PURE__ */ l("div", { className: "pvx-positions-chart", children: [
1520
1897
  e && /* @__PURE__ */ n("div", { className: "pvx-positions-title", children: e }),
1521
1898
  /* @__PURE__ */ l(
1522
1899
  "svg",
1523
1900
  {
1524
1901
  className: "pvx-positions-svg",
1525
- viewBox: `0 0 ${p} ${g}`,
1902
+ viewBox: `0 0 ${p} ${m}`,
1526
1903
  preserveAspectRatio: "xMidYMid meet",
1527
1904
  role: "img",
1528
1905
  "aria-label": `Race position progression${e ? ` — ${e}` : ""}`,
1529
1906
  children: [
1530
- Array.from({ length: d }, (N, S) => S + 1).map((N) => /* @__PURE__ */ l("g", { children: [
1907
+ Array.from({ length: d }, (N, L) => L + 1).map((N) => /* @__PURE__ */ l("g", { children: [
1531
1908
  /* @__PURE__ */ n(
1532
1909
  "line",
1533
1910
  {
1534
1911
  className: "pvx-positions-grid",
1535
1912
  x1: c,
1536
- y1: w(N),
1913
+ y1: k(N),
1537
1914
  x2: p - u,
1538
- y2: w(N)
1915
+ y2: k(N)
1539
1916
  }
1540
1917
  ),
1541
- /* @__PURE__ */ l("text", { className: "pvx-positions-axis", x: c - 6, y: w(N) + 3, textAnchor: "end", children: [
1918
+ /* @__PURE__ */ l("text", { className: "pvx-positions-axis", x: c - 6, y: k(N) + 3, textAnchor: "end", children: [
1542
1919
  "P",
1543
1920
  N
1544
1921
  ] })
1545
1922
  ] }, `y${N}`)),
1546
- r.map((N, S) => S % P === 0 && /* @__PURE__ */ n(
1923
+ r.map((N, L) => L % A === 0 && /* @__PURE__ */ n(
1547
1924
  "text",
1548
1925
  {
1549
1926
  className: "pvx-positions-axis",
1550
- x: x(S),
1551
- y: g - h + 16,
1927
+ x: g(L),
1928
+ y: m - h + 16,
1552
1929
  textAnchor: "middle",
1553
1930
  children: N.label
1554
1931
  },
1555
- `x${S}`
1932
+ `x${L}`
1556
1933
  )),
1557
- o.map((N) => {
1558
- const S = M && !s.has(N.driverName);
1559
- return /* @__PURE__ */ l("g", { opacity: S ? 0.12 : 1, children: [
1560
- C(N.positions).map((y, A) => /* @__PURE__ */ n(
1934
+ i.map((N) => {
1935
+ const L = P && !s.has(N.driverName);
1936
+ return /* @__PURE__ */ l("g", { opacity: L ? 0.12 : 1, children: [
1937
+ C(N.positions).map((w, D) => /* @__PURE__ */ n(
1561
1938
  "polyline",
1562
1939
  {
1563
1940
  fill: "none",
1564
1941
  stroke: N.colour,
1565
- strokeWidth: S ? 1 : 2,
1566
- points: y.map(([R, H]) => `${R},${H}`).join(" ")
1942
+ strokeWidth: L ? 1 : 2,
1943
+ points: w.map(([$, j]) => `${$},${j}`).join(" ")
1567
1944
  },
1568
- A
1945
+ D
1569
1946
  )),
1570
- !S && N.positions.map((y, A) => y != null && /* @__PURE__ */ n("circle", { cx: x(A), cy: w(y), r: 2.4, fill: N.colour, children: /* @__PURE__ */ n("title", { children: `${N.driverName} — ${r[A].label}: P${y}` }) }, A))
1947
+ !L && N.positions.map((w, D) => w != null && /* @__PURE__ */ n("circle", { cx: g(D), cy: k(w), r: 2.4, fill: N.colour, children: /* @__PURE__ */ n("title", { children: `${N.driverName} — ${r[D].label}: P${w}` }) }, D))
1571
1948
  ] }, N.driverName);
1572
1949
  })
1573
1950
  ]
1574
1951
  }
1575
1952
  ),
1576
1953
  /* @__PURE__ */ l("div", { className: "pvx-positions-legend", children: [
1577
- o.map((N) => {
1578
- const S = M && !s.has(N.driverName);
1954
+ i.map((N) => {
1955
+ const L = P && !s.has(N.driverName);
1579
1956
  return /* @__PURE__ */ l(
1580
1957
  "button",
1581
1958
  {
1582
1959
  type: "button",
1583
1960
  className: "pvx-positions-legend-item",
1584
- style: { opacity: S ? 0.4 : 1 },
1585
- onClick: () => i(N.driverName),
1961
+ style: { opacity: L ? 0.4 : 1 },
1962
+ onClick: () => o(N.driverName),
1586
1963
  children: [
1587
1964
  /* @__PURE__ */ n("span", { className: "pvx-positions-swatch", style: { background: N.colour } }),
1588
1965
  N.driverName
@@ -1591,7 +1968,7 @@ function jn({ title: e, drivers: t, timingPoints: r }) {
1591
1968
  N.driverName
1592
1969
  );
1593
1970
  }),
1594
- M && /* @__PURE__ */ n(
1971
+ P && /* @__PURE__ */ n(
1595
1972
  "button",
1596
1973
  {
1597
1974
  type: "button",
@@ -1603,35 +1980,35 @@ function jn({ title: e, drivers: t, timingPoints: r }) {
1603
1980
  ] })
1604
1981
  ] });
1605
1982
  }
1606
- function Vn({ positions: e }) {
1983
+ function ut({ positions: e }) {
1607
1984
  const t = (e == null ? void 0 : e.timingPoints) || [], r = (e == null ? void 0 : e.drivers) || [], s = T(() => {
1608
- const a = [...new Set(r.map((i) => i.carClass).filter(Boolean))];
1609
- return a.length <= 1 ? [{ title: a[0] || null, drivers: r }] : a.sort().map((i) => ({
1610
- title: i,
1611
- drivers: Hn(
1612
- r.filter((o) => o.carClass === i),
1985
+ const a = [...new Set(r.map((o) => o.carClass).filter(Boolean))];
1986
+ return a.length <= 1 ? [{ title: a[0] || null, drivers: r }] : a.sort().map((o) => ({
1987
+ title: o,
1988
+ drivers: dt(
1989
+ r.filter((i) => i.carClass === o),
1613
1990
  t.length
1614
1991
  )
1615
1992
  }));
1616
1993
  }, [r, t.length]);
1617
- return !t.length || !r.length ? /* @__PURE__ */ n("div", { className: "pvx-positions-empty", children: "No position data available for this race." }) : /* @__PURE__ */ n("div", { className: "pvx-positions", children: s.map((a, i) => /* @__PURE__ */ n(
1618
- jn,
1994
+ return !t.length || !r.length ? /* @__PURE__ */ n("div", { className: "pvx-positions-empty", children: "No position data available for this race." }) : /* @__PURE__ */ n("div", { className: "pvx-positions", children: s.map((a, o) => /* @__PURE__ */ n(
1995
+ pt,
1619
1996
  {
1620
1997
  title: s.length > 1 ? a.title : null,
1621
1998
  drivers: a.drivers,
1622
1999
  timingPoints: t
1623
2000
  },
1624
- a.title || i
2001
+ a.title || o
1625
2002
  )) });
1626
2003
  }
1627
- function qt({ competitionId: e, roundNumber: t, className: r }) {
2004
+ function pr({ competitionId: e, roundNumber: t, className: r }) {
1628
2005
  var p;
1629
- const { data: s, isLoading: a } = nn(e, t);
2006
+ const { data: s, isLoading: a } = dn(e, t);
1630
2007
  if (a)
1631
2008
  return /* @__PURE__ */ n(W, { message: "Loading results..." });
1632
2009
  if (!s)
1633
- return /* @__PURE__ */ n(U, { message: "No results for this round." });
1634
- const o = (s.sessions || []).find((c) => c.type === "RACE"), d = (p = o == null ? void 0 : o.results) == null ? void 0 : p.filter((c) => c.position <= 3).sort((c, u) => c.position - u.position);
2010
+ return /* @__PURE__ */ n(_, { message: "No results for this round." });
2011
+ const i = (s.sessions || []).find((c) => c.type === "RACE"), d = (p = i == null ? void 0 : i.results) == null ? void 0 : p.filter((c) => c.position <= 3).sort((c, u) => c.position - u.position);
1635
2012
  return /* @__PURE__ */ l("div", { className: `pvx-round-results ${r || ""}`, children: [
1636
2013
  /* @__PURE__ */ l("div", { className: "pvx-round-results-header", children: [
1637
2014
  /* @__PURE__ */ l("div", { children: [
@@ -1647,64 +2024,64 @@ function qt({ competitionId: e, roundNumber: t, className: r }) {
1647
2024
  }) })
1648
2025
  ] }),
1649
2026
  (d == null ? void 0 : d.length) > 0 && /* @__PURE__ */ n("div", { className: "pvx-round-podium-summary", children: d.map((c) => /* @__PURE__ */ l("span", { className: "pvx-round-podium-item", children: [
1650
- /* @__PURE__ */ n("span", { children: he[c.position - 1] }),
2027
+ /* @__PURE__ */ n("span", { children: xe[c.position - 1] }),
1651
2028
  /* @__PURE__ */ n("span", { children: c.driverName })
1652
2029
  ] }, c.driverId)) })
1653
2030
  ] }),
1654
- /* @__PURE__ */ n(ve, { round: s, competitionId: e })
2031
+ /* @__PURE__ */ n(ye, { round: s, competitionId: e })
1655
2032
  ] });
1656
2033
  }
1657
- function ve({ round: e, competitionId: t, className: r }) {
1658
- var h, k, m, g, b, x;
1659
- const [s, a] = E(null), i = (e == null ? void 0 : e.sessions) || [];
1660
- if (!i.length)
1661
- return /* @__PURE__ */ n(U, { message: "No session data for this round." });
1662
- const { data: o } = an(
2034
+ function ye({ round: e, competitionId: t, className: r }) {
2035
+ var h, y, x, m, b, g;
2036
+ const [s, a] = E(null), o = (e == null ? void 0 : e.sessions) || [];
2037
+ if (!o.length)
2038
+ return /* @__PURE__ */ n(_, { message: "No session data for this round." });
2039
+ const { data: i } = mn(
1663
2040
  t,
1664
2041
  e == null ? void 0 : e.roundNumber,
1665
2042
  {}
1666
- ), d = i.some((w) => w.type === "RACE"), { data: p } = on(
2043
+ ), d = o.some((k) => k.type === "RACE"), { data: p } = vn(
1667
2044
  t,
1668
2045
  e == null ? void 0 : e.roundNumber,
1669
2046
  { enabled: !!t && d }
1670
- ), c = s || ((h = i.find((w) => w.type === "RACE")) == null ? void 0 : h.type) || ((k = i[0]) == null ? void 0 : k.type), u = i.find((w) => w.type === c) || i[0], v = ((g = (m = o == null ? void 0 : o.sessions) == null ? void 0 : m.find((w) => w.type === c)) == null ? void 0 : g.drivers) || null, f = (u == null ? void 0 : u.type) === "RACE" && ((b = p == null ? void 0 : p.timingPoints) == null ? void 0 : b.length) > 0 && ((x = p == null ? void 0 : p.drivers) == null ? void 0 : x.length) > 0;
2047
+ ), c = s || ((h = o.find((k) => k.type === "RACE")) == null ? void 0 : h.type) || ((y = o[0]) == null ? void 0 : y.type), u = o.find((k) => k.type === c) || o[0], v = ((m = (x = i == null ? void 0 : i.sessions) == null ? void 0 : x.find((k) => k.type === c)) == null ? void 0 : m.drivers) || null, f = (u == null ? void 0 : u.type) === "RACE" && ((b = p == null ? void 0 : p.timingPoints) == null ? void 0 : b.length) > 0 && ((g = p == null ? void 0 : p.drivers) == null ? void 0 : g.length) > 0;
1671
2048
  return /* @__PURE__ */ l("div", { className: r || "", children: [
1672
2049
  /* @__PURE__ */ n(
1673
- xn,
2050
+ Tn,
1674
2051
  {
1675
- sessions: i,
2052
+ sessions: o,
1676
2053
  activeSession: c,
1677
2054
  onSelect: a
1678
2055
  }
1679
2056
  ),
1680
- /* @__PURE__ */ n(Wn, { session: u, sessionLaps: v }),
2057
+ /* @__PURE__ */ n(ht, { session: u, sessionLaps: v }),
1681
2058
  f && /* @__PURE__ */ l("div", { className: "pvx-positions-section", children: [
1682
2059
  /* @__PURE__ */ n("div", { className: "pvx-positions-section-title", children: "Race Positions" }),
1683
- /* @__PURE__ */ n(Vn, { positions: p })
2060
+ /* @__PURE__ */ n(ut, { positions: p })
1684
2061
  ] })
1685
2062
  ] });
1686
2063
  }
1687
- function Wn({ session: e, sessionLaps: t }) {
2064
+ function ht({ session: e, sessionLaps: t }) {
1688
2065
  var u;
1689
2066
  const r = e.type === "RACE", [s, a] = E(null);
1690
2067
  if (!((u = e.results) != null && u.length))
1691
- return /* @__PURE__ */ n(U, { message: `No results for ${e.type}.` });
1692
- const i = Nn(e.results), o = r ? 7 : 4, d = [...new Set(e.results.map((v) => v.carClass).filter(Boolean))], p = d.length > 1, c = (v, f, h) => {
1693
- var g;
1694
- const k = (g = t == null ? void 0 : t[v.driverId]) == null ? void 0 : g.laps, m = s === v.driverId && !!k;
2068
+ return /* @__PURE__ */ n(_, { message: `No results for ${e.type}.` });
2069
+ const o = Pn(e.results), i = r ? 7 : 4, d = [...new Set(e.results.map((v) => v.carClass).filter(Boolean))], p = d.length > 1, c = (v, f, h) => {
2070
+ var m;
2071
+ const y = (m = t == null ? void 0 : t[v.driverId]) == null ? void 0 : m.laps, x = s === v.driverId && !!y;
1695
2072
  return /* @__PURE__ */ n(
1696
- Kn,
2073
+ mt,
1697
2074
  {
1698
2075
  result: v,
1699
2076
  isRace: r,
1700
- fastestSplits: i,
2077
+ fastestSplits: o,
1701
2078
  rowIndex: f,
1702
2079
  displayPosition: h,
1703
- hasLapDetail: !!k,
1704
- isExpanded: m,
1705
- onToggle: () => a(m ? null : v.driverId),
1706
- driverLaps: m ? k : null,
1707
- colCount: o
2080
+ hasLapDetail: !!y,
2081
+ isExpanded: x,
2082
+ onToggle: () => a(x ? null : v.driverId),
2083
+ driverLaps: x ? y : null,
2084
+ colCount: i
1708
2085
  },
1709
2086
  v.driverId || f
1710
2087
  );
@@ -1722,29 +2099,29 @@ function Wn({ session: e, sessionLaps: t }) {
1722
2099
  ] })
1723
2100
  ] }) }),
1724
2101
  /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: p ? d.sort().map((v) => {
1725
- const f = e.results.filter((h) => h.carClass === v).sort((h, k) => (h.classPosition ?? h.position) - (k.classPosition ?? k.position));
2102
+ const f = e.results.filter((h) => h.carClass === v).sort((h, y) => (h.classPosition ?? h.position) - (y.classPosition ?? y.position));
1726
2103
  return [
1727
- /* @__PURE__ */ n("tr", { className: "pvx-row pvx-row--class-header", children: /* @__PURE__ */ n("td", { colSpan: o, className: "pvx-td pvx-td--class-header", children: v }) }, `hdr-${v}`),
2104
+ /* @__PURE__ */ n("tr", { className: "pvx-row pvx-row--class-header", children: /* @__PURE__ */ n("td", { colSpan: i, className: "pvx-td pvx-td--class-header", children: v }) }, `hdr-${v}`),
1728
2105
  ...f.map(
1729
- (h, k) => c(h, k, h.classPosition ?? h.position)
2106
+ (h, y) => c(h, y, h.classPosition ?? h.position)
1730
2107
  )
1731
2108
  ];
1732
2109
  }) : e.results.map((v, f) => c(v, f)) })
1733
2110
  ] }) });
1734
2111
  }
1735
- function Kn({ result: e, isRace: t, fastestSplits: r, rowIndex: s, displayPosition: a, hasLapDetail: i, isExpanded: o, onToggle: d, driverLaps: p, colCount: c }) {
2112
+ function mt({ result: e, isRace: t, fastestSplits: r, rowIndex: s, displayPosition: a, hasLapDetail: o, isExpanded: i, onToggle: d, driverLaps: p, colCount: c }) {
1736
2113
  const u = a ?? e.position, v = u <= 3;
1737
2114
  return /* @__PURE__ */ l(B, { children: [
1738
2115
  /* @__PURE__ */ l(
1739
2116
  "tr",
1740
2117
  {
1741
- className: `pvx-row ${v ? "pvx-row--podium" : ""} ${i ? "pvx-row--expandable" : ""}`,
1742
- onClick: i ? d : void 0,
1743
- style: i ? { cursor: "pointer" } : void 0,
2118
+ className: `pvx-row ${v ? "pvx-row--podium" : ""} ${o ? "pvx-row--expandable" : ""}`,
2119
+ onClick: o ? d : void 0,
2120
+ style: o ? { cursor: "pointer" } : void 0,
1744
2121
  children: [
1745
- /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(me, { position: u }) }),
2122
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(ge, { position: u }) }),
1746
2123
  /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
1747
- /* @__PURE__ */ n(ne, { nation: e.nation }),
2124
+ /* @__PURE__ */ n(ee, { nation: e.nation }),
1748
2125
  e.driverName,
1749
2126
  e.carNumber != null && /* @__PURE__ */ l("span", { className: "pvx-car-number", children: [
1750
2127
  "#",
@@ -1752,9 +2129,9 @@ function Kn({ result: e, isRace: t, fastestSplits: r, rowIndex: s, displayPositi
1752
2129
  ] }),
1753
2130
  e.penalty && /* @__PURE__ */ n("span", { className: "pvx-penalty", children: e.penalty })
1754
2131
  ] }),
1755
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: _(e.carId) }),
2132
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: I(e.carId) }),
1756
2133
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ n(
1757
- Gn,
2134
+ xt,
1758
2135
  {
1759
2136
  bestLap: e.bestLapFormatted,
1760
2137
  hasBestLap: e.hasBestLap,
@@ -1779,10 +2156,10 @@ function Kn({ result: e, isRace: t, fastestSplits: r, rowIndex: s, displayPositi
1779
2156
  ]
1780
2157
  }
1781
2158
  ),
1782
- o && p && /* @__PURE__ */ n("tr", { className: "pvx-row pvx-row--lap-detail", children: /* @__PURE__ */ n("td", { colSpan: c, className: "pvx-td pvx-td--lap-detail", children: /* @__PURE__ */ n(On, { laps: p }) }) })
2159
+ i && p && /* @__PURE__ */ n("tr", { className: "pvx-row pvx-row--lap-detail", children: /* @__PURE__ */ n("td", { colSpan: c, className: "pvx-td pvx-td--lap-detail", children: /* @__PURE__ */ n(vt, { laps: p }) }) })
1783
2160
  ] });
1784
2161
  }
1785
- function On({ laps: e }) {
2162
+ function vt({ laps: e }) {
1786
2163
  const t = Math.min(...e.filter((r) => r.valid && r.timeMs > 0).map((r) => r.timeMs));
1787
2164
  return /* @__PURE__ */ l("table", { className: "pvx-table pvx-table--laps", children: [
1788
2165
  /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
@@ -1798,35 +2175,35 @@ function On({ laps: e }) {
1798
2175
  return /* @__PURE__ */ l("tr", { className: `pvx-row ${r.valid ? "" : "pvx-row--invalid"} ${s ? "pvx-row--fastest" : ""}`, children: [
1799
2176
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted", children: r.lap }),
1800
2177
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children: r.time }),
1801
- (r.splits || []).map((i, o) => /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: i }, o)),
1802
- Array.from({ length: Math.max(0, 3 - (((a = r.splits) == null ? void 0 : a.length) || 0)) }).map((i, o) => /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm" }, `pad-${o}`))
2178
+ (r.splits || []).map((o, i) => /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: o }, i)),
2179
+ Array.from({ length: Math.max(0, 3 - (((a = r.splits) == null ? void 0 : a.length) || 0)) }).map((o, i) => /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm" }, `pad-${i}`))
1803
2180
  ] }, r.lap);
1804
2181
  }) })
1805
2182
  ] });
1806
2183
  }
1807
- function Gn({ bestLap: e, hasBestLap: t, splits: r, fastestSplits: s, showAbove: a }) {
2184
+ function xt({ bestLap: e, hasBestLap: t, splits: r, fastestSplits: s, showAbove: a }) {
1808
2185
  return e ? /* @__PURE__ */ l("span", { className: `pvx-best-lap-cell ${t ? "pvx-best-lap-cell--fastest" : ""}`, children: [
1809
2186
  /* @__PURE__ */ n("span", { className: "pvx-best-lap-time", children: e }),
1810
- (r == null ? void 0 : r.length) > 0 && /* @__PURE__ */ n("span", { className: "pvx-splits-tooltip-anchor", children: /* @__PURE__ */ n("span", { className: `pvx-splits-tooltip ${a ? "" : "pvx-splits-tooltip--above"}`, children: r.map((i, o) => {
1811
- const d = s && i === s[o];
2187
+ (r == null ? void 0 : r.length) > 0 && /* @__PURE__ */ n("span", { className: "pvx-splits-tooltip-anchor", children: /* @__PURE__ */ n("span", { className: `pvx-splits-tooltip ${a ? "" : "pvx-splits-tooltip--above"}`, children: r.map((o, i) => {
2188
+ const d = s && o === s[i];
1812
2189
  return /* @__PURE__ */ l("span", { className: "pvx-splits-tooltip-row", children: [
1813
2190
  /* @__PURE__ */ l("span", { className: "pvx-splits-tooltip-label", children: [
1814
2191
  "S",
1815
- o + 1
2192
+ i + 1
1816
2193
  ] }),
1817
- /* @__PURE__ */ n("span", { className: d ? "pvx-splits-tooltip-best" : "", children: i })
1818
- ] }, o);
2194
+ /* @__PURE__ */ n("span", { className: d ? "pvx-splits-tooltip-best" : "", children: o })
2195
+ ] }, i);
1819
2196
  }) }) })
1820
2197
  ] }) : /* @__PURE__ */ n("span", { className: "pvx-td--muted", children: "-" });
1821
2198
  }
1822
- function Ht({ competitionId: e, className: t }) {
1823
- const { getSteamId: r } = L(), { data: s, isLoading: a } = Re(e), i = r();
2199
+ function ur({ competitionId: e, className: t }) {
2200
+ const { getSteamId: r } = S(), { data: s, isLoading: a } = Ae(e), o = r();
1824
2201
  if (a)
1825
2202
  return /* @__PURE__ */ n(W, { message: "Loading drivers..." });
1826
- const o = (s == null ? void 0 : s.drivers) || (s == null ? void 0 : s.entries) || [];
1827
- return o.length ? /* @__PURE__ */ n("div", { className: `pvx-entry-grid ${t || ""}`, children: o.map((d) => {
2203
+ const i = (s == null ? void 0 : s.drivers) || (s == null ? void 0 : s.entries) || [];
2204
+ return i.length ? /* @__PURE__ */ n("div", { className: `pvx-entry-grid ${t || ""}`, children: i.map((d) => {
1828
2205
  var c, u;
1829
- const p = i && d.steamId === i;
2206
+ const p = o && d.steamId === o;
1830
2207
  return /* @__PURE__ */ l("div", { className: `pvx-entry-card ${p ? "pvx-entry-card--you" : ""}`, children: [
1831
2208
  d.avatarUrl ? /* @__PURE__ */ n(
1832
2209
  "img",
@@ -1841,24 +2218,24 @@ function Ht({ competitionId: e, className: t }) {
1841
2218
  p && /* @__PURE__ */ n("span", { className: "pvx-entry-you", children: " (you)" })
1842
2219
  ] })
1843
2220
  ] }, d.steamId || d.driverId);
1844
- }) }) : /* @__PURE__ */ n(U, { message: "No drivers registered yet." });
2221
+ }) }) : /* @__PURE__ */ n(_, { message: "No drivers registered yet." });
1845
2222
  }
1846
- function jt({
2223
+ function hr({
1847
2224
  competitionId: e,
1848
2225
  driverData: t,
1849
2226
  className: r,
1850
2227
  children: s
1851
2228
  }) {
1852
- const { data: a, isLoading: i } = le(e), { isPowerMode: o } = ce(), d = de(e), p = Te(e), c = $e(e), u = (a == null ? void 0 : a.isRegistered) || !1, v = i || p.isPending || c.isPending, f = p.error || c.error || null, h = () => {
1853
- o && p.mutate(t || {});
1854
- }, k = () => {
1855
- o && c.mutate();
2229
+ const { data: a, isLoading: o } = he(e), { isPowerMode: i } = me(), d = ve(e), p = Ee(e), c = Be(e), u = (a == null ? void 0 : a.isRegistered) || !1, v = o || p.isPending || c.isPending, f = p.error || c.error || null, h = () => {
2230
+ i && p.mutate(t || {});
2231
+ }, y = () => {
2232
+ i && c.mutate();
1856
2233
  };
1857
- return typeof s == "function" ? s({ isRegistered: u, isLoading: v, register: h, withdraw: k, error: f, isPowerMode: o, registrationUrl: d }) : o ? /* @__PURE__ */ n(
2234
+ return typeof s == "function" ? s({ isRegistered: u, isLoading: v, register: h, withdraw: y, error: f, isPowerMode: i, registrationUrl: d }) : i ? /* @__PURE__ */ n(
1858
2235
  "button",
1859
2236
  {
1860
2237
  className: `pvx-comp-register-btn ${r || ""}`,
1861
- onClick: u ? k : h,
2238
+ onClick: u ? y : h,
1862
2239
  disabled: v,
1863
2240
  children: v ? "Loading..." : u ? "Withdraw" : "Register"
1864
2241
  }
@@ -1873,44 +2250,44 @@ function jt({
1873
2250
  }
1874
2251
  );
1875
2252
  }
1876
- function Vt({ competitionId: e, registration: t, onWithdrawSuccess: r, className: s }) {
1877
- const { getSteamId: a } = L(), { isPowerMode: i } = ce(), o = de(e), { data: d, isLoading: p } = le(e), { data: c, isLoading: u } = Re(e), v = Te(e), f = $e(e), h = a(), k = (d == null ? void 0 : d.isRegistered) || !1, m = (c == null ? void 0 : c.drivers) || (c == null ? void 0 : c.entries) || [], g = t || {}, b = m.length || g.currentCount || 0, x = g.maxParticipants && b >= g.maxParticipants, w = g.deadline && new Date(g.deadline) < /* @__PURE__ */ new Date(), C = g.isOpen && !w && !x;
1878
- return p || u ? /* @__PURE__ */ n(W, { message: "Loading registration..." }) : k ? /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: /* @__PURE__ */ n(
1879
- Qn,
2253
+ function mr({ competitionId: e, registration: t, onWithdrawSuccess: r, className: s }) {
2254
+ const { getSteamId: a } = S(), { isPowerMode: o } = me(), i = ve(e), { data: d, isLoading: p } = he(e), { data: c, isLoading: u } = Ae(e), v = Ee(e), f = Be(e), h = a(), y = (d == null ? void 0 : d.isRegistered) || !1, x = (c == null ? void 0 : c.drivers) || (c == null ? void 0 : c.entries) || [], m = t || {}, b = x.length || m.currentCount || 0, g = m.maxParticipants && b >= m.maxParticipants, k = m.deadline && new Date(m.deadline) < /* @__PURE__ */ new Date(), C = m.isOpen && !k && !g;
2255
+ return p || u ? /* @__PURE__ */ n(W, { message: "Loading registration..." }) : y ? /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: /* @__PURE__ */ n(
2256
+ ft,
1880
2257
  {
1881
2258
  competitionId: e,
1882
- drivers: m,
2259
+ drivers: x,
1883
2260
  steamId: h,
1884
- isPowerMode: i,
1885
- registrationUrl: o,
2261
+ isPowerMode: o,
2262
+ registrationUrl: i,
1886
2263
  withdrawMutation: f,
1887
2264
  onWithdrawSuccess: r,
1888
- registration: g
2265
+ registration: m
1889
2266
  }
1890
- ) }) : C ? h ? i ? /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: /* @__PURE__ */ n(
1891
- zn,
2267
+ ) }) : C ? h ? o ? /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: /* @__PURE__ */ n(
2268
+ gt,
1892
2269
  {
1893
2270
  competitionId: e,
1894
2271
  registerMutation: v,
1895
- registration: g
2272
+ registration: m
1896
2273
  }
1897
- ) }) : /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: /* @__PURE__ */ n("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) : /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: i ? /* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children: "Sign in to register for this competition." }) : /* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children: /* @__PURE__ */ n("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) }) : /* @__PURE__ */ l("div", { className: `pvx-reg-panel ${s || ""}`, children: [
1898
- /* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children: x ? "Registration is full." : w ? "Registration deadline has passed." : "Registration is closed." }),
1899
- m.length > 0 && /* @__PURE__ */ n(Ee, { drivers: m, steamId: h })
2274
+ ) }) : /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: /* @__PURE__ */ n("a", { href: i, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) : /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: o ? /* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children: "Sign in to register for this competition." }) : /* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children: /* @__PURE__ */ n("a", { href: i, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) }) : /* @__PURE__ */ l("div", { className: `pvx-reg-panel ${s || ""}`, children: [
2275
+ /* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children: g ? "Registration is full." : k ? "Registration deadline has passed." : "Registration is closed." }),
2276
+ x.length > 0 && /* @__PURE__ */ n(Ke, { drivers: x, steamId: h })
1900
2277
  ] });
1901
2278
  }
1902
- function zn({ competitionId: e, registerMutation: t, registration: r }) {
1903
- const [s, a] = E(""), [i, o] = E("intermediate"), [d, p] = E(""), c = (h) => {
2279
+ function gt({ competitionId: e, registerMutation: t, registration: r }) {
2280
+ const [s, a] = E(""), [o, i] = E("intermediate"), [d, p] = E(""), c = (h) => {
1904
2281
  h.preventDefault(), t.mutate({
1905
2282
  discordUsername: s || void 0,
1906
- experience: i,
2283
+ experience: o,
1907
2284
  comments: d || void 0
1908
2285
  });
1909
2286
  }, u = r || {}, v = u.currentCount || 0, f = u.maxParticipants;
1910
2287
  return /* @__PURE__ */ l("form", { className: "pvx-reg-form", onSubmit: c, children: [
1911
2288
  /* @__PURE__ */ l("div", { className: "pvx-reg-form-header", children: [
1912
2289
  /* @__PURE__ */ n("h3", { className: "pvx-reg-form-title", children: "Register" }),
1913
- f && /* @__PURE__ */ n(_e, { count: v, max: f })
2290
+ f && /* @__PURE__ */ n(He, { count: v, max: f })
1914
2291
  ] }),
1915
2292
  t.error && /* @__PURE__ */ n("div", { className: "pvx-reg-error", children: t.error.message || "Registration failed" }),
1916
2293
  /* @__PURE__ */ l("div", { className: "pvx-reg-field", children: [
@@ -1937,8 +2314,8 @@ function zn({ competitionId: e, registerMutation: t, registration: r }) {
1937
2314
  {
1938
2315
  id: `pvx-exp-${e}`,
1939
2316
  className: "pvx-reg-select",
1940
- value: i,
1941
- onChange: (h) => o(h.target.value),
2317
+ value: o,
2318
+ onChange: (h) => i(h.target.value),
1942
2319
  children: [
1943
2320
  /* @__PURE__ */ n("option", { value: "beginner", children: "Beginner" }),
1944
2321
  /* @__PURE__ */ n("option", { value: "intermediate", children: "Intermediate" }),
@@ -1975,21 +2352,21 @@ function zn({ competitionId: e, registerMutation: t, registration: r }) {
1975
2352
  ) })
1976
2353
  ] });
1977
2354
  }
1978
- function Qn({ competitionId: e, drivers: t, steamId: r, isPowerMode: s, registrationUrl: a, withdrawMutation: i, onWithdrawSuccess: o, registration: d }) {
2355
+ function ft({ competitionId: e, drivers: t, steamId: r, isPowerMode: s, registrationUrl: a, withdrawMutation: o, onWithdrawSuccess: i, registration: d }) {
1979
2356
  const [p, c] = E(!1), u = () => {
1980
- i.mutate(void 0, {
2357
+ o.mutate(void 0, {
1981
2358
  onSuccess: () => {
1982
- c(!1), o && o();
2359
+ c(!1), i && i();
1983
2360
  }
1984
2361
  });
1985
2362
  }, v = d || {}, f = t.length || v.currentCount || 0, h = v.maxParticipants;
1986
2363
  return /* @__PURE__ */ l(B, { children: [
1987
2364
  /* @__PURE__ */ l("div", { className: "pvx-reg-form-header", children: [
1988
2365
  /* @__PURE__ */ n("h3", { className: "pvx-reg-form-title", children: "Registered Drivers" }),
1989
- h && /* @__PURE__ */ n(_e, { count: f, max: h })
2366
+ h && /* @__PURE__ */ n(He, { count: f, max: h })
1990
2367
  ] }),
1991
- /* @__PURE__ */ n(Ee, { drivers: t, steamId: r }),
1992
- i.error && /* @__PURE__ */ n("div", { className: "pvx-reg-error", children: i.error.message || "Withdrawal failed" }),
2368
+ /* @__PURE__ */ n(Ke, { drivers: t, steamId: r }),
2369
+ o.error && /* @__PURE__ */ n("div", { className: "pvx-reg-error", children: o.error.message || "Withdrawal failed" }),
1993
2370
  s ? /* @__PURE__ */ n("div", { className: "pvx-reg-actions", children: p ? /* @__PURE__ */ l("div", { className: "pvx-reg-confirm", children: [
1994
2371
  /* @__PURE__ */ n("p", { className: "pvx-reg-confirm-text", children: "Are you sure you want to unregister?" }),
1995
2372
  /* @__PURE__ */ l("div", { className: "pvx-reg-confirm-actions", children: [
@@ -2008,8 +2385,8 @@ function Qn({ competitionId: e, drivers: t, steamId: r, isPowerMode: s, registra
2008
2385
  type: "button",
2009
2386
  className: "pvx-reg-danger-btn",
2010
2387
  onClick: u,
2011
- disabled: i.isPending,
2012
- children: i.isPending ? "Unregistering..." : "Yes, Unregister"
2388
+ disabled: o.isPending,
2389
+ children: o.isPending ? "Unregistering..." : "Yes, Unregister"
2013
2390
  }
2014
2391
  )
2015
2392
  ] })
@@ -2024,22 +2401,22 @@ function Qn({ competitionId: e, drivers: t, steamId: r, isPowerMode: s, registra
2024
2401
  ) }) : /* @__PURE__ */ n("div", { className: "pvx-reg-actions", children: /* @__PURE__ */ n("a", { href: a, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Manage on PitVox" }) })
2025
2402
  ] });
2026
2403
  }
2027
- function Ee({ drivers: e, steamId: t }) {
2404
+ function Ke({ drivers: e, steamId: t }) {
2028
2405
  if (!e.length)
2029
2406
  return /* @__PURE__ */ n("div", { className: "pvx-reg-no-drivers", children: "No drivers registered yet." });
2030
2407
  const r = [...e].sort((s, a) => {
2031
- const i = t && s.steamId === t ? -1 : 0, o = t && a.steamId === t ? -1 : 0;
2032
- return i - o;
2408
+ const o = t && s.steamId === t ? -1 : 0, i = t && a.steamId === t ? -1 : 0;
2409
+ return o - i;
2033
2410
  });
2034
2411
  return /* @__PURE__ */ n("div", { className: "pvx-reg-driver-list", children: r.map((s) => {
2035
- var i, o;
2412
+ var o, i;
2036
2413
  const a = t && s.steamId === t;
2037
2414
  return /* @__PURE__ */ l(
2038
2415
  "div",
2039
2416
  {
2040
2417
  className: `pvx-reg-driver-row ${a ? "pvx-reg-driver-row--you" : ""}`,
2041
2418
  children: [
2042
- s.avatarUrl ? /* @__PURE__ */ n("img", { src: s.avatarUrl, alt: "", className: "pvx-reg-driver-avatar" }) : /* @__PURE__ */ n("div", { className: "pvx-reg-driver-avatar pvx-reg-driver-avatar--placeholder", children: ((o = (i = s.displayName) == null ? void 0 : i.charAt(0)) == null ? void 0 : o.toUpperCase()) || "?" }),
2419
+ s.avatarUrl ? /* @__PURE__ */ n("img", { src: s.avatarUrl, alt: "", className: "pvx-reg-driver-avatar" }) : /* @__PURE__ */ n("div", { className: "pvx-reg-driver-avatar pvx-reg-driver-avatar--placeholder", children: ((i = (o = s.displayName) == null ? void 0 : o.charAt(0)) == null ? void 0 : i.toUpperCase()) || "?" }),
2043
2420
  /* @__PURE__ */ l("span", { className: "pvx-reg-driver-name", children: [
2044
2421
  s.displayName,
2045
2422
  a && /* @__PURE__ */ n("span", { className: "pvx-entry-you", children: " (you)" })
@@ -2050,7 +2427,7 @@ function Ee({ drivers: e, steamId: t }) {
2050
2427
  );
2051
2428
  }) });
2052
2429
  }
2053
- function _e({ count: e, max: t }) {
2430
+ function He({ count: e, max: t }) {
2054
2431
  const r = t ? e / t * 100 : 0, s = r >= 100 ? "full" : r >= 75 ? "warning" : "ok";
2055
2432
  return /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${s}`, children: [
2056
2433
  e,
@@ -2059,82 +2436,82 @@ function _e({ count: e, max: t }) {
2059
2436
  " drivers"
2060
2437
  ] });
2061
2438
  }
2062
- function Wt({ competitionId: e, className: t }) {
2063
- const { data: r, isLoading: s } = Se(e), a = (r == null ? void 0 : r.type) === "championship", i = (r == null ? void 0 : r.type) === "hotlap", o = T(() => (r == null ? void 0 : r.rounds) || [], [r]), d = i && o.length > 1, p = i && !d, { data: c } = rn(p ? e : null), u = T(
2064
- () => o.filter((y) => y.isFinalized),
2065
- [o]
2439
+ function vr({ competitionId: e, className: t }) {
2440
+ const { data: r, isLoading: s } = Pe(e), a = (r == null ? void 0 : r.type) === "championship", o = (r == null ? void 0 : r.type) === "hotlap", i = T(() => (r == null ? void 0 : r.rounds) || [], [r]), d = o && i.length > 1, p = o && !d, { data: c } = un(p ? e : null), u = T(
2441
+ () => i.filter((w) => w.isFinalized),
2442
+ [i]
2066
2443
  ), v = T(
2067
- () => u.map((y) => y.roundNumber),
2444
+ () => u.map((w) => w.roundNumber),
2068
2445
  [u]
2069
- ), { data: f = [], isLoading: h } = tn(
2446
+ ), { data: f = [], isLoading: h } = pn(
2070
2447
  e,
2071
2448
  v
2072
- ), k = p && f.length > 0 ? f[0] : null, m = (k == null ? void 0 : k.sessions) || [], g = d ? o.find(
2073
- (y) => y.startTime && new Date(y.startTime) <= /* @__PURE__ */ new Date() && !j(y)
2074
- ) : null, b = d ? g ? `hlround-${g.roundNumber}` : "standings" : p ? "leaderboard" : a ? "standings" : v.length > 0 ? `round-${v[v.length - 1]}` : null, [x, w] = E(null), C = x || b;
2449
+ ), y = p && f.length > 0 ? f[0] : null, x = (y == null ? void 0 : y.sessions) || [], m = d ? i.find(
2450
+ (w) => w.startTime && new Date(w.startTime) <= /* @__PURE__ */ new Date() && !O(w)
2451
+ ) : null, b = d ? m ? `hlround-${m.roundNumber}` : "standings" : p ? "leaderboard" : a ? "standings" : v.length > 0 ? `round-${v[v.length - 1]}` : null, [g, k] = E(null), C = g || b;
2075
2452
  if (s || h)
2076
2453
  return /* @__PURE__ */ n(W, { message: "Loading results..." });
2077
2454
  if (!r)
2078
- return /* @__PURE__ */ n(U, { message: "Competition not found." });
2455
+ return /* @__PURE__ */ n(_, { message: "Competition not found." });
2079
2456
  if (!u.length)
2080
- return /* @__PURE__ */ n(U, { message: "No results available yet. Results will appear here once rounds are finalised." });
2081
- const M = new Map(f.map((y) => [`round-${y.roundNumber}`, y])), P = new Map(f.map((y) => [y.roundNumber, y])), N = [];
2457
+ return /* @__PURE__ */ n(_, { message: "No results available yet. Results will appear here once rounds are finalised." });
2458
+ const P = new Map(f.map((w) => [`round-${w.roundNumber}`, w])), A = new Map(f.map((w) => [w.roundNumber, w])), N = [];
2082
2459
  if (d) {
2083
2460
  N.push({ id: "standings", label: "Standings" });
2084
- for (const y of [...o].sort((A, R) => A.roundNumber - R.roundNumber))
2085
- N.push({ id: `hlround-${y.roundNumber}`, label: `R${y.roundNumber}`, track: y.track || null });
2461
+ for (const w of [...i].sort((D, $) => D.roundNumber - $.roundNumber))
2462
+ N.push({ id: `hlround-${w.roundNumber}`, label: `R${w.roundNumber}`, track: w.track || null });
2086
2463
  } else if (p) {
2087
2464
  N.push({ id: "leaderboard", label: "Leaderboard" });
2088
- for (const y of m)
2089
- N.push({ id: `session-${y.type}`, label: ee(y.type) });
2465
+ for (const w of x)
2466
+ N.push({ id: `session-${w.type}`, label: X(w.type) });
2090
2467
  } else if (a) {
2091
2468
  N.push({ id: "standings", label: "Standings" });
2092
- for (const y of u)
2093
- N.push({ id: `round-${y.roundNumber}`, label: `R${y.roundNumber}`, track: null });
2469
+ for (const w of u)
2470
+ N.push({ id: `round-${w.roundNumber}`, label: `R${w.roundNumber}`, track: null });
2094
2471
  } else
2095
- for (const y of u)
2096
- N.push({ id: `round-${y.roundNumber}`, label: `R${y.roundNumber}`, track: null });
2097
- let S;
2472
+ for (const w of u)
2473
+ N.push({ id: `round-${w.roundNumber}`, label: `R${w.roundNumber}`, track: null });
2474
+ let L;
2098
2475
  if (C === "standings")
2099
- S = /* @__PURE__ */ n(Fn, { competitionId: e });
2476
+ L = /* @__PURE__ */ n(lt, { competitionId: e });
2100
2477
  else if (C === "leaderboard")
2101
- S = /* @__PURE__ */ n(Ue, { leaderboard: c, config: r });
2478
+ L = /* @__PURE__ */ n(Oe, { leaderboard: c, config: r });
2102
2479
  else if (C != null && C.startsWith("hlround-")) {
2103
- const y = parseInt(C.slice(8), 10), A = o.find((R) => R.roundNumber === y);
2104
- S = A ? /* @__PURE__ */ n(Zn, { competitionId: e, roundMeta: A, roundData: P.get(y) }) : /* @__PURE__ */ n(U, { message: "No results for this round." });
2480
+ const w = parseInt(C.slice(8), 10), D = i.find(($) => $.roundNumber === w);
2481
+ L = D ? /* @__PURE__ */ n(yt, { competitionId: e, roundMeta: D, roundData: A.get(w) }) : /* @__PURE__ */ n(_, { message: "No results for this round." });
2105
2482
  } else if (C != null && C.startsWith("session-"))
2106
- S = /* @__PURE__ */ n(
2107
- Fe,
2483
+ L = /* @__PURE__ */ n(
2484
+ Ge,
2108
2485
  {
2109
- session: m.find((y) => `session-${y.type}` === C),
2110
- round: k,
2486
+ session: x.find((w) => `session-${w.type}` === C),
2487
+ round: y,
2111
2488
  competitionId: e
2112
2489
  }
2113
2490
  );
2114
2491
  else {
2115
- const y = M.get(C);
2116
- S = y ? /* @__PURE__ */ n(Yn, { round: y, competitionId: e }) : /* @__PURE__ */ n(U, { message: "No results for this round." });
2492
+ const w = P.get(C);
2493
+ L = w ? /* @__PURE__ */ n(Nt, { round: w, competitionId: e }) : /* @__PURE__ */ n(_, { message: "No results for this round." });
2117
2494
  }
2118
2495
  return /* @__PURE__ */ l("div", { className: t || "", children: [
2119
- /* @__PURE__ */ n("div", { className: "pvx-results-tabs", children: N.map((y) => /* @__PURE__ */ l(
2496
+ /* @__PURE__ */ n("div", { className: "pvx-results-tabs", children: N.map((w) => /* @__PURE__ */ l(
2120
2497
  "button",
2121
2498
  {
2122
- className: `pvx-results-tab ${C === y.id ? "pvx-results-tab--active" : ""}`,
2123
- onClick: () => w(y.id),
2124
- title: y.track || void 0,
2499
+ className: `pvx-results-tab ${C === w.id ? "pvx-results-tab--active" : ""}`,
2500
+ onClick: () => k(w.id),
2501
+ title: w.track || void 0,
2125
2502
  children: [
2126
- /* @__PURE__ */ n("span", { className: "pvx-results-tab-label", children: y.label }),
2127
- y.track && /* @__PURE__ */ n("span", { className: "pvx-results-tab-track", children: y.track })
2503
+ /* @__PURE__ */ n("span", { className: "pvx-results-tab-label", children: w.label }),
2504
+ w.track && /* @__PURE__ */ n("span", { className: "pvx-results-tab-track", children: w.track })
2128
2505
  ]
2129
2506
  },
2130
- y.id
2507
+ w.id
2131
2508
  )) }),
2132
- S
2509
+ L
2133
2510
  ] });
2134
2511
  }
2135
- function Yn({ round: e, competitionId: t }) {
2136
- var i;
2137
- const s = (e.sessions || []).find((o) => o.type === "RACE"), a = (i = s == null ? void 0 : s.results) == null ? void 0 : i.filter((o) => o.position <= 3).sort((o, d) => o.position - d.position);
2512
+ function Nt({ round: e, competitionId: t }) {
2513
+ var o;
2514
+ const s = (e.sessions || []).find((i) => i.type === "RACE"), a = (o = s == null ? void 0 : s.results) == null ? void 0 : o.filter((i) => i.position <= 3).sort((i, d) => i.position - d.position);
2138
2515
  return /* @__PURE__ */ l("div", { className: "pvx-card", children: [
2139
2516
  /* @__PURE__ */ l("div", { className: "pvx-card-header--split", children: [
2140
2517
  /* @__PURE__ */ l("div", { children: [
@@ -2149,15 +2526,15 @@ function Yn({ round: e, competitionId: t }) {
2149
2526
  year: "numeric"
2150
2527
  }) })
2151
2528
  ] }),
2152
- (a == null ? void 0 : a.length) > 0 && /* @__PURE__ */ n("div", { className: "pvx-round-podium-summary", children: a.map((o) => /* @__PURE__ */ l("span", { className: "pvx-round-podium-item", children: [
2153
- /* @__PURE__ */ n("span", { children: he[o.position - 1] }),
2154
- /* @__PURE__ */ n("span", { children: o.driverName })
2155
- ] }, o.driverId)) })
2529
+ (a == null ? void 0 : a.length) > 0 && /* @__PURE__ */ n("div", { className: "pvx-round-podium-summary", children: a.map((i) => /* @__PURE__ */ l("span", { className: "pvx-round-podium-item", children: [
2530
+ /* @__PURE__ */ n("span", { children: xe[i.position - 1] }),
2531
+ /* @__PURE__ */ n("span", { children: i.driverName })
2532
+ ] }, i.driverId)) })
2156
2533
  ] }),
2157
- /* @__PURE__ */ n(ve, { round: e, competitionId: t })
2534
+ /* @__PURE__ */ n(ye, { round: e, competitionId: t })
2158
2535
  ] });
2159
2536
  }
2160
- function Ue({ leaderboard: e, config: t, heading: r }) {
2537
+ function Oe({ leaderboard: e, config: t, heading: r }) {
2161
2538
  var s;
2162
2539
  return (s = e == null ? void 0 : e.drivers) != null && s.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
2163
2540
  /* @__PURE__ */ n("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ l("div", { children: [
@@ -2180,52 +2557,52 @@ function Ue({ leaderboard: e, config: t, heading: r }) {
2180
2557
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Gap" })
2181
2558
  ] }) }),
2182
2559
  /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: e.drivers.map((a) => {
2183
- const i = a.position === 1 ? "" : `+${((a.bestLapMs - e.drivers[0].bestLapMs) / 1e3).toFixed(3)}`;
2560
+ const o = a.position === 1 ? "" : `+${((a.bestLapMs - e.drivers[0].bestLapMs) / 1e3).toFixed(3)}`;
2184
2561
  return /* @__PURE__ */ l("tr", { className: `pvx-row ${a.position <= 3 ? "pvx-row--podium" : ""}`, children: [
2185
- /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(me, { position: a.position }) }),
2562
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(ge, { position: a.position }) }),
2186
2563
  /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
2187
- /* @__PURE__ */ n(ne, { nation: a.nation }),
2564
+ /* @__PURE__ */ n(ee, { nation: a.nation }),
2188
2565
  a.driverName
2189
2566
  ] }),
2190
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: _(a.carId) }),
2567
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: I(a.carId) }),
2191
2568
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ n("span", { className: a.position === 1 ? "pvx-best-lap-cell--fastest" : "", children: a.bestLapFormatted }) }),
2192
2569
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: a.totalLaps }),
2193
2570
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: a.sessionsParticipated }),
2194
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: i })
2571
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: o })
2195
2572
  ] }, a.driverId);
2196
2573
  }) })
2197
2574
  ] }) })
2198
- ] }) : /* @__PURE__ */ n(U, { message: "No lap times recorded yet." });
2575
+ ] }) : /* @__PURE__ */ n(_, { message: "No lap times recorded yet." });
2199
2576
  }
2200
- function Fe({ session: e, round: t, competitionId: r }) {
2577
+ function Ge({ session: e, round: t, competitionId: r }) {
2201
2578
  return e ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
2202
- /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n("h4", { className: "pvx-card-title", children: ee(e.type) }) }),
2579
+ /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n("h4", { className: "pvx-card-title", children: X(e.type) }) }),
2203
2580
  /* @__PURE__ */ n(
2204
- ve,
2581
+ ye,
2205
2582
  {
2206
2583
  round: { ...t, sessions: [e] },
2207
2584
  competitionId: r
2208
2585
  }
2209
2586
  )
2210
- ] }) : /* @__PURE__ */ n(U, { message: "Session data not available." });
2587
+ ] }) : /* @__PURE__ */ n(_, { message: "Session data not available." });
2211
2588
  }
2212
- function Zn({ competitionId: e, roundMeta: t, roundData: r }) {
2213
- const { data: s } = sn(e, t.roundNumber), a = (r == null ? void 0 : r.sessions) || [], [i, o] = E("leaderboard"), d = [
2589
+ function yt({ competitionId: e, roundMeta: t, roundData: r }) {
2590
+ const { data: s } = hn(e, t.roundNumber), a = (r == null ? void 0 : r.sessions) || [], [o, i] = E("leaderboard"), d = [
2214
2591
  { id: "leaderboard", label: "Leaderboard" },
2215
- ...a.map((u) => ({ id: `session-${u.type}`, label: ee(u.type) }))
2216
- ], p = d.some((u) => u.id === i) ? i : "leaderboard", c = `Round ${t.roundNumber}${t.track ? ` — ${t.track}` : ""}`;
2592
+ ...a.map((u) => ({ id: `session-${u.type}`, label: X(u.type) }))
2593
+ ], p = d.some((u) => u.id === o) ? o : "leaderboard", c = `Round ${t.roundNumber}${t.track ? ` — ${t.track}` : ""}`;
2217
2594
  return /* @__PURE__ */ l("div", { children: [
2218
2595
  /* @__PURE__ */ n("div", { className: "pvx-session-tabs", children: d.map((u) => /* @__PURE__ */ n(
2219
2596
  "button",
2220
2597
  {
2221
- onClick: () => o(u.id),
2598
+ onClick: () => i(u.id),
2222
2599
  className: `pvx-session-tab ${p === u.id ? "pvx-session-tab--active" : ""}`,
2223
2600
  children: u.label
2224
2601
  },
2225
2602
  u.id
2226
2603
  )) }),
2227
- p === "leaderboard" ? /* @__PURE__ */ n(Ue, { leaderboard: s, heading: c }) : /* @__PURE__ */ n(
2228
- Fe,
2604
+ p === "leaderboard" ? /* @__PURE__ */ n(Oe, { leaderboard: s, heading: c }) : /* @__PURE__ */ n(
2605
+ Ge,
2229
2606
  {
2230
2607
  session: a.find((u) => `session-${u.type}` === p),
2231
2608
  round: r,
@@ -2234,10 +2611,10 @@ function Zn({ competitionId: e, roundMeta: t, roundData: r }) {
2234
2611
  )
2235
2612
  ] });
2236
2613
  }
2237
- function Jn(e) {
2238
- const { cdnUrl: t } = L(), r = $({
2614
+ function bt(e) {
2615
+ const { cdnUrl: t } = S(), r = R({
2239
2616
  queryKey: ["pitvox", "laps", "global", e, "index"],
2240
- queryFn: () => D(t, ye(null, e)),
2617
+ queryFn: () => M(t, Te(null, e)),
2241
2618
  enabled: !!e,
2242
2619
  staleTime: 3e4,
2243
2620
  refetchInterval: 3e4
@@ -2260,16 +2637,16 @@ function Jn(e) {
2260
2637
  } : null
2261
2638
  };
2262
2639
  }
2263
- function Xn(e) {
2264
- const { cdnUrl: t, partnerSlug: r } = L(), s = $({
2640
+ function wt(e) {
2641
+ const { cdnUrl: t, partnerSlug: r } = S(), s = R({
2265
2642
  queryKey: ["pitvox", "laps", r || "global", e, "index"],
2266
- queryFn: () => D(t, ye(r, e)),
2643
+ queryFn: () => M(t, Te(r, e)),
2267
2644
  enabled: !!e,
2268
2645
  staleTime: 3e4,
2269
2646
  refetchInterval: 3e4
2270
2647
  }), a = T(() => {
2271
- var i;
2272
- return ((i = s.data) == null ? void 0 : i.combos) || [];
2648
+ var o;
2649
+ return ((o = s.data) == null ? void 0 : o.combos) || [];
2273
2650
  }, [s.data]);
2274
2651
  return {
2275
2652
  isLoading: s.isLoading,
@@ -2277,22 +2654,22 @@ function Xn(e) {
2277
2654
  data: a
2278
2655
  };
2279
2656
  }
2280
- function qe(e = {}) {
2281
- const { cdnUrl: t, partnerSlug: r } = L(), { game: s, gameVersion: a, enabled: i = !0 } = e, o = ie(r, s, a, "ratings.json");
2282
- return $({
2657
+ function ze(e = {}) {
2658
+ const { cdnUrl: t, partnerSlug: r } = S(), { game: s, gameVersion: a, enabled: o = !0 } = e, i = de(r, s, a, "ratings.json");
2659
+ return R({
2283
2660
  queryKey: ["pitvox", "ratings", r, s || null, a || null],
2284
- queryFn: () => D(t, o),
2661
+ queryFn: () => M(t, i),
2285
2662
  staleTime: 3e4,
2286
2663
  refetchInterval: 3e4,
2287
- enabled: i
2664
+ enabled: o
2288
2665
  });
2289
2666
  }
2290
- function Kt(e) {
2667
+ function xr(e) {
2291
2668
  var s;
2292
- const t = qe(), r = T(() => {
2669
+ const t = ze(), r = T(() => {
2293
2670
  var a;
2294
2671
  return !((a = t.data) != null && a.drivers) || !e ? null : t.data.drivers.find(
2295
- (i) => i.identifier === e
2672
+ (o) => o.identifier === e
2296
2673
  ) || null;
2297
2674
  }, [(s = t.data) == null ? void 0 : s.drivers, e]);
2298
2675
  return {
@@ -2308,66 +2685,66 @@ function Kt(e) {
2308
2685
  } : null
2309
2686
  };
2310
2687
  }
2311
- function se(e = {}) {
2312
- const t = qe(e);
2688
+ function ie(e = {}) {
2689
+ const t = ze(e);
2313
2690
  return {
2314
2691
  data: t.data || null,
2315
2692
  isLoading: t.isLoading,
2316
2693
  error: t.error
2317
2694
  };
2318
2695
  }
2319
- function et(e) {
2696
+ function kt(e) {
2320
2697
  var p, c;
2321
- const { versions: t } = Je(), r = (p = t == null ? void 0 : t.evo) == null ? void 0 : p.default, s = (c = t == null ? void 0 : t.lmu) == null ? void 0 : c.default, a = se({ game: "evo", gameVersion: r, enabled: !!r }), i = se({ game: "acc" }), o = se({ game: "lmu", gameVersion: s, enabled: !!s });
2698
+ const { versions: t } = on(), r = (p = t == null ? void 0 : t.evo) == null ? void 0 : p.default, s = (c = t == null ? void 0 : t.lmu) == null ? void 0 : c.default, a = ie({ game: "evo", gameVersion: r, enabled: !!r }), o = ie({ game: "acc" }), i = ie({ game: "lmu", gameVersion: s, enabled: !!s });
2322
2699
  return {
2323
2700
  data: T(() => e ? [
2324
2701
  { data: a.data, game: "evo", label: "EVO" },
2325
- { data: i.data, game: "acc", label: "ACC" },
2326
- { data: o.data, game: "lmu", label: "LMU" }
2702
+ { data: o.data, game: "acc", label: "ACC" },
2703
+ { data: i.data, game: "lmu", label: "LMU" }
2327
2704
  ].map(({ data: u, game: v, label: f }) => {
2328
- var m;
2329
- if (!((m = u == null ? void 0 : u.drivers) != null && m.length)) return null;
2330
- const h = [...u.drivers].sort((g, b) => b.rating - g.rating), k = h.findIndex((g) => g.identifier === e);
2331
- return k === -1 ? null : {
2705
+ var x;
2706
+ if (!((x = u == null ? void 0 : u.drivers) != null && x.length)) return null;
2707
+ const h = [...u.drivers].sort((m, b) => b.rating - m.rating), y = h.findIndex((m) => m.identifier === e);
2708
+ return y === -1 ? null : {
2332
2709
  game: v,
2333
2710
  label: f,
2334
- rating: h[k].rating,
2335
- rank: k + 1,
2711
+ rating: h[y].rating,
2712
+ rank: y + 1,
2336
2713
  totalDrivers: h.length
2337
2714
  };
2338
- }).filter(Boolean) : [], [e, a.data, i.data, o.data]),
2339
- isLoading: a.isLoading || i.isLoading || o.isLoading
2715
+ }).filter(Boolean) : [], [e, a.data, o.data, i.data]),
2716
+ isLoading: a.isLoading || o.isLoading || i.isLoading
2340
2717
  };
2341
2718
  }
2342
- function nt() {
2343
- const { cdnUrl: e, partnerSlug: t, getSteamId: r, onFetchServerPassword: s } = L(), a = r(), { data: i, isLoading: o } = $({
2719
+ function Ct() {
2720
+ const { cdnUrl: e, partnerSlug: t, getSteamId: r, onFetchServerPassword: s } = S(), a = r(), { data: o, isLoading: i } = R({
2344
2721
  queryKey: ["pitvox", "competitions", t],
2345
2722
  queryFn: async () => {
2346
- const h = await D(e, "competitions/index.json");
2347
- return h != null && h.competitions ? h.competitions.filter((k) => k.partnerSlug === t) : [];
2723
+ const h = await M(e, "competitions/index.json");
2724
+ return h != null && h.competitions ? h.competitions.filter((y) => y.partnerSlug === t) : [];
2348
2725
  },
2349
2726
  staleTime: 6e4
2350
- }), d = (i == null ? void 0 : i.map((h) => h.id)) || [], p = xe({
2727
+ }), d = (o == null ? void 0 : o.map((h) => h.id)) || [], p = be({
2351
2728
  queries: d.map((h) => ({
2352
2729
  queryKey: ["pitvox", "competition", t, h, "entrylist"],
2353
- queryFn: () => D(e, `competitions/${t}/${h}/entrylist.json`),
2730
+ queryFn: () => M(e, `competitions/${t}/${h}/entrylist.json`),
2354
2731
  enabled: !!a && d.length > 0,
2355
2732
  staleTime: 6e4
2356
2733
  }))
2357
2734
  }), c = p.some((h) => h.isLoading), u = T(() => {
2358
- var m, g;
2359
- if (!i || !a || c) return [];
2360
- const h = /* @__PURE__ */ new Date(), k = [];
2361
- for (let b = 0; b < i.length; b++) {
2362
- const x = i[b], w = (m = p[b]) == null ? void 0 : m.data;
2363
- if (!((g = w == null ? void 0 : w.drivers) == null ? void 0 : g.some((N) => N.steamId === a))) continue;
2364
- const M = x.type === "hotlap", P = x.rounds || [];
2365
- for (const N of P) {
2366
- if (M ? j(N) : N.isFinalized) continue;
2367
- const y = N.dediStatus === "running" || N.dediStatus === "provisioning", A = N.dediStatus === "scheduled", R = N.startTime && new Date(N.startTime) > h, H = y || A || N.dediServerAddress;
2368
- !y && !R && !H || k.push({
2369
- competitionId: x.id,
2370
- competitionName: x.name,
2735
+ var x, m;
2736
+ if (!o || !a || c) return [];
2737
+ const h = /* @__PURE__ */ new Date(), y = [];
2738
+ for (let b = 0; b < o.length; b++) {
2739
+ const g = o[b], k = (x = p[b]) == null ? void 0 : x.data;
2740
+ if (!((m = k == null ? void 0 : k.drivers) == null ? void 0 : m.some((N) => N.steamId === a))) continue;
2741
+ const P = g.type === "hotlap", A = g.rounds || [];
2742
+ for (const N of A) {
2743
+ if (P ? O(N) : N.isFinalized) continue;
2744
+ const w = N.dediStatus === "running" || N.dediStatus === "provisioning", D = N.dediStatus === "scheduled", $ = N.startTime && new Date(N.startTime) > h, j = w || D || N.dediServerAddress;
2745
+ !w && !$ && !j || y.push({
2746
+ competitionId: g.id,
2747
+ competitionName: g.name,
2371
2748
  roundNumber: N.roundNumber,
2372
2749
  track: N.track || "TBD",
2373
2750
  startTime: N.startTime,
@@ -2376,11 +2753,11 @@ function nt() {
2376
2753
  });
2377
2754
  }
2378
2755
  }
2379
- return k.sort((b, x) => {
2380
- const w = b.dediStatus === "running" || b.dediStatus === "provisioning", C = x.dediStatus === "running" || x.dediStatus === "provisioning";
2381
- return w && !C ? -1 : !w && C ? 1 : new Date(b.startTime) - new Date(x.startTime);
2382
- }), k.length > 0 && (k[0].isNext = !0), k;
2383
- }, [i, a, c, p]), v = xe({
2756
+ return y.sort((b, g) => {
2757
+ const k = b.dediStatus === "running" || b.dediStatus === "provisioning", C = g.dediStatus === "running" || g.dediStatus === "provisioning";
2758
+ return k && !C ? -1 : !k && C ? 1 : new Date(b.startTime) - new Date(g.startTime);
2759
+ }), y.length > 0 && (y[0].isNext = !0), y;
2760
+ }, [o, a, c, p]), v = be({
2384
2761
  queries: u.map((h) => ({
2385
2762
  queryKey: ["pitvox", "serverInfo", h.competitionId, h.roundNumber],
2386
2763
  queryFn: () => s(h.competitionId, h.roundNumber),
@@ -2391,25 +2768,25 @@ function nt() {
2391
2768
  }))
2392
2769
  });
2393
2770
  return {
2394
- data: T(() => u.length ? s ? u.map((h, k) => {
2395
- var g;
2396
- const m = (g = v[k]) == null ? void 0 : g.data;
2397
- return m != null && m.success ? {
2771
+ data: T(() => u.length ? s ? u.map((h, y) => {
2772
+ var m;
2773
+ const x = (m = v[y]) == null ? void 0 : m.data;
2774
+ return x != null && x.success ? {
2398
2775
  ...h,
2399
- serverAddress: m.serverAddress || null,
2400
- serverPassword: m.serverPassword || null
2776
+ serverAddress: x.serverAddress || null,
2777
+ serverPassword: x.serverPassword || null
2401
2778
  } : h;
2402
2779
  }) : u : [], [u, s, v]),
2403
- isLoading: o || !!a && c
2780
+ isLoading: i || !!a && c
2404
2781
  };
2405
2782
  }
2406
- function tt() {
2407
- const { onFetchNotifications: e } = L();
2783
+ function St() {
2784
+ const { onFetchNotifications: e } = S();
2408
2785
  return !!e;
2409
2786
  }
2410
- function rt(e = {}) {
2411
- const { onFetchNotifications: t, partnerSlug: r } = L(), { limit: s = 20, unreadOnly: a = !1 } = e;
2412
- return $({
2787
+ function Lt(e = {}) {
2788
+ const { onFetchNotifications: t, partnerSlug: r } = S(), { limit: s = 20, unreadOnly: a = !1 } = e;
2789
+ return R({
2413
2790
  queryKey: ["pitvox", "notifications", r, { limit: s, unreadOnly: a }],
2414
2791
  queryFn: () => t({ limit: s, unreadOnly: a }),
2415
2792
  enabled: !!t,
@@ -2417,8 +2794,8 @@ function rt(e = {}) {
2417
2794
  refetchInterval: 3e4
2418
2795
  });
2419
2796
  }
2420
- function Ot() {
2421
- const { onFetchNotifications: e, partnerSlug: t } = L(), { data: r, isLoading: s } = $({
2797
+ function gr() {
2798
+ const { onFetchNotifications: e, partnerSlug: t } = S(), { data: r, isLoading: s } = R({
2422
2799
  queryKey: ["pitvox", "notifications", t, { limit: 1, unreadOnly: !1 }],
2423
2800
  queryFn: () => e({ limit: 1 }),
2424
2801
  enabled: !!e,
@@ -2428,9 +2805,9 @@ function Ot() {
2428
2805
  });
2429
2806
  return { count: r ?? 0, isLoading: s };
2430
2807
  }
2431
- function st() {
2432
- const { onMarkNotificationRead: e, partnerSlug: t } = L(), r = O();
2433
- return Y({
2808
+ function $t() {
2809
+ const { onMarkNotificationRead: e, partnerSlug: t } = S(), r = V();
2810
+ return G({
2434
2811
  mutationFn: (s) => {
2435
2812
  if (!e)
2436
2813
  throw new Error("No onMarkNotificationRead callback provided to PitVoxPartnerProvider.");
@@ -2439,20 +2816,20 @@ function st() {
2439
2816
  onSuccess: (s, a) => {
2440
2817
  r.setQueriesData(
2441
2818
  { queryKey: ["pitvox", "notifications", t] },
2442
- (i) => i != null && i.notifications ? {
2443
- ...i,
2444
- unreadCount: Math.max(0, (i.unreadCount || 0) - 1),
2445
- notifications: i.notifications.map(
2446
- (o) => o.id === a ? { ...o, isRead: !0, readAt: (/* @__PURE__ */ new Date()).toISOString() } : o
2819
+ (o) => o != null && o.notifications ? {
2820
+ ...o,
2821
+ unreadCount: Math.max(0, (o.unreadCount || 0) - 1),
2822
+ notifications: o.notifications.map(
2823
+ (i) => i.id === a ? { ...i, isRead: !0, readAt: (/* @__PURE__ */ new Date()).toISOString() } : i
2447
2824
  )
2448
- } : i
2825
+ } : o
2449
2826
  );
2450
2827
  }
2451
2828
  });
2452
2829
  }
2453
- function at() {
2454
- const { onMarkAllNotificationsRead: e, partnerSlug: t } = L(), r = O();
2455
- return Y({
2830
+ function Tt() {
2831
+ const { onMarkAllNotificationsRead: e, partnerSlug: t } = S(), r = V();
2832
+ return G({
2456
2833
  mutationFn: () => {
2457
2834
  if (!e)
2458
2835
  throw new Error("No onMarkAllNotificationsRead callback provided to PitVoxPartnerProvider.");
@@ -2474,7 +2851,7 @@ function at() {
2474
2851
  }
2475
2852
  });
2476
2853
  }
2477
- function it({ driverName: e, avatarUrl: t, memberSince: r, className: s = "" }) {
2854
+ function Rt({ driverName: e, avatarUrl: t, memberSince: r, className: s = "" }) {
2478
2855
  const a = r ? new Date(r).toLocaleDateString("en-GB", { day: "2-digit", month: "2-digit", year: "numeric" }) : null;
2479
2856
  return /* @__PURE__ */ l("div", { className: `pvx-card pvx-dash-profile ${s}`, children: [
2480
2857
  t ? /* @__PURE__ */ n("img", { src: t, alt: "", className: "pvx-dash-profile-avatar" }) : /* @__PURE__ */ n("div", { className: "pvx-dash-profile-avatar pvx-dash-profile-avatar--placeholder", children: (e || "?")[0].toUpperCase() }),
@@ -2487,7 +2864,7 @@ function it({ driverName: e, avatarUrl: t, memberSince: r, className: s = "" })
2487
2864
  ] })
2488
2865
  ] });
2489
2866
  }
2490
- function ot() {
2867
+ function Mt() {
2491
2868
  return /* @__PURE__ */ l("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2492
2869
  /* @__PURE__ */ n("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
2493
2870
  /* @__PURE__ */ n("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
@@ -2495,7 +2872,7 @@ function ot() {
2495
2872
  /* @__PURE__ */ n("line", { x1: "16", y1: "3", x2: "14", y2: "21" })
2496
2873
  ] });
2497
2874
  }
2498
- function lt() {
2875
+ function Pt() {
2499
2876
  return /* @__PURE__ */ l("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2500
2877
  /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "10" }),
2501
2878
  /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "2" }),
@@ -2504,19 +2881,19 @@ function lt() {
2504
2881
  /* @__PURE__ */ n("path", { d: "M13.5 12.5l4 2.5" })
2505
2882
  ] });
2506
2883
  }
2507
- function Ne() {
2884
+ function Se() {
2508
2885
  return /* @__PURE__ */ n("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ n("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" }) });
2509
2886
  }
2510
- function be({ icon: e, value: t, label: r, items: s, labelKey: a, countKey: i }) {
2511
- const [o, d] = E(!1), p = Ve(null);
2512
- We(() => {
2513
- if (!o) return;
2887
+ function Le({ icon: e, value: t, label: r, items: s, labelKey: a, countKey: o }) {
2888
+ const [i, d] = E(!1), p = Ze(null);
2889
+ $e(() => {
2890
+ if (!i) return;
2514
2891
  function u(v) {
2515
2892
  p.current && !p.current.contains(v.target) && d(!1);
2516
2893
  }
2517
2894
  return document.addEventListener("mousedown", u), () => document.removeEventListener("mousedown", u);
2518
- }, [o]);
2519
- const c = s != null && s.length ? s.slice().sort((u, v) => v[i] - u[i]) : null;
2895
+ }, [i]);
2896
+ const c = s != null && s.length ? s.slice().sort((u, v) => v[o] - u[o]) : null;
2520
2897
  return /* @__PURE__ */ l(
2521
2898
  "div",
2522
2899
  {
@@ -2529,48 +2906,48 @@ function be({ icon: e, value: t, label: r, items: s, labelKey: a, countKey: i })
2529
2906
  /* @__PURE__ */ n("span", { className: "pvx-dash-stat-value", children: t }),
2530
2907
  /* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: r })
2531
2908
  ] }),
2532
- c && /* @__PURE__ */ n("div", { className: `pvx-dash-tooltip pvx-dash-tooltip--scrollable ${o ? "pvx-dash-tooltip--open" : ""}`, children: c.map((u, v) => /* @__PURE__ */ l("div", { className: "pvx-dash-tooltip-row", children: [
2909
+ c && /* @__PURE__ */ n("div", { className: `pvx-dash-tooltip pvx-dash-tooltip--scrollable ${i ? "pvx-dash-tooltip--open" : ""}`, children: c.map((u, v) => /* @__PURE__ */ l("div", { className: "pvx-dash-tooltip-row", children: [
2533
2910
  /* @__PURE__ */ n("span", { className: "pvx-dash-tooltip-label", children: u[a] }),
2534
- /* @__PURE__ */ n("span", { className: "pvx-dash-tooltip-value", children: u[i] })
2911
+ /* @__PURE__ */ n("span", { className: "pvx-dash-tooltip-value", children: u[o] })
2535
2912
  ] }, v)) })
2536
2913
  ]
2537
2914
  }
2538
2915
  );
2539
2916
  }
2540
- function ct({ stats: e, gameRatings: t, onGameRatingSelect: r, rating: s, className: a = "" }) {
2917
+ function Dt({ stats: e, gameRatings: t, onGameRatingSelect: r, rating: s, className: a = "" }) {
2541
2918
  if (!e) return null;
2542
- const i = e.trackBreakdown.map((p) => ({
2543
- name: V(p.trackId, p.layout),
2919
+ const o = e.trackBreakdown.map((p) => ({
2920
+ name: z(p.trackId, p.layout),
2544
2921
  lapCount: p.lapCount
2545
- })), o = e.carBreakdown.map((p) => ({
2546
- name: _(p.carId),
2922
+ })), i = e.carBreakdown.map((p) => ({
2923
+ name: I(p.carId),
2547
2924
  lapCount: p.lapCount
2548
2925
  })), d = Array.isArray(t) && t.length > 0;
2549
2926
  return /* @__PURE__ */ l("div", { className: `pvx-dash-stats ${a}`, children: [
2550
2927
  /* @__PURE__ */ n(
2551
- be,
2928
+ Le,
2552
2929
  {
2553
- icon: /* @__PURE__ */ n(ot, {}),
2930
+ icon: /* @__PURE__ */ n(Mt, {}),
2554
2931
  value: e.lapCount.toLocaleString(),
2555
2932
  label: "Total Laps",
2556
- items: i,
2933
+ items: o,
2557
2934
  labelKey: "name",
2558
2935
  countKey: "lapCount"
2559
2936
  }
2560
2937
  ),
2561
2938
  /* @__PURE__ */ n(
2562
- be,
2939
+ Le,
2563
2940
  {
2564
- icon: /* @__PURE__ */ n(lt, {}),
2941
+ icon: /* @__PURE__ */ n(Pt, {}),
2565
2942
  value: e.carBreakdown.length,
2566
2943
  label: "Cars Used",
2567
- items: o,
2944
+ items: i,
2568
2945
  labelKey: "name",
2569
2946
  countKey: "lapCount"
2570
2947
  }
2571
2948
  ),
2572
2949
  d ? /* @__PURE__ */ l("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--rating-chips", children: [
2573
- /* @__PURE__ */ n(Ne, {}),
2950
+ /* @__PURE__ */ n(Se, {}),
2574
2951
  /* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
2575
2952
  /* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: "Driver Rating" }),
2576
2953
  /* @__PURE__ */ n("div", { className: "pvx-dash-rating-chips", children: t.map((p) => {
@@ -2602,7 +2979,7 @@ function ct({ stats: e, gameRatings: t, onGameRatingSelect: r, rating: s, classN
2602
2979
  }) })
2603
2980
  ] })
2604
2981
  ] }) : s ? /* @__PURE__ */ l("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--rating", children: [
2605
- /* @__PURE__ */ n(Ne, {}),
2982
+ /* @__PURE__ */ n(Se, {}),
2606
2983
  /* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
2607
2984
  /* @__PURE__ */ n("span", { className: "pvx-dash-stat-value", children: s.rating.toFixed(1) }),
2608
2985
  /* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: "Driver Rating" }),
@@ -2616,7 +2993,7 @@ function ct({ stats: e, gameRatings: t, onGameRatingSelect: r, rating: s, classN
2616
2993
  ] }) : null
2617
2994
  ] });
2618
2995
  }
2619
- function dt({ combos: e, onComboSelect: t, className: r = "" }) {
2996
+ function At({ combos: e, onComboSelect: t, className: r = "" }) {
2620
2997
  return e != null && e.length ? /* @__PURE__ */ l("div", { className: `pvx-card ${r}`, children: [
2621
2998
  /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
2622
2999
  /* @__PURE__ */ n("span", { className: "pvx-dash-combos-icon", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
@@ -2631,7 +3008,7 @@ function dt({ combos: e, onComboSelect: t, className: r = "" }) {
2631
3008
  ] })
2632
3009
  ] }) }),
2633
3010
  /* @__PURE__ */ n("div", { className: "pvx-dash-combos-list", children: e.map((s) => /* @__PURE__ */ n(
2634
- pt,
3011
+ Et,
2635
3012
  {
2636
3013
  combo: s,
2637
3014
  onClick: t ? () => t(s) : null
@@ -2640,7 +3017,7 @@ function dt({ combos: e, onComboSelect: t, className: r = "" }) {
2640
3017
  )) })
2641
3018
  ] }) : null;
2642
3019
  }
2643
- function pt({ combo: e, onClick: t }) {
3020
+ function Et({ combo: e, onClick: t }) {
2644
3021
  const r = e.game || "evo", s = e.gapToLeaderMs && e.gapToLeaderMs > 0 ? (e.gapToLeaderMs / 1e3).toFixed(3) : null, a = e.rank === 1 && e.totalDrivers > 1;
2645
3022
  return /* @__PURE__ */ l(
2646
3023
  "div",
@@ -2656,10 +3033,10 @@ function pt({ combo: e, onClick: t }) {
2656
3033
  /* @__PURE__ */ l("div", { className: "pvx-dash-combo-info", children: [
2657
3034
  /* @__PURE__ */ l("div", { className: "pvx-dash-combo-title", children: [
2658
3035
  e.game && /* @__PURE__ */ n("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${r}`, children: r.toUpperCase() }),
2659
- /* @__PURE__ */ n("span", { className: "pvx-dash-combo-track", children: V(e.trackId, e.trackLayout, e.game) })
3036
+ /* @__PURE__ */ n("span", { className: "pvx-dash-combo-track", children: z(e.trackId, e.trackLayout, e.game) })
2660
3037
  ] }),
2661
3038
  /* @__PURE__ */ l("div", { className: "pvx-dash-combo-meta", children: [
2662
- /* @__PURE__ */ n("span", { className: "pvx-dash-combo-car", children: _(e.carId) }),
3039
+ /* @__PURE__ */ n("span", { className: "pvx-dash-combo-car", children: I(e.carId) }),
2663
3040
  e.lapCount > 0 && /* @__PURE__ */ l(B, { children: [
2664
3041
  /* @__PURE__ */ n("span", { className: "pvx-dash-combo-meta-sep", children: "·" }),
2665
3042
  /* @__PURE__ */ l("span", { children: [
@@ -2670,7 +3047,7 @@ function pt({ combo: e, onClick: t }) {
2670
3047
  ] }),
2671
3048
  e.lastDrivenAt && /* @__PURE__ */ l(B, { children: [
2672
3049
  /* @__PURE__ */ n("span", { className: "pvx-dash-combo-meta-sep", children: "·" }),
2673
- /* @__PURE__ */ n("span", { children: oe(e.lastDrivenAt) })
3050
+ /* @__PURE__ */ n("span", { children: pe(e.lastDrivenAt) })
2674
3051
  ] })
2675
3052
  ] })
2676
3053
  ] }),
@@ -2706,15 +3083,15 @@ function pt({ combo: e, onClick: t }) {
2706
3083
  }
2707
3084
  );
2708
3085
  }
2709
- function ut({ events: e, isLoading: t, className: r, limit: s = 3 }) {
3086
+ function Bt({ events: e, isLoading: t, className: r, limit: s = 3 }) {
2710
3087
  if (t)
2711
3088
  return /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading upcoming events..." });
2712
3089
  if (!(e != null && e.length))
2713
3090
  return null;
2714
- const a = s ? e.slice(0, s) : e, i = e.length - a.length;
3091
+ const a = s ? e.slice(0, s) : e, o = e.length - a.length;
2715
3092
  return /* @__PURE__ */ l("div", { className: `pvx-card ${r || ""}`, children: [
2716
3093
  /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
2717
- /* @__PURE__ */ n(vt, {}),
3094
+ /* @__PURE__ */ n(It, {}),
2718
3095
  "Upcoming Events",
2719
3096
  /* @__PURE__ */ l("span", { className: "pvx-dash-records-count", children: [
2720
3097
  "(",
@@ -2723,67 +3100,67 @@ function ut({ events: e, isLoading: t, className: r, limit: s = 3 }) {
2723
3100
  ] })
2724
3101
  ] }) }),
2725
3102
  /* @__PURE__ */ l("div", { className: "pvx-upcoming-list", children: [
2726
- a.map((o) => /* @__PURE__ */ l(
3103
+ a.map((i) => /* @__PURE__ */ l(
2727
3104
  "div",
2728
3105
  {
2729
- className: `pvx-upcoming-item ${o.isNext ? "pvx-upcoming-item--next" : ""}`,
3106
+ className: `pvx-upcoming-item ${i.isNext ? "pvx-upcoming-item--next" : ""}`,
2730
3107
  children: [
2731
3108
  /* @__PURE__ */ l("div", { className: "pvx-upcoming-info", children: [
2732
- /* @__PURE__ */ n("span", { className: "pvx-upcoming-comp", children: o.competitionName }),
3109
+ /* @__PURE__ */ n("span", { className: "pvx-upcoming-comp", children: i.competitionName }),
2733
3110
  /* @__PURE__ */ l("span", { className: "pvx-upcoming-round", children: [
2734
3111
  "Round ",
2735
- o.roundNumber,
3112
+ i.roundNumber,
2736
3113
  ": ",
2737
- o.track
3114
+ i.track
2738
3115
  ] }),
2739
- o.serverPassword && /* @__PURE__ */ n(
2740
- ht,
3116
+ i.serverPassword && /* @__PURE__ */ n(
3117
+ Ut,
2741
3118
  {
2742
- password: o.serverPassword,
2743
- address: o.serverAddress
3119
+ password: i.serverPassword,
3120
+ address: i.serverAddress
2744
3121
  }
2745
3122
  )
2746
3123
  ] }),
2747
3124
  /* @__PURE__ */ l("div", { className: "pvx-upcoming-time", children: [
2748
- /* @__PURE__ */ n("span", { className: "pvx-upcoming-date", children: new Date(o.startTime).toLocaleDateString("en-GB", {
3125
+ /* @__PURE__ */ n("span", { className: "pvx-upcoming-date", children: new Date(i.startTime).toLocaleDateString("en-GB", {
2749
3126
  day: "numeric",
2750
3127
  month: "short",
2751
3128
  year: "numeric"
2752
3129
  }) }),
2753
- /* @__PURE__ */ n("span", { className: "pvx-upcoming-relative", children: o.dediStatus === "running" ? "Live now" : o.dediStatus === "provisioning" ? "Starting..." : mt(o.startTime) }),
2754
- o.dediStatus === "running" && /* @__PURE__ */ n("span", { className: "pvx-upcoming-badge pvx-upcoming-badge--live", children: "Live" }),
2755
- !o.dediStatus && o.isNext && /* @__PURE__ */ n("span", { className: "pvx-upcoming-badge", children: "Next" })
3130
+ /* @__PURE__ */ n("span", { className: "pvx-upcoming-relative", children: i.dediStatus === "running" ? "Live now" : i.dediStatus === "provisioning" ? "Starting..." : _t(i.startTime) }),
3131
+ i.dediStatus === "running" && /* @__PURE__ */ n("span", { className: "pvx-upcoming-badge pvx-upcoming-badge--live", children: "Live" }),
3132
+ !i.dediStatus && i.isNext && /* @__PURE__ */ n("span", { className: "pvx-upcoming-badge", children: "Next" })
2756
3133
  ] })
2757
3134
  ]
2758
3135
  },
2759
- `${o.competitionId}-${o.roundNumber}`
3136
+ `${i.competitionId}-${i.roundNumber}`
2760
3137
  )),
2761
- i > 0 && /* @__PURE__ */ l("div", { className: "pvx-upcoming-remaining", children: [
3138
+ o > 0 && /* @__PURE__ */ l("div", { className: "pvx-upcoming-remaining", children: [
2762
3139
  "+",
2763
- i,
3140
+ o,
2764
3141
  " more event",
2765
- i !== 1 ? "s" : ""
3142
+ o !== 1 ? "s" : ""
2766
3143
  ] })
2767
3144
  ] })
2768
3145
  ] });
2769
3146
  }
2770
- function ht({ password: e, address: t }) {
2771
- const [r, s] = E(!1), [a, i] = E(!1), o = t ? e ? `join:${t}|${e}` : `join:${t}` : null, d = K(async () => {
2772
- if (o)
3147
+ function Ut({ password: e, address: t }) {
3148
+ const [r, s] = E(!1), [a, o] = E(!1), i = t ? e ? `join:${t}|${e}` : `join:${t}` : null, d = H(async () => {
3149
+ if (i)
2773
3150
  try {
2774
- await navigator.clipboard.writeText(o), s(!0), setTimeout(() => s(!1), 2e3);
3151
+ await navigator.clipboard.writeText(i), s(!0), setTimeout(() => s(!1), 2e3);
2775
3152
  } catch {
2776
3153
  }
2777
- }, [o]);
3154
+ }, [i]);
2778
3155
  return /* @__PURE__ */ l("div", { className: "pvx-server-info", children: [
2779
- o && /* @__PURE__ */ l(
3156
+ i && /* @__PURE__ */ l(
2780
3157
  "span",
2781
3158
  {
2782
3159
  className: "pvx-server-detail pvx-server-detail--clickable",
2783
3160
  onClick: d,
2784
3161
  title: "Copy join string to clipboard",
2785
3162
  children: [
2786
- /* @__PURE__ */ n(gt, {}),
3163
+ /* @__PURE__ */ n(qt, {}),
2787
3164
  " ",
2788
3165
  r ? "Copied!" : "Join"
2789
3166
  ]
@@ -2794,20 +3171,20 @@ function ht({ password: e, address: t }) {
2794
3171
  "span",
2795
3172
  {
2796
3173
  className: "pvx-server-detail pvx-server-detail--clickable",
2797
- onClick: () => i((p) => !p),
3174
+ onClick: () => o((p) => !p),
2798
3175
  title: a ? "Hide password" : "Reveal password",
2799
- children: a ? /* @__PURE__ */ n(Nt, {}) : /* @__PURE__ */ n(ft, {})
3176
+ children: a ? /* @__PURE__ */ n(jt, {}) : /* @__PURE__ */ n(Wt, {})
2800
3177
  }
2801
3178
  ),
2802
3179
  a && /* @__PURE__ */ l("span", { className: "pvx-server-detail", children: [
2803
- /* @__PURE__ */ n(xt, {}),
3180
+ /* @__PURE__ */ n(Ft, {}),
2804
3181
  " ",
2805
3182
  e
2806
3183
  ] })
2807
3184
  ] })
2808
3185
  ] });
2809
3186
  }
2810
- function mt(e) {
3187
+ function _t(e) {
2811
3188
  const t = new Date(e).getTime() - Date.now();
2812
3189
  if (t <= 0) return "Now";
2813
3190
  const r = Math.floor(t / (1e3 * 60 * 60));
@@ -2820,61 +3197,61 @@ function mt(e) {
2820
3197
  const a = Math.floor(s / 7);
2821
3198
  return `in ${a} week${a !== 1 ? "s" : ""}`;
2822
3199
  }
2823
- return oe(e);
3200
+ return pe(e);
2824
3201
  }
2825
- function vt() {
3202
+ function It() {
2826
3203
  return /* @__PURE__ */ l("svg", { className: "pvx-dash-records-icon", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2827
3204
  /* @__PURE__ */ n("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
2828
3205
  /* @__PURE__ */ n("path", { d: "M16 2v4M8 2v4M3 10h18" })
2829
3206
  ] });
2830
3207
  }
2831
- function xt() {
3208
+ function Ft() {
2832
3209
  return /* @__PURE__ */ l("svg", { className: "pvx-server-icon", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2833
3210
  /* @__PURE__ */ n("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2" }),
2834
3211
  /* @__PURE__ */ n("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
2835
3212
  ] });
2836
3213
  }
2837
- function gt() {
3214
+ function qt() {
2838
3215
  return /* @__PURE__ */ l("svg", { className: "pvx-server-icon pvx-server-icon--action", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2839
3216
  /* @__PURE__ */ n("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
2840
3217
  /* @__PURE__ */ n("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
2841
3218
  ] });
2842
3219
  }
2843
- function ft() {
3220
+ function Wt() {
2844
3221
  return /* @__PURE__ */ l("svg", { className: "pvx-server-icon pvx-server-icon--action", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2845
3222
  /* @__PURE__ */ n("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
2846
3223
  /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "3" })
2847
3224
  ] });
2848
3225
  }
2849
- function Nt() {
3226
+ function jt() {
2850
3227
  return /* @__PURE__ */ l("svg", { className: "pvx-server-icon pvx-server-icon--action", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2851
3228
  /* @__PURE__ */ n("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }),
2852
3229
  /* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
2853
3230
  ] });
2854
3231
  }
2855
- function bt({ notifications: e, unreadCount: t = 0, onMarkRead: r, onMarkAllRead: s, isLoading: a, className: i }) {
2856
- const o = Ce();
2857
- return a ? /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading notifications..." }) : /* @__PURE__ */ l("div", { className: `pvx-card ${i || ""}`, children: [
3232
+ function Vt({ notifications: e, unreadCount: t = 0, onMarkRead: r, onMarkAllRead: s, isLoading: a, className: o }) {
3233
+ const i = ue();
3234
+ return a ? /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading notifications..." }) : /* @__PURE__ */ l("div", { className: `pvx-card ${o || ""}`, children: [
2858
3235
  /* @__PURE__ */ l("div", { className: "pvx-card-header", children: [
2859
3236
  /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
2860
- /* @__PURE__ */ n(wt, {}),
3237
+ /* @__PURE__ */ n(Ot, {}),
2861
3238
  "Notifications",
2862
3239
  t > 0 && /* @__PURE__ */ n("span", { className: "pvx-notif-badge", children: t > 99 ? "99+" : t })
2863
3240
  ] }),
2864
3241
  t > 0 && s && /* @__PURE__ */ n("button", { className: "pvx-notif-mark-all", onClick: s, children: "Mark all read" })
2865
3242
  ] }),
2866
3243
  e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-notif-list", children: e.map((d) => /* @__PURE__ */ n(
2867
- yt,
3244
+ Kt,
2868
3245
  {
2869
3246
  notification: d,
2870
- getUserDisplay: o,
3247
+ getUserDisplay: i,
2871
3248
  onMarkRead: r
2872
3249
  },
2873
3250
  d.id
2874
3251
  )) }) : /* @__PURE__ */ n("div", { className: "pvx-notif-empty", children: "No notifications" })
2875
3252
  ] });
2876
3253
  }
2877
- function yt({ notification: e, getUserDisplay: t, onMarkRead: r }) {
3254
+ function Kt({ notification: e, getUserDisplay: t, onMarkRead: r }) {
2878
3255
  const s = () => {
2879
3256
  !e.isRead && r && r(e.id);
2880
3257
  };
@@ -2884,17 +3261,17 @@ function yt({ notification: e, getUserDisplay: t, onMarkRead: r }) {
2884
3261
  className: `pvx-notif-item ${e.isRead ? "" : "pvx-notif-item--unread"}`,
2885
3262
  onClick: s,
2886
3263
  children: [
2887
- /* @__PURE__ */ n(kt, { type: e.type }),
3264
+ /* @__PURE__ */ n(Ht, { type: e.type }),
2888
3265
  /* @__PURE__ */ l("div", { className: "pvx-notif-content", children: [
2889
- /* @__PURE__ */ n("span", { className: "pvx-notif-message", children: Ze(e, t) }),
2890
- /* @__PURE__ */ n("span", { className: "pvx-notif-time", children: oe(e.createdAt) })
3266
+ /* @__PURE__ */ n("span", { className: "pvx-notif-message", children: an(e, t) }),
3267
+ /* @__PURE__ */ n("span", { className: "pvx-notif-time", children: pe(e.createdAt) })
2891
3268
  ] }),
2892
3269
  !e.isRead && /* @__PURE__ */ n("span", { className: "pvx-notif-dot" })
2893
3270
  ]
2894
3271
  }
2895
3272
  );
2896
3273
  }
2897
- function kt({ type: e }) {
3274
+ function Ht({ type: e }) {
2898
3275
  return e === "RECORD_BEATEN" ? /* @__PURE__ */ n("span", { className: "pvx-notif-icon pvx-notif-icon--beaten", children: /* @__PURE__ */ n("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ n("path", { d: "m7 7 10 10M17 7v10H7" }) }) }) : e === "ADMIN_MESSAGE" ? /* @__PURE__ */ n("span", { className: "pvx-notif-icon pvx-notif-icon--admin", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2899
3276
  /* @__PURE__ */ n("path", { d: "m3 11 18-5v12L3 13v-2z" }),
2900
3277
  /* @__PURE__ */ n("path", { d: "M11.6 16.8a3 3 0 1 1-5.8-1.6" })
@@ -2907,25 +3284,25 @@ function kt({ type: e }) {
2907
3284
  /* @__PURE__ */ n("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
2908
3285
  ] }) });
2909
3286
  }
2910
- function wt() {
3287
+ function Ot() {
2911
3288
  return /* @__PURE__ */ l("svg", { className: "pvx-dash-records-icon", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2912
3289
  /* @__PURE__ */ n("path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" }),
2913
3290
  /* @__PURE__ */ n("path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0" })
2914
3291
  ] });
2915
3292
  }
2916
- function Gt({
3293
+ function fr({
2917
3294
  steamId: e,
2918
3295
  avatarUrl: t,
2919
3296
  memberSince: r,
2920
3297
  hideProfile: s = !1,
2921
3298
  onComboSelect: a,
2922
- onGameRatingSelect: i,
2923
- className: o = ""
3299
+ onGameRatingSelect: o,
3300
+ className: i = ""
2924
3301
  }) {
2925
- const { data: d, isLoading: p, error: c } = Jn(e), { data: u } = et(e), { data: v } = Xn(e), { data: f, isLoading: h } = nt(), k = tt(), { data: m, isLoading: g } = rt({ limit: 10 }), b = st(), x = at();
2926
- return p ? /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading dashboard..." }) : c ? /* @__PURE__ */ n("div", { className: "pvx-empty", children: "Failed to load dashboard data." }) : d ? /* @__PURE__ */ l("div", { className: `pvx-dash ${o}`, children: [
3302
+ const { data: d, isLoading: p, error: c } = bt(e), { data: u } = kt(e), { data: v } = wt(e), { data: f, isLoading: h } = Ct(), y = St(), { data: x, isLoading: m } = Lt({ limit: 10 }), b = $t(), g = Tt();
3303
+ return p ? /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading dashboard..." }) : c ? /* @__PURE__ */ n("div", { className: "pvx-empty", children: "Failed to load dashboard data." }) : d ? /* @__PURE__ */ l("div", { className: `pvx-dash ${i}`, children: [
2927
3304
  !s && /* @__PURE__ */ n(
2928
- it,
3305
+ Rt,
2929
3306
  {
2930
3307
  driverName: d.driverName,
2931
3308
  avatarUrl: t,
@@ -2933,33 +3310,33 @@ function Gt({
2933
3310
  }
2934
3311
  ),
2935
3312
  /* @__PURE__ */ n(
2936
- ct,
3313
+ Dt,
2937
3314
  {
2938
3315
  stats: d,
2939
3316
  gameRatings: u,
2940
- onGameRatingSelect: i
3317
+ onGameRatingSelect: o
2941
3318
  }
2942
3319
  ),
2943
- e && /* @__PURE__ */ n(ut, { events: f, isLoading: h }),
2944
- /* @__PURE__ */ l("div", { className: `pvx-dash-row ${k ? "pvx-dash-row--2col" : ""}`, children: [
2945
- /* @__PURE__ */ n(dt, { combos: v, onComboSelect: a }),
2946
- k && /* @__PURE__ */ n(
2947
- bt,
3320
+ e && /* @__PURE__ */ n(Bt, { events: f, isLoading: h }),
3321
+ /* @__PURE__ */ l("div", { className: `pvx-dash-row ${y ? "pvx-dash-row--2col" : ""}`, children: [
3322
+ /* @__PURE__ */ n(At, { combos: v, onComboSelect: a }),
3323
+ y && /* @__PURE__ */ n(
3324
+ Vt,
2948
3325
  {
2949
- notifications: m == null ? void 0 : m.notifications,
2950
- unreadCount: (m == null ? void 0 : m.unreadCount) || 0,
2951
- onMarkRead: (w) => b.mutate(w),
2952
- onMarkAllRead: () => x.mutate(),
2953
- isLoading: g
3326
+ notifications: x == null ? void 0 : x.notifications,
3327
+ unreadCount: (x == null ? void 0 : x.unreadCount) || 0,
3328
+ onMarkRead: (k) => b.mutate(k),
3329
+ onMarkAllRead: () => g.mutate(),
3330
+ isLoading: m
2954
3331
  }
2955
3332
  )
2956
3333
  ] })
2957
3334
  ] }) : /* @__PURE__ */ n("div", { className: "pvx-empty", children: "No data available yet. Start driving to see your stats!" });
2958
3335
  }
2959
- function zt({ records: e, className: t = "" }) {
3336
+ function Nr({ records: e, className: t = "" }) {
2960
3337
  const r = T(() => e != null && e.length ? e.slice().sort((s, a) => {
2961
- const i = s.recordedAt ? new Date(s.recordedAt).getTime() : 0;
2962
- return (a.recordedAt ? new Date(a.recordedAt).getTime() : 0) - i;
3338
+ const o = s.recordedAt ? new Date(s.recordedAt).getTime() : 0;
3339
+ return (a.recordedAt ? new Date(a.recordedAt).getTime() : 0) - o;
2963
3340
  }) : [], [e]);
2964
3341
  return r.length ? /* @__PURE__ */ l("div", { className: `pvx-card ${t}`, children: [
2965
3342
  /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
@@ -2980,8 +3357,8 @@ function zt({ records: e, className: t = "" }) {
2980
3357
  ] }) }),
2981
3358
  /* @__PURE__ */ n("div", { className: "pvx-dash-records-list", children: r.map((s, a) => /* @__PURE__ */ l("div", { className: "pvx-dash-record-row", children: [
2982
3359
  /* @__PURE__ */ l("div", { className: "pvx-dash-record-info", children: [
2983
- /* @__PURE__ */ n("span", { className: "pvx-dash-record-track", children: V(s.trackId, s.layout, s.game) }),
2984
- /* @__PURE__ */ n("span", { className: "pvx-dash-record-car", children: _(s.carId) })
3360
+ /* @__PURE__ */ n("span", { className: "pvx-dash-record-track", children: z(s.trackId, s.layout, s.game) }),
3361
+ /* @__PURE__ */ n("span", { className: "pvx-dash-record-car", children: I(s.carId) })
2985
3362
  ] }),
2986
3363
  /* @__PURE__ */ l("div", { className: "pvx-dash-record-time", children: [
2987
3364
  /* @__PURE__ */ n("span", { className: "pvx-dash-record-lap", children: q(s.lapTimeMs) }),
@@ -2994,91 +3371,110 @@ function zt({ records: e, className: t = "" }) {
2994
3371
  ] }) : null;
2995
3372
  }
2996
3373
  export {
2997
- Bt as CarsTable,
2998
- U as CompEmptyState,
3374
+ ir as CarsTable,
3375
+ _ as CompEmptyState,
2999
3376
  W as CompLoadingState,
3000
- En as CompetitionCard,
3001
- Ft as CompetitionCards,
3002
- Wt as CompetitionResultsTabs,
3003
- wn as CompletedBadge,
3004
- Be as DEFAULT_COMPLETION_GRACE_DAYS,
3005
- Gt as DriverDashboard,
3006
- it as DriverProfile,
3007
- It as DriversTable,
3008
- Ht as EntryList,
3009
- re as InfoPill,
3010
- Et as LapHistoryTable,
3011
- bt as NotificationsCard,
3012
- he as PODIUM_MEDALS,
3013
- Rt as PitVoxPartnerProvider,
3014
- Vn as RacePositionsChart,
3015
- _t as RankingsTable,
3016
- dt as RecentCombosCard,
3017
- zt as RecordsTable,
3018
- jt as RegisterButton,
3019
- Vt as RegistrationPanel,
3020
- qt as RoundResults,
3021
- ve as RoundSessionResults,
3022
- Fn as StandingsTable,
3023
- ct as StatsCards,
3024
- Pt as TracksTable,
3025
- gn as TypeBadge,
3026
- ut as UpcomingEvents,
3027
- In as WeatherIcon,
3028
- ye as buildDriverIndexPath,
3029
- Qe as buildLapsPath,
3030
- ie as buildLeaderboardPath,
3031
- Ye as buildRecentLapsPath,
3032
- D as fetchCdnJson,
3033
- Ut as filterCompetitionsByStatus,
3034
- _ as formatCarName,
3035
- G as formatDate,
3036
- Tt as formatDelta,
3037
- we as formatFuel,
3377
+ at as CompetitionCard,
3378
+ dr as CompetitionCards,
3379
+ vr as CompetitionResultsTabs,
3380
+ On as CompletedBadge,
3381
+ Ue as DEFAULT_COMPLETION_GRACE_DAYS,
3382
+ fr as DriverDashboard,
3383
+ Rt as DriverProfile,
3384
+ or as DriversTable,
3385
+ Fn as EnterButton,
3386
+ ur as EntryList,
3387
+ ae as InfoPill,
3388
+ lr as LapHistoryTable,
3389
+ Vt as NotificationsCard,
3390
+ xe as PODIUM_MEDALS,
3391
+ xn as PROMOTION_STATUS_LABELS,
3392
+ Zt as PitVoxPartnerProvider,
3393
+ In as PromotionCard,
3394
+ _n as PromotionCards,
3395
+ qn as PromotionDetail,
3396
+ sr as PromotionExplorer,
3397
+ Ie as PromotionStatusBadge,
3398
+ Fe as PromotionTypeBadge,
3399
+ ut as RacePositionsChart,
3400
+ cr as RankingsTable,
3401
+ At as RecentCombosCard,
3402
+ Nr as RecordsTable,
3403
+ hr as RegisterButton,
3404
+ mr as RegistrationPanel,
3405
+ pr as RoundResults,
3406
+ ye as RoundSessionResults,
3407
+ lt as StandingsTable,
3408
+ Dt as StatsCards,
3409
+ ar as TracksTable,
3410
+ Rn as TypeBadge,
3411
+ Bt as UpcomingEvents,
3412
+ st as WeatherIcon,
3413
+ Te as buildDriverIndexPath,
3414
+ rn as buildLapsPath,
3415
+ de as buildLeaderboardPath,
3416
+ sn as buildRecentLapsPath,
3417
+ M as fetchCdnJson,
3418
+ rr as filterCompetitionsByStatus,
3419
+ I as formatCarName,
3420
+ Q as formatDate,
3421
+ Jt as formatDelta,
3422
+ Me as formatFuel,
3038
3423
  q as formatLapTime,
3039
- Ze as formatNotificationMessage,
3040
- oe as formatRelativeTime,
3424
+ an as formatNotificationMessage,
3425
+ K as formatPromotionDate,
3426
+ pe as formatRelativeTime,
3041
3427
  F as formatSectorTime,
3042
- ee as formatSessionLabel,
3043
- V as formatTrackName,
3044
- ke as formatTyreCompound,
3045
- kn as getCompetitionPodium,
3046
- Ie as getCompetitionStatus,
3047
- yn as getCompletionDate,
3048
- bn as isCompetitionComplete,
3049
- j as isRoundClosed,
3050
- Dt as useCarLeaderboard,
3051
- $t as useCarMetadata,
3052
- tn as useCompetitionAllRounds,
3053
- Se as useCompetitionConfig,
3054
- Re as useCompetitionEntryList,
3055
- rn as useCompetitionLeaderboard,
3056
- nn as useCompetitionRound,
3057
- an as useCompetitionRoundLaps,
3058
- sn as useCompetitionRoundLeaderboard,
3059
- on as useCompetitionRoundPositions,
3060
- Le as useCompetitionStandings,
3061
- At as useCompetitions,
3062
- Xn as useDriverCombos,
3063
- en as useDriverLaps,
3064
- Kt as useDriverRating,
3065
- se as useDriverRatings,
3066
- et as useDriverRatingsByGame,
3067
- Jn as useDriverStats,
3068
- Je as useLeaderboardIndex,
3069
- at as useMarkAllNotificationsRead,
3070
- st as useMarkNotificationRead,
3071
- rt as useNotifications,
3072
- tt as useNotificationsEnabled,
3073
- L as usePitVox,
3074
- Mt as useRecentLaps,
3075
- Te as useRegister,
3076
- ce as useRegistrationMode,
3077
- le as useRegistrationStatus,
3078
- de as useRegistrationUrl,
3079
- Xe as useTrackLeaderboard,
3080
- Ot as useUnreadCount,
3081
- nt as useUpcomingEvents,
3082
- Ce as useUserLookup,
3083
- $e as useWithdraw
3428
+ X as formatSessionLabel,
3429
+ z as formatTrackName,
3430
+ Re as formatTyreCompound,
3431
+ En as getCompetitionPodium,
3432
+ _e as getCompetitionStatus,
3433
+ An as getCompletionDate,
3434
+ J as getPromotionStatus,
3435
+ Dn as isCompetitionComplete,
3436
+ O as isRoundClosed,
3437
+ Un as promotionWindowSummary,
3438
+ nr as useCarLeaderboard,
3439
+ Xt as useCarMetadata,
3440
+ pn as useCompetitionAllRounds,
3441
+ Pe as useCompetitionConfig,
3442
+ Ae as useCompetitionEntryList,
3443
+ un as useCompetitionLeaderboard,
3444
+ dn as useCompetitionRound,
3445
+ mn as useCompetitionRoundLaps,
3446
+ hn as useCompetitionRoundLeaderboard,
3447
+ vn as useCompetitionRoundPositions,
3448
+ De as useCompetitionStandings,
3449
+ tr as useCompetitions,
3450
+ wt as useDriverCombos,
3451
+ cn as useDriverLaps,
3452
+ xr as useDriverRating,
3453
+ ie as useDriverRatings,
3454
+ kt as useDriverRatingsByGame,
3455
+ bt as useDriverStats,
3456
+ bn as useEnterPromotion,
3457
+ on as useLeaderboardIndex,
3458
+ Tt as useMarkAllNotificationsRead,
3459
+ $t as useMarkNotificationRead,
3460
+ Lt as useNotifications,
3461
+ St as useNotificationsEnabled,
3462
+ S as usePitVox,
3463
+ fn as usePromotionConfig,
3464
+ Nn as usePromotionEntryList,
3465
+ yn as usePromotionEntryStatus,
3466
+ kn as usePromotionMode,
3467
+ Cn as usePromotionUrl,
3468
+ gn as usePromotions,
3469
+ er as useRecentLaps,
3470
+ Ee as useRegister,
3471
+ me as useRegistrationMode,
3472
+ he as useRegistrationStatus,
3473
+ ve as useRegistrationUrl,
3474
+ ln as useTrackLeaderboard,
3475
+ gr as useUnreadCount,
3476
+ Ct as useUpcomingEvents,
3477
+ ue as useUserLookup,
3478
+ Be as useWithdraw,
3479
+ wn as useWithdrawPromotionEntry
3084
3480
  };