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