@burdenoff/microfe-mybodyshield 2026.827.1 → 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 +255 -266
  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 +321 -301
  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 +290 -284
  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
@@ -3,34 +3,35 @@ import { PageLayout as t } from "../../components/PageLayout.js";
3
3
  import { formatDate as n } from "../../utils/formatters.js";
4
4
  import { StatusBadge as r } from "../../components/StatusBadge.js";
5
5
  import { EmptyState as i } from "../../components/EmptyState.js";
6
- import { ErrorView as a, LoadingView as o, Section as s } from "../../components/StateViews.js";
7
- import { FilterTabs as c } from "../../components/FilterTabs.js";
8
6
  import "../../context/index.js";
9
- import { useMybCoaching as l, useMybCreateCoaching as u, useMybTransitionCoaching as d } from "../../hooks/useMyBodyShieldApi.js";
7
+ import { useMybCoaching as a, useMybCreateCoaching as o, useMybTransitionCoaching as s } from "../../hooks/useMyBodyShieldApi.js";
8
+ import { useTr as c } from "../../hooks/useTr.js";
10
9
  import "../../hooks/index.js";
11
- import { MybDiscussion as f } from "../../components/MybDiscussion.js";
12
- import { UserSearchSelect as p } from "../../components/UserSearchSelect.js";
10
+ import { ErrorView as l, LoadingView as u, Section as d } from "../../components/StateViews.js";
11
+ import { FilterTabs as f } from "../../components/FilterTabs.js";
12
+ import { MybDiscussion as p } from "../../components/MybDiscussion.js";
13
+ import { UserSearchSelect as m } from "../../components/UserSearchSelect.js";
13
14
  import "../../components/index.js";
14
- import { AnimatePresence as m } from "../../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.js";
15
- import { motion as h } from "../../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
16
- import { useReducedMotion as g } from "../../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js";
17
- import { IconChip as _ } from "../_shared/visuals.js";
18
- import { useMemo as v, useState as y } from "react";
19
- import { CalendarClock as b, CalendarX as x, Check as S, ChevronDown as C, ChevronUp as w, Dumbbell as T, EyeOff as E, FileLock2 as D, HeartHandshake as O, LineChart as k, Lock as A, MessageSquare as j, Minus as ee, Plus as M, Salad as te, ScanEye as ne, ShieldCheck as re, User as N } from "lucide-react";
20
- import { jsx as P, jsxs as F } from "react/jsx-runtime";
21
- import { Button as I, GlassCard as L, Input as ie, Label as R, ResponsiveDialog as z, ResponsiveDialogContent as B, ResponsiveDialogDescription as V, ResponsiveDialogFooter as H, ResponsiveDialogHeader as U, ResponsiveDialogTitle as W, Switch as G } from "@burdenoff/fe-libs/ui";
15
+ import { AnimatePresence as h } from "../../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.js";
16
+ import { motion as g } from "../../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
17
+ import { useReducedMotion as _ } from "../../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js";
18
+ import { IconChip as v } from "../_shared/visuals.js";
19
+ import { useMemo as y, useState as b } from "react";
20
+ import { CalendarClock as x, CalendarX as S, Check as C, ChevronDown as w, ChevronUp as T, Dumbbell as E, EyeOff as D, FileLock2 as O, HeartHandshake as k, LineChart as A, Lock as j, MessageSquare as M, Minus as N, Plus as P, Salad as F, ScanEye as ee, ShieldCheck as te, User as I } from "lucide-react";
21
+ import { jsx as L, jsxs as R } from "react/jsx-runtime";
22
+ import { Button as z, GlassCard as B, Input as ne, Label as V, ResponsiveDialog as re, ResponsiveDialogContent as H, ResponsiveDialogDescription as U, ResponsiveDialogFooter as W, ResponsiveDialogHeader as G, ResponsiveDialogTitle as K, Switch as q } from "@burdenoff/fe-libs/ui";
22
23
  //#region src/mybodyshield/pages/coaching/CoachingPage.tsx
23
- var K = [
24
+ var J = [
24
25
  "PENDING",
25
26
  "ACTIVE",
26
27
  "PAUSED",
27
28
  "ENDED"
28
- ], q = [
29
+ ], Y = [
29
30
  .16,
30
31
  1,
31
32
  .3,
32
33
  1
33
- ], J = {
34
+ ], ie = {
34
35
  hidden: {},
35
36
  show: { transition: { staggerChildren: .06 } }
36
37
  }, ae = {
@@ -43,74 +44,92 @@ var K = [
43
44
  y: 0,
44
45
  transition: {
45
46
  duration: .35,
46
- ease: q
47
+ ease: Y
47
48
  }
48
49
  }
49
- }, oe = {
50
- PENDING: [{
51
- to: "ACTIVE",
52
- label: "Accept",
53
- primary: !0
54
- }, {
55
- to: "ENDED",
56
- label: "End request",
57
- primary: !1
58
- }],
59
- ACTIVE: [{
60
- to: "PAUSED",
61
- label: "Pause",
62
- primary: !1
63
- }, {
64
- to: "ENDED",
65
- label: "End",
66
- primary: !1
67
- }],
68
- PAUSED: [{
69
- to: "ACTIVE",
70
- label: "Resume",
71
- primary: !0
72
- }, {
73
- to: "ENDED",
74
- label: "End",
75
- primary: !1
76
- }],
77
- ENDED: []
78
- }, se = {
79
- PENDING: "Nothing is shared yet. The other party has to accept this request — the person who sent it cannot accept it themselves.",
80
- ACTIVE: "The coach can read the categories marked On. Pausing or ending this revokes that access on the next request.",
81
- PAUSED: "Sharing is suspended while paused. Resuming restores exactly the scope above.",
82
- ENDED: "Access was revoked when this relationship ended."
83
- }, ce = [
84
- {
85
- icon: ne,
86
- title: "Checked on every read",
87
- detail: "Each request re-checks the relationship and the matching switch. Access is not granted once and cached for the session."
88
- },
89
- {
90
- icon: E,
91
- title: "Refusals look like \"not found\"",
92
- detail: "Asking for data you have not shared returns not-found, never \"forbidden\" — so nobody can use the error to confirm a record exists."
93
- },
94
- {
95
- icon: A,
96
- title: "Health values are encrypted at rest",
97
- detail: "Body metrics, recovery scores, sleep hours and free-text notes are stored encrypted and decrypted only when returned to someone allowed to read them."
98
- },
99
- {
100
- icon: D,
101
- title: "Health fields are redacted from the audit log",
102
- detail: "Every mutation is audited, but weights, scores, macros and notes are replaced with a redaction marker before the entry leaves this service."
103
- },
104
- {
105
- icon: re,
106
- title: "Scope is fixed for the life of the relationship",
107
- detail: "The three switches are chosen when the relationship is created. To change them, end this one and create a new relationship with the scope you want."
50
+ };
51
+ function oe(e, t) {
52
+ let n = "mybodyshield.pages.coaching.status";
53
+ switch (t) {
54
+ case "PENDING": return e(`${n}.pending`, "Pending");
55
+ case "ACTIVE": return e(`${n}.active`, "Active");
56
+ case "PAUSED": return e(`${n}.paused`, "Paused");
57
+ case "ENDED": return e(`${n}.ended`, "Ended");
58
+ }
59
+ }
60
+ function se(e) {
61
+ return y(() => ({
62
+ PENDING: [{
63
+ to: "ACTIVE",
64
+ label: e("mybodyshield.pages.coaching.accept", "Accept"),
65
+ primary: !0
66
+ }, {
67
+ to: "ENDED",
68
+ label: e("mybodyshield.pages.coaching.endRequest", "End request"),
69
+ primary: !1
70
+ }],
71
+ ACTIVE: [{
72
+ to: "PAUSED",
73
+ label: e("mybodyshield.pages.coaching.pause", "Pause"),
74
+ primary: !1
75
+ }, {
76
+ to: "ENDED",
77
+ label: e("mybodyshield.pages.coaching.end", "End"),
78
+ primary: !1
79
+ }],
80
+ PAUSED: [{
81
+ to: "ACTIVE",
82
+ label: e("mybodyshield.pages.coaching.resume", "Resume"),
83
+ primary: !0
84
+ }, {
85
+ to: "ENDED",
86
+ label: e("mybodyshield.pages.coaching.end", "End"),
87
+ primary: !1
88
+ }],
89
+ ENDED: []
90
+ }), [e]);
91
+ }
92
+ function ce(e, t) {
93
+ switch (t) {
94
+ case "PENDING": return e("mybodyshield.pages.coaching.pendingNote", "Nothing is shared yet. The other party has to accept this request — the person who sent it cannot accept it themselves.");
95
+ case "ACTIVE": return e("mybodyshield.pages.coaching.activeNote", "The coach can read the categories marked On. Pausing or ending this revokes that access on the next request.");
96
+ case "PAUSED": return e("mybodyshield.pages.coaching.pausedNote", "Sharing is suspended while paused. Resuming restores exactly the scope above.");
97
+ case "ENDED": return e("mybodyshield.pages.coaching.endedNote", "Access was revoked when this relationship ended.");
108
98
  }
109
- ];
110
- function Y(e) {
111
- return e.length <= 10 ? e : `${e.slice(0, 8)}…`;
99
+ }
100
+ function le(e) {
101
+ return y(() => [
102
+ {
103
+ icon: ee,
104
+ title: e("mybodyshield.pages.coaching.checkedOnEveryRead", "Checked on every read"),
105
+ detail: e("mybodyshield.pages.coaching.checkedOnEveryReadDetail", "Each request re-checks the relationship and the matching switch. Access is not granted once and cached for the session.")
106
+ },
107
+ {
108
+ icon: D,
109
+ title: e("mybodyshield.pages.coaching.refusalsLookLikeNotFound", "Refusals look like \"not found\""),
110
+ detail: e("mybodyshield.pages.coaching.refusalsLookLikeNotFoundDetail", "Asking for data you have not shared returns not-found, never \"forbidden\" — so nobody can use the error to confirm a record exists.")
111
+ },
112
+ {
113
+ icon: j,
114
+ title: e("mybodyshield.pages.coaching.encryptedAtRest", "Health values are encrypted at rest"),
115
+ detail: e("mybodyshield.pages.coaching.encryptedAtRestDetail", "Body metrics, recovery scores, sleep hours and free-text notes are stored encrypted and decrypted only when returned to someone allowed to read them.")
116
+ },
117
+ {
118
+ icon: O,
119
+ title: e("mybodyshield.pages.coaching.redactedFromAudit", "Health fields are redacted from the audit log"),
120
+ detail: e("mybodyshield.pages.coaching.redactedFromAuditDetail", "Every mutation is audited, but weights, scores, macros and notes are replaced with a redaction marker before the entry leaves this service.")
121
+ },
122
+ {
123
+ icon: te,
124
+ title: e("mybodyshield.pages.coaching.scopeFixed", "Scope is fixed for the life of the relationship"),
125
+ detail: e("mybodyshield.pages.coaching.scopeFixedDetail", "The three switches are chosen when the relationship is created. To change them, end this one and create a new relationship with the scope you want.")
126
+ }
127
+ ], [e]);
112
128
  }
113
129
  function X(e) {
130
+ return e.length <= 10 ? e : `${e.slice(0, 8)}…`;
131
+ }
132
+ function Z(e) {
114
133
  return {
115
134
  memberId: e.userId,
116
135
  memberName: e.displayName,
@@ -122,290 +141,286 @@ function X(e) {
122
141
  shareMetrics: !0
123
142
  };
124
143
  }
125
- function Z({ id: e, label: t, description: n, checked: r, onChange: i }) {
126
- return /* @__PURE__ */ F("div", {
144
+ function Q({ id: e, label: t, description: n, checked: r, onChange: i }) {
145
+ return /* @__PURE__ */ R("div", {
127
146
  className: "flex items-center justify-between gap-4 rounded-xl bg-bg-sunken/60 p-3",
128
- children: [/* @__PURE__ */ F("div", {
147
+ children: [/* @__PURE__ */ R("div", {
129
148
  className: "min-w-0",
130
- children: [/* @__PURE__ */ P(R, {
149
+ children: [/* @__PURE__ */ L(V, {
131
150
  htmlFor: e,
132
151
  className: "cursor-pointer",
133
152
  children: t
134
- }), /* @__PURE__ */ P("p", {
153
+ }), /* @__PURE__ */ L("p", {
135
154
  className: "text-xs text-text-tertiary",
136
155
  children: n
137
156
  })]
138
- }), /* @__PURE__ */ P(G, {
157
+ }), /* @__PURE__ */ L(q, {
139
158
  id: e,
140
159
  checked: r,
141
160
  onCheckedChange: i
142
161
  })]
143
162
  });
144
163
  }
145
- function le({ open: e, onOpenChange: t, defaultMember: n }) {
146
- let r = u(), [i, a] = y(() => X(n)), [o, s] = y(null), c = (e) => {
147
- e || (a(X(n)), s(null)), t(e);
148
- }, l = async () => {
149
- let e = i.coachId.trim(), o = i.memberId.trim();
164
+ function ue({ open: e, onOpenChange: t, defaultMember: n }) {
165
+ let r = c(), i = o(), [a, s] = b(() => Z(n)), [l, u] = b(null), d = (e) => {
166
+ e || (s(Z(n)), u(null)), t(e);
167
+ }, f = async () => {
168
+ let e = a.coachId.trim(), o = a.memberId.trim();
150
169
  if (!e) {
151
- s("Coach user id is required.");
170
+ u(r("mybodyshield.pages.coaching.coachRequired", "Coach user id is required."));
152
171
  return;
153
172
  }
154
173
  if (!o) {
155
- s("Member user id is required.");
174
+ u(r("mybodyshield.pages.coaching.memberRequired", "Member user id is required."));
156
175
  return;
157
176
  }
158
- s(null);
177
+ u(null);
159
178
  let c = {
160
179
  coachId: e,
161
180
  memberId: o,
162
- specialty: i.specialty.trim() || void 0,
163
- shareWorkouts: i.shareWorkouts,
164
- shareNutrition: i.shareNutrition,
165
- shareMetrics: i.shareMetrics
181
+ specialty: a.specialty.trim() || void 0,
182
+ shareWorkouts: a.shareWorkouts,
183
+ shareNutrition: a.shareNutrition,
184
+ shareMetrics: a.shareMetrics
166
185
  };
167
186
  try {
168
- await r.mutateAsync(c), a(X(n)), t(!1);
187
+ await i.mutateAsync(c), s(Z(n)), t(!1);
169
188
  } catch (e) {
170
- s(e instanceof Error ? e.message : "Failed to create coaching relationship.");
189
+ u(e instanceof Error ? e.message : r("mybodyshield.pages.coaching.failedToCreate", "Failed to create coaching relationship."));
171
190
  }
172
191
  };
173
- return /* @__PURE__ */ P(z, {
192
+ return /* @__PURE__ */ L(re, {
174
193
  open: e,
175
- onOpenChange: c,
176
- children: /* @__PURE__ */ F(B, { children: [/* @__PURE__ */ F(U, { children: [/* @__PURE__ */ P(W, { children: "New coaching" }), /* @__PURE__ */ P(V, { children: "Link a coach and member, and choose exactly what training, nutrition and progress data is shared." })] }), /* @__PURE__ */ F("form", {
194
+ onOpenChange: d,
195
+ children: /* @__PURE__ */ R(H, { children: [/* @__PURE__ */ R(G, { children: [/* @__PURE__ */ L(K, { children: r("mybodyshield.pages.coaching.dialogTitle", "New coaching") }), /* @__PURE__ */ L(U, { children: r("mybodyshield.pages.coaching.dialogDescription", "Link a coach and member, and choose exactly what training, nutrition and progress data is shared.") })] }), /* @__PURE__ */ R("form", {
177
196
  className: "space-y-4",
178
197
  onSubmit: (e) => {
179
- e.preventDefault(), l();
198
+ e.preventDefault(), f();
180
199
  },
181
200
  children: [
182
- o && /* @__PURE__ */ P("p", {
201
+ l && /* @__PURE__ */ L("p", {
183
202
  className: "rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
184
- children: o
203
+ children: l
185
204
  }),
186
- /* @__PURE__ */ P(p, {
187
- label: "Coach",
205
+ /* @__PURE__ */ L(m, {
206
+ label: r("mybodyshield.pages.coaching.coach", "Coach"),
188
207
  required: !0,
189
208
  htmlId: "myb-coaching-coach",
190
- userId: i.coachId,
191
- displayName: i.coachName,
192
- onSelect: ({ userId: e, displayName: t }) => a((n) => ({
209
+ userId: a.coachId,
210
+ displayName: a.coachName,
211
+ onSelect: ({ userId: e, displayName: t }) => s((n) => ({
193
212
  ...n,
194
213
  coachId: e,
195
214
  coachName: t
196
215
  }))
197
216
  }),
198
- /* @__PURE__ */ P(p, {
199
- label: "Member",
217
+ /* @__PURE__ */ L(m, {
218
+ label: r("mybodyshield.pages.coaching.member", "Member"),
200
219
  htmlId: "myb-coaching-member",
201
- userId: i.memberId,
202
- displayName: i.memberName,
203
- onSelect: ({ userId: e, displayName: t }) => a((n) => ({
220
+ userId: a.memberId,
221
+ displayName: a.memberName,
222
+ onSelect: ({ userId: e, displayName: t }) => s((n) => ({
204
223
  ...n,
205
224
  memberId: e,
206
225
  memberName: t
207
226
  }))
208
227
  }),
209
- /* @__PURE__ */ F("div", {
228
+ /* @__PURE__ */ R("div", {
210
229
  className: "space-y-2",
211
- children: [/* @__PURE__ */ P(R, {
230
+ children: [/* @__PURE__ */ L(V, {
212
231
  htmlFor: "myb-coaching-specialty",
213
- children: "Specialty"
214
- }), /* @__PURE__ */ P(ie, {
232
+ children: r("mybodyshield.pages.coaching.specialty", "Specialty")
233
+ }), /* @__PURE__ */ L(ne, {
215
234
  id: "myb-coaching-specialty",
216
- value: i.specialty,
217
- onChange: (e) => a((t) => ({
235
+ value: a.specialty,
236
+ onChange: (e) => s((t) => ({
218
237
  ...t,
219
238
  specialty: e.target.value
220
239
  })),
221
- placeholder: "e.g., Strength & conditioning"
240
+ placeholder: r("mybodyshield.pages.coaching.specialtyPlaceholder", "e.g., Strength & conditioning")
222
241
  })]
223
242
  }),
224
- /* @__PURE__ */ F("div", {
243
+ /* @__PURE__ */ R("div", {
225
244
  className: "space-y-2",
226
245
  children: [
227
- /* @__PURE__ */ P("p", {
246
+ /* @__PURE__ */ L("p", {
228
247
  className: "text-sm font-medium text-text-primary",
229
- children: "Shared with the coach"
248
+ children: r("mybodyshield.pages.coaching.sharedWithCoach", "Shared with the coach")
230
249
  }),
231
- /* @__PURE__ */ P(Z, {
250
+ /* @__PURE__ */ L(Q, {
232
251
  id: "myb-coaching-share-workouts",
233
- label: "Workouts",
234
- description: "Programs, sessions and logged sets.",
235
- checked: i.shareWorkouts,
236
- onChange: (e) => a((t) => ({
252
+ label: r("mybodyshield.pages.coaching.workouts", "Workouts"),
253
+ description: r("mybodyshield.pages.coaching.workoutsDescription", "Programs, sessions and logged sets."),
254
+ checked: a.shareWorkouts,
255
+ onChange: (e) => s((t) => ({
237
256
  ...t,
238
257
  shareWorkouts: e
239
258
  }))
240
259
  }),
241
- /* @__PURE__ */ P(Z, {
260
+ /* @__PURE__ */ L(Q, {
242
261
  id: "myb-coaching-share-nutrition",
243
- label: "Nutrition",
244
- description: "Plans, meals and daily macros.",
245
- checked: i.shareNutrition,
246
- onChange: (e) => a((t) => ({
262
+ label: r("mybodyshield.pages.coaching.nutrition", "Nutrition"),
263
+ description: r("mybodyshield.pages.coaching.nutritionDescription", "Plans, meals and daily macros."),
264
+ checked: a.shareNutrition,
265
+ onChange: (e) => s((t) => ({
247
266
  ...t,
248
267
  shareNutrition: e
249
268
  }))
250
269
  }),
251
- /* @__PURE__ */ P(Z, {
270
+ /* @__PURE__ */ L(Q, {
252
271
  id: "myb-coaching-share-metrics",
253
- label: "Metrics",
254
- description: "Body metrics and recovery logs.",
255
- checked: i.shareMetrics,
256
- onChange: (e) => a((t) => ({
272
+ label: r("mybodyshield.pages.coaching.metrics", "Metrics"),
273
+ description: r("mybodyshield.pages.coaching.metricsDescription", "Body metrics and recovery logs."),
274
+ checked: a.shareMetrics,
275
+ onChange: (e) => s((t) => ({
257
276
  ...t,
258
277
  shareMetrics: e
259
278
  }))
260
279
  })
261
280
  ]
262
281
  }),
263
- /* @__PURE__ */ F(H, { children: [/* @__PURE__ */ P(I, {
282
+ /* @__PURE__ */ R(W, { children: [/* @__PURE__ */ L(z, {
264
283
  type: "button",
265
284
  variant: "outline",
266
- onClick: () => c(!1),
267
- disabled: r.isPending,
268
- children: "Cancel"
269
- }), /* @__PURE__ */ P(I, {
285
+ onClick: () => d(!1),
286
+ disabled: i.isPending,
287
+ children: r("mybodyshield.common.cancel", "Cancel")
288
+ }), /* @__PURE__ */ L(z, {
270
289
  type: "submit",
271
- disabled: r.isPending,
272
- children: r.isPending ? "Creating…" : "Create coaching"
290
+ disabled: i.isPending,
291
+ children: i.isPending ? r("mybodyshield.common.creating", "Creating…") : r("mybodyshield.pages.coaching.createCoachingButton", "Create coaching")
273
292
  })] })
274
293
  ]
275
294
  })] })
276
295
  });
277
296
  }
278
- function Q({ label: e, icon: t, on: n }) {
279
- let r = t, i = n ? S : ee;
280
- return /* @__PURE__ */ F("span", {
281
- "aria-label": `${e} ${n ? "shared" : "not shared"}`,
282
- className: `inline-flex items-center gap-1.5 rounded-full py-0.5 pl-1 pr-2.5 text-xs font-medium ${n ? "bg-status-success-bg-subtle text-status-success-text ring-1 ring-inset ring-[color-mix(in_oklab,var(--color-status-success-text)_28%,transparent)]" : "bg-bg-sunken text-text-tertiary ring-1 ring-inset ring-border-seam"}`,
297
+ function $({ t: e, label: t, icon: n, on: r }) {
298
+ let i = n, a = r ? C : N;
299
+ return /* @__PURE__ */ R("span", {
300
+ "aria-label": `${t} ${r ? e("mybodyshield.pages.coaching.shared", "shared") : e("mybodyshield.pages.coaching.notShared", "not shared")}`,
301
+ className: `inline-flex items-center gap-1.5 rounded-full py-0.5 pl-1 pr-2.5 text-xs font-medium ${r ? "bg-status-success-bg-subtle text-status-success-text ring-1 ring-inset ring-[color-mix(in_oklab,var(--color-status-success-text)_28%,transparent)]" : "bg-bg-sunken text-text-tertiary ring-1 ring-inset ring-border-seam"}`,
283
302
  children: [
284
- /* @__PURE__ */ P("span", {
303
+ /* @__PURE__ */ L("span", {
285
304
  "aria-hidden": "true",
286
- className: `inline-flex size-4 items-center justify-center rounded-full ${n ? "bg-[color-mix(in_oklab,var(--color-status-success-text)_22%,transparent)]" : "bg-[color-mix(in_oklab,var(--color-text-tertiary)_18%,transparent)]"}`,
287
- children: /* @__PURE__ */ P(i, { className: "h-2.5 w-2.5" })
305
+ className: `inline-flex size-4 items-center justify-center rounded-full ${r ? "bg-[color-mix(in_oklab,var(--color-status-success-text)_22%,transparent)]" : "bg-[color-mix(in_oklab,var(--color-text-tertiary)_18%,transparent)]"}`,
306
+ children: /* @__PURE__ */ L(a, { className: "h-2.5 w-2.5" })
288
307
  }),
289
- /* @__PURE__ */ P(r, {
308
+ /* @__PURE__ */ L(i, {
290
309
  className: "h-3 w-3",
291
310
  "aria-hidden": "true"
292
311
  }),
293
- /* @__PURE__ */ F("span", { children: [
294
- e,
295
- " · ",
296
- n ? "On" : "Off"
312
+ /* @__PURE__ */ R("span", { children: [
313
+ t,
314
+ " ·",
315
+ " ",
316
+ r ? e("mybodyshield.pages.coaching.on", "On") : e("mybodyshield.pages.coaching.off", "Off")
297
317
  ] })
298
318
  ]
299
319
  });
300
320
  }
301
- function $({ relationship: e, currentUserId: t, busy: i, onTransition: a }) {
302
- let o = !!t && e.coachId === t, s = !!t && e.memberId === t, c = oe[e.status], l = e.status === "ACTIVE" || e.status === "PAUSED", [u, d] = y(!1), p = g();
303
- return /* @__PURE__ */ F(L, {
321
+ function de({ relationship: e, currentUserId: t, busy: i, onTransition: a }) {
322
+ let o = c(), s = se(o), l = !!t && e.coachId === t, u = !!t && e.memberId === t, d = s[e.status], f = e.status === "ACTIVE" || e.status === "PAUSED", [m, y] = b(!1), C = _();
323
+ return /* @__PURE__ */ R(B, {
304
324
  treatment: "glass",
305
325
  glow: e.status === "ACTIVE",
306
326
  className: "flex h-full flex-col gap-4 p-5 transition-shadow hover:shadow-float" + (e.status === "PENDING" ? " ring-1 ring-inset ring-[color-mix(in_oklab,var(--color-status-warning-text)_35%,transparent)]" : ""),
307
327
  children: [
308
- /* @__PURE__ */ F("div", {
328
+ /* @__PURE__ */ R("div", {
309
329
  className: "flex items-start justify-between gap-3",
310
- children: [/* @__PURE__ */ F("div", {
330
+ children: [/* @__PURE__ */ R("div", {
311
331
  className: "flex min-w-0 items-start gap-3",
312
- children: [/* @__PURE__ */ P(_, { icon: /* @__PURE__ */ P(O, { className: "h-4 w-4" }) }), /* @__PURE__ */ F("div", {
332
+ children: [/* @__PURE__ */ L(v, { icon: /* @__PURE__ */ L(k, { className: "h-4 w-4" }) }), /* @__PURE__ */ R("div", {
313
333
  className: "min-w-0",
314
- children: [/* @__PURE__ */ P("p", {
334
+ children: [/* @__PURE__ */ L("p", {
315
335
  className: "truncate text-sm font-semibold text-text-primary",
316
- children: e.specialty?.trim() || "Coaching relationship"
317
- }), /* @__PURE__ */ P("p", {
336
+ children: e.specialty?.trim() || o("mybodyshield.pages.coaching.coachingRelationship", "Coaching relationship")
337
+ }), /* @__PURE__ */ L("p", {
318
338
  className: "text-xs text-text-tertiary",
319
- children: "Coach ↔ member"
339
+ children: o("mybodyshield.pages.coaching.coachMember", "Coach ↔ member")
320
340
  })]
321
341
  })]
322
- }), /* @__PURE__ */ P(r, { status: e.status })]
342
+ }), /* @__PURE__ */ L(r, { status: e.status })]
323
343
  }),
324
- /* @__PURE__ */ F("div", {
344
+ /* @__PURE__ */ R("div", {
325
345
  className: "grid grid-cols-2 gap-3",
326
- children: [/* @__PURE__ */ F("div", {
346
+ children: [/* @__PURE__ */ R("div", {
327
347
  className: "flex items-center gap-2.5 rounded-lg bg-bg-sunken/60 p-2.5",
328
- children: [/* @__PURE__ */ P("span", {
348
+ children: [/* @__PURE__ */ L("span", {
329
349
  "aria-hidden": "true",
330
- className: `flex size-8 shrink-0 items-center justify-center rounded-full ring-1 ring-inset ${o ? "bg-[color-mix(in_oklab,var(--color-action-primary-bg)_16%,transparent)] text-action-primary-bg ring-[color-mix(in_oklab,var(--color-action-primary-bg)_40%,transparent)]" : "bg-bg-surface text-text-tertiary ring-border-seam"}`,
331
- children: /* @__PURE__ */ P(N, { className: "h-4 w-4" })
332
- }), /* @__PURE__ */ F("div", {
350
+ className: `flex size-8 shrink-0 items-center justify-center rounded-full ring-1 ring-inset ${l ? "bg-[color-mix(in_oklab,var(--color-action-primary-bg)_16%,transparent)] text-action-primary-bg ring-[color-mix(in_oklab,var(--color-action-primary-bg)_40%,transparent)]" : "bg-bg-surface text-text-tertiary ring-border-seam"}`,
351
+ children: /* @__PURE__ */ L(I, { className: "h-4 w-4" })
352
+ }), /* @__PURE__ */ R("div", {
333
353
  className: "min-w-0",
334
- children: [/* @__PURE__ */ P("p", {
354
+ children: [/* @__PURE__ */ L("p", {
335
355
  className: "text-[11px] font-medium uppercase tracking-wide text-text-tertiary",
336
- children: "Coach"
337
- }), /* @__PURE__ */ P("p", {
356
+ children: o("mybodyshield.pages.coaching.coachLabel", "Coach")
357
+ }), /* @__PURE__ */ L("p", {
338
358
  className: "mt-0.5 truncate text-sm font-medium text-text-primary",
339
359
  title: e.coachId,
340
- children: o ? "You" : `#${Y(e.coachId)}`
360
+ children: l ? o("mybodyshield.pages.coaching.you", "You") : `#${X(e.coachId)}`
341
361
  })]
342
362
  })]
343
- }), /* @__PURE__ */ F("div", {
363
+ }), /* @__PURE__ */ R("div", {
344
364
  className: "flex items-center gap-2.5 rounded-lg bg-bg-sunken/60 p-2.5",
345
- children: [/* @__PURE__ */ P("span", {
365
+ children: [/* @__PURE__ */ L("span", {
346
366
  "aria-hidden": "true",
347
- className: `flex size-8 shrink-0 items-center justify-center rounded-full ring-1 ring-inset ${s ? "bg-[color-mix(in_oklab,var(--color-action-primary-bg)_16%,transparent)] text-action-primary-bg ring-[color-mix(in_oklab,var(--color-action-primary-bg)_40%,transparent)]" : "bg-bg-surface text-text-tertiary ring-border-seam"}`,
348
- children: /* @__PURE__ */ P(N, { className: "h-4 w-4" })
349
- }), /* @__PURE__ */ F("div", {
367
+ className: `flex size-8 shrink-0 items-center justify-center rounded-full ring-1 ring-inset ${u ? "bg-[color-mix(in_oklab,var(--color-action-primary-bg)_16%,transparent)] text-action-primary-bg ring-[color-mix(in_oklab,var(--color-action-primary-bg)_40%,transparent)]" : "bg-bg-surface text-text-tertiary ring-border-seam"}`,
368
+ children: /* @__PURE__ */ L(I, { className: "h-4 w-4" })
369
+ }), /* @__PURE__ */ R("div", {
350
370
  className: "min-w-0",
351
- children: [/* @__PURE__ */ P("p", {
371
+ children: [/* @__PURE__ */ L("p", {
352
372
  className: "text-[11px] font-medium uppercase tracking-wide text-text-tertiary",
353
- children: "Member"
354
- }), /* @__PURE__ */ P("p", {
373
+ children: o("mybodyshield.pages.coaching.memberLabel", "Member")
374
+ }), /* @__PURE__ */ L("p", {
355
375
  className: "mt-0.5 truncate text-sm font-medium text-text-primary",
356
376
  title: e.memberId,
357
- children: s ? "You" : `#${Y(e.memberId)}`
377
+ children: u ? o("mybodyshield.pages.coaching.you", "You") : `#${X(e.memberId)}`
358
378
  })]
359
379
  })]
360
380
  })]
361
381
  }),
362
- /* @__PURE__ */ F("div", {
382
+ /* @__PURE__ */ R("div", {
363
383
  className: "space-y-2",
364
- children: [/* @__PURE__ */ F("div", {
384
+ children: [/* @__PURE__ */ R("div", {
365
385
  className: "flex flex-wrap gap-1.5",
366
386
  children: [
367
- /* @__PURE__ */ P(Q, {
368
- label: "Workouts",
369
- icon: T,
387
+ /* @__PURE__ */ L($, {
388
+ t: o,
389
+ label: o("mybodyshield.pages.coaching.workouts", "Workouts"),
390
+ icon: E,
370
391
  on: e.shareWorkouts
371
392
  }),
372
- /* @__PURE__ */ P(Q, {
373
- label: "Nutrition",
374
- icon: te,
393
+ /* @__PURE__ */ L($, {
394
+ t: o,
395
+ label: o("mybodyshield.pages.coaching.nutrition", "Nutrition"),
396
+ icon: F,
375
397
  on: e.shareNutrition
376
398
  }),
377
- /* @__PURE__ */ P(Q, {
378
- label: "Metrics",
379
- icon: k,
399
+ /* @__PURE__ */ L($, {
400
+ t: o,
401
+ label: o("mybodyshield.pages.coaching.metrics", "Metrics"),
402
+ icon: A,
380
403
  on: e.shareMetrics
381
404
  })
382
405
  ]
383
- }), /* @__PURE__ */ P("p", {
406
+ }), /* @__PURE__ */ L("p", {
384
407
  className: "text-xs leading-relaxed text-text-tertiary",
385
- children: se[e.status]
408
+ children: ce(o, e.status)
386
409
  })]
387
410
  }),
388
- (e.startedAt || e.endedAt) && /* @__PURE__ */ F("div", {
411
+ (e.startedAt || e.endedAt) && /* @__PURE__ */ R("div", {
389
412
  className: "flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-text-tertiary",
390
- children: [e.startedAt && /* @__PURE__ */ F("span", {
413
+ children: [e.startedAt && /* @__PURE__ */ R("span", {
391
414
  className: "inline-flex items-center gap-1",
392
- children: [
393
- /* @__PURE__ */ P(b, { className: "h-3.5 w-3.5" }),
394
- "Started ",
395
- n(e.startedAt)
396
- ]
397
- }), e.endedAt && /* @__PURE__ */ F("span", {
415
+ children: [/* @__PURE__ */ L(x, { className: "h-3.5 w-3.5" }), o("mybodyshield.pages.coaching.started", "Started {{date}}", { date: n(e.startedAt) })]
416
+ }), e.endedAt && /* @__PURE__ */ R("span", {
398
417
  className: "inline-flex items-center gap-1",
399
- children: [
400
- /* @__PURE__ */ P(x, { className: "h-3.5 w-3.5" }),
401
- "Ended ",
402
- n(e.endedAt)
403
- ]
418
+ children: [/* @__PURE__ */ L(S, { className: "h-3.5 w-3.5" }), o("mybodyshield.pages.coaching.ended", "Ended {{date}}", { date: n(e.endedAt) })]
404
419
  })]
405
420
  }),
406
- c.length > 0 && /* @__PURE__ */ P("div", {
421
+ d.length > 0 && /* @__PURE__ */ L("div", {
407
422
  className: "mt-auto flex flex-wrap gap-2 pt-1",
408
- children: c.map((t) => /* @__PURE__ */ P(I, {
423
+ children: d.map((t) => /* @__PURE__ */ L(z, {
409
424
  size: "sm",
410
425
  variant: t.primary ? void 0 : "outline",
411
426
  disabled: i,
@@ -413,22 +428,22 @@ function $({ relationship: e, currentUserId: t, busy: i, onTransition: a }) {
413
428
  children: t.label
414
429
  }, t.to))
415
430
  }),
416
- l && /* @__PURE__ */ F("div", {
417
- className: `border-t border-border-seam pt-3 ${c.length === 0 ? "mt-auto" : ""}`,
418
- children: [/* @__PURE__ */ F("button", {
431
+ f && /* @__PURE__ */ R("div", {
432
+ className: `border-t border-border-seam pt-3 ${d.length === 0 ? "mt-auto" : ""}`,
433
+ children: [/* @__PURE__ */ R("button", {
419
434
  type: "button",
420
- onClick: () => d((e) => !e),
421
- "aria-expanded": u,
435
+ onClick: () => y((e) => !e),
436
+ "aria-expanded": m,
422
437
  className: "inline-flex items-center gap-1.5 text-sm font-medium text-accent hover:underline",
423
438
  children: [
424
- /* @__PURE__ */ P(j, { className: "h-4 w-4" }),
425
- u ? "Hide discussion" : "Discussion",
426
- P(u ? w : C, { className: "h-4 w-4" })
439
+ /* @__PURE__ */ L(M, { className: "h-4 w-4" }),
440
+ m ? o("mybodyshield.pages.coaching.hideDiscussion", "Hide discussion") : o("mybodyshield.pages.coaching.discussion", "Discussion"),
441
+ L(m ? T : w, { className: "h-4 w-4" })
427
442
  ]
428
- }), /* @__PURE__ */ P(m, {
443
+ }), /* @__PURE__ */ L(h, {
429
444
  initial: !1,
430
- children: u && /* @__PURE__ */ P(h.div, {
431
- initial: p ? !1 : {
445
+ children: m && /* @__PURE__ */ L(g.div, {
446
+ initial: C ? !1 : {
432
447
  opacity: 0,
433
448
  height: 0
434
449
  },
@@ -436,22 +451,22 @@ function $({ relationship: e, currentUserId: t, busy: i, onTransition: a }) {
436
451
  opacity: 1,
437
452
  height: "auto"
438
453
  },
439
- exit: p ? { opacity: 0 } : {
454
+ exit: C ? { opacity: 0 } : {
440
455
  opacity: 0,
441
456
  height: 0
442
457
  },
443
- transition: p ? { duration: 0 } : {
458
+ transition: C ? { duration: 0 } : {
444
459
  duration: .25,
445
- ease: q
460
+ ease: Y
446
461
  },
447
462
  className: "overflow-hidden",
448
- children: /* @__PURE__ */ P("div", {
463
+ children: /* @__PURE__ */ L("div", {
449
464
  className: "mt-3",
450
- children: /* @__PURE__ */ P(f, {
465
+ children: /* @__PURE__ */ L(p, {
451
466
  entityType: "mybodyshield-coaching",
452
467
  entityId: e.id,
453
- title: "Coaching discussion",
454
- description: "A private thread between the coach and member."
468
+ title: o("mybodyshield.pages.coaching.coachingDiscussion", "Coaching discussion"),
469
+ description: o("mybodyshield.pages.coaching.coachingDiscussionDescription", "A private thread between the coach and member.")
455
470
  })
456
471
  })
457
472
  }, "discussion")
@@ -460,25 +475,26 @@ function $({ relationship: e, currentUserId: t, busy: i, onTransition: a }) {
460
475
  ]
461
476
  });
462
477
  }
463
- function ue() {
464
- return /* @__PURE__ */ P(s, {
465
- title: "How sharing is enforced",
466
- description: "Private by default — a coach only ever sees the categories you switched on, for as long as the relationship is active.",
467
- children: /* @__PURE__ */ P(L, {
478
+ function fe() {
479
+ let e = c(), t = le(e);
480
+ return /* @__PURE__ */ L(d, {
481
+ title: e("mybodyshield.pages.coaching.sharingEnforcementTitle", "How sharing is enforced"),
482
+ description: e("mybodyshield.pages.coaching.sharingEnforcementDescription", "Private by default — a coach only ever sees the categories you switched on, for as long as the relationship is active."),
483
+ children: /* @__PURE__ */ L(B, {
468
484
  treatment: "plain",
469
485
  className: "p-5",
470
- children: /* @__PURE__ */ P("ul", {
486
+ children: /* @__PURE__ */ L("ul", {
471
487
  className: "grid gap-4 sm:grid-cols-2",
472
- children: ce.map((e) => {
488
+ children: t.map((e) => {
473
489
  let t = e.icon;
474
- return /* @__PURE__ */ F("li", {
490
+ return /* @__PURE__ */ R("li", {
475
491
  className: "flex items-start gap-3",
476
- children: [/* @__PURE__ */ P(_, { icon: /* @__PURE__ */ P(t, { className: "h-4 w-4" }) }), /* @__PURE__ */ F("div", {
492
+ children: [/* @__PURE__ */ L(v, { icon: /* @__PURE__ */ L(t, { className: "h-4 w-4" }) }), /* @__PURE__ */ R("div", {
477
493
  className: "min-w-0",
478
- children: [/* @__PURE__ */ P("p", {
494
+ children: [/* @__PURE__ */ L("p", {
479
495
  className: "text-sm font-medium text-text-primary",
480
496
  children: e.title
481
- }), /* @__PURE__ */ P("p", {
497
+ }), /* @__PURE__ */ L("p", {
482
498
  className: "mt-0.5 text-xs leading-relaxed text-text-secondary",
483
499
  children: e.detail
484
500
  })]
@@ -489,98 +505,102 @@ function ue() {
489
505
  })
490
506
  });
491
507
  }
492
- function de() {
493
- let { currentUser: n } = e(), r = g(), [s, u] = y("ALL"), [f, p] = y(!1), [m, _] = y(null), [b, x] = y(null), S = l(), C = d(), w = S.data?.items ?? [], T = v(() => {
508
+ function pe() {
509
+ let n = c(), { currentUser: r } = e(), o = _(), [d, p] = b("ALL"), [m, h] = b(!1), [v, x] = b(null), [S, C] = b(null), w = a(), T = s(), E = w.data?.items ?? [], D = y(() => {
494
510
  let e = {
495
511
  PENDING: 0,
496
512
  ACTIVE: 0,
497
513
  PAUSED: 0,
498
514
  ENDED: 0
499
515
  };
500
- for (let t of w) e[t.status] += 1;
516
+ for (let t of E) e[t.status] += 1;
501
517
  return e;
502
- }, [w]), E = v(() => [{
518
+ }, [E]), O = y(() => [{
503
519
  value: "ALL",
504
- label: "All",
505
- count: w.length
506
- }, ...K.map((e) => ({
520
+ label: n("mybodyshield.common.all", "All"),
521
+ count: E.length
522
+ }, ...J.map((e) => ({
507
523
  value: e,
508
- label: e.charAt(0) + e.slice(1).toLowerCase(),
509
- count: T[e]
510
- }))], [w.length, T]), D = v(() => s === "ALL" ? w : w.filter((e) => e.status === s), [w, s]), k = async (e, t) => {
511
- _(e), x(null);
524
+ label: oe(n, e),
525
+ count: D[e]
526
+ }))], [
527
+ E.length,
528
+ D,
529
+ n
530
+ ]), A = y(() => d === "ALL" ? E : E.filter((e) => e.status === d), [E, d]), j = async (e, t) => {
531
+ x(e), C(null);
512
532
  try {
513
- await C.mutateAsync({
533
+ await T.mutateAsync({
514
534
  id: e,
515
535
  status: t
516
536
  });
517
537
  } catch (e) {
518
- x(e instanceof Error ? e.message : "Failed to update the relationship.");
538
+ C(e instanceof Error ? e.message : n("mybodyshield.pages.coaching.failedToUpdate", "Failed to update the relationship."));
519
539
  } finally {
520
- _(null);
540
+ x(null);
521
541
  }
522
- }, A = S.isLoading && !S.data;
523
- return /* @__PURE__ */ F(t, {
524
- title: "Coaching",
525
- description: "Coach ↔ member relationships and what's shared.",
526
- actions: /* @__PURE__ */ F(I, {
527
- onClick: () => p(!0),
528
- children: [/* @__PURE__ */ P(M, { className: "mr-2 h-4 w-4" }), "New coaching"]
542
+ }, M = w.isLoading && !w.data;
543
+ return /* @__PURE__ */ R(t, {
544
+ title: n("mybodyshield.pages.coaching.title", "Coaching"),
545
+ description: n("mybodyshield.pages.coaching.description", "Coach ↔ member relationships and what's shared."),
546
+ actions: /* @__PURE__ */ R(z, {
547
+ onClick: () => h(!0),
548
+ children: [/* @__PURE__ */ L(P, { className: "mr-2 h-4 w-4" }), n("mybodyshield.pages.coaching.newCoaching", "New coaching")]
529
549
  }),
530
550
  children: [
531
- /* @__PURE__ */ P("div", {
551
+ /* @__PURE__ */ L("div", {
532
552
  className: "mb-6",
533
- children: /* @__PURE__ */ P(c, {
534
- options: E,
535
- value: s,
536
- onChange: u
553
+ children: /* @__PURE__ */ L(f, {
554
+ options: O,
555
+ value: d,
556
+ onChange: p
537
557
  })
538
558
  }),
539
- b && /* @__PURE__ */ P("p", {
559
+ S && /* @__PURE__ */ L("p", {
540
560
  className: "mb-4 rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
541
- children: b
561
+ children: S
542
562
  }),
543
- A ? /* @__PURE__ */ P(o, { label: "Loading coaching relationships…" }) : S.isError ? /* @__PURE__ */ P(a, {
544
- message: "We couldn't load your coaching relationships.",
545
- onRetry: () => void S.refetch()
546
- }) : D.length === 0 ? /* @__PURE__ */ P(i, {
563
+ M ? /* @__PURE__ */ L(u, { label: n("mybodyshield.pages.coaching.loading", "Loading coaching relationships…") }) : w.isError ? /* @__PURE__ */ L(l, {
564
+ message: n("mybodyshield.pages.coaching.error", "We couldn't load your coaching relationships."),
565
+ onRetry: () => void w.refetch()
566
+ }) : A.length === 0 ? /* @__PURE__ */ L(i, {
547
567
  illustration: "empty-data",
548
- icon: /* @__PURE__ */ P(O, { className: "h-10 w-10" }),
549
- title: w.length === 0 ? "No coaching relationships" : "No relationships match this filter",
550
- description: w.length === 0 ? "Connect a coach and a member to start sharing training, nutrition and progress data." : "Try a different status filter, or create a new coaching relationship.",
551
- action: /* @__PURE__ */ F(I, {
552
- onClick: () => p(!0),
553
- children: [/* @__PURE__ */ P(M, { className: "mr-2 h-4 w-4" }), "New coaching"]
568
+ icon: /* @__PURE__ */ L(k, { className: "h-10 w-10" }),
569
+ title: E.length === 0 ? n("mybodyshield.pages.coaching.emptyTitle", "No coaching relationships") : n("mybodyshield.pages.coaching.emptyFilteredTitle", "No relationships match this filter"),
570
+ description: E.length === 0 ? n("mybodyshield.pages.coaching.emptyDescription", "Connect a coach and a member to start sharing training, nutrition and progress data.") : n("mybodyshield.pages.coaching.emptyFilteredDescription", "Try a different status filter, or create a new coaching relationship."),
571
+ action: /* @__PURE__ */ R(z, {
572
+ onClick: () => h(!0),
573
+ children: [/* @__PURE__ */ L(P, { className: "mr-2 h-4 w-4" }), n("mybodyshield.pages.coaching.newCoaching", "New coaching")]
554
574
  })
555
- }) : /* @__PURE__ */ P(h.div, {
575
+ }) : /* @__PURE__ */ L(g.div, {
556
576
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
557
- variants: r ? void 0 : J,
558
- initial: r ? !1 : "hidden",
577
+ variants: o ? void 0 : ie,
578
+ initial: o ? !1 : "hidden",
559
579
  animate: "show",
560
- children: D.map((e) => /* @__PURE__ */ P(h.div, {
580
+ children: A.map((e) => /* @__PURE__ */ L(g.div, {
561
581
  className: "h-full",
562
- variants: r ? void 0 : ae,
563
- children: /* @__PURE__ */ P($, {
582
+ variants: o ? void 0 : ae,
583
+ children: /* @__PURE__ */ L(de, {
564
584
  relationship: e,
565
- currentUserId: n?.id,
566
- busy: m === e.id,
567
- onTransition: (e, t) => void k(e, t)
585
+ currentUserId: r?.id,
586
+ busy: v === e.id,
587
+ onTransition: (e, t) => void j(e, t)
568
588
  })
569
589
  }, e.id))
570
590
  }),
571
- /* @__PURE__ */ P(ue, {}),
572
- /* @__PURE__ */ P(le, {
573
- open: f,
574
- onOpenChange: p,
591
+ /* @__PURE__ */ L(fe, {}),
592
+ /* @__PURE__ */ L(ue, {
593
+ open: m,
594
+ onOpenChange: h,
575
595
  defaultMember: {
576
- userId: n?.id ?? "",
577
- displayName: n?.name || n?.email || ""
596
+ userId: r?.id ?? "",
597
+ displayName: r?.name || r?.email || ""
578
598
  }
579
599
  })
580
600
  ]
581
601
  });
582
602
  }
583
603
  //#endregion
584
- export { de as CoachingPage };
604
+ export { pe as CoachingPage };
585
605
 
586
606
  //# sourceMappingURL=CoachingPage.js.map