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