@burdenoff/microfe-mybodyshield 2026.821.2 → 2026.830.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.
Files changed (90) hide show
  1. package/dist/mybodyshield/MyBodyShieldRoot.d.ts.map +1 -1
  2. package/dist/mybodyshield/MyBodyShieldRoot.js +54 -56
  3. package/dist/mybodyshield/MyBodyShieldRoot.js.map +1 -1
  4. package/dist/mybodyshield/MyBodyShieldRoutes.d.ts.map +1 -1
  5. package/dist/mybodyshield/MyBodyShieldRoutes.js +121 -62
  6. package/dist/mybodyshield/MyBodyShieldRoutes.js.map +1 -1
  7. package/dist/mybodyshield/components/EvidenceUpload.d.ts.map +1 -1
  8. package/dist/mybodyshield/components/EvidenceUpload.js +46 -45
  9. package/dist/mybodyshield/components/EvidenceUpload.js.map +1 -1
  10. package/dist/mybodyshield/components/FileLink.d.ts.map +1 -1
  11. package/dist/mybodyshield/components/FileLink.js +27 -18
  12. package/dist/mybodyshield/components/FileLink.js.map +1 -1
  13. package/dist/mybodyshield/components/MybDiscussion.d.ts +1 -1
  14. package/dist/mybodyshield/components/MybDiscussion.d.ts.map +1 -1
  15. package/dist/mybodyshield/components/MybDiscussion.js +59 -58
  16. package/dist/mybodyshield/components/MybDiscussion.js.map +1 -1
  17. package/dist/mybodyshield/components/MybTags.d.ts +1 -1
  18. package/dist/mybodyshield/components/MybTags.d.ts.map +1 -1
  19. package/dist/mybodyshield/components/MybTags.js +83 -74
  20. package/dist/mybodyshield/components/MybTags.js.map +1 -1
  21. package/dist/mybodyshield/components/PageDisabled.d.ts.map +1 -1
  22. package/dist/mybodyshield/components/PageDisabled.js +16 -11
  23. package/dist/mybodyshield/components/PageDisabled.js.map +1 -1
  24. package/dist/mybodyshield/components/Pagination.d.ts.map +1 -1
  25. package/dist/mybodyshield/components/Pagination.js +36 -27
  26. package/dist/mybodyshield/components/Pagination.js.map +1 -1
  27. package/dist/mybodyshield/components/StateViews.d.ts.map +1 -1
  28. package/dist/mybodyshield/components/StateViews.js +42 -34
  29. package/dist/mybodyshield/components/StateViews.js.map +1 -1
  30. package/dist/mybodyshield/components/UserSearchSelect.d.ts.map +1 -1
  31. package/dist/mybodyshield/components/UserSearchSelect.js +66 -68
  32. package/dist/mybodyshield/components/UserSearchSelect.js.map +1 -1
  33. package/dist/mybodyshield/hooks/index.d.ts +1 -0
  34. package/dist/mybodyshield/hooks/index.d.ts.map +1 -1
  35. package/dist/mybodyshield/hooks/index.js +1 -0
  36. package/dist/mybodyshield/hooks/useTr.d.ts +5 -0
  37. package/dist/mybodyshield/hooks/useTr.d.ts.map +1 -0
  38. package/dist/mybodyshield/hooks/useTr.js +12 -0
  39. package/dist/mybodyshield/hooks/useTr.js.map +1 -0
  40. package/dist/mybodyshield/pages/DashboardPage.d.ts.map +1 -1
  41. package/dist/mybodyshield/pages/DashboardPage.js +157 -136
  42. package/dist/mybodyshield/pages/DashboardPage.js.map +1 -1
  43. package/dist/mybodyshield/pages/SettingsPage.d.ts.map +1 -1
  44. package/dist/mybodyshield/pages/SettingsPage.js +50 -59
  45. package/dist/mybodyshield/pages/SettingsPage.js.map +1 -1
  46. package/dist/mybodyshield/pages/_shared/visuals.d.ts +2 -1
  47. package/dist/mybodyshield/pages/_shared/visuals.d.ts.map +1 -1
  48. package/dist/mybodyshield/pages/_shared/visuals.js +91 -81
  49. package/dist/mybodyshield/pages/_shared/visuals.js.map +1 -1
  50. package/dist/mybodyshield/pages/ai/AiControlsPage.d.ts.map +1 -1
  51. package/dist/mybodyshield/pages/ai/AiControlsPage.js +279 -231
  52. package/dist/mybodyshield/pages/ai/AiControlsPage.js.map +1 -1
  53. package/dist/mybodyshield/pages/coaching/CoachingPage.d.ts.map +1 -1
  54. package/dist/mybodyshield/pages/coaching/CoachingPage.js +349 -258
  55. package/dist/mybodyshield/pages/coaching/CoachingPage.js.map +1 -1
  56. package/dist/mybodyshield/pages/goals/GoalsPage.d.ts.map +1 -1
  57. package/dist/mybodyshield/pages/goals/GoalsPage.js +247 -251
  58. package/dist/mybodyshield/pages/goals/GoalsPage.js.map +1 -1
  59. package/dist/mybodyshield/pages/insights/InsightsCharts.d.ts.map +1 -1
  60. package/dist/mybodyshield/pages/insights/InsightsCharts.js +216 -213
  61. package/dist/mybodyshield/pages/insights/InsightsCharts.js.map +1 -1
  62. package/dist/mybodyshield/pages/insights/InsightsPage.d.ts.map +1 -1
  63. package/dist/mybodyshield/pages/insights/InsightsPage.js +327 -220
  64. package/dist/mybodyshield/pages/insights/InsightsPage.js.map +1 -1
  65. package/dist/mybodyshield/pages/nutrition/NutritionPage.d.ts.map +1 -1
  66. package/dist/mybodyshield/pages/nutrition/NutritionPage.js +575 -529
  67. package/dist/mybodyshield/pages/nutrition/NutritionPage.js.map +1 -1
  68. package/dist/mybodyshield/pages/programs/ProgramDetailPage.d.ts.map +1 -1
  69. package/dist/mybodyshield/pages/programs/ProgramDetailPage.js +333 -275
  70. package/dist/mybodyshield/pages/programs/ProgramDetailPage.js.map +1 -1
  71. package/dist/mybodyshield/pages/programs/ProgramsPage.d.ts.map +1 -1
  72. package/dist/mybodyshield/pages/programs/ProgramsPage.js +258 -253
  73. package/dist/mybodyshield/pages/programs/ProgramsPage.js.map +1 -1
  74. package/dist/mybodyshield/pages/progress/ProgressPage.d.ts.map +1 -1
  75. package/dist/mybodyshield/pages/progress/ProgressPage.js +271 -254
  76. package/dist/mybodyshield/pages/progress/ProgressPage.js.map +1 -1
  77. package/dist/mybodyshield/pages/recovery/RecoveryPage.d.ts.map +1 -1
  78. package/dist/mybodyshield/pages/recovery/RecoveryPage.js +206 -200
  79. package/dist/mybodyshield/pages/recovery/RecoveryPage.js.map +1 -1
  80. package/dist/mybodyshield/pages/train/SessionDetailPage.d.ts.map +1 -1
  81. package/dist/mybodyshield/pages/train/SessionDetailPage.js +327 -294
  82. package/dist/mybodyshield/pages/train/SessionDetailPage.js.map +1 -1
  83. package/dist/mybodyshield/pages/train/SessionsPage.d.ts.map +1 -1
  84. package/dist/mybodyshield/pages/train/SessionsPage.js +180 -163
  85. package/dist/mybodyshield/pages/train/SessionsPage.js.map +1 -1
  86. package/dist/mybodyshield/utils/i18n.d.ts +1 -2
  87. package/dist/mybodyshield/utils/i18n.d.ts.map +1 -1
  88. package/dist/mybodyshield/utils/i18n.js +15 -0
  89. package/dist/mybodyshield/utils/i18n.js.map +1 -0
  90. package/package.json +1 -1
@@ -4,48 +4,49 @@ import { MetricsCard as n } from "../../components/MetricsCard.js";
4
4
  import { formatEnumLabel as r, formatNumber as i, formatRelativeTime as a } from "../../utils/formatters.js";
5
5
  import { StatusBadge as o } from "../../components/StatusBadge.js";
6
6
  import { EmptyState as s } from "../../components/EmptyState.js";
7
- import { ErrorView as ee, LoadingView as c } from "../../components/StateViews.js";
8
- import { FilterTabs as te } from "../../components/FilterTabs.js";
9
- import { Pagination as ne } from "../../components/Pagination.js";
10
7
  import "../../context/index.js";
11
- import { useMybAddWorkout as re, useMybCreateProgram as ie, useMybPrograms as l } from "../../hooks/useMyBodyShieldApi.js";
12
- import { useOffsetPager as ae } from "../../hooks/usePager.js";
13
- import { useMyBodyShieldAnalytics as oe } from "../../hooks/useMyBodyShieldAnalytics.js";
8
+ import { useMybAddWorkout as c, useMybCreateProgram as l, useMybPrograms as u } from "../../hooks/useMyBodyShieldApi.js";
9
+ import { useOffsetPager as ee } from "../../hooks/usePager.js";
10
+ import { useMyBodyShieldAnalytics as te } from "../../hooks/useMyBodyShieldAnalytics.js";
11
+ import { useTr as d } from "../../hooks/useTr.js";
14
12
  import "../../hooks/index.js";
13
+ import { ErrorView as ne, LoadingView as re } from "../../components/StateViews.js";
14
+ import { FilterTabs as ie } from "../../components/FilterTabs.js";
15
+ import { Pagination as ae } from "../../components/Pagination.js";
15
16
  import "../../components/index.js";
16
- import { motion as u } from "../../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
17
- import { useReducedMotion as d } from "../../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js";
18
- import { GOAL_TYPE_META as f, IconChip as p } from "../_shared/visuals.js";
19
- import { PROGRAM_TEMPLATES as se, findProgramTemplate as m } from "../../data/programTemplates.js";
20
- import { useMemo as h, useState as g } from "react";
21
- import { Clock as _, Dumbbell as v, FilePenLine as ce, Layers as le, Plus as y } from "lucide-react";
22
- import { jsx as b, jsxs as x } from "react/jsx-runtime";
23
- import { Button as S, GlassCard as C, Input as w, Label as T, ResponsiveDialog as ue, ResponsiveDialogContent as de, ResponsiveDialogDescription as fe, ResponsiveDialogFooter as pe, ResponsiveDialogHeader as me, ResponsiveDialogTitle as he, Select as E, SelectContent as D, SelectItem as O, SelectTrigger as k, SelectValue as A, Textarea as ge } from "@burdenoff/fe-libs/ui";
17
+ import { motion as f } from "../../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
18
+ import { useReducedMotion as p } from "../../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js";
19
+ import { GOAL_TYPE_META as m, IconChip as h } from "../_shared/visuals.js";
20
+ import { PROGRAM_TEMPLATES as oe, findProgramTemplate as g } from "../../data/programTemplates.js";
21
+ import { useMemo as _, useState as v } from "react";
22
+ import { Clock as y, Dumbbell as b, FilePenLine as se, Layers as ce, Plus as x } from "lucide-react";
23
+ import { jsx as S, jsxs as C } from "react/jsx-runtime";
24
+ import { Button as w, GlassCard as T, Input as E, Label as D, ResponsiveDialog as le, ResponsiveDialogContent as ue, ResponsiveDialogDescription as de, ResponsiveDialogFooter as fe, ResponsiveDialogHeader as pe, ResponsiveDialogTitle as me, Select as O, SelectContent as k, SelectItem as A, SelectTrigger as j, SelectValue as M, Textarea as he } from "@burdenoff/fe-libs/ui";
24
25
  //#region src/mybodyshield/pages/programs/ProgramsPage.tsx
25
- var j = "blank", M = 24, _e = [
26
+ var N = "blank", P = 24, ge = [
26
27
  "ALL",
27
28
  "DRAFT",
28
29
  "ACTIVE",
29
30
  "COMPLETED",
30
31
  "ARCHIVED"
31
- ], N = [
32
+ ], F = [
32
33
  "WEIGHT_LOSS",
33
34
  "MUSCLE_GAIN",
34
35
  "STRENGTH",
35
36
  "ENDURANCE",
36
37
  "MOBILITY",
37
38
  "GENERAL_FITNESS"
38
- ], ve = [
39
+ ], _e = [
39
40
  "BEGINNER",
40
41
  "INTERMEDIATE",
41
42
  "ADVANCED",
42
43
  "ELITE"
43
- ], ye = [
44
+ ], ve = [
44
45
  "BUILD",
45
46
  "PEAK",
46
47
  "DELOAD",
47
48
  "MAINTENANCE"
48
- ], P = {
49
+ ], I = {
49
50
  name: "",
50
51
  description: "",
51
52
  goalType: "GENERAL_FITNESS",
@@ -54,19 +55,19 @@ var j = "blank", M = 24, _e = [
54
55
  weeks: "",
55
56
  daysPerWeek: "",
56
57
  startDate: ""
57
- }, F = (e) => {
58
+ }, L = (e) => {
58
59
  let t = e.trim();
59
60
  if (t === "") return null;
60
61
  let n = Number(t);
61
62
  return Number.isFinite(n) ? n : null;
62
- }, I = [
63
+ }, R = [
63
64
  .22,
64
65
  1,
65
66
  .36,
66
67
  1
67
- ], L = ({ index: e = 0, hover: t = !1, className: n, children: r }) => {
68
- let i = d();
69
- return /* @__PURE__ */ b(u.div, {
68
+ ], z = ({ index: e = 0, hover: t = !1, className: n, children: r }) => {
69
+ let i = p();
70
+ return /* @__PURE__ */ S(f.div, {
70
71
  className: n,
71
72
  initial: i ? !1 : {
72
73
  opacity: 0,
@@ -79,120 +80,124 @@ var j = "blank", M = 24, _e = [
79
80
  transition: i ? { duration: 0 } : {
80
81
  duration: .35,
81
82
  delay: Math.min(e * .05, .45),
82
- ease: I
83
+ ease: R
83
84
  },
84
85
  whileHover: i || !t ? void 0 : { y: -4 },
85
86
  children: r
86
87
  });
87
88
  };
88
- function R({ id: e, value: t, onChange: n, options: i }) {
89
- return /* @__PURE__ */ x(E, {
89
+ function B({ id: e, value: t, onChange: n, options: i }) {
90
+ return /* @__PURE__ */ C(O, {
90
91
  value: t,
91
92
  onValueChange: (e) => n(e),
92
- children: [/* @__PURE__ */ b(k, {
93
+ children: [/* @__PURE__ */ S(j, {
93
94
  id: e,
94
- children: /* @__PURE__ */ b(A, {})
95
- }), /* @__PURE__ */ b(D, { children: i.map((e) => /* @__PURE__ */ b(O, {
95
+ children: /* @__PURE__ */ S(M, {})
96
+ }), /* @__PURE__ */ S(k, { children: i.map((e) => /* @__PURE__ */ S(A, {
96
97
  value: e,
97
98
  children: r(e)
98
99
  }, e)) })]
99
100
  });
100
101
  }
101
- function be({ program: e, index: t, onOpen: n }) {
102
- let s = f[e.goalType], ee = s.icon, c = [
102
+ function ye({ program: e, index: t, onOpen: n }) {
103
+ let s = d(), c = m[e.goalType], l = c.icon, u = [
103
104
  e.phase,
104
105
  e.level,
105
106
  e.goalType
106
107
  ].map((e) => r(e)).join(" · ");
107
- return /* @__PURE__ */ b(L, {
108
+ return /* @__PURE__ */ S(z, {
108
109
  index: t,
109
110
  hover: !0,
110
111
  className: "h-full",
111
- children: /* @__PURE__ */ b("button", {
112
+ children: /* @__PURE__ */ S("button", {
112
113
  type: "button",
113
114
  onClick: () => n(e.id),
114
115
  className: "block h-full w-full text-left",
115
- children: /* @__PURE__ */ x(C, {
116
+ children: /* @__PURE__ */ C(T, {
116
117
  treatment: "glass",
117
118
  className: "flex h-full flex-col p-5 transition-shadow hover:shadow-[var(--shadow-pop-hover)]",
118
119
  children: [
119
- /* @__PURE__ */ x("div", {
120
+ /* @__PURE__ */ C("div", {
120
121
  className: "flex items-start justify-between gap-3",
121
- children: [/* @__PURE__ */ x("div", {
122
+ children: [/* @__PURE__ */ C("div", {
122
123
  className: "flex min-w-0 items-start gap-3",
123
- children: [/* @__PURE__ */ b(p, {
124
- icon: /* @__PURE__ */ b(ee, { className: "h-4 w-4" }),
125
- tint: s.tint
126
- }), /* @__PURE__ */ x("div", {
124
+ children: [/* @__PURE__ */ S(h, {
125
+ icon: /* @__PURE__ */ S(l, { className: "h-4 w-4" }),
126
+ tint: c.tint
127
+ }), /* @__PURE__ */ C("div", {
127
128
  className: "min-w-0",
128
- children: [/* @__PURE__ */ b("p", {
129
+ children: [/* @__PURE__ */ S("p", {
129
130
  className: "truncate font-semibold text-text-primary",
130
131
  children: e.name
131
- }), /* @__PURE__ */ b("p", {
132
+ }), /* @__PURE__ */ S("p", {
132
133
  className: "mt-0.5 truncate text-xs text-text-tertiary",
133
- children: c
134
+ children: u
134
135
  })]
135
136
  })]
136
- }), /* @__PURE__ */ b(o, { status: e.status })]
137
+ }), /* @__PURE__ */ S(o, { status: e.status })]
137
138
  }),
138
- e.description && /* @__PURE__ */ b("p", {
139
+ e.description && /* @__PURE__ */ S("p", {
139
140
  className: "mt-3 line-clamp-2 text-sm text-text-secondary",
140
141
  children: e.description
141
142
  }),
142
- /* @__PURE__ */ x("div", {
143
+ /* @__PURE__ */ C("div", {
143
144
  className: "mt-3 inline-flex items-center gap-1.5 text-sm text-text-secondary",
144
- children: [/* @__PURE__ */ b(_, { className: "h-4 w-4 shrink-0 text-action-primary-bg" }), /* @__PURE__ */ x("span", {
145
+ children: [/* @__PURE__ */ S(y, { className: "h-4 w-4 shrink-0 text-action-primary-bg" }), /* @__PURE__ */ C("span", {
145
146
  className: "tabular-nums",
146
147
  children: [
147
148
  i(e.weeks),
148
- " wk × ",
149
+ " ",
150
+ s(e.weeks === 1 ? "mybodyshield.pages.programs.weekSingular" : "mybodyshield.pages.programs.weeks", e.weeks === 1 ? "wk" : "wks"),
151
+ " ",
152
+ "× ",
149
153
  i(e.daysPerWeek),
150
- " days"
154
+ " ",
155
+ s(e.daysPerWeek === 1 ? "mybodyshield.pages.programs.daySingular" : "mybodyshield.pages.programs.days", e.daysPerWeek === 1 ? "day" : "days")
151
156
  ]
152
157
  })]
153
158
  }),
154
- e.tags.length > 0 && /* @__PURE__ */ b("div", {
159
+ e.tags.length > 0 && /* @__PURE__ */ S("div", {
155
160
  className: "mt-3 flex flex-wrap gap-1.5",
156
- children: e.tags.slice(0, 4).map((e) => /* @__PURE__ */ x("span", {
161
+ children: e.tags.slice(0, 4).map((e) => /* @__PURE__ */ S("span", {
157
162
  className: "inline-flex items-center rounded-full bg-[var(--color-accent-soft)] px-2 py-0.5 text-xs font-medium text-text-secondary",
158
- children: ["#", e]
163
+ children: s("mybodyshield.common.tagPrefix", "#{{tag}}", { tag: e })
159
164
  }, e))
160
165
  }),
161
- /* @__PURE__ */ x("div", {
166
+ /* @__PURE__ */ S("div", {
162
167
  className: "mt-auto pt-4 text-xs text-text-tertiary",
163
- children: ["Updated ", a(e.updatedAt)]
168
+ children: s("mybodyshield.pages.programs.updatedAgo", "Updated {{time}}", { time: a(e.updatedAt) })
164
169
  })
165
170
  ]
166
171
  })
167
172
  })
168
173
  });
169
174
  }
170
- function z() {
171
- let { navigateTo: a, workspaceId: o } = e(), u = ae(M), d = oe(), [f, p] = g("ALL"), [_, C] = g("ALL"), [I, z] = g(!1), [B, V] = g(P), [H, U] = g(j), [W, G] = g(null), K = ie(), q = re(), xe = l({ pagination: { limit: 100 } }), J = h(() => xe.data?.items ?? [], [xe.data]), Y = h(() => {
172
- let e = (e) => J.filter((t) => t.status === e).length;
175
+ function V() {
176
+ let a = d(), { navigateTo: o, workspaceId: f } = e(), p = ee(P), m = te(), [h, y] = v("ALL"), [T, R] = v("ALL"), [V, H] = v(!1), [U, W] = v(I), [G, K] = v(N), [be, q] = v(null), J = l(), Y = c(), xe = u({ pagination: { limit: 100 } }), X = _(() => xe.data?.items ?? [], [xe.data]), Z = _(() => {
177
+ let e = (e) => X.filter((t) => t.status === e).length;
173
178
  return {
174
- ALL: J.length,
179
+ ALL: X.length,
175
180
  DRAFT: e("DRAFT"),
176
181
  ACTIVE: e("ACTIVE"),
177
182
  COMPLETED: e("COMPLETED"),
178
183
  ARCHIVED: e("ARCHIVED")
179
184
  };
180
- }, [J]), X = l({
181
- status: f === "ALL" ? void 0 : f,
185
+ }, [X]), Q = u({
186
+ status: h === "ALL" ? void 0 : h,
182
187
  pagination: {
183
- limit: M,
184
- offset: u.offset
188
+ limit: P,
189
+ offset: p.offset
185
190
  }
186
- }), Z = X.data?.items ?? [], Q = _ === "ALL" ? Z : Z.filter((e) => e.goalType === _), Se = (e) => {
187
- p(e), u.reset();
188
- }, Ce = (e) => {
189
- C(e), u.reset();
190
- }, $ = () => {
191
- V(P), U(j), G(null), z(!0), d.emitIntent("program", "create", { workspaceId: o });
191
+ }), $ = Q.data?.items ?? [], Se = T === "ALL" ? $ : $.filter((e) => e.goalType === T), Ce = (e) => {
192
+ y(e), p.reset();
192
193
  }, we = (e) => {
193
- if (U(e), e === j) return;
194
- let t = m(e);
195
- t && V({
194
+ R(e), p.reset();
195
+ }, Te = () => {
196
+ W(I), K(N), q(null), H(!0), m.emitIntent("program", "create", { workspaceId: f });
197
+ }, Ee = (e) => {
198
+ if (K(e), e === N) return;
199
+ let t = g(e);
200
+ t && W({
196
201
  name: t.name,
197
202
  description: t.description,
198
203
  goalType: t.goalType,
@@ -202,106 +207,110 @@ function z() {
202
207
  daysPerWeek: String(t.daysPerWeek),
203
208
  startDate: ""
204
209
  });
205
- }, Te = async () => {
206
- if (!B.name.trim()) {
207
- G("Program name is required.");
210
+ }, De = async () => {
211
+ if (!U.name.trim()) {
212
+ q(a("mybodyshield.pages.programs.programNameRequired", "Program name is required."));
208
213
  return;
209
214
  }
210
215
  let e = {
211
- name: B.name.trim(),
212
- description: B.description.trim() || null,
213
- goalType: B.goalType,
214
- level: B.level,
215
- phase: B.phase,
216
- weeks: F(B.weeks),
217
- daysPerWeek: F(B.daysPerWeek),
218
- startDate: B.startDate ? new Date(B.startDate).toISOString() : null
216
+ name: U.name.trim(),
217
+ description: U.description.trim() || null,
218
+ goalType: U.goalType,
219
+ level: U.level,
220
+ phase: U.phase,
221
+ weeks: L(U.weeks),
222
+ daysPerWeek: L(U.daysPerWeek),
223
+ startDate: U.startDate ? new Date(U.startDate).toISOString() : null
219
224
  };
220
225
  try {
221
- let t = await K.mutateAsync(e), n = H === j ? void 0 : m(H);
222
- n && await Promise.allSettled(n.workouts.map((e) => q.mutateAsync({
226
+ let t = await J.mutateAsync(e), n = G === N ? void 0 : g(G);
227
+ n && await Promise.allSettled(n.workouts.map((e) => Y.mutateAsync({
223
228
  programId: t.id,
224
229
  name: e.name,
225
230
  type: e.type,
226
231
  dayOfWeek: e.dayOfWeek,
227
232
  weekNumber: e.weekNumber,
228
233
  durationMin: e.durationMin
229
- }))), d.emitFact("program", "created", {
230
- workspaceId: o,
234
+ }))), m.emitFact("program", "created", {
235
+ workspaceId: f,
231
236
  entityId: t.id
232
- }), z(!1), a(`programs/${t.id}`);
237
+ }), H(!1), o(`programs/${t.id}`);
233
238
  } catch (e) {
234
- G(e instanceof Error ? e.message : "Failed to create program.");
239
+ q(e instanceof Error ? e.message : a("mybodyshield.common.unknownError", "Unknown error"));
235
240
  }
236
- }, Ee = _e.map((e) => ({
241
+ }, Oe = ge.map((e) => ({
237
242
  value: e,
238
- label: e === "ALL" ? "All" : r(e),
239
- count: Y[e]
243
+ label: e === "ALL" ? a("mybodyshield.common.all", "All") : r(e),
244
+ count: Z[e]
240
245
  }));
241
- return /* @__PURE__ */ x(t, {
242
- title: "Programs",
243
- description: "Structured training blocks — build, peak, deload & maintain.",
244
- actions: /* @__PURE__ */ x(S, {
245
- onClick: $,
246
- children: [/* @__PURE__ */ b(y, { className: "mr-1 h-4 w-4" }), " New program"]
246
+ return /* @__PURE__ */ C(t, {
247
+ title: a("mybodyshield.pages.programs.title", "Programs"),
248
+ description: a("mybodyshield.pages.programs.description", "Structured training blocks — build, peak, deload & maintain."),
249
+ actions: /* @__PURE__ */ C(w, {
250
+ onClick: Te,
251
+ children: [
252
+ /* @__PURE__ */ S(x, { className: "mr-1 h-4 w-4" }),
253
+ " ",
254
+ a("mybodyshield.pages.programs.newProgram", "New program")
255
+ ]
247
256
  }),
248
257
  children: [
249
- /* @__PURE__ */ x("div", {
258
+ /* @__PURE__ */ C("div", {
250
259
  className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
251
260
  children: [
252
- /* @__PURE__ */ b(L, {
261
+ /* @__PURE__ */ S(z, {
253
262
  index: 0,
254
263
  className: "h-full",
255
- children: /* @__PURE__ */ b(n, {
264
+ children: /* @__PURE__ */ S(n, {
256
265
  className: "h-full",
257
- icon: /* @__PURE__ */ b(v, { className: "h-5 w-5" }),
258
- value: i(Y.ACTIVE),
259
- label: "Active programs",
266
+ icon: /* @__PURE__ */ S(b, { className: "h-5 w-5" }),
267
+ value: i(Z.ACTIVE),
268
+ label: a("mybodyshield.pages.programs.activePrograms", "Active programs"),
260
269
  accent: "success"
261
270
  })
262
271
  }),
263
- /* @__PURE__ */ b(L, {
272
+ /* @__PURE__ */ S(z, {
264
273
  index: 1,
265
274
  className: "h-full",
266
- children: /* @__PURE__ */ b(n, {
275
+ children: /* @__PURE__ */ S(n, {
267
276
  className: "h-full",
268
- icon: /* @__PURE__ */ b(ce, { className: "h-5 w-5" }),
269
- value: i(Y.DRAFT),
270
- label: "Draft programs"
277
+ icon: /* @__PURE__ */ S(se, { className: "h-5 w-5" }),
278
+ value: i(Z.DRAFT),
279
+ label: a("mybodyshield.pages.programs.draftPrograms", "Draft programs")
271
280
  })
272
281
  }),
273
- /* @__PURE__ */ b(L, {
282
+ /* @__PURE__ */ S(z, {
274
283
  index: 2,
275
284
  className: "h-full",
276
- children: /* @__PURE__ */ b(n, {
285
+ children: /* @__PURE__ */ S(n, {
277
286
  className: "h-full",
278
- icon: /* @__PURE__ */ b(le, { className: "h-5 w-5" }),
279
- value: i(Y.ALL),
280
- label: "Total programs"
287
+ icon: /* @__PURE__ */ S(ce, { className: "h-5 w-5" }),
288
+ value: i(Z.ALL),
289
+ label: a("mybodyshield.pages.programs.totalPrograms", "Total programs")
281
290
  })
282
291
  })
283
292
  ]
284
293
  }),
285
- /* @__PURE__ */ x("div", {
294
+ /* @__PURE__ */ C("div", {
286
295
  className: "mt-6 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
287
- children: [/* @__PURE__ */ b(te, {
288
- options: Ee,
289
- value: f,
290
- onChange: Se
291
- }), /* @__PURE__ */ x("div", {
296
+ children: [/* @__PURE__ */ S(ie, {
297
+ options: Oe,
298
+ value: h,
299
+ onChange: Ce
300
+ }), /* @__PURE__ */ C("div", {
292
301
  className: "flex items-center gap-2",
293
- children: [/* @__PURE__ */ b("span", {
302
+ children: [/* @__PURE__ */ S("span", {
294
303
  className: "text-sm text-text-tertiary",
295
- children: "Goal"
296
- }), /* @__PURE__ */ b("div", {
304
+ children: a("mybodyshield.pages.programs.goal", "Goal")
305
+ }), /* @__PURE__ */ S("div", {
297
306
  className: "w-48",
298
- children: /* @__PURE__ */ x(E, {
299
- value: _,
300
- onValueChange: (e) => Ce(e),
301
- children: [/* @__PURE__ */ b(k, { children: /* @__PURE__ */ b(A, {}) }), /* @__PURE__ */ x(D, { children: [/* @__PURE__ */ b(O, {
307
+ children: /* @__PURE__ */ C(O, {
308
+ value: T,
309
+ onValueChange: (e) => we(e),
310
+ children: [/* @__PURE__ */ S(j, { children: /* @__PURE__ */ S(M, {}) }), /* @__PURE__ */ C(k, { children: [/* @__PURE__ */ S(A, {
302
311
  value: "ALL",
303
- children: "All goals"
304
- }), N.map((e) => /* @__PURE__ */ b(O, {
312
+ children: a("mybodyshield.pages.programs.allGoals", "All goals")
313
+ }), F.map((e) => /* @__PURE__ */ S(A, {
305
314
  value: e,
306
315
  children: r(e)
307
316
  }, e))] })]
@@ -309,217 +318,213 @@ function z() {
309
318
  })]
310
319
  })]
311
320
  }),
312
- /* @__PURE__ */ x("div", {
321
+ /* @__PURE__ */ C("div", {
313
322
  className: "mt-6",
314
- children: [X.isLoading ? /* @__PURE__ */ b(c, { label: "Loading programs…" }) : X.isError ? /* @__PURE__ */ b(ee, {
315
- message: "We couldn't load your programs.",
316
- onRetry: () => void X.refetch()
317
- }) : Z.length === 0 ? /* @__PURE__ */ b(s, {
323
+ children: [Q.isLoading ? /* @__PURE__ */ S(re, { label: a("mybodyshield.pages.programs.loading", "Loading programs…") }) : Q.isError ? /* @__PURE__ */ S(ne, {
324
+ message: a("mybodyshield.pages.programs.error", "We couldn't load your programs."),
325
+ onRetry: () => void Q.refetch()
326
+ }) : $.length === 0 ? /* @__PURE__ */ S(s, {
318
327
  illustration: "empty-data",
319
- icon: /* @__PURE__ */ b(v, { className: "h-10 w-10" }),
320
- title: f === "ALL" ? "No programs yet" : "No programs in this status",
321
- description: "Create a structured training program to plan your workouts week by week.",
322
- action: /* @__PURE__ */ x(S, {
323
- onClick: $,
324
- children: [/* @__PURE__ */ b(y, { className: "mr-1 h-4 w-4" }), " New program"]
328
+ icon: /* @__PURE__ */ S(b, { className: "h-10 w-10" }),
329
+ title: h === "ALL" ? a("mybodyshield.pages.programs.emptyTitle", "No programs yet") : a("mybodyshield.pages.programs.emptyFilteredTitle", "No programs in this status"),
330
+ description: a("mybodyshield.pages.programs.emptyDescription", "Create a structured training program to plan your workouts week by week."),
331
+ action: /* @__PURE__ */ C(w, {
332
+ onClick: Te,
333
+ children: [
334
+ /* @__PURE__ */ S(x, { className: "mr-1 h-4 w-4" }),
335
+ " ",
336
+ a("mybodyshield.pages.programs.newProgram", "New program")
337
+ ]
325
338
  })
326
- }) : Q.length === 0 ? /* @__PURE__ */ x("div", {
339
+ }) : Se.length === 0 ? /* @__PURE__ */ S("div", {
327
340
  className: "rounded-xl border border-dashed border-border-seam py-10 text-center text-sm text-text-secondary",
328
- children: [
329
- "No programs on this page match",
330
- " ",
331
- /* @__PURE__ */ b("span", {
332
- className: "font-medium text-text-primary",
333
- children: r(_)
334
- }),
335
- "."
336
- ]
337
- }) : /* @__PURE__ */ b("div", {
341
+ children: a("mybodyshield.pages.programs.noFilteredDescription", "No programs on this page match {{filter}}.", { filter: r(T) })
342
+ }) : /* @__PURE__ */ S("div", {
338
343
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
339
- children: Q.map((e, t) => /* @__PURE__ */ b(be, {
344
+ children: Se.map((e, t) => /* @__PURE__ */ S(ye, {
340
345
  program: e,
341
346
  index: t,
342
- onOpen: (e) => a(`programs/${e}`)
347
+ onOpen: (e) => o(`programs/${e}`)
343
348
  }, e.id))
344
- }), !X.isLoading && !X.isError && Z.length > 0 && /* @__PURE__ */ b(ne, {
345
- page: u.page,
346
- pageSize: M,
347
- itemCount: Z.length,
348
- hasMore: X.data?.pageInfo?.hasMore ?? !1,
349
- onPageChange: (e) => u.onPageChange(e)
349
+ }), !Q.isLoading && !Q.isError && $.length > 0 && /* @__PURE__ */ S(ae, {
350
+ page: p.page,
351
+ pageSize: P,
352
+ itemCount: $.length,
353
+ hasMore: Q.data?.pageInfo?.hasMore ?? !1,
354
+ onPageChange: (e) => p.onPageChange(e)
350
355
  })]
351
356
  }),
352
- /* @__PURE__ */ b(ue, {
353
- open: I,
354
- onOpenChange: z,
355
- children: /* @__PURE__ */ x(de, {
357
+ /* @__PURE__ */ S(le, {
358
+ open: V,
359
+ onOpenChange: H,
360
+ children: /* @__PURE__ */ C(ue, {
356
361
  className: "sm:max-w-lg",
357
362
  children: [
358
- /* @__PURE__ */ x(me, { children: [/* @__PURE__ */ b(he, { children: "New program" }), /* @__PURE__ */ b(fe, { children: "Define a structured training block. You can add workouts & exercises after creating it." })] }),
359
- /* @__PURE__ */ x("div", {
363
+ /* @__PURE__ */ C(pe, { children: [/* @__PURE__ */ S(me, { children: a("mybodyshield.pages.programs.newProgramDialogTitle", "New program") }), /* @__PURE__ */ S(de, { children: a("mybodyshield.pages.programs.newProgramDialogDescription", "Define a structured training block. You can add workouts & exercises after creating it.") })] }),
364
+ /* @__PURE__ */ C("div", {
360
365
  className: "space-y-4 py-2",
361
366
  children: [
362
- W && /* @__PURE__ */ b("p", {
367
+ be && /* @__PURE__ */ S("p", {
363
368
  className: "rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
364
- children: W
369
+ children: be
365
370
  }),
366
- /* @__PURE__ */ x("div", {
371
+ /* @__PURE__ */ C("div", {
367
372
  className: "space-y-1.5",
368
373
  children: [
369
- /* @__PURE__ */ b(T, {
374
+ /* @__PURE__ */ S(D, {
370
375
  htmlFor: "myb-prog-template",
371
- children: "Start from a template"
376
+ children: a("mybodyshield.pages.programs.startFromTemplate", "Start from a template")
372
377
  }),
373
- /* @__PURE__ */ x(E, {
374
- value: H,
375
- onValueChange: we,
376
- children: [/* @__PURE__ */ b(k, {
378
+ /* @__PURE__ */ C(O, {
379
+ value: G,
380
+ onValueChange: Ee,
381
+ children: [/* @__PURE__ */ S(j, {
377
382
  id: "myb-prog-template",
378
- children: /* @__PURE__ */ b(A, {})
379
- }), /* @__PURE__ */ x(D, { children: [/* @__PURE__ */ b(O, {
380
- value: j,
381
- children: "Blank program"
382
- }), se.map((e) => /* @__PURE__ */ b(O, {
383
+ children: /* @__PURE__ */ S(M, {})
384
+ }), /* @__PURE__ */ C(k, { children: [/* @__PURE__ */ S(A, {
385
+ value: N,
386
+ children: a("mybodyshield.pages.programs.blankProgram", "Blank program")
387
+ }), oe.map((e) => /* @__PURE__ */ S(A, {
383
388
  value: e.id,
384
389
  children: e.name
385
390
  }, e.id))] })]
386
391
  }),
387
- H !== j && /* @__PURE__ */ b("p", {
392
+ G !== N && /* @__PURE__ */ S("p", {
388
393
  className: "text-xs text-text-tertiary",
389
- children: "Fields below are pre-filled from the template and seed a starter week of workouts — edit anything before creating."
394
+ children: a("mybodyshield.pages.programs.templateHint", "Fields below are pre-filled from the template and seed a starter week of workouts — edit anything before creating.")
390
395
  })
391
396
  ]
392
397
  }),
393
- /* @__PURE__ */ x("div", {
398
+ /* @__PURE__ */ C("div", {
394
399
  className: "space-y-1.5",
395
- children: [/* @__PURE__ */ b(T, {
400
+ children: [/* @__PURE__ */ S(D, {
396
401
  htmlFor: "myb-prog-name",
397
- children: "Name"
398
- }), /* @__PURE__ */ b(w, {
402
+ children: a("mybodyshield.common.name", "Name")
403
+ }), /* @__PURE__ */ S(E, {
399
404
  id: "myb-prog-name",
400
- value: B.name,
401
- onChange: (e) => V({
402
- ...B,
405
+ value: U.name,
406
+ onChange: (e) => W({
407
+ ...U,
403
408
  name: e.target.value
404
409
  }),
405
- placeholder: "e.g. Hypertrophy Block A"
410
+ placeholder: a("mybodyshield.pages.programs.programNamePlaceholder", "e.g. Hypertrophy Block A")
406
411
  })]
407
412
  }),
408
- /* @__PURE__ */ x("div", {
413
+ /* @__PURE__ */ C("div", {
409
414
  className: "space-y-1.5",
410
- children: [/* @__PURE__ */ b(T, {
415
+ children: [/* @__PURE__ */ S(D, {
411
416
  htmlFor: "myb-prog-desc",
412
- children: "Description"
413
- }), /* @__PURE__ */ b(ge, {
417
+ children: a("mybodyshield.common.description", "Description")
418
+ }), /* @__PURE__ */ S(he, {
414
419
  id: "myb-prog-desc",
415
420
  rows: 3,
416
- value: B.description,
417
- onChange: (e) => V({
418
- ...B,
421
+ value: U.description,
422
+ onChange: (e) => W({
423
+ ...U,
419
424
  description: e.target.value
420
425
  }),
421
- placeholder: "Focus, progression scheme, notes…"
426
+ placeholder: a("mybodyshield.pages.programs.descriptionPlaceholder", "Focus, progression scheme, notes…")
422
427
  })]
423
428
  }),
424
- /* @__PURE__ */ x("div", {
429
+ /* @__PURE__ */ C("div", {
425
430
  className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
426
431
  children: [
427
- /* @__PURE__ */ x("div", {
432
+ /* @__PURE__ */ C("div", {
428
433
  className: "space-y-1.5",
429
- children: [/* @__PURE__ */ b(T, {
434
+ children: [/* @__PURE__ */ S(D, {
430
435
  htmlFor: "myb-prog-goal",
431
- children: "Goal type"
432
- }), /* @__PURE__ */ b(R, {
436
+ children: a("mybodyshield.pages.programs.goalType", "Goal type")
437
+ }), /* @__PURE__ */ S(B, {
433
438
  id: "myb-prog-goal",
434
- value: B.goalType,
435
- onChange: (e) => V({
436
- ...B,
439
+ value: U.goalType,
440
+ onChange: (e) => W({
441
+ ...U,
437
442
  goalType: e
438
443
  }),
439
- options: N
444
+ options: F
440
445
  })]
441
446
  }),
442
- /* @__PURE__ */ x("div", {
447
+ /* @__PURE__ */ C("div", {
443
448
  className: "space-y-1.5",
444
- children: [/* @__PURE__ */ b(T, {
449
+ children: [/* @__PURE__ */ S(D, {
445
450
  htmlFor: "myb-prog-level",
446
- children: "Level"
447
- }), /* @__PURE__ */ b(R, {
451
+ children: a("mybodyshield.common.level", "Level")
452
+ }), /* @__PURE__ */ S(B, {
448
453
  id: "myb-prog-level",
449
- value: B.level,
450
- onChange: (e) => V({
451
- ...B,
454
+ value: U.level,
455
+ onChange: (e) => W({
456
+ ...U,
452
457
  level: e
453
458
  }),
454
- options: ve
459
+ options: _e
455
460
  })]
456
461
  }),
457
- /* @__PURE__ */ x("div", {
462
+ /* @__PURE__ */ C("div", {
458
463
  className: "space-y-1.5",
459
- children: [/* @__PURE__ */ b(T, {
464
+ children: [/* @__PURE__ */ S(D, {
460
465
  htmlFor: "myb-prog-phase",
461
- children: "Phase"
462
- }), /* @__PURE__ */ b(R, {
466
+ children: a("mybodyshield.common.phase", "Phase")
467
+ }), /* @__PURE__ */ S(B, {
463
468
  id: "myb-prog-phase",
464
- value: B.phase,
465
- onChange: (e) => V({
466
- ...B,
469
+ value: U.phase,
470
+ onChange: (e) => W({
471
+ ...U,
467
472
  phase: e
468
473
  }),
469
- options: ye
474
+ options: ve
470
475
  })]
471
476
  })
472
477
  ]
473
478
  }),
474
- /* @__PURE__ */ x("div", {
479
+ /* @__PURE__ */ C("div", {
475
480
  className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
476
481
  children: [
477
- /* @__PURE__ */ x("div", {
482
+ /* @__PURE__ */ C("div", {
478
483
  className: "space-y-1.5",
479
- children: [/* @__PURE__ */ b(T, {
484
+ children: [/* @__PURE__ */ S(D, {
480
485
  htmlFor: "myb-prog-weeks",
481
- children: "Weeks"
482
- }), /* @__PURE__ */ b(w, {
486
+ children: a("mybodyshield.pages.programs.weeks", "Weeks")
487
+ }), /* @__PURE__ */ S(E, {
483
488
  id: "myb-prog-weeks",
484
489
  type: "number",
485
490
  min: 1,
486
- value: B.weeks,
487
- onChange: (e) => V({
488
- ...B,
491
+ value: U.weeks,
492
+ onChange: (e) => W({
493
+ ...U,
489
494
  weeks: e.target.value
490
495
  }),
491
496
  placeholder: "8"
492
497
  })]
493
498
  }),
494
- /* @__PURE__ */ x("div", {
499
+ /* @__PURE__ */ C("div", {
495
500
  className: "space-y-1.5",
496
- children: [/* @__PURE__ */ b(T, {
501
+ children: [/* @__PURE__ */ S(D, {
497
502
  htmlFor: "myb-prog-days",
498
- children: "Days / week"
499
- }), /* @__PURE__ */ b(w, {
503
+ children: a("mybodyshield.pages.programs.daysPerWeek", "Days / week")
504
+ }), /* @__PURE__ */ S(E, {
500
505
  id: "myb-prog-days",
501
506
  type: "number",
502
507
  min: 1,
503
508
  max: 7,
504
- value: B.daysPerWeek,
505
- onChange: (e) => V({
506
- ...B,
509
+ value: U.daysPerWeek,
510
+ onChange: (e) => W({
511
+ ...U,
507
512
  daysPerWeek: e.target.value
508
513
  }),
509
514
  placeholder: "4"
510
515
  })]
511
516
  }),
512
- /* @__PURE__ */ x("div", {
517
+ /* @__PURE__ */ C("div", {
513
518
  className: "space-y-1.5",
514
- children: [/* @__PURE__ */ b(T, {
519
+ children: [/* @__PURE__ */ S(D, {
515
520
  htmlFor: "myb-prog-start",
516
- children: "Start date"
517
- }), /* @__PURE__ */ b(w, {
521
+ children: a("mybodyshield.pages.programs.startDate", "Start date")
522
+ }), /* @__PURE__ */ S(E, {
518
523
  id: "myb-prog-start",
519
524
  type: "date",
520
- value: B.startDate,
521
- onChange: (e) => V({
522
- ...B,
525
+ value: U.startDate,
526
+ onChange: (e) => W({
527
+ ...U,
523
528
  startDate: e.target.value
524
529
  })
525
530
  })]
@@ -528,15 +533,15 @@ function z() {
528
533
  })
529
534
  ]
530
535
  }),
531
- /* @__PURE__ */ x(pe, { children: [/* @__PURE__ */ b(S, {
536
+ /* @__PURE__ */ C(fe, { children: [/* @__PURE__ */ S(w, {
532
537
  variant: "outline",
533
- onClick: () => z(!1),
534
- disabled: K.isPending || q.isPending,
535
- children: "Cancel"
536
- }), /* @__PURE__ */ b(S, {
537
- onClick: () => void Te(),
538
- disabled: K.isPending || q.isPending,
539
- children: K.isPending || q.isPending ? "Creating…" : "Create program"
538
+ onClick: () => H(!1),
539
+ disabled: J.isPending || Y.isPending,
540
+ children: a("mybodyshield.common.cancel", "Cancel")
541
+ }), /* @__PURE__ */ S(w, {
542
+ onClick: () => void De(),
543
+ disabled: J.isPending || Y.isPending,
544
+ children: J.isPending || Y.isPending ? a("mybodyshield.pages.programs.creating", "Creating…") : a("mybodyshield.pages.programs.createProgram", "Create program")
540
545
  })] })
541
546
  ]
542
547
  })
@@ -545,6 +550,6 @@ function z() {
545
550
  });
546
551
  }
547
552
  //#endregion
548
- export { z as ProgramsPage };
553
+ export { V as ProgramsPage };
549
554
 
550
555
  //# sourceMappingURL=ProgramsPage.js.map