quantum-component-library 1.4.51-dev.2 → 1.4.51-dev.4

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,9 +1,9 @@
1
1
  import { j as e } from "./react-jsx-runtime-vendor-OVHDjVDe.js";
2
2
  import "./moment-vendor-DMLRxgRE.js";
3
- import { Flex as we, InputGroup as at, InputLeftElement as $t, Icon as bt, Input as Le, FormLabel as Xe, ButtonGroup as Me, Tooltip as tt, Button as se, Box as te, RangeSlider as Ft, RangeSliderMark as et, Text as C, RangeSliderTrack as Dt, RangeSliderFilledTrack as Pt, RangeSliderThumb as it, Select as lt, NumberInput as ct, NumberInputField as dt, HStack as re, Tag as Ne, FormControl as X, TableContainer as Gt, Table as Et, Thead as _t, Tr as ut, Th as Re, Tbody as zt, Td as _e, Image as Bt, useToast as yt, VStack as le, RadioGroup as vt, Radio as Ye, Alert as He, AlertIcon as Je, Spinner as Ct, useDisclosure as Wt, Modal as Ut, ModalOverlay as Qt, ModalContent as qt, ModalHeader as Kt, ModalCloseButton as Yt, ModalBody as Ht, ModalFooter as Jt, Badge as wt, IconButton as Xt, Tabs as Zt, TabList as Vt, Tab as mt, TabPanels as en, TabPanel as ht, Textarea as ze } from "@chakra-ui/react";
3
+ import { Flex as we, InputGroup as at, InputLeftElement as $t, Icon as bt, Input as Le, FormLabel as Xe, ButtonGroup as Me, Tooltip as tt, Button as se, Box as te, RangeSlider as Ft, RangeSliderMark as et, Text as S, RangeSliderTrack as Dt, RangeSliderFilledTrack as Pt, RangeSliderThumb as it, Select as lt, NumberInput as ct, NumberInputField as dt, HStack as re, Tag as Ne, FormControl as X, TableContainer as Gt, Table as Et, Thead as _t, Tr as ut, Th as Re, Tbody as zt, Td as _e, Image as Bt, useToast as yt, VStack as le, RadioGroup as vt, Radio as Ye, Alert as He, AlertIcon as Je, Spinner as Ct, useDisclosure as Wt, Modal as Ut, ModalOverlay as Qt, ModalContent as qt, ModalHeader as Kt, ModalCloseButton as Yt, ModalBody as Ht, ModalFooter as Jt, Badge as wt, IconButton as Xt, Tabs as Zt, TabList as Vt, Tab as mt, TabPanels as en, TabPanel as ht, Textarea as ze } from "@chakra-ui/react";
4
4
  import { useMemo as k, useState as B, useEffect as ie, useCallback as G, createContext as tn, useContext as nn, memo as Se, useRef as sn } from "react";
5
- import { getFragmentData as S } from "./generated.js";
6
- import { G as nt, M as je, a as be, b as St, c as rn, C as st, d as Lt, e as It, R as Ze, f as $e, T as Ie, A as ve, g as on, h as Mt, U as Ot, i as Qe, j as At, k as an, l as ln, m as cn, n as dn, o as un, p as mn } from "./graphql-B-0IK2pU.js";
5
+ import { getFragmentData as I } from "./generated.js";
6
+ import { G as nt, M as je, a as be, b as St, c as rn, C as st, d as Lt, e as It, R as Ze, f as $e, T as Ie, A as ve, g as on, h as Mt, U as Ot, i as Qe, j as At, k as an, l as ln, m as cn, n as dn, o as un, p as mn } from "./graphql-BOkP_KIq.js";
7
7
  import { c as qe } from "./utils-cn-CgdSr4hO.js";
8
8
  import "./lodash-vendor-B-xpwrnm.js";
9
9
  import { useClient as rt, useQuery as Ce, useMutation as fe } from "urql";
@@ -19,10 +19,10 @@ const Mn = ({
19
19
  setSearch: r,
20
20
  actions: n,
21
21
  updateUseCases: a,
22
- hideUseCaseFilter: m = !1
22
+ hideUseCaseFilter: h = !1
23
23
  }) => {
24
- const g = k(
25
- () => n?.flatMap((u) => u.useCases).filter((u, h, p) => p.findIndex((s) => s.id === u.id) === h).map((u) => ({
24
+ const x = k(
25
+ () => n?.flatMap((u) => u.useCases).filter((u, d, p) => p.findIndex((s) => s.id === u.id) === d).map((u) => ({
26
26
  label: u.name,
27
27
  value: u.id
28
28
  })) || [],
@@ -36,12 +36,12 @@ const Mn = ({
36
36
  {
37
37
  placeholder: "Search by name...",
38
38
  width: "100%",
39
- maxW: m ? void 0 : "30rem",
39
+ maxW: h ? void 0 : "30rem",
40
40
  onChange: (u) => r(u.target.value)
41
41
  }
42
42
  )
43
43
  ] }),
44
- !m && /* @__PURE__ */ e.jsx(at, { size: "md", children: /* @__PURE__ */ e.jsx(
44
+ !h && /* @__PURE__ */ e.jsx(at, { size: "md", children: /* @__PURE__ */ e.jsx(
45
45
  ue,
46
46
  {
47
47
  size: "md",
@@ -54,8 +54,8 @@ const Mn = ({
54
54
  menuPortalTarget: document.body,
55
55
  placeholder: "Filter use case",
56
56
  isMulti: !0,
57
- options: g,
58
- onChange: (u) => a(u.map((h) => h.value))
57
+ options: x,
58
+ onChange: (u) => a(u.map((d) => d.value))
59
59
  }
60
60
  ) })
61
61
  ] });
@@ -65,12 +65,12 @@ const Mn = ({
65
65
  items: r,
66
66
  onChange: n,
67
67
  selectedItem: a,
68
- isDisabled: m,
69
- selectedProps: g,
68
+ isDisabled: h,
69
+ selectedProps: x,
70
70
  buttonProps: u
71
71
  }) => {
72
- const h = (s) => s === a || s.value === a, p = (s) => h(s) ? { ...u, ...g } : u;
73
- return /* @__PURE__ */ e.jsx(Me, { isAttached: !0, isDisabled: m, children: r.map((s, i) => /* @__PURE__ */ e.jsx(
72
+ const d = (s) => s === a || s.value === a, p = (s) => d(s) ? { ...u, ...x } : u;
73
+ return /* @__PURE__ */ e.jsx(Me, { isAttached: !0, isDisabled: h, children: r.map((s, i) => /* @__PURE__ */ e.jsx(
74
74
  tt,
75
75
  {
76
76
  label: s.tooltip,
@@ -82,7 +82,7 @@ const Mn = ({
82
82
  children: /* @__PURE__ */ e.jsx(
83
83
  se,
84
84
  {
85
- onClick: () => h(s) ? null : n(s, i),
85
+ onClick: () => d(s) ? null : n(s, i),
86
86
  isDisabled: s.disabled,
87
87
  ...p(s),
88
88
  children: s.label
@@ -95,62 +95,62 @@ const Mn = ({
95
95
  isReversed: r,
96
96
  min: n,
97
97
  max: a,
98
- value: m,
99
- onChange: g,
98
+ value: h,
99
+ onChange: x,
100
100
  inputProps: u,
101
- size: h,
101
+ size: d,
102
102
  zeroMarker: p,
103
103
  formatValue: s,
104
104
  valueLabel: i,
105
- positiveNegativeLabels: x,
106
- isDisabled: M,
107
- ...w
105
+ positiveNegativeLabels: g,
106
+ isDisabled: C,
107
+ ...L
108
108
  }) => {
109
- const [I, L] = B([void 0, void 0]), y = I[0], c = I[1], d = p && n < -5 && a > 5, v = Number(m?.[0] ?? c ?? n) > 0 ? 1 : -1, j = Number(m?.[1] ?? c ?? a) < 0 ? -1 : 1, O = x?.[0] === x?.[1], $ = m?.[0], F = m?.[1];
109
+ const [M, w] = B([void 0, void 0]), y = M[0], c = M[1], m = p && n < -5 && a > 5, v = Number(h?.[0] ?? c ?? n) > 0 ? 1 : -1, j = Number(h?.[1] ?? c ?? a) < 0 ? -1 : 1, A = g?.[0] === g?.[1], $ = h?.[0], F = h?.[1];
110
110
  ie(() => {
111
- $ !== void 0 && F !== void 0 && L([$.toFixed(0), F.toFixed(0)]);
112
- }, [$, F, L]);
113
- const A = G(
111
+ $ !== void 0 && F !== void 0 && w([$.toFixed(0), F.toFixed(0)]);
112
+ }, [$, F, w]);
113
+ const O = G(
114
114
  ([T, _]) => {
115
- T < _ && L([T.toFixed(0), _.toFixed(0)]);
115
+ T < _ && w([T.toFixed(0), _.toFixed(0)]);
116
116
  },
117
- [L]
117
+ [w]
118
118
  ), N = G(
119
119
  ([T, _]) => {
120
- T < _ && g([T, _]);
120
+ T < _ && x([T, _]);
121
121
  },
122
- [g]
122
+ [x]
123
123
  ), H = G(() => {
124
- L(([T, _]) => {
124
+ w(([T, _]) => {
125
125
  const J = isNaN(Number(T)) ? n : Number(T), W = isNaN(Number(_)) ? a : Number(_), K = We(Number(J), v), l = We(Number(W), j), t = v < 0 ? Math.max(K, n) : Math.min(K, a), o = j < 0 ? Math.max(l, n) : Math.min(l, a);
126
- return t > o ? (g([o, t]), [o.toFixed(0), t.toFixed(0)]) : (g([t, o]), [t.toFixed(0), o.toFixed(0)]);
126
+ return t > o ? (x([o, t]), [o.toFixed(0), t.toFixed(0)]) : (x([t, o]), [t.toFixed(0), o.toFixed(0)]);
127
127
  });
128
- }, [g, L, v, j, n, a]), oe = G(
128
+ }, [x, w, v, j, n, a]), oe = G(
129
129
  (T) => {
130
130
  const _ = T === "" || isNaN(Number(T)) ? T : We(Number(T), v);
131
- L(([J, W]) => [_.toString(), W]);
131
+ w(([J, W]) => [_.toString(), W]);
132
132
  },
133
- [L, v]
133
+ [w, v]
134
134
  ), R = G(
135
135
  (T) => {
136
136
  const _ = T === "" || isNaN(Number(T)) ? T : We(Number(T), j);
137
- L(([J, W]) => [J, _.toString()]);
137
+ w(([J, W]) => [J, _.toString()]);
138
138
  },
139
- [L, j]
139
+ [w, j]
140
140
  ), Z = k(
141
- () => h === "xs" ? "0.75rem" : void 0,
142
- [h]
141
+ () => d === "xs" ? "0.75rem" : void 0,
142
+ [d]
143
143
  ), V = G(
144
144
  (T, _) => {
145
145
  const J = Number(_.target.value);
146
146
  if (!y || !c || ![-1, 1].includes(J))
147
147
  return;
148
148
  const W = (t) => J < 0 ? -1 * Math.abs(t) : Math.abs(t), K = T ? W(Number(y)) : Number(y), l = T ? Number(c) : W(Number(c));
149
- K > l ? g([l, K]) : g([K, l]);
149
+ K > l ? x([l, K]) : x([K, l]);
150
150
  },
151
- [y, c, g]
151
+ [y, c, x]
152
152
  );
153
- return /* @__PURE__ */ e.jsxs(we, { direction: "column", ...w, children: [
153
+ return /* @__PURE__ */ e.jsxs(we, { direction: "column", ...L, children: [
154
154
  /* @__PURE__ */ e.jsx(te, { pt: "1em", mb: "-0.5em", children: /* @__PURE__ */ e.jsxs(
155
155
  Ft,
156
156
  {
@@ -161,31 +161,31 @@ const Mn = ({
161
161
  min: n,
162
162
  minStepsBetweenThumbs: 3,
163
163
  step: 1,
164
- onChange: A,
164
+ onChange: O,
165
165
  onChangeEnd: N,
166
- isDisabled: M,
166
+ isDisabled: C,
167
167
  children: [
168
168
  /* @__PURE__ */ e.jsx(et, { value: n, top: "-1em", children: /* @__PURE__ */ e.jsx(
169
- C,
169
+ S,
170
170
  {
171
- fontSize: h ?? "sm",
171
+ fontSize: d ?? "sm",
172
172
  fontWeight: "semibold",
173
173
  whiteSpace: "nowrap",
174
174
  children: s ? s?.(n) : n
175
175
  }
176
176
  ) }),
177
177
  /* @__PURE__ */ e.jsx(et, { value: a, top: "-1em", children: /* @__PURE__ */ e.jsx(
178
- C,
178
+ S,
179
179
  {
180
- fontSize: h ?? "sm",
180
+ fontSize: d ?? "sm",
181
181
  fontWeight: "semibold",
182
182
  style: { transform: "translateX(-100%)" },
183
183
  whiteSpace: "nowrap",
184
184
  children: s ? s(a) : a
185
185
  }
186
186
  ) }),
187
- d && /* @__PURE__ */ e.jsxs(et, { value: 0, top: "-1em", pos: "relative", children: [
188
- /* @__PURE__ */ e.jsx(C, { fontSize: h, fontWeight: "semibold", children: s?.(0) ?? "0" }),
187
+ m && /* @__PURE__ */ e.jsxs(et, { value: 0, top: "-1em", pos: "relative", children: [
188
+ /* @__PURE__ */ e.jsx(S, { fontSize: d, fontWeight: "semibold", children: s?.(0) ?? "0" }),
189
189
  /* @__PURE__ */ e.jsx(
190
190
  te,
191
191
  {
@@ -211,18 +211,18 @@ const Mn = ({
211
211
  justifyContent: "space-between",
212
212
  children: [
213
213
  /* @__PURE__ */ e.jsx(
214
- C,
214
+ S,
215
215
  {
216
- fontSize: h ?? "sm",
216
+ fontSize: d ?? "sm",
217
217
  fontWeight: "semibold",
218
218
  whiteSpace: "nowrap",
219
219
  children: i(n)
220
220
  }
221
221
  ),
222
222
  /* @__PURE__ */ e.jsx(
223
- C,
223
+ S,
224
224
  {
225
- fontSize: h ?? "sm",
225
+ fontSize: d ?? "sm",
226
226
  fontWeight: "semibold",
227
227
  whiteSpace: "nowrap",
228
228
  children: i(a)
@@ -239,18 +239,18 @@ const Mn = ({
239
239
  alignItems: "center",
240
240
  gap: "0.125em",
241
241
  children: [
242
- x && /* @__PURE__ */ e.jsxs(
242
+ g && /* @__PURE__ */ e.jsxs(
243
243
  lt,
244
244
  {
245
245
  width: "auto",
246
- size: h,
246
+ size: d,
247
247
  fontWeight: "bold",
248
248
  value: v,
249
249
  onChange: (T) => V(!0, T),
250
- isDisabled: O || M,
250
+ isDisabled: A || C,
251
251
  children: [
252
- /* @__PURE__ */ e.jsx("option", { value: -1, children: x[0] }),
253
- /* @__PURE__ */ e.jsx("option", { value: 1, children: x[1] })
252
+ /* @__PURE__ */ e.jsx("option", { value: -1, children: g[0] }),
253
+ /* @__PURE__ */ e.jsx("option", { value: 1, children: g[1] })
254
254
  ]
255
255
  }
256
256
  ),
@@ -258,7 +258,7 @@ const Mn = ({
258
258
  ct,
259
259
  {
260
260
  precision: 0,
261
- size: h ?? "sm",
261
+ size: d ?? "sm",
262
262
  min: 0,
263
263
  max: v < 0 ? Math.abs(n) : F ?? a,
264
264
  value: y === "" ? "" : Math.abs(Number(y ?? n)),
@@ -267,7 +267,7 @@ const Mn = ({
267
267
  borderWidth: 1,
268
268
  borderRadius: 3,
269
269
  borderColor: "#ccc",
270
- isDisabled: M,
270
+ isDisabled: C,
271
271
  ...u,
272
272
  children: /* @__PURE__ */ e.jsx(
273
273
  dt,
@@ -282,7 +282,7 @@ const Mn = ({
282
282
  /* @__PURE__ */ e.jsx(
283
283
  ct,
284
284
  {
285
- size: h ?? "sm",
285
+ size: d ?? "sm",
286
286
  min: 0,
287
287
  max: j < 0 ? Math.abs($ ?? n) : a,
288
288
  precision: 0,
@@ -292,7 +292,7 @@ const Mn = ({
292
292
  borderWidth: 1,
293
293
  borderRadius: 3,
294
294
  borderColor: "#ccc",
295
- isDisabled: M,
295
+ isDisabled: C,
296
296
  ...u,
297
297
  children: /* @__PURE__ */ e.jsx(
298
298
  dt,
@@ -304,18 +304,18 @@ const Mn = ({
304
304
  )
305
305
  }
306
306
  ),
307
- x && /* @__PURE__ */ e.jsxs(
307
+ g && /* @__PURE__ */ e.jsxs(
308
308
  lt,
309
309
  {
310
310
  width: "auto",
311
- size: h,
311
+ size: d,
312
312
  fontWeight: "bold",
313
313
  value: j,
314
314
  onChange: (T) => V(!1, T),
315
- isDisabled: O || M,
315
+ isDisabled: A || C,
316
316
  children: [
317
- /* @__PURE__ */ e.jsx("option", { value: -1, children: x[0] }),
318
- /* @__PURE__ */ e.jsx("option", { value: 1, children: x[1] })
317
+ /* @__PURE__ */ e.jsx("option", { value: -1, children: g[0] }),
318
+ /* @__PURE__ */ e.jsx("option", { value: 1, children: g[1] })
319
319
  ]
320
320
  }
321
321
  )
@@ -323,17 +323,17 @@ const Mn = ({
323
323
  }
324
324
  )
325
325
  ] });
326
- }, kn = ({ tags: r, containerProps: n, ...a }) => /* @__PURE__ */ e.jsx(re, { ...n, children: r.map((m, g) => /* @__PURE__ */ e.jsx(Ne, { ...a, children: m }, g)) }), Tn = new pn({}), Rn = ({
326
+ }, kn = ({ tags: r, containerProps: n, ...a }) => /* @__PURE__ */ e.jsx(re, { ...n, children: r.map((h, x) => /* @__PURE__ */ e.jsx(Ne, { ...a, children: h }, x)) }), Tn = new pn({}), Rn = ({
327
327
  action: r,
328
328
  quantumIconSrc: n
329
329
  }) => {
330
- const { getLabel: a } = pe(), m = k(() => ({
330
+ const { getLabel: a } = pe(), h = k(() => ({
331
331
  actionLowerCase: a("action").toLocaleLowerCase()
332
332
  }), [a]);
333
333
  return r.quantumOwned ? /* @__PURE__ */ e.jsx(
334
334
  tt,
335
335
  {
336
- label: `This ${m.actionLowerCase} is owned by Quantum`,
336
+ label: `This ${h.actionLowerCase} is owned by Quantum`,
337
337
  "aria-label": "Quantum owned",
338
338
  children: /* @__PURE__ */ e.jsx(
339
339
  te,
@@ -349,7 +349,7 @@ const Mn = ({
349
349
  {
350
350
  src: n,
351
351
  boxSize: "1em",
352
- alt: `Quantum-owned ${m.actionLowerCase}`
352
+ alt: `Quantum-owned ${h.actionLowerCase}`
353
353
  }
354
354
  )
355
355
  }
@@ -359,46 +359,60 @@ const Mn = ({
359
359
  }, Nn = (r, n) => {
360
360
  if (!n || !n.trim().length)
361
361
  return r;
362
- const a = r.map((g) => g.name ?? "");
363
- return Tn.filter(a, n)?.map((g) => r[g]) ?? [];
362
+ const a = r.map((x) => x.name ?? "");
363
+ return Tn.filter(a, n)?.map((x) => r[x]) ?? [];
364
364
  }, $n = (r) => !r || r.length === 0 ? "None" : r.map(
365
365
  (n) => (
366
366
  // Convert camelCase to separate words (e.g., 'LeftFoot' -> 'Left Foot')
367
367
  n.replace(/([A-Z])/g, " $1").trim()
368
368
  )
369
369
  ).join(", "), Fn = (r, n) => !n || n.length == 0 ? r : r.filter(
370
- (a) => a.useCases?.some((m) => n.includes(m.id)) ?? !1
371
- ), Dn = (r, n) => !n || n.length === 0 ? r : r.filter((a) => {
372
- const m = a.metadataGroups?.flatMap((g) => {
373
- const u = S(je, g);
374
- return S(
375
- be,
376
- u.data
377
- ).map((p) => p.id);
378
- }) ?? [];
379
- return n.every(
380
- (g) => m.includes(g)
370
+ (a) => a.useCases?.some((h) => n.includes(h.id)) ?? !1
371
+ ), Dn = (r, n, a) => !n || n.length === 0 ? r : r.filter((h) => {
372
+ const x = {};
373
+ return n.forEach((u) => {
374
+ for (const [d, p] of Object.entries(a || {}))
375
+ if (p.some((s) => s.id === u)) {
376
+ x[d] || (x[d] = []), x[d].push(u);
377
+ break;
378
+ }
379
+ }), Object.entries(x).every(
380
+ ([u, d]) => {
381
+ const p = h.metadataGroups?.find((C) => I(je, C).key === u);
382
+ if (!p)
383
+ return !1;
384
+ const s = I(
385
+ je,
386
+ p
387
+ ), g = I(
388
+ be,
389
+ s.data
390
+ ).map((C) => C.id);
391
+ return d.some(
392
+ (C) => g.includes(C)
393
+ );
394
+ }
381
395
  );
382
396
  }), Pn = ({
383
397
  actions: r,
384
398
  totalActions: n,
385
399
  onCreate: a,
386
- onDelete: m,
387
- onEdit: g,
400
+ onDelete: h,
401
+ onEdit: x,
388
402
  onView: u,
389
- onSelected: h,
403
+ onSelected: d,
390
404
  onDuplicate: p,
391
405
  disableMultiSelect: s,
392
406
  disableDelete: i,
393
- disableEdit: x,
394
- disableCreate: M,
395
- hideUseCase: w = !0,
396
- showMetadataFilters: I = !0,
397
- tableProps: L,
407
+ disableEdit: g,
408
+ disableCreate: C,
409
+ hideUseCase: L = !0,
410
+ showMetadataFilters: M = !0,
411
+ tableProps: w,
398
412
  containerProps: y,
399
413
  quantumIconSrc: c = "/favicon.ico"
400
414
  }) => {
401
- const [d, v] = B(""), [j, O] = B(), [$, F] = B([]), [A, N] = B({}), { getLabel: H } = pe(), oe = rt(), R = k(() => ({
415
+ const [m, v] = B(""), [j, A] = B(), [$, F] = B([]), [O, N] = B({}), { getLabel: H } = pe(), oe = rt(), R = k(() => ({
402
416
  action: H("action"),
403
417
  actionPlural: H("action_plural"),
404
418
  actionLowerCase: H("action").toLocaleLowerCase(),
@@ -411,7 +425,7 @@ const Mn = ({
411
425
  { key: "sport", label: "Sport", multi: !0 }
412
426
  ], [R.action]);
413
427
  ie(() => {
414
- if (!I)
428
+ if (!M)
415
429
  return;
416
430
  const t = Z.map(
417
431
  (o) => oe.query(nt, { key: o.key })
@@ -420,10 +434,10 @@ const Mn = ({
420
434
  const b = {};
421
435
  o.forEach((U) => {
422
436
  if (U.error || !U.data) return;
423
- const q = S(
437
+ const q = I(
424
438
  je,
425
439
  U.data.getMetadataByKey
426
- ), E = S(
440
+ ), E = I(
427
441
  be,
428
442
  q.data
429
443
  );
@@ -434,51 +448,56 @@ const Mn = ({
434
448
  }));
435
449
  }), N(b);
436
450
  });
437
- }, [oe, Z, I]);
451
+ }, [oe, Z, M]);
438
452
  const V = k(() => {
439
453
  if (!r)
440
454
  return;
441
- const t = Nn(r, d), o = w ? t : Fn(t, j);
442
- return I ? Dn(o, $) : o;
455
+ const t = Nn(r, m), o = L ? t : Fn(t, j);
456
+ return M ? Dn(
457
+ o,
458
+ $,
459
+ O
460
+ ) : o;
443
461
  }, [
444
462
  r,
445
- d,
463
+ m,
446
464
  j,
447
- w,
448
- I,
449
- $
465
+ L,
466
+ M,
467
+ $,
468
+ O
450
469
  ]), T = G(() => {
451
- if (!m)
470
+ if (!h)
452
471
  return;
453
472
  const o = r.filter(
454
473
  (b) => b.selected && !b.quantumOwned
455
474
  ).map((b) => b.id);
456
- m(o);
457
- }, [r, m]), _ = G(() => {
475
+ h(o);
476
+ }, [r, h]), _ = G(() => {
458
477
  if (!p)
459
478
  return;
460
479
  const t = r.filter((o) => o.selected);
461
- p(t.map((o) => o.id)), h && t.forEach((o) => h(o, !1));
462
- }, [r, p, h]), J = k(() => r.some((t) => t.selected && !t.quantumOwned), [r]), W = k(() => r.some((t) => t.selected), [r]), K = k(() => r.some((t) => t.selected && t.quantumOwned), [r]), l = G(
480
+ p(t.map((o) => o.id)), d && t.forEach((o) => d(o, !1));
481
+ }, [r, p, d]), J = k(() => r.some((t) => t.selected && !t.quantumOwned), [r]), W = k(() => r.some((t) => t.selected), [r]), K = k(() => r.some((t) => t.selected && t.quantumOwned), [r]), l = G(
463
482
  (t, o) => {
464
483
  const b = Z.find((q) => q.key === t);
465
484
  if (!b) return;
466
485
  const U = b.multi ? (o ?? []).map((q) => q.id) : o ? [o.id] : [];
467
- F((q) => [...q.filter((D) => Object.values(A).flat().find((ge) => ge.id === D) && !Object.keys(A).find(
468
- (ge) => A[ge]?.some(
486
+ F((q) => [...q.filter((D) => Object.values(O).flat().find((ge) => ge.id === D) && !Object.keys(O).find(
487
+ (ge) => O[ge]?.some(
469
488
  (ye) => ye.id === D && ge === t
470
489
  )
471
490
  )), ...U]);
472
491
  },
473
- [Z, A]
492
+ [Z, O]
474
493
  );
475
494
  return /* @__PURE__ */ e.jsxs(te, { ...y, children: [
476
495
  /* @__PURE__ */ e.jsxs(we, { alignContent: "space-between", gap: 4, children: [
477
- (a || m || p) && /* @__PURE__ */ e.jsxs(Me, { mb: "1rem", gap: 4, children: [
496
+ (a || h || p) && /* @__PURE__ */ e.jsxs(Me, { mb: "1rem", gap: 4, children: [
478
497
  a && /* @__PURE__ */ e.jsxs(
479
498
  se,
480
499
  {
481
- isDisabled: !a || M,
500
+ isDisabled: !a || C,
482
501
  colorScheme: "blackAlpha",
483
502
  backgroundColor: "gray.700",
484
503
  onClick: a,
@@ -488,7 +507,7 @@ const Mn = ({
488
507
  ]
489
508
  }
490
509
  ),
491
- m && !s && /* @__PURE__ */ e.jsx(
510
+ h && !s && /* @__PURE__ */ e.jsx(
492
511
  tt,
493
512
  {
494
513
  label: K ? J ? `Quantum-owned ${R.actionPluralLowerCase} are selected and will be skipped` : `Selected ${R.actionPluralLowerCase} are quantum-owned and cannot be deleted` : void 0,
@@ -497,7 +516,7 @@ const Mn = ({
497
516
  se,
498
517
  {
499
518
  colorScheme: "gray",
500
- isDisabled: !J || !m || i,
519
+ isDisabled: !J || !h || i,
501
520
  onClick: T,
502
521
  children: "Delete Selected"
503
522
  }
@@ -519,12 +538,12 @@ const Mn = ({
519
538
  {
520
539
  setSearch: v,
521
540
  actions: r,
522
- updateUseCases: O,
523
- hideUseCaseFilter: w
541
+ updateUseCases: A,
542
+ hideUseCaseFilter: L
524
543
  }
525
544
  )
526
545
  ] }),
527
- I && A && /* @__PURE__ */ e.jsx(te, { mb: 4, children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4", children: Z.map((t) => /* @__PURE__ */ e.jsxs(X, { children: [
546
+ M && O && /* @__PURE__ */ e.jsx(te, { my: 4, children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4", children: Z.map((t) => /* @__PURE__ */ e.jsxs(X, { children: [
528
547
  /* @__PURE__ */ e.jsx(Xe, { fontSize: "sm", children: t.label }),
529
548
  /* @__PURE__ */ e.jsx(
530
549
  ue,
@@ -536,7 +555,7 @@ const Mn = ({
536
555
  })
537
556
  },
538
557
  isMulti: t.multi,
539
- value: A[t.key]?.filter(
558
+ value: O[t.key]?.filter(
540
559
  (o) => $.includes(o.id)
541
560
  ),
542
561
  onChange: (o) => {
@@ -545,13 +564,13 @@ const Mn = ({
545
564
  o
546
565
  );
547
566
  },
548
- options: A[t.key],
567
+ options: O[t.key],
549
568
  placeholder: `Select ${t.multi ? "one or more" : "one"} ${t.label.toLowerCase()}`,
550
569
  isClearable: t.multi
551
570
  }
552
571
  )
553
572
  ] }, t.key)) }) }),
554
- /* @__PURE__ */ e.jsx(Gt, { mr: "2rem", overflowX: "hidden", ...L, children: /* @__PURE__ */ e.jsxs(Et, { size: "md", variant: "simple", children: [
573
+ /* @__PURE__ */ e.jsx(Gt, { mr: "2rem", overflowX: "hidden", ...w, children: /* @__PURE__ */ e.jsxs(Et, { size: "md", variant: "simple", children: [
555
574
  /* @__PURE__ */ e.jsx(_t, { position: "sticky", top: 0, bg: "white", zIndex: 1, children: /* @__PURE__ */ e.jsxs(ut, { children: [
556
575
  /* @__PURE__ */ e.jsxs(Re, { fontWeight: "normal", children: [
557
576
  "(showing ",
@@ -563,7 +582,7 @@ const Mn = ({
563
582
  ] }),
564
583
  /* @__PURE__ */ e.jsx(Re, { children: "Name" }),
565
584
  /* @__PURE__ */ e.jsx(Re, { children: "Sensor Locations" }),
566
- !w && /* @__PURE__ */ e.jsx(Re, { children: "Use Case" }),
585
+ !L && /* @__PURE__ */ e.jsx(Re, { children: "Use Case" }),
567
586
  /* @__PURE__ */ e.jsx(Re, {})
568
587
  ] }) }),
569
588
  /* @__PURE__ */ e.jsx(zt, { children: V?.map((t) => /* @__PURE__ */ e.jsxs(
@@ -575,12 +594,12 @@ const Mn = ({
575
594
  t.selected && "bg-gray-200"
576
595
  ),
577
596
  onClick: () => {
578
- s || h?.(t, !t.selected);
597
+ s || d?.(t, !t.selected);
579
598
  },
580
599
  children: [
581
600
  /* @__PURE__ */ e.jsx(_e, { children: /* @__PURE__ */ e.jsxs(we, { children: [
582
601
  !s && /* @__PURE__ */ e.jsx(e.Fragment, { children: t.selected ? /* @__PURE__ */ e.jsx(xn, { className: "text-blue-500" }) : /* @__PURE__ */ e.jsx(fn, { className: "text-gray-400" }) }),
583
- (t.quantumOwned || !g) && u && /* @__PURE__ */ e.jsx(
602
+ (t.quantumOwned || !x) && u && /* @__PURE__ */ e.jsx(
584
603
  se,
585
604
  {
586
605
  ml: "1em",
@@ -593,16 +612,16 @@ const Mn = ({
593
612
  children: "View"
594
613
  }
595
614
  ),
596
- !t.quantumOwned && g && /* @__PURE__ */ e.jsx(
615
+ !t.quantumOwned && x && /* @__PURE__ */ e.jsx(
597
616
  se,
598
617
  {
599
- isDisabled: x,
618
+ isDisabled: g,
600
619
  ml: "1em",
601
620
  size: "sm",
602
621
  variant: "link",
603
622
  colorScheme: "blue",
604
623
  onClick: (o) => {
605
- o.stopPropagation(), g(t.id);
624
+ o.stopPropagation(), x(t.id);
606
625
  },
607
626
  children: "Edit"
608
627
  }
@@ -619,7 +638,7 @@ const Mn = ({
619
638
  t.name
620
639
  ] }) }),
621
640
  /* @__PURE__ */ e.jsx(_e, { maxW: "20rem", whiteSpace: "break-spaces", children: $n(t.sensorLocations) }),
622
- !w && /* @__PURE__ */ e.jsx(_e, { maxW: "20rem", children: /* @__PURE__ */ e.jsx(
641
+ !L && /* @__PURE__ */ e.jsx(_e, { maxW: "20rem", children: /* @__PURE__ */ e.jsx(
623
642
  kn,
624
643
  {
625
644
  containerProps: { flexWrap: "wrap" },
@@ -636,57 +655,57 @@ const Mn = ({
636
655
  onSave: r,
637
656
  onCancel: n,
638
657
  onError: a,
639
- hideButtons: m = !1,
640
- setButtonDisabled: g,
658
+ hideButtons: h = !1,
659
+ setButtonDisabled: x,
641
660
  setButtonOnClick: u,
642
- quantumOwned: h
661
+ quantumOwned: d
643
662
  }) => {
644
663
  const p = yt(), { getLabel: s } = pe(), i = k(() => ({
645
664
  singular: s("action"),
646
665
  plural: s("action_plural"),
647
666
  pluralLowerCase: s("action_plural").toLowerCase(),
648
667
  singularLowerCase: s("action").toLowerCase()
649
- }), [s]), [x, M] = B("copy"), [w, I] = B(""), [L, y] = B([]), [c, d] = B(!1), [v] = Ce({
668
+ }), [s]), [g, C] = B("copy"), [L, M] = B(""), [w, y] = B([]), [c, m] = B(!1), [v] = Ce({
650
669
  query: St
651
670
  }), [j] = Ce({
652
671
  query: rn,
653
- variables: { groupId: w },
654
- pause: !w
672
+ variables: { groupId: L },
673
+ pause: !L
655
674
  // Only run when group is selected
656
- }), [, O] = fe(st), [, $] = fe(
675
+ }), [, A] = fe(st), [, $] = fe(
657
676
  Lt
658
677
  ), F = k(() => v.data?.groups ? v.data.groups.map(
659
- (l) => S(It, l)
660
- ) : [], [v.data]), A = k(() => j.data ? j.data.actions.map((t) => {
661
- const o = S(ve, t), b = S(
678
+ (l) => I(It, l)
679
+ ) : [], [v.data]), O = k(() => j.data ? j.data.actions.map((t) => {
680
+ const o = I(ve, t), b = I(
662
681
  Ze,
663
682
  o.reports
664
- ), U = S(
683
+ ), U = I(
665
684
  $e,
666
685
  o.categories
667
- ), E = S(
686
+ ), E = I(
668
687
  je,
669
688
  o.metadataGroups
670
689
  ).map((D) => ({
671
690
  ...D,
672
- data: D.data.map((Y) => S(be, Y))
691
+ data: D.data.map((Y) => I(be, Y))
673
692
  }));
674
693
  return {
675
694
  ...o,
676
- thresholds: S(Ie, o.thresholds),
695
+ thresholds: I(Ie, o.thresholds),
677
696
  reports: b.map((D) => ({
678
697
  ...D,
679
- thresholds: S(Ie, D.thresholds)
698
+ thresholds: I(Ie, D.thresholds)
680
699
  })),
681
700
  categories: U,
682
701
  metadataGroups: E
683
702
  };
684
- }) : [], [j.data]), N = k(() => A.filter(
685
- (l) => L.includes(l.id)
686
- ), [A, L]), H = G(
703
+ }) : [], [j.data]), N = k(() => O.filter(
704
+ (l) => w.includes(l.id)
705
+ ), [O, w]), H = G(
687
706
  (l) => {
688
707
  const t = l?.value || "";
689
- I(t), y([]);
708
+ M(t), y([]);
690
709
  },
691
710
  []
692
711
  ), oe = G(
@@ -712,7 +731,7 @@ const Mn = ({
712
731
  id: void 0
713
732
  })),
714
733
  categories: l.categories.map((b) => b.id),
715
- quantumOwned: h,
734
+ quantumOwned: d,
716
735
  metadataItemIds: l.metadataGroups.flatMap((b) => b.data.map((U) => U.id)).filter((b) => b !== void 0),
717
736
  reports: l.reports.map((b) => ({
718
737
  ...b,
@@ -723,20 +742,20 @@ const Mn = ({
723
742
  }))
724
743
  })),
725
744
  id: void 0
726
- }, o = await O({ fields: t });
745
+ }, o = await A({ fields: t });
727
746
  if (o.error) throw new Error(o.error.message);
728
747
  if (o.data?.createAction)
729
- return S(ve, o.data.createAction);
748
+ return I(ve, o.data.createAction);
730
749
  throw new Error("No action data returned");
731
750
  },
732
- [O, h]
751
+ [A, d]
733
752
  ), Z = G(
734
753
  async (l) => {
735
754
  const t = await $({ id: l.id });
736
755
  if (t.error)
737
756
  throw new Error(t.error.message);
738
757
  if (t.data?.convertActionToQuantumOwned)
739
- return S(
758
+ return I(
740
759
  ve,
741
760
  t.data.convertActionToQuantumOwned
742
761
  );
@@ -744,17 +763,17 @@ const Mn = ({
744
763
  },
745
764
  [$]
746
765
  ), V = G(async () => {
747
- if (d(!0), !N.length) {
766
+ if (m(!0), !N.length) {
748
767
  const l = new Error(
749
- `No ${i.pluralLowerCase} selected for ${x === "copy" ? "copying" : "converting"}`
768
+ `No ${i.pluralLowerCase} selected for ${g === "copy" ? "copying" : "converting"}`
750
769
  );
751
- a?.(l), d(!1);
770
+ a?.(l), m(!1);
752
771
  return;
753
772
  }
754
773
  try {
755
774
  const l = [];
756
775
  let t = 0;
757
- const o = x === "copy" ? R : Z, b = x === "copy" ? "copy" : "convert";
776
+ const o = g === "copy" ? R : Z, b = g === "copy" ? "copy" : "convert";
758
777
  for (const U of N)
759
778
  try {
760
779
  const q = await o(U);
@@ -766,33 +785,33 @@ const Mn = ({
766
785
  ), t++;
767
786
  }
768
787
  if (l.length > 0) {
769
- const U = l.length, q = N.length, E = x === "copy" ? "copied" : "converted", D = x === "copy" ? "copy" : "convert";
788
+ const U = l.length, q = N.length, E = g === "copy" ? "copied" : "converted", D = g === "copy" ? "copy" : "convert";
770
789
  p({
771
790
  title: t > 0 ? `Partial ${D} completed` : `${i.plural} ${E} successfully`,
772
791
  description: t > 0 ? `${U} of ${q} ${i.pluralLowerCase} ${E} successfully` : `${U} ${U > 1 ? i.pluralLowerCase : i.singularLowerCase} ${E} successfully`,
773
792
  status: t > 0 ? "warning" : "success",
774
793
  duration: 3e3,
775
794
  isClosable: !0
776
- }), r?.(), I(""), y([]);
795
+ }), r?.(), M(""), y([]);
777
796
  } else
778
797
  throw new Error(
779
798
  `Failed to ${b} any ${i.pluralLowerCase}`
780
799
  );
781
800
  } catch (l) {
782
- const t = x === "copy" ? "copy" : "convert", o = l instanceof Error ? l.message : `Failed to ${t} ${i.pluralLowerCase}`;
801
+ const t = g === "copy" ? "copy" : "convert", o = l instanceof Error ? l.message : `Failed to ${t} ${i.pluralLowerCase}`;
783
802
  p({
784
- title: `${x === "copy" ? "Copy" : "Convert"} failed`,
803
+ title: `${g === "copy" ? "Copy" : "Convert"} failed`,
785
804
  description: o,
786
805
  status: "error",
787
806
  duration: 5e3,
788
807
  isClosable: !0
789
808
  }), a?.(l instanceof Error ? l : new Error(o));
790
809
  } finally {
791
- d(!1);
810
+ m(!1);
792
811
  }
793
812
  }, [
794
813
  N,
795
- x,
814
+ g,
796
815
  R,
797
816
  Z,
798
817
  p,
@@ -800,14 +819,14 @@ const Mn = ({
800
819
  a,
801
820
  i
802
821
  ]), T = G(() => {
803
- I(""), y([]), M("copy"), n?.();
822
+ M(""), y([]), C("copy"), n?.();
804
823
  }, [n]);
805
824
  ie(() => {
806
- g && g({
825
+ x && x({
807
826
  cancelButton: !1,
808
827
  saveButton: N.length === 0 || c
809
828
  });
810
- }, [N.length, c, g]), ie(() => {
829
+ }, [N.length, c, x]), ie(() => {
811
830
  u && u({
812
831
  cancelButton: T,
813
832
  saveButton: V
@@ -816,29 +835,29 @@ const Mn = ({
816
835
  const _ = k(() => F.map((l) => ({
817
836
  value: l.id,
818
837
  label: l.name
819
- })), [F]), J = k(() => A.filter((l) => x === "copy" ? !0 : !l.quantumOwned).map((l) => ({
838
+ })), [F]), J = k(() => O.filter((l) => g === "copy" ? !0 : !l.quantumOwned).map((l) => ({
820
839
  value: l.id,
821
840
  label: l.name,
822
841
  // Add custom data to identify quantum-owned actions for UI display
823
842
  isQuantumOwned: l.quantumOwned
824
- })), [A, x]), W = v.fetching, K = j.fetching;
843
+ })), [O, g]), W = v.fetching, K = j.fetching;
825
844
  return /* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsxs(le, { spacing: 6, align: "stretch", children: [
826
- h && /* @__PURE__ */ e.jsxs(X, { children: [
845
+ d && /* @__PURE__ */ e.jsxs(X, { children: [
827
846
  /* @__PURE__ */ e.jsx(he, { children: "Operation Mode" }),
828
847
  /* @__PURE__ */ e.jsx(
829
848
  vt,
830
849
  {
831
- value: x,
850
+ value: g,
832
851
  onChange: (l) => {
833
- M(l), y([]);
852
+ C(l), y([]);
834
853
  },
835
854
  children: /* @__PURE__ */ e.jsxs(re, { spacing: 6, children: [
836
855
  /* @__PURE__ */ e.jsx(Ye, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(le, { align: "start", spacing: 1, children: [
837
- /* @__PURE__ */ e.jsxs(C, { fontWeight: "medium", children: [
856
+ /* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", children: [
838
857
  "Copy ",
839
858
  i.plural
840
859
  ] }),
841
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.600", children: [
860
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
842
861
  "Create new ",
843
862
  i.plural.toLocaleLowerCase(),
844
863
  " ",
@@ -846,11 +865,11 @@ const Mn = ({
846
865
  ] })
847
866
  ] }) }),
848
867
  /* @__PURE__ */ e.jsx(Ye, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(le, { align: "start", spacing: 1, children: [
849
- /* @__PURE__ */ e.jsxs(C, { fontWeight: "medium", children: [
868
+ /* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", children: [
850
869
  "Convert to Quantum Owned ",
851
870
  i.singular
852
871
  ] }),
853
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.600", children: [
872
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
854
873
  "Convert existing",
855
874
  " ",
856
875
  i.plural.toLocaleLowerCase(),
@@ -868,7 +887,7 @@ const Mn = ({
868
887
  {
869
888
  placeholder: "Choose a group...",
870
889
  options: _,
871
- value: _.find((l) => l.value === w) || null,
890
+ value: _.find((l) => l.value === L) || null,
872
891
  onChange: H,
873
892
  isLoading: W,
874
893
  isDisabled: W,
@@ -877,23 +896,23 @@ const Mn = ({
877
896
  ),
878
897
  v.error && /* @__PURE__ */ e.jsxs(He, { status: "error", mt: 2, children: [
879
898
  /* @__PURE__ */ e.jsx(Je, {}),
880
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", children: [
899
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", children: [
881
900
  "Failed to load groups: ",
882
901
  v.error.message
883
902
  ] })
884
903
  ] })
885
904
  ] }),
886
- w && /* @__PURE__ */ e.jsxs(X, { children: [
905
+ L && /* @__PURE__ */ e.jsxs(X, { children: [
887
906
  /* @__PURE__ */ e.jsxs(he, { children: [
888
907
  "Select ",
889
908
  i.plural,
890
909
  " to",
891
910
  " ",
892
- x === "copy" ? "Copy" : "Convert"
911
+ g === "copy" ? "Copy" : "Convert"
893
912
  ] }),
894
913
  K ? /* @__PURE__ */ e.jsxs(re, { children: [
895
914
  /* @__PURE__ */ e.jsx(Ct, { size: "sm" }),
896
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.600", children: [
915
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
897
916
  "Loading ",
898
917
  i.pluralLowerCase,
899
918
  "..."
@@ -902,10 +921,10 @@ const Mn = ({
902
921
  /* @__PURE__ */ e.jsx(
903
922
  ue,
904
923
  {
905
- placeholder: `Choose ${i.pluralLowerCase} to ${x}...`,
924
+ placeholder: `Choose ${i.pluralLowerCase} to ${g}...`,
906
925
  options: J,
907
926
  value: J.filter(
908
- (l) => L.includes(l.value)
927
+ (l) => w.includes(l.value)
909
928
  ),
910
929
  onChange: oe,
911
930
  isDisabled: J.length === 0,
@@ -914,14 +933,14 @@ const Mn = ({
914
933
  closeMenuOnSelect: !1,
915
934
  formatOptionLabel: (l, { context: t }) => /* @__PURE__ */ e.jsxs(re, { justify: "space-between", w: "100%", children: [
916
935
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
917
- /* @__PURE__ */ e.jsx(C, { children: l.label }),
918
- t === "value" && l.isQuantumOwned && /* @__PURE__ */ e.jsx(C, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
936
+ /* @__PURE__ */ e.jsx(S, { children: l.label }),
937
+ t === "value" && l.isQuantumOwned && /* @__PURE__ */ e.jsx(S, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
919
938
  ] }),
920
939
  l.isQuantumOwned && t === "menu" && /* @__PURE__ */ e.jsx(Ne, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
921
940
  ] })
922
941
  }
923
942
  ),
924
- J.length === 0 && /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.500", mt: 2, children: [
943
+ J.length === 0 && /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.500", mt: 2, children: [
925
944
  "No ",
926
945
  i.pluralLowerCase,
927
946
  " found"
@@ -929,7 +948,7 @@ const Mn = ({
929
948
  ] }),
930
949
  j.error && /* @__PURE__ */ e.jsxs(He, { status: "error", mt: 2, children: [
931
950
  /* @__PURE__ */ e.jsx(Je, {}),
932
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", children: [
951
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", children: [
933
952
  "Failed to load ",
934
953
  i.pluralLowerCase,
935
954
  ":",
@@ -939,7 +958,7 @@ const Mn = ({
939
958
  ] })
940
959
  ] }),
941
960
  N.length > 0 && /* @__PURE__ */ e.jsxs(te, { p: 4, bg: "gray.50", borderRadius: "md", children: [
942
- /* @__PURE__ */ e.jsx(C, { fontWeight: "semibold", mb: 3, children: N.length === 1 ? `${i.singular} to ${x === "copy" ? "Copy" : "Convert"}:` : `${N.length} ${i.plural} to ${x === "copy" ? "Copy" : "Convert"}:` }),
961
+ /* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", mb: 3, children: N.length === 1 ? `${i.singular} to ${g === "copy" ? "Copy" : "Convert"}:` : `${N.length} ${i.plural} to ${g === "copy" ? "Copy" : "Convert"}:` }),
943
962
  /* @__PURE__ */ e.jsxs(le, { align: "start", spacing: 3, children: [
944
963
  N.map((l, t) => /* @__PURE__ */ e.jsxs(
945
964
  te,
@@ -952,7 +971,7 @@ const Mn = ({
952
971
  borderColor: "gray.200",
953
972
  children: [
954
973
  /* @__PURE__ */ e.jsxs(re, { justify: "space-between", align: "start", mb: 2, children: [
955
- /* @__PURE__ */ e.jsxs(C, { fontWeight: "medium", fontSize: "sm", children: [
974
+ /* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", fontSize: "sm", children: [
956
975
  t + 1,
957
976
  ". ",
958
977
  l.name
@@ -967,32 +986,32 @@ const Mn = ({
967
986
  fontSize: "sm",
968
987
  color: "gray.600",
969
988
  children: [
970
- l.description && /* @__PURE__ */ e.jsxs(C, { children: [
989
+ l.description && /* @__PURE__ */ e.jsxs(S, { children: [
971
990
  /* @__PURE__ */ e.jsx("strong", { children: "Description:" }),
972
991
  " ",
973
992
  l.description
974
993
  ] }),
975
- /* @__PURE__ */ e.jsxs(C, { children: [
994
+ /* @__PURE__ */ e.jsxs(S, { children: [
976
995
  /* @__PURE__ */ e.jsx("strong", { children: "Type:" }),
977
996
  " ",
978
997
  l.activityKind
979
998
  ] }),
980
- /* @__PURE__ */ e.jsxs(C, { children: [
999
+ /* @__PURE__ */ e.jsxs(S, { children: [
981
1000
  /* @__PURE__ */ e.jsx("strong", { children: "Laterality:" }),
982
1001
  " ",
983
1002
  l.laterality
984
1003
  ] }),
985
- /* @__PURE__ */ e.jsxs(C, { children: [
1004
+ /* @__PURE__ */ e.jsxs(S, { children: [
986
1005
  /* @__PURE__ */ e.jsx("strong", { children: "Sensor Locations:" }),
987
1006
  " ",
988
1007
  l.sensorLocations.length
989
1008
  ] }),
990
- /* @__PURE__ */ e.jsxs(C, { children: [
1009
+ /* @__PURE__ */ e.jsxs(S, { children: [
991
1010
  /* @__PURE__ */ e.jsx("strong", { children: "Thresholds:" }),
992
1011
  " ",
993
1012
  l.thresholds.length
994
1013
  ] }),
995
- /* @__PURE__ */ e.jsxs(C, { children: [
1014
+ /* @__PURE__ */ e.jsxs(S, { children: [
996
1015
  /* @__PURE__ */ e.jsx("strong", { children: "Use Cases:" }),
997
1016
  " ",
998
1017
  l.useCases.map((o) => o.name).join(", ") || "None"
@@ -1013,20 +1032,20 @@ const Mn = ({
1013
1032
  borderRadius: "md",
1014
1033
  border: "1px solid",
1015
1034
  borderColor: "blue.200",
1016
- children: /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
1035
+ children: /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
1017
1036
  "Total: ",
1018
1037
  N.length,
1019
1038
  " ",
1020
1039
  i.pluralLowerCase,
1021
1040
  " will be",
1022
1041
  " ",
1023
- x === "copy" ? "copied" : "converted"
1042
+ g === "copy" ? "copied" : "converted"
1024
1043
  ] })
1025
1044
  }
1026
1045
  )
1027
1046
  ] })
1028
1047
  ] }),
1029
- !m && /* @__PURE__ */ e.jsxs(Me, { spacing: 4, justifyContent: "flex-end", children: [
1048
+ !h && /* @__PURE__ */ e.jsxs(Me, { spacing: 4, justifyContent: "flex-end", children: [
1030
1049
  /* @__PURE__ */ e.jsx(
1031
1050
  se,
1032
1051
  {
@@ -1039,13 +1058,13 @@ const Mn = ({
1039
1058
  /* @__PURE__ */ e.jsxs(
1040
1059
  se,
1041
1060
  {
1042
- colorScheme: x === "copy" ? "blue" : "green",
1061
+ colorScheme: g === "copy" ? "blue" : "green",
1043
1062
  onClick: V,
1044
1063
  isDisabled: N.length === 0 || c,
1045
1064
  isLoading: c,
1046
- loadingText: `${x === "copy" ? "Copying" : "Converting"}...`,
1065
+ loadingText: `${g === "copy" ? "Copying" : "Converting"}...`,
1047
1066
  children: [
1048
- x === "copy" ? "Copy" : "Convert",
1067
+ g === "copy" ? "Copy" : "Convert",
1049
1068
  " ",
1050
1069
  N.length === 1 ? i.singular : `${N.length} ${i.plural}`
1051
1070
  ]
@@ -1057,74 +1076,74 @@ const Mn = ({
1057
1076
  onSave: r,
1058
1077
  onCancel: n,
1059
1078
  onError: a,
1060
- hideButtons: m = !1,
1061
- setButtonDisabled: g,
1079
+ hideButtons: h = !1,
1080
+ setButtonDisabled: x,
1062
1081
  setButtonOnClick: u,
1063
- quantumOwned: h
1082
+ quantumOwned: d
1064
1083
  }) => {
1065
1084
  const p = yt(), { getLabel: s } = pe(), i = k(() => ({
1066
1085
  singular: s("module"),
1067
1086
  plural: s("module_plural"),
1068
1087
  pluralLowerCase: s("module_plural").toLowerCase(),
1069
1088
  singularLowerCase: s("module").toLowerCase()
1070
- }), [s]), x = k(() => ({
1089
+ }), [s]), g = k(() => ({
1071
1090
  singular: s("action"),
1072
1091
  plural: s("action_plural"),
1073
1092
  pluralLowerCase: s("action_plural").toLowerCase(),
1074
1093
  singularLowerCase: s("action").toLowerCase()
1075
- }), [s]), [M, w] = B(""), [I, L] = B([]), [y, c] = B(!1), [d, v] = B("copy"), [j] = Ce({
1094
+ }), [s]), [C, L] = B(""), [M, w] = B([]), [y, c] = B(!1), [m, v] = B("copy"), [j] = Ce({
1076
1095
  query: St
1077
- }), [O] = Ce({
1096
+ }), [A] = Ce({
1078
1097
  query: on,
1079
- variables: { groupId: M },
1080
- pause: !M
1098
+ variables: { groupId: C },
1099
+ pause: !C
1081
1100
  // Only run when group is selected
1082
- }), [, $] = fe(Mt), [, F] = fe(Ot), [, A] = fe(st), [, N] = fe(
1101
+ }), [, $] = fe(Mt), [, F] = fe(Ot), [, O] = fe(st), [, N] = fe(
1083
1102
  Lt
1084
1103
  ), H = k(() => j.data?.groups ? j.data.groups.map(
1085
- (t) => S(It, t)
1086
- ) : [], [j.data]), oe = k(() => O.data?.modules ? S(
1104
+ (t) => I(It, t)
1105
+ ) : [], [j.data]), oe = k(() => A.data?.modules ? I(
1087
1106
  Qe,
1088
- O.data?.modules
1107
+ A.data?.modules
1089
1108
  ).map((o) => {
1090
- const b = S(
1109
+ const b = I(
1091
1110
  At,
1092
1111
  o.moduleActions
1093
- ), q = S(
1112
+ ), q = I(
1094
1113
  je,
1095
1114
  o.metadataGroups
1096
- ).map((E) => S(be, E.data)).flat();
1115
+ ).map((E) => I(be, E.data)).flat();
1097
1116
  return {
1098
1117
  ...o,
1099
1118
  moduleActions: b.map((E) => ({
1100
1119
  ...E,
1101
- action: S(ve, E.action)
1120
+ action: I(ve, E.action)
1102
1121
  })),
1103
- categories: S(
1122
+ categories: I(
1104
1123
  $e,
1105
1124
  o.categories
1106
1125
  ),
1107
1126
  metadataItems: q
1108
1127
  };
1109
- }) : [], [O.data]), R = k(() => oe.filter(
1110
- (t) => I.includes(t.id)
1111
- ), [oe, I]), Z = G(
1128
+ }) : [], [A.data]), R = k(() => oe.filter(
1129
+ (t) => M.includes(t.id)
1130
+ ), [oe, M]), Z = G(
1112
1131
  (t) => {
1113
1132
  const o = t?.value || "";
1114
- w(o), L([]);
1133
+ L(o), w([]);
1115
1134
  },
1116
1135
  []
1117
1136
  ), V = G(
1118
1137
  (t) => {
1119
1138
  const o = t.map((b) => b.value);
1120
- L(o);
1139
+ w(o);
1121
1140
  },
1122
1141
  []
1123
1142
  ), T = G(async () => {
1124
1143
  if (c(!0), !R.length) {
1125
1144
  c(!1);
1126
1145
  const t = new Error(
1127
- `No modules selected for ${d === "convert" ? "converting" : "copying"}`
1146
+ `No modules selected for ${m === "convert" ? "converting" : "copying"}`
1128
1147
  );
1129
1148
  a?.(t);
1130
1149
  return;
@@ -1135,33 +1154,33 @@ const Mn = ({
1135
1154
  for (const b of R)
1136
1155
  try {
1137
1156
  let U = b.moduleActions.map((q) => q.actionId);
1138
- if (h) {
1157
+ if (d) {
1139
1158
  const q = b.moduleActions.map((Y) => Y.action), E = async (Y) => {
1140
- if (d === "copy") {
1159
+ if (m === "copy") {
1141
1160
  if (Y.quantumOwned) return Y;
1142
- const ye = S(
1161
+ const ye = I(
1143
1162
  $e,
1144
1163
  Y.categories
1145
- ), Pe = S(
1164
+ ), Pe = I(
1146
1165
  je,
1147
1166
  Y.metadataGroups
1148
- ).map((xe) => S(
1167
+ ).map((xe) => I(
1149
1168
  be,
1150
1169
  xe.data
1151
- ).map((Te) => Te.id)).flat(), Oe = S(
1170
+ ).map((Te) => Te.id)).flat(), Oe = I(
1152
1171
  Ze,
1153
1172
  Y.reports
1154
1173
  ).map((xe) => ({
1155
1174
  ...xe,
1156
1175
  id: void 0,
1157
- thresholds: S(
1176
+ thresholds: I(
1158
1177
  Ie,
1159
1178
  xe.thresholds
1160
1179
  ).map((Te) => ({
1161
1180
  ...Te,
1162
1181
  id: void 0
1163
1182
  }))
1164
- })), Ae = S(
1183
+ })), Ae = I(
1165
1184
  Ie,
1166
1185
  Y.thresholds
1167
1186
  ).map((xe) => ({
@@ -1175,8 +1194,8 @@ const Mn = ({
1175
1194
  reports: Oe,
1176
1195
  metadataIds: Pe,
1177
1196
  id: void 0
1178
- }, ke = await A({ fields: Ge });
1179
- return ke.error || !ke.data?.createAction ? null : S(
1197
+ }, ke = await O({ fields: Ge });
1198
+ return ke.error || !ke.data?.createAction ? null : I(
1180
1199
  ve,
1181
1200
  ke.data.createAction
1182
1201
  );
@@ -1185,7 +1204,7 @@ const Mn = ({
1185
1204
  const ge = await N({
1186
1205
  id: Y.id
1187
1206
  });
1188
- return ge.error || !ge.data?.convertActionToQuantumOwned ? null : S(
1207
+ return ge.error || !ge.data?.convertActionToQuantumOwned ? null : I(
1189
1208
  ve,
1190
1209
  ge.data.convertActionToQuantumOwned
1191
1210
  );
@@ -1194,7 +1213,7 @@ const Mn = ({
1194
1213
  q.map(E)
1195
1214
  )).filter((Y) => !!Y).map((Y) => Y.id);
1196
1215
  }
1197
- if (d === "convert") {
1216
+ if (m === "convert") {
1198
1217
  const q = {
1199
1218
  name: b.name,
1200
1219
  description: b.description || void 0,
@@ -1207,7 +1226,7 @@ const Mn = ({
1207
1226
  });
1208
1227
  if (E.error) throw new Error(E.error.message);
1209
1228
  if (E.data?.updateModule) {
1210
- const D = S(
1229
+ const D = I(
1211
1230
  Qe,
1212
1231
  E.data.updateModule
1213
1232
  );
@@ -1219,7 +1238,7 @@ const Mn = ({
1219
1238
  description: b.description || void 0,
1220
1239
  actions: U,
1221
1240
  categories: b.categories.map((D) => D.id),
1222
- quantumOwned: h,
1241
+ quantumOwned: d,
1223
1242
  metadataItemIds: b.metadataItems.map((D) => D.id),
1224
1243
  actionReports: b.moduleActions.filter((D) => !!D.reportId).map((D) => ({
1225
1244
  actionId: D.actionId,
@@ -1228,7 +1247,7 @@ const Mn = ({
1228
1247
  }, E = await $({ input: q });
1229
1248
  if (E.error) throw new Error(E.error.message);
1230
1249
  if (E.data?.createModule) {
1231
- const D = S(
1250
+ const D = I(
1232
1251
  Qe,
1233
1252
  E.data.createModule
1234
1253
  );
@@ -1237,27 +1256,27 @@ const Mn = ({
1237
1256
  }
1238
1257
  } catch (U) {
1239
1258
  console.error(
1240
- `Failed to ${d === "convert" ? "convert" : "copy"} module "${b.name}":`,
1259
+ `Failed to ${m === "convert" ? "convert" : "copy"} module "${b.name}":`,
1241
1260
  U
1242
1261
  ), o++;
1243
1262
  }
1244
1263
  if (t.length > 0) {
1245
1264
  const b = t.length, U = R.length;
1246
1265
  p({
1247
- title: o > 0 ? `Partial ${d === "convert" ? "convert" : "copy"} completed` : `${i.plural} ${d === "convert" ? "converted" : "copied"} successfully`,
1248
- description: o > 0 ? `${b} of ${U} ${i.plural} ${d === "convert" ? "converted" : "copied"} successfully` : `${b} ${b > 1 ? i.plural : i.singular} ${d === "convert" ? "converted" : "copied"} successfully`,
1266
+ title: o > 0 ? `Partial ${m === "convert" ? "convert" : "copy"} completed` : `${i.plural} ${m === "convert" ? "converted" : "copied"} successfully`,
1267
+ description: o > 0 ? `${b} of ${U} ${i.plural} ${m === "convert" ? "converted" : "copied"} successfully` : `${b} ${b > 1 ? i.plural : i.singular} ${m === "convert" ? "converted" : "copied"} successfully`,
1249
1268
  status: o > 0 ? "warning" : "success",
1250
1269
  duration: 3e3,
1251
1270
  isClosable: !0
1252
- }), t.length > 0 && r?.(), w(""), L([]);
1271
+ }), t.length > 0 && r?.(), L(""), w([]);
1253
1272
  } else
1254
1273
  throw new Error(
1255
- `Failed to ${d === "convert" ? "convert" : "copy"} any modules`
1274
+ `Failed to ${m === "convert" ? "convert" : "copy"} any modules`
1256
1275
  );
1257
1276
  } catch (t) {
1258
- const o = t instanceof Error ? t.message : `Failed to ${d === "convert" ? "convert" : "copy"} modules`;
1277
+ const o = t instanceof Error ? t.message : `Failed to ${m === "convert" ? "convert" : "copy"} modules`;
1259
1278
  p({
1260
- title: d === "convert" ? "Convert failed" : "Copy failed",
1279
+ title: m === "convert" ? "Convert failed" : "Copy failed",
1261
1280
  description: o,
1262
1281
  status: "error",
1263
1282
  duration: 5e3,
@@ -1273,20 +1292,20 @@ const Mn = ({
1273
1292
  p,
1274
1293
  r,
1275
1294
  a,
1276
- h,
1277
- A,
1278
- N,
1279
1295
  d,
1296
+ O,
1297
+ N,
1298
+ m,
1280
1299
  i
1281
1300
  ]), _ = G(() => {
1282
- w(""), L([]), v("copy"), n?.();
1301
+ L(""), w([]), v("copy"), n?.();
1283
1302
  }, [n]);
1284
1303
  ie(() => {
1285
- g && g({
1304
+ x && x({
1286
1305
  cancelButton: !1,
1287
1306
  saveButton: R.length === 0 || y
1288
1307
  });
1289
- }, [R.length, y, g]), ie(() => {
1308
+ }, [R.length, y, x]), ie(() => {
1290
1309
  u && u({
1291
1310
  cancelButton: _,
1292
1311
  saveButton: T
@@ -1295,37 +1314,37 @@ const Mn = ({
1295
1314
  const J = k(() => H.map((t) => ({
1296
1315
  value: t.id,
1297
1316
  label: t.name
1298
- })), [H]), W = k(() => oe.filter((t) => d === "copy" ? !0 : !t.quantumOwned).map((t) => ({
1317
+ })), [H]), W = k(() => oe.filter((t) => m === "copy" ? !0 : !t.quantumOwned).map((t) => ({
1299
1318
  value: t.id,
1300
1319
  label: t.name,
1301
1320
  // Add custom data to identify quantum-owned modules
1302
1321
  isQuantumOwned: t.quantumOwned
1303
- })), [oe, d]), K = j.fetching, l = O.fetching;
1322
+ })), [oe, m]), K = j.fetching, l = A.fetching;
1304
1323
  return /* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsxs(le, { spacing: 6, align: "stretch", children: [
1305
- h && /* @__PURE__ */ e.jsxs(X, { children: [
1324
+ d && /* @__PURE__ */ e.jsxs(X, { children: [
1306
1325
  /* @__PURE__ */ e.jsx(he, { children: "Operation Mode" }),
1307
1326
  /* @__PURE__ */ e.jsx(
1308
1327
  vt,
1309
1328
  {
1310
- value: d,
1329
+ value: m,
1311
1330
  onChange: (t) => {
1312
- v(t), L([]);
1331
+ v(t), w([]);
1313
1332
  },
1314
1333
  children: /* @__PURE__ */ e.jsxs(re, { spacing: 6, children: [
1315
1334
  /* @__PURE__ */ e.jsx(Ye, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(le, { align: "start", spacing: 1, children: [
1316
- /* @__PURE__ */ e.jsxs(C, { fontWeight: "medium", children: [
1335
+ /* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", children: [
1317
1336
  "Copy ",
1318
1337
  i.plural
1319
1338
  ] }),
1320
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.600", children: [
1339
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
1321
1340
  "Create new ",
1322
1341
  i.pluralLowerCase,
1323
1342
  " based on selected ones"
1324
1343
  ] })
1325
1344
  ] }) }),
1326
1345
  /* @__PURE__ */ e.jsx(Ye, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(le, { align: "start", spacing: 1, children: [
1327
- /* @__PURE__ */ e.jsx(C, { fontWeight: "medium", children: "Convert to Quantum Owned" }),
1328
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.600", children: [
1346
+ /* @__PURE__ */ e.jsx(S, { fontWeight: "medium", children: "Convert to Quantum Owned" }),
1347
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
1329
1348
  "Convert existing ",
1330
1349
  i.pluralLowerCase,
1331
1350
  " to quantum-owned"
@@ -1342,7 +1361,7 @@ const Mn = ({
1342
1361
  {
1343
1362
  placeholder: "Choose a group...",
1344
1363
  options: J,
1345
- value: J.find((t) => t.value === M) || null,
1364
+ value: J.find((t) => t.value === C) || null,
1346
1365
  onChange: Z,
1347
1366
  isLoading: K,
1348
1367
  isDisabled: K,
@@ -1351,17 +1370,17 @@ const Mn = ({
1351
1370
  ),
1352
1371
  j.error && /* @__PURE__ */ e.jsxs(He, { status: "error", mt: 2, children: [
1353
1372
  /* @__PURE__ */ e.jsx(Je, {}),
1354
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", children: [
1373
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", children: [
1355
1374
  "Failed to load groups: ",
1356
1375
  j.error.message
1357
1376
  ] })
1358
1377
  ] })
1359
1378
  ] }),
1360
- M && /* @__PURE__ */ e.jsxs(X, { children: [
1361
- /* @__PURE__ */ e.jsx(he, { children: d === "convert" ? `Select ${i.plural} to Convert` : `Select ${i.plural} to Copy` }),
1379
+ C && /* @__PURE__ */ e.jsxs(X, { children: [
1380
+ /* @__PURE__ */ e.jsx(he, { children: m === "convert" ? `Select ${i.plural} to Convert` : `Select ${i.plural} to Copy` }),
1362
1381
  l ? /* @__PURE__ */ e.jsxs(re, { children: [
1363
1382
  /* @__PURE__ */ e.jsx(Ct, { size: "sm" }),
1364
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.600", children: [
1383
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
1365
1384
  "Loading ",
1366
1385
  i.pluralLowerCase,
1367
1386
  "..."
@@ -1370,10 +1389,10 @@ const Mn = ({
1370
1389
  /* @__PURE__ */ e.jsx(
1371
1390
  ue,
1372
1391
  {
1373
- placeholder: d === "convert" ? `Choose ${i.pluralLowerCase} to convert...` : `Choose ${i.pluralLowerCase} to copy...`,
1392
+ placeholder: m === "convert" ? `Choose ${i.pluralLowerCase} to convert...` : `Choose ${i.pluralLowerCase} to copy...`,
1374
1393
  options: W,
1375
1394
  value: W.filter(
1376
- (t) => I.includes(t.value)
1395
+ (t) => M.includes(t.value)
1377
1396
  ),
1378
1397
  onChange: V,
1379
1398
  isDisabled: W.length === 0,
@@ -1382,32 +1401,32 @@ const Mn = ({
1382
1401
  closeMenuOnSelect: !1,
1383
1402
  formatOptionLabel: (t, { context: o }) => /* @__PURE__ */ e.jsxs(re, { justify: "space-between", w: "100%", children: [
1384
1403
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
1385
- /* @__PURE__ */ e.jsx(C, { children: t.label }),
1386
- o === "value" && t.isQuantumOwned && /* @__PURE__ */ e.jsx(C, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
1404
+ /* @__PURE__ */ e.jsx(S, { children: t.label }),
1405
+ o === "value" && t.isQuantumOwned && /* @__PURE__ */ e.jsx(S, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
1387
1406
  ] }),
1388
1407
  t.isQuantumOwned && o === "menu" && /* @__PURE__ */ e.jsx(Ne, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
1389
1408
  ] })
1390
1409
  }
1391
1410
  ),
1392
- W.length === 0 && /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.500", mt: 2, children: [
1411
+ W.length === 0 && /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.500", mt: 2, children: [
1393
1412
  "No ",
1394
1413
  i.pluralLowerCase,
1395
1414
  " found in this group"
1396
1415
  ] })
1397
1416
  ] }),
1398
- O.error && /* @__PURE__ */ e.jsxs(He, { status: "error", mt: 2, children: [
1417
+ A.error && /* @__PURE__ */ e.jsxs(He, { status: "error", mt: 2, children: [
1399
1418
  /* @__PURE__ */ e.jsx(Je, {}),
1400
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", children: [
1419
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", children: [
1401
1420
  "Failed to load ",
1402
1421
  i.pluralLowerCase,
1403
1422
  ":",
1404
1423
  " ",
1405
- O.error.message
1424
+ A.error.message
1406
1425
  ] })
1407
1426
  ] })
1408
1427
  ] }),
1409
1428
  R.length > 0 && /* @__PURE__ */ e.jsxs(te, { p: 4, bg: "gray.50", borderRadius: "md", children: [
1410
- /* @__PURE__ */ e.jsx(C, { fontWeight: "semibold", mb: 3, children: R.length === 1 ? `${i.singular} to ${d === "copy" ? "Copy" : "Convert"}` : `${R.length} ${i.plural} to ${d === "copy" ? "Copy" : "Convert"}` }),
1429
+ /* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", mb: 3, children: R.length === 1 ? `${i.singular} to ${m === "copy" ? "Copy" : "Convert"}` : `${R.length} ${i.plural} to ${m === "copy" ? "Copy" : "Convert"}` }),
1411
1430
  /* @__PURE__ */ e.jsxs(le, { align: "start", spacing: 3, children: [
1412
1431
  R.map((t, o) => /* @__PURE__ */ e.jsxs(
1413
1432
  te,
@@ -1420,7 +1439,7 @@ const Mn = ({
1420
1439
  borderColor: "gray.200",
1421
1440
  children: [
1422
1441
  /* @__PURE__ */ e.jsxs(re, { justify: "space-between", align: "start", mb: 2, children: [
1423
- /* @__PURE__ */ e.jsxs(C, { fontWeight: "medium", fontSize: "sm", children: [
1442
+ /* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", fontSize: "sm", children: [
1424
1443
  o + 1,
1425
1444
  ". ",
1426
1445
  t.name
@@ -1435,17 +1454,17 @@ const Mn = ({
1435
1454
  fontSize: "sm",
1436
1455
  color: "gray.600",
1437
1456
  children: [
1438
- t.description && /* @__PURE__ */ e.jsxs(C, { children: [
1457
+ t.description && /* @__PURE__ */ e.jsxs(S, { children: [
1439
1458
  /* @__PURE__ */ e.jsx("strong", { children: "Description:" }),
1440
1459
  " ",
1441
1460
  t.description
1442
1461
  ] }),
1443
- /* @__PURE__ */ e.jsxs(C, { children: [
1462
+ /* @__PURE__ */ e.jsxs(S, { children: [
1444
1463
  /* @__PURE__ */ e.jsx("strong", { children: "Activities:" }),
1445
1464
  " ",
1446
1465
  t.moduleActions.length
1447
1466
  ] }),
1448
- /* @__PURE__ */ e.jsxs(C, { children: [
1467
+ /* @__PURE__ */ e.jsxs(S, { children: [
1449
1468
  /* @__PURE__ */ e.jsx("strong", { children: "Categories:" }),
1450
1469
  " ",
1451
1470
  t.categories.map((b) => b.name).join(", ") || "None"
@@ -1466,18 +1485,18 @@ const Mn = ({
1466
1485
  borderRadius: "md",
1467
1486
  border: "1px solid",
1468
1487
  borderColor: "blue.200",
1469
- children: /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
1488
+ children: /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
1470
1489
  "Total: ",
1471
1490
  R.length,
1472
1491
  " ",
1473
1492
  i.pluralLowerCase,
1474
1493
  " will be",
1475
1494
  " ",
1476
- d === "copy" ? "copied" : "converted"
1495
+ m === "copy" ? "copied" : "converted"
1477
1496
  ] })
1478
1497
  }
1479
1498
  ),
1480
- h && R.filter((t) => t.moduleActions.some((o) => !o.action.quantumOwned)).length > 0 && /* @__PURE__ */ e.jsx(
1499
+ d && R.filter((t) => t.moduleActions.some((o) => !o.action.quantumOwned)).length > 0 && /* @__PURE__ */ e.jsx(
1481
1500
  te,
1482
1501
  {
1483
1502
  p: 2,
@@ -1485,12 +1504,12 @@ const Mn = ({
1485
1504
  borderRadius: "md",
1486
1505
  border: "1px solid",
1487
1506
  borderColor: "yellow.200",
1488
- children: /* @__PURE__ */ e.jsx(C, { fontSize: "sm", fontWeight: "medium", color: "yellow.800", children: d === "convert" ? `Converting ${i.plural} will convert non QM-Owned ${x.plural} to QM-Owned ${x.plural}` : `Copying ${i.plural} with Non QM-Owned ${x.plural} will create corresponding QM-Owned ${x.plural}` })
1507
+ children: /* @__PURE__ */ e.jsx(S, { fontSize: "sm", fontWeight: "medium", color: "yellow.800", children: m === "convert" ? `Converting ${i.plural} will convert non QM-Owned ${g.plural} to QM-Owned ${g.plural}` : `Copying ${i.plural} with Non QM-Owned ${g.plural} will create corresponding QM-Owned ${g.plural}` })
1489
1508
  }
1490
1509
  )
1491
1510
  ] })
1492
1511
  ] }),
1493
- !m && /* @__PURE__ */ e.jsxs(Me, { spacing: 4, justifyContent: "flex-end", children: [
1512
+ !h && /* @__PURE__ */ e.jsxs(Me, { spacing: 4, justifyContent: "flex-end", children: [
1494
1513
  /* @__PURE__ */ e.jsx(
1495
1514
  se,
1496
1515
  {
@@ -1503,13 +1522,13 @@ const Mn = ({
1503
1522
  /* @__PURE__ */ e.jsxs(
1504
1523
  se,
1505
1524
  {
1506
- colorScheme: d === "copy" ? "blue" : "green",
1525
+ colorScheme: m === "copy" ? "blue" : "green",
1507
1526
  onClick: T,
1508
1527
  isDisabled: R.length === 0 || y,
1509
1528
  isLoading: y,
1510
- loadingText: `${d === "copy" ? "Copying" : "Converting"}...`,
1529
+ loadingText: `${m === "copy" ? "Copying" : "Converting"}...`,
1511
1530
  children: [
1512
- d === "copy" ? "Copy" : "Convert",
1531
+ m === "copy" ? "Copy" : "Convert",
1513
1532
  " ",
1514
1533
  R.length === 1 ? i.singular : `${R.length} ${i.plural}`
1515
1534
  ]
@@ -1528,31 +1547,31 @@ const Mn = ({
1528
1547
  name: r,
1529
1548
  setName: n,
1530
1549
  actions: a,
1531
- selectedActionIds: m,
1532
- setSelectedActionIds: g,
1550
+ selectedActionIds: h,
1551
+ setSelectedActionIds: x,
1533
1552
  availableCategories: u,
1534
- selectedCategoryIds: h,
1553
+ selectedCategoryIds: d,
1535
1554
  setSelectedCategoryIds: p,
1536
1555
  description: s,
1537
1556
  setDescription: i,
1538
- selectedMetadataIds: x,
1539
- setSelectedMetadataIds: M,
1540
- actionReportIds: w,
1541
- setActionReportIds: I,
1542
- ...L
1557
+ selectedMetadataIds: g,
1558
+ setSelectedMetadataIds: C,
1559
+ actionReportIds: L,
1560
+ setActionReportIds: M,
1561
+ ...w
1543
1562
  }) => {
1544
1563
  const y = Wt(), c = k(() => a.map((F) => ({
1545
1564
  ...F,
1546
- selected: m.includes(F.id)
1547
- })), [a, m]), d = k(() => a.reduce((F, A) => (F[A.id] = A, F), {}), [a]), v = k(
1548
- () => m.map((F) => d[F]),
1549
- [m, d]
1565
+ selected: h.includes(F.id)
1566
+ })), [a, h]), m = k(() => a.reduce((F, O) => (F[O.id] = O, F), {}), [a]), v = k(
1567
+ () => h.map((F) => m[F]),
1568
+ [h, m]
1550
1569
  ), j = G(
1551
- (F, A) => {
1552
- g(A ? [...m, F.id] : m.filter((N) => N !== F.id));
1570
+ (F, O) => {
1571
+ x(O ? [...h, F.id] : h.filter((N) => N !== F.id));
1553
1572
  },
1554
- [m, g]
1555
- ), O = G(
1573
+ [h, x]
1574
+ ), A = G(
1556
1575
  (F) => {
1557
1576
  n(F.target.value);
1558
1577
  },
@@ -1563,14 +1582,14 @@ const Mn = ({
1563
1582
  },
1564
1583
  [i]
1565
1584
  );
1566
- return /* @__PURE__ */ e.jsxs(te, { ...L, children: [
1585
+ return /* @__PURE__ */ e.jsxs(te, { ...w, children: [
1567
1586
  /* @__PURE__ */ e.jsxs(re, { gap: "2rem", children: [
1568
- /* @__PURE__ */ e.jsx(En, { name: r ?? "", onInputChange: O }),
1587
+ /* @__PURE__ */ e.jsx(En, { name: r ?? "", onInputChange: A }),
1569
1588
  /* @__PURE__ */ e.jsx(
1570
1589
  _n,
1571
1590
  {
1572
1591
  availableCategories: u,
1573
- value: h,
1592
+ value: d,
1574
1593
  onChange: p
1575
1594
  }
1576
1595
  )
@@ -1585,18 +1604,18 @@ const Mn = ({
1585
1604
  /* @__PURE__ */ e.jsx(
1586
1605
  Qn,
1587
1606
  {
1588
- selectedMetadataIds: x,
1589
- setSelectedMetadataIds: M
1607
+ selectedMetadataIds: g,
1608
+ setSelectedMetadataIds: C
1590
1609
  }
1591
1610
  ),
1592
1611
  /* @__PURE__ */ e.jsx(
1593
1612
  Bn,
1594
1613
  {
1595
1614
  value: v,
1596
- onChange: g,
1615
+ onChange: x,
1597
1616
  onAdjustActivities: () => y.onOpen(),
1598
- actionReportIds: w,
1599
- setActionReportIds: I
1617
+ actionReportIds: L,
1618
+ setActionReportIds: M
1600
1619
  }
1601
1620
  ),
1602
1621
  /* @__PURE__ */ e.jsxs(
@@ -1628,7 +1647,7 @@ const Mn = ({
1628
1647
  {
1629
1648
  colorScheme: "blue",
1630
1649
  onClick: y.onClose,
1631
- isDisabled: m.length === 0,
1650
+ isDisabled: h.length === 0,
1632
1651
  children: "Done"
1633
1652
  }
1634
1653
  ) })
@@ -1642,10 +1661,10 @@ const Mn = ({
1642
1661
  name: r,
1643
1662
  onInputChange: n
1644
1663
  }) => {
1645
- const { getLabel: a } = pe(), m = a("module"), { isView: g } = Fe();
1664
+ const { getLabel: a } = pe(), h = a("module"), { isView: x } = Fe();
1646
1665
  return /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
1647
1666
  /* @__PURE__ */ e.jsxs(he, { children: [
1648
- m,
1667
+ h,
1649
1668
  " Name"
1650
1669
  ] }),
1651
1670
  /* @__PURE__ */ e.jsx(
@@ -1655,7 +1674,7 @@ const Mn = ({
1655
1674
  value: r,
1656
1675
  onChange: n,
1657
1676
  isRequired: !0,
1658
- isDisabled: g
1677
+ isDisabled: x
1659
1678
  }
1660
1679
  )
1661
1680
  ] });
@@ -1666,19 +1685,19 @@ const Mn = ({
1666
1685
  value: n,
1667
1686
  onChange: a
1668
1687
  }) => {
1669
- const { getLabel: m } = pe(), g = m("module"), { isView: u } = Fe(), h = k(() => [
1688
+ const { getLabel: h } = pe(), x = h("module"), { isView: u } = Fe(), d = k(() => [
1670
1689
  ...r,
1671
1690
  {
1672
1691
  id: "other",
1673
1692
  name: "Other"
1674
1693
  }
1675
- ], [r]), p = k(() => h.map((s) => ({
1694
+ ], [r]), p = k(() => d.map((s) => ({
1676
1695
  value: s.id,
1677
1696
  label: s.name
1678
- })), [h]);
1697
+ })), [d]);
1679
1698
  return /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
1680
1699
  /* @__PURE__ */ e.jsxs(he, { children: [
1681
- g,
1700
+ x,
1682
1701
  " Category"
1683
1702
  ] }),
1684
1703
  /* @__PURE__ */ e.jsx(
@@ -1686,7 +1705,7 @@ const Mn = ({
1686
1705
  {
1687
1706
  isDisabled: r.length === 0 || u,
1688
1707
  options: p,
1689
- value: n.length === 0 ? { value: "other", label: "Other" } : h.filter((s) => n.includes(s.id)).map((s) => ({
1708
+ value: n.length === 0 ? { value: "other", label: "Other" } : d.filter((s) => n.includes(s.id)).map((s) => ({
1690
1709
  value: s.id,
1691
1710
  label: s.name
1692
1711
  }))[0],
@@ -1701,14 +1720,14 @@ const Mn = ({
1701
1720
  description: r,
1702
1721
  onInputChange: n
1703
1722
  }) => {
1704
- const { getLabel: a } = pe(), m = a("module"), { isView: g } = Fe();
1723
+ const { getLabel: a } = pe(), h = a("module"), { isView: x } = Fe();
1705
1724
  return /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
1706
1725
  /* @__PURE__ */ e.jsx(he, { children: /* @__PURE__ */ e.jsxs("span", { children: [
1707
1726
  "Description",
1708
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.500", children: [
1727
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.500", children: [
1709
1728
  "Briefly describe the objective of this",
1710
1729
  " ",
1711
- m.toLocaleLowerCase(),
1730
+ h.toLocaleLowerCase(),
1712
1731
  ". Max 40 words."
1713
1732
  ] })
1714
1733
  ] }) }),
@@ -1718,7 +1737,7 @@ const Mn = ({
1718
1737
  placeholder: "i.e. Assess readiness to return to play post-ACL reconstruction",
1719
1738
  value: r,
1720
1739
  onChange: n,
1721
- isDisabled: g
1740
+ isDisabled: x
1722
1741
  }
1723
1742
  )
1724
1743
  ] });
@@ -1728,10 +1747,10 @@ const Mn = ({
1728
1747
  value: r,
1729
1748
  onChange: n,
1730
1749
  onAdjustActivities: a,
1731
- actionReportIds: m,
1732
- setActionReportIds: g
1750
+ actionReportIds: h,
1751
+ setActionReportIds: x
1733
1752
  }) => {
1734
- const { getLabel: u } = pe(), { isView: h } = Fe(), p = k(() => ({
1753
+ const { getLabel: u } = pe(), { isView: d } = Fe(), p = k(() => ({
1735
1754
  module: u("module"),
1736
1755
  moduleLowerCase: u("module").toLocaleLowerCase(),
1737
1756
  action: u("action"),
@@ -1741,16 +1760,16 @@ const Mn = ({
1741
1760
  () => r.map((i) => ({
1742
1761
  id: i.id,
1743
1762
  name: i.name,
1744
- reports: S(Ze, i.reports) || [],
1745
- selectedReportId: m[i.id] || null
1763
+ reports: I(Ze, i.reports) || [],
1764
+ selectedReportId: h[i.id] || null
1746
1765
  })),
1747
- [r, m]
1766
+ [r, h]
1748
1767
  );
1749
1768
  return /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
1750
1769
  /* @__PURE__ */ e.jsxs(re, { justifyContent: "space-between", children: [
1751
1770
  /* @__PURE__ */ e.jsx(he, { children: /* @__PURE__ */ e.jsxs("span", { children: [
1752
1771
  p.actionPlural,
1753
- !h && /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.500", children: [
1772
+ !d && /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.500", children: [
1754
1773
  "Drag and drop to reorder the ",
1755
1774
  p.actionPluralLowerCase,
1756
1775
  " ",
@@ -1759,7 +1778,7 @@ const Mn = ({
1759
1778
  "."
1760
1779
  ] })
1761
1780
  ] }) }),
1762
- !h && /* @__PURE__ */ e.jsxs(
1781
+ !d && /* @__PURE__ */ e.jsxs(
1763
1782
  se,
1764
1783
  {
1765
1784
  size: "sm",
@@ -1773,14 +1792,14 @@ const Mn = ({
1773
1792
  }
1774
1793
  )
1775
1794
  ] }),
1776
- s.length === 0 ? /* @__PURE__ */ e.jsx(le, { children: /* @__PURE__ */ e.jsxs(C, { color: "gray.500", fontSize: "lg", mb: "4rem", mt: "4rem", children: [
1795
+ s.length === 0 ? /* @__PURE__ */ e.jsx(le, { children: /* @__PURE__ */ e.jsxs(S, { color: "gray.500", fontSize: "lg", mb: "4rem", mt: "4rem", children: [
1777
1796
  "No ",
1778
1797
  p.actionPluralLowerCase,
1779
1798
  " selected for this",
1780
1799
  " ",
1781
1800
  p.moduleLowerCase,
1782
1801
  ".",
1783
- !h && /* @__PURE__ */ e.jsxs(
1802
+ !d && /* @__PURE__ */ e.jsxs(
1784
1803
  se,
1785
1804
  {
1786
1805
  ml: "0.5em",
@@ -1800,12 +1819,12 @@ const Mn = ({
1800
1819
  {
1801
1820
  value: s,
1802
1821
  onChange: (i) => {
1803
- const x = i(s);
1804
- n(x.map((M) => M.id));
1822
+ const g = i(s);
1823
+ n(g.map((C) => C.id));
1805
1824
  },
1806
- disabled: h,
1807
- actionReportIds: m,
1808
- setActionReportIds: g
1825
+ disabled: d,
1826
+ actionReportIds: h,
1827
+ setActionReportIds: x
1809
1828
  }
1810
1829
  )
1811
1830
  ] });
@@ -1815,16 +1834,16 @@ const Mn = ({
1815
1834
  value: r,
1816
1835
  onChange: n,
1817
1836
  disabled: a,
1818
- actionReportIds: m,
1819
- setActionReportIds: g
1837
+ actionReportIds: h,
1838
+ setActionReportIds: x
1820
1839
  }) => {
1821
1840
  const [u] = B(
1822
1841
  () => Math.random().toString(36).substring(2, 15)
1823
- ), h = G(
1842
+ ), d = G(
1824
1843
  (p, s) => {
1825
1844
  a || n((i) => {
1826
- const x = [...i], [M] = x.splice(p, 1);
1827
- return x.splice(s, 0, M), x;
1845
+ const g = [...i], [C] = g.splice(p, 1);
1846
+ return g.splice(s, 0, C), g;
1828
1847
  });
1829
1848
  },
1830
1849
  [n, a]
@@ -1836,10 +1855,10 @@ const Mn = ({
1836
1855
  item: p,
1837
1856
  index: s,
1838
1857
  disabled: !!a,
1839
- move: h,
1858
+ move: d,
1840
1859
  onReportChange: (i) => {
1841
- g({
1842
- ...m,
1860
+ x({
1861
+ ...h,
1843
1862
  [p.id]: i
1844
1863
  });
1845
1864
  }
@@ -1852,74 +1871,74 @@ const Mn = ({
1852
1871
  listKey: r,
1853
1872
  item: n,
1854
1873
  index: a,
1855
- disabled: m,
1856
- move: g,
1874
+ disabled: h,
1875
+ move: x,
1857
1876
  onReportChange: u
1858
1877
  }) => {
1859
- const h = sn(null), { getLabel: p } = pe(), s = p("action"), [{ handlerId: i }, x] = vn({
1878
+ const d = sn(null), { getLabel: p } = pe(), s = p("action"), [{ handlerId: i }, g] = vn({
1860
1879
  accept: r,
1861
1880
  collect: (c) => ({
1862
1881
  handlerId: c.getHandlerId()?.toString() ?? ""
1863
1882
  }),
1864
- hover: (c, d) => {
1865
- if (!h.current)
1883
+ hover: (c, m) => {
1884
+ if (!d.current)
1866
1885
  return;
1867
1886
  const v = c.index, j = a;
1868
1887
  if (v === j)
1869
1888
  return;
1870
- const O = h.current?.getBoundingClientRect(), $ = (O.bottom - O.top) / 2, A = d.getClientOffset().y - O.top;
1871
- v < j && A < $ || v > j && A > $ || (g(v, j), c.index = j);
1889
+ const A = d.current?.getBoundingClientRect(), $ = (A.bottom - A.top) / 2, O = m.getClientOffset().y - A.top;
1890
+ v < j && O < $ || v > j && O > $ || (x(v, j), c.index = j);
1872
1891
  }
1873
- }), [{ isDragging: M }, w] = Cn({
1892
+ }), [{ isDragging: C }, L] = Cn({
1874
1893
  type: r,
1875
1894
  item: () => ({ id: n.id, index: a }),
1876
1895
  collect: (c) => ({
1877
1896
  isDragging: c.isDragging()
1878
1897
  }),
1879
- canDrag: !m
1880
- }), I = k(() => [
1898
+ canDrag: !h
1899
+ }), M = k(() => [
1881
1900
  { value: null, label: "No Report" },
1882
1901
  ...n.reports.map((c) => ({
1883
1902
  value: c.id,
1884
1903
  label: c.reportKind || "Report"
1885
1904
  }))
1886
- ], [n.reports]), L = M ? 0.6 : 1, y = m ? "default" : M ? "grabbing" : "grab";
1887
- return w(x(h)), /* @__PURE__ */ e.jsx(
1905
+ ], [n.reports]), w = C ? 0.6 : 1, y = h ? "default" : C ? "grabbing" : "grab";
1906
+ return L(g(d)), /* @__PURE__ */ e.jsx(
1888
1907
  te,
1889
1908
  {
1890
- ref: h,
1909
+ ref: d,
1891
1910
  p: 3,
1892
1911
  border: "1px solid",
1893
1912
  borderColor: "gray.200",
1894
1913
  borderRadius: "md",
1895
1914
  bg: "gray.50",
1896
- style: { opacity: L, cursor: y },
1915
+ style: { opacity: w, cursor: y },
1897
1916
  "data-handler-id": i,
1898
1917
  children: /* @__PURE__ */ e.jsxs(re, { justify: "space-between", align: "center", children: [
1899
1918
  /* @__PURE__ */ e.jsxs(re, { spacing: 3, children: [
1900
- /* @__PURE__ */ e.jsxs(C, { fontWeight: "semibold", minW: "2rem", children: [
1919
+ /* @__PURE__ */ e.jsxs(S, { fontWeight: "semibold", minW: "2rem", children: [
1901
1920
  a + 1,
1902
1921
  "."
1903
1922
  ] }),
1904
- /* @__PURE__ */ e.jsx(C, { fontWeight: "medium", children: n.name })
1923
+ /* @__PURE__ */ e.jsx(S, { fontWeight: "medium", children: n.name })
1905
1924
  ] }),
1906
1925
  /* @__PURE__ */ e.jsxs(re, { spacing: 3, align: "center", children: [
1907
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.600", children: [
1926
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
1908
1927
  s,
1909
1928
  " Report:"
1910
1929
  ] }),
1911
1930
  /* @__PURE__ */ e.jsx(te, { width: "300px", children: /* @__PURE__ */ e.jsx(
1912
1931
  ue,
1913
1932
  {
1914
- value: I.find(
1933
+ value: M.find(
1915
1934
  (c) => c.value === n.selectedReportId
1916
1935
  ),
1917
1936
  onChange: (c) => {
1918
1937
  u(c?.value || null);
1919
1938
  },
1920
- options: I,
1939
+ options: M,
1921
1940
  placeholder: "Select report...",
1922
- isDisabled: m
1941
+ isDisabled: h
1923
1942
  }
1924
1943
  ) })
1925
1944
  ] })
@@ -1932,7 +1951,7 @@ const Mn = ({
1932
1951
  selectedMetadataIds: r,
1933
1952
  setSelectedMetadataIds: n
1934
1953
  }) => {
1935
- const { getLabel: a } = pe(), { isView: m, metadataOptions: g } = Fe(), u = k(() => [
1954
+ const { getLabel: a } = pe(), { isView: h, metadataOptions: x } = Fe(), u = k(() => [
1936
1955
  {
1937
1956
  key: "activity_type",
1938
1957
  label: `${a("action")} Type`,
@@ -1941,20 +1960,20 @@ const Mn = ({
1941
1960
  { key: "session_type", label: "Session Type", multi: !0 },
1942
1961
  { key: "body_region", label: "Body Region", multi: !0 },
1943
1962
  { key: "sport", label: "Sport", multi: !0 }
1944
- ], [a]), h = G(
1963
+ ], [a]), d = G(
1945
1964
  (p, s) => {
1946
- const i = u.find((M) => M.key === p);
1965
+ const i = u.find((C) => C.key === p);
1947
1966
  if (!i) return;
1948
- const x = i.multi ? (s ?? []).map((M) => M.id) : s ? [s.id] : [];
1949
- n((M) => [...M.filter((I) => Object.values(g || {}).flat().find((y) => y.id === I) && !Object.keys(g || {}).find(
1950
- (y) => g?.[y]?.some(
1951
- (c) => c.id === I && y === p
1967
+ const g = i.multi ? (s ?? []).map((C) => C.id) : s ? [s.id] : [];
1968
+ n((C) => [...C.filter((M) => Object.values(x || {}).flat().find((y) => y.id === M) && !Object.keys(x || {}).find(
1969
+ (y) => x?.[y]?.some(
1970
+ (c) => c.id === M && y === p
1952
1971
  )
1953
- )), ...x]);
1972
+ )), ...g]);
1954
1973
  },
1955
- [u, g, n]
1974
+ [u, x, n]
1956
1975
  );
1957
- return g ? /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
1976
+ return x ? /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
1958
1977
  /* @__PURE__ */ e.jsx(he, { children: "Metadata Tags" }),
1959
1978
  /* @__PURE__ */ e.jsx(re, { gap: "1rem", align: "start", children: u.map((p) => /* @__PURE__ */ e.jsxs(X, { flex: "1", children: [
1960
1979
  /* @__PURE__ */ e.jsx(Xe, { fontSize: "sm", children: p.label }),
@@ -1962,18 +1981,18 @@ const Mn = ({
1962
1981
  ue,
1963
1982
  {
1964
1983
  isMulti: p.multi,
1965
- value: g[p.key]?.filter(
1984
+ value: x[p.key]?.filter(
1966
1985
  (s) => r.includes(s.id)
1967
1986
  ),
1968
1987
  onChange: (s) => {
1969
- h(
1988
+ d(
1970
1989
  p.key,
1971
1990
  s
1972
1991
  );
1973
1992
  },
1974
- options: g[p.key],
1993
+ options: x[p.key],
1975
1994
  placeholder: `Select ${p.multi ? "one or more" : "one"} ${p.label.toLowerCase()}`,
1976
- isDisabled: m,
1995
+ isDisabled: h,
1977
1996
  isClearable: p.multi
1978
1997
  }
1979
1998
  )
@@ -1984,68 +2003,68 @@ const Mn = ({
1984
2003
  value: r,
1985
2004
  onChange: n,
1986
2005
  forceKind: a,
1987
- disableRemove: m,
1988
- disableKind: g,
2006
+ disableRemove: h,
2007
+ disableKind: x,
1989
2008
  isDisabled: u,
1990
- lockRanges: h,
2009
+ lockRanges: d,
1991
2010
  ...p
1992
2011
  }) => {
1993
- const s = k(() => [...r].sort((w, I) => {
1994
- const L = xt.indexOf(w.plane), y = xt.indexOf(I.plane);
1995
- return L - y;
1996
- }), [r]), i = G((w) => "segment" in w.id ? kt(w.id.segment, w.plane, !0) ?? "Unknown" : Tt(w.id.joint, w.plane, !0) ?? "Unknown", []), x = G(
1997
- (w, I) => {
1998
- const L = s.findIndex(
1999
- (c) => c.id === I.id && c.plane === I.plane
2012
+ const s = k(() => [...r].sort((L, M) => {
2013
+ const w = xt.indexOf(L.plane), y = xt.indexOf(M.plane);
2014
+ return w - y;
2015
+ }), [r]), i = G((L) => "segment" in L.id ? kt(L.id.segment, L.plane, !0) ?? "Unknown" : Tt(L.id.joint, L.plane, !0) ?? "Unknown", []), g = G(
2016
+ (L, M) => {
2017
+ const w = s.findIndex(
2018
+ (c) => c.id === M.id && c.plane === M.plane
2000
2019
  );
2001
2020
  let y = [...s];
2002
- a && (I = { ...I, kind: a }), y[L] = I, h && (y = y.map((c) => ({
2021
+ a && (M = { ...M, kind: a }), y[w] = M, d && (y = y.map((c) => ({
2003
2022
  ...c,
2004
- min: I.min,
2005
- max: I.max
2023
+ min: M.min,
2024
+ max: M.max
2006
2025
  }))), n(y);
2007
2026
  },
2008
- [n, s, a, h]
2009
- ), M = G(
2010
- (w) => {
2011
- const I = s.filter(
2012
- (L) => L.id !== w.id || L.plane !== w.plane
2027
+ [n, s, a, d]
2028
+ ), C = G(
2029
+ (L) => {
2030
+ const M = s.filter(
2031
+ (w) => w.id !== L.id || w.plane !== L.plane
2013
2032
  );
2014
- n(I);
2033
+ n(M);
2015
2034
  },
2016
2035
  [n, s]
2017
2036
  );
2018
- return /* @__PURE__ */ e.jsx(le, { alignItems: "flex-start", overflowY: "auto", ...p, children: s.map((w, I) => /* @__PURE__ */ e.jsx(
2037
+ return /* @__PURE__ */ e.jsx(le, { alignItems: "flex-start", overflowY: "auto", ...p, children: s.map((L, M) => /* @__PURE__ */ e.jsx(
2019
2038
  Kn,
2020
2039
  {
2021
- label: i(w),
2022
- parameter: w,
2023
- onChange: (L) => x(I, L),
2024
- onRemove: m || u ? void 0 : () => M(w),
2040
+ label: i(L),
2041
+ parameter: L,
2042
+ onChange: (w) => g(M, w),
2043
+ onRemove: h || u ? void 0 : () => C(L),
2025
2044
  forceKind: a,
2026
- disableKind: g || u,
2045
+ disableKind: x || u,
2027
2046
  isDisabled: u
2028
2047
  },
2029
- `${JSON.stringify(w.id)}-${w.plane}`
2048
+ `${JSON.stringify(L.id)}-${L.plane}`
2030
2049
  )) });
2031
2050
  }, Kn = ({
2032
2051
  label: r,
2033
2052
  parameter: n,
2034
2053
  onChange: a,
2035
- onRemove: m,
2036
- forceKind: g,
2054
+ onRemove: h,
2055
+ forceKind: x,
2037
2056
  disableKind: u,
2038
- isDisabled: h
2057
+ isDisabled: d
2039
2058
  }) => {
2040
2059
  const p = G(
2041
- (x) => "joint" in n.id ? wn(
2060
+ (g) => "joint" in n.id ? wn(
2042
2061
  n.id.joint,
2043
2062
  n.plane,
2044
- x < 0 ? -1 : 1
2063
+ g < 0 ? -1 : 1
2045
2064
  ) : Sn(
2046
2065
  n.id.segment,
2047
2066
  n.plane,
2048
- x < 0 ? -1 : 1
2067
+ g < 0 ? -1 : 1
2049
2068
  ),
2050
2069
  [n]
2051
2070
  ), { min: s, max: i } = "joint" in n.id ? Ln(n.id.joint, n.plane) : { min: -180, max: 180 };
@@ -2062,7 +2081,7 @@ const Mn = ({
2062
2081
  children: [
2063
2082
  /* @__PURE__ */ e.jsxs(re, { w: "100%", children: [
2064
2083
  /* @__PURE__ */ e.jsx(
2065
- C,
2084
+ S,
2066
2085
  {
2067
2086
  fontSize: "sm",
2068
2087
  flex: 1,
@@ -2072,22 +2091,22 @@ const Mn = ({
2072
2091
  }
2073
2092
  ),
2074
2093
  n.sensorOnly && /* @__PURE__ */ e.jsx(wt, { size: "sm", colorScheme: "orange", variant: "subtle", children: "Sensor Only" }),
2075
- m && !h && /* @__PURE__ */ e.jsx(
2094
+ h && !d && /* @__PURE__ */ e.jsx(
2076
2095
  Xt,
2077
2096
  {
2078
2097
  size: "xs",
2079
2098
  variant: "ghost",
2080
2099
  "aria-label": "delete",
2081
2100
  icon: /* @__PURE__ */ e.jsx(bt, { as: jn }),
2082
- onClick: m
2101
+ onClick: h
2083
2102
  }
2084
2103
  ),
2085
- !g && /* @__PURE__ */ e.jsx(
2104
+ !x && /* @__PURE__ */ e.jsx(
2086
2105
  On,
2087
2106
  {
2088
2107
  selectedItem: n?.kind ?? Ke.Limit,
2089
- onChange: ({ value: x }) => a({ ...n, kind: x }),
2090
- isDisabled: u || h,
2108
+ onChange: ({ value: g }) => a({ ...n, kind: g }),
2109
+ isDisabled: u || d,
2091
2110
  buttonProps: {
2092
2111
  size: "sm",
2093
2112
  variant: "outline",
@@ -2113,11 +2132,11 @@ const Mn = ({
2113
2132
  max: i,
2114
2133
  zeroMarker: !0,
2115
2134
  value: [n.min, n.max],
2116
- onChange: (x) => a({ ...n, min: x[0], max: x[1] }),
2117
- formatValue: (x) => `${Math.abs(x)}°`,
2118
- valueLabel: (x) => p(x) ?? "",
2135
+ onChange: (g) => a({ ...n, min: g[0], max: g[1] }),
2136
+ formatValue: (g) => `${Math.abs(g)}°`,
2137
+ valueLabel: (g) => p(g) ?? "",
2119
2138
  positiveNegativeLabels: p(0) ? [p(-1) ?? "", p(1) ?? ""] : void 0,
2120
- isDisabled: h
2139
+ isDisabled: d
2121
2140
  }
2122
2141
  )
2123
2142
  ]
@@ -2127,101 +2146,101 @@ const Mn = ({
2127
2146
  options: r,
2128
2147
  value: n,
2129
2148
  onChange: a,
2130
- forceKind: m,
2131
- singleValue: g,
2149
+ forceKind: h,
2150
+ singleValue: x,
2132
2151
  singleValueSideless: u,
2133
- editOnly: h,
2152
+ editOnly: d,
2134
2153
  disableKind: p,
2135
2154
  maxParameters: s,
2136
2155
  ...i
2137
2156
  }) => {
2138
- const x = u ? 2 : s, M = k(() => {
2157
+ const g = u ? 2 : s, C = k(() => {
2139
2158
  const c = /* @__PURE__ */ new Map();
2140
- return r.forEach((d) => {
2141
- const v = "joint" in d.id;
2142
- let j, O;
2143
- if (v ? (j = Tt(d.id.joint, d.plane, !0) ?? "Unknown", O = `joint:${d.id.joint}`) : (j = kt(d.id.segment, d.plane, !0) ?? "Unknown", O = `segment:${d.id.segment}`), !c.has(O)) {
2144
- const A = v ? pt(d.id.joint) ?? "Unknown Joint" : pt(d.id.segment) ?? "Unknown Segment";
2145
- c.set(O, {
2146
- label: A,
2159
+ return r.forEach((m) => {
2160
+ const v = "joint" in m.id;
2161
+ let j, A;
2162
+ if (v ? (j = Tt(m.id.joint, m.plane, !0) ?? "Unknown", A = `joint:${m.id.joint}`) : (j = kt(m.id.segment, m.plane, !0) ?? "Unknown", A = `segment:${m.id.segment}`), !c.has(A)) {
2163
+ const O = v ? pt(m.id.joint) ?? "Unknown Joint" : pt(m.id.segment) ?? "Unknown Segment";
2164
+ c.set(A, {
2165
+ label: O,
2147
2166
  options: []
2148
2167
  });
2149
2168
  }
2150
- const $ = c.get(O), F = [
2169
+ const $ = c.get(A), F = [
2151
2170
  j,
2152
- v ? d.id.joint : d.id.segment,
2153
- d.plane
2154
- ].filter(Boolean).map((A) => String(A).toLowerCase().replace(/\s+|_/g, ""));
2171
+ v ? m.id.joint : m.id.segment,
2172
+ m.plane
2173
+ ].filter(Boolean).map((O) => String(O).toLowerCase().replace(/\s+|_/g, ""));
2155
2174
  $.options.push({
2156
2175
  label: /* @__PURE__ */ e.jsxs(re, { spacing: 2, justify: "space-between", w: "100%", pl: 3, children: [
2157
- /* @__PURE__ */ e.jsx(C, { children: j }),
2158
- d.sensorOnly && /* @__PURE__ */ e.jsx(wt, { size: "sm", colorScheme: "orange", variant: "subtle", children: "Sensor Only" })
2176
+ /* @__PURE__ */ e.jsx(S, { children: j }),
2177
+ m.sensorOnly && /* @__PURE__ */ e.jsx(wt, { size: "sm", colorScheme: "orange", variant: "subtle", children: "Sensor Only" })
2159
2178
  ] }),
2160
- value: d.id,
2161
- plane: d.plane,
2162
- sensorOnly: d.sensorOnly,
2179
+ value: m.id,
2180
+ plane: m.plane,
2181
+ sensorOnly: m.sensorOnly,
2163
2182
  searchTokens: F
2164
2183
  });
2165
2184
  }), Array.from(c.values());
2166
- }, [r]), w = k(() => {
2185
+ }, [r]), L = k(() => {
2167
2186
  if (!u || n.length === 0)
2168
- return M;
2187
+ return C;
2169
2188
  const c = n[0];
2170
- return M.map((d) => ({
2171
- ...d,
2172
- options: d.options.filter(
2189
+ return C.map((m) => ({
2190
+ ...m,
2191
+ options: m.options.filter(
2173
2192
  (v) => Be(v.value) === Be(c.id) && v.plane === c.plane
2174
2193
  )
2175
- })).filter((d) => d.options.length > 0);
2176
- }, [M, n, u]), I = k(() => M.flatMap((d) => d.options).filter(
2177
- (d) => n.some((v) => Ue(v.id, d.value) && v.plane === d.plane)
2178
- ), [M, n]), L = G((c, d) => {
2179
- if (!d) return !0;
2180
- const v = d.toLowerCase().replace(/\s+|_/g, ""), j = c.data;
2194
+ })).filter((m) => m.options.length > 0);
2195
+ }, [C, n, u]), M = k(() => C.flatMap((m) => m.options).filter(
2196
+ (m) => n.some((v) => Ue(v.id, m.value) && v.plane === m.plane)
2197
+ ), [C, n]), w = G((c, m) => {
2198
+ if (!m) return !0;
2199
+ const v = m.toLowerCase().replace(/\s+|_/g, ""), j = c.data;
2181
2200
  return !j || !j.searchTokens ? !1 : j.searchTokens.some(
2182
- (O) => O.includes(v)
2201
+ (A) => A.includes(v)
2183
2202
  );
2184
2203
  }, []), y = G(
2185
2204
  (c) => {
2186
- const d = c.map((v) => {
2205
+ const m = c.map((v) => {
2187
2206
  const j = n.find(
2188
2207
  (N) => Ue(N.id, v.value) && N.plane === v.plane
2189
- ), O = r.find(
2208
+ ), A = r.find(
2190
2209
  (N) => Ue(N.id, v.value) && N.plane === v.plane
2191
2210
  ), $ = u ? n.find(
2192
2211
  (N) => Be(N.id) === Be(v.value) && N.plane === v.plane
2193
- ) : void 0, F = $ && !j ? $.min : O && O.min ? O.min : 0, A = $ && !j ? $.max : O && O.max ? O.max : 0;
2212
+ ) : void 0, F = $ && !j ? $.min : A && A.min ? A.min : 0, O = $ && !j ? $.max : A && A.max ? A.max : 0;
2194
2213
  return j ?? {
2195
2214
  id: v.value,
2196
2215
  plane: v.plane,
2197
2216
  min: F,
2198
- max: A,
2217
+ max: O,
2199
2218
  sensorOnly: v.sensorOnly,
2200
- kind: m ?? Ke.Limit
2219
+ kind: h ?? Ke.Limit
2201
2220
  };
2202
2221
  });
2203
- a(d);
2222
+ a(m);
2204
2223
  },
2205
- [a, n, r, m, u]
2224
+ [a, n, r, h, u]
2206
2225
  );
2207
2226
  return ie(() => {
2208
2227
  const c = n.filter(
2209
- (d) => r.some((v) => Ue(v.id, d.id) && v.plane === d.plane)
2228
+ (m) => r.some((v) => Ue(v.id, m.id) && v.plane === m.plane)
2210
2229
  );
2211
2230
  c.length !== n.length && a(c);
2212
2231
  }, [r, a, n]), /* @__PURE__ */ e.jsxs(te, { ...i, children: [
2213
2232
  /* @__PURE__ */ e.jsx(
2214
2233
  ue,
2215
2234
  {
2216
- isMulti: !g,
2235
+ isMulti: !x,
2217
2236
  placeholder: n.length ? `${n.length} selected` : "Search...",
2218
- value: I,
2219
- isDisabled: h || I.length >= (x ?? 1 / 0),
2237
+ value: M,
2238
+ isDisabled: d || M.length >= (g ?? 1 / 0),
2220
2239
  onChange: (c) => Array.isArray(c) ? y([...c]) : y(c !== null ? [c] : []),
2221
- options: w,
2240
+ options: L,
2222
2241
  controlShouldRenderValue: !1,
2223
2242
  formatOptionLabel: (c) => c.label,
2224
- filterOption: L,
2243
+ filterOption: w,
2225
2244
  isSearchable: !0
2226
2245
  }
2227
2246
  ),
@@ -2232,9 +2251,9 @@ const Mn = ({
2232
2251
  maxH: "28rem",
2233
2252
  value: n,
2234
2253
  onChange: a,
2235
- forceKind: m,
2254
+ forceKind: h,
2236
2255
  disableKind: p,
2237
- isDisabled: h,
2256
+ isDisabled: d,
2238
2257
  lockRanges: u
2239
2258
  }
2240
2259
  )
@@ -2287,41 +2306,41 @@ const Mn = ({
2287
2306
  id: r,
2288
2307
  onError: n,
2289
2308
  onCancel: a,
2290
- onSave: m,
2291
- hideButtons: g,
2309
+ onSave: h,
2310
+ hideButtons: x,
2292
2311
  setButtonOnClick: u,
2293
- setButtonDisabled: h,
2312
+ setButtonDisabled: d,
2294
2313
  quantumOwned: p,
2295
2314
  isView: s
2296
2315
  }) => {
2297
- const i = rt(), [{ fetching: x }, M] = fe(st), [{ fetching: w }, I] = fe(an), [{ data: L }] = Ce({
2316
+ const i = rt(), [{ fetching: g }, C] = fe(st), [{ fetching: L }, M] = fe(an), [{ data: w }] = Ce({
2298
2317
  query: ln,
2299
2318
  variables: { id: r ?? "" },
2300
2319
  pause: !r
2301
2320
  }), y = k(() => {
2302
- const f = S(
2321
+ const f = I(
2303
2322
  ve,
2304
- L?.getActionById
2323
+ w?.getActionById
2305
2324
  );
2306
2325
  if (!f) return null;
2307
- const P = S(Ze, f.reports).map((Q) => ({
2326
+ const P = I(Ze, f.reports).map((Q) => ({
2308
2327
  ...Q,
2309
- thresholds: S(Ie, Q.thresholds)
2328
+ thresholds: I(Ie, Q.thresholds)
2310
2329
  }));
2311
2330
  return {
2312
2331
  ...f,
2313
- thresholds: S(Ie, f.thresholds),
2332
+ thresholds: I(Ie, f.thresholds),
2314
2333
  reports: P
2315
2334
  };
2316
- }, [L]), c = x || w, d = !!y && !!r, { getLabel: v } = pe(), j = k(() => ({
2335
+ }, [w]), c = g || L, m = !!y && !!r, { getLabel: v } = pe(), j = k(() => ({
2317
2336
  action: v("action")
2318
- }), [v]), O = k(() => [
2337
+ }), [v]), A = k(() => [
2319
2338
  { key: "module_category", label: "Link Category", multi: !0 },
2320
2339
  { key: "activity_type", label: `${j.action} Type`, multi: !1 },
2321
2340
  { key: "session_type", label: "Session Type", multi: !0 },
2322
2341
  { key: "body_region", label: "Body Region", multi: !0 },
2323
2342
  { key: "sport", label: "Sport", multi: !0 }
2324
- ], [j.action]), [$, F] = B(""), [A, N] = B(""), [H, oe] = B(""), [R, Z] = B(""), [V, T] = B([]), [_, J] = B({}), [W, K] = B(null), [l, t] = B([]), [o, b] = B([]), [U, q] = B(""), [E, D] = B([]), Y = hn(), ge = k(() => Y.filter((f) => f.sensorOnly), [Y]), ye = k(() => {
2343
+ ], [j.action]), [$, F] = B(""), [O, N] = B(""), [H, oe] = B(""), [R, Z] = B(""), [V, T] = B([]), [_, J] = B({}), [W, K] = B(null), [l, t] = B([]), [o, b] = B([]), [U, q] = B(""), [E, D] = B([]), Y = hn(), ge = k(() => Y.filter((f) => f.sensorOnly), [Y]), ye = k(() => {
2325
2344
  const f = [
2326
2345
  { label: "General Activity", value: ae.GeneralActivity },
2327
2346
  {
@@ -2337,17 +2356,17 @@ const Mn = ({
2337
2356
  );
2338
2357
  }, [E]), De = $.length > 0, [Pe, ot] = B({});
2339
2358
  ie(() => {
2340
- const f = O.map(
2359
+ const f = A.map(
2341
2360
  (z) => i.query(nt, { key: z.key })
2342
2361
  );
2343
2362
  Promise.all(f).then((z) => {
2344
2363
  const P = {};
2345
2364
  z.forEach((Q) => {
2346
2365
  if (Q.error || !Q.data) return;
2347
- const ee = S(
2366
+ const ee = I(
2348
2367
  je,
2349
2368
  Q.data.getMetadataByKey
2350
- ), ne = S(
2369
+ ), ne = I(
2351
2370
  be,
2352
2371
  ee.data
2353
2372
  );
@@ -2358,13 +2377,13 @@ const Mn = ({
2358
2377
  }));
2359
2378
  }), J(P);
2360
2379
  });
2361
- }, [i, O]), ie(() => {
2380
+ }, [i, A]), ie(() => {
2362
2381
  if (y) {
2363
- const z = S(
2382
+ const z = I(
2364
2383
  je,
2365
2384
  y.metadataGroups
2366
2385
  ).map(
2367
- (ee) => ee.data.map((ne) => S(be, ne).id)
2386
+ (ee) => ee.data.map((ne) => I(be, ne).id)
2368
2387
  ), P = y.reports.map((ee) => ({
2369
2388
  id: ee.id,
2370
2389
  instructions: ee.instructions ?? "",
@@ -2398,7 +2417,7 @@ const Mn = ({
2398
2417
  const Oe = k(
2399
2418
  () => JSON.stringify(Pe) !== JSON.stringify({
2400
2419
  name: $,
2401
- description: A,
2420
+ description: O,
2402
2421
  cameraPlacement: H,
2403
2422
  videoLink: R,
2404
2423
  metadataIds: V,
@@ -2407,7 +2426,7 @@ const Mn = ({
2407
2426
  [
2408
2427
  Pe,
2409
2428
  $,
2410
- A,
2429
+ O,
2411
2430
  H,
2412
2431
  R,
2413
2432
  V,
@@ -2416,7 +2435,7 @@ const Mn = ({
2416
2435
  ), Ae = G(() => {
2417
2436
  const f = {
2418
2437
  name: $,
2419
- description: A,
2438
+ description: O,
2420
2439
  cameraPlacement: H,
2421
2440
  videoLink: R,
2422
2441
  metadataItemIds: V,
@@ -2445,35 +2464,35 @@ const Mn = ({
2445
2464
  }))
2446
2465
  };
2447
2466
  let z;
2448
- d && r ? z = I({
2467
+ m && r ? z = M({
2449
2468
  id: r,
2450
2469
  fields: f
2451
- }) : z = M({
2470
+ }) : z = C({
2452
2471
  fields: f
2453
2472
  }), z.then(({ error: P }) => {
2454
- P ? n(P) : m();
2473
+ P ? n(P) : h();
2455
2474
  });
2456
2475
  }, [
2457
2476
  p,
2477
+ C,
2458
2478
  M,
2459
- I,
2460
2479
  r,
2461
2480
  $,
2462
- A,
2481
+ O,
2463
2482
  H,
2464
2483
  R,
2465
2484
  V,
2466
2485
  E,
2467
- d,
2468
2486
  m,
2487
+ h,
2469
2488
  n
2470
2489
  ]);
2471
2490
  ie(() => {
2472
- h && h({
2491
+ d && d({
2473
2492
  cancelButton: c,
2474
2493
  saveButton: s ? !0 : c || !De || !Oe
2475
2494
  });
2476
- }, [c, h, De, Oe, s]), ie(() => {
2495
+ }, [c, d, De, Oe, s]), ie(() => {
2477
2496
  u && u({
2478
2497
  cancelButton: a,
2479
2498
  saveButton: s ? () => {
@@ -2515,7 +2534,7 @@ const Mn = ({
2515
2534
  ]), xe = G((f) => {
2516
2535
  D((z) => z.filter((P) => P.id !== f));
2517
2536
  }, []), Te = (f, z) => {
2518
- const P = O.find((ee) => ee.key === f);
2537
+ const P = A.find((ee) => ee.key === f);
2519
2538
  if (!P) return;
2520
2539
  const Q = P.multi ? (z ?? []).map(
2521
2540
  (ee) => ee.id
@@ -2579,7 +2598,7 @@ const Mn = ({
2579
2598
  /* @__PURE__ */ e.jsx(
2580
2599
  ze,
2581
2600
  {
2582
- value: A,
2601
+ value: O,
2583
2602
  onChange: (f) => N(f.target.value),
2584
2603
  rows: 2,
2585
2604
  placeholder: "(optional) Describe how to perform the test or exercise",
@@ -2590,7 +2609,7 @@ const Mn = ({
2590
2609
  ] }),
2591
2610
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
2592
2611
  /* @__PURE__ */ e.jsx(de, { children: "Metadata Tags" }),
2593
- O.map((f) => /* @__PURE__ */ e.jsxs(X, { children: [
2612
+ A.map((f) => /* @__PURE__ */ e.jsxs(X, { children: [
2594
2613
  /* @__PURE__ */ e.jsx(de, { children: f.label }),
2595
2614
  /* @__PURE__ */ e.jsx(
2596
2615
  ue,
@@ -2623,7 +2642,7 @@ const Mn = ({
2623
2642
  /* @__PURE__ */ e.jsx(de, { children: "Add New Report" }),
2624
2643
  /* @__PURE__ */ e.jsxs(X, { children: [
2625
2644
  /* @__PURE__ */ e.jsx(de, { children: "Report Kind" }),
2626
- ye.length === 0 ? /* @__PURE__ */ e.jsx(C, { fontSize: "sm", color: "gray.500", p: 2, children: "All report kinds have been used. Remove an existing report to add a new one." }) : /* @__PURE__ */ e.jsx(
2645
+ ye.length === 0 ? /* @__PURE__ */ e.jsx(S, { fontSize: "sm", color: "gray.500", p: 2, children: "All report kinds have been used. Remove an existing report to add a new one." }) : /* @__PURE__ */ e.jsx(
2627
2646
  ue,
2628
2647
  {
2629
2648
  value: W ? ye.find(
@@ -2689,13 +2708,13 @@ const Mn = ({
2689
2708
  ] }),
2690
2709
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
2691
2710
  /* @__PURE__ */ e.jsx(de, { children: "Configured Reports" }),
2692
- E.length === 0 ? /* @__PURE__ */ e.jsx(C, { fontSize: "sm", color: "gray.500", children: "No reports created yet" }) : /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: E.map((f) => /* @__PURE__ */ e.jsxs(
2711
+ E.length === 0 ? /* @__PURE__ */ e.jsx(S, { fontSize: "sm", color: "gray.500", children: "No reports created yet" }) : /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: E.map((f) => /* @__PURE__ */ e.jsxs(
2693
2712
  "div",
2694
2713
  {
2695
2714
  className: "p-3 border border-gray-200 rounded-md bg-gray-50",
2696
2715
  children: [
2697
2716
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-start mb-2", children: [
2698
- /* @__PURE__ */ e.jsx(C, { fontWeight: "semibold", children: Yn(f.kind) }),
2717
+ /* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", children: Yn(f.kind) }),
2699
2718
  !s && /* @__PURE__ */ e.jsx(
2700
2719
  se,
2701
2720
  {
@@ -2742,7 +2761,7 @@ const Mn = ({
2742
2761
  editOnly: s
2743
2762
  }
2744
2763
  ),
2745
- f.kind !== ae.PointOfInterest && /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.600", mt: 2, children: [
2764
+ f.kind !== ae.PointOfInterest && /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", mt: 2, children: [
2746
2765
  "Sensors:",
2747
2766
  " ",
2748
2767
  f.sensorLocations.map(
@@ -2763,7 +2782,7 @@ const Mn = ({
2763
2782
  re,
2764
2783
  {
2765
2784
  justify: "end",
2766
- className: qe((g || s) && "!hidden"),
2785
+ className: qe((x || s) && "!hidden"),
2767
2786
  children: /* @__PURE__ */ e.jsxs(Me, { gap: 4, children: [
2768
2787
  /* @__PURE__ */ e.jsx(se, { colorScheme: "gray", isDisabled: c, onClick: a, children: "Cancel" }),
2769
2788
  /* @__PURE__ */ e.jsx(
@@ -2785,128 +2804,127 @@ const Mn = ({
2785
2804
  isView: n,
2786
2805
  metadataKeys: a
2787
2806
  }) => {
2788
- const [m, g] = B({}), u = rt();
2807
+ const [h, x] = B({}), u = rt();
2789
2808
  return ie(() => {
2790
- const h = (a ?? []).map(
2791
- (p) => u.query(nt, { key: p })
2792
- );
2793
- Promise.all(h).then((p) => {
2794
- const s = {};
2795
- p.forEach((i) => {
2796
- if (i.error || !i.data) return;
2797
- const x = S(
2809
+ let d = !1;
2810
+ return (async () => {
2811
+ const s = (a ?? []).map(
2812
+ (C) => u.query(nt, { key: C }).toPromise()
2813
+ ), i = await Promise.all(s), g = {};
2814
+ for (const C of i) {
2815
+ if (C.error || !C.data?.getMetadataByKey) continue;
2816
+ const L = I(
2798
2817
  je,
2799
- i.data.getMetadataByKey
2800
- ), M = S(
2801
- be,
2802
- x.data
2818
+ C.data.getMetadataByKey
2803
2819
  );
2804
- s[x.key] = M.map((w) => ({
2820
+ if (!L) continue;
2821
+ const M = I(be, L.data) ?? [];
2822
+ g[L.key] = M.map((w) => ({
2805
2823
  label: w.label || w.value,
2806
2824
  value: w.value,
2807
2825
  id: w.id
2808
2826
  }));
2809
- }), g(s);
2810
- });
2811
- }, [u, a]), /* @__PURE__ */ e.jsx(Rt.Provider, { value: { isView: n, metadataOptions: m }, children: r });
2827
+ }
2828
+ d || x(g);
2829
+ })(), () => {
2830
+ d = !0;
2831
+ };
2832
+ }, [u, a]), /* @__PURE__ */ e.jsx(Rt.Provider, { value: { isView: n, metadataOptions: h }, children: r });
2812
2833
  }, xs = ({
2813
2834
  id: r,
2814
2835
  onCancel: n,
2815
2836
  onSave: a,
2816
- onError: m,
2817
- hideButtons: g,
2837
+ onError: h,
2838
+ hideButtons: x,
2818
2839
  quantumOwned: u,
2819
- setButtonOnClick: h,
2840
+ setButtonOnClick: d,
2820
2841
  setButtonDisabled: p,
2821
2842
  isView: s
2822
2843
  }) => {
2823
- const [{ data: i, fetching: x }] = Ce({
2844
+ const [{ data: i, fetching: g }] = Ce({
2824
2845
  query: u ? cn : dn
2825
- }), [{ data: M }] = Ce({
2846
+ }), [{ data: C }] = Ce({
2826
2847
  query: un,
2827
2848
  variables: { id: r },
2828
2849
  pause: !r
2829
- }), [{ data: w }] = Ce({
2850
+ }), [{ data: L }] = Ce({
2830
2851
  query: mn
2831
- }), I = S(
2852
+ }), M = I(
2832
2853
  $e,
2833
- w?.moduleCategories
2834
- ), [{ fetching: L }, y] = fe(Ot), [{ fetching: c }, d] = fe(Mt), v = k(() => !i || x ? [] : S(
2854
+ L?.moduleCategories
2855
+ ), [{ fetching: w }, y] = fe(Ot), [{ fetching: c }, m] = fe(Mt), v = k(() => !i || g ? [] : I(
2835
2856
  ve,
2836
2857
  u ? i?.quantumOwnedActions ?? [] : i?.actions ?? []
2837
- ).filter((l) => !!l?.id), [i, u, x]), j = S(Qe, M?.module), O = k(() => S(At, j?.moduleActions) ?? [], [j?.moduleActions]), [$, F] = B([
2838
- ...O.map((K) => K.actionId) ?? []
2839
- ]), [A, N] = B(j?.name ?? ""), [H, oe] = B([]), [R, Z] = B(j?.description ?? ""), [V, T] = B([]), [_, J] = B({});
2858
+ ).filter((l) => !!l?.id), [i, u, g]), j = I(Qe, C?.module), A = k(() => I(At, j?.moduleActions) ?? [], [j?.moduleActions]), [$, F] = B([
2859
+ ...A.map((K) => K.actionId) ?? []
2860
+ ]), [O, N] = B(j?.name ?? ""), [H, oe] = B([]), [R, Z] = B(j?.description ?? ""), [V, T] = B([]), [_, J] = B({});
2840
2861
  ie(() => {
2841
2862
  if (j) {
2842
- F(O.map((o) => o.actionId)), N(j.name), Z(j.description ?? ""), oe(
2863
+ F(A.map((o) => o.actionId)), N(j.name), Z(j.description ?? ""), oe(
2843
2864
  j.categories.map(
2844
- (o) => S($e, o).id
2865
+ (o) => I($e, o).id
2845
2866
  ) ?? []
2846
2867
  );
2847
- const l = S(
2868
+ const l = I(
2848
2869
  je,
2849
2870
  j.metadataGroups
2850
2871
  ).map(
2851
- (o) => o.data.map((b) => S(be, b).id)
2872
+ (o) => o.data.map((b) => I(be, b).id)
2852
2873
  );
2853
2874
  T(l.flat());
2854
2875
  const t = {};
2855
- O.forEach((o) => {
2876
+ A.forEach((o) => {
2856
2877
  t[o.actionId] = o.reportId || null;
2857
2878
  }), J(t);
2858
2879
  }
2859
- }, [j, O]);
2880
+ }, [j, A]);
2860
2881
  const W = G(() => {
2861
2882
  let K;
2862
- const l = Object.entries(_).map(([o, b]) => ({
2883
+ const l = Object.entries(_).filter(([, o]) => o !== null).map(([o, b]) => ({
2863
2884
  actionId: o,
2864
2885
  reportId: b
2865
- })).filter(({ reportId: o }) => o !== null), t = {
2886
+ })), t = {
2866
2887
  actions: $,
2867
- name: A,
2888
+ name: O,
2868
2889
  categories: H.filter((o) => o !== "other"),
2869
2890
  description: R,
2870
2891
  quantumOwned: u,
2871
2892
  metadataItemIds: V,
2872
- actionReports: l.filter(({ reportId: o }) => o !== null).map(({ actionId: o, reportId: b }) => ({
2873
- actionId: o,
2874
- reportId: b
2875
- }))
2893
+ actionReports: l
2876
2894
  };
2877
2895
  j ? K = y({
2878
2896
  id: j.id,
2879
2897
  input: t
2880
- }) : K = d({
2898
+ }) : K = m({
2881
2899
  input: t
2882
2900
  }), K.then(({ error: o }) => {
2883
- o ? m(o instanceof Error ? o : new Error(String(o))) : a();
2901
+ o ? h(o instanceof Error ? o : new Error(String(o))) : a();
2884
2902
  });
2885
2903
  }, [
2886
- d,
2904
+ m,
2887
2905
  y,
2888
2906
  $,
2889
- A,
2907
+ O,
2890
2908
  R,
2891
2909
  H,
2892
2910
  V,
2893
2911
  _,
2894
2912
  j,
2895
2913
  a,
2896
- m,
2914
+ h,
2897
2915
  u
2898
2916
  ]);
2899
2917
  return ie(() => {
2900
2918
  p && p({
2901
- cancelButton: L || c,
2902
- saveButton: L || c || !A || R.trim().split(/\s+/).filter(Boolean).length > 40
2919
+ cancelButton: w || c,
2920
+ saveButton: w || c || !O || R.trim().split(/\s+/).filter(Boolean).length > 40
2903
2921
  });
2904
- }, [p, L, c, $, A, R]), ie(() => {
2905
- h && h({
2922
+ }, [p, w, c, $, O, R]), ie(() => {
2923
+ d && d({
2906
2924
  cancelButton: n,
2907
2925
  saveButton: W
2908
2926
  });
2909
- }, [h, n, W]), /* @__PURE__ */ e.jsx(te, { width: "100%", children: /* @__PURE__ */ e.jsxs(
2927
+ }, [d, n, W]), /* @__PURE__ */ e.jsx(te, { width: "100%", children: /* @__PURE__ */ e.jsxs(
2910
2928
  Hn,
2911
2929
  {
2912
2930
  isView: s,
@@ -2915,12 +2933,12 @@ const Mn = ({
2915
2933
  /* @__PURE__ */ e.jsx(
2916
2934
  Gn,
2917
2935
  {
2918
- name: A,
2936
+ name: O,
2919
2937
  setName: N,
2920
2938
  actions: v,
2921
2939
  selectedActionIds: $,
2922
2940
  setSelectedActionIds: F,
2923
- availableCategories: I ?? [],
2941
+ availableCategories: M ?? [],
2924
2942
  selectedCategoryIds: H,
2925
2943
  setSelectedCategoryIds: oe,
2926
2944
  description: R,
@@ -2931,12 +2949,12 @@ const Mn = ({
2931
2949
  setActionReportIds: J
2932
2950
  }
2933
2951
  ),
2934
- !g && !s && /* @__PURE__ */ e.jsx(re, { justifyContent: "flex-start", children: /* @__PURE__ */ e.jsxs(Me, { mt: 16, gap: 4, children: [
2952
+ !x && !s && /* @__PURE__ */ e.jsx(re, { justifyContent: "flex-start", children: /* @__PURE__ */ e.jsxs(Me, { mt: 16, gap: 4, children: [
2935
2953
  /* @__PURE__ */ e.jsx(
2936
2954
  se,
2937
2955
  {
2938
2956
  colorScheme: "gray",
2939
- isDisabled: L || c,
2957
+ isDisabled: w || c,
2940
2958
  onClick: n,
2941
2959
  children: "Cancel"
2942
2960
  }
@@ -2945,8 +2963,8 @@ const Mn = ({
2945
2963
  se,
2946
2964
  {
2947
2965
  colorScheme: "blue",
2948
- isDisabled: L || c || !A || R.trim().split(/\s+/).filter(Boolean).length > 40,
2949
- isLoading: L || c,
2966
+ isDisabled: w || c || !O || R.trim().split(/\s+/).filter(Boolean).length > 40,
2967
+ isLoading: w || c,
2950
2968
  onClick: W,
2951
2969
  children: "Save"
2952
2970
  }