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