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