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

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