quantum-component-library 1.4.47-dev.9 → 1.4.48-1

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