@pitvox/partner-react 0.5.14 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,52 +1,52 @@
1
1
  import { jsx as e, jsxs as l, Fragment as A } from "react/jsx-runtime";
2
- import { createContext as ke, useMemo as w, useContext as we, useState as M, useCallback as K, useRef as Ce, useEffect as Le } from "react";
3
- import { useQueryClient as U, QueryClient as Re, QueryClientProvider as Te, useQuery as L, useMutation as H, useQueries as ne } from "@tanstack/react-query";
4
- const Y = ke(null), Se = "https://cdn.pitvox.com", $e = "https://pitvox.com";
2
+ import { createContext as we, useMemo as w, useContext as Ce, useState as M, useCallback as K, useRef as Le, useEffect as Re } from "react";
3
+ import { useQueryClient as U, QueryClient as Te, QueryClientProvider as Se, useQuery as C, useMutation as H, useQueries as te } from "@tanstack/react-query";
4
+ const Y = we(null), $e = "https://cdn.pitvox.com", Me = "https://pitvox.com";
5
5
  let z = null;
6
- function Br({
7
- partnerSlug: r,
8
- cdnUrl: n = Se,
9
- pitvoxUrl: s = $e,
6
+ function Ur({
7
+ partnerSlug: r = null,
8
+ cdnUrl: n = $e,
9
+ pitvoxUrl: s = Me,
10
10
  getSteamId: t,
11
- onRegister: i,
12
- onWithdraw: a,
11
+ onRegister: a,
12
+ onWithdraw: i,
13
13
  onFetchNotifications: o,
14
14
  onMarkNotificationRead: d,
15
- onMarkAllNotificationsRead: m,
15
+ onMarkAllNotificationsRead: u,
16
16
  onFetchServerPassword: c,
17
17
  children: v
18
18
  }) {
19
- const f = w(() => ({
19
+ const x = w(() => ({
20
20
  partnerSlug: r,
21
21
  cdnUrl: n.replace(/\/$/, ""),
22
22
  pitvoxUrl: s.replace(/\/$/, ""),
23
23
  getSteamId: t || (() => null),
24
- onRegister: i || null,
25
- onWithdraw: a || null,
24
+ onRegister: a || null,
25
+ onWithdraw: i || null,
26
26
  onFetchNotifications: o || null,
27
27
  onMarkNotificationRead: d || null,
28
- onMarkAllNotificationsRead: m || null,
28
+ onMarkAllNotificationsRead: u || null,
29
29
  onFetchServerPassword: c || null
30
- }), [r, n, s, t, i, a, o, d, m, c]);
31
- let g = !1;
30
+ }), [r, n, s, t, a, i, o, d, u, c]);
31
+ let N = !1;
32
32
  try {
33
- U(), g = !0;
33
+ U(), N = !0;
34
34
  } catch {
35
- g = !1;
35
+ N = !1;
36
36
  }
37
- return g ? /* @__PURE__ */ e(Y.Provider, { value: f, children: v }) : (z || (z = new Re({
37
+ return N ? /* @__PURE__ */ e(Y.Provider, { value: x, children: v }) : (z || (z = new Te({
38
38
  defaultOptions: {
39
39
  queries: { staleTime: 6e4 }
40
40
  }
41
- })), /* @__PURE__ */ e(Te, { client: z, children: /* @__PURE__ */ e(Y.Provider, { value: f, children: v }) }));
41
+ })), /* @__PURE__ */ e(Se, { client: z, children: /* @__PURE__ */ e(Y.Provider, { value: x, children: v }) }));
42
42
  }
43
43
  function k() {
44
- const r = we(Y);
44
+ const r = Ce(Y);
45
45
  if (!r)
46
46
  throw new Error("usePitVox must be used within a <PitVoxPartnerProvider>");
47
47
  return r;
48
48
  }
49
- async function T(r, n) {
49
+ async function R(r, n) {
50
50
  const s = await fetch(`${r}/${n}`);
51
51
  if (!s.ok) {
52
52
  if (s.status === 404 || s.status === 403) return null;
@@ -54,10 +54,19 @@ async function T(r, n) {
54
54
  }
55
55
  return s.json();
56
56
  }
57
+ function J(r, ...n) {
58
+ return [r ? `leaderboards/partners/${r}` : "leaderboards", ...n].join("/");
59
+ }
60
+ function Ie(r, n) {
61
+ return r ? `laps/partners/${r}/${n}.json` : `laps/${n}.json`;
62
+ }
63
+ function De(r) {
64
+ return r ? `recent-laps/partners/${r}.json` : "recent-laps.json";
65
+ }
57
66
  function B(r) {
58
67
  if (!r && r !== 0) return "-";
59
- const n = Math.floor(r / 1e3), s = Math.floor(n / 60), t = n % 60, i = r % 1e3;
60
- return `${s}:${String(t).padStart(2, "0")}.${String(i).padStart(3, "0")}`;
68
+ const n = Math.floor(r / 1e3), s = Math.floor(n / 60), t = n % 60, a = r % 1e3;
69
+ return `${s}:${String(t).padStart(2, "0")}.${String(a).padStart(3, "0")}`;
61
70
  }
62
71
  function D(r) {
63
72
  return !r && r !== 0 ? "-" : (r / 1e3).toFixed(3);
@@ -68,10 +77,11 @@ function I(r) {
68
77
  return n.startsWith("ks_") && (n = n.slice(3)), n.split("_").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" ");
69
78
  }
70
79
  function E(r, n, s) {
71
- const t = r.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" "), i = s === "acc" || !s && (n == null ? void 0 : n.toLowerCase()) === "track config";
72
- if (!n || n === "default" || i) return t;
73
- const a = n.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" ");
74
- return `${t} ${a}`;
80
+ if (!r) return "";
81
+ const t = r.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" "), a = s === "acc" || !s && (n == null ? void 0 : n.toLowerCase()) === "track config";
82
+ if (!n || n === "default" || a) return t;
83
+ const i = n.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" ");
84
+ return `${t} ${i}`;
75
85
  }
76
86
  function F(r) {
77
87
  if (!r) return "-";
@@ -85,25 +95,25 @@ function F(r) {
85
95
  return "-";
86
96
  }
87
97
  }
88
- function ae(r) {
98
+ function ie(r) {
89
99
  if (!r) return "";
90
100
  const n = Date.now() - new Date(r).getTime(), s = Math.floor(n / 1e3);
91
101
  if (s < 60) return "Just now";
92
102
  const t = Math.floor(s / 60);
93
103
  if (t < 60) return `${t}m ago`;
94
- const i = Math.floor(t / 60);
95
- if (i < 24) return `${i}h ago`;
96
- const a = Math.floor(i / 24);
97
- return a < 30 ? `${a}d ago` : F(r);
104
+ const a = Math.floor(t / 60);
105
+ if (a < 24) return `${a}h ago`;
106
+ const i = Math.floor(a / 24);
107
+ return i < 30 ? `${i}d ago` : F(r);
98
108
  }
99
- function Pr(r) {
109
+ function Er(r) {
100
110
  return r == null ? "" : `${r >= 0 ? "+" : "-"}${(Math.abs(r) / 1e3).toFixed(3)}`;
101
111
  }
102
- function Me(r, n) {
103
- const { type: s, title: t, trackId: i, trackLayout: a, carId: o, game: d, data: m } = r, c = typeof m == "string" ? JSON.parse(m) : m, v = i ? E(i, a, d) : null, f = o ? I(o) : null, g = [v, f].filter(Boolean).join(" — ");
104
- return s === "RECORD_BEATEN" && g ? `${c != null && c.beatenBySteamId && n ? n(c.beatenBySteamId).displayName : "Someone"} beat your record on ${g}` : s === "RECORD_SET" && g ? `You set a new record on ${g}` : t || "New notification";
112
+ function Be(r, n) {
113
+ const { type: s, title: t, trackId: a, trackLayout: i, carId: o, game: d, data: u } = r, c = typeof u == "string" ? JSON.parse(u) : u, v = a ? E(a, i, d) : null, x = o ? I(o) : null, N = [v, x].filter(Boolean).join(" — ");
114
+ return s === "RECORD_BEATEN" && N ? `${c != null && c.beatenBySteamId && n ? n(c.beatenBySteamId).displayName : "Someone"} beat your record on ${N}` : s === "RECORD_SET" && N ? `You set a new record on ${N}` : t || "New notification";
105
115
  }
106
- function ie(r) {
116
+ function oe(r) {
107
117
  return r ? {
108
118
  E: "Eco",
109
119
  RD: "Road",
@@ -117,114 +127,114 @@ function ie(r) {
117
127
  S: "Soft"
118
128
  }[r] || r : "Unknown";
119
129
  }
120
- function Ar(r = {}) {
121
- var d, m, c, v, f, g;
122
- const { cdnUrl: n, partnerSlug: s } = k(), { game: t, gameVersion: i } = r, a = L({
130
+ function Fr(r = {}) {
131
+ var u, c, v, x, N, p;
132
+ const { cdnUrl: n, partnerSlug: s } = k(), { game: t, gameVersion: a } = r, i = J(s, "index.json"), o = C({
123
133
  queryKey: ["pitvox", "leaderboards", s, "index"],
124
- queryFn: () => T(n, `leaderboards/partners/${s}/index.json`),
134
+ queryFn: () => R(n, i),
125
135
  staleTime: 3e4,
126
136
  refetchInterval: 3e4
127
- }), o = w(() => {
128
- var b;
129
- if (!((b = a.data) != null && b.tracks)) return [];
130
- let p = a.data.tracks;
131
- return t && (p = p.filter((u) => u.game === t)), i && (p = p.filter((u) => u.gameVersion === i)), p.map((u) => ({
132
- id: u.trackId,
133
- layout: u.layout,
134
- game: u.game,
135
- gameVersion: u.gameVersion,
136
- displayName: E(u.trackId, u.layout, u.game),
137
- driverCount: u.driverCount || 0,
138
- carCount: u.carCount || 0,
139
- record: u.recordHolder ? {
140
- visibleId: u.recordHolder.steamId || u.recordHolder.userId,
141
- carId: u.recordHolder.carId,
142
- carDisplayName: I(u.recordHolder.carId),
143
- lapTimeMs: u.recordHolder.lapTimeMs,
144
- timestamp: u.recordHolder.recordedAt
137
+ }), d = w(() => {
138
+ var g;
139
+ if (!((g = o.data) != null && g.tracks)) return [];
140
+ let b = o.data.tracks;
141
+ return t && (b = b.filter((m) => m.game === t)), a && (b = b.filter((m) => m.gameVersion === a)), b.map((m) => ({
142
+ id: m.trackId,
143
+ layout: m.layout,
144
+ game: m.game,
145
+ gameVersion: m.gameVersion,
146
+ displayName: E(m.trackId, m.layout, m.game),
147
+ driverCount: m.driverCount || 0,
148
+ carCount: m.carCount || 0,
149
+ record: m.recordHolder ? {
150
+ visibleId: m.recordHolder.steamId || m.recordHolder.userId,
151
+ carId: m.recordHolder.carId,
152
+ carDisplayName: I(m.recordHolder.carId),
153
+ lapTimeMs: m.recordHolder.lapTimeMs,
154
+ timestamp: m.recordHolder.recordedAt
145
155
  } : null,
146
- recordByTag: u.recordByTag || null
156
+ recordByTag: m.recordByTag || null
147
157
  }));
148
- }, [(d = a.data) == null ? void 0 : d.tracks, t, i]);
158
+ }, [(u = o.data) == null ? void 0 : u.tracks, t, a]);
149
159
  return {
150
- ...a,
151
- data: o,
152
- partner: ((m = a.data) == null ? void 0 : m.partner) || null,
153
- generatedAt: (c = a.data) == null ? void 0 : c.generatedAt,
154
- totalLaps: ((v = a.data) == null ? void 0 : v.totalLaps) || 0,
155
- totalUsers: ((f = a.data) == null ? void 0 : f.totalUsers) || 0,
156
- versions: ((g = a.data) == null ? void 0 : g.versions) || {}
160
+ ...o,
161
+ data: d,
162
+ partner: ((c = o.data) == null ? void 0 : c.partner) || null,
163
+ generatedAt: (v = o.data) == null ? void 0 : v.generatedAt,
164
+ totalLaps: ((x = o.data) == null ? void 0 : x.totalLaps) || 0,
165
+ totalUsers: ((N = o.data) == null ? void 0 : N.totalUsers) || 0,
166
+ versions: ((p = o.data) == null ? void 0 : p.versions) || {}
157
167
  };
158
168
  }
159
- function Ie(r, n, s = {}) {
160
- const { cdnUrl: t, partnerSlug: i } = k(), { carId: a, game: o, gameVersion: d } = s, m = n || "default", c = d ? `leaderboards/partners/${i}/v/${d}/tracks/${r}/${m}.json` : `leaderboards/partners/${i}/tracks/${r}/${m}.json`, { data: v, isLoading: f, error: g } = L({
161
- queryKey: ["pitvox", "leaderboards", i, "track", r, m, d],
162
- queryFn: () => T(t, c),
169
+ function Pe(r, n, s = {}) {
170
+ const { cdnUrl: t, partnerSlug: a } = k(), { carId: i, game: o, gameVersion: d } = s, u = n || "default", c = d ? `v/${d}/` : "", v = J(a, `${c}tracks/${r}/${u}.json`), { data: x, isLoading: N, error: p } = C({
171
+ queryKey: ["pitvox", "leaderboards", a, "track", r, u, d],
172
+ queryFn: () => R(t, v),
163
173
  enabled: !!r,
164
174
  staleTime: 3e4,
165
175
  refetchInterval: 3e4
166
176
  });
167
177
  return { data: w(() => {
168
- if (!(v != null && v.entries)) return [];
169
- let b = v.entries;
170
- if (o && (b = b.filter((u) => u.game === o)), !a) {
171
- const u = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map();
172
- for (const h of b) {
173
- const x = h.steamId || h.userId;
174
- N.has(h.carId) || N.set(h.carId, /* @__PURE__ */ new Set()), N.get(h.carId).add(x), (!u.has(h.carId) || h.lapTimeMs < u.get(h.carId).lapTimeMs) && u.set(h.carId, h);
178
+ if (!(x != null && x.entries)) return [];
179
+ let g = x.entries;
180
+ if (o && (g = g.filter((m) => m.game === o)), !i) {
181
+ const m = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
182
+ for (const h of g) {
183
+ const y = h.steamId || h.userId;
184
+ f.has(h.carId) || f.set(h.carId, /* @__PURE__ */ new Set()), f.get(h.carId).add(y), (!m.has(h.carId) || h.lapTimeMs < m.get(h.carId).lapTimeMs) && m.set(h.carId, h);
175
185
  }
176
- return Array.from(u.values()).map((h) => {
177
- var x;
178
- return { ...h, driverCount: ((x = N.get(h.carId)) == null ? void 0 : x.size) || 0 };
179
- }).sort((h, x) => h.lapTimeMs - x.lapTimeMs);
186
+ return Array.from(m.values()).map((h) => {
187
+ var y;
188
+ return { ...h, driverCount: ((y = f.get(h.carId)) == null ? void 0 : y.size) || 0 };
189
+ }).sort((h, y) => h.lapTimeMs - y.lapTimeMs);
180
190
  }
181
- return b.filter((u) => u.carId === a).sort((u, N) => u.lapTimeMs - N.lapTimeMs);
182
- }, [v == null ? void 0 : v.entries, a, o]), isLoading: f, error: g };
191
+ return g.filter((m) => m.carId === i).sort((m, f) => m.lapTimeMs - f.lapTimeMs);
192
+ }, [x == null ? void 0 : x.entries, i, o]), isLoading: N, error: p };
183
193
  }
184
- function De(r, n, s, t, i = {}) {
185
- var g, p;
186
- const { cdnUrl: a, partnerSlug: o } = k(), { showInvalid: d = !1, game: m, gameVersion: c } = i, v = L({
194
+ function Ae(r, n, s, t, a = {}) {
195
+ var p, b;
196
+ const { cdnUrl: i, partnerSlug: o } = k(), { showInvalid: d = !1, game: u, gameVersion: c } = a, v = Ie(o, r), x = C({
187
197
  queryKey: ["pitvox", "laps", o, r],
188
- queryFn: () => T(a, `laps/partners/${o}/${r}.json`),
198
+ queryFn: () => R(i, v),
189
199
  enabled: !!r,
190
200
  staleTime: 3e4,
191
201
  refetchInterval: 3e4
192
- }), f = w(() => {
193
- var b;
194
- return (b = v.data) != null && b.laps ? v.data.laps.filter((u) => {
195
- if (u.trackId !== n) return !1;
202
+ }), N = w(() => {
203
+ var g;
204
+ return (g = x.data) != null && g.laps ? x.data.laps.filter((m) => {
205
+ if (m.trackId !== n) return !1;
196
206
  if (s) {
197
- if (u.trackLayout !== s) return !1;
198
- } else if (u.trackLayout && u.trackLayout !== "default") return !1;
199
- return !(u.carId !== t || m && u.game !== m || c && u.gameVersion !== c || !d && !u.isValid);
200
- }).sort((u, N) => u.lapTimeMs - N.lapTimeMs) : [];
201
- }, [(g = v.data) == null ? void 0 : g.laps, n, s, t, m, c, d]);
207
+ if (m.trackLayout !== s) return !1;
208
+ } else if (m.trackLayout && m.trackLayout !== "default") return !1;
209
+ return !(m.carId !== t || u && m.game !== u || c && m.gameVersion !== c || !d && !m.isValid);
210
+ }).sort((m, f) => m.lapTimeMs - f.lapTimeMs) : [];
211
+ }, [(p = x.data) == null ? void 0 : p.laps, n, s, t, u, c, d]);
202
212
  return {
203
- ...v,
204
- data: f,
205
- driverName: ((p = v.data) == null ? void 0 : p.driverName) || "Driver"
213
+ ...x,
214
+ data: N,
215
+ driverName: ((b = x.data) == null ? void 0 : b.driverName) || "Driver"
206
216
  };
207
217
  }
208
- function oe() {
209
- const { cdnUrl: r } = k(), { data: n } = L({
218
+ function ce() {
219
+ const { cdnUrl: r } = k(), { data: n } = C({
210
220
  queryKey: ["pitvox", "users", "index"],
211
- queryFn: () => T(r, "users/index.json"),
221
+ queryFn: () => R(r, "users/index.json"),
212
222
  staleTime: 5 * 6e4,
213
223
  gcTime: 30 * 6e4
214
224
  }), s = (n == null ? void 0 : n.users) || {};
215
- return (t, i) => {
216
- const a = s[t];
225
+ return (t, a) => {
226
+ const i = s[t];
217
227
  return {
218
- displayName: (a == null ? void 0 : a.displayName) || i || t || "Unknown",
219
- avatarUrl: (a == null ? void 0 : a.avatarUrl) || null,
220
- affiliations: (a == null ? void 0 : a.affiliations) || []
228
+ displayName: (i == null ? void 0 : i.displayName) || a || t || "Unknown",
229
+ avatarUrl: (i == null ? void 0 : i.avatarUrl) || null,
230
+ affiliations: (i == null ? void 0 : i.affiliations) || []
221
231
  };
222
232
  };
223
233
  }
224
- function Ur() {
225
- const { cdnUrl: r } = k(), { data: n } = L({
234
+ function _r() {
235
+ const { cdnUrl: r } = k(), { data: n } = C({
226
236
  queryKey: ["pitvox", "cars", "index"],
227
- queryFn: () => T(r, "cars/index.json"),
237
+ queryFn: () => R(r, "cars/index.json"),
228
238
  staleTime: 5 * 6e4,
229
239
  gcTime: 30 * 6e4
230
240
  });
@@ -233,86 +243,101 @@ function Ur() {
233
243
  cars: (n == null ? void 0 : n.cars) || {}
234
244
  };
235
245
  }
236
- function Er(r, n) {
237
- return Ie(r, null, { carId: n });
246
+ function qr() {
247
+ var a, i;
248
+ const { cdnUrl: r, partnerSlug: n } = k(), s = De(n), t = C({
249
+ queryKey: ["pitvox", "recentLaps", n],
250
+ queryFn: () => R(r, s),
251
+ staleTime: 3e4,
252
+ refetchInterval: 3e4,
253
+ gcTime: 10 * 6e4
254
+ });
255
+ return {
256
+ groups: ((a = t.data) == null ? void 0 : a.groups) || [],
257
+ generatedAt: ((i = t.data) == null ? void 0 : i.generatedAt) || null,
258
+ isLoading: t.isLoading
259
+ };
260
+ }
261
+ function jr(r, n) {
262
+ return Pe(r, null, { carId: n });
238
263
  }
239
- function Fr() {
264
+ function Vr() {
240
265
  const { cdnUrl: r, partnerSlug: n } = k();
241
- return L({
266
+ return C({
242
267
  queryKey: ["pitvox", "competitions", n],
243
268
  queryFn: async () => {
244
- const s = await T(r, "competitions/index.json");
245
- return s != null && s.competitions ? s.competitions.filter((t) => t.partnerSlug === n) : [];
269
+ const s = await R(r, "competitions/index.json");
270
+ return s != null && s.competitions ? n ? s.competitions.filter((t) => t.partnerSlug === n) : s.competitions : [];
246
271
  },
247
272
  staleTime: 6e4
248
273
  });
249
274
  }
250
- function Be(r) {
251
- const { cdnUrl: n, partnerSlug: s } = k();
252
- return L({
253
- queryKey: ["pitvox", "competition", s, r, "config"],
254
- queryFn: () => T(n, `competitions/${s}/${r}/config.json`),
255
- enabled: !!r,
275
+ function Ue(r, n = {}) {
276
+ const s = k(), t = n.partnerSlug || s.partnerSlug;
277
+ return C({
278
+ queryKey: ["pitvox", "competition", t, r, "config"],
279
+ queryFn: () => R(s.cdnUrl, `competitions/${t}/${r}/config.json`),
280
+ enabled: !!t && !!r,
256
281
  staleTime: 6e4
257
282
  });
258
283
  }
259
- function Pe(r) {
260
- const { cdnUrl: n, partnerSlug: s } = k();
261
- return L({
262
- queryKey: ["pitvox", "competition", s, r, "standings"],
263
- queryFn: () => T(n, `competitions/${s}/${r}/standings.json`),
264
- enabled: !!r,
284
+ function Ee(r, n = {}) {
285
+ const s = k(), t = n.partnerSlug || s.partnerSlug;
286
+ return C({
287
+ queryKey: ["pitvox", "competition", t, r, "standings"],
288
+ queryFn: () => R(s.cdnUrl, `competitions/${t}/${r}/standings.json`),
289
+ enabled: !!t && !!r,
265
290
  staleTime: 6e4
266
291
  });
267
292
  }
268
- function Ae(r, n) {
269
- const { cdnUrl: s, partnerSlug: t } = k();
270
- return L({
271
- queryKey: ["pitvox", "competition", t, r, "round", n],
272
- queryFn: () => T(s, `competitions/${t}/${r}/rounds/${n}.json`),
273
- enabled: !!r && n != null,
293
+ function Fe(r, n, s = {}) {
294
+ const t = k(), a = s.partnerSlug || t.partnerSlug;
295
+ return C({
296
+ queryKey: ["pitvox", "competition", a, r, "round", n],
297
+ queryFn: () => R(t.cdnUrl, `competitions/${a}/${r}/rounds/${n}.json`),
298
+ enabled: !!a && !!r && n != null,
274
299
  staleTime: 6e4
275
300
  });
276
301
  }
277
- function _r(r, n = []) {
278
- const { cdnUrl: s, partnerSlug: t } = k();
279
- return L({
280
- queryKey: ["pitvox", "competition", t, r, "allRounds", n],
302
+ function Kr(r, n = [], s = {}) {
303
+ const t = k(), a = s.partnerSlug || t.partnerSlug;
304
+ return C({
305
+ queryKey: ["pitvox", "competition", a, r, "allRounds", n],
281
306
  queryFn: async () => (await Promise.all(
282
307
  n.map(
283
- (a) => T(s, `competitions/${t}/${r}/rounds/${a}.json`).catch(() => null)
308
+ (o) => R(t.cdnUrl, `competitions/${a}/${r}/rounds/${o}.json`).catch(() => null)
284
309
  )
285
310
  )).filter(Boolean),
286
- enabled: !!r && n.length > 0,
311
+ enabled: !!a && !!r && n.length > 0,
287
312
  staleTime: 6e4
288
313
  });
289
314
  }
290
- function ce(r) {
291
- const { cdnUrl: n, partnerSlug: s } = k();
292
- return L({
293
- queryKey: ["pitvox", "competition", s, r, "entrylist"],
294
- queryFn: () => T(n, `competitions/${s}/${r}/entrylist.json`),
295
- enabled: !!r,
315
+ function le(r, n = {}) {
316
+ const s = k(), t = n.partnerSlug || s.partnerSlug;
317
+ return C({
318
+ queryKey: ["pitvox", "competition", t, r, "entrylist"],
319
+ queryFn: () => R(s.cdnUrl, `competitions/${t}/${r}/entrylist.json`),
320
+ enabled: !!t && !!r,
296
321
  staleTime: 6e4
297
322
  });
298
323
  }
299
- function J(r) {
300
- const { cdnUrl: n, partnerSlug: s, getSteamId: t } = k(), i = t();
301
- return L({
302
- queryKey: ["pitvox", "registration", s, r, i],
324
+ function Z(r) {
325
+ const { cdnUrl: n, partnerSlug: s, getSteamId: t } = k(), a = t();
326
+ return C({
327
+ queryKey: ["pitvox", "registration", s, r, a],
303
328
  queryFn: async () => {
304
- var m;
305
- const a = await fetch(`${n}/competitions/${s}/${r}/entrylist.json`);
306
- if (!a.ok) return { isRegistered: !1, entryList: null };
307
- const o = await a.json();
308
- return { isRegistered: !!i && ((m = o.drivers) == null ? void 0 : m.some((c) => c.steamId === i)), entryList: o };
329
+ var u;
330
+ const i = await fetch(`${n}/competitions/${s}/${r}/entrylist.json`);
331
+ if (!i.ok) return { isRegistered: !1, entryList: null };
332
+ const o = await i.json();
333
+ return { isRegistered: !!a && ((u = o.drivers) == null ? void 0 : u.some((c) => c.steamId === a)), entryList: o };
309
334
  },
310
335
  enabled: !!r,
311
336
  staleTime: 6e4
312
337
  });
313
338
  }
314
- function le(r) {
315
- const { onRegister: n, partnerSlug: s, getSteamId: t } = k(), i = U(), a = oe();
339
+ function de(r) {
340
+ const { onRegister: n, partnerSlug: s, getSteamId: t } = k(), a = U(), i = ce();
316
341
  return H({
317
342
  mutationFn: (o) => {
318
343
  if (!n)
@@ -323,59 +348,59 @@ function le(r) {
323
348
  },
324
349
  onSuccess: () => {
325
350
  const o = t();
326
- if (i.setQueriesData(
351
+ if (a.setQueriesData(
327
352
  { queryKey: ["pitvox", "registration", s, r] },
328
353
  (d) => d ? { ...d, isRegistered: !0 } : { isRegistered: !0, entryList: null }
329
354
  ), o) {
330
- const d = a(o), m = {
355
+ const d = i(o), u = {
331
356
  steamId: o,
332
357
  displayName: d.displayName,
333
358
  avatarUrl: d.avatarUrl
334
359
  };
335
- i.setQueriesData(
360
+ a.setQueriesData(
336
361
  { queryKey: ["pitvox", "competition", s, r, "entrylist"] },
337
362
  (c) => {
338
- var f;
339
- return c ? ((f = c.drivers) == null ? void 0 : f.some((g) => g.steamId === o)) ? c : { ...c, drivers: [...c.drivers || [], m] } : { drivers: [m] };
363
+ var x;
364
+ return c ? ((x = c.drivers) == null ? void 0 : x.some((N) => N.steamId === o)) ? c : { ...c, drivers: [...c.drivers || [], u] } : { drivers: [u] };
340
365
  }
341
366
  );
342
367
  }
343
368
  }
344
369
  });
345
370
  }
346
- function de(r) {
347
- const { onWithdraw: n, partnerSlug: s, getSteamId: t } = k(), i = U();
371
+ function pe(r) {
372
+ const { onWithdraw: n, partnerSlug: s, getSteamId: t } = k(), a = U();
348
373
  return H({
349
- mutationFn: (a) => {
374
+ mutationFn: (i) => {
350
375
  if (!n)
351
376
  throw new Error(
352
377
  "No onWithdraw callback provided to PitVoxPartnerProvider. Provide onWithdraw for in-app withdrawal, or use useRegistrationUrl() to link to pitvox.com."
353
378
  );
354
- const o = a || t();
379
+ const o = i || t();
355
380
  if (!o) throw new Error("No Steam ID available");
356
381
  return n(r, o);
357
382
  },
358
383
  onSuccess: () => {
359
- const a = t();
360
- i.setQueriesData(
384
+ const i = t();
385
+ a.setQueriesData(
361
386
  { queryKey: ["pitvox", "registration", s, r] },
362
387
  (o) => o ? { ...o, isRegistered: !1 } : { isRegistered: !1, entryList: null }
363
- ), a && i.setQueriesData(
388
+ ), i && a.setQueriesData(
364
389
  { queryKey: ["pitvox", "competition", s, r, "entrylist"] },
365
- (o) => o != null && o.drivers ? { ...o, drivers: o.drivers.filter((d) => d.steamId !== a) } : o
390
+ (o) => o != null && o.drivers ? { ...o, drivers: o.drivers.filter((d) => d.steamId !== i) } : o
366
391
  );
367
392
  }
368
393
  });
369
394
  }
370
- function Z() {
395
+ function X() {
371
396
  const { onRegister: r, onWithdraw: n } = k(), s = !!(r && n);
372
397
  return { isPowerMode: s, isBasicMode: !s };
373
398
  }
374
- function X(r) {
399
+ function ee(r) {
375
400
  const { pitvoxUrl: n, partnerSlug: s } = k();
376
401
  return `${n}/p/${s}/competitions/${r}/register`;
377
402
  }
378
- const Ue = {
403
+ const _e = {
379
404
  formula: "Formula",
380
405
  gt3: "GT3",
381
406
  gt2: "GT2",
@@ -395,55 +420,55 @@ const Ue = {
395
420
  "2000s": "2000s",
396
421
  "2010s": "2010s",
397
422
  "2020s": "2020s"
398
- }, pe = [
423
+ }, ue = [
399
424
  { id: "class", tags: ["formula", "gt3", "gt2", "gt4", "cup", "prototype", "rally"] },
400
425
  { id: "tier", tags: ["hypercar", "supercar", "sports_car", "hot_hatch", "lightweight"] },
401
426
  { id: "era", tags: ["1960s", "1970s", "1980s", "1990s", "2000s", "2010s", "2020s"] }
402
427
  ];
403
- function Ee(r) {
404
- for (const n of pe)
428
+ function qe(r) {
429
+ for (const n of ue)
405
430
  if (n.tags.includes(r)) return n.id;
406
431
  return "other";
407
432
  }
408
- function ue(r, n) {
433
+ function me(r, n) {
409
434
  if (n.size === 0) return !0;
410
435
  const s = {};
411
436
  for (const t of n) {
412
- const i = Ee(t);
413
- s[i] || (s[i] = []), s[i].push(t);
437
+ const a = qe(t);
438
+ s[a] || (s[a] = []), s[a].push(t);
414
439
  }
415
440
  for (const t of Object.values(s))
416
- if (!t.some((i) => r.includes(i))) return !1;
441
+ if (!t.some((a) => r.includes(a))) return !1;
417
442
  return !0;
418
443
  }
419
- function me(r, n) {
420
- const [s, t] = M(/* @__PURE__ */ new Set()), i = r !== void 0, a = i ? r : s, o = K((m) => {
421
- const c = new Set(a);
422
- c.has(m) ? c.delete(m) : c.add(m), i && n ? n(c) : t(c);
423
- }, [a, i, n]), d = K(() => {
424
- i && n ? n(/* @__PURE__ */ new Set()) : t(/* @__PURE__ */ new Set());
425
- }, [i, n]);
426
- return { activeTags: a, toggle: o, clear: d };
444
+ function ve(r, n) {
445
+ const [s, t] = M(/* @__PURE__ */ new Set()), a = r !== void 0, i = a ? r : s, o = K((u) => {
446
+ const c = new Set(i);
447
+ c.has(u) ? c.delete(u) : c.add(u), a && n ? n(c) : t(c);
448
+ }, [i, a, n]), d = K(() => {
449
+ a && n ? n(/* @__PURE__ */ new Set()) : t(/* @__PURE__ */ new Set());
450
+ }, [a, n]);
451
+ return { activeTags: i, toggle: o, clear: d };
427
452
  }
428
453
  function W(r) {
429
- const [n, s] = M(r), t = K((i) => {
454
+ const [n, s] = M(r), t = K((a) => {
430
455
  s(
431
- (a) => a.key === i ? { key: i, dir: a.dir === "asc" ? "desc" : "asc" } : { key: i, dir: i.includes("timestamp") || i.includes("Date") ? "desc" : "asc" }
456
+ (i) => i.key === a ? { key: a, dir: i.dir === "asc" ? "desc" : "asc" } : { key: a, dir: a.includes("timestamp") || a.includes("Date") ? "desc" : "asc" }
432
457
  );
433
458
  }, []);
434
459
  return [n, t];
435
460
  }
436
461
  function O(r, n, s) {
437
- return [...r].sort((t, i) => {
438
- const a = s(t, n.key), o = s(i, n.key);
439
- if (a == null && o == null) return 0;
440
- if (a == null) return 1;
462
+ return [...r].sort((t, a) => {
463
+ const i = s(t, n.key), o = s(a, n.key);
464
+ if (i == null && o == null) return 0;
465
+ if (i == null) return 1;
441
466
  if (o == null) return -1;
442
- const d = typeof a == "string" ? a.localeCompare(o) : a - o;
467
+ const d = typeof i == "string" ? i.localeCompare(o) : i - o;
443
468
  return n.dir === "desc" ? -d : d;
444
469
  });
445
470
  }
446
- function ve(r, n = !1) {
471
+ function he(r, n = !1) {
447
472
  const s = n ? r == null ? void 0 : r.filter((t) => t.isValid) : r;
448
473
  return s != null && s.length ? {
449
474
  s1: Math.min(...s.map((t) => t.sector1Ms).filter(Boolean)),
@@ -451,18 +476,18 @@ function ve(r, n = !1) {
451
476
  s3: Math.min(...s.map((t) => t.sector3Ms).filter(Boolean))
452
477
  } : null;
453
478
  }
454
- function Fe({ active: r, dir: n }) {
479
+ function je({ active: r, dir: n }) {
455
480
  return r ? n === "asc" ? /* @__PURE__ */ e("svg", { className: "pvx-sort-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 15.75l7.5-7.5 7.5 7.5" }) }) : /* @__PURE__ */ e("svg", { className: "pvx-sort-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" }) }) : /* @__PURE__ */ e("svg", { className: "pvx-sort-icon pvx-sort-icon--inactive", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 9l4-4 4 4M16 15l-4 4-4-4" }) });
456
481
  }
457
- function R({ label: r, sortKey: n, config: s, onSort: t, className: i = "" }) {
482
+ function T({ label: r, sortKey: n, config: s, onSort: t, className: a = "" }) {
458
483
  return /* @__PURE__ */ e(
459
484
  "th",
460
485
  {
461
- className: `pvx-th pvx-th--sortable ${i}`,
486
+ className: `pvx-th pvx-th--sortable ${a}`,
462
487
  onClick: () => t(n),
463
488
  children: /* @__PURE__ */ l("span", { className: "pvx-th-inner", children: [
464
489
  r,
465
- /* @__PURE__ */ e(Fe, { active: s.key === n, dir: s.dir })
490
+ /* @__PURE__ */ e(je, { active: s.key === n, dir: s.dir })
466
491
  ] })
467
492
  }
468
493
  );
@@ -474,12 +499,12 @@ function G({ userId: r, getUserDisplay: n }) {
474
499
  /* @__PURE__ */ e("span", { className: "pvx-driver-name", children: s })
475
500
  ] });
476
501
  }
477
- function ee({ rank: r, podium: n = !1 }) {
502
+ function re({ rank: r, podium: n = !1 }) {
478
503
  return /* @__PURE__ */ e("span", { className: n ? r === 1 ? "pvx-rank pvx-rank--gold" : r === 2 ? "pvx-rank pvx-rank--silver" : r === 3 ? "pvx-rank pvx-rank--bronze" : "pvx-rank" : "pvx-rank", children: r });
479
504
  }
480
- function he({ availableTags: r, activeTags: n, onToggle: s, onClear: t }) {
505
+ function xe({ availableTags: r, activeTags: n, onToggle: s, onClear: t }) {
481
506
  if (!r || r.length < 2) return null;
482
- const i = pe.map((a) => ({ id: a.id, tags: a.tags.filter((o) => r.includes(o)) })).filter((a) => a.tags.length > 0);
507
+ const a = ue.map((i) => ({ id: i.id, tags: i.tags.filter((o) => r.includes(o)) })).filter((i) => i.tags.length > 0);
483
508
  return /* @__PURE__ */ l("div", { className: "pvx-tag-bar", children: [
484
509
  /* @__PURE__ */ e(
485
510
  "button",
@@ -489,21 +514,21 @@ function he({ availableTags: r, activeTags: n, onToggle: s, onClear: t }) {
489
514
  children: "All"
490
515
  }
491
516
  ),
492
- i.map((a, o) => /* @__PURE__ */ l("span", { className: "contents", children: [
517
+ a.map((i, o) => /* @__PURE__ */ l("span", { className: "contents", children: [
493
518
  o > 0 && /* @__PURE__ */ e("span", { className: "pvx-tag-separator" }),
494
- a.tags.map((d) => /* @__PURE__ */ e(
519
+ i.tags.map((d) => /* @__PURE__ */ e(
495
520
  "button",
496
521
  {
497
522
  onClick: () => s(d),
498
523
  className: `pvx-tag ${n.has(d) ? "pvx-tag--active" : ""}`,
499
- children: Ue[d] || d
524
+ children: _e[d] || d
500
525
  },
501
526
  d
502
527
  ))
503
- ] }, a.id))
528
+ ] }, i.id))
504
529
  ] });
505
530
  }
506
- function re({ segments: r }) {
531
+ function ne({ segments: r }) {
507
532
  return /* @__PURE__ */ e("nav", { className: "pvx-breadcrumb", "aria-label": "Breadcrumb", children: /* @__PURE__ */ e("ol", { className: "pvx-breadcrumb-list", children: r.map((n, s) => {
508
533
  const t = s === r.length - 1;
509
534
  return /* @__PURE__ */ l("li", { className: "pvx-breadcrumb-item", children: [
@@ -521,221 +546,221 @@ function _({ message: r }) {
521
546
  function q() {
522
547
  return /* @__PURE__ */ e("div", { className: "pvx-loading", children: "Loading..." });
523
548
  }
524
- function _e() {
549
+ function Ve() {
525
550
  return /* @__PURE__ */ e("svg", { className: "pvx-icon pvx-icon--valid", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 12.75l6 6 9-13.5" }) });
526
551
  }
527
- function qe() {
552
+ function Ke() {
528
553
  return /* @__PURE__ */ e("svg", { className: "pvx-icon pvx-icon--invalid", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) });
529
554
  }
530
- function qr({ tracks: r, isLoading: n, carMetadata: s, getUserDisplay: t, onTrackSelect: i, tags: a, onTagChange: o }) {
531
- const [d, m] = W({ key: "record.timestamp", dir: "desc" }), { activeTags: c, toggle: v, clear: f } = me(a, o), g = w(() => {
532
- var N;
533
- if (!((N = s == null ? void 0 : s.tags) != null && N.length)) return [];
534
- const u = /* @__PURE__ */ new Set();
535
- for (const h of r || [])
536
- h.recordByTag && Object.keys(h.recordByTag).forEach((x) => u.add(x));
537
- return s.tags.filter((h) => u.has(h));
538
- }, [r, s]), p = w(() => r ? c.size === 0 ? r : r.map((u) => {
539
- var x, y;
540
- if (!u.recordByTag) return null;
541
- let N = null;
542
- const h = /* @__PURE__ */ new Set();
543
- for (const C of Object.values(u.recordByTag)) {
544
- if (h.has(C.carId)) continue;
545
- h.add(C.carId);
546
- const $ = ((y = (x = s == null ? void 0 : s.cars) == null ? void 0 : x[C.carId]) == null ? void 0 : y.tags) || ["sports_car"];
547
- ue($, c) && (!N || C.lapTimeMs < N.lapTimeMs) && (N = C);
555
+ function Hr({ tracks: r, isLoading: n, carMetadata: s, getUserDisplay: t, onTrackSelect: a, tags: i, onTagChange: o }) {
556
+ const [d, u] = W({ key: "record.timestamp", dir: "desc" }), { activeTags: c, toggle: v, clear: x } = ve(i, o), N = w(() => {
557
+ var m;
558
+ if (!((m = s == null ? void 0 : s.tags) != null && m.length)) return [];
559
+ const g = /* @__PURE__ */ new Set();
560
+ for (const f of r || [])
561
+ f.recordByTag && Object.keys(f.recordByTag).forEach((h) => g.add(h));
562
+ return s.tags.filter((f) => g.has(f));
563
+ }, [r, s]), p = w(() => r ? c.size === 0 ? r : r.map((g) => {
564
+ var h, y;
565
+ if (!g.recordByTag) return null;
566
+ let m = null;
567
+ const f = /* @__PURE__ */ new Set();
568
+ for (const L of Object.values(g.recordByTag)) {
569
+ if (f.has(L.carId)) continue;
570
+ f.add(L.carId);
571
+ const $ = ((y = (h = s == null ? void 0 : s.cars) == null ? void 0 : h[L.carId]) == null ? void 0 : y.tags) || ["sports_car"];
572
+ me($, c) && (!m || L.lapTimeMs < m.lapTimeMs) && (m = L);
548
573
  }
549
- return N ? {
550
- ...u,
574
+ return m ? {
575
+ ...g,
551
576
  record: {
552
- visibleId: N.steamId || N.identifier,
553
- carId: N.carId,
554
- carDisplayName: I(N.carId),
555
- lapTimeMs: N.lapTimeMs,
556
- timestamp: N.recordedAt
577
+ visibleId: m.steamId || m.identifier,
578
+ carId: m.carId,
579
+ carDisplayName: I(m.carId),
580
+ lapTimeMs: m.lapTimeMs,
581
+ timestamp: m.recordedAt
557
582
  }
558
583
  } : null;
559
- }).filter(Boolean) : [], [r, c, s]), b = w(() => O(p, d, (u, N) => {
560
- var h, x;
561
- switch (N) {
584
+ }).filter(Boolean) : [], [r, c, s]), b = w(() => O(p, d, (g, m) => {
585
+ var f, h;
586
+ switch (m) {
562
587
  case "displayName":
563
- return u.displayName;
588
+ return g.displayName;
564
589
  case "record.lapTimeMs":
565
- return (h = u.record) == null ? void 0 : h.lapTimeMs;
590
+ return (f = g.record) == null ? void 0 : f.lapTimeMs;
566
591
  case "driverCount":
567
- return u.driverCount || 0;
592
+ return g.driverCount || 0;
568
593
  case "carCount":
569
- return u.carCount || 0;
594
+ return g.carCount || 0;
570
595
  case "record.timestamp":
571
596
  default:
572
- return (x = u.record) != null && x.timestamp ? new Date(u.record.timestamp).getTime() : 0;
597
+ return (h = g.record) != null && h.timestamp ? new Date(g.record.timestamp).getTime() : 0;
573
598
  }
574
599
  }), [p, d]);
575
600
  return n ? /* @__PURE__ */ e(q, {}) : r != null && r.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
576
601
  /* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ e("h2", { className: "pvx-card-title", children: "Track Records" }) }),
577
- /* @__PURE__ */ e(he, { availableTags: g, activeTags: c, onToggle: v, onClear: f }),
602
+ /* @__PURE__ */ e(xe, { availableTags: N, activeTags: c, onToggle: v, onClear: x }),
578
603
  /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
579
604
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
580
- /* @__PURE__ */ e(R, { label: "Track", sortKey: "displayName", config: d, onSort: m }),
605
+ /* @__PURE__ */ e(T, { label: "Track", sortKey: "displayName", config: d, onSort: u }),
581
606
  /* @__PURE__ */ e("th", { className: "pvx-th", children: "Record Holder" }),
582
607
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-lg", children: "Car" }),
583
- /* @__PURE__ */ e(R, { label: "Lap Time", sortKey: "record.lapTimeMs", config: d, onSort: m }),
584
- /* @__PURE__ */ e(R, { label: "Drivers", sortKey: "driverCount", config: d, onSort: m, className: "pvx-hidden-below-md" }),
585
- /* @__PURE__ */ e(R, { label: "Cars", sortKey: "carCount", config: d, onSort: m, className: "pvx-hidden-below-lg" }),
586
- /* @__PURE__ */ e(R, { label: "Date", sortKey: "record.timestamp", config: d, onSort: m, className: "pvx-hidden-below-xl" })
608
+ /* @__PURE__ */ e(T, { label: "Lap Time", sortKey: "record.lapTimeMs", config: d, onSort: u }),
609
+ /* @__PURE__ */ e(T, { label: "Drivers", sortKey: "driverCount", config: d, onSort: u, className: "pvx-hidden-below-md" }),
610
+ /* @__PURE__ */ e(T, { label: "Cars", sortKey: "carCount", config: d, onSort: u, className: "pvx-hidden-below-lg" }),
611
+ /* @__PURE__ */ e(T, { label: "Date", sortKey: "record.timestamp", config: d, onSort: u, className: "pvx-hidden-below-xl" })
587
612
  ] }) }),
588
- /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: b.map((u) => {
589
- var N, h, x;
613
+ /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: b.map((g) => {
614
+ var m, f, h;
590
615
  return /* @__PURE__ */ l(
591
616
  "tr",
592
617
  {
593
618
  className: "pvx-row pvx-row--clickable",
594
- onClick: () => i(u.id, u.layout),
619
+ onClick: () => a(g.id, g.layout),
595
620
  children: [
596
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary", children: u.displayName }),
597
- /* @__PURE__ */ e("td", { className: "pvx-td", children: (N = u.record) != null && N.visibleId ? /* @__PURE__ */ e(G, { userId: u.record.visibleId, getUserDisplay: t }) : "-" }),
598
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-hidden-below-lg", children: ((h = u.record) == null ? void 0 : h.carDisplayName) || "-" }),
599
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: u.record ? B(u.record.lapTimeMs) : "-" }),
600
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: u.driverCount || "-" }),
601
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: u.carCount || "-" }),
602
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: (x = u.record) != null && x.timestamp ? F(u.record.timestamp) : "-" })
621
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary", children: g.displayName }),
622
+ /* @__PURE__ */ e("td", { className: "pvx-td", children: (m = g.record) != null && m.visibleId ? /* @__PURE__ */ e(G, { userId: g.record.visibleId, getUserDisplay: t }) : "-" }),
623
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-hidden-below-lg", children: ((f = g.record) == null ? void 0 : f.carDisplayName) || "-" }),
624
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: g.record ? B(g.record.lapTimeMs) : "-" }),
625
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: g.driverCount || "-" }),
626
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: g.carCount || "-" }),
627
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: (h = g.record) != null && h.timestamp ? F(g.record.timestamp) : "-" })
603
628
  ]
604
629
  },
605
- `${u.id}|${u.layout || ""}`
630
+ `${g.id}|${g.layout || ""}`
606
631
  );
607
632
  }) })
608
633
  ] }) })
609
634
  ] }) : /* @__PURE__ */ e(_, { message: "No lap times recorded yet." });
610
635
  }
611
- function jr({ entries: r, isLoading: n, track: s, carMetadata: t, getUserDisplay: i, onCarSelect: a, onNavigate: o, tags: d, onTagChange: m }) {
612
- const [c, v] = W({ key: "lapTimeMs", dir: "asc" }), { activeTags: f, toggle: g, clear: p } = me(d, m), b = w(() => {
613
- var y, C, $;
636
+ function Wr({ entries: r, isLoading: n, track: s, carMetadata: t, getUserDisplay: a, onCarSelect: i, onNavigate: o, tags: d, onTagChange: u }) {
637
+ const [c, v] = W({ key: "lapTimeMs", dir: "asc" }), { activeTags: x, toggle: N, clear: p } = ve(d, u), b = w(() => {
638
+ var y, L, $;
614
639
  if (!r || !((y = t == null ? void 0 : t.tags) != null && y.length)) return [];
615
- const x = /* @__PURE__ */ new Set();
640
+ const h = /* @__PURE__ */ new Set();
616
641
  for (const S of r)
617
- ((($ = (C = t.cars) == null ? void 0 : C[S.carId]) == null ? void 0 : $.tags) || ["sports_car"]).forEach((ye) => x.add(ye));
618
- return t.tags.filter((S) => x.has(S));
619
- }, [r, t]), u = w(() => r ? f.size === 0 ? r : r.filter((x) => {
620
- var C, $;
621
- const y = (($ = (C = t == null ? void 0 : t.cars) == null ? void 0 : C[x.carId]) == null ? void 0 : $.tags) || ["sports_car"];
622
- return ue(y, f);
623
- }) : [], [r, f, t]), N = w(() => O(u, c, (x, y) => {
642
+ ((($ = (L = t.cars) == null ? void 0 : L[S.carId]) == null ? void 0 : $.tags) || ["sports_car"]).forEach((ke) => h.add(ke));
643
+ return t.tags.filter((S) => h.has(S));
644
+ }, [r, t]), g = w(() => r ? x.size === 0 ? r : r.filter((h) => {
645
+ var L, $;
646
+ const y = (($ = (L = t == null ? void 0 : t.cars) == null ? void 0 : L[h.carId]) == null ? void 0 : $.tags) || ["sports_car"];
647
+ return me(y, x);
648
+ }) : [], [r, x, t]), m = w(() => O(g, c, (h, y) => {
624
649
  switch (y) {
625
650
  case "carId":
626
- return I(x.carId);
651
+ return I(h.carId);
627
652
  case "driverCount":
628
- return x.driverCount || 0;
653
+ return h.driverCount || 0;
629
654
  case "lapTimeMs":
630
655
  default:
631
- return x.lapTimeMs;
656
+ return h.lapTimeMs;
632
657
  }
633
- }), [u, c]), h = [
658
+ }), [g, c]), f = [
634
659
  { key: "tracks", label: "Tracks", onClick: () => o("tracks") },
635
660
  { key: "track", label: s.displayName }
636
661
  ];
637
662
  return n ? /* @__PURE__ */ e(q, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
638
- /* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ e(re, { segments: h }) }),
639
- /* @__PURE__ */ e(he, { availableTags: b, activeTags: f, onToggle: g, onClear: p }),
663
+ /* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ e(ne, { segments: f }) }),
664
+ /* @__PURE__ */ e(xe, { availableTags: b, activeTags: x, onToggle: N, onClear: p }),
640
665
  r != null && r.length ? /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
641
666
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
642
667
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
643
- /* @__PURE__ */ e(R, { label: "Car", sortKey: "carId", config: c, onSort: v }),
668
+ /* @__PURE__ */ e(T, { label: "Car", sortKey: "carId", config: c, onSort: v }),
644
669
  /* @__PURE__ */ e("th", { className: "pvx-th", children: "Record Holder" }),
645
- /* @__PURE__ */ e(R, { label: "Lap Time", sortKey: "lapTimeMs", config: c, onSort: v }),
646
- /* @__PURE__ */ e(R, { label: "Drivers", sortKey: "driverCount", config: c, onSort: v, className: "pvx-hidden-below-md" }),
670
+ /* @__PURE__ */ e(T, { label: "Lap Time", sortKey: "lapTimeMs", config: c, onSort: v }),
671
+ /* @__PURE__ */ e(T, { label: "Drivers", sortKey: "driverCount", config: c, onSort: v, className: "pvx-hidden-below-md" }),
647
672
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-lg", children: "Date" })
648
673
  ] }) }),
649
- /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: N.map((x, y) => /* @__PURE__ */ l(
674
+ /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: m.map((h, y) => /* @__PURE__ */ l(
650
675
  "tr",
651
676
  {
652
677
  className: "pvx-row pvx-row--clickable",
653
- onClick: () => a(x.carId),
678
+ onClick: () => i(h.carId),
654
679
  children: [
655
- /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(ee, { rank: y + 1, podium: !0 }) }),
656
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary", children: I(x.carId) }),
657
- /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(G, { userId: x.steamId || x.userId, getUserDisplay: i }) }),
658
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: B(x.lapTimeMs) }),
659
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: x.driverCount || "-" }),
660
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-lg", children: x.recordedAt ? F(x.recordedAt) : "-" })
680
+ /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(re, { rank: y + 1, podium: !0 }) }),
681
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary", children: I(h.carId) }),
682
+ /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(G, { userId: h.steamId || h.userId, getUserDisplay: a }) }),
683
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: B(h.lapTimeMs) }),
684
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: h.driverCount || "-" }),
685
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-lg", children: h.recordedAt ? F(h.recordedAt) : "-" })
661
686
  ]
662
687
  },
663
- x.carId
688
+ h.carId
664
689
  )) })
665
690
  ] }) }) : /* @__PURE__ */ e(_, { message: "No lap times for this track yet." })
666
691
  ] });
667
692
  }
668
- function Vr({ entries: r, isLoading: n, track: s, carId: t, getUserDisplay: i, onDriverSelect: a, onNavigate: o, highlightId: d }) {
669
- const [m, c] = W({ key: "lapTimeMs", dir: "asc" }), v = w(() => ve(r), [r]), f = w(() => O(r || [], m, (p, b) => {
693
+ function Or({ entries: r, isLoading: n, track: s, carId: t, getUserDisplay: a, onDriverSelect: i, onNavigate: o, highlightId: d }) {
694
+ const [u, c] = W({ key: "lapTimeMs", dir: "asc" }), v = w(() => he(r), [r]), x = w(() => O(r || [], u, (p, b) => {
670
695
  switch (b) {
671
696
  case "userId":
672
- return i(p.steamId || p.userId).displayName;
697
+ return a(p.steamId || p.userId).displayName;
673
698
  case "lapCount":
674
699
  return p.lapCount || 0;
675
700
  case "lapTimeMs":
676
701
  default:
677
702
  return p.lapTimeMs;
678
703
  }
679
- }), [r, m, i]), g = [
704
+ }), [r, u, a]), N = [
680
705
  { key: "tracks", label: "Tracks", onClick: () => o("tracks") },
681
706
  { key: "track", label: s.displayName, onClick: () => o("track") },
682
707
  { key: "car", label: I(t) }
683
708
  ];
684
709
  return n ? /* @__PURE__ */ e(q, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
685
- /* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ e(re, { segments: g }) }),
710
+ /* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ e(ne, { segments: N }) }),
686
711
  r != null && r.length ? /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
687
712
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
688
713
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
689
- /* @__PURE__ */ e(R, { label: "Driver", sortKey: "userId", config: m, onSort: c }),
690
- /* @__PURE__ */ e(R, { label: "Lap Time", sortKey: "lapTimeMs", config: m, onSort: c }),
714
+ /* @__PURE__ */ e(T, { label: "Driver", sortKey: "userId", config: u, onSort: c }),
715
+ /* @__PURE__ */ e(T, { label: "Lap Time", sortKey: "lapTimeMs", config: u, onSort: c }),
691
716
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
692
717
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
693
718
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" }),
694
719
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-lg", children: "Tyre" }),
695
720
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-xl", children: "Fuel" }),
696
- /* @__PURE__ */ e(R, { label: "Laps", sortKey: "lapCount", config: m, onSort: c, className: "pvx-hidden-below-lg" }),
721
+ /* @__PURE__ */ e(T, { label: "Laps", sortKey: "lapCount", config: u, onSort: c, className: "pvx-hidden-below-lg" }),
697
722
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
698
723
  ] }) }),
699
- /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: f.map((p, b) => {
700
- const u = b + 1, N = p.steamId || p.userId, h = v && p.sector1Ms === v.s1, x = v && p.sector2Ms === v.s2, y = v && p.sector3Ms === v.s3;
724
+ /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: x.map((p, b) => {
725
+ const g = b + 1, m = p.steamId || p.userId, f = v && p.sector1Ms === v.s1, h = v && p.sector2Ms === v.s2, y = v && p.sector3Ms === v.s3;
701
726
  return /* @__PURE__ */ l(
702
727
  "tr",
703
728
  {
704
- className: `pvx-row pvx-row--clickable ${d && N === d ? "pvx-row--highlight" : u <= 3 ? "pvx-row--podium" : ""}`,
705
- onClick: () => a(N),
729
+ className: `pvx-row pvx-row--clickable ${d && m === d ? "pvx-row--highlight" : g <= 3 ? "pvx-row--podium" : ""}`,
730
+ onClick: () => i(m),
706
731
  children: [
707
- /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(ee, { rank: u, podium: !0 }) }),
708
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ e(G, { userId: N, getUserDisplay: i }) }),
732
+ /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(re, { rank: g, podium: !0 }) }),
733
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ e(G, { userId: m, getUserDisplay: a }) }),
709
734
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: B(p.lapTimeMs) }),
710
- /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${h ? "pvx-td--best-sector" : ""}`, children: D(p.sector1Ms) }),
711
- /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${x ? "pvx-td--best-sector" : ""}`, children: D(p.sector2Ms) }),
735
+ /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${f ? "pvx-td--best-sector" : ""}`, children: D(p.sector1Ms) }),
736
+ /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${h ? "pvx-td--best-sector" : ""}`, children: D(p.sector2Ms) }),
712
737
  /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${y ? "pvx-td--best-sector" : ""}`, children: D(p.sector3Ms) }),
713
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: ie(p.tyreCompound), children: p.tyreCompound || "-" }),
738
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: oe(p.tyreCompound), children: p.tyreCompound || "-" }),
714
739
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-xl", children: p.startingFuelL ? `${p.startingFuelL}L` : "-" }),
715
740
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: p.lapCount || "-" }),
716
741
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: p.recordedAt ? F(p.recordedAt) : "-" })
717
742
  ]
718
743
  },
719
- N
744
+ m
720
745
  );
721
746
  }) })
722
747
  ] }) }) : /* @__PURE__ */ e(_, { message: "No lap times for this car yet." })
723
748
  ] });
724
749
  }
725
- function Kr({ userId: r, track: n, carId: s, game: t, gameVersion: i, showInvalid: a, getUserDisplay: o, onToggleInvalid: d, onNavigate: m }) {
726
- const { data: c, driverName: v, isLoading: f } = De(r, n.id, n.layout, s, { showInvalid: a, game: t, gameVersion: i }), { displayName: g, avatarUrl: p } = o(r, v), b = w(() => ve(c, !0), [c]), u = w(() => {
727
- const h = (c == null ? void 0 : c.filter((x) => x.isValid)) || [];
728
- return h.length ? Math.min(...h.map((x) => x.lapTimeMs)) : null;
729
- }, [c]), N = [
730
- { key: "tracks", label: "Tracks", onClick: () => m("tracks") },
731
- { key: "track", label: n.displayName, onClick: () => m("track") },
732
- { key: "car", label: I(s), onClick: () => m("car") },
733
- { key: "driver", label: g }
750
+ function Gr({ userId: r, track: n, carId: s, game: t, gameVersion: a, showInvalid: i, getUserDisplay: o, onToggleInvalid: d, onNavigate: u }) {
751
+ const { data: c, driverName: v, isLoading: x } = Ae(r, n.id, n.layout, s, { showInvalid: i, game: t, gameVersion: a }), { displayName: N, avatarUrl: p } = o(r, v), b = w(() => he(c, !0), [c]), g = w(() => {
752
+ const f = (c == null ? void 0 : c.filter((h) => h.isValid)) || [];
753
+ return f.length ? Math.min(...f.map((h) => h.lapTimeMs)) : null;
754
+ }, [c]), m = [
755
+ { key: "tracks", label: "Tracks", onClick: () => u("tracks") },
756
+ { key: "track", label: n.displayName, onClick: () => u("track") },
757
+ { key: "car", label: I(s), onClick: () => u("car") },
758
+ { key: "driver", label: N }
734
759
  ];
735
- return f ? /* @__PURE__ */ e(q, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
760
+ return x ? /* @__PURE__ */ e(q, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
736
761
  /* @__PURE__ */ l("div", { className: "pvx-card-header pvx-card-header--split", children: [
737
762
  /* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
738
- /* @__PURE__ */ e(re, { segments: N }),
763
+ /* @__PURE__ */ e(ne, { segments: m }),
739
764
  p ? /* @__PURE__ */ e("img", { src: p, alt: "", className: "pvx-driver-avatar pvx-driver-avatar--lg" }) : /* @__PURE__ */ e("span", { className: "pvx-driver-avatar pvx-driver-avatar--lg pvx-driver-avatar--placeholder" })
740
765
  ] }),
741
766
  /* @__PURE__ */ l("label", { className: "pvx-checkbox-label", children: [
@@ -743,7 +768,7 @@ function Kr({ userId: r, track: n, carId: s, game: t, gameVersion: i, showInvali
743
768
  "input",
744
769
  {
745
770
  type: "checkbox",
746
- checked: a,
771
+ checked: i,
747
772
  onChange: d,
748
773
  className: "pvx-checkbox"
749
774
  }
@@ -764,43 +789,43 @@ function Kr({ userId: r, track: n, carId: s, game: t, gameVersion: i, showInvali
764
789
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-lg", children: "Fuel" }),
765
790
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
766
791
  ] }) }),
767
- /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: c.map((h, x) => {
768
- const y = h.isValid && h.lapTimeMs === u, C = b && h.isValid && h.sector1Ms === b.s1, $ = b && h.isValid && h.sector2Ms === b.s2, S = b && h.isValid && h.sector3Ms === b.s3;
792
+ /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: c.map((f, h) => {
793
+ const y = f.isValid && f.lapTimeMs === g, L = b && f.isValid && f.sector1Ms === b.s1, $ = b && f.isValid && f.sector2Ms === b.s2, S = b && f.isValid && f.sector3Ms === b.s3;
769
794
  let V = "pvx-row";
770
- return h.isValid || (V += " pvx-row--invalid"), y && (V += " pvx-row--personal-best"), /* @__PURE__ */ l("tr", { className: V, children: [
771
- /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e("span", { className: `pvx-rank ${y ? "pvx-rank--gold" : ""}`, children: x + 1 }) }),
772
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-md", children: h.lapNumber || "-" }),
773
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: B(h.lapTimeMs) }),
774
- /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${C ? "pvx-td--best-sector" : ""}`, children: D(h.sector1Ms) }),
775
- /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${$ ? "pvx-td--best-sector" : ""}`, children: D(h.sector2Ms) }),
776
- /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${S ? "pvx-td--best-sector" : ""}`, children: D(h.sector3Ms) }),
777
- /* @__PURE__ */ e("td", { className: "pvx-td", title: h.isValid ? void 0 : h.invalidReason || "Invalid", children: h.isValid ? /* @__PURE__ */ e(_e, {}) : /* @__PURE__ */ e(qe, {}) }),
778
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: ie(h.tyreCompound), children: h.tyreCompound || "-" }),
779
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: h.startingFuelL ? `${h.startingFuelL}L` : "-" }),
780
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: F(h.timestamp) })
781
- ] }, h.id);
795
+ return f.isValid || (V += " pvx-row--invalid"), y && (V += " pvx-row--personal-best"), /* @__PURE__ */ l("tr", { className: V, children: [
796
+ /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e("span", { className: `pvx-rank ${y ? "pvx-rank--gold" : ""}`, children: h + 1 }) }),
797
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-md", children: f.lapNumber || "-" }),
798
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: B(f.lapTimeMs) }),
799
+ /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${L ? "pvx-td--best-sector" : ""}`, children: D(f.sector1Ms) }),
800
+ /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${$ ? "pvx-td--best-sector" : ""}`, children: D(f.sector2Ms) }),
801
+ /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${S ? "pvx-td--best-sector" : ""}`, children: D(f.sector3Ms) }),
802
+ /* @__PURE__ */ e("td", { className: "pvx-td", title: f.isValid ? void 0 : f.invalidReason || "Invalid", children: f.isValid ? /* @__PURE__ */ e(Ve, {}) : /* @__PURE__ */ e(Ke, {}) }),
803
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: oe(f.tyreCompound), children: f.tyreCompound || "-" }),
804
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: f.startingFuelL ? `${f.startingFuelL}L` : "-" }),
805
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: F(f.timestamp) })
806
+ ] }, f.id);
782
807
  }) })
783
- ] }) }) : /* @__PURE__ */ e(_, { message: a ? "No laps recorded for this combination." : 'No valid laps. Try enabling "Show invalid laps".' })
808
+ ] }) }) : /* @__PURE__ */ e(_, { message: i ? "No laps recorded for this combination." : 'No valid laps. Try enabling "Show invalid laps".' })
784
809
  ] });
785
810
  }
786
- function Hr({ drivers: r, isLoading: n, getUserDisplay: s, game: t, gameVersion: i, onComboSelect: a }) {
787
- const [o, d] = W({ key: "rank", dir: "asc" }), [m, c] = M(null), v = w(() => r ? O(r, o, (g, p) => {
811
+ function zr({ drivers: r, isLoading: n, getUserDisplay: s, game: t, gameVersion: a, onComboSelect: i }) {
812
+ const [o, d] = W({ key: "rank", dir: "asc" }), [u, c] = M(null), v = w(() => r ? O(r, o, (N, p) => {
788
813
  switch (p) {
789
814
  case "rating":
790
- return g.rating;
815
+ return N.rating;
791
816
  case "comboCount":
792
- return g.comboCount || 0;
817
+ return N.comboCount || 0;
793
818
  case "distinctCars":
794
- return g.distinctCars || 0;
819
+ return N.distinctCars || 0;
795
820
  case "rank":
796
821
  default:
797
- return g.rank;
822
+ return N.rank;
798
823
  }
799
824
  }) : [], [r, o]);
800
825
  if (n) return /* @__PURE__ */ e(q, {});
801
826
  if (!(r != null && r.length))
802
827
  return /* @__PURE__ */ e("div", { className: "pvx-card", children: /* @__PURE__ */ e(_, { message: "Not enough data for rankings yet." }) });
803
- const f = 5;
828
+ const x = 5;
804
829
  return /* @__PURE__ */ l("div", { className: "pvx-card", children: [
805
830
  /* @__PURE__ */ l("div", { className: "pvx-card-header pvx-rankings-header", children: [
806
831
  /* @__PURE__ */ e("h2", { className: "pvx-card-title", children: "Driver Rankings" }),
@@ -819,34 +844,34 @@ function Hr({ drivers: r, isLoading: n, getUserDisplay: s, game: t, gameVersion:
819
844
  ] }),
820
845
  /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
821
846
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
822
- /* @__PURE__ */ e(R, { label: "#", sortKey: "rank", config: o, onSort: d, className: "pvx-th--narrow" }),
847
+ /* @__PURE__ */ e(T, { label: "#", sortKey: "rank", config: o, onSort: d, className: "pvx-th--narrow" }),
823
848
  /* @__PURE__ */ e("th", { className: "pvx-th", children: "Driver" }),
824
- /* @__PURE__ */ e(R, { label: "Rating", sortKey: "rating", config: o, onSort: d }),
825
- /* @__PURE__ */ e(R, { label: "Cars", sortKey: "distinctCars", config: o, onSort: d, className: "pvx-hidden-below-sm" }),
826
- /* @__PURE__ */ e(R, { label: "Combos", sortKey: "comboCount", config: o, onSort: d, className: "pvx-hidden-below-sm" })
849
+ /* @__PURE__ */ e(T, { label: "Rating", sortKey: "rating", config: o, onSort: d }),
850
+ /* @__PURE__ */ e(T, { label: "Cars", sortKey: "distinctCars", config: o, onSort: d, className: "pvx-hidden-below-sm" }),
851
+ /* @__PURE__ */ e(T, { label: "Combos", sortKey: "comboCount", config: o, onSort: d, className: "pvx-hidden-below-sm" })
827
852
  ] }) }),
828
- /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: v.map((g) => {
829
- const p = m === g.identifier;
853
+ /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: v.map((N) => {
854
+ const p = u === N.identifier;
830
855
  return /* @__PURE__ */ e(
831
- je,
856
+ He,
832
857
  {
833
- driver: g,
858
+ driver: N,
834
859
  getUserDisplay: s,
835
860
  isExpanded: p,
836
- onToggle: () => c(p ? null : g.identifier),
837
- colCount: f,
861
+ onToggle: () => c(p ? null : N.identifier),
862
+ colCount: x,
838
863
  game: t,
839
- gameVersion: i,
840
- onComboSelect: a
864
+ gameVersion: a,
865
+ onComboSelect: i
841
866
  },
842
- g.identifier
867
+ N.identifier
843
868
  );
844
869
  }) })
845
870
  ] }) })
846
871
  ] });
847
872
  }
848
- function je({ driver: r, getUserDisplay: n, isExpanded: s, onToggle: t, colCount: i, game: a, gameVersion: o, onComboSelect: d }) {
849
- const m = r.identifier;
873
+ function He({ driver: r, getUserDisplay: n, isExpanded: s, onToggle: t, colCount: a, game: i, gameVersion: o, onComboSelect: d }) {
874
+ const u = r.identifier;
850
875
  return /* @__PURE__ */ l(A, { children: [
851
876
  /* @__PURE__ */ l(
852
877
  "tr",
@@ -854,8 +879,8 @@ function je({ driver: r, getUserDisplay: n, isExpanded: s, onToggle: t, colCount
854
879
  className: `pvx-row pvx-row--clickable ${r.rank <= 3 ? "pvx-row--podium" : ""}`,
855
880
  onClick: t,
856
881
  children: [
857
- /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(ee, { rank: r.rank, podium: !0 }) }),
858
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ e(G, { userId: m, getUserDisplay: n }) }),
882
+ /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(re, { rank: r.rank, podium: !0 }) }),
883
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ e(G, { userId: u, getUserDisplay: n }) }),
859
884
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: r.rating.toFixed(1) }),
860
885
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: r.distinctCars || "-" }),
861
886
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: /* @__PURE__ */ l("span", { className: "pvx-rankings-combo-count", children: [
@@ -865,17 +890,17 @@ function je({ driver: r, getUserDisplay: n, isExpanded: s, onToggle: t, colCount
865
890
  ]
866
891
  }
867
892
  ),
868
- s && r.combos && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: i, className: "pvx-rankings-combos-cell", children: /* @__PURE__ */ e("div", { className: "pvx-rankings-combos", children: r.combos.map((c, v) => {
869
- const f = c.layout ? `${c.trackId}|${c.layout}` : c.trackId, g = d ? () => d({ track: f, car: c.carId, highlight: m, game: a, gameVersion: o }) : void 0;
893
+ s && r.combos && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: a, className: "pvx-rankings-combos-cell", children: /* @__PURE__ */ e("div", { className: "pvx-rankings-combos", children: r.combos.map((c, v) => {
894
+ const x = c.layout ? `${c.trackId}|${c.layout}` : c.trackId, N = d ? () => d({ track: x, car: c.carId, highlight: u, game: i, gameVersion: o }) : void 0;
870
895
  return /* @__PURE__ */ l(
871
896
  "div",
872
897
  {
873
- className: `pvx-rankings-combo ${g ? "pvx-rankings-combo--clickable" : ""}`,
874
- onClick: g,
875
- role: g ? "button" : void 0,
898
+ className: `pvx-rankings-combo ${N ? "pvx-rankings-combo--clickable" : ""}`,
899
+ onClick: N,
900
+ role: N ? "button" : void 0,
876
901
  children: [
877
902
  /* @__PURE__ */ l("div", { className: "pvx-rankings-combo-info", children: [
878
- /* @__PURE__ */ e("p", { className: "pvx-rankings-combo-track", children: E(c.trackId, c.layout, a) }),
903
+ /* @__PURE__ */ e("p", { className: "pvx-rankings-combo-track", children: E(c.trackId, c.layout, i) }),
879
904
  /* @__PURE__ */ e("p", { className: "pvx-rankings-combo-car", children: I(c.carId) })
880
905
  ] }),
881
906
  /* @__PURE__ */ l("div", { className: "pvx-rankings-combo-stats", children: [
@@ -899,7 +924,7 @@ function je({ driver: r, getUserDisplay: n, isExpanded: s, onToggle: t, colCount
899
924
  }) }) }) })
900
925
  ] });
901
926
  }
902
- const Ve = {
927
+ const We = {
903
928
  GBR: "🇬🇧",
904
929
  DEU: "🇩🇪",
905
930
  NLD: "🇳🇱",
@@ -930,52 +955,52 @@ const Ve = {
930
955
  RUS: "🇷🇺",
931
956
  TUR: "🇹🇷",
932
957
  KOR: "🇰🇷"
933
- }, Ke = ["🥇", "🥈", "🥉"], He = {
958
+ }, Oe = ["🥇", "🥈", "🥉"], Ge = {
934
959
  championship: "Championship",
935
960
  series: "Series",
936
961
  event: "Event"
937
- }, te = ["PRACTICE", "QUALIFYING", "RACE"];
938
- function xe({ position: r }) {
962
+ }, se = ["PRACTICE", "QUALIFYING", "RACE"];
963
+ function ge({ position: r }) {
939
964
  return /* @__PURE__ */ e("span", { className: r === 1 ? "pvx-rank pvx-rank--gold" : r === 2 ? "pvx-rank pvx-rank--silver" : r === 3 ? "pvx-rank pvx-rank--bronze" : "pvx-rank", children: r });
940
965
  }
941
- function ge({ nation: r }) {
942
- const n = r && Ve[r];
966
+ function fe({ nation: r }) {
967
+ const n = r && We[r];
943
968
  return n ? /* @__PURE__ */ e("span", { className: "pvx-nation-flag", title: r, children: n }) : null;
944
969
  }
945
- function We({ sessions: r, activeSession: n, onSelect: s }) {
970
+ function ze({ sessions: r, activeSession: n, onSelect: s }) {
946
971
  if (!r || r.length <= 1) return null;
947
972
  const t = [...r].sort(
948
- (i, a) => te.indexOf(i.type) - te.indexOf(a.type)
973
+ (a, i) => se.indexOf(a.type) - se.indexOf(i.type)
949
974
  );
950
- return /* @__PURE__ */ e("div", { className: "pvx-session-tabs", children: t.map((i) => /* @__PURE__ */ e(
975
+ return /* @__PURE__ */ e("div", { className: "pvx-session-tabs", children: t.map((a) => /* @__PURE__ */ e(
951
976
  "button",
952
977
  {
953
- onClick: () => s(i.type),
954
- className: `pvx-session-tab ${n === i.type ? "pvx-session-tab--active" : ""}`,
955
- children: i.type
978
+ onClick: () => s(a.type),
979
+ className: `pvx-session-tab ${n === a.type ? "pvx-session-tab--active" : ""}`,
980
+ children: a.type
956
981
  },
957
- i.type
982
+ a.type
958
983
  )) });
959
984
  }
960
- function Oe({ type: r }) {
961
- return /* @__PURE__ */ e("span", { className: `pvx-comp-badge pvx-comp-badge--${r}`, children: He[r] || r });
985
+ function Qe({ type: r }) {
986
+ return /* @__PURE__ */ e("span", { className: `pvx-comp-badge pvx-comp-badge--${r}`, children: Ge[r] || r });
962
987
  }
963
988
  function Q({ children: r, variant: n = "default" }) {
964
989
  return /* @__PURE__ */ e("span", { className: `pvx-info-pill ${n !== "default" ? `pvx-info-pill--${n}` : ""}`, children: r });
965
990
  }
966
- function Ge(r) {
991
+ function Ye(r) {
967
992
  if (!r) return "TBD";
968
993
  const n = new Date(r);
969
994
  if (isNaN(n)) return "TBD";
970
995
  const s = n.toLocaleDateString("en-GB", { weekday: "short", day: "numeric", month: "short" }), t = n.toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit" });
971
996
  return `${s} • ${t}`;
972
997
  }
973
- function ze(r) {
998
+ function Je(r) {
974
999
  return r.reduce((n, s) => {
975
1000
  var t;
976
- return (t = s.splits) != null && t.length ? n ? n.map((i, a) => {
977
- const o = s.splits[a];
978
- return o && o < i ? o : i;
1001
+ return (t = s.splits) != null && t.length ? n ? n.map((a, i) => {
1002
+ const o = s.splits[i];
1003
+ return o && o < a ? o : a;
979
1004
  }) : [...s.splits] : n;
980
1005
  }, null);
981
1006
  }
@@ -985,12 +1010,12 @@ function j({ message: r = "Loading..." }) {
985
1010
  function P({ message: r = "No data available." }) {
986
1011
  return /* @__PURE__ */ e("div", { className: "pvx-empty", children: /* @__PURE__ */ e("p", { children: r }) });
987
1012
  }
988
- function Wr({ competitions: r, isLoading: n, onSelect: s, onRegister: t, className: i }) {
989
- return n ? /* @__PURE__ */ e(j, { message: "Loading competitions..." }) : r != null && r.length ? /* @__PURE__ */ e("div", { className: `pvx-comp-grid ${i || ""}`, children: r.map((a) => /* @__PURE__ */ e(Qe, { comp: a, onSelect: s, onRegister: t || s }, a.id)) }) : /* @__PURE__ */ e(P, { message: "No competitions available." });
1013
+ function Qr({ competitions: r, isLoading: n, onSelect: s, onRegister: t, className: a }) {
1014
+ return n ? /* @__PURE__ */ e(j, { message: "Loading competitions..." }) : r != null && r.length ? /* @__PURE__ */ e("div", { className: `pvx-comp-grid ${a || ""}`, children: r.map((i) => /* @__PURE__ */ e(Ze, { comp: i, onSelect: s, onRegister: t || s }, i.id)) }) : /* @__PURE__ */ e(P, { message: "No competitions available." });
990
1015
  }
991
- function Qe({ comp: r, onSelect: n, onRegister: s }) {
992
- var u, N, h;
993
- const { cdnUrl: t } = k(), i = r.posterCdnPath ? `${t}/${r.posterCdnPath}` : null, a = r.registration, o = (a == null ? void 0 : a.currentCount) || 0, d = a == null ? void 0 : a.maxParticipants, m = d && o >= d, c = (a == null ? void 0 : a.deadline) && new Date(a.deadline) < /* @__PURE__ */ new Date(), v = (a == null ? void 0 : a.isOpen) && !c && !m, f = /* @__PURE__ */ new Date(), g = (u = r.rounds) == null ? void 0 : u.find((x) => x.startTime && new Date(x.startTime) >= f), p = ((N = r.rounds) == null ? void 0 : N.length) || 0, b = ((h = r.rounds) == null ? void 0 : h.filter((x) => x.isFinalized).length) || 0;
1016
+ function Ze({ comp: r, onSelect: n, onRegister: s }) {
1017
+ var g, m, f;
1018
+ const { cdnUrl: t } = k(), a = r.posterCdnPath ? `${t}/${r.posterCdnPath}` : null, i = r.registration, o = (i == null ? void 0 : i.currentCount) || 0, d = i == null ? void 0 : i.maxParticipants, u = d && o >= d, c = (i == null ? void 0 : i.deadline) && new Date(i.deadline) < /* @__PURE__ */ new Date(), v = (i == null ? void 0 : i.isOpen) && !c && !u, x = /* @__PURE__ */ new Date(), N = (g = r.rounds) == null ? void 0 : g.find((h) => h.startTime && new Date(h.startTime) >= x), p = ((m = r.rounds) == null ? void 0 : m.length) || 0, b = ((f = r.rounds) == null ? void 0 : f.filter((h) => h.isFinalized).length) || 0;
994
1019
  return /* @__PURE__ */ l(
995
1020
  "div",
996
1021
  {
@@ -998,30 +1023,30 @@ function Qe({ comp: r, onSelect: n, onRegister: s }) {
998
1023
  onClick: () => n(r.id),
999
1024
  role: "button",
1000
1025
  tabIndex: 0,
1001
- onKeyDown: (x) => {
1002
- (x.key === "Enter" || x.key === " ") && (x.preventDefault(), n(r.id));
1026
+ onKeyDown: (h) => {
1027
+ (h.key === "Enter" || h.key === " ") && (h.preventDefault(), n(r.id));
1003
1028
  },
1004
1029
  children: [
1005
- /* @__PURE__ */ e("div", { className: "pvx-comp-card-poster", children: i ? /* @__PURE__ */ e("img", { src: i, alt: r.name, className: "pvx-comp-card-poster-img" }) : /* @__PURE__ */ e("div", { className: "pvx-comp-card-poster-placeholder", children: /* @__PURE__ */ e(Je, {}) }) }),
1030
+ /* @__PURE__ */ e("div", { className: "pvx-comp-card-poster", children: a ? /* @__PURE__ */ e("img", { src: a, alt: r.name, className: "pvx-comp-card-poster-img" }) : /* @__PURE__ */ e("div", { className: "pvx-comp-card-poster-placeholder", children: /* @__PURE__ */ e(er, {}) }) }),
1006
1031
  /* @__PURE__ */ l("div", { className: "pvx-comp-card-body", children: [
1007
1032
  /* @__PURE__ */ e("h3", { className: "pvx-comp-card-title", children: r.name }),
1008
1033
  r.description && /* @__PURE__ */ e("p", { className: "pvx-comp-card-desc", children: r.description }),
1009
1034
  /* @__PURE__ */ l("div", { className: "pvx-comp-card-pills", children: [
1010
- /* @__PURE__ */ e(Oe, { type: r.type }),
1035
+ /* @__PURE__ */ e(Qe, { type: r.type }),
1011
1036
  r.game && /* @__PURE__ */ e(Q, { children: r.game.toUpperCase() }),
1012
- r.formatDescription && r.formatDescription.split(", ").map((x, y) => /* @__PURE__ */ e(Q, { variant: "format", children: x }, y))
1037
+ r.formatDescription && r.formatDescription.split(", ").map((h, y) => /* @__PURE__ */ e(Q, { variant: "format", children: h }, y))
1013
1038
  ] }),
1014
- r.carsDescription && /* @__PURE__ */ e("div", { className: "pvx-comp-card-pills", children: r.carsDescription.split(", ").map((x, y) => /* @__PURE__ */ e(Q, { children: x }, y)) }),
1039
+ r.carsDescription && /* @__PURE__ */ e("div", { className: "pvx-comp-card-pills", children: r.carsDescription.split(", ").map((h, y) => /* @__PURE__ */ e(Q, { children: h }, y)) }),
1015
1040
  /* @__PURE__ */ l("div", { className: "pvx-comp-card-schedule", children: [
1016
- g ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
1041
+ N ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
1017
1042
  /* @__PURE__ */ e("span", { className: "pvx-comp-card-schedule-label", children: "Next:" }),
1018
1043
  " ",
1019
1044
  "R",
1020
- g.roundNumber,
1045
+ N.roundNumber,
1021
1046
  " ",
1022
- g.track || "TBD",
1047
+ N.track || "TBD",
1023
1048
  " — ",
1024
- Ge(g.startTime)
1049
+ Ye(N.startTime)
1025
1050
  ] }) : p > 0 ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
1026
1051
  b,
1027
1052
  "/",
@@ -1034,12 +1059,12 @@ function Qe({ comp: r, onSelect: n, onRegister: s }) {
1034
1059
  p !== 1 ? "s" : ""
1035
1060
  ] })
1036
1061
  ] }),
1037
- a && /* @__PURE__ */ e(
1038
- Ye,
1062
+ i && /* @__PURE__ */ e(
1063
+ Xe,
1039
1064
  {
1040
1065
  competitionId: r.id,
1041
1066
  regOpen: v,
1042
- isFull: m,
1067
+ isFull: u,
1043
1068
  deadlinePassed: c,
1044
1069
  regCount: o,
1045
1070
  regMax: d,
@@ -1051,13 +1076,13 @@ function Qe({ comp: r, onSelect: n, onRegister: s }) {
1051
1076
  }
1052
1077
  );
1053
1078
  }
1054
- function Ye({ competitionId: r, regOpen: n, isFull: s, deadlinePassed: t, regCount: i, regMax: a, onRegister: o }) {
1055
- const { isPowerMode: d } = Z(), m = X(r), { data: c } = J(r), v = (c == null ? void 0 : c.isRegistered) || !1, f = a ? i / a * 100 : 0, g = f >= 100 ? "full" : f >= 75 ? "warning" : "ok";
1079
+ function Xe({ competitionId: r, regOpen: n, isFull: s, deadlinePassed: t, regCount: a, regMax: i, onRegister: o }) {
1080
+ const { isPowerMode: d } = X(), u = ee(r), { data: c } = Z(r), v = (c == null ? void 0 : c.isRegistered) || !1, x = i ? a / i * 100 : 0, N = x >= 100 ? "full" : x >= 75 ? "warning" : "ok";
1056
1081
  return /* @__PURE__ */ l("div", { className: "pvx-comp-card-reg", children: [
1057
- /* @__PURE__ */ e("div", { className: "pvx-comp-card-reg-info", children: /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${g}`, children: [
1058
- i,
1082
+ /* @__PURE__ */ e("div", { className: "pvx-comp-card-reg-info", children: /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${N}`, children: [
1083
+ a,
1059
1084
  "/",
1060
- a || "∞",
1085
+ i || "∞",
1061
1086
  " drivers"
1062
1087
  ] }) }),
1063
1088
  /* @__PURE__ */ e("div", { className: "pvx-comp-card-reg-action", children: v ? /* @__PURE__ */ e(
@@ -1081,7 +1106,7 @@ function Ye({ competitionId: r, regOpen: n, isFull: s, deadlinePassed: t, regCou
1081
1106
  ) : /* @__PURE__ */ e(
1082
1107
  "a",
1083
1108
  {
1084
- href: m,
1109
+ href: u,
1085
1110
  target: "_blank",
1086
1111
  rel: "noopener noreferrer",
1087
1112
  className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--open",
@@ -1091,7 +1116,7 @@ function Ye({ competitionId: r, regOpen: n, isFull: s, deadlinePassed: t, regCou
1091
1116
  ) : /* @__PURE__ */ e("span", { className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--closed", children: s ? "Full" : "Closed" }) })
1092
1117
  ] });
1093
1118
  }
1094
- function Je() {
1119
+ function er() {
1095
1120
  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: [
1096
1121
  /* @__PURE__ */ e("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
1097
1122
  /* @__PURE__ */ e("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
@@ -1101,14 +1126,14 @@ function Je() {
1101
1126
  /* @__PURE__ */ e("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
1102
1127
  ] });
1103
1128
  }
1104
- function Or({ competitionId: r, className: n }) {
1105
- var d, m;
1106
- const { data: s, isLoading: t } = Pe(r), { data: i, isLoading: a } = Be(r);
1107
- if (t || a)
1129
+ function Yr({ competitionId: r, className: n }) {
1130
+ var d, u;
1131
+ const { data: s, isLoading: t } = Ee(r), { data: a, isLoading: i } = Ue(r);
1132
+ if (t || i)
1108
1133
  return /* @__PURE__ */ e(j, { message: "Loading standings..." });
1109
1134
  if (!((d = s == null ? void 0 : s.standings) != null && d.length))
1110
1135
  return /* @__PURE__ */ e(P, { message: "No standings data yet. Results will appear once rounds are finalised." });
1111
- const o = ((m = i == null ? void 0 : i.rounds) == null ? void 0 : m.filter((c) => c.isFinalized)) || [];
1136
+ const o = ((u = a == null ? void 0 : a.rounds) == null ? void 0 : u.filter((c) => c.isFinalized)) || [];
1112
1137
  return /* @__PURE__ */ l("div", { className: `pvx-card ${n || ""}`, children: [
1113
1138
  /* @__PURE__ */ e("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
1114
1139
  /* @__PURE__ */ e("h3", { className: "pvx-card-title", children: "Championship Standings" }),
@@ -1141,7 +1166,7 @@ function Or({ competitionId: r, className: n }) {
1141
1166
  ))
1142
1167
  ] }) }),
1143
1168
  /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: s.standings.map((c) => /* @__PURE__ */ e(
1144
- Ze,
1169
+ rr,
1145
1170
  {
1146
1171
  driver: c,
1147
1172
  finalizedRounds: o
@@ -1151,27 +1176,27 @@ function Or({ competitionId: r, className: n }) {
1151
1176
  ] }) })
1152
1177
  ] });
1153
1178
  }
1154
- function Ze({ driver: r, finalizedRounds: n }) {
1155
- var o, d, m;
1179
+ function rr({ driver: r, finalizedRounds: n }) {
1180
+ var o, d, u;
1156
1181
  const s = r.position <= 3, t = new Map(
1157
1182
  ((o = r.roundResults) == null ? void 0 : o.map((c) => [c.roundNumber, c])) || []
1158
- ), i = ((d = r.roundResults) == null ? void 0 : d.filter((c) => c.position === 1).length) || 0, a = ((m = r.roundResults) == null ? void 0 : m.filter((c) => c.position <= 3).length) || 0;
1183
+ ), a = ((d = r.roundResults) == null ? void 0 : d.filter((c) => c.position === 1).length) || 0, i = ((u = r.roundResults) == null ? void 0 : u.filter((c) => c.position <= 3).length) || 0;
1159
1184
  return /* @__PURE__ */ l("tr", { className: `pvx-row ${s ? "pvx-row--podium" : ""}`, children: [
1160
- /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(xe, { position: r.position }) }),
1185
+ /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(ge, { position: r.position }) }),
1161
1186
  /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
1162
- /* @__PURE__ */ e(ge, { nation: r.nation }),
1187
+ /* @__PURE__ */ e(fe, { nation: r.nation }),
1163
1188
  r.driverName
1164
1189
  ] }),
1165
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: i || "-" }),
1166
1190
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: a || "-" }),
1191
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: i || "-" }),
1167
1192
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-standings-total", children: r.totalPoints }),
1168
1193
  n.map((c) => {
1169
- const v = t.get(c.roundNumber), f = v == null ? void 0 : v.dropped;
1194
+ const v = t.get(c.roundNumber), x = v == null ? void 0 : v.dropped;
1170
1195
  return /* @__PURE__ */ e(
1171
1196
  "td",
1172
1197
  {
1173
- className: `pvx-td pvx-td--center pvx-hidden-below-md ${!f && (v == null ? void 0 : v.position) <= 3 ? "pvx-standings-cell--podium" : ""}`,
1174
- children: v ? /* @__PURE__ */ l("div", { className: `pvx-standings-round-cell ${f ? "pvx-standings-round-cell--dropped" : ""}`, children: [
1198
+ className: `pvx-td pvx-td--center pvx-hidden-below-md ${!x && (v == null ? void 0 : v.position) <= 3 ? "pvx-standings-cell--podium" : ""}`,
1199
+ children: v ? /* @__PURE__ */ l("div", { className: `pvx-standings-round-cell ${x ? "pvx-standings-round-cell--dropped" : ""}`, children: [
1175
1200
  /* @__PURE__ */ l("span", { className: "pvx-standings-round-pos", children: [
1176
1201
  "P",
1177
1202
  v.position
@@ -1184,14 +1209,14 @@ function Ze({ driver: r, finalizedRounds: n }) {
1184
1209
  })
1185
1210
  ] });
1186
1211
  }
1187
- function Gr({ competitionId: r, roundNumber: n, className: s }) {
1188
- var m;
1189
- const { data: t, isLoading: i } = Ae(r, n);
1190
- if (i)
1212
+ function Jr({ competitionId: r, roundNumber: n, className: s }) {
1213
+ var u;
1214
+ const { data: t, isLoading: a } = Fe(r, n);
1215
+ if (a)
1191
1216
  return /* @__PURE__ */ e(j, { message: "Loading results..." });
1192
1217
  if (!t)
1193
1218
  return /* @__PURE__ */ e(P, { message: "No results for this round." });
1194
- const o = (t.sessions || []).find((c) => c.type === "RACE"), d = (m = o == null ? void 0 : o.results) == null ? void 0 : m.filter((c) => c.position <= 3).sort((c, v) => c.position - v.position);
1219
+ const o = (t.sessions || []).find((c) => c.type === "RACE"), d = (u = o == null ? void 0 : o.results) == null ? void 0 : u.filter((c) => c.position <= 3).sort((c, v) => c.position - v.position);
1195
1220
  return /* @__PURE__ */ l("div", { className: `pvx-round-results ${s || ""}`, children: [
1196
1221
  /* @__PURE__ */ l("div", { className: "pvx-round-results-header", children: [
1197
1222
  /* @__PURE__ */ l("div", { children: [
@@ -1207,37 +1232,37 @@ function Gr({ competitionId: r, roundNumber: n, className: s }) {
1207
1232
  }) })
1208
1233
  ] }),
1209
1234
  (d == null ? void 0 : d.length) > 0 && /* @__PURE__ */ e("div", { className: "pvx-round-podium-summary", children: d.map((c) => /* @__PURE__ */ l("span", { className: "pvx-round-podium-item", children: [
1210
- /* @__PURE__ */ e("span", { children: Ke[c.position - 1] }),
1235
+ /* @__PURE__ */ e("span", { children: Oe[c.position - 1] }),
1211
1236
  /* @__PURE__ */ e("span", { children: c.driverName })
1212
1237
  ] }, c.driverId)) })
1213
1238
  ] }),
1214
- /* @__PURE__ */ e(Xe, { round: t })
1239
+ /* @__PURE__ */ e(nr, { round: t })
1215
1240
  ] });
1216
1241
  }
1217
- function Xe({ round: r, className: n }) {
1218
- var d, m;
1219
- const [s, t] = M(null), i = (r == null ? void 0 : r.sessions) || [];
1220
- if (!i.length)
1242
+ function nr({ round: r, className: n }) {
1243
+ var d, u;
1244
+ const [s, t] = M(null), a = (r == null ? void 0 : r.sessions) || [];
1245
+ if (!a.length)
1221
1246
  return /* @__PURE__ */ e(P, { message: "No session data for this round." });
1222
- const a = s || ((d = i.find((c) => c.type === "RACE")) == null ? void 0 : d.type) || ((m = i[0]) == null ? void 0 : m.type), o = i.find((c) => c.type === a) || i[0];
1247
+ const i = s || ((d = a.find((c) => c.type === "RACE")) == null ? void 0 : d.type) || ((u = a[0]) == null ? void 0 : u.type), o = a.find((c) => c.type === i) || a[0];
1223
1248
  return /* @__PURE__ */ l("div", { className: n || "", children: [
1224
1249
  /* @__PURE__ */ e(
1225
- We,
1250
+ ze,
1226
1251
  {
1227
- sessions: i,
1228
- activeSession: a,
1252
+ sessions: a,
1253
+ activeSession: i,
1229
1254
  onSelect: t
1230
1255
  }
1231
1256
  ),
1232
- /* @__PURE__ */ e(er, { session: o })
1257
+ /* @__PURE__ */ e(tr, { session: o })
1233
1258
  ] });
1234
1259
  }
1235
- function er({ session: r }) {
1260
+ function tr({ session: r }) {
1236
1261
  var t;
1237
1262
  const n = r.type === "RACE";
1238
1263
  if (!((t = r.results) != null && t.length))
1239
1264
  return /* @__PURE__ */ e(P, { message: `No results for ${r.type}.` });
1240
- const s = ze(r.results);
1265
+ const s = Je(r.results);
1241
1266
  return /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
1242
1267
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
1243
1268
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
@@ -1250,24 +1275,24 @@ function er({ session: r }) {
1250
1275
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-th--center", children: "Points" })
1251
1276
  ] })
1252
1277
  ] }) }),
1253
- /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: r.results.map((i, a) => /* @__PURE__ */ e(
1254
- rr,
1278
+ /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: r.results.map((a, i) => /* @__PURE__ */ e(
1279
+ sr,
1255
1280
  {
1256
- result: i,
1281
+ result: a,
1257
1282
  isRace: n,
1258
1283
  fastestSplits: s,
1259
- rowIndex: a
1284
+ rowIndex: i
1260
1285
  },
1261
- i.driverId || a
1286
+ a.driverId || i
1262
1287
  )) })
1263
1288
  ] }) });
1264
1289
  }
1265
- function rr({ result: r, isRace: n, fastestSplits: s, rowIndex: t }) {
1266
- const i = r.position <= 3;
1267
- return /* @__PURE__ */ l("tr", { className: `pvx-row ${i ? "pvx-row--podium" : ""}`, children: [
1268
- /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(xe, { position: r.position }) }),
1290
+ function sr({ result: r, isRace: n, fastestSplits: s, rowIndex: t }) {
1291
+ const a = r.position <= 3;
1292
+ return /* @__PURE__ */ l("tr", { className: `pvx-row ${a ? "pvx-row--podium" : ""}`, children: [
1293
+ /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(ge, { position: r.position }) }),
1269
1294
  /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
1270
- /* @__PURE__ */ e(ge, { nation: r.nation }),
1295
+ /* @__PURE__ */ e(fe, { nation: r.nation }),
1271
1296
  r.driverName,
1272
1297
  r.carNumber != null && /* @__PURE__ */ l("span", { className: "pvx-car-number", children: [
1273
1298
  "#",
@@ -1277,7 +1302,7 @@ function rr({ result: r, isRace: n, fastestSplits: s, rowIndex: t }) {
1277
1302
  ] }),
1278
1303
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-hidden-below-sm", children: I(r.carId) }),
1279
1304
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ e(
1280
- nr,
1305
+ ar,
1281
1306
  {
1282
1307
  bestLap: r.bestLapFormatted,
1283
1308
  hasBestLap: r.hasBestLap,
@@ -1301,30 +1326,30 @@ function rr({ result: r, isRace: n, fastestSplits: s, rowIndex: t }) {
1301
1326
  ] })
1302
1327
  ] });
1303
1328
  }
1304
- function nr({ bestLap: r, hasBestLap: n, splits: s, fastestSplits: t, showAbove: i }) {
1329
+ function ar({ bestLap: r, hasBestLap: n, splits: s, fastestSplits: t, showAbove: a }) {
1305
1330
  return r ? /* @__PURE__ */ l("span", { className: `pvx-best-lap-cell ${n ? "pvx-best-lap-cell--fastest" : ""}`, children: [
1306
1331
  /* @__PURE__ */ e("span", { className: "pvx-best-lap-time", children: r }),
1307
- (s == null ? void 0 : s.length) > 0 && /* @__PURE__ */ e("span", { className: "pvx-splits-tooltip-anchor", children: /* @__PURE__ */ e("span", { className: `pvx-splits-tooltip ${i ? "" : "pvx-splits-tooltip--above"}`, children: s.map((a, o) => {
1308
- const d = t && a === t[o];
1332
+ (s == null ? void 0 : s.length) > 0 && /* @__PURE__ */ e("span", { className: "pvx-splits-tooltip-anchor", children: /* @__PURE__ */ e("span", { className: `pvx-splits-tooltip ${a ? "" : "pvx-splits-tooltip--above"}`, children: s.map((i, o) => {
1333
+ const d = t && i === t[o];
1309
1334
  return /* @__PURE__ */ l("span", { className: "pvx-splits-tooltip-row", children: [
1310
1335
  /* @__PURE__ */ l("span", { className: "pvx-splits-tooltip-label", children: [
1311
1336
  "S",
1312
1337
  o + 1
1313
1338
  ] }),
1314
- /* @__PURE__ */ e("span", { className: d ? "pvx-splits-tooltip-best" : "", children: a })
1339
+ /* @__PURE__ */ e("span", { className: d ? "pvx-splits-tooltip-best" : "", children: i })
1315
1340
  ] }, o);
1316
1341
  }) }) })
1317
1342
  ] }) : /* @__PURE__ */ e("span", { className: "pvx-td--muted", children: "-" });
1318
1343
  }
1319
- function zr({ competitionId: r, className: n }) {
1320
- const { getSteamId: s } = k(), { data: t, isLoading: i } = ce(r), a = s();
1321
- if (i)
1344
+ function Zr({ competitionId: r, className: n }) {
1345
+ const { getSteamId: s } = k(), { data: t, isLoading: a } = le(r), i = s();
1346
+ if (a)
1322
1347
  return /* @__PURE__ */ e(j, { message: "Loading drivers..." });
1323
1348
  const o = (t == null ? void 0 : t.drivers) || (t == null ? void 0 : t.entries) || [];
1324
1349
  return o.length ? /* @__PURE__ */ e("div", { className: `pvx-entry-grid ${n || ""}`, children: o.map((d) => {
1325
1350
  var c, v;
1326
- const m = a && d.steamId === a;
1327
- return /* @__PURE__ */ l("div", { className: `pvx-entry-card ${m ? "pvx-entry-card--you" : ""}`, children: [
1351
+ const u = i && d.steamId === i;
1352
+ return /* @__PURE__ */ l("div", { className: `pvx-entry-card ${u ? "pvx-entry-card--you" : ""}`, children: [
1328
1353
  d.avatarUrl ? /* @__PURE__ */ e(
1329
1354
  "img",
1330
1355
  {
@@ -1335,29 +1360,29 @@ function zr({ competitionId: r, className: n }) {
1335
1360
  ) : /* @__PURE__ */ e("div", { className: "pvx-entry-avatar pvx-entry-avatar--placeholder", children: ((v = (c = d.displayName) == null ? void 0 : c.charAt(0)) == null ? void 0 : v.toUpperCase()) || "?" }),
1336
1361
  /* @__PURE__ */ l("span", { className: "pvx-entry-name", children: [
1337
1362
  d.displayName,
1338
- m && /* @__PURE__ */ e("span", { className: "pvx-entry-you", children: " (you)" })
1363
+ u && /* @__PURE__ */ e("span", { className: "pvx-entry-you", children: " (you)" })
1339
1364
  ] })
1340
1365
  ] }, d.steamId || d.driverId);
1341
1366
  }) }) : /* @__PURE__ */ e(P, { message: "No drivers registered yet." });
1342
1367
  }
1343
- function Qr({
1368
+ function Xr({
1344
1369
  competitionId: r,
1345
1370
  driverData: n,
1346
1371
  className: s,
1347
1372
  children: t
1348
1373
  }) {
1349
- const { data: i, isLoading: a } = J(r), { isPowerMode: o } = Z(), d = X(r), m = le(r), c = de(r), v = (i == null ? void 0 : i.isRegistered) || !1, f = a || m.isPending || c.isPending, g = m.error || c.error || null, p = () => {
1350
- o && m.mutate(n || {});
1374
+ const { data: a, isLoading: i } = Z(r), { isPowerMode: o } = X(), d = ee(r), u = de(r), c = pe(r), v = (a == null ? void 0 : a.isRegistered) || !1, x = i || u.isPending || c.isPending, N = u.error || c.error || null, p = () => {
1375
+ o && u.mutate(n || {});
1351
1376
  }, b = () => {
1352
1377
  o && c.mutate();
1353
1378
  };
1354
- return typeof t == "function" ? t({ isRegistered: v, isLoading: f, register: p, withdraw: b, error: g, isPowerMode: o, registrationUrl: d }) : o ? /* @__PURE__ */ e(
1379
+ return typeof t == "function" ? t({ isRegistered: v, isLoading: x, register: p, withdraw: b, error: N, isPowerMode: o, registrationUrl: d }) : o ? /* @__PURE__ */ e(
1355
1380
  "button",
1356
1381
  {
1357
1382
  className: `pvx-comp-register-btn ${s || ""}`,
1358
1383
  onClick: v ? b : p,
1359
- disabled: f,
1360
- children: f ? "Loading..." : v ? "Withdraw" : "Register"
1384
+ disabled: x,
1385
+ children: x ? "Loading..." : v ? "Withdraw" : "Register"
1361
1386
  }
1362
1387
  ) : /* @__PURE__ */ e(
1363
1388
  "a",
@@ -1370,44 +1395,44 @@ function Qr({
1370
1395
  }
1371
1396
  );
1372
1397
  }
1373
- function Yr({ competitionId: r, registration: n, onWithdrawSuccess: s, className: t }) {
1374
- const { getSteamId: i } = k(), { isPowerMode: a } = Z(), o = X(r), { data: d, isLoading: m } = J(r), { data: c, isLoading: v } = ce(r), f = le(r), g = de(r), p = i(), b = (d == null ? void 0 : d.isRegistered) || !1, u = (c == null ? void 0 : c.drivers) || (c == null ? void 0 : c.entries) || [], N = n || {}, h = u.length || N.currentCount || 0, x = N.maxParticipants && h >= N.maxParticipants, y = N.deadline && new Date(N.deadline) < /* @__PURE__ */ new Date(), C = N.isOpen && !y && !x;
1375
- return m || v ? /* @__PURE__ */ e(j, { message: "Loading registration..." }) : b ? /* @__PURE__ */ e("div", { className: `pvx-reg-panel ${t || ""}`, children: /* @__PURE__ */ e(
1376
- sr,
1398
+ function en({ competitionId: r, registration: n, onWithdrawSuccess: s, className: t }) {
1399
+ const { getSteamId: a } = k(), { isPowerMode: i } = X(), o = ee(r), { data: d, isLoading: u } = Z(r), { data: c, isLoading: v } = le(r), x = de(r), N = pe(r), p = a(), b = (d == null ? void 0 : d.isRegistered) || !1, g = (c == null ? void 0 : c.drivers) || (c == null ? void 0 : c.entries) || [], m = n || {}, f = g.length || m.currentCount || 0, h = m.maxParticipants && f >= m.maxParticipants, y = m.deadline && new Date(m.deadline) < /* @__PURE__ */ new Date(), L = m.isOpen && !y && !h;
1400
+ return u || v ? /* @__PURE__ */ e(j, { message: "Loading registration..." }) : b ? /* @__PURE__ */ e("div", { className: `pvx-reg-panel ${t || ""}`, children: /* @__PURE__ */ e(
1401
+ or,
1377
1402
  {
1378
1403
  competitionId: r,
1379
- drivers: u,
1404
+ drivers: g,
1380
1405
  steamId: p,
1381
- isPowerMode: a,
1406
+ isPowerMode: i,
1382
1407
  registrationUrl: o,
1383
- withdrawMutation: g,
1408
+ withdrawMutation: N,
1384
1409
  onWithdrawSuccess: s,
1385
- registration: N
1410
+ registration: m
1386
1411
  }
1387
- ) }) : C ? p ? a ? /* @__PURE__ */ e("div", { className: `pvx-reg-panel ${t || ""}`, children: /* @__PURE__ */ e(
1388
- tr,
1412
+ ) }) : L ? p ? i ? /* @__PURE__ */ e("div", { className: `pvx-reg-panel ${t || ""}`, children: /* @__PURE__ */ e(
1413
+ ir,
1389
1414
  {
1390
1415
  competitionId: r,
1391
- registerMutation: f,
1392
- registration: N
1416
+ registerMutation: x,
1417
+ registration: m
1393
1418
  }
1394
- ) }) : /* @__PURE__ */ e("div", { className: `pvx-reg-panel ${t || ""}`, children: /* @__PURE__ */ e("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) : /* @__PURE__ */ e("div", { className: `pvx-reg-panel ${t || ""}`, children: a ? /* @__PURE__ */ e("div", { className: "pvx-reg-status-msg", children: "Sign in to register for this competition." }) : /* @__PURE__ */ e("div", { className: "pvx-reg-status-msg", children: /* @__PURE__ */ e("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) }) : /* @__PURE__ */ l("div", { className: `pvx-reg-panel ${t || ""}`, children: [
1395
- /* @__PURE__ */ e("div", { className: "pvx-reg-status-msg", children: x ? "Registration is full." : y ? "Registration deadline has passed." : "Registration is closed." }),
1396
- u.length > 0 && /* @__PURE__ */ e(fe, { drivers: u, steamId: p })
1419
+ ) }) : /* @__PURE__ */ e("div", { className: `pvx-reg-panel ${t || ""}`, children: /* @__PURE__ */ e("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) : /* @__PURE__ */ e("div", { className: `pvx-reg-panel ${t || ""}`, children: i ? /* @__PURE__ */ e("div", { className: "pvx-reg-status-msg", children: "Sign in to register for this competition." }) : /* @__PURE__ */ e("div", { className: "pvx-reg-status-msg", children: /* @__PURE__ */ e("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) }) : /* @__PURE__ */ l("div", { className: `pvx-reg-panel ${t || ""}`, children: [
1420
+ /* @__PURE__ */ e("div", { className: "pvx-reg-status-msg", children: h ? "Registration is full." : y ? "Registration deadline has passed." : "Registration is closed." }),
1421
+ g.length > 0 && /* @__PURE__ */ e(Ne, { drivers: g, steamId: p })
1397
1422
  ] });
1398
1423
  }
1399
- function tr({ competitionId: r, registerMutation: n, registration: s }) {
1400
- const [t, i] = M(""), [a, o] = M("intermediate"), [d, m] = M(""), c = (p) => {
1424
+ function ir({ competitionId: r, registerMutation: n, registration: s }) {
1425
+ const [t, a] = M(""), [i, o] = M("intermediate"), [d, u] = M(""), c = (p) => {
1401
1426
  p.preventDefault(), n.mutate({
1402
1427
  discordUsername: t || void 0,
1403
- experience: a,
1428
+ experience: i,
1404
1429
  comments: d || void 0
1405
1430
  });
1406
- }, v = s || {}, f = v.currentCount || 0, g = v.maxParticipants;
1431
+ }, v = s || {}, x = v.currentCount || 0, N = v.maxParticipants;
1407
1432
  return /* @__PURE__ */ l("form", { className: "pvx-reg-form", onSubmit: c, children: [
1408
1433
  /* @__PURE__ */ l("div", { className: "pvx-reg-form-header", children: [
1409
1434
  /* @__PURE__ */ e("h3", { className: "pvx-reg-form-title", children: "Register" }),
1410
- g && /* @__PURE__ */ e(Ne, { count: f, max: g })
1435
+ N && /* @__PURE__ */ e(be, { count: x, max: N })
1411
1436
  ] }),
1412
1437
  n.error && /* @__PURE__ */ e("div", { className: "pvx-reg-error", children: n.error.message || "Registration failed" }),
1413
1438
  /* @__PURE__ */ l("div", { className: "pvx-reg-field", children: [
@@ -1423,7 +1448,7 @@ function tr({ competitionId: r, registerMutation: n, registration: s }) {
1423
1448
  className: "pvx-reg-input",
1424
1449
  placeholder: "e.g. username",
1425
1450
  value: t,
1426
- onChange: (p) => i(p.target.value)
1451
+ onChange: (p) => a(p.target.value)
1427
1452
  }
1428
1453
  )
1429
1454
  ] }),
@@ -1434,7 +1459,7 @@ function tr({ competitionId: r, registerMutation: n, registration: s }) {
1434
1459
  {
1435
1460
  id: `pvx-exp-${r}`,
1436
1461
  className: "pvx-reg-select",
1437
- value: a,
1462
+ value: i,
1438
1463
  onChange: (p) => o(p.target.value),
1439
1464
  children: [
1440
1465
  /* @__PURE__ */ e("option", { value: "beginner", children: "Beginner" }),
@@ -1457,7 +1482,7 @@ function tr({ competitionId: r, registerMutation: n, registration: s }) {
1457
1482
  rows: 3,
1458
1483
  placeholder: "Anything the organisers should know?",
1459
1484
  value: d,
1460
- onChange: (p) => m(p.target.value)
1485
+ onChange: (p) => u(p.target.value)
1461
1486
  }
1462
1487
  )
1463
1488
  ] }),
@@ -1472,22 +1497,22 @@ function tr({ competitionId: r, registerMutation: n, registration: s }) {
1472
1497
  ) })
1473
1498
  ] });
1474
1499
  }
1475
- function sr({ competitionId: r, drivers: n, steamId: s, isPowerMode: t, registrationUrl: i, withdrawMutation: a, onWithdrawSuccess: o, registration: d }) {
1476
- const [m, c] = M(!1), v = () => {
1477
- a.mutate(void 0, {
1500
+ function or({ competitionId: r, drivers: n, steamId: s, isPowerMode: t, registrationUrl: a, withdrawMutation: i, onWithdrawSuccess: o, registration: d }) {
1501
+ const [u, c] = M(!1), v = () => {
1502
+ i.mutate(void 0, {
1478
1503
  onSuccess: () => {
1479
1504
  c(!1), o && o();
1480
1505
  }
1481
1506
  });
1482
- }, f = d || {}, g = n.length || f.currentCount || 0, p = f.maxParticipants;
1507
+ }, x = d || {}, N = n.length || x.currentCount || 0, p = x.maxParticipants;
1483
1508
  return /* @__PURE__ */ l(A, { children: [
1484
1509
  /* @__PURE__ */ l("div", { className: "pvx-reg-form-header", children: [
1485
1510
  /* @__PURE__ */ e("h3", { className: "pvx-reg-form-title", children: "Registered Drivers" }),
1486
- p && /* @__PURE__ */ e(Ne, { count: g, max: p })
1511
+ p && /* @__PURE__ */ e(be, { count: N, max: p })
1487
1512
  ] }),
1488
- /* @__PURE__ */ e(fe, { drivers: n, steamId: s }),
1489
- a.error && /* @__PURE__ */ e("div", { className: "pvx-reg-error", children: a.error.message || "Withdrawal failed" }),
1490
- t ? /* @__PURE__ */ e("div", { className: "pvx-reg-actions", children: m ? /* @__PURE__ */ l("div", { className: "pvx-reg-confirm", children: [
1513
+ /* @__PURE__ */ e(Ne, { drivers: n, steamId: s }),
1514
+ i.error && /* @__PURE__ */ e("div", { className: "pvx-reg-error", children: i.error.message || "Withdrawal failed" }),
1515
+ t ? /* @__PURE__ */ e("div", { className: "pvx-reg-actions", children: u ? /* @__PURE__ */ l("div", { className: "pvx-reg-confirm", children: [
1491
1516
  /* @__PURE__ */ e("p", { className: "pvx-reg-confirm-text", children: "Are you sure you want to unregister?" }),
1492
1517
  /* @__PURE__ */ l("div", { className: "pvx-reg-confirm-actions", children: [
1493
1518
  /* @__PURE__ */ e(
@@ -1505,8 +1530,8 @@ function sr({ competitionId: r, drivers: n, steamId: s, isPowerMode: t, registra
1505
1530
  type: "button",
1506
1531
  className: "pvx-reg-danger-btn",
1507
1532
  onClick: v,
1508
- disabled: a.isPending,
1509
- children: a.isPending ? "Unregistering..." : "Yes, Unregister"
1533
+ disabled: i.isPending,
1534
+ children: i.isPending ? "Unregistering..." : "Yes, Unregister"
1510
1535
  }
1511
1536
  )
1512
1537
  ] })
@@ -1518,28 +1543,28 @@ function sr({ competitionId: r, drivers: n, steamId: s, isPowerMode: t, registra
1518
1543
  onClick: () => c(!0),
1519
1544
  children: "Unregister"
1520
1545
  }
1521
- ) }) : /* @__PURE__ */ e("div", { className: "pvx-reg-actions", children: /* @__PURE__ */ e("a", { href: i, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Manage on PitVox" }) })
1546
+ ) }) : /* @__PURE__ */ e("div", { className: "pvx-reg-actions", children: /* @__PURE__ */ e("a", { href: a, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Manage on PitVox" }) })
1522
1547
  ] });
1523
1548
  }
1524
- function fe({ drivers: r, steamId: n }) {
1549
+ function Ne({ drivers: r, steamId: n }) {
1525
1550
  if (!r.length)
1526
1551
  return /* @__PURE__ */ e("div", { className: "pvx-reg-no-drivers", children: "No drivers registered yet." });
1527
- const s = [...r].sort((t, i) => {
1528
- const a = n && t.steamId === n ? -1 : 0, o = n && i.steamId === n ? -1 : 0;
1529
- return a - o;
1552
+ const s = [...r].sort((t, a) => {
1553
+ const i = n && t.steamId === n ? -1 : 0, o = n && a.steamId === n ? -1 : 0;
1554
+ return i - o;
1530
1555
  });
1531
1556
  return /* @__PURE__ */ e("div", { className: "pvx-reg-driver-list", children: s.map((t) => {
1532
- var a, o;
1533
- const i = n && t.steamId === n;
1557
+ var i, o;
1558
+ const a = n && t.steamId === n;
1534
1559
  return /* @__PURE__ */ l(
1535
1560
  "div",
1536
1561
  {
1537
- className: `pvx-reg-driver-row ${i ? "pvx-reg-driver-row--you" : ""}`,
1562
+ className: `pvx-reg-driver-row ${a ? "pvx-reg-driver-row--you" : ""}`,
1538
1563
  children: [
1539
- t.avatarUrl ? /* @__PURE__ */ e("img", { src: t.avatarUrl, alt: "", className: "pvx-reg-driver-avatar" }) : /* @__PURE__ */ e("div", { className: "pvx-reg-driver-avatar pvx-reg-driver-avatar--placeholder", children: ((o = (a = t.displayName) == null ? void 0 : a.charAt(0)) == null ? void 0 : o.toUpperCase()) || "?" }),
1564
+ t.avatarUrl ? /* @__PURE__ */ e("img", { src: t.avatarUrl, alt: "", className: "pvx-reg-driver-avatar" }) : /* @__PURE__ */ e("div", { className: "pvx-reg-driver-avatar pvx-reg-driver-avatar--placeholder", children: ((o = (i = t.displayName) == null ? void 0 : i.charAt(0)) == null ? void 0 : o.toUpperCase()) || "?" }),
1540
1565
  /* @__PURE__ */ l("span", { className: "pvx-reg-driver-name", children: [
1541
1566
  t.displayName,
1542
- i && /* @__PURE__ */ e("span", { className: "pvx-entry-you", children: " (you)" })
1567
+ a && /* @__PURE__ */ e("span", { className: "pvx-entry-you", children: " (you)" })
1543
1568
  ] })
1544
1569
  ]
1545
1570
  },
@@ -1547,7 +1572,7 @@ function fe({ drivers: r, steamId: n }) {
1547
1572
  );
1548
1573
  }) });
1549
1574
  }
1550
- function Ne({ count: r, max: n }) {
1575
+ function be({ count: r, max: n }) {
1551
1576
  const s = n ? r / n * 100 : 0, t = s >= 100 ? "full" : s >= 75 ? "warning" : "ok";
1552
1577
  return /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${t}`, children: [
1553
1578
  r,
@@ -1556,10 +1581,10 @@ function Ne({ count: r, max: n }) {
1556
1581
  " drivers"
1557
1582
  ] });
1558
1583
  }
1559
- function ar(r) {
1560
- const { cdnUrl: n } = k(), s = L({
1584
+ function cr(r) {
1585
+ const { cdnUrl: n } = k(), s = C({
1561
1586
  queryKey: ["pitvox", "laps", "global", r],
1562
- queryFn: () => T(n, `laps/${r}.json`),
1587
+ queryFn: () => R(n, `laps/${r}.json`),
1563
1588
  enabled: !!r,
1564
1589
  staleTime: 3e4,
1565
1590
  refetchInterval: 3e4
@@ -1582,22 +1607,22 @@ function ar(r) {
1582
1607
  } : null
1583
1608
  };
1584
1609
  }
1585
- function be(r = {}) {
1586
- const { cdnUrl: n, partnerSlug: s } = k(), { gameVersion: t, enabled: i = !0 } = r, a = t ? `leaderboards/partners/${s}/v/${t}/ratings.json` : `leaderboards/partners/${s}/ratings.json`;
1587
- return L({
1610
+ function ye(r = {}) {
1611
+ const { cdnUrl: n, partnerSlug: s } = k(), { gameVersion: t, enabled: a = !0 } = r, i = t ? `v/${t}/` : "", o = J(s, `${i}ratings.json`);
1612
+ return C({
1588
1613
  queryKey: ["pitvox", "ratings", s, t || null],
1589
- queryFn: () => T(n, a),
1614
+ queryFn: () => R(n, o),
1590
1615
  staleTime: 3e4,
1591
1616
  refetchInterval: 3e4,
1592
- enabled: i
1617
+ enabled: a
1593
1618
  });
1594
1619
  }
1595
- function ir(r) {
1620
+ function lr(r) {
1596
1621
  var t;
1597
- const n = be(), s = w(() => {
1598
- var i;
1599
- return !((i = n.data) != null && i.drivers) || !r ? null : n.data.drivers.find(
1600
- (a) => a.identifier === r
1622
+ const n = ye(), s = w(() => {
1623
+ var a;
1624
+ return !((a = n.data) != null && a.drivers) || !r ? null : n.data.drivers.find(
1625
+ (i) => i.identifier === r
1601
1626
  ) || null;
1602
1627
  }, [(t = n.data) == null ? void 0 : t.drivers, r]);
1603
1628
  return {
@@ -1613,48 +1638,48 @@ function ir(r) {
1613
1638
  } : null
1614
1639
  };
1615
1640
  }
1616
- function Jr(r = {}) {
1617
- const n = be(r);
1641
+ function rn(r = {}) {
1642
+ const n = ye(r);
1618
1643
  return {
1619
1644
  data: n.data || null,
1620
1645
  isLoading: n.isLoading,
1621
1646
  error: n.error
1622
1647
  };
1623
1648
  }
1624
- function or() {
1625
- const { cdnUrl: r, partnerSlug: n, getSteamId: s, onFetchServerPassword: t } = k(), i = s(), { data: a, isLoading: o } = L({
1649
+ function dr() {
1650
+ const { cdnUrl: r, partnerSlug: n, getSteamId: s, onFetchServerPassword: t } = k(), a = s(), { data: i, isLoading: o } = C({
1626
1651
  queryKey: ["pitvox", "competitions", n],
1627
1652
  queryFn: async () => {
1628
- const p = await T(r, "competitions/index.json");
1653
+ const p = await R(r, "competitions/index.json");
1629
1654
  return p != null && p.competitions ? p.competitions.filter((b) => b.partnerSlug === n) : [];
1630
1655
  },
1631
1656
  staleTime: 6e4
1632
- }), d = (a == null ? void 0 : a.map((p) => p.id)) || [], m = ne({
1657
+ }), d = (i == null ? void 0 : i.map((p) => p.id)) || [], u = te({
1633
1658
  queries: d.map((p) => ({
1634
1659
  queryKey: ["pitvox", "competition", n, p, "entrylist"],
1635
- queryFn: () => T(r, `competitions/${n}/${p}/entrylist.json`),
1636
- enabled: !!i && d.length > 0,
1660
+ queryFn: () => R(r, `competitions/${n}/${p}/entrylist.json`),
1661
+ enabled: !!a && d.length > 0,
1637
1662
  staleTime: 6e4
1638
1663
  }))
1639
- }), c = m.some((p) => p.isLoading), v = w(() => {
1640
- var u, N;
1641
- if (!a || !i || c) return [];
1664
+ }), c = u.some((p) => p.isLoading), v = w(() => {
1665
+ var g, m;
1666
+ if (!i || !a || c) return [];
1642
1667
  const p = /* @__PURE__ */ new Date(), b = [];
1643
- for (let h = 0; h < a.length; h++) {
1644
- const x = a[h], y = (u = m[h]) == null ? void 0 : u.data;
1645
- if (!((N = y == null ? void 0 : y.drivers) == null ? void 0 : N.some((S) => S.steamId === i))) continue;
1646
- const $ = x.rounds || [];
1668
+ for (let f = 0; f < i.length; f++) {
1669
+ const h = i[f], y = (g = u[f]) == null ? void 0 : g.data;
1670
+ if (!((m = y == null ? void 0 : y.drivers) == null ? void 0 : m.some((S) => S.steamId === a))) continue;
1671
+ const $ = h.rounds || [];
1647
1672
  for (const S of $)
1648
1673
  S.isFinalized || !S.startTime || new Date(S.startTime) <= p || b.push({
1649
- competitionId: x.id,
1650
- competitionName: x.name,
1674
+ competitionId: h.id,
1675
+ competitionName: h.name,
1651
1676
  roundNumber: S.roundNumber,
1652
1677
  track: S.track || "TBD",
1653
1678
  startTime: S.startTime
1654
1679
  });
1655
1680
  }
1656
- return b.sort((h, x) => new Date(h.startTime) - new Date(x.startTime)), b.length > 0 && (b[0].isNext = !0), b;
1657
- }, [a, i, c, m]), f = ne({
1681
+ return b.sort((f, h) => new Date(f.startTime) - new Date(h.startTime)), b.length > 0 && (b[0].isNext = !0), b;
1682
+ }, [i, a, c, u]), x = te({
1658
1683
  queries: v.map((p) => ({
1659
1684
  queryKey: ["pitvox", "serverInfo", p.competitionId, p.roundNumber],
1660
1685
  queryFn: () => t(p.competitionId, p.roundNumber),
@@ -1666,43 +1691,43 @@ function or() {
1666
1691
  });
1667
1692
  return {
1668
1693
  data: w(() => v.length ? t ? v.map((p, b) => {
1669
- var N;
1670
- const u = (N = f[b]) == null ? void 0 : N.data;
1671
- return u != null && u.success ? {
1694
+ var m;
1695
+ const g = (m = x[b]) == null ? void 0 : m.data;
1696
+ return g != null && g.success ? {
1672
1697
  ...p,
1673
- serverAddress: u.serverAddress || null,
1674
- serverPassword: u.serverPassword || null
1698
+ serverAddress: g.serverAddress || null,
1699
+ serverPassword: g.serverPassword || null
1675
1700
  } : p;
1676
- }) : v : [], [v, t, f]),
1677
- isLoading: o || !!i && c
1701
+ }) : v : [], [v, t, x]),
1702
+ isLoading: o || !!a && c
1678
1703
  };
1679
1704
  }
1680
- function cr() {
1705
+ function pr() {
1681
1706
  const { onFetchNotifications: r } = k();
1682
1707
  return !!r;
1683
1708
  }
1684
- function lr(r = {}) {
1685
- const { onFetchNotifications: n, partnerSlug: s } = k(), { limit: t = 20, unreadOnly: i = !1 } = r;
1686
- return L({
1687
- queryKey: ["pitvox", "notifications", s, { limit: t, unreadOnly: i }],
1688
- queryFn: () => n({ limit: t, unreadOnly: i }),
1709
+ function ur(r = {}) {
1710
+ const { onFetchNotifications: n, partnerSlug: s } = k(), { limit: t = 20, unreadOnly: a = !1 } = r;
1711
+ return C({
1712
+ queryKey: ["pitvox", "notifications", s, { limit: t, unreadOnly: a }],
1713
+ queryFn: () => n({ limit: t, unreadOnly: a }),
1689
1714
  enabled: !!n,
1690
1715
  staleTime: 3e4,
1691
1716
  refetchInterval: 3e4
1692
1717
  });
1693
1718
  }
1694
- function Zr() {
1695
- const { onFetchNotifications: r, partnerSlug: n } = k(), { data: s, isLoading: t } = L({
1719
+ function nn() {
1720
+ const { onFetchNotifications: r, partnerSlug: n } = k(), { data: s, isLoading: t } = C({
1696
1721
  queryKey: ["pitvox", "notifications", n, { limit: 1, unreadOnly: !1 }],
1697
1722
  queryFn: () => r({ limit: 1 }),
1698
1723
  enabled: !!r,
1699
1724
  staleTime: 3e4,
1700
1725
  refetchInterval: 3e4,
1701
- select: (i) => (i == null ? void 0 : i.unreadCount) ?? 0
1726
+ select: (a) => (a == null ? void 0 : a.unreadCount) ?? 0
1702
1727
  });
1703
1728
  return { count: s ?? 0, isLoading: t };
1704
1729
  }
1705
- function dr() {
1730
+ function mr() {
1706
1731
  const { onMarkNotificationRead: r, partnerSlug: n } = k(), s = U();
1707
1732
  return H({
1708
1733
  mutationFn: (t) => {
@@ -1710,21 +1735,21 @@ function dr() {
1710
1735
  throw new Error("No onMarkNotificationRead callback provided to PitVoxPartnerProvider.");
1711
1736
  return r(t);
1712
1737
  },
1713
- onSuccess: (t, i) => {
1738
+ onSuccess: (t, a) => {
1714
1739
  s.setQueriesData(
1715
1740
  { queryKey: ["pitvox", "notifications", n] },
1716
- (a) => a != null && a.notifications ? {
1717
- ...a,
1718
- unreadCount: Math.max(0, (a.unreadCount || 0) - 1),
1719
- notifications: a.notifications.map(
1720
- (o) => o.id === i ? { ...o, isRead: !0, readAt: (/* @__PURE__ */ new Date()).toISOString() } : o
1741
+ (i) => i != null && i.notifications ? {
1742
+ ...i,
1743
+ unreadCount: Math.max(0, (i.unreadCount || 0) - 1),
1744
+ notifications: i.notifications.map(
1745
+ (o) => o.id === a ? { ...o, isRead: !0, readAt: (/* @__PURE__ */ new Date()).toISOString() } : o
1721
1746
  )
1722
- } : a
1747
+ } : i
1723
1748
  );
1724
1749
  }
1725
1750
  });
1726
1751
  }
1727
- function pr() {
1752
+ function vr() {
1728
1753
  const { onMarkAllNotificationsRead: r, partnerSlug: n } = k(), s = U();
1729
1754
  return H({
1730
1755
  mutationFn: () => {
@@ -1738,30 +1763,30 @@ function pr() {
1738
1763
  (t) => t != null && t.notifications ? {
1739
1764
  ...t,
1740
1765
  unreadCount: 0,
1741
- notifications: t.notifications.map((i) => ({
1742
- ...i,
1766
+ notifications: t.notifications.map((a) => ({
1767
+ ...a,
1743
1768
  isRead: !0,
1744
- readAt: i.readAt || (/* @__PURE__ */ new Date()).toISOString()
1769
+ readAt: a.readAt || (/* @__PURE__ */ new Date()).toISOString()
1745
1770
  }))
1746
1771
  } : t
1747
1772
  );
1748
1773
  }
1749
1774
  });
1750
1775
  }
1751
- function ur({ driverName: r, avatarUrl: n, memberSince: s, className: t = "" }) {
1752
- const i = s ? new Date(s).toLocaleDateString("en-GB", { day: "2-digit", month: "2-digit", year: "numeric" }) : null;
1776
+ function hr({ driverName: r, avatarUrl: n, memberSince: s, className: t = "" }) {
1777
+ const a = s ? new Date(s).toLocaleDateString("en-GB", { day: "2-digit", month: "2-digit", year: "numeric" }) : null;
1753
1778
  return /* @__PURE__ */ l("div", { className: `pvx-card pvx-dash-profile ${t}`, children: [
1754
1779
  n ? /* @__PURE__ */ e("img", { src: n, alt: "", className: "pvx-dash-profile-avatar" }) : /* @__PURE__ */ e("div", { className: "pvx-dash-profile-avatar pvx-dash-profile-avatar--placeholder", children: (r || "?")[0].toUpperCase() }),
1755
1780
  /* @__PURE__ */ l("div", { className: "pvx-dash-profile-info", children: [
1756
1781
  /* @__PURE__ */ e("h2", { className: "pvx-dash-profile-name", children: r }),
1757
- i && /* @__PURE__ */ l("p", { className: "pvx-dash-profile-since", children: [
1782
+ a && /* @__PURE__ */ l("p", { className: "pvx-dash-profile-since", children: [
1758
1783
  "Racing since ",
1759
- i
1784
+ a
1760
1785
  ] })
1761
1786
  ] })
1762
1787
  ] });
1763
1788
  }
1764
- function mr() {
1789
+ function xr() {
1765
1790
  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: [
1766
1791
  /* @__PURE__ */ e("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
1767
1792
  /* @__PURE__ */ e("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
@@ -1769,7 +1794,7 @@ function mr() {
1769
1794
  /* @__PURE__ */ e("line", { x1: "16", y1: "3", x2: "14", y2: "21" })
1770
1795
  ] });
1771
1796
  }
1772
- function vr() {
1797
+ function gr() {
1773
1798
  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: [
1774
1799
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
1775
1800
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "2" }),
@@ -1778,23 +1803,23 @@ function vr() {
1778
1803
  /* @__PURE__ */ e("path", { d: "M13.5 12.5l4 2.5" })
1779
1804
  ] });
1780
1805
  }
1781
- function hr() {
1806
+ function fr() {
1782
1807
  return /* @__PURE__ */ e("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("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" }) });
1783
1808
  }
1784
- function se({ icon: r, value: n, label: s, items: t, labelKey: i, countKey: a }) {
1785
- const [o, d] = M(!1), m = Ce(null);
1786
- Le(() => {
1809
+ function ae({ icon: r, value: n, label: s, items: t, labelKey: a, countKey: i }) {
1810
+ const [o, d] = M(!1), u = Le(null);
1811
+ Re(() => {
1787
1812
  if (!o) return;
1788
- function v(f) {
1789
- m.current && !m.current.contains(f.target) && d(!1);
1813
+ function v(x) {
1814
+ u.current && !u.current.contains(x.target) && d(!1);
1790
1815
  }
1791
1816
  return document.addEventListener("mousedown", v), () => document.removeEventListener("mousedown", v);
1792
1817
  }, [o]);
1793
- const c = t != null && t.length ? t.slice().sort((v, f) => f[a] - v[a]) : null;
1818
+ const c = t != null && t.length ? t.slice().sort((v, x) => x[i] - v[i]) : null;
1794
1819
  return /* @__PURE__ */ l(
1795
1820
  "div",
1796
1821
  {
1797
- ref: m,
1822
+ ref: u,
1798
1823
  className: `pvx-dash-stat-card ${c ? "pvx-dash-stat-card--clickable" : ""}`,
1799
1824
  onClick: c ? () => d((v) => !v) : void 0,
1800
1825
  children: [
@@ -1803,28 +1828,28 @@ function se({ icon: r, value: n, label: s, items: t, labelKey: i, countKey: a })
1803
1828
  /* @__PURE__ */ e("span", { className: "pvx-dash-stat-value", children: n }),
1804
1829
  /* @__PURE__ */ e("span", { className: "pvx-dash-stat-label", children: s })
1805
1830
  ] }),
1806
- c && /* @__PURE__ */ e("div", { className: `pvx-dash-tooltip pvx-dash-tooltip--scrollable ${o ? "pvx-dash-tooltip--open" : ""}`, children: c.map((v, f) => /* @__PURE__ */ l("div", { className: "pvx-dash-tooltip-row", children: [
1807
- /* @__PURE__ */ e("span", { className: "pvx-dash-tooltip-label", children: v[i] }),
1808
- /* @__PURE__ */ e("span", { className: "pvx-dash-tooltip-value", children: v[a] })
1809
- ] }, f)) })
1831
+ c && /* @__PURE__ */ e("div", { className: `pvx-dash-tooltip pvx-dash-tooltip--scrollable ${o ? "pvx-dash-tooltip--open" : ""}`, children: c.map((v, x) => /* @__PURE__ */ l("div", { className: "pvx-dash-tooltip-row", children: [
1832
+ /* @__PURE__ */ e("span", { className: "pvx-dash-tooltip-label", children: v[a] }),
1833
+ /* @__PURE__ */ e("span", { className: "pvx-dash-tooltip-value", children: v[i] })
1834
+ ] }, x)) })
1810
1835
  ]
1811
1836
  }
1812
1837
  );
1813
1838
  }
1814
- function xr({ stats: r, rating: n, className: s = "" }) {
1839
+ function Nr({ stats: r, rating: n, className: s = "" }) {
1815
1840
  if (!r) return null;
1816
- const t = r.trackBreakdown.map((a) => ({
1817
- name: E(a.trackId, a.layout),
1818
- lapCount: a.lapCount
1819
- })), i = r.carBreakdown.map((a) => ({
1820
- name: I(a.carId),
1821
- lapCount: a.lapCount
1841
+ const t = r.trackBreakdown.map((i) => ({
1842
+ name: E(i.trackId, i.layout),
1843
+ lapCount: i.lapCount
1844
+ })), a = r.carBreakdown.map((i) => ({
1845
+ name: I(i.carId),
1846
+ lapCount: i.lapCount
1822
1847
  }));
1823
1848
  return /* @__PURE__ */ l("div", { className: `pvx-dash-stats ${s}`, children: [
1824
1849
  /* @__PURE__ */ e(
1825
- se,
1850
+ ae,
1826
1851
  {
1827
- icon: /* @__PURE__ */ e(mr, {}),
1852
+ icon: /* @__PURE__ */ e(xr, {}),
1828
1853
  value: r.lapCount.toLocaleString(),
1829
1854
  label: "Total Laps",
1830
1855
  items: t,
@@ -1833,18 +1858,18 @@ function xr({ stats: r, rating: n, className: s = "" }) {
1833
1858
  }
1834
1859
  ),
1835
1860
  /* @__PURE__ */ e(
1836
- se,
1861
+ ae,
1837
1862
  {
1838
- icon: /* @__PURE__ */ e(vr, {}),
1863
+ icon: /* @__PURE__ */ e(gr, {}),
1839
1864
  value: r.carBreakdown.length,
1840
1865
  label: "Cars Used",
1841
- items: i,
1866
+ items: a,
1842
1867
  labelKey: "name",
1843
1868
  countKey: "lapCount"
1844
1869
  }
1845
1870
  ),
1846
1871
  n && /* @__PURE__ */ l("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--rating", children: [
1847
- /* @__PURE__ */ e(hr, {}),
1872
+ /* @__PURE__ */ e(fr, {}),
1848
1873
  /* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
1849
1874
  /* @__PURE__ */ e("span", { className: "pvx-dash-stat-value", children: n.rating.toFixed(1) }),
1850
1875
  /* @__PURE__ */ e("span", { className: "pvx-dash-stat-label", children: "Driver Rating" }),
@@ -1858,10 +1883,10 @@ function xr({ stats: r, rating: n, className: s = "" }) {
1858
1883
  ] })
1859
1884
  ] });
1860
1885
  }
1861
- function gr({ records: r, className: n = "" }) {
1862
- const s = w(() => r != null && r.length ? r.slice().sort((t, i) => {
1863
- const a = t.recordedAt ? new Date(t.recordedAt).getTime() : 0;
1864
- return (i.recordedAt ? new Date(i.recordedAt).getTime() : 0) - a;
1886
+ function br({ records: r, className: n = "" }) {
1887
+ const s = w(() => r != null && r.length ? r.slice().sort((t, a) => {
1888
+ const i = t.recordedAt ? new Date(t.recordedAt).getTime() : 0;
1889
+ return (a.recordedAt ? new Date(a.recordedAt).getTime() : 0) - i;
1865
1890
  }) : [], [r]);
1866
1891
  return s.length ? /* @__PURE__ */ l("div", { className: `pvx-card ${n}`, children: [
1867
1892
  /* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
@@ -1880,7 +1905,7 @@ function gr({ records: r, className: n = "" }) {
1880
1905
  ")"
1881
1906
  ] })
1882
1907
  ] }) }),
1883
- /* @__PURE__ */ e("div", { className: "pvx-dash-records-list", children: s.map((t, i) => /* @__PURE__ */ l("div", { className: "pvx-dash-record-row", children: [
1908
+ /* @__PURE__ */ e("div", { className: "pvx-dash-records-list", children: s.map((t, a) => /* @__PURE__ */ l("div", { className: "pvx-dash-record-row", children: [
1884
1909
  /* @__PURE__ */ l("div", { className: "pvx-dash-record-info", children: [
1885
1910
  /* @__PURE__ */ e("span", { className: "pvx-dash-record-track", children: E(t.trackId, t.layout, t.game) }),
1886
1911
  /* @__PURE__ */ e("span", { className: "pvx-dash-record-car", children: I(t.carId) })
@@ -1892,18 +1917,18 @@ function gr({ records: r, className: n = "" }) {
1892
1917
  t.gameVersion ? ` ${t.gameVersion}` : ""
1893
1918
  ] })
1894
1919
  ] })
1895
- ] }, i)) })
1920
+ ] }, a)) })
1896
1921
  ] }) : null;
1897
1922
  }
1898
- function fr({ events: r, isLoading: n, className: s, limit: t = 3 }) {
1923
+ function yr({ events: r, isLoading: n, className: s, limit: t = 3 }) {
1899
1924
  if (n)
1900
1925
  return /* @__PURE__ */ e("div", { className: "pvx-loading", children: "Loading upcoming events..." });
1901
1926
  if (!(r != null && r.length))
1902
1927
  return null;
1903
- const i = t ? r.slice(0, t) : r, a = r.length - i.length;
1928
+ const a = t ? r.slice(0, t) : r, i = r.length - a.length;
1904
1929
  return /* @__PURE__ */ l("div", { className: `pvx-card ${s || ""}`, children: [
1905
1930
  /* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
1906
- /* @__PURE__ */ e(yr, {}),
1931
+ /* @__PURE__ */ e(Cr, {}),
1907
1932
  "Upcoming Events",
1908
1933
  /* @__PURE__ */ l("span", { className: "pvx-dash-records-count", children: [
1909
1934
  "(",
@@ -1912,7 +1937,7 @@ function fr({ events: r, isLoading: n, className: s, limit: t = 3 }) {
1912
1937
  ] })
1913
1938
  ] }) }),
1914
1939
  /* @__PURE__ */ l("div", { className: "pvx-upcoming-list", children: [
1915
- i.map((o) => /* @__PURE__ */ l(
1940
+ a.map((o) => /* @__PURE__ */ l(
1916
1941
  "div",
1917
1942
  {
1918
1943
  className: `pvx-upcoming-item ${o.isNext ? "pvx-upcoming-item--next" : ""}`,
@@ -1926,7 +1951,7 @@ function fr({ events: r, isLoading: n, className: s, limit: t = 3 }) {
1926
1951
  o.track
1927
1952
  ] }),
1928
1953
  o.serverPassword && /* @__PURE__ */ e(
1929
- Nr,
1954
+ kr,
1930
1955
  {
1931
1956
  password: o.serverPassword,
1932
1957
  address: o.serverAddress
@@ -1939,24 +1964,24 @@ function fr({ events: r, isLoading: n, className: s, limit: t = 3 }) {
1939
1964
  month: "short",
1940
1965
  year: "numeric"
1941
1966
  }) }),
1942
- /* @__PURE__ */ e("span", { className: "pvx-upcoming-relative", children: br(o.startTime) }),
1967
+ /* @__PURE__ */ e("span", { className: "pvx-upcoming-relative", children: wr(o.startTime) }),
1943
1968
  o.isNext && /* @__PURE__ */ e("span", { className: "pvx-upcoming-badge", children: "Next" })
1944
1969
  ] })
1945
1970
  ]
1946
1971
  },
1947
1972
  `${o.competitionId}-${o.roundNumber}`
1948
1973
  )),
1949
- a > 0 && /* @__PURE__ */ l("div", { className: "pvx-upcoming-remaining", children: [
1974
+ i > 0 && /* @__PURE__ */ l("div", { className: "pvx-upcoming-remaining", children: [
1950
1975
  "+",
1951
- a,
1976
+ i,
1952
1977
  " more event",
1953
- a !== 1 ? "s" : ""
1978
+ i !== 1 ? "s" : ""
1954
1979
  ] })
1955
1980
  ] })
1956
1981
  ] });
1957
1982
  }
1958
- function Nr({ password: r, address: n }) {
1959
- const [s, t] = M(!1), [i, a] = M(!1), o = n ? r ? `join:${n}|${r}` : `join:${n}` : null, d = K(async () => {
1983
+ function kr({ password: r, address: n }) {
1984
+ const [s, t] = M(!1), [a, i] = M(!1), o = n ? r ? `join:${n}|${r}` : `join:${n}` : null, d = K(async () => {
1960
1985
  if (o)
1961
1986
  try {
1962
1987
  await navigator.clipboard.writeText(o), t(!0), setTimeout(() => t(!1), 2e3);
@@ -1971,7 +1996,7 @@ function Nr({ password: r, address: n }) {
1971
1996
  onClick: d,
1972
1997
  title: "Copy join string to clipboard",
1973
1998
  children: [
1974
- /* @__PURE__ */ e(wr, {}),
1999
+ /* @__PURE__ */ e(Rr, {}),
1975
2000
  " ",
1976
2001
  s ? "Copied!" : "Join"
1977
2002
  ]
@@ -1982,20 +2007,20 @@ function Nr({ password: r, address: n }) {
1982
2007
  "span",
1983
2008
  {
1984
2009
  className: "pvx-server-detail pvx-server-detail--clickable",
1985
- onClick: () => a((m) => !m),
1986
- title: i ? "Hide password" : "Reveal password",
1987
- children: i ? /* @__PURE__ */ e(Lr, {}) : /* @__PURE__ */ e(Cr, {})
2010
+ onClick: () => i((u) => !u),
2011
+ title: a ? "Hide password" : "Reveal password",
2012
+ children: a ? /* @__PURE__ */ e(Sr, {}) : /* @__PURE__ */ e(Tr, {})
1988
2013
  }
1989
2014
  ),
1990
- i && /* @__PURE__ */ l("span", { className: "pvx-server-detail", children: [
1991
- /* @__PURE__ */ e(kr, {}),
2015
+ a && /* @__PURE__ */ l("span", { className: "pvx-server-detail", children: [
2016
+ /* @__PURE__ */ e(Lr, {}),
1992
2017
  " ",
1993
2018
  r
1994
2019
  ] })
1995
2020
  ] })
1996
2021
  ] });
1997
2022
  }
1998
- function br(r) {
2023
+ function wr(r) {
1999
2024
  const n = new Date(r).getTime() - Date.now();
2000
2025
  if (n <= 0) return "Now";
2001
2026
  const s = Math.floor(n / (1e3 * 60 * 60));
@@ -2005,54 +2030,54 @@ function br(r) {
2005
2030
  if (t === 1) return "Tomorrow";
2006
2031
  if (t < 7) return `in ${t} days`;
2007
2032
  if (t < 30) {
2008
- const i = Math.floor(t / 7);
2009
- return `in ${i} week${i !== 1 ? "s" : ""}`;
2033
+ const a = Math.floor(t / 7);
2034
+ return `in ${a} week${a !== 1 ? "s" : ""}`;
2010
2035
  }
2011
- return ae(r);
2036
+ return ie(r);
2012
2037
  }
2013
- function yr() {
2038
+ function Cr() {
2014
2039
  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: [
2015
2040
  /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
2016
2041
  /* @__PURE__ */ e("path", { d: "M16 2v4M8 2v4M3 10h18" })
2017
2042
  ] });
2018
2043
  }
2019
- function kr() {
2044
+ function Lr() {
2020
2045
  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: [
2021
2046
  /* @__PURE__ */ e("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2" }),
2022
2047
  /* @__PURE__ */ e("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
2023
2048
  ] });
2024
2049
  }
2025
- function wr() {
2050
+ function Rr() {
2026
2051
  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: [
2027
2052
  /* @__PURE__ */ e("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
2028
2053
  /* @__PURE__ */ e("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
2029
2054
  ] });
2030
2055
  }
2031
- function Cr() {
2056
+ function Tr() {
2032
2057
  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: [
2033
2058
  /* @__PURE__ */ e("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
2034
2059
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "3" })
2035
2060
  ] });
2036
2061
  }
2037
- function Lr() {
2062
+ function Sr() {
2038
2063
  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: [
2039
2064
  /* @__PURE__ */ e("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" }),
2040
2065
  /* @__PURE__ */ e("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
2041
2066
  ] });
2042
2067
  }
2043
- function Rr({ notifications: r, unreadCount: n = 0, onMarkRead: s, onMarkAllRead: t, isLoading: i, className: a }) {
2044
- const o = oe();
2045
- return i ? /* @__PURE__ */ e("div", { className: "pvx-loading", children: "Loading notifications..." }) : /* @__PURE__ */ l("div", { className: `pvx-card ${a || ""}`, children: [
2068
+ function $r({ notifications: r, unreadCount: n = 0, onMarkRead: s, onMarkAllRead: t, isLoading: a, className: i }) {
2069
+ const o = ce();
2070
+ return a ? /* @__PURE__ */ e("div", { className: "pvx-loading", children: "Loading notifications..." }) : /* @__PURE__ */ l("div", { className: `pvx-card ${i || ""}`, children: [
2046
2071
  /* @__PURE__ */ l("div", { className: "pvx-card-header", children: [
2047
2072
  /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
2048
- /* @__PURE__ */ e($r, {}),
2073
+ /* @__PURE__ */ e(Dr, {}),
2049
2074
  "Notifications",
2050
2075
  n > 0 && /* @__PURE__ */ e("span", { className: "pvx-notif-badge", children: n > 99 ? "99+" : n })
2051
2076
  ] }),
2052
2077
  n > 0 && t && /* @__PURE__ */ e("button", { className: "pvx-notif-mark-all", onClick: t, children: "Mark all read" })
2053
2078
  ] }),
2054
2079
  r != null && r.length ? /* @__PURE__ */ e("div", { className: "pvx-notif-list", children: r.map((d) => /* @__PURE__ */ e(
2055
- Tr,
2080
+ Mr,
2056
2081
  {
2057
2082
  notification: d,
2058
2083
  getUserDisplay: o,
@@ -2062,7 +2087,7 @@ function Rr({ notifications: r, unreadCount: n = 0, onMarkRead: s, onMarkAllRead
2062
2087
  )) }) : /* @__PURE__ */ e("div", { className: "pvx-notif-empty", children: "No notifications" })
2063
2088
  ] });
2064
2089
  }
2065
- function Tr({ notification: r, getUserDisplay: n, onMarkRead: s }) {
2090
+ function Mr({ notification: r, getUserDisplay: n, onMarkRead: s }) {
2066
2091
  const t = () => {
2067
2092
  !r.isRead && s && s(r.id);
2068
2093
  };
@@ -2072,17 +2097,17 @@ function Tr({ notification: r, getUserDisplay: n, onMarkRead: s }) {
2072
2097
  className: `pvx-notif-item ${r.isRead ? "" : "pvx-notif-item--unread"}`,
2073
2098
  onClick: t,
2074
2099
  children: [
2075
- /* @__PURE__ */ e(Sr, { type: r.type }),
2100
+ /* @__PURE__ */ e(Ir, { type: r.type }),
2076
2101
  /* @__PURE__ */ l("div", { className: "pvx-notif-content", children: [
2077
- /* @__PURE__ */ e("span", { className: "pvx-notif-message", children: Me(r, n) }),
2078
- /* @__PURE__ */ e("span", { className: "pvx-notif-time", children: ae(r.createdAt) })
2102
+ /* @__PURE__ */ e("span", { className: "pvx-notif-message", children: Be(r, n) }),
2103
+ /* @__PURE__ */ e("span", { className: "pvx-notif-time", children: ie(r.createdAt) })
2079
2104
  ] }),
2080
2105
  !r.isRead && /* @__PURE__ */ e("span", { className: "pvx-notif-dot" })
2081
2106
  ]
2082
2107
  }
2083
2108
  );
2084
2109
  }
2085
- function Sr({ type: r }) {
2110
+ function Ir({ type: r }) {
2086
2111
  return r === "RECORD_BEATEN" ? /* @__PURE__ */ e("span", { className: "pvx-notif-icon pvx-notif-icon--beaten", children: /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "m7 7 10 10M17 7v10H7" }) }) }) : r === "ADMIN_MESSAGE" ? /* @__PURE__ */ e("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: [
2087
2112
  /* @__PURE__ */ e("path", { d: "m3 11 18-5v12L3 13v-2z" }),
2088
2113
  /* @__PURE__ */ e("path", { d: "M11.6 16.8a3 3 0 1 1-5.8-1.6" })
@@ -2095,34 +2120,34 @@ function Sr({ type: r }) {
2095
2120
  /* @__PURE__ */ e("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
2096
2121
  ] }) });
2097
2122
  }
2098
- function $r() {
2123
+ function Dr() {
2099
2124
  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: [
2100
2125
  /* @__PURE__ */ e("path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" }),
2101
2126
  /* @__PURE__ */ e("path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0" })
2102
2127
  ] });
2103
2128
  }
2104
- function Xr({ steamId: r, avatarUrl: n, memberSince: s, className: t = "" }) {
2105
- const { data: i, isLoading: a, error: o } = ar(r), { data: d, isLoading: m } = ir(r), { data: c, isLoading: v } = or(), f = cr(), { data: g, isLoading: p } = lr({ limit: 10 }), b = dr(), u = pr();
2106
- return a || m ? /* @__PURE__ */ e("div", { className: "pvx-loading", children: "Loading dashboard..." }) : o ? /* @__PURE__ */ e("div", { className: "pvx-empty", children: "Failed to load dashboard data." }) : i ? /* @__PURE__ */ l("div", { className: `pvx-dash ${t}`, children: [
2129
+ function tn({ steamId: r, avatarUrl: n, memberSince: s, className: t = "" }) {
2130
+ const { data: a, isLoading: i, error: o } = cr(r), { data: d, isLoading: u } = lr(r), { data: c, isLoading: v } = dr(), x = pr(), { data: N, isLoading: p } = ur({ limit: 10 }), b = mr(), g = vr();
2131
+ return i || u ? /* @__PURE__ */ e("div", { className: "pvx-loading", children: "Loading dashboard..." }) : o ? /* @__PURE__ */ e("div", { className: "pvx-empty", children: "Failed to load dashboard data." }) : a ? /* @__PURE__ */ l("div", { className: `pvx-dash ${t}`, children: [
2107
2132
  /* @__PURE__ */ e(
2108
- ur,
2133
+ hr,
2109
2134
  {
2110
- driverName: i.driverName,
2135
+ driverName: a.driverName,
2111
2136
  avatarUrl: n,
2112
2137
  memberSince: s
2113
2138
  }
2114
2139
  ),
2115
- /* @__PURE__ */ e(xr, { stats: i, rating: d }),
2116
- r && /* @__PURE__ */ e(fr, { events: c, isLoading: v }),
2117
- /* @__PURE__ */ l("div", { className: `pvx-dash-row ${f ? "pvx-dash-row--2col" : ""}`, children: [
2118
- /* @__PURE__ */ e(gr, { records: i.currentRecords }),
2119
- f && /* @__PURE__ */ e(
2120
- Rr,
2140
+ /* @__PURE__ */ e(Nr, { stats: a, rating: d }),
2141
+ r && /* @__PURE__ */ e(yr, { events: c, isLoading: v }),
2142
+ /* @__PURE__ */ l("div", { className: `pvx-dash-row ${x ? "pvx-dash-row--2col" : ""}`, children: [
2143
+ /* @__PURE__ */ e(br, { records: a.currentRecords }),
2144
+ x && /* @__PURE__ */ e(
2145
+ $r,
2121
2146
  {
2122
- notifications: g == null ? void 0 : g.notifications,
2123
- unreadCount: (g == null ? void 0 : g.unreadCount) || 0,
2124
- onMarkRead: (N) => b.mutate(N),
2125
- onMarkAllRead: () => u.mutate(),
2147
+ notifications: N == null ? void 0 : N.notifications,
2148
+ unreadCount: (N == null ? void 0 : N.unreadCount) || 0,
2149
+ onMarkRead: (m) => b.mutate(m),
2150
+ onMarkAllRead: () => g.mutate(),
2126
2151
  isLoading: p
2127
2152
  }
2128
2153
  )
@@ -2130,65 +2155,70 @@ function Xr({ steamId: r, avatarUrl: n, memberSince: s, className: t = "" }) {
2130
2155
  ] }) : /* @__PURE__ */ e("div", { className: "pvx-empty", children: "No data available yet. Start driving to see your stats!" });
2131
2156
  }
2132
2157
  export {
2133
- jr as CarsTable,
2158
+ Wr as CarsTable,
2134
2159
  P as CompEmptyState,
2135
2160
  j as CompLoadingState,
2136
- Qe as CompetitionCard,
2137
- Wr as CompetitionCards,
2138
- Xr as DriverDashboard,
2139
- ur as DriverProfile,
2140
- Vr as DriversTable,
2141
- zr as EntryList,
2161
+ Ze as CompetitionCard,
2162
+ Qr as CompetitionCards,
2163
+ tn as DriverDashboard,
2164
+ hr as DriverProfile,
2165
+ Or as DriversTable,
2166
+ Zr as EntryList,
2142
2167
  Q as InfoPill,
2143
- Kr as LapHistoryTable,
2144
- Rr as NotificationsCard,
2145
- Ke as PODIUM_MEDALS,
2146
- Br as PitVoxPartnerProvider,
2147
- Hr as RankingsTable,
2148
- gr as RecordsTable,
2149
- Qr as RegisterButton,
2150
- Yr as RegistrationPanel,
2151
- Gr as RoundResults,
2152
- Xe as RoundSessionResults,
2153
- Or as StandingsTable,
2154
- xr as StatsCards,
2155
- qr as TracksTable,
2156
- Oe as TypeBadge,
2157
- fr as UpcomingEvents,
2168
+ Gr as LapHistoryTable,
2169
+ $r as NotificationsCard,
2170
+ Oe as PODIUM_MEDALS,
2171
+ Ur as PitVoxPartnerProvider,
2172
+ zr as RankingsTable,
2173
+ br as RecordsTable,
2174
+ Xr as RegisterButton,
2175
+ en as RegistrationPanel,
2176
+ Jr as RoundResults,
2177
+ nr as RoundSessionResults,
2178
+ Yr as StandingsTable,
2179
+ Nr as StatsCards,
2180
+ Hr as TracksTable,
2181
+ Qe as TypeBadge,
2182
+ yr as UpcomingEvents,
2183
+ Ie as buildLapsPath,
2184
+ J as buildLeaderboardPath,
2185
+ De as buildRecentLapsPath,
2186
+ R as fetchCdnJson,
2158
2187
  I as formatCarName,
2159
2188
  F as formatDate,
2160
- Pr as formatDelta,
2189
+ Er as formatDelta,
2161
2190
  B as formatLapTime,
2162
- Me as formatNotificationMessage,
2163
- ae as formatRelativeTime,
2191
+ Be as formatNotificationMessage,
2192
+ ie as formatRelativeTime,
2164
2193
  D as formatSectorTime,
2165
2194
  E as formatTrackName,
2166
- ie as formatTyreCompound,
2167
- Er as useCarLeaderboard,
2168
- Ur as useCarMetadata,
2169
- _r as useCompetitionAllRounds,
2170
- Be as useCompetitionConfig,
2171
- ce as useCompetitionEntryList,
2172
- Ae as useCompetitionRound,
2173
- Pe as useCompetitionStandings,
2174
- Fr as useCompetitions,
2175
- De as useDriverLaps,
2176
- ir as useDriverRating,
2177
- Jr as useDriverRatings,
2178
- ar as useDriverStats,
2179
- Ar as useLeaderboardIndex,
2180
- pr as useMarkAllNotificationsRead,
2181
- dr as useMarkNotificationRead,
2182
- lr as useNotifications,
2183
- cr as useNotificationsEnabled,
2195
+ oe as formatTyreCompound,
2196
+ jr as useCarLeaderboard,
2197
+ _r as useCarMetadata,
2198
+ Kr as useCompetitionAllRounds,
2199
+ Ue as useCompetitionConfig,
2200
+ le as useCompetitionEntryList,
2201
+ Fe as useCompetitionRound,
2202
+ Ee as useCompetitionStandings,
2203
+ Vr as useCompetitions,
2204
+ Ae as useDriverLaps,
2205
+ lr as useDriverRating,
2206
+ rn as useDriverRatings,
2207
+ cr as useDriverStats,
2208
+ Fr as useLeaderboardIndex,
2209
+ vr as useMarkAllNotificationsRead,
2210
+ mr as useMarkNotificationRead,
2211
+ ur as useNotifications,
2212
+ pr as useNotificationsEnabled,
2184
2213
  k as usePitVox,
2185
- le as useRegister,
2186
- Z as useRegistrationMode,
2187
- J as useRegistrationStatus,
2188
- X as useRegistrationUrl,
2189
- Ie as useTrackLeaderboard,
2190
- Zr as useUnreadCount,
2191
- or as useUpcomingEvents,
2192
- oe as useUserLookup,
2193
- de as useWithdraw
2214
+ qr as useRecentLaps,
2215
+ de as useRegister,
2216
+ X as useRegistrationMode,
2217
+ Z as useRegistrationStatus,
2218
+ ee as useRegistrationUrl,
2219
+ Pe as useTrackLeaderboard,
2220
+ nn as useUnreadCount,
2221
+ dr as useUpcomingEvents,
2222
+ ce as useUserLookup,
2223
+ pe as useWithdraw
2194
2224
  };