@pitvox/partner-react 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -4
- package/dist/index.cjs +1 -1
- package/dist/index.js +329 -323
- package/dist/styles.css +12 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as c, Fragment as j } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as ye, useMemo as w, useContext as ke, useState as M, useCallback as Q } from "react";
|
|
3
3
|
import { useQueryClient as U, QueryClient as we, QueryClientProvider as Ce, useQuery as C, useMutation as K, useQueries as Re } from "@tanstack/react-query";
|
|
4
4
|
const Y = ye(null), Le = "https://cdn.pitvox.com", Te = "https://pitvox.com";
|
|
@@ -10,10 +10,10 @@ function Lr({
|
|
|
10
10
|
getSteamId: t,
|
|
11
11
|
onRegister: a,
|
|
12
12
|
onWithdraw: i,
|
|
13
|
-
onFetchNotifications:
|
|
13
|
+
onFetchNotifications: o,
|
|
14
14
|
onMarkNotificationRead: d,
|
|
15
15
|
onMarkAllNotificationsRead: m,
|
|
16
|
-
children:
|
|
16
|
+
children: l
|
|
17
17
|
}) {
|
|
18
18
|
const u = w(() => ({
|
|
19
19
|
partnerSlug: r,
|
|
@@ -22,21 +22,21 @@ function Lr({
|
|
|
22
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: m || null
|
|
28
|
-
}), [r, n, s, t, a, i,
|
|
28
|
+
}), [r, n, s, t, a, i, o, d, m]);
|
|
29
29
|
let x = !1;
|
|
30
30
|
try {
|
|
31
31
|
U(), x = !0;
|
|
32
32
|
} catch {
|
|
33
33
|
x = !1;
|
|
34
34
|
}
|
|
35
|
-
return x ? /* @__PURE__ */ e(Y.Provider, { value: u, children:
|
|
35
|
+
return x ? /* @__PURE__ */ e(Y.Provider, { value: u, children: l }) : (G || (G = new we({
|
|
36
36
|
defaultOptions: {
|
|
37
37
|
queries: { staleTime: 6e4 }
|
|
38
38
|
}
|
|
39
|
-
})), /* @__PURE__ */ e(Ce, { client: G, children: /* @__PURE__ */ e(Y.Provider, { value: u, children:
|
|
39
|
+
})), /* @__PURE__ */ e(Ce, { client: G, children: /* @__PURE__ */ e(Y.Provider, { value: u, children: l }) }));
|
|
40
40
|
}
|
|
41
41
|
function k() {
|
|
42
42
|
const r = ke(Y);
|
|
@@ -66,9 +66,9 @@ function S(r) {
|
|
|
66
66
|
return n.startsWith("ks_") && (n = n.slice(3)), n.split("_").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" ");
|
|
67
67
|
}
|
|
68
68
|
function A(r, n, s) {
|
|
69
|
-
const t = r.split("_").map((
|
|
69
|
+
const t = r.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" "), a = s === "acc" || !s && (n == null ? void 0 : n.toLowerCase()) === "track config";
|
|
70
70
|
if (!n || n === "default" || a) return t;
|
|
71
|
-
const i = n.split("_").map((
|
|
71
|
+
const i = n.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" ");
|
|
72
72
|
return `${t} ${i}`;
|
|
73
73
|
}
|
|
74
74
|
function F(r) {
|
|
@@ -98,7 +98,7 @@ function Tr(r) {
|
|
|
98
98
|
return r == null ? "" : `${r >= 0 ? "+" : "-"}${(Math.abs(r) / 1e3).toFixed(3)}`;
|
|
99
99
|
}
|
|
100
100
|
function Se(r, n) {
|
|
101
|
-
const { type: s, title: t, trackId: a, trackLayout: i, carId:
|
|
101
|
+
const { type: s, title: t, trackId: a, trackLayout: i, carId: o, game: d, data: m } = r, l = a ? A(a, i, d) : null, u = o ? S(o) : null, x = [l, u].filter(Boolean).join(" — ");
|
|
102
102
|
return s === "RECORD_BEATEN" && x ? `${m != null && m.beatenBySteamId && n ? n(m.beatenBySteamId).displayName : "Someone"} beat your record on ${x}` : s === "RECORD_SET" && x ? `You set a new record on ${x}` : t || "New notification";
|
|
103
103
|
}
|
|
104
104
|
function ae(r) {
|
|
@@ -116,13 +116,13 @@ function ae(r) {
|
|
|
116
116
|
}[r] || r : "Unknown";
|
|
117
117
|
}
|
|
118
118
|
function Sr(r = {}) {
|
|
119
|
-
var d, m,
|
|
119
|
+
var d, m, l, u, x, f;
|
|
120
120
|
const { cdnUrl: n, partnerSlug: s } = k(), { game: t, gameVersion: a } = r, i = C({
|
|
121
121
|
queryKey: ["pitvox", "leaderboards", s, "index"],
|
|
122
122
|
queryFn: () => T(n, `leaderboards/partners/${s}/index.json`),
|
|
123
123
|
staleTime: 3e4,
|
|
124
124
|
refetchInterval: 3e4
|
|
125
|
-
}),
|
|
125
|
+
}), o = w(() => {
|
|
126
126
|
var b;
|
|
127
127
|
if (!((b = i.data) != null && b.tracks)) return [];
|
|
128
128
|
let v = i.data.tracks;
|
|
@@ -146,18 +146,18 @@ function Sr(r = {}) {
|
|
|
146
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: ((m = i.data) == null ? void 0 : m.partner) || null,
|
|
151
|
-
generatedAt: (
|
|
151
|
+
generatedAt: (l = i.data) == null ? void 0 : l.generatedAt,
|
|
152
152
|
totalLaps: ((u = i.data) == null ? void 0 : u.totalLaps) || 0,
|
|
153
153
|
totalUsers: ((x = i.data) == null ? void 0 : x.totalUsers) || 0,
|
|
154
154
|
versions: ((f = i.data) == null ? void 0 : f.versions) || {}
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
157
|
function $e(r, n, s = {}) {
|
|
158
|
-
const { cdnUrl: t, partnerSlug: a } = k(), { carId: i, game:
|
|
158
|
+
const { cdnUrl: t, partnerSlug: a } = k(), { carId: i, game: o, gameVersion: d } = s, m = n || "default", l = d ? `leaderboards/partners/${a}/v/${d}/tracks/${r}/${m}.json` : `leaderboards/partners/${a}/tracks/${r}/${m}.json`, { data: u, isLoading: x, error: f } = C({
|
|
159
159
|
queryKey: ["pitvox", "leaderboards", a, "track", r, m, d],
|
|
160
|
-
queryFn: () => T(t,
|
|
160
|
+
queryFn: () => T(t, l),
|
|
161
161
|
enabled: !!r,
|
|
162
162
|
staleTime: 3e4,
|
|
163
163
|
refetchInterval: 3e4
|
|
@@ -165,7 +165,7 @@ function $e(r, n, s = {}) {
|
|
|
165
165
|
return { data: w(() => {
|
|
166
166
|
if (!(u != null && u.entries)) return [];
|
|
167
167
|
let b = u.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
170
|
for (const h of b) {
|
|
171
171
|
const g = h.steamId || h.userId;
|
|
@@ -177,13 +177,13 @@ function $e(r, n, s = {}) {
|
|
|
177
177
|
}).sort((h, g) => h.lapTimeMs - g.lapTimeMs);
|
|
178
178
|
}
|
|
179
179
|
return b.filter((p) => p.carId === i).sort((p, N) => p.lapTimeMs - N.lapTimeMs);
|
|
180
|
-
}, [u == null ? void 0 : u.entries, i,
|
|
180
|
+
}, [u == null ? void 0 : u.entries, i, o]), isLoading: x, error: f };
|
|
181
181
|
}
|
|
182
182
|
function Me(r, n, s, t, a = {}) {
|
|
183
183
|
var f, v;
|
|
184
|
-
const { cdnUrl: i, partnerSlug:
|
|
185
|
-
queryKey: ["pitvox", "laps",
|
|
186
|
-
queryFn: () => T(i, `laps/partners/${
|
|
184
|
+
const { cdnUrl: i, partnerSlug: o } = k(), { showInvalid: d = !1, game: m, gameVersion: l } = a, u = C({
|
|
185
|
+
queryKey: ["pitvox", "laps", o, r],
|
|
186
|
+
queryFn: () => T(i, `laps/partners/${o}/${r}.json`),
|
|
187
187
|
enabled: !!r,
|
|
188
188
|
staleTime: 3e4,
|
|
189
189
|
refetchInterval: 3e4
|
|
@@ -194,9 +194,9 @@ function Me(r, n, s, t, a = {}) {
|
|
|
194
194
|
if (s) {
|
|
195
195
|
if (p.trackLayout !== s) return !1;
|
|
196
196
|
} else if (p.trackLayout && p.trackLayout !== "default") return !1;
|
|
197
|
-
return !(p.carId !== t || m && p.game !== m ||
|
|
197
|
+
return !(p.carId !== t || m && p.game !== m || l && p.gameVersion !== l || !d && !p.isValid);
|
|
198
198
|
}).sort((p, N) => p.lapTimeMs - N.lapTimeMs) : [];
|
|
199
|
-
}, [(f = u.data) == null ? void 0 : f.laps, n, s, t, m,
|
|
199
|
+
}, [(f = u.data) == null ? void 0 : f.laps, n, s, t, m, l, d]);
|
|
200
200
|
return {
|
|
201
201
|
...u,
|
|
202
202
|
data: x,
|
|
@@ -302,8 +302,8 @@ function Z(r) {
|
|
|
302
302
|
var m;
|
|
303
303
|
const i = await fetch(`${n}/competitions/${s}/${r}/entrylist.json`);
|
|
304
304
|
if (!i.ok) return { isRegistered: !1, entryList: null };
|
|
305
|
-
const
|
|
306
|
-
return { isRegistered: !!a && ((m =
|
|
305
|
+
const o = await i.json();
|
|
306
|
+
return { isRegistered: !!a && ((m = o.drivers) == null ? void 0 : m.some((l) => l.steamId === a)), entryList: o };
|
|
307
307
|
},
|
|
308
308
|
enabled: !!r,
|
|
309
309
|
staleTime: 6e4
|
|
@@ -312,29 +312,29 @@ function Z(r) {
|
|
|
312
312
|
function ce(r) {
|
|
313
313
|
const { onRegister: n, partnerSlug: s, getSteamId: t } = k(), a = U(), i = ie();
|
|
314
314
|
return K({
|
|
315
|
-
mutationFn: (
|
|
315
|
+
mutationFn: (o) => {
|
|
316
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 n(r,
|
|
320
|
+
return n(r, o);
|
|
321
321
|
},
|
|
322
322
|
onSuccess: () => {
|
|
323
|
-
const
|
|
323
|
+
const o = t();
|
|
324
324
|
if (a.setQueriesData(
|
|
325
325
|
{ queryKey: ["pitvox", "registration", s, r] },
|
|
326
326
|
(d) => d ? { ...d, isRegistered: !0 } : { isRegistered: !0, entryList: null }
|
|
327
|
-
),
|
|
328
|
-
const d = i(
|
|
329
|
-
steamId:
|
|
327
|
+
), o) {
|
|
328
|
+
const d = i(o), m = {
|
|
329
|
+
steamId: o,
|
|
330
330
|
displayName: d.displayName,
|
|
331
331
|
avatarUrl: d.avatarUrl
|
|
332
332
|
};
|
|
333
333
|
a.setQueriesData(
|
|
334
334
|
{ queryKey: ["pitvox", "competition", s, r, "entrylist"] },
|
|
335
|
-
(
|
|
335
|
+
(l) => {
|
|
336
336
|
var x;
|
|
337
|
-
return
|
|
337
|
+
return l ? ((x = l.drivers) == null ? void 0 : x.some((f) => f.steamId === o)) ? l : { ...l, drivers: [...l.drivers || [], m] } : { drivers: [m] };
|
|
338
338
|
}
|
|
339
339
|
);
|
|
340
340
|
}
|
|
@@ -349,18 +349,18 @@ function le(r) {
|
|
|
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 n(r,
|
|
352
|
+
const o = i || t();
|
|
353
|
+
if (!o) throw new Error("No Steam ID available");
|
|
354
|
+
return n(r, o);
|
|
355
355
|
},
|
|
356
356
|
onSuccess: () => {
|
|
357
357
|
const i = t();
|
|
358
358
|
a.setQueriesData(
|
|
359
359
|
{ queryKey: ["pitvox", "registration", s, r] },
|
|
360
|
-
(
|
|
360
|
+
(o) => o ? { ...o, isRegistered: !1 } : { isRegistered: !1, entryList: null }
|
|
361
361
|
), i && a.setQueriesData(
|
|
362
362
|
{ queryKey: ["pitvox", "competition", s, r, "entrylist"] },
|
|
363
|
-
(
|
|
363
|
+
(o) => o != null && o.drivers ? { ...o, drivers: o.drivers.filter((d) => d.steamId !== i) } : o
|
|
364
364
|
);
|
|
365
365
|
}
|
|
366
366
|
});
|
|
@@ -415,13 +415,13 @@ function pe(r, n) {
|
|
|
415
415
|
return !0;
|
|
416
416
|
}
|
|
417
417
|
function ue(r, n) {
|
|
418
|
-
const [s, t] = M(/* @__PURE__ */ new Set()), a = r !== void 0, i = a ? r : s,
|
|
419
|
-
const
|
|
420
|
-
|
|
418
|
+
const [s, t] = M(/* @__PURE__ */ new Set()), a = r !== void 0, i = a ? r : s, o = Q((m) => {
|
|
419
|
+
const l = new Set(i);
|
|
420
|
+
l.has(m) ? l.delete(m) : l.add(m), a && n ? n(l) : t(l);
|
|
421
421
|
}, [i, a, n]), d = Q(() => {
|
|
422
422
|
a && n ? n(/* @__PURE__ */ new Set()) : t(/* @__PURE__ */ new Set());
|
|
423
423
|
}, [a, n]);
|
|
424
|
-
return { activeTags: i, toggle:
|
|
424
|
+
return { activeTags: i, toggle: o, clear: d };
|
|
425
425
|
}
|
|
426
426
|
function H(r) {
|
|
427
427
|
const [n, s] = M(r), t = Q((a) => {
|
|
@@ -433,11 +433,11 @@ function H(r) {
|
|
|
433
433
|
}
|
|
434
434
|
function O(r, n, s) {
|
|
435
435
|
return [...r].sort((t, a) => {
|
|
436
|
-
const i = s(t, n.key),
|
|
437
|
-
if (i == null &&
|
|
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(
|
|
439
|
+
if (o == null) return -1;
|
|
440
|
+
const d = typeof i == "string" ? i.localeCompare(o) : i - o;
|
|
441
441
|
return n.dir === "desc" ? -d : d;
|
|
442
442
|
});
|
|
443
443
|
}
|
|
@@ -458,7 +458,7 @@ function L({ label: r, sortKey: n, config: s, onSort: t, className: a = "" }) {
|
|
|
458
458
|
{
|
|
459
459
|
className: `pvx-th pvx-th--sortable ${a}`,
|
|
460
460
|
onClick: () => t(n),
|
|
461
|
-
children: /* @__PURE__ */
|
|
461
|
+
children: /* @__PURE__ */ c("span", { className: "pvx-th-inner", children: [
|
|
462
462
|
r,
|
|
463
463
|
/* @__PURE__ */ e(Ae, { active: s.key === n, dir: s.dir })
|
|
464
464
|
] })
|
|
@@ -467,7 +467,7 @@ function L({ label: r, sortKey: n, config: s, onSort: t, className: a = "" }) {
|
|
|
467
467
|
}
|
|
468
468
|
function W({ userId: r, getUserDisplay: n }) {
|
|
469
469
|
const { displayName: s, avatarUrl: t } = n(r);
|
|
470
|
-
return /* @__PURE__ */
|
|
470
|
+
return /* @__PURE__ */ c("span", { className: "pvx-driver", children: [
|
|
471
471
|
t ? /* @__PURE__ */ e("img", { src: t, alt: "", className: "pvx-driver-avatar" }) : /* @__PURE__ */ e("span", { className: "pvx-driver-avatar pvx-driver-avatar--placeholder" }),
|
|
472
472
|
/* @__PURE__ */ e("span", { className: "pvx-driver-name", children: s })
|
|
473
473
|
] });
|
|
@@ -477,8 +477,8 @@ function ee({ rank: r, podium: n = !1 }) {
|
|
|
477
477
|
}
|
|
478
478
|
function ve({ availableTags: r, activeTags: n, onToggle: s, onClear: t }) {
|
|
479
479
|
if (!r || r.length < 2) return null;
|
|
480
|
-
const a = de.map((i) => ({ id: i.id, tags: i.tags.filter((
|
|
481
|
-
return /* @__PURE__ */
|
|
480
|
+
const a = de.map((i) => ({ id: i.id, tags: i.tags.filter((o) => r.includes(o)) })).filter((i) => i.tags.length > 0);
|
|
481
|
+
return /* @__PURE__ */ c("div", { className: "pvx-tag-bar", children: [
|
|
482
482
|
/* @__PURE__ */ e(
|
|
483
483
|
"button",
|
|
484
484
|
{
|
|
@@ -487,8 +487,8 @@ function ve({ availableTags: r, activeTags: n, onToggle: s, onClear: t }) {
|
|
|
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__ */ e("span", { className: "pvx-tag-separator" }),
|
|
492
492
|
i.tags.map((d) => /* @__PURE__ */ e(
|
|
493
493
|
"button",
|
|
494
494
|
{
|
|
@@ -504,14 +504,14 @@ function ve({ availableTags: r, activeTags: n, onToggle: s, onClear: t }) {
|
|
|
504
504
|
function re({ segments: r }) {
|
|
505
505
|
return /* @__PURE__ */ e("nav", { className: "pvx-breadcrumb", "aria-label": "Breadcrumb", children: /* @__PURE__ */ e("ol", { className: "pvx-breadcrumb-list", children: r.map((n, s) => {
|
|
506
506
|
const t = s === r.length - 1;
|
|
507
|
-
return /* @__PURE__ */
|
|
507
|
+
return /* @__PURE__ */ c("li", { className: "pvx-breadcrumb-item", children: [
|
|
508
508
|
s > 0 && /* @__PURE__ */ e("svg", { className: "pvx-breadcrumb-chevron", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.25 4.5l7.5 7.5-7.5 7.5" }) }),
|
|
509
509
|
!t && n.onClick ? /* @__PURE__ */ e("button", { onClick: n.onClick, className: "pvx-breadcrumb-link", children: n.label }) : /* @__PURE__ */ e("span", { className: "pvx-breadcrumb-current", children: n.label })
|
|
510
510
|
] }, n.key);
|
|
511
511
|
}) }) });
|
|
512
512
|
}
|
|
513
513
|
function E({ message: r }) {
|
|
514
|
-
return /* @__PURE__ */
|
|
514
|
+
return /* @__PURE__ */ c("div", { className: "pvx-empty", children: [
|
|
515
515
|
/* @__PURE__ */ e("svg", { className: "pvx-empty-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.5 18.75h-9m9 0a3 3 0 013 3h-15a3 3 0 013-3m9 0v-4.5A3.375 3.375 0 0013.125 10.875h-2.25A3.375 3.375 0 007.5 14.25v4.5" }) }),
|
|
516
516
|
/* @__PURE__ */ e("p", { children: r })
|
|
517
517
|
] });
|
|
@@ -525,15 +525,15 @@ function Fe() {
|
|
|
525
525
|
function Ee() {
|
|
526
526
|
return /* @__PURE__ */ e("svg", { className: "pvx-icon pvx-icon--invalid", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) });
|
|
527
527
|
}
|
|
528
|
-
function Br({ tracks: r, isLoading: n, carMetadata: s, getUserDisplay: t, onTrackSelect: a, tags: i, onTagChange:
|
|
529
|
-
const [d, m] = H({ key: "record.timestamp", dir: "desc" }), { activeTags:
|
|
528
|
+
function Br({ tracks: r, isLoading: n, carMetadata: s, getUserDisplay: t, onTrackSelect: a, tags: i, onTagChange: o }) {
|
|
529
|
+
const [d, m] = H({ key: "record.timestamp", dir: "desc" }), { activeTags: l, toggle: u, clear: x } = ue(i, o), f = w(() => {
|
|
530
530
|
var N;
|
|
531
531
|
if (!((N = s == null ? void 0 : s.tags) != null && N.length)) return [];
|
|
532
532
|
const p = /* @__PURE__ */ new Set();
|
|
533
533
|
for (const h of r || [])
|
|
534
534
|
h.recordByTag && Object.keys(h.recordByTag).forEach((g) => p.add(g));
|
|
535
535
|
return s.tags.filter((h) => p.has(h));
|
|
536
|
-
}, [r, s]), v = w(() => r ?
|
|
536
|
+
}, [r, s]), v = w(() => r ? l.size === 0 ? r : r.map((p) => {
|
|
537
537
|
var g, y;
|
|
538
538
|
if (!p.recordByTag) return null;
|
|
539
539
|
let N = null;
|
|
@@ -542,7 +542,7 @@ function Br({ tracks: r, isLoading: n, carMetadata: s, getUserDisplay: t, onTrac
|
|
|
542
542
|
if (h.has(R.carId)) continue;
|
|
543
543
|
h.add(R.carId);
|
|
544
544
|
const $ = ((y = (g = s == null ? void 0 : s.cars) == null ? void 0 : g[R.carId]) == null ? void 0 : y.tags) || ["sports_car"];
|
|
545
|
-
pe($,
|
|
545
|
+
pe($, l) && (!N || R.lapTimeMs < N.lapTimeMs) && (N = R);
|
|
546
546
|
}
|
|
547
547
|
return N ? {
|
|
548
548
|
...p,
|
|
@@ -554,7 +554,7 @@ function Br({ tracks: r, isLoading: n, carMetadata: s, getUserDisplay: t, onTrac
|
|
|
554
554
|
timestamp: N.recordedAt
|
|
555
555
|
}
|
|
556
556
|
} : null;
|
|
557
|
-
}).filter(Boolean) : [], [r,
|
|
557
|
+
}).filter(Boolean) : [], [r, l, s]), b = w(() => O(v, d, (p, N) => {
|
|
558
558
|
var h, g;
|
|
559
559
|
switch (N) {
|
|
560
560
|
case "displayName":
|
|
@@ -570,11 +570,11 @@ function Br({ tracks: r, isLoading: n, carMetadata: s, getUserDisplay: t, onTrac
|
|
|
570
570
|
return (g = p.record) != null && g.timestamp ? new Date(p.record.timestamp).getTime() : 0;
|
|
571
571
|
}
|
|
572
572
|
}), [v, d]);
|
|
573
|
-
return n ? /* @__PURE__ */ e(_, {}) : r != null && r.length ? /* @__PURE__ */
|
|
573
|
+
return n ? /* @__PURE__ */ e(_, {}) : r != null && r.length ? /* @__PURE__ */ c("div", { className: "pvx-card", children: [
|
|
574
574
|
/* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ e("h2", { className: "pvx-card-title", children: "Track Records" }) }),
|
|
575
|
-
/* @__PURE__ */ e(ve, { availableTags: f, activeTags:
|
|
576
|
-
/* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */
|
|
577
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */
|
|
575
|
+
/* @__PURE__ */ e(ve, { availableTags: f, activeTags: l, onToggle: u, onClear: x }),
|
|
576
|
+
/* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ c("table", { className: "pvx-table", children: [
|
|
577
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ c("tr", { className: "pvx-thead-row", children: [
|
|
578
578
|
/* @__PURE__ */ e(L, { label: "Track", sortKey: "displayName", config: d, onSort: m }),
|
|
579
579
|
/* @__PURE__ */ e("th", { className: "pvx-th", children: "Record Holder" }),
|
|
580
580
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-lg", children: "Car" }),
|
|
@@ -585,7 +585,7 @@ function Br({ tracks: r, isLoading: n, carMetadata: s, getUserDisplay: t, onTrac
|
|
|
585
585
|
] }) }),
|
|
586
586
|
/* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: b.map((p) => {
|
|
587
587
|
var N, h, g;
|
|
588
|
-
return /* @__PURE__ */
|
|
588
|
+
return /* @__PURE__ */ c(
|
|
589
589
|
"tr",
|
|
590
590
|
{
|
|
591
591
|
className: "pvx-row pvx-row--clickable",
|
|
@@ -606,8 +606,8 @@ function Br({ tracks: r, isLoading: n, carMetadata: s, getUserDisplay: t, onTrac
|
|
|
606
606
|
] }) })
|
|
607
607
|
] }) : /* @__PURE__ */ e(E, { message: "No lap times recorded yet." });
|
|
608
608
|
}
|
|
609
|
-
function Pr({ entries: r, isLoading: n, track: s, carMetadata: t, getUserDisplay: a, onCarSelect: i, onNavigate:
|
|
610
|
-
const [
|
|
609
|
+
function Pr({ entries: r, isLoading: n, track: s, carMetadata: t, getUserDisplay: a, onCarSelect: i, onNavigate: o, tags: d, onTagChange: m }) {
|
|
610
|
+
const [l, u] = H({ key: "lapTimeMs", dir: "asc" }), { activeTags: x, toggle: f, clear: v } = ue(d, m), b = w(() => {
|
|
611
611
|
var y, R, $;
|
|
612
612
|
if (!r || !((y = t == null ? void 0 : t.tags) != null && y.length)) return [];
|
|
613
613
|
const g = /* @__PURE__ */ new Set();
|
|
@@ -618,7 +618,7 @@ function Pr({ entries: r, isLoading: n, track: s, carMetadata: t, getUserDisplay
|
|
|
618
618
|
var R, $;
|
|
619
619
|
const y = (($ = (R = t == null ? void 0 : t.cars) == null ? void 0 : R[g.carId]) == null ? void 0 : $.tags) || ["sports_car"];
|
|
620
620
|
return pe(y, x);
|
|
621
|
-
}) : [], [r, x, t]), N = w(() => O(p,
|
|
621
|
+
}) : [], [r, x, t]), N = w(() => O(p, l, (g, y) => {
|
|
622
622
|
switch (y) {
|
|
623
623
|
case "carId":
|
|
624
624
|
return S(g.carId);
|
|
@@ -628,23 +628,23 @@ function Pr({ entries: r, isLoading: n, track: s, carMetadata: t, getUserDisplay
|
|
|
628
628
|
default:
|
|
629
629
|
return g.lapTimeMs;
|
|
630
630
|
}
|
|
631
|
-
}), [p,
|
|
632
|
-
{ key: "tracks", label: "Tracks", onClick: () =>
|
|
631
|
+
}), [p, l]), h = [
|
|
632
|
+
{ key: "tracks", label: "Tracks", onClick: () => o("tracks") },
|
|
633
633
|
{ key: "track", label: s.displayName }
|
|
634
634
|
];
|
|
635
|
-
return n ? /* @__PURE__ */ e(_, {}) : /* @__PURE__ */
|
|
635
|
+
return n ? /* @__PURE__ */ e(_, {}) : /* @__PURE__ */ c("div", { className: "pvx-card", children: [
|
|
636
636
|
/* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ e(re, { segments: h }) }),
|
|
637
637
|
/* @__PURE__ */ e(ve, { availableTags: b, activeTags: x, onToggle: f, onClear: v }),
|
|
638
|
-
r != null && r.length ? /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */
|
|
639
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */
|
|
638
|
+
r != null && r.length ? /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ c("table", { className: "pvx-table", children: [
|
|
639
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ c("tr", { className: "pvx-thead-row", children: [
|
|
640
640
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
|
|
641
|
-
/* @__PURE__ */ e(L, { label: "Car", sortKey: "carId", config:
|
|
641
|
+
/* @__PURE__ */ e(L, { label: "Car", sortKey: "carId", config: l, onSort: u }),
|
|
642
642
|
/* @__PURE__ */ e("th", { className: "pvx-th", children: "Record Holder" }),
|
|
643
|
-
/* @__PURE__ */ e(L, { label: "Lap Time", sortKey: "lapTimeMs", config:
|
|
644
|
-
/* @__PURE__ */ e(L, { label: "Drivers", sortKey: "driverCount", config:
|
|
643
|
+
/* @__PURE__ */ e(L, { label: "Lap Time", sortKey: "lapTimeMs", config: l, onSort: u }),
|
|
644
|
+
/* @__PURE__ */ e(L, { label: "Drivers", sortKey: "driverCount", config: l, onSort: u, className: "pvx-hidden-below-md" }),
|
|
645
645
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-lg", children: "Date" })
|
|
646
646
|
] }) }),
|
|
647
|
-
/* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: N.map((g, y) => /* @__PURE__ */
|
|
647
|
+
/* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: N.map((g, y) => /* @__PURE__ */ c(
|
|
648
648
|
"tr",
|
|
649
649
|
{
|
|
650
650
|
className: "pvx-row pvx-row--clickable",
|
|
@@ -663,8 +663,8 @@ function Pr({ entries: r, isLoading: n, track: s, carMetadata: t, getUserDisplay
|
|
|
663
663
|
] }) }) : /* @__PURE__ */ e(E, { message: "No lap times for this track yet." })
|
|
664
664
|
] });
|
|
665
665
|
}
|
|
666
|
-
function Ur({ entries: r, isLoading: n, track: s, carId: t, getUserDisplay: a, onDriverSelect: i, onNavigate:
|
|
667
|
-
const [m,
|
|
666
|
+
function Ur({ entries: r, isLoading: n, track: s, carId: t, getUserDisplay: a, onDriverSelect: i, onNavigate: o, highlightId: d }) {
|
|
667
|
+
const [m, l] = H({ key: "lapTimeMs", dir: "asc" }), u = w(() => me(r), [r]), x = w(() => O(r || [], m, (v, b) => {
|
|
668
668
|
switch (b) {
|
|
669
669
|
case "userId":
|
|
670
670
|
return a(v.steamId || v.userId).displayName;
|
|
@@ -675,28 +675,28 @@ function Ur({ entries: r, isLoading: n, track: s, carId: t, getUserDisplay: a, o
|
|
|
675
675
|
return v.lapTimeMs;
|
|
676
676
|
}
|
|
677
677
|
}), [r, m, a]), f = [
|
|
678
|
-
{ key: "tracks", label: "Tracks", onClick: () =>
|
|
679
|
-
{ key: "track", label: s.displayName, onClick: () =>
|
|
678
|
+
{ key: "tracks", label: "Tracks", onClick: () => o("tracks") },
|
|
679
|
+
{ key: "track", label: s.displayName, onClick: () => o("track") },
|
|
680
680
|
{ key: "car", label: S(t) }
|
|
681
681
|
];
|
|
682
|
-
return n ? /* @__PURE__ */ e(_, {}) : /* @__PURE__ */
|
|
682
|
+
return n ? /* @__PURE__ */ e(_, {}) : /* @__PURE__ */ c("div", { className: "pvx-card", children: [
|
|
683
683
|
/* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ e(re, { segments: f }) }),
|
|
684
|
-
r != null && r.length ? /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */
|
|
685
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */
|
|
684
|
+
r != null && r.length ? /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ c("table", { className: "pvx-table", children: [
|
|
685
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ c("tr", { className: "pvx-thead-row", children: [
|
|
686
686
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
|
|
687
|
-
/* @__PURE__ */ e(L, { label: "Driver", sortKey: "userId", config: m, onSort:
|
|
688
|
-
/* @__PURE__ */ e(L, { label: "Lap Time", sortKey: "lapTimeMs", config: m, onSort:
|
|
687
|
+
/* @__PURE__ */ e(L, { label: "Driver", sortKey: "userId", config: m, onSort: l }),
|
|
688
|
+
/* @__PURE__ */ e(L, { label: "Lap Time", sortKey: "lapTimeMs", config: m, onSort: l }),
|
|
689
689
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
|
|
690
690
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
|
|
691
691
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" }),
|
|
692
692
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-lg", children: "Tyre" }),
|
|
693
693
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-xl", children: "Fuel" }),
|
|
694
|
-
/* @__PURE__ */ e(L, { label: "Laps", sortKey: "lapCount", config: m, onSort:
|
|
694
|
+
/* @__PURE__ */ e(L, { label: "Laps", sortKey: "lapCount", config: m, onSort: l, className: "pvx-hidden-below-lg" }),
|
|
695
695
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
|
|
696
696
|
] }) }),
|
|
697
697
|
/* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: x.map((v, b) => {
|
|
698
698
|
const p = b + 1, N = v.steamId || v.userId, h = u && v.sector1Ms === u.s1, g = u && v.sector2Ms === u.s2, y = u && v.sector3Ms === u.s3;
|
|
699
|
-
return /* @__PURE__ */
|
|
699
|
+
return /* @__PURE__ */ c(
|
|
700
700
|
"tr",
|
|
701
701
|
{
|
|
702
702
|
className: `pvx-row pvx-row--clickable ${d && N === d ? "pvx-row--highlight" : p <= 3 ? "pvx-row--podium" : ""}`,
|
|
@@ -720,23 +720,23 @@ function Ur({ entries: r, isLoading: n, track: s, carId: t, getUserDisplay: a, o
|
|
|
720
720
|
] }) }) : /* @__PURE__ */ e(E, { message: "No lap times for this car yet." })
|
|
721
721
|
] });
|
|
722
722
|
}
|
|
723
|
-
function Ar({ userId: r, track: n, carId: s, game: t, gameVersion: a, showInvalid: i, getUserDisplay:
|
|
724
|
-
const { data:
|
|
725
|
-
const h = (
|
|
723
|
+
function Ar({ userId: r, track: n, carId: s, game: t, gameVersion: a, showInvalid: i, getUserDisplay: o, onToggleInvalid: d, onNavigate: m }) {
|
|
724
|
+
const { data: l, driverName: u, isLoading: x } = Me(r, n.id, n.layout, s, { showInvalid: i, game: t, gameVersion: a }), { displayName: f, avatarUrl: v } = o(r, u), b = w(() => me(l, !0), [l]), p = w(() => {
|
|
725
|
+
const h = (l == null ? void 0 : l.filter((g) => g.isValid)) || [];
|
|
726
726
|
return h.length ? Math.min(...h.map((g) => g.lapTimeMs)) : null;
|
|
727
|
-
}, [
|
|
727
|
+
}, [l]), N = [
|
|
728
728
|
{ key: "tracks", label: "Tracks", onClick: () => m("tracks") },
|
|
729
729
|
{ key: "track", label: n.displayName, onClick: () => m("track") },
|
|
730
730
|
{ key: "car", label: S(s), onClick: () => m("car") },
|
|
731
731
|
{ key: "driver", label: f }
|
|
732
732
|
];
|
|
733
|
-
return x ? /* @__PURE__ */ e(_, {}) : /* @__PURE__ */
|
|
734
|
-
/* @__PURE__ */
|
|
735
|
-
/* @__PURE__ */
|
|
733
|
+
return x ? /* @__PURE__ */ e(_, {}) : /* @__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__ */ e(re, { segments: N }),
|
|
737
737
|
v ? /* @__PURE__ */ e("img", { src: v, alt: "", className: "pvx-driver-avatar pvx-driver-avatar--lg" }) : /* @__PURE__ */ e("span", { className: "pvx-driver-avatar pvx-driver-avatar--lg pvx-driver-avatar--placeholder" })
|
|
738
738
|
] }),
|
|
739
|
-
/* @__PURE__ */
|
|
739
|
+
/* @__PURE__ */ c("label", { className: "pvx-checkbox-label", children: [
|
|
740
740
|
/* @__PURE__ */ e(
|
|
741
741
|
"input",
|
|
742
742
|
{
|
|
@@ -749,8 +749,8 @@ function Ar({ userId: r, track: n, carId: s, game: t, gameVersion: a, showInvali
|
|
|
749
749
|
/* @__PURE__ */ e("span", { children: "Show invalid laps" })
|
|
750
750
|
] })
|
|
751
751
|
] }),
|
|
752
|
-
|
|
753
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */
|
|
752
|
+
l != null && l.length ? /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ c("table", { className: "pvx-table", children: [
|
|
753
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ c("tr", { className: "pvx-thead-row", children: [
|
|
754
754
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
|
|
755
755
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-md", children: "Lap" }),
|
|
756
756
|
/* @__PURE__ */ e("th", { className: "pvx-th", children: "Lap Time" }),
|
|
@@ -762,10 +762,10 @@ function Ar({ userId: r, track: n, carId: s, game: t, gameVersion: a, showInvali
|
|
|
762
762
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-lg", children: "Fuel" }),
|
|
763
763
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
|
|
764
764
|
] }) }),
|
|
765
|
-
/* @__PURE__ */ e("tbody", { className: "pvx-tbody", children:
|
|
765
|
+
/* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: l.map((h, g) => {
|
|
766
766
|
const y = h.isValid && h.lapTimeMs === p, R = b && h.isValid && h.sector1Ms === b.s1, $ = b && h.isValid && h.sector2Ms === b.s2, P = b && h.isValid && h.sector3Ms === b.s3;
|
|
767
767
|
let V = "pvx-row";
|
|
768
|
-
return h.isValid || (V += " pvx-row--invalid"), y && (V += " pvx-row--personal-best"), /* @__PURE__ */
|
|
768
|
+
return h.isValid || (V += " pvx-row--invalid"), y && (V += " pvx-row--personal-best"), /* @__PURE__ */ c("tr", { className: V, children: [
|
|
769
769
|
/* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e("span", { className: `pvx-rank ${y ? "pvx-rank--gold" : ""}`, children: g + 1 }) }),
|
|
770
770
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-md", children: h.lapNumber || "-" }),
|
|
771
771
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: I(h.lapTimeMs) }),
|
|
@@ -782,7 +782,7 @@ function Ar({ userId: r, track: n, carId: s, game: t, gameVersion: a, showInvali
|
|
|
782
782
|
] });
|
|
783
783
|
}
|
|
784
784
|
function Fr({ drivers: r, isLoading: n, getUserDisplay: s, game: t, gameVersion: a, onComboSelect: i }) {
|
|
785
|
-
const [
|
|
785
|
+
const [o, d] = H({ key: "rank", dir: "asc" }), [m, l] = M(null), u = w(() => r ? O(r, o, (f, v) => {
|
|
786
786
|
switch (v) {
|
|
787
787
|
case "rating":
|
|
788
788
|
return f.rating;
|
|
@@ -794,19 +794,19 @@ function Fr({ drivers: r, isLoading: n, getUserDisplay: s, game: t, gameVersion:
|
|
|
794
794
|
default:
|
|
795
795
|
return f.rank;
|
|
796
796
|
}
|
|
797
|
-
}) : [], [r,
|
|
797
|
+
}) : [], [r, o]);
|
|
798
798
|
if (n) return /* @__PURE__ */ e(_, {});
|
|
799
799
|
if (!(r != null && r.length))
|
|
800
800
|
return /* @__PURE__ */ e("div", { className: "pvx-card", children: /* @__PURE__ */ e(E, { message: "Not enough data for rankings yet." }) });
|
|
801
801
|
const x = 5;
|
|
802
|
-
return /* @__PURE__ */
|
|
803
|
-
/* @__PURE__ */
|
|
802
|
+
return /* @__PURE__ */ c("div", { className: "pvx-card", children: [
|
|
803
|
+
/* @__PURE__ */ c("div", { className: "pvx-card-header pvx-rankings-header", children: [
|
|
804
804
|
/* @__PURE__ */ e("h2", { className: "pvx-card-title", children: "Driver Rankings" }),
|
|
805
|
-
/* @__PURE__ */
|
|
805
|
+
/* @__PURE__ */ c("div", { className: "pvx-rankings-info-trigger", children: [
|
|
806
806
|
/* @__PURE__ */ e("svg", { className: "pvx-rankings-info-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" }) }),
|
|
807
|
-
/* @__PURE__ */
|
|
807
|
+
/* @__PURE__ */ c("div", { className: "pvx-rankings-info-tooltip", children: [
|
|
808
808
|
/* @__PURE__ */ e("p", { className: "pvx-rankings-info-title", children: "How ratings work" }),
|
|
809
|
-
/* @__PURE__ */
|
|
809
|
+
/* @__PURE__ */ c("ul", { className: "pvx-rankings-info-list", children: [
|
|
810
810
|
/* @__PURE__ */ e("li", { children: "For each car/track combo with 3+ drivers, you're ranked by lap time and given a percentile (100 = fastest, 0 = slowest)" }),
|
|
811
811
|
/* @__PURE__ */ e("li", { children: "Your rating is a weighted average across all your combos — bigger fields count more" }),
|
|
812
812
|
/* @__PURE__ */ e("li", { children: "A confidence adjustment rewards car diversity: the more different cars you drive competitively, the closer your rating reflects your true score" }),
|
|
@@ -815,13 +815,13 @@ function Fr({ drivers: r, isLoading: n, getUserDisplay: s, game: t, gameVersion:
|
|
|
815
815
|
] })
|
|
816
816
|
] })
|
|
817
817
|
] }),
|
|
818
|
-
/* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */
|
|
819
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */
|
|
820
|
-
/* @__PURE__ */ e(L, { label: "#", sortKey: "rank", config:
|
|
818
|
+
/* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ c("table", { className: "pvx-table", children: [
|
|
819
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ c("tr", { className: "pvx-thead-row", children: [
|
|
820
|
+
/* @__PURE__ */ e(L, { label: "#", sortKey: "rank", config: o, onSort: d, className: "pvx-th--narrow" }),
|
|
821
821
|
/* @__PURE__ */ e("th", { className: "pvx-th", children: "Driver" }),
|
|
822
|
-
/* @__PURE__ */ e(L, { label: "Rating", sortKey: "rating", config:
|
|
823
|
-
/* @__PURE__ */ e(L, { label: "Cars", sortKey: "distinctCars", config:
|
|
824
|
-
/* @__PURE__ */ e(L, { label: "Combos", sortKey: "comboCount", config:
|
|
822
|
+
/* @__PURE__ */ e(L, { label: "Rating", sortKey: "rating", config: o, onSort: d }),
|
|
823
|
+
/* @__PURE__ */ e(L, { label: "Cars", sortKey: "distinctCars", config: o, onSort: d, className: "pvx-hidden-below-sm" }),
|
|
824
|
+
/* @__PURE__ */ e(L, { label: "Combos", sortKey: "comboCount", config: o, onSort: d, className: "pvx-hidden-below-sm" })
|
|
825
825
|
] }) }),
|
|
826
826
|
/* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: u.map((f) => {
|
|
827
827
|
const v = m === f.identifier;
|
|
@@ -831,7 +831,7 @@ function Fr({ drivers: r, isLoading: n, getUserDisplay: s, game: t, gameVersion:
|
|
|
831
831
|
driver: f,
|
|
832
832
|
getUserDisplay: s,
|
|
833
833
|
isExpanded: v,
|
|
834
|
-
onToggle: () =>
|
|
834
|
+
onToggle: () => l(v ? null : f.identifier),
|
|
835
835
|
colCount: x,
|
|
836
836
|
game: t,
|
|
837
837
|
gameVersion: a,
|
|
@@ -843,10 +843,10 @@ function Fr({ drivers: r, isLoading: n, getUserDisplay: s, game: t, gameVersion:
|
|
|
843
843
|
] }) })
|
|
844
844
|
] });
|
|
845
845
|
}
|
|
846
|
-
function _e({ driver: r, getUserDisplay: n, isExpanded: s, onToggle: t, colCount: a, game: i, gameVersion:
|
|
846
|
+
function _e({ driver: r, getUserDisplay: n, isExpanded: s, onToggle: t, colCount: a, game: i, gameVersion: o, onComboSelect: d }) {
|
|
847
847
|
const m = r.identifier;
|
|
848
|
-
return /* @__PURE__ */
|
|
849
|
-
/* @__PURE__ */
|
|
848
|
+
return /* @__PURE__ */ c(j, { children: [
|
|
849
|
+
/* @__PURE__ */ c(
|
|
850
850
|
"tr",
|
|
851
851
|
{
|
|
852
852
|
className: `pvx-row pvx-row--clickable ${r.rank <= 3 ? "pvx-row--podium" : ""}`,
|
|
@@ -856,36 +856,36 @@ function _e({ driver: r, getUserDisplay: n, isExpanded: s, onToggle: t, colCount
|
|
|
856
856
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ e(W, { userId: m, getUserDisplay: n }) }),
|
|
857
857
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: r.rating.toFixed(1) }),
|
|
858
858
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: r.distinctCars || "-" }),
|
|
859
|
-
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: /* @__PURE__ */
|
|
859
|
+
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: /* @__PURE__ */ c("span", { className: "pvx-rankings-combo-count", children: [
|
|
860
860
|
r.comboCount,
|
|
861
861
|
/* @__PURE__ */ e("svg", { className: `pvx-rankings-chevron ${s ? "pvx-rankings-chevron--open" : ""}`, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "m6 9 6 6 6-6" }) })
|
|
862
862
|
] }) })
|
|
863
863
|
]
|
|
864
864
|
}
|
|
865
865
|
),
|
|
866
|
-
s && r.combos && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: a, className: "pvx-rankings-combos-cell", children: /* @__PURE__ */ e("div", { className: "pvx-rankings-combos", children: r.combos.map((
|
|
867
|
-
const x =
|
|
868
|
-
return /* @__PURE__ */
|
|
866
|
+
s && r.combos && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: a, className: "pvx-rankings-combos-cell", children: /* @__PURE__ */ e("div", { className: "pvx-rankings-combos", children: r.combos.map((l, u) => {
|
|
867
|
+
const x = l.layout ? `${l.trackId}|${l.layout}` : l.trackId, f = d ? () => d({ track: x, car: l.carId, highlight: m, game: i, gameVersion: o }) : void 0;
|
|
868
|
+
return /* @__PURE__ */ c(
|
|
869
869
|
"div",
|
|
870
870
|
{
|
|
871
871
|
className: `pvx-rankings-combo ${f ? "pvx-rankings-combo--clickable" : ""}`,
|
|
872
872
|
onClick: f,
|
|
873
873
|
role: f ? "button" : void 0,
|
|
874
874
|
children: [
|
|
875
|
-
/* @__PURE__ */
|
|
876
|
-
/* @__PURE__ */ e("p", { className: "pvx-rankings-combo-track", children: A(
|
|
877
|
-
/* @__PURE__ */ e("p", { className: "pvx-rankings-combo-car", children: S(
|
|
875
|
+
/* @__PURE__ */ c("div", { className: "pvx-rankings-combo-info", children: [
|
|
876
|
+
/* @__PURE__ */ e("p", { className: "pvx-rankings-combo-track", children: A(l.trackId, l.layout, i) }),
|
|
877
|
+
/* @__PURE__ */ e("p", { className: "pvx-rankings-combo-car", children: S(l.carId) })
|
|
878
878
|
] }),
|
|
879
|
-
/* @__PURE__ */
|
|
880
|
-
/* @__PURE__ */ e("p", { className: "pvx-rankings-combo-time", children: I(
|
|
881
|
-
/* @__PURE__ */
|
|
882
|
-
|
|
879
|
+
/* @__PURE__ */ c("div", { className: "pvx-rankings-combo-stats", children: [
|
|
880
|
+
/* @__PURE__ */ e("p", { className: "pvx-rankings-combo-time", children: I(l.lapTimeMs) }),
|
|
881
|
+
/* @__PURE__ */ c("p", { className: `pvx-rankings-combo-pct ${l.percentile >= 75 ? "pvx-rankings-combo-pct--high" : l.percentile >= 50 ? "pvx-rankings-combo-pct--mid" : l.percentile >= 25 ? "pvx-rankings-combo-pct--low" : "pvx-rankings-combo-pct--bottom"}`, children: [
|
|
882
|
+
l.percentile.toFixed(0),
|
|
883
883
|
"%",
|
|
884
|
-
/* @__PURE__ */
|
|
884
|
+
/* @__PURE__ */ c("span", { className: "pvx-rankings-combo-rank", children: [
|
|
885
885
|
"(",
|
|
886
|
-
|
|
886
|
+
l.rank,
|
|
887
887
|
"/",
|
|
888
|
-
|
|
888
|
+
l.totalDrivers,
|
|
889
889
|
")"
|
|
890
890
|
] })
|
|
891
891
|
] })
|
|
@@ -972,8 +972,8 @@ function We(r) {
|
|
|
972
972
|
return r.reduce((n, s) => {
|
|
973
973
|
var t;
|
|
974
974
|
return (t = s.splits) != null && t.length ? n ? n.map((a, i) => {
|
|
975
|
-
const
|
|
976
|
-
return
|
|
975
|
+
const o = s.splits[i];
|
|
976
|
+
return o && o < a ? o : a;
|
|
977
977
|
}) : [...s.splits] : n;
|
|
978
978
|
}, null);
|
|
979
979
|
}
|
|
@@ -988,8 +988,8 @@ function Er({ competitions: r, isLoading: n, onSelect: s, onRegister: t, classNa
|
|
|
988
988
|
}
|
|
989
989
|
function Ge({ comp: r, onSelect: n, onRegister: s }) {
|
|
990
990
|
var p, N, h;
|
|
991
|
-
const { cdnUrl: t } = k(), a = r.posterCdnPath ? `${t}/${r.posterCdnPath}` : null, i = r.registration,
|
|
992
|
-
return /* @__PURE__ */
|
|
991
|
+
const { cdnUrl: t } = k(), a = r.posterCdnPath ? `${t}/${r.posterCdnPath}` : null, i = r.registration, o = (i == null ? void 0 : i.currentCount) || 0, d = i == null ? void 0 : i.maxParticipants, m = d && o >= d, l = (i == null ? void 0 : i.deadline) && new Date(i.deadline) < /* @__PURE__ */ new Date(), u = (i == null ? void 0 : i.isOpen) && !l && !m, x = /* @__PURE__ */ new Date(), f = (p = r.rounds) == null ? void 0 : p.find((g) => g.startTime && new Date(g.startTime) >= x), v = ((N = r.rounds) == null ? void 0 : N.length) || 0, b = ((h = r.rounds) == null ? void 0 : h.filter((g) => g.isFinalized).length) || 0;
|
|
992
|
+
return /* @__PURE__ */ c(
|
|
993
993
|
"div",
|
|
994
994
|
{
|
|
995
995
|
className: "pvx-comp-card",
|
|
@@ -1001,17 +1001,17 @@ function Ge({ comp: r, onSelect: n, onRegister: s }) {
|
|
|
1001
1001
|
},
|
|
1002
1002
|
children: [
|
|
1003
1003
|
/* @__PURE__ */ e("div", { className: "pvx-comp-card-poster", children: a ? /* @__PURE__ */ e("img", { src: a, alt: r.name, className: "pvx-comp-card-poster-img" }) : /* @__PURE__ */ e("div", { className: "pvx-comp-card-poster-placeholder", children: /* @__PURE__ */ e(Qe, {}) }) }),
|
|
1004
|
-
/* @__PURE__ */
|
|
1004
|
+
/* @__PURE__ */ c("div", { className: "pvx-comp-card-body", children: [
|
|
1005
1005
|
/* @__PURE__ */ e("h3", { className: "pvx-comp-card-title", children: r.name }),
|
|
1006
1006
|
r.description && /* @__PURE__ */ e("p", { className: "pvx-comp-card-desc", children: r.description }),
|
|
1007
|
-
/* @__PURE__ */
|
|
1007
|
+
/* @__PURE__ */ c("div", { className: "pvx-comp-card-pills", children: [
|
|
1008
1008
|
/* @__PURE__ */ e(He, { type: r.type }),
|
|
1009
1009
|
r.game && /* @__PURE__ */ e(z, { children: r.game.toUpperCase() }),
|
|
1010
1010
|
r.formatDescription && r.formatDescription.split(", ").map((g, y) => /* @__PURE__ */ e(z, { variant: "format", children: g }, y))
|
|
1011
1011
|
] }),
|
|
1012
1012
|
r.carsDescription && /* @__PURE__ */ e("div", { className: "pvx-comp-card-pills", children: r.carsDescription.split(", ").map((g, y) => /* @__PURE__ */ e(z, { children: g }, y)) }),
|
|
1013
|
-
/* @__PURE__ */
|
|
1014
|
-
f ? /* @__PURE__ */
|
|
1013
|
+
/* @__PURE__ */ c("div", { className: "pvx-comp-card-schedule", children: [
|
|
1014
|
+
f ? /* @__PURE__ */ c("span", { className: "pvx-comp-card-schedule-next", children: [
|
|
1015
1015
|
/* @__PURE__ */ e("span", { className: "pvx-comp-card-schedule-label", children: "Next:" }),
|
|
1016
1016
|
" ",
|
|
1017
1017
|
"R",
|
|
@@ -1020,13 +1020,13 @@ function Ge({ comp: r, onSelect: n, onRegister: s }) {
|
|
|
1020
1020
|
f.track || "TBD",
|
|
1021
1021
|
" — ",
|
|
1022
1022
|
Oe(f.startTime)
|
|
1023
|
-
] }) : v > 0 ? /* @__PURE__ */
|
|
1023
|
+
] }) : v > 0 ? /* @__PURE__ */ c("span", { className: "pvx-comp-card-schedule-next", children: [
|
|
1024
1024
|
b,
|
|
1025
1025
|
"/",
|
|
1026
1026
|
v,
|
|
1027
1027
|
" rounds completed"
|
|
1028
1028
|
] }) : null,
|
|
1029
|
-
v > 0 && /* @__PURE__ */
|
|
1029
|
+
v > 0 && /* @__PURE__ */ c("span", { className: "pvx-comp-card-round-count", children: [
|
|
1030
1030
|
v,
|
|
1031
1031
|
" round",
|
|
1032
1032
|
v !== 1 ? "s" : ""
|
|
@@ -1038,8 +1038,8 @@ function Ge({ comp: r, onSelect: n, onRegister: s }) {
|
|
|
1038
1038
|
competitionId: r.id,
|
|
1039
1039
|
regOpen: u,
|
|
1040
1040
|
isFull: m,
|
|
1041
|
-
deadlinePassed:
|
|
1042
|
-
regCount:
|
|
1041
|
+
deadlinePassed: l,
|
|
1042
|
+
regCount: o,
|
|
1043
1043
|
regMax: d,
|
|
1044
1044
|
onRegister: s
|
|
1045
1045
|
}
|
|
@@ -1049,10 +1049,10 @@ function Ge({ comp: r, onSelect: n, onRegister: s }) {
|
|
|
1049
1049
|
}
|
|
1050
1050
|
);
|
|
1051
1051
|
}
|
|
1052
|
-
function ze({ competitionId: r, regOpen: n, isFull: s, deadlinePassed: t, regCount: a, regMax: i, onRegister:
|
|
1053
|
-
const { isPowerMode: d } = J(), m = X(r), { data:
|
|
1054
|
-
return /* @__PURE__ */
|
|
1055
|
-
/* @__PURE__ */ e("div", { className: "pvx-comp-card-reg-info", children: /* @__PURE__ */
|
|
1052
|
+
function ze({ competitionId: r, regOpen: n, isFull: s, deadlinePassed: t, regCount: a, regMax: i, onRegister: o }) {
|
|
1053
|
+
const { isPowerMode: d } = J(), m = X(r), { data: l } = Z(r), u = (l == null ? void 0 : l.isRegistered) || !1, x = i ? a / i * 100 : 0, f = x >= 100 ? "full" : x >= 75 ? "warning" : "ok";
|
|
1054
|
+
return /* @__PURE__ */ c("div", { className: "pvx-comp-card-reg", children: [
|
|
1055
|
+
/* @__PURE__ */ e("div", { className: "pvx-comp-card-reg-info", children: /* @__PURE__ */ c("span", { className: `pvx-reg-capacity pvx-reg-capacity--${f}`, children: [
|
|
1056
1056
|
a,
|
|
1057
1057
|
"/",
|
|
1058
1058
|
i || "∞",
|
|
@@ -1063,7 +1063,7 @@ function ze({ competitionId: r, regOpen: n, isFull: s, deadlinePassed: t, regCou
|
|
|
1063
1063
|
{
|
|
1064
1064
|
className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--registered",
|
|
1065
1065
|
onClick: (v) => {
|
|
1066
|
-
v.stopPropagation(),
|
|
1066
|
+
v.stopPropagation(), o(r);
|
|
1067
1067
|
},
|
|
1068
1068
|
children: "✓ Registered"
|
|
1069
1069
|
}
|
|
@@ -1072,7 +1072,7 @@ function ze({ competitionId: r, regOpen: n, isFull: s, deadlinePassed: t, regCou
|
|
|
1072
1072
|
{
|
|
1073
1073
|
className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--open",
|
|
1074
1074
|
onClick: (v) => {
|
|
1075
|
-
v.stopPropagation(),
|
|
1075
|
+
v.stopPropagation(), o(r);
|
|
1076
1076
|
},
|
|
1077
1077
|
children: "Register"
|
|
1078
1078
|
}
|
|
@@ -1090,7 +1090,7 @@ function ze({ competitionId: r, regOpen: n, isFull: s, deadlinePassed: t, regCou
|
|
|
1090
1090
|
] });
|
|
1091
1091
|
}
|
|
1092
1092
|
function Qe() {
|
|
1093
|
-
return /* @__PURE__ */
|
|
1093
|
+
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: [
|
|
1094
1094
|
/* @__PURE__ */ e("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
|
|
1095
1095
|
/* @__PURE__ */ e("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
|
|
1096
1096
|
/* @__PURE__ */ e("path", { d: "M4 22h16" }),
|
|
@@ -1106,11 +1106,11 @@ function _r({ competitionId: r, className: n }) {
|
|
|
1106
1106
|
return /* @__PURE__ */ e(q, { message: "Loading standings..." });
|
|
1107
1107
|
if (!((d = s == null ? void 0 : s.standings) != null && d.length))
|
|
1108
1108
|
return /* @__PURE__ */ e(B, { message: "No standings data yet. Results will appear once rounds are finalised." });
|
|
1109
|
-
const
|
|
1110
|
-
return /* @__PURE__ */
|
|
1111
|
-
/* @__PURE__ */ e("div", { className: "pvx-card-header--split", children: /* @__PURE__ */
|
|
1109
|
+
const o = ((m = a == null ? void 0 : a.rounds) == null ? void 0 : m.filter((l) => l.isFinalized)) || [];
|
|
1110
|
+
return /* @__PURE__ */ c("div", { className: `pvx-card ${n || ""}`, children: [
|
|
1111
|
+
/* @__PURE__ */ e("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ c("div", { className: "pvx-card-header-left", children: [
|
|
1112
1112
|
/* @__PURE__ */ e("h3", { className: "pvx-card-title", children: "Championship Standings" }),
|
|
1113
|
-
/* @__PURE__ */
|
|
1113
|
+
/* @__PURE__ */ c("span", { className: "pvx-standings-subtitle", children: [
|
|
1114
1114
|
"After ",
|
|
1115
1115
|
s.roundsCompleted,
|
|
1116
1116
|
" round",
|
|
@@ -1118,66 +1118,66 @@ function _r({ competitionId: r, className: n }) {
|
|
|
1118
1118
|
s.countingRounds > 0 && ` (best ${s.countingRounds} count)`
|
|
1119
1119
|
] })
|
|
1120
1120
|
] }) }),
|
|
1121
|
-
/* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */
|
|
1122
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */
|
|
1121
|
+
/* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ c("table", { className: "pvx-table", children: [
|
|
1122
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ c("tr", { className: "pvx-thead-row", children: [
|
|
1123
1123
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
|
|
1124
1124
|
/* @__PURE__ */ e("th", { className: "pvx-th", children: "Driver" }),
|
|
1125
1125
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-th--center pvx-hidden-below-sm", children: "W" }),
|
|
1126
1126
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-th--center pvx-hidden-below-sm", children: "Pod" }),
|
|
1127
1127
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-th--center", children: "Points" }),
|
|
1128
|
-
|
|
1128
|
+
o.map((l) => /* @__PURE__ */ c(
|
|
1129
1129
|
"th",
|
|
1130
1130
|
{
|
|
1131
1131
|
className: "pvx-th pvx-th--center pvx-hidden-below-md",
|
|
1132
|
-
title:
|
|
1132
|
+
title: l.track || `Round ${l.roundNumber}`,
|
|
1133
1133
|
children: [
|
|
1134
1134
|
"R",
|
|
1135
|
-
|
|
1135
|
+
l.roundNumber
|
|
1136
1136
|
]
|
|
1137
1137
|
},
|
|
1138
|
-
|
|
1138
|
+
l.roundNumber
|
|
1139
1139
|
))
|
|
1140
1140
|
] }) }),
|
|
1141
|
-
/* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: s.standings.map((
|
|
1141
|
+
/* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: s.standings.map((l) => /* @__PURE__ */ e(
|
|
1142
1142
|
Ye,
|
|
1143
1143
|
{
|
|
1144
|
-
driver:
|
|
1145
|
-
finalizedRounds:
|
|
1144
|
+
driver: l,
|
|
1145
|
+
finalizedRounds: o
|
|
1146
1146
|
},
|
|
1147
|
-
|
|
1147
|
+
l.driverId || l.driverName
|
|
1148
1148
|
)) })
|
|
1149
1149
|
] }) })
|
|
1150
1150
|
] });
|
|
1151
1151
|
}
|
|
1152
1152
|
function Ye({ driver: r, finalizedRounds: n }) {
|
|
1153
|
-
var
|
|
1153
|
+
var o, d, m;
|
|
1154
1154
|
const s = r.position <= 3, t = new Map(
|
|
1155
|
-
((
|
|
1156
|
-
), a = ((d = r.roundResults) == null ? void 0 : d.filter((
|
|
1157
|
-
return /* @__PURE__ */
|
|
1155
|
+
((o = r.roundResults) == null ? void 0 : o.map((l) => [l.roundNumber, l])) || []
|
|
1156
|
+
), a = ((d = r.roundResults) == null ? void 0 : d.filter((l) => l.position === 1).length) || 0, i = ((m = r.roundResults) == null ? void 0 : m.filter((l) => l.position <= 3).length) || 0;
|
|
1157
|
+
return /* @__PURE__ */ c("tr", { className: `pvx-row ${s ? "pvx-row--podium" : ""}`, children: [
|
|
1158
1158
|
/* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(he, { position: r.position }) }),
|
|
1159
|
-
/* @__PURE__ */
|
|
1159
|
+
/* @__PURE__ */ c("td", { className: "pvx-td pvx-td--primary", children: [
|
|
1160
1160
|
/* @__PURE__ */ e(xe, { nation: r.nation }),
|
|
1161
1161
|
r.driverName
|
|
1162
1162
|
] }),
|
|
1163
1163
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: a || "-" }),
|
|
1164
1164
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: i || "-" }),
|
|
1165
1165
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-standings-total", children: r.totalPoints }),
|
|
1166
|
-
n.map((
|
|
1167
|
-
const u = t.get(
|
|
1166
|
+
n.map((l) => {
|
|
1167
|
+
const u = t.get(l.roundNumber), x = u == null ? void 0 : u.dropped;
|
|
1168
1168
|
return /* @__PURE__ */ e(
|
|
1169
1169
|
"td",
|
|
1170
1170
|
{
|
|
1171
1171
|
className: `pvx-td pvx-td--center pvx-hidden-below-md ${!x && (u == null ? void 0 : u.position) <= 3 ? "pvx-standings-cell--podium" : ""}`,
|
|
1172
|
-
children: u ? /* @__PURE__ */
|
|
1173
|
-
/* @__PURE__ */
|
|
1172
|
+
children: u ? /* @__PURE__ */ c("div", { className: `pvx-standings-round-cell ${x ? "pvx-standings-round-cell--dropped" : ""}`, children: [
|
|
1173
|
+
/* @__PURE__ */ c("span", { className: "pvx-standings-round-pos", children: [
|
|
1174
1174
|
"P",
|
|
1175
1175
|
u.position
|
|
1176
1176
|
] }),
|
|
1177
1177
|
/* @__PURE__ */ e("span", { className: "pvx-standings-round-pts", children: u.points })
|
|
1178
1178
|
] }) : /* @__PURE__ */ e("span", { className: "pvx-td--muted", children: "-" })
|
|
1179
1179
|
},
|
|
1180
|
-
|
|
1180
|
+
l.roundNumber
|
|
1181
1181
|
);
|
|
1182
1182
|
})
|
|
1183
1183
|
] });
|
|
@@ -1189,11 +1189,11 @@ function qr({ competitionId: r, roundNumber: n, className: s }) {
|
|
|
1189
1189
|
return /* @__PURE__ */ e(q, { message: "Loading results..." });
|
|
1190
1190
|
if (!t)
|
|
1191
1191
|
return /* @__PURE__ */ e(B, { message: "No results for this round." });
|
|
1192
|
-
const
|
|
1193
|
-
return /* @__PURE__ */
|
|
1194
|
-
/* @__PURE__ */
|
|
1195
|
-
/* @__PURE__ */
|
|
1196
|
-
/* @__PURE__ */
|
|
1192
|
+
const o = (t.sessions || []).find((l) => l.type === "RACE"), d = (m = o == null ? void 0 : o.results) == null ? void 0 : m.filter((l) => l.position <= 3).sort((l, u) => l.position - u.position);
|
|
1193
|
+
return /* @__PURE__ */ c("div", { className: `pvx-round-results ${s || ""}`, children: [
|
|
1194
|
+
/* @__PURE__ */ c("div", { className: "pvx-round-results-header", children: [
|
|
1195
|
+
/* @__PURE__ */ c("div", { children: [
|
|
1196
|
+
/* @__PURE__ */ c("h4", { className: "pvx-round-results-title", children: [
|
|
1197
1197
|
"Round ",
|
|
1198
1198
|
t.roundNumber,
|
|
1199
1199
|
t.track ? `: ${t.track}` : ""
|
|
@@ -1204,10 +1204,10 @@ function qr({ competitionId: r, roundNumber: n, className: s }) {
|
|
|
1204
1204
|
year: "numeric"
|
|
1205
1205
|
}) })
|
|
1206
1206
|
] }),
|
|
1207
|
-
(d == null ? void 0 : d.length) > 0 && /* @__PURE__ */ e("div", { className: "pvx-round-podium-summary", children: d.map((
|
|
1208
|
-
/* @__PURE__ */ e("span", { children: Ve[
|
|
1209
|
-
/* @__PURE__ */ e("span", { children:
|
|
1210
|
-
] },
|
|
1207
|
+
(d == null ? void 0 : d.length) > 0 && /* @__PURE__ */ e("div", { className: "pvx-round-podium-summary", children: d.map((l) => /* @__PURE__ */ c("span", { className: "pvx-round-podium-item", children: [
|
|
1208
|
+
/* @__PURE__ */ e("span", { children: Ve[l.position - 1] }),
|
|
1209
|
+
/* @__PURE__ */ e("span", { children: l.driverName })
|
|
1210
|
+
] }, l.driverId)) })
|
|
1211
1211
|
] }),
|
|
1212
1212
|
/* @__PURE__ */ e(Ze, { round: t })
|
|
1213
1213
|
] });
|
|
@@ -1217,8 +1217,8 @@ function Ze({ round: r, className: n }) {
|
|
|
1217
1217
|
const [s, t] = M(null), a = (r == null ? void 0 : r.sessions) || [];
|
|
1218
1218
|
if (!a.length)
|
|
1219
1219
|
return /* @__PURE__ */ e(B, { message: "No session data for this round." });
|
|
1220
|
-
const i = s || ((d = a.find((
|
|
1221
|
-
return /* @__PURE__ */
|
|
1220
|
+
const i = s || ((d = a.find((l) => l.type === "RACE")) == null ? void 0 : d.type) || ((m = a[0]) == null ? void 0 : m.type), o = a.find((l) => l.type === i) || a[0];
|
|
1221
|
+
return /* @__PURE__ */ c("div", { className: n || "", children: [
|
|
1222
1222
|
/* @__PURE__ */ e(
|
|
1223
1223
|
Ke,
|
|
1224
1224
|
{
|
|
@@ -1227,7 +1227,7 @@ function Ze({ round: r, className: n }) {
|
|
|
1227
1227
|
onSelect: t
|
|
1228
1228
|
}
|
|
1229
1229
|
),
|
|
1230
|
-
/* @__PURE__ */ e(Je, { session:
|
|
1230
|
+
/* @__PURE__ */ e(Je, { session: o })
|
|
1231
1231
|
] });
|
|
1232
1232
|
}
|
|
1233
1233
|
function Je({ session: r }) {
|
|
@@ -1236,13 +1236,13 @@ function Je({ session: r }) {
|
|
|
1236
1236
|
if (!((t = r.results) != null && t.length))
|
|
1237
1237
|
return /* @__PURE__ */ e(B, { message: `No results for ${r.type}.` });
|
|
1238
1238
|
const s = We(r.results);
|
|
1239
|
-
return /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */
|
|
1240
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */
|
|
1239
|
+
return /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ c("table", { className: "pvx-table", children: [
|
|
1240
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ c("tr", { className: "pvx-thead-row", children: [
|
|
1241
1241
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
|
|
1242
1242
|
/* @__PURE__ */ e("th", { className: "pvx-th", children: "Driver" }),
|
|
1243
1243
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "Car" }),
|
|
1244
1244
|
/* @__PURE__ */ e("th", { className: "pvx-th", children: "Best Lap" }),
|
|
1245
|
-
n && /* @__PURE__ */
|
|
1245
|
+
n && /* @__PURE__ */ c(j, { children: [
|
|
1246
1246
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "Laps" }),
|
|
1247
1247
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "Time / Gap" }),
|
|
1248
1248
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-th--center", children: "Points" })
|
|
@@ -1262,12 +1262,12 @@ function Je({ session: r }) {
|
|
|
1262
1262
|
}
|
|
1263
1263
|
function Xe({ result: r, isRace: n, fastestSplits: s, rowIndex: t }) {
|
|
1264
1264
|
const a = r.position <= 3;
|
|
1265
|
-
return /* @__PURE__ */
|
|
1265
|
+
return /* @__PURE__ */ c("tr", { className: `pvx-row ${a ? "pvx-row--podium" : ""}`, children: [
|
|
1266
1266
|
/* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(he, { position: r.position }) }),
|
|
1267
|
-
/* @__PURE__ */
|
|
1267
|
+
/* @__PURE__ */ c("td", { className: "pvx-td pvx-td--primary", children: [
|
|
1268
1268
|
/* @__PURE__ */ e(xe, { nation: r.nation }),
|
|
1269
1269
|
r.driverName,
|
|
1270
|
-
r.carNumber != null && /* @__PURE__ */
|
|
1270
|
+
r.carNumber != null && /* @__PURE__ */ c("span", { className: "pvx-car-number", children: [
|
|
1271
1271
|
"#",
|
|
1272
1272
|
r.carNumber
|
|
1273
1273
|
] }),
|
|
@@ -1284,12 +1284,12 @@ function Xe({ result: r, isRace: n, fastestSplits: s, rowIndex: t }) {
|
|
|
1284
1284
|
showAbove: t <= 1
|
|
1285
1285
|
}
|
|
1286
1286
|
) }),
|
|
1287
|
-
n && /* @__PURE__ */
|
|
1287
|
+
n && /* @__PURE__ */ c(j, { children: [
|
|
1288
1288
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-hidden-below-sm", children: r.lapsCompleted }),
|
|
1289
1289
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: r.position === 1 ? r.totalTime || "-" : r.gap || "-" }),
|
|
1290
|
-
/* @__PURE__ */
|
|
1290
|
+
/* @__PURE__ */ c("td", { className: "pvx-td pvx-td--center", children: [
|
|
1291
1291
|
/* @__PURE__ */ e("span", { className: "pvx-session-points", children: r.points }),
|
|
1292
|
-
r.pointsOverride !== 0 && r.pointsOverride && /* @__PURE__ */
|
|
1292
|
+
r.pointsOverride !== 0 && r.pointsOverride && /* @__PURE__ */ c("span", { className: "pvx-points-override", children: [
|
|
1293
1293
|
"(",
|
|
1294
1294
|
r.pointsOverride > 0 ? "+" : "",
|
|
1295
1295
|
r.pointsOverride,
|
|
@@ -1300,17 +1300,17 @@ function Xe({ result: r, isRace: n, fastestSplits: s, rowIndex: t }) {
|
|
|
1300
1300
|
] });
|
|
1301
1301
|
}
|
|
1302
1302
|
function er({ bestLap: r, hasBestLap: n, splits: s, fastestSplits: t, showAbove: a }) {
|
|
1303
|
-
return r ? /* @__PURE__ */
|
|
1303
|
+
return r ? /* @__PURE__ */ c("span", { className: `pvx-best-lap-cell ${n ? "pvx-best-lap-cell--fastest" : ""}`, children: [
|
|
1304
1304
|
/* @__PURE__ */ e("span", { className: "pvx-best-lap-time", children: r }),
|
|
1305
|
-
(s == null ? void 0 : s.length) > 0 && /* @__PURE__ */ e("span", { className: "pvx-splits-tooltip-anchor", children: /* @__PURE__ */ e("span", { className: `pvx-splits-tooltip ${a ? "" : "pvx-splits-tooltip--above"}`, children: s.map((i,
|
|
1306
|
-
const d = t && i === t[
|
|
1307
|
-
return /* @__PURE__ */
|
|
1308
|
-
/* @__PURE__ */
|
|
1305
|
+
(s == null ? void 0 : s.length) > 0 && /* @__PURE__ */ e("span", { className: "pvx-splits-tooltip-anchor", children: /* @__PURE__ */ e("span", { className: `pvx-splits-tooltip ${a ? "" : "pvx-splits-tooltip--above"}`, children: s.map((i, o) => {
|
|
1306
|
+
const d = t && i === t[o];
|
|
1307
|
+
return /* @__PURE__ */ c("span", { className: "pvx-splits-tooltip-row", children: [
|
|
1308
|
+
/* @__PURE__ */ c("span", { className: "pvx-splits-tooltip-label", children: [
|
|
1309
1309
|
"S",
|
|
1310
|
-
|
|
1310
|
+
o + 1
|
|
1311
1311
|
] }),
|
|
1312
1312
|
/* @__PURE__ */ e("span", { className: d ? "pvx-splits-tooltip-best" : "", children: i })
|
|
1313
|
-
] },
|
|
1313
|
+
] }, o);
|
|
1314
1314
|
}) }) })
|
|
1315
1315
|
] }) : /* @__PURE__ */ e("span", { className: "pvx-td--muted", children: "-" });
|
|
1316
1316
|
}
|
|
@@ -1318,11 +1318,11 @@ function Vr({ competitionId: r, className: n }) {
|
|
|
1318
1318
|
const { getSteamId: s } = k(), { data: t, isLoading: a } = oe(r), i = s();
|
|
1319
1319
|
if (a)
|
|
1320
1320
|
return /* @__PURE__ */ e(q, { message: "Loading drivers..." });
|
|
1321
|
-
const
|
|
1322
|
-
return
|
|
1323
|
-
var
|
|
1321
|
+
const o = (t == null ? void 0 : t.drivers) || (t == null ? void 0 : t.entries) || [];
|
|
1322
|
+
return o.length ? /* @__PURE__ */ e("div", { className: `pvx-entry-grid ${n || ""}`, children: o.map((d) => {
|
|
1323
|
+
var l, u;
|
|
1324
1324
|
const m = i && d.steamId === i;
|
|
1325
|
-
return /* @__PURE__ */
|
|
1325
|
+
return /* @__PURE__ */ c("div", { className: `pvx-entry-card ${m ? "pvx-entry-card--you" : ""}`, children: [
|
|
1326
1326
|
d.avatarUrl ? /* @__PURE__ */ e(
|
|
1327
1327
|
"img",
|
|
1328
1328
|
{
|
|
@@ -1330,8 +1330,8 @@ function Vr({ competitionId: r, className: n }) {
|
|
|
1330
1330
|
alt: "",
|
|
1331
1331
|
className: "pvx-entry-avatar"
|
|
1332
1332
|
}
|
|
1333
|
-
) : /* @__PURE__ */ e("div", { className: "pvx-entry-avatar pvx-entry-avatar--placeholder", children: ((u = (
|
|
1334
|
-
/* @__PURE__ */
|
|
1333
|
+
) : /* @__PURE__ */ e("div", { className: "pvx-entry-avatar pvx-entry-avatar--placeholder", children: ((u = (l = d.displayName) == null ? void 0 : l.charAt(0)) == null ? void 0 : u.toUpperCase()) || "?" }),
|
|
1334
|
+
/* @__PURE__ */ c("span", { className: "pvx-entry-name", children: [
|
|
1335
1335
|
d.displayName,
|
|
1336
1336
|
m && /* @__PURE__ */ e("span", { className: "pvx-entry-you", children: " (you)" })
|
|
1337
1337
|
] })
|
|
@@ -1344,12 +1344,12 @@ function jr({
|
|
|
1344
1344
|
className: s,
|
|
1345
1345
|
children: t
|
|
1346
1346
|
}) {
|
|
1347
|
-
const { data: a, isLoading: i } = Z(r), { isPowerMode:
|
|
1348
|
-
|
|
1347
|
+
const { data: a, isLoading: i } = Z(r), { isPowerMode: o } = J(), d = X(r), m = ce(r), l = le(r), u = (a == null ? void 0 : a.isRegistered) || !1, x = i || m.isPending || l.isPending, f = m.error || l.error || null, v = () => {
|
|
1348
|
+
o && m.mutate(n || {});
|
|
1349
1349
|
}, b = () => {
|
|
1350
|
-
|
|
1350
|
+
o && l.mutate();
|
|
1351
1351
|
};
|
|
1352
|
-
return typeof t == "function" ? t({ isRegistered: u, isLoading: x, register: v, withdraw: b, error: f, isPowerMode:
|
|
1352
|
+
return typeof t == "function" ? t({ isRegistered: u, isLoading: x, register: v, withdraw: b, error: f, isPowerMode: o, registrationUrl: d }) : o ? /* @__PURE__ */ e(
|
|
1353
1353
|
"button",
|
|
1354
1354
|
{
|
|
1355
1355
|
className: `pvx-comp-register-btn ${s || ""}`,
|
|
@@ -1369,7 +1369,7 @@ function jr({
|
|
|
1369
1369
|
);
|
|
1370
1370
|
}
|
|
1371
1371
|
function Kr({ competitionId: r, registration: n, onWithdrawSuccess: s, className: t }) {
|
|
1372
|
-
const { getSteamId: a } = k(), { isPowerMode: i } = J(),
|
|
1372
|
+
const { getSteamId: a } = k(), { isPowerMode: i } = J(), o = X(r), { data: d, isLoading: m } = Z(r), { data: l, isLoading: u } = oe(r), x = ce(r), f = le(r), v = a(), b = (d == null ? void 0 : d.isRegistered) || !1, p = (l == null ? void 0 : l.drivers) || (l == null ? void 0 : l.entries) || [], N = n || {}, h = p.length || N.currentCount || 0, g = N.maxParticipants && h >= N.maxParticipants, y = N.deadline && new Date(N.deadline) < /* @__PURE__ */ new Date(), R = N.isOpen && !y && !g;
|
|
1373
1373
|
return m || u ? /* @__PURE__ */ e(q, { message: "Loading registration..." }) : b ? /* @__PURE__ */ e("div", { className: `pvx-reg-panel ${t || ""}`, children: /* @__PURE__ */ e(
|
|
1374
1374
|
nr,
|
|
1375
1375
|
{
|
|
@@ -1377,7 +1377,7 @@ function Kr({ competitionId: r, registration: n, onWithdrawSuccess: s, className
|
|
|
1377
1377
|
drivers: p,
|
|
1378
1378
|
steamId: v,
|
|
1379
1379
|
isPowerMode: i,
|
|
1380
|
-
registrationUrl:
|
|
1380
|
+
registrationUrl: o,
|
|
1381
1381
|
withdrawMutation: f,
|
|
1382
1382
|
onWithdrawSuccess: s,
|
|
1383
1383
|
registration: N
|
|
@@ -1389,27 +1389,27 @@ function Kr({ competitionId: r, registration: n, onWithdrawSuccess: s, className
|
|
|
1389
1389
|
registerMutation: x,
|
|
1390
1390
|
registration: N
|
|
1391
1391
|
}
|
|
1392
|
-
) }) : /* @__PURE__ */ e("div", { className: `pvx-reg-panel ${t || ""}`, children: /* @__PURE__ */ e("a", { href:
|
|
1392
|
+
) }) : /* @__PURE__ */ e("div", { className: `pvx-reg-panel ${t || ""}`, children: /* @__PURE__ */ e("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) : /* @__PURE__ */ e("div", { className: `pvx-reg-panel ${t || ""}`, children: i ? /* @__PURE__ */ e("div", { className: "pvx-reg-status-msg", children: "Sign in to register for this competition." }) : /* @__PURE__ */ e("div", { className: "pvx-reg-status-msg", children: /* @__PURE__ */ e("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) }) : /* @__PURE__ */ c("div", { className: `pvx-reg-panel ${t || ""}`, children: [
|
|
1393
1393
|
/* @__PURE__ */ e("div", { className: "pvx-reg-status-msg", children: g ? "Registration is full." : y ? "Registration deadline has passed." : "Registration is closed." }),
|
|
1394
1394
|
p.length > 0 && /* @__PURE__ */ e(ge, { drivers: p, steamId: v })
|
|
1395
1395
|
] });
|
|
1396
1396
|
}
|
|
1397
1397
|
function rr({ competitionId: r, registerMutation: n, registration: s }) {
|
|
1398
|
-
const [t, a] = M(""), [i,
|
|
1398
|
+
const [t, a] = M(""), [i, o] = M("intermediate"), [d, m] = M(""), l = (v) => {
|
|
1399
1399
|
v.preventDefault(), n.mutate({
|
|
1400
1400
|
discordUsername: t || void 0,
|
|
1401
1401
|
experience: i,
|
|
1402
1402
|
comments: d || void 0
|
|
1403
1403
|
});
|
|
1404
1404
|
}, u = s || {}, x = u.currentCount || 0, f = u.maxParticipants;
|
|
1405
|
-
return /* @__PURE__ */
|
|
1406
|
-
/* @__PURE__ */
|
|
1405
|
+
return /* @__PURE__ */ c("form", { className: "pvx-reg-form", onSubmit: l, children: [
|
|
1406
|
+
/* @__PURE__ */ c("div", { className: "pvx-reg-form-header", children: [
|
|
1407
1407
|
/* @__PURE__ */ e("h3", { className: "pvx-reg-form-title", children: "Register" }),
|
|
1408
1408
|
f && /* @__PURE__ */ e(fe, { count: x, max: f })
|
|
1409
1409
|
] }),
|
|
1410
1410
|
n.error && /* @__PURE__ */ e("div", { className: "pvx-reg-error", children: n.error.message || "Registration failed" }),
|
|
1411
|
-
/* @__PURE__ */
|
|
1412
|
-
/* @__PURE__ */
|
|
1411
|
+
/* @__PURE__ */ c("div", { className: "pvx-reg-field", children: [
|
|
1412
|
+
/* @__PURE__ */ c("label", { className: "pvx-reg-label", htmlFor: `pvx-discord-${r}`, children: [
|
|
1413
1413
|
"Discord Username ",
|
|
1414
1414
|
/* @__PURE__ */ e("span", { className: "pvx-reg-optional", children: "(optional)" })
|
|
1415
1415
|
] }),
|
|
@@ -1425,15 +1425,15 @@ function rr({ competitionId: r, registerMutation: n, registration: s }) {
|
|
|
1425
1425
|
}
|
|
1426
1426
|
)
|
|
1427
1427
|
] }),
|
|
1428
|
-
/* @__PURE__ */
|
|
1428
|
+
/* @__PURE__ */ c("div", { className: "pvx-reg-field", children: [
|
|
1429
1429
|
/* @__PURE__ */ e("label", { className: "pvx-reg-label", htmlFor: `pvx-exp-${r}`, children: "Experience Level" }),
|
|
1430
|
-
/* @__PURE__ */
|
|
1430
|
+
/* @__PURE__ */ c(
|
|
1431
1431
|
"select",
|
|
1432
1432
|
{
|
|
1433
1433
|
id: `pvx-exp-${r}`,
|
|
1434
1434
|
className: "pvx-reg-select",
|
|
1435
1435
|
value: i,
|
|
1436
|
-
onChange: (v) =>
|
|
1436
|
+
onChange: (v) => o(v.target.value),
|
|
1437
1437
|
children: [
|
|
1438
1438
|
/* @__PURE__ */ e("option", { value: "beginner", children: "Beginner" }),
|
|
1439
1439
|
/* @__PURE__ */ e("option", { value: "intermediate", children: "Intermediate" }),
|
|
@@ -1442,8 +1442,8 @@ function rr({ competitionId: r, registerMutation: n, registration: s }) {
|
|
|
1442
1442
|
}
|
|
1443
1443
|
)
|
|
1444
1444
|
] }),
|
|
1445
|
-
/* @__PURE__ */
|
|
1446
|
-
/* @__PURE__ */
|
|
1445
|
+
/* @__PURE__ */ c("div", { className: "pvx-reg-field", children: [
|
|
1446
|
+
/* @__PURE__ */ c("label", { className: "pvx-reg-label", htmlFor: `pvx-comments-${r}`, children: [
|
|
1447
1447
|
"Comments ",
|
|
1448
1448
|
/* @__PURE__ */ e("span", { className: "pvx-reg-optional", children: "(optional)" })
|
|
1449
1449
|
] }),
|
|
@@ -1470,30 +1470,30 @@ function rr({ competitionId: r, registerMutation: n, registration: s }) {
|
|
|
1470
1470
|
) })
|
|
1471
1471
|
] });
|
|
1472
1472
|
}
|
|
1473
|
-
function nr({ competitionId: r, drivers: n, steamId: s, isPowerMode: t, registrationUrl: a, withdrawMutation: i, onWithdrawSuccess:
|
|
1474
|
-
const [m,
|
|
1473
|
+
function nr({ competitionId: r, drivers: n, steamId: s, isPowerMode: t, registrationUrl: a, withdrawMutation: i, onWithdrawSuccess: o, registration: d }) {
|
|
1474
|
+
const [m, l] = M(!1), u = () => {
|
|
1475
1475
|
i.mutate(void 0, {
|
|
1476
1476
|
onSuccess: () => {
|
|
1477
|
-
|
|
1477
|
+
l(!1), o && o();
|
|
1478
1478
|
}
|
|
1479
1479
|
});
|
|
1480
1480
|
}, x = d || {}, f = n.length || x.currentCount || 0, v = x.maxParticipants;
|
|
1481
|
-
return /* @__PURE__ */
|
|
1482
|
-
/* @__PURE__ */
|
|
1481
|
+
return /* @__PURE__ */ c(j, { children: [
|
|
1482
|
+
/* @__PURE__ */ c("div", { className: "pvx-reg-form-header", children: [
|
|
1483
1483
|
/* @__PURE__ */ e("h3", { className: "pvx-reg-form-title", children: "Registered Drivers" }),
|
|
1484
1484
|
v && /* @__PURE__ */ e(fe, { count: f, max: v })
|
|
1485
1485
|
] }),
|
|
1486
1486
|
/* @__PURE__ */ e(ge, { drivers: n, steamId: s }),
|
|
1487
1487
|
i.error && /* @__PURE__ */ e("div", { className: "pvx-reg-error", children: i.error.message || "Withdrawal failed" }),
|
|
1488
|
-
t ? /* @__PURE__ */ e("div", { className: "pvx-reg-actions", children: m ? /* @__PURE__ */
|
|
1488
|
+
t ? /* @__PURE__ */ e("div", { className: "pvx-reg-actions", children: m ? /* @__PURE__ */ c("div", { className: "pvx-reg-confirm", children: [
|
|
1489
1489
|
/* @__PURE__ */ e("p", { className: "pvx-reg-confirm-text", children: "Are you sure you want to unregister?" }),
|
|
1490
|
-
/* @__PURE__ */
|
|
1490
|
+
/* @__PURE__ */ c("div", { className: "pvx-reg-confirm-actions", children: [
|
|
1491
1491
|
/* @__PURE__ */ e(
|
|
1492
1492
|
"button",
|
|
1493
1493
|
{
|
|
1494
1494
|
type: "button",
|
|
1495
1495
|
className: "pvx-reg-cancel-btn",
|
|
1496
|
-
onClick: () =>
|
|
1496
|
+
onClick: () => l(!1),
|
|
1497
1497
|
children: "Cancel"
|
|
1498
1498
|
}
|
|
1499
1499
|
),
|
|
@@ -1513,7 +1513,7 @@ function nr({ competitionId: r, drivers: n, steamId: s, isPowerMode: t, registra
|
|
|
1513
1513
|
{
|
|
1514
1514
|
type: "button",
|
|
1515
1515
|
className: "pvx-reg-unregister-btn",
|
|
1516
|
-
onClick: () =>
|
|
1516
|
+
onClick: () => l(!0),
|
|
1517
1517
|
children: "Unregister"
|
|
1518
1518
|
}
|
|
1519
1519
|
) }) : /* @__PURE__ */ e("div", { className: "pvx-reg-actions", children: /* @__PURE__ */ e("a", { href: a, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Manage on PitVox" }) })
|
|
@@ -1523,19 +1523,19 @@ function ge({ drivers: r, steamId: n }) {
|
|
|
1523
1523
|
if (!r.length)
|
|
1524
1524
|
return /* @__PURE__ */ e("div", { className: "pvx-reg-no-drivers", children: "No drivers registered yet." });
|
|
1525
1525
|
const s = [...r].sort((t, a) => {
|
|
1526
|
-
const i = n && t.steamId === n ? -1 : 0,
|
|
1527
|
-
return i -
|
|
1526
|
+
const i = n && t.steamId === n ? -1 : 0, o = n && a.steamId === n ? -1 : 0;
|
|
1527
|
+
return i - o;
|
|
1528
1528
|
});
|
|
1529
1529
|
return /* @__PURE__ */ e("div", { className: "pvx-reg-driver-list", children: s.map((t) => {
|
|
1530
|
-
var i,
|
|
1530
|
+
var i, o;
|
|
1531
1531
|
const a = n && t.steamId === n;
|
|
1532
|
-
return /* @__PURE__ */
|
|
1532
|
+
return /* @__PURE__ */ c(
|
|
1533
1533
|
"div",
|
|
1534
1534
|
{
|
|
1535
1535
|
className: `pvx-reg-driver-row ${a ? "pvx-reg-driver-row--you" : ""}`,
|
|
1536
1536
|
children: [
|
|
1537
|
-
t.avatarUrl ? /* @__PURE__ */ e("img", { src: t.avatarUrl, alt: "", className: "pvx-reg-driver-avatar" }) : /* @__PURE__ */ e("div", { className: "pvx-reg-driver-avatar pvx-reg-driver-avatar--placeholder", children: ((
|
|
1538
|
-
/* @__PURE__ */
|
|
1537
|
+
t.avatarUrl ? /* @__PURE__ */ e("img", { src: t.avatarUrl, alt: "", className: "pvx-reg-driver-avatar" }) : /* @__PURE__ */ e("div", { className: "pvx-reg-driver-avatar pvx-reg-driver-avatar--placeholder", children: ((o = (i = t.displayName) == null ? void 0 : i.charAt(0)) == null ? void 0 : o.toUpperCase()) || "?" }),
|
|
1538
|
+
/* @__PURE__ */ c("span", { className: "pvx-reg-driver-name", children: [
|
|
1539
1539
|
t.displayName,
|
|
1540
1540
|
a && /* @__PURE__ */ e("span", { className: "pvx-entry-you", children: " (you)" })
|
|
1541
1541
|
] })
|
|
@@ -1547,7 +1547,7 @@ function ge({ drivers: r, steamId: n }) {
|
|
|
1547
1547
|
}
|
|
1548
1548
|
function fe({ count: r, max: n }) {
|
|
1549
1549
|
const s = n ? r / n * 100 : 0, t = s >= 100 ? "full" : s >= 75 ? "warning" : "ok";
|
|
1550
|
-
return /* @__PURE__ */
|
|
1550
|
+
return /* @__PURE__ */ c("span", { className: `pvx-reg-capacity pvx-reg-capacity--${t}`, children: [
|
|
1551
1551
|
r,
|
|
1552
1552
|
"/",
|
|
1553
1553
|
n,
|
|
@@ -1627,11 +1627,11 @@ function ar() {
|
|
|
1627
1627
|
return u != null && u.competitions ? u.competitions.filter((x) => x.partnerSlug === n) : [];
|
|
1628
1628
|
},
|
|
1629
1629
|
staleTime: 6e4
|
|
1630
|
-
}),
|
|
1631
|
-
queries:
|
|
1630
|
+
}), o = (a == null ? void 0 : a.map((u) => u.id)) || [], d = Re({
|
|
1631
|
+
queries: o.map((u) => ({
|
|
1632
1632
|
queryKey: ["pitvox", "competition", n, u, "entrylist"],
|
|
1633
1633
|
queryFn: () => T(r, `competitions/${n}/${u}/entrylist.json`),
|
|
1634
|
-
enabled: !!t &&
|
|
1634
|
+
enabled: !!t && o.length > 0,
|
|
1635
1635
|
staleTime: 6e4
|
|
1636
1636
|
}))
|
|
1637
1637
|
}), m = d.some((u) => u.isLoading);
|
|
@@ -1698,7 +1698,7 @@ function cr() {
|
|
|
1698
1698
|
...i,
|
|
1699
1699
|
unreadCount: Math.max(0, (i.unreadCount || 0) - 1),
|
|
1700
1700
|
notifications: i.notifications.map(
|
|
1701
|
-
(
|
|
1701
|
+
(o) => o.id === a ? { ...o, isRead: !0, readAt: (/* @__PURE__ */ new Date()).toISOString() } : o
|
|
1702
1702
|
)
|
|
1703
1703
|
} : i
|
|
1704
1704
|
);
|
|
@@ -1731,11 +1731,11 @@ function lr() {
|
|
|
1731
1731
|
}
|
|
1732
1732
|
function dr({ driverName: r, avatarUrl: n, memberSince: s, className: t = "" }) {
|
|
1733
1733
|
const a = s ? new Date(s).toLocaleDateString("en-GB", { day: "2-digit", month: "2-digit", year: "numeric" }) : null;
|
|
1734
|
-
return /* @__PURE__ */
|
|
1734
|
+
return /* @__PURE__ */ c("div", { className: `pvx-card pvx-dash-profile ${t}`, children: [
|
|
1735
1735
|
n ? /* @__PURE__ */ e("img", { src: n, alt: "", className: "pvx-dash-profile-avatar" }) : /* @__PURE__ */ e("div", { className: "pvx-dash-profile-avatar pvx-dash-profile-avatar--placeholder", children: (r || "?")[0].toUpperCase() }),
|
|
1736
|
-
/* @__PURE__ */
|
|
1736
|
+
/* @__PURE__ */ c("div", { className: "pvx-dash-profile-info", children: [
|
|
1737
1737
|
/* @__PURE__ */ e("h2", { className: "pvx-dash-profile-name", children: r }),
|
|
1738
|
-
a && /* @__PURE__ */
|
|
1738
|
+
a && /* @__PURE__ */ c("p", { className: "pvx-dash-profile-since", children: [
|
|
1739
1739
|
"Racing since ",
|
|
1740
1740
|
a
|
|
1741
1741
|
] })
|
|
@@ -1743,7 +1743,7 @@ function dr({ driverName: r, avatarUrl: n, memberSince: s, className: t = "" })
|
|
|
1743
1743
|
] });
|
|
1744
1744
|
}
|
|
1745
1745
|
function pr() {
|
|
1746
|
-
return /* @__PURE__ */
|
|
1746
|
+
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: [
|
|
1747
1747
|
/* @__PURE__ */ e("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
|
|
1748
1748
|
/* @__PURE__ */ e("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
|
|
1749
1749
|
/* @__PURE__ */ e("line", { x1: "10", y1: "3", x2: "8", y2: "21" }),
|
|
@@ -1751,7 +1751,7 @@ function pr() {
|
|
|
1751
1751
|
] });
|
|
1752
1752
|
}
|
|
1753
1753
|
function ur() {
|
|
1754
|
-
return /* @__PURE__ */
|
|
1754
|
+
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: [
|
|
1755
1755
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1756
1756
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "2" }),
|
|
1757
1757
|
/* @__PURE__ */ e("path", { d: "M12 14v4" }),
|
|
@@ -1764,18 +1764,11 @@ function mr() {
|
|
|
1764
1764
|
}
|
|
1765
1765
|
function te({ items: r, labelKey: n, countKey: s }) {
|
|
1766
1766
|
if (!(r != null && r.length)) return null;
|
|
1767
|
-
const t = r.slice().sort((a, i) => i[s] - a[s])
|
|
1768
|
-
return /* @__PURE__ */
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
] }, i)),
|
|
1773
|
-
r.length > 10 && /* @__PURE__ */ o("div", { className: "pvx-dash-tooltip-row pvx-dash-tooltip-more", children: [
|
|
1774
|
-
"+",
|
|
1775
|
-
r.length - 10,
|
|
1776
|
-
" more"
|
|
1777
|
-
] })
|
|
1778
|
-
] });
|
|
1767
|
+
const t = r.slice().sort((a, i) => i[s] - a[s]);
|
|
1768
|
+
return /* @__PURE__ */ e("div", { className: "pvx-dash-tooltip pvx-dash-tooltip--scrollable", children: t.map((a, i) => /* @__PURE__ */ c("div", { className: "pvx-dash-tooltip-row", children: [
|
|
1769
|
+
/* @__PURE__ */ e("span", { className: "pvx-dash-tooltip-label", children: a[n] }),
|
|
1770
|
+
/* @__PURE__ */ e("span", { className: "pvx-dash-tooltip-value", children: a[s] })
|
|
1771
|
+
] }, i)) });
|
|
1779
1772
|
}
|
|
1780
1773
|
function vr({ stats: r, rating: n, className: s = "" }) {
|
|
1781
1774
|
if (!r) return null;
|
|
@@ -1786,29 +1779,29 @@ function vr({ stats: r, rating: n, className: s = "" }) {
|
|
|
1786
1779
|
name: S(i.carId),
|
|
1787
1780
|
lapCount: i.lapCount
|
|
1788
1781
|
}));
|
|
1789
|
-
return /* @__PURE__ */
|
|
1790
|
-
/* @__PURE__ */
|
|
1782
|
+
return /* @__PURE__ */ c("div", { className: `pvx-dash-stats ${s}`, children: [
|
|
1783
|
+
/* @__PURE__ */ c("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--has-tooltip", children: [
|
|
1791
1784
|
/* @__PURE__ */ e(pr, {}),
|
|
1792
|
-
/* @__PURE__ */
|
|
1785
|
+
/* @__PURE__ */ c("div", { className: "pvx-dash-stat-content", children: [
|
|
1793
1786
|
/* @__PURE__ */ e("span", { className: "pvx-dash-stat-value", children: r.lapCount.toLocaleString() }),
|
|
1794
1787
|
/* @__PURE__ */ e("span", { className: "pvx-dash-stat-label", children: "Total Laps" })
|
|
1795
1788
|
] }),
|
|
1796
1789
|
/* @__PURE__ */ e(te, { items: t, labelKey: "name", countKey: "lapCount" })
|
|
1797
1790
|
] }),
|
|
1798
|
-
/* @__PURE__ */
|
|
1791
|
+
/* @__PURE__ */ c("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--has-tooltip", children: [
|
|
1799
1792
|
/* @__PURE__ */ e(ur, {}),
|
|
1800
|
-
/* @__PURE__ */
|
|
1793
|
+
/* @__PURE__ */ c("div", { className: "pvx-dash-stat-content", children: [
|
|
1801
1794
|
/* @__PURE__ */ e("span", { className: "pvx-dash-stat-value", children: r.carBreakdown.length }),
|
|
1802
1795
|
/* @__PURE__ */ e("span", { className: "pvx-dash-stat-label", children: "Cars Used" })
|
|
1803
1796
|
] }),
|
|
1804
1797
|
/* @__PURE__ */ e(te, { items: a, labelKey: "name", countKey: "lapCount" })
|
|
1805
1798
|
] }),
|
|
1806
|
-
n && /* @__PURE__ */
|
|
1799
|
+
n && /* @__PURE__ */ c("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--rating", children: [
|
|
1807
1800
|
/* @__PURE__ */ e(mr, {}),
|
|
1808
|
-
/* @__PURE__ */
|
|
1801
|
+
/* @__PURE__ */ c("div", { className: "pvx-dash-stat-content", children: [
|
|
1809
1802
|
/* @__PURE__ */ e("span", { className: "pvx-dash-stat-value", children: n.rating.toFixed(1) }),
|
|
1810
1803
|
/* @__PURE__ */ e("span", { className: "pvx-dash-stat-label", children: "Driver Rating" }),
|
|
1811
|
-
/* @__PURE__ */
|
|
1804
|
+
/* @__PURE__ */ c("span", { className: "pvx-dash-stat-sub", children: [
|
|
1812
1805
|
"#",
|
|
1813
1806
|
n.rank,
|
|
1814
1807
|
" of ",
|
|
@@ -1823,9 +1816,9 @@ function hr({ records: r, className: n = "" }) {
|
|
|
1823
1816
|
const i = t.recordedAt ? new Date(t.recordedAt).getTime() : 0;
|
|
1824
1817
|
return (a.recordedAt ? new Date(a.recordedAt).getTime() : 0) - i;
|
|
1825
1818
|
}) : [], [r]);
|
|
1826
|
-
return s.length ? /* @__PURE__ */
|
|
1827
|
-
/* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */
|
|
1828
|
-
/* @__PURE__ */ e("span", { className: "pvx-dash-records-icon", children: /* @__PURE__ */
|
|
1819
|
+
return s.length ? /* @__PURE__ */ c("div", { className: `pvx-card ${n}`, children: [
|
|
1820
|
+
/* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ c("h3", { className: "pvx-card-title", children: [
|
|
1821
|
+
/* @__PURE__ */ e("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: [
|
|
1829
1822
|
/* @__PURE__ */ e("path", { d: "M6 9H4.5a2.5 2.5 0 010-5H6" }),
|
|
1830
1823
|
/* @__PURE__ */ e("path", { d: "M18 9h1.5a2.5 2.5 0 000-5H18" }),
|
|
1831
1824
|
/* @__PURE__ */ e("path", { d: "M4 22h16" }),
|
|
@@ -1834,20 +1827,20 @@ function hr({ records: r, className: n = "" }) {
|
|
|
1834
1827
|
/* @__PURE__ */ e("path", { d: "M18 2H6v7a6 6 0 0012 0V2z" })
|
|
1835
1828
|
] }) }),
|
|
1836
1829
|
"Current Records",
|
|
1837
|
-
/* @__PURE__ */
|
|
1830
|
+
/* @__PURE__ */ c("span", { className: "pvx-dash-records-count", children: [
|
|
1838
1831
|
"(",
|
|
1839
1832
|
s.length,
|
|
1840
1833
|
")"
|
|
1841
1834
|
] })
|
|
1842
1835
|
] }) }),
|
|
1843
|
-
/* @__PURE__ */ e("div", { className: "pvx-dash-records-list", children: s.map((t, a) => /* @__PURE__ */
|
|
1844
|
-
/* @__PURE__ */
|
|
1836
|
+
/* @__PURE__ */ e("div", { className: "pvx-dash-records-list", children: s.map((t, a) => /* @__PURE__ */ c("div", { className: "pvx-dash-record-row", children: [
|
|
1837
|
+
/* @__PURE__ */ c("div", { className: "pvx-dash-record-info", children: [
|
|
1845
1838
|
/* @__PURE__ */ e("span", { className: "pvx-dash-record-track", children: A(t.trackId, t.layout, t.game) }),
|
|
1846
1839
|
/* @__PURE__ */ e("span", { className: "pvx-dash-record-car", children: S(t.carId) })
|
|
1847
1840
|
] }),
|
|
1848
|
-
/* @__PURE__ */
|
|
1841
|
+
/* @__PURE__ */ c("div", { className: "pvx-dash-record-time", children: [
|
|
1849
1842
|
/* @__PURE__ */ e("span", { className: "pvx-dash-record-lap", children: I(t.lapTimeMs) }),
|
|
1850
|
-
/* @__PURE__ */
|
|
1843
|
+
/* @__PURE__ */ c("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${t.game || "evo"}`, children: [
|
|
1851
1844
|
(t.game || "evo").toUpperCase(),
|
|
1852
1845
|
t.gameVersion ? ` ${t.gameVersion}` : ""
|
|
1853
1846
|
] })
|
|
@@ -1855,45 +1848,58 @@ function hr({ records: r, className: n = "" }) {
|
|
|
1855
1848
|
] }, a)) })
|
|
1856
1849
|
] }) : null;
|
|
1857
1850
|
}
|
|
1858
|
-
function xr({ events: r, isLoading: n, className: s }) {
|
|
1859
|
-
|
|
1860
|
-
/* @__PURE__ */ e("div", { className: "pvx-
|
|
1851
|
+
function xr({ events: r, isLoading: n, className: s, limit: t = 3 }) {
|
|
1852
|
+
if (n)
|
|
1853
|
+
return /* @__PURE__ */ e("div", { className: "pvx-loading", children: "Loading upcoming events..." });
|
|
1854
|
+
if (!(r != null && r.length))
|
|
1855
|
+
return null;
|
|
1856
|
+
const a = t ? r.slice(0, t) : r, i = r.length - a.length;
|
|
1857
|
+
return /* @__PURE__ */ c("div", { className: `pvx-card ${s || ""}`, children: [
|
|
1858
|
+
/* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ c("h3", { className: "pvx-card-title", children: [
|
|
1861
1859
|
/* @__PURE__ */ e(fr, {}),
|
|
1862
1860
|
"Upcoming Events",
|
|
1863
|
-
/* @__PURE__ */
|
|
1861
|
+
/* @__PURE__ */ c("span", { className: "pvx-dash-records-count", children: [
|
|
1864
1862
|
"(",
|
|
1865
1863
|
r.length,
|
|
1866
1864
|
")"
|
|
1867
1865
|
] })
|
|
1868
1866
|
] }) }),
|
|
1869
|
-
/* @__PURE__ */
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
/* @__PURE__ */
|
|
1876
|
-
|
|
1877
|
-
"
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1867
|
+
/* @__PURE__ */ c("div", { className: "pvx-upcoming-list", children: [
|
|
1868
|
+
a.map((o) => /* @__PURE__ */ c(
|
|
1869
|
+
"div",
|
|
1870
|
+
{
|
|
1871
|
+
className: `pvx-upcoming-item ${o.isNext ? "pvx-upcoming-item--next" : ""}`,
|
|
1872
|
+
children: [
|
|
1873
|
+
/* @__PURE__ */ c("div", { className: "pvx-upcoming-info", children: [
|
|
1874
|
+
/* @__PURE__ */ e("span", { className: "pvx-upcoming-comp", children: o.competitionName }),
|
|
1875
|
+
/* @__PURE__ */ c("span", { className: "pvx-upcoming-round", children: [
|
|
1876
|
+
"Round ",
|
|
1877
|
+
o.roundNumber,
|
|
1878
|
+
": ",
|
|
1879
|
+
o.track
|
|
1880
|
+
] })
|
|
1881
|
+
] }),
|
|
1882
|
+
/* @__PURE__ */ c("div", { className: "pvx-upcoming-time", children: [
|
|
1883
|
+
/* @__PURE__ */ e("span", { className: "pvx-upcoming-date", children: new Date(o.startTime).toLocaleDateString("en-GB", {
|
|
1884
|
+
day: "numeric",
|
|
1885
|
+
month: "short",
|
|
1886
|
+
year: "numeric"
|
|
1887
|
+
}) }),
|
|
1888
|
+
/* @__PURE__ */ e("span", { className: "pvx-upcoming-relative", children: gr(o.startTime) }),
|
|
1889
|
+
o.isNext && /* @__PURE__ */ e("span", { className: "pvx-upcoming-badge", children: "Next" })
|
|
1881
1890
|
] })
|
|
1882
|
-
]
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
`${t.competitionId}-${t.roundNumber}`
|
|
1895
|
-
)) })
|
|
1896
|
-
] }) : null;
|
|
1891
|
+
]
|
|
1892
|
+
},
|
|
1893
|
+
`${o.competitionId}-${o.roundNumber}`
|
|
1894
|
+
)),
|
|
1895
|
+
i > 0 && /* @__PURE__ */ c("div", { className: "pvx-upcoming-remaining", children: [
|
|
1896
|
+
"+",
|
|
1897
|
+
i,
|
|
1898
|
+
" more event",
|
|
1899
|
+
i !== 1 ? "s" : ""
|
|
1900
|
+
] })
|
|
1901
|
+
] })
|
|
1902
|
+
] });
|
|
1897
1903
|
}
|
|
1898
1904
|
function gr(r) {
|
|
1899
1905
|
const n = new Date(r).getTime() - Date.now();
|
|
@@ -1911,16 +1917,16 @@ function gr(r) {
|
|
|
1911
1917
|
return se(r);
|
|
1912
1918
|
}
|
|
1913
1919
|
function fr() {
|
|
1914
|
-
return /* @__PURE__ */
|
|
1920
|
+
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: [
|
|
1915
1921
|
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
|
|
1916
1922
|
/* @__PURE__ */ e("path", { d: "M16 2v4M8 2v4M3 10h18" })
|
|
1917
1923
|
] });
|
|
1918
1924
|
}
|
|
1919
1925
|
function Nr({ notifications: r, unreadCount: n = 0, onMarkRead: s, onMarkAllRead: t, isLoading: a, className: i }) {
|
|
1920
|
-
const
|
|
1921
|
-
return a ? /* @__PURE__ */ e("div", { className: "pvx-loading", children: "Loading notifications..." }) : /* @__PURE__ */
|
|
1922
|
-
/* @__PURE__ */
|
|
1923
|
-
/* @__PURE__ */
|
|
1926
|
+
const o = ie();
|
|
1927
|
+
return a ? /* @__PURE__ */ e("div", { className: "pvx-loading", children: "Loading notifications..." }) : /* @__PURE__ */ c("div", { className: `pvx-card ${i || ""}`, children: [
|
|
1928
|
+
/* @__PURE__ */ c("div", { className: "pvx-card-header", children: [
|
|
1929
|
+
/* @__PURE__ */ c("h3", { className: "pvx-card-title", children: [
|
|
1924
1930
|
/* @__PURE__ */ e(kr, {}),
|
|
1925
1931
|
"Notifications",
|
|
1926
1932
|
n > 0 && /* @__PURE__ */ e("span", { className: "pvx-notif-badge", children: n > 99 ? "99+" : n })
|
|
@@ -1931,7 +1937,7 @@ function Nr({ notifications: r, unreadCount: n = 0, onMarkRead: s, onMarkAllRead
|
|
|
1931
1937
|
br,
|
|
1932
1938
|
{
|
|
1933
1939
|
notification: d,
|
|
1934
|
-
getUserDisplay:
|
|
1940
|
+
getUserDisplay: o,
|
|
1935
1941
|
onMarkRead: s
|
|
1936
1942
|
},
|
|
1937
1943
|
d.id
|
|
@@ -1942,14 +1948,14 @@ function br({ notification: r, getUserDisplay: n, onMarkRead: s }) {
|
|
|
1942
1948
|
const t = () => {
|
|
1943
1949
|
!r.isRead && s && s(r.id);
|
|
1944
1950
|
};
|
|
1945
|
-
return /* @__PURE__ */
|
|
1951
|
+
return /* @__PURE__ */ c(
|
|
1946
1952
|
"button",
|
|
1947
1953
|
{
|
|
1948
1954
|
className: `pvx-notif-item ${r.isRead ? "" : "pvx-notif-item--unread"}`,
|
|
1949
1955
|
onClick: t,
|
|
1950
1956
|
children: [
|
|
1951
1957
|
/* @__PURE__ */ e(yr, { type: r.type }),
|
|
1952
|
-
/* @__PURE__ */
|
|
1958
|
+
/* @__PURE__ */ c("div", { className: "pvx-notif-content", children: [
|
|
1953
1959
|
/* @__PURE__ */ e("span", { className: "pvx-notif-message", children: Se(r, n) }),
|
|
1954
1960
|
/* @__PURE__ */ e("span", { className: "pvx-notif-time", children: se(r.createdAt) })
|
|
1955
1961
|
] }),
|
|
@@ -1959,10 +1965,10 @@ function br({ notification: r, getUserDisplay: n, onMarkRead: s }) {
|
|
|
1959
1965
|
);
|
|
1960
1966
|
}
|
|
1961
1967
|
function yr({ type: r }) {
|
|
1962
|
-
return r === "RECORD_BEATEN" ? /* @__PURE__ */ e("span", { className: "pvx-notif-icon pvx-notif-icon--beaten", children: /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "m7 7 10 10M17 7v10H7" }) }) }) : r === "ADMIN_MESSAGE" ? /* @__PURE__ */ e("span", { className: "pvx-notif-icon pvx-notif-icon--admin", children: /* @__PURE__ */
|
|
1968
|
+
return r === "RECORD_BEATEN" ? /* @__PURE__ */ e("span", { className: "pvx-notif-icon pvx-notif-icon--beaten", children: /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "m7 7 10 10M17 7v10H7" }) }) }) : r === "ADMIN_MESSAGE" ? /* @__PURE__ */ e("span", { className: "pvx-notif-icon pvx-notif-icon--admin", children: /* @__PURE__ */ c("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1963
1969
|
/* @__PURE__ */ e("path", { d: "m3 11 18-5v12L3 13v-2z" }),
|
|
1964
1970
|
/* @__PURE__ */ e("path", { d: "M11.6 16.8a3 3 0 1 1-5.8-1.6" })
|
|
1965
|
-
] }) }) : /* @__PURE__ */ e("span", { className: "pvx-notif-icon pvx-notif-icon--record", children: /* @__PURE__ */
|
|
1971
|
+
] }) }) : /* @__PURE__ */ e("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: [
|
|
1966
1972
|
/* @__PURE__ */ e("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
|
|
1967
1973
|
/* @__PURE__ */ e("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
|
|
1968
1974
|
/* @__PURE__ */ e("path", { d: "M4 22h16" }),
|
|
@@ -1972,14 +1978,14 @@ function yr({ type: r }) {
|
|
|
1972
1978
|
] }) });
|
|
1973
1979
|
}
|
|
1974
1980
|
function kr() {
|
|
1975
|
-
return /* @__PURE__ */
|
|
1981
|
+
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: [
|
|
1976
1982
|
/* @__PURE__ */ e("path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" }),
|
|
1977
1983
|
/* @__PURE__ */ e("path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0" })
|
|
1978
1984
|
] });
|
|
1979
1985
|
}
|
|
1980
1986
|
function Wr({ steamId: r, avatarUrl: n, memberSince: s, className: t = "" }) {
|
|
1981
|
-
const { data: a, isLoading: i, error:
|
|
1982
|
-
return i || m ? /* @__PURE__ */ e("div", { className: "pvx-loading", children: "Loading dashboard..." }) :
|
|
1987
|
+
const { data: a, isLoading: i, error: o } = tr(r), { data: d, isLoading: m } = sr(r), { data: l, isLoading: u } = ar(), x = ir(), { data: f, isLoading: v } = or({ limit: 10 }), b = cr(), p = lr();
|
|
1988
|
+
return i || m ? /* @__PURE__ */ e("div", { className: "pvx-loading", children: "Loading dashboard..." }) : o ? /* @__PURE__ */ e("div", { className: "pvx-empty", children: "Failed to load dashboard data." }) : a ? /* @__PURE__ */ c("div", { className: `pvx-dash ${t}`, children: [
|
|
1983
1989
|
/* @__PURE__ */ e(
|
|
1984
1990
|
dr,
|
|
1985
1991
|
{
|
|
@@ -1989,8 +1995,8 @@ function Wr({ steamId: r, avatarUrl: n, memberSince: s, className: t = "" }) {
|
|
|
1989
1995
|
}
|
|
1990
1996
|
),
|
|
1991
1997
|
/* @__PURE__ */ e(vr, { stats: a, rating: d }),
|
|
1992
|
-
r && /* @__PURE__ */ e(xr, { events:
|
|
1993
|
-
/* @__PURE__ */
|
|
1998
|
+
r && /* @__PURE__ */ e(xr, { events: l, isLoading: u }),
|
|
1999
|
+
/* @__PURE__ */ c("div", { className: `pvx-dash-row ${x ? "pvx-dash-row--2col" : ""}`, children: [
|
|
1994
2000
|
/* @__PURE__ */ e(hr, { records: a.currentRecords }),
|
|
1995
2001
|
x && /* @__PURE__ */ e(
|
|
1996
2002
|
Nr,
|