quantum-component-library 1.4.47-dev.2 → 1.4.47-dev.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.
@@ -1,34 +1,34 @@
1
1
  import { j as e } from "./react-jsx-runtime-vendor-OVHDjVDe.js";
2
- import { Flex as he, InputGroup as Pe, InputLeftElement as dt, Icon as Qe, Input as Ie, FormLabel as qe, Box as q, TableContainer as He, Table as Ye, Thead as Je, Tr as Me, Th as ce, Tbody as Ke, Td as ue, ButtonGroup as me, Tooltip as Xe, Button as J, RangeSlider as ut, RangeSliderMark as Re, Text as v, RangeSliderTrack as ht, RangeSliderFilledTrack as mt, RangeSliderThumb as Ue, Select as $e, NumberInput as Ge, NumberInputField as We, HStack as X, Tag as ge, Checkbox as pt, useToast as Ze, VStack as Z, FormControl as W, RadioGroup as Ve, Radio as Ae, Alert as Oe, AlertIcon as Te, Spinner as et, useDisclosure as gt, Modal as xt, ModalOverlay as ft, ModalContent as jt, ModalHeader as vt, ModalCloseButton as bt, ModalBody as yt, ModalFooter as Ct, IconButton as wt, Textarea as Le } from "@chakra-ui/react";
3
- import { useMemo as _, useState as E, useCallback as N, useRef as St, useEffect as V, memo as Ne } from "react";
4
- import { u as Mt } from "./ufuzzy-vendor-Dl0ZI6Av.js";
5
- import { s as ie, y as At } from "./react-select-vendor-C_DuqfB7.js";
6
- import { F as Ot, a as Tt } from "./react-icons-vendor-TETORdU9.js";
7
- import { u as oe, a as te, b as It } from "./graphql-vendor-BWnD0b-j.js";
8
- import { g as B, T as we, S as z, A as ve, a as Fe } from "./generated-esGwfMXj.js";
9
- import { A as re, G as tt, a as Nt, C as ze, b as st, c as nt, d as Se, M as ot, e as ke, f as Rt, U as rt, g as it, S as Lt, h as Ft, i as Et, j as Dt, k as kt, l as _t, m as zt, n as Pt } from "./graphql-CZIf58Fd.js";
10
- import { D as Ut, H as $t, u as Gt, a as Wt } from "./react-dnd-vendor-D4nn9Mqx.js";
11
- import { getSegmentNameWithPlane as lt, getJointNameWithPlane as at, getJointAngleDirectionName as Bt, getSegmentAngleDirectionName as Qt, getNormativeJointRange as qt } from "./services.js";
12
- import { availablePlanes as Be, getAnalysisPartIdNoSide as be } from "./types.js";
13
- import { thresholdsToParameters as Ht, parametersToThresholds as Ee, cn as Yt } from "./utils.js";
14
- import { usePartOptionsForSensorLocations as Jt } from "./hooks.js";
15
- const Kt = ({
2
+ import { Flex as me, InputGroup as Le, InputLeftElement as lt, Icon as Ue, Input as je, FormLabel as We, Box as J, TableContainer as Be, Table as Qe, Thead as qe, Tr as Se, Th as ce, Tbody as He, Td as he, ButtonGroup as pe, Tooltip as at, Button as X, RangeSlider as ct, RangeSliderMark as Ne, Text as b, RangeSliderTrack as dt, RangeSliderFilledTrack as ut, RangeSliderThumb as Fe, Select as Re, NumberInput as ke, NumberInputField as De, HStack as te, Tag as fe, Checkbox as ht, useToast as Ye, VStack as ee, FormControl as B, RadioGroup as Je, Radio as Te, Alert as Ae, AlertIcon as Me, Spinner as Xe, useDisclosure as mt, Modal as pt, ModalOverlay as gt, ModalContent as xt, ModalHeader as jt, ModalCloseButton as ft, ModalBody as vt, ModalFooter as yt, IconButton as bt, Textarea as Ee } from "@chakra-ui/react";
3
+ import { useMemo as D, useState as z, useCallback as R, useRef as Ct, useEffect as se, memo as Oe } from "react";
4
+ import { u as wt } from "./ufuzzy-vendor-Dl0ZI6Av.js";
5
+ import { s as ne } from "./react-select-vendor-BlY9Il4Q.js";
6
+ import { F as St, a as Tt } from "./react-icons-vendor-TETORdU9.js";
7
+ import { u as le, a as oe } from "./graphql-vendor-B0NjgbDB.js";
8
+ import { g as _, T as Ce, S as P, a as At, A as Mt, b as Ot } from "./generated-BTI7tPmv.js";
9
+ import { M as de, A as ae, G as Ke, a as Nt, C as Ie, b as Ve, c as Ze, d as we, e as et, f as It, U as tt, g as st, h as Lt, i as Ft, j as nt, k as Rt, l as kt, m as Dt } from "./graphql-BZ2WVM1o.js";
10
+ import { D as Et, H as zt, u as Pt, a as $t } from "./react-dnd-vendor-D4nn9Mqx.js";
11
+ import { getSegmentNameWithPlane as ot, getJointNameWithPlane as rt, getJointAngleDirectionName as _t, getSegmentAngleDirectionName as Gt, getNormativeJointRange as Ut, mapSessionTypeEnumToLabel as ze, getActivityKindFromActivityType as Wt, mapActivityTypeEnumToLabel as Pe } from "./services.js";
12
+ import { availablePlanes as $e, getAnalysisPartIdNoSide as ve } from "./types.js";
13
+ import { thresholdsToParameters as Bt, parametersToThresholds as _e, cn as Qt } from "./utils.js";
14
+ import { usePartOptionsForSensorLocations as qt } from "./hooks.js";
15
+ const Ht = ({
16
16
  setSearch: n,
17
17
  actions: s,
18
- updateUseCases: r
18
+ updateUseCases: o
19
19
  }) => {
20
- const d = _(
21
- () => s?.flatMap((i) => i.useCases).filter((i, l, u) => u.findIndex((g) => g.id === i.id) === l).map((i) => ({
20
+ const c = D(
21
+ () => s?.flatMap((i) => i.useCases).filter((i, l, u) => u.findIndex((x) => x.id === i.id) === l).map((i) => ({
22
22
  label: i.name,
23
23
  value: i.id
24
24
  })) || [],
25
25
  [s]
26
26
  );
27
- return /* @__PURE__ */ e.jsxs(he, { width: "100%", alignContent: "space-evenly", gap: 4, children: [
28
- /* @__PURE__ */ e.jsxs(Pe, { size: "md", children: [
29
- /* @__PURE__ */ e.jsx(dt, { children: /* @__PURE__ */ e.jsx(Qe, { as: Ot, color: "gray.300" }) }),
27
+ return /* @__PURE__ */ e.jsxs(me, { width: "100%", alignContent: "space-evenly", gap: 4, children: [
28
+ /* @__PURE__ */ e.jsxs(Le, { size: "md", children: [
29
+ /* @__PURE__ */ e.jsx(lt, { children: /* @__PURE__ */ e.jsx(Ue, { as: St, color: "gray.300" }) }),
30
30
  /* @__PURE__ */ e.jsx(
31
- Ie,
31
+ je,
32
32
  {
33
33
  placeholder: "Search by name...",
34
34
  maxW: "30rem",
@@ -36,8 +36,8 @@ const Kt = ({
36
36
  }
37
37
  )
38
38
  ] }),
39
- /* @__PURE__ */ e.jsx(Pe, { size: "md", children: /* @__PURE__ */ e.jsx(
40
- ie,
39
+ /* @__PURE__ */ e.jsx(Le, { size: "md", children: /* @__PURE__ */ e.jsx(
40
+ ne,
41
41
  {
42
42
  size: "md",
43
43
  chakraStyles: {
@@ -49,79 +49,79 @@ const Kt = ({
49
49
  menuPortalTarget: document.body,
50
50
  placeholder: "Filter use case",
51
51
  isMulti: !0,
52
- options: d,
53
- onChange: (i) => r(i.map((l) => l.value))
52
+ options: c,
53
+ onChange: (i) => o(i.map((l) => l.value))
54
54
  }
55
55
  ) })
56
56
  ] });
57
- }, se = ({
57
+ }, re = ({
58
58
  children: n
59
- }) => /* @__PURE__ */ e.jsx(qe, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: n }), Xt = ({ value: n, onChange: s }) => {
60
- const r = E(
59
+ }) => /* @__PURE__ */ e.jsx(We, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: n }), Yt = ({ value: n, onChange: s }) => {
60
+ const o = z(
61
61
  () => Math.random().toString(36).substring(2, 15)
62
- )[0], d = N(
62
+ )[0], c = R(
63
63
  (i, l) => {
64
64
  s((u) => {
65
- const g = [...u], [a] = g.splice(i, 1);
66
- return g.splice(l, 0, a), g;
65
+ const x = [...u], [a] = x.splice(i, 1);
66
+ return x.splice(l, 0, a), x;
67
67
  });
68
68
  },
69
69
  [s]
70
70
  );
71
- return /* @__PURE__ */ e.jsx(q, { children: /* @__PURE__ */ e.jsx(Ut, { backend: $t, children: /* @__PURE__ */ e.jsx(He, { children: /* @__PURE__ */ e.jsxs(Ye, { variant: "simple", size: "md", children: [
72
- /* @__PURE__ */ e.jsx(Je, { children: /* @__PURE__ */ e.jsxs(Me, { children: [
71
+ return /* @__PURE__ */ e.jsx(J, { children: /* @__PURE__ */ e.jsx(Et, { backend: zt, children: /* @__PURE__ */ e.jsx(Be, { children: /* @__PURE__ */ e.jsxs(Qe, { variant: "simple", size: "md", children: [
72
+ /* @__PURE__ */ e.jsx(qe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
73
73
  /* @__PURE__ */ e.jsx(ce, { children: "Order" }),
74
74
  /* @__PURE__ */ e.jsx(ce, { children: "Name" })
75
75
  ] }) }),
76
- /* @__PURE__ */ e.jsx(Ke, { children: n.map((i, l) => /* @__PURE__ */ e.jsx(
77
- Zt,
76
+ /* @__PURE__ */ e.jsx(He, { children: n.map((i, l) => /* @__PURE__ */ e.jsx(
77
+ Jt,
78
78
  {
79
- listKey: r,
79
+ listKey: o,
80
80
  index: l,
81
81
  id: i.id,
82
82
  name: i.name,
83
- move: d
83
+ move: c
84
84
  },
85
85
  i.id
86
86
  )) })
87
87
  ] }) }) }) });
88
- }, Zt = ({ listKey: n, index: s, id: r, name: d, move: i }) => {
89
- const l = St(null), [{ handlerId: u }, g] = Gt({
88
+ }, Jt = ({ listKey: n, index: s, id: o, name: c, move: i }) => {
89
+ const l = Ct(null), [{ handlerId: u }, x] = Pt({
90
90
  accept: n,
91
- collect: (x) => ({
92
- handlerId: x.getHandlerId()?.toString() ?? ""
91
+ collect: (j) => ({
92
+ handlerId: j.getHandlerId()?.toString() ?? ""
93
93
  }),
94
- hover: (x, A) => {
94
+ hover: (j, f) => {
95
95
  if (!l.current)
96
96
  return;
97
- const o = x.index, c = s;
98
- if (o === c)
97
+ const r = j.index, d = s;
98
+ if (r === d)
99
99
  return;
100
- const j = l.current?.getBoundingClientRect(), m = (j.bottom - j.top) / 2, w = A.getClientOffset().y - j.top;
101
- o < c && w < m || o > c && w > m || (i(o, c), x.index = c);
100
+ const p = l.current?.getBoundingClientRect(), g = (p.bottom - p.top) / 2, A = f.getClientOffset().y - p.top;
101
+ r < d && A < g || r > d && A > g || (i(r, d), j.index = d);
102
102
  }
103
- }), [{ isDragging: a }, M] = Wt({
103
+ }), [{ isDragging: a }, w] = $t({
104
104
  type: n,
105
- item: () => ({ id: r, index: s }),
106
- collect: (x) => ({
107
- isDragging: x.isDragging()
105
+ item: () => ({ id: o, index: s }),
106
+ collect: (j) => ({
107
+ isDragging: j.isDragging()
108
108
  })
109
- }), T = a ? 0.6 : 1, p = a ? "grabbing" : "grab";
110
- return M(g(l)), /* @__PURE__ */ e.jsxs(Me, { ref: l, style: { opacity: T, cursor: p }, "data-handler-id": u, children: [
111
- /* @__PURE__ */ e.jsx(ue, { children: s + 1 }),
112
- /* @__PURE__ */ e.jsx(ue, { children: d })
109
+ }), I = a ? 0.6 : 1, m = a ? "grabbing" : "grab";
110
+ return w(x(l)), /* @__PURE__ */ e.jsxs(Se, { ref: l, style: { opacity: I, cursor: m }, "data-handler-id": u, children: [
111
+ /* @__PURE__ */ e.jsx(he, { children: s + 1 }),
112
+ /* @__PURE__ */ e.jsx(he, { children: c })
113
113
  ] });
114
- }, _e = ({
114
+ }, Xt = ({
115
115
  items: n,
116
116
  onChange: s,
117
- selectedItem: r,
118
- isDisabled: d,
117
+ selectedItem: o,
118
+ isDisabled: c,
119
119
  selectedProps: i,
120
120
  buttonProps: l
121
121
  }) => {
122
- const u = (a) => a === r || a.value === r, g = (a) => u(a) ? { ...l, ...i } : l;
123
- return /* @__PURE__ */ e.jsx(me, { isAttached: !0, isDisabled: d, children: n.map((a, M) => /* @__PURE__ */ e.jsx(
124
- Xe,
122
+ const u = (a) => a === o || a.value === o, x = (a) => u(a) ? { ...l, ...i } : l;
123
+ return /* @__PURE__ */ e.jsx(pe, { isAttached: !0, isDisabled: c, children: n.map((a, w) => /* @__PURE__ */ e.jsx(
124
+ at,
125
125
  {
126
126
  label: a.tooltip,
127
127
  openDelay: 50,
@@ -130,93 +130,93 @@ const Kt = ({
130
130
  visibility: a.tooltip ? "visible" : "hidden",
131
131
  hasArrow: !0,
132
132
  children: /* @__PURE__ */ e.jsx(
133
- J,
133
+ X,
134
134
  {
135
- onClick: () => u(a) ? null : s(a, M),
135
+ onClick: () => u(a) ? null : s(a, w),
136
136
  isDisabled: a.disabled,
137
- ...g(a),
137
+ ...x(a),
138
138
  children: a.label
139
139
  }
140
140
  )
141
141
  },
142
- M
142
+ w
143
143
  )) });
144
- }, ye = (n, s) => s < 0 ? -1 * Math.abs(n) : Math.abs(n), Vt = ({
144
+ }, ye = (n, s) => s < 0 ? -1 * Math.abs(n) : Math.abs(n), Kt = ({
145
145
  isReversed: n,
146
146
  min: s,
147
- max: r,
148
- value: d,
147
+ max: o,
148
+ value: c,
149
149
  onChange: i,
150
150
  inputProps: l,
151
151
  size: u,
152
- zeroMarker: g,
152
+ zeroMarker: x,
153
153
  formatValue: a,
154
- valueLabel: M,
155
- positiveNegativeLabels: T,
156
- isDisabled: p,
157
- ...x
154
+ valueLabel: w,
155
+ positiveNegativeLabels: I,
156
+ isDisabled: m,
157
+ ...j
158
158
  }) => {
159
- const [A, o] = E([void 0, void 0]), c = A[0], j = A[1], m = g && s < -5 && r > 5, C = Number(d?.[0] ?? j ?? s) > 0 ? 1 : -1, w = Number(d?.[1] ?? j ?? r) < 0 ? -1 : 1, S = T?.[0] === T?.[1], b = d?.[0], O = d?.[1];
160
- V(() => {
161
- b !== void 0 && O !== void 0 && o([b.toFixed(0), O.toFixed(0)]);
162
- }, [b, O, o]);
163
- const I = N(
164
- ([y, L]) => {
165
- y < L && o([y.toFixed(0), L.toFixed(0)]);
159
+ const [f, r] = z([void 0, void 0]), d = f[0], p = f[1], g = x && s < -5 && o > 5, y = Number(c?.[0] ?? p ?? s) > 0 ? 1 : -1, A = Number(c?.[1] ?? p ?? o) < 0 ? -1 : 1, C = I?.[0] === I?.[1], T = c?.[0], M = c?.[1];
160
+ se(() => {
161
+ T !== void 0 && M !== void 0 && r([T.toFixed(0), M.toFixed(0)]);
162
+ }, [T, M, r]);
163
+ const E = R(
164
+ ([v, $]) => {
165
+ v < $ && r([v.toFixed(0), $.toFixed(0)]);
166
166
  },
167
- [o]
168
- ), D = N(
169
- ([y, L]) => {
170
- y < L && i([y, L]);
167
+ [r]
168
+ ), O = R(
169
+ ([v, $]) => {
170
+ v < $ && i([v, $]);
171
171
  },
172
172
  [i]
173
- ), P = N(() => {
174
- o(([y, L]) => {
175
- const K = isNaN(Number(y)) ? s : Number(y), t = isNaN(Number(L)) ? r : Number(L), h = ye(Number(K), C), f = ye(Number(t), w), F = C < 0 ? Math.max(h, s) : Math.min(h, r), U = w < 0 ? Math.max(f, s) : Math.min(f, r);
176
- return F > U ? (i([U, F]), [U.toFixed(0), F.toFixed(0)]) : (i([F, U]), [F.toFixed(0), U.toFixed(0)]);
173
+ ), Q = R(() => {
174
+ r(([v, $]) => {
175
+ const q = isNaN(Number(v)) ? s : Number(v), t = isNaN(Number($)) ? o : Number($), h = ye(Number(q), y), S = ye(Number(t), A), F = y < 0 ? Math.max(h, s) : Math.min(h, o), L = A < 0 ? Math.max(S, s) : Math.min(S, o);
176
+ return F > L ? (i([L, F]), [L.toFixed(0), F.toFixed(0)]) : (i([F, L]), [F.toFixed(0), L.toFixed(0)]);
177
177
  });
178
- }, [i, o, C, w, s, r]), ee = N(
179
- (y) => {
180
- const L = y === "" || isNaN(Number(y)) ? y : ye(Number(y), C);
181
- o(([K, t]) => [L.toString(), t]);
178
+ }, [i, r, y, A, s, o]), K = R(
179
+ (v) => {
180
+ const $ = v === "" || isNaN(Number(v)) ? v : ye(Number(v), y);
181
+ r(([q, t]) => [$.toString(), t]);
182
182
  },
183
- [o, C]
184
- ), $ = N(
185
- (y) => {
186
- const L = y === "" || isNaN(Number(y)) ? y : ye(Number(y), w);
187
- o(([K, t]) => [K, L.toString()]);
183
+ [r, y]
184
+ ), Y = R(
185
+ (v) => {
186
+ const $ = v === "" || isNaN(Number(v)) ? v : ye(Number(v), A);
187
+ r(([q, t]) => [q, $.toString()]);
188
188
  },
189
- [o, w]
190
- ), k = _(
189
+ [r, A]
190
+ ), k = D(
191
191
  () => u === "xs" ? "0.75rem" : void 0,
192
192
  [u]
193
- ), H = N(
194
- (y, L) => {
195
- const K = Number(L.target.value);
196
- if (!c || !j || ![-1, 1].includes(K))
193
+ ), V = R(
194
+ (v, $) => {
195
+ const q = Number($.target.value);
196
+ if (!d || !p || ![-1, 1].includes(q))
197
197
  return;
198
- const t = (F) => K < 0 ? -1 * Math.abs(F) : Math.abs(F), h = y ? t(Number(c)) : Number(c), f = y ? Number(j) : t(Number(j));
199
- h > f ? i([f, h]) : i([h, f]);
198
+ const t = (F) => q < 0 ? -1 * Math.abs(F) : Math.abs(F), h = v ? t(Number(d)) : Number(d), S = v ? Number(p) : t(Number(p));
199
+ h > S ? i([S, h]) : i([h, S]);
200
200
  },
201
- [c, j, i]
201
+ [d, p, i]
202
202
  );
203
- return /* @__PURE__ */ e.jsxs(he, { direction: "column", ...x, children: [
204
- /* @__PURE__ */ e.jsx(q, { pt: "1em", mb: "-0.5em", children: /* @__PURE__ */ e.jsxs(
205
- ut,
203
+ return /* @__PURE__ */ e.jsxs(me, { direction: "column", ...j, children: [
204
+ /* @__PURE__ */ e.jsx(J, { pt: "1em", mb: "-0.5em", children: /* @__PURE__ */ e.jsxs(
205
+ ct,
206
206
  {
207
207
  "aria-label": ["min", "max"],
208
208
  isReversed: n,
209
- value: [Number(c ?? s), Number(j ?? r)],
210
- max: r,
209
+ value: [Number(d ?? s), Number(p ?? o)],
210
+ max: o,
211
211
  min: s,
212
212
  minStepsBetweenThumbs: 3,
213
213
  step: 1,
214
- onChange: I,
215
- onChangeEnd: D,
216
- isDisabled: p,
214
+ onChange: E,
215
+ onChangeEnd: O,
216
+ isDisabled: m,
217
217
  children: [
218
- /* @__PURE__ */ e.jsx(Re, { value: s, top: "-1em", children: /* @__PURE__ */ e.jsx(
219
- v,
218
+ /* @__PURE__ */ e.jsx(Ne, { value: s, top: "-1em", children: /* @__PURE__ */ e.jsx(
219
+ b,
220
220
  {
221
221
  fontSize: u ?? "sm",
222
222
  fontWeight: "semibold",
@@ -224,20 +224,20 @@ const Kt = ({
224
224
  children: a ? a?.(s) : s
225
225
  }
226
226
  ) }),
227
- /* @__PURE__ */ e.jsx(Re, { value: r, top: "-1em", children: /* @__PURE__ */ e.jsx(
228
- v,
227
+ /* @__PURE__ */ e.jsx(Ne, { value: o, top: "-1em", children: /* @__PURE__ */ e.jsx(
228
+ b,
229
229
  {
230
230
  fontSize: u ?? "sm",
231
231
  fontWeight: "semibold",
232
232
  style: { transform: "translateX(-100%)" },
233
233
  whiteSpace: "nowrap",
234
- children: a ? a(r) : r
234
+ children: a ? a(o) : o
235
235
  }
236
236
  ) }),
237
- m && /* @__PURE__ */ e.jsxs(Re, { value: 0, top: "-1em", pos: "relative", children: [
238
- /* @__PURE__ */ e.jsx(v, { fontSize: u, fontWeight: "semibold", children: a?.(0) ?? "0" }),
237
+ g && /* @__PURE__ */ e.jsxs(Ne, { value: 0, top: "-1em", pos: "relative", children: [
238
+ /* @__PURE__ */ e.jsx(b, { fontSize: u, fontWeight: "semibold", children: a?.(0) ?? "0" }),
239
239
  /* @__PURE__ */ e.jsx(
240
- q,
240
+ J,
241
241
  {
242
242
  position: "absolute",
243
243
  width: "2px",
@@ -248,79 +248,79 @@ const Kt = ({
248
248
  }
249
249
  )
250
250
  ] }),
251
- /* @__PURE__ */ e.jsx(ht, { children: /* @__PURE__ */ e.jsx(mt, {}) }),
252
- /* @__PURE__ */ e.jsx(Ue, { index: 0, w: k, h: k }),
253
- /* @__PURE__ */ e.jsx(Ue, { index: 1, w: k, h: k })
251
+ /* @__PURE__ */ e.jsx(dt, { children: /* @__PURE__ */ e.jsx(ut, {}) }),
252
+ /* @__PURE__ */ e.jsx(Fe, { index: 0, w: k, h: k }),
253
+ /* @__PURE__ */ e.jsx(Fe, { index: 1, w: k, h: k })
254
254
  ]
255
255
  }
256
256
  ) }),
257
- M && /* @__PURE__ */ e.jsxs(
258
- he,
257
+ w && /* @__PURE__ */ e.jsxs(
258
+ me,
259
259
  {
260
260
  direction: n ? "row-reverse" : "row",
261
261
  justifyContent: "space-between",
262
262
  children: [
263
263
  /* @__PURE__ */ e.jsx(
264
- v,
264
+ b,
265
265
  {
266
266
  fontSize: u ?? "sm",
267
267
  fontWeight: "semibold",
268
268
  whiteSpace: "nowrap",
269
- children: M(s)
269
+ children: w(s)
270
270
  }
271
271
  ),
272
272
  /* @__PURE__ */ e.jsx(
273
- v,
273
+ b,
274
274
  {
275
275
  fontSize: u ?? "sm",
276
276
  fontWeight: "semibold",
277
277
  whiteSpace: "nowrap",
278
- children: M(r)
278
+ children: w(o)
279
279
  }
280
280
  )
281
281
  ]
282
282
  }
283
283
  ),
284
284
  /* @__PURE__ */ e.jsxs(
285
- he,
285
+ me,
286
286
  {
287
287
  direction: n ? "row-reverse" : "row",
288
288
  justifyContent: "center",
289
289
  alignItems: "center",
290
290
  gap: "0.125em",
291
291
  children: [
292
- T && /* @__PURE__ */ e.jsxs(
293
- $e,
292
+ I && /* @__PURE__ */ e.jsxs(
293
+ Re,
294
294
  {
295
295
  width: "auto",
296
296
  size: u,
297
297
  fontWeight: "bold",
298
- value: C,
299
- onChange: (y) => H(!0, y),
300
- isDisabled: S || p,
298
+ value: y,
299
+ onChange: (v) => V(!0, v),
300
+ isDisabled: C || m,
301
301
  children: [
302
- /* @__PURE__ */ e.jsx("option", { value: -1, children: T[0] }),
303
- /* @__PURE__ */ e.jsx("option", { value: 1, children: T[1] })
302
+ /* @__PURE__ */ e.jsx("option", { value: -1, children: I[0] }),
303
+ /* @__PURE__ */ e.jsx("option", { value: 1, children: I[1] })
304
304
  ]
305
305
  }
306
306
  ),
307
307
  /* @__PURE__ */ e.jsx(
308
- Ge,
308
+ ke,
309
309
  {
310
310
  precision: 0,
311
311
  size: u ?? "sm",
312
312
  min: 0,
313
- max: C < 0 ? Math.abs(s) : O ?? r,
314
- value: c === "" ? "" : Math.abs(Number(c ?? s)),
315
- onChange: ee,
316
- onBlur: P,
313
+ max: y < 0 ? Math.abs(s) : M ?? o,
314
+ value: d === "" ? "" : Math.abs(Number(d ?? s)),
315
+ onChange: K,
316
+ onBlur: Q,
317
317
  borderWidth: 1,
318
318
  borderRadius: 3,
319
319
  borderColor: "#ccc",
320
- isDisabled: p,
320
+ isDisabled: m,
321
321
  ...l,
322
322
  children: /* @__PURE__ */ e.jsx(
323
- We,
323
+ De,
324
324
  {
325
325
  backgroundColor: "#fff",
326
326
  paddingRight: 0,
@@ -330,22 +330,22 @@ const Kt = ({
330
330
  }
331
331
  ),
332
332
  /* @__PURE__ */ e.jsx(
333
- Ge,
333
+ ke,
334
334
  {
335
335
  size: u ?? "sm",
336
336
  min: 0,
337
- max: w < 0 ? Math.abs(b ?? s) : r,
337
+ max: A < 0 ? Math.abs(T ?? s) : o,
338
338
  precision: 0,
339
- value: j === "" ? "" : Math.abs(Number(j ?? r)),
340
- onChange: $,
341
- onBlur: P,
339
+ value: p === "" ? "" : Math.abs(Number(p ?? o)),
340
+ onChange: Y,
341
+ onBlur: Q,
342
342
  borderWidth: 1,
343
343
  borderRadius: 3,
344
344
  borderColor: "#ccc",
345
- isDisabled: p,
345
+ isDisabled: m,
346
346
  ...l,
347
347
  children: /* @__PURE__ */ e.jsx(
348
- We,
348
+ De,
349
349
  {
350
350
  backgroundColor: "#fff",
351
351
  paddingRight: 0,
@@ -354,18 +354,18 @@ const Kt = ({
354
354
  )
355
355
  }
356
356
  ),
357
- T && /* @__PURE__ */ e.jsxs(
358
- $e,
357
+ I && /* @__PURE__ */ e.jsxs(
358
+ Re,
359
359
  {
360
360
  width: "auto",
361
361
  size: u,
362
362
  fontWeight: "bold",
363
- value: w,
364
- onChange: (y) => H(!1, y),
365
- isDisabled: S || p,
363
+ value: A,
364
+ onChange: (v) => V(!1, v),
365
+ isDisabled: C || m,
366
366
  children: [
367
- /* @__PURE__ */ e.jsx("option", { value: -1, children: T[0] }),
368
- /* @__PURE__ */ e.jsx("option", { value: 1, children: T[1] })
367
+ /* @__PURE__ */ e.jsx("option", { value: -1, children: I[0] }),
368
+ /* @__PURE__ */ e.jsx("option", { value: 1, children: I[1] })
369
369
  ]
370
370
  }
371
371
  )
@@ -373,90 +373,90 @@ const Kt = ({
373
373
  }
374
374
  )
375
375
  ] });
376
- }, es = ({ tags: n, containerProps: s, ...r }) => /* @__PURE__ */ e.jsx(X, { ...s, children: n.map((d, i) => /* @__PURE__ */ e.jsx(ge, { ...r, children: d }, i)) }), ts = new Mt({}), ss = (n, s) => {
376
+ }, Vt = ({ tags: n, containerProps: s, ...o }) => /* @__PURE__ */ e.jsx(te, { ...s, children: n.map((c, i) => /* @__PURE__ */ e.jsx(fe, { ...o, children: c }, i)) }), Zt = new wt({}), es = (n, s) => {
377
377
  if (!s || !s.trim().length)
378
378
  return n;
379
- const r = n.map((i) => i.name ?? "");
380
- return ts.filter(r, s)?.map((i) => n[i]) ?? [];
381
- }, ns = (n, s) => !s || s.length == 0 ? n : n.filter(
382
- (r) => r.useCases.some((d) => s.includes(d.id))
383
- ), os = ({
379
+ const o = n.map((i) => i.name ?? "");
380
+ return Zt.filter(o, s)?.map((i) => n[i]) ?? [];
381
+ }, ts = (n, s) => !s || s.length == 0 ? n : n.filter(
382
+ (o) => o.useCases.some((c) => s.includes(c.id))
383
+ ), ss = ({
384
384
  actions: n,
385
385
  totalActions: s,
386
- onCreate: r,
387
- onDelete: d,
386
+ onCreate: o,
387
+ onDelete: c,
388
388
  onEdit: i,
389
389
  onSelected: l,
390
390
  onDuplicate: u,
391
- disableMultiSelect: g,
391
+ disableMultiSelect: x,
392
392
  disableDelete: a,
393
- disableEdit: M,
394
- disableCreate: T,
395
- tableProps: p,
396
- ...x
393
+ disableEdit: w,
394
+ disableCreate: I,
395
+ tableProps: m,
396
+ ...j
397
397
  }) => {
398
- const [A, o] = E(""), [c, j] = E(), m = _(() => {
398
+ const [f, r] = z(""), [d, p] = z(), g = D(() => {
399
399
  if (!n)
400
400
  return;
401
- const S = ss(n, A);
402
- return ns(S, c).sort((O, I) => O.name.localeCompare(I.name));
403
- }, [n, A, c]), C = N(() => {
404
- if (!d)
401
+ const C = es(n, f);
402
+ return ts(C, d).sort((M, E) => M.name.localeCompare(E.name));
403
+ }, [n, f, d]), y = R(() => {
404
+ if (!c)
405
405
  return;
406
- const S = n.filter((b) => b.selected).map((b) => b.id);
407
- d(S);
408
- }, [n, d]), w = N(() => {
406
+ const C = n.filter((T) => T.selected).map((T) => T.id);
407
+ c(C);
408
+ }, [n, c]), A = R(() => {
409
409
  if (!u)
410
410
  return;
411
- const S = n.filter((b) => b.selected);
412
- u(S.map((b) => b.id)), l && S.forEach((b) => l(b, !1));
411
+ const C = n.filter((T) => T.selected);
412
+ u(C.map((T) => T.id)), l && C.forEach((T) => l(T, !1));
413
413
  }, [n, u, l]);
414
- return /* @__PURE__ */ e.jsxs(q, { ...x, children: [
415
- /* @__PURE__ */ e.jsxs(he, { alignContent: "space-between", gap: 4, children: [
416
- (r || d || u) && /* @__PURE__ */ e.jsxs(me, { mb: "1rem", gap: 4, children: [
417
- r && /* @__PURE__ */ e.jsx(
418
- J,
414
+ return /* @__PURE__ */ e.jsxs(J, { ...j, children: [
415
+ /* @__PURE__ */ e.jsxs(me, { alignContent: "space-between", gap: 4, children: [
416
+ (o || c || u) && /* @__PURE__ */ e.jsxs(pe, { mb: "1rem", gap: 4, children: [
417
+ o && /* @__PURE__ */ e.jsx(
418
+ X,
419
419
  {
420
- isDisabled: !r || T,
420
+ isDisabled: !o || I,
421
421
  colorScheme: "blackAlpha",
422
422
  backgroundColor: "gray.700",
423
- onClick: r,
423
+ onClick: o,
424
424
  children: "Create New Activity"
425
425
  }
426
426
  ),
427
- d && !g && /* @__PURE__ */ e.jsx(
428
- J,
427
+ c && !x && /* @__PURE__ */ e.jsx(
428
+ X,
429
429
  {
430
430
  colorScheme: "gray",
431
- isDisabled: n.length <= 0 || !d || a,
432
- onClick: C,
431
+ isDisabled: n.length <= 0 || !c || a,
432
+ onClick: y,
433
433
  children: "Delete Selected"
434
434
  }
435
435
  ),
436
- u && !g && /* @__PURE__ */ e.jsx(
437
- J,
436
+ u && !x && /* @__PURE__ */ e.jsx(
437
+ X,
438
438
  {
439
439
  colorScheme: "gray",
440
440
  isDisabled: n.length <= 0,
441
- onClick: w,
441
+ onClick: A,
442
442
  children: "Duplicate Selected"
443
443
  }
444
444
  )
445
445
  ] }),
446
446
  /* @__PURE__ */ e.jsx(
447
- Kt,
447
+ Ht,
448
448
  {
449
- setSearch: o,
449
+ setSearch: r,
450
450
  actions: n,
451
- updateUseCases: j
451
+ updateUseCases: p
452
452
  }
453
453
  )
454
454
  ] }),
455
- /* @__PURE__ */ e.jsx(He, { mr: "2rem", overflowX: "hidden", ...p, children: /* @__PURE__ */ e.jsxs(Ye, { size: "md", variant: "simple", children: [
456
- /* @__PURE__ */ e.jsx(Je, { position: "sticky", top: 0, bg: "white", zIndex: 1, children: /* @__PURE__ */ e.jsxs(Me, { children: [
455
+ /* @__PURE__ */ e.jsx(Be, { mr: "2rem", overflowX: "hidden", ...m, children: /* @__PURE__ */ e.jsxs(Qe, { size: "md", variant: "simple", children: [
456
+ /* @__PURE__ */ e.jsx(qe, { position: "sticky", top: 0, bg: "white", zIndex: 1, children: /* @__PURE__ */ e.jsxs(Se, { children: [
457
457
  /* @__PURE__ */ e.jsxs(ce, { fontWeight: "normal", children: [
458
458
  "(showing ",
459
- m?.length ?? 0,
459
+ g?.length ?? 0,
460
460
  " of",
461
461
  " ",
462
462
  s ?? n.length,
@@ -467,92 +467,95 @@ const Kt = ({
467
467
  /* @__PURE__ */ e.jsx(ce, { children: "Use Case" }),
468
468
  /* @__PURE__ */ e.jsx(ce, {})
469
469
  ] }) }),
470
- /* @__PURE__ */ e.jsx(Ke, { children: m?.map((S) => /* @__PURE__ */ e.jsxs(
471
- Me,
470
+ /* @__PURE__ */ e.jsx(He, { children: g?.map((C) => /* @__PURE__ */ e.jsxs(
471
+ Se,
472
472
  {
473
- title: g && S.selected ? "This activity is selected. Click it again to deselect." : void 0,
474
- bg: g && S.selected ? "gray.200" : void 0,
473
+ title: x && C.selected ? "This activity is selected. Click it again to deselect." : void 0,
474
+ bg: x && C.selected ? "gray.200" : void 0,
475
475
  _hover: {
476
- bg: g && !S.selected ? "#f7f7f7" : void 0
476
+ bg: x && !C.selected ? "#f7f7f7" : void 0
477
477
  },
478
- cursor: g ? "pointer" : "default",
479
- onClick: () => g ? l?.(S, !S.selected) : void 0,
478
+ cursor: x ? "pointer" : "default",
479
+ onClick: () => x ? l?.(C, !C.selected) : void 0,
480
480
  children: [
481
- /* @__PURE__ */ e.jsx(ue, { children: /* @__PURE__ */ e.jsxs(he, { children: [
482
- l && !g && /* @__PURE__ */ e.jsx(
483
- pt,
481
+ /* @__PURE__ */ e.jsx(he, { children: /* @__PURE__ */ e.jsxs(me, { children: [
482
+ l && !x && /* @__PURE__ */ e.jsx(
483
+ ht,
484
484
  {
485
- isChecked: S.selected,
486
- onChange: (b) => l(S, b.target.checked)
485
+ isChecked: C.selected,
486
+ onChange: (T) => l(C, T.target.checked)
487
487
  }
488
488
  ),
489
489
  i && /* @__PURE__ */ e.jsx(
490
- J,
490
+ X,
491
491
  {
492
- disabled: M,
492
+ disabled: w,
493
493
  ml: "1em",
494
494
  size: "sm",
495
495
  variant: "link",
496
496
  colorScheme: "blue",
497
- onClick: () => i(S.id),
497
+ onClick: () => i(C.id),
498
498
  children: "edit"
499
499
  }
500
500
  )
501
501
  ] }) }),
502
- /* @__PURE__ */ e.jsx(ue, { whiteSpace: "break-spaces", children: S.name }),
503
- /* @__PURE__ */ e.jsx(ue, { maxW: "20rem", children: S.sensorLocations.length }),
504
- /* @__PURE__ */ e.jsx(ue, { maxW: "20rem", children: /* @__PURE__ */ e.jsx(
505
- es,
502
+ /* @__PURE__ */ e.jsx(he, { whiteSpace: "break-spaces", children: C.name }),
503
+ /* @__PURE__ */ e.jsx(he, { maxW: "20rem", children: C.sensorLocations.length }),
504
+ /* @__PURE__ */ e.jsx(he, { maxW: "20rem", children: /* @__PURE__ */ e.jsx(
505
+ Vt,
506
506
  {
507
507
  containerProps: { flexWrap: "wrap" },
508
- tags: S.useCases?.map((b) => b.name) ?? []
508
+ tags: C.useCases?.map((T) => T.name) ?? []
509
509
  }
510
510
  ) })
511
511
  ]
512
512
  },
513
- S.id
513
+ C.id
514
514
  )) })
515
515
  ] }) })
516
516
  ] });
517
- }, Ns = ({
517
+ }, Os = ({
518
518
  onSave: n,
519
519
  onCancel: s,
520
- onError: r,
521
- hideButtons: d = !1,
520
+ onError: o,
521
+ hideButtons: c = !1,
522
522
  setButtonDisabled: i,
523
523
  setButtonOnClick: l,
524
524
  quantumOwned: u
525
525
  }) => {
526
- const g = Ze(), [a, M] = E("copy"), [T, p] = E(""), [x, A] = E([]), [o, c] = E(!1), [j] = oe({
527
- query: tt
528
- }), [m] = oe({
526
+ const x = Ye(), [a, w] = z("copy"), [I, m] = z(""), [j, f] = z([]), [r, d] = z(!1), [p] = le({
527
+ query: Ke
528
+ }), [g] = le({
529
529
  query: Nt,
530
- variables: { groupId: T },
531
- pause: !T
530
+ variables: { groupId: I },
531
+ pause: !I
532
532
  // Only run when group is selected
533
- }), [, C] = te(ze), [, w] = te(
534
- st
535
- ), S = _(() => j.data?.groups ? j.data.groups.map(
536
- (t) => B(nt, t)
537
- ) : [], [j.data]), b = _(() => m.data ? m.data.actions.map(
538
- (h) => B(re, h)
539
- ) : [], [m.data]), O = _(() => b.filter(
540
- (t) => x.includes(t.id)
541
- ), [b, x]), I = N(
533
+ }), [, y] = oe(Ie), [, A] = oe(
534
+ Ve
535
+ ), C = D(() => p.data?.groups ? p.data.groups.map(
536
+ (t) => _(Ze, t)
537
+ ) : [], [p.data]), T = D(() => g.data ? g.data.actions.map(
538
+ (h) => _(ae, h)
539
+ ) : [], [g.data]), M = D(() => T.filter(
540
+ (t) => j.includes(t.id)
541
+ ), [T, j]), E = R(
542
542
  (t) => {
543
543
  const h = t?.value || "";
544
- p(h), A([]);
544
+ m(h), f([]);
545
545
  },
546
546
  []
547
- ), D = N(
547
+ ), O = R(
548
548
  (t) => {
549
- const h = t.map((f) => f.value);
550
- A(h);
549
+ const h = t.map((S) => S.value);
550
+ f(h);
551
551
  },
552
552
  []
553
- ), P = N(
553
+ ), Q = R(
554
554
  async (t) => {
555
- const h = {
555
+ const h = _(
556
+ de,
557
+ t.categories
558
+ ), S = {
556
559
  ...t,
557
560
  name: `${t.name} (Copy)`,
558
561
  // Add "(Copy)" suffix to distinguish
@@ -562,201 +565,202 @@ const Kt = ({
562
565
  laterality: t.laterality,
563
566
  activityKind: t.activityKind,
564
567
  sensorLocations: t.sensorLocations,
565
- thresholds: t.thresholds.map((F) => ({
566
- ...F,
568
+ thresholds: t.thresholds.map((L) => ({
569
+ ...L,
567
570
  id: void 0
568
571
  })),
572
+ categories: h?.map((L) => L.id),
569
573
  quantumOwned: u,
570
574
  id: void 0
571
- }, f = await C({ fields: h });
572
- if (f.error)
573
- throw new Error(f.error.message);
574
- if (f.data?.createAction)
575
- return B(re, f.data.createAction);
575
+ }, F = await y({ fields: S });
576
+ if (F.error)
577
+ throw new Error(F.error.message);
578
+ if (F.data?.createAction)
579
+ return _(ae, F.data.createAction);
576
580
  throw new Error("No action data returned");
577
581
  },
578
- [C, u]
579
- ), ee = N(
582
+ [y, u]
583
+ ), K = R(
580
584
  async (t) => {
581
- const h = await w({ id: t.id });
585
+ const h = await A({ id: t.id });
582
586
  if (h.error)
583
587
  throw new Error(h.error.message);
584
588
  if (h.data?.convertActionToQuantumOwned)
585
- return B(
586
- re,
589
+ return _(
590
+ ae,
587
591
  h.data.convertActionToQuantumOwned
588
592
  );
589
593
  throw new Error("No action data returned");
590
594
  },
591
- [w]
592
- ), $ = N(async () => {
593
- if (c(!0), !O.length) {
595
+ [A]
596
+ ), Y = R(async () => {
597
+ if (d(!0), !M.length) {
594
598
  const t = new Error(
595
599
  `No activities selected for ${a === "copy" ? "copying" : "converting"}`
596
600
  );
597
- r?.(t), c(!1);
601
+ o?.(t), d(!1);
598
602
  return;
599
603
  }
600
604
  try {
601
605
  const t = [];
602
606
  let h = 0;
603
- const f = a === "copy" ? P : ee, F = a === "copy" ? "copy" : "convert";
604
- for (const U of O)
607
+ const S = a === "copy" ? Q : K, F = a === "copy" ? "copy" : "convert";
608
+ for (const L of M)
605
609
  try {
606
- const G = await f(U);
607
- t.push(G);
608
- } catch (G) {
610
+ const U = await S(L);
611
+ t.push(U);
612
+ } catch (U) {
609
613
  console.error(
610
- `Failed to ${F} activity "${U.name}":`,
611
- G
614
+ `Failed to ${F} activity "${L.name}":`,
615
+ U
612
616
  ), h++;
613
617
  }
614
618
  if (t.length > 0) {
615
- const U = t.length, G = O.length, Y = a === "copy" ? "copied" : "converted", Q = a === "copy" ? "copy" : "convert";
616
- g({
617
- title: h > 0 ? `Partial ${Q} completed` : `Activities ${Y} successfully`,
618
- description: h > 0 ? `${U} of ${G} activities ${Y} successfully` : `${U} activit${U > 1 ? "ies" : "y"} ${Y} successfully`,
619
+ const L = t.length, U = M.length, H = a === "copy" ? "copied" : "converted", W = a === "copy" ? "copy" : "convert";
620
+ x({
621
+ title: h > 0 ? `Partial ${W} completed` : `Activities ${H} successfully`,
622
+ description: h > 0 ? `${L} of ${U} activities ${H} successfully` : `${L} activit${L > 1 ? "ies" : "y"} ${H} successfully`,
619
623
  status: h > 0 ? "warning" : "success",
620
624
  duration: 3e3,
621
625
  isClosable: !0
622
- }), n?.(), p(""), A([]);
626
+ }), n?.(), m(""), f([]);
623
627
  } else
624
628
  throw new Error(`Failed to ${F} any activities`);
625
629
  } catch (t) {
626
- const h = a === "copy" ? "copy" : "convert", f = t instanceof Error ? t.message : `Failed to ${h} activities`;
627
- g({
630
+ const h = a === "copy" ? "copy" : "convert", S = t instanceof Error ? t.message : `Failed to ${h} activities`;
631
+ x({
628
632
  title: `${a === "copy" ? "Copy" : "Convert"} failed`,
629
- description: f,
633
+ description: S,
630
634
  status: "error",
631
635
  duration: 5e3,
632
636
  isClosable: !0
633
- }), r?.(t instanceof Error ? t : new Error(f));
637
+ }), o?.(t instanceof Error ? t : new Error(S));
634
638
  } finally {
635
- c(!1);
639
+ d(!1);
636
640
  }
637
641
  }, [
638
- O,
642
+ M,
639
643
  a,
640
- P,
641
- ee,
642
- g,
644
+ Q,
645
+ K,
646
+ x,
643
647
  n,
644
- r
645
- ]), k = N(() => {
646
- p(""), A([]), M("copy"), s?.();
648
+ o
649
+ ]), k = R(() => {
650
+ m(""), f([]), w("copy"), s?.();
647
651
  }, [s]);
648
- V(() => {
652
+ se(() => {
649
653
  i && i({
650
654
  cancelButton: !1,
651
- saveButton: O.length === 0 || o
655
+ saveButton: M.length === 0 || r
652
656
  });
653
- }, [O.length, o, i]), V(() => {
657
+ }, [M.length, r, i]), se(() => {
654
658
  l && l({
655
659
  cancelButton: k,
656
- saveButton: $
660
+ saveButton: Y
657
661
  });
658
- }, [l, k, $]);
659
- const H = _(() => S.map((t) => ({
662
+ }, [l, k, Y]);
663
+ const V = D(() => C.map((t) => ({
660
664
  value: t.id,
661
665
  label: t.name
662
- })), [S]), y = _(() => b.filter((t) => a === "copy" ? !0 : !t.quantumOwned).map((t) => ({
666
+ })), [C]), v = D(() => T.filter((t) => a === "copy" ? !0 : !t.quantumOwned).map((t) => ({
663
667
  value: t.id,
664
668
  label: t.name,
665
669
  // Add custom data to identify quantum-owned actions for UI display
666
670
  isQuantumOwned: t.quantumOwned
667
- })), [b, a]), L = j.fetching, K = m.fetching;
668
- return /* @__PURE__ */ e.jsx(q, { children: /* @__PURE__ */ e.jsxs(Z, { spacing: 6, align: "stretch", children: [
669
- u && /* @__PURE__ */ e.jsxs(W, { children: [
670
- /* @__PURE__ */ e.jsx(se, { children: "Operation Mode" }),
671
+ })), [T, a]), $ = p.fetching, q = g.fetching;
672
+ return /* @__PURE__ */ e.jsx(J, { children: /* @__PURE__ */ e.jsxs(ee, { spacing: 6, align: "stretch", children: [
673
+ u && /* @__PURE__ */ e.jsxs(B, { children: [
674
+ /* @__PURE__ */ e.jsx(re, { children: "Operation Mode" }),
671
675
  /* @__PURE__ */ e.jsx(
672
- Ve,
676
+ Je,
673
677
  {
674
678
  value: a,
675
679
  onChange: (t) => {
676
- M(t), A([]);
680
+ w(t), f([]);
677
681
  },
678
- children: /* @__PURE__ */ e.jsxs(X, { spacing: 6, children: [
679
- /* @__PURE__ */ e.jsx(Ae, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(Z, { align: "start", spacing: 1, children: [
680
- /* @__PURE__ */ e.jsx(v, { fontWeight: "medium", children: "Copy Activities" }),
681
- /* @__PURE__ */ e.jsx(v, { fontSize: "sm", color: "gray.600", children: "Create new activities based on selected ones" })
682
+ children: /* @__PURE__ */ e.jsxs(te, { spacing: 6, children: [
683
+ /* @__PURE__ */ e.jsx(Te, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(ee, { align: "start", spacing: 1, children: [
684
+ /* @__PURE__ */ e.jsx(b, { fontWeight: "medium", children: "Copy Activities" }),
685
+ /* @__PURE__ */ e.jsx(b, { fontSize: "sm", color: "gray.600", children: "Create new activities based on selected ones" })
682
686
  ] }) }),
683
- /* @__PURE__ */ e.jsx(Ae, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(Z, { align: "start", spacing: 1, children: [
684
- /* @__PURE__ */ e.jsx(v, { fontWeight: "medium", children: "Convert to Quantum Owned" }),
685
- /* @__PURE__ */ e.jsx(v, { fontSize: "sm", color: "gray.600", children: "Convert existing activities to quantum-owned" })
687
+ /* @__PURE__ */ e.jsx(Te, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(ee, { align: "start", spacing: 1, children: [
688
+ /* @__PURE__ */ e.jsx(b, { fontWeight: "medium", children: "Convert to Quantum Owned" }),
689
+ /* @__PURE__ */ e.jsx(b, { fontSize: "sm", color: "gray.600", children: "Convert existing activities to quantum-owned" })
686
690
  ] }) })
687
691
  ] })
688
692
  }
689
693
  )
690
694
  ] }),
691
- /* @__PURE__ */ e.jsxs(W, { children: [
692
- /* @__PURE__ */ e.jsx(se, { children: "Select Source Group" }),
695
+ /* @__PURE__ */ e.jsxs(B, { children: [
696
+ /* @__PURE__ */ e.jsx(re, { children: "Select Source Group" }),
693
697
  /* @__PURE__ */ e.jsx(
694
- ie,
698
+ ne,
695
699
  {
696
700
  placeholder: "Choose a group...",
697
- options: H,
698
- value: H.find((t) => t.value === T) || null,
699
- onChange: I,
700
- isLoading: L,
701
- isDisabled: L,
701
+ options: V,
702
+ value: V.find((t) => t.value === I) || null,
703
+ onChange: E,
704
+ isLoading: $,
705
+ isDisabled: $,
702
706
  isClearable: !0
703
707
  }
704
708
  ),
705
- j.error && /* @__PURE__ */ e.jsxs(Oe, { status: "error", mt: 2, children: [
706
- /* @__PURE__ */ e.jsx(Te, {}),
707
- /* @__PURE__ */ e.jsxs(v, { fontSize: "sm", children: [
709
+ p.error && /* @__PURE__ */ e.jsxs(Ae, { status: "error", mt: 2, children: [
710
+ /* @__PURE__ */ e.jsx(Me, {}),
711
+ /* @__PURE__ */ e.jsxs(b, { fontSize: "sm", children: [
708
712
  "Failed to load groups: ",
709
- j.error.message
713
+ p.error.message
710
714
  ] })
711
715
  ] })
712
716
  ] }),
713
- T && /* @__PURE__ */ e.jsxs(W, { children: [
714
- /* @__PURE__ */ e.jsxs(se, { children: [
717
+ I && /* @__PURE__ */ e.jsxs(B, { children: [
718
+ /* @__PURE__ */ e.jsxs(re, { children: [
715
719
  "Select Activities to",
716
720
  " ",
717
721
  a === "copy" ? "Copy" : "Convert"
718
722
  ] }),
719
- K ? /* @__PURE__ */ e.jsxs(X, { children: [
720
- /* @__PURE__ */ e.jsx(et, { size: "sm" }),
721
- /* @__PURE__ */ e.jsx(v, { fontSize: "sm", color: "gray.600", children: "Loading activities..." })
723
+ q ? /* @__PURE__ */ e.jsxs(te, { children: [
724
+ /* @__PURE__ */ e.jsx(Xe, { size: "sm" }),
725
+ /* @__PURE__ */ e.jsx(b, { fontSize: "sm", color: "gray.600", children: "Loading activities..." })
722
726
  ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
723
727
  /* @__PURE__ */ e.jsx(
724
- ie,
728
+ ne,
725
729
  {
726
730
  placeholder: `Choose activities to ${a}...`,
727
- options: y,
728
- value: y.filter(
729
- (t) => x.includes(t.value)
731
+ options: v,
732
+ value: v.filter(
733
+ (t) => j.includes(t.value)
730
734
  ),
731
- onChange: D,
732
- isDisabled: y.length === 0,
735
+ onChange: O,
736
+ isDisabled: v.length === 0,
733
737
  isClearable: !0,
734
738
  isMulti: !0,
735
739
  closeMenuOnSelect: !1,
736
- formatOptionLabel: (t, { context: h }) => /* @__PURE__ */ e.jsxs(X, { justify: "space-between", w: "100%", children: [
740
+ formatOptionLabel: (t, { context: h }) => /* @__PURE__ */ e.jsxs(te, { justify: "space-between", w: "100%", children: [
737
741
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
738
- /* @__PURE__ */ e.jsx(v, { children: t.label }),
739
- h === "value" && t.isQuantumOwned && /* @__PURE__ */ e.jsx(v, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
742
+ /* @__PURE__ */ e.jsx(b, { children: t.label }),
743
+ h === "value" && t.isQuantumOwned && /* @__PURE__ */ e.jsx(b, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
740
744
  ] }),
741
- t.isQuantumOwned && h === "menu" && /* @__PURE__ */ e.jsx(ge, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
745
+ t.isQuantumOwned && h === "menu" && /* @__PURE__ */ e.jsx(fe, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
742
746
  ] })
743
747
  }
744
748
  ),
745
- y.length === 0 && /* @__PURE__ */ e.jsx(v, { fontSize: "sm", color: "gray.500", mt: 2, children: "No activities found" })
749
+ v.length === 0 && /* @__PURE__ */ e.jsx(b, { fontSize: "sm", color: "gray.500", mt: 2, children: "No activities found" })
746
750
  ] }),
747
- m.error && /* @__PURE__ */ e.jsxs(Oe, { status: "error", mt: 2, children: [
748
- /* @__PURE__ */ e.jsx(Te, {}),
749
- /* @__PURE__ */ e.jsxs(v, { fontSize: "sm", children: [
751
+ g.error && /* @__PURE__ */ e.jsxs(Ae, { status: "error", mt: 2, children: [
752
+ /* @__PURE__ */ e.jsx(Me, {}),
753
+ /* @__PURE__ */ e.jsxs(b, { fontSize: "sm", children: [
750
754
  "Failed to load activities: ",
751
- m.error.message
755
+ g.error.message
752
756
  ] })
753
757
  ] })
754
758
  ] }),
755
- O.length > 0 && /* @__PURE__ */ e.jsxs(q, { p: 4, bg: "gray.50", borderRadius: "md", children: [
756
- /* @__PURE__ */ e.jsx(v, { fontWeight: "semibold", mb: 3, children: O.length === 1 ? `Activity to ${a === "copy" ? "Copy" : "Convert"}:` : `${O.length} Activities to ${a === "copy" ? "Copy" : "Convert"}:` }),
757
- /* @__PURE__ */ e.jsxs(Z, { align: "start", spacing: 3, children: [
758
- O.map((t, h) => /* @__PURE__ */ e.jsxs(
759
- q,
759
+ M.length > 0 && /* @__PURE__ */ e.jsxs(J, { p: 4, bg: "gray.50", borderRadius: "md", children: [
760
+ /* @__PURE__ */ e.jsx(b, { fontWeight: "semibold", mb: 3, children: M.length === 1 ? `Activity to ${a === "copy" ? "Copy" : "Convert"}:` : `${M.length} Activities to ${a === "copy" ? "Copy" : "Convert"}:` }),
761
+ /* @__PURE__ */ e.jsxs(ee, { align: "start", spacing: 3, children: [
762
+ M.map((t, h) => /* @__PURE__ */ e.jsxs(
763
+ J,
760
764
  {
761
765
  w: "100%",
762
766
  p: 3,
@@ -765,51 +769,51 @@ const Kt = ({
765
769
  border: "1px solid",
766
770
  borderColor: "gray.200",
767
771
  children: [
768
- /* @__PURE__ */ e.jsxs(X, { justify: "space-between", align: "start", mb: 2, children: [
769
- /* @__PURE__ */ e.jsxs(v, { fontWeight: "medium", fontSize: "sm", children: [
772
+ /* @__PURE__ */ e.jsxs(te, { justify: "space-between", align: "start", mb: 2, children: [
773
+ /* @__PURE__ */ e.jsxs(b, { fontWeight: "medium", fontSize: "sm", children: [
770
774
  h + 1,
771
775
  ". ",
772
776
  t.name
773
777
  ] }),
774
- t.quantumOwned && /* @__PURE__ */ e.jsx(ge, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
778
+ t.quantumOwned && /* @__PURE__ */ e.jsx(fe, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
775
779
  ] }),
776
780
  /* @__PURE__ */ e.jsxs(
777
- Z,
781
+ ee,
778
782
  {
779
783
  align: "start",
780
784
  spacing: 1,
781
785
  fontSize: "sm",
782
786
  color: "gray.600",
783
787
  children: [
784
- t.description && /* @__PURE__ */ e.jsxs(v, { children: [
788
+ t.description && /* @__PURE__ */ e.jsxs(b, { children: [
785
789
  /* @__PURE__ */ e.jsx("strong", { children: "Description:" }),
786
790
  " ",
787
791
  t.description
788
792
  ] }),
789
- /* @__PURE__ */ e.jsxs(v, { children: [
793
+ /* @__PURE__ */ e.jsxs(b, { children: [
790
794
  /* @__PURE__ */ e.jsx("strong", { children: "Type:" }),
791
795
  " ",
792
796
  t.activityKind
793
797
  ] }),
794
- /* @__PURE__ */ e.jsxs(v, { children: [
798
+ /* @__PURE__ */ e.jsxs(b, { children: [
795
799
  /* @__PURE__ */ e.jsx("strong", { children: "Laterality:" }),
796
800
  " ",
797
801
  t.laterality
798
802
  ] }),
799
- /* @__PURE__ */ e.jsxs(v, { children: [
803
+ /* @__PURE__ */ e.jsxs(b, { children: [
800
804
  /* @__PURE__ */ e.jsx("strong", { children: "Sensor Locations:" }),
801
805
  " ",
802
806
  t.sensorLocations.length
803
807
  ] }),
804
- /* @__PURE__ */ e.jsxs(v, { children: [
808
+ /* @__PURE__ */ e.jsxs(b, { children: [
805
809
  /* @__PURE__ */ e.jsx("strong", { children: "Thresholds:" }),
806
810
  " ",
807
811
  t.thresholds.length
808
812
  ] }),
809
- /* @__PURE__ */ e.jsxs(v, { children: [
813
+ /* @__PURE__ */ e.jsxs(b, { children: [
810
814
  /* @__PURE__ */ e.jsx("strong", { children: "Use Cases:" }),
811
815
  " ",
812
- t.useCases.map((f) => f.name).join(", ") || "None"
816
+ t.useCases.map((S) => S.name).join(", ") || "None"
813
817
  ] })
814
818
  ]
815
819
  }
@@ -818,8 +822,8 @@ const Kt = ({
818
822
  },
819
823
  t.id
820
824
  )),
821
- O.length > 1 && /* @__PURE__ */ e.jsx(
822
- q,
825
+ M.length > 1 && /* @__PURE__ */ e.jsx(
826
+ J,
823
827
  {
824
828
  w: "100%",
825
829
  p: 2,
@@ -827,9 +831,9 @@ const Kt = ({
827
831
  borderRadius: "md",
828
832
  border: "1px solid",
829
833
  borderColor: "blue.200",
830
- children: /* @__PURE__ */ e.jsxs(v, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
834
+ children: /* @__PURE__ */ e.jsxs(b, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
831
835
  "Total: ",
832
- O.length,
836
+ M.length,
833
837
  " activities will be",
834
838
  " ",
835
839
  a === "copy" ? "copied" : "converted"
@@ -838,321 +842,325 @@ const Kt = ({
838
842
  )
839
843
  ] })
840
844
  ] }),
841
- !d && /* @__PURE__ */ e.jsxs(me, { spacing: 4, justifyContent: "flex-end", children: [
845
+ !c && /* @__PURE__ */ e.jsxs(pe, { spacing: 4, justifyContent: "flex-end", children: [
842
846
  /* @__PURE__ */ e.jsx(
843
- J,
847
+ X,
844
848
  {
845
849
  variant: "outline",
846
850
  onClick: k,
847
- isDisabled: o,
851
+ isDisabled: r,
848
852
  children: "Cancel"
849
853
  }
850
854
  ),
851
855
  /* @__PURE__ */ e.jsxs(
852
- J,
856
+ X,
853
857
  {
854
858
  colorScheme: a === "copy" ? "blue" : "green",
855
- onClick: $,
856
- isDisabled: O.length === 0 || o,
857
- isLoading: o,
859
+ onClick: Y,
860
+ isDisabled: M.length === 0 || r,
861
+ isLoading: r,
858
862
  loadingText: `${a === "copy" ? "Copying" : "Converting"}...`,
859
863
  children: [
860
864
  a === "copy" ? "Copy" : "Convert",
861
865
  " ",
862
- O.length === 1 ? "Activity" : `${O.length} Activities`
866
+ M.length === 1 ? "Activity" : `${M.length} Activities`
863
867
  ]
864
868
  }
865
869
  )
866
870
  ] })
867
871
  ] }) });
868
- }, Rs = ({
872
+ }, Ns = ({
869
873
  onSave: n,
870
874
  onCancel: s,
871
- onError: r,
872
- hideButtons: d = !1,
875
+ onError: o,
876
+ hideButtons: c = !1,
873
877
  setButtonDisabled: i,
874
878
  setButtonOnClick: l,
875
879
  quantumOwned: u
876
880
  }) => {
877
- const g = Ze(), [a, M] = E(""), [T, p] = E([]), [x, A] = E(!1), [o, c] = E("copy"), [j] = oe({
878
- query: tt
879
- }), [m] = oe({
880
- query: Rt,
881
+ const x = Ye(), [a, w] = z(""), [I, m] = z([]), [j, f] = z(!1), [r, d] = z("copy"), [p] = le({
882
+ query: Ke
883
+ }), [g] = le({
884
+ query: It,
881
885
  variables: { groupId: a },
882
886
  pause: !a
883
887
  // Only run when group is selected
884
- }), [, C] = te(it), [, w] = te(rt), [, S] = te(ze), [, b] = te(
885
- st
886
- ), O = _(() => j.data?.groups ? j.data.groups.map(
887
- (t) => B(nt, t)
888
- ) : [], [j.data]), I = _(() => m.data?.modules ? B(
889
- Se,
890
- m.data?.modules
888
+ }), [, y] = oe(st), [, A] = oe(tt), [, C] = oe(Ie), [, T] = oe(
889
+ Ve
890
+ ), M = D(() => p.data?.groups ? p.data.groups.map(
891
+ (t) => _(Ze, t)
892
+ ) : [], [p.data]), E = D(() => g.data?.modules ? _(
893
+ we,
894
+ g.data?.modules
891
895
  ).map((h) => {
892
- const f = B(
893
- ot,
896
+ const S = _(
897
+ et,
894
898
  h.moduleActions
895
899
  );
896
900
  return {
897
901
  ...h,
898
- moduleActions: f.map((F) => ({
902
+ moduleActions: S.map((F) => ({
899
903
  ...F,
900
- action: B(re, F.action)
904
+ action: _(ae, F.action)
901
905
  })),
902
- categories: B(
903
- ke,
906
+ categories: _(
907
+ de,
904
908
  h.categories
905
909
  )
906
910
  };
907
- }) : [], [m.data]), D = _(() => I.filter(
908
- (t) => T.includes(t.id)
909
- ), [I, T]), P = N(
911
+ }) : [], [g.data]), O = D(() => E.filter(
912
+ (t) => I.includes(t.id)
913
+ ), [E, I]), Q = R(
910
914
  (t) => {
911
915
  const h = t?.value || "";
912
- M(h), p([]);
916
+ w(h), m([]);
913
917
  },
914
918
  []
915
- ), ee = N(
919
+ ), K = R(
916
920
  (t) => {
917
- const h = t.map((f) => f.value);
918
- p(h);
921
+ const h = t.map((S) => S.value);
922
+ m(h);
919
923
  },
920
924
  []
921
- ), $ = N(async () => {
922
- if (A(!0), !D.length) {
923
- A(!1);
925
+ ), Y = R(async () => {
926
+ if (f(!0), !O.length) {
927
+ f(!1);
924
928
  const t = new Error(
925
- `No modules selected for ${o === "convert" ? "converting" : "copying"}`
929
+ `No modules selected for ${r === "convert" ? "converting" : "copying"}`
926
930
  );
927
- r?.(t);
931
+ o?.(t);
928
932
  return;
929
933
  }
930
934
  try {
931
935
  const t = [];
932
936
  let h = 0;
933
- for (const f of D)
937
+ for (const S of O)
934
938
  try {
935
- let F = f.moduleActions.map((U) => U.actionId);
939
+ let F = S.moduleActions.map((L) => L.actionId);
936
940
  if (u) {
937
- const U = f.moduleActions.map((Q) => Q.action), G = async (Q) => {
938
- if (o === "copy") {
939
- if (Q.quantumOwned) return Q;
940
- const xe = {
941
- ...Q,
941
+ const L = S.moduleActions.map((W) => W.action), U = async (W) => {
942
+ if (r === "copy") {
943
+ if (W.quantumOwned) return W;
944
+ const ue = _(
945
+ de,
946
+ W.categories
947
+ ), xe = {
948
+ ...W,
942
949
  quantumOwned: !0,
943
- thresholds: Q.thresholds.map((pe) => ({
944
- ...pe,
950
+ thresholds: W.thresholds.map((G) => ({
951
+ ...G,
945
952
  id: void 0
946
953
  })),
954
+ categories: ue?.map((G) => G.id),
947
955
  id: void 0
948
- }, le = await S({ fields: xe });
949
- return le.error || !le.data?.createAction ? null : B(
950
- re,
951
- le.data.createAction
956
+ }, N = await C({ fields: xe });
957
+ return N.error || !N.data?.createAction ? null : _(
958
+ ae,
959
+ N.data.createAction
952
960
  );
953
961
  }
954
- if (Q.quantumOwned) return Q;
955
- const de = await b({
956
- id: Q.id
962
+ if (W.quantumOwned) return W;
963
+ const ge = await T({
964
+ id: W.id
957
965
  });
958
- return de.error || !de.data?.convertActionToQuantumOwned ? null : B(
959
- re,
960
- de.data.convertActionToQuantumOwned
966
+ return ge.error || !ge.data?.convertActionToQuantumOwned ? null : _(
967
+ ae,
968
+ ge.data.convertActionToQuantumOwned
961
969
  );
962
970
  };
963
971
  F = (await Promise.all(
964
- U.map(G)
965
- )).filter((Q) => !!Q).map((Q) => Q.id);
972
+ L.map(U)
973
+ )).filter((W) => !!W).map((W) => W.id);
966
974
  }
967
- if (o === "convert") {
968
- const U = {
969
- name: f.name,
970
- description: f.description || void 0,
975
+ if (r === "convert") {
976
+ const L = {
977
+ name: S.name,
978
+ description: S.description || void 0,
971
979
  actions: F,
972
- categories: f.categories.map((Y) => Y.id),
980
+ categories: S.categories.map((H) => H.id),
973
981
  quantumOwned: !0
974
- }, G = await w({
975
- id: f.id,
976
- input: U
982
+ }, U = await A({
983
+ id: S.id,
984
+ input: L
977
985
  });
978
- if (G.error) throw new Error(G.error.message);
979
- if (G.data?.updateModule) {
980
- const Y = B(
981
- Se,
982
- G.data.updateModule
986
+ if (U.error) throw new Error(U.error.message);
987
+ if (U.data?.updateModule) {
988
+ const H = _(
989
+ we,
990
+ U.data.updateModule
983
991
  );
984
- t.push(Y);
992
+ t.push(H);
985
993
  }
986
994
  } else {
987
- const U = {
988
- name: `${f.name} (Copy)`,
989
- description: f.description || void 0,
995
+ const L = {
996
+ name: `${S.name} (Copy)`,
997
+ description: S.description || void 0,
990
998
  actions: F,
991
- categories: f.categories.map((Y) => Y.id),
999
+ categories: S.categories.map((H) => H.id),
992
1000
  quantumOwned: u
993
- }, G = await C({ input: U });
994
- if (G.error) throw new Error(G.error.message);
995
- if (G.data?.createModule) {
996
- const Y = B(
997
- Se,
998
- G.data.createModule
1001
+ }, U = await y({ input: L });
1002
+ if (U.error) throw new Error(U.error.message);
1003
+ if (U.data?.createModule) {
1004
+ const H = _(
1005
+ we,
1006
+ U.data.createModule
999
1007
  );
1000
- t.push(Y);
1008
+ t.push(H);
1001
1009
  }
1002
1010
  }
1003
1011
  } catch (F) {
1004
1012
  console.error(
1005
- `Failed to ${o === "convert" ? "convert" : "copy"} module "${f.name}":`,
1013
+ `Failed to ${r === "convert" ? "convert" : "copy"} module "${S.name}":`,
1006
1014
  F
1007
1015
  ), h++;
1008
1016
  }
1009
1017
  if (t.length > 0) {
1010
- const f = t.length, F = D.length;
1011
- g({
1012
- title: h > 0 ? `Partial ${o === "convert" ? "convert" : "copy"} completed` : `Modules ${o === "convert" ? "converted" : "copied"} successfully`,
1013
- description: h > 0 ? `${f} of ${F} modules ${o === "convert" ? "converted" : "copied"} successfully` : `${f} module${f > 1 ? "s" : ""} ${o === "convert" ? "converted" : "copied"} successfully`,
1018
+ const S = t.length, F = O.length;
1019
+ x({
1020
+ title: h > 0 ? `Partial ${r === "convert" ? "convert" : "copy"} completed` : `Modules ${r === "convert" ? "converted" : "copied"} successfully`,
1021
+ description: h > 0 ? `${S} of ${F} modules ${r === "convert" ? "converted" : "copied"} successfully` : `${S} module${S > 1 ? "s" : ""} ${r === "convert" ? "converted" : "copied"} successfully`,
1014
1022
  status: h > 0 ? "warning" : "success",
1015
1023
  duration: 3e3,
1016
1024
  isClosable: !0
1017
- }), t.length > 0 && n?.(), M(""), p([]);
1025
+ }), t.length > 0 && n?.(), w(""), m([]);
1018
1026
  } else
1019
1027
  throw new Error(
1020
- `Failed to ${o === "convert" ? "convert" : "copy"} any modules`
1028
+ `Failed to ${r === "convert" ? "convert" : "copy"} any modules`
1021
1029
  );
1022
1030
  } catch (t) {
1023
- const h = t instanceof Error ? t.message : `Failed to ${o === "convert" ? "convert" : "copy"} modules`;
1024
- g({
1025
- title: o === "convert" ? "Convert failed" : "Copy failed",
1031
+ const h = t instanceof Error ? t.message : `Failed to ${r === "convert" ? "convert" : "copy"} modules`;
1032
+ x({
1033
+ title: r === "convert" ? "Convert failed" : "Copy failed",
1026
1034
  description: h,
1027
1035
  status: "error",
1028
1036
  duration: 5e3,
1029
1037
  isClosable: !0
1030
- }), r?.(t instanceof Error ? t : new Error(h));
1038
+ }), o?.(t instanceof Error ? t : new Error(h));
1031
1039
  } finally {
1032
- A(!1);
1040
+ f(!1);
1033
1041
  }
1034
1042
  }, [
1035
- D,
1036
- C,
1037
- w,
1038
- g,
1043
+ O,
1044
+ y,
1045
+ A,
1046
+ x,
1039
1047
  n,
1040
- r,
1048
+ o,
1041
1049
  u,
1042
- S,
1043
- b,
1044
- o
1045
- ]), k = N(() => {
1046
- M(""), p([]), c("copy"), s?.();
1050
+ C,
1051
+ T,
1052
+ r
1053
+ ]), k = R(() => {
1054
+ w(""), m([]), d("copy"), s?.();
1047
1055
  }, [s]);
1048
- V(() => {
1056
+ se(() => {
1049
1057
  i && i({
1050
1058
  cancelButton: !1,
1051
- saveButton: D.length === 0 || x
1059
+ saveButton: O.length === 0 || j
1052
1060
  });
1053
- }, [D.length, x, i]), V(() => {
1061
+ }, [O.length, j, i]), se(() => {
1054
1062
  l && l({
1055
1063
  cancelButton: k,
1056
- saveButton: $
1064
+ saveButton: Y
1057
1065
  });
1058
- }, [l, k, $]);
1059
- const H = _(() => O.map((t) => ({
1066
+ }, [l, k, Y]);
1067
+ const V = D(() => M.map((t) => ({
1060
1068
  value: t.id,
1061
1069
  label: t.name
1062
- })), [O]), y = _(() => I.filter((t) => o === "copy" ? !0 : !t.quantumOwned).map((t) => ({
1070
+ })), [M]), v = D(() => E.filter((t) => r === "copy" ? !0 : !t.quantumOwned).map((t) => ({
1063
1071
  value: t.id,
1064
1072
  label: t.name,
1065
1073
  // Add custom data to identify quantum-owned modules
1066
1074
  isQuantumOwned: t.quantumOwned
1067
- })), [I, o]), L = j.fetching, K = m.fetching;
1068
- return /* @__PURE__ */ e.jsx(q, { children: /* @__PURE__ */ e.jsxs(Z, { spacing: 6, align: "stretch", children: [
1069
- u && /* @__PURE__ */ e.jsxs(W, { children: [
1070
- /* @__PURE__ */ e.jsx(se, { children: "Operation Mode" }),
1075
+ })), [E, r]), $ = p.fetching, q = g.fetching;
1076
+ return /* @__PURE__ */ e.jsx(J, { children: /* @__PURE__ */ e.jsxs(ee, { spacing: 6, align: "stretch", children: [
1077
+ u && /* @__PURE__ */ e.jsxs(B, { children: [
1078
+ /* @__PURE__ */ e.jsx(re, { children: "Operation Mode" }),
1071
1079
  /* @__PURE__ */ e.jsx(
1072
- Ve,
1080
+ Je,
1073
1081
  {
1074
- value: o,
1082
+ value: r,
1075
1083
  onChange: (t) => {
1076
- c(t), p([]);
1084
+ d(t), m([]);
1077
1085
  },
1078
- children: /* @__PURE__ */ e.jsxs(X, { spacing: 6, children: [
1079
- /* @__PURE__ */ e.jsx(Ae, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(Z, { align: "start", spacing: 1, children: [
1080
- /* @__PURE__ */ e.jsx(v, { fontWeight: "medium", children: "Copy Modules" }),
1081
- /* @__PURE__ */ e.jsx(v, { fontSize: "sm", color: "gray.600", children: "Create new modules based on selected ones" })
1086
+ children: /* @__PURE__ */ e.jsxs(te, { spacing: 6, children: [
1087
+ /* @__PURE__ */ e.jsx(Te, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(ee, { align: "start", spacing: 1, children: [
1088
+ /* @__PURE__ */ e.jsx(b, { fontWeight: "medium", children: "Copy Modules" }),
1089
+ /* @__PURE__ */ e.jsx(b, { fontSize: "sm", color: "gray.600", children: "Create new modules based on selected ones" })
1082
1090
  ] }) }),
1083
- /* @__PURE__ */ e.jsx(Ae, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(Z, { align: "start", spacing: 1, children: [
1084
- /* @__PURE__ */ e.jsx(v, { fontWeight: "medium", children: "Convert to Quantum Owned" }),
1085
- /* @__PURE__ */ e.jsx(v, { fontSize: "sm", color: "gray.600", children: "Convert existing modules to quantum-owned" })
1091
+ /* @__PURE__ */ e.jsx(Te, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(ee, { align: "start", spacing: 1, children: [
1092
+ /* @__PURE__ */ e.jsx(b, { fontWeight: "medium", children: "Convert to Quantum Owned" }),
1093
+ /* @__PURE__ */ e.jsx(b, { fontSize: "sm", color: "gray.600", children: "Convert existing modules to quantum-owned" })
1086
1094
  ] }) })
1087
1095
  ] })
1088
1096
  }
1089
1097
  )
1090
1098
  ] }),
1091
- /* @__PURE__ */ e.jsxs(W, { children: [
1092
- /* @__PURE__ */ e.jsx(se, { children: "Select Source Group" }),
1099
+ /* @__PURE__ */ e.jsxs(B, { children: [
1100
+ /* @__PURE__ */ e.jsx(re, { children: "Select Source Group" }),
1093
1101
  /* @__PURE__ */ e.jsx(
1094
- ie,
1102
+ ne,
1095
1103
  {
1096
1104
  placeholder: "Choose a group...",
1097
- options: H,
1098
- value: H.find((t) => t.value === a) || null,
1099
- onChange: P,
1100
- isLoading: L,
1101
- isDisabled: L,
1105
+ options: V,
1106
+ value: V.find((t) => t.value === a) || null,
1107
+ onChange: Q,
1108
+ isLoading: $,
1109
+ isDisabled: $,
1102
1110
  isClearable: !0
1103
1111
  }
1104
1112
  ),
1105
- j.error && /* @__PURE__ */ e.jsxs(Oe, { status: "error", mt: 2, children: [
1106
- /* @__PURE__ */ e.jsx(Te, {}),
1107
- /* @__PURE__ */ e.jsxs(v, { fontSize: "sm", children: [
1113
+ p.error && /* @__PURE__ */ e.jsxs(Ae, { status: "error", mt: 2, children: [
1114
+ /* @__PURE__ */ e.jsx(Me, {}),
1115
+ /* @__PURE__ */ e.jsxs(b, { fontSize: "sm", children: [
1108
1116
  "Failed to load groups: ",
1109
- j.error.message
1117
+ p.error.message
1110
1118
  ] })
1111
1119
  ] })
1112
1120
  ] }),
1113
- a && /* @__PURE__ */ e.jsxs(W, { children: [
1114
- /* @__PURE__ */ e.jsx(se, { children: o === "convert" ? "Select Module to Convert" : "Select Module to Copy" }),
1115
- K ? /* @__PURE__ */ e.jsxs(X, { children: [
1116
- /* @__PURE__ */ e.jsx(et, { size: "sm" }),
1117
- /* @__PURE__ */ e.jsx(v, { fontSize: "sm", color: "gray.600", children: "Loading modules..." })
1121
+ a && /* @__PURE__ */ e.jsxs(B, { children: [
1122
+ /* @__PURE__ */ e.jsx(re, { children: r === "convert" ? "Select Module to Convert" : "Select Module to Copy" }),
1123
+ q ? /* @__PURE__ */ e.jsxs(te, { children: [
1124
+ /* @__PURE__ */ e.jsx(Xe, { size: "sm" }),
1125
+ /* @__PURE__ */ e.jsx(b, { fontSize: "sm", color: "gray.600", children: "Loading modules..." })
1118
1126
  ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1119
1127
  /* @__PURE__ */ e.jsx(
1120
- ie,
1128
+ ne,
1121
1129
  {
1122
- placeholder: o === "convert" ? "Choose modules to convert..." : "Choose modules to copy...",
1123
- options: y,
1124
- value: y.filter(
1125
- (t) => T.includes(t.value)
1130
+ placeholder: r === "convert" ? "Choose modules to convert..." : "Choose modules to copy...",
1131
+ options: v,
1132
+ value: v.filter(
1133
+ (t) => I.includes(t.value)
1126
1134
  ),
1127
- onChange: ee,
1128
- isDisabled: y.length === 0,
1135
+ onChange: K,
1136
+ isDisabled: v.length === 0,
1129
1137
  isClearable: !0,
1130
1138
  isMulti: !0,
1131
1139
  closeMenuOnSelect: !1,
1132
- formatOptionLabel: (t, { context: h }) => /* @__PURE__ */ e.jsxs(X, { justify: "space-between", w: "100%", children: [
1140
+ formatOptionLabel: (t, { context: h }) => /* @__PURE__ */ e.jsxs(te, { justify: "space-between", w: "100%", children: [
1133
1141
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
1134
- /* @__PURE__ */ e.jsx(v, { children: t.label }),
1135
- h === "value" && t.isQuantumOwned && /* @__PURE__ */ e.jsx(v, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
1142
+ /* @__PURE__ */ e.jsx(b, { children: t.label }),
1143
+ h === "value" && t.isQuantumOwned && /* @__PURE__ */ e.jsx(b, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
1136
1144
  ] }),
1137
- t.isQuantumOwned && h === "menu" && /* @__PURE__ */ e.jsx(ge, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
1145
+ t.isQuantumOwned && h === "menu" && /* @__PURE__ */ e.jsx(fe, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
1138
1146
  ] })
1139
1147
  }
1140
1148
  ),
1141
- y.length === 0 && /* @__PURE__ */ e.jsx(v, { fontSize: "sm", color: "gray.500", mt: 2, children: "No modules found in this group" })
1149
+ v.length === 0 && /* @__PURE__ */ e.jsx(b, { fontSize: "sm", color: "gray.500", mt: 2, children: "No modules found in this group" })
1142
1150
  ] }),
1143
- m.error && /* @__PURE__ */ e.jsxs(Oe, { status: "error", mt: 2, children: [
1144
- /* @__PURE__ */ e.jsx(Te, {}),
1145
- /* @__PURE__ */ e.jsxs(v, { fontSize: "sm", children: [
1151
+ g.error && /* @__PURE__ */ e.jsxs(Ae, { status: "error", mt: 2, children: [
1152
+ /* @__PURE__ */ e.jsx(Me, {}),
1153
+ /* @__PURE__ */ e.jsxs(b, { fontSize: "sm", children: [
1146
1154
  "Failed to load modules: ",
1147
- m.error.message
1155
+ g.error.message
1148
1156
  ] })
1149
1157
  ] })
1150
1158
  ] }),
1151
- D.length > 0 && /* @__PURE__ */ e.jsxs(q, { p: 4, bg: "gray.50", borderRadius: "md", children: [
1152
- /* @__PURE__ */ e.jsx(v, { fontWeight: "semibold", mb: 3, children: D.length === 1 ? `Module to ${o === "copy" ? "Copy" : "Convert"}` : `${D.length} Modules to ${o === "copy" ? "Copy" : "Convert"}` }),
1153
- /* @__PURE__ */ e.jsxs(Z, { align: "start", spacing: 3, children: [
1154
- D.map((t, h) => /* @__PURE__ */ e.jsxs(
1155
- q,
1159
+ O.length > 0 && /* @__PURE__ */ e.jsxs(J, { p: 4, bg: "gray.50", borderRadius: "md", children: [
1160
+ /* @__PURE__ */ e.jsx(b, { fontWeight: "semibold", mb: 3, children: O.length === 1 ? `Module to ${r === "copy" ? "Copy" : "Convert"}` : `${O.length} Modules to ${r === "copy" ? "Copy" : "Convert"}` }),
1161
+ /* @__PURE__ */ e.jsxs(ee, { align: "start", spacing: 3, children: [
1162
+ O.map((t, h) => /* @__PURE__ */ e.jsxs(
1163
+ J,
1156
1164
  {
1157
1165
  w: "100%",
1158
1166
  p: 3,
@@ -1161,36 +1169,36 @@ const Kt = ({
1161
1169
  border: "1px solid",
1162
1170
  borderColor: "gray.200",
1163
1171
  children: [
1164
- /* @__PURE__ */ e.jsxs(X, { justify: "space-between", align: "start", mb: 2, children: [
1165
- /* @__PURE__ */ e.jsxs(v, { fontWeight: "medium", fontSize: "sm", children: [
1172
+ /* @__PURE__ */ e.jsxs(te, { justify: "space-between", align: "start", mb: 2, children: [
1173
+ /* @__PURE__ */ e.jsxs(b, { fontWeight: "medium", fontSize: "sm", children: [
1166
1174
  h + 1,
1167
1175
  ". ",
1168
1176
  t.name
1169
1177
  ] }),
1170
- t.quantumOwned && /* @__PURE__ */ e.jsx(ge, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
1178
+ t.quantumOwned && /* @__PURE__ */ e.jsx(fe, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
1171
1179
  ] }),
1172
1180
  /* @__PURE__ */ e.jsxs(
1173
- Z,
1181
+ ee,
1174
1182
  {
1175
1183
  align: "start",
1176
1184
  spacing: 1,
1177
1185
  fontSize: "sm",
1178
1186
  color: "gray.600",
1179
1187
  children: [
1180
- t.description && /* @__PURE__ */ e.jsxs(v, { children: [
1188
+ t.description && /* @__PURE__ */ e.jsxs(b, { children: [
1181
1189
  /* @__PURE__ */ e.jsx("strong", { children: "Description:" }),
1182
1190
  " ",
1183
1191
  t.description
1184
1192
  ] }),
1185
- /* @__PURE__ */ e.jsxs(v, { children: [
1193
+ /* @__PURE__ */ e.jsxs(b, { children: [
1186
1194
  /* @__PURE__ */ e.jsx("strong", { children: "Actions:" }),
1187
1195
  " ",
1188
1196
  t.moduleActions.length
1189
1197
  ] }),
1190
- /* @__PURE__ */ e.jsxs(v, { children: [
1198
+ /* @__PURE__ */ e.jsxs(b, { children: [
1191
1199
  /* @__PURE__ */ e.jsx("strong", { children: "Categories:" }),
1192
1200
  " ",
1193
- t.categories.map((f) => f.name).join(", ") || "None"
1201
+ t.categories.map((S) => S.name).join(", ") || "None"
1194
1202
  ] })
1195
1203
  ]
1196
1204
  }
@@ -1199,8 +1207,8 @@ const Kt = ({
1199
1207
  },
1200
1208
  t.id
1201
1209
  )),
1202
- D.length > 1 && /* @__PURE__ */ e.jsx(
1203
- q,
1210
+ O.length > 1 && /* @__PURE__ */ e.jsx(
1211
+ J,
1204
1212
  {
1205
1213
  w: "100%",
1206
1214
  p: 2,
@@ -1208,133 +1216,133 @@ const Kt = ({
1208
1216
  borderRadius: "md",
1209
1217
  border: "1px solid",
1210
1218
  borderColor: "blue.200",
1211
- children: /* @__PURE__ */ e.jsxs(v, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
1219
+ children: /* @__PURE__ */ e.jsxs(b, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
1212
1220
  "Total: ",
1213
- D.length,
1221
+ O.length,
1214
1222
  " modules will be",
1215
1223
  " ",
1216
- o === "copy" ? "copied" : "converted"
1224
+ r === "copy" ? "copied" : "converted"
1217
1225
  ] })
1218
1226
  }
1219
1227
  ),
1220
- u && D.filter((t) => t.moduleActions.some((h) => !h.action.quantumOwned)).length > 0 && /* @__PURE__ */ e.jsx(
1221
- q,
1228
+ u && O.filter((t) => t.moduleActions.some((h) => !h.action.quantumOwned)).length > 0 && /* @__PURE__ */ e.jsx(
1229
+ J,
1222
1230
  {
1223
1231
  p: 2,
1224
1232
  bg: "yellow.50",
1225
1233
  borderRadius: "md",
1226
1234
  border: "1px solid",
1227
1235
  borderColor: "yellow.200",
1228
- children: /* @__PURE__ */ e.jsx(v, { fontSize: "sm", fontWeight: "medium", color: "yellow.800", children: o === "convert" ? "Converting Modules will convert non QM-Owned Actions to QM-Owned" : "Copying Modules with Non QM-Owned Actions will create corresponding QM-Owned Actions" })
1236
+ children: /* @__PURE__ */ e.jsx(b, { fontSize: "sm", fontWeight: "medium", color: "yellow.800", children: r === "convert" ? "Converting Modules will convert non QM-Owned Actions to QM-Owned" : "Copying Modules with Non QM-Owned Actions will create corresponding QM-Owned Actions" })
1229
1237
  }
1230
1238
  )
1231
1239
  ] })
1232
1240
  ] }),
1233
- !d && /* @__PURE__ */ e.jsxs(me, { spacing: 4, justifyContent: "flex-end", children: [
1241
+ !c && /* @__PURE__ */ e.jsxs(pe, { spacing: 4, justifyContent: "flex-end", children: [
1234
1242
  /* @__PURE__ */ e.jsx(
1235
- J,
1243
+ X,
1236
1244
  {
1237
1245
  variant: "outline",
1238
1246
  onClick: k,
1239
- isDisabled: x,
1247
+ isDisabled: j,
1240
1248
  children: "Cancel"
1241
1249
  }
1242
1250
  ),
1243
1251
  /* @__PURE__ */ e.jsxs(
1244
- J,
1252
+ X,
1245
1253
  {
1246
- colorScheme: o === "copy" ? "blue" : "green",
1247
- onClick: $,
1248
- isDisabled: D.length === 0 || x,
1249
- isLoading: x,
1250
- loadingText: `${o === "copy" ? "Copying" : "Converting"}...`,
1254
+ colorScheme: r === "copy" ? "blue" : "green",
1255
+ onClick: Y,
1256
+ isDisabled: O.length === 0 || j,
1257
+ isLoading: j,
1258
+ loadingText: `${r === "copy" ? "Copying" : "Converting"}...`,
1251
1259
  children: [
1252
- o === "copy" ? "Copy" : "Convert",
1260
+ r === "copy" ? "Copy" : "Convert",
1253
1261
  " ",
1254
- D.length === 1 ? "Module" : `${D.length} Modules`
1262
+ O.length === 1 ? "Module" : `${O.length} Modules`
1255
1263
  ]
1256
1264
  }
1257
1265
  )
1258
1266
  ] })
1259
1267
  ] }) });
1260
- }, rs = ({
1268
+ }, ns = ({
1261
1269
  name: n,
1262
1270
  setName: s,
1263
- actions: r,
1264
- selectedActionIds: d,
1271
+ actions: o,
1272
+ selectedActionIds: c,
1265
1273
  setSelectedActionIds: i,
1266
1274
  availableCategories: l,
1267
1275
  selectedCategoryIds: u,
1268
- setSelectedCategoryIds: g,
1276
+ setSelectedCategoryIds: x,
1269
1277
  description: a,
1270
- setDescription: M,
1271
- ...T
1278
+ setDescription: w,
1279
+ ...I
1272
1280
  }) => {
1273
- const p = gt(), x = _(() => r.map((C) => ({
1274
- ...C,
1275
- selected: d.includes(C.id)
1276
- })), [r, d]), A = _(() => r.reduce((C, w) => (C[w.id] = w, C), {}), [r]), o = _(
1277
- () => d.map((C) => A[C]),
1278
- [x, d]
1279
- ), c = N(
1280
- (C, w) => {
1281
- i(w ? [...d, C.id] : d.filter((S) => S !== C.id));
1281
+ const m = mt(), j = D(() => o.map((y) => ({
1282
+ ...y,
1283
+ selected: c.includes(y.id)
1284
+ })), [o, c]), f = D(() => o.reduce((y, A) => (y[A.id] = A, y), {}), [o]), r = D(
1285
+ () => c.map((y) => f[y]),
1286
+ [j, c]
1287
+ ), d = R(
1288
+ (y, A) => {
1289
+ i(A ? [...c, y.id] : c.filter((C) => C !== y.id));
1282
1290
  },
1283
- [d, i]
1284
- ), j = N(
1285
- (C) => {
1286
- s(C.target.value);
1291
+ [c, i]
1292
+ ), p = R(
1293
+ (y) => {
1294
+ s(y.target.value);
1287
1295
  },
1288
1296
  [s]
1289
- ), m = N(
1290
- (C) => {
1291
- M?.(C.target.value);
1297
+ ), g = R(
1298
+ (y) => {
1299
+ w?.(y.target.value);
1292
1300
  },
1293
- [M]
1301
+ [w]
1294
1302
  );
1295
- return /* @__PURE__ */ e.jsxs(q, { ...T, children: [
1296
- /* @__PURE__ */ e.jsxs(X, { gap: "2rem", children: [
1297
- /* @__PURE__ */ e.jsx(is, { name: n ?? "", onInputChange: j }),
1303
+ return /* @__PURE__ */ e.jsxs(J, { ...I, children: [
1304
+ /* @__PURE__ */ e.jsxs(te, { gap: "2rem", children: [
1305
+ /* @__PURE__ */ e.jsx(os, { name: n ?? "", onInputChange: p }),
1298
1306
  /* @__PURE__ */ e.jsx(
1299
- ls,
1307
+ rs,
1300
1308
  {
1301
1309
  availableCategories: l,
1302
1310
  value: u,
1303
- onChange: g
1311
+ onChange: x
1304
1312
  }
1305
1313
  )
1306
1314
  ] }),
1307
1315
  /* @__PURE__ */ e.jsx(
1308
- as,
1316
+ is,
1309
1317
  {
1310
1318
  description: a ?? "",
1311
- onInputChange: m
1319
+ onInputChange: g
1312
1320
  }
1313
1321
  ),
1314
1322
  /* @__PURE__ */ e.jsx(
1315
- cs,
1323
+ ls,
1316
1324
  {
1317
- value: o,
1325
+ value: r,
1318
1326
  onChange: i,
1319
- onAdjustActivities: () => p.onOpen()
1327
+ onAdjustActivities: () => m.onOpen()
1320
1328
  }
1321
1329
  ),
1322
1330
  /* @__PURE__ */ e.jsxs(
1323
- xt,
1331
+ pt,
1324
1332
  {
1325
- isOpen: p.isOpen,
1326
- onClose: p.onClose,
1333
+ isOpen: m.isOpen,
1334
+ onClose: m.onClose,
1327
1335
  size: "6xl",
1328
1336
  children: [
1329
- /* @__PURE__ */ e.jsx(ft, {}),
1330
- /* @__PURE__ */ e.jsxs(jt, { children: [
1331
- /* @__PURE__ */ e.jsx(vt, { children: "Select Activities" }),
1332
- /* @__PURE__ */ e.jsx(bt, {}),
1333
- /* @__PURE__ */ e.jsx(yt, { children: /* @__PURE__ */ e.jsx(
1334
- os,
1337
+ /* @__PURE__ */ e.jsx(gt, {}),
1338
+ /* @__PURE__ */ e.jsxs(xt, { children: [
1339
+ /* @__PURE__ */ e.jsx(jt, { children: "Select Activities" }),
1340
+ /* @__PURE__ */ e.jsx(ft, {}),
1341
+ /* @__PURE__ */ e.jsx(vt, { children: /* @__PURE__ */ e.jsx(
1342
+ ss,
1335
1343
  {
1336
- actions: x,
1337
- onSelected: c,
1344
+ actions: j,
1345
+ onSelected: d,
1338
1346
  disableCreate: !0,
1339
1347
  disableDelete: !0,
1340
1348
  tableProps: {
@@ -1343,12 +1351,12 @@ const Kt = ({
1343
1351
  }
1344
1352
  }
1345
1353
  ) }),
1346
- /* @__PURE__ */ e.jsx(Ct, { children: /* @__PURE__ */ e.jsx(
1347
- J,
1354
+ /* @__PURE__ */ e.jsx(yt, { children: /* @__PURE__ */ e.jsx(
1355
+ X,
1348
1356
  {
1349
1357
  colorScheme: "blue",
1350
- onClick: p.onClose,
1351
- isDisabled: d.length === 0,
1358
+ onClick: m.onClose,
1359
+ isDisabled: c.length === 0,
1352
1360
  children: "Done"
1353
1361
  }
1354
1362
  ) })
@@ -1357,14 +1365,14 @@ const Kt = ({
1357
1365
  }
1358
1366
  )
1359
1367
  ] });
1360
- }, is = Ne(
1368
+ }, os = Oe(
1361
1369
  ({
1362
1370
  name: n,
1363
1371
  onInputChange: s
1364
- }) => /* @__PURE__ */ e.jsxs(W, { mb: 4, children: [
1365
- /* @__PURE__ */ e.jsx(se, { children: "Module Name" }),
1372
+ }) => /* @__PURE__ */ e.jsxs(B, { mb: 4, children: [
1373
+ /* @__PURE__ */ e.jsx(re, { children: "Module Name" }),
1366
1374
  /* @__PURE__ */ e.jsx(
1367
- Ie,
1375
+ je,
1368
1376
  {
1369
1377
  placeholder: "i.e. ACL RTP Test Battery",
1370
1378
  value: n,
@@ -1373,51 +1381,51 @@ const Kt = ({
1373
1381
  }
1374
1382
  )
1375
1383
  ] })
1376
- ), ls = Ne(
1384
+ ), rs = Oe(
1377
1385
  ({
1378
1386
  availableCategories: n,
1379
1387
  value: s,
1380
- onChange: r
1388
+ onChange: o
1381
1389
  }) => {
1382
- const d = _(() => [
1390
+ const c = D(() => [
1383
1391
  ...n,
1384
1392
  {
1385
1393
  id: "other",
1386
1394
  name: "Other"
1387
1395
  }
1388
- ], [n]), i = _(() => d.map((l) => ({
1396
+ ], [n]), i = D(() => c.map((l) => ({
1389
1397
  value: l.id,
1390
1398
  label: l.name
1391
- })), [d]);
1392
- return /* @__PURE__ */ e.jsxs(W, { mb: 4, children: [
1393
- /* @__PURE__ */ e.jsx(se, { children: "Module Category" }),
1399
+ })), [c]);
1400
+ return /* @__PURE__ */ e.jsxs(B, { mb: 4, children: [
1401
+ /* @__PURE__ */ e.jsx(re, { children: "Module Category" }),
1394
1402
  /* @__PURE__ */ e.jsx(
1395
- ie,
1403
+ ne,
1396
1404
  {
1397
1405
  isDisabled: n.length === 0,
1398
1406
  isClearable: !0,
1399
1407
  options: i,
1400
- value: d.filter((l) => s.includes(l.id)).map((l) => ({
1408
+ value: c.filter((l) => s.includes(l.id)).map((l) => ({
1401
1409
  value: l.id,
1402
1410
  label: l.name
1403
1411
  })),
1404
- onChange: (l) => r(l ? [l.value] : []),
1412
+ onChange: (l) => o(l ? [l.value] : []),
1405
1413
  placeholder: "Select category"
1406
1414
  }
1407
1415
  )
1408
1416
  ] });
1409
1417
  }
1410
- ), as = Ne(
1418
+ ), is = Oe(
1411
1419
  ({
1412
1420
  description: n,
1413
1421
  onInputChange: s
1414
- }) => /* @__PURE__ */ e.jsxs(W, { mb: 4, children: [
1415
- /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsxs("span", { children: [
1422
+ }) => /* @__PURE__ */ e.jsxs(B, { mb: 4, children: [
1423
+ /* @__PURE__ */ e.jsx(re, { children: /* @__PURE__ */ e.jsxs("span", { children: [
1416
1424
  "Description",
1417
- /* @__PURE__ */ e.jsx(v, { fontSize: "sm", color: "gray.500", children: "Briefly describe the objective of this module. Max 40 words." })
1425
+ /* @__PURE__ */ e.jsx(b, { fontSize: "sm", color: "gray.500", children: "Briefly describe the objective of this module. Max 40 words." })
1418
1426
  ] }) }),
1419
1427
  /* @__PURE__ */ e.jsx(
1420
- Ie,
1428
+ je,
1421
1429
  {
1422
1430
  placeholder: "i.e. Assess readiness to return to play post-ACL reconstruction",
1423
1431
  value: n,
@@ -1425,129 +1433,129 @@ const Kt = ({
1425
1433
  }
1426
1434
  )
1427
1435
  ] })
1428
- ), cs = Ne(
1436
+ ), ls = Oe(
1429
1437
  ({
1430
1438
  value: n,
1431
1439
  onChange: s,
1432
- onAdjustActivities: r
1440
+ onAdjustActivities: o
1433
1441
  }) => {
1434
- const d = _(
1442
+ const c = D(
1435
1443
  () => n.map((i) => ({
1436
1444
  id: i.id,
1437
1445
  name: i.name
1438
1446
  })),
1439
1447
  [n]
1440
1448
  );
1441
- return /* @__PURE__ */ e.jsxs(W, { mb: 4, children: [
1442
- /* @__PURE__ */ e.jsxs(X, { justifyContent: "space-between", children: [
1443
- /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsxs("span", { children: [
1449
+ return /* @__PURE__ */ e.jsxs(B, { mb: 4, children: [
1450
+ /* @__PURE__ */ e.jsxs(te, { justifyContent: "space-between", children: [
1451
+ /* @__PURE__ */ e.jsx(re, { children: /* @__PURE__ */ e.jsxs("span", { children: [
1444
1452
  "Activities",
1445
- /* @__PURE__ */ e.jsx(v, { fontSize: "sm", color: "gray.500", children: "Drag and drop to reorder the activities in this module." })
1453
+ /* @__PURE__ */ e.jsx(b, { fontSize: "sm", color: "gray.500", children: "Drag and drop to reorder the activities in this module." })
1446
1454
  ] }) }),
1447
1455
  /* @__PURE__ */ e.jsx(
1448
- J,
1456
+ X,
1449
1457
  {
1450
1458
  size: "sm",
1451
1459
  variant: "solid",
1452
1460
  colorScheme: "blue",
1453
- onClick: r,
1461
+ onClick: o,
1454
1462
  children: "Add / Remove Activities"
1455
1463
  }
1456
1464
  )
1457
1465
  ] }),
1458
- d.length === 0 ? /* @__PURE__ */ e.jsx(Z, { children: /* @__PURE__ */ e.jsxs(v, { color: "gray.500", fontSize: "lg", mb: "4rem", mt: "4rem", children: [
1466
+ c.length === 0 ? /* @__PURE__ */ e.jsx(ee, { children: /* @__PURE__ */ e.jsxs(b, { color: "gray.500", fontSize: "lg", mb: "4rem", mt: "4rem", children: [
1459
1467
  "No activities selected for this module.",
1460
1468
  /* @__PURE__ */ e.jsx(
1461
- J,
1469
+ X,
1462
1470
  {
1463
1471
  ml: "0.5em",
1464
1472
  size: "sm",
1465
1473
  variant: "link",
1466
1474
  colorScheme: "blue",
1467
- onClick: r,
1475
+ onClick: o,
1468
1476
  children: "Add activities."
1469
1477
  }
1470
1478
  )
1471
1479
  ] }) }) : /* @__PURE__ */ e.jsx(
1472
- Xt,
1480
+ Yt,
1473
1481
  {
1474
- value: d,
1482
+ value: c,
1475
1483
  onChange: (i) => {
1476
- const l = i(d);
1484
+ const l = i(c);
1477
1485
  s(l.map((u) => u.id));
1478
1486
  }
1479
1487
  }
1480
1488
  )
1481
1489
  ] });
1482
1490
  }
1483
- ), ds = ({
1491
+ ), as = ({
1484
1492
  value: n,
1485
1493
  onChange: s,
1486
- forceKind: r,
1487
- disableRemove: d,
1494
+ forceKind: o,
1495
+ disableRemove: c,
1488
1496
  disableKind: i,
1489
1497
  lockRanges: l,
1490
1498
  ...u
1491
1499
  }) => {
1492
- const g = _(() => [...n].sort((p, x) => {
1493
- const A = Be.indexOf(p.plane), o = Be.indexOf(x.plane);
1494
- return A - o;
1495
- }), [n]), a = N((p) => "segment" in p.id ? lt(p.id.segment, p.plane, !0) ?? "Unknown" : at(p.id.joint, p.plane, !0) ?? "Unknown", []), M = N(
1496
- (p, x) => {
1497
- const A = g.findIndex(
1498
- (c) => c.id === x.id && c.plane === x.plane
1500
+ const x = D(() => [...n].sort((m, j) => {
1501
+ const f = $e.indexOf(m.plane), r = $e.indexOf(j.plane);
1502
+ return f - r;
1503
+ }), [n]), a = R((m) => "segment" in m.id ? ot(m.id.segment, m.plane, !0) ?? "Unknown" : rt(m.id.joint, m.plane, !0) ?? "Unknown", []), w = R(
1504
+ (m, j) => {
1505
+ const f = x.findIndex(
1506
+ (d) => d.id === j.id && d.plane === j.plane
1499
1507
  );
1500
- let o = [...g];
1501
- r && (x = { ...x, kind: r }), o[A] = x, l && (o = o.map((c) => ({
1502
- ...c,
1503
- min: x.min,
1504
- max: x.max
1505
- }))), s(o);
1508
+ let r = [...x];
1509
+ o && (j = { ...j, kind: o }), r[f] = j, l && (r = r.map((d) => ({
1510
+ ...d,
1511
+ min: j.min,
1512
+ max: j.max
1513
+ }))), s(r);
1506
1514
  },
1507
- [s, g, r, l]
1508
- ), T = N(
1509
- (p) => {
1510
- const x = g.filter(
1511
- (A) => A.id !== p.id || A.plane !== p.plane
1515
+ [s, x, o, l]
1516
+ ), I = R(
1517
+ (m) => {
1518
+ const j = x.filter(
1519
+ (f) => f.id !== m.id || f.plane !== m.plane
1512
1520
  );
1513
- s(x);
1521
+ s(j);
1514
1522
  },
1515
- [s, g]
1523
+ [s, x]
1516
1524
  );
1517
- return /* @__PURE__ */ e.jsx(Z, { alignItems: "flex-start", overflowY: "auto", ...u, children: g.map((p, x) => /* @__PURE__ */ e.jsx(
1518
- us,
1525
+ return /* @__PURE__ */ e.jsx(ee, { alignItems: "flex-start", overflowY: "auto", ...u, children: x.map((m, j) => /* @__PURE__ */ e.jsx(
1526
+ cs,
1519
1527
  {
1520
- label: a(p),
1521
- parameter: p,
1522
- onChange: (A) => M(x, A),
1523
- onRemove: d ? void 0 : () => T(p),
1524
- forceKind: r,
1528
+ label: a(m),
1529
+ parameter: m,
1530
+ onChange: (f) => w(j, f),
1531
+ onRemove: c ? void 0 : () => I(m),
1532
+ forceKind: o,
1525
1533
  disableKind: i
1526
1534
  },
1527
- `${JSON.stringify(p.id)}-${p.plane}`
1535
+ `${JSON.stringify(m.id)}-${m.plane}`
1528
1536
  )) });
1529
- }, us = ({
1537
+ }, cs = ({
1530
1538
  label: n,
1531
1539
  parameter: s,
1532
- onChange: r,
1533
- onRemove: d,
1540
+ onChange: o,
1541
+ onRemove: c,
1534
1542
  forceKind: i,
1535
1543
  disableKind: l
1536
1544
  }) => {
1537
- const u = N(
1538
- (M) => "joint" in s.id ? Bt(
1545
+ const u = R(
1546
+ (w) => "joint" in s.id ? _t(
1539
1547
  s.id.joint,
1540
1548
  s.plane,
1541
- M < 0 ? -1 : 1
1542
- ) : Qt(
1549
+ w < 0 ? -1 : 1
1550
+ ) : Gt(
1543
1551
  s.id.segment,
1544
1552
  s.plane,
1545
- M < 0 ? -1 : 1
1553
+ w < 0 ? -1 : 1
1546
1554
  ),
1547
1555
  [s]
1548
- ), { min: g, max: a } = "joint" in s.id ? qt(s.id.joint, s.plane) : { min: -180, max: 180 };
1556
+ ), { min: x, max: a } = "joint" in s.id ? Ut(s.id.joint, s.plane) : { min: -180, max: 180 };
1549
1557
  return /* @__PURE__ */ e.jsxs(
1550
- Z,
1558
+ ee,
1551
1559
  {
1552
1560
  borderRadius: "md",
1553
1561
  p: 2,
@@ -1557,9 +1565,9 @@ const Kt = ({
1557
1565
  overflow: "hidden",
1558
1566
  flexShrink: "0",
1559
1567
  children: [
1560
- /* @__PURE__ */ e.jsxs(X, { w: "100%", children: [
1568
+ /* @__PURE__ */ e.jsxs(te, { w: "100%", children: [
1561
1569
  /* @__PURE__ */ e.jsx(
1562
- v,
1570
+ b,
1563
1571
  {
1564
1572
  fontSize: "sm",
1565
1573
  flex: 1,
@@ -1568,21 +1576,21 @@ const Kt = ({
1568
1576
  children: n
1569
1577
  }
1570
1578
  ),
1571
- d && /* @__PURE__ */ e.jsx(
1572
- wt,
1579
+ c && /* @__PURE__ */ e.jsx(
1580
+ bt,
1573
1581
  {
1574
1582
  size: "xs",
1575
1583
  variant: "ghost",
1576
1584
  "aria-label": "delete",
1577
- icon: /* @__PURE__ */ e.jsx(Qe, { as: Tt }),
1578
- onClick: d
1585
+ icon: /* @__PURE__ */ e.jsx(Ue, { as: Tt }),
1586
+ onClick: c
1579
1587
  }
1580
1588
  ),
1581
1589
  !i && /* @__PURE__ */ e.jsx(
1582
- _e,
1590
+ Xt,
1583
1591
  {
1584
- selectedItem: s?.kind ?? we.Limit,
1585
- onChange: ({ value: M }) => r({ ...s, kind: M }),
1592
+ selectedItem: s?.kind ?? Ce.Limit,
1593
+ onChange: ({ value: w }) => o({ ...s, kind: w }),
1586
1594
  isDisabled: l,
1587
1595
  buttonProps: {
1588
1596
  size: "sm",
@@ -1594,461 +1602,421 @@ const Kt = ({
1594
1602
  colorScheme: "teal"
1595
1603
  },
1596
1604
  items: [
1597
- { value: we.Limit, label: "limit" },
1598
- { value: we.Target, label: "target" }
1605
+ { value: Ce.Limit, label: "limit" },
1606
+ { value: Ce.Target, label: "target" }
1599
1607
  ]
1600
1608
  }
1601
1609
  )
1602
1610
  ] }),
1603
1611
  /* @__PURE__ */ e.jsx(
1604
- Vt,
1612
+ Kt,
1605
1613
  {
1606
1614
  w: "100%",
1607
1615
  size: "xs",
1608
- min: g,
1616
+ min: x,
1609
1617
  max: a,
1610
1618
  zeroMarker: !0,
1611
1619
  value: [s.min, s.max],
1612
- onChange: (M) => r({ ...s, min: M[0], max: M[1] }),
1613
- formatValue: (M) => `${Math.abs(M)}°`,
1614
- valueLabel: (M) => u(M) ?? "",
1620
+ onChange: (w) => o({ ...s, min: w[0], max: w[1] }),
1621
+ formatValue: (w) => `${Math.abs(w)}°`,
1622
+ valueLabel: (w) => u(w) ?? "",
1615
1623
  positiveNegativeLabels: u(0) ? [u(-1) ?? "", u(1) ?? ""] : void 0
1616
1624
  }
1617
1625
  )
1618
1626
  ]
1619
1627
  }
1620
1628
  );
1621
- }, Ce = (n, s) => "segment" in n && "segment" in s && n.segment === s.segment || "joint" in n && "joint" in s && n.joint === s.joint, hs = ({
1629
+ }, be = (n, s) => "segment" in n && "segment" in s && n.segment === s.segment || "joint" in n && "joint" in s && n.joint === s.joint, ds = ({
1622
1630
  options: n,
1623
1631
  value: s,
1624
- onChange: r,
1625
- forceKind: d,
1632
+ onChange: o,
1633
+ forceKind: c,
1626
1634
  singleValue: i,
1627
1635
  singleValueSideless: l,
1628
1636
  editOnly: u,
1629
- disableKind: g,
1637
+ disableKind: x,
1630
1638
  maxParameters: a,
1631
- ...M
1639
+ ...w
1632
1640
  }) => {
1633
- const T = l ? 2 : a, p = _(
1634
- () => n.map((c) => ({
1635
- label: "segment" in c.id ? lt(c.id.segment, c.plane, !0) ?? "Unknown" : at(c.id.joint, c.plane, !0) ?? "Unknown",
1636
- value: c.id,
1637
- plane: c.plane
1641
+ const I = l ? 2 : a, m = D(
1642
+ () => n.map((d) => ({
1643
+ label: "segment" in d.id ? ot(d.id.segment, d.plane, !0) ?? "Unknown" : rt(d.id.joint, d.plane, !0) ?? "Unknown",
1644
+ value: d.id,
1645
+ plane: d.plane
1638
1646
  })),
1639
1647
  [n]
1640
- ), x = _(() => {
1648
+ ), j = D(() => {
1641
1649
  if (!l || s.length === 0)
1642
- return p;
1643
- const c = s[0];
1644
- return p.filter(
1645
- (j) => be(j.value) === be(c.id) && j.plane === c.plane
1650
+ return m;
1651
+ const d = s[0];
1652
+ return m.filter(
1653
+ (p) => ve(p.value) === ve(d.id) && p.plane === d.plane
1646
1654
  );
1647
- }, [p, s, l]), A = _(
1648
- () => p.filter(
1649
- (c) => s.some((j) => Ce(j.id, c.value) && j.plane === c.plane)
1655
+ }, [m, s, l]), f = D(
1656
+ () => m.filter(
1657
+ (d) => s.some((p) => be(p.id, d.value) && p.plane === d.plane)
1650
1658
  ),
1651
- [p, s]
1652
- ), o = N(
1653
- (c) => {
1654
- const j = c.map((m) => {
1655
- const C = s.find(
1656
- (I) => Ce(I.id, m.value) && I.plane === m.plane
1657
- ), w = n.find(
1658
- (I) => Ce(I.id, m.value) && I.plane === m.plane
1659
- ), S = l ? s.find(
1660
- (I) => be(I.id) === be(m.value) && I.plane === m.plane
1661
- ) : void 0, b = S && !C ? S.min : w && w.min ? w.min : 0, O = S && !C ? S.max : w && w.max ? w.max : 0;
1662
- return C ?? {
1663
- id: m.value,
1664
- plane: m.plane,
1665
- min: b,
1666
- max: O,
1667
- kind: d ?? we.Limit
1659
+ [m, s]
1660
+ ), r = R(
1661
+ (d) => {
1662
+ const p = d.map((g) => {
1663
+ const y = s.find(
1664
+ (E) => be(E.id, g.value) && E.plane === g.plane
1665
+ ), A = n.find(
1666
+ (E) => be(E.id, g.value) && E.plane === g.plane
1667
+ ), C = l ? s.find(
1668
+ (E) => ve(E.id) === ve(g.value) && E.plane === g.plane
1669
+ ) : void 0, T = C && !y ? C.min : A && A.min ? A.min : 0, M = C && !y ? C.max : A && A.max ? A.max : 0;
1670
+ return y ?? {
1671
+ id: g.value,
1672
+ plane: g.plane,
1673
+ min: T,
1674
+ max: M,
1675
+ kind: c ?? Ce.Limit
1668
1676
  };
1669
1677
  });
1670
- r(j);
1678
+ o(p);
1671
1679
  },
1672
- [r, s, n, d, l]
1680
+ [o, s, n, c, l]
1673
1681
  );
1674
- return V(() => {
1675
- const c = s.filter(
1676
- (j) => n.some((m) => Ce(m.id, j.id) && m.plane === j.plane)
1682
+ return se(() => {
1683
+ const d = s.filter(
1684
+ (p) => n.some((g) => be(g.id, p.id) && g.plane === p.plane)
1677
1685
  );
1678
- c.length !== s.length && r(c);
1679
- }, [n, r]), /* @__PURE__ */ e.jsxs(q, { ...M, children: [
1686
+ d.length !== s.length && o(d);
1687
+ }, [n, o]), /* @__PURE__ */ e.jsxs(J, { ...w, children: [
1680
1688
  /* @__PURE__ */ e.jsx(
1681
- ie,
1689
+ ne,
1682
1690
  {
1683
1691
  isMulti: !i,
1684
1692
  placeholder: s.length ? `${s.length} selected` : "Search...",
1685
- value: A,
1686
- isDisabled: u || A.length >= (T ?? 1 / 0),
1687
- onChange: (c) => Array.isArray(c) ? o([...c]) : o(c !== null ? [c] : []),
1688
- options: x,
1693
+ value: f,
1694
+ isDisabled: u || f.length >= (I ?? 1 / 0),
1695
+ onChange: (d) => Array.isArray(d) ? r([...d]) : r(d !== null ? [d] : []),
1696
+ options: j,
1689
1697
  controlShouldRenderValue: !1
1690
1698
  }
1691
1699
  ),
1692
1700
  /* @__PURE__ */ e.jsx(
1693
- ds,
1701
+ as,
1694
1702
  {
1695
1703
  marginTop: 2,
1696
1704
  maxH: "28rem",
1697
1705
  value: s,
1698
- onChange: r,
1699
- forceKind: d,
1700
- disableKind: g,
1706
+ onChange: o,
1707
+ forceKind: c,
1708
+ disableKind: x,
1701
1709
  lockRanges: l
1702
1710
  }
1703
1711
  )
1704
1712
  ] });
1705
- }, ct = (n) => {
1713
+ }, it = (n) => {
1706
1714
  switch (n) {
1707
- case z.Thorax:
1715
+ case P.Thorax:
1708
1716
  return "Thorax";
1709
- case z.CenterBack:
1717
+ case P.CenterBack:
1710
1718
  return "Center Back";
1711
- case z.Pelvis:
1719
+ case P.Pelvis:
1712
1720
  return "Pelvis";
1713
- case z.LeftThigh:
1721
+ case P.LeftThigh:
1714
1722
  return "Left Thigh";
1715
- case z.RightThigh:
1723
+ case P.RightThigh:
1716
1724
  return "Right Thigh";
1717
- case z.LeftShank:
1725
+ case P.LeftShank:
1718
1726
  return "Left Shank";
1719
- case z.RightShank:
1727
+ case P.RightShank:
1720
1728
  return "Right Shank";
1721
- case z.LeftFoot:
1729
+ case P.LeftFoot:
1722
1730
  return "Left Foot";
1723
- case z.RightFoot:
1731
+ case P.RightFoot:
1724
1732
  return "Right Foot";
1725
- case z.LeftUpperArm:
1733
+ case P.LeftUpperArm:
1726
1734
  return "Left Upper Arm";
1727
- case z.RightUpperArm:
1735
+ case P.RightUpperArm:
1728
1736
  return "Right Upper Arm";
1729
- case z.LeftForearm:
1737
+ case P.LeftForearm:
1730
1738
  return "Left Forearm";
1731
- case z.RightForearm:
1739
+ case P.RightForearm:
1732
1740
  return "Right Forearm";
1733
- case z.Head:
1741
+ case P.Head:
1734
1742
  return "Head";
1735
1743
  }
1736
1744
  return console.warn(`Unknown sensor location: ${n}`), "Unknown";
1737
- }, ms = 6, ps = [
1738
- z.LeftFoot,
1739
- z.LeftShank,
1740
- z.LeftThigh,
1741
- z.Pelvis,
1742
- z.RightFoot,
1743
- z.RightShank,
1744
- z.RightThigh,
1745
- z.Thorax,
1746
- z.CenterBack,
1747
- z.Head
1748
- ], gs = ps.map((n) => ({
1749
- label: ct(n),
1745
+ }, us = 6, hs = [
1746
+ P.LeftFoot,
1747
+ P.LeftShank,
1748
+ P.LeftThigh,
1749
+ P.Pelvis,
1750
+ P.RightFoot,
1751
+ P.RightShank,
1752
+ P.RightThigh,
1753
+ P.Thorax,
1754
+ P.CenterBack,
1755
+ P.Head
1756
+ ], ms = hs.map((n) => ({
1757
+ label: it(n),
1750
1758
  value: n
1751
- })), De = (n) => n.map(
1752
- (s) => s.__isNew__ ? { name: s.label } : { id: s.value, name: s.label }
1753
- ), Ls = ({
1759
+ })), Ge = (n, s) => n.map((o) => ({ label: s ? s(o) : o, value: o })), Is = ({
1754
1760
  id: n,
1755
1761
  onError: s,
1756
- onCancel: r,
1757
- onSave: d,
1762
+ onCancel: o,
1763
+ onSave: c,
1758
1764
  hideButtons: i,
1759
1765
  setButtonOnClick: l,
1760
1766
  setButtonDisabled: u,
1761
- quantumOwned: g
1767
+ quantumOwned: x
1762
1768
  }) => {
1763
- const a = It(), [{ fetching: M }, T] = te(ze), [{ fetching: p }, x] = te(Et), [{ data: A }] = oe({
1764
- query: Dt,
1769
+ const [{ fetching: a }, w] = oe(Ie), [{ fetching: I }, m] = oe(Lt), [{ data: j }] = le({
1770
+ query: Ft,
1765
1771
  variables: { id: n ?? "" },
1766
1772
  pause: !n
1767
- }), o = B(
1768
- re,
1769
- A?.getActionById
1770
- ), c = M || p, j = !!o && !!n, [m, C] = E(""), [w, S] = E(""), [b, O] = E(""), [I, D] = E(""), [P, ee] = E(
1771
- ve.Either
1772
- ), [$, k] = E(
1773
- Fe.Action
1774
- ), [H, y] = E([]), [L, K] = E([]), t = _(
1775
- () => H.map((R) => R.value),
1776
- [H]
1777
- ), h = Jt(t), [f, F] = E([]), [U, G] = E(!1), Y = m.length && P;
1778
- V(() => {
1779
- o && (C(o.name), k(o.activityKind), S(o.description || ""), ee(o.laterality), K(
1780
- o.useCases.map((R) => ({
1781
- id: R.id,
1782
- value: R.id,
1783
- label: R.name,
1784
- __isNew__: !1
1785
- }))
1786
- ), O(o.instructionsPointOfInterest || ""), D(o.instructionsMovementReport || ""), y(
1787
- o.sensorLocations.map((R) => ({
1788
- label: ct(R),
1789
- value: R
1790
- }))
1791
- ), F(Ht(o.thresholds)));
1792
- }, [o]);
1793
- const Q = N(
1794
- async (R) => (await a.query(
1795
- g ? Lt : Ft,
1796
- {
1797
- query: R,
1798
- limit: 10
1799
- }
1800
- ).then((ae) => {
1801
- const je = ae.data;
1802
- return je ? je?.quantumOwnedUseCases ? je.quantumOwnedUseCases : je.useCases : [];
1803
- }) ?? []).map((ae) => ({
1804
- label: ae.name,
1805
- value: ae.id
1806
- })),
1807
- [a, g]
1808
- ), [de, xe] = E({});
1809
- V(() => {
1810
- xe({
1811
- name: m,
1812
- laterality: P,
1813
- description: w,
1814
- instructionsPointOfInterest: b,
1815
- instructionsMovementReport: I,
1816
- sensorLocations: t,
1817
- thresholds: Ee(f),
1818
- useCases: De(L),
1819
- activityKind: $
1820
- });
1821
- }, [xe, o]);
1822
- const le = _(
1823
- () => JSON.stringify(de) !== JSON.stringify({
1824
- name: m,
1825
- laterality: P,
1826
- description: w,
1827
- instructionsPointOfInterest: b,
1828
- instructionsMovementReport: I,
1829
- sensorLocations: t,
1830
- thresholds: Ee(f),
1831
- useCases: De(L),
1832
- activityKind: $
1773
+ }), f = _(
1774
+ ae,
1775
+ j?.getActionById
1776
+ ), r = a || I, d = !!f && !!n, [p, g] = z(""), [y, A] = z(""), [C, T] = z(""), [M, E] = z(""), [O, Q] = z(), [K, Y] = z([]), [k, V] = z([]), [v, $] = z([]), q = D(
1777
+ () => k.map((N) => N.value),
1778
+ [k]
1779
+ ), t = qt(q), [{ data: h }] = le({
1780
+ query: nt
1781
+ }), S = D(() => _(
1782
+ de,
1783
+ h?.moduleCategories
1784
+ )?.map((G) => ({
1785
+ label: G.name,
1786
+ value: G.id
1787
+ })), [h?.moduleCategories]), F = D(
1788
+ () => Ge(Object.values(At), ze),
1789
+ []
1790
+ ), [L, U] = z([]), H = p.length > 0, [W, ge] = z({});
1791
+ se(() => {
1792
+ if (f) {
1793
+ const N = _(
1794
+ de,
1795
+ f.categories
1796
+ ), G = {
1797
+ name: f.name,
1798
+ activityType: f.activityType ?? void 0,
1799
+ description: f.description || "",
1800
+ cameraPlacement: f.cameraPlacement || "",
1801
+ videoLink: f.videoLink || "",
1802
+ sessionType: f.sessionType.map((Z) => ({
1803
+ label: ze(Z),
1804
+ value: Z
1805
+ })),
1806
+ categories: N?.map((Z) => Z.id) || [],
1807
+ sensorLocations: f.sensorLocations.map((Z) => ({
1808
+ label: it(Z),
1809
+ value: Z
1810
+ })),
1811
+ thresholds: Bt(f.thresholds)
1812
+ };
1813
+ g(G.name), Q(G.activityType ?? void 0), A(G.description), T(G.cameraPlacement), E(G.videoLink), Y(G.sessionType), $(N?.map((Z) => Z.id) || []), V(G.sensorLocations), U(G.thresholds), ge(G);
1814
+ }
1815
+ }, [f]);
1816
+ const ue = D(
1817
+ () => JSON.stringify(W) !== JSON.stringify({
1818
+ name: p,
1819
+ description: y,
1820
+ cameraPlacement: C,
1821
+ videoLink: M,
1822
+ activityType: O,
1823
+ sessionType: K.map((N) => N.value),
1824
+ categories: v,
1825
+ sensorLocations: q,
1826
+ thresholds: _e(L)
1833
1827
  }),
1834
1828
  [
1835
- de,
1836
- m,
1837
- P,
1838
- t,
1839
- w,
1840
- I,
1841
- b,
1842
- f,
1843
- L,
1844
- $
1829
+ W,
1830
+ p,
1831
+ q,
1832
+ y,
1833
+ C,
1834
+ M,
1835
+ O,
1836
+ K,
1837
+ v,
1838
+ L
1845
1839
  ]
1846
- ), pe = N(() => {
1847
- const R = {
1848
- name: m,
1849
- laterality: P,
1850
- description: w,
1851
- instructionsPointOfInterest: b,
1852
- instructionsMovementReport: I,
1853
- sensorLocations: t,
1854
- thresholds: Ee(f),
1855
- useCases: De(L),
1856
- activityKind: $,
1857
- quantumOwned: g
1840
+ ), xe = R(() => {
1841
+ const N = {
1842
+ name: p,
1843
+ description: y,
1844
+ cameraPlacement: C,
1845
+ videoLink: M,
1846
+ activityType: O,
1847
+ activityKind: Wt(O),
1848
+ sessionType: K.map((Z) => Z.value),
1849
+ categories: v,
1850
+ sensorLocations: q,
1851
+ thresholds: _e(L),
1852
+ // Backend requires laterality; keep existing default since UI no longer edits it
1853
+ laterality: Mt.Either,
1854
+ quantumOwned: x
1858
1855
  };
1859
- let fe;
1860
- j && n ? fe = x({
1856
+ let G;
1857
+ d && n ? G = m({
1861
1858
  id: n,
1862
- fields: R
1863
- }) : fe = T({
1864
- fields: R
1865
- }), fe.then(({ error: ae }) => {
1866
- ae ? s(ae) : d();
1859
+ fields: N
1860
+ }) : G = w({
1861
+ fields: N
1862
+ }), G.then(({ error: Z }) => {
1863
+ Z ? s(Z) : c();
1867
1864
  });
1868
1865
  }, [
1869
- g,
1870
- T,
1871
1866
  x,
1872
- n,
1867
+ w,
1873
1868
  m,
1874
- P,
1875
- t,
1869
+ n,
1870
+ p,
1871
+ q,
1872
+ y,
1873
+ C,
1874
+ M,
1875
+ O,
1876
+ K,
1877
+ v,
1876
1878
  d,
1877
- w,
1878
- I,
1879
- b,
1880
- j,
1881
- f,
1882
1879
  L,
1883
- $,
1880
+ c,
1884
1881
  s
1885
1882
  ]);
1886
- return V(() => {
1883
+ return se(() => {
1887
1884
  u && u({
1888
- cancelButton: c,
1889
- saveButton: c || !Y || !le
1885
+ cancelButton: r,
1886
+ saveButton: r || !H || !ue
1890
1887
  });
1891
- }, [c, u, Y, le]), V(() => {
1888
+ }, [r, u, H, ue]), se(() => {
1892
1889
  l && l({
1893
- cancelButton: r,
1894
- saveButton: pe
1890
+ cancelButton: o,
1891
+ saveButton: xe
1895
1892
  });
1896
- }, [l, r, pe]), /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2 gap-4 w-full", children: [
1897
- /* @__PURE__ */ e.jsxs("div", { className: "col-span-2 lg:col-span-1 flex flex-col gap-8", children: [
1898
- /* @__PURE__ */ e.jsxs(W, { children: [
1899
- /* @__PURE__ */ e.jsx(ne, { children: "Name" }),
1893
+ }, [l, o, xe]), console.log(H, ue, r, W), /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2 gap-4 w-full", children: [
1894
+ /* @__PURE__ */ e.jsxs("div", { className: "col-span-2 lg:col-span-1 flex flex-col gap-4", children: [
1895
+ /* @__PURE__ */ e.jsxs(B, { children: [
1896
+ /* @__PURE__ */ e.jsx(ie, { children: "Name" }),
1900
1897
  /* @__PURE__ */ e.jsx(
1901
- Ie,
1898
+ je,
1902
1899
  {
1903
- value: m,
1904
- onChange: (R) => C(R.target.value),
1900
+ value: p,
1901
+ onChange: (N) => g(N.target.value),
1905
1902
  type: "text",
1906
1903
  placeholder: "i.e. Lunge & Return"
1907
1904
  }
1908
1905
  )
1909
1906
  ] }),
1910
- /* @__PURE__ */ e.jsxs(X, { m: "0", p: "0", w: "100%", justifyItems: "space-between", children: [
1911
- /* @__PURE__ */ e.jsxs(W, { children: [
1912
- /* @__PURE__ */ e.jsx(ne, { children: "Activity Type" }),
1913
- /* @__PURE__ */ e.jsx(
1914
- _e,
1915
- {
1916
- selectedItem: $,
1917
- onChange: (R) => k(R.value),
1918
- buttonProps: {
1919
- size: "sm",
1920
- variant: "outline",
1921
- colorScheme: "gray"
1922
- },
1923
- selectedProps: {
1924
- variant: "solid",
1925
- colorScheme: "teal"
1926
- },
1927
- items: [
1928
- { value: Fe.Action, label: "Action" },
1929
- { value: Fe.Movement, label: "Movement" }
1930
- ]
1931
- }
1932
- )
1933
- ] }),
1934
- /* @__PURE__ */ e.jsxs(W, { children: [
1935
- /* @__PURE__ */ e.jsx(ne, { children: "Laterality" }),
1936
- /* @__PURE__ */ e.jsx(
1937
- _e,
1938
- {
1939
- selectedItem: P,
1940
- onChange: (R) => ee(R.value),
1941
- buttonProps: {
1942
- size: "sm",
1943
- variant: "outline",
1944
- colorScheme: "gray"
1945
- },
1946
- selectedProps: {
1947
- variant: "solid",
1948
- colorScheme: "teal"
1949
- },
1950
- items: [
1951
- {
1952
- value: ve.Unilateral,
1953
- label: "unilateral"
1954
- },
1955
- {
1956
- value: ve.Bilateral,
1957
- label: "bilateral"
1958
- },
1959
- {
1960
- value: ve.Either,
1961
- label: "either / or"
1962
- }
1963
- ]
1964
- }
1965
- )
1966
- ] })
1907
+ /* @__PURE__ */ e.jsxs(B, { children: [
1908
+ /* @__PURE__ */ e.jsx(ie, { children: "Activity Type" }),
1909
+ /* @__PURE__ */ e.jsx(
1910
+ ne,
1911
+ {
1912
+ isClearable: !0,
1913
+ isMulti: !1,
1914
+ value: O ? {
1915
+ label: Pe(O),
1916
+ value: O
1917
+ } : null,
1918
+ onChange: (N) => Q(N?.value),
1919
+ options: Ge(
1920
+ Object.values(Ot),
1921
+ Pe
1922
+ ),
1923
+ placeholder: "(optional) Select activity type"
1924
+ }
1925
+ )
1967
1926
  ] }),
1968
- /* @__PURE__ */ e.jsxs(W, { children: [
1969
- /* @__PURE__ */ e.jsx(ne, { children: "Use Cases" }),
1927
+ /* @__PURE__ */ e.jsxs(B, { children: [
1928
+ /* @__PURE__ */ e.jsx(ie, { children: "Camera Placement" }),
1970
1929
  /* @__PURE__ */ e.jsx(
1971
- Xe,
1930
+ Ee,
1972
1931
  {
1973
- isOpen: U,
1974
- label: "Type to search for existing use cases",
1975
- placement: "top-end",
1976
- children: /* @__PURE__ */ e.jsx(q, { children: /* @__PURE__ */ e.jsx(
1977
- At,
1978
- {
1979
- value: L,
1980
- onChange: (R) => K([...R]),
1981
- isMulti: !0,
1982
- cacheOptions: !0,
1983
- defaultOptions: !0,
1984
- onFocus: () => G(!0),
1985
- onBlur: () => G(!1),
1986
- loadOptions: Q,
1987
- placeholder: "(optional) Search for & select use cases…"
1988
- }
1989
- ) })
1932
+ value: C,
1933
+ onChange: (N) => T(N.target.value),
1934
+ rows: 2,
1935
+ placeholder: "(optional) Describe camera setup, placement, angles"
1936
+ }
1937
+ )
1938
+ ] }),
1939
+ /* @__PURE__ */ e.jsxs(B, { children: [
1940
+ /* @__PURE__ */ e.jsx(ie, { children: "Video Link" }),
1941
+ /* @__PURE__ */ e.jsx(
1942
+ je,
1943
+ {
1944
+ value: M,
1945
+ onChange: (N) => E(N.target.value),
1946
+ type: "url",
1947
+ placeholder: "(optional) https://..."
1990
1948
  }
1991
1949
  )
1992
1950
  ] }),
1993
- /* @__PURE__ */ e.jsxs(W, { children: [
1994
- /* @__PURE__ */ e.jsx(ne, { children: "Description" }),
1951
+ /* @__PURE__ */ e.jsxs(B, { children: [
1952
+ /* @__PURE__ */ e.jsx(ie, { children: "Description" }),
1995
1953
  /* @__PURE__ */ e.jsx(
1996
- Le,
1954
+ Ee,
1997
1955
  {
1998
- value: w,
1999
- onChange: (R) => S(R.target.value),
1956
+ value: y,
1957
+ onChange: (N) => A(N.target.value),
2000
1958
  rows: 2,
2001
1959
  placeholder: "(optional) Describe how to perform the test or exercise"
2002
1960
  }
2003
1961
  )
2004
1962
  ] }),
2005
- /* @__PURE__ */ e.jsxs(W, { children: [
2006
- /* @__PURE__ */ e.jsx(ne, { children: "Instructions for General Movement Report" }),
1963
+ /* @__PURE__ */ e.jsxs(B, { children: [
1964
+ /* @__PURE__ */ e.jsx(ie, { children: "Link to Category" }),
2007
1965
  /* @__PURE__ */ e.jsx(
2008
- Le,
1966
+ ne,
2009
1967
  {
2010
- value: I,
2011
- onChange: (R) => D(R.target.value),
2012
- rows: 2,
2013
- placeholder: "(optional) Describe how to setup or generate the movement report"
1968
+ isMulti: !0,
1969
+ value: S?.filter(
1970
+ (N) => v.includes(N.value)
1971
+ ),
1972
+ onChange: (N) => $(
1973
+ (N ?? []).map(
1974
+ (G) => G.value
1975
+ )
1976
+ ),
1977
+ options: S,
1978
+ placeholder: "Select one or more categories"
2014
1979
  }
2015
1980
  )
2016
1981
  ] }),
2017
- /* @__PURE__ */ e.jsxs(W, { children: [
2018
- /* @__PURE__ */ e.jsx(ne, { children: "Instructions for Point of Interest Report" }),
1982
+ /* @__PURE__ */ e.jsxs(B, { children: [
1983
+ /* @__PURE__ */ e.jsx(ie, { children: "Session Types" }),
2019
1984
  /* @__PURE__ */ e.jsx(
2020
- Le,
1985
+ ne,
2021
1986
  {
2022
- value: b,
2023
- onChange: (R) => O(R.target.value),
2024
- rows: 2,
2025
- placeholder: "(optional) Describe how to setup or generate the point of interest report"
1987
+ isMulti: !0,
1988
+ value: K,
1989
+ onChange: (N) => Y(
1990
+ N ?? []
1991
+ ),
1992
+ options: F,
1993
+ placeholder: "Select one or more session types"
2026
1994
  }
2027
1995
  )
2028
1996
  ] })
2029
1997
  ] }),
2030
- /* @__PURE__ */ e.jsxs("div", { className: "col-span-2 lg:col-span-1 flex flex-col gap-8", children: [
2031
- /* @__PURE__ */ e.jsxs(W, { children: [
2032
- /* @__PURE__ */ e.jsx(ne, { children: "Sensor Locations" }),
1998
+ /* @__PURE__ */ e.jsxs("div", { className: "col-span-2 lg:col-span-1 flex flex-col gap-4", children: [
1999
+ /* @__PURE__ */ e.jsxs(B, { children: [
2000
+ /* @__PURE__ */ e.jsx(ie, { children: "Sensor Locations" }),
2033
2001
  /* @__PURE__ */ e.jsx(
2034
- ie,
2002
+ ne,
2035
2003
  {
2036
2004
  isMulti: !0,
2037
- value: H,
2038
- onChange: (R) => y([...R]),
2039
- options: gs,
2040
- isOptionDisabled: () => H.length >= ms
2005
+ value: k,
2006
+ onChange: (N) => V([...N]),
2007
+ options: ms,
2008
+ isOptionDisabled: () => k.length >= us
2041
2009
  }
2042
2010
  )
2043
2011
  ] }),
2044
- /* @__PURE__ */ e.jsxs(W, { children: [
2045
- /* @__PURE__ */ e.jsx(ne, { children: "Default Parameters" }),
2012
+ /* @__PURE__ */ e.jsxs(B, { children: [
2013
+ /* @__PURE__ */ e.jsx(ie, { children: "Default Parameters" }),
2046
2014
  /* @__PURE__ */ e.jsx(
2047
- hs,
2015
+ ds,
2048
2016
  {
2049
- options: h,
2050
- value: f,
2051
- onChange: F
2017
+ options: t,
2018
+ value: L,
2019
+ onChange: U
2052
2020
  }
2053
2021
  )
2054
2022
  ] })
@@ -2056,16 +2024,16 @@ const Kt = ({
2056
2024
  /* @__PURE__ */ e.jsx(
2057
2025
  "div",
2058
2026
  {
2059
- className: Yt("col-span-2 flex justify-end", i && "hidden"),
2060
- children: /* @__PURE__ */ e.jsxs(me, { mt: 16, gap: 4, children: [
2061
- /* @__PURE__ */ e.jsx(J, { colorScheme: "gray", isDisabled: c, onClick: r, children: "Cancel" }),
2027
+ className: Qt("col-span-2 flex justify-end", i && "hidden"),
2028
+ children: /* @__PURE__ */ e.jsxs(pe, { mt: 16, gap: 4, children: [
2029
+ /* @__PURE__ */ e.jsx(X, { colorScheme: "gray", isDisabled: r, onClick: o, children: "Cancel" }),
2062
2030
  /* @__PURE__ */ e.jsx(
2063
- J,
2031
+ X,
2064
2032
  {
2065
2033
  colorScheme: "blue",
2066
- isDisabled: c || !Y || !le,
2067
- isLoading: c,
2068
- onClick: pe,
2034
+ isDisabled: r || !H || !ue,
2035
+ isLoading: r,
2036
+ onClick: xe,
2069
2037
  children: "Save changes"
2070
2038
  }
2071
2039
  )
@@ -2073,111 +2041,111 @@ const Kt = ({
2073
2041
  }
2074
2042
  )
2075
2043
  ] });
2076
- }, ne = ({ children: n }) => /* @__PURE__ */ e.jsx(qe, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: n }), Fs = ({
2044
+ }, ie = ({ children: n }) => /* @__PURE__ */ e.jsx(We, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: n }), Ls = ({
2077
2045
  id: n,
2078
2046
  onCancel: s,
2079
- onSave: r,
2080
- onError: d,
2047
+ onSave: o,
2048
+ onError: c,
2081
2049
  hideButtons: i,
2082
2050
  quantumOwned: l,
2083
2051
  setButtonOnClick: u,
2084
- setButtonDisabled: g
2052
+ setButtonDisabled: x
2085
2053
  }) => {
2086
- const [{ data: a }] = oe({
2087
- query: l ? kt : _t
2088
- }), [{ data: M }] = oe({
2089
- query: zt,
2054
+ const [{ data: a }] = le({
2055
+ query: l ? Rt : kt
2056
+ }), [{ data: w }] = le({
2057
+ query: Dt,
2090
2058
  variables: { id: n },
2091
2059
  pause: !n
2092
- }), [{ data: T }] = oe({
2093
- query: Pt
2094
- }), p = B(
2095
- ke,
2096
- T?.moduleCategories
2097
- ), [{ fetching: x }, A] = te(rt), [{ fetching: o }, c] = te(it), j = B(
2098
- re,
2060
+ }), [{ data: I }] = le({
2061
+ query: nt
2062
+ }), m = _(
2063
+ de,
2064
+ I?.moduleCategories
2065
+ ), [{ fetching: j }, f] = oe(tt), [{ fetching: r }, d] = oe(st), p = _(
2066
+ ae,
2099
2067
  l ? a?.quantumOwnedActions : a?.actions
2100
- ) ?? [], m = B(Se, M?.module), C = B(ot, m?.moduleActions) ?? [], [w, S] = E([
2101
- ...C.map((k) => k.actionId) ?? []
2102
- ]), [b, O] = E(m?.name ?? ""), [I, D] = E([]), [P, ee] = E(m?.description ?? "");
2103
- V(() => {
2104
- m && (S(C.map((k) => k.actionId)), O(m.name), ee(m.description ?? ""), D(
2105
- m.categories.map(
2106
- (k) => B(ke, k).id
2068
+ ) ?? [], g = _(we, w?.module), y = _(et, g?.moduleActions) ?? [], [A, C] = z([
2069
+ ...y.map((k) => k.actionId) ?? []
2070
+ ]), [T, M] = z(g?.name ?? ""), [E, O] = z([]), [Q, K] = z(g?.description ?? "");
2071
+ se(() => {
2072
+ g && (C(y.map((k) => k.actionId)), M(g.name), K(g.description ?? ""), O(
2073
+ g.categories.map(
2074
+ (k) => _(de, k).id
2107
2075
  ) ?? []
2108
2076
  ));
2109
- }, [m, C]);
2110
- const $ = N(() => {
2077
+ }, [g, y]);
2078
+ const Y = R(() => {
2111
2079
  let k;
2112
- const H = {
2113
- actions: w,
2114
- name: b,
2115
- categories: I.filter((y) => y !== "other"),
2116
- description: P,
2080
+ const V = {
2081
+ actions: A,
2082
+ name: T,
2083
+ categories: E.filter((v) => v !== "other"),
2084
+ description: Q,
2117
2085
  quantumOwned: l
2118
2086
  };
2119
- m ? k = A({
2120
- id: m.id,
2121
- input: H
2122
- }) : k = c({
2123
- input: H
2124
- }), k.then(({ error: y }) => {
2125
- y ? d(y) : r();
2087
+ g ? k = f({
2088
+ id: g.id,
2089
+ input: V
2090
+ }) : k = d({
2091
+ input: V
2092
+ }), k.then(({ error: v }) => {
2093
+ v ? c(v) : o();
2126
2094
  });
2127
2095
  }, [
2128
- c,
2096
+ d,
2097
+ f,
2129
2098
  A,
2130
- w,
2131
- b,
2132
- P,
2133
- I,
2134
- m,
2135
- r,
2136
- d
2099
+ T,
2100
+ Q,
2101
+ E,
2102
+ g,
2103
+ o,
2104
+ c
2137
2105
  ]);
2138
- return V(() => {
2139
- g && g({
2140
- cancelButton: x || o,
2141
- saveButton: x || o || !b || P.trim().split(/\s+/).filter(Boolean).length > 40
2106
+ return se(() => {
2107
+ x && x({
2108
+ cancelButton: j || r,
2109
+ saveButton: j || r || !T || Q.trim().split(/\s+/).filter(Boolean).length > 40
2142
2110
  });
2143
- }, [g, x, o, w, b, P]), V(() => {
2111
+ }, [x, j, r, A, T, Q]), se(() => {
2144
2112
  u && u({
2145
2113
  cancelButton: s,
2146
- saveButton: $
2114
+ saveButton: Y
2147
2115
  });
2148
- }, [u, s, $]), /* @__PURE__ */ e.jsxs(q, { width: "100%", children: [
2116
+ }, [u, s, Y]), /* @__PURE__ */ e.jsxs(J, { width: "100%", children: [
2149
2117
  /* @__PURE__ */ e.jsx(
2150
- rs,
2118
+ ns,
2151
2119
  {
2152
- name: b,
2153
- setName: O,
2154
- actions: j,
2155
- selectedActionIds: w,
2156
- setSelectedActionIds: S,
2157
- availableCategories: p ?? [],
2158
- selectedCategoryIds: I,
2159
- setSelectedCategoryIds: D,
2160
- description: P,
2161
- setDescription: ee
2120
+ name: T,
2121
+ setName: M,
2122
+ actions: p,
2123
+ selectedActionIds: A,
2124
+ setSelectedActionIds: C,
2125
+ availableCategories: m ?? [],
2126
+ selectedCategoryIds: E,
2127
+ setSelectedCategoryIds: O,
2128
+ description: Q,
2129
+ setDescription: K
2162
2130
  }
2163
2131
  ),
2164
- !i && /* @__PURE__ */ e.jsx(X, { justifyContent: "flex-start", children: /* @__PURE__ */ e.jsxs(me, { mt: 16, gap: 4, children: [
2132
+ !i && /* @__PURE__ */ e.jsx(te, { justifyContent: "flex-start", children: /* @__PURE__ */ e.jsxs(pe, { mt: 16, gap: 4, children: [
2165
2133
  /* @__PURE__ */ e.jsx(
2166
- J,
2134
+ X,
2167
2135
  {
2168
2136
  colorScheme: "gray",
2169
- isDisabled: x || o,
2137
+ isDisabled: j || r,
2170
2138
  onClick: s,
2171
2139
  children: "Cancel"
2172
2140
  }
2173
2141
  ),
2174
2142
  /* @__PURE__ */ e.jsx(
2175
- J,
2143
+ X,
2176
2144
  {
2177
2145
  colorScheme: "blue",
2178
- isDisabled: x || o || !b || P.trim().split(/\s+/).filter(Boolean).length > 40,
2179
- isLoading: x || o,
2180
- onClick: $,
2146
+ isDisabled: j || r || !T || Q.trim().split(/\s+/).filter(Boolean).length > 40,
2147
+ isLoading: j || r,
2148
+ onClick: Y,
2181
2149
  children: "Save"
2182
2150
  }
2183
2151
  )
@@ -2185,12 +2153,12 @@ const Kt = ({
2185
2153
  ] });
2186
2154
  };
2187
2155
  export {
2188
- os as ActivityList,
2189
- Ns as CopyActivityForm,
2190
- Rs as CopyModuleForm,
2191
- rs as ModuleForm,
2192
- ds as ParameterEditList,
2193
- hs as ParameterEditSelect,
2194
- Ls as UpsertActivityForm,
2195
- Fs as UpsertModuleForm
2156
+ ss as ActivityList,
2157
+ Os as CopyActivityForm,
2158
+ Ns as CopyModuleForm,
2159
+ ns as ModuleForm,
2160
+ as as ParameterEditList,
2161
+ ds as ParameterEditSelect,
2162
+ Is as UpsertActivityForm,
2163
+ Ls as UpsertModuleForm
2196
2164
  };