@burdenoff/microfe-atheletebridge 2026.1124.1 → 2026.1128.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atheletebridge/admin/AdminDashboardPage.js +4 -0
- package/dist/atheletebridge/admin/AdminDashboardPage.js.map +1 -1
- package/dist/atheletebridge/components/AthleteSelect.js +23 -22
- package/dist/atheletebridge/components/AthleteSelect.js.map +1 -1
- package/dist/atheletebridge/components/EmptyState.d.ts +8 -0
- package/dist/atheletebridge/components/EmptyState.js +42 -29
- package/dist/atheletebridge/components/EmptyState.js.map +1 -1
- package/dist/atheletebridge/components/FilterSelect.js +10 -9
- package/dist/atheletebridge/components/FilterSelect.js.map +1 -1
- package/dist/atheletebridge/components/ai/AgentRunFeed.js.map +1 -1
- package/dist/atheletebridge/components/ai/AiModelPicker.js +49 -49
- package/dist/atheletebridge/components/ai/AiModelPicker.js.map +1 -1
- package/dist/atheletebridge/components/ai/DecisionCard.js +16 -16
- package/dist/atheletebridge/components/ai/DecisionCard.js.map +1 -1
- package/dist/atheletebridge/components/ai/RunDecisionPanel.js +42 -42
- package/dist/atheletebridge/components/ai/RunDecisionPanel.js.map +1 -1
- package/dist/atheletebridge/components/analytics/AiInsightsPanel.js +52 -52
- package/dist/atheletebridge/components/analytics/AiInsightsPanel.js.map +1 -1
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.js +24 -23
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.js.map +1 -1
- package/dist/atheletebridge/components/wearables/ConnectedDevicesPanel.js.map +1 -1
- package/dist/atheletebridge/pages/DashboardPage.js.map +1 -1
- package/dist/atheletebridge/pages/StandingsPage.js.map +1 -1
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.js.map +1 -1
- package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js +1 -0
- package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js.map +1 -1
- package/dist/atheletebridge/pages/audit/AuditLogPage.js +1 -0
- package/dist/atheletebridge/pages/audit/AuditLogPage.js.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixtureFormPage.js +56 -56
- package/dist/atheletebridge/pages/fixtures/FixtureFormPage.js.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixturesListPage.js +1 -0
- package/dist/atheletebridge/pages/fixtures/FixturesListPage.js.map +1 -1
- package/dist/atheletebridge/pages/marketplace/MarketplacePage.js +97 -97
- package/dist/atheletebridge/pages/marketplace/MarketplacePage.js.map +1 -1
- package/dist/atheletebridge/pages/onboarding/OnboardingPage.js +34 -34
- package/dist/atheletebridge/pages/onboarding/OnboardingPage.js.map +1 -1
- package/dist/atheletebridge/pages/performance/PerformancePage.js +182 -182
- package/dist/atheletebridge/pages/performance/PerformancePage.js.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.js +13 -13
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramFormPage.js +61 -60
- package/dist/atheletebridge/pages/programs/ProgramFormPage.js.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramsListPage.js +1 -0
- package/dist/atheletebridge/pages/programs/ProgramsListPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.js +26 -21
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegisterPage.js +1 -0
- package/dist/atheletebridge/pages/registrations/RegisterPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.js +205 -204
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.js +121 -115
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js +59 -40
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionFormPage.js +59 -59
- package/dist/atheletebridge/pages/sessions/SessionFormPage.js.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionsListPage.js +1 -0
- package/dist/atheletebridge/pages/sessions/SessionsListPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamDetailPage.js +143 -143
- package/dist/atheletebridge/pages/teams/TeamDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamFormPage.js +72 -72
- package/dist/atheletebridge/pages/teams/TeamFormPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamsListPage.js +1 -0
- package/dist/atheletebridge/pages/teams/TeamsListPage.js.map +1 -1
- package/dist/atheletebridge/pages/tournaments/TournamentBracketPage.js.map +1 -1
- package/package.json +3 -3
|
@@ -15,31 +15,31 @@ import { useLogWorkout as m, usePerformanceMetrics as h, useRecordMetric as g, u
|
|
|
15
15
|
import { formatDate as v, formatDuration as y } from "../../utils/formatters.js";
|
|
16
16
|
import { cn as b } from "../../utils/cn.js";
|
|
17
17
|
import { useMemo as x, useState as S } from "react";
|
|
18
|
-
import { Activity as C, ArrowDown as w, ArrowUp as T, CalendarRange as E, Dumbbell as D, Gauge as O, HeartPulse as k, Loader2 as A, Move as j, Plus as M, Save as N, Scale as P, Target as F, Users as
|
|
19
|
-
import { Fragment as
|
|
20
|
-
import { GlassCard as
|
|
18
|
+
import { Activity as C, ArrowDown as w, ArrowUp as T, CalendarRange as E, Dumbbell as D, Gauge as O, HeartPulse as k, Loader2 as A, Move as j, Plus as M, Save as N, Scale as P, Target as F, Users as I, Watch as L, Zap as R } from "lucide-react";
|
|
19
|
+
import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
20
|
+
import { GlassCard as H, ResponsiveDialog as U, ResponsiveDialogContent as W, ResponsiveDialogFooter as G, ResponsiveDialogHeader as K, ResponsiveDialogTitle as q, ResponsiveTable as ee, ThemedSelect as J } from "@burdenoff/fe-libs/ui";
|
|
21
21
|
// src/atheletebridge/pages/performance/PerformancePage.tsx
|
|
22
|
-
var
|
|
22
|
+
var Y = 10, te = [
|
|
23
23
|
"COMPLETED",
|
|
24
24
|
"PLANNED",
|
|
25
25
|
"SKIPPED"
|
|
26
|
-
],
|
|
26
|
+
], ne = Object.keys(d), re = 100, ie = { limit: 100 }, ae = [
|
|
27
27
|
"7d",
|
|
28
28
|
"28d",
|
|
29
29
|
"90d"
|
|
30
|
-
],
|
|
30
|
+
], oe = {
|
|
31
31
|
"7d": 7,
|
|
32
32
|
"28d": 28,
|
|
33
33
|
"90d": 90
|
|
34
|
-
},
|
|
34
|
+
}, se = (e) => {
|
|
35
35
|
let t = /* @__PURE__ */ new Date();
|
|
36
36
|
t.setHours(23, 59, 59, 999);
|
|
37
37
|
let n = new Date(t);
|
|
38
|
-
return n.setHours(0, 0, 0, 0), n.setDate(n.getDate() - (
|
|
38
|
+
return n.setHours(0, 0, 0, 0), n.setDate(n.getDate() - (oe[e] - 1)), {
|
|
39
39
|
start: n.getTime(),
|
|
40
40
|
end: t.getTime()
|
|
41
41
|
};
|
|
42
|
-
},
|
|
42
|
+
}, X = (e) => new Date(e).getTime(), ce = (e) => v(new Date(e), {
|
|
43
43
|
hour: void 0,
|
|
44
44
|
minute: void 0,
|
|
45
45
|
hour12: void 0
|
|
@@ -61,8 +61,8 @@ var q = 10, ne = [
|
|
|
61
61
|
case "28d": return t("atheletebridge.pages.performance.window.noPrior28", "No reading in the previous 28 days");
|
|
62
62
|
case "90d": return t("atheletebridge.pages.performance.window.noPrior90", "No reading in the previous 90 days");
|
|
63
63
|
}
|
|
64
|
-
},
|
|
65
|
-
SPEED:
|
|
64
|
+
}, Z = "inline-flex items-center justify-center gap-1.5 rounded-lg px-4 py-2 text-sm font-semibold text-action-primary-text shadow-elevation-1 transition-[filter,box-shadow] hover:shadow-elevation-2 hover:brightness-110 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] bg-[linear-gradient(120deg,var(--color-action-primary-bg),color-mix(in_oklab,var(--color-action-primary-bg)_62%,var(--color-accent-purple)),var(--color-action-primary-bg))]", pe = {
|
|
65
|
+
SPEED: R,
|
|
66
66
|
ENDURANCE: C,
|
|
67
67
|
STRENGTH: D,
|
|
68
68
|
AGILITY: j,
|
|
@@ -75,7 +75,7 @@ var q = 10, ne = [
|
|
|
75
75
|
if (!t) return;
|
|
76
76
|
let n = Number.parseInt(t, 10);
|
|
77
77
|
return Number.isNaN(n) ? void 0 : n;
|
|
78
|
-
},
|
|
78
|
+
}, he = (e) => {
|
|
79
79
|
let t = e.trim();
|
|
80
80
|
if (!t) return;
|
|
81
81
|
let n = Number.parseFloat(t);
|
|
@@ -84,89 +84,89 @@ var q = 10, ne = [
|
|
|
84
84
|
let e = /* @__PURE__ */ new Date();
|
|
85
85
|
return (/* @__PURE__ */ new Date(e.getTime() - e.getTimezoneOffset() * 6e4)).toISOString().slice(0, 16);
|
|
86
86
|
}, $ = (e) => (Math.abs(e) >= 100 ? e.toFixed(0) : e.toFixed(2)).replace(/\.?0+$/, "");
|
|
87
|
-
function
|
|
87
|
+
function ge() {
|
|
88
88
|
let n = p(), { navigateTo: i } = f(), [a, o] = S({
|
|
89
89
|
athleteId: "",
|
|
90
90
|
displayName: ""
|
|
91
91
|
});
|
|
92
|
-
return /* @__PURE__ */
|
|
92
|
+
return /* @__PURE__ */ V(e, {
|
|
93
93
|
title: n("atheletebridge.pages.performance.title", "Performance"),
|
|
94
94
|
description: n("atheletebridge.pages.performance.description", "Track. Analyze. Improve — log workouts, record metrics and review an athlete's progress over time."),
|
|
95
|
-
actions: /* @__PURE__ */
|
|
95
|
+
actions: /* @__PURE__ */ V("button", {
|
|
96
96
|
type: "button",
|
|
97
97
|
onClick: () => i("/devices"),
|
|
98
98
|
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
99
|
-
children: [/* @__PURE__ */
|
|
99
|
+
children: [/* @__PURE__ */ B(L, {
|
|
100
100
|
className: "h-4 w-4",
|
|
101
101
|
"aria-hidden": "true"
|
|
102
102
|
}), n("atheletebridge.pages.performance.connectedDevices", "Connected devices")]
|
|
103
103
|
}),
|
|
104
|
-
children: [/* @__PURE__ */
|
|
104
|
+
children: [/* @__PURE__ */ B("div", {
|
|
105
105
|
"data-tour": "performance-athlete-picker",
|
|
106
106
|
className: "sticky top-0 z-20 -mx-6 mb-8 bg-bg-canvas/80 px-6 pb-4 pt-1 backdrop-blur supports-[backdrop-filter]:bg-bg-canvas/60",
|
|
107
|
-
children: /* @__PURE__ */
|
|
107
|
+
children: /* @__PURE__ */ B(H, {
|
|
108
108
|
treatment: "insight",
|
|
109
109
|
className: "p-5 sm:p-6",
|
|
110
|
-
children: /* @__PURE__ */
|
|
110
|
+
children: /* @__PURE__ */ B(t, {
|
|
111
111
|
athleteId: a.athleteId,
|
|
112
112
|
onSelect: o,
|
|
113
113
|
idPrefix: "perf-athlete"
|
|
114
114
|
})
|
|
115
115
|
})
|
|
116
|
-
}), a.athleteId ? /* @__PURE__ */
|
|
116
|
+
}), a.athleteId ? /* @__PURE__ */ B(_e, {
|
|
117
117
|
athleteId: a.athleteId,
|
|
118
118
|
displayName: a.displayName
|
|
119
|
-
}) : /* @__PURE__ */
|
|
119
|
+
}) : /* @__PURE__ */ B(r, {
|
|
120
120
|
illustration: "empty-data",
|
|
121
|
-
icon: /* @__PURE__ */
|
|
121
|
+
icon: /* @__PURE__ */ B(I, { className: "h-10 w-10" }),
|
|
122
122
|
title: n("atheletebridge.pages.performance.pickAthleteTitle", "Pick an athlete to begin"),
|
|
123
123
|
description: n("atheletebridge.pages.performance.pickAthleteHint", "Choose a team and an athlete above to log workouts, record metrics and review their history.")
|
|
124
124
|
})]
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
|
-
function
|
|
128
|
-
let i = p(), [l, u] = S(0), [d, f] = S(""), [m, g] = S(!1), [w, T] = S(!1), k = x(() => d === "" ? null :
|
|
127
|
+
function _e({ athleteId: e, displayName: t }) {
|
|
128
|
+
let i = p(), [l, u] = S(0), [d, f] = S(""), [m, g] = S(!1), [w, T] = S(!1), k = x(() => d === "" ? null : se(d), [d]), A = _({
|
|
129
129
|
athleteId: e,
|
|
130
|
-
pagination: k ? { limit:
|
|
131
|
-
limit:
|
|
132
|
-
offset: l *
|
|
130
|
+
pagination: k ? { limit: re } : {
|
|
131
|
+
limit: Y,
|
|
132
|
+
offset: l * Y
|
|
133
133
|
}
|
|
134
|
-
}), j = h(e,
|
|
135
|
-
let t =
|
|
134
|
+
}), j = h(e, ie), N = x(() => A.data?.items ?? [], [A.data]), P = A.data?.pageInfo.hasMore ?? !1, F = x(() => k ? N.filter((e) => {
|
|
135
|
+
let t = X(e.performedAt);
|
|
136
136
|
return t >= k.start && t <= k.end;
|
|
137
|
-
}) : N, [N, k]),
|
|
137
|
+
}) : N, [N, k]), I = k ? Math.max(0, Math.ceil(F.length / Y) - 1) : l, L = Math.min(l, I), R = k ? F.slice(L * Y, (L + 1) * Y) : F, U = k ? F.length > (L + 1) * Y : P, W = x(() => {
|
|
138
138
|
if (!k || !P) return !0;
|
|
139
139
|
let e = N[N.length - 1];
|
|
140
|
-
return e != null &&
|
|
140
|
+
return e != null && X(e.performedAt) <= k.start;
|
|
141
141
|
}, [
|
|
142
142
|
k,
|
|
143
143
|
P,
|
|
144
144
|
N
|
|
145
|
-
]),
|
|
145
|
+
]), G = x(() => ae.map((e) => ({
|
|
146
146
|
value: e,
|
|
147
|
-
label: `${ue(e, i)} · ${le(
|
|
148
|
-
})), [i]),
|
|
147
|
+
label: `${ue(e, i)} · ${le(se(e))}`
|
|
148
|
+
})), [i]), K = x(() => d === "" ? {
|
|
149
149
|
comparison: i("atheletebridge.pages.performance.window.vsPrevious", "vs previous"),
|
|
150
150
|
noComparison: i("atheletebridge.pages.performance.window.firstReading", "First reading")
|
|
151
151
|
} : {
|
|
152
152
|
comparison: de(d, i),
|
|
153
153
|
noComparison: fe(d, i)
|
|
154
|
-
}, [d, i]),
|
|
154
|
+
}, [d, i]), q = x(() => {
|
|
155
155
|
let e = /* @__PURE__ */ new Map();
|
|
156
156
|
for (let t of j.data ?? []) {
|
|
157
157
|
let n = `${t.type}::${t.label}`, r = e.get(n) ?? [];
|
|
158
158
|
r.push(t), e.set(n, r);
|
|
159
159
|
}
|
|
160
160
|
return Array.from(e.entries()).map(([e, t]) => {
|
|
161
|
-
let n = [...t].sort((e, t) =>
|
|
162
|
-
let t =
|
|
161
|
+
let n = [...t].sort((e, t) => X(e.recordedAt) - X(t.recordedAt)), r = k ? n.filter((e) => {
|
|
162
|
+
let t = X(e.recordedAt);
|
|
163
163
|
return t >= k.start && t <= k.end;
|
|
164
164
|
}) : n;
|
|
165
165
|
if (r.length === 0) return null;
|
|
166
166
|
let i = r.map((e) => e.value), a = r[r.length - 1], o = null;
|
|
167
167
|
if (k) {
|
|
168
168
|
let e = k.start - (k.end - k.start + 1), t = n.filter((t) => {
|
|
169
|
-
let n =
|
|
169
|
+
let n = X(t.recordedAt);
|
|
170
170
|
return n >= e && n < k.start;
|
|
171
171
|
});
|
|
172
172
|
o = t.length > 0 ? t[t.length - 1].value : null;
|
|
@@ -183,23 +183,23 @@ function ge({ athleteId: e, displayName: t }) {
|
|
|
183
183
|
series: i,
|
|
184
184
|
recordedAt: a.recordedAt
|
|
185
185
|
};
|
|
186
|
-
}).filter((e) => e !== null).sort((e, t) =>
|
|
187
|
-
}, [j.data, k]),
|
|
186
|
+
}).filter((e) => e !== null).sort((e, t) => X(t.recordedAt) - X(e.recordedAt));
|
|
187
|
+
}, [j.data, k]), J = x(() => [
|
|
188
188
|
{
|
|
189
189
|
key: "workout",
|
|
190
190
|
header: i("atheletebridge.pages.performance.column.workout", "Workout"),
|
|
191
191
|
priority: "primary",
|
|
192
192
|
cell: (e) => {
|
|
193
|
-
let t =
|
|
194
|
-
return /* @__PURE__ */
|
|
193
|
+
let t = ve(e.title);
|
|
194
|
+
return /* @__PURE__ */ V("div", {
|
|
195
195
|
className: "flex items-center gap-3",
|
|
196
|
-
children: [/* @__PURE__ */
|
|
196
|
+
children: [/* @__PURE__ */ B("span", {
|
|
197
197
|
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-[var(--color-accent-teal)]",
|
|
198
|
-
children: /* @__PURE__ */
|
|
198
|
+
children: /* @__PURE__ */ B(t, {
|
|
199
199
|
className: "h-4 w-4",
|
|
200
200
|
"aria-hidden": "true"
|
|
201
201
|
})
|
|
202
|
-
}), /* @__PURE__ */
|
|
202
|
+
}), /* @__PURE__ */ B("span", {
|
|
203
203
|
className: "min-w-0 truncate font-medium text-text-primary",
|
|
204
204
|
children: e.title
|
|
205
205
|
})]
|
|
@@ -211,10 +211,10 @@ function ge({ athleteId: e, displayName: t }) {
|
|
|
211
211
|
header: i("atheletebridge.pages.performance.column.duration", "Duration"),
|
|
212
212
|
priority: "secondary",
|
|
213
213
|
mobileLabel: i("atheletebridge.pages.performance.column.duration", "Duration"),
|
|
214
|
-
cell: (e) => e.durationMin == null ? /* @__PURE__ */
|
|
214
|
+
cell: (e) => e.durationMin == null ? /* @__PURE__ */ B("span", {
|
|
215
215
|
className: "text-text-muted",
|
|
216
216
|
children: "—"
|
|
217
|
-
}) : /* @__PURE__ */
|
|
217
|
+
}) : /* @__PURE__ */ B("span", {
|
|
218
218
|
className: "tabular-nums text-text-secondary",
|
|
219
219
|
children: y(e.durationMin)
|
|
220
220
|
})
|
|
@@ -224,17 +224,17 @@ function ge({ athleteId: e, displayName: t }) {
|
|
|
224
224
|
header: i("atheletebridge.pages.performance.column.rpe", "RPE"),
|
|
225
225
|
priority: "secondary",
|
|
226
226
|
mobileLabel: i("atheletebridge.pages.performance.column.rpe", "RPE"),
|
|
227
|
-
cell: (e) => e.rpe == null ? /* @__PURE__ */
|
|
227
|
+
cell: (e) => e.rpe == null ? /* @__PURE__ */ B("span", {
|
|
228
228
|
className: "text-text-muted",
|
|
229
229
|
children: "—"
|
|
230
|
-
}) : /* @__PURE__ */
|
|
230
|
+
}) : /* @__PURE__ */ B(ye, { rpe: e.rpe })
|
|
231
231
|
},
|
|
232
232
|
{
|
|
233
233
|
key: "date",
|
|
234
234
|
header: i("atheletebridge.pages.performance.column.date", "Date"),
|
|
235
235
|
priority: "secondary",
|
|
236
236
|
mobileLabel: i("atheletebridge.pages.performance.column.date", "Date"),
|
|
237
|
-
cell: (e) => /* @__PURE__ */
|
|
237
|
+
cell: (e) => /* @__PURE__ */ B("span", {
|
|
238
238
|
className: "tabular-nums text-text-secondary",
|
|
239
239
|
children: v(e.performedAt)
|
|
240
240
|
})
|
|
@@ -244,75 +244,75 @@ function ge({ athleteId: e, displayName: t }) {
|
|
|
244
244
|
header: i("atheletebridge.pages.performance.column.status", "Status"),
|
|
245
245
|
priority: "primary",
|
|
246
246
|
mobileLabel: i("atheletebridge.pages.performance.column.status", "Status"),
|
|
247
|
-
cell: (e) => /* @__PURE__ */
|
|
247
|
+
cell: (e) => /* @__PURE__ */ B(n, { status: e.status })
|
|
248
248
|
},
|
|
249
249
|
{
|
|
250
250
|
key: "notes",
|
|
251
251
|
header: i("atheletebridge.pages.performance.column.notes", "Notes"),
|
|
252
252
|
priority: "hidden-on-mobile",
|
|
253
|
-
cell: (e) => e.notes ? /* @__PURE__ */
|
|
253
|
+
cell: (e) => e.notes ? /* @__PURE__ */ B("span", {
|
|
254
254
|
className: "line-clamp-2 max-w-[22ch] text-text-secondary",
|
|
255
255
|
children: e.notes
|
|
256
|
-
}) : /* @__PURE__ */
|
|
256
|
+
}) : /* @__PURE__ */ B("span", {
|
|
257
257
|
className: "text-text-muted",
|
|
258
258
|
children: "—"
|
|
259
259
|
})
|
|
260
260
|
}
|
|
261
261
|
], [i]);
|
|
262
|
-
return /* @__PURE__ */
|
|
262
|
+
return /* @__PURE__ */ V("div", {
|
|
263
263
|
className: "space-y-8 pb-24 sm:pb-0",
|
|
264
264
|
children: [
|
|
265
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ V("div", {
|
|
266
266
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
|
|
267
|
-
children: [/* @__PURE__ */
|
|
267
|
+
children: [/* @__PURE__ */ V("p", {
|
|
268
268
|
className: "text-sm text-text-secondary",
|
|
269
269
|
children: [
|
|
270
270
|
i("atheletebridge.pages.performance.tracking", "Tracking"),
|
|
271
271
|
" ",
|
|
272
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ B("span", {
|
|
273
273
|
className: "font-medium text-text-primary",
|
|
274
274
|
children: t || i("atheletebridge.pages.performance.athleteFallback", "athlete")
|
|
275
275
|
}),
|
|
276
|
-
k ? /* @__PURE__ */
|
|
276
|
+
k ? /* @__PURE__ */ V(z, { children: [" · ", /* @__PURE__ */ B("span", {
|
|
277
277
|
className: "tabular-nums text-text-muted",
|
|
278
278
|
children: le(k)
|
|
279
279
|
})] }) : null
|
|
280
280
|
]
|
|
281
|
-
}), /* @__PURE__ */
|
|
281
|
+
}), /* @__PURE__ */ V("div", {
|
|
282
282
|
className: "flex flex-wrap items-center gap-2",
|
|
283
283
|
children: [
|
|
284
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ V("span", {
|
|
285
285
|
className: "flex items-center gap-2",
|
|
286
286
|
"data-tour": "performance-date-range",
|
|
287
|
-
children: [/* @__PURE__ */
|
|
287
|
+
children: [/* @__PURE__ */ B(E, {
|
|
288
288
|
className: "h-4 w-4 shrink-0 text-text-muted",
|
|
289
289
|
"aria-hidden": "true"
|
|
290
|
-
}), /* @__PURE__ */
|
|
290
|
+
}), /* @__PURE__ */ B(c, {
|
|
291
291
|
value: d,
|
|
292
292
|
onChange: (e) => {
|
|
293
293
|
f(e), u(0);
|
|
294
294
|
},
|
|
295
|
-
options:
|
|
295
|
+
options: G,
|
|
296
296
|
allLabel: i("atheletebridge.pages.performance.window.allTime", "All time"),
|
|
297
297
|
ariaLabel: i("atheletebridge.pages.performance.window.ariaLabel", "Date range")
|
|
298
298
|
})]
|
|
299
299
|
}),
|
|
300
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ V("button", {
|
|
301
301
|
type: "button",
|
|
302
302
|
onClick: () => T(!0),
|
|
303
303
|
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
304
304
|
children: [
|
|
305
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ B(O, { className: "h-4 w-4" }),
|
|
306
306
|
" ",
|
|
307
307
|
i("atheletebridge.pages.performance.recordMetric", "Record metric")
|
|
308
308
|
]
|
|
309
309
|
}),
|
|
310
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ V("button", {
|
|
311
311
|
type: "button",
|
|
312
312
|
onClick: () => g(!0),
|
|
313
|
-
className: b(
|
|
313
|
+
className: b(Z, "hidden sm:inline-flex"),
|
|
314
314
|
children: [
|
|
315
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ B(D, { className: "h-4 w-4" }),
|
|
316
316
|
" ",
|
|
317
317
|
i("atheletebridge.pages.performance.logWorkout", "Log workout")
|
|
318
318
|
]
|
|
@@ -320,93 +320,93 @@ function ge({ athleteId: e, displayName: t }) {
|
|
|
320
320
|
]
|
|
321
321
|
})]
|
|
322
322
|
}),
|
|
323
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ V("section", { children: [/* @__PURE__ */ B("h2", {
|
|
324
324
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
325
325
|
children: i("atheletebridge.pages.performance.metricsTitle", "Performance metrics")
|
|
326
|
-
}), j.isLoading ? /* @__PURE__ */
|
|
326
|
+
}), j.isLoading ? /* @__PURE__ */ B(o, { label: i("atheletebridge.pages.performance.loadingMetrics", "Loading metrics…") }) : j.isError ? /* @__PURE__ */ B(a, { onRetry: () => void j.refetch() }) : q.length === 0 ? /* @__PURE__ */ B(r, {
|
|
327
327
|
illustration: "empty-data",
|
|
328
|
-
icon: /* @__PURE__ */
|
|
328
|
+
icon: /* @__PURE__ */ B(O, { className: "h-10 w-10" }),
|
|
329
329
|
title: k ? i("atheletebridge.pages.performance.metrics.emptyWindowTitle", "No metrics in this window") : i("atheletebridge.pages.performance.metrics.emptyTitle", "No metrics recorded"),
|
|
330
330
|
description: k ? i("atheletebridge.pages.performance.metrics.emptyWindowDescription", "Nothing was recorded for this athlete in the selected period. Widen the date range, or record a metric.") : i("atheletebridge.pages.performance.noMetricsDescription", "Record a metric — speed, strength, endurance and more — to start charting progress."),
|
|
331
|
-
action: /* @__PURE__ */
|
|
331
|
+
action: /* @__PURE__ */ V("button", {
|
|
332
332
|
type: "button",
|
|
333
333
|
onClick: () => T(!0),
|
|
334
|
-
className:
|
|
334
|
+
className: Z,
|
|
335
335
|
children: [
|
|
336
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ B(M, { className: "h-4 w-4" }),
|
|
337
337
|
" ",
|
|
338
338
|
i("atheletebridge.pages.performance.recordMetricAction", "Record metric")
|
|
339
339
|
]
|
|
340
340
|
})
|
|
341
|
-
}) : /* @__PURE__ */
|
|
341
|
+
}) : /* @__PURE__ */ B("div", {
|
|
342
342
|
className: "grid grid-cols-2 gap-3 sm:gap-4 lg:grid-cols-3",
|
|
343
|
-
children:
|
|
343
|
+
children: q.map((e) => /* @__PURE__ */ B(be, {
|
|
344
344
|
metric: e,
|
|
345
|
-
labels:
|
|
345
|
+
labels: K,
|
|
346
346
|
tr: i
|
|
347
347
|
}, e.key))
|
|
348
348
|
})] }),
|
|
349
|
-
/* @__PURE__ */
|
|
350
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ V("section", { children: [
|
|
350
|
+
/* @__PURE__ */ B("h2", {
|
|
351
351
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
352
352
|
children: i("atheletebridge.pages.performance.workoutsTitle", "Workout history")
|
|
353
353
|
}),
|
|
354
|
-
A.isLoading ? /* @__PURE__ */
|
|
354
|
+
A.isLoading ? /* @__PURE__ */ B(o, { label: i("atheletebridge.pages.performance.loadingWorkouts", "Loading workouts…") }) : A.isError ? /* @__PURE__ */ B(a, { onRetry: () => void A.refetch() }) : R.length === 0 ? /* @__PURE__ */ B(r, {
|
|
355
355
|
illustration: "empty-data",
|
|
356
|
-
icon: /* @__PURE__ */
|
|
356
|
+
icon: /* @__PURE__ */ B(C, { className: "h-10 w-10" }),
|
|
357
357
|
title: k ? i("atheletebridge.pages.performance.workouts.emptyWindowTitle", "No workouts in this window") : i("atheletebridge.pages.performance.workouts.emptyTitle", "No workouts logged"),
|
|
358
358
|
description: k ? i("atheletebridge.pages.performance.workouts.emptyWindowDescription", "Nothing was logged for this athlete in the selected period. Widen the date range, or log a workout.") : i("atheletebridge.pages.performance.noWorkoutsDescription", "Log a workout to build this athlete's training history."),
|
|
359
|
-
action: /* @__PURE__ */
|
|
359
|
+
action: /* @__PURE__ */ V("button", {
|
|
360
360
|
type: "button",
|
|
361
361
|
onClick: () => g(!0),
|
|
362
|
-
className:
|
|
362
|
+
className: Z,
|
|
363
363
|
children: [
|
|
364
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ B(D, { className: "h-4 w-4" }),
|
|
365
365
|
" ",
|
|
366
366
|
i("atheletebridge.pages.performance.logWorkout", "Log workout")
|
|
367
367
|
]
|
|
368
368
|
})
|
|
369
|
-
}) : /* @__PURE__ */
|
|
369
|
+
}) : /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(H, {
|
|
370
370
|
treatment: "metric",
|
|
371
371
|
className: "overflow-hidden p-1 sm:p-2",
|
|
372
|
-
children: /* @__PURE__ */
|
|
373
|
-
columns:
|
|
374
|
-
data:
|
|
372
|
+
children: /* @__PURE__ */ B(ee, {
|
|
373
|
+
columns: J,
|
|
374
|
+
data: R,
|
|
375
375
|
rowKey: (e) => e.id,
|
|
376
376
|
caption: i("atheletebridge.pages.performance.workouts.caption", "Workout history for {{name}}").replace("{{name}}", t || i("atheletebridge.pages.performance.athleteFallback", "athlete"))
|
|
377
377
|
})
|
|
378
|
-
}), /* @__PURE__ */
|
|
378
|
+
}), /* @__PURE__ */ B(s, {
|
|
379
379
|
className: "mt-6",
|
|
380
|
-
page:
|
|
381
|
-
hasMore:
|
|
382
|
-
onPrev: () => u(Math.max(0,
|
|
383
|
-
onNext: () => u(
|
|
380
|
+
page: L,
|
|
381
|
+
hasMore: U,
|
|
382
|
+
onPrev: () => u(Math.max(0, L - 1)),
|
|
383
|
+
onNext: () => u(L + 1)
|
|
384
384
|
})] }),
|
|
385
|
-
|
|
385
|
+
W ? null : /* @__PURE__ */ B("p", {
|
|
386
386
|
className: "mt-3 text-xs text-text-muted",
|
|
387
387
|
children: i("atheletebridge.pages.performance.workouts.windowTruncated", "Only the most recent page of workouts was searched, and it does not reach back to the start of this window — older sessions in the range are not listed.")
|
|
388
388
|
})
|
|
389
389
|
] }),
|
|
390
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ B("div", {
|
|
391
391
|
className: "sticky bottom-0 z-30 -mx-6 border-t border-border-seam bg-bg-canvas/85 px-6 pb-[max(env(safe-area-inset-bottom),0.75rem)] pt-3 backdrop-blur sm:hidden",
|
|
392
|
-
children: /* @__PURE__ */
|
|
392
|
+
children: /* @__PURE__ */ V("button", {
|
|
393
393
|
type: "button",
|
|
394
394
|
onClick: () => g(!0),
|
|
395
|
-
className: b(
|
|
395
|
+
className: b(Z, "w-full py-3 text-base"),
|
|
396
396
|
children: [
|
|
397
|
-
/* @__PURE__ */
|
|
397
|
+
/* @__PURE__ */ B(M, { className: "h-5 w-5" }),
|
|
398
398
|
" ",
|
|
399
399
|
i("atheletebridge.pages.performance.logWorkout", "Log workout")
|
|
400
400
|
]
|
|
401
401
|
})
|
|
402
402
|
}),
|
|
403
|
-
/* @__PURE__ */
|
|
403
|
+
/* @__PURE__ */ B(xe, {
|
|
404
404
|
open: m,
|
|
405
405
|
onOpenChange: g,
|
|
406
406
|
athleteId: e,
|
|
407
407
|
displayName: t
|
|
408
408
|
}),
|
|
409
|
-
/* @__PURE__ */
|
|
409
|
+
/* @__PURE__ */ B(Se, {
|
|
410
410
|
open: w,
|
|
411
411
|
onOpenChange: T,
|
|
412
412
|
athleteId: e,
|
|
@@ -415,27 +415,27 @@ function ge({ athleteId: e, displayName: t }) {
|
|
|
415
415
|
]
|
|
416
416
|
});
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function ve(e) {
|
|
419
419
|
let t = e.toLowerCase();
|
|
420
|
-
return /strength|lift|squat|deadlift|bench|1rm|weight/.test(t) ? D : /speed|sprint|agility|accel|split/.test(t) ?
|
|
420
|
+
return /strength|lift|squat|deadlift|bench|1rm|weight/.test(t) ? D : /speed|sprint|agility|accel|split/.test(t) ? R : /endurance|aerobic|cardio|run|beep|yo-?yo/.test(t) ? C : /recovery|mobility|stretch|rest/.test(t) ? k : /accuracy|shoot|target/.test(t) ? F : D;
|
|
421
421
|
}
|
|
422
|
-
function
|
|
423
|
-
return /* @__PURE__ */
|
|
422
|
+
function ye({ rpe: e }) {
|
|
423
|
+
return /* @__PURE__ */ B("span", {
|
|
424
424
|
className: b("inline-flex h-7 min-w-[1.75rem] items-center justify-center rounded-md border px-1.5 text-sm font-semibold tabular-nums", e >= 8 ? "border-status-error-border text-status-error-text" : e >= 5 ? "border-status-warning-border text-status-warning-text" : "border-border-seam text-text-secondary"),
|
|
425
425
|
children: e
|
|
426
426
|
});
|
|
427
427
|
}
|
|
428
|
-
function
|
|
428
|
+
function be({ metric: e, labels: t, tr: n }) {
|
|
429
429
|
let r = pe[e.type], a = e.previous == null ? null : e.latest - e.previous, o = e.max > e.min, s = o ? Math.round((e.latest - e.min) / (e.max - e.min) * 100) : 100, c = e.unit ? ` ${e.unit}` : "";
|
|
430
|
-
return /* @__PURE__ */
|
|
430
|
+
return /* @__PURE__ */ V(H, {
|
|
431
431
|
treatment: "metric",
|
|
432
432
|
className: "flex flex-col gap-3 p-5",
|
|
433
433
|
children: [
|
|
434
|
-
/* @__PURE__ */
|
|
434
|
+
/* @__PURE__ */ V("div", {
|
|
435
435
|
className: "flex items-center justify-between gap-2",
|
|
436
|
-
children: [/* @__PURE__ */
|
|
436
|
+
children: [/* @__PURE__ */ V("span", {
|
|
437
437
|
className: "flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-[var(--color-accent-teal)]",
|
|
438
|
-
children: [/* @__PURE__ */
|
|
438
|
+
children: [/* @__PURE__ */ B(r, {
|
|
439
439
|
className: "h-4 w-4",
|
|
440
440
|
"aria-hidden": "true"
|
|
441
441
|
}), ((e) => {
|
|
@@ -450,28 +450,28 @@ function ye({ metric: e, labels: t, tr: n }) {
|
|
|
450
450
|
case "CUSTOM": return n("atheletebridge.metricType.custom", "Custom");
|
|
451
451
|
}
|
|
452
452
|
})(e.type)]
|
|
453
|
-
}), /* @__PURE__ */
|
|
453
|
+
}), /* @__PURE__ */ B("span", {
|
|
454
454
|
className: "text-xs text-text-muted",
|
|
455
455
|
children: v(e.recordedAt)
|
|
456
456
|
})]
|
|
457
457
|
}),
|
|
458
|
-
/* @__PURE__ */
|
|
458
|
+
/* @__PURE__ */ V("div", {
|
|
459
459
|
className: "flex items-end justify-between gap-3",
|
|
460
|
-
children: [/* @__PURE__ */
|
|
460
|
+
children: [/* @__PURE__ */ V("div", {
|
|
461
461
|
className: "min-w-0",
|
|
462
|
-
children: [/* @__PURE__ */
|
|
462
|
+
children: [/* @__PURE__ */ B("p", {
|
|
463
463
|
className: "truncate text-sm text-text-secondary",
|
|
464
464
|
children: e.label
|
|
465
|
-
}), /* @__PURE__ */
|
|
465
|
+
}), /* @__PURE__ */ V("p", {
|
|
466
466
|
className: "mt-0.5 text-3xl font-bold leading-none tracking-tight tabular-nums text-text-primary",
|
|
467
|
-
children: [$(e.latest), e.unit ? /* @__PURE__ */
|
|
467
|
+
children: [$(e.latest), e.unit ? /* @__PURE__ */ B("span", {
|
|
468
468
|
className: "ml-1 text-base font-medium text-text-secondary",
|
|
469
469
|
children: e.unit
|
|
470
470
|
}) : null]
|
|
471
471
|
})]
|
|
472
|
-
}), e.series.length > 1 ? /* @__PURE__ */
|
|
472
|
+
}), e.series.length > 1 ? /* @__PURE__ */ B("div", {
|
|
473
473
|
className: "w-24 shrink-0 sm:w-28",
|
|
474
|
-
children: /* @__PURE__ */
|
|
474
|
+
children: /* @__PURE__ */ B(i, {
|
|
475
475
|
data: e.series,
|
|
476
476
|
variant: "area",
|
|
477
477
|
height: 40,
|
|
@@ -479,53 +479,53 @@ function ye({ metric: e, labels: t, tr: n }) {
|
|
|
479
479
|
})
|
|
480
480
|
}) : null]
|
|
481
481
|
}),
|
|
482
|
-
o ? /* @__PURE__ */
|
|
482
|
+
o ? /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ V("div", {
|
|
483
483
|
className: "flex items-center gap-2",
|
|
484
|
-
children: [/* @__PURE__ */
|
|
484
|
+
children: [/* @__PURE__ */ B("span", {
|
|
485
485
|
className: "block h-1.5 flex-1 overflow-hidden rounded-full bg-bg-sunken",
|
|
486
486
|
"aria-hidden": "true",
|
|
487
|
-
children: /* @__PURE__ */
|
|
487
|
+
children: /* @__PURE__ */ B("span", {
|
|
488
488
|
className: "block h-1.5 rounded-full bg-[var(--color-accent-teal)]",
|
|
489
489
|
style: { width: `${Math.max(4, Math.min(100, s))}%` }
|
|
490
490
|
})
|
|
491
|
-
}), /* @__PURE__ */
|
|
491
|
+
}), /* @__PURE__ */ V("span", {
|
|
492
492
|
className: "shrink-0 text-[0.7rem] font-semibold tabular-nums text-[var(--color-accent-teal)]",
|
|
493
493
|
children: [s, "%"]
|
|
494
494
|
})]
|
|
495
|
-
}), /* @__PURE__ */
|
|
495
|
+
}), /* @__PURE__ */ V("div", {
|
|
496
496
|
className: "mt-1 flex justify-between text-[0.7rem] tabular-nums text-text-muted",
|
|
497
497
|
children: [
|
|
498
|
-
/* @__PURE__ */
|
|
499
|
-
/* @__PURE__ */
|
|
498
|
+
/* @__PURE__ */ B("span", { children: $(e.min) }),
|
|
499
|
+
/* @__PURE__ */ B("span", {
|
|
500
500
|
className: "hidden sm:inline",
|
|
501
501
|
children: $((e.min + e.max) / 2)
|
|
502
502
|
}),
|
|
503
|
-
/* @__PURE__ */
|
|
503
|
+
/* @__PURE__ */ B("span", { children: $(e.max) })
|
|
504
504
|
]
|
|
505
505
|
})] }) : null,
|
|
506
|
-
/* @__PURE__ */
|
|
506
|
+
/* @__PURE__ */ B("div", {
|
|
507
507
|
className: "mt-auto flex items-center gap-1.5 text-sm",
|
|
508
|
-
children: a == null ? /* @__PURE__ */
|
|
508
|
+
children: a == null ? /* @__PURE__ */ B("span", {
|
|
509
509
|
className: "text-text-muted",
|
|
510
510
|
children: t.noComparison
|
|
511
|
-
}) : a === 0 ? /* @__PURE__ */
|
|
511
|
+
}) : a === 0 ? /* @__PURE__ */ V("span", {
|
|
512
512
|
className: "text-text-muted",
|
|
513
513
|
children: [
|
|
514
514
|
n("atheletebridge.pages.performance.window.noChange", "No change"),
|
|
515
515
|
" ",
|
|
516
516
|
t.comparison
|
|
517
517
|
]
|
|
518
|
-
}) : /* @__PURE__ */
|
|
518
|
+
}) : /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ V("span", {
|
|
519
519
|
className: "inline-flex items-center gap-0.5 font-medium tabular-nums text-text-secondary",
|
|
520
520
|
children: [
|
|
521
|
-
|
|
521
|
+
B(a > 0 ? T : w, {
|
|
522
522
|
className: "h-4 w-4",
|
|
523
523
|
"aria-hidden": "true"
|
|
524
524
|
}),
|
|
525
525
|
$(Math.abs(a)),
|
|
526
526
|
c
|
|
527
527
|
]
|
|
528
|
-
}), /* @__PURE__ */
|
|
528
|
+
}), /* @__PURE__ */ B("span", {
|
|
529
529
|
className: "text-text-muted",
|
|
530
530
|
children: t.comparison
|
|
531
531
|
})] })
|
|
@@ -533,7 +533,7 @@ function ye({ metric: e, labels: t, tr: n }) {
|
|
|
533
533
|
]
|
|
534
534
|
});
|
|
535
535
|
}
|
|
536
|
-
function
|
|
536
|
+
function xe({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
537
537
|
let i = p(), a = m(), [o, s] = S(""), [c, d] = S("COMPLETED"), [f, h] = S(Q), [g, _] = S(""), [v, y] = S(""), [x, C] = S(""), [w, T] = S(""), [E, D] = S(null), O = () => {
|
|
538
538
|
s(""), d("COMPLETED"), h(Q()), _(""), y(""), C(""), T(""), D(null);
|
|
539
539
|
}, k = (e) => {
|
|
@@ -543,10 +543,10 @@ function be({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
|
543
543
|
case "SKIPPED": return i("atheletebridge.workoutStatus.skipped", "Skipped");
|
|
544
544
|
}
|
|
545
545
|
};
|
|
546
|
-
return /* @__PURE__ */
|
|
546
|
+
return /* @__PURE__ */ B(U, {
|
|
547
547
|
open: e,
|
|
548
548
|
onOpenChange: t,
|
|
549
|
-
children: /* @__PURE__ */
|
|
549
|
+
children: /* @__PURE__ */ V(W, { children: [/* @__PURE__ */ B(K, { children: /* @__PURE__ */ V(q, { children: [i("atheletebridge.pages.performance.logWorkoutDialogTitle", "Log workout"), r ? ` — ${r}` : ""] }) }), /* @__PURE__ */ V("form", {
|
|
550
550
|
onSubmit: async (e) => {
|
|
551
551
|
if (e.preventDefault(), D(null), !o.trim()) D(i("atheletebridge.pages.performance.error.titleRequired", "A workout title is required."));
|
|
552
552
|
else if (!f) D(i("atheletebridge.pages.performance.error.performedAtRequired", "A performed date and time is required."));
|
|
@@ -558,7 +558,7 @@ function be({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
|
558
558
|
performedAt: new Date(f).toISOString(),
|
|
559
559
|
durationMin: me(g),
|
|
560
560
|
rpe: me(v),
|
|
561
|
-
totalLoad:
|
|
561
|
+
totalLoad: he(x),
|
|
562
562
|
notes: w.trim() || void 0
|
|
563
563
|
}), O(), t(!1);
|
|
564
564
|
} catch (e) {
|
|
@@ -567,11 +567,11 @@ function be({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
|
567
567
|
},
|
|
568
568
|
className: "space-y-4 px-1",
|
|
569
569
|
children: [
|
|
570
|
-
/* @__PURE__ */
|
|
570
|
+
/* @__PURE__ */ B(l, {
|
|
571
571
|
label: i("atheletebridge.pages.performance.label.title", "Title"),
|
|
572
572
|
htmlFor: "workoutTitle",
|
|
573
573
|
required: !0,
|
|
574
|
-
children: /* @__PURE__ */
|
|
574
|
+
children: /* @__PURE__ */ B("input", {
|
|
575
575
|
id: "workoutTitle",
|
|
576
576
|
className: u,
|
|
577
577
|
value: o,
|
|
@@ -579,26 +579,26 @@ function be({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
|
579
579
|
placeholder: i("atheletebridge.pages.performance.placeholder.title", "e.g. Lower-body strength")
|
|
580
580
|
})
|
|
581
581
|
}),
|
|
582
|
-
/* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ V("div", {
|
|
583
583
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
584
|
-
children: [/* @__PURE__ */
|
|
584
|
+
children: [/* @__PURE__ */ B(l, {
|
|
585
585
|
label: i("atheletebridge.pages.performance.label.status", "Status"),
|
|
586
586
|
htmlFor: "workoutStatus",
|
|
587
|
-
children: /* @__PURE__ */
|
|
587
|
+
children: /* @__PURE__ */ B(J, {
|
|
588
588
|
id: "workoutStatus",
|
|
589
589
|
className: u,
|
|
590
590
|
value: c,
|
|
591
591
|
onChange: (e) => d(e.target.value),
|
|
592
|
-
children:
|
|
592
|
+
children: te.map((e) => /* @__PURE__ */ B("option", {
|
|
593
593
|
value: e,
|
|
594
594
|
children: k(e)
|
|
595
595
|
}, e))
|
|
596
596
|
})
|
|
597
|
-
}), /* @__PURE__ */
|
|
597
|
+
}), /* @__PURE__ */ B(l, {
|
|
598
598
|
label: i("atheletebridge.pages.performance.label.performedAt", "Performed at"),
|
|
599
599
|
htmlFor: "workoutPerformedAt",
|
|
600
600
|
required: !0,
|
|
601
|
-
children: /* @__PURE__ */
|
|
601
|
+
children: /* @__PURE__ */ B("input", {
|
|
602
602
|
id: "workoutPerformedAt",
|
|
603
603
|
type: "datetime-local",
|
|
604
604
|
className: u,
|
|
@@ -607,13 +607,13 @@ function be({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
|
607
607
|
})
|
|
608
608
|
})]
|
|
609
609
|
}),
|
|
610
|
-
/* @__PURE__ */
|
|
610
|
+
/* @__PURE__ */ V("div", {
|
|
611
611
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
612
612
|
children: [
|
|
613
|
-
/* @__PURE__ */
|
|
613
|
+
/* @__PURE__ */ B(l, {
|
|
614
614
|
label: i("atheletebridge.pages.performance.label.durationMin", "Duration (min)"),
|
|
615
615
|
htmlFor: "workoutDuration",
|
|
616
|
-
children: /* @__PURE__ */
|
|
616
|
+
children: /* @__PURE__ */ B("input", {
|
|
617
617
|
id: "workoutDuration",
|
|
618
618
|
inputMode: "numeric",
|
|
619
619
|
className: u,
|
|
@@ -621,10 +621,10 @@ function be({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
|
621
621
|
onChange: (e) => _(e.target.value)
|
|
622
622
|
})
|
|
623
623
|
}),
|
|
624
|
-
/* @__PURE__ */
|
|
624
|
+
/* @__PURE__ */ B(l, {
|
|
625
625
|
label: i("atheletebridge.pages.performance.label.rpe", "RPE (1–10)"),
|
|
626
626
|
htmlFor: "workoutRpe",
|
|
627
|
-
children: /* @__PURE__ */
|
|
627
|
+
children: /* @__PURE__ */ B("input", {
|
|
628
628
|
id: "workoutRpe",
|
|
629
629
|
inputMode: "numeric",
|
|
630
630
|
className: u,
|
|
@@ -632,10 +632,10 @@ function be({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
|
632
632
|
onChange: (e) => y(e.target.value)
|
|
633
633
|
})
|
|
634
634
|
}),
|
|
635
|
-
/* @__PURE__ */
|
|
635
|
+
/* @__PURE__ */ B(l, {
|
|
636
636
|
label: i("atheletebridge.pages.performance.label.totalLoad", "Total load"),
|
|
637
637
|
htmlFor: "workoutLoad",
|
|
638
|
-
children: /* @__PURE__ */
|
|
638
|
+
children: /* @__PURE__ */ B("input", {
|
|
639
639
|
id: "workoutLoad",
|
|
640
640
|
inputMode: "decimal",
|
|
641
641
|
className: u,
|
|
@@ -645,10 +645,10 @@ function be({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
|
645
645
|
})
|
|
646
646
|
]
|
|
647
647
|
}),
|
|
648
|
-
/* @__PURE__ */
|
|
648
|
+
/* @__PURE__ */ B(l, {
|
|
649
649
|
label: i("atheletebridge.pages.performance.label.notes", "Notes"),
|
|
650
650
|
htmlFor: "workoutNotes",
|
|
651
|
-
children: /* @__PURE__ */
|
|
651
|
+
children: /* @__PURE__ */ B("textarea", {
|
|
652
652
|
id: "workoutNotes",
|
|
653
653
|
rows: 2,
|
|
654
654
|
className: u,
|
|
@@ -657,26 +657,26 @@ function be({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
|
657
657
|
placeholder: i("atheletebridge.pages.performance.notesPlaceholder", "How did the session go?")
|
|
658
658
|
})
|
|
659
659
|
}),
|
|
660
|
-
E && /* @__PURE__ */
|
|
660
|
+
E && /* @__PURE__ */ B("p", {
|
|
661
661
|
className: "text-sm text-status-error-text",
|
|
662
662
|
children: E
|
|
663
663
|
}),
|
|
664
|
-
/* @__PURE__ */
|
|
664
|
+
/* @__PURE__ */ V(G, { children: [/* @__PURE__ */ B("button", {
|
|
665
665
|
type: "button",
|
|
666
666
|
onClick: () => t(!1),
|
|
667
667
|
className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
668
668
|
children: i("common.cancel", "Cancel")
|
|
669
|
-
}), /* @__PURE__ */
|
|
669
|
+
}), /* @__PURE__ */ V("button", {
|
|
670
670
|
type: "submit",
|
|
671
671
|
disabled: a.isPending,
|
|
672
|
-
className: b(
|
|
673
|
-
children: [a.isPending ? /* @__PURE__ */
|
|
672
|
+
className: b(Z, "disabled:opacity-60"),
|
|
673
|
+
children: [a.isPending ? /* @__PURE__ */ B(A, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ B(N, { className: "h-4 w-4" }), i("atheletebridge.pages.performance.logWorkout", "Log workout")]
|
|
674
674
|
})] })
|
|
675
675
|
]
|
|
676
676
|
})] })
|
|
677
677
|
});
|
|
678
678
|
}
|
|
679
|
-
function
|
|
679
|
+
function Se({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
680
680
|
let i = p(), a = g(), [o, s] = S("CUSTOM"), [c, d] = S(""), [f, m] = S(""), [h, _] = S(""), [v, y] = S(""), [x, C] = S(Q), [w, T] = S(null), E = () => {
|
|
681
681
|
s("CUSTOM"), d(""), m(""), _(""), y(""), C(Q()), T(null);
|
|
682
682
|
}, D = (e) => {
|
|
@@ -691,16 +691,16 @@ function xe({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
|
691
691
|
case "CUSTOM": return i("atheletebridge.metricType.custom", "Custom");
|
|
692
692
|
}
|
|
693
693
|
};
|
|
694
|
-
return /* @__PURE__ */
|
|
694
|
+
return /* @__PURE__ */ B(U, {
|
|
695
695
|
open: e,
|
|
696
696
|
onOpenChange: t,
|
|
697
|
-
children: /* @__PURE__ */
|
|
697
|
+
children: /* @__PURE__ */ V(W, { children: [/* @__PURE__ */ B(K, { children: /* @__PURE__ */ V(q, { children: [i("atheletebridge.pages.performance.recordMetricDialogTitle", "Record metric"), r ? ` — ${r}` : ""] }) }), /* @__PURE__ */ V("form", {
|
|
698
698
|
onSubmit: async (e) => {
|
|
699
699
|
if (e.preventDefault(), T(null), !c.trim()) {
|
|
700
700
|
T(i("atheletebridge.pages.performance.error.metricLabelRequired", "A metric label is required."));
|
|
701
701
|
return;
|
|
702
702
|
}
|
|
703
|
-
let r =
|
|
703
|
+
let r = he(f);
|
|
704
704
|
if (r === void 0) T(i("atheletebridge.pages.performance.error.metricValueRequired", "A numeric value is required."));
|
|
705
705
|
else if (!x) T(i("atheletebridge.pages.performance.error.recordedAtRequired", "A recorded date and time is required."));
|
|
706
706
|
else try {
|
|
@@ -719,26 +719,26 @@ function xe({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
|
719
719
|
},
|
|
720
720
|
className: "space-y-4 px-1",
|
|
721
721
|
children: [
|
|
722
|
-
/* @__PURE__ */
|
|
722
|
+
/* @__PURE__ */ V("div", {
|
|
723
723
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
724
|
-
children: [/* @__PURE__ */
|
|
724
|
+
children: [/* @__PURE__ */ B(l, {
|
|
725
725
|
label: i("atheletebridge.pages.performance.label.metricType", "Metric type"),
|
|
726
726
|
htmlFor: "metricType",
|
|
727
|
-
children: /* @__PURE__ */
|
|
727
|
+
children: /* @__PURE__ */ B(J, {
|
|
728
728
|
id: "metricType",
|
|
729
729
|
className: u,
|
|
730
730
|
value: o,
|
|
731
731
|
onChange: (e) => s(e.target.value),
|
|
732
|
-
children:
|
|
732
|
+
children: ne.map((e) => /* @__PURE__ */ B("option", {
|
|
733
733
|
value: e,
|
|
734
734
|
children: D(e)
|
|
735
735
|
}, e))
|
|
736
736
|
})
|
|
737
|
-
}), /* @__PURE__ */
|
|
737
|
+
}), /* @__PURE__ */ B(l, {
|
|
738
738
|
label: i("atheletebridge.pages.performance.label.recordedAt", "Recorded at"),
|
|
739
739
|
htmlFor: "metricRecordedAt",
|
|
740
740
|
required: !0,
|
|
741
|
-
children: /* @__PURE__ */
|
|
741
|
+
children: /* @__PURE__ */ B("input", {
|
|
742
742
|
id: "metricRecordedAt",
|
|
743
743
|
type: "datetime-local",
|
|
744
744
|
className: u,
|
|
@@ -747,11 +747,11 @@ function xe({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
|
747
747
|
})
|
|
748
748
|
})]
|
|
749
749
|
}),
|
|
750
|
-
/* @__PURE__ */
|
|
750
|
+
/* @__PURE__ */ B(l, {
|
|
751
751
|
label: i("atheletebridge.pages.performance.label.metricLabel", "Label"),
|
|
752
752
|
htmlFor: "metricLabel",
|
|
753
753
|
required: !0,
|
|
754
|
-
children: /* @__PURE__ */
|
|
754
|
+
children: /* @__PURE__ */ B("input", {
|
|
755
755
|
id: "metricLabel",
|
|
756
756
|
className: u,
|
|
757
757
|
value: c,
|
|
@@ -759,13 +759,13 @@ function xe({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
|
759
759
|
placeholder: i("atheletebridge.pages.performance.placeholder.metricLabel", "e.g. 40m sprint")
|
|
760
760
|
})
|
|
761
761
|
}),
|
|
762
|
-
/* @__PURE__ */
|
|
762
|
+
/* @__PURE__ */ V("div", {
|
|
763
763
|
className: "grid grid-cols-2 gap-4",
|
|
764
|
-
children: [/* @__PURE__ */
|
|
764
|
+
children: [/* @__PURE__ */ B(l, {
|
|
765
765
|
label: i("atheletebridge.pages.performance.label.value", "Value"),
|
|
766
766
|
htmlFor: "metricValue",
|
|
767
767
|
required: !0,
|
|
768
|
-
children: /* @__PURE__ */
|
|
768
|
+
children: /* @__PURE__ */ B("input", {
|
|
769
769
|
id: "metricValue",
|
|
770
770
|
inputMode: "decimal",
|
|
771
771
|
className: u,
|
|
@@ -773,10 +773,10 @@ function xe({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
|
773
773
|
onChange: (e) => m(e.target.value),
|
|
774
774
|
placeholder: i("atheletebridge.pages.performance.placeholder.value", "e.g. 4.8")
|
|
775
775
|
})
|
|
776
|
-
}), /* @__PURE__ */
|
|
776
|
+
}), /* @__PURE__ */ B(l, {
|
|
777
777
|
label: i("atheletebridge.pages.performance.label.unit", "Unit"),
|
|
778
778
|
htmlFor: "metricUnit",
|
|
779
|
-
children: /* @__PURE__ */
|
|
779
|
+
children: /* @__PURE__ */ B("input", {
|
|
780
780
|
id: "metricUnit",
|
|
781
781
|
className: u,
|
|
782
782
|
value: h,
|
|
@@ -785,11 +785,11 @@ function xe({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
|
785
785
|
})
|
|
786
786
|
})]
|
|
787
787
|
}),
|
|
788
|
-
/* @__PURE__ */
|
|
788
|
+
/* @__PURE__ */ B(l, {
|
|
789
789
|
label: i("atheletebridge.pages.performance.label.source", "Source"),
|
|
790
790
|
htmlFor: "metricSource",
|
|
791
791
|
hint: i("atheletebridge.pages.performance.hint.source", "Optional — device, test or coach."),
|
|
792
|
-
children: /* @__PURE__ */
|
|
792
|
+
children: /* @__PURE__ */ B("input", {
|
|
793
793
|
id: "metricSource",
|
|
794
794
|
className: u,
|
|
795
795
|
value: v,
|
|
@@ -797,25 +797,25 @@ function xe({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
|
797
797
|
placeholder: i("atheletebridge.pages.performance.placeholder.source", "e.g. GPS vest")
|
|
798
798
|
})
|
|
799
799
|
}),
|
|
800
|
-
w && /* @__PURE__ */
|
|
800
|
+
w && /* @__PURE__ */ B("p", {
|
|
801
801
|
className: "text-sm text-status-error-text",
|
|
802
802
|
children: w
|
|
803
803
|
}),
|
|
804
|
-
/* @__PURE__ */
|
|
804
|
+
/* @__PURE__ */ V(G, { children: [/* @__PURE__ */ B("button", {
|
|
805
805
|
type: "button",
|
|
806
806
|
onClick: () => t(!1),
|
|
807
807
|
className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
808
808
|
children: i("common.cancel", "Cancel")
|
|
809
|
-
}), /* @__PURE__ */
|
|
809
|
+
}), /* @__PURE__ */ V("button", {
|
|
810
810
|
type: "submit",
|
|
811
811
|
disabled: a.isPending,
|
|
812
|
-
className: b(
|
|
813
|
-
children: [a.isPending ? /* @__PURE__ */
|
|
812
|
+
className: b(Z, "disabled:opacity-60"),
|
|
813
|
+
children: [a.isPending ? /* @__PURE__ */ B(A, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ B(M, { className: "h-4 w-4" }), i("atheletebridge.pages.performance.recordMetric", "Record metric")]
|
|
814
814
|
})] })
|
|
815
815
|
]
|
|
816
816
|
})] })
|
|
817
817
|
});
|
|
818
818
|
}
|
|
819
|
-
export {
|
|
819
|
+
export { ge as PerformancePage };
|
|
820
820
|
|
|
821
821
|
//# sourceMappingURL=PerformancePage.js.map
|