@skopon-cool/form-sdk 0.4.7 → 0.4.8
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/index.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import './form-sdk.css';
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var G = (e, t, n) =>
|
|
2
|
+
var On = Object.defineProperty;
|
|
3
|
+
var qn = (e, t, n) => t in e ? On(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
|
+
var G = (e, t, n) => qn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
5
5
|
import { jsx as u, jsxs as M } from "react/jsx-runtime";
|
|
6
|
-
import { useRef as A, useState as
|
|
7
|
-
import { Spin as ft, Button as Oe, Typography as ne, Avatar as
|
|
8
|
-
import { ReloadOutlined as Yt, FileTextOutlined as Qt, UserOutlined as
|
|
6
|
+
import { useRef as A, useState as w, useCallback as j, useMemo as L, createContext as Ce, useContext as Ae, useEffect as q, useSyncExternalStore as Bn, forwardRef as Vn, useImperativeHandle as Ln } from "react";
|
|
7
|
+
import { Spin as ft, Button as Oe, Typography as ne, Avatar as jn, Tag as ve, Select as st, Checkbox as $n, Radio as Dn, Switch as Hn, TimePicker as Kn, DatePicker as Jn, Upload as Ye, Input as Qe, InputNumber as Gn, ConfigProvider as Wn, Tooltip as ye } from "antd";
|
|
8
|
+
import { ReloadOutlined as Yt, FileTextOutlined as Qt, UserOutlined as Yn, FileImageOutlined as Qn, FileExcelOutlined as Xn, FileOutlined as Xt, PictureOutlined as Zn, SoundOutlined as er, VideoCameraOutlined as tr } from "@ant-design/icons";
|
|
9
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
|
|
11
|
+
import { Catalog as nr, MessageProcessor as en } from "@a2ui/web_core/v0_9";
|
|
12
12
|
import { injectBasicCatalogStyles as tn } from "@a2ui/web_core/v0_9/basic_catalog";
|
|
13
13
|
import { injectStyles as nn } from "@a2ui/react/styles";
|
|
14
14
|
import jt from "dayjs";
|
|
15
|
-
const
|
|
15
|
+
const ps = "v0.9", rr = [
|
|
16
16
|
"huge",
|
|
17
17
|
"large",
|
|
18
18
|
"medium",
|
|
19
19
|
"small",
|
|
20
20
|
"icon"
|
|
21
21
|
];
|
|
22
|
-
function
|
|
22
|
+
function pe(e) {
|
|
23
23
|
return e === "image" || e === "video" || e === "audio";
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function _e(e) {
|
|
26
26
|
return e === "heading" || e === "paragraph";
|
|
27
27
|
}
|
|
28
28
|
function Z(e) {
|
|
29
|
-
return !
|
|
29
|
+
return !_e(e) && !pe(e);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
return
|
|
31
|
+
function hs(e) {
|
|
32
|
+
return _e(e) || pe(e);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function or(e) {
|
|
35
35
|
return e === "select" || e === "multiselect" || e === "radio" || e === "checkbox";
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function gs(e) {
|
|
38
38
|
return Z(e) && e !== "file" && e !== "resume_multiselect" && e !== "case_multiselect";
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function ir() {
|
|
41
41
|
if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
|
|
42
42
|
return crypto.randomUUID();
|
|
43
43
|
if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") {
|
|
@@ -52,7 +52,7 @@ function or() {
|
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
function le(e) {
|
|
55
|
-
const t =
|
|
55
|
+
const t = ir().replace(/-/g, "").slice(0, 8);
|
|
56
56
|
return `${e}${t}`;
|
|
57
57
|
}
|
|
58
58
|
const rn = [
|
|
@@ -66,7 +66,7 @@ const rn = [
|
|
|
66
66
|
{ value: "text/plain", label: "纯文本" },
|
|
67
67
|
{ value: "application/zip", label: "ZIP 压缩包" },
|
|
68
68
|
{ value: "application/x-rar-compressed", label: "RAR 压缩包" }
|
|
69
|
-
],
|
|
69
|
+
], sr = {
|
|
70
70
|
"image/*": ["image/*"],
|
|
71
71
|
"video/*": ["video/*"],
|
|
72
72
|
"audio/*": ["audio/*"],
|
|
@@ -86,7 +86,7 @@ const rn = [
|
|
|
86
86
|
"text/plain": ["text/plain"],
|
|
87
87
|
"application/zip": ["application/zip"],
|
|
88
88
|
"application/x-rar-compressed": ["application/x-rar-compressed"]
|
|
89
|
-
},
|
|
89
|
+
}, ar = {
|
|
90
90
|
"image/*": [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"],
|
|
91
91
|
"video/*": [".mp4", ".mov", ".avi", ".webm"],
|
|
92
92
|
"audio/*": [".mp3", ".wav", ".ogg", ".m4a"],
|
|
@@ -97,7 +97,7 @@ const rn = [
|
|
|
97
97
|
"text/plain": [".txt"],
|
|
98
98
|
"application/zip": [".zip", ".7z"],
|
|
99
99
|
"application/x-rar-compressed": [".rar"]
|
|
100
|
-
},
|
|
100
|
+
}, lr = {
|
|
101
101
|
"application/msword": "office/word",
|
|
102
102
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "office/word",
|
|
103
103
|
"application/vnd.ms-excel": "office/excel",
|
|
@@ -130,119 +130,119 @@ const rn = [
|
|
|
130
130
|
{ value: ".zip", label: ".zip" },
|
|
131
131
|
{ value: ".rar", label: ".rar" },
|
|
132
132
|
{ value: ".7z", label: ".7z" }
|
|
133
|
-
],
|
|
133
|
+
], cr = Object.fromEntries(
|
|
134
134
|
rn.map((e) => [e.value, e.label])
|
|
135
|
-
),
|
|
135
|
+
), ur = Object.fromEntries(
|
|
136
136
|
pt.map((e) => [e.value, e.label])
|
|
137
|
-
),
|
|
137
|
+
), mr = new Set(rn.map((e) => e.value)), dr = new Set(
|
|
138
138
|
pt.map((e) => e.value)
|
|
139
139
|
);
|
|
140
|
-
function
|
|
140
|
+
function fr(e) {
|
|
141
141
|
const t = e.trim();
|
|
142
|
-
return t ?
|
|
142
|
+
return t ? mr.has(t) ? t : lr[t] ?? null : null;
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function pr(e) {
|
|
145
145
|
return Array.isArray(e) ? e.map((t) => {
|
|
146
146
|
const n = t.trim().toLowerCase();
|
|
147
147
|
return n ? n.startsWith(".") ? n : `.${n}` : "";
|
|
148
148
|
}).filter(Boolean) : [];
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function Te(e) {
|
|
151
151
|
if (!Array.isArray(e)) return [];
|
|
152
152
|
const t = [], n = /* @__PURE__ */ new Set();
|
|
153
153
|
for (const r of e) {
|
|
154
|
-
const o =
|
|
154
|
+
const o = fr(r);
|
|
155
155
|
o && !n.has(o) && (n.add(o), t.push(o));
|
|
156
156
|
}
|
|
157
157
|
return t;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
const t =
|
|
159
|
+
function hr(e) {
|
|
160
|
+
const t = Te(e), n = [];
|
|
161
161
|
for (const r of t)
|
|
162
|
-
n.push(...
|
|
162
|
+
n.push(...sr[r] ?? [r]);
|
|
163
163
|
return n;
|
|
164
164
|
}
|
|
165
|
-
function
|
|
166
|
-
const t =
|
|
165
|
+
function gr(e) {
|
|
166
|
+
const t = Te(e);
|
|
167
167
|
if (t.length === 0) return [];
|
|
168
168
|
const n = /* @__PURE__ */ new Set();
|
|
169
169
|
for (const r of t)
|
|
170
|
-
for (const o of
|
|
170
|
+
for (const o of ar[r] ?? [])
|
|
171
171
|
n.add(o);
|
|
172
172
|
return pt.filter((r) => n.has(r.value));
|
|
173
173
|
}
|
|
174
174
|
function ht(e, t) {
|
|
175
|
-
const n =
|
|
175
|
+
const n = pr(t), r = Te(e);
|
|
176
176
|
if (r.length === 0)
|
|
177
|
-
return n.filter((i) =>
|
|
177
|
+
return n.filter((i) => dr.has(i));
|
|
178
178
|
const o = new Set(
|
|
179
|
-
|
|
179
|
+
gr(r).map((i) => i.value)
|
|
180
180
|
);
|
|
181
181
|
return n.filter((i) => o.has(i));
|
|
182
182
|
}
|
|
183
|
-
function
|
|
184
|
-
const n =
|
|
183
|
+
function yr(e, t) {
|
|
184
|
+
const n = hr(e), r = ht(e, t), o = [...n, ...r];
|
|
185
185
|
return o.length > 0 ? o.join(",") : void 0;
|
|
186
186
|
}
|
|
187
|
-
function
|
|
188
|
-
const n =
|
|
187
|
+
function vr(e, t) {
|
|
188
|
+
const n = Te(e), r = ht(
|
|
189
189
|
n,
|
|
190
190
|
t
|
|
191
191
|
), o = [
|
|
192
|
-
...n.map((i) =>
|
|
193
|
-
...r.map((i) =>
|
|
192
|
+
...n.map((i) => cr[i] ?? i),
|
|
193
|
+
...r.map((i) => ur[i] ?? i)
|
|
194
194
|
];
|
|
195
195
|
return o.length === 0 ? null : o.join("、");
|
|
196
196
|
}
|
|
197
|
-
const
|
|
197
|
+
const br = [
|
|
198
198
|
"video",
|
|
199
199
|
"audio",
|
|
200
200
|
"image",
|
|
201
201
|
"file",
|
|
202
202
|
"spreadsheet",
|
|
203
203
|
"document"
|
|
204
|
-
],
|
|
205
|
-
function
|
|
206
|
-
return e &&
|
|
204
|
+
], Sr = new Set(br);
|
|
205
|
+
function kr(e) {
|
|
206
|
+
return e && Sr.has(e) ? e : "file";
|
|
207
207
|
}
|
|
208
|
-
function
|
|
209
|
-
return typeof e == "string" &&
|
|
208
|
+
function xe(e) {
|
|
209
|
+
return typeof e == "string" && rr.includes(e) ? e : "medium";
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function Cr(e, t) {
|
|
212
212
|
var o;
|
|
213
213
|
const n = Math.max(1, t);
|
|
214
214
|
let r = [];
|
|
215
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);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function Ar(e) {
|
|
218
218
|
var t;
|
|
219
219
|
return Array.isArray(e.mediaUrls) ? e.mediaUrls.map((n) => n.trim()).filter(Boolean) : (t = e.mediaUrl) != null && t.trim() ? [e.mediaUrl.trim()] : [];
|
|
220
220
|
}
|
|
221
|
-
function Ar(e) {
|
|
222
|
-
return `form-media-size-${_e(e)}`;
|
|
223
|
-
}
|
|
224
221
|
function _r(e) {
|
|
225
|
-
return `form-media-
|
|
222
|
+
return `form-media-size-${xe(e)}`;
|
|
223
|
+
}
|
|
224
|
+
function Tr(e) {
|
|
225
|
+
return `form-media-preview form-media-list ${_r(e)}`;
|
|
226
226
|
}
|
|
227
|
-
const
|
|
227
|
+
const xr = 10;
|
|
228
228
|
function on(e) {
|
|
229
229
|
return e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function Me(e) {
|
|
232
232
|
return e === !0 || e === "true" || e === 1 || e === "1";
|
|
233
233
|
}
|
|
234
234
|
function Re(e, t = 1) {
|
|
235
235
|
const n = typeof e == "number" ? e : Number(e);
|
|
236
236
|
return Number.isFinite(n) ? Math.max(0, Math.floor(n)) : t;
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function de(e, t = 1) {
|
|
239
239
|
const n = typeof e == "number" ? e : Number(e);
|
|
240
240
|
return Number.isFinite(n) ? Math.max(1, Math.floor(n)) : t;
|
|
241
241
|
}
|
|
242
242
|
function sn(e, t) {
|
|
243
|
-
return t == null ? void 0 : e === "toggle" ?
|
|
243
|
+
return t == null ? void 0 : e === "toggle" ? Me(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;
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function Mr(e) {
|
|
246
246
|
if (Array.isArray(e)) return e.map(String).filter(Boolean);
|
|
247
247
|
if (typeof e == "string" && e.trim())
|
|
248
248
|
try {
|
|
@@ -252,11 +252,11 @@ function xr(e) {
|
|
|
252
252
|
}
|
|
253
253
|
return [];
|
|
254
254
|
}
|
|
255
|
-
function
|
|
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 =
|
|
255
|
+
function Nr(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 = Mr(e == null ? void 0 : e.flowUniqueIds);
|
|
257
257
|
return { agentKind: r, agentUniqueId: o, flowType: i, category: s, flowUniqueIds: a, pageSize: n };
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function Ir(e) {
|
|
260
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;
|
|
261
261
|
return {
|
|
262
262
|
names: Array.isArray(e == null ? void 0 : e.names) ? e.names.map(String).filter(Boolean) : [],
|
|
@@ -266,14 +266,14 @@ function Nr(e) {
|
|
|
266
266
|
pageSize: n
|
|
267
267
|
};
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function Fr(e) {
|
|
270
270
|
if (e.type !== "case_singleselect") return e;
|
|
271
271
|
const t = typeof e.defaultValue == "string" && e.defaultValue.trim() ? [e.defaultValue.trim()] : Array.isArray(e.defaultValue) ? e.defaultValue.map(String).filter(Boolean) : [];
|
|
272
272
|
return { ...e, type: "case_multiselect", defaultValue: t };
|
|
273
273
|
}
|
|
274
|
-
function
|
|
274
|
+
function Er(e) {
|
|
275
275
|
var o, i, s, a;
|
|
276
|
-
const t =
|
|
276
|
+
const t = Fr(e), n = Te(t.fileAcceptTypes), r = t.type;
|
|
277
277
|
return {
|
|
278
278
|
id: ((o = t.id) == null ? void 0 : o.trim()) || le("block-"),
|
|
279
279
|
type: r,
|
|
@@ -282,14 +282,14 @@ function Fr(e) {
|
|
|
282
282
|
placeholder: t.placeholder ?? "",
|
|
283
283
|
help: t.help ?? "",
|
|
284
284
|
required: t.required === !0,
|
|
285
|
-
mediaUrls:
|
|
286
|
-
mediaSize:
|
|
285
|
+
mediaUrls: pe(r) ? Cr(t, xr) : void 0,
|
|
286
|
+
mediaSize: pe(r) ? xe(t.mediaSize) : void 0,
|
|
287
287
|
fileAcceptTypes: n,
|
|
288
288
|
fileAcceptExtensions: ht(
|
|
289
289
|
n,
|
|
290
290
|
t.fileAcceptExtensions
|
|
291
291
|
),
|
|
292
|
-
filePlaceholderIcon:
|
|
292
|
+
filePlaceholderIcon: kr(t.filePlaceholderIcon),
|
|
293
293
|
fileMinCount: r === "file" ? Re(t.fileMinCount, 1) : void 0,
|
|
294
294
|
fileMaxCount: r === "file" ? Re(t.fileMaxCount, 1) : void 0,
|
|
295
295
|
defaultValue: sn(r, t.defaultValue),
|
|
@@ -309,16 +309,16 @@ function Fr(e) {
|
|
|
309
309
|
value: t.condition.value
|
|
310
310
|
} : void 0,
|
|
311
311
|
resumeEnableRefresh: r === "resume_multiselect" ? t.resumeEnableRefresh !== !1 : void 0,
|
|
312
|
-
resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ?
|
|
313
|
-
resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ?
|
|
314
|
-
resumeFilter: r === "resume_multiselect" ?
|
|
312
|
+
resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? de(t.resumeMinCount, 1) : void 0,
|
|
313
|
+
resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? de(t.resumeMaxCount, 1) : void 0,
|
|
314
|
+
resumeFilter: r === "resume_multiselect" ? Ir(t.resumeFilter) : void 0,
|
|
315
315
|
caseEnableRefresh: r === "case_multiselect" ? t.caseEnableRefresh !== !1 : void 0,
|
|
316
|
-
caseMinCount: r === "case_multiselect" && t.caseMinCount != null ?
|
|
317
|
-
caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ?
|
|
318
|
-
caseFilter: r === "case_multiselect" ?
|
|
316
|
+
caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? de(t.caseMinCount, 1) : void 0,
|
|
317
|
+
caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? de(t.caseMaxCount, 1) : void 0,
|
|
318
|
+
caseFilter: r === "case_multiselect" ? Nr(t.caseFilter) : void 0
|
|
319
319
|
};
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function Ur(e) {
|
|
322
322
|
return new Set((e.options ?? []).map((t) => t.value));
|
|
323
323
|
}
|
|
324
324
|
function $t(e, t) {
|
|
@@ -326,12 +326,12 @@ function $t(e, t) {
|
|
|
326
326
|
type: "array",
|
|
327
327
|
items: { type: "string" }
|
|
328
328
|
};
|
|
329
|
-
return e !== void 0 && (n.minItems =
|
|
329
|
+
return e !== void 0 && (n.minItems = de(e, 1)), t !== void 0 && (n.maxItems = de(t, 1)), n;
|
|
330
330
|
}
|
|
331
|
-
function
|
|
331
|
+
function Rr(e) {
|
|
332
332
|
const t = sn(e.type, e.defaultValue);
|
|
333
333
|
if (t === void 0) return;
|
|
334
|
-
const n =
|
|
334
|
+
const n = Ur(e);
|
|
335
335
|
switch (e.type) {
|
|
336
336
|
case "toggle":
|
|
337
337
|
return t;
|
|
@@ -358,7 +358,7 @@ function Ur(e) {
|
|
|
358
358
|
return t;
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function Pr(e) {
|
|
362
362
|
var i, s;
|
|
363
363
|
if (!((i = e.name) == null ? void 0 : i.trim()) || !Z(e.type)) return null;
|
|
364
364
|
let n;
|
|
@@ -410,16 +410,16 @@ function Rr(e) {
|
|
|
410
410
|
}
|
|
411
411
|
const r = (s = e.jsonSchemaDescription) == null ? void 0 : s.trim();
|
|
412
412
|
r && (n.$comment = r);
|
|
413
|
-
const o =
|
|
413
|
+
const o = Rr(e);
|
|
414
414
|
return o !== void 0 && (n.default = o), n;
|
|
415
415
|
}
|
|
416
|
-
function
|
|
416
|
+
function wr(e, t, n) {
|
|
417
417
|
var l;
|
|
418
418
|
const r = {}, o = [];
|
|
419
419
|
for (const c of e) {
|
|
420
420
|
const m = (l = c.name) == null ? void 0 : l.trim();
|
|
421
421
|
if (!m || !Z(c.type)) continue;
|
|
422
|
-
const d =
|
|
422
|
+
const d = Pr(c);
|
|
423
423
|
d && (r[m] = d, c.required && o.push(m));
|
|
424
424
|
}
|
|
425
425
|
const i = {
|
|
@@ -430,35 +430,35 @@ function Pr(e, t, n) {
|
|
|
430
430
|
}, s = t == null ? void 0 : t.trim(), a = n == null ? void 0 : n.trim();
|
|
431
431
|
return s && (i.title = s), a && (i.description = a), i;
|
|
432
432
|
}
|
|
433
|
-
function
|
|
433
|
+
function be(e) {
|
|
434
434
|
const t = e.title ?? "", n = e.description ?? "";
|
|
435
435
|
return {
|
|
436
436
|
title: t,
|
|
437
437
|
description: n,
|
|
438
438
|
blocks: e.blocks,
|
|
439
|
-
jsonSchema:
|
|
439
|
+
jsonSchema: wr(e.blocks, t, n)
|
|
440
440
|
};
|
|
441
441
|
}
|
|
442
442
|
function qe(e) {
|
|
443
443
|
if (!e || !Array.isArray(e.blocks))
|
|
444
|
-
return
|
|
445
|
-
const t = e.blocks.map(
|
|
446
|
-
return
|
|
444
|
+
return be({ title: "", description: "", blocks: [] });
|
|
445
|
+
const t = e.blocks.map(Er);
|
|
446
|
+
return be({
|
|
447
447
|
title: typeof e.title == "string" ? e.title : "",
|
|
448
448
|
description: typeof e.description == "string" ? e.description : "",
|
|
449
449
|
blocks: t
|
|
450
450
|
});
|
|
451
451
|
}
|
|
452
|
-
function
|
|
453
|
-
return
|
|
452
|
+
function ys() {
|
|
453
|
+
return be({ title: "", description: "", blocks: [] });
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function vs(e) {
|
|
456
456
|
const t = {
|
|
457
457
|
id: le("block-"),
|
|
458
458
|
type: e,
|
|
459
459
|
label: e
|
|
460
460
|
};
|
|
461
|
-
return Z(e) && (t.label = "", t.name = le("field_"), t.placeholder = "", t.required = !1),
|
|
461
|
+
return Z(e) && (t.label = "", t.name = le("field_"), t.placeholder = "", t.required = !1), pe(e) && (t.label = "", t.placeholder = "", t.help = "", t.mediaUrls = [""], t.mediaSize = "medium"), or(e) && (t.options = [
|
|
462
462
|
{ value: "option_1", label: "选项 1" },
|
|
463
463
|
{ value: "option_2", label: "选项 2" }
|
|
464
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 = {
|
|
@@ -468,7 +468,7 @@ function gs(e) {
|
|
|
468
468
|
pageSize: 20
|
|
469
469
|
}, t.defaultValue = []), e === "case_multiselect" && (t.caseEnableRefresh = !0, t.caseMinCount = 1, t.caseMaxCount = 1, t.caseFilter = { flowUniqueIds: [], pageSize: 20 }, t.defaultValue = []), t;
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function zr(e) {
|
|
472
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) : [];
|
|
473
473
|
return {
|
|
474
474
|
agentKind: n,
|
|
@@ -485,7 +485,7 @@ function Dt(e) {
|
|
|
485
485
|
if (!(!Number.isFinite(t) || t < 1))
|
|
486
486
|
return Math.floor(t);
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function Or(e, t) {
|
|
489
489
|
var s, a, l, c, m, d;
|
|
490
490
|
const { id: n, label: r, path: o, withData: i } = t;
|
|
491
491
|
return i({
|
|
@@ -508,7 +508,7 @@ function zr(e, t) {
|
|
|
508
508
|
value: { path: o }
|
|
509
509
|
});
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function qr(e, t, n) {
|
|
512
512
|
const r = n.nameFromValue(e.value), o = {
|
|
513
513
|
...t("case_multiselect"),
|
|
514
514
|
name: r,
|
|
@@ -516,23 +516,23 @@ function Or(e, t, n) {
|
|
|
516
516
|
}, i = n.asLiteral(e.placeholder);
|
|
517
517
|
i && (o.placeholder = i);
|
|
518
518
|
const s = n.asLiteral(e.help);
|
|
519
|
-
s && (o.help = s), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter =
|
|
519
|
+
s && (o.help = s), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = zr(e.caseFilter));
|
|
520
520
|
const a = Dt(e.minCount);
|
|
521
521
|
a !== void 0 && (o.caseMinCount = a);
|
|
522
522
|
const l = Dt(e.maxCount);
|
|
523
523
|
return l !== void 0 && (o.caseMaxCount = l), o;
|
|
524
524
|
}
|
|
525
|
-
const an =
|
|
525
|
+
const an = Ce(
|
|
526
526
|
null
|
|
527
527
|
);
|
|
528
|
-
function
|
|
528
|
+
function Br(e) {
|
|
529
529
|
try {
|
|
530
530
|
return JSON.stringify(e);
|
|
531
531
|
} catch {
|
|
532
532
|
return String(e.length);
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
|
-
const
|
|
535
|
+
const Vr = {
|
|
536
536
|
publishLiveOptions: () => {
|
|
537
537
|
},
|
|
538
538
|
liveOptions: /* @__PURE__ */ new Map(),
|
|
@@ -541,18 +541,18 @@ const Br = {
|
|
|
541
541
|
clearPendingChangeFields: () => {
|
|
542
542
|
}
|
|
543
543
|
};
|
|
544
|
-
function
|
|
545
|
-
const t = A(/* @__PURE__ */ new Map()), n = A(/* @__PURE__ */ new Map()), r = A([]), [o, i] =
|
|
544
|
+
function Lr({ children: e }) {
|
|
545
|
+
const t = A(/* @__PURE__ */ new Map()), n = A(/* @__PURE__ */ new Map()), r = A([]), [o, i] = w(0), [s, a] = w(() => /* @__PURE__ */ new Map()), [l, c] = w(
|
|
546
546
|
[]
|
|
547
547
|
), m = j(
|
|
548
|
-
(
|
|
549
|
-
const
|
|
550
|
-
if (!
|
|
548
|
+
(y, S) => {
|
|
549
|
+
const g = y.trim();
|
|
550
|
+
if (!g) return;
|
|
551
551
|
const k = S.map((f) => ({
|
|
552
552
|
value: String(f.value ?? ""),
|
|
553
553
|
label: String(f.label ?? f.value ?? "")
|
|
554
|
-
})), p =
|
|
555
|
-
n.current.get(
|
|
554
|
+
})), p = Br(k);
|
|
555
|
+
n.current.get(g) !== p && (n.current.set(g, p), t.current.set(g, k), r.current.includes(g) || (r.current = [...r.current, g]), a(new Map(t.current)), c(r.current), i((f) => f + 1));
|
|
556
556
|
},
|
|
557
557
|
[]
|
|
558
558
|
), d = j(() => {
|
|
@@ -576,9 +576,9 @@ function Vr({ children: e }) {
|
|
|
576
576
|
return /* @__PURE__ */ u(an.Provider, { value: b, children: e });
|
|
577
577
|
}
|
|
578
578
|
function gt() {
|
|
579
|
-
return
|
|
579
|
+
return Ae(an) ?? Vr;
|
|
580
580
|
}
|
|
581
|
-
const ln =
|
|
581
|
+
const ln = Ce({ interactive: !0 });
|
|
582
582
|
function at({
|
|
583
583
|
interactive: e,
|
|
584
584
|
children: t
|
|
@@ -586,13 +586,13 @@ function at({
|
|
|
586
586
|
return /* @__PURE__ */ u(ln.Provider, { value: { interactive: e }, children: t });
|
|
587
587
|
}
|
|
588
588
|
function se() {
|
|
589
|
-
return
|
|
589
|
+
return Ae(ln);
|
|
590
590
|
}
|
|
591
|
-
const cn =
|
|
592
|
-
function
|
|
591
|
+
const cn = Ce(null);
|
|
592
|
+
function jr(e) {
|
|
593
593
|
return e != null && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
|
|
594
594
|
}
|
|
595
|
-
const
|
|
595
|
+
const $r = {
|
|
596
596
|
reportEvent: () => {
|
|
597
597
|
},
|
|
598
598
|
reportData: () => {
|
|
@@ -600,7 +600,7 @@ const jr = {
|
|
|
600
600
|
runAutoControl: (e) => e(),
|
|
601
601
|
isAutoControl: () => !1
|
|
602
602
|
};
|
|
603
|
-
function
|
|
603
|
+
function Dr(e) {
|
|
604
604
|
const t = {};
|
|
605
605
|
for (const [n, r] of Object.entries(e.form_values ?? {}))
|
|
606
606
|
r !== void 0 && (t[n] = r);
|
|
@@ -610,7 +610,7 @@ function $r(e) {
|
|
|
610
610
|
form_change: Array.isArray(e.form_change) ? [...e.form_change] : []
|
|
611
611
|
};
|
|
612
612
|
}
|
|
613
|
-
function
|
|
613
|
+
function Hr({
|
|
614
614
|
client: e,
|
|
615
615
|
children: t
|
|
616
616
|
}) {
|
|
@@ -628,7 +628,7 @@ function Dr({
|
|
|
628
628
|
m.send(b, d);
|
|
629
629
|
}, []), i = j((c) => {
|
|
630
630
|
const m = r.current;
|
|
631
|
-
m && m.send("form_runtime_data",
|
|
631
|
+
m && m.send("form_runtime_data", Dr(c));
|
|
632
632
|
}, []), s = j((c) => {
|
|
633
633
|
n.current += 1;
|
|
634
634
|
let m;
|
|
@@ -637,7 +637,7 @@ function Dr({
|
|
|
637
637
|
} catch (d) {
|
|
638
638
|
throw n.current = Math.max(0, n.current - 1), d;
|
|
639
639
|
}
|
|
640
|
-
return
|
|
640
|
+
return jr(m) ? Promise.resolve(m).finally(() => {
|
|
641
641
|
n.current = Math.max(0, n.current - 1);
|
|
642
642
|
}) : (n.current = Math.max(0, n.current - 1), m);
|
|
643
643
|
}, []), a = j(
|
|
@@ -655,13 +655,13 @@ function Dr({
|
|
|
655
655
|
return /* @__PURE__ */ u(cn.Provider, { value: l, children: t });
|
|
656
656
|
}
|
|
657
657
|
function un() {
|
|
658
|
-
return
|
|
658
|
+
return Ae(cn) ?? $r;
|
|
659
659
|
}
|
|
660
|
-
const
|
|
660
|
+
const Kr = 300;
|
|
661
661
|
function mn(e) {
|
|
662
662
|
return e && typeof e == "object" && "path" in e && String(e.path ?? "").trim() || null;
|
|
663
663
|
}
|
|
664
|
-
function
|
|
664
|
+
function Jr(e) {
|
|
665
665
|
if (!e) return;
|
|
666
666
|
const t = e.trim();
|
|
667
667
|
if (t)
|
|
@@ -673,20 +673,20 @@ function Ht(e, t = "value") {
|
|
|
673
673
|
return e.dataContext.resolveDynamicValue(r);
|
|
674
674
|
}
|
|
675
675
|
function ae(e, t = "value", n = {}) {
|
|
676
|
-
const o = e.componentModel.properties[t], i = mn(o), s =
|
|
676
|
+
const o = e.componentModel.properties[t], i = mn(o), s = Jr(i), a = un(), {
|
|
677
677
|
component: l = "Unknown",
|
|
678
678
|
changeAction: c = "change",
|
|
679
679
|
debounceChange: m = !1
|
|
680
|
-
} = n, d = A(null), b = A(void 0),
|
|
680
|
+
} = n, d = A(null), b = A(void 0), y = A(!1), S = A(a);
|
|
681
681
|
S.current = a;
|
|
682
|
-
const
|
|
683
|
-
|
|
682
|
+
const g = A(c);
|
|
683
|
+
g.current = c;
|
|
684
684
|
const k = A(l);
|
|
685
685
|
k.current = l;
|
|
686
686
|
const p = A(s);
|
|
687
687
|
p.current = s, q(() => () => {
|
|
688
|
-
d.current != null && (clearTimeout(d.current), d.current = null),
|
|
689
|
-
action:
|
|
688
|
+
d.current != null && (clearTimeout(d.current), d.current = null), y.current && p.current && (y.current = !1, S.current.reportEvent({
|
|
689
|
+
action: g.current,
|
|
690
690
|
component: k.current,
|
|
691
691
|
field: p.current,
|
|
692
692
|
value: b.current
|
|
@@ -703,11 +703,11 @@ function ae(e, t = "value", n = {}) {
|
|
|
703
703
|
), v = j(() => {
|
|
704
704
|
if (!(!i || o === void 0))
|
|
705
705
|
return e.dataContext.resolveDynamicValue(o);
|
|
706
|
-
}, [e, o, i]), x =
|
|
706
|
+
}, [e, o, i]), x = Bn(f, v, v), N = j(
|
|
707
707
|
(B) => {
|
|
708
708
|
if (!s) return;
|
|
709
709
|
const V = () => {
|
|
710
|
-
|
|
710
|
+
y.current = !1, S.current.reportEvent({
|
|
711
711
|
action: c,
|
|
712
712
|
component: l,
|
|
713
713
|
field: s,
|
|
@@ -718,9 +718,9 @@ function ae(e, t = "value", n = {}) {
|
|
|
718
718
|
V();
|
|
719
719
|
return;
|
|
720
720
|
}
|
|
721
|
-
b.current = B,
|
|
721
|
+
b.current = B, y.current = !0, d.current != null && clearTimeout(d.current), d.current = setTimeout(() => {
|
|
722
722
|
d.current = null, V();
|
|
723
|
-
},
|
|
723
|
+
}, Kr);
|
|
724
724
|
},
|
|
725
725
|
[s, c, l, m]
|
|
726
726
|
), _ = j(
|
|
@@ -728,7 +728,7 @@ function ae(e, t = "value", n = {}) {
|
|
|
728
728
|
!i || !o || typeof o != "object" || !("path" in o) || e.dataContext.set(String(o.path), B);
|
|
729
729
|
},
|
|
730
730
|
[e, o, i]
|
|
731
|
-
),
|
|
731
|
+
), z = j(
|
|
732
732
|
(B) => {
|
|
733
733
|
_(B), N(B);
|
|
734
734
|
},
|
|
@@ -742,7 +742,7 @@ function ae(e, t = "value", n = {}) {
|
|
|
742
742
|
}, [s, l]);
|
|
743
743
|
return {
|
|
744
744
|
value: x,
|
|
745
|
-
setValue:
|
|
745
|
+
setValue: z,
|
|
746
746
|
/** 写入 dataModel 但不上报(用于模式切换规范化等内部同步) */
|
|
747
747
|
setValueSilent: _,
|
|
748
748
|
hasBinding: !!i,
|
|
@@ -750,7 +750,7 @@ function ae(e, t = "value", n = {}) {
|
|
|
750
750
|
reportFocus: C
|
|
751
751
|
};
|
|
752
752
|
}
|
|
753
|
-
function
|
|
753
|
+
function Se(e) {
|
|
754
754
|
if (typeof e == "string") return e || void 0;
|
|
755
755
|
if (typeof e == "number") return String(e);
|
|
756
756
|
}
|
|
@@ -775,23 +775,33 @@ function pn(e, t, n, r, o) {
|
|
|
775
775
|
function hn(e, t) {
|
|
776
776
|
return t === void 0 || e.length <= t ? null : e.slice(0, t);
|
|
777
777
|
}
|
|
778
|
-
const gn =
|
|
778
|
+
const gn = Ce(null);
|
|
779
779
|
function lt({
|
|
780
780
|
caseSearch: e,
|
|
781
781
|
children: t
|
|
782
782
|
}) {
|
|
783
783
|
return /* @__PURE__ */ u(gn.Provider, { value: e ?? null, children: t });
|
|
784
784
|
}
|
|
785
|
-
function
|
|
786
|
-
return
|
|
785
|
+
function Gr() {
|
|
786
|
+
return Ae(gn);
|
|
787
787
|
}
|
|
788
788
|
function Xe(e) {
|
|
789
789
|
return typeof e == "string" ? e : "";
|
|
790
790
|
}
|
|
791
|
+
function Wr(e) {
|
|
792
|
+
if (Array.isArray(e)) return e.map(String).filter(Boolean);
|
|
793
|
+
if (typeof e == "string" && e.trim())
|
|
794
|
+
try {
|
|
795
|
+
const t = JSON.parse(e);
|
|
796
|
+
if (Array.isArray(t)) return t.map(String).filter(Boolean);
|
|
797
|
+
} catch {
|
|
798
|
+
}
|
|
799
|
+
return [];
|
|
800
|
+
}
|
|
791
801
|
function Ze(e) {
|
|
792
802
|
if (!e || typeof e != "object")
|
|
793
803
|
return { flowUniqueIds: [], pageSize: 20 };
|
|
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 =
|
|
804
|
+
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 = Wr(t.flowUniqueIds);
|
|
795
805
|
return { agentKind: o, agentUniqueId: i, flowType: s, category: a, flowUniqueIds: l, pageSize: r };
|
|
796
806
|
}
|
|
797
807
|
function et(e) {
|
|
@@ -799,10 +809,10 @@ function et(e) {
|
|
|
799
809
|
const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!(e.agentUniqueId && e.flowType && e.category);
|
|
800
810
|
return t || n;
|
|
801
811
|
}
|
|
802
|
-
function
|
|
812
|
+
function Yr(e) {
|
|
803
813
|
return JSON.stringify(e);
|
|
804
814
|
}
|
|
805
|
-
const
|
|
815
|
+
const Qr = {
|
|
806
816
|
name: "SkoponCaseSelect",
|
|
807
817
|
schema: h.object({
|
|
808
818
|
label: h.any().optional(),
|
|
@@ -815,7 +825,7 @@ const Wr = {
|
|
|
815
825
|
value: h.any().optional()
|
|
816
826
|
}).passthrough()
|
|
817
827
|
};
|
|
818
|
-
function
|
|
828
|
+
function Xr({
|
|
819
829
|
item: e,
|
|
820
830
|
selected: t,
|
|
821
831
|
disabled: n,
|
|
@@ -843,18 +853,18 @@ function Yr({
|
|
|
843
853
|
}
|
|
844
854
|
);
|
|
845
855
|
}
|
|
846
|
-
function
|
|
847
|
-
const { interactive: t } = se(), n =
|
|
856
|
+
function Zr({ context: e }) {
|
|
857
|
+
const { interactive: t } = se(), n = Gr(), { publishLiveOptions: r } = gt(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = ae(e, "value", {
|
|
848
858
|
component: "SkoponCaseSelect",
|
|
849
859
|
changeAction: "click"
|
|
850
|
-
}), l = e.componentModel.properties, c = Xe(l.label), m = Xe(l.placeholder), d = Xe(l.help), b = l.enableRefresh !== !1,
|
|
860
|
+
}), l = e.componentModel.properties, c = Xe(l.label), m = Xe(l.placeholder), d = Xe(l.help), b = l.enableRefresh !== !1, y = Pe(l.minCount), S = Pe(l.maxCount), g = L(() => Ze(l.caseFilter), [l.caseFilter]), k = Yr(g), [p, f] = w(1), [v, x] = w(!1), [N, _] = w(""), [z, C] = w([]), [B, V] = w(0), [re, K] = w(g.pageSize ?? 20), $ = A(0), W = Q(o);
|
|
851
861
|
q(() => {
|
|
852
862
|
const T = hn(W, S);
|
|
853
863
|
T !== null && s(T);
|
|
854
864
|
}, [S, W, s]);
|
|
855
|
-
const ee = L(() => n ? et(
|
|
865
|
+
const ee = L(() => n ? et(g) ? N || m || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, g, N, m]), te = j(
|
|
856
866
|
async (T) => {
|
|
857
|
-
const D = Ze(JSON.parse(k)),
|
|
867
|
+
const D = Ze(JSON.parse(k)), U = ++$.current;
|
|
858
868
|
if (!n || !et(D)) {
|
|
859
869
|
C([]), V(0), _(""), x(!1);
|
|
860
870
|
return;
|
|
@@ -862,7 +872,7 @@ function Qr({ context: e }) {
|
|
|
862
872
|
x(!0), _("");
|
|
863
873
|
try {
|
|
864
874
|
const I = await n({ filter: D, page: T });
|
|
865
|
-
if (
|
|
875
|
+
if (U !== $.current) return;
|
|
866
876
|
C(I.list), V(I.total), f(I.page), K(I.pageSize), a && r(
|
|
867
877
|
a,
|
|
868
878
|
I.list.map((Y) => ({
|
|
@@ -871,10 +881,10 @@ function Qr({ context: e }) {
|
|
|
871
881
|
}))
|
|
872
882
|
);
|
|
873
883
|
} catch (I) {
|
|
874
|
-
if (
|
|
884
|
+
if (U !== $.current) return;
|
|
875
885
|
C([]), V(0), _(I instanceof Error ? I.message : "加载案例列表失败");
|
|
876
886
|
} finally {
|
|
877
|
-
|
|
887
|
+
U === $.current && x(!1);
|
|
878
888
|
}
|
|
879
889
|
},
|
|
880
890
|
[n, k, a, r]
|
|
@@ -887,12 +897,12 @@ function Qr({ context: e }) {
|
|
|
887
897
|
const D = fn(
|
|
888
898
|
W,
|
|
889
899
|
T,
|
|
890
|
-
|
|
900
|
+
y,
|
|
891
901
|
S
|
|
892
902
|
);
|
|
893
903
|
D !== null && i(D);
|
|
894
|
-
},
|
|
895
|
-
const T = Ze(JSON.parse(k)), D = re || T.pageSize || 20,
|
|
904
|
+
}, P = () => {
|
|
905
|
+
const T = Ze(JSON.parse(k)), D = re || T.pageSize || 20, U = Math.max(1, Math.ceil(B / D)), I = p >= U ? 1 : p + 1;
|
|
896
906
|
te(I);
|
|
897
907
|
};
|
|
898
908
|
return /* @__PURE__ */ M(
|
|
@@ -902,13 +912,13 @@ function Qr({ context: e }) {
|
|
|
902
912
|
"data-skopon-field": a || void 0,
|
|
903
913
|
children: [
|
|
904
914
|
c ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: c }) : null,
|
|
905
|
-
v &&
|
|
915
|
+
v && z.length === 0 ? /* @__PURE__ */ M("div", { className: "skopon-resume-select-status", children: [
|
|
906
916
|
/* @__PURE__ */ u(ft, { size: "small" }),
|
|
907
917
|
" 加载案例…"
|
|
908
918
|
] }) : null,
|
|
909
|
-
!v &&
|
|
910
|
-
|
|
911
|
-
|
|
919
|
+
!v && z.length === 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-empty", children: ee }) : null,
|
|
920
|
+
z.length > 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-list", children: z.map((T) => /* @__PURE__ */ u(
|
|
921
|
+
Xr,
|
|
912
922
|
{
|
|
913
923
|
item: T,
|
|
914
924
|
selected: W.includes(T.caseUniqueId),
|
|
@@ -916,14 +926,14 @@ function Qr({ context: e }) {
|
|
|
916
926
|
W,
|
|
917
927
|
T.caseUniqueId,
|
|
918
928
|
t,
|
|
919
|
-
|
|
929
|
+
y,
|
|
920
930
|
S
|
|
921
931
|
),
|
|
922
932
|
onToggle: () => E(T.caseUniqueId)
|
|
923
933
|
},
|
|
924
934
|
T.caseUniqueId
|
|
925
935
|
)) }) : null,
|
|
926
|
-
b && n && et(
|
|
936
|
+
b && n && et(g) ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ u(
|
|
927
937
|
Oe,
|
|
928
938
|
{
|
|
929
939
|
type: "default",
|
|
@@ -931,7 +941,7 @@ function Qr({ context: e }) {
|
|
|
931
941
|
icon: /* @__PURE__ */ u(Yt, {}),
|
|
932
942
|
loading: v,
|
|
933
943
|
disabled: !t,
|
|
934
|
-
onClick:
|
|
944
|
+
onClick: P,
|
|
935
945
|
children: "换一批"
|
|
936
946
|
}
|
|
937
947
|
) }) : null,
|
|
@@ -940,15 +950,15 @@ function Qr({ context: e }) {
|
|
|
940
950
|
}
|
|
941
951
|
);
|
|
942
952
|
}
|
|
943
|
-
const
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
),
|
|
953
|
+
const eo = X(
|
|
954
|
+
Qr,
|
|
955
|
+
Zr
|
|
956
|
+
), to = {
|
|
947
957
|
type: "case_multiselect",
|
|
948
958
|
componentName: "SkoponCaseSelect",
|
|
949
|
-
toComponent:
|
|
950
|
-
fromComponent:
|
|
951
|
-
catalogComponents: [
|
|
959
|
+
toComponent: Or,
|
|
960
|
+
fromComponent: qr,
|
|
961
|
+
catalogComponents: [eo]
|
|
952
962
|
};
|
|
953
963
|
function Kt(e) {
|
|
954
964
|
if (e == null) return;
|
|
@@ -956,7 +966,7 @@ function Kt(e) {
|
|
|
956
966
|
if (!(!Number.isFinite(t) || t < 1))
|
|
957
967
|
return Math.floor(t);
|
|
958
968
|
}
|
|
959
|
-
function
|
|
969
|
+
function no(e, t) {
|
|
960
970
|
var s, a, l, c;
|
|
961
971
|
const { id: n, label: r, path: o, withData: i } = t;
|
|
962
972
|
return i({
|
|
@@ -977,7 +987,7 @@ function eo(e, t) {
|
|
|
977
987
|
value: { path: o }
|
|
978
988
|
});
|
|
979
989
|
}
|
|
980
|
-
function
|
|
990
|
+
function ro(e, t, n) {
|
|
981
991
|
const r = n.nameFromValue(e.value), o = {
|
|
982
992
|
...t("resume_multiselect"),
|
|
983
993
|
name: r,
|
|
@@ -999,15 +1009,15 @@ function to(e, t, n) {
|
|
|
999
1009
|
const l = Kt(e.maxCount);
|
|
1000
1010
|
return l !== void 0 && (o.resumeMaxCount = l), o;
|
|
1001
1011
|
}
|
|
1002
|
-
const yn =
|
|
1012
|
+
const yn = Ce(null);
|
|
1003
1013
|
function ct({
|
|
1004
1014
|
resumeSearch: e,
|
|
1005
1015
|
children: t
|
|
1006
1016
|
}) {
|
|
1007
1017
|
return /* @__PURE__ */ u(yn.Provider, { value: e ?? null, children: t });
|
|
1008
1018
|
}
|
|
1009
|
-
function
|
|
1010
|
-
return
|
|
1019
|
+
function oo() {
|
|
1020
|
+
return Ae(yn);
|
|
1011
1021
|
}
|
|
1012
1022
|
function tt(e) {
|
|
1013
1023
|
return typeof e == "string" ? e : "";
|
|
@@ -1018,10 +1028,10 @@ function nt(e) {
|
|
|
1018
1028
|
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;
|
|
1019
1029
|
return { names: n, agentUniqueIds: r, resumeUniqueIds: o, pageSize: s };
|
|
1020
1030
|
}
|
|
1021
|
-
function
|
|
1031
|
+
function io(e) {
|
|
1022
1032
|
return JSON.stringify(e);
|
|
1023
1033
|
}
|
|
1024
|
-
const
|
|
1034
|
+
const so = {
|
|
1025
1035
|
name: "SkoponResumeSelect",
|
|
1026
1036
|
schema: h.object({
|
|
1027
1037
|
label: h.any().optional(),
|
|
@@ -1033,39 +1043,39 @@ const oo = {
|
|
|
1033
1043
|
maxCount: h.any().optional(),
|
|
1034
1044
|
value: h.any().optional()
|
|
1035
1045
|
}).passthrough()
|
|
1036
|
-
},
|
|
1046
|
+
}, ao = 3, lo = 2;
|
|
1037
1047
|
function rt(e, t) {
|
|
1038
|
-
const n = (t ?? []).filter(Boolean), r = n.slice(0,
|
|
1048
|
+
const n = (t ?? []).filter(Boolean), r = n.slice(0, ao), o = n.length - r.length;
|
|
1039
1049
|
return /* @__PURE__ */ M("div", { className: "skopon-resume-select-card-tags", children: [
|
|
1040
1050
|
/* @__PURE__ */ u("span", { className: "skopon-resume-select-card-tags-label", children: e }),
|
|
1041
1051
|
n.length > 0 ? /* @__PURE__ */ M("div", { className: "skopon-resume-select-card-tags-list", children: [
|
|
1042
|
-
r.map((i) => /* @__PURE__ */ u(
|
|
1043
|
-
o > 0 ? /* @__PURE__ */ M(
|
|
1052
|
+
r.map((i) => /* @__PURE__ */ u(ve, { className: "skopon-resume-select-card-tag", children: i }, i)),
|
|
1053
|
+
o > 0 ? /* @__PURE__ */ M(ve, { className: "skopon-resume-select-card-tag", children: [
|
|
1044
1054
|
"+",
|
|
1045
1055
|
o
|
|
1046
1056
|
] }) : null
|
|
1047
1057
|
] }) : /* @__PURE__ */ u("span", { className: "skopon-resume-select-card-tags-empty", children: "暂无" })
|
|
1048
1058
|
] });
|
|
1049
1059
|
}
|
|
1050
|
-
function
|
|
1060
|
+
function co(e) {
|
|
1051
1061
|
return /* @__PURE__ */ M("div", { className: "skopon-resume-select-card-field", children: [
|
|
1052
1062
|
/* @__PURE__ */ u("span", { className: "skopon-resume-select-card-tags-label", children: "满意度" }),
|
|
1053
1063
|
/* @__PURE__ */ u("span", { className: "skopon-resume-select-card-field-value", children: typeof e == "number" ? `${e}%` : "暂无" })
|
|
1054
1064
|
] });
|
|
1055
1065
|
}
|
|
1056
|
-
function
|
|
1066
|
+
function uo({ work: e }) {
|
|
1057
1067
|
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(
|
|
1068
|
+
/* @__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(Qn, { className: "skopon-resume-select-card-work-placeholder" }) }),
|
|
1059
1069
|
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-work-title", children: e.title || "未命名作品" })
|
|
1060
1070
|
] });
|
|
1061
1071
|
}
|
|
1062
|
-
function
|
|
1072
|
+
function mo({
|
|
1063
1073
|
item: e,
|
|
1064
1074
|
selected: t,
|
|
1065
1075
|
disabled: n,
|
|
1066
1076
|
onToggle: r
|
|
1067
1077
|
}) {
|
|
1068
|
-
const o = (e.works ?? []).slice(0,
|
|
1078
|
+
const o = (e.works ?? []).slice(0, lo);
|
|
1069
1079
|
return /* @__PURE__ */ M(
|
|
1070
1080
|
"button",
|
|
1071
1081
|
{
|
|
@@ -1075,41 +1085,41 @@ function co({
|
|
|
1075
1085
|
onClick: r,
|
|
1076
1086
|
children: [
|
|
1077
1087
|
/* @__PURE__ */ u(
|
|
1078
|
-
|
|
1088
|
+
jn,
|
|
1079
1089
|
{
|
|
1080
1090
|
size: 48,
|
|
1081
1091
|
src: e.avatarUrl || void 0,
|
|
1082
|
-
icon: e.avatarUrl ? void 0 : /* @__PURE__ */ u(
|
|
1092
|
+
icon: e.avatarUrl ? void 0 : /* @__PURE__ */ u(Yn, {}),
|
|
1083
1093
|
className: "skopon-resume-select-card-avatar"
|
|
1084
1094
|
}
|
|
1085
1095
|
),
|
|
1086
1096
|
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-name", children: e.name || "未命名简历" }),
|
|
1087
1097
|
/* @__PURE__ */ M("div", { className: "skopon-resume-select-card-body", children: [
|
|
1088
|
-
|
|
1098
|
+
co(e.satisfaction),
|
|
1089
1099
|
rt("性格", e.personality),
|
|
1090
1100
|
rt("专长", e.specialties),
|
|
1091
1101
|
rt("擅长领域", e.traits),
|
|
1092
1102
|
/* @__PURE__ */ M("div", { className: "skopon-resume-select-card-works", children: [
|
|
1093
1103
|
/* @__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(
|
|
1104
|
+
o.length > 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, s) => /* @__PURE__ */ u(uo, { work: i }, `${i.title}-${s}`)) }) : /* @__PURE__ */ u("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
|
|
1095
1105
|
] })
|
|
1096
1106
|
] })
|
|
1097
1107
|
]
|
|
1098
1108
|
}
|
|
1099
1109
|
);
|
|
1100
1110
|
}
|
|
1101
|
-
function
|
|
1102
|
-
const { interactive: t } = se(), n =
|
|
1111
|
+
function fo({ context: e }) {
|
|
1112
|
+
const { interactive: t } = se(), n = oo(), { publishLiveOptions: r } = gt(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = ae(e, "value", {
|
|
1103
1113
|
component: "SkoponResumeSelect",
|
|
1104
1114
|
changeAction: "click"
|
|
1105
|
-
}), l = e.componentModel.properties, c = tt(l.label), m = tt(l.placeholder), d = tt(l.help), b = l.enableRefresh !== !1,
|
|
1115
|
+
}), l = e.componentModel.properties, c = tt(l.label), m = tt(l.placeholder), d = tt(l.help), b = l.enableRefresh !== !1, y = Pe(l.minCount), S = Pe(l.maxCount), g = L(() => nt(l.resumeFilter), [l.resumeFilter]), k = io(g), [p, f] = w(1), [v, x] = w(!1), [N, _] = w(""), [z, C] = w([]), [B, V] = w(0), [re, K] = w(g.pageSize ?? 20), $ = A(0), W = Q(o);
|
|
1106
1116
|
q(() => {
|
|
1107
1117
|
const T = hn(W, S);
|
|
1108
1118
|
T !== null && s(T);
|
|
1109
1119
|
}, [S, W, s]);
|
|
1110
1120
|
const ee = j(
|
|
1111
1121
|
async (T) => {
|
|
1112
|
-
const D = nt(JSON.parse(k)),
|
|
1122
|
+
const D = nt(JSON.parse(k)), U = ++$.current;
|
|
1113
1123
|
if (!n) {
|
|
1114
1124
|
C([]), V(0), _("未配置简历搜索服务"), x(!1);
|
|
1115
1125
|
return;
|
|
@@ -1117,7 +1127,7 @@ function uo({ context: e }) {
|
|
|
1117
1127
|
x(!0), _("");
|
|
1118
1128
|
try {
|
|
1119
1129
|
const I = await n({ filter: D, page: T });
|
|
1120
|
-
if (
|
|
1130
|
+
if (U !== $.current) return;
|
|
1121
1131
|
C(I.list), V(I.total), f(I.page), K(I.pageSize), a && r(
|
|
1122
1132
|
a,
|
|
1123
1133
|
I.list.map((Y) => ({
|
|
@@ -1126,10 +1136,10 @@ function uo({ context: e }) {
|
|
|
1126
1136
|
}))
|
|
1127
1137
|
);
|
|
1128
1138
|
} catch (I) {
|
|
1129
|
-
if (
|
|
1139
|
+
if (U !== $.current) return;
|
|
1130
1140
|
C([]), V(0), _(I instanceof Error ? I.message : "加载简历列表失败");
|
|
1131
1141
|
} finally {
|
|
1132
|
-
|
|
1142
|
+
U === $.current && x(!1);
|
|
1133
1143
|
}
|
|
1134
1144
|
},
|
|
1135
1145
|
[n, k, a, r]
|
|
@@ -1142,14 +1152,14 @@ function uo({ context: e }) {
|
|
|
1142
1152
|
const D = fn(
|
|
1143
1153
|
W,
|
|
1144
1154
|
T,
|
|
1145
|
-
|
|
1155
|
+
y,
|
|
1146
1156
|
S
|
|
1147
1157
|
);
|
|
1148
1158
|
D !== null && i(D);
|
|
1149
1159
|
}, E = () => {
|
|
1150
|
-
const T = nt(JSON.parse(k)), D = re || T.pageSize || 20,
|
|
1160
|
+
const T = nt(JSON.parse(k)), D = re || T.pageSize || 20, U = Math.max(1, Math.ceil(B / D)), I = p >= U ? 1 : p + 1;
|
|
1151
1161
|
ee(I);
|
|
1152
|
-
},
|
|
1162
|
+
}, P = m || "暂无匹配的简历";
|
|
1153
1163
|
return /* @__PURE__ */ M(
|
|
1154
1164
|
"div",
|
|
1155
1165
|
{
|
|
@@ -1157,14 +1167,14 @@ function uo({ context: e }) {
|
|
|
1157
1167
|
"data-skopon-field": a || void 0,
|
|
1158
1168
|
children: [
|
|
1159
1169
|
c ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: c }) : null,
|
|
1160
|
-
v &&
|
|
1170
|
+
v && z.length === 0 ? /* @__PURE__ */ M("div", { className: "skopon-resume-select-status", children: [
|
|
1161
1171
|
/* @__PURE__ */ u(ft, { size: "small" }),
|
|
1162
1172
|
" 加载简历…"
|
|
1163
1173
|
] }) : null,
|
|
1164
1174
|
!v && N ? /* @__PURE__ */ u(ne.Text, { type: "danger", className: "skopon-resume-select-status", children: N }) : null,
|
|
1165
|
-
!v && !N &&
|
|
1166
|
-
|
|
1167
|
-
|
|
1175
|
+
!v && !N && z.length === 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-empty", children: P }) : null,
|
|
1176
|
+
z.length > 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-list", children: z.map((T) => /* @__PURE__ */ u(
|
|
1177
|
+
mo,
|
|
1168
1178
|
{
|
|
1169
1179
|
item: T,
|
|
1170
1180
|
selected: W.includes(T.resumeUniqueId),
|
|
@@ -1172,7 +1182,7 @@ function uo({ context: e }) {
|
|
|
1172
1182
|
W,
|
|
1173
1183
|
T.resumeUniqueId,
|
|
1174
1184
|
t,
|
|
1175
|
-
|
|
1185
|
+
y,
|
|
1176
1186
|
S
|
|
1177
1187
|
),
|
|
1178
1188
|
onToggle: () => te(T.resumeUniqueId)
|
|
@@ -1196,34 +1206,34 @@ function uo({ context: e }) {
|
|
|
1196
1206
|
}
|
|
1197
1207
|
);
|
|
1198
1208
|
}
|
|
1199
|
-
const
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
),
|
|
1209
|
+
const po = X(
|
|
1210
|
+
so,
|
|
1211
|
+
fo
|
|
1212
|
+
), ho = {
|
|
1203
1213
|
type: "resume_multiselect",
|
|
1204
1214
|
componentName: "SkoponResumeSelect",
|
|
1205
|
-
toComponent:
|
|
1206
|
-
fromComponent:
|
|
1207
|
-
catalogComponents: [
|
|
1208
|
-
}, Be = [
|
|
1215
|
+
toComponent: no,
|
|
1216
|
+
fromComponent: ro,
|
|
1217
|
+
catalogComponents: [po]
|
|
1218
|
+
}, Be = [ho, to], go = new Map(
|
|
1209
1219
|
Be.map((e) => [e.type, e])
|
|
1210
|
-
),
|
|
1220
|
+
), yo = new Map(
|
|
1211
1221
|
Be.map((e) => [e.componentName, e])
|
|
1212
1222
|
);
|
|
1213
|
-
function
|
|
1214
|
-
return
|
|
1223
|
+
function vo(e) {
|
|
1224
|
+
return go.get(e);
|
|
1215
1225
|
}
|
|
1216
|
-
function
|
|
1217
|
-
return
|
|
1226
|
+
function bo(e) {
|
|
1227
|
+
return yo.get(e);
|
|
1218
1228
|
}
|
|
1219
|
-
function
|
|
1229
|
+
function So() {
|
|
1220
1230
|
return Be.flatMap((e) => e.catalogComponents);
|
|
1221
1231
|
}
|
|
1222
|
-
function
|
|
1232
|
+
function ko() {
|
|
1223
1233
|
return Be.map((e) => e.componentName);
|
|
1224
1234
|
}
|
|
1225
1235
|
const we = "root", ut = "__title__", mt = "__desc__", yt = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
|
|
1226
|
-
function
|
|
1236
|
+
function Co(e) {
|
|
1227
1237
|
return `/${e}`;
|
|
1228
1238
|
}
|
|
1229
1239
|
function Jt(e) {
|
|
@@ -1232,27 +1242,27 @@ function Jt(e) {
|
|
|
1232
1242
|
function H(e) {
|
|
1233
1243
|
if (typeof e == "string") return e;
|
|
1234
1244
|
}
|
|
1235
|
-
function
|
|
1245
|
+
function Ao(e) {
|
|
1236
1246
|
const t = e.id || le("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
|
|
1237
1247
|
return {
|
|
1238
1248
|
id: t,
|
|
1239
1249
|
component: "SkoponMedia",
|
|
1240
1250
|
mediaType: n,
|
|
1241
|
-
urls:
|
|
1242
|
-
mediaSize:
|
|
1251
|
+
urls: Ar(e),
|
|
1252
|
+
mediaSize: xe(e.mediaSize),
|
|
1243
1253
|
label: e.label ?? "",
|
|
1244
1254
|
help: e.help ?? "",
|
|
1245
1255
|
placeholder: e.placeholder ?? ""
|
|
1246
1256
|
};
|
|
1247
1257
|
}
|
|
1248
|
-
function
|
|
1258
|
+
function _o(e) {
|
|
1249
1259
|
if (Array.isArray(e.urls))
|
|
1250
1260
|
return e.urls.map((n) => String(n).trim()).filter(Boolean);
|
|
1251
1261
|
const t = H(e.url);
|
|
1252
1262
|
return t != null && t.trim() ? [t.trim()] : [];
|
|
1253
1263
|
}
|
|
1254
1264
|
function Fe(e, t, n) {
|
|
1255
|
-
const r = typeof e.id == "string" ? e.id : le("block-"), o =
|
|
1265
|
+
const r = typeof e.id == "string" ? e.id : le("block-"), o = _o(e), i = H(e.label) ?? H(e.description) ?? n, s = H(e.help), a = H(e.placeholder), l = xe(e.mediaSize);
|
|
1256
1266
|
return {
|
|
1257
1267
|
id: r,
|
|
1258
1268
|
type: t,
|
|
@@ -1266,7 +1276,7 @@ function Fe(e, t, n) {
|
|
|
1266
1276
|
function Gt(e) {
|
|
1267
1277
|
switch (e.type) {
|
|
1268
1278
|
case "toggle":
|
|
1269
|
-
return
|
|
1279
|
+
return Me(e.defaultValue);
|
|
1270
1280
|
case "multiselect":
|
|
1271
1281
|
case "checkbox":
|
|
1272
1282
|
case "resume_multiselect":
|
|
@@ -1280,9 +1290,9 @@ function Gt(e) {
|
|
|
1280
1290
|
return typeof e.defaultValue == "string" ? e.defaultValue : "";
|
|
1281
1291
|
}
|
|
1282
1292
|
}
|
|
1283
|
-
function
|
|
1293
|
+
function To(e) {
|
|
1284
1294
|
var c;
|
|
1285
|
-
const t = e.id || le("a2-"), n = e.label ?? "", r = ((c = e.name) == null ? void 0 : c.trim()) || "", o = r ?
|
|
1295
|
+
const t = e.id || le("a2-"), n = e.label ?? "", r = ((c = e.name) == null ? void 0 : c.trim()) || "", o = r ? Co(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 = vo(e.type);
|
|
1286
1296
|
if (l)
|
|
1287
1297
|
return l.toComponent(e, a);
|
|
1288
1298
|
switch (e.type) {
|
|
@@ -1401,7 +1411,7 @@ function Ao(e) {
|
|
|
1401
1411
|
case "image":
|
|
1402
1412
|
case "video":
|
|
1403
1413
|
case "audio":
|
|
1404
|
-
return { node:
|
|
1414
|
+
return { node: Ao(e) };
|
|
1405
1415
|
case "file":
|
|
1406
1416
|
return s({
|
|
1407
1417
|
id: t,
|
|
@@ -1429,14 +1439,14 @@ function vn(e, t) {
|
|
|
1429
1439
|
const n = [], r = [], o = {}, i = (t == null ? void 0 : t.includeHeader) !== !1, s = (e.title ?? "").trim(), a = (e.description ?? "").trim();
|
|
1430
1440
|
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));
|
|
1431
1441
|
for (const m of e.blocks ?? []) {
|
|
1432
|
-
const { node: d, dataKey: b, dataValue:
|
|
1433
|
-
b && (o[b] =
|
|
1442
|
+
const { node: d, dataKey: b, dataValue: y } = To(m);
|
|
1443
|
+
b && (o[b] = y), d && (n.push(d), r.push(d.id));
|
|
1434
1444
|
}
|
|
1435
1445
|
n.unshift({ id: we, component: "Column", children: r });
|
|
1436
1446
|
const l = { root: we, components: n, dataModel: o }, c = t == null ? void 0 : t.styleId;
|
|
1437
1447
|
return c !== void 0 && (l.surfaceProperties = { styleId: c ?? null }), l;
|
|
1438
1448
|
}
|
|
1439
|
-
function
|
|
1449
|
+
function xo(e) {
|
|
1440
1450
|
const t = /* @__PURE__ */ new Map();
|
|
1441
1451
|
for (const n of e.components ?? [])
|
|
1442
1452
|
n && typeof n.id == "string" && t.set(n.id, n);
|
|
@@ -1453,8 +1463,8 @@ function ot(e) {
|
|
|
1453
1463
|
};
|
|
1454
1464
|
}).filter((n) => !!n) : [];
|
|
1455
1465
|
}
|
|
1456
|
-
function
|
|
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 =
|
|
1466
|
+
function Mo(e) {
|
|
1467
|
+
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 = bo(n);
|
|
1458
1468
|
if (s)
|
|
1459
1469
|
return s.fromComponent(e, i, { asLiteral: H, nameFromValue: Jt });
|
|
1460
1470
|
switch (n) {
|
|
@@ -1527,19 +1537,19 @@ function bn(e, t, n, r) {
|
|
|
1527
1537
|
}
|
|
1528
1538
|
r.push(o);
|
|
1529
1539
|
}
|
|
1530
|
-
function
|
|
1540
|
+
function No(e, t) {
|
|
1531
1541
|
return t ? e.map((n) => {
|
|
1532
1542
|
var i;
|
|
1533
1543
|
const r = (i = n.name) == null ? void 0 : i.trim();
|
|
1534
1544
|
if (!r || !(r in t)) return n;
|
|
1535
1545
|
const o = t[r];
|
|
1536
|
-
return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue:
|
|
1546
|
+
return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue: Me(o) } : { ...n, defaultValue: o };
|
|
1537
1547
|
}) : e;
|
|
1538
1548
|
}
|
|
1539
|
-
function
|
|
1549
|
+
function Io(e) {
|
|
1540
1550
|
if (!e || !Array.isArray(e.components))
|
|
1541
|
-
return
|
|
1542
|
-
const t =
|
|
1551
|
+
return be({ title: "", description: "", blocks: [] });
|
|
1552
|
+
const t = xo(e), n = [];
|
|
1543
1553
|
bn(e.root ?? we, t, /* @__PURE__ */ new Set(), n);
|
|
1544
1554
|
let r = "", o = "";
|
|
1545
1555
|
const i = [];
|
|
@@ -1552,16 +1562,16 @@ function Mo(e) {
|
|
|
1552
1562
|
o = H(s.text) ?? o;
|
|
1553
1563
|
continue;
|
|
1554
1564
|
}
|
|
1555
|
-
const a =
|
|
1565
|
+
const a = Mo(s);
|
|
1556
1566
|
a && i.push(a);
|
|
1557
1567
|
}
|
|
1558
|
-
return
|
|
1568
|
+
return be({
|
|
1559
1569
|
title: r,
|
|
1560
1570
|
description: o,
|
|
1561
|
-
blocks:
|
|
1571
|
+
blocks: No(i, e.dataModel)
|
|
1562
1572
|
});
|
|
1563
1573
|
}
|
|
1564
|
-
function
|
|
1574
|
+
function Fo(e, t) {
|
|
1565
1575
|
const { surfaceId: n, catalogId: r } = t, o = [
|
|
1566
1576
|
{ version: "v0.9", createSurface: { surfaceId: n, catalogId: r } },
|
|
1567
1577
|
{
|
|
@@ -1577,7 +1587,7 @@ function No(e, t) {
|
|
|
1577
1587
|
function Sn(e) {
|
|
1578
1588
|
return !!e && typeof e == "object" && !Array.isArray(e) && Array.isArray(e.components);
|
|
1579
1589
|
}
|
|
1580
|
-
function
|
|
1590
|
+
function Eo(e, t) {
|
|
1581
1591
|
if (!e || typeof e != "object") return null;
|
|
1582
1592
|
const n = e, r = Sn(n.a2ui) ? n.a2ui : void 0;
|
|
1583
1593
|
if (r && !dt(r)) return r;
|
|
@@ -1591,7 +1601,7 @@ function Io(e, t) {
|
|
|
1591
1601
|
}), s = vn(i, t);
|
|
1592
1602
|
return dt(s) ? null : s;
|
|
1593
1603
|
}
|
|
1594
|
-
function
|
|
1604
|
+
function Uo(e, t, n) {
|
|
1595
1605
|
return vn(
|
|
1596
1606
|
{
|
|
1597
1607
|
title: e.title,
|
|
@@ -1601,18 +1611,18 @@ function Fo(e, t, n) {
|
|
|
1601
1611
|
n
|
|
1602
1612
|
);
|
|
1603
1613
|
}
|
|
1604
|
-
function
|
|
1614
|
+
function Ro(e) {
|
|
1605
1615
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1606
1616
|
return;
|
|
1607
1617
|
const t = e;
|
|
1608
|
-
return !(Array.isArray(t.blocks) && t.blocks.length > 0) && Sn(t.a2ui) ?
|
|
1618
|
+
return !(Array.isArray(t.blocks) && t.blocks.length > 0) && Sn(t.a2ui) ? Io(t.a2ui) : qe({
|
|
1609
1619
|
title: typeof t.title == "string" ? t.title : "",
|
|
1610
1620
|
description: typeof t.description == "string" ? t.description : "",
|
|
1611
1621
|
blocks: Array.isArray(t.blocks) ? t.blocks : [],
|
|
1612
1622
|
jsonSchema: on(t.jsonSchema ?? t.json_schema)
|
|
1613
1623
|
});
|
|
1614
1624
|
}
|
|
1615
|
-
function
|
|
1625
|
+
function Po(e, t, n) {
|
|
1616
1626
|
const r = e.model.surfacesMap.get(t);
|
|
1617
1627
|
if (!r) return {};
|
|
1618
1628
|
const o = {};
|
|
@@ -1622,7 +1632,7 @@ function Uo(e, t, n) {
|
|
|
1622
1632
|
}
|
|
1623
1633
|
return o;
|
|
1624
1634
|
}
|
|
1625
|
-
const
|
|
1635
|
+
const wo = /* @__PURE__ */ new Set(["type", "name", "id"]);
|
|
1626
1636
|
function vt(e) {
|
|
1627
1637
|
return e.type === "text" && e.hidden === !0;
|
|
1628
1638
|
}
|
|
@@ -1633,7 +1643,7 @@ function bt(e) {
|
|
|
1633
1643
|
blocks: [e]
|
|
1634
1644
|
}).blocks[0];
|
|
1635
1645
|
}
|
|
1636
|
-
function
|
|
1646
|
+
function zo(e, t) {
|
|
1637
1647
|
var o, i;
|
|
1638
1648
|
const n = /* @__PURE__ */ new Map();
|
|
1639
1649
|
for (const s of t) {
|
|
@@ -1642,7 +1652,7 @@ function Po(e, t) {
|
|
|
1642
1652
|
}
|
|
1643
1653
|
const r = [];
|
|
1644
1654
|
for (const s of e.blocks) {
|
|
1645
|
-
if (
|
|
1655
|
+
if (_e(s.type)) {
|
|
1646
1656
|
r.push(bt(s));
|
|
1647
1657
|
continue;
|
|
1648
1658
|
}
|
|
@@ -1654,7 +1664,7 @@ function Po(e, t) {
|
|
|
1654
1664
|
}
|
|
1655
1665
|
return r;
|
|
1656
1666
|
}
|
|
1657
|
-
function
|
|
1667
|
+
function Oo(e, t, n) {
|
|
1658
1668
|
const r = e.rawBlocks;
|
|
1659
1669
|
if (!(r != null && r.length)) return n;
|
|
1660
1670
|
for (const o of r) {
|
|
@@ -1663,11 +1673,11 @@ function wo(e, t, n) {
|
|
|
1663
1673
|
}
|
|
1664
1674
|
return n;
|
|
1665
1675
|
}
|
|
1666
|
-
function
|
|
1676
|
+
function qo(e, t) {
|
|
1667
1677
|
var r;
|
|
1668
1678
|
const n = { ...e };
|
|
1669
1679
|
for (const o of Object.keys(t)) {
|
|
1670
|
-
if (
|
|
1680
|
+
if (wo.has(o) || !Object.prototype.hasOwnProperty.call(t, o)) continue;
|
|
1671
1681
|
const i = t[o];
|
|
1672
1682
|
i !== void 0 && Object.assign(n, { [o]: i });
|
|
1673
1683
|
}
|
|
@@ -1691,7 +1701,7 @@ function Ve(e) {
|
|
|
1691
1701
|
rawBlocks: n
|
|
1692
1702
|
};
|
|
1693
1703
|
}
|
|
1694
|
-
function
|
|
1704
|
+
function Bo(e, t) {
|
|
1695
1705
|
var i, s, a, l, c, m;
|
|
1696
1706
|
const n = /* @__PURE__ */ new Map();
|
|
1697
1707
|
for (const d of (t == null ? void 0 : t.blocks) ?? [])
|
|
@@ -1701,17 +1711,17 @@ function Oo(e, t) {
|
|
|
1701
1711
|
if (!Z(d.type)) continue;
|
|
1702
1712
|
const b = (s = d.name) == null ? void 0 : s.trim();
|
|
1703
1713
|
if (!b) continue;
|
|
1704
|
-
const
|
|
1705
|
-
if (
|
|
1706
|
-
const S =
|
|
1707
|
-
r.push(
|
|
1714
|
+
const y = n.get(b);
|
|
1715
|
+
if (y) {
|
|
1716
|
+
const S = Oo(e, b, d);
|
|
1717
|
+
r.push(qo(y, S));
|
|
1708
1718
|
} else
|
|
1709
1719
|
o.push(bt(d));
|
|
1710
1720
|
}
|
|
1711
1721
|
return {
|
|
1712
1722
|
matchedBlocks: r,
|
|
1713
1723
|
extraBlocks: o,
|
|
1714
|
-
renderBlocks:
|
|
1724
|
+
renderBlocks: zo(e, r),
|
|
1715
1725
|
title: ((a = e.title) == null ? void 0 : a.trim()) || ((l = t == null ? void 0 : t.title) == null ? void 0 : l.trim()) || "",
|
|
1716
1726
|
description: ((c = e.description) == null ? void 0 : c.trim()) || ((m = t == null ? void 0 : t.description) == null ? void 0 : m.trim()) || ""
|
|
1717
1727
|
};
|
|
@@ -1730,7 +1740,7 @@ function ze(e) {
|
|
|
1730
1740
|
}
|
|
1731
1741
|
return t;
|
|
1732
1742
|
}
|
|
1733
|
-
function
|
|
1743
|
+
function Vo(e) {
|
|
1734
1744
|
return e.blocks.some(
|
|
1735
1745
|
(t) => {
|
|
1736
1746
|
var n;
|
|
@@ -1738,19 +1748,19 @@ function qo(e) {
|
|
|
1738
1748
|
}
|
|
1739
1749
|
);
|
|
1740
1750
|
}
|
|
1741
|
-
function
|
|
1751
|
+
function Lo(e) {
|
|
1742
1752
|
return e.blocks.filter((t) => {
|
|
1743
1753
|
var n;
|
|
1744
|
-
return
|
|
1754
|
+
return _e(t.type) ? !0 : !Z(t.type) || !((n = t.name) != null && n.trim()) ? !1 : !vt(t);
|
|
1745
1755
|
});
|
|
1746
1756
|
}
|
|
1747
|
-
function
|
|
1757
|
+
function bs(e) {
|
|
1748
1758
|
return e.blocks.filter((t) => {
|
|
1749
1759
|
var n;
|
|
1750
1760
|
return Z(t.type) && ((n = t.name) == null ? void 0 : n.trim());
|
|
1751
1761
|
}).map((t) => t.name.trim());
|
|
1752
1762
|
}
|
|
1753
|
-
function
|
|
1763
|
+
function jo(e) {
|
|
1754
1764
|
var n;
|
|
1755
1765
|
const t = {};
|
|
1756
1766
|
for (const r of e.blocks) {
|
|
@@ -1778,16 +1788,16 @@ function An(e, t, n) {
|
|
|
1778
1788
|
].join(`
|
|
1779
1789
|
`);
|
|
1780
1790
|
}
|
|
1781
|
-
function
|
|
1791
|
+
function $o(e, t) {
|
|
1782
1792
|
return JSON.stringify({ ...e, ...t }, null, 2);
|
|
1783
1793
|
}
|
|
1784
|
-
function
|
|
1794
|
+
function Do({
|
|
1785
1795
|
cardValues: e,
|
|
1786
1796
|
extraValues: t = {},
|
|
1787
1797
|
callbackUrl: n,
|
|
1788
1798
|
headers: r
|
|
1789
1799
|
}) {
|
|
1790
|
-
const o = (n ?? "").trim() || "<callback_url>", i =
|
|
1800
|
+
const o = (n ?? "").trim() || "<callback_url>", i = $o(e, t);
|
|
1791
1801
|
return [
|
|
1792
1802
|
`curl -X POST '${o}' \\`,
|
|
1793
1803
|
" -H 'Content-Type: application/json' \\",
|
|
@@ -1796,11 +1806,11 @@ function jo({
|
|
|
1796
1806
|
].join(`
|
|
1797
1807
|
`);
|
|
1798
1808
|
}
|
|
1799
|
-
function
|
|
1809
|
+
function Ss(e, t, n) {
|
|
1800
1810
|
const r = Ve(e);
|
|
1801
1811
|
if (!r) return An(e, t, n);
|
|
1802
1812
|
const o = ze(r.blocks);
|
|
1803
|
-
return
|
|
1813
|
+
return Do({ cardValues: o, callbackUrl: t, headers: n });
|
|
1804
1814
|
}
|
|
1805
1815
|
async function _n(e, t, n) {
|
|
1806
1816
|
const r = e.trim();
|
|
@@ -1829,7 +1839,7 @@ async function _n(e, t, n) {
|
|
|
1829
1839
|
}
|
|
1830
1840
|
return { ok: i.ok, status: i.status, body: s };
|
|
1831
1841
|
}
|
|
1832
|
-
async function
|
|
1842
|
+
async function ks(e) {
|
|
1833
1843
|
var n;
|
|
1834
1844
|
if (typeof navigator < "u" && ((n = navigator.clipboard) != null && n.writeText)) {
|
|
1835
1845
|
await navigator.clipboard.writeText(e);
|
|
@@ -1858,7 +1868,7 @@ async function kt(e) {
|
|
|
1858
1868
|
throw new Error(t.message || `响应缺少 data (${e.status})`);
|
|
1859
1869
|
return t.data;
|
|
1860
1870
|
}
|
|
1861
|
-
const Ct = "auth_user",
|
|
1871
|
+
const Ct = "auth_user", Ho = "token", Ko = "answer_agent_callback_url", Jo = "realtime_ws_url", Go = "/api/v1/mock/ask_user_answer_mock";
|
|
1862
1872
|
function At(e) {
|
|
1863
1873
|
if (typeof window > "u") return null;
|
|
1864
1874
|
try {
|
|
@@ -1875,24 +1885,24 @@ function _t(e) {
|
|
|
1875
1885
|
return null;
|
|
1876
1886
|
}
|
|
1877
1887
|
}
|
|
1878
|
-
function
|
|
1888
|
+
function Wo(e, t) {
|
|
1879
1889
|
const n = _t(e);
|
|
1880
1890
|
if (!n) return "";
|
|
1881
1891
|
const r = n[t];
|
|
1882
1892
|
return typeof r == "string" ? r.trim().replace(/^bearer\s+/i, "").trim() : "";
|
|
1883
1893
|
}
|
|
1884
|
-
function
|
|
1885
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ct, r = e.answerAgentCallbackUrlField ??
|
|
1894
|
+
function Yo(e = {}) {
|
|
1895
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ct, r = e.answerAgentCallbackUrlField ?? Ko, o = At(t);
|
|
1886
1896
|
if (!o) return "";
|
|
1887
1897
|
const i = o.getItem(n);
|
|
1888
1898
|
if (!i) return "";
|
|
1889
1899
|
const s = _t(i);
|
|
1890
1900
|
if (!s) return "";
|
|
1891
1901
|
const a = s[r];
|
|
1892
|
-
return (typeof a == "string" ? a.trim() : "") ||
|
|
1902
|
+
return (typeof a == "string" ? a.trim() : "") || Go;
|
|
1893
1903
|
}
|
|
1894
|
-
function
|
|
1895
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ct, r = e.realtimeWsUrlField ??
|
|
1904
|
+
function Qo(e = {}) {
|
|
1905
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ct, r = e.realtimeWsUrlField ?? Jo, o = At(t);
|
|
1896
1906
|
if (!o) return "";
|
|
1897
1907
|
const i = o.getItem(n);
|
|
1898
1908
|
if (!i) return "";
|
|
@@ -1908,17 +1918,17 @@ function Tt(e, t) {
|
|
|
1908
1918
|
};
|
|
1909
1919
|
}
|
|
1910
1920
|
function Tn(e = {}) {
|
|
1911
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ct, r = e.tokenField ??
|
|
1921
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ct, r = e.tokenField ?? Ho, o = At(t);
|
|
1912
1922
|
if (!o) return {};
|
|
1913
1923
|
const i = o.getItem(n);
|
|
1914
1924
|
if (!i) return {};
|
|
1915
|
-
const s =
|
|
1925
|
+
const s = Wo(i, r);
|
|
1916
1926
|
return s ? { Authorization: `Bearer ${s}` } : {};
|
|
1917
1927
|
}
|
|
1918
1928
|
async function xt(e = {}) {
|
|
1919
1929
|
return e.getHeaders ? await e.getHeaders() ?? {} : Tn(e.authStorage);
|
|
1920
1930
|
}
|
|
1921
|
-
function
|
|
1931
|
+
function Xo(e = {}) {
|
|
1922
1932
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.detailPath ?? "/dev/form/detail", r = e.fetch ?? fetch;
|
|
1923
1933
|
async function o(i) {
|
|
1924
1934
|
const s = new URLSearchParams();
|
|
@@ -1931,18 +1941,18 @@ function Yo(e = {}) {
|
|
|
1931
1941
|
const a = await xt(e), l = await r(`${t}${n}?${s.toString()}`, {
|
|
1932
1942
|
method: "GET",
|
|
1933
1943
|
headers: a
|
|
1934
|
-
}), c = await kt(l), m =
|
|
1944
|
+
}), c = await kt(l), m = Ro(c.form_definition);
|
|
1935
1945
|
return {
|
|
1936
1946
|
formUniqueId: c.form_unique_id,
|
|
1937
1947
|
formId: c.form_id,
|
|
1938
1948
|
disabled: c.disabled === 1,
|
|
1939
1949
|
formDefinition: m,
|
|
1940
|
-
a2ui:
|
|
1950
|
+
a2ui: Eo(c.form_definition) ?? void 0
|
|
1941
1951
|
};
|
|
1942
1952
|
}
|
|
1943
1953
|
return { fetchDetail: o };
|
|
1944
1954
|
}
|
|
1945
|
-
function
|
|
1955
|
+
function Zo(e) {
|
|
1946
1956
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1947
1957
|
return e ?? null;
|
|
1948
1958
|
const t = e;
|
|
@@ -1958,7 +1968,7 @@ function Mt({
|
|
|
1958
1968
|
form: n,
|
|
1959
1969
|
answer: r
|
|
1960
1970
|
}) {
|
|
1961
|
-
const o = Ve(t) ?? t, i = n ?
|
|
1971
|
+
const o = Ve(t) ?? t, i = n ? Zo(n) : o;
|
|
1962
1972
|
return {
|
|
1963
1973
|
mission_id: e.missionId ?? null,
|
|
1964
1974
|
tenant_id: e.tenantId ?? null,
|
|
@@ -1986,7 +1996,7 @@ function Nt(e) {
|
|
|
1986
1996
|
const o = e.mission_id;
|
|
1987
1997
|
return o == null || o === "" ? "mission_id 缺失,无法提交" : null;
|
|
1988
1998
|
}
|
|
1989
|
-
function
|
|
1999
|
+
function Cs(e) {
|
|
1990
2000
|
return Nt(
|
|
1991
2001
|
Mt({
|
|
1992
2002
|
context: e,
|
|
@@ -1996,14 +2006,14 @@ function Ss(e) {
|
|
|
1996
2006
|
);
|
|
1997
2007
|
}
|
|
1998
2008
|
const Wt = "answer_agent_callback_url 未配置,无法提交";
|
|
1999
|
-
function
|
|
2009
|
+
function ei(e) {
|
|
2000
2010
|
if ((e == null ? void 0 : e.answerAgentCallbackUrl) != null) {
|
|
2001
2011
|
const n = e.answerAgentCallbackUrl.trim();
|
|
2002
2012
|
if (!n)
|
|
2003
2013
|
throw new Error(Wt);
|
|
2004
2014
|
return n;
|
|
2005
2015
|
}
|
|
2006
|
-
const t =
|
|
2016
|
+
const t = Yo(e == null ? void 0 : e.authStorage).trim();
|
|
2007
2017
|
if (!t)
|
|
2008
2018
|
throw new Error(Wt);
|
|
2009
2019
|
return t;
|
|
@@ -2013,7 +2023,7 @@ function xn(e) {
|
|
|
2013
2023
|
const n = e.data;
|
|
2014
2024
|
return !n || typeof n != "object" || Array.isArray(n) ? null : n;
|
|
2015
2025
|
}
|
|
2016
|
-
function
|
|
2026
|
+
function ti(e, t) {
|
|
2017
2027
|
if (t && typeof t == "object" && t !== null && "message" in t) {
|
|
2018
2028
|
const n = t.message;
|
|
2019
2029
|
if (typeof n == "string" && n.trim())
|
|
@@ -2021,27 +2031,27 @@ function Zo(e, t) {
|
|
|
2021
2031
|
}
|
|
2022
2032
|
return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
|
|
2023
2033
|
}
|
|
2024
|
-
function
|
|
2034
|
+
function ni(e) {
|
|
2025
2035
|
return `提交失败:${typeof e.error == "string" && e.error.trim() ? e.error.trim() : `回调 HTTP ${e.callback_status ?? "失败"}`}`;
|
|
2026
2036
|
}
|
|
2027
2037
|
function Mn(e) {
|
|
2028
2038
|
const t = xn(e.body);
|
|
2029
|
-
return (t == null ? void 0 : t.callback_ok) === !1 ? { type: "error", message:
|
|
2039
|
+
return (t == null ? void 0 : t.callback_ok) === !1 ? { type: "error", message: ni(t) } : e.ok ? { type: "success", message: "提交成功" } : {
|
|
2030
2040
|
type: "error",
|
|
2031
|
-
message:
|
|
2041
|
+
message: ti(e.status, e.body)
|
|
2032
2042
|
};
|
|
2033
2043
|
}
|
|
2034
2044
|
async function Nn(e, t) {
|
|
2035
2045
|
const n = Nt(e);
|
|
2036
2046
|
if (n)
|
|
2037
2047
|
throw new Error(n);
|
|
2038
|
-
const r =
|
|
2048
|
+
const r = ei(t), o = await _n(r, e, {
|
|
2039
2049
|
...t,
|
|
2040
2050
|
headers: Tt(t == null ? void 0 : t.headers, t == null ? void 0 : t.authStorage)
|
|
2041
2051
|
}), i = xn(o.body);
|
|
2042
2052
|
return o.ok && (i == null ? void 0 : i.callback_ok) === !1 ? { ok: !1, status: o.status, body: o.body } : o;
|
|
2043
2053
|
}
|
|
2044
|
-
function
|
|
2054
|
+
function ri(e) {
|
|
2045
2055
|
return {
|
|
2046
2056
|
resumeUniqueId: e.resume_unique_id,
|
|
2047
2057
|
resumeId: e.resume_id,
|
|
@@ -2062,7 +2072,7 @@ function ti(e) {
|
|
|
2062
2072
|
}))
|
|
2063
2073
|
};
|
|
2064
2074
|
}
|
|
2065
|
-
function
|
|
2075
|
+
function oi(e, t, n) {
|
|
2066
2076
|
const r = new URLSearchParams();
|
|
2067
2077
|
r.set("page", String(t)), r.set("page_size", String(e.pageSize ?? 20));
|
|
2068
2078
|
for (const o of e.names ?? [])
|
|
@@ -2075,27 +2085,27 @@ function ni(e, t, n) {
|
|
|
2075
2085
|
r.append("published", String(o));
|
|
2076
2086
|
return r;
|
|
2077
2087
|
}
|
|
2078
|
-
function
|
|
2088
|
+
function ii(e = {}) {
|
|
2079
2089
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.searchPath ?? "/univ/resume/search", r = e.fetch ?? fetch, o = e.published ?? [1];
|
|
2080
2090
|
return async ({ filter: i, page: s }) => {
|
|
2081
|
-
const a = await xt(e), l =
|
|
2091
|
+
const a = await xt(e), l = oi(i, s, o), c = await r(`${t}${n}?${l.toString()}`, {
|
|
2082
2092
|
method: "GET",
|
|
2083
2093
|
headers: a
|
|
2084
2094
|
}), m = await kt(c);
|
|
2085
2095
|
return {
|
|
2086
|
-
list: (m.list ?? []).map(
|
|
2096
|
+
list: (m.list ?? []).map(ri),
|
|
2087
2097
|
total: m.total ?? 0,
|
|
2088
2098
|
page: m.page ?? s,
|
|
2089
2099
|
pageSize: m.page_size ?? i.pageSize ?? 20
|
|
2090
2100
|
};
|
|
2091
2101
|
};
|
|
2092
2102
|
}
|
|
2093
|
-
function
|
|
2103
|
+
function si(e) {
|
|
2094
2104
|
var r, o, i, s;
|
|
2095
2105
|
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()));
|
|
2096
2106
|
return t || n;
|
|
2097
2107
|
}
|
|
2098
|
-
function
|
|
2108
|
+
function ai(e) {
|
|
2099
2109
|
return {
|
|
2100
2110
|
caseUniqueId: e.case_unique_id,
|
|
2101
2111
|
caseId: e.case_id,
|
|
@@ -2106,7 +2116,7 @@ function ii(e) {
|
|
|
2106
2116
|
description: e.description ?? void 0
|
|
2107
2117
|
};
|
|
2108
2118
|
}
|
|
2109
|
-
function
|
|
2119
|
+
function li(e, t, n) {
|
|
2110
2120
|
var o, i, s;
|
|
2111
2121
|
const r = new URLSearchParams();
|
|
2112
2122
|
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());
|
|
@@ -2114,24 +2124,24 @@ function si(e, t, n) {
|
|
|
2114
2124
|
a && r.append("flow_unique_ids", a);
|
|
2115
2125
|
return r;
|
|
2116
2126
|
}
|
|
2117
|
-
function
|
|
2127
|
+
function ci(e = {}) {
|
|
2118
2128
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.listPath ?? "/univ/case/list", r = e.fetch ?? fetch, o = e.published ?? 1;
|
|
2119
2129
|
return async ({ filter: i, page: s }) => {
|
|
2120
|
-
if (!
|
|
2130
|
+
if (!si(i))
|
|
2121
2131
|
return { list: [], total: 0, page: 1, pageSize: i.pageSize ?? 20 };
|
|
2122
|
-
const a = await xt(e), l =
|
|
2132
|
+
const a = await xt(e), l = li(i, s, o), c = await r(`${t}${n}?${l.toString()}`, {
|
|
2123
2133
|
method: "GET",
|
|
2124
2134
|
headers: a
|
|
2125
2135
|
}), m = await kt(c);
|
|
2126
2136
|
return {
|
|
2127
|
-
list: (m.list ?? []).map(
|
|
2137
|
+
list: (m.list ?? []).map(ai),
|
|
2128
2138
|
total: m.total ?? 0,
|
|
2129
2139
|
page: m.page ?? s,
|
|
2130
2140
|
pageSize: m.page_size ?? i.pageSize ?? 20
|
|
2131
2141
|
};
|
|
2132
2142
|
};
|
|
2133
2143
|
}
|
|
2134
|
-
function
|
|
2144
|
+
function As(e = {}) {
|
|
2135
2145
|
var r, o, i, s, a;
|
|
2136
2146
|
const t = {
|
|
2137
2147
|
baseUrl: e.baseUrl,
|
|
@@ -2140,16 +2150,16 @@ function ks(e = {}) {
|
|
|
2140
2150
|
authStorage: e.authStorage
|
|
2141
2151
|
};
|
|
2142
2152
|
return {
|
|
2143
|
-
fetchDetail:
|
|
2153
|
+
fetchDetail: Xo({
|
|
2144
2154
|
...t,
|
|
2145
2155
|
detailPath: (r = e.form) == null ? void 0 : r.detailPath
|
|
2146
2156
|
}).fetchDetail,
|
|
2147
|
-
resumeSearch:
|
|
2157
|
+
resumeSearch: ii({
|
|
2148
2158
|
...t,
|
|
2149
2159
|
searchPath: (o = e.resume) == null ? void 0 : o.searchPath,
|
|
2150
2160
|
published: (i = e.resume) == null ? void 0 : i.published
|
|
2151
2161
|
}),
|
|
2152
|
-
caseSearch:
|
|
2162
|
+
caseSearch: ci({
|
|
2153
2163
|
...t,
|
|
2154
2164
|
listPath: (s = e.case) == null ? void 0 : s.listPath,
|
|
2155
2165
|
published: (a = e.case) == null ? void 0 : a.published
|
|
@@ -2167,7 +2177,7 @@ function In(e, t) {
|
|
|
2167
2177
|
function Fn(e) {
|
|
2168
2178
|
return e == null ? !0 : typeof e == "string" ? !e.trim() : !1;
|
|
2169
2179
|
}
|
|
2170
|
-
function
|
|
2180
|
+
function ui(e, t) {
|
|
2171
2181
|
switch (e.type) {
|
|
2172
2182
|
case "multiselect":
|
|
2173
2183
|
case "checkbox":
|
|
@@ -2176,7 +2186,7 @@ function li(e, t) {
|
|
|
2176
2186
|
case "case_multiselect":
|
|
2177
2187
|
return Q(t).length === 0;
|
|
2178
2188
|
case "toggle":
|
|
2179
|
-
return !
|
|
2189
|
+
return !Me(t);
|
|
2180
2190
|
case "number":
|
|
2181
2191
|
return t == null || t === "";
|
|
2182
2192
|
default:
|
|
@@ -2186,13 +2196,13 @@ function li(e, t) {
|
|
|
2186
2196
|
function it(e, t) {
|
|
2187
2197
|
return e.required === !0 || t > 0;
|
|
2188
2198
|
}
|
|
2189
|
-
function
|
|
2199
|
+
function mi(e, t) {
|
|
2190
2200
|
var n, r;
|
|
2191
2201
|
for (const o of e) {
|
|
2192
2202
|
const i = (n = o.name) == null ? void 0 : n.trim();
|
|
2193
|
-
if (!i ||
|
|
2203
|
+
if (!i || _e(o.type) || pe(o.type)) continue;
|
|
2194
2204
|
const s = t[i], a = ((r = o.label) == null ? void 0 : r.trim()) || i;
|
|
2195
|
-
if (o.required &&
|
|
2205
|
+
if (o.required && ui(o, s))
|
|
2196
2206
|
return { fieldName: i, label: a, message: `请填写「${a}」` };
|
|
2197
2207
|
if (o.type === "email" && !Fn(s)) {
|
|
2198
2208
|
const l = String(s).trim();
|
|
@@ -2229,20 +2239,20 @@ function ci(e, t) {
|
|
|
2229
2239
|
}
|
|
2230
2240
|
return null;
|
|
2231
2241
|
}
|
|
2232
|
-
const
|
|
2233
|
-
video:
|
|
2234
|
-
audio:
|
|
2235
|
-
image:
|
|
2242
|
+
const di = {
|
|
2243
|
+
video: tr,
|
|
2244
|
+
audio: er,
|
|
2245
|
+
image: Zn,
|
|
2236
2246
|
file: Xt,
|
|
2237
|
-
spreadsheet:
|
|
2247
|
+
spreadsheet: Xn,
|
|
2238
2248
|
document: Qt
|
|
2239
2249
|
};
|
|
2240
|
-
function
|
|
2250
|
+
function fi({
|
|
2241
2251
|
type: e,
|
|
2242
2252
|
size: t = 40,
|
|
2243
2253
|
className: n
|
|
2244
2254
|
}) {
|
|
2245
|
-
const r =
|
|
2255
|
+
const r = di[e] ?? Xt;
|
|
2246
2256
|
return /* @__PURE__ */ u(
|
|
2247
2257
|
r,
|
|
2248
2258
|
{
|
|
@@ -2252,7 +2262,7 @@ function mi({
|
|
|
2252
2262
|
}
|
|
2253
2263
|
);
|
|
2254
2264
|
}
|
|
2255
|
-
const En = "skopon-form-v0_9",
|
|
2265
|
+
const En = "skopon-form-v0_9", pi = /* @__PURE__ */ new Set([
|
|
2256
2266
|
"SkoponMedia",
|
|
2257
2267
|
"SkoponSelect",
|
|
2258
2268
|
"Image",
|
|
@@ -2264,14 +2274,14 @@ const En = "skopon-form-v0_9", di = /* @__PURE__ */ new Set([
|
|
|
2264
2274
|
"FileUpload",
|
|
2265
2275
|
"TextField",
|
|
2266
2276
|
"Text",
|
|
2267
|
-
...
|
|
2268
|
-
]),
|
|
2269
|
-
function
|
|
2277
|
+
...ko()
|
|
2278
|
+
]), hi = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
|
|
2279
|
+
function Ne(e) {
|
|
2270
2280
|
const t = [...Ue.components.values()].find((n) => n.name === e);
|
|
2271
2281
|
if (!t) throw new Error(`Missing basic catalog component: ${e}`);
|
|
2272
2282
|
return t.schema;
|
|
2273
2283
|
}
|
|
2274
|
-
function
|
|
2284
|
+
function R(e) {
|
|
2275
2285
|
return typeof e == "string" ? e : "";
|
|
2276
2286
|
}
|
|
2277
2287
|
function Un(e) {
|
|
@@ -2289,7 +2299,7 @@ function Le({
|
|
|
2289
2299
|
help: o,
|
|
2290
2300
|
placeholder: i
|
|
2291
2301
|
}) {
|
|
2292
|
-
const s = r == null ? void 0 : r.trim(), a = o == null ? void 0 : o.trim(), l =
|
|
2302
|
+
const s = r == null ? void 0 : r.trim(), a = o == null ? void 0 : o.trim(), l = Tr(n), c = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
|
|
2293
2303
|
return /* @__PURE__ */ M("div", { className: "form-block-preview", children: [
|
|
2294
2304
|
s ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: s }) : null,
|
|
2295
2305
|
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(
|
|
@@ -2321,17 +2331,17 @@ function Le({
|
|
|
2321
2331
|
] });
|
|
2322
2332
|
}
|
|
2323
2333
|
function je(e, t) {
|
|
2324
|
-
const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) :
|
|
2334
|
+
const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : R(e.url).trim() ? [R(e.url).trim()] : [];
|
|
2325
2335
|
return {
|
|
2326
2336
|
mediaType: t,
|
|
2327
2337
|
urls: n,
|
|
2328
|
-
mediaSize:
|
|
2329
|
-
label:
|
|
2330
|
-
help:
|
|
2331
|
-
placeholder:
|
|
2338
|
+
mediaSize: xe(e.mediaSize),
|
|
2339
|
+
label: R(e.label) || R(e.description),
|
|
2340
|
+
help: R(e.help),
|
|
2341
|
+
placeholder: R(e.placeholder)
|
|
2332
2342
|
};
|
|
2333
2343
|
}
|
|
2334
|
-
const
|
|
2344
|
+
const gi = {
|
|
2335
2345
|
name: "SkoponMedia",
|
|
2336
2346
|
schema: h.object({
|
|
2337
2347
|
mediaType: h.any().optional(),
|
|
@@ -2341,19 +2351,19 @@ const pi = {
|
|
|
2341
2351
|
help: h.any().optional(),
|
|
2342
2352
|
placeholder: h.any().optional()
|
|
2343
2353
|
}).passthrough()
|
|
2344
|
-
},
|
|
2345
|
-
const t = e.componentModel.properties, n =
|
|
2354
|
+
}, yi = X(gi, ({ context: e }) => {
|
|
2355
|
+
const t = e.componentModel.properties, n = R(t.mediaType);
|
|
2346
2356
|
return /* @__PURE__ */ u(Le, { ...je(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
|
|
2347
|
-
}),
|
|
2348
|
-
{ name: "Image", schema:
|
|
2357
|
+
}), vi = X(
|
|
2358
|
+
{ name: "Image", schema: Ne("Image") },
|
|
2349
2359
|
({ context: e }) => /* @__PURE__ */ u(Le, { ...je(e.componentModel.properties, "image") })
|
|
2350
|
-
),
|
|
2351
|
-
{ name: "Video", schema:
|
|
2360
|
+
), bi = X(
|
|
2361
|
+
{ name: "Video", schema: Ne("Video") },
|
|
2352
2362
|
({ context: e }) => /* @__PURE__ */ u(Le, { ...je(e.componentModel.properties, "video") })
|
|
2353
|
-
),
|
|
2354
|
-
{ name: "AudioPlayer", schema:
|
|
2363
|
+
), Si = X(
|
|
2364
|
+
{ name: "AudioPlayer", schema: Ne("AudioPlayer") },
|
|
2355
2365
|
({ context: e }) => /* @__PURE__ */ u(Le, { ...je(e.componentModel.properties, "audio") })
|
|
2356
|
-
),
|
|
2366
|
+
), ki = {
|
|
2357
2367
|
name: "SkoponSelect",
|
|
2358
2368
|
schema: h.object({
|
|
2359
2369
|
label: h.any().optional(),
|
|
@@ -2363,11 +2373,11 @@ const pi = {
|
|
|
2363
2373
|
value: h.any().optional()
|
|
2364
2374
|
}).passthrough()
|
|
2365
2375
|
};
|
|
2366
|
-
function
|
|
2376
|
+
function Ci({ context: e }) {
|
|
2367
2377
|
const { interactive: t } = se(), { value: n, setValue: r, setValueSilent: o, fieldName: i } = ae(e, "value", {
|
|
2368
2378
|
component: "SkoponSelect",
|
|
2369
2379
|
changeAction: "select"
|
|
2370
|
-
}), s = e.componentModel.properties, a =
|
|
2380
|
+
}), s = e.componentModel.properties, a = R(s.label), l = R(s.placeholder), c = Un(s.options), m = R(s.mode) === "multiple";
|
|
2371
2381
|
return q(() => {
|
|
2372
2382
|
const d = dn(n, m);
|
|
2373
2383
|
d !== null && o(d);
|
|
@@ -2383,27 +2393,27 @@ function Si({ context: e }) {
|
|
|
2383
2393
|
style: { width: "100%" },
|
|
2384
2394
|
placeholder: l || (m ? "请选择多项" : "请选择"),
|
|
2385
2395
|
options: c,
|
|
2386
|
-
value: m ? Q(n) :
|
|
2396
|
+
value: m ? Q(n) : Se(n),
|
|
2387
2397
|
onChange: (d) => r(m ? d ?? [] : d ?? "")
|
|
2388
2398
|
}
|
|
2389
2399
|
)
|
|
2390
2400
|
] });
|
|
2391
2401
|
}
|
|
2392
|
-
const
|
|
2393
|
-
|
|
2394
|
-
|
|
2402
|
+
const Ai = X(
|
|
2403
|
+
ki,
|
|
2404
|
+
Ci
|
|
2395
2405
|
);
|
|
2396
|
-
function
|
|
2406
|
+
function _i({ context: e }) {
|
|
2397
2407
|
const { interactive: t } = se(), { value: n, setValue: r, setValueSilent: o, fieldName: i } = ae(e, "value", {
|
|
2398
2408
|
component: "ChoicePicker",
|
|
2399
2409
|
changeAction: "select"
|
|
2400
|
-
}), s = e.componentModel.properties, a =
|
|
2410
|
+
}), s = e.componentModel.properties, a = R(s.label), l = R(s.variant) || "mutuallyExclusive", c = R(s.skoponPickerType), m = R(s.placeholder), d = Un(s.options), y = c === "select" || c === "multiselect" || c === "radio" || c === "checkbox" ? c : l === "multipleSelection" ? "checkbox" : "radio", S = y === "multiselect" || y === "checkbox";
|
|
2401
2411
|
return q(() => {
|
|
2402
|
-
const
|
|
2403
|
-
|
|
2412
|
+
const g = dn(n, S);
|
|
2413
|
+
g !== null && o(g);
|
|
2404
2414
|
}, [S, n, o]), /* @__PURE__ */ M("div", { className: "form-block-preview", "data-skopon-field": i || void 0, children: [
|
|
2405
2415
|
a ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2406
|
-
|
|
2416
|
+
y === "select" ? /* @__PURE__ */ u(
|
|
2407
2417
|
st,
|
|
2408
2418
|
{
|
|
2409
2419
|
disabled: !t,
|
|
@@ -2412,10 +2422,10 @@ function Ci({ context: e }) {
|
|
|
2412
2422
|
style: { width: "100%" },
|
|
2413
2423
|
placeholder: m || "请选择",
|
|
2414
2424
|
options: d,
|
|
2415
|
-
value:
|
|
2416
|
-
onChange: (
|
|
2425
|
+
value: Se(n),
|
|
2426
|
+
onChange: (g) => r(g ?? "")
|
|
2417
2427
|
}
|
|
2418
|
-
) :
|
|
2428
|
+
) : y === "multiselect" ? /* @__PURE__ */ u(
|
|
2419
2429
|
st,
|
|
2420
2430
|
{
|
|
2421
2431
|
mode: "multiple",
|
|
@@ -2426,30 +2436,30 @@ function Ci({ context: e }) {
|
|
|
2426
2436
|
placeholder: m || "请选择多项",
|
|
2427
2437
|
options: d,
|
|
2428
2438
|
value: Q(n),
|
|
2429
|
-
onChange: (
|
|
2439
|
+
onChange: (g) => r(g ?? [])
|
|
2430
2440
|
}
|
|
2431
|
-
) :
|
|
2432
|
-
|
|
2441
|
+
) : y === "checkbox" ? /* @__PURE__ */ u(
|
|
2442
|
+
$n.Group,
|
|
2433
2443
|
{
|
|
2434
2444
|
disabled: !t,
|
|
2435
2445
|
className: "form-block-preview-control",
|
|
2436
2446
|
options: d,
|
|
2437
2447
|
value: Q(n),
|
|
2438
|
-
onChange: (
|
|
2448
|
+
onChange: (g) => r(g)
|
|
2439
2449
|
}
|
|
2440
2450
|
) : /* @__PURE__ */ u(
|
|
2441
|
-
|
|
2451
|
+
Dn.Group,
|
|
2442
2452
|
{
|
|
2443
2453
|
disabled: !t,
|
|
2444
2454
|
className: "form-block-preview-control",
|
|
2445
2455
|
options: d,
|
|
2446
|
-
value:
|
|
2447
|
-
onChange: (
|
|
2456
|
+
value: Se(n),
|
|
2457
|
+
onChange: (g) => r(g.target.value)
|
|
2448
2458
|
}
|
|
2449
2459
|
)
|
|
2450
2460
|
] });
|
|
2451
2461
|
}
|
|
2452
|
-
const
|
|
2462
|
+
const Ti = X(
|
|
2453
2463
|
{
|
|
2454
2464
|
name: "ChoicePicker",
|
|
2455
2465
|
schema: h.object({
|
|
@@ -2461,32 +2471,32 @@ const Ai = X(
|
|
|
2461
2471
|
placeholder: h.any().optional()
|
|
2462
2472
|
}).passthrough()
|
|
2463
2473
|
},
|
|
2464
|
-
|
|
2474
|
+
_i
|
|
2465
2475
|
);
|
|
2466
|
-
function
|
|
2476
|
+
function xi({ context: e }) {
|
|
2467
2477
|
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o } = ae(e, "value", {
|
|
2468
2478
|
component: "CheckBox",
|
|
2469
2479
|
changeAction: "change"
|
|
2470
|
-
}), i = e.componentModel.properties, s =
|
|
2480
|
+
}), i = e.componentModel.properties, s = R(i.label);
|
|
2471
2481
|
return /* @__PURE__ */ M("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2472
2482
|
s ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: s }) : null,
|
|
2473
2483
|
/* @__PURE__ */ u(
|
|
2474
|
-
|
|
2484
|
+
Hn,
|
|
2475
2485
|
{
|
|
2476
2486
|
disabled: !t,
|
|
2477
2487
|
className: "form-block-preview-control",
|
|
2478
|
-
checked:
|
|
2488
|
+
checked: Me(n),
|
|
2479
2489
|
onChange: (a) => r(a)
|
|
2480
2490
|
}
|
|
2481
2491
|
)
|
|
2482
2492
|
] });
|
|
2483
2493
|
}
|
|
2484
|
-
const
|
|
2485
|
-
{ name: "CheckBox", schema:
|
|
2486
|
-
|
|
2494
|
+
const Mi = X(
|
|
2495
|
+
{ name: "CheckBox", schema: Ne("CheckBox") },
|
|
2496
|
+
xi
|
|
2487
2497
|
);
|
|
2488
|
-
function
|
|
2489
|
-
const r =
|
|
2498
|
+
function Ni(e, t, n) {
|
|
2499
|
+
const r = Se(e);
|
|
2490
2500
|
if (!r) return;
|
|
2491
2501
|
if (!t && n) {
|
|
2492
2502
|
const i = jt(r, "HH:mm", !0);
|
|
@@ -2495,29 +2505,29 @@ function xi(e, t, n) {
|
|
|
2495
2505
|
const o = jt(r);
|
|
2496
2506
|
return o.isValid() ? o : void 0;
|
|
2497
2507
|
}
|
|
2498
|
-
function
|
|
2508
|
+
function Ii({ context: e }) {
|
|
2499
2509
|
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o, reportFocus: i } = ae(e, "value", {
|
|
2500
2510
|
component: "DateTimeInput",
|
|
2501
2511
|
changeAction: "change"
|
|
2502
|
-
}), s = e.componentModel.properties, a =
|
|
2503
|
-
if (!
|
|
2512
|
+
}), s = e.componentModel.properties, a = R(s.label), l = R(s.placeholder), c = s.enableDate === !0, m = s.enableTime === !0, d = Ni(n, c, m), b = (y) => {
|
|
2513
|
+
if (!y) {
|
|
2504
2514
|
r("");
|
|
2505
2515
|
return;
|
|
2506
2516
|
}
|
|
2507
2517
|
if (!c && m) {
|
|
2508
|
-
r(
|
|
2518
|
+
r(y.format("HH:mm"));
|
|
2509
2519
|
return;
|
|
2510
2520
|
}
|
|
2511
2521
|
if (c && m) {
|
|
2512
|
-
r(
|
|
2522
|
+
r(y.format("YYYY-MM-DDTHH:mm"));
|
|
2513
2523
|
return;
|
|
2514
2524
|
}
|
|
2515
|
-
r(
|
|
2525
|
+
r(y.format("YYYY-MM-DD"));
|
|
2516
2526
|
};
|
|
2517
2527
|
return /* @__PURE__ */ M("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2518
2528
|
a ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2519
2529
|
!c && m ? /* @__PURE__ */ u(
|
|
2520
|
-
|
|
2530
|
+
Kn,
|
|
2521
2531
|
{
|
|
2522
2532
|
disabled: !t,
|
|
2523
2533
|
className: "form-block-preview-control",
|
|
@@ -2528,7 +2538,7 @@ function Mi({ context: e }) {
|
|
|
2528
2538
|
onFocus: i
|
|
2529
2539
|
}
|
|
2530
2540
|
) : /* @__PURE__ */ u(
|
|
2531
|
-
|
|
2541
|
+
Jn,
|
|
2532
2542
|
{
|
|
2533
2543
|
showTime: c && m,
|
|
2534
2544
|
disabled: !t,
|
|
@@ -2542,7 +2552,7 @@ function Mi({ context: e }) {
|
|
|
2542
2552
|
)
|
|
2543
2553
|
] });
|
|
2544
2554
|
}
|
|
2545
|
-
const
|
|
2555
|
+
const Fi = X(
|
|
2546
2556
|
{
|
|
2547
2557
|
name: "DateTimeInput",
|
|
2548
2558
|
schema: h.object({
|
|
@@ -2555,8 +2565,8 @@ const Ni = X(
|
|
|
2555
2565
|
max: h.any().optional()
|
|
2556
2566
|
}).passthrough()
|
|
2557
2567
|
},
|
|
2558
|
-
|
|
2559
|
-
),
|
|
2568
|
+
Ii
|
|
2569
|
+
), Ei = {
|
|
2560
2570
|
name: "FileUpload",
|
|
2561
2571
|
schema: h.object({
|
|
2562
2572
|
label: h.any().optional(),
|
|
@@ -2568,23 +2578,23 @@ const Ni = X(
|
|
|
2568
2578
|
value: h.any().optional()
|
|
2569
2579
|
}).passthrough()
|
|
2570
2580
|
};
|
|
2571
|
-
function
|
|
2581
|
+
function Ui({ context: e }) {
|
|
2572
2582
|
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o } = ae(e, "value", {
|
|
2573
2583
|
component: "FileUpload",
|
|
2574
2584
|
changeAction: "change"
|
|
2575
|
-
}), i = e.componentModel.properties, s =
|
|
2585
|
+
}), i = e.componentModel.properties, s = R(i.label), a = R(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 = vr(l, c), d = typeof i.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
|
|
2576
2586
|
i.filePlaceholderIcon
|
|
2577
|
-
) ? i.filePlaceholderIcon : "document", b = typeof i.minCount == "number" ? Math.max(0, i.minCount) : 0,
|
|
2587
|
+
) ? i.filePlaceholderIcon : "document", b = typeof i.minCount == "number" ? Math.max(0, i.minCount) : 0, y = typeof i.maxCount == "number" ? i.maxCount : 1, S = y > 0, g = Q(n), k = S && g.length >= y, p = g.length < b;
|
|
2578
2588
|
return /* @__PURE__ */ M("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2579
2589
|
s ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: s }) : null,
|
|
2580
2590
|
/* @__PURE__ */ M(
|
|
2581
2591
|
Ye.Dragger,
|
|
2582
2592
|
{
|
|
2583
2593
|
disabled: !t || k,
|
|
2584
|
-
accept:
|
|
2594
|
+
accept: yr(l, c),
|
|
2585
2595
|
className: "form-file-upload-preview",
|
|
2586
|
-
showUploadList: t &&
|
|
2587
|
-
fileList: t ?
|
|
2596
|
+
showUploadList: t && g.length > 0,
|
|
2597
|
+
fileList: t ? g.map((f, v) => ({
|
|
2588
2598
|
uid: `${v}-${f}`,
|
|
2589
2599
|
name: f,
|
|
2590
2600
|
status: "done"
|
|
@@ -2592,17 +2602,17 @@ function Fi({ context: e }) {
|
|
|
2592
2602
|
beforeUpload: (f) => {
|
|
2593
2603
|
if (!t) return Ye.LIST_IGNORE;
|
|
2594
2604
|
const v = Q(Ht(e));
|
|
2595
|
-
if (S && v.length >=
|
|
2596
|
-
const x = S ? [...v, f.name].slice(0,
|
|
2605
|
+
if (S && v.length >= y) return Ye.LIST_IGNORE;
|
|
2606
|
+
const x = S ? [...v, f.name].slice(0, y) : [...v, f.name];
|
|
2597
2607
|
return r(x), !1;
|
|
2598
2608
|
},
|
|
2599
2609
|
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((
|
|
2610
|
+
const v = Q(Ht(e)), x = /^(\d+)-/.exec(f.uid ?? ""), N = x ? Number(x[1]) : -1, _ = N >= 0 && N < v.length ? v.filter((z, C) => C !== N) : v.filter((z) => z !== f.name);
|
|
2601
2611
|
if (_.length < b) return !1;
|
|
2602
2612
|
r(_);
|
|
2603
2613
|
},
|
|
2604
2614
|
children: [
|
|
2605
|
-
/* @__PURE__ */ u("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ u(
|
|
2615
|
+
/* @__PURE__ */ u("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ u(fi, { type: d, size: 40 }) }),
|
|
2606
2616
|
/* @__PURE__ */ u("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
|
|
2607
2617
|
]
|
|
2608
2618
|
}
|
|
@@ -2611,22 +2621,22 @@ function Fi({ context: e }) {
|
|
|
2611
2621
|
"允许:",
|
|
2612
2622
|
m ?? "全部类型",
|
|
2613
2623
|
b > 0 ? `;至少 ${b} 个文件` : "",
|
|
2614
|
-
S ? `;最多 ${
|
|
2624
|
+
S ? `;最多 ${y} 个文件` : "",
|
|
2615
2625
|
";当前仅收集文件名(不含文件内容,需宿主另行上传)",
|
|
2616
|
-
p && t ? `(当前 ${
|
|
2626
|
+
p && t ? `(当前 ${g.length} 个,未达下限)` : ""
|
|
2617
2627
|
] })
|
|
2618
2628
|
] });
|
|
2619
2629
|
}
|
|
2620
|
-
const
|
|
2621
|
-
|
|
2622
|
-
|
|
2630
|
+
const Ri = X(
|
|
2631
|
+
Ei,
|
|
2632
|
+
Ui
|
|
2623
2633
|
);
|
|
2624
|
-
function
|
|
2634
|
+
function Pi({ context: e }) {
|
|
2625
2635
|
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o, reportFocus: i } = ae(e, "value", {
|
|
2626
2636
|
component: "TextField",
|
|
2627
2637
|
changeAction: "change",
|
|
2628
2638
|
debounceChange: !0
|
|
2629
|
-
}), s = e.componentModel.properties, a =
|
|
2639
|
+
}), s = e.componentModel.properties, a = R(s.label), l = R(s.placeholder), c = R(s.variant) || "shortText", m = R(s.validationRegexp), d = Se(n) ?? "", b = !t, [y, S] = w(""), g = (f) => {
|
|
2630
2640
|
if (!m || !f.trim()) {
|
|
2631
2641
|
S("");
|
|
2632
2642
|
return;
|
|
@@ -2634,7 +2644,7 @@ function Ui({ context: e }) {
|
|
|
2634
2644
|
S(In(f, m) ? "" : "格式不正确");
|
|
2635
2645
|
};
|
|
2636
2646
|
q(() => {
|
|
2637
|
-
|
|
2647
|
+
g(d);
|
|
2638
2648
|
}, [m, d]);
|
|
2639
2649
|
const k = "form-block-preview-control";
|
|
2640
2650
|
let p;
|
|
@@ -2647,19 +2657,19 @@ function Ui({ context: e }) {
|
|
|
2647
2657
|
placeholder: l || "长文本回答...",
|
|
2648
2658
|
autoSize: { minRows: 2, maxRows: 6 },
|
|
2649
2659
|
value: d,
|
|
2650
|
-
status:
|
|
2660
|
+
status: y ? "error" : void 0,
|
|
2651
2661
|
onChange: (f) => {
|
|
2652
2662
|
const v = f.target.value;
|
|
2653
|
-
r(v),
|
|
2663
|
+
r(v), g(v);
|
|
2654
2664
|
},
|
|
2655
2665
|
onFocus: i,
|
|
2656
|
-
onBlur: (f) =>
|
|
2666
|
+
onBlur: (f) => g(f.target.value)
|
|
2657
2667
|
}
|
|
2658
2668
|
);
|
|
2659
2669
|
else if (c === "number") {
|
|
2660
2670
|
const f = d && Number.isFinite(Number(d)) ? Number(d) : void 0;
|
|
2661
2671
|
p = /* @__PURE__ */ u(
|
|
2662
|
-
|
|
2672
|
+
Gn,
|
|
2663
2673
|
{
|
|
2664
2674
|
disabled: b,
|
|
2665
2675
|
className: k,
|
|
@@ -2687,22 +2697,22 @@ function Ui({ context: e }) {
|
|
|
2687
2697
|
className: k,
|
|
2688
2698
|
placeholder: l,
|
|
2689
2699
|
value: d,
|
|
2690
|
-
status:
|
|
2700
|
+
status: y ? "error" : void 0,
|
|
2691
2701
|
onChange: (f) => {
|
|
2692
2702
|
const v = f.target.value;
|
|
2693
|
-
r(v),
|
|
2703
|
+
r(v), g(v);
|
|
2694
2704
|
},
|
|
2695
2705
|
onFocus: i,
|
|
2696
|
-
onBlur: (f) =>
|
|
2706
|
+
onBlur: (f) => g(f.target.value)
|
|
2697
2707
|
}
|
|
2698
2708
|
);
|
|
2699
2709
|
return /* @__PURE__ */ M("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2700
2710
|
a ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2701
2711
|
p,
|
|
2702
|
-
|
|
2712
|
+
y ? /* @__PURE__ */ u(ne.Text, { type: "danger", className: "form-block-preview-help", children: y }) : null
|
|
2703
2713
|
] });
|
|
2704
2714
|
}
|
|
2705
|
-
const
|
|
2715
|
+
const wi = X(
|
|
2706
2716
|
{
|
|
2707
2717
|
name: "TextField",
|
|
2708
2718
|
schema: h.object({
|
|
@@ -2713,35 +2723,35 @@ const Ri = X(
|
|
|
2713
2723
|
value: h.any().optional()
|
|
2714
2724
|
}).passthrough()
|
|
2715
2725
|
},
|
|
2716
|
-
|
|
2726
|
+
Pi
|
|
2717
2727
|
);
|
|
2718
|
-
function
|
|
2719
|
-
const t = e.componentModel.properties, n =
|
|
2720
|
-
return
|
|
2728
|
+
function zi({ context: e }) {
|
|
2729
|
+
const t = e.componentModel.properties, n = R(t.text), r = R(t.variant) || "body";
|
|
2730
|
+
return hi.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 });
|
|
2721
2731
|
}
|
|
2722
|
-
const
|
|
2723
|
-
{ name: "Text", schema:
|
|
2724
|
-
|
|
2732
|
+
const Oi = X(
|
|
2733
|
+
{ name: "Text", schema: Ne("Text") },
|
|
2734
|
+
zi
|
|
2725
2735
|
);
|
|
2726
2736
|
function Rn() {
|
|
2727
2737
|
const t = [
|
|
2728
2738
|
...[...Ue.components.values()].filter(
|
|
2729
|
-
(r) => !
|
|
2739
|
+
(r) => !pi.has(r.name)
|
|
2730
2740
|
),
|
|
2731
|
-
hi,
|
|
2732
|
-
ki,
|
|
2733
|
-
gi,
|
|
2734
2741
|
yi,
|
|
2735
|
-
vi,
|
|
2736
2742
|
Ai,
|
|
2743
|
+
vi,
|
|
2744
|
+
bi,
|
|
2745
|
+
Si,
|
|
2737
2746
|
Ti,
|
|
2738
|
-
|
|
2739
|
-
|
|
2747
|
+
Mi,
|
|
2748
|
+
Fi,
|
|
2740
2749
|
Ri,
|
|
2741
2750
|
wi,
|
|
2742
|
-
|
|
2751
|
+
Oi,
|
|
2752
|
+
...So()
|
|
2743
2753
|
], n = [...Ue.functions.values()];
|
|
2744
|
-
return new
|
|
2754
|
+
return new nr(En, t, n, Ue.themeSchema);
|
|
2745
2755
|
}
|
|
2746
2756
|
const ie = {
|
|
2747
2757
|
jade9: "#29a383",
|
|
@@ -2755,7 +2765,7 @@ const ie = {
|
|
|
2755
2765
|
primaryHover: "#26997b",
|
|
2756
2766
|
primaryActive: "#1d3b31",
|
|
2757
2767
|
onPrimary: "#ffffff"
|
|
2758
|
-
},
|
|
2768
|
+
}, qi = {
|
|
2759
2769
|
cssVar: { key: "vidtempl" },
|
|
2760
2770
|
token: {
|
|
2761
2771
|
colorPrimary: ie.primarySolid,
|
|
@@ -2840,14 +2850,14 @@ const ie = {
|
|
|
2840
2850
|
}
|
|
2841
2851
|
}
|
|
2842
2852
|
};
|
|
2843
|
-
function
|
|
2853
|
+
function ke({
|
|
2844
2854
|
children: e,
|
|
2845
2855
|
locale: t,
|
|
2846
2856
|
theme: n
|
|
2847
2857
|
}) {
|
|
2848
|
-
return /* @__PURE__ */ u(
|
|
2858
|
+
return /* @__PURE__ */ u(Wn, { theme: n ?? qi, locale: t, children: e });
|
|
2849
2859
|
}
|
|
2850
|
-
const
|
|
2860
|
+
const Bi = Vn(
|
|
2851
2861
|
function({
|
|
2852
2862
|
doc: t,
|
|
2853
2863
|
surfaceId: n = "skopon-form",
|
|
@@ -2870,11 +2880,11 @@ const Oi = Bn(
|
|
|
2870
2880
|
} catch {
|
|
2871
2881
|
return String(t);
|
|
2872
2882
|
}
|
|
2873
|
-
}, [t]),
|
|
2883
|
+
}, [t]), y = L(() => {
|
|
2874
2884
|
if (!b)
|
|
2875
2885
|
return { surfaces: [], processor: null };
|
|
2876
2886
|
try {
|
|
2877
|
-
const p = JSON.parse(b), f = new en([Rn()]), v =
|
|
2887
|
+
const p = JSON.parse(b), f = new en([Rn()]), v = Fo(p, {
|
|
2878
2888
|
surfaceId: n,
|
|
2879
2889
|
catalogId: En
|
|
2880
2890
|
});
|
|
@@ -2885,15 +2895,15 @@ const Oi = Bn(
|
|
|
2885
2895
|
} catch (p) {
|
|
2886
2896
|
return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", p), { surfaces: [], processor: null };
|
|
2887
2897
|
}
|
|
2888
|
-
}, [b, n]), { surfaces: S, processor:
|
|
2889
|
-
if (m.current =
|
|
2898
|
+
}, [b, n]), { surfaces: S, processor: g } = y;
|
|
2899
|
+
if (m.current = g, Ln(
|
|
2890
2900
|
c,
|
|
2891
2901
|
() => ({
|
|
2892
2902
|
getValues(p) {
|
|
2893
2903
|
const f = m.current;
|
|
2894
2904
|
if (!f) return {};
|
|
2895
2905
|
const v = (p ?? d.current).map((x) => x.trim()).filter(Boolean);
|
|
2896
|
-
return
|
|
2906
|
+
return Po(f, n, v);
|
|
2897
2907
|
},
|
|
2898
2908
|
setValues(p) {
|
|
2899
2909
|
const f = m.current;
|
|
@@ -2909,16 +2919,16 @@ const Oi = Bn(
|
|
|
2909
2919
|
[n]
|
|
2910
2920
|
), S.length === 0) {
|
|
2911
2921
|
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(
|
|
2922
|
+
return l ? /* @__PURE__ */ u(ke, { children: p }) : p;
|
|
2913
2923
|
}
|
|
2914
2924
|
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(
|
|
2925
|
+
return l ? /* @__PURE__ */ u(ke, { children: k }) : k;
|
|
2916
2926
|
}
|
|
2917
2927
|
);
|
|
2918
2928
|
function Ee() {
|
|
2919
2929
|
return new en([Rn()]);
|
|
2920
2930
|
}
|
|
2921
|
-
function
|
|
2931
|
+
function _s({
|
|
2922
2932
|
messages: e,
|
|
2923
2933
|
surfaceId: t = "skopon-form-stream",
|
|
2924
2934
|
emptyHint: n = null,
|
|
@@ -2946,9 +2956,9 @@ function Cs({
|
|
|
2946
2956
|
return !0;
|
|
2947
2957
|
}
|
|
2948
2958
|
}
|
|
2949
|
-
const [
|
|
2959
|
+
const [y, S] = w(
|
|
2950
2960
|
() => s.current
|
|
2951
|
-
), [
|
|
2961
|
+
), [g, k] = w(
|
|
2952
2962
|
() => Array.from(
|
|
2953
2963
|
s.current.model.surfacesMap.values()
|
|
2954
2964
|
)
|
|
@@ -2956,15 +2966,15 @@ function Cs({
|
|
|
2956
2966
|
return q(() => (c.current = !0, () => {
|
|
2957
2967
|
c.current = !1;
|
|
2958
2968
|
}), []), q(() => {
|
|
2959
|
-
s.current =
|
|
2960
|
-
}, [
|
|
2969
|
+
s.current = y;
|
|
2970
|
+
}, [y]), q(() => {
|
|
2961
2971
|
const p = () => {
|
|
2962
|
-
c.current && k(Array.from(
|
|
2963
|
-
}, f =
|
|
2972
|
+
c.current && k(Array.from(y.model.surfacesMap.values()));
|
|
2973
|
+
}, f = y.onSurfaceCreated(p), v = y.onSurfaceDeleted(p);
|
|
2964
2974
|
return () => {
|
|
2965
2975
|
f.unsubscribe(), v.unsubscribe();
|
|
2966
2976
|
};
|
|
2967
|
-
}, [
|
|
2977
|
+
}, [y]), q(() => {
|
|
2968
2978
|
let p = !1;
|
|
2969
2979
|
const f = m.current !== t;
|
|
2970
2980
|
if (m.current = t, f) {
|
|
@@ -2995,15 +3005,15 @@ function Cs({
|
|
|
2995
3005
|
} : (v.processMessages(N), a.current = e.length, l.current = JSON.stringify(e), p || k(Array.from(v.model.surfacesMap.values())), () => {
|
|
2996
3006
|
p = !0;
|
|
2997
3007
|
});
|
|
2998
|
-
}, [e, t]),
|
|
3008
|
+
}, [e, t]), g.length === 0 ? /* @__PURE__ */ u(ke, { children: n }) : /* @__PURE__ */ u(ke, { 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: g.map((p) => /* @__PURE__ */ u(Zt, { surface: p }, p.id)) }) }) }) }) });
|
|
2999
3009
|
}
|
|
3000
|
-
const
|
|
3001
|
-
function
|
|
3010
|
+
const Vi = 100, Li = 3e4, ji = 1500, fe = /* @__PURE__ */ new Map();
|
|
3011
|
+
function $i(e) {
|
|
3002
3012
|
const t = e.trim();
|
|
3003
|
-
let n =
|
|
3004
|
-
return n || (n = new
|
|
3013
|
+
let n = fe.get(t);
|
|
3014
|
+
return n || (n = new Di(t), fe.set(t, n)), n.acquire(), n;
|
|
3005
3015
|
}
|
|
3006
|
-
class
|
|
3016
|
+
class Di {
|
|
3007
3017
|
constructor(t) {
|
|
3008
3018
|
G(this, "url");
|
|
3009
3019
|
G(this, "ws", null);
|
|
@@ -3021,12 +3031,12 @@ class ji {
|
|
|
3021
3031
|
}
|
|
3022
3032
|
release() {
|
|
3023
3033
|
this.refCount = Math.max(0, this.refCount - 1), !(this.refCount > 0) && (this.clearReleaseTimer(), this.releaseTimer = setTimeout(() => {
|
|
3024
|
-
this.releaseTimer = null, !(this.refCount > 0) && (this.teardown(),
|
|
3025
|
-
},
|
|
3034
|
+
this.releaseTimer = null, !(this.refCount > 0) && (this.teardown(), fe.get(this.url) === this && fe.delete(this.url));
|
|
3035
|
+
}, ji));
|
|
3026
3036
|
}
|
|
3027
3037
|
/** 强制关闭(测试用),跳过宽限期。 */
|
|
3028
3038
|
forceClose() {
|
|
3029
|
-
this.refCount = 0, this.teardown(),
|
|
3039
|
+
this.refCount = 0, this.teardown(), fe.get(this.url) === this && fe.delete(this.url);
|
|
3030
3040
|
}
|
|
3031
3041
|
subscribe(t, n) {
|
|
3032
3042
|
const r = t.trim();
|
|
@@ -3095,7 +3105,7 @@ class ji {
|
|
|
3095
3105
|
}
|
|
3096
3106
|
}
|
|
3097
3107
|
enqueue(t) {
|
|
3098
|
-
for (this.sendQueue.push(t); this.sendQueue.length >
|
|
3108
|
+
for (this.sendQueue.push(t); this.sendQueue.length > Vi; )
|
|
3099
3109
|
this.sendQueue.shift();
|
|
3100
3110
|
}
|
|
3101
3111
|
flushQueue() {
|
|
@@ -3109,7 +3119,7 @@ class ji {
|
|
|
3109
3119
|
if (!this.connectRequested || this.refCount <= 0) return;
|
|
3110
3120
|
this.clearReconnectTimer();
|
|
3111
3121
|
const t = Math.min(
|
|
3112
|
-
|
|
3122
|
+
Li,
|
|
3113
3123
|
1e3 * 2 ** Math.min(this.reconnectAttempt, 5)
|
|
3114
3124
|
);
|
|
3115
3125
|
this.reconnectAttempt += 1, this.reconnectTimer = setTimeout(() => {
|
|
@@ -3147,13 +3157,13 @@ class ji {
|
|
|
3147
3157
|
}
|
|
3148
3158
|
}
|
|
3149
3159
|
}
|
|
3150
|
-
class
|
|
3160
|
+
class Hi {
|
|
3151
3161
|
constructor(t) {
|
|
3152
3162
|
G(this, "askUserMessageId");
|
|
3153
3163
|
G(this, "connection");
|
|
3154
3164
|
G(this, "unsubscribe");
|
|
3155
3165
|
G(this, "closed", !1);
|
|
3156
|
-
this.askUserMessageId = t.askUserMessageId.trim(), this.connection =
|
|
3166
|
+
this.askUserMessageId = t.askUserMessageId.trim(), this.connection = $i(t.url);
|
|
3157
3167
|
const n = t.onAutoControl;
|
|
3158
3168
|
this.unsubscribe = n ? this.connection.subscribe(this.askUserMessageId, n) : () => {
|
|
3159
3169
|
};
|
|
@@ -3171,21 +3181,21 @@ class $i {
|
|
|
3171
3181
|
function Pn(e) {
|
|
3172
3182
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
3173
3183
|
}
|
|
3174
|
-
function
|
|
3184
|
+
function Ki(e, t) {
|
|
3175
3185
|
if (!e) return !1;
|
|
3176
3186
|
const n = e.querySelector(`[data-skopon-field="${Pn(t)}"]`);
|
|
3177
3187
|
return n instanceof HTMLElement ? ((n.querySelector(
|
|
3178
3188
|
'input, textarea, select, button, [tabindex]:not([tabindex="-1"])'
|
|
3179
3189
|
) ?? n).focus(), !0) : !1;
|
|
3180
3190
|
}
|
|
3181
|
-
function
|
|
3191
|
+
function Ji(e, t) {
|
|
3182
3192
|
if (!e) return !1;
|
|
3183
3193
|
const n = e.querySelector(`[data-skopon-field="${Pn(t)}"]`);
|
|
3184
3194
|
return n instanceof HTMLElement ? ((n.querySelector(
|
|
3185
3195
|
'button, [role="button"], .skopon-resume-select-card, input, label'
|
|
3186
3196
|
) ?? n).click(), !0) : !1;
|
|
3187
3197
|
}
|
|
3188
|
-
function
|
|
3198
|
+
function Gi(e, t, n) {
|
|
3189
3199
|
const r = e.action;
|
|
3190
3200
|
if (r !== "change" && r !== "select" && r !== "focus" && r !== "click" && r !== "submit") {
|
|
3191
3201
|
console.warn("[FormAutoControl] unknown action", r);
|
|
@@ -3215,47 +3225,47 @@ function Ki(e, t, n) {
|
|
|
3215
3225
|
return;
|
|
3216
3226
|
}
|
|
3217
3227
|
if (r === "focus") {
|
|
3218
|
-
|
|
3228
|
+
Ki(t.rootElement, o), n.reportEvent({
|
|
3219
3229
|
action: "focus",
|
|
3220
3230
|
component: i,
|
|
3221
3231
|
field: o
|
|
3222
3232
|
});
|
|
3223
3233
|
return;
|
|
3224
3234
|
}
|
|
3225
|
-
|
|
3235
|
+
Ji(t.rootElement, o) || console.warn("[FormAutoControl] click target not found", o);
|
|
3226
3236
|
});
|
|
3227
3237
|
}
|
|
3228
|
-
function
|
|
3238
|
+
function Wi(e) {
|
|
3229
3239
|
const t = {};
|
|
3230
3240
|
for (const [n, r] of Object.entries(e))
|
|
3231
3241
|
r !== void 0 && (t[n] = r);
|
|
3232
3242
|
return t;
|
|
3233
3243
|
}
|
|
3234
|
-
function
|
|
3244
|
+
function Yi(e, t) {
|
|
3235
3245
|
var o;
|
|
3236
3246
|
const n = (o = e.name) == null ? void 0 : o.trim();
|
|
3237
3247
|
if (!n || !t) return { ...e };
|
|
3238
3248
|
const r = t.get(n);
|
|
3239
3249
|
return r ? e.type !== "resume_multiselect" && e.type !== "case_multiselect" ? { ...e } : { ...e, options: r.map((i) => ({ ...i })) } : { ...e };
|
|
3240
3250
|
}
|
|
3241
|
-
function
|
|
3251
|
+
function Qi(e) {
|
|
3242
3252
|
var i, s;
|
|
3243
3253
|
const n = {
|
|
3244
3254
|
blocks: (e.blocks ?? []).map(
|
|
3245
|
-
(a) =>
|
|
3255
|
+
(a) => Yi(a, e.liveOptions)
|
|
3246
3256
|
)
|
|
3247
3257
|
}, r = (i = e.title) == null ? void 0 : i.trim(), o = (s = e.description) == null ? void 0 : s.trim();
|
|
3248
3258
|
return r && (n.title = r), o && (n.description = o), {
|
|
3249
3259
|
form_schema: n,
|
|
3250
|
-
form_values:
|
|
3260
|
+
form_values: Wi(e.values ?? {}),
|
|
3251
3261
|
form_change: [...e.formChange ?? []]
|
|
3252
3262
|
};
|
|
3253
3263
|
}
|
|
3254
|
-
function
|
|
3264
|
+
function Xi(e) {
|
|
3255
3265
|
const t = Ve(e);
|
|
3256
3266
|
return t ? ze(t.blocks) : e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
3257
3267
|
}
|
|
3258
|
-
function
|
|
3268
|
+
function Zi({
|
|
3259
3269
|
payload: e,
|
|
3260
3270
|
callbackUrl: t,
|
|
3261
3271
|
title: n,
|
|
@@ -3265,7 +3275,7 @@ function Qi({
|
|
|
3265
3275
|
submitHeaders: s,
|
|
3266
3276
|
onNotify: a
|
|
3267
3277
|
}) {
|
|
3268
|
-
const [l, c] =
|
|
3278
|
+
const [l, c] = w(!1), m = A(!0);
|
|
3269
3279
|
q(() => (m.current = !0, () => {
|
|
3270
3280
|
m.current = !1;
|
|
3271
3281
|
}), []);
|
|
@@ -3275,7 +3285,7 @@ function Qi({
|
|
|
3275
3285
|
), b = L(
|
|
3276
3286
|
() => An(e, t, d),
|
|
3277
3287
|
[e, t, d]
|
|
3278
|
-
),
|
|
3288
|
+
), y = L(
|
|
3279
3289
|
() => ({
|
|
3280
3290
|
...i,
|
|
3281
3291
|
callbackUrl: (i == null ? void 0 : i.callbackUrl) ?? t ?? null
|
|
@@ -3286,19 +3296,19 @@ function Qi({
|
|
|
3286
3296
|
if (!l) {
|
|
3287
3297
|
c(!0);
|
|
3288
3298
|
try {
|
|
3289
|
-
const
|
|
3290
|
-
context:
|
|
3299
|
+
const g = Xi(e), k = Mt({
|
|
3300
|
+
context: y,
|
|
3291
3301
|
payload: e,
|
|
3292
|
-
answer:
|
|
3302
|
+
answer: g
|
|
3293
3303
|
}), p = await Nn(k, {
|
|
3294
3304
|
headers: d
|
|
3295
3305
|
});
|
|
3296
3306
|
if (!m.current) return;
|
|
3297
3307
|
const f = Mn(p);
|
|
3298
3308
|
a == null || a(f.type, f.message);
|
|
3299
|
-
} catch (
|
|
3309
|
+
} catch (g) {
|
|
3300
3310
|
if (!m.current) return;
|
|
3301
|
-
const k =
|
|
3311
|
+
const k = g instanceof Error ? g.message : "提交失败";
|
|
3302
3312
|
a == null || a("error", k);
|
|
3303
3313
|
} finally {
|
|
3304
3314
|
m.current && c(!1);
|
|
@@ -3309,10 +3319,10 @@ function Qi({
|
|
|
3309
3319
|
/* @__PURE__ */ M("div", { className: "ask-user-curl-card-header", children: [
|
|
3310
3320
|
/* @__PURE__ */ M("div", { className: "ask-user-curl-card-header-title", children: [
|
|
3311
3321
|
/* @__PURE__ */ u(ne.Text, { type: "secondary", children: n ?? "curl 命令" }),
|
|
3312
|
-
r ? /* @__PURE__ */ u(
|
|
3313
|
-
o ? /* @__PURE__ */ u(
|
|
3322
|
+
r ? /* @__PURE__ */ u(ye, { title: r, children: /* @__PURE__ */ u(ve, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
|
|
3323
|
+
o ? /* @__PURE__ */ u(ye, { title: o, children: /* @__PURE__ */ u(ve, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
|
|
3314
3324
|
] }),
|
|
3315
|
-
/* @__PURE__ */ u(
|
|
3325
|
+
/* @__PURE__ */ u(ye, { title: "提交到 answer_agent_callback_url", children: /* @__PURE__ */ u(
|
|
3316
3326
|
Oe,
|
|
3317
3327
|
{
|
|
3318
3328
|
size: "small",
|
|
@@ -3327,8 +3337,8 @@ function Qi({
|
|
|
3327
3337
|
/* @__PURE__ */ u("pre", { className: "skopon-form-curl-json", children: b })
|
|
3328
3338
|
] });
|
|
3329
3339
|
}
|
|
3330
|
-
const
|
|
3331
|
-
function
|
|
3340
|
+
const es = 80;
|
|
3341
|
+
function ts(e, t) {
|
|
3332
3342
|
if (t && typeof t == "object" && t !== null && "message" in t) {
|
|
3333
3343
|
const n = t.message;
|
|
3334
3344
|
if (typeof n == "string" && n.trim())
|
|
@@ -3336,7 +3346,7 @@ function Zi(e, t) {
|
|
|
3336
3346
|
}
|
|
3337
3347
|
return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
|
|
3338
3348
|
}
|
|
3339
|
-
function
|
|
3349
|
+
function ns({
|
|
3340
3350
|
payload: e,
|
|
3341
3351
|
formUniqueId: t,
|
|
3342
3352
|
askUserMessageId: n,
|
|
@@ -3351,7 +3361,7 @@ function es({
|
|
|
3351
3361
|
onSurfaceReadyChange: d,
|
|
3352
3362
|
onAutoControlReady: b
|
|
3353
3363
|
}) {
|
|
3354
|
-
const [
|
|
3364
|
+
const [y, S] = w(null), [g, k] = w(!1), [p, f] = w(!0), [v, x] = w(!1), N = A(null), _ = A(null), z = A(!0), C = A(l);
|
|
3355
3365
|
C.current = l;
|
|
3356
3366
|
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
3367
|
() => Tt(s),
|
|
@@ -3363,8 +3373,8 @@ function es({
|
|
|
3363
3373
|
}),
|
|
3364
3374
|
[i, r]
|
|
3365
3375
|
);
|
|
3366
|
-
q(() => (
|
|
3367
|
-
|
|
3376
|
+
q(() => (z.current = !0, () => {
|
|
3377
|
+
z.current = !1, K.current != null && (clearTimeout(K.current), K.current = null);
|
|
3368
3378
|
}), []), q(() => {
|
|
3369
3379
|
let F = !1;
|
|
3370
3380
|
return $ ? (f(!0), k(!1), a({ formUniqueId: $ }).then((O) => {
|
|
@@ -3384,32 +3394,32 @@ function es({
|
|
|
3384
3394
|
F = !0;
|
|
3385
3395
|
});
|
|
3386
3396
|
}, [$, a]);
|
|
3387
|
-
const E = L(() => Ve(e), [e]),
|
|
3397
|
+
const E = L(() => Ve(e), [e]), P = L(() => E ? Bo(E, y ?? void 0) : null, [E, y]), T = (P == null ? void 0 : P.matchedBlocks) ?? [], D = !!(E && Vo(E) && T.length === 0), U = L(() => D && E ? Lo(E) : P && P.renderBlocks.length > 0 ? P.renderBlocks : [], [P, D, E]), I = L(() => {
|
|
3388
3398
|
if (D && E)
|
|
3389
|
-
return
|
|
3390
|
-
const F = ze((
|
|
3399
|
+
return jo(E);
|
|
3400
|
+
const F = ze((P == null ? void 0 : P.extraBlocks) ?? []);
|
|
3391
3401
|
return { ...ze(
|
|
3392
|
-
((
|
|
3402
|
+
((P == null ? void 0 : P.matchedBlocks) ?? []).filter(
|
|
3393
3403
|
(J) => J.type === "text" && J.hidden === !0
|
|
3394
3404
|
)
|
|
3395
3405
|
), ...F };
|
|
3396
|
-
}, [D, E,
|
|
3397
|
-
() =>
|
|
3406
|
+
}, [D, E, P]), Y = L(
|
|
3407
|
+
() => U.filter((F) => {
|
|
3398
3408
|
var O;
|
|
3399
3409
|
return (O = F.name) == null ? void 0 : O.trim();
|
|
3400
3410
|
}).map((F) => F.name.trim()),
|
|
3401
|
-
[
|
|
3402
|
-
),
|
|
3403
|
-
{ title:
|
|
3404
|
-
|
|
3405
|
-
), [
|
|
3406
|
-
if (!
|
|
3411
|
+
[U]
|
|
3412
|
+
), ce = (P == null ? void 0 : P.title) ?? (E == null ? void 0 : E.title) ?? "", ue = (P == null ? void 0 : P.description) ?? (E == null ? void 0 : E.description) ?? "", me = L(() => U.length === 0 ? null : Uo(
|
|
3413
|
+
{ title: ce, description: ue },
|
|
3414
|
+
U
|
|
3415
|
+
), [ce, ue, U]), $e = L(() => {
|
|
3416
|
+
if (!me) return "";
|
|
3407
3417
|
try {
|
|
3408
|
-
return JSON.stringify(
|
|
3418
|
+
return JSON.stringify(me);
|
|
3409
3419
|
} catch {
|
|
3410
|
-
return String(
|
|
3420
|
+
return String(me);
|
|
3411
3421
|
}
|
|
3412
|
-
}, [
|
|
3422
|
+
}, [me]), De = $ ? `ask-user-${$}` : "ask-user-payload", oe = !!(!p && E && U.length > 0 && me);
|
|
3413
3423
|
q(() => (d(oe), () => d(!1)), [oe, d]);
|
|
3414
3424
|
const It = j(() => {
|
|
3415
3425
|
var O;
|
|
@@ -3418,21 +3428,21 @@ function es({
|
|
|
3418
3428
|
Ft.current = V.liveOptions;
|
|
3419
3429
|
const He = A(V.pendingChangeFields);
|
|
3420
3430
|
He.current = V.pendingChangeFields;
|
|
3421
|
-
const
|
|
3431
|
+
const he = j(
|
|
3422
3432
|
(F) => {
|
|
3423
|
-
const O =
|
|
3424
|
-
title:
|
|
3425
|
-
description:
|
|
3426
|
-
blocks:
|
|
3433
|
+
const O = Qi({
|
|
3434
|
+
title: ce,
|
|
3435
|
+
description: ue,
|
|
3436
|
+
blocks: U,
|
|
3427
3437
|
values: It(),
|
|
3428
3438
|
liveOptions: Ft.current,
|
|
3429
3439
|
formChange: F
|
|
3430
3440
|
});
|
|
3431
3441
|
B.reportData(O);
|
|
3432
3442
|
},
|
|
3433
|
-
[
|
|
3434
|
-
), Ke = A(
|
|
3435
|
-
Ke.current =
|
|
3443
|
+
[ce, ue, U, It, B]
|
|
3444
|
+
), Ke = A(he);
|
|
3445
|
+
Ke.current = he, q(() => {
|
|
3436
3446
|
if (!oe) {
|
|
3437
3447
|
re.current = "";
|
|
3438
3448
|
return;
|
|
@@ -3441,16 +3451,16 @@ function es({
|
|
|
3441
3451
|
const F = `${De}::${$e}`;
|
|
3442
3452
|
if (re.current === F) return;
|
|
3443
3453
|
const O = setTimeout(() => {
|
|
3444
|
-
|
|
3454
|
+
z.current && re.current !== F && (re.current = F, Ke.current([]));
|
|
3445
3455
|
}, 0);
|
|
3446
3456
|
return () => clearTimeout(O);
|
|
3447
3457
|
}, [oe, De, $e]), q(() => {
|
|
3448
3458
|
if (!(!oe || V.version === 0) && He.current.length !== 0)
|
|
3449
3459
|
return K.current != null && clearTimeout(K.current), K.current = setTimeout(() => {
|
|
3450
|
-
if (K.current = null, !
|
|
3460
|
+
if (K.current = null, !z.current) return;
|
|
3451
3461
|
const F = [...He.current];
|
|
3452
3462
|
V.clearPendingChangeFields(), F.length !== 0 && Ke.current(F);
|
|
3453
|
-
},
|
|
3463
|
+
}, es), () => {
|
|
3454
3464
|
K.current != null && (clearTimeout(K.current), K.current = null);
|
|
3455
3465
|
};
|
|
3456
3466
|
}, [oe, V.version, V.clearPendingChangeFields]);
|
|
@@ -3459,7 +3469,7 @@ function es({
|
|
|
3459
3469
|
if (!v) {
|
|
3460
3470
|
x(!0);
|
|
3461
3471
|
try {
|
|
3462
|
-
const
|
|
3472
|
+
const ge = { ...((F = N.current) == null ? void 0 : F.getValues(Y)) ?? {}, ...I }, Ot = mi(U, ge);
|
|
3463
3473
|
if (Ot) {
|
|
3464
3474
|
(O = C.current) == null || O.call(C, "error", Ot.message);
|
|
3465
3475
|
return;
|
|
@@ -3470,64 +3480,69 @@ function es({
|
|
|
3470
3480
|
(J = C.current) == null || J.call(C, "error", "callback_url 为空,无法提交");
|
|
3471
3481
|
return;
|
|
3472
3482
|
}
|
|
3473
|
-
|
|
3483
|
+
he([]), B.reportEvent({
|
|
3474
3484
|
action: "submit",
|
|
3475
3485
|
component: "SubmitButton"
|
|
3476
3486
|
});
|
|
3477
|
-
const We = await _n(Lt,
|
|
3487
|
+
const We = await _n(Lt, ge, {
|
|
3478
3488
|
headers: ee
|
|
3479
3489
|
});
|
|
3480
|
-
if (!
|
|
3481
|
-
We.ok ? (Ie = C.current) == null || Ie.call(C, "success", "提交成功") : (Rt = C.current) == null || Rt.call(C, "error",
|
|
3490
|
+
if (!z.current) return;
|
|
3491
|
+
We.ok ? (Ie = C.current) == null || Ie.call(C, "success", "提交成功") : (Rt = C.current) == null || Rt.call(C, "error", ts(We.status, We.body));
|
|
3482
3492
|
return;
|
|
3483
3493
|
}
|
|
3484
|
-
const
|
|
3494
|
+
const wn = U.length > 0 ? {
|
|
3495
|
+
title: ce,
|
|
3496
|
+
description: ue,
|
|
3497
|
+
blocks: U
|
|
3498
|
+
} : E ?? void 0, qt = Mt({
|
|
3485
3499
|
context: te,
|
|
3486
3500
|
payload: e,
|
|
3487
|
-
form:
|
|
3488
|
-
answer:
|
|
3501
|
+
form: wn,
|
|
3502
|
+
answer: ge
|
|
3489
3503
|
}), Bt = Nt(qt);
|
|
3490
3504
|
if (Bt) {
|
|
3491
3505
|
(Pt = C.current) == null || Pt.call(C, "error", Bt);
|
|
3492
3506
|
return;
|
|
3493
3507
|
}
|
|
3494
|
-
|
|
3508
|
+
he([]), B.reportEvent({
|
|
3495
3509
|
action: "submit",
|
|
3496
3510
|
component: "SubmitButton"
|
|
3497
3511
|
});
|
|
3498
|
-
const
|
|
3512
|
+
const zn = await Nn(qt, {
|
|
3499
3513
|
headers: ee
|
|
3500
3514
|
});
|
|
3501
|
-
if (!
|
|
3502
|
-
const Vt = Mn(
|
|
3515
|
+
if (!z.current) return;
|
|
3516
|
+
const Vt = Mn(zn);
|
|
3503
3517
|
(wt = C.current) == null || wt.call(C, Vt.type, Vt.message);
|
|
3504
3518
|
} catch (Ge) {
|
|
3505
|
-
if (!
|
|
3506
|
-
const
|
|
3507
|
-
(zt = C.current) == null || zt.call(C, "error",
|
|
3519
|
+
if (!z.current) return;
|
|
3520
|
+
const ge = Ge instanceof Error ? Ge.message : "提交失败";
|
|
3521
|
+
(zt = C.current) == null || zt.call(C, "error", ge);
|
|
3508
3522
|
} finally {
|
|
3509
|
-
|
|
3523
|
+
z.current && x(!1);
|
|
3510
3524
|
}
|
|
3511
3525
|
}
|
|
3512
3526
|
}, [
|
|
3513
3527
|
v,
|
|
3514
3528
|
Y,
|
|
3515
|
-
|
|
3529
|
+
U,
|
|
3530
|
+
ce,
|
|
3531
|
+
ue,
|
|
3516
3532
|
I,
|
|
3517
|
-
|
|
3533
|
+
he,
|
|
3518
3534
|
B,
|
|
3519
3535
|
o,
|
|
3520
3536
|
r,
|
|
3521
3537
|
ee,
|
|
3522
3538
|
te,
|
|
3523
3539
|
e,
|
|
3524
|
-
g,
|
|
3525
3540
|
E
|
|
3526
3541
|
]), Et = A(Je);
|
|
3527
3542
|
Et.current = Je;
|
|
3528
3543
|
const Ut = j(
|
|
3529
3544
|
(F) => {
|
|
3530
|
-
|
|
3545
|
+
Gi(
|
|
3531
3546
|
F,
|
|
3532
3547
|
{
|
|
3533
3548
|
setValues: (O) => {
|
|
@@ -3555,14 +3570,14 @@ function es({
|
|
|
3555
3570
|
return;
|
|
3556
3571
|
}
|
|
3557
3572
|
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 ||
|
|
3559
|
-
|
|
3573
|
+
}, [oe, Ut, b]), p ? /* @__PURE__ */ u("div", { className: "ask-user-form-card", children: /* @__PURE__ */ u(ft, { size: "small" }) }) : !E || U.length === 0 ? /* @__PURE__ */ u(
|
|
3574
|
+
Zi,
|
|
3560
3575
|
{
|
|
3561
3576
|
payload: e,
|
|
3562
3577
|
callbackUrl: r,
|
|
3563
3578
|
answerAgentContext: te,
|
|
3564
3579
|
submitHeaders: s,
|
|
3565
|
-
unpublishedFormId:
|
|
3580
|
+
unpublishedFormId: g && $ ? $ : void 0,
|
|
3566
3581
|
onNotify: l
|
|
3567
3582
|
}
|
|
3568
3583
|
) : /* @__PURE__ */ M(
|
|
@@ -3572,12 +3587,12 @@ function es({
|
|
|
3572
3587
|
ref: _,
|
|
3573
3588
|
"data-ask-user-message-id": W || void 0,
|
|
3574
3589
|
children: [
|
|
3575
|
-
|
|
3590
|
+
g && $ ? /* @__PURE__ */ u("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ u(ye, { title: $, children: /* @__PURE__ */ u(ve, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
|
|
3576
3591
|
/* @__PURE__ */ u(
|
|
3577
|
-
|
|
3592
|
+
Bi,
|
|
3578
3593
|
{
|
|
3579
3594
|
ref: N,
|
|
3580
|
-
doc:
|
|
3595
|
+
doc: me,
|
|
3581
3596
|
surfaceId: De,
|
|
3582
3597
|
fieldNames: Y,
|
|
3583
3598
|
interactive: !0,
|
|
@@ -3587,7 +3602,7 @@ function es({
|
|
|
3587
3602
|
}
|
|
3588
3603
|
),
|
|
3589
3604
|
/* @__PURE__ */ u("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ u(
|
|
3590
|
-
|
|
3605
|
+
ye,
|
|
3591
3606
|
{
|
|
3592
3607
|
title: o === "post" ? "提交 JSON 到 callback_url" : "提交到 answer_agent_callback_url",
|
|
3593
3608
|
children: /* @__PURE__ */ u(
|
|
@@ -3607,16 +3622,16 @@ function es({
|
|
|
3607
3622
|
}
|
|
3608
3623
|
);
|
|
3609
3624
|
}
|
|
3610
|
-
function
|
|
3625
|
+
function Ts(e) {
|
|
3611
3626
|
var c;
|
|
3612
|
-
const t = ((c = e.askUserMessageId) == null ? void 0 : c.trim()) ?? "", n = L(() =>
|
|
3627
|
+
const t = ((c = e.askUserMessageId) == null ? void 0 : c.trim()) ?? "", n = L(() => Qo(), []), [r, o] = w(!1), i = A(null), s = j((m) => {
|
|
3613
3628
|
o(m);
|
|
3614
3629
|
}, []), a = j(
|
|
3615
3630
|
(m) => {
|
|
3616
3631
|
i.current = m;
|
|
3617
3632
|
},
|
|
3618
3633
|
[]
|
|
3619
|
-
), l = L(() => !n || !t ? null : new
|
|
3634
|
+
), l = L(() => !n || !t ? null : new Hi({
|
|
3620
3635
|
url: n,
|
|
3621
3636
|
askUserMessageId: t,
|
|
3622
3637
|
onAutoControl: (m) => {
|
|
@@ -3631,8 +3646,8 @@ function As(e) {
|
|
|
3631
3646
|
};
|
|
3632
3647
|
}, [l]), q(() => {
|
|
3633
3648
|
!l || !r || l.connect();
|
|
3634
|
-
}, [l, r]), /* @__PURE__ */ u(
|
|
3635
|
-
|
|
3649
|
+
}, [l, r]), /* @__PURE__ */ u(ke, { children: /* @__PURE__ */ u(Hr, { client: l, children: /* @__PURE__ */ u(Lr, { children: /* @__PURE__ */ u(
|
|
3650
|
+
ns,
|
|
3636
3651
|
{
|
|
3637
3652
|
...e,
|
|
3638
3653
|
onSurfaceReadyChange: s,
|
|
@@ -3641,71 +3656,71 @@ function As(e) {
|
|
|
3641
3656
|
) }) }) });
|
|
3642
3657
|
}
|
|
3643
3658
|
export {
|
|
3644
|
-
|
|
3645
|
-
|
|
3659
|
+
ps as A2UI_PROTOCOL_VERSION,
|
|
3660
|
+
Ts as AskUserFormCard,
|
|
3646
3661
|
lt as CaseSearchProvider,
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3662
|
+
Zi as CurlSubmitBlock,
|
|
3663
|
+
Go as DEFAULT_ANSWER_AGENT_CALLBACK_URL,
|
|
3664
|
+
Ko as DEFAULT_AUTH_ANSWER_AGENT_CALLBACK_URL_FIELD,
|
|
3665
|
+
Jo as DEFAULT_AUTH_REALTIME_WS_URL_FIELD,
|
|
3651
3666
|
Ct as DEFAULT_AUTH_STORAGE_KEY,
|
|
3652
|
-
|
|
3653
|
-
|
|
3667
|
+
Ho as DEFAULT_AUTH_TOKEN_FIELD,
|
|
3668
|
+
rr as FORM_MEDIA_SIZES,
|
|
3654
3669
|
ct as ResumeSearchProvider,
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3670
|
+
_s as SkoponA2uiStreamRenderer,
|
|
3671
|
+
ke as SkoponFormProvider,
|
|
3672
|
+
Bi as SkoponFormRenderer,
|
|
3673
|
+
Io as a2uiToBlocks,
|
|
3659
3674
|
vn as blocksToA2ui,
|
|
3660
|
-
|
|
3675
|
+
wr as blocksToJsonSchema,
|
|
3661
3676
|
Mt as buildAnswerAgentBody,
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3677
|
+
$o as buildAskUserCurlBodyJson,
|
|
3678
|
+
Do as buildAskUserCurlStatement,
|
|
3679
|
+
Ss as buildAskUserSubmitCurlFromPayload,
|
|
3680
|
+
Uo as buildAskUserSurface,
|
|
3666
3681
|
An as buildCurlStatement,
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3682
|
+
Me as coerceToggleValue,
|
|
3683
|
+
ks as copyTextToClipboard,
|
|
3684
|
+
ci as createCaseSearchClient,
|
|
3685
|
+
vs as createEmptyBlock,
|
|
3686
|
+
ys as createEmptyFormDefinition,
|
|
3687
|
+
Xo as createFormClient,
|
|
3688
|
+
ii as createResumeSearchClient,
|
|
3689
|
+
As as createSkoponSdkClients,
|
|
3675
3690
|
ze as extractExtraBlockValues,
|
|
3676
|
-
|
|
3691
|
+
Po as extractSurfaceValues,
|
|
3677
3692
|
Mn as formatAnswerAgentSubmitMessage,
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3693
|
+
jo as getPayloadHiddenBlockValues,
|
|
3694
|
+
bs as getPayloadInputFieldNames,
|
|
3695
|
+
Lo as getPayloadRenderableBlocks,
|
|
3696
|
+
Bo as intersectPayloadBlocksWithForm,
|
|
3682
3697
|
dt as isA2uiSurfaceEmpty,
|
|
3683
|
-
|
|
3698
|
+
hs as isDisplayBlockType,
|
|
3684
3699
|
Z as isInputBlockType,
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3700
|
+
_e as isLayoutBlockType,
|
|
3701
|
+
pe as isMediaBlockType,
|
|
3702
|
+
or as isOptionsBlockType,
|
|
3703
|
+
Ro as mapFormDefinitionFromDto,
|
|
3689
3704
|
qe as normalizeFormDefinition,
|
|
3690
|
-
|
|
3705
|
+
de as normalizeMultiselectCount,
|
|
3691
3706
|
Ve as parsePayloadBlocksJson,
|
|
3692
|
-
|
|
3693
|
-
|
|
3707
|
+
Vo as payloadHasInputBlocks,
|
|
3708
|
+
Yo as resolveAnswerAgentCallbackUrl,
|
|
3694
3709
|
xt as resolveClientHeaders,
|
|
3695
|
-
|
|
3696
|
-
|
|
3710
|
+
Qo as resolveRealtimeWsUrl,
|
|
3711
|
+
Rr as resolveSchemaDefaultValue,
|
|
3697
3712
|
Tn as resolveSkoponAuthHeaders,
|
|
3698
3713
|
Tt as resolveSubmitAuthHeaders,
|
|
3699
|
-
|
|
3700
|
-
|
|
3714
|
+
Eo as resolveSurfaceFromFormDefinition,
|
|
3715
|
+
qi as skoponAntdTheme,
|
|
3701
3716
|
ie as skoponBrandColors,
|
|
3702
3717
|
Nn as submitAnswerAgent,
|
|
3703
3718
|
_n as submitFormJson,
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3719
|
+
gs as supportsDefaultValue,
|
|
3720
|
+
Fo as surfaceDocToMessages,
|
|
3721
|
+
be as syncFormDefinition,
|
|
3722
|
+
Gr as useCaseSearch,
|
|
3723
|
+
oo as useResumeSearch,
|
|
3709
3724
|
Nt as validateAnswerAgentBody,
|
|
3710
|
-
|
|
3725
|
+
Cs as validateAnswerAgentContext
|
|
3711
3726
|
};
|