@skopon-cool/form-sdk 0.1.3 → 0.1.5

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 (73) hide show
  1. package/README.md +2 -0
  2. package/dist/adapter/a2uiAdapter.d.ts +0 -1
  3. package/dist/adapter/a2uiAdapter.d.ts.map +1 -1
  4. package/dist/adapter/formSchema.d.ts.map +1 -1
  5. package/dist/blocks/case_multiselect/adapter.d.ts +10 -0
  6. package/dist/blocks/case_multiselect/adapter.d.ts.map +1 -0
  7. package/dist/blocks/case_multiselect/index.d.ts +3 -0
  8. package/dist/blocks/case_multiselect/index.d.ts.map +1 -0
  9. package/dist/blocks/case_singleselect/catalog.d.ts +2 -0
  10. package/dist/blocks/case_singleselect/catalog.d.ts.map +1 -0
  11. package/dist/blocks/registry.d.ts +8 -0
  12. package/dist/blocks/registry.d.ts.map +1 -0
  13. package/dist/blocks/resume_multiselect/adapter.d.ts +10 -0
  14. package/dist/blocks/resume_multiselect/adapter.d.ts.map +1 -0
  15. package/dist/blocks/resume_multiselect/catalog.d.ts +2 -0
  16. package/dist/blocks/resume_multiselect/catalog.d.ts.map +1 -0
  17. package/dist/blocks/resume_multiselect/index.d.ts +3 -0
  18. package/dist/blocks/resume_multiselect/index.d.ts.map +1 -0
  19. package/dist/blocks/types.d.ts +27 -0
  20. package/dist/blocks/types.d.ts.map +1 -0
  21. package/dist/catalog/a2uiCustomCatalog.d.ts.map +1 -1
  22. package/dist/catalog/caseSearchContext.d.ts +28 -0
  23. package/dist/catalog/caseSearchContext.d.ts.map +1 -0
  24. package/dist/catalog/resumeSearchContext.d.ts +39 -0
  25. package/dist/catalog/resumeSearchContext.d.ts.map +1 -0
  26. package/dist/catalog/skoponCaseSelect.d.ts +2 -0
  27. package/dist/catalog/skoponCaseSelect.d.ts.map +1 -0
  28. package/dist/catalog/skoponResumeSelect.d.ts +2 -0
  29. package/dist/catalog/skoponResumeSelect.d.ts.map +1 -0
  30. package/dist/components/AskUserFormCard.d.ts +7 -1
  31. package/dist/components/AskUserFormCard.d.ts.map +1 -1
  32. package/dist/components/SkoponA2uiStreamRenderer.d.ts +7 -1
  33. package/dist/components/SkoponA2uiStreamRenderer.d.ts.map +1 -1
  34. package/dist/components/SkoponFormRenderer.d.ts +6 -0
  35. package/dist/components/SkoponFormRenderer.d.ts.map +1 -1
  36. package/dist/form-sdk.css +1 -1
  37. package/dist/index.d.ts +5 -0
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +1374 -889
  40. package/dist/submit/buildCurlStatement.d.ts +1 -1
  41. package/dist/submit/buildCurlStatement.d.ts.map +1 -1
  42. package/dist/submit/intersectPayloadBlocksWithForm.d.ts.map +1 -1
  43. package/dist/types/index.d.ts +33 -2
  44. package/dist/types/index.d.ts.map +1 -1
  45. package/package.json +1 -1
  46. package/src/adapter/a2uiAdapter.test.ts +71 -0
  47. package/src/adapter/a2uiAdapter.ts +41 -4
  48. package/src/adapter/formSchema.ts +102 -19
  49. package/src/blocks/case_multiselect/adapter.ts +90 -0
  50. package/src/blocks/case_multiselect/index.ts +14 -0
  51. package/src/blocks/case_singleselect/catalog.ts +1 -0
  52. package/src/blocks/registry.ts +34 -0
  53. package/src/blocks/resume_multiselect/adapter.ts +57 -0
  54. package/src/blocks/resume_multiselect/catalog.ts +1 -0
  55. package/src/blocks/resume_multiselect/index.ts +14 -0
  56. package/src/blocks/types.ts +34 -0
  57. package/src/catalog/a2uiCustomCatalog.tsx +6 -0
  58. package/src/catalog/caseSearchContext.tsx +46 -0
  59. package/src/catalog/resumeSearchContext.tsx +58 -0
  60. package/src/catalog/skoponCaseSelect.tsx +240 -0
  61. package/src/catalog/skoponResumeSelect.tsx +293 -0
  62. package/src/components/AskUserFormCard.tsx +13 -1
  63. package/src/components/SkoponA2uiStreamRenderer.test.ts +18 -2
  64. package/src/components/SkoponA2uiStreamRenderer.test.tsx +26 -2
  65. package/src/components/SkoponA2uiStreamRenderer.tsx +71 -27
  66. package/src/components/SkoponFormRenderer.tsx +32 -10
  67. package/src/index.ts +23 -0
  68. package/src/styles/a2ui-preview.css +4 -4
  69. package/src/styles/index.css +191 -0
  70. package/src/submit/buildCurlStatement.ts +2 -23
  71. package/src/submit/intersectPayloadBlocksWithForm.ts +14 -2
  72. package/src/submit/submit.test.ts +34 -3
  73. package/src/types/index.ts +37 -0
package/dist/index.js CHANGED
@@ -1,37 +1,37 @@
1
1
  import './form-sdk.css';
2
- import { jsx as s, jsxs as M, Fragment as Ie } from "react/jsx-runtime";
3
- import { createContext as We, useContext as Ze, useCallback as ie, useSyncExternalStore as Qe, forwardRef as et, useEffect as _, useRef as w, useMemo as N, useImperativeHandle as tt, useState as O } from "react";
4
- import { Catalog as rt, MessageProcessor as Pe } from "@a2ui/web_core/v0_9";
5
- import { injectBasicCatalogStyles as we } from "@a2ui/web_core/v0_9/basic_catalog";
6
- import { basicCatalog as Z, createBinderlessComponentImplementation as E, A2uiSurface as Ne } from "@a2ui/react/v0_9";
7
- import { injectStyles as _e } from "@a2ui/react/styles";
8
- import { z as m } from "zod";
9
- import { Typography as R, Select as ue, Checkbox as nt, Radio as ot, Switch as at, TimePicker as it, DatePicker as lt, Upload as le, Input as ce, InputNumber as ct, Tooltip as Q, Tag as pe, Button as Fe, Spin as st } from "antd";
10
- import Te from "dayjs";
11
- import { FileTextOutlined as ut, FileExcelOutlined as pt, FileOutlined as Oe, PictureOutlined as dt, SoundOutlined as mt, VideoCameraOutlined as ft } from "@ant-design/icons";
12
- const en = "v0.9", ht = [
2
+ import { jsx as s, jsxs as x, Fragment as De } from "react/jsx-runtime";
3
+ import { createContext as Pe, useContext as Ee, useCallback as W, useSyncExternalStore as ht, useMemo as O, useState as E, useRef as B, useEffect as V, forwardRef as gt, useImperativeHandle as yt } from "react";
4
+ import { Spin as Ue, Button as ue, Typography as L, Avatar as vt, Tag as Z, Select as Ce, Checkbox as bt, Radio as St, Switch as kt, TimePicker as xt, DatePicker as At, Upload as ge, Input as ye, InputNumber as Tt, Tooltip as ie } from "antd";
5
+ import { ReloadOutlined as Ke, FileTextOutlined as Je, UserOutlined as Ct, FileImageOutlined as It, FileExcelOutlined as Nt, FileOutlined as He, PictureOutlined as Ft, SoundOutlined as Mt, VideoCameraOutlined as Pt } from "@ant-design/icons";
6
+ import { createBinderlessComponentImplementation as z, basicCatalog as le, A2uiSurface as Ye } from "@a2ui/react/v0_9";
7
+ import { z as d } from "zod";
8
+ import { Catalog as Et, MessageProcessor as Xe } from "@a2ui/web_core/v0_9";
9
+ import { injectBasicCatalogStyles as Ge } from "@a2ui/web_core/v0_9/basic_catalog";
10
+ import { injectStyles as We } from "@a2ui/react/styles";
11
+ import qe from "dayjs";
12
+ const Gr = "v0.9", Ut = [
13
13
  "huge",
14
14
  "large",
15
15
  "medium",
16
16
  "small",
17
17
  "icon"
18
18
  ];
19
- function de(e) {
19
+ function Ie(e) {
20
20
  return e === "image" || e === "video" || e === "audio";
21
21
  }
22
- function ve(e) {
22
+ function _e(e) {
23
23
  return e === "heading" || e === "paragraph";
24
24
  }
25
- function F(e) {
26
- return !ve(e) && !de(e);
25
+ function J(e) {
26
+ return !_e(e) && !Ie(e);
27
27
  }
28
- function vt() {
28
+ function _t() {
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") {
32
32
  const e = new Uint8Array(16);
33
33
  crypto.getRandomValues(e), e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128;
34
- const t = Array.from(e, (r) => r.toString(16).padStart(2, "0")).join("");
34
+ const t = Array.from(e, (n) => n.toString(16).padStart(2, "0")).join("");
35
35
  return `${t.slice(0, 8)}-${t.slice(8, 12)}-${t.slice(12, 16)}-${t.slice(16, 20)}-${t.slice(20)}`;
36
36
  }
37
37
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
@@ -39,11 +39,11 @@ function vt() {
39
39
  return (e === "x" ? t : t & 3 | 8).toString(16);
40
40
  });
41
41
  }
42
- function H(e) {
43
- const t = vt().replace(/-/g, "").slice(0, 8);
42
+ function ee(e) {
43
+ const t = _t().replace(/-/g, "").slice(0, 8);
44
44
  return `${e}${t}`;
45
45
  }
46
- const Ve = [
46
+ const Ze = [
47
47
  { value: "image/*", label: "图片" },
48
48
  { value: "video/*", label: "视频" },
49
49
  { value: "audio/*", label: "音频" },
@@ -54,7 +54,7 @@ const Ve = [
54
54
  { value: "text/plain", label: "纯文本" },
55
55
  { value: "application/zip", label: "ZIP 压缩包" },
56
56
  { value: "application/x-rar-compressed", label: "RAR 压缩包" }
57
- ], yt = {
57
+ ], zt = {
58
58
  "image/*": ["image/*"],
59
59
  "video/*": ["video/*"],
60
60
  "audio/*": ["audio/*"],
@@ -74,7 +74,7 @@ const Ve = [
74
74
  "text/plain": ["text/plain"],
75
75
  "application/zip": ["application/zip"],
76
76
  "application/x-rar-compressed": ["application/x-rar-compressed"]
77
- }, gt = {
77
+ }, Rt = {
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 Ve = [
85
85
  "text/plain": [".txt"],
86
86
  "application/zip": [".zip", ".7z"],
87
87
  "application/x-rar-compressed": [".rar"]
88
- }, bt = {
88
+ }, wt = {
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
- }, ye = [
95
+ }, ze = [
96
96
  { value: ".jpg", label: ".jpg" },
97
97
  { value: ".jpeg", label: ".jpeg" },
98
98
  { value: ".png", label: ".png" },
@@ -118,144 +118,166 @@ const Ve = [
118
118
  { value: ".zip", label: ".zip" },
119
119
  { value: ".rar", label: ".rar" },
120
120
  { value: ".7z", label: ".7z" }
121
- ], xt = Object.fromEntries(
122
- Ve.map((e) => [e.value, e.label])
123
- ), St = Object.fromEntries(
124
- ye.map((e) => [e.value, e.label])
125
- ), kt = new Set(Ve.map((e) => e.value)), At = new Set(
126
- ye.map((e) => e.value)
121
+ ], Ot = Object.fromEntries(
122
+ Ze.map((e) => [e.value, e.label])
123
+ ), Bt = Object.fromEntries(
124
+ ze.map((e) => [e.value, e.label])
125
+ ), Vt = new Set(Ze.map((e) => e.value)), qt = new Set(
126
+ ze.map((e) => e.value)
127
127
  );
128
- function Tt(e) {
128
+ function jt(e) {
129
129
  const t = e.trim();
130
- return t ? kt.has(t) ? t : bt[t] ?? null : null;
130
+ return t ? Vt.has(t) ? t : wt[t] ?? null : null;
131
131
  }
132
- function Ct(e) {
132
+ function Lt(e) {
133
133
  return Array.isArray(e) ? e.map((t) => {
134
- const r = t.trim().toLowerCase();
135
- return r ? r.startsWith(".") ? r : `.${r}` : "";
134
+ const n = t.trim().toLowerCase();
135
+ return n ? n.startsWith(".") ? n : `.${n}` : "";
136
136
  }).filter(Boolean) : [];
137
137
  }
138
- function Y(e) {
138
+ function te(e) {
139
139
  if (!Array.isArray(e)) return [];
140
- const t = [], r = /* @__PURE__ */ new Set();
141
- for (const n of e) {
142
- const o = Tt(n);
143
- o && !r.has(o) && (r.add(o), t.push(o));
140
+ const t = [], n = /* @__PURE__ */ new Set();
141
+ for (const r of e) {
142
+ const o = jt(r);
143
+ o && !n.has(o) && (n.add(o), t.push(o));
144
144
  }
145
145
  return t;
146
146
  }
147
- function Mt(e) {
148
- const t = Y(e), r = [];
149
- for (const n of t)
150
- r.push(...yt[n] ?? [n]);
151
- return r;
147
+ function $t(e) {
148
+ const t = te(e), n = [];
149
+ for (const r of t)
150
+ n.push(...zt[r] ?? [r]);
151
+ return n;
152
152
  }
153
- function Et(e) {
154
- const t = Y(e);
153
+ function Dt(e) {
154
+ const t = te(e);
155
155
  if (t.length === 0) return [];
156
- const r = /* @__PURE__ */ new Set();
157
- for (const n of t)
158
- for (const o of gt[n] ?? [])
159
- r.add(o);
160
- return ye.filter((n) => r.has(n.value));
161
- }
162
- function ge(e, t) {
163
- const r = Ct(t), n = Y(e);
164
- if (n.length === 0)
165
- return r.filter((i) => At.has(i));
156
+ const n = /* @__PURE__ */ new Set();
157
+ for (const r of t)
158
+ for (const o of Rt[r] ?? [])
159
+ n.add(o);
160
+ return ze.filter((r) => n.has(r.value));
161
+ }
162
+ function Re(e, t) {
163
+ const n = Lt(t), r = te(e);
164
+ if (r.length === 0)
165
+ return n.filter((a) => qt.has(a));
166
166
  const o = new Set(
167
- Et(n).map((i) => i.value)
167
+ Dt(r).map((a) => a.value)
168
168
  );
169
- return r.filter((i) => o.has(i));
169
+ return n.filter((a) => o.has(a));
170
170
  }
171
- function It(e, t) {
172
- const r = Mt(e), n = ge(e, t), o = [...r, ...n];
171
+ function Kt(e, t) {
172
+ const n = $t(e), r = Re(e, t), o = [...n, ...r];
173
173
  return o.length > 0 ? o.join(",") : void 0;
174
174
  }
175
- function Pt(e, t) {
176
- const r = Y(e), n = ge(
177
- r,
175
+ function Jt(e, t) {
176
+ const n = te(e), r = Re(
177
+ n,
178
178
  t
179
179
  ), o = [
180
- ...r.map((i) => xt[i] ?? i),
181
- ...n.map((i) => St[i] ?? i)
180
+ ...n.map((a) => Ot[a] ?? a),
181
+ ...r.map((a) => Bt[a] ?? a)
182
182
  ];
183
183
  return o.length === 0 ? null : o.join("、");
184
184
  }
185
- const wt = [
185
+ const Ht = [
186
186
  "video",
187
187
  "audio",
188
188
  "image",
189
189
  "file",
190
190
  "spreadsheet",
191
191
  "document"
192
- ], Nt = new Set(wt);
193
- function _t(e) {
194
- return e && Nt.has(e) ? e : "file";
192
+ ], Yt = new Set(Ht);
193
+ function Xt(e) {
194
+ return e && Yt.has(e) ? e : "file";
195
195
  }
196
- function J(e) {
197
- return typeof e == "string" && ht.includes(e) ? e : "medium";
196
+ function ne(e) {
197
+ return typeof e == "string" && Ut.includes(e) ? e : "medium";
198
198
  }
199
- function Ft(e, t) {
199
+ function Gt(e, t) {
200
200
  var o;
201
- const r = Math.max(1, t);
202
- let n = [];
203
- return Array.isArray(e.mediaUrls) ? n = e.mediaUrls.map((i) => String(i).trim()) : (o = e.mediaUrl) != null && o.trim() && (n = [e.mediaUrl.trim()]), n.length === 0 ? [""] : n.slice(0, r);
201
+ const n = Math.max(1, t);
202
+ let r = [];
203
+ return Array.isArray(e.mediaUrls) ? r = e.mediaUrls.map((a) => String(a).trim()) : (o = e.mediaUrl) != null && o.trim() && (r = [e.mediaUrl.trim()]), r.length === 0 ? [""] : r.slice(0, n);
204
204
  }
205
- function Ot(e) {
205
+ function Wt(e) {
206
206
  var t;
207
- return Array.isArray(e.mediaUrls) ? e.mediaUrls.map((r) => r.trim()).filter(Boolean) : (t = e.mediaUrl) != null && t.trim() ? [e.mediaUrl.trim()] : [];
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 Vt(e) {
210
- return `form-media-size-${J(e)}`;
209
+ function Zt(e) {
210
+ return `form-media-size-${ne(e)}`;
211
211
  }
212
- function Bt(e) {
213
- return `form-media-preview form-media-list ${Vt(e)}`;
212
+ function Qt(e) {
213
+ return `form-media-preview form-media-list ${Zt(e)}`;
214
214
  }
215
- const jt = 10;
216
- function be(e) {
215
+ const en = 10;
216
+ function we(e) {
217
217
  return e === !0 || e === "true";
218
218
  }
219
- function Ce(e, t = 1) {
220
- const r = typeof e == "number" ? e : Number(e);
221
- return Number.isFinite(r) ? Math.max(0, Math.floor(r)) : t;
219
+ function je(e, t = 1) {
220
+ const n = typeof e == "number" ? e : Number(e);
221
+ return Number.isFinite(n) ? Math.max(0, Math.floor(n)) : t;
222
222
  }
223
- function Lt(e, t) {
223
+ function tn(e, t) {
224
224
  if (t !== void 0)
225
- return e === "toggle" ? be(t) : e === "multiselect" || e === "checkbox" ? 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);
225
+ return e === "toggle" ? we(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);
226
226
  }
227
- function zt(e) {
228
- var n, o;
229
- const t = Y(e.fileAcceptTypes), r = e.type;
227
+ function nn(e) {
228
+ 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, a = typeof (e == null ? void 0 : e.flowType) == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, l = typeof (e == null ? void 0 : e.category) == "string" && e.category.trim() ? e.category.trim() : void 0, i = Array.isArray(e == null ? void 0 : e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
229
+ return { agentKind: r, agentUniqueId: o, flowType: a, category: l, flowUniqueIds: i, pageSize: n };
230
+ }
231
+ function rn(e) {
232
+ 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;
233
+ return {
234
+ names: Array.isArray(e == null ? void 0 : e.names) ? e.names.map(String).filter(Boolean) : [],
235
+ agentUniqueIds: Array.isArray(e == null ? void 0 : e.agentUniqueIds) ? e.agentUniqueIds.map(String).filter(Boolean) : [],
236
+ resumeUniqueIds: Array.isArray(e == null ? void 0 : e.resumeUniqueIds) ? e.resumeUniqueIds.map(String).filter(Boolean) : [],
237
+ pageSize: n
238
+ };
239
+ }
240
+ function on(e) {
241
+ if (e.type !== "case_singleselect") return e;
242
+ const t = typeof e.defaultValue == "string" && e.defaultValue.trim() ? [e.defaultValue.trim()] : Array.isArray(e.defaultValue) ? e.defaultValue.map(String).filter(Boolean) : [];
243
+ return { ...e, type: "case_multiselect", defaultValue: t };
244
+ }
245
+ function an(e) {
246
+ var o, a;
247
+ const t = on(e), n = te(t.fileAcceptTypes), r = t.type;
230
248
  return {
231
- id: ((n = e.id) == null ? void 0 : n.trim()) || H("block-"),
249
+ id: ((o = t.id) == null ? void 0 : o.trim()) || ee("block-"),
232
250
  type: r,
233
- name: ((o = e.name) == null ? void 0 : o.trim()) || void 0,
234
- label: e.label ?? "",
235
- placeholder: e.placeholder ?? "",
236
- help: e.help ?? "",
237
- required: e.required === !0,
238
- mediaUrls: de(r) ? Ft(e, jt) : void 0,
239
- mediaSize: de(r) ? J(e.mediaSize) : void 0,
240
- fileAcceptTypes: t,
241
- fileAcceptExtensions: ge(
242
- t,
243
- e.fileAcceptExtensions
251
+ name: ((a = t.name) == null ? void 0 : a.trim()) || void 0,
252
+ label: t.label ?? "",
253
+ placeholder: t.placeholder ?? "",
254
+ help: t.help ?? "",
255
+ required: t.required === !0,
256
+ mediaUrls: Ie(r) ? Gt(t, en) : void 0,
257
+ mediaSize: Ie(r) ? ne(t.mediaSize) : void 0,
258
+ fileAcceptTypes: n,
259
+ fileAcceptExtensions: Re(
260
+ n,
261
+ t.fileAcceptExtensions
244
262
  ),
245
- filePlaceholderIcon: _t(e.filePlaceholderIcon),
246
- fileMinCount: r === "file" ? Ce(e.fileMinCount, 1) : void 0,
247
- fileMaxCount: r === "file" ? Ce(e.fileMaxCount, 1) : void 0,
248
- defaultValue: Lt(r, e.defaultValue),
249
- options: Array.isArray(e.options) ? e.options.map((i, a) => {
250
- var l, c;
263
+ filePlaceholderIcon: Xt(t.filePlaceholderIcon),
264
+ fileMinCount: r === "file" ? je(t.fileMinCount, 1) : void 0,
265
+ fileMaxCount: r === "file" ? je(t.fileMaxCount, 1) : void 0,
266
+ defaultValue: tn(r, t.defaultValue),
267
+ options: Array.isArray(t.options) ? t.options.map((l, i) => {
268
+ var c, u;
251
269
  return {
252
- value: ((l = i.value) == null ? void 0 : l.trim()) || `option_${a + 1}`,
253
- label: ((c = i.label) == null ? void 0 : c.trim()) || `选项 ${a + 1}`
270
+ value: ((c = l.value) == null ? void 0 : c.trim()) || `option_${i + 1}`,
271
+ label: ((u = l.label) == null ? void 0 : u.trim()) || `选项 ${i + 1}`
254
272
  };
255
- }) : void 0
273
+ }) : void 0,
274
+ resumeEnableRefresh: r === "resume_multiselect" ? t.resumeEnableRefresh !== !1 : void 0,
275
+ resumeFilter: r === "resume_multiselect" ? rn(t.resumeFilter) : void 0,
276
+ caseEnableRefresh: r === "case_multiselect" ? t.caseEnableRefresh !== !1 : void 0,
277
+ caseFilter: r === "case_multiselect" ? nn(t.caseFilter) : void 0
256
278
  };
257
279
  }
258
- function ee(e) {
280
+ function se(e) {
259
281
  return {
260
282
  title: e.title ?? "",
261
283
  description: e.description ?? "",
@@ -263,176 +285,636 @@ function ee(e) {
263
285
  jsonSchema: e.jsonSchema ?? {}
264
286
  };
265
287
  }
266
- function B(e) {
288
+ function H(e) {
267
289
  if (!e || !Array.isArray(e.blocks))
268
- return ee({ title: "", description: "", blocks: [], jsonSchema: {} });
269
- const t = e.blocks.map(zt);
270
- return ee({
290
+ return se({ title: "", description: "", blocks: [], jsonSchema: {} });
291
+ const t = e.blocks.map(an);
292
+ return se({
271
293
  title: typeof e.title == "string" ? e.title : "",
272
294
  description: typeof e.description == "string" ? e.description : "",
273
295
  blocks: t,
274
296
  jsonSchema: {}
275
297
  });
276
298
  }
277
- const te = "root", me = "__title__", fe = "__desc__", Be = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
278
- function Ut(e) {
299
+ function ln(e) {
300
+ 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, a = typeof e.category == "string" && e.category.trim() ? e.category.trim() : void 0, l = Array.isArray(e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
301
+ return {
302
+ agentKind: n,
303
+ agentUniqueId: r,
304
+ flowType: o,
305
+ category: a,
306
+ flowUniqueIds: l,
307
+ pageSize: Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20
308
+ };
309
+ }
310
+ function sn(e, t) {
311
+ var l, i, c, u, m, p;
312
+ const { id: n, label: r, path: o, withData: a } = t;
313
+ return a({
314
+ id: n,
315
+ component: "SkoponCaseSelect",
316
+ label: r,
317
+ placeholder: e.placeholder ?? "",
318
+ help: e.help ?? "",
319
+ enableRefresh: e.caseEnableRefresh !== !1,
320
+ caseFilter: {
321
+ agentKind: (l = e.caseFilter) == null ? void 0 : l.agentKind,
322
+ agentUniqueId: (i = e.caseFilter) == null ? void 0 : i.agentUniqueId,
323
+ flowType: (c = e.caseFilter) == null ? void 0 : c.flowType,
324
+ category: (u = e.caseFilter) == null ? void 0 : u.category,
325
+ flowUniqueIds: ((m = e.caseFilter) == null ? void 0 : m.flowUniqueIds) ?? [],
326
+ pageSize: ((p = e.caseFilter) == null ? void 0 : p.pageSize) ?? 20
327
+ },
328
+ value: { path: o }
329
+ });
330
+ }
331
+ function cn(e, t, n) {
332
+ const r = n.nameFromValue(e.value), o = {
333
+ ...t("case_multiselect"),
334
+ name: r,
335
+ caseEnableRefresh: e.enableRefresh !== !1
336
+ }, a = n.asLiteral(e.placeholder);
337
+ a && (o.placeholder = a);
338
+ const l = n.asLiteral(e.help);
339
+ return l && (o.help = l), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = ln(e.caseFilter)), o;
340
+ }
341
+ const Qe = Pe({ interactive: !0 });
342
+ function et({
343
+ interactive: e,
344
+ children: t
345
+ }) {
346
+ return /* @__PURE__ */ s(Qe.Provider, { value: { interactive: e }, children: t });
347
+ }
348
+ function $() {
349
+ return Ee(Qe);
350
+ }
351
+ function tt(e) {
352
+ return e && typeof e == "object" && "path" in e && String(e.path ?? "").trim() || null;
353
+ }
354
+ function Le(e, t = "value") {
355
+ const r = e.componentModel.properties[t];
356
+ if (!(!tt(r) || r === void 0))
357
+ return e.dataContext.resolveDynamicValue(r);
358
+ }
359
+ function D(e, t = "value") {
360
+ const r = e.componentModel.properties[t], o = tt(r), a = W(
361
+ (u) => {
362
+ if (!o || r === void 0) return () => {
363
+ };
364
+ const m = e.dataContext.subscribeDynamicValue(r, () => u());
365
+ return () => m.unsubscribe();
366
+ },
367
+ [e, r, o]
368
+ ), l = W(() => {
369
+ if (!(!o || r === void 0))
370
+ return e.dataContext.resolveDynamicValue(r);
371
+ }, [e, r, o]), i = ht(a, l, l), c = W(
372
+ (u) => {
373
+ !o || !r || typeof r != "object" || !("path" in r) || e.dataContext.set(String(r.path), u);
374
+ },
375
+ [e, r, o]
376
+ );
377
+ return { value: i, setValue: c, hasBinding: !!o };
378
+ }
379
+ function Q(e) {
380
+ if (typeof e == "string") return e || void 0;
381
+ if (typeof e == "number") return String(e);
382
+ }
383
+ function j(e) {
384
+ return Array.isArray(e) ? e.map(String) : typeof e == "string" && e ? [e] : [];
385
+ }
386
+ const nt = Pe(null);
387
+ function rt({
388
+ caseSearch: e,
389
+ children: t
390
+ }) {
391
+ return /* @__PURE__ */ s(nt.Provider, { value: e ?? null, children: t });
392
+ }
393
+ function un() {
394
+ return Ee(nt);
395
+ }
396
+ function ve(e) {
397
+ return typeof e == "string" ? e : "";
398
+ }
399
+ function be(e) {
400
+ if (!e || typeof e != "object")
401
+ return { flowUniqueIds: [], pageSize: 20 };
402
+ 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, a = typeof t.agentUniqueId == "string" && t.agentUniqueId.trim() ? t.agentUniqueId.trim() : void 0, l = typeof t.flowType == "string" && t.flowType.trim() ? t.flowType.trim() : void 0, i = typeof t.category == "string" && t.category.trim() ? t.category.trim() : void 0, c = Array.isArray(t.flowUniqueIds) ? t.flowUniqueIds.map(String).filter(Boolean) : [];
403
+ return { agentKind: o, agentUniqueId: a, flowType: l, category: i, flowUniqueIds: c, pageSize: r };
404
+ }
405
+ function Se(e) {
406
+ var r;
407
+ const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!(e.agentUniqueId && e.flowType && e.category);
408
+ return t || n;
409
+ }
410
+ function pn(e) {
411
+ return JSON.stringify(e);
412
+ }
413
+ const mn = {
414
+ name: "SkoponCaseSelect",
415
+ schema: d.object({
416
+ label: d.any().optional(),
417
+ placeholder: d.any().optional(),
418
+ help: d.any().optional(),
419
+ enableRefresh: d.any().optional(),
420
+ caseFilter: d.any().optional(),
421
+ value: d.any().optional()
422
+ }).passthrough()
423
+ };
424
+ function dn({
425
+ item: e,
426
+ selected: t,
427
+ disabled: n,
428
+ onToggle: r
429
+ }) {
430
+ return /* @__PURE__ */ x(
431
+ "button",
432
+ {
433
+ type: "button",
434
+ className: `skopon-resume-select-card${t ? " skopon-resume-select-card--selected" : ""}`,
435
+ disabled: n,
436
+ onClick: r,
437
+ children: [
438
+ /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ s(Je, { style: { fontSize: 24, color: "var(--color-primary, #1677ff)" } }) }),
439
+ /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-body", children: [
440
+ /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-name", children: e.name }),
441
+ e.description ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-desc", children: e.description }) : null,
442
+ /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-meta", children: [
443
+ e.caseUniqueId,
444
+ e.platform ? ` · ${e.platform}` : "",
445
+ e.link ? ` · ${e.link}` : ""
446
+ ] })
447
+ ] })
448
+ ]
449
+ }
450
+ );
451
+ }
452
+ function fn({ context: e }) {
453
+ const { interactive: t } = $(), n = un(), { value: r, setValue: o } = D(e), a = e.componentModel.properties, l = ve(a.label), i = ve(a.placeholder), c = ve(a.help), u = a.enableRefresh !== !1, m = O(() => be(a.caseFilter), [a.caseFilter]), p = pn(m), [y, S] = E(1), [C, F] = E(!1), [T, f] = E(""), [h, k] = E([]), [v, b] = E(0), [P, R] = E(m.pageSize ?? 20), _ = B(0), w = j(r), q = O(() => n ? Se(m) ? T || i || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, m, T, i]), K = W(
454
+ async (g) => {
455
+ const A = be(JSON.parse(p)), M = ++_.current;
456
+ if (!n || !Se(A)) {
457
+ k([]), b(0), f("");
458
+ return;
459
+ }
460
+ F(!0), f("");
461
+ try {
462
+ const I = await n({ filter: A, page: g });
463
+ if (M !== _.current) return;
464
+ k(I.list), b(I.total), S(I.page), R(I.pageSize);
465
+ } catch (I) {
466
+ if (M !== _.current) return;
467
+ k([]), b(0), f(I instanceof Error ? I.message : "加载案例列表失败");
468
+ } finally {
469
+ M === _.current && F(!1);
470
+ }
471
+ },
472
+ [n, p]
473
+ );
474
+ V(() => {
475
+ S(1), K(1);
476
+ }, [p, K]);
477
+ const Y = (g) => {
478
+ if (!t) return;
479
+ const A = w.includes(g) ? w.filter((M) => M !== g) : [...w, g];
480
+ o(A);
481
+ }, X = () => {
482
+ const g = be(JSON.parse(p)), A = P || g.pageSize || 20, M = Math.max(1, Math.ceil(v / A)), I = y >= M ? 1 : y + 1;
483
+ K(I);
484
+ };
485
+ return /* @__PURE__ */ x("div", { className: "form-block-preview skopon-resume-select", children: [
486
+ l ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: l }) : null,
487
+ C && h.length === 0 ? /* @__PURE__ */ x("div", { className: "skopon-resume-select-status", children: [
488
+ /* @__PURE__ */ s(Ue, { size: "small" }),
489
+ " 加载案例…"
490
+ ] }) : null,
491
+ !C && h.length === 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-empty", children: q }) : null,
492
+ h.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-list", children: h.map((g) => /* @__PURE__ */ s(
493
+ dn,
494
+ {
495
+ item: g,
496
+ selected: w.includes(g.caseUniqueId),
497
+ disabled: !t,
498
+ onToggle: () => Y(g.caseUniqueId)
499
+ },
500
+ g.caseUniqueId
501
+ )) }) : null,
502
+ u && n && Se(m) ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ s(
503
+ ue,
504
+ {
505
+ type: "default",
506
+ size: "small",
507
+ icon: /* @__PURE__ */ s(Ke, {}),
508
+ loading: C,
509
+ disabled: !t,
510
+ onClick: X,
511
+ children: "换一批"
512
+ }
513
+ ) }) : null,
514
+ c ? /* @__PURE__ */ s(L.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
515
+ ] });
516
+ }
517
+ const hn = z(
518
+ mn,
519
+ fn
520
+ ), gn = {
521
+ type: "case_multiselect",
522
+ componentName: "SkoponCaseSelect",
523
+ toComponent: sn,
524
+ fromComponent: cn,
525
+ catalogComponents: [hn]
526
+ };
527
+ function yn(e, t) {
528
+ var l, i, c, u;
529
+ const { id: n, label: r, path: o, withData: a } = t;
530
+ return a({
531
+ id: n,
532
+ component: "SkoponResumeSelect",
533
+ label: r,
534
+ placeholder: e.placeholder ?? "",
535
+ help: e.help ?? "",
536
+ enableRefresh: e.resumeEnableRefresh !== !1,
537
+ resumeFilter: {
538
+ names: ((l = e.resumeFilter) == null ? void 0 : l.names) ?? [],
539
+ agentUniqueIds: ((i = e.resumeFilter) == null ? void 0 : i.agentUniqueIds) ?? [],
540
+ resumeUniqueIds: ((c = e.resumeFilter) == null ? void 0 : c.resumeUniqueIds) ?? [],
541
+ pageSize: ((u = e.resumeFilter) == null ? void 0 : u.pageSize) ?? 20
542
+ },
543
+ value: { path: o }
544
+ });
545
+ }
546
+ function vn(e, t, n) {
547
+ const r = n.nameFromValue(e.value), o = {
548
+ ...t("resume_multiselect"),
549
+ name: r,
550
+ resumeEnableRefresh: e.enableRefresh !== !1
551
+ }, a = n.asLiteral(e.placeholder);
552
+ a && (o.placeholder = a);
553
+ const l = n.asLiteral(e.help);
554
+ if (l && (o.help = l), e.resumeFilter && typeof e.resumeFilter == "object") {
555
+ const i = e.resumeFilter;
556
+ o.resumeFilter = {
557
+ names: Array.isArray(i.names) ? i.names.map(String) : [],
558
+ agentUniqueIds: Array.isArray(i.agentUniqueIds) ? i.agentUniqueIds.map(String) : [],
559
+ resumeUniqueIds: Array.isArray(i.resumeUniqueIds) ? i.resumeUniqueIds.map(String) : [],
560
+ pageSize: typeof i.pageSize == "number" ? i.pageSize : 20
561
+ };
562
+ }
563
+ return o;
564
+ }
565
+ const ot = Pe(null);
566
+ function at({
567
+ resumeSearch: e,
568
+ children: t
569
+ }) {
570
+ return /* @__PURE__ */ s(ot.Provider, { value: e ?? null, children: t });
571
+ }
572
+ function bn() {
573
+ return Ee(ot);
574
+ }
575
+ function ke(e) {
576
+ return typeof e == "string" ? e : "";
577
+ }
578
+ function xe(e) {
579
+ if (!e || typeof e != "object")
580
+ return { names: [], agentUniqueIds: [], resumeUniqueIds: [], pageSize: 20 };
581
+ 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) : [], a = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), l = Number.isFinite(a) && a >= 1 && a <= 100 ? Math.floor(a) : 20;
582
+ return { names: n, agentUniqueIds: r, resumeUniqueIds: o, pageSize: l };
583
+ }
584
+ function Sn(e) {
585
+ return JSON.stringify(e);
586
+ }
587
+ const kn = {
588
+ name: "SkoponResumeSelect",
589
+ schema: d.object({
590
+ label: d.any().optional(),
591
+ placeholder: d.any().optional(),
592
+ help: d.any().optional(),
593
+ enableRefresh: d.any().optional(),
594
+ resumeFilter: d.any().optional(),
595
+ value: d.any().optional()
596
+ }).passthrough()
597
+ }, xn = 3, An = 2;
598
+ function Ae(e, t) {
599
+ const n = (t ?? []).filter(Boolean), r = n.slice(0, xn), o = n.length - r.length;
600
+ return /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-tags", children: [
601
+ /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-tags-label", children: e }),
602
+ n.length > 0 ? /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-tags-list", children: [
603
+ r.map((a) => /* @__PURE__ */ s(Z, { className: "skopon-resume-select-card-tag", children: a }, a)),
604
+ o > 0 ? /* @__PURE__ */ x(Z, { className: "skopon-resume-select-card-tag", children: [
605
+ "+",
606
+ o
607
+ ] }) : null
608
+ ] }) : /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-tags-empty", children: "暂无" })
609
+ ] });
610
+ }
611
+ function Tn(e) {
612
+ return /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-field", children: [
613
+ /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-tags-label", children: "满意度" }),
614
+ /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-field-value", children: typeof e == "number" ? `${e}%` : "暂无" })
615
+ ] });
616
+ }
617
+ function Cn({ work: e }) {
618
+ return /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-work", children: [
619
+ /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ s("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ s(It, { className: "skopon-resume-select-card-work-placeholder" }) }),
620
+ /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-work-title", children: e.title || "未命名作品" })
621
+ ] });
622
+ }
623
+ function In({
624
+ item: e,
625
+ selected: t,
626
+ disabled: n,
627
+ onToggle: r
628
+ }) {
629
+ const o = (e.works ?? []).slice(0, An);
630
+ return /* @__PURE__ */ x(
631
+ "button",
632
+ {
633
+ type: "button",
634
+ className: `skopon-resume-select-card skopon-resume-select-card--profile${t ? " skopon-resume-select-card--selected" : ""}`,
635
+ disabled: n,
636
+ onClick: r,
637
+ children: [
638
+ /* @__PURE__ */ s(
639
+ vt,
640
+ {
641
+ size: 48,
642
+ src: e.avatarUrl || void 0,
643
+ icon: e.avatarUrl ? void 0 : /* @__PURE__ */ s(Ct, {}),
644
+ className: "skopon-resume-select-card-avatar"
645
+ }
646
+ ),
647
+ /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-name", children: e.name || "未命名简历" }),
648
+ /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-body", children: [
649
+ Tn(e.satisfaction),
650
+ Ae("性格", e.personality),
651
+ Ae("专长", e.specialties),
652
+ Ae("擅长领域", e.traits),
653
+ /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-works", children: [
654
+ /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-works-label", children: "过往作品" }),
655
+ o.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-works-list", children: o.map((a, l) => /* @__PURE__ */ s(Cn, { work: a }, `${a.title}-${l}`)) }) : /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
656
+ ] })
657
+ ] })
658
+ ]
659
+ }
660
+ );
661
+ }
662
+ function Nn({ context: e }) {
663
+ const { interactive: t } = $(), n = bn(), { value: r, setValue: o } = D(e), a = e.componentModel.properties, l = ke(a.label), i = ke(a.placeholder), c = ke(a.help), u = a.enableRefresh !== !1, m = O(() => xe(a.resumeFilter), [a.resumeFilter]), p = Sn(m), [y, S] = E(1), [C, F] = E(!1), [T, f] = E(""), [h, k] = E([]), [v, b] = E(0), [P, R] = E(m.pageSize ?? 20), _ = B(0), w = j(r), q = W(
664
+ async (g) => {
665
+ const A = xe(JSON.parse(p)), M = ++_.current;
666
+ if (!n) {
667
+ k([]), b(0), f("未配置简历搜索服务");
668
+ return;
669
+ }
670
+ F(!0), f("");
671
+ try {
672
+ const I = await n({ filter: A, page: g });
673
+ if (M !== _.current) return;
674
+ k(I.list), b(I.total), S(I.page), R(I.pageSize);
675
+ } catch (I) {
676
+ if (M !== _.current) return;
677
+ k([]), b(0), f(I instanceof Error ? I.message : "加载简历列表失败");
678
+ } finally {
679
+ M === _.current && F(!1);
680
+ }
681
+ },
682
+ [n, p]
683
+ );
684
+ V(() => {
685
+ S(1), q(1);
686
+ }, [p, q]);
687
+ const K = (g) => {
688
+ if (!t) return;
689
+ const A = w.includes(g) ? w.filter((M) => M !== g) : [...w, g];
690
+ o(A);
691
+ }, Y = () => {
692
+ const g = xe(JSON.parse(p)), A = P || g.pageSize || 20, M = Math.max(1, Math.ceil(v / A)), I = y >= M ? 1 : y + 1;
693
+ q(I);
694
+ }, X = i || "暂无匹配的简历";
695
+ return /* @__PURE__ */ x("div", { className: "form-block-preview skopon-resume-select", children: [
696
+ l ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: l }) : null,
697
+ C && h.length === 0 ? /* @__PURE__ */ x("div", { className: "skopon-resume-select-status", children: [
698
+ /* @__PURE__ */ s(Ue, { size: "small" }),
699
+ " 加载简历…"
700
+ ] }) : null,
701
+ !C && T ? /* @__PURE__ */ s(L.Text, { type: "danger", className: "skopon-resume-select-status", children: T }) : null,
702
+ !C && !T && h.length === 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-empty", children: X }) : null,
703
+ h.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-list", children: h.map((g) => /* @__PURE__ */ s(
704
+ In,
705
+ {
706
+ item: g,
707
+ selected: w.includes(g.resumeUniqueId),
708
+ disabled: !t,
709
+ onToggle: () => K(g.resumeUniqueId)
710
+ },
711
+ g.resumeUniqueId
712
+ )) }) : null,
713
+ u && n ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ s(
714
+ ue,
715
+ {
716
+ type: "default",
717
+ size: "small",
718
+ icon: /* @__PURE__ */ s(Ke, {}),
719
+ loading: C,
720
+ disabled: !t,
721
+ onClick: Y,
722
+ children: "换一批"
723
+ }
724
+ ) }) : null,
725
+ c ? /* @__PURE__ */ s(L.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
726
+ ] });
727
+ }
728
+ const Fn = z(
729
+ kn,
730
+ Nn
731
+ ), Mn = {
732
+ type: "resume_multiselect",
733
+ componentName: "SkoponResumeSelect",
734
+ toComponent: yn,
735
+ fromComponent: vn,
736
+ catalogComponents: [Fn]
737
+ }, pe = [Mn, gn], Pn = new Map(
738
+ pe.map((e) => [e.type, e])
739
+ ), En = new Map(
740
+ pe.map((e) => [e.componentName, e])
741
+ );
742
+ function Un(e) {
743
+ return Pn.get(e);
744
+ }
745
+ function _n(e) {
746
+ return En.get(e);
747
+ }
748
+ function zn() {
749
+ return pe.flatMap((e) => e.catalogComponents);
750
+ }
751
+ function Rn() {
752
+ return pe.map((e) => e.componentName);
753
+ }
754
+ const ce = "root", Ne = "__title__", Fe = "__desc__", lt = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
755
+ function wn(e) {
279
756
  return `/${e}`;
280
757
  }
281
- function $t(e) {
758
+ function $e(e) {
282
759
  return e && typeof e == "object" && "path" in e ? String(e.path ?? "").replace(/^\//, "") : "";
283
760
  }
284
- function S(e) {
761
+ function U(e) {
285
762
  if (typeof e == "string") return e;
286
763
  }
287
- function Rt(e) {
288
- const t = e.id || H("a2-"), r = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
764
+ function On(e) {
765
+ const t = e.id || ee("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
289
766
  return {
290
767
  id: t,
291
768
  component: "SkoponMedia",
292
- mediaType: r,
293
- urls: Ot(e),
294
- mediaSize: J(e.mediaSize),
769
+ mediaType: n,
770
+ urls: Wt(e),
771
+ mediaSize: ne(e.mediaSize),
295
772
  label: e.label ?? "",
296
773
  help: e.help ?? "",
297
774
  placeholder: e.placeholder ?? ""
298
775
  };
299
776
  }
300
- function Dt(e) {
777
+ function Bn(e) {
301
778
  if (Array.isArray(e.urls))
302
- return e.urls.map((r) => String(r).trim()).filter(Boolean);
303
- const t = S(e.url);
779
+ return e.urls.map((n) => String(n).trim()).filter(Boolean);
780
+ const t = U(e.url);
304
781
  return t != null && t.trim() ? [t.trim()] : [];
305
782
  }
306
- function K(e, t, r) {
307
- const n = typeof e.id == "string" ? e.id : H("block-"), o = Dt(e), i = S(e.label) ?? S(e.description) ?? r, a = S(e.help), l = S(e.placeholder), c = J(e.mediaSize);
783
+ function oe(e, t, n) {
784
+ const r = typeof e.id == "string" ? e.id : ee("block-"), o = Bn(e), a = U(e.label) ?? U(e.description) ?? n, l = U(e.help), i = U(e.placeholder), c = ne(e.mediaSize);
308
785
  return {
309
- id: n,
786
+ id: r,
310
787
  type: t,
311
- label: i,
312
- ...a ? { help: a } : {},
313
- ...l ? { placeholder: l } : {},
788
+ label: a,
789
+ ...l ? { help: l } : {},
790
+ ...i ? { placeholder: i } : {},
314
791
  mediaSize: c,
315
792
  mediaUrls: o.length > 0 ? o : [""]
316
793
  };
317
794
  }
318
- function Ht(e) {
795
+ function Vn(e) {
319
796
  switch (e.type) {
320
797
  case "toggle":
321
- return be(e.defaultValue);
798
+ return we(e.defaultValue);
322
799
  case "multiselect":
323
800
  case "checkbox":
801
+ case "resume_multiselect":
802
+ case "case_multiselect":
324
803
  return Array.isArray(e.defaultValue) ? e.defaultValue : typeof e.defaultValue == "string" && e.defaultValue ? [e.defaultValue] : [];
325
804
  case "select":
326
805
  case "radio":
327
- return Array.isArray(e.defaultValue) ? e.defaultValue[0] ?? "" : typeof e.defaultValue == "string" ? e.defaultValue : "";
806
+ case "number":
807
+ return typeof e.defaultValue == "number" || typeof e.defaultValue == "string" && e.defaultValue ? e.defaultValue : null;
328
808
  default:
329
809
  return typeof e.defaultValue == "string" ? e.defaultValue : "";
330
810
  }
331
811
  }
332
- function Yt(e) {
333
- var l;
334
- const t = e.id || H("a2-"), r = e.label ?? "", n = ((l = e.name) == null ? void 0 : l.trim()) || "", o = n ? Ut(n) : void 0, i = (e.options ?? []).map((c) => ({ label: c.label, value: c.value })), a = (c) => n ? { node: c, dataKey: n, dataValue: Ht(e) } : { node: c };
812
+ function qn(e) {
813
+ var u;
814
+ const t = e.id || ee("a2-"), n = e.label ?? "", r = ((u = e.name) == null ? void 0 : u.trim()) || "", o = r ? wn(r) : void 0, a = (e.options ?? []).map((m) => ({ label: m.label, value: m.value })), l = (m) => r ? { node: m, dataKey: r, dataValue: Vn(e) } : { node: m }, i = { id: t, label: n, name: r, path: o, withData: l }, c = Un(e.type);
815
+ if (c)
816
+ return c.toComponent(e, i);
335
817
  switch (e.type) {
336
818
  case "heading":
337
- return { node: { id: t, component: "Text", text: r, variant: "h3" } };
819
+ return { node: { id: t, component: "Text", text: n, variant: "h3" } };
338
820
  case "paragraph":
339
- return { node: { id: t, component: "Text", text: r, variant: "body" } };
821
+ return { node: { id: t, component: "Text", text: n, variant: "body" } };
340
822
  case "text":
341
823
  case "tel":
342
824
  case "url":
343
- return a({
825
+ return l({
344
826
  id: t,
345
827
  component: "TextField",
346
- label: r,
828
+ label: n,
347
829
  variant: "shortText",
348
830
  ...e.placeholder ? { placeholder: e.placeholder } : {},
349
831
  value: { path: o }
350
832
  });
351
833
  case "email":
352
- return a({
834
+ return l({
353
835
  id: t,
354
836
  component: "TextField",
355
- label: r,
837
+ label: n,
356
838
  variant: "shortText",
357
- validationRegexp: Be,
839
+ validationRegexp: lt,
358
840
  ...e.placeholder ? { placeholder: e.placeholder } : {},
359
841
  value: { path: o }
360
842
  });
361
843
  case "textarea":
362
- return a({
844
+ return l({
363
845
  id: t,
364
846
  component: "TextField",
365
- label: r,
847
+ label: n,
366
848
  variant: "longText",
367
849
  ...e.placeholder ? { placeholder: e.placeholder } : {},
368
850
  value: { path: o }
369
851
  });
370
852
  case "number":
371
- return a({
853
+ return l({
372
854
  id: t,
373
855
  component: "TextField",
374
- label: r,
856
+ label: n,
375
857
  variant: "number",
376
858
  ...e.placeholder ? { placeholder: e.placeholder } : {},
377
859
  value: { path: o }
378
860
  });
379
861
  case "select":
380
- return a({
862
+ return l({
381
863
  id: t,
382
864
  component: "SkoponSelect",
383
- label: r,
865
+ label: n,
384
866
  mode: "single",
385
867
  placeholder: e.placeholder ?? "",
386
- options: i,
868
+ options: a,
387
869
  value: { path: o }
388
870
  });
389
871
  case "radio":
390
- return a({
872
+ return l({
391
873
  id: t,
392
874
  component: "ChoicePicker",
393
- label: r,
875
+ label: n,
394
876
  variant: "mutuallyExclusive",
395
877
  skoponPickerType: "radio",
396
- options: i,
878
+ options: a,
397
879
  value: { path: o }
398
880
  });
399
881
  case "multiselect":
400
- return a({
882
+ return l({
401
883
  id: t,
402
884
  component: "SkoponSelect",
403
- label: r,
885
+ label: n,
404
886
  mode: "multiple",
405
887
  placeholder: e.placeholder ?? "",
406
- options: i,
888
+ options: a,
407
889
  value: { path: o }
408
890
  });
409
891
  case "checkbox":
410
- return a({
892
+ return l({
411
893
  id: t,
412
894
  component: "ChoicePicker",
413
- label: r,
895
+ label: n,
414
896
  variant: "multipleSelection",
415
897
  skoponPickerType: "checkbox",
416
- options: i,
898
+ options: a,
417
899
  value: { path: o }
418
900
  });
419
901
  case "toggle":
420
- return a({ id: t, component: "CheckBox", label: r, value: { path: o } });
902
+ return l({ id: t, component: "CheckBox", label: n, value: { path: o } });
421
903
  case "datetime":
422
- return a({
904
+ return l({
423
905
  id: t,
424
906
  component: "DateTimeInput",
425
- label: r,
907
+ label: n,
426
908
  enableDate: !0,
427
909
  enableTime: !0,
428
910
  placeholder: e.placeholder ?? "",
429
911
  value: { path: o }
430
912
  });
431
913
  case "time":
432
- return a({
914
+ return l({
433
915
  id: t,
434
916
  component: "DateTimeInput",
435
- label: r,
917
+ label: n,
436
918
  enableTime: !0,
437
919
  placeholder: e.placeholder ?? "",
438
920
  value: { path: o }
@@ -440,12 +922,12 @@ function Yt(e) {
440
922
  case "image":
441
923
  case "video":
442
924
  case "audio":
443
- return { node: Rt(e) };
925
+ return { node: On(e) };
444
926
  case "file":
445
- return a({
927
+ return l({
446
928
  id: t,
447
929
  component: "FileUpload",
448
- label: r,
930
+ label: n,
449
931
  accept: (e.fileAcceptExtensions ?? []).join(","),
450
932
  fileAcceptTypes: e.fileAcceptTypes ?? [],
451
933
  filePlaceholderIcon: e.filePlaceholderIcon ?? "document",
@@ -457,371 +939,377 @@ function Yt(e) {
457
939
  return { node: null };
458
940
  }
459
941
  }
460
- function he(e) {
942
+ function Me(e) {
461
943
  if (!e || !Array.isArray(e.components) || e.components.length === 0) return !0;
462
- const t = e.components.find((n) => n.id === te);
944
+ const t = e.components.find((r) => r.id === ce);
463
945
  if (!t) return e.components.length === 0;
464
- const r = t.children;
465
- return !Array.isArray(r) || r.length === 0;
466
- }
467
- function je(e, t) {
468
- const r = [], n = [], o = {}, i = (t == null ? void 0 : t.includeHeader) !== !1, a = (e.title ?? "").trim(), l = (e.description ?? "").trim();
469
- i && a && (r.push({ id: me, component: "Text", text: a, variant: "h2" }), n.push(me)), i && l && (r.push({ id: fe, component: "Text", text: l, variant: "body" }), n.push(fe));
470
- for (const f of e.blocks ?? []) {
471
- const { node: d, dataKey: p, dataValue: y } = Yt(f);
472
- d && (r.push(d), n.push(d.id), p && (o[p] = y));
946
+ const n = t.children;
947
+ return !Array.isArray(n) || n.length === 0;
948
+ }
949
+ function it(e, t) {
950
+ const n = [], r = [], o = {}, a = (t == null ? void 0 : t.includeHeader) !== !1, l = (e.title ?? "").trim(), i = (e.description ?? "").trim();
951
+ a && l && (n.push({ id: Ne, component: "Text", text: l, variant: "h2" }), r.push(Ne)), a && i && (n.push({ id: Fe, component: "Text", text: i, variant: "body" }), r.push(Fe));
952
+ for (const m of e.blocks ?? []) {
953
+ const { node: p, dataKey: y, dataValue: S } = qn(m);
954
+ p && (n.push(p), r.push(p.id), y && (o[y] = S));
473
955
  }
474
- r.unshift({ id: te, component: "Column", children: n });
475
- const c = { root: te, components: r, dataModel: o }, u = t == null ? void 0 : t.styleId;
956
+ n.unshift({ id: ce, component: "Column", children: r });
957
+ const c = { root: ce, components: n, dataModel: o }, u = t == null ? void 0 : t.styleId;
476
958
  return u !== void 0 && (c.surfaceProperties = { styleId: u ?? null }), c;
477
959
  }
478
- function Jt(e) {
960
+ function jn(e) {
479
961
  const t = /* @__PURE__ */ new Map();
480
- for (const r of e.components ?? [])
481
- r && typeof r.id == "string" && t.set(r.id, r);
962
+ for (const n of e.components ?? [])
963
+ n && typeof n.id == "string" && t.set(n.id, n);
482
964
  return t;
483
965
  }
484
- function se(e) {
966
+ function Te(e) {
485
967
  const t = e.options;
486
- return Array.isArray(t) ? t.map((r) => {
487
- if (!r || typeof r != "object") return null;
488
- const n = r;
968
+ return Array.isArray(t) ? t.map((n) => {
969
+ if (!n || typeof n != "object") return null;
970
+ const r = n;
489
971
  return {
490
- value: String(n.value ?? n.label ?? ""),
491
- label: String(n.label ?? n.value ?? "")
972
+ value: String(r.value ?? r.label ?? ""),
973
+ label: String(r.label ?? r.value ?? "")
492
974
  };
493
- }).filter((r) => !!r) : [];
975
+ }).filter((n) => !!n) : [];
494
976
  }
495
- function Gt(e) {
496
- const t = typeof e.id == "string" ? e.id : H("block-"), r = String(e.component ?? ""), n = S(e.label) ?? S(e.text) ?? "", o = $t(e.value), i = (a) => ({ id: t, type: a, label: n });
497
- switch (r) {
977
+ function Ln(e) {
978
+ const t = typeof e.id == "string" ? e.id : ee("block-"), n = String(e.component ?? ""), r = U(e.label) ?? U(e.text) ?? "", o = $e(e.value), a = (i) => ({ id: t, type: i, label: r }), l = _n(n);
979
+ if (l)
980
+ return l.fromComponent(e, a, { asLiteral: U, nameFromValue: $e });
981
+ switch (n) {
498
982
  case "Text": {
499
- const a = String(e.variant ?? "body"), l = /^h[1-6]$/i.test(a) || a === "title" || a === "subtitle";
500
- return { id: t, type: l ? "heading" : "paragraph", label: n };
983
+ const i = String(e.variant ?? "body"), c = /^h[1-6]$/i.test(i) || i === "title" || i === "subtitle";
984
+ return { id: t, type: c ? "heading" : "paragraph", label: r };
501
985
  }
502
986
  case "TextField": {
503
- const a = String(e.variant ?? "shortText");
504
- let l = "text";
505
- a === "longText" ? l = "textarea" : a === "number" ? l = "number" : S(e.validationRegexp) === Be && (l = "email");
506
- const c = { ...i(l), name: o }, u = S(e.placeholder);
507
- return u && (c.placeholder = u), c;
987
+ const i = String(e.variant ?? "shortText");
988
+ let c = "text";
989
+ i === "longText" ? c = "textarea" : i === "number" ? c = "number" : U(e.validationRegexp) === lt && (c = "email");
990
+ const u = { ...a(c), name: o }, m = U(e.placeholder);
991
+ return m && (u.placeholder = m), u;
508
992
  }
509
993
  case "CheckBox":
510
- return { ...i("toggle"), name: o };
994
+ return { ...a("toggle"), name: o };
511
995
  case "SkoponSelect": {
512
- const l = String(e.mode ?? "single") === "multiple" ? "multiselect" : "select", c = {
513
- ...i(l),
996
+ const c = String(e.mode ?? "single") === "multiple" ? "multiselect" : "select", u = {
997
+ ...a(c),
514
998
  name: o,
515
- options: se(e)
516
- }, u = S(e.placeholder);
517
- return u && (c.placeholder = u), c;
999
+ options: Te(e)
1000
+ }, m = U(e.placeholder);
1001
+ return m && (u.placeholder = m), u;
518
1002
  }
519
1003
  case "ChoicePicker": {
520
- const a = S(e.skoponPickerType);
521
- if (a === "select" || a === "multiselect" || a === "radio" || a === "checkbox") {
522
- const u = {
523
- ...i(a),
1004
+ const i = U(e.skoponPickerType);
1005
+ if (i === "select" || i === "multiselect" || i === "radio" || i === "checkbox") {
1006
+ const m = {
1007
+ ...a(i),
524
1008
  name: o,
525
- options: se(e)
526
- }, f = S(e.placeholder);
527
- return f && (u.placeholder = f), u;
1009
+ options: Te(e)
1010
+ }, p = U(e.placeholder);
1011
+ return p && (m.placeholder = p), m;
528
1012
  }
529
- const c = String(e.variant ?? "mutuallyExclusive") === "multipleSelection" ? "checkbox" : "radio";
530
- return { ...i(c), name: o, options: se(e) };
1013
+ const u = String(e.variant ?? "mutuallyExclusive") === "multipleSelection" ? "checkbox" : "radio";
1014
+ return { ...a(u), name: o, options: Te(e) };
531
1015
  }
532
1016
  case "DateTimeInput": {
533
- const a = e.enableDate === !0, l = e.enableTime === !0, u = { ...i(!a && l ? "time" : "datetime"), name: o }, f = S(e.placeholder);
534
- return f && (u.placeholder = f), u;
1017
+ const i = e.enableDate === !0, c = e.enableTime === !0, m = { ...a(!i && c ? "time" : "datetime"), name: o }, p = U(e.placeholder);
1018
+ return p && (m.placeholder = p), m;
535
1019
  }
536
1020
  case "SkoponMedia": {
537
- const a = String(e.mediaType ?? "image");
538
- return K(e, a === "video" ? "video" : a === "audio" ? "audio" : "image", n);
1021
+ const i = String(e.mediaType ?? "image");
1022
+ return oe(e, i === "video" ? "video" : i === "audio" ? "audio" : "image", r);
539
1023
  }
540
1024
  case "Image":
541
- return K(e, "image", n);
1025
+ return oe(e, "image", r);
542
1026
  case "Video":
543
- return K(e, "video", n);
1027
+ return oe(e, "video", r);
544
1028
  case "AudioPlayer":
545
- return K(e, "audio", n);
1029
+ return oe(e, "audio", r);
546
1030
  case "FileUpload": {
547
- const a = S(e.accept) ?? "", l = { ...i("file"), name: o };
548
- return a && (l.fileAcceptExtensions = a.split(",").map((c) => c.trim()).filter(Boolean)), Array.isArray(e.fileAcceptTypes) && (l.fileAcceptTypes = e.fileAcceptTypes.map(String)), typeof e.filePlaceholderIcon == "string" && (l.filePlaceholderIcon = e.filePlaceholderIcon), typeof e.minCount == "number" && (l.fileMinCount = e.minCount), typeof e.maxCount == "number" && (l.fileMaxCount = e.maxCount), l;
1031
+ const i = U(e.accept) ?? "", c = { ...a("file"), name: o };
1032
+ return i && (c.fileAcceptExtensions = i.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;
549
1033
  }
550
1034
  default:
551
1035
  return null;
552
1036
  }
553
1037
  }
554
- function Le(e, t, r, n) {
555
- if (r.has(e)) return;
556
- r.add(e);
1038
+ function st(e, t, n, r) {
1039
+ if (n.has(e)) return;
1040
+ n.add(e);
557
1041
  const o = t.get(e);
558
1042
  if (!o) return;
559
- const i = String(o.component ?? "");
560
- if ((i === "Column" || i === "Row") && Array.isArray(o.children)) {
561
- for (const a of o.children)
562
- typeof a == "string" && Le(a, t, r, n);
1043
+ const a = String(o.component ?? "");
1044
+ if ((a === "Column" || a === "Row") && Array.isArray(o.children)) {
1045
+ for (const l of o.children)
1046
+ typeof l == "string" && st(l, t, n, r);
563
1047
  return;
564
1048
  }
565
- n.push(o);
566
- }
567
- function Xt(e) {
1049
+ r.push(o);
1050
+ }
1051
+ function $n(e, t) {
1052
+ return t ? e.map((n) => {
1053
+ var a;
1054
+ const r = (a = n.name) == null ? void 0 : a.trim();
1055
+ if (!r || !(r in t)) return n;
1056
+ const o = t[r];
1057
+ return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue: o === !0 || o === "true" } : { ...n, defaultValue: o };
1058
+ }) : e;
1059
+ }
1060
+ function Dn(e) {
568
1061
  if (!e || !Array.isArray(e.components))
569
- return ee({ title: "", description: "", blocks: [], jsonSchema: {} });
570
- const t = Jt(e), r = [];
571
- Le(e.root ?? te, t, /* @__PURE__ */ new Set(), r);
572
- let n = "", o = "";
573
- const i = [];
574
- for (const a of r) {
575
- if (a.id === me) {
576
- n = S(a.text) ?? n;
1062
+ return se({ title: "", description: "", blocks: [], jsonSchema: {} });
1063
+ const t = jn(e), n = [];
1064
+ st(e.root ?? ce, t, /* @__PURE__ */ new Set(), n);
1065
+ let r = "", o = "";
1066
+ const a = [];
1067
+ for (const l of n) {
1068
+ if (l.id === Ne) {
1069
+ r = U(l.text) ?? r;
577
1070
  continue;
578
1071
  }
579
- if (a.id === fe) {
580
- o = S(a.text) ?? o;
1072
+ if (l.id === Fe) {
1073
+ o = U(l.text) ?? o;
581
1074
  continue;
582
1075
  }
583
- const l = Gt(a);
584
- l && i.push(l);
1076
+ const i = Ln(l);
1077
+ i && a.push(i);
585
1078
  }
586
- return ee({ title: n, description: o, blocks: i, jsonSchema: {} });
1079
+ return se({
1080
+ title: r,
1081
+ description: o,
1082
+ blocks: $n(a, e.dataModel),
1083
+ jsonSchema: {}
1084
+ });
587
1085
  }
588
- function qt(e, t) {
589
- const { surfaceId: r, catalogId: n } = t, o = [
590
- { version: "v0.9", createSurface: { surfaceId: r, catalogId: n } },
1086
+ function Kn(e, t) {
1087
+ const { surfaceId: n, catalogId: r } = t, o = [
1088
+ { version: "v0.9", createSurface: { surfaceId: n, catalogId: r } },
591
1089
  {
592
1090
  version: "v0.9",
593
- updateComponents: { surfaceId: r, components: e.components }
1091
+ updateComponents: { surfaceId: n, components: e.components }
594
1092
  }
595
1093
  ];
596
1094
  return e.dataModel && Object.keys(e.dataModel).length > 0 && o.push({
597
1095
  version: "v0.9",
598
- updateDataModel: { surfaceId: r, path: "/", value: e.dataModel }
1096
+ updateDataModel: { surfaceId: n, path: "/", value: e.dataModel }
599
1097
  }), o;
600
1098
  }
601
- function ze(e) {
1099
+ function ct(e) {
602
1100
  return !!e && typeof e == "object" && !Array.isArray(e) && Array.isArray(e.components);
603
1101
  }
604
- function Kt(e, t) {
1102
+ function Jn(e, t) {
605
1103
  if (!e || typeof e != "object") return null;
606
- const r = e, n = ze(r.a2ui) ? r.a2ui : void 0;
607
- if (n && !he(n)) return n;
608
- const o = Array.isArray(r.blocks) ? r.blocks : [];
1104
+ const n = e, r = ct(n.a2ui) ? n.a2ui : void 0;
1105
+ if (r && !Me(r)) return r;
1106
+ const o = Array.isArray(n.blocks) ? n.blocks : [];
609
1107
  if (o.length === 0) return null;
610
- const i = B({
611
- title: typeof r.title == "string" ? r.title : "",
612
- description: typeof r.description == "string" ? r.description : "",
1108
+ const a = H({
1109
+ title: typeof n.title == "string" ? n.title : "",
1110
+ description: typeof n.description == "string" ? n.description : "",
613
1111
  blocks: o
614
- }), a = je(i, t);
615
- return he(a) ? null : a;
1112
+ }), l = it(a, t);
1113
+ return Me(l) ? null : l;
616
1114
  }
617
- function Wt(e, t, r) {
618
- return je(
1115
+ function Hn(e, t, n) {
1116
+ return it(
619
1117
  {
620
1118
  title: e.title,
621
1119
  description: e.description,
622
1120
  blocks: t
623
1121
  },
624
- r
1122
+ n
625
1123
  );
626
1124
  }
627
- function Zt(e) {
1125
+ function Yn(e) {
628
1126
  if (!e || typeof e != "object" || Array.isArray(e))
629
1127
  return;
630
1128
  const t = e;
631
- return !(Array.isArray(t.blocks) && t.blocks.length > 0) && ze(t.a2ui) ? Xt(t.a2ui) : B({
1129
+ return !(Array.isArray(t.blocks) && t.blocks.length > 0) && ct(t.a2ui) ? Dn(t.a2ui) : H({
632
1130
  title: typeof t.title == "string" ? t.title : "",
633
1131
  description: typeof t.description == "string" ? t.description : "",
634
1132
  blocks: Array.isArray(t.blocks) ? t.blocks : []
635
1133
  });
636
1134
  }
637
- function Qt(e, t, r) {
638
- const n = e.model.surfacesMap.get(t);
639
- if (!n) return {};
1135
+ function Xn(e, t, n) {
1136
+ const r = e.model.surfacesMap.get(t);
1137
+ if (!r) return {};
640
1138
  const o = {};
641
- for (const i of r) {
642
- const a = i.trim();
643
- a && (o[a] = n.dataModel.get(`/${a}`));
1139
+ for (const a of n) {
1140
+ const l = a.trim();
1141
+ l && (o[l] = r.dataModel.get(`/${l}`));
644
1142
  }
645
1143
  return o;
646
1144
  }
647
- function Ue(e) {
1145
+ function ut(e) {
648
1146
  return e.replace(/'/g, "'\\''");
649
1147
  }
650
- function er(e, t) {
651
- const r = (t ?? "").trim() || "<callback_url>", n = JSON.stringify(e ?? {}, null, 2);
1148
+ function Gn(e, t) {
1149
+ const n = (t ?? "").trim() || "<callback_url>", r = JSON.stringify(e ?? {}, null, 2);
652
1150
  return [
653
- `curl -X POST '${r}' \\`,
1151
+ `curl -X POST '${n}' \\`,
654
1152
  " -H 'Content-Type: application/json' \\",
655
- ` -d '${Ue(n)}'`
1153
+ ` -d '${ut(r)}'`
656
1154
  ].join(`
657
1155
  `);
658
1156
  }
659
- function Me(e, t, r) {
660
- return ` ${JSON.stringify(e)}: ${JSON.stringify(t)}${r ? "," : ""}`;
1157
+ function Wn(e, t) {
1158
+ return JSON.stringify({ ...e, ...t }, null, 2);
661
1159
  }
662
- function tr(e, t) {
663
- const r = ["{"], n = Object.entries(e), o = Object.entries(t);
664
- return n.forEach(([i, a], l) => {
665
- const c = l < n.length - 1 || o.length > 0;
666
- r.push(Me(i, a, c));
667
- }), o.length > 0 && (r.push(" // 额外字段(未在卡片展示)"), o.forEach(([i, a], l) => {
668
- r.push(Me(i, a, l < o.length - 1));
669
- })), r.push("}"), r.join(`
670
- `);
671
- }
672
- function rr({
1160
+ function Zn({
673
1161
  cardValues: e,
674
1162
  extraValues: t = {},
675
- callbackUrl: r
1163
+ callbackUrl: n
676
1164
  }) {
677
- const n = (r ?? "").trim() || "<callback_url>", o = tr(e, t);
1165
+ const r = (n ?? "").trim() || "<callback_url>", o = Wn(e, t);
678
1166
  return [
679
- `curl -X POST '${n}' \\`,
1167
+ `curl -X POST '${r}' \\`,
680
1168
  " -H 'Content-Type: application/json' \\",
681
- ` -d '${Ue(o)}'`
1169
+ ` -d '${ut(o)}'`
682
1170
  ].join(`
683
1171
  `);
684
1172
  }
685
- function nr(e) {
686
- return B({
1173
+ function Qn(e) {
1174
+ return H({
687
1175
  title: "",
688
1176
  description: "",
689
1177
  blocks: [e]
690
1178
  }).blocks[0];
691
1179
  }
692
- function or(e, t) {
693
- var o, i;
694
- const r = /* @__PURE__ */ new Map();
695
- for (const a of t) {
696
- const l = (o = a.name) == null ? void 0 : o.trim();
697
- l && r.set(l, a);
1180
+ function er(e, t) {
1181
+ var o, a;
1182
+ const n = /* @__PURE__ */ new Map();
1183
+ for (const l of t) {
1184
+ const i = (o = l.name) == null ? void 0 : o.trim();
1185
+ i && n.set(i, l);
698
1186
  }
699
- const n = [];
700
- for (const a of e.blocks) {
701
- if (ve(a.type)) {
702
- n.push(nr(a));
1187
+ const r = [];
1188
+ for (const l of e.blocks) {
1189
+ if (_e(l.type)) {
1190
+ r.push(Qn(l));
703
1191
  continue;
704
1192
  }
705
- if (!F(a.type)) continue;
706
- const l = (i = a.name) == null ? void 0 : i.trim();
707
- if (!l) continue;
708
- const c = r.get(l);
709
- c && n.push(c);
1193
+ if (!J(l.type)) continue;
1194
+ const i = (a = l.name) == null ? void 0 : a.trim();
1195
+ if (!i) continue;
1196
+ const c = n.get(i);
1197
+ c && r.push(c);
710
1198
  }
711
- return n;
1199
+ return r;
712
1200
  }
713
- function ar(e, t) {
714
- var n;
715
- const r = {
1201
+ function tr(e, t) {
1202
+ var r;
1203
+ const n = {
716
1204
  ...e,
717
- name: ((n = e.name) == null ? void 0 : n.trim()) || t.name
1205
+ name: ((r = e.name) == null ? void 0 : r.trim()) || t.name
718
1206
  };
719
- return t.defaultValue !== void 0 && (r.defaultValue = t.defaultValue), B({
1207
+ return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue), H({
720
1208
  title: "",
721
1209
  description: "",
722
- blocks: [r]
1210
+ blocks: [n]
723
1211
  }).blocks[0];
724
1212
  }
725
- function ir(e) {
1213
+ function nr(e) {
726
1214
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
727
1215
  const t = e;
728
- return Array.isArray(t.blocks) ? B({
1216
+ return Array.isArray(t.blocks) ? H({
729
1217
  title: typeof t.title == "string" ? t.title : "",
730
1218
  description: typeof t.description == "string" ? t.description : "",
731
1219
  blocks: t.blocks
732
1220
  }) : null;
733
1221
  }
734
- function lr(e, t) {
735
- var i, a, l, c, u, f;
736
- const r = /* @__PURE__ */ new Map();
737
- for (const d of (t == null ? void 0 : t.blocks) ?? [])
738
- F(d.type) && ((i = d.name) != null && i.trim()) && r.set(d.name.trim(), d);
739
- const n = [], o = [];
740
- for (const d of e.blocks) {
741
- if (!F(d.type)) continue;
742
- const p = (a = d.name) == null ? void 0 : a.trim();
743
- if (!p) continue;
744
- const y = r.get(p);
745
- y ? n.push(ar(y, d)) : o.push(
746
- B({
1222
+ function rr(e, t) {
1223
+ var a, l, i, c, u, m;
1224
+ const n = /* @__PURE__ */ new Map();
1225
+ for (const p of (t == null ? void 0 : t.blocks) ?? [])
1226
+ J(p.type) && ((a = p.name) != null && a.trim()) && n.set(p.name.trim(), p);
1227
+ const r = [], o = [];
1228
+ for (const p of e.blocks) {
1229
+ if (!J(p.type)) continue;
1230
+ const y = (l = p.name) == null ? void 0 : l.trim();
1231
+ if (!y) continue;
1232
+ const S = n.get(y);
1233
+ S ? r.push(tr(S, p)) : o.push(
1234
+ H({
747
1235
  title: "",
748
1236
  description: "",
749
- blocks: [d]
1237
+ blocks: [p]
750
1238
  }).blocks[0]
751
1239
  );
752
1240
  }
753
1241
  return {
754
- matchedBlocks: n,
1242
+ matchedBlocks: r,
755
1243
  extraBlocks: o,
756
- renderBlocks: or(e, n),
757
- title: ((l = e.title) == null ? void 0 : l.trim()) || ((c = t == null ? void 0 : t.title) == null ? void 0 : c.trim()) || "",
758
- description: ((u = e.description) == null ? void 0 : u.trim()) || ((f = t == null ? void 0 : t.description) == null ? void 0 : f.trim()) || ""
1244
+ renderBlocks: er(e, r),
1245
+ title: ((i = e.title) == null ? void 0 : i.trim()) || ((c = t == null ? void 0 : t.title) == null ? void 0 : c.trim()) || "",
1246
+ description: ((u = e.description) == null ? void 0 : u.trim()) || ((m = t == null ? void 0 : t.description) == null ? void 0 : m.trim()) || ""
759
1247
  };
760
1248
  }
761
- function cr(e) {
762
- const { type: t, defaultValue: r } = e;
763
- return r !== void 0 ? t === "toggle" ? r === !0 || r === "true" : t === "multiselect" || t === "checkbox" ? Array.isArray(r) ? r.map(String) : typeof r == "string" && r ? [r] : [] : r : t === "toggle" ? !1 : t === "multiselect" || t === "checkbox" ? [] : t === "number" ? null : "";
1249
+ function or(e) {
1250
+ const { type: t, defaultValue: n } = e;
1251
+ 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 : "";
764
1252
  }
765
- function sr(e) {
766
- var r;
1253
+ function ar(e) {
1254
+ var n;
767
1255
  const t = {};
768
- for (const n of e) {
769
- if (!F(n.type)) continue;
770
- const o = (r = n.name) == null ? void 0 : r.trim();
771
- o && (t[o] = cr(n));
1256
+ for (const r of e) {
1257
+ if (!J(r.type)) continue;
1258
+ const o = (n = r.name) == null ? void 0 : n.trim();
1259
+ o && (t[o] = or(r));
772
1260
  }
773
1261
  return t;
774
1262
  }
775
- function ur(e) {
1263
+ function lr(e) {
776
1264
  return e.blocks.some(
777
1265
  (t) => {
778
- var r;
779
- return F(t.type) && !!((r = t.name) != null && r.trim());
1266
+ var n;
1267
+ return J(t.type) && !!((n = t.name) != null && n.trim());
780
1268
  }
781
1269
  );
782
1270
  }
783
- function pr(e) {
1271
+ function ir(e) {
784
1272
  return e.blocks.filter((t) => {
785
- var r;
786
- return ve(t.type) ? !0 : F(t.type) && !!((r = t.name) != null && r.trim());
1273
+ var n;
1274
+ return _e(t.type) ? !0 : J(t.type) && !!((n = t.name) != null && n.trim());
787
1275
  });
788
1276
  }
789
- function dr(e) {
1277
+ function sr(e) {
790
1278
  return e.blocks.filter((t) => {
791
- var r;
792
- return F(t.type) && ((r = t.name) == null ? void 0 : r.trim());
1279
+ var n;
1280
+ return J(t.type) && ((n = t.name) == null ? void 0 : n.trim());
793
1281
  }).map((t) => t.name.trim());
794
1282
  }
795
- async function mr(e, t, r) {
796
- const n = e.trim();
797
- if (!n)
1283
+ async function cr(e, t, n) {
1284
+ const r = e.trim();
1285
+ if (!r)
798
1286
  throw new Error("callback_url 为空");
799
- const i = await ((r == null ? void 0 : r.fetch) ?? fetch)(n, {
1287
+ const a = await ((n == null ? void 0 : n.fetch) ?? fetch)(r, {
800
1288
  method: "POST",
801
1289
  headers: {
802
1290
  "Content-Type": "application/json",
803
- ...(r == null ? void 0 : r.headers) ?? {}
1291
+ ...(n == null ? void 0 : n.headers) ?? {}
804
1292
  },
805
1293
  body: JSON.stringify(t ?? {})
806
1294
  });
807
- let a;
808
- if ((i.headers.get("content-type") ?? "").includes("application/json"))
1295
+ let l;
1296
+ if ((a.headers.get("content-type") ?? "").includes("application/json"))
809
1297
  try {
810
- a = await i.json();
1298
+ l = await a.json();
811
1299
  } catch {
812
- a = void 0;
1300
+ l = void 0;
813
1301
  }
814
1302
  else
815
1303
  try {
816
- a = await i.text();
1304
+ l = await a.text();
817
1305
  } catch {
818
- a = void 0;
1306
+ l = void 0;
819
1307
  }
820
- return { ok: i.ok, status: i.status, body: a };
1308
+ return { ok: a.ok, status: a.status, body: l };
821
1309
  }
822
- async function $e(e) {
823
- var r;
824
- if (typeof navigator < "u" && ((r = navigator.clipboard) != null && r.writeText)) {
1310
+ async function pt(e) {
1311
+ var n;
1312
+ if (typeof navigator < "u" && ((n = navigator.clipboard) != null && n.writeText)) {
825
1313
  await navigator.clipboard.writeText(e);
826
1314
  return;
827
1315
  }
@@ -835,7 +1323,7 @@ async function $e(e) {
835
1323
  document.body.removeChild(t);
836
1324
  }
837
1325
  }
838
- async function fr(e) {
1326
+ async function ur(e) {
839
1327
  let t;
840
1328
  try {
841
1329
  t = await e.json();
@@ -848,100 +1336,55 @@ async function fr(e) {
848
1336
  throw new Error(t.message || `响应缺少 data (${e.status})`);
849
1337
  return t.data;
850
1338
  }
851
- function tn(e = {}) {
852
- const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), r = e.detailPath ?? "/dev/form/detail", n = e.fetch ?? fetch;
853
- async function o(i) {
854
- var d;
855
- const a = new URLSearchParams();
856
- if (i.formId !== void 0)
857
- a.set("form_id", String(i.formId));
858
- else if (i.formUniqueId)
859
- a.set("form_unique_id", i.formUniqueId);
1339
+ function Wr(e = {}) {
1340
+ const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.detailPath ?? "/dev/form/detail", r = e.fetch ?? fetch;
1341
+ async function o(a) {
1342
+ var p;
1343
+ const l = new URLSearchParams();
1344
+ if (a.formId !== void 0)
1345
+ l.set("form_id", String(a.formId));
1346
+ else if (a.formUniqueId)
1347
+ l.set("form_unique_id", a.formUniqueId);
860
1348
  else
861
1349
  throw new Error("form_id 或 form_unique_id 至少传一个");
862
- const l = await ((d = e.getHeaders) == null ? void 0 : d.call(e)) ?? {}, c = await n(`${t}${r}?${a.toString()}`, {
1350
+ const i = await ((p = e.getHeaders) == null ? void 0 : p.call(e)) ?? {}, c = await r(`${t}${n}?${l.toString()}`, {
863
1351
  method: "GET",
864
- headers: l
865
- }), u = await fr(c), f = Zt(u.form_definition);
1352
+ headers: i
1353
+ }), u = await ur(c), m = Yn(u.form_definition);
866
1354
  return {
867
1355
  formUniqueId: u.form_unique_id,
868
1356
  formId: u.form_id,
869
1357
  disabled: u.disabled === 1,
870
- formDefinition: f,
871
- a2ui: Kt(u.form_definition) ?? void 0
1358
+ formDefinition: m,
1359
+ a2ui: Jn(u.form_definition) ?? void 0
872
1360
  };
873
1361
  }
874
1362
  return { fetchDetail: o };
875
1363
  }
876
- const hr = {
877
- video: ft,
878
- audio: mt,
879
- image: dt,
880
- file: Oe,
881
- spreadsheet: pt,
882
- document: ut
1364
+ const pr = {
1365
+ video: Pt,
1366
+ audio: Mt,
1367
+ image: Ft,
1368
+ file: He,
1369
+ spreadsheet: Nt,
1370
+ document: Je
883
1371
  };
884
- function vr({
1372
+ function mr({
885
1373
  type: e,
886
1374
  size: t = 40,
887
- className: r
1375
+ className: n
888
1376
  }) {
889
- const n = hr[e] ?? Oe;
1377
+ const r = pr[e] ?? He;
890
1378
  return /* @__PURE__ */ s(
891
- n,
1379
+ r,
892
1380
  {
893
- className: r ?? "skopon-form-file-placeholder-icon",
1381
+ className: n ?? "skopon-form-file-placeholder-icon",
894
1382
  style: { fontSize: t, color: "var(--color-primary, #1677ff)" },
895
1383
  "aria-hidden": !0
896
1384
  }
897
1385
  );
898
1386
  }
899
- const Re = We({ interactive: !0 });
900
- function De({
901
- interactive: e,
902
- children: t
903
- }) {
904
- return /* @__PURE__ */ s(Re.Provider, { value: { interactive: e }, children: t });
905
- }
906
- function j() {
907
- return Ze(Re);
908
- }
909
- function He(e) {
910
- return e && typeof e == "object" && "path" in e && String(e.path ?? "").trim() || null;
911
- }
912
- function Ee(e, t = "value") {
913
- const n = e.componentModel.properties[t];
914
- if (!(!He(n) || n === void 0))
915
- return e.dataContext.resolveDynamicValue(n);
916
- }
917
- function L(e, t = "value") {
918
- const n = e.componentModel.properties[t], o = He(n), i = ie(
919
- (u) => {
920
- if (!o || n === void 0) return () => {
921
- };
922
- const f = e.dataContext.subscribeDynamicValue(n, () => u());
923
- return () => f.unsubscribe();
924
- },
925
- [e, n, o]
926
- ), a = ie(() => {
927
- if (!(!o || n === void 0))
928
- return e.dataContext.resolveDynamicValue(n);
929
- }, [e, n, o]), l = Qe(i, a, a), c = ie(
930
- (u) => {
931
- !o || !n || typeof n != "object" || !("path" in n) || e.dataContext.set(String(n.path), u);
932
- },
933
- [e, n, o]
934
- );
935
- return { value: l, setValue: c, hasBinding: !!o };
936
- }
937
- function D(e) {
938
- if (typeof e == "string") return e || void 0;
939
- if (typeof e == "number") return String(e);
940
- }
941
- function V(e) {
942
- return Array.isArray(e) ? e.map(String) : typeof e == "string" && e ? [e] : [];
943
- }
944
- const Ye = "skopon-form-v0_9", yr = /* @__PURE__ */ new Set([
1387
+ const mt = "skopon-form-v0_9", dr = /* @__PURE__ */ new Set([
945
1388
  "SkoponMedia",
946
1389
  "SkoponSelect",
947
1390
  "Image",
@@ -952,135 +1395,136 @@ const Ye = "skopon-form-v0_9", yr = /* @__PURE__ */ new Set([
952
1395
  "DateTimeInput",
953
1396
  "FileUpload",
954
1397
  "TextField",
955
- "Text"
956
- ]), gr = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
957
- function G(e) {
958
- const t = [...Z.components.values()].find((r) => r.name === e);
1398
+ "Text",
1399
+ ...Rn()
1400
+ ]), fr = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
1401
+ function re(e) {
1402
+ const t = [...le.components.values()].find((n) => n.name === e);
959
1403
  if (!t) throw new Error(`Missing basic catalog component: ${e}`);
960
1404
  return t.schema;
961
1405
  }
962
- function g(e) {
1406
+ function N(e) {
963
1407
  return typeof e == "string" ? e : "";
964
1408
  }
965
- function Je(e) {
1409
+ function dt(e) {
966
1410
  return Array.isArray(e) ? e.map((t) => {
967
1411
  if (!t || typeof t != "object") return null;
968
- const r = t, n = String(r.value ?? r.label ?? ""), o = String(r.label ?? r.value ?? "");
969
- return { value: n, label: o };
1412
+ const n = t, r = String(n.value ?? n.label ?? ""), o = String(n.label ?? n.value ?? "");
1413
+ return { value: r, label: o };
970
1414
  }).filter((t) => !!t) : [];
971
1415
  }
972
- function re({
1416
+ function me({
973
1417
  mediaType: e,
974
1418
  urls: t,
975
- mediaSize: r,
976
- label: n,
1419
+ mediaSize: n,
1420
+ label: r,
977
1421
  help: o,
978
- placeholder: i
1422
+ placeholder: a
979
1423
  }) {
980
- const a = n == null ? void 0 : n.trim(), l = o == null ? void 0 : o.trim(), c = Bt(r), u = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
981
- return /* @__PURE__ */ M("div", { className: "form-block-preview", children: [
982
- a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
983
- t.length === 0 ? /* @__PURE__ */ s("div", { className: "form-media-preview form-media-preview--empty", children: u }) : /* @__PURE__ */ s("div", { className: c, children: t.map((f, d) => e === "image" ? /* @__PURE__ */ s(
1424
+ const l = r == null ? void 0 : r.trim(), i = o == null ? void 0 : o.trim(), c = Qt(n), u = (a == null ? void 0 : a.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
1425
+ return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
1426
+ l ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: l }) : null,
1427
+ t.length === 0 ? /* @__PURE__ */ s("div", { className: "form-media-preview form-media-preview--empty", children: u }) : /* @__PURE__ */ s("div", { className: c, children: t.map((m, p) => e === "image" ? /* @__PURE__ */ s(
984
1428
  "img",
985
1429
  {
986
- src: f,
987
- alt: a || "图片",
1430
+ src: m,
1431
+ alt: l || "图片",
988
1432
  className: "form-media-item"
989
1433
  },
990
- `media-${d}`
1434
+ `media-${p}`
991
1435
  ) : e === "video" ? /* @__PURE__ */ s(
992
1436
  "video",
993
1437
  {
994
- src: f,
1438
+ src: m,
995
1439
  controls: !0,
996
1440
  className: "form-media-item"
997
1441
  },
998
- `media-${d}`
1442
+ `media-${p}`
999
1443
  ) : /* @__PURE__ */ s(
1000
1444
  "audio",
1001
1445
  {
1002
- src: f,
1446
+ src: m,
1003
1447
  controls: !0,
1004
1448
  className: "form-media-item form-media-item--audio"
1005
1449
  },
1006
- `media-${d}`
1450
+ `media-${p}`
1007
1451
  )) }),
1008
- l ? /* @__PURE__ */ s(R.Text, { type: "secondary", className: "form-block-preview-help", children: l }) : null
1452
+ i ? /* @__PURE__ */ s(L.Text, { type: "secondary", className: "form-block-preview-help", children: i }) : null
1009
1453
  ] });
1010
1454
  }
1011
- function ne(e, t) {
1012
- const r = Array.isArray(e.urls) ? e.urls.map((n) => String(n).trim()).filter(Boolean) : g(e.url).trim() ? [g(e.url).trim()] : [];
1455
+ function de(e, t) {
1456
+ const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : N(e.url).trim() ? [N(e.url).trim()] : [];
1013
1457
  return {
1014
1458
  mediaType: t,
1015
- urls: r,
1016
- mediaSize: J(e.mediaSize),
1017
- label: g(e.label) || g(e.description),
1018
- help: g(e.help),
1019
- placeholder: g(e.placeholder)
1459
+ urls: n,
1460
+ mediaSize: ne(e.mediaSize),
1461
+ label: N(e.label) || N(e.description),
1462
+ help: N(e.help),
1463
+ placeholder: N(e.placeholder)
1020
1464
  };
1021
1465
  }
1022
- const br = {
1466
+ const hr = {
1023
1467
  name: "SkoponMedia",
1024
- schema: m.object({
1025
- mediaType: m.any().optional(),
1026
- urls: m.any().optional(),
1027
- mediaSize: m.any().optional(),
1028
- label: m.any().optional(),
1029
- help: m.any().optional(),
1030
- placeholder: m.any().optional()
1468
+ schema: d.object({
1469
+ mediaType: d.any().optional(),
1470
+ urls: d.any().optional(),
1471
+ mediaSize: d.any().optional(),
1472
+ label: d.any().optional(),
1473
+ help: d.any().optional(),
1474
+ placeholder: d.any().optional()
1031
1475
  }).passthrough()
1032
- }, xr = E(br, ({ context: e }) => {
1033
- const t = e.componentModel.properties, r = g(t.mediaType);
1034
- return /* @__PURE__ */ s(re, { ...ne(t, r === "video" ? "video" : r === "audio" ? "audio" : "image") });
1035
- }), Sr = E(
1036
- { name: "Image", schema: G("Image") },
1037
- ({ context: e }) => /* @__PURE__ */ s(re, { ...ne(e.componentModel.properties, "image") })
1038
- ), kr = E(
1039
- { name: "Video", schema: G("Video") },
1040
- ({ context: e }) => /* @__PURE__ */ s(re, { ...ne(e.componentModel.properties, "video") })
1041
- ), Ar = E(
1042
- { name: "AudioPlayer", schema: G("AudioPlayer") },
1043
- ({ context: e }) => /* @__PURE__ */ s(re, { ...ne(e.componentModel.properties, "audio") })
1044
- ), Tr = {
1476
+ }, gr = z(hr, ({ context: e }) => {
1477
+ const t = e.componentModel.properties, n = N(t.mediaType);
1478
+ return /* @__PURE__ */ s(me, { ...de(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
1479
+ }), yr = z(
1480
+ { name: "Image", schema: re("Image") },
1481
+ ({ context: e }) => /* @__PURE__ */ s(me, { ...de(e.componentModel.properties, "image") })
1482
+ ), vr = z(
1483
+ { name: "Video", schema: re("Video") },
1484
+ ({ context: e }) => /* @__PURE__ */ s(me, { ...de(e.componentModel.properties, "video") })
1485
+ ), br = z(
1486
+ { name: "AudioPlayer", schema: re("AudioPlayer") },
1487
+ ({ context: e }) => /* @__PURE__ */ s(me, { ...de(e.componentModel.properties, "audio") })
1488
+ ), Sr = {
1045
1489
  name: "SkoponSelect",
1046
- schema: m.object({
1047
- label: m.any().optional(),
1048
- mode: m.any().optional(),
1049
- placeholder: m.any().optional(),
1050
- options: m.any().optional(),
1051
- value: m.any().optional()
1490
+ schema: d.object({
1491
+ label: d.any().optional(),
1492
+ mode: d.any().optional(),
1493
+ placeholder: d.any().optional(),
1494
+ options: d.any().optional(),
1495
+ value: d.any().optional()
1052
1496
  }).passthrough()
1053
1497
  };
1054
- function Cr({ context: e }) {
1055
- const { interactive: t } = j(), { value: r, setValue: n } = L(e), o = e.componentModel.properties, i = g(o.label), a = g(o.placeholder), l = Je(o.options), c = g(o.mode) === "multiple";
1056
- return /* @__PURE__ */ M("div", { className: "form-block-preview", children: [
1057
- i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
1498
+ function kr({ context: e }) {
1499
+ const { interactive: t } = $(), { value: n, setValue: r } = D(e), o = e.componentModel.properties, a = N(o.label), l = N(o.placeholder), i = dt(o.options), c = N(o.mode) === "multiple";
1500
+ return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
1501
+ a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
1058
1502
  /* @__PURE__ */ s(
1059
- ue,
1503
+ Ce,
1060
1504
  {
1061
1505
  mode: c ? "multiple" : void 0,
1062
1506
  disabled: !t,
1063
1507
  allowClear: !0,
1064
1508
  className: "form-block-preview-control",
1065
1509
  style: { width: "100%" },
1066
- placeholder: a || (c ? "请选择多项" : "请选择"),
1067
- options: l,
1068
- value: c ? V(r) : D(r),
1069
- onChange: (u) => n(c ? u ?? [] : u ?? "")
1510
+ placeholder: l || (c ? "请选择多项" : "请选择"),
1511
+ options: i,
1512
+ value: c ? j(n) : Q(n),
1513
+ onChange: (u) => r(c ? u ?? [] : u ?? "")
1070
1514
  }
1071
1515
  )
1072
1516
  ] });
1073
1517
  }
1074
- const Mr = E(
1075
- Tr,
1076
- Cr
1518
+ const xr = z(
1519
+ Sr,
1520
+ kr
1077
1521
  );
1078
- function Er({ context: e }) {
1079
- const { interactive: t } = j(), { value: r, setValue: n } = L(e), o = e.componentModel.properties, i = g(o.label), a = g(o.variant) || "mutuallyExclusive", l = g(o.skoponPickerType), c = g(o.placeholder), u = Je(o.options), d = l === "select" || l === "multiselect" || l === "radio" || l === "checkbox" ? l : a === "multipleSelection" ? "checkbox" : "radio";
1080
- return /* @__PURE__ */ M("div", { className: "form-block-preview", children: [
1081
- i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
1082
- d === "select" ? /* @__PURE__ */ s(
1083
- ue,
1522
+ function Ar({ context: e }) {
1523
+ const { interactive: t } = $(), { value: n, setValue: r } = D(e), o = e.componentModel.properties, a = N(o.label), l = N(o.variant) || "mutuallyExclusive", i = N(o.skoponPickerType), c = N(o.placeholder), u = dt(o.options), p = i === "select" || i === "multiselect" || i === "radio" || i === "checkbox" ? i : l === "multipleSelection" ? "checkbox" : "radio";
1524
+ return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
1525
+ a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
1526
+ p === "select" ? /* @__PURE__ */ s(
1527
+ Ce,
1084
1528
  {
1085
1529
  disabled: !t,
1086
1530
  allowClear: !0,
@@ -1088,11 +1532,11 @@ function Er({ context: e }) {
1088
1532
  style: { width: "100%" },
1089
1533
  placeholder: c || "请选择",
1090
1534
  options: u,
1091
- value: D(r),
1092
- onChange: (p) => n(p ?? "")
1535
+ value: Q(n),
1536
+ onChange: (y) => r(y ?? "")
1093
1537
  }
1094
- ) : d === "multiselect" ? /* @__PURE__ */ s(
1095
- ue,
1538
+ ) : p === "multiselect" ? /* @__PURE__ */ s(
1539
+ Ce,
1096
1540
  {
1097
1541
  mode: "multiple",
1098
1542
  disabled: !t,
@@ -1101,563 +1545,604 @@ function Er({ context: e }) {
1101
1545
  style: { width: "100%" },
1102
1546
  placeholder: c || "请选择多项",
1103
1547
  options: u,
1104
- value: V(r),
1105
- onChange: (p) => n(p ?? [])
1548
+ value: j(n),
1549
+ onChange: (y) => r(y ?? [])
1106
1550
  }
1107
- ) : d === "checkbox" ? /* @__PURE__ */ s(
1108
- nt.Group,
1551
+ ) : p === "checkbox" ? /* @__PURE__ */ s(
1552
+ bt.Group,
1109
1553
  {
1110
1554
  disabled: !t,
1111
1555
  className: "form-block-preview-control",
1112
1556
  options: u,
1113
- value: V(r),
1114
- onChange: (p) => n(p)
1557
+ value: j(n),
1558
+ onChange: (y) => r(y)
1115
1559
  }
1116
1560
  ) : /* @__PURE__ */ s(
1117
- ot.Group,
1561
+ St.Group,
1118
1562
  {
1119
1563
  disabled: !t,
1120
1564
  className: "form-block-preview-control",
1121
1565
  options: u,
1122
- value: D(r),
1123
- onChange: (p) => n(p.target.value)
1566
+ value: Q(n),
1567
+ onChange: (y) => r(y.target.value)
1124
1568
  }
1125
1569
  )
1126
1570
  ] });
1127
1571
  }
1128
- const Ir = E(
1572
+ const Tr = z(
1129
1573
  {
1130
1574
  name: "ChoicePicker",
1131
- schema: m.object({
1132
- label: m.any().optional(),
1133
- variant: m.any().optional(),
1134
- options: m.any().optional(),
1135
- value: m.any().optional(),
1136
- skoponPickerType: m.any().optional(),
1137
- placeholder: m.any().optional()
1575
+ schema: d.object({
1576
+ label: d.any().optional(),
1577
+ variant: d.any().optional(),
1578
+ options: d.any().optional(),
1579
+ value: d.any().optional(),
1580
+ skoponPickerType: d.any().optional(),
1581
+ placeholder: d.any().optional()
1138
1582
  }).passthrough()
1139
1583
  },
1140
- Er
1584
+ Ar
1141
1585
  );
1142
- function Pr({ context: e }) {
1143
- const { interactive: t } = j(), { value: r, setValue: n } = L(e), o = e.componentModel.properties, i = g(o.label);
1144
- return /* @__PURE__ */ M("div", { className: "form-block-preview", children: [
1145
- i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
1586
+ function Cr({ context: e }) {
1587
+ const { interactive: t } = $(), { value: n, setValue: r } = D(e), o = e.componentModel.properties, a = N(o.label);
1588
+ return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
1589
+ a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
1146
1590
  /* @__PURE__ */ s(
1147
- at,
1591
+ kt,
1148
1592
  {
1149
1593
  disabled: !t,
1150
1594
  className: "form-block-preview-control",
1151
- checked: be(r),
1152
- onChange: (a) => n(a)
1595
+ checked: we(n),
1596
+ onChange: (l) => r(l)
1153
1597
  }
1154
1598
  )
1155
1599
  ] });
1156
1600
  }
1157
- const wr = E(
1158
- { name: "CheckBox", schema: G("CheckBox") },
1159
- Pr
1601
+ const Ir = z(
1602
+ { name: "CheckBox", schema: re("CheckBox") },
1603
+ Cr
1160
1604
  );
1161
- function Nr(e, t, r) {
1162
- const n = D(e);
1163
- if (!n) return;
1164
- if (!t && r) {
1165
- const i = Te(n, "HH:mm", !0);
1166
- return i.isValid() ? i : void 0;
1605
+ function Nr(e, t, n) {
1606
+ const r = Q(e);
1607
+ if (!r) return;
1608
+ if (!t && n) {
1609
+ const a = qe(r, "HH:mm", !0);
1610
+ return a.isValid() ? a : void 0;
1167
1611
  }
1168
- const o = Te(n);
1612
+ const o = qe(r);
1169
1613
  return o.isValid() ? o : void 0;
1170
1614
  }
1171
- function _r({ context: e }) {
1172
- const { interactive: t } = j(), { value: r, setValue: n } = L(e), o = e.componentModel.properties, i = g(o.label), a = g(o.placeholder), l = o.enableDate === !0, c = o.enableTime === !0, u = Nr(r, l, c), f = (d) => {
1173
- if (!d) {
1174
- n("");
1615
+ function Fr({ context: e }) {
1616
+ const { interactive: t } = $(), { value: n, setValue: r } = D(e), o = e.componentModel.properties, a = N(o.label), l = N(o.placeholder), i = o.enableDate === !0, c = o.enableTime === !0, u = Nr(n, i, c), m = (p) => {
1617
+ if (!p) {
1618
+ r("");
1175
1619
  return;
1176
1620
  }
1177
- if (!l && c) {
1178
- n(d.format("HH:mm"));
1621
+ if (!i && c) {
1622
+ r(p.format("HH:mm"));
1179
1623
  return;
1180
1624
  }
1181
- if (l && c) {
1182
- n(d.format("YYYY-MM-DDTHH:mm"));
1625
+ if (i && c) {
1626
+ r(p.format("YYYY-MM-DDTHH:mm"));
1183
1627
  return;
1184
1628
  }
1185
- n(d.format("YYYY-MM-DD"));
1629
+ r(p.format("YYYY-MM-DD"));
1186
1630
  };
1187
- return /* @__PURE__ */ M("div", { className: "form-block-preview", children: [
1188
- i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
1189
- !l && c ? /* @__PURE__ */ s(
1190
- it,
1631
+ return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
1632
+ a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
1633
+ !i && c ? /* @__PURE__ */ s(
1634
+ xt,
1191
1635
  {
1192
1636
  disabled: !t,
1193
1637
  className: "form-block-preview-control",
1194
1638
  style: { width: "100%" },
1195
- placeholder: a || "选择时间",
1639
+ placeholder: l || "选择时间",
1196
1640
  value: u,
1197
- onChange: f
1641
+ onChange: m
1198
1642
  }
1199
1643
  ) : /* @__PURE__ */ s(
1200
- lt,
1644
+ At,
1201
1645
  {
1202
- showTime: l && c,
1646
+ showTime: i && c,
1203
1647
  disabled: !t,
1204
1648
  className: "form-block-preview-control",
1205
1649
  style: { width: "100%" },
1206
- placeholder: a || (l && c ? "选择日期时间" : "选择日期"),
1650
+ placeholder: l || (i && c ? "选择日期时间" : "选择日期"),
1207
1651
  value: u,
1208
- onChange: f
1652
+ onChange: m
1209
1653
  }
1210
1654
  )
1211
1655
  ] });
1212
1656
  }
1213
- const Fr = E(
1657
+ const Mr = z(
1214
1658
  {
1215
1659
  name: "DateTimeInput",
1216
- schema: m.object({
1217
- label: m.any().optional(),
1218
- enableDate: m.any().optional(),
1219
- enableTime: m.any().optional(),
1220
- placeholder: m.any().optional(),
1221
- value: m.any().optional(),
1222
- min: m.any().optional(),
1223
- max: m.any().optional()
1660
+ schema: d.object({
1661
+ label: d.any().optional(),
1662
+ enableDate: d.any().optional(),
1663
+ enableTime: d.any().optional(),
1664
+ placeholder: d.any().optional(),
1665
+ value: d.any().optional(),
1666
+ min: d.any().optional(),
1667
+ max: d.any().optional()
1224
1668
  }).passthrough()
1225
1669
  },
1226
- _r
1227
- ), Or = {
1670
+ Fr
1671
+ ), Pr = {
1228
1672
  name: "FileUpload",
1229
- schema: m.object({
1230
- label: m.any().optional(),
1231
- accept: m.any().optional(),
1232
- fileAcceptTypes: m.any().optional(),
1233
- filePlaceholderIcon: m.any().optional(),
1234
- minCount: m.any().optional(),
1235
- maxCount: m.any().optional(),
1236
- value: m.any().optional()
1673
+ schema: d.object({
1674
+ label: d.any().optional(),
1675
+ accept: d.any().optional(),
1676
+ fileAcceptTypes: d.any().optional(),
1677
+ filePlaceholderIcon: d.any().optional(),
1678
+ minCount: d.any().optional(),
1679
+ maxCount: d.any().optional(),
1680
+ value: d.any().optional()
1237
1681
  }).passthrough()
1238
1682
  };
1239
- function Vr({ context: e }) {
1240
- const { interactive: t } = j(), { value: r, setValue: n } = L(e), o = e.componentModel.properties, i = g(o.label), a = g(o.accept), l = Array.isArray(o.fileAcceptTypes) ? o.fileAcceptTypes.map(String) : void 0, c = a ? a.split(",").map((x) => x.trim()).filter(Boolean) : void 0, u = Pt(l, c), f = typeof o.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
1683
+ function Er({ context: e }) {
1684
+ const { interactive: t } = $(), { value: n, setValue: r } = D(e), o = e.componentModel.properties, a = N(o.label), l = N(o.accept), i = Array.isArray(o.fileAcceptTypes) ? o.fileAcceptTypes.map(String) : void 0, c = l ? l.split(",").map((f) => f.trim()).filter(Boolean) : void 0, u = Jt(i, c), m = typeof o.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
1241
1685
  o.filePlaceholderIcon
1242
- ) ? o.filePlaceholderIcon : "document", d = typeof o.minCount == "number" ? Math.max(0, o.minCount) : 0, p = typeof o.maxCount == "number" ? o.maxCount : 1, y = p > 0, k = V(r), T = y && k.length >= p, h = k.length < d;
1243
- return /* @__PURE__ */ M("div", { className: "form-block-preview", children: [
1244
- i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
1245
- /* @__PURE__ */ M(
1246
- le.Dragger,
1686
+ ) ? o.filePlaceholderIcon : "document", p = typeof o.minCount == "number" ? Math.max(0, o.minCount) : 0, y = typeof o.maxCount == "number" ? o.maxCount : 1, S = y > 0, C = j(n), F = S && C.length >= y, T = C.length < p;
1687
+ return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
1688
+ a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
1689
+ /* @__PURE__ */ x(
1690
+ ge.Dragger,
1247
1691
  {
1248
- disabled: !t || T,
1249
- accept: It(l, c),
1692
+ disabled: !t || F,
1693
+ accept: Kt(i, c),
1250
1694
  className: "form-file-upload-preview",
1251
- showUploadList: t && k.length > 0,
1252
- fileList: t ? k.map((x, v) => ({
1253
- uid: `${v}-${x}`,
1254
- name: x,
1695
+ showUploadList: t && C.length > 0,
1696
+ fileList: t ? C.map((f, h) => ({
1697
+ uid: `${h}-${f}`,
1698
+ name: f,
1255
1699
  status: "done"
1256
1700
  })) : [],
1257
- beforeUpload: (x) => {
1258
- if (!t) return le.LIST_IGNORE;
1259
- const v = V(Ee(e));
1260
- if (y && v.length >= p) return le.LIST_IGNORE;
1261
- const b = y ? [...v, x.name].slice(0, p) : [...v, x.name];
1262
- return n(b), !1;
1701
+ beforeUpload: (f) => {
1702
+ if (!t) return ge.LIST_IGNORE;
1703
+ const h = j(Le(e));
1704
+ if (S && h.length >= y) return ge.LIST_IGNORE;
1705
+ const k = S ? [...h, f.name].slice(0, y) : [...h, f.name];
1706
+ return r(k), !1;
1263
1707
  },
1264
- onRemove: (x) => {
1265
- const v = V(Ee(e)), b = /^(\d+)-/.exec(x.uid ?? ""), z = b ? Number(b[1]) : -1, I = z >= 0 && z < v.length ? v.filter((P, X) => X !== z) : v.filter((P) => P !== x.name);
1266
- if (I.length < d) return !1;
1267
- n(I);
1708
+ onRemove: (f) => {
1709
+ const h = j(Le(e)), k = /^(\d+)-/.exec(f.uid ?? ""), v = k ? Number(k[1]) : -1, b = v >= 0 && v < h.length ? h.filter((P, R) => R !== v) : h.filter((P) => P !== f.name);
1710
+ if (b.length < p) return !1;
1711
+ r(b);
1268
1712
  },
1269
1713
  children: [
1270
- /* @__PURE__ */ s("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ s(vr, { type: f, size: 40 }) }),
1714
+ /* @__PURE__ */ s("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ s(mr, { type: m, size: 40 }) }),
1271
1715
  /* @__PURE__ */ s("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
1272
1716
  ]
1273
1717
  }
1274
1718
  ),
1275
- /* @__PURE__ */ M(R.Text, { type: "secondary", className: "form-block-preview-help", children: [
1719
+ /* @__PURE__ */ x(L.Text, { type: "secondary", className: "form-block-preview-help", children: [
1276
1720
  "允许:",
1277
1721
  u ?? "全部类型",
1278
- d > 0 ? `;至少 ${d} 个文件` : "",
1279
- y ? `;最多 ${p} 个文件` : "",
1280
- h && t ? `(当前 ${k.length} 个,未达下限)` : ""
1722
+ p > 0 ? `;至少 ${p} 个文件` : "",
1723
+ S ? `;最多 ${y} 个文件` : "",
1724
+ T && t ? `(当前 ${C.length} 个,未达下限)` : ""
1281
1725
  ] })
1282
1726
  ] });
1283
1727
  }
1284
- const Br = E(
1285
- Or,
1286
- Vr
1728
+ const Ur = z(
1729
+ Pr,
1730
+ Er
1287
1731
  );
1288
- function jr({ context: e }) {
1289
- const { interactive: t } = j(), { value: r, setValue: n } = L(e), o = e.componentModel.properties, i = g(o.label), a = g(o.placeholder), l = g(o.variant) || "shortText", c = D(r) ?? "", u = !t, f = "form-block-preview-control";
1290
- let d;
1291
- if (l === "longText")
1292
- d = /* @__PURE__ */ s(
1293
- ce.TextArea,
1732
+ function _r({ context: e }) {
1733
+ const { interactive: t } = $(), { value: n, setValue: r } = D(e), o = e.componentModel.properties, a = N(o.label), l = N(o.placeholder), i = N(o.variant) || "shortText", c = Q(n) ?? "", u = !t, m = "form-block-preview-control";
1734
+ let p;
1735
+ if (i === "longText")
1736
+ p = /* @__PURE__ */ s(
1737
+ ye.TextArea,
1294
1738
  {
1295
1739
  disabled: u,
1296
- className: f,
1297
- placeholder: a || "长文本回答...",
1740
+ className: m,
1741
+ placeholder: l || "长文本回答...",
1298
1742
  autoSize: { minRows: 2, maxRows: 6 },
1299
1743
  value: c,
1300
- onChange: (p) => n(p.target.value)
1744
+ onChange: (y) => r(y.target.value)
1301
1745
  }
1302
1746
  );
1303
- else if (l === "number") {
1304
- const p = c && Number.isFinite(Number(c)) ? Number(c) : void 0;
1305
- d = /* @__PURE__ */ s(
1306
- ct,
1747
+ else if (i === "number") {
1748
+ const y = c && Number.isFinite(Number(c)) ? Number(c) : void 0;
1749
+ p = /* @__PURE__ */ s(
1750
+ Tt,
1307
1751
  {
1308
1752
  disabled: u,
1309
- className: f,
1753
+ className: m,
1310
1754
  style: { width: "100%" },
1311
- placeholder: a || "数字",
1312
- value: p,
1313
- onChange: (y) => n(y == null ? "" : String(y))
1755
+ placeholder: l || "数字",
1756
+ value: y,
1757
+ onChange: (S) => r(S == null ? "" : String(S))
1314
1758
  }
1315
1759
  );
1316
- } else l === "obscured" ? d = /* @__PURE__ */ s(
1317
- ce.Password,
1760
+ } else i === "obscured" ? p = /* @__PURE__ */ s(
1761
+ ye.Password,
1318
1762
  {
1319
1763
  disabled: u,
1320
- className: f,
1321
- placeholder: a,
1764
+ className: m,
1765
+ placeholder: l,
1322
1766
  value: c,
1323
- onChange: (p) => n(p.target.value)
1767
+ onChange: (y) => r(y.target.value)
1324
1768
  }
1325
- ) : d = /* @__PURE__ */ s(
1326
- ce,
1769
+ ) : p = /* @__PURE__ */ s(
1770
+ ye,
1327
1771
  {
1328
1772
  disabled: u,
1329
- className: f,
1330
- placeholder: a,
1773
+ className: m,
1774
+ placeholder: l,
1331
1775
  value: c,
1332
- onChange: (p) => n(p.target.value)
1776
+ onChange: (y) => r(y.target.value)
1333
1777
  }
1334
1778
  );
1335
- return /* @__PURE__ */ M("div", { className: "form-block-preview", children: [
1336
- i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
1337
- d
1779
+ return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
1780
+ a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
1781
+ p
1338
1782
  ] });
1339
1783
  }
1340
- const Lr = E(
1784
+ const zr = z(
1341
1785
  {
1342
1786
  name: "TextField",
1343
- schema: m.object({
1344
- label: m.any().optional(),
1345
- variant: m.any().optional(),
1346
- placeholder: m.any().optional(),
1347
- validationRegexp: m.any().optional(),
1348
- value: m.any().optional()
1787
+ schema: d.object({
1788
+ label: d.any().optional(),
1789
+ variant: d.any().optional(),
1790
+ placeholder: d.any().optional(),
1791
+ validationRegexp: d.any().optional(),
1792
+ value: d.any().optional()
1349
1793
  }).passthrough()
1350
1794
  },
1351
- jr
1795
+ _r
1352
1796
  );
1353
- function zr({ context: e }) {
1354
- const t = e.componentModel.properties, r = g(t.text), n = g(t.variant) || "body";
1355
- return gr.has(n) ? n === "caption" ? /* @__PURE__ */ s(R.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ s("em", { children: r }) }) : /* @__PURE__ */ s(n, { className: "form-block-preview-heading", children: r }) : /* @__PURE__ */ s(R.Paragraph, { className: "form-block-preview-paragraph", children: r });
1797
+ function Rr({ context: e }) {
1798
+ const t = e.componentModel.properties, n = N(t.text), r = N(t.variant) || "body";
1799
+ return fr.has(r) ? r === "caption" ? /* @__PURE__ */ s(L.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ s("em", { children: n }) }) : /* @__PURE__ */ s(r, { className: "form-block-preview-heading", children: n }) : /* @__PURE__ */ s(L.Paragraph, { className: "form-block-preview-paragraph", children: n });
1356
1800
  }
1357
- const Ur = E(
1358
- { name: "Text", schema: G("Text") },
1359
- zr
1801
+ const wr = z(
1802
+ { name: "Text", schema: re("Text") },
1803
+ Rr
1360
1804
  );
1361
- function Ge() {
1805
+ function ft() {
1362
1806
  const t = [
1363
- ...[...Z.components.values()].filter(
1364
- (n) => !yr.has(n.name)
1807
+ ...[...le.components.values()].filter(
1808
+ (r) => !dr.has(r.name)
1365
1809
  ),
1810
+ gr,
1366
1811
  xr,
1367
- Mr,
1368
- Sr,
1369
- kr,
1370
- Ar,
1812
+ yr,
1813
+ vr,
1814
+ br,
1815
+ Tr,
1371
1816
  Ir,
1817
+ Mr,
1818
+ Ur,
1819
+ zr,
1372
1820
  wr,
1373
- Fr,
1374
- Br,
1375
- Lr,
1376
- Ur
1377
- ], r = [...Z.functions.values()];
1378
- return new rt(Ye, t, r, Z.themeSchema);
1379
- }
1380
- const $r = et(
1821
+ ...zn()
1822
+ ], n = [...le.functions.values()];
1823
+ return new Et(mt, t, n, le.themeSchema);
1824
+ }
1825
+ const Or = gt(
1381
1826
  function({
1382
1827
  doc: t,
1383
- surfaceId: r = "skopon-form",
1384
- emptyHint: n = null,
1828
+ surfaceId: n = "skopon-form",
1829
+ emptyHint: r = null,
1385
1830
  interactive: o = !0,
1386
- fieldNames: i = []
1387
- }, a) {
1388
- _(() => {
1389
- _e(), we();
1831
+ fieldNames: a = [],
1832
+ resumeSearch: l = null,
1833
+ caseSearch: i = null
1834
+ }, c) {
1835
+ V(() => {
1836
+ We(), Ge();
1390
1837
  }, []);
1391
- const l = w(null), c = w(i);
1392
- c.current = i;
1393
- const u = N(() => {
1394
- if (he(t))
1838
+ const u = B(null), m = B(a);
1839
+ m.current = a;
1840
+ const p = O(() => {
1841
+ if (Me(t)) return "";
1842
+ try {
1843
+ return JSON.stringify(t);
1844
+ } catch {
1845
+ return String(t);
1846
+ }
1847
+ }, [t]), y = O(() => {
1848
+ if (!p)
1395
1849
  return { surfaces: [], processor: null };
1396
1850
  try {
1397
- const p = new Pe([Ge()]), y = qt(t, {
1398
- surfaceId: r,
1399
- catalogId: Ye
1851
+ const F = JSON.parse(p), T = new Xe([ft()]), f = Kn(F, {
1852
+ surfaceId: n,
1853
+ catalogId: mt
1400
1854
  });
1401
- return p.processMessages(y), {
1402
- surfaces: Array.from(p.model.surfacesMap.values()),
1403
- processor: p
1855
+ return T.processMessages(f), {
1856
+ surfaces: Array.from(T.model.surfacesMap.values()),
1857
+ processor: T
1404
1858
  };
1405
- } catch (p) {
1406
- return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", p), { surfaces: [], processor: null };
1859
+ } catch (F) {
1860
+ return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", F), { surfaces: [], processor: null };
1407
1861
  }
1408
- }, [t, r]), { surfaces: f, processor: d } = u;
1409
- return l.current = d, tt(
1410
- a,
1862
+ }, [p, n]), { surfaces: S, processor: C } = y;
1863
+ return u.current = C, yt(
1864
+ c,
1411
1865
  () => ({
1412
- getValues(p) {
1413
- const y = l.current;
1414
- if (!y) return {};
1415
- const k = (p ?? c.current).map((T) => T.trim()).filter(Boolean);
1416
- return Qt(y, r, k);
1866
+ getValues(F) {
1867
+ const T = u.current;
1868
+ if (!T) return {};
1869
+ const f = (F ?? m.current).map((h) => h.trim()).filter(Boolean);
1870
+ return Xn(T, n, f);
1417
1871
  }
1418
1872
  }),
1419
- [r]
1420
- ), f.length === 0 ? /* @__PURE__ */ s(Ie, { children: n }) : /* @__PURE__ */ s(De, { interactive: o, children: /* @__PURE__ */ s("div", { className: "a2ui-surface a2ui-container", children: f.map((p) => /* @__PURE__ */ s(Ne, { surface: p }, p.id)) }) });
1873
+ [n]
1874
+ ), S.length === 0 ? /* @__PURE__ */ s(De, { children: r }) : /* @__PURE__ */ s(at, { resumeSearch: l, children: /* @__PURE__ */ s(rt, { caseSearch: i, children: /* @__PURE__ */ s(et, { interactive: o, children: /* @__PURE__ */ s("div", { className: "a2ui-surface a2ui-container", children: S.map((F) => /* @__PURE__ */ s(Ye, { surface: F }, F.id)) }) }) }) });
1421
1875
  }
1422
1876
  );
1423
- function W() {
1424
- return new Pe([Ge()]);
1877
+ function ae() {
1878
+ return new Xe([ft()]);
1425
1879
  }
1426
- function rn({
1880
+ function Zr({
1427
1881
  messages: e,
1428
1882
  surfaceId: t = "skopon-form-stream",
1429
- emptyHint: r = null,
1430
- interactive: n = !0
1883
+ emptyHint: n = null,
1884
+ interactive: r = !0,
1885
+ resumeSearch: o = null,
1886
+ caseSearch: a = null
1431
1887
  }) {
1432
- _(() => {
1433
- _e(), we();
1888
+ V(() => {
1889
+ We(), Ge();
1434
1890
  }, []);
1435
- const o = w(W()), i = w(0), a = w(!0), l = w(t), [c, u] = O(() => o.current), [f, d] = O(
1436
- () => Array.from(o.current.model.surfacesMap.values())
1891
+ const l = B(null);
1892
+ l.current === null && (l.current = ae());
1893
+ const i = B(0), c = B(""), u = B(!0), m = B(t);
1894
+ function p(f, h) {
1895
+ l.current = f, i.current = h.length, c.current = JSON.stringify(h), u.current && (C(f), T(Array.from(f.model.surfacesMap.values())));
1896
+ }
1897
+ function y(f, h) {
1898
+ if (h <= 0) return !1;
1899
+ const k = JSON.stringify(f.slice(0, h)), v = c.current;
1900
+ if (!v) return !0;
1901
+ try {
1902
+ const b = JSON.parse(v);
1903
+ return JSON.stringify(b.slice(0, h)) !== k;
1904
+ } catch {
1905
+ return !0;
1906
+ }
1907
+ }
1908
+ const [S, C] = E(
1909
+ () => l.current
1910
+ ), [F, T] = E(
1911
+ () => Array.from(
1912
+ l.current.model.surfacesMap.values()
1913
+ )
1437
1914
  );
1438
- return _(() => (a.current = !0, () => {
1439
- a.current = !1;
1440
- }), []), _(() => {
1441
- o.current = c;
1442
- }, [c]), _(() => {
1443
- const p = () => {
1444
- a.current && d(Array.from(c.model.surfacesMap.values()));
1445
- }, y = c.onSurfaceCreated(p), k = c.onSurfaceDeleted(p);
1915
+ return V(() => (u.current = !0, () => {
1916
+ u.current = !1;
1917
+ }), []), V(() => {
1918
+ l.current = S;
1919
+ }, [S]), V(() => {
1920
+ const f = () => {
1921
+ u.current && T(Array.from(S.model.surfacesMap.values()));
1922
+ }, h = S.onSurfaceCreated(f), k = S.onSurfaceDeleted(f);
1446
1923
  return () => {
1447
- y.unsubscribe(), k.unsubscribe();
1924
+ h.unsubscribe(), k.unsubscribe();
1448
1925
  };
1449
- }, [c]), _(() => {
1450
- let p = !1;
1451
- const y = l.current !== t;
1452
- if (l.current = t, y) {
1453
- const h = W();
1454
- return o.current = h, i.current = 0, Array.isArray(e) && e.length > 0 ? (h.processMessages(e), i.current = e.length, p || (u(h), d(Array.from(h.model.surfacesMap.values())))) : p || (u(h), d([])), () => {
1455
- p = !0;
1926
+ }, [S]), V(() => {
1927
+ let f = !1;
1928
+ const h = m.current !== t;
1929
+ if (m.current = t, h) {
1930
+ const P = ae();
1931
+ return Array.isArray(e) && e.length > 0 ? (P.processMessages(e), f || p(P, e)) : (l.current = P, i.current = 0, c.current = "", f || (C(P), T([]))), () => {
1932
+ f = !0;
1456
1933
  };
1457
1934
  }
1458
1935
  if (!Array.isArray(e) || e.length === 0) {
1459
1936
  if (i.current > 0) {
1460
- const h = W();
1461
- o.current = h, i.current = 0, p || (u(h), d([]));
1937
+ const P = ae();
1938
+ l.current = P, i.current = 0, c.current = "", f || (C(P), T([]));
1462
1939
  }
1463
1940
  return () => {
1464
- p = !0;
1941
+ f = !0;
1465
1942
  };
1466
1943
  }
1467
- const k = o.current;
1468
- if (e.length < i.current) {
1469
- const h = W();
1470
- return o.current = h, i.current = 0, h.processMessages(e), i.current = e.length, p || (u(h), d(Array.from(h.model.surfacesMap.values()))), () => {
1471
- p = !0;
1944
+ const k = l.current, v = i.current;
1945
+ if (e.length < v || y(e, v)) {
1946
+ const P = ae();
1947
+ return P.processMessages(e), f || p(P, e), () => {
1948
+ f = !0;
1472
1949
  };
1473
1950
  }
1474
- const T = e.slice(i.current);
1475
- return T.length === 0 ? () => {
1476
- p = !0;
1477
- } : (k.processMessages(T), i.current = e.length, p || d(Array.from(k.model.surfacesMap.values())), () => {
1478
- p = !0;
1951
+ const b = e.slice(v);
1952
+ return b.length === 0 ? () => {
1953
+ f = !0;
1954
+ } : (k.processMessages(b), i.current = e.length, c.current = JSON.stringify(e), f || T(Array.from(k.model.surfacesMap.values())), () => {
1955
+ f = !0;
1479
1956
  });
1480
- }, [e, t]), f.length === 0 ? /* @__PURE__ */ s(Ie, { children: r }) : /* @__PURE__ */ s(De, { interactive: n, children: /* @__PURE__ */ s("div", { className: "a2ui-surface a2ui-container", children: f.map((p) => /* @__PURE__ */ s(Ne, { surface: p }, p.id)) }) });
1957
+ }, [e, t]), F.length === 0 ? /* @__PURE__ */ s(De, { children: n }) : /* @__PURE__ */ s(at, { resumeSearch: o, children: /* @__PURE__ */ s(rt, { caseSearch: a, children: /* @__PURE__ */ s(et, { interactive: r, children: /* @__PURE__ */ s("div", { className: "a2ui-surface a2ui-container", children: F.map((f) => /* @__PURE__ */ s(Ye, { surface: f }, f.id)) }) }) }) });
1481
1958
  }
1482
- function Rr({
1959
+ function Br({
1483
1960
  payload: e,
1484
1961
  callbackUrl: t,
1485
- title: r,
1486
- unpublishedFormId: n,
1962
+ title: n,
1963
+ unpublishedFormId: r,
1487
1964
  incompleteFormId: o,
1488
- onNotify: i
1965
+ onNotify: a
1489
1966
  }) {
1490
- const a = N(
1491
- () => er(e, t),
1967
+ const l = O(
1968
+ () => Gn(e, t),
1492
1969
  [e, t]
1493
1970
  );
1494
- async function l() {
1971
+ async function i() {
1495
1972
  try {
1496
- await $e(a), i == null || i("success", "已复制到剪贴板");
1973
+ await pt(l), a == null || a("success", "已复制到剪贴板");
1497
1974
  } catch {
1498
- i == null || i("error", "复制失败");
1975
+ a == null || a("error", "复制失败");
1499
1976
  }
1500
1977
  }
1501
- return /* @__PURE__ */ M("div", { className: "ask-user-curl-card", children: [
1502
- /* @__PURE__ */ M("div", { className: "ask-user-curl-card-header", children: [
1503
- /* @__PURE__ */ M("div", { className: "ask-user-curl-card-header-title", children: [
1504
- /* @__PURE__ */ s(R.Text, { type: "secondary", children: r ?? "curl 命令" }),
1505
- n ? /* @__PURE__ */ s(Q, { title: n, children: /* @__PURE__ */ s(pe, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
1506
- o ? /* @__PURE__ */ s(Q, { title: o, children: /* @__PURE__ */ s(pe, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
1978
+ return /* @__PURE__ */ x("div", { className: "ask-user-curl-card", children: [
1979
+ /* @__PURE__ */ x("div", { className: "ask-user-curl-card-header", children: [
1980
+ /* @__PURE__ */ x("div", { className: "ask-user-curl-card-header-title", children: [
1981
+ /* @__PURE__ */ s(L.Text, { type: "secondary", children: n ?? "curl 命令" }),
1982
+ r ? /* @__PURE__ */ s(ie, { title: r, children: /* @__PURE__ */ s(Z, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
1983
+ o ? /* @__PURE__ */ s(ie, { title: o, children: /* @__PURE__ */ s(Z, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
1507
1984
  ] }),
1508
- /* @__PURE__ */ s(Fe, { size: "small", type: "text", onClick: () => void l(), children: "复制" })
1985
+ /* @__PURE__ */ s(ue, { size: "small", type: "text", onClick: () => void i(), children: "复制" })
1509
1986
  ] }),
1510
- /* @__PURE__ */ s("pre", { className: "skopon-form-curl-json", children: a })
1987
+ /* @__PURE__ */ s("pre", { className: "skopon-form-curl-json", children: l })
1511
1988
  ] });
1512
1989
  }
1513
- function Dr(e, t) {
1990
+ function Vr(e, t) {
1514
1991
  if (t && typeof t == "object" && t !== null && "message" in t) {
1515
- const r = t.message;
1516
- if (typeof r == "string" && r.trim())
1517
- return `提交失败 (${e}): ${r.trim()}`;
1992
+ const n = t.message;
1993
+ if (typeof n == "string" && n.trim())
1994
+ return `提交失败 (${e}): ${n.trim()}`;
1518
1995
  }
1519
1996
  return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
1520
1997
  }
1521
- function nn({
1998
+ function Qr({
1522
1999
  payload: e,
1523
2000
  formUniqueId: t,
1524
- callbackUrl: r,
1525
- submitMode: n = "curl",
2001
+ callbackUrl: n,
2002
+ submitMode: r = "curl",
1526
2003
  fetchFormDetail: o,
1527
- onNotify: i
2004
+ onNotify: a,
2005
+ resumeSearch: l = null,
2006
+ caseSearch: i = null
1528
2007
  }) {
1529
- const [a, l] = O(null), [c, u] = O(!1), [f, d] = O(!0), [p, y] = O(!1), k = w(null), T = w(!0), h = w(i);
1530
- h.current = i;
1531
- const x = (t == null ? void 0 : t.trim()) ?? "";
1532
- _(() => (T.current = !0, () => {
1533
- T.current = !1;
1534
- }), []), _(() => {
1535
- let A = !1;
1536
- return x ? (d(!0), u(!1), o({ formUniqueId: x }).then((C) => {
1537
- A || (u(!!C.disabled), l(C.formDefinition ?? null));
1538
- }).catch((C) => {
1539
- var U;
1540
- if (!A) {
1541
- u(!1), l(null);
1542
- const q = C instanceof Error ? C.message : "获取表单定义失败";
1543
- (U = h.current) == null || U.call(h, "error", q);
2008
+ const [c, u] = E(null), [m, p] = E(!1), [y, S] = E(!0), [C, F] = E(!1), T = B(null), f = B(!0), h = B(a);
2009
+ h.current = a;
2010
+ const k = (t == null ? void 0 : t.trim()) ?? "";
2011
+ V(() => (f.current = !0, () => {
2012
+ f.current = !1;
2013
+ }), []), V(() => {
2014
+ let g = !1;
2015
+ return k ? (S(!0), p(!1), o({ formUniqueId: k }).then((A) => {
2016
+ g || (p(!!A.disabled), u(A.formDefinition ?? null));
2017
+ }).catch((A) => {
2018
+ var M;
2019
+ if (!g) {
2020
+ p(!1), u(null);
2021
+ const I = A instanceof Error ? A.message : "获取表单定义失败";
2022
+ (M = h.current) == null || M.call(h, "error", I);
1544
2023
  }
1545
2024
  }).finally(() => {
1546
- A || d(!1);
2025
+ g || S(!1);
1547
2026
  }), () => {
1548
- A = !0;
1549
- }) : (d(!1), u(!1), l(null), () => {
1550
- A = !0;
2027
+ g = !0;
2028
+ }) : (S(!1), p(!1), u(null), () => {
2029
+ g = !0;
1551
2030
  });
1552
- }, [x, o]);
1553
- const v = N(() => ir(e), [e]), b = N(() => v ? lr(v, a ?? void 0) : null, [v, a]), z = (b == null ? void 0 : b.matchedBlocks) ?? [], I = !!(v && ur(v) && z.length === 0), P = N(() => b && b.renderBlocks.length > 0 ? b.renderBlocks : I && v ? pr(v) : [], [b, I, v]), X = N(
1554
- () => I ? {} : sr((b == null ? void 0 : b.extraBlocks) ?? []),
1555
- [I, b]
1556
- ), xe = N(() => I && v ? dr(v) : P.filter((A) => {
1557
- var C;
1558
- return (C = A.name) == null ? void 0 : C.trim();
1559
- }).map((A) => A.name.trim()), [I, v, P]), Xe = N(() => {
1560
- if (P.length === 0) return null;
1561
- const A = (b == null ? void 0 : b.title) ?? (v == null ? void 0 : v.title) ?? "", C = (b == null ? void 0 : b.description) ?? (v == null ? void 0 : v.description) ?? "";
1562
- return Wt({ title: A, description: C }, P);
1563
- }, [b, v, P]), qe = x ? `ask-user-${x}` : "ask-user-payload";
1564
- if (f)
1565
- return /* @__PURE__ */ s("div", { className: "ask-user-form-card", children: /* @__PURE__ */ s(st, { size: "small" }) });
1566
- if (!v || P.length === 0)
2031
+ }, [k, o]);
2032
+ const v = O(() => nr(e), [e]), b = O(() => v ? rr(v, c ?? void 0) : null, [v, c]), P = (b == null ? void 0 : b.matchedBlocks) ?? [], R = !!(v && lr(v) && P.length === 0), _ = O(() => R && v ? ir(v) : b && b.renderBlocks.length > 0 ? b.renderBlocks : [], [b, R, v]), w = O(
2033
+ () => R ? {} : ar((b == null ? void 0 : b.extraBlocks) ?? []),
2034
+ [R, b]
2035
+ ), q = O(() => R && v ? sr(v) : _.filter((g) => {
2036
+ var A;
2037
+ return (A = g.name) == null ? void 0 : A.trim();
2038
+ }).map((g) => g.name.trim()), [R, v, _]), K = O(() => {
2039
+ if (_.length === 0) return null;
2040
+ const g = (b == null ? void 0 : b.title) ?? (v == null ? void 0 : v.title) ?? "", A = (b == null ? void 0 : b.description) ?? (v == null ? void 0 : v.description) ?? "";
2041
+ return Hn({ title: g, description: A }, _);
2042
+ }, [b, v, _]), Y = k ? `ask-user-${k}` : "ask-user-payload";
2043
+ if (y)
2044
+ return /* @__PURE__ */ s("div", { className: "ask-user-form-card", children: /* @__PURE__ */ s(Ue, { size: "small" }) });
2045
+ if (!v || _.length === 0)
1567
2046
  return /* @__PURE__ */ s(
1568
- Rr,
2047
+ Br,
1569
2048
  {
1570
2049
  payload: e,
1571
- callbackUrl: r,
1572
- unpublishedFormId: c && x ? x : void 0,
1573
- onNotify: i
2050
+ callbackUrl: n,
2051
+ unpublishedFormId: m && k ? k : void 0,
2052
+ onNotify: a
1574
2053
  }
1575
2054
  );
1576
- async function Ke() {
1577
- var A, C, U, q, Se, ke;
1578
- if (!p) {
1579
- y(!0);
2055
+ async function X() {
2056
+ var g, A, M, I, Oe, Be;
2057
+ if (!C) {
2058
+ F(!0);
1580
2059
  try {
1581
- const $ = ((A = k.current) == null ? void 0 : A.getValues(xe)) ?? {}, oe = { ...$, ...X };
1582
- if (n === "post") {
1583
- const Ae = (r ?? "").trim();
1584
- if (!Ae) {
1585
- (C = h.current) == null || C.call(h, "error", "callback_url 为空,无法提交");
2060
+ const G = ((g = T.current) == null ? void 0 : g.getValues(q)) ?? {}, fe = { ...G, ...w };
2061
+ if (r === "post") {
2062
+ const Ve = (n ?? "").trim();
2063
+ if (!Ve) {
2064
+ (A = h.current) == null || A.call(h, "error", "callback_url 为空,无法提交");
1586
2065
  return;
1587
2066
  }
1588
- const ae = await mr(Ae, oe);
1589
- if (!T.current) return;
1590
- ae.ok ? (U = h.current) == null || U.call(h, "success", "提交成功") : (q = h.current) == null || q.call(h, "error", Dr(ae.status, ae.body));
2067
+ const he = await cr(Ve, fe);
2068
+ if (!f.current) return;
2069
+ he.ok ? (M = h.current) == null || M.call(h, "success", "提交成功") : (I = h.current) == null || I.call(h, "error", Vr(he.status, he.body));
1591
2070
  return;
1592
2071
  }
1593
- if (await $e(
1594
- rr({ cardValues: $, extraValues: X, callbackUrl: r })
1595
- ), !T.current) return;
1596
- (Se = h.current) == null || Se.call(h, "success", "已复制 curl 到剪贴板");
1597
- } catch ($) {
1598
- if (!T.current) return;
1599
- const oe = $ instanceof Error ? $.message : "复制失败";
1600
- (ke = h.current) == null || ke.call(h, "error", oe);
2072
+ if (await pt(
2073
+ Zn({ cardValues: G, extraValues: w, callbackUrl: n })
2074
+ ), !f.current) return;
2075
+ (Oe = h.current) == null || Oe.call(h, "success", "已复制 curl 到剪贴板");
2076
+ } catch (G) {
2077
+ if (!f.current) return;
2078
+ const fe = G instanceof Error ? G.message : "复制失败";
2079
+ (Be = h.current) == null || Be.call(h, "error", fe);
1601
2080
  } finally {
1602
- T.current && y(!1);
2081
+ f.current && F(!1);
1603
2082
  }
1604
2083
  }
1605
2084
  }
1606
- return /* @__PURE__ */ M("div", { className: "ask-user-form-card", children: [
1607
- c && x ? /* @__PURE__ */ s("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ s(Q, { title: x, children: /* @__PURE__ */ s(pe, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
2085
+ return /* @__PURE__ */ x("div", { className: "ask-user-form-card", children: [
2086
+ m && k ? /* @__PURE__ */ s("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ s(ie, { title: k, children: /* @__PURE__ */ s(Z, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
1608
2087
  /* @__PURE__ */ s(
1609
- $r,
2088
+ Or,
1610
2089
  {
1611
- ref: k,
1612
- doc: Xe,
1613
- surfaceId: qe,
1614
- fieldNames: xe,
1615
- interactive: !0
2090
+ ref: T,
2091
+ doc: K,
2092
+ surfaceId: Y,
2093
+ fieldNames: q,
2094
+ interactive: !0,
2095
+ resumeSearch: l,
2096
+ caseSearch: i
1616
2097
  }
1617
2098
  ),
1618
- /* @__PURE__ */ s("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ s(Q, { title: n === "curl" ? "点击复制 curl" : "提交 JSON 到 callback_url", children: /* @__PURE__ */ s(
1619
- Fe,
2099
+ /* @__PURE__ */ s("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ s(ie, { title: r === "curl" ? "点击复制 curl" : "提交 JSON 到 callback_url", children: /* @__PURE__ */ s(
2100
+ ue,
1620
2101
  {
1621
2102
  type: "primary",
1622
2103
  size: "small",
1623
- loading: p,
1624
- disabled: p,
1625
- onClick: () => void Ke(),
2104
+ loading: C,
2105
+ disabled: C,
2106
+ onClick: () => void X(),
1626
2107
  children: "提交"
1627
2108
  }
1628
2109
  ) }) })
1629
2110
  ] });
1630
2111
  }
1631
2112
  export {
1632
- en as A2UI_PROTOCOL_VERSION,
1633
- nn as AskUserFormCard,
1634
- Rr as CurlSubmitBlock,
1635
- ht as FORM_MEDIA_SIZES,
1636
- rn as SkoponA2uiStreamRenderer,
1637
- $r as SkoponFormRenderer,
1638
- Xt as a2uiToBlocks,
1639
- je as blocksToA2ui,
1640
- tr as buildAskUserCurlBodyJson,
1641
- rr as buildAskUserCurlStatement,
1642
- Wt as buildAskUserSurface,
1643
- er as buildCurlStatement,
1644
- $e as copyTextToClipboard,
1645
- tn as createFormClient,
1646
- sr as extractExtraBlockValues,
1647
- Qt as extractSurfaceValues,
1648
- dr as getPayloadInputFieldNames,
1649
- pr as getPayloadRenderableBlocks,
1650
- lr as intersectPayloadBlocksWithForm,
1651
- he as isA2uiSurfaceEmpty,
1652
- F as isInputBlockType,
1653
- ve as isLayoutBlockType,
1654
- de as isMediaBlockType,
1655
- Zt as mapFormDefinitionFromDto,
1656
- B as normalizeFormDefinition,
1657
- ir as parsePayloadBlocksJson,
1658
- ur as payloadHasInputBlocks,
1659
- Kt as resolveSurfaceFromFormDefinition,
1660
- mr as submitFormJson,
1661
- qt as surfaceDocToMessages,
1662
- ee as syncFormDefinition
2113
+ Gr as A2UI_PROTOCOL_VERSION,
2114
+ Qr as AskUserFormCard,
2115
+ rt as CaseSearchProvider,
2116
+ Br as CurlSubmitBlock,
2117
+ Ut as FORM_MEDIA_SIZES,
2118
+ at as ResumeSearchProvider,
2119
+ Zr as SkoponA2uiStreamRenderer,
2120
+ Or as SkoponFormRenderer,
2121
+ Dn as a2uiToBlocks,
2122
+ it as blocksToA2ui,
2123
+ Wn as buildAskUserCurlBodyJson,
2124
+ Zn as buildAskUserCurlStatement,
2125
+ Hn as buildAskUserSurface,
2126
+ Gn as buildCurlStatement,
2127
+ pt as copyTextToClipboard,
2128
+ Wr as createFormClient,
2129
+ ar as extractExtraBlockValues,
2130
+ Xn as extractSurfaceValues,
2131
+ sr as getPayloadInputFieldNames,
2132
+ ir as getPayloadRenderableBlocks,
2133
+ rr as intersectPayloadBlocksWithForm,
2134
+ Me as isA2uiSurfaceEmpty,
2135
+ J as isInputBlockType,
2136
+ _e as isLayoutBlockType,
2137
+ Ie as isMediaBlockType,
2138
+ Yn as mapFormDefinitionFromDto,
2139
+ H as normalizeFormDefinition,
2140
+ nr as parsePayloadBlocksJson,
2141
+ lr as payloadHasInputBlocks,
2142
+ Jn as resolveSurfaceFromFormDefinition,
2143
+ cr as submitFormJson,
2144
+ Kn as surfaceDocToMessages,
2145
+ se as syncFormDefinition,
2146
+ un as useCaseSearch,
2147
+ bn as useResumeSearch
1663
2148
  };