quantum-component-library 1.4.48-dev.5 → 1.4.48-dev.6

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