@pitvox/partner-react 0.5.2 → 0.5.4

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,42 +1,42 @@
1
- import { jsx as e, jsxs as o, Fragment as j } from "react/jsx-runtime";
2
- import { createContext as ye, useMemo as w, useContext as ke, useState as M, useCallback as Q } from "react";
3
- import { useQueryClient as U, QueryClient as we, QueryClientProvider as Ce, useQuery as C, useMutation as K, useQueries as Re } from "@tanstack/react-query";
4
- const Y = ye(null), Le = "https://cdn.pitvox.com", Te = "https://pitvox.com";
1
+ import { jsx as e, jsxs as l, Fragment as j } from "react/jsx-runtime";
2
+ import { createContext as ye, useMemo as w, useContext as ke, useState as M, useCallback as Q, useRef as we, useEffect as Ce } from "react";
3
+ import { useQueryClient as U, QueryClient as Le, QueryClientProvider as Re, useQuery as C, useMutation as K, useQueries as Te } from "@tanstack/react-query";
4
+ const Y = ye(null), Se = "https://cdn.pitvox.com", $e = "https://pitvox.com";
5
5
  let G = null;
6
- function Lr({
6
+ function Sr({
7
7
  partnerSlug: r,
8
- cdnUrl: n = Le,
9
- pitvoxUrl: s = Te,
8
+ cdnUrl: n = Se,
9
+ pitvoxUrl: s = $e,
10
10
  getSteamId: t,
11
11
  onRegister: a,
12
12
  onWithdraw: i,
13
- onFetchNotifications: l,
13
+ onFetchNotifications: o,
14
14
  onMarkNotificationRead: d,
15
15
  onMarkAllNotificationsRead: m,
16
16
  children: c
17
17
  }) {
18
- const u = w(() => ({
18
+ const p = w(() => ({
19
19
  partnerSlug: r,
20
20
  cdnUrl: n.replace(/\/$/, ""),
21
21
  pitvoxUrl: s.replace(/\/$/, ""),
22
22
  getSteamId: t || (() => null),
23
23
  onRegister: a || null,
24
24
  onWithdraw: i || null,
25
- onFetchNotifications: l || null,
25
+ onFetchNotifications: o || null,
26
26
  onMarkNotificationRead: d || null,
27
27
  onMarkAllNotificationsRead: m || null
28
- }), [r, n, s, t, a, i, l, d, m]);
29
- let x = !1;
28
+ }), [r, n, s, t, a, i, o, d, m]);
29
+ let h = !1;
30
30
  try {
31
- U(), x = !0;
31
+ U(), h = !0;
32
32
  } catch {
33
- x = !1;
33
+ h = !1;
34
34
  }
35
- return x ? /* @__PURE__ */ e(Y.Provider, { value: u, children: c }) : (G || (G = new we({
35
+ return h ? /* @__PURE__ */ e(Y.Provider, { value: p, children: c }) : (G || (G = new Le({
36
36
  defaultOptions: {
37
37
  queries: { staleTime: 6e4 }
38
38
  }
39
- })), /* @__PURE__ */ e(Ce, { client: G, children: /* @__PURE__ */ e(Y.Provider, { value: u, children: c }) }));
39
+ })), /* @__PURE__ */ e(Re, { client: G, children: /* @__PURE__ */ e(Y.Provider, { value: p, children: c }) }));
40
40
  }
41
41
  function k() {
42
42
  const r = ke(Y);
@@ -66,12 +66,12 @@ function S(r) {
66
66
  return n.startsWith("ks_") && (n = n.slice(3)), n.split("_").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" ");
67
67
  }
68
68
  function A(r, n, s) {
69
- const t = r.split("_").map((l) => l.charAt(0).toUpperCase() + l.slice(1)).join(" "), a = s === "acc" || !s && (n == null ? void 0 : n.toLowerCase()) === "track config";
69
+ 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";
70
70
  if (!n || n === "default" || a) return t;
71
- const i = n.split("_").map((l) => l.charAt(0).toUpperCase() + l.slice(1)).join(" ");
71
+ const i = n.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" ");
72
72
  return `${t} ${i}`;
73
73
  }
74
- function F(r) {
74
+ function E(r) {
75
75
  if (!r) return "-";
76
76
  try {
77
77
  return new Date(r).toLocaleDateString("en-GB", {
@@ -92,14 +92,14 @@ function se(r) {
92
92
  const a = Math.floor(t / 60);
93
93
  if (a < 24) return `${a}h ago`;
94
94
  const i = Math.floor(a / 24);
95
- return i < 30 ? `${i}d ago` : F(r);
95
+ return i < 30 ? `${i}d ago` : E(r);
96
96
  }
97
- function Tr(r) {
97
+ function $r(r) {
98
98
  return r == null ? "" : `${r >= 0 ? "+" : "-"}${(Math.abs(r) / 1e3).toFixed(3)}`;
99
99
  }
100
- function Se(r, n) {
101
- const { type: s, title: t, trackId: a, trackLayout: i, carId: l, game: d, data: m } = r, c = a ? A(a, i, d) : null, u = l ? S(l) : null, x = [c, u].filter(Boolean).join(" — ");
102
- return s === "RECORD_BEATEN" && x ? `${m != null && m.beatenBySteamId && n ? n(m.beatenBySteamId).displayName : "Someone"} beat your record on ${x}` : s === "RECORD_SET" && x ? `You set a new record on ${x}` : t || "New notification";
100
+ function Me(r, n) {
101
+ const { type: s, title: t, trackId: a, trackLayout: i, carId: o, game: d, data: m } = r, c = a ? A(a, i, d) : null, p = o ? S(o) : null, h = [c, p].filter(Boolean).join(" — ");
102
+ return s === "RECORD_BEATEN" && h ? `${m != null && m.beatenBySteamId && n ? n(m.beatenBySteamId).displayName : "Someone"} beat your record on ${h}` : s === "RECORD_SET" && h ? `You set a new record on ${h}` : t || "New notification";
103
103
  }
104
104
  function ae(r) {
105
105
  return r ? {
@@ -115,47 +115,47 @@ function ae(r) {
115
115
  S: "Soft"
116
116
  }[r] || r : "Unknown";
117
117
  }
118
- function Sr(r = {}) {
119
- var d, m, c, u, x, f;
118
+ function Mr(r = {}) {
119
+ var d, m, c, p, h, f;
120
120
  const { cdnUrl: n, partnerSlug: s } = k(), { game: t, gameVersion: a } = r, i = C({
121
121
  queryKey: ["pitvox", "leaderboards", s, "index"],
122
122
  queryFn: () => T(n, `leaderboards/partners/${s}/index.json`),
123
123
  staleTime: 3e4,
124
124
  refetchInterval: 3e4
125
- }), l = w(() => {
125
+ }), o = w(() => {
126
126
  var b;
127
127
  if (!((b = i.data) != null && b.tracks)) return [];
128
128
  let v = i.data.tracks;
129
- return t && (v = v.filter((p) => p.game === t)), a && (v = v.filter((p) => p.gameVersion === a)), v.map((p) => ({
130
- id: p.trackId,
131
- layout: p.layout,
132
- game: p.game,
133
- gameVersion: p.gameVersion,
134
- displayName: A(p.trackId, p.layout, p.game),
135
- driverCount: p.driverCount || 0,
136
- carCount: p.carCount || 0,
137
- record: p.recordHolder ? {
138
- visibleId: p.recordHolder.steamId || p.recordHolder.userId,
139
- carId: p.recordHolder.carId,
140
- carDisplayName: S(p.recordHolder.carId),
141
- lapTimeMs: p.recordHolder.lapTimeMs,
142
- timestamp: p.recordHolder.recordedAt
129
+ return t && (v = v.filter((u) => u.game === t)), a && (v = v.filter((u) => u.gameVersion === a)), v.map((u) => ({
130
+ id: u.trackId,
131
+ layout: u.layout,
132
+ game: u.game,
133
+ gameVersion: u.gameVersion,
134
+ displayName: A(u.trackId, u.layout, u.game),
135
+ driverCount: u.driverCount || 0,
136
+ carCount: u.carCount || 0,
137
+ record: u.recordHolder ? {
138
+ visibleId: u.recordHolder.steamId || u.recordHolder.userId,
139
+ carId: u.recordHolder.carId,
140
+ carDisplayName: S(u.recordHolder.carId),
141
+ lapTimeMs: u.recordHolder.lapTimeMs,
142
+ timestamp: u.recordHolder.recordedAt
143
143
  } : null,
144
- recordByTag: p.recordByTag || null
144
+ recordByTag: u.recordByTag || null
145
145
  }));
146
146
  }, [(d = i.data) == null ? void 0 : d.tracks, t, a]);
147
147
  return {
148
148
  ...i,
149
- data: l,
149
+ data: o,
150
150
  partner: ((m = i.data) == null ? void 0 : m.partner) || null,
151
151
  generatedAt: (c = i.data) == null ? void 0 : c.generatedAt,
152
- totalLaps: ((u = i.data) == null ? void 0 : u.totalLaps) || 0,
153
- totalUsers: ((x = i.data) == null ? void 0 : x.totalUsers) || 0,
152
+ totalLaps: ((p = i.data) == null ? void 0 : p.totalLaps) || 0,
153
+ totalUsers: ((h = i.data) == null ? void 0 : h.totalUsers) || 0,
154
154
  versions: ((f = i.data) == null ? void 0 : f.versions) || {}
155
155
  };
156
156
  }
157
- function $e(r, n, s = {}) {
158
- const { cdnUrl: t, partnerSlug: a } = k(), { carId: i, game: l, gameVersion: d } = s, m = n || "default", c = d ? `leaderboards/partners/${a}/v/${d}/tracks/${r}/${m}.json` : `leaderboards/partners/${a}/tracks/${r}/${m}.json`, { data: u, isLoading: x, error: f } = C({
157
+ function De(r, n, s = {}) {
158
+ const { cdnUrl: t, partnerSlug: a } = k(), { carId: i, game: o, gameVersion: d } = s, m = n || "default", c = d ? `leaderboards/partners/${a}/v/${d}/tracks/${r}/${m}.json` : `leaderboards/partners/${a}/tracks/${r}/${m}.json`, { data: p, isLoading: h, error: f } = C({
159
159
  queryKey: ["pitvox", "leaderboards", a, "track", r, m, d],
160
160
  queryFn: () => T(t, c),
161
161
  enabled: !!r,
@@ -163,44 +163,44 @@ function $e(r, n, s = {}) {
163
163
  refetchInterval: 3e4
164
164
  });
165
165
  return { data: w(() => {
166
- if (!(u != null && u.entries)) return [];
167
- let b = u.entries;
168
- if (l && (b = b.filter((p) => p.game === l)), !i) {
169
- const p = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map();
170
- for (const h of b) {
171
- const g = h.steamId || h.userId;
172
- N.has(h.carId) || N.set(h.carId, /* @__PURE__ */ new Set()), N.get(h.carId).add(g), (!p.has(h.carId) || h.lapTimeMs < p.get(h.carId).lapTimeMs) && p.set(h.carId, h);
166
+ if (!(p != null && p.entries)) return [];
167
+ let b = p.entries;
168
+ if (o && (b = b.filter((u) => u.game === o)), !i) {
169
+ const u = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map();
170
+ for (const x of b) {
171
+ const g = x.steamId || x.userId;
172
+ N.has(x.carId) || N.set(x.carId, /* @__PURE__ */ new Set()), N.get(x.carId).add(g), (!u.has(x.carId) || x.lapTimeMs < u.get(x.carId).lapTimeMs) && u.set(x.carId, x);
173
173
  }
174
- return Array.from(p.values()).map((h) => {
174
+ return Array.from(u.values()).map((x) => {
175
175
  var g;
176
- return { ...h, driverCount: ((g = N.get(h.carId)) == null ? void 0 : g.size) || 0 };
177
- }).sort((h, g) => h.lapTimeMs - g.lapTimeMs);
176
+ return { ...x, driverCount: ((g = N.get(x.carId)) == null ? void 0 : g.size) || 0 };
177
+ }).sort((x, g) => x.lapTimeMs - g.lapTimeMs);
178
178
  }
179
- return b.filter((p) => p.carId === i).sort((p, N) => p.lapTimeMs - N.lapTimeMs);
180
- }, [u == null ? void 0 : u.entries, i, l]), isLoading: x, error: f };
179
+ return b.filter((u) => u.carId === i).sort((u, N) => u.lapTimeMs - N.lapTimeMs);
180
+ }, [p == null ? void 0 : p.entries, i, o]), isLoading: h, error: f };
181
181
  }
182
- function Me(r, n, s, t, a = {}) {
182
+ function Ie(r, n, s, t, a = {}) {
183
183
  var f, v;
184
- const { cdnUrl: i, partnerSlug: l } = k(), { showInvalid: d = !1, game: m, gameVersion: c } = a, u = C({
185
- queryKey: ["pitvox", "laps", l, r],
186
- queryFn: () => T(i, `laps/partners/${l}/${r}.json`),
184
+ const { cdnUrl: i, partnerSlug: o } = k(), { showInvalid: d = !1, game: m, gameVersion: c } = a, p = C({
185
+ queryKey: ["pitvox", "laps", o, r],
186
+ queryFn: () => T(i, `laps/partners/${o}/${r}.json`),
187
187
  enabled: !!r,
188
188
  staleTime: 3e4,
189
189
  refetchInterval: 3e4
190
- }), x = w(() => {
190
+ }), h = w(() => {
191
191
  var b;
192
- return (b = u.data) != null && b.laps ? u.data.laps.filter((p) => {
193
- if (p.trackId !== n) return !1;
192
+ return (b = p.data) != null && b.laps ? p.data.laps.filter((u) => {
193
+ if (u.trackId !== n) return !1;
194
194
  if (s) {
195
- if (p.trackLayout !== s) return !1;
196
- } else if (p.trackLayout && p.trackLayout !== "default") return !1;
197
- return !(p.carId !== t || m && p.game !== m || c && p.gameVersion !== c || !d && !p.isValid);
198
- }).sort((p, N) => p.lapTimeMs - N.lapTimeMs) : [];
199
- }, [(f = u.data) == null ? void 0 : f.laps, n, s, t, m, c, d]);
195
+ if (u.trackLayout !== s) return !1;
196
+ } else if (u.trackLayout && u.trackLayout !== "default") return !1;
197
+ return !(u.carId !== t || m && u.game !== m || c && u.gameVersion !== c || !d && !u.isValid);
198
+ }).sort((u, N) => u.lapTimeMs - N.lapTimeMs) : [];
199
+ }, [(f = p.data) == null ? void 0 : f.laps, n, s, t, m, c, d]);
200
200
  return {
201
- ...u,
202
- data: x,
203
- driverName: ((v = u.data) == null ? void 0 : v.driverName) || "Driver"
201
+ ...p,
202
+ data: h,
203
+ driverName: ((v = p.data) == null ? void 0 : v.driverName) || "Driver"
204
204
  };
205
205
  }
206
206
  function ie() {
@@ -219,7 +219,7 @@ function ie() {
219
219
  };
220
220
  };
221
221
  }
222
- function $r() {
222
+ function Dr() {
223
223
  const { cdnUrl: r } = k(), { data: n } = C({
224
224
  queryKey: ["pitvox", "cars", "index"],
225
225
  queryFn: () => T(r, "cars/index.json"),
@@ -231,10 +231,10 @@ function $r() {
231
231
  cars: (n == null ? void 0 : n.cars) || {}
232
232
  };
233
233
  }
234
- function Mr(r, n) {
235
- return $e(r, null, { carId: n });
234
+ function Ir(r, n) {
235
+ return De(r, null, { carId: n });
236
236
  }
237
- function Dr() {
237
+ function Br() {
238
238
  const { cdnUrl: r, partnerSlug: n } = k();
239
239
  return C({
240
240
  queryKey: ["pitvox", "competitions", n],
@@ -245,7 +245,7 @@ function Dr() {
245
245
  staleTime: 6e4
246
246
  });
247
247
  }
248
- function De(r) {
248
+ function Be(r) {
249
249
  const { cdnUrl: n, partnerSlug: s } = k();
250
250
  return C({
251
251
  queryKey: ["pitvox", "competition", s, r, "config"],
@@ -254,7 +254,7 @@ function De(r) {
254
254
  staleTime: 6e4
255
255
  });
256
256
  }
257
- function Ie(r) {
257
+ function Pe(r) {
258
258
  const { cdnUrl: n, partnerSlug: s } = k();
259
259
  return C({
260
260
  queryKey: ["pitvox", "competition", s, r, "standings"],
@@ -263,7 +263,7 @@ function Ie(r) {
263
263
  staleTime: 6e4
264
264
  });
265
265
  }
266
- function Be(r, n) {
266
+ function Ue(r, n) {
267
267
  const { cdnUrl: s, partnerSlug: t } = k();
268
268
  return C({
269
269
  queryKey: ["pitvox", "competition", t, r, "round", n],
@@ -272,7 +272,7 @@ function Be(r, n) {
272
272
  staleTime: 6e4
273
273
  });
274
274
  }
275
- function Ir(r, n = []) {
275
+ function Pr(r, n = []) {
276
276
  const { cdnUrl: s, partnerSlug: t } = k();
277
277
  return C({
278
278
  queryKey: ["pitvox", "competition", t, r, "allRounds", n],
@@ -302,8 +302,8 @@ function Z(r) {
302
302
  var m;
303
303
  const i = await fetch(`${n}/competitions/${s}/${r}/entrylist.json`);
304
304
  if (!i.ok) return { isRegistered: !1, entryList: null };
305
- const l = await i.json();
306
- return { isRegistered: !!a && ((m = l.drivers) == null ? void 0 : m.some((c) => c.steamId === a)), entryList: l };
305
+ const o = await i.json();
306
+ return { isRegistered: !!a && ((m = o.drivers) == null ? void 0 : m.some((c) => c.steamId === a)), entryList: o };
307
307
  },
308
308
  enabled: !!r,
309
309
  staleTime: 6e4
@@ -312,29 +312,29 @@ function Z(r) {
312
312
  function ce(r) {
313
313
  const { onRegister: n, partnerSlug: s, getSteamId: t } = k(), a = U(), i = ie();
314
314
  return K({
315
- mutationFn: (l) => {
315
+ mutationFn: (o) => {
316
316
  if (!n)
317
317
  throw new Error(
318
318
  "No onRegister callback provided to PitVoxPartnerProvider. Provide onRegister for in-app registration, or use useRegistrationUrl() to link to pitvox.com."
319
319
  );
320
- return n(r, l);
320
+ return n(r, o);
321
321
  },
322
322
  onSuccess: () => {
323
- const l = t();
323
+ const o = t();
324
324
  if (a.setQueriesData(
325
325
  { queryKey: ["pitvox", "registration", s, r] },
326
326
  (d) => d ? { ...d, isRegistered: !0 } : { isRegistered: !0, entryList: null }
327
- ), l) {
328
- const d = i(l), m = {
329
- steamId: l,
327
+ ), o) {
328
+ const d = i(o), m = {
329
+ steamId: o,
330
330
  displayName: d.displayName,
331
331
  avatarUrl: d.avatarUrl
332
332
  };
333
333
  a.setQueriesData(
334
334
  { queryKey: ["pitvox", "competition", s, r, "entrylist"] },
335
335
  (c) => {
336
- var x;
337
- return c ? ((x = c.drivers) == null ? void 0 : x.some((f) => f.steamId === l)) ? c : { ...c, drivers: [...c.drivers || [], m] } : { drivers: [m] };
336
+ var h;
337
+ return c ? ((h = c.drivers) == null ? void 0 : h.some((f) => f.steamId === o)) ? c : { ...c, drivers: [...c.drivers || [], m] } : { drivers: [m] };
338
338
  }
339
339
  );
340
340
  }
@@ -349,18 +349,18 @@ function le(r) {
349
349
  throw new Error(
350
350
  "No onWithdraw callback provided to PitVoxPartnerProvider. Provide onWithdraw for in-app withdrawal, or use useRegistrationUrl() to link to pitvox.com."
351
351
  );
352
- const l = i || t();
353
- if (!l) throw new Error("No Steam ID available");
354
- return n(r, l);
352
+ const o = i || t();
353
+ if (!o) throw new Error("No Steam ID available");
354
+ return n(r, o);
355
355
  },
356
356
  onSuccess: () => {
357
357
  const i = t();
358
358
  a.setQueriesData(
359
359
  { queryKey: ["pitvox", "registration", s, r] },
360
- (l) => l ? { ...l, isRegistered: !1 } : { isRegistered: !1, entryList: null }
360
+ (o) => o ? { ...o, isRegistered: !1 } : { isRegistered: !1, entryList: null }
361
361
  ), i && a.setQueriesData(
362
362
  { queryKey: ["pitvox", "competition", s, r, "entrylist"] },
363
- (l) => l != null && l.drivers ? { ...l, drivers: l.drivers.filter((d) => d.steamId !== i) } : l
363
+ (o) => o != null && o.drivers ? { ...o, drivers: o.drivers.filter((d) => d.steamId !== i) } : o
364
364
  );
365
365
  }
366
366
  });
@@ -373,7 +373,7 @@ function X(r) {
373
373
  const { pitvoxUrl: n, partnerSlug: s } = k();
374
374
  return `${n}/p/${s}/competitions/${r}/register`;
375
375
  }
376
- const Pe = {
376
+ const Ae = {
377
377
  formula: "Formula",
378
378
  gt3: "GT3",
379
379
  gt2: "GT2",
@@ -398,7 +398,7 @@ const Pe = {
398
398
  { id: "tier", tags: ["hypercar", "supercar", "sports_car", "hot_hatch", "lightweight"] },
399
399
  { id: "era", tags: ["1960s", "1970s", "1980s", "1990s", "2000s", "2010s", "2020s"] }
400
400
  ];
401
- function Ue(r) {
401
+ function Ee(r) {
402
402
  for (const n of de)
403
403
  if (n.tags.includes(r)) return n.id;
404
404
  return "other";
@@ -407,7 +407,7 @@ function pe(r, n) {
407
407
  if (n.size === 0) return !0;
408
408
  const s = {};
409
409
  for (const t of n) {
410
- const a = Ue(t);
410
+ const a = Ee(t);
411
411
  s[a] || (s[a] = []), s[a].push(t);
412
412
  }
413
413
  for (const t of Object.values(s))
@@ -415,13 +415,13 @@ function pe(r, n) {
415
415
  return !0;
416
416
  }
417
417
  function ue(r, n) {
418
- const [s, t] = M(/* @__PURE__ */ new Set()), a = r !== void 0, i = a ? r : s, l = Q((m) => {
418
+ const [s, t] = M(/* @__PURE__ */ new Set()), a = r !== void 0, i = a ? r : s, o = Q((m) => {
419
419
  const c = new Set(i);
420
420
  c.has(m) ? c.delete(m) : c.add(m), a && n ? n(c) : t(c);
421
421
  }, [i, a, n]), d = Q(() => {
422
422
  a && n ? n(/* @__PURE__ */ new Set()) : t(/* @__PURE__ */ new Set());
423
423
  }, [a, n]);
424
- return { activeTags: i, toggle: l, clear: d };
424
+ return { activeTags: i, toggle: o, clear: d };
425
425
  }
426
426
  function H(r) {
427
427
  const [n, s] = M(r), t = Q((a) => {
@@ -433,11 +433,11 @@ function H(r) {
433
433
  }
434
434
  function O(r, n, s) {
435
435
  return [...r].sort((t, a) => {
436
- const i = s(t, n.key), l = s(a, n.key);
437
- if (i == null && l == null) return 0;
436
+ const i = s(t, n.key), o = s(a, n.key);
437
+ if (i == null && o == null) return 0;
438
438
  if (i == null) return 1;
439
- if (l == null) return -1;
440
- const d = typeof i == "string" ? i.localeCompare(l) : i - l;
439
+ if (o == null) return -1;
440
+ const d = typeof i == "string" ? i.localeCompare(o) : i - o;
441
441
  return n.dir === "desc" ? -d : d;
442
442
  });
443
443
  }
@@ -449,25 +449,25 @@ function me(r, n = !1) {
449
449
  s3: Math.min(...s.map((t) => t.sector3Ms).filter(Boolean))
450
450
  } : null;
451
451
  }
452
- function Ae({ active: r, dir: n }) {
452
+ function Fe({ active: r, dir: n }) {
453
453
  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" }) });
454
454
  }
455
- function L({ label: r, sortKey: n, config: s, onSort: t, className: a = "" }) {
455
+ function R({ label: r, sortKey: n, config: s, onSort: t, className: a = "" }) {
456
456
  return /* @__PURE__ */ e(
457
457
  "th",
458
458
  {
459
459
  className: `pvx-th pvx-th--sortable ${a}`,
460
460
  onClick: () => t(n),
461
- children: /* @__PURE__ */ o("span", { className: "pvx-th-inner", children: [
461
+ children: /* @__PURE__ */ l("span", { className: "pvx-th-inner", children: [
462
462
  r,
463
- /* @__PURE__ */ e(Ae, { active: s.key === n, dir: s.dir })
463
+ /* @__PURE__ */ e(Fe, { active: s.key === n, dir: s.dir })
464
464
  ] })
465
465
  }
466
466
  );
467
467
  }
468
468
  function W({ userId: r, getUserDisplay: n }) {
469
469
  const { displayName: s, avatarUrl: t } = n(r);
470
- return /* @__PURE__ */ o("span", { className: "pvx-driver", children: [
470
+ return /* @__PURE__ */ l("span", { className: "pvx-driver", children: [
471
471
  t ? /* @__PURE__ */ e("img", { src: t, alt: "", className: "pvx-driver-avatar" }) : /* @__PURE__ */ e("span", { className: "pvx-driver-avatar pvx-driver-avatar--placeholder" }),
472
472
  /* @__PURE__ */ e("span", { className: "pvx-driver-name", children: s })
473
473
  ] });
@@ -477,8 +477,8 @@ function ee({ rank: r, podium: n = !1 }) {
477
477
  }
478
478
  function ve({ availableTags: r, activeTags: n, onToggle: s, onClear: t }) {
479
479
  if (!r || r.length < 2) return null;
480
- const a = de.map((i) => ({ id: i.id, tags: i.tags.filter((l) => r.includes(l)) })).filter((i) => i.tags.length > 0);
481
- return /* @__PURE__ */ o("div", { className: "pvx-tag-bar", children: [
480
+ const a = de.map((i) => ({ id: i.id, tags: i.tags.filter((o) => r.includes(o)) })).filter((i) => i.tags.length > 0);
481
+ return /* @__PURE__ */ l("div", { className: "pvx-tag-bar", children: [
482
482
  /* @__PURE__ */ e(
483
483
  "button",
484
484
  {
@@ -487,14 +487,14 @@ function ve({ availableTags: r, activeTags: n, onToggle: s, onClear: t }) {
487
487
  children: "All"
488
488
  }
489
489
  ),
490
- a.map((i, l) => /* @__PURE__ */ o("span", { className: "contents", children: [
491
- l > 0 && /* @__PURE__ */ e("span", { className: "pvx-tag-separator" }),
490
+ a.map((i, o) => /* @__PURE__ */ l("span", { className: "contents", children: [
491
+ o > 0 && /* @__PURE__ */ e("span", { className: "pvx-tag-separator" }),
492
492
  i.tags.map((d) => /* @__PURE__ */ e(
493
493
  "button",
494
494
  {
495
495
  onClick: () => s(d),
496
496
  className: `pvx-tag ${n.has(d) ? "pvx-tag--active" : ""}`,
497
- children: Pe[d] || d
497
+ children: Ae[d] || d
498
498
  },
499
499
  d
500
500
  ))
@@ -504,14 +504,14 @@ function ve({ availableTags: r, activeTags: n, onToggle: s, onClear: t }) {
504
504
  function re({ segments: r }) {
505
505
  return /* @__PURE__ */ e("nav", { className: "pvx-breadcrumb", "aria-label": "Breadcrumb", children: /* @__PURE__ */ e("ol", { className: "pvx-breadcrumb-list", children: r.map((n, s) => {
506
506
  const t = s === r.length - 1;
507
- return /* @__PURE__ */ o("li", { className: "pvx-breadcrumb-item", children: [
507
+ return /* @__PURE__ */ l("li", { className: "pvx-breadcrumb-item", children: [
508
508
  s > 0 && /* @__PURE__ */ e("svg", { className: "pvx-breadcrumb-chevron", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.25 4.5l7.5 7.5-7.5 7.5" }) }),
509
509
  !t && n.onClick ? /* @__PURE__ */ e("button", { onClick: n.onClick, className: "pvx-breadcrumb-link", children: n.label }) : /* @__PURE__ */ e("span", { className: "pvx-breadcrumb-current", children: n.label })
510
510
  ] }, n.key);
511
511
  }) }) });
512
512
  }
513
- function E({ message: r }) {
514
- return /* @__PURE__ */ o("div", { className: "pvx-empty", children: [
513
+ function F({ message: r }) {
514
+ return /* @__PURE__ */ l("div", { className: "pvx-empty", children: [
515
515
  /* @__PURE__ */ e("svg", { className: "pvx-empty-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.5 18.75h-9m9 0a3 3 0 013 3h-15a3 3 0 013-3m9 0v-4.5A3.375 3.375 0 0013.125 10.875h-2.25A3.375 3.375 0 007.5 14.25v4.5" }) }),
516
516
  /* @__PURE__ */ e("p", { children: r })
517
517
  ] });
@@ -519,33 +519,33 @@ function E({ message: r }) {
519
519
  function _() {
520
520
  return /* @__PURE__ */ e("div", { className: "pvx-loading", children: "Loading..." });
521
521
  }
522
- function Fe() {
522
+ function _e() {
523
523
  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" }) });
524
524
  }
525
- function Ee() {
525
+ function qe() {
526
526
  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" }) });
527
527
  }
528
- function Br({ tracks: r, isLoading: n, carMetadata: s, getUserDisplay: t, onTrackSelect: a, tags: i, onTagChange: l }) {
529
- const [d, m] = H({ key: "record.timestamp", dir: "desc" }), { activeTags: c, toggle: u, clear: x } = ue(i, l), f = w(() => {
528
+ function Ur({ tracks: r, isLoading: n, carMetadata: s, getUserDisplay: t, onTrackSelect: a, tags: i, onTagChange: o }) {
529
+ const [d, m] = H({ key: "record.timestamp", dir: "desc" }), { activeTags: c, toggle: p, clear: h } = ue(i, o), f = w(() => {
530
530
  var N;
531
531
  if (!((N = s == null ? void 0 : s.tags) != null && N.length)) return [];
532
- const p = /* @__PURE__ */ new Set();
533
- for (const h of r || [])
534
- h.recordByTag && Object.keys(h.recordByTag).forEach((g) => p.add(g));
535
- return s.tags.filter((h) => p.has(h));
536
- }, [r, s]), v = w(() => r ? c.size === 0 ? r : r.map((p) => {
532
+ const u = /* @__PURE__ */ new Set();
533
+ for (const x of r || [])
534
+ x.recordByTag && Object.keys(x.recordByTag).forEach((g) => u.add(g));
535
+ return s.tags.filter((x) => u.has(x));
536
+ }, [r, s]), v = w(() => r ? c.size === 0 ? r : r.map((u) => {
537
537
  var g, y;
538
- if (!p.recordByTag) return null;
538
+ if (!u.recordByTag) return null;
539
539
  let N = null;
540
- const h = /* @__PURE__ */ new Set();
541
- for (const R of Object.values(p.recordByTag)) {
542
- if (h.has(R.carId)) continue;
543
- h.add(R.carId);
544
- const $ = ((y = (g = s == null ? void 0 : s.cars) == null ? void 0 : g[R.carId]) == null ? void 0 : y.tags) || ["sports_car"];
545
- pe($, c) && (!N || R.lapTimeMs < N.lapTimeMs) && (N = R);
540
+ const x = /* @__PURE__ */ new Set();
541
+ for (const L of Object.values(u.recordByTag)) {
542
+ if (x.has(L.carId)) continue;
543
+ x.add(L.carId);
544
+ const $ = ((y = (g = s == null ? void 0 : s.cars) == null ? void 0 : g[L.carId]) == null ? void 0 : y.tags) || ["sports_car"];
545
+ pe($, c) && (!N || L.lapTimeMs < N.lapTimeMs) && (N = L);
546
546
  }
547
547
  return N ? {
548
- ...p,
548
+ ...u,
549
549
  record: {
550
550
  visibleId: N.steamId || N.identifier,
551
551
  carId: N.carId,
@@ -554,71 +554,71 @@ function Br({ tracks: r, isLoading: n, carMetadata: s, getUserDisplay: t, onTrac
554
554
  timestamp: N.recordedAt
555
555
  }
556
556
  } : null;
557
- }).filter(Boolean) : [], [r, c, s]), b = w(() => O(v, d, (p, N) => {
558
- var h, g;
557
+ }).filter(Boolean) : [], [r, c, s]), b = w(() => O(v, d, (u, N) => {
558
+ var x, g;
559
559
  switch (N) {
560
560
  case "displayName":
561
- return p.displayName;
561
+ return u.displayName;
562
562
  case "record.lapTimeMs":
563
- return (h = p.record) == null ? void 0 : h.lapTimeMs;
563
+ return (x = u.record) == null ? void 0 : x.lapTimeMs;
564
564
  case "driverCount":
565
- return p.driverCount || 0;
565
+ return u.driverCount || 0;
566
566
  case "carCount":
567
- return p.carCount || 0;
567
+ return u.carCount || 0;
568
568
  case "record.timestamp":
569
569
  default:
570
- return (g = p.record) != null && g.timestamp ? new Date(p.record.timestamp).getTime() : 0;
570
+ return (g = u.record) != null && g.timestamp ? new Date(u.record.timestamp).getTime() : 0;
571
571
  }
572
572
  }), [v, d]);
573
- return n ? /* @__PURE__ */ e(_, {}) : r != null && r.length ? /* @__PURE__ */ o("div", { className: "pvx-card", children: [
573
+ return n ? /* @__PURE__ */ e(_, {}) : r != null && r.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
574
574
  /* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ e("h2", { className: "pvx-card-title", children: "Track Records" }) }),
575
- /* @__PURE__ */ e(ve, { availableTags: f, activeTags: c, onToggle: u, onClear: x }),
576
- /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ o("table", { className: "pvx-table", children: [
577
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ o("tr", { className: "pvx-thead-row", children: [
578
- /* @__PURE__ */ e(L, { label: "Track", sortKey: "displayName", config: d, onSort: m }),
575
+ /* @__PURE__ */ e(ve, { availableTags: f, activeTags: c, onToggle: p, onClear: h }),
576
+ /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
577
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
578
+ /* @__PURE__ */ e(R, { label: "Track", sortKey: "displayName", config: d, onSort: m }),
579
579
  /* @__PURE__ */ e("th", { className: "pvx-th", children: "Record Holder" }),
580
580
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-lg", children: "Car" }),
581
- /* @__PURE__ */ e(L, { label: "Lap Time", sortKey: "record.lapTimeMs", config: d, onSort: m }),
582
- /* @__PURE__ */ e(L, { label: "Drivers", sortKey: "driverCount", config: d, onSort: m, className: "pvx-hidden-below-md" }),
583
- /* @__PURE__ */ e(L, { label: "Cars", sortKey: "carCount", config: d, onSort: m, className: "pvx-hidden-below-lg" }),
584
- /* @__PURE__ */ e(L, { label: "Date", sortKey: "record.timestamp", config: d, onSort: m, className: "pvx-hidden-below-xl" })
581
+ /* @__PURE__ */ e(R, { label: "Lap Time", sortKey: "record.lapTimeMs", config: d, onSort: m }),
582
+ /* @__PURE__ */ e(R, { label: "Drivers", sortKey: "driverCount", config: d, onSort: m, className: "pvx-hidden-below-md" }),
583
+ /* @__PURE__ */ e(R, { label: "Cars", sortKey: "carCount", config: d, onSort: m, className: "pvx-hidden-below-lg" }),
584
+ /* @__PURE__ */ e(R, { label: "Date", sortKey: "record.timestamp", config: d, onSort: m, className: "pvx-hidden-below-xl" })
585
585
  ] }) }),
586
- /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: b.map((p) => {
587
- var N, h, g;
588
- return /* @__PURE__ */ o(
586
+ /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: b.map((u) => {
587
+ var N, x, g;
588
+ return /* @__PURE__ */ l(
589
589
  "tr",
590
590
  {
591
591
  className: "pvx-row pvx-row--clickable",
592
- onClick: () => a(p.id, p.layout),
592
+ onClick: () => a(u.id, u.layout),
593
593
  children: [
594
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary", children: p.displayName }),
595
- /* @__PURE__ */ e("td", { className: "pvx-td", children: (N = p.record) != null && N.visibleId ? /* @__PURE__ */ e(W, { userId: p.record.visibleId, getUserDisplay: t }) : "-" }),
596
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-hidden-below-lg", children: ((h = p.record) == null ? void 0 : h.carDisplayName) || "-" }),
597
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: p.record ? I(p.record.lapTimeMs) : "-" }),
598
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: p.driverCount || "-" }),
599
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: p.carCount || "-" }),
600
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: (g = p.record) != null && g.timestamp ? F(p.record.timestamp) : "-" })
594
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary", children: u.displayName }),
595
+ /* @__PURE__ */ e("td", { className: "pvx-td", children: (N = u.record) != null && N.visibleId ? /* @__PURE__ */ e(W, { userId: u.record.visibleId, getUserDisplay: t }) : "-" }),
596
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-hidden-below-lg", children: ((x = u.record) == null ? void 0 : x.carDisplayName) || "-" }),
597
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: u.record ? I(u.record.lapTimeMs) : "-" }),
598
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: u.driverCount || "-" }),
599
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: u.carCount || "-" }),
600
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: (g = u.record) != null && g.timestamp ? E(u.record.timestamp) : "-" })
601
601
  ]
602
602
  },
603
- `${p.id}|${p.layout || ""}`
603
+ `${u.id}|${u.layout || ""}`
604
604
  );
605
605
  }) })
606
606
  ] }) })
607
- ] }) : /* @__PURE__ */ e(E, { message: "No lap times recorded yet." });
607
+ ] }) : /* @__PURE__ */ e(F, { message: "No lap times recorded yet." });
608
608
  }
609
- function Pr({ entries: r, isLoading: n, track: s, carMetadata: t, getUserDisplay: a, onCarSelect: i, onNavigate: l, tags: d, onTagChange: m }) {
610
- const [c, u] = H({ key: "lapTimeMs", dir: "asc" }), { activeTags: x, toggle: f, clear: v } = ue(d, m), b = w(() => {
611
- var y, R, $;
609
+ function Ar({ entries: r, isLoading: n, track: s, carMetadata: t, getUserDisplay: a, onCarSelect: i, onNavigate: o, tags: d, onTagChange: m }) {
610
+ const [c, p] = H({ key: "lapTimeMs", dir: "asc" }), { activeTags: h, toggle: f, clear: v } = ue(d, m), b = w(() => {
611
+ var y, L, $;
612
612
  if (!r || !((y = t == null ? void 0 : t.tags) != null && y.length)) return [];
613
613
  const g = /* @__PURE__ */ new Set();
614
614
  for (const P of r)
615
- ((($ = (R = t.cars) == null ? void 0 : R[P.carId]) == null ? void 0 : $.tags) || ["sports_car"]).forEach((be) => g.add(be));
615
+ ((($ = (L = t.cars) == null ? void 0 : L[P.carId]) == null ? void 0 : $.tags) || ["sports_car"]).forEach((be) => g.add(be));
616
616
  return t.tags.filter((P) => g.has(P));
617
- }, [r, t]), p = w(() => r ? x.size === 0 ? r : r.filter((g) => {
618
- var R, $;
619
- const y = (($ = (R = t == null ? void 0 : t.cars) == null ? void 0 : R[g.carId]) == null ? void 0 : $.tags) || ["sports_car"];
620
- return pe(y, x);
621
- }) : [], [r, x, t]), N = w(() => O(p, c, (g, y) => {
617
+ }, [r, t]), u = w(() => r ? h.size === 0 ? r : r.filter((g) => {
618
+ var L, $;
619
+ const y = (($ = (L = t == null ? void 0 : t.cars) == null ? void 0 : L[g.carId]) == null ? void 0 : $.tags) || ["sports_car"];
620
+ return pe(y, h);
621
+ }) : [], [r, h, t]), N = w(() => O(u, c, (g, y) => {
622
622
  switch (y) {
623
623
  case "carId":
624
624
  return S(g.carId);
@@ -628,23 +628,23 @@ function Pr({ entries: r, isLoading: n, track: s, carMetadata: t, getUserDisplay
628
628
  default:
629
629
  return g.lapTimeMs;
630
630
  }
631
- }), [p, c]), h = [
632
- { key: "tracks", label: "Tracks", onClick: () => l("tracks") },
631
+ }), [u, c]), x = [
632
+ { key: "tracks", label: "Tracks", onClick: () => o("tracks") },
633
633
  { key: "track", label: s.displayName }
634
634
  ];
635
- return n ? /* @__PURE__ */ e(_, {}) : /* @__PURE__ */ o("div", { className: "pvx-card", children: [
636
- /* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ e(re, { segments: h }) }),
637
- /* @__PURE__ */ e(ve, { availableTags: b, activeTags: x, onToggle: f, onClear: v }),
638
- r != null && r.length ? /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ o("table", { className: "pvx-table", children: [
639
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ o("tr", { className: "pvx-thead-row", children: [
635
+ return n ? /* @__PURE__ */ e(_, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
636
+ /* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ e(re, { segments: x }) }),
637
+ /* @__PURE__ */ e(ve, { availableTags: b, activeTags: h, onToggle: f, onClear: v }),
638
+ r != null && r.length ? /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
639
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
640
640
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
641
- /* @__PURE__ */ e(L, { label: "Car", sortKey: "carId", config: c, onSort: u }),
641
+ /* @__PURE__ */ e(R, { label: "Car", sortKey: "carId", config: c, onSort: p }),
642
642
  /* @__PURE__ */ e("th", { className: "pvx-th", children: "Record Holder" }),
643
- /* @__PURE__ */ e(L, { label: "Lap Time", sortKey: "lapTimeMs", config: c, onSort: u }),
644
- /* @__PURE__ */ e(L, { label: "Drivers", sortKey: "driverCount", config: c, onSort: u, className: "pvx-hidden-below-md" }),
643
+ /* @__PURE__ */ e(R, { label: "Lap Time", sortKey: "lapTimeMs", config: c, onSort: p }),
644
+ /* @__PURE__ */ e(R, { label: "Drivers", sortKey: "driverCount", config: c, onSort: p, className: "pvx-hidden-below-md" }),
645
645
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-lg", children: "Date" })
646
646
  ] }) }),
647
- /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: N.map((g, y) => /* @__PURE__ */ o(
647
+ /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: N.map((g, y) => /* @__PURE__ */ l(
648
648
  "tr",
649
649
  {
650
650
  className: "pvx-row pvx-row--clickable",
@@ -655,16 +655,16 @@ function Pr({ entries: r, isLoading: n, track: s, carMetadata: t, getUserDisplay
655
655
  /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(W, { userId: g.steamId || g.userId, getUserDisplay: a }) }),
656
656
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: I(g.lapTimeMs) }),
657
657
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: g.driverCount || "-" }),
658
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-lg", children: g.recordedAt ? F(g.recordedAt) : "-" })
658
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-lg", children: g.recordedAt ? E(g.recordedAt) : "-" })
659
659
  ]
660
660
  },
661
661
  g.carId
662
662
  )) })
663
- ] }) }) : /* @__PURE__ */ e(E, { message: "No lap times for this track yet." })
663
+ ] }) }) : /* @__PURE__ */ e(F, { message: "No lap times for this track yet." })
664
664
  ] });
665
665
  }
666
- function Ur({ entries: r, isLoading: n, track: s, carId: t, getUserDisplay: a, onDriverSelect: i, onNavigate: l, highlightId: d }) {
667
- const [m, c] = H({ key: "lapTimeMs", dir: "asc" }), u = w(() => me(r), [r]), x = w(() => O(r || [], m, (v, b) => {
666
+ function Er({ entries: r, isLoading: n, track: s, carId: t, getUserDisplay: a, onDriverSelect: i, onNavigate: o, highlightId: d }) {
667
+ const [m, c] = H({ key: "lapTimeMs", dir: "asc" }), p = w(() => me(r), [r]), h = w(() => O(r || [], m, (v, b) => {
668
668
  switch (b) {
669
669
  case "userId":
670
670
  return a(v.steamId || v.userId).displayName;
@@ -675,68 +675,68 @@ function Ur({ entries: r, isLoading: n, track: s, carId: t, getUserDisplay: a, o
675
675
  return v.lapTimeMs;
676
676
  }
677
677
  }), [r, m, a]), f = [
678
- { key: "tracks", label: "Tracks", onClick: () => l("tracks") },
679
- { key: "track", label: s.displayName, onClick: () => l("track") },
678
+ { key: "tracks", label: "Tracks", onClick: () => o("tracks") },
679
+ { key: "track", label: s.displayName, onClick: () => o("track") },
680
680
  { key: "car", label: S(t) }
681
681
  ];
682
- return n ? /* @__PURE__ */ e(_, {}) : /* @__PURE__ */ o("div", { className: "pvx-card", children: [
682
+ return n ? /* @__PURE__ */ e(_, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
683
683
  /* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ e(re, { segments: f }) }),
684
- r != null && r.length ? /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ o("table", { className: "pvx-table", children: [
685
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ o("tr", { className: "pvx-thead-row", children: [
684
+ r != null && r.length ? /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
685
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
686
686
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
687
- /* @__PURE__ */ e(L, { label: "Driver", sortKey: "userId", config: m, onSort: c }),
688
- /* @__PURE__ */ e(L, { label: "Lap Time", sortKey: "lapTimeMs", config: m, onSort: c }),
687
+ /* @__PURE__ */ e(R, { label: "Driver", sortKey: "userId", config: m, onSort: c }),
688
+ /* @__PURE__ */ e(R, { label: "Lap Time", sortKey: "lapTimeMs", config: m, onSort: c }),
689
689
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
690
690
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
691
691
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" }),
692
692
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-lg", children: "Tyre" }),
693
693
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-xl", children: "Fuel" }),
694
- /* @__PURE__ */ e(L, { label: "Laps", sortKey: "lapCount", config: m, onSort: c, className: "pvx-hidden-below-lg" }),
694
+ /* @__PURE__ */ e(R, { label: "Laps", sortKey: "lapCount", config: m, onSort: c, className: "pvx-hidden-below-lg" }),
695
695
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
696
696
  ] }) }),
697
- /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: x.map((v, b) => {
698
- const p = b + 1, N = v.steamId || v.userId, h = u && v.sector1Ms === u.s1, g = u && v.sector2Ms === u.s2, y = u && v.sector3Ms === u.s3;
699
- return /* @__PURE__ */ o(
697
+ /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: h.map((v, b) => {
698
+ const u = b + 1, N = v.steamId || v.userId, x = p && v.sector1Ms === p.s1, g = p && v.sector2Ms === p.s2, y = p && v.sector3Ms === p.s3;
699
+ return /* @__PURE__ */ l(
700
700
  "tr",
701
701
  {
702
- className: `pvx-row pvx-row--clickable ${d && N === d ? "pvx-row--highlight" : p <= 3 ? "pvx-row--podium" : ""}`,
702
+ className: `pvx-row pvx-row--clickable ${d && N === d ? "pvx-row--highlight" : u <= 3 ? "pvx-row--podium" : ""}`,
703
703
  onClick: () => i(N),
704
704
  children: [
705
- /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(ee, { rank: p, podium: !0 }) }),
705
+ /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(ee, { rank: u, podium: !0 }) }),
706
706
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ e(W, { userId: N, getUserDisplay: a }) }),
707
707
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: I(v.lapTimeMs) }),
708
- /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${h ? "pvx-td--best-sector" : ""}`, children: D(v.sector1Ms) }),
708
+ /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${x ? "pvx-td--best-sector" : ""}`, children: D(v.sector1Ms) }),
709
709
  /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${g ? "pvx-td--best-sector" : ""}`, children: D(v.sector2Ms) }),
710
710
  /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${y ? "pvx-td--best-sector" : ""}`, children: D(v.sector3Ms) }),
711
711
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: ae(v.tyreCompound), children: v.tyreCompound || "-" }),
712
712
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-xl", children: v.startingFuelL ? `${v.startingFuelL}L` : "-" }),
713
713
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: v.lapCount || "-" }),
714
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: v.recordedAt ? F(v.recordedAt) : "-" })
714
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: v.recordedAt ? E(v.recordedAt) : "-" })
715
715
  ]
716
716
  },
717
717
  N
718
718
  );
719
719
  }) })
720
- ] }) }) : /* @__PURE__ */ e(E, { message: "No lap times for this car yet." })
720
+ ] }) }) : /* @__PURE__ */ e(F, { message: "No lap times for this car yet." })
721
721
  ] });
722
722
  }
723
- function Ar({ userId: r, track: n, carId: s, game: t, gameVersion: a, showInvalid: i, getUserDisplay: l, onToggleInvalid: d, onNavigate: m }) {
724
- const { data: c, driverName: u, isLoading: x } = Me(r, n.id, n.layout, s, { showInvalid: i, game: t, gameVersion: a }), { displayName: f, avatarUrl: v } = l(r, u), b = w(() => me(c, !0), [c]), p = w(() => {
725
- const h = (c == null ? void 0 : c.filter((g) => g.isValid)) || [];
726
- return h.length ? Math.min(...h.map((g) => g.lapTimeMs)) : null;
723
+ function Fr({ userId: r, track: n, carId: s, game: t, gameVersion: a, showInvalid: i, getUserDisplay: o, onToggleInvalid: d, onNavigate: m }) {
724
+ const { data: c, driverName: p, isLoading: h } = Ie(r, n.id, n.layout, s, { showInvalid: i, game: t, gameVersion: a }), { displayName: f, avatarUrl: v } = o(r, p), b = w(() => me(c, !0), [c]), u = w(() => {
725
+ const x = (c == null ? void 0 : c.filter((g) => g.isValid)) || [];
726
+ return x.length ? Math.min(...x.map((g) => g.lapTimeMs)) : null;
727
727
  }, [c]), N = [
728
728
  { key: "tracks", label: "Tracks", onClick: () => m("tracks") },
729
729
  { key: "track", label: n.displayName, onClick: () => m("track") },
730
730
  { key: "car", label: S(s), onClick: () => m("car") },
731
731
  { key: "driver", label: f }
732
732
  ];
733
- return x ? /* @__PURE__ */ e(_, {}) : /* @__PURE__ */ o("div", { className: "pvx-card", children: [
734
- /* @__PURE__ */ o("div", { className: "pvx-card-header pvx-card-header--split", children: [
735
- /* @__PURE__ */ o("div", { className: "pvx-card-header-left", children: [
733
+ return h ? /* @__PURE__ */ e(_, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
734
+ /* @__PURE__ */ l("div", { className: "pvx-card-header pvx-card-header--split", children: [
735
+ /* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
736
736
  /* @__PURE__ */ e(re, { segments: N }),
737
737
  v ? /* @__PURE__ */ e("img", { src: v, alt: "", className: "pvx-driver-avatar pvx-driver-avatar--lg" }) : /* @__PURE__ */ e("span", { className: "pvx-driver-avatar pvx-driver-avatar--lg pvx-driver-avatar--placeholder" })
738
738
  ] }),
739
- /* @__PURE__ */ o("label", { className: "pvx-checkbox-label", children: [
739
+ /* @__PURE__ */ l("label", { className: "pvx-checkbox-label", children: [
740
740
  /* @__PURE__ */ e(
741
741
  "input",
742
742
  {
@@ -749,8 +749,8 @@ function Ar({ userId: r, track: n, carId: s, game: t, gameVersion: a, showInvali
749
749
  /* @__PURE__ */ e("span", { children: "Show invalid laps" })
750
750
  ] })
751
751
  ] }),
752
- c != null && c.length ? /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ o("table", { className: "pvx-table", children: [
753
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ o("tr", { className: "pvx-thead-row", children: [
752
+ c != null && c.length ? /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
753
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
754
754
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
755
755
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-md", children: "Lap" }),
756
756
  /* @__PURE__ */ e("th", { className: "pvx-th", children: "Lap Time" }),
@@ -762,27 +762,27 @@ function Ar({ userId: r, track: n, carId: s, game: t, gameVersion: a, showInvali
762
762
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-lg", children: "Fuel" }),
763
763
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
764
764
  ] }) }),
765
- /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: c.map((h, g) => {
766
- const y = h.isValid && h.lapTimeMs === p, R = b && h.isValid && h.sector1Ms === b.s1, $ = b && h.isValid && h.sector2Ms === b.s2, P = b && h.isValid && h.sector3Ms === b.s3;
765
+ /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: c.map((x, g) => {
766
+ const y = x.isValid && x.lapTimeMs === u, L = b && x.isValid && x.sector1Ms === b.s1, $ = b && x.isValid && x.sector2Ms === b.s2, P = b && x.isValid && x.sector3Ms === b.s3;
767
767
  let V = "pvx-row";
768
- return h.isValid || (V += " pvx-row--invalid"), y && (V += " pvx-row--personal-best"), /* @__PURE__ */ o("tr", { className: V, children: [
768
+ return x.isValid || (V += " pvx-row--invalid"), y && (V += " pvx-row--personal-best"), /* @__PURE__ */ l("tr", { className: V, children: [
769
769
  /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e("span", { className: `pvx-rank ${y ? "pvx-rank--gold" : ""}`, children: g + 1 }) }),
770
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-md", children: h.lapNumber || "-" }),
771
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: I(h.lapTimeMs) }),
772
- /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${R ? "pvx-td--best-sector" : ""}`, children: D(h.sector1Ms) }),
773
- /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${$ ? "pvx-td--best-sector" : ""}`, children: D(h.sector2Ms) }),
774
- /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${P ? "pvx-td--best-sector" : ""}`, children: D(h.sector3Ms) }),
775
- /* @__PURE__ */ e("td", { className: "pvx-td", title: h.isValid ? void 0 : h.invalidReason || "Invalid", children: h.isValid ? /* @__PURE__ */ e(Fe, {}) : /* @__PURE__ */ e(Ee, {}) }),
776
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: ae(h.tyreCompound), children: h.tyreCompound || "-" }),
777
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: h.startingFuelL ? `${h.startingFuelL}L` : "-" }),
778
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: F(h.timestamp) })
779
- ] }, h.id);
770
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-md", children: x.lapNumber || "-" }),
771
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: I(x.lapTimeMs) }),
772
+ /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${L ? "pvx-td--best-sector" : ""}`, children: D(x.sector1Ms) }),
773
+ /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${$ ? "pvx-td--best-sector" : ""}`, children: D(x.sector2Ms) }),
774
+ /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${P ? "pvx-td--best-sector" : ""}`, children: D(x.sector3Ms) }),
775
+ /* @__PURE__ */ e("td", { className: "pvx-td", title: x.isValid ? void 0 : x.invalidReason || "Invalid", children: x.isValid ? /* @__PURE__ */ e(_e, {}) : /* @__PURE__ */ e(qe, {}) }),
776
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: ae(x.tyreCompound), children: x.tyreCompound || "-" }),
777
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: x.startingFuelL ? `${x.startingFuelL}L` : "-" }),
778
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: E(x.timestamp) })
779
+ ] }, x.id);
780
780
  }) })
781
- ] }) }) : /* @__PURE__ */ e(E, { message: i ? "No laps recorded for this combination." : 'No valid laps. Try enabling "Show invalid laps".' })
781
+ ] }) }) : /* @__PURE__ */ e(F, { message: i ? "No laps recorded for this combination." : 'No valid laps. Try enabling "Show invalid laps".' })
782
782
  ] });
783
783
  }
784
- function Fr({ drivers: r, isLoading: n, getUserDisplay: s, game: t, gameVersion: a, onComboSelect: i }) {
785
- const [l, d] = H({ key: "rank", dir: "asc" }), [m, c] = M(null), u = w(() => r ? O(r, l, (f, v) => {
784
+ function _r({ drivers: r, isLoading: n, getUserDisplay: s, game: t, gameVersion: a, onComboSelect: i }) {
785
+ const [o, d] = H({ key: "rank", dir: "asc" }), [m, c] = M(null), p = w(() => r ? O(r, o, (f, v) => {
786
786
  switch (v) {
787
787
  case "rating":
788
788
  return f.rating;
@@ -794,19 +794,19 @@ function Fr({ drivers: r, isLoading: n, getUserDisplay: s, game: t, gameVersion:
794
794
  default:
795
795
  return f.rank;
796
796
  }
797
- }) : [], [r, l]);
797
+ }) : [], [r, o]);
798
798
  if (n) return /* @__PURE__ */ e(_, {});
799
799
  if (!(r != null && r.length))
800
- return /* @__PURE__ */ e("div", { className: "pvx-card", children: /* @__PURE__ */ e(E, { message: "Not enough data for rankings yet." }) });
801
- const x = 5;
802
- return /* @__PURE__ */ o("div", { className: "pvx-card", children: [
803
- /* @__PURE__ */ o("div", { className: "pvx-card-header pvx-rankings-header", children: [
800
+ return /* @__PURE__ */ e("div", { className: "pvx-card", children: /* @__PURE__ */ e(F, { message: "Not enough data for rankings yet." }) });
801
+ const h = 5;
802
+ return /* @__PURE__ */ l("div", { className: "pvx-card", children: [
803
+ /* @__PURE__ */ l("div", { className: "pvx-card-header pvx-rankings-header", children: [
804
804
  /* @__PURE__ */ e("h2", { className: "pvx-card-title", children: "Driver Rankings" }),
805
- /* @__PURE__ */ o("div", { className: "pvx-rankings-info-trigger", children: [
805
+ /* @__PURE__ */ l("div", { className: "pvx-rankings-info-trigger", children: [
806
806
  /* @__PURE__ */ e("svg", { className: "pvx-rankings-info-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" }) }),
807
- /* @__PURE__ */ o("div", { className: "pvx-rankings-info-tooltip", children: [
807
+ /* @__PURE__ */ l("div", { className: "pvx-rankings-info-tooltip", children: [
808
808
  /* @__PURE__ */ e("p", { className: "pvx-rankings-info-title", children: "How ratings work" }),
809
- /* @__PURE__ */ o("ul", { className: "pvx-rankings-info-list", children: [
809
+ /* @__PURE__ */ l("ul", { className: "pvx-rankings-info-list", children: [
810
810
  /* @__PURE__ */ e("li", { children: "For each car/track combo with 3+ drivers, you're ranked by lap time and given a percentile (100 = fastest, 0 = slowest)" }),
811
811
  /* @__PURE__ */ e("li", { children: "Your rating is a weighted average across all your combos — bigger fields count more" }),
812
812
  /* @__PURE__ */ e("li", { children: "A confidence adjustment rewards car diversity: the more different cars you drive competitively, the closer your rating reflects your true score" }),
@@ -815,24 +815,24 @@ function Fr({ drivers: r, isLoading: n, getUserDisplay: s, game: t, gameVersion:
815
815
  ] })
816
816
  ] })
817
817
  ] }),
818
- /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ o("table", { className: "pvx-table", children: [
819
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ o("tr", { className: "pvx-thead-row", children: [
820
- /* @__PURE__ */ e(L, { label: "#", sortKey: "rank", config: l, onSort: d, className: "pvx-th--narrow" }),
818
+ /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
819
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
820
+ /* @__PURE__ */ e(R, { label: "#", sortKey: "rank", config: o, onSort: d, className: "pvx-th--narrow" }),
821
821
  /* @__PURE__ */ e("th", { className: "pvx-th", children: "Driver" }),
822
- /* @__PURE__ */ e(L, { label: "Rating", sortKey: "rating", config: l, onSort: d }),
823
- /* @__PURE__ */ e(L, { label: "Cars", sortKey: "distinctCars", config: l, onSort: d, className: "pvx-hidden-below-sm" }),
824
- /* @__PURE__ */ e(L, { label: "Combos", sortKey: "comboCount", config: l, onSort: d, className: "pvx-hidden-below-sm" })
822
+ /* @__PURE__ */ e(R, { label: "Rating", sortKey: "rating", config: o, onSort: d }),
823
+ /* @__PURE__ */ e(R, { label: "Cars", sortKey: "distinctCars", config: o, onSort: d, className: "pvx-hidden-below-sm" }),
824
+ /* @__PURE__ */ e(R, { label: "Combos", sortKey: "comboCount", config: o, onSort: d, className: "pvx-hidden-below-sm" })
825
825
  ] }) }),
826
- /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: u.map((f) => {
826
+ /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: p.map((f) => {
827
827
  const v = m === f.identifier;
828
828
  return /* @__PURE__ */ e(
829
- _e,
829
+ Ve,
830
830
  {
831
831
  driver: f,
832
832
  getUserDisplay: s,
833
833
  isExpanded: v,
834
834
  onToggle: () => c(v ? null : f.identifier),
835
- colCount: x,
835
+ colCount: h,
836
836
  game: t,
837
837
  gameVersion: a,
838
838
  onComboSelect: i
@@ -843,10 +843,10 @@ function Fr({ drivers: r, isLoading: n, getUserDisplay: s, game: t, gameVersion:
843
843
  ] }) })
844
844
  ] });
845
845
  }
846
- function _e({ driver: r, getUserDisplay: n, isExpanded: s, onToggle: t, colCount: a, game: i, gameVersion: l, onComboSelect: d }) {
846
+ function Ve({ driver: r, getUserDisplay: n, isExpanded: s, onToggle: t, colCount: a, game: i, gameVersion: o, onComboSelect: d }) {
847
847
  const m = r.identifier;
848
- return /* @__PURE__ */ o(j, { children: [
849
- /* @__PURE__ */ o(
848
+ return /* @__PURE__ */ l(j, { children: [
849
+ /* @__PURE__ */ l(
850
850
  "tr",
851
851
  {
852
852
  className: `pvx-row pvx-row--clickable ${r.rank <= 3 ? "pvx-row--podium" : ""}`,
@@ -856,32 +856,32 @@ function _e({ driver: r, getUserDisplay: n, isExpanded: s, onToggle: t, colCount
856
856
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ e(W, { userId: m, getUserDisplay: n }) }),
857
857
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: r.rating.toFixed(1) }),
858
858
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: r.distinctCars || "-" }),
859
- /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: /* @__PURE__ */ o("span", { className: "pvx-rankings-combo-count", children: [
859
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: /* @__PURE__ */ l("span", { className: "pvx-rankings-combo-count", children: [
860
860
  r.comboCount,
861
861
  /* @__PURE__ */ e("svg", { className: `pvx-rankings-chevron ${s ? "pvx-rankings-chevron--open" : ""}`, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "m6 9 6 6 6-6" }) })
862
862
  ] }) })
863
863
  ]
864
864
  }
865
865
  ),
866
- 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, u) => {
867
- const x = c.layout ? `${c.trackId}|${c.layout}` : c.trackId, f = d ? () => d({ track: x, car: c.carId, highlight: m, game: i, gameVersion: l }) : void 0;
868
- return /* @__PURE__ */ o(
866
+ 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, p) => {
867
+ const h = c.layout ? `${c.trackId}|${c.layout}` : c.trackId, f = d ? () => d({ track: h, car: c.carId, highlight: m, game: i, gameVersion: o }) : void 0;
868
+ return /* @__PURE__ */ l(
869
869
  "div",
870
870
  {
871
871
  className: `pvx-rankings-combo ${f ? "pvx-rankings-combo--clickable" : ""}`,
872
872
  onClick: f,
873
873
  role: f ? "button" : void 0,
874
874
  children: [
875
- /* @__PURE__ */ o("div", { className: "pvx-rankings-combo-info", children: [
875
+ /* @__PURE__ */ l("div", { className: "pvx-rankings-combo-info", children: [
876
876
  /* @__PURE__ */ e("p", { className: "pvx-rankings-combo-track", children: A(c.trackId, c.layout, i) }),
877
877
  /* @__PURE__ */ e("p", { className: "pvx-rankings-combo-car", children: S(c.carId) })
878
878
  ] }),
879
- /* @__PURE__ */ o("div", { className: "pvx-rankings-combo-stats", children: [
879
+ /* @__PURE__ */ l("div", { className: "pvx-rankings-combo-stats", children: [
880
880
  /* @__PURE__ */ e("p", { className: "pvx-rankings-combo-time", children: I(c.lapTimeMs) }),
881
- /* @__PURE__ */ o("p", { className: `pvx-rankings-combo-pct ${c.percentile >= 75 ? "pvx-rankings-combo-pct--high" : c.percentile >= 50 ? "pvx-rankings-combo-pct--mid" : c.percentile >= 25 ? "pvx-rankings-combo-pct--low" : "pvx-rankings-combo-pct--bottom"}`, children: [
881
+ /* @__PURE__ */ l("p", { className: `pvx-rankings-combo-pct ${c.percentile >= 75 ? "pvx-rankings-combo-pct--high" : c.percentile >= 50 ? "pvx-rankings-combo-pct--mid" : c.percentile >= 25 ? "pvx-rankings-combo-pct--low" : "pvx-rankings-combo-pct--bottom"}`, children: [
882
882
  c.percentile.toFixed(0),
883
883
  "%",
884
- /* @__PURE__ */ o("span", { className: "pvx-rankings-combo-rank", children: [
884
+ /* @__PURE__ */ l("span", { className: "pvx-rankings-combo-rank", children: [
885
885
  "(",
886
886
  c.rank,
887
887
  "/",
@@ -892,12 +892,12 @@ function _e({ driver: r, getUserDisplay: n, isExpanded: s, onToggle: t, colCount
892
892
  ] })
893
893
  ]
894
894
  },
895
- u
895
+ p
896
896
  );
897
897
  }) }) }) })
898
898
  ] });
899
899
  }
900
- const qe = {
900
+ const je = {
901
901
  GBR: "🇬🇧",
902
902
  DEU: "🇩🇪",
903
903
  NLD: "🇳🇱",
@@ -928,7 +928,7 @@ const qe = {
928
928
  RUS: "🇷🇺",
929
929
  TUR: "🇹🇷",
930
930
  KOR: "🇰🇷"
931
- }, Ve = ["🥇", "🥈", "🥉"], je = {
931
+ }, Ke = ["🥇", "🥈", "🥉"], He = {
932
932
  championship: "Championship",
933
933
  series: "Series",
934
934
  event: "Event"
@@ -937,10 +937,10 @@ function he({ position: r }) {
937
937
  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 });
938
938
  }
939
939
  function xe({ nation: r }) {
940
- const n = r && qe[r];
940
+ const n = r && je[r];
941
941
  return n ? /* @__PURE__ */ e("span", { className: "pvx-nation-flag", title: r, children: n }) : null;
942
942
  }
943
- function Ke({ sessions: r, activeSession: n, onSelect: s }) {
943
+ function Oe({ sessions: r, activeSession: n, onSelect: s }) {
944
944
  if (!r || r.length <= 1) return null;
945
945
  const t = [...r].sort(
946
946
  (a, i) => ne.indexOf(a.type) - ne.indexOf(i.type)
@@ -955,25 +955,25 @@ function Ke({ sessions: r, activeSession: n, onSelect: s }) {
955
955
  a.type
956
956
  )) });
957
957
  }
958
- function He({ type: r }) {
959
- return /* @__PURE__ */ e("span", { className: `pvx-comp-badge pvx-comp-badge--${r}`, children: je[r] || r });
958
+ function We({ type: r }) {
959
+ return /* @__PURE__ */ e("span", { className: `pvx-comp-badge pvx-comp-badge--${r}`, children: He[r] || r });
960
960
  }
961
961
  function z({ children: r, variant: n = "default" }) {
962
962
  return /* @__PURE__ */ e("span", { className: `pvx-info-pill ${n !== "default" ? `pvx-info-pill--${n}` : ""}`, children: r });
963
963
  }
964
- function Oe(r) {
964
+ function Ge(r) {
965
965
  if (!r) return "TBD";
966
966
  const n = new Date(r);
967
967
  if (isNaN(n)) return "TBD";
968
968
  const s = n.toLocaleDateString("en-GB", { weekday: "short", day: "numeric", month: "short" }), t = n.toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit" });
969
969
  return `${s} • ${t}`;
970
970
  }
971
- function We(r) {
971
+ function ze(r) {
972
972
  return r.reduce((n, s) => {
973
973
  var t;
974
974
  return (t = s.splits) != null && t.length ? n ? n.map((a, i) => {
975
- const l = s.splits[i];
976
- return l && l < a ? l : a;
975
+ const o = s.splits[i];
976
+ return o && o < a ? o : a;
977
977
  }) : [...s.splits] : n;
978
978
  }, null);
979
979
  }
@@ -983,13 +983,13 @@ function q({ message: r = "Loading..." }) {
983
983
  function B({ message: r = "No data available." }) {
984
984
  return /* @__PURE__ */ e("div", { className: "pvx-empty", children: /* @__PURE__ */ e("p", { children: r }) });
985
985
  }
986
- function Er({ competitions: r, isLoading: n, onSelect: s, onRegister: t, className: a }) {
987
- return n ? /* @__PURE__ */ e(q, { message: "Loading competitions..." }) : r != null && r.length ? /* @__PURE__ */ e("div", { className: `pvx-comp-grid ${a || ""}`, children: r.map((i) => /* @__PURE__ */ e(Ge, { comp: i, onSelect: s, onRegister: t || s }, i.id)) }) : /* @__PURE__ */ e(B, { message: "No competitions available." });
986
+ function qr({ competitions: r, isLoading: n, onSelect: s, onRegister: t, className: a }) {
987
+ return n ? /* @__PURE__ */ e(q, { message: "Loading competitions..." }) : r != null && r.length ? /* @__PURE__ */ e("div", { className: `pvx-comp-grid ${a || ""}`, children: r.map((i) => /* @__PURE__ */ e(Qe, { comp: i, onSelect: s, onRegister: t || s }, i.id)) }) : /* @__PURE__ */ e(B, { message: "No competitions available." });
988
988
  }
989
- function Ge({ comp: r, onSelect: n, onRegister: s }) {
990
- var p, N, h;
991
- const { cdnUrl: t } = k(), a = r.posterCdnPath ? `${t}/${r.posterCdnPath}` : null, i = r.registration, l = (i == null ? void 0 : i.currentCount) || 0, d = i == null ? void 0 : i.maxParticipants, m = d && l >= d, c = (i == null ? void 0 : i.deadline) && new Date(i.deadline) < /* @__PURE__ */ new Date(), u = (i == null ? void 0 : i.isOpen) && !c && !m, x = /* @__PURE__ */ new Date(), f = (p = r.rounds) == null ? void 0 : p.find((g) => g.startTime && new Date(g.startTime) >= x), v = ((N = r.rounds) == null ? void 0 : N.length) || 0, b = ((h = r.rounds) == null ? void 0 : h.filter((g) => g.isFinalized).length) || 0;
992
- return /* @__PURE__ */ o(
989
+ function Qe({ comp: r, onSelect: n, onRegister: s }) {
990
+ var u, N, x;
991
+ 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, m = d && o >= d, c = (i == null ? void 0 : i.deadline) && new Date(i.deadline) < /* @__PURE__ */ new Date(), p = (i == null ? void 0 : i.isOpen) && !c && !m, h = /* @__PURE__ */ new Date(), f = (u = r.rounds) == null ? void 0 : u.find((g) => g.startTime && new Date(g.startTime) >= h), v = ((N = r.rounds) == null ? void 0 : N.length) || 0, b = ((x = r.rounds) == null ? void 0 : x.filter((g) => g.isFinalized).length) || 0;
992
+ return /* @__PURE__ */ l(
993
993
  "div",
994
994
  {
995
995
  className: "pvx-comp-card",
@@ -1000,18 +1000,18 @@ function Ge({ comp: r, onSelect: n, onRegister: s }) {
1000
1000
  (g.key === "Enter" || g.key === " ") && (g.preventDefault(), n(r.id));
1001
1001
  },
1002
1002
  children: [
1003
- /* @__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(Qe, {}) }) }),
1004
- /* @__PURE__ */ o("div", { className: "pvx-comp-card-body", children: [
1003
+ /* @__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(Ze, {}) }) }),
1004
+ /* @__PURE__ */ l("div", { className: "pvx-comp-card-body", children: [
1005
1005
  /* @__PURE__ */ e("h3", { className: "pvx-comp-card-title", children: r.name }),
1006
1006
  r.description && /* @__PURE__ */ e("p", { className: "pvx-comp-card-desc", children: r.description }),
1007
- /* @__PURE__ */ o("div", { className: "pvx-comp-card-pills", children: [
1008
- /* @__PURE__ */ e(He, { type: r.type }),
1007
+ /* @__PURE__ */ l("div", { className: "pvx-comp-card-pills", children: [
1008
+ /* @__PURE__ */ e(We, { type: r.type }),
1009
1009
  r.game && /* @__PURE__ */ e(z, { children: r.game.toUpperCase() }),
1010
1010
  r.formatDescription && r.formatDescription.split(", ").map((g, y) => /* @__PURE__ */ e(z, { variant: "format", children: g }, y))
1011
1011
  ] }),
1012
1012
  r.carsDescription && /* @__PURE__ */ e("div", { className: "pvx-comp-card-pills", children: r.carsDescription.split(", ").map((g, y) => /* @__PURE__ */ e(z, { children: g }, y)) }),
1013
- /* @__PURE__ */ o("div", { className: "pvx-comp-card-schedule", children: [
1014
- f ? /* @__PURE__ */ o("span", { className: "pvx-comp-card-schedule-next", children: [
1013
+ /* @__PURE__ */ l("div", { className: "pvx-comp-card-schedule", children: [
1014
+ f ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
1015
1015
  /* @__PURE__ */ e("span", { className: "pvx-comp-card-schedule-label", children: "Next:" }),
1016
1016
  " ",
1017
1017
  "R",
@@ -1019,27 +1019,27 @@ function Ge({ comp: r, onSelect: n, onRegister: s }) {
1019
1019
  " ",
1020
1020
  f.track || "TBD",
1021
1021
  " — ",
1022
- Oe(f.startTime)
1023
- ] }) : v > 0 ? /* @__PURE__ */ o("span", { className: "pvx-comp-card-schedule-next", children: [
1022
+ Ge(f.startTime)
1023
+ ] }) : v > 0 ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
1024
1024
  b,
1025
1025
  "/",
1026
1026
  v,
1027
1027
  " rounds completed"
1028
1028
  ] }) : null,
1029
- v > 0 && /* @__PURE__ */ o("span", { className: "pvx-comp-card-round-count", children: [
1029
+ v > 0 && /* @__PURE__ */ l("span", { className: "pvx-comp-card-round-count", children: [
1030
1030
  v,
1031
1031
  " round",
1032
1032
  v !== 1 ? "s" : ""
1033
1033
  ] })
1034
1034
  ] }),
1035
1035
  i && /* @__PURE__ */ e(
1036
- ze,
1036
+ Ye,
1037
1037
  {
1038
1038
  competitionId: r.id,
1039
- regOpen: u,
1039
+ regOpen: p,
1040
1040
  isFull: m,
1041
1041
  deadlinePassed: c,
1042
- regCount: l,
1042
+ regCount: o,
1043
1043
  regMax: d,
1044
1044
  onRegister: s
1045
1045
  }
@@ -1049,21 +1049,21 @@ function Ge({ comp: r, onSelect: n, onRegister: s }) {
1049
1049
  }
1050
1050
  );
1051
1051
  }
1052
- function ze({ competitionId: r, regOpen: n, isFull: s, deadlinePassed: t, regCount: a, regMax: i, onRegister: l }) {
1053
- const { isPowerMode: d } = J(), m = X(r), { data: c } = Z(r), u = (c == null ? void 0 : c.isRegistered) || !1, x = i ? a / i * 100 : 0, f = x >= 100 ? "full" : x >= 75 ? "warning" : "ok";
1054
- return /* @__PURE__ */ o("div", { className: "pvx-comp-card-reg", children: [
1055
- /* @__PURE__ */ e("div", { className: "pvx-comp-card-reg-info", children: /* @__PURE__ */ o("span", { className: `pvx-reg-capacity pvx-reg-capacity--${f}`, children: [
1052
+ function Ye({ competitionId: r, regOpen: n, isFull: s, deadlinePassed: t, regCount: a, regMax: i, onRegister: o }) {
1053
+ const { isPowerMode: d } = J(), m = X(r), { data: c } = Z(r), p = (c == null ? void 0 : c.isRegistered) || !1, h = i ? a / i * 100 : 0, f = h >= 100 ? "full" : h >= 75 ? "warning" : "ok";
1054
+ return /* @__PURE__ */ l("div", { className: "pvx-comp-card-reg", children: [
1055
+ /* @__PURE__ */ e("div", { className: "pvx-comp-card-reg-info", children: /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${f}`, children: [
1056
1056
  a,
1057
1057
  "/",
1058
1058
  i || "∞",
1059
1059
  " drivers"
1060
1060
  ] }) }),
1061
- /* @__PURE__ */ e("div", { className: "pvx-comp-card-reg-action", children: u ? /* @__PURE__ */ e(
1061
+ /* @__PURE__ */ e("div", { className: "pvx-comp-card-reg-action", children: p ? /* @__PURE__ */ e(
1062
1062
  "button",
1063
1063
  {
1064
1064
  className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--registered",
1065
1065
  onClick: (v) => {
1066
- v.stopPropagation(), l(r);
1066
+ v.stopPropagation(), o(r);
1067
1067
  },
1068
1068
  children: "✓ Registered"
1069
1069
  }
@@ -1072,7 +1072,7 @@ function ze({ competitionId: r, regOpen: n, isFull: s, deadlinePassed: t, regCou
1072
1072
  {
1073
1073
  className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--open",
1074
1074
  onClick: (v) => {
1075
- v.stopPropagation(), l(r);
1075
+ v.stopPropagation(), o(r);
1076
1076
  },
1077
1077
  children: "Register"
1078
1078
  }
@@ -1089,8 +1089,8 @@ function ze({ competitionId: r, regOpen: n, isFull: s, deadlinePassed: t, regCou
1089
1089
  ) : /* @__PURE__ */ e("span", { className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--closed", children: s ? "Full" : "Closed" }) })
1090
1090
  ] });
1091
1091
  }
1092
- function Qe() {
1093
- return /* @__PURE__ */ o("svg", { className: "pvx-comp-trophy-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
1092
+ function Ze() {
1093
+ 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: [
1094
1094
  /* @__PURE__ */ e("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
1095
1095
  /* @__PURE__ */ e("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
1096
1096
  /* @__PURE__ */ e("path", { d: "M4 22h16" }),
@@ -1099,18 +1099,18 @@ function Qe() {
1099
1099
  /* @__PURE__ */ e("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
1100
1100
  ] });
1101
1101
  }
1102
- function _r({ competitionId: r, className: n }) {
1102
+ function Vr({ competitionId: r, className: n }) {
1103
1103
  var d, m;
1104
- const { data: s, isLoading: t } = Ie(r), { data: a, isLoading: i } = De(r);
1104
+ const { data: s, isLoading: t } = Pe(r), { data: a, isLoading: i } = Be(r);
1105
1105
  if (t || i)
1106
1106
  return /* @__PURE__ */ e(q, { message: "Loading standings..." });
1107
1107
  if (!((d = s == null ? void 0 : s.standings) != null && d.length))
1108
1108
  return /* @__PURE__ */ e(B, { message: "No standings data yet. Results will appear once rounds are finalised." });
1109
- const l = ((m = a == null ? void 0 : a.rounds) == null ? void 0 : m.filter((c) => c.isFinalized)) || [];
1110
- return /* @__PURE__ */ o("div", { className: `pvx-card ${n || ""}`, children: [
1111
- /* @__PURE__ */ e("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ o("div", { className: "pvx-card-header-left", children: [
1109
+ const o = ((m = a == null ? void 0 : a.rounds) == null ? void 0 : m.filter((c) => c.isFinalized)) || [];
1110
+ return /* @__PURE__ */ l("div", { className: `pvx-card ${n || ""}`, children: [
1111
+ /* @__PURE__ */ e("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
1112
1112
  /* @__PURE__ */ e("h3", { className: "pvx-card-title", children: "Championship Standings" }),
1113
- /* @__PURE__ */ o("span", { className: "pvx-standings-subtitle", children: [
1113
+ /* @__PURE__ */ l("span", { className: "pvx-standings-subtitle", children: [
1114
1114
  "After ",
1115
1115
  s.roundsCompleted,
1116
1116
  " round",
@@ -1118,14 +1118,14 @@ function _r({ competitionId: r, className: n }) {
1118
1118
  s.countingRounds > 0 && ` (best ${s.countingRounds} count)`
1119
1119
  ] })
1120
1120
  ] }) }),
1121
- /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ o("table", { className: "pvx-table", children: [
1122
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ o("tr", { className: "pvx-thead-row", children: [
1121
+ /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
1122
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
1123
1123
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
1124
1124
  /* @__PURE__ */ e("th", { className: "pvx-th", children: "Driver" }),
1125
1125
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-th--center pvx-hidden-below-sm", children: "W" }),
1126
1126
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-th--center pvx-hidden-below-sm", children: "Pod" }),
1127
1127
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-th--center", children: "Points" }),
1128
- l.map((c) => /* @__PURE__ */ o(
1128
+ o.map((c) => /* @__PURE__ */ l(
1129
1129
  "th",
1130
1130
  {
1131
1131
  className: "pvx-th pvx-th--center pvx-hidden-below-md",
@@ -1139,24 +1139,24 @@ function _r({ competitionId: r, className: n }) {
1139
1139
  ))
1140
1140
  ] }) }),
1141
1141
  /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: s.standings.map((c) => /* @__PURE__ */ e(
1142
- Ye,
1142
+ Je,
1143
1143
  {
1144
1144
  driver: c,
1145
- finalizedRounds: l
1145
+ finalizedRounds: o
1146
1146
  },
1147
1147
  c.driverId || c.driverName
1148
1148
  )) })
1149
1149
  ] }) })
1150
1150
  ] });
1151
1151
  }
1152
- function Ye({ driver: r, finalizedRounds: n }) {
1153
- var l, d, m;
1152
+ function Je({ driver: r, finalizedRounds: n }) {
1153
+ var o, d, m;
1154
1154
  const s = r.position <= 3, t = new Map(
1155
- ((l = r.roundResults) == null ? void 0 : l.map((c) => [c.roundNumber, c])) || []
1155
+ ((o = r.roundResults) == null ? void 0 : o.map((c) => [c.roundNumber, c])) || []
1156
1156
  ), a = ((d = r.roundResults) == null ? void 0 : d.filter((c) => c.position === 1).length) || 0, i = ((m = r.roundResults) == null ? void 0 : m.filter((c) => c.position <= 3).length) || 0;
1157
- return /* @__PURE__ */ o("tr", { className: `pvx-row ${s ? "pvx-row--podium" : ""}`, children: [
1157
+ return /* @__PURE__ */ l("tr", { className: `pvx-row ${s ? "pvx-row--podium" : ""}`, children: [
1158
1158
  /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(he, { position: r.position }) }),
1159
- /* @__PURE__ */ o("td", { className: "pvx-td pvx-td--primary", children: [
1159
+ /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
1160
1160
  /* @__PURE__ */ e(xe, { nation: r.nation }),
1161
1161
  r.driverName
1162
1162
  ] }),
@@ -1164,17 +1164,17 @@ function Ye({ driver: r, finalizedRounds: n }) {
1164
1164
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: i || "-" }),
1165
1165
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-standings-total", children: r.totalPoints }),
1166
1166
  n.map((c) => {
1167
- const u = t.get(c.roundNumber), x = u == null ? void 0 : u.dropped;
1167
+ const p = t.get(c.roundNumber), h = p == null ? void 0 : p.dropped;
1168
1168
  return /* @__PURE__ */ e(
1169
1169
  "td",
1170
1170
  {
1171
- className: `pvx-td pvx-td--center pvx-hidden-below-md ${!x && (u == null ? void 0 : u.position) <= 3 ? "pvx-standings-cell--podium" : ""}`,
1172
- children: u ? /* @__PURE__ */ o("div", { className: `pvx-standings-round-cell ${x ? "pvx-standings-round-cell--dropped" : ""}`, children: [
1173
- /* @__PURE__ */ o("span", { className: "pvx-standings-round-pos", children: [
1171
+ className: `pvx-td pvx-td--center pvx-hidden-below-md ${!h && (p == null ? void 0 : p.position) <= 3 ? "pvx-standings-cell--podium" : ""}`,
1172
+ children: p ? /* @__PURE__ */ l("div", { className: `pvx-standings-round-cell ${h ? "pvx-standings-round-cell--dropped" : ""}`, children: [
1173
+ /* @__PURE__ */ l("span", { className: "pvx-standings-round-pos", children: [
1174
1174
  "P",
1175
- u.position
1175
+ p.position
1176
1176
  ] }),
1177
- /* @__PURE__ */ e("span", { className: "pvx-standings-round-pts", children: u.points })
1177
+ /* @__PURE__ */ e("span", { className: "pvx-standings-round-pts", children: p.points })
1178
1178
  ] }) : /* @__PURE__ */ e("span", { className: "pvx-td--muted", children: "-" })
1179
1179
  },
1180
1180
  c.roundNumber
@@ -1182,18 +1182,18 @@ function Ye({ driver: r, finalizedRounds: n }) {
1182
1182
  })
1183
1183
  ] });
1184
1184
  }
1185
- function qr({ competitionId: r, roundNumber: n, className: s }) {
1185
+ function jr({ competitionId: r, roundNumber: n, className: s }) {
1186
1186
  var m;
1187
- const { data: t, isLoading: a } = Be(r, n);
1187
+ const { data: t, isLoading: a } = Ue(r, n);
1188
1188
  if (a)
1189
1189
  return /* @__PURE__ */ e(q, { message: "Loading results..." });
1190
1190
  if (!t)
1191
1191
  return /* @__PURE__ */ e(B, { message: "No results for this round." });
1192
- const l = (t.sessions || []).find((c) => c.type === "RACE"), d = (m = l == null ? void 0 : l.results) == null ? void 0 : m.filter((c) => c.position <= 3).sort((c, u) => c.position - u.position);
1193
- return /* @__PURE__ */ o("div", { className: `pvx-round-results ${s || ""}`, children: [
1194
- /* @__PURE__ */ o("div", { className: "pvx-round-results-header", children: [
1195
- /* @__PURE__ */ o("div", { children: [
1196
- /* @__PURE__ */ o("h4", { className: "pvx-round-results-title", children: [
1192
+ 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, p) => c.position - p.position);
1193
+ return /* @__PURE__ */ l("div", { className: `pvx-round-results ${s || ""}`, children: [
1194
+ /* @__PURE__ */ l("div", { className: "pvx-round-results-header", children: [
1195
+ /* @__PURE__ */ l("div", { children: [
1196
+ /* @__PURE__ */ l("h4", { className: "pvx-round-results-title", children: [
1197
1197
  "Round ",
1198
1198
  t.roundNumber,
1199
1199
  t.track ? `: ${t.track}` : ""
@@ -1204,52 +1204,52 @@ function qr({ competitionId: r, roundNumber: n, className: s }) {
1204
1204
  year: "numeric"
1205
1205
  }) })
1206
1206
  ] }),
1207
- (d == null ? void 0 : d.length) > 0 && /* @__PURE__ */ e("div", { className: "pvx-round-podium-summary", children: d.map((c) => /* @__PURE__ */ o("span", { className: "pvx-round-podium-item", children: [
1208
- /* @__PURE__ */ e("span", { children: Ve[c.position - 1] }),
1207
+ (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: [
1208
+ /* @__PURE__ */ e("span", { children: Ke[c.position - 1] }),
1209
1209
  /* @__PURE__ */ e("span", { children: c.driverName })
1210
1210
  ] }, c.driverId)) })
1211
1211
  ] }),
1212
- /* @__PURE__ */ e(Ze, { round: t })
1212
+ /* @__PURE__ */ e(Xe, { round: t })
1213
1213
  ] });
1214
1214
  }
1215
- function Ze({ round: r, className: n }) {
1215
+ function Xe({ round: r, className: n }) {
1216
1216
  var d, m;
1217
1217
  const [s, t] = M(null), a = (r == null ? void 0 : r.sessions) || [];
1218
1218
  if (!a.length)
1219
1219
  return /* @__PURE__ */ e(B, { message: "No session data for this round." });
1220
- const i = s || ((d = a.find((c) => c.type === "RACE")) == null ? void 0 : d.type) || ((m = a[0]) == null ? void 0 : m.type), l = a.find((c) => c.type === i) || a[0];
1221
- return /* @__PURE__ */ o("div", { className: n || "", children: [
1220
+ const i = s || ((d = a.find((c) => c.type === "RACE")) == null ? void 0 : d.type) || ((m = a[0]) == null ? void 0 : m.type), o = a.find((c) => c.type === i) || a[0];
1221
+ return /* @__PURE__ */ l("div", { className: n || "", children: [
1222
1222
  /* @__PURE__ */ e(
1223
- Ke,
1223
+ Oe,
1224
1224
  {
1225
1225
  sessions: a,
1226
1226
  activeSession: i,
1227
1227
  onSelect: t
1228
1228
  }
1229
1229
  ),
1230
- /* @__PURE__ */ e(Je, { session: l })
1230
+ /* @__PURE__ */ e(er, { session: o })
1231
1231
  ] });
1232
1232
  }
1233
- function Je({ session: r }) {
1233
+ function er({ session: r }) {
1234
1234
  var t;
1235
1235
  const n = r.type === "RACE";
1236
1236
  if (!((t = r.results) != null && t.length))
1237
1237
  return /* @__PURE__ */ e(B, { message: `No results for ${r.type}.` });
1238
- const s = We(r.results);
1239
- return /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ o("table", { className: "pvx-table", children: [
1240
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ o("tr", { className: "pvx-thead-row", children: [
1238
+ const s = ze(r.results);
1239
+ return /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
1240
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
1241
1241
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
1242
1242
  /* @__PURE__ */ e("th", { className: "pvx-th", children: "Driver" }),
1243
1243
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "Car" }),
1244
1244
  /* @__PURE__ */ e("th", { className: "pvx-th", children: "Best Lap" }),
1245
- n && /* @__PURE__ */ o(j, { children: [
1245
+ n && /* @__PURE__ */ l(j, { children: [
1246
1246
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "Laps" }),
1247
1247
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "Time / Gap" }),
1248
1248
  /* @__PURE__ */ e("th", { className: "pvx-th pvx-th--center", children: "Points" })
1249
1249
  ] })
1250
1250
  ] }) }),
1251
1251
  /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: r.results.map((a, i) => /* @__PURE__ */ e(
1252
- Xe,
1252
+ rr,
1253
1253
  {
1254
1254
  result: a,
1255
1255
  isRace: n,
@@ -1260,14 +1260,14 @@ function Je({ session: r }) {
1260
1260
  )) })
1261
1261
  ] }) });
1262
1262
  }
1263
- function Xe({ result: r, isRace: n, fastestSplits: s, rowIndex: t }) {
1263
+ function rr({ result: r, isRace: n, fastestSplits: s, rowIndex: t }) {
1264
1264
  const a = r.position <= 3;
1265
- return /* @__PURE__ */ o("tr", { className: `pvx-row ${a ? "pvx-row--podium" : ""}`, children: [
1265
+ return /* @__PURE__ */ l("tr", { className: `pvx-row ${a ? "pvx-row--podium" : ""}`, children: [
1266
1266
  /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(he, { position: r.position }) }),
1267
- /* @__PURE__ */ o("td", { className: "pvx-td pvx-td--primary", children: [
1267
+ /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
1268
1268
  /* @__PURE__ */ e(xe, { nation: r.nation }),
1269
1269
  r.driverName,
1270
- r.carNumber != null && /* @__PURE__ */ o("span", { className: "pvx-car-number", children: [
1270
+ r.carNumber != null && /* @__PURE__ */ l("span", { className: "pvx-car-number", children: [
1271
1271
  "#",
1272
1272
  r.carNumber
1273
1273
  ] }),
@@ -1275,7 +1275,7 @@ function Xe({ result: r, isRace: n, fastestSplits: s, rowIndex: t }) {
1275
1275
  ] }),
1276
1276
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-hidden-below-sm", children: S(r.carId) }),
1277
1277
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ e(
1278
- er,
1278
+ nr,
1279
1279
  {
1280
1280
  bestLap: r.bestLapFormatted,
1281
1281
  hasBestLap: r.hasBestLap,
@@ -1284,12 +1284,12 @@ function Xe({ result: r, isRace: n, fastestSplits: s, rowIndex: t }) {
1284
1284
  showAbove: t <= 1
1285
1285
  }
1286
1286
  ) }),
1287
- n && /* @__PURE__ */ o(j, { children: [
1287
+ n && /* @__PURE__ */ l(j, { children: [
1288
1288
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-hidden-below-sm", children: r.lapsCompleted }),
1289
1289
  /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: r.position === 1 ? r.totalTime || "-" : r.gap || "-" }),
1290
- /* @__PURE__ */ o("td", { className: "pvx-td pvx-td--center", children: [
1290
+ /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--center", children: [
1291
1291
  /* @__PURE__ */ e("span", { className: "pvx-session-points", children: r.points }),
1292
- r.pointsOverride !== 0 && r.pointsOverride && /* @__PURE__ */ o("span", { className: "pvx-points-override", children: [
1292
+ r.pointsOverride !== 0 && r.pointsOverride && /* @__PURE__ */ l("span", { className: "pvx-points-override", children: [
1293
1293
  "(",
1294
1294
  r.pointsOverride > 0 ? "+" : "",
1295
1295
  r.pointsOverride,
@@ -1299,30 +1299,30 @@ function Xe({ result: r, isRace: n, fastestSplits: s, rowIndex: t }) {
1299
1299
  ] })
1300
1300
  ] });
1301
1301
  }
1302
- function er({ bestLap: r, hasBestLap: n, splits: s, fastestSplits: t, showAbove: a }) {
1303
- return r ? /* @__PURE__ */ o("span", { className: `pvx-best-lap-cell ${n ? "pvx-best-lap-cell--fastest" : ""}`, children: [
1302
+ function nr({ bestLap: r, hasBestLap: n, splits: s, fastestSplits: t, showAbove: a }) {
1303
+ return r ? /* @__PURE__ */ l("span", { className: `pvx-best-lap-cell ${n ? "pvx-best-lap-cell--fastest" : ""}`, children: [
1304
1304
  /* @__PURE__ */ e("span", { className: "pvx-best-lap-time", children: r }),
1305
- (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, l) => {
1306
- const d = t && i === t[l];
1307
- return /* @__PURE__ */ o("span", { className: "pvx-splits-tooltip-row", children: [
1308
- /* @__PURE__ */ o("span", { className: "pvx-splits-tooltip-label", children: [
1305
+ (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) => {
1306
+ const d = t && i === t[o];
1307
+ return /* @__PURE__ */ l("span", { className: "pvx-splits-tooltip-row", children: [
1308
+ /* @__PURE__ */ l("span", { className: "pvx-splits-tooltip-label", children: [
1309
1309
  "S",
1310
- l + 1
1310
+ o + 1
1311
1311
  ] }),
1312
1312
  /* @__PURE__ */ e("span", { className: d ? "pvx-splits-tooltip-best" : "", children: i })
1313
- ] }, l);
1313
+ ] }, o);
1314
1314
  }) }) })
1315
1315
  ] }) : /* @__PURE__ */ e("span", { className: "pvx-td--muted", children: "-" });
1316
1316
  }
1317
- function Vr({ competitionId: r, className: n }) {
1317
+ function Kr({ competitionId: r, className: n }) {
1318
1318
  const { getSteamId: s } = k(), { data: t, isLoading: a } = oe(r), i = s();
1319
1319
  if (a)
1320
1320
  return /* @__PURE__ */ e(q, { message: "Loading drivers..." });
1321
- const l = (t == null ? void 0 : t.drivers) || (t == null ? void 0 : t.entries) || [];
1322
- return l.length ? /* @__PURE__ */ e("div", { className: `pvx-entry-grid ${n || ""}`, children: l.map((d) => {
1323
- var c, u;
1321
+ const o = (t == null ? void 0 : t.drivers) || (t == null ? void 0 : t.entries) || [];
1322
+ return o.length ? /* @__PURE__ */ e("div", { className: `pvx-entry-grid ${n || ""}`, children: o.map((d) => {
1323
+ var c, p;
1324
1324
  const m = i && d.steamId === i;
1325
- return /* @__PURE__ */ o("div", { className: `pvx-entry-card ${m ? "pvx-entry-card--you" : ""}`, children: [
1325
+ return /* @__PURE__ */ l("div", { className: `pvx-entry-card ${m ? "pvx-entry-card--you" : ""}`, children: [
1326
1326
  d.avatarUrl ? /* @__PURE__ */ e(
1327
1327
  "img",
1328
1328
  {
@@ -1330,32 +1330,32 @@ function Vr({ competitionId: r, className: n }) {
1330
1330
  alt: "",
1331
1331
  className: "pvx-entry-avatar"
1332
1332
  }
1333
- ) : /* @__PURE__ */ e("div", { className: "pvx-entry-avatar pvx-entry-avatar--placeholder", children: ((u = (c = d.displayName) == null ? void 0 : c.charAt(0)) == null ? void 0 : u.toUpperCase()) || "?" }),
1334
- /* @__PURE__ */ o("span", { className: "pvx-entry-name", children: [
1333
+ ) : /* @__PURE__ */ e("div", { className: "pvx-entry-avatar pvx-entry-avatar--placeholder", children: ((p = (c = d.displayName) == null ? void 0 : c.charAt(0)) == null ? void 0 : p.toUpperCase()) || "?" }),
1334
+ /* @__PURE__ */ l("span", { className: "pvx-entry-name", children: [
1335
1335
  d.displayName,
1336
1336
  m && /* @__PURE__ */ e("span", { className: "pvx-entry-you", children: " (you)" })
1337
1337
  ] })
1338
1338
  ] }, d.steamId || d.driverId);
1339
1339
  }) }) : /* @__PURE__ */ e(B, { message: "No drivers registered yet." });
1340
1340
  }
1341
- function jr({
1341
+ function Hr({
1342
1342
  competitionId: r,
1343
1343
  driverData: n,
1344
1344
  className: s,
1345
1345
  children: t
1346
1346
  }) {
1347
- const { data: a, isLoading: i } = Z(r), { isPowerMode: l } = J(), d = X(r), m = ce(r), c = le(r), u = (a == null ? void 0 : a.isRegistered) || !1, x = i || m.isPending || c.isPending, f = m.error || c.error || null, v = () => {
1348
- l && m.mutate(n || {});
1347
+ const { data: a, isLoading: i } = Z(r), { isPowerMode: o } = J(), d = X(r), m = ce(r), c = le(r), p = (a == null ? void 0 : a.isRegistered) || !1, h = i || m.isPending || c.isPending, f = m.error || c.error || null, v = () => {
1348
+ o && m.mutate(n || {});
1349
1349
  }, b = () => {
1350
- l && c.mutate();
1350
+ o && c.mutate();
1351
1351
  };
1352
- return typeof t == "function" ? t({ isRegistered: u, isLoading: x, register: v, withdraw: b, error: f, isPowerMode: l, registrationUrl: d }) : l ? /* @__PURE__ */ e(
1352
+ return typeof t == "function" ? t({ isRegistered: p, isLoading: h, register: v, withdraw: b, error: f, isPowerMode: o, registrationUrl: d }) : o ? /* @__PURE__ */ e(
1353
1353
  "button",
1354
1354
  {
1355
1355
  className: `pvx-comp-register-btn ${s || ""}`,
1356
- onClick: u ? b : v,
1357
- disabled: x,
1358
- children: x ? "Loading..." : u ? "Withdraw" : "Register"
1356
+ onClick: p ? b : v,
1357
+ disabled: h,
1358
+ children: h ? "Loading..." : p ? "Withdraw" : "Register"
1359
1359
  }
1360
1360
  ) : /* @__PURE__ */ e(
1361
1361
  "a",
@@ -1364,52 +1364,52 @@ function jr({
1364
1364
  target: "_blank",
1365
1365
  rel: "noopener noreferrer",
1366
1366
  className: `pvx-comp-register-link ${s || ""}`,
1367
- children: u ? "View Registration" : "Register on PitVox"
1367
+ children: p ? "View Registration" : "Register on PitVox"
1368
1368
  }
1369
1369
  );
1370
1370
  }
1371
- function Kr({ competitionId: r, registration: n, onWithdrawSuccess: s, className: t }) {
1372
- const { getSteamId: a } = k(), { isPowerMode: i } = J(), l = X(r), { data: d, isLoading: m } = Z(r), { data: c, isLoading: u } = oe(r), x = ce(r), f = le(r), v = a(), b = (d == null ? void 0 : d.isRegistered) || !1, p = (c == null ? void 0 : c.drivers) || (c == null ? void 0 : c.entries) || [], N = n || {}, h = p.length || N.currentCount || 0, g = N.maxParticipants && h >= N.maxParticipants, y = N.deadline && new Date(N.deadline) < /* @__PURE__ */ new Date(), R = N.isOpen && !y && !g;
1373
- return m || u ? /* @__PURE__ */ e(q, { message: "Loading registration..." }) : b ? /* @__PURE__ */ e("div", { className: `pvx-reg-panel ${t || ""}`, children: /* @__PURE__ */ e(
1374
- nr,
1371
+ function Or({ competitionId: r, registration: n, onWithdrawSuccess: s, className: t }) {
1372
+ const { getSteamId: a } = k(), { isPowerMode: i } = J(), o = X(r), { data: d, isLoading: m } = Z(r), { data: c, isLoading: p } = oe(r), h = ce(r), f = le(r), v = a(), b = (d == null ? void 0 : d.isRegistered) || !1, u = (c == null ? void 0 : c.drivers) || (c == null ? void 0 : c.entries) || [], N = n || {}, x = u.length || N.currentCount || 0, g = N.maxParticipants && x >= N.maxParticipants, y = N.deadline && new Date(N.deadline) < /* @__PURE__ */ new Date(), L = N.isOpen && !y && !g;
1373
+ return m || p ? /* @__PURE__ */ e(q, { message: "Loading registration..." }) : b ? /* @__PURE__ */ e("div", { className: `pvx-reg-panel ${t || ""}`, children: /* @__PURE__ */ e(
1374
+ sr,
1375
1375
  {
1376
1376
  competitionId: r,
1377
- drivers: p,
1377
+ drivers: u,
1378
1378
  steamId: v,
1379
1379
  isPowerMode: i,
1380
- registrationUrl: l,
1380
+ registrationUrl: o,
1381
1381
  withdrawMutation: f,
1382
1382
  onWithdrawSuccess: s,
1383
1383
  registration: N
1384
1384
  }
1385
- ) }) : R ? v ? i ? /* @__PURE__ */ e("div", { className: `pvx-reg-panel ${t || ""}`, children: /* @__PURE__ */ e(
1386
- rr,
1385
+ ) }) : L ? v ? i ? /* @__PURE__ */ e("div", { className: `pvx-reg-panel ${t || ""}`, children: /* @__PURE__ */ e(
1386
+ tr,
1387
1387
  {
1388
1388
  competitionId: r,
1389
- registerMutation: x,
1389
+ registerMutation: h,
1390
1390
  registration: N
1391
1391
  }
1392
- ) }) : /* @__PURE__ */ e("div", { className: `pvx-reg-panel ${t || ""}`, children: /* @__PURE__ */ e("a", { href: l, 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: l, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) }) : /* @__PURE__ */ o("div", { className: `pvx-reg-panel ${t || ""}`, children: [
1392
+ ) }) : /* @__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: [
1393
1393
  /* @__PURE__ */ e("div", { className: "pvx-reg-status-msg", children: g ? "Registration is full." : y ? "Registration deadline has passed." : "Registration is closed." }),
1394
- p.length > 0 && /* @__PURE__ */ e(ge, { drivers: p, steamId: v })
1394
+ u.length > 0 && /* @__PURE__ */ e(ge, { drivers: u, steamId: v })
1395
1395
  ] });
1396
1396
  }
1397
- function rr({ competitionId: r, registerMutation: n, registration: s }) {
1398
- const [t, a] = M(""), [i, l] = M("intermediate"), [d, m] = M(""), c = (v) => {
1397
+ function tr({ competitionId: r, registerMutation: n, registration: s }) {
1398
+ const [t, a] = M(""), [i, o] = M("intermediate"), [d, m] = M(""), c = (v) => {
1399
1399
  v.preventDefault(), n.mutate({
1400
1400
  discordUsername: t || void 0,
1401
1401
  experience: i,
1402
1402
  comments: d || void 0
1403
1403
  });
1404
- }, u = s || {}, x = u.currentCount || 0, f = u.maxParticipants;
1405
- return /* @__PURE__ */ o("form", { className: "pvx-reg-form", onSubmit: c, children: [
1406
- /* @__PURE__ */ o("div", { className: "pvx-reg-form-header", children: [
1404
+ }, p = s || {}, h = p.currentCount || 0, f = p.maxParticipants;
1405
+ return /* @__PURE__ */ l("form", { className: "pvx-reg-form", onSubmit: c, children: [
1406
+ /* @__PURE__ */ l("div", { className: "pvx-reg-form-header", children: [
1407
1407
  /* @__PURE__ */ e("h3", { className: "pvx-reg-form-title", children: "Register" }),
1408
- f && /* @__PURE__ */ e(fe, { count: x, max: f })
1408
+ f && /* @__PURE__ */ e(fe, { count: h, max: f })
1409
1409
  ] }),
1410
1410
  n.error && /* @__PURE__ */ e("div", { className: "pvx-reg-error", children: n.error.message || "Registration failed" }),
1411
- /* @__PURE__ */ o("div", { className: "pvx-reg-field", children: [
1412
- /* @__PURE__ */ o("label", { className: "pvx-reg-label", htmlFor: `pvx-discord-${r}`, children: [
1411
+ /* @__PURE__ */ l("div", { className: "pvx-reg-field", children: [
1412
+ /* @__PURE__ */ l("label", { className: "pvx-reg-label", htmlFor: `pvx-discord-${r}`, children: [
1413
1413
  "Discord Username ",
1414
1414
  /* @__PURE__ */ e("span", { className: "pvx-reg-optional", children: "(optional)" })
1415
1415
  ] }),
@@ -1425,15 +1425,15 @@ function rr({ competitionId: r, registerMutation: n, registration: s }) {
1425
1425
  }
1426
1426
  )
1427
1427
  ] }),
1428
- /* @__PURE__ */ o("div", { className: "pvx-reg-field", children: [
1428
+ /* @__PURE__ */ l("div", { className: "pvx-reg-field", children: [
1429
1429
  /* @__PURE__ */ e("label", { className: "pvx-reg-label", htmlFor: `pvx-exp-${r}`, children: "Experience Level" }),
1430
- /* @__PURE__ */ o(
1430
+ /* @__PURE__ */ l(
1431
1431
  "select",
1432
1432
  {
1433
1433
  id: `pvx-exp-${r}`,
1434
1434
  className: "pvx-reg-select",
1435
1435
  value: i,
1436
- onChange: (v) => l(v.target.value),
1436
+ onChange: (v) => o(v.target.value),
1437
1437
  children: [
1438
1438
  /* @__PURE__ */ e("option", { value: "beginner", children: "Beginner" }),
1439
1439
  /* @__PURE__ */ e("option", { value: "intermediate", children: "Intermediate" }),
@@ -1442,8 +1442,8 @@ function rr({ competitionId: r, registerMutation: n, registration: s }) {
1442
1442
  }
1443
1443
  )
1444
1444
  ] }),
1445
- /* @__PURE__ */ o("div", { className: "pvx-reg-field", children: [
1446
- /* @__PURE__ */ o("label", { className: "pvx-reg-label", htmlFor: `pvx-comments-${r}`, children: [
1445
+ /* @__PURE__ */ l("div", { className: "pvx-reg-field", children: [
1446
+ /* @__PURE__ */ l("label", { className: "pvx-reg-label", htmlFor: `pvx-comments-${r}`, children: [
1447
1447
  "Comments ",
1448
1448
  /* @__PURE__ */ e("span", { className: "pvx-reg-optional", children: "(optional)" })
1449
1449
  ] }),
@@ -1470,24 +1470,24 @@ function rr({ competitionId: r, registerMutation: n, registration: s }) {
1470
1470
  ) })
1471
1471
  ] });
1472
1472
  }
1473
- function nr({ competitionId: r, drivers: n, steamId: s, isPowerMode: t, registrationUrl: a, withdrawMutation: i, onWithdrawSuccess: l, registration: d }) {
1474
- const [m, c] = M(!1), u = () => {
1473
+ function sr({ competitionId: r, drivers: n, steamId: s, isPowerMode: t, registrationUrl: a, withdrawMutation: i, onWithdrawSuccess: o, registration: d }) {
1474
+ const [m, c] = M(!1), p = () => {
1475
1475
  i.mutate(void 0, {
1476
1476
  onSuccess: () => {
1477
- c(!1), l && l();
1477
+ c(!1), o && o();
1478
1478
  }
1479
1479
  });
1480
- }, x = d || {}, f = n.length || x.currentCount || 0, v = x.maxParticipants;
1481
- return /* @__PURE__ */ o(j, { children: [
1482
- /* @__PURE__ */ o("div", { className: "pvx-reg-form-header", children: [
1480
+ }, h = d || {}, f = n.length || h.currentCount || 0, v = h.maxParticipants;
1481
+ return /* @__PURE__ */ l(j, { children: [
1482
+ /* @__PURE__ */ l("div", { className: "pvx-reg-form-header", children: [
1483
1483
  /* @__PURE__ */ e("h3", { className: "pvx-reg-form-title", children: "Registered Drivers" }),
1484
1484
  v && /* @__PURE__ */ e(fe, { count: f, max: v })
1485
1485
  ] }),
1486
1486
  /* @__PURE__ */ e(ge, { drivers: n, steamId: s }),
1487
1487
  i.error && /* @__PURE__ */ e("div", { className: "pvx-reg-error", children: i.error.message || "Withdrawal failed" }),
1488
- t ? /* @__PURE__ */ e("div", { className: "pvx-reg-actions", children: m ? /* @__PURE__ */ o("div", { className: "pvx-reg-confirm", children: [
1488
+ t ? /* @__PURE__ */ e("div", { className: "pvx-reg-actions", children: m ? /* @__PURE__ */ l("div", { className: "pvx-reg-confirm", children: [
1489
1489
  /* @__PURE__ */ e("p", { className: "pvx-reg-confirm-text", children: "Are you sure you want to unregister?" }),
1490
- /* @__PURE__ */ o("div", { className: "pvx-reg-confirm-actions", children: [
1490
+ /* @__PURE__ */ l("div", { className: "pvx-reg-confirm-actions", children: [
1491
1491
  /* @__PURE__ */ e(
1492
1492
  "button",
1493
1493
  {
@@ -1502,7 +1502,7 @@ function nr({ competitionId: r, drivers: n, steamId: s, isPowerMode: t, registra
1502
1502
  {
1503
1503
  type: "button",
1504
1504
  className: "pvx-reg-danger-btn",
1505
- onClick: u,
1505
+ onClick: p,
1506
1506
  disabled: i.isPending,
1507
1507
  children: i.isPending ? "Unregistering..." : "Yes, Unregister"
1508
1508
  }
@@ -1523,19 +1523,19 @@ function ge({ drivers: r, steamId: n }) {
1523
1523
  if (!r.length)
1524
1524
  return /* @__PURE__ */ e("div", { className: "pvx-reg-no-drivers", children: "No drivers registered yet." });
1525
1525
  const s = [...r].sort((t, a) => {
1526
- const i = n && t.steamId === n ? -1 : 0, l = n && a.steamId === n ? -1 : 0;
1527
- return i - l;
1526
+ const i = n && t.steamId === n ? -1 : 0, o = n && a.steamId === n ? -1 : 0;
1527
+ return i - o;
1528
1528
  });
1529
1529
  return /* @__PURE__ */ e("div", { className: "pvx-reg-driver-list", children: s.map((t) => {
1530
- var i, l;
1530
+ var i, o;
1531
1531
  const a = n && t.steamId === n;
1532
- return /* @__PURE__ */ o(
1532
+ return /* @__PURE__ */ l(
1533
1533
  "div",
1534
1534
  {
1535
1535
  className: `pvx-reg-driver-row ${a ? "pvx-reg-driver-row--you" : ""}`,
1536
1536
  children: [
1537
- 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: ((l = (i = t.displayName) == null ? void 0 : i.charAt(0)) == null ? void 0 : l.toUpperCase()) || "?" }),
1538
- /* @__PURE__ */ o("span", { className: "pvx-reg-driver-name", children: [
1537
+ 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()) || "?" }),
1538
+ /* @__PURE__ */ l("span", { className: "pvx-reg-driver-name", children: [
1539
1539
  t.displayName,
1540
1540
  a && /* @__PURE__ */ e("span", { className: "pvx-entry-you", children: " (you)" })
1541
1541
  ] })
@@ -1547,14 +1547,14 @@ function ge({ drivers: r, steamId: n }) {
1547
1547
  }
1548
1548
  function fe({ count: r, max: n }) {
1549
1549
  const s = n ? r / n * 100 : 0, t = s >= 100 ? "full" : s >= 75 ? "warning" : "ok";
1550
- return /* @__PURE__ */ o("span", { className: `pvx-reg-capacity pvx-reg-capacity--${t}`, children: [
1550
+ return /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${t}`, children: [
1551
1551
  r,
1552
1552
  "/",
1553
1553
  n,
1554
1554
  " drivers"
1555
1555
  ] });
1556
1556
  }
1557
- function tr(r) {
1557
+ function ar(r) {
1558
1558
  const { cdnUrl: n } = k(), s = C({
1559
1559
  queryKey: ["pitvox", "laps", "global", r],
1560
1560
  queryFn: () => T(n, `laps/${r}.json`),
@@ -1590,7 +1590,7 @@ function Ne(r = {}) {
1590
1590
  enabled: a
1591
1591
  });
1592
1592
  }
1593
- function sr(r) {
1593
+ function ir(r) {
1594
1594
  var t;
1595
1595
  const n = Ne(), s = w(() => {
1596
1596
  var a;
@@ -1611,7 +1611,7 @@ function sr(r) {
1611
1611
  } : null
1612
1612
  };
1613
1613
  }
1614
- function Hr(r = {}) {
1614
+ function Wr(r = {}) {
1615
1615
  const n = Ne(r);
1616
1616
  return {
1617
1617
  data: n.data || null,
@@ -1619,50 +1619,50 @@ function Hr(r = {}) {
1619
1619
  error: n.error
1620
1620
  };
1621
1621
  }
1622
- function ar() {
1622
+ function or() {
1623
1623
  const { cdnUrl: r, partnerSlug: n, getSteamId: s } = k(), t = s(), { data: a, isLoading: i } = C({
1624
1624
  queryKey: ["pitvox", "competitions", n],
1625
1625
  queryFn: async () => {
1626
- const u = await T(r, "competitions/index.json");
1627
- return u != null && u.competitions ? u.competitions.filter((x) => x.partnerSlug === n) : [];
1626
+ const p = await T(r, "competitions/index.json");
1627
+ return p != null && p.competitions ? p.competitions.filter((h) => h.partnerSlug === n) : [];
1628
1628
  },
1629
1629
  staleTime: 6e4
1630
- }), l = (a == null ? void 0 : a.map((u) => u.id)) || [], d = Re({
1631
- queries: l.map((u) => ({
1632
- queryKey: ["pitvox", "competition", n, u, "entrylist"],
1633
- queryFn: () => T(r, `competitions/${n}/${u}/entrylist.json`),
1634
- enabled: !!t && l.length > 0,
1630
+ }), o = (a == null ? void 0 : a.map((p) => p.id)) || [], d = Te({
1631
+ queries: o.map((p) => ({
1632
+ queryKey: ["pitvox", "competition", n, p, "entrylist"],
1633
+ queryFn: () => T(r, `competitions/${n}/${p}/entrylist.json`),
1634
+ enabled: !!t && o.length > 0,
1635
1635
  staleTime: 6e4
1636
1636
  }))
1637
- }), m = d.some((u) => u.isLoading);
1637
+ }), m = d.some((p) => p.isLoading);
1638
1638
  return {
1639
1639
  data: w(() => {
1640
1640
  var f, v;
1641
1641
  if (!a || !t || m) return [];
1642
- const u = /* @__PURE__ */ new Date(), x = [];
1642
+ const p = /* @__PURE__ */ new Date(), h = [];
1643
1643
  for (let b = 0; b < a.length; b++) {
1644
- const p = a[b], N = (f = d[b]) == null ? void 0 : f.data;
1644
+ const u = a[b], N = (f = d[b]) == null ? void 0 : f.data;
1645
1645
  if (!((v = N == null ? void 0 : N.drivers) == null ? void 0 : v.some((y) => y.steamId === t))) continue;
1646
- const g = p.rounds || [];
1646
+ const g = u.rounds || [];
1647
1647
  for (const y of g)
1648
- y.isFinalized || !y.startTime || new Date(y.startTime) <= u || x.push({
1649
- competitionId: p.id,
1650
- competitionName: p.name,
1648
+ y.isFinalized || !y.startTime || new Date(y.startTime) <= p || h.push({
1649
+ competitionId: u.id,
1650
+ competitionName: u.name,
1651
1651
  roundNumber: y.roundNumber,
1652
1652
  track: y.track || "TBD",
1653
1653
  startTime: y.startTime
1654
1654
  });
1655
1655
  }
1656
- return x.sort((b, p) => new Date(b.startTime) - new Date(p.startTime)), x.length > 0 && (x[0].isNext = !0), x;
1656
+ return h.sort((b, u) => new Date(b.startTime) - new Date(u.startTime)), h.length > 0 && (h[0].isNext = !0), h;
1657
1657
  }, [a, t, m, d]),
1658
1658
  isLoading: i || !!t && m
1659
1659
  };
1660
1660
  }
1661
- function ir() {
1661
+ function cr() {
1662
1662
  const { onFetchNotifications: r } = k();
1663
1663
  return !!r;
1664
1664
  }
1665
- function or(r = {}) {
1665
+ function lr(r = {}) {
1666
1666
  const { onFetchNotifications: n, partnerSlug: s } = k(), { limit: t = 20, unreadOnly: a = !1 } = r;
1667
1667
  return C({
1668
1668
  queryKey: ["pitvox", "notifications", s, { limit: t, unreadOnly: a }],
@@ -1672,7 +1672,7 @@ function or(r = {}) {
1672
1672
  refetchInterval: 3e4
1673
1673
  });
1674
1674
  }
1675
- function Or() {
1675
+ function Gr() {
1676
1676
  const { onFetchNotifications: r, partnerSlug: n } = k(), { data: s, isLoading: t } = C({
1677
1677
  queryKey: ["pitvox", "notifications", n, { limit: 1, unreadOnly: !1 }],
1678
1678
  queryFn: () => r({ limit: 1 }),
@@ -1683,7 +1683,7 @@ function Or() {
1683
1683
  });
1684
1684
  return { count: s ?? 0, isLoading: t };
1685
1685
  }
1686
- function cr() {
1686
+ function dr() {
1687
1687
  const { onMarkNotificationRead: r, partnerSlug: n } = k(), s = U();
1688
1688
  return K({
1689
1689
  mutationFn: (t) => {
@@ -1698,14 +1698,14 @@ function cr() {
1698
1698
  ...i,
1699
1699
  unreadCount: Math.max(0, (i.unreadCount || 0) - 1),
1700
1700
  notifications: i.notifications.map(
1701
- (l) => l.id === a ? { ...l, isRead: !0, readAt: (/* @__PURE__ */ new Date()).toISOString() } : l
1701
+ (o) => o.id === a ? { ...o, isRead: !0, readAt: (/* @__PURE__ */ new Date()).toISOString() } : o
1702
1702
  )
1703
1703
  } : i
1704
1704
  );
1705
1705
  }
1706
1706
  });
1707
1707
  }
1708
- function lr() {
1708
+ function pr() {
1709
1709
  const { onMarkAllNotificationsRead: r, partnerSlug: n } = k(), s = U();
1710
1710
  return K({
1711
1711
  mutationFn: () => {
@@ -1729,29 +1729,29 @@ function lr() {
1729
1729
  }
1730
1730
  });
1731
1731
  }
1732
- function dr({ driverName: r, avatarUrl: n, memberSince: s, className: t = "" }) {
1732
+ function ur({ driverName: r, avatarUrl: n, memberSince: s, className: t = "" }) {
1733
1733
  const a = s ? new Date(s).toLocaleDateString("en-GB", { day: "2-digit", month: "2-digit", year: "numeric" }) : null;
1734
- return /* @__PURE__ */ o("div", { className: `pvx-card pvx-dash-profile ${t}`, children: [
1734
+ return /* @__PURE__ */ l("div", { className: `pvx-card pvx-dash-profile ${t}`, children: [
1735
1735
  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() }),
1736
- /* @__PURE__ */ o("div", { className: "pvx-dash-profile-info", children: [
1736
+ /* @__PURE__ */ l("div", { className: "pvx-dash-profile-info", children: [
1737
1737
  /* @__PURE__ */ e("h2", { className: "pvx-dash-profile-name", children: r }),
1738
- a && /* @__PURE__ */ o("p", { className: "pvx-dash-profile-since", children: [
1738
+ a && /* @__PURE__ */ l("p", { className: "pvx-dash-profile-since", children: [
1739
1739
  "Racing since ",
1740
1740
  a
1741
1741
  ] })
1742
1742
  ] })
1743
1743
  ] });
1744
1744
  }
1745
- function pr() {
1746
- return /* @__PURE__ */ o("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1745
+ function mr() {
1746
+ 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: [
1747
1747
  /* @__PURE__ */ e("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
1748
1748
  /* @__PURE__ */ e("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
1749
1749
  /* @__PURE__ */ e("line", { x1: "10", y1: "3", x2: "8", y2: "21" }),
1750
1750
  /* @__PURE__ */ e("line", { x1: "16", y1: "3", x2: "14", y2: "21" })
1751
1751
  ] });
1752
1752
  }
1753
- function ur() {
1754
- return /* @__PURE__ */ o("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1753
+ function vr() {
1754
+ 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: [
1755
1755
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
1756
1756
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "2" }),
1757
1757
  /* @__PURE__ */ e("path", { d: "M12 14v4" }),
@@ -1759,25 +1759,40 @@ function ur() {
1759
1759
  /* @__PURE__ */ e("path", { d: "M13.5 12.5l4 2.5" })
1760
1760
  ] });
1761
1761
  }
1762
- function mr() {
1762
+ function hr() {
1763
1763
  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" }) });
1764
1764
  }
1765
- function te({ items: r, labelKey: n, countKey: s }) {
1766
- if (!(r != null && r.length)) return null;
1767
- const t = r.slice().sort((a, i) => i[s] - a[s]).slice(0, 10);
1768
- return /* @__PURE__ */ o("div", { className: "pvx-dash-tooltip", children: [
1769
- t.map((a, i) => /* @__PURE__ */ o("div", { className: "pvx-dash-tooltip-row", children: [
1770
- /* @__PURE__ */ e("span", { className: "pvx-dash-tooltip-label", children: a[n] }),
1771
- /* @__PURE__ */ e("span", { className: "pvx-dash-tooltip-value", children: a[s] })
1772
- ] }, i)),
1773
- r.length > 10 && /* @__PURE__ */ o("div", { className: "pvx-dash-tooltip-row pvx-dash-tooltip-more", children: [
1774
- "+",
1775
- r.length - 10,
1776
- " more"
1777
- ] })
1778
- ] });
1765
+ function te({ icon: r, value: n, label: s, items: t, labelKey: a, countKey: i }) {
1766
+ const [o, d] = M(!1), m = we(null);
1767
+ Ce(() => {
1768
+ if (!o) return;
1769
+ function p(h) {
1770
+ m.current && !m.current.contains(h.target) && d(!1);
1771
+ }
1772
+ return document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
1773
+ }, [o]);
1774
+ const c = t != null && t.length ? t.slice().sort((p, h) => h[i] - p[i]) : null;
1775
+ return /* @__PURE__ */ l(
1776
+ "div",
1777
+ {
1778
+ ref: m,
1779
+ className: `pvx-dash-stat-card ${c ? "pvx-dash-stat-card--clickable" : ""}`,
1780
+ onClick: c ? () => d((p) => !p) : void 0,
1781
+ children: [
1782
+ r,
1783
+ /* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
1784
+ /* @__PURE__ */ e("span", { className: "pvx-dash-stat-value", children: n }),
1785
+ /* @__PURE__ */ e("span", { className: "pvx-dash-stat-label", children: s })
1786
+ ] }),
1787
+ c && /* @__PURE__ */ e("div", { className: `pvx-dash-tooltip pvx-dash-tooltip--scrollable ${o ? "pvx-dash-tooltip--open" : ""}`, children: c.map((p, h) => /* @__PURE__ */ l("div", { className: "pvx-dash-tooltip-row", children: [
1788
+ /* @__PURE__ */ e("span", { className: "pvx-dash-tooltip-label", children: p[a] }),
1789
+ /* @__PURE__ */ e("span", { className: "pvx-dash-tooltip-value", children: p[i] })
1790
+ ] }, h)) })
1791
+ ]
1792
+ }
1793
+ );
1779
1794
  }
1780
- function vr({ stats: r, rating: n, className: s = "" }) {
1795
+ function xr({ stats: r, rating: n, className: s = "" }) {
1781
1796
  if (!r) return null;
1782
1797
  const t = r.trackBreakdown.map((i) => ({
1783
1798
  name: A(i.trackId, i.layout),
@@ -1786,29 +1801,35 @@ function vr({ stats: r, rating: n, className: s = "" }) {
1786
1801
  name: S(i.carId),
1787
1802
  lapCount: i.lapCount
1788
1803
  }));
1789
- return /* @__PURE__ */ o("div", { className: `pvx-dash-stats ${s}`, children: [
1790
- /* @__PURE__ */ o("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--has-tooltip", children: [
1791
- /* @__PURE__ */ e(pr, {}),
1792
- /* @__PURE__ */ o("div", { className: "pvx-dash-stat-content", children: [
1793
- /* @__PURE__ */ e("span", { className: "pvx-dash-stat-value", children: r.lapCount.toLocaleString() }),
1794
- /* @__PURE__ */ e("span", { className: "pvx-dash-stat-label", children: "Total Laps" })
1795
- ] }),
1796
- /* @__PURE__ */ e(te, { items: t, labelKey: "name", countKey: "lapCount" })
1797
- ] }),
1798
- /* @__PURE__ */ o("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--has-tooltip", children: [
1799
- /* @__PURE__ */ e(ur, {}),
1800
- /* @__PURE__ */ o("div", { className: "pvx-dash-stat-content", children: [
1801
- /* @__PURE__ */ e("span", { className: "pvx-dash-stat-value", children: r.carBreakdown.length }),
1802
- /* @__PURE__ */ e("span", { className: "pvx-dash-stat-label", children: "Cars Used" })
1803
- ] }),
1804
- /* @__PURE__ */ e(te, { items: a, labelKey: "name", countKey: "lapCount" })
1805
- ] }),
1806
- n && /* @__PURE__ */ o("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--rating", children: [
1807
- /* @__PURE__ */ e(mr, {}),
1808
- /* @__PURE__ */ o("div", { className: "pvx-dash-stat-content", children: [
1804
+ return /* @__PURE__ */ l("div", { className: `pvx-dash-stats ${s}`, children: [
1805
+ /* @__PURE__ */ e(
1806
+ te,
1807
+ {
1808
+ icon: /* @__PURE__ */ e(mr, {}),
1809
+ value: r.lapCount.toLocaleString(),
1810
+ label: "Total Laps",
1811
+ items: t,
1812
+ labelKey: "name",
1813
+ countKey: "lapCount"
1814
+ }
1815
+ ),
1816
+ /* @__PURE__ */ e(
1817
+ te,
1818
+ {
1819
+ icon: /* @__PURE__ */ e(vr, {}),
1820
+ value: r.carBreakdown.length,
1821
+ label: "Cars Used",
1822
+ items: a,
1823
+ labelKey: "name",
1824
+ countKey: "lapCount"
1825
+ }
1826
+ ),
1827
+ n && /* @__PURE__ */ l("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--rating", children: [
1828
+ /* @__PURE__ */ e(hr, {}),
1829
+ /* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
1809
1830
  /* @__PURE__ */ e("span", { className: "pvx-dash-stat-value", children: n.rating.toFixed(1) }),
1810
1831
  /* @__PURE__ */ e("span", { className: "pvx-dash-stat-label", children: "Driver Rating" }),
1811
- /* @__PURE__ */ o("span", { className: "pvx-dash-stat-sub", children: [
1832
+ /* @__PURE__ */ l("span", { className: "pvx-dash-stat-sub", children: [
1812
1833
  "#",
1813
1834
  n.rank,
1814
1835
  " of ",
@@ -1818,14 +1839,14 @@ function vr({ stats: r, rating: n, className: s = "" }) {
1818
1839
  ] })
1819
1840
  ] });
1820
1841
  }
1821
- function hr({ records: r, className: n = "" }) {
1842
+ function gr({ records: r, className: n = "" }) {
1822
1843
  const s = w(() => r != null && r.length ? r.slice().sort((t, a) => {
1823
1844
  const i = t.recordedAt ? new Date(t.recordedAt).getTime() : 0;
1824
1845
  return (a.recordedAt ? new Date(a.recordedAt).getTime() : 0) - i;
1825
1846
  }) : [], [r]);
1826
- return s.length ? /* @__PURE__ */ o("div", { className: `pvx-card ${n}`, children: [
1827
- /* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ o("h3", { className: "pvx-card-title", children: [
1828
- /* @__PURE__ */ e("span", { className: "pvx-dash-records-icon", children: /* @__PURE__ */ o("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1847
+ return s.length ? /* @__PURE__ */ l("div", { className: `pvx-card ${n}`, children: [
1848
+ /* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
1849
+ /* @__PURE__ */ e("span", { className: "pvx-dash-records-icon", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1829
1850
  /* @__PURE__ */ e("path", { d: "M6 9H4.5a2.5 2.5 0 010-5H6" }),
1830
1851
  /* @__PURE__ */ e("path", { d: "M18 9h1.5a2.5 2.5 0 000-5H18" }),
1831
1852
  /* @__PURE__ */ e("path", { d: "M4 22h16" }),
@@ -1834,20 +1855,20 @@ function hr({ records: r, className: n = "" }) {
1834
1855
  /* @__PURE__ */ e("path", { d: "M18 2H6v7a6 6 0 0012 0V2z" })
1835
1856
  ] }) }),
1836
1857
  "Current Records",
1837
- /* @__PURE__ */ o("span", { className: "pvx-dash-records-count", children: [
1858
+ /* @__PURE__ */ l("span", { className: "pvx-dash-records-count", children: [
1838
1859
  "(",
1839
1860
  s.length,
1840
1861
  ")"
1841
1862
  ] })
1842
1863
  ] }) }),
1843
- /* @__PURE__ */ e("div", { className: "pvx-dash-records-list", children: s.map((t, a) => /* @__PURE__ */ o("div", { className: "pvx-dash-record-row", children: [
1844
- /* @__PURE__ */ o("div", { className: "pvx-dash-record-info", children: [
1864
+ /* @__PURE__ */ e("div", { className: "pvx-dash-records-list", children: s.map((t, a) => /* @__PURE__ */ l("div", { className: "pvx-dash-record-row", children: [
1865
+ /* @__PURE__ */ l("div", { className: "pvx-dash-record-info", children: [
1845
1866
  /* @__PURE__ */ e("span", { className: "pvx-dash-record-track", children: A(t.trackId, t.layout, t.game) }),
1846
1867
  /* @__PURE__ */ e("span", { className: "pvx-dash-record-car", children: S(t.carId) })
1847
1868
  ] }),
1848
- /* @__PURE__ */ o("div", { className: "pvx-dash-record-time", children: [
1869
+ /* @__PURE__ */ l("div", { className: "pvx-dash-record-time", children: [
1849
1870
  /* @__PURE__ */ e("span", { className: "pvx-dash-record-lap", children: I(t.lapTimeMs) }),
1850
- /* @__PURE__ */ o("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${t.game || "evo"}`, children: [
1871
+ /* @__PURE__ */ l("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${t.game || "evo"}`, children: [
1851
1872
  (t.game || "evo").toUpperCase(),
1852
1873
  t.gameVersion ? ` ${t.gameVersion}` : ""
1853
1874
  ] })
@@ -1855,47 +1876,60 @@ function hr({ records: r, className: n = "" }) {
1855
1876
  ] }, a)) })
1856
1877
  ] }) : null;
1857
1878
  }
1858
- function xr({ events: r, isLoading: n, className: s }) {
1859
- return n ? /* @__PURE__ */ e("div", { className: "pvx-loading", children: "Loading upcoming events..." }) : r != null && r.length ? /* @__PURE__ */ o("div", { className: `pvx-card ${s || ""}`, children: [
1860
- /* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ o("h3", { className: "pvx-card-title", children: [
1861
- /* @__PURE__ */ e(fr, {}),
1879
+ function fr({ events: r, isLoading: n, className: s, limit: t = 3 }) {
1880
+ if (n)
1881
+ return /* @__PURE__ */ e("div", { className: "pvx-loading", children: "Loading upcoming events..." });
1882
+ if (!(r != null && r.length))
1883
+ return null;
1884
+ const a = t ? r.slice(0, t) : r, i = r.length - a.length;
1885
+ return /* @__PURE__ */ l("div", { className: `pvx-card ${s || ""}`, children: [
1886
+ /* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
1887
+ /* @__PURE__ */ e(br, {}),
1862
1888
  "Upcoming Events",
1863
- /* @__PURE__ */ o("span", { className: "pvx-dash-records-count", children: [
1889
+ /* @__PURE__ */ l("span", { className: "pvx-dash-records-count", children: [
1864
1890
  "(",
1865
1891
  r.length,
1866
1892
  ")"
1867
1893
  ] })
1868
1894
  ] }) }),
1869
- /* @__PURE__ */ e("div", { className: "pvx-upcoming-list", children: r.map((t) => /* @__PURE__ */ o(
1870
- "div",
1871
- {
1872
- className: `pvx-upcoming-item ${t.isNext ? "pvx-upcoming-item--next" : ""}`,
1873
- children: [
1874
- /* @__PURE__ */ o("div", { className: "pvx-upcoming-info", children: [
1875
- /* @__PURE__ */ e("span", { className: "pvx-upcoming-comp", children: t.competitionName }),
1876
- /* @__PURE__ */ o("span", { className: "pvx-upcoming-round", children: [
1877
- "Round ",
1878
- t.roundNumber,
1879
- ": ",
1880
- t.track
1895
+ /* @__PURE__ */ l("div", { className: "pvx-upcoming-list", children: [
1896
+ a.map((o) => /* @__PURE__ */ l(
1897
+ "div",
1898
+ {
1899
+ className: `pvx-upcoming-item ${o.isNext ? "pvx-upcoming-item--next" : ""}`,
1900
+ children: [
1901
+ /* @__PURE__ */ l("div", { className: "pvx-upcoming-info", children: [
1902
+ /* @__PURE__ */ e("span", { className: "pvx-upcoming-comp", children: o.competitionName }),
1903
+ /* @__PURE__ */ l("span", { className: "pvx-upcoming-round", children: [
1904
+ "Round ",
1905
+ o.roundNumber,
1906
+ ": ",
1907
+ o.track
1908
+ ] })
1909
+ ] }),
1910
+ /* @__PURE__ */ l("div", { className: "pvx-upcoming-time", children: [
1911
+ /* @__PURE__ */ e("span", { className: "pvx-upcoming-date", children: new Date(o.startTime).toLocaleDateString("en-GB", {
1912
+ day: "numeric",
1913
+ month: "short",
1914
+ year: "numeric"
1915
+ }) }),
1916
+ /* @__PURE__ */ e("span", { className: "pvx-upcoming-relative", children: Nr(o.startTime) }),
1917
+ o.isNext && /* @__PURE__ */ e("span", { className: "pvx-upcoming-badge", children: "Next" })
1881
1918
  ] })
1882
- ] }),
1883
- /* @__PURE__ */ o("div", { className: "pvx-upcoming-time", children: [
1884
- /* @__PURE__ */ e("span", { className: "pvx-upcoming-date", children: new Date(t.startTime).toLocaleDateString("en-GB", {
1885
- day: "numeric",
1886
- month: "short",
1887
- year: "numeric"
1888
- }) }),
1889
- /* @__PURE__ */ e("span", { className: "pvx-upcoming-relative", children: gr(t.startTime) }),
1890
- t.isNext && /* @__PURE__ */ e("span", { className: "pvx-upcoming-badge", children: "Next" })
1891
- ] })
1892
- ]
1893
- },
1894
- `${t.competitionId}-${t.roundNumber}`
1895
- )) })
1896
- ] }) : null;
1919
+ ]
1920
+ },
1921
+ `${o.competitionId}-${o.roundNumber}`
1922
+ )),
1923
+ i > 0 && /* @__PURE__ */ l("div", { className: "pvx-upcoming-remaining", children: [
1924
+ "+",
1925
+ i,
1926
+ " more event",
1927
+ i !== 1 ? "s" : ""
1928
+ ] })
1929
+ ] })
1930
+ ] });
1897
1931
  }
1898
- function gr(r) {
1932
+ function Nr(r) {
1899
1933
  const n = new Date(r).getTime() - Date.now();
1900
1934
  if (n <= 0) return "Now";
1901
1935
  const s = Math.floor(n / (1e3 * 60 * 60));
@@ -1910,47 +1944,47 @@ function gr(r) {
1910
1944
  }
1911
1945
  return se(r);
1912
1946
  }
1913
- function fr() {
1914
- return /* @__PURE__ */ o("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: [
1947
+ function br() {
1948
+ 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: [
1915
1949
  /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
1916
1950
  /* @__PURE__ */ e("path", { d: "M16 2v4M8 2v4M3 10h18" })
1917
1951
  ] });
1918
1952
  }
1919
- function Nr({ notifications: r, unreadCount: n = 0, onMarkRead: s, onMarkAllRead: t, isLoading: a, className: i }) {
1920
- const l = ie();
1921
- return a ? /* @__PURE__ */ e("div", { className: "pvx-loading", children: "Loading notifications..." }) : /* @__PURE__ */ o("div", { className: `pvx-card ${i || ""}`, children: [
1922
- /* @__PURE__ */ o("div", { className: "pvx-card-header", children: [
1923
- /* @__PURE__ */ o("h3", { className: "pvx-card-title", children: [
1924
- /* @__PURE__ */ e(kr, {}),
1953
+ function yr({ notifications: r, unreadCount: n = 0, onMarkRead: s, onMarkAllRead: t, isLoading: a, className: i }) {
1954
+ const o = ie();
1955
+ return a ? /* @__PURE__ */ e("div", { className: "pvx-loading", children: "Loading notifications..." }) : /* @__PURE__ */ l("div", { className: `pvx-card ${i || ""}`, children: [
1956
+ /* @__PURE__ */ l("div", { className: "pvx-card-header", children: [
1957
+ /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
1958
+ /* @__PURE__ */ e(Cr, {}),
1925
1959
  "Notifications",
1926
1960
  n > 0 && /* @__PURE__ */ e("span", { className: "pvx-notif-badge", children: n > 99 ? "99+" : n })
1927
1961
  ] }),
1928
1962
  n > 0 && t && /* @__PURE__ */ e("button", { className: "pvx-notif-mark-all", onClick: t, children: "Mark all read" })
1929
1963
  ] }),
1930
1964
  r != null && r.length ? /* @__PURE__ */ e("div", { className: "pvx-notif-list", children: r.map((d) => /* @__PURE__ */ e(
1931
- br,
1965
+ kr,
1932
1966
  {
1933
1967
  notification: d,
1934
- getUserDisplay: l,
1968
+ getUserDisplay: o,
1935
1969
  onMarkRead: s
1936
1970
  },
1937
1971
  d.id
1938
1972
  )) }) : /* @__PURE__ */ e("div", { className: "pvx-notif-empty", children: "No notifications" })
1939
1973
  ] });
1940
1974
  }
1941
- function br({ notification: r, getUserDisplay: n, onMarkRead: s }) {
1975
+ function kr({ notification: r, getUserDisplay: n, onMarkRead: s }) {
1942
1976
  const t = () => {
1943
1977
  !r.isRead && s && s(r.id);
1944
1978
  };
1945
- return /* @__PURE__ */ o(
1979
+ return /* @__PURE__ */ l(
1946
1980
  "button",
1947
1981
  {
1948
1982
  className: `pvx-notif-item ${r.isRead ? "" : "pvx-notif-item--unread"}`,
1949
1983
  onClick: t,
1950
1984
  children: [
1951
- /* @__PURE__ */ e(yr, { type: r.type }),
1952
- /* @__PURE__ */ o("div", { className: "pvx-notif-content", children: [
1953
- /* @__PURE__ */ e("span", { className: "pvx-notif-message", children: Se(r, n) }),
1985
+ /* @__PURE__ */ e(wr, { type: r.type }),
1986
+ /* @__PURE__ */ l("div", { className: "pvx-notif-content", children: [
1987
+ /* @__PURE__ */ e("span", { className: "pvx-notif-message", children: Me(r, n) }),
1954
1988
  /* @__PURE__ */ e("span", { className: "pvx-notif-time", children: se(r.createdAt) })
1955
1989
  ] }),
1956
1990
  !r.isRead && /* @__PURE__ */ e("span", { className: "pvx-notif-dot" })
@@ -1958,11 +1992,11 @@ function br({ notification: r, getUserDisplay: n, onMarkRead: s }) {
1958
1992
  }
1959
1993
  );
1960
1994
  }
1961
- function yr({ type: r }) {
1962
- 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__ */ o("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1995
+ function wr({ type: r }) {
1996
+ 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: [
1963
1997
  /* @__PURE__ */ e("path", { d: "m3 11 18-5v12L3 13v-2z" }),
1964
1998
  /* @__PURE__ */ e("path", { d: "M11.6 16.8a3 3 0 1 1-5.8-1.6" })
1965
- ] }) }) : /* @__PURE__ */ e("span", { className: "pvx-notif-icon pvx-notif-icon--record", children: /* @__PURE__ */ o("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1999
+ ] }) }) : /* @__PURE__ */ e("span", { className: "pvx-notif-icon pvx-notif-icon--record", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1966
2000
  /* @__PURE__ */ e("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
1967
2001
  /* @__PURE__ */ e("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
1968
2002
  /* @__PURE__ */ e("path", { d: "M4 22h16" }),
@@ -1971,34 +2005,34 @@ function yr({ type: r }) {
1971
2005
  /* @__PURE__ */ e("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
1972
2006
  ] }) });
1973
2007
  }
1974
- function kr() {
1975
- return /* @__PURE__ */ o("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: [
2008
+ function Cr() {
2009
+ 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: [
1976
2010
  /* @__PURE__ */ e("path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" }),
1977
2011
  /* @__PURE__ */ e("path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0" })
1978
2012
  ] });
1979
2013
  }
1980
- function Wr({ steamId: r, avatarUrl: n, memberSince: s, className: t = "" }) {
1981
- const { data: a, isLoading: i, error: l } = tr(r), { data: d, isLoading: m } = sr(r), { data: c, isLoading: u } = ar(), x = ir(), { data: f, isLoading: v } = or({ limit: 10 }), b = cr(), p = lr();
1982
- return i || m ? /* @__PURE__ */ e("div", { className: "pvx-loading", children: "Loading dashboard..." }) : l ? /* @__PURE__ */ e("div", { className: "pvx-empty", children: "Failed to load dashboard data." }) : a ? /* @__PURE__ */ o("div", { className: `pvx-dash ${t}`, children: [
2014
+ function zr({ steamId: r, avatarUrl: n, memberSince: s, className: t = "" }) {
2015
+ const { data: a, isLoading: i, error: o } = ar(r), { data: d, isLoading: m } = ir(r), { data: c, isLoading: p } = or(), h = cr(), { data: f, isLoading: v } = lr({ limit: 10 }), b = dr(), u = pr();
2016
+ return i || m ? /* @__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: [
1983
2017
  /* @__PURE__ */ e(
1984
- dr,
2018
+ ur,
1985
2019
  {
1986
2020
  driverName: a.driverName,
1987
2021
  avatarUrl: n,
1988
2022
  memberSince: s
1989
2023
  }
1990
2024
  ),
1991
- /* @__PURE__ */ e(vr, { stats: a, rating: d }),
1992
- r && /* @__PURE__ */ e(xr, { events: c, isLoading: u }),
1993
- /* @__PURE__ */ o("div", { className: `pvx-dash-row ${x ? "pvx-dash-row--2col" : ""}`, children: [
1994
- /* @__PURE__ */ e(hr, { records: a.currentRecords }),
1995
- x && /* @__PURE__ */ e(
1996
- Nr,
2025
+ /* @__PURE__ */ e(xr, { stats: a, rating: d }),
2026
+ r && /* @__PURE__ */ e(fr, { events: c, isLoading: p }),
2027
+ /* @__PURE__ */ l("div", { className: `pvx-dash-row ${h ? "pvx-dash-row--2col" : ""}`, children: [
2028
+ /* @__PURE__ */ e(gr, { records: a.currentRecords }),
2029
+ h && /* @__PURE__ */ e(
2030
+ yr,
1997
2031
  {
1998
2032
  notifications: f == null ? void 0 : f.notifications,
1999
2033
  unreadCount: (f == null ? void 0 : f.unreadCount) || 0,
2000
2034
  onMarkRead: (N) => b.mutate(N),
2001
- onMarkAllRead: () => p.mutate(),
2035
+ onMarkAllRead: () => u.mutate(),
2002
2036
  isLoading: v
2003
2037
  }
2004
2038
  )
@@ -2006,64 +2040,64 @@ function Wr({ steamId: r, avatarUrl: n, memberSince: s, className: t = "" }) {
2006
2040
  ] }) : /* @__PURE__ */ e("div", { className: "pvx-empty", children: "No data available yet. Start driving to see your stats!" });
2007
2041
  }
2008
2042
  export {
2009
- Pr as CarsTable,
2043
+ Ar as CarsTable,
2010
2044
  B as CompEmptyState,
2011
2045
  q as CompLoadingState,
2012
- Er as CompetitionCards,
2013
- Wr as DriverDashboard,
2014
- dr as DriverProfile,
2015
- Ur as DriversTable,
2016
- Vr as EntryList,
2046
+ qr as CompetitionCards,
2047
+ zr as DriverDashboard,
2048
+ ur as DriverProfile,
2049
+ Er as DriversTable,
2050
+ Kr as EntryList,
2017
2051
  z as InfoPill,
2018
- Ar as LapHistoryTable,
2019
- Nr as NotificationsCard,
2020
- Ve as PODIUM_MEDALS,
2021
- Lr as PitVoxPartnerProvider,
2022
- Fr as RankingsTable,
2023
- hr as RecordsTable,
2024
- jr as RegisterButton,
2025
- Kr as RegistrationPanel,
2026
- qr as RoundResults,
2027
- Ze as RoundSessionResults,
2028
- _r as StandingsTable,
2029
- vr as StatsCards,
2030
- Br as TracksTable,
2031
- He as TypeBadge,
2032
- xr as UpcomingEvents,
2052
+ Fr as LapHistoryTable,
2053
+ yr as NotificationsCard,
2054
+ Ke as PODIUM_MEDALS,
2055
+ Sr as PitVoxPartnerProvider,
2056
+ _r as RankingsTable,
2057
+ gr as RecordsTable,
2058
+ Hr as RegisterButton,
2059
+ Or as RegistrationPanel,
2060
+ jr as RoundResults,
2061
+ Xe as RoundSessionResults,
2062
+ Vr as StandingsTable,
2063
+ xr as StatsCards,
2064
+ Ur as TracksTable,
2065
+ We as TypeBadge,
2066
+ fr as UpcomingEvents,
2033
2067
  S as formatCarName,
2034
- F as formatDate,
2035
- Tr as formatDelta,
2068
+ E as formatDate,
2069
+ $r as formatDelta,
2036
2070
  I as formatLapTime,
2037
- Se as formatNotificationMessage,
2071
+ Me as formatNotificationMessage,
2038
2072
  se as formatRelativeTime,
2039
2073
  D as formatSectorTime,
2040
2074
  A as formatTrackName,
2041
2075
  ae as formatTyreCompound,
2042
- Mr as useCarLeaderboard,
2043
- $r as useCarMetadata,
2044
- Ir as useCompetitionAllRounds,
2045
- De as useCompetitionConfig,
2076
+ Ir as useCarLeaderboard,
2077
+ Dr as useCarMetadata,
2078
+ Pr as useCompetitionAllRounds,
2079
+ Be as useCompetitionConfig,
2046
2080
  oe as useCompetitionEntryList,
2047
- Be as useCompetitionRound,
2048
- Ie as useCompetitionStandings,
2049
- Dr as useCompetitions,
2050
- Me as useDriverLaps,
2051
- sr as useDriverRating,
2052
- Hr as useDriverRatings,
2053
- tr as useDriverStats,
2054
- Sr as useLeaderboardIndex,
2055
- lr as useMarkAllNotificationsRead,
2056
- cr as useMarkNotificationRead,
2057
- or as useNotifications,
2058
- ir as useNotificationsEnabled,
2081
+ Ue as useCompetitionRound,
2082
+ Pe as useCompetitionStandings,
2083
+ Br as useCompetitions,
2084
+ Ie as useDriverLaps,
2085
+ ir as useDriverRating,
2086
+ Wr as useDriverRatings,
2087
+ ar as useDriverStats,
2088
+ Mr as useLeaderboardIndex,
2089
+ pr as useMarkAllNotificationsRead,
2090
+ dr as useMarkNotificationRead,
2091
+ lr as useNotifications,
2092
+ cr as useNotificationsEnabled,
2059
2093
  k as usePitVox,
2060
2094
  ce as useRegister,
2061
2095
  J as useRegistrationMode,
2062
2096
  Z as useRegistrationStatus,
2063
2097
  X as useRegistrationUrl,
2064
- $e as useTrackLeaderboard,
2065
- Or as useUnreadCount,
2066
- ar as useUpcomingEvents,
2098
+ De as useTrackLeaderboard,
2099
+ Gr as useUnreadCount,
2100
+ or as useUpcomingEvents,
2067
2101
  ie as useUserLookup,
2068
2102
  le as useWithdraw
2069
2103
  };