quantum-component-library 1.4.48-dev.6 → 1.4.48-dev.7
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 +495 -497
- package/dist/quantum-component-library.css +1 -1
- package/dist/react-icons-vendor-BF_sZq07.cjs +1 -0
- package/dist/{react-icons-vendor-TETORdU9.js → react-icons-vendor-CMsTQrA0.js} +51 -43
- package/package.json +1 -1
- package/dist/react-icons-vendor-D2s8zw9h.cjs +0 -1
package/dist/components.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { j as e } from "./react-jsx-runtime-vendor-OVHDjVDe.js";
|
|
2
|
-
import { Flex as fe, InputGroup as Ge, InputLeftElement as
|
|
3
|
-
import { useMemo as A, useState as z, useCallback as
|
|
4
|
-
import { useQuery as he, useMutation as
|
|
5
|
-
import "./
|
|
6
|
-
import { useUiLabelContext as pe, usePartOptionsForSensorLocations as
|
|
7
|
-
import { u as
|
|
2
|
+
import { Flex as fe, InputGroup as Ge, InputLeftElement as gt, Icon as Je, Input as ye, FormLabel as Xe, Box as V, TableContainer as Ze, Table as Ke, Thead as Ve, Tr as Oe, Th as xe, Tbody as et, Td as je, ButtonGroup as be, Tooltip as _e, Button as ee, RangeSlider as xt, RangeSliderMark as De, Text as v, RangeSliderTrack as ft, RangeSliderFilledTrack as jt, RangeSliderThumb as We, Select as Ue, NumberInput as Be, NumberInputField as Qe, HStack as re, Tag as ve, Image as bt, useToast as tt, VStack as oe, FormControl as K, RadioGroup as nt, Radio as Ne, Alert as ke, AlertIcon as $e, Spinner as st, useDisclosure as Ct, Modal as yt, ModalOverlay as vt, ModalContent as wt, ModalHeader as Lt, ModalCloseButton as St, ModalBody as Mt, ModalFooter as At, IconButton as Tt, Textarea as qe } from "@chakra-ui/react";
|
|
3
|
+
import { useMemo as A, useState as z, useCallback as R, useRef as It, useEffect as ae, memo as Fe } from "react";
|
|
4
|
+
import { useQuery as he, useMutation as ie, useClient as Ot } from "urql";
|
|
5
|
+
import { cn as ot, thresholdsToParameters as Nt, parametersToThresholds as Ye } from "./utils.js";
|
|
6
|
+
import { useUiLabelContext as pe, usePartOptionsForSensorLocations as kt } from "./hooks.js";
|
|
7
|
+
import { u as $t } from "./ufuzzy-vendor-Dl0ZI6Av.js";
|
|
8
|
+
import { F as Ft, a as Rt, b as Dt, c as Et } from "./react-icons-vendor-CMsTQrA0.js";
|
|
8
9
|
import { s as de } from "./react-select-vendor-D8Fzpeg3.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import { D as
|
|
13
|
-
import { ThresholdKind as Ie, SensorLocation as G, ActionLaterality as
|
|
14
|
-
import { getSegmentNameWithPlane as
|
|
15
|
-
import { availablePlanes as
|
|
16
|
-
|
|
17
|
-
const en = ({
|
|
10
|
+
import { getFragmentData as _ } from "./generated.js";
|
|
11
|
+
import { G as rt, a as Pt, C as ze, b as at, M as we, c as Ee, A as me, d as Pe, e as lt, f as _t, g as it, U as ct, h as Te, i as dt, j as zt, k as Gt, l as Wt, m as Ut, n as Bt, o as Qt, p as qt } from "./graphql-_vGi4u4K.js";
|
|
12
|
+
import "./moment-vendor-DMLRxgRE.js";
|
|
13
|
+
import { D as Yt, H as Ht, u as Jt, a as Xt } from "./react-dnd-vendor-DQO87S4J.js";
|
|
14
|
+
import { ThresholdKind as Ie, SensorLocation as G, ActionLaterality as Zt } from "./generated-graphql.js";
|
|
15
|
+
import { getSegmentNameWithPlane as ut, getJointNameWithPlane as ht, getJointAngleDirectionName as Kt, getSegmentAngleDirectionName as Vt, getNormativeJointRange as en } from "./services.js";
|
|
16
|
+
import { availablePlanes as He, getAnalysisPartIdNoSide as Se } from "./types.js";
|
|
17
|
+
const tn = ({
|
|
18
18
|
setSearch: n,
|
|
19
19
|
actions: t,
|
|
20
|
-
updateUseCases:
|
|
20
|
+
updateUseCases: a,
|
|
21
21
|
hideUseCaseFilter: c = !1
|
|
22
22
|
}) => {
|
|
23
23
|
const u = A(
|
|
24
|
-
() => t?.flatMap((
|
|
25
|
-
label:
|
|
26
|
-
value:
|
|
24
|
+
() => t?.flatMap((i) => i.useCases).filter((i, d, m) => m.findIndex((l) => l.id === i.id) === d).map((i) => ({
|
|
25
|
+
label: i.name,
|
|
26
|
+
value: i.id
|
|
27
27
|
})) || [],
|
|
28
28
|
[t]
|
|
29
29
|
);
|
|
30
30
|
return /* @__PURE__ */ e.jsxs(fe, { width: "100%", alignContent: "space-evenly", gap: 4, children: [
|
|
31
31
|
/* @__PURE__ */ e.jsxs(Ge, { size: "md", flex: 1, children: [
|
|
32
|
-
/* @__PURE__ */ e.jsx(
|
|
32
|
+
/* @__PURE__ */ e.jsx(gt, { children: /* @__PURE__ */ e.jsx(Je, { as: Ft, color: "gray.300" }) }),
|
|
33
33
|
/* @__PURE__ */ e.jsx(
|
|
34
34
|
ye,
|
|
35
35
|
{
|
|
36
36
|
placeholder: "Search by name...",
|
|
37
37
|
width: "100%",
|
|
38
38
|
maxW: c ? void 0 : "30rem",
|
|
39
|
-
onChange: (
|
|
39
|
+
onChange: (i) => n(i.target.value)
|
|
40
40
|
}
|
|
41
41
|
)
|
|
42
42
|
] }),
|
|
@@ -45,8 +45,8 @@ const en = ({
|
|
|
45
45
|
{
|
|
46
46
|
size: "md",
|
|
47
47
|
chakraStyles: {
|
|
48
|
-
container: (
|
|
49
|
-
...
|
|
48
|
+
container: (i) => ({
|
|
49
|
+
...i,
|
|
50
50
|
width: "100%"
|
|
51
51
|
})
|
|
52
52
|
},
|
|
@@ -54,34 +54,34 @@ const en = ({
|
|
|
54
54
|
placeholder: "Filter use case",
|
|
55
55
|
isMulti: !0,
|
|
56
56
|
options: u,
|
|
57
|
-
onChange: (
|
|
57
|
+
onChange: (i) => a(i.map((d) => d.value))
|
|
58
58
|
}
|
|
59
59
|
) })
|
|
60
60
|
] });
|
|
61
61
|
}, ce = ({
|
|
62
62
|
children: n
|
|
63
|
-
}) => /* @__PURE__ */ e.jsx(Xe, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: n }),
|
|
64
|
-
const
|
|
63
|
+
}) => /* @__PURE__ */ e.jsx(Xe, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: n }), nn = ({ value: n, onChange: t }) => {
|
|
64
|
+
const a = z(
|
|
65
65
|
() => Math.random().toString(36).substring(2, 15)
|
|
66
|
-
)[0], c =
|
|
67
|
-
(u,
|
|
66
|
+
)[0], c = R(
|
|
67
|
+
(u, i) => {
|
|
68
68
|
t((d) => {
|
|
69
|
-
const m = [...d], [
|
|
70
|
-
return m.splice(
|
|
69
|
+
const m = [...d], [l] = m.splice(u, 1);
|
|
70
|
+
return m.splice(i, 0, l), m;
|
|
71
71
|
});
|
|
72
72
|
},
|
|
73
73
|
[t]
|
|
74
74
|
);
|
|
75
|
-
return /* @__PURE__ */ e.jsx(V, { children: /* @__PURE__ */ e.jsx(
|
|
75
|
+
return /* @__PURE__ */ e.jsx(V, { children: /* @__PURE__ */ e.jsx(Yt, { backend: Ht, children: /* @__PURE__ */ e.jsx(Ze, { children: /* @__PURE__ */ e.jsxs(Ke, { variant: "simple", size: "md", children: [
|
|
76
76
|
/* @__PURE__ */ e.jsx(Ve, { children: /* @__PURE__ */ e.jsxs(Oe, { children: [
|
|
77
77
|
/* @__PURE__ */ e.jsx(xe, { children: "Order" }),
|
|
78
78
|
/* @__PURE__ */ e.jsx(xe, { children: "Name" })
|
|
79
79
|
] }) }),
|
|
80
|
-
/* @__PURE__ */ e.jsx(et, { children: n.map((u,
|
|
81
|
-
|
|
80
|
+
/* @__PURE__ */ e.jsx(et, { children: n.map((u, i) => /* @__PURE__ */ e.jsx(
|
|
81
|
+
sn,
|
|
82
82
|
{
|
|
83
|
-
listKey:
|
|
84
|
-
index:
|
|
83
|
+
listKey: a,
|
|
84
|
+
index: i,
|
|
85
85
|
id: u.id,
|
|
86
86
|
name: u.name,
|
|
87
87
|
move: c
|
|
@@ -89,103 +89,103 @@ const en = ({
|
|
|
89
89
|
u.id
|
|
90
90
|
)) })
|
|
91
91
|
] }) }) }) });
|
|
92
|
-
},
|
|
93
|
-
const
|
|
92
|
+
}, sn = ({ listKey: n, index: t, id: a, name: c, move: u }) => {
|
|
93
|
+
const i = It(null), [{ handlerId: d }, m] = Jt({
|
|
94
94
|
accept: n,
|
|
95
95
|
collect: (p) => ({
|
|
96
96
|
handlerId: p.getHandlerId()?.toString() ?? ""
|
|
97
97
|
}),
|
|
98
98
|
hover: (p, L) => {
|
|
99
|
-
if (!
|
|
99
|
+
if (!i.current)
|
|
100
100
|
return;
|
|
101
101
|
const b = p.index, s = t;
|
|
102
102
|
if (b === s)
|
|
103
103
|
return;
|
|
104
|
-
const f =
|
|
104
|
+
const f = i.current?.getBoundingClientRect(), C = (f.bottom - f.top) / 2, S = L.getClientOffset().y - f.top;
|
|
105
105
|
b < s && S < C || b > s && S > C || (u(b, s), p.index = s);
|
|
106
106
|
}
|
|
107
|
-
}), [{ isDragging:
|
|
107
|
+
}), [{ isDragging: l }, x] = Xt({
|
|
108
108
|
type: n,
|
|
109
|
-
item: () => ({ id:
|
|
109
|
+
item: () => ({ id: a, index: t }),
|
|
110
110
|
collect: (p) => ({
|
|
111
111
|
isDragging: p.isDragging()
|
|
112
112
|
})
|
|
113
|
-
}), h =
|
|
114
|
-
return x(m(
|
|
113
|
+
}), h = l ? 0.6 : 1, T = l ? "grabbing" : "grab";
|
|
114
|
+
return x(m(i)), /* @__PURE__ */ e.jsxs(Oe, { ref: i, style: { opacity: h, cursor: T }, "data-handler-id": d, children: [
|
|
115
115
|
/* @__PURE__ */ e.jsx(je, { children: t + 1 }),
|
|
116
116
|
/* @__PURE__ */ e.jsx(je, { children: c })
|
|
117
117
|
] });
|
|
118
|
-
},
|
|
118
|
+
}, on = ({
|
|
119
119
|
items: n,
|
|
120
120
|
onChange: t,
|
|
121
|
-
selectedItem:
|
|
121
|
+
selectedItem: a,
|
|
122
122
|
isDisabled: c,
|
|
123
123
|
selectedProps: u,
|
|
124
|
-
buttonProps:
|
|
124
|
+
buttonProps: i
|
|
125
125
|
}) => {
|
|
126
|
-
const d = (
|
|
127
|
-
return /* @__PURE__ */ e.jsx(be, { isAttached: !0, isDisabled: c, children: n.map((
|
|
128
|
-
|
|
126
|
+
const d = (l) => l === a || l.value === a, m = (l) => d(l) ? { ...i, ...u } : i;
|
|
127
|
+
return /* @__PURE__ */ e.jsx(be, { isAttached: !0, isDisabled: c, children: n.map((l, x) => /* @__PURE__ */ e.jsx(
|
|
128
|
+
_e,
|
|
129
129
|
{
|
|
130
|
-
label:
|
|
130
|
+
label: l.tooltip,
|
|
131
131
|
openDelay: 50,
|
|
132
132
|
closeDelay: 200,
|
|
133
133
|
placement: "top",
|
|
134
|
-
visibility:
|
|
134
|
+
visibility: l.tooltip ? "visible" : "hidden",
|
|
135
135
|
hasArrow: !0,
|
|
136
136
|
children: /* @__PURE__ */ e.jsx(
|
|
137
137
|
ee,
|
|
138
138
|
{
|
|
139
|
-
onClick: () => d(
|
|
140
|
-
isDisabled:
|
|
141
|
-
...m(
|
|
142
|
-
children:
|
|
139
|
+
onClick: () => d(l) ? null : t(l, x),
|
|
140
|
+
isDisabled: l.disabled,
|
|
141
|
+
...m(l),
|
|
142
|
+
children: l.label
|
|
143
143
|
}
|
|
144
144
|
)
|
|
145
145
|
},
|
|
146
146
|
x
|
|
147
147
|
)) });
|
|
148
|
-
}, Me = (n, t) => t < 0 ? -1 * Math.abs(n) : Math.abs(n),
|
|
148
|
+
}, Me = (n, t) => t < 0 ? -1 * Math.abs(n) : Math.abs(n), rn = ({
|
|
149
149
|
isReversed: n,
|
|
150
150
|
min: t,
|
|
151
|
-
max:
|
|
151
|
+
max: a,
|
|
152
152
|
value: c,
|
|
153
153
|
onChange: u,
|
|
154
|
-
inputProps:
|
|
154
|
+
inputProps: i,
|
|
155
155
|
size: d,
|
|
156
156
|
zeroMarker: m,
|
|
157
|
-
formatValue:
|
|
157
|
+
formatValue: l,
|
|
158
158
|
valueLabel: x,
|
|
159
159
|
positiveNegativeLabels: h,
|
|
160
160
|
isDisabled: T,
|
|
161
161
|
...p
|
|
162
162
|
}) => {
|
|
163
|
-
const [L, b] = z([void 0, void 0]), s = L[0], f = L[1], C = m && t < -5 &&
|
|
163
|
+
const [L, b] = z([void 0, void 0]), s = L[0], f = L[1], C = m && t < -5 && a > 5, j = Number(c?.[0] ?? f ?? t) > 0 ? 1 : -1, S = Number(c?.[1] ?? f ?? a) < 0 ? -1 : 1, F = h?.[0] === h?.[1], N = c?.[0], B = c?.[1];
|
|
164
164
|
ae(() => {
|
|
165
|
-
|
|
166
|
-
}, [
|
|
167
|
-
const k =
|
|
165
|
+
N !== void 0 && B !== void 0 && b([N.toFixed(0), B.toFixed(0)]);
|
|
166
|
+
}, [N, B, b]);
|
|
167
|
+
const k = R(
|
|
168
168
|
([y, D]) => {
|
|
169
169
|
y < D && b([y.toFixed(0), D.toFixed(0)]);
|
|
170
170
|
},
|
|
171
171
|
[b]
|
|
172
|
-
), $ =
|
|
172
|
+
), $ = R(
|
|
173
173
|
([y, D]) => {
|
|
174
174
|
y < D && u([y, D]);
|
|
175
175
|
},
|
|
176
176
|
[u]
|
|
177
|
-
), M =
|
|
177
|
+
), M = R(() => {
|
|
178
178
|
b(([y, D]) => {
|
|
179
|
-
const X = isNaN(Number(y)) ? t : Number(y), Z = isNaN(Number(D)) ?
|
|
179
|
+
const X = isNaN(Number(y)) ? t : Number(y), Z = isNaN(Number(D)) ? a : Number(D), E = Me(Number(X), j), r = Me(Number(Z), S), o = j < 0 ? Math.max(E, t) : Math.min(E, a), w = S < 0 ? Math.max(r, t) : Math.min(r, a);
|
|
180
180
|
return o > w ? (u([w, o]), [w.toFixed(0), o.toFixed(0)]) : (u([o, w]), [o.toFixed(0), w.toFixed(0)]);
|
|
181
181
|
});
|
|
182
|
-
}, [u, b, j, S, t,
|
|
182
|
+
}, [u, b, j, S, t, a]), se = R(
|
|
183
183
|
(y) => {
|
|
184
184
|
const D = y === "" || isNaN(Number(y)) ? y : Me(Number(y), j);
|
|
185
185
|
b(([X, Z]) => [D.toString(), Z]);
|
|
186
186
|
},
|
|
187
187
|
[b, j]
|
|
188
|
-
), J =
|
|
188
|
+
), J = R(
|
|
189
189
|
(y) => {
|
|
190
190
|
const D = y === "" || isNaN(Number(y)) ? y : Me(Number(y), S);
|
|
191
191
|
b(([X, Z]) => [X, D.toString()]);
|
|
@@ -194,24 +194,24 @@ const en = ({
|
|
|
194
194
|
), g = A(
|
|
195
195
|
() => d === "xs" ? "0.75rem" : void 0,
|
|
196
196
|
[d]
|
|
197
|
-
),
|
|
197
|
+
), I = R(
|
|
198
198
|
(y, D) => {
|
|
199
199
|
const X = Number(D.target.value);
|
|
200
200
|
if (!s || !f || ![-1, 1].includes(X))
|
|
201
201
|
return;
|
|
202
|
-
const Z = (o) => X < 0 ? -1 * Math.abs(o) : Math.abs(o), E = y ? Z(Number(s)) : Number(s),
|
|
203
|
-
E >
|
|
202
|
+
const Z = (o) => X < 0 ? -1 * Math.abs(o) : Math.abs(o), E = y ? Z(Number(s)) : Number(s), r = y ? Number(f) : Z(Number(f));
|
|
203
|
+
E > r ? u([r, E]) : u([E, r]);
|
|
204
204
|
},
|
|
205
205
|
[s, f, u]
|
|
206
206
|
);
|
|
207
207
|
return /* @__PURE__ */ e.jsxs(fe, { direction: "column", ...p, children: [
|
|
208
208
|
/* @__PURE__ */ e.jsx(V, { pt: "1em", mb: "-0.5em", children: /* @__PURE__ */ e.jsxs(
|
|
209
|
-
|
|
209
|
+
xt,
|
|
210
210
|
{
|
|
211
211
|
"aria-label": ["min", "max"],
|
|
212
212
|
isReversed: n,
|
|
213
|
-
value: [Number(s ?? t), Number(f ??
|
|
214
|
-
max:
|
|
213
|
+
value: [Number(s ?? t), Number(f ?? a)],
|
|
214
|
+
max: a,
|
|
215
215
|
min: t,
|
|
216
216
|
minStepsBetweenThumbs: 3,
|
|
217
217
|
step: 1,
|
|
@@ -225,21 +225,21 @@ const en = ({
|
|
|
225
225
|
fontSize: d ?? "sm",
|
|
226
226
|
fontWeight: "semibold",
|
|
227
227
|
whiteSpace: "nowrap",
|
|
228
|
-
children:
|
|
228
|
+
children: l ? l?.(t) : t
|
|
229
229
|
}
|
|
230
230
|
) }),
|
|
231
|
-
/* @__PURE__ */ e.jsx(De, { value:
|
|
231
|
+
/* @__PURE__ */ e.jsx(De, { value: a, top: "-1em", children: /* @__PURE__ */ e.jsx(
|
|
232
232
|
v,
|
|
233
233
|
{
|
|
234
234
|
fontSize: d ?? "sm",
|
|
235
235
|
fontWeight: "semibold",
|
|
236
236
|
style: { transform: "translateX(-100%)" },
|
|
237
237
|
whiteSpace: "nowrap",
|
|
238
|
-
children:
|
|
238
|
+
children: l ? l(a) : a
|
|
239
239
|
}
|
|
240
240
|
) }),
|
|
241
241
|
C && /* @__PURE__ */ e.jsxs(De, { value: 0, top: "-1em", pos: "relative", children: [
|
|
242
|
-
/* @__PURE__ */ e.jsx(v, { fontSize: d, fontWeight: "semibold", children:
|
|
242
|
+
/* @__PURE__ */ e.jsx(v, { fontSize: d, fontWeight: "semibold", children: l?.(0) ?? "0" }),
|
|
243
243
|
/* @__PURE__ */ e.jsx(
|
|
244
244
|
V,
|
|
245
245
|
{
|
|
@@ -252,7 +252,7 @@ const en = ({
|
|
|
252
252
|
}
|
|
253
253
|
)
|
|
254
254
|
] }),
|
|
255
|
-
/* @__PURE__ */ e.jsx(
|
|
255
|
+
/* @__PURE__ */ e.jsx(ft, { children: /* @__PURE__ */ e.jsx(jt, {}) }),
|
|
256
256
|
/* @__PURE__ */ e.jsx(We, { index: 0, w: g, h: g }),
|
|
257
257
|
/* @__PURE__ */ e.jsx(We, { index: 1, w: g, h: g })
|
|
258
258
|
]
|
|
@@ -279,7 +279,7 @@ const en = ({
|
|
|
279
279
|
fontSize: d ?? "sm",
|
|
280
280
|
fontWeight: "semibold",
|
|
281
281
|
whiteSpace: "nowrap",
|
|
282
|
-
children: x(
|
|
282
|
+
children: x(a)
|
|
283
283
|
}
|
|
284
284
|
)
|
|
285
285
|
]
|
|
@@ -300,8 +300,8 @@ const en = ({
|
|
|
300
300
|
size: d,
|
|
301
301
|
fontWeight: "bold",
|
|
302
302
|
value: j,
|
|
303
|
-
onChange: (y) =>
|
|
304
|
-
isDisabled:
|
|
303
|
+
onChange: (y) => I(!0, y),
|
|
304
|
+
isDisabled: F || T,
|
|
305
305
|
children: [
|
|
306
306
|
/* @__PURE__ */ e.jsx("option", { value: -1, children: h[0] }),
|
|
307
307
|
/* @__PURE__ */ e.jsx("option", { value: 1, children: h[1] })
|
|
@@ -314,7 +314,7 @@ const en = ({
|
|
|
314
314
|
precision: 0,
|
|
315
315
|
size: d ?? "sm",
|
|
316
316
|
min: 0,
|
|
317
|
-
max: j < 0 ? Math.abs(t) : B ??
|
|
317
|
+
max: j < 0 ? Math.abs(t) : B ?? a,
|
|
318
318
|
value: s === "" ? "" : Math.abs(Number(s ?? t)),
|
|
319
319
|
onChange: se,
|
|
320
320
|
onBlur: M,
|
|
@@ -322,7 +322,7 @@ const en = ({
|
|
|
322
322
|
borderRadius: 3,
|
|
323
323
|
borderColor: "#ccc",
|
|
324
324
|
isDisabled: T,
|
|
325
|
-
...
|
|
325
|
+
...i,
|
|
326
326
|
children: /* @__PURE__ */ e.jsx(
|
|
327
327
|
Qe,
|
|
328
328
|
{
|
|
@@ -338,16 +338,16 @@ const en = ({
|
|
|
338
338
|
{
|
|
339
339
|
size: d ?? "sm",
|
|
340
340
|
min: 0,
|
|
341
|
-
max: S < 0 ? Math.abs(
|
|
341
|
+
max: S < 0 ? Math.abs(N ?? t) : a,
|
|
342
342
|
precision: 0,
|
|
343
|
-
value: f === "" ? "" : Math.abs(Number(f ??
|
|
343
|
+
value: f === "" ? "" : Math.abs(Number(f ?? a)),
|
|
344
344
|
onChange: J,
|
|
345
345
|
onBlur: M,
|
|
346
346
|
borderWidth: 1,
|
|
347
347
|
borderRadius: 3,
|
|
348
348
|
borderColor: "#ccc",
|
|
349
349
|
isDisabled: T,
|
|
350
|
-
...
|
|
350
|
+
...i,
|
|
351
351
|
children: /* @__PURE__ */ e.jsx(
|
|
352
352
|
Qe,
|
|
353
353
|
{
|
|
@@ -365,8 +365,8 @@ const en = ({
|
|
|
365
365
|
size: d,
|
|
366
366
|
fontWeight: "bold",
|
|
367
367
|
value: S,
|
|
368
|
-
onChange: (y) =>
|
|
369
|
-
isDisabled:
|
|
368
|
+
onChange: (y) => I(!1, y),
|
|
369
|
+
isDisabled: F || T,
|
|
370
370
|
children: [
|
|
371
371
|
/* @__PURE__ */ e.jsx("option", { value: -1, children: h[0] }),
|
|
372
372
|
/* @__PURE__ */ e.jsx("option", { value: 1, children: h[1] })
|
|
@@ -377,15 +377,15 @@ const en = ({
|
|
|
377
377
|
}
|
|
378
378
|
)
|
|
379
379
|
] });
|
|
380
|
-
},
|
|
380
|
+
}, an = ({ tags: n, containerProps: t, ...a }) => /* @__PURE__ */ e.jsx(re, { ...t, children: n.map((c, u) => /* @__PURE__ */ e.jsx(ve, { ...a, children: c }, u)) }), ln = new $t({}), cn = ({
|
|
381
381
|
action: n,
|
|
382
382
|
quantumIconSrc: t
|
|
383
383
|
}) => {
|
|
384
|
-
const { getLabel:
|
|
385
|
-
actionLowerCase:
|
|
386
|
-
}), [
|
|
384
|
+
const { getLabel: a } = pe(), c = A(() => ({
|
|
385
|
+
actionLowerCase: a("action").toLocaleLowerCase()
|
|
386
|
+
}), [a]);
|
|
387
387
|
return n.quantumOwned ? /* @__PURE__ */ e.jsx(
|
|
388
|
-
|
|
388
|
+
_e,
|
|
389
389
|
{
|
|
390
390
|
label: `This ${c.actionLowerCase} is owned by Quantum`,
|
|
391
391
|
"aria-label": "Quantum owned",
|
|
@@ -410,28 +410,28 @@ const en = ({
|
|
|
410
410
|
)
|
|
411
411
|
}
|
|
412
412
|
) : null;
|
|
413
|
-
},
|
|
413
|
+
}, dn = (n, t) => {
|
|
414
414
|
if (!t || !t.trim().length)
|
|
415
415
|
return n;
|
|
416
|
-
const
|
|
417
|
-
return
|
|
418
|
-
},
|
|
416
|
+
const a = n.map((u) => u.name ?? "");
|
|
417
|
+
return ln.filter(a, t)?.map((u) => n[u]) ?? [];
|
|
418
|
+
}, un = (n) => !n || n.length === 0 ? "None" : n.map(
|
|
419
419
|
(t) => (
|
|
420
420
|
// Convert camelCase to separate words (e.g., 'LeftFoot' -> 'Left Foot')
|
|
421
421
|
t.replace(/([A-Z])/g, " $1").trim()
|
|
422
422
|
)
|
|
423
|
-
).join(", "),
|
|
424
|
-
(
|
|
425
|
-
),
|
|
423
|
+
).join(", "), hn = (n, t) => !t || t.length == 0 ? n : n.filter(
|
|
424
|
+
(a) => a.useCases?.some((c) => t.includes(c.id)) ?? !1
|
|
425
|
+
), mn = ({
|
|
426
426
|
actions: n,
|
|
427
427
|
totalActions: t,
|
|
428
|
-
onCreate:
|
|
428
|
+
onCreate: a,
|
|
429
429
|
onDelete: c,
|
|
430
430
|
onEdit: u,
|
|
431
|
-
onView:
|
|
431
|
+
onView: i,
|
|
432
432
|
onSelected: d,
|
|
433
433
|
onDuplicate: m,
|
|
434
|
-
disableMultiSelect:
|
|
434
|
+
disableMultiSelect: l,
|
|
435
435
|
disableDelete: x,
|
|
436
436
|
disableEdit: h,
|
|
437
437
|
disableCreate: T,
|
|
@@ -440,49 +440,49 @@ const en = ({
|
|
|
440
440
|
containerProps: b,
|
|
441
441
|
quantumIconSrc: s = "/favicon.ico"
|
|
442
442
|
}) => {
|
|
443
|
-
const [f, C] = z(""), [j, S] = z(), { getLabel:
|
|
444
|
-
action:
|
|
445
|
-
actionPlural:
|
|
446
|
-
actionLowerCase:
|
|
447
|
-
actionPluralLowerCase:
|
|
448
|
-
}), [
|
|
443
|
+
const [f, C] = z(""), [j, S] = z(), { getLabel: F } = pe(), N = A(() => ({
|
|
444
|
+
action: F("action"),
|
|
445
|
+
actionPlural: F("action_plural"),
|
|
446
|
+
actionLowerCase: F("action").toLocaleLowerCase(),
|
|
447
|
+
actionPluralLowerCase: F("action_plural").toLocaleLowerCase()
|
|
448
|
+
}), [F]), B = A(() => {
|
|
449
449
|
if (!n)
|
|
450
450
|
return;
|
|
451
|
-
const g =
|
|
452
|
-
return p ? g :
|
|
453
|
-
}, [n, f, j, p]), k =
|
|
451
|
+
const g = dn(n, f);
|
|
452
|
+
return p ? g : hn(g, j);
|
|
453
|
+
}, [n, f, j, p]), k = R(() => {
|
|
454
454
|
if (!c)
|
|
455
455
|
return;
|
|
456
|
-
const
|
|
456
|
+
const I = n.filter(
|
|
457
457
|
(y) => y.selected && !y.quantumOwned
|
|
458
458
|
).map((y) => y.id);
|
|
459
|
-
c(
|
|
460
|
-
}, [n, c]), $ =
|
|
459
|
+
c(I);
|
|
460
|
+
}, [n, c]), $ = R(() => {
|
|
461
461
|
if (!m)
|
|
462
462
|
return;
|
|
463
|
-
const g = n.filter((
|
|
464
|
-
m(g.map((
|
|
463
|
+
const g = n.filter((I) => I.selected);
|
|
464
|
+
m(g.map((I) => I.id)), d && g.forEach((I) => d(I, !1));
|
|
465
465
|
}, [n, m, d]), M = A(() => n.some((g) => g.selected && !g.quantumOwned), [n]), se = A(() => n.some((g) => g.selected), [n]), J = A(() => n.some((g) => g.selected && g.quantumOwned), [n]);
|
|
466
466
|
return /* @__PURE__ */ e.jsxs(V, { ...b, children: [
|
|
467
467
|
/* @__PURE__ */ e.jsxs(fe, { alignContent: "space-between", gap: 4, children: [
|
|
468
|
-
(
|
|
469
|
-
|
|
468
|
+
(a || c || m) && /* @__PURE__ */ e.jsxs(be, { mb: "1rem", gap: 4, children: [
|
|
469
|
+
a && /* @__PURE__ */ e.jsxs(
|
|
470
470
|
ee,
|
|
471
471
|
{
|
|
472
|
-
isDisabled: !
|
|
472
|
+
isDisabled: !a || T,
|
|
473
473
|
colorScheme: "blackAlpha",
|
|
474
474
|
backgroundColor: "gray.700",
|
|
475
|
-
onClick:
|
|
475
|
+
onClick: a,
|
|
476
476
|
children: [
|
|
477
477
|
"Create New ",
|
|
478
|
-
|
|
478
|
+
N.action
|
|
479
479
|
]
|
|
480
480
|
}
|
|
481
481
|
),
|
|
482
|
-
c && !
|
|
483
|
-
|
|
482
|
+
c && !l && /* @__PURE__ */ e.jsx(
|
|
483
|
+
_e,
|
|
484
484
|
{
|
|
485
|
-
label: J ? M ? `Quantum-owned ${
|
|
485
|
+
label: J ? M ? `Quantum-owned ${N.actionPluralLowerCase} are selected and will be skipped` : `Selected ${N.actionPluralLowerCase} are quantum-owned and cannot be deleted` : void 0,
|
|
486
486
|
shouldWrapChildren: !0,
|
|
487
487
|
children: /* @__PURE__ */ e.jsx(
|
|
488
488
|
ee,
|
|
@@ -495,7 +495,7 @@ const en = ({
|
|
|
495
495
|
)
|
|
496
496
|
}
|
|
497
497
|
),
|
|
498
|
-
m && !
|
|
498
|
+
m && !l && /* @__PURE__ */ e.jsx(
|
|
499
499
|
ee,
|
|
500
500
|
{
|
|
501
501
|
colorScheme: "gray",
|
|
@@ -506,7 +506,7 @@ const en = ({
|
|
|
506
506
|
)
|
|
507
507
|
] }),
|
|
508
508
|
/* @__PURE__ */ e.jsx(
|
|
509
|
-
|
|
509
|
+
tn,
|
|
510
510
|
{
|
|
511
511
|
setSearch: C,
|
|
512
512
|
actions: n,
|
|
@@ -533,31 +533,27 @@ const en = ({
|
|
|
533
533
|
/* @__PURE__ */ e.jsx(et, { children: B?.map((g) => /* @__PURE__ */ e.jsxs(
|
|
534
534
|
Oe,
|
|
535
535
|
{
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
536
|
+
className: ot(
|
|
537
|
+
"hover:bg-[#f7f7f7]",
|
|
538
|
+
!l && "cursor-pointer",
|
|
539
|
+
g.selected && "bg-gray-200"
|
|
540
|
+
),
|
|
541
|
+
onClick: () => {
|
|
542
|
+
l || d?.(g, !g.selected);
|
|
540
543
|
},
|
|
541
|
-
cursor: r ? "pointer" : "default",
|
|
542
|
-
onClick: () => r ? d?.(g, !g.selected) : void 0,
|
|
543
544
|
children: [
|
|
544
545
|
/* @__PURE__ */ e.jsx(je, { children: /* @__PURE__ */ e.jsxs(fe, { children: [
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
{
|
|
548
|
-
isChecked: g.selected,
|
|
549
|
-
"aria-label": `Select ${I.actionLowerCase}`,
|
|
550
|
-
onChange: (N) => d(g, N.target.checked)
|
|
551
|
-
}
|
|
552
|
-
),
|
|
553
|
-
(g.quantumOwned || !u) && l && /* @__PURE__ */ e.jsx(
|
|
546
|
+
!l && /* @__PURE__ */ e.jsx(e.Fragment, { children: g.selected ? /* @__PURE__ */ e.jsx(Rt, { className: "text-blue-500" }) : /* @__PURE__ */ e.jsx(Dt, { className: "text-gray-400" }) }),
|
|
547
|
+
(g.quantumOwned || !u) && i && /* @__PURE__ */ e.jsx(
|
|
554
548
|
ee,
|
|
555
549
|
{
|
|
556
550
|
ml: "1em",
|
|
557
551
|
size: "sm",
|
|
558
552
|
variant: "link",
|
|
559
553
|
colorScheme: "blue",
|
|
560
|
-
onClick: () =>
|
|
554
|
+
onClick: (I) => {
|
|
555
|
+
I.stopPropagation(), i(g.id);
|
|
556
|
+
},
|
|
561
557
|
children: "View"
|
|
562
558
|
}
|
|
563
559
|
),
|
|
@@ -569,14 +565,16 @@ const en = ({
|
|
|
569
565
|
size: "sm",
|
|
570
566
|
variant: "link",
|
|
571
567
|
colorScheme: "blue",
|
|
572
|
-
onClick: () =>
|
|
568
|
+
onClick: (I) => {
|
|
569
|
+
I.stopPropagation(), u(g.id);
|
|
570
|
+
},
|
|
573
571
|
children: "Edit"
|
|
574
572
|
}
|
|
575
573
|
)
|
|
576
574
|
] }) }),
|
|
577
575
|
/* @__PURE__ */ e.jsx(je, { whiteSpace: "break-spaces", children: /* @__PURE__ */ e.jsxs(fe, { align: "center", gap: 2, children: [
|
|
578
576
|
/* @__PURE__ */ e.jsx(
|
|
579
|
-
|
|
577
|
+
cn,
|
|
580
578
|
{
|
|
581
579
|
action: g,
|
|
582
580
|
quantumIconSrc: s
|
|
@@ -584,12 +582,12 @@ const en = ({
|
|
|
584
582
|
),
|
|
585
583
|
g.name
|
|
586
584
|
] }) }),
|
|
587
|
-
/* @__PURE__ */ e.jsx(je, { maxW: "20rem", whiteSpace: "break-spaces", children:
|
|
585
|
+
/* @__PURE__ */ e.jsx(je, { maxW: "20rem", whiteSpace: "break-spaces", children: un(g.sensorLocations) }),
|
|
588
586
|
!p && /* @__PURE__ */ e.jsx(je, { maxW: "20rem", children: /* @__PURE__ */ e.jsx(
|
|
589
|
-
|
|
587
|
+
an,
|
|
590
588
|
{
|
|
591
589
|
containerProps: { flexWrap: "wrap" },
|
|
592
|
-
tags: g.useCases?.map((
|
|
590
|
+
tags: g.useCases?.map((I) => I.name) ?? []
|
|
593
591
|
}
|
|
594
592
|
) })
|
|
595
593
|
]
|
|
@@ -598,120 +596,120 @@ const en = ({
|
|
|
598
596
|
)) })
|
|
599
597
|
] }) })
|
|
600
598
|
] });
|
|
601
|
-
},
|
|
599
|
+
}, Wn = ({
|
|
602
600
|
onSave: n,
|
|
603
601
|
onCancel: t,
|
|
604
|
-
onError:
|
|
602
|
+
onError: a,
|
|
605
603
|
hideButtons: c = !1,
|
|
606
604
|
setButtonDisabled: u,
|
|
607
|
-
setButtonOnClick:
|
|
605
|
+
setButtonOnClick: i,
|
|
608
606
|
quantumOwned: d
|
|
609
607
|
}) => {
|
|
610
|
-
const m = tt(), { getLabel:
|
|
611
|
-
singular:
|
|
612
|
-
plural:
|
|
613
|
-
pluralLowerCase:
|
|
614
|
-
singularLowerCase:
|
|
615
|
-
}), [
|
|
616
|
-
query:
|
|
608
|
+
const m = tt(), { getLabel: l } = pe(), x = A(() => ({
|
|
609
|
+
singular: l("action"),
|
|
610
|
+
plural: l("action_plural"),
|
|
611
|
+
pluralLowerCase: l("action_plural").toLowerCase(),
|
|
612
|
+
singularLowerCase: l("action").toLowerCase()
|
|
613
|
+
}), [l]), [h, T] = z("copy"), [p, L] = z(""), [b, s] = z([]), [f, C] = z(!1), [j] = he({
|
|
614
|
+
query: rt
|
|
617
615
|
}), [S] = he({
|
|
618
|
-
query:
|
|
616
|
+
query: Pt,
|
|
619
617
|
variables: { groupId: p },
|
|
620
618
|
pause: !p
|
|
621
619
|
// Only run when group is selected
|
|
622
|
-
}), [,
|
|
623
|
-
|
|
620
|
+
}), [, F] = ie(ze), [, N] = ie(
|
|
621
|
+
at
|
|
624
622
|
), B = A(() => j.data?.groups ? j.data.groups.map(
|
|
625
|
-
(
|
|
623
|
+
(r) => _(lt, r)
|
|
626
624
|
) : [], [j.data]), k = A(() => S.data ? S.data.actions.map(
|
|
627
|
-
(o) =>
|
|
625
|
+
(o) => _(me, o)
|
|
628
626
|
) : [], [S.data]), $ = A(() => k.filter(
|
|
629
|
-
(
|
|
630
|
-
), [k, b]), M =
|
|
631
|
-
(
|
|
632
|
-
const o =
|
|
627
|
+
(r) => b.includes(r.id)
|
|
628
|
+
), [k, b]), M = R(
|
|
629
|
+
(r) => {
|
|
630
|
+
const o = r?.value || "";
|
|
633
631
|
L(o), s([]);
|
|
634
632
|
},
|
|
635
633
|
[]
|
|
636
|
-
), se =
|
|
637
|
-
(
|
|
638
|
-
const o =
|
|
634
|
+
), se = R(
|
|
635
|
+
(r) => {
|
|
636
|
+
const o = r.map((w) => w.value);
|
|
639
637
|
s(o);
|
|
640
638
|
},
|
|
641
639
|
[]
|
|
642
|
-
), J =
|
|
643
|
-
async (
|
|
644
|
-
const o =
|
|
640
|
+
), J = R(
|
|
641
|
+
async (r) => {
|
|
642
|
+
const o = _(
|
|
645
643
|
we,
|
|
646
|
-
|
|
647
|
-
),
|
|
644
|
+
r.categories
|
|
645
|
+
), P = _(
|
|
648
646
|
Ee,
|
|
649
|
-
|
|
647
|
+
r.metadataGroups
|
|
650
648
|
).flatMap(
|
|
651
|
-
(U) => U.data.map((te) =>
|
|
649
|
+
(U) => U.data.map((te) => _(Pe, te).id)
|
|
652
650
|
), W = {
|
|
653
|
-
...
|
|
654
|
-
name: `${
|
|
651
|
+
...r,
|
|
652
|
+
name: `${r.name} (Copy)`,
|
|
655
653
|
// Add "(Copy)" suffix to distinguish
|
|
656
|
-
description:
|
|
657
|
-
instructionsPointOfInterest:
|
|
658
|
-
instructionsMovementReport:
|
|
659
|
-
laterality:
|
|
660
|
-
activityKind:
|
|
661
|
-
sensorLocations:
|
|
662
|
-
thresholds:
|
|
654
|
+
description: r.description || void 0,
|
|
655
|
+
instructionsPointOfInterest: r.instructionsPointOfInterest || void 0,
|
|
656
|
+
instructionsMovementReport: r.instructionsMovementReport || void 0,
|
|
657
|
+
laterality: r.laterality,
|
|
658
|
+
activityKind: r.activityKind,
|
|
659
|
+
sensorLocations: r.sensorLocations,
|
|
660
|
+
thresholds: r.thresholds.map((U) => ({
|
|
663
661
|
...U,
|
|
664
662
|
id: void 0
|
|
665
663
|
})),
|
|
666
664
|
categories: o?.map((U) => U.id),
|
|
667
665
|
quantumOwned: d,
|
|
668
|
-
metadataItemIds:
|
|
666
|
+
metadataItemIds: P,
|
|
669
667
|
id: void 0
|
|
670
|
-
}, Q = await
|
|
668
|
+
}, Q = await F({ fields: W });
|
|
671
669
|
if (Q.error)
|
|
672
670
|
throw new Error(Q.error.message);
|
|
673
671
|
if (Q.data?.createAction)
|
|
674
|
-
return
|
|
672
|
+
return _(me, Q.data.createAction);
|
|
675
673
|
throw new Error("No action data returned");
|
|
676
674
|
},
|
|
677
|
-
[
|
|
678
|
-
), g =
|
|
679
|
-
async (
|
|
680
|
-
const o = await
|
|
675
|
+
[F, d]
|
|
676
|
+
), g = R(
|
|
677
|
+
async (r) => {
|
|
678
|
+
const o = await N({ id: r.id });
|
|
681
679
|
if (o.error)
|
|
682
680
|
throw new Error(o.error.message);
|
|
683
681
|
if (o.data?.convertActionToQuantumOwned)
|
|
684
|
-
return
|
|
682
|
+
return _(
|
|
685
683
|
me,
|
|
686
684
|
o.data.convertActionToQuantumOwned
|
|
687
685
|
);
|
|
688
686
|
throw new Error("No action data returned");
|
|
689
687
|
},
|
|
690
|
-
[
|
|
691
|
-
),
|
|
688
|
+
[N]
|
|
689
|
+
), I = R(async () => {
|
|
692
690
|
if (C(!0), !$.length) {
|
|
693
|
-
const
|
|
691
|
+
const r = new Error(
|
|
694
692
|
`No ${x.pluralLowerCase} selected for ${h === "copy" ? "copying" : "converting"}`
|
|
695
693
|
);
|
|
696
|
-
|
|
694
|
+
a?.(r), C(!1);
|
|
697
695
|
return;
|
|
698
696
|
}
|
|
699
697
|
try {
|
|
700
|
-
const
|
|
698
|
+
const r = [];
|
|
701
699
|
let o = 0;
|
|
702
|
-
const w = h === "copy" ? J : g,
|
|
700
|
+
const w = h === "copy" ? J : g, P = h === "copy" ? "copy" : "convert";
|
|
703
701
|
for (const W of $)
|
|
704
702
|
try {
|
|
705
703
|
const Q = await w(W);
|
|
706
|
-
|
|
704
|
+
r.push(Q);
|
|
707
705
|
} catch (Q) {
|
|
708
706
|
console.error(
|
|
709
|
-
`Failed to ${
|
|
707
|
+
`Failed to ${P} ${x.singularLowerCase} "${W.name}":`,
|
|
710
708
|
Q
|
|
711
709
|
), o++;
|
|
712
710
|
}
|
|
713
|
-
if (
|
|
714
|
-
const W =
|
|
711
|
+
if (r.length > 0) {
|
|
712
|
+
const W = r.length, Q = $.length, U = h === "copy" ? "copied" : "converted", te = h === "copy" ? "copy" : "convert";
|
|
715
713
|
m({
|
|
716
714
|
title: o > 0 ? `Partial ${te} completed` : `${x.plural} ${U} successfully`,
|
|
717
715
|
description: o > 0 ? `${W} of ${Q} ${x.pluralLowerCase} ${U} successfully` : `${W} ${W > 1 ? x.pluralLowerCase : x.singularLowerCase} ${U} successfully`,
|
|
@@ -721,17 +719,17 @@ const en = ({
|
|
|
721
719
|
}), n?.(), L(""), s([]);
|
|
722
720
|
} else
|
|
723
721
|
throw new Error(
|
|
724
|
-
`Failed to ${
|
|
722
|
+
`Failed to ${P} any ${x.pluralLowerCase}`
|
|
725
723
|
);
|
|
726
|
-
} catch (
|
|
727
|
-
const o = h === "copy" ? "copy" : "convert", w =
|
|
724
|
+
} catch (r) {
|
|
725
|
+
const o = h === "copy" ? "copy" : "convert", w = r instanceof Error ? r.message : `Failed to ${o} ${x.pluralLowerCase}`;
|
|
728
726
|
m({
|
|
729
727
|
title: `${h === "copy" ? "Copy" : "Convert"} failed`,
|
|
730
728
|
description: w,
|
|
731
729
|
status: "error",
|
|
732
730
|
duration: 5e3,
|
|
733
731
|
isClosable: !0
|
|
734
|
-
}),
|
|
732
|
+
}), a?.(r instanceof Error ? r : new Error(w));
|
|
735
733
|
} finally {
|
|
736
734
|
C(!1);
|
|
737
735
|
}
|
|
@@ -742,8 +740,8 @@ const en = ({
|
|
|
742
740
|
g,
|
|
743
741
|
m,
|
|
744
742
|
n,
|
|
745
|
-
|
|
746
|
-
]), y =
|
|
743
|
+
a
|
|
744
|
+
]), y = R(() => {
|
|
747
745
|
L(""), s([]), T("copy"), t?.();
|
|
748
746
|
}, [t]);
|
|
749
747
|
ae(() => {
|
|
@@ -752,19 +750,19 @@ const en = ({
|
|
|
752
750
|
saveButton: $.length === 0 || f
|
|
753
751
|
});
|
|
754
752
|
}, [$.length, f, u]), ae(() => {
|
|
755
|
-
|
|
753
|
+
i && i({
|
|
756
754
|
cancelButton: y,
|
|
757
|
-
saveButton:
|
|
755
|
+
saveButton: I
|
|
758
756
|
});
|
|
759
|
-
}, [
|
|
760
|
-
const D = A(() => B.map((
|
|
761
|
-
value:
|
|
762
|
-
label:
|
|
763
|
-
})), [B]), X = A(() => k.filter((
|
|
764
|
-
value:
|
|
765
|
-
label:
|
|
757
|
+
}, [i, y, I]);
|
|
758
|
+
const D = A(() => B.map((r) => ({
|
|
759
|
+
value: r.id,
|
|
760
|
+
label: r.name
|
|
761
|
+
})), [B]), X = A(() => k.filter((r) => h === "copy" ? !0 : !r.quantumOwned).map((r) => ({
|
|
762
|
+
value: r.id,
|
|
763
|
+
label: r.name,
|
|
766
764
|
// Add custom data to identify quantum-owned actions for UI display
|
|
767
|
-
isQuantumOwned:
|
|
765
|
+
isQuantumOwned: r.quantumOwned
|
|
768
766
|
})), [k, h]), Z = j.fetching, E = S.fetching;
|
|
769
767
|
return /* @__PURE__ */ e.jsx(V, { children: /* @__PURE__ */ e.jsxs(oe, { spacing: 6, align: "stretch", children: [
|
|
770
768
|
d && /* @__PURE__ */ e.jsxs(K, { children: [
|
|
@@ -773,8 +771,8 @@ const en = ({
|
|
|
773
771
|
nt,
|
|
774
772
|
{
|
|
775
773
|
value: h,
|
|
776
|
-
onChange: (
|
|
777
|
-
T(
|
|
774
|
+
onChange: (r) => {
|
|
775
|
+
T(r), s([]);
|
|
778
776
|
},
|
|
779
777
|
children: /* @__PURE__ */ e.jsxs(re, { spacing: 6, children: [
|
|
780
778
|
/* @__PURE__ */ e.jsx(Ne, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(oe, { align: "start", spacing: 1, children: [
|
|
@@ -812,7 +810,7 @@ const en = ({
|
|
|
812
810
|
{
|
|
813
811
|
placeholder: "Choose a group...",
|
|
814
812
|
options: D,
|
|
815
|
-
value: D.find((
|
|
813
|
+
value: D.find((r) => r.value === p) || null,
|
|
816
814
|
onChange: M,
|
|
817
815
|
isLoading: Z,
|
|
818
816
|
isDisabled: Z,
|
|
@@ -849,19 +847,19 @@ const en = ({
|
|
|
849
847
|
placeholder: `Choose ${x.pluralLowerCase} to ${h}...`,
|
|
850
848
|
options: X,
|
|
851
849
|
value: X.filter(
|
|
852
|
-
(
|
|
850
|
+
(r) => b.includes(r.value)
|
|
853
851
|
),
|
|
854
852
|
onChange: se,
|
|
855
853
|
isDisabled: X.length === 0,
|
|
856
854
|
isClearable: !0,
|
|
857
855
|
isMulti: !0,
|
|
858
856
|
closeMenuOnSelect: !1,
|
|
859
|
-
formatOptionLabel: (
|
|
857
|
+
formatOptionLabel: (r, { context: o }) => /* @__PURE__ */ e.jsxs(re, { justify: "space-between", w: "100%", children: [
|
|
860
858
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
861
|
-
/* @__PURE__ */ e.jsx(v, { children:
|
|
862
|
-
o === "value" &&
|
|
859
|
+
/* @__PURE__ */ e.jsx(v, { children: r.label }),
|
|
860
|
+
o === "value" && r.isQuantumOwned && /* @__PURE__ */ e.jsx(v, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
|
|
863
861
|
] }),
|
|
864
|
-
|
|
862
|
+
r.isQuantumOwned && o === "menu" && /* @__PURE__ */ e.jsx(ve, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
|
|
865
863
|
] })
|
|
866
864
|
}
|
|
867
865
|
),
|
|
@@ -885,7 +883,7 @@ const en = ({
|
|
|
885
883
|
$.length > 0 && /* @__PURE__ */ e.jsxs(V, { p: 4, bg: "gray.50", borderRadius: "md", children: [
|
|
886
884
|
/* @__PURE__ */ e.jsx(v, { fontWeight: "semibold", mb: 3, children: $.length === 1 ? `${x.singular} to ${h === "copy" ? "Copy" : "Convert"}:` : `${$.length} ${x.plural} to ${h === "copy" ? "Copy" : "Convert"}:` }),
|
|
887
885
|
/* @__PURE__ */ e.jsxs(oe, { align: "start", spacing: 3, children: [
|
|
888
|
-
$.map((
|
|
886
|
+
$.map((r, o) => /* @__PURE__ */ e.jsxs(
|
|
889
887
|
V,
|
|
890
888
|
{
|
|
891
889
|
w: "100%",
|
|
@@ -899,9 +897,9 @@ const en = ({
|
|
|
899
897
|
/* @__PURE__ */ e.jsxs(v, { fontWeight: "medium", fontSize: "sm", children: [
|
|
900
898
|
o + 1,
|
|
901
899
|
". ",
|
|
902
|
-
|
|
900
|
+
r.name
|
|
903
901
|
] }),
|
|
904
|
-
|
|
902
|
+
r.quantumOwned && /* @__PURE__ */ e.jsx(ve, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
|
|
905
903
|
] }),
|
|
906
904
|
/* @__PURE__ */ e.jsxs(
|
|
907
905
|
oe,
|
|
@@ -911,42 +909,42 @@ const en = ({
|
|
|
911
909
|
fontSize: "sm",
|
|
912
910
|
color: "gray.600",
|
|
913
911
|
children: [
|
|
914
|
-
|
|
912
|
+
r.description && /* @__PURE__ */ e.jsxs(v, { children: [
|
|
915
913
|
/* @__PURE__ */ e.jsx("strong", { children: "Description:" }),
|
|
916
914
|
" ",
|
|
917
|
-
|
|
915
|
+
r.description
|
|
918
916
|
] }),
|
|
919
917
|
/* @__PURE__ */ e.jsxs(v, { children: [
|
|
920
918
|
/* @__PURE__ */ e.jsx("strong", { children: "Type:" }),
|
|
921
919
|
" ",
|
|
922
|
-
|
|
920
|
+
r.activityKind
|
|
923
921
|
] }),
|
|
924
922
|
/* @__PURE__ */ e.jsxs(v, { children: [
|
|
925
923
|
/* @__PURE__ */ e.jsx("strong", { children: "Laterality:" }),
|
|
926
924
|
" ",
|
|
927
|
-
|
|
925
|
+
r.laterality
|
|
928
926
|
] }),
|
|
929
927
|
/* @__PURE__ */ e.jsxs(v, { children: [
|
|
930
928
|
/* @__PURE__ */ e.jsx("strong", { children: "Sensor Locations:" }),
|
|
931
929
|
" ",
|
|
932
|
-
|
|
930
|
+
r.sensorLocations.length
|
|
933
931
|
] }),
|
|
934
932
|
/* @__PURE__ */ e.jsxs(v, { children: [
|
|
935
933
|
/* @__PURE__ */ e.jsx("strong", { children: "Thresholds:" }),
|
|
936
934
|
" ",
|
|
937
|
-
|
|
935
|
+
r.thresholds.length
|
|
938
936
|
] }),
|
|
939
937
|
/* @__PURE__ */ e.jsxs(v, { children: [
|
|
940
938
|
/* @__PURE__ */ e.jsx("strong", { children: "Use Cases:" }),
|
|
941
939
|
" ",
|
|
942
|
-
|
|
940
|
+
r.useCases.map((w) => w.name).join(", ") || "None"
|
|
943
941
|
] })
|
|
944
942
|
]
|
|
945
943
|
}
|
|
946
944
|
)
|
|
947
945
|
]
|
|
948
946
|
},
|
|
949
|
-
|
|
947
|
+
r.id
|
|
950
948
|
)),
|
|
951
949
|
$.length > 1 && /* @__PURE__ */ e.jsx(
|
|
952
950
|
V,
|
|
@@ -984,7 +982,7 @@ const en = ({
|
|
|
984
982
|
ee,
|
|
985
983
|
{
|
|
986
984
|
colorScheme: h === "copy" ? "blue" : "green",
|
|
987
|
-
onClick:
|
|
985
|
+
onClick: I,
|
|
988
986
|
isDisabled: $.length === 0 || f,
|
|
989
987
|
isLoading: f,
|
|
990
988
|
loadingText: `${h === "copy" ? "Copying" : "Converting"}...`,
|
|
@@ -997,79 +995,79 @@ const en = ({
|
|
|
997
995
|
)
|
|
998
996
|
] })
|
|
999
997
|
] }) });
|
|
1000
|
-
},
|
|
998
|
+
}, Un = ({
|
|
1001
999
|
onSave: n,
|
|
1002
1000
|
onCancel: t,
|
|
1003
|
-
onError:
|
|
1001
|
+
onError: a,
|
|
1004
1002
|
hideButtons: c = !1,
|
|
1005
1003
|
setButtonDisabled: u,
|
|
1006
|
-
setButtonOnClick:
|
|
1004
|
+
setButtonOnClick: i,
|
|
1007
1005
|
quantumOwned: d
|
|
1008
1006
|
}) => {
|
|
1009
|
-
const m = tt(), { getLabel:
|
|
1010
|
-
query:
|
|
1007
|
+
const m = tt(), { getLabel: l } = pe(), [x, h] = z(""), [T, p] = z([]), [L, b] = z(!1), [s, f] = z("copy"), [C] = he({
|
|
1008
|
+
query: rt
|
|
1011
1009
|
}), [j] = he({
|
|
1012
|
-
query:
|
|
1010
|
+
query: _t,
|
|
1013
1011
|
variables: { groupId: x },
|
|
1014
1012
|
pause: !x
|
|
1015
1013
|
// Only run when group is selected
|
|
1016
|
-
}), [, S] =
|
|
1017
|
-
|
|
1014
|
+
}), [, S] = ie(it), [, F] = ie(ct), [, N] = ie(ze), [, B] = ie(
|
|
1015
|
+
at
|
|
1018
1016
|
), k = A(() => C.data?.groups ? C.data.groups.map(
|
|
1019
|
-
(o) =>
|
|
1020
|
-
) : [], [C.data]), $ = A(() => j.data?.modules ?
|
|
1017
|
+
(o) => _(lt, o)
|
|
1018
|
+
) : [], [C.data]), $ = A(() => j.data?.modules ? _(
|
|
1021
1019
|
Te,
|
|
1022
1020
|
j.data?.modules
|
|
1023
1021
|
).map((w) => {
|
|
1024
|
-
const
|
|
1025
|
-
|
|
1022
|
+
const P = _(
|
|
1023
|
+
dt,
|
|
1026
1024
|
w.moduleActions
|
|
1027
1025
|
);
|
|
1028
1026
|
return {
|
|
1029
1027
|
...w,
|
|
1030
|
-
moduleActions:
|
|
1028
|
+
moduleActions: P.map((W) => ({
|
|
1031
1029
|
...W,
|
|
1032
|
-
action:
|
|
1030
|
+
action: _(me, W.action)
|
|
1033
1031
|
})),
|
|
1034
|
-
categories:
|
|
1032
|
+
categories: _(
|
|
1035
1033
|
we,
|
|
1036
1034
|
w.categories
|
|
1037
1035
|
)
|
|
1038
1036
|
};
|
|
1039
1037
|
}) : [], [j.data]), M = A(() => $.filter(
|
|
1040
1038
|
(o) => T.includes(o.id)
|
|
1041
|
-
), [$, T]), se =
|
|
1039
|
+
), [$, T]), se = R(
|
|
1042
1040
|
(o) => {
|
|
1043
1041
|
const w = o?.value || "";
|
|
1044
1042
|
h(w), p([]);
|
|
1045
1043
|
},
|
|
1046
1044
|
[]
|
|
1047
|
-
), J =
|
|
1045
|
+
), J = R(
|
|
1048
1046
|
(o) => {
|
|
1049
|
-
const w = o.map((
|
|
1047
|
+
const w = o.map((P) => P.value);
|
|
1050
1048
|
p(w);
|
|
1051
1049
|
},
|
|
1052
1050
|
[]
|
|
1053
|
-
), g =
|
|
1051
|
+
), g = R(async () => {
|
|
1054
1052
|
if (b(!0), !M.length) {
|
|
1055
1053
|
b(!1);
|
|
1056
1054
|
const o = new Error(
|
|
1057
1055
|
`No modules selected for ${s === "convert" ? "converting" : "copying"}`
|
|
1058
1056
|
);
|
|
1059
|
-
|
|
1057
|
+
a?.(o);
|
|
1060
1058
|
return;
|
|
1061
1059
|
}
|
|
1062
1060
|
try {
|
|
1063
1061
|
const o = [];
|
|
1064
1062
|
let w = 0;
|
|
1065
|
-
for (const
|
|
1063
|
+
for (const P of M)
|
|
1066
1064
|
try {
|
|
1067
|
-
let W =
|
|
1065
|
+
let W = P.moduleActions.map((Q) => Q.actionId);
|
|
1068
1066
|
if (d) {
|
|
1069
|
-
const Q =
|
|
1067
|
+
const Q = P.moduleActions.map((Y) => Y.action), U = async (Y) => {
|
|
1070
1068
|
if (s === "copy") {
|
|
1071
1069
|
if (Y.quantumOwned) return Y;
|
|
1072
|
-
const O =
|
|
1070
|
+
const O = _(
|
|
1073
1071
|
we,
|
|
1074
1072
|
Y.categories
|
|
1075
1073
|
), H = {
|
|
@@ -1081,8 +1079,8 @@ const en = ({
|
|
|
1081
1079
|
})),
|
|
1082
1080
|
categories: O?.map((ne) => ne.id),
|
|
1083
1081
|
id: void 0
|
|
1084
|
-
}, q = await
|
|
1085
|
-
return q.error || !q.data?.createAction ? null :
|
|
1082
|
+
}, q = await N({ fields: H });
|
|
1083
|
+
return q.error || !q.data?.createAction ? null : _(
|
|
1086
1084
|
me,
|
|
1087
1085
|
q.data.createAction
|
|
1088
1086
|
);
|
|
@@ -1091,7 +1089,7 @@ const en = ({
|
|
|
1091
1089
|
const Ce = await B({
|
|
1092
1090
|
id: Y.id
|
|
1093
1091
|
});
|
|
1094
|
-
return Ce.error || !Ce.data?.convertActionToQuantumOwned ? null :
|
|
1092
|
+
return Ce.error || !Ce.data?.convertActionToQuantumOwned ? null : _(
|
|
1095
1093
|
me,
|
|
1096
1094
|
Ce.data.convertActionToQuantumOwned
|
|
1097
1095
|
);
|
|
@@ -1102,18 +1100,18 @@ const en = ({
|
|
|
1102
1100
|
}
|
|
1103
1101
|
if (s === "convert") {
|
|
1104
1102
|
const Q = {
|
|
1105
|
-
name:
|
|
1106
|
-
description:
|
|
1103
|
+
name: P.name,
|
|
1104
|
+
description: P.description || void 0,
|
|
1107
1105
|
actions: W,
|
|
1108
|
-
categories:
|
|
1106
|
+
categories: P.categories.map((te) => te.id),
|
|
1109
1107
|
quantumOwned: !0
|
|
1110
|
-
}, U = await
|
|
1111
|
-
id:
|
|
1108
|
+
}, U = await F({
|
|
1109
|
+
id: P.id,
|
|
1112
1110
|
input: Q
|
|
1113
1111
|
});
|
|
1114
1112
|
if (U.error) throw new Error(U.error.message);
|
|
1115
1113
|
if (U.data?.updateModule) {
|
|
1116
|
-
const te =
|
|
1114
|
+
const te = _(
|
|
1117
1115
|
Te,
|
|
1118
1116
|
U.data.updateModule
|
|
1119
1117
|
);
|
|
@@ -1121,15 +1119,15 @@ const en = ({
|
|
|
1121
1119
|
}
|
|
1122
1120
|
} else {
|
|
1123
1121
|
const Q = {
|
|
1124
|
-
name: `${
|
|
1125
|
-
description:
|
|
1122
|
+
name: `${P.name} (Copy)`,
|
|
1123
|
+
description: P.description || void 0,
|
|
1126
1124
|
actions: W,
|
|
1127
|
-
categories:
|
|
1125
|
+
categories: P.categories.map((te) => te.id),
|
|
1128
1126
|
quantumOwned: d
|
|
1129
1127
|
}, U = await S({ input: Q });
|
|
1130
1128
|
if (U.error) throw new Error(U.error.message);
|
|
1131
1129
|
if (U.data?.createModule) {
|
|
1132
|
-
const te =
|
|
1130
|
+
const te = _(
|
|
1133
1131
|
Te,
|
|
1134
1132
|
U.data.createModule
|
|
1135
1133
|
);
|
|
@@ -1138,15 +1136,15 @@ const en = ({
|
|
|
1138
1136
|
}
|
|
1139
1137
|
} catch (W) {
|
|
1140
1138
|
console.error(
|
|
1141
|
-
`Failed to ${s === "convert" ? "convert" : "copy"} module "${
|
|
1139
|
+
`Failed to ${s === "convert" ? "convert" : "copy"} module "${P.name}":`,
|
|
1142
1140
|
W
|
|
1143
1141
|
), w++;
|
|
1144
1142
|
}
|
|
1145
1143
|
if (o.length > 0) {
|
|
1146
|
-
const
|
|
1144
|
+
const P = o.length, W = M.length;
|
|
1147
1145
|
m({
|
|
1148
1146
|
title: w > 0 ? `Partial ${s === "convert" ? "convert" : "copy"} completed` : `Modules ${s === "convert" ? "converted" : "copied"} successfully`,
|
|
1149
|
-
description: w > 0 ? `${
|
|
1147
|
+
description: w > 0 ? `${P} of ${W} modules ${s === "convert" ? "converted" : "copied"} successfully` : `${P} module${P > 1 ? "s" : ""} ${s === "convert" ? "converted" : "copied"} successfully`,
|
|
1150
1148
|
status: w > 0 ? "warning" : "success",
|
|
1151
1149
|
duration: 3e3,
|
|
1152
1150
|
isClosable: !0
|
|
@@ -1163,22 +1161,22 @@ const en = ({
|
|
|
1163
1161
|
status: "error",
|
|
1164
1162
|
duration: 5e3,
|
|
1165
1163
|
isClosable: !0
|
|
1166
|
-
}),
|
|
1164
|
+
}), a?.(o instanceof Error ? o : new Error(w));
|
|
1167
1165
|
} finally {
|
|
1168
1166
|
b(!1);
|
|
1169
1167
|
}
|
|
1170
1168
|
}, [
|
|
1171
1169
|
M,
|
|
1172
1170
|
S,
|
|
1173
|
-
|
|
1171
|
+
F,
|
|
1174
1172
|
m,
|
|
1175
1173
|
n,
|
|
1176
|
-
|
|
1174
|
+
a,
|
|
1177
1175
|
d,
|
|
1178
|
-
|
|
1176
|
+
N,
|
|
1179
1177
|
B,
|
|
1180
1178
|
s
|
|
1181
|
-
]),
|
|
1179
|
+
]), I = R(() => {
|
|
1182
1180
|
h(""), p([]), f("copy"), t?.();
|
|
1183
1181
|
}, [t]);
|
|
1184
1182
|
ae(() => {
|
|
@@ -1187,11 +1185,11 @@ const en = ({
|
|
|
1187
1185
|
saveButton: M.length === 0 || L
|
|
1188
1186
|
});
|
|
1189
1187
|
}, [M.length, L, u]), ae(() => {
|
|
1190
|
-
|
|
1191
|
-
cancelButton:
|
|
1188
|
+
i && i({
|
|
1189
|
+
cancelButton: I,
|
|
1192
1190
|
saveButton: g
|
|
1193
1191
|
});
|
|
1194
|
-
}, [
|
|
1192
|
+
}, [i, I, g]);
|
|
1195
1193
|
const y = A(() => k.map((o) => ({
|
|
1196
1194
|
value: o.id,
|
|
1197
1195
|
label: o.name
|
|
@@ -1201,16 +1199,16 @@ const en = ({
|
|
|
1201
1199
|
// Add custom data to identify quantum-owned modules
|
|
1202
1200
|
isQuantumOwned: o.quantumOwned
|
|
1203
1201
|
})), [$, s]), X = C.fetching, Z = j.fetching, E = A(() => ({
|
|
1204
|
-
singular:
|
|
1205
|
-
plural:
|
|
1206
|
-
pluralLowerCase:
|
|
1207
|
-
singularLowerCase:
|
|
1208
|
-
}), [
|
|
1209
|
-
singular:
|
|
1210
|
-
plural:
|
|
1211
|
-
pluralLowerCase:
|
|
1212
|
-
singularLowerCase:
|
|
1213
|
-
}), [
|
|
1202
|
+
singular: l("module"),
|
|
1203
|
+
plural: l("module_plural"),
|
|
1204
|
+
pluralLowerCase: l("module_plural").toLowerCase(),
|
|
1205
|
+
singularLowerCase: l("module").toLowerCase()
|
|
1206
|
+
}), [l]), r = A(() => ({
|
|
1207
|
+
singular: l("action"),
|
|
1208
|
+
plural: l("action_plural"),
|
|
1209
|
+
pluralLowerCase: l("action_plural").toLowerCase(),
|
|
1210
|
+
singularLowerCase: l("action").toLowerCase()
|
|
1211
|
+
}), [l]);
|
|
1214
1212
|
return /* @__PURE__ */ e.jsx(V, { children: /* @__PURE__ */ e.jsxs(oe, { spacing: 6, align: "stretch", children: [
|
|
1215
1213
|
d && /* @__PURE__ */ e.jsxs(K, { children: [
|
|
1216
1214
|
/* @__PURE__ */ e.jsx(ce, { children: "Operation Mode" }),
|
|
@@ -1358,7 +1356,7 @@ const en = ({
|
|
|
1358
1356
|
/* @__PURE__ */ e.jsxs(v, { children: [
|
|
1359
1357
|
/* @__PURE__ */ e.jsx("strong", { children: "Categories:" }),
|
|
1360
1358
|
" ",
|
|
1361
|
-
o.categories.map((
|
|
1359
|
+
o.categories.map((P) => P.name).join(", ") || "None"
|
|
1362
1360
|
] })
|
|
1363
1361
|
]
|
|
1364
1362
|
}
|
|
@@ -1395,7 +1393,7 @@ const en = ({
|
|
|
1395
1393
|
borderRadius: "md",
|
|
1396
1394
|
border: "1px solid",
|
|
1397
1395
|
borderColor: "yellow.200",
|
|
1398
|
-
children: /* @__PURE__ */ e.jsx(v, { fontSize: "sm", fontWeight: "medium", color: "yellow.800", children: s === "convert" ? `Converting ${E.plural} will convert non QM-Owned ${
|
|
1396
|
+
children: /* @__PURE__ */ e.jsx(v, { fontSize: "sm", fontWeight: "medium", color: "yellow.800", children: s === "convert" ? `Converting ${E.plural} will convert non QM-Owned ${r.plural} to QM-Owned ${r.plural}` : `Copying ${E.plural} with Non QM-Owned ${r.plural} will create corresponding QM-Owned ${r.plural}` })
|
|
1399
1397
|
}
|
|
1400
1398
|
)
|
|
1401
1399
|
] })
|
|
@@ -1405,7 +1403,7 @@ const en = ({
|
|
|
1405
1403
|
ee,
|
|
1406
1404
|
{
|
|
1407
1405
|
variant: "outline",
|
|
1408
|
-
onClick:
|
|
1406
|
+
onClick: I,
|
|
1409
1407
|
isDisabled: L,
|
|
1410
1408
|
children: "Cancel"
|
|
1411
1409
|
}
|
|
@@ -1427,36 +1425,36 @@ const en = ({
|
|
|
1427
1425
|
)
|
|
1428
1426
|
] })
|
|
1429
1427
|
] }) });
|
|
1430
|
-
},
|
|
1428
|
+
}, pn = ({
|
|
1431
1429
|
name: n,
|
|
1432
1430
|
setName: t,
|
|
1433
|
-
actions:
|
|
1431
|
+
actions: a,
|
|
1434
1432
|
selectedActionIds: c,
|
|
1435
1433
|
setSelectedActionIds: u,
|
|
1436
|
-
availableCategories:
|
|
1434
|
+
availableCategories: i,
|
|
1437
1435
|
selectedCategoryIds: d,
|
|
1438
1436
|
setSelectedCategoryIds: m,
|
|
1439
|
-
description:
|
|
1437
|
+
description: l,
|
|
1440
1438
|
setDescription: x,
|
|
1441
1439
|
...h
|
|
1442
1440
|
}) => {
|
|
1443
|
-
const T = Ct(), p = A(() =>
|
|
1441
|
+
const T = Ct(), p = A(() => a.map((j) => ({
|
|
1444
1442
|
...j,
|
|
1445
1443
|
selected: c.includes(j.id)
|
|
1446
|
-
})), [
|
|
1444
|
+
})), [a, c]), L = A(() => a.reduce((j, S) => (j[S.id] = S, j), {}), [a]), b = A(
|
|
1447
1445
|
() => c.map((j) => L[j]),
|
|
1448
1446
|
[c, L]
|
|
1449
|
-
), s =
|
|
1447
|
+
), s = R(
|
|
1450
1448
|
(j, S) => {
|
|
1451
|
-
u(S ? [...c, j.id] : c.filter((
|
|
1449
|
+
u(S ? [...c, j.id] : c.filter((F) => F !== j.id));
|
|
1452
1450
|
},
|
|
1453
1451
|
[c, u]
|
|
1454
|
-
), f =
|
|
1452
|
+
), f = R(
|
|
1455
1453
|
(j) => {
|
|
1456
1454
|
t(j.target.value);
|
|
1457
1455
|
},
|
|
1458
1456
|
[t]
|
|
1459
|
-
), C =
|
|
1457
|
+
), C = R(
|
|
1460
1458
|
(j) => {
|
|
1461
1459
|
x?.(j.target.value);
|
|
1462
1460
|
},
|
|
@@ -1464,25 +1462,25 @@ const en = ({
|
|
|
1464
1462
|
);
|
|
1465
1463
|
return /* @__PURE__ */ e.jsxs(V, { ...h, children: [
|
|
1466
1464
|
/* @__PURE__ */ e.jsxs(re, { gap: "2rem", children: [
|
|
1467
|
-
/* @__PURE__ */ e.jsx(
|
|
1465
|
+
/* @__PURE__ */ e.jsx(gn, { name: n ?? "", onInputChange: f }),
|
|
1468
1466
|
/* @__PURE__ */ e.jsx(
|
|
1469
|
-
|
|
1467
|
+
xn,
|
|
1470
1468
|
{
|
|
1471
|
-
availableCategories:
|
|
1469
|
+
availableCategories: i,
|
|
1472
1470
|
value: d,
|
|
1473
1471
|
onChange: m
|
|
1474
1472
|
}
|
|
1475
1473
|
)
|
|
1476
1474
|
] }),
|
|
1477
1475
|
/* @__PURE__ */ e.jsx(
|
|
1478
|
-
|
|
1476
|
+
fn,
|
|
1479
1477
|
{
|
|
1480
|
-
description:
|
|
1478
|
+
description: l ?? "",
|
|
1481
1479
|
onInputChange: C
|
|
1482
1480
|
}
|
|
1483
1481
|
),
|
|
1484
1482
|
/* @__PURE__ */ e.jsx(
|
|
1485
|
-
|
|
1483
|
+
jn,
|
|
1486
1484
|
{
|
|
1487
1485
|
value: b,
|
|
1488
1486
|
onChange: u,
|
|
@@ -1501,7 +1499,7 @@ const en = ({
|
|
|
1501
1499
|
/* @__PURE__ */ e.jsx(Lt, { children: "Select Activities" }),
|
|
1502
1500
|
/* @__PURE__ */ e.jsx(St, {}),
|
|
1503
1501
|
/* @__PURE__ */ e.jsx(Mt, { children: /* @__PURE__ */ e.jsx(
|
|
1504
|
-
|
|
1502
|
+
mn,
|
|
1505
1503
|
{
|
|
1506
1504
|
actions: p,
|
|
1507
1505
|
onSelected: s,
|
|
@@ -1527,12 +1525,12 @@ const en = ({
|
|
|
1527
1525
|
}
|
|
1528
1526
|
)
|
|
1529
1527
|
] });
|
|
1530
|
-
},
|
|
1528
|
+
}, gn = Fe(
|
|
1531
1529
|
({
|
|
1532
1530
|
name: n,
|
|
1533
1531
|
onInputChange: t
|
|
1534
1532
|
}) => {
|
|
1535
|
-
const { getLabel:
|
|
1533
|
+
const { getLabel: a } = pe(), c = a("module");
|
|
1536
1534
|
return /* @__PURE__ */ e.jsxs(K, { mb: 4, children: [
|
|
1537
1535
|
/* @__PURE__ */ e.jsxs(ce, { children: [
|
|
1538
1536
|
c,
|
|
@@ -1549,22 +1547,22 @@ const en = ({
|
|
|
1549
1547
|
)
|
|
1550
1548
|
] });
|
|
1551
1549
|
}
|
|
1552
|
-
),
|
|
1550
|
+
), xn = Fe(
|
|
1553
1551
|
({
|
|
1554
1552
|
availableCategories: n,
|
|
1555
1553
|
value: t,
|
|
1556
|
-
onChange:
|
|
1554
|
+
onChange: a
|
|
1557
1555
|
}) => {
|
|
1558
|
-
const { getLabel: c } = pe(), u = c("module"),
|
|
1556
|
+
const { getLabel: c } = pe(), u = c("module"), i = A(() => [
|
|
1559
1557
|
...n,
|
|
1560
1558
|
{
|
|
1561
1559
|
id: "other",
|
|
1562
1560
|
name: "Other"
|
|
1563
1561
|
}
|
|
1564
|
-
], [n]), d = A(() =>
|
|
1562
|
+
], [n]), d = A(() => i.map((m) => ({
|
|
1565
1563
|
value: m.id,
|
|
1566
1564
|
label: m.name
|
|
1567
|
-
})), [
|
|
1565
|
+
})), [i]);
|
|
1568
1566
|
return /* @__PURE__ */ e.jsxs(K, { mb: 4, children: [
|
|
1569
1567
|
/* @__PURE__ */ e.jsxs(ce, { children: [
|
|
1570
1568
|
u,
|
|
@@ -1575,17 +1573,17 @@ const en = ({
|
|
|
1575
1573
|
{
|
|
1576
1574
|
isDisabled: n.length === 0,
|
|
1577
1575
|
options: d,
|
|
1578
|
-
value: t.length === 0 ? { value: "other", label: "Other" } :
|
|
1576
|
+
value: t.length === 0 ? { value: "other", label: "Other" } : i.filter((m) => t.includes(m.id)).map((m) => ({
|
|
1579
1577
|
value: m.id,
|
|
1580
1578
|
label: m.name
|
|
1581
1579
|
}))[0],
|
|
1582
|
-
onChange: (m) =>
|
|
1580
|
+
onChange: (m) => a(m ? [m.value] : []),
|
|
1583
1581
|
placeholder: "Select category"
|
|
1584
1582
|
}
|
|
1585
1583
|
)
|
|
1586
1584
|
] });
|
|
1587
1585
|
}
|
|
1588
|
-
),
|
|
1586
|
+
), fn = Fe(
|
|
1589
1587
|
({
|
|
1590
1588
|
description: n,
|
|
1591
1589
|
onInputChange: t
|
|
@@ -1603,11 +1601,11 @@ const en = ({
|
|
|
1603
1601
|
}
|
|
1604
1602
|
)
|
|
1605
1603
|
] })
|
|
1606
|
-
),
|
|
1604
|
+
), jn = Fe(
|
|
1607
1605
|
({
|
|
1608
1606
|
value: n,
|
|
1609
1607
|
onChange: t,
|
|
1610
|
-
onAdjustActivities:
|
|
1608
|
+
onAdjustActivities: a
|
|
1611
1609
|
}) => {
|
|
1612
1610
|
const { getLabel: c } = pe(), u = A(() => ({
|
|
1613
1611
|
module: c("module"),
|
|
@@ -1615,7 +1613,7 @@ const en = ({
|
|
|
1615
1613
|
action: c("action"),
|
|
1616
1614
|
actionPlural: c("action_plural"),
|
|
1617
1615
|
actionPluralLowerCase: c("action_plural").toLocaleLowerCase()
|
|
1618
|
-
}), [c]),
|
|
1616
|
+
}), [c]), i = A(
|
|
1619
1617
|
() => n.map((d) => ({
|
|
1620
1618
|
id: d.id,
|
|
1621
1619
|
name: d.name
|
|
@@ -1640,7 +1638,7 @@ const en = ({
|
|
|
1640
1638
|
size: "sm",
|
|
1641
1639
|
variant: "solid",
|
|
1642
1640
|
colorScheme: "blue",
|
|
1643
|
-
onClick:
|
|
1641
|
+
onClick: a,
|
|
1644
1642
|
children: [
|
|
1645
1643
|
"Add / Remove ",
|
|
1646
1644
|
u.actionPlural
|
|
@@ -1648,7 +1646,7 @@ const en = ({
|
|
|
1648
1646
|
}
|
|
1649
1647
|
)
|
|
1650
1648
|
] }),
|
|
1651
|
-
|
|
1649
|
+
i.length === 0 ? /* @__PURE__ */ e.jsx(oe, { children: /* @__PURE__ */ e.jsxs(v, { color: "gray.500", fontSize: "lg", mb: "4rem", mt: "4rem", children: [
|
|
1652
1650
|
"No ",
|
|
1653
1651
|
u.actionPluralLowerCase,
|
|
1654
1652
|
" selected for this",
|
|
@@ -1662,7 +1660,7 @@ const en = ({
|
|
|
1662
1660
|
size: "sm",
|
|
1663
1661
|
variant: "link",
|
|
1664
1662
|
colorScheme: "blue",
|
|
1665
|
-
onClick:
|
|
1663
|
+
onClick: a,
|
|
1666
1664
|
children: [
|
|
1667
1665
|
"Add ",
|
|
1668
1666
|
u.actionPluralLowerCase,
|
|
@@ -1671,86 +1669,86 @@ const en = ({
|
|
|
1671
1669
|
}
|
|
1672
1670
|
)
|
|
1673
1671
|
] }) }) : /* @__PURE__ */ e.jsx(
|
|
1674
|
-
|
|
1672
|
+
nn,
|
|
1675
1673
|
{
|
|
1676
|
-
value:
|
|
1674
|
+
value: i,
|
|
1677
1675
|
onChange: (d) => {
|
|
1678
|
-
const m = d(
|
|
1679
|
-
t(m.map((
|
|
1676
|
+
const m = d(i);
|
|
1677
|
+
t(m.map((l) => l.id));
|
|
1680
1678
|
}
|
|
1681
1679
|
}
|
|
1682
1680
|
)
|
|
1683
1681
|
] });
|
|
1684
1682
|
}
|
|
1685
|
-
),
|
|
1683
|
+
), bn = ({
|
|
1686
1684
|
value: n,
|
|
1687
1685
|
onChange: t,
|
|
1688
|
-
forceKind:
|
|
1686
|
+
forceKind: a,
|
|
1689
1687
|
disableRemove: c,
|
|
1690
1688
|
disableKind: u,
|
|
1691
|
-
isDisabled:
|
|
1689
|
+
isDisabled: i,
|
|
1692
1690
|
lockRanges: d,
|
|
1693
1691
|
...m
|
|
1694
1692
|
}) => {
|
|
1695
|
-
const
|
|
1696
|
-
const b =
|
|
1693
|
+
const l = A(() => [...n].sort((p, L) => {
|
|
1694
|
+
const b = He.indexOf(p.plane), s = He.indexOf(L.plane);
|
|
1697
1695
|
return b - s;
|
|
1698
|
-
}), [n]), x =
|
|
1696
|
+
}), [n]), x = R((p) => "segment" in p.id ? ut(p.id.segment, p.plane, !0) ?? "Unknown" : ht(p.id.joint, p.plane, !0) ?? "Unknown", []), h = R(
|
|
1699
1697
|
(p, L) => {
|
|
1700
|
-
const b =
|
|
1698
|
+
const b = l.findIndex(
|
|
1701
1699
|
(f) => f.id === L.id && f.plane === L.plane
|
|
1702
1700
|
);
|
|
1703
|
-
let s = [...
|
|
1704
|
-
|
|
1701
|
+
let s = [...l];
|
|
1702
|
+
a && (L = { ...L, kind: a }), s[b] = L, d && (s = s.map((f) => ({
|
|
1705
1703
|
...f,
|
|
1706
1704
|
min: L.min,
|
|
1707
1705
|
max: L.max
|
|
1708
1706
|
}))), t(s);
|
|
1709
1707
|
},
|
|
1710
|
-
[t,
|
|
1711
|
-
), T =
|
|
1708
|
+
[t, l, a, d]
|
|
1709
|
+
), T = R(
|
|
1712
1710
|
(p) => {
|
|
1713
|
-
const L =
|
|
1711
|
+
const L = l.filter(
|
|
1714
1712
|
(b) => b.id !== p.id || b.plane !== p.plane
|
|
1715
1713
|
);
|
|
1716
1714
|
t(L);
|
|
1717
1715
|
},
|
|
1718
|
-
[t,
|
|
1716
|
+
[t, l]
|
|
1719
1717
|
);
|
|
1720
|
-
return /* @__PURE__ */ e.jsx(oe, { alignItems: "flex-start", overflowY: "auto", ...m, children:
|
|
1721
|
-
|
|
1718
|
+
return /* @__PURE__ */ e.jsx(oe, { alignItems: "flex-start", overflowY: "auto", ...m, children: l.map((p, L) => /* @__PURE__ */ e.jsx(
|
|
1719
|
+
Cn,
|
|
1722
1720
|
{
|
|
1723
1721
|
label: x(p),
|
|
1724
1722
|
parameter: p,
|
|
1725
1723
|
onChange: (b) => h(L, b),
|
|
1726
|
-
onRemove: c ||
|
|
1727
|
-
forceKind:
|
|
1728
|
-
disableKind: u ||
|
|
1729
|
-
isDisabled:
|
|
1724
|
+
onRemove: c || i ? void 0 : () => T(p),
|
|
1725
|
+
forceKind: a,
|
|
1726
|
+
disableKind: u || i,
|
|
1727
|
+
isDisabled: i
|
|
1730
1728
|
},
|
|
1731
1729
|
`${JSON.stringify(p.id)}-${p.plane}`
|
|
1732
1730
|
)) });
|
|
1733
|
-
},
|
|
1731
|
+
}, Cn = ({
|
|
1734
1732
|
label: n,
|
|
1735
1733
|
parameter: t,
|
|
1736
|
-
onChange:
|
|
1734
|
+
onChange: a,
|
|
1737
1735
|
onRemove: c,
|
|
1738
1736
|
forceKind: u,
|
|
1739
|
-
disableKind:
|
|
1737
|
+
disableKind: i,
|
|
1740
1738
|
isDisabled: d
|
|
1741
1739
|
}) => {
|
|
1742
|
-
const m =
|
|
1743
|
-
(h) => "joint" in t.id ?
|
|
1740
|
+
const m = R(
|
|
1741
|
+
(h) => "joint" in t.id ? Kt(
|
|
1744
1742
|
t.id.joint,
|
|
1745
1743
|
t.plane,
|
|
1746
1744
|
h < 0 ? -1 : 1
|
|
1747
|
-
) :
|
|
1745
|
+
) : Vt(
|
|
1748
1746
|
t.id.segment,
|
|
1749
1747
|
t.plane,
|
|
1750
1748
|
h < 0 ? -1 : 1
|
|
1751
1749
|
),
|
|
1752
1750
|
[t]
|
|
1753
|
-
), { min:
|
|
1751
|
+
), { min: l, max: x } = "joint" in t.id ? en(t.id.joint, t.plane) : { min: -180, max: 180 };
|
|
1754
1752
|
return /* @__PURE__ */ e.jsxs(
|
|
1755
1753
|
oe,
|
|
1756
1754
|
{
|
|
@@ -1779,16 +1777,16 @@ const en = ({
|
|
|
1779
1777
|
size: "xs",
|
|
1780
1778
|
variant: "ghost",
|
|
1781
1779
|
"aria-label": "delete",
|
|
1782
|
-
icon: /* @__PURE__ */ e.jsx(Je, { as:
|
|
1780
|
+
icon: /* @__PURE__ */ e.jsx(Je, { as: Et }),
|
|
1783
1781
|
onClick: c
|
|
1784
1782
|
}
|
|
1785
1783
|
),
|
|
1786
1784
|
!u && /* @__PURE__ */ e.jsx(
|
|
1787
|
-
|
|
1785
|
+
on,
|
|
1788
1786
|
{
|
|
1789
1787
|
selectedItem: t?.kind ?? Ie.Limit,
|
|
1790
|
-
onChange: ({ value: h }) =>
|
|
1791
|
-
isDisabled:
|
|
1788
|
+
onChange: ({ value: h }) => a({ ...t, kind: h }),
|
|
1789
|
+
isDisabled: i || d,
|
|
1792
1790
|
buttonProps: {
|
|
1793
1791
|
size: "sm",
|
|
1794
1792
|
variant: "outline",
|
|
@@ -1806,15 +1804,15 @@ const en = ({
|
|
|
1806
1804
|
)
|
|
1807
1805
|
] }),
|
|
1808
1806
|
/* @__PURE__ */ e.jsx(
|
|
1809
|
-
|
|
1807
|
+
rn,
|
|
1810
1808
|
{
|
|
1811
1809
|
w: "100%",
|
|
1812
1810
|
size: "xs",
|
|
1813
|
-
min:
|
|
1811
|
+
min: l,
|
|
1814
1812
|
max: x,
|
|
1815
1813
|
zeroMarker: !0,
|
|
1816
1814
|
value: [t.min, t.max],
|
|
1817
|
-
onChange: (h) =>
|
|
1815
|
+
onChange: (h) => a({ ...t, min: h[0], max: h[1] }),
|
|
1818
1816
|
formatValue: (h) => `${Math.abs(h)}°`,
|
|
1819
1817
|
valueLabel: (h) => m(h) ?? "",
|
|
1820
1818
|
positiveNegativeLabels: m(0) ? [m(-1) ?? "", m(1) ?? ""] : void 0,
|
|
@@ -1824,65 +1822,65 @@ const en = ({
|
|
|
1824
1822
|
]
|
|
1825
1823
|
}
|
|
1826
1824
|
);
|
|
1827
|
-
}, Ae = (n, t) => "segment" in n && "segment" in t && n.segment === t.segment || "joint" in n && "joint" in t && n.joint === t.joint,
|
|
1825
|
+
}, Ae = (n, t) => "segment" in n && "segment" in t && n.segment === t.segment || "joint" in n && "joint" in t && n.joint === t.joint, yn = ({
|
|
1828
1826
|
options: n,
|
|
1829
1827
|
value: t,
|
|
1830
|
-
onChange:
|
|
1828
|
+
onChange: a,
|
|
1831
1829
|
forceKind: c,
|
|
1832
1830
|
singleValue: u,
|
|
1833
|
-
singleValueSideless:
|
|
1831
|
+
singleValueSideless: i,
|
|
1834
1832
|
editOnly: d,
|
|
1835
1833
|
disableKind: m,
|
|
1836
|
-
maxParameters:
|
|
1834
|
+
maxParameters: l,
|
|
1837
1835
|
...x
|
|
1838
1836
|
}) => {
|
|
1839
|
-
const h =
|
|
1837
|
+
const h = i ? 2 : l, T = A(
|
|
1840
1838
|
() => n.map((s) => ({
|
|
1841
|
-
label: "segment" in s.id ?
|
|
1839
|
+
label: "segment" in s.id ? ut(s.id.segment, s.plane, !0) ?? "Unknown" : ht(s.id.joint, s.plane, !0) ?? "Unknown",
|
|
1842
1840
|
value: s.id,
|
|
1843
1841
|
plane: s.plane
|
|
1844
1842
|
})),
|
|
1845
1843
|
[n]
|
|
1846
1844
|
), p = A(() => {
|
|
1847
|
-
if (!
|
|
1845
|
+
if (!i || t.length === 0)
|
|
1848
1846
|
return T;
|
|
1849
1847
|
const s = t[0];
|
|
1850
1848
|
return T.filter(
|
|
1851
1849
|
(f) => Se(f.value) === Se(s.id) && f.plane === s.plane
|
|
1852
1850
|
);
|
|
1853
|
-
}, [T, t,
|
|
1851
|
+
}, [T, t, i]), L = A(
|
|
1854
1852
|
() => T.filter(
|
|
1855
1853
|
(s) => t.some((f) => Ae(f.id, s.value) && f.plane === s.plane)
|
|
1856
1854
|
),
|
|
1857
1855
|
[T, t]
|
|
1858
|
-
), b =
|
|
1856
|
+
), b = R(
|
|
1859
1857
|
(s) => {
|
|
1860
1858
|
const f = s.map((C) => {
|
|
1861
1859
|
const j = t.find(
|
|
1862
1860
|
(k) => Ae(k.id, C.value) && k.plane === C.plane
|
|
1863
1861
|
), S = n.find(
|
|
1864
1862
|
(k) => Ae(k.id, C.value) && k.plane === C.plane
|
|
1865
|
-
),
|
|
1863
|
+
), F = i ? t.find(
|
|
1866
1864
|
(k) => Se(k.id) === Se(C.value) && k.plane === C.plane
|
|
1867
|
-
) : void 0,
|
|
1865
|
+
) : void 0, N = F && !j ? F.min : S && S.min ? S.min : 0, B = F && !j ? F.max : S && S.max ? S.max : 0;
|
|
1868
1866
|
return j ?? {
|
|
1869
1867
|
id: C.value,
|
|
1870
1868
|
plane: C.plane,
|
|
1871
|
-
min:
|
|
1869
|
+
min: N,
|
|
1872
1870
|
max: B,
|
|
1873
1871
|
kind: c ?? Ie.Limit
|
|
1874
1872
|
};
|
|
1875
1873
|
});
|
|
1876
|
-
|
|
1874
|
+
a(f);
|
|
1877
1875
|
},
|
|
1878
|
-
[
|
|
1876
|
+
[a, t, n, c, i]
|
|
1879
1877
|
);
|
|
1880
1878
|
return ae(() => {
|
|
1881
1879
|
const s = t.filter(
|
|
1882
1880
|
(f) => n.some((C) => Ae(C.id, f.id) && C.plane === f.plane)
|
|
1883
1881
|
);
|
|
1884
|
-
s.length !== t.length &&
|
|
1885
|
-
}, [n,
|
|
1882
|
+
s.length !== t.length && a(s);
|
|
1883
|
+
}, [n, a]), /* @__PURE__ */ e.jsxs(V, { ...x, children: [
|
|
1886
1884
|
/* @__PURE__ */ e.jsx(
|
|
1887
1885
|
de,
|
|
1888
1886
|
{
|
|
@@ -1896,20 +1894,20 @@ const en = ({
|
|
|
1896
1894
|
}
|
|
1897
1895
|
),
|
|
1898
1896
|
/* @__PURE__ */ e.jsx(
|
|
1899
|
-
|
|
1897
|
+
bn,
|
|
1900
1898
|
{
|
|
1901
1899
|
marginTop: 2,
|
|
1902
1900
|
maxH: "28rem",
|
|
1903
1901
|
value: t,
|
|
1904
|
-
onChange:
|
|
1902
|
+
onChange: a,
|
|
1905
1903
|
forceKind: c,
|
|
1906
1904
|
disableKind: m,
|
|
1907
1905
|
isDisabled: d,
|
|
1908
|
-
lockRanges:
|
|
1906
|
+
lockRanges: i
|
|
1909
1907
|
}
|
|
1910
1908
|
)
|
|
1911
1909
|
] });
|
|
1912
|
-
},
|
|
1910
|
+
}, mt = (n) => {
|
|
1913
1911
|
switch (n) {
|
|
1914
1912
|
case G.Thorax:
|
|
1915
1913
|
return "Thorax";
|
|
@@ -1941,7 +1939,7 @@ const en = ({
|
|
|
1941
1939
|
return "Head";
|
|
1942
1940
|
}
|
|
1943
1941
|
return console.warn(`Unknown sensor location: ${n}`), "Unknown";
|
|
1944
|
-
},
|
|
1942
|
+
}, vn = 6, wn = [
|
|
1945
1943
|
G.LeftFoot,
|
|
1946
1944
|
G.LeftShank,
|
|
1947
1945
|
G.LeftThigh,
|
|
@@ -1952,114 +1950,114 @@ const en = ({
|
|
|
1952
1950
|
G.Thorax,
|
|
1953
1951
|
G.CenterBack,
|
|
1954
1952
|
G.Head
|
|
1955
|
-
],
|
|
1956
|
-
label:
|
|
1953
|
+
], Ln = wn.map((n) => ({
|
|
1954
|
+
label: mt(n),
|
|
1957
1955
|
value: n
|
|
1958
|
-
})),
|
|
1956
|
+
})), Bn = ({
|
|
1959
1957
|
id: n,
|
|
1960
1958
|
onError: t,
|
|
1961
|
-
onCancel:
|
|
1959
|
+
onCancel: a,
|
|
1962
1960
|
onSave: c,
|
|
1963
1961
|
hideButtons: u,
|
|
1964
|
-
setButtonOnClick:
|
|
1962
|
+
setButtonOnClick: i,
|
|
1965
1963
|
setButtonDisabled: d,
|
|
1966
1964
|
quantumOwned: m,
|
|
1967
|
-
isView:
|
|
1965
|
+
isView: l
|
|
1968
1966
|
}) => {
|
|
1969
|
-
const x = Ot(), [{ fetching: h }, T] =
|
|
1970
|
-
query:
|
|
1967
|
+
const x = Ot(), [{ fetching: h }, T] = ie(ze), [{ fetching: p }, L] = ie(zt), [{ data: b }] = he({
|
|
1968
|
+
query: Gt,
|
|
1971
1969
|
variables: { id: n ?? "" },
|
|
1972
1970
|
pause: !n
|
|
1973
|
-
}), s =
|
|
1971
|
+
}), s = _(
|
|
1974
1972
|
me,
|
|
1975
1973
|
b?.getActionById
|
|
1976
1974
|
), f = h || p, C = !!s && !!n, { getLabel: j } = pe(), S = A(() => ({
|
|
1977
1975
|
action: j("action")
|
|
1978
|
-
}), [j]),
|
|
1976
|
+
}), [j]), F = A(() => [
|
|
1979
1977
|
{ key: "module_category", label: "Link Category", multi: !0 },
|
|
1980
1978
|
{ key: "activity_type", label: `${S.action} Type`, multi: !1 },
|
|
1981
1979
|
{ key: "session_type", label: "Session Type", multi: !0 },
|
|
1982
1980
|
{ key: "body_region", label: "Body Region", multi: !0 },
|
|
1983
1981
|
{ key: "sport", label: "Sport", multi: !0 }
|
|
1984
|
-
], [S.action]), [
|
|
1985
|
-
() =>
|
|
1986
|
-
[
|
|
1987
|
-
), o =
|
|
1982
|
+
], [S.action]), [N, B] = z(""), [k, $] = z(""), [M, se] = z(""), [J, g] = z(""), [I, y] = z([]), [D, X] = z([]), [Z, E] = z({}), r = A(
|
|
1983
|
+
() => I.map((O) => O.value),
|
|
1984
|
+
[I]
|
|
1985
|
+
), o = kt(r), [w, P] = z([]), W = N.length > 0, [Q, U] = z({});
|
|
1988
1986
|
ae(() => {
|
|
1989
|
-
const O =
|
|
1990
|
-
(H) => x.query(
|
|
1987
|
+
const O = F.map(
|
|
1988
|
+
(H) => x.query(Wt, { key: H.key })
|
|
1991
1989
|
);
|
|
1992
1990
|
Promise.all(O).then((H) => {
|
|
1993
1991
|
const q = {};
|
|
1994
1992
|
H.forEach((ne) => {
|
|
1995
1993
|
if (ne.error || !ne.data) return;
|
|
1996
|
-
const
|
|
1994
|
+
const le = _(
|
|
1997
1995
|
Ee,
|
|
1998
1996
|
ne.data.getMetadataByKey
|
|
1999
|
-
),
|
|
2000
|
-
|
|
2001
|
-
|
|
1997
|
+
), Re = _(
|
|
1998
|
+
Pe,
|
|
1999
|
+
le.data
|
|
2002
2000
|
);
|
|
2003
|
-
q[
|
|
2001
|
+
q[le.key] = Re.map((ge) => ({
|
|
2004
2002
|
label: ge.label || ge.value,
|
|
2005
2003
|
value: ge.value,
|
|
2006
2004
|
id: ge.id
|
|
2007
2005
|
}));
|
|
2008
2006
|
}), E(q);
|
|
2009
2007
|
});
|
|
2010
|
-
}, [x,
|
|
2008
|
+
}, [x, F]), ae(() => {
|
|
2011
2009
|
if (s) {
|
|
2012
|
-
const H =
|
|
2010
|
+
const H = _(
|
|
2013
2011
|
Ee,
|
|
2014
2012
|
s.metadataGroups
|
|
2015
2013
|
).map(
|
|
2016
|
-
(ne) => ne.data.map((
|
|
2014
|
+
(ne) => ne.data.map((le) => _(Pe, le).id)
|
|
2017
2015
|
), q = {
|
|
2018
2016
|
name: s.name,
|
|
2019
2017
|
description: s.description || "",
|
|
2020
2018
|
cameraPlacement: s.cameraPlacement || "",
|
|
2021
2019
|
videoLink: s.videoLink || "",
|
|
2022
2020
|
sensorLocations: s.sensorLocations.map((ne) => ({
|
|
2023
|
-
label:
|
|
2021
|
+
label: mt(ne),
|
|
2024
2022
|
value: ne
|
|
2025
2023
|
})),
|
|
2026
|
-
thresholds:
|
|
2024
|
+
thresholds: Nt(s.thresholds),
|
|
2027
2025
|
metadataIds: H.flat()
|
|
2028
2026
|
};
|
|
2029
|
-
B(q.name), $(q.description), se(q.cameraPlacement), g(q.videoLink), y(q.sensorLocations),
|
|
2027
|
+
B(q.name), $(q.description), se(q.cameraPlacement), g(q.videoLink), y(q.sensorLocations), P(q.thresholds), X(q.metadataIds), U(q);
|
|
2030
2028
|
}
|
|
2031
2029
|
}, [s]);
|
|
2032
2030
|
const te = A(
|
|
2033
2031
|
() => JSON.stringify(Q) !== JSON.stringify({
|
|
2034
|
-
name:
|
|
2032
|
+
name: N,
|
|
2035
2033
|
description: k,
|
|
2036
2034
|
cameraPlacement: M,
|
|
2037
2035
|
videoLink: J,
|
|
2038
|
-
sensorLocations:
|
|
2039
|
-
thresholds:
|
|
2036
|
+
sensorLocations: r,
|
|
2037
|
+
thresholds: Ye(w),
|
|
2040
2038
|
metadataIds: D
|
|
2041
2039
|
}),
|
|
2042
2040
|
[
|
|
2043
2041
|
Q,
|
|
2044
|
-
|
|
2045
|
-
|
|
2042
|
+
N,
|
|
2043
|
+
r,
|
|
2046
2044
|
k,
|
|
2047
2045
|
M,
|
|
2048
2046
|
J,
|
|
2049
2047
|
D,
|
|
2050
2048
|
w
|
|
2051
2049
|
]
|
|
2052
|
-
), Y =
|
|
2050
|
+
), Y = R(() => {
|
|
2053
2051
|
const O = {
|
|
2054
|
-
name:
|
|
2052
|
+
name: N,
|
|
2055
2053
|
description: k,
|
|
2056
2054
|
cameraPlacement: M,
|
|
2057
2055
|
videoLink: J,
|
|
2058
|
-
sensorLocations:
|
|
2059
|
-
thresholds:
|
|
2056
|
+
sensorLocations: r,
|
|
2057
|
+
thresholds: Ye(w),
|
|
2060
2058
|
metadataItemIds: D,
|
|
2061
2059
|
// Backend requires laterality; keep existing default since UI no longer edits it
|
|
2062
|
-
laterality:
|
|
2060
|
+
laterality: Zt.Either,
|
|
2063
2061
|
quantumOwned: m,
|
|
2064
2062
|
//Backend requires session type; keep existing default since UI no longer edits it
|
|
2065
2063
|
sessionType: []
|
|
@@ -2078,8 +2076,8 @@ const en = ({
|
|
|
2078
2076
|
T,
|
|
2079
2077
|
L,
|
|
2080
2078
|
n,
|
|
2081
|
-
|
|
2082
|
-
|
|
2079
|
+
N,
|
|
2080
|
+
r,
|
|
2083
2081
|
k,
|
|
2084
2082
|
M,
|
|
2085
2083
|
J,
|
|
@@ -2092,24 +2090,24 @@ const en = ({
|
|
|
2092
2090
|
ae(() => {
|
|
2093
2091
|
d && d({
|
|
2094
2092
|
cancelButton: f,
|
|
2095
|
-
saveButton:
|
|
2093
|
+
saveButton: l ? !0 : f || !W || !te
|
|
2096
2094
|
});
|
|
2097
|
-
}, [f, d, W, te,
|
|
2098
|
-
|
|
2099
|
-
cancelButton:
|
|
2100
|
-
saveButton:
|
|
2095
|
+
}, [f, d, W, te, l]), ae(() => {
|
|
2096
|
+
i && i({
|
|
2097
|
+
cancelButton: a,
|
|
2098
|
+
saveButton: l ? () => {
|
|
2101
2099
|
} : Y
|
|
2102
2100
|
});
|
|
2103
|
-
}, [
|
|
2101
|
+
}, [i, a, Y, l]);
|
|
2104
2102
|
const Ce = (O, H) => {
|
|
2105
|
-
const q =
|
|
2103
|
+
const q = F.find((le) => le.key === O);
|
|
2106
2104
|
if (!q) return;
|
|
2107
2105
|
const ne = q.multi ? (H ?? []).map(
|
|
2108
|
-
(
|
|
2106
|
+
(le) => le.id
|
|
2109
2107
|
) : H ? [H.id] : [];
|
|
2110
|
-
X((
|
|
2108
|
+
X((le) => [...le.filter((ge) => Object.values(Z).flat().find((Le) => Le.id === ge) && !Object.keys(Z).find(
|
|
2111
2109
|
(Le) => Z[Le]?.some(
|
|
2112
|
-
(
|
|
2110
|
+
(pt) => pt.id === ge && Le === O
|
|
2113
2111
|
)
|
|
2114
2112
|
)), ...ne]);
|
|
2115
2113
|
};
|
|
@@ -2120,11 +2118,11 @@ const en = ({
|
|
|
2120
2118
|
/* @__PURE__ */ e.jsx(
|
|
2121
2119
|
ye,
|
|
2122
2120
|
{
|
|
2123
|
-
value:
|
|
2121
|
+
value: N,
|
|
2124
2122
|
onChange: (O) => B(O.target.value),
|
|
2125
2123
|
type: "text",
|
|
2126
2124
|
placeholder: "i.e. Lunge & Return",
|
|
2127
|
-
isDisabled:
|
|
2125
|
+
isDisabled: l
|
|
2128
2126
|
}
|
|
2129
2127
|
)
|
|
2130
2128
|
] }),
|
|
@@ -2137,7 +2135,7 @@ const en = ({
|
|
|
2137
2135
|
onChange: (O) => se(O.target.value),
|
|
2138
2136
|
rows: 2,
|
|
2139
2137
|
placeholder: "(optional) Describe camera setup, placement, angles",
|
|
2140
|
-
isDisabled:
|
|
2138
|
+
isDisabled: l
|
|
2141
2139
|
}
|
|
2142
2140
|
)
|
|
2143
2141
|
] }),
|
|
@@ -2150,7 +2148,7 @@ const en = ({
|
|
|
2150
2148
|
onChange: (O) => g(O.target.value),
|
|
2151
2149
|
type: "url",
|
|
2152
2150
|
placeholder: "(optional) https://...",
|
|
2153
|
-
isDisabled:
|
|
2151
|
+
isDisabled: l
|
|
2154
2152
|
}
|
|
2155
2153
|
)
|
|
2156
2154
|
] }),
|
|
@@ -2163,13 +2161,13 @@ const en = ({
|
|
|
2163
2161
|
onChange: (O) => $(O.target.value),
|
|
2164
2162
|
rows: 2,
|
|
2165
2163
|
placeholder: "(optional) Describe how to perform the test or exercise",
|
|
2166
|
-
isDisabled:
|
|
2164
|
+
isDisabled: l
|
|
2167
2165
|
}
|
|
2168
2166
|
)
|
|
2169
2167
|
] }),
|
|
2170
2168
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
2171
2169
|
/* @__PURE__ */ e.jsx(ue, { children: "Metadata Tags" }),
|
|
2172
|
-
|
|
2170
|
+
F.map((O) => /* @__PURE__ */ e.jsxs(K, { children: [
|
|
2173
2171
|
/* @__PURE__ */ e.jsx(ue, { children: O.label }),
|
|
2174
2172
|
/* @__PURE__ */ e.jsx(
|
|
2175
2173
|
de,
|
|
@@ -2183,7 +2181,7 @@ const en = ({
|
|
|
2183
2181
|
},
|
|
2184
2182
|
options: Z[O.key],
|
|
2185
2183
|
placeholder: `Select ${O.multi ? "one or more" : "one"} ${O.label.toLowerCase()}`,
|
|
2186
|
-
isDisabled:
|
|
2184
|
+
isDisabled: l,
|
|
2187
2185
|
isClearable: O.multi
|
|
2188
2186
|
}
|
|
2189
2187
|
)
|
|
@@ -2197,23 +2195,23 @@ const en = ({
|
|
|
2197
2195
|
de,
|
|
2198
2196
|
{
|
|
2199
2197
|
isMulti: !0,
|
|
2200
|
-
value:
|
|
2198
|
+
value: I,
|
|
2201
2199
|
onChange: (O) => y([...O]),
|
|
2202
|
-
options:
|
|
2203
|
-
isOptionDisabled: () =>
|
|
2204
|
-
isDisabled:
|
|
2200
|
+
options: Ln,
|
|
2201
|
+
isOptionDisabled: () => I.length >= vn,
|
|
2202
|
+
isDisabled: l
|
|
2205
2203
|
}
|
|
2206
2204
|
)
|
|
2207
2205
|
] }),
|
|
2208
2206
|
/* @__PURE__ */ e.jsxs(K, { children: [
|
|
2209
2207
|
/* @__PURE__ */ e.jsx(ue, { children: "Default Parameters" }),
|
|
2210
2208
|
/* @__PURE__ */ e.jsx(
|
|
2211
|
-
|
|
2209
|
+
yn,
|
|
2212
2210
|
{
|
|
2213
2211
|
options: o,
|
|
2214
2212
|
value: w,
|
|
2215
|
-
onChange:
|
|
2216
|
-
editOnly:
|
|
2213
|
+
onChange: P,
|
|
2214
|
+
editOnly: l
|
|
2217
2215
|
}
|
|
2218
2216
|
)
|
|
2219
2217
|
] })
|
|
@@ -2221,12 +2219,12 @@ const en = ({
|
|
|
2221
2219
|
/* @__PURE__ */ e.jsx(
|
|
2222
2220
|
"div",
|
|
2223
2221
|
{
|
|
2224
|
-
className:
|
|
2222
|
+
className: ot(
|
|
2225
2223
|
"col-span-2 flex justify-end",
|
|
2226
|
-
(u ||
|
|
2224
|
+
(u || l) && "hidden"
|
|
2227
2225
|
),
|
|
2228
2226
|
children: /* @__PURE__ */ e.jsxs(be, { mt: 16, gap: 4, children: [
|
|
2229
|
-
/* @__PURE__ */ e.jsx(ee, { colorScheme: "gray", isDisabled: f, onClick:
|
|
2227
|
+
/* @__PURE__ */ e.jsx(ee, { colorScheme: "gray", isDisabled: f, onClick: a, children: "Cancel" }),
|
|
2230
2228
|
/* @__PURE__ */ e.jsx(
|
|
2231
2229
|
ee,
|
|
2232
2230
|
{
|
|
@@ -2241,88 +2239,88 @@ const en = ({
|
|
|
2241
2239
|
}
|
|
2242
2240
|
)
|
|
2243
2241
|
] });
|
|
2244
|
-
}, ue = ({ children: n }) => /* @__PURE__ */ e.jsx(Xe, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: n }),
|
|
2242
|
+
}, ue = ({ children: n }) => /* @__PURE__ */ e.jsx(Xe, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: n }), Qn = ({
|
|
2245
2243
|
id: n,
|
|
2246
2244
|
onCancel: t,
|
|
2247
|
-
onSave:
|
|
2245
|
+
onSave: a,
|
|
2248
2246
|
onError: c,
|
|
2249
2247
|
hideButtons: u,
|
|
2250
|
-
quantumOwned:
|
|
2248
|
+
quantumOwned: i,
|
|
2251
2249
|
setButtonOnClick: d,
|
|
2252
2250
|
setButtonDisabled: m
|
|
2253
2251
|
}) => {
|
|
2254
|
-
const [{ data:
|
|
2255
|
-
query:
|
|
2252
|
+
const [{ data: l }] = he({
|
|
2253
|
+
query: i ? Ut : Bt
|
|
2256
2254
|
}), [{ data: x }] = he({
|
|
2257
|
-
query:
|
|
2255
|
+
query: Qt,
|
|
2258
2256
|
variables: { id: n },
|
|
2259
2257
|
pause: !n
|
|
2260
2258
|
}), [{ data: h }] = he({
|
|
2261
|
-
query:
|
|
2262
|
-
}), T =
|
|
2259
|
+
query: qt
|
|
2260
|
+
}), T = _(
|
|
2263
2261
|
we,
|
|
2264
2262
|
h?.moduleCategories
|
|
2265
|
-
), [{ fetching: p }, L] =
|
|
2263
|
+
), [{ fetching: p }, L] = ie(ct), [{ fetching: b }, s] = ie(it), f = _(
|
|
2266
2264
|
me,
|
|
2267
|
-
|
|
2268
|
-
) ?? [], C =
|
|
2265
|
+
i ? l?.quantumOwnedActions : l?.actions
|
|
2266
|
+
) ?? [], C = _(Te, x?.module), j = _(dt, C?.moduleActions) ?? [], [S, F] = z([
|
|
2269
2267
|
...j.map((g) => g.actionId) ?? []
|
|
2270
|
-
]), [
|
|
2268
|
+
]), [N, B] = z(C?.name ?? ""), [k, $] = z([]), [M, se] = z(C?.description ?? "");
|
|
2271
2269
|
ae(() => {
|
|
2272
|
-
C && (
|
|
2270
|
+
C && (F(j.map((g) => g.actionId)), B(C.name), se(C.description ?? ""), $(
|
|
2273
2271
|
C.categories.map(
|
|
2274
|
-
(g) =>
|
|
2272
|
+
(g) => _(we, g).id
|
|
2275
2273
|
) ?? []
|
|
2276
2274
|
));
|
|
2277
2275
|
}, [C, j]);
|
|
2278
|
-
const J =
|
|
2276
|
+
const J = R(() => {
|
|
2279
2277
|
let g;
|
|
2280
|
-
const
|
|
2278
|
+
const I = {
|
|
2281
2279
|
actions: S,
|
|
2282
|
-
name:
|
|
2280
|
+
name: N,
|
|
2283
2281
|
categories: k.filter((y) => y !== "other"),
|
|
2284
2282
|
description: M,
|
|
2285
|
-
quantumOwned:
|
|
2283
|
+
quantumOwned: i
|
|
2286
2284
|
};
|
|
2287
2285
|
C ? g = L({
|
|
2288
2286
|
id: C.id,
|
|
2289
|
-
input:
|
|
2287
|
+
input: I
|
|
2290
2288
|
}) : g = s({
|
|
2291
|
-
input:
|
|
2289
|
+
input: I
|
|
2292
2290
|
}), g.then(({ error: y }) => {
|
|
2293
|
-
y ? c(y) :
|
|
2291
|
+
y ? c(y) : a();
|
|
2294
2292
|
});
|
|
2295
2293
|
}, [
|
|
2296
2294
|
s,
|
|
2297
2295
|
L,
|
|
2298
2296
|
S,
|
|
2299
|
-
|
|
2297
|
+
N,
|
|
2300
2298
|
M,
|
|
2301
2299
|
k,
|
|
2302
2300
|
C,
|
|
2303
|
-
|
|
2301
|
+
a,
|
|
2304
2302
|
c,
|
|
2305
|
-
|
|
2303
|
+
i
|
|
2306
2304
|
]);
|
|
2307
2305
|
return ae(() => {
|
|
2308
2306
|
m && m({
|
|
2309
2307
|
cancelButton: p || b,
|
|
2310
|
-
saveButton: p || b || !
|
|
2308
|
+
saveButton: p || b || !N || M.trim().split(/\s+/).filter(Boolean).length > 40
|
|
2311
2309
|
});
|
|
2312
|
-
}, [m, p, b, S,
|
|
2310
|
+
}, [m, p, b, S, N, M]), ae(() => {
|
|
2313
2311
|
d && d({
|
|
2314
2312
|
cancelButton: t,
|
|
2315
2313
|
saveButton: J
|
|
2316
2314
|
});
|
|
2317
2315
|
}, [d, t, J]), /* @__PURE__ */ e.jsxs(V, { width: "100%", children: [
|
|
2318
2316
|
/* @__PURE__ */ e.jsx(
|
|
2319
|
-
|
|
2317
|
+
pn,
|
|
2320
2318
|
{
|
|
2321
|
-
name:
|
|
2319
|
+
name: N,
|
|
2322
2320
|
setName: B,
|
|
2323
2321
|
actions: f,
|
|
2324
2322
|
selectedActionIds: S,
|
|
2325
|
-
setSelectedActionIds:
|
|
2323
|
+
setSelectedActionIds: F,
|
|
2326
2324
|
availableCategories: T ?? [],
|
|
2327
2325
|
selectedCategoryIds: k,
|
|
2328
2326
|
setSelectedCategoryIds: $,
|
|
@@ -2344,7 +2342,7 @@ const en = ({
|
|
|
2344
2342
|
ee,
|
|
2345
2343
|
{
|
|
2346
2344
|
colorScheme: "blue",
|
|
2347
|
-
isDisabled: p || b || !
|
|
2345
|
+
isDisabled: p || b || !N || M.trim().split(/\s+/).filter(Boolean).length > 40,
|
|
2348
2346
|
isLoading: p || b,
|
|
2349
2347
|
onClick: J,
|
|
2350
2348
|
children: "Save"
|
|
@@ -2354,12 +2352,12 @@ const en = ({
|
|
|
2354
2352
|
] });
|
|
2355
2353
|
};
|
|
2356
2354
|
export {
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2355
|
+
mn as ActivityList,
|
|
2356
|
+
Wn as CopyActivityForm,
|
|
2357
|
+
Un as CopyModuleForm,
|
|
2358
|
+
pn as ModuleForm,
|
|
2359
|
+
bn as ParameterEditList,
|
|
2360
|
+
yn as ParameterEditSelect,
|
|
2361
|
+
Bn as UpsertActivityForm,
|
|
2362
|
+
Qn as UpsertModuleForm
|
|
2365
2363
|
};
|