@pitvox/partner-react 0.7.1 → 0.7.3

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