@pitvox/partner-react 0.7.8 → 0.7.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +1328 -1267
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,92 +1,92 @@
1
- import { jsx as n, jsxs as c, Fragment as U } from "react/jsx-runtime";
2
- import { createContext as Me, useMemo as L, useContext as De, useState as D, useCallback as H, useRef as Ie, useEffect as Be } from "react";
3
- import { useQueryClient as _, QueryClient as Pe, QueryClientProvider as Ae, useQuery as S, useMutation as O, useQueries as ie } from "@tanstack/react-query";
4
- const J = Me(null), Ue = "https://cdn.pitvox.com", Ee = "https://pitvox.com";
5
- let Q = null;
6
- function Zn({
1
+ import { jsx as t, jsxs as l, Fragment as U } from "react/jsx-runtime";
2
+ import { createContext as De, useMemo as L, useContext as Ie, useState as D, useCallback as H, useRef as Pe, useEffect as Be } from "react";
3
+ import { useQueryClient as _, QueryClient as Ae, QueryClientProvider as Ue, useQuery as S, useMutation as O, useQueries as ce } from "@tanstack/react-query";
4
+ const Z = De(null), Ee = "https://cdn.pitvox.com", Fe = "https://pitvox.com";
5
+ let Y = null;
6
+ function en({
7
7
  partnerSlug: e = null,
8
- cdnUrl: t = Ue,
9
- pitvoxUrl: r = Ee,
10
- getSteamId: s,
8
+ cdnUrl: n = Ee,
9
+ pitvoxUrl: s = Fe,
10
+ getSteamId: r,
11
11
  onRegister: a,
12
12
  onWithdraw: i,
13
13
  onFetchNotifications: o,
14
14
  onMarkNotificationRead: d,
15
- onMarkAllNotificationsRead: u,
16
- onFetchServerPassword: l,
17
- children: p
15
+ onMarkAllNotificationsRead: p,
16
+ onFetchServerPassword: c,
17
+ children: u
18
18
  }) {
19
- const f = L(() => ({
19
+ const g = L(() => ({
20
20
  partnerSlug: e,
21
- cdnUrl: t.replace(/\/$/, ""),
22
- pitvoxUrl: r.replace(/\/$/, ""),
23
- getSteamId: s || (() => null),
21
+ cdnUrl: n.replace(/\/$/, ""),
22
+ pitvoxUrl: s.replace(/\/$/, ""),
23
+ getSteamId: r || (() => null),
24
24
  onRegister: a || null,
25
25
  onWithdraw: i || null,
26
26
  onFetchNotifications: o || null,
27
27
  onMarkNotificationRead: d || null,
28
- onMarkAllNotificationsRead: u || null,
29
- onFetchServerPassword: l || null
30
- }), [e, t, r, s, a, i, o, d, u, l]);
31
- let g = !1;
28
+ onMarkAllNotificationsRead: p || null,
29
+ onFetchServerPassword: c || null
30
+ }), [e, n, s, r, a, i, o, d, p, c]);
31
+ let f = !1;
32
32
  try {
33
- _(), g = !0;
33
+ _(), f = !0;
34
34
  } catch {
35
- g = !1;
35
+ f = !1;
36
36
  }
37
- return g ? /* @__PURE__ */ n(J.Provider, { value: f, children: p }) : (Q || (Q = new Pe({
37
+ return f ? /* @__PURE__ */ t(Z.Provider, { value: g, children: u }) : (Y || (Y = new Ae({
38
38
  defaultOptions: {
39
39
  queries: { staleTime: 6e4 }
40
40
  }
41
- })), /* @__PURE__ */ n(Ae, { client: Q, children: /* @__PURE__ */ n(J.Provider, { value: f, children: p }) }));
41
+ })), /* @__PURE__ */ t(Ue, { client: Y, children: /* @__PURE__ */ t(Z.Provider, { value: g, children: u }) }));
42
42
  }
43
43
  function k() {
44
- const e = De(J);
44
+ const e = Ie(Z);
45
45
  if (!e)
46
46
  throw new Error("usePitVox must be used within a <PitVoxPartnerProvider>");
47
47
  return e;
48
48
  }
49
- async function R(e, t) {
50
- const r = await fetch(`${e}/${t}`);
51
- if (!r.ok) {
52
- if (r.status === 404 || r.status === 403) return null;
53
- throw new Error(`CDN fetch failed: ${r.status}`);
49
+ async function R(e, n) {
50
+ const s = await fetch(`${e}/${n}`);
51
+ if (!s.ok) {
52
+ if (s.status === 404 || s.status === 403) return null;
53
+ throw new Error(`CDN fetch failed: ${s.status}`);
54
54
  }
55
- return r.json();
55
+ return s.json();
56
56
  }
57
- function Z(e, t, r, ...s) {
57
+ function X(e, n, s, ...r) {
58
58
  const a = ["leaderboards"];
59
- return e && a.push(`partners/${e}`), t && a.push(t), r && a.push(`v/${r}`), [...a, ...s].join("/");
59
+ return e && a.push(`partners/${e}`), n && a.push(n), s && a.push(`v/${s}`), [...a, ...r].join("/");
60
60
  }
61
- function Fe(e, t, r, s) {
62
- const a = s || "default";
63
- return e ? `laps/partners/${e}/${t}/${r}/${a}.json` : `laps/${t}/${r}/${a}.json`;
61
+ function _e(e, n, s, r) {
62
+ const a = r || "default";
63
+ return e ? `laps/partners/${e}/${n}/${s}/${a}.json` : `laps/${n}/${s}/${a}.json`;
64
64
  }
65
- function _e(e, t) {
66
- return e ? `laps/partners/${e}/${t}/index.json` : `laps/${t}/index.json`;
65
+ function qe(e, n) {
66
+ return e ? `laps/partners/${e}/${n}/index.json` : `laps/${n}/index.json`;
67
67
  }
68
- function qe(e) {
68
+ function je(e) {
69
69
  return e ? `recent-laps/partners/${e}.json` : "recent-laps.json";
70
70
  }
71
71
  function A(e) {
72
72
  if (!e && e !== 0) return "-";
73
- const t = Math.floor(e / 1e3), r = Math.floor(t / 60), s = t % 60, a = e % 1e3;
74
- return `${r}:${String(s).padStart(2, "0")}.${String(a).padStart(3, "0")}`;
73
+ const n = Math.floor(e / 1e3), s = Math.floor(n / 60), r = n % 60, a = e % 1e3;
74
+ return `${s}:${String(r).padStart(2, "0")}.${String(a).padStart(3, "0")}`;
75
75
  }
76
76
  function B(e) {
77
77
  return !e && e !== 0 ? "-" : e >= 6e4 ? A(e) : (e / 1e3).toFixed(3);
78
78
  }
79
79
  function I(e) {
80
80
  if (!e) return "";
81
- let t = e;
82
- return t.startsWith("ks_") && (t = t.slice(3)), t.split("_").map((r) => r.charAt(0).toUpperCase() + r.slice(1)).join(" ");
81
+ let n = e;
82
+ return n.startsWith("ks_") && (n = n.slice(3)), n.split("_").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" ");
83
83
  }
84
- function q(e, t, r) {
84
+ function q(e, n, s) {
85
85
  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";
87
- 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}`;
86
+ const r = e.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" "), a = s === "acc" || !s && (n == null ? void 0 : n.toLowerCase()) === "track config";
87
+ if (!n || n === "default" || a) return r;
88
+ const i = n.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" ");
89
+ return `${r} ${i}`;
90
90
  }
91
91
  function j(e) {
92
92
  if (!e) return "-";
@@ -100,25 +100,25 @@ function j(e) {
100
100
  return "-";
101
101
  }
102
102
  }
103
- function le(e) {
103
+ function ue(e) {
104
104
  if (!e) return "";
105
- const t = Date.now() - new Date(e).getTime(), r = Math.floor(t / 1e3);
106
- if (r < 60) return "Just now";
107
- const s = Math.floor(r / 60);
108
- if (s < 60) return `${s}m ago`;
109
- const a = Math.floor(s / 60);
105
+ const n = Date.now() - new Date(e).getTime(), s = Math.floor(n / 1e3);
106
+ if (s < 60) return "Just now";
107
+ const r = Math.floor(s / 60);
108
+ if (r < 60) return `${r}m ago`;
109
+ const a = Math.floor(r / 60);
110
110
  if (a < 24) return `${a}h ago`;
111
111
  const i = Math.floor(a / 24);
112
112
  return i < 30 ? `${i}d ago` : j(e);
113
113
  }
114
- function Xn(e) {
114
+ function tn(e) {
115
115
  return e == null ? "" : `${e >= 0 ? "+" : "-"}${(Math.abs(e) / 1e3).toFixed(3)}`;
116
116
  }
117
- function je(e, t) {
118
- const { type: r, title: s, trackId: a, trackLayout: i, carId: o, game: d, data: u } = e, l = typeof u == "string" ? JSON.parse(u) : u, p = a ? q(a, i, d) : null, f = o ? I(o) : null, g = [p, f].filter(Boolean).join(" — ");
119
- return r === "RECORD_BEATEN" && g ? `${l != null && l.beatenBySteamId && t ? t(l.beatenBySteamId).displayName : "Someone"} beat your record on ${g}` : r === "RECORD_SET" && g ? `You set a new record on ${g}` : s || "New notification";
117
+ function Ve(e, n) {
118
+ const { type: s, title: r, trackId: a, trackLayout: i, carId: o, game: d, data: p } = e, c = typeof p == "string" ? JSON.parse(p) : p, u = a ? q(a, i, d) : null, g = o ? I(o) : null, f = [u, g].filter(Boolean).join(" — ");
119
+ return s === "RECORD_BEATEN" && f ? `${c != null && c.beatenBySteamId && n ? n(c.beatenBySteamId).displayName : "Someone"} beat your record on ${f}` : s === "RECORD_SET" && f ? `You set a new record on ${f}` : r || "New notification";
120
120
  }
121
- function de(e) {
121
+ function me(e) {
122
122
  return e ? {
123
123
  E: "Eco",
124
124
  RD: "Road",
@@ -132,23 +132,23 @@ function de(e) {
132
132
  S: "Soft"
133
133
  }[e] || e : "Unknown";
134
134
  }
135
- function pe(e) {
135
+ function he(e) {
136
136
  if (!e) return "-";
137
- const t = Number(e);
138
- return isNaN(t) ? "-" : t % 1 ? `${t.toFixed(1)}L` : `${t}L`;
139
- }
140
- function et(e = {}) {
141
- var u, l, p, f, g, m;
142
- const { cdnUrl: t, partnerSlug: r } = k(), { game: s, gameVersion: a } = e, i = Z(r, null, null, "index.json"), o = S({
143
- queryKey: ["pitvox", "leaderboards", r, "index"],
144
- queryFn: () => R(t, i),
137
+ const n = Number(e);
138
+ return isNaN(n) ? "-" : n % 1 ? `${n.toFixed(1)}L` : `${n}L`;
139
+ }
140
+ function nn(e = {}) {
141
+ var p, c, u, g, f, m;
142
+ const { cdnUrl: n, partnerSlug: s } = k(), { game: r, gameVersion: a } = e, i = X(s, null, null, "index.json"), o = S({
143
+ queryKey: ["pitvox", "leaderboards", s, "index"],
144
+ queryFn: () => R(n, i),
145
145
  staleTime: 3e4,
146
146
  refetchInterval: 3e4
147
147
  }), d = L(() => {
148
148
  var x;
149
149
  if (!((x = o.data) != null && x.tracks)) return [];
150
150
  let b = o.data.tracks;
151
- return s && (b = b.filter((v) => v.game === s)), a && (b = b.filter((v) => v.gameVersion === a)), b.map((v) => ({
151
+ return r && (b = b.filter((v) => v.game === r)), a && (b = b.filter((v) => v.gameVersion === a)), b.map((v) => ({
152
152
  id: v.trackId,
153
153
  layout: v.layout,
154
154
  game: v.game,
@@ -165,28 +165,28 @@ function et(e = {}) {
165
165
  } : null,
166
166
  recordByTag: v.recordByTag || null
167
167
  }));
168
- }, [(u = o.data) == null ? void 0 : u.tracks, s, a]);
168
+ }, [(p = o.data) == null ? void 0 : p.tracks, r, a]);
169
169
  return {
170
170
  ...o,
171
171
  data: d,
172
- partner: ((l = o.data) == null ? void 0 : l.partner) || null,
173
- generatedAt: (p = o.data) == null ? void 0 : p.generatedAt,
174
- totalLaps: ((f = o.data) == null ? void 0 : f.totalLaps) || 0,
175
- totalUsers: ((g = o.data) == null ? void 0 : g.totalUsers) || 0,
172
+ partner: ((c = o.data) == null ? void 0 : c.partner) || null,
173
+ generatedAt: (u = o.data) == null ? void 0 : u.generatedAt,
174
+ totalLaps: ((g = o.data) == null ? void 0 : g.totalLaps) || 0,
175
+ totalUsers: ((f = o.data) == null ? void 0 : f.totalUsers) || 0,
176
176
  versions: ((m = o.data) == null ? void 0 : m.versions) || {}
177
177
  };
178
178
  }
179
- function Ve(e, t, r = {}) {
180
- const { cdnUrl: s, partnerSlug: a } = k(), { carId: i, game: o, gameVersion: d } = r, u = t || "default", l = Z(a, o, d, `tracks/${e}/${u}.json`), { data: p, isLoading: f, error: g } = S({
181
- queryKey: ["pitvox", "leaderboards", a, "track", e, u, o, d],
182
- queryFn: () => R(s, l),
179
+ function Ke(e, n, s = {}) {
180
+ const { cdnUrl: r, partnerSlug: a } = k(), { carId: i, game: o, gameVersion: d } = s, p = n || "default", c = X(a, o, d, `tracks/${e}/${p}.json`), { data: u, isLoading: g, error: f } = S({
181
+ queryKey: ["pitvox", "leaderboards", a, "track", e, p, o, d],
182
+ queryFn: () => R(r, c),
183
183
  enabled: !!e,
184
184
  staleTime: 3e4,
185
185
  refetchInterval: 3e4
186
186
  });
187
187
  return { data: L(() => {
188
- if (!(p != null && p.entries)) return [];
189
- let b = p.entries;
188
+ if (!(u != null && u.entries)) return [];
189
+ let b = u.entries;
190
190
  if (o && (b = b.filter((x) => x.game === o)), !i) {
191
191
  const x = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map();
192
192
  for (const N of b) {
@@ -199,236 +199,236 @@ function Ve(e, t, r = {}) {
199
199
  }).sort((N, h) => N.lapTimeMs - h.lapTimeMs);
200
200
  }
201
201
  return b.filter((x) => x.carId === i).sort((x, v) => x.lapTimeMs - v.lapTimeMs);
202
- }, [p == null ? void 0 : p.entries, i, o]), isLoading: f, error: g };
202
+ }, [u == null ? void 0 : u.entries, i, o]), isLoading: g, error: f };
203
203
  }
204
- function Ke(e, t, r, s, a = {}) {
204
+ function He(e, n, s, r, a = {}) {
205
205
  var x, v;
206
- const { cdnUrl: i, partnerSlug: o } = k(), { showInvalid: d = !1, game: u, gameVersion: l } = a, p = e && t ? Fe(o, e, t, r) : null, g = S({
207
- queryKey: ["pitvox", "laps", o, e, t, r || "default"],
208
- queryFn: () => R(i, p),
209
- enabled: !!e && !!t,
206
+ const { cdnUrl: i, partnerSlug: o } = k(), { showInvalid: d = !1, game: p, gameVersion: c } = a, u = e && n ? _e(o, e, n, s) : null, f = S({
207
+ queryKey: ["pitvox", "laps", o, e, n, s || "default"],
208
+ queryFn: () => R(i, u),
209
+ enabled: !!e && !!n,
210
210
  staleTime: 3e4,
211
211
  refetchInterval: 3e4
212
212
  }), m = L(() => {
213
213
  var N;
214
- return (N = g.data) != null && N.laps ? g.data.laps.filter((h) => !(h.carId !== s || u && h.game !== u || l && h.gameVersion !== l || !d && !h.isValid)).sort((h, y) => h.lapTimeMs - y.lapTimeMs) : [];
215
- }, [(x = g.data) == null ? void 0 : x.laps, s, u, l, d]), b = L(() => {
214
+ return (N = f.data) != null && N.laps ? f.data.laps.filter((h) => !(h.carId !== r || p && h.game !== p || c && h.gameVersion !== c || !d && !h.isValid)).sort((h, w) => h.lapTimeMs - w.lapTimeMs) : [];
215
+ }, [(x = f.data) == null ? void 0 : x.laps, r, p, c, d]), b = L(() => {
216
216
  const N = m.filter(($) => $.isValid && $.sector1Ms && $.sector2Ms && $.sector3Ms);
217
217
  if (N.length < 2) return null;
218
- const h = Math.min(...N.map(($) => $.sector1Ms)), y = Math.min(...N.map(($) => $.sector2Ms)), C = Math.min(...N.map(($) => $.sector3Ms)), w = h + y + C, T = Math.min(...N.map(($) => $.lapTimeMs));
219
- return w >= T ? null : { lapTimeMs: w, sector1Ms: h, sector2Ms: y, sector3Ms: C };
218
+ const h = Math.min(...N.map(($) => $.sector1Ms)), w = Math.min(...N.map(($) => $.sector2Ms)), y = Math.min(...N.map(($) => $.sector3Ms)), C = h + w + y, T = Math.min(...N.map(($) => $.lapTimeMs));
219
+ return C >= T ? null : { lapTimeMs: C, sector1Ms: h, sector2Ms: w, sector3Ms: y };
220
220
  }, [m]);
221
221
  return {
222
- ...g,
222
+ ...f,
223
223
  data: m,
224
- driverName: ((v = g.data) == null ? void 0 : v.driverName) || "Driver",
224
+ driverName: ((v = f.data) == null ? void 0 : v.driverName) || "Driver",
225
225
  theoreticalBest: b
226
226
  };
227
227
  }
228
- function ue() {
229
- const { cdnUrl: e } = k(), { data: t } = S({
228
+ function ve() {
229
+ const { cdnUrl: e } = k(), { data: n } = S({
230
230
  queryKey: ["pitvox", "users", "index"],
231
231
  queryFn: () => R(e, "users/index.json"),
232
232
  staleTime: 5 * 6e4,
233
233
  gcTime: 30 * 6e4
234
- }), r = (t == null ? void 0 : t.users) || {};
235
- return (s, a) => {
236
- const i = r[s];
234
+ }), s = (n == null ? void 0 : n.users) || {};
235
+ return (r, a) => {
236
+ const i = s[r];
237
237
  return {
238
- displayName: (i == null ? void 0 : i.displayName) || a || s || "Unknown",
238
+ displayName: (i == null ? void 0 : i.displayName) || a || r || "Unknown",
239
239
  avatarUrl: (i == null ? void 0 : i.avatarUrl) || null,
240
240
  affiliations: (i == null ? void 0 : i.affiliations) || []
241
241
  };
242
242
  };
243
243
  }
244
- function nt() {
245
- const { cdnUrl: e } = k(), { data: t } = S({
244
+ function rn() {
245
+ const { cdnUrl: e } = k(), { data: n } = S({
246
246
  queryKey: ["pitvox", "cars", "evo"],
247
247
  queryFn: () => R(e, "cars/evo.json"),
248
248
  staleTime: 5 * 6e4,
249
249
  gcTime: 30 * 6e4
250
250
  });
251
251
  return {
252
- tags: (t == null ? void 0 : t.tags) || [],
253
- cars: (t == null ? void 0 : t.cars) || {}
252
+ tags: (n == null ? void 0 : n.tags) || [],
253
+ cars: (n == null ? void 0 : n.cars) || {}
254
254
  };
255
255
  }
256
- function tt() {
256
+ function sn() {
257
257
  var a, i;
258
- const { cdnUrl: e, partnerSlug: t } = k(), r = qe(t), s = S({
259
- queryKey: ["pitvox", "recentLaps", t],
260
- queryFn: () => R(e, r),
258
+ const { cdnUrl: e, partnerSlug: n } = k(), s = je(n), r = S({
259
+ queryKey: ["pitvox", "recentLaps", n],
260
+ queryFn: () => R(e, s),
261
261
  staleTime: 3e4,
262
262
  refetchInterval: 3e4,
263
263
  gcTime: 10 * 6e4
264
264
  });
265
265
  return {
266
- groups: ((a = s.data) == null ? void 0 : a.groups) || [],
267
- generatedAt: ((i = s.data) == null ? void 0 : i.generatedAt) || null,
268
- isLoading: s.isLoading
266
+ groups: ((a = r.data) == null ? void 0 : a.groups) || [],
267
+ generatedAt: ((i = r.data) == null ? void 0 : i.generatedAt) || null,
268
+ isLoading: r.isLoading
269
269
  };
270
270
  }
271
- function rt(e, t) {
272
- return Ve(e, null, { carId: t });
271
+ function an(e, n) {
272
+ return Ke(e, null, { carId: n });
273
273
  }
274
- function st() {
275
- const { cdnUrl: e, partnerSlug: t } = k();
274
+ function on() {
275
+ const { cdnUrl: e, partnerSlug: n } = k();
276
276
  return S({
277
- queryKey: ["pitvox", "competitions", t],
277
+ queryKey: ["pitvox", "competitions", n],
278
278
  queryFn: async () => {
279
- const r = await R(e, "competitions/index.json");
280
- return r != null && r.competitions ? t ? r.competitions.filter((s) => s.partnerSlug === t) : r.competitions : [];
279
+ const s = await R(e, "competitions/index.json");
280
+ return s != null && s.competitions ? n ? s.competitions.filter((r) => r.partnerSlug === n) : s.competitions : [];
281
281
  },
282
282
  staleTime: 6e4
283
283
  });
284
284
  }
285
- function me(e, t = {}) {
286
- const r = k(), s = t.partnerSlug || r.partnerSlug;
285
+ function xe(e, n = {}) {
286
+ const s = k(), r = n.partnerSlug || s.partnerSlug;
287
287
  return S({
288
- queryKey: ["pitvox", "competition", s, e, "config"],
289
- queryFn: () => R(r.cdnUrl, `competitions/${s}/${e}/config.json`),
290
- enabled: !!s && !!e,
288
+ queryKey: ["pitvox", "competition", r, e, "config"],
289
+ queryFn: () => R(s.cdnUrl, `competitions/${r}/${e}/config.json`),
290
+ enabled: !!r && !!e,
291
291
  staleTime: 6e4
292
292
  });
293
293
  }
294
- function ve(e, t = {}) {
295
- const r = k(), s = t.partnerSlug || r.partnerSlug;
294
+ function ge(e, n = {}) {
295
+ const s = k(), r = n.partnerSlug || s.partnerSlug;
296
296
  return S({
297
- queryKey: ["pitvox", "competition", s, e, "standings"],
298
- queryFn: () => R(r.cdnUrl, `competitions/${s}/${e}/standings.json`),
299
- enabled: !!s && !!e,
297
+ queryKey: ["pitvox", "competition", r, e, "standings"],
298
+ queryFn: () => R(s.cdnUrl, `competitions/${r}/${e}/standings.json`),
299
+ enabled: !!r && !!e,
300
300
  staleTime: 6e4
301
301
  });
302
302
  }
303
- function He(e, t, r = {}) {
304
- const s = k(), a = r.partnerSlug || s.partnerSlug;
303
+ function Oe(e, n, s = {}) {
304
+ const r = k(), a = s.partnerSlug || r.partnerSlug;
305
305
  return S({
306
- queryKey: ["pitvox", "competition", a, e, "round", t],
307
- queryFn: () => R(s.cdnUrl, `competitions/${a}/${e}/rounds/${t}.json`),
308
- enabled: !!a && !!e && t != null,
306
+ queryKey: ["pitvox", "competition", a, e, "round", n],
307
+ queryFn: () => R(r.cdnUrl, `competitions/${a}/${e}/rounds/${n}.json`),
308
+ enabled: !!a && !!e && n != null,
309
309
  staleTime: 6e4
310
310
  });
311
311
  }
312
- function Oe(e, t = [], r = {}) {
313
- const s = k(), a = r.partnerSlug || s.partnerSlug;
312
+ function We(e, n = [], s = {}) {
313
+ const r = k(), a = s.partnerSlug || r.partnerSlug;
314
314
  return S({
315
- queryKey: ["pitvox", "competition", a, e, "allRounds", t],
315
+ queryKey: ["pitvox", "competition", a, e, "allRounds", n],
316
316
  queryFn: async () => (await Promise.all(
317
- t.map(
318
- (o) => R(s.cdnUrl, `competitions/${a}/${e}/rounds/${o}.json`).catch(() => null)
317
+ n.map(
318
+ (o) => R(r.cdnUrl, `competitions/${a}/${e}/rounds/${o}.json`).catch(() => null)
319
319
  )
320
320
  )).filter(Boolean),
321
- enabled: !!a && !!e && t.length > 0,
321
+ enabled: !!a && !!e && n.length > 0,
322
322
  staleTime: 6e4
323
323
  });
324
324
  }
325
- function at(e, t = {}) {
326
- const r = k(), s = t.partnerSlug || r.partnerSlug;
325
+ function Ge(e, n = {}) {
326
+ const s = k(), r = n.partnerSlug || s.partnerSlug;
327
327
  return S({
328
- queryKey: ["pitvox", "competition", s, e, "leaderboard"],
329
- queryFn: () => R(r.cdnUrl, `competitions/${s}/${e}/leaderboard.json`).catch(() => null),
330
- enabled: !!s && !!e,
328
+ queryKey: ["pitvox", "competition", r, e, "leaderboard"],
329
+ queryFn: () => R(s.cdnUrl, `competitions/${r}/${e}/leaderboard.json`).catch(() => null),
330
+ enabled: !!r && !!e,
331
331
  staleTime: 6e4
332
332
  });
333
333
  }
334
- function We(e, t, r = {}) {
335
- const s = k(), a = r.partnerSlug || s.partnerSlug;
334
+ function ze(e, n, s = {}) {
335
+ const r = k(), a = s.partnerSlug || r.partnerSlug;
336
336
  return S({
337
- queryKey: ["pitvox", "competition", a, e, "round", t, "laps"],
338
- queryFn: () => R(s.cdnUrl, `competitions/${a}/${e}/rounds/${t}/laps.json`).catch(() => null),
339
- enabled: !!a && !!e && t != null,
337
+ queryKey: ["pitvox", "competition", a, e, "round", n, "laps"],
338
+ queryFn: () => R(r.cdnUrl, `competitions/${a}/${e}/rounds/${n}/laps.json`).catch(() => null),
339
+ enabled: !!a && !!e && n != null,
340
340
  staleTime: 6e4
341
341
  });
342
342
  }
343
- function he(e, t = {}) {
344
- const r = k(), s = t.partnerSlug || r.partnerSlug;
343
+ function fe(e, n = {}) {
344
+ const s = k(), r = n.partnerSlug || s.partnerSlug;
345
345
  return S({
346
- queryKey: ["pitvox", "competition", s, e, "entrylist"],
347
- queryFn: () => R(r.cdnUrl, `competitions/${s}/${e}/entrylist.json`),
348
- enabled: !!s && !!e,
346
+ queryKey: ["pitvox", "competition", r, e, "entrylist"],
347
+ queryFn: () => R(s.cdnUrl, `competitions/${r}/${e}/entrylist.json`),
348
+ enabled: !!r && !!e,
349
349
  staleTime: 6e4
350
350
  });
351
351
  }
352
- function X(e) {
353
- const { cdnUrl: t, partnerSlug: r, getSteamId: s } = k(), a = s();
352
+ function ee(e) {
353
+ const { cdnUrl: n, partnerSlug: s, getSteamId: r } = k(), a = r();
354
354
  return S({
355
- queryKey: ["pitvox", "registration", r, e, a],
355
+ queryKey: ["pitvox", "registration", s, e, a],
356
356
  queryFn: async () => {
357
- var u;
358
- const i = await fetch(`${t}/competitions/${r}/${e}/entrylist.json`);
357
+ var p;
358
+ const i = await fetch(`${n}/competitions/${s}/${e}/entrylist.json`);
359
359
  if (!i.ok) return { isRegistered: !1, entryList: null };
360
360
  const o = await i.json();
361
- return { isRegistered: !!a && ((u = o.drivers) == null ? void 0 : u.some((l) => l.steamId === a)), entryList: o };
361
+ return { isRegistered: !!a && ((p = o.drivers) == null ? void 0 : p.some((c) => c.steamId === a)), entryList: o };
362
362
  },
363
363
  enabled: !!e,
364
364
  staleTime: 6e4
365
365
  });
366
366
  }
367
- function xe(e) {
368
- const { onRegister: t, partnerSlug: r, getSteamId: s } = k(), a = _(), i = ue();
367
+ function Ne(e) {
368
+ const { onRegister: n, partnerSlug: s, getSteamId: r } = k(), a = _(), i = ve();
369
369
  return O({
370
370
  mutationFn: (o) => {
371
- if (!t)
371
+ if (!n)
372
372
  throw new Error(
373
373
  "No onRegister callback provided to PitVoxPartnerProvider. Provide onRegister for in-app registration, or use useRegistrationUrl() to link to pitvox.com."
374
374
  );
375
- return t(e, o);
375
+ return n(e, o);
376
376
  },
377
377
  onSuccess: () => {
378
- const o = s();
378
+ const o = r();
379
379
  if (a.setQueriesData(
380
- { queryKey: ["pitvox", "registration", r, e] },
380
+ { queryKey: ["pitvox", "registration", s, e] },
381
381
  (d) => d ? { ...d, isRegistered: !0 } : { isRegistered: !0, entryList: null }
382
382
  ), o) {
383
- const d = i(o), u = {
383
+ const d = i(o), p = {
384
384
  steamId: o,
385
385
  displayName: d.displayName,
386
386
  avatarUrl: d.avatarUrl
387
387
  };
388
388
  a.setQueriesData(
389
- { queryKey: ["pitvox", "competition", r, e, "entrylist"] },
390
- (l) => {
391
- var f;
392
- return l ? ((f = l.drivers) == null ? void 0 : f.some((g) => g.steamId === o)) ? l : { ...l, drivers: [...l.drivers || [], u] } : { drivers: [u] };
389
+ { queryKey: ["pitvox", "competition", s, e, "entrylist"] },
390
+ (c) => {
391
+ var g;
392
+ return c ? ((g = c.drivers) == null ? void 0 : g.some((f) => f.steamId === o)) ? c : { ...c, drivers: [...c.drivers || [], p] } : { drivers: [p] };
393
393
  }
394
394
  );
395
395
  }
396
396
  }
397
397
  });
398
398
  }
399
- function ge(e) {
400
- const { onWithdraw: t, partnerSlug: r, getSteamId: s } = k(), a = _();
399
+ function be(e) {
400
+ const { onWithdraw: n, partnerSlug: s, getSteamId: r } = k(), a = _();
401
401
  return O({
402
402
  mutationFn: (i) => {
403
- if (!t)
403
+ if (!n)
404
404
  throw new Error(
405
405
  "No onWithdraw callback provided to PitVoxPartnerProvider. Provide onWithdraw for in-app withdrawal, or use useRegistrationUrl() to link to pitvox.com."
406
406
  );
407
- const o = i || s();
407
+ const o = i || r();
408
408
  if (!o) throw new Error("No Steam ID available");
409
- return t(e, o);
409
+ return n(e, o);
410
410
  },
411
411
  onSuccess: () => {
412
- const i = s();
412
+ const i = r();
413
413
  a.setQueriesData(
414
- { queryKey: ["pitvox", "registration", r, e] },
414
+ { queryKey: ["pitvox", "registration", s, e] },
415
415
  (o) => o ? { ...o, isRegistered: !1 } : { isRegistered: !1, entryList: null }
416
416
  ), i && a.setQueriesData(
417
- { queryKey: ["pitvox", "competition", r, e, "entrylist"] },
417
+ { queryKey: ["pitvox", "competition", s, e, "entrylist"] },
418
418
  (o) => o != null && o.drivers ? { ...o, drivers: o.drivers.filter((d) => d.steamId !== i) } : o
419
419
  );
420
420
  }
421
421
  });
422
422
  }
423
- function ee() {
424
- const { onRegister: e, onWithdraw: t } = k(), r = !!(e && t);
425
- return { isPowerMode: r, isBasicMode: !r };
423
+ function te() {
424
+ const { onRegister: e, onWithdraw: n } = k(), s = !!(e && n);
425
+ return { isPowerMode: s, isBasicMode: !s };
426
426
  }
427
427
  function ne(e) {
428
- const { pitvoxUrl: t, partnerSlug: r } = k();
429
- return `${t}/p/${r}/competitions/${e}/register`;
428
+ const { pitvoxUrl: n, partnerSlug: s } = k();
429
+ return `${n}/p/${s}/competitions/${e}/register`;
430
430
  }
431
- const ze = {
431
+ const Qe = {
432
432
  formula: "Formula",
433
433
  gt3: "GT3",
434
434
  gt2: "GT2",
@@ -448,156 +448,156 @@ const ze = {
448
448
  "2000s": "2000s",
449
449
  "2010s": "2010s",
450
450
  "2020s": "2020s"
451
- }, fe = [
451
+ }, ye = [
452
452
  { id: "class", tags: ["formula", "gt3", "gt2", "gt4", "cup", "prototype", "rally"] },
453
453
  { id: "tier", tags: ["hypercar", "supercar", "sports_car", "hot_hatch", "lightweight"] },
454
454
  { id: "era", tags: ["1960s", "1970s", "1980s", "1990s", "2000s", "2010s", "2020s"] }
455
455
  ];
456
- function Ge(e) {
457
- for (const t of fe)
458
- if (t.tags.includes(e)) return t.id;
456
+ function Ye(e) {
457
+ for (const n of ye)
458
+ if (n.tags.includes(e)) return n.id;
459
459
  return "other";
460
460
  }
461
- function Ne(e, t) {
462
- if (t.size === 0) return !0;
463
- const r = {};
464
- for (const s of t) {
465
- const a = Ge(s);
466
- r[a] || (r[a] = []), r[a].push(s);
461
+ function we(e, n) {
462
+ if (n.size === 0) return !0;
463
+ const s = {};
464
+ for (const r of n) {
465
+ const a = Ye(r);
466
+ s[a] || (s[a] = []), s[a].push(r);
467
467
  }
468
- for (const s of Object.values(r))
469
- if (!s.some((a) => e.includes(a))) return !1;
468
+ for (const r of Object.values(s))
469
+ if (!r.some((a) => e.includes(a))) return !1;
470
470
  return !0;
471
471
  }
472
- function be(e, t) {
473
- const [r, s] = D(/* @__PURE__ */ new Set()), a = e !== void 0, i = a ? e : r, o = H((u) => {
474
- const l = new Set(i);
475
- l.has(u) ? l.delete(u) : l.add(u), a && t ? t(l) : s(l);
476
- }, [i, a, t]), d = H(() => {
477
- a && t ? t(/* @__PURE__ */ new Set()) : s(/* @__PURE__ */ new Set());
478
- }, [a, t]);
472
+ function ke(e, n) {
473
+ const [s, r] = D(/* @__PURE__ */ new Set()), a = e !== void 0, i = a ? e : s, o = H((p) => {
474
+ const c = new Set(i);
475
+ c.has(p) ? c.delete(p) : c.add(p), a && n ? n(c) : r(c);
476
+ }, [i, a, n]), d = H(() => {
477
+ a && n ? n(/* @__PURE__ */ new Set()) : r(/* @__PURE__ */ new Set());
478
+ }, [a, n]);
479
479
  return { activeTags: i, toggle: o, clear: d };
480
480
  }
481
481
  function W(e) {
482
- const [t, r] = D(e), s = H((a) => {
483
- r(
482
+ const [n, s] = D(e), r = H((a) => {
483
+ s(
484
484
  (i) => i.key === a ? { key: a, dir: i.dir === "asc" ? "desc" : "asc" } : { key: a, dir: a.includes("timestamp") || a.includes("Date") ? "desc" : "asc" }
485
485
  );
486
486
  }, []);
487
- return [t, s];
487
+ return [n, r];
488
488
  }
489
- function z(e, t, r) {
490
- return [...e].sort((s, a) => {
491
- const i = r(s, t.key), o = r(a, t.key);
489
+ function G(e, n, s) {
490
+ return [...e].sort((r, a) => {
491
+ const i = s(r, n.key), o = s(a, n.key);
492
492
  if (i == null && o == null) return 0;
493
493
  if (i == null) return 1;
494
494
  if (o == null) return -1;
495
495
  const d = typeof i == "string" ? i.localeCompare(o) : i - o;
496
- return t.dir === "desc" ? -d : d;
496
+ return n.dir === "desc" ? -d : d;
497
497
  });
498
498
  }
499
- function ye(e, t = !1) {
500
- const r = t ? e == null ? void 0 : e.filter((s) => s.isValid) : e;
501
- return r != null && r.length ? {
502
- s1: Math.min(...r.map((s) => s.sector1Ms).filter(Boolean)),
503
- s2: Math.min(...r.map((s) => s.sector2Ms).filter(Boolean)),
504
- s3: Math.min(...r.map((s) => s.sector3Ms).filter(Boolean))
499
+ function Ce(e, n = !1) {
500
+ const s = n ? e == null ? void 0 : e.filter((r) => r.isValid) : e;
501
+ return s != null && s.length ? {
502
+ s1: Math.min(...s.map((r) => r.sector1Ms).filter(Boolean)),
503
+ s2: Math.min(...s.map((r) => r.sector2Ms).filter(Boolean)),
504
+ s3: Math.min(...s.map((r) => r.sector3Ms).filter(Boolean))
505
505
  } : null;
506
506
  }
507
- function Qe({ active: e, dir: t }) {
508
- 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" }) });
507
+ function Je({ active: e, dir: n }) {
508
+ return e ? n === "asc" ? /* @__PURE__ */ t("svg", { className: "pvx-sort-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 15.75l7.5-7.5 7.5 7.5" }) }) : /* @__PURE__ */ t("svg", { className: "pvx-sort-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" }) }) : /* @__PURE__ */ t("svg", { className: "pvx-sort-icon pvx-sort-icon--inactive", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 9l4-4 4 4M16 15l-4 4-4-4" }) });
509
509
  }
510
- function M({ label: e, sortKey: t, config: r, onSort: s, className: a = "" }) {
511
- return /* @__PURE__ */ n(
510
+ function M({ label: e, sortKey: n, config: s, onSort: r, className: a = "" }) {
511
+ return /* @__PURE__ */ t(
512
512
  "th",
513
513
  {
514
514
  className: `pvx-th pvx-th--sortable ${a}`,
515
- onClick: () => s(t),
516
- children: /* @__PURE__ */ c("span", { className: "pvx-th-inner", children: [
515
+ onClick: () => r(n),
516
+ children: /* @__PURE__ */ l("span", { className: "pvx-th-inner", children: [
517
517
  e,
518
- /* @__PURE__ */ n(Qe, { active: r.key === t, dir: r.dir })
518
+ /* @__PURE__ */ t(Je, { active: s.key === n, dir: s.dir })
519
519
  ] })
520
520
  }
521
521
  );
522
522
  }
523
- function G({ userId: e, getUserDisplay: t }) {
524
- const { displayName: r, avatarUrl: s } = t(e);
525
- return /* @__PURE__ */ c("span", { className: "pvx-driver", children: [
526
- s ? /* @__PURE__ */ n("img", { src: s, alt: "", className: "pvx-driver-avatar" }) : /* @__PURE__ */ n("span", { className: "pvx-driver-avatar pvx-driver-avatar--placeholder" }),
527
- /* @__PURE__ */ n("span", { className: "pvx-driver-name", children: r })
523
+ function z({ userId: e, getUserDisplay: n }) {
524
+ const { displayName: s, avatarUrl: r } = n(e);
525
+ return /* @__PURE__ */ l("span", { className: "pvx-driver", children: [
526
+ r ? /* @__PURE__ */ t("img", { src: r, alt: "", className: "pvx-driver-avatar" }) : /* @__PURE__ */ t("span", { className: "pvx-driver-avatar pvx-driver-avatar--placeholder" }),
527
+ /* @__PURE__ */ t("span", { className: "pvx-driver-name", children: s })
528
528
  ] });
529
529
  }
530
- function te({ rank: e, podium: t = !1 }) {
531
- 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 });
530
+ function re({ rank: e, podium: n = !1 }) {
531
+ return /* @__PURE__ */ t("span", { className: n ? 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 });
532
532
  }
533
- function ke({ availableTags: e, activeTags: t, onToggle: r, onClear: s }) {
533
+ function Le({ availableTags: e, activeTags: n, onToggle: s, onClear: r }) {
534
534
  if (!e || e.length < 2) return null;
535
- const a = fe.map((i) => ({ id: i.id, tags: i.tags.filter((o) => e.includes(o)) })).filter((i) => i.tags.length > 0);
536
- return /* @__PURE__ */ c("div", { className: "pvx-tag-bar", children: [
537
- /* @__PURE__ */ n(
535
+ const a = ye.map((i) => ({ id: i.id, tags: i.tags.filter((o) => e.includes(o)) })).filter((i) => i.tags.length > 0);
536
+ return /* @__PURE__ */ l("div", { className: "pvx-tag-bar", children: [
537
+ /* @__PURE__ */ t(
538
538
  "button",
539
539
  {
540
- onClick: s,
541
- className: `pvx-tag ${t.size === 0 ? "pvx-tag--active" : ""}`,
540
+ onClick: r,
541
+ className: `pvx-tag ${n.size === 0 ? "pvx-tag--active" : ""}`,
542
542
  children: "All"
543
543
  }
544
544
  ),
545
- a.map((i, o) => /* @__PURE__ */ c("span", { className: "contents", children: [
546
- o > 0 && /* @__PURE__ */ n("span", { className: "pvx-tag-separator" }),
547
- i.tags.map((d) => /* @__PURE__ */ n(
545
+ a.map((i, o) => /* @__PURE__ */ l("span", { className: "contents", children: [
546
+ o > 0 && /* @__PURE__ */ t("span", { className: "pvx-tag-separator" }),
547
+ i.tags.map((d) => /* @__PURE__ */ t(
548
548
  "button",
549
549
  {
550
- onClick: () => r(d),
551
- className: `pvx-tag ${t.has(d) ? "pvx-tag--active" : ""}`,
552
- children: ze[d] || d
550
+ onClick: () => s(d),
551
+ className: `pvx-tag ${n.has(d) ? "pvx-tag--active" : ""}`,
552
+ children: Qe[d] || d
553
553
  },
554
554
  d
555
555
  ))
556
556
  ] }, i.id))
557
557
  ] });
558
558
  }
559
- function re({ segments: e }) {
560
- return /* @__PURE__ */ n("nav", { className: "pvx-breadcrumb", "aria-label": "Breadcrumb", children: /* @__PURE__ */ n("ol", { className: "pvx-breadcrumb-list", children: e.map((t, r) => {
561
- const s = r === e.length - 1;
562
- return /* @__PURE__ */ c("li", { className: "pvx-breadcrumb-item", children: [
563
- r > 0 && /* @__PURE__ */ n("svg", { className: "pvx-breadcrumb-chevron", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.25 4.5l7.5 7.5-7.5 7.5" }) }),
564
- !s && t.onClick ? /* @__PURE__ */ n("button", { onClick: t.onClick, className: "pvx-breadcrumb-link", children: t.label }) : /* @__PURE__ */ n("span", { className: "pvx-breadcrumb-current", children: t.label })
565
- ] }, t.key);
559
+ function se({ segments: e }) {
560
+ return /* @__PURE__ */ t("nav", { className: "pvx-breadcrumb", "aria-label": "Breadcrumb", children: /* @__PURE__ */ t("ol", { className: "pvx-breadcrumb-list", children: e.map((n, s) => {
561
+ const r = s === e.length - 1;
562
+ return /* @__PURE__ */ l("li", { className: "pvx-breadcrumb-item", children: [
563
+ s > 0 && /* @__PURE__ */ t("svg", { className: "pvx-breadcrumb-chevron", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.25 4.5l7.5 7.5-7.5 7.5" }) }),
564
+ !r && n.onClick ? /* @__PURE__ */ t("button", { onClick: n.onClick, className: "pvx-breadcrumb-link", children: n.label }) : /* @__PURE__ */ t("span", { className: "pvx-breadcrumb-current", children: n.label })
565
+ ] }, n.key);
566
566
  }) }) });
567
567
  }
568
568
  function V({ message: e }) {
569
- return /* @__PURE__ */ c("div", { className: "pvx-empty", children: [
570
- /* @__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" }) }),
571
- /* @__PURE__ */ n("p", { children: e })
569
+ return /* @__PURE__ */ l("div", { className: "pvx-empty", children: [
570
+ /* @__PURE__ */ t("svg", { className: "pvx-empty-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ t("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" }) }),
571
+ /* @__PURE__ */ t("p", { children: e })
572
572
  ] });
573
573
  }
574
574
  function K() {
575
- return /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading..." });
575
+ return /* @__PURE__ */ t("div", { className: "pvx-loading", children: "Loading..." });
576
576
  }
577
- function Ye() {
578
- 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" }) });
577
+ function Ze() {
578
+ return /* @__PURE__ */ t("svg", { className: "pvx-icon pvx-icon--valid", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 12.75l6 6 9-13.5" }) });
579
579
  }
580
- function Je() {
581
- 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" }) });
580
+ function Xe() {
581
+ return /* @__PURE__ */ t("svg", { className: "pvx-icon pvx-icon--invalid", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) });
582
582
  }
583
- function it({ tracks: e, isLoading: t, carMetadata: r, getUserDisplay: s, onTrackSelect: a, tags: i, onTagChange: o }) {
584
- const [d, u] = W({ key: "record.timestamp", dir: "desc" }), { activeTags: l, toggle: p, clear: f } = be(i, o), g = L(() => {
583
+ function ln({ tracks: e, isLoading: n, carMetadata: s, getUserDisplay: r, onTrackSelect: a, tags: i, onTagChange: o }) {
584
+ const [d, p] = W({ key: "record.timestamp", dir: "desc" }), { activeTags: c, toggle: u, clear: g } = ke(i, o), f = L(() => {
585
585
  var v;
586
- if (!((v = r == null ? void 0 : r.tags) != null && v.length)) return [];
586
+ if (!((v = s == null ? void 0 : s.tags) != null && v.length)) return [];
587
587
  const x = /* @__PURE__ */ new Set();
588
588
  for (const N of e || [])
589
589
  N.recordByTag && Object.keys(N.recordByTag).forEach((h) => x.add(h));
590
- return r.tags.filter((N) => x.has(N));
591
- }, [e, r]), m = L(() => e ? l.size === 0 ? e : e.map((x) => {
592
- var h, y;
590
+ return s.tags.filter((N) => x.has(N));
591
+ }, [e, s]), m = L(() => e ? c.size === 0 ? e : e.map((x) => {
592
+ var h, w;
593
593
  if (!x.recordByTag) return null;
594
594
  let v = null;
595
595
  const N = /* @__PURE__ */ new Set();
596
- for (const C of Object.values(x.recordByTag)) {
597
- if (N.has(C.carId)) continue;
598
- N.add(C.carId);
599
- const w = ((y = (h = r == null ? void 0 : r.cars) == null ? void 0 : h[C.carId]) == null ? void 0 : y.tags) || ["sports_car"];
600
- Ne(w, l) && (!v || C.lapTimeMs < v.lapTimeMs) && (v = C);
596
+ for (const y of Object.values(x.recordByTag)) {
597
+ if (N.has(y.carId)) continue;
598
+ N.add(y.carId);
599
+ const C = ((w = (h = s == null ? void 0 : s.cars) == null ? void 0 : h[y.carId]) == null ? void 0 : w.tags) || ["sports_car"];
600
+ we(C, c) && (!v || y.lapTimeMs < v.lapTimeMs) && (v = y);
601
601
  }
602
602
  return v ? {
603
603
  ...x,
@@ -609,7 +609,7 @@ function it({ tracks: e, isLoading: t, carMetadata: r, getUserDisplay: s, onTrac
609
609
  timestamp: v.recordedAt
610
610
  }
611
611
  } : null;
612
- }).filter(Boolean) : [], [e, l, r]), b = L(() => z(m, d, (x, v) => {
612
+ }).filter(Boolean) : [], [e, c, s]), b = L(() => G(m, d, (x, v) => {
613
613
  var N, h;
614
614
  switch (v) {
615
615
  case "displayName":
@@ -625,56 +625,56 @@ function it({ tracks: e, isLoading: t, carMetadata: r, getUserDisplay: s, onTrac
625
625
  return (h = x.record) != null && h.timestamp ? new Date(x.record.timestamp).getTime() : 0;
626
626
  }
627
627
  }), [m, d]);
628
- return t ? /* @__PURE__ */ n(K, {}) : e != null && e.length ? /* @__PURE__ */ c("div", { className: "pvx-card", children: [
629
- /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n("h2", { className: "pvx-card-title", children: "Track Records" }) }),
630
- /* @__PURE__ */ n(ke, { availableTags: g, activeTags: l, onToggle: p, onClear: f }),
631
- /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ c("table", { className: "pvx-table", children: [
632
- /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ c("tr", { className: "pvx-thead-row", children: [
633
- /* @__PURE__ */ n(M, { label: "Track", sortKey: "displayName", config: d, onSort: u }),
634
- /* @__PURE__ */ n("th", { className: "pvx-th", children: "Record Holder" }),
635
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Car" }),
636
- /* @__PURE__ */ n(M, { label: "Lap Time", sortKey: "record.lapTimeMs", config: d, onSort: u }),
637
- /* @__PURE__ */ n(M, { label: "Drivers", sortKey: "driverCount", config: d, onSort: u, className: "pvx-hidden-below-md" }),
638
- /* @__PURE__ */ n(M, { label: "Cars", sortKey: "carCount", config: d, onSort: u, className: "pvx-hidden-below-lg" }),
639
- /* @__PURE__ */ n(M, { label: "Date", sortKey: "record.timestamp", config: d, onSort: u, className: "pvx-hidden-below-xl" })
628
+ return n ? /* @__PURE__ */ t(K, {}) : e != null && e.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
629
+ /* @__PURE__ */ t("div", { className: "pvx-card-header", children: /* @__PURE__ */ t("h2", { className: "pvx-card-title", children: "Track Records" }) }),
630
+ /* @__PURE__ */ t(Le, { availableTags: f, activeTags: c, onToggle: u, onClear: g }),
631
+ /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
632
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
633
+ /* @__PURE__ */ t(M, { label: "Track", sortKey: "displayName", config: d, onSort: p }),
634
+ /* @__PURE__ */ t("th", { className: "pvx-th", children: "Record Holder" }),
635
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-lg", children: "Car" }),
636
+ /* @__PURE__ */ t(M, { label: "Lap Time", sortKey: "record.lapTimeMs", config: d, onSort: p }),
637
+ /* @__PURE__ */ t(M, { label: "Drivers", sortKey: "driverCount", config: d, onSort: p, className: "pvx-hidden-below-md" }),
638
+ /* @__PURE__ */ t(M, { label: "Cars", sortKey: "carCount", config: d, onSort: p, className: "pvx-hidden-below-lg" }),
639
+ /* @__PURE__ */ t(M, { label: "Date", sortKey: "record.timestamp", config: d, onSort: p, className: "pvx-hidden-below-xl" })
640
640
  ] }) }),
641
- /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: b.map((x) => {
641
+ /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: b.map((x) => {
642
642
  var v, N, h;
643
- return /* @__PURE__ */ c(
643
+ return /* @__PURE__ */ l(
644
644
  "tr",
645
645
  {
646
646
  className: "pvx-row pvx-row--clickable",
647
647
  onClick: () => a(x.id, x.layout),
648
648
  children: [
649
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: x.displayName }),
650
- /* @__PURE__ */ n("td", { className: "pvx-td", children: (v = x.record) != null && v.visibleId ? /* @__PURE__ */ n(G, { userId: x.record.visibleId, getUserDisplay: s }) : "-" }),
651
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-lg", children: ((N = x.record) == null ? void 0 : N.carDisplayName) || "-" }),
652
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: x.record ? A(x.record.lapTimeMs) : "-" }),
653
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: x.driverCount || "-" }),
654
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: x.carCount || "-" }),
655
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: (h = x.record) != null && h.timestamp ? j(x.record.timestamp) : "-" })
649
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary", children: x.displayName }),
650
+ /* @__PURE__ */ t("td", { className: "pvx-td", children: (v = x.record) != null && v.visibleId ? /* @__PURE__ */ t(z, { userId: x.record.visibleId, getUserDisplay: r }) : "-" }),
651
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-hidden-below-lg", children: ((N = x.record) == null ? void 0 : N.carDisplayName) || "-" }),
652
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: x.record ? A(x.record.lapTimeMs) : "-" }),
653
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: x.driverCount || "-" }),
654
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: x.carCount || "-" }),
655
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: (h = x.record) != null && h.timestamp ? j(x.record.timestamp) : "-" })
656
656
  ]
657
657
  },
658
658
  `${x.id}|${x.layout || ""}`
659
659
  );
660
660
  }) })
661
661
  ] }) })
662
- ] }) : /* @__PURE__ */ n(V, { message: "No lap times recorded yet." });
662
+ ] }) : /* @__PURE__ */ t(V, { message: "No lap times recorded yet." });
663
663
  }
664
- function ot({ entries: e, isLoading: t, track: r, carMetadata: s, getUserDisplay: a, onCarSelect: i, onNavigate: o, tags: d, onTagChange: u }) {
665
- const [l, p] = W({ key: "lapTimeMs", dir: "asc" }), { activeTags: f, toggle: g, clear: m } = be(d, u), b = L(() => {
666
- var y, C, w;
667
- if (!e || !((y = s == null ? void 0 : s.tags) != null && y.length)) return [];
664
+ function cn({ entries: e, isLoading: n, track: s, carMetadata: r, getUserDisplay: a, onCarSelect: i, onNavigate: o, tags: d, onTagChange: p }) {
665
+ const [c, u] = W({ key: "lapTimeMs", dir: "asc" }), { activeTags: g, toggle: f, clear: m } = ke(d, p), b = L(() => {
666
+ var w, y, C;
667
+ if (!e || !((w = r == null ? void 0 : r.tags) != null && w.length)) return [];
668
668
  const h = /* @__PURE__ */ new Set();
669
669
  for (const T of e)
670
- (((w = (C = s.cars) == null ? void 0 : C[T.carId]) == null ? void 0 : w.tags) || ["sports_car"]).forEach((F) => h.add(F));
671
- return s.tags.filter((T) => h.has(T));
672
- }, [e, s]), x = L(() => e ? f.size === 0 ? e : e.filter((h) => {
673
- var C, w;
674
- const y = ((w = (C = s == null ? void 0 : s.cars) == null ? void 0 : C[h.carId]) == null ? void 0 : w.tags) || ["sports_car"];
675
- return Ne(y, f);
676
- }) : [], [e, f, s]), v = L(() => z(x, l, (h, y) => {
677
- switch (y) {
670
+ (((C = (y = r.cars) == null ? void 0 : y[T.carId]) == null ? void 0 : C.tags) || ["sports_car"]).forEach((F) => h.add(F));
671
+ return r.tags.filter((T) => h.has(T));
672
+ }, [e, r]), x = L(() => e ? g.size === 0 ? e : e.filter((h) => {
673
+ var y, C;
674
+ const w = ((C = (y = r == null ? void 0 : r.cars) == null ? void 0 : y[h.carId]) == null ? void 0 : C.tags) || ["sports_car"];
675
+ return we(w, g);
676
+ }) : [], [e, g, r]), v = L(() => G(x, c, (h, w) => {
677
+ switch (w) {
678
678
  case "carId":
679
679
  return I(h.carId);
680
680
  case "driverCount":
@@ -683,43 +683,43 @@ function ot({ entries: e, isLoading: t, track: r, carMetadata: s, getUserDisplay
683
683
  default:
684
684
  return h.lapTimeMs;
685
685
  }
686
- }), [x, l]), N = [
686
+ }), [x, c]), N = [
687
687
  { key: "tracks", label: "Tracks", onClick: () => o("tracks") },
688
- { key: "track", label: r.displayName }
688
+ { key: "track", label: s.displayName }
689
689
  ];
690
- return t ? /* @__PURE__ */ n(K, {}) : /* @__PURE__ */ c("div", { className: "pvx-card", children: [
691
- /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(re, { segments: N }) }),
692
- /* @__PURE__ */ n(ke, { availableTags: b, activeTags: f, onToggle: g, onClear: m }),
693
- e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ c("table", { className: "pvx-table", children: [
694
- /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ c("tr", { className: "pvx-thead-row", children: [
695
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
696
- /* @__PURE__ */ n(M, { label: "Car", sortKey: "carId", config: l, onSort: p }),
697
- /* @__PURE__ */ n("th", { className: "pvx-th", children: "Record Holder" }),
698
- /* @__PURE__ */ n(M, { label: "Lap Time", sortKey: "lapTimeMs", config: l, onSort: p }),
699
- /* @__PURE__ */ n(M, { label: "Drivers", sortKey: "driverCount", config: l, onSort: p, className: "pvx-hidden-below-md" }),
700
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Date" })
690
+ return n ? /* @__PURE__ */ t(K, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
691
+ /* @__PURE__ */ t("div", { className: "pvx-card-header", children: /* @__PURE__ */ t(se, { segments: N }) }),
692
+ /* @__PURE__ */ t(Le, { availableTags: b, activeTags: g, onToggle: f, onClear: m }),
693
+ e != null && e.length ? /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
694
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
695
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
696
+ /* @__PURE__ */ t(M, { label: "Car", sortKey: "carId", config: c, onSort: u }),
697
+ /* @__PURE__ */ t("th", { className: "pvx-th", children: "Record Holder" }),
698
+ /* @__PURE__ */ t(M, { label: "Lap Time", sortKey: "lapTimeMs", config: c, onSort: u }),
699
+ /* @__PURE__ */ t(M, { label: "Drivers", sortKey: "driverCount", config: c, onSort: u, className: "pvx-hidden-below-md" }),
700
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-lg", children: "Date" })
701
701
  ] }) }),
702
- /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: v.map((h, y) => /* @__PURE__ */ c(
702
+ /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: v.map((h, w) => /* @__PURE__ */ l(
703
703
  "tr",
704
704
  {
705
705
  className: "pvx-row pvx-row--clickable",
706
706
  onClick: () => i(h.carId),
707
707
  children: [
708
- /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(te, { rank: y + 1, podium: !0 }) }),
709
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: I(h.carId) }),
710
- /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(G, { userId: h.steamId || h.userId, getUserDisplay: a }) }),
711
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: A(h.lapTimeMs) }),
712
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: h.driverCount || "-" }),
713
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-lg", children: h.recordedAt ? j(h.recordedAt) : "-" })
708
+ /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t(re, { rank: w + 1, podium: !0 }) }),
709
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary", children: I(h.carId) }),
710
+ /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t(z, { userId: h.steamId || h.userId, getUserDisplay: a }) }),
711
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: A(h.lapTimeMs) }),
712
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: h.driverCount || "-" }),
713
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-lg", children: h.recordedAt ? j(h.recordedAt) : "-" })
714
714
  ]
715
715
  },
716
716
  h.carId
717
717
  )) })
718
- ] }) }) : /* @__PURE__ */ n(V, { message: "No lap times for this track yet." })
718
+ ] }) }) : /* @__PURE__ */ t(V, { message: "No lap times for this track yet." })
719
719
  ] });
720
720
  }
721
- function ct({ entries: e, isLoading: t, track: r, carId: s, getUserDisplay: a, onDriverSelect: i, onNavigate: o, highlightId: d }) {
722
- const [u, l] = W({ key: "lapTimeMs", dir: "asc" }), p = L(() => ye(e), [e]), f = L(() => z(e || [], u, (m, b) => {
721
+ function dn({ entries: e, isLoading: n, track: s, carId: r, getUserDisplay: a, onDriverSelect: i, onNavigate: o, highlightId: d }) {
722
+ const [p, c] = W({ key: "lapTimeMs", dir: "asc" }), u = L(() => Ce(e), [e]), g = L(() => G(e || [], p, (m, b) => {
723
723
  switch (b) {
724
724
  case "userId":
725
725
  return a(m.steamId || m.userId).displayName;
@@ -729,70 +729,70 @@ function ct({ entries: e, isLoading: t, track: r, carId: s, getUserDisplay: a, o
729
729
  default:
730
730
  return m.lapTimeMs;
731
731
  }
732
- }), [e, u, a]), g = [
732
+ }), [e, p, a]), f = [
733
733
  { key: "tracks", label: "Tracks", onClick: () => o("tracks") },
734
- { key: "track", label: r.displayName, onClick: () => o("track") },
735
- { key: "car", label: I(s) }
734
+ { key: "track", label: s.displayName, onClick: () => o("track") },
735
+ { key: "car", label: I(r) }
736
736
  ];
737
- return t ? /* @__PURE__ */ n(K, {}) : /* @__PURE__ */ c("div", { className: "pvx-card", children: [
738
- /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(re, { segments: g }) }),
739
- e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ c("table", { className: "pvx-table", children: [
740
- /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ c("tr", { className: "pvx-thead-row", children: [
741
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
742
- /* @__PURE__ */ n(M, { label: "Driver", sortKey: "userId", config: u, onSort: l }),
743
- /* @__PURE__ */ n(M, { label: "Lap Time", sortKey: "lapTimeMs", config: u, onSort: l }),
744
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
745
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
746
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" }),
747
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Tyre" }),
748
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Fuel" }),
749
- /* @__PURE__ */ n(M, { label: "Laps", sortKey: "lapCount", config: u, onSort: l, className: "pvx-hidden-below-lg" }),
750
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
737
+ return n ? /* @__PURE__ */ t(K, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
738
+ /* @__PURE__ */ t("div", { className: "pvx-card-header", children: /* @__PURE__ */ t(se, { segments: f }) }),
739
+ e != null && e.length ? /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
740
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
741
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
742
+ /* @__PURE__ */ t(M, { label: "Driver", sortKey: "userId", config: p, onSort: c }),
743
+ /* @__PURE__ */ t(M, { label: "Lap Time", sortKey: "lapTimeMs", config: p, onSort: c }),
744
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
745
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
746
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" }),
747
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-lg", children: "Tyre" }),
748
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-xl", children: "Fuel" }),
749
+ /* @__PURE__ */ t(M, { label: "Laps", sortKey: "lapCount", config: p, onSort: c, className: "pvx-hidden-below-lg" }),
750
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
751
751
  ] }) }),
752
- /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: f.map((m, b) => {
753
- const x = b + 1, v = m.steamId || m.userId, N = p && m.sector1Ms === p.s1, h = p && m.sector2Ms === p.s2, y = p && m.sector3Ms === p.s3;
754
- return /* @__PURE__ */ c(
752
+ /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: g.map((m, b) => {
753
+ const x = b + 1, v = m.steamId || m.userId, N = u && m.sector1Ms === u.s1, h = u && m.sector2Ms === u.s2, w = u && m.sector3Ms === u.s3;
754
+ return /* @__PURE__ */ l(
755
755
  "tr",
756
756
  {
757
757
  className: `pvx-row pvx-row--clickable ${d && v === d ? "pvx-row--highlight" : x <= 3 ? "pvx-row--podium" : ""}`,
758
758
  onClick: () => i(v),
759
759
  children: [
760
- /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(te, { rank: x, podium: !0 }) }),
761
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(G, { userId: v, getUserDisplay: a }) }),
762
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: A(m.lapTimeMs) }),
763
- /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${N ? "pvx-td--best-sector" : ""}`, children: B(m.sector1Ms) }),
764
- /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${h ? "pvx-td--best-sector" : ""}`, children: B(m.sector2Ms) }),
765
- /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${y ? "pvx-td--best-sector" : ""}`, children: B(m.sector3Ms) }),
766
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: de(m.tyreCompound), children: m.tyreCompound || "-" }),
767
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-xl", children: pe(m.startingFuelL) }),
768
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: m.lapCount || "-" }),
769
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: m.recordedAt ? j(m.recordedAt) : "-" })
760
+ /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t(re, { rank: x, podium: !0 }) }),
761
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ t(z, { userId: v, getUserDisplay: a }) }),
762
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: A(m.lapTimeMs) }),
763
+ /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${N ? "pvx-td--best-sector" : ""}`, children: B(m.sector1Ms) }),
764
+ /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${h ? "pvx-td--best-sector" : ""}`, children: B(m.sector2Ms) }),
765
+ /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${w ? "pvx-td--best-sector" : ""}`, children: B(m.sector3Ms) }),
766
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: me(m.tyreCompound), children: m.tyreCompound || "-" }),
767
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-xl", children: he(m.startingFuelL) }),
768
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: m.lapCount || "-" }),
769
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: m.recordedAt ? j(m.recordedAt) : "-" })
770
770
  ]
771
771
  },
772
772
  v
773
773
  );
774
774
  }) })
775
- ] }) }) : /* @__PURE__ */ n(V, { message: "No lap times for this car yet." })
775
+ ] }) }) : /* @__PURE__ */ t(V, { message: "No lap times for this car yet." })
776
776
  ] });
777
777
  }
778
- function lt({ userId: e, track: t, carId: r, game: s, gameVersion: a, showInvalid: i, getUserDisplay: o, onToggleInvalid: d, onNavigate: u }) {
779
- const { data: l, driverName: p, theoreticalBest: f, isLoading: g } = Ke(e, t.id, t.layout, r, { showInvalid: i, game: s, gameVersion: a }), { displayName: m, avatarUrl: b } = o(e, p), x = L(() => ye(l, !0), [l]), v = L(() => {
780
- const h = (l == null ? void 0 : l.filter((y) => y.isValid)) || [];
781
- return h.length ? Math.min(...h.map((y) => y.lapTimeMs)) : null;
782
- }, [l]), N = [
783
- { key: "tracks", label: "Tracks", onClick: () => u("tracks") },
784
- { key: "track", label: t.displayName, onClick: () => u("track") },
785
- { key: "car", label: I(r), onClick: () => u("car") },
778
+ function pn({ userId: e, track: n, carId: s, game: r, gameVersion: a, showInvalid: i, getUserDisplay: o, onToggleInvalid: d, onNavigate: p }) {
779
+ const { data: c, driverName: u, theoreticalBest: g, isLoading: f } = He(e, n.id, n.layout, s, { showInvalid: i, game: r, gameVersion: a }), { displayName: m, avatarUrl: b } = o(e, u), x = L(() => Ce(c, !0), [c]), v = L(() => {
780
+ const h = (c == null ? void 0 : c.filter((w) => w.isValid)) || [];
781
+ return h.length ? Math.min(...h.map((w) => w.lapTimeMs)) : null;
782
+ }, [c]), N = [
783
+ { key: "tracks", label: "Tracks", onClick: () => p("tracks") },
784
+ { key: "track", label: n.displayName, onClick: () => p("track") },
785
+ { key: "car", label: I(s), onClick: () => p("car") },
786
786
  { key: "driver", label: m }
787
787
  ];
788
- return g ? /* @__PURE__ */ n(K, {}) : /* @__PURE__ */ c("div", { className: "pvx-card", children: [
789
- /* @__PURE__ */ c("div", { className: "pvx-card-header pvx-card-header--split", children: [
790
- /* @__PURE__ */ c("div", { className: "pvx-card-header-left", children: [
791
- /* @__PURE__ */ n(re, { segments: N }),
792
- b ? /* @__PURE__ */ n("img", { src: b, alt: "", className: "pvx-driver-avatar pvx-driver-avatar--lg" }) : /* @__PURE__ */ n("span", { className: "pvx-driver-avatar pvx-driver-avatar--lg pvx-driver-avatar--placeholder" })
788
+ return f ? /* @__PURE__ */ t(K, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
789
+ /* @__PURE__ */ l("div", { className: "pvx-card-header pvx-card-header--split", children: [
790
+ /* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
791
+ /* @__PURE__ */ t(se, { segments: N }),
792
+ b ? /* @__PURE__ */ t("img", { src: b, alt: "", className: "pvx-driver-avatar pvx-driver-avatar--lg" }) : /* @__PURE__ */ t("span", { className: "pvx-driver-avatar pvx-driver-avatar--lg pvx-driver-avatar--placeholder" })
793
793
  ] }),
794
- /* @__PURE__ */ c("label", { className: "pvx-checkbox-label", children: [
795
- /* @__PURE__ */ n(
794
+ /* @__PURE__ */ l("label", { className: "pvx-checkbox-label", children: [
795
+ /* @__PURE__ */ t(
796
796
  "input",
797
797
  {
798
798
  type: "checkbox",
@@ -801,171 +801,171 @@ function lt({ userId: e, track: t, carId: r, game: s, gameVersion: a, showInvali
801
801
  className: "pvx-checkbox"
802
802
  }
803
803
  ),
804
- /* @__PURE__ */ n("span", { children: "Show invalid laps" })
804
+ /* @__PURE__ */ t("span", { children: "Show invalid laps" })
805
805
  ] })
806
806
  ] }),
807
- f && /* @__PURE__ */ c("div", { className: "pvx-theoretical-best", children: [
808
- /* @__PURE__ */ n("span", { className: "pvx-theoretical-best-label", children: "Theoretical Best:" }),
809
- /* @__PURE__ */ n("span", { className: "pvx-theoretical-best-time", children: A(f.lapTimeMs) }),
810
- /* @__PURE__ */ c("span", { className: "pvx-theoretical-best-sectors", children: [
807
+ g && /* @__PURE__ */ l("div", { className: "pvx-theoretical-best", children: [
808
+ /* @__PURE__ */ t("span", { className: "pvx-theoretical-best-label", children: "Theoretical Best:" }),
809
+ /* @__PURE__ */ t("span", { className: "pvx-theoretical-best-time", children: A(g.lapTimeMs) }),
810
+ /* @__PURE__ */ l("span", { className: "pvx-theoretical-best-sectors", children: [
811
811
  "(",
812
- B(f.sector1Ms),
812
+ B(g.sector1Ms),
813
813
  " + ",
814
- B(f.sector2Ms),
814
+ B(g.sector2Ms),
815
815
  " + ",
816
- B(f.sector3Ms),
816
+ B(g.sector3Ms),
817
817
  ")"
818
818
  ] })
819
819
  ] }),
820
- l != null && l.length ? /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ c("table", { className: "pvx-table", children: [
821
- /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ c("tr", { className: "pvx-thead-row", children: [
822
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
823
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-md", children: "Lap" }),
824
- /* @__PURE__ */ n("th", { className: "pvx-th", children: "Lap Time" }),
825
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
826
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
827
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" }),
828
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "Valid" }),
829
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Tyre" }),
830
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Fuel" }),
831
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
820
+ c != null && c.length ? /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
821
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
822
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
823
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-md", children: "Lap" }),
824
+ /* @__PURE__ */ t("th", { className: "pvx-th", children: "Lap Time" }),
825
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
826
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
827
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" }),
828
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "Valid" }),
829
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-lg", children: "Tyre" }),
830
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-lg", children: "Fuel" }),
831
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
832
832
  ] }) }),
833
- /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: l.map((h, y) => {
834
- const C = h.isValid && h.lapTimeMs === v, w = x && h.isValid && h.sector1Ms === x.s1, T = x && h.isValid && h.sector2Ms === x.s2, $ = x && h.isValid && h.sector3Ms === x.s3;
833
+ /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: c.map((h, w) => {
834
+ const y = h.isValid && h.lapTimeMs === v, C = x && h.isValid && h.sector1Ms === x.s1, T = x && h.isValid && h.sector2Ms === x.s2, $ = x && h.isValid && h.sector3Ms === x.s3;
835
835
  let F = "pvx-row";
836
- return h.isValid || (F += " pvx-row--invalid"), C && (F += " pvx-row--personal-best"), /* @__PURE__ */ c("tr", { className: F, children: [
837
- /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n("span", { className: `pvx-rank ${C ? "pvx-rank--gold" : ""}`, children: y + 1 }) }),
838
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-md", children: h.lapNumber || "-" }),
839
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: A(h.lapTimeMs) }),
840
- /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${w ? "pvx-td--best-sector" : ""}`, children: B(h.sector1Ms) }),
841
- /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${T ? "pvx-td--best-sector" : ""}`, children: B(h.sector2Ms) }),
842
- /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${$ ? "pvx-td--best-sector" : ""}`, children: B(h.sector3Ms) }),
843
- /* @__PURE__ */ n("td", { className: "pvx-td", title: h.isValid ? void 0 : h.invalidReason || "Invalid", children: h.isValid ? /* @__PURE__ */ n(Ye, {}) : /* @__PURE__ */ n(Je, {}) }),
844
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: de(h.tyreCompound), children: h.tyreCompound || "-" }),
845
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: pe(h.startingFuelL) }),
846
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: j(h.timestamp) })
836
+ return h.isValid || (F += " pvx-row--invalid"), y && (F += " pvx-row--personal-best"), /* @__PURE__ */ l("tr", { className: F, children: [
837
+ /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t("span", { className: `pvx-rank ${y ? "pvx-rank--gold" : ""}`, children: w + 1 }) }),
838
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-md", children: h.lapNumber || "-" }),
839
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: A(h.lapTimeMs) }),
840
+ /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${C ? "pvx-td--best-sector" : ""}`, children: B(h.sector1Ms) }),
841
+ /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${T ? "pvx-td--best-sector" : ""}`, children: B(h.sector2Ms) }),
842
+ /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${$ ? "pvx-td--best-sector" : ""}`, children: B(h.sector3Ms) }),
843
+ /* @__PURE__ */ t("td", { className: "pvx-td", title: h.isValid ? void 0 : h.invalidReason || "Invalid", children: h.isValid ? /* @__PURE__ */ t(Ze, {}) : /* @__PURE__ */ t(Xe, {}) }),
844
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: me(h.tyreCompound), children: h.tyreCompound || "-" }),
845
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: he(h.startingFuelL) }),
846
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: j(h.timestamp) })
847
847
  ] }, h.id);
848
848
  }) })
849
- ] }) }) : /* @__PURE__ */ n(V, { message: i ? "No laps recorded for this combination." : 'No valid laps. Try enabling "Show invalid laps".' })
849
+ ] }) }) : /* @__PURE__ */ t(V, { message: i ? "No laps recorded for this combination." : 'No valid laps. Try enabling "Show invalid laps".' })
850
850
  ] });
851
851
  }
852
- function dt({ drivers: e, isLoading: t, getUserDisplay: r, game: s, gameVersion: a, onComboSelect: i }) {
853
- const [o, d] = W({ key: "rank", dir: "asc" }), [u, l] = D(null), p = L(() => e ? z(e, o, (g, m) => {
852
+ function un({ drivers: e, isLoading: n, getUserDisplay: s, game: r, gameVersion: a, onComboSelect: i }) {
853
+ const [o, d] = W({ key: "rank", dir: "asc" }), [p, c] = D(null), u = L(() => e ? G(e, o, (f, m) => {
854
854
  switch (m) {
855
855
  case "rating":
856
- return g.rating;
856
+ return f.rating;
857
857
  case "comboCount":
858
- return g.comboCount || 0;
858
+ return f.comboCount || 0;
859
859
  case "distinctCars":
860
- return g.distinctCars || 0;
860
+ return f.distinctCars || 0;
861
861
  case "rank":
862
862
  default:
863
- return g.rank;
863
+ return f.rank;
864
864
  }
865
865
  }) : [], [e, o]);
866
- if (t) return /* @__PURE__ */ n(K, {});
866
+ if (n) return /* @__PURE__ */ t(K, {});
867
867
  if (!(e != null && e.length))
868
- return /* @__PURE__ */ n("div", { className: "pvx-card", children: /* @__PURE__ */ n(V, { message: "Not enough data for rankings yet." }) });
869
- const f = 5;
870
- return /* @__PURE__ */ c("div", { className: "pvx-card", children: [
871
- /* @__PURE__ */ c("div", { className: "pvx-card-header pvx-rankings-header", children: [
872
- /* @__PURE__ */ n("h2", { className: "pvx-card-title", children: "Driver Rankings" }),
873
- /* @__PURE__ */ c("div", { className: "pvx-rankings-info-trigger", children: [
874
- /* @__PURE__ */ n("svg", { className: "pvx-rankings-info-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" }) }),
875
- /* @__PURE__ */ c("div", { className: "pvx-rankings-info-tooltip", children: [
876
- /* @__PURE__ */ n("p", { className: "pvx-rankings-info-title", children: "How ratings work" }),
877
- /* @__PURE__ */ c("ul", { className: "pvx-rankings-info-list", children: [
878
- /* @__PURE__ */ n("li", { children: "For each car/track combo with 3+ drivers, you're ranked by lap time and given a percentile (100 = fastest, 0 = slowest)" }),
879
- /* @__PURE__ */ n("li", { children: "Your rating is a weighted average across all your combos — bigger fields count more" }),
880
- /* @__PURE__ */ n("li", { children: "A confidence adjustment rewards car diversity: the more different cars you drive competitively, the closer your rating reflects your true score" }),
881
- /* @__PURE__ */ n("li", { children: "Minimum 2 qualifying combos required" })
868
+ return /* @__PURE__ */ t("div", { className: "pvx-card", children: /* @__PURE__ */ t(V, { message: "Not enough data for rankings yet." }) });
869
+ const g = 5;
870
+ return /* @__PURE__ */ l("div", { className: "pvx-card", children: [
871
+ /* @__PURE__ */ l("div", { className: "pvx-card-header pvx-rankings-header", children: [
872
+ /* @__PURE__ */ t("h2", { className: "pvx-card-title", children: "Driver Rankings" }),
873
+ /* @__PURE__ */ l("div", { className: "pvx-rankings-info-trigger", children: [
874
+ /* @__PURE__ */ t("svg", { className: "pvx-rankings-info-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" }) }),
875
+ /* @__PURE__ */ l("div", { className: "pvx-rankings-info-tooltip", children: [
876
+ /* @__PURE__ */ t("p", { className: "pvx-rankings-info-title", children: "How ratings work" }),
877
+ /* @__PURE__ */ l("ul", { className: "pvx-rankings-info-list", children: [
878
+ /* @__PURE__ */ t("li", { children: "For each car/track combo with 3+ drivers, you're ranked by lap time and given a percentile (100 = fastest, 0 = slowest)" }),
879
+ /* @__PURE__ */ t("li", { children: "Your rating is a weighted average across all your combos — bigger fields count more" }),
880
+ /* @__PURE__ */ t("li", { children: "A confidence adjustment rewards car diversity: the more different cars you drive competitively, the closer your rating reflects your true score" }),
881
+ /* @__PURE__ */ t("li", { children: "Minimum 2 qualifying combos required" })
882
882
  ] })
883
883
  ] })
884
884
  ] })
885
885
  ] }),
886
- /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ c("table", { className: "pvx-table", children: [
887
- /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ c("tr", { className: "pvx-thead-row", children: [
888
- /* @__PURE__ */ n(M, { label: "#", sortKey: "rank", config: o, onSort: d, className: "pvx-th--narrow" }),
889
- /* @__PURE__ */ n("th", { className: "pvx-th", children: "Driver" }),
890
- /* @__PURE__ */ n(M, { label: "Rating", sortKey: "rating", config: o, onSort: d }),
891
- /* @__PURE__ */ n(M, { label: "Cars", sortKey: "distinctCars", config: o, onSort: d, className: "pvx-hidden-below-sm" }),
892
- /* @__PURE__ */ n(M, { label: "Combos", sortKey: "comboCount", config: o, onSort: d, className: "pvx-hidden-below-sm" })
886
+ /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
887
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
888
+ /* @__PURE__ */ t(M, { label: "#", sortKey: "rank", config: o, onSort: d, className: "pvx-th--narrow" }),
889
+ /* @__PURE__ */ t("th", { className: "pvx-th", children: "Driver" }),
890
+ /* @__PURE__ */ t(M, { label: "Rating", sortKey: "rating", config: o, onSort: d }),
891
+ /* @__PURE__ */ t(M, { label: "Cars", sortKey: "distinctCars", config: o, onSort: d, className: "pvx-hidden-below-sm" }),
892
+ /* @__PURE__ */ t(M, { label: "Combos", sortKey: "comboCount", config: o, onSort: d, className: "pvx-hidden-below-sm" })
893
893
  ] }) }),
894
- /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: p.map((g) => {
895
- const m = u === g.identifier;
896
- return /* @__PURE__ */ n(
897
- Ze,
894
+ /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: u.map((f) => {
895
+ const m = p === f.identifier;
896
+ return /* @__PURE__ */ t(
897
+ et,
898
898
  {
899
- driver: g,
900
- getUserDisplay: r,
899
+ driver: f,
900
+ getUserDisplay: s,
901
901
  isExpanded: m,
902
- onToggle: () => l(m ? null : g.identifier),
903
- colCount: f,
904
- game: s,
902
+ onToggle: () => c(m ? null : f.identifier),
903
+ colCount: g,
904
+ game: r,
905
905
  gameVersion: a,
906
906
  onComboSelect: i
907
907
  },
908
- g.identifier
908
+ f.identifier
909
909
  );
910
910
  }) })
911
911
  ] }) })
912
912
  ] });
913
913
  }
914
- function Ze({ driver: e, getUserDisplay: t, isExpanded: r, onToggle: s, colCount: a, game: i, gameVersion: o, onComboSelect: d }) {
915
- const u = e.identifier;
916
- return /* @__PURE__ */ c(U, { children: [
917
- /* @__PURE__ */ c(
914
+ function et({ driver: e, getUserDisplay: n, isExpanded: s, onToggle: r, colCount: a, game: i, gameVersion: o, onComboSelect: d }) {
915
+ const p = e.identifier;
916
+ return /* @__PURE__ */ l(U, { children: [
917
+ /* @__PURE__ */ l(
918
918
  "tr",
919
919
  {
920
920
  className: `pvx-row pvx-row--clickable ${e.rank <= 3 ? "pvx-row--podium" : ""}`,
921
- onClick: s,
921
+ onClick: r,
922
922
  children: [
923
- /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(te, { rank: e.rank, podium: !0 }) }),
924
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(G, { userId: u, getUserDisplay: t }) }),
925
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: e.rating.toFixed(1) }),
926
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: e.distinctCars || "-" }),
927
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: /* @__PURE__ */ c("span", { className: "pvx-rankings-combo-count", children: [
923
+ /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t(re, { rank: e.rank, podium: !0 }) }),
924
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ t(z, { userId: p, getUserDisplay: n }) }),
925
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: e.rating.toFixed(1) }),
926
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: e.distinctCars || "-" }),
927
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: /* @__PURE__ */ l("span", { className: "pvx-rankings-combo-count", children: [
928
928
  e.comboCount,
929
- /* @__PURE__ */ n("svg", { className: `pvx-rankings-chevron ${r ? "pvx-rankings-chevron--open" : ""}`, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ n("path", { d: "m6 9 6 6 6-6" }) })
929
+ /* @__PURE__ */ t("svg", { className: `pvx-rankings-chevron ${s ? "pvx-rankings-chevron--open" : ""}`, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ t("path", { d: "m6 9 6 6 6-6" }) })
930
930
  ] }) })
931
931
  ]
932
932
  }
933
933
  ),
934
- 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((l, p) => {
935
- const f = l.layout ? `${l.trackId}|${l.layout}` : l.trackId, g = d ? () => d({ track: f, car: l.carId, highlight: u, game: i, gameVersion: o }) : void 0;
936
- return /* @__PURE__ */ c(
934
+ s && e.combos && /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: a, className: "pvx-rankings-combos-cell", children: /* @__PURE__ */ t("div", { className: "pvx-rankings-combos", children: e.combos.map((c, u) => {
935
+ const g = c.layout ? `${c.trackId}|${c.layout}` : c.trackId, f = d ? () => d({ track: g, car: c.carId, highlight: p, game: i, gameVersion: o }) : void 0;
936
+ return /* @__PURE__ */ l(
937
937
  "div",
938
938
  {
939
- className: `pvx-rankings-combo ${g ? "pvx-rankings-combo--clickable" : ""}`,
940
- onClick: g,
941
- role: g ? "button" : void 0,
939
+ className: `pvx-rankings-combo ${f ? "pvx-rankings-combo--clickable" : ""}`,
940
+ onClick: f,
941
+ role: f ? "button" : void 0,
942
942
  children: [
943
- /* @__PURE__ */ c("div", { className: "pvx-rankings-combo-info", children: [
944
- /* @__PURE__ */ n("p", { className: "pvx-rankings-combo-track", children: q(l.trackId, l.layout, i) }),
945
- /* @__PURE__ */ n("p", { className: "pvx-rankings-combo-car", children: I(l.carId) })
943
+ /* @__PURE__ */ l("div", { className: "pvx-rankings-combo-info", children: [
944
+ /* @__PURE__ */ t("p", { className: "pvx-rankings-combo-track", children: q(c.trackId, c.layout, i) }),
945
+ /* @__PURE__ */ t("p", { className: "pvx-rankings-combo-car", children: I(c.carId) })
946
946
  ] }),
947
- /* @__PURE__ */ c("div", { className: "pvx-rankings-combo-stats", children: [
948
- /* @__PURE__ */ n("p", { className: "pvx-rankings-combo-time", children: A(l.lapTimeMs) }),
949
- /* @__PURE__ */ c("p", { className: `pvx-rankings-combo-pct ${l.percentile >= 75 ? "pvx-rankings-combo-pct--high" : l.percentile >= 50 ? "pvx-rankings-combo-pct--mid" : l.percentile >= 25 ? "pvx-rankings-combo-pct--low" : "pvx-rankings-combo-pct--bottom"}`, children: [
950
- l.percentile.toFixed(0),
947
+ /* @__PURE__ */ l("div", { className: "pvx-rankings-combo-stats", children: [
948
+ /* @__PURE__ */ t("p", { className: "pvx-rankings-combo-time", children: A(c.lapTimeMs) }),
949
+ /* @__PURE__ */ l("p", { className: `pvx-rankings-combo-pct ${c.percentile >= 75 ? "pvx-rankings-combo-pct--high" : c.percentile >= 50 ? "pvx-rankings-combo-pct--mid" : c.percentile >= 25 ? "pvx-rankings-combo-pct--low" : "pvx-rankings-combo-pct--bottom"}`, children: [
950
+ c.percentile.toFixed(0),
951
951
  "%",
952
- /* @__PURE__ */ c("span", { className: "pvx-rankings-combo-rank", children: [
952
+ /* @__PURE__ */ l("span", { className: "pvx-rankings-combo-rank", children: [
953
953
  "(",
954
- l.rank,
954
+ c.rank,
955
955
  "/",
956
- l.totalDrivers,
956
+ c.totalDrivers,
957
957
  ")"
958
958
  ] })
959
959
  ] })
960
960
  ] })
961
961
  ]
962
962
  },
963
- p
963
+ u
964
964
  );
965
965
  }) }) }) })
966
966
  ] });
967
967
  }
968
- const Xe = {
968
+ const tt = {
969
969
  GBR: "🇬🇧",
970
970
  DEU: "🇩🇪",
971
971
  NLD: "🇳🇱",
@@ -996,175 +996,173 @@ const Xe = {
996
996
  RUS: "🇷🇺",
997
997
  TUR: "🇹🇷",
998
998
  KOR: "🇰🇷"
999
- }, se = ["🥇", "🥈", "🥉"], en = {
999
+ }, ae = ["🥇", "🥈", "🥉"], nt = {
1000
1000
  championship: "Championship",
1001
1001
  series: "Series",
1002
1002
  event: "Event",
1003
1003
  hotlap: "Hotlap"
1004
- }, nn = ["PRACTICE", "QUALIFYING", "RACE"];
1005
- function oe(e) {
1006
- const t = nn.indexOf(e);
1007
- if (t >= 0) return t;
1008
- const r = e.match(/^PRACTICE_(\d+)$/);
1009
- return r ? 100 + parseInt(r[1]) : 999;
1004
+ }, rt = ["PRACTICE", "QUALIFYING", "RACE"];
1005
+ function de(e) {
1006
+ const n = rt.indexOf(e);
1007
+ if (n >= 0) return n;
1008
+ const s = e.match(/^PRACTICE_(\d+)$/);
1009
+ return s ? 100 + parseInt(s[1]) : 999;
1010
1010
  }
1011
- function tn(e) {
1012
- const t = e.match(/^PRACTICE_(\d+)$/);
1013
- return t ? `P${t[1]}` : e;
1011
+ function ie(e) {
1012
+ const n = e.match(/^PRACTICE_(\d+)$/);
1013
+ return n ? `P${n[1]}` : e;
1014
1014
  }
1015
- function we({ position: e }) {
1016
- 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 });
1015
+ function oe({ position: e }) {
1016
+ return /* @__PURE__ */ t("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 });
1017
1017
  }
1018
- function ae({ nation: e }) {
1019
- const t = e && Xe[e];
1020
- return t ? /* @__PURE__ */ n("span", { className: "pvx-nation-flag", title: e, children: t }) : null;
1018
+ function Q({ nation: e }) {
1019
+ const n = e && tt[e];
1020
+ return n ? /* @__PURE__ */ t("span", { className: "pvx-nation-flag", title: e, children: n }) : null;
1021
1021
  }
1022
- function rn({ sessions: e, activeSession: t, onSelect: r }) {
1022
+ function st({ sessions: e, activeSession: n, onSelect: s }) {
1023
1023
  if (!e || e.length <= 1) return null;
1024
- const s = [...e].sort(
1025
- (a, i) => oe(a.type) - oe(i.type)
1024
+ const r = [...e].sort(
1025
+ (a, i) => de(a.type) - de(i.type)
1026
1026
  );
1027
- return /* @__PURE__ */ n("div", { className: "pvx-session-tabs", children: s.map((a) => /* @__PURE__ */ n(
1027
+ return /* @__PURE__ */ t("div", { className: "pvx-session-tabs", children: r.map((a) => /* @__PURE__ */ t(
1028
1028
  "button",
1029
1029
  {
1030
- onClick: () => r(a.type),
1031
- className: `pvx-session-tab ${t === a.type ? "pvx-session-tab--active" : ""}`,
1032
- children: tn(a.type)
1030
+ onClick: () => s(a.type),
1031
+ className: `pvx-session-tab ${n === a.type ? "pvx-session-tab--active" : ""}`,
1032
+ children: ie(a.type)
1033
1033
  },
1034
1034
  a.type
1035
1035
  )) });
1036
1036
  }
1037
- function sn({ type: e }) {
1038
- return /* @__PURE__ */ n("span", { className: `pvx-comp-badge pvx-comp-badge--${e}`, children: en[e] || e });
1037
+ function at({ type: e }) {
1038
+ return /* @__PURE__ */ t("span", { className: `pvx-comp-badge pvx-comp-badge--${e}`, children: nt[e] || e });
1039
1039
  }
1040
- function Y({ children: e, variant: t = "default" }) {
1041
- return /* @__PURE__ */ n("span", { className: `pvx-info-pill ${t !== "default" ? `pvx-info-pill--${t}` : ""}`, children: e });
1040
+ function J({ children: e, variant: n = "default" }) {
1041
+ return /* @__PURE__ */ t("span", { className: `pvx-info-pill ${n !== "default" ? `pvx-info-pill--${n}` : ""}`, children: e });
1042
1042
  }
1043
- function an(e) {
1043
+ function it(e) {
1044
1044
  if (!e) return "TBD";
1045
- const t = new Date(e);
1046
- if (isNaN(t)) return "TBD";
1047
- const r = t.toLocaleDateString("en-GB", { weekday: "short", day: "numeric", month: "short" }), s = t.toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit" });
1048
- return `${r} • ${s}`;
1049
- }
1050
- function on(e) {
1051
- return e.reduce((t, r) => {
1052
- var s;
1053
- return (s = r.splits) != null && s.length ? t ? t.map((a, i) => {
1054
- const o = r.splits[i];
1045
+ const n = new Date(e);
1046
+ if (isNaN(n)) return "TBD";
1047
+ const s = n.toLocaleDateString("en-GB", { weekday: "short", day: "numeric", month: "short" }), r = n.toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit" });
1048
+ return `${s} • ${r}`;
1049
+ }
1050
+ function ot(e) {
1051
+ return e.reduce((n, s) => {
1052
+ var r;
1053
+ return (r = s.splits) != null && r.length ? n ? n.map((a, i) => {
1054
+ const o = s.splits[i];
1055
1055
  return o && o < a ? o : a;
1056
- }) : [...r.splits] : t;
1056
+ }) : [...s.splits] : n;
1057
1057
  }, null);
1058
1058
  }
1059
1059
  function E({ message: e = "Loading..." }) {
1060
- return /* @__PURE__ */ n("div", { className: "pvx-loading", children: e });
1060
+ return /* @__PURE__ */ t("div", { className: "pvx-loading", children: e });
1061
1061
  }
1062
1062
  function P({ message: e = "No data available." }) {
1063
- return /* @__PURE__ */ n("div", { className: "pvx-empty", children: /* @__PURE__ */ n("p", { children: e }) });
1064
- }
1065
- const Ce = 3;
1066
- function cn(e) {
1067
- const t = e == null ? void 0 : e.rounds;
1068
- return t != null && t.length ? t.every((r) => r.isFinalized) : !1;
1069
- }
1070
- function ln(e) {
1071
- const t = e == null ? void 0 : e.rounds;
1072
- if (!(t != null && t.length)) return null;
1073
- let r = null;
1074
- for (const s of t) {
1075
- if (!s.startTime) continue;
1076
- const a = new Date(s.startTime);
1077
- isNaN(a) || (!r || a > r) && (r = a);
1063
+ return /* @__PURE__ */ t("div", { className: "pvx-empty", children: /* @__PURE__ */ t("p", { children: e }) });
1064
+ }
1065
+ const Te = 3;
1066
+ function lt(e) {
1067
+ const n = e == null ? void 0 : e.rounds;
1068
+ return n != null && n.length ? n.every((s) => s.isFinalized) : !1;
1069
+ }
1070
+ function ct(e) {
1071
+ const n = e == null ? void 0 : e.rounds;
1072
+ if (!(n != null && n.length)) return null;
1073
+ let s = null;
1074
+ for (const r of n) {
1075
+ if (!r.startTime) continue;
1076
+ const a = new Date(r.startTime);
1077
+ isNaN(a) || (!s || a > s) && (s = a);
1078
1078
  }
1079
- return r;
1079
+ return s;
1080
1080
  }
1081
- function Le(e, t = Ce) {
1082
- if (!cn(e)) return "active";
1083
- const r = ln(e);
1084
- if (!r) return "recently-completed";
1085
- const s = t * 24 * 60 * 60 * 1e3;
1086
- return Date.now() - r.getTime() <= s ? "recently-completed" : "archived";
1081
+ function Se(e, n = Te) {
1082
+ if (!lt(e)) return "active";
1083
+ const s = ct(e);
1084
+ if (!s) return "recently-completed";
1085
+ const r = n * 24 * 60 * 60 * 1e3;
1086
+ return Date.now() - s.getTime() <= r ? "recently-completed" : "archived";
1087
1087
  }
1088
- function pt(e, t, r = Ce) {
1088
+ function mn(e, n, s = Te) {
1089
1089
  if (!(e != null && e.length)) return [];
1090
- const s = new Set(Array.isArray(t) ? t : [t]);
1091
- return e.filter((a) => s.has(Le(a, r)));
1092
- }
1093
- function dn(e, t = 3) {
1094
- const r = e == null ? void 0 : e.standings;
1095
- return Array.isArray(r) ? [...r].sort((s, a) => (s.position ?? 999) - (a.position ?? 999)).slice(0, t) : [];
1096
- }
1097
- function pn({ competitionId: e, topN: t = 3, label: r = "Completed", className: s }) {
1098
- const { data: a } = ve(e), i = dn(a, t);
1099
- return /* @__PURE__ */ c("div", { className: `pvx-comp-completed-badge ${s || ""}`, children: [
1100
- /* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-label", children: r }),
1101
- i.length > 0 && /* @__PURE__ */ n("ol", { className: "pvx-comp-completed-badge-podium", children: i.map((o, d) => /* @__PURE__ */ c("li", { className: "pvx-comp-completed-badge-driver", children: [
1102
- /* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-medal", "aria-hidden": "true", children: se[d] || "" }),
1103
- /* @__PURE__ */ n(ae, { nation: o.nation }),
1104
- /* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-name", children: o.driverName })
1090
+ const r = new Set(Array.isArray(n) ? n : [n]);
1091
+ return e.filter((a) => r.has(Se(a, s)));
1092
+ }
1093
+ function dt(e, n = 3) {
1094
+ const s = e == null ? void 0 : e.standings;
1095
+ return Array.isArray(s) ? [...s].sort((r, a) => (r.position ?? 999) - (a.position ?? 999)).slice(0, n) : [];
1096
+ }
1097
+ function pt({ competitionId: e, topN: n = 3, label: s = "Completed", className: r }) {
1098
+ const { data: a } = ge(e), i = dt(a, n);
1099
+ return /* @__PURE__ */ l("div", { className: `pvx-comp-completed-badge ${r || ""}`, children: [
1100
+ /* @__PURE__ */ t("span", { className: "pvx-comp-completed-badge-label", children: s }),
1101
+ i.length > 0 && /* @__PURE__ */ t("ol", { className: "pvx-comp-completed-badge-podium", children: i.map((o, d) => /* @__PURE__ */ l("li", { className: "pvx-comp-completed-badge-driver", children: [
1102
+ /* @__PURE__ */ t("span", { className: "pvx-comp-completed-badge-medal", "aria-hidden": "true", children: ae[d] || "" }),
1103
+ /* @__PURE__ */ t(Q, { nation: o.nation }),
1104
+ /* @__PURE__ */ t("span", { className: "pvx-comp-completed-badge-name", children: o.driverName })
1105
1105
  ] }, o.driverId || d)) })
1106
1106
  ] });
1107
1107
  }
1108
- function ut({ competitions: e, isLoading: t, onSelect: r, onRegister: s, className: a }) {
1109
- return t ? /* @__PURE__ */ n(E, { message: "Loading competitions..." }) : e != null && e.length ? /* @__PURE__ */ n("div", { className: `pvx-comp-grid ${a || ""}`, children: e.map((i) => /* @__PURE__ */ n(un, { comp: i, onSelect: r, onRegister: s || r }, i.id)) }) : /* @__PURE__ */ n(P, { message: "No competitions available." });
1108
+ function hn({ competitions: e, isLoading: n, onSelect: s, onRegister: r, className: a }) {
1109
+ return n ? /* @__PURE__ */ t(E, { message: "Loading competitions..." }) : e != null && e.length ? /* @__PURE__ */ t("div", { className: `pvx-comp-grid ${a || ""}`, children: e.map((i) => /* @__PURE__ */ t(ut, { comp: i, onSelect: s, onRegister: r || s }, i.id)) }) : /* @__PURE__ */ t(P, { message: "No competitions available." });
1110
1110
  }
1111
- function un({ comp: e, onSelect: t, onRegister: r }) {
1112
- var h, y, C;
1113
- const { cdnUrl: s } = k(), 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, u = d && o >= d, l = (i == null ? void 0 : i.deadline) && new Date(i.deadline) < /* @__PURE__ */ new Date(), p = (i == null ? void 0 : i.isOpen) && !l && !u, f = /* @__PURE__ */ new Date(), g = (h = e.rounds) == null ? void 0 : h.find((w) => w.startTime && new Date(w.startTime) >= f), m = ((y = e.rounds) == null ? void 0 : y.length) || 0, b = ((C = e.rounds) == null ? void 0 : C.filter((w) => w.isFinalized).length) || 0, x = Le(e), v = x === "recently-completed" || x === "archived", N = e.type === "championship";
1114
- return /* @__PURE__ */ c(
1111
+ function ut({ comp: e, onSelect: n, onRegister: s }) {
1112
+ var h, w, y;
1113
+ const { cdnUrl: r } = k(), a = e.posterCdnPath ? `${r}/${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, g = /* @__PURE__ */ new Date(), f = (h = e.rounds) == null ? void 0 : h.find((C) => C.startTime && new Date(C.startTime) >= g), m = ((w = e.rounds) == null ? void 0 : w.length) || 0, b = ((y = e.rounds) == null ? void 0 : y.filter((C) => C.isFinalized).length) || 0, x = Se(e), v = x === "recently-completed" || x === "archived", N = e.type === "championship";
1114
+ return /* @__PURE__ */ l(
1115
1115
  "div",
1116
1116
  {
1117
1117
  className: "pvx-comp-card",
1118
- onClick: () => t(e.id),
1118
+ onClick: () => n(e.id),
1119
1119
  role: "button",
1120
1120
  tabIndex: 0,
1121
- onKeyDown: (w) => {
1122
- (w.key === "Enter" || w.key === " ") && (w.preventDefault(), t(e.id));
1121
+ onKeyDown: (C) => {
1122
+ (C.key === "Enter" || C.key === " ") && (C.preventDefault(), n(e.id));
1123
1123
  },
1124
1124
  children: [
1125
- /* @__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(vn, {}) }) }),
1126
- /* @__PURE__ */ c("div", { className: "pvx-comp-card-body", children: [
1127
- /* @__PURE__ */ n("h3", { className: "pvx-comp-card-title", children: e.name }),
1128
- e.description && /* @__PURE__ */ n("p", { className: "pvx-comp-card-desc", children: e.description }),
1129
- /* @__PURE__ */ c("div", { className: "pvx-comp-card-pills", children: [
1130
- /* @__PURE__ */ n(sn, { type: e.type }),
1131
- e.game && /* @__PURE__ */ n(Y, { children: e.game.toUpperCase() }),
1132
- e.formatDescription && e.formatDescription.split(", ").map((w, T) => /* @__PURE__ */ n(Y, { variant: "format", children: w }, T))
1125
+ /* @__PURE__ */ t("div", { className: "pvx-comp-card-poster", children: a ? /* @__PURE__ */ t("img", { src: a, alt: e.name, className: "pvx-comp-card-poster-img" }) : /* @__PURE__ */ t("div", { className: "pvx-comp-card-poster-placeholder", children: /* @__PURE__ */ t(ht, {}) }) }),
1126
+ /* @__PURE__ */ l("div", { className: "pvx-comp-card-body", children: [
1127
+ /* @__PURE__ */ t("h3", { className: "pvx-comp-card-title", children: e.name }),
1128
+ e.description && /* @__PURE__ */ t("p", { className: "pvx-comp-card-desc", children: e.description }),
1129
+ /* @__PURE__ */ l("div", { className: "pvx-comp-card-pills", children: [
1130
+ /* @__PURE__ */ t(at, { type: e.type }),
1131
+ e.game && /* @__PURE__ */ t(J, { children: e.game.toUpperCase() }),
1132
+ e.formatDescription && e.formatDescription.split(", ").map((C, T) => /* @__PURE__ */ t(J, { variant: "format", children: C }, T))
1133
1133
  ] }),
1134
- e.carsDescription && /* @__PURE__ */ n("div", { className: "pvx-comp-card-pills", children: e.carsDescription.split(", ").map((w, T) => /* @__PURE__ */ n(Y, { children: w }, T)) }),
1135
- /* @__PURE__ */ c("div", { className: "pvx-comp-card-schedule", children: [
1136
- g ? /* @__PURE__ */ c("span", { className: "pvx-comp-card-schedule-next", children: [
1137
- /* @__PURE__ */ n("span", { className: "pvx-comp-card-schedule-label", children: "Next:" }),
1134
+ e.carsDescription && /* @__PURE__ */ t("div", { className: "pvx-comp-card-pills", children: e.carsDescription.split(", ").map((C, T) => /* @__PURE__ */ t(J, { children: C }, T)) }),
1135
+ /* @__PURE__ */ l("div", { className: "pvx-comp-card-schedule", children: [
1136
+ f ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
1137
+ /* @__PURE__ */ t("span", { className: "pvx-comp-card-schedule-label", children: "Next:" }),
1138
1138
  " ",
1139
- "R",
1140
- g.roundNumber,
1141
- " ",
1142
- g.track || "TBD",
1143
- " ",
1144
- an(g.startTime)
1145
- ] }) : m > 0 ? /* @__PURE__ */ c("span", { className: "pvx-comp-card-schedule-next", children: [
1139
+ e.type !== "hotlap" && `R${f.roundNumber} `,
1140
+ f.track || "TBD",
1141
+ " · ",
1142
+ it(f.startTime)
1143
+ ] }) : m > 0 ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
1146
1144
  b,
1147
1145
  "/",
1148
1146
  m,
1149
1147
  " rounds completed"
1150
1148
  ] }) : null,
1151
- m > 0 && /* @__PURE__ */ c("span", { className: "pvx-comp-card-round-count", children: [
1149
+ m > 0 && /* @__PURE__ */ l("span", { className: "pvx-comp-card-round-count", children: [
1152
1150
  m,
1153
1151
  " round",
1154
1152
  m !== 1 ? "s" : ""
1155
1153
  ] })
1156
1154
  ] }),
1157
- v && N && /* @__PURE__ */ n(pn, { competitionId: e.id }),
1158
- i && !v && /* @__PURE__ */ n(
1159
- mn,
1155
+ v && N && /* @__PURE__ */ t(pt, { competitionId: e.id }),
1156
+ i && !v && /* @__PURE__ */ t(
1157
+ mt,
1160
1158
  {
1161
1159
  competitionId: e.id,
1162
- regOpen: p,
1163
- isFull: u,
1164
- deadlinePassed: l,
1160
+ regOpen: u,
1161
+ isFull: p,
1162
+ deadlinePassed: c,
1165
1163
  regCount: o,
1166
1164
  regMax: d,
1167
- onRegister: r
1165
+ onRegister: s
1168
1166
  }
1169
1167
  )
1170
1168
  ] })
@@ -1172,16 +1170,16 @@ function un({ comp: e, onSelect: t, onRegister: r }) {
1172
1170
  }
1173
1171
  );
1174
1172
  }
1175
- function mn({ competitionId: e, regOpen: t, isFull: r, deadlinePassed: s, regCount: a, regMax: i, onRegister: o }) {
1176
- const { isPowerMode: d } = ee(), u = ne(e), { data: l } = X(e), p = (l == null ? void 0 : l.isRegistered) || !1, f = i ? a / i * 100 : 0, g = f >= 100 ? "full" : f >= 75 ? "warning" : "ok";
1177
- return /* @__PURE__ */ c("div", { className: "pvx-comp-card-reg", children: [
1178
- /* @__PURE__ */ n("div", { className: "pvx-comp-card-reg-info", children: /* @__PURE__ */ c("span", { className: `pvx-reg-capacity pvx-reg-capacity--${g}`, children: [
1173
+ function mt({ competitionId: e, regOpen: n, isFull: s, deadlinePassed: r, regCount: a, regMax: i, onRegister: o }) {
1174
+ const { isPowerMode: d } = te(), p = ne(e), { data: c } = ee(e), u = (c == null ? void 0 : c.isRegistered) || !1, g = i ? a / i * 100 : 0, f = g >= 100 ? "full" : g >= 75 ? "warning" : "ok";
1175
+ return /* @__PURE__ */ l("div", { className: "pvx-comp-card-reg", children: [
1176
+ /* @__PURE__ */ t("div", { className: "pvx-comp-card-reg-info", children: /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${f}`, children: [
1179
1177
  a,
1180
1178
  "/",
1181
1179
  i || "∞",
1182
1180
  " drivers"
1183
1181
  ] }) }),
1184
- /* @__PURE__ */ n("div", { className: "pvx-comp-card-reg-action", children: p ? /* @__PURE__ */ n(
1182
+ /* @__PURE__ */ t("div", { className: "pvx-comp-card-reg-action", children: u ? /* @__PURE__ */ t(
1185
1183
  "button",
1186
1184
  {
1187
1185
  className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--registered",
@@ -1190,7 +1188,7 @@ function mn({ competitionId: e, regOpen: t, isFull: r, deadlinePassed: s, regCou
1190
1188
  },
1191
1189
  children: "✓ Registered"
1192
1190
  }
1193
- ) : t ? d ? /* @__PURE__ */ n(
1191
+ ) : n ? d ? /* @__PURE__ */ t(
1194
1192
  "button",
1195
1193
  {
1196
1194
  className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--open",
@@ -1199,240 +1197,240 @@ function mn({ competitionId: e, regOpen: t, isFull: r, deadlinePassed: s, regCou
1199
1197
  },
1200
1198
  children: "Register"
1201
1199
  }
1202
- ) : /* @__PURE__ */ n(
1200
+ ) : /* @__PURE__ */ t(
1203
1201
  "a",
1204
1202
  {
1205
- href: u,
1203
+ href: p,
1206
1204
  target: "_blank",
1207
1205
  rel: "noopener noreferrer",
1208
1206
  className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--open",
1209
1207
  onClick: (m) => m.stopPropagation(),
1210
1208
  children: "Register"
1211
1209
  }
1212
- ) : /* @__PURE__ */ n("span", { className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--closed", children: r ? "Full" : "Closed" }) })
1210
+ ) : /* @__PURE__ */ t("span", { className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--closed", children: s ? "Full" : "Closed" }) })
1213
1211
  ] });
1214
1212
  }
1215
- function vn() {
1216
- return /* @__PURE__ */ c("svg", { className: "pvx-comp-trophy-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
1217
- /* @__PURE__ */ n("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
1218
- /* @__PURE__ */ n("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
1219
- /* @__PURE__ */ n("path", { d: "M4 22h16" }),
1220
- /* @__PURE__ */ n("path", { d: "M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22" }),
1221
- /* @__PURE__ */ n("path", { d: "M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22" }),
1222
- /* @__PURE__ */ n("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
1213
+ function ht() {
1214
+ 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: [
1215
+ /* @__PURE__ */ t("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
1216
+ /* @__PURE__ */ t("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
1217
+ /* @__PURE__ */ t("path", { d: "M4 22h16" }),
1218
+ /* @__PURE__ */ t("path", { d: "M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22" }),
1219
+ /* @__PURE__ */ t("path", { d: "M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22" }),
1220
+ /* @__PURE__ */ t("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
1223
1221
  ] });
1224
1222
  }
1225
- function hn({ competitionId: e, className: t }) {
1226
- var d, u;
1227
- const { data: r, isLoading: s } = ve(e), { data: a, isLoading: i } = me(e);
1228
- if (s || i)
1229
- return /* @__PURE__ */ n(E, { message: "Loading standings..." });
1230
- if (!((d = r == null ? void 0 : r.standings) != null && d.length))
1231
- return /* @__PURE__ */ n(P, { message: "No standings data yet. Results will appear once rounds are finalised." });
1232
- const o = ((u = a == null ? void 0 : a.rounds) == null ? void 0 : u.filter((l) => l.isFinalized)) || [];
1233
- return /* @__PURE__ */ c("div", { className: `pvx-card ${t || ""}`, children: [
1234
- /* @__PURE__ */ n("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ c("div", { className: "pvx-card-header-left", children: [
1235
- /* @__PURE__ */ n("h3", { className: "pvx-card-title", children: "Championship Standings" }),
1236
- /* @__PURE__ */ c("span", { className: "pvx-standings-subtitle", children: [
1223
+ function vt({ competitionId: e, className: n }) {
1224
+ var d, p;
1225
+ const { data: s, isLoading: r } = ge(e), { data: a, isLoading: i } = xe(e);
1226
+ if (r || i)
1227
+ return /* @__PURE__ */ t(E, { message: "Loading standings..." });
1228
+ if (!((d = s == null ? void 0 : s.standings) != null && d.length))
1229
+ return /* @__PURE__ */ t(P, { message: "No standings data yet. Results will appear once rounds are finalised." });
1230
+ const o = ((p = a == null ? void 0 : a.rounds) == null ? void 0 : p.filter((c) => c.isFinalized)) || [];
1231
+ return /* @__PURE__ */ l("div", { className: `pvx-card ${n || ""}`, children: [
1232
+ /* @__PURE__ */ t("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
1233
+ /* @__PURE__ */ t("h3", { className: "pvx-card-title", children: "Championship Standings" }),
1234
+ /* @__PURE__ */ l("span", { className: "pvx-standings-subtitle", children: [
1237
1235
  "After ",
1238
- r.roundsCompleted,
1236
+ s.roundsCompleted,
1239
1237
  " round",
1240
- r.roundsCompleted !== 1 ? "s" : "",
1241
- r.countingRounds > 0 && ` (best ${r.countingRounds} count)`
1238
+ s.roundsCompleted !== 1 ? "s" : "",
1239
+ s.countingRounds > 0 && ` (best ${s.countingRounds} count)`
1242
1240
  ] })
1243
1241
  ] }) }),
1244
- /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ c("table", { className: "pvx-table", children: [
1245
- /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ c("tr", { className: "pvx-thead-row", children: [
1246
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
1247
- /* @__PURE__ */ n("th", { className: "pvx-th", children: "Driver" }),
1248
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--center pvx-hidden-below-sm", children: "W" }),
1249
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--center pvx-hidden-below-sm", children: "Pod" }),
1250
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--center", children: "Points" }),
1251
- o.map((l) => /* @__PURE__ */ c(
1242
+ /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
1243
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
1244
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
1245
+ /* @__PURE__ */ t("th", { className: "pvx-th", children: "Driver" }),
1246
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--center pvx-hidden-below-sm", children: "W" }),
1247
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--center pvx-hidden-below-sm", children: "Pod" }),
1248
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--center", children: "Points" }),
1249
+ o.map((c) => /* @__PURE__ */ l(
1252
1250
  "th",
1253
1251
  {
1254
1252
  className: "pvx-th pvx-th--center pvx-hidden-below-md",
1255
- title: l.track || `Round ${l.roundNumber}`,
1253
+ title: c.track || `Round ${c.roundNumber}`,
1256
1254
  children: [
1257
1255
  "R",
1258
- l.roundNumber
1256
+ c.roundNumber
1259
1257
  ]
1260
1258
  },
1261
- l.roundNumber
1259
+ c.roundNumber
1262
1260
  ))
1263
1261
  ] }) }),
1264
- /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: r.standings.map((l) => /* @__PURE__ */ n(
1265
- xn,
1262
+ /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: s.standings.map((c) => /* @__PURE__ */ t(
1263
+ xt,
1266
1264
  {
1267
- driver: l,
1265
+ driver: c,
1268
1266
  finalizedRounds: o
1269
1267
  },
1270
- l.driverId || l.driverName
1268
+ c.driverId || c.driverName
1271
1269
  )) })
1272
1270
  ] }) })
1273
1271
  ] });
1274
1272
  }
1275
- function xn({ driver: e, finalizedRounds: t }) {
1276
- var o, d, u;
1277
- const r = e.position <= 3, s = new Map(
1278
- ((o = e.roundResults) == null ? void 0 : o.map((l) => [l.roundNumber, l])) || []
1279
- ), a = ((d = e.roundResults) == null ? void 0 : d.filter((l) => l.position === 1).length) || 0, i = ((u = e.roundResults) == null ? void 0 : u.filter((l) => l.position <= 3).length) || 0;
1280
- return /* @__PURE__ */ c("tr", { className: `pvx-row ${r ? "pvx-row--podium" : ""}`, children: [
1281
- /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(we, { position: e.position }) }),
1282
- /* @__PURE__ */ c("td", { className: "pvx-td pvx-td--primary", children: [
1283
- /* @__PURE__ */ n(ae, { nation: e.nation }),
1273
+ function xt({ driver: e, finalizedRounds: n }) {
1274
+ var o, d, p;
1275
+ const s = e.position <= 3, r = new Map(
1276
+ ((o = e.roundResults) == null ? void 0 : o.map((c) => [c.roundNumber, c])) || []
1277
+ ), 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;
1278
+ return /* @__PURE__ */ l("tr", { className: `pvx-row ${s ? "pvx-row--podium" : ""}`, children: [
1279
+ /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t(oe, { position: e.position }) }),
1280
+ /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
1281
+ /* @__PURE__ */ t(Q, { nation: e.nation }),
1284
1282
  e.driverName
1285
1283
  ] }),
1286
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: a || "-" }),
1287
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: i || "-" }),
1288
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-standings-total", children: e.totalPoints }),
1289
- t.map((l) => {
1290
- const p = s.get(l.roundNumber), f = p == null ? void 0 : p.dropped;
1291
- return /* @__PURE__ */ n(
1284
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: a || "-" }),
1285
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: i || "-" }),
1286
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-standings-total", children: e.totalPoints }),
1287
+ n.map((c) => {
1288
+ const u = r.get(c.roundNumber), g = u == null ? void 0 : u.dropped;
1289
+ return /* @__PURE__ */ t(
1292
1290
  "td",
1293
1291
  {
1294
- className: `pvx-td pvx-td--center pvx-hidden-below-md ${!f && (p == null ? void 0 : p.position) === 1 ? "pvx-standings-cell--p1" : !f && (p == null ? void 0 : p.position) === 2 ? "pvx-standings-cell--p2" : !f && (p == null ? void 0 : p.position) === 3 ? "pvx-standings-cell--p3" : ""}`,
1295
- children: p ? /* @__PURE__ */ c("div", { className: `pvx-standings-round-cell ${f ? "pvx-standings-round-cell--dropped" : ""}`, children: [
1296
- /* @__PURE__ */ c("span", { className: "pvx-standings-round-pos", children: [
1292
+ className: `pvx-td pvx-td--center pvx-hidden-below-md ${!g && (u == null ? void 0 : u.position) === 1 ? "pvx-standings-cell--p1" : !g && (u == null ? void 0 : u.position) === 2 ? "pvx-standings-cell--p2" : !g && (u == null ? void 0 : u.position) === 3 ? "pvx-standings-cell--p3" : ""}`,
1293
+ children: u ? /* @__PURE__ */ l("div", { className: `pvx-standings-round-cell ${g ? "pvx-standings-round-cell--dropped" : ""}`, children: [
1294
+ /* @__PURE__ */ l("span", { className: "pvx-standings-round-pos", children: [
1297
1295
  "P",
1298
- p.position
1296
+ u.position
1299
1297
  ] }),
1300
- /* @__PURE__ */ n("span", { className: "pvx-standings-round-pts", children: p.points })
1301
- ] }) : /* @__PURE__ */ n("span", { className: "pvx-td--muted", children: "-" })
1298
+ /* @__PURE__ */ t("span", { className: "pvx-standings-round-pts", children: u.points })
1299
+ ] }) : /* @__PURE__ */ t("span", { className: "pvx-td--muted", children: "-" })
1302
1300
  },
1303
- l.roundNumber
1301
+ c.roundNumber
1304
1302
  );
1305
1303
  })
1306
1304
  ] });
1307
1305
  }
1308
- function mt({ competitionId: e, roundNumber: t, className: r }) {
1309
- var u;
1310
- const { data: s, isLoading: a } = He(e, t);
1306
+ function vn({ competitionId: e, roundNumber: n, className: s }) {
1307
+ var p;
1308
+ const { data: r, isLoading: a } = Oe(e, n);
1311
1309
  if (a)
1312
- return /* @__PURE__ */ n(E, { message: "Loading results..." });
1313
- if (!s)
1314
- return /* @__PURE__ */ n(P, { message: "No results for this round." });
1315
- const o = (s.sessions || []).find((l) => l.type === "RACE"), d = (u = o == null ? void 0 : o.results) == null ? void 0 : u.filter((l) => l.position <= 3).sort((l, p) => l.position - p.position);
1316
- return /* @__PURE__ */ c("div", { className: `pvx-round-results ${r || ""}`, children: [
1317
- /* @__PURE__ */ c("div", { className: "pvx-round-results-header", children: [
1318
- /* @__PURE__ */ c("div", { children: [
1319
- /* @__PURE__ */ c("h4", { className: "pvx-round-results-title", children: [
1310
+ return /* @__PURE__ */ t(E, { message: "Loading results..." });
1311
+ if (!r)
1312
+ return /* @__PURE__ */ t(P, { message: "No results for this round." });
1313
+ const o = (r.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);
1314
+ return /* @__PURE__ */ l("div", { className: `pvx-round-results ${s || ""}`, children: [
1315
+ /* @__PURE__ */ l("div", { className: "pvx-round-results-header", children: [
1316
+ /* @__PURE__ */ l("div", { children: [
1317
+ /* @__PURE__ */ l("h4", { className: "pvx-round-results-title", children: [
1320
1318
  "Round ",
1321
- s.roundNumber,
1322
- s.track ? `: ${s.track}` : ""
1319
+ r.roundNumber,
1320
+ r.track ? `: ${r.track}` : ""
1323
1321
  ] }),
1324
- s.startTime && /* @__PURE__ */ n("p", { className: "pvx-round-results-date", children: new Date(s.startTime).toLocaleDateString("en-GB", {
1322
+ r.startTime && /* @__PURE__ */ t("p", { className: "pvx-round-results-date", children: new Date(r.startTime).toLocaleDateString("en-GB", {
1325
1323
  day: "numeric",
1326
1324
  month: "long",
1327
1325
  year: "numeric"
1328
1326
  }) })
1329
1327
  ] }),
1330
- (d == null ? void 0 : d.length) > 0 && /* @__PURE__ */ n("div", { className: "pvx-round-podium-summary", children: d.map((l) => /* @__PURE__ */ c("span", { className: "pvx-round-podium-item", children: [
1331
- /* @__PURE__ */ n("span", { children: se[l.position - 1] }),
1332
- /* @__PURE__ */ n("span", { children: l.driverName })
1333
- ] }, l.driverId)) })
1328
+ (d == null ? void 0 : d.length) > 0 && /* @__PURE__ */ t("div", { className: "pvx-round-podium-summary", children: d.map((c) => /* @__PURE__ */ l("span", { className: "pvx-round-podium-item", children: [
1329
+ /* @__PURE__ */ t("span", { children: ae[c.position - 1] }),
1330
+ /* @__PURE__ */ t("span", { children: c.driverName })
1331
+ ] }, c.driverId)) })
1334
1332
  ] }),
1335
- /* @__PURE__ */ n(Te, { round: s, competitionId: e })
1333
+ /* @__PURE__ */ t(le, { round: r, competitionId: e })
1336
1334
  ] });
1337
1335
  }
1338
- function Te({ round: e, competitionId: t, className: r }) {
1339
- var p, f, g, m;
1340
- const [s, a] = D(null), i = (e == null ? void 0 : e.sessions) || [];
1336
+ function le({ round: e, competitionId: n, className: s }) {
1337
+ var u, g, f, m;
1338
+ const [r, a] = D(null), i = (e == null ? void 0 : e.sessions) || [];
1341
1339
  if (!i.length)
1342
- return /* @__PURE__ */ n(P, { message: "No session data for this round." });
1343
- const { data: o } = We(
1344
- t,
1340
+ return /* @__PURE__ */ t(P, { message: "No session data for this round." });
1341
+ const { data: o } = ze(
1342
+ n,
1345
1343
  e == null ? void 0 : e.roundNumber,
1346
1344
  {}
1347
- ), d = s || ((p = i.find((b) => b.type === "RACE")) == null ? void 0 : p.type) || ((f = i[0]) == null ? void 0 : f.type), u = i.find((b) => b.type === d) || i[0], l = ((m = (g = o == null ? void 0 : o.sessions) == null ? void 0 : g.find((b) => b.type === d)) == null ? void 0 : m.drivers) || null;
1348
- return /* @__PURE__ */ c("div", { className: r || "", children: [
1349
- /* @__PURE__ */ n(
1350
- rn,
1345
+ ), d = r || ((u = i.find((b) => b.type === "RACE")) == null ? void 0 : u.type) || ((g = i[0]) == null ? void 0 : g.type), p = i.find((b) => b.type === d) || i[0], c = ((m = (f = o == null ? void 0 : o.sessions) == null ? void 0 : f.find((b) => b.type === d)) == null ? void 0 : m.drivers) || null;
1346
+ return /* @__PURE__ */ l("div", { className: s || "", children: [
1347
+ /* @__PURE__ */ t(
1348
+ st,
1351
1349
  {
1352
1350
  sessions: i,
1353
1351
  activeSession: d,
1354
1352
  onSelect: a
1355
1353
  }
1356
1354
  ),
1357
- /* @__PURE__ */ n(gn, { session: u, sessionLaps: l })
1355
+ /* @__PURE__ */ t(gt, { session: p, sessionLaps: c })
1358
1356
  ] });
1359
1357
  }
1360
- function gn({ session: e, sessionLaps: t }) {
1358
+ function gt({ session: e, sessionLaps: n }) {
1361
1359
  var d;
1362
- const r = e.type === "RACE", [s, a] = D(null);
1360
+ const s = e.type === "RACE", [r, a] = D(null);
1363
1361
  if (!((d = e.results) != null && d.length))
1364
- return /* @__PURE__ */ n(P, { message: `No results for ${e.type}.` });
1365
- const i = on(e.results), o = r ? 7 : 4;
1366
- return /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ c("table", { className: "pvx-table", children: [
1367
- /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ c("tr", { className: "pvx-thead-row", children: [
1368
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
1369
- /* @__PURE__ */ n("th", { className: "pvx-th", children: "Driver" }),
1370
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Car" }),
1371
- /* @__PURE__ */ n("th", { className: "pvx-th", children: "Best Lap" }),
1372
- r && /* @__PURE__ */ c(U, { children: [
1373
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Laps" }),
1374
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Time / Gap" }),
1375
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--center", children: "Points" })
1362
+ return /* @__PURE__ */ t(P, { message: `No results for ${e.type}.` });
1363
+ const i = ot(e.results), o = s ? 7 : 4;
1364
+ return /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
1365
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
1366
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
1367
+ /* @__PURE__ */ t("th", { className: "pvx-th", children: "Driver" }),
1368
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "Car" }),
1369
+ /* @__PURE__ */ t("th", { className: "pvx-th", children: "Best Lap" }),
1370
+ s && /* @__PURE__ */ l(U, { children: [
1371
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "Laps" }),
1372
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "Time / Gap" }),
1373
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--center", children: "Points" })
1376
1374
  ] })
1377
1375
  ] }) }),
1378
- /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: e.results.map((u, l) => {
1379
- var g;
1380
- const p = (g = t == null ? void 0 : t[u.driverId]) == null ? void 0 : g.laps, f = s === u.driverId && !!p;
1381
- return /* @__PURE__ */ n(
1382
- fn,
1376
+ /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: e.results.map((p, c) => {
1377
+ var f;
1378
+ const u = (f = n == null ? void 0 : n[p.driverId]) == null ? void 0 : f.laps, g = r === p.driverId && !!u;
1379
+ return /* @__PURE__ */ t(
1380
+ ft,
1383
1381
  {
1384
- result: u,
1385
- isRace: r,
1382
+ result: p,
1383
+ isRace: s,
1386
1384
  fastestSplits: i,
1387
- rowIndex: l,
1388
- hasLapDetail: !!p,
1389
- isExpanded: f,
1390
- onToggle: () => a(f ? null : u.driverId),
1391
- driverLaps: f ? p : null,
1385
+ rowIndex: c,
1386
+ hasLapDetail: !!u,
1387
+ isExpanded: g,
1388
+ onToggle: () => a(g ? null : p.driverId),
1389
+ driverLaps: g ? u : null,
1392
1390
  colCount: o
1393
1391
  },
1394
- u.driverId || l
1392
+ p.driverId || c
1395
1393
  );
1396
1394
  }) })
1397
1395
  ] }) });
1398
1396
  }
1399
- function fn({ result: e, isRace: t, fastestSplits: r, rowIndex: s, hasLapDetail: a, isExpanded: i, onToggle: o, driverLaps: d, colCount: u }) {
1400
- const l = e.position <= 3;
1401
- return /* @__PURE__ */ c(U, { children: [
1402
- /* @__PURE__ */ c(
1397
+ function ft({ result: e, isRace: n, fastestSplits: s, rowIndex: r, hasLapDetail: a, isExpanded: i, onToggle: o, driverLaps: d, colCount: p }) {
1398
+ const c = e.position <= 3;
1399
+ return /* @__PURE__ */ l(U, { children: [
1400
+ /* @__PURE__ */ l(
1403
1401
  "tr",
1404
1402
  {
1405
- className: `pvx-row ${l ? "pvx-row--podium" : ""} ${a ? "pvx-row--expandable" : ""}`,
1403
+ className: `pvx-row ${c ? "pvx-row--podium" : ""} ${a ? "pvx-row--expandable" : ""}`,
1406
1404
  onClick: a ? o : void 0,
1407
1405
  style: a ? { cursor: "pointer" } : void 0,
1408
1406
  children: [
1409
- /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(we, { position: e.position }) }),
1410
- /* @__PURE__ */ c("td", { className: "pvx-td pvx-td--primary", children: [
1411
- /* @__PURE__ */ n(ae, { nation: e.nation }),
1407
+ /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t(oe, { position: e.position }) }),
1408
+ /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
1409
+ /* @__PURE__ */ t(Q, { nation: e.nation }),
1412
1410
  e.driverName,
1413
- e.carNumber != null && /* @__PURE__ */ c("span", { className: "pvx-car-number", children: [
1411
+ e.carNumber != null && /* @__PURE__ */ l("span", { className: "pvx-car-number", children: [
1414
1412
  "#",
1415
1413
  e.carNumber
1416
1414
  ] }),
1417
- e.penalty && /* @__PURE__ */ n("span", { className: "pvx-penalty", children: e.penalty })
1415
+ e.penalty && /* @__PURE__ */ t("span", { className: "pvx-penalty", children: e.penalty })
1418
1416
  ] }),
1419
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: I(e.carId) }),
1420
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ n(
1421
- bn,
1417
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-hidden-below-sm", children: I(e.carId) }),
1418
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ t(
1419
+ bt,
1422
1420
  {
1423
1421
  bestLap: e.bestLapFormatted,
1424
1422
  hasBestLap: e.hasBestLap,
1425
1423
  splits: e.splits,
1426
- fastestSplits: r,
1427
- showAbove: s <= 1
1424
+ fastestSplits: s,
1425
+ showAbove: r <= 1
1428
1426
  }
1429
1427
  ) }),
1430
- t && /* @__PURE__ */ c(U, { children: [
1431
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: e.lapsCompleted }),
1432
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: e.position === 1 ? e.totalTime || "-" : e.gap || "-" }),
1433
- /* @__PURE__ */ c("td", { className: "pvx-td pvx-td--center", children: [
1434
- /* @__PURE__ */ n("span", { className: "pvx-session-points", children: e.points }),
1435
- e.pointsOverride !== 0 && e.pointsOverride && /* @__PURE__ */ c("span", { className: "pvx-points-override", children: [
1428
+ n && /* @__PURE__ */ l(U, { children: [
1429
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-hidden-below-sm", children: e.lapsCompleted }),
1430
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: e.position === 1 ? e.totalTime || "-" : e.gap || "-" }),
1431
+ /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--center", children: [
1432
+ /* @__PURE__ */ t("span", { className: "pvx-session-points", children: e.points }),
1433
+ e.pointsOverride !== 0 && e.pointsOverride && /* @__PURE__ */ l("span", { className: "pvx-points-override", children: [
1436
1434
  "(",
1437
1435
  e.pointsOverride > 0 ? "+" : "",
1438
1436
  e.pointsOverride,
@@ -1443,160 +1441,160 @@ function fn({ result: e, isRace: t, fastestSplits: r, rowIndex: s, hasLapDetail:
1443
1441
  ]
1444
1442
  }
1445
1443
  ),
1446
- i && d && /* @__PURE__ */ n("tr", { className: "pvx-row pvx-row--lap-detail", children: /* @__PURE__ */ n("td", { colSpan: u, className: "pvx-td pvx-td--lap-detail", children: /* @__PURE__ */ n(Nn, { laps: d }) }) })
1444
+ i && d && /* @__PURE__ */ t("tr", { className: "pvx-row pvx-row--lap-detail", children: /* @__PURE__ */ t("td", { colSpan: p, className: "pvx-td pvx-td--lap-detail", children: /* @__PURE__ */ t(Nt, { laps: d }) }) })
1447
1445
  ] });
1448
1446
  }
1449
- function Nn({ laps: e }) {
1450
- const t = Math.min(...e.filter((r) => r.valid && r.timeMs > 0).map((r) => r.timeMs));
1451
- return /* @__PURE__ */ c("table", { className: "pvx-table pvx-table--laps", children: [
1452
- /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ c("tr", { className: "pvx-thead-row", children: [
1453
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "Lap" }),
1454
- /* @__PURE__ */ n("th", { className: "pvx-th", children: "Time" }),
1455
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
1456
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
1457
- /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" })
1447
+ function Nt({ laps: e }) {
1448
+ const n = Math.min(...e.filter((s) => s.valid && s.timeMs > 0).map((s) => s.timeMs));
1449
+ return /* @__PURE__ */ l("table", { className: "pvx-table pvx-table--laps", children: [
1450
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
1451
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "Lap" }),
1452
+ /* @__PURE__ */ t("th", { className: "pvx-th", children: "Time" }),
1453
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
1454
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
1455
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" })
1458
1456
  ] }) }),
1459
- /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: e.map((r) => {
1457
+ /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: e.map((s) => {
1460
1458
  var a;
1461
- const s = r.valid && r.timeMs === t;
1462
- return /* @__PURE__ */ c("tr", { className: `pvx-row ${r.valid ? "" : "pvx-row--invalid"} ${s ? "pvx-row--fastest" : ""}`, children: [
1463
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted", children: r.lap }),
1464
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children: r.time }),
1465
- (r.splits || []).map((i, o) => /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: i }, o)),
1466
- 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}`))
1467
- ] }, r.lap);
1459
+ const r = s.valid && s.timeMs === n;
1460
+ return /* @__PURE__ */ l("tr", { className: `pvx-row ${s.valid ? "" : "pvx-row--invalid"} ${r ? "pvx-row--fastest" : ""}`, children: [
1461
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--muted", children: s.lap }),
1462
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--mono", children: s.time }),
1463
+ (s.splits || []).map((i, o) => /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: i }, o)),
1464
+ Array.from({ length: Math.max(0, 3 - (((a = s.splits) == null ? void 0 : a.length) || 0)) }).map((i, o) => /* @__PURE__ */ t("td", { className: "pvx-td pvx-hidden-below-sm" }, `pad-${o}`))
1465
+ ] }, s.lap);
1468
1466
  }) })
1469
1467
  ] });
1470
1468
  }
1471
- function bn({ bestLap: e, hasBestLap: t, splits: r, fastestSplits: s, showAbove: a }) {
1472
- return e ? /* @__PURE__ */ c("span", { className: `pvx-best-lap-cell ${t ? "pvx-best-lap-cell--fastest" : ""}`, children: [
1473
- /* @__PURE__ */ n("span", { className: "pvx-best-lap-time", children: e }),
1474
- (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) => {
1475
- const d = s && i === s[o];
1476
- return /* @__PURE__ */ c("span", { className: "pvx-splits-tooltip-row", children: [
1477
- /* @__PURE__ */ c("span", { className: "pvx-splits-tooltip-label", children: [
1469
+ function bt({ bestLap: e, hasBestLap: n, splits: s, fastestSplits: r, showAbove: a }) {
1470
+ return e ? /* @__PURE__ */ l("span", { className: `pvx-best-lap-cell ${n ? "pvx-best-lap-cell--fastest" : ""}`, children: [
1471
+ /* @__PURE__ */ t("span", { className: "pvx-best-lap-time", children: e }),
1472
+ (s == null ? void 0 : s.length) > 0 && /* @__PURE__ */ t("span", { className: "pvx-splits-tooltip-anchor", children: /* @__PURE__ */ t("span", { className: `pvx-splits-tooltip ${a ? "" : "pvx-splits-tooltip--above"}`, children: s.map((i, o) => {
1473
+ const d = r && i === r[o];
1474
+ return /* @__PURE__ */ l("span", { className: "pvx-splits-tooltip-row", children: [
1475
+ /* @__PURE__ */ l("span", { className: "pvx-splits-tooltip-label", children: [
1478
1476
  "S",
1479
1477
  o + 1
1480
1478
  ] }),
1481
- /* @__PURE__ */ n("span", { className: d ? "pvx-splits-tooltip-best" : "", children: i })
1479
+ /* @__PURE__ */ t("span", { className: d ? "pvx-splits-tooltip-best" : "", children: i })
1482
1480
  ] }, o);
1483
1481
  }) }) })
1484
- ] }) : /* @__PURE__ */ n("span", { className: "pvx-td--muted", children: "-" });
1482
+ ] }) : /* @__PURE__ */ t("span", { className: "pvx-td--muted", children: "-" });
1485
1483
  }
1486
- function vt({ competitionId: e, className: t }) {
1487
- const { getSteamId: r } = k(), { data: s, isLoading: a } = he(e), i = r();
1484
+ function xn({ competitionId: e, className: n }) {
1485
+ const { getSteamId: s } = k(), { data: r, isLoading: a } = fe(e), i = s();
1488
1486
  if (a)
1489
- return /* @__PURE__ */ n(E, { message: "Loading drivers..." });
1490
- const o = (s == null ? void 0 : s.drivers) || (s == null ? void 0 : s.entries) || [];
1491
- return o.length ? /* @__PURE__ */ n("div", { className: `pvx-entry-grid ${t || ""}`, children: o.map((d) => {
1492
- var l, p;
1493
- const u = i && d.steamId === i;
1494
- return /* @__PURE__ */ c("div", { className: `pvx-entry-card ${u ? "pvx-entry-card--you" : ""}`, children: [
1495
- d.avatarUrl ? /* @__PURE__ */ n(
1487
+ return /* @__PURE__ */ t(E, { message: "Loading drivers..." });
1488
+ const o = (r == null ? void 0 : r.drivers) || (r == null ? void 0 : r.entries) || [];
1489
+ return o.length ? /* @__PURE__ */ t("div", { className: `pvx-entry-grid ${n || ""}`, children: o.map((d) => {
1490
+ var c, u;
1491
+ const p = i && d.steamId === i;
1492
+ return /* @__PURE__ */ l("div", { className: `pvx-entry-card ${p ? "pvx-entry-card--you" : ""}`, children: [
1493
+ d.avatarUrl ? /* @__PURE__ */ t(
1496
1494
  "img",
1497
1495
  {
1498
1496
  src: d.avatarUrl,
1499
1497
  alt: "",
1500
1498
  className: "pvx-entry-avatar"
1501
1499
  }
1502
- ) : /* @__PURE__ */ n("div", { className: "pvx-entry-avatar pvx-entry-avatar--placeholder", children: ((p = (l = d.displayName) == null ? void 0 : l.charAt(0)) == null ? void 0 : p.toUpperCase()) || "?" }),
1503
- /* @__PURE__ */ c("span", { className: "pvx-entry-name", children: [
1500
+ ) : /* @__PURE__ */ t("div", { className: "pvx-entry-avatar pvx-entry-avatar--placeholder", children: ((u = (c = d.displayName) == null ? void 0 : c.charAt(0)) == null ? void 0 : u.toUpperCase()) || "?" }),
1501
+ /* @__PURE__ */ l("span", { className: "pvx-entry-name", children: [
1504
1502
  d.displayName,
1505
- u && /* @__PURE__ */ n("span", { className: "pvx-entry-you", children: " (you)" })
1503
+ p && /* @__PURE__ */ t("span", { className: "pvx-entry-you", children: " (you)" })
1506
1504
  ] })
1507
1505
  ] }, d.steamId || d.driverId);
1508
- }) }) : /* @__PURE__ */ n(P, { message: "No drivers registered yet." });
1506
+ }) }) : /* @__PURE__ */ t(P, { message: "No drivers registered yet." });
1509
1507
  }
1510
- function ht({
1508
+ function gn({
1511
1509
  competitionId: e,
1512
- driverData: t,
1513
- className: r,
1514
- children: s
1510
+ driverData: n,
1511
+ className: s,
1512
+ children: r
1515
1513
  }) {
1516
- const { data: a, isLoading: i } = X(e), { isPowerMode: o } = ee(), d = ne(e), u = xe(e), l = ge(e), p = (a == null ? void 0 : a.isRegistered) || !1, f = i || u.isPending || l.isPending, g = u.error || l.error || null, m = () => {
1517
- o && u.mutate(t || {});
1514
+ const { data: a, isLoading: i } = ee(e), { isPowerMode: o } = te(), d = ne(e), p = Ne(e), c = be(e), u = (a == null ? void 0 : a.isRegistered) || !1, g = i || p.isPending || c.isPending, f = p.error || c.error || null, m = () => {
1515
+ o && p.mutate(n || {});
1518
1516
  }, b = () => {
1519
- o && l.mutate();
1517
+ o && c.mutate();
1520
1518
  };
1521
- return typeof s == "function" ? s({ isRegistered: p, isLoading: f, register: m, withdraw: b, error: g, isPowerMode: o, registrationUrl: d }) : o ? /* @__PURE__ */ n(
1519
+ return typeof r == "function" ? r({ isRegistered: u, isLoading: g, register: m, withdraw: b, error: f, isPowerMode: o, registrationUrl: d }) : o ? /* @__PURE__ */ t(
1522
1520
  "button",
1523
1521
  {
1524
- className: `pvx-comp-register-btn ${r || ""}`,
1525
- onClick: p ? b : m,
1526
- disabled: f,
1527
- children: f ? "Loading..." : p ? "Withdraw" : "Register"
1522
+ className: `pvx-comp-register-btn ${s || ""}`,
1523
+ onClick: u ? b : m,
1524
+ disabled: g,
1525
+ children: g ? "Loading..." : u ? "Withdraw" : "Register"
1528
1526
  }
1529
- ) : /* @__PURE__ */ n(
1527
+ ) : /* @__PURE__ */ t(
1530
1528
  "a",
1531
1529
  {
1532
1530
  href: d,
1533
1531
  target: "_blank",
1534
1532
  rel: "noopener noreferrer",
1535
- className: `pvx-comp-register-link ${r || ""}`,
1536
- children: p ? "View Registration" : "Register on PitVox"
1533
+ className: `pvx-comp-register-link ${s || ""}`,
1534
+ children: u ? "View Registration" : "Register on PitVox"
1537
1535
  }
1538
1536
  );
1539
1537
  }
1540
- function xt({ competitionId: e, registration: t, onWithdrawSuccess: r, className: s }) {
1541
- const { getSteamId: a } = k(), { isPowerMode: i } = ee(), o = ne(e), { data: d, isLoading: u } = X(e), { data: l, isLoading: p } = he(e), f = xe(e), g = ge(e), m = a(), b = (d == null ? void 0 : d.isRegistered) || !1, x = (l == null ? void 0 : l.drivers) || (l == null ? void 0 : l.entries) || [], v = t || {}, N = x.length || v.currentCount || 0, h = v.maxParticipants && N >= v.maxParticipants, y = v.deadline && new Date(v.deadline) < /* @__PURE__ */ new Date(), C = v.isOpen && !y && !h;
1542
- return u || p ? /* @__PURE__ */ n(E, { message: "Loading registration..." }) : b ? /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: /* @__PURE__ */ n(
1543
- kn,
1538
+ function fn({ competitionId: e, registration: n, onWithdrawSuccess: s, className: r }) {
1539
+ const { getSteamId: a } = k(), { isPowerMode: i } = te(), o = ne(e), { data: d, isLoading: p } = ee(e), { data: c, isLoading: u } = fe(e), g = Ne(e), f = be(e), m = a(), b = (d == null ? void 0 : d.isRegistered) || !1, x = (c == null ? void 0 : c.drivers) || (c == null ? void 0 : c.entries) || [], v = n || {}, N = x.length || v.currentCount || 0, h = v.maxParticipants && N >= v.maxParticipants, w = v.deadline && new Date(v.deadline) < /* @__PURE__ */ new Date(), y = v.isOpen && !w && !h;
1540
+ return p || u ? /* @__PURE__ */ t(E, { message: "Loading registration..." }) : b ? /* @__PURE__ */ t("div", { className: `pvx-reg-panel ${r || ""}`, children: /* @__PURE__ */ t(
1541
+ wt,
1544
1542
  {
1545
1543
  competitionId: e,
1546
1544
  drivers: x,
1547
1545
  steamId: m,
1548
1546
  isPowerMode: i,
1549
1547
  registrationUrl: o,
1550
- withdrawMutation: g,
1551
- onWithdrawSuccess: r,
1548
+ withdrawMutation: f,
1549
+ onWithdrawSuccess: s,
1552
1550
  registration: v
1553
1551
  }
1554
- ) }) : C ? m ? i ? /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: /* @__PURE__ */ n(
1555
- yn,
1552
+ ) }) : y ? m ? i ? /* @__PURE__ */ t("div", { className: `pvx-reg-panel ${r || ""}`, children: /* @__PURE__ */ t(
1553
+ yt,
1556
1554
  {
1557
1555
  competitionId: e,
1558
- registerMutation: f,
1556
+ registerMutation: g,
1559
1557
  registration: v
1560
1558
  }
1561
- ) }) : /* @__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__ */ c("div", { className: `pvx-reg-panel ${s || ""}`, children: [
1562
- /* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children: h ? "Registration is full." : y ? "Registration deadline has passed." : "Registration is closed." }),
1563
- x.length > 0 && /* @__PURE__ */ n(Se, { drivers: x, steamId: m })
1559
+ ) }) : /* @__PURE__ */ t("div", { className: `pvx-reg-panel ${r || ""}`, children: /* @__PURE__ */ t("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) : /* @__PURE__ */ t("div", { className: `pvx-reg-panel ${r || ""}`, children: i ? /* @__PURE__ */ t("div", { className: "pvx-reg-status-msg", children: "Sign in to register for this competition." }) : /* @__PURE__ */ t("div", { className: "pvx-reg-status-msg", children: /* @__PURE__ */ t("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) }) : /* @__PURE__ */ l("div", { className: `pvx-reg-panel ${r || ""}`, children: [
1560
+ /* @__PURE__ */ t("div", { className: "pvx-reg-status-msg", children: h ? "Registration is full." : w ? "Registration deadline has passed." : "Registration is closed." }),
1561
+ x.length > 0 && /* @__PURE__ */ t(Re, { drivers: x, steamId: m })
1564
1562
  ] });
1565
1563
  }
1566
- function yn({ competitionId: e, registerMutation: t, registration: r }) {
1567
- const [s, a] = D(""), [i, o] = D("intermediate"), [d, u] = D(""), l = (m) => {
1568
- m.preventDefault(), t.mutate({
1569
- discordUsername: s || void 0,
1564
+ function yt({ competitionId: e, registerMutation: n, registration: s }) {
1565
+ const [r, a] = D(""), [i, o] = D("intermediate"), [d, p] = D(""), c = (m) => {
1566
+ m.preventDefault(), n.mutate({
1567
+ discordUsername: r || void 0,
1570
1568
  experience: i,
1571
1569
  comments: d || void 0
1572
1570
  });
1573
- }, p = r || {}, f = p.currentCount || 0, g = p.maxParticipants;
1574
- return /* @__PURE__ */ c("form", { className: "pvx-reg-form", onSubmit: l, children: [
1575
- /* @__PURE__ */ c("div", { className: "pvx-reg-form-header", children: [
1576
- /* @__PURE__ */ n("h3", { className: "pvx-reg-form-title", children: "Register" }),
1577
- g && /* @__PURE__ */ n(Re, { count: f, max: g })
1571
+ }, u = s || {}, g = u.currentCount || 0, f = u.maxParticipants;
1572
+ return /* @__PURE__ */ l("form", { className: "pvx-reg-form", onSubmit: c, children: [
1573
+ /* @__PURE__ */ l("div", { className: "pvx-reg-form-header", children: [
1574
+ /* @__PURE__ */ t("h3", { className: "pvx-reg-form-title", children: "Register" }),
1575
+ f && /* @__PURE__ */ t($e, { count: g, max: f })
1578
1576
  ] }),
1579
- t.error && /* @__PURE__ */ n("div", { className: "pvx-reg-error", children: t.error.message || "Registration failed" }),
1580
- /* @__PURE__ */ c("div", { className: "pvx-reg-field", children: [
1581
- /* @__PURE__ */ c("label", { className: "pvx-reg-label", htmlFor: `pvx-discord-${e}`, children: [
1577
+ n.error && /* @__PURE__ */ t("div", { className: "pvx-reg-error", children: n.error.message || "Registration failed" }),
1578
+ /* @__PURE__ */ l("div", { className: "pvx-reg-field", children: [
1579
+ /* @__PURE__ */ l("label", { className: "pvx-reg-label", htmlFor: `pvx-discord-${e}`, children: [
1582
1580
  "Discord Username ",
1583
- /* @__PURE__ */ n("span", { className: "pvx-reg-optional", children: "(optional)" })
1581
+ /* @__PURE__ */ t("span", { className: "pvx-reg-optional", children: "(optional)" })
1584
1582
  ] }),
1585
- /* @__PURE__ */ n(
1583
+ /* @__PURE__ */ t(
1586
1584
  "input",
1587
1585
  {
1588
1586
  id: `pvx-discord-${e}`,
1589
1587
  type: "text",
1590
1588
  className: "pvx-reg-input",
1591
1589
  placeholder: "e.g. username",
1592
- value: s,
1590
+ value: r,
1593
1591
  onChange: (m) => a(m.target.value)
1594
1592
  }
1595
1593
  )
1596
1594
  ] }),
1597
- /* @__PURE__ */ c("div", { className: "pvx-reg-field", children: [
1598
- /* @__PURE__ */ n("label", { className: "pvx-reg-label", htmlFor: `pvx-exp-${e}`, children: "Experience Level" }),
1599
- /* @__PURE__ */ c(
1595
+ /* @__PURE__ */ l("div", { className: "pvx-reg-field", children: [
1596
+ /* @__PURE__ */ t("label", { className: "pvx-reg-label", htmlFor: `pvx-exp-${e}`, children: "Experience Level" }),
1597
+ /* @__PURE__ */ l(
1600
1598
  "select",
1601
1599
  {
1602
1600
  id: `pvx-exp-${e}`,
@@ -1604,19 +1602,19 @@ function yn({ competitionId: e, registerMutation: t, registration: r }) {
1604
1602
  value: i,
1605
1603
  onChange: (m) => o(m.target.value),
1606
1604
  children: [
1607
- /* @__PURE__ */ n("option", { value: "beginner", children: "Beginner" }),
1608
- /* @__PURE__ */ n("option", { value: "intermediate", children: "Intermediate" }),
1609
- /* @__PURE__ */ n("option", { value: "advanced", children: "Advanced" })
1605
+ /* @__PURE__ */ t("option", { value: "beginner", children: "Beginner" }),
1606
+ /* @__PURE__ */ t("option", { value: "intermediate", children: "Intermediate" }),
1607
+ /* @__PURE__ */ t("option", { value: "advanced", children: "Advanced" })
1610
1608
  ]
1611
1609
  }
1612
1610
  )
1613
1611
  ] }),
1614
- /* @__PURE__ */ c("div", { className: "pvx-reg-field", children: [
1615
- /* @__PURE__ */ c("label", { className: "pvx-reg-label", htmlFor: `pvx-comments-${e}`, children: [
1612
+ /* @__PURE__ */ l("div", { className: "pvx-reg-field", children: [
1613
+ /* @__PURE__ */ l("label", { className: "pvx-reg-label", htmlFor: `pvx-comments-${e}`, children: [
1616
1614
  "Comments ",
1617
- /* @__PURE__ */ n("span", { className: "pvx-reg-optional", children: "(optional)" })
1615
+ /* @__PURE__ */ t("span", { className: "pvx-reg-optional", children: "(optional)" })
1618
1616
  ] }),
1619
- /* @__PURE__ */ n(
1617
+ /* @__PURE__ */ t(
1620
1618
  "textarea",
1621
1619
  {
1622
1620
  id: `pvx-comments-${e}`,
@@ -1624,265 +1622,328 @@ function yn({ competitionId: e, registerMutation: t, registration: r }) {
1624
1622
  rows: 3,
1625
1623
  placeholder: "Anything the organisers should know?",
1626
1624
  value: d,
1627
- onChange: (m) => u(m.target.value)
1625
+ onChange: (m) => p(m.target.value)
1628
1626
  }
1629
1627
  )
1630
1628
  ] }),
1631
- /* @__PURE__ */ n("div", { className: "pvx-reg-actions", children: /* @__PURE__ */ n(
1629
+ /* @__PURE__ */ t("div", { className: "pvx-reg-actions", children: /* @__PURE__ */ t(
1632
1630
  "button",
1633
1631
  {
1634
1632
  type: "submit",
1635
1633
  className: "pvx-comp-register-btn",
1636
- disabled: t.isPending,
1637
- children: t.isPending ? "Registering..." : "Register"
1634
+ disabled: n.isPending,
1635
+ children: n.isPending ? "Registering..." : "Register"
1638
1636
  }
1639
1637
  ) })
1640
1638
  ] });
1641
1639
  }
1642
- function kn({ competitionId: e, drivers: t, steamId: r, isPowerMode: s, registrationUrl: a, withdrawMutation: i, onWithdrawSuccess: o, registration: d }) {
1643
- const [u, l] = D(!1), p = () => {
1640
+ function wt({ competitionId: e, drivers: n, steamId: s, isPowerMode: r, registrationUrl: a, withdrawMutation: i, onWithdrawSuccess: o, registration: d }) {
1641
+ const [p, c] = D(!1), u = () => {
1644
1642
  i.mutate(void 0, {
1645
1643
  onSuccess: () => {
1646
- l(!1), o && o();
1644
+ c(!1), o && o();
1647
1645
  }
1648
1646
  });
1649
- }, f = d || {}, g = t.length || f.currentCount || 0, m = f.maxParticipants;
1650
- return /* @__PURE__ */ c(U, { children: [
1651
- /* @__PURE__ */ c("div", { className: "pvx-reg-form-header", children: [
1652
- /* @__PURE__ */ n("h3", { className: "pvx-reg-form-title", children: "Registered Drivers" }),
1653
- m && /* @__PURE__ */ n(Re, { count: g, max: m })
1647
+ }, g = d || {}, f = n.length || g.currentCount || 0, m = g.maxParticipants;
1648
+ return /* @__PURE__ */ l(U, { children: [
1649
+ /* @__PURE__ */ l("div", { className: "pvx-reg-form-header", children: [
1650
+ /* @__PURE__ */ t("h3", { className: "pvx-reg-form-title", children: "Registered Drivers" }),
1651
+ m && /* @__PURE__ */ t($e, { count: f, max: m })
1654
1652
  ] }),
1655
- /* @__PURE__ */ n(Se, { drivers: t, steamId: r }),
1656
- i.error && /* @__PURE__ */ n("div", { className: "pvx-reg-error", children: i.error.message || "Withdrawal failed" }),
1657
- s ? /* @__PURE__ */ n("div", { className: "pvx-reg-actions", children: u ? /* @__PURE__ */ c("div", { className: "pvx-reg-confirm", children: [
1658
- /* @__PURE__ */ n("p", { className: "pvx-reg-confirm-text", children: "Are you sure you want to unregister?" }),
1659
- /* @__PURE__ */ c("div", { className: "pvx-reg-confirm-actions", children: [
1660
- /* @__PURE__ */ n(
1653
+ /* @__PURE__ */ t(Re, { drivers: n, steamId: s }),
1654
+ i.error && /* @__PURE__ */ t("div", { className: "pvx-reg-error", children: i.error.message || "Withdrawal failed" }),
1655
+ r ? /* @__PURE__ */ t("div", { className: "pvx-reg-actions", children: p ? /* @__PURE__ */ l("div", { className: "pvx-reg-confirm", children: [
1656
+ /* @__PURE__ */ t("p", { className: "pvx-reg-confirm-text", children: "Are you sure you want to unregister?" }),
1657
+ /* @__PURE__ */ l("div", { className: "pvx-reg-confirm-actions", children: [
1658
+ /* @__PURE__ */ t(
1661
1659
  "button",
1662
1660
  {
1663
1661
  type: "button",
1664
1662
  className: "pvx-reg-cancel-btn",
1665
- onClick: () => l(!1),
1663
+ onClick: () => c(!1),
1666
1664
  children: "Cancel"
1667
1665
  }
1668
1666
  ),
1669
- /* @__PURE__ */ n(
1667
+ /* @__PURE__ */ t(
1670
1668
  "button",
1671
1669
  {
1672
1670
  type: "button",
1673
1671
  className: "pvx-reg-danger-btn",
1674
- onClick: p,
1672
+ onClick: u,
1675
1673
  disabled: i.isPending,
1676
1674
  children: i.isPending ? "Unregistering..." : "Yes, Unregister"
1677
1675
  }
1678
1676
  )
1679
1677
  ] })
1680
- ] }) : /* @__PURE__ */ n(
1678
+ ] }) : /* @__PURE__ */ t(
1681
1679
  "button",
1682
1680
  {
1683
1681
  type: "button",
1684
1682
  className: "pvx-reg-unregister-btn",
1685
- onClick: () => l(!0),
1683
+ onClick: () => c(!0),
1686
1684
  children: "Unregister"
1687
1685
  }
1688
- ) }) : /* @__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" }) })
1686
+ ) }) : /* @__PURE__ */ t("div", { className: "pvx-reg-actions", children: /* @__PURE__ */ t("a", { href: a, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Manage on PitVox" }) })
1689
1687
  ] });
1690
1688
  }
1691
- function Se({ drivers: e, steamId: t }) {
1689
+ function Re({ drivers: e, steamId: n }) {
1692
1690
  if (!e.length)
1693
- return /* @__PURE__ */ n("div", { className: "pvx-reg-no-drivers", children: "No drivers registered yet." });
1694
- const r = [...e].sort((s, a) => {
1695
- const i = t && s.steamId === t ? -1 : 0, o = t && a.steamId === t ? -1 : 0;
1691
+ return /* @__PURE__ */ t("div", { className: "pvx-reg-no-drivers", children: "No drivers registered yet." });
1692
+ const s = [...e].sort((r, a) => {
1693
+ const i = n && r.steamId === n ? -1 : 0, o = n && a.steamId === n ? -1 : 0;
1696
1694
  return i - o;
1697
1695
  });
1698
- return /* @__PURE__ */ n("div", { className: "pvx-reg-driver-list", children: r.map((s) => {
1696
+ return /* @__PURE__ */ t("div", { className: "pvx-reg-driver-list", children: s.map((r) => {
1699
1697
  var i, o;
1700
- const a = t && s.steamId === t;
1701
- return /* @__PURE__ */ c(
1698
+ const a = n && r.steamId === n;
1699
+ return /* @__PURE__ */ l(
1702
1700
  "div",
1703
1701
  {
1704
1702
  className: `pvx-reg-driver-row ${a ? "pvx-reg-driver-row--you" : ""}`,
1705
1703
  children: [
1706
- 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()) || "?" }),
1707
- /* @__PURE__ */ c("span", { className: "pvx-reg-driver-name", children: [
1708
- s.displayName,
1709
- a && /* @__PURE__ */ n("span", { className: "pvx-entry-you", children: " (you)" })
1704
+ r.avatarUrl ? /* @__PURE__ */ t("img", { src: r.avatarUrl, alt: "", className: "pvx-reg-driver-avatar" }) : /* @__PURE__ */ t("div", { className: "pvx-reg-driver-avatar pvx-reg-driver-avatar--placeholder", children: ((o = (i = r.displayName) == null ? void 0 : i.charAt(0)) == null ? void 0 : o.toUpperCase()) || "?" }),
1705
+ /* @__PURE__ */ l("span", { className: "pvx-reg-driver-name", children: [
1706
+ r.displayName,
1707
+ a && /* @__PURE__ */ t("span", { className: "pvx-entry-you", children: " (you)" })
1710
1708
  ] })
1711
1709
  ]
1712
1710
  },
1713
- s.steamId || s.driverId
1711
+ r.steamId || r.driverId
1714
1712
  );
1715
1713
  }) });
1716
1714
  }
1717
- function Re({ count: e, max: t }) {
1718
- const r = t ? e / t * 100 : 0, s = r >= 100 ? "full" : r >= 75 ? "warning" : "ok";
1719
- return /* @__PURE__ */ c("span", { className: `pvx-reg-capacity pvx-reg-capacity--${s}`, children: [
1715
+ function $e({ count: e, max: n }) {
1716
+ const s = n ? e / n * 100 : 0, r = s >= 100 ? "full" : s >= 75 ? "warning" : "ok";
1717
+ return /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${r}`, children: [
1720
1718
  e,
1721
1719
  "/",
1722
- t,
1720
+ n,
1723
1721
  " drivers"
1724
1722
  ] });
1725
1723
  }
1726
- function gt({ competitionId: e, className: t }) {
1727
- const { data: r, isLoading: s } = me(e), a = (r == null ? void 0 : r.type) === "championship", i = L(
1724
+ function Nn({ competitionId: e, className: n }) {
1725
+ const { data: s, isLoading: r } = xe(e), a = (s == null ? void 0 : s.type) === "championship", i = (s == null ? void 0 : s.type) === "hotlap", { data: o } = Ge(i ? e : null), d = L(
1728
1726
  () => {
1729
- var v;
1730
- return ((v = r == null ? void 0 : r.rounds) == null ? void 0 : v.filter((N) => N.isFinalized)) || [];
1727
+ var y;
1728
+ return ((y = s == null ? void 0 : s.rounds) == null ? void 0 : y.filter((C) => C.isFinalized)) || [];
1731
1729
  },
1732
- [r]
1733
- ), o = L(
1734
- () => i.map((v) => v.roundNumber),
1735
- [i]
1736
- ), { data: d = [], isLoading: u } = Oe(
1730
+ [s]
1731
+ ), p = L(
1732
+ () => d.map((y) => y.roundNumber),
1733
+ [d]
1734
+ ), { data: c = [], isLoading: u } = We(
1737
1735
  e,
1738
- o
1739
- ), l = a ? "standings" : o.length > 0 ? `round-${o[o.length - 1]}` : null, [p, f] = D(null), g = p || l;
1740
- if (s || u)
1741
- return /* @__PURE__ */ n(E, { message: "Loading results..." });
1742
- if (!r)
1743
- return /* @__PURE__ */ n(P, { message: "Competition not found." });
1744
- if (!i.length)
1745
- return /* @__PURE__ */ n(P, { message: "No results available yet. Results will appear here once rounds are finalised." });
1746
- const m = new Map(d.map((v) => [`round-${v.roundNumber}`, v])), b = [];
1747
- a && b.push({ id: "standings", label: "Standings" });
1748
- for (const v of i)
1749
- b.push({
1750
- id: `round-${v.roundNumber}`,
1751
- label: `R${v.roundNumber}`,
1752
- track: null
1753
- });
1754
- const x = m.get(g);
1755
- return /* @__PURE__ */ c("div", { className: t || "", children: [
1756
- /* @__PURE__ */ n("div", { className: "pvx-results-tabs", children: b.map((v) => /* @__PURE__ */ c(
1736
+ p
1737
+ ), g = i && c.length > 0 ? c[0] : null, f = (g == null ? void 0 : g.sessions) || [], m = i ? "leaderboard" : a ? "standings" : p.length > 0 ? `round-${p[p.length - 1]}` : null, [b, x] = D(null), v = b || m;
1738
+ if (r || u)
1739
+ return /* @__PURE__ */ t(E, { message: "Loading results..." });
1740
+ if (!s)
1741
+ return /* @__PURE__ */ t(P, { message: "Competition not found." });
1742
+ if (!d.length)
1743
+ return /* @__PURE__ */ t(P, { message: "No results available yet. Results will appear here once rounds are finalised." });
1744
+ const N = new Map(c.map((y) => [`round-${y.roundNumber}`, y])), h = [];
1745
+ if (a && h.push({ id: "standings", label: "Standings" }), i) {
1746
+ h.push({ id: "leaderboard", label: "Leaderboard" });
1747
+ for (const y of f)
1748
+ h.push({ id: `session-${y.type}`, label: ie(y.type) });
1749
+ } else
1750
+ for (const y of d)
1751
+ h.push({
1752
+ id: `round-${y.roundNumber}`,
1753
+ label: `R${y.roundNumber}`,
1754
+ track: null
1755
+ });
1756
+ const w = N.get(v);
1757
+ return /* @__PURE__ */ l("div", { className: n || "", children: [
1758
+ /* @__PURE__ */ t("div", { className: "pvx-results-tabs", children: h.map((y) => /* @__PURE__ */ l(
1757
1759
  "button",
1758
1760
  {
1759
- className: `pvx-results-tab ${g === v.id ? "pvx-results-tab--active" : ""}`,
1760
- onClick: () => f(v.id),
1761
- title: v.track || void 0,
1761
+ className: `pvx-results-tab ${v === y.id ? "pvx-results-tab--active" : ""}`,
1762
+ onClick: () => x(y.id),
1763
+ title: y.track || void 0,
1762
1764
  children: [
1763
- /* @__PURE__ */ n("span", { className: "pvx-results-tab-label", children: v.label }),
1764
- v.track && /* @__PURE__ */ n("span", { className: "pvx-results-tab-track", children: v.track })
1765
+ /* @__PURE__ */ t("span", { className: "pvx-results-tab-label", children: y.label }),
1766
+ y.track && /* @__PURE__ */ t("span", { className: "pvx-results-tab-track", children: y.track })
1765
1767
  ]
1766
1768
  },
1767
- v.id
1769
+ y.id
1768
1770
  )) }),
1769
- g === "standings" ? /* @__PURE__ */ n(hn, { competitionId: e }) : x ? /* @__PURE__ */ n(wn, { round: x }) : /* @__PURE__ */ n(P, { message: "No results for this round." })
1771
+ v === "standings" ? /* @__PURE__ */ t(vt, { competitionId: e }) : v === "leaderboard" ? /* @__PURE__ */ t(Ct, { leaderboard: o, config: s }) : v != null && v.startsWith("session-") ? /* @__PURE__ */ t(
1772
+ Lt,
1773
+ {
1774
+ session: f.find((y) => `session-${y.type}` === v),
1775
+ round: g,
1776
+ competitionId: e
1777
+ }
1778
+ ) : w ? /* @__PURE__ */ t(kt, { round: w, competitionId: e }) : /* @__PURE__ */ t(P, { message: "No results for this round." })
1770
1779
  ] });
1771
1780
  }
1772
- function wn({ round: e }) {
1773
- var a;
1774
- const r = (e.sessions || []).find((i) => i.type === "RACE"), s = (a = r == null ? void 0 : r.results) == null ? void 0 : a.filter((i) => i.position <= 3).sort((i, o) => i.position - o.position);
1775
- return /* @__PURE__ */ c("div", { className: "pvx-card", children: [
1776
- /* @__PURE__ */ c("div", { className: "pvx-card-header--split", children: [
1777
- /* @__PURE__ */ c("div", { children: [
1778
- /* @__PURE__ */ c("h4", { className: "pvx-card-title", children: [
1781
+ function kt({ round: e, competitionId: n }) {
1782
+ var i;
1783
+ const r = (e.sessions || []).find((o) => o.type === "RACE"), a = (i = r == null ? void 0 : r.results) == null ? void 0 : i.filter((o) => o.position <= 3).sort((o, d) => o.position - d.position);
1784
+ return /* @__PURE__ */ l("div", { className: "pvx-card", children: [
1785
+ /* @__PURE__ */ l("div", { className: "pvx-card-header--split", children: [
1786
+ /* @__PURE__ */ l("div", { children: [
1787
+ /* @__PURE__ */ l("h4", { className: "pvx-card-title", children: [
1779
1788
  "Round ",
1780
1789
  e.roundNumber,
1781
1790
  e.track ? `: ${e.track}` : ""
1782
1791
  ] }),
1783
- e.startTime && /* @__PURE__ */ n("span", { className: "pvx-standings-subtitle", children: new Date(e.startTime).toLocaleDateString("en-GB", {
1792
+ e.startTime && /* @__PURE__ */ t("span", { className: "pvx-standings-subtitle", children: new Date(e.startTime).toLocaleDateString("en-GB", {
1784
1793
  day: "numeric",
1785
1794
  month: "long",
1786
1795
  year: "numeric"
1787
1796
  }) })
1788
1797
  ] }),
1789
- (s == null ? void 0 : s.length) > 0 && /* @__PURE__ */ n("div", { className: "pvx-round-podium-summary", children: s.map((i) => /* @__PURE__ */ c("span", { className: "pvx-round-podium-item", children: [
1790
- /* @__PURE__ */ n("span", { children: se[i.position - 1] }),
1791
- /* @__PURE__ */ n("span", { children: i.driverName })
1792
- ] }, i.driverId)) })
1798
+ (a == null ? void 0 : a.length) > 0 && /* @__PURE__ */ t("div", { className: "pvx-round-podium-summary", children: a.map((o) => /* @__PURE__ */ l("span", { className: "pvx-round-podium-item", children: [
1799
+ /* @__PURE__ */ t("span", { children: ae[o.position - 1] }),
1800
+ /* @__PURE__ */ t("span", { children: o.driverName })
1801
+ ] }, o.driverId)) })
1793
1802
  ] }),
1794
- /* @__PURE__ */ n(Te, { round: e })
1803
+ /* @__PURE__ */ t(le, { round: e, competitionId: n })
1795
1804
  ] });
1796
1805
  }
1797
- function Cn(e) {
1798
- const { cdnUrl: t } = k(), r = S({
1806
+ function Ct({ leaderboard: e, config: n }) {
1807
+ var s;
1808
+ return (s = e == null ? void 0 : e.drivers) != null && s.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
1809
+ /* @__PURE__ */ t("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ l("div", { children: [
1810
+ /* @__PURE__ */ t("h4", { className: "pvx-card-title", children: e.track || (n == null ? void 0 : n.name) || "Hotlap Leaderboard" }),
1811
+ /* @__PURE__ */ l("span", { className: "pvx-standings-subtitle", children: [
1812
+ e.sessionsCompleted,
1813
+ " session",
1814
+ e.sessionsCompleted !== 1 ? "s" : "",
1815
+ " completed"
1816
+ ] })
1817
+ ] }) }),
1818
+ /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
1819
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
1820
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
1821
+ /* @__PURE__ */ t("th", { className: "pvx-th", children: "Driver" }),
1822
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "Car" }),
1823
+ /* @__PURE__ */ t("th", { className: "pvx-th", children: "Best Lap" }),
1824
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "Laps" }),
1825
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "Sessions" }),
1826
+ /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "Gap" })
1827
+ ] }) }),
1828
+ /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: e.drivers.map((r) => {
1829
+ const a = r.position === 1 ? "" : `+${((r.bestLapMs - e.drivers[0].bestLapMs) / 1e3).toFixed(3)}`;
1830
+ return /* @__PURE__ */ l("tr", { className: `pvx-row ${r.position <= 3 ? "pvx-row--podium" : ""}`, children: [
1831
+ /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t(oe, { position: r.position }) }),
1832
+ /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
1833
+ /* @__PURE__ */ t(Q, { nation: r.nation }),
1834
+ r.driverName
1835
+ ] }),
1836
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-hidden-below-sm", children: I(r.carId) }),
1837
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ t("span", { className: r.position === 1 ? "pvx-best-lap-cell--fastest" : "", children: r.bestLapFormatted }) }),
1838
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-hidden-below-sm", children: r.totalLaps }),
1839
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-hidden-below-sm", children: r.sessionsParticipated }),
1840
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: a })
1841
+ ] }, r.driverId);
1842
+ }) })
1843
+ ] }) })
1844
+ ] }) : /* @__PURE__ */ t(P, { message: "No lap times recorded yet." });
1845
+ }
1846
+ function Lt({ session: e, round: n, competitionId: s }) {
1847
+ return e ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
1848
+ /* @__PURE__ */ t("div", { className: "pvx-card-header", children: /* @__PURE__ */ t("h4", { className: "pvx-card-title", children: ie(e.type) }) }),
1849
+ /* @__PURE__ */ t(
1850
+ le,
1851
+ {
1852
+ round: { ...n, sessions: [e] },
1853
+ competitionId: s
1854
+ }
1855
+ )
1856
+ ] }) : /* @__PURE__ */ t(P, { message: "Session data not available." });
1857
+ }
1858
+ function Tt(e) {
1859
+ const { cdnUrl: n } = k(), s = S({
1799
1860
  queryKey: ["pitvox", "laps", "global", e, "index"],
1800
- queryFn: () => R(t, _e(null, e)),
1861
+ queryFn: () => R(n, qe(null, e)),
1801
1862
  enabled: !!e,
1802
1863
  staleTime: 3e4,
1803
1864
  refetchInterval: 3e4
1804
- }), s = r.data;
1865
+ }), r = s.data;
1805
1866
  return {
1806
- isLoading: r.isLoading,
1807
- error: r.error,
1808
- data: s ? {
1809
- driverName: s.driverName || "Driver",
1810
- lapCount: s.lapCount || 0,
1811
- trackBreakdown: s.trackBreakdown || [],
1812
- carBreakdown: s.carBreakdown || [],
1813
- recordsHeld: s.recordsHeld || 0,
1814
- currentRecords: s.currentRecords || [],
1815
- bestRanking: s.bestRanking ?? null,
1816
- bestRankingTrackId: s.bestRankingTrackId ?? null,
1817
- bestRankingLayout: s.bestRankingLayout ?? null,
1818
- bestRankingCarId: s.bestRankingCarId ?? null,
1819
- generatedAt: s.generatedAt
1867
+ isLoading: s.isLoading,
1868
+ error: s.error,
1869
+ data: r ? {
1870
+ driverName: r.driverName || "Driver",
1871
+ lapCount: r.lapCount || 0,
1872
+ trackBreakdown: r.trackBreakdown || [],
1873
+ carBreakdown: r.carBreakdown || [],
1874
+ recordsHeld: r.recordsHeld || 0,
1875
+ currentRecords: r.currentRecords || [],
1876
+ bestRanking: r.bestRanking ?? null,
1877
+ bestRankingTrackId: r.bestRankingTrackId ?? null,
1878
+ bestRankingLayout: r.bestRankingLayout ?? null,
1879
+ bestRankingCarId: r.bestRankingCarId ?? null,
1880
+ generatedAt: r.generatedAt
1820
1881
  } : null
1821
1882
  };
1822
1883
  }
1823
- function $e(e = {}) {
1824
- const { cdnUrl: t, partnerSlug: r } = k(), { game: s, gameVersion: a, enabled: i = !0 } = e, o = Z(r, s, a, "ratings.json");
1884
+ function Me(e = {}) {
1885
+ const { cdnUrl: n, partnerSlug: s } = k(), { game: r, gameVersion: a, enabled: i = !0 } = e, o = X(s, r, a, "ratings.json");
1825
1886
  return S({
1826
- queryKey: ["pitvox", "ratings", r, s || null, a || null],
1827
- queryFn: () => R(t, o),
1887
+ queryKey: ["pitvox", "ratings", s, r || null, a || null],
1888
+ queryFn: () => R(n, o),
1828
1889
  staleTime: 3e4,
1829
1890
  refetchInterval: 3e4,
1830
1891
  enabled: i
1831
1892
  });
1832
1893
  }
1833
- function Ln(e) {
1834
- var s;
1835
- const t = $e(), r = L(() => {
1894
+ function St(e) {
1895
+ var r;
1896
+ const n = Me(), s = L(() => {
1836
1897
  var a;
1837
- return !((a = t.data) != null && a.drivers) || !e ? null : t.data.drivers.find(
1898
+ return !((a = n.data) != null && a.drivers) || !e ? null : n.data.drivers.find(
1838
1899
  (i) => i.identifier === e
1839
1900
  ) || null;
1840
- }, [(s = t.data) == null ? void 0 : s.drivers, e]);
1901
+ }, [(r = n.data) == null ? void 0 : r.drivers, e]);
1841
1902
  return {
1842
- isLoading: t.isLoading,
1843
- error: t.error,
1844
- data: r ? {
1845
- rating: r.rating,
1846
- rank: r.rank,
1847
- totalDrivers: t.data.driverCount || t.data.drivers.length,
1848
- comboCount: r.comboCount || 0,
1849
- distinctCars: r.distinctCars || 0,
1850
- combos: r.combos || []
1903
+ isLoading: n.isLoading,
1904
+ error: n.error,
1905
+ data: s ? {
1906
+ rating: s.rating,
1907
+ rank: s.rank,
1908
+ totalDrivers: n.data.driverCount || n.data.drivers.length,
1909
+ comboCount: s.comboCount || 0,
1910
+ distinctCars: s.distinctCars || 0,
1911
+ combos: s.combos || []
1851
1912
  } : null
1852
1913
  };
1853
1914
  }
1854
- function ft(e = {}) {
1855
- const t = $e(e);
1915
+ function bn(e = {}) {
1916
+ const n = Me(e);
1856
1917
  return {
1857
- data: t.data || null,
1858
- isLoading: t.isLoading,
1859
- error: t.error
1918
+ data: n.data || null,
1919
+ isLoading: n.isLoading,
1920
+ error: n.error
1860
1921
  };
1861
1922
  }
1862
- function Tn() {
1863
- const { cdnUrl: e, partnerSlug: t, getSteamId: r, onFetchServerPassword: s } = k(), a = r(), { data: i, isLoading: o } = S({
1864
- queryKey: ["pitvox", "competitions", t],
1923
+ function Rt() {
1924
+ const { cdnUrl: e, partnerSlug: n, getSteamId: s, onFetchServerPassword: r } = k(), a = s(), { data: i, isLoading: o } = S({
1925
+ queryKey: ["pitvox", "competitions", n],
1865
1926
  queryFn: async () => {
1866
1927
  const m = await R(e, "competitions/index.json");
1867
- return m != null && m.competitions ? m.competitions.filter((b) => b.partnerSlug === t) : [];
1928
+ return m != null && m.competitions ? m.competitions.filter((b) => b.partnerSlug === n) : [];
1868
1929
  },
1869
1930
  staleTime: 6e4
1870
- }), d = (i == null ? void 0 : i.map((m) => m.id)) || [], u = ie({
1931
+ }), d = (i == null ? void 0 : i.map((m) => m.id)) || [], p = ce({
1871
1932
  queries: d.map((m) => ({
1872
- queryKey: ["pitvox", "competition", t, m, "entrylist"],
1873
- queryFn: () => R(e, `competitions/${t}/${m}/entrylist.json`),
1933
+ queryKey: ["pitvox", "competition", n, m, "entrylist"],
1934
+ queryFn: () => R(e, `competitions/${n}/${m}/entrylist.json`),
1874
1935
  enabled: !!a && d.length > 0,
1875
1936
  staleTime: 6e4
1876
1937
  }))
1877
- }), l = u.some((m) => m.isLoading), p = L(() => {
1938
+ }), c = p.some((m) => m.isLoading), u = L(() => {
1878
1939
  var x, v;
1879
- if (!i || !a || l) return [];
1940
+ if (!i || !a || c) return [];
1880
1941
  const m = /* @__PURE__ */ new Date(), b = [];
1881
1942
  for (let N = 0; N < i.length; N++) {
1882
- const h = i[N], y = (x = u[N]) == null ? void 0 : x.data;
1883
- if (!((v = y == null ? void 0 : y.drivers) == null ? void 0 : v.some((T) => T.steamId === a))) continue;
1884
- const w = h.rounds || [];
1885
- for (const T of w)
1943
+ const h = i[N], w = (x = p[N]) == null ? void 0 : x.data;
1944
+ if (!((v = w == null ? void 0 : w.drivers) == null ? void 0 : v.some((T) => T.steamId === a))) continue;
1945
+ const C = h.rounds || [];
1946
+ for (const T of C)
1886
1947
  T.isFinalized || !T.startTime || new Date(T.startTime) <= m || b.push({
1887
1948
  competitionId: h.id,
1888
1949
  competitionName: h.name,
@@ -1892,65 +1953,65 @@ function Tn() {
1892
1953
  });
1893
1954
  }
1894
1955
  return b.sort((N, h) => new Date(N.startTime) - new Date(h.startTime)), b.length > 0 && (b[0].isNext = !0), b;
1895
- }, [i, a, l, u]), f = ie({
1896
- queries: p.map((m) => ({
1956
+ }, [i, a, c, p]), g = ce({
1957
+ queries: u.map((m) => ({
1897
1958
  queryKey: ["pitvox", "serverInfo", m.competitionId, m.roundNumber],
1898
- queryFn: () => s(m.competitionId, m.roundNumber),
1899
- enabled: !!s && p.length > 0,
1959
+ queryFn: () => r(m.competitionId, m.roundNumber),
1960
+ enabled: !!r && u.length > 0,
1900
1961
  staleTime: 5 * 6e4,
1901
1962
  // 5 minutes
1902
1963
  retry: !1
1903
1964
  }))
1904
1965
  });
1905
1966
  return {
1906
- data: L(() => p.length ? s ? p.map((m, b) => {
1967
+ data: L(() => u.length ? r ? u.map((m, b) => {
1907
1968
  var v;
1908
- const x = (v = f[b]) == null ? void 0 : v.data;
1969
+ const x = (v = g[b]) == null ? void 0 : v.data;
1909
1970
  return x != null && x.success ? {
1910
1971
  ...m,
1911
1972
  serverAddress: x.serverAddress || null,
1912
1973
  serverPassword: x.serverPassword || null
1913
1974
  } : m;
1914
- }) : p : [], [p, s, f]),
1915
- isLoading: o || !!a && l
1975
+ }) : u : [], [u, r, g]),
1976
+ isLoading: o || !!a && c
1916
1977
  };
1917
1978
  }
1918
- function Sn() {
1979
+ function $t() {
1919
1980
  const { onFetchNotifications: e } = k();
1920
1981
  return !!e;
1921
1982
  }
1922
- function Rn(e = {}) {
1923
- const { onFetchNotifications: t, partnerSlug: r } = k(), { limit: s = 20, unreadOnly: a = !1 } = e;
1983
+ function Mt(e = {}) {
1984
+ const { onFetchNotifications: n, partnerSlug: s } = k(), { limit: r = 20, unreadOnly: a = !1 } = e;
1924
1985
  return S({
1925
- queryKey: ["pitvox", "notifications", r, { limit: s, unreadOnly: a }],
1926
- queryFn: () => t({ limit: s, unreadOnly: a }),
1927
- enabled: !!t,
1986
+ queryKey: ["pitvox", "notifications", s, { limit: r, unreadOnly: a }],
1987
+ queryFn: () => n({ limit: r, unreadOnly: a }),
1988
+ enabled: !!n,
1928
1989
  staleTime: 3e4,
1929
1990
  refetchInterval: 3e4
1930
1991
  });
1931
1992
  }
1932
- function Nt() {
1933
- const { onFetchNotifications: e, partnerSlug: t } = k(), { data: r, isLoading: s } = S({
1934
- queryKey: ["pitvox", "notifications", t, { limit: 1, unreadOnly: !1 }],
1993
+ function yn() {
1994
+ const { onFetchNotifications: e, partnerSlug: n } = k(), { data: s, isLoading: r } = S({
1995
+ queryKey: ["pitvox", "notifications", n, { limit: 1, unreadOnly: !1 }],
1935
1996
  queryFn: () => e({ limit: 1 }),
1936
1997
  enabled: !!e,
1937
1998
  staleTime: 3e4,
1938
1999
  refetchInterval: 3e4,
1939
2000
  select: (a) => (a == null ? void 0 : a.unreadCount) ?? 0
1940
2001
  });
1941
- return { count: r ?? 0, isLoading: s };
2002
+ return { count: s ?? 0, isLoading: r };
1942
2003
  }
1943
- function $n() {
1944
- const { onMarkNotificationRead: e, partnerSlug: t } = k(), r = _();
2004
+ function Dt() {
2005
+ const { onMarkNotificationRead: e, partnerSlug: n } = k(), s = _();
1945
2006
  return O({
1946
- mutationFn: (s) => {
2007
+ mutationFn: (r) => {
1947
2008
  if (!e)
1948
2009
  throw new Error("No onMarkNotificationRead callback provided to PitVoxPartnerProvider.");
1949
- return e(s);
2010
+ return e(r);
1950
2011
  },
1951
- onSuccess: (s, a) => {
1952
- r.setQueriesData(
1953
- { queryKey: ["pitvox", "notifications", t] },
2012
+ onSuccess: (r, a) => {
2013
+ s.setQueriesData(
2014
+ { queryKey: ["pitvox", "notifications", n] },
1954
2015
  (i) => i != null && i.notifications ? {
1955
2016
  ...i,
1956
2017
  unreadCount: Math.max(0, (i.unreadCount || 0) - 1),
@@ -1962,8 +2023,8 @@ function $n() {
1962
2023
  }
1963
2024
  });
1964
2025
  }
1965
- function Mn() {
1966
- const { onMarkAllNotificationsRead: e, partnerSlug: t } = k(), r = _();
2026
+ function It() {
2027
+ const { onMarkAllNotificationsRead: e, partnerSlug: n } = k(), s = _();
1967
2028
  return O({
1968
2029
  mutationFn: () => {
1969
2030
  if (!e)
@@ -1971,109 +2032,109 @@ function Mn() {
1971
2032
  return e();
1972
2033
  },
1973
2034
  onSuccess: () => {
1974
- r.setQueriesData(
1975
- { queryKey: ["pitvox", "notifications", t] },
1976
- (s) => s != null && s.notifications ? {
1977
- ...s,
2035
+ s.setQueriesData(
2036
+ { queryKey: ["pitvox", "notifications", n] },
2037
+ (r) => r != null && r.notifications ? {
2038
+ ...r,
1978
2039
  unreadCount: 0,
1979
- notifications: s.notifications.map((a) => ({
2040
+ notifications: r.notifications.map((a) => ({
1980
2041
  ...a,
1981
2042
  isRead: !0,
1982
2043
  readAt: a.readAt || (/* @__PURE__ */ new Date()).toISOString()
1983
2044
  }))
1984
- } : s
2045
+ } : r
1985
2046
  );
1986
2047
  }
1987
2048
  });
1988
2049
  }
1989
- function Dn({ driverName: e, avatarUrl: t, memberSince: r, className: s = "" }) {
1990
- const a = r ? new Date(r).toLocaleDateString("en-GB", { day: "2-digit", month: "2-digit", year: "numeric" }) : null;
1991
- return /* @__PURE__ */ c("div", { className: `pvx-card pvx-dash-profile ${s}`, children: [
1992
- 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() }),
1993
- /* @__PURE__ */ c("div", { className: "pvx-dash-profile-info", children: [
1994
- /* @__PURE__ */ n("h2", { className: "pvx-dash-profile-name", children: e }),
1995
- a && /* @__PURE__ */ c("p", { className: "pvx-dash-profile-since", children: [
2050
+ function Pt({ driverName: e, avatarUrl: n, memberSince: s, className: r = "" }) {
2051
+ const a = s ? new Date(s).toLocaleDateString("en-GB", { day: "2-digit", month: "2-digit", year: "numeric" }) : null;
2052
+ return /* @__PURE__ */ l("div", { className: `pvx-card pvx-dash-profile ${r}`, children: [
2053
+ n ? /* @__PURE__ */ t("img", { src: n, alt: "", className: "pvx-dash-profile-avatar" }) : /* @__PURE__ */ t("div", { className: "pvx-dash-profile-avatar pvx-dash-profile-avatar--placeholder", children: (e || "?")[0].toUpperCase() }),
2054
+ /* @__PURE__ */ l("div", { className: "pvx-dash-profile-info", children: [
2055
+ /* @__PURE__ */ t("h2", { className: "pvx-dash-profile-name", children: e }),
2056
+ a && /* @__PURE__ */ l("p", { className: "pvx-dash-profile-since", children: [
1996
2057
  "Racing since ",
1997
2058
  a
1998
2059
  ] })
1999
2060
  ] })
2000
2061
  ] });
2001
2062
  }
2002
- function In() {
2003
- return /* @__PURE__ */ c("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2004
- /* @__PURE__ */ n("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
2005
- /* @__PURE__ */ n("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
2006
- /* @__PURE__ */ n("line", { x1: "10", y1: "3", x2: "8", y2: "21" }),
2007
- /* @__PURE__ */ n("line", { x1: "16", y1: "3", x2: "14", y2: "21" })
2063
+ function Bt() {
2064
+ 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: [
2065
+ /* @__PURE__ */ t("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
2066
+ /* @__PURE__ */ t("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
2067
+ /* @__PURE__ */ t("line", { x1: "10", y1: "3", x2: "8", y2: "21" }),
2068
+ /* @__PURE__ */ t("line", { x1: "16", y1: "3", x2: "14", y2: "21" })
2008
2069
  ] });
2009
2070
  }
2010
- function Bn() {
2011
- return /* @__PURE__ */ c("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2012
- /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "10" }),
2013
- /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "2" }),
2014
- /* @__PURE__ */ n("path", { d: "M12 14v4" }),
2015
- /* @__PURE__ */ n("path", { d: "M10.5 12.5l-4 2.5" }),
2016
- /* @__PURE__ */ n("path", { d: "M13.5 12.5l4 2.5" })
2071
+ function At() {
2072
+ 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: [
2073
+ /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10" }),
2074
+ /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "2" }),
2075
+ /* @__PURE__ */ t("path", { d: "M12 14v4" }),
2076
+ /* @__PURE__ */ t("path", { d: "M10.5 12.5l-4 2.5" }),
2077
+ /* @__PURE__ */ t("path", { d: "M13.5 12.5l4 2.5" })
2017
2078
  ] });
2018
2079
  }
2019
- function Pn() {
2020
- 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" }) });
2080
+ function Ut() {
2081
+ return /* @__PURE__ */ t("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ t("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" }) });
2021
2082
  }
2022
- function ce({ icon: e, value: t, label: r, items: s, labelKey: a, countKey: i }) {
2023
- const [o, d] = D(!1), u = Ie(null);
2083
+ function pe({ icon: e, value: n, label: s, items: r, labelKey: a, countKey: i }) {
2084
+ const [o, d] = D(!1), p = Pe(null);
2024
2085
  Be(() => {
2025
2086
  if (!o) return;
2026
- function p(f) {
2027
- u.current && !u.current.contains(f.target) && d(!1);
2087
+ function u(g) {
2088
+ p.current && !p.current.contains(g.target) && d(!1);
2028
2089
  }
2029
- return document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
2090
+ return document.addEventListener("mousedown", u), () => document.removeEventListener("mousedown", u);
2030
2091
  }, [o]);
2031
- const l = s != null && s.length ? s.slice().sort((p, f) => f[i] - p[i]) : null;
2032
- return /* @__PURE__ */ c(
2092
+ const c = r != null && r.length ? r.slice().sort((u, g) => g[i] - u[i]) : null;
2093
+ return /* @__PURE__ */ l(
2033
2094
  "div",
2034
2095
  {
2035
- ref: u,
2036
- className: `pvx-dash-stat-card ${l ? "pvx-dash-stat-card--clickable" : ""}`,
2037
- onClick: l ? () => d((p) => !p) : void 0,
2096
+ ref: p,
2097
+ className: `pvx-dash-stat-card ${c ? "pvx-dash-stat-card--clickable" : ""}`,
2098
+ onClick: c ? () => d((u) => !u) : void 0,
2038
2099
  children: [
2039
2100
  e,
2040
- /* @__PURE__ */ c("div", { className: "pvx-dash-stat-content", children: [
2041
- /* @__PURE__ */ n("span", { className: "pvx-dash-stat-value", children: t }),
2042
- /* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: r })
2101
+ /* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
2102
+ /* @__PURE__ */ t("span", { className: "pvx-dash-stat-value", children: n }),
2103
+ /* @__PURE__ */ t("span", { className: "pvx-dash-stat-label", children: s })
2043
2104
  ] }),
2044
- l && /* @__PURE__ */ n("div", { className: `pvx-dash-tooltip pvx-dash-tooltip--scrollable ${o ? "pvx-dash-tooltip--open" : ""}`, children: l.map((p, f) => /* @__PURE__ */ c("div", { className: "pvx-dash-tooltip-row", children: [
2045
- /* @__PURE__ */ n("span", { className: "pvx-dash-tooltip-label", children: p[a] }),
2046
- /* @__PURE__ */ n("span", { className: "pvx-dash-tooltip-value", children: p[i] })
2047
- ] }, f)) })
2105
+ c && /* @__PURE__ */ t("div", { className: `pvx-dash-tooltip pvx-dash-tooltip--scrollable ${o ? "pvx-dash-tooltip--open" : ""}`, children: c.map((u, g) => /* @__PURE__ */ l("div", { className: "pvx-dash-tooltip-row", children: [
2106
+ /* @__PURE__ */ t("span", { className: "pvx-dash-tooltip-label", children: u[a] }),
2107
+ /* @__PURE__ */ t("span", { className: "pvx-dash-tooltip-value", children: u[i] })
2108
+ ] }, g)) })
2048
2109
  ]
2049
2110
  }
2050
2111
  );
2051
2112
  }
2052
- function An({ stats: e, rating: t, className: r = "" }) {
2113
+ function Et({ stats: e, rating: n, className: s = "" }) {
2053
2114
  if (!e) return null;
2054
- const s = e.trackBreakdown.map((i) => ({
2115
+ const r = e.trackBreakdown.map((i) => ({
2055
2116
  name: q(i.trackId, i.layout),
2056
2117
  lapCount: i.lapCount
2057
2118
  })), a = e.carBreakdown.map((i) => ({
2058
2119
  name: I(i.carId),
2059
2120
  lapCount: i.lapCount
2060
2121
  }));
2061
- return /* @__PURE__ */ c("div", { className: `pvx-dash-stats ${r}`, children: [
2062
- /* @__PURE__ */ n(
2063
- ce,
2122
+ return /* @__PURE__ */ l("div", { className: `pvx-dash-stats ${s}`, children: [
2123
+ /* @__PURE__ */ t(
2124
+ pe,
2064
2125
  {
2065
- icon: /* @__PURE__ */ n(In, {}),
2126
+ icon: /* @__PURE__ */ t(Bt, {}),
2066
2127
  value: e.lapCount.toLocaleString(),
2067
2128
  label: "Total Laps",
2068
- items: s,
2129
+ items: r,
2069
2130
  labelKey: "name",
2070
2131
  countKey: "lapCount"
2071
2132
  }
2072
2133
  ),
2073
- /* @__PURE__ */ n(
2074
- ce,
2134
+ /* @__PURE__ */ t(
2135
+ pe,
2075
2136
  {
2076
- icon: /* @__PURE__ */ n(Bn, {}),
2137
+ icon: /* @__PURE__ */ t(At, {}),
2077
2138
  value: e.carBreakdown.length,
2078
2139
  label: "Cars Used",
2079
2140
  items: a,
@@ -2081,111 +2142,111 @@ function An({ stats: e, rating: t, className: r = "" }) {
2081
2142
  countKey: "lapCount"
2082
2143
  }
2083
2144
  ),
2084
- t && /* @__PURE__ */ c("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--rating", children: [
2085
- /* @__PURE__ */ n(Pn, {}),
2086
- /* @__PURE__ */ c("div", { className: "pvx-dash-stat-content", children: [
2087
- /* @__PURE__ */ n("span", { className: "pvx-dash-stat-value", children: t.rating.toFixed(1) }),
2088
- /* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: "Driver Rating" }),
2089
- /* @__PURE__ */ c("span", { className: "pvx-dash-stat-sub", children: [
2145
+ n && /* @__PURE__ */ l("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--rating", children: [
2146
+ /* @__PURE__ */ t(Ut, {}),
2147
+ /* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
2148
+ /* @__PURE__ */ t("span", { className: "pvx-dash-stat-value", children: n.rating.toFixed(1) }),
2149
+ /* @__PURE__ */ t("span", { className: "pvx-dash-stat-label", children: "Driver Rating" }),
2150
+ /* @__PURE__ */ l("span", { className: "pvx-dash-stat-sub", children: [
2090
2151
  "#",
2091
- t.rank,
2152
+ n.rank,
2092
2153
  " of ",
2093
- t.totalDrivers
2154
+ n.totalDrivers
2094
2155
  ] })
2095
2156
  ] })
2096
2157
  ] })
2097
2158
  ] });
2098
2159
  }
2099
- function Un({ records: e, className: t = "" }) {
2100
- const r = L(() => e != null && e.length ? e.slice().sort((s, a) => {
2101
- const i = s.recordedAt ? new Date(s.recordedAt).getTime() : 0;
2160
+ function Ft({ records: e, className: n = "" }) {
2161
+ const s = L(() => e != null && e.length ? e.slice().sort((r, a) => {
2162
+ const i = r.recordedAt ? new Date(r.recordedAt).getTime() : 0;
2102
2163
  return (a.recordedAt ? new Date(a.recordedAt).getTime() : 0) - i;
2103
2164
  }) : [], [e]);
2104
- return r.length ? /* @__PURE__ */ c("div", { className: `pvx-card ${t}`, children: [
2105
- /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ c("h3", { className: "pvx-card-title", children: [
2106
- /* @__PURE__ */ n("span", { className: "pvx-dash-records-icon", children: /* @__PURE__ */ c("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2107
- /* @__PURE__ */ n("path", { d: "M6 9H4.5a2.5 2.5 0 010-5H6" }),
2108
- /* @__PURE__ */ n("path", { d: "M18 9h1.5a2.5 2.5 0 000-5H18" }),
2109
- /* @__PURE__ */ n("path", { d: "M4 22h16" }),
2110
- /* @__PURE__ */ n("path", { d: "M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20 7 22" }),
2111
- /* @__PURE__ */ n("path", { d: "M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20 17 22" }),
2112
- /* @__PURE__ */ n("path", { d: "M18 2H6v7a6 6 0 0012 0V2z" })
2165
+ return s.length ? /* @__PURE__ */ l("div", { className: `pvx-card ${n}`, children: [
2166
+ /* @__PURE__ */ t("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
2167
+ /* @__PURE__ */ t("span", { className: "pvx-dash-records-icon", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2168
+ /* @__PURE__ */ t("path", { d: "M6 9H4.5a2.5 2.5 0 010-5H6" }),
2169
+ /* @__PURE__ */ t("path", { d: "M18 9h1.5a2.5 2.5 0 000-5H18" }),
2170
+ /* @__PURE__ */ t("path", { d: "M4 22h16" }),
2171
+ /* @__PURE__ */ t("path", { d: "M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20 7 22" }),
2172
+ /* @__PURE__ */ t("path", { d: "M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20 17 22" }),
2173
+ /* @__PURE__ */ t("path", { d: "M18 2H6v7a6 6 0 0012 0V2z" })
2113
2174
  ] }) }),
2114
2175
  "Current Records",
2115
- /* @__PURE__ */ c("span", { className: "pvx-dash-records-count", children: [
2176
+ /* @__PURE__ */ l("span", { className: "pvx-dash-records-count", children: [
2116
2177
  "(",
2117
- r.length,
2178
+ s.length,
2118
2179
  ")"
2119
2180
  ] })
2120
2181
  ] }) }),
2121
- /* @__PURE__ */ n("div", { className: "pvx-dash-records-list", children: r.map((s, a) => /* @__PURE__ */ c("div", { className: "pvx-dash-record-row", children: [
2122
- /* @__PURE__ */ c("div", { className: "pvx-dash-record-info", children: [
2123
- /* @__PURE__ */ n("span", { className: "pvx-dash-record-track", children: q(s.trackId, s.layout, s.game) }),
2124
- /* @__PURE__ */ n("span", { className: "pvx-dash-record-car", children: I(s.carId) })
2182
+ /* @__PURE__ */ t("div", { className: "pvx-dash-records-list", children: s.map((r, a) => /* @__PURE__ */ l("div", { className: "pvx-dash-record-row", children: [
2183
+ /* @__PURE__ */ l("div", { className: "pvx-dash-record-info", children: [
2184
+ /* @__PURE__ */ t("span", { className: "pvx-dash-record-track", children: q(r.trackId, r.layout, r.game) }),
2185
+ /* @__PURE__ */ t("span", { className: "pvx-dash-record-car", children: I(r.carId) })
2125
2186
  ] }),
2126
- /* @__PURE__ */ c("div", { className: "pvx-dash-record-time", children: [
2127
- /* @__PURE__ */ n("span", { className: "pvx-dash-record-lap", children: A(s.lapTimeMs) }),
2128
- /* @__PURE__ */ c("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${s.game || "evo"}`, children: [
2129
- (s.game || "evo").toUpperCase(),
2130
- s.gameVersion ? ` ${s.gameVersion}` : ""
2187
+ /* @__PURE__ */ l("div", { className: "pvx-dash-record-time", children: [
2188
+ /* @__PURE__ */ t("span", { className: "pvx-dash-record-lap", children: A(r.lapTimeMs) }),
2189
+ /* @__PURE__ */ l("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${r.game || "evo"}`, children: [
2190
+ (r.game || "evo").toUpperCase(),
2191
+ r.gameVersion ? ` ${r.gameVersion}` : ""
2131
2192
  ] })
2132
2193
  ] })
2133
2194
  ] }, a)) })
2134
2195
  ] }) : null;
2135
2196
  }
2136
- function En({ events: e, isLoading: t, className: r, limit: s = 3 }) {
2137
- if (t)
2138
- return /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading upcoming events..." });
2197
+ function _t({ events: e, isLoading: n, className: s, limit: r = 3 }) {
2198
+ if (n)
2199
+ return /* @__PURE__ */ t("div", { className: "pvx-loading", children: "Loading upcoming events..." });
2139
2200
  if (!(e != null && e.length))
2140
2201
  return null;
2141
- const a = s ? e.slice(0, s) : e, i = e.length - a.length;
2142
- return /* @__PURE__ */ c("div", { className: `pvx-card ${r || ""}`, children: [
2143
- /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ c("h3", { className: "pvx-card-title", children: [
2144
- /* @__PURE__ */ n(qn, {}),
2202
+ const a = r ? e.slice(0, r) : e, i = e.length - a.length;
2203
+ return /* @__PURE__ */ l("div", { className: `pvx-card ${s || ""}`, children: [
2204
+ /* @__PURE__ */ t("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
2205
+ /* @__PURE__ */ t(Vt, {}),
2145
2206
  "Upcoming Events",
2146
- /* @__PURE__ */ c("span", { className: "pvx-dash-records-count", children: [
2207
+ /* @__PURE__ */ l("span", { className: "pvx-dash-records-count", children: [
2147
2208
  "(",
2148
2209
  e.length,
2149
2210
  ")"
2150
2211
  ] })
2151
2212
  ] }) }),
2152
- /* @__PURE__ */ c("div", { className: "pvx-upcoming-list", children: [
2153
- a.map((o) => /* @__PURE__ */ c(
2213
+ /* @__PURE__ */ l("div", { className: "pvx-upcoming-list", children: [
2214
+ a.map((o) => /* @__PURE__ */ l(
2154
2215
  "div",
2155
2216
  {
2156
2217
  className: `pvx-upcoming-item ${o.isNext ? "pvx-upcoming-item--next" : ""}`,
2157
2218
  children: [
2158
- /* @__PURE__ */ c("div", { className: "pvx-upcoming-info", children: [
2159
- /* @__PURE__ */ n("span", { className: "pvx-upcoming-comp", children: o.competitionName }),
2160
- /* @__PURE__ */ c("span", { className: "pvx-upcoming-round", children: [
2219
+ /* @__PURE__ */ l("div", { className: "pvx-upcoming-info", children: [
2220
+ /* @__PURE__ */ t("span", { className: "pvx-upcoming-comp", children: o.competitionName }),
2221
+ /* @__PURE__ */ l("span", { className: "pvx-upcoming-round", children: [
2161
2222
  "Round ",
2162
2223
  o.roundNumber,
2163
2224
  ": ",
2164
2225
  o.track
2165
2226
  ] }),
2166
- o.serverPassword && /* @__PURE__ */ n(
2167
- Fn,
2227
+ o.serverPassword && /* @__PURE__ */ t(
2228
+ qt,
2168
2229
  {
2169
2230
  password: o.serverPassword,
2170
2231
  address: o.serverAddress
2171
2232
  }
2172
2233
  )
2173
2234
  ] }),
2174
- /* @__PURE__ */ c("div", { className: "pvx-upcoming-time", children: [
2175
- /* @__PURE__ */ n("span", { className: "pvx-upcoming-date", children: new Date(o.startTime).toLocaleDateString("en-GB", {
2235
+ /* @__PURE__ */ l("div", { className: "pvx-upcoming-time", children: [
2236
+ /* @__PURE__ */ t("span", { className: "pvx-upcoming-date", children: new Date(o.startTime).toLocaleDateString("en-GB", {
2176
2237
  day: "numeric",
2177
2238
  month: "short",
2178
2239
  year: "numeric"
2179
2240
  }) }),
2180
- /* @__PURE__ */ n("span", { className: "pvx-upcoming-relative", children: o.dediStatus === "running" ? "Live now" : o.dediStatus === "provisioning" ? "Starting..." : _n(o.startTime) }),
2181
- o.dediStatus === "running" && /* @__PURE__ */ n("span", { className: "pvx-upcoming-badge pvx-upcoming-badge--live", children: "Live" }),
2182
- !o.dediStatus && o.isNext && /* @__PURE__ */ n("span", { className: "pvx-upcoming-badge", children: "Next" })
2241
+ /* @__PURE__ */ t("span", { className: "pvx-upcoming-relative", children: o.dediStatus === "running" ? "Live now" : o.dediStatus === "provisioning" ? "Starting..." : jt(o.startTime) }),
2242
+ o.dediStatus === "running" && /* @__PURE__ */ t("span", { className: "pvx-upcoming-badge pvx-upcoming-badge--live", children: "Live" }),
2243
+ !o.dediStatus && o.isNext && /* @__PURE__ */ t("span", { className: "pvx-upcoming-badge", children: "Next" })
2183
2244
  ] })
2184
2245
  ]
2185
2246
  },
2186
2247
  `${o.competitionId}-${o.roundNumber}`
2187
2248
  )),
2188
- i > 0 && /* @__PURE__ */ c("div", { className: "pvx-upcoming-remaining", children: [
2249
+ i > 0 && /* @__PURE__ */ l("div", { className: "pvx-upcoming-remaining", children: [
2189
2250
  "+",
2190
2251
  i,
2191
2252
  " more event",
@@ -2194,258 +2255,258 @@ function En({ events: e, isLoading: t, className: r, limit: s = 3 }) {
2194
2255
  ] })
2195
2256
  ] });
2196
2257
  }
2197
- function Fn({ password: e, address: t }) {
2198
- const [r, s] = D(!1), [a, i] = D(!1), o = t ? e ? `join:${t}|${e}` : `join:${t}` : null, d = H(async () => {
2258
+ function qt({ password: e, address: n }) {
2259
+ const [s, r] = D(!1), [a, i] = D(!1), o = n ? e ? `join:${n}|${e}` : `join:${n}` : null, d = H(async () => {
2199
2260
  if (o)
2200
2261
  try {
2201
- await navigator.clipboard.writeText(o), s(!0), setTimeout(() => s(!1), 2e3);
2262
+ await navigator.clipboard.writeText(o), r(!0), setTimeout(() => r(!1), 2e3);
2202
2263
  } catch {
2203
2264
  }
2204
2265
  }, [o]);
2205
- return /* @__PURE__ */ c("div", { className: "pvx-server-info", children: [
2206
- o && /* @__PURE__ */ c(
2266
+ return /* @__PURE__ */ l("div", { className: "pvx-server-info", children: [
2267
+ o && /* @__PURE__ */ l(
2207
2268
  "span",
2208
2269
  {
2209
2270
  className: "pvx-server-detail pvx-server-detail--clickable",
2210
2271
  onClick: d,
2211
2272
  title: "Copy join string to clipboard",
2212
2273
  children: [
2213
- /* @__PURE__ */ n(Vn, {}),
2274
+ /* @__PURE__ */ t(Ht, {}),
2214
2275
  " ",
2215
- r ? "Copied!" : "Join"
2276
+ s ? "Copied!" : "Join"
2216
2277
  ]
2217
2278
  }
2218
2279
  ),
2219
- e && /* @__PURE__ */ c(U, { children: [
2220
- /* @__PURE__ */ n(
2280
+ e && /* @__PURE__ */ l(U, { children: [
2281
+ /* @__PURE__ */ t(
2221
2282
  "span",
2222
2283
  {
2223
2284
  className: "pvx-server-detail pvx-server-detail--clickable",
2224
- onClick: () => i((u) => !u),
2285
+ onClick: () => i((p) => !p),
2225
2286
  title: a ? "Hide password" : "Reveal password",
2226
- children: a ? /* @__PURE__ */ n(Hn, {}) : /* @__PURE__ */ n(Kn, {})
2287
+ children: a ? /* @__PURE__ */ t(Wt, {}) : /* @__PURE__ */ t(Ot, {})
2227
2288
  }
2228
2289
  ),
2229
- a && /* @__PURE__ */ c("span", { className: "pvx-server-detail", children: [
2230
- /* @__PURE__ */ n(jn, {}),
2290
+ a && /* @__PURE__ */ l("span", { className: "pvx-server-detail", children: [
2291
+ /* @__PURE__ */ t(Kt, {}),
2231
2292
  " ",
2232
2293
  e
2233
2294
  ] })
2234
2295
  ] })
2235
2296
  ] });
2236
2297
  }
2237
- function _n(e) {
2238
- const t = new Date(e).getTime() - Date.now();
2239
- if (t <= 0) return "Now";
2240
- const r = Math.floor(t / (1e3 * 60 * 60));
2241
- if (r < 1) return "Less than 1 hour";
2242
- if (r < 24) return `in ${r}h`;
2243
- const s = Math.floor(r / 24);
2244
- if (s === 1) return "Tomorrow";
2245
- if (s < 7) return `in ${s} days`;
2246
- if (s < 30) {
2247
- const a = Math.floor(s / 7);
2298
+ function jt(e) {
2299
+ const n = new Date(e).getTime() - Date.now();
2300
+ if (n <= 0) return "Now";
2301
+ const s = Math.floor(n / (1e3 * 60 * 60));
2302
+ if (s < 1) return "Less than 1 hour";
2303
+ if (s < 24) return `in ${s}h`;
2304
+ const r = Math.floor(s / 24);
2305
+ if (r === 1) return "Tomorrow";
2306
+ if (r < 7) return `in ${r} days`;
2307
+ if (r < 30) {
2308
+ const a = Math.floor(r / 7);
2248
2309
  return `in ${a} week${a !== 1 ? "s" : ""}`;
2249
2310
  }
2250
- return le(e);
2311
+ return ue(e);
2251
2312
  }
2252
- function qn() {
2253
- return /* @__PURE__ */ c("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: [
2254
- /* @__PURE__ */ n("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
2255
- /* @__PURE__ */ n("path", { d: "M16 2v4M8 2v4M3 10h18" })
2313
+ function Vt() {
2314
+ 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: [
2315
+ /* @__PURE__ */ t("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
2316
+ /* @__PURE__ */ t("path", { d: "M16 2v4M8 2v4M3 10h18" })
2256
2317
  ] });
2257
2318
  }
2258
- function jn() {
2259
- return /* @__PURE__ */ c("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: [
2260
- /* @__PURE__ */ n("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2" }),
2261
- /* @__PURE__ */ n("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
2319
+ function Kt() {
2320
+ 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: [
2321
+ /* @__PURE__ */ t("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2" }),
2322
+ /* @__PURE__ */ t("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
2262
2323
  ] });
2263
2324
  }
2264
- function Vn() {
2265
- return /* @__PURE__ */ c("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: [
2266
- /* @__PURE__ */ n("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
2267
- /* @__PURE__ */ n("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
2325
+ function Ht() {
2326
+ 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: [
2327
+ /* @__PURE__ */ t("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
2328
+ /* @__PURE__ */ t("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
2268
2329
  ] });
2269
2330
  }
2270
- function Kn() {
2271
- return /* @__PURE__ */ c("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: [
2272
- /* @__PURE__ */ n("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
2273
- /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "3" })
2331
+ function Ot() {
2332
+ 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: [
2333
+ /* @__PURE__ */ t("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
2334
+ /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "3" })
2274
2335
  ] });
2275
2336
  }
2276
- function Hn() {
2277
- return /* @__PURE__ */ c("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: [
2278
- /* @__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" }),
2279
- /* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
2337
+ function Wt() {
2338
+ 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: [
2339
+ /* @__PURE__ */ t("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" }),
2340
+ /* @__PURE__ */ t("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
2280
2341
  ] });
2281
2342
  }
2282
- function On({ notifications: e, unreadCount: t = 0, onMarkRead: r, onMarkAllRead: s, isLoading: a, className: i }) {
2283
- const o = ue();
2284
- return a ? /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading notifications..." }) : /* @__PURE__ */ c("div", { className: `pvx-card ${i || ""}`, children: [
2285
- /* @__PURE__ */ c("div", { className: "pvx-card-header", children: [
2286
- /* @__PURE__ */ c("h3", { className: "pvx-card-title", children: [
2287
- /* @__PURE__ */ n(Gn, {}),
2343
+ function Gt({ notifications: e, unreadCount: n = 0, onMarkRead: s, onMarkAllRead: r, isLoading: a, className: i }) {
2344
+ const o = ve();
2345
+ return a ? /* @__PURE__ */ t("div", { className: "pvx-loading", children: "Loading notifications..." }) : /* @__PURE__ */ l("div", { className: `pvx-card ${i || ""}`, children: [
2346
+ /* @__PURE__ */ l("div", { className: "pvx-card-header", children: [
2347
+ /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
2348
+ /* @__PURE__ */ t(Yt, {}),
2288
2349
  "Notifications",
2289
- t > 0 && /* @__PURE__ */ n("span", { className: "pvx-notif-badge", children: t > 99 ? "99+" : t })
2350
+ n > 0 && /* @__PURE__ */ t("span", { className: "pvx-notif-badge", children: n > 99 ? "99+" : n })
2290
2351
  ] }),
2291
- t > 0 && s && /* @__PURE__ */ n("button", { className: "pvx-notif-mark-all", onClick: s, children: "Mark all read" })
2352
+ n > 0 && r && /* @__PURE__ */ t("button", { className: "pvx-notif-mark-all", onClick: r, children: "Mark all read" })
2292
2353
  ] }),
2293
- e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-notif-list", children: e.map((d) => /* @__PURE__ */ n(
2294
- Wn,
2354
+ e != null && e.length ? /* @__PURE__ */ t("div", { className: "pvx-notif-list", children: e.map((d) => /* @__PURE__ */ t(
2355
+ zt,
2295
2356
  {
2296
2357
  notification: d,
2297
2358
  getUserDisplay: o,
2298
- onMarkRead: r
2359
+ onMarkRead: s
2299
2360
  },
2300
2361
  d.id
2301
- )) }) : /* @__PURE__ */ n("div", { className: "pvx-notif-empty", children: "No notifications" })
2362
+ )) }) : /* @__PURE__ */ t("div", { className: "pvx-notif-empty", children: "No notifications" })
2302
2363
  ] });
2303
2364
  }
2304
- function Wn({ notification: e, getUserDisplay: t, onMarkRead: r }) {
2305
- const s = () => {
2306
- !e.isRead && r && r(e.id);
2365
+ function zt({ notification: e, getUserDisplay: n, onMarkRead: s }) {
2366
+ const r = () => {
2367
+ !e.isRead && s && s(e.id);
2307
2368
  };
2308
- return /* @__PURE__ */ c(
2369
+ return /* @__PURE__ */ l(
2309
2370
  "button",
2310
2371
  {
2311
2372
  className: `pvx-notif-item ${e.isRead ? "" : "pvx-notif-item--unread"}`,
2312
- onClick: s,
2373
+ onClick: r,
2313
2374
  children: [
2314
- /* @__PURE__ */ n(zn, { type: e.type }),
2315
- /* @__PURE__ */ c("div", { className: "pvx-notif-content", children: [
2316
- /* @__PURE__ */ n("span", { className: "pvx-notif-message", children: je(e, t) }),
2317
- /* @__PURE__ */ n("span", { className: "pvx-notif-time", children: le(e.createdAt) })
2375
+ /* @__PURE__ */ t(Qt, { type: e.type }),
2376
+ /* @__PURE__ */ l("div", { className: "pvx-notif-content", children: [
2377
+ /* @__PURE__ */ t("span", { className: "pvx-notif-message", children: Ve(e, n) }),
2378
+ /* @__PURE__ */ t("span", { className: "pvx-notif-time", children: ue(e.createdAt) })
2318
2379
  ] }),
2319
- !e.isRead && /* @__PURE__ */ n("span", { className: "pvx-notif-dot" })
2380
+ !e.isRead && /* @__PURE__ */ t("span", { className: "pvx-notif-dot" })
2320
2381
  ]
2321
2382
  }
2322
2383
  );
2323
2384
  }
2324
- function zn({ type: e }) {
2325
- 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__ */ c("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2326
- /* @__PURE__ */ n("path", { d: "m3 11 18-5v12L3 13v-2z" }),
2327
- /* @__PURE__ */ n("path", { d: "M11.6 16.8a3 3 0 1 1-5.8-1.6" })
2328
- ] }) }) : /* @__PURE__ */ n("span", { className: "pvx-notif-icon pvx-notif-icon--record", children: /* @__PURE__ */ c("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2329
- /* @__PURE__ */ n("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
2330
- /* @__PURE__ */ n("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
2331
- /* @__PURE__ */ n("path", { d: "M4 22h16" }),
2332
- /* @__PURE__ */ n("path", { d: "M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22" }),
2333
- /* @__PURE__ */ n("path", { d: "M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22" }),
2334
- /* @__PURE__ */ n("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
2385
+ function Qt({ type: e }) {
2386
+ return e === "RECORD_BEATEN" ? /* @__PURE__ */ t("span", { className: "pvx-notif-icon pvx-notif-icon--beaten", children: /* @__PURE__ */ t("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ t("path", { d: "m7 7 10 10M17 7v10H7" }) }) }) : e === "ADMIN_MESSAGE" ? /* @__PURE__ */ t("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: [
2387
+ /* @__PURE__ */ t("path", { d: "m3 11 18-5v12L3 13v-2z" }),
2388
+ /* @__PURE__ */ t("path", { d: "M11.6 16.8a3 3 0 1 1-5.8-1.6" })
2389
+ ] }) }) : /* @__PURE__ */ t("span", { className: "pvx-notif-icon pvx-notif-icon--record", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2390
+ /* @__PURE__ */ t("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
2391
+ /* @__PURE__ */ t("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
2392
+ /* @__PURE__ */ t("path", { d: "M4 22h16" }),
2393
+ /* @__PURE__ */ t("path", { d: "M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22" }),
2394
+ /* @__PURE__ */ t("path", { d: "M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22" }),
2395
+ /* @__PURE__ */ t("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
2335
2396
  ] }) });
2336
2397
  }
2337
- function Gn() {
2338
- return /* @__PURE__ */ c("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: [
2339
- /* @__PURE__ */ n("path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" }),
2340
- /* @__PURE__ */ n("path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0" })
2398
+ function Yt() {
2399
+ 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: [
2400
+ /* @__PURE__ */ t("path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" }),
2401
+ /* @__PURE__ */ t("path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0" })
2341
2402
  ] });
2342
2403
  }
2343
- function bt({ steamId: e, avatarUrl: t, memberSince: r, className: s = "" }) {
2344
- const { data: a, isLoading: i, error: o } = Cn(e), { data: d, isLoading: u } = Ln(e), { data: l, isLoading: p } = Tn(), f = Sn(), { data: g, isLoading: m } = Rn({ limit: 10 }), b = $n(), x = Mn();
2345
- return i || u ? /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading dashboard..." }) : o ? /* @__PURE__ */ n("div", { className: "pvx-empty", children: "Failed to load dashboard data." }) : a ? /* @__PURE__ */ c("div", { className: `pvx-dash ${s}`, children: [
2346
- /* @__PURE__ */ n(
2347
- Dn,
2404
+ function wn({ steamId: e, avatarUrl: n, memberSince: s, className: r = "" }) {
2405
+ const { data: a, isLoading: i, error: o } = Tt(e), { data: d, isLoading: p } = St(e), { data: c, isLoading: u } = Rt(), g = $t(), { data: f, isLoading: m } = Mt({ limit: 10 }), b = Dt(), x = It();
2406
+ return i || p ? /* @__PURE__ */ t("div", { className: "pvx-loading", children: "Loading dashboard..." }) : o ? /* @__PURE__ */ t("div", { className: "pvx-empty", children: "Failed to load dashboard data." }) : a ? /* @__PURE__ */ l("div", { className: `pvx-dash ${r}`, children: [
2407
+ /* @__PURE__ */ t(
2408
+ Pt,
2348
2409
  {
2349
2410
  driverName: a.driverName,
2350
- avatarUrl: t,
2351
- memberSince: r
2411
+ avatarUrl: n,
2412
+ memberSince: s
2352
2413
  }
2353
2414
  ),
2354
- /* @__PURE__ */ n(An, { stats: a, rating: d }),
2355
- e && /* @__PURE__ */ n(En, { events: l, isLoading: p }),
2356
- /* @__PURE__ */ c("div", { className: `pvx-dash-row ${f ? "pvx-dash-row--2col" : ""}`, children: [
2357
- /* @__PURE__ */ n(Un, { records: a.currentRecords }),
2358
- f && /* @__PURE__ */ n(
2359
- On,
2415
+ /* @__PURE__ */ t(Et, { stats: a, rating: d }),
2416
+ e && /* @__PURE__ */ t(_t, { events: c, isLoading: u }),
2417
+ /* @__PURE__ */ l("div", { className: `pvx-dash-row ${g ? "pvx-dash-row--2col" : ""}`, children: [
2418
+ /* @__PURE__ */ t(Ft, { records: a.currentRecords }),
2419
+ g && /* @__PURE__ */ t(
2420
+ Gt,
2360
2421
  {
2361
- notifications: g == null ? void 0 : g.notifications,
2362
- unreadCount: (g == null ? void 0 : g.unreadCount) || 0,
2422
+ notifications: f == null ? void 0 : f.notifications,
2423
+ unreadCount: (f == null ? void 0 : f.unreadCount) || 0,
2363
2424
  onMarkRead: (v) => b.mutate(v),
2364
2425
  onMarkAllRead: () => x.mutate(),
2365
2426
  isLoading: m
2366
2427
  }
2367
2428
  )
2368
2429
  ] })
2369
- ] }) : /* @__PURE__ */ n("div", { className: "pvx-empty", children: "No data available yet. Start driving to see your stats!" });
2430
+ ] }) : /* @__PURE__ */ t("div", { className: "pvx-empty", children: "No data available yet. Start driving to see your stats!" });
2370
2431
  }
2371
2432
  export {
2372
- ot as CarsTable,
2433
+ cn as CarsTable,
2373
2434
  P as CompEmptyState,
2374
2435
  E as CompLoadingState,
2375
- un as CompetitionCard,
2376
- ut as CompetitionCards,
2377
- gt as CompetitionResultsTabs,
2378
- pn as CompletedBadge,
2379
- Ce as DEFAULT_COMPLETION_GRACE_DAYS,
2380
- bt as DriverDashboard,
2381
- Dn as DriverProfile,
2382
- ct as DriversTable,
2383
- vt as EntryList,
2384
- Y as InfoPill,
2385
- lt as LapHistoryTable,
2386
- On as NotificationsCard,
2387
- se as PODIUM_MEDALS,
2388
- Zn as PitVoxPartnerProvider,
2389
- dt as RankingsTable,
2390
- Un as RecordsTable,
2391
- ht as RegisterButton,
2392
- xt as RegistrationPanel,
2393
- mt as RoundResults,
2394
- Te as RoundSessionResults,
2395
- hn as StandingsTable,
2396
- An as StatsCards,
2397
- it as TracksTable,
2398
- sn as TypeBadge,
2399
- En as UpcomingEvents,
2400
- _e as buildDriverIndexPath,
2401
- Fe as buildLapsPath,
2402
- Z as buildLeaderboardPath,
2403
- qe as buildRecentLapsPath,
2436
+ ut as CompetitionCard,
2437
+ hn as CompetitionCards,
2438
+ Nn as CompetitionResultsTabs,
2439
+ pt as CompletedBadge,
2440
+ Te as DEFAULT_COMPLETION_GRACE_DAYS,
2441
+ wn as DriverDashboard,
2442
+ Pt as DriverProfile,
2443
+ dn as DriversTable,
2444
+ xn as EntryList,
2445
+ J as InfoPill,
2446
+ pn as LapHistoryTable,
2447
+ Gt as NotificationsCard,
2448
+ ae as PODIUM_MEDALS,
2449
+ en as PitVoxPartnerProvider,
2450
+ un as RankingsTable,
2451
+ Ft as RecordsTable,
2452
+ gn as RegisterButton,
2453
+ fn as RegistrationPanel,
2454
+ vn as RoundResults,
2455
+ le as RoundSessionResults,
2456
+ vt as StandingsTable,
2457
+ Et as StatsCards,
2458
+ ln as TracksTable,
2459
+ at as TypeBadge,
2460
+ _t as UpcomingEvents,
2461
+ qe as buildDriverIndexPath,
2462
+ _e as buildLapsPath,
2463
+ X as buildLeaderboardPath,
2464
+ je as buildRecentLapsPath,
2404
2465
  R as fetchCdnJson,
2405
- pt as filterCompetitionsByStatus,
2466
+ mn as filterCompetitionsByStatus,
2406
2467
  I as formatCarName,
2407
2468
  j as formatDate,
2408
- Xn as formatDelta,
2409
- pe as formatFuel,
2469
+ tn as formatDelta,
2470
+ he as formatFuel,
2410
2471
  A as formatLapTime,
2411
- je as formatNotificationMessage,
2412
- le as formatRelativeTime,
2472
+ Ve as formatNotificationMessage,
2473
+ ue as formatRelativeTime,
2413
2474
  B as formatSectorTime,
2414
- tn as formatSessionLabel,
2475
+ ie as formatSessionLabel,
2415
2476
  q as formatTrackName,
2416
- de as formatTyreCompound,
2417
- dn as getCompetitionPodium,
2418
- Le as getCompetitionStatus,
2419
- ln as getCompletionDate,
2420
- cn as isCompetitionComplete,
2421
- rt as useCarLeaderboard,
2422
- nt as useCarMetadata,
2423
- Oe as useCompetitionAllRounds,
2424
- me as useCompetitionConfig,
2425
- he as useCompetitionEntryList,
2426
- at as useCompetitionLeaderboard,
2427
- He as useCompetitionRound,
2428
- We as useCompetitionRoundLaps,
2429
- ve as useCompetitionStandings,
2430
- st as useCompetitions,
2431
- Ke as useDriverLaps,
2432
- Ln as useDriverRating,
2433
- ft as useDriverRatings,
2434
- Cn as useDriverStats,
2435
- et as useLeaderboardIndex,
2436
- Mn as useMarkAllNotificationsRead,
2437
- $n as useMarkNotificationRead,
2438
- Rn as useNotifications,
2439
- Sn as useNotificationsEnabled,
2477
+ me as formatTyreCompound,
2478
+ dt as getCompetitionPodium,
2479
+ Se as getCompetitionStatus,
2480
+ ct as getCompletionDate,
2481
+ lt as isCompetitionComplete,
2482
+ an as useCarLeaderboard,
2483
+ rn as useCarMetadata,
2484
+ We as useCompetitionAllRounds,
2485
+ xe as useCompetitionConfig,
2486
+ fe as useCompetitionEntryList,
2487
+ Ge as useCompetitionLeaderboard,
2488
+ Oe as useCompetitionRound,
2489
+ ze as useCompetitionRoundLaps,
2490
+ ge as useCompetitionStandings,
2491
+ on as useCompetitions,
2492
+ He as useDriverLaps,
2493
+ St as useDriverRating,
2494
+ bn as useDriverRatings,
2495
+ Tt as useDriverStats,
2496
+ nn as useLeaderboardIndex,
2497
+ It as useMarkAllNotificationsRead,
2498
+ Dt as useMarkNotificationRead,
2499
+ Mt as useNotifications,
2500
+ $t as useNotificationsEnabled,
2440
2501
  k as usePitVox,
2441
- tt as useRecentLaps,
2442
- xe as useRegister,
2443
- ee as useRegistrationMode,
2444
- X as useRegistrationStatus,
2502
+ sn as useRecentLaps,
2503
+ Ne as useRegister,
2504
+ te as useRegistrationMode,
2505
+ ee as useRegistrationStatus,
2445
2506
  ne as useRegistrationUrl,
2446
- Ve as useTrackLeaderboard,
2447
- Nt as useUnreadCount,
2448
- Tn as useUpcomingEvents,
2449
- ue as useUserLookup,
2450
- ge as useWithdraw
2507
+ Ke as useTrackLeaderboard,
2508
+ yn as useUnreadCount,
2509
+ Rt as useUpcomingEvents,
2510
+ ve as useUserLookup,
2511
+ be as useWithdraw
2451
2512
  };