@burdenoff/microfe-mybodyshield 2026.720.3 → 2026.731.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/hooks/useMyBodyShieldApi.d.ts +28 -1
- package/dist/mybodyshield/hooks/useMyBodyShieldApi.d.ts.map +1 -1
- package/dist/mybodyshield/hooks/useMyBodyShieldApi.js +79 -40
- package/dist/mybodyshield/hooks/useMyBodyShieldApi.js.map +1 -1
- package/dist/mybodyshield/lib/offlineSessionQueue.d.ts +76 -0
- package/dist/mybodyshield/lib/offlineSessionQueue.d.ts.map +1 -0
- package/dist/mybodyshield/lib/offlineSessionQueue.js +77 -0
- package/dist/mybodyshield/lib/offlineSessionQueue.js.map +1 -0
- package/dist/mybodyshield/lib/useOfflineSessionSync.d.ts +30 -0
- package/dist/mybodyshield/lib/useOfflineSessionSync.d.ts.map +1 -0
- package/dist/mybodyshield/lib/useOfflineSessionSync.js +80 -0
- package/dist/mybodyshield/lib/useOfflineSessionSync.js.map +1 -0
- package/dist/mybodyshield/pages/DashboardPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/DashboardPage.js +247 -170
- package/dist/mybodyshield/pages/DashboardPage.js.map +1 -1
- package/dist/mybodyshield/pages/nutrition/NutritionPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/nutrition/NutritionPage.js +540 -441
- package/dist/mybodyshield/pages/nutrition/NutritionPage.js.map +1 -1
- package/dist/mybodyshield/pages/train/SessionDetailPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/train/SessionDetailPage.js +242 -173
- package/dist/mybodyshield/pages/train/SessionDetailPage.js.map +1 -1
- package/dist/mybodyshield/types/index.d.ts +46 -0
- package/dist/mybodyshield/types/index.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -4,27 +4,58 @@ import { MetricsCard as n } from "../components/MetricsCard.js";
|
|
|
4
4
|
import { formatEnumLabel as r, formatNumber as i, formatPercent as a, formatRelativeTime as o, formatWeight as s } from "../utils/formatters.js";
|
|
5
5
|
import { StatusBadge as c } from "../components/StatusBadge.js";
|
|
6
6
|
import { EmptyState as l } from "../components/EmptyState.js";
|
|
7
|
-
import { LoadingView as
|
|
8
|
-
import { MiniBar as
|
|
7
|
+
import { LoadingView as ee, Section as u } from "../components/StateViews.js";
|
|
8
|
+
import { MiniBar as d } from "../components/MiniBar.js";
|
|
9
9
|
import "../context/index.js";
|
|
10
|
-
import { useMybBodyMetrics as
|
|
10
|
+
import { useMybBodyMetrics as te, useMybDailyMacros as ne, useMybGoals as re, useMybPrograms as ie, useMybRecoveryLogs as ae, useMybSessions as f, useMybTodayGuidance as p } from "../hooks/useMyBodyShieldApi.js";
|
|
11
11
|
import "../hooks/index.js";
|
|
12
12
|
import { motion as m } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
|
|
13
|
-
import { useReducedMotion as
|
|
14
|
-
import { GOAL_TYPE_META as
|
|
15
|
-
import { useMemo as
|
|
16
|
-
import { ArrowRight as
|
|
17
|
-
import { jsx as
|
|
18
|
-
import { GlassCard as
|
|
13
|
+
import { useReducedMotion as oe } from "../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js";
|
|
14
|
+
import { GOAL_TYPE_META as se, IconChip as h, MacroBar as ce, MacroLegend as le, Meter as g, ProgressRing as ue, WORKOUT_TYPE_META as de, computeGoalProgress as _ } from "./_shared/visuals.js";
|
|
15
|
+
import { useMemo as fe } from "react";
|
|
16
|
+
import { ArrowRight as v, BedDouble as y, CalendarCheck as b, CheckCircle2 as x, Dumbbell as pe, Flame as S, Moon as C, Salad as w, Sparkles as me, Target as T, TrendingUp as E, Utensils as D, Weight as he } from "lucide-react";
|
|
17
|
+
import { jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
18
|
+
import { GlassCard as A } from "@burdenoff/fe-libs/ui";
|
|
19
19
|
//#region src/mybodyshield/pages/DashboardPage.tsx
|
|
20
|
-
var
|
|
20
|
+
var j = [
|
|
21
21
|
.16,
|
|
22
22
|
1,
|
|
23
23
|
.3,
|
|
24
24
|
1
|
|
25
|
-
]
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
], M = {
|
|
26
|
+
REST: {
|
|
27
|
+
icon: y,
|
|
28
|
+
textClass: "text-status-error-text",
|
|
29
|
+
bgClass: "bg-status-error-bg-subtle",
|
|
30
|
+
label: "Rest"
|
|
31
|
+
},
|
|
32
|
+
LIGHTEN_SESSION: {
|
|
33
|
+
icon: C,
|
|
34
|
+
textClass: "text-status-warning-text",
|
|
35
|
+
bgClass: "bg-status-warning-bg-subtle",
|
|
36
|
+
label: "Lighten session"
|
|
37
|
+
},
|
|
38
|
+
PROCEED_AS_PLANNED: {
|
|
39
|
+
icon: x,
|
|
40
|
+
textClass: "text-status-success-text",
|
|
41
|
+
bgClass: "bg-status-success-bg-subtle",
|
|
42
|
+
label: "Proceed as planned"
|
|
43
|
+
},
|
|
44
|
+
INCREASE_LOAD: {
|
|
45
|
+
icon: E,
|
|
46
|
+
textClass: "text-status-success-text",
|
|
47
|
+
bgClass: "bg-status-success-bg-subtle",
|
|
48
|
+
label: "Increase load"
|
|
49
|
+
},
|
|
50
|
+
REVIEW_NUTRITION: {
|
|
51
|
+
icon: D,
|
|
52
|
+
textClass: "text-status-warning-text",
|
|
53
|
+
bgClass: "bg-status-warning-bg-subtle",
|
|
54
|
+
label: "Review nutrition"
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
function N() {
|
|
58
|
+
let { navigateTo: y, currentUser: E } = e(), D = oe(), N = (e) => D ? {} : {
|
|
28
59
|
initial: {
|
|
29
60
|
opacity: 0,
|
|
30
61
|
y: 14
|
|
@@ -40,54 +71,54 @@ function j() {
|
|
|
40
71
|
transition: {
|
|
41
72
|
duration: .45,
|
|
42
73
|
delay: Math.min(e, 8) * .05,
|
|
43
|
-
ease:
|
|
74
|
+
ease: j
|
|
44
75
|
}
|
|
45
|
-
},
|
|
76
|
+
}, P = D ? {} : { whileHover: {
|
|
46
77
|
y: -3,
|
|
47
78
|
transition: {
|
|
48
79
|
duration: .2,
|
|
49
|
-
ease:
|
|
80
|
+
ease: j
|
|
50
81
|
}
|
|
51
|
-
} },
|
|
82
|
+
} }, F = D ? {} : {
|
|
52
83
|
whileHover: {
|
|
53
84
|
y: -3,
|
|
54
85
|
transition: {
|
|
55
86
|
duration: .2,
|
|
56
|
-
ease:
|
|
87
|
+
ease: j
|
|
57
88
|
}
|
|
58
89
|
},
|
|
59
90
|
whileTap: { scale: .985 }
|
|
60
|
-
},
|
|
91
|
+
}, I = ie({
|
|
61
92
|
status: "ACTIVE",
|
|
62
93
|
pagination: { limit: 50 }
|
|
63
|
-
}),
|
|
94
|
+
}), L = f({ pagination: { limit: 20 } }), R = re({
|
|
64
95
|
status: "ACTIVE",
|
|
65
96
|
pagination: { limit: 50 }
|
|
66
|
-
}),
|
|
97
|
+
}), z = ne(), ge = te({
|
|
67
98
|
type: "WEIGHT",
|
|
68
99
|
pagination: { limit: 30 }
|
|
69
|
-
}),
|
|
100
|
+
}), _e = ae("READINESS"), B = p(), ve = I.data?.items ?? [], V = L.data?.items ?? [], H = R.data?.items ?? [], U = ge.data?.items ?? [], ye = _e.data?.items ?? [], be = (/* @__PURE__ */ new Date()).getTime() - 10080 * 60 * 1e3, W = V.filter((e) => {
|
|
70
101
|
let t = e.completedAt ?? e.startedAt ?? e.scheduledFor ?? e.createdAt;
|
|
71
|
-
return t ? new Date(t).getTime() >=
|
|
72
|
-
}),
|
|
73
|
-
if (
|
|
102
|
+
return t ? new Date(t).getTime() >= be : !1;
|
|
103
|
+
}), G = W.filter((e) => e.status === "COMPLETED").length, K = V.find((e) => e.status === "IN_PROGRESS"), q = V.filter((e) => e.status === "SCHEDULED" && e.scheduledFor).sort((e, t) => new Date(e.scheduledFor).getTime() - new Date(t.scheduledFor).getTime())[0], J = U[0], Y = U[1], X = J && Y ? J.value - Y.value : void 0, Z = ye.slice().sort((e, t) => new Date(t.loggedAt).getTime() - new Date(e.loggedAt).getTime())[0], Q = fe(() => H.length === 0 ? 0 : H.reduce((e, t) => e + _(t), 0) / H.length, [H]), $ = z.data, xe = $?.calorieTarget ? $.calories / $.calorieTarget * 100 : 0;
|
|
104
|
+
if (I.isLoading && L.isLoading && R.isLoading && z.isLoading) return /* @__PURE__ */ O(t, {
|
|
74
105
|
title: "MyBodyShield",
|
|
75
106
|
titleGradient: !0,
|
|
76
107
|
aurora: !0,
|
|
77
|
-
children: /* @__PURE__ */
|
|
108
|
+
children: /* @__PURE__ */ O(ee, { label: "Loading your fitness overview…" })
|
|
78
109
|
});
|
|
79
|
-
let
|
|
110
|
+
let Se = E?.firstName || E?.name || "there", Ce = [
|
|
80
111
|
{
|
|
81
112
|
id: "programs",
|
|
82
|
-
node: /* @__PURE__ */
|
|
83
|
-
icon: /* @__PURE__ */
|
|
84
|
-
value: i(
|
|
113
|
+
node: /* @__PURE__ */ O(n, {
|
|
114
|
+
icon: /* @__PURE__ */ O(pe, { className: "h-5 w-5" }),
|
|
115
|
+
value: i(ve.length),
|
|
85
116
|
label: "Active programs",
|
|
86
|
-
footer: /* @__PURE__ */
|
|
117
|
+
footer: /* @__PURE__ */ O("p", {
|
|
87
118
|
className: "text-xs text-text-tertiary",
|
|
88
|
-
children: /* @__PURE__ */
|
|
119
|
+
children: /* @__PURE__ */ O("button", {
|
|
89
120
|
type: "button",
|
|
90
|
-
onClick: () =>
|
|
121
|
+
onClick: () => y("programs"),
|
|
91
122
|
className: "font-medium text-accent hover:underline",
|
|
92
123
|
children: "Manage programs"
|
|
93
124
|
})
|
|
@@ -96,22 +127,22 @@ function j() {
|
|
|
96
127
|
},
|
|
97
128
|
{
|
|
98
129
|
id: "sessions",
|
|
99
|
-
node: /* @__PURE__ */
|
|
100
|
-
icon: /* @__PURE__ */
|
|
101
|
-
value: i(
|
|
130
|
+
node: /* @__PURE__ */ O(n, {
|
|
131
|
+
icon: /* @__PURE__ */ O(S, { className: "h-5 w-5" }),
|
|
132
|
+
value: i(G),
|
|
102
133
|
label: "Sessions this week",
|
|
103
134
|
accent: K ? "warning" : void 0,
|
|
104
|
-
footer: K ? /* @__PURE__ */
|
|
135
|
+
footer: K ? /* @__PURE__ */ O("button", {
|
|
105
136
|
type: "button",
|
|
106
|
-
onClick: () =>
|
|
137
|
+
onClick: () => y(`train/${K.id}`),
|
|
107
138
|
className: "text-xs font-medium text-status-warning-text hover:underline",
|
|
108
139
|
children: "Resume live session →"
|
|
109
|
-
}) : /* @__PURE__ */
|
|
140
|
+
}) : /* @__PURE__ */ k("p", {
|
|
110
141
|
className: "text-xs text-text-tertiary",
|
|
111
142
|
children: [
|
|
112
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ O("span", {
|
|
113
144
|
className: "tabular-nums text-text-secondary",
|
|
114
|
-
children:
|
|
145
|
+
children: W.length
|
|
115
146
|
}),
|
|
116
147
|
" ",
|
|
117
148
|
"logged"
|
|
@@ -121,20 +152,20 @@ function j() {
|
|
|
121
152
|
},
|
|
122
153
|
{
|
|
123
154
|
id: "goals",
|
|
124
|
-
node: /* @__PURE__ */
|
|
125
|
-
icon: /* @__PURE__ */
|
|
126
|
-
value: i(
|
|
155
|
+
node: /* @__PURE__ */ O(n, {
|
|
156
|
+
icon: /* @__PURE__ */ O(T, { className: "h-5 w-5" }),
|
|
157
|
+
value: i(H.length),
|
|
127
158
|
label: "Active goals",
|
|
128
|
-
footer: /* @__PURE__ */
|
|
159
|
+
footer: /* @__PURE__ */ k("div", {
|
|
129
160
|
className: "space-y-2",
|
|
130
|
-
children: [/* @__PURE__ */
|
|
161
|
+
children: [/* @__PURE__ */ O(d, {
|
|
131
162
|
value: Q,
|
|
132
163
|
height: 4,
|
|
133
164
|
barClassName: "bg-action-primary-bg"
|
|
134
|
-
}), /* @__PURE__ */
|
|
165
|
+
}), /* @__PURE__ */ k("p", {
|
|
135
166
|
className: "text-xs text-text-tertiary",
|
|
136
167
|
children: [
|
|
137
|
-
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ O("span", {
|
|
138
169
|
className: "tabular-nums text-text-secondary",
|
|
139
170
|
children: a(Q)
|
|
140
171
|
}),
|
|
@@ -147,19 +178,19 @@ function j() {
|
|
|
147
178
|
},
|
|
148
179
|
{
|
|
149
180
|
id: "weight",
|
|
150
|
-
node: /* @__PURE__ */
|
|
151
|
-
icon: /* @__PURE__ */
|
|
181
|
+
node: /* @__PURE__ */ O(n, {
|
|
182
|
+
icon: /* @__PURE__ */ O(he, { className: "h-5 w-5" }),
|
|
152
183
|
value: J ? s(J.value) : "—",
|
|
153
184
|
label: "Latest weight",
|
|
154
|
-
footer: X == null ? /* @__PURE__ */
|
|
185
|
+
footer: X == null ? /* @__PURE__ */ O("button", {
|
|
155
186
|
type: "button",
|
|
156
|
-
onClick: () =>
|
|
187
|
+
onClick: () => y("progress"),
|
|
157
188
|
className: "text-xs font-medium text-accent hover:underline",
|
|
158
189
|
children: "Log a measurement →"
|
|
159
|
-
}) : /* @__PURE__ */
|
|
190
|
+
}) : /* @__PURE__ */ k("p", {
|
|
160
191
|
className: "text-xs text-text-tertiary",
|
|
161
192
|
children: [
|
|
162
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ k("span", {
|
|
163
194
|
className: X <= 0 ? "font-medium text-status-success-text" : "font-medium text-text-secondary",
|
|
164
195
|
children: [
|
|
165
196
|
X > 0 ? "+" : "",
|
|
@@ -175,92 +206,138 @@ function j() {
|
|
|
175
206
|
},
|
|
176
207
|
{
|
|
177
208
|
id: "recovery",
|
|
178
|
-
node: /* @__PURE__ */
|
|
179
|
-
icon: /* @__PURE__ */
|
|
209
|
+
node: /* @__PURE__ */ O(n, {
|
|
210
|
+
icon: /* @__PURE__ */ O(C, { className: "h-5 w-5" }),
|
|
180
211
|
value: Z ? `${Z.score}` : "—",
|
|
181
212
|
label: "Recovery readiness",
|
|
182
213
|
accent: Z ? Z.score >= 70 ? "success" : Z.score >= 40 ? "warning" : "error" : void 0,
|
|
183
|
-
footer: Z ? /* @__PURE__ */
|
|
214
|
+
footer: Z ? /* @__PURE__ */ O("p", {
|
|
184
215
|
className: "text-xs text-text-tertiary",
|
|
185
216
|
children: o(Z.loggedAt)
|
|
186
|
-
}) : /* @__PURE__ */
|
|
217
|
+
}) : /* @__PURE__ */ O("button", {
|
|
187
218
|
type: "button",
|
|
188
|
-
onClick: () =>
|
|
219
|
+
onClick: () => y("recovery"),
|
|
189
220
|
className: "text-xs font-medium text-accent hover:underline",
|
|
190
221
|
children: "Log recovery →"
|
|
191
222
|
})
|
|
192
223
|
})
|
|
193
224
|
}
|
|
194
225
|
];
|
|
195
|
-
return /* @__PURE__ */
|
|
226
|
+
return /* @__PURE__ */ k(t, {
|
|
196
227
|
title: "MyBodyShield",
|
|
197
228
|
titleGradient: !0,
|
|
198
229
|
aurora: !0,
|
|
199
|
-
description: `Welcome back, ${
|
|
230
|
+
description: `Welcome back, ${Se} — your training, nutrition, progress & recovery control room.`,
|
|
200
231
|
children: [
|
|
201
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ O("div", {
|
|
202
233
|
"data-tour": "mybodyshield-dashboard-kpi-grid",
|
|
203
234
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5",
|
|
204
|
-
children:
|
|
235
|
+
children: Ce.map((e, t) => /* @__PURE__ */ k(m.div, {
|
|
205
236
|
className: "group relative rounded-2xl transition-shadow duration-300 hover:shadow-float",
|
|
206
|
-
...
|
|
207
|
-
...
|
|
208
|
-
children: [/* @__PURE__ */
|
|
237
|
+
...N(t),
|
|
238
|
+
...P,
|
|
239
|
+
children: [/* @__PURE__ */ O("span", {
|
|
209
240
|
"aria-hidden": !0,
|
|
210
241
|
className: "pointer-events-none absolute inset-x-6 top-0 z-10 h-px rounded-full bg-gradient-to-r from-transparent via-action-primary-bg to-transparent opacity-40 transition-opacity duration-300 group-hover:opacity-90"
|
|
211
242
|
}), e.node]
|
|
212
243
|
}, e.id))
|
|
213
244
|
}),
|
|
214
|
-
/* @__PURE__ */ O(
|
|
245
|
+
!B.isLoading && (B.data?.cards.length ?? 0) > 0 && /* @__PURE__ */ O(m.div, {
|
|
246
|
+
className: "mt-6",
|
|
247
|
+
...N(0),
|
|
248
|
+
children: /* @__PURE__ */ k(A, {
|
|
249
|
+
treatment: "glass",
|
|
250
|
+
className: "p-6",
|
|
251
|
+
children: [
|
|
252
|
+
/* @__PURE__ */ k("div", {
|
|
253
|
+
className: "mb-4 flex items-center gap-2",
|
|
254
|
+
children: [/* @__PURE__ */ O(h, {
|
|
255
|
+
icon: /* @__PURE__ */ O(me, { className: "h-5 w-5" }),
|
|
256
|
+
tint: "var(--color-accent-primary)"
|
|
257
|
+
}), /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("h2", {
|
|
258
|
+
className: "text-base font-semibold text-text-primary",
|
|
259
|
+
children: "Today's guidance"
|
|
260
|
+
}), /* @__PURE__ */ O("p", {
|
|
261
|
+
className: "mt-0.5 text-sm text-text-secondary",
|
|
262
|
+
children: "Recovery-aware suggestions from your logged training & recovery data."
|
|
263
|
+
})] })]
|
|
264
|
+
}),
|
|
265
|
+
/* @__PURE__ */ O("div", {
|
|
266
|
+
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
|
|
267
|
+
children: B.data?.cards.map((e, t) => {
|
|
268
|
+
let n = M[e.action], r = n.icon;
|
|
269
|
+
return /* @__PURE__ */ k("div", {
|
|
270
|
+
className: `rounded-xl border border-seam ${n.bgClass} p-4`,
|
|
271
|
+
children: [/* @__PURE__ */ k("div", {
|
|
272
|
+
className: "mb-1.5 flex items-center gap-1.5",
|
|
273
|
+
children: [/* @__PURE__ */ O(r, { className: `h-4 w-4 shrink-0 ${n.textClass}` }), /* @__PURE__ */ O("span", {
|
|
274
|
+
className: `text-xs font-semibold uppercase tracking-wide ${n.textClass}`,
|
|
275
|
+
children: n.label
|
|
276
|
+
})]
|
|
277
|
+
}), /* @__PURE__ */ O("p", {
|
|
278
|
+
className: "text-sm text-text-secondary",
|
|
279
|
+
children: e.reason
|
|
280
|
+
})]
|
|
281
|
+
}, `${e.signal}-${t}`);
|
|
282
|
+
})
|
|
283
|
+
}),
|
|
284
|
+
B.data?.aiSummary && /* @__PURE__ */ O("p", {
|
|
285
|
+
className: "mt-4 rounded-lg bg-surface p-3 text-sm italic text-text-secondary",
|
|
286
|
+
children: B.data.aiSummary
|
|
287
|
+
})
|
|
288
|
+
]
|
|
289
|
+
})
|
|
290
|
+
}),
|
|
291
|
+
/* @__PURE__ */ k("div", {
|
|
215
292
|
className: "mt-6 grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
216
|
-
children: [/* @__PURE__ */
|
|
293
|
+
children: [/* @__PURE__ */ O(m.div, {
|
|
217
294
|
"data-tour": "mybodyshield-dashboard-nutrition",
|
|
218
295
|
className: "lg:col-span-2",
|
|
219
|
-
...
|
|
220
|
-
children: /* @__PURE__ */
|
|
296
|
+
...N(0),
|
|
297
|
+
children: /* @__PURE__ */ k(A, {
|
|
221
298
|
treatment: "glass",
|
|
222
299
|
className: "h-full p-6",
|
|
223
|
-
children: [/* @__PURE__ */
|
|
300
|
+
children: [/* @__PURE__ */ k("div", {
|
|
224
301
|
className: "mb-4 flex flex-wrap items-start justify-between gap-3",
|
|
225
|
-
children: [/* @__PURE__ */
|
|
302
|
+
children: [/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("h2", {
|
|
226
303
|
className: "text-base font-semibold text-text-primary",
|
|
227
304
|
children: "Today's nutrition"
|
|
228
|
-
}), /* @__PURE__ */
|
|
305
|
+
}), /* @__PURE__ */ O("p", {
|
|
229
306
|
className: "mt-0.5 text-sm text-text-secondary",
|
|
230
307
|
children: "Calories & macros logged against your active plan."
|
|
231
|
-
})] }), /* @__PURE__ */
|
|
308
|
+
})] }), /* @__PURE__ */ k("button", {
|
|
232
309
|
type: "button",
|
|
233
|
-
onClick: () =>
|
|
310
|
+
onClick: () => y("nutrition"),
|
|
234
311
|
className: "inline-flex items-center gap-1 text-sm font-medium text-accent hover:underline",
|
|
235
|
-
children: ["Nutrition ", /* @__PURE__ */
|
|
312
|
+
children: ["Nutrition ", /* @__PURE__ */ O(v, { className: "h-4 w-4" })]
|
|
236
313
|
})]
|
|
237
|
-
}), !$ || $.calorieTarget === 0 && $.calories === 0 ? /* @__PURE__ */
|
|
314
|
+
}), !$ || $.calorieTarget === 0 && $.calories === 0 ? /* @__PURE__ */ O(l, {
|
|
238
315
|
illustration: "empty-data",
|
|
239
|
-
icon: /* @__PURE__ */
|
|
316
|
+
icon: /* @__PURE__ */ O(w, { className: "h-10 w-10" }),
|
|
240
317
|
title: "No nutrition data yet",
|
|
241
318
|
description: "Activate a nutrition plan and log meals to track your daily macros here."
|
|
242
|
-
}) : /* @__PURE__ */
|
|
319
|
+
}) : /* @__PURE__ */ k("div", {
|
|
243
320
|
className: "flex flex-col gap-8 sm:flex-row sm:items-center",
|
|
244
|
-
children: [/* @__PURE__ */
|
|
321
|
+
children: [/* @__PURE__ */ k("div", {
|
|
245
322
|
className: "relative mx-auto flex shrink-0 items-center justify-center sm:mx-0",
|
|
246
|
-
children: [/* @__PURE__ */
|
|
323
|
+
children: [/* @__PURE__ */ O("span", {
|
|
247
324
|
"aria-hidden": !0,
|
|
248
325
|
className: "pointer-events-none absolute inset-2 rounded-full opacity-70 blur-2xl",
|
|
249
326
|
style: { background: "radial-gradient(circle, color-mix(in srgb, var(--color-action-primary-bg) 26%, transparent), transparent 70%)" }
|
|
250
|
-
}), /* @__PURE__ */
|
|
251
|
-
value:
|
|
327
|
+
}), /* @__PURE__ */ k(ue, {
|
|
328
|
+
value: xe,
|
|
252
329
|
size: 188,
|
|
253
330
|
stroke: 16,
|
|
254
331
|
children: [
|
|
255
|
-
/* @__PURE__ */
|
|
332
|
+
/* @__PURE__ */ O("span", {
|
|
256
333
|
className: "text-[11px] font-medium uppercase tracking-wide text-text-tertiary",
|
|
257
334
|
children: "Calories"
|
|
258
335
|
}),
|
|
259
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ O("span", {
|
|
260
337
|
className: "text-3xl font-bold tabular-nums text-text-primary",
|
|
261
338
|
children: i($.calories)
|
|
262
339
|
}),
|
|
263
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ k("span", {
|
|
264
341
|
className: "mt-0.5 text-xs text-text-tertiary",
|
|
265
342
|
children: [
|
|
266
343
|
"/ ",
|
|
@@ -270,17 +347,17 @@ function j() {
|
|
|
270
347
|
})
|
|
271
348
|
]
|
|
272
349
|
})]
|
|
273
|
-
}), /* @__PURE__ */
|
|
350
|
+
}), /* @__PURE__ */ k("div", {
|
|
274
351
|
className: "flex-1 space-y-4",
|
|
275
|
-
children: [/* @__PURE__ */
|
|
352
|
+
children: [/* @__PURE__ */ k("div", {
|
|
276
353
|
className: "space-y-2",
|
|
277
|
-
children: [/* @__PURE__ */
|
|
354
|
+
children: [/* @__PURE__ */ O(ce, {
|
|
278
355
|
proteinG: $.proteinG,
|
|
279
356
|
carbsG: $.carbsG,
|
|
280
357
|
fatG: $.fatG,
|
|
281
358
|
height: 12
|
|
282
|
-
}), /* @__PURE__ */
|
|
283
|
-
}), /* @__PURE__ */
|
|
359
|
+
}), /* @__PURE__ */ O(le, {})]
|
|
360
|
+
}), /* @__PURE__ */ O("div", {
|
|
284
361
|
className: "grid grid-cols-3 gap-3",
|
|
285
362
|
children: [
|
|
286
363
|
[
|
|
@@ -300,22 +377,22 @@ function j() {
|
|
|
300
377
|
]
|
|
301
378
|
].map(([e, t, n]) => {
|
|
302
379
|
let r = n ? t / n * 100 : 0;
|
|
303
|
-
return /* @__PURE__ */
|
|
380
|
+
return /* @__PURE__ */ k("div", {
|
|
304
381
|
className: "rounded-2xl bg-bg-sunken/60 p-3 ring-1 ring-inset ring-border-seam/40 transition-shadow hover:shadow-float",
|
|
305
382
|
children: [
|
|
306
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ k("div", {
|
|
307
384
|
className: "flex items-center justify-between gap-1",
|
|
308
|
-
children: [/* @__PURE__ */
|
|
385
|
+
children: [/* @__PURE__ */ O("p", {
|
|
309
386
|
className: "text-xs font-medium text-text-tertiary",
|
|
310
387
|
children: e
|
|
311
|
-
}), /* @__PURE__ */
|
|
388
|
+
}), /* @__PURE__ */ O("span", {
|
|
312
389
|
className: "text-[11px] tabular-nums text-text-tertiary",
|
|
313
390
|
children: a(r)
|
|
314
391
|
})]
|
|
315
392
|
}),
|
|
316
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ k("p", {
|
|
317
394
|
className: "mt-1 text-sm font-semibold tabular-nums text-text-primary",
|
|
318
|
-
children: [i(t), /* @__PURE__ */
|
|
395
|
+
children: [i(t), /* @__PURE__ */ k("span", {
|
|
319
396
|
className: "text-xs font-normal text-text-tertiary",
|
|
320
397
|
children: [
|
|
321
398
|
" ",
|
|
@@ -325,7 +402,7 @@ function j() {
|
|
|
325
402
|
]
|
|
326
403
|
})]
|
|
327
404
|
}),
|
|
328
|
-
/* @__PURE__ */
|
|
405
|
+
/* @__PURE__ */ O(g, {
|
|
329
406
|
value: r,
|
|
330
407
|
height: 5,
|
|
331
408
|
className: "mt-2"
|
|
@@ -337,71 +414,71 @@ function j() {
|
|
|
337
414
|
})]
|
|
338
415
|
})]
|
|
339
416
|
})
|
|
340
|
-
}), /* @__PURE__ */
|
|
417
|
+
}), /* @__PURE__ */ O(m.div, {
|
|
341
418
|
"data-tour": "mybodyshield-dashboard-next-up",
|
|
342
|
-
...
|
|
343
|
-
children: /* @__PURE__ */
|
|
419
|
+
...N(1),
|
|
420
|
+
children: /* @__PURE__ */ k(A, {
|
|
344
421
|
treatment: "glass",
|
|
345
422
|
className: "h-full p-6",
|
|
346
|
-
children: [/* @__PURE__ */
|
|
423
|
+
children: [/* @__PURE__ */ k("div", {
|
|
347
424
|
className: "mb-4 flex items-center justify-between gap-3",
|
|
348
|
-
children: [/* @__PURE__ */
|
|
425
|
+
children: [/* @__PURE__ */ O("h2", {
|
|
349
426
|
className: "text-base font-semibold text-text-primary",
|
|
350
427
|
children: "Next up"
|
|
351
|
-
}), /* @__PURE__ */
|
|
428
|
+
}), /* @__PURE__ */ k("button", {
|
|
352
429
|
type: "button",
|
|
353
|
-
onClick: () =>
|
|
430
|
+
onClick: () => y("train"),
|
|
354
431
|
className: "inline-flex items-center gap-1 text-sm font-medium text-accent hover:underline",
|
|
355
|
-
children: ["Train ", /* @__PURE__ */
|
|
432
|
+
children: ["Train ", /* @__PURE__ */ O(v, { className: "h-4 w-4" })]
|
|
356
433
|
})]
|
|
357
|
-
}), K ? /* @__PURE__ */
|
|
434
|
+
}), K ? /* @__PURE__ */ k(m.button, {
|
|
358
435
|
type: "button",
|
|
359
|
-
onClick: () =>
|
|
436
|
+
onClick: () => y(`train/${K.id}`),
|
|
360
437
|
className: "w-full rounded-2xl border border-status-warning-text/40 bg-status-warning-bg-subtle p-4 text-left transition-shadow hover:shadow-float",
|
|
361
|
-
...
|
|
438
|
+
...F,
|
|
362
439
|
children: [
|
|
363
|
-
/* @__PURE__ */
|
|
440
|
+
/* @__PURE__ */ O("div", {
|
|
364
441
|
className: "flex items-center gap-2",
|
|
365
|
-
children: /* @__PURE__ */
|
|
442
|
+
children: /* @__PURE__ */ O(c, { status: K.status })
|
|
366
443
|
}),
|
|
367
|
-
/* @__PURE__ */
|
|
444
|
+
/* @__PURE__ */ O("p", {
|
|
368
445
|
className: "mt-2 text-sm font-medium text-text-primary",
|
|
369
446
|
children: "Live workout in progress"
|
|
370
447
|
}),
|
|
371
|
-
/* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ k("p", {
|
|
372
449
|
className: "mt-0.5 text-xs text-text-tertiary",
|
|
373
450
|
children: ["Started ", o(K.startedAt)]
|
|
374
451
|
})
|
|
375
452
|
]
|
|
376
|
-
}) : q ? /* @__PURE__ */
|
|
453
|
+
}) : q ? /* @__PURE__ */ O(m.button, {
|
|
377
454
|
type: "button",
|
|
378
|
-
onClick: () =>
|
|
455
|
+
onClick: () => y(`train/${q.id}`),
|
|
379
456
|
className: "w-full rounded-2xl bg-bg-sunken/60 p-4 text-left ring-1 ring-inset ring-border-seam/40 transition-shadow hover:shadow-float",
|
|
380
|
-
...
|
|
381
|
-
children: /* @__PURE__ */
|
|
457
|
+
...F,
|
|
458
|
+
children: /* @__PURE__ */ k("div", {
|
|
382
459
|
className: "flex items-center gap-2",
|
|
383
|
-
children: [/* @__PURE__ */
|
|
460
|
+
children: [/* @__PURE__ */ O(h, { icon: /* @__PURE__ */ O(b, { className: "h-4 w-4" }) }), /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
|
|
384
461
|
className: "text-sm font-medium text-text-primary",
|
|
385
462
|
children: "Scheduled session"
|
|
386
|
-
}), /* @__PURE__ */
|
|
463
|
+
}), /* @__PURE__ */ O("p", {
|
|
387
464
|
className: "text-xs text-text-tertiary",
|
|
388
465
|
children: o(q.scheduledFor)
|
|
389
466
|
})] })]
|
|
390
467
|
})
|
|
391
|
-
}) : /* @__PURE__ */
|
|
468
|
+
}) : /* @__PURE__ */ k("div", {
|
|
392
469
|
className: "flex flex-col items-center justify-center rounded-2xl border border-dashed border-border-seam py-8 text-center",
|
|
393
470
|
children: [
|
|
394
|
-
/* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ O("span", {
|
|
395
472
|
className: "flex size-11 items-center justify-center rounded-full bg-[var(--color-accent-soft)]",
|
|
396
|
-
children: /* @__PURE__ */
|
|
473
|
+
children: /* @__PURE__ */ O(S, { className: "h-5 w-5 text-accent" })
|
|
397
474
|
}),
|
|
398
|
-
/* @__PURE__ */
|
|
475
|
+
/* @__PURE__ */ O("p", {
|
|
399
476
|
className: "mt-3 text-sm font-medium text-text-primary",
|
|
400
477
|
children: "No session scheduled"
|
|
401
478
|
}),
|
|
402
|
-
/* @__PURE__ */
|
|
479
|
+
/* @__PURE__ */ O("button", {
|
|
403
480
|
type: "button",
|
|
404
|
-
onClick: () =>
|
|
481
|
+
onClick: () => y("train"),
|
|
405
482
|
className: "mt-1 text-xs font-medium text-accent hover:underline",
|
|
406
483
|
children: "Start a workout"
|
|
407
484
|
})
|
|
@@ -410,54 +487,54 @@ function j() {
|
|
|
410
487
|
})
|
|
411
488
|
})]
|
|
412
489
|
}),
|
|
413
|
-
/* @__PURE__ */
|
|
490
|
+
/* @__PURE__ */ O(u, {
|
|
414
491
|
"data-tour": "mybodyshield-dashboard-active-goals",
|
|
415
492
|
title: "Active goals",
|
|
416
493
|
description: "Your current targets across training, nutrition and body composition.",
|
|
417
|
-
action: /* @__PURE__ */
|
|
494
|
+
action: /* @__PURE__ */ k("button", {
|
|
418
495
|
type: "button",
|
|
419
|
-
onClick: () =>
|
|
496
|
+
onClick: () => y("goals"),
|
|
420
497
|
className: "inline-flex items-center gap-1 text-sm font-medium text-accent hover:underline",
|
|
421
|
-
children: ["All goals ", /* @__PURE__ */
|
|
498
|
+
children: ["All goals ", /* @__PURE__ */ O(v, { className: "h-4 w-4" })]
|
|
422
499
|
}),
|
|
423
|
-
children:
|
|
500
|
+
children: H.length === 0 ? /* @__PURE__ */ O(l, {
|
|
424
501
|
illustration: "empty-data",
|
|
425
|
-
icon: /* @__PURE__ */
|
|
502
|
+
icon: /* @__PURE__ */ O(T, { className: "h-10 w-10" }),
|
|
426
503
|
title: "No active goals",
|
|
427
504
|
description: "Set a goal to give your training and nutrition a clear target to work toward."
|
|
428
|
-
}) : /* @__PURE__ */
|
|
505
|
+
}) : /* @__PURE__ */ O("div", {
|
|
429
506
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
430
|
-
children:
|
|
431
|
-
let n =
|
|
432
|
-
return /* @__PURE__ */
|
|
507
|
+
children: H.slice(0, 6).map((e, t) => {
|
|
508
|
+
let n = _(e), o = se[e.type], s = o.icon;
|
|
509
|
+
return /* @__PURE__ */ O(m.button, {
|
|
433
510
|
type: "button",
|
|
434
|
-
onClick: () =>
|
|
511
|
+
onClick: () => y("goals"),
|
|
435
512
|
className: "text-left",
|
|
436
|
-
...
|
|
437
|
-
...
|
|
438
|
-
children: /* @__PURE__ */
|
|
513
|
+
...N(t),
|
|
514
|
+
...F,
|
|
515
|
+
children: /* @__PURE__ */ k(A, {
|
|
439
516
|
treatment: "plain",
|
|
440
517
|
className: "h-full p-4 transition-shadow hover:shadow-float",
|
|
441
|
-
children: [/* @__PURE__ */
|
|
518
|
+
children: [/* @__PURE__ */ k("div", {
|
|
442
519
|
className: "flex items-start gap-3",
|
|
443
|
-
children: [/* @__PURE__ */
|
|
444
|
-
icon: /* @__PURE__ */
|
|
520
|
+
children: [/* @__PURE__ */ O(h, {
|
|
521
|
+
icon: /* @__PURE__ */ O(s, { className: "h-4 w-4" }),
|
|
445
522
|
tint: o.tint
|
|
446
|
-
}), /* @__PURE__ */
|
|
523
|
+
}), /* @__PURE__ */ k("div", {
|
|
447
524
|
className: "min-w-0 flex-1",
|
|
448
|
-
children: [/* @__PURE__ */
|
|
525
|
+
children: [/* @__PURE__ */ O("p", {
|
|
449
526
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
450
527
|
children: e.title
|
|
451
|
-
}), /* @__PURE__ */
|
|
528
|
+
}), /* @__PURE__ */ O("p", {
|
|
452
529
|
className: "text-xs text-text-tertiary",
|
|
453
530
|
children: r(e.type)
|
|
454
531
|
})]
|
|
455
532
|
})]
|
|
456
|
-
}), /* @__PURE__ */
|
|
533
|
+
}), /* @__PURE__ */ k("div", {
|
|
457
534
|
className: "mt-3 space-y-1.5",
|
|
458
|
-
children: [/* @__PURE__ */
|
|
535
|
+
children: [/* @__PURE__ */ O(g, { value: n }), /* @__PURE__ */ k("div", {
|
|
459
536
|
className: "flex items-center justify-between text-xs",
|
|
460
|
-
children: [/* @__PURE__ */
|
|
537
|
+
children: [/* @__PURE__ */ k("span", {
|
|
461
538
|
className: "tabular-nums text-text-secondary",
|
|
462
539
|
children: [
|
|
463
540
|
i(e.currentValue),
|
|
@@ -466,7 +543,7 @@ function j() {
|
|
|
466
543
|
i(e.targetValue),
|
|
467
544
|
e.unit ? ` ${e.unit}` : ""
|
|
468
545
|
]
|
|
469
|
-
}), /* @__PURE__ */
|
|
546
|
+
}), /* @__PURE__ */ O("span", {
|
|
470
547
|
className: "tabular-nums text-text-tertiary",
|
|
471
548
|
children: a(n)
|
|
472
549
|
})]
|
|
@@ -477,47 +554,47 @@ function j() {
|
|
|
477
554
|
})
|
|
478
555
|
})
|
|
479
556
|
}),
|
|
480
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ O(u, {
|
|
481
558
|
"data-tour": "mybodyshield-dashboard-recent-sessions",
|
|
482
559
|
title: "Recent sessions",
|
|
483
560
|
description: "Your latest logged and scheduled workouts.",
|
|
484
|
-
action: /* @__PURE__ */
|
|
561
|
+
action: /* @__PURE__ */ k("button", {
|
|
485
562
|
type: "button",
|
|
486
|
-
onClick: () =>
|
|
563
|
+
onClick: () => y("train"),
|
|
487
564
|
className: "inline-flex items-center gap-1 text-sm font-medium text-accent hover:underline",
|
|
488
|
-
children: ["All sessions ", /* @__PURE__ */
|
|
565
|
+
children: ["All sessions ", /* @__PURE__ */ O(v, { className: "h-4 w-4" })]
|
|
489
566
|
}),
|
|
490
|
-
children:
|
|
567
|
+
children: V.length === 0 ? /* @__PURE__ */ O(l, {
|
|
491
568
|
illustration: "empty-data",
|
|
492
|
-
icon: /* @__PURE__ */
|
|
569
|
+
icon: /* @__PURE__ */ O(S, { className: "h-10 w-10" }),
|
|
493
570
|
title: "No sessions yet",
|
|
494
571
|
description: "Start a workout session to begin logging sets and tracking your training."
|
|
495
|
-
}) : /* @__PURE__ */
|
|
572
|
+
}) : /* @__PURE__ */ O("div", {
|
|
496
573
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
497
|
-
children:
|
|
498
|
-
let n =
|
|
499
|
-
return /* @__PURE__ */
|
|
574
|
+
children: V.slice(0, 6).map((e, t) => {
|
|
575
|
+
let n = de.STRENGTH, r = e.status === "COMPLETED" ? x : n.icon;
|
|
576
|
+
return /* @__PURE__ */ O(m.button, {
|
|
500
577
|
type: "button",
|
|
501
|
-
onClick: () =>
|
|
578
|
+
onClick: () => y(`train/${e.id}`),
|
|
502
579
|
className: "text-left",
|
|
503
|
-
...
|
|
504
|
-
...
|
|
505
|
-
children: /* @__PURE__ */
|
|
580
|
+
...N(t),
|
|
581
|
+
...F,
|
|
582
|
+
children: /* @__PURE__ */ k(A, {
|
|
506
583
|
treatment: "plain",
|
|
507
584
|
className: "p-4 transition-shadow hover:shadow-float",
|
|
508
585
|
children: [
|
|
509
|
-
/* @__PURE__ */
|
|
586
|
+
/* @__PURE__ */ k("div", {
|
|
510
587
|
className: "flex items-center justify-between gap-2",
|
|
511
|
-
children: [/* @__PURE__ */
|
|
512
|
-
icon: /* @__PURE__ */
|
|
588
|
+
children: [/* @__PURE__ */ O(h, {
|
|
589
|
+
icon: /* @__PURE__ */ O(r, { className: "h-4 w-4" }),
|
|
513
590
|
tint: n.tint
|
|
514
|
-
}), /* @__PURE__ */
|
|
591
|
+
}), /* @__PURE__ */ O(c, { status: e.status })]
|
|
515
592
|
}),
|
|
516
|
-
/* @__PURE__ */
|
|
593
|
+
/* @__PURE__ */ O("p", {
|
|
517
594
|
className: "mt-3 text-sm font-medium text-text-primary",
|
|
518
595
|
children: e.caloriesBurned > 0 ? `${i(e.caloriesBurned)} kcal burned` : "Workout session"
|
|
519
596
|
}),
|
|
520
|
-
/* @__PURE__ */
|
|
597
|
+
/* @__PURE__ */ O("p", {
|
|
521
598
|
className: "mt-0.5 text-xs text-text-tertiary",
|
|
522
599
|
children: o(e.completedAt ?? e.startedAt ?? e.createdAt)
|
|
523
600
|
})
|
|
@@ -531,6 +608,6 @@ function j() {
|
|
|
531
608
|
});
|
|
532
609
|
}
|
|
533
610
|
//#endregion
|
|
534
|
-
export {
|
|
611
|
+
export { N as DashboardPage };
|
|
535
612
|
|
|
536
613
|
//# sourceMappingURL=DashboardPage.js.map
|