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