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