@skopon-cool/form-sdk 0.4.5 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter/a2uiAdapter.d.ts.map +1 -1
- package/dist/adapter/formSchema.d.ts +3 -0
- package/dist/adapter/formSchema.d.ts.map +1 -1
- package/dist/components/AskUserFormCard.d.ts.map +1 -1
- package/dist/index.d.ts +4 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1353 -1169
- package/dist/submit/intersectPayloadBlocksWithForm.d.ts +4 -2
- package/dist/submit/intersectPayloadBlocksWithForm.d.ts.map +1 -1
- package/dist/types/index.d.ts +18 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/adapter/a2uiAdapter.test.ts +25 -0
- package/src/adapter/a2uiAdapter.ts +16 -1
- package/src/adapter/formSchema.test.ts +91 -10
- package/src/adapter/formSchema.ts +209 -17
- package/src/components/AskUserFormCard.tsx +25 -13
- package/src/index.ts +18 -3
- package/src/submit/intersectPayloadBlocksWithForm.ts +27 -4
- package/src/submit/submit.test.ts +54 -0
- package/src/types/index.ts +34 -0
package/dist/index.js
CHANGED
|
@@ -1,34 +1,43 @@
|
|
|
1
1
|
import './form-sdk.css';
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var G = (e, t, n) =>
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { useRef as A, useState as
|
|
7
|
-
import { Spin as
|
|
8
|
-
import { ReloadOutlined as
|
|
9
|
-
import { createBinderlessComponentImplementation as
|
|
2
|
+
var zn = Object.defineProperty;
|
|
3
|
+
var On = (e, t, n) => t in e ? zn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
|
+
var G = (e, t, n) => On(e, typeof t != "symbol" ? t + "" : t, n);
|
|
5
|
+
import { jsx as u, jsxs as M } from "react/jsx-runtime";
|
|
6
|
+
import { useRef as A, useState as P, useCallback as j, useMemo as L, createContext as Se, useContext as ke, useEffect as q, useSyncExternalStore as qn, forwardRef as Bn, useImperativeHandle as Vn } from "react";
|
|
7
|
+
import { Spin as ft, Button as Oe, Typography as ne, Avatar as Ln, Tag as ge, Select as st, Checkbox as jn, Radio as $n, Switch as Dn, TimePicker as Hn, DatePicker as Kn, Upload as Ye, Input as Qe, InputNumber as Jn, ConfigProvider as Gn, Tooltip as he } from "antd";
|
|
8
|
+
import { ReloadOutlined as Yt, FileTextOutlined as Qt, UserOutlined as Wn, FileImageOutlined as Yn, FileExcelOutlined as Qn, FileOutlined as Xt, PictureOutlined as Xn, SoundOutlined as Zn, VideoCameraOutlined as er } from "@ant-design/icons";
|
|
9
|
+
import { createBinderlessComponentImplementation as X, basicCatalog as Ue, A2uiSurface as Zt } from "@a2ui/react/v0_9";
|
|
10
10
|
import { z as h } from "zod";
|
|
11
|
-
import { Catalog as
|
|
12
|
-
import { injectBasicCatalogStyles as
|
|
13
|
-
import { injectStyles as
|
|
14
|
-
import
|
|
15
|
-
const
|
|
11
|
+
import { Catalog as tr, MessageProcessor as en } from "@a2ui/web_core/v0_9";
|
|
12
|
+
import { injectBasicCatalogStyles as tn } from "@a2ui/web_core/v0_9/basic_catalog";
|
|
13
|
+
import { injectStyles as nn } from "@a2ui/react/styles";
|
|
14
|
+
import jt from "dayjs";
|
|
15
|
+
const ds = "v0.9", nr = [
|
|
16
16
|
"huge",
|
|
17
17
|
"large",
|
|
18
18
|
"medium",
|
|
19
19
|
"small",
|
|
20
20
|
"icon"
|
|
21
21
|
];
|
|
22
|
-
function
|
|
22
|
+
function de(e) {
|
|
23
23
|
return e === "image" || e === "video" || e === "audio";
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function Ce(e) {
|
|
26
26
|
return e === "heading" || e === "paragraph";
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
return !
|
|
28
|
+
function Z(e) {
|
|
29
|
+
return !Ce(e) && !de(e);
|
|
30
|
+
}
|
|
31
|
+
function fs(e) {
|
|
32
|
+
return Ce(e) || de(e);
|
|
33
|
+
}
|
|
34
|
+
function rr(e) {
|
|
35
|
+
return e === "select" || e === "multiselect" || e === "radio" || e === "checkbox";
|
|
36
|
+
}
|
|
37
|
+
function ps(e) {
|
|
38
|
+
return Z(e) && e !== "file" && e !== "resume_multiselect" && e !== "case_multiselect";
|
|
30
39
|
}
|
|
31
|
-
function
|
|
40
|
+
function or() {
|
|
32
41
|
if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
|
|
33
42
|
return crypto.randomUUID();
|
|
34
43
|
if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") {
|
|
@@ -42,11 +51,11 @@ function Xn() {
|
|
|
42
51
|
return (e === "x" ? t : t & 3 | 8).toString(16);
|
|
43
52
|
});
|
|
44
53
|
}
|
|
45
|
-
function
|
|
46
|
-
const t =
|
|
54
|
+
function le(e) {
|
|
55
|
+
const t = or().replace(/-/g, "").slice(0, 8);
|
|
47
56
|
return `${e}${t}`;
|
|
48
57
|
}
|
|
49
|
-
const
|
|
58
|
+
const rn = [
|
|
50
59
|
{ value: "image/*", label: "图片" },
|
|
51
60
|
{ value: "video/*", label: "视频" },
|
|
52
61
|
{ value: "audio/*", label: "音频" },
|
|
@@ -57,7 +66,7 @@ const tn = [
|
|
|
57
66
|
{ value: "text/plain", label: "纯文本" },
|
|
58
67
|
{ value: "application/zip", label: "ZIP 压缩包" },
|
|
59
68
|
{ value: "application/x-rar-compressed", label: "RAR 压缩包" }
|
|
60
|
-
],
|
|
69
|
+
], ir = {
|
|
61
70
|
"image/*": ["image/*"],
|
|
62
71
|
"video/*": ["video/*"],
|
|
63
72
|
"audio/*": ["audio/*"],
|
|
@@ -77,7 +86,7 @@ const tn = [
|
|
|
77
86
|
"text/plain": ["text/plain"],
|
|
78
87
|
"application/zip": ["application/zip"],
|
|
79
88
|
"application/x-rar-compressed": ["application/x-rar-compressed"]
|
|
80
|
-
},
|
|
89
|
+
}, sr = {
|
|
81
90
|
"image/*": [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"],
|
|
82
91
|
"video/*": [".mp4", ".mov", ".avi", ".webm"],
|
|
83
92
|
"audio/*": [".mp3", ".wav", ".ogg", ".m4a"],
|
|
@@ -88,14 +97,14 @@ const tn = [
|
|
|
88
97
|
"text/plain": [".txt"],
|
|
89
98
|
"application/zip": [".zip", ".7z"],
|
|
90
99
|
"application/x-rar-compressed": [".rar"]
|
|
91
|
-
},
|
|
100
|
+
}, ar = {
|
|
92
101
|
"application/msword": "office/word",
|
|
93
102
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "office/word",
|
|
94
103
|
"application/vnd.ms-excel": "office/excel",
|
|
95
104
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "office/excel",
|
|
96
105
|
"application/vnd.ms-powerpoint": "office/ppt",
|
|
97
106
|
"application/vnd.openxmlformats-officedocument.presentationml.presentation": "office/ppt"
|
|
98
|
-
},
|
|
107
|
+
}, pt = [
|
|
99
108
|
{ value: ".jpg", label: ".jpg" },
|
|
100
109
|
{ value: ".jpeg", label: ".jpeg" },
|
|
101
110
|
{ value: ".png", label: ".png" },
|
|
@@ -121,120 +130,119 @@ const tn = [
|
|
|
121
130
|
{ value: ".zip", label: ".zip" },
|
|
122
131
|
{ value: ".rar", label: ".rar" },
|
|
123
132
|
{ value: ".7z", label: ".7z" }
|
|
124
|
-
],
|
|
125
|
-
|
|
126
|
-
),
|
|
127
|
-
|
|
128
|
-
),
|
|
129
|
-
|
|
133
|
+
], lr = Object.fromEntries(
|
|
134
|
+
rn.map((e) => [e.value, e.label])
|
|
135
|
+
), cr = Object.fromEntries(
|
|
136
|
+
pt.map((e) => [e.value, e.label])
|
|
137
|
+
), ur = new Set(rn.map((e) => e.value)), mr = new Set(
|
|
138
|
+
pt.map((e) => e.value)
|
|
130
139
|
);
|
|
131
|
-
function
|
|
140
|
+
function dr(e) {
|
|
132
141
|
const t = e.trim();
|
|
133
|
-
return t ?
|
|
142
|
+
return t ? ur.has(t) ? t : ar[t] ?? null : null;
|
|
134
143
|
}
|
|
135
|
-
function
|
|
144
|
+
function fr(e) {
|
|
136
145
|
return Array.isArray(e) ? e.map((t) => {
|
|
137
146
|
const n = t.trim().toLowerCase();
|
|
138
147
|
return n ? n.startsWith(".") ? n : `.${n}` : "";
|
|
139
148
|
}).filter(Boolean) : [];
|
|
140
149
|
}
|
|
141
|
-
function
|
|
150
|
+
function Ae(e) {
|
|
142
151
|
if (!Array.isArray(e)) return [];
|
|
143
152
|
const t = [], n = /* @__PURE__ */ new Set();
|
|
144
153
|
for (const r of e) {
|
|
145
|
-
const o =
|
|
154
|
+
const o = dr(r);
|
|
146
155
|
o && !n.has(o) && (n.add(o), t.push(o));
|
|
147
156
|
}
|
|
148
157
|
return t;
|
|
149
158
|
}
|
|
150
|
-
function
|
|
151
|
-
const t =
|
|
159
|
+
function pr(e) {
|
|
160
|
+
const t = Ae(e), n = [];
|
|
152
161
|
for (const r of t)
|
|
153
|
-
n.push(...
|
|
162
|
+
n.push(...ir[r] ?? [r]);
|
|
154
163
|
return n;
|
|
155
164
|
}
|
|
156
|
-
function
|
|
157
|
-
const t =
|
|
165
|
+
function hr(e) {
|
|
166
|
+
const t = Ae(e);
|
|
158
167
|
if (t.length === 0) return [];
|
|
159
168
|
const n = /* @__PURE__ */ new Set();
|
|
160
169
|
for (const r of t)
|
|
161
|
-
for (const o of
|
|
170
|
+
for (const o of sr[r] ?? [])
|
|
162
171
|
n.add(o);
|
|
163
|
-
return
|
|
172
|
+
return pt.filter((r) => n.has(r.value));
|
|
164
173
|
}
|
|
165
|
-
function
|
|
166
|
-
const n =
|
|
174
|
+
function ht(e, t) {
|
|
175
|
+
const n = fr(t), r = Ae(e);
|
|
167
176
|
if (r.length === 0)
|
|
168
|
-
return n.filter((i) =>
|
|
177
|
+
return n.filter((i) => mr.has(i));
|
|
169
178
|
const o = new Set(
|
|
170
|
-
|
|
179
|
+
hr(r).map((i) => i.value)
|
|
171
180
|
);
|
|
172
181
|
return n.filter((i) => o.has(i));
|
|
173
182
|
}
|
|
174
|
-
function
|
|
175
|
-
const n =
|
|
183
|
+
function gr(e, t) {
|
|
184
|
+
const n = pr(e), r = ht(e, t), o = [...n, ...r];
|
|
176
185
|
return o.length > 0 ? o.join(",") : void 0;
|
|
177
186
|
}
|
|
178
|
-
function
|
|
179
|
-
const n =
|
|
187
|
+
function yr(e, t) {
|
|
188
|
+
const n = Ae(e), r = ht(
|
|
180
189
|
n,
|
|
181
190
|
t
|
|
182
191
|
), o = [
|
|
183
|
-
...n.map((i) =>
|
|
184
|
-
...r.map((i) =>
|
|
192
|
+
...n.map((i) => lr[i] ?? i),
|
|
193
|
+
...r.map((i) => cr[i] ?? i)
|
|
185
194
|
];
|
|
186
195
|
return o.length === 0 ? null : o.join("、");
|
|
187
196
|
}
|
|
188
|
-
const
|
|
197
|
+
const vr = [
|
|
189
198
|
"video",
|
|
190
199
|
"audio",
|
|
191
200
|
"image",
|
|
192
201
|
"file",
|
|
193
202
|
"spreadsheet",
|
|
194
203
|
"document"
|
|
195
|
-
],
|
|
196
|
-
function
|
|
197
|
-
return e &&
|
|
204
|
+
], br = new Set(vr);
|
|
205
|
+
function Sr(e) {
|
|
206
|
+
return e && br.has(e) ? e : "file";
|
|
198
207
|
}
|
|
199
|
-
function
|
|
200
|
-
return typeof e == "string" &&
|
|
208
|
+
function _e(e) {
|
|
209
|
+
return typeof e == "string" && nr.includes(e) ? e : "medium";
|
|
201
210
|
}
|
|
202
|
-
function
|
|
211
|
+
function kr(e, t) {
|
|
203
212
|
var o;
|
|
204
213
|
const n = Math.max(1, t);
|
|
205
214
|
let r = [];
|
|
206
215
|
return Array.isArray(e.mediaUrls) ? r = e.mediaUrls.map((i) => String(i).trim()) : (o = e.mediaUrl) != null && o.trim() && (r = [e.mediaUrl.trim()]), r.length === 0 ? [""] : r.slice(0, n);
|
|
207
216
|
}
|
|
208
|
-
function
|
|
217
|
+
function Cr(e) {
|
|
209
218
|
var t;
|
|
210
219
|
return Array.isArray(e.mediaUrls) ? e.mediaUrls.map((n) => n.trim()).filter(Boolean) : (t = e.mediaUrl) != null && t.trim() ? [e.mediaUrl.trim()] : [];
|
|
211
220
|
}
|
|
212
|
-
function
|
|
213
|
-
return `form-media-size-${
|
|
221
|
+
function Ar(e) {
|
|
222
|
+
return `form-media-size-${_e(e)}`;
|
|
214
223
|
}
|
|
215
|
-
function
|
|
216
|
-
return `form-media-preview form-media-list ${
|
|
224
|
+
function _r(e) {
|
|
225
|
+
return `form-media-preview form-media-list ${Ar(e)}`;
|
|
217
226
|
}
|
|
218
|
-
const
|
|
219
|
-
function
|
|
227
|
+
const Tr = 10;
|
|
228
|
+
function on(e) {
|
|
220
229
|
return e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
221
230
|
}
|
|
222
|
-
function
|
|
231
|
+
function Te(e) {
|
|
223
232
|
return e === !0 || e === "true" || e === 1 || e === "1";
|
|
224
233
|
}
|
|
225
|
-
function
|
|
234
|
+
function Re(e, t = 1) {
|
|
226
235
|
const n = typeof e == "number" ? e : Number(e);
|
|
227
236
|
return Number.isFinite(n) ? Math.max(0, Math.floor(n)) : t;
|
|
228
237
|
}
|
|
229
|
-
function
|
|
238
|
+
function ue(e, t = 1) {
|
|
230
239
|
const n = typeof e == "number" ? e : Number(e);
|
|
231
240
|
return Number.isFinite(n) ? Math.max(1, Math.floor(n)) : t;
|
|
232
241
|
}
|
|
233
|
-
function
|
|
234
|
-
|
|
235
|
-
return e === "toggle" ? ke(t) : e === "multiselect" || e === "checkbox" || e === "resume_multiselect" || e === "case_multiselect" ? Array.isArray(t) ? t.map(String) : typeof t == "string" && t ? [t] : [] : typeof t == "boolean" ? t ? "true" : "false" : Array.isArray(t) ? t.map(String) : String(t);
|
|
242
|
+
function sn(e, t) {
|
|
243
|
+
return t == null ? void 0 : e === "toggle" ? Te(t) : e === "multiselect" || e === "checkbox" || e === "resume_multiselect" || e === "case_multiselect" ? Array.isArray(t) ? t.map(String).map((o) => o.trim()).filter(Boolean) : typeof t == "string" && t.trim() ? [t.trim()] : [] : typeof t == "boolean" ? t ? "true" : "false" : Array.isArray(t) ? t.map(String) : String(t).trim() || void 0;
|
|
236
244
|
}
|
|
237
|
-
function
|
|
245
|
+
function xr(e) {
|
|
238
246
|
if (Array.isArray(e)) return e.map(String).filter(Boolean);
|
|
239
247
|
if (typeof e == "string" && e.trim())
|
|
240
248
|
try {
|
|
@@ -244,83 +252,223 @@ function kr(e) {
|
|
|
244
252
|
}
|
|
245
253
|
return [];
|
|
246
254
|
}
|
|
247
|
-
function
|
|
248
|
-
const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20, r = typeof (e == null ? void 0 : e.agentKind) == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, o = typeof (e == null ? void 0 : e.agentUniqueId) == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, i = typeof (e == null ? void 0 : e.flowType) == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, s = typeof (e == null ? void 0 : e.category) == "string" && e.category.trim() ? e.category.trim() : void 0, a =
|
|
255
|
+
function Mr(e) {
|
|
256
|
+
const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20, r = typeof (e == null ? void 0 : e.agentKind) == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, o = typeof (e == null ? void 0 : e.agentUniqueId) == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, i = typeof (e == null ? void 0 : e.flowType) == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, s = typeof (e == null ? void 0 : e.category) == "string" && e.category.trim() ? e.category.trim() : void 0, a = xr(e == null ? void 0 : e.flowUniqueIds);
|
|
249
257
|
return { agentKind: r, agentUniqueId: o, flowType: i, category: s, flowUniqueIds: a, pageSize: n };
|
|
250
258
|
}
|
|
251
|
-
function
|
|
252
|
-
const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20;
|
|
259
|
+
function Nr(e) {
|
|
260
|
+
const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20, r = typeof (e == null ? void 0 : e.agentKind) == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0;
|
|
253
261
|
return {
|
|
254
262
|
names: Array.isArray(e == null ? void 0 : e.names) ? e.names.map(String).filter(Boolean) : [],
|
|
263
|
+
agentKind: r,
|
|
255
264
|
agentUniqueIds: Array.isArray(e == null ? void 0 : e.agentUniqueIds) ? e.agentUniqueIds.map(String).filter(Boolean) : [],
|
|
256
265
|
resumeUniqueIds: Array.isArray(e == null ? void 0 : e.resumeUniqueIds) ? e.resumeUniqueIds.map(String).filter(Boolean) : [],
|
|
257
266
|
pageSize: n
|
|
258
267
|
};
|
|
259
268
|
}
|
|
260
|
-
function
|
|
269
|
+
function Ir(e) {
|
|
261
270
|
if (e.type !== "case_singleselect") return e;
|
|
262
271
|
const t = typeof e.defaultValue == "string" && e.defaultValue.trim() ? [e.defaultValue.trim()] : Array.isArray(e.defaultValue) ? e.defaultValue.map(String).filter(Boolean) : [];
|
|
263
272
|
return { ...e, type: "case_multiselect", defaultValue: t };
|
|
264
273
|
}
|
|
265
|
-
function
|
|
266
|
-
var o, i;
|
|
267
|
-
const t =
|
|
274
|
+
function Fr(e) {
|
|
275
|
+
var o, i, s, a;
|
|
276
|
+
const t = Ir(e), n = Ae(t.fileAcceptTypes), r = t.type;
|
|
268
277
|
return {
|
|
269
|
-
id: ((o = t.id) == null ? void 0 : o.trim()) ||
|
|
278
|
+
id: ((o = t.id) == null ? void 0 : o.trim()) || le("block-"),
|
|
270
279
|
type: r,
|
|
271
280
|
name: ((i = t.name) == null ? void 0 : i.trim()) || void 0,
|
|
272
281
|
label: t.label ?? "",
|
|
273
282
|
placeholder: t.placeholder ?? "",
|
|
274
283
|
help: t.help ?? "",
|
|
275
284
|
required: t.required === !0,
|
|
276
|
-
mediaUrls:
|
|
277
|
-
mediaSize:
|
|
285
|
+
mediaUrls: de(r) ? kr(t, Tr) : void 0,
|
|
286
|
+
mediaSize: de(r) ? _e(t.mediaSize) : void 0,
|
|
278
287
|
fileAcceptTypes: n,
|
|
279
|
-
fileAcceptExtensions:
|
|
288
|
+
fileAcceptExtensions: ht(
|
|
280
289
|
n,
|
|
281
290
|
t.fileAcceptExtensions
|
|
282
291
|
),
|
|
283
|
-
filePlaceholderIcon:
|
|
284
|
-
fileMinCount: r === "file" ?
|
|
285
|
-
fileMaxCount: r === "file" ?
|
|
286
|
-
defaultValue:
|
|
287
|
-
|
|
288
|
-
|
|
292
|
+
filePlaceholderIcon: Sr(t.filePlaceholderIcon),
|
|
293
|
+
fileMinCount: r === "file" ? Re(t.fileMinCount, 1) : void 0,
|
|
294
|
+
fileMaxCount: r === "file" ? Re(t.fileMaxCount, 1) : void 0,
|
|
295
|
+
defaultValue: sn(r, t.defaultValue),
|
|
296
|
+
jsonSchemaDescription: ((s = t.jsonSchemaDescription) == null ? void 0 : s.trim()) ?? "",
|
|
297
|
+
hidden: r === "text" ? t.hidden === !0 : void 0,
|
|
298
|
+
needLLM: t.needLLM === !0 ? !0 : void 0,
|
|
299
|
+
options: Array.isArray(t.options) ? t.options.map((l, c) => {
|
|
300
|
+
var m, d;
|
|
289
301
|
return {
|
|
290
|
-
value: ((
|
|
291
|
-
label: ((
|
|
302
|
+
value: ((m = l.value) == null ? void 0 : m.trim()) || `option_${c + 1}`,
|
|
303
|
+
label: ((d = l.label) == null ? void 0 : d.trim()) || `选项 ${c + 1}`
|
|
292
304
|
};
|
|
293
305
|
}) : void 0,
|
|
306
|
+
condition: (a = t.condition) != null && a.fieldName ? {
|
|
307
|
+
fieldName: t.condition.fieldName.trim(),
|
|
308
|
+
operator: t.condition.operator ?? "eq",
|
|
309
|
+
value: t.condition.value
|
|
310
|
+
} : void 0,
|
|
294
311
|
resumeEnableRefresh: r === "resume_multiselect" ? t.resumeEnableRefresh !== !1 : void 0,
|
|
295
|
-
resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ?
|
|
296
|
-
resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ?
|
|
297
|
-
resumeFilter: r === "resume_multiselect" ?
|
|
312
|
+
resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? ue(t.resumeMinCount, 1) : void 0,
|
|
313
|
+
resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? ue(t.resumeMaxCount, 1) : void 0,
|
|
314
|
+
resumeFilter: r === "resume_multiselect" ? Nr(t.resumeFilter) : void 0,
|
|
298
315
|
caseEnableRefresh: r === "case_multiselect" ? t.caseEnableRefresh !== !1 : void 0,
|
|
299
|
-
caseMinCount: r === "case_multiselect" && t.caseMinCount != null ?
|
|
300
|
-
caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ?
|
|
301
|
-
caseFilter: r === "case_multiselect" ?
|
|
316
|
+
caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? ue(t.caseMinCount, 1) : void 0,
|
|
317
|
+
caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? ue(t.caseMaxCount, 1) : void 0,
|
|
318
|
+
caseFilter: r === "case_multiselect" ? Mr(t.caseFilter) : void 0
|
|
302
319
|
};
|
|
303
320
|
}
|
|
304
|
-
function
|
|
321
|
+
function Er(e) {
|
|
322
|
+
return new Set((e.options ?? []).map((t) => t.value));
|
|
323
|
+
}
|
|
324
|
+
function $t(e, t) {
|
|
325
|
+
const n = {
|
|
326
|
+
type: "array",
|
|
327
|
+
items: { type: "string" }
|
|
328
|
+
};
|
|
329
|
+
return e !== void 0 && (n.minItems = ue(e, 1)), t !== void 0 && (n.maxItems = ue(t, 1)), n;
|
|
330
|
+
}
|
|
331
|
+
function Ur(e) {
|
|
332
|
+
const t = sn(e.type, e.defaultValue);
|
|
333
|
+
if (t === void 0) return;
|
|
334
|
+
const n = Er(e);
|
|
335
|
+
switch (e.type) {
|
|
336
|
+
case "toggle":
|
|
337
|
+
return t;
|
|
338
|
+
case "number": {
|
|
339
|
+
const r = Number(t);
|
|
340
|
+
return Number.isNaN(r) ? void 0 : r;
|
|
341
|
+
}
|
|
342
|
+
case "multiselect":
|
|
343
|
+
case "checkbox": {
|
|
344
|
+
const r = t.filter((o) => n.has(o));
|
|
345
|
+
return r.length > 0 ? r : void 0;
|
|
346
|
+
}
|
|
347
|
+
case "select":
|
|
348
|
+
case "radio": {
|
|
349
|
+
const r = t;
|
|
350
|
+
return n.has(r) ? r : void 0;
|
|
351
|
+
}
|
|
352
|
+
case "resume_multiselect":
|
|
353
|
+
case "case_multiselect": {
|
|
354
|
+
const r = Array.isArray(t) ? t.map(String).filter(Boolean) : [];
|
|
355
|
+
return r.length > 0 ? r : void 0;
|
|
356
|
+
}
|
|
357
|
+
default:
|
|
358
|
+
return t;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
function Rr(e) {
|
|
362
|
+
var i, s;
|
|
363
|
+
if (!((i = e.name) == null ? void 0 : i.trim()) || !Z(e.type)) return null;
|
|
364
|
+
let n;
|
|
365
|
+
switch (e.type) {
|
|
366
|
+
case "number":
|
|
367
|
+
n = { type: "number" };
|
|
368
|
+
break;
|
|
369
|
+
case "toggle":
|
|
370
|
+
n = { type: "boolean" };
|
|
371
|
+
break;
|
|
372
|
+
case "select":
|
|
373
|
+
case "radio": {
|
|
374
|
+
n = { type: "string" };
|
|
375
|
+
const a = (e.options ?? []).map((l) => l.value).filter(Boolean);
|
|
376
|
+
a.length > 0 && (n.enum = a);
|
|
377
|
+
break;
|
|
378
|
+
}
|
|
379
|
+
case "multiselect":
|
|
380
|
+
case "checkbox": {
|
|
381
|
+
const a = (e.options ?? []).map((l) => l.value).filter(Boolean);
|
|
382
|
+
n = {
|
|
383
|
+
type: "array",
|
|
384
|
+
items: a.length > 0 ? { type: "string", enum: a } : { type: "string" }
|
|
385
|
+
};
|
|
386
|
+
break;
|
|
387
|
+
}
|
|
388
|
+
case "file": {
|
|
389
|
+
const a = Re(e.fileMinCount, 1), l = Re(e.fileMaxCount, 1);
|
|
390
|
+
l <= 1 ? n = { type: "string" } : n = {
|
|
391
|
+
type: "array",
|
|
392
|
+
items: { type: "string" },
|
|
393
|
+
minItems: a,
|
|
394
|
+
maxItems: l
|
|
395
|
+
};
|
|
396
|
+
break;
|
|
397
|
+
}
|
|
398
|
+
case "resume_multiselect":
|
|
399
|
+
n = $t(e.resumeMinCount, e.resumeMaxCount);
|
|
400
|
+
break;
|
|
401
|
+
case "case_multiselect":
|
|
402
|
+
n = $t(e.caseMinCount, e.caseMaxCount);
|
|
403
|
+
break;
|
|
404
|
+
case "text":
|
|
405
|
+
n = { type: "string" }, e.hidden && (n["x-hidden"] = !0);
|
|
406
|
+
break;
|
|
407
|
+
default:
|
|
408
|
+
n = { type: "string" };
|
|
409
|
+
break;
|
|
410
|
+
}
|
|
411
|
+
const r = (s = e.jsonSchemaDescription) == null ? void 0 : s.trim();
|
|
412
|
+
r && (n.$comment = r);
|
|
413
|
+
const o = Ur(e);
|
|
414
|
+
return o !== void 0 && (n.default = o), n;
|
|
415
|
+
}
|
|
416
|
+
function Pr(e, t, n) {
|
|
417
|
+
var l;
|
|
418
|
+
const r = {}, o = [];
|
|
419
|
+
for (const c of e) {
|
|
420
|
+
const m = (l = c.name) == null ? void 0 : l.trim();
|
|
421
|
+
if (!m || !Z(c.type)) continue;
|
|
422
|
+
const d = Rr(c);
|
|
423
|
+
d && (r[m] = d, c.required && o.push(m));
|
|
424
|
+
}
|
|
425
|
+
const i = {
|
|
426
|
+
type: "object",
|
|
427
|
+
properties: r,
|
|
428
|
+
required: o,
|
|
429
|
+
additionalProperties: !1
|
|
430
|
+
}, s = t == null ? void 0 : t.trim(), a = n == null ? void 0 : n.trim();
|
|
431
|
+
return s && (i.title = s), a && (i.description = a), i;
|
|
432
|
+
}
|
|
433
|
+
function ye(e) {
|
|
434
|
+
const t = e.title ?? "", n = e.description ?? "";
|
|
305
435
|
return {
|
|
306
|
-
title:
|
|
307
|
-
description:
|
|
436
|
+
title: t,
|
|
437
|
+
description: n,
|
|
308
438
|
blocks: e.blocks,
|
|
309
|
-
jsonSchema: e.
|
|
439
|
+
jsonSchema: Pr(e.blocks, t, n)
|
|
310
440
|
};
|
|
311
441
|
}
|
|
312
|
-
function
|
|
442
|
+
function qe(e) {
|
|
313
443
|
if (!e || !Array.isArray(e.blocks))
|
|
314
|
-
return
|
|
315
|
-
const t = e.blocks.map(
|
|
316
|
-
return
|
|
444
|
+
return ye({ title: "", description: "", blocks: [] });
|
|
445
|
+
const t = e.blocks.map(Fr);
|
|
446
|
+
return ye({
|
|
317
447
|
title: typeof e.title == "string" ? e.title : "",
|
|
318
448
|
description: typeof e.description == "string" ? e.description : "",
|
|
319
|
-
blocks: t
|
|
320
|
-
jsonSchema: ft(e.jsonSchema)
|
|
449
|
+
blocks: t
|
|
321
450
|
});
|
|
322
451
|
}
|
|
323
|
-
function
|
|
452
|
+
function hs() {
|
|
453
|
+
return ye({ title: "", description: "", blocks: [] });
|
|
454
|
+
}
|
|
455
|
+
function gs(e) {
|
|
456
|
+
const t = {
|
|
457
|
+
id: le("block-"),
|
|
458
|
+
type: e,
|
|
459
|
+
label: e
|
|
460
|
+
};
|
|
461
|
+
return Z(e) && (t.label = "", t.name = le("field_"), t.placeholder = "", t.required = !1), de(e) && (t.label = "", t.placeholder = "", t.help = "", t.mediaUrls = [""], t.mediaSize = "medium"), rr(e) && (t.options = [
|
|
462
|
+
{ value: "option_1", label: "选项 1" },
|
|
463
|
+
{ value: "option_2", label: "选项 2" }
|
|
464
|
+
]), e === "file" && (t.fileAcceptTypes = [], t.fileAcceptExtensions = [], t.filePlaceholderIcon = "file", t.fileMinCount = 1, t.fileMaxCount = 1), e === "resume_multiselect" && (t.resumeEnableRefresh = !0, t.resumeMinCount = 1, t.resumeMaxCount = 1, t.resumeFilter = {
|
|
465
|
+
names: [],
|
|
466
|
+
agentUniqueIds: [],
|
|
467
|
+
resumeUniqueIds: [],
|
|
468
|
+
pageSize: 20
|
|
469
|
+
}, t.defaultValue = []), e === "case_multiselect" && (t.caseEnableRefresh = !0, t.caseMinCount = 1, t.caseMaxCount = 1, t.caseFilter = { flowUniqueIds: [], pageSize: 20 }, t.defaultValue = []), t;
|
|
470
|
+
}
|
|
471
|
+
function wr(e) {
|
|
324
472
|
const t = typeof e.pageSize == "number" ? e.pageSize : Number(e.pageSize), n = typeof e.agentKind == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, r = typeof e.agentUniqueId == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, o = typeof e.flowType == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, i = typeof e.category == "string" && e.category.trim() ? e.category.trim() : void 0, s = Array.isArray(e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
|
|
325
473
|
return {
|
|
326
474
|
agentKind: n,
|
|
@@ -331,14 +479,14 @@ function xr(e) {
|
|
|
331
479
|
pageSize: Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20
|
|
332
480
|
};
|
|
333
481
|
}
|
|
334
|
-
function
|
|
482
|
+
function Dt(e) {
|
|
335
483
|
if (e == null) return;
|
|
336
484
|
const t = typeof e == "number" ? e : Number(e);
|
|
337
485
|
if (!(!Number.isFinite(t) || t < 1))
|
|
338
486
|
return Math.floor(t);
|
|
339
487
|
}
|
|
340
|
-
function
|
|
341
|
-
var s, a, l,
|
|
488
|
+
function zr(e, t) {
|
|
489
|
+
var s, a, l, c, m, d;
|
|
342
490
|
const { id: n, label: r, path: o, withData: i } = t;
|
|
343
491
|
return i({
|
|
344
492
|
id: n,
|
|
@@ -351,7 +499,7 @@ function Nr(e, t) {
|
|
|
351
499
|
agentKind: (s = e.caseFilter) == null ? void 0 : s.agentKind,
|
|
352
500
|
agentUniqueId: (a = e.caseFilter) == null ? void 0 : a.agentUniqueId,
|
|
353
501
|
flowType: (l = e.caseFilter) == null ? void 0 : l.flowType,
|
|
354
|
-
category: (
|
|
502
|
+
category: (c = e.caseFilter) == null ? void 0 : c.category,
|
|
355
503
|
flowUniqueIds: ((m = e.caseFilter) == null ? void 0 : m.flowUniqueIds) ?? [],
|
|
356
504
|
pageSize: ((d = e.caseFilter) == null ? void 0 : d.pageSize) ?? 20
|
|
357
505
|
},
|
|
@@ -360,7 +508,7 @@ function Nr(e, t) {
|
|
|
360
508
|
value: { path: o }
|
|
361
509
|
});
|
|
362
510
|
}
|
|
363
|
-
function
|
|
511
|
+
function Or(e, t, n) {
|
|
364
512
|
const r = n.nameFromValue(e.value), o = {
|
|
365
513
|
...t("case_multiselect"),
|
|
366
514
|
name: r,
|
|
@@ -368,23 +516,23 @@ function Ir(e, t, n) {
|
|
|
368
516
|
}, i = n.asLiteral(e.placeholder);
|
|
369
517
|
i && (o.placeholder = i);
|
|
370
518
|
const s = n.asLiteral(e.help);
|
|
371
|
-
s && (o.help = s), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter =
|
|
372
|
-
const a =
|
|
519
|
+
s && (o.help = s), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = wr(e.caseFilter));
|
|
520
|
+
const a = Dt(e.minCount);
|
|
373
521
|
a !== void 0 && (o.caseMinCount = a);
|
|
374
|
-
const l =
|
|
522
|
+
const l = Dt(e.maxCount);
|
|
375
523
|
return l !== void 0 && (o.caseMaxCount = l), o;
|
|
376
524
|
}
|
|
377
|
-
const
|
|
525
|
+
const an = Se(
|
|
378
526
|
null
|
|
379
527
|
);
|
|
380
|
-
function
|
|
528
|
+
function qr(e) {
|
|
381
529
|
try {
|
|
382
530
|
return JSON.stringify(e);
|
|
383
531
|
} catch {
|
|
384
532
|
return String(e.length);
|
|
385
533
|
}
|
|
386
534
|
}
|
|
387
|
-
const
|
|
535
|
+
const Br = {
|
|
388
536
|
publishLiveOptions: () => {
|
|
389
537
|
},
|
|
390
538
|
liveOptions: /* @__PURE__ */ new Map(),
|
|
@@ -393,23 +541,23 @@ const Fr = {
|
|
|
393
541
|
clearPendingChangeFields: () => {
|
|
394
542
|
}
|
|
395
543
|
};
|
|
396
|
-
function
|
|
397
|
-
const t = A(/* @__PURE__ */ new Map()), n = A(/* @__PURE__ */ new Map()), r = A([]), [o, i] =
|
|
544
|
+
function Vr({ children: e }) {
|
|
545
|
+
const t = A(/* @__PURE__ */ new Map()), n = A(/* @__PURE__ */ new Map()), r = A([]), [o, i] = P(0), [s, a] = P(() => /* @__PURE__ */ new Map()), [l, c] = P(
|
|
398
546
|
[]
|
|
399
|
-
), m =
|
|
400
|
-
(g,
|
|
547
|
+
), m = j(
|
|
548
|
+
(g, S) => {
|
|
401
549
|
const y = g.trim();
|
|
402
550
|
if (!y) return;
|
|
403
|
-
const k =
|
|
404
|
-
value: String(
|
|
405
|
-
label: String(
|
|
406
|
-
})),
|
|
407
|
-
n.current.get(y) !==
|
|
551
|
+
const k = S.map((f) => ({
|
|
552
|
+
value: String(f.value ?? ""),
|
|
553
|
+
label: String(f.label ?? f.value ?? "")
|
|
554
|
+
})), p = qr(k);
|
|
555
|
+
n.current.get(y) !== p && (n.current.set(y, p), t.current.set(y, k), r.current.includes(y) || (r.current = [...r.current, y]), a(new Map(t.current)), c(r.current), i((f) => f + 1));
|
|
408
556
|
},
|
|
409
557
|
[]
|
|
410
|
-
), d =
|
|
411
|
-
r.current = [],
|
|
412
|
-
}, []),
|
|
558
|
+
), d = j(() => {
|
|
559
|
+
r.current = [], c([]);
|
|
560
|
+
}, []), b = L(
|
|
413
561
|
() => ({
|
|
414
562
|
publishLiveOptions: m,
|
|
415
563
|
liveOptions: s,
|
|
@@ -425,26 +573,26 @@ function Er({ children: e }) {
|
|
|
425
573
|
d
|
|
426
574
|
]
|
|
427
575
|
);
|
|
428
|
-
return /* @__PURE__ */
|
|
576
|
+
return /* @__PURE__ */ u(an.Provider, { value: b, children: e });
|
|
429
577
|
}
|
|
430
|
-
function
|
|
431
|
-
return
|
|
578
|
+
function gt() {
|
|
579
|
+
return ke(an) ?? Br;
|
|
432
580
|
}
|
|
433
|
-
const
|
|
434
|
-
function
|
|
581
|
+
const ln = Se({ interactive: !0 });
|
|
582
|
+
function at({
|
|
435
583
|
interactive: e,
|
|
436
584
|
children: t
|
|
437
585
|
}) {
|
|
438
|
-
return /* @__PURE__ */
|
|
586
|
+
return /* @__PURE__ */ u(ln.Provider, { value: { interactive: e }, children: t });
|
|
439
587
|
}
|
|
440
|
-
function
|
|
441
|
-
return
|
|
588
|
+
function se() {
|
|
589
|
+
return ke(ln);
|
|
442
590
|
}
|
|
443
|
-
const
|
|
444
|
-
function
|
|
591
|
+
const cn = Se(null);
|
|
592
|
+
function Lr(e) {
|
|
445
593
|
return e != null && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
|
|
446
594
|
}
|
|
447
|
-
const
|
|
595
|
+
const jr = {
|
|
448
596
|
reportEvent: () => {
|
|
449
597
|
},
|
|
450
598
|
reportData: () => {
|
|
@@ -452,7 +600,7 @@ const Ur = {
|
|
|
452
600
|
runAutoControl: (e) => e(),
|
|
453
601
|
isAutoControl: () => !1
|
|
454
602
|
};
|
|
455
|
-
function
|
|
603
|
+
function $r(e) {
|
|
456
604
|
const t = {};
|
|
457
605
|
for (const [n, r] of Object.entries(e.form_values ?? {}))
|
|
458
606
|
r !== void 0 && (t[n] = r);
|
|
@@ -462,40 +610,40 @@ function wr(e) {
|
|
|
462
610
|
form_change: Array.isArray(e.form_change) ? [...e.form_change] : []
|
|
463
611
|
};
|
|
464
612
|
}
|
|
465
|
-
function
|
|
613
|
+
function Dr({
|
|
466
614
|
client: e,
|
|
467
615
|
children: t
|
|
468
616
|
}) {
|
|
469
617
|
const n = A(0), r = A(e);
|
|
470
618
|
r.current = e;
|
|
471
|
-
const o =
|
|
619
|
+
const o = j((c) => {
|
|
472
620
|
const m = r.current;
|
|
473
621
|
if (!m) return;
|
|
474
622
|
const d = {
|
|
475
|
-
action:
|
|
476
|
-
component:
|
|
623
|
+
action: c.action,
|
|
624
|
+
component: c.component
|
|
477
625
|
};
|
|
478
|
-
|
|
479
|
-
const
|
|
480
|
-
m.send(
|
|
481
|
-
}, []), i =
|
|
626
|
+
c.field !== void 0 && (d.field = c.field), c.value !== void 0 && (d.value = c.value);
|
|
627
|
+
const b = n.current > 0 ? "form_auto_control_bac_event" : "form_runtime_event";
|
|
628
|
+
m.send(b, d);
|
|
629
|
+
}, []), i = j((c) => {
|
|
482
630
|
const m = r.current;
|
|
483
|
-
m && m.send("form_runtime_data",
|
|
484
|
-
}, []), s =
|
|
631
|
+
m && m.send("form_runtime_data", $r(c));
|
|
632
|
+
}, []), s = j((c) => {
|
|
485
633
|
n.current += 1;
|
|
486
634
|
let m;
|
|
487
635
|
try {
|
|
488
|
-
m =
|
|
636
|
+
m = c();
|
|
489
637
|
} catch (d) {
|
|
490
638
|
throw n.current = Math.max(0, n.current - 1), d;
|
|
491
639
|
}
|
|
492
|
-
return
|
|
640
|
+
return Lr(m) ? Promise.resolve(m).finally(() => {
|
|
493
641
|
n.current = Math.max(0, n.current - 1);
|
|
494
642
|
}) : (n.current = Math.max(0, n.current - 1), m);
|
|
495
|
-
}, []), a =
|
|
643
|
+
}, []), a = j(
|
|
496
644
|
() => n.current > 0,
|
|
497
645
|
[]
|
|
498
|
-
), l =
|
|
646
|
+
), l = L(
|
|
499
647
|
() => ({
|
|
500
648
|
reportEvent: o,
|
|
501
649
|
reportData: i,
|
|
@@ -504,89 +652,89 @@ function Pr({
|
|
|
504
652
|
}),
|
|
505
653
|
[o, i, s, a]
|
|
506
654
|
);
|
|
507
|
-
return /* @__PURE__ */
|
|
655
|
+
return /* @__PURE__ */ u(cn.Provider, { value: l, children: t });
|
|
508
656
|
}
|
|
509
|
-
function
|
|
510
|
-
return
|
|
657
|
+
function un() {
|
|
658
|
+
return ke(cn) ?? jr;
|
|
511
659
|
}
|
|
512
|
-
const
|
|
513
|
-
function
|
|
660
|
+
const Hr = 300;
|
|
661
|
+
function mn(e) {
|
|
514
662
|
return e && typeof e == "object" && "path" in e && String(e.path ?? "").trim() || null;
|
|
515
663
|
}
|
|
516
|
-
function
|
|
664
|
+
function Kr(e) {
|
|
517
665
|
if (!e) return;
|
|
518
666
|
const t = e.trim();
|
|
519
667
|
if (t)
|
|
520
668
|
return t.startsWith("/") ? t.slice(1) : t;
|
|
521
669
|
}
|
|
522
|
-
function
|
|
670
|
+
function Ht(e, t = "value") {
|
|
523
671
|
const r = e.componentModel.properties[t];
|
|
524
|
-
if (!(!
|
|
672
|
+
if (!(!mn(r) || r === void 0))
|
|
525
673
|
return e.dataContext.resolveDynamicValue(r);
|
|
526
674
|
}
|
|
527
|
-
function
|
|
528
|
-
const o = e.componentModel.properties[t], i =
|
|
675
|
+
function ae(e, t = "value", n = {}) {
|
|
676
|
+
const o = e.componentModel.properties[t], i = mn(o), s = Kr(i), a = un(), {
|
|
529
677
|
component: l = "Unknown",
|
|
530
|
-
changeAction:
|
|
678
|
+
changeAction: c = "change",
|
|
531
679
|
debounceChange: m = !1
|
|
532
|
-
} = n, d = A(null),
|
|
533
|
-
|
|
534
|
-
const y = A(
|
|
535
|
-
y.current =
|
|
680
|
+
} = n, d = A(null), b = A(void 0), g = A(!1), S = A(a);
|
|
681
|
+
S.current = a;
|
|
682
|
+
const y = A(c);
|
|
683
|
+
y.current = c;
|
|
536
684
|
const k = A(l);
|
|
537
685
|
k.current = l;
|
|
538
|
-
const
|
|
539
|
-
|
|
540
|
-
d.current != null && (clearTimeout(d.current), d.current = null), g.current &&
|
|
686
|
+
const p = A(s);
|
|
687
|
+
p.current = s, q(() => () => {
|
|
688
|
+
d.current != null && (clearTimeout(d.current), d.current = null), g.current && p.current && (g.current = !1, S.current.reportEvent({
|
|
541
689
|
action: y.current,
|
|
542
690
|
component: k.current,
|
|
543
|
-
field:
|
|
544
|
-
value:
|
|
691
|
+
field: p.current,
|
|
692
|
+
value: b.current
|
|
545
693
|
}));
|
|
546
694
|
}, []);
|
|
547
|
-
const
|
|
548
|
-
(
|
|
695
|
+
const f = j(
|
|
696
|
+
(B) => {
|
|
549
697
|
if (!i || o === void 0) return () => {
|
|
550
698
|
};
|
|
551
|
-
const
|
|
552
|
-
return () =>
|
|
699
|
+
const V = e.dataContext.subscribeDynamicValue(o, () => B());
|
|
700
|
+
return () => V.unsubscribe();
|
|
553
701
|
},
|
|
554
702
|
[e, o, i]
|
|
555
|
-
), v =
|
|
703
|
+
), v = j(() => {
|
|
556
704
|
if (!(!i || o === void 0))
|
|
557
705
|
return e.dataContext.resolveDynamicValue(o);
|
|
558
|
-
}, [e, o, i]), x =
|
|
559
|
-
(
|
|
706
|
+
}, [e, o, i]), x = qn(f, v, v), N = j(
|
|
707
|
+
(B) => {
|
|
560
708
|
if (!s) return;
|
|
561
|
-
const
|
|
562
|
-
g.current = !1,
|
|
563
|
-
action:
|
|
709
|
+
const V = () => {
|
|
710
|
+
g.current = !1, S.current.reportEvent({
|
|
711
|
+
action: c,
|
|
564
712
|
component: l,
|
|
565
713
|
field: s,
|
|
566
|
-
value:
|
|
714
|
+
value: B
|
|
567
715
|
});
|
|
568
716
|
};
|
|
569
717
|
if (!m) {
|
|
570
|
-
|
|
718
|
+
V();
|
|
571
719
|
return;
|
|
572
720
|
}
|
|
573
|
-
|
|
574
|
-
d.current = null,
|
|
575
|
-
},
|
|
721
|
+
b.current = B, g.current = !0, d.current != null && clearTimeout(d.current), d.current = setTimeout(() => {
|
|
722
|
+
d.current = null, V();
|
|
723
|
+
}, Hr);
|
|
576
724
|
},
|
|
577
|
-
[s,
|
|
578
|
-
), _ =
|
|
579
|
-
(
|
|
580
|
-
!i || !o || typeof o != "object" || !("path" in o) || e.dataContext.set(String(o.path),
|
|
725
|
+
[s, c, l, m]
|
|
726
|
+
), _ = j(
|
|
727
|
+
(B) => {
|
|
728
|
+
!i || !o || typeof o != "object" || !("path" in o) || e.dataContext.set(String(o.path), B);
|
|
581
729
|
},
|
|
582
730
|
[e, o, i]
|
|
583
|
-
), w =
|
|
584
|
-
(
|
|
585
|
-
_(
|
|
731
|
+
), w = j(
|
|
732
|
+
(B) => {
|
|
733
|
+
_(B), N(B);
|
|
586
734
|
},
|
|
587
|
-
[_,
|
|
588
|
-
), C =
|
|
589
|
-
s &&
|
|
735
|
+
[_, N]
|
|
736
|
+
), C = j(() => {
|
|
737
|
+
s && S.current.reportEvent({
|
|
590
738
|
action: "focus",
|
|
591
739
|
component: l,
|
|
592
740
|
field: s
|
|
@@ -602,59 +750,59 @@ function se(e, t = "value", n = {}) {
|
|
|
602
750
|
reportFocus: C
|
|
603
751
|
};
|
|
604
752
|
}
|
|
605
|
-
function
|
|
753
|
+
function ve(e) {
|
|
606
754
|
if (typeof e == "string") return e || void 0;
|
|
607
755
|
if (typeof e == "number") return String(e);
|
|
608
756
|
}
|
|
609
|
-
function
|
|
757
|
+
function Q(e) {
|
|
610
758
|
return Array.isArray(e) ? e.map(String) : typeof e == "string" && e ? [e] : [];
|
|
611
759
|
}
|
|
612
|
-
function
|
|
613
|
-
return t ? Array.isArray(e) ? null :
|
|
760
|
+
function dn(e, t) {
|
|
761
|
+
return t ? Array.isArray(e) ? null : Q(e) : Array.isArray(e) ? e.length > 0 ? String(e[0]) : "" : e == null || typeof e == "string" || typeof e == "number" ? null : "";
|
|
614
762
|
}
|
|
615
|
-
function
|
|
763
|
+
function Pe(e) {
|
|
616
764
|
if (e == null) return;
|
|
617
765
|
const t = typeof e == "number" ? e : Number(e);
|
|
618
766
|
if (!(!Number.isFinite(t) || t < 1))
|
|
619
767
|
return Math.floor(t);
|
|
620
768
|
}
|
|
621
|
-
function
|
|
769
|
+
function fn(e, t, n, r) {
|
|
622
770
|
return e.includes(t) ? e.filter((i) => i !== t) : r === 1 ? [t] : r !== void 0 && e.length >= r ? null : [...e, t];
|
|
623
771
|
}
|
|
624
|
-
function
|
|
772
|
+
function pn(e, t, n, r, o) {
|
|
625
773
|
return n ? e.includes(t) || o === 1 ? !1 : o !== void 0 && e.length >= o : !0;
|
|
626
774
|
}
|
|
627
|
-
function
|
|
775
|
+
function hn(e, t) {
|
|
628
776
|
return t === void 0 || e.length <= t ? null : e.slice(0, t);
|
|
629
777
|
}
|
|
630
|
-
const
|
|
631
|
-
function
|
|
778
|
+
const gn = Se(null);
|
|
779
|
+
function lt({
|
|
632
780
|
caseSearch: e,
|
|
633
781
|
children: t
|
|
634
782
|
}) {
|
|
635
|
-
return /* @__PURE__ */
|
|
783
|
+
return /* @__PURE__ */ u(gn.Provider, { value: e ?? null, children: t });
|
|
636
784
|
}
|
|
637
|
-
function
|
|
638
|
-
return
|
|
785
|
+
function Jr() {
|
|
786
|
+
return ke(gn);
|
|
639
787
|
}
|
|
640
|
-
function
|
|
788
|
+
function Xe(e) {
|
|
641
789
|
return typeof e == "string" ? e : "";
|
|
642
790
|
}
|
|
643
|
-
function
|
|
791
|
+
function Ze(e) {
|
|
644
792
|
if (!e || typeof e != "object")
|
|
645
793
|
return { flowUniqueIds: [], pageSize: 20 };
|
|
646
794
|
const t = e, n = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), r = Number.isFinite(n) && n >= 1 && n <= 100 ? Math.floor(n) : 20, o = typeof t.agentKind == "string" && t.agentKind.trim() ? t.agentKind.trim() : void 0, i = typeof t.agentUniqueId == "string" && t.agentUniqueId.trim() ? t.agentUniqueId.trim() : void 0, s = typeof t.flowType == "string" && t.flowType.trim() ? t.flowType.trim() : void 0, a = typeof t.category == "string" && t.category.trim() ? t.category.trim() : void 0, l = Array.isArray(t.flowUniqueIds) ? t.flowUniqueIds.map(String).filter(Boolean) : [];
|
|
647
795
|
return { agentKind: o, agentUniqueId: i, flowType: s, category: a, flowUniqueIds: l, pageSize: r };
|
|
648
796
|
}
|
|
649
|
-
function
|
|
797
|
+
function et(e) {
|
|
650
798
|
var r;
|
|
651
799
|
const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!(e.agentUniqueId && e.flowType && e.category);
|
|
652
800
|
return t || n;
|
|
653
801
|
}
|
|
654
|
-
function
|
|
802
|
+
function Gr(e) {
|
|
655
803
|
return JSON.stringify(e);
|
|
656
804
|
}
|
|
657
|
-
const
|
|
805
|
+
const Wr = {
|
|
658
806
|
name: "SkoponCaseSelect",
|
|
659
807
|
schema: h.object({
|
|
660
808
|
label: h.any().optional(),
|
|
@@ -667,13 +815,13 @@ const Lr = {
|
|
|
667
815
|
value: h.any().optional()
|
|
668
816
|
}).passthrough()
|
|
669
817
|
};
|
|
670
|
-
function
|
|
818
|
+
function Yr({
|
|
671
819
|
item: e,
|
|
672
820
|
selected: t,
|
|
673
821
|
disabled: n,
|
|
674
822
|
onToggle: r
|
|
675
823
|
}) {
|
|
676
|
-
return /* @__PURE__ */
|
|
824
|
+
return /* @__PURE__ */ M(
|
|
677
825
|
"button",
|
|
678
826
|
{
|
|
679
827
|
type: "button",
|
|
@@ -681,11 +829,11 @@ function Vr({
|
|
|
681
829
|
disabled: n,
|
|
682
830
|
onClick: r,
|
|
683
831
|
children: [
|
|
684
|
-
/* @__PURE__ */
|
|
685
|
-
/* @__PURE__ */
|
|
686
|
-
/* @__PURE__ */
|
|
687
|
-
e.description ? /* @__PURE__ */
|
|
688
|
-
/* @__PURE__ */
|
|
832
|
+
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ u(Qt, { style: { fontSize: 24, color: "var(--color-primary, #208368)" } }) }),
|
|
833
|
+
/* @__PURE__ */ M("div", { className: "skopon-resume-select-card-body", children: [
|
|
834
|
+
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-name", children: e.name }),
|
|
835
|
+
e.description ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-card-desc", children: e.description }) : null,
|
|
836
|
+
/* @__PURE__ */ M("div", { className: "skopon-resume-select-card-meta", children: [
|
|
689
837
|
e.caseUniqueId,
|
|
690
838
|
e.platform ? ` · ${e.platform}` : "",
|
|
691
839
|
e.link ? ` · ${e.link}` : ""
|
|
@@ -695,121 +843,121 @@ function Vr({
|
|
|
695
843
|
}
|
|
696
844
|
);
|
|
697
845
|
}
|
|
698
|
-
function
|
|
699
|
-
const { interactive: t } =
|
|
846
|
+
function Qr({ context: e }) {
|
|
847
|
+
const { interactive: t } = se(), n = Jr(), { publishLiveOptions: r } = gt(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = ae(e, "value", {
|
|
700
848
|
component: "SkoponCaseSelect",
|
|
701
849
|
changeAction: "click"
|
|
702
|
-
}), l = e.componentModel.properties,
|
|
703
|
-
|
|
704
|
-
const T =
|
|
850
|
+
}), l = e.componentModel.properties, c = Xe(l.label), m = Xe(l.placeholder), d = Xe(l.help), b = l.enableRefresh !== !1, g = Pe(l.minCount), S = Pe(l.maxCount), y = L(() => Ze(l.caseFilter), [l.caseFilter]), k = Gr(y), [p, f] = P(1), [v, x] = P(!1), [N, _] = P(""), [w, C] = P([]), [B, V] = P(0), [re, K] = P(y.pageSize ?? 20), $ = A(0), W = Q(o);
|
|
851
|
+
q(() => {
|
|
852
|
+
const T = hn(W, S);
|
|
705
853
|
T !== null && s(T);
|
|
706
|
-
}, [
|
|
707
|
-
const
|
|
854
|
+
}, [S, W, s]);
|
|
855
|
+
const ee = L(() => n ? et(y) ? N || m || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, y, N, m]), te = j(
|
|
708
856
|
async (T) => {
|
|
709
|
-
const
|
|
710
|
-
if (!n || !
|
|
711
|
-
C([]),
|
|
857
|
+
const D = Ze(JSON.parse(k)), z = ++$.current;
|
|
858
|
+
if (!n || !et(D)) {
|
|
859
|
+
C([]), V(0), _(""), x(!1);
|
|
712
860
|
return;
|
|
713
861
|
}
|
|
714
862
|
x(!0), _("");
|
|
715
863
|
try {
|
|
716
|
-
const
|
|
717
|
-
if (
|
|
718
|
-
C(
|
|
864
|
+
const I = await n({ filter: D, page: T });
|
|
865
|
+
if (z !== $.current) return;
|
|
866
|
+
C(I.list), V(I.total), f(I.page), K(I.pageSize), a && r(
|
|
719
867
|
a,
|
|
720
|
-
|
|
721
|
-
value:
|
|
722
|
-
label:
|
|
868
|
+
I.list.map((Y) => ({
|
|
869
|
+
value: Y.caseUniqueId,
|
|
870
|
+
label: Y.name || Y.caseUniqueId
|
|
723
871
|
}))
|
|
724
872
|
);
|
|
725
|
-
} catch (
|
|
726
|
-
if (
|
|
727
|
-
C([]),
|
|
873
|
+
} catch (I) {
|
|
874
|
+
if (z !== $.current) return;
|
|
875
|
+
C([]), V(0), _(I instanceof Error ? I.message : "加载案例列表失败");
|
|
728
876
|
} finally {
|
|
729
|
-
|
|
877
|
+
z === $.current && x(!1);
|
|
730
878
|
}
|
|
731
879
|
},
|
|
732
880
|
[n, k, a, r]
|
|
733
881
|
);
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
}, [k,
|
|
737
|
-
const
|
|
882
|
+
q(() => {
|
|
883
|
+
f(1), te(1);
|
|
884
|
+
}, [k, te]);
|
|
885
|
+
const E = (T) => {
|
|
738
886
|
if (!t) return;
|
|
739
|
-
const
|
|
740
|
-
|
|
887
|
+
const D = fn(
|
|
888
|
+
W,
|
|
741
889
|
T,
|
|
742
890
|
g,
|
|
743
|
-
|
|
891
|
+
S
|
|
744
892
|
);
|
|
745
|
-
|
|
746
|
-
},
|
|
747
|
-
const T =
|
|
748
|
-
|
|
893
|
+
D !== null && i(D);
|
|
894
|
+
}, R = () => {
|
|
895
|
+
const T = Ze(JSON.parse(k)), D = re || T.pageSize || 20, z = Math.max(1, Math.ceil(B / D)), I = p >= z ? 1 : p + 1;
|
|
896
|
+
te(I);
|
|
749
897
|
};
|
|
750
|
-
return /* @__PURE__ */
|
|
898
|
+
return /* @__PURE__ */ M(
|
|
751
899
|
"div",
|
|
752
900
|
{
|
|
753
901
|
className: "form-block-preview skopon-resume-select",
|
|
754
902
|
"data-skopon-field": a || void 0,
|
|
755
903
|
children: [
|
|
756
|
-
|
|
757
|
-
v && w.length === 0 ? /* @__PURE__ */
|
|
758
|
-
/* @__PURE__ */
|
|
904
|
+
c ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: c }) : null,
|
|
905
|
+
v && w.length === 0 ? /* @__PURE__ */ M("div", { className: "skopon-resume-select-status", children: [
|
|
906
|
+
/* @__PURE__ */ u(ft, { size: "small" }),
|
|
759
907
|
" 加载案例…"
|
|
760
908
|
] }) : null,
|
|
761
|
-
!v && w.length === 0 ? /* @__PURE__ */
|
|
762
|
-
w.length > 0 ? /* @__PURE__ */
|
|
763
|
-
|
|
909
|
+
!v && w.length === 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-empty", children: ee }) : null,
|
|
910
|
+
w.length > 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-list", children: w.map((T) => /* @__PURE__ */ u(
|
|
911
|
+
Yr,
|
|
764
912
|
{
|
|
765
913
|
item: T,
|
|
766
|
-
selected:
|
|
767
|
-
disabled:
|
|
768
|
-
|
|
914
|
+
selected: W.includes(T.caseUniqueId),
|
|
915
|
+
disabled: pn(
|
|
916
|
+
W,
|
|
769
917
|
T.caseUniqueId,
|
|
770
918
|
t,
|
|
771
919
|
g,
|
|
772
|
-
|
|
920
|
+
S
|
|
773
921
|
),
|
|
774
|
-
onToggle: () =>
|
|
922
|
+
onToggle: () => E(T.caseUniqueId)
|
|
775
923
|
},
|
|
776
924
|
T.caseUniqueId
|
|
777
925
|
)) }) : null,
|
|
778
|
-
|
|
779
|
-
|
|
926
|
+
b && n && et(y) ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ u(
|
|
927
|
+
Oe,
|
|
780
928
|
{
|
|
781
929
|
type: "default",
|
|
782
930
|
size: "small",
|
|
783
|
-
icon: /* @__PURE__ */
|
|
931
|
+
icon: /* @__PURE__ */ u(Yt, {}),
|
|
784
932
|
loading: v,
|
|
785
933
|
disabled: !t,
|
|
786
|
-
onClick:
|
|
934
|
+
onClick: R,
|
|
787
935
|
children: "换一批"
|
|
788
936
|
}
|
|
789
937
|
) }) : null,
|
|
790
|
-
d ? /* @__PURE__ */
|
|
938
|
+
d ? /* @__PURE__ */ u(ne.Text, { type: "secondary", className: "form-block-preview-help", children: d }) : null
|
|
791
939
|
]
|
|
792
940
|
}
|
|
793
941
|
);
|
|
794
942
|
}
|
|
795
|
-
const
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
),
|
|
943
|
+
const Xr = X(
|
|
944
|
+
Wr,
|
|
945
|
+
Qr
|
|
946
|
+
), Zr = {
|
|
799
947
|
type: "case_multiselect",
|
|
800
948
|
componentName: "SkoponCaseSelect",
|
|
801
|
-
toComponent:
|
|
802
|
-
fromComponent:
|
|
803
|
-
catalogComponents: [
|
|
949
|
+
toComponent: zr,
|
|
950
|
+
fromComponent: Or,
|
|
951
|
+
catalogComponents: [Xr]
|
|
804
952
|
};
|
|
805
|
-
function
|
|
953
|
+
function Kt(e) {
|
|
806
954
|
if (e == null) return;
|
|
807
955
|
const t = typeof e == "number" ? e : Number(e);
|
|
808
956
|
if (!(!Number.isFinite(t) || t < 1))
|
|
809
957
|
return Math.floor(t);
|
|
810
958
|
}
|
|
811
|
-
function
|
|
812
|
-
var s, a, l,
|
|
959
|
+
function eo(e, t) {
|
|
960
|
+
var s, a, l, c;
|
|
813
961
|
const { id: n, label: r, path: o, withData: i } = t;
|
|
814
962
|
return i({
|
|
815
963
|
id: n,
|
|
@@ -822,14 +970,14 @@ function Hr(e, t) {
|
|
|
822
970
|
names: ((s = e.resumeFilter) == null ? void 0 : s.names) ?? [],
|
|
823
971
|
agentUniqueIds: ((a = e.resumeFilter) == null ? void 0 : a.agentUniqueIds) ?? [],
|
|
824
972
|
resumeUniqueIds: ((l = e.resumeFilter) == null ? void 0 : l.resumeUniqueIds) ?? [],
|
|
825
|
-
pageSize: ((
|
|
973
|
+
pageSize: ((c = e.resumeFilter) == null ? void 0 : c.pageSize) ?? 20
|
|
826
974
|
},
|
|
827
975
|
...e.resumeMinCount !== void 0 ? { minCount: e.resumeMinCount } : {},
|
|
828
976
|
...e.resumeMaxCount !== void 0 ? { maxCount: e.resumeMaxCount } : {},
|
|
829
977
|
value: { path: o }
|
|
830
978
|
});
|
|
831
979
|
}
|
|
832
|
-
function
|
|
980
|
+
function to(e, t, n) {
|
|
833
981
|
const r = n.nameFromValue(e.value), o = {
|
|
834
982
|
...t("resume_multiselect"),
|
|
835
983
|
name: r,
|
|
@@ -838,42 +986,42 @@ function Kr(e, t, n) {
|
|
|
838
986
|
i && (o.placeholder = i);
|
|
839
987
|
const s = n.asLiteral(e.help);
|
|
840
988
|
if (s && (o.help = s), e.resumeFilter && typeof e.resumeFilter == "object") {
|
|
841
|
-
const
|
|
989
|
+
const c = e.resumeFilter;
|
|
842
990
|
o.resumeFilter = {
|
|
843
|
-
names: Array.isArray(
|
|
844
|
-
agentUniqueIds: Array.isArray(
|
|
845
|
-
resumeUniqueIds: Array.isArray(
|
|
846
|
-
pageSize: typeof
|
|
991
|
+
names: Array.isArray(c.names) ? c.names.map(String) : [],
|
|
992
|
+
agentUniqueIds: Array.isArray(c.agentUniqueIds) ? c.agentUniqueIds.map(String) : [],
|
|
993
|
+
resumeUniqueIds: Array.isArray(c.resumeUniqueIds) ? c.resumeUniqueIds.map(String) : [],
|
|
994
|
+
pageSize: typeof c.pageSize == "number" ? c.pageSize : 20
|
|
847
995
|
};
|
|
848
996
|
}
|
|
849
|
-
const a =
|
|
997
|
+
const a = Kt(e.minCount);
|
|
850
998
|
a !== void 0 && (o.resumeMinCount = a);
|
|
851
|
-
const l =
|
|
999
|
+
const l = Kt(e.maxCount);
|
|
852
1000
|
return l !== void 0 && (o.resumeMaxCount = l), o;
|
|
853
1001
|
}
|
|
854
|
-
const
|
|
855
|
-
function
|
|
1002
|
+
const yn = Se(null);
|
|
1003
|
+
function ct({
|
|
856
1004
|
resumeSearch: e,
|
|
857
1005
|
children: t
|
|
858
1006
|
}) {
|
|
859
|
-
return /* @__PURE__ */
|
|
1007
|
+
return /* @__PURE__ */ u(yn.Provider, { value: e ?? null, children: t });
|
|
860
1008
|
}
|
|
861
|
-
function
|
|
862
|
-
return
|
|
1009
|
+
function no() {
|
|
1010
|
+
return ke(yn);
|
|
863
1011
|
}
|
|
864
|
-
function
|
|
1012
|
+
function tt(e) {
|
|
865
1013
|
return typeof e == "string" ? e : "";
|
|
866
1014
|
}
|
|
867
|
-
function
|
|
1015
|
+
function nt(e) {
|
|
868
1016
|
if (!e || typeof e != "object")
|
|
869
1017
|
return { names: [], agentUniqueIds: [], resumeUniqueIds: [], pageSize: 20 };
|
|
870
1018
|
const t = e, n = Array.isArray(t.names) ? t.names.map(String).filter(Boolean) : [], r = Array.isArray(t.agentUniqueIds) ? t.agentUniqueIds.map(String).filter(Boolean) : [], o = Array.isArray(t.resumeUniqueIds) ? t.resumeUniqueIds.map(String).filter(Boolean) : [], i = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), s = Number.isFinite(i) && i >= 1 && i <= 100 ? Math.floor(i) : 20;
|
|
871
1019
|
return { names: n, agentUniqueIds: r, resumeUniqueIds: o, pageSize: s };
|
|
872
1020
|
}
|
|
873
|
-
function
|
|
1021
|
+
function ro(e) {
|
|
874
1022
|
return JSON.stringify(e);
|
|
875
1023
|
}
|
|
876
|
-
const
|
|
1024
|
+
const oo = {
|
|
877
1025
|
name: "SkoponResumeSelect",
|
|
878
1026
|
schema: h.object({
|
|
879
1027
|
label: h.any().optional(),
|
|
@@ -885,40 +1033,40 @@ const Wr = {
|
|
|
885
1033
|
maxCount: h.any().optional(),
|
|
886
1034
|
value: h.any().optional()
|
|
887
1035
|
}).passthrough()
|
|
888
|
-
},
|
|
889
|
-
function
|
|
890
|
-
const n = (t ?? []).filter(Boolean), r = n.slice(0,
|
|
891
|
-
return /* @__PURE__ */
|
|
892
|
-
/* @__PURE__ */
|
|
893
|
-
n.length > 0 ? /* @__PURE__ */
|
|
894
|
-
r.map((i) => /* @__PURE__ */
|
|
895
|
-
o > 0 ? /* @__PURE__ */
|
|
1036
|
+
}, io = 3, so = 2;
|
|
1037
|
+
function rt(e, t) {
|
|
1038
|
+
const n = (t ?? []).filter(Boolean), r = n.slice(0, io), o = n.length - r.length;
|
|
1039
|
+
return /* @__PURE__ */ M("div", { className: "skopon-resume-select-card-tags", children: [
|
|
1040
|
+
/* @__PURE__ */ u("span", { className: "skopon-resume-select-card-tags-label", children: e }),
|
|
1041
|
+
n.length > 0 ? /* @__PURE__ */ M("div", { className: "skopon-resume-select-card-tags-list", children: [
|
|
1042
|
+
r.map((i) => /* @__PURE__ */ u(ge, { className: "skopon-resume-select-card-tag", children: i }, i)),
|
|
1043
|
+
o > 0 ? /* @__PURE__ */ M(ge, { className: "skopon-resume-select-card-tag", children: [
|
|
896
1044
|
"+",
|
|
897
1045
|
o
|
|
898
1046
|
] }) : null
|
|
899
|
-
] }) : /* @__PURE__ */
|
|
1047
|
+
] }) : /* @__PURE__ */ u("span", { className: "skopon-resume-select-card-tags-empty", children: "暂无" })
|
|
900
1048
|
] });
|
|
901
1049
|
}
|
|
902
|
-
function
|
|
903
|
-
return /* @__PURE__ */
|
|
904
|
-
/* @__PURE__ */
|
|
905
|
-
/* @__PURE__ */
|
|
1050
|
+
function ao(e) {
|
|
1051
|
+
return /* @__PURE__ */ M("div", { className: "skopon-resume-select-card-field", children: [
|
|
1052
|
+
/* @__PURE__ */ u("span", { className: "skopon-resume-select-card-tags-label", children: "满意度" }),
|
|
1053
|
+
/* @__PURE__ */ u("span", { className: "skopon-resume-select-card-field-value", children: typeof e == "number" ? `${e}%` : "暂无" })
|
|
906
1054
|
] });
|
|
907
1055
|
}
|
|
908
|
-
function
|
|
909
|
-
return /* @__PURE__ */
|
|
910
|
-
/* @__PURE__ */
|
|
911
|
-
/* @__PURE__ */
|
|
1056
|
+
function lo({ work: e }) {
|
|
1057
|
+
return /* @__PURE__ */ M("div", { className: "skopon-resume-select-card-work", children: [
|
|
1058
|
+
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ u("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ u(Yn, { className: "skopon-resume-select-card-work-placeholder" }) }),
|
|
1059
|
+
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-work-title", children: e.title || "未命名作品" })
|
|
912
1060
|
] });
|
|
913
1061
|
}
|
|
914
|
-
function
|
|
1062
|
+
function co({
|
|
915
1063
|
item: e,
|
|
916
1064
|
selected: t,
|
|
917
1065
|
disabled: n,
|
|
918
1066
|
onToggle: r
|
|
919
1067
|
}) {
|
|
920
|
-
const o = (e.works ?? []).slice(0,
|
|
921
|
-
return /* @__PURE__ */
|
|
1068
|
+
const o = (e.works ?? []).slice(0, so);
|
|
1069
|
+
return /* @__PURE__ */ M(
|
|
922
1070
|
"button",
|
|
923
1071
|
{
|
|
924
1072
|
type: "button",
|
|
@@ -926,185 +1074,185 @@ function eo({
|
|
|
926
1074
|
disabled: n,
|
|
927
1075
|
onClick: r,
|
|
928
1076
|
children: [
|
|
929
|
-
/* @__PURE__ */
|
|
930
|
-
|
|
1077
|
+
/* @__PURE__ */ u(
|
|
1078
|
+
Ln,
|
|
931
1079
|
{
|
|
932
1080
|
size: 48,
|
|
933
1081
|
src: e.avatarUrl || void 0,
|
|
934
|
-
icon: e.avatarUrl ? void 0 : /* @__PURE__ */
|
|
1082
|
+
icon: e.avatarUrl ? void 0 : /* @__PURE__ */ u(Wn, {}),
|
|
935
1083
|
className: "skopon-resume-select-card-avatar"
|
|
936
1084
|
}
|
|
937
1085
|
),
|
|
938
|
-
/* @__PURE__ */
|
|
939
|
-
/* @__PURE__ */
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
/* @__PURE__ */
|
|
945
|
-
/* @__PURE__ */
|
|
946
|
-
o.length > 0 ? /* @__PURE__ */
|
|
1086
|
+
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-name", children: e.name || "未命名简历" }),
|
|
1087
|
+
/* @__PURE__ */ M("div", { className: "skopon-resume-select-card-body", children: [
|
|
1088
|
+
ao(e.satisfaction),
|
|
1089
|
+
rt("性格", e.personality),
|
|
1090
|
+
rt("专长", e.specialties),
|
|
1091
|
+
rt("擅长领域", e.traits),
|
|
1092
|
+
/* @__PURE__ */ M("div", { className: "skopon-resume-select-card-works", children: [
|
|
1093
|
+
/* @__PURE__ */ u("span", { className: "skopon-resume-select-card-works-label", children: "过往作品" }),
|
|
1094
|
+
o.length > 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, s) => /* @__PURE__ */ u(lo, { work: i }, `${i.title}-${s}`)) }) : /* @__PURE__ */ u("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
|
|
947
1095
|
] })
|
|
948
1096
|
] })
|
|
949
1097
|
]
|
|
950
1098
|
}
|
|
951
1099
|
);
|
|
952
1100
|
}
|
|
953
|
-
function
|
|
954
|
-
const { interactive: t } =
|
|
1101
|
+
function uo({ context: e }) {
|
|
1102
|
+
const { interactive: t } = se(), n = no(), { publishLiveOptions: r } = gt(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = ae(e, "value", {
|
|
955
1103
|
component: "SkoponResumeSelect",
|
|
956
1104
|
changeAction: "click"
|
|
957
|
-
}), l = e.componentModel.properties,
|
|
958
|
-
|
|
959
|
-
const T =
|
|
1105
|
+
}), l = e.componentModel.properties, c = tt(l.label), m = tt(l.placeholder), d = tt(l.help), b = l.enableRefresh !== !1, g = Pe(l.minCount), S = Pe(l.maxCount), y = L(() => nt(l.resumeFilter), [l.resumeFilter]), k = ro(y), [p, f] = P(1), [v, x] = P(!1), [N, _] = P(""), [w, C] = P([]), [B, V] = P(0), [re, K] = P(y.pageSize ?? 20), $ = A(0), W = Q(o);
|
|
1106
|
+
q(() => {
|
|
1107
|
+
const T = hn(W, S);
|
|
960
1108
|
T !== null && s(T);
|
|
961
|
-
}, [
|
|
962
|
-
const
|
|
1109
|
+
}, [S, W, s]);
|
|
1110
|
+
const ee = j(
|
|
963
1111
|
async (T) => {
|
|
964
|
-
const
|
|
1112
|
+
const D = nt(JSON.parse(k)), z = ++$.current;
|
|
965
1113
|
if (!n) {
|
|
966
|
-
C([]),
|
|
1114
|
+
C([]), V(0), _("未配置简历搜索服务"), x(!1);
|
|
967
1115
|
return;
|
|
968
1116
|
}
|
|
969
1117
|
x(!0), _("");
|
|
970
1118
|
try {
|
|
971
|
-
const
|
|
972
|
-
if (
|
|
973
|
-
C(
|
|
1119
|
+
const I = await n({ filter: D, page: T });
|
|
1120
|
+
if (z !== $.current) return;
|
|
1121
|
+
C(I.list), V(I.total), f(I.page), K(I.pageSize), a && r(
|
|
974
1122
|
a,
|
|
975
|
-
|
|
976
|
-
value:
|
|
977
|
-
label:
|
|
1123
|
+
I.list.map((Y) => ({
|
|
1124
|
+
value: Y.resumeUniqueId,
|
|
1125
|
+
label: Y.name || Y.resumeUniqueId
|
|
978
1126
|
}))
|
|
979
1127
|
);
|
|
980
|
-
} catch (
|
|
981
|
-
if (
|
|
982
|
-
C([]),
|
|
1128
|
+
} catch (I) {
|
|
1129
|
+
if (z !== $.current) return;
|
|
1130
|
+
C([]), V(0), _(I instanceof Error ? I.message : "加载简历列表失败");
|
|
983
1131
|
} finally {
|
|
984
|
-
|
|
1132
|
+
z === $.current && x(!1);
|
|
985
1133
|
}
|
|
986
1134
|
},
|
|
987
1135
|
[n, k, a, r]
|
|
988
1136
|
);
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
}, [k,
|
|
992
|
-
const
|
|
1137
|
+
q(() => {
|
|
1138
|
+
f(1), ee(1);
|
|
1139
|
+
}, [k, ee]);
|
|
1140
|
+
const te = (T) => {
|
|
993
1141
|
if (!t) return;
|
|
994
|
-
const
|
|
995
|
-
|
|
1142
|
+
const D = fn(
|
|
1143
|
+
W,
|
|
996
1144
|
T,
|
|
997
1145
|
g,
|
|
998
|
-
|
|
1146
|
+
S
|
|
999
1147
|
);
|
|
1000
|
-
|
|
1001
|
-
},
|
|
1002
|
-
const T =
|
|
1003
|
-
|
|
1004
|
-
},
|
|
1005
|
-
return /* @__PURE__ */
|
|
1148
|
+
D !== null && i(D);
|
|
1149
|
+
}, E = () => {
|
|
1150
|
+
const T = nt(JSON.parse(k)), D = re || T.pageSize || 20, z = Math.max(1, Math.ceil(B / D)), I = p >= z ? 1 : p + 1;
|
|
1151
|
+
ee(I);
|
|
1152
|
+
}, R = m || "暂无匹配的简历";
|
|
1153
|
+
return /* @__PURE__ */ M(
|
|
1006
1154
|
"div",
|
|
1007
1155
|
{
|
|
1008
1156
|
className: "form-block-preview skopon-resume-select",
|
|
1009
1157
|
"data-skopon-field": a || void 0,
|
|
1010
1158
|
children: [
|
|
1011
|
-
|
|
1012
|
-
v && w.length === 0 ? /* @__PURE__ */
|
|
1013
|
-
/* @__PURE__ */
|
|
1159
|
+
c ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: c }) : null,
|
|
1160
|
+
v && w.length === 0 ? /* @__PURE__ */ M("div", { className: "skopon-resume-select-status", children: [
|
|
1161
|
+
/* @__PURE__ */ u(ft, { size: "small" }),
|
|
1014
1162
|
" 加载简历…"
|
|
1015
1163
|
] }) : null,
|
|
1016
|
-
!v &&
|
|
1017
|
-
!v && !
|
|
1018
|
-
w.length > 0 ? /* @__PURE__ */
|
|
1019
|
-
|
|
1164
|
+
!v && N ? /* @__PURE__ */ u(ne.Text, { type: "danger", className: "skopon-resume-select-status", children: N }) : null,
|
|
1165
|
+
!v && !N && w.length === 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-empty", children: R }) : null,
|
|
1166
|
+
w.length > 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-list", children: w.map((T) => /* @__PURE__ */ u(
|
|
1167
|
+
co,
|
|
1020
1168
|
{
|
|
1021
1169
|
item: T,
|
|
1022
|
-
selected:
|
|
1023
|
-
disabled:
|
|
1024
|
-
|
|
1170
|
+
selected: W.includes(T.resumeUniqueId),
|
|
1171
|
+
disabled: pn(
|
|
1172
|
+
W,
|
|
1025
1173
|
T.resumeUniqueId,
|
|
1026
1174
|
t,
|
|
1027
1175
|
g,
|
|
1028
|
-
|
|
1176
|
+
S
|
|
1029
1177
|
),
|
|
1030
|
-
onToggle: () =>
|
|
1178
|
+
onToggle: () => te(T.resumeUniqueId)
|
|
1031
1179
|
},
|
|
1032
1180
|
T.resumeUniqueId
|
|
1033
1181
|
)) }) : null,
|
|
1034
|
-
|
|
1035
|
-
|
|
1182
|
+
b && n ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ u(
|
|
1183
|
+
Oe,
|
|
1036
1184
|
{
|
|
1037
1185
|
type: "default",
|
|
1038
1186
|
size: "small",
|
|
1039
|
-
icon: /* @__PURE__ */
|
|
1187
|
+
icon: /* @__PURE__ */ u(Yt, {}),
|
|
1040
1188
|
loading: v,
|
|
1041
1189
|
disabled: !t,
|
|
1042
|
-
onClick:
|
|
1190
|
+
onClick: E,
|
|
1043
1191
|
children: "换一批"
|
|
1044
1192
|
}
|
|
1045
1193
|
) }) : null,
|
|
1046
|
-
d ? /* @__PURE__ */
|
|
1194
|
+
d ? /* @__PURE__ */ u(ne.Text, { type: "secondary", className: "form-block-preview-help", children: d }) : null
|
|
1047
1195
|
]
|
|
1048
1196
|
}
|
|
1049
1197
|
);
|
|
1050
1198
|
}
|
|
1051
|
-
const
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
),
|
|
1199
|
+
const mo = X(
|
|
1200
|
+
oo,
|
|
1201
|
+
uo
|
|
1202
|
+
), fo = {
|
|
1055
1203
|
type: "resume_multiselect",
|
|
1056
1204
|
componentName: "SkoponResumeSelect",
|
|
1057
|
-
toComponent:
|
|
1058
|
-
fromComponent:
|
|
1059
|
-
catalogComponents: [
|
|
1060
|
-
},
|
|
1061
|
-
|
|
1062
|
-
),
|
|
1063
|
-
|
|
1205
|
+
toComponent: eo,
|
|
1206
|
+
fromComponent: to,
|
|
1207
|
+
catalogComponents: [mo]
|
|
1208
|
+
}, Be = [fo, Zr], po = new Map(
|
|
1209
|
+
Be.map((e) => [e.type, e])
|
|
1210
|
+
), ho = new Map(
|
|
1211
|
+
Be.map((e) => [e.componentName, e])
|
|
1064
1212
|
);
|
|
1065
|
-
function
|
|
1066
|
-
return
|
|
1213
|
+
function go(e) {
|
|
1214
|
+
return po.get(e);
|
|
1067
1215
|
}
|
|
1068
|
-
function
|
|
1069
|
-
return
|
|
1216
|
+
function yo(e) {
|
|
1217
|
+
return ho.get(e);
|
|
1070
1218
|
}
|
|
1071
|
-
function
|
|
1072
|
-
return
|
|
1219
|
+
function vo() {
|
|
1220
|
+
return Be.flatMap((e) => e.catalogComponents);
|
|
1073
1221
|
}
|
|
1074
|
-
function
|
|
1075
|
-
return
|
|
1222
|
+
function bo() {
|
|
1223
|
+
return Be.map((e) => e.componentName);
|
|
1076
1224
|
}
|
|
1077
|
-
const we = "root",
|
|
1078
|
-
function
|
|
1225
|
+
const we = "root", ut = "__title__", mt = "__desc__", yt = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
|
|
1226
|
+
function So(e) {
|
|
1079
1227
|
return `/${e}`;
|
|
1080
1228
|
}
|
|
1081
|
-
function
|
|
1229
|
+
function Jt(e) {
|
|
1082
1230
|
return e && typeof e == "object" && "path" in e ? String(e.path ?? "").replace(/^\//, "") : "";
|
|
1083
1231
|
}
|
|
1084
1232
|
function H(e) {
|
|
1085
1233
|
if (typeof e == "string") return e;
|
|
1086
1234
|
}
|
|
1087
|
-
function
|
|
1088
|
-
const t = e.id ||
|
|
1235
|
+
function ko(e) {
|
|
1236
|
+
const t = e.id || le("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
|
|
1089
1237
|
return {
|
|
1090
1238
|
id: t,
|
|
1091
1239
|
component: "SkoponMedia",
|
|
1092
1240
|
mediaType: n,
|
|
1093
|
-
urls:
|
|
1094
|
-
mediaSize:
|
|
1241
|
+
urls: Cr(e),
|
|
1242
|
+
mediaSize: _e(e.mediaSize),
|
|
1095
1243
|
label: e.label ?? "",
|
|
1096
1244
|
help: e.help ?? "",
|
|
1097
1245
|
placeholder: e.placeholder ?? ""
|
|
1098
1246
|
};
|
|
1099
1247
|
}
|
|
1100
|
-
function
|
|
1248
|
+
function Co(e) {
|
|
1101
1249
|
if (Array.isArray(e.urls))
|
|
1102
1250
|
return e.urls.map((n) => String(n).trim()).filter(Boolean);
|
|
1103
1251
|
const t = H(e.url);
|
|
1104
1252
|
return t != null && t.trim() ? [t.trim()] : [];
|
|
1105
1253
|
}
|
|
1106
|
-
function
|
|
1107
|
-
const r = typeof e.id == "string" ? e.id :
|
|
1254
|
+
function Fe(e, t, n) {
|
|
1255
|
+
const r = typeof e.id == "string" ? e.id : le("block-"), o = Co(e), i = H(e.label) ?? H(e.description) ?? n, s = H(e.help), a = H(e.placeholder), l = _e(e.mediaSize);
|
|
1108
1256
|
return {
|
|
1109
1257
|
id: r,
|
|
1110
1258
|
type: t,
|
|
@@ -1115,10 +1263,10 @@ function Ie(e, t, n) {
|
|
|
1115
1263
|
mediaUrls: o.length > 0 ? o : [""]
|
|
1116
1264
|
};
|
|
1117
1265
|
}
|
|
1118
|
-
function
|
|
1266
|
+
function Gt(e) {
|
|
1119
1267
|
switch (e.type) {
|
|
1120
1268
|
case "toggle":
|
|
1121
|
-
return
|
|
1269
|
+
return Te(e.defaultValue);
|
|
1122
1270
|
case "multiselect":
|
|
1123
1271
|
case "checkbox":
|
|
1124
1272
|
case "resume_multiselect":
|
|
@@ -1132,9 +1280,9 @@ function fo(e) {
|
|
|
1132
1280
|
return typeof e.defaultValue == "string" ? e.defaultValue : "";
|
|
1133
1281
|
}
|
|
1134
1282
|
}
|
|
1135
|
-
function
|
|
1136
|
-
var
|
|
1137
|
-
const t = e.id ||
|
|
1283
|
+
function Ao(e) {
|
|
1284
|
+
var c;
|
|
1285
|
+
const t = e.id || le("a2-"), n = e.label ?? "", r = ((c = e.name) == null ? void 0 : c.trim()) || "", o = r ? So(r) : void 0, i = (e.options ?? []).map((m) => ({ label: m.label, value: m.value })), s = (m) => r ? { node: m, dataKey: r, dataValue: Gt(e) } : { node: m }, a = { id: t, label: n, name: r, path: o, withData: s }, l = go(e.type);
|
|
1138
1286
|
if (l)
|
|
1139
1287
|
return l.toComponent(e, a);
|
|
1140
1288
|
switch (e.type) {
|
|
@@ -1143,6 +1291,14 @@ function ho(e) {
|
|
|
1143
1291
|
case "paragraph":
|
|
1144
1292
|
return { node: { id: t, component: "Text", text: n, variant: "body" } };
|
|
1145
1293
|
case "text":
|
|
1294
|
+
return e.hidden ? r ? { node: null, dataKey: r, dataValue: Gt(e) } : { node: null } : s({
|
|
1295
|
+
id: t,
|
|
1296
|
+
component: "TextField",
|
|
1297
|
+
label: n,
|
|
1298
|
+
variant: "shortText",
|
|
1299
|
+
...e.placeholder ? { placeholder: e.placeholder } : {},
|
|
1300
|
+
value: { path: o }
|
|
1301
|
+
});
|
|
1146
1302
|
case "tel":
|
|
1147
1303
|
case "url":
|
|
1148
1304
|
return s({
|
|
@@ -1159,7 +1315,7 @@ function ho(e) {
|
|
|
1159
1315
|
component: "TextField",
|
|
1160
1316
|
label: n,
|
|
1161
1317
|
variant: "shortText",
|
|
1162
|
-
validationRegexp:
|
|
1318
|
+
validationRegexp: yt,
|
|
1163
1319
|
...e.placeholder ? { placeholder: e.placeholder } : {},
|
|
1164
1320
|
value: { path: o }
|
|
1165
1321
|
});
|
|
@@ -1245,7 +1401,7 @@ function ho(e) {
|
|
|
1245
1401
|
case "image":
|
|
1246
1402
|
case "video":
|
|
1247
1403
|
case "audio":
|
|
1248
|
-
return { node:
|
|
1404
|
+
return { node: ko(e) };
|
|
1249
1405
|
case "file":
|
|
1250
1406
|
return s({
|
|
1251
1407
|
id: t,
|
|
@@ -1262,31 +1418,31 @@ function ho(e) {
|
|
|
1262
1418
|
return { node: null };
|
|
1263
1419
|
}
|
|
1264
1420
|
}
|
|
1265
|
-
function
|
|
1421
|
+
function dt(e) {
|
|
1266
1422
|
if (!e || !Array.isArray(e.components) || e.components.length === 0) return !0;
|
|
1267
1423
|
const t = e.components.find((r) => r.id === we);
|
|
1268
1424
|
if (!t) return e.components.length === 0;
|
|
1269
1425
|
const n = t.children;
|
|
1270
1426
|
return !Array.isArray(n) || n.length === 0;
|
|
1271
1427
|
}
|
|
1272
|
-
function
|
|
1428
|
+
function vn(e, t) {
|
|
1273
1429
|
const n = [], r = [], o = {}, i = (t == null ? void 0 : t.includeHeader) !== !1, s = (e.title ?? "").trim(), a = (e.description ?? "").trim();
|
|
1274
|
-
i && s && (n.push({ id:
|
|
1430
|
+
i && s && (n.push({ id: ut, component: "Text", text: s, variant: "h2" }), r.push(ut)), i && a && (n.push({ id: mt, component: "Text", text: a, variant: "body" }), r.push(mt));
|
|
1275
1431
|
for (const m of e.blocks ?? []) {
|
|
1276
|
-
const { node: d, dataKey:
|
|
1277
|
-
d && (n.push(d), r.push(d.id)
|
|
1432
|
+
const { node: d, dataKey: b, dataValue: g } = Ao(m);
|
|
1433
|
+
b && (o[b] = g), d && (n.push(d), r.push(d.id));
|
|
1278
1434
|
}
|
|
1279
1435
|
n.unshift({ id: we, component: "Column", children: r });
|
|
1280
|
-
const l = { root: we, components: n, dataModel: o },
|
|
1281
|
-
return
|
|
1436
|
+
const l = { root: we, components: n, dataModel: o }, c = t == null ? void 0 : t.styleId;
|
|
1437
|
+
return c !== void 0 && (l.surfaceProperties = { styleId: c ?? null }), l;
|
|
1282
1438
|
}
|
|
1283
|
-
function
|
|
1439
|
+
function _o(e) {
|
|
1284
1440
|
const t = /* @__PURE__ */ new Map();
|
|
1285
1441
|
for (const n of e.components ?? [])
|
|
1286
1442
|
n && typeof n.id == "string" && t.set(n.id, n);
|
|
1287
1443
|
return t;
|
|
1288
1444
|
}
|
|
1289
|
-
function
|
|
1445
|
+
function ot(e) {
|
|
1290
1446
|
const t = e.options;
|
|
1291
1447
|
return Array.isArray(t) ? t.map((n) => {
|
|
1292
1448
|
if (!n || typeof n != "object") return null;
|
|
@@ -1297,10 +1453,10 @@ function nt(e) {
|
|
|
1297
1453
|
};
|
|
1298
1454
|
}).filter((n) => !!n) : [];
|
|
1299
1455
|
}
|
|
1300
|
-
function
|
|
1301
|
-
const t = typeof e.id == "string" ? e.id :
|
|
1456
|
+
function To(e) {
|
|
1457
|
+
const t = typeof e.id == "string" ? e.id : le("block-"), n = String(e.component ?? ""), r = H(e.label) ?? H(e.text) ?? "", o = Jt(e.value), i = (a) => ({ id: t, type: a, label: r }), s = yo(n);
|
|
1302
1458
|
if (s)
|
|
1303
|
-
return s.fromComponent(e, i, { asLiteral: H, nameFromValue:
|
|
1459
|
+
return s.fromComponent(e, i, { asLiteral: H, nameFromValue: Jt });
|
|
1304
1460
|
switch (n) {
|
|
1305
1461
|
case "Text": {
|
|
1306
1462
|
const a = String(e.variant ?? "body"), l = /^h[1-6]$/i.test(a) || a === "title" || a === "subtitle";
|
|
@@ -1309,19 +1465,19 @@ function yo(e) {
|
|
|
1309
1465
|
case "TextField": {
|
|
1310
1466
|
const a = String(e.variant ?? "shortText");
|
|
1311
1467
|
let l = "text";
|
|
1312
|
-
a === "longText" ? l = "textarea" : a === "number" ? l = "number" : H(e.validationRegexp) ===
|
|
1313
|
-
const
|
|
1314
|
-
return m && (
|
|
1468
|
+
a === "longText" ? l = "textarea" : a === "number" ? l = "number" : H(e.validationRegexp) === yt && (l = "email");
|
|
1469
|
+
const c = { ...i(l), name: o }, m = H(e.placeholder);
|
|
1470
|
+
return m && (c.placeholder = m), c;
|
|
1315
1471
|
}
|
|
1316
1472
|
case "CheckBox":
|
|
1317
1473
|
return { ...i("toggle"), name: o };
|
|
1318
1474
|
case "SkoponSelect": {
|
|
1319
|
-
const l = String(e.mode ?? "single") === "multiple" ? "multiselect" : "select",
|
|
1475
|
+
const l = String(e.mode ?? "single") === "multiple" ? "multiselect" : "select", c = {
|
|
1320
1476
|
...i(l),
|
|
1321
1477
|
name: o,
|
|
1322
|
-
options:
|
|
1478
|
+
options: ot(e)
|
|
1323
1479
|
}, m = H(e.placeholder);
|
|
1324
|
-
return m && (
|
|
1480
|
+
return m && (c.placeholder = m), c;
|
|
1325
1481
|
}
|
|
1326
1482
|
case "ChoicePicker": {
|
|
1327
1483
|
const a = H(e.skoponPickerType);
|
|
@@ -1329,12 +1485,12 @@ function yo(e) {
|
|
|
1329
1485
|
const m = {
|
|
1330
1486
|
...i(a),
|
|
1331
1487
|
name: o,
|
|
1332
|
-
options:
|
|
1488
|
+
options: ot(e)
|
|
1333
1489
|
}, d = H(e.placeholder);
|
|
1334
1490
|
return d && (m.placeholder = d), m;
|
|
1335
1491
|
}
|
|
1336
|
-
const
|
|
1337
|
-
return { ...i(
|
|
1492
|
+
const c = String(e.variant ?? "mutuallyExclusive") === "multipleSelection" ? "checkbox" : "radio";
|
|
1493
|
+
return { ...i(c), name: o, options: ot(e) };
|
|
1338
1494
|
}
|
|
1339
1495
|
case "DateTimeInput": {
|
|
1340
1496
|
const a = e.enableDate === !0, l = e.enableTime === !0, m = { ...i(!a && l ? "time" : "datetime"), name: o }, d = H(e.placeholder);
|
|
@@ -1342,23 +1498,23 @@ function yo(e) {
|
|
|
1342
1498
|
}
|
|
1343
1499
|
case "SkoponMedia": {
|
|
1344
1500
|
const a = String(e.mediaType ?? "image");
|
|
1345
|
-
return
|
|
1501
|
+
return Fe(e, a === "video" ? "video" : a === "audio" ? "audio" : "image", r);
|
|
1346
1502
|
}
|
|
1347
1503
|
case "Image":
|
|
1348
|
-
return
|
|
1504
|
+
return Fe(e, "image", r);
|
|
1349
1505
|
case "Video":
|
|
1350
|
-
return
|
|
1506
|
+
return Fe(e, "video", r);
|
|
1351
1507
|
case "AudioPlayer":
|
|
1352
|
-
return
|
|
1508
|
+
return Fe(e, "audio", r);
|
|
1353
1509
|
case "FileUpload": {
|
|
1354
1510
|
const a = H(e.accept) ?? "", l = { ...i("file"), name: o };
|
|
1355
|
-
return a && (l.fileAcceptExtensions = a.split(",").map((
|
|
1511
|
+
return a && (l.fileAcceptExtensions = a.split(",").map((c) => c.trim()).filter(Boolean)), Array.isArray(e.fileAcceptTypes) && (l.fileAcceptTypes = e.fileAcceptTypes.map(String)), typeof e.filePlaceholderIcon == "string" && (l.filePlaceholderIcon = e.filePlaceholderIcon), typeof e.minCount == "number" && (l.fileMinCount = e.minCount), typeof e.maxCount == "number" && (l.fileMaxCount = e.maxCount), l;
|
|
1356
1512
|
}
|
|
1357
1513
|
default:
|
|
1358
1514
|
return null;
|
|
1359
1515
|
}
|
|
1360
1516
|
}
|
|
1361
|
-
function
|
|
1517
|
+
function bn(e, t, n, r) {
|
|
1362
1518
|
if (n.has(e)) return;
|
|
1363
1519
|
n.add(e);
|
|
1364
1520
|
const o = t.get(e);
|
|
@@ -1366,47 +1522,46 @@ function hn(e, t, n, r) {
|
|
|
1366
1522
|
const i = String(o.component ?? "");
|
|
1367
1523
|
if ((i === "Column" || i === "Row") && Array.isArray(o.children)) {
|
|
1368
1524
|
for (const s of o.children)
|
|
1369
|
-
typeof s == "string" &&
|
|
1525
|
+
typeof s == "string" && bn(s, t, n, r);
|
|
1370
1526
|
return;
|
|
1371
1527
|
}
|
|
1372
1528
|
r.push(o);
|
|
1373
1529
|
}
|
|
1374
|
-
function
|
|
1530
|
+
function xo(e, t) {
|
|
1375
1531
|
return t ? e.map((n) => {
|
|
1376
1532
|
var i;
|
|
1377
1533
|
const r = (i = n.name) == null ? void 0 : i.trim();
|
|
1378
1534
|
if (!r || !(r in t)) return n;
|
|
1379
1535
|
const o = t[r];
|
|
1380
|
-
return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue:
|
|
1536
|
+
return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue: Te(o) } : { ...n, defaultValue: o };
|
|
1381
1537
|
}) : e;
|
|
1382
1538
|
}
|
|
1383
|
-
function
|
|
1539
|
+
function Mo(e) {
|
|
1384
1540
|
if (!e || !Array.isArray(e.components))
|
|
1385
|
-
return
|
|
1386
|
-
const t =
|
|
1387
|
-
|
|
1541
|
+
return ye({ title: "", description: "", blocks: [] });
|
|
1542
|
+
const t = _o(e), n = [];
|
|
1543
|
+
bn(e.root ?? we, t, /* @__PURE__ */ new Set(), n);
|
|
1388
1544
|
let r = "", o = "";
|
|
1389
1545
|
const i = [];
|
|
1390
1546
|
for (const s of n) {
|
|
1391
|
-
if (s.id ===
|
|
1547
|
+
if (s.id === ut) {
|
|
1392
1548
|
r = H(s.text) ?? r;
|
|
1393
1549
|
continue;
|
|
1394
1550
|
}
|
|
1395
|
-
if (s.id ===
|
|
1551
|
+
if (s.id === mt) {
|
|
1396
1552
|
o = H(s.text) ?? o;
|
|
1397
1553
|
continue;
|
|
1398
1554
|
}
|
|
1399
|
-
const a =
|
|
1555
|
+
const a = To(s);
|
|
1400
1556
|
a && i.push(a);
|
|
1401
1557
|
}
|
|
1402
|
-
return
|
|
1558
|
+
return ye({
|
|
1403
1559
|
title: r,
|
|
1404
1560
|
description: o,
|
|
1405
|
-
blocks:
|
|
1406
|
-
jsonSchema: {}
|
|
1561
|
+
blocks: xo(i, e.dataModel)
|
|
1407
1562
|
});
|
|
1408
1563
|
}
|
|
1409
|
-
function
|
|
1564
|
+
function No(e, t) {
|
|
1410
1565
|
const { surfaceId: n, catalogId: r } = t, o = [
|
|
1411
1566
|
{ version: "v0.9", createSurface: { surfaceId: n, catalogId: r } },
|
|
1412
1567
|
{
|
|
@@ -1419,25 +1574,25 @@ function bo(e, t) {
|
|
|
1419
1574
|
updateDataModel: { surfaceId: n, path: "/", value: e.dataModel }
|
|
1420
1575
|
}), o;
|
|
1421
1576
|
}
|
|
1422
|
-
function
|
|
1577
|
+
function Sn(e) {
|
|
1423
1578
|
return !!e && typeof e == "object" && !Array.isArray(e) && Array.isArray(e.components);
|
|
1424
1579
|
}
|
|
1425
|
-
function
|
|
1580
|
+
function Io(e, t) {
|
|
1426
1581
|
if (!e || typeof e != "object") return null;
|
|
1427
|
-
const n = e, r =
|
|
1428
|
-
if (r && !
|
|
1582
|
+
const n = e, r = Sn(n.a2ui) ? n.a2ui : void 0;
|
|
1583
|
+
if (r && !dt(r)) return r;
|
|
1429
1584
|
const o = Array.isArray(n.blocks) ? n.blocks : [];
|
|
1430
1585
|
if (o.length === 0) return null;
|
|
1431
|
-
const i =
|
|
1586
|
+
const i = qe({
|
|
1432
1587
|
title: typeof n.title == "string" ? n.title : "",
|
|
1433
1588
|
description: typeof n.description == "string" ? n.description : "",
|
|
1434
1589
|
blocks: o,
|
|
1435
|
-
jsonSchema:
|
|
1436
|
-
}), s =
|
|
1437
|
-
return
|
|
1590
|
+
jsonSchema: on(n.jsonSchema ?? n.json_schema)
|
|
1591
|
+
}), s = vn(i, t);
|
|
1592
|
+
return dt(s) ? null : s;
|
|
1438
1593
|
}
|
|
1439
|
-
function
|
|
1440
|
-
return
|
|
1594
|
+
function Fo(e, t, n) {
|
|
1595
|
+
return vn(
|
|
1441
1596
|
{
|
|
1442
1597
|
title: e.title,
|
|
1443
1598
|
description: e.description,
|
|
@@ -1446,18 +1601,18 @@ function Co(e, t, n) {
|
|
|
1446
1601
|
n
|
|
1447
1602
|
);
|
|
1448
1603
|
}
|
|
1449
|
-
function
|
|
1604
|
+
function Eo(e) {
|
|
1450
1605
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1451
1606
|
return;
|
|
1452
1607
|
const t = e;
|
|
1453
|
-
return !(Array.isArray(t.blocks) && t.blocks.length > 0) &&
|
|
1608
|
+
return !(Array.isArray(t.blocks) && t.blocks.length > 0) && Sn(t.a2ui) ? Mo(t.a2ui) : qe({
|
|
1454
1609
|
title: typeof t.title == "string" ? t.title : "",
|
|
1455
1610
|
description: typeof t.description == "string" ? t.description : "",
|
|
1456
1611
|
blocks: Array.isArray(t.blocks) ? t.blocks : [],
|
|
1457
|
-
jsonSchema:
|
|
1612
|
+
jsonSchema: on(t.jsonSchema ?? t.json_schema)
|
|
1458
1613
|
});
|
|
1459
1614
|
}
|
|
1460
|
-
function
|
|
1615
|
+
function Uo(e, t, n) {
|
|
1461
1616
|
const r = e.model.surfacesMap.get(t);
|
|
1462
1617
|
if (!r) return {};
|
|
1463
1618
|
const o = {};
|
|
@@ -1467,16 +1622,18 @@ function _o(e, t, n) {
|
|
|
1467
1622
|
}
|
|
1468
1623
|
return o;
|
|
1469
1624
|
}
|
|
1470
|
-
const
|
|
1471
|
-
function
|
|
1472
|
-
return
|
|
1625
|
+
const Ro = /* @__PURE__ */ new Set(["type", "name", "id"]);
|
|
1626
|
+
function vt(e) {
|
|
1627
|
+
return e.type === "text" && e.hidden === !0;
|
|
1628
|
+
}
|
|
1629
|
+
function bt(e) {
|
|
1630
|
+
return qe({
|
|
1473
1631
|
title: "",
|
|
1474
1632
|
description: "",
|
|
1475
|
-
blocks: [e]
|
|
1476
|
-
jsonSchema: {}
|
|
1633
|
+
blocks: [e]
|
|
1477
1634
|
}).blocks[0];
|
|
1478
1635
|
}
|
|
1479
|
-
function
|
|
1636
|
+
function Po(e, t) {
|
|
1480
1637
|
var o, i;
|
|
1481
1638
|
const n = /* @__PURE__ */ new Map();
|
|
1482
1639
|
for (const s of t) {
|
|
@@ -1485,19 +1642,19 @@ function xo(e, t) {
|
|
|
1485
1642
|
}
|
|
1486
1643
|
const r = [];
|
|
1487
1644
|
for (const s of e.blocks) {
|
|
1488
|
-
if (
|
|
1489
|
-
r.push(
|
|
1645
|
+
if (Ce(s.type)) {
|
|
1646
|
+
r.push(bt(s));
|
|
1490
1647
|
continue;
|
|
1491
1648
|
}
|
|
1492
|
-
if (!
|
|
1649
|
+
if (!Z(s.type)) continue;
|
|
1493
1650
|
const a = (i = s.name) == null ? void 0 : i.trim();
|
|
1494
1651
|
if (!a) continue;
|
|
1495
1652
|
const l = n.get(a);
|
|
1496
|
-
l && r.push(l);
|
|
1653
|
+
l && (vt(l) || r.push(l));
|
|
1497
1654
|
}
|
|
1498
1655
|
return r;
|
|
1499
1656
|
}
|
|
1500
|
-
function
|
|
1657
|
+
function wo(e, t, n) {
|
|
1501
1658
|
const r = e.rawBlocks;
|
|
1502
1659
|
if (!(r != null && r.length)) return n;
|
|
1503
1660
|
for (const o of r) {
|
|
@@ -1506,27 +1663,26 @@ function No(e, t, n) {
|
|
|
1506
1663
|
}
|
|
1507
1664
|
return n;
|
|
1508
1665
|
}
|
|
1509
|
-
function
|
|
1666
|
+
function zo(e, t) {
|
|
1510
1667
|
var r;
|
|
1511
1668
|
const n = { ...e };
|
|
1512
1669
|
for (const o of Object.keys(t)) {
|
|
1513
|
-
if (
|
|
1670
|
+
if (Ro.has(o) || !Object.prototype.hasOwnProperty.call(t, o)) continue;
|
|
1514
1671
|
const i = t[o];
|
|
1515
1672
|
i !== void 0 && Object.assign(n, { [o]: i });
|
|
1516
1673
|
}
|
|
1517
|
-
return n.type = e.type, n.name = ((r = e.name) == null ? void 0 : r.trim()) || t.name, n.id = e.id,
|
|
1674
|
+
return n.type = e.type, n.name = ((r = e.name) == null ? void 0 : r.trim()) || t.name, n.id = e.id, bt(n);
|
|
1518
1675
|
}
|
|
1519
|
-
function
|
|
1676
|
+
function Ve(e) {
|
|
1520
1677
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1521
1678
|
const t = e;
|
|
1522
1679
|
if (!Array.isArray(t.blocks)) return null;
|
|
1523
1680
|
const n = t.blocks.filter(
|
|
1524
1681
|
(o) => !!o && typeof o == "object" && !Array.isArray(o)
|
|
1525
|
-
), r =
|
|
1682
|
+
), r = qe({
|
|
1526
1683
|
title: typeof t.title == "string" ? t.title : "",
|
|
1527
1684
|
description: typeof t.description == "string" ? t.description : "",
|
|
1528
|
-
blocks: n
|
|
1529
|
-
jsonSchema: {}
|
|
1685
|
+
blocks: n
|
|
1530
1686
|
});
|
|
1531
1687
|
return {
|
|
1532
1688
|
title: r.title,
|
|
@@ -1535,108 +1691,118 @@ function Be(e) {
|
|
|
1535
1691
|
rawBlocks: n
|
|
1536
1692
|
};
|
|
1537
1693
|
}
|
|
1538
|
-
function
|
|
1539
|
-
var i, s, a, l,
|
|
1694
|
+
function Oo(e, t) {
|
|
1695
|
+
var i, s, a, l, c, m;
|
|
1540
1696
|
const n = /* @__PURE__ */ new Map();
|
|
1541
1697
|
for (const d of (t == null ? void 0 : t.blocks) ?? [])
|
|
1542
|
-
|
|
1698
|
+
Z(d.type) && ((i = d.name) != null && i.trim()) && n.set(d.name.trim(), d);
|
|
1543
1699
|
const r = [], o = [];
|
|
1544
1700
|
for (const d of e.blocks) {
|
|
1545
|
-
if (!
|
|
1546
|
-
const
|
|
1547
|
-
if (!
|
|
1548
|
-
const g = n.get(
|
|
1701
|
+
if (!Z(d.type)) continue;
|
|
1702
|
+
const b = (s = d.name) == null ? void 0 : s.trim();
|
|
1703
|
+
if (!b) continue;
|
|
1704
|
+
const g = n.get(b);
|
|
1549
1705
|
if (g) {
|
|
1550
|
-
const
|
|
1551
|
-
r.push(
|
|
1706
|
+
const S = wo(e, b, d);
|
|
1707
|
+
r.push(zo(g, S));
|
|
1552
1708
|
} else
|
|
1553
|
-
o.push(
|
|
1709
|
+
o.push(bt(d));
|
|
1554
1710
|
}
|
|
1555
1711
|
return {
|
|
1556
1712
|
matchedBlocks: r,
|
|
1557
1713
|
extraBlocks: o,
|
|
1558
|
-
renderBlocks:
|
|
1714
|
+
renderBlocks: Po(e, r),
|
|
1559
1715
|
title: ((a = e.title) == null ? void 0 : a.trim()) || ((l = t == null ? void 0 : t.title) == null ? void 0 : l.trim()) || "",
|
|
1560
|
-
description: ((
|
|
1716
|
+
description: ((c = e.description) == null ? void 0 : c.trim()) || ((m = t == null ? void 0 : t.description) == null ? void 0 : m.trim()) || ""
|
|
1561
1717
|
};
|
|
1562
1718
|
}
|
|
1563
|
-
function
|
|
1719
|
+
function kn(e) {
|
|
1564
1720
|
const { type: t, defaultValue: n } = e;
|
|
1565
1721
|
return n !== void 0 ? t === "toggle" ? n === !0 || n === "true" : t === "multiselect" || t === "checkbox" || t === "resume_multiselect" || t === "case_multiselect" ? Array.isArray(n) ? n.map(String) : typeof n == "string" && n ? [n] : [] : n : t === "toggle" ? !1 : t === "multiselect" || t === "checkbox" || t === "resume_multiselect" || t === "case_multiselect" ? [] : t === "number" ? null : "";
|
|
1566
1722
|
}
|
|
1567
|
-
function
|
|
1723
|
+
function ze(e) {
|
|
1568
1724
|
var n;
|
|
1569
1725
|
const t = {};
|
|
1570
1726
|
for (const r of e) {
|
|
1571
|
-
if (!
|
|
1727
|
+
if (!Z(r.type)) continue;
|
|
1572
1728
|
const o = (n = r.name) == null ? void 0 : n.trim();
|
|
1573
|
-
o && (t[o] =
|
|
1729
|
+
o && (t[o] = kn(r));
|
|
1574
1730
|
}
|
|
1575
1731
|
return t;
|
|
1576
1732
|
}
|
|
1577
|
-
function
|
|
1733
|
+
function qo(e) {
|
|
1578
1734
|
return e.blocks.some(
|
|
1579
1735
|
(t) => {
|
|
1580
1736
|
var n;
|
|
1581
|
-
return
|
|
1737
|
+
return Z(t.type) && !!((n = t.name) != null && n.trim());
|
|
1582
1738
|
}
|
|
1583
1739
|
);
|
|
1584
1740
|
}
|
|
1585
|
-
function
|
|
1741
|
+
function Bo(e) {
|
|
1586
1742
|
return e.blocks.filter((t) => {
|
|
1587
1743
|
var n;
|
|
1588
|
-
return
|
|
1744
|
+
return Ce(t.type) ? !0 : !Z(t.type) || !((n = t.name) != null && n.trim()) ? !1 : !vt(t);
|
|
1589
1745
|
});
|
|
1590
1746
|
}
|
|
1591
|
-
function
|
|
1747
|
+
function ys(e) {
|
|
1592
1748
|
return e.blocks.filter((t) => {
|
|
1593
1749
|
var n;
|
|
1594
|
-
return
|
|
1750
|
+
return Z(t.type) && ((n = t.name) == null ? void 0 : n.trim());
|
|
1595
1751
|
}).map((t) => t.name.trim());
|
|
1596
1752
|
}
|
|
1753
|
+
function Vo(e) {
|
|
1754
|
+
var n;
|
|
1755
|
+
const t = {};
|
|
1756
|
+
for (const r of e.blocks) {
|
|
1757
|
+
if (!vt(r)) continue;
|
|
1758
|
+
const o = (n = r.name) == null ? void 0 : n.trim();
|
|
1759
|
+
o && (t[o] = kn(r));
|
|
1760
|
+
}
|
|
1761
|
+
return t;
|
|
1762
|
+
}
|
|
1597
1763
|
function St(e) {
|
|
1598
1764
|
return e.replace(/'/g, "'\\''");
|
|
1599
1765
|
}
|
|
1600
|
-
function
|
|
1766
|
+
function Cn(e) {
|
|
1601
1767
|
var n;
|
|
1602
1768
|
const t = (n = e == null ? void 0 : e.Authorization) == null ? void 0 : n.trim();
|
|
1603
1769
|
return t ? ` -H 'Authorization: ${St(t)}' \\` : " -H 'Authorization: Bearer <token>' \\";
|
|
1604
1770
|
}
|
|
1605
|
-
function
|
|
1771
|
+
function An(e, t, n) {
|
|
1606
1772
|
const r = (t ?? "").trim() || "<callback_url>", o = JSON.stringify(e ?? {}, null, 2);
|
|
1607
1773
|
return [
|
|
1608
1774
|
`curl -X POST '${r}' \\`,
|
|
1609
1775
|
" -H 'Content-Type: application/json' \\",
|
|
1610
|
-
|
|
1776
|
+
Cn(n),
|
|
1611
1777
|
` -d '${St(o)}'`
|
|
1612
1778
|
].join(`
|
|
1613
1779
|
`);
|
|
1614
1780
|
}
|
|
1615
|
-
function
|
|
1781
|
+
function Lo(e, t) {
|
|
1616
1782
|
return JSON.stringify({ ...e, ...t }, null, 2);
|
|
1617
1783
|
}
|
|
1618
|
-
function
|
|
1784
|
+
function jo({
|
|
1619
1785
|
cardValues: e,
|
|
1620
1786
|
extraValues: t = {},
|
|
1621
1787
|
callbackUrl: n,
|
|
1622
1788
|
headers: r
|
|
1623
1789
|
}) {
|
|
1624
|
-
const o = (n ?? "").trim() || "<callback_url>", i =
|
|
1790
|
+
const o = (n ?? "").trim() || "<callback_url>", i = Lo(e, t);
|
|
1625
1791
|
return [
|
|
1626
1792
|
`curl -X POST '${o}' \\`,
|
|
1627
1793
|
" -H 'Content-Type: application/json' \\",
|
|
1628
|
-
|
|
1794
|
+
Cn(r),
|
|
1629
1795
|
` -d '${St(i)}'`
|
|
1630
1796
|
].join(`
|
|
1631
1797
|
`);
|
|
1632
1798
|
}
|
|
1633
|
-
function
|
|
1634
|
-
const r =
|
|
1635
|
-
if (!r) return
|
|
1636
|
-
const o =
|
|
1637
|
-
return
|
|
1799
|
+
function vs(e, t, n) {
|
|
1800
|
+
const r = Ve(e);
|
|
1801
|
+
if (!r) return An(e, t, n);
|
|
1802
|
+
const o = ze(r.blocks);
|
|
1803
|
+
return jo({ cardValues: o, callbackUrl: t, headers: n });
|
|
1638
1804
|
}
|
|
1639
|
-
async function
|
|
1805
|
+
async function _n(e, t, n) {
|
|
1640
1806
|
const r = e.trim();
|
|
1641
1807
|
if (!r)
|
|
1642
1808
|
throw new Error("callback_url 为空");
|
|
@@ -1663,7 +1829,7 @@ async function Sn(e, t, n) {
|
|
|
1663
1829
|
}
|
|
1664
1830
|
return { ok: i.ok, status: i.status, body: s };
|
|
1665
1831
|
}
|
|
1666
|
-
async function
|
|
1832
|
+
async function bs(e) {
|
|
1667
1833
|
var n;
|
|
1668
1834
|
if (typeof navigator < "u" && ((n = navigator.clipboard) != null && n.writeText)) {
|
|
1669
1835
|
await navigator.clipboard.writeText(e);
|
|
@@ -1679,7 +1845,7 @@ async function as(e) {
|
|
|
1679
1845
|
document.body.removeChild(t);
|
|
1680
1846
|
}
|
|
1681
1847
|
}
|
|
1682
|
-
async function
|
|
1848
|
+
async function kt(e) {
|
|
1683
1849
|
let t;
|
|
1684
1850
|
try {
|
|
1685
1851
|
t = await e.json();
|
|
@@ -1692,8 +1858,8 @@ async function bt(e) {
|
|
|
1692
1858
|
throw new Error(t.message || `响应缺少 data (${e.status})`);
|
|
1693
1859
|
return t.data;
|
|
1694
1860
|
}
|
|
1695
|
-
const
|
|
1696
|
-
function
|
|
1861
|
+
const Ct = "auth_user", $o = "token", Do = "answer_agent_callback_url", Ho = "realtime_ws_url", Ko = "/api/v1/mock/ask_user_answer_mock";
|
|
1862
|
+
function At(e) {
|
|
1697
1863
|
if (typeof window > "u") return null;
|
|
1698
1864
|
try {
|
|
1699
1865
|
return e === "localStorage" ? window.localStorage : window.sessionStorage;
|
|
@@ -1701,7 +1867,7 @@ function Ct(e) {
|
|
|
1701
1867
|
return null;
|
|
1702
1868
|
}
|
|
1703
1869
|
}
|
|
1704
|
-
function
|
|
1870
|
+
function _t(e) {
|
|
1705
1871
|
try {
|
|
1706
1872
|
const t = JSON.parse(e);
|
|
1707
1873
|
return !t || typeof t != "object" || Array.isArray(t) ? null : t;
|
|
@@ -1709,50 +1875,50 @@ function At(e) {
|
|
|
1709
1875
|
return null;
|
|
1710
1876
|
}
|
|
1711
1877
|
}
|
|
1712
|
-
function
|
|
1713
|
-
const n =
|
|
1878
|
+
function Jo(e, t) {
|
|
1879
|
+
const n = _t(e);
|
|
1714
1880
|
if (!n) return "";
|
|
1715
1881
|
const r = n[t];
|
|
1716
1882
|
return typeof r == "string" ? r.trim().replace(/^bearer\s+/i, "").trim() : "";
|
|
1717
1883
|
}
|
|
1718
|
-
function
|
|
1719
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ??
|
|
1884
|
+
function Go(e = {}) {
|
|
1885
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ct, r = e.answerAgentCallbackUrlField ?? Do, o = At(t);
|
|
1720
1886
|
if (!o) return "";
|
|
1721
1887
|
const i = o.getItem(n);
|
|
1722
1888
|
if (!i) return "";
|
|
1723
|
-
const s =
|
|
1889
|
+
const s = _t(i);
|
|
1724
1890
|
if (!s) return "";
|
|
1725
1891
|
const a = s[r];
|
|
1726
|
-
return (typeof a == "string" ? a.trim() : "") ||
|
|
1892
|
+
return (typeof a == "string" ? a.trim() : "") || Ko;
|
|
1727
1893
|
}
|
|
1728
|
-
function
|
|
1729
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ??
|
|
1894
|
+
function Wo(e = {}) {
|
|
1895
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ct, r = e.realtimeWsUrlField ?? Ho, o = At(t);
|
|
1730
1896
|
if (!o) return "";
|
|
1731
1897
|
const i = o.getItem(n);
|
|
1732
1898
|
if (!i) return "";
|
|
1733
|
-
const s =
|
|
1899
|
+
const s = _t(i);
|
|
1734
1900
|
if (!s) return "";
|
|
1735
1901
|
const a = s[r];
|
|
1736
1902
|
return typeof a == "string" ? a.trim() : "";
|
|
1737
1903
|
}
|
|
1738
|
-
function
|
|
1904
|
+
function Tt(e, t) {
|
|
1739
1905
|
return {
|
|
1740
|
-
...
|
|
1906
|
+
...Tn(t),
|
|
1741
1907
|
...e ?? {}
|
|
1742
1908
|
};
|
|
1743
1909
|
}
|
|
1744
|
-
function
|
|
1745
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ??
|
|
1910
|
+
function Tn(e = {}) {
|
|
1911
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ct, r = e.tokenField ?? $o, o = At(t);
|
|
1746
1912
|
if (!o) return {};
|
|
1747
1913
|
const i = o.getItem(n);
|
|
1748
1914
|
if (!i) return {};
|
|
1749
|
-
const s =
|
|
1915
|
+
const s = Jo(i, r);
|
|
1750
1916
|
return s ? { Authorization: `Bearer ${s}` } : {};
|
|
1751
1917
|
}
|
|
1752
|
-
async function
|
|
1753
|
-
return e.getHeaders ? await e.getHeaders() ?? {} :
|
|
1918
|
+
async function xt(e = {}) {
|
|
1919
|
+
return e.getHeaders ? await e.getHeaders() ?? {} : Tn(e.authStorage);
|
|
1754
1920
|
}
|
|
1755
|
-
function
|
|
1921
|
+
function Yo(e = {}) {
|
|
1756
1922
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.detailPath ?? "/dev/form/detail", r = e.fetch ?? fetch;
|
|
1757
1923
|
async function o(i) {
|
|
1758
1924
|
const s = new URLSearchParams();
|
|
@@ -1762,21 +1928,21 @@ function $o(e = {}) {
|
|
|
1762
1928
|
s.set("form_unique_id", i.formUniqueId);
|
|
1763
1929
|
else
|
|
1764
1930
|
throw new Error("form_id 或 form_unique_id 至少传一个");
|
|
1765
|
-
const a = await
|
|
1931
|
+
const a = await xt(e), l = await r(`${t}${n}?${s.toString()}`, {
|
|
1766
1932
|
method: "GET",
|
|
1767
1933
|
headers: a
|
|
1768
|
-
}),
|
|
1934
|
+
}), c = await kt(l), m = Eo(c.form_definition);
|
|
1769
1935
|
return {
|
|
1770
|
-
formUniqueId:
|
|
1771
|
-
formId:
|
|
1772
|
-
disabled:
|
|
1936
|
+
formUniqueId: c.form_unique_id,
|
|
1937
|
+
formId: c.form_id,
|
|
1938
|
+
disabled: c.disabled === 1,
|
|
1773
1939
|
formDefinition: m,
|
|
1774
|
-
a2ui:
|
|
1940
|
+
a2ui: Io(c.form_definition) ?? void 0
|
|
1775
1941
|
};
|
|
1776
1942
|
}
|
|
1777
1943
|
return { fetchDetail: o };
|
|
1778
1944
|
}
|
|
1779
|
-
function
|
|
1945
|
+
function Qo(e) {
|
|
1780
1946
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1781
1947
|
return e ?? null;
|
|
1782
1948
|
const t = e;
|
|
@@ -1786,13 +1952,13 @@ function Do(e) {
|
|
|
1786
1952
|
blocks: t.blocks
|
|
1787
1953
|
} : e;
|
|
1788
1954
|
}
|
|
1789
|
-
function
|
|
1955
|
+
function Mt({
|
|
1790
1956
|
context: e,
|
|
1791
1957
|
payload: t,
|
|
1792
1958
|
form: n,
|
|
1793
1959
|
answer: r
|
|
1794
1960
|
}) {
|
|
1795
|
-
const o =
|
|
1961
|
+
const o = Ve(t) ?? t, i = n ? Qo(n) : o;
|
|
1796
1962
|
return {
|
|
1797
1963
|
mission_id: e.missionId ?? null,
|
|
1798
1964
|
tenant_id: e.tenantId ?? null,
|
|
@@ -1820,34 +1986,34 @@ function Nt(e) {
|
|
|
1820
1986
|
const o = e.mission_id;
|
|
1821
1987
|
return o == null || o === "" ? "mission_id 缺失,无法提交" : null;
|
|
1822
1988
|
}
|
|
1823
|
-
function
|
|
1989
|
+
function Ss(e) {
|
|
1824
1990
|
return Nt(
|
|
1825
|
-
|
|
1991
|
+
Mt({
|
|
1826
1992
|
context: e,
|
|
1827
1993
|
payload: {},
|
|
1828
1994
|
answer: {}
|
|
1829
1995
|
})
|
|
1830
1996
|
);
|
|
1831
1997
|
}
|
|
1832
|
-
const
|
|
1833
|
-
function
|
|
1998
|
+
const Wt = "answer_agent_callback_url 未配置,无法提交";
|
|
1999
|
+
function Xo(e) {
|
|
1834
2000
|
if ((e == null ? void 0 : e.answerAgentCallbackUrl) != null) {
|
|
1835
2001
|
const n = e.answerAgentCallbackUrl.trim();
|
|
1836
2002
|
if (!n)
|
|
1837
|
-
throw new Error(
|
|
2003
|
+
throw new Error(Wt);
|
|
1838
2004
|
return n;
|
|
1839
2005
|
}
|
|
1840
|
-
const t =
|
|
2006
|
+
const t = Go(e == null ? void 0 : e.authStorage).trim();
|
|
1841
2007
|
if (!t)
|
|
1842
|
-
throw new Error(
|
|
2008
|
+
throw new Error(Wt);
|
|
1843
2009
|
return t;
|
|
1844
2010
|
}
|
|
1845
|
-
function
|
|
2011
|
+
function xn(e) {
|
|
1846
2012
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1847
2013
|
const n = e.data;
|
|
1848
2014
|
return !n || typeof n != "object" || Array.isArray(n) ? null : n;
|
|
1849
2015
|
}
|
|
1850
|
-
function
|
|
2016
|
+
function Zo(e, t) {
|
|
1851
2017
|
if (t && typeof t == "object" && t !== null && "message" in t) {
|
|
1852
2018
|
const n = t.message;
|
|
1853
2019
|
if (typeof n == "string" && n.trim())
|
|
@@ -1855,27 +2021,27 @@ function Ko(e, t) {
|
|
|
1855
2021
|
}
|
|
1856
2022
|
return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
|
|
1857
2023
|
}
|
|
1858
|
-
function
|
|
2024
|
+
function ei(e) {
|
|
1859
2025
|
return `提交失败:${typeof e.error == "string" && e.error.trim() ? e.error.trim() : `回调 HTTP ${e.callback_status ?? "失败"}`}`;
|
|
1860
2026
|
}
|
|
1861
|
-
function
|
|
1862
|
-
const t =
|
|
1863
|
-
return (t == null ? void 0 : t.callback_ok) === !1 ? { type: "error", message:
|
|
2027
|
+
function Mn(e) {
|
|
2028
|
+
const t = xn(e.body);
|
|
2029
|
+
return (t == null ? void 0 : t.callback_ok) === !1 ? { type: "error", message: ei(t) } : e.ok ? { type: "success", message: "提交成功" } : {
|
|
1864
2030
|
type: "error",
|
|
1865
|
-
message:
|
|
2031
|
+
message: Zo(e.status, e.body)
|
|
1866
2032
|
};
|
|
1867
2033
|
}
|
|
1868
|
-
async function
|
|
2034
|
+
async function Nn(e, t) {
|
|
1869
2035
|
const n = Nt(e);
|
|
1870
2036
|
if (n)
|
|
1871
2037
|
throw new Error(n);
|
|
1872
|
-
const r =
|
|
2038
|
+
const r = Xo(t), o = await _n(r, e, {
|
|
1873
2039
|
...t,
|
|
1874
|
-
headers:
|
|
1875
|
-
}), i =
|
|
2040
|
+
headers: Tt(t == null ? void 0 : t.headers, t == null ? void 0 : t.authStorage)
|
|
2041
|
+
}), i = xn(o.body);
|
|
1876
2042
|
return o.ok && (i == null ? void 0 : i.callback_ok) === !1 ? { ok: !1, status: o.status, body: o.body } : o;
|
|
1877
2043
|
}
|
|
1878
|
-
function
|
|
2044
|
+
function ti(e) {
|
|
1879
2045
|
return {
|
|
1880
2046
|
resumeUniqueId: e.resume_unique_id,
|
|
1881
2047
|
resumeId: e.resume_id,
|
|
@@ -1896,7 +2062,7 @@ function Jo(e) {
|
|
|
1896
2062
|
}))
|
|
1897
2063
|
};
|
|
1898
2064
|
}
|
|
1899
|
-
function
|
|
2065
|
+
function ni(e, t, n) {
|
|
1900
2066
|
const r = new URLSearchParams();
|
|
1901
2067
|
r.set("page", String(t)), r.set("page_size", String(e.pageSize ?? 20));
|
|
1902
2068
|
for (const o of e.names ?? [])
|
|
@@ -1909,27 +2075,27 @@ function Wo(e, t, n) {
|
|
|
1909
2075
|
r.append("published", String(o));
|
|
1910
2076
|
return r;
|
|
1911
2077
|
}
|
|
1912
|
-
function
|
|
2078
|
+
function ri(e = {}) {
|
|
1913
2079
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.searchPath ?? "/univ/resume/search", r = e.fetch ?? fetch, o = e.published ?? [1];
|
|
1914
2080
|
return async ({ filter: i, page: s }) => {
|
|
1915
|
-
const a = await
|
|
2081
|
+
const a = await xt(e), l = ni(i, s, o), c = await r(`${t}${n}?${l.toString()}`, {
|
|
1916
2082
|
method: "GET",
|
|
1917
2083
|
headers: a
|
|
1918
|
-
}), m = await
|
|
2084
|
+
}), m = await kt(c);
|
|
1919
2085
|
return {
|
|
1920
|
-
list: (m.list ?? []).map(
|
|
2086
|
+
list: (m.list ?? []).map(ti),
|
|
1921
2087
|
total: m.total ?? 0,
|
|
1922
2088
|
page: m.page ?? s,
|
|
1923
2089
|
pageSize: m.page_size ?? i.pageSize ?? 20
|
|
1924
2090
|
};
|
|
1925
2091
|
};
|
|
1926
2092
|
}
|
|
1927
|
-
function
|
|
2093
|
+
function oi(e) {
|
|
1928
2094
|
var r, o, i, s;
|
|
1929
2095
|
const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!((o = e.agentUniqueId) != null && o.trim() && ((i = e.flowType) != null && i.trim()) && ((s = e.category) != null && s.trim()));
|
|
1930
2096
|
return t || n;
|
|
1931
2097
|
}
|
|
1932
|
-
function
|
|
2098
|
+
function ii(e) {
|
|
1933
2099
|
return {
|
|
1934
2100
|
caseUniqueId: e.case_unique_id,
|
|
1935
2101
|
caseId: e.case_id,
|
|
@@ -1940,7 +2106,7 @@ function Xo(e) {
|
|
|
1940
2106
|
description: e.description ?? void 0
|
|
1941
2107
|
};
|
|
1942
2108
|
}
|
|
1943
|
-
function
|
|
2109
|
+
function si(e, t, n) {
|
|
1944
2110
|
var o, i, s;
|
|
1945
2111
|
const r = new URLSearchParams();
|
|
1946
2112
|
r.set("page", String(t)), r.set("page_size", String(e.pageSize ?? 20)), r.set("published", String(n)), (o = e.agentUniqueId) != null && o.trim() && r.set("agent_unique_id", e.agentUniqueId.trim()), (i = e.flowType) != null && i.trim() && r.set("flow_type", e.flowType.trim()), (s = e.category) != null && s.trim() && r.set("category_unique_id", e.category.trim());
|
|
@@ -1948,24 +2114,24 @@ function Zo(e, t, n) {
|
|
|
1948
2114
|
a && r.append("flow_unique_ids", a);
|
|
1949
2115
|
return r;
|
|
1950
2116
|
}
|
|
1951
|
-
function
|
|
2117
|
+
function ai(e = {}) {
|
|
1952
2118
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.listPath ?? "/univ/case/list", r = e.fetch ?? fetch, o = e.published ?? 1;
|
|
1953
2119
|
return async ({ filter: i, page: s }) => {
|
|
1954
|
-
if (!
|
|
2120
|
+
if (!oi(i))
|
|
1955
2121
|
return { list: [], total: 0, page: 1, pageSize: i.pageSize ?? 20 };
|
|
1956
|
-
const a = await
|
|
2122
|
+
const a = await xt(e), l = si(i, s, o), c = await r(`${t}${n}?${l.toString()}`, {
|
|
1957
2123
|
method: "GET",
|
|
1958
2124
|
headers: a
|
|
1959
|
-
}), m = await
|
|
2125
|
+
}), m = await kt(c);
|
|
1960
2126
|
return {
|
|
1961
|
-
list: (m.list ?? []).map(
|
|
2127
|
+
list: (m.list ?? []).map(ii),
|
|
1962
2128
|
total: m.total ?? 0,
|
|
1963
2129
|
page: m.page ?? s,
|
|
1964
2130
|
pageSize: m.page_size ?? i.pageSize ?? 20
|
|
1965
2131
|
};
|
|
1966
2132
|
};
|
|
1967
2133
|
}
|
|
1968
|
-
function
|
|
2134
|
+
function ks(e = {}) {
|
|
1969
2135
|
var r, o, i, s, a;
|
|
1970
2136
|
const t = {
|
|
1971
2137
|
baseUrl: e.baseUrl,
|
|
@@ -1974,23 +2140,23 @@ function cs(e = {}) {
|
|
|
1974
2140
|
authStorage: e.authStorage
|
|
1975
2141
|
};
|
|
1976
2142
|
return {
|
|
1977
|
-
fetchDetail:
|
|
2143
|
+
fetchDetail: Yo({
|
|
1978
2144
|
...t,
|
|
1979
2145
|
detailPath: (r = e.form) == null ? void 0 : r.detailPath
|
|
1980
2146
|
}).fetchDetail,
|
|
1981
|
-
resumeSearch:
|
|
2147
|
+
resumeSearch: ri({
|
|
1982
2148
|
...t,
|
|
1983
2149
|
searchPath: (o = e.resume) == null ? void 0 : o.searchPath,
|
|
1984
2150
|
published: (i = e.resume) == null ? void 0 : i.published
|
|
1985
2151
|
}),
|
|
1986
|
-
caseSearch:
|
|
2152
|
+
caseSearch: ai({
|
|
1987
2153
|
...t,
|
|
1988
2154
|
listPath: (s = e.case) == null ? void 0 : s.listPath,
|
|
1989
2155
|
published: (a = e.case) == null ? void 0 : a.published
|
|
1990
2156
|
})
|
|
1991
2157
|
};
|
|
1992
2158
|
}
|
|
1993
|
-
function
|
|
2159
|
+
function In(e, t) {
|
|
1994
2160
|
if (!t.trim()) return !0;
|
|
1995
2161
|
try {
|
|
1996
2162
|
return new RegExp(t).test(e);
|
|
@@ -1998,44 +2164,44 @@ function _n(e, t) {
|
|
|
1998
2164
|
return !0;
|
|
1999
2165
|
}
|
|
2000
2166
|
}
|
|
2001
|
-
function
|
|
2167
|
+
function Fn(e) {
|
|
2002
2168
|
return e == null ? !0 : typeof e == "string" ? !e.trim() : !1;
|
|
2003
2169
|
}
|
|
2004
|
-
function
|
|
2170
|
+
function li(e, t) {
|
|
2005
2171
|
switch (e.type) {
|
|
2006
2172
|
case "multiselect":
|
|
2007
2173
|
case "checkbox":
|
|
2008
2174
|
case "file":
|
|
2009
2175
|
case "resume_multiselect":
|
|
2010
2176
|
case "case_multiselect":
|
|
2011
|
-
return
|
|
2177
|
+
return Q(t).length === 0;
|
|
2012
2178
|
case "toggle":
|
|
2013
|
-
return !
|
|
2179
|
+
return !Te(t);
|
|
2014
2180
|
case "number":
|
|
2015
2181
|
return t == null || t === "";
|
|
2016
2182
|
default:
|
|
2017
|
-
return
|
|
2183
|
+
return Fn(t);
|
|
2018
2184
|
}
|
|
2019
2185
|
}
|
|
2020
|
-
function
|
|
2186
|
+
function it(e, t) {
|
|
2021
2187
|
return e.required === !0 || t > 0;
|
|
2022
2188
|
}
|
|
2023
|
-
function
|
|
2189
|
+
function ci(e, t) {
|
|
2024
2190
|
var n, r;
|
|
2025
2191
|
for (const o of e) {
|
|
2026
2192
|
const i = (n = o.name) == null ? void 0 : n.trim();
|
|
2027
|
-
if (!i ||
|
|
2193
|
+
if (!i || Ce(o.type) || de(o.type)) continue;
|
|
2028
2194
|
const s = t[i], a = ((r = o.label) == null ? void 0 : r.trim()) || i;
|
|
2029
|
-
if (o.required &&
|
|
2195
|
+
if (o.required && li(o, s))
|
|
2030
2196
|
return { fieldName: i, label: a, message: `请填写「${a}」` };
|
|
2031
|
-
if (o.type === "email" && !
|
|
2197
|
+
if (o.type === "email" && !Fn(s)) {
|
|
2032
2198
|
const l = String(s).trim();
|
|
2033
|
-
if (!
|
|
2199
|
+
if (!In(l, yt))
|
|
2034
2200
|
return { fieldName: i, label: a, message: `「${a}」格式不正确` };
|
|
2035
2201
|
}
|
|
2036
2202
|
if (o.type === "file") {
|
|
2037
|
-
const l = o.fileMinCount ?? 0,
|
|
2038
|
-
if (l > 0 &&
|
|
2203
|
+
const l = o.fileMinCount ?? 0, c = Q(s).length;
|
|
2204
|
+
if (l > 0 && c < l && it(o, c))
|
|
2039
2205
|
return {
|
|
2040
2206
|
fieldName: i,
|
|
2041
2207
|
label: a,
|
|
@@ -2043,8 +2209,8 @@ function ni(e, t) {
|
|
|
2043
2209
|
};
|
|
2044
2210
|
}
|
|
2045
2211
|
if (o.type === "resume_multiselect") {
|
|
2046
|
-
const l = o.resumeMinCount,
|
|
2047
|
-
if (l !== void 0 &&
|
|
2212
|
+
const l = o.resumeMinCount, c = Q(s).length;
|
|
2213
|
+
if (l !== void 0 && c < l && it(o, c))
|
|
2048
2214
|
return {
|
|
2049
2215
|
fieldName: i,
|
|
2050
2216
|
label: a,
|
|
@@ -2052,8 +2218,8 @@ function ni(e, t) {
|
|
|
2052
2218
|
};
|
|
2053
2219
|
}
|
|
2054
2220
|
if (o.type === "case_multiselect") {
|
|
2055
|
-
const l = o.caseMinCount,
|
|
2056
|
-
if (l !== void 0 &&
|
|
2221
|
+
const l = o.caseMinCount, c = Q(s).length;
|
|
2222
|
+
if (l !== void 0 && c < l && it(o, c))
|
|
2057
2223
|
return {
|
|
2058
2224
|
fieldName: i,
|
|
2059
2225
|
label: a,
|
|
@@ -2063,21 +2229,21 @@ function ni(e, t) {
|
|
|
2063
2229
|
}
|
|
2064
2230
|
return null;
|
|
2065
2231
|
}
|
|
2066
|
-
const
|
|
2067
|
-
video:
|
|
2068
|
-
audio:
|
|
2069
|
-
image:
|
|
2070
|
-
file:
|
|
2071
|
-
spreadsheet:
|
|
2072
|
-
document:
|
|
2232
|
+
const ui = {
|
|
2233
|
+
video: er,
|
|
2234
|
+
audio: Zn,
|
|
2235
|
+
image: Xn,
|
|
2236
|
+
file: Xt,
|
|
2237
|
+
spreadsheet: Qn,
|
|
2238
|
+
document: Qt
|
|
2073
2239
|
};
|
|
2074
|
-
function
|
|
2240
|
+
function mi({
|
|
2075
2241
|
type: e,
|
|
2076
2242
|
size: t = 40,
|
|
2077
2243
|
className: n
|
|
2078
2244
|
}) {
|
|
2079
|
-
const r =
|
|
2080
|
-
return /* @__PURE__ */
|
|
2245
|
+
const r = ui[e] ?? Xt;
|
|
2246
|
+
return /* @__PURE__ */ u(
|
|
2081
2247
|
r,
|
|
2082
2248
|
{
|
|
2083
2249
|
className: n ?? "skopon-form-file-placeholder-icon",
|
|
@@ -2086,7 +2252,7 @@ function oi({
|
|
|
2086
2252
|
}
|
|
2087
2253
|
);
|
|
2088
2254
|
}
|
|
2089
|
-
const
|
|
2255
|
+
const En = "skopon-form-v0_9", di = /* @__PURE__ */ new Set([
|
|
2090
2256
|
"SkoponMedia",
|
|
2091
2257
|
"SkoponSelect",
|
|
2092
2258
|
"Image",
|
|
@@ -2098,17 +2264,17 @@ const xn = "skopon-form-v0_9", ii = /* @__PURE__ */ new Set([
|
|
|
2098
2264
|
"FileUpload",
|
|
2099
2265
|
"TextField",
|
|
2100
2266
|
"Text",
|
|
2101
|
-
...
|
|
2102
|
-
]),
|
|
2103
|
-
function
|
|
2104
|
-
const t = [...
|
|
2267
|
+
...bo()
|
|
2268
|
+
]), fi = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
|
|
2269
|
+
function xe(e) {
|
|
2270
|
+
const t = [...Ue.components.values()].find((n) => n.name === e);
|
|
2105
2271
|
if (!t) throw new Error(`Missing basic catalog component: ${e}`);
|
|
2106
2272
|
return t.schema;
|
|
2107
2273
|
}
|
|
2108
|
-
function
|
|
2274
|
+
function U(e) {
|
|
2109
2275
|
return typeof e == "string" ? e : "";
|
|
2110
2276
|
}
|
|
2111
|
-
function
|
|
2277
|
+
function Un(e) {
|
|
2112
2278
|
return Array.isArray(e) ? e.map((t) => {
|
|
2113
2279
|
if (!t || typeof t != "object") return null;
|
|
2114
2280
|
const n = t, r = String(n.value ?? n.label ?? ""), o = String(n.label ?? n.value ?? "");
|
|
@@ -2123,10 +2289,10 @@ function Le({
|
|
|
2123
2289
|
help: o,
|
|
2124
2290
|
placeholder: i
|
|
2125
2291
|
}) {
|
|
2126
|
-
const s = r == null ? void 0 : r.trim(), a = o == null ? void 0 : o.trim(), l =
|
|
2127
|
-
return /* @__PURE__ */
|
|
2128
|
-
s ? /* @__PURE__ */
|
|
2129
|
-
t.length === 0 ? /* @__PURE__ */
|
|
2292
|
+
const s = r == null ? void 0 : r.trim(), a = o == null ? void 0 : o.trim(), l = _r(n), c = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
|
|
2293
|
+
return /* @__PURE__ */ M("div", { className: "form-block-preview", children: [
|
|
2294
|
+
s ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: s }) : null,
|
|
2295
|
+
t.length === 0 ? /* @__PURE__ */ u("div", { className: "form-media-preview form-media-preview--empty", children: c }) : /* @__PURE__ */ u("div", { className: l, children: t.map((m, d) => e === "image" ? /* @__PURE__ */ u(
|
|
2130
2296
|
"img",
|
|
2131
2297
|
{
|
|
2132
2298
|
src: m,
|
|
@@ -2134,7 +2300,7 @@ function Le({
|
|
|
2134
2300
|
className: "form-media-item"
|
|
2135
2301
|
},
|
|
2136
2302
|
`media-${d}`
|
|
2137
|
-
) : e === "video" ? /* @__PURE__ */
|
|
2303
|
+
) : e === "video" ? /* @__PURE__ */ u(
|
|
2138
2304
|
"video",
|
|
2139
2305
|
{
|
|
2140
2306
|
src: m,
|
|
@@ -2142,7 +2308,7 @@ function Le({
|
|
|
2142
2308
|
className: "form-media-item"
|
|
2143
2309
|
},
|
|
2144
2310
|
`media-${d}`
|
|
2145
|
-
) : /* @__PURE__ */
|
|
2311
|
+
) : /* @__PURE__ */ u(
|
|
2146
2312
|
"audio",
|
|
2147
2313
|
{
|
|
2148
2314
|
src: m,
|
|
@@ -2151,21 +2317,21 @@ function Le({
|
|
|
2151
2317
|
},
|
|
2152
2318
|
`media-${d}`
|
|
2153
2319
|
)) }),
|
|
2154
|
-
a ? /* @__PURE__ */
|
|
2320
|
+
a ? /* @__PURE__ */ u(ne.Text, { type: "secondary", className: "form-block-preview-help", children: a }) : null
|
|
2155
2321
|
] });
|
|
2156
2322
|
}
|
|
2157
|
-
function
|
|
2158
|
-
const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) :
|
|
2323
|
+
function je(e, t) {
|
|
2324
|
+
const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : U(e.url).trim() ? [U(e.url).trim()] : [];
|
|
2159
2325
|
return {
|
|
2160
2326
|
mediaType: t,
|
|
2161
2327
|
urls: n,
|
|
2162
|
-
mediaSize:
|
|
2163
|
-
label:
|
|
2164
|
-
help:
|
|
2165
|
-
placeholder:
|
|
2328
|
+
mediaSize: _e(e.mediaSize),
|
|
2329
|
+
label: U(e.label) || U(e.description),
|
|
2330
|
+
help: U(e.help),
|
|
2331
|
+
placeholder: U(e.placeholder)
|
|
2166
2332
|
};
|
|
2167
2333
|
}
|
|
2168
|
-
const
|
|
2334
|
+
const pi = {
|
|
2169
2335
|
name: "SkoponMedia",
|
|
2170
2336
|
schema: h.object({
|
|
2171
2337
|
mediaType: h.any().optional(),
|
|
@@ -2175,19 +2341,19 @@ const ai = {
|
|
|
2175
2341
|
help: h.any().optional(),
|
|
2176
2342
|
placeholder: h.any().optional()
|
|
2177
2343
|
}).passthrough()
|
|
2178
|
-
},
|
|
2179
|
-
const t = e.componentModel.properties, n =
|
|
2180
|
-
return /* @__PURE__ */
|
|
2181
|
-
}),
|
|
2182
|
-
{ name: "Image", schema:
|
|
2183
|
-
({ context: e }) => /* @__PURE__ */
|
|
2184
|
-
),
|
|
2185
|
-
{ name: "Video", schema:
|
|
2186
|
-
({ context: e }) => /* @__PURE__ */
|
|
2187
|
-
),
|
|
2188
|
-
{ name: "AudioPlayer", schema:
|
|
2189
|
-
({ context: e }) => /* @__PURE__ */
|
|
2190
|
-
),
|
|
2344
|
+
}, hi = X(pi, ({ context: e }) => {
|
|
2345
|
+
const t = e.componentModel.properties, n = U(t.mediaType);
|
|
2346
|
+
return /* @__PURE__ */ u(Le, { ...je(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
|
|
2347
|
+
}), gi = X(
|
|
2348
|
+
{ name: "Image", schema: xe("Image") },
|
|
2349
|
+
({ context: e }) => /* @__PURE__ */ u(Le, { ...je(e.componentModel.properties, "image") })
|
|
2350
|
+
), yi = X(
|
|
2351
|
+
{ name: "Video", schema: xe("Video") },
|
|
2352
|
+
({ context: e }) => /* @__PURE__ */ u(Le, { ...je(e.componentModel.properties, "video") })
|
|
2353
|
+
), vi = X(
|
|
2354
|
+
{ name: "AudioPlayer", schema: xe("AudioPlayer") },
|
|
2355
|
+
({ context: e }) => /* @__PURE__ */ u(Le, { ...je(e.componentModel.properties, "audio") })
|
|
2356
|
+
), bi = {
|
|
2191
2357
|
name: "SkoponSelect",
|
|
2192
2358
|
schema: h.object({
|
|
2193
2359
|
label: h.any().optional(),
|
|
@@ -2197,18 +2363,18 @@ const ai = {
|
|
|
2197
2363
|
value: h.any().optional()
|
|
2198
2364
|
}).passthrough()
|
|
2199
2365
|
};
|
|
2200
|
-
function
|
|
2201
|
-
const { interactive: t } =
|
|
2366
|
+
function Si({ context: e }) {
|
|
2367
|
+
const { interactive: t } = se(), { value: n, setValue: r, setValueSilent: o, fieldName: i } = ae(e, "value", {
|
|
2202
2368
|
component: "SkoponSelect",
|
|
2203
2369
|
changeAction: "select"
|
|
2204
|
-
}), s = e.componentModel.properties, a =
|
|
2205
|
-
return
|
|
2206
|
-
const d =
|
|
2370
|
+
}), s = e.componentModel.properties, a = U(s.label), l = U(s.placeholder), c = Un(s.options), m = U(s.mode) === "multiple";
|
|
2371
|
+
return q(() => {
|
|
2372
|
+
const d = dn(n, m);
|
|
2207
2373
|
d !== null && o(d);
|
|
2208
|
-
}, [m, n, o]), /* @__PURE__ */
|
|
2209
|
-
a ? /* @__PURE__ */
|
|
2210
|
-
/* @__PURE__ */
|
|
2211
|
-
|
|
2374
|
+
}, [m, n, o]), /* @__PURE__ */ M("div", { className: "form-block-preview", "data-skopon-field": i || void 0, children: [
|
|
2375
|
+
a ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2376
|
+
/* @__PURE__ */ u(
|
|
2377
|
+
st,
|
|
2212
2378
|
{
|
|
2213
2379
|
mode: m ? "multiple" : void 0,
|
|
2214
2380
|
disabled: !t,
|
|
@@ -2216,29 +2382,29 @@ function pi({ context: e }) {
|
|
|
2216
2382
|
className: "form-block-preview-control",
|
|
2217
2383
|
style: { width: "100%" },
|
|
2218
2384
|
placeholder: l || (m ? "请选择多项" : "请选择"),
|
|
2219
|
-
options:
|
|
2220
|
-
value: m ?
|
|
2385
|
+
options: c,
|
|
2386
|
+
value: m ? Q(n) : ve(n),
|
|
2221
2387
|
onChange: (d) => r(m ? d ?? [] : d ?? "")
|
|
2222
2388
|
}
|
|
2223
2389
|
)
|
|
2224
2390
|
] });
|
|
2225
2391
|
}
|
|
2226
|
-
const
|
|
2227
|
-
|
|
2228
|
-
|
|
2392
|
+
const ki = X(
|
|
2393
|
+
bi,
|
|
2394
|
+
Si
|
|
2229
2395
|
);
|
|
2230
|
-
function
|
|
2231
|
-
const { interactive: t } =
|
|
2396
|
+
function Ci({ context: e }) {
|
|
2397
|
+
const { interactive: t } = se(), { value: n, setValue: r, setValueSilent: o, fieldName: i } = ae(e, "value", {
|
|
2232
2398
|
component: "ChoicePicker",
|
|
2233
2399
|
changeAction: "select"
|
|
2234
|
-
}), s = e.componentModel.properties, a =
|
|
2235
|
-
return
|
|
2236
|
-
const y =
|
|
2400
|
+
}), s = e.componentModel.properties, a = U(s.label), l = U(s.variant) || "mutuallyExclusive", c = U(s.skoponPickerType), m = U(s.placeholder), d = Un(s.options), g = c === "select" || c === "multiselect" || c === "radio" || c === "checkbox" ? c : l === "multipleSelection" ? "checkbox" : "radio", S = g === "multiselect" || g === "checkbox";
|
|
2401
|
+
return q(() => {
|
|
2402
|
+
const y = dn(n, S);
|
|
2237
2403
|
y !== null && o(y);
|
|
2238
|
-
}, [
|
|
2239
|
-
a ? /* @__PURE__ */
|
|
2240
|
-
g === "select" ? /* @__PURE__ */
|
|
2241
|
-
|
|
2404
|
+
}, [S, n, o]), /* @__PURE__ */ M("div", { className: "form-block-preview", "data-skopon-field": i || void 0, children: [
|
|
2405
|
+
a ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2406
|
+
g === "select" ? /* @__PURE__ */ u(
|
|
2407
|
+
st,
|
|
2242
2408
|
{
|
|
2243
2409
|
disabled: !t,
|
|
2244
2410
|
allowClear: !0,
|
|
@@ -2246,11 +2412,11 @@ function hi({ context: e }) {
|
|
|
2246
2412
|
style: { width: "100%" },
|
|
2247
2413
|
placeholder: m || "请选择",
|
|
2248
2414
|
options: d,
|
|
2249
|
-
value:
|
|
2415
|
+
value: ve(n),
|
|
2250
2416
|
onChange: (y) => r(y ?? "")
|
|
2251
2417
|
}
|
|
2252
|
-
) : g === "multiselect" ? /* @__PURE__ */
|
|
2253
|
-
|
|
2418
|
+
) : g === "multiselect" ? /* @__PURE__ */ u(
|
|
2419
|
+
st,
|
|
2254
2420
|
{
|
|
2255
2421
|
mode: "multiple",
|
|
2256
2422
|
disabled: !t,
|
|
@@ -2259,31 +2425,31 @@ function hi({ context: e }) {
|
|
|
2259
2425
|
style: { width: "100%" },
|
|
2260
2426
|
placeholder: m || "请选择多项",
|
|
2261
2427
|
options: d,
|
|
2262
|
-
value:
|
|
2428
|
+
value: Q(n),
|
|
2263
2429
|
onChange: (y) => r(y ?? [])
|
|
2264
2430
|
}
|
|
2265
|
-
) : g === "checkbox" ? /* @__PURE__ */
|
|
2266
|
-
|
|
2431
|
+
) : g === "checkbox" ? /* @__PURE__ */ u(
|
|
2432
|
+
jn.Group,
|
|
2267
2433
|
{
|
|
2268
2434
|
disabled: !t,
|
|
2269
2435
|
className: "form-block-preview-control",
|
|
2270
2436
|
options: d,
|
|
2271
|
-
value:
|
|
2437
|
+
value: Q(n),
|
|
2272
2438
|
onChange: (y) => r(y)
|
|
2273
2439
|
}
|
|
2274
|
-
) : /* @__PURE__ */
|
|
2275
|
-
|
|
2440
|
+
) : /* @__PURE__ */ u(
|
|
2441
|
+
$n.Group,
|
|
2276
2442
|
{
|
|
2277
2443
|
disabled: !t,
|
|
2278
2444
|
className: "form-block-preview-control",
|
|
2279
2445
|
options: d,
|
|
2280
|
-
value:
|
|
2446
|
+
value: ve(n),
|
|
2281
2447
|
onChange: (y) => r(y.target.value)
|
|
2282
2448
|
}
|
|
2283
2449
|
)
|
|
2284
2450
|
] });
|
|
2285
2451
|
}
|
|
2286
|
-
const
|
|
2452
|
+
const Ai = X(
|
|
2287
2453
|
{
|
|
2288
2454
|
name: "ChoicePicker",
|
|
2289
2455
|
schema: h.object({
|
|
@@ -2295,88 +2461,88 @@ const gi = Q(
|
|
|
2295
2461
|
placeholder: h.any().optional()
|
|
2296
2462
|
}).passthrough()
|
|
2297
2463
|
},
|
|
2298
|
-
|
|
2464
|
+
Ci
|
|
2299
2465
|
);
|
|
2300
|
-
function
|
|
2301
|
-
const { interactive: t } =
|
|
2466
|
+
function _i({ context: e }) {
|
|
2467
|
+
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o } = ae(e, "value", {
|
|
2302
2468
|
component: "CheckBox",
|
|
2303
2469
|
changeAction: "change"
|
|
2304
|
-
}), i = e.componentModel.properties, s =
|
|
2305
|
-
return /* @__PURE__ */
|
|
2306
|
-
s ? /* @__PURE__ */
|
|
2307
|
-
/* @__PURE__ */
|
|
2308
|
-
|
|
2470
|
+
}), i = e.componentModel.properties, s = U(i.label);
|
|
2471
|
+
return /* @__PURE__ */ M("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2472
|
+
s ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: s }) : null,
|
|
2473
|
+
/* @__PURE__ */ u(
|
|
2474
|
+
Dn,
|
|
2309
2475
|
{
|
|
2310
2476
|
disabled: !t,
|
|
2311
2477
|
className: "form-block-preview-control",
|
|
2312
|
-
checked:
|
|
2478
|
+
checked: Te(n),
|
|
2313
2479
|
onChange: (a) => r(a)
|
|
2314
2480
|
}
|
|
2315
2481
|
)
|
|
2316
2482
|
] });
|
|
2317
2483
|
}
|
|
2318
|
-
const
|
|
2319
|
-
{ name: "CheckBox", schema:
|
|
2320
|
-
|
|
2484
|
+
const Ti = X(
|
|
2485
|
+
{ name: "CheckBox", schema: xe("CheckBox") },
|
|
2486
|
+
_i
|
|
2321
2487
|
);
|
|
2322
|
-
function
|
|
2323
|
-
const r =
|
|
2488
|
+
function xi(e, t, n) {
|
|
2489
|
+
const r = ve(e);
|
|
2324
2490
|
if (!r) return;
|
|
2325
2491
|
if (!t && n) {
|
|
2326
|
-
const i =
|
|
2492
|
+
const i = jt(r, "HH:mm", !0);
|
|
2327
2493
|
return i.isValid() ? i : void 0;
|
|
2328
2494
|
}
|
|
2329
|
-
const o =
|
|
2495
|
+
const o = jt(r);
|
|
2330
2496
|
return o.isValid() ? o : void 0;
|
|
2331
2497
|
}
|
|
2332
|
-
function
|
|
2333
|
-
const { interactive: t } =
|
|
2498
|
+
function Mi({ context: e }) {
|
|
2499
|
+
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o, reportFocus: i } = ae(e, "value", {
|
|
2334
2500
|
component: "DateTimeInput",
|
|
2335
2501
|
changeAction: "change"
|
|
2336
|
-
}), s = e.componentModel.properties, a =
|
|
2502
|
+
}), s = e.componentModel.properties, a = U(s.label), l = U(s.placeholder), c = s.enableDate === !0, m = s.enableTime === !0, d = xi(n, c, m), b = (g) => {
|
|
2337
2503
|
if (!g) {
|
|
2338
2504
|
r("");
|
|
2339
2505
|
return;
|
|
2340
2506
|
}
|
|
2341
|
-
if (!
|
|
2507
|
+
if (!c && m) {
|
|
2342
2508
|
r(g.format("HH:mm"));
|
|
2343
2509
|
return;
|
|
2344
2510
|
}
|
|
2345
|
-
if (
|
|
2511
|
+
if (c && m) {
|
|
2346
2512
|
r(g.format("YYYY-MM-DDTHH:mm"));
|
|
2347
2513
|
return;
|
|
2348
2514
|
}
|
|
2349
2515
|
r(g.format("YYYY-MM-DD"));
|
|
2350
2516
|
};
|
|
2351
|
-
return /* @__PURE__ */
|
|
2352
|
-
a ? /* @__PURE__ */
|
|
2353
|
-
!
|
|
2354
|
-
|
|
2517
|
+
return /* @__PURE__ */ M("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2518
|
+
a ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2519
|
+
!c && m ? /* @__PURE__ */ u(
|
|
2520
|
+
Hn,
|
|
2355
2521
|
{
|
|
2356
2522
|
disabled: !t,
|
|
2357
2523
|
className: "form-block-preview-control",
|
|
2358
2524
|
style: { width: "100%" },
|
|
2359
2525
|
placeholder: l || "选择时间",
|
|
2360
2526
|
value: d,
|
|
2361
|
-
onChange:
|
|
2527
|
+
onChange: b,
|
|
2362
2528
|
onFocus: i
|
|
2363
2529
|
}
|
|
2364
|
-
) : /* @__PURE__ */
|
|
2365
|
-
|
|
2530
|
+
) : /* @__PURE__ */ u(
|
|
2531
|
+
Kn,
|
|
2366
2532
|
{
|
|
2367
|
-
showTime:
|
|
2533
|
+
showTime: c && m,
|
|
2368
2534
|
disabled: !t,
|
|
2369
2535
|
className: "form-block-preview-control",
|
|
2370
2536
|
style: { width: "100%" },
|
|
2371
|
-
placeholder: l || (
|
|
2537
|
+
placeholder: l || (c && m ? "选择日期时间" : "选择日期"),
|
|
2372
2538
|
value: d,
|
|
2373
|
-
onChange:
|
|
2539
|
+
onChange: b,
|
|
2374
2540
|
onFocus: i
|
|
2375
2541
|
}
|
|
2376
2542
|
)
|
|
2377
2543
|
] });
|
|
2378
2544
|
}
|
|
2379
|
-
const
|
|
2545
|
+
const Ni = X(
|
|
2380
2546
|
{
|
|
2381
2547
|
name: "DateTimeInput",
|
|
2382
2548
|
schema: h.object({
|
|
@@ -2389,8 +2555,8 @@ const ki = Q(
|
|
|
2389
2555
|
max: h.any().optional()
|
|
2390
2556
|
}).passthrough()
|
|
2391
2557
|
},
|
|
2392
|
-
|
|
2393
|
-
),
|
|
2558
|
+
Mi
|
|
2559
|
+
), Ii = {
|
|
2394
2560
|
name: "FileUpload",
|
|
2395
2561
|
schema: h.object({
|
|
2396
2562
|
label: h.any().optional(),
|
|
@@ -2402,141 +2568,141 @@ const ki = Q(
|
|
|
2402
2568
|
value: h.any().optional()
|
|
2403
2569
|
}).passthrough()
|
|
2404
2570
|
};
|
|
2405
|
-
function
|
|
2406
|
-
const { interactive: t } =
|
|
2571
|
+
function Fi({ context: e }) {
|
|
2572
|
+
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o } = ae(e, "value", {
|
|
2407
2573
|
component: "FileUpload",
|
|
2408
2574
|
changeAction: "change"
|
|
2409
|
-
}), i = e.componentModel.properties, s =
|
|
2575
|
+
}), i = e.componentModel.properties, s = U(i.label), a = U(i.accept), l = Array.isArray(i.fileAcceptTypes) ? i.fileAcceptTypes.map(String) : void 0, c = a ? a.split(",").map((f) => f.trim()).filter(Boolean) : void 0, m = yr(l, c), d = typeof i.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
|
|
2410
2576
|
i.filePlaceholderIcon
|
|
2411
|
-
) ? i.filePlaceholderIcon : "document",
|
|
2412
|
-
return /* @__PURE__ */
|
|
2413
|
-
s ? /* @__PURE__ */
|
|
2414
|
-
/* @__PURE__ */
|
|
2415
|
-
|
|
2577
|
+
) ? i.filePlaceholderIcon : "document", b = typeof i.minCount == "number" ? Math.max(0, i.minCount) : 0, g = typeof i.maxCount == "number" ? i.maxCount : 1, S = g > 0, y = Q(n), k = S && y.length >= g, p = y.length < b;
|
|
2578
|
+
return /* @__PURE__ */ M("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2579
|
+
s ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: s }) : null,
|
|
2580
|
+
/* @__PURE__ */ M(
|
|
2581
|
+
Ye.Dragger,
|
|
2416
2582
|
{
|
|
2417
2583
|
disabled: !t || k,
|
|
2418
|
-
accept:
|
|
2584
|
+
accept: gr(l, c),
|
|
2419
2585
|
className: "form-file-upload-preview",
|
|
2420
2586
|
showUploadList: t && y.length > 0,
|
|
2421
|
-
fileList: t ? y.map((
|
|
2422
|
-
uid: `${v}-${
|
|
2423
|
-
name:
|
|
2587
|
+
fileList: t ? y.map((f, v) => ({
|
|
2588
|
+
uid: `${v}-${f}`,
|
|
2589
|
+
name: f,
|
|
2424
2590
|
status: "done"
|
|
2425
2591
|
})) : [],
|
|
2426
|
-
beforeUpload: (
|
|
2427
|
-
if (!t) return
|
|
2428
|
-
const v =
|
|
2429
|
-
if (
|
|
2430
|
-
const x =
|
|
2592
|
+
beforeUpload: (f) => {
|
|
2593
|
+
if (!t) return Ye.LIST_IGNORE;
|
|
2594
|
+
const v = Q(Ht(e));
|
|
2595
|
+
if (S && v.length >= g) return Ye.LIST_IGNORE;
|
|
2596
|
+
const x = S ? [...v, f.name].slice(0, g) : [...v, f.name];
|
|
2431
2597
|
return r(x), !1;
|
|
2432
2598
|
},
|
|
2433
|
-
onRemove: (
|
|
2434
|
-
const v =
|
|
2435
|
-
if (_.length <
|
|
2599
|
+
onRemove: (f) => {
|
|
2600
|
+
const v = Q(Ht(e)), x = /^(\d+)-/.exec(f.uid ?? ""), N = x ? Number(x[1]) : -1, _ = N >= 0 && N < v.length ? v.filter((w, C) => C !== N) : v.filter((w) => w !== f.name);
|
|
2601
|
+
if (_.length < b) return !1;
|
|
2436
2602
|
r(_);
|
|
2437
2603
|
},
|
|
2438
2604
|
children: [
|
|
2439
|
-
/* @__PURE__ */
|
|
2440
|
-
/* @__PURE__ */
|
|
2605
|
+
/* @__PURE__ */ u("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ u(mi, { type: d, size: 40 }) }),
|
|
2606
|
+
/* @__PURE__ */ u("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
|
|
2441
2607
|
]
|
|
2442
2608
|
}
|
|
2443
2609
|
),
|
|
2444
|
-
/* @__PURE__ */
|
|
2610
|
+
/* @__PURE__ */ M(ne.Text, { type: "secondary", className: "form-block-preview-help", children: [
|
|
2445
2611
|
"允许:",
|
|
2446
2612
|
m ?? "全部类型",
|
|
2447
|
-
|
|
2448
|
-
|
|
2613
|
+
b > 0 ? `;至少 ${b} 个文件` : "",
|
|
2614
|
+
S ? `;最多 ${g} 个文件` : "",
|
|
2449
2615
|
";当前仅收集文件名(不含文件内容,需宿主另行上传)",
|
|
2450
|
-
|
|
2616
|
+
p && t ? `(当前 ${y.length} 个,未达下限)` : ""
|
|
2451
2617
|
] })
|
|
2452
2618
|
] });
|
|
2453
2619
|
}
|
|
2454
|
-
const
|
|
2455
|
-
|
|
2456
|
-
|
|
2620
|
+
const Ei = X(
|
|
2621
|
+
Ii,
|
|
2622
|
+
Fi
|
|
2457
2623
|
);
|
|
2458
|
-
function
|
|
2459
|
-
const { interactive: t } =
|
|
2624
|
+
function Ui({ context: e }) {
|
|
2625
|
+
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o, reportFocus: i } = ae(e, "value", {
|
|
2460
2626
|
component: "TextField",
|
|
2461
2627
|
changeAction: "change",
|
|
2462
2628
|
debounceChange: !0
|
|
2463
|
-
}), s = e.componentModel.properties, a =
|
|
2464
|
-
if (!m || !
|
|
2465
|
-
|
|
2629
|
+
}), s = e.componentModel.properties, a = U(s.label), l = U(s.placeholder), c = U(s.variant) || "shortText", m = U(s.validationRegexp), d = ve(n) ?? "", b = !t, [g, S] = P(""), y = (f) => {
|
|
2630
|
+
if (!m || !f.trim()) {
|
|
2631
|
+
S("");
|
|
2466
2632
|
return;
|
|
2467
2633
|
}
|
|
2468
|
-
|
|
2634
|
+
S(In(f, m) ? "" : "格式不正确");
|
|
2469
2635
|
};
|
|
2470
|
-
|
|
2636
|
+
q(() => {
|
|
2471
2637
|
y(d);
|
|
2472
2638
|
}, [m, d]);
|
|
2473
2639
|
const k = "form-block-preview-control";
|
|
2474
|
-
let
|
|
2475
|
-
if (
|
|
2476
|
-
|
|
2477
|
-
|
|
2640
|
+
let p;
|
|
2641
|
+
if (c === "longText")
|
|
2642
|
+
p = /* @__PURE__ */ u(
|
|
2643
|
+
Qe.TextArea,
|
|
2478
2644
|
{
|
|
2479
|
-
disabled:
|
|
2645
|
+
disabled: b,
|
|
2480
2646
|
className: k,
|
|
2481
2647
|
placeholder: l || "长文本回答...",
|
|
2482
2648
|
autoSize: { minRows: 2, maxRows: 6 },
|
|
2483
2649
|
value: d,
|
|
2484
2650
|
status: g ? "error" : void 0,
|
|
2485
|
-
onChange: (
|
|
2486
|
-
const v =
|
|
2651
|
+
onChange: (f) => {
|
|
2652
|
+
const v = f.target.value;
|
|
2487
2653
|
r(v), y(v);
|
|
2488
2654
|
},
|
|
2489
2655
|
onFocus: i,
|
|
2490
|
-
onBlur: (
|
|
2656
|
+
onBlur: (f) => y(f.target.value)
|
|
2491
2657
|
}
|
|
2492
2658
|
);
|
|
2493
|
-
else if (
|
|
2494
|
-
const
|
|
2495
|
-
|
|
2496
|
-
|
|
2659
|
+
else if (c === "number") {
|
|
2660
|
+
const f = d && Number.isFinite(Number(d)) ? Number(d) : void 0;
|
|
2661
|
+
p = /* @__PURE__ */ u(
|
|
2662
|
+
Jn,
|
|
2497
2663
|
{
|
|
2498
|
-
disabled:
|
|
2664
|
+
disabled: b,
|
|
2499
2665
|
className: k,
|
|
2500
2666
|
style: { width: "100%" },
|
|
2501
2667
|
placeholder: l || "数字",
|
|
2502
|
-
value:
|
|
2668
|
+
value: f,
|
|
2503
2669
|
onChange: (v) => r(v == null ? "" : String(v)),
|
|
2504
2670
|
onFocus: i
|
|
2505
2671
|
}
|
|
2506
2672
|
);
|
|
2507
|
-
} else
|
|
2508
|
-
|
|
2673
|
+
} else c === "obscured" ? p = /* @__PURE__ */ u(
|
|
2674
|
+
Qe.Password,
|
|
2509
2675
|
{
|
|
2510
|
-
disabled:
|
|
2676
|
+
disabled: b,
|
|
2511
2677
|
className: k,
|
|
2512
2678
|
placeholder: l,
|
|
2513
2679
|
value: d,
|
|
2514
|
-
onChange: (
|
|
2680
|
+
onChange: (f) => r(f.target.value),
|
|
2515
2681
|
onFocus: i
|
|
2516
2682
|
}
|
|
2517
|
-
) :
|
|
2518
|
-
|
|
2683
|
+
) : p = /* @__PURE__ */ u(
|
|
2684
|
+
Qe,
|
|
2519
2685
|
{
|
|
2520
|
-
disabled:
|
|
2686
|
+
disabled: b,
|
|
2521
2687
|
className: k,
|
|
2522
2688
|
placeholder: l,
|
|
2523
2689
|
value: d,
|
|
2524
2690
|
status: g ? "error" : void 0,
|
|
2525
|
-
onChange: (
|
|
2526
|
-
const v =
|
|
2691
|
+
onChange: (f) => {
|
|
2692
|
+
const v = f.target.value;
|
|
2527
2693
|
r(v), y(v);
|
|
2528
2694
|
},
|
|
2529
2695
|
onFocus: i,
|
|
2530
|
-
onBlur: (
|
|
2696
|
+
onBlur: (f) => y(f.target.value)
|
|
2531
2697
|
}
|
|
2532
2698
|
);
|
|
2533
|
-
return /* @__PURE__ */
|
|
2534
|
-
a ? /* @__PURE__ */
|
|
2535
|
-
|
|
2536
|
-
g ? /* @__PURE__ */
|
|
2699
|
+
return /* @__PURE__ */ M("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2700
|
+
a ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2701
|
+
p,
|
|
2702
|
+
g ? /* @__PURE__ */ u(ne.Text, { type: "danger", className: "form-block-preview-help", children: g }) : null
|
|
2537
2703
|
] });
|
|
2538
2704
|
}
|
|
2539
|
-
const
|
|
2705
|
+
const Ri = X(
|
|
2540
2706
|
{
|
|
2541
2707
|
name: "TextField",
|
|
2542
2708
|
schema: h.object({
|
|
@@ -2547,37 +2713,37 @@ const xi = Q(
|
|
|
2547
2713
|
value: h.any().optional()
|
|
2548
2714
|
}).passthrough()
|
|
2549
2715
|
},
|
|
2550
|
-
|
|
2716
|
+
Ui
|
|
2551
2717
|
);
|
|
2552
|
-
function
|
|
2553
|
-
const t = e.componentModel.properties, n =
|
|
2554
|
-
return
|
|
2718
|
+
function Pi({ context: e }) {
|
|
2719
|
+
const t = e.componentModel.properties, n = U(t.text), r = U(t.variant) || "body";
|
|
2720
|
+
return fi.has(r) ? r === "caption" ? /* @__PURE__ */ u(ne.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ u("em", { children: n }) }) : /* @__PURE__ */ u(r, { className: "form-block-preview-heading", children: n }) : /* @__PURE__ */ u(ne.Paragraph, { className: "form-block-preview-paragraph", children: n });
|
|
2555
2721
|
}
|
|
2556
|
-
const
|
|
2557
|
-
{ name: "Text", schema:
|
|
2558
|
-
|
|
2722
|
+
const wi = X(
|
|
2723
|
+
{ name: "Text", schema: xe("Text") },
|
|
2724
|
+
Pi
|
|
2559
2725
|
);
|
|
2560
|
-
function
|
|
2726
|
+
function Rn() {
|
|
2561
2727
|
const t = [
|
|
2562
|
-
...[...
|
|
2563
|
-
(r) => !
|
|
2728
|
+
...[...Ue.components.values()].filter(
|
|
2729
|
+
(r) => !di.has(r.name)
|
|
2564
2730
|
),
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
ci,
|
|
2568
|
-
ui,
|
|
2569
|
-
mi,
|
|
2731
|
+
hi,
|
|
2732
|
+
ki,
|
|
2570
2733
|
gi,
|
|
2734
|
+
yi,
|
|
2571
2735
|
vi,
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2736
|
+
Ai,
|
|
2737
|
+
Ti,
|
|
2738
|
+
Ni,
|
|
2739
|
+
Ei,
|
|
2740
|
+
Ri,
|
|
2741
|
+
wi,
|
|
2742
|
+
...vo()
|
|
2743
|
+
], n = [...Ue.functions.values()];
|
|
2744
|
+
return new tr(En, t, n, Ue.themeSchema);
|
|
2745
|
+
}
|
|
2746
|
+
const ie = {
|
|
2581
2747
|
jade9: "#29a383",
|
|
2582
2748
|
jade10: "#26997b",
|
|
2583
2749
|
jade11: "#208368",
|
|
@@ -2589,20 +2755,20 @@ const oe = {
|
|
|
2589
2755
|
primaryHover: "#26997b",
|
|
2590
2756
|
primaryActive: "#1d3b31",
|
|
2591
2757
|
onPrimary: "#ffffff"
|
|
2592
|
-
},
|
|
2758
|
+
}, zi = {
|
|
2593
2759
|
cssVar: { key: "vidtempl" },
|
|
2594
2760
|
token: {
|
|
2595
|
-
colorPrimary:
|
|
2596
|
-
colorPrimaryHover:
|
|
2597
|
-
colorPrimaryActive:
|
|
2598
|
-
colorLink:
|
|
2599
|
-
colorLinkHover:
|
|
2600
|
-
colorSuccess:
|
|
2761
|
+
colorPrimary: ie.primarySolid,
|
|
2762
|
+
colorPrimaryHover: ie.primaryHover,
|
|
2763
|
+
colorPrimaryActive: ie.primaryActive,
|
|
2764
|
+
colorLink: ie.primary,
|
|
2765
|
+
colorLinkHover: ie.primaryHover,
|
|
2766
|
+
colorSuccess: ie.jade9,
|
|
2601
2767
|
colorWarning: "#f5a623",
|
|
2602
2768
|
gold6: "#f5a623",
|
|
2603
2769
|
gold7: "#e6951a",
|
|
2604
2770
|
colorError: "#e5484d",
|
|
2605
|
-
colorInfo:
|
|
2771
|
+
colorInfo: ie.primary,
|
|
2606
2772
|
colorBgLayout: "#f9f9f9",
|
|
2607
2773
|
colorBgContainer: "#ffffff",
|
|
2608
2774
|
colorBgElevated: "#ffffff",
|
|
@@ -2662,7 +2828,7 @@ const oe = {
|
|
|
2662
2828
|
},
|
|
2663
2829
|
Tag: {
|
|
2664
2830
|
defaultBg: "#e6f7ed",
|
|
2665
|
-
defaultColor:
|
|
2831
|
+
defaultColor: ie.primary,
|
|
2666
2832
|
fontSizeSM: 13
|
|
2667
2833
|
},
|
|
2668
2834
|
Form: {
|
|
@@ -2674,14 +2840,14 @@ const oe = {
|
|
|
2674
2840
|
}
|
|
2675
2841
|
}
|
|
2676
2842
|
};
|
|
2677
|
-
function
|
|
2843
|
+
function be({
|
|
2678
2844
|
children: e,
|
|
2679
2845
|
locale: t,
|
|
2680
2846
|
theme: n
|
|
2681
2847
|
}) {
|
|
2682
|
-
return /* @__PURE__ */
|
|
2848
|
+
return /* @__PURE__ */ u(Gn, { theme: n ?? zi, locale: t, children: e });
|
|
2683
2849
|
}
|
|
2684
|
-
const
|
|
2850
|
+
const Oi = Bn(
|
|
2685
2851
|
function({
|
|
2686
2852
|
doc: t,
|
|
2687
2853
|
surfaceId: n = "skopon-form",
|
|
@@ -2691,68 +2857,68 @@ const Fi = wn(
|
|
|
2691
2857
|
resumeSearch: s = null,
|
|
2692
2858
|
caseSearch: a = null,
|
|
2693
2859
|
wrapProvider: l = !0
|
|
2694
|
-
},
|
|
2695
|
-
|
|
2696
|
-
|
|
2860
|
+
}, c) {
|
|
2861
|
+
q(() => {
|
|
2862
|
+
nn(), tn();
|
|
2697
2863
|
}, []);
|
|
2698
2864
|
const m = A(null), d = A(i);
|
|
2699
2865
|
d.current = i;
|
|
2700
|
-
const
|
|
2701
|
-
if (
|
|
2866
|
+
const b = L(() => {
|
|
2867
|
+
if (dt(t)) return "";
|
|
2702
2868
|
try {
|
|
2703
2869
|
return JSON.stringify(t);
|
|
2704
2870
|
} catch {
|
|
2705
2871
|
return String(t);
|
|
2706
2872
|
}
|
|
2707
|
-
}, [t]), g =
|
|
2708
|
-
if (!
|
|
2873
|
+
}, [t]), g = L(() => {
|
|
2874
|
+
if (!b)
|
|
2709
2875
|
return { surfaces: [], processor: null };
|
|
2710
2876
|
try {
|
|
2711
|
-
const
|
|
2877
|
+
const p = JSON.parse(b), f = new en([Rn()]), v = No(p, {
|
|
2712
2878
|
surfaceId: n,
|
|
2713
|
-
catalogId:
|
|
2879
|
+
catalogId: En
|
|
2714
2880
|
});
|
|
2715
|
-
return
|
|
2716
|
-
surfaces: Array.from(
|
|
2717
|
-
processor:
|
|
2881
|
+
return f.processMessages(v), {
|
|
2882
|
+
surfaces: Array.from(f.model.surfacesMap.values()),
|
|
2883
|
+
processor: f
|
|
2718
2884
|
};
|
|
2719
|
-
} catch (
|
|
2720
|
-
return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败",
|
|
2885
|
+
} catch (p) {
|
|
2886
|
+
return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", p), { surfaces: [], processor: null };
|
|
2721
2887
|
}
|
|
2722
|
-
}, [
|
|
2723
|
-
if (m.current = y,
|
|
2724
|
-
|
|
2888
|
+
}, [b, n]), { surfaces: S, processor: y } = g;
|
|
2889
|
+
if (m.current = y, Vn(
|
|
2890
|
+
c,
|
|
2725
2891
|
() => ({
|
|
2726
|
-
getValues(
|
|
2727
|
-
const
|
|
2728
|
-
if (!
|
|
2729
|
-
const v = (
|
|
2730
|
-
return
|
|
2892
|
+
getValues(p) {
|
|
2893
|
+
const f = m.current;
|
|
2894
|
+
if (!f) return {};
|
|
2895
|
+
const v = (p ?? d.current).map((x) => x.trim()).filter(Boolean);
|
|
2896
|
+
return Uo(f, n, v);
|
|
2731
2897
|
},
|
|
2732
|
-
setValues(
|
|
2733
|
-
const
|
|
2734
|
-
if (!
|
|
2735
|
-
const v =
|
|
2898
|
+
setValues(p) {
|
|
2899
|
+
const f = m.current;
|
|
2900
|
+
if (!f) return;
|
|
2901
|
+
const v = f.model.surfacesMap.get(n);
|
|
2736
2902
|
if (v)
|
|
2737
|
-
for (const [x,
|
|
2903
|
+
for (const [x, N] of Object.entries(p)) {
|
|
2738
2904
|
const _ = x.trim();
|
|
2739
|
-
_ && v.dataModel.set(`/${_}`,
|
|
2905
|
+
_ && v.dataModel.set(`/${_}`, N);
|
|
2740
2906
|
}
|
|
2741
2907
|
}
|
|
2742
2908
|
}),
|
|
2743
2909
|
[n]
|
|
2744
|
-
),
|
|
2745
|
-
const
|
|
2746
|
-
return l ? /* @__PURE__ */
|
|
2910
|
+
), S.length === 0) {
|
|
2911
|
+
const p = /* @__PURE__ */ u(ct, { resumeSearch: s, children: /* @__PURE__ */ u(lt, { caseSearch: a, children: /* @__PURE__ */ u(at, { interactive: o, children: r }) }) });
|
|
2912
|
+
return l ? /* @__PURE__ */ u(be, { children: p }) : p;
|
|
2747
2913
|
}
|
|
2748
|
-
const k = /* @__PURE__ */
|
|
2749
|
-
return l ? /* @__PURE__ */
|
|
2914
|
+
const k = /* @__PURE__ */ u(ct, { resumeSearch: s, children: /* @__PURE__ */ u(lt, { caseSearch: a, children: /* @__PURE__ */ u(at, { interactive: o, children: /* @__PURE__ */ u("div", { className: "a2ui-surface a2ui-container", children: S.map((p) => /* @__PURE__ */ u(Zt, { surface: p }, p.id)) }) }) }) });
|
|
2915
|
+
return l ? /* @__PURE__ */ u(be, { children: k }) : k;
|
|
2750
2916
|
}
|
|
2751
2917
|
);
|
|
2752
|
-
function
|
|
2753
|
-
return new
|
|
2918
|
+
function Ee() {
|
|
2919
|
+
return new en([Rn()]);
|
|
2754
2920
|
}
|
|
2755
|
-
function
|
|
2921
|
+
function Cs({
|
|
2756
2922
|
messages: e,
|
|
2757
2923
|
surfaceId: t = "skopon-form-stream",
|
|
2758
2924
|
emptyHint: n = null,
|
|
@@ -2760,84 +2926,84 @@ function us({
|
|
|
2760
2926
|
resumeSearch: o = null,
|
|
2761
2927
|
caseSearch: i = null
|
|
2762
2928
|
}) {
|
|
2763
|
-
|
|
2764
|
-
|
|
2929
|
+
q(() => {
|
|
2930
|
+
nn(), tn();
|
|
2765
2931
|
}, []);
|
|
2766
2932
|
const s = A(null);
|
|
2767
|
-
s.current === null && (s.current =
|
|
2768
|
-
const a = A(0), l = A(""),
|
|
2769
|
-
function d(
|
|
2770
|
-
s.current =
|
|
2933
|
+
s.current === null && (s.current = Ee());
|
|
2934
|
+
const a = A(0), l = A(""), c = A(!0), m = A(t);
|
|
2935
|
+
function d(p, f) {
|
|
2936
|
+
s.current = p, a.current = f.length, l.current = JSON.stringify(f), c.current && (S(p), k(Array.from(p.model.surfacesMap.values())));
|
|
2771
2937
|
}
|
|
2772
|
-
function
|
|
2773
|
-
if (
|
|
2774
|
-
const v = JSON.stringify(
|
|
2938
|
+
function b(p, f) {
|
|
2939
|
+
if (f <= 0) return !1;
|
|
2940
|
+
const v = JSON.stringify(p.slice(0, f)), x = l.current;
|
|
2775
2941
|
if (!x) return !0;
|
|
2776
2942
|
try {
|
|
2777
|
-
const
|
|
2778
|
-
return JSON.stringify(
|
|
2943
|
+
const N = JSON.parse(x);
|
|
2944
|
+
return JSON.stringify(N.slice(0, f)) !== v;
|
|
2779
2945
|
} catch {
|
|
2780
2946
|
return !0;
|
|
2781
2947
|
}
|
|
2782
2948
|
}
|
|
2783
|
-
const [g,
|
|
2949
|
+
const [g, S] = P(
|
|
2784
2950
|
() => s.current
|
|
2785
|
-
), [y, k] =
|
|
2951
|
+
), [y, k] = P(
|
|
2786
2952
|
() => Array.from(
|
|
2787
2953
|
s.current.model.surfacesMap.values()
|
|
2788
2954
|
)
|
|
2789
2955
|
);
|
|
2790
|
-
return
|
|
2791
|
-
|
|
2792
|
-
}), []),
|
|
2956
|
+
return q(() => (c.current = !0, () => {
|
|
2957
|
+
c.current = !1;
|
|
2958
|
+
}), []), q(() => {
|
|
2793
2959
|
s.current = g;
|
|
2794
|
-
}, [g]),
|
|
2795
|
-
const
|
|
2796
|
-
|
|
2797
|
-
},
|
|
2960
|
+
}, [g]), q(() => {
|
|
2961
|
+
const p = () => {
|
|
2962
|
+
c.current && k(Array.from(g.model.surfacesMap.values()));
|
|
2963
|
+
}, f = g.onSurfaceCreated(p), v = g.onSurfaceDeleted(p);
|
|
2798
2964
|
return () => {
|
|
2799
|
-
|
|
2965
|
+
f.unsubscribe(), v.unsubscribe();
|
|
2800
2966
|
};
|
|
2801
|
-
}, [g]),
|
|
2802
|
-
let
|
|
2803
|
-
const
|
|
2804
|
-
if (m.current = t,
|
|
2805
|
-
const _ =
|
|
2806
|
-
return Array.isArray(e) && e.length > 0 ? (_.processMessages(e),
|
|
2807
|
-
|
|
2967
|
+
}, [g]), q(() => {
|
|
2968
|
+
let p = !1;
|
|
2969
|
+
const f = m.current !== t;
|
|
2970
|
+
if (m.current = t, f) {
|
|
2971
|
+
const _ = Ee();
|
|
2972
|
+
return Array.isArray(e) && e.length > 0 ? (_.processMessages(e), p || d(_, e)) : (s.current = _, a.current = 0, l.current = "", p || (S(_), k([]))), () => {
|
|
2973
|
+
p = !0;
|
|
2808
2974
|
};
|
|
2809
2975
|
}
|
|
2810
2976
|
if (!Array.isArray(e) || e.length === 0) {
|
|
2811
2977
|
if (a.current > 0) {
|
|
2812
|
-
const _ =
|
|
2813
|
-
s.current = _, a.current = 0, l.current = "",
|
|
2978
|
+
const _ = Ee();
|
|
2979
|
+
s.current = _, a.current = 0, l.current = "", p || (S(_), k([]));
|
|
2814
2980
|
}
|
|
2815
2981
|
return () => {
|
|
2816
|
-
|
|
2982
|
+
p = !0;
|
|
2817
2983
|
};
|
|
2818
2984
|
}
|
|
2819
2985
|
const v = s.current, x = a.current;
|
|
2820
|
-
if (e.length < x ||
|
|
2821
|
-
const _ =
|
|
2822
|
-
return _.processMessages(e),
|
|
2823
|
-
|
|
2986
|
+
if (e.length < x || b(e, x)) {
|
|
2987
|
+
const _ = Ee();
|
|
2988
|
+
return _.processMessages(e), p || d(_, e), () => {
|
|
2989
|
+
p = !0;
|
|
2824
2990
|
};
|
|
2825
2991
|
}
|
|
2826
|
-
const
|
|
2827
|
-
return
|
|
2828
|
-
|
|
2829
|
-
} : (v.processMessages(
|
|
2830
|
-
|
|
2992
|
+
const N = e.slice(x);
|
|
2993
|
+
return N.length === 0 ? () => {
|
|
2994
|
+
p = !0;
|
|
2995
|
+
} : (v.processMessages(N), a.current = e.length, l.current = JSON.stringify(e), p || k(Array.from(v.model.surfacesMap.values())), () => {
|
|
2996
|
+
p = !0;
|
|
2831
2997
|
});
|
|
2832
|
-
}, [e, t]), y.length === 0 ? /* @__PURE__ */
|
|
2998
|
+
}, [e, t]), y.length === 0 ? /* @__PURE__ */ u(be, { children: n }) : /* @__PURE__ */ u(be, { children: /* @__PURE__ */ u(ct, { resumeSearch: o, children: /* @__PURE__ */ u(lt, { caseSearch: i, children: /* @__PURE__ */ u(at, { interactive: r, children: /* @__PURE__ */ u("div", { className: "a2ui-surface a2ui-container", children: y.map((p) => /* @__PURE__ */ u(Zt, { surface: p }, p.id)) }) }) }) }) });
|
|
2833
2999
|
}
|
|
2834
|
-
const
|
|
2835
|
-
function
|
|
3000
|
+
const qi = 100, Bi = 3e4, Vi = 1500, me = /* @__PURE__ */ new Map();
|
|
3001
|
+
function Li(e) {
|
|
2836
3002
|
const t = e.trim();
|
|
2837
|
-
let n =
|
|
2838
|
-
return n || (n = new
|
|
3003
|
+
let n = me.get(t);
|
|
3004
|
+
return n || (n = new ji(t), me.set(t, n)), n.acquire(), n;
|
|
2839
3005
|
}
|
|
2840
|
-
class
|
|
3006
|
+
class ji {
|
|
2841
3007
|
constructor(t) {
|
|
2842
3008
|
G(this, "url");
|
|
2843
3009
|
G(this, "ws", null);
|
|
@@ -2855,12 +3021,12 @@ class Pi {
|
|
|
2855
3021
|
}
|
|
2856
3022
|
release() {
|
|
2857
3023
|
this.refCount = Math.max(0, this.refCount - 1), !(this.refCount > 0) && (this.clearReleaseTimer(), this.releaseTimer = setTimeout(() => {
|
|
2858
|
-
this.releaseTimer = null, !(this.refCount > 0) && (this.teardown(),
|
|
2859
|
-
},
|
|
3024
|
+
this.releaseTimer = null, !(this.refCount > 0) && (this.teardown(), me.get(this.url) === this && me.delete(this.url));
|
|
3025
|
+
}, Vi));
|
|
2860
3026
|
}
|
|
2861
3027
|
/** 强制关闭(测试用),跳过宽限期。 */
|
|
2862
3028
|
forceClose() {
|
|
2863
|
-
this.refCount = 0, this.teardown(),
|
|
3029
|
+
this.refCount = 0, this.teardown(), me.get(this.url) === this && me.delete(this.url);
|
|
2864
3030
|
}
|
|
2865
3031
|
subscribe(t, n) {
|
|
2866
3032
|
const r = t.trim();
|
|
@@ -2929,7 +3095,7 @@ class Pi {
|
|
|
2929
3095
|
}
|
|
2930
3096
|
}
|
|
2931
3097
|
enqueue(t) {
|
|
2932
|
-
for (this.sendQueue.push(t); this.sendQueue.length >
|
|
3098
|
+
for (this.sendQueue.push(t); this.sendQueue.length > qi; )
|
|
2933
3099
|
this.sendQueue.shift();
|
|
2934
3100
|
}
|
|
2935
3101
|
flushQueue() {
|
|
@@ -2943,7 +3109,7 @@ class Pi {
|
|
|
2943
3109
|
if (!this.connectRequested || this.refCount <= 0) return;
|
|
2944
3110
|
this.clearReconnectTimer();
|
|
2945
3111
|
const t = Math.min(
|
|
2946
|
-
|
|
3112
|
+
Bi,
|
|
2947
3113
|
1e3 * 2 ** Math.min(this.reconnectAttempt, 5)
|
|
2948
3114
|
);
|
|
2949
3115
|
this.reconnectAttempt += 1, this.reconnectTimer = setTimeout(() => {
|
|
@@ -2981,13 +3147,13 @@ class Pi {
|
|
|
2981
3147
|
}
|
|
2982
3148
|
}
|
|
2983
3149
|
}
|
|
2984
|
-
class
|
|
3150
|
+
class $i {
|
|
2985
3151
|
constructor(t) {
|
|
2986
3152
|
G(this, "askUserMessageId");
|
|
2987
3153
|
G(this, "connection");
|
|
2988
3154
|
G(this, "unsubscribe");
|
|
2989
3155
|
G(this, "closed", !1);
|
|
2990
|
-
this.askUserMessageId = t.askUserMessageId.trim(), this.connection =
|
|
3156
|
+
this.askUserMessageId = t.askUserMessageId.trim(), this.connection = Li(t.url);
|
|
2991
3157
|
const n = t.onAutoControl;
|
|
2992
3158
|
this.unsubscribe = n ? this.connection.subscribe(this.askUserMessageId, n) : () => {
|
|
2993
3159
|
};
|
|
@@ -3002,24 +3168,24 @@ class zi {
|
|
|
3002
3168
|
this.closed || (this.closed = !0, this.unsubscribe(), this.connection.release());
|
|
3003
3169
|
}
|
|
3004
3170
|
}
|
|
3005
|
-
function
|
|
3171
|
+
function Pn(e) {
|
|
3006
3172
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
3007
3173
|
}
|
|
3008
|
-
function
|
|
3174
|
+
function Di(e, t) {
|
|
3009
3175
|
if (!e) return !1;
|
|
3010
|
-
const n = e.querySelector(`[data-skopon-field="${
|
|
3176
|
+
const n = e.querySelector(`[data-skopon-field="${Pn(t)}"]`);
|
|
3011
3177
|
return n instanceof HTMLElement ? ((n.querySelector(
|
|
3012
3178
|
'input, textarea, select, button, [tabindex]:not([tabindex="-1"])'
|
|
3013
3179
|
) ?? n).focus(), !0) : !1;
|
|
3014
3180
|
}
|
|
3015
|
-
function
|
|
3181
|
+
function Hi(e, t) {
|
|
3016
3182
|
if (!e) return !1;
|
|
3017
|
-
const n = e.querySelector(`[data-skopon-field="${
|
|
3183
|
+
const n = e.querySelector(`[data-skopon-field="${Pn(t)}"]`);
|
|
3018
3184
|
return n instanceof HTMLElement ? ((n.querySelector(
|
|
3019
3185
|
'button, [role="button"], .skopon-resume-select-card, input, label'
|
|
3020
3186
|
) ?? n).click(), !0) : !1;
|
|
3021
3187
|
}
|
|
3022
|
-
function
|
|
3188
|
+
function Ki(e, t, n) {
|
|
3023
3189
|
const r = e.action;
|
|
3024
3190
|
if (r !== "change" && r !== "select" && r !== "focus" && r !== "click" && r !== "submit") {
|
|
3025
3191
|
console.warn("[FormAutoControl] unknown action", r);
|
|
@@ -3049,47 +3215,47 @@ function Bi(e, t, n) {
|
|
|
3049
3215
|
return;
|
|
3050
3216
|
}
|
|
3051
3217
|
if (r === "focus") {
|
|
3052
|
-
|
|
3218
|
+
Di(t.rootElement, o), n.reportEvent({
|
|
3053
3219
|
action: "focus",
|
|
3054
3220
|
component: i,
|
|
3055
3221
|
field: o
|
|
3056
3222
|
});
|
|
3057
3223
|
return;
|
|
3058
3224
|
}
|
|
3059
|
-
|
|
3225
|
+
Hi(t.rootElement, o) || console.warn("[FormAutoControl] click target not found", o);
|
|
3060
3226
|
});
|
|
3061
3227
|
}
|
|
3062
|
-
function
|
|
3228
|
+
function Ji(e) {
|
|
3063
3229
|
const t = {};
|
|
3064
3230
|
for (const [n, r] of Object.entries(e))
|
|
3065
3231
|
r !== void 0 && (t[n] = r);
|
|
3066
3232
|
return t;
|
|
3067
3233
|
}
|
|
3068
|
-
function
|
|
3234
|
+
function Gi(e, t) {
|
|
3069
3235
|
var o;
|
|
3070
3236
|
const n = (o = e.name) == null ? void 0 : o.trim();
|
|
3071
3237
|
if (!n || !t) return { ...e };
|
|
3072
3238
|
const r = t.get(n);
|
|
3073
3239
|
return r ? e.type !== "resume_multiselect" && e.type !== "case_multiselect" ? { ...e } : { ...e, options: r.map((i) => ({ ...i })) } : { ...e };
|
|
3074
3240
|
}
|
|
3075
|
-
function
|
|
3241
|
+
function Wi(e) {
|
|
3076
3242
|
var i, s;
|
|
3077
3243
|
const n = {
|
|
3078
3244
|
blocks: (e.blocks ?? []).map(
|
|
3079
|
-
(a) =>
|
|
3245
|
+
(a) => Gi(a, e.liveOptions)
|
|
3080
3246
|
)
|
|
3081
3247
|
}, r = (i = e.title) == null ? void 0 : i.trim(), o = (s = e.description) == null ? void 0 : s.trim();
|
|
3082
3248
|
return r && (n.title = r), o && (n.description = o), {
|
|
3083
3249
|
form_schema: n,
|
|
3084
|
-
form_values:
|
|
3250
|
+
form_values: Ji(e.values ?? {}),
|
|
3085
3251
|
form_change: [...e.formChange ?? []]
|
|
3086
3252
|
};
|
|
3087
3253
|
}
|
|
3088
|
-
function
|
|
3089
|
-
const t =
|
|
3090
|
-
return t ?
|
|
3254
|
+
function Yi(e) {
|
|
3255
|
+
const t = Ve(e);
|
|
3256
|
+
return t ? ze(t.blocks) : e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
3091
3257
|
}
|
|
3092
|
-
function
|
|
3258
|
+
function Qi({
|
|
3093
3259
|
payload: e,
|
|
3094
3260
|
callbackUrl: t,
|
|
3095
3261
|
title: n,
|
|
@@ -3099,70 +3265,70 @@ function Di({
|
|
|
3099
3265
|
submitHeaders: s,
|
|
3100
3266
|
onNotify: a
|
|
3101
3267
|
}) {
|
|
3102
|
-
const [l,
|
|
3103
|
-
|
|
3268
|
+
const [l, c] = P(!1), m = A(!0);
|
|
3269
|
+
q(() => (m.current = !0, () => {
|
|
3104
3270
|
m.current = !1;
|
|
3105
3271
|
}), []);
|
|
3106
|
-
const d =
|
|
3107
|
-
() =>
|
|
3272
|
+
const d = L(
|
|
3273
|
+
() => Tt(s),
|
|
3108
3274
|
[s]
|
|
3109
|
-
),
|
|
3110
|
-
() =>
|
|
3275
|
+
), b = L(
|
|
3276
|
+
() => An(e, t, d),
|
|
3111
3277
|
[e, t, d]
|
|
3112
|
-
), g =
|
|
3278
|
+
), g = L(
|
|
3113
3279
|
() => ({
|
|
3114
3280
|
...i,
|
|
3115
3281
|
callbackUrl: (i == null ? void 0 : i.callbackUrl) ?? t ?? null
|
|
3116
3282
|
}),
|
|
3117
3283
|
[i, t]
|
|
3118
3284
|
);
|
|
3119
|
-
async function
|
|
3285
|
+
async function S() {
|
|
3120
3286
|
if (!l) {
|
|
3121
|
-
|
|
3287
|
+
c(!0);
|
|
3122
3288
|
try {
|
|
3123
|
-
const y =
|
|
3289
|
+
const y = Yi(e), k = Mt({
|
|
3124
3290
|
context: g,
|
|
3125
3291
|
payload: e,
|
|
3126
3292
|
answer: y
|
|
3127
|
-
}),
|
|
3293
|
+
}), p = await Nn(k, {
|
|
3128
3294
|
headers: d
|
|
3129
3295
|
});
|
|
3130
3296
|
if (!m.current) return;
|
|
3131
|
-
const
|
|
3132
|
-
a == null || a(
|
|
3297
|
+
const f = Mn(p);
|
|
3298
|
+
a == null || a(f.type, f.message);
|
|
3133
3299
|
} catch (y) {
|
|
3134
3300
|
if (!m.current) return;
|
|
3135
3301
|
const k = y instanceof Error ? y.message : "提交失败";
|
|
3136
3302
|
a == null || a("error", k);
|
|
3137
3303
|
} finally {
|
|
3138
|
-
m.current &&
|
|
3304
|
+
m.current && c(!1);
|
|
3139
3305
|
}
|
|
3140
3306
|
}
|
|
3141
3307
|
}
|
|
3142
|
-
return /* @__PURE__ */
|
|
3143
|
-
/* @__PURE__ */
|
|
3144
|
-
/* @__PURE__ */
|
|
3145
|
-
/* @__PURE__ */
|
|
3146
|
-
r ? /* @__PURE__ */
|
|
3147
|
-
o ? /* @__PURE__ */
|
|
3308
|
+
return /* @__PURE__ */ M("div", { className: "ask-user-curl-card", children: [
|
|
3309
|
+
/* @__PURE__ */ M("div", { className: "ask-user-curl-card-header", children: [
|
|
3310
|
+
/* @__PURE__ */ M("div", { className: "ask-user-curl-card-header-title", children: [
|
|
3311
|
+
/* @__PURE__ */ u(ne.Text, { type: "secondary", children: n ?? "curl 命令" }),
|
|
3312
|
+
r ? /* @__PURE__ */ u(he, { title: r, children: /* @__PURE__ */ u(ge, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
|
|
3313
|
+
o ? /* @__PURE__ */ u(he, { title: o, children: /* @__PURE__ */ u(ge, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
|
|
3148
3314
|
] }),
|
|
3149
|
-
/* @__PURE__ */
|
|
3150
|
-
|
|
3315
|
+
/* @__PURE__ */ u(he, { title: "提交到 answer_agent_callback_url", children: /* @__PURE__ */ u(
|
|
3316
|
+
Oe,
|
|
3151
3317
|
{
|
|
3152
3318
|
size: "small",
|
|
3153
3319
|
type: "text",
|
|
3154
3320
|
loading: l,
|
|
3155
3321
|
disabled: l,
|
|
3156
|
-
onClick: () => void
|
|
3322
|
+
onClick: () => void S(),
|
|
3157
3323
|
children: "提交"
|
|
3158
3324
|
}
|
|
3159
3325
|
) })
|
|
3160
3326
|
] }),
|
|
3161
|
-
/* @__PURE__ */
|
|
3327
|
+
/* @__PURE__ */ u("pre", { className: "skopon-form-curl-json", children: b })
|
|
3162
3328
|
] });
|
|
3163
3329
|
}
|
|
3164
|
-
const
|
|
3165
|
-
function
|
|
3330
|
+
const Xi = 80;
|
|
3331
|
+
function Zi(e, t) {
|
|
3166
3332
|
if (t && typeof t == "object" && t !== null && "message" in t) {
|
|
3167
3333
|
const n = t.message;
|
|
3168
3334
|
if (typeof n == "string" && n.trim())
|
|
@@ -3170,7 +3336,7 @@ function Ki(e, t) {
|
|
|
3170
3336
|
}
|
|
3171
3337
|
return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
|
|
3172
3338
|
}
|
|
3173
|
-
function
|
|
3339
|
+
function es({
|
|
3174
3340
|
payload: e,
|
|
3175
3341
|
formUniqueId: t,
|
|
3176
3342
|
askUserMessageId: n,
|
|
@@ -3180,250 +3346,258 @@ function Gi({
|
|
|
3180
3346
|
submitHeaders: s,
|
|
3181
3347
|
fetchFormDetail: a,
|
|
3182
3348
|
onNotify: l,
|
|
3183
|
-
resumeSearch:
|
|
3349
|
+
resumeSearch: c = null,
|
|
3184
3350
|
caseSearch: m = null,
|
|
3185
3351
|
onSurfaceReadyChange: d,
|
|
3186
|
-
onAutoControlReady:
|
|
3352
|
+
onAutoControlReady: b
|
|
3187
3353
|
}) {
|
|
3188
|
-
const [g,
|
|
3354
|
+
const [g, S] = P(null), [y, k] = P(!1), [p, f] = P(!0), [v, x] = P(!1), N = A(null), _ = A(null), w = A(!0), C = A(l);
|
|
3189
3355
|
C.current = l;
|
|
3190
|
-
const
|
|
3191
|
-
() =>
|
|
3356
|
+
const B = un(), V = gt(), re = A(""), K = A(null), $ = (t == null ? void 0 : t.trim()) ?? "", W = (n == null ? void 0 : n.trim()) ?? "", ee = L(
|
|
3357
|
+
() => Tt(s),
|
|
3192
3358
|
[s]
|
|
3193
|
-
),
|
|
3359
|
+
), te = L(
|
|
3194
3360
|
() => ({
|
|
3195
3361
|
...i,
|
|
3196
3362
|
callbackUrl: (i == null ? void 0 : i.callbackUrl) ?? r ?? null
|
|
3197
3363
|
}),
|
|
3198
3364
|
[i, r]
|
|
3199
3365
|
);
|
|
3200
|
-
|
|
3366
|
+
q(() => (w.current = !0, () => {
|
|
3201
3367
|
w.current = !1, K.current != null && (clearTimeout(K.current), K.current = null);
|
|
3202
|
-
}), []),
|
|
3203
|
-
let
|
|
3204
|
-
return
|
|
3205
|
-
|
|
3206
|
-
}).catch((
|
|
3207
|
-
var
|
|
3208
|
-
if (!
|
|
3209
|
-
k(!1),
|
|
3210
|
-
const
|
|
3211
|
-
(
|
|
3368
|
+
}), []), q(() => {
|
|
3369
|
+
let F = !1;
|
|
3370
|
+
return $ ? (f(!0), k(!1), a({ formUniqueId: $ }).then((O) => {
|
|
3371
|
+
F || (k(!!O.disabled), S(O.formDefinition ?? null));
|
|
3372
|
+
}).catch((O) => {
|
|
3373
|
+
var J;
|
|
3374
|
+
if (!F) {
|
|
3375
|
+
k(!1), S(null);
|
|
3376
|
+
const Ie = O instanceof Error ? O.message : "获取表单定义失败";
|
|
3377
|
+
(J = C.current) == null || J.call(C, "error", Ie);
|
|
3212
3378
|
}
|
|
3213
3379
|
}).finally(() => {
|
|
3214
|
-
|
|
3380
|
+
F || f(!1);
|
|
3215
3381
|
}), () => {
|
|
3216
|
-
|
|
3217
|
-
}) : (
|
|
3218
|
-
|
|
3382
|
+
F = !0;
|
|
3383
|
+
}) : (f(!1), k(!1), S(null), () => {
|
|
3384
|
+
F = !0;
|
|
3219
3385
|
});
|
|
3220
|
-
}, [
|
|
3221
|
-
const
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3386
|
+
}, [$, a]);
|
|
3387
|
+
const E = L(() => Ve(e), [e]), R = L(() => E ? Oo(E, g ?? void 0) : null, [E, g]), T = (R == null ? void 0 : R.matchedBlocks) ?? [], D = !!(E && qo(E) && T.length === 0), z = L(() => D && E ? Bo(E) : R && R.renderBlocks.length > 0 ? R.renderBlocks : [], [R, D, E]), I = L(() => {
|
|
3388
|
+
if (D && E)
|
|
3389
|
+
return Vo(E);
|
|
3390
|
+
const F = ze((R == null ? void 0 : R.extraBlocks) ?? []);
|
|
3391
|
+
return { ...ze(
|
|
3392
|
+
((R == null ? void 0 : R.matchedBlocks) ?? []).filter(
|
|
3393
|
+
(J) => J.type === "text" && J.hidden === !0
|
|
3394
|
+
)
|
|
3395
|
+
), ...F };
|
|
3396
|
+
}, [D, E, R]), Y = L(
|
|
3397
|
+
() => z.filter((F) => {
|
|
3398
|
+
var O;
|
|
3399
|
+
return (O = F.name) == null ? void 0 : O.trim();
|
|
3400
|
+
}).map((F) => F.name.trim()),
|
|
3401
|
+
[z]
|
|
3402
|
+
), Me = (R == null ? void 0 : R.title) ?? (E == null ? void 0 : E.title) ?? "", Ne = (R == null ? void 0 : R.description) ?? (E == null ? void 0 : E.description) ?? "", ce = L(() => z.length === 0 ? null : Fo(
|
|
3403
|
+
{ title: Me, description: Ne },
|
|
3404
|
+
z
|
|
3405
|
+
), [Me, Ne, z]), $e = L(() => {
|
|
3406
|
+
if (!ce) return "";
|
|
3232
3407
|
try {
|
|
3233
|
-
return JSON.stringify(
|
|
3408
|
+
return JSON.stringify(ce);
|
|
3234
3409
|
} catch {
|
|
3235
|
-
return String(
|
|
3410
|
+
return String(ce);
|
|
3236
3411
|
}
|
|
3237
|
-
}, [
|
|
3238
|
-
|
|
3239
|
-
const It =
|
|
3240
|
-
var
|
|
3241
|
-
return { ...((
|
|
3242
|
-
}, [
|
|
3243
|
-
|
|
3244
|
-
const
|
|
3245
|
-
|
|
3246
|
-
const
|
|
3247
|
-
(
|
|
3248
|
-
const
|
|
3249
|
-
title:
|
|
3250
|
-
description:
|
|
3251
|
-
blocks:
|
|
3412
|
+
}, [ce]), De = $ ? `ask-user-${$}` : "ask-user-payload", oe = !!(!p && E && z.length > 0 && ce);
|
|
3413
|
+
q(() => (d(oe), () => d(!1)), [oe, d]);
|
|
3414
|
+
const It = j(() => {
|
|
3415
|
+
var O;
|
|
3416
|
+
return { ...((O = N.current) == null ? void 0 : O.getValues(Y)) ?? {}, ...I };
|
|
3417
|
+
}, [Y, I]), Ft = A(V.liveOptions);
|
|
3418
|
+
Ft.current = V.liveOptions;
|
|
3419
|
+
const He = A(V.pendingChangeFields);
|
|
3420
|
+
He.current = V.pendingChangeFields;
|
|
3421
|
+
const fe = j(
|
|
3422
|
+
(F) => {
|
|
3423
|
+
const O = Wi({
|
|
3424
|
+
title: Me,
|
|
3425
|
+
description: Ne,
|
|
3426
|
+
blocks: z,
|
|
3252
3427
|
values: It(),
|
|
3253
|
-
liveOptions:
|
|
3254
|
-
formChange:
|
|
3428
|
+
liveOptions: Ft.current,
|
|
3429
|
+
formChange: F
|
|
3255
3430
|
});
|
|
3256
|
-
|
|
3431
|
+
B.reportData(O);
|
|
3257
3432
|
},
|
|
3258
|
-
[
|
|
3259
|
-
),
|
|
3260
|
-
|
|
3261
|
-
if (!
|
|
3262
|
-
|
|
3433
|
+
[Me, Ne, z, It, B]
|
|
3434
|
+
), Ke = A(fe);
|
|
3435
|
+
Ke.current = fe, q(() => {
|
|
3436
|
+
if (!oe) {
|
|
3437
|
+
re.current = "";
|
|
3263
3438
|
return;
|
|
3264
3439
|
}
|
|
3265
|
-
if (
|
|
3266
|
-
const
|
|
3267
|
-
if (
|
|
3268
|
-
const
|
|
3269
|
-
w.current &&
|
|
3440
|
+
if (!$e) return;
|
|
3441
|
+
const F = `${De}::${$e}`;
|
|
3442
|
+
if (re.current === F) return;
|
|
3443
|
+
const O = setTimeout(() => {
|
|
3444
|
+
w.current && re.current !== F && (re.current = F, Ke.current([]));
|
|
3270
3445
|
}, 0);
|
|
3271
|
-
return () => clearTimeout(
|
|
3272
|
-
}, [
|
|
3273
|
-
if (!(!
|
|
3446
|
+
return () => clearTimeout(O);
|
|
3447
|
+
}, [oe, De, $e]), q(() => {
|
|
3448
|
+
if (!(!oe || V.version === 0) && He.current.length !== 0)
|
|
3274
3449
|
return K.current != null && clearTimeout(K.current), K.current = setTimeout(() => {
|
|
3275
3450
|
if (K.current = null, !w.current) return;
|
|
3276
|
-
const
|
|
3277
|
-
|
|
3278
|
-
},
|
|
3451
|
+
const F = [...He.current];
|
|
3452
|
+
V.clearPendingChangeFields(), F.length !== 0 && Ke.current(F);
|
|
3453
|
+
}, Xi), () => {
|
|
3279
3454
|
K.current != null && (clearTimeout(K.current), K.current = null);
|
|
3280
3455
|
};
|
|
3281
|
-
}, [
|
|
3282
|
-
const
|
|
3283
|
-
var
|
|
3456
|
+
}, [oe, V.version, V.clearPendingChangeFields]);
|
|
3457
|
+
const Je = j(async () => {
|
|
3458
|
+
var F, O, J, Ie, Rt, Pt, wt, zt;
|
|
3284
3459
|
if (!v) {
|
|
3285
3460
|
x(!0);
|
|
3286
3461
|
try {
|
|
3287
|
-
const
|
|
3288
|
-
if (
|
|
3289
|
-
(
|
|
3462
|
+
const pe = { ...((F = N.current) == null ? void 0 : F.getValues(Y)) ?? {}, ...I }, Ot = ci(z, pe);
|
|
3463
|
+
if (Ot) {
|
|
3464
|
+
(O = C.current) == null || O.call(C, "error", Ot.message);
|
|
3290
3465
|
return;
|
|
3291
3466
|
}
|
|
3292
|
-
const zt = { ...me, ...M };
|
|
3293
3467
|
if (o === "post") {
|
|
3294
3468
|
const Lt = (r ?? "").trim();
|
|
3295
3469
|
if (!Lt) {
|
|
3296
|
-
(
|
|
3470
|
+
(J = C.current) == null || J.call(C, "error", "callback_url 为空,无法提交");
|
|
3297
3471
|
return;
|
|
3298
3472
|
}
|
|
3299
|
-
|
|
3473
|
+
fe([]), B.reportEvent({
|
|
3300
3474
|
action: "submit",
|
|
3301
3475
|
component: "SubmitButton"
|
|
3302
3476
|
});
|
|
3303
|
-
const
|
|
3304
|
-
headers:
|
|
3477
|
+
const We = await _n(Lt, pe, {
|
|
3478
|
+
headers: ee
|
|
3305
3479
|
});
|
|
3306
3480
|
if (!w.current) return;
|
|
3307
|
-
|
|
3481
|
+
We.ok ? (Ie = C.current) == null || Ie.call(C, "success", "提交成功") : (Rt = C.current) == null || Rt.call(C, "error", Zi(We.status, We.body));
|
|
3308
3482
|
return;
|
|
3309
3483
|
}
|
|
3310
|
-
const
|
|
3311
|
-
context:
|
|
3484
|
+
const qt = Mt({
|
|
3485
|
+
context: te,
|
|
3312
3486
|
payload: e,
|
|
3313
|
-
form: g ??
|
|
3314
|
-
answer:
|
|
3315
|
-
}),
|
|
3316
|
-
if (
|
|
3317
|
-
(
|
|
3487
|
+
form: g ?? E,
|
|
3488
|
+
answer: pe
|
|
3489
|
+
}), Bt = Nt(qt);
|
|
3490
|
+
if (Bt) {
|
|
3491
|
+
(Pt = C.current) == null || Pt.call(C, "error", Bt);
|
|
3318
3492
|
return;
|
|
3319
3493
|
}
|
|
3320
|
-
|
|
3494
|
+
fe([]), B.reportEvent({
|
|
3321
3495
|
action: "submit",
|
|
3322
3496
|
component: "SubmitButton"
|
|
3323
3497
|
});
|
|
3324
|
-
const
|
|
3325
|
-
headers:
|
|
3498
|
+
const wn = await Nn(qt, {
|
|
3499
|
+
headers: ee
|
|
3326
3500
|
});
|
|
3327
3501
|
if (!w.current) return;
|
|
3328
|
-
const
|
|
3329
|
-
(wt = C.current) == null || wt.call(C,
|
|
3330
|
-
} catch (
|
|
3502
|
+
const Vt = Mn(wn);
|
|
3503
|
+
(wt = C.current) == null || wt.call(C, Vt.type, Vt.message);
|
|
3504
|
+
} catch (Ge) {
|
|
3331
3505
|
if (!w.current) return;
|
|
3332
|
-
const
|
|
3333
|
-
(
|
|
3506
|
+
const pe = Ge instanceof Error ? Ge.message : "提交失败";
|
|
3507
|
+
(zt = C.current) == null || zt.call(C, "error", pe);
|
|
3334
3508
|
} finally {
|
|
3335
3509
|
w.current && x(!1);
|
|
3336
3510
|
}
|
|
3337
3511
|
}
|
|
3338
3512
|
}, [
|
|
3339
3513
|
v,
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3514
|
+
Y,
|
|
3515
|
+
z,
|
|
3516
|
+
I,
|
|
3517
|
+
fe,
|
|
3518
|
+
B,
|
|
3345
3519
|
o,
|
|
3346
3520
|
r,
|
|
3347
|
-
Z,
|
|
3348
3521
|
ee,
|
|
3522
|
+
te,
|
|
3349
3523
|
e,
|
|
3350
3524
|
g,
|
|
3351
|
-
|
|
3352
|
-
]),
|
|
3353
|
-
|
|
3354
|
-
const
|
|
3355
|
-
(
|
|
3356
|
-
|
|
3357
|
-
|
|
3525
|
+
E
|
|
3526
|
+
]), Et = A(Je);
|
|
3527
|
+
Et.current = Je;
|
|
3528
|
+
const Ut = j(
|
|
3529
|
+
(F) => {
|
|
3530
|
+
Ki(
|
|
3531
|
+
F,
|
|
3358
3532
|
{
|
|
3359
|
-
setValues: (
|
|
3360
|
-
var
|
|
3361
|
-
return (
|
|
3533
|
+
setValues: (O) => {
|
|
3534
|
+
var J;
|
|
3535
|
+
return (J = N.current) == null ? void 0 : J.setValues(O);
|
|
3362
3536
|
},
|
|
3363
|
-
getValues: (
|
|
3364
|
-
var
|
|
3365
|
-
return ((
|
|
3537
|
+
getValues: (O) => {
|
|
3538
|
+
var J;
|
|
3539
|
+
return ((J = N.current) == null ? void 0 : J.getValues(O)) ?? {};
|
|
3366
3540
|
},
|
|
3367
|
-
submit: () =>
|
|
3541
|
+
submit: () => Et.current(),
|
|
3368
3542
|
rootElement: _.current
|
|
3369
3543
|
},
|
|
3370
3544
|
{
|
|
3371
|
-
reportEvent:
|
|
3372
|
-
runAutoControl:
|
|
3545
|
+
reportEvent: B.reportEvent,
|
|
3546
|
+
runAutoControl: B.runAutoControl
|
|
3373
3547
|
}
|
|
3374
3548
|
);
|
|
3375
3549
|
},
|
|
3376
|
-
[
|
|
3550
|
+
[B]
|
|
3377
3551
|
);
|
|
3378
|
-
return
|
|
3379
|
-
if (!
|
|
3380
|
-
|
|
3552
|
+
return q(() => {
|
|
3553
|
+
if (!oe) {
|
|
3554
|
+
b(null);
|
|
3381
3555
|
return;
|
|
3382
3556
|
}
|
|
3383
|
-
return
|
|
3384
|
-
}, [
|
|
3385
|
-
|
|
3557
|
+
return b(Ut), () => b(null);
|
|
3558
|
+
}, [oe, Ut, b]), p ? /* @__PURE__ */ u("div", { className: "ask-user-form-card", children: /* @__PURE__ */ u(ft, { size: "small" }) }) : !E || z.length === 0 ? /* @__PURE__ */ u(
|
|
3559
|
+
Qi,
|
|
3386
3560
|
{
|
|
3387
3561
|
payload: e,
|
|
3388
3562
|
callbackUrl: r,
|
|
3389
|
-
answerAgentContext:
|
|
3563
|
+
answerAgentContext: te,
|
|
3390
3564
|
submitHeaders: s,
|
|
3391
|
-
unpublishedFormId: y &&
|
|
3565
|
+
unpublishedFormId: y && $ ? $ : void 0,
|
|
3392
3566
|
onNotify: l
|
|
3393
3567
|
}
|
|
3394
|
-
) : /* @__PURE__ */
|
|
3568
|
+
) : /* @__PURE__ */ M(
|
|
3395
3569
|
"div",
|
|
3396
3570
|
{
|
|
3397
3571
|
className: "ask-user-form-card",
|
|
3398
3572
|
ref: _,
|
|
3399
|
-
"data-ask-user-message-id":
|
|
3573
|
+
"data-ask-user-message-id": W || void 0,
|
|
3400
3574
|
children: [
|
|
3401
|
-
y &&
|
|
3402
|
-
/* @__PURE__ */
|
|
3403
|
-
|
|
3575
|
+
y && $ ? /* @__PURE__ */ u("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ u(he, { title: $, children: /* @__PURE__ */ u(ge, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
|
|
3576
|
+
/* @__PURE__ */ u(
|
|
3577
|
+
Oi,
|
|
3404
3578
|
{
|
|
3405
|
-
ref:
|
|
3406
|
-
doc:
|
|
3407
|
-
surfaceId:
|
|
3408
|
-
fieldNames:
|
|
3579
|
+
ref: N,
|
|
3580
|
+
doc: ce,
|
|
3581
|
+
surfaceId: De,
|
|
3582
|
+
fieldNames: Y,
|
|
3409
3583
|
interactive: !0,
|
|
3410
3584
|
wrapProvider: !1,
|
|
3411
|
-
resumeSearch:
|
|
3585
|
+
resumeSearch: c,
|
|
3412
3586
|
caseSearch: m
|
|
3413
3587
|
}
|
|
3414
3588
|
),
|
|
3415
|
-
/* @__PURE__ */
|
|
3416
|
-
|
|
3589
|
+
/* @__PURE__ */ u("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ u(
|
|
3590
|
+
he,
|
|
3417
3591
|
{
|
|
3418
3592
|
title: o === "post" ? "提交 JSON 到 callback_url" : "提交到 answer_agent_callback_url",
|
|
3419
|
-
children: /* @__PURE__ */
|
|
3420
|
-
|
|
3593
|
+
children: /* @__PURE__ */ u(
|
|
3594
|
+
Oe,
|
|
3421
3595
|
{
|
|
3422
3596
|
type: "primary",
|
|
3423
3597
|
size: "small",
|
|
3424
3598
|
loading: v,
|
|
3425
3599
|
disabled: v,
|
|
3426
|
-
onClick: () => void
|
|
3600
|
+
onClick: () => void Je(),
|
|
3427
3601
|
children: "提交"
|
|
3428
3602
|
}
|
|
3429
3603
|
)
|
|
@@ -3433,16 +3607,16 @@ function Gi({
|
|
|
3433
3607
|
}
|
|
3434
3608
|
);
|
|
3435
3609
|
}
|
|
3436
|
-
function
|
|
3437
|
-
var
|
|
3438
|
-
const t = ((
|
|
3610
|
+
function As(e) {
|
|
3611
|
+
var c;
|
|
3612
|
+
const t = ((c = e.askUserMessageId) == null ? void 0 : c.trim()) ?? "", n = L(() => Wo(), []), [r, o] = P(!1), i = A(null), s = j((m) => {
|
|
3439
3613
|
o(m);
|
|
3440
|
-
}, []), a =
|
|
3614
|
+
}, []), a = j(
|
|
3441
3615
|
(m) => {
|
|
3442
3616
|
i.current = m;
|
|
3443
3617
|
},
|
|
3444
3618
|
[]
|
|
3445
|
-
), l =
|
|
3619
|
+
), l = L(() => !n || !t ? null : new $i({
|
|
3446
3620
|
url: n,
|
|
3447
3621
|
askUserMessageId: t,
|
|
3448
3622
|
onAutoControl: (m) => {
|
|
@@ -3450,15 +3624,15 @@ function ms(e) {
|
|
|
3450
3624
|
(d = i.current) == null || d.call(i, m);
|
|
3451
3625
|
}
|
|
3452
3626
|
}), [n, t]);
|
|
3453
|
-
return
|
|
3627
|
+
return q(() => {
|
|
3454
3628
|
if (l)
|
|
3455
3629
|
return () => {
|
|
3456
3630
|
l.close();
|
|
3457
3631
|
};
|
|
3458
|
-
}, [l]),
|
|
3632
|
+
}, [l]), q(() => {
|
|
3459
3633
|
!l || !r || l.connect();
|
|
3460
|
-
}, [l, r]), /* @__PURE__ */
|
|
3461
|
-
|
|
3634
|
+
}, [l, r]), /* @__PURE__ */ u(be, { children: /* @__PURE__ */ u(Dr, { client: l, children: /* @__PURE__ */ u(Vr, { children: /* @__PURE__ */ u(
|
|
3635
|
+
es,
|
|
3462
3636
|
{
|
|
3463
3637
|
...e,
|
|
3464
3638
|
onSurfaceReadyChange: s,
|
|
@@ -3467,61 +3641,71 @@ function ms(e) {
|
|
|
3467
3641
|
) }) }) });
|
|
3468
3642
|
}
|
|
3469
3643
|
export {
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3644
|
+
ds as A2UI_PROTOCOL_VERSION,
|
|
3645
|
+
As as AskUserFormCard,
|
|
3646
|
+
lt as CaseSearchProvider,
|
|
3647
|
+
Qi as CurlSubmitBlock,
|
|
3648
|
+
Ko as DEFAULT_ANSWER_AGENT_CALLBACK_URL,
|
|
3649
|
+
Do as DEFAULT_AUTH_ANSWER_AGENT_CALLBACK_URL_FIELD,
|
|
3650
|
+
Ho as DEFAULT_AUTH_REALTIME_WS_URL_FIELD,
|
|
3651
|
+
Ct as DEFAULT_AUTH_STORAGE_KEY,
|
|
3652
|
+
$o as DEFAULT_AUTH_TOKEN_FIELD,
|
|
3653
|
+
nr as FORM_MEDIA_SIZES,
|
|
3654
|
+
ct as ResumeSearchProvider,
|
|
3655
|
+
Cs as SkoponA2uiStreamRenderer,
|
|
3656
|
+
be as SkoponFormProvider,
|
|
3657
|
+
Oi as SkoponFormRenderer,
|
|
3658
|
+
Mo as a2uiToBlocks,
|
|
3659
|
+
vn as blocksToA2ui,
|
|
3660
|
+
Pr as blocksToJsonSchema,
|
|
3661
|
+
Mt as buildAnswerAgentBody,
|
|
3662
|
+
Lo as buildAskUserCurlBodyJson,
|
|
3663
|
+
jo as buildAskUserCurlStatement,
|
|
3664
|
+
vs as buildAskUserSubmitCurlFromPayload,
|
|
3665
|
+
Fo as buildAskUserSurface,
|
|
3666
|
+
An as buildCurlStatement,
|
|
3667
|
+
Te as coerceToggleValue,
|
|
3668
|
+
bs as copyTextToClipboard,
|
|
3669
|
+
ai as createCaseSearchClient,
|
|
3670
|
+
gs as createEmptyBlock,
|
|
3671
|
+
hs as createEmptyFormDefinition,
|
|
3672
|
+
Yo as createFormClient,
|
|
3673
|
+
ri as createResumeSearchClient,
|
|
3674
|
+
ks as createSkoponSdkClients,
|
|
3675
|
+
ze as extractExtraBlockValues,
|
|
3676
|
+
Uo as extractSurfaceValues,
|
|
3677
|
+
Mn as formatAnswerAgentSubmitMessage,
|
|
3678
|
+
Vo as getPayloadHiddenBlockValues,
|
|
3679
|
+
ys as getPayloadInputFieldNames,
|
|
3680
|
+
Bo as getPayloadRenderableBlocks,
|
|
3681
|
+
Oo as intersectPayloadBlocksWithForm,
|
|
3682
|
+
dt as isA2uiSurfaceEmpty,
|
|
3683
|
+
fs as isDisplayBlockType,
|
|
3684
|
+
Z as isInputBlockType,
|
|
3685
|
+
Ce as isLayoutBlockType,
|
|
3686
|
+
de as isMediaBlockType,
|
|
3687
|
+
rr as isOptionsBlockType,
|
|
3688
|
+
Eo as mapFormDefinitionFromDto,
|
|
3689
|
+
qe as normalizeFormDefinition,
|
|
3690
|
+
ue as normalizeMultiselectCount,
|
|
3691
|
+
Ve as parsePayloadBlocksJson,
|
|
3692
|
+
qo as payloadHasInputBlocks,
|
|
3693
|
+
Go as resolveAnswerAgentCallbackUrl,
|
|
3694
|
+
xt as resolveClientHeaders,
|
|
3695
|
+
Wo as resolveRealtimeWsUrl,
|
|
3696
|
+
Ur as resolveSchemaDefaultValue,
|
|
3697
|
+
Tn as resolveSkoponAuthHeaders,
|
|
3698
|
+
Tt as resolveSubmitAuthHeaders,
|
|
3699
|
+
Io as resolveSurfaceFromFormDefinition,
|
|
3700
|
+
zi as skoponAntdTheme,
|
|
3701
|
+
ie as skoponBrandColors,
|
|
3702
|
+
Nn as submitAnswerAgent,
|
|
3703
|
+
_n as submitFormJson,
|
|
3704
|
+
ps as supportsDefaultValue,
|
|
3705
|
+
No as surfaceDocToMessages,
|
|
3706
|
+
ye as syncFormDefinition,
|
|
3707
|
+
Jr as useCaseSearch,
|
|
3708
|
+
no as useResumeSearch,
|
|
3525
3709
|
Nt as validateAnswerAgentBody,
|
|
3526
|
-
|
|
3710
|
+
Ss as validateAnswerAgentContext
|
|
3527
3711
|
};
|