quantum-component-library 1.4.52 → 1.4.53-dev.2

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