@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.
- package/dist/mybodyshield/MyBodyShieldRoot.d.ts.map +1 -1
- package/dist/mybodyshield/MyBodyShieldRoot.js +54 -56
- package/dist/mybodyshield/MyBodyShieldRoot.js.map +1 -1
- package/dist/mybodyshield/MyBodyShieldRoutes.d.ts.map +1 -1
- package/dist/mybodyshield/MyBodyShieldRoutes.js +121 -62
- package/dist/mybodyshield/MyBodyShieldRoutes.js.map +1 -1
- package/dist/mybodyshield/components/EvidenceUpload.d.ts.map +1 -1
- package/dist/mybodyshield/components/EvidenceUpload.js +46 -45
- package/dist/mybodyshield/components/EvidenceUpload.js.map +1 -1
- package/dist/mybodyshield/components/FileLink.d.ts.map +1 -1
- package/dist/mybodyshield/components/FileLink.js +27 -18
- package/dist/mybodyshield/components/FileLink.js.map +1 -1
- package/dist/mybodyshield/components/MybDiscussion.d.ts +1 -1
- package/dist/mybodyshield/components/MybDiscussion.d.ts.map +1 -1
- package/dist/mybodyshield/components/MybDiscussion.js +59 -58
- package/dist/mybodyshield/components/MybDiscussion.js.map +1 -1
- package/dist/mybodyshield/components/MybTags.d.ts +1 -1
- package/dist/mybodyshield/components/MybTags.d.ts.map +1 -1
- package/dist/mybodyshield/components/MybTags.js +83 -74
- package/dist/mybodyshield/components/MybTags.js.map +1 -1
- package/dist/mybodyshield/components/PageDisabled.d.ts.map +1 -1
- package/dist/mybodyshield/components/PageDisabled.js +16 -11
- package/dist/mybodyshield/components/PageDisabled.js.map +1 -1
- package/dist/mybodyshield/components/Pagination.d.ts.map +1 -1
- package/dist/mybodyshield/components/Pagination.js +36 -27
- package/dist/mybodyshield/components/Pagination.js.map +1 -1
- package/dist/mybodyshield/components/StateViews.d.ts.map +1 -1
- package/dist/mybodyshield/components/StateViews.js +42 -34
- package/dist/mybodyshield/components/StateViews.js.map +1 -1
- package/dist/mybodyshield/components/UserSearchSelect.d.ts.map +1 -1
- package/dist/mybodyshield/components/UserSearchSelect.js +66 -68
- package/dist/mybodyshield/components/UserSearchSelect.js.map +1 -1
- package/dist/mybodyshield/hooks/index.d.ts +1 -0
- package/dist/mybodyshield/hooks/index.d.ts.map +1 -1
- package/dist/mybodyshield/hooks/index.js +1 -0
- package/dist/mybodyshield/hooks/useTr.d.ts +5 -0
- package/dist/mybodyshield/hooks/useTr.d.ts.map +1 -0
- package/dist/mybodyshield/hooks/useTr.js +12 -0
- package/dist/mybodyshield/hooks/useTr.js.map +1 -0
- package/dist/mybodyshield/pages/DashboardPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/DashboardPage.js +157 -136
- package/dist/mybodyshield/pages/DashboardPage.js.map +1 -1
- package/dist/mybodyshield/pages/SettingsPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/SettingsPage.js +50 -59
- package/dist/mybodyshield/pages/SettingsPage.js.map +1 -1
- package/dist/mybodyshield/pages/_shared/visuals.d.ts +2 -1
- package/dist/mybodyshield/pages/_shared/visuals.d.ts.map +1 -1
- package/dist/mybodyshield/pages/_shared/visuals.js +91 -81
- package/dist/mybodyshield/pages/_shared/visuals.js.map +1 -1
- package/dist/mybodyshield/pages/ai/AiControlsPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/ai/AiControlsPage.js +255 -266
- package/dist/mybodyshield/pages/ai/AiControlsPage.js.map +1 -1
- package/dist/mybodyshield/pages/coaching/CoachingPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/coaching/CoachingPage.js +321 -301
- package/dist/mybodyshield/pages/coaching/CoachingPage.js.map +1 -1
- package/dist/mybodyshield/pages/goals/GoalsPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/goals/GoalsPage.js +247 -251
- package/dist/mybodyshield/pages/goals/GoalsPage.js.map +1 -1
- package/dist/mybodyshield/pages/insights/InsightsCharts.d.ts.map +1 -1
- package/dist/mybodyshield/pages/insights/InsightsCharts.js +216 -213
- package/dist/mybodyshield/pages/insights/InsightsCharts.js.map +1 -1
- package/dist/mybodyshield/pages/insights/InsightsPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/insights/InsightsPage.js +290 -284
- package/dist/mybodyshield/pages/insights/InsightsPage.js.map +1 -1
- package/dist/mybodyshield/pages/nutrition/NutritionPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/nutrition/NutritionPage.js +575 -529
- package/dist/mybodyshield/pages/nutrition/NutritionPage.js.map +1 -1
- package/dist/mybodyshield/pages/programs/ProgramDetailPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/programs/ProgramDetailPage.js +333 -275
- package/dist/mybodyshield/pages/programs/ProgramDetailPage.js.map +1 -1
- package/dist/mybodyshield/pages/programs/ProgramsPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/programs/ProgramsPage.js +258 -253
- package/dist/mybodyshield/pages/programs/ProgramsPage.js.map +1 -1
- package/dist/mybodyshield/pages/progress/ProgressPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/progress/ProgressPage.js +271 -254
- package/dist/mybodyshield/pages/progress/ProgressPage.js.map +1 -1
- package/dist/mybodyshield/pages/recovery/RecoveryPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/recovery/RecoveryPage.js +206 -200
- package/dist/mybodyshield/pages/recovery/RecoveryPage.js.map +1 -1
- package/dist/mybodyshield/pages/train/SessionDetailPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/train/SessionDetailPage.js +327 -294
- package/dist/mybodyshield/pages/train/SessionDetailPage.js.map +1 -1
- package/dist/mybodyshield/pages/train/SessionsPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/train/SessionsPage.js +180 -163
- package/dist/mybodyshield/pages/train/SessionsPage.js.map +1 -1
- package/dist/mybodyshield/utils/i18n.d.ts +1 -2
- package/dist/mybodyshield/utils/i18n.d.ts.map +1 -1
- package/dist/mybodyshield/utils/i18n.js +15 -0
- package/dist/mybodyshield/utils/i18n.js.map +1 -0
- package/package.json +1 -1
|
@@ -3,36 +3,41 @@ import { MetricsCard as t } from "../../components/MetricsCard.js";
|
|
|
3
3
|
import { formatDate as n, formatEnumLabel as r, formatNumber as i, formatPercent as a, formatRelativeTime as o } from "../../utils/formatters.js";
|
|
4
4
|
import { StatusBadge as s } from "../../components/StatusBadge.js";
|
|
5
5
|
import { EmptyState as c } from "../../components/EmptyState.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { MiniBar as p } from "../../components/MiniBar.js";
|
|
10
|
-
import { useMybAchieveGoal as m, useMybCreateGoal as h, useMybGoals as g, useMybUpdateGoal as _ } from "../../hooks/useMyBodyShieldApi.js";
|
|
11
|
-
import { useOffsetPager as v } from "../../hooks/usePager.js";
|
|
6
|
+
import { useMybAchieveGoal as l, useMybCreateGoal as u, useMybGoals as d, useMybUpdateGoal as f } from "../../hooks/useMyBodyShieldApi.js";
|
|
7
|
+
import { useOffsetPager as p } from "../../hooks/usePager.js";
|
|
8
|
+
import { useTr as m } from "../../hooks/useTr.js";
|
|
12
9
|
import "../../hooks/index.js";
|
|
10
|
+
import { ErrorView as h, LoadingView as g } from "../../components/StateViews.js";
|
|
11
|
+
import { FilterTabs as _ } from "../../components/FilterTabs.js";
|
|
12
|
+
import { Pagination as ee } from "../../components/Pagination.js";
|
|
13
|
+
import { MiniBar as v } from "../../components/MiniBar.js";
|
|
13
14
|
import "../../components/index.js";
|
|
14
15
|
import { motion as y } from "../../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
|
|
15
16
|
import { useReducedMotion as b } from "../../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js";
|
|
16
17
|
import { GOAL_TYPE_META as x, IconChip as S, Meter as C, computeGoalProgress as w } from "../_shared/visuals.js";
|
|
17
|
-
import { useMemo as
|
|
18
|
-
import { CalendarClock as E, CheckCircle2 as D, Plus as O, Target as k, TrendingUp as
|
|
19
|
-
import { Fragment as
|
|
20
|
-
import { Button as
|
|
18
|
+
import { useMemo as te, useState as T } from "react";
|
|
19
|
+
import { CalendarClock as E, CheckCircle2 as D, Plus as O, Target as k, TrendingUp as ne, Trophy as A } from "lucide-react";
|
|
20
|
+
import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
21
|
+
import { Button as P, GlassCard as F, Input as I, Label as L, ResponsiveDialog as R, ResponsiveDialogContent as z, ResponsiveDialogDescription as B, ResponsiveDialogFooter as V, ResponsiveDialogHeader as H, ResponsiveDialogTitle as U, Select as W, SelectContent as G, SelectItem as K, SelectTrigger as q, SelectValue as J, Textarea as re } from "@burdenoff/fe-libs/ui";
|
|
21
22
|
//#region src/mybodyshield/pages/goals/GoalsPage.tsx
|
|
22
|
-
var Y = 12, X = 100
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
var Y = 12, X = 100;
|
|
24
|
+
function ie(e) {
|
|
25
|
+
return [
|
|
26
|
+
{
|
|
27
|
+
value: "ALL",
|
|
28
|
+
label: e("mybodyshield.common.all", "All")
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
value: "ACTIVE",
|
|
32
|
+
label: e("mybodyshield.common.active", "Active")
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
value: "ACHIEVED",
|
|
36
|
+
label: e("mybodyshield.pages.goals.achieved", "Achieved")
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
var ae = [
|
|
36
41
|
"WEIGHT_LOSS",
|
|
37
42
|
"MUSCLE_GAIN",
|
|
38
43
|
"STRENGTH",
|
|
@@ -55,261 +60,257 @@ var Q = {
|
|
|
55
60
|
targetDate: "",
|
|
56
61
|
description: ""
|
|
57
62
|
};
|
|
58
|
-
function
|
|
59
|
-
let n =
|
|
60
|
-
e || (
|
|
61
|
-
},
|
|
62
|
-
let e =
|
|
63
|
+
function oe({ open: e, onOpenChange: t }) {
|
|
64
|
+
let n = m(), i = u(), [a, o] = T(Q), [s, c] = T(null), l = (e) => {
|
|
65
|
+
e || (o(Q), c(null)), t(e);
|
|
66
|
+
}, d = async () => {
|
|
67
|
+
let e = a.title.trim();
|
|
63
68
|
if (!e) {
|
|
64
|
-
|
|
69
|
+
c(n("mybodyshield.pages.goals.goalTitleRequired", "Goal title is required."));
|
|
65
70
|
return;
|
|
66
71
|
}
|
|
67
|
-
|
|
72
|
+
c(null);
|
|
68
73
|
let r = {
|
|
69
74
|
title: e,
|
|
70
|
-
type:
|
|
71
|
-
description:
|
|
72
|
-
baselineValue: Z(
|
|
73
|
-
targetValue: Z(
|
|
74
|
-
unit:
|
|
75
|
-
targetDate:
|
|
75
|
+
type: a.type,
|
|
76
|
+
description: a.description.trim() || void 0,
|
|
77
|
+
baselineValue: Z(a.baselineValue),
|
|
78
|
+
targetValue: Z(a.targetValue),
|
|
79
|
+
unit: a.unit.trim() || void 0,
|
|
80
|
+
targetDate: a.targetDate ? new Date(a.targetDate).toISOString() : void 0
|
|
76
81
|
};
|
|
77
82
|
try {
|
|
78
|
-
await
|
|
83
|
+
await i.mutateAsync(r), o(Q), t(!1);
|
|
79
84
|
} catch (e) {
|
|
80
|
-
|
|
85
|
+
c(e instanceof Error ? e.message : n("mybodyshield.pages.goals.failedToCreate", "Failed to create goal."));
|
|
81
86
|
}
|
|
82
87
|
};
|
|
83
|
-
return /* @__PURE__ */
|
|
88
|
+
return /* @__PURE__ */ M(R, {
|
|
84
89
|
open: e,
|
|
85
|
-
onOpenChange:
|
|
86
|
-
children: /* @__PURE__ */
|
|
90
|
+
onOpenChange: l,
|
|
91
|
+
children: /* @__PURE__ */ N(z, { children: [/* @__PURE__ */ N(H, { children: [/* @__PURE__ */ M(U, { children: n("mybodyshield.pages.goals.dialogTitle", "New goal") }), /* @__PURE__ */ M(B, { children: n("mybodyshield.pages.goals.dialogDescription", "Set a target across training, nutrition or body composition and track it to completion.") })] }), /* @__PURE__ */ N("form", {
|
|
87
92
|
className: "space-y-4",
|
|
88
93
|
onSubmit: (e) => {
|
|
89
|
-
e.preventDefault(),
|
|
94
|
+
e.preventDefault(), d();
|
|
90
95
|
},
|
|
91
96
|
children: [
|
|
92
|
-
|
|
97
|
+
s && /* @__PURE__ */ M("p", {
|
|
93
98
|
className: "rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
94
|
-
children:
|
|
99
|
+
children: s
|
|
95
100
|
}),
|
|
96
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ N("div", {
|
|
97
102
|
className: "space-y-2",
|
|
98
|
-
children: [/* @__PURE__ */
|
|
103
|
+
children: [/* @__PURE__ */ M(L, {
|
|
99
104
|
htmlFor: "myb-goal-title",
|
|
100
|
-
children: "Title"
|
|
101
|
-
}), /* @__PURE__ */
|
|
105
|
+
children: n("mybodyshield.pages.goals.titleLabel", "Title")
|
|
106
|
+
}), /* @__PURE__ */ M(I, {
|
|
102
107
|
id: "myb-goal-title",
|
|
103
|
-
value:
|
|
104
|
-
onChange: (e) =>
|
|
108
|
+
value: a.title,
|
|
109
|
+
onChange: (e) => o((t) => ({
|
|
105
110
|
...t,
|
|
106
111
|
title: e.target.value
|
|
107
112
|
})),
|
|
108
|
-
placeholder: "e.g., Squat 140 kg"
|
|
113
|
+
placeholder: n("mybodyshield.pages.goals.titlePlaceholder", "e.g., Squat 140 kg")
|
|
109
114
|
})]
|
|
110
115
|
}),
|
|
111
|
-
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ N("div", {
|
|
112
117
|
className: "space-y-2",
|
|
113
|
-
children: [/* @__PURE__ */
|
|
118
|
+
children: [/* @__PURE__ */ M(L, {
|
|
114
119
|
htmlFor: "myb-goal-type",
|
|
115
|
-
children: "Type"
|
|
116
|
-
}), /* @__PURE__ */
|
|
117
|
-
value:
|
|
118
|
-
onValueChange: (e) =>
|
|
120
|
+
children: n("mybodyshield.pages.goals.goalType", "Type")
|
|
121
|
+
}), /* @__PURE__ */ N(W, {
|
|
122
|
+
value: a.type,
|
|
123
|
+
onValueChange: (e) => o((t) => ({
|
|
119
124
|
...t,
|
|
120
125
|
type: e
|
|
121
126
|
})),
|
|
122
|
-
children: [/* @__PURE__ */
|
|
127
|
+
children: [/* @__PURE__ */ M(q, {
|
|
123
128
|
id: "myb-goal-type",
|
|
124
|
-
children: /* @__PURE__ */
|
|
125
|
-
}), /* @__PURE__ */
|
|
129
|
+
children: /* @__PURE__ */ M(J, { placeholder: n("mybodyshield.pages.goals.goalTypePlaceholder", "Select a goal type") })
|
|
130
|
+
}), /* @__PURE__ */ M(G, { children: ae.map((e) => /* @__PURE__ */ M(K, {
|
|
126
131
|
value: e,
|
|
127
132
|
children: r(e)
|
|
128
133
|
}, e)) })]
|
|
129
134
|
})]
|
|
130
135
|
}),
|
|
131
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ N("div", {
|
|
132
137
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
133
138
|
children: [
|
|
134
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ N("div", {
|
|
135
140
|
className: "space-y-2",
|
|
136
|
-
children: [/* @__PURE__ */
|
|
141
|
+
children: [/* @__PURE__ */ M(L, {
|
|
137
142
|
htmlFor: "myb-goal-baseline",
|
|
138
|
-
children: "Baseline"
|
|
139
|
-
}), /* @__PURE__ */
|
|
143
|
+
children: n("mybodyshield.pages.goals.baseline", "Baseline")
|
|
144
|
+
}), /* @__PURE__ */ M(I, {
|
|
140
145
|
id: "myb-goal-baseline",
|
|
141
146
|
type: "number",
|
|
142
147
|
inputMode: "decimal",
|
|
143
|
-
value:
|
|
144
|
-
onChange: (e) =>
|
|
148
|
+
value: a.baselineValue,
|
|
149
|
+
onChange: (e) => o((t) => ({
|
|
145
150
|
...t,
|
|
146
151
|
baselineValue: e.target.value
|
|
147
152
|
})),
|
|
148
153
|
placeholder: "0"
|
|
149
154
|
})]
|
|
150
155
|
}),
|
|
151
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ N("div", {
|
|
152
157
|
className: "space-y-2",
|
|
153
|
-
children: [/* @__PURE__ */
|
|
158
|
+
children: [/* @__PURE__ */ M(L, {
|
|
154
159
|
htmlFor: "myb-goal-target",
|
|
155
|
-
children: "Target"
|
|
156
|
-
}), /* @__PURE__ */
|
|
160
|
+
children: n("mybodyshield.pages.goals.target", "Target")
|
|
161
|
+
}), /* @__PURE__ */ M(I, {
|
|
157
162
|
id: "myb-goal-target",
|
|
158
163
|
type: "number",
|
|
159
164
|
inputMode: "decimal",
|
|
160
|
-
value:
|
|
161
|
-
onChange: (e) =>
|
|
165
|
+
value: a.targetValue,
|
|
166
|
+
onChange: (e) => o((t) => ({
|
|
162
167
|
...t,
|
|
163
168
|
targetValue: e.target.value
|
|
164
169
|
})),
|
|
165
170
|
placeholder: "100"
|
|
166
171
|
})]
|
|
167
172
|
}),
|
|
168
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ N("div", {
|
|
169
174
|
className: "space-y-2",
|
|
170
|
-
children: [/* @__PURE__ */
|
|
175
|
+
children: [/* @__PURE__ */ M(L, {
|
|
171
176
|
htmlFor: "myb-goal-unit",
|
|
172
|
-
children: "Unit"
|
|
173
|
-
}), /* @__PURE__ */
|
|
177
|
+
children: n("mybodyshield.common.unit", "Unit")
|
|
178
|
+
}), /* @__PURE__ */ M(I, {
|
|
174
179
|
id: "myb-goal-unit",
|
|
175
|
-
value:
|
|
176
|
-
onChange: (e) =>
|
|
180
|
+
value: a.unit,
|
|
181
|
+
onChange: (e) => o((t) => ({
|
|
177
182
|
...t,
|
|
178
183
|
unit: e.target.value
|
|
179
184
|
})),
|
|
180
|
-
placeholder: "kg / reps / min"
|
|
185
|
+
placeholder: n("mybodyshield.pages.goals.unitPlaceholder", "kg / reps / min")
|
|
181
186
|
})]
|
|
182
187
|
})
|
|
183
188
|
]
|
|
184
189
|
}),
|
|
185
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ N("div", {
|
|
186
191
|
className: "space-y-2",
|
|
187
|
-
children: [/* @__PURE__ */
|
|
192
|
+
children: [/* @__PURE__ */ M(L, {
|
|
188
193
|
htmlFor: "myb-goal-date",
|
|
189
|
-
children: "Target date"
|
|
190
|
-
}), /* @__PURE__ */
|
|
194
|
+
children: n("mybodyshield.pages.goals.targetDate", "Target date")
|
|
195
|
+
}), /* @__PURE__ */ M(I, {
|
|
191
196
|
id: "myb-goal-date",
|
|
192
197
|
type: "date",
|
|
193
|
-
value:
|
|
194
|
-
onChange: (e) =>
|
|
198
|
+
value: a.targetDate,
|
|
199
|
+
onChange: (e) => o((t) => ({
|
|
195
200
|
...t,
|
|
196
201
|
targetDate: e.target.value
|
|
197
202
|
}))
|
|
198
203
|
})]
|
|
199
204
|
}),
|
|
200
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ N("div", {
|
|
201
206
|
className: "space-y-2",
|
|
202
|
-
children: [/* @__PURE__ */
|
|
207
|
+
children: [/* @__PURE__ */ M(L, {
|
|
203
208
|
htmlFor: "myb-goal-desc",
|
|
204
|
-
children: "Description"
|
|
205
|
-
}), /* @__PURE__ */
|
|
209
|
+
children: n("mybodyshield.common.description", "Description")
|
|
210
|
+
}), /* @__PURE__ */ M(re, {
|
|
206
211
|
id: "myb-goal-desc",
|
|
207
212
|
rows: 3,
|
|
208
|
-
value:
|
|
209
|
-
onChange: (e) =>
|
|
213
|
+
value: a.description,
|
|
214
|
+
onChange: (e) => o((t) => ({
|
|
210
215
|
...t,
|
|
211
216
|
description: e.target.value
|
|
212
217
|
})),
|
|
213
|
-
placeholder: "Why this goal matters and how you'll get there."
|
|
218
|
+
placeholder: n("mybodyshield.pages.goals.descriptionPlaceholder", "Why this goal matters and how you'll get there.")
|
|
214
219
|
})]
|
|
215
220
|
}),
|
|
216
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ N(V, { children: [/* @__PURE__ */ M(P, {
|
|
217
222
|
type: "button",
|
|
218
223
|
variant: "outline",
|
|
219
|
-
onClick: () =>
|
|
220
|
-
disabled:
|
|
221
|
-
children: "Cancel"
|
|
222
|
-
}), /* @__PURE__ */
|
|
224
|
+
onClick: () => l(!1),
|
|
225
|
+
disabled: i.isPending,
|
|
226
|
+
children: n("mybodyshield.common.cancel", "Cancel")
|
|
227
|
+
}), /* @__PURE__ */ M(P, {
|
|
223
228
|
type: "submit",
|
|
224
|
-
disabled:
|
|
225
|
-
children:
|
|
229
|
+
disabled: i.isPending,
|
|
230
|
+
children: i.isPending ? n("mybodyshield.common.creating", "Creating…") : n("mybodyshield.pages.goals.createGoalButton", "Create goal")
|
|
226
231
|
})] })
|
|
227
232
|
]
|
|
228
233
|
})] })
|
|
229
234
|
});
|
|
230
235
|
}
|
|
231
|
-
function
|
|
232
|
-
let n =
|
|
233
|
-
e && e.id !==
|
|
234
|
-
let
|
|
236
|
+
function se({ goal: e, onOpenChange: t }) {
|
|
237
|
+
let n = m(), r = f(), [a, o] = T(""), [s, c] = T(null), [l, u] = T(null);
|
|
238
|
+
e && e.id !== l && (u(e.id), o(String(e.currentValue)), c(null));
|
|
239
|
+
let d = async () => {
|
|
235
240
|
if (!e) return;
|
|
236
|
-
let i = Z(
|
|
241
|
+
let i = Z(a);
|
|
237
242
|
if (i === void 0) {
|
|
238
|
-
|
|
243
|
+
c(n("mybodyshield.pages.goals.enterValidNumber", "Enter a valid number."));
|
|
239
244
|
return;
|
|
240
245
|
}
|
|
241
|
-
|
|
246
|
+
c(null);
|
|
242
247
|
try {
|
|
243
|
-
await
|
|
248
|
+
await r.mutateAsync({
|
|
244
249
|
id: e.id,
|
|
245
250
|
input: { currentValue: i }
|
|
246
251
|
}), t(!1);
|
|
247
252
|
} catch (e) {
|
|
248
|
-
|
|
253
|
+
c(e instanceof Error ? e.message : n("mybodyshield.pages.goals.failedToUpdate", "Failed to update progress."));
|
|
249
254
|
}
|
|
250
255
|
};
|
|
251
|
-
return /* @__PURE__ */
|
|
256
|
+
return /* @__PURE__ */ M(R, {
|
|
252
257
|
open: e != null,
|
|
253
258
|
onOpenChange: t,
|
|
254
|
-
children: /* @__PURE__ */
|
|
259
|
+
children: /* @__PURE__ */ N(z, { children: [/* @__PURE__ */ N(H, { children: [/* @__PURE__ */ M(U, { children: n("mybodyshield.pages.goals.updateProgressTitle", "Update progress") }), /* @__PURE__ */ M(B, { children: e ? e.title : n("mybodyshield.pages.goals.updateProgressDescription", "Log your latest value for this goal.") })] }), /* @__PURE__ */ N("form", {
|
|
255
260
|
className: "space-y-4",
|
|
256
261
|
onSubmit: (e) => {
|
|
257
|
-
e.preventDefault(),
|
|
262
|
+
e.preventDefault(), d();
|
|
258
263
|
},
|
|
259
264
|
children: [
|
|
260
|
-
|
|
265
|
+
s && /* @__PURE__ */ M("p", {
|
|
261
266
|
className: "rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
262
|
-
children:
|
|
267
|
+
children: s
|
|
263
268
|
}),
|
|
264
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ N("div", {
|
|
265
270
|
className: "space-y-2",
|
|
266
271
|
children: [
|
|
267
|
-
/* @__PURE__ */ M(
|
|
272
|
+
/* @__PURE__ */ M(L, {
|
|
268
273
|
htmlFor: "myb-goal-current",
|
|
269
|
-
children:
|
|
274
|
+
children: n("mybodyshield.pages.goals.currentValue", "Current value{{unit}}", { unit: e?.unit ? ` (${e.unit})` : "" })
|
|
270
275
|
}),
|
|
271
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ M(I, {
|
|
272
277
|
id: "myb-goal-current",
|
|
273
278
|
type: "number",
|
|
274
279
|
inputMode: "decimal",
|
|
275
280
|
autoFocus: !0,
|
|
276
|
-
value:
|
|
277
|
-
onChange: (e) =>
|
|
281
|
+
value: a,
|
|
282
|
+
onChange: (e) => o(e.target.value),
|
|
278
283
|
placeholder: "0"
|
|
279
284
|
}),
|
|
280
285
|
e && /* @__PURE__ */ M("p", {
|
|
281
286
|
className: "text-xs text-text-tertiary",
|
|
282
|
-
children:
|
|
283
|
-
"Target: ",
|
|
284
|
-
i(e.targetValue),
|
|
285
|
-
e.unit ? ` ${e.unit}` : ""
|
|
286
|
-
]
|
|
287
|
+
children: n("mybodyshield.pages.goals.targetValue", "Target: {{value}}", { value: i(e.targetValue) + (e.unit ? ` ${e.unit}` : "") })
|
|
287
288
|
})
|
|
288
289
|
]
|
|
289
290
|
}),
|
|
290
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ N(V, { children: [/* @__PURE__ */ M(P, {
|
|
291
292
|
type: "button",
|
|
292
293
|
variant: "outline",
|
|
293
294
|
onClick: () => t(!1),
|
|
294
|
-
disabled:
|
|
295
|
-
children: "Cancel"
|
|
296
|
-
}), /* @__PURE__ */
|
|
295
|
+
disabled: r.isPending,
|
|
296
|
+
children: n("mybodyshield.common.cancel", "Cancel")
|
|
297
|
+
}), /* @__PURE__ */ M(P, {
|
|
297
298
|
type: "submit",
|
|
298
|
-
disabled:
|
|
299
|
-
children:
|
|
299
|
+
disabled: r.isPending,
|
|
300
|
+
children: r.isPending ? n("mybodyshield.common.saving", "Saving…") : n("mybodyshield.pages.goals.saveProgress", "Save progress")
|
|
300
301
|
})] })
|
|
301
302
|
]
|
|
302
303
|
})] })
|
|
303
304
|
});
|
|
304
305
|
}
|
|
305
|
-
var
|
|
306
|
+
var ce = [
|
|
306
307
|
.22,
|
|
307
308
|
1,
|
|
308
309
|
.36,
|
|
309
310
|
1
|
|
310
311
|
], $ = ({ index: e = 0, hover: t = !1, className: n, children: r }) => {
|
|
311
312
|
let i = b();
|
|
312
|
-
return /* @__PURE__ */
|
|
313
|
+
return /* @__PURE__ */ M(y.div, {
|
|
313
314
|
className: n,
|
|
314
315
|
initial: i ? !1 : {
|
|
315
316
|
opacity: 0,
|
|
@@ -322,180 +323,175 @@ var se = [
|
|
|
322
323
|
transition: i ? { duration: 0 } : {
|
|
323
324
|
duration: .35,
|
|
324
325
|
delay: Math.min(e * .05, .45),
|
|
325
|
-
ease:
|
|
326
|
+
ease: ce
|
|
326
327
|
},
|
|
327
328
|
whileHover: i || !t ? void 0 : { y: -4 },
|
|
328
329
|
children: r
|
|
329
330
|
});
|
|
330
331
|
};
|
|
331
|
-
function
|
|
332
|
-
let d = x[e.type],
|
|
333
|
-
return /* @__PURE__ */
|
|
332
|
+
function le({ goal: e, index: t, onUpdateProgress: c, onAchieve: l, isAchieving: u }) {
|
|
333
|
+
let d = m(), f = x[e.type], p = f.icon, h = w(e), g = e.unit ? ` ${e.unit}` : "", _ = e.status === "ACHIEVED";
|
|
334
|
+
return /* @__PURE__ */ M($, {
|
|
334
335
|
index: t,
|
|
335
336
|
hover: !0,
|
|
336
337
|
className: "h-full",
|
|
337
|
-
children: /* @__PURE__ */
|
|
338
|
+
children: /* @__PURE__ */ N(F, {
|
|
338
339
|
treatment: "glass",
|
|
339
|
-
glow:
|
|
340
|
+
glow: _,
|
|
340
341
|
className: "flex h-full flex-col gap-3.5 p-5 transition-shadow hover:shadow-[var(--shadow-pop-hover)]",
|
|
341
342
|
children: [
|
|
342
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ N("div", {
|
|
343
344
|
className: "flex items-start justify-between gap-3",
|
|
344
|
-
children: [/* @__PURE__ */
|
|
345
|
+
children: [/* @__PURE__ */ N("div", {
|
|
345
346
|
className: "flex min-w-0 items-start gap-3",
|
|
346
|
-
children: [/* @__PURE__ */
|
|
347
|
-
icon: /* @__PURE__ */
|
|
348
|
-
tint:
|
|
349
|
-
}), /* @__PURE__ */
|
|
347
|
+
children: [/* @__PURE__ */ M(S, {
|
|
348
|
+
icon: /* @__PURE__ */ M(p, { className: "h-4 w-4" }),
|
|
349
|
+
tint: f.tint
|
|
350
|
+
}), /* @__PURE__ */ N("div", {
|
|
350
351
|
className: "min-w-0",
|
|
351
|
-
children: [/* @__PURE__ */
|
|
352
|
+
children: [/* @__PURE__ */ M("p", {
|
|
352
353
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
353
354
|
children: e.title
|
|
354
|
-
}), /* @__PURE__ */
|
|
355
|
+
}), /* @__PURE__ */ M("span", {
|
|
355
356
|
className: "mt-1 inline-flex items-center rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary",
|
|
356
357
|
children: r(e.type)
|
|
357
358
|
})]
|
|
358
359
|
})]
|
|
359
|
-
}), /* @__PURE__ */
|
|
360
|
+
}), /* @__PURE__ */ M(s, { status: e.status })]
|
|
360
361
|
}),
|
|
361
|
-
e.description && /* @__PURE__ */
|
|
362
|
+
e.description && /* @__PURE__ */ M("p", {
|
|
362
363
|
className: "line-clamp-2 text-xs text-text-secondary",
|
|
363
364
|
children: e.description
|
|
364
365
|
}),
|
|
365
|
-
/* @__PURE__ */
|
|
366
|
+
/* @__PURE__ */ N("div", {
|
|
366
367
|
className: "space-y-2",
|
|
367
|
-
children: [/* @__PURE__ */
|
|
368
|
+
children: [/* @__PURE__ */ N("div", {
|
|
368
369
|
className: "flex items-end justify-between gap-2",
|
|
369
|
-
children: [/* @__PURE__ */
|
|
370
|
+
children: [/* @__PURE__ */ N("span", {
|
|
370
371
|
className: "tabular-nums text-sm text-text-secondary",
|
|
371
|
-
children: [/* @__PURE__ */
|
|
372
|
+
children: [/* @__PURE__ */ N("span", {
|
|
372
373
|
className: "font-semibold text-text-primary",
|
|
373
|
-
children: [i(e.currentValue),
|
|
374
|
-
}), /* @__PURE__ */
|
|
374
|
+
children: [i(e.currentValue), g]
|
|
375
|
+
}), /* @__PURE__ */ N("span", {
|
|
375
376
|
className: "text-text-tertiary",
|
|
376
377
|
children: [
|
|
377
378
|
" ",
|
|
378
379
|
"/ ",
|
|
379
380
|
i(e.targetValue),
|
|
380
|
-
|
|
381
|
+
g
|
|
381
382
|
]
|
|
382
383
|
})]
|
|
383
|
-
}), /* @__PURE__ */
|
|
384
|
+
}), /* @__PURE__ */ M("span", {
|
|
384
385
|
className: "text-lg font-bold leading-none tabular-nums text-action-primary-bg",
|
|
385
|
-
children: a(
|
|
386
|
+
children: a(h)
|
|
386
387
|
})]
|
|
387
|
-
}), /* @__PURE__ */
|
|
388
|
-
value:
|
|
388
|
+
}), /* @__PURE__ */ M(C, {
|
|
389
|
+
value: h,
|
|
389
390
|
height: 10
|
|
390
391
|
})]
|
|
391
392
|
}),
|
|
392
|
-
(e.targetDate ||
|
|
393
|
+
(e.targetDate || _ && e.achievedAt) && /* @__PURE__ */ N("div", {
|
|
393
394
|
className: "flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-text-tertiary",
|
|
394
|
-
children: [e.targetDate && /* @__PURE__ */
|
|
395
|
+
children: [e.targetDate && /* @__PURE__ */ N("span", {
|
|
395
396
|
className: "inline-flex items-center gap-1",
|
|
396
397
|
children: [
|
|
397
|
-
/* @__PURE__ */
|
|
398
|
-
"Target ",
|
|
399
|
-
|
|
400
|
-
/* @__PURE__ */ M("span", {
|
|
398
|
+
/* @__PURE__ */ M(E, { className: "h-3.5 w-3.5" }),
|
|
399
|
+
d("mybodyshield.pages.goals.targetDateLabel", "Target {{date}}", { date: n(e.targetDate) }),
|
|
400
|
+
/* @__PURE__ */ N("span", {
|
|
401
401
|
className: "text-text-secondary",
|
|
402
402
|
children: ["· ", o(e.targetDate)]
|
|
403
403
|
})
|
|
404
404
|
]
|
|
405
|
-
}),
|
|
405
|
+
}), _ && e.achievedAt && /* @__PURE__ */ N("span", {
|
|
406
406
|
className: "inline-flex items-center gap-1 text-status-success-text",
|
|
407
|
-
children: [
|
|
408
|
-
/* @__PURE__ */ j(D, { className: "h-3.5 w-3.5" }),
|
|
409
|
-
"Achieved ",
|
|
410
|
-
n(e.achievedAt)
|
|
411
|
-
]
|
|
407
|
+
children: [/* @__PURE__ */ M(D, { className: "h-3.5 w-3.5" }), d("mybodyshield.pages.goals.achievedDateLabel", "Achieved {{date}}", { date: n(e.achievedAt) })]
|
|
412
408
|
})]
|
|
413
409
|
}),
|
|
414
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ N("div", {
|
|
415
411
|
className: "mt-auto flex flex-wrap gap-2 pt-1",
|
|
416
|
-
children: [/* @__PURE__ */
|
|
412
|
+
children: [/* @__PURE__ */ M(P, {
|
|
417
413
|
variant: "outline",
|
|
418
414
|
size: "sm",
|
|
419
415
|
onClick: () => c(e),
|
|
420
|
-
children: "Update progress"
|
|
421
|
-
}), e.status === "ACTIVE" && /* @__PURE__ */
|
|
416
|
+
children: d("mybodyshield.pages.goals.updateProgress", "Update progress")
|
|
417
|
+
}), e.status === "ACTIVE" && /* @__PURE__ */ M(P, {
|
|
422
418
|
size: "sm",
|
|
423
419
|
onClick: () => l(e),
|
|
424
420
|
disabled: u,
|
|
425
|
-
children: u ? "Marking…" : "Mark achieved"
|
|
421
|
+
children: u ? d("mybodyshield.pages.goals.marking", "Marking…") : d("mybodyshield.pages.goals.markAchieved", "Mark achieved")
|
|
426
422
|
})]
|
|
427
423
|
})
|
|
428
424
|
]
|
|
429
425
|
})
|
|
430
426
|
});
|
|
431
427
|
}
|
|
432
|
-
function
|
|
433
|
-
let
|
|
434
|
-
status:
|
|
428
|
+
function ue() {
|
|
429
|
+
let n = m(), [r, o] = T("ALL"), [s, u] = T(!1), [f, y] = T(null), [b, x] = T(null), [S, C] = T(null), E = p(Y), D = d({
|
|
430
|
+
status: r === "ALL" ? void 0 : r,
|
|
435
431
|
pagination: {
|
|
436
432
|
limit: Y,
|
|
437
|
-
offset:
|
|
433
|
+
offset: E.offset
|
|
438
434
|
}
|
|
439
|
-
}),
|
|
435
|
+
}), F = d({
|
|
440
436
|
status: "ACTIVE",
|
|
441
437
|
pagination: { limit: X }
|
|
442
|
-
}),
|
|
438
|
+
}), I = d({
|
|
443
439
|
status: "ACHIEVED",
|
|
444
440
|
pagination: { limit: X }
|
|
445
|
-
}),
|
|
446
|
-
|
|
447
|
-
},
|
|
448
|
-
|
|
441
|
+
}), L = l(), R = D.data?.items ?? [], z = F.data?.items ?? [], B = I.data?.items ?? [], V = te(() => z.length === 0 ? 0 : z.reduce((e, t) => e + w(t), 0) / z.length, [z]), H = (e) => {
|
|
442
|
+
o(e), E.reset();
|
|
443
|
+
}, U = async (e) => {
|
|
444
|
+
x(e.id), C(null);
|
|
449
445
|
try {
|
|
450
|
-
await
|
|
446
|
+
await L.mutateAsync(e.id);
|
|
451
447
|
} catch (e) {
|
|
452
|
-
|
|
448
|
+
C(e instanceof Error ? e.message : n("mybodyshield.pages.goals.failedToAchieve", "Failed to mark goal as achieved."));
|
|
453
449
|
} finally {
|
|
454
|
-
|
|
450
|
+
x(null);
|
|
455
451
|
}
|
|
456
|
-
},
|
|
457
|
-
return /* @__PURE__ */
|
|
458
|
-
title: "Goals",
|
|
459
|
-
description: "Targets across training, nutrition and body composition.",
|
|
460
|
-
actions: /* @__PURE__ */
|
|
461
|
-
onClick: () =>
|
|
462
|
-
children: [/* @__PURE__ */
|
|
452
|
+
}, W = D.isLoading && !D.data, G = ie(n);
|
|
453
|
+
return /* @__PURE__ */ N(e, {
|
|
454
|
+
title: n("mybodyshield.pages.goals.title", "Goals"),
|
|
455
|
+
description: n("mybodyshield.pages.goals.description", "Targets across training, nutrition and body composition."),
|
|
456
|
+
actions: /* @__PURE__ */ N(P, {
|
|
457
|
+
onClick: () => u(!0),
|
|
458
|
+
children: [/* @__PURE__ */ M(O, { className: "mr-2 h-4 w-4" }), n("mybodyshield.pages.goals.newGoal", "New goal")]
|
|
463
459
|
}),
|
|
464
460
|
children: [
|
|
465
|
-
/* @__PURE__ */
|
|
461
|
+
/* @__PURE__ */ N("div", {
|
|
466
462
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
467
463
|
children: [
|
|
468
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ M($, {
|
|
469
465
|
index: 0,
|
|
470
466
|
className: "h-full",
|
|
471
|
-
children: /* @__PURE__ */
|
|
467
|
+
children: /* @__PURE__ */ M(t, {
|
|
472
468
|
className: "h-full",
|
|
473
|
-
icon: /* @__PURE__ */
|
|
474
|
-
value: i(
|
|
475
|
-
label: "Active goals"
|
|
469
|
+
icon: /* @__PURE__ */ M(k, { className: "h-5 w-5" }),
|
|
470
|
+
value: i(F.data ? z.length : void 0),
|
|
471
|
+
label: n("mybodyshield.pages.goals.activeGoals", "Active goals")
|
|
476
472
|
})
|
|
477
473
|
}),
|
|
478
|
-
/* @__PURE__ */
|
|
474
|
+
/* @__PURE__ */ M($, {
|
|
479
475
|
index: 1,
|
|
480
476
|
className: "h-full",
|
|
481
|
-
children: /* @__PURE__ */
|
|
477
|
+
children: /* @__PURE__ */ M(t, {
|
|
482
478
|
className: "h-full",
|
|
483
|
-
icon: /* @__PURE__ */
|
|
484
|
-
value: i(
|
|
485
|
-
label: "Achieved",
|
|
479
|
+
icon: /* @__PURE__ */ M(A, { className: "h-5 w-5" }),
|
|
480
|
+
value: i(I.data ? B.length : void 0),
|
|
481
|
+
label: n("mybodyshield.pages.goals.achieved", "Achieved"),
|
|
486
482
|
accent: "success"
|
|
487
483
|
})
|
|
488
484
|
}),
|
|
489
|
-
/* @__PURE__ */
|
|
485
|
+
/* @__PURE__ */ M($, {
|
|
490
486
|
index: 2,
|
|
491
487
|
className: "h-full",
|
|
492
|
-
children: /* @__PURE__ */
|
|
488
|
+
children: /* @__PURE__ */ M(t, {
|
|
493
489
|
className: "h-full",
|
|
494
|
-
icon: /* @__PURE__ */
|
|
495
|
-
value:
|
|
496
|
-
label: "Avg progress (active)",
|
|
497
|
-
footer: /* @__PURE__ */
|
|
498
|
-
value:
|
|
490
|
+
icon: /* @__PURE__ */ M(ne, { className: "h-5 w-5" }),
|
|
491
|
+
value: F.data ? a(V) : "—",
|
|
492
|
+
label: n("mybodyshield.pages.goals.avgProgress", "Avg progress (active)"),
|
|
493
|
+
footer: /* @__PURE__ */ M(v, {
|
|
494
|
+
value: V,
|
|
499
495
|
height: 4,
|
|
500
496
|
barClassName: "bg-action-primary-bg"
|
|
501
497
|
})
|
|
@@ -503,63 +499,63 @@ function le() {
|
|
|
503
499
|
})
|
|
504
500
|
]
|
|
505
501
|
}),
|
|
506
|
-
/* @__PURE__ */
|
|
502
|
+
/* @__PURE__ */ M("div", {
|
|
507
503
|
className: "mt-6",
|
|
508
|
-
children: /* @__PURE__ */
|
|
509
|
-
options:
|
|
510
|
-
value:
|
|
511
|
-
onChange:
|
|
504
|
+
children: /* @__PURE__ */ M(_, {
|
|
505
|
+
options: G,
|
|
506
|
+
value: r,
|
|
507
|
+
onChange: H
|
|
512
508
|
})
|
|
513
509
|
}),
|
|
514
|
-
|
|
510
|
+
S && /* @__PURE__ */ M("p", {
|
|
515
511
|
className: "mt-4 rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
516
|
-
children:
|
|
512
|
+
children: S
|
|
517
513
|
}),
|
|
518
|
-
/* @__PURE__ */
|
|
514
|
+
/* @__PURE__ */ M("div", {
|
|
519
515
|
className: "mt-4",
|
|
520
|
-
children:
|
|
521
|
-
message: "We couldn't load your goals.",
|
|
522
|
-
onRetry: () => void
|
|
523
|
-
}) :
|
|
516
|
+
children: W ? /* @__PURE__ */ M(g, { label: n("mybodyshield.pages.goals.loading", "Loading your goals…") }) : D.isError ? /* @__PURE__ */ M(h, {
|
|
517
|
+
message: n("mybodyshield.pages.goals.error", "We couldn't load your goals."),
|
|
518
|
+
onRetry: () => void D.refetch()
|
|
519
|
+
}) : R.length === 0 ? /* @__PURE__ */ M(c, {
|
|
524
520
|
illustration: "empty-data",
|
|
525
|
-
icon: /* @__PURE__ */
|
|
526
|
-
title:
|
|
527
|
-
description:
|
|
528
|
-
action: /* @__PURE__ */
|
|
529
|
-
onClick: () =>
|
|
530
|
-
children: [/* @__PURE__ */
|
|
521
|
+
icon: /* @__PURE__ */ M(k, { className: "h-10 w-10" }),
|
|
522
|
+
title: r === "ALL" ? n("mybodyshield.pages.goals.emptyTitle", "No goals yet") : n("mybodyshield.pages.goals.emptyFilteredTitle", "No goals match this filter"),
|
|
523
|
+
description: r === "ALL" ? n("mybodyshield.pages.goals.emptyDescription", "Set a goal to give your training and nutrition a clear target to work toward.") : n("mybodyshield.pages.goals.emptyFilteredDescription", "Try a different status filter, or create a new goal."),
|
|
524
|
+
action: /* @__PURE__ */ N(P, {
|
|
525
|
+
onClick: () => u(!0),
|
|
526
|
+
children: [/* @__PURE__ */ M(O, { className: "mr-2 h-4 w-4" }), n("mybodyshield.pages.goals.newGoal", "New goal")]
|
|
531
527
|
})
|
|
532
|
-
}) : /* @__PURE__ */
|
|
528
|
+
}) : /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M("div", {
|
|
533
529
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
534
|
-
children:
|
|
530
|
+
children: R.map((e, t) => /* @__PURE__ */ M(le, {
|
|
535
531
|
goal: e,
|
|
536
532
|
index: t,
|
|
537
|
-
onUpdateProgress:
|
|
538
|
-
onAchieve: (e) => void
|
|
539
|
-
isAchieving:
|
|
533
|
+
onUpdateProgress: y,
|
|
534
|
+
onAchieve: (e) => void U(e),
|
|
535
|
+
isAchieving: b === e.id
|
|
540
536
|
}, e.id))
|
|
541
|
-
}), /* @__PURE__ */
|
|
542
|
-
page:
|
|
537
|
+
}), /* @__PURE__ */ M(ee, {
|
|
538
|
+
page: E.page,
|
|
543
539
|
pageSize: Y,
|
|
544
|
-
itemCount:
|
|
545
|
-
hasMore:
|
|
546
|
-
onPageChange: (e) =>
|
|
540
|
+
itemCount: R.length,
|
|
541
|
+
hasMore: D.data?.pageInfo?.hasMore ?? !1,
|
|
542
|
+
onPageChange: (e) => E.onPageChange(e)
|
|
547
543
|
})] })
|
|
548
544
|
}),
|
|
549
|
-
/* @__PURE__ */
|
|
550
|
-
open:
|
|
551
|
-
onOpenChange:
|
|
545
|
+
/* @__PURE__ */ M(oe, {
|
|
546
|
+
open: s,
|
|
547
|
+
onOpenChange: u
|
|
552
548
|
}),
|
|
553
|
-
/* @__PURE__ */
|
|
554
|
-
goal:
|
|
549
|
+
/* @__PURE__ */ M(se, {
|
|
550
|
+
goal: f,
|
|
555
551
|
onOpenChange: (e) => {
|
|
556
|
-
e ||
|
|
552
|
+
e || y(null);
|
|
557
553
|
}
|
|
558
554
|
})
|
|
559
555
|
]
|
|
560
556
|
});
|
|
561
557
|
}
|
|
562
558
|
//#endregion
|
|
563
|
-
export {
|
|
559
|
+
export { ue as GoalsPage };
|
|
564
560
|
|
|
565
561
|
//# sourceMappingURL=GoalsPage.js.map
|