@baishuyun/ai-feat-utils 2.0.28 → 2.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/ai-feat-utils.js +177 -172
  2. package/dist/ai-feat-utils.js.map +1 -1
  3. package/dist/array.d.ts +3 -0
  4. package/dist/array.d.ts.map +1 -0
  5. package/dist/attachment.d.ts +2 -0
  6. package/dist/attachment.d.ts.map +1 -0
  7. package/dist/condition.d.ts +10 -0
  8. package/dist/condition.d.ts.map +1 -0
  9. package/dist/constants.d.ts +2 -0
  10. package/dist/constants.d.ts.map +1 -0
  11. package/dist/date.d.ts +2 -0
  12. package/dist/date.d.ts.map +1 -0
  13. package/dist/dom.d.ts +2 -0
  14. package/dist/dom.d.ts.map +1 -0
  15. package/dist/field-json.d.ts +21 -0
  16. package/dist/field-json.d.ts.map +1 -0
  17. package/dist/fields-json-rebuild/build-widget-name.d.ts +2 -0
  18. package/dist/fields-json-rebuild/build-widget-name.d.ts.map +1 -0
  19. package/dist/fields-json-rebuild/default-builder.d.ts +2 -0
  20. package/dist/fields-json-rebuild/default-builder.d.ts.map +1 -0
  21. package/dist/fields-json-rebuild/index.d.ts +6 -0
  22. package/dist/fields-json-rebuild/index.d.ts.map +1 -0
  23. package/dist/fields-json-rebuild/rebuild-address.d.ts +2 -0
  24. package/dist/fields-json-rebuild/rebuild-address.d.ts.map +1 -0
  25. package/dist/fields-json-rebuild/rebuild-button.d.ts +2 -0
  26. package/dist/fields-json-rebuild/rebuild-button.d.ts.map +1 -0
  27. package/dist/fields-json-rebuild/rebuild-checkbox-group.d.ts +2 -0
  28. package/dist/fields-json-rebuild/rebuild-checkbox-group.d.ts.map +1 -0
  29. package/dist/fields-json-rebuild/rebuild-combo-checker.d.ts +2 -0
  30. package/dist/fields-json-rebuild/rebuild-combo-checker.d.ts.map +1 -0
  31. package/dist/fields-json-rebuild/rebuild-data-linker.d.ts +2 -0
  32. package/dist/fields-json-rebuild/rebuild-data-linker.d.ts.map +1 -0
  33. package/dist/fields-json-rebuild/rebuild-data-loader.d.ts +2 -0
  34. package/dist/fields-json-rebuild/rebuild-data-loader.d.ts.map +1 -0
  35. package/dist/fields-json-rebuild/rebuild-data-query.d.ts +2 -0
  36. package/dist/fields-json-rebuild/rebuild-data-query.d.ts.map +1 -0
  37. package/dist/fields-json-rebuild/rebuild-date-time.d.ts +2 -0
  38. package/dist/fields-json-rebuild/rebuild-date-time.d.ts.map +1 -0
  39. package/dist/fields-json-rebuild/rebuild-dept-group.d.ts +2 -0
  40. package/dist/fields-json-rebuild/rebuild-dept-group.d.ts.map +1 -0
  41. package/dist/fields-json-rebuild/rebuild-dept.d.ts +2 -0
  42. package/dist/fields-json-rebuild/rebuild-dept.d.ts.map +1 -0
  43. package/dist/fields-json-rebuild/rebuild-image.d.ts +2 -0
  44. package/dist/fields-json-rebuild/rebuild-image.d.ts.map +1 -0
  45. package/dist/fields-json-rebuild/rebuild-line.d.ts +2 -0
  46. package/dist/fields-json-rebuild/rebuild-line.d.ts.map +1 -0
  47. package/dist/fields-json-rebuild/rebuild-location.d.ts +2 -0
  48. package/dist/fields-json-rebuild/rebuild-location.d.ts.map +1 -0
  49. package/dist/fields-json-rebuild/rebuild-number.d.ts +2 -0
  50. package/dist/fields-json-rebuild/rebuild-number.d.ts.map +1 -0
  51. package/dist/fields-json-rebuild/rebuild-radio-group.d.ts +2 -0
  52. package/dist/fields-json-rebuild/rebuild-radio-group.d.ts.map +1 -0
  53. package/dist/fields-json-rebuild/rebuild-select.d.ts +2 -0
  54. package/dist/fields-json-rebuild/rebuild-select.d.ts.map +1 -0
  55. package/dist/fields-json-rebuild/rebuild-signature.d.ts +2 -0
  56. package/dist/fields-json-rebuild/rebuild-signature.d.ts.map +1 -0
  57. package/dist/fields-json-rebuild/rebuild-sn.d.ts +2 -0
  58. package/dist/fields-json-rebuild/rebuild-sn.d.ts.map +1 -0
  59. package/dist/fields-json-rebuild/rebuild-subform.d.ts +57 -0
  60. package/dist/fields-json-rebuild/rebuild-subform.d.ts.map +1 -0
  61. package/dist/fields-json-rebuild/rebuild-text.d.ts +2 -0
  62. package/dist/fields-json-rebuild/rebuild-text.d.ts.map +1 -0
  63. package/dist/fields-json-rebuild/rebuild-textarea.d.ts +2 -0
  64. package/dist/fields-json-rebuild/rebuild-textarea.d.ts.map +1 -0
  65. package/dist/fields-json-rebuild/rebuild-upload.d.ts +2 -0
  66. package/dist/fields-json-rebuild/rebuild-upload.d.ts.map +1 -0
  67. package/dist/fields-json-rebuild/rebuild-user-group.d.ts +2 -0
  68. package/dist/fields-json-rebuild/rebuild-user-group.d.ts.map +1 -0
  69. package/dist/fields-json-rebuild/rebuild-user.d.ts +2 -0
  70. package/dist/fields-json-rebuild/rebuild-user.d.ts.map +1 -0
  71. package/dist/form-structure.d.ts +4 -0
  72. package/dist/form-structure.d.ts.map +1 -0
  73. package/dist/iconfont.d.ts +13 -0
  74. package/dist/iconfont.d.ts.map +1 -0
  75. package/dist/index.d.ts +15 -0
  76. package/dist/index.d.ts.map +1 -0
  77. package/dist/part.d.ts +12 -0
  78. package/dist/part.d.ts.map +1 -0
  79. package/dist/prompt-parser.d.ts +3 -0
  80. package/dist/prompt-parser.d.ts.map +1 -0
  81. package/dist/text-part.d.ts +2 -0
  82. package/dist/text-part.d.ts.map +1 -0
  83. package/dist/value-normalizer.d.ts +2 -0
  84. package/dist/value-normalizer.d.ts.map +1 -0
  85. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- const d = (e) => {
1
+ const u = (e) => {
2
2
  if ((e == null ? void 0 : e.type) !== "text" || !e.providerMetadata || !e.providerMetadata.raw || !e.providerMetadata.raw.data)
3
3
  return null;
4
4
  if (typeof e.providerMetadata.raw.data != "string")
@@ -10,19 +10,19 @@ const d = (e) => {
10
10
  console.error("invalid raw data");
11
11
  }
12
12
  return t || e.providerMetadata.raw.data;
13
- }, k = (e) => {
13
+ }, C = (e) => {
14
14
  if ((e == null ? void 0 : e.type) === "error")
15
15
  return !0;
16
- const t = d(e);
16
+ const t = u(e);
17
17
  return (t == null ? void 0 : t.type) === "agent-error";
18
- }, ce = (e) => {
19
- const t = d(e);
18
+ }, ge = (e) => {
19
+ const t = u(e);
20
20
  return (t == null ? void 0 : t.type) === "agent-fake-msg";
21
- }, ge = (e) => (e == null ? void 0 : e.type) === "file", me = (e) => {
22
- const t = d(e);
21
+ }, me = (e) => (e == null ? void 0 : e.type) === "file", pe = (e) => {
22
+ const t = u(e);
23
23
  return (t == null ? void 0 : t.type) === "query-stream-parsed-info";
24
- }, pe = (e) => {
25
- const t = d(e);
24
+ }, fe = (e) => {
25
+ const t = u(e);
26
26
  if ((t == null ? void 0 : t.type) !== "query-stream-parsed-info")
27
27
  return null;
28
28
  const r = t.result;
@@ -32,32 +32,32 @@ const d = (e) => {
32
32
  } catch (n) {
33
33
  return console.error("invalid query result data"), null;
34
34
  }
35
- }, fe = (e) => {
35
+ }, be = (e) => {
36
36
  if (!Array.isArray(e))
37
37
  return !1;
38
38
  for (const t of e)
39
39
  if ((t == null ? void 0 : t.type) === "file")
40
40
  return !0;
41
41
  return !1;
42
- }, be = (e) => {
43
- const t = d(e);
44
- return (t == null ? void 0 : t.type) === "agent-loading";
45
42
  }, we = (e) => {
46
- const t = d(e);
47
- return (t == null ? void 0 : t.type) !== "agent-loading" ? "" : (t == null ? void 0 : t.label) || "加载中";
43
+ const t = u(e);
44
+ return (t == null ? void 0 : t.type) === "agent-loading";
48
45
  }, ye = (e) => {
49
- if (!k(e))
46
+ const t = u(e);
47
+ return (t == null ? void 0 : t.type) !== "agent-loading" ? "" : (t == null ? void 0 : t.label) || "加载中";
48
+ }, he = (e) => {
49
+ if (!C(e))
50
50
  return "";
51
51
  if (e != null && e.errorText)
52
52
  return e.errorText;
53
- const t = d(e);
53
+ const t = u(e);
54
54
  return (t == null ? void 0 : t.error) || "未知错误";
55
- }, he = (e) => {
55
+ }, ve = (e) => {
56
56
  if (e != null && e.errorText)
57
57
  return e.errorText;
58
- const t = d(e);
58
+ const t = u(e);
59
59
  return (t == null ? void 0 : t.error) || "未知错误";
60
- }, b = "data-shadow-slot-injected", ve = (e, t) => {
60
+ }, b = "data-shadow-slot-injected", Se = (e, t) => {
61
61
  if (e.querySelector(`[${b}]`)) return;
62
62
  const r = (a) => {
63
63
  const l = a.cloneNode(!0);
@@ -68,15 +68,15 @@ const d = (e) => {
68
68
  for (; n; )
69
69
  n instanceof ShadowRoot && (n.querySelectorAll("style").forEach(r), n.querySelectorAll('link[rel="stylesheet"]').forEach(r)), n = n.parentNode;
70
70
  };
71
- function C(e) {
71
+ function N(e) {
72
72
  return Array.isArray(e) ? e.every((t) => typeof t == "string") : !1;
73
73
  }
74
- function N(e) {
74
+ function M(e) {
75
75
  return Array.isArray(e) ? e.every(
76
76
  (t) => typeof t == "object" && t !== null && "label" in t && "value" in t && typeof t.label == "string" && typeof t.value == "string"
77
77
  ) : !1;
78
78
  }
79
- const Se = (e) => C(e) ? e.join(", ") : N(e) ? e.map((r) => r.value).join(", ") : e, M = /* @__PURE__ */ new Set([
79
+ const Ae = (e) => N(e) ? e.join(", ") : M(e) ? e.map((r) => r.value).join(", ") : e, q = /* @__PURE__ */ new Set([
80
80
  "password",
81
81
  "textarea",
82
82
  "datetime",
@@ -87,16 +87,16 @@ const Se = (e) => C(e) ? e.join(", ") : N(e) ? e.map((r) => r.value).join(", ")
87
87
  "combocheck",
88
88
  "checkboxgroup",
89
89
  "number"
90
- ]), Ae = (e) => Array.isArray(e) ? e.filter((t) => t.widget ? M.has(t.widget.type) : !1) : [], x = (e) => (t) => {
91
- const r = d(t);
90
+ ]), _e = (e) => Array.isArray(e) ? e.filter((t) => t.widget ? q.has(t.widget.type) : !1) : [], x = (e) => (t) => {
91
+ const r = u(t);
92
92
  return (r == null ? void 0 : r.type) === e;
93
- }, _e = (e) => (t) => {
93
+ }, ke = (e) => (t) => {
94
94
  const r = t, n = r == null ? void 0 : r.part;
95
95
  return x(e)(n);
96
- }, ke = (e) => (t) => {
97
- const r = d(t);
96
+ }, Ce = (e) => (t) => {
97
+ const r = u(t);
98
98
  return (r == null ? void 0 : r.type) !== e ? null : (r == null ? void 0 : r.field) || null;
99
- }, Ce = (e) => (t) => Array.isArray(t) && t.length > 0 ? t.filter(e) : e(t) ? [t] : [], Ne = (e) => {
99
+ }, Ne = (e) => (t) => Array.isArray(t) && t.length > 0 ? t.filter(e) : e(t) ? [t] : [], Me = (e) => {
100
100
  if (typeof e != "string")
101
101
  return e;
102
102
  try {
@@ -104,10 +104,14 @@ const Se = (e) => C(e) ? e.join(", ") : N(e) ? e.map((r) => r.value).join(", ")
104
104
  } catch (t) {
105
105
  return console.info("[safeParseJson] Failed to parse JSON:", t), null;
106
106
  }
107
- }, q = (e = "_widget_") => {
107
+ }, w = (e) => !!(e && typeof e == "object" && e.qnKey), qe = (e) => {
108
+ var n, a;
109
+ const t = (n = e == null ? void 0 : e.widget) == null ? void 0 : n.value, r = (a = e == null ? void 0 : e.widget) == null ? void 0 : a.type;
110
+ return t == null || t === "" || Array.isArray(t) && t.length === 0 || typeof t == "number" && Number.isNaN(t) || typeof t == "object" && !Array.isArray(t) && Object.keys(t).length === 0 ? !1 : r === "signature" ? w(t) : r === "upload" || r === "image" ? Array.isArray(t) && t.length > 0 && t.every(w) : !0;
111
+ }, F = (e = "_widget_") => {
108
112
  const t = Date.now(), r = String(t), n = r.length, a = r.slice(0, n - 5), l = String(Math.floor(Math.random() * 1e5)).padStart(5, "0");
109
113
  return `${e}${a}${l}`;
110
- }, Me = (e, t) => ({
114
+ }, xe = (e, t) => ({
111
115
  field: e,
112
116
  onLoaded: () => {
113
117
  t.fillWidget({
@@ -124,13 +128,13 @@ const Se = (e) => C(e) ? e.join(", ") : N(e) ? e.map((r) => r.value).join(", ")
124
128
  };
125
129
  t.fillWidget(i);
126
130
  }
127
- }), xe = 10, qe = (e, t = "image/png") => new Promise((r) => {
131
+ }), Fe = 10, Ee = (e, t = "image/png") => new Promise((r) => {
128
132
  const n = new Image();
129
133
  n.crossOrigin = "anonymous", n.onload = () => {
130
134
  const a = document.createElement("canvas");
131
135
  a.width = n.naturalWidth, a.height = n.naturalHeight, a.getContext("2d").drawImage(n, 0, 0), r(a.toDataURL(t));
132
136
  }, n.onerror = () => r(e), n.src = e;
133
- }), Fe = {
137
+ }), De = {
134
138
  eq: "等于",
135
139
  neq: "不等于",
136
140
  gt: "大于",
@@ -145,7 +149,7 @@ const Se = (e) => C(e) ? e.join(", ") : N(e) ? e.map((r) => r.value).join(", ")
145
149
  empty: "为空",
146
150
  not_empty: "不为空",
147
151
  range: "范围"
148
- }, F = {
152
+ }, E = {
149
153
  // Text-like: equality, fuzzy, empty checks
150
154
  text: ["eq", "neq", "in", "nin", "contains", "not_contains", "empty", "not_empty"],
151
155
  password: ["eq", "neq", "contains", "not_contains", "empty", "not_empty"],
@@ -189,7 +193,7 @@ const Se = (e) => C(e) ? e.join(", ") : N(e) ? e.map((r) => r.value).join(", ")
189
193
  button: [],
190
194
  subform: [],
191
195
  unknown: []
192
- }, E = {
196
+ }, D = {
193
197
  text: "eq",
194
198
  password: "eq",
195
199
  radiogroup: "eq",
@@ -217,24 +221,24 @@ const Se = (e) => C(e) ? e.join(", ") : N(e) ? e.map((r) => r.value).join(", ")
217
221
  dataload: "eq",
218
222
  formula: "eq"
219
223
  };
220
- function Ee(e) {
224
+ function Re(e) {
221
225
  var t;
222
- return e ? (t = F[e]) != null ? t : [] : [];
226
+ return e ? (t = E[e]) != null ? t : [] : [];
223
227
  }
224
- function De(e) {
228
+ function Pe(e) {
225
229
  var t;
226
- return e && (t = E[e]) != null ? t : "eq";
230
+ return e && (t = D[e]) != null ? t : "eq";
227
231
  }
228
232
  function m(e) {
229
233
  return typeof e == "object" && e !== null && !Array.isArray(e);
230
234
  }
231
- function A(e) {
235
+ function _(e) {
232
236
  return m(e) ? e : null;
233
237
  }
234
- function w(e) {
238
+ function y(e) {
235
239
  return !!(e == null || e === "" || Array.isArray(e) && e.length === 0);
236
240
  }
237
- function y(e, t) {
241
+ function h(e, t) {
238
242
  if (Array.isArray(e) && Array.isArray(t)) {
239
243
  if (e.length !== t.length) return !1;
240
244
  const r = e.map(String).sort(), n = t.map(String).sort();
@@ -246,40 +250,40 @@ function y(e, t) {
246
250
  }
247
251
  return String(e) === String(t);
248
252
  }
249
- function h(e, t) {
253
+ function v(e, t) {
250
254
  if (m(t)) {
251
- const n = A(e);
255
+ const n = _(e);
252
256
  return !(!n || t.province !== void 0 && String(n.province) !== String(t.province) || t.city !== void 0 && String(n.city) !== String(t.city) || t.district !== void 0 && String(n.district) !== String(t.district));
253
257
  }
254
258
  const r = Array.isArray(t) ? t.map(String) : [];
255
259
  return Array.isArray(e) ? e.some((n) => r.includes(String(n))) : r.includes(String(e));
256
260
  }
257
- function D(e, t) {
261
+ function R(e, t) {
258
262
  const r = Array.isArray(t) ? t.map(String) : [];
259
263
  if (r.length === 0) return !1;
260
264
  const n = Array.isArray(e) ? e.map(String) : [];
261
265
  return r.every((a) => n.includes(a));
262
266
  }
263
267
  function P(e, t) {
264
- const r = A(t);
268
+ const r = _(t);
265
269
  if (!r) return !1;
266
270
  const n = Number(e);
267
271
  return !(isNaN(n) || r.min !== void 0 && r.min !== null && n < Number(r.min) || r.max !== void 0 && r.max !== null && n > Number(r.max));
268
272
  }
269
- function R(e, t) {
273
+ function W(e, t) {
270
274
  var i;
271
275
  const r = (i = e.field.widget) == null ? void 0 : i.widgetName;
272
276
  if (!r) return !1;
273
277
  const n = t[r], { operator: a, value: l } = e;
274
278
  switch (a) {
275
279
  case "empty":
276
- return w(n);
280
+ return y(n);
277
281
  case "not_empty":
278
- return !w(n);
282
+ return !y(n);
279
283
  case "eq":
280
- return y(n, l);
284
+ return h(n, l);
281
285
  case "neq":
282
- return !y(n, l);
286
+ return !h(n, l);
283
287
  case "contains":
284
288
  return String(n).includes(String(l));
285
289
  case "not_contains":
@@ -293,28 +297,28 @@ function R(e, t) {
293
297
  case "lte":
294
298
  return Number(n) <= Number(l);
295
299
  case "in":
296
- return h(n, l);
300
+ return v(n, l);
297
301
  case "nin":
298
- return !h(n, l);
302
+ return !v(n, l);
299
303
  case "all":
300
- return D(n, l);
304
+ return R(n, l);
301
305
  case "range":
302
306
  return P(n, l);
303
307
  default:
304
308
  return !1;
305
309
  }
306
310
  }
307
- function Pe(e, t) {
311
+ function We(e, t) {
308
312
  if (!e.enabled)
309
313
  return !1;
310
314
  const r = e.triggerCondition;
311
315
  if (!r) return !0;
312
316
  const { items: n, quantifier: a } = r;
313
317
  if (!n || n.length === 0) return !0;
314
- const l = n.map((i) => R(i, t));
318
+ const l = n.map((i) => W(i, t));
315
319
  return a === "any" ? l.some((i) => i) : l.every((i) => i);
316
320
  }
317
- const Re = (e, t) => e === null || t === null ? !1 : e.formId ? t.type === "form" && t.params.formId === e.formId : e.appId ? (t.type === "app" || t.type === "form") && t.params.appId === e.appId : t.type === "global" || t.type === "app" || t.type === "form", W = {
321
+ const Be = (e, t) => e === null || t === null ? !1 : e.formId ? t.type === "form" && t.params.formId === e.formId : e.appId ? (t.type === "app" || t.type === "form") && t.params.appId === e.appId : t.type === "global" || t.type === "app" || t.type === "form", B = {
318
322
  eq: "eq",
319
323
  neq: "ne",
320
324
  gt: "gt",
@@ -345,13 +349,13 @@ const Re = (e, t) => e === null || t === null ? !1 : e.formId ? t.type === "form
345
349
  not_empty: "not_empty",
346
350
  range: "range"
347
351
  };
348
- function We(e) {
352
+ function Te(e) {
349
353
  const t = e.quantifier === "any" ? "or" : "and", r = e.items.map((n) => {
350
- var i, s, u, c, p, f;
351
- const a = (i = W[n.operator]) != null ? i : "eq";
354
+ var i, s, d, c, p, f;
355
+ const a = (i = B[n.operator]) != null ? i : "eq";
352
356
  let l;
353
357
  return n.operator === "range" && m(n.value) ? l = [n.value.min, n.value.max] : Array.isArray(n.value) ? l = n.value : l = [n.value], {
354
- field: (c = (u = (s = n.field) == null ? void 0 : s.widget) == null ? void 0 : u.widgetName) != null ? c : "",
358
+ field: (c = (d = (s = n.field) == null ? void 0 : s.widget) == null ? void 0 : d.widgetName) != null ? c : "",
355
359
  method: a,
356
360
  value: l,
357
361
  type: (f = (p = n.field) == null ? void 0 : p.widget) == null ? void 0 : f.type
@@ -359,10 +363,10 @@ function We(e) {
359
363
  });
360
364
  return JSON.stringify({ rel: t, cond: r });
361
365
  }
362
- function Te(e) {
366
+ function Oe(e) {
363
367
  const t = JSON.parse(e), r = t.rel === "or" ? "any" : "all", n = t.cond.map((a, l) => {
364
- var u, c;
365
- const i = (u = T[a.method]) != null ? u : "eq";
368
+ var d, c;
369
+ const i = (d = T[a.method]) != null ? d : "eq";
366
370
  let s = a.value;
367
371
  return i === "range" ? s = { min: a.value[0], max: a.value[1] } : ["eq", "neq", "contains", "not_contains", "gt", "gte", "lt", "lte"].includes(i) && (s = a.value[0]), {
368
372
  id: `${a.field}_${l}`,
@@ -380,23 +384,23 @@ function Te(e) {
380
384
  });
381
385
  return { targetName: "", quantifier: r, items: n };
382
386
  }
383
- function Be(e) {
387
+ function $e(e) {
384
388
  const t = (r) => String(r).padStart(2, "0");
385
389
  return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())} ${t(e.getHours())}:${t(e.getMinutes())}:${t(e.getSeconds())}`;
386
390
  }
387
- function Oe(e, t, r = 1) {
391
+ function Ie(e, t, r = 1) {
388
392
  const n = [], a = [];
389
393
  for (const l of e)
390
394
  t(l) ? a.push(l) : (a.length > 0 && (n.push(a.length >= r ? [...a] : a[0]), a.length = 0), n.push(l));
391
395
  return a.length > 0 && n.push(a.length >= 2 ? [...a] : a[0]), n;
392
396
  }
393
- function _(e) {
397
+ function k(e) {
394
398
  const t = [];
395
399
  for (const r of e)
396
- Array.isArray(r) ? t.push(..._(r)) : t.push(r);
400
+ Array.isArray(r) ? t.push(...k(r)) : t.push(r);
397
401
  return t;
398
402
  }
399
- const B = {
403
+ const O = {
400
404
  projectdevelopment: "e914",
401
405
  resourcelibrary: "e915",
402
406
  Plugin2: "e90e",
@@ -790,11 +794,11 @@ const B = {
790
794
  Automation1: "ea95",
791
795
  Avatar: "ea96"
792
796
  };
793
- function $e(e) {
794
- const t = B[e];
797
+ function Le(e) {
798
+ const t = O[e];
795
799
  return t ? `&#x${t};` : void 0;
796
800
  }
797
- const Ie = (e, t, r) => {
801
+ const Ge = (e, t, r) => {
798
802
  if (!r)
799
803
  return {
800
804
  translated: ""
@@ -804,22 +808,22 @@ const Ie = (e, t, r) => {
804
808
  if (i.widget.type === "subform" && i.widget.items) {
805
809
  for (const s of i.widget.items)
806
810
  if ("widget" in s && !("options" in s)) {
807
- const u = `${i.widget.widgetName}.${s.widget.widgetName}`;
808
- n.set(u, s.label);
811
+ const d = `${i.widget.widgetName}.${s.widget.widgetName}`;
812
+ n.set(d, s.label);
809
813
  }
810
814
  }
811
815
  const a = [], l = e.replace(
812
816
  /\$\{(_widget_\d+(?:\._widget_\d+)?)\}/g,
813
817
  (i, s) => {
814
- const { translated: u, meta: c } = r(s);
815
- return c && a.push(c), u;
818
+ const { translated: d, meta: c } = r(s);
819
+ return c && a.push(c), d;
816
820
  }
817
821
  );
818
822
  return {
819
- meta: a.length ? _(a) : null,
823
+ meta: a.length ? k(a) : null,
820
824
  translated: (l != null ? l : "").trim()
821
825
  };
822
- }, O = {
826
+ }, $ = {
823
827
  手机号码: "^((\\(\\d{2,3}\\))|(\\d{3}\\-))?1\\d{10}$",
824
828
  电话号码: "^(0[0-9]{2,3}\\-)?([2-9][0-9]{6,7})+(\\-[0-9]{1,4})?$",
825
829
  邮政编码: "^\\d{6}$",
@@ -831,8 +835,8 @@ const Ie = (e, t, r) => {
831
835
  二维码图片: "qrcode",
832
836
  条形码图片: "barcode",
833
837
  自定义: "custom"
834
- }, v = (e) => {
835
- const { widget: t, labelStyle: r, label: n, ...a } = e || {}, l = O[r] || "";
838
+ }, S = (e) => {
839
+ const { widget: t, labelStyle: r, label: n, ...a } = e || {}, l = $[r] || "";
836
840
  return {
837
841
  widget: {
838
842
  widgetName: `_widget_${Date.now()}`,
@@ -886,7 +890,7 @@ const Ie = (e, t, r) => {
886
890
  return r;
887
891
  const n = t.toString().length;
888
892
  return `${r.slice(0, -n)}${t}`;
889
- }, $ = (e) => {
893
+ }, I = (e) => {
890
894
  const { widget: t, label: r, ...n } = e || {};
891
895
  return {
892
896
  widget: {
@@ -951,7 +955,7 @@ const Ie = (e, t, r) => {
951
955
  tab: null,
952
956
  ...n
953
957
  };
954
- }, I = (e) => {
958
+ }, L = (e) => {
955
959
  const { widget: t, label: r, ...n } = e || {};
956
960
  return {
957
961
  widget: {
@@ -988,7 +992,7 @@ const Ie = (e, t, r) => {
988
992
  tab: null,
989
993
  ...n
990
994
  };
991
- }, S = (e) => {
995
+ }, A = (e) => {
992
996
  const { widget: t, label: r, ...n } = e || {};
993
997
  return {
994
998
  widget: {
@@ -1024,7 +1028,7 @@ const Ie = (e, t, r) => {
1024
1028
  ...n,
1025
1029
  labelStyle: r
1026
1030
  };
1027
- }, L = (e) => {
1031
+ }, G = (e) => {
1028
1032
  const { widget: t, label: r, ...n } = e || {};
1029
1033
  return {
1030
1034
  widget: {
@@ -1091,7 +1095,7 @@ const Ie = (e, t, r) => {
1091
1095
  tab: null,
1092
1096
  ...n
1093
1097
  };
1094
- }, g = (e) => e, G = (e) => {
1098
+ }, g = (e) => e, U = (e) => {
1095
1099
  const { widget: t, label: r, ...n } = e || {};
1096
1100
  return {
1097
1101
  widget: {
@@ -1125,7 +1129,7 @@ const Ie = (e, t, r) => {
1125
1129
  tab: null,
1126
1130
  ...n
1127
1131
  };
1128
- }, U = (e) => {
1132
+ }, j = (e) => {
1129
1133
  const { widget: t, label: r, ...n } = e || {};
1130
1134
  return {
1131
1135
  widget: {
@@ -1162,7 +1166,7 @@ const Ie = (e, t, r) => {
1162
1166
  tab: null,
1163
1167
  ...n
1164
1168
  };
1165
- }, j = (e) => {
1169
+ }, H = (e) => {
1166
1170
  const { widget: t, label: r, ...n } = e || {};
1167
1171
  return {
1168
1172
  widget: {
@@ -1196,7 +1200,7 @@ const Ie = (e, t, r) => {
1196
1200
  tab: null,
1197
1201
  ...n
1198
1202
  };
1199
- }, H = (e) => {
1203
+ }, Q = (e) => {
1200
1204
  const { widget: t, label: r, ...n } = e || {};
1201
1205
  return {
1202
1206
  widget: {
@@ -1233,7 +1237,7 @@ const Ie = (e, t, r) => {
1233
1237
  tab: null,
1234
1238
  ...n
1235
1239
  };
1236
- }, Q = (e) => {
1240
+ }, z = (e) => {
1237
1241
  const { widget: t, label: r, ...n } = e || {};
1238
1242
  return {
1239
1243
  widget: {
@@ -1261,7 +1265,7 @@ const Ie = (e, t, r) => {
1261
1265
  tab: null,
1262
1266
  ...n
1263
1267
  };
1264
- }, z = (e) => !e || !e.length ? e : e.map((t, r) => ({
1268
+ }, Z = (e) => !e || !e.length ? e : e.map((t, r) => ({
1265
1269
  id: r,
1266
1270
  // name: "_widget_1761976674767",
1267
1271
  // form: "a2f34ef882158a3e97da4ef7",
@@ -1273,10 +1277,10 @@ const Ie = (e, t, r) => {
1273
1277
  isEditable: !0,
1274
1278
  group: "dimension,filter,select",
1275
1279
  formula: ""
1276
- })), Z = (e) => !e || !e.length ? e : e.map((t) => ({
1280
+ })), X = (e) => !e || !e.length ? e : e.map((t) => ({
1277
1281
  mode: "depend",
1278
1282
  ...t
1279
- })), X = (e) => {
1283
+ })), Y = (e) => {
1280
1284
  var a, l, i;
1281
1285
  const { widget: t, label: r, ...n } = e || {};
1282
1286
  return {
@@ -1318,8 +1322,8 @@ const Ie = (e, t, r) => {
1318
1322
  forms: (a = t == null ? void 0 : t.loaddataconfig) == null ? void 0 : a.forms,
1319
1323
  selectArg: [],
1320
1324
  selectRel: "and",
1321
- fields: z((l = t == null ? void 0 : t.loaddataconfig) == null ? void 0 : l.mapFields),
1322
- mapFields: Z((i = t == null ? void 0 : t.loaddataconfig) == null ? void 0 : i.mapFields)
1325
+ fields: Z((l = t == null ? void 0 : t.loaddataconfig) == null ? void 0 : l.mapFields),
1326
+ mapFields: X((i = t == null ? void 0 : t.loaddataconfig) == null ? void 0 : i.mapFields)
1323
1327
  },
1324
1328
  labelStyle: r
1325
1329
  },
@@ -1328,7 +1332,7 @@ const Ie = (e, t, r) => {
1328
1332
  tab: null,
1329
1333
  ...n
1330
1334
  };
1331
- }, Y = (e) => {
1335
+ }, K = (e) => {
1332
1336
  const { widget: t, label: r, ...n } = e || {};
1333
1337
  return {
1334
1338
  widget: {
@@ -1365,7 +1369,7 @@ const Ie = (e, t, r) => {
1365
1369
  tab: null,
1366
1370
  ...n
1367
1371
  };
1368
- }, K = (e) => {
1372
+ }, V = (e) => {
1369
1373
  const { widget: t, label: r, ...n } = e || {};
1370
1374
  return {
1371
1375
  widget: {
@@ -1388,7 +1392,7 @@ const Ie = (e, t, r) => {
1388
1392
  tab: null,
1389
1393
  ...n
1390
1394
  };
1391
- }, V = (e) => {
1395
+ }, J = (e) => {
1392
1396
  const { widget: t, label: r, ...n } = e || {};
1393
1397
  return {
1394
1398
  widget: {
@@ -1460,7 +1464,7 @@ const Ie = (e, t, r) => {
1460
1464
  tab: null,
1461
1465
  ...n
1462
1466
  };
1463
- }, J = (e) => {
1467
+ }, ee = (e) => {
1464
1468
  const { widget: t, label: r, ...n } = e || {};
1465
1469
  return {
1466
1470
  widget: {
@@ -1495,7 +1499,7 @@ const Ie = (e, t, r) => {
1495
1499
  tab: null,
1496
1500
  ...n
1497
1501
  };
1498
- }, ee = (e) => {
1502
+ }, te = (e) => {
1499
1503
  const { widget: t, label: r, ...n } = e || {};
1500
1504
  return {
1501
1505
  widget: {
@@ -1529,7 +1533,7 @@ const Ie = (e, t, r) => {
1529
1533
  tab: null,
1530
1534
  ...n
1531
1535
  };
1532
- }, te = (e) => {
1536
+ }, re = (e) => {
1533
1537
  const { widget: t, label: r, ...n } = e || {};
1534
1538
  return {
1535
1539
  widget: {
@@ -1548,7 +1552,7 @@ const Ie = (e, t, r) => {
1548
1552
  tab: null,
1549
1553
  ...n
1550
1554
  };
1551
- }, re = (e) => {
1555
+ }, ne = (e) => {
1552
1556
  const { widget: t, label: r, ...n } = e || {};
1553
1557
  return {
1554
1558
  widget: {
@@ -1585,7 +1589,7 @@ const Ie = (e, t, r) => {
1585
1589
  tab: null,
1586
1590
  ...n
1587
1591
  };
1588
- }, ne = (e) => {
1592
+ }, ae = (e) => {
1589
1593
  const { widget: t, label: r, ...n } = e || {};
1590
1594
  return {
1591
1595
  widget: {
@@ -1622,7 +1626,7 @@ const Ie = (e, t, r) => {
1622
1626
  tab: null,
1623
1627
  ...n
1624
1628
  };
1625
- }, ae = (e) => {
1629
+ }, le = (e) => {
1626
1630
  const { widget: t, label: r, ...n } = e || {};
1627
1631
  return {
1628
1632
  widget: {
@@ -1665,7 +1669,7 @@ const Ie = (e, t, r) => {
1665
1669
  tab: null,
1666
1670
  ...n
1667
1671
  };
1668
- }, le = (e = {}) => {
1672
+ }, ie = (e = {}) => {
1669
1673
  const { widget: t, label: r, ...n } = e;
1670
1674
  return {
1671
1675
  widget: {
@@ -1709,7 +1713,7 @@ const Ie = (e, t, r) => {
1709
1713
  tab: null,
1710
1714
  ...n
1711
1715
  };
1712
- }, ie = (e = {}) => {
1716
+ }, oe = (e = {}) => {
1713
1717
  const { widget: t, label: r, ...n } = e;
1714
1718
  return {
1715
1719
  widget: {
@@ -1743,7 +1747,7 @@ const Ie = (e, t, r) => {
1743
1747
  tab: null,
1744
1748
  ...n
1745
1749
  };
1746
- }, oe = (e = {}) => {
1750
+ }, se = (e = {}) => {
1747
1751
  const { widget: t, label: r, ...n } = e;
1748
1752
  return {
1749
1753
  widget: {
@@ -1763,7 +1767,7 @@ const Ie = (e, t, r) => {
1763
1767
  version: 1
1764
1768
  },
1765
1769
  items: (t.items || []).map((a, l) => {
1766
- const i = ue(a, !0);
1770
+ const i = ce(a, !0);
1767
1771
  return i.widget.widgetName = o("_widget", l), i;
1768
1772
  }),
1769
1773
  sortable: !0,
@@ -1826,7 +1830,7 @@ const Ie = (e, t, r) => {
1826
1830
  lineWidth: 12,
1827
1831
  tab: null
1828
1832
  };
1829
- }, se = (e) => {
1833
+ }, ue = (e) => {
1830
1834
  const { widget: t, label: r, ...n } = e || {};
1831
1835
  return {
1832
1836
  widget: {
@@ -1861,80 +1865,81 @@ const Ie = (e, t, r) => {
1861
1865
  ...n
1862
1866
  };
1863
1867
  }, de = {
1864
- address: ie,
1865
- button: le,
1866
- textarea: ae,
1867
- datetime: L,
1868
- text: v,
1869
- password: v,
1870
- location: ne,
1871
- radiogroup: S,
1872
- radio: S,
1873
- combo: I,
1874
- combocheck: re,
1875
- separator: te,
1876
- checkboxgroup: ee,
1877
- upload: J,
1878
- number: $,
1879
- image: V,
1880
- signature: K,
1881
- user: Y,
1882
- dataload: X,
1883
- linkdata: Q,
1884
- linkquery: se,
1885
- usergroup: H,
1886
- subform: oe,
1887
- dept: j,
1888
- sn: U,
1889
- deptgroup: G,
1868
+ address: oe,
1869
+ button: ie,
1870
+ textarea: le,
1871
+ datetime: G,
1872
+ text: S,
1873
+ password: S,
1874
+ location: ae,
1875
+ radiogroup: A,
1876
+ radio: A,
1877
+ combo: L,
1878
+ combocheck: ne,
1879
+ separator: re,
1880
+ checkboxgroup: te,
1881
+ upload: ee,
1882
+ number: I,
1883
+ image: J,
1884
+ signature: V,
1885
+ user: K,
1886
+ dataload: Y,
1887
+ linkdata: z,
1888
+ linkquery: ue,
1889
+ usergroup: Q,
1890
+ subform: se,
1891
+ dept: H,
1892
+ sn: j,
1893
+ deptgroup: U,
1890
1894
  flowState: g,
1891
1895
  flowstate: g,
1892
1896
  formula: g,
1893
1897
  unknown: g
1894
- }, ue = (e, t = !1) => {
1898
+ }, ce = (e, t = !1) => {
1895
1899
  var l, i;
1896
1900
  if (!e || !e.widget || !e.widget.type)
1897
1901
  return e;
1898
1902
  const r = e.widget.type || "unknown";
1899
- return t && r === "subform" ? g(e) : (((i = (l = e == null ? void 0 : e.widget) == null ? void 0 : l.widgetName) != null ? i : "").startsWith("_widget_") || (e.widget.widgetName = q()), (de[r] || g)(e));
1903
+ return t && r === "subform" ? g(e) : (((i = (l = e == null ? void 0 : e.widget) == null ? void 0 : l.widgetName) != null ? i : "").startsWith("_widget_") || (e.widget.widgetName = F()), (de[r] || g)(e));
1900
1904
  };
1901
1905
  export {
1902
- xe as DATA_COUNT_PER_BATCH,
1903
- F as FIELD_TYPE_OPERATOR_MAP,
1904
- we as GetLoadingMsg,
1905
- ye as GetPartErrMsg,
1906
- pe as GetQueryResult,
1907
- Ae as GetSafeFormStructure,
1908
- k as IsErrorPart,
1909
- ce as IsFakeMsgPart,
1910
- fe as IsFileGroupPart,
1911
- ge as IsFilePart,
1912
- be as IsLoadingPart,
1913
- me as IsQueryResultPart,
1914
- Fe as OPERATOR_LABEL_MAP,
1915
- M as WHITE_LIST_FIELDS_SET,
1916
- Te as bsConditionParse2Condition,
1917
- We as conditionStringify2bsCondition,
1918
- Ce as createFieldPartsExtractor,
1919
- ke as createGetFieldJsonInfo,
1906
+ Fe as DATA_COUNT_PER_BATCH,
1907
+ E as FIELD_TYPE_OPERATOR_MAP,
1908
+ ye as GetLoadingMsg,
1909
+ he as GetPartErrMsg,
1910
+ fe as GetQueryResult,
1911
+ _e as GetSafeFormStructure,
1912
+ C as IsErrorPart,
1913
+ ge as IsFakeMsgPart,
1914
+ be as IsFileGroupPart,
1915
+ me as IsFilePart,
1916
+ we as IsLoadingPart,
1917
+ pe as IsQueryResultPart,
1918
+ De as OPERATOR_LABEL_MAP,
1919
+ q as WHITE_LIST_FIELDS_SET,
1920
+ Oe as bsConditionParse2Condition,
1921
+ Te as conditionStringify2bsCondition,
1922
+ Ne as createFieldPartsExtractor,
1923
+ Ce as createGetFieldJsonInfo,
1920
1924
  x as createPartTypeChecker,
1921
- _e as createPayloadTypeChecker,
1922
- d as extractTextPartMeta,
1923
- Me as field2config,
1924
- _ as flatArr,
1925
- Be as formatLocalDate,
1926
- Ee as getAvailableOperators,
1927
- De as getDefaultOperator,
1928
- $e as getIconUnicode,
1929
- he as getMetaErrorMsg,
1930
- qe as imageUrlToBase64,
1931
- ve as injectHostStylesIntoShadow,
1932
- Re as isCtxMatch,
1933
- Pe as isHelperCondMet,
1934
- Oe as mergeConsecutiveTargets,
1935
- Ie as promptParser,
1936
- ue as rebuildFieldsJsonStructure,
1937
- Ne as safeParseJson,
1938
- Se as valueNormalizer
1925
+ ke as createPayloadTypeChecker,
1926
+ u as extractTextPartMeta,
1927
+ xe as field2config,
1928
+ k as flatArr,
1929
+ $e as formatLocalDate,
1930
+ Re as getAvailableOperators,
1931
+ Pe as getDefaultOperator,
1932
+ Le as getIconUnicode,
1933
+ ve as getMetaErrorMsg,
1934
+ qe as hasValidFieldValue,
1935
+ Ee as imageUrlToBase64,
1936
+ Se as injectHostStylesIntoShadow,
1937
+ Be as isCtxMatch,
1938
+ We as isHelperCondMet,
1939
+ Ie as mergeConsecutiveTargets,
1940
+ Ge as promptParser,
1941
+ ce as rebuildFieldsJsonStructure,
1942
+ Me as safeParseJson,
1943
+ Ae as valueNormalizer
1939
1944
  };
1940
1945
  //# sourceMappingURL=ai-feat-utils.js.map