@burdenoff/microfe-mybodyshield 2026.720.1 → 2026.720.3

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.
@@ -4,47 +4,48 @@ 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 c, LoadingView as l } from "../../components/StateViews.js";
8
- import { FilterTabs as ee } from "../../components/FilterTabs.js";
9
- import { Pagination as te } from "../../components/Pagination.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
10
  import "../../context/index.js";
11
- import { useMybCreateProgram as ne, useMybPrograms as u } from "../../hooks/useMyBodyShieldApi.js";
12
- import { useOffsetPager as re } from "../../hooks/usePager.js";
13
- import { useMyBodyShieldAnalytics as ie } from "../../hooks/useMyBodyShieldAnalytics.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";
14
14
  import "../../hooks/index.js";
15
15
  import "../../components/index.js";
16
- import { motion as d } from "../../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
17
- import { useReducedMotion as f } from "../../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js";
18
- import { GOAL_TYPE_META as p, IconChip as m } from "../_shared/visuals.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";
19
20
  import { useMemo as h, useState as g } from "react";
20
- import { Clock as _, Dumbbell as v, FilePenLine as ae, Layers as oe, Plus as y } from "lucide-react";
21
+ import { Clock as _, Dumbbell as v, FilePenLine as ce, Layers as le, Plus as y } from "lucide-react";
21
22
  import { jsx as b, jsxs as x } from "react/jsx-runtime";
22
- import { Button as S, GlassCard as C, Input as w, Label as T, ResponsiveDialog as E, ResponsiveDialogContent as se, ResponsiveDialogDescription as ce, ResponsiveDialogFooter as D, ResponsiveDialogHeader as O, ResponsiveDialogTitle as le, Select as k, SelectContent as A, SelectItem as j, SelectTrigger as M, SelectValue as N, Textarea as ue } from "@burdenoff/fe-libs/ui";
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";
23
24
  //#region src/mybodyshield/pages/programs/ProgramsPage.tsx
24
- var P = 24, de = [
25
+ var j = "blank", M = 24, _e = [
25
26
  "ALL",
26
27
  "DRAFT",
27
28
  "ACTIVE",
28
29
  "COMPLETED",
29
30
  "ARCHIVED"
30
- ], F = [
31
+ ], N = [
31
32
  "WEIGHT_LOSS",
32
33
  "MUSCLE_GAIN",
33
34
  "STRENGTH",
34
35
  "ENDURANCE",
35
36
  "MOBILITY",
36
37
  "GENERAL_FITNESS"
37
- ], fe = [
38
+ ], ve = [
38
39
  "BEGINNER",
39
40
  "INTERMEDIATE",
40
41
  "ADVANCED",
41
42
  "ELITE"
42
- ], pe = [
43
+ ], ye = [
43
44
  "BUILD",
44
45
  "PEAK",
45
46
  "DELOAD",
46
47
  "MAINTENANCE"
47
- ], I = {
48
+ ], P = {
48
49
  name: "",
49
50
  description: "",
50
51
  goalType: "GENERAL_FITNESS",
@@ -53,19 +54,19 @@ var P = 24, de = [
53
54
  weeks: "",
54
55
  daysPerWeek: "",
55
56
  startDate: ""
56
- }, L = (e) => {
57
+ }, F = (e) => {
57
58
  let t = e.trim();
58
59
  if (t === "") return null;
59
60
  let n = Number(t);
60
61
  return Number.isFinite(n) ? n : null;
61
- }, R = [
62
+ }, I = [
62
63
  .22,
63
64
  1,
64
65
  .36,
65
66
  1
66
- ], z = ({ index: e = 0, hover: t = !1, className: n, children: r }) => {
67
- let i = f();
68
- return /* @__PURE__ */ b(d.div, {
67
+ ], L = ({ index: e = 0, hover: t = !1, className: n, children: r }) => {
68
+ let i = d();
69
+ return /* @__PURE__ */ b(u.div, {
69
70
  className: n,
70
71
  initial: i ? !1 : {
71
72
  opacity: 0,
@@ -78,32 +79,32 @@ var P = 24, de = [
78
79
  transition: i ? { duration: 0 } : {
79
80
  duration: .35,
80
81
  delay: Math.min(e * .05, .45),
81
- ease: R
82
+ ease: I
82
83
  },
83
84
  whileHover: i || !t ? void 0 : { y: -4 },
84
85
  children: r
85
86
  });
86
87
  };
87
- function B({ id: e, value: t, onChange: n, options: i }) {
88
- return /* @__PURE__ */ x(k, {
88
+ function R({ id: e, value: t, onChange: n, options: i }) {
89
+ return /* @__PURE__ */ x(E, {
89
90
  value: t,
90
91
  onValueChange: (e) => n(e),
91
- children: [/* @__PURE__ */ b(M, {
92
+ children: [/* @__PURE__ */ b(k, {
92
93
  id: e,
93
- children: /* @__PURE__ */ b(N, {})
94
- }), /* @__PURE__ */ b(A, { children: i.map((e) => /* @__PURE__ */ b(j, {
94
+ children: /* @__PURE__ */ b(A, {})
95
+ }), /* @__PURE__ */ b(D, { children: i.map((e) => /* @__PURE__ */ b(O, {
95
96
  value: e,
96
97
  children: r(e)
97
98
  }, e)) })]
98
99
  });
99
100
  }
100
- function me({ program: e, index: t, onOpen: n }) {
101
- let s = p[e.goalType], c = s.icon, l = [
101
+ function be({ program: e, index: t, onOpen: n }) {
102
+ let s = f[e.goalType], ee = s.icon, c = [
102
103
  e.phase,
103
104
  e.level,
104
105
  e.goalType
105
106
  ].map((e) => r(e)).join(" · ");
106
- return /* @__PURE__ */ b(z, {
107
+ return /* @__PURE__ */ b(L, {
107
108
  index: t,
108
109
  hover: !0,
109
110
  className: "h-full",
@@ -119,8 +120,8 @@ function me({ program: e, index: t, onOpen: n }) {
119
120
  className: "flex items-start justify-between gap-3",
120
121
  children: [/* @__PURE__ */ x("div", {
121
122
  className: "flex min-w-0 items-start gap-3",
122
- children: [/* @__PURE__ */ b(m, {
123
- icon: /* @__PURE__ */ b(c, { className: "h-4 w-4" }),
123
+ children: [/* @__PURE__ */ b(p, {
124
+ icon: /* @__PURE__ */ b(ee, { className: "h-4 w-4" }),
124
125
  tint: s.tint
125
126
  }), /* @__PURE__ */ x("div", {
126
127
  className: "min-w-0",
@@ -129,7 +130,7 @@ function me({ program: e, index: t, onOpen: n }) {
129
130
  children: e.name
130
131
  }), /* @__PURE__ */ b("p", {
131
132
  className: "mt-0.5 truncate text-xs text-text-tertiary",
132
- children: l
133
+ children: c
133
134
  })]
134
135
  })]
135
136
  }), /* @__PURE__ */ b(o, { status: e.status })]
@@ -166,8 +167,8 @@ function me({ program: e, index: t, onOpen: n }) {
166
167
  })
167
168
  });
168
169
  }
169
- function V() {
170
- let { navigateTo: a, workspaceId: o } = e(), d = re(P), f = ie(), [p, m] = g("ALL"), [_, C] = g("ALL"), [R, V] = g(!1), [H, U] = g(I), [W, G] = g(null), K = ne(), q = u({ pagination: { limit: 100 } }), J = h(() => q.data?.items ?? [], [q.data]), Y = h(() => {
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(() => {
171
172
  let e = (e) => J.filter((t) => t.status === e).length;
172
173
  return {
173
174
  ALL: J.length,
@@ -176,43 +177,63 @@ function V() {
176
177
  COMPLETED: e("COMPLETED"),
177
178
  ARCHIVED: e("ARCHIVED")
178
179
  };
179
- }, [J]), X = u({
180
- status: p === "ALL" ? void 0 : p,
180
+ }, [J]), X = l({
181
+ status: f === "ALL" ? void 0 : f,
181
182
  pagination: {
182
- limit: P,
183
- offset: d.offset
183
+ limit: M,
184
+ offset: u.offset
184
185
  }
185
- }), Z = X.data?.items ?? [], Q = _ === "ALL" ? Z : Z.filter((e) => e.goalType === _), he = (e) => {
186
- m(e), d.reset();
187
- }, ge = (e) => {
188
- C(e), d.reset();
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();
189
190
  }, $ = () => {
190
- U(I), G(null), V(!0), f.emitIntent("program", "create", { workspaceId: o });
191
- }, _e = async () => {
192
- if (!H.name.trim()) {
191
+ V(P), U(j), G(null), z(!0), d.emitIntent("program", "create", { workspaceId: o });
192
+ }, we = (e) => {
193
+ if (U(e), e === j) return;
194
+ let t = m(e);
195
+ t && V({
196
+ name: t.name,
197
+ description: t.description,
198
+ goalType: t.goalType,
199
+ level: t.level,
200
+ phase: "BUILD",
201
+ weeks: String(t.weeks),
202
+ daysPerWeek: String(t.daysPerWeek),
203
+ startDate: ""
204
+ });
205
+ }, Te = async () => {
206
+ if (!B.name.trim()) {
193
207
  G("Program name is required.");
194
208
  return;
195
209
  }
196
210
  let e = {
197
- name: H.name.trim(),
198
- description: H.description.trim() || null,
199
- goalType: H.goalType,
200
- level: H.level,
201
- phase: H.phase,
202
- weeks: L(H.weeks),
203
- daysPerWeek: L(H.daysPerWeek),
204
- startDate: H.startDate ? new Date(H.startDate).toISOString() : null
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
205
219
  };
206
220
  try {
207
- let t = await K.mutateAsync(e);
208
- f.emitFact("program", "created", {
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({
223
+ programId: t.id,
224
+ name: e.name,
225
+ type: e.type,
226
+ dayOfWeek: e.dayOfWeek,
227
+ weekNumber: e.weekNumber,
228
+ durationMin: e.durationMin
229
+ }))), d.emitFact("program", "created", {
209
230
  workspaceId: o,
210
231
  entityId: t.id
211
- }), V(!1), a(`programs/${t.id}`);
232
+ }), z(!1), a(`programs/${t.id}`);
212
233
  } catch (e) {
213
234
  G(e instanceof Error ? e.message : "Failed to create program.");
214
235
  }
215
- }, ve = de.map((e) => ({
236
+ }, Ee = _e.map((e) => ({
216
237
  value: e,
217
238
  label: e === "ALL" ? "All" : r(e),
218
239
  count: Y[e]
@@ -228,7 +249,7 @@ function V() {
228
249
  /* @__PURE__ */ x("div", {
229
250
  className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
230
251
  children: [
231
- /* @__PURE__ */ b(z, {
252
+ /* @__PURE__ */ b(L, {
232
253
  index: 0,
233
254
  className: "h-full",
234
255
  children: /* @__PURE__ */ b(n, {
@@ -239,22 +260,22 @@ function V() {
239
260
  accent: "success"
240
261
  })
241
262
  }),
242
- /* @__PURE__ */ b(z, {
263
+ /* @__PURE__ */ b(L, {
243
264
  index: 1,
244
265
  className: "h-full",
245
266
  children: /* @__PURE__ */ b(n, {
246
267
  className: "h-full",
247
- icon: /* @__PURE__ */ b(ae, { className: "h-5 w-5" }),
268
+ icon: /* @__PURE__ */ b(ce, { className: "h-5 w-5" }),
248
269
  value: i(Y.DRAFT),
249
270
  label: "Draft programs"
250
271
  })
251
272
  }),
252
- /* @__PURE__ */ b(z, {
273
+ /* @__PURE__ */ b(L, {
253
274
  index: 2,
254
275
  className: "h-full",
255
276
  children: /* @__PURE__ */ b(n, {
256
277
  className: "h-full",
257
- icon: /* @__PURE__ */ b(oe, { className: "h-5 w-5" }),
278
+ icon: /* @__PURE__ */ b(le, { className: "h-5 w-5" }),
258
279
  value: i(Y.ALL),
259
280
  label: "Total programs"
260
281
  })
@@ -263,10 +284,10 @@ function V() {
263
284
  }),
264
285
  /* @__PURE__ */ x("div", {
265
286
  className: "mt-6 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
266
- children: [/* @__PURE__ */ b(ee, {
267
- options: ve,
268
- value: p,
269
- onChange: he
287
+ children: [/* @__PURE__ */ b(te, {
288
+ options: Ee,
289
+ value: f,
290
+ onChange: Se
270
291
  }), /* @__PURE__ */ x("div", {
271
292
  className: "flex items-center gap-2",
272
293
  children: [/* @__PURE__ */ b("span", {
@@ -274,13 +295,13 @@ function V() {
274
295
  children: "Goal"
275
296
  }), /* @__PURE__ */ b("div", {
276
297
  className: "w-48",
277
- children: /* @__PURE__ */ x(k, {
298
+ children: /* @__PURE__ */ x(E, {
278
299
  value: _,
279
- onValueChange: (e) => ge(e),
280
- children: [/* @__PURE__ */ b(M, { children: /* @__PURE__ */ b(N, {}) }), /* @__PURE__ */ x(A, { children: [/* @__PURE__ */ b(j, {
300
+ onValueChange: (e) => Ce(e),
301
+ children: [/* @__PURE__ */ b(k, { children: /* @__PURE__ */ b(A, {}) }), /* @__PURE__ */ x(D, { children: [/* @__PURE__ */ b(O, {
281
302
  value: "ALL",
282
303
  children: "All goals"
283
- }), F.map((e) => /* @__PURE__ */ b(j, {
304
+ }), N.map((e) => /* @__PURE__ */ b(O, {
284
305
  value: e,
285
306
  children: r(e)
286
307
  }, e))] })]
@@ -290,13 +311,13 @@ function V() {
290
311
  }),
291
312
  /* @__PURE__ */ x("div", {
292
313
  className: "mt-6",
293
- children: [X.isLoading ? /* @__PURE__ */ b(l, { label: "Loading programs…" }) : X.isError ? /* @__PURE__ */ b(c, {
314
+ children: [X.isLoading ? /* @__PURE__ */ b(c, { label: "Loading programs…" }) : X.isError ? /* @__PURE__ */ b(ee, {
294
315
  message: "We couldn't load your programs.",
295
316
  onRetry: () => void X.refetch()
296
317
  }) : Z.length === 0 ? /* @__PURE__ */ b(s, {
297
318
  illustration: "empty-data",
298
319
  icon: /* @__PURE__ */ b(v, { className: "h-10 w-10" }),
299
- title: p === "ALL" ? "No programs yet" : "No programs in this status",
320
+ title: f === "ALL" ? "No programs yet" : "No programs in this status",
300
321
  description: "Create a structured training program to plan your workouts week by week.",
301
322
  action: /* @__PURE__ */ x(S, {
302
323
  onClick: $,
@@ -315,26 +336,26 @@ function V() {
315
336
  ]
316
337
  }) : /* @__PURE__ */ b("div", {
317
338
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
318
- children: Q.map((e, t) => /* @__PURE__ */ b(me, {
339
+ children: Q.map((e, t) => /* @__PURE__ */ b(be, {
319
340
  program: e,
320
341
  index: t,
321
342
  onOpen: (e) => a(`programs/${e}`)
322
343
  }, e.id))
323
- }), !X.isLoading && !X.isError && Z.length > 0 && /* @__PURE__ */ b(te, {
324
- page: d.page,
325
- pageSize: P,
344
+ }), !X.isLoading && !X.isError && Z.length > 0 && /* @__PURE__ */ b(ne, {
345
+ page: u.page,
346
+ pageSize: M,
326
347
  itemCount: Z.length,
327
348
  hasMore: X.data?.pageInfo?.hasMore ?? !1,
328
- onPageChange: (e) => d.onPageChange(e)
349
+ onPageChange: (e) => u.onPageChange(e)
329
350
  })]
330
351
  }),
331
- /* @__PURE__ */ b(E, {
332
- open: R,
333
- onOpenChange: V,
334
- children: /* @__PURE__ */ x(se, {
352
+ /* @__PURE__ */ b(ue, {
353
+ open: I,
354
+ onOpenChange: z,
355
+ children: /* @__PURE__ */ x(de, {
335
356
  className: "sm:max-w-lg",
336
357
  children: [
337
- /* @__PURE__ */ x(O, { children: [/* @__PURE__ */ b(le, { children: "New program" }), /* @__PURE__ */ b(ce, { children: "Define a structured training block. You can add workouts & exercises after creating it." })] }),
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." })] }),
338
359
  /* @__PURE__ */ x("div", {
339
360
  className: "space-y-4 py-2",
340
361
  children: [
@@ -342,6 +363,33 @@ function V() {
342
363
  className: "rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
343
364
  children: W
344
365
  }),
366
+ /* @__PURE__ */ x("div", {
367
+ className: "space-y-1.5",
368
+ children: [
369
+ /* @__PURE__ */ b(T, {
370
+ htmlFor: "myb-prog-template",
371
+ children: "Start from a template"
372
+ }),
373
+ /* @__PURE__ */ x(E, {
374
+ value: H,
375
+ onValueChange: we,
376
+ children: [/* @__PURE__ */ b(k, {
377
+ 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
+ value: e.id,
384
+ children: e.name
385
+ }, e.id))] })]
386
+ }),
387
+ H !== j && /* @__PURE__ */ b("p", {
388
+ 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."
390
+ })
391
+ ]
392
+ }),
345
393
  /* @__PURE__ */ x("div", {
346
394
  className: "space-y-1.5",
347
395
  children: [/* @__PURE__ */ b(T, {
@@ -349,9 +397,9 @@ function V() {
349
397
  children: "Name"
350
398
  }), /* @__PURE__ */ b(w, {
351
399
  id: "myb-prog-name",
352
- value: H.name,
353
- onChange: (e) => U({
354
- ...H,
400
+ value: B.name,
401
+ onChange: (e) => V({
402
+ ...B,
355
403
  name: e.target.value
356
404
  }),
357
405
  placeholder: "e.g. Hypertrophy Block A"
@@ -362,12 +410,12 @@ function V() {
362
410
  children: [/* @__PURE__ */ b(T, {
363
411
  htmlFor: "myb-prog-desc",
364
412
  children: "Description"
365
- }), /* @__PURE__ */ b(ue, {
413
+ }), /* @__PURE__ */ b(ge, {
366
414
  id: "myb-prog-desc",
367
415
  rows: 3,
368
- value: H.description,
369
- onChange: (e) => U({
370
- ...H,
416
+ value: B.description,
417
+ onChange: (e) => V({
418
+ ...B,
371
419
  description: e.target.value
372
420
  }),
373
421
  placeholder: "Focus, progression scheme, notes…"
@@ -381,14 +429,14 @@ function V() {
381
429
  children: [/* @__PURE__ */ b(T, {
382
430
  htmlFor: "myb-prog-goal",
383
431
  children: "Goal type"
384
- }), /* @__PURE__ */ b(B, {
432
+ }), /* @__PURE__ */ b(R, {
385
433
  id: "myb-prog-goal",
386
- value: H.goalType,
387
- onChange: (e) => U({
388
- ...H,
434
+ value: B.goalType,
435
+ onChange: (e) => V({
436
+ ...B,
389
437
  goalType: e
390
438
  }),
391
- options: F
439
+ options: N
392
440
  })]
393
441
  }),
394
442
  /* @__PURE__ */ x("div", {
@@ -396,14 +444,14 @@ function V() {
396
444
  children: [/* @__PURE__ */ b(T, {
397
445
  htmlFor: "myb-prog-level",
398
446
  children: "Level"
399
- }), /* @__PURE__ */ b(B, {
447
+ }), /* @__PURE__ */ b(R, {
400
448
  id: "myb-prog-level",
401
- value: H.level,
402
- onChange: (e) => U({
403
- ...H,
449
+ value: B.level,
450
+ onChange: (e) => V({
451
+ ...B,
404
452
  level: e
405
453
  }),
406
- options: fe
454
+ options: ve
407
455
  })]
408
456
  }),
409
457
  /* @__PURE__ */ x("div", {
@@ -411,14 +459,14 @@ function V() {
411
459
  children: [/* @__PURE__ */ b(T, {
412
460
  htmlFor: "myb-prog-phase",
413
461
  children: "Phase"
414
- }), /* @__PURE__ */ b(B, {
462
+ }), /* @__PURE__ */ b(R, {
415
463
  id: "myb-prog-phase",
416
- value: H.phase,
417
- onChange: (e) => U({
418
- ...H,
464
+ value: B.phase,
465
+ onChange: (e) => V({
466
+ ...B,
419
467
  phase: e
420
468
  }),
421
- options: pe
469
+ options: ye
422
470
  })]
423
471
  })
424
472
  ]
@@ -435,9 +483,9 @@ function V() {
435
483
  id: "myb-prog-weeks",
436
484
  type: "number",
437
485
  min: 1,
438
- value: H.weeks,
439
- onChange: (e) => U({
440
- ...H,
486
+ value: B.weeks,
487
+ onChange: (e) => V({
488
+ ...B,
441
489
  weeks: e.target.value
442
490
  }),
443
491
  placeholder: "8"
@@ -453,9 +501,9 @@ function V() {
453
501
  type: "number",
454
502
  min: 1,
455
503
  max: 7,
456
- value: H.daysPerWeek,
457
- onChange: (e) => U({
458
- ...H,
504
+ value: B.daysPerWeek,
505
+ onChange: (e) => V({
506
+ ...B,
459
507
  daysPerWeek: e.target.value
460
508
  }),
461
509
  placeholder: "4"
@@ -469,9 +517,9 @@ function V() {
469
517
  }), /* @__PURE__ */ b(w, {
470
518
  id: "myb-prog-start",
471
519
  type: "date",
472
- value: H.startDate,
473
- onChange: (e) => U({
474
- ...H,
520
+ value: B.startDate,
521
+ onChange: (e) => V({
522
+ ...B,
475
523
  startDate: e.target.value
476
524
  })
477
525
  })]
@@ -480,15 +528,15 @@ function V() {
480
528
  })
481
529
  ]
482
530
  }),
483
- /* @__PURE__ */ x(D, { children: [/* @__PURE__ */ b(S, {
531
+ /* @__PURE__ */ x(pe, { children: [/* @__PURE__ */ b(S, {
484
532
  variant: "outline",
485
- onClick: () => V(!1),
486
- disabled: K.isPending,
533
+ onClick: () => z(!1),
534
+ disabled: K.isPending || q.isPending,
487
535
  children: "Cancel"
488
536
  }), /* @__PURE__ */ b(S, {
489
- onClick: () => void _e(),
490
- disabled: K.isPending,
491
- children: K.isPending ? "Creating…" : "Create program"
537
+ onClick: () => void Te(),
538
+ disabled: K.isPending || q.isPending,
539
+ children: K.isPending || q.isPending ? "Creating…" : "Create program"
492
540
  })] })
493
541
  ]
494
542
  })
@@ -497,6 +545,6 @@ function V() {
497
545
  });
498
546
  }
499
547
  //#endregion
500
- export { V as ProgramsPage };
548
+ export { z as ProgramsPage };
501
549
 
502
550
  //# sourceMappingURL=ProgramsPage.js.map