@burdenoff/microfe-mybodyshield 2026.821.1 → 2026.827.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mybodyshield/pages/ai/AiControlsPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/ai/AiControlsPage.js +167 -108
- package/dist/mybodyshield/pages/ai/AiControlsPage.js.map +1 -1
- package/dist/mybodyshield/pages/coaching/CoachingPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/coaching/CoachingPage.js +222 -151
- package/dist/mybodyshield/pages/coaching/CoachingPage.js.map +1 -1
- package/dist/mybodyshield/pages/insights/InsightsCharts.d.ts +18 -0
- package/dist/mybodyshield/pages/insights/InsightsCharts.d.ts.map +1 -0
- package/dist/mybodyshield/pages/insights/InsightsCharts.js +549 -0
- package/dist/mybodyshield/pages/insights/InsightsCharts.js.map +1 -0
- package/dist/mybodyshield/pages/insights/InsightsPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/insights/InsightsPage.js +202 -86
- package/dist/mybodyshield/pages/insights/InsightsPage.js.map +1 -1
- package/dist/node_modules/recharts/es6/cartesian/Line.js +473 -0
- package/dist/node_modules/recharts/es6/cartesian/Line.js.map +1 -0
- package/dist/node_modules/recharts/es6/cartesian/Scatter.js +368 -0
- package/dist/node_modules/recharts/es6/cartesian/Scatter.js.map +1 -0
- package/dist/node_modules/recharts/es6/cartesian/ZAxis.js +103 -0
- package/dist/node_modules/recharts/es6/cartesian/ZAxis.js.map +1 -0
- package/dist/node_modules/recharts/es6/chart/BarChart.js +24 -0
- package/dist/node_modules/recharts/es6/chart/BarChart.js.map +1 -0
- package/dist/node_modules/recharts/es6/chart/ComposedChart.js +38 -0
- package/dist/node_modules/recharts/es6/chart/ComposedChart.js.map +1 -0
- package/dist/node_modules/recharts/es6/util/DataUtils.js +12 -2
- package/dist/node_modules/recharts/es6/util/DataUtils.js.map +1 -1
- package/dist/node_modules/recharts/es6/util/ScatterUtils.js +48 -0
- package/dist/node_modules/recharts/es6/util/ScatterUtils.js.map +1 -0
- package/dist/stories/InsightsCharts.stories.d.ts +15 -0
- package/dist/stories/InsightsCharts.stories.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -9,12 +9,13 @@ import { useMybInsights as m } from "../../hooks/useMyBodyShieldApi.js";
|
|
|
9
9
|
import { useMyBodyShieldAnalytics as h } from "../../hooks/useMyBodyShieldAnalytics.js";
|
|
10
10
|
import "../../hooks/index.js";
|
|
11
11
|
import "../../components/index.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
12
|
+
import { CalorieChart as g, CorrelationView as _, MacroChart as v, ReadinessSleepChart as y, VolumeChart as b } from "./InsightsCharts.js";
|
|
13
|
+
import { useEffect as x, useMemo as S, useState as C } from "react";
|
|
14
|
+
import { BarChart3 as w, Calendar as T, Dumbbell as E, Flame as D, HeartPulse as O, Moon as k, Scale as A, Target as j, TrendingUp as M, Utensils as N } from "lucide-react";
|
|
15
|
+
import { jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
16
|
+
import { Button as I, GlassCard as L } from "@burdenoff/fe-libs/ui";
|
|
16
17
|
//#region src/mybodyshield/pages/insights/InsightsPage.tsx
|
|
17
|
-
var
|
|
18
|
+
var R = [
|
|
18
19
|
{
|
|
19
20
|
label: "Last 7 days",
|
|
20
21
|
days: 7
|
|
@@ -28,107 +29,218 @@ var j = [
|
|
|
28
29
|
days: 90
|
|
29
30
|
}
|
|
30
31
|
];
|
|
31
|
-
function
|
|
32
|
+
function z(e) {
|
|
32
33
|
return e.toISOString().split("T")[0];
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
-
return
|
|
35
|
+
function B(e) {
|
|
36
|
+
return e.calories > 0 || e.proteinG > 0 || e.carbsG > 0 || e.fatG > 0;
|
|
37
|
+
}
|
|
38
|
+
function V(e) {
|
|
39
|
+
return e.readiness != null || e.sleepHours != null;
|
|
40
|
+
}
|
|
41
|
+
function H(e) {
|
|
42
|
+
return e.sessions > 0 || V(e) || B(e) || e.weight != null;
|
|
43
|
+
}
|
|
44
|
+
function U({ daily: e, summary: t, onOpen: n }) {
|
|
45
|
+
let r = e.length;
|
|
46
|
+
return /* @__PURE__ */ P(f, {
|
|
47
|
+
title: "What these numbers are built on",
|
|
48
|
+
description: "The logs feeding the charts above. Gaps here are why a trend can look flat.",
|
|
49
|
+
children: /* @__PURE__ */ P("div", {
|
|
50
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4",
|
|
51
|
+
children: [
|
|
52
|
+
{
|
|
53
|
+
route: "train",
|
|
54
|
+
icon: /* @__PURE__ */ P(E, { className: "h-4 w-4" }),
|
|
55
|
+
label: "Training",
|
|
56
|
+
value: t.totalSessions,
|
|
57
|
+
unit: t.totalSessions === 1 ? "completed session" : "completed sessions",
|
|
58
|
+
detail: `on ${e.filter((e) => e.sessions > 0).length} of ${r} days`
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
route: "recovery",
|
|
62
|
+
icon: /* @__PURE__ */ P(O, { className: "h-4 w-4" }),
|
|
63
|
+
label: "Recovery",
|
|
64
|
+
value: e.filter(V).length,
|
|
65
|
+
unit: "days logged",
|
|
66
|
+
detail: "readiness or sleep entries"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
route: "nutrition",
|
|
70
|
+
icon: /* @__PURE__ */ P(N, { className: "h-4 w-4" }),
|
|
71
|
+
label: "Nutrition",
|
|
72
|
+
value: e.filter(B).length,
|
|
73
|
+
unit: "days logged",
|
|
74
|
+
detail: "days with macros logged"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
route: "progress",
|
|
78
|
+
icon: /* @__PURE__ */ P(A, { className: "h-4 w-4" }),
|
|
79
|
+
label: "Body weight",
|
|
80
|
+
value: e.filter((e) => e.weight != null).length,
|
|
81
|
+
unit: "days logged",
|
|
82
|
+
detail: "weight readings only"
|
|
83
|
+
}
|
|
84
|
+
].map((e) => /* @__PURE__ */ F(L, {
|
|
85
|
+
treatment: "plain",
|
|
86
|
+
className: "flex flex-col gap-3 p-5",
|
|
87
|
+
children: [/* @__PURE__ */ F("div", {
|
|
88
|
+
className: "flex items-center justify-between gap-2",
|
|
89
|
+
children: [/* @__PURE__ */ F("div", {
|
|
90
|
+
className: "flex min-w-0 items-center gap-2 text-text-secondary",
|
|
91
|
+
children: [e.icon, /* @__PURE__ */ P("span", {
|
|
92
|
+
className: "truncate text-sm font-medium text-text-primary",
|
|
93
|
+
children: e.label
|
|
94
|
+
})]
|
|
95
|
+
}), /* @__PURE__ */ P(I, {
|
|
96
|
+
variant: "ghost",
|
|
97
|
+
size: "sm",
|
|
98
|
+
onClick: () => n(e.route),
|
|
99
|
+
children: "View"
|
|
100
|
+
})]
|
|
101
|
+
}), /* @__PURE__ */ F("div", { children: [
|
|
102
|
+
/* @__PURE__ */ P("p", {
|
|
103
|
+
className: "text-2xl font-bold tabular-nums text-text-primary",
|
|
104
|
+
children: s(e.value)
|
|
105
|
+
}),
|
|
106
|
+
/* @__PURE__ */ P("p", {
|
|
107
|
+
className: "text-xs text-text-secondary",
|
|
108
|
+
children: e.unit
|
|
109
|
+
}),
|
|
110
|
+
/* @__PURE__ */ P("p", {
|
|
111
|
+
className: "mt-1 text-xs text-text-tertiary",
|
|
112
|
+
children: e.detail
|
|
113
|
+
})
|
|
114
|
+
] })]
|
|
115
|
+
}, e.route))
|
|
116
|
+
})
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function W(e) {
|
|
120
|
+
return S(() => {
|
|
36
121
|
let t = /* @__PURE__ */ new Date(), n = /* @__PURE__ */ new Date();
|
|
37
122
|
return n.setDate(t.getDate() - e + 1), {
|
|
38
|
-
dateRangeStart:
|
|
39
|
-
dateRangeEnd:
|
|
123
|
+
dateRangeStart: z(n),
|
|
124
|
+
dateRangeEnd: z(t)
|
|
40
125
|
};
|
|
41
126
|
}, [e]);
|
|
42
127
|
}
|
|
43
|
-
function
|
|
44
|
-
let { workspaceId:
|
|
45
|
-
if (
|
|
46
|
-
|
|
47
|
-
}, []),
|
|
128
|
+
function G() {
|
|
129
|
+
let { workspaceId: S, navigateTo: I } = e(), [z, B] = C(30), V = m(W(z)), G = h();
|
|
130
|
+
if (x(() => {
|
|
131
|
+
G.emitPageView("insights", { workspaceId: S });
|
|
132
|
+
}, [G, S]), V.isLoading) return /* @__PURE__ */ P(t, {
|
|
48
133
|
title: "Insights",
|
|
49
|
-
children: /* @__PURE__ */
|
|
134
|
+
children: /* @__PURE__ */ P(d, { label: "Loading insights…" })
|
|
50
135
|
});
|
|
51
|
-
if (
|
|
136
|
+
if (V.isError) return /* @__PURE__ */ P(t, {
|
|
52
137
|
title: "Insights",
|
|
53
|
-
children: /* @__PURE__ */
|
|
138
|
+
children: /* @__PURE__ */ P(u, {
|
|
54
139
|
title: "Could not load insights",
|
|
55
|
-
message:
|
|
56
|
-
onRetry: () =>
|
|
140
|
+
message: V.error instanceof Error ? V.error.message : "Unknown error",
|
|
141
|
+
onRetry: () => V.refetch()
|
|
57
142
|
})
|
|
58
143
|
});
|
|
59
|
-
let
|
|
60
|
-
if (!
|
|
144
|
+
let K = V.data;
|
|
145
|
+
if (!K) return /* @__PURE__ */ P(t, {
|
|
61
146
|
title: "Insights",
|
|
62
|
-
children: /* @__PURE__ */
|
|
147
|
+
children: /* @__PURE__ */ P(u, {
|
|
63
148
|
title: "Could not load insights",
|
|
64
149
|
message: "No insight data was returned.",
|
|
65
|
-
onRetry: () =>
|
|
150
|
+
onRetry: () => V.refetch()
|
|
66
151
|
})
|
|
67
152
|
});
|
|
68
|
-
let { summary:
|
|
69
|
-
return /* @__PURE__ */
|
|
153
|
+
let { summary: q, daily: J, goals: Y } = K, X = J.filter(H).length;
|
|
154
|
+
return /* @__PURE__ */ F(t, {
|
|
70
155
|
title: "Insights",
|
|
71
|
-
description: `${r(
|
|
156
|
+
description: `${r(K.dateRangeStart)} – ${r(K.dateRangeEnd)}`,
|
|
72
157
|
children: [
|
|
73
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ P("div", {
|
|
74
159
|
className: "flex flex-wrap items-center gap-2",
|
|
75
|
-
children:
|
|
160
|
+
children: R.map((e) => /* @__PURE__ */ P("button", {
|
|
76
161
|
type: "button",
|
|
77
|
-
onClick: () =>
|
|
78
|
-
className: `rounded-lg px-3 py-1.5 text-sm font-medium transition-colors ${
|
|
162
|
+
onClick: () => B(e.days),
|
|
163
|
+
className: `rounded-lg px-3 py-1.5 text-sm font-medium transition-colors ${z === e.days ? "bg-accent text-white" : "bg-bg-sunken text-text-secondary hover:bg-bg-elevated"}`,
|
|
79
164
|
children: e.label
|
|
80
165
|
}, e.days))
|
|
81
166
|
}),
|
|
82
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ P(f, {
|
|
83
168
|
title: "Summary",
|
|
84
|
-
children: /* @__PURE__ */
|
|
169
|
+
children: /* @__PURE__ */ F("div", {
|
|
85
170
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
86
171
|
children: [
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
icon: /* @__PURE__ */
|
|
89
|
-
value:
|
|
172
|
+
/* @__PURE__ */ P(n, {
|
|
173
|
+
icon: /* @__PURE__ */ P(D, { className: "h-5 w-5" }),
|
|
174
|
+
value: q.consistencyStreakDays,
|
|
90
175
|
label: "Consistency streak"
|
|
91
176
|
}),
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
icon: /* @__PURE__ */
|
|
94
|
-
value:
|
|
177
|
+
/* @__PURE__ */ P(n, {
|
|
178
|
+
icon: /* @__PURE__ */ P(E, { className: "h-5 w-5" }),
|
|
179
|
+
value: q.totalSessions,
|
|
95
180
|
label: "Total sessions"
|
|
96
181
|
}),
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
icon: /* @__PURE__ */
|
|
99
|
-
value: l(
|
|
182
|
+
/* @__PURE__ */ P(n, {
|
|
183
|
+
icon: /* @__PURE__ */ P(M, { className: "h-5 w-5" }),
|
|
184
|
+
value: l(q.totalVolumeKg),
|
|
100
185
|
label: "Total volume"
|
|
101
186
|
}),
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
icon: /* @__PURE__ */ O
|
|
104
|
-
value: s(
|
|
187
|
+
/* @__PURE__ */ P(n, {
|
|
188
|
+
icon: /* @__PURE__ */ P(O, { className: "h-5 w-5" }),
|
|
189
|
+
value: s(q.averageReadiness),
|
|
105
190
|
label: "Average readiness"
|
|
106
191
|
}),
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
icon: /* @__PURE__ */
|
|
109
|
-
value: c(
|
|
192
|
+
/* @__PURE__ */ P(n, {
|
|
193
|
+
icon: /* @__PURE__ */ P(N, { className: "h-5 w-5" }),
|
|
194
|
+
value: c(q.macroAdherencePercent),
|
|
110
195
|
label: "Macro adherence"
|
|
111
196
|
}),
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
icon: /* @__PURE__ */
|
|
114
|
-
value:
|
|
115
|
-
label: "Days
|
|
197
|
+
/* @__PURE__ */ P(n, {
|
|
198
|
+
icon: /* @__PURE__ */ P(T, { className: "h-5 w-5" }),
|
|
199
|
+
value: X,
|
|
200
|
+
label: "Days with data",
|
|
201
|
+
footer: /* @__PURE__ */ F("p", {
|
|
202
|
+
className: "text-xs text-text-tertiary",
|
|
203
|
+
children: [
|
|
204
|
+
"of ",
|
|
205
|
+
J.length,
|
|
206
|
+
" days in this range"
|
|
207
|
+
]
|
|
208
|
+
})
|
|
116
209
|
})
|
|
117
210
|
]
|
|
118
211
|
})
|
|
119
212
|
}),
|
|
120
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ P(U, {
|
|
214
|
+
daily: J,
|
|
215
|
+
summary: q,
|
|
216
|
+
onOpen: I
|
|
217
|
+
}),
|
|
218
|
+
/* @__PURE__ */ P(f, {
|
|
219
|
+
title: "Trends",
|
|
220
|
+
description: "How training, recovery and nutrition move together.",
|
|
221
|
+
children: /* @__PURE__ */ F("div", {
|
|
222
|
+
className: "grid grid-cols-1 gap-6 xl:grid-cols-2",
|
|
223
|
+
children: [
|
|
224
|
+
/* @__PURE__ */ P(b, { daily: J }),
|
|
225
|
+
/* @__PURE__ */ P(y, { daily: J }),
|
|
226
|
+
/* @__PURE__ */ P(v, { daily: J }),
|
|
227
|
+
/* @__PURE__ */ P(g, { daily: J })
|
|
228
|
+
]
|
|
229
|
+
})
|
|
230
|
+
}),
|
|
231
|
+
/* @__PURE__ */ P(_, { daily: J }),
|
|
232
|
+
/* @__PURE__ */ P(f, {
|
|
121
233
|
title: "Daily breakdown",
|
|
122
234
|
description: "Per-day training, recovery and nutrition.",
|
|
123
|
-
children: /* @__PURE__ */
|
|
235
|
+
children: /* @__PURE__ */ P(L, {
|
|
124
236
|
treatment: "plain",
|
|
125
237
|
className: "overflow-hidden p-0",
|
|
126
|
-
children: /* @__PURE__ */
|
|
238
|
+
children: /* @__PURE__ */ P(p, {
|
|
127
239
|
columns: [
|
|
128
240
|
{
|
|
129
241
|
key: "date",
|
|
130
242
|
header: "Date",
|
|
131
|
-
render: (e) => /* @__PURE__ */
|
|
243
|
+
render: (e) => /* @__PURE__ */ P("span", {
|
|
132
244
|
className: "text-text-primary",
|
|
133
245
|
children: r(e.date)
|
|
134
246
|
})
|
|
@@ -137,7 +249,7 @@ function P() {
|
|
|
137
249
|
key: "sessions",
|
|
138
250
|
header: "Sessions",
|
|
139
251
|
align: "right",
|
|
140
|
-
render: (e) => /* @__PURE__ */
|
|
252
|
+
render: (e) => /* @__PURE__ */ P("span", {
|
|
141
253
|
className: "tabular-nums text-text-secondary",
|
|
142
254
|
children: e.sessions
|
|
143
255
|
})
|
|
@@ -146,7 +258,7 @@ function P() {
|
|
|
146
258
|
key: "volumeKg",
|
|
147
259
|
header: "Volume",
|
|
148
260
|
align: "right",
|
|
149
|
-
render: (e) => /* @__PURE__ */
|
|
261
|
+
render: (e) => /* @__PURE__ */ P("span", {
|
|
150
262
|
className: "tabular-nums text-text-secondary",
|
|
151
263
|
children: l(e.volumeKg)
|
|
152
264
|
})
|
|
@@ -155,7 +267,7 @@ function P() {
|
|
|
155
267
|
key: "readiness",
|
|
156
268
|
header: "Readiness",
|
|
157
269
|
align: "right",
|
|
158
|
-
render: (e) => /* @__PURE__ */
|
|
270
|
+
render: (e) => /* @__PURE__ */ P("span", {
|
|
159
271
|
className: "tabular-nums text-text-secondary",
|
|
160
272
|
children: e.readiness == null ? "—" : s(e.readiness)
|
|
161
273
|
})
|
|
@@ -164,7 +276,7 @@ function P() {
|
|
|
164
276
|
key: "sleepHours",
|
|
165
277
|
header: "Sleep",
|
|
166
278
|
align: "right",
|
|
167
|
-
render: (e) => /* @__PURE__ */
|
|
279
|
+
render: (e) => /* @__PURE__ */ P("span", {
|
|
168
280
|
className: "tabular-nums text-text-secondary",
|
|
169
281
|
children: e.sleepHours == null ? "—" : `${s(e.sleepHours)} h`
|
|
170
282
|
})
|
|
@@ -173,7 +285,7 @@ function P() {
|
|
|
173
285
|
key: "calories",
|
|
174
286
|
header: "Calories",
|
|
175
287
|
align: "right",
|
|
176
|
-
render: (e) => /* @__PURE__ */
|
|
288
|
+
render: (e) => /* @__PURE__ */ P("span", {
|
|
177
289
|
className: "tabular-nums text-text-secondary",
|
|
178
290
|
children: o(e.calories)
|
|
179
291
|
})
|
|
@@ -182,7 +294,7 @@ function P() {
|
|
|
182
294
|
key: "proteinG",
|
|
183
295
|
header: "Protein",
|
|
184
296
|
align: "right",
|
|
185
|
-
render: (e) => /* @__PURE__ */
|
|
297
|
+
render: (e) => /* @__PURE__ */ P("span", {
|
|
186
298
|
className: "tabular-nums text-text-secondary",
|
|
187
299
|
children: a(e.proteinG)
|
|
188
300
|
})
|
|
@@ -191,13 +303,13 @@ function P() {
|
|
|
191
303
|
key: "weight",
|
|
192
304
|
header: "Weight",
|
|
193
305
|
align: "right",
|
|
194
|
-
render: (e) => /* @__PURE__ */
|
|
306
|
+
render: (e) => /* @__PURE__ */ P("span", {
|
|
195
307
|
className: "tabular-nums text-text-secondary",
|
|
196
308
|
children: e.weight == null ? "—" : l(e.weight)
|
|
197
309
|
})
|
|
198
310
|
}
|
|
199
311
|
],
|
|
200
|
-
rows:
|
|
312
|
+
rows: J,
|
|
201
313
|
rowKey: (e) => e.date,
|
|
202
314
|
defaultSort: {
|
|
203
315
|
key: "date",
|
|
@@ -206,35 +318,35 @@ function P() {
|
|
|
206
318
|
})
|
|
207
319
|
})
|
|
208
320
|
}),
|
|
209
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ P(f, {
|
|
210
322
|
title: "Active goals",
|
|
211
323
|
description: "Goals open during this period.",
|
|
212
|
-
children:
|
|
324
|
+
children: Y.length === 0 ? /* @__PURE__ */ F(L, {
|
|
213
325
|
treatment: "plain",
|
|
214
326
|
className: "p-8 text-center",
|
|
215
327
|
children: [
|
|
216
|
-
/* @__PURE__ */
|
|
217
|
-
/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ P(j, { className: "mx-auto h-8 w-8 text-text-tertiary" }),
|
|
329
|
+
/* @__PURE__ */ P("p", {
|
|
218
330
|
className: "mt-3 text-sm font-medium text-text-primary",
|
|
219
331
|
children: "No active goals"
|
|
220
332
|
}),
|
|
221
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ P("p", {
|
|
222
334
|
className: "mt-1 text-xs text-text-tertiary",
|
|
223
335
|
children: "Create a goal to see progress here."
|
|
224
336
|
})
|
|
225
337
|
]
|
|
226
|
-
}) : /* @__PURE__ */
|
|
338
|
+
}) : /* @__PURE__ */ P(L, {
|
|
227
339
|
treatment: "plain",
|
|
228
340
|
className: "overflow-hidden p-0",
|
|
229
|
-
children: /* @__PURE__ */
|
|
341
|
+
children: /* @__PURE__ */ P(p, {
|
|
230
342
|
columns: [
|
|
231
343
|
{
|
|
232
344
|
key: "title",
|
|
233
345
|
header: "Goal",
|
|
234
|
-
render: (e) => /* @__PURE__ */
|
|
346
|
+
render: (e) => /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("span", {
|
|
235
347
|
className: "block text-sm text-text-primary",
|
|
236
348
|
children: e.title
|
|
237
|
-
}), /* @__PURE__ */
|
|
349
|
+
}), /* @__PURE__ */ P("span", {
|
|
238
350
|
className: "text-xs text-text-tertiary",
|
|
239
351
|
children: i(e.type)
|
|
240
352
|
})] })
|
|
@@ -242,7 +354,7 @@ function P() {
|
|
|
242
354
|
{
|
|
243
355
|
key: "status",
|
|
244
356
|
header: "Status",
|
|
245
|
-
render: (e) => /* @__PURE__ */
|
|
357
|
+
render: (e) => /* @__PURE__ */ P("span", {
|
|
246
358
|
className: `inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${e.status === "ACHIEVED" ? "bg-status-success-bg text-status-success-text" : "bg-status-warning-bg text-status-warning-text"}`,
|
|
247
359
|
children: i(e.status)
|
|
248
360
|
})
|
|
@@ -251,7 +363,7 @@ function P() {
|
|
|
251
363
|
key: "progress",
|
|
252
364
|
header: "Progress",
|
|
253
365
|
align: "right",
|
|
254
|
-
render: (e) => /* @__PURE__ */
|
|
366
|
+
render: (e) => /* @__PURE__ */ F("span", {
|
|
255
367
|
className: "tabular-nums text-text-secondary",
|
|
256
368
|
children: [
|
|
257
369
|
s(e.currentValue),
|
|
@@ -263,7 +375,7 @@ function P() {
|
|
|
263
375
|
})
|
|
264
376
|
}
|
|
265
377
|
],
|
|
266
|
-
rows:
|
|
378
|
+
rows: Y,
|
|
267
379
|
rowKey: (e) => e.id,
|
|
268
380
|
defaultSort: {
|
|
269
381
|
key: "status",
|
|
@@ -272,31 +384,35 @@ function P() {
|
|
|
272
384
|
})
|
|
273
385
|
})
|
|
274
386
|
}),
|
|
275
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ F("div", {
|
|
276
388
|
className: "flex flex-wrap gap-4 text-xs text-text-tertiary",
|
|
277
389
|
children: [
|
|
278
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ F("span", {
|
|
279
391
|
className: "inline-flex items-center gap-1.5",
|
|
280
|
-
children: [/* @__PURE__ */
|
|
392
|
+
children: [/* @__PURE__ */ P(E, { className: "h-3.5 w-3.5" }), "Training data from completed sessions."]
|
|
281
393
|
}),
|
|
282
|
-
/* @__PURE__ */
|
|
394
|
+
/* @__PURE__ */ F("span", {
|
|
283
395
|
className: "inline-flex items-center gap-1.5",
|
|
284
|
-
children: [/* @__PURE__ */
|
|
396
|
+
children: [/* @__PURE__ */ P(k, { className: "h-3.5 w-3.5" }), "Recovery data from recovery logs."]
|
|
285
397
|
}),
|
|
286
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ F("span", {
|
|
287
399
|
className: "inline-flex items-center gap-1.5",
|
|
288
|
-
children: [/* @__PURE__ */
|
|
400
|
+
children: [/* @__PURE__ */ P(A, { className: "h-3.5 w-3.5" }), "Body metrics from progress logs."]
|
|
289
401
|
}),
|
|
290
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ F("span", {
|
|
291
403
|
className: "inline-flex items-center gap-1.5",
|
|
292
|
-
children: [/* @__PURE__ */
|
|
404
|
+
children: [/* @__PURE__ */ P(w, { className: "h-3.5 w-3.5" }), "Nutrition data from logged meals."]
|
|
293
405
|
})
|
|
294
406
|
]
|
|
407
|
+
}),
|
|
408
|
+
/* @__PURE__ */ P("p", {
|
|
409
|
+
className: "mt-4 border-t border-border-seam pt-4 text-xs leading-relaxed text-text-tertiary",
|
|
410
|
+
children: "General fitness information, not medical advice. MyBodyShield is not a medical device and does not diagnose, treat, cure or prevent any condition — talk to a qualified healthcare professional before changing how you train or eat."
|
|
295
411
|
})
|
|
296
412
|
]
|
|
297
413
|
});
|
|
298
414
|
}
|
|
299
415
|
//#endregion
|
|
300
|
-
export {
|
|
416
|
+
export { G as InsightsPage };
|
|
301
417
|
|
|
302
418
|
//# sourceMappingURL=InsightsPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsightsPage.js","names":[],"sources":["../../../../src/mybodyshield/pages/insights/InsightsPage.tsx"],"sourcesContent":["/**\n * Insights — unified analytics dashboard for MyBodyShield.\n * @module mybodyshield/pages/insights\n *\n * BOFF-4056: surfaces a 30-day rollup of training volume, sessions,\n * readiness, sleep, nutrition, body weight, and active goals using the\n * `mybInsights` federated query. The backend already aggregates and\n * anonymizes the data; this page only renders what the member is allowed\n * to see.\n */\n\nimport { useMemo, useState } from 'react';\nimport {\n BarChart3,\n Calendar,\n Dumbbell,\n Flame,\n HeartPulse,\n Moon,\n Scale,\n Target,\n TrendingUp,\n Utensils,\n} from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport {\n PageLayout,\n MetricsCard,\n LoadingView,\n ErrorView,\n Section,\n DataTable,\n type Column,\n} from '../../components';\nimport { useMybInsights, useMyBodyShieldAnalytics } from '../../hooks';\nimport { useMyBodyShield } from '../../context';\nimport type { MybInsightsDay, MybGoal } from '../../types';\nimport {\n formatDate,\n formatNumber,\n formatWeight,\n formatKcal,\n formatGrams,\n formatPercent,\n formatEnumLabel,\n} from '../../utils/formatters';\n\nconst RANGE_OPTIONS = [\n { label: 'Last 7 days', days: 7 },\n { label: 'Last 30 days', days: 30 },\n { label: 'Last 90 days', days: 90 },\n] as const;\n\ntype RangeDays = (typeof RANGE_OPTIONS)[number]['days'];\n\nfunction toISODate(d: Date): string {\n return d.toISOString().split('T')[0];\n}\n\nfunction useInsightsRange(days: RangeDays) {\n return useMemo(() => {\n const end = new Date();\n const start = new Date();\n start.setDate(end.getDate() - days + 1);\n return {\n dateRangeStart: toISODate(start),\n dateRangeEnd: toISODate(end),\n };\n }, [days]);\n}\n\nexport function InsightsPage() {\n const { workspaceId } = useMyBodyShield();\n const [days, setDays] = useState<RangeDays>(30);\n const range = useInsightsRange(days);\n const insights = useMybInsights(range);\n const analytics = useMyBodyShieldAnalytics();\n\n // Emit a page-view event once on mount.\n useMemo(() => {\n analytics.emitPageView('insights', { workspaceId });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (insights.isLoading) {\n return (\n <PageLayout title=\"Insights\">\n <LoadingView label=\"Loading insights…\" />\n </PageLayout>\n );\n }\n\n if (insights.isError) {\n return (\n <PageLayout title=\"Insights\">\n <ErrorView\n title=\"Could not load insights\"\n message={insights.error instanceof Error ? insights.error.message : 'Unknown error'}\n onRetry={() => insights.refetch()}\n />\n </PageLayout>\n );\n }\n\n const data = insights.data;\n if (!data) {\n return (\n <PageLayout title=\"Insights\">\n <ErrorView\n title=\"Could not load insights\"\n message=\"No insight data was returned.\"\n onRetry={() => insights.refetch()}\n />\n </PageLayout>\n );\n }\n\n const { summary, daily, goals } = data;\n\n const dayColumns: Column<MybInsightsDay>[] = [\n {\n key: 'date',\n header: 'Date',\n render: (r) => <span className=\"text-text-primary\">{formatDate(r.date)}</span>,\n },\n {\n key: 'sessions',\n header: 'Sessions',\n align: 'right',\n render: (r) => <span className=\"tabular-nums text-text-secondary\">{r.sessions}</span>,\n },\n {\n key: 'volumeKg',\n header: 'Volume',\n align: 'right',\n render: (r) => <span className=\"tabular-nums text-text-secondary\">{formatWeight(r.volumeKg)}</span>,\n },\n {\n key: 'readiness',\n header: 'Readiness',\n align: 'right',\n render: (r) => (\n <span className=\"tabular-nums text-text-secondary\">\n {r.readiness != null ? formatNumber(r.readiness) : '—'}\n </span>\n ),\n },\n {\n key: 'sleepHours',\n header: 'Sleep',\n align: 'right',\n render: (r) => (\n <span className=\"tabular-nums text-text-secondary\">\n {r.sleepHours != null ? `${formatNumber(r.sleepHours)} h` : '—'}\n </span>\n ),\n },\n {\n key: 'calories',\n header: 'Calories',\n align: 'right',\n render: (r) => <span className=\"tabular-nums text-text-secondary\">{formatKcal(r.calories)}</span>,\n },\n {\n key: 'proteinG',\n header: 'Protein',\n align: 'right',\n render: (r) => <span className=\"tabular-nums text-text-secondary\">{formatGrams(r.proteinG)}</span>,\n },\n {\n key: 'weight',\n header: 'Weight',\n align: 'right',\n render: (r) => (\n <span className=\"tabular-nums text-text-secondary\">\n {r.weight != null ? formatWeight(r.weight) : '—'}\n </span>\n ),\n },\n ];\n\n const goalColumns: Column<MybGoal>[] = [\n {\n key: 'title',\n header: 'Goal',\n render: (r) => (\n <div>\n <span className=\"block text-sm text-text-primary\">{r.title}</span>\n <span className=\"text-xs text-text-tertiary\">{formatEnumLabel(r.type)}</span>\n </div>\n ),\n },\n {\n key: 'status',\n header: 'Status',\n render: (r) => (\n <span\n className={`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${\n r.status === 'ACHIEVED'\n ? 'bg-status-success-bg text-status-success-text'\n : 'bg-status-warning-bg text-status-warning-text'\n }`}\n >\n {formatEnumLabel(r.status)}\n </span>\n ),\n },\n {\n key: 'progress',\n header: 'Progress',\n align: 'right',\n render: (r) => (\n <span className=\"tabular-nums text-text-secondary\">\n {formatNumber(r.currentValue)} / {formatNumber(r.targetValue)} {r.unit}\n </span>\n ),\n },\n ];\n\n return (\n <PageLayout\n title=\"Insights\"\n description={`${formatDate(data.dateRangeStart)} – ${formatDate(data.dateRangeEnd)}`}\n >\n {/* Range selector */}\n <div className=\"flex flex-wrap items-center gap-2\">\n {RANGE_OPTIONS.map((opt) => (\n <button\n key={opt.days}\n type=\"button\"\n onClick={() => setDays(opt.days)}\n className={`rounded-lg px-3 py-1.5 text-sm font-medium transition-colors ${\n days === opt.days\n ? 'bg-accent text-white'\n : 'bg-bg-sunken text-text-secondary hover:bg-bg-elevated'\n }`}\n >\n {opt.label}\n </button>\n ))}\n </div>\n\n {/* Summary KPIs */}\n <Section title=\"Summary\">\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n <MetricsCard\n icon={<Flame className=\"h-5 w-5\" />}\n value={summary.consistencyStreakDays}\n label=\"Consistency streak\"\n />\n <MetricsCard\n icon={<Dumbbell className=\"h-5 w-5\" />}\n value={summary.totalSessions}\n label=\"Total sessions\"\n />\n <MetricsCard\n icon={<TrendingUp className=\"h-5 w-5\" />}\n value={formatWeight(summary.totalVolumeKg)}\n label=\"Total volume\"\n />\n <MetricsCard\n icon={<HeartPulse className=\"h-5 w-5\" />}\n value={formatNumber(summary.averageReadiness)}\n label=\"Average readiness\"\n />\n <MetricsCard\n icon={<Utensils className=\"h-5 w-5\" />}\n value={formatPercent(summary.macroAdherencePercent)}\n label=\"Macro adherence\"\n />\n <MetricsCard\n icon={<Calendar className=\"h-5 w-5\" />}\n value={daily.length}\n label=\"Days tracked\"\n />\n </div>\n </Section>\n\n {/* Daily breakdown */}\n <Section title=\"Daily breakdown\" description=\"Per-day training, recovery and nutrition.\">\n <GlassCard treatment=\"plain\" className=\"overflow-hidden p-0\">\n <DataTable\n columns={dayColumns}\n rows={daily}\n rowKey={(r) => r.date}\n defaultSort={{ key: 'date', dir: 'desc' }}\n />\n </GlassCard>\n </Section>\n\n {/* Active goals */}\n <Section title=\"Active goals\" description=\"Goals open during this period.\">\n {goals.length === 0 ? (\n <GlassCard treatment=\"plain\" className=\"p-8 text-center\">\n <Target className=\"mx-auto h-8 w-8 text-text-tertiary\" />\n <p className=\"mt-3 text-sm font-medium text-text-primary\">No active goals</p>\n <p className=\"mt-1 text-xs text-text-tertiary\">\n Create a goal to see progress here.\n </p>\n </GlassCard>\n ) : (\n <GlassCard treatment=\"plain\" className=\"overflow-hidden p-0\">\n <DataTable\n columns={goalColumns}\n rows={goals}\n rowKey={(r) => r.id}\n defaultSort={{ key: 'status', dir: 'asc' }}\n />\n </GlassCard>\n )}\n </Section>\n\n {/* Legend */}\n <div className=\"flex flex-wrap gap-4 text-xs text-text-tertiary\">\n <span className=\"inline-flex items-center gap-1.5\">\n <Dumbbell className=\"h-3.5 w-3.5\" />\n Training data from completed sessions.\n </span>\n <span className=\"inline-flex items-center gap-1.5\">\n <Moon className=\"h-3.5 w-3.5\" />\n Recovery data from recovery logs.\n </span>\n <span className=\"inline-flex items-center gap-1.5\">\n <Scale className=\"h-3.5 w-3.5\" />\n Body metrics from progress logs.\n </span>\n <span className=\"inline-flex items-center gap-1.5\">\n <BarChart3 className=\"h-3.5 w-3.5\" />\n Nutrition data from logged meals.\n </span>\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA+CA,IAAM,IAAgB;CACpB;EAAE,OAAO;EAAe,MAAM;EAAG;CACjC;EAAE,OAAO;EAAgB,MAAM;EAAI;CACnC;EAAE,OAAO;EAAgB,MAAM;EAAI;CACpC;AAID,SAAS,EAAU,GAAiB;AAClC,QAAO,EAAE,aAAa,CAAC,MAAM,IAAI,CAAC;;AAGpC,SAAS,EAAiB,GAAiB;AACzC,QAAO,QAAc;EACnB,IAAM,oBAAM,IAAI,MAAM,EAChB,oBAAQ,IAAI,MAAM;AAExB,SADA,EAAM,QAAQ,EAAI,SAAS,GAAG,IAAO,EAAE,EAChC;GACL,gBAAgB,EAAU,EAAM;GAChC,cAAc,EAAU,EAAI;GAC7B;IACA,CAAC,EAAK,CAAC;;AAGZ,SAAgB,IAAe;CAC7B,IAAM,EAAE,mBAAgB,GAAiB,EACnC,CAAC,GAAM,KAAW,EAAoB,GAAG,EAEzC,IAAW,EADH,EAAiB,EAAK,CACE,EAChC,IAAY,GAA0B;AAQ5C,KALA,QAAc;AACZ,IAAU,aAAa,YAAY,EAAE,gBAAa,CAAC;IAElD,EAAE,CAAC,EAEF,EAAS,UACX,QACE,kBAAC,GAAD;EAAY,OAAM;YAChB,kBAAC,GAAD,EAAa,OAAM,qBAAsB,CAAA;EAC9B,CAAA;AAIjB,KAAI,EAAS,QACX,QACE,kBAAC,GAAD;EAAY,OAAM;YAChB,kBAAC,GAAD;GACE,OAAM;GACN,SAAS,EAAS,iBAAiB,QAAQ,EAAS,MAAM,UAAU;GACpE,eAAe,EAAS,SAAS;GACjC,CAAA;EACS,CAAA;CAIjB,IAAM,IAAO,EAAS;AACtB,KAAI,CAAC,EACH,QACE,kBAAC,GAAD;EAAY,OAAM;YAChB,kBAAC,GAAD;GACE,OAA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WAAU,eAAgB,CAAA,EAAA,oCAE3B;;KACP,kBAAC,QAAD;MAAM,WAAU;gBAAhB,CACE,kBAAC,GAAD,EAAO,WAAU,eAAgB,CAAA,EAAA,mCAE5B;;KACP,kBAAC,QAAD;MAAM,WAAU;gBAAhB,CACE,kBAAC,GAAD,EAAW,WAAU,eAAgB,CAAA,EAAA,oCAEhC;;KACH;;GACK"}
|
|
1
|
+
{"version":3,"file":"InsightsPage.js","names":[],"sources":["../../../../src/mybodyshield/pages/insights/InsightsPage.tsx"],"sourcesContent":["/**\n * Insights — unified analytics dashboard for MyBodyShield.\n * @module mybodyshield/pages/insights\n *\n * BOFF-4056: surfaces a 30-day rollup of training volume, sessions,\n * readiness, sleep, nutrition, body weight, and active goals using the\n * `mybInsights` federated query. The backend already aggregates and\n * anonymizes the data; this page only renders what the member is allowed\n * to see.\n */\n\nimport { useEffect, useMemo, useState } from 'react';\nimport {\n BarChart3,\n Calendar,\n Dumbbell,\n Flame,\n HeartPulse,\n Moon,\n Scale,\n Target,\n TrendingUp,\n Utensils,\n} from 'lucide-react';\nimport { Button, GlassCard } from '@burdenoff/fe-libs/ui';\nimport {\n PageLayout,\n MetricsCard,\n LoadingView,\n ErrorView,\n Section,\n DataTable,\n type Column,\n} from '../../components';\nimport { useMybInsights, useMyBodyShieldAnalytics } from '../../hooks';\nimport { useMyBodyShield } from '../../context';\nimport type { MybInsightsDay, MybInsightsSummary, MybGoal } from '../../types';\nimport {\n formatDate,\n formatNumber,\n formatWeight,\n formatKcal,\n formatGrams,\n formatPercent,\n formatEnumLabel,\n} from '../../utils/formatters';\nimport {\n VolumeChart,\n ReadinessSleepChart,\n MacroChart,\n CalorieChart,\n CorrelationView,\n} from './InsightsCharts';\n\nconst RANGE_OPTIONS = [\n { label: 'Last 7 days', days: 7 },\n { label: 'Last 30 days', days: 30 },\n { label: 'Last 90 days', days: 90 },\n] as const;\n\ntype RangeDays = (typeof RANGE_OPTIONS)[number]['days'];\n\nfunction toISODate(d: Date): string {\n return d.toISOString().split('T')[0];\n}\n\n/**\n * True when this day carries any logged nutrition. `MybInsightsDay` totals are\n * sums over the day's meals, so a day with no meals is all-zero — but a meal\n * logged with zero macros is indistinguishable from that, which is why the\n * label below says \"macros logged\" rather than \"meals logged\".\n */\nfunction hasMacros(day: MybInsightsDay): boolean {\n return day.calories > 0 || day.proteinG > 0 || day.carbsG > 0 || day.fatG > 0;\n}\n\n/** True when the member logged a readiness or a sleep entry that day. */\nfunction hasRecovery(day: MybInsightsDay): boolean {\n return day.readiness != null || day.sleepHours != null;\n}\n\n/** True when the day carries anything at all — used for \"days with data\". */\nfunction hasAnyData(day: MybInsightsDay): boolean {\n return day.sessions > 0 || hasRecovery(day) || hasMacros(day) || day.weight != null;\n}\n\n/**\n * \"What these numbers are built on\" — the evidence behind the charts above.\n *\n * Every figure here is read straight out of the `mybInsights` payload this page\n * already holds. `daily` is zero-filled to one row per calendar day in the\n * range by the service, so a day count is exact; raw entry counts (how many\n * meals, how many measurements) are NOT in the payload and are deliberately not\n * guessed at. Each row deep-links to the page that owns the underlying log.\n */\nfunction InsightsSources({\n daily,\n summary,\n onOpen,\n}: {\n daily: MybInsightsDay[];\n summary: MybInsightsSummary;\n onOpen: (route: string) => void;\n}) {\n const totalDays = daily.length;\n const sources = [\n {\n route: 'train',\n icon: <Dumbbell className=\"h-4 w-4\" />,\n label: 'Training',\n value: summary.totalSessions,\n unit: summary.totalSessions === 1 ? 'completed session' : 'completed sessions',\n detail: `on ${daily.filter((d) => d.sessions > 0).length} of ${totalDays} days`,\n },\n {\n route: 'recovery',\n icon: <HeartPulse className=\"h-4 w-4\" />,\n label: 'Recovery',\n value: daily.filter(hasRecovery).length,\n unit: 'days logged',\n detail: 'readiness or sleep entries',\n },\n {\n route: 'nutrition',\n icon: <Utensils className=\"h-4 w-4\" />,\n label: 'Nutrition',\n value: daily.filter(hasMacros).length,\n unit: 'days logged',\n detail: 'days with macros logged',\n },\n {\n route: 'progress',\n icon: <Scale className=\"h-4 w-4\" />,\n label: 'Body weight',\n value: daily.filter((d) => d.weight != null).length,\n unit: 'days logged',\n detail: 'weight readings only',\n },\n ];\n\n return (\n <Section\n title=\"What these numbers are built on\"\n description=\"The logs feeding the charts above. Gaps here are why a trend can look flat.\"\n >\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4\">\n {sources.map((source) => (\n <GlassCard key={source.route} treatment=\"plain\" className=\"flex flex-col gap-3 p-5\">\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"flex min-w-0 items-center gap-2 text-text-secondary\">\n {source.icon}\n <span className=\"truncate text-sm font-medium text-text-primary\">\n {source.label}\n </span>\n </div>\n <Button variant=\"ghost\" size=\"sm\" onClick={() => onOpen(source.route)}>\n View\n </Button>\n </div>\n <div>\n <p className=\"text-2xl font-bold tabular-nums text-text-primary\">\n {formatNumber(source.value)}\n </p>\n <p className=\"text-xs text-text-secondary\">{source.unit}</p>\n <p className=\"mt-1 text-xs text-text-tertiary\">{source.detail}</p>\n </div>\n </GlassCard>\n ))}\n </div>\n </Section>\n );\n}\n\nfunction useInsightsRange(days: RangeDays) {\n return useMemo(() => {\n const end = new Date();\n const start = new Date();\n start.setDate(end.getDate() - days + 1);\n return {\n dateRangeStart: toISODate(start),\n dateRangeEnd: toISODate(end),\n };\n }, [days]);\n}\n\nexport function InsightsPage() {\n const { workspaceId, navigateTo } = useMyBodyShield();\n const [days, setDays] = useState<RangeDays>(30);\n const range = useInsightsRange(days);\n const insights = useMybInsights(range);\n const analytics = useMyBodyShieldAnalytics();\n\n // Emit a page-view event once on mount.\n useEffect(() => {\n analytics.emitPageView('insights', { workspaceId });\n }, [analytics, workspaceId]);\n\n if (insights.isLoading) {\n return (\n <PageLayout title=\"Insights\">\n <LoadingView label=\"Loading insights…\" />\n </PageLayout>\n );\n }\n\n if (insights.isError) {\n return (\n <PageLayout title=\"Insights\">\n <ErrorView\n title=\"Could not load insights\"\n message={insights.error instanceof Error ? insights.error.message : 'Unknown error'}\n onRetry={() => insights.refetch()}\n />\n </PageLayout>\n );\n }\n\n const data = insights.data;\n if (!data) {\n return (\n <PageLayout title=\"Insights\">\n <ErrorView\n title=\"Could not load insights\"\n message=\"No insight data was returned.\"\n onRetry={() => insights.refetch()}\n />\n </PageLayout>\n );\n }\n\n const { summary, daily, goals } = data;\n\n // `daily` carries one row per calendar day in the range, zero-filled by the\n // service for days with nothing logged — so `daily.length` is the range\n // length, not a measure of tracking. Count the days that actually carry data.\n const daysWithData = daily.filter(hasAnyData).length;\n\n const dayColumns: Column<MybInsightsDay>[] = [\n {\n key: 'date',\n header: 'Date',\n render: (r) => <span className=\"text-text-primary\">{formatDate(r.date)}</span>,\n },\n {\n key: 'sessions',\n header: 'Sessions',\n align: 'right',\n render: (r) => <span className=\"tabular-nums text-text-secondary\">{r.sessions}</span>,\n },\n {\n key: 'volumeKg',\n header: 'Volume',\n align: 'right',\n render: (r) => (\n <span className=\"tabular-nums text-text-secondary\">{formatWeight(r.volumeKg)}</span>\n ),\n },\n {\n key: 'readiness',\n header: 'Readiness',\n align: 'right',\n render: (r) => (\n <span className=\"tabular-nums text-text-secondary\">\n {r.readiness != null ? formatNumber(r.readiness) : '—'}\n </span>\n ),\n },\n {\n key: 'sleepHours',\n header: 'Sleep',\n align: 'right',\n render: (r) => (\n <span className=\"tabular-nums text-text-secondary\">\n {r.sleepHours != null ? `${formatNumber(r.sleepHours)} h` : '—'}\n </span>\n ),\n },\n {\n key: 'calories',\n header: 'Calories',\n align: 'right',\n render: (r) => (\n <span className=\"tabular-nums text-text-secondary\">{formatKcal(r.calories)}</span>\n ),\n },\n {\n key: 'proteinG',\n header: 'Protein',\n align: 'right',\n render: (r) => (\n <span className=\"tabular-nums text-text-secondary\">{formatGrams(r.proteinG)}</span>\n ),\n },\n {\n key: 'weight',\n header: 'Weight',\n align: 'right',\n render: (r) => (\n <span className=\"tabular-nums text-text-secondary\">\n {r.weight != null ? formatWeight(r.weight) : '—'}\n </span>\n ),\n },\n ];\n\n const goalColumns: Column<MybGoal>[] = [\n {\n key: 'title',\n header: 'Goal',\n render: (r) => (\n <div>\n <span className=\"block text-sm text-text-primary\">{r.title}</span>\n <span className=\"text-xs text-text-tertiary\">{formatEnumLabel(r.type)}</span>\n </div>\n ),\n },\n {\n key: 'status',\n header: 'Status',\n render: (r) => (\n <span\n className={`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${\n r.status === 'ACHIEVED'\n ? 'bg-status-success-bg text-status-success-text'\n : 'bg-status-warning-bg text-status-warning-text'\n }`}\n >\n {formatEnumLabel(r.status)}\n </span>\n ),\n },\n {\n key: 'progress',\n header: 'Progress',\n align: 'right',\n render: (r) => (\n <span className=\"tabular-nums text-text-secondary\">\n {formatNumber(r.currentValue)} / {formatNumber(r.targetValue)} {r.unit}\n </span>\n ),\n },\n ];\n\n return (\n <PageLayout\n title=\"Insights\"\n description={`${formatDate(data.dateRangeStart)} – ${formatDate(data.dateRangeEnd)}`}\n >\n {/* Range selector */}\n <div className=\"flex flex-wrap items-center gap-2\">\n {RANGE_OPTIONS.map((opt) => (\n <button\n key={opt.days}\n type=\"button\"\n onClick={() => setDays(opt.days)}\n className={`rounded-lg px-3 py-1.5 text-sm font-medium transition-colors ${\n days === opt.days\n ? 'bg-accent text-white'\n : 'bg-bg-sunken text-text-secondary hover:bg-bg-elevated'\n }`}\n >\n {opt.label}\n </button>\n ))}\n </div>\n\n {/* Summary KPIs */}\n <Section title=\"Summary\">\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n <MetricsCard\n icon={<Flame className=\"h-5 w-5\" />}\n value={summary.consistencyStreakDays}\n label=\"Consistency streak\"\n />\n <MetricsCard\n icon={<Dumbbell className=\"h-5 w-5\" />}\n value={summary.totalSessions}\n label=\"Total sessions\"\n />\n <MetricsCard\n icon={<TrendingUp className=\"h-5 w-5\" />}\n value={formatWeight(summary.totalVolumeKg)}\n label=\"Total volume\"\n />\n <MetricsCard\n icon={<HeartPulse className=\"h-5 w-5\" />}\n value={formatNumber(summary.averageReadiness)}\n label=\"Average readiness\"\n />\n <MetricsCard\n icon={<Utensils className=\"h-5 w-5\" />}\n value={formatPercent(summary.macroAdherencePercent)}\n label=\"Macro adherence\"\n />\n <MetricsCard\n icon={<Calendar className=\"h-5 w-5\" />}\n value={daysWithData}\n label=\"Days with data\"\n footer={\n <p className=\"text-xs text-text-tertiary\">of {daily.length} days in this range</p>\n }\n />\n </div>\n </Section>\n\n {/* Evidence behind the numbers */}\n <InsightsSources daily={daily} summary={summary} onOpen={navigateTo} />\n\n {/* Trends */}\n <Section title=\"Trends\" description=\"How training, recovery and nutrition move together.\">\n <div className=\"grid grid-cols-1 gap-6 xl:grid-cols-2\">\n <VolumeChart daily={daily} />\n <ReadinessSleepChart daily={daily} />\n <MacroChart daily={daily} />\n <CalorieChart daily={daily} />\n </div>\n </Section>\n\n {/* Correlations */}\n <CorrelationView daily={daily} />\n\n {/* Daily breakdown */}\n <Section title=\"Daily breakdown\" description=\"Per-day training, recovery and nutrition.\">\n <GlassCard treatment=\"plain\" className=\"overflow-hidden p-0\">\n <DataTable\n columns={dayColumns}\n rows={daily}\n rowKey={(r) => r.date}\n defaultSort={{ key: 'date', dir: 'desc' }}\n />\n </GlassCard>\n </Section>\n\n {/* Active goals */}\n <Section title=\"Active goals\" description=\"Goals open during this period.\">\n {goals.length === 0 ? (\n <GlassCard treatment=\"plain\" className=\"p-8 text-center\">\n <Target className=\"mx-auto h-8 w-8 text-text-tertiary\" />\n <p className=\"mt-3 text-sm font-medium text-text-primary\">No active goals</p>\n <p className=\"mt-1 text-xs text-text-tertiary\">Create a goal to see progress here.</p>\n </GlassCard>\n ) : (\n <GlassCard treatment=\"plain\" className=\"overflow-hidden p-0\">\n <DataTable\n columns={goalColumns}\n rows={goals}\n rowKey={(r) => r.id}\n defaultSort={{ key: 'status', dir: 'asc' }}\n />\n </GlassCard>\n )}\n </Section>\n\n {/* Legend */}\n <div className=\"flex flex-wrap gap-4 text-xs text-text-tertiary\">\n <span className=\"inline-flex items-center gap-1.5\">\n <Dumbbell className=\"h-3.5 w-3.5\" />\n Training data from completed sessions.\n </span>\n <span className=\"inline-flex items-center gap-1.5\">\n <Moon className=\"h-3.5 w-3.5\" />\n Recovery data from recovery logs.\n </span>\n <span className=\"inline-flex items-center gap-1.5\">\n <Scale className=\"h-3.5 w-3.5\" />\n Body metrics from progress logs.\n </span>\n <span className=\"inline-flex items-center gap-1.5\">\n <BarChart3 className=\"h-3.5 w-3.5\" />\n Nutrition data from logged meals.\n </span>\n </div>\n\n <p className=\"mt-4 border-t border-border-seam pt-4 text-xs leading-relaxed text-text-tertiary\">\n General fitness information, not medical advice. MyBodyShield is not a medical device and\n does not diagnose, treat, cure or prevent any condition — talk to a qualified healthcare\n professional before changing how you train or eat.\n </p>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAsDA,IAAM,IAAgB;CACpB;EAAE,OAAO;EAAe,MAAM;EAAG;CACjC;EAAE,OAAO;EAAgB,MAAM;EAAI;CACnC;EAAE,OAAO;EAAgB,MAAM;EAAI;CACpC;AAID,SAAS,EAAU,GAAiB;AAClC,QAAO,EAAE,aAAa,CAAC,MAAM,IAAI,CAAC;;AASpC,SAAS,EAAU,GAA8B;AAC/C,QAAO,EAAI,WAAW,KAAK,EAAI,WAAW,KAAK,EAAI,SAAS,KAAK,EAAI,OAAO;;AAI9E,SAAS,EAAY,GAA8B;AACjD,QAAO,EAAI,aAAa,QAAQ,EAAI,cAAc;;AAIpD,SAAS,EAAW,GAA8B;AAChD,QAAO,EAAI,WAAW,KAAK,EAAY,EAAI,IAAI,EAAU,EAAI,IAAI,EAAI,UAAU;;AAYjF,SAAS,EAAgB,EACvB,UACA,YACA,aAKC;CACD,IAAM,IAAY,EAAM;AAoCxB,QACE,kBAAC,GAAD;EACE,OAAM;EACN,aAAY;YAEZ,kBAAC,OAAD;GAAK,WAAU;aAxCH;IACd;KACE,OAAO;KACP,MAAM,kBAAC,GA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