@skopon-cool/form-sdk 0.2.1 → 0.2.2

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.
Files changed (50) hide show
  1. package/README.md +94 -9
  2. package/dist/adapter/a2uiAdapter.d.ts +1 -0
  3. package/dist/adapter/a2uiAdapter.d.ts.map +1 -1
  4. package/dist/adapter/formSchema.d.ts +2 -1
  5. package/dist/adapter/formSchema.d.ts.map +1 -1
  6. package/dist/catalog/a2uiCustomCatalog.d.ts.map +1 -1
  7. package/dist/client/apiEnvelope.d.ts +7 -0
  8. package/dist/client/apiEnvelope.d.ts.map +1 -0
  9. package/dist/client/authStorage.d.ts +19 -0
  10. package/dist/client/authStorage.d.ts.map +1 -0
  11. package/dist/client/caseSearchClient.d.ts +11 -0
  12. package/dist/client/caseSearchClient.d.ts.map +1 -0
  13. package/dist/client/formClient.d.ts +2 -2
  14. package/dist/client/formClient.d.ts.map +1 -1
  15. package/dist/client/resumeSearchClient.d.ts +9 -0
  16. package/dist/client/resumeSearchClient.d.ts.map +1 -0
  17. package/dist/client/skoponSdkClients.d.ts +22 -0
  18. package/dist/client/skoponSdkClients.d.ts.map +1 -0
  19. package/dist/components/AskUserFormCard.d.ts.map +1 -1
  20. package/dist/index.d.ts +4 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +1013 -759
  23. package/dist/submit/validateFormSubmit.d.ts +10 -0
  24. package/dist/submit/validateFormSubmit.d.ts.map +1 -0
  25. package/package.json +1 -1
  26. package/src/adapter/a2uiAdapter.ts +1 -1
  27. package/src/adapter/formSchema.test.ts +24 -0
  28. package/src/adapter/formSchema.ts +9 -2
  29. package/src/adapter/resolveSurface.ts +3 -3
  30. package/src/catalog/a2uiCustomCatalog.tsx +35 -3
  31. package/src/catalog/textFieldPreview.test.tsx +31 -0
  32. package/src/client/apiEnvelope.ts +21 -0
  33. package/src/client/authStorage.test.ts +61 -0
  34. package/src/client/authStorage.ts +70 -0
  35. package/src/client/caseSearchClient.ts +107 -0
  36. package/src/client/formClient.test.ts +25 -0
  37. package/src/client/formClient.ts +7 -25
  38. package/src/client/resumeSearchClient.test.ts +87 -0
  39. package/src/client/resumeSearchClient.ts +108 -0
  40. package/src/client/skoponSdkClients.ts +51 -0
  41. package/src/components/AskUserFormCard.tsx +6 -0
  42. package/src/index.ts +21 -0
  43. package/src/submit/submit.test.ts +40 -0
  44. package/src/submit/validateFormSubmit.ts +111 -0
  45. package/dist/catalog/skoponSelectLoading.test.d.ts +0 -2
  46. package/dist/catalog/skoponSelectLoading.test.d.ts.map +0 -1
  47. package/dist/catalog/textFieldPreview.test.d.ts +0 -2
  48. package/dist/catalog/textFieldPreview.test.d.ts.map +0 -1
  49. package/dist/components/SkoponA2uiStreamRenderer.test.d.ts +0 -2
  50. package/dist/components/SkoponA2uiStreamRenderer.test.d.ts.map +0 -1
package/dist/index.js CHANGED
@@ -1,31 +1,31 @@
1
1
  import './form-sdk.css';
2
- import { jsx as l, jsxs as C } from "react/jsx-runtime";
3
- import { createContext as we, useContext as Le, useCallback as te, useSyncExternalStore as It, useMemo as V, useState as P, useRef as L, useEffect as B, forwardRef as Ft, useImperativeHandle as Pt } from "react";
4
- import { Spin as je, Button as ge, Typography as H, Avatar as zt, Tag as re, Select as Ue, Checkbox as Ut, Radio as _t, Switch as Et, TimePicker as Rt, DatePicker as Bt, Upload as ke, Input as Ae, InputNumber as Ot, ConfigProvider as Vt, Tooltip as ne } from "antd";
5
- import { ReloadOutlined as Ze, FileTextOutlined as et, UserOutlined as qt, FileImageOutlined as wt, FileExcelOutlined as Lt, FileOutlined as tt, PictureOutlined as jt, SoundOutlined as $t, VideoCameraOutlined as Dt } from "@ant-design/icons";
6
- import { createBinderlessComponentImplementation as q, basicCatalog as de, A2uiSurface as nt } from "@a2ui/react/v0_9";
2
+ import { jsx as l, jsxs as k } from "react/jsx-runtime";
3
+ import { createContext as Le, useContext as $e, useCallback as te, useSyncExternalStore as Bt, useMemo as q, useState as _, useRef as L, useEffect as R, forwardRef as wt, useImperativeHandle as qt } from "react";
4
+ import { Spin as De, Button as Se, Typography as D, Avatar as Ot, Tag as re, Select as Re, Checkbox as Vt, Radio as jt, Switch as Lt, TimePicker as $t, DatePicker as Dt, Upload as Te, Input as Ie, InputNumber as Ht, ConfigProvider as Kt, Tooltip as ne } from "antd";
5
+ import { ReloadOutlined as it, FileTextOutlined as at, UserOutlined as Gt, FileImageOutlined as Jt, FileExcelOutlined as Yt, FileOutlined as st, PictureOutlined as Xt, SoundOutlined as Wt, VideoCameraOutlined as Qt } from "@ant-design/icons";
6
+ import { createBinderlessComponentImplementation as V, basicCatalog as fe, A2uiSurface as lt } from "@a2ui/react/v0_9";
7
7
  import { z as f } from "zod";
8
- import { Catalog as Ht, MessageProcessor as rt } from "@a2ui/web_core/v0_9";
9
- import { injectBasicCatalogStyles as ot } from "@a2ui/web_core/v0_9/basic_catalog";
10
- import { injectStyles as it } from "@a2ui/react/styles";
11
- import Ge from "dayjs";
12
- const so = "v0.9", Kt = [
8
+ import { Catalog as Zt, MessageProcessor as ct } from "@a2ui/web_core/v0_9";
9
+ import { injectBasicCatalogStyles as ut } from "@a2ui/web_core/v0_9/basic_catalog";
10
+ import { injectStyles as pt } from "@a2ui/react/styles";
11
+ import Ze from "dayjs";
12
+ const Po = "v0.9", en = [
13
13
  "huge",
14
14
  "large",
15
15
  "medium",
16
16
  "small",
17
17
  "icon"
18
18
  ];
19
- function _e(e) {
19
+ function he(e) {
20
20
  return e === "image" || e === "video" || e === "audio";
21
21
  }
22
- function $e(e) {
22
+ function be(e) {
23
23
  return e === "heading" || e === "paragraph";
24
24
  }
25
25
  function W(e) {
26
- return !$e(e) && !_e(e);
26
+ return !be(e) && !he(e);
27
27
  }
28
- function Gt() {
28
+ function tn() {
29
29
  if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
30
30
  return crypto.randomUUID();
31
31
  if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") {
@@ -40,10 +40,10 @@ function Gt() {
40
40
  });
41
41
  }
42
42
  function ie(e) {
43
- const t = Gt().replace(/-/g, "").slice(0, 8);
43
+ const t = tn().replace(/-/g, "").slice(0, 8);
44
44
  return `${e}${t}`;
45
45
  }
46
- const at = [
46
+ const mt = [
47
47
  { value: "image/*", label: "图片" },
48
48
  { value: "video/*", label: "视频" },
49
49
  { value: "audio/*", label: "音频" },
@@ -54,7 +54,7 @@ const at = [
54
54
  { value: "text/plain", label: "纯文本" },
55
55
  { value: "application/zip", label: "ZIP 压缩包" },
56
56
  { value: "application/x-rar-compressed", label: "RAR 压缩包" }
57
- ], Jt = {
57
+ ], nn = {
58
58
  "image/*": ["image/*"],
59
59
  "video/*": ["video/*"],
60
60
  "audio/*": ["audio/*"],
@@ -74,7 +74,7 @@ const at = [
74
74
  "text/plain": ["text/plain"],
75
75
  "application/zip": ["application/zip"],
76
76
  "application/x-rar-compressed": ["application/x-rar-compressed"]
77
- }, Yt = {
77
+ }, rn = {
78
78
  "image/*": [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"],
79
79
  "video/*": [".mp4", ".mov", ".avi", ".webm"],
80
80
  "audio/*": [".mp3", ".wav", ".ogg", ".m4a"],
@@ -85,14 +85,14 @@ const at = [
85
85
  "text/plain": [".txt"],
86
86
  "application/zip": [".zip", ".7z"],
87
87
  "application/x-rar-compressed": [".rar"]
88
- }, Xt = {
88
+ }, on = {
89
89
  "application/msword": "office/word",
90
90
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document": "office/word",
91
91
  "application/vnd.ms-excel": "office/excel",
92
92
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "office/excel",
93
93
  "application/vnd.ms-powerpoint": "office/ppt",
94
94
  "application/vnd.openxmlformats-officedocument.presentationml.presentation": "office/ppt"
95
- }, De = [
95
+ }, He = [
96
96
  { value: ".jpg", label: ".jpg" },
97
97
  { value: ".jpeg", label: ".jpeg" },
98
98
  { value: ".png", label: ".png" },
@@ -118,18 +118,18 @@ const at = [
118
118
  { value: ".zip", label: ".zip" },
119
119
  { value: ".rar", label: ".rar" },
120
120
  { value: ".7z", label: ".7z" }
121
- ], Wt = Object.fromEntries(
122
- at.map((e) => [e.value, e.label])
123
- ), Qt = Object.fromEntries(
124
- De.map((e) => [e.value, e.label])
125
- ), Zt = new Set(at.map((e) => e.value)), en = new Set(
126
- De.map((e) => e.value)
121
+ ], an = Object.fromEntries(
122
+ mt.map((e) => [e.value, e.label])
123
+ ), sn = Object.fromEntries(
124
+ He.map((e) => [e.value, e.label])
125
+ ), ln = new Set(mt.map((e) => e.value)), cn = new Set(
126
+ He.map((e) => e.value)
127
127
  );
128
- function tn(e) {
128
+ function un(e) {
129
129
  const t = e.trim();
130
- return t ? Zt.has(t) ? t : Xt[t] ?? null : null;
130
+ return t ? ln.has(t) ? t : on[t] ?? null : null;
131
131
  }
132
- function nn(e) {
132
+ function pn(e) {
133
133
  return Array.isArray(e) ? e.map((t) => {
134
134
  const n = t.trim().toLowerCase();
135
135
  return n ? n.startsWith(".") ? n : `.${n}` : "";
@@ -139,100 +139,103 @@ function ae(e) {
139
139
  if (!Array.isArray(e)) return [];
140
140
  const t = [], n = /* @__PURE__ */ new Set();
141
141
  for (const r of e) {
142
- const o = tn(r);
142
+ const o = un(r);
143
143
  o && !n.has(o) && (n.add(o), t.push(o));
144
144
  }
145
145
  return t;
146
146
  }
147
- function rn(e) {
147
+ function mn(e) {
148
148
  const t = ae(e), n = [];
149
149
  for (const r of t)
150
- n.push(...Jt[r] ?? [r]);
150
+ n.push(...nn[r] ?? [r]);
151
151
  return n;
152
152
  }
153
- function on(e) {
153
+ function dn(e) {
154
154
  const t = ae(e);
155
155
  if (t.length === 0) return [];
156
156
  const n = /* @__PURE__ */ new Set();
157
157
  for (const r of t)
158
- for (const o of Yt[r] ?? [])
158
+ for (const o of rn[r] ?? [])
159
159
  n.add(o);
160
- return De.filter((r) => n.has(r.value));
160
+ return He.filter((r) => n.has(r.value));
161
161
  }
162
- function He(e, t) {
163
- const n = nn(t), r = ae(e);
162
+ function Ke(e, t) {
163
+ const n = pn(t), r = ae(e);
164
164
  if (r.length === 0)
165
- return n.filter((i) => en.has(i));
165
+ return n.filter((i) => cn.has(i));
166
166
  const o = new Set(
167
- on(r).map((i) => i.value)
167
+ dn(r).map((i) => i.value)
168
168
  );
169
169
  return n.filter((i) => o.has(i));
170
170
  }
171
- function an(e, t) {
172
- const n = rn(e), r = He(e, t), o = [...n, ...r];
171
+ function fn(e, t) {
172
+ const n = mn(e), r = Ke(e, t), o = [...n, ...r];
173
173
  return o.length > 0 ? o.join(",") : void 0;
174
174
  }
175
- function ln(e, t) {
176
- const n = ae(e), r = He(
175
+ function hn(e, t) {
176
+ const n = ae(e), r = Ke(
177
177
  n,
178
178
  t
179
179
  ), o = [
180
- ...n.map((i) => Wt[i] ?? i),
181
- ...r.map((i) => Qt[i] ?? i)
180
+ ...n.map((i) => an[i] ?? i),
181
+ ...r.map((i) => sn[i] ?? i)
182
182
  ];
183
183
  return o.length === 0 ? null : o.join("、");
184
184
  }
185
- const sn = [
185
+ const gn = [
186
186
  "video",
187
187
  "audio",
188
188
  "image",
189
189
  "file",
190
190
  "spreadsheet",
191
191
  "document"
192
- ], cn = new Set(sn);
193
- function un(e) {
194
- return e && cn.has(e) ? e : "file";
192
+ ], yn = new Set(gn);
193
+ function vn(e) {
194
+ return e && yn.has(e) ? e : "file";
195
195
  }
196
- function le(e) {
197
- return typeof e == "string" && Kt.includes(e) ? e : "medium";
196
+ function se(e) {
197
+ return typeof e == "string" && en.includes(e) ? e : "medium";
198
198
  }
199
- function pn(e, t) {
199
+ function Sn(e, t) {
200
200
  var o;
201
201
  const n = Math.max(1, t);
202
202
  let r = [];
203
203
  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);
204
204
  }
205
- function dn(e) {
205
+ function bn(e) {
206
206
  var t;
207
207
  return Array.isArray(e.mediaUrls) ? e.mediaUrls.map((n) => n.trim()).filter(Boolean) : (t = e.mediaUrl) != null && t.trim() ? [e.mediaUrl.trim()] : [];
208
208
  }
209
- function mn(e) {
210
- return `form-media-size-${le(e)}`;
209
+ function Cn(e) {
210
+ return `form-media-size-${se(e)}`;
211
+ }
212
+ function xn(e) {
213
+ return `form-media-preview form-media-list ${Cn(e)}`;
211
214
  }
212
- function fn(e) {
213
- return `form-media-preview form-media-list ${mn(e)}`;
215
+ const kn = 10;
216
+ function Ge(e) {
217
+ return e && typeof e == "object" && !Array.isArray(e) ? e : {};
214
218
  }
215
- const hn = 10;
216
- function ye(e) {
219
+ function le(e) {
217
220
  return e === !0 || e === "true" || e === 1 || e === "1";
218
221
  }
219
- function Je(e, t = 1) {
222
+ function et(e, t = 1) {
220
223
  const n = typeof e == "number" ? e : Number(e);
221
224
  return Number.isFinite(n) ? Math.max(0, Math.floor(n)) : t;
222
225
  }
223
- function ce(e, t = 1) {
226
+ function pe(e, t = 1) {
224
227
  const n = typeof e == "number" ? e : Number(e);
225
228
  return Number.isFinite(n) ? Math.max(1, Math.floor(n)) : t;
226
229
  }
227
- function gn(e, t) {
230
+ function An(e, t) {
228
231
  if (t !== void 0)
229
- return e === "toggle" ? ye(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);
232
+ return e === "toggle" ? le(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);
230
233
  }
231
- function yn(e) {
234
+ function Tn(e) {
232
235
  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, a = typeof (e == null ? void 0 : e.category) == "string" && e.category.trim() ? e.category.trim() : void 0, s = Array.isArray(e == null ? void 0 : e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
233
236
  return { agentKind: r, agentUniqueId: o, flowType: i, category: a, flowUniqueIds: s, pageSize: n };
234
237
  }
235
- function vn(e) {
238
+ function In(e) {
236
239
  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;
237
240
  return {
238
241
  names: Array.isArray(e == null ? void 0 : e.names) ? e.names.map(String).filter(Boolean) : [],
@@ -241,14 +244,14 @@ function vn(e) {
241
244
  pageSize: n
242
245
  };
243
246
  }
244
- function bn(e) {
247
+ function Nn(e) {
245
248
  if (e.type !== "case_singleselect") return e;
246
249
  const t = typeof e.defaultValue == "string" && e.defaultValue.trim() ? [e.defaultValue.trim()] : Array.isArray(e.defaultValue) ? e.defaultValue.map(String).filter(Boolean) : [];
247
250
  return { ...e, type: "case_multiselect", defaultValue: t };
248
251
  }
249
- function Sn(e) {
252
+ function Mn(e) {
250
253
  var o, i;
251
- const t = bn(e), n = ae(t.fileAcceptTypes), r = t.type;
254
+ const t = Nn(e), n = ae(t.fileAcceptTypes), r = t.type;
252
255
  return {
253
256
  id: ((o = t.id) == null ? void 0 : o.trim()) || ie("block-"),
254
257
  type: r,
@@ -257,17 +260,17 @@ function Sn(e) {
257
260
  placeholder: t.placeholder ?? "",
258
261
  help: t.help ?? "",
259
262
  required: t.required === !0,
260
- mediaUrls: _e(r) ? pn(t, hn) : void 0,
261
- mediaSize: _e(r) ? le(t.mediaSize) : void 0,
263
+ mediaUrls: he(r) ? Sn(t, kn) : void 0,
264
+ mediaSize: he(r) ? se(t.mediaSize) : void 0,
262
265
  fileAcceptTypes: n,
263
- fileAcceptExtensions: He(
266
+ fileAcceptExtensions: Ke(
264
267
  n,
265
268
  t.fileAcceptExtensions
266
269
  ),
267
- filePlaceholderIcon: un(t.filePlaceholderIcon),
268
- fileMinCount: r === "file" ? Je(t.fileMinCount, 1) : void 0,
269
- fileMaxCount: r === "file" ? Je(t.fileMaxCount, 1) : void 0,
270
- defaultValue: gn(r, t.defaultValue),
270
+ filePlaceholderIcon: vn(t.filePlaceholderIcon),
271
+ fileMinCount: r === "file" ? et(t.fileMinCount, 1) : void 0,
272
+ fileMaxCount: r === "file" ? et(t.fileMaxCount, 1) : void 0,
273
+ defaultValue: An(r, t.defaultValue),
271
274
  options: Array.isArray(t.options) ? t.options.map((a, s) => {
272
275
  var c, u;
273
276
  return {
@@ -276,16 +279,16 @@ function Sn(e) {
276
279
  };
277
280
  }) : void 0,
278
281
  resumeEnableRefresh: r === "resume_multiselect" ? t.resumeEnableRefresh !== !1 : void 0,
279
- resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? ce(t.resumeMinCount, 1) : void 0,
280
- resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? ce(t.resumeMaxCount, 1) : void 0,
281
- resumeFilter: r === "resume_multiselect" ? vn(t.resumeFilter) : void 0,
282
+ resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? pe(t.resumeMinCount, 1) : void 0,
283
+ resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? pe(t.resumeMaxCount, 1) : void 0,
284
+ resumeFilter: r === "resume_multiselect" ? In(t.resumeFilter) : void 0,
282
285
  caseEnableRefresh: r === "case_multiselect" ? t.caseEnableRefresh !== !1 : void 0,
283
- caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? ce(t.caseMinCount, 1) : void 0,
284
- caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? ce(t.caseMaxCount, 1) : void 0,
285
- caseFilter: r === "case_multiselect" ? yn(t.caseFilter) : void 0
286
+ caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? pe(t.caseMinCount, 1) : void 0,
287
+ caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? pe(t.caseMaxCount, 1) : void 0,
288
+ caseFilter: r === "case_multiselect" ? Tn(t.caseFilter) : void 0
286
289
  };
287
290
  }
288
- function me(e) {
291
+ function ge(e) {
289
292
  return {
290
293
  title: e.title ?? "",
291
294
  description: e.description ?? "",
@@ -293,18 +296,18 @@ function me(e) {
293
296
  jsonSchema: e.jsonSchema ?? {}
294
297
  };
295
298
  }
296
- function Z(e) {
299
+ function ee(e) {
297
300
  if (!e || !Array.isArray(e.blocks))
298
- return me({ title: "", description: "", blocks: [], jsonSchema: {} });
299
- const t = e.blocks.map(Sn);
300
- return me({
301
+ return ge({ title: "", description: "", blocks: [], jsonSchema: {} });
302
+ const t = e.blocks.map(Mn);
303
+ return ge({
301
304
  title: typeof e.title == "string" ? e.title : "",
302
305
  description: typeof e.description == "string" ? e.description : "",
303
306
  blocks: t,
304
- jsonSchema: {}
307
+ jsonSchema: Ge(e.jsonSchema)
305
308
  });
306
309
  }
307
- function xn(e) {
310
+ function Fn(e) {
308
311
  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, a = Array.isArray(e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
309
312
  return {
310
313
  agentKind: n,
@@ -315,14 +318,14 @@ function xn(e) {
315
318
  pageSize: Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20
316
319
  };
317
320
  }
318
- function Ye(e) {
321
+ function tt(e) {
319
322
  if (e == null) return;
320
323
  const t = typeof e == "number" ? e : Number(e);
321
324
  if (!(!Number.isFinite(t) || t < 1))
322
325
  return Math.floor(t);
323
326
  }
324
- function Cn(e, t) {
325
- var a, s, c, u, d, p;
327
+ function _n(e, t) {
328
+ var a, s, c, u, d, m;
326
329
  const { id: n, label: r, path: o, withData: i } = t;
327
330
  return i({
328
331
  id: n,
@@ -337,14 +340,14 @@ function Cn(e, t) {
337
340
  flowType: (c = e.caseFilter) == null ? void 0 : c.flowType,
338
341
  category: (u = e.caseFilter) == null ? void 0 : u.category,
339
342
  flowUniqueIds: ((d = e.caseFilter) == null ? void 0 : d.flowUniqueIds) ?? [],
340
- pageSize: ((p = e.caseFilter) == null ? void 0 : p.pageSize) ?? 20
343
+ pageSize: ((m = e.caseFilter) == null ? void 0 : m.pageSize) ?? 20
341
344
  },
342
345
  ...e.caseMinCount !== void 0 ? { minCount: e.caseMinCount } : {},
343
346
  ...e.caseMaxCount !== void 0 ? { maxCount: e.caseMaxCount } : {},
344
347
  value: { path: o }
345
348
  });
346
349
  }
347
- function kn(e, t, n) {
350
+ function Pn(e, t, n) {
348
351
  const r = n.nameFromValue(e.value), o = {
349
352
  ...t("case_multiselect"),
350
353
  name: r,
@@ -352,32 +355,32 @@ function kn(e, t, n) {
352
355
  }, i = n.asLiteral(e.placeholder);
353
356
  i && (o.placeholder = i);
354
357
  const a = n.asLiteral(e.help);
355
- a && (o.help = a), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = xn(e.caseFilter));
356
- const s = Ye(e.minCount);
358
+ a && (o.help = a), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = Fn(e.caseFilter));
359
+ const s = tt(e.minCount);
357
360
  s !== void 0 && (o.caseMinCount = s);
358
- const c = Ye(e.maxCount);
361
+ const c = tt(e.maxCount);
359
362
  return c !== void 0 && (o.caseMaxCount = c), o;
360
363
  }
361
- const lt = we({ interactive: !0 });
362
- function Ee({
364
+ const dt = Le({ interactive: !0 });
365
+ function Be({
363
366
  interactive: e,
364
367
  children: t
365
368
  }) {
366
- return /* @__PURE__ */ l(lt.Provider, { value: { interactive: e }, children: t });
369
+ return /* @__PURE__ */ l(dt.Provider, { value: { interactive: e }, children: t });
367
370
  }
368
371
  function K() {
369
- return Le(lt);
372
+ return $e(dt);
370
373
  }
371
- function st(e) {
374
+ function ft(e) {
372
375
  return e && typeof e == "object" && "path" in e && String(e.path ?? "").trim() || null;
373
376
  }
374
- function Xe(e, t = "value") {
377
+ function nt(e, t = "value") {
375
378
  const r = e.componentModel.properties[t];
376
- if (!(!st(r) || r === void 0))
379
+ if (!(!ft(r) || r === void 0))
377
380
  return e.dataContext.resolveDynamicValue(r);
378
381
  }
379
382
  function G(e, t = "value") {
380
- const r = e.componentModel.properties[t], o = st(r), i = te(
383
+ const r = e.componentModel.properties[t], o = ft(r), i = te(
381
384
  (u) => {
382
385
  if (!o || r === void 0) return () => {
383
386
  };
@@ -388,7 +391,7 @@ function G(e, t = "value") {
388
391
  ), a = te(() => {
389
392
  if (!(!o || r === void 0))
390
393
  return e.dataContext.resolveDynamicValue(r);
391
- }, [e, r, o]), s = It(i, a, a), c = te(
394
+ }, [e, r, o]), s = Bt(i, a, a), c = te(
392
395
  (u) => {
393
396
  !o || !r || typeof r != "object" || !("path" in r) || e.dataContext.set(String(r.path), u);
394
397
  },
@@ -400,44 +403,44 @@ function oe(e) {
400
403
  if (typeof e == "string") return e || void 0;
401
404
  if (typeof e == "number") return String(e);
402
405
  }
403
- function $(e) {
406
+ function O(e) {
404
407
  return Array.isArray(e) ? e.map(String) : typeof e == "string" && e ? [e] : [];
405
408
  }
406
- function ct(e, t) {
407
- return t ? Array.isArray(e) ? null : $(e) : Array.isArray(e) ? e.length > 0 ? String(e[0]) : "" : e == null || typeof e == "string" || typeof e == "number" ? null : "";
409
+ function ht(e, t) {
410
+ return t ? Array.isArray(e) ? null : O(e) : Array.isArray(e) ? e.length > 0 ? String(e[0]) : "" : e == null || typeof e == "string" || typeof e == "number" ? null : "";
408
411
  }
409
- function fe(e) {
412
+ function ye(e) {
410
413
  if (e == null) return;
411
414
  const t = typeof e == "number" ? e : Number(e);
412
415
  if (!(!Number.isFinite(t) || t < 1))
413
416
  return Math.floor(t);
414
417
  }
415
- function ut(e, t, n, r) {
418
+ function gt(e, t, n, r) {
416
419
  if (e.includes(t)) {
417
420
  const i = e.filter((a) => a !== t);
418
421
  return n !== void 0 && i.length < n ? null : i;
419
422
  }
420
423
  return r !== void 0 && e.length >= r ? null : [...e, t];
421
424
  }
422
- function pt(e, t, n, r, o) {
425
+ function yt(e, t, n, r, o) {
423
426
  if (!n) return !0;
424
427
  const i = e.includes(t);
425
428
  return !!(!i && o !== void 0 && e.length >= o || i && r !== void 0 && e.length <= r);
426
429
  }
427
- function dt(e, t) {
430
+ function vt(e, t) {
428
431
  return t === void 0 || e.length <= t ? null : e.slice(0, t);
429
432
  }
430
- const mt = we(null);
431
- function Re({
433
+ const St = Le(null);
434
+ function we({
432
435
  caseSearch: e,
433
436
  children: t
434
437
  }) {
435
- return /* @__PURE__ */ l(mt.Provider, { value: e ?? null, children: t });
438
+ return /* @__PURE__ */ l(St.Provider, { value: e ?? null, children: t });
436
439
  }
437
- function An() {
438
- return Le(mt);
440
+ function Un() {
441
+ return $e(St);
439
442
  }
440
- function Te(e) {
443
+ function Ne(e) {
441
444
  return typeof e == "string" ? e : "";
442
445
  }
443
446
  function Me(e) {
@@ -446,15 +449,15 @@ function Me(e) {
446
449
  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, a = typeof t.flowType == "string" && t.flowType.trim() ? t.flowType.trim() : void 0, s = typeof t.category == "string" && t.category.trim() ? t.category.trim() : void 0, c = Array.isArray(t.flowUniqueIds) ? t.flowUniqueIds.map(String).filter(Boolean) : [];
447
450
  return { agentKind: o, agentUniqueId: i, flowType: a, category: s, flowUniqueIds: c, pageSize: r };
448
451
  }
449
- function Ne(e) {
452
+ function Fe(e) {
450
453
  var r;
451
454
  const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!(e.agentUniqueId && e.flowType && e.category);
452
455
  return t || n;
453
456
  }
454
- function Tn(e) {
457
+ function zn(e) {
455
458
  return JSON.stringify(e);
456
459
  }
457
- const Mn = {
460
+ const En = {
458
461
  name: "SkoponCaseSelect",
459
462
  schema: f.object({
460
463
  label: f.any().optional(),
@@ -467,13 +470,13 @@ const Mn = {
467
470
  value: f.any().optional()
468
471
  }).passthrough()
469
472
  };
470
- function Nn({
473
+ function Rn({
471
474
  item: e,
472
475
  selected: t,
473
476
  disabled: n,
474
477
  onToggle: r
475
478
  }) {
476
- return /* @__PURE__ */ C(
479
+ return /* @__PURE__ */ k(
477
480
  "button",
478
481
  {
479
482
  type: "button",
@@ -481,11 +484,11 @@ function Nn({
481
484
  disabled: n,
482
485
  onClick: r,
483
486
  children: [
484
- /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ l(et, { style: { fontSize: 24, color: "var(--color-primary, #208368)" } }) }),
485
- /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-body", children: [
487
+ /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ l(at, { style: { fontSize: 24, color: "var(--color-primary, #208368)" } }) }),
488
+ /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-body", children: [
486
489
  /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-name", children: e.name }),
487
490
  e.description ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-desc", children: e.description }) : null,
488
- /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-meta", children: [
491
+ /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-meta", children: [
489
492
  e.caseUniqueId,
490
493
  e.platform ? ` · ${e.platform}` : "",
491
494
  e.link ? ` · ${e.link}` : ""
@@ -495,104 +498,104 @@ function Nn({
495
498
  }
496
499
  );
497
500
  }
498
- function In({ context: e }) {
499
- const { interactive: t } = K(), n = An(), { value: r, setValue: o } = G(e), i = e.componentModel.properties, a = Te(i.label), s = Te(i.placeholder), c = Te(i.help), u = i.enableRefresh !== !1, d = fe(i.minCount), p = fe(i.maxCount), v = V(() => Me(i.caseFilter), [i.caseFilter]), g = Tn(v), [A, E] = P(1), [T, m] = P(!1), [h, x] = P(""), [y, S] = P([]), [N, _] = P(0), [j, Q] = P(v.pageSize ?? 20), w = L(0), O = $(r);
500
- B(() => {
501
- const b = dt(O, p);
502
- b !== null && o(b);
503
- }, [p, O, o]);
504
- const J = V(() => n ? Ne(v) ? h || s || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, v, h, s]), Y = te(
505
- async (b) => {
506
- const I = Me(JSON.parse(g)), R = ++w.current;
507
- if (!n || !Ne(I)) {
508
- S([]), _(0), x(""), m(!1);
501
+ function Bn({ context: e }) {
502
+ const { interactive: t } = K(), n = Un(), { value: r, setValue: o } = G(e), i = e.componentModel.properties, a = Ne(i.label), s = Ne(i.placeholder), c = Ne(i.help), u = i.enableRefresh !== !1, d = ye(i.minCount), m = ye(i.maxCount), b = q(() => Me(i.caseFilter), [i.caseFilter]), g = zn(b), [A, N] = _(1), [v, p] = _(!1), [h, x] = _(""), [y, C] = _([]), [M, E] = _(0), [$, Q] = _(b.pageSize ?? 20), j = L(0), w = O(r);
503
+ R(() => {
504
+ const S = vt(w, m);
505
+ S !== null && o(S);
506
+ }, [m, w, o]);
507
+ const J = q(() => n ? Fe(b) ? h || s || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, b, h, s]), Y = te(
508
+ async (S) => {
509
+ const F = Me(JSON.parse(g)), B = ++j.current;
510
+ if (!n || !Fe(F)) {
511
+ C([]), E(0), x(""), p(!1);
509
512
  return;
510
513
  }
511
- m(!0), x("");
514
+ p(!0), x("");
512
515
  try {
513
- const M = await n({ filter: I, page: b });
514
- if (R !== w.current) return;
515
- S(M.list), _(M.total), E(M.page), Q(M.pageSize);
516
- } catch (M) {
517
- if (R !== w.current) return;
518
- S([]), _(0), x(M instanceof Error ? M.message : "加载案例列表失败");
516
+ const I = await n({ filter: F, page: S });
517
+ if (B !== j.current) return;
518
+ C(I.list), E(I.total), N(I.page), Q(I.pageSize);
519
+ } catch (I) {
520
+ if (B !== j.current) return;
521
+ C([]), E(0), x(I instanceof Error ? I.message : "加载案例列表失败");
519
522
  } finally {
520
- R === w.current && m(!1);
523
+ B === j.current && p(!1);
521
524
  }
522
525
  },
523
526
  [n, g]
524
527
  );
525
- B(() => {
526
- E(1), Y(1);
528
+ R(() => {
529
+ N(1), Y(1);
527
530
  }, [g, Y]);
528
- const F = (b) => {
531
+ const P = (S) => {
529
532
  if (!t) return;
530
- const I = ut(
531
- O,
532
- b,
533
+ const F = gt(
534
+ w,
535
+ S,
533
536
  d,
534
- p
537
+ m
535
538
  );
536
- I !== null && o(I);
537
- }, z = () => {
538
- const b = Me(JSON.parse(g)), I = j || b.pageSize || 20, R = Math.max(1, Math.ceil(N / I)), M = A >= R ? 1 : A + 1;
539
- Y(M);
539
+ F !== null && o(F);
540
+ }, U = () => {
541
+ const S = Me(JSON.parse(g)), F = $ || S.pageSize || 20, B = Math.max(1, Math.ceil(M / F)), I = A >= B ? 1 : A + 1;
542
+ Y(I);
540
543
  };
541
- return /* @__PURE__ */ C("div", { className: "form-block-preview skopon-resume-select", children: [
544
+ return /* @__PURE__ */ k("div", { className: "form-block-preview skopon-resume-select", children: [
542
545
  a ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: a }) : null,
543
- T && y.length === 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-status", children: [
544
- /* @__PURE__ */ l(je, { size: "small" }),
546
+ v && y.length === 0 ? /* @__PURE__ */ k("div", { className: "skopon-resume-select-status", children: [
547
+ /* @__PURE__ */ l(De, { size: "small" }),
545
548
  " 加载案例…"
546
549
  ] }) : null,
547
- !T && y.length === 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-empty", children: J }) : null,
548
- y.length > 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-list", children: y.map((b) => /* @__PURE__ */ l(
549
- Nn,
550
+ !v && y.length === 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-empty", children: J }) : null,
551
+ y.length > 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-list", children: y.map((S) => /* @__PURE__ */ l(
552
+ Rn,
550
553
  {
551
- item: b,
552
- selected: O.includes(b.caseUniqueId),
553
- disabled: pt(
554
- O,
555
- b.caseUniqueId,
554
+ item: S,
555
+ selected: w.includes(S.caseUniqueId),
556
+ disabled: yt(
557
+ w,
558
+ S.caseUniqueId,
556
559
  t,
557
560
  d,
558
- p
561
+ m
559
562
  ),
560
- onToggle: () => F(b.caseUniqueId)
563
+ onToggle: () => P(S.caseUniqueId)
561
564
  },
562
- b.caseUniqueId
565
+ S.caseUniqueId
563
566
  )) }) : null,
564
- u && n && Ne(v) ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ l(
565
- ge,
567
+ u && n && Fe(b) ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ l(
568
+ Se,
566
569
  {
567
570
  type: "default",
568
571
  size: "small",
569
- icon: /* @__PURE__ */ l(Ze, {}),
570
- loading: T,
572
+ icon: /* @__PURE__ */ l(it, {}),
573
+ loading: v,
571
574
  disabled: !t,
572
- onClick: z,
575
+ onClick: U,
573
576
  children: "换一批"
574
577
  }
575
578
  ) }) : null,
576
- c ? /* @__PURE__ */ l(H.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
579
+ c ? /* @__PURE__ */ l(D.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
577
580
  ] });
578
581
  }
579
- const Fn = q(
580
- Mn,
581
- In
582
- ), Pn = {
582
+ const wn = V(
583
+ En,
584
+ Bn
585
+ ), qn = {
583
586
  type: "case_multiselect",
584
587
  componentName: "SkoponCaseSelect",
585
- toComponent: Cn,
586
- fromComponent: kn,
587
- catalogComponents: [Fn]
588
+ toComponent: _n,
589
+ fromComponent: Pn,
590
+ catalogComponents: [wn]
588
591
  };
589
- function We(e) {
592
+ function rt(e) {
590
593
  if (e == null) return;
591
594
  const t = typeof e == "number" ? e : Number(e);
592
595
  if (!(!Number.isFinite(t) || t < 1))
593
596
  return Math.floor(t);
594
597
  }
595
- function zn(e, t) {
598
+ function On(e, t) {
596
599
  var a, s, c, u;
597
600
  const { id: n, label: r, path: o, withData: i } = t;
598
601
  return i({
@@ -613,7 +616,7 @@ function zn(e, t) {
613
616
  value: { path: o }
614
617
  });
615
618
  }
616
- function Un(e, t, n) {
619
+ function Vn(e, t, n) {
617
620
  const r = n.nameFromValue(e.value), o = {
618
621
  ...t("resume_multiselect"),
619
622
  name: r,
@@ -630,34 +633,34 @@ function Un(e, t, n) {
630
633
  pageSize: typeof u.pageSize == "number" ? u.pageSize : 20
631
634
  };
632
635
  }
633
- const s = We(e.minCount);
636
+ const s = rt(e.minCount);
634
637
  s !== void 0 && (o.resumeMinCount = s);
635
- const c = We(e.maxCount);
638
+ const c = rt(e.maxCount);
636
639
  return c !== void 0 && (o.resumeMaxCount = c), o;
637
640
  }
638
- const ft = we(null);
639
- function Be({
641
+ const bt = Le(null);
642
+ function qe({
640
643
  resumeSearch: e,
641
644
  children: t
642
645
  }) {
643
- return /* @__PURE__ */ l(ft.Provider, { value: e ?? null, children: t });
646
+ return /* @__PURE__ */ l(bt.Provider, { value: e ?? null, children: t });
644
647
  }
645
- function _n() {
646
- return Le(ft);
648
+ function jn() {
649
+ return $e(bt);
647
650
  }
648
- function Ie(e) {
651
+ function _e(e) {
649
652
  return typeof e == "string" ? e : "";
650
653
  }
651
- function Fe(e) {
654
+ function Pe(e) {
652
655
  if (!e || typeof e != "object")
653
656
  return { names: [], agentUniqueIds: [], resumeUniqueIds: [], pageSize: 20 };
654
657
  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), a = Number.isFinite(i) && i >= 1 && i <= 100 ? Math.floor(i) : 20;
655
658
  return { names: n, agentUniqueIds: r, resumeUniqueIds: o, pageSize: a };
656
659
  }
657
- function En(e) {
660
+ function Ln(e) {
658
661
  return JSON.stringify(e);
659
662
  }
660
- const Rn = {
663
+ const $n = {
661
664
  name: "SkoponResumeSelect",
662
665
  schema: f.object({
663
666
  label: f.any().optional(),
@@ -669,40 +672,40 @@ const Rn = {
669
672
  maxCount: f.any().optional(),
670
673
  value: f.any().optional()
671
674
  }).passthrough()
672
- }, Bn = 3, On = 2;
673
- function Pe(e, t) {
674
- const n = (t ?? []).filter(Boolean), r = n.slice(0, Bn), o = n.length - r.length;
675
- return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-tags", children: [
675
+ }, Dn = 3, Hn = 2;
676
+ function Ue(e, t) {
677
+ const n = (t ?? []).filter(Boolean), r = n.slice(0, Dn), o = n.length - r.length;
678
+ return /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-tags", children: [
676
679
  /* @__PURE__ */ l("span", { className: "skopon-resume-select-card-tags-label", children: e }),
677
- n.length > 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-tags-list", children: [
680
+ n.length > 0 ? /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-tags-list", children: [
678
681
  r.map((i) => /* @__PURE__ */ l(re, { className: "skopon-resume-select-card-tag", children: i }, i)),
679
- o > 0 ? /* @__PURE__ */ C(re, { className: "skopon-resume-select-card-tag", children: [
682
+ o > 0 ? /* @__PURE__ */ k(re, { className: "skopon-resume-select-card-tag", children: [
680
683
  "+",
681
684
  o
682
685
  ] }) : null
683
686
  ] }) : /* @__PURE__ */ l("span", { className: "skopon-resume-select-card-tags-empty", children: "暂无" })
684
687
  ] });
685
688
  }
686
- function Vn(e) {
687
- return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-field", children: [
689
+ function Kn(e) {
690
+ return /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-field", children: [
688
691
  /* @__PURE__ */ l("span", { className: "skopon-resume-select-card-tags-label", children: "满意度" }),
689
692
  /* @__PURE__ */ l("span", { className: "skopon-resume-select-card-field-value", children: typeof e == "number" ? `${e}%` : "暂无" })
690
693
  ] });
691
694
  }
692
- function qn({ work: e }) {
693
- return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-work", children: [
694
- /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ l("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ l(wt, { className: "skopon-resume-select-card-work-placeholder" }) }),
695
+ function Gn({ work: e }) {
696
+ return /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-work", children: [
697
+ /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ l("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ l(Jt, { className: "skopon-resume-select-card-work-placeholder" }) }),
695
698
  /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-work-title", children: e.title || "未命名作品" })
696
699
  ] });
697
700
  }
698
- function wn({
701
+ function Jn({
699
702
  item: e,
700
703
  selected: t,
701
704
  disabled: n,
702
705
  onToggle: r
703
706
  }) {
704
- const o = (e.works ?? []).slice(0, On);
705
- return /* @__PURE__ */ C(
707
+ const o = (e.works ?? []).slice(0, Hn);
708
+ return /* @__PURE__ */ k(
706
709
  "button",
707
710
  {
708
711
  type: "button",
@@ -711,168 +714,168 @@ function wn({
711
714
  onClick: r,
712
715
  children: [
713
716
  /* @__PURE__ */ l(
714
- zt,
717
+ Ot,
715
718
  {
716
719
  size: 48,
717
720
  src: e.avatarUrl || void 0,
718
- icon: e.avatarUrl ? void 0 : /* @__PURE__ */ l(qt, {}),
721
+ icon: e.avatarUrl ? void 0 : /* @__PURE__ */ l(Gt, {}),
719
722
  className: "skopon-resume-select-card-avatar"
720
723
  }
721
724
  ),
722
725
  /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-name", children: e.name || "未命名简历" }),
723
- /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-body", children: [
724
- Vn(e.satisfaction),
725
- Pe("性格", e.personality),
726
- Pe("专长", e.specialties),
727
- Pe("擅长领域", e.traits),
728
- /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-works", children: [
726
+ /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-body", children: [
727
+ Kn(e.satisfaction),
728
+ Ue("性格", e.personality),
729
+ Ue("专长", e.specialties),
730
+ Ue("擅长领域", e.traits),
731
+ /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-works", children: [
729
732
  /* @__PURE__ */ l("span", { className: "skopon-resume-select-card-works-label", children: "过往作品" }),
730
- o.length > 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, a) => /* @__PURE__ */ l(qn, { work: i }, `${i.title}-${a}`)) }) : /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
733
+ o.length > 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, a) => /* @__PURE__ */ l(Gn, { work: i }, `${i.title}-${a}`)) }) : /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
731
734
  ] })
732
735
  ] })
733
736
  ]
734
737
  }
735
738
  );
736
739
  }
737
- function Ln({ context: e }) {
738
- const { interactive: t } = K(), n = _n(), { value: r, setValue: o } = G(e), i = e.componentModel.properties, a = Ie(i.label), s = Ie(i.placeholder), c = Ie(i.help), u = i.enableRefresh !== !1, d = fe(i.minCount), p = fe(i.maxCount), v = V(() => Fe(i.resumeFilter), [i.resumeFilter]), g = En(v), [A, E] = P(1), [T, m] = P(!1), [h, x] = P(""), [y, S] = P([]), [N, _] = P(0), [j, Q] = P(v.pageSize ?? 20), w = L(0), O = $(r);
739
- B(() => {
740
- const b = dt(O, p);
741
- b !== null && o(b);
742
- }, [p, O, o]);
740
+ function Yn({ context: e }) {
741
+ const { interactive: t } = K(), n = jn(), { value: r, setValue: o } = G(e), i = e.componentModel.properties, a = _e(i.label), s = _e(i.placeholder), c = _e(i.help), u = i.enableRefresh !== !1, d = ye(i.minCount), m = ye(i.maxCount), b = q(() => Pe(i.resumeFilter), [i.resumeFilter]), g = Ln(b), [A, N] = _(1), [v, p] = _(!1), [h, x] = _(""), [y, C] = _([]), [M, E] = _(0), [$, Q] = _(b.pageSize ?? 20), j = L(0), w = O(r);
742
+ R(() => {
743
+ const S = vt(w, m);
744
+ S !== null && o(S);
745
+ }, [m, w, o]);
743
746
  const J = te(
744
- async (b) => {
745
- const I = Fe(JSON.parse(g)), R = ++w.current;
747
+ async (S) => {
748
+ const F = Pe(JSON.parse(g)), B = ++j.current;
746
749
  if (!n) {
747
- S([]), _(0), x("未配置简历搜索服务"), m(!1);
750
+ C([]), E(0), x("未配置简历搜索服务"), p(!1);
748
751
  return;
749
752
  }
750
- m(!0), x("");
753
+ p(!0), x("");
751
754
  try {
752
- const M = await n({ filter: I, page: b });
753
- if (R !== w.current) return;
754
- S(M.list), _(M.total), E(M.page), Q(M.pageSize);
755
- } catch (M) {
756
- if (R !== w.current) return;
757
- S([]), _(0), x(M instanceof Error ? M.message : "加载简历列表失败");
755
+ const I = await n({ filter: F, page: S });
756
+ if (B !== j.current) return;
757
+ C(I.list), E(I.total), N(I.page), Q(I.pageSize);
758
+ } catch (I) {
759
+ if (B !== j.current) return;
760
+ C([]), E(0), x(I instanceof Error ? I.message : "加载简历列表失败");
758
761
  } finally {
759
- R === w.current && m(!1);
762
+ B === j.current && p(!1);
760
763
  }
761
764
  },
762
765
  [n, g]
763
766
  );
764
- B(() => {
765
- E(1), J(1);
767
+ R(() => {
768
+ N(1), J(1);
766
769
  }, [g, J]);
767
- const Y = (b) => {
770
+ const Y = (S) => {
768
771
  if (!t) return;
769
- const I = ut(
770
- O,
771
- b,
772
+ const F = gt(
773
+ w,
774
+ S,
772
775
  d,
773
- p
776
+ m
774
777
  );
775
- I !== null && o(I);
776
- }, F = () => {
777
- const b = Fe(JSON.parse(g)), I = j || b.pageSize || 20, R = Math.max(1, Math.ceil(N / I)), M = A >= R ? 1 : A + 1;
778
- J(M);
779
- }, z = s || "暂无匹配的简历";
780
- return /* @__PURE__ */ C("div", { className: "form-block-preview skopon-resume-select", children: [
778
+ F !== null && o(F);
779
+ }, P = () => {
780
+ const S = Pe(JSON.parse(g)), F = $ || S.pageSize || 20, B = Math.max(1, Math.ceil(M / F)), I = A >= B ? 1 : A + 1;
781
+ J(I);
782
+ }, U = s || "暂无匹配的简历";
783
+ return /* @__PURE__ */ k("div", { className: "form-block-preview skopon-resume-select", children: [
781
784
  a ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: a }) : null,
782
- T && y.length === 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-status", children: [
783
- /* @__PURE__ */ l(je, { size: "small" }),
785
+ v && y.length === 0 ? /* @__PURE__ */ k("div", { className: "skopon-resume-select-status", children: [
786
+ /* @__PURE__ */ l(De, { size: "small" }),
784
787
  " 加载简历…"
785
788
  ] }) : null,
786
- !T && h ? /* @__PURE__ */ l(H.Text, { type: "danger", className: "skopon-resume-select-status", children: h }) : null,
787
- !T && !h && y.length === 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-empty", children: z }) : null,
788
- y.length > 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-list", children: y.map((b) => /* @__PURE__ */ l(
789
- wn,
789
+ !v && h ? /* @__PURE__ */ l(D.Text, { type: "danger", className: "skopon-resume-select-status", children: h }) : null,
790
+ !v && !h && y.length === 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-empty", children: U }) : null,
791
+ y.length > 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-list", children: y.map((S) => /* @__PURE__ */ l(
792
+ Jn,
790
793
  {
791
- item: b,
792
- selected: O.includes(b.resumeUniqueId),
793
- disabled: pt(
794
- O,
795
- b.resumeUniqueId,
794
+ item: S,
795
+ selected: w.includes(S.resumeUniqueId),
796
+ disabled: yt(
797
+ w,
798
+ S.resumeUniqueId,
796
799
  t,
797
800
  d,
798
- p
801
+ m
799
802
  ),
800
- onToggle: () => Y(b.resumeUniqueId)
803
+ onToggle: () => Y(S.resumeUniqueId)
801
804
  },
802
- b.resumeUniqueId
805
+ S.resumeUniqueId
803
806
  )) }) : null,
804
807
  u && n ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ l(
805
- ge,
808
+ Se,
806
809
  {
807
810
  type: "default",
808
811
  size: "small",
809
- icon: /* @__PURE__ */ l(Ze, {}),
810
- loading: T,
812
+ icon: /* @__PURE__ */ l(it, {}),
813
+ loading: v,
811
814
  disabled: !t,
812
- onClick: F,
815
+ onClick: P,
813
816
  children: "换一批"
814
817
  }
815
818
  ) }) : null,
816
- c ? /* @__PURE__ */ l(H.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
819
+ c ? /* @__PURE__ */ l(D.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
817
820
  ] });
818
821
  }
819
- const jn = q(
820
- Rn,
821
- Ln
822
- ), $n = {
822
+ const Xn = V(
823
+ $n,
824
+ Yn
825
+ ), Wn = {
823
826
  type: "resume_multiselect",
824
827
  componentName: "SkoponResumeSelect",
825
- toComponent: zn,
826
- fromComponent: Un,
827
- catalogComponents: [jn]
828
- }, ve = [$n, Pn], Dn = new Map(
829
- ve.map((e) => [e.type, e])
830
- ), Hn = new Map(
831
- ve.map((e) => [e.componentName, e])
828
+ toComponent: On,
829
+ fromComponent: Vn,
830
+ catalogComponents: [Xn]
831
+ }, Ce = [Wn, qn], Qn = new Map(
832
+ Ce.map((e) => [e.type, e])
833
+ ), Zn = new Map(
834
+ Ce.map((e) => [e.componentName, e])
832
835
  );
833
- function Kn(e) {
834
- return Dn.get(e);
836
+ function er(e) {
837
+ return Qn.get(e);
835
838
  }
836
- function Gn(e) {
837
- return Hn.get(e);
839
+ function tr(e) {
840
+ return Zn.get(e);
838
841
  }
839
- function Jn() {
840
- return ve.flatMap((e) => e.catalogComponents);
842
+ function nr() {
843
+ return Ce.flatMap((e) => e.catalogComponents);
841
844
  }
842
- function Yn() {
843
- return ve.map((e) => e.componentName);
845
+ function rr() {
846
+ return Ce.map((e) => e.componentName);
844
847
  }
845
- const he = "root", Oe = "__title__", Ve = "__desc__", ht = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
846
- function Xn(e) {
848
+ const ve = "root", Oe = "__title__", Ve = "__desc__", Je = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
849
+ function or(e) {
847
850
  return `/${e}`;
848
851
  }
849
- function Qe(e) {
852
+ function ot(e) {
850
853
  return e && typeof e == "object" && "path" in e ? String(e.path ?? "").replace(/^\//, "") : "";
851
854
  }
852
- function U(e) {
855
+ function z(e) {
853
856
  if (typeof e == "string") return e;
854
857
  }
855
- function Wn(e) {
858
+ function ir(e) {
856
859
  const t = e.id || ie("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
857
860
  return {
858
861
  id: t,
859
862
  component: "SkoponMedia",
860
863
  mediaType: n,
861
- urls: dn(e),
862
- mediaSize: le(e.mediaSize),
864
+ urls: bn(e),
865
+ mediaSize: se(e.mediaSize),
863
866
  label: e.label ?? "",
864
867
  help: e.help ?? "",
865
868
  placeholder: e.placeholder ?? ""
866
869
  };
867
870
  }
868
- function Qn(e) {
871
+ function ar(e) {
869
872
  if (Array.isArray(e.urls))
870
873
  return e.urls.map((n) => String(n).trim()).filter(Boolean);
871
- const t = U(e.url);
874
+ const t = z(e.url);
872
875
  return t != null && t.trim() ? [t.trim()] : [];
873
876
  }
874
- function ue(e, t, n) {
875
- const r = typeof e.id == "string" ? e.id : ie("block-"), o = Qn(e), i = U(e.label) ?? U(e.description) ?? n, a = U(e.help), s = U(e.placeholder), c = le(e.mediaSize);
877
+ function me(e, t, n) {
878
+ const r = typeof e.id == "string" ? e.id : ie("block-"), o = ar(e), i = z(e.label) ?? z(e.description) ?? n, a = z(e.help), s = z(e.placeholder), c = se(e.mediaSize);
876
879
  return {
877
880
  id: r,
878
881
  type: t,
@@ -883,10 +886,10 @@ function ue(e, t, n) {
883
886
  mediaUrls: o.length > 0 ? o : [""]
884
887
  };
885
888
  }
886
- function Zn(e) {
889
+ function sr(e) {
887
890
  switch (e.type) {
888
891
  case "toggle":
889
- return ye(e.defaultValue);
892
+ return le(e.defaultValue);
890
893
  case "multiselect":
891
894
  case "checkbox":
892
895
  case "resume_multiselect":
@@ -900,9 +903,9 @@ function Zn(e) {
900
903
  return typeof e.defaultValue == "string" ? e.defaultValue : "";
901
904
  }
902
905
  }
903
- function er(e) {
906
+ function lr(e) {
904
907
  var u;
905
- const t = e.id || ie("a2-"), n = e.label ?? "", r = ((u = e.name) == null ? void 0 : u.trim()) || "", o = r ? Xn(r) : void 0, i = (e.options ?? []).map((d) => ({ label: d.label, value: d.value })), a = (d) => r ? { node: d, dataKey: r, dataValue: Zn(e) } : { node: d }, s = { id: t, label: n, name: r, path: o, withData: a }, c = Kn(e.type);
908
+ const t = e.id || ie("a2-"), n = e.label ?? "", r = ((u = e.name) == null ? void 0 : u.trim()) || "", o = r ? or(r) : void 0, i = (e.options ?? []).map((d) => ({ label: d.label, value: d.value })), a = (d) => r ? { node: d, dataKey: r, dataValue: sr(e) } : { node: d }, s = { id: t, label: n, name: r, path: o, withData: a }, c = er(e.type);
906
909
  if (c)
907
910
  return c.toComponent(e, s);
908
911
  switch (e.type) {
@@ -927,7 +930,7 @@ function er(e) {
927
930
  component: "TextField",
928
931
  label: n,
929
932
  variant: "shortText",
930
- validationRegexp: ht,
933
+ validationRegexp: Je,
931
934
  ...e.placeholder ? { placeholder: e.placeholder } : {},
932
935
  value: { path: o }
933
936
  });
@@ -1013,7 +1016,7 @@ function er(e) {
1013
1016
  case "image":
1014
1017
  case "video":
1015
1018
  case "audio":
1016
- return { node: Wn(e) };
1019
+ return { node: ir(e) };
1017
1020
  case "file":
1018
1021
  return a({
1019
1022
  id: t,
@@ -1030,25 +1033,25 @@ function er(e) {
1030
1033
  return { node: null };
1031
1034
  }
1032
1035
  }
1033
- function qe(e) {
1036
+ function je(e) {
1034
1037
  if (!e || !Array.isArray(e.components) || e.components.length === 0) return !0;
1035
- const t = e.components.find((r) => r.id === he);
1038
+ const t = e.components.find((r) => r.id === ve);
1036
1039
  if (!t) return e.components.length === 0;
1037
1040
  const n = t.children;
1038
1041
  return !Array.isArray(n) || n.length === 0;
1039
1042
  }
1040
- function gt(e, t) {
1043
+ function Ct(e, t) {
1041
1044
  const n = [], r = [], o = {}, i = (t == null ? void 0 : t.includeHeader) !== !1, a = (e.title ?? "").trim(), s = (e.description ?? "").trim();
1042
1045
  i && a && (n.push({ id: Oe, component: "Text", text: a, variant: "h2" }), r.push(Oe)), i && s && (n.push({ id: Ve, component: "Text", text: s, variant: "body" }), r.push(Ve));
1043
1046
  for (const d of e.blocks ?? []) {
1044
- const { node: p, dataKey: v, dataValue: g } = er(d);
1045
- p && (n.push(p), r.push(p.id), v && (o[v] = g));
1047
+ const { node: m, dataKey: b, dataValue: g } = lr(d);
1048
+ m && (n.push(m), r.push(m.id), b && (o[b] = g));
1046
1049
  }
1047
- n.unshift({ id: he, component: "Column", children: r });
1048
- const c = { root: he, components: n, dataModel: o }, u = t == null ? void 0 : t.styleId;
1050
+ n.unshift({ id: ve, component: "Column", children: r });
1051
+ const c = { root: ve, components: n, dataModel: o }, u = t == null ? void 0 : t.styleId;
1049
1052
  return u !== void 0 && (c.surfaceProperties = { styleId: u ?? null }), c;
1050
1053
  }
1051
- function tr(e) {
1054
+ function cr(e) {
1052
1055
  const t = /* @__PURE__ */ new Map();
1053
1056
  for (const n of e.components ?? [])
1054
1057
  n && typeof n.id == "string" && t.set(n.id, n);
@@ -1065,10 +1068,10 @@ function ze(e) {
1065
1068
  };
1066
1069
  }).filter((n) => !!n) : [];
1067
1070
  }
1068
- function nr(e) {
1069
- const t = typeof e.id == "string" ? e.id : ie("block-"), n = String(e.component ?? ""), r = U(e.label) ?? U(e.text) ?? "", o = Qe(e.value), i = (s) => ({ id: t, type: s, label: r }), a = Gn(n);
1071
+ function ur(e) {
1072
+ const t = typeof e.id == "string" ? e.id : ie("block-"), n = String(e.component ?? ""), r = z(e.label) ?? z(e.text) ?? "", o = ot(e.value), i = (s) => ({ id: t, type: s, label: r }), a = tr(n);
1070
1073
  if (a)
1071
- return a.fromComponent(e, i, { asLiteral: U, nameFromValue: Qe });
1074
+ return a.fromComponent(e, i, { asLiteral: z, nameFromValue: ot });
1072
1075
  switch (n) {
1073
1076
  case "Text": {
1074
1077
  const s = String(e.variant ?? "body"), c = /^h[1-6]$/i.test(s) || s === "title" || s === "subtitle";
@@ -1077,8 +1080,8 @@ function nr(e) {
1077
1080
  case "TextField": {
1078
1081
  const s = String(e.variant ?? "shortText");
1079
1082
  let c = "text";
1080
- s === "longText" ? c = "textarea" : s === "number" ? c = "number" : U(e.validationRegexp) === ht && (c = "email");
1081
- const u = { ...i(c), name: o }, d = U(e.placeholder);
1083
+ s === "longText" ? c = "textarea" : s === "number" ? c = "number" : z(e.validationRegexp) === Je && (c = "email");
1084
+ const u = { ...i(c), name: o }, d = z(e.placeholder);
1082
1085
  return d && (u.placeholder = d), u;
1083
1086
  }
1084
1087
  case "CheckBox":
@@ -1088,45 +1091,45 @@ function nr(e) {
1088
1091
  ...i(c),
1089
1092
  name: o,
1090
1093
  options: ze(e)
1091
- }, d = U(e.placeholder);
1094
+ }, d = z(e.placeholder);
1092
1095
  return d && (u.placeholder = d), u;
1093
1096
  }
1094
1097
  case "ChoicePicker": {
1095
- const s = U(e.skoponPickerType);
1098
+ const s = z(e.skoponPickerType);
1096
1099
  if (s === "select" || s === "multiselect" || s === "radio" || s === "checkbox") {
1097
1100
  const d = {
1098
1101
  ...i(s),
1099
1102
  name: o,
1100
1103
  options: ze(e)
1101
- }, p = U(e.placeholder);
1102
- return p && (d.placeholder = p), d;
1104
+ }, m = z(e.placeholder);
1105
+ return m && (d.placeholder = m), d;
1103
1106
  }
1104
1107
  const u = String(e.variant ?? "mutuallyExclusive") === "multipleSelection" ? "checkbox" : "radio";
1105
1108
  return { ...i(u), name: o, options: ze(e) };
1106
1109
  }
1107
1110
  case "DateTimeInput": {
1108
- const s = e.enableDate === !0, c = e.enableTime === !0, d = { ...i(!s && c ? "time" : "datetime"), name: o }, p = U(e.placeholder);
1109
- return p && (d.placeholder = p), d;
1111
+ const s = e.enableDate === !0, c = e.enableTime === !0, d = { ...i(!s && c ? "time" : "datetime"), name: o }, m = z(e.placeholder);
1112
+ return m && (d.placeholder = m), d;
1110
1113
  }
1111
1114
  case "SkoponMedia": {
1112
1115
  const s = String(e.mediaType ?? "image");
1113
- return ue(e, s === "video" ? "video" : s === "audio" ? "audio" : "image", r);
1116
+ return me(e, s === "video" ? "video" : s === "audio" ? "audio" : "image", r);
1114
1117
  }
1115
1118
  case "Image":
1116
- return ue(e, "image", r);
1119
+ return me(e, "image", r);
1117
1120
  case "Video":
1118
- return ue(e, "video", r);
1121
+ return me(e, "video", r);
1119
1122
  case "AudioPlayer":
1120
- return ue(e, "audio", r);
1123
+ return me(e, "audio", r);
1121
1124
  case "FileUpload": {
1122
- const s = U(e.accept) ?? "", c = { ...i("file"), name: o };
1125
+ const s = z(e.accept) ?? "", c = { ...i("file"), name: o };
1123
1126
  return s && (c.fileAcceptExtensions = s.split(",").map((u) => u.trim()).filter(Boolean)), Array.isArray(e.fileAcceptTypes) && (c.fileAcceptTypes = e.fileAcceptTypes.map(String)), typeof e.filePlaceholderIcon == "string" && (c.filePlaceholderIcon = e.filePlaceholderIcon), typeof e.minCount == "number" && (c.fileMinCount = e.minCount), typeof e.maxCount == "number" && (c.fileMaxCount = e.maxCount), c;
1124
1127
  }
1125
1128
  default:
1126
1129
  return null;
1127
1130
  }
1128
1131
  }
1129
- function yt(e, t, n, r) {
1132
+ function xt(e, t, n, r) {
1130
1133
  if (n.has(e)) return;
1131
1134
  n.add(e);
1132
1135
  const o = t.get(e);
@@ -1134,47 +1137,47 @@ function yt(e, t, n, r) {
1134
1137
  const i = String(o.component ?? "");
1135
1138
  if ((i === "Column" || i === "Row") && Array.isArray(o.children)) {
1136
1139
  for (const a of o.children)
1137
- typeof a == "string" && yt(a, t, n, r);
1140
+ typeof a == "string" && xt(a, t, n, r);
1138
1141
  return;
1139
1142
  }
1140
1143
  r.push(o);
1141
1144
  }
1142
- function rr(e, t) {
1145
+ function pr(e, t) {
1143
1146
  return t ? e.map((n) => {
1144
1147
  var i;
1145
1148
  const r = (i = n.name) == null ? void 0 : i.trim();
1146
1149
  if (!r || !(r in t)) return n;
1147
1150
  const o = t[r];
1148
- return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue: ye(o) } : { ...n, defaultValue: o };
1151
+ return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue: le(o) } : { ...n, defaultValue: o };
1149
1152
  }) : e;
1150
1153
  }
1151
- function or(e) {
1154
+ function mr(e) {
1152
1155
  if (!e || !Array.isArray(e.components))
1153
- return me({ title: "", description: "", blocks: [], jsonSchema: {} });
1154
- const t = tr(e), n = [];
1155
- yt(e.root ?? he, t, /* @__PURE__ */ new Set(), n);
1156
+ return ge({ title: "", description: "", blocks: [], jsonSchema: {} });
1157
+ const t = cr(e), n = [];
1158
+ xt(e.root ?? ve, t, /* @__PURE__ */ new Set(), n);
1156
1159
  let r = "", o = "";
1157
1160
  const i = [];
1158
1161
  for (const a of n) {
1159
1162
  if (a.id === Oe) {
1160
- r = U(a.text) ?? r;
1163
+ r = z(a.text) ?? r;
1161
1164
  continue;
1162
1165
  }
1163
1166
  if (a.id === Ve) {
1164
- o = U(a.text) ?? o;
1167
+ o = z(a.text) ?? o;
1165
1168
  continue;
1166
1169
  }
1167
- const s = nr(a);
1170
+ const s = ur(a);
1168
1171
  s && i.push(s);
1169
1172
  }
1170
- return me({
1173
+ return ge({
1171
1174
  title: r,
1172
1175
  description: o,
1173
- blocks: rr(i, e.dataModel),
1176
+ blocks: pr(i, e.dataModel),
1174
1177
  jsonSchema: {}
1175
1178
  });
1176
1179
  }
1177
- function ir(e, t) {
1180
+ function dr(e, t) {
1178
1181
  const { surfaceId: n, catalogId: r } = t, o = [
1179
1182
  { version: "v0.9", createSurface: { surfaceId: n, catalogId: r } },
1180
1183
  {
@@ -1187,24 +1190,25 @@ function ir(e, t) {
1187
1190
  updateDataModel: { surfaceId: n, path: "/", value: e.dataModel }
1188
1191
  }), o;
1189
1192
  }
1190
- function vt(e) {
1193
+ function kt(e) {
1191
1194
  return !!e && typeof e == "object" && !Array.isArray(e) && Array.isArray(e.components);
1192
1195
  }
1193
- function ar(e, t) {
1196
+ function fr(e, t) {
1194
1197
  if (!e || typeof e != "object") return null;
1195
- const n = e, r = vt(n.a2ui) ? n.a2ui : void 0;
1196
- if (r && !qe(r)) return r;
1198
+ const n = e, r = kt(n.a2ui) ? n.a2ui : void 0;
1199
+ if (r && !je(r)) return r;
1197
1200
  const o = Array.isArray(n.blocks) ? n.blocks : [];
1198
1201
  if (o.length === 0) return null;
1199
- const i = Z({
1202
+ const i = ee({
1200
1203
  title: typeof n.title == "string" ? n.title : "",
1201
1204
  description: typeof n.description == "string" ? n.description : "",
1202
- blocks: o
1203
- }), a = gt(i, t);
1204
- return qe(a) ? null : a;
1205
+ blocks: o,
1206
+ jsonSchema: Ge(n.jsonSchema ?? n.json_schema)
1207
+ }), a = Ct(i, t);
1208
+ return je(a) ? null : a;
1205
1209
  }
1206
- function lr(e, t, n) {
1207
- return gt(
1210
+ function hr(e, t, n) {
1211
+ return Ct(
1208
1212
  {
1209
1213
  title: e.title,
1210
1214
  description: e.description,
@@ -1213,17 +1217,18 @@ function lr(e, t, n) {
1213
1217
  n
1214
1218
  );
1215
1219
  }
1216
- function sr(e) {
1220
+ function gr(e) {
1217
1221
  if (!e || typeof e != "object" || Array.isArray(e))
1218
1222
  return;
1219
1223
  const t = e;
1220
- return !(Array.isArray(t.blocks) && t.blocks.length > 0) && vt(t.a2ui) ? or(t.a2ui) : Z({
1224
+ return !(Array.isArray(t.blocks) && t.blocks.length > 0) && kt(t.a2ui) ? mr(t.a2ui) : ee({
1221
1225
  title: typeof t.title == "string" ? t.title : "",
1222
1226
  description: typeof t.description == "string" ? t.description : "",
1223
- blocks: Array.isArray(t.blocks) ? t.blocks : []
1227
+ blocks: Array.isArray(t.blocks) ? t.blocks : [],
1228
+ jsonSchema: Ge(t.jsonSchema ?? t.json_schema)
1224
1229
  });
1225
1230
  }
1226
- function cr(e, t, n) {
1231
+ function yr(e, t, n) {
1227
1232
  const r = e.model.surfacesMap.get(t);
1228
1233
  if (!r) return {};
1229
1234
  const o = {};
@@ -1233,14 +1238,15 @@ function cr(e, t, n) {
1233
1238
  }
1234
1239
  return o;
1235
1240
  }
1236
- function ur(e) {
1237
- return Z({
1241
+ function vr(e) {
1242
+ return ee({
1238
1243
  title: "",
1239
1244
  description: "",
1240
- blocks: [e]
1245
+ blocks: [e],
1246
+ jsonSchema: {}
1241
1247
  }).blocks[0];
1242
1248
  }
1243
- function pr(e, t) {
1249
+ function Sr(e, t) {
1244
1250
  var o, i;
1245
1251
  const n = /* @__PURE__ */ new Map();
1246
1252
  for (const a of t) {
@@ -1249,8 +1255,8 @@ function pr(e, t) {
1249
1255
  }
1250
1256
  const r = [];
1251
1257
  for (const a of e.blocks) {
1252
- if ($e(a.type)) {
1253
- r.push(ur(a));
1258
+ if (be(a.type)) {
1259
+ r.push(vr(a));
1254
1260
  continue;
1255
1261
  }
1256
1262
  if (!W(a.type)) continue;
@@ -1261,69 +1267,72 @@ function pr(e, t) {
1261
1267
  }
1262
1268
  return r;
1263
1269
  }
1264
- function dr(e, t) {
1270
+ function br(e, t) {
1265
1271
  var r;
1266
1272
  const n = {
1267
1273
  ...e,
1268
1274
  name: ((r = e.name) == null ? void 0 : r.trim()) || t.name
1269
1275
  };
1270
- return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue), Z({
1276
+ return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue), ee({
1271
1277
  title: "",
1272
1278
  description: "",
1273
- blocks: [n]
1279
+ blocks: [n],
1280
+ jsonSchema: {}
1274
1281
  }).blocks[0];
1275
1282
  }
1276
- function bt(e) {
1283
+ function At(e) {
1277
1284
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
1278
1285
  const t = e;
1279
- return Array.isArray(t.blocks) ? Z({
1286
+ return Array.isArray(t.blocks) ? ee({
1280
1287
  title: typeof t.title == "string" ? t.title : "",
1281
1288
  description: typeof t.description == "string" ? t.description : "",
1282
- blocks: t.blocks
1289
+ blocks: t.blocks,
1290
+ jsonSchema: {}
1283
1291
  }) : null;
1284
1292
  }
1285
- function mr(e, t) {
1293
+ function Cr(e, t) {
1286
1294
  var i, a, s, c, u, d;
1287
1295
  const n = /* @__PURE__ */ new Map();
1288
- for (const p of (t == null ? void 0 : t.blocks) ?? [])
1289
- W(p.type) && ((i = p.name) != null && i.trim()) && n.set(p.name.trim(), p);
1296
+ for (const m of (t == null ? void 0 : t.blocks) ?? [])
1297
+ W(m.type) && ((i = m.name) != null && i.trim()) && n.set(m.name.trim(), m);
1290
1298
  const r = [], o = [];
1291
- for (const p of e.blocks) {
1292
- if (!W(p.type)) continue;
1293
- const v = (a = p.name) == null ? void 0 : a.trim();
1294
- if (!v) continue;
1295
- const g = n.get(v);
1296
- g ? r.push(dr(g, p)) : o.push(
1297
- Z({
1299
+ for (const m of e.blocks) {
1300
+ if (!W(m.type)) continue;
1301
+ const b = (a = m.name) == null ? void 0 : a.trim();
1302
+ if (!b) continue;
1303
+ const g = n.get(b);
1304
+ g ? r.push(br(g, m)) : o.push(
1305
+ ee({
1298
1306
  title: "",
1299
1307
  description: "",
1300
- blocks: [p]
1308
+ blocks: [m],
1309
+ jsonSchema: {}
1301
1310
  }).blocks[0]
1302
1311
  );
1303
1312
  }
1304
1313
  return {
1305
1314
  matchedBlocks: r,
1306
1315
  extraBlocks: o,
1307
- renderBlocks: pr(e, r),
1316
+ renderBlocks: Sr(e, r),
1308
1317
  title: ((s = e.title) == null ? void 0 : s.trim()) || ((c = t == null ? void 0 : t.title) == null ? void 0 : c.trim()) || "",
1309
1318
  description: ((u = e.description) == null ? void 0 : u.trim()) || ((d = t == null ? void 0 : t.description) == null ? void 0 : d.trim()) || ""
1310
1319
  };
1311
1320
  }
1312
- function fr(e) {
1321
+ function xr(e) {
1313
1322
  const { type: t, defaultValue: n } = e;
1314
1323
  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 : "";
1315
1324
  }
1316
- function St(e) {
1325
+ function Tt(e) {
1317
1326
  var n;
1318
1327
  const t = {};
1319
1328
  for (const r of e) {
1320
1329
  if (!W(r.type)) continue;
1321
1330
  const o = (n = r.name) == null ? void 0 : n.trim();
1322
- o && (t[o] = fr(r));
1331
+ o && (t[o] = xr(r));
1323
1332
  }
1324
1333
  return t;
1325
1334
  }
1326
- function hr(e) {
1335
+ function kr(e) {
1327
1336
  return e.blocks.some(
1328
1337
  (t) => {
1329
1338
  var n;
@@ -1331,53 +1340,53 @@ function hr(e) {
1331
1340
  }
1332
1341
  );
1333
1342
  }
1334
- function gr(e) {
1343
+ function Ar(e) {
1335
1344
  return e.blocks.filter((t) => {
1336
1345
  var n;
1337
- return $e(t.type) ? !0 : W(t.type) && !!((n = t.name) != null && n.trim());
1346
+ return be(t.type) ? !0 : W(t.type) && !!((n = t.name) != null && n.trim());
1338
1347
  });
1339
1348
  }
1340
- function yr(e) {
1349
+ function Tr(e) {
1341
1350
  return e.blocks.filter((t) => {
1342
1351
  var n;
1343
1352
  return W(t.type) && ((n = t.name) == null ? void 0 : n.trim());
1344
1353
  }).map((t) => t.name.trim());
1345
1354
  }
1346
- function xt(e) {
1355
+ function It(e) {
1347
1356
  return e.replace(/'/g, "'\\''");
1348
1357
  }
1349
- function Ct(e, t) {
1358
+ function Nt(e, t) {
1350
1359
  const n = (t ?? "").trim() || "<callback_url>", r = JSON.stringify(e ?? {}, null, 2);
1351
1360
  return [
1352
1361
  `curl -X POST '${n}' \\`,
1353
1362
  " -H 'Content-Type: application/json' \\",
1354
- ` -d '${xt(r)}'`
1363
+ ` -d '${It(r)}'`
1355
1364
  ].join(`
1356
1365
  `);
1357
1366
  }
1358
- function vr(e, t) {
1367
+ function Ir(e, t) {
1359
1368
  return JSON.stringify({ ...e, ...t }, null, 2);
1360
1369
  }
1361
- function kt({
1370
+ function Mt({
1362
1371
  cardValues: e,
1363
1372
  extraValues: t = {},
1364
1373
  callbackUrl: n
1365
1374
  }) {
1366
- const r = (n ?? "").trim() || "<callback_url>", o = vr(e, t);
1375
+ const r = (n ?? "").trim() || "<callback_url>", o = Ir(e, t);
1367
1376
  return [
1368
1377
  `curl -X POST '${r}' \\`,
1369
1378
  " -H 'Content-Type: application/json' \\",
1370
- ` -d '${xt(o)}'`
1379
+ ` -d '${It(o)}'`
1371
1380
  ].join(`
1372
1381
  `);
1373
1382
  }
1374
- function br(e, t) {
1375
- const n = bt(e);
1376
- if (!n) return Ct(e, t);
1377
- const r = St(n.blocks);
1378
- return kt({ cardValues: r, callbackUrl: t });
1383
+ function Nr(e, t) {
1384
+ const n = At(e);
1385
+ if (!n) return Nt(e, t);
1386
+ const r = Tt(n.blocks);
1387
+ return Mt({ cardValues: r, callbackUrl: t });
1379
1388
  }
1380
- async function Sr(e, t, n) {
1389
+ async function Mr(e, t, n) {
1381
1390
  const r = e.trim();
1382
1391
  if (!r)
1383
1392
  throw new Error("callback_url 为空");
@@ -1404,7 +1413,7 @@ async function Sr(e, t, n) {
1404
1413
  }
1405
1414
  return { ok: i.ok, status: i.status, body: a };
1406
1415
  }
1407
- async function At(e) {
1416
+ async function Ft(e) {
1408
1417
  var n;
1409
1418
  if (typeof navigator < "u" && ((n = navigator.clipboard) != null && n.writeText)) {
1410
1419
  await navigator.clipboard.writeText(e);
@@ -1420,7 +1429,7 @@ async function At(e) {
1420
1429
  document.body.removeChild(t);
1421
1430
  }
1422
1431
  }
1423
- async function xr(e) {
1432
+ async function Ye(e) {
1424
1433
  let t;
1425
1434
  try {
1426
1435
  t = await e.json();
@@ -1433,10 +1442,37 @@ async function xr(e) {
1433
1442
  throw new Error(t.message || `响应缺少 data (${e.status})`);
1434
1443
  return t.data;
1435
1444
  }
1436
- function co(e = {}) {
1445
+ const Fr = "auth_user", _r = "token";
1446
+ function Pr(e) {
1447
+ if (typeof window > "u") return null;
1448
+ try {
1449
+ return e === "localStorage" ? window.localStorage : window.sessionStorage;
1450
+ } catch {
1451
+ return null;
1452
+ }
1453
+ }
1454
+ function Ur(e, t) {
1455
+ try {
1456
+ const r = JSON.parse(e)[t];
1457
+ return typeof r == "string" ? r.trim().replace(/^bearer\s+/i, "").trim() : "";
1458
+ } catch {
1459
+ return "";
1460
+ }
1461
+ }
1462
+ function zr(e = {}) {
1463
+ const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Fr, r = e.tokenField ?? _r, o = Pr(t);
1464
+ if (!o) return {};
1465
+ const i = o.getItem(n);
1466
+ if (!i) return {};
1467
+ const a = Ur(i, r);
1468
+ return a ? { Authorization: `Bearer ${a}` } : {};
1469
+ }
1470
+ async function Xe(e = {}) {
1471
+ return e.getHeaders ? await e.getHeaders() ?? {} : zr(e.authStorage);
1472
+ }
1473
+ function Er(e = {}) {
1437
1474
  const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.detailPath ?? "/dev/form/detail", r = e.fetch ?? fetch;
1438
1475
  async function o(i) {
1439
- var p;
1440
1476
  const a = new URLSearchParams();
1441
1477
  if (i.formId !== void 0)
1442
1478
  a.set("form_id", String(i.formId));
@@ -1444,34 +1480,219 @@ function co(e = {}) {
1444
1480
  a.set("form_unique_id", i.formUniqueId);
1445
1481
  else
1446
1482
  throw new Error("form_id 或 form_unique_id 至少传一个");
1447
- const s = await ((p = e.getHeaders) == null ? void 0 : p.call(e)) ?? {}, c = await r(`${t}${n}?${a.toString()}`, {
1483
+ const s = await Xe(e), c = await r(`${t}${n}?${a.toString()}`, {
1448
1484
  method: "GET",
1449
1485
  headers: s
1450
- }), u = await xr(c), d = sr(u.form_definition);
1486
+ }), u = await Ye(c), d = gr(u.form_definition);
1451
1487
  return {
1452
1488
  formUniqueId: u.form_unique_id,
1453
1489
  formId: u.form_id,
1454
1490
  disabled: u.disabled === 1,
1455
1491
  formDefinition: d,
1456
- a2ui: ar(u.form_definition) ?? void 0
1492
+ a2ui: fr(u.form_definition) ?? void 0
1457
1493
  };
1458
1494
  }
1459
1495
  return { fetchDetail: o };
1460
1496
  }
1461
- const Cr = {
1462
- video: Dt,
1463
- audio: $t,
1464
- image: jt,
1465
- file: tt,
1466
- spreadsheet: Lt,
1467
- document: et
1497
+ function Rr(e) {
1498
+ return {
1499
+ resumeUniqueId: e.resume_unique_id,
1500
+ resumeId: e.resume_id,
1501
+ agentId: e.agent_id,
1502
+ name: e.name,
1503
+ avatarUrl: e.avatar_url ?? null,
1504
+ description: e.description ?? void 0,
1505
+ satisfaction: e.satisfaction,
1506
+ published: e.published,
1507
+ worksCount: e.works_count,
1508
+ personality: e.personality_json ?? [],
1509
+ specialties: e.specialties_json ?? [],
1510
+ traits: e.traits_json ?? [],
1511
+ works: (e.works_json ?? []).map((t) => ({
1512
+ title: t.title ?? "",
1513
+ coverUrl: t.cover_url ?? null,
1514
+ link: t.link
1515
+ }))
1516
+ };
1517
+ }
1518
+ function Br(e, t) {
1519
+ const n = new URLSearchParams();
1520
+ n.set("page", String(t)), n.set("page_size", String(e.pageSize ?? 20));
1521
+ for (const r of e.names ?? [])
1522
+ r && n.append("name", r);
1523
+ for (const r of e.agentUniqueIds ?? [])
1524
+ r && n.append("agent_unique_id", r);
1525
+ for (const r of e.resumeUniqueIds ?? [])
1526
+ r && n.append("resume_unique_id", r);
1527
+ return n;
1528
+ }
1529
+ function wr(e = {}) {
1530
+ const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.searchPath ?? "/univ/resume/search", r = e.fetch ?? fetch;
1531
+ return async ({ filter: o, page: i }) => {
1532
+ const a = await Xe(e), s = Br(o, i), c = await r(`${t}${n}?${s.toString()}`, {
1533
+ method: "GET",
1534
+ headers: a
1535
+ }), u = await Ye(c);
1536
+ return {
1537
+ list: (u.list ?? []).map(Rr),
1538
+ total: u.total ?? 0,
1539
+ page: u.page ?? i,
1540
+ pageSize: u.page_size ?? o.pageSize ?? 20
1541
+ };
1542
+ };
1543
+ }
1544
+ function qr(e) {
1545
+ var r, o, i, a;
1546
+ const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!((o = e.agentUniqueId) != null && o.trim() && ((i = e.flowType) != null && i.trim()) && ((a = e.category) != null && a.trim()));
1547
+ return t || n;
1548
+ }
1549
+ function Or(e) {
1550
+ return {
1551
+ caseUniqueId: e.case_unique_id,
1552
+ caseId: e.case_id,
1553
+ flowId: e.flow_id,
1554
+ name: e.name,
1555
+ link: e.link,
1556
+ platform: e.platform ?? null,
1557
+ description: e.description ?? void 0
1558
+ };
1559
+ }
1560
+ function Vr(e, t, n) {
1561
+ var o, i, a;
1562
+ const r = new URLSearchParams();
1563
+ 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()), (a = e.category) != null && a.trim() && r.set("category_unique_id", e.category.trim());
1564
+ for (const s of e.flowUniqueIds ?? [])
1565
+ s && r.append("flow_unique_ids", s);
1566
+ return r;
1567
+ }
1568
+ function jr(e = {}) {
1569
+ const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.listPath ?? "/univ/case/list", r = e.fetch ?? fetch, o = e.published ?? 1;
1570
+ return async ({ filter: i, page: a }) => {
1571
+ if (!qr(i))
1572
+ return { list: [], total: 0, page: 1, pageSize: i.pageSize ?? 20 };
1573
+ const s = await Xe(e), c = Vr(i, a, o), u = await r(`${t}${n}?${c.toString()}`, {
1574
+ method: "GET",
1575
+ headers: s
1576
+ }), d = await Ye(u);
1577
+ return {
1578
+ list: (d.list ?? []).map(Or),
1579
+ total: d.total ?? 0,
1580
+ page: d.page ?? a,
1581
+ pageSize: d.page_size ?? i.pageSize ?? 20
1582
+ };
1583
+ };
1584
+ }
1585
+ function Uo(e = {}) {
1586
+ var r, o, i, a;
1587
+ const t = {
1588
+ baseUrl: e.baseUrl,
1589
+ fetch: e.fetch,
1590
+ getHeaders: e.getHeaders,
1591
+ authStorage: e.authStorage
1592
+ };
1593
+ return {
1594
+ fetchDetail: Er({
1595
+ ...t,
1596
+ detailPath: (r = e.form) == null ? void 0 : r.detailPath
1597
+ }).fetchDetail,
1598
+ resumeSearch: wr({
1599
+ ...t,
1600
+ searchPath: (o = e.resume) == null ? void 0 : o.searchPath
1601
+ }),
1602
+ caseSearch: jr({
1603
+ ...t,
1604
+ listPath: (i = e.case) == null ? void 0 : i.listPath,
1605
+ published: (a = e.case) == null ? void 0 : a.published
1606
+ })
1607
+ };
1608
+ }
1609
+ function _t(e, t) {
1610
+ if (!t.trim()) return !0;
1611
+ try {
1612
+ return new RegExp(t).test(e);
1613
+ } catch {
1614
+ return !0;
1615
+ }
1616
+ }
1617
+ function Pt(e) {
1618
+ return e == null ? !0 : typeof e == "string" ? !e.trim() : !1;
1619
+ }
1620
+ function Lr(e, t) {
1621
+ switch (e.type) {
1622
+ case "multiselect":
1623
+ case "checkbox":
1624
+ case "file":
1625
+ case "resume_multiselect":
1626
+ case "case_multiselect":
1627
+ return O(t).length === 0;
1628
+ case "toggle":
1629
+ return !le(t);
1630
+ case "number":
1631
+ return t == null || t === "";
1632
+ default:
1633
+ return Pt(t);
1634
+ }
1635
+ }
1636
+ function Ee(e, t) {
1637
+ return e.required === !0 || t > 0;
1638
+ }
1639
+ function $r(e, t) {
1640
+ var n, r;
1641
+ for (const o of e) {
1642
+ const i = (n = o.name) == null ? void 0 : n.trim();
1643
+ if (!i || be(o.type) || he(o.type)) continue;
1644
+ const a = t[i], s = ((r = o.label) == null ? void 0 : r.trim()) || i;
1645
+ if (o.required && Lr(o, a))
1646
+ return { fieldName: i, label: s, message: `请填写「${s}」` };
1647
+ if (o.type === "email" && !Pt(a)) {
1648
+ const c = String(a).trim();
1649
+ if (!_t(c, Je))
1650
+ return { fieldName: i, label: s, message: `「${s}」格式不正确` };
1651
+ }
1652
+ if (o.type === "file") {
1653
+ const c = o.fileMinCount ?? 0, u = O(a).length;
1654
+ if (c > 0 && u < c && Ee(o, u))
1655
+ return {
1656
+ fieldName: i,
1657
+ label: s,
1658
+ message: `「${s}」至少需要 ${c} 个文件`
1659
+ };
1660
+ }
1661
+ if (o.type === "resume_multiselect") {
1662
+ const c = o.resumeMinCount, u = O(a).length;
1663
+ if (c !== void 0 && u < c && Ee(o, u))
1664
+ return {
1665
+ fieldName: i,
1666
+ label: s,
1667
+ message: `「${s}」至少选择 ${c} 项`
1668
+ };
1669
+ }
1670
+ if (o.type === "case_multiselect") {
1671
+ const c = o.caseMinCount, u = O(a).length;
1672
+ if (c !== void 0 && u < c && Ee(o, u))
1673
+ return {
1674
+ fieldName: i,
1675
+ label: s,
1676
+ message: `「${s}」至少选择 ${c} 项`
1677
+ };
1678
+ }
1679
+ }
1680
+ return null;
1681
+ }
1682
+ const Dr = {
1683
+ video: Qt,
1684
+ audio: Wt,
1685
+ image: Xt,
1686
+ file: st,
1687
+ spreadsheet: Yt,
1688
+ document: at
1468
1689
  };
1469
- function kr({
1690
+ function Hr({
1470
1691
  type: e,
1471
1692
  size: t = 40,
1472
1693
  className: n
1473
1694
  }) {
1474
- const r = Cr[e] ?? tt;
1695
+ const r = Dr[e] ?? st;
1475
1696
  return /* @__PURE__ */ l(
1476
1697
  r,
1477
1698
  {
@@ -1481,7 +1702,7 @@ function kr({
1481
1702
  }
1482
1703
  );
1483
1704
  }
1484
- const Tt = "skopon-form-v0_9", Ar = /* @__PURE__ */ new Set([
1705
+ const Ut = "skopon-form-v0_9", Kr = /* @__PURE__ */ new Set([
1485
1706
  "SkoponMedia",
1486
1707
  "SkoponSelect",
1487
1708
  "Image",
@@ -1493,24 +1714,24 @@ const Tt = "skopon-form-v0_9", Ar = /* @__PURE__ */ new Set([
1493
1714
  "FileUpload",
1494
1715
  "TextField",
1495
1716
  "Text",
1496
- ...Yn()
1497
- ]), Tr = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
1498
- function se(e) {
1499
- const t = [...de.components.values()].find((n) => n.name === e);
1717
+ ...rr()
1718
+ ]), Gr = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
1719
+ function ce(e) {
1720
+ const t = [...fe.components.values()].find((n) => n.name === e);
1500
1721
  if (!t) throw new Error(`Missing basic catalog component: ${e}`);
1501
1722
  return t.schema;
1502
1723
  }
1503
- function k(e) {
1724
+ function T(e) {
1504
1725
  return typeof e == "string" ? e : "";
1505
1726
  }
1506
- function Mt(e) {
1727
+ function zt(e) {
1507
1728
  return Array.isArray(e) ? e.map((t) => {
1508
1729
  if (!t || typeof t != "object") return null;
1509
1730
  const n = t, r = String(n.value ?? n.label ?? ""), o = String(n.label ?? n.value ?? "");
1510
1731
  return { value: r, label: o };
1511
1732
  }).filter((t) => !!t) : [];
1512
1733
  }
1513
- function be({
1734
+ function xe({
1514
1735
  mediaType: e,
1515
1736
  urls: t,
1516
1737
  mediaSize: n,
@@ -1518,17 +1739,17 @@ function be({
1518
1739
  help: o,
1519
1740
  placeholder: i
1520
1741
  }) {
1521
- const a = r == null ? void 0 : r.trim(), s = o == null ? void 0 : o.trim(), c = fn(n), u = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
1522
- return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1742
+ const a = r == null ? void 0 : r.trim(), s = o == null ? void 0 : o.trim(), c = xn(n), u = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
1743
+ return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
1523
1744
  a ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: a }) : null,
1524
- t.length === 0 ? /* @__PURE__ */ l("div", { className: "form-media-preview form-media-preview--empty", children: u }) : /* @__PURE__ */ l("div", { className: c, children: t.map((d, p) => e === "image" ? /* @__PURE__ */ l(
1745
+ t.length === 0 ? /* @__PURE__ */ l("div", { className: "form-media-preview form-media-preview--empty", children: u }) : /* @__PURE__ */ l("div", { className: c, children: t.map((d, m) => e === "image" ? /* @__PURE__ */ l(
1525
1746
  "img",
1526
1747
  {
1527
1748
  src: d,
1528
1749
  alt: a || "图片",
1529
1750
  className: "form-media-item"
1530
1751
  },
1531
- `media-${p}`
1752
+ `media-${m}`
1532
1753
  ) : e === "video" ? /* @__PURE__ */ l(
1533
1754
  "video",
1534
1755
  {
@@ -1536,7 +1757,7 @@ function be({
1536
1757
  controls: !0,
1537
1758
  className: "form-media-item"
1538
1759
  },
1539
- `media-${p}`
1760
+ `media-${m}`
1540
1761
  ) : /* @__PURE__ */ l(
1541
1762
  "audio",
1542
1763
  {
@@ -1544,23 +1765,23 @@ function be({
1544
1765
  controls: !0,
1545
1766
  className: "form-media-item form-media-item--audio"
1546
1767
  },
1547
- `media-${p}`
1768
+ `media-${m}`
1548
1769
  )) }),
1549
- s ? /* @__PURE__ */ l(H.Text, { type: "secondary", className: "form-block-preview-help", children: s }) : null
1770
+ s ? /* @__PURE__ */ l(D.Text, { type: "secondary", className: "form-block-preview-help", children: s }) : null
1550
1771
  ] });
1551
1772
  }
1552
- function Se(e, t) {
1553
- const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : k(e.url).trim() ? [k(e.url).trim()] : [];
1773
+ function ke(e, t) {
1774
+ const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : T(e.url).trim() ? [T(e.url).trim()] : [];
1554
1775
  return {
1555
1776
  mediaType: t,
1556
1777
  urls: n,
1557
- mediaSize: le(e.mediaSize),
1558
- label: k(e.label) || k(e.description),
1559
- help: k(e.help),
1560
- placeholder: k(e.placeholder)
1778
+ mediaSize: se(e.mediaSize),
1779
+ label: T(e.label) || T(e.description),
1780
+ help: T(e.help),
1781
+ placeholder: T(e.placeholder)
1561
1782
  };
1562
1783
  }
1563
- const Mr = {
1784
+ const Jr = {
1564
1785
  name: "SkoponMedia",
1565
1786
  schema: f.object({
1566
1787
  mediaType: f.any().optional(),
@@ -1570,19 +1791,19 @@ const Mr = {
1570
1791
  help: f.any().optional(),
1571
1792
  placeholder: f.any().optional()
1572
1793
  }).passthrough()
1573
- }, Nr = q(Mr, ({ context: e }) => {
1574
- const t = e.componentModel.properties, n = k(t.mediaType);
1575
- return /* @__PURE__ */ l(be, { ...Se(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
1576
- }), Ir = q(
1577
- { name: "Image", schema: se("Image") },
1578
- ({ context: e }) => /* @__PURE__ */ l(be, { ...Se(e.componentModel.properties, "image") })
1579
- ), Fr = q(
1580
- { name: "Video", schema: se("Video") },
1581
- ({ context: e }) => /* @__PURE__ */ l(be, { ...Se(e.componentModel.properties, "video") })
1582
- ), Pr = q(
1583
- { name: "AudioPlayer", schema: se("AudioPlayer") },
1584
- ({ context: e }) => /* @__PURE__ */ l(be, { ...Se(e.componentModel.properties, "audio") })
1585
- ), zr = {
1794
+ }, Yr = V(Jr, ({ context: e }) => {
1795
+ const t = e.componentModel.properties, n = T(t.mediaType);
1796
+ return /* @__PURE__ */ l(xe, { ...ke(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
1797
+ }), Xr = V(
1798
+ { name: "Image", schema: ce("Image") },
1799
+ ({ context: e }) => /* @__PURE__ */ l(xe, { ...ke(e.componentModel.properties, "image") })
1800
+ ), Wr = V(
1801
+ { name: "Video", schema: ce("Video") },
1802
+ ({ context: e }) => /* @__PURE__ */ l(xe, { ...ke(e.componentModel.properties, "video") })
1803
+ ), Qr = V(
1804
+ { name: "AudioPlayer", schema: ce("AudioPlayer") },
1805
+ ({ context: e }) => /* @__PURE__ */ l(xe, { ...ke(e.componentModel.properties, "audio") })
1806
+ ), Zr = {
1586
1807
  name: "SkoponSelect",
1587
1808
  schema: f.object({
1588
1809
  label: f.any().optional(),
@@ -1592,15 +1813,15 @@ const Mr = {
1592
1813
  value: f.any().optional()
1593
1814
  }).passthrough()
1594
1815
  };
1595
- function Ur({ context: e }) {
1596
- const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = k(o.label), a = k(o.placeholder), s = Mt(o.options), c = k(o.mode) === "multiple";
1597
- return B(() => {
1598
- const u = ct(n, c);
1816
+ function eo({ context: e }) {
1817
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = T(o.label), a = T(o.placeholder), s = zt(o.options), c = T(o.mode) === "multiple";
1818
+ return R(() => {
1819
+ const u = ht(n, c);
1599
1820
  u !== null && r(u);
1600
- }, [c, n, r]), /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1821
+ }, [c, n, r]), /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
1601
1822
  i ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
1602
1823
  /* @__PURE__ */ l(
1603
- Ue,
1824
+ Re,
1604
1825
  {
1605
1826
  mode: c ? "multiple" : void 0,
1606
1827
  disabled: !t,
@@ -1609,25 +1830,25 @@ function Ur({ context: e }) {
1609
1830
  style: { width: "100%" },
1610
1831
  placeholder: a || (c ? "请选择多项" : "请选择"),
1611
1832
  options: s,
1612
- value: c ? $(n) : oe(n),
1833
+ value: c ? O(n) : oe(n),
1613
1834
  onChange: (u) => r(c ? u ?? [] : u ?? "")
1614
1835
  }
1615
1836
  )
1616
1837
  ] });
1617
1838
  }
1618
- const _r = q(
1619
- zr,
1620
- Ur
1839
+ const to = V(
1840
+ Zr,
1841
+ eo
1621
1842
  );
1622
- function Er({ context: e }) {
1623
- const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = k(o.label), a = k(o.variant) || "mutuallyExclusive", s = k(o.skoponPickerType), c = k(o.placeholder), u = Mt(o.options), p = s === "select" || s === "multiselect" || s === "radio" || s === "checkbox" ? s : a === "multipleSelection" ? "checkbox" : "radio", v = p === "multiselect" || p === "checkbox";
1624
- return B(() => {
1625
- const g = ct(n, v);
1843
+ function no({ context: e }) {
1844
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = T(o.label), a = T(o.variant) || "mutuallyExclusive", s = T(o.skoponPickerType), c = T(o.placeholder), u = zt(o.options), m = s === "select" || s === "multiselect" || s === "radio" || s === "checkbox" ? s : a === "multipleSelection" ? "checkbox" : "radio", b = m === "multiselect" || m === "checkbox";
1845
+ return R(() => {
1846
+ const g = ht(n, b);
1626
1847
  g !== null && r(g);
1627
- }, [v, n, r]), /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1848
+ }, [b, n, r]), /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
1628
1849
  i ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
1629
- p === "select" ? /* @__PURE__ */ l(
1630
- Ue,
1850
+ m === "select" ? /* @__PURE__ */ l(
1851
+ Re,
1631
1852
  {
1632
1853
  disabled: !t,
1633
1854
  allowClear: !0,
@@ -1638,8 +1859,8 @@ function Er({ context: e }) {
1638
1859
  value: oe(n),
1639
1860
  onChange: (g) => r(g ?? "")
1640
1861
  }
1641
- ) : p === "multiselect" ? /* @__PURE__ */ l(
1642
- Ue,
1862
+ ) : m === "multiselect" ? /* @__PURE__ */ l(
1863
+ Re,
1643
1864
  {
1644
1865
  mode: "multiple",
1645
1866
  disabled: !t,
@@ -1648,20 +1869,20 @@ function Er({ context: e }) {
1648
1869
  style: { width: "100%" },
1649
1870
  placeholder: c || "请选择多项",
1650
1871
  options: u,
1651
- value: $(n),
1872
+ value: O(n),
1652
1873
  onChange: (g) => r(g ?? [])
1653
1874
  }
1654
- ) : p === "checkbox" ? /* @__PURE__ */ l(
1655
- Ut.Group,
1875
+ ) : m === "checkbox" ? /* @__PURE__ */ l(
1876
+ Vt.Group,
1656
1877
  {
1657
1878
  disabled: !t,
1658
1879
  className: "form-block-preview-control",
1659
1880
  options: u,
1660
- value: $(n),
1881
+ value: O(n),
1661
1882
  onChange: (g) => r(g)
1662
1883
  }
1663
1884
  ) : /* @__PURE__ */ l(
1664
- _t.Group,
1885
+ jt.Group,
1665
1886
  {
1666
1887
  disabled: !t,
1667
1888
  className: "form-block-preview-control",
@@ -1672,7 +1893,7 @@ function Er({ context: e }) {
1672
1893
  )
1673
1894
  ] });
1674
1895
  }
1675
- const Rr = q(
1896
+ const ro = V(
1676
1897
  {
1677
1898
  name: "ChoicePicker",
1678
1899
  schema: f.object({
@@ -1684,57 +1905,57 @@ const Rr = q(
1684
1905
  placeholder: f.any().optional()
1685
1906
  }).passthrough()
1686
1907
  },
1687
- Er
1908
+ no
1688
1909
  );
1689
- function Br({ context: e }) {
1690
- const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = k(o.label);
1691
- return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1910
+ function oo({ context: e }) {
1911
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = T(o.label);
1912
+ return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
1692
1913
  i ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
1693
1914
  /* @__PURE__ */ l(
1694
- Et,
1915
+ Lt,
1695
1916
  {
1696
1917
  disabled: !t,
1697
1918
  className: "form-block-preview-control",
1698
- checked: ye(n),
1919
+ checked: le(n),
1699
1920
  onChange: (a) => r(a)
1700
1921
  }
1701
1922
  )
1702
1923
  ] });
1703
1924
  }
1704
- const Or = q(
1705
- { name: "CheckBox", schema: se("CheckBox") },
1706
- Br
1925
+ const io = V(
1926
+ { name: "CheckBox", schema: ce("CheckBox") },
1927
+ oo
1707
1928
  );
1708
- function Vr(e, t, n) {
1929
+ function ao(e, t, n) {
1709
1930
  const r = oe(e);
1710
1931
  if (!r) return;
1711
1932
  if (!t && n) {
1712
- const i = Ge(r, "HH:mm", !0);
1933
+ const i = Ze(r, "HH:mm", !0);
1713
1934
  return i.isValid() ? i : void 0;
1714
1935
  }
1715
- const o = Ge(r);
1936
+ const o = Ze(r);
1716
1937
  return o.isValid() ? o : void 0;
1717
1938
  }
1718
- function qr({ context: e }) {
1719
- const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = k(o.label), a = k(o.placeholder), s = o.enableDate === !0, c = o.enableTime === !0, u = Vr(n, s, c), d = (p) => {
1720
- if (!p) {
1939
+ function so({ context: e }) {
1940
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = T(o.label), a = T(o.placeholder), s = o.enableDate === !0, c = o.enableTime === !0, u = ao(n, s, c), d = (m) => {
1941
+ if (!m) {
1721
1942
  r("");
1722
1943
  return;
1723
1944
  }
1724
1945
  if (!s && c) {
1725
- r(p.format("HH:mm"));
1946
+ r(m.format("HH:mm"));
1726
1947
  return;
1727
1948
  }
1728
1949
  if (s && c) {
1729
- r(p.format("YYYY-MM-DDTHH:mm"));
1950
+ r(m.format("YYYY-MM-DDTHH:mm"));
1730
1951
  return;
1731
1952
  }
1732
- r(p.format("YYYY-MM-DD"));
1953
+ r(m.format("YYYY-MM-DD"));
1733
1954
  };
1734
- return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1955
+ return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
1735
1956
  i ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
1736
1957
  !s && c ? /* @__PURE__ */ l(
1737
- Rt,
1958
+ $t,
1738
1959
  {
1739
1960
  disabled: !t,
1740
1961
  className: "form-block-preview-control",
@@ -1744,7 +1965,7 @@ function qr({ context: e }) {
1744
1965
  onChange: d
1745
1966
  }
1746
1967
  ) : /* @__PURE__ */ l(
1747
- Bt,
1968
+ Dt,
1748
1969
  {
1749
1970
  showTime: s && c,
1750
1971
  disabled: !t,
@@ -1757,7 +1978,7 @@ function qr({ context: e }) {
1757
1978
  )
1758
1979
  ] });
1759
1980
  }
1760
- const wr = q(
1981
+ const lo = V(
1761
1982
  {
1762
1983
  name: "DateTimeInput",
1763
1984
  schema: f.object({
@@ -1770,8 +1991,8 @@ const wr = q(
1770
1991
  max: f.any().optional()
1771
1992
  }).passthrough()
1772
1993
  },
1773
- qr
1774
- ), Lr = {
1994
+ so
1995
+ ), co = {
1775
1996
  name: "FileUpload",
1776
1997
  schema: f.object({
1777
1998
  label: f.any().optional(),
@@ -1783,109 +2004,130 @@ const wr = q(
1783
2004
  value: f.any().optional()
1784
2005
  }).passthrough()
1785
2006
  };
1786
- function jr({ context: e }) {
1787
- const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = k(o.label), a = k(o.accept), s = Array.isArray(o.fileAcceptTypes) ? o.fileAcceptTypes.map(String) : void 0, c = a ? a.split(",").map((m) => m.trim()).filter(Boolean) : void 0, u = ln(s, c), d = typeof o.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
2007
+ function uo({ context: e }) {
2008
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = T(o.label), a = T(o.accept), s = Array.isArray(o.fileAcceptTypes) ? o.fileAcceptTypes.map(String) : void 0, c = a ? a.split(",").map((p) => p.trim()).filter(Boolean) : void 0, u = hn(s, c), d = typeof o.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
1788
2009
  o.filePlaceholderIcon
1789
- ) ? o.filePlaceholderIcon : "document", p = typeof o.minCount == "number" ? Math.max(0, o.minCount) : 0, v = typeof o.maxCount == "number" ? o.maxCount : 1, g = v > 0, A = $(n), E = g && A.length >= v, T = A.length < p;
1790
- return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
2010
+ ) ? o.filePlaceholderIcon : "document", m = typeof o.minCount == "number" ? Math.max(0, o.minCount) : 0, b = typeof o.maxCount == "number" ? o.maxCount : 1, g = b > 0, A = O(n), N = g && A.length >= b, v = A.length < m;
2011
+ return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
1791
2012
  i ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
1792
- /* @__PURE__ */ C(
1793
- ke.Dragger,
2013
+ /* @__PURE__ */ k(
2014
+ Te.Dragger,
1794
2015
  {
1795
- disabled: !t || E,
1796
- accept: an(s, c),
2016
+ disabled: !t || N,
2017
+ accept: fn(s, c),
1797
2018
  className: "form-file-upload-preview",
1798
2019
  showUploadList: t && A.length > 0,
1799
- fileList: t ? A.map((m, h) => ({
1800
- uid: `${h}-${m}`,
1801
- name: m,
2020
+ fileList: t ? A.map((p, h) => ({
2021
+ uid: `${h}-${p}`,
2022
+ name: p,
1802
2023
  status: "done"
1803
2024
  })) : [],
1804
- beforeUpload: (m) => {
1805
- if (!t) return ke.LIST_IGNORE;
1806
- const h = $(Xe(e));
1807
- if (g && h.length >= v) return ke.LIST_IGNORE;
1808
- const x = g ? [...h, m.name].slice(0, v) : [...h, m.name];
2025
+ beforeUpload: (p) => {
2026
+ if (!t) return Te.LIST_IGNORE;
2027
+ const h = O(nt(e));
2028
+ if (g && h.length >= b) return Te.LIST_IGNORE;
2029
+ const x = g ? [...h, p.name].slice(0, b) : [...h, p.name];
1809
2030
  return r(x), !1;
1810
2031
  },
1811
- onRemove: (m) => {
1812
- const h = $(Xe(e)), x = /^(\d+)-/.exec(m.uid ?? ""), y = x ? Number(x[1]) : -1, S = y >= 0 && y < h.length ? h.filter((N, _) => _ !== y) : h.filter((N) => N !== m.name);
1813
- if (S.length < p) return !1;
1814
- r(S);
2032
+ onRemove: (p) => {
2033
+ const h = O(nt(e)), x = /^(\d+)-/.exec(p.uid ?? ""), y = x ? Number(x[1]) : -1, C = y >= 0 && y < h.length ? h.filter((M, E) => E !== y) : h.filter((M) => M !== p.name);
2034
+ if (C.length < m) return !1;
2035
+ r(C);
1815
2036
  },
1816
2037
  children: [
1817
- /* @__PURE__ */ l("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ l(kr, { type: d, size: 40 }) }),
2038
+ /* @__PURE__ */ l("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ l(Hr, { type: d, size: 40 }) }),
1818
2039
  /* @__PURE__ */ l("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
1819
2040
  ]
1820
2041
  }
1821
2042
  ),
1822
- /* @__PURE__ */ C(H.Text, { type: "secondary", className: "form-block-preview-help", children: [
2043
+ /* @__PURE__ */ k(D.Text, { type: "secondary", className: "form-block-preview-help", children: [
1823
2044
  "允许:",
1824
2045
  u ?? "全部类型",
1825
- p > 0 ? `;至少 ${p} 个文件` : "",
1826
- g ? `;最多 ${v} 个文件` : "",
2046
+ m > 0 ? `;至少 ${m} 个文件` : "",
2047
+ g ? `;最多 ${b} 个文件` : "",
1827
2048
  ";当前仅收集文件名(不含文件内容,需宿主另行上传)",
1828
- T && t ? `(当前 ${A.length} 个,未达下限)` : ""
2049
+ v && t ? `(当前 ${A.length} 个,未达下限)` : ""
1829
2050
  ] })
1830
2051
  ] });
1831
2052
  }
1832
- const $r = q(
1833
- Lr,
1834
- jr
2053
+ const po = V(
2054
+ co,
2055
+ uo
1835
2056
  );
1836
- function Dr({ context: e }) {
1837
- const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = k(o.label), a = k(o.placeholder), s = k(o.variant) || "shortText", c = oe(n) ?? "", u = !t, d = "form-block-preview-control";
1838
- let p;
2057
+ function mo({ context: e }) {
2058
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = T(o.label), a = T(o.placeholder), s = T(o.variant) || "shortText", c = T(o.validationRegexp), u = oe(n) ?? "", d = !t, [m, b] = _(""), g = (v) => {
2059
+ if (!c || !v.trim()) {
2060
+ b("");
2061
+ return;
2062
+ }
2063
+ b(_t(v, c) ? "" : "格式不正确");
2064
+ };
2065
+ R(() => {
2066
+ g(u);
2067
+ }, [c, u]);
2068
+ const A = "form-block-preview-control";
2069
+ let N;
1839
2070
  if (s === "longText")
1840
- p = /* @__PURE__ */ l(
1841
- Ae.TextArea,
2071
+ N = /* @__PURE__ */ l(
2072
+ Ie.TextArea,
1842
2073
  {
1843
- disabled: u,
1844
- className: d,
2074
+ disabled: d,
2075
+ className: A,
1845
2076
  placeholder: a || "长文本回答...",
1846
2077
  autoSize: { minRows: 2, maxRows: 6 },
1847
- value: c,
1848
- onChange: (v) => r(v.target.value)
2078
+ value: u,
2079
+ status: m ? "error" : void 0,
2080
+ onChange: (v) => {
2081
+ const p = v.target.value;
2082
+ r(p), g(p);
2083
+ },
2084
+ onBlur: (v) => g(v.target.value)
1849
2085
  }
1850
2086
  );
1851
2087
  else if (s === "number") {
1852
- const v = c && Number.isFinite(Number(c)) ? Number(c) : void 0;
1853
- p = /* @__PURE__ */ l(
1854
- Ot,
2088
+ const v = u && Number.isFinite(Number(u)) ? Number(u) : void 0;
2089
+ N = /* @__PURE__ */ l(
2090
+ Ht,
1855
2091
  {
1856
- disabled: u,
1857
- className: d,
2092
+ disabled: d,
2093
+ className: A,
1858
2094
  style: { width: "100%" },
1859
2095
  placeholder: a || "数字",
1860
2096
  value: v,
1861
- onChange: (g) => r(g == null ? "" : String(g))
2097
+ onChange: (p) => r(p == null ? "" : String(p))
1862
2098
  }
1863
2099
  );
1864
- } else s === "obscured" ? p = /* @__PURE__ */ l(
1865
- Ae.Password,
2100
+ } else s === "obscured" ? N = /* @__PURE__ */ l(
2101
+ Ie.Password,
1866
2102
  {
1867
- disabled: u,
1868
- className: d,
2103
+ disabled: d,
2104
+ className: A,
1869
2105
  placeholder: a,
1870
- value: c,
2106
+ value: u,
1871
2107
  onChange: (v) => r(v.target.value)
1872
2108
  }
1873
- ) : p = /* @__PURE__ */ l(
1874
- Ae,
2109
+ ) : N = /* @__PURE__ */ l(
2110
+ Ie,
1875
2111
  {
1876
- disabled: u,
1877
- className: d,
2112
+ disabled: d,
2113
+ className: A,
1878
2114
  placeholder: a,
1879
- value: c,
1880
- onChange: (v) => r(v.target.value)
2115
+ value: u,
2116
+ status: m ? "error" : void 0,
2117
+ onChange: (v) => {
2118
+ const p = v.target.value;
2119
+ r(p), g(p);
2120
+ },
2121
+ onBlur: (v) => g(v.target.value)
1881
2122
  }
1882
2123
  );
1883
- return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
2124
+ return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
1884
2125
  i ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
1885
- p
2126
+ N,
2127
+ m ? /* @__PURE__ */ l(D.Text, { type: "danger", className: "form-block-preview-help", children: m }) : null
1886
2128
  ] });
1887
2129
  }
1888
- const Hr = q(
2130
+ const fo = V(
1889
2131
  {
1890
2132
  name: "TextField",
1891
2133
  schema: f.object({
@@ -1896,37 +2138,37 @@ const Hr = q(
1896
2138
  value: f.any().optional()
1897
2139
  }).passthrough()
1898
2140
  },
1899
- Dr
2141
+ mo
1900
2142
  );
1901
- function Kr({ context: e }) {
1902
- const t = e.componentModel.properties, n = k(t.text), r = k(t.variant) || "body";
1903
- return Tr.has(r) ? r === "caption" ? /* @__PURE__ */ l(H.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ l("em", { children: n }) }) : /* @__PURE__ */ l(r, { className: "form-block-preview-heading", children: n }) : /* @__PURE__ */ l(H.Paragraph, { className: "form-block-preview-paragraph", children: n });
2143
+ function ho({ context: e }) {
2144
+ const t = e.componentModel.properties, n = T(t.text), r = T(t.variant) || "body";
2145
+ return Gr.has(r) ? r === "caption" ? /* @__PURE__ */ l(D.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ l("em", { children: n }) }) : /* @__PURE__ */ l(r, { className: "form-block-preview-heading", children: n }) : /* @__PURE__ */ l(D.Paragraph, { className: "form-block-preview-paragraph", children: n });
1904
2146
  }
1905
- const Gr = q(
1906
- { name: "Text", schema: se("Text") },
1907
- Kr
2147
+ const go = V(
2148
+ { name: "Text", schema: ce("Text") },
2149
+ ho
1908
2150
  );
1909
- function Nt() {
2151
+ function Et() {
1910
2152
  const t = [
1911
- ...[...de.components.values()].filter(
1912
- (r) => !Ar.has(r.name)
2153
+ ...[...fe.components.values()].filter(
2154
+ (r) => !Kr.has(r.name)
1913
2155
  ),
1914
- Nr,
1915
- _r,
1916
- Ir,
1917
- Fr,
1918
- Pr,
1919
- Rr,
1920
- Or,
1921
- wr,
1922
- $r,
1923
- Hr,
1924
- Gr,
1925
- ...Jn()
1926
- ], n = [...de.functions.values()];
1927
- return new Ht(Tt, t, n, de.themeSchema);
1928
- }
1929
- const D = {
2156
+ Yr,
2157
+ to,
2158
+ Xr,
2159
+ Wr,
2160
+ Qr,
2161
+ ro,
2162
+ io,
2163
+ lo,
2164
+ po,
2165
+ fo,
2166
+ go,
2167
+ ...nr()
2168
+ ], n = [...fe.functions.values()];
2169
+ return new Zt(Ut, t, n, fe.themeSchema);
2170
+ }
2171
+ const H = {
1930
2172
  jade9: "#29a383",
1931
2173
  jade10: "#26997b",
1932
2174
  jade11: "#208368",
@@ -1938,20 +2180,20 @@ const D = {
1938
2180
  primaryHover: "#26997b",
1939
2181
  primaryActive: "#1d3b31",
1940
2182
  onPrimary: "#ffffff"
1941
- }, Jr = {
2183
+ }, yo = {
1942
2184
  cssVar: { key: "vidtempl" },
1943
2185
  token: {
1944
- colorPrimary: D.primarySolid,
1945
- colorPrimaryHover: D.primaryHover,
1946
- colorPrimaryActive: D.primaryActive,
1947
- colorLink: D.primary,
1948
- colorLinkHover: D.primaryHover,
1949
- colorSuccess: D.jade9,
2186
+ colorPrimary: H.primarySolid,
2187
+ colorPrimaryHover: H.primaryHover,
2188
+ colorPrimaryActive: H.primaryActive,
2189
+ colorLink: H.primary,
2190
+ colorLinkHover: H.primaryHover,
2191
+ colorSuccess: H.jade9,
1950
2192
  colorWarning: "#f5a623",
1951
2193
  gold6: "#f5a623",
1952
2194
  gold7: "#e6951a",
1953
2195
  colorError: "#e5484d",
1954
- colorInfo: D.primary,
2196
+ colorInfo: H.primary,
1955
2197
  colorBgLayout: "#f9f9f9",
1956
2198
  colorBgContainer: "#ffffff",
1957
2199
  colorBgElevated: "#ffffff",
@@ -2011,7 +2253,7 @@ const D = {
2011
2253
  },
2012
2254
  Tag: {
2013
2255
  defaultBg: "#e6f7ed",
2014
- defaultColor: D.primary,
2256
+ defaultColor: H.primary,
2015
2257
  fontSizeSM: 13
2016
2258
  },
2017
2259
  Form: {
@@ -2028,9 +2270,9 @@ function X({
2028
2270
  locale: t,
2029
2271
  theme: n
2030
2272
  }) {
2031
- return /* @__PURE__ */ l(Vt, { theme: n ?? Jr, locale: t, children: e });
2273
+ return /* @__PURE__ */ l(Kt, { theme: n ?? yo, locale: t, children: e });
2032
2274
  }
2033
- const Yr = Ft(
2275
+ const vo = wt(
2034
2276
  function({
2035
2277
  doc: t,
2036
2278
  surfaceId: n = "skopon-form",
@@ -2041,57 +2283,57 @@ const Yr = Ft(
2041
2283
  caseSearch: s = null,
2042
2284
  wrapProvider: c = !0
2043
2285
  }, u) {
2044
- B(() => {
2045
- it(), ot();
2286
+ R(() => {
2287
+ pt(), ut();
2046
2288
  }, []);
2047
- const d = L(null), p = L(i);
2048
- p.current = i;
2049
- const v = V(() => {
2050
- if (qe(t)) return "";
2289
+ const d = L(null), m = L(i);
2290
+ m.current = i;
2291
+ const b = q(() => {
2292
+ if (je(t)) return "";
2051
2293
  try {
2052
2294
  return JSON.stringify(t);
2053
2295
  } catch {
2054
2296
  return String(t);
2055
2297
  }
2056
- }, [t]), g = V(() => {
2057
- if (!v)
2298
+ }, [t]), g = q(() => {
2299
+ if (!b)
2058
2300
  return { surfaces: [], processor: null };
2059
2301
  try {
2060
- const m = JSON.parse(v), h = new rt([Nt()]), x = ir(m, {
2302
+ const p = JSON.parse(b), h = new ct([Et()]), x = dr(p, {
2061
2303
  surfaceId: n,
2062
- catalogId: Tt
2304
+ catalogId: Ut
2063
2305
  });
2064
2306
  return h.processMessages(x), {
2065
2307
  surfaces: Array.from(h.model.surfacesMap.values()),
2066
2308
  processor: h
2067
2309
  };
2068
- } catch (m) {
2069
- return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", m), { surfaces: [], processor: null };
2310
+ } catch (p) {
2311
+ return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", p), { surfaces: [], processor: null };
2070
2312
  }
2071
- }, [v, n]), { surfaces: A, processor: E } = g;
2072
- if (d.current = E, Pt(
2313
+ }, [b, n]), { surfaces: A, processor: N } = g;
2314
+ if (d.current = N, qt(
2073
2315
  u,
2074
2316
  () => ({
2075
- getValues(m) {
2317
+ getValues(p) {
2076
2318
  const h = d.current;
2077
2319
  if (!h) return {};
2078
- const x = (m ?? p.current).map((y) => y.trim()).filter(Boolean);
2079
- return cr(h, n, x);
2320
+ const x = (p ?? m.current).map((y) => y.trim()).filter(Boolean);
2321
+ return yr(h, n, x);
2080
2322
  }
2081
2323
  }),
2082
2324
  [n]
2083
2325
  ), A.length === 0) {
2084
- const m = /* @__PURE__ */ l(Be, { resumeSearch: a, children: /* @__PURE__ */ l(Re, { caseSearch: s, children: /* @__PURE__ */ l(Ee, { interactive: o, children: r }) }) });
2085
- return c ? /* @__PURE__ */ l(X, { children: m }) : m;
2326
+ const p = /* @__PURE__ */ l(qe, { resumeSearch: a, children: /* @__PURE__ */ l(we, { caseSearch: s, children: /* @__PURE__ */ l(Be, { interactive: o, children: r }) }) });
2327
+ return c ? /* @__PURE__ */ l(X, { children: p }) : p;
2086
2328
  }
2087
- const T = /* @__PURE__ */ l(Be, { resumeSearch: a, children: /* @__PURE__ */ l(Re, { caseSearch: s, children: /* @__PURE__ */ l(Ee, { interactive: o, children: /* @__PURE__ */ l("div", { className: "a2ui-surface a2ui-container", children: A.map((m) => /* @__PURE__ */ l(nt, { surface: m }, m.id)) }) }) }) });
2088
- return c ? /* @__PURE__ */ l(X, { children: T }) : T;
2329
+ const v = /* @__PURE__ */ l(qe, { resumeSearch: a, children: /* @__PURE__ */ l(we, { caseSearch: s, children: /* @__PURE__ */ l(Be, { interactive: o, children: /* @__PURE__ */ l("div", { className: "a2ui-surface a2ui-container", children: A.map((p) => /* @__PURE__ */ l(lt, { surface: p }, p.id)) }) }) }) });
2330
+ return c ? /* @__PURE__ */ l(X, { children: v }) : v;
2089
2331
  }
2090
2332
  );
2091
- function pe() {
2092
- return new rt([Nt()]);
2333
+ function de() {
2334
+ return new ct([Et()]);
2093
2335
  }
2094
- function uo({
2336
+ function zo({
2095
2337
  messages: e,
2096
2338
  surfaceId: t = "skopon-form-stream",
2097
2339
  emptyHint: n = null,
@@ -2099,78 +2341,78 @@ function uo({
2099
2341
  resumeSearch: o = null,
2100
2342
  caseSearch: i = null
2101
2343
  }) {
2102
- B(() => {
2103
- it(), ot();
2344
+ R(() => {
2345
+ pt(), ut();
2104
2346
  }, []);
2105
2347
  const a = L(null);
2106
- a.current === null && (a.current = pe());
2348
+ a.current === null && (a.current = de());
2107
2349
  const s = L(0), c = L(""), u = L(!0), d = L(t);
2108
- function p(m, h) {
2109
- a.current = m, s.current = h.length, c.current = JSON.stringify(h), u.current && (A(m), T(Array.from(m.model.surfacesMap.values())));
2350
+ function m(p, h) {
2351
+ a.current = p, s.current = h.length, c.current = JSON.stringify(h), u.current && (A(p), v(Array.from(p.model.surfacesMap.values())));
2110
2352
  }
2111
- function v(m, h) {
2353
+ function b(p, h) {
2112
2354
  if (h <= 0) return !1;
2113
- const x = JSON.stringify(m.slice(0, h)), y = c.current;
2355
+ const x = JSON.stringify(p.slice(0, h)), y = c.current;
2114
2356
  if (!y) return !0;
2115
2357
  try {
2116
- const S = JSON.parse(y);
2117
- return JSON.stringify(S.slice(0, h)) !== x;
2358
+ const C = JSON.parse(y);
2359
+ return JSON.stringify(C.slice(0, h)) !== x;
2118
2360
  } catch {
2119
2361
  return !0;
2120
2362
  }
2121
2363
  }
2122
- const [g, A] = P(
2364
+ const [g, A] = _(
2123
2365
  () => a.current
2124
- ), [E, T] = P(
2366
+ ), [N, v] = _(
2125
2367
  () => Array.from(
2126
2368
  a.current.model.surfacesMap.values()
2127
2369
  )
2128
2370
  );
2129
- return B(() => (u.current = !0, () => {
2371
+ return R(() => (u.current = !0, () => {
2130
2372
  u.current = !1;
2131
- }), []), B(() => {
2373
+ }), []), R(() => {
2132
2374
  a.current = g;
2133
- }, [g]), B(() => {
2134
- const m = () => {
2135
- u.current && T(Array.from(g.model.surfacesMap.values()));
2136
- }, h = g.onSurfaceCreated(m), x = g.onSurfaceDeleted(m);
2375
+ }, [g]), R(() => {
2376
+ const p = () => {
2377
+ u.current && v(Array.from(g.model.surfacesMap.values()));
2378
+ }, h = g.onSurfaceCreated(p), x = g.onSurfaceDeleted(p);
2137
2379
  return () => {
2138
2380
  h.unsubscribe(), x.unsubscribe();
2139
2381
  };
2140
- }, [g]), B(() => {
2141
- let m = !1;
2382
+ }, [g]), R(() => {
2383
+ let p = !1;
2142
2384
  const h = d.current !== t;
2143
2385
  if (d.current = t, h) {
2144
- const N = pe();
2145
- return Array.isArray(e) && e.length > 0 ? (N.processMessages(e), m || p(N, e)) : (a.current = N, s.current = 0, c.current = "", m || (A(N), T([]))), () => {
2146
- m = !0;
2386
+ const M = de();
2387
+ return Array.isArray(e) && e.length > 0 ? (M.processMessages(e), p || m(M, e)) : (a.current = M, s.current = 0, c.current = "", p || (A(M), v([]))), () => {
2388
+ p = !0;
2147
2389
  };
2148
2390
  }
2149
2391
  if (!Array.isArray(e) || e.length === 0) {
2150
2392
  if (s.current > 0) {
2151
- const N = pe();
2152
- a.current = N, s.current = 0, c.current = "", m || (A(N), T([]));
2393
+ const M = de();
2394
+ a.current = M, s.current = 0, c.current = "", p || (A(M), v([]));
2153
2395
  }
2154
2396
  return () => {
2155
- m = !0;
2397
+ p = !0;
2156
2398
  };
2157
2399
  }
2158
2400
  const x = a.current, y = s.current;
2159
- if (e.length < y || v(e, y)) {
2160
- const N = pe();
2161
- return N.processMessages(e), m || p(N, e), () => {
2162
- m = !0;
2401
+ if (e.length < y || b(e, y)) {
2402
+ const M = de();
2403
+ return M.processMessages(e), p || m(M, e), () => {
2404
+ p = !0;
2163
2405
  };
2164
2406
  }
2165
- const S = e.slice(y);
2166
- return S.length === 0 ? () => {
2167
- m = !0;
2168
- } : (x.processMessages(S), s.current = e.length, c.current = JSON.stringify(e), m || T(Array.from(x.model.surfacesMap.values())), () => {
2169
- m = !0;
2407
+ const C = e.slice(y);
2408
+ return C.length === 0 ? () => {
2409
+ p = !0;
2410
+ } : (x.processMessages(C), s.current = e.length, c.current = JSON.stringify(e), p || v(Array.from(x.model.surfacesMap.values())), () => {
2411
+ p = !0;
2170
2412
  });
2171
- }, [e, t]), E.length === 0 ? /* @__PURE__ */ l(X, { children: n }) : /* @__PURE__ */ l(X, { children: /* @__PURE__ */ l(Be, { resumeSearch: o, children: /* @__PURE__ */ l(Re, { caseSearch: i, children: /* @__PURE__ */ l(Ee, { interactive: r, children: /* @__PURE__ */ l("div", { className: "a2ui-surface a2ui-container", children: E.map((m) => /* @__PURE__ */ l(nt, { surface: m }, m.id)) }) }) }) }) });
2413
+ }, [e, t]), N.length === 0 ? /* @__PURE__ */ l(X, { children: n }) : /* @__PURE__ */ l(X, { children: /* @__PURE__ */ l(qe, { resumeSearch: o, children: /* @__PURE__ */ l(we, { caseSearch: i, children: /* @__PURE__ */ l(Be, { interactive: r, children: /* @__PURE__ */ l("div", { className: "a2ui-surface a2ui-container", children: N.map((p) => /* @__PURE__ */ l(lt, { surface: p }, p.id)) }) }) }) }) });
2172
2414
  }
2173
- function Xr({
2415
+ function So({
2174
2416
  payload: e,
2175
2417
  callbackUrl: t,
2176
2418
  title: n,
@@ -2179,31 +2421,31 @@ function Xr({
2179
2421
  copyMode: i = "display",
2180
2422
  onNotify: a
2181
2423
  }) {
2182
- const s = V(
2183
- () => Ct(e, t),
2424
+ const s = q(
2425
+ () => Nt(e, t),
2184
2426
  [e, t]
2185
- ), c = V(() => i === "submitFields" ? br(e, t) : s, [i, e, t, s]);
2427
+ ), c = q(() => i === "submitFields" ? Nr(e, t) : s, [i, e, t, s]);
2186
2428
  async function u() {
2187
2429
  try {
2188
- await At(c), a == null || a("success", "已复制到剪贴板");
2430
+ await Ft(c), a == null || a("success", "已复制到剪贴板");
2189
2431
  } catch {
2190
2432
  a == null || a("error", "复制失败");
2191
2433
  }
2192
2434
  }
2193
2435
  const d = i === "submitFields" ? "复制提交字段 curl(向 callback 回传)" : "复制 curl";
2194
- return /* @__PURE__ */ C("div", { className: "ask-user-curl-card", children: [
2195
- /* @__PURE__ */ C("div", { className: "ask-user-curl-card-header", children: [
2196
- /* @__PURE__ */ C("div", { className: "ask-user-curl-card-header-title", children: [
2197
- /* @__PURE__ */ l(H.Text, { type: "secondary", children: n ?? "curl 命令" }),
2436
+ return /* @__PURE__ */ k("div", { className: "ask-user-curl-card", children: [
2437
+ /* @__PURE__ */ k("div", { className: "ask-user-curl-card-header", children: [
2438
+ /* @__PURE__ */ k("div", { className: "ask-user-curl-card-header-title", children: [
2439
+ /* @__PURE__ */ l(D.Text, { type: "secondary", children: n ?? "curl 命令" }),
2198
2440
  r ? /* @__PURE__ */ l(ne, { title: r, children: /* @__PURE__ */ l(re, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
2199
2441
  o ? /* @__PURE__ */ l(ne, { title: o, children: /* @__PURE__ */ l(re, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
2200
2442
  ] }),
2201
- /* @__PURE__ */ l(ne, { title: d, children: /* @__PURE__ */ l(ge, { size: "small", type: "text", onClick: () => void u(), children: "复制" }) })
2443
+ /* @__PURE__ */ l(ne, { title: d, children: /* @__PURE__ */ l(Se, { size: "small", type: "text", onClick: () => void u(), children: "复制" }) })
2202
2444
  ] }),
2203
2445
  /* @__PURE__ */ l("pre", { className: "skopon-form-curl-json", children: s })
2204
2446
  ] });
2205
2447
  }
2206
- function Wr(e, t) {
2448
+ function bo(e, t) {
2207
2449
  if (t && typeof t == "object" && t !== null && "message" in t) {
2208
2450
  const n = t.message;
2209
2451
  if (typeof n == "string" && n.trim())
@@ -2211,7 +2453,7 @@ function Wr(e, t) {
2211
2453
  }
2212
2454
  return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
2213
2455
  }
2214
- function po({
2456
+ function Eo({
2215
2457
  payload: e,
2216
2458
  formUniqueId: t,
2217
2459
  callbackUrl: n,
@@ -2221,46 +2463,46 @@ function po({
2221
2463
  resumeSearch: a = null,
2222
2464
  caseSearch: s = null
2223
2465
  }) {
2224
- const [c, u] = P(null), [d, p] = P(!1), [v, g] = P(!0), [A, E] = P(!1), T = L(null), m = L(!0), h = L(i);
2466
+ const [c, u] = _(null), [d, m] = _(!1), [b, g] = _(!0), [A, N] = _(!1), v = L(null), p = L(!0), h = L(i);
2225
2467
  h.current = i;
2226
2468
  const x = (t == null ? void 0 : t.trim()) ?? "";
2227
- B(() => (m.current = !0, () => {
2228
- m.current = !1;
2229
- }), []), B(() => {
2230
- let F = !1;
2231
- return x ? (g(!0), p(!1), o({ formUniqueId: x }).then((z) => {
2232
- F || (p(!!z.disabled), u(z.formDefinition ?? null));
2233
- }).catch((z) => {
2234
- var b;
2235
- if (!F) {
2236
- p(!1), u(null);
2237
- const I = z instanceof Error ? z.message : "获取表单定义失败";
2238
- (b = h.current) == null || b.call(h, "error", I);
2469
+ R(() => (p.current = !0, () => {
2470
+ p.current = !1;
2471
+ }), []), R(() => {
2472
+ let P = !1;
2473
+ return x ? (g(!0), m(!1), o({ formUniqueId: x }).then((U) => {
2474
+ P || (m(!!U.disabled), u(U.formDefinition ?? null));
2475
+ }).catch((U) => {
2476
+ var S;
2477
+ if (!P) {
2478
+ m(!1), u(null);
2479
+ const F = U instanceof Error ? U.message : "获取表单定义失败";
2480
+ (S = h.current) == null || S.call(h, "error", F);
2239
2481
  }
2240
2482
  }).finally(() => {
2241
- F || g(!1);
2483
+ P || g(!1);
2242
2484
  }), () => {
2243
- F = !0;
2244
- }) : (g(!1), p(!1), u(null), () => {
2245
- F = !0;
2485
+ P = !0;
2486
+ }) : (g(!1), m(!1), u(null), () => {
2487
+ P = !0;
2246
2488
  });
2247
2489
  }, [x, o]);
2248
- const y = V(() => bt(e), [e]), S = V(() => y ? mr(y, c ?? void 0) : null, [y, c]), N = (S == null ? void 0 : S.matchedBlocks) ?? [], _ = !!(y && hr(y) && N.length === 0), j = V(() => _ && y ? gr(y) : S && S.renderBlocks.length > 0 ? S.renderBlocks : [], [S, _, y]), Q = V(
2249
- () => _ ? {} : St((S == null ? void 0 : S.extraBlocks) ?? []),
2250
- [_, S]
2251
- ), w = V(() => _ && y ? yr(y) : j.filter((F) => {
2252
- var z;
2253
- return (z = F.name) == null ? void 0 : z.trim();
2254
- }).map((F) => F.name.trim()), [_, y, j]), O = V(() => {
2255
- if (j.length === 0) return null;
2256
- const F = (S == null ? void 0 : S.title) ?? (y == null ? void 0 : y.title) ?? "", z = (S == null ? void 0 : S.description) ?? (y == null ? void 0 : y.description) ?? "";
2257
- return lr({ title: F, description: z }, j);
2258
- }, [S, y, j]), J = x ? `ask-user-${x}` : "ask-user-payload";
2259
- if (v)
2260
- return /* @__PURE__ */ l(X, { children: /* @__PURE__ */ l("div", { className: "ask-user-form-card", children: /* @__PURE__ */ l(je, { size: "small" }) }) });
2261
- if (!y || j.length === 0)
2490
+ const y = q(() => At(e), [e]), C = q(() => y ? Cr(y, c ?? void 0) : null, [y, c]), M = (C == null ? void 0 : C.matchedBlocks) ?? [], E = !!(y && kr(y) && M.length === 0), $ = q(() => E && y ? Ar(y) : C && C.renderBlocks.length > 0 ? C.renderBlocks : [], [C, E, y]), Q = q(
2491
+ () => E ? {} : Tt((C == null ? void 0 : C.extraBlocks) ?? []),
2492
+ [E, C]
2493
+ ), j = q(() => E && y ? Tr(y) : $.filter((P) => {
2494
+ var U;
2495
+ return (U = P.name) == null ? void 0 : U.trim();
2496
+ }).map((P) => P.name.trim()), [E, y, $]), w = q(() => {
2497
+ if ($.length === 0) return null;
2498
+ const P = (C == null ? void 0 : C.title) ?? (y == null ? void 0 : y.title) ?? "", U = (C == null ? void 0 : C.description) ?? (y == null ? void 0 : y.description) ?? "";
2499
+ return hr({ title: P, description: U }, $);
2500
+ }, [C, y, $]), J = x ? `ask-user-${x}` : "ask-user-payload";
2501
+ if (b)
2502
+ return /* @__PURE__ */ l(X, { children: /* @__PURE__ */ l("div", { className: "ask-user-form-card", children: /* @__PURE__ */ l(De, { size: "small" }) }) });
2503
+ if (!y || $.length === 0)
2262
2504
  return /* @__PURE__ */ l(X, { children: /* @__PURE__ */ l(
2263
- Xr,
2505
+ So,
2264
2506
  {
2265
2507
  payload: e,
2266
2508
  callbackUrl: n,
@@ -2270,44 +2512,49 @@ function po({
2270
2512
  }
2271
2513
  ) });
2272
2514
  async function Y() {
2273
- var F, z, b, I, R, M;
2515
+ var P, U, S, F, B, I, We;
2274
2516
  if (!A) {
2275
- E(!0);
2517
+ N(!0);
2276
2518
  try {
2277
- const ee = ((F = T.current) == null ? void 0 : F.getValues(w)) ?? {}, xe = { ...ee, ...Q };
2519
+ const Z = ((P = v.current) == null ? void 0 : P.getValues(j)) ?? {}, ue = $r($, Z);
2520
+ if (ue) {
2521
+ (U = h.current) == null || U.call(h, "error", ue.message);
2522
+ return;
2523
+ }
2524
+ const Rt = { ...Z, ...Q };
2278
2525
  if (r === "post") {
2279
- const Ke = (n ?? "").trim();
2280
- if (!Ke) {
2281
- (z = h.current) == null || z.call(h, "error", "callback_url 为空,无法提交");
2526
+ const Qe = (n ?? "").trim();
2527
+ if (!Qe) {
2528
+ (S = h.current) == null || S.call(h, "error", "callback_url 为空,无法提交");
2282
2529
  return;
2283
2530
  }
2284
- const Ce = await Sr(Ke, xe);
2285
- if (!m.current) return;
2286
- Ce.ok ? (b = h.current) == null || b.call(h, "success", "提交成功") : (I = h.current) == null || I.call(h, "error", Wr(Ce.status, Ce.body));
2531
+ const Ae = await Mr(Qe, Rt);
2532
+ if (!p.current) return;
2533
+ Ae.ok ? (F = h.current) == null || F.call(h, "success", "提交成功") : (B = h.current) == null || B.call(h, "error", bo(Ae.status, Ae.body));
2287
2534
  return;
2288
2535
  }
2289
- if (await At(
2290
- kt({ cardValues: ee, extraValues: Q, callbackUrl: n })
2291
- ), !m.current) return;
2292
- (R = h.current) == null || R.call(h, "success", "已复制 curl 到剪贴板");
2293
- } catch (ee) {
2294
- if (!m.current) return;
2295
- const xe = ee instanceof Error ? ee.message : "复制失败";
2296
- (M = h.current) == null || M.call(h, "error", xe);
2536
+ if (await Ft(
2537
+ Mt({ cardValues: Z, extraValues: Q, callbackUrl: n })
2538
+ ), !p.current) return;
2539
+ (I = h.current) == null || I.call(h, "success", "已复制 curl 到剪贴板");
2540
+ } catch (Z) {
2541
+ if (!p.current) return;
2542
+ const ue = Z instanceof Error ? Z.message : "复制失败";
2543
+ (We = h.current) == null || We.call(h, "error", ue);
2297
2544
  } finally {
2298
- m.current && E(!1);
2545
+ p.current && N(!1);
2299
2546
  }
2300
2547
  }
2301
2548
  }
2302
- return /* @__PURE__ */ l(X, { children: /* @__PURE__ */ C("div", { className: "ask-user-form-card", children: [
2549
+ return /* @__PURE__ */ l(X, { children: /* @__PURE__ */ k("div", { className: "ask-user-form-card", children: [
2303
2550
  d && x ? /* @__PURE__ */ l("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ l(ne, { title: x, children: /* @__PURE__ */ l(re, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
2304
2551
  /* @__PURE__ */ l(
2305
- Yr,
2552
+ vo,
2306
2553
  {
2307
- ref: T,
2308
- doc: O,
2554
+ ref: v,
2555
+ doc: w,
2309
2556
  surfaceId: J,
2310
- fieldNames: w,
2557
+ fieldNames: j,
2311
2558
  interactive: !0,
2312
2559
  wrapProvider: !1,
2313
2560
  resumeSearch: a,
@@ -2315,7 +2562,7 @@ function po({
2315
2562
  }
2316
2563
  ),
2317
2564
  /* @__PURE__ */ l("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ l(ne, { title: r === "curl" ? "点击复制 curl" : "提交 JSON 到 callback_url", children: /* @__PURE__ */ l(
2318
- ge,
2565
+ Se,
2319
2566
  {
2320
2567
  type: "primary",
2321
2568
  size: "small",
@@ -2328,43 +2575,50 @@ function po({
2328
2575
  ] }) });
2329
2576
  }
2330
2577
  export {
2331
- so as A2UI_PROTOCOL_VERSION,
2332
- po as AskUserFormCard,
2333
- Re as CaseSearchProvider,
2334
- Xr as CurlSubmitBlock,
2335
- Kt as FORM_MEDIA_SIZES,
2336
- Be as ResumeSearchProvider,
2337
- uo as SkoponA2uiStreamRenderer,
2578
+ Po as A2UI_PROTOCOL_VERSION,
2579
+ Eo as AskUserFormCard,
2580
+ we as CaseSearchProvider,
2581
+ So as CurlSubmitBlock,
2582
+ Fr as DEFAULT_AUTH_STORAGE_KEY,
2583
+ _r as DEFAULT_AUTH_TOKEN_FIELD,
2584
+ en as FORM_MEDIA_SIZES,
2585
+ qe as ResumeSearchProvider,
2586
+ zo as SkoponA2uiStreamRenderer,
2338
2587
  X as SkoponFormProvider,
2339
- Yr as SkoponFormRenderer,
2340
- or as a2uiToBlocks,
2341
- gt as blocksToA2ui,
2342
- vr as buildAskUserCurlBodyJson,
2343
- kt as buildAskUserCurlStatement,
2344
- br as buildAskUserSubmitCurlFromPayload,
2345
- lr as buildAskUserSurface,
2346
- Ct as buildCurlStatement,
2347
- At as copyTextToClipboard,
2348
- co as createFormClient,
2349
- St as extractExtraBlockValues,
2350
- cr as extractSurfaceValues,
2351
- yr as getPayloadInputFieldNames,
2352
- gr as getPayloadRenderableBlocks,
2353
- mr as intersectPayloadBlocksWithForm,
2354
- qe as isA2uiSurfaceEmpty,
2588
+ vo as SkoponFormRenderer,
2589
+ mr as a2uiToBlocks,
2590
+ Ct as blocksToA2ui,
2591
+ Ir as buildAskUserCurlBodyJson,
2592
+ Mt as buildAskUserCurlStatement,
2593
+ Nr as buildAskUserSubmitCurlFromPayload,
2594
+ hr as buildAskUserSurface,
2595
+ Nt as buildCurlStatement,
2596
+ Ft as copyTextToClipboard,
2597
+ jr as createCaseSearchClient,
2598
+ Er as createFormClient,
2599
+ wr as createResumeSearchClient,
2600
+ Uo as createSkoponSdkClients,
2601
+ Tt as extractExtraBlockValues,
2602
+ yr as extractSurfaceValues,
2603
+ Tr as getPayloadInputFieldNames,
2604
+ Ar as getPayloadRenderableBlocks,
2605
+ Cr as intersectPayloadBlocksWithForm,
2606
+ je as isA2uiSurfaceEmpty,
2355
2607
  W as isInputBlockType,
2356
- $e as isLayoutBlockType,
2357
- _e as isMediaBlockType,
2358
- sr as mapFormDefinitionFromDto,
2359
- Z as normalizeFormDefinition,
2360
- bt as parsePayloadBlocksJson,
2361
- hr as payloadHasInputBlocks,
2362
- ar as resolveSurfaceFromFormDefinition,
2363
- Jr as skoponAntdTheme,
2364
- D as skoponBrandColors,
2365
- Sr as submitFormJson,
2366
- ir as surfaceDocToMessages,
2367
- me as syncFormDefinition,
2368
- An as useCaseSearch,
2369
- _n as useResumeSearch
2608
+ be as isLayoutBlockType,
2609
+ he as isMediaBlockType,
2610
+ gr as mapFormDefinitionFromDto,
2611
+ ee as normalizeFormDefinition,
2612
+ At as parsePayloadBlocksJson,
2613
+ kr as payloadHasInputBlocks,
2614
+ Xe as resolveClientHeaders,
2615
+ zr as resolveSkoponAuthHeaders,
2616
+ fr as resolveSurfaceFromFormDefinition,
2617
+ yo as skoponAntdTheme,
2618
+ H as skoponBrandColors,
2619
+ Mr as submitFormJson,
2620
+ dr as surfaceDocToMessages,
2621
+ ge as syncFormDefinition,
2622
+ Un as useCaseSearch,
2623
+ jn as useResumeSearch
2370
2624
  };