@freecallai/pro 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +23 -23
  3. package/dist/FkpKnowledgeTypePicker.vue_vue_type_script_setup_true_lang--MPtqZY_.js +193 -0
  4. package/dist/FkpRichText.vue_vue_type_script_setup_true_lang-bw74hFS9.js +4980 -0
  5. package/dist/KnowledgeArea-CEX1esVZ.js +4 -0
  6. package/dist/KnowledgeArea.vue_vue_type_script_setup_true_lang-Bg1e7xYT.js +1653 -0
  7. package/dist/ToolForm-DA-EFBhw.js +196 -0
  8. package/dist/agent-prompt-editor/index.js +917 -0
  9. package/dist/agent-prompt-editor/legacy-converter/index.js +490 -0
  10. package/dist/{choice-C1SxozNA.js → choice-2dbddjJU.js} +1 -1
  11. package/dist/edition-info/index.js +1 -1
  12. package/dist/filters/index.js +1 -1
  13. package/dist/{guard-CXpVx8UR.js → guard-Cr_ny-sR.js} +226 -213
  14. package/dist/index-7x1OTv0m.js +98 -0
  15. package/dist/{index-CM0MN2DT.js → index-BBxrpF3v.js} +1 -1
  16. package/dist/{index-UjI4WA5F.js → index-CgRisH4B.js} +1 -1
  17. package/dist/index-Ck8RYpuE.js +816 -0
  18. package/dist/index-CnjG7Mj4.js +5 -0
  19. package/dist/{index-lNhA3N9x.js → index-DBQsQ1ZK.js} +1 -0
  20. package/dist/index-DCZKt14c.js +5 -0
  21. package/dist/{index-BqXNMfLG.js → index-DiaPY8Db.js} +2 -2
  22. package/dist/{index-bSNw0XAf.js → index-DmdrsEvk.js} +1 -1
  23. package/dist/index-DnmCPdCI.js +168 -0
  24. package/dist/{index-Cy4DqT8R.js → index-DwDYy2lj.js} +1 -1
  25. package/dist/{index-B8jg37Wj.js → index-FQQfN6nm.js} +1 -1
  26. package/dist/{index-CZc2Gyjb.js → index-aic1yCBs.js} +1 -1
  27. package/dist/index.js +13 -13
  28. package/dist/{inline-Zj7Hqg-_.js → inline-8aNfINLF.js} +1 -1
  29. package/dist/knowledge-type-picker/index.js +1 -1
  30. package/dist/{knowledge-DaTnF2IW.js → knowledge-y2j0ijgx.js} +1 -1
  31. package/dist/media-id-b2dgniSy.js +15 -0
  32. package/dist/{media-migration-C2QLMSpd.js → media-migration-Dy_rbdkK.js} +1 -1
  33. package/dist/media-policy-BwKjZPWt.js +158 -0
  34. package/dist/{media-upload-D9MYBbLg.js → media-upload-NzWYyCm3.js} +1 -1
  35. package/dist/model-DvukseoR.js +146 -0
  36. package/dist/navigation/index.js +1 -1
  37. package/dist/rich-text/index.js +75 -73
  38. package/dist/rich-text/legacy-converter/index.js +822 -799
  39. package/dist/style.css +1 -1
  40. package/dist/switcher/index.js +1 -1
  41. package/dist/types/agent-prompt-editor/FkpAgentPromptEditor.vue.d.ts +550 -0
  42. package/dist/types/agent-prompt-editor/agent-size-chart.d.ts +3 -0
  43. package/dist/types/agent-prompt-editor/document-adapter.d.ts +3 -0
  44. package/dist/types/agent-prompt-editor/index.d.ts +6 -0
  45. package/dist/types/agent-prompt-editor/legacy-converter-index.d.ts +2 -0
  46. package/dist/types/agent-prompt-editor/legacy-converter.d.ts +26 -0
  47. package/dist/types/agent-prompt-editor/model.d.ts +21 -0
  48. package/dist/types/agent-prompt-editor/types.d.ts +56 -0
  49. package/dist/types/edition-info/FkpEditionInfo.vue.d.ts +1 -3
  50. package/dist/types/edition-info/presets.d.ts +8 -0
  51. package/dist/types/edition-info/types.d.ts +1 -0
  52. package/dist/types/filters/FkpFilter.vue.d.ts +2 -2
  53. package/dist/types/filters/FkpFilterDateRange.vue.d.ts +2 -2
  54. package/dist/types/filters/FkpFilterPeriod.vue.d.ts +2 -2
  55. package/dist/types/filters/FkpSearchableMultiSelect.vue.d.ts +2 -2
  56. package/dist/types/index.d.ts +4 -1
  57. package/dist/types/navigation/FkpNavigation.vue.d.ts +20 -29
  58. package/dist/types/navigation/NavigationButton.vue.d.ts +26 -0
  59. package/dist/types/navigation/NavigationGroup.vue.d.ts +45 -0
  60. package/dist/types/navigation/NavigationIcon.vue.d.ts +28 -0
  61. package/dist/types/navigation/NavigationNodes.vue.d.ts +40 -0
  62. package/dist/types/navigation/index.d.ts +1 -1
  63. package/dist/types/navigation/types.d.ts +43 -5
  64. package/dist/types/navigation/use-navigation-tree.d.ts +13 -0
  65. package/dist/types/rich-text/FkpRichText.vue.d.ts +28 -8
  66. package/dist/types/rich-text/config/descriptor.d.ts +1 -0
  67. package/dist/types/rich-text/config/resolve.d.ts +1 -1
  68. package/dist/types/rich-text/index.d.ts +4 -1
  69. package/dist/types/rich-text/knowledge-document-adapter.d.ts +2 -0
  70. package/dist/types/rich-text/model/question-text.d.ts +1 -1
  71. package/dist/types/rich-text/plugins/registry.d.ts +2 -1
  72. package/dist/types/rich-text/public/types.d.ts +12 -0
  73. package/dist/types/rich-text/runtime/document-adapter.d.ts +9 -0
  74. package/dist/types/rich-text/runtime/knowledge-clipboard.d.ts +9 -3
  75. package/dist/types/rich-text/runtime/media-sources.d.ts +7 -0
  76. package/dist/types/rich-text/runtime/media-upload-session.d.ts +2 -0
  77. package/dist/types/rich-text/ui/FkpKnowledgeTypePicker.vue.d.ts +3 -3
  78. package/dist/types/rich-text/ui/KnowledgeArea.vue.d.ts +18 -3
  79. package/dist/types/rich-text/ui/MediaSourceControls.vue.d.ts +190 -0
  80. package/dist/types/rich-text/ui/ToolForm.vue.d.ts +2 -2
  81. package/dist/types/rich-text/ui/token-renderer.d.ts +3 -0
  82. package/dist/types/rich-text/ui/useMediaHint.d.ts +6 -0
  83. package/dist/types/switcher/FkpSwitcher.vue.d.ts +2 -2
  84. package/dist/types-PvYB5e85.js +14 -0
  85. package/package.json +13 -5
  86. package/dist/FkpKnowledgeTypePicker.vue_vue_type_script_setup_true_lang-DYwu7oQs.js +0 -187
  87. package/dist/FkpRichText.vue_vue_type_script_setup_true_lang-BowbZoTQ.js +0 -4885
  88. package/dist/KnowledgeArea-BH-_uF6R.js +0 -1438
  89. package/dist/ToolForm-C6XW31Y7.js +0 -185
  90. package/dist/index-CS2xQQ8W.js +0 -168
  91. package/dist/index-D0bJAQSN.js +0 -327
  92. package/dist/index-DAZ1ulyA.js +0 -5
  93. package/dist/index-DCmHHi07.js +0 -71
  94. package/dist/index-F7lDP1lI.js +0 -5
@@ -1,4 +1,8 @@
1
- const we = [
1
+ const ae = [
2
+ "若使用千牛内部应用接待:",
3
+ "「辅助接待」模式,将顾客标记为“需介入”;",
4
+ "「全自动接待」模式,将按千牛分流规则直接转接(不支持福客转接方案)"
5
+ ], he = [
2
6
  {
3
7
  id: "todo",
4
8
  apiVersion: 1,
@@ -16,6 +20,7 @@ const we = [
16
20
  classes: ["is-todo-menu"],
17
21
  width: 296,
18
22
  helpClass: "fkp-todo-help",
23
+ warning: ae,
19
24
  guidanceClass: "fkp-todo-guidance",
20
25
  guidance: [
21
26
  "常规知识可直接开启待办标签;",
@@ -45,6 +50,7 @@ const we = [
45
50
  classes: ["is-todo-menu"],
46
51
  width: 296,
47
52
  helpClass: "fkp-todo-help",
53
+ warning: ae,
48
54
  guidanceClass: "fkp-todo-guidance",
49
55
  guidance: [
50
56
  "常规知识可直接开启待办标签;",
@@ -56,7 +62,7 @@ const we = [
56
62
  optionSource: "flatTags",
57
63
  optionTrigger: "hover"
58
64
  }
59
- ], he = [
65
+ ], $e = [
60
66
  {
61
67
  id: "tableKnowledge",
62
68
  apiVersion: 1,
@@ -81,7 +87,7 @@ const we = [
81
87
  optionSource: "flatTags",
82
88
  optionTrigger: "hover"
83
89
  }
84
- ], $e = [
90
+ ], Se = [
85
91
  {
86
92
  id: "ticket",
87
93
  apiVersion: 1,
@@ -114,7 +120,7 @@ const we = [
114
120
  optionSource: "flatTags",
115
121
  optionTrigger: "hover"
116
122
  }
117
- ], Se = [
123
+ ], Ae = [
118
124
  {
119
125
  id: "originalReply",
120
126
  apiVersion: 1,
@@ -141,7 +147,7 @@ const we = [
141
147
  types: ["reasoning"],
142
148
  icon: "quote"
143
149
  }
144
- ], Ae = [
150
+ ], Te = [
145
151
  {
146
152
  id: "memory",
147
153
  apiVersion: 1,
@@ -154,7 +160,7 @@ const we = [
154
160
  types: ["normal", "reasoning", "agent"],
155
161
  icon: "memory"
156
162
  }
157
- ], Te = [
163
+ ], Ie = [
158
164
  {
159
165
  id: "tagged",
160
166
  apiVersion: 1,
@@ -172,6 +178,7 @@ const we = [
172
178
  classes: ["is-todo-menu", "is-tagged-menu"],
173
179
  width: 336,
174
180
  helpClass: "fkp-todo-help",
181
+ warning: ["此功能千牛内部应用接待不生效"],
175
182
  guidanceClass: "fkp-tagged-guidance",
176
183
  guidance: ["顾客消息命中此场景后,将对其打上所选顾客标签"]
177
184
  },
@@ -180,7 +187,7 @@ const we = [
180
187
  optionTrigger: "hover",
181
188
  questionTag: { kind: "default", protocolLabel: "顾客标签" }
182
189
  }
183
- ], Ie = [
190
+ ], xe = [
184
191
  {
185
192
  id: "attribute",
186
193
  apiVersion: 1,
@@ -208,7 +215,7 @@ const we = [
208
215
  optionTrigger: "hover",
209
216
  optionHierarchy: "tree"
210
217
  }
211
- ], xe = [
218
+ ], ve = [
212
219
  {
213
220
  id: "tool",
214
221
  apiVersion: 1,
@@ -237,7 +244,7 @@ const we = [
237
244
  optionHierarchy: "tree",
238
245
  uiPorts: ["getToolForm"]
239
246
  }
240
- ], ve = [
247
+ ], Pe = [
241
248
  {
242
249
  id: "variable",
243
250
  apiVersion: 1,
@@ -263,7 +270,7 @@ const we = [
263
270
  optionTrigger: "hover"
264
271
  }
265
272
  ];
266
- const it = {
273
+ const st = {
267
274
  agents: "searchAgents",
268
275
  variables: "listVariables",
269
276
  flatTags: "listCapabilityOptions",
@@ -286,7 +293,7 @@ const w = {
286
293
  requiredPorts: [],
287
294
  optionalPorts: ["getReasoningTemplate", "listCapabilityOptions"]
288
295
  }
289
- }, Pe = [
296
+ }, qe = [
290
297
  {
291
298
  id: "image",
292
299
  apiVersion: 1,
@@ -316,7 +323,7 @@ const w = {
316
323
  icon: "video3",
317
324
  optionKind: "media"
318
325
  }
319
- ], qe = [
326
+ ], Ve = [
320
327
  {
321
328
  id: "separator",
322
329
  apiVersion: 1,
@@ -329,7 +336,7 @@ const w = {
329
336
  types: ["normal", "reasoning"],
330
337
  icon: "sep"
331
338
  }
332
- ], Ve = [
339
+ ], _e = [
333
340
  {
334
341
  id: "reasoningPolish",
335
342
  apiVersion: 1,
@@ -343,7 +350,7 @@ const w = {
343
350
  types: ["reasoning"],
344
351
  icon: "AI"
345
352
  }
346
- ], _e = [
353
+ ], je = [
347
354
  {
348
355
  id: "reasoningTemplate",
349
356
  apiVersion: 1,
@@ -366,7 +373,7 @@ const w = {
366
373
  optionKind: "selection",
367
374
  optionSource: "reasoningTemplates"
368
375
  }
369
- ], je = [
376
+ ], Le = [
370
377
  {
371
378
  id: "agentSelect",
372
379
  apiVersion: 1,
@@ -394,56 +401,56 @@ const w = {
394
401
  optionSource: "agents",
395
402
  optionTrigger: "hover"
396
403
  }
397
- ], q = [
398
- ...we,
399
- ...$e,
404
+ ], O = [
400
405
  ...he,
401
406
  ...Se,
407
+ ...$e,
402
408
  ...Ae,
403
409
  ...Te,
404
410
  ...Ie,
405
411
  ...xe,
406
412
  ...ve,
407
413
  ...Pe,
408
- ...Oe,
409
414
  ...qe,
415
+ ...Oe,
410
416
  ...Ve,
411
417
  ..._e,
412
- ...je
418
+ ...je,
419
+ ...Le
413
420
  ];
414
- function ue(e, t = "") {
415
- const r = /* @__PURE__ */ new Set(), i = (o, a, n) => {
416
- if (o === null || typeof o == "string" || typeof o == "boolean")
421
+ function pe(e, t = "") {
422
+ const r = /* @__PURE__ */ new Set(), o = (i, a, n) => {
423
+ if (i === null || typeof i == "string" || typeof i == "boolean")
417
424
  return null;
418
- if (typeof o == "number")
419
- return Number.isFinite(o) ? null : a;
420
- if (typeof o != "object" || n > 64 || r.has(o))
425
+ if (typeof i == "number")
426
+ return Number.isFinite(i) ? null : a;
427
+ if (typeof i != "object" || n > 64 || r.has(i))
421
428
  return a;
422
- if (!Array.isArray(o)) {
423
- const c = Object.getPrototypeOf(o);
429
+ if (!Array.isArray(i)) {
430
+ const c = Object.getPrototypeOf(i);
424
431
  if (c !== Object.prototype && c !== null) return a;
425
432
  }
426
- const s = Reflect.ownKeys(o);
433
+ const s = Reflect.ownKeys(i);
427
434
  if (s.some((c) => typeof c == "symbol")) return a;
428
- if (Array.isArray(o)) {
429
- if (s.length !== o.length + 1) return a;
430
- for (let c = 0; c < o.length; c++)
431
- if (!Object.prototype.hasOwnProperty.call(o, c))
435
+ if (Array.isArray(i)) {
436
+ if (s.length !== i.length + 1) return a;
437
+ for (let c = 0; c < i.length; c++)
438
+ if (!Object.prototype.hasOwnProperty.call(i, c))
432
439
  return `${a}[${c}]`;
433
440
  }
434
- r.add(o);
441
+ r.add(i);
435
442
  for (const c of s) {
436
- if (Array.isArray(o) && c === "length") continue;
437
- const l = Object.getOwnPropertyDescriptor(o, c), u = Array.isArray(o) ? `${a}[${String(c)}]` : a ? `${a}.${String(c)}` : String(c);
438
- if (!l || !("value" in l) || !Array.isArray(o) && !l.enumerable)
443
+ if (Array.isArray(i) && c === "length") continue;
444
+ const l = Object.getOwnPropertyDescriptor(i, c), u = Array.isArray(i) ? `${a}[${String(c)}]` : a ? `${a}.${String(c)}` : String(c);
445
+ if (!l || !("value" in l) || !Array.isArray(i) && !l.enumerable)
439
446
  return u;
440
- const d = i(l.value, u, n + 1);
447
+ const d = o(l.value, u, n + 1);
441
448
  if (d !== null) return d;
442
449
  }
443
- return r.delete(o), null;
450
+ return r.delete(i), null;
444
451
  };
445
452
  try {
446
- return i(e, t, 0);
453
+ return o(e, t, 0);
447
454
  } catch {
448
455
  return t;
449
456
  }
@@ -451,35 +458,35 @@ function ue(e, t = "") {
451
458
  function S(e, t, r) {
452
459
  return {
453
460
  choice: !0,
454
- present: (i) => ({
461
+ present: (o) => ({
455
462
  layout: "choice",
456
463
  icon: t,
457
- label: String(i.label || ""),
458
- ariaLabel: `${e}:${i.label || ""}`
464
+ label: String(o.label || ""),
465
+ ariaLabel: `${e}:${o.label || ""}`
459
466
  }),
460
467
  serialize: r
461
468
  };
462
469
  }
463
- const Le = S(
470
+ const Re = S(
464
471
  "待办",
465
472
  "rte-todo",
466
473
  (e) => e.label === "默认" && e.token === "{待办}" ? "{待办}" : `{待办@${e.label || e.key}}`
467
474
  );
468
- function st(e) {
475
+ function at(e) {
469
476
  const t = e.match(/^\{智能工单@name=([^{};\r\n]+);id=([^\s{};]+)\}$/u);
470
477
  if (t && t[1].trim())
471
478
  return { key: t[2], label: t[1], params: { protocol: "legacy" } };
472
479
  const r = e.match(/^\{智能建单@([^\s{}:]+):([^{}\r\n]+)\}$/u);
473
480
  return r && r[2].trim() ? { key: r[1], label: r[2] } : null;
474
481
  }
475
- function Re(e, t, r) {
482
+ function Ce(e, t, r) {
476
483
  return (r == null ? void 0 : r.protocol) === "legacy" ? `{智能工单@name=${t};id=${e}}` : `{智能建单@${e}:${t}}`;
477
484
  }
478
- const Ce = {
485
+ const De = {
479
486
  ...S(
480
487
  "工单",
481
488
  "AI-ticket",
482
- (e) => Re(
489
+ (e) => Ce(
483
490
  String(e.key || ""),
484
491
  String(e.label || ""),
485
492
  e.params
@@ -489,17 +496,17 @@ const Ce = {
489
496
  validate(e) {
490
497
  return e.params != null && (typeof e.params != "object" || Array.isArray(e.params) || Object.keys(e.params).length !== 1 || e.params.protocol !== "legacy") ? "params" : typeof e.key != "string" || !/^[^\s{}:]+$/u.test(e.key) ? "key" : typeof e.label != "string" || !e.label.trim() || /[{}\r\n]/u.test(e.label) || e.params != null && /[;]/u.test(e.label) ? "label" : e.params != null && /[;]/u.test(e.key) ? "key" : null;
491
498
  }
492
- }, De = {
499
+ }, Be = {
493
500
  ...S(
494
501
  "表格知识",
495
502
  "table-knowledge",
496
503
  (e) => `##${e.label}##`
497
504
  ),
498
505
  validate: (e) => typeof e.label != "string" || !e.label.trim() || /[#\r\n]/u.test(e.label) ? "label" : null
499
- }, Be = {
506
+ }, Ne = {
500
507
  ...S("属性", "prte-reference", (e) => `{属性@${e.key}}`),
501
508
  allowInOriginalReply: !1
502
- }, Ne = {
509
+ }, Ke = {
503
510
  requiresInsertToken: !0,
504
511
  present(e) {
505
512
  const t = String(e.label || e.key || "");
@@ -511,7 +518,7 @@ const Ce = {
511
518
  };
512
519
  },
513
520
  serialize: (e) => String(e.token || `#${e.key}#`)
514
- }, Ke = {
521
+ }, Me = {
515
522
  present: (e) => ({
516
523
  layout: "inline",
517
524
  icon: "sep",
@@ -520,11 +527,11 @@ const Ce = {
520
527
  }),
521
528
  serialize: () => "{分隔符}"
522
529
  };
523
- function Me(e, t) {
530
+ function Fe(e, t) {
524
531
  if (e !== "order_note" && e !== "small_payment") return null;
525
532
  const r = t && typeof t == "object" && !Array.isArray(t) ? t : {};
526
533
  if (e === "small_payment") {
527
- const o = typeof r.amount == "string" ? r.amount : "", a = /^(?:0|[1-9]\d*)(?:\.\d{1,2})?$/.test(o), [n = "", s = ""] = o.split(".");
534
+ const i = typeof r.amount == "string" ? r.amount : "", a = /^(?:0|[1-9]\d*)(?:\.\d{1,2})?$/.test(i), [n = "", s = ""] = i.split(".");
528
535
  return {
529
536
  label: "小额打款",
530
537
  icon: "rte-tool",
@@ -533,14 +540,14 @@ function Me(e, t) {
533
540
  }
534
541
  return { label: "备注", icon: "msg-tag", summary: r.contentMode === "smart" ? "智能提取" : typeof r.content == "string" ? r.content.replace(/\s+/g, " ").trim() : "" };
535
542
  }
536
- const pe = (e) => typeof e == "string" && /^(?:[1-9]|[1-9]\d)$/.test(e), de = (e) => typeof e == "string" && /^(?:rmk_[a-z0-9]{8}|[1-9]\d*)$/.test(e), $ = {
543
+ const de = (e) => typeof e == "string" && /^(?:[1-9]|[1-9]\d)$/.test(e), ge = (e) => typeof e == "string" && /^(?:rmk_[a-z0-9]{8}|[1-9]\d*)$/.test(e), $ = {
537
544
  none: "不标记",
538
545
  red: "红色",
539
546
  yellow: "黄色",
540
547
  green: "绿色",
541
548
  blue: "蓝色",
542
549
  purple: "紫色"
543
- }, at = {
550
+ }, lt = {
544
551
  none: "",
545
552
  red: "#f53f3f",
546
553
  yellow: "#ff7d00",
@@ -551,21 +558,21 @@ const pe = (e) => typeof e == "string" && /^(?:[1-9]|[1-9]\d)$/.test(e), de = (e
551
558
  function A(e) {
552
559
  if (!e || typeof e != "object" || Array.isArray(e)) return !1;
553
560
  const t = e;
554
- return de(t.id) && (t.contentMode === "fixed" || t.contentMode === "smart") && typeof t.content == "string" && !!t.content.trim() && [...t.content.trim()].length <= 500 && !/\^\^|\$\$|¥¥/.test(t.content) && !t.content.endsWith("^") && Object.hasOwn($, String(t.flag)) && typeof t.preserveFlag == "boolean" && (t.position === "first" || t.position === "last");
561
+ return ge(t.id) && (t.contentMode === "fixed" || t.contentMode === "smart") && typeof t.content == "string" && !!t.content.trim() && [...t.content.trim()].length <= 500 && !/\^\^|\$\$|¥¥/.test(t.content) && !t.content.endsWith("^") && Object.hasOwn($, String(t.flag)) && typeof t.preserveFlag == "boolean" && (t.position === "first" || t.position === "last");
555
562
  }
556
- function ae() {
563
+ function le() {
557
564
  return `rmk_${crypto.randomUUID().replace(/-/g, "").slice(0, 8)}`;
558
565
  }
559
- function lt(e, t, r, i, o) {
566
+ function ct(e, t, r, o, i) {
560
567
  if (e !== "small_payment" && e !== "order_note")
561
568
  return { ok: !0, params: t };
562
569
  let a = 0;
563
570
  const n = /* @__PURE__ */ new Set(), s = (u) => {
564
571
  var d, y, g;
565
- u.type === "businessToken" && ((d = u.attrs) == null ? void 0 : d.kind) === "tool" && (!o || u.attrs.id !== o) && (u.attrs.key === "small_payment" && a++, u.attrs.key === "order_note" && n.add(String(((y = u.attrs.params) == null ? void 0 : y.id) || ""))), (g = u.content) == null || g.forEach(s);
572
+ u.type === "businessToken" && ((d = u.attrs) == null ? void 0 : d.kind) === "tool" && (!i || u.attrs.id !== i) && (u.attrs.key === "small_payment" && a++, u.attrs.key === "order_note" && n.add(String(((y = u.attrs.params) == null ? void 0 : y.id) || ""))), (g = u.content) == null || g.forEach(s);
566
573
  };
567
- if (i && s(i), e === "small_payment")
568
- return pe(t.amount) ? a ? {
574
+ if (o && s(o), e === "small_payment")
575
+ return de(t.amount) ? a ? {
569
576
  ok: !1,
570
577
  code: "TOOL_LIMIT_REACHED",
571
578
  message: "最多配置一个小额打款工具"
@@ -574,9 +581,9 @@ function lt(e, t, r, i, o) {
574
581
  code: "TOOL_PARAMS_INVALID",
575
582
  message: "打款金额必须是1-99的整数元"
576
583
  };
577
- let c = de(r.id) ? r.id : ae();
578
- if (!o)
579
- for (; n.has(c); ) c = ae();
584
+ let c = ge(r.id) ? r.id : le();
585
+ if (!i)
586
+ for (; n.has(c); ) c = le();
580
587
  if (n.has(c))
581
588
  return {
582
589
  ok: !1,
@@ -590,7 +597,7 @@ function lt(e, t, r, i, o) {
590
597
  message: "订单备注内容或配置不合法"
591
598
  };
592
599
  }
593
- function ct(e) {
600
+ function ut(e) {
594
601
  const t = /^\{外部方法@([^\s{}:]+):([^{}\r\n]+)\}$/u.exec(e);
595
602
  if (t && t[2].trim())
596
603
  return {
@@ -615,38 +622,38 @@ function ct(e) {
615
622
  }
616
623
  };
617
624
  }
618
- const i = /^\^\^订单备注-(固定话术|智能提取)@编号=(rmk_[a-z0-9]{8}|[1-9]\d*);插旗=([^;]+);保留已有旗帜=(是|否);位置=(最前|最后);内容=([\s\S]+)\^\^$/u.exec(
625
+ const o = /^\^\^订单备注-(固定话术|智能提取)@编号=(rmk_[a-z0-9]{8}|[1-9]\d*);插旗=([^;]+);保留已有旗帜=(是|否);位置=(最前|最后);内容=([\s\S]+)\^\^$/u.exec(
619
626
  e
620
627
  );
621
- if (!i) return null;
622
- const o = Object.keys($).find(
623
- (n) => $[n] === i[3]
624
- );
625
628
  if (!o) return null;
629
+ const i = Object.keys($).find(
630
+ (n) => $[n] === o[3]
631
+ );
632
+ if (!i) return null;
626
633
  const a = {
627
- id: i[2],
628
- contentMode: i[1] === "固定话术" ? "fixed" : "smart",
629
- content: i[6],
630
- flag: o,
631
- preserveFlag: i[4] === "是",
632
- position: i[5] === "最前" ? "first" : "last"
634
+ id: o[2],
635
+ contentMode: o[1] === "固定话术" ? "fixed" : "smart",
636
+ content: o[6],
637
+ flag: i,
638
+ preserveFlag: o[4] === "是",
639
+ position: o[5] === "最前" ? "first" : "last"
633
640
  };
634
641
  return A(a) ? {
635
642
  type: "businessToken",
636
643
  attrs: { kind: "tool", key: "order_note", label: "订单备注", params: a }
637
644
  } : null;
638
645
  }
639
- function le(e) {
646
+ function ce(e) {
640
647
  var r;
641
648
  if (e.type !== "businessToken" || ((r = e.attrs) == null ? void 0 : r.kind) !== "tool") return null;
642
649
  const { params: t } = e.attrs;
643
650
  if (e.attrs.key === "external_method") {
644
- const { sceneId: i, sceneName: o } = t || {};
645
- return typeof i == "string" && /^[^\s{}:]+$/u.test(i) && typeof o == "string" && o.trim() && !/[{}\r\n]/u.test(o) ? `{外部方法@${i}:${o}}` : null;
651
+ const { sceneId: o, sceneName: i } = t || {};
652
+ return typeof o == "string" && /^[^\s{}:]+$/u.test(o) && typeof i == "string" && i.trim() && !/[{}\r\n]/u.test(i) ? `{外部方法@${o}:${i}}` : null;
646
653
  }
647
- return e.attrs.key === "small_payment" ? pe(t == null ? void 0 : t.amount) ? `$$小额打款@${Number(t.amount) * 100}$$` : null : e.attrs.key !== "order_note" || !A(t) ? null : `^^订单备注-${t.contentMode === "fixed" ? "固定话术" : "智能提取"}@编号=${t.id};插旗=${$[t.flag]};保留已有旗帜=${t.preserveFlag ? "是" : "否"};位置=${t.position === "first" ? "最前" : "最后"};内容=${t.content}^^`;
654
+ return e.attrs.key === "small_payment" ? de(t == null ? void 0 : t.amount) ? `$$小额打款@${Number(t.amount) * 100}$$` : null : e.attrs.key !== "order_note" || !A(t) ? null : `^^订单备注-${t.contentMode === "fixed" ? "固定话术" : "智能提取"}@编号=${t.id};插旗=${$[t.flag]};保留已有旗帜=${t.preserveFlag ? "是" : "否"};位置=${t.position === "first" ? "最前" : "最后"};内容=${t.content}^^`;
648
655
  }
649
- function ut(e) {
656
+ function pt(e) {
650
657
  try {
651
658
  const t = JSON.parse(decodeURIComponent(e)), r = {
652
659
  id: String(t.id || ""),
@@ -664,15 +671,15 @@ function ut(e) {
664
671
  return null;
665
672
  }
666
673
  }
667
- const Fe = {
674
+ const Ee = {
668
675
  allowsParams: !0,
669
676
  validate(e) {
670
677
  return ["small_payment", "order_note", "external_method"].includes(
671
678
  String(e.key)
672
- ) ? le({ type: "businessToken", attrs: { ...e } }) ? null : "params" : null;
679
+ ) ? ce({ type: "businessToken", attrs: { ...e } }) ? null : "params" : null;
673
680
  },
674
681
  present(e) {
675
- const t = Me(e.key, e.params);
682
+ const t = Fe(e.key, e.params);
676
683
  return t ? {
677
684
  layout: "toolNote",
678
685
  icon: t.icon,
@@ -691,7 +698,7 @@ const Fe = {
691
698
  if (["small_payment", "order_note", "external_method"].includes(
692
699
  String(e.key)
693
700
  )) {
694
- const t = le({
701
+ const t = ce({
695
702
  type: "businessToken",
696
703
  attrs: { ...e }
697
704
  });
@@ -700,63 +707,63 @@ const Fe = {
700
707
  }
701
708
  return `{工具@${e.key}}`;
702
709
  }
703
- }, ge = {
704
- todo: Le,
705
- ticket: Ce,
706
- tableKnowledge: De,
707
- variable: Ne,
708
- attribute: Be,
709
- tool: Fe,
710
- separator: Ke
711
- }, P = ge;
710
+ }, fe = {
711
+ todo: Re,
712
+ ticket: De,
713
+ tableKnowledge: Be,
714
+ variable: Ke,
715
+ attribute: Ne,
716
+ tool: Ee,
717
+ separator: Me
718
+ }, P = fe;
712
719
  function I(e) {
713
720
  return typeof e == "string" && Object.prototype.hasOwnProperty.call(P, e) ? P[e] : void 0;
714
721
  }
715
- const fe = Object.keys(
716
- ge
717
- ), Ee = fe.filter(
722
+ const ye = Object.keys(
723
+ fe
724
+ ), Ue = ye.filter(
718
725
  (e) => P[e].choice
719
- ), Ue = ["image", "video"], ze = new Set(fe), We = new Set(Ee), He = new Set(Ue), ye = (e) => typeof e == "string" && ze.has(e), pt = (e) => typeof e == "string" && We.has(e), me = (e) => typeof e == "string" && He.has(e), Je = /* @__PURE__ */ new Set([
726
+ ), ze = ["image", "video"], We = new Set(ye), He = new Set(Ue), Je = new Set(ze), me = (e) => typeof e == "string" && We.has(e), dt = (e) => typeof e == "string" && He.has(e), ke = (e) => typeof e == "string" && Je.has(e), Qe = /* @__PURE__ */ new Set([
720
727
  "businessToken",
721
728
  "originalReply",
722
729
  "messageSeparator",
723
730
  "mediaBlock"
724
- ]), V = (e) => Je.has(e);
725
- function Qe(e, t) {
726
- return e === "businessToken" ? ye(t == null ? void 0 : t.kind) ? t.kind : null : e === "mediaBlock" ? me(t == null ? void 0 : t.kind) ? t.kind : null : e === "originalReply" ? "originalReply" : e === "messageSeparator" ? "separator" : null;
731
+ ]), V = (e) => Qe.has(e);
732
+ function Ge(e, t) {
733
+ return e === "businessToken" ? me(t == null ? void 0 : t.kind) ? t.kind : null : e === "mediaBlock" ? ke(t == null ? void 0 : t.kind) ? t.kind : null : e === "originalReply" ? "originalReply" : e === "messageSeparator" ? "separator" : null;
727
734
  }
728
- function Ge(e) {
729
- const t = Qe(e.type || "", e.attrs);
735
+ function Ye(e) {
736
+ const t = Ge(e.type || "", e.attrs);
730
737
  return t ? {
731
738
  id: t,
732
739
  slot: e.type === "businessToken" || e.type === "messageSeparator" ? "knowledgeInline" : "knowledgeBlock"
733
740
  } : null;
734
741
  }
735
- function Ye(e) {
742
+ function Xe(e) {
736
743
  var t;
737
744
  return !!((t = e.content) != null && t.some(
738
- (r) => typeof r.type == "string" && V(r.type) || Ye(r)
745
+ (r) => typeof r.type == "string" && V(r.type) || Xe(r)
739
746
  ));
740
747
  }
741
- const dt = "fkpTrustedNodeIds";
742
- function gt(e) {
743
- const t = [], r = (i) => {
744
- var o, a;
745
- i.type && V(i.type) && typeof ((o = i.attrs) == null ? void 0 : o.id) == "string" && i.attrs.id && t.push(i.attrs.id), (a = i.content) == null || a.forEach(r);
748
+ const gt = "fkpTrustedNodeIds";
749
+ function ft(e) {
750
+ const t = [], r = (o) => {
751
+ var i, a;
752
+ o.type && V(o.type) && typeof ((i = o.attrs) == null ? void 0 : i.id) == "string" && o.attrs.id && t.push(o.attrs.id), (a = o.content) == null || a.forEach(r);
746
753
  };
747
754
  return Array.isArray(e) ? e.forEach(r) : r(e), t;
748
755
  }
749
- function ft(e, t) {
756
+ function yt(e, t) {
750
757
  for (let a = 0; a < 8; a++) {
751
758
  const n = t();
752
759
  if (n && !e.has(n)) return n;
753
760
  }
754
761
  const r = t() || "node";
755
- let i = r, o = 1;
756
- for (; e.has(i); ) i = `${r}-${o++}`;
757
- return i;
762
+ let o = r, i = 1;
763
+ for (; e.has(o); ) o = `${r}-${i++}`;
764
+ return o;
758
765
  }
759
- function O(e) {
766
+ function q(e) {
760
767
  if (typeof e != "string" || !/^https?:\/\/[^\s]+$/i.test(e))
761
768
  return !1;
762
769
  try {
@@ -766,40 +773,46 @@ function O(e) {
766
773
  return !1;
767
774
  }
768
775
  }
769
- function Xe(e) {
770
- return e.includes("[") || e.includes("]") || /[【】\r\n]/u.test(e);
776
+ function Ze(e) {
777
+ if (e.includes("[") || e.includes("]") || /[\r\n]/u.test(e))
778
+ return !0;
779
+ let t = 0;
780
+ for (const r of e)
781
+ if (r === "【") t++;
782
+ else if (r === "】" && --t < 0) return !0;
783
+ return t !== 0;
771
784
  }
772
- function ke(e) {
785
+ function be(e) {
773
786
  return /[{}\r\n]/u.test(e);
774
787
  }
775
- function Ze(e, t) {
788
+ function et(e, t) {
776
789
  var n;
777
790
  const r = (n = e.extensionState[t]) == null ? void 0 : n.data;
778
791
  if (!r || typeof r != "object" || Array.isArray(r)) return null;
779
- const { tag: i } = r;
780
- if (!i || typeof i != "object" || Array.isArray(i)) return null;
781
- const { id: o, label: a } = i;
782
- return typeof o != "string" || !o.trim() || typeof a != "string" || !a.trim() ? null : { id: o, label: a };
792
+ const { tag: o } = r;
793
+ if (!o || typeof o != "object" || Array.isArray(o)) return null;
794
+ const { id: i, label: a } = o;
795
+ return typeof i != "string" || !i.trim() || typeof a != "string" || !a.trim() ? null : { id: i, label: a };
783
796
  }
784
- function et(e) {
785
- return q.filter(
797
+ function tt(e) {
798
+ return O.filter(
786
799
  (t) => t.slot === "questionAction" && t.questionTag && t.types.includes(e.type)
787
800
  ).sort((t, r) => t.order - r.order).flatMap(({ id: t, questionTag: r }) => {
788
801
  var s;
789
- const i = r.protocolLabel, o = (s = e.extensionState[t]) == null ? void 0 : s.data, a = o && typeof o == "object" && !Array.isArray(o) ? o.enabled === !0 : !1, n = a ? Ze(e, t) : null;
790
- if (a && !n) throw new Error(`${i}已开启但未选择方案`);
791
- if (n && ke(n.label))
802
+ const o = r.protocolLabel, i = (s = e.extensionState[t]) == null ? void 0 : s.data, a = i && typeof i == "object" && !Array.isArray(i) ? i.enabled === !0 : !1, n = a ? et(e, t) : null;
803
+ if (a && !n) throw new Error(`${o}已开启但未选择方案`);
804
+ if (n && be(n.label))
792
805
  throw new Error("方案名称包含协议保留字符");
793
- return n ? [`{${i}@${n.label}}`] : [];
806
+ return n ? [`{${o}@${n.label}}`] : [];
794
807
  }).join("");
795
808
  }
796
- function yt(e) {
809
+ function mt(e) {
797
810
  var t;
798
- if (typeof ((t = e.question) == null ? void 0 : t.text) != "string" || Xe(e.question.text))
799
- throw new Error("意图文字中不可填写方括号或换行,请修改");
800
- return `[${e.question.text}]${et(e)}`;
811
+ if (typeof ((t = e.question) == null ? void 0 : t.text) != "string" || Ze(e.question.text))
812
+ throw new Error("意图文字不能包含半角方括号、换行或未配对的【】");
813
+ return `[${e.question.text}]${tt(e)}`;
801
814
  }
802
- const be = /* @__PURE__ */ new Set([
815
+ const we = /* @__PURE__ */ new Set([
803
816
  "doc",
804
817
  "paragraph",
805
818
  "text",
@@ -814,7 +827,7 @@ const be = /* @__PURE__ */ new Set([
814
827
  "originalReply",
815
828
  "messageSeparator",
816
829
  "mediaBlock"
817
- ]), mt = (e) => be.has(e), tt = /* @__PURE__ */ new Set([
830
+ ]), kt = (e) => we.has(e), nt = /* @__PURE__ */ new Set([
818
831
  "bold",
819
832
  "italic",
820
833
  "strike",
@@ -831,7 +844,7 @@ const be = /* @__PURE__ */ new Set([
831
844
  "originalReply",
832
845
  "messageSeparator",
833
846
  "mediaBlock"
834
- ]), ce = {
847
+ ]), ue = {
835
848
  doc: x,
836
849
  paragraph: /* @__PURE__ */ new Set(["text", "hardBreak", "businessToken"]),
837
850
  bulletList: /* @__PURE__ */ new Set(["listItem"]),
@@ -840,7 +853,7 @@ const be = /* @__PURE__ */ new Set([
840
853
  blockquote: x,
841
854
  codeBlock: /* @__PURE__ */ new Set(["text"]),
842
855
  originalReply: /* @__PURE__ */ new Set(["paragraph", "mediaBlock", "messageSeparator"])
843
- }, nt = {
856
+ }, rt = {
844
857
  orderedList: /* @__PURE__ */ new Set(["start", "type"]),
845
858
  codeBlock: /* @__PURE__ */ new Set(["language"]),
846
859
  businessToken: /* @__PURE__ */ new Set([
@@ -866,32 +879,32 @@ const be = /* @__PURE__ */ new Set([
866
879
  "error"
867
880
  ])
868
881
  };
869
- function rt(e) {
882
+ function it(e) {
870
883
  if (!e || typeof e != "object" || Array.isArray(e)) return !1;
871
884
  const t = e;
872
- if (typeof t.type != "string" || !tt.has(t.type) || Object.keys(t).some((o) => !["type", "attrs"].includes(o)) || t.attrs !== void 0 && (!t.attrs || typeof t.attrs != "object" || Array.isArray(t.attrs)))
885
+ if (typeof t.type != "string" || !nt.has(t.type) || Object.keys(t).some((i) => !["type", "attrs"].includes(i)) || t.attrs !== void 0 && (!t.attrs || typeof t.attrs != "object" || Array.isArray(t.attrs)))
873
886
  return !1;
874
887
  const r = t.attrs || {};
875
888
  if (t.type !== "link") return Object.keys(r).length === 0;
876
889
  if (Object.keys(r).some(
877
- (o) => !["href", "target", "rel", "class", "title"].includes(o)
878
- ) || !O(r.href))
890
+ (i) => !["href", "target", "rel", "class", "title"].includes(i)
891
+ ) || !q(r.href))
879
892
  return !1;
880
- const i = (o) => o == null || typeof o == "string";
881
- return !i(r.rel) || !i(r.class) || !i(r.title) || r.target !== void 0 && r.target !== null && !["_blank", "_self"].includes(String(r.target)) ? !1 : r.target !== "_blank" || typeof r.rel == "string" && r.rel.split(/\s+/).includes("noopener");
893
+ const o = (i) => i == null || typeof i == "string";
894
+ return !o(r.rel) || !o(r.class) || !o(r.title) || r.target !== void 0 && r.target !== null && !["_blank", "_self"].includes(String(r.target)) ? !1 : r.target !== "_blank" || typeof r.rel == "string" && r.rel.split(/\s+/).includes("noopener");
882
895
  }
883
896
  function k(e, t, r = "") {
884
- const i = Object.keys(e).find(
885
- (o) => !t.includes(o)
897
+ const o = Object.keys(e).find(
898
+ (i) => !t.includes(i)
886
899
  );
887
- return i ? r ? `${r}.${i}` : i : null;
900
+ return o ? r ? `${r}.${o}` : o : null;
888
901
  }
889
902
  function v(e, t = "knowledge.doc", r = !1) {
890
903
  if (e === null) return null;
891
- const i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new WeakSet();
904
+ const o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new WeakSet();
892
905
  function a(n, s, c, l = !1) {
893
- var d, y, g, m, f, b, _, j, L, R, h, C, D, B, N, K, M, F, E, U, z, W, H, J, Q, G, Y, X, Z, ee, te, ne, re, oe, ie;
894
- if (!n || typeof n != "object" || !n.type || !be.has(n.type) || o.has(n) || (o.add(n), c ? !((d = ce[c]) != null && d.has(n.type)) : n.type !== "doc") || !r && l && n.type === "businessToken" && ((g = I((y = n.attrs) == null ? void 0 : y.kind)) == null ? void 0 : g.allowInOriginalReply) === !1)
906
+ var d, y, g, m, f, b, _, j, L, R, h, C, D, B, N, K, M, F, E, U, z, W, H, J, Q, G, Y, X, Z, ee, te, ne, re, ie, oe;
907
+ if (!n || typeof n != "object" || !n.type || !we.has(n.type) || i.has(n) || (i.add(n), c ? !((d = ue[c]) != null && d.has(n.type)) : n.type !== "doc") || !r && l && n.type === "businessToken" && ((g = I((y = n.attrs) == null ? void 0 : y.kind)) == null ? void 0 : g.allowInOriginalReply) === !1)
895
908
  return s;
896
909
  for (const p of Object.keys(n))
897
910
  if (!["type", "attrs", "content", "marks", "text"].includes(p))
@@ -909,14 +922,14 @@ function v(e, t = "knowledge.doc", r = !1) {
909
922
  return `${s}.text`;
910
923
  if (n.type === "text" && n.content !== void 0)
911
924
  return `${s}.content`;
912
- if ((j = n.content) != null && j.length && !ce[n.type])
925
+ if ((j = n.content) != null && j.length && !ue[n.type])
913
926
  return `${s}.content`;
914
927
  if (n.attrs !== void 0 && (!n.attrs || typeof n.attrs != "object" || Array.isArray(n.attrs)))
915
928
  return `${s}.attrs`;
916
- const u = nt[n.type] || /* @__PURE__ */ new Set();
929
+ const u = rt[n.type] || /* @__PURE__ */ new Set();
917
930
  for (const p of Object.keys(n.attrs || {}))
918
931
  if (!u.has(p)) return `${s}.attrs.${p}`;
919
- if (n.type === "businessToken" && !ye((L = n.attrs) == null ? void 0 : L.kind))
932
+ if (n.type === "businessToken" && !me((L = n.attrs) == null ? void 0 : L.kind))
920
933
  return `${s}.attrs.kind`;
921
934
  if (n.type === "businessToken") {
922
935
  const p = (C = (h = I(
@@ -930,9 +943,9 @@ function v(e, t = "knowledge.doc", r = !1) {
930
943
  return `${s}.attrs.label`;
931
944
  if (n.type === "businessToken" && ((N = n.attrs) == null ? void 0 : N.token) !== void 0 && n.attrs.token !== null && typeof n.attrs.token != "string")
932
945
  return `${s}.attrs.token`;
933
- if (n.type === "businessToken" && ((K = n.attrs) == null ? void 0 : K.params) != null && (!((M = I(n.attrs.kind)) != null && M.allowsParams) || typeof n.attrs.params != "object" || Array.isArray(n.attrs.params) || ue(n.attrs.params) !== null || JSON.stringify(n.attrs.params).length > 8192))
946
+ if (n.type === "businessToken" && ((K = n.attrs) == null ? void 0 : K.params) != null && (!((M = I(n.attrs.kind)) != null && M.allowsParams) || typeof n.attrs.params != "object" || Array.isArray(n.attrs.params) || pe(n.attrs.params) !== null || JSON.stringify(n.attrs.params).length > 8192))
934
947
  return `${s}.attrs.params`;
935
- if (n.type === "mediaBlock" && !me((F = n.attrs) == null ? void 0 : F.kind))
948
+ if (n.type === "mediaBlock" && !ke((F = n.attrs) == null ? void 0 : F.kind))
936
949
  return `${s}.attrs.kind`;
937
950
  if (n.type === "mediaBlock") {
938
951
  if (((E = n.attrs) == null ? void 0 : E.assetId) !== void 0 && n.attrs.assetId !== null && typeof n.attrs.assetId != "string")
@@ -944,16 +957,16 @@ function v(e, t = "knowledge.doc", r = !1) {
944
957
  if (((W = n.attrs) == null ? void 0 : W.status) !== void 0 && !["ready", "uploading", "error"].includes(String(n.attrs.status)))
945
958
  return `${s}.attrs.status`;
946
959
  const p = (((H = n.attrs) == null ? void 0 : H.status) === "uploading" || ((J = n.attrs) == null ? void 0 : J.status) === "error") && typeof ((Q = n.attrs) == null ? void 0 : Q.src) == "string" && n.attrs.src.startsWith("blob:");
947
- if (!O((G = n.attrs) == null ? void 0 : G.src) && !p)
960
+ if (!q((G = n.attrs) == null ? void 0 : G.src) && !p)
948
961
  return `${s}.attrs.src`;
949
- if (((Y = n.attrs) == null ? void 0 : Y.poster) !== void 0 && n.attrs.poster !== null && !O(n.attrs.poster))
962
+ if (((Y = n.attrs) == null ? void 0 : Y.poster) !== void 0 && n.attrs.poster !== null && !q(n.attrs.poster))
950
963
  return `${s}.attrs.poster`;
951
964
  }
952
965
  if (V(n.type)) {
953
966
  const p = (X = n.attrs) == null ? void 0 : X.id;
954
- if ((n.type === "mediaBlock" || p !== void 0) && (typeof p != "string" || !p.trim() || i.has(p)))
967
+ if ((n.type === "mediaBlock" || p !== void 0) && (typeof p != "string" || !p.trim() || o.has(p)))
955
968
  return `${s}.attrs.id`;
956
- if (typeof p == "string" && i.add(p), ((Z = n.attrs) == null ? void 0 : Z.nodeVersion) !== void 0 && (!Number.isSafeInteger(n.attrs.nodeVersion) || n.attrs.nodeVersion < 0))
969
+ if (typeof p == "string" && o.add(p), ((Z = n.attrs) == null ? void 0 : Z.nodeVersion) !== void 0 && (!Number.isSafeInteger(n.attrs.nodeVersion) || n.attrs.nodeVersion < 0))
957
970
  return `${s}.attrs.nodeVersion`;
958
971
  }
959
972
  if (n.type === "orderedList" && ((ee = n.attrs) == null ? void 0 : ee.start) !== void 0 && (!Number.isSafeInteger(n.attrs.start) || n.attrs.start < 1))
@@ -965,9 +978,9 @@ function v(e, t = "knowledge.doc", r = !1) {
965
978
  if (n.marks !== void 0 && !Array.isArray(n.marks))
966
979
  return `${s}.marks`;
967
980
  if (c === "codeBlock" && ((re = n.marks) != null && re.length)) return `${s}.marks`;
968
- if ((oe = n.marks) != null && oe.some((p) => !rt(p)))
981
+ if ((ie = n.marks) != null && ie.some((p) => !it(p)))
969
982
  return `${s}.marks`;
970
- if ((ie = n.marks) != null && ie.length) {
983
+ if ((oe = n.marks) != null && oe.length) {
971
984
  const p = n.marks.map((T) => T.type);
972
985
  if (new Set(p).size !== p.length || p.includes("code") && p.length > 1)
973
986
  return `${s}.marks`;
@@ -987,35 +1000,35 @@ function v(e, t = "knowledge.doc", r = !1) {
987
1000
  }
988
1001
  function ot(e, t, r = "knowledge.doc") {
989
1002
  if (!e) return null;
990
- const i = /* @__PURE__ */ new WeakSet(), o = (a, n) => {
991
- if (i.has(a)) return n;
992
- i.add(a);
993
- const s = Ge(a);
994
- if (s && !q.some(
1003
+ const o = /* @__PURE__ */ new WeakSet(), i = (a, n) => {
1004
+ if (o.has(a)) return n;
1005
+ o.add(a);
1006
+ const s = Ye(a);
1007
+ if (s && !O.some(
995
1008
  (c) => c.id === s.id && c.slot === s.slot && c.types.includes(t)
996
1009
  ))
997
1010
  return n;
998
1011
  for (const [c, l] of (a.content || []).entries()) {
999
- const u = o(l, `${n}.content[${c}]`);
1012
+ const u = i(l, `${n}.content[${c}]`);
1000
1013
  if (u) return u;
1001
1014
  }
1002
1015
  return null;
1003
1016
  };
1004
- return o(e, r);
1017
+ return i(e, r);
1005
1018
  }
1006
- function kt(e) {
1019
+ function bt(e) {
1007
1020
  if (!e || typeof e != "object" || Array.isArray(e)) return !1;
1008
- const t = e, r = t.question, i = t.knowledge;
1009
- return ["normal", "reasoning", "agent"].includes(String(t.type)) && !!r && typeof r == "object" && !Array.isArray(r) && typeof r.text == "string" && !!i && typeof i == "object" && !Array.isArray(i) && Object.prototype.hasOwnProperty.call(i, "doc") && !!t.extensionState && typeof t.extensionState == "object" && !Array.isArray(t.extensionState);
1021
+ const t = e, r = t.question, o = t.knowledge;
1022
+ return ["normal", "reasoning", "agent"].includes(String(t.type)) && !!r && typeof r == "object" && !Array.isArray(r) && typeof r.text == "string" && !!o && typeof o == "object" && !Array.isArray(o) && Object.prototype.hasOwnProperty.call(o, "doc") && !!t.extensionState && typeof t.extensionState == "object" && !Array.isArray(t.extensionState);
1010
1023
  }
1011
- function bt(e) {
1024
+ function wt(e) {
1012
1025
  if (!e || typeof e != "object" || Array.isArray(e))
1013
1026
  return "modelValue";
1014
- const t = ue(e);
1027
+ const t = pe(e);
1015
1028
  if (t !== null) return t || "modelValue";
1016
1029
  const r = e;
1017
1030
  if (r.schemaVersion !== 1) return "schemaVersion";
1018
- const i = k(r, [
1031
+ const o = k(r, [
1019
1032
  "schemaVersion",
1020
1033
  "id",
1021
1034
  "type",
@@ -1023,17 +1036,17 @@ function bt(e) {
1023
1036
  "knowledge",
1024
1037
  "extensionState"
1025
1038
  ]);
1026
- if (i) return i;
1039
+ if (o) return o;
1027
1040
  if (r.id !== void 0 && typeof r.id != "string") return "id";
1028
1041
  if (!["normal", "reasoning", "agent"].includes(r.type)) return "type";
1029
1042
  if (!r.question || typeof r.question != "object" || Array.isArray(r.question) || typeof r.question.text != "string")
1030
1043
  return "question.text";
1031
- const o = k(
1044
+ const i = k(
1032
1045
  r.question,
1033
1046
  ["text"],
1034
1047
  "question"
1035
1048
  );
1036
- if (o) return o;
1049
+ if (i) return i;
1037
1050
  if (!r.knowledge || typeof r.knowledge != "object" || Array.isArray(r.knowledge))
1038
1051
  return "knowledge";
1039
1052
  const a = k(
@@ -1088,7 +1101,7 @@ function bt(e) {
1088
1101
  if (!r.extensionState || typeof r.extensionState != "object" || Array.isArray(r.extensionState))
1089
1102
  return "extensionState";
1090
1103
  for (const [l, u] of Object.entries(r.extensionState)) {
1091
- const d = q.find(
1104
+ const d = O.find(
1092
1105
  (g) => g.id === l && g.types.includes(r.type) && g.implementation === "plugin"
1093
1106
  );
1094
1107
  if (!d) return `extensionState.${l}`;
@@ -1115,7 +1128,7 @@ function bt(e) {
1115
1128
  const f = m;
1116
1129
  if (typeof f.id != "string" || !f.id.trim())
1117
1130
  return `extensionState.${l}.data.tag.id`;
1118
- if (typeof f.label != "string" || !f.label.trim() || ke(f.label))
1131
+ if (typeof f.label != "string" || !f.label.trim() || be(f.label))
1119
1132
  return `extensionState.${l}.data.tag.label`;
1120
1133
  const b = k(
1121
1134
  f,
@@ -1129,40 +1142,40 @@ function bt(e) {
1129
1142
  return null;
1130
1143
  }
1131
1144
  export {
1132
- q as A,
1133
- it as B,
1134
- Ee as C,
1135
- Ge as D,
1136
- mt as E,
1137
- kt as F,
1138
- ke as G,
1139
- fe as H,
1140
- Ze as I,
1141
- Ue as M,
1142
- et as a,
1143
- O as b,
1144
- bt as c,
1145
- Re as d,
1146
- st as e,
1147
- ue as f,
1145
+ O as A,
1146
+ st as B,
1147
+ Ue as C,
1148
+ Ye as D,
1149
+ kt as E,
1150
+ bt as F,
1151
+ be as G,
1152
+ ye as H,
1153
+ et as I,
1154
+ ze as M,
1155
+ pe as a,
1156
+ v as b,
1157
+ de as c,
1158
+ V as d,
1159
+ tt as e,
1160
+ ce as f,
1148
1161
  I as g,
1149
- Xe as h,
1150
- V as i,
1151
- le as j,
1152
- ct as k,
1153
- ut as l,
1154
- ft as m,
1155
- ye as n,
1156
- pe as o,
1157
- lt as p,
1158
- A as q,
1159
- v as r,
1160
- yt as s,
1161
- dt as t,
1162
- gt as u,
1163
- at as v,
1162
+ Ze as h,
1163
+ q as i,
1164
+ wt as j,
1165
+ Ce as k,
1166
+ at as l,
1167
+ ut as m,
1168
+ pt as n,
1169
+ yt as o,
1170
+ ct as p,
1171
+ me as q,
1172
+ A as r,
1173
+ mt as s,
1174
+ gt as t,
1175
+ ft as u,
1176
+ lt as v,
1164
1177
  $ as w,
1165
- pt as x,
1166
- Qe as y,
1167
- Ye as z
1178
+ dt as x,
1179
+ Ge as y,
1180
+ Xe as z
1168
1181
  };