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