quantum-component-library 1.4.67 → 1.4.68
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.cjs +1 -1
- package/dist/components.js +656 -662
- package/dist/generated/gql.d.ts +2 -2
- package/dist/generated/graphql.d.ts +29 -3
- package/dist/generated-graphql.cjs +1 -1
- package/dist/generated-graphql.js +66 -65
- package/dist/generated.cjs +1 -1
- package/dist/generated.js +5 -5
- package/dist/{graphql-kPu5QxaL.cjs → graphql-BEhru2G1.cjs} +1 -0
- package/dist/{graphql-DAkuEEbq.js → graphql-DFQnN0la.js} +5 -4
- package/dist/hooks.cjs +1 -1
- package/dist/hooks.js +1 -1
- package/dist/providers.cjs +1 -1
- package/dist/providers.js +1 -1
- package/package.json +1 -1
package/dist/components.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as e } from "./react-jsx-runtime-vendor-OVHDjVDe.js";
|
|
2
2
|
import "./moment-vendor-DMLRxgRE.js";
|
|
3
3
|
import { Flex as Me, InputGroup as ct, InputLeftElement as Pt, Icon as Ct, Input as ye, FormLabel as _e, ButtonGroup as Ne, Tooltip as rt, Button as te, Box as se, RangeSlider as _t, RangeSliderMark as st, Text as M, RangeSliderTrack as Et, RangeSliderFilledTrack as zt, RangeSliderThumb as dt, Select as ut, NumberInput as mt, NumberInputField as ht, HStack as V, Tag as Ge, FormControl as X, TableContainer as Bt, Table as Ut, Thead as Wt, Tr as pt, Th as De, Tbody as Qt, Td as We, IconButton as ot, Image as qt, useToast as wt, VStack as ue, RadioGroup as It, Radio as Ze, Alert as Ve, AlertIcon as et, Spinner as St, useDisclosure as Kt, Modal as Ht, ModalOverlay as Yt, ModalContent as Jt, ModalHeader as Xt, ModalCloseButton as Zt, ModalBody as Vt, ModalFooter as en, Badge as Oe, Tabs as tn, TabList as nn, Tab as gt, TabPanels as sn, TabPanel as xt, Textarea as Qe, Switch as on } from "@chakra-ui/react";
|
|
4
|
-
import { useMemo as
|
|
4
|
+
import { useMemo as $, useState as q, useEffect as ce, useCallback as _, createContext as rn, useContext as an, memo as Ae, useRef as ln } from "react";
|
|
5
5
|
import { getFragmentData as A } from "./generated.js";
|
|
6
|
-
import { G as at, M as je, a as be, b as Lt, c as cn, C as it, d as kt, e as Mt, R as Fe, f as Pe, T as Te, A as ve, g as dn, h as At, U as Ot, i as Ye, j as Tt, k as un, l as mn, m as hn, n as pn, o as gn, p as xn } from "./graphql-
|
|
6
|
+
import { G as at, M as je, a as be, b as Lt, c as cn, C as it, d as kt, e as Mt, R as Fe, f as Pe, T as Te, A as ve, g as dn, h as At, U as Ot, i as Ye, j as Tt, k as un, l as mn, m as hn, n as pn, o as gn, p as xn } from "./graphql-DFQnN0la.js";
|
|
7
7
|
import { c as Je } from "./utils-cn-CgdSr4hO.js";
|
|
8
8
|
import "./lodash-vendor-CY4G3-79.js";
|
|
9
9
|
import { useClient as lt, useQuery as Ce, useMutation as fe } from "urql";
|
|
@@ -18,16 +18,16 @@ import { ThresholdKind as Xe, ReportKind as ie, ActionLaterality as Nn, SensorLo
|
|
|
18
18
|
import { availablePlanes as bt, getAnalysisPartIdNoSide as qe } from "./types.js";
|
|
19
19
|
const Rn = ({
|
|
20
20
|
setSearch: s,
|
|
21
|
-
actions:
|
|
21
|
+
actions: t,
|
|
22
22
|
updateUseCases: r,
|
|
23
23
|
hideUseCaseFilter: p = !1
|
|
24
24
|
}) => {
|
|
25
|
-
const m =
|
|
26
|
-
() =>
|
|
25
|
+
const m = $(
|
|
26
|
+
() => t?.flatMap((h) => h.useCases).filter((h, d, g) => g.findIndex((n) => n.id === h.id) === d).map((h) => ({
|
|
27
27
|
label: h.name,
|
|
28
28
|
value: h.id
|
|
29
29
|
})) || [],
|
|
30
|
-
[
|
|
30
|
+
[t]
|
|
31
31
|
);
|
|
32
32
|
return /* @__PURE__ */ e.jsxs(Me, { width: "100%", alignContent: "space-evenly", gap: 4, children: [
|
|
33
33
|
/* @__PURE__ */ e.jsxs(ct, { size: "md", flex: 1, children: [
|
|
@@ -56,7 +56,7 @@ const Rn = ({
|
|
|
56
56
|
placeholder: "Filter use case",
|
|
57
57
|
isMulti: !0,
|
|
58
58
|
options: m,
|
|
59
|
-
onChange: (h) => r(h.map((
|
|
59
|
+
onChange: (h) => r(h.map((d) => d.value))
|
|
60
60
|
}
|
|
61
61
|
) })
|
|
62
62
|
] });
|
|
@@ -64,54 +64,54 @@ const Rn = ({
|
|
|
64
64
|
children: s
|
|
65
65
|
}) => /* @__PURE__ */ e.jsx(_e, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: s }), $n = ({
|
|
66
66
|
items: s,
|
|
67
|
-
onChange:
|
|
67
|
+
onChange: t,
|
|
68
68
|
selectedItem: r,
|
|
69
69
|
isDisabled: p,
|
|
70
70
|
selectedProps: m,
|
|
71
71
|
buttonProps: h
|
|
72
72
|
}) => {
|
|
73
|
-
const
|
|
74
|
-
return /* @__PURE__ */ e.jsx(Ne, { isAttached: !0, isDisabled: p, children: s.map((
|
|
73
|
+
const d = (n) => n === r || n.value === r, g = (n) => d(n) ? { ...h, ...m } : h;
|
|
74
|
+
return /* @__PURE__ */ e.jsx(Ne, { isAttached: !0, isDisabled: p, children: s.map((n, o) => /* @__PURE__ */ e.jsx(
|
|
75
75
|
rt,
|
|
76
76
|
{
|
|
77
|
-
label:
|
|
77
|
+
label: n.tooltip,
|
|
78
78
|
openDelay: 50,
|
|
79
79
|
closeDelay: 200,
|
|
80
80
|
placement: "top",
|
|
81
|
-
visibility:
|
|
81
|
+
visibility: n.tooltip ? "visible" : "hidden",
|
|
82
82
|
hasArrow: !0,
|
|
83
83
|
children: /* @__PURE__ */ e.jsx(
|
|
84
84
|
te,
|
|
85
85
|
{
|
|
86
|
-
onClick: () =>
|
|
87
|
-
isDisabled:
|
|
88
|
-
...
|
|
89
|
-
children:
|
|
86
|
+
onClick: () => d(n) ? null : t(n, o),
|
|
87
|
+
isDisabled: n.disabled,
|
|
88
|
+
...g(n),
|
|
89
|
+
children: n.label
|
|
90
90
|
}
|
|
91
91
|
)
|
|
92
92
|
},
|
|
93
93
|
o
|
|
94
94
|
)) });
|
|
95
|
-
}, Ke = (s,
|
|
95
|
+
}, Ke = (s, t) => t < 0 ? -1 * Math.abs(s) : Math.abs(s), Dn = ({
|
|
96
96
|
isReversed: s,
|
|
97
|
-
min:
|
|
97
|
+
min: t,
|
|
98
98
|
max: r,
|
|
99
99
|
value: p,
|
|
100
100
|
onChange: m,
|
|
101
101
|
inputProps: h,
|
|
102
|
-
size:
|
|
103
|
-
zeroMarker:
|
|
104
|
-
formatValue:
|
|
102
|
+
size: d,
|
|
103
|
+
zeroMarker: g,
|
|
104
|
+
formatValue: n,
|
|
105
105
|
valueLabel: o,
|
|
106
106
|
positiveNegativeLabels: u,
|
|
107
107
|
isDisabled: y,
|
|
108
|
-
...
|
|
108
|
+
...b
|
|
109
109
|
}) => {
|
|
110
|
-
const [w, I] = q([void 0, void 0]), L = w[0],
|
|
110
|
+
const [w, I] = q([void 0, void 0]), L = w[0], f = w[1], c = g && t < -5 && r > 5, k = Number(p?.[0] ?? f ?? t) > 0 ? 1 : -1, x = Number(p?.[1] ?? f ?? r) < 0 ? -1 : 1, N = u?.[0] === u?.[1], v = p?.[0], E = p?.[1];
|
|
111
111
|
ce(() => {
|
|
112
112
|
v !== void 0 && E !== void 0 && I([v.toFixed(0), E.toFixed(0)]);
|
|
113
113
|
}, [v, E, I]);
|
|
114
|
-
const
|
|
114
|
+
const R = _(
|
|
115
115
|
([T, B]) => {
|
|
116
116
|
T < B && I([T.toFixed(0), B.toFixed(0)]);
|
|
117
117
|
},
|
|
@@ -123,10 +123,10 @@ const Rn = ({
|
|
|
123
123
|
[m]
|
|
124
124
|
), K = _(() => {
|
|
125
125
|
I(([T, B]) => {
|
|
126
|
-
const J = isNaN(Number(T)) ?
|
|
126
|
+
const J = isNaN(Number(T)) ? t : Number(T), U = isNaN(Number(B)) ? r : Number(B), Y = Ke(Number(J), k), i = Ke(Number(U), x), a = k < 0 ? Math.max(Y, t) : Math.min(Y, r), C = x < 0 ? Math.max(i, t) : Math.min(i, r);
|
|
127
127
|
return a > C ? (m([C, a]), [C.toFixed(0), a.toFixed(0)]) : (m([a, C]), [a.toFixed(0), C.toFixed(0)]);
|
|
128
128
|
});
|
|
129
|
-
}, [m, I, k,
|
|
129
|
+
}, [m, I, k, x, t, r]), oe = _(
|
|
130
130
|
(T) => {
|
|
131
131
|
const B = T === "" || isNaN(Number(T)) ? T : Ke(Number(T), k);
|
|
132
132
|
I(([J, U]) => [B.toString(), U]);
|
|
@@ -134,59 +134,59 @@ const Rn = ({
|
|
|
134
134
|
[I, k]
|
|
135
135
|
), D = _(
|
|
136
136
|
(T) => {
|
|
137
|
-
const B = T === "" || isNaN(Number(T)) ? T : Ke(Number(T),
|
|
137
|
+
const B = T === "" || isNaN(Number(T)) ? T : Ke(Number(T), x);
|
|
138
138
|
I(([J, U]) => [J, B.toString()]);
|
|
139
139
|
},
|
|
140
|
-
[I,
|
|
141
|
-
), ae =
|
|
142
|
-
() =>
|
|
143
|
-
[
|
|
140
|
+
[I, x]
|
|
141
|
+
), ae = $(
|
|
142
|
+
() => d === "xs" ? "0.75rem" : void 0,
|
|
143
|
+
[d]
|
|
144
144
|
), Z = _(
|
|
145
145
|
(T, B) => {
|
|
146
146
|
const J = Number(B.target.value);
|
|
147
|
-
if (!L || !
|
|
147
|
+
if (!L || !f || ![-1, 1].includes(J))
|
|
148
148
|
return;
|
|
149
|
-
const U = (a) => J < 0 ? -1 * Math.abs(a) : Math.abs(a),
|
|
150
|
-
|
|
149
|
+
const U = (a) => J < 0 ? -1 * Math.abs(a) : Math.abs(a), Y = T ? U(Number(L)) : Number(L), i = T ? Number(f) : U(Number(f));
|
|
150
|
+
Y > i ? m([i, Y]) : m([Y, i]);
|
|
151
151
|
},
|
|
152
|
-
[L,
|
|
152
|
+
[L, f, m]
|
|
153
153
|
);
|
|
154
|
-
return /* @__PURE__ */ e.jsxs(Me, { direction: "column", ...
|
|
154
|
+
return /* @__PURE__ */ e.jsxs(Me, { direction: "column", ...b, children: [
|
|
155
155
|
/* @__PURE__ */ e.jsx(se, { pt: "1em", mb: "-0.5em", children: /* @__PURE__ */ e.jsxs(
|
|
156
156
|
_t,
|
|
157
157
|
{
|
|
158
158
|
"aria-label": ["min", "max"],
|
|
159
159
|
isReversed: s,
|
|
160
|
-
value: [Number(L ??
|
|
160
|
+
value: [Number(L ?? t), Number(f ?? r)],
|
|
161
161
|
max: r,
|
|
162
|
-
min:
|
|
162
|
+
min: t,
|
|
163
163
|
minStepsBetweenThumbs: 3,
|
|
164
164
|
step: 1,
|
|
165
|
-
onChange:
|
|
165
|
+
onChange: R,
|
|
166
166
|
onChangeEnd: O,
|
|
167
167
|
isDisabled: y,
|
|
168
168
|
children: [
|
|
169
|
-
/* @__PURE__ */ e.jsx(st, { value:
|
|
169
|
+
/* @__PURE__ */ e.jsx(st, { value: t, top: "-1em", children: /* @__PURE__ */ e.jsx(
|
|
170
170
|
M,
|
|
171
171
|
{
|
|
172
|
-
fontSize:
|
|
172
|
+
fontSize: d ?? "sm",
|
|
173
173
|
fontWeight: "semibold",
|
|
174
174
|
whiteSpace: "nowrap",
|
|
175
|
-
children:
|
|
175
|
+
children: n ? n?.(t) : t
|
|
176
176
|
}
|
|
177
177
|
) }),
|
|
178
178
|
/* @__PURE__ */ e.jsx(st, { value: r, top: "-1em", children: /* @__PURE__ */ e.jsx(
|
|
179
179
|
M,
|
|
180
180
|
{
|
|
181
|
-
fontSize:
|
|
181
|
+
fontSize: d ?? "sm",
|
|
182
182
|
fontWeight: "semibold",
|
|
183
183
|
style: { transform: "translateX(-100%)" },
|
|
184
184
|
whiteSpace: "nowrap",
|
|
185
|
-
children:
|
|
185
|
+
children: n ? n(r) : r
|
|
186
186
|
}
|
|
187
187
|
) }),
|
|
188
|
-
|
|
189
|
-
/* @__PURE__ */ e.jsx(M, { fontSize:
|
|
188
|
+
c && /* @__PURE__ */ e.jsxs(st, { value: 0, top: "-1em", pos: "relative", children: [
|
|
189
|
+
/* @__PURE__ */ e.jsx(M, { fontSize: d, fontWeight: "semibold", children: n?.(0) ?? "0" }),
|
|
190
190
|
/* @__PURE__ */ e.jsx(
|
|
191
191
|
se,
|
|
192
192
|
{
|
|
@@ -214,16 +214,16 @@ const Rn = ({
|
|
|
214
214
|
/* @__PURE__ */ e.jsx(
|
|
215
215
|
M,
|
|
216
216
|
{
|
|
217
|
-
fontSize:
|
|
217
|
+
fontSize: d ?? "sm",
|
|
218
218
|
fontWeight: "semibold",
|
|
219
219
|
whiteSpace: "nowrap",
|
|
220
|
-
children: o(
|
|
220
|
+
children: o(t)
|
|
221
221
|
}
|
|
222
222
|
),
|
|
223
223
|
/* @__PURE__ */ e.jsx(
|
|
224
224
|
M,
|
|
225
225
|
{
|
|
226
|
-
fontSize:
|
|
226
|
+
fontSize: d ?? "sm",
|
|
227
227
|
fontWeight: "semibold",
|
|
228
228
|
whiteSpace: "nowrap",
|
|
229
229
|
children: o(r)
|
|
@@ -244,11 +244,11 @@ const Rn = ({
|
|
|
244
244
|
ut,
|
|
245
245
|
{
|
|
246
246
|
width: "auto",
|
|
247
|
-
size:
|
|
247
|
+
size: d,
|
|
248
248
|
fontWeight: "bold",
|
|
249
249
|
value: k,
|
|
250
250
|
onChange: (T) => Z(!0, T),
|
|
251
|
-
isDisabled:
|
|
251
|
+
isDisabled: N || y,
|
|
252
252
|
children: [
|
|
253
253
|
/* @__PURE__ */ e.jsx("option", { value: -1, children: u[0] }),
|
|
254
254
|
/* @__PURE__ */ e.jsx("option", { value: 1, children: u[1] })
|
|
@@ -259,10 +259,10 @@ const Rn = ({
|
|
|
259
259
|
mt,
|
|
260
260
|
{
|
|
261
261
|
precision: 0,
|
|
262
|
-
size:
|
|
262
|
+
size: d ?? "sm",
|
|
263
263
|
min: 0,
|
|
264
|
-
max: k < 0 ? Math.abs(
|
|
265
|
-
value: L === "" ? "" : Math.abs(Number(L ??
|
|
264
|
+
max: k < 0 ? Math.abs(t) : E ?? r,
|
|
265
|
+
value: L === "" ? "" : Math.abs(Number(L ?? t)),
|
|
266
266
|
onChange: oe,
|
|
267
267
|
onBlur: K,
|
|
268
268
|
borderWidth: 1,
|
|
@@ -283,11 +283,11 @@ const Rn = ({
|
|
|
283
283
|
/* @__PURE__ */ e.jsx(
|
|
284
284
|
mt,
|
|
285
285
|
{
|
|
286
|
-
size:
|
|
286
|
+
size: d ?? "sm",
|
|
287
287
|
min: 0,
|
|
288
|
-
max:
|
|
288
|
+
max: x < 0 ? Math.abs(v ?? t) : r,
|
|
289
289
|
precision: 0,
|
|
290
|
-
value:
|
|
290
|
+
value: f === "" ? "" : Math.abs(Number(f ?? r)),
|
|
291
291
|
onChange: D,
|
|
292
292
|
onBlur: K,
|
|
293
293
|
borderWidth: 1,
|
|
@@ -309,11 +309,11 @@ const Rn = ({
|
|
|
309
309
|
ut,
|
|
310
310
|
{
|
|
311
311
|
width: "auto",
|
|
312
|
-
size:
|
|
312
|
+
size: d,
|
|
313
313
|
fontWeight: "bold",
|
|
314
|
-
value:
|
|
314
|
+
value: x,
|
|
315
315
|
onChange: (T) => Z(!1, T),
|
|
316
|
-
isDisabled:
|
|
316
|
+
isDisabled: N || y,
|
|
317
317
|
children: [
|
|
318
318
|
/* @__PURE__ */ e.jsx("option", { value: -1, children: u[0] }),
|
|
319
319
|
/* @__PURE__ */ e.jsx("option", { value: 1, children: u[1] })
|
|
@@ -324,11 +324,11 @@ const Rn = ({
|
|
|
324
324
|
}
|
|
325
325
|
)
|
|
326
326
|
] });
|
|
327
|
-
}, Gn = ({ tags: s, containerProps:
|
|
327
|
+
}, Gn = ({ tags: s, containerProps: t, ...r }) => /* @__PURE__ */ e.jsx(V, { ...t, children: s.map((p, m) => /* @__PURE__ */ e.jsx(Ge, { ...r, children: p }, m)) }), Fn = new jn({}), Pn = ({
|
|
328
328
|
action: s,
|
|
329
|
-
quantumIconSrc:
|
|
329
|
+
quantumIconSrc: t
|
|
330
330
|
}) => {
|
|
331
|
-
const { getLabel: r } = xe(), p =
|
|
331
|
+
const { getLabel: r } = xe(), p = $(() => ({
|
|
332
332
|
actionLowerCase: r("action").toLocaleLowerCase()
|
|
333
333
|
}), [r]);
|
|
334
334
|
return s.quantumOwned ? /* @__PURE__ */ e.jsx(
|
|
@@ -348,7 +348,7 @@ const Rn = ({
|
|
|
348
348
|
children: /* @__PURE__ */ e.jsx(
|
|
349
349
|
qt,
|
|
350
350
|
{
|
|
351
|
-
src:
|
|
351
|
+
src: t,
|
|
352
352
|
boxSize: "1em",
|
|
353
353
|
alt: `Quantum-owned ${p.actionLowerCase}`
|
|
354
354
|
}
|
|
@@ -357,70 +357,70 @@ const Rn = ({
|
|
|
357
357
|
)
|
|
358
358
|
}
|
|
359
359
|
) : null;
|
|
360
|
-
}, _n = (s,
|
|
361
|
-
if (!
|
|
360
|
+
}, _n = (s, t) => {
|
|
361
|
+
if (!t || !t.trim().length)
|
|
362
362
|
return s;
|
|
363
363
|
const r = s.map((m) => m.name ?? "");
|
|
364
|
-
return Fn.filter(r,
|
|
364
|
+
return Fn.filter(r, t)?.map((m) => s[m]) ?? [];
|
|
365
365
|
}, En = (s) => !s || s.length === 0 ? "None" : s.map(
|
|
366
|
-
(
|
|
366
|
+
(t) => (
|
|
367
367
|
// Convert camelCase to separate words (e.g., 'LeftFoot' -> 'Left Foot')
|
|
368
|
-
|
|
368
|
+
t.replace(/([A-Z])/g, " $1").trim()
|
|
369
369
|
)
|
|
370
|
-
).join(", "), zn = (s,
|
|
371
|
-
(r) => r.useCases?.some((p) =>
|
|
372
|
-
), Bn = (s,
|
|
370
|
+
).join(", "), zn = (s, t) => !t || t.length == 0 ? s : s.filter(
|
|
371
|
+
(r) => r.useCases?.some((p) => t.includes(p.id)) ?? !1
|
|
372
|
+
), Bn = (s, t, r) => !t || t.length === 0 ? s : s.filter((p) => {
|
|
373
373
|
const m = {};
|
|
374
|
-
return
|
|
375
|
-
for (const [
|
|
376
|
-
if (
|
|
377
|
-
m[
|
|
374
|
+
return t.forEach((h) => {
|
|
375
|
+
for (const [d, g] of Object.entries(r || {}))
|
|
376
|
+
if (g.some((n) => n.id === h)) {
|
|
377
|
+
m[d] || (m[d] = []), m[d].push(h);
|
|
378
378
|
break;
|
|
379
379
|
}
|
|
380
380
|
}), Object.entries(m).every(
|
|
381
|
-
([h,
|
|
382
|
-
const
|
|
383
|
-
if (!
|
|
381
|
+
([h, d]) => {
|
|
382
|
+
const g = p.metadataGroups?.find((y) => A(je, y).key === h);
|
|
383
|
+
if (!g)
|
|
384
384
|
return !1;
|
|
385
|
-
const
|
|
385
|
+
const n = A(
|
|
386
386
|
je,
|
|
387
|
-
|
|
387
|
+
g
|
|
388
388
|
), u = A(
|
|
389
389
|
be,
|
|
390
|
-
|
|
390
|
+
n.data
|
|
391
391
|
).map((y) => y.id);
|
|
392
|
-
return
|
|
392
|
+
return d.some(
|
|
393
393
|
(y) => u.includes(y)
|
|
394
394
|
);
|
|
395
395
|
}
|
|
396
396
|
);
|
|
397
397
|
}), Un = ({
|
|
398
398
|
actions: s,
|
|
399
|
-
totalActions:
|
|
399
|
+
totalActions: t,
|
|
400
400
|
onCreate: r,
|
|
401
401
|
onDelete: p,
|
|
402
402
|
onEdit: m,
|
|
403
403
|
onView: h,
|
|
404
|
-
onSelected:
|
|
405
|
-
onDuplicate:
|
|
406
|
-
disableMultiSelect:
|
|
404
|
+
onSelected: d,
|
|
405
|
+
onDuplicate: g,
|
|
406
|
+
disableMultiSelect: n,
|
|
407
407
|
disableDelete: o,
|
|
408
408
|
disableEdit: u,
|
|
409
409
|
disableCreate: y,
|
|
410
|
-
hideUseCase:
|
|
410
|
+
hideUseCase: b = !0,
|
|
411
411
|
showMetadataFilters: w = !0,
|
|
412
412
|
tableProps: I,
|
|
413
413
|
containerProps: L,
|
|
414
|
-
quantumIconSrc:
|
|
415
|
-
allowDuplicateSelection:
|
|
414
|
+
quantumIconSrc: f = "/favicon.ico",
|
|
415
|
+
allowDuplicateSelection: c = !1,
|
|
416
416
|
getSelectedCount: k
|
|
417
417
|
}) => {
|
|
418
|
-
const [
|
|
418
|
+
const [x, N] = q(""), [v, E] = q(), [R, O] = q([]), [K, oe] = q({}), { getLabel: D } = xe(), ae = lt(), Z = $(() => ({
|
|
419
419
|
action: D("action"),
|
|
420
420
|
actionPlural: D("action_plural"),
|
|
421
421
|
actionLowerCase: D("action").toLocaleLowerCase(),
|
|
422
422
|
actionPluralLowerCase: D("action_plural").toLocaleLowerCase()
|
|
423
|
-
}), [D]), T =
|
|
423
|
+
}), [D]), T = $(() => [
|
|
424
424
|
{ key: "module_category", label: "Link Category", multi: !0 },
|
|
425
425
|
{ key: "activity_type", label: `${Z.action} Type`, multi: !0 },
|
|
426
426
|
{ key: "session_type", label: "Session Type", multi: !0 },
|
|
@@ -440,11 +440,11 @@ const Rn = ({
|
|
|
440
440
|
const Q = A(
|
|
441
441
|
je,
|
|
442
442
|
G.data.getMetadataByKey
|
|
443
|
-
),
|
|
443
|
+
), H = A(
|
|
444
444
|
be,
|
|
445
445
|
Q.data
|
|
446
446
|
);
|
|
447
|
-
W[Q.key] =
|
|
447
|
+
W[Q.key] = H.map((re) => ({
|
|
448
448
|
label: re.label || re.value,
|
|
449
449
|
value: re.value,
|
|
450
450
|
id: re.id
|
|
@@ -452,22 +452,22 @@ const Rn = ({
|
|
|
452
452
|
}), oe(W);
|
|
453
453
|
});
|
|
454
454
|
}, [ae, T, w]);
|
|
455
|
-
const B =
|
|
455
|
+
const B = $(() => {
|
|
456
456
|
if (!s)
|
|
457
457
|
return;
|
|
458
|
-
const l = _n(s,
|
|
458
|
+
const l = _n(s, x), S = b ? l : zn(l, v);
|
|
459
459
|
return w ? Bn(
|
|
460
460
|
S,
|
|
461
|
-
|
|
461
|
+
R,
|
|
462
462
|
K
|
|
463
463
|
) : S;
|
|
464
464
|
}, [
|
|
465
465
|
s,
|
|
466
|
-
|
|
466
|
+
x,
|
|
467
467
|
v,
|
|
468
|
-
|
|
468
|
+
b,
|
|
469
469
|
w,
|
|
470
|
-
|
|
470
|
+
R,
|
|
471
471
|
K
|
|
472
472
|
]), J = _(() => {
|
|
473
473
|
if (!p)
|
|
@@ -477,11 +477,11 @@ const Rn = ({
|
|
|
477
477
|
).map((W) => W.id);
|
|
478
478
|
p(S);
|
|
479
479
|
}, [s, p]), U = _(() => {
|
|
480
|
-
if (!
|
|
480
|
+
if (!g)
|
|
481
481
|
return;
|
|
482
482
|
const l = s.filter((S) => S.selected);
|
|
483
|
-
|
|
484
|
-
}, [s,
|
|
483
|
+
g(l.map((S) => S.id)), d && l.forEach((S) => d(S, !1));
|
|
484
|
+
}, [s, g, d]), Y = $(() => s.some((l) => l.selected && !l.quantumOwned), [s]), i = $(() => s.some((l) => l.selected), [s]), a = $(() => s.some((l) => l.selected && l.quantumOwned), [s]), C = _(
|
|
485
485
|
(l, S) => {
|
|
486
486
|
const W = T.find((Q) => Q.key === l);
|
|
487
487
|
if (!W) return;
|
|
@@ -496,7 +496,7 @@ const Rn = ({
|
|
|
496
496
|
);
|
|
497
497
|
return /* @__PURE__ */ e.jsxs(se, { ...L, children: [
|
|
498
498
|
/* @__PURE__ */ e.jsxs(Me, { alignContent: "space-between", gap: 4, children: [
|
|
499
|
-
(r || p ||
|
|
499
|
+
(r || p || g) && /* @__PURE__ */ e.jsxs(Ne, { mb: "1rem", gap: 4, children: [
|
|
500
500
|
r && /* @__PURE__ */ e.jsxs(
|
|
501
501
|
te,
|
|
502
502
|
{
|
|
@@ -510,23 +510,23 @@ const Rn = ({
|
|
|
510
510
|
]
|
|
511
511
|
}
|
|
512
512
|
),
|
|
513
|
-
p && !
|
|
513
|
+
p && !n && /* @__PURE__ */ e.jsx(
|
|
514
514
|
rt,
|
|
515
515
|
{
|
|
516
|
-
label: a ?
|
|
516
|
+
label: a ? Y ? `Quantum-owned ${Z.actionPluralLowerCase} are selected and will be skipped` : `Selected ${Z.actionPluralLowerCase} are quantum-owned and cannot be deleted` : void 0,
|
|
517
517
|
shouldWrapChildren: !0,
|
|
518
518
|
children: /* @__PURE__ */ e.jsx(
|
|
519
519
|
te,
|
|
520
520
|
{
|
|
521
521
|
colorScheme: "gray",
|
|
522
|
-
isDisabled: !
|
|
522
|
+
isDisabled: !Y || !p || o,
|
|
523
523
|
onClick: J,
|
|
524
524
|
children: "Delete Selected"
|
|
525
525
|
}
|
|
526
526
|
)
|
|
527
527
|
}
|
|
528
528
|
),
|
|
529
|
-
|
|
529
|
+
g && !n && /* @__PURE__ */ e.jsx(
|
|
530
530
|
te,
|
|
531
531
|
{
|
|
532
532
|
colorScheme: "gray",
|
|
@@ -539,10 +539,10 @@ const Rn = ({
|
|
|
539
539
|
/* @__PURE__ */ e.jsx(
|
|
540
540
|
Rn,
|
|
541
541
|
{
|
|
542
|
-
setSearch:
|
|
542
|
+
setSearch: N,
|
|
543
543
|
actions: s,
|
|
544
544
|
updateUseCases: E,
|
|
545
|
-
hideUseCaseFilter:
|
|
545
|
+
hideUseCaseFilter: b
|
|
546
546
|
}
|
|
547
547
|
)
|
|
548
548
|
] }),
|
|
@@ -559,7 +559,7 @@ const Rn = ({
|
|
|
559
559
|
},
|
|
560
560
|
isMulti: l.multi,
|
|
561
561
|
value: K[l.key]?.filter(
|
|
562
|
-
(S) =>
|
|
562
|
+
(S) => R.includes(S.id)
|
|
563
563
|
),
|
|
564
564
|
onChange: (S) => {
|
|
565
565
|
C(
|
|
@@ -580,30 +580,30 @@ const Rn = ({
|
|
|
580
580
|
B?.length ?? 0,
|
|
581
581
|
" of",
|
|
582
582
|
" ",
|
|
583
|
-
|
|
583
|
+
t ?? s.length,
|
|
584
584
|
")"
|
|
585
585
|
] }),
|
|
586
586
|
/* @__PURE__ */ e.jsx(De, { children: "Name" }),
|
|
587
587
|
/* @__PURE__ */ e.jsx(De, { children: "Sensor Locations" }),
|
|
588
|
-
!
|
|
588
|
+
!b && /* @__PURE__ */ e.jsx(De, { children: "Use Case" }),
|
|
589
589
|
/* @__PURE__ */ e.jsx(De, {})
|
|
590
590
|
] }) }),
|
|
591
591
|
/* @__PURE__ */ e.jsx(Qt, { children: B?.map((l) => {
|
|
592
|
-
const S =
|
|
592
|
+
const S = c ? k?.(l.id) ?? 0 : 0, W = c ? S > 0 : !!l.selected;
|
|
593
593
|
return /* @__PURE__ */ e.jsxs(
|
|
594
594
|
pt,
|
|
595
595
|
{
|
|
596
596
|
className: Je(
|
|
597
597
|
"hover:bg-[#f7f7f7]",
|
|
598
|
-
!
|
|
598
|
+
!n && !c && "cursor-pointer",
|
|
599
599
|
W && "bg-gray-200"
|
|
600
600
|
),
|
|
601
601
|
onClick: () => {
|
|
602
|
-
|
|
602
|
+
n || c || d?.(l, !l.selected);
|
|
603
603
|
},
|
|
604
604
|
children: [
|
|
605
605
|
/* @__PURE__ */ e.jsx(We, { children: /* @__PURE__ */ e.jsxs(Me, { alignItems: "center", children: [
|
|
606
|
-
!
|
|
606
|
+
!n && c ? /* @__PURE__ */ e.jsxs(
|
|
607
607
|
V,
|
|
608
608
|
{
|
|
609
609
|
spacing: 1,
|
|
@@ -617,7 +617,7 @@ const Rn = ({
|
|
|
617
617
|
size: "xs",
|
|
618
618
|
variant: "outline",
|
|
619
619
|
isDisabled: S === 0,
|
|
620
|
-
onClick: () =>
|
|
620
|
+
onClick: () => d?.(l, !1)
|
|
621
621
|
}
|
|
622
622
|
),
|
|
623
623
|
/* @__PURE__ */ e.jsx(
|
|
@@ -638,12 +638,12 @@ const Rn = ({
|
|
|
638
638
|
size: "xs",
|
|
639
639
|
variant: "outline",
|
|
640
640
|
colorScheme: "blue",
|
|
641
|
-
onClick: () =>
|
|
641
|
+
onClick: () => d?.(l, !0)
|
|
642
642
|
}
|
|
643
643
|
)
|
|
644
644
|
]
|
|
645
645
|
}
|
|
646
|
-
) :
|
|
646
|
+
) : n ? null : /* @__PURE__ */ e.jsx(e.Fragment, { children: l.selected ? /* @__PURE__ */ e.jsx(Cn, { className: "text-blue-500" }) : /* @__PURE__ */ e.jsx(wn, { className: "text-gray-400" }) }),
|
|
647
647
|
(l.quantumOwned || !m) && h && /* @__PURE__ */ e.jsx(
|
|
648
648
|
te,
|
|
649
649
|
{
|
|
@@ -677,13 +677,13 @@ const Rn = ({
|
|
|
677
677
|
Pn,
|
|
678
678
|
{
|
|
679
679
|
action: l,
|
|
680
|
-
quantumIconSrc:
|
|
680
|
+
quantumIconSrc: f
|
|
681
681
|
}
|
|
682
682
|
),
|
|
683
683
|
l.name
|
|
684
684
|
] }) }),
|
|
685
685
|
/* @__PURE__ */ e.jsx(We, { maxW: "20rem", whiteSpace: "break-spaces", children: En(l.sensorLocations) }),
|
|
686
|
-
!
|
|
686
|
+
!b && /* @__PURE__ */ e.jsx(We, { maxW: "20rem", children: /* @__PURE__ */ e.jsx(
|
|
687
687
|
Gn,
|
|
688
688
|
{
|
|
689
689
|
containerProps: { flexWrap: "wrap" },
|
|
@@ -699,30 +699,30 @@ const Rn = ({
|
|
|
699
699
|
] });
|
|
700
700
|
}, bs = ({
|
|
701
701
|
onSave: s,
|
|
702
|
-
onCancel:
|
|
702
|
+
onCancel: t,
|
|
703
703
|
onError: r,
|
|
704
704
|
hideButtons: p = !1,
|
|
705
705
|
setButtonDisabled: m,
|
|
706
706
|
setButtonOnClick: h,
|
|
707
|
-
quantumOwned:
|
|
707
|
+
quantumOwned: d
|
|
708
708
|
}) => {
|
|
709
|
-
const
|
|
710
|
-
singular:
|
|
711
|
-
plural:
|
|
712
|
-
pluralLowerCase:
|
|
713
|
-
singularLowerCase:
|
|
714
|
-
}), [
|
|
709
|
+
const g = wt(), { getLabel: n } = xe(), o = $(() => ({
|
|
710
|
+
singular: n("action"),
|
|
711
|
+
plural: n("action_plural"),
|
|
712
|
+
pluralLowerCase: n("action_plural").toLowerCase(),
|
|
713
|
+
singularLowerCase: n("action").toLowerCase()
|
|
714
|
+
}), [n]), [u, y] = q("copy"), [b, w] = q(""), [I, L] = q([]), [f, c] = q(!1), [k] = Ce({
|
|
715
715
|
query: Lt
|
|
716
|
-
}), [
|
|
716
|
+
}), [x] = Ce({
|
|
717
717
|
query: cn,
|
|
718
|
-
variables: { groupId:
|
|
719
|
-
pause: !
|
|
718
|
+
variables: { groupId: b },
|
|
719
|
+
pause: !b
|
|
720
720
|
// Only run when group is selected
|
|
721
|
-
}), [,
|
|
721
|
+
}), [, N] = fe(it), [, v] = fe(
|
|
722
722
|
kt
|
|
723
|
-
), E =
|
|
723
|
+
), E = $(() => k.data?.groups ? k.data.groups.map(
|
|
724
724
|
(i) => A(Mt, i)
|
|
725
|
-
) : [], [k.data]),
|
|
725
|
+
) : [], [k.data]), R = $(() => x.data ? x.data.actions.map((a) => {
|
|
726
726
|
const C = A(ve, a), l = A(
|
|
727
727
|
Fe,
|
|
728
728
|
C.reports
|
|
@@ -734,7 +734,7 @@ const Rn = ({
|
|
|
734
734
|
C.metadataGroups
|
|
735
735
|
).map((Q) => ({
|
|
736
736
|
...Q,
|
|
737
|
-
data: Q.data.map((
|
|
737
|
+
data: Q.data.map((H) => A(be, H))
|
|
738
738
|
}));
|
|
739
739
|
return {
|
|
740
740
|
...C,
|
|
@@ -746,9 +746,9 @@ const Rn = ({
|
|
|
746
746
|
categories: S,
|
|
747
747
|
metadataGroups: G
|
|
748
748
|
};
|
|
749
|
-
}) : [], [
|
|
749
|
+
}) : [], [x.data]), O = $(() => R.filter(
|
|
750
750
|
(i) => I.includes(i.id)
|
|
751
|
-
), [
|
|
751
|
+
), [R, I]), K = _(
|
|
752
752
|
(i) => {
|
|
753
753
|
const a = i?.value || "";
|
|
754
754
|
w(a), L([]);
|
|
@@ -777,7 +777,7 @@ const Rn = ({
|
|
|
777
777
|
id: void 0
|
|
778
778
|
})),
|
|
779
779
|
categories: i.categories.map((l) => l.id),
|
|
780
|
-
quantumOwned:
|
|
780
|
+
quantumOwned: d,
|
|
781
781
|
metadataItemIds: i.metadataGroups.flatMap((l) => l.data.map((S) => S.id)).filter((l) => l !== void 0),
|
|
782
782
|
reports: i.reports.map((l) => ({
|
|
783
783
|
...l,
|
|
@@ -788,13 +788,13 @@ const Rn = ({
|
|
|
788
788
|
}))
|
|
789
789
|
})),
|
|
790
790
|
id: void 0
|
|
791
|
-
}, C = await
|
|
791
|
+
}, C = await N({ fields: a });
|
|
792
792
|
if (C.error) throw new Error(C.error.message);
|
|
793
793
|
if (C.data?.createAction)
|
|
794
794
|
return A(ve, C.data.createAction);
|
|
795
795
|
throw new Error("No action data returned");
|
|
796
796
|
},
|
|
797
|
-
[
|
|
797
|
+
[N, d]
|
|
798
798
|
), ae = _(
|
|
799
799
|
async (i) => {
|
|
800
800
|
const a = await v({ id: i.id });
|
|
@@ -809,11 +809,11 @@ const Rn = ({
|
|
|
809
809
|
},
|
|
810
810
|
[v]
|
|
811
811
|
), Z = _(async () => {
|
|
812
|
-
if (
|
|
812
|
+
if (c(!0), !O.length) {
|
|
813
813
|
const i = new Error(
|
|
814
814
|
`No ${o.pluralLowerCase} selected for ${u === "copy" ? "copying" : "converting"}`
|
|
815
815
|
);
|
|
816
|
-
r?.(i),
|
|
816
|
+
r?.(i), c(!1);
|
|
817
817
|
return;
|
|
818
818
|
}
|
|
819
819
|
try {
|
|
@@ -832,7 +832,7 @@ const Rn = ({
|
|
|
832
832
|
}
|
|
833
833
|
if (i.length > 0) {
|
|
834
834
|
const S = i.length, W = O.length, G = u === "copy" ? "copied" : "converted", Q = u === "copy" ? "copy" : "convert";
|
|
835
|
-
|
|
835
|
+
g({
|
|
836
836
|
title: a > 0 ? `Partial ${Q} completed` : `${o.plural} ${G} successfully`,
|
|
837
837
|
description: a > 0 ? `${S} of ${W} ${o.pluralLowerCase} ${G} successfully` : `${S} ${S > 1 ? o.pluralLowerCase : o.singularLowerCase} ${G} successfully`,
|
|
838
838
|
status: a > 0 ? "warning" : "success",
|
|
@@ -845,7 +845,7 @@ const Rn = ({
|
|
|
845
845
|
);
|
|
846
846
|
} catch (i) {
|
|
847
847
|
const a = u === "copy" ? "copy" : "convert", C = i instanceof Error ? i.message : `Failed to ${a} ${o.pluralLowerCase}`;
|
|
848
|
-
|
|
848
|
+
g({
|
|
849
849
|
title: `${u === "copy" ? "Copy" : "Convert"} failed`,
|
|
850
850
|
description: C,
|
|
851
851
|
status: "error",
|
|
@@ -853,42 +853,42 @@ const Rn = ({
|
|
|
853
853
|
isClosable: !0
|
|
854
854
|
}), r?.(i instanceof Error ? i : new Error(C));
|
|
855
855
|
} finally {
|
|
856
|
-
|
|
856
|
+
c(!1);
|
|
857
857
|
}
|
|
858
858
|
}, [
|
|
859
859
|
O,
|
|
860
860
|
u,
|
|
861
861
|
D,
|
|
862
862
|
ae,
|
|
863
|
-
|
|
863
|
+
g,
|
|
864
864
|
s,
|
|
865
865
|
r,
|
|
866
866
|
o
|
|
867
867
|
]), T = _(() => {
|
|
868
|
-
w(""), L([]), y("copy"),
|
|
869
|
-
}, [
|
|
868
|
+
w(""), L([]), y("copy"), t?.();
|
|
869
|
+
}, [t]);
|
|
870
870
|
ce(() => {
|
|
871
871
|
m && m({
|
|
872
872
|
cancelButton: !1,
|
|
873
|
-
saveButton: O.length === 0 ||
|
|
873
|
+
saveButton: O.length === 0 || f
|
|
874
874
|
});
|
|
875
|
-
}, [O.length,
|
|
875
|
+
}, [O.length, f, m]), ce(() => {
|
|
876
876
|
h && h({
|
|
877
877
|
cancelButton: T,
|
|
878
878
|
saveButton: Z
|
|
879
879
|
});
|
|
880
880
|
}, [h, T, Z]);
|
|
881
|
-
const B =
|
|
881
|
+
const B = $(() => E.map((i) => ({
|
|
882
882
|
value: i.id,
|
|
883
883
|
label: i.name
|
|
884
|
-
})), [E]), J =
|
|
884
|
+
})), [E]), J = $(() => R.filter((i) => u === "copy" ? !0 : !i.quantumOwned).map((i) => ({
|
|
885
885
|
value: i.id,
|
|
886
886
|
label: i.name,
|
|
887
887
|
// Add custom data to identify quantum-owned actions for UI display
|
|
888
888
|
isQuantumOwned: i.quantumOwned
|
|
889
|
-
})), [
|
|
889
|
+
})), [R, u]), U = k.fetching, Y = x.fetching;
|
|
890
890
|
return /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsxs(ue, { spacing: 6, align: "stretch", children: [
|
|
891
|
-
|
|
891
|
+
d && /* @__PURE__ */ e.jsxs(X, { children: [
|
|
892
892
|
/* @__PURE__ */ e.jsx(ge, { children: "Operation Mode" }),
|
|
893
893
|
/* @__PURE__ */ e.jsx(
|
|
894
894
|
It,
|
|
@@ -933,7 +933,7 @@ const Rn = ({
|
|
|
933
933
|
{
|
|
934
934
|
placeholder: "Choose a group...",
|
|
935
935
|
options: B,
|
|
936
|
-
value: B.find((i) => i.value ===
|
|
936
|
+
value: B.find((i) => i.value === b) || null,
|
|
937
937
|
onChange: K,
|
|
938
938
|
isLoading: U,
|
|
939
939
|
isDisabled: U,
|
|
@@ -948,7 +948,7 @@ const Rn = ({
|
|
|
948
948
|
] })
|
|
949
949
|
] })
|
|
950
950
|
] }),
|
|
951
|
-
|
|
951
|
+
b && /* @__PURE__ */ e.jsxs(X, { children: [
|
|
952
952
|
/* @__PURE__ */ e.jsxs(ge, { children: [
|
|
953
953
|
"Select ",
|
|
954
954
|
o.plural,
|
|
@@ -956,7 +956,7 @@ const Rn = ({
|
|
|
956
956
|
" ",
|
|
957
957
|
u === "copy" ? "Copy" : "Convert"
|
|
958
958
|
] }),
|
|
959
|
-
|
|
959
|
+
Y ? /* @__PURE__ */ e.jsxs(V, { children: [
|
|
960
960
|
/* @__PURE__ */ e.jsx(St, { size: "sm" }),
|
|
961
961
|
/* @__PURE__ */ e.jsxs(M, { fontSize: "sm", color: "gray.600", children: [
|
|
962
962
|
"Loading ",
|
|
@@ -992,14 +992,14 @@ const Rn = ({
|
|
|
992
992
|
" found"
|
|
993
993
|
] })
|
|
994
994
|
] }),
|
|
995
|
-
|
|
995
|
+
x.error && /* @__PURE__ */ e.jsxs(Ve, { status: "error", mt: 2, children: [
|
|
996
996
|
/* @__PURE__ */ e.jsx(et, {}),
|
|
997
997
|
/* @__PURE__ */ e.jsxs(M, { fontSize: "sm", children: [
|
|
998
998
|
"Failed to load ",
|
|
999
999
|
o.pluralLowerCase,
|
|
1000
1000
|
":",
|
|
1001
1001
|
" ",
|
|
1002
|
-
|
|
1002
|
+
x.error.message
|
|
1003
1003
|
] })
|
|
1004
1004
|
] })
|
|
1005
1005
|
] }),
|
|
@@ -1097,7 +1097,7 @@ const Rn = ({
|
|
|
1097
1097
|
{
|
|
1098
1098
|
variant: "outline",
|
|
1099
1099
|
onClick: T,
|
|
1100
|
-
isDisabled:
|
|
1100
|
+
isDisabled: f,
|
|
1101
1101
|
children: "Cancel"
|
|
1102
1102
|
}
|
|
1103
1103
|
),
|
|
@@ -1106,8 +1106,8 @@ const Rn = ({
|
|
|
1106
1106
|
{
|
|
1107
1107
|
colorScheme: u === "copy" ? "blue" : "green",
|
|
1108
1108
|
onClick: Z,
|
|
1109
|
-
isDisabled: O.length === 0 ||
|
|
1110
|
-
isLoading:
|
|
1109
|
+
isDisabled: O.length === 0 || f,
|
|
1110
|
+
isLoading: f,
|
|
1111
1111
|
loadingText: `${u === "copy" ? "Copying" : "Converting"}...`,
|
|
1112
1112
|
children: [
|
|
1113
1113
|
u === "copy" ? "Copy" : "Convert",
|
|
@@ -1120,37 +1120,37 @@ const Rn = ({
|
|
|
1120
1120
|
] }) });
|
|
1121
1121
|
}, ys = ({
|
|
1122
1122
|
onSave: s,
|
|
1123
|
-
onCancel:
|
|
1123
|
+
onCancel: t,
|
|
1124
1124
|
onError: r,
|
|
1125
1125
|
hideButtons: p = !1,
|
|
1126
1126
|
setButtonDisabled: m,
|
|
1127
1127
|
setButtonOnClick: h,
|
|
1128
|
-
quantumOwned:
|
|
1128
|
+
quantumOwned: d
|
|
1129
1129
|
}) => {
|
|
1130
|
-
const
|
|
1131
|
-
singular:
|
|
1132
|
-
plural:
|
|
1133
|
-
pluralLowerCase:
|
|
1134
|
-
singularLowerCase:
|
|
1135
|
-
}), [
|
|
1136
|
-
singular:
|
|
1137
|
-
plural:
|
|
1138
|
-
pluralLowerCase:
|
|
1139
|
-
singularLowerCase:
|
|
1140
|
-
}), [
|
|
1130
|
+
const g = wt(), { getLabel: n } = xe(), o = $(() => ({
|
|
1131
|
+
singular: n("module"),
|
|
1132
|
+
plural: n("module_plural"),
|
|
1133
|
+
pluralLowerCase: n("module_plural").toLowerCase(),
|
|
1134
|
+
singularLowerCase: n("module").toLowerCase()
|
|
1135
|
+
}), [n]), u = $(() => ({
|
|
1136
|
+
singular: n("action"),
|
|
1137
|
+
plural: n("action_plural"),
|
|
1138
|
+
pluralLowerCase: n("action_plural").toLowerCase(),
|
|
1139
|
+
singularLowerCase: n("action").toLowerCase()
|
|
1140
|
+
}), [n]), [y, b] = q(""), [w, I] = q([]), [L, f] = q(!1), [c, k] = q("copy"), [x] = Ce({
|
|
1141
1141
|
query: Lt
|
|
1142
|
-
}), [
|
|
1142
|
+
}), [N] = Ce({
|
|
1143
1143
|
query: dn,
|
|
1144
1144
|
variables: { groupId: y },
|
|
1145
1145
|
pause: !y
|
|
1146
1146
|
// Only run when group is selected
|
|
1147
|
-
}), [, v] = fe(At), [, E] = fe(Ot), [,
|
|
1147
|
+
}), [, v] = fe(At), [, E] = fe(Ot), [, R] = fe(it), [, O] = fe(
|
|
1148
1148
|
kt
|
|
1149
|
-
), K =
|
|
1149
|
+
), K = $(() => x.data?.groups ? x.data.groups.map(
|
|
1150
1150
|
(a) => A(Mt, a)
|
|
1151
|
-
) : [], [
|
|
1151
|
+
) : [], [x.data]), oe = $(() => N.data?.modules ? A(
|
|
1152
1152
|
Ye,
|
|
1153
|
-
|
|
1153
|
+
N.data?.modules
|
|
1154
1154
|
).map((C) => {
|
|
1155
1155
|
const l = A(
|
|
1156
1156
|
Tt,
|
|
@@ -1171,12 +1171,12 @@ const Rn = ({
|
|
|
1171
1171
|
),
|
|
1172
1172
|
metadataItems: W
|
|
1173
1173
|
};
|
|
1174
|
-
}) : [], [
|
|
1174
|
+
}) : [], [N.data]), D = $(() => oe.filter(
|
|
1175
1175
|
(a) => w.includes(a.id)
|
|
1176
1176
|
), [oe, w]), ae = _(
|
|
1177
1177
|
(a) => {
|
|
1178
1178
|
const C = a?.value || "";
|
|
1179
|
-
|
|
1179
|
+
b(C), I([]);
|
|
1180
1180
|
},
|
|
1181
1181
|
[]
|
|
1182
1182
|
), Z = _(
|
|
@@ -1186,10 +1186,10 @@ const Rn = ({
|
|
|
1186
1186
|
},
|
|
1187
1187
|
[]
|
|
1188
1188
|
), T = _(async () => {
|
|
1189
|
-
if (
|
|
1190
|
-
|
|
1189
|
+
if (f(!0), !D.length) {
|
|
1190
|
+
f(!1);
|
|
1191
1191
|
const a = new Error(
|
|
1192
|
-
`No modules selected for ${
|
|
1192
|
+
`No modules selected for ${c === "convert" ? "converting" : "copying"}`
|
|
1193
1193
|
);
|
|
1194
1194
|
r?.(a);
|
|
1195
1195
|
return;
|
|
@@ -1200,22 +1200,22 @@ const Rn = ({
|
|
|
1200
1200
|
for (const l of D)
|
|
1201
1201
|
try {
|
|
1202
1202
|
let S = l.moduleActions.map((W) => W.actionId);
|
|
1203
|
-
if (
|
|
1204
|
-
const W = l.moduleActions.map((
|
|
1205
|
-
if (
|
|
1206
|
-
if (
|
|
1203
|
+
if (d) {
|
|
1204
|
+
const W = l.moduleActions.map((H) => H.action), G = async (H) => {
|
|
1205
|
+
if (c === "copy") {
|
|
1206
|
+
if (H.quantumOwned) return H;
|
|
1207
1207
|
const we = A(
|
|
1208
1208
|
Pe,
|
|
1209
|
-
|
|
1209
|
+
H.categories
|
|
1210
1210
|
), Se = A(
|
|
1211
1211
|
je,
|
|
1212
|
-
|
|
1212
|
+
H.metadataGroups
|
|
1213
1213
|
).map((pe) => A(
|
|
1214
1214
|
be,
|
|
1215
1215
|
pe.data
|
|
1216
1216
|
).map(($e) => $e.id)).flat(), Be = A(
|
|
1217
1217
|
Fe,
|
|
1218
|
-
|
|
1218
|
+
H.reports
|
|
1219
1219
|
).map((pe) => ({
|
|
1220
1220
|
...pe,
|
|
1221
1221
|
id: void 0,
|
|
@@ -1228,27 +1228,27 @@ const Rn = ({
|
|
|
1228
1228
|
}))
|
|
1229
1229
|
})), tt = A(
|
|
1230
1230
|
Te,
|
|
1231
|
-
|
|
1231
|
+
H.thresholds
|
|
1232
1232
|
).map((pe) => ({
|
|
1233
1233
|
...pe,
|
|
1234
1234
|
id: void 0
|
|
1235
1235
|
})), Re = {
|
|
1236
|
-
...
|
|
1236
|
+
...H,
|
|
1237
1237
|
quantumOwned: !0,
|
|
1238
1238
|
thresholds: tt,
|
|
1239
1239
|
categories: we?.map((pe) => pe.id),
|
|
1240
1240
|
reports: Be,
|
|
1241
1241
|
metadataIds: Se,
|
|
1242
1242
|
id: void 0
|
|
1243
|
-
}, Le = await
|
|
1243
|
+
}, Le = await R({ fields: Re });
|
|
1244
1244
|
return Le.error || !Le.data?.createAction ? null : A(
|
|
1245
1245
|
ve,
|
|
1246
1246
|
Le.data.createAction
|
|
1247
1247
|
);
|
|
1248
1248
|
}
|
|
1249
|
-
if (
|
|
1249
|
+
if (H.quantumOwned) return H;
|
|
1250
1250
|
const re = await O({
|
|
1251
|
-
id:
|
|
1251
|
+
id: H.id
|
|
1252
1252
|
});
|
|
1253
1253
|
return re.error || !re.data?.convertActionToQuantumOwned ? null : A(
|
|
1254
1254
|
ve,
|
|
@@ -1257,9 +1257,9 @@ const Rn = ({
|
|
|
1257
1257
|
};
|
|
1258
1258
|
S = (await Promise.all(
|
|
1259
1259
|
W.map(G)
|
|
1260
|
-
)).filter((
|
|
1260
|
+
)).filter((H) => !!H?.id).map((H) => H.id);
|
|
1261
1261
|
}
|
|
1262
|
-
if (
|
|
1262
|
+
if (c === "convert") {
|
|
1263
1263
|
const W = {
|
|
1264
1264
|
name: l.name,
|
|
1265
1265
|
description: l.description || void 0,
|
|
@@ -1287,7 +1287,7 @@ const Rn = ({
|
|
|
1287
1287
|
reportId: Q.reportId ?? void 0
|
|
1288
1288
|
})),
|
|
1289
1289
|
categories: l.categories.map((Q) => Q.id),
|
|
1290
|
-
quantumOwned:
|
|
1290
|
+
quantumOwned: d,
|
|
1291
1291
|
metadataItemIds: l.metadataItems.map((Q) => Q.id)
|
|
1292
1292
|
}, G = await v({ input: W });
|
|
1293
1293
|
if (G.error) throw new Error(G.error.message);
|
|
@@ -1301,50 +1301,50 @@ const Rn = ({
|
|
|
1301
1301
|
}
|
|
1302
1302
|
} catch (S) {
|
|
1303
1303
|
console.error(
|
|
1304
|
-
`Failed to ${
|
|
1304
|
+
`Failed to ${c === "convert" ? "convert" : "copy"} module "${l.name}":`,
|
|
1305
1305
|
S
|
|
1306
1306
|
), C++;
|
|
1307
1307
|
}
|
|
1308
1308
|
if (a.length > 0) {
|
|
1309
1309
|
const l = a.length, S = D.length;
|
|
1310
|
-
|
|
1311
|
-
title: C > 0 ? `Partial ${
|
|
1312
|
-
description: C > 0 ? `${l} of ${S} ${o.plural} ${
|
|
1310
|
+
g({
|
|
1311
|
+
title: C > 0 ? `Partial ${c === "convert" ? "convert" : "copy"} completed` : `${o.plural} ${c === "convert" ? "converted" : "copied"} successfully`,
|
|
1312
|
+
description: C > 0 ? `${l} of ${S} ${o.plural} ${c === "convert" ? "converted" : "copied"} successfully` : `${l} ${l > 1 ? o.plural : o.singular} ${c === "convert" ? "converted" : "copied"} successfully`,
|
|
1313
1313
|
status: C > 0 ? "warning" : "success",
|
|
1314
1314
|
duration: 3e3,
|
|
1315
1315
|
isClosable: !0
|
|
1316
|
-
}), a.length > 0 && s?.(),
|
|
1316
|
+
}), a.length > 0 && s?.(), b(""), I([]);
|
|
1317
1317
|
} else
|
|
1318
1318
|
throw new Error(
|
|
1319
|
-
`Failed to ${
|
|
1319
|
+
`Failed to ${c === "convert" ? "convert" : "copy"} any modules`
|
|
1320
1320
|
);
|
|
1321
1321
|
} catch (a) {
|
|
1322
|
-
const C = a instanceof Error ? a.message : `Failed to ${
|
|
1323
|
-
|
|
1324
|
-
title:
|
|
1322
|
+
const C = a instanceof Error ? a.message : `Failed to ${c === "convert" ? "convert" : "copy"} modules`;
|
|
1323
|
+
g({
|
|
1324
|
+
title: c === "convert" ? "Convert failed" : "Copy failed",
|
|
1325
1325
|
description: C,
|
|
1326
1326
|
status: "error",
|
|
1327
1327
|
duration: 5e3,
|
|
1328
1328
|
isClosable: !0
|
|
1329
1329
|
}), r?.(a instanceof Error ? a : new Error(C));
|
|
1330
1330
|
} finally {
|
|
1331
|
-
|
|
1331
|
+
f(!1);
|
|
1332
1332
|
}
|
|
1333
1333
|
}, [
|
|
1334
1334
|
D,
|
|
1335
1335
|
v,
|
|
1336
1336
|
E,
|
|
1337
|
-
|
|
1337
|
+
g,
|
|
1338
1338
|
s,
|
|
1339
1339
|
r,
|
|
1340
|
-
c,
|
|
1341
|
-
$,
|
|
1342
|
-
O,
|
|
1343
1340
|
d,
|
|
1341
|
+
R,
|
|
1342
|
+
O,
|
|
1343
|
+
c,
|
|
1344
1344
|
o
|
|
1345
1345
|
]), B = _(() => {
|
|
1346
|
-
|
|
1347
|
-
}, [
|
|
1346
|
+
b(""), I([]), k("copy"), t?.();
|
|
1347
|
+
}, [t]);
|
|
1348
1348
|
ce(() => {
|
|
1349
1349
|
m && m({
|
|
1350
1350
|
cancelButton: !1,
|
|
@@ -1356,22 +1356,22 @@ const Rn = ({
|
|
|
1356
1356
|
saveButton: T
|
|
1357
1357
|
});
|
|
1358
1358
|
}, [h, B, T]);
|
|
1359
|
-
const J =
|
|
1359
|
+
const J = $(() => K.map((a) => ({
|
|
1360
1360
|
value: a.id,
|
|
1361
1361
|
label: a.name
|
|
1362
|
-
})), [K]), U =
|
|
1362
|
+
})), [K]), U = $(() => oe.filter((a) => c === "copy" ? !0 : !a.quantumOwned).map((a) => ({
|
|
1363
1363
|
value: a.id,
|
|
1364
1364
|
label: a.name,
|
|
1365
1365
|
// Add custom data to identify quantum-owned modules
|
|
1366
1366
|
isQuantumOwned: a.quantumOwned
|
|
1367
|
-
})), [oe,
|
|
1367
|
+
})), [oe, c]), Y = x.fetching, i = N.fetching;
|
|
1368
1368
|
return /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsxs(ue, { spacing: 6, align: "stretch", children: [
|
|
1369
|
-
|
|
1369
|
+
d && /* @__PURE__ */ e.jsxs(X, { children: [
|
|
1370
1370
|
/* @__PURE__ */ e.jsx(ge, { children: "Operation Mode" }),
|
|
1371
1371
|
/* @__PURE__ */ e.jsx(
|
|
1372
1372
|
It,
|
|
1373
1373
|
{
|
|
1374
|
-
value:
|
|
1374
|
+
value: c,
|
|
1375
1375
|
onChange: (a) => {
|
|
1376
1376
|
k(a), I([]);
|
|
1377
1377
|
},
|
|
@@ -1408,21 +1408,21 @@ const Rn = ({
|
|
|
1408
1408
|
options: J,
|
|
1409
1409
|
value: J.find((a) => a.value === y) || null,
|
|
1410
1410
|
onChange: ae,
|
|
1411
|
-
isLoading:
|
|
1412
|
-
isDisabled:
|
|
1411
|
+
isLoading: Y,
|
|
1412
|
+
isDisabled: Y,
|
|
1413
1413
|
isClearable: !0
|
|
1414
1414
|
}
|
|
1415
1415
|
),
|
|
1416
|
-
|
|
1416
|
+
x.error && /* @__PURE__ */ e.jsxs(Ve, { status: "error", mt: 2, children: [
|
|
1417
1417
|
/* @__PURE__ */ e.jsx(et, {}),
|
|
1418
1418
|
/* @__PURE__ */ e.jsxs(M, { fontSize: "sm", children: [
|
|
1419
1419
|
"Failed to load groups: ",
|
|
1420
|
-
|
|
1420
|
+
x.error.message
|
|
1421
1421
|
] })
|
|
1422
1422
|
] })
|
|
1423
1423
|
] }),
|
|
1424
1424
|
y && /* @__PURE__ */ e.jsxs(X, { children: [
|
|
1425
|
-
/* @__PURE__ */ e.jsx(ge, { children:
|
|
1425
|
+
/* @__PURE__ */ e.jsx(ge, { children: c === "convert" ? `Select ${o.plural} to Convert` : `Select ${o.plural} to Copy` }),
|
|
1426
1426
|
i ? /* @__PURE__ */ e.jsxs(V, { children: [
|
|
1427
1427
|
/* @__PURE__ */ e.jsx(St, { size: "sm" }),
|
|
1428
1428
|
/* @__PURE__ */ e.jsxs(M, { fontSize: "sm", color: "gray.600", children: [
|
|
@@ -1434,7 +1434,7 @@ const Rn = ({
|
|
|
1434
1434
|
/* @__PURE__ */ e.jsx(
|
|
1435
1435
|
he,
|
|
1436
1436
|
{
|
|
1437
|
-
placeholder:
|
|
1437
|
+
placeholder: c === "convert" ? `Choose ${o.pluralLowerCase} to convert...` : `Choose ${o.pluralLowerCase} to copy...`,
|
|
1438
1438
|
options: U,
|
|
1439
1439
|
value: U.filter(
|
|
1440
1440
|
(a) => w.includes(a.value)
|
|
@@ -1459,19 +1459,19 @@ const Rn = ({
|
|
|
1459
1459
|
" found in this group"
|
|
1460
1460
|
] })
|
|
1461
1461
|
] }),
|
|
1462
|
-
|
|
1462
|
+
N.error && /* @__PURE__ */ e.jsxs(Ve, { status: "error", mt: 2, children: [
|
|
1463
1463
|
/* @__PURE__ */ e.jsx(et, {}),
|
|
1464
1464
|
/* @__PURE__ */ e.jsxs(M, { fontSize: "sm", children: [
|
|
1465
1465
|
"Failed to load ",
|
|
1466
1466
|
o.pluralLowerCase,
|
|
1467
1467
|
":",
|
|
1468
1468
|
" ",
|
|
1469
|
-
|
|
1469
|
+
N.error.message
|
|
1470
1470
|
] })
|
|
1471
1471
|
] })
|
|
1472
1472
|
] }),
|
|
1473
1473
|
D.length > 0 && /* @__PURE__ */ e.jsxs(se, { p: 4, bg: "gray.50", borderRadius: "md", children: [
|
|
1474
|
-
/* @__PURE__ */ e.jsx(M, { fontWeight: "semibold", mb: 3, children: D.length === 1 ? `${o.singular} to ${
|
|
1474
|
+
/* @__PURE__ */ e.jsx(M, { fontWeight: "semibold", mb: 3, children: D.length === 1 ? `${o.singular} to ${c === "copy" ? "Copy" : "Convert"}` : `${D.length} ${o.plural} to ${c === "copy" ? "Copy" : "Convert"}` }),
|
|
1475
1475
|
/* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 3, children: [
|
|
1476
1476
|
D.map((a, C) => /* @__PURE__ */ e.jsxs(
|
|
1477
1477
|
se,
|
|
@@ -1537,11 +1537,11 @@ const Rn = ({
|
|
|
1537
1537
|
o.pluralLowerCase,
|
|
1538
1538
|
" will be",
|
|
1539
1539
|
" ",
|
|
1540
|
-
|
|
1540
|
+
c === "copy" ? "copied" : "converted"
|
|
1541
1541
|
] })
|
|
1542
1542
|
}
|
|
1543
1543
|
),
|
|
1544
|
-
|
|
1544
|
+
d && D.filter((a) => a.moduleActions.some((C) => !C.action.quantumOwned)).length > 0 && /* @__PURE__ */ e.jsx(
|
|
1545
1545
|
se,
|
|
1546
1546
|
{
|
|
1547
1547
|
p: 2,
|
|
@@ -1549,7 +1549,7 @@ const Rn = ({
|
|
|
1549
1549
|
borderRadius: "md",
|
|
1550
1550
|
border: "1px solid",
|
|
1551
1551
|
borderColor: "yellow.200",
|
|
1552
|
-
children: /* @__PURE__ */ e.jsx(M, { fontSize: "sm", fontWeight: "medium", color: "yellow.800", children:
|
|
1552
|
+
children: /* @__PURE__ */ e.jsx(M, { fontSize: "sm", fontWeight: "medium", color: "yellow.800", children: c === "convert" ? `Converting ${o.plural} will convert non QM-Owned ${u.plural} to QM-Owned ${u.plural}` : `Copying ${o.plural} with Non QM-Owned ${u.plural} will create corresponding QM-Owned ${u.plural}` })
|
|
1553
1553
|
}
|
|
1554
1554
|
)
|
|
1555
1555
|
] })
|
|
@@ -1567,13 +1567,13 @@ const Rn = ({
|
|
|
1567
1567
|
/* @__PURE__ */ e.jsxs(
|
|
1568
1568
|
te,
|
|
1569
1569
|
{
|
|
1570
|
-
colorScheme:
|
|
1570
|
+
colorScheme: c === "copy" ? "blue" : "green",
|
|
1571
1571
|
onClick: T,
|
|
1572
1572
|
isDisabled: D.length === 0 || L,
|
|
1573
1573
|
isLoading: L,
|
|
1574
|
-
loadingText: `${
|
|
1574
|
+
loadingText: `${c === "copy" ? "Copying" : "Converting"}...`,
|
|
1575
1575
|
children: [
|
|
1576
|
-
|
|
1576
|
+
c === "copy" ? "Copy" : "Convert",
|
|
1577
1577
|
" ",
|
|
1578
1578
|
D.length === 1 ? o.singular : `${D.length} ${o.plural}`
|
|
1579
1579
|
]
|
|
@@ -1590,20 +1590,20 @@ const Rn = ({
|
|
|
1590
1590
|
return s;
|
|
1591
1591
|
}, Wn = ({
|
|
1592
1592
|
name: s,
|
|
1593
|
-
setName:
|
|
1593
|
+
setName: t,
|
|
1594
1594
|
actions: r,
|
|
1595
1595
|
moduleActionEntries: p,
|
|
1596
1596
|
setModuleActionEntries: m,
|
|
1597
1597
|
availableCategories: h,
|
|
1598
|
-
selectedCategoryIds:
|
|
1599
|
-
setSelectedCategoryIds:
|
|
1600
|
-
description:
|
|
1598
|
+
selectedCategoryIds: d,
|
|
1599
|
+
setSelectedCategoryIds: g,
|
|
1600
|
+
description: n,
|
|
1601
1601
|
setDescription: o,
|
|
1602
1602
|
selectedMetadataIds: u,
|
|
1603
1603
|
setSelectedMetadataIds: y,
|
|
1604
|
-
...
|
|
1604
|
+
...b
|
|
1605
1605
|
}) => {
|
|
1606
|
-
const w = Kt(), I =
|
|
1606
|
+
const w = Kt(), I = $(() => {
|
|
1607
1607
|
const v = {};
|
|
1608
1608
|
return p.forEach((E) => {
|
|
1609
1609
|
v[E.actionId] = (v[E.actionId] ?? 0) + 1;
|
|
@@ -1611,57 +1611,57 @@ const Rn = ({
|
|
|
1611
1611
|
}, [p]), L = _(
|
|
1612
1612
|
(v) => I[v] ?? 0,
|
|
1613
1613
|
[I]
|
|
1614
|
-
),
|
|
1614
|
+
), f = $(() => r.map((v) => ({
|
|
1615
1615
|
...v,
|
|
1616
1616
|
selected: (I[v.id] ?? 0) > 0
|
|
1617
|
-
})), [r, I]),
|
|
1617
|
+
})), [r, I]), c = $(() => r.reduce((v, E) => (v[E.id] = E, v), {}), [r]), k = _(
|
|
1618
1618
|
(v, E) => {
|
|
1619
1619
|
if (E) {
|
|
1620
|
-
const
|
|
1620
|
+
const R = {
|
|
1621
1621
|
key: crypto.randomUUID(),
|
|
1622
1622
|
actionId: v.id,
|
|
1623
1623
|
reportId: null
|
|
1624
1624
|
};
|
|
1625
|
-
m((O) => [...O,
|
|
1625
|
+
m((O) => [...O, R]);
|
|
1626
1626
|
} else
|
|
1627
|
-
m((
|
|
1628
|
-
for (let O =
|
|
1629
|
-
if (
|
|
1630
|
-
const K = [
|
|
1627
|
+
m((R) => {
|
|
1628
|
+
for (let O = R.length - 1; O >= 0; O--)
|
|
1629
|
+
if (R[O].actionId === v.id) {
|
|
1630
|
+
const K = [...R];
|
|
1631
1631
|
return K.splice(O, 1), K;
|
|
1632
1632
|
}
|
|
1633
|
-
return
|
|
1633
|
+
return R;
|
|
1634
1634
|
});
|
|
1635
1635
|
},
|
|
1636
1636
|
[m]
|
|
1637
|
-
),
|
|
1637
|
+
), x = _(
|
|
1638
1638
|
(v) => {
|
|
1639
|
-
|
|
1639
|
+
t(v.target.value);
|
|
1640
1640
|
},
|
|
1641
|
-
[
|
|
1642
|
-
),
|
|
1641
|
+
[t]
|
|
1642
|
+
), N = _(
|
|
1643
1643
|
(v) => {
|
|
1644
1644
|
o?.(v.target.value);
|
|
1645
1645
|
},
|
|
1646
1646
|
[o]
|
|
1647
1647
|
);
|
|
1648
|
-
return /* @__PURE__ */ e.jsxs(se, { ...
|
|
1648
|
+
return /* @__PURE__ */ e.jsxs(se, { ...b, children: [
|
|
1649
1649
|
/* @__PURE__ */ e.jsxs(V, { gap: "2rem", children: [
|
|
1650
|
-
/* @__PURE__ */ e.jsx(Qn, { name: s ?? "", onInputChange:
|
|
1650
|
+
/* @__PURE__ */ e.jsx(Qn, { name: s ?? "", onInputChange: x }),
|
|
1651
1651
|
/* @__PURE__ */ e.jsx(
|
|
1652
1652
|
qn,
|
|
1653
1653
|
{
|
|
1654
1654
|
availableCategories: h,
|
|
1655
|
-
value:
|
|
1656
|
-
onChange:
|
|
1655
|
+
value: d,
|
|
1656
|
+
onChange: g
|
|
1657
1657
|
}
|
|
1658
1658
|
)
|
|
1659
1659
|
] }),
|
|
1660
1660
|
/* @__PURE__ */ e.jsx(
|
|
1661
1661
|
Kn,
|
|
1662
1662
|
{
|
|
1663
|
-
description:
|
|
1664
|
-
onInputChange:
|
|
1663
|
+
description: n ?? "",
|
|
1664
|
+
onInputChange: N
|
|
1665
1665
|
}
|
|
1666
1666
|
),
|
|
1667
1667
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1676,7 +1676,7 @@ const Rn = ({
|
|
|
1676
1676
|
{
|
|
1677
1677
|
moduleActionEntries: p,
|
|
1678
1678
|
setModuleActionEntries: m,
|
|
1679
|
-
actionsById:
|
|
1679
|
+
actionsById: c,
|
|
1680
1680
|
onAdjustActivities: () => w.onOpen()
|
|
1681
1681
|
}
|
|
1682
1682
|
),
|
|
@@ -1694,7 +1694,7 @@ const Rn = ({
|
|
|
1694
1694
|
/* @__PURE__ */ e.jsx(Vt, { children: /* @__PURE__ */ e.jsx(
|
|
1695
1695
|
Un,
|
|
1696
1696
|
{
|
|
1697
|
-
actions:
|
|
1697
|
+
actions: f,
|
|
1698
1698
|
onSelected: k,
|
|
1699
1699
|
allowDuplicateSelection: !0,
|
|
1700
1700
|
getSelectedCount: L,
|
|
@@ -1723,7 +1723,7 @@ const Rn = ({
|
|
|
1723
1723
|
}, Qn = Ae(
|
|
1724
1724
|
({
|
|
1725
1725
|
name: s,
|
|
1726
|
-
onInputChange:
|
|
1726
|
+
onInputChange: t
|
|
1727
1727
|
}) => {
|
|
1728
1728
|
const { getLabel: r } = xe(), p = r("module"), { isView: m } = Ee();
|
|
1729
1729
|
return /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
|
|
@@ -1736,7 +1736,7 @@ const Rn = ({
|
|
|
1736
1736
|
{
|
|
1737
1737
|
placeholder: "i.e. ACL RTP Test Battery",
|
|
1738
1738
|
value: s,
|
|
1739
|
-
onChange:
|
|
1739
|
+
onChange: t,
|
|
1740
1740
|
isRequired: !0,
|
|
1741
1741
|
isDisabled: m
|
|
1742
1742
|
}
|
|
@@ -1746,19 +1746,13 @@ const Rn = ({
|
|
|
1746
1746
|
), qn = Ae(
|
|
1747
1747
|
({
|
|
1748
1748
|
availableCategories: s,
|
|
1749
|
-
value:
|
|
1749
|
+
value: t,
|
|
1750
1750
|
onChange: r
|
|
1751
1751
|
}) => {
|
|
1752
|
-
const { getLabel: p } = xe(), m = p("module"), { isView: h } = Ee(),
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
name: "Other"
|
|
1757
|
-
}
|
|
1758
|
-
], [s]), b = N(() => c.map((t) => ({
|
|
1759
|
-
value: t.id,
|
|
1760
|
-
label: t.name
|
|
1761
|
-
})), [c]);
|
|
1752
|
+
const { getLabel: p } = xe(), m = p("module"), { isView: h } = Ee(), d = $(() => s.map((g) => ({
|
|
1753
|
+
value: g.id,
|
|
1754
|
+
label: g.name
|
|
1755
|
+
})), [s]);
|
|
1762
1756
|
return /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
|
|
1763
1757
|
/* @__PURE__ */ e.jsxs(ge, { children: [
|
|
1764
1758
|
m,
|
|
@@ -1768,12 +1762,12 @@ const Rn = ({
|
|
|
1768
1762
|
he,
|
|
1769
1763
|
{
|
|
1770
1764
|
isDisabled: s.length === 0 || h,
|
|
1771
|
-
options:
|
|
1772
|
-
value:
|
|
1773
|
-
value:
|
|
1774
|
-
label:
|
|
1775
|
-
}))[0],
|
|
1776
|
-
onChange: (
|
|
1765
|
+
options: d,
|
|
1766
|
+
value: s.filter((g) => t.includes(g.id)).map((g) => ({
|
|
1767
|
+
value: g.id,
|
|
1768
|
+
label: g.name
|
|
1769
|
+
}))[0] ?? null,
|
|
1770
|
+
onChange: (g) => r(g ? [g.value] : []),
|
|
1777
1771
|
placeholder: "Select category"
|
|
1778
1772
|
}
|
|
1779
1773
|
)
|
|
@@ -1782,7 +1776,7 @@ const Rn = ({
|
|
|
1782
1776
|
), Kn = Ae(
|
|
1783
1777
|
({
|
|
1784
1778
|
description: s,
|
|
1785
|
-
onInputChange:
|
|
1779
|
+
onInputChange: t
|
|
1786
1780
|
}) => {
|
|
1787
1781
|
const { getLabel: r } = xe(), p = r("module"), { isView: m } = Ee();
|
|
1788
1782
|
return /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
|
|
@@ -1800,7 +1794,7 @@ const Rn = ({
|
|
|
1800
1794
|
{
|
|
1801
1795
|
placeholder: "i.e. Assess readiness to return to play post-ACL reconstruction",
|
|
1802
1796
|
value: s,
|
|
1803
|
-
onChange:
|
|
1797
|
+
onChange: t,
|
|
1804
1798
|
isDisabled: m
|
|
1805
1799
|
}
|
|
1806
1800
|
)
|
|
@@ -1809,25 +1803,25 @@ const Rn = ({
|
|
|
1809
1803
|
), Hn = Ae(
|
|
1810
1804
|
({
|
|
1811
1805
|
moduleActionEntries: s,
|
|
1812
|
-
setModuleActionEntries:
|
|
1806
|
+
setModuleActionEntries: t,
|
|
1813
1807
|
actionsById: r,
|
|
1814
1808
|
onAdjustActivities: p
|
|
1815
1809
|
}) => {
|
|
1816
|
-
const { getLabel: m } = xe(), { isView: h } = Ee(),
|
|
1810
|
+
const { getLabel: m } = xe(), { isView: h } = Ee(), d = $(() => ({
|
|
1817
1811
|
module: m("module"),
|
|
1818
1812
|
moduleLowerCase: m("module").toLocaleLowerCase(),
|
|
1819
1813
|
action: m("action"),
|
|
1820
1814
|
actionPlural: m("action_plural"),
|
|
1821
1815
|
actionPluralLowerCase: m("action_plural").toLocaleLowerCase()
|
|
1822
|
-
}), [m]),
|
|
1823
|
-
() => s.map((
|
|
1824
|
-
const o = r[
|
|
1816
|
+
}), [m]), g = $(
|
|
1817
|
+
() => s.map((n) => {
|
|
1818
|
+
const o = r[n.actionId];
|
|
1825
1819
|
return o ? {
|
|
1826
|
-
key:
|
|
1827
|
-
actionId:
|
|
1820
|
+
key: n.key,
|
|
1821
|
+
actionId: n.actionId,
|
|
1828
1822
|
name: o.name,
|
|
1829
1823
|
reports: A(Fe, o.reports) || [],
|
|
1830
|
-
selectedReportId:
|
|
1824
|
+
selectedReportId: n.reportId
|
|
1831
1825
|
} : null;
|
|
1832
1826
|
}).filter(Boolean),
|
|
1833
1827
|
[s, r]
|
|
@@ -1835,13 +1829,13 @@ const Rn = ({
|
|
|
1835
1829
|
return /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
|
|
1836
1830
|
/* @__PURE__ */ e.jsxs(V, { justifyContent: "space-between", children: [
|
|
1837
1831
|
/* @__PURE__ */ e.jsx(ge, { children: /* @__PURE__ */ e.jsxs("span", { children: [
|
|
1838
|
-
|
|
1832
|
+
d.actionPlural,
|
|
1839
1833
|
!h && /* @__PURE__ */ e.jsxs(M, { fontSize: "sm", color: "gray.500", children: [
|
|
1840
1834
|
"Drag and drop to reorder the ",
|
|
1841
|
-
|
|
1835
|
+
d.actionPluralLowerCase,
|
|
1842
1836
|
" ",
|
|
1843
1837
|
"in this ",
|
|
1844
|
-
|
|
1838
|
+
d.moduleLowerCase,
|
|
1845
1839
|
"."
|
|
1846
1840
|
] })
|
|
1847
1841
|
] }) }),
|
|
@@ -1854,17 +1848,17 @@ const Rn = ({
|
|
|
1854
1848
|
onClick: p,
|
|
1855
1849
|
children: [
|
|
1856
1850
|
"Add / Remove ",
|
|
1857
|
-
|
|
1851
|
+
d.actionPlural
|
|
1858
1852
|
]
|
|
1859
1853
|
}
|
|
1860
1854
|
)
|
|
1861
1855
|
] }),
|
|
1862
|
-
|
|
1856
|
+
g.length === 0 ? /* @__PURE__ */ e.jsx(ue, { children: /* @__PURE__ */ e.jsxs(M, { color: "gray.500", fontSize: "lg", mb: "4rem", mt: "4rem", children: [
|
|
1863
1857
|
"No ",
|
|
1864
|
-
|
|
1858
|
+
d.actionPluralLowerCase,
|
|
1865
1859
|
" selected for this",
|
|
1866
1860
|
" ",
|
|
1867
|
-
|
|
1861
|
+
d.moduleLowerCase,
|
|
1868
1862
|
".",
|
|
1869
1863
|
!h && /* @__PURE__ */ e.jsxs(
|
|
1870
1864
|
te,
|
|
@@ -1876,7 +1870,7 @@ const Rn = ({
|
|
|
1876
1870
|
onClick: p,
|
|
1877
1871
|
children: [
|
|
1878
1872
|
"Add ",
|
|
1879
|
-
|
|
1873
|
+
d.actionPluralLowerCase,
|
|
1880
1874
|
"."
|
|
1881
1875
|
]
|
|
1882
1876
|
}
|
|
@@ -1884,28 +1878,28 @@ const Rn = ({
|
|
|
1884
1878
|
] }) }) : /* @__PURE__ */ e.jsx(
|
|
1885
1879
|
Yn,
|
|
1886
1880
|
{
|
|
1887
|
-
value:
|
|
1888
|
-
onChange: (
|
|
1889
|
-
|
|
1890
|
-
const u = o.map((
|
|
1891
|
-
const w = r[
|
|
1881
|
+
value: g,
|
|
1882
|
+
onChange: (n) => {
|
|
1883
|
+
t((o) => {
|
|
1884
|
+
const u = o.map((b) => {
|
|
1885
|
+
const w = r[b.actionId];
|
|
1892
1886
|
return w ? {
|
|
1893
|
-
key:
|
|
1894
|
-
actionId:
|
|
1887
|
+
key: b.key,
|
|
1888
|
+
actionId: b.actionId,
|
|
1895
1889
|
name: w.name,
|
|
1896
1890
|
reports: A(Fe, w.reports) || [],
|
|
1897
|
-
selectedReportId:
|
|
1891
|
+
selectedReportId: b.reportId
|
|
1898
1892
|
} : null;
|
|
1899
1893
|
}).filter(Boolean);
|
|
1900
|
-
return
|
|
1901
|
-
key:
|
|
1902
|
-
actionId:
|
|
1903
|
-
reportId:
|
|
1894
|
+
return n(u).map((b) => ({
|
|
1895
|
+
key: b.key,
|
|
1896
|
+
actionId: b.actionId,
|
|
1897
|
+
reportId: b.selectedReportId
|
|
1904
1898
|
}));
|
|
1905
1899
|
});
|
|
1906
1900
|
},
|
|
1907
1901
|
disabled: h,
|
|
1908
|
-
setModuleActionEntries:
|
|
1902
|
+
setModuleActionEntries: t
|
|
1909
1903
|
}
|
|
1910
1904
|
)
|
|
1911
1905
|
] });
|
|
@@ -1913,115 +1907,115 @@ const Rn = ({
|
|
|
1913
1907
|
), Yn = Ae(
|
|
1914
1908
|
({
|
|
1915
1909
|
value: s,
|
|
1916
|
-
onChange:
|
|
1910
|
+
onChange: t,
|
|
1917
1911
|
disabled: r,
|
|
1918
1912
|
setModuleActionEntries: p
|
|
1919
1913
|
}) => {
|
|
1920
1914
|
const [m] = q(
|
|
1921
1915
|
() => Math.random().toString(36).substring(2, 15)
|
|
1922
1916
|
), h = _(
|
|
1923
|
-
(
|
|
1924
|
-
r ||
|
|
1925
|
-
const y = [...u], [
|
|
1926
|
-
return y.splice(o, 0,
|
|
1917
|
+
(n, o) => {
|
|
1918
|
+
r || t((u) => {
|
|
1919
|
+
const y = [...u], [b] = y.splice(n, 1);
|
|
1920
|
+
return y.splice(o, 0, b), y;
|
|
1927
1921
|
});
|
|
1928
1922
|
},
|
|
1929
|
-
[
|
|
1930
|
-
),
|
|
1931
|
-
(
|
|
1923
|
+
[t, r]
|
|
1924
|
+
), d = _(
|
|
1925
|
+
(n) => {
|
|
1932
1926
|
p((o) => {
|
|
1933
|
-
const u = o.findIndex((I) => I.key ===
|
|
1927
|
+
const u = o.findIndex((I) => I.key === n);
|
|
1934
1928
|
if (u === -1) return o;
|
|
1935
|
-
const y = o[u],
|
|
1929
|
+
const y = o[u], b = {
|
|
1936
1930
|
key: crypto.randomUUID(),
|
|
1937
1931
|
actionId: y.actionId,
|
|
1938
1932
|
reportId: null
|
|
1939
1933
|
}, w = [...o];
|
|
1940
|
-
return w.splice(u + 1, 0,
|
|
1934
|
+
return w.splice(u + 1, 0, b), w;
|
|
1941
1935
|
});
|
|
1942
1936
|
},
|
|
1943
1937
|
[p]
|
|
1944
|
-
),
|
|
1945
|
-
(
|
|
1938
|
+
), g = _(
|
|
1939
|
+
(n) => {
|
|
1946
1940
|
p(
|
|
1947
|
-
(o) => o.filter((u) => u.key !==
|
|
1941
|
+
(o) => o.filter((u) => u.key !== n)
|
|
1948
1942
|
);
|
|
1949
1943
|
},
|
|
1950
1944
|
[p]
|
|
1951
1945
|
);
|
|
1952
|
-
return /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsx(Sn, { backend: Ln, children: /* @__PURE__ */ e.jsx(ue, { spacing: 3, align: "stretch", children: s.map((
|
|
1946
|
+
return /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsx(Sn, { backend: Ln, children: /* @__PURE__ */ e.jsx(ue, { spacing: 3, align: "stretch", children: s.map((n, o) => /* @__PURE__ */ e.jsx(
|
|
1953
1947
|
Jn,
|
|
1954
1948
|
{
|
|
1955
1949
|
listKey: m,
|
|
1956
|
-
item:
|
|
1950
|
+
item: n,
|
|
1957
1951
|
index: o,
|
|
1958
1952
|
disabled: !!r,
|
|
1959
1953
|
move: h,
|
|
1960
1954
|
onReportChange: (u) => {
|
|
1961
1955
|
p(
|
|
1962
1956
|
(y) => y.map(
|
|
1963
|
-
(
|
|
1957
|
+
(b) => b.key === n.key ? { ...b, reportId: u } : b
|
|
1964
1958
|
)
|
|
1965
1959
|
);
|
|
1966
1960
|
},
|
|
1967
|
-
onDuplicate: () =>
|
|
1968
|
-
onRemove: () =>
|
|
1961
|
+
onDuplicate: () => d(n.key),
|
|
1962
|
+
onRemove: () => g(n.key)
|
|
1969
1963
|
},
|
|
1970
|
-
|
|
1964
|
+
n.key
|
|
1971
1965
|
)) }) }) });
|
|
1972
1966
|
}
|
|
1973
1967
|
), Jn = Ae(
|
|
1974
1968
|
({
|
|
1975
1969
|
listKey: s,
|
|
1976
|
-
item:
|
|
1970
|
+
item: t,
|
|
1977
1971
|
index: r,
|
|
1978
1972
|
disabled: p,
|
|
1979
1973
|
move: m,
|
|
1980
1974
|
onReportChange: h,
|
|
1981
|
-
onDuplicate:
|
|
1982
|
-
onRemove:
|
|
1975
|
+
onDuplicate: d,
|
|
1976
|
+
onRemove: g
|
|
1983
1977
|
}) => {
|
|
1984
|
-
const
|
|
1978
|
+
const n = ln(null), { getLabel: o } = xe(), u = o("action"), [{ handlerId: y }, b] = kn({
|
|
1985
1979
|
accept: s,
|
|
1986
|
-
collect: (
|
|
1987
|
-
handlerId:
|
|
1980
|
+
collect: (x) => ({
|
|
1981
|
+
handlerId: x.getHandlerId()?.toString() ?? ""
|
|
1988
1982
|
}),
|
|
1989
|
-
hover: (
|
|
1990
|
-
if (!
|
|
1983
|
+
hover: (x, N) => {
|
|
1984
|
+
if (!n.current)
|
|
1991
1985
|
return;
|
|
1992
|
-
const v =
|
|
1986
|
+
const v = x.index, E = r;
|
|
1993
1987
|
if (v === E)
|
|
1994
1988
|
return;
|
|
1995
|
-
const
|
|
1996
|
-
v < E && oe < O || v > E && oe > O || (m(v, E),
|
|
1989
|
+
const R = n.current?.getBoundingClientRect(), O = (R.bottom - R.top) / 2, oe = N.getClientOffset().y - R.top;
|
|
1990
|
+
v < E && oe < O || v > E && oe > O || (m(v, E), x.index = E);
|
|
1997
1991
|
}
|
|
1998
1992
|
}), [{ isDragging: w }, I] = Mn({
|
|
1999
1993
|
type: s,
|
|
2000
|
-
item: () => ({ id:
|
|
2001
|
-
collect: (
|
|
2002
|
-
isDragging:
|
|
1994
|
+
item: () => ({ id: t.key, index: r }),
|
|
1995
|
+
collect: (x) => ({
|
|
1996
|
+
isDragging: x.isDragging()
|
|
2003
1997
|
}),
|
|
2004
1998
|
canDrag: !p
|
|
2005
|
-
}), L =
|
|
1999
|
+
}), L = $(() => `action-report-label-${t.key}`, [t.key]), f = $(() => [
|
|
2006
2000
|
{ value: null, label: "No Report" },
|
|
2007
|
-
...
|
|
2008
|
-
const
|
|
2001
|
+
...t.reports.map((x) => {
|
|
2002
|
+
const N = x.name && x.name.length > 0 ? x.name : "No Name", v = ke(x.reportKind);
|
|
2009
2003
|
return {
|
|
2010
|
-
value:
|
|
2011
|
-
label: `${
|
|
2004
|
+
value: x.id,
|
|
2005
|
+
label: `${N} (${v})`
|
|
2012
2006
|
};
|
|
2013
2007
|
})
|
|
2014
|
-
], [
|
|
2015
|
-
return I(
|
|
2008
|
+
], [t.reports]), c = w ? 0.6 : 1, k = p ? "default" : w ? "grabbing" : "grab";
|
|
2009
|
+
return I(b(n)), /* @__PURE__ */ e.jsx(
|
|
2016
2010
|
se,
|
|
2017
2011
|
{
|
|
2018
|
-
ref:
|
|
2012
|
+
ref: n,
|
|
2019
2013
|
p: 3,
|
|
2020
2014
|
border: "1px solid",
|
|
2021
2015
|
borderColor: "gray.200",
|
|
2022
2016
|
borderRadius: "md",
|
|
2023
2017
|
bg: "gray.50",
|
|
2024
|
-
style: { opacity:
|
|
2018
|
+
style: { opacity: c, cursor: k },
|
|
2025
2019
|
"data-handler-id": y,
|
|
2026
2020
|
children: /* @__PURE__ */ e.jsxs(V, { justify: "space-between", align: "center", children: [
|
|
2027
2021
|
/* @__PURE__ */ e.jsxs(V, { spacing: 3, children: [
|
|
@@ -2029,7 +2023,7 @@ const Rn = ({
|
|
|
2029
2023
|
r + 1,
|
|
2030
2024
|
"."
|
|
2031
2025
|
] }),
|
|
2032
|
-
/* @__PURE__ */ e.jsx(M, { fontWeight: "medium", children:
|
|
2026
|
+
/* @__PURE__ */ e.jsx(M, { fontWeight: "medium", children: t.name })
|
|
2033
2027
|
] }),
|
|
2034
2028
|
/* @__PURE__ */ e.jsxs(V, { spacing: 3, align: "center", children: [
|
|
2035
2029
|
/* @__PURE__ */ e.jsxs(M, { id: L, fontSize: "sm", color: "gray.600", children: [
|
|
@@ -2040,13 +2034,13 @@ const Rn = ({
|
|
|
2040
2034
|
he,
|
|
2041
2035
|
{
|
|
2042
2036
|
"aria-labelledby": L,
|
|
2043
|
-
value:
|
|
2044
|
-
(
|
|
2037
|
+
value: f.find(
|
|
2038
|
+
(x) => x.value === t.selectedReportId
|
|
2045
2039
|
),
|
|
2046
|
-
onChange: (
|
|
2047
|
-
h(
|
|
2040
|
+
onChange: (x) => {
|
|
2041
|
+
h(x?.value || null);
|
|
2048
2042
|
},
|
|
2049
|
-
options:
|
|
2043
|
+
options: f,
|
|
2050
2044
|
placeholder: "Select report...",
|
|
2051
2045
|
isDisabled: p
|
|
2052
2046
|
}
|
|
@@ -2058,7 +2052,7 @@ const Rn = ({
|
|
|
2058
2052
|
size: "xs",
|
|
2059
2053
|
variant: "ghost",
|
|
2060
2054
|
colorScheme: "blue",
|
|
2061
|
-
onClick:
|
|
2055
|
+
onClick: d,
|
|
2062
2056
|
title: "Add another instance with a different report",
|
|
2063
2057
|
children: "+ Duplicate"
|
|
2064
2058
|
}
|
|
@@ -2069,7 +2063,7 @@ const Rn = ({
|
|
|
2069
2063
|
size: "xs",
|
|
2070
2064
|
variant: "ghost",
|
|
2071
2065
|
colorScheme: "red",
|
|
2072
|
-
onClick:
|
|
2066
|
+
onClick: g,
|
|
2073
2067
|
title: "Remove this entry",
|
|
2074
2068
|
children: "Remove"
|
|
2075
2069
|
}
|
|
@@ -2083,9 +2077,9 @@ const Rn = ({
|
|
|
2083
2077
|
), Xn = Ae(
|
|
2084
2078
|
({
|
|
2085
2079
|
selectedMetadataIds: s,
|
|
2086
|
-
setSelectedMetadataIds:
|
|
2080
|
+
setSelectedMetadataIds: t
|
|
2087
2081
|
}) => {
|
|
2088
|
-
const { getLabel: r } = xe(), { isView: p, metadataOptions: m } = Ee(), h =
|
|
2082
|
+
const { getLabel: r } = xe(), { isView: p, metadataOptions: m } = Ee(), h = $(() => [
|
|
2089
2083
|
{
|
|
2090
2084
|
key: "activity_type",
|
|
2091
2085
|
label: `${r("action")} Type`,
|
|
@@ -2094,114 +2088,114 @@ const Rn = ({
|
|
|
2094
2088
|
{ key: "session_type", label: "Session Type", multi: !0 },
|
|
2095
2089
|
{ key: "body_region", label: "Body Region", multi: !0 },
|
|
2096
2090
|
{ key: "sport", label: "Sport", multi: !0 }
|
|
2097
|
-
], [r]),
|
|
2098
|
-
(
|
|
2099
|
-
const o = h.find((y) => y.key ===
|
|
2091
|
+
], [r]), d = _(
|
|
2092
|
+
(g, n) => {
|
|
2093
|
+
const o = h.find((y) => y.key === g);
|
|
2100
2094
|
if (!o) return;
|
|
2101
|
-
const u = o.multi ? (
|
|
2102
|
-
|
|
2095
|
+
const u = o.multi ? (n ?? []).map((y) => y.id) : n ? [n.id] : [];
|
|
2096
|
+
t((y) => [...y.filter((w) => Object.values(m || {}).flat().find((L) => L.id === w) && !Object.keys(m || {}).find(
|
|
2103
2097
|
(L) => m?.[L]?.some(
|
|
2104
|
-
(
|
|
2098
|
+
(f) => f.id === w && L === g
|
|
2105
2099
|
)
|
|
2106
2100
|
)), ...u]);
|
|
2107
2101
|
},
|
|
2108
|
-
[h, m,
|
|
2102
|
+
[h, m, t]
|
|
2109
2103
|
);
|
|
2110
2104
|
return m ? /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
|
|
2111
2105
|
/* @__PURE__ */ e.jsx(ge, { children: "Metadata Tags" }),
|
|
2112
|
-
/* @__PURE__ */ e.jsx(V, { gap: "1rem", align: "start", children: h.map((
|
|
2113
|
-
/* @__PURE__ */ e.jsx(_e, { fontSize: "sm", children:
|
|
2106
|
+
/* @__PURE__ */ e.jsx(V, { gap: "1rem", align: "start", children: h.map((g) => /* @__PURE__ */ e.jsxs(X, { flex: "1", children: [
|
|
2107
|
+
/* @__PURE__ */ e.jsx(_e, { fontSize: "sm", children: g.label }),
|
|
2114
2108
|
/* @__PURE__ */ e.jsx(
|
|
2115
2109
|
he,
|
|
2116
2110
|
{
|
|
2117
|
-
isMulti:
|
|
2118
|
-
value: m[
|
|
2119
|
-
(
|
|
2111
|
+
isMulti: g.multi,
|
|
2112
|
+
value: m[g.key]?.filter(
|
|
2113
|
+
(n) => s.includes(n.id)
|
|
2120
2114
|
),
|
|
2121
|
-
onChange: (
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2115
|
+
onChange: (n) => {
|
|
2116
|
+
d(
|
|
2117
|
+
g.key,
|
|
2118
|
+
n
|
|
2125
2119
|
);
|
|
2126
2120
|
},
|
|
2127
|
-
options: m[
|
|
2128
|
-
placeholder: `Select ${
|
|
2121
|
+
options: m[g.key],
|
|
2122
|
+
placeholder: `Select ${g.multi ? "one or more" : "one"} ${g.label.toLowerCase()}`,
|
|
2129
2123
|
isDisabled: p,
|
|
2130
|
-
isClearable:
|
|
2124
|
+
isClearable: g.multi
|
|
2131
2125
|
}
|
|
2132
2126
|
)
|
|
2133
|
-
] },
|
|
2127
|
+
] }, g.key)) })
|
|
2134
2128
|
] }) : null;
|
|
2135
2129
|
}
|
|
2136
2130
|
), Zn = ({
|
|
2137
2131
|
value: s,
|
|
2138
|
-
onChange:
|
|
2132
|
+
onChange: t,
|
|
2139
2133
|
forceKind: r,
|
|
2140
2134
|
disableRemove: p,
|
|
2141
2135
|
disableKind: m,
|
|
2142
2136
|
isDisabled: h,
|
|
2143
|
-
lockRanges:
|
|
2144
|
-
...
|
|
2137
|
+
lockRanges: d,
|
|
2138
|
+
...g
|
|
2145
2139
|
}) => {
|
|
2146
|
-
const
|
|
2147
|
-
const I = bt.indexOf(
|
|
2140
|
+
const n = $(() => [...s].sort((b, w) => {
|
|
2141
|
+
const I = bt.indexOf(b.plane), L = bt.indexOf(w.plane);
|
|
2148
2142
|
return I - L;
|
|
2149
|
-
}), [s]), o = _((
|
|
2150
|
-
(
|
|
2151
|
-
const I =
|
|
2152
|
-
(
|
|
2143
|
+
}), [s]), o = _((b) => "segment" in b.id ? Nt(b.id.segment, b.plane, !0) ?? "Unknown" : Rt(b.id.joint, b.plane, !0) ?? "Unknown", []), u = _(
|
|
2144
|
+
(b, w) => {
|
|
2145
|
+
const I = n.findIndex(
|
|
2146
|
+
(f) => f.id === w.id && f.plane === w.plane
|
|
2153
2147
|
);
|
|
2154
|
-
let L = [...
|
|
2155
|
-
r && (w = { ...w, kind: r }), L[I] = w,
|
|
2156
|
-
...
|
|
2148
|
+
let L = [...n];
|
|
2149
|
+
r && (w = { ...w, kind: r }), L[I] = w, d && (L = L.map((f) => ({
|
|
2150
|
+
...f,
|
|
2157
2151
|
min: w.min,
|
|
2158
2152
|
max: w.max
|
|
2159
|
-
}))),
|
|
2153
|
+
}))), t(L);
|
|
2160
2154
|
},
|
|
2161
|
-
[
|
|
2155
|
+
[t, n, r, d]
|
|
2162
2156
|
), y = _(
|
|
2163
|
-
(
|
|
2164
|
-
const w =
|
|
2165
|
-
(I) => I.id !==
|
|
2157
|
+
(b) => {
|
|
2158
|
+
const w = n.filter(
|
|
2159
|
+
(I) => I.id !== b.id || I.plane !== b.plane
|
|
2166
2160
|
);
|
|
2167
|
-
|
|
2161
|
+
t(w);
|
|
2168
2162
|
},
|
|
2169
|
-
[
|
|
2163
|
+
[t, n]
|
|
2170
2164
|
);
|
|
2171
|
-
return /* @__PURE__ */ e.jsx(ue, { alignItems: "flex-start", overflowY: "auto", ...
|
|
2165
|
+
return /* @__PURE__ */ e.jsx(ue, { alignItems: "flex-start", overflowY: "auto", ...g, children: n.map((b, w) => /* @__PURE__ */ e.jsx(
|
|
2172
2166
|
Vn,
|
|
2173
2167
|
{
|
|
2174
|
-
label: o(
|
|
2175
|
-
parameter:
|
|
2168
|
+
label: o(b),
|
|
2169
|
+
parameter: b,
|
|
2176
2170
|
onChange: (I) => u(w, I),
|
|
2177
|
-
onRemove: p || h ? void 0 : () => y(
|
|
2171
|
+
onRemove: p || h ? void 0 : () => y(b),
|
|
2178
2172
|
forceKind: r,
|
|
2179
2173
|
disableKind: m || h,
|
|
2180
2174
|
isDisabled: h
|
|
2181
2175
|
},
|
|
2182
|
-
`${JSON.stringify(
|
|
2176
|
+
`${JSON.stringify(b.id)}-${b.plane}`
|
|
2183
2177
|
)) });
|
|
2184
2178
|
}, Vn = ({
|
|
2185
2179
|
label: s,
|
|
2186
|
-
parameter:
|
|
2180
|
+
parameter: t,
|
|
2187
2181
|
onChange: r,
|
|
2188
2182
|
onRemove: p,
|
|
2189
2183
|
forceKind: m,
|
|
2190
2184
|
disableKind: h,
|
|
2191
|
-
isDisabled:
|
|
2185
|
+
isDisabled: d
|
|
2192
2186
|
}) => {
|
|
2193
|
-
const
|
|
2194
|
-
(u) => "joint" in
|
|
2195
|
-
|
|
2196
|
-
|
|
2187
|
+
const g = _(
|
|
2188
|
+
(u) => "joint" in t.id ? An(
|
|
2189
|
+
t.id.joint,
|
|
2190
|
+
t.plane,
|
|
2197
2191
|
u < 0 ? -1 : 1
|
|
2198
2192
|
) : On(
|
|
2199
|
-
|
|
2200
|
-
|
|
2193
|
+
t.id.segment,
|
|
2194
|
+
t.plane,
|
|
2201
2195
|
u < 0 ? -1 : 1
|
|
2202
2196
|
),
|
|
2203
|
-
[
|
|
2204
|
-
), { min:
|
|
2197
|
+
[t]
|
|
2198
|
+
), { min: n, max: o } = "joint" in t.id ? Tn(t.id.joint, t.plane) : { min: -180, max: 180 };
|
|
2205
2199
|
return /* @__PURE__ */ e.jsxs(
|
|
2206
2200
|
ue,
|
|
2207
2201
|
{
|
|
@@ -2224,11 +2218,11 @@ const Rn = ({
|
|
|
2224
2218
|
children: s
|
|
2225
2219
|
}
|
|
2226
2220
|
),
|
|
2227
|
-
|
|
2221
|
+
t.sensorOnly ? /* @__PURE__ */ e.jsx(Oe, { size: "sm", colorScheme: "orange", variant: "subtle", children: "Sensor" }) : /* @__PURE__ */ e.jsxs(V, { spacing: 1, children: [
|
|
2228
2222
|
/* @__PURE__ */ e.jsx(Oe, { size: "sm", colorScheme: "blue", variant: "subtle", children: "Pose" }),
|
|
2229
2223
|
/* @__PURE__ */ e.jsx(Oe, { size: "sm", colorScheme: "orange", variant: "subtle", children: "Sensor" })
|
|
2230
2224
|
] }),
|
|
2231
|
-
p && !
|
|
2225
|
+
p && !d && /* @__PURE__ */ e.jsx(
|
|
2232
2226
|
ot,
|
|
2233
2227
|
{
|
|
2234
2228
|
size: "xs",
|
|
@@ -2241,9 +2235,9 @@ const Rn = ({
|
|
|
2241
2235
|
!m && /* @__PURE__ */ e.jsx(
|
|
2242
2236
|
$n,
|
|
2243
2237
|
{
|
|
2244
|
-
selectedItem:
|
|
2245
|
-
onChange: ({ value: u }) => r({ ...
|
|
2246
|
-
isDisabled: h ||
|
|
2238
|
+
selectedItem: t?.kind ?? Xe.Limit,
|
|
2239
|
+
onChange: ({ value: u }) => r({ ...t, kind: u }),
|
|
2240
|
+
isDisabled: h || d,
|
|
2247
2241
|
buttonProps: {
|
|
2248
2242
|
size: "sm",
|
|
2249
2243
|
variant: "outline",
|
|
@@ -2265,49 +2259,49 @@ const Rn = ({
|
|
|
2265
2259
|
{
|
|
2266
2260
|
w: "100%",
|
|
2267
2261
|
size: "xs",
|
|
2268
|
-
min:
|
|
2262
|
+
min: n,
|
|
2269
2263
|
max: o,
|
|
2270
2264
|
zeroMarker: !0,
|
|
2271
|
-
value: [
|
|
2272
|
-
onChange: (u) => r({ ...
|
|
2265
|
+
value: [t.min, t.max],
|
|
2266
|
+
onChange: (u) => r({ ...t, min: u[0], max: u[1] }),
|
|
2273
2267
|
formatValue: (u) => `${Math.abs(u)}°`,
|
|
2274
|
-
valueLabel: (u) =>
|
|
2275
|
-
positiveNegativeLabels:
|
|
2276
|
-
isDisabled:
|
|
2268
|
+
valueLabel: (u) => g(u) ?? "",
|
|
2269
|
+
positiveNegativeLabels: g(0) ? [g(-1) ?? "", g(1) ?? ""] : void 0,
|
|
2270
|
+
isDisabled: d
|
|
2277
2271
|
}
|
|
2278
2272
|
)
|
|
2279
2273
|
]
|
|
2280
2274
|
}
|
|
2281
2275
|
);
|
|
2282
|
-
}, He = (s,
|
|
2276
|
+
}, He = (s, t) => "segment" in s && "segment" in t && s.segment === t.segment || "joint" in s && "joint" in t && s.joint === t.joint, yt = ({
|
|
2283
2277
|
options: s,
|
|
2284
|
-
value:
|
|
2278
|
+
value: t,
|
|
2285
2279
|
onChange: r,
|
|
2286
2280
|
forceKind: p,
|
|
2287
2281
|
singleValue: m,
|
|
2288
2282
|
singleValueSideless: h,
|
|
2289
|
-
editOnly:
|
|
2290
|
-
disableKind:
|
|
2291
|
-
maxParameters:
|
|
2283
|
+
editOnly: d,
|
|
2284
|
+
disableKind: g,
|
|
2285
|
+
maxParameters: n,
|
|
2292
2286
|
...o
|
|
2293
2287
|
}) => {
|
|
2294
|
-
const u = h ? 2 :
|
|
2295
|
-
const
|
|
2296
|
-
return s.forEach((
|
|
2297
|
-
const k = "joint" in
|
|
2298
|
-
let
|
|
2299
|
-
if (k ? (
|
|
2300
|
-
const
|
|
2301
|
-
|
|
2302
|
-
label:
|
|
2288
|
+
const u = h ? 2 : n, y = $(() => {
|
|
2289
|
+
const f = /* @__PURE__ */ new Map();
|
|
2290
|
+
return s.forEach((c) => {
|
|
2291
|
+
const k = "joint" in c.id;
|
|
2292
|
+
let x, N;
|
|
2293
|
+
if (k ? (x = Rt(c.id.joint, c.plane, !0) ?? "Unknown", N = `joint:${c.id.joint}`) : (x = Nt(c.id.segment, c.plane, !0) ?? "Unknown", N = `segment:${c.id.segment}`), !f.has(N)) {
|
|
2294
|
+
const R = k ? ft(c.id.joint) ?? "Unknown Joint" : ft(c.id.segment) ?? "Unknown Segment";
|
|
2295
|
+
f.set(N, {
|
|
2296
|
+
label: R,
|
|
2303
2297
|
options: []
|
|
2304
2298
|
});
|
|
2305
2299
|
}
|
|
2306
|
-
const v =
|
|
2307
|
-
|
|
2308
|
-
k ?
|
|
2309
|
-
|
|
2310
|
-
].filter(Boolean).map((
|
|
2300
|
+
const v = f.get(N), E = [
|
|
2301
|
+
x,
|
|
2302
|
+
k ? c.id.joint : c.id.segment,
|
|
2303
|
+
c.plane
|
|
2304
|
+
].filter(Boolean).map((R) => String(R).toLowerCase().replace(/\s+|_/g, ""));
|
|
2311
2305
|
v.options.push({
|
|
2312
2306
|
label: /* @__PURE__ */ e.jsxs(
|
|
2313
2307
|
V,
|
|
@@ -2318,78 +2312,78 @@ const Rn = ({
|
|
|
2318
2312
|
w: "100%",
|
|
2319
2313
|
pl: 3,
|
|
2320
2314
|
children: [
|
|
2321
|
-
/* @__PURE__ */ e.jsx(M, { children:
|
|
2322
|
-
|
|
2315
|
+
/* @__PURE__ */ e.jsx(M, { children: x }),
|
|
2316
|
+
c.sensorOnly ? /* @__PURE__ */ e.jsx(Oe, { size: "sm", colorScheme: "orange", variant: "subtle", children: "Sensor" }) : /* @__PURE__ */ e.jsxs(V, { spacing: 1, children: [
|
|
2323
2317
|
/* @__PURE__ */ e.jsx(Oe, { size: "sm", colorScheme: "blue", variant: "subtle", children: "Pose" }),
|
|
2324
2318
|
/* @__PURE__ */ e.jsx(Oe, { size: "sm", colorScheme: "orange", variant: "subtle", children: "Sensor" })
|
|
2325
2319
|
] })
|
|
2326
2320
|
]
|
|
2327
2321
|
}
|
|
2328
2322
|
),
|
|
2329
|
-
value:
|
|
2330
|
-
plane:
|
|
2331
|
-
sensorOnly:
|
|
2323
|
+
value: c.id,
|
|
2324
|
+
plane: c.plane,
|
|
2325
|
+
sensorOnly: c.sensorOnly,
|
|
2332
2326
|
searchTokens: E
|
|
2333
2327
|
});
|
|
2334
|
-
}), Array.from(
|
|
2335
|
-
}, [s]),
|
|
2336
|
-
if (!h ||
|
|
2328
|
+
}), Array.from(f.values());
|
|
2329
|
+
}, [s]), b = $(() => {
|
|
2330
|
+
if (!h || t.length === 0)
|
|
2337
2331
|
return y;
|
|
2338
|
-
const
|
|
2339
|
-
return y.map((
|
|
2340
|
-
...
|
|
2341
|
-
options:
|
|
2342
|
-
(k) => qe(k.value) === qe(
|
|
2332
|
+
const f = t[0];
|
|
2333
|
+
return y.map((c) => ({
|
|
2334
|
+
...c,
|
|
2335
|
+
options: c.options.filter(
|
|
2336
|
+
(k) => qe(k.value) === qe(f.id) && k.plane === f.plane
|
|
2343
2337
|
)
|
|
2344
|
-
})).filter((
|
|
2345
|
-
}, [y,
|
|
2346
|
-
(
|
|
2347
|
-
), [y,
|
|
2348
|
-
if (!
|
|
2349
|
-
const k =
|
|
2350
|
-
return !
|
|
2351
|
-
(
|
|
2338
|
+
})).filter((c) => c.options.length > 0);
|
|
2339
|
+
}, [y, t, h]), w = $(() => y.flatMap((c) => c.options).filter(
|
|
2340
|
+
(c) => t.some((k) => He(k.id, c.value) && k.plane === c.plane)
|
|
2341
|
+
), [y, t]), I = _((f, c) => {
|
|
2342
|
+
if (!c) return !0;
|
|
2343
|
+
const k = c.toLowerCase().replace(/\s+|_/g, ""), x = f.data;
|
|
2344
|
+
return !x || !x.searchTokens ? !1 : x.searchTokens.some(
|
|
2345
|
+
(N) => N.includes(k)
|
|
2352
2346
|
);
|
|
2353
2347
|
}, []), L = _(
|
|
2354
|
-
(
|
|
2355
|
-
const
|
|
2356
|
-
const
|
|
2348
|
+
(f) => {
|
|
2349
|
+
const c = f.map((k) => {
|
|
2350
|
+
const x = t.find(
|
|
2357
2351
|
(O) => He(O.id, k.value) && O.plane === k.plane
|
|
2358
|
-
),
|
|
2352
|
+
), N = s.find(
|
|
2359
2353
|
(O) => He(O.id, k.value) && O.plane === k.plane
|
|
2360
|
-
), v = h ?
|
|
2354
|
+
), v = h ? t.find(
|
|
2361
2355
|
(O) => qe(O.id) === qe(k.value) && O.plane === k.plane
|
|
2362
|
-
) : void 0, E = v && !
|
|
2363
|
-
return
|
|
2356
|
+
) : void 0, E = v && !x ? v.min : N && N.min ? N.min : 0, R = v && !x ? v.max : N && N.max ? N.max : 0;
|
|
2357
|
+
return x ?? {
|
|
2364
2358
|
id: k.value,
|
|
2365
2359
|
plane: k.plane,
|
|
2366
2360
|
min: E,
|
|
2367
|
-
max:
|
|
2361
|
+
max: R,
|
|
2368
2362
|
sensorOnly: k.sensorOnly,
|
|
2369
2363
|
kind: p ?? Xe.Limit
|
|
2370
2364
|
};
|
|
2371
2365
|
});
|
|
2372
|
-
r(
|
|
2366
|
+
r(c);
|
|
2373
2367
|
},
|
|
2374
|
-
[r,
|
|
2368
|
+
[r, t, s, p, h]
|
|
2375
2369
|
);
|
|
2376
2370
|
return ce(() => {
|
|
2377
|
-
const
|
|
2378
|
-
(
|
|
2371
|
+
const f = t.filter(
|
|
2372
|
+
(c) => s.some((k) => He(k.id, c.id) && k.plane === c.plane)
|
|
2379
2373
|
);
|
|
2380
|
-
|
|
2381
|
-
}, [s, r,
|
|
2374
|
+
f.length !== t.length && r(f);
|
|
2375
|
+
}, [s, r, t]), /* @__PURE__ */ e.jsxs(se, { ...o, children: [
|
|
2382
2376
|
/* @__PURE__ */ e.jsx(
|
|
2383
2377
|
he,
|
|
2384
2378
|
{
|
|
2385
2379
|
isMulti: !m,
|
|
2386
|
-
placeholder:
|
|
2380
|
+
placeholder: t.length ? `${t.length} selected` : "Search...",
|
|
2387
2381
|
value: w,
|
|
2388
|
-
isDisabled:
|
|
2389
|
-
onChange: (
|
|
2390
|
-
options:
|
|
2382
|
+
isDisabled: d || w.length >= (u ?? 1 / 0),
|
|
2383
|
+
onChange: (f) => Array.isArray(f) ? L([...f]) : L(f !== null ? [f] : []),
|
|
2384
|
+
options: b,
|
|
2391
2385
|
controlShouldRenderValue: !1,
|
|
2392
|
-
formatOptionLabel: (
|
|
2386
|
+
formatOptionLabel: (f) => f.label,
|
|
2393
2387
|
filterOption: I,
|
|
2394
2388
|
isSearchable: !0
|
|
2395
2389
|
}
|
|
@@ -2399,11 +2393,11 @@ const Rn = ({
|
|
|
2399
2393
|
{
|
|
2400
2394
|
marginTop: 2,
|
|
2401
2395
|
maxH: "28rem",
|
|
2402
|
-
value:
|
|
2396
|
+
value: t,
|
|
2403
2397
|
onChange: r,
|
|
2404
2398
|
forceKind: p,
|
|
2405
|
-
disableKind:
|
|
2406
|
-
isDisabled:
|
|
2399
|
+
disableKind: g,
|
|
2400
|
+
isDisabled: d,
|
|
2407
2401
|
lockRanges: h
|
|
2408
2402
|
}
|
|
2409
2403
|
)
|
|
@@ -2441,39 +2435,39 @@ const Rn = ({
|
|
|
2441
2435
|
}
|
|
2442
2436
|
}, vs = ({
|
|
2443
2437
|
id: s,
|
|
2444
|
-
onError:
|
|
2438
|
+
onError: t,
|
|
2445
2439
|
onCancel: r,
|
|
2446
2440
|
onSave: p,
|
|
2447
2441
|
hideButtons: m,
|
|
2448
2442
|
setButtonOnClick: h,
|
|
2449
|
-
setButtonDisabled:
|
|
2450
|
-
quantumOwned:
|
|
2451
|
-
isView:
|
|
2443
|
+
setButtonDisabled: d,
|
|
2444
|
+
quantumOwned: g,
|
|
2445
|
+
isView: n
|
|
2452
2446
|
}) => {
|
|
2453
|
-
const o = lt(), [{ fetching: u }, y] = fe(it), [{ fetching:
|
|
2447
|
+
const o = lt(), [{ fetching: u }, y] = fe(it), [{ fetching: b }, w] = fe(un), [{ data: I }] = Ce({
|
|
2454
2448
|
query: mn,
|
|
2455
2449
|
variables: { id: s ?? "" },
|
|
2456
2450
|
pause: !s
|
|
2457
|
-
}), L =
|
|
2458
|
-
const
|
|
2451
|
+
}), L = $(() => {
|
|
2452
|
+
const j = A(
|
|
2459
2453
|
ve,
|
|
2460
2454
|
I?.getActionById
|
|
2461
2455
|
);
|
|
2462
|
-
if (!
|
|
2463
|
-
const P = (A(Fe,
|
|
2456
|
+
if (!j) return null;
|
|
2457
|
+
const P = (A(Fe, j.reports) || []).map((F) => ({
|
|
2464
2458
|
...F,
|
|
2465
2459
|
thresholds: A(Te, F.thresholds)
|
|
2466
2460
|
}));
|
|
2467
2461
|
return {
|
|
2468
|
-
...
|
|
2469
|
-
thresholds: A(Te,
|
|
2462
|
+
...j,
|
|
2463
|
+
thresholds: A(Te, j.thresholds),
|
|
2470
2464
|
reports: P
|
|
2471
2465
|
};
|
|
2472
|
-
}, [I]),
|
|
2466
|
+
}, [I]), f = u || b, c = !!L && !!s, { getLabel: k } = xe(), x = $(() => ({
|
|
2473
2467
|
action: k("action")
|
|
2474
|
-
}), [k]),
|
|
2468
|
+
}), [k]), N = $(() => [
|
|
2475
2469
|
{ key: "module_category", label: "Link Category", multi: !0 },
|
|
2476
|
-
{ key: "activity_type", label: `${
|
|
2470
|
+
{ key: "activity_type", label: `${x.action} Type`, multi: !1 },
|
|
2477
2471
|
{ key: "session_type", label: "Session Type", multi: !0 },
|
|
2478
2472
|
{ key: "body_region", label: "Body Region", multi: !0 },
|
|
2479
2473
|
{ key: "sport", label: "Sport", multi: !0 },
|
|
@@ -2482,7 +2476,7 @@ const Rn = ({
|
|
|
2482
2476
|
label: "Activity Motion Direction",
|
|
2483
2477
|
multi: !0
|
|
2484
2478
|
}
|
|
2485
|
-
], [
|
|
2479
|
+
], [x.action]), [v, E] = q(""), [R, O] = q(""), [K, oe] = q(""), [D, ae] = q(""), [Z, T] = q([]), [B, J] = q({}), [U, Y] = q(null), [i, a] = q(""), [C, l] = q([]), [S, W] = q([]), [G, Q] = q(""), [H, re] = q([]), we = fn(), Ie = $(() => we.filter((j) => j.sensorOnly), [we]), Se = [
|
|
2486
2480
|
{
|
|
2487
2481
|
label: ke(ie.GeneralActivity),
|
|
2488
2482
|
value: ie.GeneralActivity
|
|
@@ -2500,12 +2494,12 @@ const Rn = ({
|
|
|
2500
2494
|
label: ke(ie.PointOfInterest),
|
|
2501
2495
|
value: ie.PointOfInterest
|
|
2502
2496
|
}
|
|
2503
|
-
], ze =
|
|
2497
|
+
], ze = $(() => v.trim().length > 0, [v]), [Be, tt] = q({});
|
|
2504
2498
|
ce(() => {
|
|
2505
|
-
const
|
|
2499
|
+
const j = N.map(
|
|
2506
2500
|
(z) => o.query(at, { key: z.key })
|
|
2507
2501
|
);
|
|
2508
|
-
Promise.all(
|
|
2502
|
+
Promise.all(j).then((z) => {
|
|
2509
2503
|
const P = {};
|
|
2510
2504
|
z.forEach((F) => {
|
|
2511
2505
|
if (F.error || !F.data) return;
|
|
@@ -2523,7 +2517,7 @@ const Rn = ({
|
|
|
2523
2517
|
}));
|
|
2524
2518
|
}), J(P);
|
|
2525
2519
|
});
|
|
2526
|
-
}, [o,
|
|
2520
|
+
}, [o, N]), ce(() => {
|
|
2527
2521
|
if (L) {
|
|
2528
2522
|
const z = A(
|
|
2529
2523
|
je,
|
|
@@ -2562,40 +2556,40 @@ const Rn = ({
|
|
|
2562
2556
|
E(F.name), O(F.description), oe(F.cameraPlacement), ae(F.videoLink), T(F.metadataIds), re(P), tt(F);
|
|
2563
2557
|
}
|
|
2564
2558
|
}, [L]);
|
|
2565
|
-
const Re =
|
|
2559
|
+
const Re = $(
|
|
2566
2560
|
() => JSON.stringify(Be) !== JSON.stringify({
|
|
2567
2561
|
name: v,
|
|
2568
|
-
description:
|
|
2562
|
+
description: R,
|
|
2569
2563
|
cameraPlacement: K,
|
|
2570
2564
|
videoLink: D,
|
|
2571
2565
|
metadataIds: Z,
|
|
2572
|
-
reports:
|
|
2566
|
+
reports: H
|
|
2573
2567
|
}),
|
|
2574
2568
|
[
|
|
2575
2569
|
Be,
|
|
2576
2570
|
v,
|
|
2577
|
-
|
|
2571
|
+
R,
|
|
2578
2572
|
K,
|
|
2579
2573
|
D,
|
|
2580
2574
|
Z,
|
|
2581
|
-
|
|
2575
|
+
H
|
|
2582
2576
|
]
|
|
2583
2577
|
), Le = _(() => {
|
|
2584
|
-
const
|
|
2578
|
+
const j = {
|
|
2585
2579
|
name: v,
|
|
2586
|
-
description:
|
|
2580
|
+
description: R,
|
|
2587
2581
|
cameraPlacement: K,
|
|
2588
2582
|
videoLink: D,
|
|
2589
2583
|
metadataItemIds: Z,
|
|
2590
2584
|
// Backend requires laterality; keep existing default since UI no longer edits it
|
|
2591
2585
|
laterality: Nn.Either,
|
|
2592
|
-
quantumOwned:
|
|
2586
|
+
quantumOwned: g,
|
|
2593
2587
|
//Backend requires session type; keep existing default since UI no longer edits it
|
|
2594
2588
|
sessionType: [],
|
|
2595
2589
|
// Backend requires thresholds; use empty array since reports handle parameters now
|
|
2596
2590
|
thresholds: [],
|
|
2597
2591
|
// Include reports data
|
|
2598
|
-
reports:
|
|
2592
|
+
reports: H.map((P) => ({
|
|
2599
2593
|
id: P.isNew ? void 0 : P.id,
|
|
2600
2594
|
name: P.name,
|
|
2601
2595
|
reportKind: P.kind,
|
|
@@ -2614,45 +2608,45 @@ const Rn = ({
|
|
|
2614
2608
|
}))
|
|
2615
2609
|
};
|
|
2616
2610
|
let z;
|
|
2617
|
-
|
|
2611
|
+
c && s ? z = w({
|
|
2618
2612
|
id: s,
|
|
2619
|
-
fields:
|
|
2613
|
+
fields: j
|
|
2620
2614
|
}) : z = y({
|
|
2621
|
-
fields:
|
|
2615
|
+
fields: j
|
|
2622
2616
|
}), z.then(({ error: P }) => {
|
|
2623
|
-
P ?
|
|
2617
|
+
P ? t(P) : p();
|
|
2624
2618
|
});
|
|
2625
2619
|
}, [
|
|
2626
|
-
|
|
2620
|
+
g,
|
|
2627
2621
|
y,
|
|
2628
2622
|
w,
|
|
2629
2623
|
s,
|
|
2630
2624
|
v,
|
|
2631
|
-
|
|
2625
|
+
R,
|
|
2632
2626
|
K,
|
|
2633
2627
|
D,
|
|
2634
2628
|
Z,
|
|
2635
|
-
|
|
2636
|
-
|
|
2629
|
+
H,
|
|
2630
|
+
c,
|
|
2637
2631
|
p,
|
|
2638
|
-
|
|
2632
|
+
t
|
|
2639
2633
|
]);
|
|
2640
2634
|
ce(() => {
|
|
2641
|
-
|
|
2642
|
-
cancelButton:
|
|
2643
|
-
saveButton:
|
|
2635
|
+
d && d({
|
|
2636
|
+
cancelButton: f,
|
|
2637
|
+
saveButton: n ? !0 : f || !ze || !Re
|
|
2644
2638
|
});
|
|
2645
|
-
}, [
|
|
2639
|
+
}, [f, d, ze, Re, n]), ce(() => {
|
|
2646
2640
|
h && h({
|
|
2647
2641
|
cancelButton: r,
|
|
2648
|
-
saveButton:
|
|
2642
|
+
saveButton: n ? () => {
|
|
2649
2643
|
} : Le
|
|
2650
2644
|
});
|
|
2651
|
-
}, [h, r, Le,
|
|
2645
|
+
}, [h, r, Le, n]);
|
|
2652
2646
|
const pe = _(
|
|
2653
|
-
(
|
|
2647
|
+
(j) => {
|
|
2654
2648
|
const z = jt(
|
|
2655
|
-
|
|
2649
|
+
j.map(
|
|
2656
2650
|
(P) => "joint" in P.id ? P.id.joint : P.id.segment
|
|
2657
2651
|
)
|
|
2658
2652
|
);
|
|
@@ -2666,35 +2660,35 @@ const Rn = ({
|
|
|
2666
2660
|
const $e = _(() => {
|
|
2667
2661
|
if (!U || !i.trim())
|
|
2668
2662
|
return;
|
|
2669
|
-
const
|
|
2663
|
+
const j = U === ie.PointOfInterest, z = {
|
|
2670
2664
|
id: Date.now().toString(),
|
|
2671
2665
|
// Temporary ID
|
|
2672
2666
|
name: i.trim(),
|
|
2673
2667
|
kind: U,
|
|
2674
|
-
parameters:
|
|
2675
|
-
sensorLocations:
|
|
2676
|
-
instructions:
|
|
2668
|
+
parameters: j ? [] : C,
|
|
2669
|
+
sensorLocations: j ? [] : S,
|
|
2670
|
+
instructions: j ? G : "",
|
|
2677
2671
|
autoGenerate: !1,
|
|
2678
2672
|
isNew: !0
|
|
2679
2673
|
};
|
|
2680
|
-
re((P) => [...P, z]),
|
|
2674
|
+
re((P) => [...P, z]), Y(null), a(""), l([]), W([]), Q("");
|
|
2681
2675
|
}, [
|
|
2682
2676
|
U,
|
|
2683
2677
|
i,
|
|
2684
2678
|
C,
|
|
2685
2679
|
S,
|
|
2686
2680
|
G
|
|
2687
|
-
]), Dt = _((
|
|
2688
|
-
re((z) => z.filter((P) => P.id !==
|
|
2689
|
-
}, []), Gt = (
|
|
2690
|
-
const P =
|
|
2681
|
+
]), Dt = _((j) => {
|
|
2682
|
+
re((z) => z.filter((P) => P.id !== j));
|
|
2683
|
+
}, []), Gt = (j, z) => {
|
|
2684
|
+
const P = N.find((ne) => ne.key === j);
|
|
2691
2685
|
if (!P) return;
|
|
2692
2686
|
const F = P.multi ? (z ?? []).map(
|
|
2693
2687
|
(ne) => ne.id
|
|
2694
2688
|
) : z ? [z.id] : [];
|
|
2695
2689
|
T((ne) => [...ne.filter((de) => Object.values(B).flat().find((Ue) => Ue.id === de) && !Object.keys(B).find(
|
|
2696
2690
|
(Ue) => B[Ue]?.some(
|
|
2697
|
-
(Ft) => Ft.id === de && Ue ===
|
|
2691
|
+
(Ft) => Ft.id === de && Ue === j
|
|
2698
2692
|
)
|
|
2699
2693
|
)), ...F]);
|
|
2700
2694
|
};
|
|
@@ -2713,10 +2707,10 @@ const Rn = ({
|
|
|
2713
2707
|
ye,
|
|
2714
2708
|
{
|
|
2715
2709
|
value: v,
|
|
2716
|
-
onChange: (
|
|
2710
|
+
onChange: (j) => E(j.target.value),
|
|
2717
2711
|
type: "text",
|
|
2718
2712
|
placeholder: "i.e. Lunge & Return",
|
|
2719
|
-
isDisabled:
|
|
2713
|
+
isDisabled: n
|
|
2720
2714
|
}
|
|
2721
2715
|
)
|
|
2722
2716
|
] }),
|
|
@@ -2726,10 +2720,10 @@ const Rn = ({
|
|
|
2726
2720
|
Qe,
|
|
2727
2721
|
{
|
|
2728
2722
|
value: K,
|
|
2729
|
-
onChange: (
|
|
2723
|
+
onChange: (j) => oe(j.target.value),
|
|
2730
2724
|
rows: 2,
|
|
2731
2725
|
placeholder: "(optional) Describe camera setup, placement, angles",
|
|
2732
|
-
isDisabled:
|
|
2726
|
+
isDisabled: n
|
|
2733
2727
|
}
|
|
2734
2728
|
)
|
|
2735
2729
|
] }),
|
|
@@ -2739,10 +2733,10 @@ const Rn = ({
|
|
|
2739
2733
|
ye,
|
|
2740
2734
|
{
|
|
2741
2735
|
value: D,
|
|
2742
|
-
onChange: (
|
|
2736
|
+
onChange: (j) => ae(j.target.value),
|
|
2743
2737
|
type: "url",
|
|
2744
2738
|
placeholder: "(optional) https://...",
|
|
2745
|
-
isDisabled:
|
|
2739
|
+
isDisabled: n
|
|
2746
2740
|
}
|
|
2747
2741
|
)
|
|
2748
2742
|
] }),
|
|
@@ -2751,36 +2745,36 @@ const Rn = ({
|
|
|
2751
2745
|
/* @__PURE__ */ e.jsx(
|
|
2752
2746
|
Qe,
|
|
2753
2747
|
{
|
|
2754
|
-
value:
|
|
2755
|
-
onChange: (
|
|
2748
|
+
value: R,
|
|
2749
|
+
onChange: (j) => O(j.target.value),
|
|
2756
2750
|
rows: 2,
|
|
2757
2751
|
placeholder: "(optional) Describe how to perform the test or exercise",
|
|
2758
|
-
isDisabled:
|
|
2752
|
+
isDisabled: n
|
|
2759
2753
|
}
|
|
2760
2754
|
)
|
|
2761
2755
|
] })
|
|
2762
2756
|
] }),
|
|
2763
2757
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
2764
2758
|
/* @__PURE__ */ e.jsx(le, { children: "Metadata Tags" }),
|
|
2765
|
-
|
|
2766
|
-
/* @__PURE__ */ e.jsx(le, { children:
|
|
2759
|
+
N.map((j) => /* @__PURE__ */ e.jsxs(X, { children: [
|
|
2760
|
+
/* @__PURE__ */ e.jsx(le, { children: j.label }),
|
|
2767
2761
|
/* @__PURE__ */ e.jsx(
|
|
2768
2762
|
he,
|
|
2769
2763
|
{
|
|
2770
|
-
isMulti:
|
|
2771
|
-
value: B[
|
|
2764
|
+
isMulti: j.multi,
|
|
2765
|
+
value: B[j.key]?.filter(
|
|
2772
2766
|
(z) => Z.includes(z.id)
|
|
2773
2767
|
),
|
|
2774
2768
|
onChange: (z) => {
|
|
2775
|
-
Gt(
|
|
2769
|
+
Gt(j.key, z);
|
|
2776
2770
|
},
|
|
2777
|
-
options: B[
|
|
2778
|
-
placeholder: `Select ${
|
|
2779
|
-
isDisabled:
|
|
2780
|
-
isClearable:
|
|
2771
|
+
options: B[j.key],
|
|
2772
|
+
placeholder: `Select ${j.multi ? "one or more" : "one"} ${j.label.toLowerCase()}`,
|
|
2773
|
+
isDisabled: n,
|
|
2774
|
+
isClearable: j.multi
|
|
2781
2775
|
}
|
|
2782
2776
|
)
|
|
2783
|
-
] },
|
|
2777
|
+
] }, j.key))
|
|
2784
2778
|
] })
|
|
2785
2779
|
] }) }),
|
|
2786
2780
|
/* @__PURE__ */ e.jsx(xt, { px: 0, children: /* @__PURE__ */ e.jsxs(
|
|
@@ -2788,10 +2782,10 @@ const Rn = ({
|
|
|
2788
2782
|
{
|
|
2789
2783
|
className: Je(
|
|
2790
2784
|
"grid grid-cols-1 gap-6",
|
|
2791
|
-
!
|
|
2785
|
+
!n && "md:grid-cols-2"
|
|
2792
2786
|
),
|
|
2793
2787
|
children: [
|
|
2794
|
-
/* @__PURE__ */ e.jsxs("div", { className: Je("space-y-4",
|
|
2788
|
+
/* @__PURE__ */ e.jsxs("div", { className: Je("space-y-4", n && "hidden"), children: [
|
|
2795
2789
|
/* @__PURE__ */ e.jsx(le, { children: "Add New Report" }),
|
|
2796
2790
|
/* @__PURE__ */ e.jsxs(X, { children: [
|
|
2797
2791
|
/* @__PURE__ */ e.jsx(le, { children: "Report Name" }),
|
|
@@ -2799,11 +2793,11 @@ const Rn = ({
|
|
|
2799
2793
|
ye,
|
|
2800
2794
|
{
|
|
2801
2795
|
value: i,
|
|
2802
|
-
onChange: (
|
|
2796
|
+
onChange: (j) => a(j.target.value),
|
|
2803
2797
|
maxLength: 120,
|
|
2804
2798
|
type: "text",
|
|
2805
2799
|
placeholder: "Enter report name...",
|
|
2806
|
-
isDisabled:
|
|
2800
|
+
isDisabled: n
|
|
2807
2801
|
}
|
|
2808
2802
|
)
|
|
2809
2803
|
] }),
|
|
@@ -2813,12 +2807,12 @@ const Rn = ({
|
|
|
2813
2807
|
he,
|
|
2814
2808
|
{
|
|
2815
2809
|
value: U ? Se.find(
|
|
2816
|
-
(
|
|
2810
|
+
(j) => j.value === U
|
|
2817
2811
|
) : null,
|
|
2818
|
-
onChange: (
|
|
2812
|
+
onChange: (j) => Y(j?.value || null),
|
|
2819
2813
|
options: Se,
|
|
2820
2814
|
placeholder: "Select report type...",
|
|
2821
|
-
isDisabled:
|
|
2815
|
+
isDisabled: n,
|
|
2822
2816
|
isClearable: !0
|
|
2823
2817
|
}
|
|
2824
2818
|
)
|
|
@@ -2832,7 +2826,7 @@ const Rn = ({
|
|
|
2832
2826
|
options: we,
|
|
2833
2827
|
value: C,
|
|
2834
2828
|
onChange: l,
|
|
2835
|
-
editOnly:
|
|
2829
|
+
editOnly: n
|
|
2836
2830
|
}
|
|
2837
2831
|
)
|
|
2838
2832
|
] }),
|
|
@@ -2842,7 +2836,7 @@ const Rn = ({
|
|
|
2842
2836
|
ye,
|
|
2843
2837
|
{
|
|
2844
2838
|
value: S.map(
|
|
2845
|
-
(
|
|
2839
|
+
(j) => vt(j)
|
|
2846
2840
|
).join(", "),
|
|
2847
2841
|
placeholder: "Auto-filled based on parameters...",
|
|
2848
2842
|
isDisabled: !0
|
|
@@ -2856,10 +2850,10 @@ const Rn = ({
|
|
|
2856
2850
|
Qe,
|
|
2857
2851
|
{
|
|
2858
2852
|
value: G,
|
|
2859
|
-
onChange: (
|
|
2853
|
+
onChange: (j) => Q(j.target.value),
|
|
2860
2854
|
rows: 3,
|
|
2861
2855
|
placeholder: "Enter specific instructions for this report...",
|
|
2862
|
-
isDisabled:
|
|
2856
|
+
isDisabled: n
|
|
2863
2857
|
}
|
|
2864
2858
|
)
|
|
2865
2859
|
] }),
|
|
@@ -2868,27 +2862,27 @@ const Rn = ({
|
|
|
2868
2862
|
{
|
|
2869
2863
|
colorScheme: "blue",
|
|
2870
2864
|
onClick: $e,
|
|
2871
|
-
isDisabled: !U || !i.trim() ||
|
|
2865
|
+
isDisabled: !U || !i.trim() || n || Se.length === 0 || U !== ie.PointOfInterest && C.length === 0,
|
|
2872
2866
|
children: "Add Report"
|
|
2873
2867
|
}
|
|
2874
2868
|
) })
|
|
2875
2869
|
] }),
|
|
2876
2870
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
2877
2871
|
/* @__PURE__ */ e.jsx(le, { children: "Configured Reports" }),
|
|
2878
|
-
|
|
2872
|
+
H.length === 0 ? /* @__PURE__ */ e.jsx(M, { fontSize: "sm", color: "gray.500", children: "No reports created yet" }) : /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: H.map((j) => /* @__PURE__ */ e.jsxs(
|
|
2879
2873
|
"div",
|
|
2880
2874
|
{
|
|
2881
2875
|
className: "p-3 border border-gray-200 rounded-md bg-gray-50 flex flex-col gap-2",
|
|
2882
2876
|
children: [
|
|
2883
2877
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-start", children: [
|
|
2884
|
-
/* @__PURE__ */ e.jsx(M, { fontSize: "sm", color: "gray.600", children: ke(
|
|
2885
|
-
!
|
|
2878
|
+
/* @__PURE__ */ e.jsx(M, { fontSize: "sm", color: "gray.600", children: ke(j.kind) }),
|
|
2879
|
+
!n && /* @__PURE__ */ e.jsx(
|
|
2886
2880
|
te,
|
|
2887
2881
|
{
|
|
2888
2882
|
size: "xs",
|
|
2889
2883
|
colorScheme: "red",
|
|
2890
2884
|
variant: "ghost",
|
|
2891
|
-
onClick: () => Dt(
|
|
2885
|
+
onClick: () => Dt(j.id),
|
|
2892
2886
|
children: "Remove"
|
|
2893
2887
|
}
|
|
2894
2888
|
)
|
|
@@ -2898,14 +2892,14 @@ const Rn = ({
|
|
|
2898
2892
|
/* @__PURE__ */ e.jsx(
|
|
2899
2893
|
ye,
|
|
2900
2894
|
{
|
|
2901
|
-
value:
|
|
2895
|
+
value: j.name,
|
|
2902
2896
|
onChange: (z) => re(
|
|
2903
2897
|
(P) => P.map(
|
|
2904
|
-
(F) => F.id ===
|
|
2898
|
+
(F) => F.id === j.id ? { ...F, name: z.target.value } : F
|
|
2905
2899
|
)
|
|
2906
2900
|
),
|
|
2907
2901
|
placeholder: "Enter report name...",
|
|
2908
|
-
isDisabled:
|
|
2902
|
+
isDisabled: n
|
|
2909
2903
|
}
|
|
2910
2904
|
)
|
|
2911
2905
|
] }),
|
|
@@ -2913,7 +2907,7 @@ const Rn = ({
|
|
|
2913
2907
|
/* @__PURE__ */ e.jsx(
|
|
2914
2908
|
_e,
|
|
2915
2909
|
{
|
|
2916
|
-
htmlFor: `auto-generate-${
|
|
2910
|
+
htmlFor: `auto-generate-${j.id}`,
|
|
2917
2911
|
mb: "0",
|
|
2918
2912
|
children: "Auto Generate"
|
|
2919
2913
|
}
|
|
@@ -2921,63 +2915,63 @@ const Rn = ({
|
|
|
2921
2915
|
/* @__PURE__ */ e.jsx(
|
|
2922
2916
|
on,
|
|
2923
2917
|
{
|
|
2924
|
-
id: `auto-generate-${
|
|
2925
|
-
isChecked:
|
|
2918
|
+
id: `auto-generate-${j.id}`,
|
|
2919
|
+
isChecked: j.autoGenerate ?? !1,
|
|
2926
2920
|
onChange: (z) => re(
|
|
2927
2921
|
(P) => P.map(
|
|
2928
|
-
(F) => F.id ===
|
|
2922
|
+
(F) => F.id === j.id ? { ...F, autoGenerate: z.target.checked } : F
|
|
2929
2923
|
)
|
|
2930
2924
|
),
|
|
2931
|
-
isDisabled:
|
|
2925
|
+
isDisabled: n
|
|
2932
2926
|
}
|
|
2933
2927
|
)
|
|
2934
2928
|
] }),
|
|
2935
|
-
|
|
2929
|
+
j.kind === ie.PointOfInterest && /* @__PURE__ */ e.jsxs(X, { children: [
|
|
2936
2930
|
/* @__PURE__ */ e.jsx(le, { children: "Instructions" }),
|
|
2937
2931
|
/* @__PURE__ */ e.jsx(
|
|
2938
2932
|
Qe,
|
|
2939
2933
|
{
|
|
2940
|
-
value:
|
|
2934
|
+
value: j.instructions,
|
|
2941
2935
|
onChange: (z) => re(
|
|
2942
2936
|
(P) => P.map(
|
|
2943
|
-
(F) => F.id ===
|
|
2937
|
+
(F) => F.id === j.id ? { ...F, instructions: z.target.value } : F
|
|
2944
2938
|
)
|
|
2945
2939
|
),
|
|
2946
2940
|
rows: 3,
|
|
2947
2941
|
placeholder: "Enter specific instructions for this report...",
|
|
2948
|
-
isDisabled:
|
|
2942
|
+
isDisabled: n
|
|
2949
2943
|
}
|
|
2950
2944
|
)
|
|
2951
2945
|
] }),
|
|
2952
|
-
|
|
2946
|
+
j.kind !== ie.PointOfInterest && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
|
|
2953
2947
|
/* @__PURE__ */ e.jsx(le, { children: "Default Parameters" }),
|
|
2954
2948
|
/* @__PURE__ */ e.jsx(
|
|
2955
2949
|
yt,
|
|
2956
2950
|
{
|
|
2957
2951
|
options: we,
|
|
2958
|
-
value:
|
|
2952
|
+
value: j.parameters,
|
|
2959
2953
|
onChange: (z) => {
|
|
2960
2954
|
const P = (ee) => "joint" in ee.id ? ee.id.joint : ee.id.segment, F = z.map(P), ne = jt(F);
|
|
2961
2955
|
re(
|
|
2962
2956
|
(ee) => ee.map(
|
|
2963
|
-
(de) => de.id ===
|
|
2957
|
+
(de) => de.id === j.id ? { ...de, parameters: z, sensorLocations: ne } : de
|
|
2964
2958
|
)
|
|
2965
2959
|
);
|
|
2966
2960
|
},
|
|
2967
|
-
editOnly:
|
|
2961
|
+
editOnly: n
|
|
2968
2962
|
}
|
|
2969
2963
|
)
|
|
2970
2964
|
] }),
|
|
2971
|
-
|
|
2965
|
+
j.kind !== ie.PointOfInterest && /* @__PURE__ */ e.jsxs(M, { fontSize: "sm", color: "gray.600", children: [
|
|
2972
2966
|
"Sensors:",
|
|
2973
2967
|
" ",
|
|
2974
|
-
|
|
2968
|
+
j.sensorLocations.map(
|
|
2975
2969
|
(z) => vt(z)
|
|
2976
2970
|
).join(", ")
|
|
2977
2971
|
] })
|
|
2978
2972
|
]
|
|
2979
2973
|
},
|
|
2980
|
-
|
|
2974
|
+
j.id
|
|
2981
2975
|
)) })
|
|
2982
2976
|
] })
|
|
2983
2977
|
]
|
|
@@ -2989,15 +2983,15 @@ const Rn = ({
|
|
|
2989
2983
|
V,
|
|
2990
2984
|
{
|
|
2991
2985
|
justify: "end",
|
|
2992
|
-
className: Je((m ||
|
|
2986
|
+
className: Je((m || n) && "!hidden"),
|
|
2993
2987
|
children: /* @__PURE__ */ e.jsxs(Ne, { gap: 4, children: [
|
|
2994
|
-
/* @__PURE__ */ e.jsx(te, { colorScheme: "gray", isDisabled:
|
|
2988
|
+
/* @__PURE__ */ e.jsx(te, { colorScheme: "gray", isDisabled: f, onClick: r, children: "Cancel" }),
|
|
2995
2989
|
/* @__PURE__ */ e.jsx(
|
|
2996
2990
|
te,
|
|
2997
2991
|
{
|
|
2998
2992
|
colorScheme: "blue",
|
|
2999
|
-
isDisabled:
|
|
3000
|
-
isLoading:
|
|
2993
|
+
isDisabled: f || !ze || !Re,
|
|
2994
|
+
isLoading: f,
|
|
3001
2995
|
onClick: Le,
|
|
3002
2996
|
children: "Save changes"
|
|
3003
2997
|
}
|
|
@@ -3008,45 +3002,45 @@ const Rn = ({
|
|
|
3008
3002
|
] });
|
|
3009
3003
|
}, le = ({ children: s }) => /* @__PURE__ */ e.jsx(_e, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: s }), es = ({
|
|
3010
3004
|
children: s,
|
|
3011
|
-
isView:
|
|
3005
|
+
isView: t,
|
|
3012
3006
|
metadataKeys: r
|
|
3013
3007
|
}) => {
|
|
3014
3008
|
const [p, m] = q({}), h = lt();
|
|
3015
3009
|
return ce(() => {
|
|
3016
|
-
let
|
|
3010
|
+
let d = !1;
|
|
3017
3011
|
return (async () => {
|
|
3018
|
-
const
|
|
3012
|
+
const n = (r ?? []).map(
|
|
3019
3013
|
(y) => h.query(at, { key: y }).toPromise()
|
|
3020
|
-
), o = await Promise.all(
|
|
3014
|
+
), o = await Promise.all(n), u = {};
|
|
3021
3015
|
for (const y of o) {
|
|
3022
3016
|
if (y.error || !y.data?.getMetadataByKey) continue;
|
|
3023
|
-
const
|
|
3017
|
+
const b = A(
|
|
3024
3018
|
je,
|
|
3025
3019
|
y.data.getMetadataByKey
|
|
3026
3020
|
);
|
|
3027
|
-
if (!
|
|
3028
|
-
const w = A(be,
|
|
3029
|
-
u[
|
|
3021
|
+
if (!b) continue;
|
|
3022
|
+
const w = A(be, b.data) ?? [];
|
|
3023
|
+
u[b.key] = w.map((I) => ({
|
|
3030
3024
|
label: I.label || I.value,
|
|
3031
3025
|
value: I.value,
|
|
3032
3026
|
id: I.id
|
|
3033
3027
|
}));
|
|
3034
3028
|
}
|
|
3035
|
-
|
|
3029
|
+
d || m(u);
|
|
3036
3030
|
})(), () => {
|
|
3037
|
-
|
|
3031
|
+
d = !0;
|
|
3038
3032
|
};
|
|
3039
|
-
}, [h, r]), /* @__PURE__ */ e.jsx($t.Provider, { value: { isView:
|
|
3033
|
+
}, [h, r]), /* @__PURE__ */ e.jsx($t.Provider, { value: { isView: t, metadataOptions: p }, children: s });
|
|
3040
3034
|
}, Cs = ({
|
|
3041
3035
|
id: s,
|
|
3042
|
-
onCancel:
|
|
3036
|
+
onCancel: t,
|
|
3043
3037
|
onSave: r,
|
|
3044
3038
|
onError: p,
|
|
3045
3039
|
hideButtons: m,
|
|
3046
3040
|
quantumOwned: h,
|
|
3047
|
-
setButtonOnClick:
|
|
3048
|
-
setButtonDisabled:
|
|
3049
|
-
isView:
|
|
3041
|
+
setButtonOnClick: d,
|
|
3042
|
+
setButtonDisabled: g,
|
|
3043
|
+
isView: n
|
|
3050
3044
|
}) => {
|
|
3051
3045
|
const [{ data: o, fetching: u }] = Ce({
|
|
3052
3046
|
query: h ? hn : pn
|
|
@@ -3054,90 +3048,90 @@ const Rn = ({
|
|
|
3054
3048
|
query: gn,
|
|
3055
3049
|
variables: { id: s },
|
|
3056
3050
|
pause: !s
|
|
3057
|
-
}), [{ data:
|
|
3051
|
+
}), [{ data: b }] = Ce({
|
|
3058
3052
|
query: xn
|
|
3059
3053
|
}), w = A(
|
|
3060
3054
|
Pe,
|
|
3061
|
-
|
|
3062
|
-
), [{ fetching: I }, L] = fe(Ot), [{ fetching:
|
|
3055
|
+
b?.moduleCategories
|
|
3056
|
+
), [{ fetching: I }, L] = fe(Ot), [{ fetching: f }, c] = fe(At), k = $(() => !o || u ? [] : A(
|
|
3063
3057
|
ve,
|
|
3064
3058
|
h ? o?.quantumOwnedActions ?? [] : o?.actions ?? []
|
|
3065
|
-
).filter((U) => !!U?.id), [o, h, u]),
|
|
3059
|
+
).filter((U) => !!U?.id), [o, h, u]), x = A(Ye, y?.module), N = $(() => A(Tt, x?.moduleActions) ?? [], [x?.moduleActions]), [v, E] = q([]), [R, O] = q(x?.name ?? ""), [K, oe] = q([]), [D, ae] = q(x?.description ?? ""), [Z, T] = q([]);
|
|
3066
3060
|
ce(() => {
|
|
3067
|
-
if (
|
|
3068
|
-
const J =
|
|
3061
|
+
if (x) {
|
|
3062
|
+
const J = N.map((i, a) => ({
|
|
3069
3063
|
key: i.id ?? `${i.actionId}-${a}`,
|
|
3070
3064
|
actionId: i.actionId,
|
|
3071
3065
|
reportId: i.reportId || null
|
|
3072
3066
|
}));
|
|
3073
|
-
E(J), O(
|
|
3074
|
-
|
|
3067
|
+
E(J), O(x.name), ae(x.description ?? ""), oe(
|
|
3068
|
+
x.categories.map(
|
|
3075
3069
|
(i) => A(Pe, i).id
|
|
3076
3070
|
) ?? []
|
|
3077
3071
|
);
|
|
3078
|
-
const
|
|
3072
|
+
const Y = A(
|
|
3079
3073
|
je,
|
|
3080
|
-
|
|
3074
|
+
x.metadataGroups
|
|
3081
3075
|
).map(
|
|
3082
3076
|
(i) => i.data.map((a) => A(be, a).id)
|
|
3083
3077
|
);
|
|
3084
|
-
T(
|
|
3078
|
+
T(Y.flat());
|
|
3085
3079
|
}
|
|
3086
|
-
}, [
|
|
3080
|
+
}, [x, N]);
|
|
3087
3081
|
const B = _(() => {
|
|
3088
3082
|
let J;
|
|
3089
3083
|
const U = {
|
|
3090
|
-
moduleActions: v.map((
|
|
3091
|
-
actionId:
|
|
3092
|
-
reportId:
|
|
3084
|
+
moduleActions: v.map((Y) => ({
|
|
3085
|
+
actionId: Y.actionId,
|
|
3086
|
+
reportId: Y.reportId ?? void 0
|
|
3093
3087
|
})),
|
|
3094
|
-
name:
|
|
3095
|
-
categories: K
|
|
3088
|
+
name: R,
|
|
3089
|
+
categories: K,
|
|
3096
3090
|
description: D,
|
|
3097
3091
|
quantumOwned: h,
|
|
3098
3092
|
metadataItemIds: Z
|
|
3099
3093
|
};
|
|
3100
|
-
|
|
3101
|
-
id:
|
|
3094
|
+
x ? J = L({
|
|
3095
|
+
id: x.id,
|
|
3102
3096
|
input: U
|
|
3103
|
-
}) : J =
|
|
3097
|
+
}) : J = c({
|
|
3104
3098
|
input: U
|
|
3105
|
-
}), J.then(({ error:
|
|
3106
|
-
|
|
3099
|
+
}), J.then(({ error: Y }) => {
|
|
3100
|
+
Y ? p(Y instanceof Error ? Y : new Error(String(Y))) : r();
|
|
3107
3101
|
});
|
|
3108
3102
|
}, [
|
|
3109
|
-
|
|
3103
|
+
c,
|
|
3110
3104
|
L,
|
|
3111
3105
|
v,
|
|
3112
|
-
|
|
3106
|
+
R,
|
|
3113
3107
|
D,
|
|
3114
3108
|
K,
|
|
3115
3109
|
Z,
|
|
3116
|
-
|
|
3110
|
+
x,
|
|
3117
3111
|
r,
|
|
3118
3112
|
p,
|
|
3119
3113
|
h
|
|
3120
3114
|
]);
|
|
3121
3115
|
return ce(() => {
|
|
3122
|
-
|
|
3123
|
-
cancelButton: I ||
|
|
3124
|
-
saveButton: I ||
|
|
3116
|
+
g && g({
|
|
3117
|
+
cancelButton: I || f,
|
|
3118
|
+
saveButton: I || f || !R || D.trim().split(/\s+/).filter(Boolean).length > 40
|
|
3125
3119
|
});
|
|
3126
|
-
}, [
|
|
3127
|
-
|
|
3128
|
-
cancelButton:
|
|
3120
|
+
}, [g, I, f, v, R, D]), ce(() => {
|
|
3121
|
+
d && d({
|
|
3122
|
+
cancelButton: t,
|
|
3129
3123
|
saveButton: B
|
|
3130
3124
|
});
|
|
3131
|
-
}, [
|
|
3125
|
+
}, [d, t, B]), /* @__PURE__ */ e.jsx(se, { width: "100%", children: /* @__PURE__ */ e.jsxs(
|
|
3132
3126
|
es,
|
|
3133
3127
|
{
|
|
3134
|
-
isView:
|
|
3128
|
+
isView: n,
|
|
3135
3129
|
metadataKeys: ["activity_type", "session_type", "body_region", "sport"],
|
|
3136
3130
|
children: [
|
|
3137
3131
|
/* @__PURE__ */ e.jsx(
|
|
3138
3132
|
Wn,
|
|
3139
3133
|
{
|
|
3140
|
-
name:
|
|
3134
|
+
name: R,
|
|
3141
3135
|
setName: O,
|
|
3142
3136
|
actions: k,
|
|
3143
3137
|
moduleActionEntries: v,
|
|
@@ -3151,13 +3145,13 @@ const Rn = ({
|
|
|
3151
3145
|
setSelectedMetadataIds: T
|
|
3152
3146
|
}
|
|
3153
3147
|
),
|
|
3154
|
-
!m && !
|
|
3148
|
+
!m && !n && /* @__PURE__ */ e.jsx(V, { justifyContent: "flex-start", children: /* @__PURE__ */ e.jsxs(Ne, { mt: 16, gap: 4, children: [
|
|
3155
3149
|
/* @__PURE__ */ e.jsx(
|
|
3156
3150
|
te,
|
|
3157
3151
|
{
|
|
3158
3152
|
colorScheme: "gray",
|
|
3159
|
-
isDisabled: I ||
|
|
3160
|
-
onClick:
|
|
3153
|
+
isDisabled: I || f,
|
|
3154
|
+
onClick: t,
|
|
3161
3155
|
children: "Cancel"
|
|
3162
3156
|
}
|
|
3163
3157
|
),
|
|
@@ -3165,8 +3159,8 @@ const Rn = ({
|
|
|
3165
3159
|
te,
|
|
3166
3160
|
{
|
|
3167
3161
|
colorScheme: "blue",
|
|
3168
|
-
isDisabled: I ||
|
|
3169
|
-
isLoading: I ||
|
|
3162
|
+
isDisabled: I || f || !R || D.trim().split(/\s+/).filter(Boolean).length > 40,
|
|
3163
|
+
isLoading: I || f,
|
|
3170
3164
|
onClick: B,
|
|
3171
3165
|
children: "Save"
|
|
3172
3166
|
}
|