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