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