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