@burdenoff/microfe-mybodyshield 2026.705.1 → 2026.705.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.
Files changed (44) hide show
  1. package/dist/mybodyshield/components/DataTable.js +8 -4
  2. package/dist/mybodyshield/components/DataTable.js.map +1 -1
  3. package/dist/mybodyshield/components/EvidenceUpload.js +92 -4
  4. package/dist/mybodyshield/components/EvidenceUpload.js.map +1 -0
  5. package/dist/mybodyshield/components/FileLink.js +35 -2
  6. package/dist/mybodyshield/components/FileLink.js.map +1 -0
  7. package/dist/mybodyshield/components/MybDiscussion.js +107 -6
  8. package/dist/mybodyshield/components/MybDiscussion.js.map +1 -0
  9. package/dist/mybodyshield/components/MybTags.js +148 -4
  10. package/dist/mybodyshield/components/MybTags.js.map +1 -0
  11. package/dist/mybodyshield/components/Pagination.js.map +1 -1
  12. package/dist/mybodyshield/components/UserSearchSelect.js +148 -0
  13. package/dist/mybodyshield/components/UserSearchSelect.js.map +1 -0
  14. package/dist/mybodyshield/components/index.js +1 -0
  15. package/dist/mybodyshield/hooks/index.js +1 -0
  16. package/dist/mybodyshield/hooks/useMyBodyShieldApi.js +47 -27
  17. package/dist/mybodyshield/hooks/useMyBodyShieldApi.js.map +1 -1
  18. package/dist/mybodyshield/hooks/useMybComments.js +44 -2
  19. package/dist/mybodyshield/hooks/useMybComments.js.map +1 -0
  20. package/dist/mybodyshield/hooks/useMybFiles.js +80 -3
  21. package/dist/mybodyshield/hooks/useMybFiles.js.map +1 -0
  22. package/dist/mybodyshield/hooks/useMybTags.js +88 -2
  23. package/dist/mybodyshield/hooks/useMybTags.js.map +1 -0
  24. package/dist/mybodyshield/hooks/useMybUsers.js +36 -0
  25. package/dist/mybodyshield/hooks/useMybUsers.js.map +1 -0
  26. package/dist/mybodyshield/pages/DashboardPage.js +41 -36
  27. package/dist/mybodyshield/pages/DashboardPage.js.map +1 -1
  28. package/dist/mybodyshield/pages/_shared/visuals.js +15 -9
  29. package/dist/mybodyshield/pages/_shared/visuals.js.map +1 -1
  30. package/dist/mybodyshield/pages/coaching/CoachingPage.js +171 -147
  31. package/dist/mybodyshield/pages/coaching/CoachingPage.js.map +1 -1
  32. package/dist/mybodyshield/pages/goals/GoalsPage.js +0 -8
  33. package/dist/mybodyshield/pages/goals/GoalsPage.js.map +1 -1
  34. package/dist/mybodyshield/pages/nutrition/NutritionPage.js +352 -278
  35. package/dist/mybodyshield/pages/nutrition/NutritionPage.js.map +1 -1
  36. package/dist/mybodyshield/pages/programs/ProgramDetailPage.js +600 -296
  37. package/dist/mybodyshield/pages/programs/ProgramDetailPage.js.map +1 -1
  38. package/dist/mybodyshield/pages/progress/ProgressPage.js +88 -51
  39. package/dist/mybodyshield/pages/progress/ProgressPage.js.map +1 -1
  40. package/dist/mybodyshield/pages/train/SessionDetailPage.js +146 -126
  41. package/dist/mybodyshield/pages/train/SessionDetailPage.js.map +1 -1
  42. package/dist/mybodyshield/pages/train/SessionsPage.js +1 -4
  43. package/dist/mybodyshield/pages/train/SessionsPage.js.map +1 -1
  44. package/package.json +2 -2
@@ -5,7 +5,7 @@ import { StatusBadge as o } from "../../components/StatusBadge.js";
5
5
  import { ErrorView as s, LoadingView as c, Section as ne } from "../../components/StateViews.js";
6
6
  import { EmptyState as l } from "../../components/EmptyState.js";
7
7
  import { MacroBar as re, MacroLegend as ie, Meter as ae, ProgressRing as oe } from "../_shared/visuals.js";
8
- import { useMybActiveNutritionPlan as se, useMybCreateNutritionPlan as ce, useMybDailyMacros as le, useMybDeleteMeal as ue, useMybLogMeal as de, useMybMeals as fe, useMybUpdateNutritionPlan as pe } from "../../hooks/useMyBodyShieldApi.js";
8
+ import { useMybActivateNutritionPlan as se, useMybActiveNutritionPlan as ce, useMybCreateNutritionPlan as le, useMybDailyMacros as ue, useMybDeleteMeal as de, useMybLogMeal as fe, useMybMeals as u, useMybUpdateNutritionPlan as pe } from "../../hooks/useMyBodyShieldApi.js";
9
9
  import { useOffsetPager as me } from "../../hooks/usePager.js";
10
10
  import "../../hooks/index.js";
11
11
  import { DataTable as he } from "../../components/DataTable.js";
@@ -13,63 +13,64 @@ import { FilterTabs as ge } from "../../components/FilterTabs.js";
13
13
  import { Tabs as _e } from "../../components/Tabs.js";
14
14
  import { Pagination as ve } from "../../components/Pagination.js";
15
15
  import "../../components/index.js";
16
- import { useMemo as ye, useState as u } from "react";
17
- import { Beef as be, ClipboardList as d, Droplet as xe, Flame as f, Pencil as p, Plus as m, Salad as h, Trash2 as Se, UtensilsCrossed as Ce, Wheat as we } from "lucide-react";
18
- import { Fragment as Te, jsx as g, jsxs as _ } from "react/jsx-runtime";
19
- import { Button as v, GlassCard as y, Input as b, Label as x, ResponsiveDialog as S, ResponsiveDialogContent as C, ResponsiveDialogDescription as w, ResponsiveDialogFooter as T, ResponsiveDialogHeader as Ee, ResponsiveDialogTitle as De, Select as Oe, SelectContent as ke, SelectItem as Ae, SelectTrigger as je, SelectValue as Me, Textarea as Ne } from "@burdenoff/fe-libs/ui";
16
+ import { useMemo as ye, useState as d } from "react";
17
+ import { Beef as be, CheckCircle2 as xe, ClipboardList as Se, Droplet as Ce, Flame as we, Pencil as Te, Plus as f, Salad as Ee, Star as De, Trash2 as p, UtensilsCrossed as Oe, Wheat as ke } from "lucide-react";
18
+ import { Fragment as Ae, jsx as m, jsxs as h } from "react/jsx-runtime";
19
+ import { Button as g, GlassCard as _, Input as v, Label as y, ResponsiveDialog as b, ResponsiveDialogContent as je, ResponsiveDialogDescription as x, ResponsiveDialogFooter as S, ResponsiveDialogHeader as C, ResponsiveDialogTitle as Me, Select as Ne, SelectContent as Pe, SelectItem as Fe, SelectTrigger as Ie, SelectValue as Le, Switch as Re, Textarea as ze } from "@burdenoff/fe-libs/ui";
20
20
  //#region src/mybodyshield/pages/nutrition/NutritionPage.tsx
21
- var E = 25, Pe = [
21
+ var w = 25, Be = [
22
22
  "BREAKFAST",
23
23
  "LUNCH",
24
24
  "DINNER",
25
25
  "SNACK"
26
- ], Fe = [
26
+ ], Ve = [
27
27
  "WEIGHT_LOSS",
28
28
  "MUSCLE_GAIN",
29
29
  "STRENGTH",
30
30
  "ENDURANCE",
31
31
  "MOBILITY",
32
32
  "GENERAL_FITNESS"
33
- ], Ie = [
33
+ ], He = [
34
34
  {
35
35
  value: "today",
36
36
  label: "Today",
37
- icon: /* @__PURE__ */ g(f, { className: "h-4 w-4" })
37
+ icon: /* @__PURE__ */ m(we, { className: "h-4 w-4" })
38
38
  },
39
39
  {
40
40
  value: "plan",
41
41
  label: "Plan",
42
- icon: /* @__PURE__ */ g(d, { className: "h-4 w-4" })
42
+ icon: /* @__PURE__ */ m(Se, { className: "h-4 w-4" })
43
43
  },
44
44
  {
45
45
  value: "meals",
46
46
  label: "Meals",
47
- icon: /* @__PURE__ */ g(Ce, { className: "h-4 w-4" })
47
+ icon: /* @__PURE__ */ m(Oe, { className: "h-4 w-4" })
48
48
  }
49
- ], Le = [{
49
+ ], Ue = [{
50
50
  value: "ALL",
51
51
  label: "All"
52
- }, ...Pe.map((e) => ({
52
+ }, ...Be.map((e) => ({
53
53
  value: e,
54
54
  label: r(e)
55
- }))], D = (e) => {
55
+ }))], T = (e) => {
56
56
  let t = e.trim();
57
57
  if (!t) return;
58
58
  let n = Number(t);
59
59
  return Number.isFinite(n) ? n : void 0;
60
- }, O = (e) => e ? String(e) : "", Re = (e) => {
60
+ }, E = (e) => e ? String(e) : "", We = (e) => {
61
61
  if (!e) return "";
62
62
  let t = new Date(e);
63
63
  return Number.isNaN(t.getTime()) ? "" : t.toISOString().slice(0, 10);
64
- }, ze = (e) => e ? new Date(e).toISOString() : void 0, k = {
64
+ }, Ge = (e) => e ? new Date(e).toISOString() : void 0, D = {
65
65
  name: "",
66
66
  mealType: "BREAKFAST",
67
67
  calories: "",
68
68
  proteinG: "",
69
69
  carbsG: "",
70
70
  fatG: "",
71
- servings: ""
72
- }, A = {
71
+ servings: "",
72
+ isFavorite: !1
73
+ }, Ke = {
73
74
  name: "",
74
75
  goalType: "GENERAL_FITNESS",
75
76
  calorieTarget: "",
@@ -80,59 +81,60 @@ var E = 25, Pe = [
80
81
  endDate: "",
81
82
  notes: ""
82
83
  };
83
- function j() {
84
- let [j, Be] = u("today"), M = le(), N = se(), P = fe({}), [F, Ve] = u("ALL"), I = me(E), L = fe({
85
- mealType: F === "ALL" ? void 0 : F,
84
+ function O() {
85
+ let [O, qe] = d("today"), k = ue(), A = ce(), j = u({}), [M, Je] = d("ALL"), N = me(w), P = u({
86
+ mealType: M === "ALL" ? void 0 : M,
86
87
  pagination: {
87
- limit: E,
88
- offset: I.offset
88
+ limit: w,
89
+ offset: N.offset
89
90
  }
90
- }), R = de(), He = ue(), Ue = ce(), We = pe(), [Ge, Ke] = u(null), [qe, Je] = u(null), [Ye, z] = u(!1), [B, V] = u(k), [Xe, H] = u(null), [Ze, U] = u(!1), [W, Qe] = u("create"), [G, K] = u(A), [$e, q] = u(null), J = N.data ?? null, Y = ye(() => {
91
- let e = P.data?.items ?? [], t = (/* @__PURE__ */ new Date()).toDateString();
91
+ }), F = fe(), Ye = de(), Xe = le(), Ze = pe(), I = se(), [Qe, L] = d(null), [$e, et] = d(null), [tt, R] = d(null), [nt, z] = d(!1), [B, V] = d(D), [rt, H] = d(null), [it, U] = d(!1), [W, at] = d("create"), [G, K] = d(Ke), [ot, q] = d(null), st = A.data ?? null, J = tt ?? st, Y = ye(() => {
92
+ let e = j.data?.items ?? [], t = (/* @__PURE__ */ new Date()).toDateString();
92
93
  return e.filter((e) => {
93
94
  let n = new Date(e.loggedAt);
94
95
  return !Number.isNaN(n.getTime()) && n.toDateString() === t;
95
96
  }).sort((e, t) => new Date(t.loggedAt).getTime() - new Date(e.loggedAt).getTime());
96
- }, [P.data]), X = L.data?.items ?? [], et = (e) => {
97
- Ve(e), I.reset();
97
+ }, [j.data]), X = P.data?.items ?? [], ct = (e) => {
98
+ Je(e), N.reset();
98
99
  }, Z = () => {
99
- V(k), H(null), z(!0);
100
- }, Q = () => {
101
- Qe("create"), K(A), q(null), U(!0);
102
- }, tt = () => {
103
- J && (Qe("edit"), K({
100
+ V(D), H(null), z(!0);
101
+ }, lt = () => {
102
+ at("create"), K(Ke), q(null), U(!0);
103
+ }, ut = () => {
104
+ J && (at("edit"), K({
104
105
  name: J.name,
105
106
  goalType: J.goalType,
106
- calorieTarget: O(J.calorieTarget),
107
- proteinTarget: O(J.proteinTarget),
108
- carbsTarget: O(J.carbsTarget),
109
- fatTarget: O(J.fatTarget),
110
- startDate: Re(J.startDate),
111
- endDate: Re(J.endDate),
107
+ calorieTarget: E(J.calorieTarget),
108
+ proteinTarget: E(J.proteinTarget),
109
+ carbsTarget: E(J.carbsTarget),
110
+ fatTarget: E(J.fatTarget),
111
+ startDate: We(J.startDate),
112
+ endDate: We(J.endDate),
112
113
  notes: J.notes ?? ""
113
114
  }), q(null), U(!0));
114
- }, nt = async () => {
115
+ }, dt = async () => {
115
116
  if (!B.name.trim()) {
116
117
  H("Meal name is required.");
117
118
  return;
118
119
  }
119
120
  H(null);
120
121
  try {
121
- await R.mutateAsync({
122
+ await F.mutateAsync({
122
123
  name: B.name.trim(),
123
124
  mealType: B.mealType,
124
- calories: D(B.calories),
125
- proteinG: D(B.proteinG),
126
- carbsG: D(B.carbsG),
127
- fatG: D(B.fatG),
128
- servings: D(B.servings),
125
+ calories: T(B.calories),
126
+ proteinG: T(B.proteinG),
127
+ carbsG: T(B.carbsG),
128
+ fatG: T(B.fatG),
129
+ servings: T(B.servings),
130
+ isFavorite: B.isFavorite,
129
131
  planId: J?.id ?? void 0,
130
132
  loggedAt: (/* @__PURE__ */ new Date()).toISOString()
131
- }), z(!1), V(k);
133
+ }), z(!1), V(D);
132
134
  } catch (e) {
133
135
  H(e instanceof Error ? e.message : "Failed to log meal.");
134
136
  }
135
- }, rt = async () => {
137
+ }, ft = async () => {
136
138
  if (!G.name.trim()) {
137
139
  q("Plan name is required.");
138
140
  return;
@@ -140,112 +142,123 @@ function j() {
140
142
  q(null);
141
143
  let e = {
142
144
  goalType: G.goalType,
143
- calorieTarget: D(G.calorieTarget),
144
- proteinTarget: D(G.proteinTarget),
145
- carbsTarget: D(G.carbsTarget),
146
- fatTarget: D(G.fatTarget),
147
- startDate: ze(G.startDate),
148
- endDate: ze(G.endDate),
145
+ calorieTarget: T(G.calorieTarget),
146
+ proteinTarget: T(G.proteinTarget),
147
+ carbsTarget: T(G.carbsTarget),
148
+ fatTarget: T(G.fatTarget),
149
+ startDate: Ge(G.startDate),
150
+ endDate: Ge(G.endDate),
149
151
  notes: G.notes.trim() || void 0
150
152
  };
151
153
  try {
152
- W === "edit" && J ? await We.mutateAsync({
153
- id: J.id,
154
- input: {
155
- name: G.name.trim(),
156
- ...e
157
- }
158
- }) : await Ue.mutateAsync({
154
+ if (W === "edit" && J) {
155
+ let t = await Ze.mutateAsync({
156
+ id: J.id,
157
+ input: {
158
+ name: G.name.trim(),
159
+ ...e
160
+ }
161
+ });
162
+ R((e) => e && e.id === t.id ? t : e);
163
+ } else R(await Xe.mutateAsync({
159
164
  name: G.name.trim(),
160
165
  ...e
161
- }), U(!1);
166
+ })), qe("plan");
167
+ U(!1);
162
168
  } catch (e) {
163
169
  q(e instanceof Error ? e.message : "Failed to save plan.");
164
170
  }
165
- }, it = async (e) => {
171
+ }, pt = async (e) => {
172
+ L(null);
173
+ try {
174
+ await I.mutateAsync(e), R(null);
175
+ } catch (e) {
176
+ L(e instanceof Error ? e.message : "Failed to activate plan.");
177
+ }
178
+ }, Q = async (e) => {
166
179
  if (window.confirm("Delete this meal log? This cannot be undone.")) {
167
- Je(e), Ke(null);
180
+ et(e), L(null);
168
181
  try {
169
- await He.mutateAsync(e);
182
+ await Ye.mutateAsync(e);
170
183
  } catch (e) {
171
- Ke(e instanceof Error ? e.message : "Failed to delete meal.");
184
+ L(e instanceof Error ? e.message : "Failed to delete meal.");
172
185
  } finally {
173
- Je(null);
186
+ et(null);
174
187
  }
175
188
  }
176
- }, $ = W === "edit" ? We.isPending : Ue.isPending;
177
- return /* @__PURE__ */ _(e, {
189
+ }, $ = W === "edit" ? Ze.isPending : Xe.isPending;
190
+ return /* @__PURE__ */ h(e, {
178
191
  title: "Nutrition",
179
192
  description: "Plans, meal logging and daily macro targets.",
180
- actions: j === "today" ? /* @__PURE__ */ _(v, {
193
+ actions: O === "today" ? /* @__PURE__ */ h(g, {
181
194
  onClick: Z,
182
- children: [/* @__PURE__ */ g(m, { className: "mr-1.5 h-4 w-4" }), " Log meal"]
183
- }) : j === "plan" ? /* @__PURE__ */ _("div", {
195
+ children: [/* @__PURE__ */ m(f, { className: "mr-1.5 h-4 w-4" }), " Log meal"]
196
+ }) : O === "plan" ? /* @__PURE__ */ h("div", {
184
197
  className: "flex flex-wrap items-center gap-2",
185
- children: [J && /* @__PURE__ */ _(v, {
198
+ children: [J && /* @__PURE__ */ h(g, {
186
199
  variant: "outline",
187
- onClick: tt,
188
- children: [/* @__PURE__ */ g(p, { className: "mr-1.5 h-4 w-4" }), " Edit targets"]
189
- }), /* @__PURE__ */ _(v, {
190
- onClick: Q,
191
- children: [/* @__PURE__ */ g(m, { className: "mr-1.5 h-4 w-4" }), " Create plan"]
200
+ onClick: ut,
201
+ children: [/* @__PURE__ */ m(Te, { className: "mr-1.5 h-4 w-4" }), " Edit targets"]
202
+ }), /* @__PURE__ */ h(g, {
203
+ onClick: lt,
204
+ children: [/* @__PURE__ */ m(f, { className: "mr-1.5 h-4 w-4" }), " Create plan"]
192
205
  })]
193
206
  }) : void 0,
194
207
  children: [
195
- /* @__PURE__ */ g(_e, {
196
- items: Ie,
197
- value: j,
198
- onChange: Be,
208
+ /* @__PURE__ */ m(_e, {
209
+ items: He,
210
+ value: O,
211
+ onChange: qe,
199
212
  className: "mb-6"
200
213
  }),
201
- Ge && /* @__PURE__ */ g("div", {
214
+ Qe && /* @__PURE__ */ m("div", {
202
215
  className: "mb-4 rounded-lg border border-status-error-text/40 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
203
- children: Ge
216
+ children: Qe
204
217
  }),
205
- j === "today" && (() => {
206
- if (M.isLoading) return /* @__PURE__ */ g(c, { label: "Loading today's nutrition…" });
207
- if (M.isError) return /* @__PURE__ */ g(s, {
218
+ O === "today" && (() => {
219
+ if (k.isLoading) return /* @__PURE__ */ m(c, { label: "Loading today's nutrition…" });
220
+ if (k.isError) return /* @__PURE__ */ m(s, {
208
221
  message: "We couldn't load your daily macros.",
209
- onRetry: () => M.refetch()
222
+ onRetry: () => k.refetch()
210
223
  });
211
- let e = M.data;
212
- if (!e) return /* @__PURE__ */ g(c, { label: "Loading today's nutrition…" });
224
+ let e = k.data;
225
+ if (!e) return /* @__PURE__ */ m(c, { label: "Loading today's nutrition…" });
213
226
  let t = e.calorieTarget > 0, n = e.calories > 0 || Y.length > 0;
214
- if (!t && !n) return /* @__PURE__ */ g(l, {
227
+ if (!t && !n) return /* @__PURE__ */ m(l, {
215
228
  illustration: "empty-data",
216
- icon: /* @__PURE__ */ g(h, { className: "h-10 w-10" }),
229
+ icon: /* @__PURE__ */ m(Ee, { className: "h-10 w-10" }),
217
230
  title: "No nutrition tracked yet",
218
231
  description: "Activate a nutrition plan or log your first meal to start tracking daily macros.",
219
- action: /* @__PURE__ */ _(v, {
232
+ action: /* @__PURE__ */ h(g, {
220
233
  onClick: Z,
221
- children: [/* @__PURE__ */ g(m, { className: "mr-1.5 h-4 w-4" }), " Log meal"]
234
+ children: [/* @__PURE__ */ m(f, { className: "mr-1.5 h-4 w-4" }), " Log meal"]
222
235
  })
223
236
  });
224
237
  let r = e.calorieTarget ? e.calories / e.calorieTarget * 100 : 0;
225
- return /* @__PURE__ */ _("div", {
238
+ return /* @__PURE__ */ h("div", {
226
239
  className: "space-y-6",
227
- children: [/* @__PURE__ */ _(y, {
240
+ children: [/* @__PURE__ */ h(_, {
228
241
  treatment: "glass",
229
242
  className: "p-6",
230
- children: [/* @__PURE__ */ _("div", {
243
+ children: [/* @__PURE__ */ h("div", {
231
244
  className: "mb-4",
232
- children: [/* @__PURE__ */ g("h2", {
245
+ children: [/* @__PURE__ */ m("h2", {
233
246
  className: "text-base font-semibold text-text-primary",
234
247
  children: "Today's macros"
235
- }), /* @__PURE__ */ g("p", {
248
+ }), /* @__PURE__ */ m("p", {
236
249
  className: "mt-0.5 text-sm text-text-secondary",
237
250
  children: "Calories & macros logged against your active plan."
238
251
  })]
239
- }), /* @__PURE__ */ _("div", {
252
+ }), /* @__PURE__ */ h("div", {
240
253
  className: "flex flex-col gap-6 sm:flex-row sm:items-center",
241
- children: [/* @__PURE__ */ _(oe, {
254
+ children: [/* @__PURE__ */ h(oe, {
242
255
  value: r,
243
256
  size: 128,
244
257
  stroke: 12,
245
- children: [/* @__PURE__ */ g("span", {
258
+ children: [/* @__PURE__ */ m("span", {
246
259
  className: "text-xl font-bold tabular-nums text-text-primary",
247
260
  children: a(e.calories)
248
- }), /* @__PURE__ */ _("span", {
261
+ }), /* @__PURE__ */ h("span", {
249
262
  className: "text-xs text-text-tertiary",
250
263
  children: [
251
264
  "/ ",
@@ -253,17 +266,17 @@ function j() {
253
266
  " kcal"
254
267
  ]
255
268
  })]
256
- }), /* @__PURE__ */ _("div", {
269
+ }), /* @__PURE__ */ h("div", {
257
270
  className: "flex-1 space-y-4",
258
- children: [/* @__PURE__ */ _("div", {
271
+ children: [/* @__PURE__ */ h("div", {
259
272
  className: "space-y-2",
260
- children: [/* @__PURE__ */ g(re, {
273
+ children: [/* @__PURE__ */ m(re, {
261
274
  proteinG: e.proteinG,
262
275
  carbsG: e.carbsG,
263
276
  fatG: e.fatG,
264
277
  height: 10
265
- }), /* @__PURE__ */ g(ie, {})]
266
- }), /* @__PURE__ */ g("div", {
278
+ }), /* @__PURE__ */ m(ie, {})]
279
+ }), /* @__PURE__ */ m("div", {
267
280
  className: "grid grid-cols-3 gap-3",
268
281
  children: [
269
282
  [
@@ -281,16 +294,16 @@ function j() {
281
294
  e.fatG,
282
295
  e.fatTarget
283
296
  ]
284
- ].map(([e, t, n]) => /* @__PURE__ */ _("div", {
297
+ ].map(([e, t, n]) => /* @__PURE__ */ h("div", {
285
298
  className: "rounded-xl bg-bg-sunken/60 p-3",
286
299
  children: [
287
- /* @__PURE__ */ g("p", {
300
+ /* @__PURE__ */ m("p", {
288
301
  className: "text-xs text-text-tertiary",
289
302
  children: e
290
303
  }),
291
- /* @__PURE__ */ _("p", {
304
+ /* @__PURE__ */ h("p", {
292
305
  className: "mt-0.5 text-sm font-semibold tabular-nums text-text-primary",
293
- children: [a(t), /* @__PURE__ */ _("span", {
306
+ children: [a(t), /* @__PURE__ */ h("span", {
294
307
  className: "text-xs font-normal text-text-tertiary",
295
308
  children: [
296
309
  " ",
@@ -300,7 +313,7 @@ function j() {
300
313
  ]
301
314
  })]
302
315
  }),
303
- /* @__PURE__ */ g(ae, {
316
+ /* @__PURE__ */ m(ae, {
304
317
  value: n ? t / n * 100 : 0,
305
318
  height: 4,
306
319
  className: "mt-2"
@@ -310,34 +323,34 @@ function j() {
310
323
  })]
311
324
  })]
312
325
  })]
313
- }), /* @__PURE__ */ g(ne, {
326
+ }), /* @__PURE__ */ m(ne, {
314
327
  title: "Today's meals",
315
328
  description: "Everything you've logged today.",
316
- children: P.isLoading ? /* @__PURE__ */ g(c, { label: "Loading meals…" }) : P.isError ? /* @__PURE__ */ g(s, {
329
+ children: j.isLoading ? /* @__PURE__ */ m(c, { label: "Loading meals…" }) : j.isError ? /* @__PURE__ */ m(s, {
317
330
  message: "We couldn't load today's meals.",
318
- onRetry: () => P.refetch()
319
- }) : Y.length === 0 ? /* @__PURE__ */ g(l, {
331
+ onRetry: () => j.refetch()
332
+ }) : Y.length === 0 ? /* @__PURE__ */ m(l, {
320
333
  illustration: "empty-data",
321
- icon: /* @__PURE__ */ g(h, { className: "h-10 w-10" }),
334
+ icon: /* @__PURE__ */ m(Ee, { className: "h-10 w-10" }),
322
335
  title: "No meals logged today",
323
336
  description: "Use “Log meal” to record what you've eaten and keep your macros current.",
324
- action: /* @__PURE__ */ _(v, {
337
+ action: /* @__PURE__ */ h(g, {
325
338
  onClick: Z,
326
- children: [/* @__PURE__ */ g(m, { className: "mr-1.5 h-4 w-4" }), " Log meal"]
339
+ children: [/* @__PURE__ */ m(f, { className: "mr-1.5 h-4 w-4" }), " Log meal"]
327
340
  })
328
- }) : /* @__PURE__ */ g(y, {
341
+ }) : /* @__PURE__ */ m(_, {
329
342
  treatment: "plain",
330
343
  className: "divide-y divide-border-seam/60 px-4",
331
- children: Y.map((e) => /* @__PURE__ */ _("div", {
344
+ children: Y.map((e) => /* @__PURE__ */ h("div", {
332
345
  className: "flex items-center gap-3 py-3",
333
346
  children: [
334
- /* @__PURE__ */ g(o, { status: e.mealType }),
335
- /* @__PURE__ */ _("div", {
347
+ /* @__PURE__ */ m(o, { status: e.mealType }),
348
+ /* @__PURE__ */ h("div", {
336
349
  className: "min-w-0 flex-1",
337
- children: [/* @__PURE__ */ g("p", {
350
+ children: [/* @__PURE__ */ m("p", {
338
351
  className: "truncate text-sm font-medium text-text-primary",
339
352
  children: e.name
340
- }), /* @__PURE__ */ _("p", {
353
+ }), /* @__PURE__ */ h("p", {
341
354
  className: "text-xs text-text-tertiary",
342
355
  children: [
343
356
  i(e.proteinG),
@@ -353,18 +366,18 @@ function j() {
353
366
  ]
354
367
  })]
355
368
  }),
356
- /* @__PURE__ */ g("span", {
369
+ /* @__PURE__ */ m("span", {
357
370
  className: "shrink-0 text-sm font-semibold tabular-nums text-text-primary",
358
371
  children: ee(e.calories)
359
372
  }),
360
- /* @__PURE__ */ g(v, {
373
+ /* @__PURE__ */ m(g, {
361
374
  variant: "ghost",
362
375
  size: "icon-sm",
363
- onClick: () => it(e.id),
364
- disabled: qe === e.id,
376
+ onClick: () => Q(e.id),
377
+ disabled: $e === e.id,
365
378
  "aria-label": "Delete meal",
366
379
  className: "shrink-0",
367
- children: /* @__PURE__ */ g(Se, { className: "h-4 w-4 text-status-error-text" })
380
+ children: /* @__PURE__ */ m(p, { className: "h-4 w-4 text-status-error-text" })
368
381
  })
369
382
  ]
370
383
  }, e.id))
@@ -372,89 +385,116 @@ function j() {
372
385
  })]
373
386
  });
374
387
  })(),
375
- j === "plan" && (() => {
376
- if (N.isLoading) return /* @__PURE__ */ g(c, { label: "Loading your nutrition plan…" });
377
- if (N.isError) return /* @__PURE__ */ g(s, {
388
+ O === "plan" && (() => {
389
+ if (A.isLoading) return /* @__PURE__ */ m(c, { label: "Loading your nutrition plan…" });
390
+ if (A.isError) return /* @__PURE__ */ m(s, {
378
391
  message: "We couldn't load your active nutrition plan.",
379
- onRetry: () => N.refetch()
392
+ onRetry: () => A.refetch()
380
393
  });
381
- if (!J) return /* @__PURE__ */ g(l, {
394
+ if (!J) return /* @__PURE__ */ m(l, {
382
395
  illustration: "empty-data",
383
- icon: /* @__PURE__ */ g(d, { className: "h-10 w-10" }),
396
+ icon: /* @__PURE__ */ m(Se, { className: "h-10 w-10" }),
384
397
  title: "No active nutrition plan",
385
398
  description: "Create a nutrition plan to set your daily calorie and macro targets.",
386
- action: /* @__PURE__ */ _(v, {
387
- onClick: Q,
388
- children: [/* @__PURE__ */ g(m, { className: "mr-1.5 h-4 w-4" }), " Create plan"]
399
+ action: /* @__PURE__ */ h(g, {
400
+ onClick: lt,
401
+ children: [/* @__PURE__ */ m(f, { className: "mr-1.5 h-4 w-4" }), " Create plan"]
389
402
  })
390
403
  });
391
404
  let e = [
392
405
  {
393
- icon: /* @__PURE__ */ g(f, { className: "h-5 w-5" }),
406
+ icon: /* @__PURE__ */ m(we, { className: "h-5 w-5" }),
394
407
  label: "Calorie target",
395
408
  value: J.calorieTarget ? `${a(J.calorieTarget)} kcal` : "—"
396
409
  },
397
410
  {
398
- icon: /* @__PURE__ */ g(be, { className: "h-5 w-5" }),
411
+ icon: /* @__PURE__ */ m(be, { className: "h-5 w-5" }),
399
412
  label: "Protein target",
400
413
  value: J.proteinTarget ? i(J.proteinTarget) : "—"
401
414
  },
402
415
  {
403
- icon: /* @__PURE__ */ g(we, { className: "h-5 w-5" }),
416
+ icon: /* @__PURE__ */ m(ke, { className: "h-5 w-5" }),
404
417
  label: "Carbs target",
405
418
  value: J.carbsTarget ? i(J.carbsTarget) : "—"
406
419
  },
407
420
  {
408
- icon: /* @__PURE__ */ g(xe, { className: "h-5 w-5" }),
421
+ icon: /* @__PURE__ */ m(Ce, { className: "h-5 w-5" }),
409
422
  label: "Fat target",
410
423
  value: J.fatTarget ? i(J.fatTarget) : "—"
411
424
  }
412
425
  ];
413
- return /* @__PURE__ */ _("div", {
426
+ return /* @__PURE__ */ h("div", {
414
427
  className: "space-y-6",
415
428
  children: [
416
- /* @__PURE__ */ g(y, {
429
+ !J.isActive && /* @__PURE__ */ h("div", {
430
+ className: "flex flex-wrap items-center justify-between gap-3 rounded-xl border border-border-seam bg-bg-sunken/60 px-4 py-3",
431
+ children: [/* @__PURE__ */ h("div", {
432
+ className: "min-w-0",
433
+ children: [/* @__PURE__ */ m("p", {
434
+ className: "text-sm font-medium text-text-primary",
435
+ children: "This plan isn't active yet"
436
+ }), /* @__PURE__ */ m("p", {
437
+ className: "text-xs text-text-secondary",
438
+ children: "Activate it to track today's macros against these targets."
439
+ })]
440
+ }), /* @__PURE__ */ h(g, {
441
+ onClick: () => pt(J.id),
442
+ disabled: I.isPending,
443
+ children: [/* @__PURE__ */ m(xe, { className: "mr-1.5 h-4 w-4" }), I.isPending ? "Activating…" : "Activate this plan"]
444
+ })]
445
+ }),
446
+ /* @__PURE__ */ m(_, {
417
447
  treatment: "glass",
418
448
  className: "p-6",
419
- children: /* @__PURE__ */ _("div", {
449
+ children: /* @__PURE__ */ h("div", {
420
450
  className: "flex flex-wrap items-start justify-between gap-3",
421
- children: [/* @__PURE__ */ _("div", {
451
+ children: [/* @__PURE__ */ h("div", {
422
452
  className: "min-w-0",
423
- children: [/* @__PURE__ */ g("h2", {
453
+ children: [/* @__PURE__ */ m("h2", {
424
454
  className: "text-lg font-semibold text-text-primary",
425
455
  children: J.name
426
- }), /* @__PURE__ */ _("div", {
456
+ }), /* @__PURE__ */ h("div", {
427
457
  className: "mt-2 flex flex-wrap items-center gap-2",
428
- children: [/* @__PURE__ */ g(o, { status: J.goalType }), (J.startDate || J.endDate) && /* @__PURE__ */ _("span", {
429
- className: "text-sm text-text-secondary",
430
- children: [
431
- n(J.startDate),
432
- " – ",
433
- n(J.endDate)
434
- ]
435
- })]
458
+ children: [
459
+ J.isActive ? /* @__PURE__ */ h("span", {
460
+ className: "inline-flex items-center gap-1 rounded-full bg-status-success-bg-subtle px-2.5 py-0.5 text-xs font-medium text-status-success-text",
461
+ children: [/* @__PURE__ */ m(xe, { className: "h-3.5 w-3.5" }), " Active"]
462
+ }) : /* @__PURE__ */ m("span", {
463
+ className: "inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary",
464
+ children: "Inactive"
465
+ }),
466
+ /* @__PURE__ */ m(o, { status: J.goalType }),
467
+ (J.startDate || J.endDate) && /* @__PURE__ */ h("span", {
468
+ className: "text-sm text-text-secondary",
469
+ children: [
470
+ n(J.startDate),
471
+ " – ",
472
+ n(J.endDate)
473
+ ]
474
+ })
475
+ ]
436
476
  })]
437
- }), /* @__PURE__ */ _(v, {
477
+ }), /* @__PURE__ */ h(g, {
438
478
  variant: "outline",
439
- onClick: tt,
440
- children: [/* @__PURE__ */ g(p, { className: "mr-1.5 h-4 w-4" }), " Edit targets"]
479
+ onClick: ut,
480
+ children: [/* @__PURE__ */ m(Te, { className: "mr-1.5 h-4 w-4" }), " Edit targets"]
441
481
  })]
442
482
  })
443
483
  }),
444
- /* @__PURE__ */ g("div", {
484
+ /* @__PURE__ */ m("div", {
445
485
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
446
- children: e.map((e) => /* @__PURE__ */ g(t, {
486
+ children: e.map((e) => /* @__PURE__ */ m(t, {
447
487
  icon: e.icon,
448
488
  value: e.value,
449
489
  label: e.label
450
490
  }, e.label))
451
491
  }),
452
- J.notes && /* @__PURE__ */ g(ne, {
492
+ J.notes && /* @__PURE__ */ m(ne, {
453
493
  title: "Notes",
454
- children: /* @__PURE__ */ g(y, {
494
+ children: /* @__PURE__ */ m(_, {
455
495
  treatment: "plain",
456
496
  className: "p-4",
457
- children: /* @__PURE__ */ g("p", {
497
+ children: /* @__PURE__ */ m("p", {
458
498
  className: "whitespace-pre-wrap text-sm text-text-secondary",
459
499
  children: J.notes
460
500
  })
@@ -463,30 +503,43 @@ function j() {
463
503
  ]
464
504
  });
465
505
  })(),
466
- j === "meals" && (L.isLoading ? /* @__PURE__ */ g(c, { label: "Loading meal log…" }) : L.isError ? /* @__PURE__ */ g(s, {
506
+ O === "meals" && (P.isLoading ? /* @__PURE__ */ m(c, { label: "Loading meal log…" }) : P.isError ? /* @__PURE__ */ m(s, {
467
507
  message: "We couldn't load your meal log.",
468
- onRetry: () => L.refetch()
469
- }) : /* @__PURE__ */ _("div", {
508
+ onRetry: () => P.refetch()
509
+ }) : /* @__PURE__ */ h("div", {
470
510
  className: "space-y-4",
471
- children: [/* @__PURE__ */ g(ge, {
472
- options: Le,
473
- value: F,
474
- onChange: et
475
- }), X.length === 0 ? /* @__PURE__ */ g(l, {
511
+ children: [/* @__PURE__ */ m(ge, {
512
+ options: Ue,
513
+ value: M,
514
+ onChange: ct
515
+ }), X.length === 0 ? /* @__PURE__ */ m(l, {
476
516
  illustration: "empty-data",
477
- icon: /* @__PURE__ */ g(Ce, { className: "h-10 w-10" }),
478
- title: F === "ALL" ? "No meals logged yet" : "No meals for this filter",
479
- description: F === "ALL" ? "Log meals from the Today tab to build up your nutrition history." : "Try a different meal type, or log a meal to get started.",
480
- action: /* @__PURE__ */ _(v, {
517
+ icon: /* @__PURE__ */ m(Oe, { className: "h-10 w-10" }),
518
+ title: M === "ALL" ? "No meals logged yet" : "No meals for this filter",
519
+ description: M === "ALL" ? "Log meals from the Today tab to build up your nutrition history." : "Try a different meal type, or log a meal to get started.",
520
+ action: /* @__PURE__ */ h(g, {
481
521
  onClick: Z,
482
- children: [/* @__PURE__ */ g(m, { className: "mr-1.5 h-4 w-4" }), " Log meal"]
522
+ children: [/* @__PURE__ */ m(f, { className: "mr-1.5 h-4 w-4" }), " Log meal"]
483
523
  })
484
- }) : /* @__PURE__ */ _(Te, { children: [/* @__PURE__ */ g(he, {
524
+ }) : /* @__PURE__ */ h(Ae, { children: [/* @__PURE__ */ m(he, {
485
525
  columns: [
526
+ {
527
+ key: "favorite",
528
+ header: "",
529
+ sortValue: (e) => +!!e.isFavorite,
530
+ render: (e) => /* @__PURE__ */ h("span", {
531
+ className: "inline-flex",
532
+ title: e.isFavorite ? "Favorite meal" : "Not a favorite",
533
+ children: [/* @__PURE__ */ m(De, { className: `h-4 w-4 ${e.isFavorite ? "fill-current text-accent" : "text-text-tertiary"}` }), /* @__PURE__ */ m("span", {
534
+ className: "sr-only",
535
+ children: e.isFavorite ? "Favorite" : "Not favorite"
536
+ })]
537
+ })
538
+ },
486
539
  {
487
540
  key: "name",
488
541
  header: "Meal",
489
- render: (e) => /* @__PURE__ */ g("span", {
542
+ render: (e) => /* @__PURE__ */ m("span", {
490
543
  className: "font-medium text-text-primary",
491
544
  children: e.name
492
545
  })
@@ -494,14 +547,14 @@ function j() {
494
547
  {
495
548
  key: "mealType",
496
549
  header: "Type",
497
- render: (e) => /* @__PURE__ */ g(o, { status: e.mealType })
550
+ render: (e) => /* @__PURE__ */ m(o, { status: e.mealType })
498
551
  },
499
552
  {
500
553
  key: "calories",
501
554
  header: "Calories",
502
555
  align: "right",
503
556
  sortValue: (e) => e.calories,
504
- render: (e) => /* @__PURE__ */ g("span", {
557
+ render: (e) => /* @__PURE__ */ m("span", {
505
558
  className: "tabular-nums",
506
559
  children: ee(e.calories)
507
560
  })
@@ -512,7 +565,7 @@ function j() {
512
565
  align: "right",
513
566
  hideOnMobile: !0,
514
567
  sortValue: (e) => e.proteinG,
515
- render: (e) => /* @__PURE__ */ g("span", {
568
+ render: (e) => /* @__PURE__ */ m("span", {
516
569
  className: "tabular-nums text-text-secondary",
517
570
  children: i(e.proteinG)
518
571
  })
@@ -523,7 +576,7 @@ function j() {
523
576
  align: "right",
524
577
  hideOnMobile: !0,
525
578
  sortValue: (e) => e.carbsG,
526
- render: (e) => /* @__PURE__ */ g("span", {
579
+ render: (e) => /* @__PURE__ */ m("span", {
527
580
  className: "tabular-nums text-text-secondary",
528
581
  children: i(e.carbsG)
529
582
  })
@@ -534,7 +587,7 @@ function j() {
534
587
  align: "right",
535
588
  hideOnMobile: !0,
536
589
  sortValue: (e) => e.fatG,
537
- render: (e) => /* @__PURE__ */ g("span", {
590
+ render: (e) => /* @__PURE__ */ m("span", {
538
591
  className: "tabular-nums text-text-secondary",
539
592
  children: i(e.fatG)
540
593
  })
@@ -544,7 +597,7 @@ function j() {
544
597
  header: "Servings",
545
598
  align: "right",
546
599
  sortValue: (e) => e.servings,
547
- render: (e) => /* @__PURE__ */ g("span", {
600
+ render: (e) => /* @__PURE__ */ m("span", {
548
601
  className: "tabular-nums",
549
602
  children: a(e.servings)
550
603
  })
@@ -554,7 +607,7 @@ function j() {
554
607
  header: "Logged",
555
608
  hideOnMobile: !0,
556
609
  sortValue: (e) => new Date(e.loggedAt).getTime(),
557
- render: (e) => /* @__PURE__ */ g("span", {
610
+ render: (e) => /* @__PURE__ */ m("span", {
558
611
  className: "text-text-secondary",
559
612
  children: te(e.loggedAt)
560
613
  })
@@ -563,13 +616,13 @@ function j() {
563
616
  key: "actions",
564
617
  header: "",
565
618
  align: "right",
566
- render: (e) => /* @__PURE__ */ g(v, {
619
+ render: (e) => /* @__PURE__ */ m(g, {
567
620
  variant: "ghost",
568
621
  size: "icon-sm",
569
- onClick: () => it(e.id),
570
- disabled: qe === e.id,
622
+ onClick: () => Q(e.id),
623
+ disabled: $e === e.id,
571
624
  "aria-label": "Delete meal",
572
- children: /* @__PURE__ */ g(Se, { className: "h-4 w-4 text-status-error-text" })
625
+ children: /* @__PURE__ */ m(p, { className: "h-4 w-4 text-status-error-text" })
573
626
  })
574
627
  }
575
628
  ],
@@ -579,34 +632,34 @@ function j() {
579
632
  key: "loggedAt",
580
633
  dir: "desc"
581
634
  }
582
- }), /* @__PURE__ */ g(ve, {
583
- page: I.page,
584
- pageSize: E,
635
+ }), /* @__PURE__ */ m(ve, {
636
+ page: N.page,
637
+ pageSize: w,
585
638
  itemCount: X.length,
586
- hasMore: L.data?.pageInfo?.hasMore ?? !1,
587
- onPageChange: (e) => I.onPageChange(e)
639
+ hasMore: P.data?.pageInfo?.hasMore ?? !1,
640
+ onPageChange: (e) => N.onPageChange(e)
588
641
  })] })]
589
642
  })),
590
- /* @__PURE__ */ g(S, {
591
- open: Ye,
643
+ /* @__PURE__ */ m(b, {
644
+ open: nt,
592
645
  onOpenChange: z,
593
- children: /* @__PURE__ */ _(C, {
646
+ children: /* @__PURE__ */ h(je, {
594
647
  className: "sm:max-w-lg",
595
648
  children: [
596
- /* @__PURE__ */ _(Ee, { children: [/* @__PURE__ */ g(De, { children: "Log a meal" }), /* @__PURE__ */ g(w, { children: "Record what you ate to update today's macros." })] }),
597
- /* @__PURE__ */ _("div", {
649
+ /* @__PURE__ */ h(C, { children: [/* @__PURE__ */ m(Me, { children: "Log a meal" }), /* @__PURE__ */ m(x, { children: "Record what you ate to update today's macros." })] }),
650
+ /* @__PURE__ */ h("div", {
598
651
  className: "space-y-4 py-2",
599
652
  children: [
600
- Xe && /* @__PURE__ */ g("div", {
653
+ rt && /* @__PURE__ */ m("div", {
601
654
  className: "rounded-lg border border-status-error-text/40 bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
602
- children: Xe
655
+ children: rt
603
656
  }),
604
- /* @__PURE__ */ _("div", {
657
+ /* @__PURE__ */ h("div", {
605
658
  className: "space-y-1.5",
606
- children: [/* @__PURE__ */ g(x, {
659
+ children: [/* @__PURE__ */ m(y, {
607
660
  htmlFor: "meal-name",
608
661
  children: "Name"
609
- }), /* @__PURE__ */ g(b, {
662
+ }), /* @__PURE__ */ m(v, {
610
663
  id: "meal-name",
611
664
  value: B.name,
612
665
  onChange: (e) => V({
@@ -616,33 +669,33 @@ function j() {
616
669
  placeholder: "Grilled chicken salad"
617
670
  })]
618
671
  }),
619
- /* @__PURE__ */ _("div", {
672
+ /* @__PURE__ */ h("div", {
620
673
  className: "grid grid-cols-2 gap-3",
621
- children: [/* @__PURE__ */ _("div", {
674
+ children: [/* @__PURE__ */ h("div", {
622
675
  className: "space-y-1.5",
623
- children: [/* @__PURE__ */ g(x, {
676
+ children: [/* @__PURE__ */ m(y, {
624
677
  htmlFor: "meal-type",
625
678
  children: "Meal type"
626
- }), /* @__PURE__ */ _(Oe, {
679
+ }), /* @__PURE__ */ h(Ne, {
627
680
  value: B.mealType,
628
681
  onValueChange: (e) => V({
629
682
  ...B,
630
683
  mealType: e
631
684
  }),
632
- children: [/* @__PURE__ */ g(je, {
685
+ children: [/* @__PURE__ */ m(Ie, {
633
686
  id: "meal-type",
634
- children: /* @__PURE__ */ g(Me, {})
635
- }), /* @__PURE__ */ g(ke, { children: Pe.map((e) => /* @__PURE__ */ g(Ae, {
687
+ children: /* @__PURE__ */ m(Le, {})
688
+ }), /* @__PURE__ */ m(Pe, { children: Be.map((e) => /* @__PURE__ */ m(Fe, {
636
689
  value: e,
637
690
  children: r(e)
638
691
  }, e)) })]
639
692
  })]
640
- }), /* @__PURE__ */ _("div", {
693
+ }), /* @__PURE__ */ h("div", {
641
694
  className: "space-y-1.5",
642
- children: [/* @__PURE__ */ g(x, {
695
+ children: [/* @__PURE__ */ m(y, {
643
696
  htmlFor: "meal-servings",
644
697
  children: "Servings"
645
- }), /* @__PURE__ */ g(b, {
698
+ }), /* @__PURE__ */ m(v, {
646
699
  id: "meal-servings",
647
700
  type: "number",
648
701
  min: 0,
@@ -656,15 +709,15 @@ function j() {
656
709
  })]
657
710
  })]
658
711
  }),
659
- /* @__PURE__ */ _("div", {
712
+ /* @__PURE__ */ h("div", {
660
713
  className: "grid grid-cols-2 gap-3",
661
714
  children: [
662
- /* @__PURE__ */ _("div", {
715
+ /* @__PURE__ */ h("div", {
663
716
  className: "space-y-1.5",
664
- children: [/* @__PURE__ */ g(x, {
717
+ children: [/* @__PURE__ */ m(y, {
665
718
  htmlFor: "meal-calories",
666
719
  children: "Calories (kcal)"
667
- }), /* @__PURE__ */ g(b, {
720
+ }), /* @__PURE__ */ m(v, {
668
721
  id: "meal-calories",
669
722
  type: "number",
670
723
  min: 0,
@@ -676,12 +729,12 @@ function j() {
676
729
  placeholder: "0"
677
730
  })]
678
731
  }),
679
- /* @__PURE__ */ _("div", {
732
+ /* @__PURE__ */ h("div", {
680
733
  className: "space-y-1.5",
681
- children: [/* @__PURE__ */ g(x, {
734
+ children: [/* @__PURE__ */ m(y, {
682
735
  htmlFor: "meal-protein",
683
736
  children: "Protein (g)"
684
- }), /* @__PURE__ */ g(b, {
737
+ }), /* @__PURE__ */ m(v, {
685
738
  id: "meal-protein",
686
739
  type: "number",
687
740
  min: 0,
@@ -693,12 +746,12 @@ function j() {
693
746
  placeholder: "0"
694
747
  })]
695
748
  }),
696
- /* @__PURE__ */ _("div", {
749
+ /* @__PURE__ */ h("div", {
697
750
  className: "space-y-1.5",
698
- children: [/* @__PURE__ */ g(x, {
751
+ children: [/* @__PURE__ */ m(y, {
699
752
  htmlFor: "meal-carbs",
700
753
  children: "Carbs (g)"
701
- }), /* @__PURE__ */ g(b, {
754
+ }), /* @__PURE__ */ m(v, {
702
755
  id: "meal-carbs",
703
756
  type: "number",
704
757
  min: 0,
@@ -710,12 +763,12 @@ function j() {
710
763
  placeholder: "0"
711
764
  })]
712
765
  }),
713
- /* @__PURE__ */ _("div", {
766
+ /* @__PURE__ */ h("div", {
714
767
  className: "space-y-1.5",
715
- children: [/* @__PURE__ */ g(x, {
768
+ children: [/* @__PURE__ */ m(y, {
716
769
  htmlFor: "meal-fat",
717
770
  children: "Fat (g)"
718
- }), /* @__PURE__ */ g(b, {
771
+ }), /* @__PURE__ */ m(v, {
719
772
  id: "meal-fat",
720
773
  type: "number",
721
774
  min: 0,
@@ -728,42 +781,63 @@ function j() {
728
781
  })]
729
782
  })
730
783
  ]
784
+ }),
785
+ /* @__PURE__ */ h("div", {
786
+ className: "flex items-center justify-between gap-4 rounded-xl bg-bg-sunken/60 p-3",
787
+ children: [/* @__PURE__ */ h("div", {
788
+ className: "min-w-0",
789
+ children: [/* @__PURE__ */ m(y, {
790
+ htmlFor: "meal-favorite",
791
+ className: "cursor-pointer",
792
+ children: "Favorite"
793
+ }), /* @__PURE__ */ m("p", {
794
+ className: "text-xs text-text-tertiary",
795
+ children: "Save for quick re-log"
796
+ })]
797
+ }), /* @__PURE__ */ m(Re, {
798
+ id: "meal-favorite",
799
+ checked: B.isFavorite,
800
+ onCheckedChange: (e) => V({
801
+ ...B,
802
+ isFavorite: e
803
+ })
804
+ })]
731
805
  })
732
806
  ]
733
807
  }),
734
- /* @__PURE__ */ _(T, { children: [/* @__PURE__ */ g(v, {
808
+ /* @__PURE__ */ h(S, { children: [/* @__PURE__ */ m(g, {
735
809
  variant: "outline",
736
810
  onClick: () => z(!1),
737
- disabled: R.isPending,
811
+ disabled: F.isPending,
738
812
  children: "Cancel"
739
- }), /* @__PURE__ */ g(v, {
740
- onClick: nt,
741
- disabled: R.isPending,
742
- children: R.isPending ? "Logging…" : "Log meal"
813
+ }), /* @__PURE__ */ m(g, {
814
+ onClick: dt,
815
+ disabled: F.isPending,
816
+ children: F.isPending ? "Logging…" : "Log meal"
743
817
  })] })
744
818
  ]
745
819
  })
746
820
  }),
747
- /* @__PURE__ */ g(S, {
748
- open: Ze,
821
+ /* @__PURE__ */ m(b, {
822
+ open: it,
749
823
  onOpenChange: U,
750
- children: /* @__PURE__ */ _(C, {
824
+ children: /* @__PURE__ */ h(je, {
751
825
  className: "sm:max-w-lg",
752
826
  children: [
753
- /* @__PURE__ */ _(Ee, { children: [/* @__PURE__ */ g(De, { children: W === "edit" ? "Edit nutrition targets" : "Create nutrition plan" }), /* @__PURE__ */ g(w, { children: W === "edit" ? "Update your calorie and macro targets for this plan." : "Set your daily calorie and macro targets." })] }),
754
- /* @__PURE__ */ _("div", {
827
+ /* @__PURE__ */ h(C, { children: [/* @__PURE__ */ m(Me, { children: W === "edit" ? "Edit nutrition targets" : "Create nutrition plan" }), /* @__PURE__ */ m(x, { children: W === "edit" ? "Update your calorie and macro targets for this plan." : "Set your daily calorie and macro targets." })] }),
828
+ /* @__PURE__ */ h("div", {
755
829
  className: "space-y-4 py-2",
756
830
  children: [
757
- $e && /* @__PURE__ */ g("div", {
831
+ ot && /* @__PURE__ */ m("div", {
758
832
  className: "rounded-lg border border-status-error-text/40 bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
759
- children: $e
833
+ children: ot
760
834
  }),
761
- /* @__PURE__ */ _("div", {
835
+ /* @__PURE__ */ h("div", {
762
836
  className: "space-y-1.5",
763
- children: [/* @__PURE__ */ g(x, {
837
+ children: [/* @__PURE__ */ m(y, {
764
838
  htmlFor: "plan-name",
765
839
  children: "Name"
766
- }), /* @__PURE__ */ g(b, {
840
+ }), /* @__PURE__ */ m(v, {
767
841
  id: "plan-name",
768
842
  value: G.name,
769
843
  onChange: (e) => K({
@@ -773,35 +847,35 @@ function j() {
773
847
  placeholder: "Lean bulk — Q3"
774
848
  })]
775
849
  }),
776
- /* @__PURE__ */ _("div", {
850
+ /* @__PURE__ */ h("div", {
777
851
  className: "space-y-1.5",
778
- children: [/* @__PURE__ */ g(x, {
852
+ children: [/* @__PURE__ */ m(y, {
779
853
  htmlFor: "plan-goal",
780
854
  children: "Goal type"
781
- }), /* @__PURE__ */ _(Oe, {
855
+ }), /* @__PURE__ */ h(Ne, {
782
856
  value: G.goalType,
783
857
  onValueChange: (e) => K({
784
858
  ...G,
785
859
  goalType: e
786
860
  }),
787
- children: [/* @__PURE__ */ g(je, {
861
+ children: [/* @__PURE__ */ m(Ie, {
788
862
  id: "plan-goal",
789
- children: /* @__PURE__ */ g(Me, {})
790
- }), /* @__PURE__ */ g(ke, { children: Fe.map((e) => /* @__PURE__ */ g(Ae, {
863
+ children: /* @__PURE__ */ m(Le, {})
864
+ }), /* @__PURE__ */ m(Pe, { children: Ve.map((e) => /* @__PURE__ */ m(Fe, {
791
865
  value: e,
792
866
  children: r(e)
793
867
  }, e)) })]
794
868
  })]
795
869
  }),
796
- /* @__PURE__ */ _("div", {
870
+ /* @__PURE__ */ h("div", {
797
871
  className: "grid grid-cols-2 gap-3",
798
872
  children: [
799
- /* @__PURE__ */ _("div", {
873
+ /* @__PURE__ */ h("div", {
800
874
  className: "space-y-1.5",
801
- children: [/* @__PURE__ */ g(x, {
875
+ children: [/* @__PURE__ */ m(y, {
802
876
  htmlFor: "plan-calories",
803
877
  children: "Calorie target (kcal)"
804
- }), /* @__PURE__ */ g(b, {
878
+ }), /* @__PURE__ */ m(v, {
805
879
  id: "plan-calories",
806
880
  type: "number",
807
881
  min: 0,
@@ -813,12 +887,12 @@ function j() {
813
887
  placeholder: "2400"
814
888
  })]
815
889
  }),
816
- /* @__PURE__ */ _("div", {
890
+ /* @__PURE__ */ h("div", {
817
891
  className: "space-y-1.5",
818
- children: [/* @__PURE__ */ g(x, {
892
+ children: [/* @__PURE__ */ m(y, {
819
893
  htmlFor: "plan-protein",
820
894
  children: "Protein target (g)"
821
- }), /* @__PURE__ */ g(b, {
895
+ }), /* @__PURE__ */ m(v, {
822
896
  id: "plan-protein",
823
897
  type: "number",
824
898
  min: 0,
@@ -830,12 +904,12 @@ function j() {
830
904
  placeholder: "180"
831
905
  })]
832
906
  }),
833
- /* @__PURE__ */ _("div", {
907
+ /* @__PURE__ */ h("div", {
834
908
  className: "space-y-1.5",
835
- children: [/* @__PURE__ */ g(x, {
909
+ children: [/* @__PURE__ */ m(y, {
836
910
  htmlFor: "plan-carbs",
837
911
  children: "Carbs target (g)"
838
- }), /* @__PURE__ */ g(b, {
912
+ }), /* @__PURE__ */ m(v, {
839
913
  id: "plan-carbs",
840
914
  type: "number",
841
915
  min: 0,
@@ -847,12 +921,12 @@ function j() {
847
921
  placeholder: "250"
848
922
  })]
849
923
  }),
850
- /* @__PURE__ */ _("div", {
924
+ /* @__PURE__ */ h("div", {
851
925
  className: "space-y-1.5",
852
- children: [/* @__PURE__ */ g(x, {
926
+ children: [/* @__PURE__ */ m(y, {
853
927
  htmlFor: "plan-fat",
854
928
  children: "Fat target (g)"
855
- }), /* @__PURE__ */ g(b, {
929
+ }), /* @__PURE__ */ m(v, {
856
930
  id: "plan-fat",
857
931
  type: "number",
858
932
  min: 0,
@@ -866,14 +940,14 @@ function j() {
866
940
  })
867
941
  ]
868
942
  }),
869
- /* @__PURE__ */ _("div", {
943
+ /* @__PURE__ */ h("div", {
870
944
  className: "grid grid-cols-2 gap-3",
871
- children: [/* @__PURE__ */ _("div", {
945
+ children: [/* @__PURE__ */ h("div", {
872
946
  className: "space-y-1.5",
873
- children: [/* @__PURE__ */ g(x, {
947
+ children: [/* @__PURE__ */ m(y, {
874
948
  htmlFor: "plan-start",
875
949
  children: "Start date"
876
- }), /* @__PURE__ */ g(b, {
950
+ }), /* @__PURE__ */ m(v, {
877
951
  id: "plan-start",
878
952
  type: "date",
879
953
  value: G.startDate,
@@ -882,12 +956,12 @@ function j() {
882
956
  startDate: e.target.value
883
957
  })
884
958
  })]
885
- }), /* @__PURE__ */ _("div", {
959
+ }), /* @__PURE__ */ h("div", {
886
960
  className: "space-y-1.5",
887
- children: [/* @__PURE__ */ g(x, {
961
+ children: [/* @__PURE__ */ m(y, {
888
962
  htmlFor: "plan-end",
889
963
  children: "End date"
890
- }), /* @__PURE__ */ g(b, {
964
+ }), /* @__PURE__ */ m(v, {
891
965
  id: "plan-end",
892
966
  type: "date",
893
967
  value: G.endDate,
@@ -898,12 +972,12 @@ function j() {
898
972
  })]
899
973
  })]
900
974
  }),
901
- /* @__PURE__ */ _("div", {
975
+ /* @__PURE__ */ h("div", {
902
976
  className: "space-y-1.5",
903
- children: [/* @__PURE__ */ g(x, {
977
+ children: [/* @__PURE__ */ m(y, {
904
978
  htmlFor: "plan-notes",
905
979
  children: "Notes"
906
- }), /* @__PURE__ */ g(Ne, {
980
+ }), /* @__PURE__ */ m(ze, {
907
981
  id: "plan-notes",
908
982
  value: G.notes,
909
983
  onChange: (e) => K({
@@ -916,13 +990,13 @@ function j() {
916
990
  })
917
991
  ]
918
992
  }),
919
- /* @__PURE__ */ _(T, { children: [/* @__PURE__ */ g(v, {
993
+ /* @__PURE__ */ h(S, { children: [/* @__PURE__ */ m(g, {
920
994
  variant: "outline",
921
995
  onClick: () => U(!1),
922
996
  disabled: $,
923
997
  children: "Cancel"
924
- }), /* @__PURE__ */ g(v, {
925
- onClick: rt,
998
+ }), /* @__PURE__ */ m(g, {
999
+ onClick: ft,
926
1000
  disabled: $,
927
1001
  children: $ ? "Saving…" : W === "edit" ? "Save targets" : "Create plan"
928
1002
  })] })
@@ -933,6 +1007,6 @@ function j() {
933
1007
  });
934
1008
  }
935
1009
  //#endregion
936
- export { j as NutritionPage };
1010
+ export { O as NutritionPage };
937
1011
 
938
1012
  //# sourceMappingURL=NutritionPage.js.map