@pitvox/partner-react 0.7.14 → 0.7.15
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 +43 -5
- package/dist/index.cjs +1 -1
- package/dist/index.js +1102 -923
- package/dist/styles.css +200 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as n, jsxs as l, Fragment as F } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { useQueryClient as
|
|
4
|
-
const
|
|
2
|
+
import { createContext as Ue, useMemo as S, useContext as Fe, useState as M, useCallback as H, useRef as Ee, useEffect as qe } from "react";
|
|
3
|
+
import { useQueryClient as j, QueryClient as je, QueryClientProvider as _e, useQuery as T, useMutation as W, useQueries as pe } from "@tanstack/react-query";
|
|
4
|
+
const X = Ue(null), Ve = "https://cdn.pitvox.com", Ke = "https://pitvox.com";
|
|
5
5
|
let Y = null;
|
|
6
|
-
function
|
|
6
|
+
function it({
|
|
7
7
|
partnerSlug: e = null,
|
|
8
|
-
cdnUrl:
|
|
9
|
-
pitvoxUrl:
|
|
8
|
+
cdnUrl: t = Ve,
|
|
9
|
+
pitvoxUrl: r = Ke,
|
|
10
10
|
getSteamId: s,
|
|
11
11
|
onRegister: a,
|
|
12
12
|
onWithdraw: i,
|
|
@@ -16,10 +16,10 @@ function tt({
|
|
|
16
16
|
onFetchServerPassword: c,
|
|
17
17
|
children: u
|
|
18
18
|
}) {
|
|
19
|
-
const
|
|
19
|
+
const x = S(() => ({
|
|
20
20
|
partnerSlug: e,
|
|
21
|
-
cdnUrl:
|
|
22
|
-
pitvoxUrl:
|
|
21
|
+
cdnUrl: t.replace(/\/$/, ""),
|
|
22
|
+
pitvoxUrl: r.replace(/\/$/, ""),
|
|
23
23
|
getSteamId: s || (() => null),
|
|
24
24
|
onRegister: a || null,
|
|
25
25
|
onWithdraw: i || null,
|
|
@@ -27,65 +27,65 @@ function tt({
|
|
|
27
27
|
onMarkNotificationRead: d || null,
|
|
28
28
|
onMarkAllNotificationsRead: p || null,
|
|
29
29
|
onFetchServerPassword: c || null
|
|
30
|
-
}), [e,
|
|
30
|
+
}), [e, t, r, s, a, i, o, d, p, c]);
|
|
31
31
|
let f = !1;
|
|
32
32
|
try {
|
|
33
|
-
|
|
33
|
+
j(), f = !0;
|
|
34
34
|
} catch {
|
|
35
35
|
f = !1;
|
|
36
36
|
}
|
|
37
|
-
return f ? /* @__PURE__ */ n(
|
|
37
|
+
return f ? /* @__PURE__ */ n(X.Provider, { value: x, children: u }) : (Y || (Y = new je({
|
|
38
38
|
defaultOptions: {
|
|
39
39
|
queries: { staleTime: 6e4 }
|
|
40
40
|
}
|
|
41
|
-
})), /* @__PURE__ */ n(
|
|
41
|
+
})), /* @__PURE__ */ n(_e, { client: Y, children: /* @__PURE__ */ n(X.Provider, { value: x, children: u }) }));
|
|
42
42
|
}
|
|
43
43
|
function C() {
|
|
44
|
-
const e =
|
|
44
|
+
const e = Fe(X);
|
|
45
45
|
if (!e)
|
|
46
46
|
throw new Error("usePitVox must be used within a <PitVoxPartnerProvider>");
|
|
47
47
|
return e;
|
|
48
48
|
}
|
|
49
|
-
async function
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
52
|
-
if (
|
|
53
|
-
throw new Error(`CDN fetch failed: ${
|
|
49
|
+
async function $(e, t) {
|
|
50
|
+
const r = await fetch(`${e}/${t}`);
|
|
51
|
+
if (!r.ok) {
|
|
52
|
+
if (r.status === 404 || r.status === 403) return null;
|
|
53
|
+
throw new Error(`CDN fetch failed: ${r.status}`);
|
|
54
54
|
}
|
|
55
|
-
return
|
|
55
|
+
return r.json();
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function ee(e, t, r, ...s) {
|
|
58
58
|
const a = ["leaderboards"];
|
|
59
|
-
return e && a.push(`partners/${e}`),
|
|
59
|
+
return e && a.push(`partners/${e}`), t && a.push(t), r && a.push(`v/${r}`), [...a, ...s].join("/");
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function He(e, t, r, s) {
|
|
62
62
|
const a = s || "default";
|
|
63
|
-
return e ? `laps/partners/${e}/${
|
|
63
|
+
return e ? `laps/partners/${e}/${t}/${r}/${a}.json` : `laps/${t}/${r}/${a}.json`;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
return e ? `laps/partners/${e}/${
|
|
65
|
+
function me(e, t) {
|
|
66
|
+
return e ? `laps/partners/${e}/${t}/index.json` : `laps/${t}/index.json`;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function We(e) {
|
|
69
69
|
return e ? `recent-laps/partners/${e}.json` : "recent-laps.json";
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function A(e) {
|
|
72
72
|
if (!e && e !== 0) return "-";
|
|
73
|
-
const
|
|
74
|
-
return `${
|
|
73
|
+
const t = Math.floor(e / 1e3), r = Math.floor(t / 60), s = t % 60, a = e % 1e3;
|
|
74
|
+
return `${r}:${String(s).padStart(2, "0")}.${String(a).padStart(3, "0")}`;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
return !e && e !== 0 ? "-" : e >= 6e4 ?
|
|
76
|
+
function P(e) {
|
|
77
|
+
return !e && e !== 0 ? "-" : e >= 6e4 ? A(e) : (e / 1e3).toFixed(3);
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function B(e) {
|
|
80
80
|
if (!e) return "";
|
|
81
|
-
let
|
|
82
|
-
return
|
|
81
|
+
let t = e;
|
|
82
|
+
return t.startsWith("ks_") && (t = t.slice(3)), t.split("_").map((r) => r.charAt(0).toUpperCase() + r.slice(1)).join(" ");
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function E(e, t, r) {
|
|
85
85
|
if (!e) return "";
|
|
86
|
-
const s = e.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" "), a =
|
|
87
|
-
if (!
|
|
88
|
-
const i =
|
|
86
|
+
const s = e.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" "), a = r === "acc" || !r && (t == null ? void 0 : t.toLowerCase()) === "track config";
|
|
87
|
+
if (!t || t === "default" || a) return s;
|
|
88
|
+
const i = t.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" ");
|
|
89
89
|
return `${s} ${i}`;
|
|
90
90
|
}
|
|
91
91
|
function _(e) {
|
|
@@ -100,25 +100,25 @@ function _(e) {
|
|
|
100
100
|
return "-";
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function ne(e) {
|
|
104
104
|
if (!e) return "";
|
|
105
|
-
const
|
|
106
|
-
if (
|
|
107
|
-
const s = Math.floor(
|
|
105
|
+
const t = Date.now() - new Date(e).getTime(), r = Math.floor(t / 1e3);
|
|
106
|
+
if (r < 60) return "Just now";
|
|
107
|
+
const s = Math.floor(r / 60);
|
|
108
108
|
if (s < 60) return `${s}m ago`;
|
|
109
109
|
const a = Math.floor(s / 60);
|
|
110
110
|
if (a < 24) return `${a}h ago`;
|
|
111
111
|
const i = Math.floor(a / 24);
|
|
112
112
|
return i < 30 ? `${i}d ago` : _(e);
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function ot(e) {
|
|
115
115
|
return e == null ? "" : `${e >= 0 ? "+" : "-"}${(Math.abs(e) / 1e3).toFixed(3)}`;
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
const { type:
|
|
119
|
-
return
|
|
117
|
+
function Oe(e, t) {
|
|
118
|
+
const { type: r, title: s, trackId: a, trackLayout: i, carId: o, game: d, data: p } = e, c = typeof p == "string" ? JSON.parse(p) : p, u = a ? E(a, i, d) : null, x = o ? B(o) : null, f = [u, x].filter(Boolean).join(" — ");
|
|
119
|
+
return r === "RECORD_BEATEN" && f ? `${c != null && c.beatenBySteamId && t ? t(c.beatenBySteamId).displayName : "Someone"} beat your record on ${f}` : r === "RECORD_SET" && f ? `You set a new record on ${f}` : s || "New notification";
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function xe(e) {
|
|
122
122
|
return e ? {
|
|
123
123
|
E: "Eco",
|
|
124
124
|
RD: "Road",
|
|
@@ -132,38 +132,38 @@ function me(e) {
|
|
|
132
132
|
S: "Soft"
|
|
133
133
|
}[e] || e : "Unknown";
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function ge(e) {
|
|
136
136
|
if (!e) return "-";
|
|
137
|
-
const
|
|
138
|
-
return isNaN(
|
|
139
|
-
}
|
|
140
|
-
function
|
|
141
|
-
var p, c, u,
|
|
142
|
-
const { cdnUrl:
|
|
143
|
-
queryKey: ["pitvox", "leaderboards",
|
|
144
|
-
queryFn: () =>
|
|
137
|
+
const t = Number(e);
|
|
138
|
+
return isNaN(t) ? "-" : t % 1 ? `${t.toFixed(1)}L` : `${t}L`;
|
|
139
|
+
}
|
|
140
|
+
function ze(e = {}) {
|
|
141
|
+
var p, c, u, x, f, h;
|
|
142
|
+
const { cdnUrl: t, partnerSlug: r } = C(), { game: s, gameVersion: a } = e, i = ee(r, null, null, "index.json"), o = T({
|
|
143
|
+
queryKey: ["pitvox", "leaderboards", r, "index"],
|
|
144
|
+
queryFn: () => $(t, i),
|
|
145
145
|
staleTime: 3e4,
|
|
146
146
|
refetchInterval: 3e4
|
|
147
147
|
}), d = S(() => {
|
|
148
|
-
var
|
|
149
|
-
if (!((
|
|
150
|
-
let
|
|
151
|
-
return s && (
|
|
152
|
-
id:
|
|
153
|
-
layout:
|
|
154
|
-
game:
|
|
155
|
-
gameVersion:
|
|
156
|
-
displayName:
|
|
157
|
-
driverCount:
|
|
158
|
-
carCount:
|
|
159
|
-
record:
|
|
160
|
-
visibleId:
|
|
161
|
-
carId:
|
|
162
|
-
carDisplayName:
|
|
163
|
-
lapTimeMs:
|
|
164
|
-
timestamp:
|
|
148
|
+
var g;
|
|
149
|
+
if (!((g = o.data) != null && g.tracks)) return [];
|
|
150
|
+
let b = o.data.tracks;
|
|
151
|
+
return s && (b = b.filter((m) => m.game === s)), a && (b = b.filter((m) => m.gameVersion === a)), b.map((m) => ({
|
|
152
|
+
id: m.trackId,
|
|
153
|
+
layout: m.layout,
|
|
154
|
+
game: m.game,
|
|
155
|
+
gameVersion: m.gameVersion,
|
|
156
|
+
displayName: E(m.trackId, m.layout, m.game),
|
|
157
|
+
driverCount: m.driverCount || 0,
|
|
158
|
+
carCount: m.carCount || 0,
|
|
159
|
+
record: m.recordHolder ? {
|
|
160
|
+
visibleId: m.recordHolder.steamId || m.recordHolder.userId,
|
|
161
|
+
carId: m.recordHolder.carId,
|
|
162
|
+
carDisplayName: B(m.recordHolder.carId),
|
|
163
|
+
lapTimeMs: m.recordHolder.lapTimeMs,
|
|
164
|
+
timestamp: m.recordHolder.recordedAt
|
|
165
165
|
} : null,
|
|
166
|
-
recordByTag:
|
|
166
|
+
recordByTag: m.recordByTag || null
|
|
167
167
|
}));
|
|
168
168
|
}, [(p = o.data) == null ? void 0 : p.tracks, s, a]);
|
|
169
169
|
return {
|
|
@@ -171,69 +171,69 @@ function st(e = {}) {
|
|
|
171
171
|
data: d,
|
|
172
172
|
partner: ((c = o.data) == null ? void 0 : c.partner) || null,
|
|
173
173
|
generatedAt: (u = o.data) == null ? void 0 : u.generatedAt,
|
|
174
|
-
totalLaps: ((
|
|
174
|
+
totalLaps: ((x = o.data) == null ? void 0 : x.totalLaps) || 0,
|
|
175
175
|
totalUsers: ((f = o.data) == null ? void 0 : f.totalUsers) || 0,
|
|
176
|
-
versions: ((
|
|
176
|
+
versions: ((h = o.data) == null ? void 0 : h.versions) || {}
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
|
-
function
|
|
180
|
-
const { cdnUrl: s, partnerSlug: a } = C(), { carId: i, game: o, gameVersion: d } =
|
|
179
|
+
function Qe(e, t, r = {}) {
|
|
180
|
+
const { cdnUrl: s, partnerSlug: a } = C(), { carId: i, game: o, gameVersion: d } = r, p = t || "default", c = ee(a, o, d, `tracks/${e}/${p}.json`), { data: u, isLoading: x, error: f } = T({
|
|
181
181
|
queryKey: ["pitvox", "leaderboards", a, "track", e, p, o, d],
|
|
182
|
-
queryFn: () =>
|
|
182
|
+
queryFn: () => $(s, c),
|
|
183
183
|
enabled: !!e,
|
|
184
184
|
staleTime: 3e4,
|
|
185
185
|
refetchInterval: 3e4
|
|
186
186
|
});
|
|
187
187
|
return { data: S(() => {
|
|
188
188
|
if (!(u != null && u.entries)) return [];
|
|
189
|
-
let
|
|
190
|
-
if (o && (
|
|
191
|
-
const
|
|
192
|
-
for (const N of
|
|
189
|
+
let b = u.entries;
|
|
190
|
+
if (o && (b = b.filter((g) => g.game === o)), !i) {
|
|
191
|
+
const g = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
|
|
192
|
+
for (const N of b) {
|
|
193
193
|
const v = N.steamId || N.userId;
|
|
194
|
-
|
|
194
|
+
m.has(N.carId) || m.set(N.carId, /* @__PURE__ */ new Set()), m.get(N.carId).add(v), (!g.has(N.carId) || N.lapTimeMs < g.get(N.carId).lapTimeMs) && g.set(N.carId, N);
|
|
195
195
|
}
|
|
196
|
-
return Array.from(
|
|
196
|
+
return Array.from(g.values()).map((N) => {
|
|
197
197
|
var v;
|
|
198
|
-
return { ...N, driverCount: ((v =
|
|
198
|
+
return { ...N, driverCount: ((v = m.get(N.carId)) == null ? void 0 : v.size) || 0 };
|
|
199
199
|
}).sort((N, v) => N.lapTimeMs - v.lapTimeMs);
|
|
200
200
|
}
|
|
201
|
-
return
|
|
202
|
-
}, [u == null ? void 0 : u.entries, i, o]), isLoading:
|
|
203
|
-
}
|
|
204
|
-
function
|
|
205
|
-
var
|
|
206
|
-
const { cdnUrl: i, partnerSlug: o } = C(), { showInvalid: d = !1, game: p, gameVersion: c } = a, u = e &&
|
|
207
|
-
queryKey: ["pitvox", "laps", o, e,
|
|
208
|
-
queryFn: () =>
|
|
209
|
-
enabled: !!e && !!
|
|
201
|
+
return b.filter((g) => g.carId === i).sort((g, m) => g.lapTimeMs - m.lapTimeMs);
|
|
202
|
+
}, [u == null ? void 0 : u.entries, i, o]), isLoading: x, error: f };
|
|
203
|
+
}
|
|
204
|
+
function Ge(e, t, r, s, a = {}) {
|
|
205
|
+
var g, m;
|
|
206
|
+
const { cdnUrl: i, partnerSlug: o } = C(), { showInvalid: d = !1, game: p, gameVersion: c } = a, u = e && t ? He(o, e, t, r) : null, f = T({
|
|
207
|
+
queryKey: ["pitvox", "laps", o, e, t, r || "default"],
|
|
208
|
+
queryFn: () => $(i, u),
|
|
209
|
+
enabled: !!e && !!t,
|
|
210
210
|
staleTime: 3e4,
|
|
211
211
|
refetchInterval: 3e4
|
|
212
|
-
}),
|
|
212
|
+
}), h = S(() => {
|
|
213
213
|
var N;
|
|
214
214
|
return (N = f.data) != null && N.laps ? f.data.laps.filter((v) => !(v.carId !== s || p && v.game !== p || c && v.gameVersion !== c || !d && !v.isValid)).sort((v, k) => v.lapTimeMs - k.lapTimeMs) : [];
|
|
215
|
-
}, [(
|
|
216
|
-
const N =
|
|
215
|
+
}, [(g = f.data) == null ? void 0 : g.laps, s, p, c, d]), b = S(() => {
|
|
216
|
+
const N = h.filter((w) => w.isValid && w.sector1Ms && w.sector2Ms && w.sector3Ms);
|
|
217
217
|
if (N.length < 2) return null;
|
|
218
|
-
const v = Math.min(...N.map((w) => w.sector1Ms)), k = Math.min(...N.map((w) => w.sector2Ms)),
|
|
219
|
-
return L >=
|
|
220
|
-
}, [
|
|
218
|
+
const v = Math.min(...N.map((w) => w.sector1Ms)), k = Math.min(...N.map((w) => w.sector2Ms)), y = Math.min(...N.map((w) => w.sector3Ms)), L = v + k + y, D = Math.min(...N.map((w) => w.lapTimeMs));
|
|
219
|
+
return L >= D ? null : { lapTimeMs: L, sector1Ms: v, sector2Ms: k, sector3Ms: y };
|
|
220
|
+
}, [h]);
|
|
221
221
|
return {
|
|
222
222
|
...f,
|
|
223
|
-
data:
|
|
224
|
-
driverName: ((
|
|
225
|
-
theoreticalBest:
|
|
223
|
+
data: h,
|
|
224
|
+
driverName: ((m = f.data) == null ? void 0 : m.driverName) || "Driver",
|
|
225
|
+
theoreticalBest: b
|
|
226
226
|
};
|
|
227
227
|
}
|
|
228
|
-
function
|
|
229
|
-
const { cdnUrl: e } = C(), { data:
|
|
228
|
+
function fe() {
|
|
229
|
+
const { cdnUrl: e } = C(), { data: t } = T({
|
|
230
230
|
queryKey: ["pitvox", "users", "index"],
|
|
231
|
-
queryFn: () =>
|
|
231
|
+
queryFn: () => $(e, "users/index.json"),
|
|
232
232
|
staleTime: 5 * 6e4,
|
|
233
233
|
gcTime: 30 * 6e4
|
|
234
|
-
}),
|
|
234
|
+
}), r = (t == null ? void 0 : t.users) || {};
|
|
235
235
|
return (s, a) => {
|
|
236
|
-
const i =
|
|
236
|
+
const i = r[s];
|
|
237
237
|
return {
|
|
238
238
|
displayName: (i == null ? void 0 : i.displayName) || a || s || "Unknown",
|
|
239
239
|
avatarUrl: (i == null ? void 0 : i.avatarUrl) || null,
|
|
@@ -241,25 +241,25 @@ function he() {
|
|
|
241
241
|
};
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
|
-
function
|
|
245
|
-
const { cdnUrl:
|
|
244
|
+
function lt(e = "evo") {
|
|
245
|
+
const { cdnUrl: t } = C(), { data: r } = T({
|
|
246
246
|
queryKey: ["pitvox", "cars", e],
|
|
247
|
-
queryFn: () =>
|
|
247
|
+
queryFn: () => $(t, `cars/${e}.json`),
|
|
248
248
|
staleTime: 5 * 6e4,
|
|
249
249
|
gcTime: 30 * 6e4
|
|
250
250
|
});
|
|
251
251
|
return {
|
|
252
|
-
tags: (
|
|
253
|
-
cars: (
|
|
254
|
-
categories: (
|
|
255
|
-
tagLabels: (
|
|
252
|
+
tags: (r == null ? void 0 : r.tags) || [],
|
|
253
|
+
cars: (r == null ? void 0 : r.cars) || {},
|
|
254
|
+
categories: (r == null ? void 0 : r.categories) || [],
|
|
255
|
+
tagLabels: (r == null ? void 0 : r.tagLabels) || {}
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function ct() {
|
|
259
259
|
var a, i;
|
|
260
|
-
const { cdnUrl: e, partnerSlug:
|
|
261
|
-
queryKey: ["pitvox", "recentLaps",
|
|
262
|
-
queryFn: () =>
|
|
260
|
+
const { cdnUrl: e, partnerSlug: t } = C(), r = We(t), s = T({
|
|
261
|
+
queryKey: ["pitvox", "recentLaps", t],
|
|
262
|
+
queryFn: () => $(e, r),
|
|
263
263
|
staleTime: 3e4,
|
|
264
264
|
refetchInterval: 3e4,
|
|
265
265
|
gcTime: 10 * 6e4
|
|
@@ -270,94 +270,94 @@ function it() {
|
|
|
270
270
|
isLoading: s.isLoading
|
|
271
271
|
};
|
|
272
272
|
}
|
|
273
|
-
function
|
|
274
|
-
return
|
|
273
|
+
function dt(e, t) {
|
|
274
|
+
return Qe(e, null, { carId: t });
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
const { cdnUrl: e, partnerSlug:
|
|
276
|
+
function pt() {
|
|
277
|
+
const { cdnUrl: e, partnerSlug: t } = C();
|
|
278
278
|
return T({
|
|
279
|
-
queryKey: ["pitvox", "competitions",
|
|
279
|
+
queryKey: ["pitvox", "competitions", t],
|
|
280
280
|
queryFn: async () => {
|
|
281
|
-
const
|
|
282
|
-
return
|
|
281
|
+
const r = await $(e, "competitions/index.json");
|
|
282
|
+
return r != null && r.competitions ? t ? r.competitions.filter((s) => s.partnerSlug === t) : r.competitions : [];
|
|
283
283
|
},
|
|
284
284
|
staleTime: 6e4
|
|
285
285
|
});
|
|
286
286
|
}
|
|
287
|
-
function
|
|
288
|
-
const
|
|
287
|
+
function Ne(e, t = {}) {
|
|
288
|
+
const r = C(), s = t.partnerSlug || r.partnerSlug;
|
|
289
289
|
return T({
|
|
290
290
|
queryKey: ["pitvox", "competition", s, e, "config"],
|
|
291
|
-
queryFn: () =>
|
|
291
|
+
queryFn: () => $(r.cdnUrl, `competitions/${s}/${e}/config.json`),
|
|
292
292
|
enabled: !!s && !!e,
|
|
293
293
|
staleTime: 6e4
|
|
294
294
|
});
|
|
295
295
|
}
|
|
296
|
-
function
|
|
297
|
-
const
|
|
296
|
+
function be(e, t = {}) {
|
|
297
|
+
const r = C(), s = t.partnerSlug || r.partnerSlug;
|
|
298
298
|
return T({
|
|
299
299
|
queryKey: ["pitvox", "competition", s, e, "standings"],
|
|
300
|
-
queryFn: () =>
|
|
300
|
+
queryFn: () => $(r.cdnUrl, `competitions/${s}/${e}/standings.json`),
|
|
301
301
|
enabled: !!s && !!e,
|
|
302
302
|
staleTime: 6e4
|
|
303
303
|
});
|
|
304
304
|
}
|
|
305
|
-
function
|
|
306
|
-
const s = C(), a =
|
|
305
|
+
function Ye(e, t, r = {}) {
|
|
306
|
+
const s = C(), a = r.partnerSlug || s.partnerSlug;
|
|
307
307
|
return T({
|
|
308
|
-
queryKey: ["pitvox", "competition", a, e, "round",
|
|
309
|
-
queryFn: () =>
|
|
310
|
-
enabled: !!a && !!e &&
|
|
308
|
+
queryKey: ["pitvox", "competition", a, e, "round", t],
|
|
309
|
+
queryFn: () => $(s.cdnUrl, `competitions/${a}/${e}/rounds/${t}.json`),
|
|
310
|
+
enabled: !!a && !!e && t != null,
|
|
311
311
|
staleTime: 6e4
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
|
-
function
|
|
315
|
-
const s = C(), a =
|
|
314
|
+
function Je(e, t = [], r = {}) {
|
|
315
|
+
const s = C(), a = r.partnerSlug || s.partnerSlug;
|
|
316
316
|
return T({
|
|
317
|
-
queryKey: ["pitvox", "competition", a, e, "allRounds",
|
|
317
|
+
queryKey: ["pitvox", "competition", a, e, "allRounds", t],
|
|
318
318
|
queryFn: async () => (await Promise.all(
|
|
319
|
-
|
|
320
|
-
(o) =>
|
|
319
|
+
t.map(
|
|
320
|
+
(o) => $(s.cdnUrl, `competitions/${a}/${e}/rounds/${o}.json`).catch(() => null)
|
|
321
321
|
)
|
|
322
322
|
)).filter(Boolean),
|
|
323
|
-
enabled: !!a && !!e &&
|
|
323
|
+
enabled: !!a && !!e && t.length > 0,
|
|
324
324
|
staleTime: 6e4
|
|
325
325
|
});
|
|
326
326
|
}
|
|
327
|
-
function
|
|
328
|
-
const
|
|
327
|
+
function Ze(e, t = {}) {
|
|
328
|
+
const r = C(), s = t.partnerSlug || r.partnerSlug;
|
|
329
329
|
return T({
|
|
330
330
|
queryKey: ["pitvox", "competition", s, e, "leaderboard"],
|
|
331
|
-
queryFn: () =>
|
|
331
|
+
queryFn: () => $(r.cdnUrl, `competitions/${s}/${e}/leaderboard.json`).catch(() => null),
|
|
332
332
|
enabled: !!s && !!e,
|
|
333
333
|
staleTime: 6e4
|
|
334
334
|
});
|
|
335
335
|
}
|
|
336
|
-
function
|
|
337
|
-
const s = C(), a =
|
|
336
|
+
function Xe(e, t, r = {}) {
|
|
337
|
+
const s = C(), a = r.partnerSlug || s.partnerSlug;
|
|
338
338
|
return T({
|
|
339
|
-
queryKey: ["pitvox", "competition", a, e, "round",
|
|
340
|
-
queryFn: () =>
|
|
341
|
-
enabled: !!a && !!e &&
|
|
339
|
+
queryKey: ["pitvox", "competition", a, e, "round", t, "laps"],
|
|
340
|
+
queryFn: () => $(s.cdnUrl, `competitions/${a}/${e}/rounds/${t}/laps.json`).catch(() => null),
|
|
341
|
+
enabled: !!a && !!e && t != null,
|
|
342
342
|
staleTime: 6e4
|
|
343
343
|
});
|
|
344
344
|
}
|
|
345
|
-
function
|
|
346
|
-
const
|
|
345
|
+
function ye(e, t = {}) {
|
|
346
|
+
const r = C(), s = t.partnerSlug || r.partnerSlug;
|
|
347
347
|
return T({
|
|
348
348
|
queryKey: ["pitvox", "competition", s, e, "entrylist"],
|
|
349
|
-
queryFn: () =>
|
|
349
|
+
queryFn: () => $(r.cdnUrl, `competitions/${s}/${e}/entrylist.json`),
|
|
350
350
|
enabled: !!s && !!e,
|
|
351
351
|
staleTime: 6e4
|
|
352
352
|
});
|
|
353
353
|
}
|
|
354
|
-
function
|
|
355
|
-
const { cdnUrl:
|
|
354
|
+
function te(e) {
|
|
355
|
+
const { cdnUrl: t, partnerSlug: r, getSteamId: s } = C(), a = s();
|
|
356
356
|
return T({
|
|
357
|
-
queryKey: ["pitvox", "registration",
|
|
357
|
+
queryKey: ["pitvox", "registration", r, e, a],
|
|
358
358
|
queryFn: async () => {
|
|
359
359
|
var p;
|
|
360
|
-
const i = await fetch(`${
|
|
360
|
+
const i = await fetch(`${t}/competitions/${r}/${e}/entrylist.json`);
|
|
361
361
|
if (!i.ok) return { isRegistered: !1, entryList: null };
|
|
362
362
|
const o = await i.json();
|
|
363
363
|
return { isRegistered: !!a && ((p = o.drivers) == null ? void 0 : p.some((c) => c.steamId === a)), entryList: o };
|
|
@@ -366,20 +366,20 @@ function ee(e) {
|
|
|
366
366
|
staleTime: 6e4
|
|
367
367
|
});
|
|
368
368
|
}
|
|
369
|
-
function
|
|
370
|
-
const { onRegister:
|
|
369
|
+
function ke(e) {
|
|
370
|
+
const { onRegister: t, partnerSlug: r, getSteamId: s } = C(), a = j(), i = fe();
|
|
371
371
|
return W({
|
|
372
372
|
mutationFn: (o) => {
|
|
373
|
-
if (!
|
|
373
|
+
if (!t)
|
|
374
374
|
throw new Error(
|
|
375
375
|
"No onRegister callback provided to PitVoxPartnerProvider. Provide onRegister for in-app registration, or use useRegistrationUrl() to link to pitvox.com."
|
|
376
376
|
);
|
|
377
|
-
return
|
|
377
|
+
return t(e, o);
|
|
378
378
|
},
|
|
379
379
|
onSuccess: () => {
|
|
380
380
|
const o = s();
|
|
381
381
|
if (a.setQueriesData(
|
|
382
|
-
{ queryKey: ["pitvox", "registration",
|
|
382
|
+
{ queryKey: ["pitvox", "registration", r, e] },
|
|
383
383
|
(d) => d ? { ...d, isRegistered: !0 } : { isRegistered: !0, entryList: null }
|
|
384
384
|
), o) {
|
|
385
385
|
const d = i(o), p = {
|
|
@@ -388,126 +388,126 @@ function Ne(e) {
|
|
|
388
388
|
avatarUrl: d.avatarUrl
|
|
389
389
|
};
|
|
390
390
|
a.setQueriesData(
|
|
391
|
-
{ queryKey: ["pitvox", "competition",
|
|
391
|
+
{ queryKey: ["pitvox", "competition", r, e, "entrylist"] },
|
|
392
392
|
(c) => {
|
|
393
|
-
var
|
|
394
|
-
return c ? ((
|
|
393
|
+
var x;
|
|
394
|
+
return c ? ((x = c.drivers) == null ? void 0 : x.some((f) => f.steamId === o)) ? c : { ...c, drivers: [...c.drivers || [], p] } : { drivers: [p] };
|
|
395
395
|
}
|
|
396
396
|
);
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
399
|
});
|
|
400
400
|
}
|
|
401
|
-
function
|
|
402
|
-
const { onWithdraw:
|
|
401
|
+
function we(e) {
|
|
402
|
+
const { onWithdraw: t, partnerSlug: r, getSteamId: s } = C(), a = j();
|
|
403
403
|
return W({
|
|
404
404
|
mutationFn: (i) => {
|
|
405
|
-
if (!
|
|
405
|
+
if (!t)
|
|
406
406
|
throw new Error(
|
|
407
407
|
"No onWithdraw callback provided to PitVoxPartnerProvider. Provide onWithdraw for in-app withdrawal, or use useRegistrationUrl() to link to pitvox.com."
|
|
408
408
|
);
|
|
409
409
|
const o = i || s();
|
|
410
410
|
if (!o) throw new Error("No Steam ID available");
|
|
411
|
-
return
|
|
411
|
+
return t(e, o);
|
|
412
412
|
},
|
|
413
413
|
onSuccess: () => {
|
|
414
414
|
const i = s();
|
|
415
415
|
a.setQueriesData(
|
|
416
|
-
{ queryKey: ["pitvox", "registration",
|
|
416
|
+
{ queryKey: ["pitvox", "registration", r, e] },
|
|
417
417
|
(o) => o ? { ...o, isRegistered: !1 } : { isRegistered: !1, entryList: null }
|
|
418
418
|
), i && a.setQueriesData(
|
|
419
|
-
{ queryKey: ["pitvox", "competition",
|
|
419
|
+
{ queryKey: ["pitvox", "competition", r, e, "entrylist"] },
|
|
420
420
|
(o) => o != null && o.drivers ? { ...o, drivers: o.drivers.filter((d) => d.steamId !== i) } : o
|
|
421
421
|
);
|
|
422
422
|
}
|
|
423
423
|
});
|
|
424
424
|
}
|
|
425
|
-
function
|
|
426
|
-
const { onRegister: e, onWithdraw:
|
|
427
|
-
return { isPowerMode:
|
|
425
|
+
function re() {
|
|
426
|
+
const { onRegister: e, onWithdraw: t } = C(), r = !!(e && t);
|
|
427
|
+
return { isPowerMode: r, isBasicMode: !r };
|
|
428
428
|
}
|
|
429
|
-
function
|
|
430
|
-
const { pitvoxUrl:
|
|
431
|
-
return `${
|
|
429
|
+
function se(e) {
|
|
430
|
+
const { pitvoxUrl: t, partnerSlug: r } = C();
|
|
431
|
+
return `${t}/p/${r}/competitions/${e}/register`;
|
|
432
432
|
}
|
|
433
|
-
function
|
|
434
|
-
for (const
|
|
435
|
-
if (
|
|
433
|
+
function en(e, t) {
|
|
434
|
+
for (const r of t)
|
|
435
|
+
if (r.tags.includes(e)) return r.id;
|
|
436
436
|
return "other";
|
|
437
437
|
}
|
|
438
|
-
function
|
|
439
|
-
if (
|
|
438
|
+
function Ce(e, t, r = []) {
|
|
439
|
+
if (t.size === 0) return !0;
|
|
440
440
|
const s = {};
|
|
441
|
-
for (const a of
|
|
442
|
-
const i =
|
|
441
|
+
for (const a of t) {
|
|
442
|
+
const i = en(a, r);
|
|
443
443
|
s[i] || (s[i] = []), s[i].push(a);
|
|
444
444
|
}
|
|
445
445
|
for (const a of Object.values(s))
|
|
446
446
|
if (!a.some((i) => e.includes(i))) return !1;
|
|
447
447
|
return !0;
|
|
448
448
|
}
|
|
449
|
-
function
|
|
450
|
-
const [
|
|
449
|
+
function Le(e, t) {
|
|
450
|
+
const [r, s] = M(/* @__PURE__ */ new Set()), a = e !== void 0, i = a ? e : r, o = H((p) => {
|
|
451
451
|
const c = new Set(i);
|
|
452
|
-
c.has(p) ? c.delete(p) : c.add(p), a &&
|
|
453
|
-
}, [i, a,
|
|
454
|
-
a &&
|
|
455
|
-
}, [a,
|
|
452
|
+
c.has(p) ? c.delete(p) : c.add(p), a && t ? t(c) : s(c);
|
|
453
|
+
}, [i, a, t]), d = H(() => {
|
|
454
|
+
a && t ? t(/* @__PURE__ */ new Set()) : s(/* @__PURE__ */ new Set());
|
|
455
|
+
}, [a, t]);
|
|
456
456
|
return { activeTags: i, toggle: o, clear: d };
|
|
457
457
|
}
|
|
458
458
|
function O(e) {
|
|
459
|
-
const [
|
|
460
|
-
|
|
459
|
+
const [t, r] = M(e), s = H((a) => {
|
|
460
|
+
r(
|
|
461
461
|
(i) => i.key === a ? { key: a, dir: i.dir === "asc" ? "desc" : "asc" } : { key: a, dir: a.includes("timestamp") || a.includes("Date") ? "desc" : "asc" }
|
|
462
462
|
);
|
|
463
463
|
}, []);
|
|
464
|
-
return [
|
|
464
|
+
return [t, s];
|
|
465
465
|
}
|
|
466
|
-
function z(e,
|
|
466
|
+
function z(e, t, r) {
|
|
467
467
|
return [...e].sort((s, a) => {
|
|
468
|
-
const i =
|
|
468
|
+
const i = r(s, t.key), o = r(a, t.key);
|
|
469
469
|
if (i == null && o == null) return 0;
|
|
470
470
|
if (i == null) return 1;
|
|
471
471
|
if (o == null) return -1;
|
|
472
472
|
const d = typeof i == "string" ? i.localeCompare(o) : i - o;
|
|
473
|
-
return
|
|
473
|
+
return t.dir === "desc" ? -d : d;
|
|
474
474
|
});
|
|
475
475
|
}
|
|
476
|
-
function
|
|
477
|
-
const
|
|
478
|
-
return
|
|
479
|
-
s1: Math.min(...
|
|
480
|
-
s2: Math.min(...
|
|
481
|
-
s3: Math.min(...
|
|
476
|
+
function Se(e, t = !1) {
|
|
477
|
+
const r = t ? e == null ? void 0 : e.filter((s) => s.isValid) : e;
|
|
478
|
+
return r != null && r.length ? {
|
|
479
|
+
s1: Math.min(...r.map((s) => s.sector1Ms).filter(Boolean)),
|
|
480
|
+
s2: Math.min(...r.map((s) => s.sector2Ms).filter(Boolean)),
|
|
481
|
+
s3: Math.min(...r.map((s) => s.sector3Ms).filter(Boolean))
|
|
482
482
|
} : null;
|
|
483
483
|
}
|
|
484
|
-
function
|
|
485
|
-
return e ?
|
|
484
|
+
function nn({ active: e, dir: t }) {
|
|
485
|
+
return e ? t === "asc" ? /* @__PURE__ */ n("svg", { className: "pvx-sort-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 15.75l7.5-7.5 7.5 7.5" }) }) : /* @__PURE__ */ n("svg", { className: "pvx-sort-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" }) }) : /* @__PURE__ */ n("svg", { className: "pvx-sort-icon pvx-sort-icon--inactive", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 9l4-4 4 4M16 15l-4 4-4-4" }) });
|
|
486
486
|
}
|
|
487
|
-
function
|
|
487
|
+
function R({ label: e, sortKey: t, config: r, onSort: s, className: a = "" }) {
|
|
488
488
|
return /* @__PURE__ */ n(
|
|
489
489
|
"th",
|
|
490
490
|
{
|
|
491
491
|
className: `pvx-th pvx-th--sortable ${a}`,
|
|
492
|
-
onClick: () => s(
|
|
492
|
+
onClick: () => s(t),
|
|
493
493
|
children: /* @__PURE__ */ l("span", { className: "pvx-th-inner", children: [
|
|
494
494
|
e,
|
|
495
|
-
/* @__PURE__ */ n(
|
|
495
|
+
/* @__PURE__ */ n(nn, { active: r.key === t, dir: r.dir })
|
|
496
496
|
] })
|
|
497
497
|
}
|
|
498
498
|
);
|
|
499
499
|
}
|
|
500
|
-
function Q({ userId: e, getUserDisplay:
|
|
501
|
-
const { displayName:
|
|
500
|
+
function Q({ userId: e, getUserDisplay: t }) {
|
|
501
|
+
const { displayName: r, avatarUrl: s } = t(e);
|
|
502
502
|
return /* @__PURE__ */ l("span", { className: "pvx-driver", children: [
|
|
503
503
|
s ? /* @__PURE__ */ n("img", { src: s, alt: "", className: "pvx-driver-avatar" }) : /* @__PURE__ */ n("span", { className: "pvx-driver-avatar pvx-driver-avatar--placeholder" }),
|
|
504
|
-
/* @__PURE__ */ n("span", { className: "pvx-driver-name", children:
|
|
504
|
+
/* @__PURE__ */ n("span", { className: "pvx-driver-name", children: r })
|
|
505
505
|
] });
|
|
506
506
|
}
|
|
507
|
-
function
|
|
508
|
-
return /* @__PURE__ */ n("span", { className:
|
|
507
|
+
function ae({ rank: e, podium: t = !1 }) {
|
|
508
|
+
return /* @__PURE__ */ n("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 });
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function Te({ availableTags: e, activeTags: t, onToggle: r, onClear: s, categories: a = [], tagLabels: i = {} }) {
|
|
511
511
|
if (!e || e.length < 2) return null;
|
|
512
512
|
const o = a.map((d) => ({ id: d.id, tags: d.tags.filter((p) => e.includes(p)) })).filter((d) => d.tags.length > 0);
|
|
513
513
|
return /* @__PURE__ */ l("div", { className: "pvx-tag-bar", children: [
|
|
@@ -515,7 +515,7 @@ function Ce({ availableTags: e, activeTags: r, onToggle: t, onClear: s, categori
|
|
|
515
515
|
"button",
|
|
516
516
|
{
|
|
517
517
|
onClick: s,
|
|
518
|
-
className: `pvx-tag ${
|
|
518
|
+
className: `pvx-tag ${t.size === 0 ? "pvx-tag--active" : ""}`,
|
|
519
519
|
children: "All"
|
|
520
520
|
}
|
|
521
521
|
),
|
|
@@ -524,8 +524,8 @@ function Ce({ availableTags: e, activeTags: r, onToggle: t, onClear: s, categori
|
|
|
524
524
|
d.tags.map((c) => /* @__PURE__ */ n(
|
|
525
525
|
"button",
|
|
526
526
|
{
|
|
527
|
-
onClick: () =>
|
|
528
|
-
className: `pvx-tag ${
|
|
527
|
+
onClick: () => r(c),
|
|
528
|
+
className: `pvx-tag ${t.has(c) ? "pvx-tag--active" : ""}`,
|
|
529
529
|
children: i[c] || c
|
|
530
530
|
},
|
|
531
531
|
c
|
|
@@ -533,13 +533,13 @@ function Ce({ availableTags: e, activeTags: r, onToggle: t, onClear: s, categori
|
|
|
533
533
|
] }, d.id))
|
|
534
534
|
] });
|
|
535
535
|
}
|
|
536
|
-
function
|
|
537
|
-
return /* @__PURE__ */ n("nav", { className: "pvx-breadcrumb", "aria-label": "Breadcrumb", children: /* @__PURE__ */ n("ol", { className: "pvx-breadcrumb-list", children: e.map((
|
|
538
|
-
const s =
|
|
536
|
+
function ie({ segments: e }) {
|
|
537
|
+
return /* @__PURE__ */ n("nav", { className: "pvx-breadcrumb", "aria-label": "Breadcrumb", children: /* @__PURE__ */ n("ol", { className: "pvx-breadcrumb-list", children: e.map((t, r) => {
|
|
538
|
+
const s = r === e.length - 1;
|
|
539
539
|
return /* @__PURE__ */ l("li", { className: "pvx-breadcrumb-item", children: [
|
|
540
|
-
|
|
541
|
-
!s &&
|
|
542
|
-
] },
|
|
540
|
+
r > 0 && /* @__PURE__ */ n("svg", { className: "pvx-breadcrumb-chevron", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.25 4.5l7.5 7.5-7.5 7.5" }) }),
|
|
541
|
+
!s && t.onClick ? /* @__PURE__ */ n("button", { onClick: t.onClick, className: "pvx-breadcrumb-link", children: t.label }) : /* @__PURE__ */ n("span", { className: "pvx-breadcrumb-current", children: t.label })
|
|
542
|
+
] }, t.key);
|
|
543
543
|
}) }) });
|
|
544
544
|
}
|
|
545
545
|
function V({ message: e }) {
|
|
@@ -551,138 +551,138 @@ function V({ message: e }) {
|
|
|
551
551
|
function K() {
|
|
552
552
|
return /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading..." });
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function tn() {
|
|
555
555
|
return /* @__PURE__ */ n("svg", { className: "pvx-icon pvx-icon--valid", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 12.75l6 6 9-13.5" }) });
|
|
556
556
|
}
|
|
557
|
-
function
|
|
557
|
+
function rn() {
|
|
558
558
|
return /* @__PURE__ */ n("svg", { className: "pvx-icon pvx-icon--invalid", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) });
|
|
559
559
|
}
|
|
560
|
-
function
|
|
561
|
-
const [d, p] = O({ key: "record.timestamp", dir: "desc" }), { activeTags: c, toggle: u, clear:
|
|
562
|
-
var
|
|
563
|
-
if (!((
|
|
564
|
-
const
|
|
560
|
+
function ut({ tracks: e, isLoading: t, carMetadata: r, getUserDisplay: s, onTrackSelect: a, tags: i, onTagChange: o }) {
|
|
561
|
+
const [d, p] = O({ key: "record.timestamp", dir: "desc" }), { activeTags: c, toggle: u, clear: x } = Le(i, o), f = S(() => {
|
|
562
|
+
var m;
|
|
563
|
+
if (!((m = r == null ? void 0 : r.tags) != null && m.length)) return [];
|
|
564
|
+
const g = /* @__PURE__ */ new Set();
|
|
565
565
|
for (const N of e || [])
|
|
566
|
-
N.recordByTag && Object.keys(N.recordByTag).forEach((v) =>
|
|
567
|
-
return
|
|
568
|
-
}, [e,
|
|
566
|
+
N.recordByTag && Object.keys(N.recordByTag).forEach((v) => g.add(v));
|
|
567
|
+
return r.tags.filter((N) => g.has(N));
|
|
568
|
+
}, [e, r]), h = S(() => e ? c.size === 0 ? e : e.map((g) => {
|
|
569
569
|
var v, k;
|
|
570
|
-
if (!
|
|
571
|
-
let
|
|
570
|
+
if (!g.recordByTag) return null;
|
|
571
|
+
let m = null;
|
|
572
572
|
const N = /* @__PURE__ */ new Set();
|
|
573
|
-
for (const
|
|
574
|
-
if (N.has(
|
|
575
|
-
N.add(
|
|
576
|
-
const L = ((k = (v =
|
|
577
|
-
|
|
573
|
+
for (const y of Object.values(g.recordByTag)) {
|
|
574
|
+
if (N.has(y.carId)) continue;
|
|
575
|
+
N.add(y.carId);
|
|
576
|
+
const L = ((k = (v = r == null ? void 0 : r.cars) == null ? void 0 : v[y.carId]) == null ? void 0 : k.tags) || [];
|
|
577
|
+
Ce(L, c, r == null ? void 0 : r.categories) && (!m || y.lapTimeMs < m.lapTimeMs) && (m = y);
|
|
578
578
|
}
|
|
579
|
-
return
|
|
580
|
-
...
|
|
579
|
+
return m ? {
|
|
580
|
+
...g,
|
|
581
581
|
record: {
|
|
582
|
-
visibleId:
|
|
583
|
-
carId:
|
|
584
|
-
carDisplayName:
|
|
585
|
-
lapTimeMs:
|
|
586
|
-
timestamp:
|
|
582
|
+
visibleId: m.steamId || m.identifier,
|
|
583
|
+
carId: m.carId,
|
|
584
|
+
carDisplayName: B(m.carId),
|
|
585
|
+
lapTimeMs: m.lapTimeMs,
|
|
586
|
+
timestamp: m.recordedAt
|
|
587
587
|
}
|
|
588
588
|
} : null;
|
|
589
|
-
}).filter(Boolean) : [], [e, c,
|
|
589
|
+
}).filter(Boolean) : [], [e, c, r]), b = S(() => z(h, d, (g, m) => {
|
|
590
590
|
var N, v;
|
|
591
|
-
switch (
|
|
591
|
+
switch (m) {
|
|
592
592
|
case "displayName":
|
|
593
|
-
return
|
|
593
|
+
return g.displayName;
|
|
594
594
|
case "record.lapTimeMs":
|
|
595
|
-
return (N =
|
|
595
|
+
return (N = g.record) == null ? void 0 : N.lapTimeMs;
|
|
596
596
|
case "driverCount":
|
|
597
|
-
return
|
|
597
|
+
return g.driverCount || 0;
|
|
598
598
|
case "carCount":
|
|
599
|
-
return
|
|
599
|
+
return g.carCount || 0;
|
|
600
600
|
case "record.timestamp":
|
|
601
601
|
default:
|
|
602
|
-
return (v =
|
|
602
|
+
return (v = g.record) != null && v.timestamp ? new Date(g.record.timestamp).getTime() : 0;
|
|
603
603
|
}
|
|
604
|
-
}), [
|
|
605
|
-
return
|
|
604
|
+
}), [h, d]);
|
|
605
|
+
return t ? /* @__PURE__ */ n(K, {}) : e != null && e.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
|
|
606
606
|
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n("h2", { className: "pvx-card-title", children: "Track Records" }) }),
|
|
607
607
|
/* @__PURE__ */ n(
|
|
608
|
-
|
|
608
|
+
Te,
|
|
609
609
|
{
|
|
610
610
|
availableTags: f,
|
|
611
611
|
activeTags: c,
|
|
612
612
|
onToggle: u,
|
|
613
|
-
onClear:
|
|
614
|
-
categories:
|
|
615
|
-
tagLabels:
|
|
613
|
+
onClear: x,
|
|
614
|
+
categories: r == null ? void 0 : r.categories,
|
|
615
|
+
tagLabels: r == null ? void 0 : r.tagLabels
|
|
616
616
|
}
|
|
617
617
|
),
|
|
618
618
|
/* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
|
|
619
619
|
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
|
|
620
|
-
/* @__PURE__ */ n(
|
|
620
|
+
/* @__PURE__ */ n(R, { label: "Track", sortKey: "displayName", config: d, onSort: p }),
|
|
621
621
|
/* @__PURE__ */ n("th", { className: "pvx-th", children: "Record Holder" }),
|
|
622
622
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Car" }),
|
|
623
|
-
/* @__PURE__ */ n(
|
|
624
|
-
/* @__PURE__ */ n(
|
|
625
|
-
/* @__PURE__ */ n(
|
|
626
|
-
/* @__PURE__ */ n(
|
|
623
|
+
/* @__PURE__ */ n(R, { label: "Lap Time", sortKey: "record.lapTimeMs", config: d, onSort: p }),
|
|
624
|
+
/* @__PURE__ */ n(R, { label: "Drivers", sortKey: "driverCount", config: d, onSort: p, className: "pvx-hidden-below-md" }),
|
|
625
|
+
/* @__PURE__ */ n(R, { label: "Cars", sortKey: "carCount", config: d, onSort: p, className: "pvx-hidden-below-lg" }),
|
|
626
|
+
/* @__PURE__ */ n(R, { label: "Date", sortKey: "record.timestamp", config: d, onSort: p, className: "pvx-hidden-below-xl" })
|
|
627
627
|
] }) }),
|
|
628
|
-
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children:
|
|
629
|
-
var
|
|
628
|
+
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: b.map((g) => {
|
|
629
|
+
var m, N, v;
|
|
630
630
|
return /* @__PURE__ */ l(
|
|
631
631
|
"tr",
|
|
632
632
|
{
|
|
633
633
|
className: "pvx-row pvx-row--clickable",
|
|
634
|
-
onClick: () => a(
|
|
634
|
+
onClick: () => a(g.id, g.layout),
|
|
635
635
|
children: [
|
|
636
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children:
|
|
637
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", children: (
|
|
638
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-lg", children: ((N =
|
|
639
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children:
|
|
640
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children:
|
|
641
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children:
|
|
642
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: (v =
|
|
636
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: g.displayName }),
|
|
637
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: (m = g.record) != null && m.visibleId ? /* @__PURE__ */ n(Q, { userId: g.record.visibleId, getUserDisplay: s }) : "-" }),
|
|
638
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-lg", children: ((N = g.record) == null ? void 0 : N.carDisplayName) || "-" }),
|
|
639
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: g.record ? A(g.record.lapTimeMs) : "-" }),
|
|
640
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: g.driverCount || "-" }),
|
|
641
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: g.carCount || "-" }),
|
|
642
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: (v = g.record) != null && v.timestamp ? _(g.record.timestamp) : "-" })
|
|
643
643
|
]
|
|
644
644
|
},
|
|
645
|
-
`${
|
|
645
|
+
`${g.id}|${g.layout || ""}`
|
|
646
646
|
);
|
|
647
647
|
}) })
|
|
648
648
|
] }) })
|
|
649
649
|
] }) : /* @__PURE__ */ n(V, { message: "No lap times recorded yet." });
|
|
650
650
|
}
|
|
651
|
-
function
|
|
652
|
-
const [c, u] = O({ key: "lapTimeMs", dir: "asc" }), { activeTags:
|
|
653
|
-
var k,
|
|
651
|
+
function ht({ entries: e, isLoading: t, track: r, carMetadata: s, getUserDisplay: a, onCarSelect: i, onNavigate: o, tags: d, onTagChange: p }) {
|
|
652
|
+
const [c, u] = O({ key: "lapTimeMs", dir: "asc" }), { activeTags: x, toggle: f, clear: h } = Le(d, p), b = S(() => {
|
|
653
|
+
var k, y, L;
|
|
654
654
|
if (!e || !((k = s == null ? void 0 : s.tags) != null && k.length)) return [];
|
|
655
655
|
const v = /* @__PURE__ */ new Set();
|
|
656
|
-
for (const
|
|
657
|
-
(((L = (
|
|
658
|
-
return s.tags.filter((
|
|
659
|
-
}, [e, s]),
|
|
660
|
-
var
|
|
661
|
-
const k = ((L = (
|
|
662
|
-
return
|
|
663
|
-
}) : [], [e,
|
|
656
|
+
for (const D of e)
|
|
657
|
+
(((L = (y = s.cars) == null ? void 0 : y[D.carId]) == null ? void 0 : L.tags) || []).forEach((U) => v.add(U));
|
|
658
|
+
return s.tags.filter((D) => v.has(D));
|
|
659
|
+
}, [e, s]), g = S(() => e ? x.size === 0 ? e : e.filter((v) => {
|
|
660
|
+
var y, L;
|
|
661
|
+
const k = ((L = (y = s == null ? void 0 : s.cars) == null ? void 0 : y[v.carId]) == null ? void 0 : L.tags) || [];
|
|
662
|
+
return Ce(k, x, s == null ? void 0 : s.categories);
|
|
663
|
+
}) : [], [e, x, s]), m = S(() => z(g, c, (v, k) => {
|
|
664
664
|
switch (k) {
|
|
665
665
|
case "carId":
|
|
666
|
-
return
|
|
666
|
+
return B(v.carId);
|
|
667
667
|
case "driverCount":
|
|
668
668
|
return v.driverCount || 0;
|
|
669
669
|
case "lapTimeMs":
|
|
670
670
|
default:
|
|
671
671
|
return v.lapTimeMs;
|
|
672
672
|
}
|
|
673
|
-
}), [
|
|
673
|
+
}), [g, c]), N = [
|
|
674
674
|
{ key: "tracks", label: "Tracks", onClick: () => o("tracks") },
|
|
675
|
-
{ key: "track", label:
|
|
675
|
+
{ key: "track", label: r.displayName }
|
|
676
676
|
];
|
|
677
|
-
return
|
|
678
|
-
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(
|
|
677
|
+
return t ? /* @__PURE__ */ n(K, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
|
|
678
|
+
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(ie, { segments: N }) }),
|
|
679
679
|
/* @__PURE__ */ n(
|
|
680
|
-
|
|
680
|
+
Te,
|
|
681
681
|
{
|
|
682
|
-
availableTags:
|
|
683
|
-
activeTags:
|
|
682
|
+
availableTags: b,
|
|
683
|
+
activeTags: x,
|
|
684
684
|
onToggle: f,
|
|
685
|
-
onClear:
|
|
685
|
+
onClear: h,
|
|
686
686
|
categories: s == null ? void 0 : s.categories,
|
|
687
687
|
tagLabels: s == null ? void 0 : s.tagLabels
|
|
688
688
|
}
|
|
@@ -690,22 +690,22 @@ function dt({ entries: e, isLoading: r, track: t, carMetadata: s, getUserDisplay
|
|
|
690
690
|
e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
|
|
691
691
|
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
|
|
692
692
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
|
|
693
|
-
/* @__PURE__ */ n(
|
|
693
|
+
/* @__PURE__ */ n(R, { label: "Car", sortKey: "carId", config: c, onSort: u }),
|
|
694
694
|
/* @__PURE__ */ n("th", { className: "pvx-th", children: "Record Holder" }),
|
|
695
|
-
/* @__PURE__ */ n(
|
|
696
|
-
/* @__PURE__ */ n(
|
|
695
|
+
/* @__PURE__ */ n(R, { label: "Lap Time", sortKey: "lapTimeMs", config: c, onSort: u }),
|
|
696
|
+
/* @__PURE__ */ n(R, { label: "Drivers", sortKey: "driverCount", config: c, onSort: u, className: "pvx-hidden-below-md" }),
|
|
697
697
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Date" })
|
|
698
698
|
] }) }),
|
|
699
|
-
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children:
|
|
699
|
+
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: m.map((v, k) => /* @__PURE__ */ l(
|
|
700
700
|
"tr",
|
|
701
701
|
{
|
|
702
702
|
className: "pvx-row pvx-row--clickable",
|
|
703
703
|
onClick: () => i(v.carId),
|
|
704
704
|
children: [
|
|
705
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(
|
|
706
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children:
|
|
705
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(ae, { rank: k + 1, podium: !0 }) }),
|
|
706
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: B(v.carId) }),
|
|
707
707
|
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(Q, { userId: v.steamId || v.userId, getUserDisplay: a }) }),
|
|
708
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children:
|
|
708
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: A(v.lapTimeMs) }),
|
|
709
709
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: v.driverCount || "-" }),
|
|
710
710
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-lg", children: v.recordedAt ? _(v.recordedAt) : "-" })
|
|
711
711
|
]
|
|
@@ -715,78 +715,78 @@ function dt({ entries: e, isLoading: r, track: t, carMetadata: s, getUserDisplay
|
|
|
715
715
|
] }) }) : /* @__PURE__ */ n(V, { message: "No lap times for this track yet." })
|
|
716
716
|
] });
|
|
717
717
|
}
|
|
718
|
-
function
|
|
719
|
-
const [p, c] = O({ key: "lapTimeMs", dir: "asc" }), u = S(() =>
|
|
720
|
-
switch (
|
|
718
|
+
function vt({ entries: e, isLoading: t, track: r, carId: s, getUserDisplay: a, onDriverSelect: i, onNavigate: o, highlightId: d }) {
|
|
719
|
+
const [p, c] = O({ key: "lapTimeMs", dir: "asc" }), u = S(() => Se(e), [e]), x = S(() => z(e || [], p, (h, b) => {
|
|
720
|
+
switch (b) {
|
|
721
721
|
case "userId":
|
|
722
|
-
return a(
|
|
722
|
+
return a(h.steamId || h.userId).displayName;
|
|
723
723
|
case "lapCount":
|
|
724
|
-
return
|
|
724
|
+
return h.lapCount || 0;
|
|
725
725
|
case "lapTimeMs":
|
|
726
726
|
default:
|
|
727
|
-
return
|
|
727
|
+
return h.lapTimeMs;
|
|
728
728
|
}
|
|
729
729
|
}), [e, p, a]), f = [
|
|
730
730
|
{ key: "tracks", label: "Tracks", onClick: () => o("tracks") },
|
|
731
|
-
{ key: "track", label:
|
|
732
|
-
{ key: "car", label:
|
|
731
|
+
{ key: "track", label: r.displayName, onClick: () => o("track") },
|
|
732
|
+
{ key: "car", label: B(s) }
|
|
733
733
|
];
|
|
734
|
-
return
|
|
735
|
-
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(
|
|
734
|
+
return t ? /* @__PURE__ */ n(K, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
|
|
735
|
+
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(ie, { segments: f }) }),
|
|
736
736
|
e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
|
|
737
737
|
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
|
|
738
738
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
|
|
739
|
-
/* @__PURE__ */ n(
|
|
740
|
-
/* @__PURE__ */ n(
|
|
739
|
+
/* @__PURE__ */ n(R, { label: "Driver", sortKey: "userId", config: p, onSort: c }),
|
|
740
|
+
/* @__PURE__ */ n(R, { label: "Lap Time", sortKey: "lapTimeMs", config: p, onSort: c }),
|
|
741
741
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
|
|
742
742
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
|
|
743
743
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" }),
|
|
744
744
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Tyre" }),
|
|
745
745
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Fuel" }),
|
|
746
|
-
/* @__PURE__ */ n(
|
|
746
|
+
/* @__PURE__ */ n(R, { label: "Laps", sortKey: "lapCount", config: p, onSort: c, className: "pvx-hidden-below-lg" }),
|
|
747
747
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
|
|
748
748
|
] }) }),
|
|
749
|
-
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children:
|
|
750
|
-
const
|
|
749
|
+
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: x.map((h, b) => {
|
|
750
|
+
const g = b + 1, m = h.steamId || h.userId, N = u && h.sector1Ms === u.s1, v = u && h.sector2Ms === u.s2, k = u && h.sector3Ms === u.s3;
|
|
751
751
|
return /* @__PURE__ */ l(
|
|
752
752
|
"tr",
|
|
753
753
|
{
|
|
754
|
-
className: `pvx-row pvx-row--clickable ${d &&
|
|
755
|
-
onClick: () => i(
|
|
754
|
+
className: `pvx-row pvx-row--clickable ${d && m === d ? "pvx-row--highlight" : g <= 3 ? "pvx-row--podium" : ""}`,
|
|
755
|
+
onClick: () => i(m),
|
|
756
756
|
children: [
|
|
757
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(
|
|
758
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(Q, { userId:
|
|
759
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children:
|
|
760
|
-
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${N ? "pvx-td--best-sector" : ""}`, children:
|
|
761
|
-
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${v ? "pvx-td--best-sector" : ""}`, children:
|
|
762
|
-
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${k ? "pvx-td--best-sector" : ""}`, children:
|
|
763
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title:
|
|
764
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-xl", children:
|
|
765
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children:
|
|
766
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children:
|
|
757
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(ae, { rank: g, podium: !0 }) }),
|
|
758
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(Q, { userId: m, getUserDisplay: a }) }),
|
|
759
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: A(h.lapTimeMs) }),
|
|
760
|
+
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${N ? "pvx-td--best-sector" : ""}`, children: P(h.sector1Ms) }),
|
|
761
|
+
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${v ? "pvx-td--best-sector" : ""}`, children: P(h.sector2Ms) }),
|
|
762
|
+
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${k ? "pvx-td--best-sector" : ""}`, children: P(h.sector3Ms) }),
|
|
763
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: xe(h.tyreCompound), children: h.tyreCompound || "-" }),
|
|
764
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-xl", children: ge(h.startingFuelL) }),
|
|
765
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: h.lapCount || "-" }),
|
|
766
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: h.recordedAt ? _(h.recordedAt) : "-" })
|
|
767
767
|
]
|
|
768
768
|
},
|
|
769
|
-
|
|
769
|
+
m
|
|
770
770
|
);
|
|
771
771
|
}) })
|
|
772
772
|
] }) }) : /* @__PURE__ */ n(V, { message: "No lap times for this car yet." })
|
|
773
773
|
] });
|
|
774
774
|
}
|
|
775
|
-
function
|
|
776
|
-
const { data: c, driverName: u, theoreticalBest:
|
|
775
|
+
function mt({ userId: e, track: t, carId: r, game: s, gameVersion: a, showInvalid: i, getUserDisplay: o, onToggleInvalid: d, onNavigate: p }) {
|
|
776
|
+
const { data: c, driverName: u, theoreticalBest: x, isLoading: f } = Ge(e, t.id, t.layout, r, { showInvalid: i, game: s, gameVersion: a }), { displayName: h, avatarUrl: b } = o(e, u), g = S(() => Se(c, !0), [c]), m = S(() => {
|
|
777
777
|
const v = (c == null ? void 0 : c.filter((k) => k.isValid)) || [];
|
|
778
778
|
return v.length ? Math.min(...v.map((k) => k.lapTimeMs)) : null;
|
|
779
779
|
}, [c]), N = [
|
|
780
780
|
{ key: "tracks", label: "Tracks", onClick: () => p("tracks") },
|
|
781
|
-
{ key: "track", label:
|
|
782
|
-
{ key: "car", label:
|
|
783
|
-
{ key: "driver", label:
|
|
781
|
+
{ key: "track", label: t.displayName, onClick: () => p("track") },
|
|
782
|
+
{ key: "car", label: B(r), onClick: () => p("car") },
|
|
783
|
+
{ key: "driver", label: h }
|
|
784
784
|
];
|
|
785
785
|
return f ? /* @__PURE__ */ n(K, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
|
|
786
786
|
/* @__PURE__ */ l("div", { className: "pvx-card-header pvx-card-header--split", children: [
|
|
787
787
|
/* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
|
|
788
|
-
/* @__PURE__ */ n(
|
|
789
|
-
|
|
788
|
+
/* @__PURE__ */ n(ie, { segments: N }),
|
|
789
|
+
b ? /* @__PURE__ */ n("img", { src: b, alt: "", className: "pvx-driver-avatar pvx-driver-avatar--lg" }) : /* @__PURE__ */ n("span", { className: "pvx-driver-avatar pvx-driver-avatar--lg pvx-driver-avatar--placeholder" })
|
|
790
790
|
] }),
|
|
791
791
|
/* @__PURE__ */ l("label", { className: "pvx-checkbox-label", children: [
|
|
792
792
|
/* @__PURE__ */ n(
|
|
@@ -801,16 +801,16 @@ function ut({ userId: e, track: r, carId: t, game: s, gameVersion: a, showInvali
|
|
|
801
801
|
/* @__PURE__ */ n("span", { children: "Show invalid laps" })
|
|
802
802
|
] })
|
|
803
803
|
] }),
|
|
804
|
-
|
|
804
|
+
x && /* @__PURE__ */ l("div", { className: "pvx-theoretical-best", children: [
|
|
805
805
|
/* @__PURE__ */ n("span", { className: "pvx-theoretical-best-label", children: "Theoretical Best:" }),
|
|
806
|
-
/* @__PURE__ */ n("span", { className: "pvx-theoretical-best-time", children:
|
|
806
|
+
/* @__PURE__ */ n("span", { className: "pvx-theoretical-best-time", children: A(x.lapTimeMs) }),
|
|
807
807
|
/* @__PURE__ */ l("span", { className: "pvx-theoretical-best-sectors", children: [
|
|
808
808
|
"(",
|
|
809
|
-
|
|
809
|
+
P(x.sector1Ms),
|
|
810
810
|
" + ",
|
|
811
|
-
|
|
811
|
+
P(x.sector2Ms),
|
|
812
812
|
" + ",
|
|
813
|
-
|
|
813
|
+
P(x.sector3Ms),
|
|
814
814
|
")"
|
|
815
815
|
] })
|
|
816
816
|
] }),
|
|
@@ -828,27 +828,27 @@ function ut({ userId: e, track: r, carId: t, game: s, gameVersion: a, showInvali
|
|
|
828
828
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
|
|
829
829
|
] }) }),
|
|
830
830
|
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: c.map((v, k) => {
|
|
831
|
-
const
|
|
832
|
-
let
|
|
833
|
-
return v.isValid || (
|
|
834
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n("span", { className: `pvx-rank ${
|
|
831
|
+
const y = v.isValid && v.lapTimeMs === m, L = g && v.isValid && v.sector1Ms === g.s1, D = g && v.isValid && v.sector2Ms === g.s2, w = g && v.isValid && v.sector3Ms === g.s3;
|
|
832
|
+
let U = "pvx-row";
|
|
833
|
+
return v.isValid || (U += " pvx-row--invalid"), y && (U += " pvx-row--personal-best"), /* @__PURE__ */ l("tr", { className: U, children: [
|
|
834
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n("span", { className: `pvx-rank ${y ? "pvx-rank--gold" : ""}`, children: k + 1 }) }),
|
|
835
835
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-md", children: v.lapNumber || "-" }),
|
|
836
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children:
|
|
837
|
-
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${L ? "pvx-td--best-sector" : ""}`, children:
|
|
838
|
-
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${
|
|
839
|
-
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${w ? "pvx-td--best-sector" : ""}`, children:
|
|
840
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", title: v.isValid ? void 0 : v.invalidReason || "Invalid", children: v.isValid ? /* @__PURE__ */ n(
|
|
841
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title:
|
|
842
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children:
|
|
836
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: A(v.lapTimeMs) }),
|
|
837
|
+
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${L ? "pvx-td--best-sector" : ""}`, children: P(v.sector1Ms) }),
|
|
838
|
+
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${D ? "pvx-td--best-sector" : ""}`, children: P(v.sector2Ms) }),
|
|
839
|
+
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${w ? "pvx-td--best-sector" : ""}`, children: P(v.sector3Ms) }),
|
|
840
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", title: v.isValid ? void 0 : v.invalidReason || "Invalid", children: v.isValid ? /* @__PURE__ */ n(tn, {}) : /* @__PURE__ */ n(rn, {}) }),
|
|
841
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: xe(v.tyreCompound), children: v.tyreCompound || "-" }),
|
|
842
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: ge(v.startingFuelL) }),
|
|
843
843
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: _(v.timestamp) })
|
|
844
844
|
] }, v.id);
|
|
845
845
|
}) })
|
|
846
846
|
] }) }) : /* @__PURE__ */ n(V, { message: i ? "No laps recorded for this combination." : 'No valid laps. Try enabling "Show invalid laps".' })
|
|
847
847
|
] });
|
|
848
848
|
}
|
|
849
|
-
function
|
|
850
|
-
const [o, d] = O({ key: "rank", dir: "asc" }), [p, c] =
|
|
851
|
-
switch (
|
|
849
|
+
function xt({ drivers: e, isLoading: t, getUserDisplay: r, game: s, gameVersion: a, onComboSelect: i }) {
|
|
850
|
+
const [o, d] = O({ key: "rank", dir: "asc" }), [p, c] = M(null), u = S(() => e ? z(e, o, (f, h) => {
|
|
851
|
+
switch (h) {
|
|
852
852
|
case "rating":
|
|
853
853
|
return f.rating;
|
|
854
854
|
case "comboCount":
|
|
@@ -860,10 +860,10 @@ function mt({ drivers: e, isLoading: r, getUserDisplay: t, game: s, gameVersion:
|
|
|
860
860
|
return f.rank;
|
|
861
861
|
}
|
|
862
862
|
}) : [], [e, o]);
|
|
863
|
-
if (
|
|
863
|
+
if (t) return /* @__PURE__ */ n(K, {});
|
|
864
864
|
if (!(e != null && e.length))
|
|
865
865
|
return /* @__PURE__ */ n("div", { className: "pvx-card", children: /* @__PURE__ */ n(V, { message: "Not enough data for rankings yet." }) });
|
|
866
|
-
const
|
|
866
|
+
const x = 5;
|
|
867
867
|
return /* @__PURE__ */ l("div", { className: "pvx-card", children: [
|
|
868
868
|
/* @__PURE__ */ l("div", { className: "pvx-card-header pvx-rankings-header", children: [
|
|
869
869
|
/* @__PURE__ */ n("h2", { className: "pvx-card-title", children: "Driver Rankings" }),
|
|
@@ -882,22 +882,22 @@ function mt({ drivers: e, isLoading: r, getUserDisplay: t, game: s, gameVersion:
|
|
|
882
882
|
] }),
|
|
883
883
|
/* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
|
|
884
884
|
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
|
|
885
|
-
/* @__PURE__ */ n(
|
|
885
|
+
/* @__PURE__ */ n(R, { label: "#", sortKey: "rank", config: o, onSort: d, className: "pvx-th--narrow" }),
|
|
886
886
|
/* @__PURE__ */ n("th", { className: "pvx-th", children: "Driver" }),
|
|
887
|
-
/* @__PURE__ */ n(
|
|
888
|
-
/* @__PURE__ */ n(
|
|
889
|
-
/* @__PURE__ */ n(
|
|
887
|
+
/* @__PURE__ */ n(R, { label: "Rating", sortKey: "rating", config: o, onSort: d }),
|
|
888
|
+
/* @__PURE__ */ n(R, { label: "Cars", sortKey: "distinctCars", config: o, onSort: d, className: "pvx-hidden-below-sm" }),
|
|
889
|
+
/* @__PURE__ */ n(R, { label: "Combos", sortKey: "comboCount", config: o, onSort: d, className: "pvx-hidden-below-sm" })
|
|
890
890
|
] }) }),
|
|
891
891
|
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: u.map((f) => {
|
|
892
|
-
const
|
|
892
|
+
const h = p === f.identifier;
|
|
893
893
|
return /* @__PURE__ */ n(
|
|
894
|
-
|
|
894
|
+
sn,
|
|
895
895
|
{
|
|
896
896
|
driver: f,
|
|
897
|
-
getUserDisplay:
|
|
898
|
-
isExpanded:
|
|
899
|
-
onToggle: () => c(
|
|
900
|
-
colCount:
|
|
897
|
+
getUserDisplay: r,
|
|
898
|
+
isExpanded: h,
|
|
899
|
+
onToggle: () => c(h ? null : f.identifier),
|
|
900
|
+
colCount: x,
|
|
901
901
|
game: s,
|
|
902
902
|
gameVersion: a,
|
|
903
903
|
onComboSelect: i
|
|
@@ -908,7 +908,7 @@ function mt({ drivers: e, isLoading: r, getUserDisplay: t, game: s, gameVersion:
|
|
|
908
908
|
] }) })
|
|
909
909
|
] });
|
|
910
910
|
}
|
|
911
|
-
function
|
|
911
|
+
function sn({ driver: e, getUserDisplay: t, isExpanded: r, onToggle: s, colCount: a, game: i, gameVersion: o, onComboSelect: d }) {
|
|
912
912
|
const p = e.identifier;
|
|
913
913
|
return /* @__PURE__ */ l(F, { children: [
|
|
914
914
|
/* @__PURE__ */ l(
|
|
@@ -917,19 +917,19 @@ function nn({ driver: e, getUserDisplay: r, isExpanded: t, onToggle: s, colCount
|
|
|
917
917
|
className: `pvx-row pvx-row--clickable ${e.rank <= 3 ? "pvx-row--podium" : ""}`,
|
|
918
918
|
onClick: s,
|
|
919
919
|
children: [
|
|
920
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(
|
|
921
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(Q, { userId: p, getUserDisplay:
|
|
920
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(ae, { rank: e.rank, podium: !0 }) }),
|
|
921
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(Q, { userId: p, getUserDisplay: t }) }),
|
|
922
922
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: e.rating.toFixed(1) }),
|
|
923
923
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: e.distinctCars || "-" }),
|
|
924
924
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: /* @__PURE__ */ l("span", { className: "pvx-rankings-combo-count", children: [
|
|
925
925
|
e.comboCount,
|
|
926
|
-
/* @__PURE__ */ n("svg", { className: `pvx-rankings-chevron ${
|
|
926
|
+
/* @__PURE__ */ n("svg", { className: `pvx-rankings-chevron ${r ? "pvx-rankings-chevron--open" : ""}`, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ n("path", { d: "m6 9 6 6 6-6" }) })
|
|
927
927
|
] }) })
|
|
928
928
|
]
|
|
929
929
|
}
|
|
930
930
|
),
|
|
931
|
-
|
|
932
|
-
const
|
|
931
|
+
r && e.combos && /* @__PURE__ */ n("tr", { children: /* @__PURE__ */ n("td", { colSpan: a, className: "pvx-rankings-combos-cell", children: /* @__PURE__ */ n("div", { className: "pvx-rankings-combos", children: e.combos.map((c, u) => {
|
|
932
|
+
const x = c.layout ? `${c.trackId}|${c.layout}` : c.trackId, f = d ? () => d({ track: x, car: c.carId, highlight: p, game: i, gameVersion: o }) : void 0;
|
|
933
933
|
return /* @__PURE__ */ l(
|
|
934
934
|
"div",
|
|
935
935
|
{
|
|
@@ -938,11 +938,11 @@ function nn({ driver: e, getUserDisplay: r, isExpanded: t, onToggle: s, colCount
|
|
|
938
938
|
role: f ? "button" : void 0,
|
|
939
939
|
children: [
|
|
940
940
|
/* @__PURE__ */ l("div", { className: "pvx-rankings-combo-info", children: [
|
|
941
|
-
/* @__PURE__ */ n("p", { className: "pvx-rankings-combo-track", children:
|
|
942
|
-
/* @__PURE__ */ n("p", { className: "pvx-rankings-combo-car", children:
|
|
941
|
+
/* @__PURE__ */ n("p", { className: "pvx-rankings-combo-track", children: E(c.trackId, c.layout, i) }),
|
|
942
|
+
/* @__PURE__ */ n("p", { className: "pvx-rankings-combo-car", children: B(c.carId) })
|
|
943
943
|
] }),
|
|
944
944
|
/* @__PURE__ */ l("div", { className: "pvx-rankings-combo-stats", children: [
|
|
945
|
-
/* @__PURE__ */ n("p", { className: "pvx-rankings-combo-time", children:
|
|
945
|
+
/* @__PURE__ */ n("p", { className: "pvx-rankings-combo-time", children: A(c.lapTimeMs) }),
|
|
946
946
|
/* @__PURE__ */ l("p", { className: `pvx-rankings-combo-pct ${c.percentile >= 75 ? "pvx-rankings-combo-pct--high" : c.percentile >= 50 ? "pvx-rankings-combo-pct--mid" : c.percentile >= 25 ? "pvx-rankings-combo-pct--low" : "pvx-rankings-combo-pct--bottom"}`, children: [
|
|
947
947
|
c.percentile.toFixed(0),
|
|
948
948
|
"%",
|
|
@@ -962,7 +962,7 @@ function nn({ driver: e, getUserDisplay: r, isExpanded: t, onToggle: s, colCount
|
|
|
962
962
|
}) }) }) })
|
|
963
963
|
] });
|
|
964
964
|
}
|
|
965
|
-
const
|
|
965
|
+
const an = {
|
|
966
966
|
GBR: "🇬🇧",
|
|
967
967
|
DEU: "🇩🇪",
|
|
968
968
|
NLD: "🇳🇱",
|
|
@@ -993,142 +993,142 @@ const tn = {
|
|
|
993
993
|
RUS: "🇷🇺",
|
|
994
994
|
TUR: "🇹🇷",
|
|
995
995
|
KOR: "🇰🇷"
|
|
996
|
-
},
|
|
996
|
+
}, oe = ["🥇", "🥈", "🥉"], on = {
|
|
997
997
|
championship: "Championship",
|
|
998
998
|
series: "Series",
|
|
999
999
|
event: "Event",
|
|
1000
1000
|
hotlap: "Hotlap"
|
|
1001
|
-
},
|
|
1002
|
-
function
|
|
1003
|
-
const
|
|
1004
|
-
if (
|
|
1005
|
-
const t = e.match(/^PRACTICE_(\d+)$/);
|
|
1006
|
-
return t ? 100 + parseInt(t[1]) : 999;
|
|
1007
|
-
}
|
|
1008
|
-
function ie(e) {
|
|
1001
|
+
}, ln = ["PRACTICE", "QUALIFYING", "RACE"];
|
|
1002
|
+
function ue(e) {
|
|
1003
|
+
const t = ln.indexOf(e);
|
|
1004
|
+
if (t >= 0) return t;
|
|
1009
1005
|
const r = e.match(/^PRACTICE_(\d+)$/);
|
|
1010
|
-
return r ?
|
|
1006
|
+
return r ? 100 + parseInt(r[1]) : 999;
|
|
1011
1007
|
}
|
|
1012
|
-
function
|
|
1008
|
+
function le(e) {
|
|
1009
|
+
const t = e.match(/^PRACTICE_(\d+)$/);
|
|
1010
|
+
return t ? `P${t[1]}` : e;
|
|
1011
|
+
}
|
|
1012
|
+
function ce({ position: e }) {
|
|
1013
1013
|
return /* @__PURE__ */ n("span", { className: e === 1 ? "pvx-rank pvx-rank--gold" : e === 2 ? "pvx-rank pvx-rank--silver" : e === 3 ? "pvx-rank pvx-rank--bronze" : "pvx-rank", children: e });
|
|
1014
1014
|
}
|
|
1015
1015
|
function G({ nation: e }) {
|
|
1016
|
-
const
|
|
1017
|
-
return
|
|
1016
|
+
const t = e && an[e];
|
|
1017
|
+
return t ? /* @__PURE__ */ n("span", { className: "pvx-nation-flag", title: e, children: t }) : null;
|
|
1018
1018
|
}
|
|
1019
|
-
function
|
|
1019
|
+
function cn({ sessions: e, activeSession: t, onSelect: r }) {
|
|
1020
1020
|
if (!e || e.length <= 1) return null;
|
|
1021
1021
|
const s = [...e].sort(
|
|
1022
|
-
(a, i) =>
|
|
1022
|
+
(a, i) => ue(a.type) - ue(i.type)
|
|
1023
1023
|
);
|
|
1024
1024
|
return /* @__PURE__ */ n("div", { className: "pvx-session-tabs", children: s.map((a) => /* @__PURE__ */ n(
|
|
1025
1025
|
"button",
|
|
1026
1026
|
{
|
|
1027
|
-
onClick: () =>
|
|
1028
|
-
className: `pvx-session-tab ${
|
|
1029
|
-
children:
|
|
1027
|
+
onClick: () => r(a.type),
|
|
1028
|
+
className: `pvx-session-tab ${t === a.type ? "pvx-session-tab--active" : ""}`,
|
|
1029
|
+
children: le(a.type)
|
|
1030
1030
|
},
|
|
1031
1031
|
a.type
|
|
1032
1032
|
)) });
|
|
1033
1033
|
}
|
|
1034
|
-
function
|
|
1035
|
-
return /* @__PURE__ */ n("span", { className: `pvx-comp-badge pvx-comp-badge--${e}`, children:
|
|
1034
|
+
function dn({ type: e }) {
|
|
1035
|
+
return /* @__PURE__ */ n("span", { className: `pvx-comp-badge pvx-comp-badge--${e}`, children: on[e] || e });
|
|
1036
1036
|
}
|
|
1037
|
-
function J({ children: e, variant:
|
|
1038
|
-
return /* @__PURE__ */ n("span", { className: `pvx-info-pill ${
|
|
1037
|
+
function J({ children: e, variant: t = "default" }) {
|
|
1038
|
+
return /* @__PURE__ */ n("span", { className: `pvx-info-pill ${t !== "default" ? `pvx-info-pill--${t}` : ""}`, children: e });
|
|
1039
1039
|
}
|
|
1040
|
-
function
|
|
1040
|
+
function pn(e) {
|
|
1041
1041
|
if (!e) return "TBD";
|
|
1042
|
-
const
|
|
1043
|
-
if (isNaN(
|
|
1044
|
-
const
|
|
1045
|
-
return `${
|
|
1042
|
+
const t = new Date(e);
|
|
1043
|
+
if (isNaN(t)) return "TBD";
|
|
1044
|
+
const r = t.toLocaleDateString("en-GB", { weekday: "short", day: "numeric", month: "short" }), s = t.toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit" });
|
|
1045
|
+
return `${r} • ${s}`;
|
|
1046
1046
|
}
|
|
1047
|
-
function
|
|
1048
|
-
return e.reduce((
|
|
1047
|
+
function un(e) {
|
|
1048
|
+
return e.reduce((t, r) => {
|
|
1049
1049
|
var s;
|
|
1050
|
-
return (s =
|
|
1051
|
-
const o =
|
|
1050
|
+
return (s = r.splits) != null && s.length ? t ? t.map((a, i) => {
|
|
1051
|
+
const o = r.splits[i];
|
|
1052
1052
|
return o && o < a ? o : a;
|
|
1053
|
-
}) : [...
|
|
1053
|
+
}) : [...r.splits] : t;
|
|
1054
1054
|
}, null);
|
|
1055
1055
|
}
|
|
1056
|
-
function
|
|
1056
|
+
function q({ message: e = "Loading..." }) {
|
|
1057
1057
|
return /* @__PURE__ */ n("div", { className: "pvx-loading", children: e });
|
|
1058
1058
|
}
|
|
1059
|
-
function
|
|
1059
|
+
function I({ message: e = "No data available." }) {
|
|
1060
1060
|
return /* @__PURE__ */ n("div", { className: "pvx-empty", children: /* @__PURE__ */ n("p", { children: e }) });
|
|
1061
1061
|
}
|
|
1062
|
-
const
|
|
1063
|
-
function
|
|
1064
|
-
const
|
|
1065
|
-
return
|
|
1062
|
+
const $e = 3;
|
|
1063
|
+
function hn(e) {
|
|
1064
|
+
const t = e == null ? void 0 : e.rounds;
|
|
1065
|
+
return t != null && t.length ? e.type === "hotlap" ? t.every((r) => r.isFinalized && r.dediStatus === "completed") : t.every((r) => r.isFinalized) : !1;
|
|
1066
1066
|
}
|
|
1067
|
-
function
|
|
1068
|
-
const
|
|
1069
|
-
if (!(
|
|
1070
|
-
let
|
|
1071
|
-
for (const s of
|
|
1067
|
+
function vn(e) {
|
|
1068
|
+
const t = e == null ? void 0 : e.rounds;
|
|
1069
|
+
if (!(t != null && t.length)) return null;
|
|
1070
|
+
let r = null;
|
|
1071
|
+
for (const s of t) {
|
|
1072
1072
|
if (!s.startTime) continue;
|
|
1073
1073
|
const a = new Date(s.startTime);
|
|
1074
|
-
isNaN(a) || (!
|
|
1074
|
+
isNaN(a) || (!r || a > r) && (r = a);
|
|
1075
1075
|
}
|
|
1076
|
-
return
|
|
1076
|
+
return r;
|
|
1077
1077
|
}
|
|
1078
|
-
function
|
|
1079
|
-
if (!
|
|
1080
|
-
const
|
|
1081
|
-
if (!
|
|
1082
|
-
const s =
|
|
1083
|
-
return Date.now() -
|
|
1078
|
+
function Re(e, t = $e) {
|
|
1079
|
+
if (!hn(e)) return "active";
|
|
1080
|
+
const r = vn(e);
|
|
1081
|
+
if (!r) return "recently-completed";
|
|
1082
|
+
const s = t * 24 * 60 * 60 * 1e3;
|
|
1083
|
+
return Date.now() - r.getTime() <= s ? "recently-completed" : "archived";
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function gt(e, t, r = $e) {
|
|
1086
1086
|
if (!(e != null && e.length)) return [];
|
|
1087
|
-
const s = new Set(Array.isArray(
|
|
1088
|
-
return e.filter((a) => s.has(
|
|
1087
|
+
const s = new Set(Array.isArray(t) ? t : [t]);
|
|
1088
|
+
return e.filter((a) => s.has(Re(a, r)));
|
|
1089
1089
|
}
|
|
1090
|
-
function
|
|
1091
|
-
const
|
|
1092
|
-
return Array.isArray(
|
|
1090
|
+
function mn(e, t = 3) {
|
|
1091
|
+
const r = e == null ? void 0 : e.standings;
|
|
1092
|
+
return Array.isArray(r) ? [...r].sort((s, a) => (s.position ?? 999) - (a.position ?? 999)).slice(0, t) : [];
|
|
1093
1093
|
}
|
|
1094
|
-
function
|
|
1095
|
-
const { data: a } =
|
|
1094
|
+
function xn({ competitionId: e, topN: t = 3, label: r = "Completed", className: s }) {
|
|
1095
|
+
const { data: a } = be(e), i = mn(a, t);
|
|
1096
1096
|
return /* @__PURE__ */ l("div", { className: `pvx-comp-completed-badge ${s || ""}`, children: [
|
|
1097
|
-
/* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-label", children:
|
|
1097
|
+
/* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-label", children: r }),
|
|
1098
1098
|
i.length > 0 && /* @__PURE__ */ n("ol", { className: "pvx-comp-completed-badge-podium", children: i.map((o, d) => /* @__PURE__ */ l("li", { className: "pvx-comp-completed-badge-driver", children: [
|
|
1099
|
-
/* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-medal", "aria-hidden": "true", children:
|
|
1099
|
+
/* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-medal", "aria-hidden": "true", children: oe[d] || "" }),
|
|
1100
1100
|
/* @__PURE__ */ n(G, { nation: o.nation }),
|
|
1101
1101
|
/* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-name", children: o.driverName })
|
|
1102
1102
|
] }, o.driverId || d)) })
|
|
1103
1103
|
] });
|
|
1104
1104
|
}
|
|
1105
|
-
function
|
|
1106
|
-
return
|
|
1105
|
+
function ft({ competitions: e, isLoading: t, onSelect: r, onRegister: s, className: a }) {
|
|
1106
|
+
return t ? /* @__PURE__ */ n(q, { message: "Loading competitions..." }) : e != null && e.length ? /* @__PURE__ */ n("div", { className: `pvx-comp-grid ${a || ""}`, children: e.map((i) => /* @__PURE__ */ n(gn, { comp: i, onSelect: r, onRegister: s || r }, i.id)) }) : /* @__PURE__ */ n(I, { message: "No competitions available." });
|
|
1107
1107
|
}
|
|
1108
|
-
function
|
|
1109
|
-
var v, k,
|
|
1110
|
-
const { cdnUrl: s } = C(), a = e.posterCdnPath ? `${s}/${e.posterCdnPath}` : null, i = e.registration, o = (i == null ? void 0 : i.currentCount) || 0, d = i == null ? void 0 : i.maxParticipants, p = d && o >= d, c = (i == null ? void 0 : i.deadline) && new Date(i.deadline) < /* @__PURE__ */ new Date(), u = (i == null ? void 0 : i.isOpen) && !c && !p,
|
|
1108
|
+
function gn({ comp: e, onSelect: t, onRegister: r }) {
|
|
1109
|
+
var v, k, y;
|
|
1110
|
+
const { cdnUrl: s } = C(), a = e.posterCdnPath ? `${s}/${e.posterCdnPath}` : null, i = e.registration, o = (i == null ? void 0 : i.currentCount) || 0, d = i == null ? void 0 : i.maxParticipants, p = d && o >= d, c = (i == null ? void 0 : i.deadline) && new Date(i.deadline) < /* @__PURE__ */ new Date(), u = (i == null ? void 0 : i.isOpen) && !c && !p, x = /* @__PURE__ */ new Date(), f = (v = e.rounds) == null ? void 0 : v.find((L) => L.startTime && new Date(L.startTime) >= x), h = ((k = e.rounds) == null ? void 0 : k.length) || 0, b = ((y = e.rounds) == null ? void 0 : y.filter((L) => L.isFinalized).length) || 0, g = Re(e), m = g === "recently-completed" || g === "archived", N = e.type === "championship";
|
|
1111
1111
|
return /* @__PURE__ */ l(
|
|
1112
1112
|
"div",
|
|
1113
1113
|
{
|
|
1114
1114
|
className: "pvx-comp-card",
|
|
1115
|
-
onClick: () =>
|
|
1115
|
+
onClick: () => t(e.id),
|
|
1116
1116
|
role: "button",
|
|
1117
1117
|
tabIndex: 0,
|
|
1118
1118
|
onKeyDown: (L) => {
|
|
1119
|
-
(L.key === "Enter" || L.key === " ") && (L.preventDefault(),
|
|
1119
|
+
(L.key === "Enter" || L.key === " ") && (L.preventDefault(), t(e.id));
|
|
1120
1120
|
},
|
|
1121
1121
|
children: [
|
|
1122
|
-
/* @__PURE__ */ n("div", { className: "pvx-comp-card-poster", children: a ? /* @__PURE__ */ n("img", { src: a, alt: e.name, className: "pvx-comp-card-poster-img" }) : /* @__PURE__ */ n("div", { className: "pvx-comp-card-poster-placeholder", children: /* @__PURE__ */ n(
|
|
1122
|
+
/* @__PURE__ */ n("div", { className: "pvx-comp-card-poster", children: a ? /* @__PURE__ */ n("img", { src: a, alt: e.name, className: "pvx-comp-card-poster-img" }) : /* @__PURE__ */ n("div", { className: "pvx-comp-card-poster-placeholder", children: /* @__PURE__ */ n(Nn, {}) }) }),
|
|
1123
1123
|
/* @__PURE__ */ l("div", { className: "pvx-comp-card-body", children: [
|
|
1124
1124
|
/* @__PURE__ */ n("h3", { className: "pvx-comp-card-title", children: e.name }),
|
|
1125
1125
|
e.description && /* @__PURE__ */ n("p", { className: "pvx-comp-card-desc", children: e.description }),
|
|
1126
1126
|
/* @__PURE__ */ l("div", { className: "pvx-comp-card-pills", children: [
|
|
1127
|
-
/* @__PURE__ */ n(
|
|
1127
|
+
/* @__PURE__ */ n(dn, { type: e.type }),
|
|
1128
1128
|
e.game && /* @__PURE__ */ n(J, { children: e.game.toUpperCase() }),
|
|
1129
|
-
e.formatDescription && e.formatDescription.split(", ").map((L,
|
|
1129
|
+
e.formatDescription && e.formatDescription.split(", ").map((L, D) => /* @__PURE__ */ n(J, { variant: "format", children: L }, D))
|
|
1130
1130
|
] }),
|
|
1131
|
-
e.carsDescription && /* @__PURE__ */ n("div", { className: "pvx-comp-card-pills", children: e.carsDescription.split(", ").map((L,
|
|
1131
|
+
e.carsDescription && /* @__PURE__ */ n("div", { className: "pvx-comp-card-pills", children: e.carsDescription.split(", ").map((L, D) => /* @__PURE__ */ n(J, { children: L }, D)) }),
|
|
1132
1132
|
/* @__PURE__ */ l("div", { className: "pvx-comp-card-schedule", children: [
|
|
1133
1133
|
f ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
|
|
1134
1134
|
/* @__PURE__ */ n("span", { className: "pvx-comp-card-schedule-label", children: "Next:" }),
|
|
@@ -1136,22 +1136,22 @@ function vn({ comp: e, onSelect: r, onRegister: t }) {
|
|
|
1136
1136
|
e.type !== "hotlap" && `R${f.roundNumber} `,
|
|
1137
1137
|
f.track || "TBD",
|
|
1138
1138
|
" · ",
|
|
1139
|
-
|
|
1140
|
-
] }) :
|
|
1141
|
-
|
|
1139
|
+
pn(f.startTime)
|
|
1140
|
+
] }) : h > 0 ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
|
|
1141
|
+
b,
|
|
1142
1142
|
"/",
|
|
1143
|
-
|
|
1143
|
+
h,
|
|
1144
1144
|
" rounds completed"
|
|
1145
1145
|
] }) : null,
|
|
1146
|
-
|
|
1147
|
-
|
|
1146
|
+
h > 0 && /* @__PURE__ */ l("span", { className: "pvx-comp-card-round-count", children: [
|
|
1147
|
+
h,
|
|
1148
1148
|
" round",
|
|
1149
|
-
|
|
1149
|
+
h !== 1 ? "s" : ""
|
|
1150
1150
|
] })
|
|
1151
1151
|
] }),
|
|
1152
|
-
|
|
1153
|
-
i && !
|
|
1154
|
-
|
|
1152
|
+
m && N && /* @__PURE__ */ n(xn, { competitionId: e.id }),
|
|
1153
|
+
i && !m && /* @__PURE__ */ n(
|
|
1154
|
+
fn,
|
|
1155
1155
|
{
|
|
1156
1156
|
competitionId: e.id,
|
|
1157
1157
|
regOpen: u,
|
|
@@ -1159,7 +1159,7 @@ function vn({ comp: e, onSelect: r, onRegister: t }) {
|
|
|
1159
1159
|
deadlinePassed: c,
|
|
1160
1160
|
regCount: o,
|
|
1161
1161
|
regMax: d,
|
|
1162
|
-
onRegister:
|
|
1162
|
+
onRegister: r
|
|
1163
1163
|
}
|
|
1164
1164
|
)
|
|
1165
1165
|
] })
|
|
@@ -1167,8 +1167,8 @@ function vn({ comp: e, onSelect: r, onRegister: t }) {
|
|
|
1167
1167
|
}
|
|
1168
1168
|
);
|
|
1169
1169
|
}
|
|
1170
|
-
function
|
|
1171
|
-
const { isPowerMode: d } =
|
|
1170
|
+
function fn({ competitionId: e, regOpen: t, isFull: r, deadlinePassed: s, regCount: a, regMax: i, onRegister: o }) {
|
|
1171
|
+
const { isPowerMode: d } = re(), p = se(e), { data: c } = te(e), u = (c == null ? void 0 : c.isRegistered) || !1, x = i ? a / i * 100 : 0, f = x >= 100 ? "full" : x >= 75 ? "warning" : "ok";
|
|
1172
1172
|
return /* @__PURE__ */ l("div", { className: "pvx-comp-card-reg", children: [
|
|
1173
1173
|
/* @__PURE__ */ n("div", { className: "pvx-comp-card-reg-info", children: /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${f}`, children: [
|
|
1174
1174
|
a,
|
|
@@ -1180,17 +1180,17 @@ function hn({ competitionId: e, regOpen: r, isFull: t, deadlinePassed: s, regCou
|
|
|
1180
1180
|
"button",
|
|
1181
1181
|
{
|
|
1182
1182
|
className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--registered",
|
|
1183
|
-
onClick: (
|
|
1184
|
-
|
|
1183
|
+
onClick: (h) => {
|
|
1184
|
+
h.stopPropagation(), o(e);
|
|
1185
1185
|
},
|
|
1186
1186
|
children: "✓ Registered"
|
|
1187
1187
|
}
|
|
1188
|
-
) :
|
|
1188
|
+
) : t ? d ? /* @__PURE__ */ n(
|
|
1189
1189
|
"button",
|
|
1190
1190
|
{
|
|
1191
1191
|
className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--open",
|
|
1192
|
-
onClick: (
|
|
1193
|
-
|
|
1192
|
+
onClick: (h) => {
|
|
1193
|
+
h.stopPropagation(), o(e);
|
|
1194
1194
|
},
|
|
1195
1195
|
children: "Register"
|
|
1196
1196
|
}
|
|
@@ -1201,13 +1201,13 @@ function hn({ competitionId: e, regOpen: r, isFull: t, deadlinePassed: s, regCou
|
|
|
1201
1201
|
target: "_blank",
|
|
1202
1202
|
rel: "noopener noreferrer",
|
|
1203
1203
|
className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--open",
|
|
1204
|
-
onClick: (
|
|
1204
|
+
onClick: (h) => h.stopPropagation(),
|
|
1205
1205
|
children: "Register"
|
|
1206
1206
|
}
|
|
1207
|
-
) : /* @__PURE__ */ n("span", { className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--closed", children:
|
|
1207
|
+
) : /* @__PURE__ */ n("span", { className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--closed", children: r ? "Full" : "Closed" }) })
|
|
1208
1208
|
] });
|
|
1209
1209
|
}
|
|
1210
|
-
function
|
|
1210
|
+
function Nn() {
|
|
1211
1211
|
return /* @__PURE__ */ l("svg", { className: "pvx-comp-trophy-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1212
1212
|
/* @__PURE__ */ n("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
|
|
1213
1213
|
/* @__PURE__ */ n("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
|
|
@@ -1217,23 +1217,23 @@ function xn() {
|
|
|
1217
1217
|
/* @__PURE__ */ n("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
|
|
1218
1218
|
] });
|
|
1219
1219
|
}
|
|
1220
|
-
function
|
|
1220
|
+
function bn({ competitionId: e, className: t }) {
|
|
1221
1221
|
var d, p;
|
|
1222
|
-
const { data:
|
|
1222
|
+
const { data: r, isLoading: s } = be(e), { data: a, isLoading: i } = Ne(e);
|
|
1223
1223
|
if (s || i)
|
|
1224
|
-
return /* @__PURE__ */ n(
|
|
1225
|
-
if (!((d =
|
|
1226
|
-
return /* @__PURE__ */ n(
|
|
1224
|
+
return /* @__PURE__ */ n(q, { message: "Loading standings..." });
|
|
1225
|
+
if (!((d = r == null ? void 0 : r.standings) != null && d.length))
|
|
1226
|
+
return /* @__PURE__ */ n(I, { message: "No standings data yet. Results will appear once rounds are finalised." });
|
|
1227
1227
|
const o = ((p = a == null ? void 0 : a.rounds) == null ? void 0 : p.filter((c) => c.isFinalized)) || [];
|
|
1228
|
-
return /* @__PURE__ */ l("div", { className: `pvx-card ${
|
|
1228
|
+
return /* @__PURE__ */ l("div", { className: `pvx-card ${t || ""}`, children: [
|
|
1229
1229
|
/* @__PURE__ */ n("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
|
|
1230
1230
|
/* @__PURE__ */ n("h3", { className: "pvx-card-title", children: "Championship Standings" }),
|
|
1231
1231
|
/* @__PURE__ */ l("span", { className: "pvx-standings-subtitle", children: [
|
|
1232
1232
|
"After ",
|
|
1233
|
-
|
|
1233
|
+
r.roundsCompleted,
|
|
1234
1234
|
" round",
|
|
1235
|
-
|
|
1236
|
-
|
|
1235
|
+
r.roundsCompleted !== 1 ? "s" : "",
|
|
1236
|
+
r.countingRounds > 0 && ` (best ${r.countingRounds} count)`
|
|
1237
1237
|
] })
|
|
1238
1238
|
] }) }),
|
|
1239
1239
|
/* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
|
|
@@ -1256,8 +1256,8 @@ function gn({ competitionId: e, className: r }) {
|
|
|
1256
1256
|
c.roundNumber
|
|
1257
1257
|
))
|
|
1258
1258
|
] }) }),
|
|
1259
|
-
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children:
|
|
1260
|
-
|
|
1259
|
+
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: r.standings.map((c) => /* @__PURE__ */ n(
|
|
1260
|
+
yn,
|
|
1261
1261
|
{
|
|
1262
1262
|
driver: c,
|
|
1263
1263
|
finalizedRounds: o
|
|
@@ -1267,13 +1267,13 @@ function gn({ competitionId: e, className: r }) {
|
|
|
1267
1267
|
] }) })
|
|
1268
1268
|
] });
|
|
1269
1269
|
}
|
|
1270
|
-
function
|
|
1270
|
+
function yn({ driver: e, finalizedRounds: t }) {
|
|
1271
1271
|
var o, d, p;
|
|
1272
|
-
const
|
|
1272
|
+
const r = e.position <= 3, s = new Map(
|
|
1273
1273
|
((o = e.roundResults) == null ? void 0 : o.map((c) => [c.roundNumber, c])) || []
|
|
1274
1274
|
), a = ((d = e.roundResults) == null ? void 0 : d.filter((c) => c.position === 1).length) || 0, i = ((p = e.roundResults) == null ? void 0 : p.filter((c) => c.position <= 3).length) || 0;
|
|
1275
|
-
return /* @__PURE__ */ l("tr", { className: `pvx-row ${
|
|
1276
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(
|
|
1275
|
+
return /* @__PURE__ */ l("tr", { className: `pvx-row ${r ? "pvx-row--podium" : ""}`, children: [
|
|
1276
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(ce, { position: e.position }) }),
|
|
1277
1277
|
/* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
|
|
1278
1278
|
/* @__PURE__ */ n(G, { nation: e.nation }),
|
|
1279
1279
|
e.driverName
|
|
@@ -1281,13 +1281,13 @@ function fn({ driver: e, finalizedRounds: r }) {
|
|
|
1281
1281
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: a || "-" }),
|
|
1282
1282
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: i || "-" }),
|
|
1283
1283
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-standings-total", children: e.totalPoints }),
|
|
1284
|
-
|
|
1285
|
-
const u = s.get(c.roundNumber),
|
|
1284
|
+
t.map((c) => {
|
|
1285
|
+
const u = s.get(c.roundNumber), x = u == null ? void 0 : u.dropped;
|
|
1286
1286
|
return /* @__PURE__ */ n(
|
|
1287
1287
|
"td",
|
|
1288
1288
|
{
|
|
1289
|
-
className: `pvx-td pvx-td--center pvx-hidden-below-md ${!
|
|
1290
|
-
children: u ? /* @__PURE__ */ l("div", { className: `pvx-standings-round-cell ${
|
|
1289
|
+
className: `pvx-td pvx-td--center pvx-hidden-below-md ${!x && (u == null ? void 0 : u.position) === 1 ? "pvx-standings-cell--p1" : !x && (u == null ? void 0 : u.position) === 2 ? "pvx-standings-cell--p2" : !x && (u == null ? void 0 : u.position) === 3 ? "pvx-standings-cell--p3" : ""}`,
|
|
1290
|
+
children: u ? /* @__PURE__ */ l("div", { className: `pvx-standings-round-cell ${x ? "pvx-standings-round-cell--dropped" : ""}`, children: [
|
|
1291
1291
|
/* @__PURE__ */ l("span", { className: "pvx-standings-round-pos", children: [
|
|
1292
1292
|
"P",
|
|
1293
1293
|
u.position
|
|
@@ -1300,15 +1300,15 @@ function fn({ driver: e, finalizedRounds: r }) {
|
|
|
1300
1300
|
})
|
|
1301
1301
|
] });
|
|
1302
1302
|
}
|
|
1303
|
-
function
|
|
1303
|
+
function Nt({ competitionId: e, roundNumber: t, className: r }) {
|
|
1304
1304
|
var p;
|
|
1305
|
-
const { data: s, isLoading: a } =
|
|
1305
|
+
const { data: s, isLoading: a } = Ye(e, t);
|
|
1306
1306
|
if (a)
|
|
1307
|
-
return /* @__PURE__ */ n(
|
|
1307
|
+
return /* @__PURE__ */ n(q, { message: "Loading results..." });
|
|
1308
1308
|
if (!s)
|
|
1309
|
-
return /* @__PURE__ */ n(
|
|
1309
|
+
return /* @__PURE__ */ n(I, { message: "No results for this round." });
|
|
1310
1310
|
const o = (s.sessions || []).find((c) => c.type === "RACE"), d = (p = o == null ? void 0 : o.results) == null ? void 0 : p.filter((c) => c.position <= 3).sort((c, u) => c.position - u.position);
|
|
1311
|
-
return /* @__PURE__ */ l("div", { className: `pvx-round-results ${
|
|
1311
|
+
return /* @__PURE__ */ l("div", { className: `pvx-round-results ${r || ""}`, children: [
|
|
1312
1312
|
/* @__PURE__ */ l("div", { className: "pvx-round-results-header", children: [
|
|
1313
1313
|
/* @__PURE__ */ l("div", { children: [
|
|
1314
1314
|
/* @__PURE__ */ l("h4", { className: "pvx-round-results-title", children: [
|
|
@@ -1323,48 +1323,48 @@ function xt({ competitionId: e, roundNumber: r, className: t }) {
|
|
|
1323
1323
|
}) })
|
|
1324
1324
|
] }),
|
|
1325
1325
|
(d == null ? void 0 : d.length) > 0 && /* @__PURE__ */ n("div", { className: "pvx-round-podium-summary", children: d.map((c) => /* @__PURE__ */ l("span", { className: "pvx-round-podium-item", children: [
|
|
1326
|
-
/* @__PURE__ */ n("span", { children:
|
|
1326
|
+
/* @__PURE__ */ n("span", { children: oe[c.position - 1] }),
|
|
1327
1327
|
/* @__PURE__ */ n("span", { children: c.driverName })
|
|
1328
1328
|
] }, c.driverId)) })
|
|
1329
1329
|
] }),
|
|
1330
|
-
/* @__PURE__ */ n(
|
|
1330
|
+
/* @__PURE__ */ n(de, { round: s, competitionId: e })
|
|
1331
1331
|
] });
|
|
1332
1332
|
}
|
|
1333
|
-
function
|
|
1334
|
-
var u,
|
|
1335
|
-
const [s, a] =
|
|
1333
|
+
function de({ round: e, competitionId: t, className: r }) {
|
|
1334
|
+
var u, x, f, h;
|
|
1335
|
+
const [s, a] = M(null), i = (e == null ? void 0 : e.sessions) || [];
|
|
1336
1336
|
if (!i.length)
|
|
1337
|
-
return /* @__PURE__ */ n(
|
|
1338
|
-
const { data: o } =
|
|
1339
|
-
|
|
1337
|
+
return /* @__PURE__ */ n(I, { message: "No session data for this round." });
|
|
1338
|
+
const { data: o } = Xe(
|
|
1339
|
+
t,
|
|
1340
1340
|
e == null ? void 0 : e.roundNumber,
|
|
1341
1341
|
{}
|
|
1342
|
-
), d = s || ((u = i.find((
|
|
1343
|
-
return /* @__PURE__ */ l("div", { className:
|
|
1342
|
+
), d = s || ((u = i.find((b) => b.type === "RACE")) == null ? void 0 : u.type) || ((x = i[0]) == null ? void 0 : x.type), p = i.find((b) => b.type === d) || i[0], c = ((h = (f = o == null ? void 0 : o.sessions) == null ? void 0 : f.find((b) => b.type === d)) == null ? void 0 : h.drivers) || null;
|
|
1343
|
+
return /* @__PURE__ */ l("div", { className: r || "", children: [
|
|
1344
1344
|
/* @__PURE__ */ n(
|
|
1345
|
-
|
|
1345
|
+
cn,
|
|
1346
1346
|
{
|
|
1347
1347
|
sessions: i,
|
|
1348
1348
|
activeSession: d,
|
|
1349
1349
|
onSelect: a
|
|
1350
1350
|
}
|
|
1351
1351
|
),
|
|
1352
|
-
/* @__PURE__ */ n(
|
|
1352
|
+
/* @__PURE__ */ n(kn, { session: p, sessionLaps: c })
|
|
1353
1353
|
] });
|
|
1354
1354
|
}
|
|
1355
|
-
function
|
|
1355
|
+
function kn({ session: e, sessionLaps: t }) {
|
|
1356
1356
|
var d;
|
|
1357
|
-
const
|
|
1357
|
+
const r = e.type === "RACE", [s, a] = M(null);
|
|
1358
1358
|
if (!((d = e.results) != null && d.length))
|
|
1359
|
-
return /* @__PURE__ */ n(
|
|
1360
|
-
const i =
|
|
1359
|
+
return /* @__PURE__ */ n(I, { message: `No results for ${e.type}.` });
|
|
1360
|
+
const i = un(e.results), o = r ? 7 : 4;
|
|
1361
1361
|
return /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
|
|
1362
1362
|
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
|
|
1363
1363
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
|
|
1364
1364
|
/* @__PURE__ */ n("th", { className: "pvx-th", children: "Driver" }),
|
|
1365
1365
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Car" }),
|
|
1366
1366
|
/* @__PURE__ */ n("th", { className: "pvx-th", children: "Best Lap" }),
|
|
1367
|
-
|
|
1367
|
+
r && /* @__PURE__ */ l(F, { children: [
|
|
1368
1368
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Laps" }),
|
|
1369
1369
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Time / Gap" }),
|
|
1370
1370
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-th--center", children: "Points" })
|
|
@@ -1372,18 +1372,18 @@ function Nn({ session: e, sessionLaps: r }) {
|
|
|
1372
1372
|
] }) }),
|
|
1373
1373
|
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: e.results.map((p, c) => {
|
|
1374
1374
|
var f;
|
|
1375
|
-
const u = (f =
|
|
1375
|
+
const u = (f = t == null ? void 0 : t[p.driverId]) == null ? void 0 : f.laps, x = s === p.driverId && !!u;
|
|
1376
1376
|
return /* @__PURE__ */ n(
|
|
1377
|
-
|
|
1377
|
+
wn,
|
|
1378
1378
|
{
|
|
1379
1379
|
result: p,
|
|
1380
|
-
isRace:
|
|
1380
|
+
isRace: r,
|
|
1381
1381
|
fastestSplits: i,
|
|
1382
1382
|
rowIndex: c,
|
|
1383
1383
|
hasLapDetail: !!u,
|
|
1384
|
-
isExpanded:
|
|
1385
|
-
onToggle: () => a(
|
|
1386
|
-
driverLaps:
|
|
1384
|
+
isExpanded: x,
|
|
1385
|
+
onToggle: () => a(x ? null : p.driverId),
|
|
1386
|
+
driverLaps: x ? u : null,
|
|
1387
1387
|
colCount: o
|
|
1388
1388
|
},
|
|
1389
1389
|
p.driverId || c
|
|
@@ -1391,7 +1391,7 @@ function Nn({ session: e, sessionLaps: r }) {
|
|
|
1391
1391
|
}) })
|
|
1392
1392
|
] }) });
|
|
1393
1393
|
}
|
|
1394
|
-
function
|
|
1394
|
+
function wn({ result: e, isRace: t, fastestSplits: r, rowIndex: s, hasLapDetail: a, isExpanded: i, onToggle: o, driverLaps: d, colCount: p }) {
|
|
1395
1395
|
const c = e.position <= 3;
|
|
1396
1396
|
return /* @__PURE__ */ l(F, { children: [
|
|
1397
1397
|
/* @__PURE__ */ l(
|
|
@@ -1401,7 +1401,7 @@ function bn({ result: e, isRace: r, fastestSplits: t, rowIndex: s, hasLapDetail:
|
|
|
1401
1401
|
onClick: a ? o : void 0,
|
|
1402
1402
|
style: a ? { cursor: "pointer" } : void 0,
|
|
1403
1403
|
children: [
|
|
1404
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(
|
|
1404
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(ce, { position: e.position }) }),
|
|
1405
1405
|
/* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
|
|
1406
1406
|
/* @__PURE__ */ n(G, { nation: e.nation }),
|
|
1407
1407
|
e.driverName,
|
|
@@ -1411,18 +1411,18 @@ function bn({ result: e, isRace: r, fastestSplits: t, rowIndex: s, hasLapDetail:
|
|
|
1411
1411
|
] }),
|
|
1412
1412
|
e.penalty && /* @__PURE__ */ n("span", { className: "pvx-penalty", children: e.penalty })
|
|
1413
1413
|
] }),
|
|
1414
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children:
|
|
1414
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: B(e.carId) }),
|
|
1415
1415
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ n(
|
|
1416
|
-
|
|
1416
|
+
Ln,
|
|
1417
1417
|
{
|
|
1418
1418
|
bestLap: e.bestLapFormatted,
|
|
1419
1419
|
hasBestLap: e.hasBestLap,
|
|
1420
1420
|
splits: e.splits,
|
|
1421
|
-
fastestSplits:
|
|
1421
|
+
fastestSplits: r,
|
|
1422
1422
|
showAbove: s <= 1
|
|
1423
1423
|
}
|
|
1424
1424
|
) }),
|
|
1425
|
-
|
|
1425
|
+
t && /* @__PURE__ */ l(F, { children: [
|
|
1426
1426
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: e.lapsCompleted }),
|
|
1427
1427
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: e.position === 1 ? e.totalTime || "-" : e.gap || "-" }),
|
|
1428
1428
|
/* @__PURE__ */ l("td", { className: "pvx-td pvx-td--center", children: [
|
|
@@ -1438,11 +1438,11 @@ function bn({ result: e, isRace: r, fastestSplits: t, rowIndex: s, hasLapDetail:
|
|
|
1438
1438
|
]
|
|
1439
1439
|
}
|
|
1440
1440
|
),
|
|
1441
|
-
i && d && /* @__PURE__ */ n("tr", { className: "pvx-row pvx-row--lap-detail", children: /* @__PURE__ */ n("td", { colSpan: p, className: "pvx-td pvx-td--lap-detail", children: /* @__PURE__ */ n(
|
|
1441
|
+
i && d && /* @__PURE__ */ n("tr", { className: "pvx-row pvx-row--lap-detail", children: /* @__PURE__ */ n("td", { colSpan: p, className: "pvx-td pvx-td--lap-detail", children: /* @__PURE__ */ n(Cn, { laps: d }) }) })
|
|
1442
1442
|
] });
|
|
1443
1443
|
}
|
|
1444
|
-
function
|
|
1445
|
-
const
|
|
1444
|
+
function Cn({ laps: e }) {
|
|
1445
|
+
const t = Math.min(...e.filter((r) => r.valid && r.timeMs > 0).map((r) => r.timeMs));
|
|
1446
1446
|
return /* @__PURE__ */ l("table", { className: "pvx-table pvx-table--laps", children: [
|
|
1447
1447
|
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
|
|
1448
1448
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "Lap" }),
|
|
@@ -1451,22 +1451,22 @@ function yn({ laps: e }) {
|
|
|
1451
1451
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
|
|
1452
1452
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" })
|
|
1453
1453
|
] }) }),
|
|
1454
|
-
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: e.map((
|
|
1454
|
+
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: e.map((r) => {
|
|
1455
1455
|
var a;
|
|
1456
|
-
const s =
|
|
1457
|
-
return /* @__PURE__ */ l("tr", { className: `pvx-row ${
|
|
1458
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted", children:
|
|
1459
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children:
|
|
1460
|
-
(
|
|
1461
|
-
Array.from({ length: Math.max(0, 3 - (((a =
|
|
1462
|
-
] },
|
|
1456
|
+
const s = r.valid && r.timeMs === t;
|
|
1457
|
+
return /* @__PURE__ */ l("tr", { className: `pvx-row ${r.valid ? "" : "pvx-row--invalid"} ${s ? "pvx-row--fastest" : ""}`, children: [
|
|
1458
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted", children: r.lap }),
|
|
1459
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children: r.time }),
|
|
1460
|
+
(r.splits || []).map((i, o) => /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: i }, o)),
|
|
1461
|
+
Array.from({ length: Math.max(0, 3 - (((a = r.splits) == null ? void 0 : a.length) || 0)) }).map((i, o) => /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm" }, `pad-${o}`))
|
|
1462
|
+
] }, r.lap);
|
|
1463
1463
|
}) })
|
|
1464
1464
|
] });
|
|
1465
1465
|
}
|
|
1466
|
-
function
|
|
1467
|
-
return e ? /* @__PURE__ */ l("span", { className: `pvx-best-lap-cell ${
|
|
1466
|
+
function Ln({ bestLap: e, hasBestLap: t, splits: r, fastestSplits: s, showAbove: a }) {
|
|
1467
|
+
return e ? /* @__PURE__ */ l("span", { className: `pvx-best-lap-cell ${t ? "pvx-best-lap-cell--fastest" : ""}`, children: [
|
|
1468
1468
|
/* @__PURE__ */ n("span", { className: "pvx-best-lap-time", children: e }),
|
|
1469
|
-
(
|
|
1469
|
+
(r == null ? void 0 : r.length) > 0 && /* @__PURE__ */ n("span", { className: "pvx-splits-tooltip-anchor", children: /* @__PURE__ */ n("span", { className: `pvx-splits-tooltip ${a ? "" : "pvx-splits-tooltip--above"}`, children: r.map((i, o) => {
|
|
1470
1470
|
const d = s && i === s[o];
|
|
1471
1471
|
return /* @__PURE__ */ l("span", { className: "pvx-splits-tooltip-row", children: [
|
|
1472
1472
|
/* @__PURE__ */ l("span", { className: "pvx-splits-tooltip-label", children: [
|
|
@@ -1478,12 +1478,12 @@ function kn({ bestLap: e, hasBestLap: r, splits: t, fastestSplits: s, showAbove:
|
|
|
1478
1478
|
}) }) })
|
|
1479
1479
|
] }) : /* @__PURE__ */ n("span", { className: "pvx-td--muted", children: "-" });
|
|
1480
1480
|
}
|
|
1481
|
-
function
|
|
1482
|
-
const { getSteamId:
|
|
1481
|
+
function bt({ competitionId: e, className: t }) {
|
|
1482
|
+
const { getSteamId: r } = C(), { data: s, isLoading: a } = ye(e), i = r();
|
|
1483
1483
|
if (a)
|
|
1484
|
-
return /* @__PURE__ */ n(
|
|
1484
|
+
return /* @__PURE__ */ n(q, { message: "Loading drivers..." });
|
|
1485
1485
|
const o = (s == null ? void 0 : s.drivers) || (s == null ? void 0 : s.entries) || [];
|
|
1486
|
-
return o.length ? /* @__PURE__ */ n("div", { className: `pvx-entry-grid ${
|
|
1486
|
+
return o.length ? /* @__PURE__ */ n("div", { className: `pvx-entry-grid ${t || ""}`, children: o.map((d) => {
|
|
1487
1487
|
var c, u;
|
|
1488
1488
|
const p = i && d.steamId === i;
|
|
1489
1489
|
return /* @__PURE__ */ l("div", { className: `pvx-entry-card ${p ? "pvx-entry-card--you" : ""}`, children: [
|
|
@@ -1500,26 +1500,26 @@ function gt({ competitionId: e, className: r }) {
|
|
|
1500
1500
|
p && /* @__PURE__ */ n("span", { className: "pvx-entry-you", children: " (you)" })
|
|
1501
1501
|
] })
|
|
1502
1502
|
] }, d.steamId || d.driverId);
|
|
1503
|
-
}) }) : /* @__PURE__ */ n(
|
|
1503
|
+
}) }) : /* @__PURE__ */ n(I, { message: "No drivers registered yet." });
|
|
1504
1504
|
}
|
|
1505
|
-
function
|
|
1505
|
+
function yt({
|
|
1506
1506
|
competitionId: e,
|
|
1507
|
-
driverData:
|
|
1508
|
-
className:
|
|
1507
|
+
driverData: t,
|
|
1508
|
+
className: r,
|
|
1509
1509
|
children: s
|
|
1510
1510
|
}) {
|
|
1511
|
-
const { data: a, isLoading: i } =
|
|
1512
|
-
o && p.mutate(
|
|
1513
|
-
},
|
|
1511
|
+
const { data: a, isLoading: i } = te(e), { isPowerMode: o } = re(), d = se(e), p = ke(e), c = we(e), u = (a == null ? void 0 : a.isRegistered) || !1, x = i || p.isPending || c.isPending, f = p.error || c.error || null, h = () => {
|
|
1512
|
+
o && p.mutate(t || {});
|
|
1513
|
+
}, b = () => {
|
|
1514
1514
|
o && c.mutate();
|
|
1515
1515
|
};
|
|
1516
|
-
return typeof s == "function" ? s({ isRegistered: u, isLoading:
|
|
1516
|
+
return typeof s == "function" ? s({ isRegistered: u, isLoading: x, register: h, withdraw: b, error: f, isPowerMode: o, registrationUrl: d }) : o ? /* @__PURE__ */ n(
|
|
1517
1517
|
"button",
|
|
1518
1518
|
{
|
|
1519
|
-
className: `pvx-comp-register-btn ${
|
|
1520
|
-
onClick: u ?
|
|
1521
|
-
disabled:
|
|
1522
|
-
children:
|
|
1519
|
+
className: `pvx-comp-register-btn ${r || ""}`,
|
|
1520
|
+
onClick: u ? b : h,
|
|
1521
|
+
disabled: x,
|
|
1522
|
+
children: x ? "Loading..." : u ? "Withdraw" : "Register"
|
|
1523
1523
|
}
|
|
1524
1524
|
) : /* @__PURE__ */ n(
|
|
1525
1525
|
"a",
|
|
@@ -1527,51 +1527,51 @@ function ft({
|
|
|
1527
1527
|
href: d,
|
|
1528
1528
|
target: "_blank",
|
|
1529
1529
|
rel: "noopener noreferrer",
|
|
1530
|
-
className: `pvx-comp-register-link ${
|
|
1530
|
+
className: `pvx-comp-register-link ${r || ""}`,
|
|
1531
1531
|
children: u ? "View Registration" : "Register on PitVox"
|
|
1532
1532
|
}
|
|
1533
1533
|
);
|
|
1534
1534
|
}
|
|
1535
|
-
function
|
|
1536
|
-
const { getSteamId: a } = C(), { isPowerMode: i } =
|
|
1537
|
-
return p || u ? /* @__PURE__ */ n(
|
|
1538
|
-
|
|
1535
|
+
function kt({ competitionId: e, registration: t, onWithdrawSuccess: r, className: s }) {
|
|
1536
|
+
const { getSteamId: a } = C(), { isPowerMode: i } = re(), o = se(e), { data: d, isLoading: p } = te(e), { data: c, isLoading: u } = ye(e), x = ke(e), f = we(e), h = a(), b = (d == null ? void 0 : d.isRegistered) || !1, g = (c == null ? void 0 : c.drivers) || (c == null ? void 0 : c.entries) || [], m = t || {}, N = g.length || m.currentCount || 0, v = m.maxParticipants && N >= m.maxParticipants, k = m.deadline && new Date(m.deadline) < /* @__PURE__ */ new Date(), y = m.isOpen && !k && !v;
|
|
1537
|
+
return p || u ? /* @__PURE__ */ n(q, { message: "Loading registration..." }) : b ? /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: /* @__PURE__ */ n(
|
|
1538
|
+
Tn,
|
|
1539
1539
|
{
|
|
1540
1540
|
competitionId: e,
|
|
1541
|
-
drivers:
|
|
1542
|
-
steamId:
|
|
1541
|
+
drivers: g,
|
|
1542
|
+
steamId: h,
|
|
1543
1543
|
isPowerMode: i,
|
|
1544
1544
|
registrationUrl: o,
|
|
1545
1545
|
withdrawMutation: f,
|
|
1546
|
-
onWithdrawSuccess:
|
|
1547
|
-
registration:
|
|
1546
|
+
onWithdrawSuccess: r,
|
|
1547
|
+
registration: m
|
|
1548
1548
|
}
|
|
1549
|
-
) }) :
|
|
1550
|
-
|
|
1549
|
+
) }) : y ? h ? i ? /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: /* @__PURE__ */ n(
|
|
1550
|
+
Sn,
|
|
1551
1551
|
{
|
|
1552
1552
|
competitionId: e,
|
|
1553
|
-
registerMutation:
|
|
1554
|
-
registration:
|
|
1553
|
+
registerMutation: x,
|
|
1554
|
+
registration: m
|
|
1555
1555
|
}
|
|
1556
1556
|
) }) : /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: /* @__PURE__ */ n("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) : /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: i ? /* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children: "Sign in to register for this competition." }) : /* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children: /* @__PURE__ */ n("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) }) : /* @__PURE__ */ l("div", { className: `pvx-reg-panel ${s || ""}`, children: [
|
|
1557
1557
|
/* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children: v ? "Registration is full." : k ? "Registration deadline has passed." : "Registration is closed." }),
|
|
1558
|
-
|
|
1558
|
+
g.length > 0 && /* @__PURE__ */ n(De, { drivers: g, steamId: h })
|
|
1559
1559
|
] });
|
|
1560
1560
|
}
|
|
1561
|
-
function
|
|
1562
|
-
const [s, a] =
|
|
1563
|
-
|
|
1561
|
+
function Sn({ competitionId: e, registerMutation: t, registration: r }) {
|
|
1562
|
+
const [s, a] = M(""), [i, o] = M("intermediate"), [d, p] = M(""), c = (h) => {
|
|
1563
|
+
h.preventDefault(), t.mutate({
|
|
1564
1564
|
discordUsername: s || void 0,
|
|
1565
1565
|
experience: i,
|
|
1566
1566
|
comments: d || void 0
|
|
1567
1567
|
});
|
|
1568
|
-
}, u =
|
|
1568
|
+
}, u = r || {}, x = u.currentCount || 0, f = u.maxParticipants;
|
|
1569
1569
|
return /* @__PURE__ */ l("form", { className: "pvx-reg-form", onSubmit: c, children: [
|
|
1570
1570
|
/* @__PURE__ */ l("div", { className: "pvx-reg-form-header", children: [
|
|
1571
1571
|
/* @__PURE__ */ n("h3", { className: "pvx-reg-form-title", children: "Register" }),
|
|
1572
|
-
f && /* @__PURE__ */ n(
|
|
1572
|
+
f && /* @__PURE__ */ n(Me, { count: x, max: f })
|
|
1573
1573
|
] }),
|
|
1574
|
-
|
|
1574
|
+
t.error && /* @__PURE__ */ n("div", { className: "pvx-reg-error", children: t.error.message || "Registration failed" }),
|
|
1575
1575
|
/* @__PURE__ */ l("div", { className: "pvx-reg-field", children: [
|
|
1576
1576
|
/* @__PURE__ */ l("label", { className: "pvx-reg-label", htmlFor: `pvx-discord-${e}`, children: [
|
|
1577
1577
|
"Discord Username ",
|
|
@@ -1585,7 +1585,7 @@ function wn({ competitionId: e, registerMutation: r, registration: t }) {
|
|
|
1585
1585
|
className: "pvx-reg-input",
|
|
1586
1586
|
placeholder: "e.g. username",
|
|
1587
1587
|
value: s,
|
|
1588
|
-
onChange: (
|
|
1588
|
+
onChange: (h) => a(h.target.value)
|
|
1589
1589
|
}
|
|
1590
1590
|
)
|
|
1591
1591
|
] }),
|
|
@@ -1597,7 +1597,7 @@ function wn({ competitionId: e, registerMutation: r, registration: t }) {
|
|
|
1597
1597
|
id: `pvx-exp-${e}`,
|
|
1598
1598
|
className: "pvx-reg-select",
|
|
1599
1599
|
value: i,
|
|
1600
|
-
onChange: (
|
|
1600
|
+
onChange: (h) => o(h.target.value),
|
|
1601
1601
|
children: [
|
|
1602
1602
|
/* @__PURE__ */ n("option", { value: "beginner", children: "Beginner" }),
|
|
1603
1603
|
/* @__PURE__ */ n("option", { value: "intermediate", children: "Intermediate" }),
|
|
@@ -1619,7 +1619,7 @@ function wn({ competitionId: e, registerMutation: r, registration: t }) {
|
|
|
1619
1619
|
rows: 3,
|
|
1620
1620
|
placeholder: "Anything the organisers should know?",
|
|
1621
1621
|
value: d,
|
|
1622
|
-
onChange: (
|
|
1622
|
+
onChange: (h) => p(h.target.value)
|
|
1623
1623
|
}
|
|
1624
1624
|
)
|
|
1625
1625
|
] }),
|
|
@@ -1628,26 +1628,26 @@ function wn({ competitionId: e, registerMutation: r, registration: t }) {
|
|
|
1628
1628
|
{
|
|
1629
1629
|
type: "submit",
|
|
1630
1630
|
className: "pvx-comp-register-btn",
|
|
1631
|
-
disabled:
|
|
1632
|
-
children:
|
|
1631
|
+
disabled: t.isPending,
|
|
1632
|
+
children: t.isPending ? "Registering..." : "Register"
|
|
1633
1633
|
}
|
|
1634
1634
|
) })
|
|
1635
1635
|
] });
|
|
1636
1636
|
}
|
|
1637
|
-
function
|
|
1638
|
-
const [p, c] =
|
|
1637
|
+
function Tn({ competitionId: e, drivers: t, steamId: r, isPowerMode: s, registrationUrl: a, withdrawMutation: i, onWithdrawSuccess: o, registration: d }) {
|
|
1638
|
+
const [p, c] = M(!1), u = () => {
|
|
1639
1639
|
i.mutate(void 0, {
|
|
1640
1640
|
onSuccess: () => {
|
|
1641
1641
|
c(!1), o && o();
|
|
1642
1642
|
}
|
|
1643
1643
|
});
|
|
1644
|
-
},
|
|
1644
|
+
}, x = d || {}, f = t.length || x.currentCount || 0, h = x.maxParticipants;
|
|
1645
1645
|
return /* @__PURE__ */ l(F, { children: [
|
|
1646
1646
|
/* @__PURE__ */ l("div", { className: "pvx-reg-form-header", children: [
|
|
1647
1647
|
/* @__PURE__ */ n("h3", { className: "pvx-reg-form-title", children: "Registered Drivers" }),
|
|
1648
|
-
|
|
1648
|
+
h && /* @__PURE__ */ n(Me, { count: f, max: h })
|
|
1649
1649
|
] }),
|
|
1650
|
-
/* @__PURE__ */ n(
|
|
1650
|
+
/* @__PURE__ */ n(De, { drivers: t, steamId: r }),
|
|
1651
1651
|
i.error && /* @__PURE__ */ n("div", { className: "pvx-reg-error", children: i.error.message || "Withdrawal failed" }),
|
|
1652
1652
|
s ? /* @__PURE__ */ n("div", { className: "pvx-reg-actions", children: p ? /* @__PURE__ */ l("div", { className: "pvx-reg-confirm", children: [
|
|
1653
1653
|
/* @__PURE__ */ n("p", { className: "pvx-reg-confirm-text", children: "Are you sure you want to unregister?" }),
|
|
@@ -1683,16 +1683,16 @@ function Cn({ competitionId: e, drivers: r, steamId: t, isPowerMode: s, registra
|
|
|
1683
1683
|
) }) : /* @__PURE__ */ n("div", { className: "pvx-reg-actions", children: /* @__PURE__ */ n("a", { href: a, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Manage on PitVox" }) })
|
|
1684
1684
|
] });
|
|
1685
1685
|
}
|
|
1686
|
-
function
|
|
1686
|
+
function De({ drivers: e, steamId: t }) {
|
|
1687
1687
|
if (!e.length)
|
|
1688
1688
|
return /* @__PURE__ */ n("div", { className: "pvx-reg-no-drivers", children: "No drivers registered yet." });
|
|
1689
|
-
const
|
|
1690
|
-
const i =
|
|
1689
|
+
const r = [...e].sort((s, a) => {
|
|
1690
|
+
const i = t && s.steamId === t ? -1 : 0, o = t && a.steamId === t ? -1 : 0;
|
|
1691
1691
|
return i - o;
|
|
1692
1692
|
});
|
|
1693
|
-
return /* @__PURE__ */ n("div", { className: "pvx-reg-driver-list", children:
|
|
1693
|
+
return /* @__PURE__ */ n("div", { className: "pvx-reg-driver-list", children: r.map((s) => {
|
|
1694
1694
|
var i, o;
|
|
1695
|
-
const a =
|
|
1695
|
+
const a = t && s.steamId === t;
|
|
1696
1696
|
return /* @__PURE__ */ l(
|
|
1697
1697
|
"div",
|
|
1698
1698
|
{
|
|
@@ -1709,73 +1709,73 @@ function Te({ drivers: e, steamId: r }) {
|
|
|
1709
1709
|
);
|
|
1710
1710
|
}) });
|
|
1711
1711
|
}
|
|
1712
|
-
function
|
|
1713
|
-
const
|
|
1712
|
+
function Me({ count: e, max: t }) {
|
|
1713
|
+
const r = t ? e / t * 100 : 0, s = r >= 100 ? "full" : r >= 75 ? "warning" : "ok";
|
|
1714
1714
|
return /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${s}`, children: [
|
|
1715
1715
|
e,
|
|
1716
1716
|
"/",
|
|
1717
|
-
|
|
1717
|
+
t,
|
|
1718
1718
|
" drivers"
|
|
1719
1719
|
] });
|
|
1720
1720
|
}
|
|
1721
|
-
function
|
|
1722
|
-
const { data:
|
|
1721
|
+
function wt({ competitionId: e, className: t }) {
|
|
1722
|
+
const { data: r, isLoading: s } = Ne(e), a = (r == null ? void 0 : r.type) === "championship", i = (r == null ? void 0 : r.type) === "hotlap", { data: o } = Ze(i ? e : null), d = S(
|
|
1723
1723
|
() => {
|
|
1724
|
-
var
|
|
1725
|
-
return ((
|
|
1724
|
+
var y;
|
|
1725
|
+
return ((y = r == null ? void 0 : r.rounds) == null ? void 0 : y.filter((L) => L.isFinalized)) || [];
|
|
1726
1726
|
},
|
|
1727
|
-
[
|
|
1727
|
+
[r]
|
|
1728
1728
|
), p = S(
|
|
1729
|
-
() => d.map((
|
|
1729
|
+
() => d.map((y) => y.roundNumber),
|
|
1730
1730
|
[d]
|
|
1731
|
-
), { data: c = [], isLoading: u } =
|
|
1731
|
+
), { data: c = [], isLoading: u } = Je(
|
|
1732
1732
|
e,
|
|
1733
1733
|
p
|
|
1734
|
-
),
|
|
1734
|
+
), x = i && c.length > 0 ? c[0] : null, f = (x == null ? void 0 : x.sessions) || [], h = i ? "leaderboard" : a ? "standings" : p.length > 0 ? `round-${p[p.length - 1]}` : null, [b, g] = M(null), m = b || h;
|
|
1735
1735
|
if (s || u)
|
|
1736
|
-
return /* @__PURE__ */ n(
|
|
1737
|
-
if (!
|
|
1738
|
-
return /* @__PURE__ */ n(
|
|
1736
|
+
return /* @__PURE__ */ n(q, { message: "Loading results..." });
|
|
1737
|
+
if (!r)
|
|
1738
|
+
return /* @__PURE__ */ n(I, { message: "Competition not found." });
|
|
1739
1739
|
if (!d.length)
|
|
1740
|
-
return /* @__PURE__ */ n(
|
|
1741
|
-
const N = new Map(c.map((
|
|
1740
|
+
return /* @__PURE__ */ n(I, { message: "No results available yet. Results will appear here once rounds are finalised." });
|
|
1741
|
+
const N = new Map(c.map((y) => [`round-${y.roundNumber}`, y])), v = [];
|
|
1742
1742
|
if (a && v.push({ id: "standings", label: "Standings" }), i) {
|
|
1743
1743
|
v.push({ id: "leaderboard", label: "Leaderboard" });
|
|
1744
|
-
for (const
|
|
1745
|
-
v.push({ id: `session-${
|
|
1744
|
+
for (const y of f)
|
|
1745
|
+
v.push({ id: `session-${y.type}`, label: le(y.type) });
|
|
1746
1746
|
} else
|
|
1747
|
-
for (const
|
|
1747
|
+
for (const y of d)
|
|
1748
1748
|
v.push({
|
|
1749
|
-
id: `round-${
|
|
1750
|
-
label: `R${
|
|
1749
|
+
id: `round-${y.roundNumber}`,
|
|
1750
|
+
label: `R${y.roundNumber}`,
|
|
1751
1751
|
track: null
|
|
1752
1752
|
});
|
|
1753
|
-
const k = N.get(
|
|
1754
|
-
return /* @__PURE__ */ l("div", { className:
|
|
1755
|
-
/* @__PURE__ */ n("div", { className: "pvx-results-tabs", children: v.map((
|
|
1753
|
+
const k = N.get(m);
|
|
1754
|
+
return /* @__PURE__ */ l("div", { className: t || "", children: [
|
|
1755
|
+
/* @__PURE__ */ n("div", { className: "pvx-results-tabs", children: v.map((y) => /* @__PURE__ */ l(
|
|
1756
1756
|
"button",
|
|
1757
1757
|
{
|
|
1758
|
-
className: `pvx-results-tab ${
|
|
1759
|
-
onClick: () =>
|
|
1760
|
-
title:
|
|
1758
|
+
className: `pvx-results-tab ${m === y.id ? "pvx-results-tab--active" : ""}`,
|
|
1759
|
+
onClick: () => g(y.id),
|
|
1760
|
+
title: y.track || void 0,
|
|
1761
1761
|
children: [
|
|
1762
|
-
/* @__PURE__ */ n("span", { className: "pvx-results-tab-label", children:
|
|
1763
|
-
|
|
1762
|
+
/* @__PURE__ */ n("span", { className: "pvx-results-tab-label", children: y.label }),
|
|
1763
|
+
y.track && /* @__PURE__ */ n("span", { className: "pvx-results-tab-track", children: y.track })
|
|
1764
1764
|
]
|
|
1765
1765
|
},
|
|
1766
|
-
|
|
1766
|
+
y.id
|
|
1767
1767
|
)) }),
|
|
1768
|
-
|
|
1769
|
-
|
|
1768
|
+
m === "standings" ? /* @__PURE__ */ n(bn, { competitionId: e }) : m === "leaderboard" ? /* @__PURE__ */ n(Rn, { leaderboard: o, config: r }) : m != null && m.startsWith("session-") ? /* @__PURE__ */ n(
|
|
1769
|
+
Dn,
|
|
1770
1770
|
{
|
|
1771
|
-
session: f.find((
|
|
1772
|
-
round:
|
|
1771
|
+
session: f.find((y) => `session-${y.type}` === m),
|
|
1772
|
+
round: x,
|
|
1773
1773
|
competitionId: e
|
|
1774
1774
|
}
|
|
1775
|
-
) : k ? /* @__PURE__ */ n(
|
|
1775
|
+
) : k ? /* @__PURE__ */ n($n, { round: k, competitionId: e }) : /* @__PURE__ */ n(I, { message: "No results for this round." })
|
|
1776
1776
|
] });
|
|
1777
1777
|
}
|
|
1778
|
-
function
|
|
1778
|
+
function $n({ round: e, competitionId: t }) {
|
|
1779
1779
|
var i;
|
|
1780
1780
|
const s = (e.sessions || []).find((o) => o.type === "RACE"), a = (i = s == null ? void 0 : s.results) == null ? void 0 : i.filter((o) => o.position <= 3).sort((o, d) => o.position - d.position);
|
|
1781
1781
|
return /* @__PURE__ */ l("div", { className: "pvx-card", children: [
|
|
@@ -1793,18 +1793,18 @@ function Ln({ round: e, competitionId: r }) {
|
|
|
1793
1793
|
}) })
|
|
1794
1794
|
] }),
|
|
1795
1795
|
(a == null ? void 0 : a.length) > 0 && /* @__PURE__ */ n("div", { className: "pvx-round-podium-summary", children: a.map((o) => /* @__PURE__ */ l("span", { className: "pvx-round-podium-item", children: [
|
|
1796
|
-
/* @__PURE__ */ n("span", { children:
|
|
1796
|
+
/* @__PURE__ */ n("span", { children: oe[o.position - 1] }),
|
|
1797
1797
|
/* @__PURE__ */ n("span", { children: o.driverName })
|
|
1798
1798
|
] }, o.driverId)) })
|
|
1799
1799
|
] }),
|
|
1800
|
-
/* @__PURE__ */ n(
|
|
1800
|
+
/* @__PURE__ */ n(de, { round: e, competitionId: t })
|
|
1801
1801
|
] });
|
|
1802
1802
|
}
|
|
1803
|
-
function
|
|
1804
|
-
var
|
|
1805
|
-
return (
|
|
1803
|
+
function Rn({ leaderboard: e, config: t }) {
|
|
1804
|
+
var r;
|
|
1805
|
+
return (r = e == null ? void 0 : e.drivers) != null && r.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
|
|
1806
1806
|
/* @__PURE__ */ n("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ l("div", { children: [
|
|
1807
|
-
/* @__PURE__ */ n("h4", { className: "pvx-card-title", children: e.track || (
|
|
1807
|
+
/* @__PURE__ */ n("h4", { className: "pvx-card-title", children: e.track || (t == null ? void 0 : t.name) || "Hotlap Leaderboard" }),
|
|
1808
1808
|
/* @__PURE__ */ l("span", { className: "pvx-standings-subtitle", children: [
|
|
1809
1809
|
e.sessionsCompleted,
|
|
1810
1810
|
" session",
|
|
@@ -1825,12 +1825,12 @@ function Sn({ leaderboard: e, config: r }) {
|
|
|
1825
1825
|
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: e.drivers.map((s) => {
|
|
1826
1826
|
const a = s.position === 1 ? "" : `+${((s.bestLapMs - e.drivers[0].bestLapMs) / 1e3).toFixed(3)}`;
|
|
1827
1827
|
return /* @__PURE__ */ l("tr", { className: `pvx-row ${s.position <= 3 ? "pvx-row--podium" : ""}`, children: [
|
|
1828
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(
|
|
1828
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(ce, { position: s.position }) }),
|
|
1829
1829
|
/* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
|
|
1830
1830
|
/* @__PURE__ */ n(G, { nation: s.nation }),
|
|
1831
1831
|
s.driverName
|
|
1832
1832
|
] }),
|
|
1833
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children:
|
|
1833
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: B(s.carId) }),
|
|
1834
1834
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ n("span", { className: s.position === 1 ? "pvx-best-lap-cell--fastest" : "", children: s.bestLapFormatted }) }),
|
|
1835
1835
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: s.totalLaps }),
|
|
1836
1836
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: s.sessionsParticipated }),
|
|
@@ -1838,31 +1838,31 @@ function Sn({ leaderboard: e, config: r }) {
|
|
|
1838
1838
|
] }, s.driverId);
|
|
1839
1839
|
}) })
|
|
1840
1840
|
] }) })
|
|
1841
|
-
] }) : /* @__PURE__ */ n(
|
|
1841
|
+
] }) : /* @__PURE__ */ n(I, { message: "No lap times recorded yet." });
|
|
1842
1842
|
}
|
|
1843
|
-
function
|
|
1843
|
+
function Dn({ session: e, round: t, competitionId: r }) {
|
|
1844
1844
|
return e ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
|
|
1845
|
-
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n("h4", { className: "pvx-card-title", children:
|
|
1845
|
+
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n("h4", { className: "pvx-card-title", children: le(e.type) }) }),
|
|
1846
1846
|
/* @__PURE__ */ n(
|
|
1847
|
-
|
|
1847
|
+
de,
|
|
1848
1848
|
{
|
|
1849
|
-
round: { ...
|
|
1850
|
-
competitionId:
|
|
1849
|
+
round: { ...t, sessions: [e] },
|
|
1850
|
+
competitionId: r
|
|
1851
1851
|
}
|
|
1852
1852
|
)
|
|
1853
|
-
] }) : /* @__PURE__ */ n(
|
|
1853
|
+
] }) : /* @__PURE__ */ n(I, { message: "Session data not available." });
|
|
1854
1854
|
}
|
|
1855
|
-
function
|
|
1856
|
-
const { cdnUrl:
|
|
1855
|
+
function Mn(e) {
|
|
1856
|
+
const { cdnUrl: t } = C(), r = T({
|
|
1857
1857
|
queryKey: ["pitvox", "laps", "global", e, "index"],
|
|
1858
|
-
queryFn: () =>
|
|
1858
|
+
queryFn: () => $(t, me(null, e)),
|
|
1859
1859
|
enabled: !!e,
|
|
1860
1860
|
staleTime: 3e4,
|
|
1861
1861
|
refetchInterval: 3e4
|
|
1862
|
-
}), s =
|
|
1862
|
+
}), s = r.data;
|
|
1863
1863
|
return {
|
|
1864
|
-
isLoading:
|
|
1865
|
-
error:
|
|
1864
|
+
isLoading: r.isLoading,
|
|
1865
|
+
error: r.error,
|
|
1866
1866
|
data: s ? {
|
|
1867
1867
|
driverName: s.driverName || "Driver",
|
|
1868
1868
|
lapCount: s.lapCount || 0,
|
|
@@ -1878,72 +1878,112 @@ function Rn(e) {
|
|
|
1878
1878
|
} : null
|
|
1879
1879
|
};
|
|
1880
1880
|
}
|
|
1881
|
-
function
|
|
1882
|
-
const { cdnUrl:
|
|
1881
|
+
function Bn(e) {
|
|
1882
|
+
const { cdnUrl: t, partnerSlug: r } = C(), s = T({
|
|
1883
|
+
queryKey: ["pitvox", "laps", r || "global", e, "index"],
|
|
1884
|
+
queryFn: () => $(t, me(r, e)),
|
|
1885
|
+
enabled: !!e,
|
|
1886
|
+
staleTime: 3e4,
|
|
1887
|
+
refetchInterval: 3e4
|
|
1888
|
+
}), a = S(() => {
|
|
1889
|
+
var i;
|
|
1890
|
+
return ((i = s.data) == null ? void 0 : i.combos) || [];
|
|
1891
|
+
}, [s.data]);
|
|
1892
|
+
return {
|
|
1893
|
+
isLoading: s.isLoading,
|
|
1894
|
+
error: s.error,
|
|
1895
|
+
data: a
|
|
1896
|
+
};
|
|
1897
|
+
}
|
|
1898
|
+
function Be(e = {}) {
|
|
1899
|
+
const { cdnUrl: t, partnerSlug: r } = C(), { game: s, gameVersion: a, enabled: i = !0 } = e, o = ee(r, s, a, "ratings.json");
|
|
1883
1900
|
return T({
|
|
1884
|
-
queryKey: ["pitvox", "ratings",
|
|
1885
|
-
queryFn: () =>
|
|
1901
|
+
queryKey: ["pitvox", "ratings", r, s || null, a || null],
|
|
1902
|
+
queryFn: () => $(t, o),
|
|
1886
1903
|
staleTime: 3e4,
|
|
1887
1904
|
refetchInterval: 3e4,
|
|
1888
1905
|
enabled: i
|
|
1889
1906
|
});
|
|
1890
1907
|
}
|
|
1891
|
-
function
|
|
1908
|
+
function Ct(e) {
|
|
1892
1909
|
var s;
|
|
1893
|
-
const
|
|
1910
|
+
const t = Be(), r = S(() => {
|
|
1894
1911
|
var a;
|
|
1895
|
-
return !((a =
|
|
1912
|
+
return !((a = t.data) != null && a.drivers) || !e ? null : t.data.drivers.find(
|
|
1896
1913
|
(i) => i.identifier === e
|
|
1897
1914
|
) || null;
|
|
1898
|
-
}, [(s =
|
|
1915
|
+
}, [(s = t.data) == null ? void 0 : s.drivers, e]);
|
|
1899
1916
|
return {
|
|
1900
|
-
isLoading:
|
|
1901
|
-
error:
|
|
1902
|
-
data:
|
|
1903
|
-
rating:
|
|
1904
|
-
rank:
|
|
1905
|
-
totalDrivers:
|
|
1906
|
-
comboCount:
|
|
1907
|
-
distinctCars:
|
|
1908
|
-
combos:
|
|
1917
|
+
isLoading: t.isLoading,
|
|
1918
|
+
error: t.error,
|
|
1919
|
+
data: r ? {
|
|
1920
|
+
rating: r.rating,
|
|
1921
|
+
rank: r.rank,
|
|
1922
|
+
totalDrivers: t.data.driverCount || t.data.drivers.length,
|
|
1923
|
+
comboCount: r.comboCount || 0,
|
|
1924
|
+
distinctCars: r.distinctCars || 0,
|
|
1925
|
+
combos: r.combos || []
|
|
1909
1926
|
} : null
|
|
1910
1927
|
};
|
|
1911
1928
|
}
|
|
1912
|
-
function
|
|
1913
|
-
const
|
|
1929
|
+
function Z(e = {}) {
|
|
1930
|
+
const t = Be(e);
|
|
1914
1931
|
return {
|
|
1915
|
-
data:
|
|
1916
|
-
isLoading:
|
|
1917
|
-
error:
|
|
1932
|
+
data: t.data || null,
|
|
1933
|
+
isLoading: t.isLoading,
|
|
1934
|
+
error: t.error
|
|
1918
1935
|
};
|
|
1919
1936
|
}
|
|
1920
|
-
function
|
|
1921
|
-
|
|
1922
|
-
|
|
1937
|
+
function In(e) {
|
|
1938
|
+
var p, c;
|
|
1939
|
+
const { versions: t } = ze(), r = (p = t == null ? void 0 : t.evo) == null ? void 0 : p.default, s = (c = t == null ? void 0 : t.lmu) == null ? void 0 : c.default, a = Z({ game: "evo", gameVersion: r, enabled: !!r }), i = Z({ game: "acc" }), o = Z({ game: "lmu", gameVersion: s, enabled: !!s });
|
|
1940
|
+
return {
|
|
1941
|
+
data: S(() => e ? [
|
|
1942
|
+
{ data: a.data, game: "evo", label: "EVO" },
|
|
1943
|
+
{ data: i.data, game: "acc", label: "ACC" },
|
|
1944
|
+
{ data: o.data, game: "lmu", label: "LMU" }
|
|
1945
|
+
].map(({ data: u, game: x, label: f }) => {
|
|
1946
|
+
var g;
|
|
1947
|
+
if (!((g = u == null ? void 0 : u.drivers) != null && g.length)) return null;
|
|
1948
|
+
const h = [...u.drivers].sort((m, N) => N.rating - m.rating), b = h.findIndex((m) => m.identifier === e);
|
|
1949
|
+
return b === -1 ? null : {
|
|
1950
|
+
game: x,
|
|
1951
|
+
label: f,
|
|
1952
|
+
rating: h[b].rating,
|
|
1953
|
+
rank: b + 1,
|
|
1954
|
+
totalDrivers: h.length
|
|
1955
|
+
};
|
|
1956
|
+
}).filter(Boolean) : [], [e, a.data, i.data, o.data]),
|
|
1957
|
+
isLoading: a.isLoading || i.isLoading || o.isLoading
|
|
1958
|
+
};
|
|
1959
|
+
}
|
|
1960
|
+
function Pn() {
|
|
1961
|
+
const { cdnUrl: e, partnerSlug: t, getSteamId: r, onFetchServerPassword: s } = C(), a = r(), { data: i, isLoading: o } = T({
|
|
1962
|
+
queryKey: ["pitvox", "competitions", t],
|
|
1923
1963
|
queryFn: async () => {
|
|
1924
|
-
const
|
|
1925
|
-
return
|
|
1964
|
+
const h = await $(e, "competitions/index.json");
|
|
1965
|
+
return h != null && h.competitions ? h.competitions.filter((b) => b.partnerSlug === t) : [];
|
|
1926
1966
|
},
|
|
1927
1967
|
staleTime: 6e4
|
|
1928
|
-
}), d = (i == null ? void 0 : i.map((
|
|
1929
|
-
queries: d.map((
|
|
1930
|
-
queryKey: ["pitvox", "competition",
|
|
1931
|
-
queryFn: () =>
|
|
1968
|
+
}), d = (i == null ? void 0 : i.map((h) => h.id)) || [], p = pe({
|
|
1969
|
+
queries: d.map((h) => ({
|
|
1970
|
+
queryKey: ["pitvox", "competition", t, h, "entrylist"],
|
|
1971
|
+
queryFn: () => $(e, `competitions/${t}/${h}/entrylist.json`),
|
|
1932
1972
|
enabled: !!a && d.length > 0,
|
|
1933
1973
|
staleTime: 6e4
|
|
1934
1974
|
}))
|
|
1935
|
-
}), c = p.some((
|
|
1936
|
-
var
|
|
1975
|
+
}), c = p.some((h) => h.isLoading), u = S(() => {
|
|
1976
|
+
var g, m;
|
|
1937
1977
|
if (!i || !a || c) return [];
|
|
1938
|
-
const
|
|
1978
|
+
const h = /* @__PURE__ */ new Date(), b = [];
|
|
1939
1979
|
for (let N = 0; N < i.length; N++) {
|
|
1940
|
-
const v = i[N], k = (
|
|
1941
|
-
if (!((
|
|
1942
|
-
const L = v.type === "hotlap",
|
|
1943
|
-
for (const w of
|
|
1980
|
+
const v = i[N], k = (g = p[N]) == null ? void 0 : g.data;
|
|
1981
|
+
if (!((m = k == null ? void 0 : k.drivers) == null ? void 0 : m.some((w) => w.steamId === a))) continue;
|
|
1982
|
+
const L = v.type === "hotlap", D = v.rounds || [];
|
|
1983
|
+
for (const w of D) {
|
|
1944
1984
|
if (w.isFinalized && (!L || w.dediStatus === "completed")) continue;
|
|
1945
|
-
const
|
|
1946
|
-
!
|
|
1985
|
+
const U = w.dediStatus === "running" || w.dediStatus === "provisioning", Ie = w.dediStatus === "scheduled", Pe = w.startTime && new Date(w.startTime) > h, Ae = U || Ie || w.dediServerAddress;
|
|
1986
|
+
!U && !Pe && !Ae || b.push({
|
|
1947
1987
|
competitionId: v.id,
|
|
1948
1988
|
competitionName: v.name,
|
|
1949
1989
|
roundNumber: w.roundNumber,
|
|
@@ -1954,14 +1994,14 @@ function Mn() {
|
|
|
1954
1994
|
});
|
|
1955
1995
|
}
|
|
1956
1996
|
}
|
|
1957
|
-
return
|
|
1958
|
-
const k = N.dediStatus === "running" || N.dediStatus === "provisioning",
|
|
1959
|
-
return k && !
|
|
1960
|
-
}),
|
|
1961
|
-
}, [i, a, c, p]),
|
|
1962
|
-
queries: u.map((
|
|
1963
|
-
queryKey: ["pitvox", "serverInfo",
|
|
1964
|
-
queryFn: () => s(
|
|
1997
|
+
return b.sort((N, v) => {
|
|
1998
|
+
const k = N.dediStatus === "running" || N.dediStatus === "provisioning", y = v.dediStatus === "running" || v.dediStatus === "provisioning";
|
|
1999
|
+
return k && !y ? -1 : !k && y ? 1 : new Date(N.startTime) - new Date(v.startTime);
|
|
2000
|
+
}), b.length > 0 && (b[0].isNext = !0), b;
|
|
2001
|
+
}, [i, a, c, p]), x = pe({
|
|
2002
|
+
queries: u.map((h) => ({
|
|
2003
|
+
queryKey: ["pitvox", "serverInfo", h.competitionId, h.roundNumber],
|
|
2004
|
+
queryFn: () => s(h.competitionId, h.roundNumber),
|
|
1965
2005
|
enabled: !!s && u.length > 0,
|
|
1966
2006
|
staleTime: 5 * 6e4,
|
|
1967
2007
|
// 5 minutes
|
|
@@ -1969,45 +2009,45 @@ function Mn() {
|
|
|
1969
2009
|
}))
|
|
1970
2010
|
});
|
|
1971
2011
|
return {
|
|
1972
|
-
data: S(() => u.length ? s ? u.map((
|
|
1973
|
-
var
|
|
1974
|
-
const
|
|
1975
|
-
return
|
|
1976
|
-
...
|
|
1977
|
-
serverAddress:
|
|
1978
|
-
serverPassword:
|
|
1979
|
-
} :
|
|
1980
|
-
}) : u : [], [u, s,
|
|
2012
|
+
data: S(() => u.length ? s ? u.map((h, b) => {
|
|
2013
|
+
var m;
|
|
2014
|
+
const g = (m = x[b]) == null ? void 0 : m.data;
|
|
2015
|
+
return g != null && g.success ? {
|
|
2016
|
+
...h,
|
|
2017
|
+
serverAddress: g.serverAddress || null,
|
|
2018
|
+
serverPassword: g.serverPassword || null
|
|
2019
|
+
} : h;
|
|
2020
|
+
}) : u : [], [u, s, x]),
|
|
1981
2021
|
isLoading: o || !!a && c
|
|
1982
2022
|
};
|
|
1983
2023
|
}
|
|
1984
|
-
function
|
|
2024
|
+
function An() {
|
|
1985
2025
|
const { onFetchNotifications: e } = C();
|
|
1986
2026
|
return !!e;
|
|
1987
2027
|
}
|
|
1988
|
-
function
|
|
1989
|
-
const { onFetchNotifications:
|
|
2028
|
+
function Un(e = {}) {
|
|
2029
|
+
const { onFetchNotifications: t, partnerSlug: r } = C(), { limit: s = 20, unreadOnly: a = !1 } = e;
|
|
1990
2030
|
return T({
|
|
1991
|
-
queryKey: ["pitvox", "notifications",
|
|
1992
|
-
queryFn: () =>
|
|
1993
|
-
enabled: !!
|
|
2031
|
+
queryKey: ["pitvox", "notifications", r, { limit: s, unreadOnly: a }],
|
|
2032
|
+
queryFn: () => t({ limit: s, unreadOnly: a }),
|
|
2033
|
+
enabled: !!t,
|
|
1994
2034
|
staleTime: 3e4,
|
|
1995
2035
|
refetchInterval: 3e4
|
|
1996
2036
|
});
|
|
1997
2037
|
}
|
|
1998
|
-
function
|
|
1999
|
-
const { onFetchNotifications: e, partnerSlug:
|
|
2000
|
-
queryKey: ["pitvox", "notifications",
|
|
2038
|
+
function Lt() {
|
|
2039
|
+
const { onFetchNotifications: e, partnerSlug: t } = C(), { data: r, isLoading: s } = T({
|
|
2040
|
+
queryKey: ["pitvox", "notifications", t, { limit: 1, unreadOnly: !1 }],
|
|
2001
2041
|
queryFn: () => e({ limit: 1 }),
|
|
2002
2042
|
enabled: !!e,
|
|
2003
2043
|
staleTime: 3e4,
|
|
2004
2044
|
refetchInterval: 3e4,
|
|
2005
2045
|
select: (a) => (a == null ? void 0 : a.unreadCount) ?? 0
|
|
2006
2046
|
});
|
|
2007
|
-
return { count:
|
|
2047
|
+
return { count: r ?? 0, isLoading: s };
|
|
2008
2048
|
}
|
|
2009
|
-
function
|
|
2010
|
-
const { onMarkNotificationRead: e, partnerSlug:
|
|
2049
|
+
function Fn() {
|
|
2050
|
+
const { onMarkNotificationRead: e, partnerSlug: t } = C(), r = j();
|
|
2011
2051
|
return W({
|
|
2012
2052
|
mutationFn: (s) => {
|
|
2013
2053
|
if (!e)
|
|
@@ -2015,8 +2055,8 @@ function Pn() {
|
|
|
2015
2055
|
return e(s);
|
|
2016
2056
|
},
|
|
2017
2057
|
onSuccess: (s, a) => {
|
|
2018
|
-
|
|
2019
|
-
{ queryKey: ["pitvox", "notifications",
|
|
2058
|
+
r.setQueriesData(
|
|
2059
|
+
{ queryKey: ["pitvox", "notifications", t] },
|
|
2020
2060
|
(i) => i != null && i.notifications ? {
|
|
2021
2061
|
...i,
|
|
2022
2062
|
unreadCount: Math.max(0, (i.unreadCount || 0) - 1),
|
|
@@ -2028,8 +2068,8 @@ function Pn() {
|
|
|
2028
2068
|
}
|
|
2029
2069
|
});
|
|
2030
2070
|
}
|
|
2031
|
-
function
|
|
2032
|
-
const { onMarkAllNotificationsRead: e, partnerSlug:
|
|
2071
|
+
function En() {
|
|
2072
|
+
const { onMarkAllNotificationsRead: e, partnerSlug: t } = C(), r = j();
|
|
2033
2073
|
return W({
|
|
2034
2074
|
mutationFn: () => {
|
|
2035
2075
|
if (!e)
|
|
@@ -2037,8 +2077,8 @@ function Bn() {
|
|
|
2037
2077
|
return e();
|
|
2038
2078
|
},
|
|
2039
2079
|
onSuccess: () => {
|
|
2040
|
-
|
|
2041
|
-
{ queryKey: ["pitvox", "notifications",
|
|
2080
|
+
r.setQueriesData(
|
|
2081
|
+
{ queryKey: ["pitvox", "notifications", t] },
|
|
2042
2082
|
(s) => s != null && s.notifications ? {
|
|
2043
2083
|
...s,
|
|
2044
2084
|
unreadCount: 0,
|
|
@@ -2052,10 +2092,10 @@ function Bn() {
|
|
|
2052
2092
|
}
|
|
2053
2093
|
});
|
|
2054
2094
|
}
|
|
2055
|
-
function
|
|
2056
|
-
const a =
|
|
2095
|
+
function qn({ driverName: e, avatarUrl: t, memberSince: r, className: s = "" }) {
|
|
2096
|
+
const a = r ? new Date(r).toLocaleDateString("en-GB", { day: "2-digit", month: "2-digit", year: "numeric" }) : null;
|
|
2057
2097
|
return /* @__PURE__ */ l("div", { className: `pvx-card pvx-dash-profile ${s}`, children: [
|
|
2058
|
-
|
|
2098
|
+
t ? /* @__PURE__ */ n("img", { src: t, alt: "", className: "pvx-dash-profile-avatar" }) : /* @__PURE__ */ n("div", { className: "pvx-dash-profile-avatar pvx-dash-profile-avatar--placeholder", children: (e || "?")[0].toUpperCase() }),
|
|
2059
2099
|
/* @__PURE__ */ l("div", { className: "pvx-dash-profile-info", children: [
|
|
2060
2100
|
/* @__PURE__ */ n("h2", { className: "pvx-dash-profile-name", children: e }),
|
|
2061
2101
|
a && /* @__PURE__ */ l("p", { className: "pvx-dash-profile-since", children: [
|
|
@@ -2065,7 +2105,7 @@ function An({ driverName: e, avatarUrl: r, memberSince: t, className: s = "" })
|
|
|
2065
2105
|
] })
|
|
2066
2106
|
] });
|
|
2067
2107
|
}
|
|
2068
|
-
function
|
|
2108
|
+
function jn() {
|
|
2069
2109
|
return /* @__PURE__ */ l("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2070
2110
|
/* @__PURE__ */ n("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
|
|
2071
2111
|
/* @__PURE__ */ n("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
|
|
@@ -2073,7 +2113,7 @@ function Un() {
|
|
|
2073
2113
|
/* @__PURE__ */ n("line", { x1: "16", y1: "3", x2: "14", y2: "21" })
|
|
2074
2114
|
] });
|
|
2075
2115
|
}
|
|
2076
|
-
function
|
|
2116
|
+
function _n() {
|
|
2077
2117
|
return /* @__PURE__ */ l("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2078
2118
|
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2079
2119
|
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "2" }),
|
|
@@ -2082,19 +2122,19 @@ function Fn() {
|
|
|
2082
2122
|
/* @__PURE__ */ n("path", { d: "M13.5 12.5l4 2.5" })
|
|
2083
2123
|
] });
|
|
2084
2124
|
}
|
|
2085
|
-
function
|
|
2125
|
+
function he() {
|
|
2086
2126
|
return /* @__PURE__ */ n("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ n("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" }) });
|
|
2087
2127
|
}
|
|
2088
|
-
function
|
|
2089
|
-
const [o, d] =
|
|
2090
|
-
|
|
2128
|
+
function ve({ icon: e, value: t, label: r, items: s, labelKey: a, countKey: i }) {
|
|
2129
|
+
const [o, d] = M(!1), p = Ee(null);
|
|
2130
|
+
qe(() => {
|
|
2091
2131
|
if (!o) return;
|
|
2092
|
-
function u(
|
|
2093
|
-
p.current && !p.current.contains(
|
|
2132
|
+
function u(x) {
|
|
2133
|
+
p.current && !p.current.contains(x.target) && d(!1);
|
|
2094
2134
|
}
|
|
2095
2135
|
return document.addEventListener("mousedown", u), () => document.removeEventListener("mousedown", u);
|
|
2096
2136
|
}, [o]);
|
|
2097
|
-
const c = s != null && s.length ? s.slice().sort((u,
|
|
2137
|
+
const c = s != null && s.length ? s.slice().sort((u, x) => x[i] - u[i]) : null;
|
|
2098
2138
|
return /* @__PURE__ */ l(
|
|
2099
2139
|
"div",
|
|
2100
2140
|
{
|
|
@@ -2104,110 +2144,195 @@ function pe({ icon: e, value: r, label: t, items: s, labelKey: a, countKey: i })
|
|
|
2104
2144
|
children: [
|
|
2105
2145
|
e,
|
|
2106
2146
|
/* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
|
|
2107
|
-
/* @__PURE__ */ n("span", { className: "pvx-dash-stat-value", children:
|
|
2108
|
-
/* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children:
|
|
2147
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-stat-value", children: t }),
|
|
2148
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: r })
|
|
2109
2149
|
] }),
|
|
2110
|
-
c && /* @__PURE__ */ n("div", { className: `pvx-dash-tooltip pvx-dash-tooltip--scrollable ${o ? "pvx-dash-tooltip--open" : ""}`, children: c.map((u,
|
|
2150
|
+
c && /* @__PURE__ */ n("div", { className: `pvx-dash-tooltip pvx-dash-tooltip--scrollable ${o ? "pvx-dash-tooltip--open" : ""}`, children: c.map((u, x) => /* @__PURE__ */ l("div", { className: "pvx-dash-tooltip-row", children: [
|
|
2111
2151
|
/* @__PURE__ */ n("span", { className: "pvx-dash-tooltip-label", children: u[a] }),
|
|
2112
2152
|
/* @__PURE__ */ n("span", { className: "pvx-dash-tooltip-value", children: u[i] })
|
|
2113
|
-
] },
|
|
2153
|
+
] }, x)) })
|
|
2114
2154
|
]
|
|
2115
2155
|
}
|
|
2116
2156
|
);
|
|
2117
2157
|
}
|
|
2118
|
-
function
|
|
2158
|
+
function Vn({ stats: e, gameRatings: t, onGameRatingSelect: r, rating: s, className: a = "" }) {
|
|
2119
2159
|
if (!e) return null;
|
|
2120
|
-
const
|
|
2121
|
-
name:
|
|
2122
|
-
lapCount:
|
|
2123
|
-
})),
|
|
2124
|
-
name:
|
|
2125
|
-
lapCount:
|
|
2126
|
-
}));
|
|
2127
|
-
return /* @__PURE__ */ l("div", { className: `pvx-dash-stats ${
|
|
2160
|
+
const i = e.trackBreakdown.map((p) => ({
|
|
2161
|
+
name: E(p.trackId, p.layout),
|
|
2162
|
+
lapCount: p.lapCount
|
|
2163
|
+
})), o = e.carBreakdown.map((p) => ({
|
|
2164
|
+
name: B(p.carId),
|
|
2165
|
+
lapCount: p.lapCount
|
|
2166
|
+
})), d = Array.isArray(t) && t.length > 0;
|
|
2167
|
+
return /* @__PURE__ */ l("div", { className: `pvx-dash-stats ${a}`, children: [
|
|
2128
2168
|
/* @__PURE__ */ n(
|
|
2129
|
-
|
|
2169
|
+
ve,
|
|
2130
2170
|
{
|
|
2131
|
-
icon: /* @__PURE__ */ n(
|
|
2171
|
+
icon: /* @__PURE__ */ n(jn, {}),
|
|
2132
2172
|
value: e.lapCount.toLocaleString(),
|
|
2133
2173
|
label: "Total Laps",
|
|
2134
|
-
items:
|
|
2174
|
+
items: i,
|
|
2135
2175
|
labelKey: "name",
|
|
2136
2176
|
countKey: "lapCount"
|
|
2137
2177
|
}
|
|
2138
2178
|
),
|
|
2139
2179
|
/* @__PURE__ */ n(
|
|
2140
|
-
|
|
2180
|
+
ve,
|
|
2141
2181
|
{
|
|
2142
|
-
icon: /* @__PURE__ */ n(
|
|
2182
|
+
icon: /* @__PURE__ */ n(_n, {}),
|
|
2143
2183
|
value: e.carBreakdown.length,
|
|
2144
2184
|
label: "Cars Used",
|
|
2145
|
-
items:
|
|
2185
|
+
items: o,
|
|
2146
2186
|
labelKey: "name",
|
|
2147
2187
|
countKey: "lapCount"
|
|
2148
2188
|
}
|
|
2149
2189
|
),
|
|
2150
|
-
|
|
2151
|
-
/* @__PURE__ */ n(
|
|
2190
|
+
d ? /* @__PURE__ */ l("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--rating-chips", children: [
|
|
2191
|
+
/* @__PURE__ */ n(he, {}),
|
|
2152
2192
|
/* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
|
|
2153
|
-
/* @__PURE__ */ n("span", { className: "pvx-dash-stat-
|
|
2193
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: "Driver Rating" }),
|
|
2194
|
+
/* @__PURE__ */ n("div", { className: "pvx-dash-rating-chips", children: t.map((p) => {
|
|
2195
|
+
const c = !!r;
|
|
2196
|
+
return /* @__PURE__ */ l(
|
|
2197
|
+
"span",
|
|
2198
|
+
{
|
|
2199
|
+
className: `pvx-dash-rating-chip${c ? " pvx-dash-rating-chip--clickable" : ""}`,
|
|
2200
|
+
onClick: c ? () => r(p) : void 0,
|
|
2201
|
+
onKeyDown: c ? (x) => {
|
|
2202
|
+
c && (x.key === "Enter" || x.key === " ") && (x.preventDefault(), r(p));
|
|
2203
|
+
} : void 0,
|
|
2204
|
+
role: c ? "button" : void 0,
|
|
2205
|
+
tabIndex: c ? 0 : void 0,
|
|
2206
|
+
title: `${p.label} rating: ${p.rating.toFixed(1)} (#${p.rank} of ${p.totalDrivers})`,
|
|
2207
|
+
children: [
|
|
2208
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-rating-chip-label", children: p.label }),
|
|
2209
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-rating-chip-value", children: p.rating.toFixed(1) }),
|
|
2210
|
+
/* @__PURE__ */ l("span", { className: "pvx-dash-rating-chip-rank", children: [
|
|
2211
|
+
"#",
|
|
2212
|
+
p.rank,
|
|
2213
|
+
"/",
|
|
2214
|
+
p.totalDrivers
|
|
2215
|
+
] })
|
|
2216
|
+
]
|
|
2217
|
+
},
|
|
2218
|
+
p.game
|
|
2219
|
+
);
|
|
2220
|
+
}) })
|
|
2221
|
+
] })
|
|
2222
|
+
] }) : s ? /* @__PURE__ */ l("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--rating", children: [
|
|
2223
|
+
/* @__PURE__ */ n(he, {}),
|
|
2224
|
+
/* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
|
|
2225
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-stat-value", children: s.rating.toFixed(1) }),
|
|
2154
2226
|
/* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: "Driver Rating" }),
|
|
2155
2227
|
/* @__PURE__ */ l("span", { className: "pvx-dash-stat-sub", children: [
|
|
2156
2228
|
"#",
|
|
2157
|
-
|
|
2229
|
+
s.rank,
|
|
2158
2230
|
" of ",
|
|
2159
|
-
|
|
2231
|
+
s.totalDrivers
|
|
2160
2232
|
] })
|
|
2161
2233
|
] })
|
|
2162
|
-
] })
|
|
2234
|
+
] }) : null
|
|
2163
2235
|
] });
|
|
2164
2236
|
}
|
|
2165
|
-
function
|
|
2166
|
-
|
|
2167
|
-
const i = s.recordedAt ? new Date(s.recordedAt).getTime() : 0;
|
|
2168
|
-
return (a.recordedAt ? new Date(a.recordedAt).getTime() : 0) - i;
|
|
2169
|
-
}) : [], [e]);
|
|
2170
|
-
return t.length ? /* @__PURE__ */ l("div", { className: `pvx-card ${r}`, children: [
|
|
2237
|
+
function Kn({ combos: e, onComboSelect: t, className: r = "" }) {
|
|
2238
|
+
return e != null && e.length ? /* @__PURE__ */ l("div", { className: `pvx-card ${r}`, children: [
|
|
2171
2239
|
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
|
|
2172
|
-
/* @__PURE__ */ n("span", { className: "pvx-dash-
|
|
2173
|
-
/* @__PURE__ */ n("
|
|
2174
|
-
/* @__PURE__ */ n("
|
|
2175
|
-
/* @__PURE__ */ n("path", { d: "M4 22h16" }),
|
|
2176
|
-
/* @__PURE__ */ n("path", { d: "M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20 7 22" }),
|
|
2177
|
-
/* @__PURE__ */ n("path", { d: "M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20 17 22" }),
|
|
2178
|
-
/* @__PURE__ */ n("path", { d: "M18 2H6v7a6 6 0 0012 0V2z" })
|
|
2240
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-combos-icon", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2241
|
+
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2242
|
+
/* @__PURE__ */ n("polyline", { points: "12 6 12 12 16 14" })
|
|
2179
2243
|
] }) }),
|
|
2180
|
-
"
|
|
2181
|
-
/* @__PURE__ */ l("span", { className: "pvx-dash-
|
|
2244
|
+
"Recent Combos",
|
|
2245
|
+
/* @__PURE__ */ l("span", { className: "pvx-dash-combos-count", children: [
|
|
2182
2246
|
"(",
|
|
2183
|
-
|
|
2247
|
+
e.length,
|
|
2184
2248
|
")"
|
|
2185
2249
|
] })
|
|
2186
2250
|
] }) }),
|
|
2187
|
-
/* @__PURE__ */ n("div", { className: "pvx-dash-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
(s.game || "evo").toUpperCase(),
|
|
2196
|
-
s.gameVersion ? ` ${s.gameVersion}` : ""
|
|
2197
|
-
] })
|
|
2198
|
-
] })
|
|
2199
|
-
] }, a)) })
|
|
2251
|
+
/* @__PURE__ */ n("div", { className: "pvx-dash-combos-list", children: e.map((s) => /* @__PURE__ */ n(
|
|
2252
|
+
Hn,
|
|
2253
|
+
{
|
|
2254
|
+
combo: s,
|
|
2255
|
+
onClick: t ? () => t(s) : null
|
|
2256
|
+
},
|
|
2257
|
+
`${s.trackId}|${s.trackLayout || ""}|${s.carId}|${s.game || ""}|${s.gameVersion || ""}`
|
|
2258
|
+
)) })
|
|
2200
2259
|
] }) : null;
|
|
2201
2260
|
}
|
|
2202
|
-
function
|
|
2203
|
-
|
|
2261
|
+
function Hn({ combo: e, onClick: t }) {
|
|
2262
|
+
const r = e.game || "evo", s = e.gapToLeaderMs && e.gapToLeaderMs > 0 ? (e.gapToLeaderMs / 1e3).toFixed(3) : null, a = e.rank === 1 && e.totalDrivers > 1;
|
|
2263
|
+
return /* @__PURE__ */ l(
|
|
2264
|
+
"div",
|
|
2265
|
+
{
|
|
2266
|
+
className: `pvx-dash-combo-row${t ? " pvx-dash-combo-row--clickable" : ""}`,
|
|
2267
|
+
onClick: t || void 0,
|
|
2268
|
+
onKeyDown: t ? (d) => {
|
|
2269
|
+
t && (d.key === "Enter" || d.key === " ") && (d.preventDefault(), t());
|
|
2270
|
+
} : void 0,
|
|
2271
|
+
role: t ? "button" : void 0,
|
|
2272
|
+
tabIndex: t ? 0 : void 0,
|
|
2273
|
+
children: [
|
|
2274
|
+
/* @__PURE__ */ l("div", { className: "pvx-dash-combo-info", children: [
|
|
2275
|
+
/* @__PURE__ */ l("div", { className: "pvx-dash-combo-title", children: [
|
|
2276
|
+
e.game && /* @__PURE__ */ n("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${r}`, children: r.toUpperCase() }),
|
|
2277
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-combo-track", children: E(e.trackId, e.trackLayout, e.game) })
|
|
2278
|
+
] }),
|
|
2279
|
+
/* @__PURE__ */ l("div", { className: "pvx-dash-combo-meta", children: [
|
|
2280
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-combo-car", children: B(e.carId) }),
|
|
2281
|
+
e.lapCount > 0 && /* @__PURE__ */ l(F, { children: [
|
|
2282
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-combo-meta-sep", children: "·" }),
|
|
2283
|
+
/* @__PURE__ */ l("span", { children: [
|
|
2284
|
+
e.lapCount,
|
|
2285
|
+
" ",
|
|
2286
|
+
e.lapCount === 1 ? "lap" : "laps"
|
|
2287
|
+
] })
|
|
2288
|
+
] }),
|
|
2289
|
+
e.lastDrivenAt && /* @__PURE__ */ l(F, { children: [
|
|
2290
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-combo-meta-sep", children: "·" }),
|
|
2291
|
+
/* @__PURE__ */ n("span", { children: ne(e.lastDrivenAt) })
|
|
2292
|
+
] })
|
|
2293
|
+
] })
|
|
2294
|
+
] }),
|
|
2295
|
+
/* @__PURE__ */ l("div", { className: "pvx-dash-combo-stats", children: [
|
|
2296
|
+
e.rank ? /* @__PURE__ */ l("span", { className: "pvx-dash-combo-rank", children: [
|
|
2297
|
+
a && /* @__PURE__ */ n("span", { className: "pvx-dash-combo-trophy", "aria-label": "Leader", title: "Leader", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2298
|
+
/* @__PURE__ */ n("path", { d: "M6 9H4.5a2.5 2.5 0 010-5H6" }),
|
|
2299
|
+
/* @__PURE__ */ n("path", { d: "M18 9h1.5a2.5 2.5 0 000-5H18" }),
|
|
2300
|
+
/* @__PURE__ */ n("path", { d: "M4 22h16" }),
|
|
2301
|
+
/* @__PURE__ */ n("path", { d: "M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20 7 22" }),
|
|
2302
|
+
/* @__PURE__ */ n("path", { d: "M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20 17 22" }),
|
|
2303
|
+
/* @__PURE__ */ n("path", { d: "M18 2H6v7a6 6 0 0012 0V2z" })
|
|
2304
|
+
] }) }),
|
|
2305
|
+
/* @__PURE__ */ l("span", { className: "pvx-dash-combo-rank-text", children: [
|
|
2306
|
+
"P",
|
|
2307
|
+
e.rank,
|
|
2308
|
+
e.totalDrivers ? /* @__PURE__ */ l("span", { className: "pvx-dash-combo-rank-total", children: [
|
|
2309
|
+
"/",
|
|
2310
|
+
e.totalDrivers
|
|
2311
|
+
] }) : null
|
|
2312
|
+
] })
|
|
2313
|
+
] }) : e.totalDrivers ? /* @__PURE__ */ l("span", { className: "pvx-dash-combo-rank-text pvx-dash-combo-rank-text--muted", children: [
|
|
2314
|
+
e.totalDrivers,
|
|
2315
|
+
" on leaderboard"
|
|
2316
|
+
] }) : null,
|
|
2317
|
+
s && /* @__PURE__ */ l("span", { className: "pvx-dash-combo-gap", children: [
|
|
2318
|
+
"+",
|
|
2319
|
+
s
|
|
2320
|
+
] }),
|
|
2321
|
+
e.personalBestMs && /* @__PURE__ */ n("span", { className: "pvx-dash-combo-pb", children: A(e.personalBestMs) })
|
|
2322
|
+
] })
|
|
2323
|
+
]
|
|
2324
|
+
}
|
|
2325
|
+
);
|
|
2326
|
+
}
|
|
2327
|
+
function Wn({ events: e, isLoading: t, className: r, limit: s = 3 }) {
|
|
2328
|
+
if (t)
|
|
2204
2329
|
return /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading upcoming events..." });
|
|
2205
2330
|
if (!(e != null && e.length))
|
|
2206
2331
|
return null;
|
|
2207
2332
|
const a = s ? e.slice(0, s) : e, i = e.length - a.length;
|
|
2208
|
-
return /* @__PURE__ */ l("div", { className: `pvx-card ${
|
|
2333
|
+
return /* @__PURE__ */ l("div", { className: `pvx-card ${r || ""}`, children: [
|
|
2209
2334
|
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
|
|
2210
|
-
/* @__PURE__ */ n(
|
|
2335
|
+
/* @__PURE__ */ n(Qn, {}),
|
|
2211
2336
|
"Upcoming Events",
|
|
2212
2337
|
/* @__PURE__ */ l("span", { className: "pvx-dash-records-count", children: [
|
|
2213
2338
|
"(",
|
|
@@ -2230,7 +2355,7 @@ function _n({ events: e, isLoading: r, className: t, limit: s = 3 }) {
|
|
|
2230
2355
|
o.track
|
|
2231
2356
|
] }),
|
|
2232
2357
|
o.serverPassword && /* @__PURE__ */ n(
|
|
2233
|
-
|
|
2358
|
+
On,
|
|
2234
2359
|
{
|
|
2235
2360
|
password: o.serverPassword,
|
|
2236
2361
|
address: o.serverAddress
|
|
@@ -2243,7 +2368,7 @@ function _n({ events: e, isLoading: r, className: t, limit: s = 3 }) {
|
|
|
2243
2368
|
month: "short",
|
|
2244
2369
|
year: "numeric"
|
|
2245
2370
|
}) }),
|
|
2246
|
-
/* @__PURE__ */ n("span", { className: "pvx-upcoming-relative", children: o.dediStatus === "running" ? "Live now" : o.dediStatus === "provisioning" ? "Starting..." :
|
|
2371
|
+
/* @__PURE__ */ n("span", { className: "pvx-upcoming-relative", children: o.dediStatus === "running" ? "Live now" : o.dediStatus === "provisioning" ? "Starting..." : zn(o.startTime) }),
|
|
2247
2372
|
o.dediStatus === "running" && /* @__PURE__ */ n("span", { className: "pvx-upcoming-badge pvx-upcoming-badge--live", children: "Live" }),
|
|
2248
2373
|
!o.dediStatus && o.isNext && /* @__PURE__ */ n("span", { className: "pvx-upcoming-badge", children: "Next" })
|
|
2249
2374
|
] })
|
|
@@ -2260,8 +2385,8 @@ function _n({ events: e, isLoading: r, className: t, limit: s = 3 }) {
|
|
|
2260
2385
|
] })
|
|
2261
2386
|
] });
|
|
2262
2387
|
}
|
|
2263
|
-
function
|
|
2264
|
-
const [
|
|
2388
|
+
function On({ password: e, address: t }) {
|
|
2389
|
+
const [r, s] = M(!1), [a, i] = M(!1), o = t ? e ? `join:${t}|${e}` : `join:${t}` : null, d = H(async () => {
|
|
2265
2390
|
if (o)
|
|
2266
2391
|
try {
|
|
2267
2392
|
await navigator.clipboard.writeText(o), s(!0), setTimeout(() => s(!1), 2e3);
|
|
@@ -2276,9 +2401,9 @@ function Vn({ password: e, address: r }) {
|
|
|
2276
2401
|
onClick: d,
|
|
2277
2402
|
title: "Copy join string to clipboard",
|
|
2278
2403
|
children: [
|
|
2279
|
-
/* @__PURE__ */ n(
|
|
2404
|
+
/* @__PURE__ */ n(Yn, {}),
|
|
2280
2405
|
" ",
|
|
2281
|
-
|
|
2406
|
+
r ? "Copied!" : "Join"
|
|
2282
2407
|
]
|
|
2283
2408
|
}
|
|
2284
2409
|
),
|
|
@@ -2289,87 +2414,87 @@ function Vn({ password: e, address: r }) {
|
|
|
2289
2414
|
className: "pvx-server-detail pvx-server-detail--clickable",
|
|
2290
2415
|
onClick: () => i((p) => !p),
|
|
2291
2416
|
title: a ? "Hide password" : "Reveal password",
|
|
2292
|
-
children: a ? /* @__PURE__ */ n(
|
|
2417
|
+
children: a ? /* @__PURE__ */ n(Zn, {}) : /* @__PURE__ */ n(Jn, {})
|
|
2293
2418
|
}
|
|
2294
2419
|
),
|
|
2295
2420
|
a && /* @__PURE__ */ l("span", { className: "pvx-server-detail", children: [
|
|
2296
|
-
/* @__PURE__ */ n(
|
|
2421
|
+
/* @__PURE__ */ n(Gn, {}),
|
|
2297
2422
|
" ",
|
|
2298
2423
|
e
|
|
2299
2424
|
] })
|
|
2300
2425
|
] })
|
|
2301
2426
|
] });
|
|
2302
2427
|
}
|
|
2303
|
-
function
|
|
2304
|
-
const
|
|
2305
|
-
if (
|
|
2306
|
-
const
|
|
2307
|
-
if (
|
|
2308
|
-
if (
|
|
2309
|
-
const s = Math.floor(
|
|
2428
|
+
function zn(e) {
|
|
2429
|
+
const t = new Date(e).getTime() - Date.now();
|
|
2430
|
+
if (t <= 0) return "Now";
|
|
2431
|
+
const r = Math.floor(t / (1e3 * 60 * 60));
|
|
2432
|
+
if (r < 1) return "Less than 1 hour";
|
|
2433
|
+
if (r < 24) return `in ${r}h`;
|
|
2434
|
+
const s = Math.floor(r / 24);
|
|
2310
2435
|
if (s === 1) return "Tomorrow";
|
|
2311
2436
|
if (s < 7) return `in ${s} days`;
|
|
2312
2437
|
if (s < 30) {
|
|
2313
2438
|
const a = Math.floor(s / 7);
|
|
2314
2439
|
return `in ${a} week${a !== 1 ? "s" : ""}`;
|
|
2315
2440
|
}
|
|
2316
|
-
return
|
|
2441
|
+
return ne(e);
|
|
2317
2442
|
}
|
|
2318
|
-
function
|
|
2443
|
+
function Qn() {
|
|
2319
2444
|
return /* @__PURE__ */ l("svg", { className: "pvx-dash-records-icon", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2320
2445
|
/* @__PURE__ */ n("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
|
|
2321
2446
|
/* @__PURE__ */ n("path", { d: "M16 2v4M8 2v4M3 10h18" })
|
|
2322
2447
|
] });
|
|
2323
2448
|
}
|
|
2324
|
-
function
|
|
2449
|
+
function Gn() {
|
|
2325
2450
|
return /* @__PURE__ */ l("svg", { className: "pvx-server-icon", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2326
2451
|
/* @__PURE__ */ n("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2" }),
|
|
2327
2452
|
/* @__PURE__ */ n("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
|
|
2328
2453
|
] });
|
|
2329
2454
|
}
|
|
2330
|
-
function
|
|
2455
|
+
function Yn() {
|
|
2331
2456
|
return /* @__PURE__ */ l("svg", { className: "pvx-server-icon pvx-server-icon--action", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2332
2457
|
/* @__PURE__ */ n("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
|
|
2333
2458
|
/* @__PURE__ */ n("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
2334
2459
|
] });
|
|
2335
2460
|
}
|
|
2336
|
-
function
|
|
2461
|
+
function Jn() {
|
|
2337
2462
|
return /* @__PURE__ */ l("svg", { className: "pvx-server-icon pvx-server-icon--action", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2338
2463
|
/* @__PURE__ */ n("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
|
|
2339
2464
|
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "3" })
|
|
2340
2465
|
] });
|
|
2341
2466
|
}
|
|
2342
|
-
function
|
|
2467
|
+
function Zn() {
|
|
2343
2468
|
return /* @__PURE__ */ l("svg", { className: "pvx-server-icon pvx-server-icon--action", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2344
2469
|
/* @__PURE__ */ n("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }),
|
|
2345
2470
|
/* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
2346
2471
|
] });
|
|
2347
2472
|
}
|
|
2348
|
-
function
|
|
2349
|
-
const o =
|
|
2473
|
+
function Xn({ notifications: e, unreadCount: t = 0, onMarkRead: r, onMarkAllRead: s, isLoading: a, className: i }) {
|
|
2474
|
+
const o = fe();
|
|
2350
2475
|
return a ? /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading notifications..." }) : /* @__PURE__ */ l("div", { className: `pvx-card ${i || ""}`, children: [
|
|
2351
2476
|
/* @__PURE__ */ l("div", { className: "pvx-card-header", children: [
|
|
2352
2477
|
/* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
|
|
2353
|
-
/* @__PURE__ */ n(
|
|
2478
|
+
/* @__PURE__ */ n(tt, {}),
|
|
2354
2479
|
"Notifications",
|
|
2355
|
-
|
|
2480
|
+
t > 0 && /* @__PURE__ */ n("span", { className: "pvx-notif-badge", children: t > 99 ? "99+" : t })
|
|
2356
2481
|
] }),
|
|
2357
|
-
|
|
2482
|
+
t > 0 && s && /* @__PURE__ */ n("button", { className: "pvx-notif-mark-all", onClick: s, children: "Mark all read" })
|
|
2358
2483
|
] }),
|
|
2359
2484
|
e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-notif-list", children: e.map((d) => /* @__PURE__ */ n(
|
|
2360
|
-
|
|
2485
|
+
et,
|
|
2361
2486
|
{
|
|
2362
2487
|
notification: d,
|
|
2363
2488
|
getUserDisplay: o,
|
|
2364
|
-
onMarkRead:
|
|
2489
|
+
onMarkRead: r
|
|
2365
2490
|
},
|
|
2366
2491
|
d.id
|
|
2367
2492
|
)) }) : /* @__PURE__ */ n("div", { className: "pvx-notif-empty", children: "No notifications" })
|
|
2368
2493
|
] });
|
|
2369
2494
|
}
|
|
2370
|
-
function
|
|
2495
|
+
function et({ notification: e, getUserDisplay: t, onMarkRead: r }) {
|
|
2371
2496
|
const s = () => {
|
|
2372
|
-
!e.isRead &&
|
|
2497
|
+
!e.isRead && r && r(e.id);
|
|
2373
2498
|
};
|
|
2374
2499
|
return /* @__PURE__ */ l(
|
|
2375
2500
|
"button",
|
|
@@ -2377,17 +2502,17 @@ function Yn({ notification: e, getUserDisplay: r, onMarkRead: t }) {
|
|
|
2377
2502
|
className: `pvx-notif-item ${e.isRead ? "" : "pvx-notif-item--unread"}`,
|
|
2378
2503
|
onClick: s,
|
|
2379
2504
|
children: [
|
|
2380
|
-
/* @__PURE__ */ n(
|
|
2505
|
+
/* @__PURE__ */ n(nt, { type: e.type }),
|
|
2381
2506
|
/* @__PURE__ */ l("div", { className: "pvx-notif-content", children: [
|
|
2382
|
-
/* @__PURE__ */ n("span", { className: "pvx-notif-message", children:
|
|
2383
|
-
/* @__PURE__ */ n("span", { className: "pvx-notif-time", children:
|
|
2507
|
+
/* @__PURE__ */ n("span", { className: "pvx-notif-message", children: Oe(e, t) }),
|
|
2508
|
+
/* @__PURE__ */ n("span", { className: "pvx-notif-time", children: ne(e.createdAt) })
|
|
2384
2509
|
] }),
|
|
2385
2510
|
!e.isRead && /* @__PURE__ */ n("span", { className: "pvx-notif-dot" })
|
|
2386
2511
|
]
|
|
2387
2512
|
}
|
|
2388
2513
|
);
|
|
2389
2514
|
}
|
|
2390
|
-
function
|
|
2515
|
+
function nt({ type: e }) {
|
|
2391
2516
|
return e === "RECORD_BEATEN" ? /* @__PURE__ */ n("span", { className: "pvx-notif-icon pvx-notif-icon--beaten", children: /* @__PURE__ */ n("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ n("path", { d: "m7 7 10 10M17 7v10H7" }) }) }) : e === "ADMIN_MESSAGE" ? /* @__PURE__ */ n("span", { className: "pvx-notif-icon pvx-notif-icon--admin", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2392
2517
|
/* @__PURE__ */ n("path", { d: "m3 11 18-5v12L3 13v-2z" }),
|
|
2393
2518
|
/* @__PURE__ */ n("path", { d: "M11.6 16.8a3 3 0 1 1-5.8-1.6" })
|
|
@@ -2400,118 +2525,172 @@ function Jn({ type: e }) {
|
|
|
2400
2525
|
/* @__PURE__ */ n("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
|
|
2401
2526
|
] }) });
|
|
2402
2527
|
}
|
|
2403
|
-
function
|
|
2528
|
+
function tt() {
|
|
2404
2529
|
return /* @__PURE__ */ l("svg", { className: "pvx-dash-records-icon", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2405
2530
|
/* @__PURE__ */ n("path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" }),
|
|
2406
2531
|
/* @__PURE__ */ n("path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0" })
|
|
2407
2532
|
] });
|
|
2408
2533
|
}
|
|
2409
|
-
function
|
|
2410
|
-
|
|
2411
|
-
|
|
2534
|
+
function St({
|
|
2535
|
+
steamId: e,
|
|
2536
|
+
avatarUrl: t,
|
|
2537
|
+
memberSince: r,
|
|
2538
|
+
onComboSelect: s,
|
|
2539
|
+
onGameRatingSelect: a,
|
|
2540
|
+
className: i = ""
|
|
2541
|
+
}) {
|
|
2542
|
+
const { data: o, isLoading: d, error: p } = Mn(e), { data: c } = In(e), { data: u } = Bn(e), { data: x, isLoading: f } = Pn(), h = An(), { data: b, isLoading: g } = Un({ limit: 10 }), m = Fn(), N = En();
|
|
2543
|
+
return d ? /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading dashboard..." }) : p ? /* @__PURE__ */ n("div", { className: "pvx-empty", children: "Failed to load dashboard data." }) : o ? /* @__PURE__ */ l("div", { className: `pvx-dash ${i}`, children: [
|
|
2544
|
+
/* @__PURE__ */ n(
|
|
2545
|
+
qn,
|
|
2546
|
+
{
|
|
2547
|
+
driverName: o.driverName,
|
|
2548
|
+
avatarUrl: t,
|
|
2549
|
+
memberSince: r
|
|
2550
|
+
}
|
|
2551
|
+
),
|
|
2412
2552
|
/* @__PURE__ */ n(
|
|
2413
|
-
|
|
2553
|
+
Vn,
|
|
2414
2554
|
{
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2555
|
+
stats: o,
|
|
2556
|
+
gameRatings: c,
|
|
2557
|
+
onGameRatingSelect: a
|
|
2418
2558
|
}
|
|
2419
2559
|
),
|
|
2420
|
-
/* @__PURE__ */ n(
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
/* @__PURE__ */ n(
|
|
2424
|
-
|
|
2425
|
-
Gn,
|
|
2560
|
+
e && /* @__PURE__ */ n(Wn, { events: x, isLoading: f }),
|
|
2561
|
+
/* @__PURE__ */ l("div", { className: `pvx-dash-row ${h ? "pvx-dash-row--2col" : ""}`, children: [
|
|
2562
|
+
/* @__PURE__ */ n(Kn, { combos: u, onComboSelect: s }),
|
|
2563
|
+
h && /* @__PURE__ */ n(
|
|
2564
|
+
Xn,
|
|
2426
2565
|
{
|
|
2427
|
-
notifications:
|
|
2428
|
-
unreadCount: (
|
|
2429
|
-
onMarkRead: (
|
|
2430
|
-
onMarkAllRead: () =>
|
|
2431
|
-
isLoading:
|
|
2566
|
+
notifications: b == null ? void 0 : b.notifications,
|
|
2567
|
+
unreadCount: (b == null ? void 0 : b.unreadCount) || 0,
|
|
2568
|
+
onMarkRead: (v) => m.mutate(v),
|
|
2569
|
+
onMarkAllRead: () => N.mutate(),
|
|
2570
|
+
isLoading: g
|
|
2432
2571
|
}
|
|
2433
2572
|
)
|
|
2434
2573
|
] })
|
|
2435
2574
|
] }) : /* @__PURE__ */ n("div", { className: "pvx-empty", children: "No data available yet. Start driving to see your stats!" });
|
|
2436
2575
|
}
|
|
2576
|
+
function Tt({ records: e, className: t = "" }) {
|
|
2577
|
+
const r = S(() => e != null && e.length ? e.slice().sort((s, a) => {
|
|
2578
|
+
const i = s.recordedAt ? new Date(s.recordedAt).getTime() : 0;
|
|
2579
|
+
return (a.recordedAt ? new Date(a.recordedAt).getTime() : 0) - i;
|
|
2580
|
+
}) : [], [e]);
|
|
2581
|
+
return r.length ? /* @__PURE__ */ l("div", { className: `pvx-card ${t}`, children: [
|
|
2582
|
+
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
|
|
2583
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-records-icon", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2584
|
+
/* @__PURE__ */ n("path", { d: "M6 9H4.5a2.5 2.5 0 010-5H6" }),
|
|
2585
|
+
/* @__PURE__ */ n("path", { d: "M18 9h1.5a2.5 2.5 0 000-5H18" }),
|
|
2586
|
+
/* @__PURE__ */ n("path", { d: "M4 22h16" }),
|
|
2587
|
+
/* @__PURE__ */ n("path", { d: "M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20 7 22" }),
|
|
2588
|
+
/* @__PURE__ */ n("path", { d: "M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20 17 22" }),
|
|
2589
|
+
/* @__PURE__ */ n("path", { d: "M18 2H6v7a6 6 0 0012 0V2z" })
|
|
2590
|
+
] }) }),
|
|
2591
|
+
"Current Records",
|
|
2592
|
+
/* @__PURE__ */ l("span", { className: "pvx-dash-records-count", children: [
|
|
2593
|
+
"(",
|
|
2594
|
+
r.length,
|
|
2595
|
+
")"
|
|
2596
|
+
] })
|
|
2597
|
+
] }) }),
|
|
2598
|
+
/* @__PURE__ */ n("div", { className: "pvx-dash-records-list", children: r.map((s, a) => /* @__PURE__ */ l("div", { className: "pvx-dash-record-row", children: [
|
|
2599
|
+
/* @__PURE__ */ l("div", { className: "pvx-dash-record-info", children: [
|
|
2600
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-record-track", children: E(s.trackId, s.layout, s.game) }),
|
|
2601
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-record-car", children: B(s.carId) })
|
|
2602
|
+
] }),
|
|
2603
|
+
/* @__PURE__ */ l("div", { className: "pvx-dash-record-time", children: [
|
|
2604
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-record-lap", children: A(s.lapTimeMs) }),
|
|
2605
|
+
/* @__PURE__ */ l("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${s.game || "evo"}`, children: [
|
|
2606
|
+
(s.game || "evo").toUpperCase(),
|
|
2607
|
+
s.gameVersion ? ` ${s.gameVersion}` : ""
|
|
2608
|
+
] })
|
|
2609
|
+
] })
|
|
2610
|
+
] }, a)) })
|
|
2611
|
+
] }) : null;
|
|
2612
|
+
}
|
|
2437
2613
|
export {
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2614
|
+
ht as CarsTable,
|
|
2615
|
+
I as CompEmptyState,
|
|
2616
|
+
q as CompLoadingState,
|
|
2617
|
+
gn as CompetitionCard,
|
|
2618
|
+
ft as CompetitionCards,
|
|
2619
|
+
wt as CompetitionResultsTabs,
|
|
2620
|
+
xn as CompletedBadge,
|
|
2621
|
+
$e as DEFAULT_COMPLETION_GRACE_DAYS,
|
|
2622
|
+
St as DriverDashboard,
|
|
2623
|
+
qn as DriverProfile,
|
|
2624
|
+
vt as DriversTable,
|
|
2625
|
+
bt as EntryList,
|
|
2450
2626
|
J as InfoPill,
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2627
|
+
mt as LapHistoryTable,
|
|
2628
|
+
Xn as NotificationsCard,
|
|
2629
|
+
oe as PODIUM_MEDALS,
|
|
2630
|
+
it as PitVoxPartnerProvider,
|
|
2631
|
+
xt as RankingsTable,
|
|
2632
|
+
Kn as RecentCombosCard,
|
|
2633
|
+
Tt as RecordsTable,
|
|
2634
|
+
yt as RegisterButton,
|
|
2635
|
+
kt as RegistrationPanel,
|
|
2636
|
+
Nt as RoundResults,
|
|
2637
|
+
de as RoundSessionResults,
|
|
2638
|
+
bn as StandingsTable,
|
|
2639
|
+
Vn as StatsCards,
|
|
2640
|
+
ut as TracksTable,
|
|
2641
|
+
dn as TypeBadge,
|
|
2642
|
+
Wn as UpcomingEvents,
|
|
2643
|
+
me as buildDriverIndexPath,
|
|
2644
|
+
He as buildLapsPath,
|
|
2645
|
+
ee as buildLeaderboardPath,
|
|
2646
|
+
We as buildRecentLapsPath,
|
|
2647
|
+
$ as fetchCdnJson,
|
|
2648
|
+
gt as filterCompetitionsByStatus,
|
|
2649
|
+
B as formatCarName,
|
|
2473
2650
|
_ as formatDate,
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2651
|
+
ot as formatDelta,
|
|
2652
|
+
ge as formatFuel,
|
|
2653
|
+
A as formatLapTime,
|
|
2654
|
+
Oe as formatNotificationMessage,
|
|
2655
|
+
ne as formatRelativeTime,
|
|
2656
|
+
P as formatSectorTime,
|
|
2657
|
+
le as formatSessionLabel,
|
|
2658
|
+
E as formatTrackName,
|
|
2659
|
+
xe as formatTyreCompound,
|
|
2660
|
+
mn as getCompetitionPodium,
|
|
2661
|
+
Re as getCompetitionStatus,
|
|
2662
|
+
vn as getCompletionDate,
|
|
2663
|
+
hn as isCompetitionComplete,
|
|
2664
|
+
dt as useCarLeaderboard,
|
|
2665
|
+
lt as useCarMetadata,
|
|
2666
|
+
Je as useCompetitionAllRounds,
|
|
2667
|
+
Ne as useCompetitionConfig,
|
|
2668
|
+
ye as useCompetitionEntryList,
|
|
2669
|
+
Ze as useCompetitionLeaderboard,
|
|
2670
|
+
Ye as useCompetitionRound,
|
|
2671
|
+
Xe as useCompetitionRoundLaps,
|
|
2672
|
+
be as useCompetitionStandings,
|
|
2673
|
+
pt as useCompetitions,
|
|
2674
|
+
Bn as useDriverCombos,
|
|
2675
|
+
Ge as useDriverLaps,
|
|
2676
|
+
Ct as useDriverRating,
|
|
2677
|
+
Z as useDriverRatings,
|
|
2678
|
+
In as useDriverRatingsByGame,
|
|
2679
|
+
Mn as useDriverStats,
|
|
2680
|
+
ze as useLeaderboardIndex,
|
|
2681
|
+
En as useMarkAllNotificationsRead,
|
|
2682
|
+
Fn as useMarkNotificationRead,
|
|
2683
|
+
Un as useNotifications,
|
|
2684
|
+
An as useNotificationsEnabled,
|
|
2506
2685
|
C as usePitVox,
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2686
|
+
ct as useRecentLaps,
|
|
2687
|
+
ke as useRegister,
|
|
2688
|
+
re as useRegistrationMode,
|
|
2689
|
+
te as useRegistrationStatus,
|
|
2690
|
+
se as useRegistrationUrl,
|
|
2691
|
+
Qe as useTrackLeaderboard,
|
|
2692
|
+
Lt as useUnreadCount,
|
|
2693
|
+
Pn as useUpcomingEvents,
|
|
2694
|
+
fe as useUserLookup,
|
|
2695
|
+
we as useWithdraw
|
|
2517
2696
|
};
|