@skopon-cool/form-sdk 0.4.5 → 0.4.6

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