@burdenoff/microfe-atheletebridge 2026.1109.1 → 2026.1110.2
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/AthleteBridgeRoutes.js +45 -21
- package/dist/atheletebridge/AthleteBridgeRoutes.js.map +1 -1
- package/dist/atheletebridge/components/MemberCard.d.ts +7 -0
- package/dist/atheletebridge/components/MemberCard.js +45 -0
- package/dist/atheletebridge/components/MemberCard.js.map +1 -0
- package/dist/atheletebridge/components/StatusBadge.js +8 -0
- package/dist/atheletebridge/components/StatusBadge.js.map +1 -1
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.d.ts +15 -1
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.js +63 -41
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.js.map +1 -1
- package/dist/atheletebridge/hooks/useAuditApi.d.ts +14 -0
- package/dist/atheletebridge/hooks/useAuditApi.js +38 -0
- package/dist/atheletebridge/hooks/useAuditApi.js.map +1 -0
- package/dist/atheletebridge/hooks/useRegistrationApi.d.ts +15 -0
- package/dist/atheletebridge/hooks/useRegistrationApi.js +38 -19
- package/dist/atheletebridge/hooks/useRegistrationApi.js.map +1 -1
- package/dist/atheletebridge/pages/audit/AuditLogPage.d.ts +11 -0
- package/dist/atheletebridge/pages/audit/AuditLogPage.js +277 -0
- package/dist/atheletebridge/pages/audit/AuditLogPage.js.map +1 -0
- package/dist/atheletebridge/pages/control/ClubControlPage.d.ts +11 -0
- package/dist/atheletebridge/pages/control/ClubControlPage.js +208 -0
- package/dist/atheletebridge/pages/control/ClubControlPage.js.map +1 -0
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js +126 -65
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.js +366 -196
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.js +243 -217
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.js +136 -83
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js +173 -146
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionsCalendarPage.d.ts +11 -0
- package/dist/atheletebridge/pages/sessions/SessionsCalendarPage.js +259 -0
- package/dist/atheletebridge/pages/sessions/SessionsCalendarPage.js.map +1 -0
- package/dist/atheletebridge/pages/sessions/SessionsListPage.js +59 -47
- package/dist/atheletebridge/pages/sessions/SessionsListPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamDetailPage.js +110 -83
- package/dist/atheletebridge/pages/teams/TeamDetailPage.js.map +1 -1
- package/dist/atheletebridge/types/audit.d.ts +47 -0
- package/dist/atheletebridge/types/index.d.ts +25 -0
- package/dist/atheletebridge/types/registration.d.ts +22 -1
- package/package.json +1 -1
|
@@ -2,20 +2,21 @@ import { SubjectDecisions as e } from "../../components/ai/SubjectDecisions.js";
|
|
|
2
2
|
import { PageLayout as t } from "../../components/PageLayout.js";
|
|
3
3
|
import { StatusBadge as n } from "../../components/StatusBadge.js";
|
|
4
4
|
import { EmptyState as ee } from "../../components/EmptyState.js";
|
|
5
|
-
import { ErrorState as te, LoadingState as
|
|
6
|
-
import { FormField as
|
|
7
|
-
import { DrillVideoLink as
|
|
8
|
-
import { PROGRAM_LEVEL_LABELS as
|
|
9
|
-
import { useAthleteBridge as
|
|
10
|
-
import { useAddDrill as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
5
|
+
import { ErrorState as te, LoadingState as ne } from "../../components/LoadingState.js";
|
|
6
|
+
import { FormField as r, fieldInputClass as i } from "../../components/form.js";
|
|
7
|
+
import { DrillVideoLink as re } from "../../components/DrillVideoLink.js";
|
|
8
|
+
import { PROGRAM_LEVEL_LABELS as a, SPORT_ICONS as ie, SPORT_LABELS as o } from "../../components/domain.js";
|
|
9
|
+
import { useAthleteBridge as ae } from "../../context/AthleteBridgeContext.js";
|
|
10
|
+
import { useAddDrill as oe, useArchiveProgram as se, useAssignProgram as ce, useProgram as le, useRemoveDrill as ue, useTeam as de, useTeams as fe, useTransitionProgram as pe, useUploadFile as me, useUserDirectory as he } from "../../hooks/useAthleteBridgeApi.js";
|
|
11
|
+
import { UserSearchSelect as ge } from "../../components/UserSearchSelect.js";
|
|
12
|
+
import { useAbTranslate as _e } from "../../i18n.js";
|
|
13
|
+
import { useMemo as ve, useState as s } from "react";
|
|
14
|
+
import { Archive as c, ArrowLeft as ye, Copy as be, Edit as xe, FileVideo as Se, Loader2 as l, Plus as u, Send as Ce, Trash2 as we, Undo2 as Te, UserCheck as Ee } from "lucide-react";
|
|
15
|
+
import { useParams as De } from "react-router";
|
|
16
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
17
|
+
import { Accordion as Oe, AccordionContent as ke, AccordionItem as Ae, AccordionTrigger as je, Badge as m, GlassCard as h, ResponsiveDialog as g, ResponsiveDialogContent as _, ResponsiveDialogFooter as v, ResponsiveDialogHeader as Me, ResponsiveDialogTitle as y } from "@burdenoff/fe-libs/ui";
|
|
17
18
|
// src/atheletebridge/pages/programs/ProgramDetailPage.tsx
|
|
18
|
-
var
|
|
19
|
+
var b = {
|
|
19
20
|
name: "",
|
|
20
21
|
description: "",
|
|
21
22
|
weekNumber: "1",
|
|
@@ -23,18 +24,21 @@ var A = {
|
|
|
23
24
|
reps: "",
|
|
24
25
|
durationSec: "",
|
|
25
26
|
restSec: ""
|
|
26
|
-
},
|
|
27
|
+
}, x = ({ children: e }) => /* @__PURE__ */ f("span", {
|
|
27
28
|
className: "inline-flex items-center rounded-md border border-border-seam bg-bg-sunken px-2 py-0.5 text-xs font-medium tabular-nums text-text-secondary",
|
|
28
29
|
children: e
|
|
29
|
-
}),
|
|
30
|
+
}), S = (e) => {
|
|
30
31
|
let t = e.trim();
|
|
31
32
|
if (!t) return;
|
|
32
33
|
let n = Number.parseInt(t, 10);
|
|
33
34
|
return Number.isNaN(n) ? void 0 : n;
|
|
34
35
|
};
|
|
35
|
-
function
|
|
36
|
-
let
|
|
37
|
-
|
|
36
|
+
function C() {
|
|
37
|
+
let C = _e(), { id: w } = De(), { navigateTo: T } = ae(), E = le(w), D = pe(), O = se(), k = ce(), A = oe(), j = ue(w), Ne = me(), Pe = fe(), Fe = de(E.data?.assignedTeamId ?? void 0), M = he([E.data?.assignedAthleteId, E.data?.coachId]), [Ie, N] = s(!1), [P, F] = s(b), [I, L] = s(null), [R, z] = s(!1), [B, V] = s(null), [Le, H] = s(!1), [U, W] = s("none"), [G, K] = s({
|
|
38
|
+
userId: "",
|
|
39
|
+
displayName: ""
|
|
40
|
+
}), [q, J] = s(""), [Y, X] = s(null), Re = ve(() => {
|
|
41
|
+
let e = E.data?.drills?.items ?? [], t = /* @__PURE__ */ new Map();
|
|
38
42
|
for (let n of e) {
|
|
39
43
|
let e = t.get(n.weekNumber) ?? [];
|
|
40
44
|
e.push(n), t.set(n.weekNumber, e);
|
|
@@ -43,100 +47,100 @@ function N() {
|
|
|
43
47
|
week: e,
|
|
44
48
|
drills: [...t].sort((e, t) => e.orderIndex - t.orderIndex)
|
|
45
49
|
}));
|
|
46
|
-
}, [
|
|
47
|
-
if (
|
|
48
|
-
title:
|
|
49
|
-
children: /* @__PURE__ */
|
|
50
|
+
}, [E.data]);
|
|
51
|
+
if (E.isLoading) return /* @__PURE__ */ f(t, {
|
|
52
|
+
title: C("atheletebridge.pages.programDetail.title", "Program"),
|
|
53
|
+
children: /* @__PURE__ */ f(ne, { label: C("atheletebridge.pages.programDetail.loading", "Loading program…") })
|
|
50
54
|
});
|
|
51
|
-
if (
|
|
52
|
-
title:
|
|
53
|
-
children: /* @__PURE__ */
|
|
54
|
-
title:
|
|
55
|
-
message:
|
|
56
|
-
onRetry: () =>
|
|
55
|
+
if (E.isError || !E.data) return /* @__PURE__ */ f(t, {
|
|
56
|
+
title: C("atheletebridge.pages.programDetail.title", "Program"),
|
|
57
|
+
children: /* @__PURE__ */ f(te, {
|
|
58
|
+
title: C("atheletebridge.pages.programDetail.notFoundTitle", "Program not found"),
|
|
59
|
+
message: C("atheletebridge.pages.programDetail.notFoundMessage", "This program does not exist or you do not have access to it."),
|
|
60
|
+
onRetry: () => T("/programs")
|
|
57
61
|
})
|
|
58
62
|
});
|
|
59
|
-
let Z =
|
|
60
|
-
|
|
61
|
-
id:
|
|
63
|
+
let Z = E.data, Q = Z.drills?.items.length ?? 0, ze = ie[Z.sport], Be = Re.map(({ week: e }) => `week-${e}`), $ = (e) => {
|
|
64
|
+
w && D.mutate({
|
|
65
|
+
id: w,
|
|
62
66
|
status: e
|
|
63
67
|
});
|
|
64
68
|
};
|
|
65
|
-
return /* @__PURE__ */
|
|
69
|
+
return /* @__PURE__ */ p(t, {
|
|
66
70
|
title: Z.name,
|
|
67
71
|
gradientTitle: !0,
|
|
68
|
-
description: `${
|
|
69
|
-
actions: /* @__PURE__ */
|
|
72
|
+
description: `${o[Z.sport]} · ${a[Z.level]} · ${Z.weeks} ${Z.weeks === 1 ? "week" : "weeks"}`,
|
|
73
|
+
actions: /* @__PURE__ */ p("div", {
|
|
70
74
|
className: "flex flex-wrap items-center gap-2",
|
|
71
75
|
children: [
|
|
72
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ p("button", {
|
|
73
77
|
type: "button",
|
|
74
|
-
onClick: () =>
|
|
78
|
+
onClick: () => T("/programs"),
|
|
75
79
|
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",
|
|
76
80
|
children: [
|
|
77
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ f(ye, { className: "h-4 w-4" }),
|
|
78
82
|
" ",
|
|
79
|
-
|
|
83
|
+
C("atheletebridge.pages.programDetail.back", "Back")
|
|
80
84
|
]
|
|
81
85
|
}),
|
|
82
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ p("button", {
|
|
83
87
|
type: "button",
|
|
84
|
-
onClick: () =>
|
|
88
|
+
onClick: () => T(`/programs/${Z.id}/edit`),
|
|
85
89
|
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",
|
|
86
90
|
children: [
|
|
87
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ f(xe, { className: "h-4 w-4" }),
|
|
88
92
|
" ",
|
|
89
|
-
|
|
93
|
+
C("atheletebridge.pages.programDetail.edit", "Edit")
|
|
90
94
|
]
|
|
91
95
|
}),
|
|
92
|
-
Z.status !== "ARCHIVED" && /* @__PURE__ */
|
|
96
|
+
Z.status !== "ARCHIVED" && /* @__PURE__ */ p("button", {
|
|
93
97
|
type: "button",
|
|
94
98
|
onClick: async () => {
|
|
95
|
-
|
|
99
|
+
w && (await O.mutateAsync(w), T("/programs"));
|
|
96
100
|
},
|
|
97
|
-
disabled:
|
|
101
|
+
disabled: O.isPending,
|
|
98
102
|
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle disabled:opacity-60",
|
|
99
103
|
children: [
|
|
100
|
-
|
|
104
|
+
O.isPending ? /* @__PURE__ */ f(l, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ f(c, { className: "h-4 w-4" }),
|
|
101
105
|
" ",
|
|
102
|
-
|
|
106
|
+
C("atheletebridge.pages.programDetail.archive", "Archive")
|
|
103
107
|
]
|
|
104
108
|
})
|
|
105
109
|
]
|
|
106
110
|
}),
|
|
107
111
|
children: [
|
|
108
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ p(h, {
|
|
109
113
|
treatment: "insight",
|
|
110
114
|
className: "mb-8 p-6",
|
|
111
115
|
children: [
|
|
112
|
-
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ p("div", {
|
|
113
117
|
className: "flex items-start gap-4",
|
|
114
|
-
children: [/* @__PURE__ */
|
|
118
|
+
children: [/* @__PURE__ */ f("div", {
|
|
115
119
|
className: "flex h-14 w-14 shrink-0 items-center justify-center rounded-2xl bg-[var(--color-accent-soft)] text-text-primary",
|
|
116
|
-
children: /* @__PURE__ */
|
|
120
|
+
children: /* @__PURE__ */ f(ze, {
|
|
117
121
|
className: "h-7 w-7",
|
|
118
122
|
"aria-hidden": "true"
|
|
119
123
|
})
|
|
120
|
-
}), /* @__PURE__ */
|
|
124
|
+
}), /* @__PURE__ */ p("div", {
|
|
121
125
|
className: "min-w-0 flex-1",
|
|
122
|
-
children: [/* @__PURE__ */
|
|
126
|
+
children: [/* @__PURE__ */ p("div", {
|
|
123
127
|
className: "flex flex-wrap items-center gap-2",
|
|
124
128
|
children: [
|
|
125
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ f(m, {
|
|
126
130
|
variant: "secondary",
|
|
127
|
-
children:
|
|
131
|
+
children: o[Z.sport]
|
|
128
132
|
}),
|
|
129
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ f(m, {
|
|
130
134
|
variant: "secondary",
|
|
131
|
-
children:
|
|
135
|
+
children: a[Z.level]
|
|
132
136
|
}),
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
Z.isTemplate && /* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ f(n, { status: Z.status }),
|
|
138
|
+
Z.isTemplate && /* @__PURE__ */ p("span", {
|
|
135
139
|
className: "inline-flex items-center gap-1 text-xs text-text-secondary",
|
|
136
|
-
children: [/* @__PURE__ */
|
|
140
|
+
children: [/* @__PURE__ */ f(be, { className: "h-3.5 w-3.5" }), " Template"]
|
|
137
141
|
})
|
|
138
142
|
]
|
|
139
|
-
}), /* @__PURE__ */
|
|
143
|
+
}), /* @__PURE__ */ p("p", {
|
|
140
144
|
className: "mt-2 text-sm text-text-secondary",
|
|
141
145
|
children: [
|
|
142
146
|
Z.weeks,
|
|
@@ -150,110 +154,197 @@ function N() {
|
|
|
150
154
|
})]
|
|
151
155
|
})]
|
|
152
156
|
}),
|
|
153
|
-
Z.summary && /* @__PURE__ */
|
|
157
|
+
Z.summary && /* @__PURE__ */ f("p", {
|
|
154
158
|
className: "mt-4 text-sm text-text-secondary",
|
|
155
159
|
children: Z.summary
|
|
156
160
|
}),
|
|
157
|
-
Z.tags.length > 0 && /* @__PURE__ */
|
|
161
|
+
Z.tags.length > 0 && /* @__PURE__ */ f("div", {
|
|
158
162
|
className: "mt-4 flex flex-wrap gap-1.5",
|
|
159
|
-
children: Z.tags.map((e) => /* @__PURE__ */
|
|
163
|
+
children: Z.tags.map((e) => /* @__PURE__ */ f("span", {
|
|
160
164
|
className: "inline-flex items-center rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary",
|
|
161
165
|
children: e
|
|
162
166
|
}, e))
|
|
163
167
|
}),
|
|
164
|
-
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ p("div", {
|
|
165
169
|
className: "mt-5 flex flex-wrap items-center gap-2 border-t border-border-seam pt-5",
|
|
166
170
|
children: [
|
|
167
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ f("span", {
|
|
168
172
|
className: "text-sm font-medium text-text-primary",
|
|
169
|
-
children:
|
|
173
|
+
children: C("atheletebridge.pages.programDetail.lifecycle", "Publish lifecycle:")
|
|
170
174
|
}),
|
|
171
|
-
Z.status === "DRAFT" && /* @__PURE__ */
|
|
175
|
+
Z.status === "DRAFT" && /* @__PURE__ */ p("button", {
|
|
172
176
|
type: "button",
|
|
173
177
|
onClick: () => $("PUBLISHED"),
|
|
174
|
-
disabled:
|
|
178
|
+
disabled: D.isPending,
|
|
175
179
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-60",
|
|
176
180
|
children: [
|
|
177
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ f(Ce, { className: "h-4 w-4" }),
|
|
178
182
|
" ",
|
|
179
|
-
|
|
183
|
+
C("atheletebridge.pages.programDetail.publish", "Publish")
|
|
180
184
|
]
|
|
181
185
|
}),
|
|
182
|
-
Z.status === "PUBLISHED" && /* @__PURE__ */
|
|
186
|
+
Z.status === "PUBLISHED" && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ p("button", {
|
|
183
187
|
type: "button",
|
|
184
188
|
onClick: () => $("DRAFT"),
|
|
185
|
-
disabled:
|
|
189
|
+
disabled: D.isPending,
|
|
186
190
|
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-1.5 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-60",
|
|
187
191
|
children: [
|
|
188
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ f(Te, { className: "h-4 w-4" }),
|
|
189
193
|
" ",
|
|
190
|
-
|
|
194
|
+
C("atheletebridge.pages.programDetail.pullBackToDraft", "Pull back to draft")
|
|
191
195
|
]
|
|
192
|
-
}), /* @__PURE__ */
|
|
196
|
+
}), /* @__PURE__ */ p("button", {
|
|
193
197
|
type: "button",
|
|
194
198
|
onClick: () => $("ARCHIVED"),
|
|
195
|
-
disabled:
|
|
199
|
+
disabled: D.isPending,
|
|
196
200
|
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-1.5 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-60",
|
|
197
201
|
children: [
|
|
198
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ f(c, { className: "h-4 w-4" }),
|
|
199
203
|
" ",
|
|
200
|
-
|
|
204
|
+
C("atheletebridge.pages.programDetail.archiveAction", "Archive")
|
|
201
205
|
]
|
|
202
206
|
})] }),
|
|
203
|
-
Z.status === "ARCHIVED" && /* @__PURE__ */
|
|
207
|
+
Z.status === "ARCHIVED" && /* @__PURE__ */ f("span", {
|
|
204
208
|
className: "text-sm text-text-secondary",
|
|
205
|
-
children:
|
|
209
|
+
children: C("atheletebridge.pages.programDetail.archived", "This program is archived.")
|
|
206
210
|
}),
|
|
207
|
-
|
|
211
|
+
D.isPending && /* @__PURE__ */ f(l, { className: "h-4 w-4 animate-spin text-text-secondary" })
|
|
208
212
|
]
|
|
209
213
|
})
|
|
210
214
|
]
|
|
211
215
|
}),
|
|
212
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ f(h, {
|
|
217
|
+
treatment: "insight",
|
|
218
|
+
className: "mb-8 p-6",
|
|
219
|
+
children: /* @__PURE__ */ p("div", {
|
|
220
|
+
className: "flex flex-wrap items-start justify-between gap-4",
|
|
221
|
+
children: [/* @__PURE__ */ p("div", {
|
|
222
|
+
className: "min-w-0 flex-1",
|
|
223
|
+
children: [
|
|
224
|
+
/* @__PURE__ */ f("h2", {
|
|
225
|
+
className: "text-sm font-semibold text-text-primary",
|
|
226
|
+
children: C("atheletebridge.pages.programDetail.assignmentTitle", "Assignment")
|
|
227
|
+
}),
|
|
228
|
+
/* @__PURE__ */ f("p", {
|
|
229
|
+
className: "mt-1 text-sm text-text-secondary",
|
|
230
|
+
children: Z.assignedTeamId ? /* @__PURE__ */ p(d, { children: [
|
|
231
|
+
C("atheletebridge.pages.programDetail.assignedToTeam", "Assigned to team"),
|
|
232
|
+
" ",
|
|
233
|
+
/* @__PURE__ */ f("button", {
|
|
234
|
+
type: "button",
|
|
235
|
+
onClick: () => T(`/teams/${Z.assignedTeamId}`),
|
|
236
|
+
className: "font-medium text-text-link hover:underline",
|
|
237
|
+
children: Fe.data?.name ?? Z.assignedTeamId
|
|
238
|
+
})
|
|
239
|
+
] }) : Z.assignedAthleteId ? /* @__PURE__ */ p(d, { children: [
|
|
240
|
+
C("atheletebridge.pages.programDetail.assignedToAthlete", "Assigned to"),
|
|
241
|
+
" ",
|
|
242
|
+
/* @__PURE__ */ f("span", {
|
|
243
|
+
className: "font-medium text-text-primary",
|
|
244
|
+
children: M.nameOf(Z.assignedAthleteId) ?? Z.assignedAthleteId
|
|
245
|
+
})
|
|
246
|
+
] }) : C("atheletebridge.pages.programDetail.unassigned", "Not assigned yet — assign it to a team or an athlete to track adherence.")
|
|
247
|
+
}),
|
|
248
|
+
Z.adherence && /* @__PURE__ */ p("div", {
|
|
249
|
+
className: "mt-4",
|
|
250
|
+
children: [
|
|
251
|
+
/* @__PURE__ */ p("div", {
|
|
252
|
+
className: "flex flex-wrap items-center justify-between gap-2",
|
|
253
|
+
children: [/* @__PURE__ */ f("span", {
|
|
254
|
+
className: "text-xs font-medium uppercase tracking-wide text-text-secondary",
|
|
255
|
+
children: C("atheletebridge.pages.programDetail.adherenceTitle", "Adherence")
|
|
256
|
+
}), /* @__PURE__ */ f("span", {
|
|
257
|
+
className: "text-sm font-semibold tabular-nums text-text-primary",
|
|
258
|
+
children: C("atheletebridge.pages.programDetail.adherencePct", "{pct}%").replace("{pct}", String(Z.adherence.adherencePct))
|
|
259
|
+
})]
|
|
260
|
+
}),
|
|
261
|
+
/* @__PURE__ */ f("div", {
|
|
262
|
+
role: "progressbar",
|
|
263
|
+
"aria-valuenow": Z.adherence.adherencePct,
|
|
264
|
+
"aria-valuemin": 0,
|
|
265
|
+
"aria-valuemax": 100,
|
|
266
|
+
className: "mt-2 h-2 overflow-hidden rounded-full bg-bg-sunken",
|
|
267
|
+
children: /* @__PURE__ */ f("div", {
|
|
268
|
+
className: "h-full rounded-full bg-action-primary-bg transition-[width]",
|
|
269
|
+
style: { width: `${Z.adherence.adherencePct}%` }
|
|
270
|
+
})
|
|
271
|
+
}),
|
|
272
|
+
/* @__PURE__ */ f("p", {
|
|
273
|
+
className: "mt-2 text-xs text-text-secondary",
|
|
274
|
+
children: C("atheletebridge.pages.programDetail.adherenceSummary", "{completed} of {planned} planned drills completed · {skipped} skipped · {logged} workouts logged").replace("{completed}", String(Z.adherence.completedWorkouts)).replace("{planned}", String(Z.adherence.plannedDrills)).replace("{skipped}", String(Z.adherence.skippedWorkouts)).replace("{logged}", String(Z.adherence.loggedWorkouts))
|
|
275
|
+
})
|
|
276
|
+
]
|
|
277
|
+
})
|
|
278
|
+
]
|
|
279
|
+
}), /* @__PURE__ */ p("button", {
|
|
280
|
+
type: "button",
|
|
281
|
+
onClick: () => {
|
|
282
|
+
X(null), E.data?.assignedTeamId ? (W("team"), J(E.data.assignedTeamId), K({
|
|
283
|
+
userId: "",
|
|
284
|
+
displayName: ""
|
|
285
|
+
})) : E.data?.assignedAthleteId ? (W("athlete"), K({
|
|
286
|
+
userId: E.data.assignedAthleteId,
|
|
287
|
+
displayName: M.nameOf(E.data.assignedAthleteId) ?? ""
|
|
288
|
+
}), J("")) : (W("none"), K({
|
|
289
|
+
userId: "",
|
|
290
|
+
displayName: ""
|
|
291
|
+
}), J("")), H(!0);
|
|
292
|
+
},
|
|
293
|
+
disabled: Z.status === "ARCHIVED",
|
|
294
|
+
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-1.5 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-60",
|
|
295
|
+
children: [
|
|
296
|
+
/* @__PURE__ */ f(Ee, { className: "h-4 w-4" }),
|
|
297
|
+
" ",
|
|
298
|
+
C("atheletebridge.pages.programDetail.assignAction", "Assign")
|
|
299
|
+
]
|
|
300
|
+
})]
|
|
301
|
+
})
|
|
302
|
+
}),
|
|
303
|
+
/* @__PURE__ */ p("section", { children: [/* @__PURE__ */ p("div", {
|
|
213
304
|
className: "mb-4 flex items-center justify-between",
|
|
214
|
-
children: [/* @__PURE__ */
|
|
305
|
+
children: [/* @__PURE__ */ p("h2", {
|
|
215
306
|
className: "text-lg font-semibold text-text-primary",
|
|
216
307
|
children: [
|
|
217
|
-
|
|
308
|
+
C("atheletebridge.pages.programDetail.drillsTitle", "Drills"),
|
|
218
309
|
" (",
|
|
219
310
|
Q,
|
|
220
311
|
")"
|
|
221
312
|
]
|
|
222
|
-
}), /* @__PURE__ */
|
|
313
|
+
}), /* @__PURE__ */ p("button", {
|
|
223
314
|
type: "button",
|
|
224
315
|
onClick: () => {
|
|
225
|
-
|
|
316
|
+
V(null), N(!0);
|
|
226
317
|
},
|
|
227
318
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90",
|
|
228
319
|
children: [
|
|
229
|
-
/* @__PURE__ */
|
|
320
|
+
/* @__PURE__ */ f(u, { className: "h-4 w-4" }),
|
|
230
321
|
" ",
|
|
231
|
-
|
|
322
|
+
C("atheletebridge.pages.programDetail.addDrill", "Add drill")
|
|
232
323
|
]
|
|
233
324
|
})]
|
|
234
|
-
}), Q === 0 ? /* @__PURE__ */
|
|
325
|
+
}), Q === 0 ? /* @__PURE__ */ f(ee, {
|
|
235
326
|
illustration: "empty-data",
|
|
236
|
-
icon: /* @__PURE__ */
|
|
237
|
-
title:
|
|
238
|
-
description:
|
|
239
|
-
}) : /* @__PURE__ */
|
|
327
|
+
icon: /* @__PURE__ */ f(u, { className: "h-10 w-10" }),
|
|
328
|
+
title: C("atheletebridge.pages.programDetail.noDrillsTitle", "No drills yet"),
|
|
329
|
+
description: C("atheletebridge.pages.programDetail.noDrillsHint", "Add drills with sets, reps and durations, organized by week.")
|
|
330
|
+
}) : /* @__PURE__ */ f(Oe, {
|
|
240
331
|
type: "multiple",
|
|
241
|
-
defaultValue:
|
|
332
|
+
defaultValue: Be,
|
|
242
333
|
className: "flex flex-col gap-3",
|
|
243
|
-
children:
|
|
334
|
+
children: Re.map(({ week: e, drills: t }) => /* @__PURE__ */ f(h, {
|
|
244
335
|
treatment: "insight",
|
|
245
336
|
className: "overflow-hidden px-4 py-0",
|
|
246
|
-
children: /* @__PURE__ */
|
|
337
|
+
children: /* @__PURE__ */ p(Ae, {
|
|
247
338
|
value: `week-${e}`,
|
|
248
339
|
className: "border-b-0",
|
|
249
|
-
children: [/* @__PURE__ */
|
|
340
|
+
children: [/* @__PURE__ */ f(je, {
|
|
250
341
|
className: "py-4",
|
|
251
|
-
children: /* @__PURE__ */
|
|
342
|
+
children: /* @__PURE__ */ p("span", {
|
|
252
343
|
className: "flex items-center gap-2.5",
|
|
253
|
-
children: [/* @__PURE__ */
|
|
344
|
+
children: [/* @__PURE__ */ p("span", {
|
|
254
345
|
className: "text-sm font-semibold text-text-primary",
|
|
255
346
|
children: ["Week ", e]
|
|
256
|
-
}), /* @__PURE__ */
|
|
347
|
+
}), /* @__PURE__ */ p(m, {
|
|
257
348
|
variant: "secondary",
|
|
258
349
|
children: [
|
|
259
350
|
t.length,
|
|
@@ -262,41 +353,41 @@ function N() {
|
|
|
262
353
|
]
|
|
263
354
|
})]
|
|
264
355
|
})
|
|
265
|
-
}), /* @__PURE__ */
|
|
356
|
+
}), /* @__PURE__ */ f(ke, {
|
|
266
357
|
className: "pb-2",
|
|
267
|
-
children: /* @__PURE__ */
|
|
358
|
+
children: /* @__PURE__ */ f("div", {
|
|
268
359
|
className: "divide-y divide-border-seam",
|
|
269
|
-
children: t.map((e) => /* @__PURE__ */
|
|
360
|
+
children: t.map((e) => /* @__PURE__ */ p("div", {
|
|
270
361
|
className: "flex items-start gap-4 py-3",
|
|
271
|
-
children: [/* @__PURE__ */
|
|
362
|
+
children: [/* @__PURE__ */ p("div", {
|
|
272
363
|
className: "min-w-0 flex-1",
|
|
273
364
|
children: [
|
|
274
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ f("p", {
|
|
275
366
|
className: "text-sm font-medium text-text-primary",
|
|
276
367
|
children: e.name
|
|
277
368
|
}),
|
|
278
|
-
e.description && /* @__PURE__ */
|
|
369
|
+
e.description && /* @__PURE__ */ f("p", {
|
|
279
370
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
280
371
|
children: e.description
|
|
281
372
|
}),
|
|
282
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ p("div", {
|
|
283
374
|
className: "mt-2 flex flex-wrap gap-1.5",
|
|
284
375
|
children: [
|
|
285
|
-
e.sets !== null && /* @__PURE__ */
|
|
286
|
-
e.reps !== null && /* @__PURE__ */
|
|
287
|
-
e.durationSec !== null && /* @__PURE__ */
|
|
288
|
-
e.restSec !== null && /* @__PURE__ */
|
|
376
|
+
e.sets !== null && /* @__PURE__ */ p(x, { children: [e.sets, " sets"] }),
|
|
377
|
+
e.reps !== null && /* @__PURE__ */ p(x, { children: [e.reps, " reps"] }),
|
|
378
|
+
e.durationSec !== null && /* @__PURE__ */ p(x, { children: [e.durationSec, "s work"] }),
|
|
379
|
+
e.restSec !== null && /* @__PURE__ */ p(x, { children: [e.restSec, "s rest"] })
|
|
289
380
|
]
|
|
290
381
|
}),
|
|
291
|
-
e.video?.id && /* @__PURE__ */
|
|
382
|
+
e.video?.id && /* @__PURE__ */ f("div", { children: /* @__PURE__ */ f(re, { fileId: e.video.id }) })
|
|
292
383
|
]
|
|
293
|
-
}), /* @__PURE__ */
|
|
384
|
+
}), /* @__PURE__ */ f("button", {
|
|
294
385
|
type: "button",
|
|
295
|
-
onClick: () => void
|
|
296
|
-
disabled:
|
|
297
|
-
"aria-label": `${
|
|
386
|
+
onClick: () => void j.mutate(e.id),
|
|
387
|
+
disabled: j.isPending,
|
|
388
|
+
"aria-label": `${C("common.delete", "Delete")} ${e.name}`,
|
|
298
389
|
className: "rounded-lg p-2 text-text-secondary transition-colors hover:bg-status-error-bg-subtle hover:text-status-error-text disabled:opacity-60",
|
|
299
|
-
children: /* @__PURE__ */
|
|
390
|
+
children: /* @__PURE__ */ f(we, { className: "h-4 w-4" })
|
|
300
391
|
})]
|
|
301
392
|
}, e.id))
|
|
302
393
|
})
|
|
@@ -304,123 +395,202 @@ function N() {
|
|
|
304
395
|
})
|
|
305
396
|
}, e))
|
|
306
397
|
})] }),
|
|
307
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ f(e, {
|
|
308
399
|
className: "mt-8",
|
|
309
400
|
subject: {
|
|
310
401
|
kind: "program",
|
|
311
402
|
programId: Z.id
|
|
312
403
|
}
|
|
313
404
|
}),
|
|
314
|
-
/* @__PURE__ */
|
|
315
|
-
open:
|
|
316
|
-
onOpenChange:
|
|
317
|
-
children: /* @__PURE__ */
|
|
405
|
+
/* @__PURE__ */ f(g, {
|
|
406
|
+
open: Le,
|
|
407
|
+
onOpenChange: H,
|
|
408
|
+
children: /* @__PURE__ */ p(_, { children: [/* @__PURE__ */ f(Me, { children: /* @__PURE__ */ f(y, { children: C("atheletebridge.pages.programDetail.assignTitle", "Assign program") }) }), /* @__PURE__ */ p("form", {
|
|
409
|
+
onSubmit: async (e) => {
|
|
410
|
+
if (e.preventDefault(), X(null), w) {
|
|
411
|
+
if (U === "athlete" && !G.userId.trim()) X(C("atheletebridge.pages.programDetail.assignAthleteRequired", "Pick an athlete."));
|
|
412
|
+
else if (U === "team" && !q) X(C("atheletebridge.pages.programDetail.assignTeamRequired", "Pick a team."));
|
|
413
|
+
else try {
|
|
414
|
+
await k.mutateAsync({
|
|
415
|
+
id: w,
|
|
416
|
+
input: U === "athlete" ? { athleteId: G.userId.trim() } : U === "team" ? { teamId: q } : {}
|
|
417
|
+
}), H(!1);
|
|
418
|
+
} catch (e) {
|
|
419
|
+
X(e instanceof Error ? e.message : "Failed to update the assignment.");
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
},
|
|
423
|
+
className: "space-y-4 px-1",
|
|
424
|
+
children: [
|
|
425
|
+
/* @__PURE__ */ f("div", {
|
|
426
|
+
className: "flex flex-wrap gap-2",
|
|
427
|
+
children: [
|
|
428
|
+
["none", C("atheletebridge.pages.programDetail.assignNone", "Unassigned")],
|
|
429
|
+
["athlete", C("atheletebridge.pages.programDetail.assignAthlete", "Athlete")],
|
|
430
|
+
["team", C("atheletebridge.pages.programDetail.assignTeam", "Team")]
|
|
431
|
+
].map(([e, t]) => /* @__PURE__ */ f("button", {
|
|
432
|
+
type: "button",
|
|
433
|
+
onClick: () => W(e),
|
|
434
|
+
"aria-pressed": U === e,
|
|
435
|
+
className: `rounded-full border px-3 py-1 text-xs font-medium transition-colors ${U === e ? "border-border-strong bg-bg-sunken text-text-primary" : "border-border-seam text-text-secondary hover:bg-bg-sunken"}`,
|
|
436
|
+
children: t
|
|
437
|
+
}, e))
|
|
438
|
+
}),
|
|
439
|
+
U === "athlete" && /* @__PURE__ */ f(ge, {
|
|
440
|
+
userId: G.userId,
|
|
441
|
+
displayName: G.displayName,
|
|
442
|
+
onSelect: ({ userId: e, displayName: t }) => K({
|
|
443
|
+
userId: e,
|
|
444
|
+
displayName: t
|
|
445
|
+
}),
|
|
446
|
+
required: !0
|
|
447
|
+
}),
|
|
448
|
+
U === "team" && /* @__PURE__ */ f(r, {
|
|
449
|
+
label: C("atheletebridge.pages.programDetail.assignTeam", "Team"),
|
|
450
|
+
htmlFor: "assignTeam",
|
|
451
|
+
required: !0,
|
|
452
|
+
children: /* @__PURE__ */ p("select", {
|
|
453
|
+
id: "assignTeam",
|
|
454
|
+
className: i,
|
|
455
|
+
value: q,
|
|
456
|
+
onChange: (e) => J(e.target.value),
|
|
457
|
+
children: [/* @__PURE__ */ f("option", {
|
|
458
|
+
value: "",
|
|
459
|
+
children: C("atheletebridge.pages.programDetail.assignTeamPlaceholder", "Select a team")
|
|
460
|
+
}), (Pe.data?.items ?? []).map((e) => /* @__PURE__ */ f("option", {
|
|
461
|
+
value: e.id,
|
|
462
|
+
children: e.name
|
|
463
|
+
}, e.id))]
|
|
464
|
+
})
|
|
465
|
+
}),
|
|
466
|
+
Y && /* @__PURE__ */ f("p", {
|
|
467
|
+
className: "text-sm text-status-error-text",
|
|
468
|
+
children: Y
|
|
469
|
+
}),
|
|
470
|
+
/* @__PURE__ */ p(v, { children: [/* @__PURE__ */ f("button", {
|
|
471
|
+
type: "button",
|
|
472
|
+
onClick: () => H(!1),
|
|
473
|
+
className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
474
|
+
children: C("common.cancel", "Cancel")
|
|
475
|
+
}), /* @__PURE__ */ p("button", {
|
|
476
|
+
type: "submit",
|
|
477
|
+
disabled: k.isPending,
|
|
478
|
+
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-semibold text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-60",
|
|
479
|
+
children: [k.isPending && /* @__PURE__ */ f(l, { className: "h-4 w-4 animate-spin" }), C("common.save", "Save")]
|
|
480
|
+
})] })
|
|
481
|
+
]
|
|
482
|
+
})] })
|
|
483
|
+
}),
|
|
484
|
+
/* @__PURE__ */ f(g, {
|
|
485
|
+
open: Ie,
|
|
486
|
+
onOpenChange: N,
|
|
487
|
+
children: /* @__PURE__ */ p(_, { children: [/* @__PURE__ */ f(Me, { children: /* @__PURE__ */ f(y, { children: C("atheletebridge.pages.programDetail.addDrill", "Add drill") }) }), /* @__PURE__ */ p("form", {
|
|
318
488
|
onSubmit: async (e) => {
|
|
319
|
-
if (e.preventDefault(),
|
|
320
|
-
if (!
|
|
321
|
-
|
|
489
|
+
if (e.preventDefault(), V(null), !w) return;
|
|
490
|
+
if (!P.name.trim()) {
|
|
491
|
+
V("Drill name is required.");
|
|
322
492
|
return;
|
|
323
493
|
}
|
|
324
|
-
let t =
|
|
325
|
-
if (
|
|
326
|
-
|
|
494
|
+
let t = S(P.weekNumber) ?? 1, n;
|
|
495
|
+
if (I) {
|
|
496
|
+
z(!0);
|
|
327
497
|
try {
|
|
328
|
-
n = await
|
|
498
|
+
n = await Ne(I);
|
|
329
499
|
} catch (e) {
|
|
330
|
-
|
|
500
|
+
V(e instanceof Error ? e.message : "Failed to upload the demo video."), z(!1);
|
|
331
501
|
return;
|
|
332
502
|
}
|
|
333
|
-
|
|
503
|
+
z(!1);
|
|
334
504
|
}
|
|
335
505
|
try {
|
|
336
|
-
await
|
|
337
|
-
programId:
|
|
338
|
-
name:
|
|
339
|
-
description:
|
|
506
|
+
await A.mutateAsync({
|
|
507
|
+
programId: w,
|
|
508
|
+
name: P.name.trim(),
|
|
509
|
+
description: P.description.trim() || void 0,
|
|
340
510
|
weekNumber: t,
|
|
341
|
-
orderIndex:
|
|
342
|
-
sets:
|
|
343
|
-
reps:
|
|
344
|
-
durationSec:
|
|
345
|
-
restSec:
|
|
511
|
+
orderIndex: E.data?.drills?.items.filter((e) => e.weekNumber === t).length ?? 0,
|
|
512
|
+
sets: S(P.sets),
|
|
513
|
+
reps: S(P.reps),
|
|
514
|
+
durationSec: S(P.durationSec),
|
|
515
|
+
restSec: S(P.restSec),
|
|
346
516
|
videoFileId: n
|
|
347
|
-
}),
|
|
517
|
+
}), F(b), L(null), N(!1);
|
|
348
518
|
} catch (e) {
|
|
349
|
-
|
|
519
|
+
V(e instanceof Error ? e.message : "Failed to add drill.");
|
|
350
520
|
}
|
|
351
521
|
},
|
|
352
522
|
className: "space-y-4 px-1",
|
|
353
523
|
children: [
|
|
354
|
-
/* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ f(r, {
|
|
355
525
|
label: "Name",
|
|
356
526
|
htmlFor: "drillName",
|
|
357
527
|
required: !0,
|
|
358
|
-
children: /* @__PURE__ */
|
|
528
|
+
children: /* @__PURE__ */ f("input", {
|
|
359
529
|
id: "drillName",
|
|
360
|
-
className:
|
|
361
|
-
value:
|
|
362
|
-
onChange: (e) =>
|
|
530
|
+
className: i,
|
|
531
|
+
value: P.name,
|
|
532
|
+
onChange: (e) => F((t) => ({
|
|
363
533
|
...t,
|
|
364
534
|
name: e.target.value
|
|
365
535
|
})),
|
|
366
536
|
placeholder: "e.g. Box jumps"
|
|
367
537
|
})
|
|
368
538
|
}),
|
|
369
|
-
/* @__PURE__ */
|
|
539
|
+
/* @__PURE__ */ f(r, {
|
|
370
540
|
label: "Description",
|
|
371
541
|
htmlFor: "drillDesc",
|
|
372
|
-
children: /* @__PURE__ */
|
|
542
|
+
children: /* @__PURE__ */ f("textarea", {
|
|
373
543
|
id: "drillDesc",
|
|
374
|
-
className:
|
|
544
|
+
className: i,
|
|
375
545
|
rows: 2,
|
|
376
|
-
value:
|
|
377
|
-
onChange: (e) =>
|
|
546
|
+
value: P.description,
|
|
547
|
+
onChange: (e) => F((t) => ({
|
|
378
548
|
...t,
|
|
379
549
|
description: e.target.value
|
|
380
550
|
})),
|
|
381
551
|
placeholder: "How to perform the drill."
|
|
382
552
|
})
|
|
383
553
|
}),
|
|
384
|
-
/* @__PURE__ */
|
|
554
|
+
/* @__PURE__ */ p("div", {
|
|
385
555
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
386
556
|
children: [
|
|
387
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ f(r, {
|
|
388
558
|
label: "Week",
|
|
389
559
|
htmlFor: "drillWeek",
|
|
390
|
-
children: /* @__PURE__ */
|
|
560
|
+
children: /* @__PURE__ */ f("input", {
|
|
391
561
|
id: "drillWeek",
|
|
392
562
|
inputMode: "numeric",
|
|
393
|
-
className:
|
|
394
|
-
value:
|
|
395
|
-
onChange: (e) =>
|
|
563
|
+
className: i,
|
|
564
|
+
value: P.weekNumber,
|
|
565
|
+
onChange: (e) => F((t) => ({
|
|
396
566
|
...t,
|
|
397
567
|
weekNumber: e.target.value
|
|
398
568
|
}))
|
|
399
569
|
})
|
|
400
570
|
}),
|
|
401
|
-
/* @__PURE__ */
|
|
571
|
+
/* @__PURE__ */ f(r, {
|
|
402
572
|
label: "Sets",
|
|
403
573
|
htmlFor: "drillSets",
|
|
404
|
-
children: /* @__PURE__ */
|
|
574
|
+
children: /* @__PURE__ */ f("input", {
|
|
405
575
|
id: "drillSets",
|
|
406
576
|
inputMode: "numeric",
|
|
407
|
-
className:
|
|
408
|
-
value:
|
|
409
|
-
onChange: (e) =>
|
|
577
|
+
className: i,
|
|
578
|
+
value: P.sets,
|
|
579
|
+
onChange: (e) => F((t) => ({
|
|
410
580
|
...t,
|
|
411
581
|
sets: e.target.value
|
|
412
582
|
}))
|
|
413
583
|
})
|
|
414
584
|
}),
|
|
415
|
-
/* @__PURE__ */
|
|
585
|
+
/* @__PURE__ */ f(r, {
|
|
416
586
|
label: "Reps",
|
|
417
587
|
htmlFor: "drillReps",
|
|
418
|
-
children: /* @__PURE__ */
|
|
588
|
+
children: /* @__PURE__ */ f("input", {
|
|
419
589
|
id: "drillReps",
|
|
420
590
|
inputMode: "numeric",
|
|
421
|
-
className:
|
|
422
|
-
value:
|
|
423
|
-
onChange: (e) =>
|
|
591
|
+
className: i,
|
|
592
|
+
value: P.reps,
|
|
593
|
+
onChange: (e) => F((t) => ({
|
|
424
594
|
...t,
|
|
425
595
|
reps: e.target.value
|
|
426
596
|
}))
|
|
@@ -428,71 +598,71 @@ function N() {
|
|
|
428
598
|
})
|
|
429
599
|
]
|
|
430
600
|
}),
|
|
431
|
-
/* @__PURE__ */
|
|
601
|
+
/* @__PURE__ */ p("div", {
|
|
432
602
|
className: "grid grid-cols-2 gap-4",
|
|
433
|
-
children: [/* @__PURE__ */
|
|
603
|
+
children: [/* @__PURE__ */ f(r, {
|
|
434
604
|
label: "Work (sec)",
|
|
435
605
|
htmlFor: "drillDuration",
|
|
436
|
-
children: /* @__PURE__ */
|
|
606
|
+
children: /* @__PURE__ */ f("input", {
|
|
437
607
|
id: "drillDuration",
|
|
438
608
|
inputMode: "numeric",
|
|
439
|
-
className:
|
|
440
|
-
value:
|
|
441
|
-
onChange: (e) =>
|
|
609
|
+
className: i,
|
|
610
|
+
value: P.durationSec,
|
|
611
|
+
onChange: (e) => F((t) => ({
|
|
442
612
|
...t,
|
|
443
613
|
durationSec: e.target.value
|
|
444
614
|
}))
|
|
445
615
|
})
|
|
446
|
-
}), /* @__PURE__ */
|
|
616
|
+
}), /* @__PURE__ */ f(r, {
|
|
447
617
|
label: "Rest (sec)",
|
|
448
618
|
htmlFor: "drillRest",
|
|
449
|
-
children: /* @__PURE__ */
|
|
619
|
+
children: /* @__PURE__ */ f("input", {
|
|
450
620
|
id: "drillRest",
|
|
451
621
|
inputMode: "numeric",
|
|
452
|
-
className:
|
|
453
|
-
value:
|
|
454
|
-
onChange: (e) =>
|
|
622
|
+
className: i,
|
|
623
|
+
value: P.restSec,
|
|
624
|
+
onChange: (e) => F((t) => ({
|
|
455
625
|
...t,
|
|
456
626
|
restSec: e.target.value
|
|
457
627
|
}))
|
|
458
628
|
})
|
|
459
629
|
})]
|
|
460
630
|
}),
|
|
461
|
-
/* @__PURE__ */
|
|
631
|
+
/* @__PURE__ */ p(r, {
|
|
462
632
|
label: "Demo video",
|
|
463
633
|
htmlFor: "drillVideo",
|
|
464
634
|
hint: "Optional — attach a short demo clip; it's stored in workspace files.",
|
|
465
|
-
children: [/* @__PURE__ */
|
|
635
|
+
children: [/* @__PURE__ */ f("input", {
|
|
466
636
|
id: "drillVideo",
|
|
467
637
|
type: "file",
|
|
468
638
|
accept: "video/*",
|
|
469
|
-
className:
|
|
470
|
-
onChange: (e) =>
|
|
471
|
-
}),
|
|
639
|
+
className: i,
|
|
640
|
+
onChange: (e) => L(e.target.files?.[0] ?? null)
|
|
641
|
+
}), I && /* @__PURE__ */ p("p", {
|
|
472
642
|
className: "mt-1 inline-flex items-center gap-1 text-xs text-text-secondary",
|
|
473
643
|
children: [
|
|
474
|
-
/* @__PURE__ */
|
|
644
|
+
/* @__PURE__ */ f(Se, { className: "h-3.5 w-3.5" }),
|
|
475
645
|
" ",
|
|
476
|
-
|
|
646
|
+
I.name
|
|
477
647
|
]
|
|
478
648
|
})]
|
|
479
649
|
}),
|
|
480
|
-
|
|
650
|
+
B && /* @__PURE__ */ f("p", {
|
|
481
651
|
className: "text-sm text-status-error-text",
|
|
482
|
-
children:
|
|
652
|
+
children: B
|
|
483
653
|
}),
|
|
484
|
-
/* @__PURE__ */
|
|
654
|
+
/* @__PURE__ */ p(v, { children: [/* @__PURE__ */ f("button", {
|
|
485
655
|
type: "button",
|
|
486
656
|
onClick: () => {
|
|
487
|
-
|
|
657
|
+
N(!1), L(null);
|
|
488
658
|
},
|
|
489
659
|
className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
490
|
-
children:
|
|
491
|
-
}), /* @__PURE__ */
|
|
660
|
+
children: C("common.cancel", "Cancel")
|
|
661
|
+
}), /* @__PURE__ */ p("button", {
|
|
492
662
|
type: "submit",
|
|
493
|
-
disabled:
|
|
663
|
+
disabled: A.isPending || R,
|
|
494
664
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-60",
|
|
495
|
-
children: [(
|
|
665
|
+
children: [(A.isPending || R) && /* @__PURE__ */ f(l, { className: "h-4 w-4 animate-spin" }), R ? C("atheletebridge.pages.programDetail.uploadingVideo", "Uploading video…") : C("atheletebridge.pages.programDetail.addDrill", "Add drill")]
|
|
496
666
|
})] })
|
|
497
667
|
]
|
|
498
668
|
})] })
|
|
@@ -500,6 +670,6 @@ function N() {
|
|
|
500
670
|
]
|
|
501
671
|
});
|
|
502
672
|
}
|
|
503
|
-
export {
|
|
673
|
+
export { C as ProgramDetailPage };
|
|
504
674
|
|
|
505
675
|
//# sourceMappingURL=ProgramDetailPage.js.map
|