@skopon-cool/form-sdk 0.2.0 → 0.2.1

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