@burdenoff/microfe-mybodyshield 2026.716.1 → 2026.720.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/mybodyshield/data/programTemplates.d.ts +23 -0
- package/dist/mybodyshield/data/programTemplates.d.ts.map +1 -0
- package/dist/mybodyshield/data/programTemplates.js +212 -0
- package/dist/mybodyshield/data/programTemplates.js.map +1 -0
- package/dist/mybodyshield/hooks/useMyBodyShieldApi.d.ts +54 -5
- package/dist/mybodyshield/hooks/useMyBodyShieldApi.d.ts.map +1 -1
- package/dist/mybodyshield/hooks/useMyBodyShieldApi.js +101 -43
- package/dist/mybodyshield/hooks/useMyBodyShieldApi.js.map +1 -1
- package/dist/mybodyshield/pages/DashboardPage.js +1 -1
- package/dist/mybodyshield/pages/DashboardPage.js.map +1 -1
- package/dist/mybodyshield/pages/coaching/CoachingPage.js +1 -1
- package/dist/mybodyshield/pages/coaching/CoachingPage.js.map +1 -1
- package/dist/mybodyshield/pages/programs/ProgramsPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/programs/ProgramsPage.js +169 -121
- package/dist/mybodyshield/pages/programs/ProgramsPage.js.map +1 -1
- package/dist/mybodyshield/pages/recovery/RecoveryPage.js +1 -1
- package/dist/mybodyshield/pages/recovery/RecoveryPage.js.map +1 -1
- package/dist/mybodyshield/pages/train/SessionDetailPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/train/SessionDetailPage.js +438 -266
- package/dist/mybodyshield/pages/train/SessionDetailPage.js.map +1 -1
- package/dist/mybodyshield/types/assistant.d.ts.map +1 -1
- package/dist/mybodyshield/types/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,34 +1,38 @@
|
|
|
1
1
|
import { useMyBodyShield as e } from "../../context/MyBodyShieldContext.js";
|
|
2
2
|
import { PageLayout as t } from "../../components/PageLayout.js";
|
|
3
3
|
import { MetricsCard as n } from "../../components/MetricsCard.js";
|
|
4
|
-
import { formatDateTime as
|
|
5
|
-
import { StatusBadge as
|
|
6
|
-
import { EmptyState as
|
|
7
|
-
import { ErrorView as
|
|
4
|
+
import { formatDateTime as ee, formatDuration as r, formatEnumLabel as te, formatKcal as ne, formatNumber as i, formatRelativeTime as a, formatWeight as o } from "../../utils/formatters.js";
|
|
5
|
+
import { StatusBadge as re } from "../../components/StatusBadge.js";
|
|
6
|
+
import { EmptyState as ie } from "../../components/EmptyState.js";
|
|
7
|
+
import { ErrorView as ae, LoadingView as oe } from "../../components/StateViews.js";
|
|
8
8
|
import "../../context/index.js";
|
|
9
|
-
import { useMybCompleteSession as
|
|
10
|
-
import { useMyBodyShieldAnalytics as
|
|
9
|
+
import { useMybCompleteSession as se, useMybExerciseBestSet as ce, useMybLogSet as le, useMybSession as ue, useMybWorkoutExercises as de } from "../../hooks/useMyBodyShieldApi.js";
|
|
10
|
+
import { useMyBodyShieldAnalytics as fe } from "../../hooks/useMyBodyShieldAnalytics.js";
|
|
11
11
|
import "../../hooks/index.js";
|
|
12
|
-
import { MybDiscussion as
|
|
12
|
+
import { MybDiscussion as pe } from "../../components/MybDiscussion.js";
|
|
13
13
|
import "../../components/index.js";
|
|
14
|
-
import { motion as
|
|
15
|
-
import { useReducedMotion as
|
|
16
|
-
import { IconChip as
|
|
17
|
-
import { useMemo as l, useState as u } from "react";
|
|
18
|
-
import { AlertTriangle as
|
|
19
|
-
import { useParams as
|
|
20
|
-
import { Fragment as
|
|
21
|
-
import { Button as
|
|
14
|
+
import { motion as s } from "../../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
|
|
15
|
+
import { useReducedMotion as me } from "../../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js";
|
|
16
|
+
import { IconChip as c } from "../_shared/visuals.js";
|
|
17
|
+
import { useEffect as he, useMemo as l, useState as u } from "react";
|
|
18
|
+
import { AlertTriangle as ge, ArrowLeft as _e, CheckCircle2 as ve, ChevronLeft as ye, ChevronRight as be, Dumbbell as d, Flame as xe, Gauge as Se, ListChecks as Ce, Plus as f, Ruler as we, Timer as p, Trophy as Te, Weight as Ee, X as De } from "lucide-react";
|
|
19
|
+
import { useParams as Oe } from "react-router-dom";
|
|
20
|
+
import { Fragment as ke, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
21
|
+
import { Button as g, GlassCard as _, Input as v, Label as y, ResponsiveDialog as Ae, ResponsiveDialogContent as je, ResponsiveDialogDescription as Me, ResponsiveDialogFooter as Ne, ResponsiveDialogHeader as Pe, ResponsiveDialogTitle as Fe, Switch as Ie, Textarea as Le } from "@burdenoff/fe-libs/ui";
|
|
22
22
|
//#region src/mybodyshield/pages/train/SessionDetailPage.tsx
|
|
23
|
-
var
|
|
23
|
+
var Re = 90, ze = [];
|
|
24
|
+
function Be(e, t, n) {
|
|
25
|
+
return n ? e > n.weight || e === n.weight && t > n.reps : !1;
|
|
26
|
+
}
|
|
27
|
+
var b = [
|
|
24
28
|
.16,
|
|
25
29
|
1,
|
|
26
30
|
.3,
|
|
27
31
|
1
|
|
28
|
-
],
|
|
32
|
+
], Ve = {
|
|
29
33
|
hidden: {},
|
|
30
34
|
show: { transition: { staggerChildren: .06 } }
|
|
31
|
-
},
|
|
35
|
+
}, x = {
|
|
32
36
|
hidden: {
|
|
33
37
|
opacity: 0,
|
|
34
38
|
y: 12
|
|
@@ -38,17 +42,17 @@ var E = [
|
|
|
38
42
|
y: 0,
|
|
39
43
|
transition: {
|
|
40
44
|
duration: .35,
|
|
41
|
-
ease:
|
|
45
|
+
ease: b
|
|
42
46
|
}
|
|
43
47
|
}
|
|
44
48
|
};
|
|
45
|
-
function
|
|
49
|
+
function S(e) {
|
|
46
50
|
let t = e.trim();
|
|
47
51
|
if (!t) return;
|
|
48
52
|
let n = Number(t);
|
|
49
53
|
return Number.isFinite(n) ? n : void 0;
|
|
50
54
|
}
|
|
51
|
-
var
|
|
55
|
+
var C = {
|
|
52
56
|
exerciseName: "",
|
|
53
57
|
setNumber: "",
|
|
54
58
|
reps: "",
|
|
@@ -56,17 +60,17 @@ var A = {
|
|
|
56
60
|
distanceM: "",
|
|
57
61
|
durationSec: "",
|
|
58
62
|
isPersonalRecord: !1
|
|
59
|
-
},
|
|
63
|
+
}, He = {
|
|
60
64
|
caloriesBurned: "",
|
|
61
65
|
perceivedExertion: "",
|
|
62
66
|
notes: ""
|
|
63
67
|
};
|
|
64
|
-
function
|
|
65
|
-
let { navigateTo:
|
|
66
|
-
|
|
67
|
-
let
|
|
68
|
+
function w() {
|
|
69
|
+
let { navigateTo: w, workspaceId: Ue } = e(), T = me(), { id: E } = Oe();
|
|
70
|
+
fe();
|
|
71
|
+
let D = ue(E), O = le(), k = se(), We = de(D.data?.workoutId ?? void 0), [Ge, A] = u(!1), [j, M] = u(C), [Ke, N] = u(null), [qe, P] = u(!1), [Je, F] = u(!1), [I, L] = u(He), [Ye, R] = u(null), [Xe, z] = u(null), [Ze, Qe] = u(D.data?.workoutId), [B, V] = u(null), [$e, H] = u(0), U = ce(j.exerciseName), W = D.data, G = l(() => W?.sets ?? [], [W?.sets]), K = l(() => {
|
|
68
72
|
let e = /* @__PURE__ */ new Map();
|
|
69
|
-
for (let t of
|
|
73
|
+
for (let t of G) {
|
|
70
74
|
let n = e.get(t.exerciseName) ?? [];
|
|
71
75
|
n.push(t), e.set(t.exerciseName, n);
|
|
72
76
|
}
|
|
@@ -74,55 +78,81 @@ function M() {
|
|
|
74
78
|
name: e,
|
|
75
79
|
sets: t.slice().sort((e, t) => e.setNumber - t.setNumber)
|
|
76
80
|
}));
|
|
77
|
-
}, [
|
|
78
|
-
if (!
|
|
79
|
-
let e = new Date(
|
|
81
|
+
}, [G]), et = l(() => G.reduce((e, t) => e + t.reps * t.weight, 0), [G]), q = W?.startedAt, tt = W?.completedAt, nt = l(() => {
|
|
82
|
+
if (!q || !tt) return;
|
|
83
|
+
let e = new Date(q).getTime(), t = new Date(tt).getTime();
|
|
80
84
|
if (!(!Number.isFinite(e) || !Number.isFinite(t) || t < e)) return (t - e) / 1e3;
|
|
81
|
-
}, [
|
|
82
|
-
|
|
85
|
+
}, [q, tt]), J = We.data ?? ze, Y = l(() => {
|
|
86
|
+
let e = /* @__PURE__ */ new Map();
|
|
87
|
+
for (let t of K) e.set(t.name, t.sets.length);
|
|
88
|
+
return e;
|
|
89
|
+
}, [K]), rt = l(() => {
|
|
90
|
+
if (J.length === 0) return 0;
|
|
91
|
+
let e = J.findIndex((e) => (Y.get(e.name) ?? 0) < Math.max(e.sets, 1));
|
|
92
|
+
return e === -1 ? J.length - 1 : e;
|
|
93
|
+
}, [J, Y]), X = Math.min(Xe ?? rt, Math.max(J.length - 1, 0)), Z = J[X], it = J.length > 0 && J.every((e) => (Y.get(e.name) ?? 0) >= Math.max(e.sets, 1));
|
|
94
|
+
D.data?.workoutId !== Ze && (Qe(D.data?.workoutId), z(null)), he(() => {
|
|
95
|
+
if (B == null) return;
|
|
96
|
+
let e = window.setInterval(() => {
|
|
97
|
+
let e = Math.max(0, Math.ceil((B - Date.now()) / 1e3));
|
|
98
|
+
H(e), e <= 0 && V(null);
|
|
99
|
+
}, 1e3);
|
|
100
|
+
return () => window.clearInterval(e);
|
|
101
|
+
}, [B]);
|
|
102
|
+
let at = S(j.weight) ?? 0, ot = S(j.reps) ?? 0, st = j.exerciseName.trim().length > 0 && Be(at, ot, U.data), ct = qe ? j.isPersonalRecord : st;
|
|
103
|
+
if (!E) return /* @__PURE__ */ m(t, {
|
|
83
104
|
title: "Workout session",
|
|
84
|
-
children: /* @__PURE__ */
|
|
105
|
+
children: /* @__PURE__ */ m(ae, {
|
|
85
106
|
message: "No session was specified.",
|
|
86
|
-
onRetry: () =>
|
|
107
|
+
onRetry: () => w("train")
|
|
87
108
|
})
|
|
88
109
|
});
|
|
89
|
-
if (
|
|
110
|
+
if (D.isLoading) return /* @__PURE__ */ m(t, {
|
|
90
111
|
title: "Workout session",
|
|
91
|
-
children: /* @__PURE__ */
|
|
112
|
+
children: /* @__PURE__ */ m(oe, { label: "Loading session…" })
|
|
92
113
|
});
|
|
93
|
-
if (
|
|
114
|
+
if (D.isError || !W) return /* @__PURE__ */ m(t, {
|
|
94
115
|
title: "Workout session",
|
|
95
|
-
children: /* @__PURE__ */
|
|
116
|
+
children: /* @__PURE__ */ m(ae, {
|
|
96
117
|
title: "Session not found",
|
|
97
118
|
message: "This workout session may have been removed, or you don't have access to it.",
|
|
98
|
-
onRetry: () =>
|
|
119
|
+
onRetry: () => D.refetch()
|
|
99
120
|
})
|
|
100
121
|
});
|
|
101
|
-
let Q =
|
|
102
|
-
|
|
122
|
+
let Q = W.status === "IN_PROGRESS", lt = W.completedAt ? `Completed ${a(W.completedAt)}` : W.startedAt ? `Started ${a(W.startedAt)}` : W.scheduledFor ? `Scheduled ${a(W.scheduledFor)}` : `Created ${a(W.createdAt)}`, $ = () => {
|
|
123
|
+
M(C), N(null), P(!1), A(!0);
|
|
124
|
+
}, ut = (e) => {
|
|
125
|
+
let t = Y.get(e.name) ?? 0;
|
|
126
|
+
M({
|
|
127
|
+
...C,
|
|
128
|
+
exerciseName: e.name,
|
|
129
|
+
setNumber: String(t + 1),
|
|
130
|
+
reps: e.reps > 0 ? String(e.reps) : "",
|
|
131
|
+
weight: e.targetWeight > 0 ? String(e.targetWeight) : ""
|
|
132
|
+
}), N(null), P(!1), A(!0);
|
|
103
133
|
};
|
|
104
|
-
return /* @__PURE__ */
|
|
134
|
+
return /* @__PURE__ */ h(t, {
|
|
105
135
|
title: "Workout session",
|
|
106
|
-
description:
|
|
107
|
-
actions: Q ? /* @__PURE__ */
|
|
136
|
+
description: lt,
|
|
137
|
+
actions: Q ? /* @__PURE__ */ h(ke, { children: [/* @__PURE__ */ h(g, {
|
|
108
138
|
variant: "outline",
|
|
109
139
|
onClick: $,
|
|
110
|
-
children: [/* @__PURE__ */
|
|
111
|
-
}), /* @__PURE__ */ g
|
|
140
|
+
children: [/* @__PURE__ */ m(f, { className: "h-4 w-4" }), " Log set"]
|
|
141
|
+
}), /* @__PURE__ */ h(g, {
|
|
112
142
|
onClick: () => {
|
|
113
|
-
|
|
143
|
+
L(He), R(null), F(!0);
|
|
114
144
|
},
|
|
115
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ m(ve, { className: "h-4 w-4" }), " Complete"]
|
|
116
146
|
})] }) : void 0,
|
|
117
147
|
children: [
|
|
118
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ h("button", {
|
|
119
149
|
type: "button",
|
|
120
|
-
onClick: () =>
|
|
150
|
+
onClick: () => w("train"),
|
|
121
151
|
className: "mb-4 inline-flex items-center gap-1.5 text-sm font-medium text-text-secondary hover:text-text-primary",
|
|
122
|
-
children: [/* @__PURE__ */
|
|
152
|
+
children: [/* @__PURE__ */ m(_e, { className: "h-4 w-4" }), " Back to sessions"]
|
|
123
153
|
}),
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
initial:
|
|
154
|
+
/* @__PURE__ */ m(s.div, {
|
|
155
|
+
initial: T ? !1 : {
|
|
126
156
|
opacity: 0,
|
|
127
157
|
y: 10
|
|
128
158
|
},
|
|
@@ -130,185 +160,320 @@ function M() {
|
|
|
130
160
|
opacity: 1,
|
|
131
161
|
y: 0
|
|
132
162
|
},
|
|
133
|
-
transition:
|
|
163
|
+
transition: T ? { duration: 0 } : {
|
|
134
164
|
duration: .35,
|
|
135
|
-
ease:
|
|
165
|
+
ease: b
|
|
136
166
|
},
|
|
137
|
-
children: /* @__PURE__ */
|
|
167
|
+
children: /* @__PURE__ */ h(_, {
|
|
138
168
|
treatment: "glass",
|
|
139
169
|
glow: Q,
|
|
140
170
|
className: "p-6",
|
|
141
171
|
children: [
|
|
142
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ m("div", {
|
|
143
173
|
className: "flex flex-wrap items-start justify-between gap-3",
|
|
144
|
-
children: /* @__PURE__ */
|
|
174
|
+
children: /* @__PURE__ */ h("div", {
|
|
145
175
|
className: "flex items-center gap-3",
|
|
146
|
-
children: [/* @__PURE__ */
|
|
147
|
-
icon:
|
|
176
|
+
children: [/* @__PURE__ */ m(c, {
|
|
177
|
+
icon: m(Q ? xe : d, { className: "h-5 w-5" }),
|
|
148
178
|
tint: Q ? "var(--color-accent-teal)" : "var(--color-accent-primary)"
|
|
149
|
-
}), /* @__PURE__ */
|
|
179
|
+
}), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
|
|
150
180
|
className: "flex items-center gap-2",
|
|
151
|
-
children: /* @__PURE__ */
|
|
152
|
-
}), /* @__PURE__ */
|
|
181
|
+
children: /* @__PURE__ */ m(re, { status: W.status })
|
|
182
|
+
}), /* @__PURE__ */ m("p", {
|
|
153
183
|
className: "mt-1 text-sm text-text-secondary",
|
|
154
|
-
children:
|
|
184
|
+
children: lt
|
|
155
185
|
})] })]
|
|
156
186
|
})
|
|
157
187
|
}),
|
|
158
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ h("div", {
|
|
159
189
|
className: "mt-5 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
160
190
|
children: [
|
|
161
|
-
|
|
191
|
+
W.scheduledFor && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
|
|
162
192
|
className: "text-xs text-text-tertiary",
|
|
163
193
|
children: "Scheduled for"
|
|
164
|
-
}), /* @__PURE__ */
|
|
194
|
+
}), /* @__PURE__ */ m("p", {
|
|
165
195
|
className: "mt-0.5 text-sm font-medium text-text-primary",
|
|
166
|
-
children:
|
|
196
|
+
children: ee(W.scheduledFor)
|
|
167
197
|
})] }),
|
|
168
|
-
|
|
198
|
+
W.startedAt && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
|
|
169
199
|
className: "text-xs text-text-tertiary",
|
|
170
200
|
children: "Started"
|
|
171
|
-
}), /* @__PURE__ */
|
|
201
|
+
}), /* @__PURE__ */ m("p", {
|
|
172
202
|
className: "mt-0.5 text-sm font-medium text-text-primary",
|
|
173
|
-
children:
|
|
203
|
+
children: ee(W.startedAt)
|
|
174
204
|
})] }),
|
|
175
|
-
|
|
205
|
+
W.completedAt && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
|
|
176
206
|
className: "text-xs text-text-tertiary",
|
|
177
207
|
children: "Completed"
|
|
178
|
-
}), /* @__PURE__ */
|
|
208
|
+
}), /* @__PURE__ */ m("p", {
|
|
179
209
|
className: "mt-0.5 text-sm font-medium text-text-primary",
|
|
180
|
-
children:
|
|
210
|
+
children: ee(W.completedAt)
|
|
181
211
|
})] }),
|
|
182
|
-
|
|
212
|
+
W.perceivedExertion != null && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
|
|
183
213
|
className: "text-xs text-text-tertiary",
|
|
184
214
|
children: "Perceived exertion"
|
|
185
|
-
}), /* @__PURE__ */
|
|
215
|
+
}), /* @__PURE__ */ h("p", {
|
|
186
216
|
className: "mt-0.5 text-sm font-medium tabular-nums text-text-primary",
|
|
187
|
-
children: [
|
|
217
|
+
children: [W.perceivedExertion, "/10 RPE"]
|
|
188
218
|
})] }),
|
|
189
|
-
|
|
219
|
+
W.caloriesBurned > 0 && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
|
|
190
220
|
className: "text-xs text-text-tertiary",
|
|
191
221
|
children: "Calories burned"
|
|
192
|
-
}), /* @__PURE__ */
|
|
222
|
+
}), /* @__PURE__ */ m("p", {
|
|
193
223
|
className: "mt-0.5 text-sm font-medium tabular-nums text-text-primary",
|
|
194
|
-
children:
|
|
224
|
+
children: ne(W.caloriesBurned)
|
|
195
225
|
})] })
|
|
196
226
|
]
|
|
197
227
|
}),
|
|
198
|
-
|
|
228
|
+
W.notes && /* @__PURE__ */ h("div", {
|
|
199
229
|
className: "mt-5 rounded-xl bg-bg-sunken/60 p-4",
|
|
200
|
-
children: [/* @__PURE__ */
|
|
230
|
+
children: [/* @__PURE__ */ m("p", {
|
|
201
231
|
className: "text-xs text-text-tertiary",
|
|
202
232
|
children: "Notes"
|
|
203
|
-
}), /* @__PURE__ */
|
|
233
|
+
}), /* @__PURE__ */ m("p", {
|
|
204
234
|
className: "mt-1 whitespace-pre-wrap text-sm text-text-secondary",
|
|
205
|
-
children:
|
|
235
|
+
children: W.notes
|
|
206
236
|
})]
|
|
207
237
|
})
|
|
208
238
|
]
|
|
209
239
|
})
|
|
210
240
|
}),
|
|
211
|
-
/* @__PURE__ */
|
|
241
|
+
Q && $e > 0 && /* @__PURE__ */ m(s.div, {
|
|
242
|
+
initial: T ? !1 : {
|
|
243
|
+
opacity: 0,
|
|
244
|
+
y: -6
|
|
245
|
+
},
|
|
246
|
+
animate: {
|
|
247
|
+
opacity: 1,
|
|
248
|
+
y: 0
|
|
249
|
+
},
|
|
250
|
+
transition: T ? { duration: 0 } : {
|
|
251
|
+
duration: .25,
|
|
252
|
+
ease: b
|
|
253
|
+
},
|
|
254
|
+
className: "mt-4",
|
|
255
|
+
children: /* @__PURE__ */ h(_, {
|
|
256
|
+
treatment: "plain",
|
|
257
|
+
className: "flex flex-wrap items-center justify-between gap-3 border border-accent/30 bg-accent/5 p-4",
|
|
258
|
+
children: [/* @__PURE__ */ h("div", {
|
|
259
|
+
className: "flex items-center gap-2.5",
|
|
260
|
+
children: [/* @__PURE__ */ m(c, {
|
|
261
|
+
icon: /* @__PURE__ */ m(p, { className: "h-4 w-4" }),
|
|
262
|
+
tint: "var(--color-accent-teal)"
|
|
263
|
+
}), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
|
|
264
|
+
className: "text-sm font-semibold text-text-primary",
|
|
265
|
+
children: "Resting"
|
|
266
|
+
}), /* @__PURE__ */ h("p", {
|
|
267
|
+
className: "text-xs tabular-nums text-text-secondary",
|
|
268
|
+
children: [r($e), " remaining"]
|
|
269
|
+
})] })]
|
|
270
|
+
}), /* @__PURE__ */ h("div", {
|
|
271
|
+
className: "flex items-center gap-2",
|
|
272
|
+
children: [/* @__PURE__ */ m(g, {
|
|
273
|
+
variant: "outline",
|
|
274
|
+
size: "sm",
|
|
275
|
+
onClick: () => {
|
|
276
|
+
V((e) => e && e + 15e3), H((e) => e + 15);
|
|
277
|
+
},
|
|
278
|
+
children: "+15s"
|
|
279
|
+
}), /* @__PURE__ */ h(g, {
|
|
280
|
+
variant: "ghost",
|
|
281
|
+
size: "sm",
|
|
282
|
+
onClick: () => {
|
|
283
|
+
V(null), H(0);
|
|
284
|
+
},
|
|
285
|
+
children: [/* @__PURE__ */ m(De, { className: "h-4 w-4" }), " Skip"]
|
|
286
|
+
})]
|
|
287
|
+
})]
|
|
288
|
+
})
|
|
289
|
+
}),
|
|
290
|
+
Q && J.length > 0 && /* @__PURE__ */ m(s.div, {
|
|
291
|
+
initial: T ? !1 : {
|
|
292
|
+
opacity: 0,
|
|
293
|
+
y: 10
|
|
294
|
+
},
|
|
295
|
+
animate: {
|
|
296
|
+
opacity: 1,
|
|
297
|
+
y: 0
|
|
298
|
+
},
|
|
299
|
+
transition: T ? { duration: 0 } : {
|
|
300
|
+
duration: .35,
|
|
301
|
+
ease: b,
|
|
302
|
+
delay: .05
|
|
303
|
+
},
|
|
304
|
+
className: "mt-4",
|
|
305
|
+
children: /* @__PURE__ */ h(_, {
|
|
306
|
+
treatment: "plain",
|
|
307
|
+
className: "p-4",
|
|
308
|
+
children: [/* @__PURE__ */ h("div", {
|
|
309
|
+
className: "mb-3 flex items-center justify-between gap-2",
|
|
310
|
+
children: [/* @__PURE__ */ h("div", {
|
|
311
|
+
className: "flex items-center gap-2.5",
|
|
312
|
+
children: [/* @__PURE__ */ m(c, { icon: /* @__PURE__ */ m(Ce, { className: "h-4 w-4" }) }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h3", {
|
|
313
|
+
className: "text-sm font-semibold text-text-primary",
|
|
314
|
+
children: "Guided workout"
|
|
315
|
+
}), /* @__PURE__ */ m("p", {
|
|
316
|
+
className: "text-xs text-text-secondary",
|
|
317
|
+
children: it ? "All planned exercises logged — nice work." : `Exercise ${X + 1} of ${J.length}`
|
|
318
|
+
})] })]
|
|
319
|
+
}), /* @__PURE__ */ h("div", {
|
|
320
|
+
className: "flex items-center gap-1.5",
|
|
321
|
+
children: [/* @__PURE__ */ m(g, {
|
|
322
|
+
variant: "outline",
|
|
323
|
+
size: "sm",
|
|
324
|
+
onClick: () => z(Math.max(X - 1, 0)),
|
|
325
|
+
disabled: X === 0,
|
|
326
|
+
"aria-label": "Previous exercise",
|
|
327
|
+
children: /* @__PURE__ */ m(ye, { className: "h-4 w-4" })
|
|
328
|
+
}), /* @__PURE__ */ m(g, {
|
|
329
|
+
variant: "outline",
|
|
330
|
+
size: "sm",
|
|
331
|
+
onClick: () => z(Math.min(X + 1, J.length - 1)),
|
|
332
|
+
disabled: X >= J.length - 1,
|
|
333
|
+
"aria-label": "Next exercise",
|
|
334
|
+
children: /* @__PURE__ */ m(be, { className: "h-4 w-4" })
|
|
335
|
+
})]
|
|
336
|
+
})]
|
|
337
|
+
}), Z && /* @__PURE__ */ h("div", {
|
|
338
|
+
className: "flex flex-wrap items-center justify-between gap-3 rounded-xl bg-bg-sunken/60 p-3",
|
|
339
|
+
children: [/* @__PURE__ */ h("div", { children: [
|
|
340
|
+
/* @__PURE__ */ m("p", {
|
|
341
|
+
className: "text-sm font-semibold text-text-primary",
|
|
342
|
+
children: Z.name
|
|
343
|
+
}),
|
|
344
|
+
/* @__PURE__ */ h("p", {
|
|
345
|
+
className: "mt-0.5 text-xs text-text-secondary",
|
|
346
|
+
children: [
|
|
347
|
+
te(Z.muscleGroup),
|
|
348
|
+
" · ",
|
|
349
|
+
Z.sets,
|
|
350
|
+
" ×",
|
|
351
|
+
" ",
|
|
352
|
+
Z.reps,
|
|
353
|
+
" reps",
|
|
354
|
+
Z.targetWeight > 0 ? ` @ ${o(Z.targetWeight)}` : "",
|
|
355
|
+
Z.restSeconds > 0 ? ` · ${r(Z.restSeconds)} rest` : ""
|
|
356
|
+
]
|
|
357
|
+
}),
|
|
358
|
+
/* @__PURE__ */ h("p", {
|
|
359
|
+
className: "mt-0.5 text-xs tabular-nums text-text-tertiary",
|
|
360
|
+
children: [
|
|
361
|
+
Y.get(Z.name) ?? 0,
|
|
362
|
+
" of",
|
|
363
|
+
" ",
|
|
364
|
+
Math.max(Z.sets, 1),
|
|
365
|
+
" sets logged"
|
|
366
|
+
]
|
|
367
|
+
})
|
|
368
|
+
] }), /* @__PURE__ */ h(g, {
|
|
369
|
+
size: "sm",
|
|
370
|
+
onClick: () => ut(Z),
|
|
371
|
+
children: [/* @__PURE__ */ m(f, { className: "h-4 w-4" }), " Log this exercise"]
|
|
372
|
+
})]
|
|
373
|
+
})]
|
|
374
|
+
})
|
|
375
|
+
}),
|
|
376
|
+
/* @__PURE__ */ h(s.div, {
|
|
212
377
|
className: "mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
213
|
-
variants:
|
|
214
|
-
initial:
|
|
378
|
+
variants: T ? void 0 : Ve,
|
|
379
|
+
initial: T ? !1 : "hidden",
|
|
215
380
|
animate: "show",
|
|
216
381
|
children: [
|
|
217
|
-
/* @__PURE__ */
|
|
218
|
-
variants:
|
|
219
|
-
children: /* @__PURE__ */
|
|
220
|
-
icon: /* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ m(s.div, {
|
|
383
|
+
variants: T ? void 0 : x,
|
|
384
|
+
children: /* @__PURE__ */ m(n, {
|
|
385
|
+
icon: /* @__PURE__ */ m("span", {
|
|
221
386
|
className: "text-action-primary-bg",
|
|
222
|
-
children: /* @__PURE__ */
|
|
387
|
+
children: /* @__PURE__ */ m(d, { className: "h-5 w-5" })
|
|
223
388
|
}),
|
|
224
|
-
value:
|
|
389
|
+
value: i(G.length),
|
|
225
390
|
label: "Total sets"
|
|
226
391
|
})
|
|
227
392
|
}),
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
variants:
|
|
230
|
-
children: /* @__PURE__ */
|
|
231
|
-
icon: /* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ m(s.div, {
|
|
394
|
+
variants: T ? void 0 : x,
|
|
395
|
+
children: /* @__PURE__ */ m(n, {
|
|
396
|
+
icon: /* @__PURE__ */ m("span", {
|
|
232
397
|
className: "text-action-primary-bg",
|
|
233
|
-
children: /* @__PURE__ */
|
|
398
|
+
children: /* @__PURE__ */ m(Ee, { className: "h-5 w-5" })
|
|
234
399
|
}),
|
|
235
|
-
value: `${
|
|
400
|
+
value: `${i(et)} kg`,
|
|
236
401
|
label: "Total volume"
|
|
237
402
|
})
|
|
238
403
|
}),
|
|
239
|
-
/* @__PURE__ */
|
|
240
|
-
variants:
|
|
241
|
-
children: /* @__PURE__ */
|
|
242
|
-
icon: /* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ m(s.div, {
|
|
405
|
+
variants: T ? void 0 : x,
|
|
406
|
+
children: /* @__PURE__ */ m(n, {
|
|
407
|
+
icon: /* @__PURE__ */ m("span", {
|
|
243
408
|
className: "text-action-primary-bg",
|
|
244
|
-
children: /* @__PURE__ */
|
|
409
|
+
children: /* @__PURE__ */ m(p, { className: "h-5 w-5" })
|
|
245
410
|
}),
|
|
246
|
-
value:
|
|
411
|
+
value: nt == null ? "—" : r(nt),
|
|
247
412
|
label: "Duration"
|
|
248
413
|
})
|
|
249
414
|
}),
|
|
250
|
-
/* @__PURE__ */
|
|
251
|
-
variants:
|
|
252
|
-
children: /* @__PURE__ */
|
|
253
|
-
icon: /* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ m(s.div, {
|
|
416
|
+
variants: T ? void 0 : x,
|
|
417
|
+
children: /* @__PURE__ */ m(n, {
|
|
418
|
+
icon: /* @__PURE__ */ m("span", {
|
|
254
419
|
className: "text-action-primary-bg",
|
|
255
|
-
children: /* @__PURE__ */
|
|
420
|
+
children: /* @__PURE__ */ m(xe, { className: "h-5 w-5" })
|
|
256
421
|
}),
|
|
257
|
-
value:
|
|
422
|
+
value: W.caloriesBurned > 0 ? ne(W.caloriesBurned) : "—",
|
|
258
423
|
label: "Calories burned"
|
|
259
424
|
})
|
|
260
425
|
})
|
|
261
426
|
]
|
|
262
427
|
}),
|
|
263
|
-
/* @__PURE__ */
|
|
428
|
+
/* @__PURE__ */ h("div", {
|
|
264
429
|
className: "mt-8",
|
|
265
|
-
children: [/* @__PURE__ */
|
|
430
|
+
children: [/* @__PURE__ */ h("div", {
|
|
266
431
|
className: "mb-3 flex items-end justify-between gap-3",
|
|
267
|
-
children: [/* @__PURE__ */
|
|
432
|
+
children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h2", {
|
|
268
433
|
className: "text-base font-semibold text-text-primary",
|
|
269
434
|
children: "Logged sets"
|
|
270
|
-
}), /* @__PURE__ */
|
|
435
|
+
}), /* @__PURE__ */ m("p", {
|
|
271
436
|
className: "mt-0.5 text-sm text-text-secondary",
|
|
272
437
|
children: "Every set recorded during this session, grouped by exercise."
|
|
273
|
-
})] }), Q && /* @__PURE__ */ g
|
|
438
|
+
})] }), Q && /* @__PURE__ */ h(g, {
|
|
274
439
|
variant: "outline",
|
|
275
440
|
size: "sm",
|
|
276
441
|
onClick: $,
|
|
277
442
|
className: "shrink-0",
|
|
278
|
-
children: [/* @__PURE__ */
|
|
443
|
+
children: [/* @__PURE__ */ m(f, { className: "h-4 w-4" }), " Log set"]
|
|
279
444
|
})]
|
|
280
|
-
}),
|
|
445
|
+
}), K.length === 0 ? /* @__PURE__ */ m(ie, {
|
|
281
446
|
illustration: "empty-data",
|
|
282
|
-
icon: /* @__PURE__ */
|
|
447
|
+
icon: /* @__PURE__ */ m(d, { className: "h-10 w-10" }),
|
|
283
448
|
title: "No sets logged yet",
|
|
284
449
|
description: Q ? "Log your first set to start tracking this workout." : "No sets were recorded for this session.",
|
|
285
|
-
action: Q ? /* @__PURE__ */ g
|
|
450
|
+
action: Q ? /* @__PURE__ */ h(g, {
|
|
286
451
|
onClick: $,
|
|
287
|
-
children: [/* @__PURE__ */
|
|
452
|
+
children: [/* @__PURE__ */ m(f, { className: "h-4 w-4" }), " Log set"]
|
|
288
453
|
}) : void 0
|
|
289
|
-
}) : /* @__PURE__ */
|
|
454
|
+
}) : /* @__PURE__ */ m(s.div, {
|
|
290
455
|
className: "space-y-4",
|
|
291
|
-
variants:
|
|
292
|
-
initial:
|
|
456
|
+
variants: T ? void 0 : Ve,
|
|
457
|
+
initial: T ? !1 : "hidden",
|
|
293
458
|
animate: "show",
|
|
294
|
-
children:
|
|
459
|
+
children: K.map((e) => {
|
|
295
460
|
let t = e.sets.filter((e) => e.isPersonalRecord).length;
|
|
296
|
-
return /* @__PURE__ */
|
|
297
|
-
variants:
|
|
298
|
-
children: /* @__PURE__ */
|
|
461
|
+
return /* @__PURE__ */ m(s.div, {
|
|
462
|
+
variants: T ? void 0 : x,
|
|
463
|
+
children: /* @__PURE__ */ h(_, {
|
|
299
464
|
treatment: "plain",
|
|
300
465
|
className: "p-4 transition-shadow hover:shadow-float",
|
|
301
|
-
children: [/* @__PURE__ */
|
|
466
|
+
children: [/* @__PURE__ */ h("div", {
|
|
302
467
|
className: "mb-3 flex items-center justify-between gap-2",
|
|
303
|
-
children: [/* @__PURE__ */
|
|
468
|
+
children: [/* @__PURE__ */ h("div", {
|
|
304
469
|
className: "flex min-w-0 items-center gap-2.5",
|
|
305
470
|
children: [
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
-
/* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ m(c, { icon: /* @__PURE__ */ m(d, { className: "h-4 w-4" }) }),
|
|
472
|
+
/* @__PURE__ */ m("h3", {
|
|
308
473
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
309
474
|
children: e.name
|
|
310
475
|
}),
|
|
311
|
-
t > 0 && /* @__PURE__ */
|
|
476
|
+
t > 0 && /* @__PURE__ */ h("span", {
|
|
312
477
|
className: "inline-flex items-center rounded-full bg-status-success-bg-subtle px-2 py-0.5 text-[11px] font-semibold text-status-success-text shadow-[0_0_0_3px_color-mix(in_oklab,var(--color-status-success-text)_14%,transparent)]",
|
|
313
478
|
children: [
|
|
314
479
|
t,
|
|
@@ -317,47 +482,47 @@ function M() {
|
|
|
317
482
|
]
|
|
318
483
|
})
|
|
319
484
|
]
|
|
320
|
-
}), /* @__PURE__ */
|
|
485
|
+
}), /* @__PURE__ */ h("span", {
|
|
321
486
|
className: "shrink-0 text-xs tabular-nums text-text-tertiary",
|
|
322
487
|
children: [
|
|
323
|
-
|
|
488
|
+
i(e.sets.length),
|
|
324
489
|
" ",
|
|
325
490
|
e.sets.length === 1 ? "set" : "sets"
|
|
326
491
|
]
|
|
327
492
|
})]
|
|
328
|
-
}), /* @__PURE__ */
|
|
493
|
+
}), /* @__PURE__ */ m("ul", {
|
|
329
494
|
className: "divide-y divide-border-seam",
|
|
330
495
|
children: e.sets.map((e) => {
|
|
331
496
|
let t = e.durationSec > 0 || e.distanceM > 0;
|
|
332
|
-
return /* @__PURE__ */
|
|
497
|
+
return /* @__PURE__ */ h("li", {
|
|
333
498
|
className: "flex flex-wrap items-center justify-between gap-2 rounded-lg px-2 py-2 transition-colors" + (e.isPersonalRecord ? " bg-[color-mix(in_oklab,var(--color-status-success-text)_9%,transparent)]" : " hover:bg-bg-sunken/40"),
|
|
334
|
-
children: [/* @__PURE__ */
|
|
499
|
+
children: [/* @__PURE__ */ h("div", {
|
|
335
500
|
className: "flex items-center gap-2",
|
|
336
|
-
children: [/* @__PURE__ */
|
|
501
|
+
children: [/* @__PURE__ */ h("span", {
|
|
337
502
|
className: "text-sm font-medium text-text-primary tabular-nums",
|
|
338
503
|
children: [
|
|
339
504
|
"Set ",
|
|
340
505
|
e.setNumber,
|
|
341
506
|
": ",
|
|
342
|
-
|
|
507
|
+
i(e.reps),
|
|
343
508
|
" ×",
|
|
344
509
|
" ",
|
|
345
|
-
|
|
510
|
+
o(e.weight)
|
|
346
511
|
]
|
|
347
|
-
}), e.isPersonalRecord && /* @__PURE__ */
|
|
512
|
+
}), e.isPersonalRecord && /* @__PURE__ */ m("span", {
|
|
348
513
|
className: "inline-flex rounded-full shadow-[0_0_0_3px_color-mix(in_oklab,var(--color-status-success-text)_16%,transparent)]",
|
|
349
|
-
children: /* @__PURE__ */
|
|
514
|
+
children: /* @__PURE__ */ m(re, { status: "PR" })
|
|
350
515
|
})]
|
|
351
|
-
}), /* @__PURE__ */
|
|
516
|
+
}), /* @__PURE__ */ h("div", {
|
|
352
517
|
className: "flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-text-secondary",
|
|
353
|
-
children: [t && e.durationSec > 0 && /* @__PURE__ */
|
|
518
|
+
children: [t && e.durationSec > 0 && /* @__PURE__ */ h("span", {
|
|
354
519
|
className: "inline-flex items-center gap-1 tabular-nums",
|
|
355
|
-
children: [/* @__PURE__ */
|
|
356
|
-
}), t && e.distanceM > 0 && /* @__PURE__ */
|
|
520
|
+
children: [/* @__PURE__ */ m(p, { className: "h-3.5 w-3.5 text-accent" }), r(e.durationSec)]
|
|
521
|
+
}), t && e.distanceM > 0 && /* @__PURE__ */ h("span", {
|
|
357
522
|
className: "inline-flex items-center gap-1 tabular-nums",
|
|
358
523
|
children: [
|
|
359
|
-
/* @__PURE__ */
|
|
360
|
-
|
|
524
|
+
/* @__PURE__ */ m(we, { className: "h-3.5 w-3.5 text-accent" }),
|
|
525
|
+
i(e.distanceM),
|
|
361
526
|
" m"
|
|
362
527
|
]
|
|
363
528
|
})]
|
|
@@ -370,126 +535,129 @@ function M() {
|
|
|
370
535
|
})
|
|
371
536
|
})]
|
|
372
537
|
}),
|
|
373
|
-
/* @__PURE__ */
|
|
538
|
+
/* @__PURE__ */ m("div", {
|
|
374
539
|
className: "mt-8",
|
|
375
|
-
children: /* @__PURE__ */
|
|
540
|
+
children: /* @__PURE__ */ m(pe, {
|
|
376
541
|
entityType: "mybodyshield-session",
|
|
377
|
-
entityId:
|
|
542
|
+
entityId: W.id,
|
|
378
543
|
title: "Coach feedback",
|
|
379
544
|
description: "Discuss form, cues and this session's results with your coach and team."
|
|
380
545
|
})
|
|
381
546
|
}),
|
|
382
|
-
/* @__PURE__ */
|
|
383
|
-
open:
|
|
384
|
-
onOpenChange:
|
|
385
|
-
children: /* @__PURE__ */
|
|
386
|
-
/* @__PURE__ */
|
|
387
|
-
/* @__PURE__ */
|
|
547
|
+
/* @__PURE__ */ m(Ae, {
|
|
548
|
+
open: Ge,
|
|
549
|
+
onOpenChange: A,
|
|
550
|
+
children: /* @__PURE__ */ h(je, { children: [
|
|
551
|
+
/* @__PURE__ */ h(Pe, { children: [/* @__PURE__ */ m(Fe, { children: "Log a set" }), /* @__PURE__ */ m(Me, { children: "Record reps and load for strength work, or duration and distance for cardio. The dialog stays open so you can log sets back-to-back." })] }),
|
|
552
|
+
/* @__PURE__ */ h("div", {
|
|
388
553
|
className: "space-y-4 px-1",
|
|
389
554
|
children: [
|
|
390
|
-
/* @__PURE__ */
|
|
555
|
+
/* @__PURE__ */ h("div", {
|
|
391
556
|
className: "space-y-1.5",
|
|
392
|
-
children: [/* @__PURE__ */
|
|
557
|
+
children: [/* @__PURE__ */ m(y, {
|
|
393
558
|
htmlFor: "myb-set-exercise",
|
|
394
559
|
children: "Exercise"
|
|
395
|
-
}), /* @__PURE__ */
|
|
560
|
+
}), /* @__PURE__ */ m(v, {
|
|
396
561
|
id: "myb-set-exercise",
|
|
397
|
-
value:
|
|
398
|
-
onChange: (e) =>
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
562
|
+
value: j.exerciseName,
|
|
563
|
+
onChange: (e) => {
|
|
564
|
+
let t = e.target.value;
|
|
565
|
+
M((e) => ({
|
|
566
|
+
...e,
|
|
567
|
+
exerciseName: t
|
|
568
|
+
})), P(!1);
|
|
569
|
+
},
|
|
402
570
|
placeholder: "e.g. Back Squat"
|
|
403
571
|
})]
|
|
404
572
|
}),
|
|
405
|
-
/* @__PURE__ */
|
|
573
|
+
/* @__PURE__ */ h("div", {
|
|
406
574
|
className: "grid grid-cols-2 gap-3",
|
|
407
575
|
children: [
|
|
408
|
-
/* @__PURE__ */
|
|
576
|
+
/* @__PURE__ */ h("div", {
|
|
409
577
|
className: "space-y-1.5",
|
|
410
|
-
children: [/* @__PURE__ */
|
|
578
|
+
children: [/* @__PURE__ */ m(y, {
|
|
411
579
|
htmlFor: "myb-set-number",
|
|
412
580
|
children: "Set number"
|
|
413
|
-
}), /* @__PURE__ */
|
|
581
|
+
}), /* @__PURE__ */ m(v, {
|
|
414
582
|
id: "myb-set-number",
|
|
415
583
|
type: "number",
|
|
416
584
|
inputMode: "numeric",
|
|
417
585
|
min: 1,
|
|
418
|
-
value:
|
|
419
|
-
onChange: (e) =>
|
|
586
|
+
value: j.setNumber,
|
|
587
|
+
onChange: (e) => M((t) => ({
|
|
420
588
|
...t,
|
|
421
589
|
setNumber: e.target.value
|
|
422
590
|
})),
|
|
423
591
|
placeholder: "1"
|
|
424
592
|
})]
|
|
425
593
|
}),
|
|
426
|
-
/* @__PURE__ */
|
|
594
|
+
/* @__PURE__ */ h("div", {
|
|
427
595
|
className: "space-y-1.5",
|
|
428
|
-
children: [/* @__PURE__ */
|
|
596
|
+
children: [/* @__PURE__ */ m(y, {
|
|
429
597
|
htmlFor: "myb-set-reps",
|
|
430
598
|
children: "Reps"
|
|
431
|
-
}), /* @__PURE__ */
|
|
599
|
+
}), /* @__PURE__ */ m(v, {
|
|
432
600
|
id: "myb-set-reps",
|
|
433
601
|
type: "number",
|
|
434
602
|
inputMode: "numeric",
|
|
435
603
|
min: 0,
|
|
436
|
-
value:
|
|
437
|
-
onChange: (e) =>
|
|
604
|
+
value: j.reps,
|
|
605
|
+
onChange: (e) => M((t) => ({
|
|
438
606
|
...t,
|
|
439
607
|
reps: e.target.value
|
|
440
608
|
})),
|
|
441
609
|
placeholder: "8"
|
|
442
610
|
})]
|
|
443
611
|
}),
|
|
444
|
-
/* @__PURE__ */
|
|
612
|
+
/* @__PURE__ */ h("div", {
|
|
445
613
|
className: "space-y-1.5",
|
|
446
|
-
children: [/* @__PURE__ */
|
|
614
|
+
children: [/* @__PURE__ */ m(y, {
|
|
447
615
|
htmlFor: "myb-set-weight",
|
|
448
616
|
children: "Weight (kg)"
|
|
449
|
-
}), /* @__PURE__ */
|
|
617
|
+
}), /* @__PURE__ */ m(v, {
|
|
450
618
|
id: "myb-set-weight",
|
|
451
619
|
type: "number",
|
|
452
620
|
inputMode: "decimal",
|
|
453
621
|
min: 0,
|
|
454
622
|
step: "0.5",
|
|
455
|
-
value:
|
|
456
|
-
onChange: (e) =>
|
|
623
|
+
value: j.weight,
|
|
624
|
+
onChange: (e) => M((t) => ({
|
|
457
625
|
...t,
|
|
458
626
|
weight: e.target.value
|
|
459
627
|
})),
|
|
460
628
|
placeholder: "60"
|
|
461
629
|
})]
|
|
462
630
|
}),
|
|
463
|
-
/* @__PURE__ */
|
|
631
|
+
/* @__PURE__ */ h("div", {
|
|
464
632
|
className: "space-y-1.5",
|
|
465
|
-
children: [/* @__PURE__ */
|
|
633
|
+
children: [/* @__PURE__ */ m(y, {
|
|
466
634
|
htmlFor: "myb-set-distance",
|
|
467
635
|
children: "Distance (m)"
|
|
468
|
-
}), /* @__PURE__ */
|
|
636
|
+
}), /* @__PURE__ */ m(v, {
|
|
469
637
|
id: "myb-set-distance",
|
|
470
638
|
type: "number",
|
|
471
639
|
inputMode: "numeric",
|
|
472
640
|
min: 0,
|
|
473
|
-
value:
|
|
474
|
-
onChange: (e) =>
|
|
641
|
+
value: j.distanceM,
|
|
642
|
+
onChange: (e) => M((t) => ({
|
|
475
643
|
...t,
|
|
476
644
|
distanceM: e.target.value
|
|
477
645
|
})),
|
|
478
646
|
placeholder: "Optional"
|
|
479
647
|
})]
|
|
480
648
|
}),
|
|
481
|
-
/* @__PURE__ */
|
|
649
|
+
/* @__PURE__ */ h("div", {
|
|
482
650
|
className: "space-y-1.5",
|
|
483
|
-
children: [/* @__PURE__ */
|
|
651
|
+
children: [/* @__PURE__ */ m(y, {
|
|
484
652
|
htmlFor: "myb-set-duration",
|
|
485
653
|
children: "Duration (sec)"
|
|
486
|
-
}), /* @__PURE__ */
|
|
654
|
+
}), /* @__PURE__ */ m(v, {
|
|
487
655
|
id: "myb-set-duration",
|
|
488
656
|
type: "number",
|
|
489
657
|
inputMode: "numeric",
|
|
490
658
|
min: 0,
|
|
491
|
-
value:
|
|
492
|
-
onChange: (e) =>
|
|
659
|
+
value: j.durationSec,
|
|
660
|
+
onChange: (e) => M((t) => ({
|
|
493
661
|
...t,
|
|
494
662
|
durationSec: e.target.value
|
|
495
663
|
})),
|
|
@@ -498,120 +666,124 @@ function M() {
|
|
|
498
666
|
})
|
|
499
667
|
]
|
|
500
668
|
}),
|
|
501
|
-
/* @__PURE__ */
|
|
669
|
+
/* @__PURE__ */ h("div", {
|
|
502
670
|
className: "flex items-center justify-between gap-3 rounded-xl bg-bg-sunken/60 p-3",
|
|
503
|
-
children: [/* @__PURE__ */
|
|
671
|
+
children: [/* @__PURE__ */ h("div", {
|
|
504
672
|
className: "flex items-center gap-2",
|
|
505
|
-
children: [/* @__PURE__ */ h(
|
|
673
|
+
children: [ct ? /* @__PURE__ */ m(Te, { className: "h-4 w-4 text-status-success-text" }) : /* @__PURE__ */ m(Se, { className: "h-4 w-4 text-accent" }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m(y, {
|
|
506
674
|
htmlFor: "myb-set-pr",
|
|
507
675
|
className: "cursor-pointer",
|
|
508
676
|
children: "Personal record"
|
|
509
|
-
}), /* @__PURE__ */
|
|
677
|
+
}), /* @__PURE__ */ m("p", {
|
|
510
678
|
className: "text-xs text-text-tertiary",
|
|
511
|
-
children: "Flag this set as a new PR."
|
|
679
|
+
children: U.data ? `Auto-detected against your best: ${i(U.data.reps)} × ${o(U.data.weight)}.` : j.exerciseName.trim() ? "First time logging this exercise — nothing to compare yet." : "Flag this set as a new PR."
|
|
512
680
|
})] })]
|
|
513
|
-
}), /* @__PURE__ */
|
|
681
|
+
}), /* @__PURE__ */ m(Ie, {
|
|
514
682
|
id: "myb-set-pr",
|
|
515
|
-
checked:
|
|
516
|
-
onCheckedChange: (e) =>
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
683
|
+
checked: ct,
|
|
684
|
+
onCheckedChange: (e) => {
|
|
685
|
+
P(!0), M((t) => ({
|
|
686
|
+
...t,
|
|
687
|
+
isPersonalRecord: e
|
|
688
|
+
}));
|
|
689
|
+
}
|
|
520
690
|
})]
|
|
521
691
|
}),
|
|
522
|
-
|
|
692
|
+
Ke && /* @__PURE__ */ m("p", {
|
|
523
693
|
className: "text-sm text-status-error-text",
|
|
524
|
-
children:
|
|
694
|
+
children: Ke
|
|
525
695
|
})
|
|
526
696
|
]
|
|
527
697
|
}),
|
|
528
|
-
/* @__PURE__ */
|
|
698
|
+
/* @__PURE__ */ h(Ne, { children: [/* @__PURE__ */ m(g, {
|
|
529
699
|
variant: "outline",
|
|
530
|
-
onClick: () =>
|
|
700
|
+
onClick: () => A(!1),
|
|
531
701
|
children: "Done"
|
|
532
|
-
}), /* @__PURE__ */
|
|
702
|
+
}), /* @__PURE__ */ m(g, {
|
|
533
703
|
onClick: async () => {
|
|
534
|
-
|
|
535
|
-
let e =
|
|
704
|
+
N(null);
|
|
705
|
+
let e = j.exerciseName.trim();
|
|
536
706
|
if (!e) {
|
|
537
|
-
|
|
707
|
+
N("Exercise name is required.");
|
|
538
708
|
return;
|
|
539
709
|
}
|
|
540
710
|
try {
|
|
541
|
-
let t = await
|
|
542
|
-
sessionId:
|
|
711
|
+
let t = await O.mutateAsync({
|
|
712
|
+
sessionId: E,
|
|
543
713
|
exerciseName: e,
|
|
544
|
-
setNumber:
|
|
545
|
-
reps:
|
|
546
|
-
weight:
|
|
547
|
-
distanceM:
|
|
548
|
-
durationSec:
|
|
549
|
-
isPersonalRecord:
|
|
714
|
+
setNumber: S(j.setNumber),
|
|
715
|
+
reps: S(j.reps),
|
|
716
|
+
weight: S(j.weight),
|
|
717
|
+
distanceM: S(j.distanceM),
|
|
718
|
+
durationSec: S(j.durationSec),
|
|
719
|
+
isPersonalRecord: ct
|
|
550
720
|
});
|
|
551
|
-
|
|
552
|
-
...
|
|
721
|
+
M({
|
|
722
|
+
...C,
|
|
553
723
|
exerciseName: e,
|
|
554
724
|
setNumber: String(t.setNumber + 1)
|
|
555
|
-
});
|
|
725
|
+
}), P(!1);
|
|
726
|
+
let n = Z && Z.name === e && Z.restSeconds > 0 ? Z.restSeconds : Re;
|
|
727
|
+
V(Date.now() + n * 1e3), H(n);
|
|
556
728
|
} catch (e) {
|
|
557
|
-
|
|
729
|
+
N(e instanceof Error ? e.message : "Failed to log the set.");
|
|
558
730
|
}
|
|
559
731
|
},
|
|
560
|
-
disabled:
|
|
561
|
-
children:
|
|
732
|
+
disabled: O.isPending,
|
|
733
|
+
children: O.isPending ? "Logging…" : "Log set"
|
|
562
734
|
})] })
|
|
563
735
|
] })
|
|
564
736
|
}),
|
|
565
|
-
/* @__PURE__ */
|
|
566
|
-
open:
|
|
567
|
-
onOpenChange:
|
|
568
|
-
children: /* @__PURE__ */
|
|
569
|
-
/* @__PURE__ */
|
|
570
|
-
/* @__PURE__ */
|
|
737
|
+
/* @__PURE__ */ m(Ae, {
|
|
738
|
+
open: Je,
|
|
739
|
+
onOpenChange: F,
|
|
740
|
+
children: /* @__PURE__ */ h(je, { children: [
|
|
741
|
+
/* @__PURE__ */ h(Pe, { children: [/* @__PURE__ */ m(Fe, { children: "Complete session" }), /* @__PURE__ */ m(Me, { children: "Wrap up this workout and record how it went." })] }),
|
|
742
|
+
/* @__PURE__ */ h("div", {
|
|
571
743
|
className: "space-y-4 px-1",
|
|
572
744
|
children: [
|
|
573
|
-
|
|
745
|
+
G.length === 0 && /* @__PURE__ */ h("div", {
|
|
574
746
|
className: "flex items-start gap-2.5 rounded-xl border border-status-warning-text/40 bg-status-warning-bg-subtle p-3",
|
|
575
|
-
children: [/* @__PURE__ */
|
|
747
|
+
children: [/* @__PURE__ */ m(ge, { className: "mt-0.5 h-4 w-4 shrink-0 text-status-warning-text" }), /* @__PURE__ */ h("p", {
|
|
576
748
|
className: "text-sm text-text-secondary",
|
|
577
|
-
children: [/* @__PURE__ */
|
|
749
|
+
children: [/* @__PURE__ */ m("span", {
|
|
578
750
|
className: "font-medium text-text-primary",
|
|
579
751
|
children: "No sets logged."
|
|
580
752
|
}), " You can still complete this session, but nothing was recorded for it."]
|
|
581
753
|
})]
|
|
582
754
|
}),
|
|
583
|
-
/* @__PURE__ */
|
|
755
|
+
/* @__PURE__ */ h("div", {
|
|
584
756
|
className: "grid grid-cols-2 gap-3",
|
|
585
|
-
children: [/* @__PURE__ */
|
|
757
|
+
children: [/* @__PURE__ */ h("div", {
|
|
586
758
|
className: "space-y-1.5",
|
|
587
|
-
children: [/* @__PURE__ */
|
|
759
|
+
children: [/* @__PURE__ */ m(y, {
|
|
588
760
|
htmlFor: "myb-complete-calories",
|
|
589
761
|
children: "Calories burned"
|
|
590
|
-
}), /* @__PURE__ */
|
|
762
|
+
}), /* @__PURE__ */ m(v, {
|
|
591
763
|
id: "myb-complete-calories",
|
|
592
764
|
type: "number",
|
|
593
765
|
inputMode: "numeric",
|
|
594
766
|
min: 0,
|
|
595
|
-
value:
|
|
596
|
-
onChange: (e) =>
|
|
767
|
+
value: I.caloriesBurned,
|
|
768
|
+
onChange: (e) => L((t) => ({
|
|
597
769
|
...t,
|
|
598
770
|
caloriesBurned: e.target.value
|
|
599
771
|
})),
|
|
600
772
|
placeholder: "Optional"
|
|
601
773
|
})]
|
|
602
|
-
}), /* @__PURE__ */
|
|
774
|
+
}), /* @__PURE__ */ h("div", {
|
|
603
775
|
className: "space-y-1.5",
|
|
604
|
-
children: [/* @__PURE__ */
|
|
776
|
+
children: [/* @__PURE__ */ m(y, {
|
|
605
777
|
htmlFor: "myb-complete-rpe",
|
|
606
778
|
children: "Perceived exertion (1–10)"
|
|
607
|
-
}), /* @__PURE__ */
|
|
779
|
+
}), /* @__PURE__ */ m(v, {
|
|
608
780
|
id: "myb-complete-rpe",
|
|
609
781
|
type: "number",
|
|
610
782
|
inputMode: "numeric",
|
|
611
783
|
min: 1,
|
|
612
784
|
max: 10,
|
|
613
|
-
value:
|
|
614
|
-
onChange: (e) =>
|
|
785
|
+
value: I.perceivedExertion,
|
|
786
|
+
onChange: (e) => L((t) => ({
|
|
615
787
|
...t,
|
|
616
788
|
perceivedExertion: e.target.value
|
|
617
789
|
})),
|
|
@@ -619,50 +791,50 @@ function M() {
|
|
|
619
791
|
})]
|
|
620
792
|
})]
|
|
621
793
|
}),
|
|
622
|
-
/* @__PURE__ */
|
|
794
|
+
/* @__PURE__ */ h("div", {
|
|
623
795
|
className: "space-y-1.5",
|
|
624
|
-
children: [/* @__PURE__ */
|
|
796
|
+
children: [/* @__PURE__ */ m(y, {
|
|
625
797
|
htmlFor: "myb-complete-notes",
|
|
626
798
|
children: "Notes"
|
|
627
|
-
}), /* @__PURE__ */
|
|
799
|
+
}), /* @__PURE__ */ m(Le, {
|
|
628
800
|
id: "myb-complete-notes",
|
|
629
801
|
rows: 3,
|
|
630
|
-
value:
|
|
631
|
-
onChange: (e) =>
|
|
802
|
+
value: I.notes,
|
|
803
|
+
onChange: (e) => L((t) => ({
|
|
632
804
|
...t,
|
|
633
805
|
notes: e.target.value
|
|
634
806
|
})),
|
|
635
807
|
placeholder: "How did the session feel?"
|
|
636
808
|
})]
|
|
637
809
|
}),
|
|
638
|
-
|
|
810
|
+
Ye && /* @__PURE__ */ m("p", {
|
|
639
811
|
className: "text-sm text-status-error-text",
|
|
640
|
-
children:
|
|
812
|
+
children: Ye
|
|
641
813
|
})
|
|
642
814
|
]
|
|
643
815
|
}),
|
|
644
|
-
/* @__PURE__ */
|
|
816
|
+
/* @__PURE__ */ h(Ne, { children: [/* @__PURE__ */ m(g, {
|
|
645
817
|
variant: "outline",
|
|
646
|
-
onClick: () =>
|
|
818
|
+
onClick: () => F(!1),
|
|
647
819
|
children: "Cancel"
|
|
648
|
-
}), /* @__PURE__ */
|
|
820
|
+
}), /* @__PURE__ */ m(g, {
|
|
649
821
|
onClick: async () => {
|
|
650
|
-
|
|
822
|
+
R(null);
|
|
651
823
|
try {
|
|
652
|
-
await
|
|
653
|
-
id:
|
|
824
|
+
await k.mutateAsync({
|
|
825
|
+
id: E,
|
|
654
826
|
input: {
|
|
655
|
-
caloriesBurned:
|
|
656
|
-
perceivedExertion:
|
|
657
|
-
notes:
|
|
827
|
+
caloriesBurned: S(I.caloriesBurned),
|
|
828
|
+
perceivedExertion: S(I.perceivedExertion),
|
|
829
|
+
notes: I.notes.trim() ? I.notes.trim() : void 0
|
|
658
830
|
}
|
|
659
|
-
}),
|
|
831
|
+
}), F(!1);
|
|
660
832
|
} catch (e) {
|
|
661
|
-
|
|
833
|
+
R(e instanceof Error ? e.message : "Failed to complete the session.");
|
|
662
834
|
}
|
|
663
835
|
},
|
|
664
|
-
disabled:
|
|
665
|
-
children:
|
|
836
|
+
disabled: k.isPending,
|
|
837
|
+
children: k.isPending ? "Completing…" : "Complete session"
|
|
666
838
|
})] })
|
|
667
839
|
] })
|
|
668
840
|
})
|
|
@@ -670,6 +842,6 @@ function M() {
|
|
|
670
842
|
});
|
|
671
843
|
}
|
|
672
844
|
//#endregion
|
|
673
|
-
export {
|
|
845
|
+
export { w as SessionDetailPage };
|
|
674
846
|
|
|
675
847
|
//# sourceMappingURL=SessionDetailPage.js.map
|