wi-chat 0.6.1 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/core/index.cjs +1 -1
  2. package/dist/core/index.js +273 -261
  3. package/dist/core/useChat.d.ts +61 -12
  4. package/dist/index.cjs +1 -1
  5. package/dist/index.d.ts +1 -1
  6. package/dist/index.js +33 -33
  7. package/dist/mobile-ui/chat/ChatContainer.vue.d.ts +6 -6
  8. package/dist/mobile-ui/chat/ChatMessagesView.vue.d.ts +6 -6
  9. package/dist/mobile-ui/index.cjs +1 -1
  10. package/dist/mobile-ui/index.js +104 -104
  11. package/dist/mobile-ui/inputbox/Inputbox.vue.d.ts +5 -5
  12. package/dist/page-context/index.js +2 -4
  13. package/dist/parser/answerCom/actionExecute/actionProtocol.d.ts +1 -7
  14. package/dist/parser/answerCom/actionExecute/clarification.d.ts +15 -3
  15. package/dist/parser/answerCom/actionExecute/constants.d.ts +10 -0
  16. package/dist/parser/answerCom/actionExecute/parseCollectClarifications.d.ts +3 -2
  17. package/dist/parser/answerCom/actionExecute/parseHostAction.d.ts +3 -2
  18. package/dist/parser/answerCom/actionExecute/types.d.ts +3 -3
  19. package/dist/parser/index.cjs +2 -2
  20. package/dist/parser/index.d.ts +2 -2
  21. package/dist/parser/index.js +216 -258
  22. package/dist/parser/registry.d.ts +1 -1
  23. package/dist/renderers/aiAnswer/AiAnswerBubble.vue.d.ts +4 -4
  24. package/dist/renderers/clarification/ClarificationCard.vue.d.ts +3 -3
  25. package/dist/renderers/deepThinking/DeepThinkingSteps.vue.d.ts +4 -4
  26. package/dist/renderers/hostAction/HostActionStatus.vue.d.ts +3 -3
  27. package/dist/renderers/iframePage/IframePage.vue.d.ts +3 -3
  28. package/dist/renderers/index.cjs +1 -1
  29. package/dist/renderers/index.js +484 -498
  30. package/dist/renderers/knowledgeStream/KnowledgeStreamResult.vue.d.ts +3 -3
  31. package/dist/renderers/outputFile/OutputFile.vue.d.ts +3 -3
  32. package/dist/renderers/style.css +1 -1
  33. package/dist/request/index.cjs +2 -2
  34. package/dist/request/index.js +6 -13
  35. package/dist/request/ws.d.ts +3 -3
  36. package/dist/right-panel/RightPanel.vue.d.ts +6 -6
  37. package/dist/right-panel/RightPanelIcon.vue.d.ts +4 -4
  38. package/dist/right-panel/RightPanelTabs.vue.d.ts +5 -5
  39. package/dist/right-panel/index.cjs +1 -1
  40. package/dist/right-panel/index.js +397 -416
  41. package/dist/right-panel/panels/newtab/NewTabPanel.vue.d.ts +4 -4
  42. package/dist/right-panel/panels/web/WebPanel.vue.d.ts +3 -3
  43. package/dist/right-panel/shared/BrowserToolbar.vue.d.ts +3 -3
  44. package/dist/right-panel/shared/RightPanelToolList.vue.d.ts +5 -5
  45. package/dist/theme/index.js +2 -4
  46. package/dist/tools/index.cjs +2 -2
  47. package/dist/tools/index.js +10 -19
  48. package/dist/tools/markdown/MarkdownContent.vue.d.ts +5 -5
  49. package/dist/tools/useAutoScroll.d.ts +3 -3
  50. package/dist/web-ui/attach/AttachmentCard.vue.d.ts +6 -6
  51. package/dist/web-ui/attach/AttachmentList.vue.d.ts +6 -6
  52. package/dist/web-ui/chat/ChatContainer.vue.d.ts +6 -6
  53. package/dist/web-ui/chat/ChatMessagesView.vue.d.ts +6 -6
  54. package/dist/web-ui/envswitch/EnvSwitch.vue.d.ts +5 -5
  55. package/dist/web-ui/index.cjs +1 -1
  56. package/dist/web-ui/index.js +630 -635
  57. package/dist/web-ui/inputbox/Inputbox.vue.d.ts +7 -7
  58. package/dist/web-ui/recordset/RecordsetTable.vue.d.ts +4 -4
  59. package/package.json +2 -1
@@ -1,151 +1,150 @@
1
1
  import "wi-chat/style.css";
2
- import { defineAsyncComponent as H, defineComponent as j, computed as I, openBlock as l, createElementBlock as c, createElementVNode as e, Fragment as M, renderList as B, createBlock as ee, resolveDynamicComponent as ke, createCommentVNode as V, createTextVNode as Se, pushScopeId as K, popScopeId as X, unref as i, toDisplayString as v, withDirectives as $e, vShow as xe, getCurrentInstance as ce, inject as ue, toValue as z, ref as U, watch as de, onBeforeUnmount as Ie, provide as _e, withKeys as re, withModifiers as te, normalizeClass as D, Teleport as Ce, createVNode as Ee, Transition as Oe, withCtx as Te, reactive as Ve, normalizeStyle as Pe } from "vue";
3
- import { knowledgeStreamParser as Ue, iframePageParser as Me, outputFileParser as Le, collectClarificationsParser as je, hostActionParser as Ne, formatFileSize as Re, IFRAME_RESIZER_CHILD_SCRIPT as Ae, submitClarification as Fe, cancelClarification as De } from "wi-chat/parser";
4
- import { createStyleScope as pe, renderMarkdown as fe, downloadTableAsExcel as Be } from "wi-chat/tools";
5
- import ie from "@iframe-resizer/vue/iframe-resizer.vue";
6
- const ze = [
7
- { ...Ue, component: H(() => Promise.resolve().then(() => ft)) },
8
- { ...Me, component: H(() => Promise.resolve().then(() => fs)) },
9
- { ...Le, component: H(() => Promise.resolve().then(() => os)) },
2
+ import { defineAsyncComponent as H, defineComponent as j, computed as I, openBlock as i, createElementBlock as u, createElementVNode as e, Fragment as M, renderList as B, createBlock as Z, resolveDynamicComponent as ye, createCommentVNode as V, createTextVNode as me, unref as l, toDisplayString as f, withDirectives as he, vShow as be, getCurrentInstance as ae, inject as re, toValue as z, ref as U, watch as le, onBeforeUnmount as ge, provide as ie, withKeys as se, withModifiers as Q, normalizeClass as D, Teleport as ke, createVNode as xe, Transition as Se, withCtx as $e, reactive as Ie, normalizeStyle as Ce } from "vue";
3
+ import { knowledgeStreamParser as Ee, iframePageParser as Oe, outputFileParser as Te, collectClarificationsParser as Ve, hostActionParser as Pe, formatFileSize as Ue, IFRAME_RESIZER_CHILD_SCRIPT as Me, submitClarification as Le, cancelClarification as je } from "wi-chat/parser";
4
+ import { createStyleScope as ue, renderMarkdown as ce, downloadTableAsExcel as Ne } from "wi-chat/tools";
5
+ import ne from "@iframe-resizer/vue/iframe-resizer.vue";
6
+ const Re = [
7
+ { ...Ee, component: H(() => Promise.resolve().then(() => at)) },
8
+ { ...Oe, component: H(() => Promise.resolve().then(() => es)) },
9
+ { ...Te, component: H(() => Promise.resolve().then(() => qt)) },
10
10
  // 确认卡片(front_reply + action_execute + executor=agent + collect_clarifications):
11
11
  // 解析由内置 collectClarificationsParser 完成,提交/取消经 wi-chat/parser 回传 wait_reply
12
- { ...je, component: H(() => Promise.resolve().then(() => tn)) },
12
+ { ...Ve, component: H(() => Promise.resolve().then(() => Ns)) },
13
13
  // 宿主执行过程(front_reply + action_execute + executor=host):宿主执行、进度卡片
14
- { ...Ne, component: H(() => Promise.resolve().then(() => fn)) }
15
- ], qe = (n) => {
16
- const a = (u) => {
14
+ { ...Pe, component: H(() => Promise.resolve().then(() => Xs)) }
15
+ ], Ae = (r) => {
16
+ const a = (c) => {
17
17
  const t = {};
18
- for (const o of u)
18
+ for (const o of c)
19
19
  !o.answerType || !o.component || (t[o.answerType] = o.component);
20
20
  return t;
21
21
  };
22
- return { ...a(ze), ...a(n ?? []) };
23
- }, He = (n) => (K("data-v-efad55c8"), n = n(), X(), n), Ke = { class: "flex justify-start" }, Xe = { class: "ai-answer-bubble" }, Ge = {
22
+ return { ...a(Re), ...a(r ?? []) };
23
+ }, Fe = { class: "flex justify-start" }, De = { class: "ai-answer-bubble" }, Be = {
24
24
  key: 0,
25
25
  class: "ai-answer-bubble__error"
26
- }, We = { class: "ai-answer-bubble__body" }, Ye = {
26
+ }, ze = { class: "ai-answer-bubble__body" }, qe = {
27
27
  key: 0,
28
28
  class: "ai-answer-bubble__status"
29
- }, Je = {
29
+ }, He = {
30
30
  key: 2,
31
31
  class: "ai-answer-bubble__status"
32
- }, Ze = {
32
+ }, Ke = {
33
33
  key: 3,
34
34
  class: "ai-answer-bubble__loading"
35
- }, Qe = /* @__PURE__ */ He(() => /* @__PURE__ */ e("span", { class: "ai-answer-bubble__pulse" }, null, -1)), et = /* @__PURE__ */ j({
35
+ }, Xe = /* @__PURE__ */ j({
36
36
  __name: "AiAnswerBubble",
37
37
  props: {
38
38
  answer: {},
39
39
  error: { type: Boolean, default: !1 },
40
40
  stopped: { type: Boolean, default: !1 },
41
- contentMap: { default: () => qe() }
41
+ contentMap: { default: () => Ae() }
42
42
  },
43
- setup(n) {
44
- const a = n, u = I(() => {
43
+ setup(r) {
44
+ const a = r, c = I(() => {
45
45
  var o, d;
46
46
  return ((d = (o = a.answer) == null ? void 0 : o.answer) == null ? void 0 : d.reports) ?? [];
47
- }), t = I(() => u.value.filter((o) => a.contentMap[o.answer_type]));
48
- return (o, d) => (l(), c("div", Ke, [
49
- e("div", Xe, [
50
- o.error ? (l(), c("div", Ge, "回答加载失败")) : t.value.length ? (l(), c(M, { key: 1 }, [
51
- e("div", We, [
52
- (l(!0), c(M, null, B(t.value, (w, $) => (l(), ee(ke(o.contentMap[w.answer_type]), {
53
- key: $,
54
- report: w
47
+ }), t = I(() => c.value.filter((o) => a.contentMap[o.answer_type]));
48
+ return (o, d) => (i(), u("div", Fe, [
49
+ e("div", De, [
50
+ r.error ? (i(), u("div", Be, "回答加载失败")) : t.value.length ? (i(), u(M, { key: 1 }, [
51
+ e("div", ze, [
52
+ (i(!0), u(M, null, B(t.value, (v, S) => (i(), Z(ye(r.contentMap[v.answer_type]), {
53
+ key: S,
54
+ report: v
55
55
  }, null, 8, ["report"]))), 128))
56
56
  ]),
57
- o.stopped ? (l(), c("div", Ye, "回答已停止")) : V("", !0)
58
- ], 64)) : o.stopped ? (l(), c("div", Je, "回答已停止")) : u.value.length ? V("", !0) : (l(), c("div", Ze, [
59
- Qe,
60
- Se("正在思考...")
61
- ]))
57
+ r.stopped ? (i(), u("div", qe, "回答已停止")) : V("", !0)
58
+ ], 64)) : r.stopped ? (i(), u("div", He, "回答已停止")) : c.value.length ? V("", !0) : (i(), u("div", Ke, [...d[0] || (d[0] = [
59
+ e("span", { class: "ai-answer-bubble__pulse" }, null, -1),
60
+ me("正在思考...", -1)
61
+ ])]))
62
62
  ])
63
63
  ]));
64
64
  }
65
- }), N = (n, a) => {
66
- const u = n.__vccOpts || n;
65
+ }), N = (r, a) => {
66
+ const c = r.__vccOpts || r;
67
67
  for (const [t, o] of a)
68
- u[t] = o;
69
- return u;
70
- }, bn = /* @__PURE__ */ N(et, [["__scopeId", "data-v-efad55c8"]]), tt = (n) => (K("data-v-de333356"), n = n(), X(), n), st = ["data-wi-md-scope"], nt = ["aria-expanded"], ot = /* @__PURE__ */ tt(() => /* @__PURE__ */ e("span", { class: "deep-thinking__title" }, "深度思考", -1)), at = { class: "deep-thinking__count" }, rt = { class: "deep-thinking__list" }, it = { class: "deep-thinking__index" }, lt = ["innerHTML"], ct = /* @__PURE__ */ j({
68
+ c[t] = o;
69
+ return c;
70
+ }, Qs = /* @__PURE__ */ N(Xe, [["__scopeId", "data-v-efad55c8"]]), Ge = ["data-wi-md-scope"], We = ["aria-expanded"], Ye = { class: "deep-thinking__count" }, Je = { class: "deep-thinking__list" }, Ze = { class: "deep-thinking__index" }, Qe = ["innerHTML"], et = /* @__PURE__ */ j({
71
71
  __name: "DeepThinkingSteps",
72
72
  props: {
73
73
  steps: {},
74
74
  expanded: { type: Boolean }
75
75
  },
76
76
  emits: ["update:expanded"],
77
- setup(n, { emit: a }) {
78
- const u = n, t = a, o = { imageDownload: !1, tableDownload: !1 }, d = pe(), w = { ...o, styleScope: d.selector }, $ = /* @__PURE__ */ new Map(), b = (p) => {
79
- let y = $.get(p);
80
- return y === void 0 && ($.size > 500 && $.clear(), y = fe(p, w), $.set(p, y)), y;
81
- }, g = I(() => u.steps.map(b));
82
- return (p, y) => g.value.length ? (l(), c("div", {
77
+ setup(r, { emit: a }) {
78
+ const c = r, t = a, o = { imageDownload: !1, tableDownload: !1 }, d = ue(), v = { ...o, styleScope: d.selector }, S = /* @__PURE__ */ new Map(), g = (h) => {
79
+ let w = S.get(h);
80
+ return w === void 0 && (S.size > 500 && S.clear(), w = ce(h, v), S.set(h, w)), w;
81
+ }, k = I(() => c.steps.map(g));
82
+ return (h, w) => k.value.length ? (i(), u("div", {
83
83
  key: 0,
84
84
  class: "deep-thinking",
85
- "data-wi-md-scope": i(d).id
85
+ "data-wi-md-scope": l(d).id
86
86
  }, [
87
87
  e("button", {
88
88
  type: "button",
89
89
  class: "deep-thinking__header",
90
- "aria-expanded": p.expanded,
91
- onClick: y[0] || (y[0] = (k) => t("update:expanded", !p.expanded))
90
+ "aria-expanded": r.expanded,
91
+ onClick: w[0] || (w[0] = (x) => t("update:expanded", !r.expanded))
92
92
  }, [
93
- ot,
94
- e("span", at, v(g.value.length), 1),
95
- e("span", null, v(p.expanded ? "收起" : "展开"), 1)
96
- ], 8, nt),
97
- $e(e("div", rt, [
98
- (l(!0), c(M, null, B(g.value, (k, O) => (l(), c("div", {
93
+ w[1] || (w[1] = e("span", { class: "deep-thinking__title" }, "深度思考", -1)),
94
+ e("span", Ye, f(k.value.length), 1),
95
+ e("span", null, f(r.expanded ? "收起" : "展开"), 1)
96
+ ], 8, We),
97
+ he(e("div", Je, [
98
+ (i(!0), u(M, null, B(k.value, (x, O) => (i(), u("div", {
99
99
  key: O,
100
100
  class: "deep-thinking__item"
101
101
  }, [
102
- e("span", it, v(O + 1), 1),
102
+ e("span", Ze, f(O + 1), 1),
103
103
  e("div", {
104
104
  class: "markdown-it",
105
- innerHTML: k
106
- }, null, 8, lt)
105
+ innerHTML: x
106
+ }, null, 8, Qe)
107
107
  ]))), 128))
108
108
  ], 512), [
109
- [xe, p.expanded]
109
+ [be, r.expanded]
110
110
  ])
111
- ], 8, st)) : V("", !0);
111
+ ], 8, Ge)) : V("", !0);
112
112
  }
113
- }), gn = /* @__PURE__ */ N(ct, [["__scopeId", "data-v-de333356"]]), ut = ["data-wi-md-scope"], dt = ["innerHTML"], _t = /* @__PURE__ */ j({
113
+ }), en = /* @__PURE__ */ N(et, [["__scopeId", "data-v-de333356"]]), tt = ["data-wi-md-scope"], st = ["innerHTML"], nt = /* @__PURE__ */ j({
114
114
  __name: "KnowledgeStreamResult",
115
115
  props: {
116
116
  report: {}
117
117
  },
118
- setup(n) {
119
- const a = n, u = { imageDownload: !1, tableDownload: !0 }, t = pe(), o = { ...u, styleScope: t.selector }, d = (g) => {
118
+ setup(r) {
119
+ const a = r, c = { imageDownload: !1, tableDownload: !0 }, t = ue(), o = { ...c, styleScope: t.selector }, d = (k) => {
120
120
  var O;
121
- const y = g.target.closest(".wi-md-table-download");
122
- if (!y)
123
- return;
124
- g.preventDefault(), g.stopPropagation();
125
- const k = (O = y.closest(".wi-md-table-wrap")) == null ? void 0 : O.querySelector("table");
126
- k && Be(k);
127
- }, w = /* @__PURE__ */ new Map(), $ = (g) => {
128
- let p = w.get(g);
129
- return p === void 0 && (w.size > 300 && w.clear(), p = fe(g, o), w.set(g, p)), p;
130
- }, b = I(() => (a.report.values || []).map((g) => $(g.answer || "")));
131
- return (g, p) => (l(), c("div", {
121
+ const w = k.target.closest(".wi-md-table-download");
122
+ if (!w) return;
123
+ k.preventDefault(), k.stopPropagation();
124
+ const x = (O = w.closest(".wi-md-table-wrap")) == null ? void 0 : O.querySelector("table");
125
+ x && Ne(x);
126
+ }, v = /* @__PURE__ */ new Map(), S = (k) => {
127
+ let h = v.get(k);
128
+ return h === void 0 && (v.size > 300 && v.clear(), h = ce(k, o), v.set(k, h)), h;
129
+ }, g = I(() => (a.report.values || []).map((k) => S(k.answer || "")));
130
+ return (k, h) => (i(), u("div", {
132
131
  class: "knowledge-result",
133
- "data-wi-md-scope": i(t).id,
132
+ "data-wi-md-scope": l(t).id,
134
133
  onClick: d
135
134
  }, [
136
- (l(!0), c(M, null, B(b.value, (y, k) => (l(), c("div", {
137
- key: k,
135
+ (i(!0), u(M, null, B(g.value, (w, x) => (i(), u("div", {
136
+ key: x,
138
137
  class: "markdown-it",
139
- innerHTML: y
140
- }, null, 8, dt))), 128))
141
- ], 8, ut));
138
+ innerHTML: w
139
+ }, null, 8, st))), 128))
140
+ ], 8, tt));
142
141
  }
143
- }), pt = /* @__PURE__ */ N(_t, [["__scopeId", "data-v-857bc0d2"]]), ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
142
+ }), ot = /* @__PURE__ */ N(nt, [["__scopeId", "data-v-857bc0d2"]]), at = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
144
143
  __proto__: null,
145
- default: pt
146
- }, Symbol.toStringTag, { value: "Module" })), ve = Symbol("wi-chat-output-file-config"), kn = (n) => {
147
- _e(ve, n);
148
- }, vt = /* @__PURE__ */ new Set(["png", "jpg", "jpeg", "gif", "webp", "bmp", "svg", "ico"]), wt = /* @__PURE__ */ new Set(["mp3", "wav", "ogg", "m4a", "aac", "flac"]), ht = /* @__PURE__ */ new Set(["mp4", "webm", "mov", "avi", "mkv"]), yt = /* @__PURE__ */ new Set(["doc", "docx", "xls", "xlsx", "ppt", "pptx"]), mt = /* @__PURE__ */ new Set(["html", "htm"]), bt = /* @__PURE__ */ new Set([
144
+ default: ot
145
+ }, Symbol.toStringTag, { value: "Module" })), de = Symbol("wi-chat-output-file-config"), tn = (r) => {
146
+ ie(de, r);
147
+ }, rt = /* @__PURE__ */ new Set(["png", "jpg", "jpeg", "gif", "webp", "bmp", "svg", "ico"]), lt = /* @__PURE__ */ new Set(["mp3", "wav", "ogg", "m4a", "aac", "flac"]), it = /* @__PURE__ */ new Set(["mp4", "webm", "mov", "avi", "mkv"]), ut = /* @__PURE__ */ new Set(["doc", "docx", "xls", "xlsx", "ppt", "pptx"]), ct = /* @__PURE__ */ new Set(["html", "htm"]), dt = /* @__PURE__ */ new Set([
149
148
  "js",
150
149
  "mjs",
151
150
  "cjs",
@@ -171,7 +170,7 @@ const ze = [
171
170
  "css",
172
171
  "scss",
173
172
  "less"
174
- ]), gt = /* @__PURE__ */ new Set([
173
+ ]), _t = /* @__PURE__ */ new Set([
175
174
  "txt",
176
175
  "text",
177
176
  "md",
@@ -187,217 +186,198 @@ const ze = [
187
186
  "env",
188
187
  "toml",
189
188
  "sql"
190
- ]), kt = 20, F = /* @__PURE__ */ new Map(), se = /* @__PURE__ */ new Map(), St = (n, a) => {
191
- if (!F.has(n) && F.size >= kt) {
192
- const u = F.keys().next().value;
193
- u !== void 0 && F.delete(u);
189
+ ]), pt = 20, F = /* @__PURE__ */ new Map(), ee = /* @__PURE__ */ new Map(), ft = (r, a) => {
190
+ if (!F.has(r) && F.size >= pt) {
191
+ const c = F.keys().next().value;
192
+ c !== void 0 && F.delete(c);
194
193
  }
195
- F.set(n, a);
196
- }, $t = (n) => {
197
- const a = n.lastIndexOf(".");
198
- return a >= 0 ? n.slice(a + 1).toLowerCase() : "";
199
- }, xt = (n) => vt.has(n) ? "image" : n === "pdf" ? "pdf" : mt.has(n) ? "html" : wt.has(n) ? "audio" : ht.has(n) ? "video" : yt.has(n) ? "office" : bt.has(n) ? "code" : gt.has(n) ? "text" : "unknown", It = (n) => {
200
- const a = ce() ? ue(ve, {}) : {}, u = I(() => {
194
+ F.set(r, a);
195
+ }, vt = (r) => {
196
+ const a = r.lastIndexOf(".");
197
+ return a >= 0 ? r.slice(a + 1).toLowerCase() : "";
198
+ }, wt = (r) => rt.has(r) ? "image" : r === "pdf" ? "pdf" : ct.has(r) ? "html" : lt.has(r) ? "audio" : it.has(r) ? "video" : ut.has(r) ? "office" : dt.has(r) ? "code" : _t.has(r) ? "text" : "unknown", yt = (r) => {
199
+ const a = ae() ? re(de, {}) : {}, c = I(() => {
201
200
  var C;
202
- const _ = z(n);
201
+ const _ = z(r);
203
202
  return ((C = _ == null ? void 0 : _.values) == null ? void 0 : C.file_id) ?? (_ == null ? void 0 : _.file_id) ?? "";
204
203
  }), t = I(() => {
205
204
  var C;
206
- const _ = z(n);
205
+ const _ = z(r);
207
206
  return ((C = _ == null ? void 0 : _.values) == null ? void 0 : C.file_name) ?? (_ == null ? void 0 : _.file_name) ?? "未命名文件";
208
- }), o = I(() => $t(t.value)), d = I(() => xt(o.value)), w = U(!1), $ = U(!1), b = U(""), g = U(!1), p = U(""), y = U(""), k = U(null), O = I(() => k.value ? Re(k.value.size) : ""), T = () => {
209
- y.value && typeof URL < "u" && typeof URL.revokeObjectURL == "function" && URL.revokeObjectURL(y.value), y.value = "";
207
+ }), o = I(() => vt(t.value)), d = I(() => wt(o.value)), v = U(!1), S = U(!1), g = U(""), k = U(!1), h = U(""), w = U(""), x = U(null), O = I(() => x.value ? Ue(x.value.size) : ""), T = () => {
208
+ w.value && typeof URL < "u" && typeof URL.revokeObjectURL == "function" && URL.revokeObjectURL(w.value), w.value = "";
210
209
  }, R = async () => {
211
- const _ = u.value, C = t.value;
212
- if (!_)
213
- throw new Error("缺少文件 id,无法加载文件");
214
- const E = _ || C, Y = F.get(E);
215
- if (Y)
216
- return Y;
217
- let A = se.get(E);
210
+ const _ = c.value, C = t.value;
211
+ if (!_) throw new Error("缺少文件 id,无法加载文件");
212
+ const E = _ || C, G = F.get(E);
213
+ if (G) return G;
214
+ let A = ee.get(E);
218
215
  return A || (A = (async () => {
219
- var J, Z;
220
- if (a.loadFile)
221
- return a.loadFile(_);
222
- const L = (J = a.getFileUrl) == null ? void 0 : J.call(a, _);
223
- if (!L)
224
- throw new Error("未配置文件加载方式(请提供 loadFile 或 getFileUrl)");
225
- const h = await fetch(L, { headers: (Z = a.getHeaders) == null ? void 0 : Z.call(a) });
226
- if (!h.ok)
227
- throw new Error(`文件加载失败(HTTP ${h.status})`);
228
- return h.blob();
229
- })().then((L) => (St(E, L), L)).finally(() => se.delete(E)), se.set(E, A)), A;
230
- }, S = async () => {
231
- $.value = !0, b.value = "", g.value = !1, p.value = "", T();
216
+ var W, Y;
217
+ if (a.loadFile) return a.loadFile(_);
218
+ const L = (W = a.getFileUrl) == null ? void 0 : W.call(a, _);
219
+ if (!L) throw new Error("未配置文件加载方式(请提供 loadFile 或 getFileUrl)");
220
+ const y = await fetch(L, { headers: (Y = a.getHeaders) == null ? void 0 : Y.call(a) });
221
+ if (!y.ok) throw new Error(`文件加载失败(HTTP ${y.status})`);
222
+ return y.blob();
223
+ })().then((L) => (ft(E, L), L)).finally(() => ee.delete(E)), ee.set(E, A)), A;
224
+ }, b = async () => {
225
+ S.value = !0, g.value = "", k.value = !1, h.value = "", T();
232
226
  try {
233
227
  const _ = await R();
234
- k.value = _;
228
+ x.value = _;
235
229
  const C = d.value;
236
230
  if (C === "office") {
237
- g.value = !0;
231
+ k.value = !0;
238
232
  return;
239
233
  }
240
234
  if (C === "image" || C === "pdf" || C === "audio" || C === "video") {
241
- typeof URL < "u" && typeof URL.createObjectURL == "function" && (y.value = URL.createObjectURL(_));
235
+ typeof URL < "u" && typeof URL.createObjectURL == "function" && (w.value = URL.createObjectURL(_));
242
236
  return;
243
237
  }
244
238
  const E = await _.text();
245
239
  if (E.includes("\0")) {
246
- g.value = !0;
240
+ k.value = !0;
247
241
  return;
248
242
  }
249
- p.value = E;
243
+ h.value = E;
250
244
  } catch (_) {
251
- b.value = _ instanceof Error ? _.message : String(_);
245
+ g.value = _ instanceof Error ? _.message : String(_);
252
246
  } finally {
253
- $.value = !1;
247
+ S.value = !1;
254
248
  }
255
- }, x = async () => {
249
+ }, $ = async () => {
256
250
  if (a.openPreview) {
257
251
  a.openPreview({
258
- fileId: u.value,
252
+ fileId: c.value,
259
253
  fileName: t.value,
260
254
  loadFile: R,
261
- download: W
255
+ download: X
262
256
  });
263
257
  return;
264
258
  }
265
- w.value = !0, await S();
266
- }, G = () => {
267
- w.value = !1, $.value = !1, b.value = "", g.value = !1, p.value = "", T();
268
- }, W = async () => {
259
+ v.value = !0, await b();
260
+ }, K = () => {
261
+ v.value = !1, S.value = !1, g.value = "", k.value = !1, h.value = "", T();
262
+ }, X = async () => {
269
263
  try {
270
- const _ = k.value ?? await R();
271
- if (k.value = _, a.downloadFile) {
272
- a.downloadFile({ fileId: u.value, fileName: t.value, blob: _ });
264
+ const _ = x.value ?? await R();
265
+ if (x.value = _, a.downloadFile) {
266
+ a.downloadFile({ fileId: c.value, fileName: t.value, blob: _ });
273
267
  return;
274
268
  }
275
- if (typeof document > "u" || typeof URL > "u")
276
- return;
269
+ if (typeof document > "u" || typeof URL > "u") return;
277
270
  const C = URL.createObjectURL(_), E = document.createElement("a");
278
271
  E.href = C, E.download = t.value, document.body.appendChild(E), E.click(), E.remove(), URL.revokeObjectURL(C);
279
272
  } catch (_) {
280
- b.value = _ instanceof Error ? _.message : String(_), !w.value && !a.openPreview && (w.value = !0);
273
+ g.value = _ instanceof Error ? _.message : String(_), !v.value && !a.openPreview && (v.value = !0);
281
274
  }
282
275
  }, q = (_) => {
283
- _.key === "Escape" && w.value && G();
276
+ _.key === "Escape" && v.value && K();
284
277
  };
285
- return de(w, (_) => {
278
+ return le(v, (_) => {
286
279
  typeof window > "u" || (_ ? window.addEventListener("keydown", q) : window.removeEventListener("keydown", q));
287
- }), Ie(() => {
280
+ }), ge(() => {
288
281
  typeof window < "u" && window.removeEventListener("keydown", q), T();
289
282
  }), {
290
- fileId: u,
283
+ fileId: c,
291
284
  fileName: t,
292
285
  extension: o,
293
286
  previewKind: d,
294
287
  fileSize: O,
295
- visible: w,
296
- loading: $,
297
- error: b,
298
- unsupported: g,
299
- textContent: p,
300
- objectUrl: y,
301
- open: x,
302
- close: G,
303
- download: W
288
+ visible: v,
289
+ loading: S,
290
+ error: g,
291
+ unsupported: k,
292
+ textContent: h,
293
+ objectUrl: w,
294
+ open: $,
295
+ close: K,
296
+ download: X
304
297
  };
305
- }, oe = (n) => (K("data-v-f61a91b5"), n = n(), X(), n), Ct = { class: "wi-output-file" }, Et = ["aria-label"], Ot = /* @__PURE__ */ oe(() => /* @__PURE__ */ e("svg", {
306
- viewBox: "0 0 24 24",
307
- fill: "none",
308
- stroke: "currentColor",
309
- "stroke-width": "1.7",
310
- "stroke-linecap": "round",
311
- "stroke-linejoin": "round"
312
- }, [
313
- /* @__PURE__ */ e("path", { d: "M7 2.5h7l4 4V21.5H7z" }),
314
- /* @__PURE__ */ e("path", { d: "M14 2.5v4h4" })
315
- ], -1)), Tt = [
316
- Ot
317
- ], Vt = { class: "wi-output-file__info" }, Pt = ["title"], Ut = { class: "wi-output-file__meta" }, Mt = { class: "wi-output-file__ext" }, Lt = {
298
+ }, mt = { class: "wi-output-file" }, ht = ["aria-label"], bt = { class: "wi-output-file__info" }, gt = ["title"], kt = { class: "wi-output-file__meta" }, xt = { class: "wi-output-file__ext" }, St = {
318
299
  key: 0,
319
300
  class: "wi-output-file__size"
320
- }, jt = /* @__PURE__ */ oe(() => /* @__PURE__ */ e("svg", {
321
- viewBox: "0 0 24 24",
322
- fill: "none",
323
- stroke: "currentColor",
324
- "stroke-width": "1.8",
325
- "stroke-linecap": "round",
326
- "stroke-linejoin": "round"
327
- }, [
328
- /* @__PURE__ */ e("path", { d: "M12 3v12" }),
329
- /* @__PURE__ */ e("path", { d: "m7 10 5 5 5-5" }),
330
- /* @__PURE__ */ e("path", { d: "M5 21h14" })
331
- ], -1)), Nt = [
332
- jt
333
- ], Rt = ["aria-label"], At = { class: "wi-output-file-drawer__head" }, Ft = { class: "wi-output-file-drawer__title" }, Dt = { class: "wi-output-file-drawer__ext" }, Bt = ["title"], zt = {
301
+ }, $t = ["aria-label"], It = { class: "wi-output-file-drawer__head" }, Ct = { class: "wi-output-file-drawer__title" }, Et = { class: "wi-output-file-drawer__ext" }, Ot = ["title"], Tt = {
334
302
  key: 0,
335
303
  class: "wi-output-file-drawer__size"
336
- }, qt = { class: "wi-output-file-drawer__actions" }, Ht = { class: "wi-output-file-drawer__body" }, Kt = {
304
+ }, Vt = { class: "wi-output-file-drawer__actions" }, Pt = { class: "wi-output-file-drawer__body" }, Ut = {
337
305
  key: 0,
338
306
  class: "wi-output-file-drawer__state"
339
- }, Xt = {
307
+ }, Mt = {
340
308
  key: 1,
341
309
  class: "wi-output-file-drawer__state is-error"
342
- }, Gt = {
310
+ }, Lt = {
343
311
  key: 2,
344
312
  class: "wi-output-file-drawer__state"
345
- }, Wt = /* @__PURE__ */ oe(() => /* @__PURE__ */ e("p", null, "该文件类型暂不支持在线预览,请下载后查看。", -1)), Yt = ["src", "alt"], Jt = ["src", "title"], Zt = ["srcdoc", "title"], Qt = ["src"], es = ["src"], ts = {
313
+ }, jt = ["src", "alt"], Nt = ["src", "title"], Rt = ["srcdoc", "title"], At = ["src"], Ft = ["src"], Dt = {
346
314
  key: 8,
347
315
  class: "wi-output-file-drawer__text"
348
- }, ss = /* @__PURE__ */ j({
316
+ }, Bt = /* @__PURE__ */ j({
349
317
  __name: "OutputFile",
350
318
  props: {
351
319
  report: {}
352
320
  },
353
- setup(n) {
354
- const a = n, {
355
- fileName: u,
321
+ setup(r) {
322
+ const a = r, {
323
+ fileName: c,
356
324
  extension: t,
357
325
  previewKind: o,
358
326
  fileSize: d,
359
- visible: w,
360
- loading: $,
361
- error: b,
362
- unsupported: g,
363
- textContent: p,
364
- objectUrl: y,
365
- open: k,
327
+ visible: v,
328
+ loading: S,
329
+ error: g,
330
+ unsupported: k,
331
+ textContent: h,
332
+ objectUrl: w,
333
+ open: x,
366
334
  close: O,
367
335
  download: T
368
- } = It(() => a.report);
369
- return (R, S) => (l(), c("div", Ct, [
336
+ } = yt(() => a.report);
337
+ return (R, b) => (i(), u("div", mt, [
370
338
  e("div", {
371
339
  class: "wi-output-file__card",
372
340
  role: "button",
373
341
  tabindex: "0",
374
- "aria-label": `预览文件 ${i(u)}`,
375
- onClick: S[1] || (S[1] = //@ts-ignore
376
- (...x) => i(k) && i(k)(...x)),
342
+ "aria-label": `预览文件 ${l(c)}`,
343
+ onClick: b[1] || (b[1] = //@ts-ignore
344
+ (...$) => l(x) && l(x)(...$)),
377
345
  onKeydown: [
378
- S[2] || (S[2] = re(
346
+ b[2] || (b[2] = se(
379
347
  //@ts-ignore
380
- (...x) => i(k) && i(k)(...x),
348
+ (...$) => l(x) && l(x)(...$),
381
349
  ["enter"]
382
350
  )),
383
- S[3] || (S[3] = re(te(
351
+ b[3] || (b[3] = se(Q(
384
352
  //@ts-ignore
385
- (...x) => i(k) && i(k)(...x),
353
+ (...$) => l(x) && l(x)(...$),
386
354
  ["prevent"]
387
355
  ), ["space"]))
388
356
  ]
389
357
  }, [
390
358
  e("span", {
391
- class: D(["wi-output-file__icon", `is-${i(o)}`])
392
- }, Tt, 2),
393
- e("div", Vt, [
359
+ class: D(["wi-output-file__icon", `is-${l(o)}`])
360
+ }, [...b[9] || (b[9] = [
361
+ e("svg", {
362
+ viewBox: "0 0 24 24",
363
+ fill: "none",
364
+ stroke: "currentColor",
365
+ "stroke-width": "1.7",
366
+ "stroke-linecap": "round",
367
+ "stroke-linejoin": "round"
368
+ }, [
369
+ e("path", { d: "M7 2.5h7l4 4V21.5H7z" }),
370
+ e("path", { d: "M14 2.5v4h4" })
371
+ ], -1)
372
+ ])], 2),
373
+ e("div", bt, [
394
374
  e("div", {
395
375
  class: "wi-output-file__name",
396
- title: i(u)
397
- }, v(i(u)), 9, Pt),
398
- e("div", Ut, [
399
- e("span", Mt, v(i(t).toUpperCase() || "FILE"), 1),
400
- i(d) ? (l(), c("span", Lt, v(i(d)), 1)) : V("", !0)
376
+ title: l(c)
377
+ }, f(l(c)), 9, gt),
378
+ e("div", kt, [
379
+ e("span", xt, f(l(t).toUpperCase() || "FILE"), 1),
380
+ l(d) ? (i(), u("span", St, f(l(d)), 1)) : V("", !0)
401
381
  ])
402
382
  ]),
403
383
  e("button", {
@@ -405,22 +385,35 @@ const ze = [
405
385
  class: "wi-output-file__download",
406
386
  title: "下载文件",
407
387
  "aria-label": "下载文件",
408
- onClick: S[0] || (S[0] = te(
388
+ onClick: b[0] || (b[0] = Q(
409
389
  //@ts-ignore
410
- (...x) => i(T) && i(T)(...x),
390
+ (...$) => l(T) && l(T)(...$),
411
391
  ["stop"]
412
392
  ))
413
- }, Nt)
414
- ], 40, Et),
415
- (l(), ee(Ce, { to: "body" }, [
416
- Ee(Oe, { name: "wi-output-file-fade" }, {
417
- default: Te(() => [
418
- i(w) ? (l(), c("div", {
393
+ }, [...b[10] || (b[10] = [
394
+ e("svg", {
395
+ viewBox: "0 0 24 24",
396
+ fill: "none",
397
+ stroke: "currentColor",
398
+ "stroke-width": "1.8",
399
+ "stroke-linecap": "round",
400
+ "stroke-linejoin": "round"
401
+ }, [
402
+ e("path", { d: "M12 3v12" }),
403
+ e("path", { d: "m7 10 5 5 5-5" }),
404
+ e("path", { d: "M5 21h14" })
405
+ ], -1)
406
+ ])])
407
+ ], 40, ht),
408
+ (i(), Z(ke, { to: "body" }, [
409
+ xe(Se, { name: "wi-output-file-fade" }, {
410
+ default: $e(() => [
411
+ l(v) ? (i(), u("div", {
419
412
  key: 0,
420
413
  class: "wi-output-file-mask",
421
- onClick: S[8] || (S[8] = te(
414
+ onClick: b[8] || (b[8] = Q(
422
415
  //@ts-ignore
423
- (...x) => i(O) && i(O)(...x),
416
+ (...$) => l(O) && l(O)(...$),
424
417
  ["self"]
425
418
  ))
426
419
  }, [
@@ -428,80 +421,80 @@ const ze = [
428
421
  class: "wi-output-file-drawer",
429
422
  role: "dialog",
430
423
  "aria-modal": "true",
431
- "aria-label": `预览文件 ${i(u)}`
424
+ "aria-label": `预览文件 ${l(c)}`
432
425
  }, [
433
- e("header", At, [
434
- e("div", Ft, [
435
- e("span", Dt, v(i(t).toUpperCase() || "FILE"), 1),
426
+ e("header", It, [
427
+ e("div", Ct, [
428
+ e("span", Et, f(l(t).toUpperCase() || "FILE"), 1),
436
429
  e("div", {
437
430
  class: "wi-output-file-drawer__name",
438
- title: i(u)
439
- }, v(i(u)), 9, Bt),
440
- i(d) ? (l(), c("div", zt, v(i(d)), 1)) : V("", !0)
431
+ title: l(c)
432
+ }, f(l(c)), 9, Ot),
433
+ l(d) ? (i(), u("div", Tt, f(l(d)), 1)) : V("", !0)
441
434
  ]),
442
- e("div", qt, [
435
+ e("div", Vt, [
443
436
  e("button", {
444
437
  type: "button",
445
438
  class: "wi-output-file-drawer__btn",
446
- onClick: S[4] || (S[4] = //@ts-ignore
447
- (...x) => i(T) && i(T)(...x))
439
+ onClick: b[4] || (b[4] = //@ts-ignore
440
+ (...$) => l(T) && l(T)(...$))
448
441
  }, "下载"),
449
442
  e("button", {
450
443
  type: "button",
451
444
  class: "wi-output-file-drawer__btn wi-output-file-drawer__btn--close",
452
445
  title: "关闭",
453
446
  "aria-label": "关闭预览",
454
- onClick: S[5] || (S[5] = //@ts-ignore
455
- (...x) => i(O) && i(O)(...x))
447
+ onClick: b[5] || (b[5] = //@ts-ignore
448
+ (...$) => l(O) && l(O)(...$))
456
449
  }, " × ")
457
450
  ])
458
451
  ]),
459
- e("div", Ht, [
460
- i($) ? (l(), c("div", Kt, "文件加载中…")) : i(b) ? (l(), c("div", Xt, [
461
- e("p", null, v(i(b)), 1),
452
+ e("div", Pt, [
453
+ l(S) ? (i(), u("div", Ut, "文件加载中…")) : l(g) ? (i(), u("div", Mt, [
454
+ e("p", null, f(l(g)), 1),
462
455
  e("button", {
463
456
  type: "button",
464
457
  class: "wi-output-file-drawer__btn",
465
- onClick: S[6] || (S[6] = //@ts-ignore
466
- (...x) => i(T) && i(T)(...x))
458
+ onClick: b[6] || (b[6] = //@ts-ignore
459
+ (...$) => l(T) && l(T)(...$))
467
460
  }, "下载文件")
468
- ])) : i(g) ? (l(), c("div", Gt, [
469
- Wt,
461
+ ])) : l(k) ? (i(), u("div", Lt, [
462
+ b[11] || (b[11] = e("p", null, "该文件类型暂不支持在线预览,请下载后查看。", -1)),
470
463
  e("button", {
471
464
  type: "button",
472
465
  class: "wi-output-file-drawer__btn",
473
- onClick: S[7] || (S[7] = //@ts-ignore
474
- (...x) => i(T) && i(T)(...x))
466
+ onClick: b[7] || (b[7] = //@ts-ignore
467
+ (...$) => l(T) && l(T)(...$))
475
468
  }, "下载文件")
476
- ])) : i(o) === "image" && i(y) ? (l(), c("img", {
469
+ ])) : l(o) === "image" && l(w) ? (i(), u("img", {
477
470
  key: 3,
478
471
  class: "wi-output-file-drawer__image",
479
- src: i(y),
480
- alt: i(u)
481
- }, null, 8, Yt)) : i(o) === "pdf" && i(y) ? (l(), c("iframe", {
472
+ src: l(w),
473
+ alt: l(c)
474
+ }, null, 8, jt)) : l(o) === "pdf" && l(w) ? (i(), u("iframe", {
482
475
  key: 4,
483
476
  class: "wi-output-file-drawer__frame",
484
- src: i(y),
485
- title: i(u)
486
- }, null, 8, Jt)) : i(o) === "html" ? (l(), c("iframe", {
477
+ src: l(w),
478
+ title: l(c)
479
+ }, null, 8, Nt)) : l(o) === "html" ? (i(), u("iframe", {
487
480
  key: 5,
488
481
  class: "wi-output-file-drawer__frame",
489
- srcdoc: i(p),
482
+ srcdoc: l(h),
490
483
  sandbox: "allow-scripts allow-forms allow-modals",
491
- title: i(u)
492
- }, null, 8, Zt)) : i(o) === "audio" && i(y) ? (l(), c("audio", {
484
+ title: l(c)
485
+ }, null, 8, Rt)) : l(o) === "audio" && l(w) ? (i(), u("audio", {
493
486
  key: 6,
494
487
  class: "wi-output-file-drawer__media",
495
- src: i(y),
488
+ src: l(w),
496
489
  controls: ""
497
- }, null, 8, Qt)) : i(o) === "video" && i(y) ? (l(), c("video", {
490
+ }, null, 8, At)) : l(o) === "video" && l(w) ? (i(), u("video", {
498
491
  key: 7,
499
492
  class: "wi-output-file-drawer__media",
500
- src: i(y),
493
+ src: l(w),
501
494
  controls: ""
502
- }, null, 8, es)) : (l(), c("pre", ts, v(i(p)), 1))
495
+ }, null, 8, Ft)) : (i(), u("pre", Dt, f(l(h)), 1))
503
496
  ])
504
- ], 8, Rt)
497
+ ], 8, $t)
505
498
  ])) : V("", !0)
506
499
  ]),
507
500
  _: 1
@@ -509,91 +502,85 @@ const ze = [
509
502
  ]))
510
503
  ]));
511
504
  }
512
- }), ns = /* @__PURE__ */ N(ss, [["__scopeId", "data-v-f61a91b5"]]), os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
505
+ }), zt = /* @__PURE__ */ N(Bt, [["__scopeId", "data-v-f61a91b5"]]), qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
513
506
  __proto__: null,
514
- default: ns
515
- }, Symbol.toStringTag, { value: "Module" })), as = () => {
516
- var a, u;
517
- const n = (u = (a = window == null ? void 0 : window.globalConfig) == null ? void 0 : a.WebApiUrl) == null ? void 0 : u.MainUrl;
518
- return typeof n == "string" ? n : "";
519
- }, rs = () => window.location.origin + window.location.pathname, ne = "access-session", is = () => {
520
- const n = window.location.pathname.split("/").filter((a) => !!a).join("-");
521
- return n ? `${n}-` : "";
522
- }, ls = () => {
523
- const n = `${is()}${ne}`, a = [];
507
+ default: zt
508
+ }, Symbol.toStringTag, { value: "Module" })), Ht = () => {
509
+ var a, c;
510
+ const r = (c = (a = window == null ? void 0 : window.globalConfig) == null ? void 0 : a.WebApiUrl) == null ? void 0 : c.MainUrl;
511
+ return typeof r == "string" ? r : "";
512
+ }, Kt = () => window.location.origin + window.location.pathname, te = "access-session", Xt = () => {
513
+ const r = window.location.pathname.split("/").filter((a) => !!a).join("-");
514
+ return r ? `${r}-` : "";
515
+ }, Gt = () => {
516
+ const r = `${Xt()}${te}`, a = [];
524
517
  for (let t = 0; t < localStorage.length; t++) {
525
518
  const o = localStorage.key(t);
526
- !o || !o.endsWith(ne) || o.slice(0, o.lastIndexOf(":")) !== "wi admin" && (o.endsWith(`x-${ne}`) || a.push(o));
519
+ !o || !o.endsWith(te) || o.slice(0, o.lastIndexOf(":")) !== "wi admin" && (o.endsWith(`x-${te}`) || a.push(o));
527
520
  }
528
- const u = a.find((t) => t.endsWith(n)) ?? a[0];
529
- if (!u)
530
- return "";
521
+ const c = a.find((t) => t.endsWith(r)) ?? a[0];
522
+ if (!c) return "";
531
523
  try {
532
- const t = localStorage.getItem(u);
533
- if (!t || t === "undefined")
534
- return "";
524
+ const t = localStorage.getItem(c);
525
+ if (!t || t === "undefined") return "";
535
526
  const o = JSON.parse(t);
536
527
  return o == null ? "" : String(o);
537
528
  } catch {
538
529
  return "";
539
530
  }
540
- }, we = Symbol("wi-chat-iframe-page-config"), Sn = (n) => {
541
- _e(we, n);
542
- }, cs = (n, a) => {
543
- const u = (a == null ? void 0 : a.mainUrl) !== void 0 ? String(z(a.mainUrl)) : as(), t = (a == null ? void 0 : a.token) !== void 0 ? String(z(a.token)) : ls();
544
- return n.replace(/\{\{\s*MAIN_URL\s*\}\}/g, u).replace(/\{\{\s*SERVE_URL\s*\}\}/g, rs()).replace(/\{\{\s*token\s*\}\}/g, t);
545
- }, us = (n) => {
546
- const a = ce() ? ue(we, {}) : {}, u = I(() => {
547
- var w;
548
- const o = z(n), d = ((w = o == null ? void 0 : o.values) == null ? void 0 : w.url) ?? (o == null ? void 0 : o.url) ?? "";
549
- return d ? a.resolveUrl ? a.resolveUrl(d) : cs(d, a) : "";
531
+ }, _e = Symbol("wi-chat-iframe-page-config"), sn = (r) => {
532
+ ie(_e, r);
533
+ }, Wt = (r, a) => {
534
+ const c = (a == null ? void 0 : a.mainUrl) !== void 0 ? String(z(a.mainUrl)) : Ht(), t = (a == null ? void 0 : a.token) !== void 0 ? String(z(a.token)) : Gt();
535
+ return r.replace(/\{\{\s*MAIN_URL\s*\}\}/g, c).replace(/\{\{\s*SERVE_URL\s*\}\}/g, Kt()).replace(/\{\{\s*token\s*\}\}/g, t);
536
+ }, Yt = (r) => {
537
+ const a = ae() ? re(_e, {}) : {}, c = I(() => {
538
+ var v;
539
+ const o = z(r), d = ((v = o == null ? void 0 : o.values) == null ? void 0 : v.url) ?? (o == null ? void 0 : o.url) ?? "";
540
+ return d ? a.resolveUrl ? a.resolveUrl(d) : Wt(d, a) : "";
550
541
  }), t = I(() => {
551
542
  var d;
552
- const o = z(n);
543
+ const o = z(r);
553
544
  return ((d = o == null ? void 0 : o.values) == null ? void 0 : d.srcdoc) ?? (o == null ? void 0 : o.srcdoc) ?? "";
554
545
  });
555
- return { url: u, srcdoc: t };
556
- }, le = "data-wi-iframe-resizer-child", ds = (n) => {
557
- if (!n)
558
- return !1;
546
+ return { url: c, srcdoc: t };
547
+ }, oe = "data-wi-iframe-resizer-child", Jt = (r) => {
548
+ if (!r) return !1;
559
549
  let a = null;
560
550
  try {
561
- a = n.contentDocument;
551
+ a = r.contentDocument;
562
552
  } catch {
563
553
  return !1;
564
554
  }
565
- if (!a)
566
- return !1;
567
- const u = a.head || a.documentElement;
568
- if (!u)
569
- return !1;
555
+ if (!a) return !1;
556
+ const c = a.head || a.documentElement;
557
+ if (!c) return !1;
570
558
  const t = a.defaultView;
571
- if (t != null && t.parentIframe || t != null && t.parentIFrame || a.querySelector(`script[${le}]`))
572
- return !1;
559
+ if (t != null && t.parentIframe || t != null && t.parentIFrame || a.querySelector(`script[${oe}]`)) return !1;
573
560
  const o = a.createElement("script");
574
- return o.textContent = Ae, o.setAttribute(le, ""), u.appendChild(o), !0;
575
- }, _s = /* @__PURE__ */ j({
561
+ return o.textContent = Me, o.setAttribute(oe, ""), c.appendChild(o), !0;
562
+ }, Zt = /* @__PURE__ */ j({
576
563
  __name: "IframePage",
577
564
  props: {
578
565
  report: {}
579
566
  },
580
- setup(n) {
581
- const a = n, { url: u, srcdoc: t } = us(() => a.report), o = (d) => {
582
- ds(d.target);
567
+ setup(r) {
568
+ const a = r, { url: c, srcdoc: t } = Yt(() => a.report), o = (d) => {
569
+ Jt(d.target);
583
570
  };
584
- return (d, w) => i(u) ? (l(), ee(ie, {
571
+ return (d, v) => l(c) ? (i(), Z(ne, {
585
572
  key: 0,
586
573
  class: "iframe-page__frame iframe-page__frame--url",
587
574
  license: "GPLv3",
588
- src: i(u),
575
+ src: l(c),
589
576
  width: "100%",
590
577
  "warning-timeout": 0,
591
578
  onLoad: o
592
- }, null, 8, ["src"])) : i(t) ? (l(), ee(ie, {
579
+ }, null, 8, ["src"])) : l(t) ? (i(), Z(ne, {
593
580
  key: 1,
594
581
  class: "iframe-page iframe-page--srcdoc",
595
582
  license: "GPLv3",
596
- srcdoc: i(t),
583
+ srcdoc: l(t),
597
584
  width: "100%",
598
585
  frameborder: "no",
599
586
  border: "0",
@@ -602,341 +589,340 @@ const ze = [
602
589
  scrolling: "no"
603
590
  }, null, 8, ["srcdoc"])) : V("", !0);
604
591
  }
605
- }), ps = /* @__PURE__ */ N(_s, [["__scopeId", "data-v-f4c94a4e"]]), fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
592
+ }), Qt = /* @__PURE__ */ N(Zt, [["__scopeId", "data-v-f4c94a4e"]]), es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
606
593
  __proto__: null,
607
- default: ps
608
- }, Symbol.toStringTag, { value: "Module" })), ae = (n) => (K("data-v-74053305"), n = n(), X(), n), vs = { class: "wi-clarify__header" }, ws = { class: "wi-clarify__heading" }, hs = /* @__PURE__ */ ae(() => /* @__PURE__ */ e("div", { class: "wi-clarify__eyebrow" }, "需要补充信息", -1)), ys = { class: "wi-clarify__title" }, ms = {
594
+ default: Qt
595
+ }, Symbol.toStringTag, { value: "Module" })), ts = { class: "wi-clarify__header" }, ss = { class: "wi-clarify__heading" }, ns = { class: "wi-clarify__title" }, os = {
609
596
  key: 0,
610
597
  class: "wi-clarify__desc"
611
- }, bs = { class: "wi-clarify__status" }, gs = { class: "wi-clarify__progress" }, ks = { class: "wi-clarify__progress-track" }, Ss = {
598
+ }, as = { class: "wi-clarify__status" }, rs = { class: "wi-clarify__progress" }, ls = { class: "wi-clarify__progress-track" }, is = {
612
599
  key: 0,
613
600
  class: "wi-clarify__panel"
614
- }, $s = { class: "wi-clarify__question" }, xs = {
601
+ }, us = { class: "wi-clarify__question" }, cs = {
615
602
  key: 0,
616
603
  class: "wi-clarify__question-desc"
617
- }, Is = {
604
+ }, ds = {
618
605
  key: 1,
619
606
  class: "wi-clarify__binding"
620
- }, Cs = {
607
+ }, _s = {
621
608
  key: 2,
622
609
  class: "wi-clarify__options"
623
- }, Es = ["onClick"], Os = { class: "wi-clarify__option-indicator" }, Ts = {
610
+ }, ps = ["onClick"], fs = { class: "wi-clarify__option-indicator" }, vs = {
624
611
  key: 3,
625
612
  class: "wi-clarify__date"
626
- }, Vs = ["for"], Ps = ["id", "value"], Us = { class: "wi-clarify__text" }, Ms = {
613
+ }, ws = ["for"], ys = ["id", "value"], ms = { class: "wi-clarify__text" }, hs = {
627
614
  key: 0,
628
615
  class: "wi-clarify__or"
629
- }, Ls = /* @__PURE__ */ ae(() => /* @__PURE__ */ e("span", null, "或者,用自己的话说明", -1)), js = [
630
- Ls
631
- ], Ns = ["for"], Rs = ["id", "value", "placeholder"], As = {
616
+ }, bs = ["for"], gs = ["id", "value", "placeholder"], ks = {
632
617
  class: "wi-clarify__dots",
633
618
  "aria-label": "确认问题导航"
634
- }, Fs = ["aria-label", "onClick"], Ds = { class: "wi-clarify__footer" }, Bs = /* @__PURE__ */ ae(() => /* @__PURE__ */ e("span", { class: "wi-clarify__confirm-text" }, "取消后本次操作将停止等待这些回答", -1)), zs = { class: "wi-clarify__actions" }, qs = { class: "wi-clarify__actions" }, Hs = ["disabled"], Ks = {
619
+ }, xs = ["aria-label", "onClick"], Ss = { class: "wi-clarify__footer" }, $s = { class: "wi-clarify__actions" }, Is = { class: "wi-clarify__actions" }, Cs = ["disabled"], Es = {
635
620
  key: 1,
636
621
  class: "wi-clarify__result"
637
- }, Xs = { class: "wi-clarify__result-icon" }, Gs = { class: "wi-clarify__result-body" }, Ws = {
622
+ }, Os = { class: "wi-clarify__result-icon" }, Ts = { class: "wi-clarify__result-body" }, Vs = {
638
623
  key: 0,
639
624
  class: "wi-clarify__summary"
640
- }, Ys = { key: 1 }, Js = { key: 2 }, Zs = {
625
+ }, Ps = { key: 1 }, Us = { key: 2 }, Ms = {
641
626
  key: 2,
642
627
  class: "wi-clarify__feedback"
643
- }, Qs = /* @__PURE__ */ j({
628
+ }, Ls = /* @__PURE__ */ j({
644
629
  __name: "ClarificationCard",
645
630
  props: {
646
631
  report: {}
647
632
  },
648
- setup(n) {
649
- const a = n, u = {
633
+ setup(r) {
634
+ const a = r, c = {
650
635
  requestId: "",
651
636
  title: "需要补充信息",
652
637
  description: "",
653
638
  items: [],
654
639
  status: "expired",
655
640
  resultMessage: "本次补充信息已失效(回答已结束)"
656
- }, t = I(() => a.report.values ?? u), o = I(() => t.value.items ?? []), d = U(0), w = Ve({}), $ = U(!1), b = U("");
657
- de(() => {
641
+ }, t = I(() => a.report.values ?? c), o = I(() => t.value.items ?? []), d = U(0), v = Ie({}), S = U(!1), g = U("");
642
+ le(() => {
658
643
  var s;
659
644
  return (s = t.value) == null ? void 0 : s.requestId;
660
645
  }, () => {
661
- Object.keys(w).forEach((s) => delete w[s]), o.value.forEach((s) => {
662
- const r = { structuredValue: void 0, structuredValues: [], textValue: "" };
663
- s.default !== void 0 && (s.input.type === "multi_select" ? r.structuredValues = Array.isArray(s.default) ? [...s.default] : [] : s.input.type === "text" ? r.textValue = String(s.default) : r.structuredValue = s.default), w[s.id] = r;
646
+ Object.keys(v).forEach((s) => delete v[s]), o.value.forEach((s) => {
647
+ const n = { structuredValue: void 0, structuredValues: [], textValue: "" };
648
+ s.default !== void 0 && (s.input.type === "multi_select" ? n.structuredValues = Array.isArray(s.default) ? [...s.default] : [] : s.input.type === "text" ? n.textValue = String(s.default) : n.structuredValue = s.default), v[s.id] = n;
664
649
  }), d.value = 0;
665
650
  }, { immediate: !0 });
666
- const p = (s) => (w[s] || (w[s] = { structuredValue: void 0, structuredValues: [], textValue: "" }), w[s]), y = I(() => {
667
- var s, r, f;
668
- return ((s = t.value) == null ? void 0 : s.status) === "submitted" ? "已提交" : ((r = t.value) == null ? void 0 : r.status) === "cancelled" ? "已取消" : ((f = t.value) == null ? void 0 : f.status) === "expired" ? "已失效" : "等待回答";
669
- }), k = (s) => {
651
+ const h = (s) => (v[s] || (v[s] = { structuredValue: void 0, structuredValues: [], textValue: "" }), v[s]), w = I(() => {
652
+ var s, n, p;
653
+ return ((s = t.value) == null ? void 0 : s.status) === "submitted" ? "已提交" : ((n = t.value) == null ? void 0 : n.status) === "cancelled" ? "已取消" : ((p = t.value) == null ? void 0 : p.status) === "expired" ? "已失效" : "等待回答";
654
+ }), x = (s) => {
670
655
  try {
671
- const r = JSON.stringify(s);
672
- return r === void 0 ? String(s) : r;
656
+ const n = JSON.stringify(s);
657
+ return n === void 0 ? String(s) : n;
673
658
  } catch {
674
659
  return String(s);
675
660
  }
676
- }, O = (s, r) => k(s) === k(r), T = (s, r) => {
677
- const f = p(s.id);
678
- return s.input.type === "multi_select" ? f.structuredValues.some((m) => O(m, r)) : O(f.structuredValue, r);
679
- }, R = (s, r) => {
680
- const f = p(s.id);
681
- if (f.textValue = "", s.input.type === "multi_select") {
682
- const m = f.structuredValues.findIndex((P) => O(P, r));
683
- m >= 0 ? f.structuredValues.splice(m, 1) : f.structuredValues.push(r);
661
+ }, O = (s, n) => x(s) === x(n), T = (s, n) => {
662
+ const p = h(s.id);
663
+ return s.input.type === "multi_select" ? p.structuredValues.some((m) => O(m, n)) : O(p.structuredValue, n);
664
+ }, R = (s, n) => {
665
+ const p = h(s.id);
666
+ if (p.textValue = "", s.input.type === "multi_select") {
667
+ const m = p.structuredValues.findIndex((P) => O(P, n));
668
+ m >= 0 ? p.structuredValues.splice(m, 1) : p.structuredValues.push(n);
684
669
  return;
685
670
  }
686
- f.structuredValue = r;
687
- }, S = (s) => {
688
- var r;
689
- return ((r = s.target) == null ? void 0 : r.value) ?? "";
690
- }, x = (s, r) => {
691
- const f = p(s.id);
692
- f.textValue = S(r), s.input.type !== "text" && (f.structuredValue = void 0, f.structuredValues.splice(0));
693
- }, G = (s, r) => {
694
- const f = p(s.id);
695
- f.structuredValue = S(r), f.textValue = "";
696
- }, W = (s) => {
697
- const r = p(s.id).structuredValue;
698
- return r == null ? "" : String(r);
671
+ p.structuredValue = n;
672
+ }, b = (s) => {
673
+ var n;
674
+ return ((n = s.target) == null ? void 0 : n.value) ?? "";
675
+ }, $ = (s, n) => {
676
+ const p = h(s.id);
677
+ p.textValue = b(n), s.input.type !== "text" && (p.structuredValue = void 0, p.structuredValues.splice(0));
678
+ }, K = (s, n) => {
679
+ const p = h(s.id);
680
+ p.structuredValue = b(n), p.textValue = "";
681
+ }, X = (s) => {
682
+ const n = h(s.id).structuredValue;
683
+ return n == null ? "" : String(n);
699
684
  }, q = (s) => {
700
- var r;
701
- return ((r = s.input.textInput) == null ? void 0 : r.placeholder) ?? s.input.placeholder ?? (s.input.type === "text" ? "请输入需要补充的信息" : "例如:使用阀门,或者说明你的具体要求");
685
+ var n;
686
+ return ((n = s.input.textInput) == null ? void 0 : n.placeholder) ?? s.input.placeholder ?? (s.input.type === "text" ? "请输入需要补充的信息" : "例如:使用阀门,或者说明你的具体要求");
702
687
  }, _ = (s) => {
703
- const r = s.binding;
704
- if (!r)
705
- return "";
706
- const f = r.actionName ? `动作:${r.actionName}` : "", m = r.parameterPath ? `参数:${r.parameterPath}` : "";
707
- return [f, m].filter(Boolean).join(" · ");
688
+ const n = s.binding;
689
+ if (!n) return "";
690
+ const p = n.actionName ? `动作:${n.actionName}` : "", m = n.parameterPath ? `参数:${n.parameterPath}` : "";
691
+ return [p, m].filter(Boolean).join(" · ");
708
692
  }, C = (s) => {
709
- const r = p(s.id);
710
- return s.input.type === "multi_select" ? r.structuredValues.length > 0 : s.input.type === "single_select" ? r.structuredValue !== void 0 : s.input.type === "date" ? !!r.structuredValue : !1;
711
- }, E = (s) => !!p(s.id).textValue.trim() || C(s), Y = (s) => !s.required || E(s) ? !0 : (b.value = `请回答“${s.question}”`, !1), A = () => {
712
- b.value = "", d.value = Math.max(0, d.value - 1);
693
+ const n = h(s.id);
694
+ return s.input.type === "multi_select" ? n.structuredValues.length > 0 : s.input.type === "single_select" ? n.structuredValue !== void 0 : s.input.type === "date" ? !!n.structuredValue : !1;
695
+ }, E = (s) => !!h(s.id).textValue.trim() || C(s), G = (s) => !s.required || E(s) ? !0 : (g.value = `请回答“${s.question}”`, !1), A = () => {
696
+ g.value = "", d.value = Math.max(0, d.value - 1);
713
697
  }, L = () => {
714
- !h.value || !Y(h.value) || (b.value = "", d.value = Math.min(o.value.length - 1, d.value + 1));
715
- }, h = I(() => o.value[d.value]), J = (s, r) => s.input.type === "date" ? String(r ?? "") : (Array.isArray(r) ? r : [r]).map((m) => {
716
- var Q;
717
- const P = (Q = s.input.options) == null ? void 0 : Q.find((ge) => O(ge.value, m));
698
+ !y.value || !G(y.value) || (g.value = "", d.value = Math.min(o.value.length - 1, d.value + 1));
699
+ }, y = I(() => o.value[d.value]), W = (s, n) => s.input.type === "date" ? String(n ?? "") : (Array.isArray(n) ? n : [n]).map((m) => {
700
+ var J;
701
+ const P = (J = s.input.options) == null ? void 0 : J.find((we) => O(we.value, m));
718
702
  return (P == null ? void 0 : P.label) ?? String(m ?? "");
719
- }).filter(Boolean).join("、"), Z = (s) => {
720
- const r = p(s.id), f = r.textValue.trim();
721
- if (s.input.type === "text" || f || !C(s))
722
- return { id: s.id, mode: "text", value: f, displayText: f };
723
- const m = s.input.type === "multi_select" ? [...r.structuredValues] : r.structuredValue;
703
+ }).filter(Boolean).join("、"), Y = (s) => {
704
+ const n = h(s.id), p = n.textValue.trim();
705
+ if (s.input.type === "text" || p || !C(s))
706
+ return { id: s.id, mode: "text", value: p, displayText: p };
707
+ const m = s.input.type === "multi_select" ? [...n.structuredValues] : n.structuredValue;
724
708
  return {
725
709
  id: s.id,
726
710
  mode: "structured",
727
711
  value: m,
728
- displayText: J(s, m)
712
+ displayText: W(s, m)
729
713
  };
730
- }, ye = () => {
731
- const s = o.value.findIndex((f) => f.required && !E(f));
714
+ }, pe = () => {
715
+ const s = o.value.findIndex((p) => p.required && !E(p));
732
716
  if (s >= 0) {
733
- d.value = s, b.value = `请回答“${o.value[s].question}”`;
717
+ d.value = s, g.value = `请回答“${o.value[s].question}”`;
734
718
  return;
735
719
  }
736
- b.value = "";
737
- const r = o.value.map(Z);
738
- Fe(t.value.requestId, r) || (b.value = "本次补充信息已经处理");
739
- }, me = () => {
740
- $.value = !1, b.value = "", De(t.value.requestId) || (b.value = "本次补充信息已经处理");
741
- }, be = (s) => {
742
- var r;
743
- return ((r = o.value.find((f) => f.id === s)) == null ? void 0 : r.question) ?? s;
720
+ g.value = "";
721
+ const n = o.value.filter((p) => p.required || E(p)).map(Y);
722
+ Le(t.value.requestId, n) || (g.value = "本次补充信息已经处理");
723
+ }, fe = () => {
724
+ S.value = !1, g.value = "", je(t.value.requestId) || (g.value = "本次补充信息已经处理");
725
+ }, ve = (s) => {
726
+ var n;
727
+ return ((n = o.value.find((p) => p.id === s)) == null ? void 0 : n.question) ?? s;
744
728
  };
745
- return (s, r) => {
746
- var f;
747
- return l(), c("section", {
729
+ return (s, n) => {
730
+ var p;
731
+ return i(), u("section", {
748
732
  class: D(["wi-clarify", `is-${t.value.status}`])
749
733
  }, [
750
- e("header", vs, [
751
- e("div", ws, [
752
- hs,
753
- e("h3", ys, v(t.value.title), 1),
754
- t.value.description ? (l(), c("p", ms, v(t.value.description), 1)) : V("", !0)
734
+ e("header", ts, [
735
+ e("div", ss, [
736
+ n[4] || (n[4] = e("div", { class: "wi-clarify__eyebrow" }, "需要补充信息", -1)),
737
+ e("h3", ns, f(t.value.title), 1),
738
+ t.value.description ? (i(), u("p", os, f(t.value.description), 1)) : V("", !0)
755
739
  ]),
756
- e("span", bs, v(y.value), 1)
740
+ e("span", as, f(w.value), 1)
757
741
  ]),
758
- t.value.status === "pending" ? (l(), c(M, { key: 0 }, [
759
- e("div", gs, [
760
- e("span", null, "问题 " + v(d.value + 1) + " / " + v(o.value.length), 1),
761
- e("div", ks, [
742
+ t.value.status === "pending" ? (i(), u(M, { key: 0 }, [
743
+ e("div", rs, [
744
+ e("span", null, "问题 " + f(d.value + 1) + " / " + f(o.value.length), 1),
745
+ e("div", ls, [
762
746
  e("span", {
763
- style: Pe({ width: `${(d.value + 1) / o.value.length * 100}%` })
747
+ style: Ce({ width: `${(d.value + 1) / o.value.length * 100}%` })
764
748
  }, null, 4)
765
749
  ])
766
750
  ]),
767
- h.value ? (l(), c("div", Ss, [
768
- e("div", $s, [
751
+ y.value ? (i(), u("div", is, [
752
+ e("div", us, [
769
753
  e("span", {
770
- class: D(h.value.required ? "wi-clarify__required" : "wi-clarify__optional")
771
- }, v(h.value.required ? "必填" : "选填"), 3),
772
- e("h4", null, v(h.value.question), 1)
754
+ class: D(y.value.required ? "wi-clarify__required" : "wi-clarify__optional")
755
+ }, f(y.value.required ? "必填" : "选填"), 3),
756
+ e("h4", null, f(y.value.question), 1)
773
757
  ]),
774
- h.value.description ? (l(), c("p", xs, v(h.value.description), 1)) : V("", !0),
775
- _(h.value) ? (l(), c("div", Is, v(_(h.value)), 1)) : V("", !0),
776
- h.value.input.type === "single_select" || h.value.input.type === "multi_select" ? (l(), c("div", Cs, [
777
- (l(!0), c(M, null, B(h.value.input.options, (m, P) => (l(), c("button", {
758
+ y.value.description ? (i(), u("p", cs, f(y.value.description), 1)) : V("", !0),
759
+ _(y.value) ? (i(), u("div", ds, f(_(y.value)), 1)) : V("", !0),
760
+ y.value.input.type === "single_select" || y.value.input.type === "multi_select" ? (i(), u("div", _s, [
761
+ (i(!0), u(M, null, B(y.value.input.options, (m, P) => (i(), u("button", {
778
762
  key: P,
779
763
  type: "button",
780
- class: D(["wi-clarify__option", { "is-selected": T(h.value, m.value) }]),
781
- onClick: (Q) => R(h.value, m.value)
764
+ class: D(["wi-clarify__option", { "is-selected": T(y.value, m.value) }]),
765
+ onClick: (J) => R(y.value, m.value)
782
766
  }, [
783
- e("span", Os, v(T(h.value, m.value) ? "✓" : ""), 1),
784
- e("span", null, v(m.label), 1)
785
- ], 10, Es))), 128))
786
- ])) : h.value.input.type === "date" ? (l(), c("div", Ts, [
767
+ e("span", fs, f(T(y.value, m.value) ? "✓" : ""), 1),
768
+ e("span", null, f(m.label), 1)
769
+ ], 10, ps))), 128))
770
+ ])) : y.value.input.type === "date" ? (i(), u("div", vs, [
787
771
  e("label", {
788
- for: `wi-clarify-date-${h.value.id}`
789
- }, "选择日期", 8, Vs),
772
+ for: `wi-clarify-date-${y.value.id}`
773
+ }, "选择日期", 8, ws),
790
774
  e("input", {
791
- id: `wi-clarify-date-${h.value.id}`,
775
+ id: `wi-clarify-date-${y.value.id}`,
792
776
  type: "date",
793
- value: W(h.value),
794
- onInput: r[0] || (r[0] = (m) => G(h.value, m))
795
- }, null, 40, Ps)
777
+ value: X(y.value),
778
+ onInput: n[0] || (n[0] = (m) => K(y.value, m))
779
+ }, null, 40, ys)
796
780
  ])) : V("", !0),
797
- e("div", Us, [
798
- h.value.input.type !== "text" ? (l(), c("div", Ms, js)) : V("", !0),
781
+ e("div", ms, [
782
+ y.value.input.type !== "text" ? (i(), u("div", hs, [...n[5] || (n[5] = [
783
+ e("span", null, "或者,用自己的话说明", -1)
784
+ ])])) : V("", !0),
799
785
  e("label", {
800
- for: `wi-clarify-text-${h.value.id}`
801
- }, v(h.value.input.type === "text" ? "你的回答" : "自然语言回答"), 9, Ns),
786
+ for: `wi-clarify-text-${y.value.id}`
787
+ }, f(y.value.input.type === "text" ? "你的回答" : "自然语言回答"), 9, bs),
802
788
  e("textarea", {
803
- id: `wi-clarify-text-${h.value.id}`,
804
- value: p(h.value.id).textValue,
805
- placeholder: q(h.value),
789
+ id: `wi-clarify-text-${y.value.id}`,
790
+ value: h(y.value.id).textValue,
791
+ placeholder: q(y.value),
806
792
  rows: "3",
807
- onInput: r[1] || (r[1] = (m) => x(h.value, m))
808
- }, null, 40, Rs)
793
+ onInput: n[1] || (n[1] = (m) => $(y.value, m))
794
+ }, null, 40, gs)
809
795
  ])
810
796
  ])) : V("", !0),
811
- e("div", As, [
812
- (l(!0), c(M, null, B(o.value, (m, P) => (l(), c("button", {
797
+ e("div", ks, [
798
+ (i(!0), u(M, null, B(o.value, (m, P) => (i(), u("button", {
813
799
  key: m.id,
814
800
  type: "button",
815
801
  "aria-label": `查看第 ${P + 1} 个问题`,
816
802
  class: D({ "is-active": P === d.value, "is-answered": E(m) }),
817
- onClick: (Q) => d.value = P
818
- }, null, 10, Fs))), 128))
803
+ onClick: (J) => d.value = P
804
+ }, null, 10, xs))), 128))
819
805
  ]),
820
- e("footer", Ds, [
821
- $.value ? (l(), c(M, { key: 0 }, [
822
- Bs,
823
- e("div", zs, [
806
+ e("footer", Ss, [
807
+ S.value ? (i(), u(M, { key: 0 }, [
808
+ n[6] || (n[6] = e("span", { class: "wi-clarify__confirm-text" }, "取消后本次操作将停止等待这些回答", -1)),
809
+ e("div", $s, [
824
810
  e("button", {
825
811
  type: "button",
826
812
  class: "wi-clarify__btn wi-clarify__btn--secondary",
827
- onClick: r[2] || (r[2] = (m) => $.value = !1)
813
+ onClick: n[2] || (n[2] = (m) => S.value = !1)
828
814
  }, " 继续填写 "),
829
815
  e("button", {
830
816
  type: "button",
831
817
  class: "wi-clarify__btn wi-clarify__btn--danger",
832
- onClick: me
818
+ onClick: fe
833
819
  }, "确认取消")
834
820
  ])
835
- ], 64)) : (l(), c(M, { key: 1 }, [
821
+ ], 64)) : (i(), u(M, { key: 1 }, [
836
822
  e("button", {
837
823
  type: "button",
838
824
  class: "wi-clarify__cancel",
839
- onClick: r[3] || (r[3] = (m) => $.value = !0)
825
+ onClick: n[3] || (n[3] = (m) => S.value = !0)
840
826
  }, "取消"),
841
- e("div", qs, [
827
+ e("div", Is, [
842
828
  e("button", {
843
829
  type: "button",
844
830
  class: "wi-clarify__btn wi-clarify__btn--secondary",
845
831
  disabled: d.value === 0,
846
832
  onClick: A
847
- }, " 上一项 ", 8, Hs),
848
- d.value < o.value.length - 1 ? (l(), c("button", {
833
+ }, " 上一项 ", 8, Cs),
834
+ d.value < o.value.length - 1 ? (i(), u("button", {
849
835
  key: 0,
850
836
  type: "button",
851
837
  class: "wi-clarify__btn wi-clarify__btn--primary",
852
838
  onClick: L
853
- }, " 下一项 ")) : (l(), c("button", {
839
+ }, " 下一项 ")) : (i(), u("button", {
854
840
  key: 1,
855
841
  type: "button",
856
842
  class: "wi-clarify__btn wi-clarify__btn--primary",
857
- onClick: ye
843
+ onClick: pe
858
844
  }, "提交全部"))
859
845
  ])
860
846
  ], 64))
861
847
  ])
862
- ], 64)) : (l(), c("div", Ks, [
863
- e("div", Xs, v(t.value.status === "submitted" ? "✓" : t.value.status === "cancelled" ? "—" : "!"), 1),
864
- e("div", Gs, [
865
- e("h4", null, v(t.value.resultMessage || y.value), 1),
866
- t.value.status === "submitted" && ((f = t.value.answers) != null && f.length) ? (l(), c("div", Ws, [
867
- (l(!0), c(M, null, B(t.value.answers, (m) => (l(), c("div", {
848
+ ], 64)) : (i(), u("div", Es, [
849
+ e("div", Os, f(t.value.status === "submitted" ? "✓" : t.value.status === "cancelled" ? "—" : "!"), 1),
850
+ e("div", Ts, [
851
+ e("h4", null, f(t.value.resultMessage || w.value), 1),
852
+ t.value.status === "submitted" && ((p = t.value.answers) != null && p.length) ? (i(), u("div", Vs, [
853
+ (i(!0), u(M, null, B(t.value.answers, (m) => (i(), u("div", {
868
854
  key: m.id
869
855
  }, [
870
- e("span", null, v(be(m.id)), 1),
871
- e("strong", null, v(m.displayText || "未填写"), 1)
856
+ e("span", null, f(ve(m.id)), 1),
857
+ e("strong", null, f(m.displayText || "未填写"), 1)
872
858
  ]))), 128))
873
- ])) : t.value.status === "cancelled" ? (l(), c("p", Ys, "本次确认未提交,工作流将收到取消结果。")) : (l(), c("p", Js, "该确认项已失效,无法再提交。"))
859
+ ])) : t.value.status === "cancelled" ? (i(), u("p", Ps, "本次确认未提交,工作流将收到取消结果。")) : (i(), u("p", Us, "该确认项已失效,无法再提交。"))
874
860
  ])
875
861
  ])),
876
- b.value ? (l(), c("div", Zs, v(b.value), 1)) : V("", !0)
862
+ g.value ? (i(), u("div", Ms, f(g.value), 1)) : V("", !0)
877
863
  ], 2);
878
864
  };
879
865
  }
880
- }), en = /* @__PURE__ */ N(Qs, [["__scopeId", "data-v-74053305"]]), tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
866
+ }), js = /* @__PURE__ */ N(Ls, [["__scopeId", "data-v-c684f993"]]), Ns = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
881
867
  __proto__: null,
882
- default: en
883
- }, Symbol.toStringTag, { value: "Module" })), he = (n) => (K("data-v-bb5c9850"), n = n(), X(), n), sn = { class: "wi-host-action__head" }, nn = {
868
+ default: js
869
+ }, Symbol.toStringTag, { value: "Module" })), Rs = { class: "wi-host-action__head" }, As = {
884
870
  class: "wi-host-action__icon",
885
871
  "aria-hidden": "true"
886
- }, on = { class: "wi-host-action__title" }, an = /* @__PURE__ */ he(() => /* @__PURE__ */ e("span", { class: "wi-host-action__label" }, "执行操作", -1)), rn = { class: "wi-host-action__name" }, ln = { class: "wi-host-action__chip" }, cn = { class: "wi-host-action__message" }, un = {
872
+ }, Fs = { class: "wi-host-action__title" }, Ds = { class: "wi-host-action__name" }, Bs = { class: "wi-host-action__chip" }, zs = { class: "wi-host-action__message" }, qs = {
887
873
  key: 0,
888
874
  class: "wi-host-action__args"
889
- }, dn = /* @__PURE__ */ he(() => /* @__PURE__ */ e("summary", null, "查看参数", -1)), _n = /* @__PURE__ */ j({
875
+ }, Hs = /* @__PURE__ */ j({
890
876
  __name: "HostActionStatus",
891
877
  props: {
892
878
  report: {}
893
879
  },
894
- setup(n) {
895
- const a = n, u = {
880
+ setup(r) {
881
+ const a = r, c = {
896
882
  id: "",
897
883
  name: "",
898
884
  arguments: {},
899
885
  status: "unknown",
900
886
  message: "执行状态未知(回答已结束)"
901
- }, t = I(() => a.report.values ?? u), o = I(() => t.value.status === "running" ? "●" : t.value.status === "success" ? "✓" : t.value.status === "error" ? "!" : "?"), d = I(() => t.value.status === "running" ? "执行中" : t.value.status === "success" ? "已完成" : t.value.status === "error" ? "执行失败" : "状态未知"), w = I(() => {
902
- const b = t.value.arguments;
903
- return !!b && typeof b == "object" && Object.keys(b).length > 0;
904
- }), $ = I(() => JSON.stringify(t.value.arguments ?? {}, null, 2));
905
- return (b, g) => (l(), c("section", {
887
+ }, t = I(() => a.report.values ?? c), o = I(() => t.value.status === "running" ? "●" : t.value.status === "success" ? "✓" : t.value.status === "error" ? "!" : "?"), d = I(() => t.value.status === "running" ? "执行中" : t.value.status === "success" ? "已完成" : t.value.status === "error" ? "执行失败" : "状态未知"), v = I(() => {
888
+ const g = t.value.arguments;
889
+ return !!g && typeof g == "object" && Object.keys(g).length > 0;
890
+ }), S = I(() => JSON.stringify(t.value.arguments ?? {}, null, 2));
891
+ return (g, k) => (i(), u("section", {
906
892
  class: D(["wi-host-action", `is-${t.value.status}`])
907
893
  }, [
908
- e("header", sn, [
909
- e("span", nn, v(o.value), 1),
910
- e("div", on, [
911
- an,
912
- e("code", rn, v(t.value.name || "未知操作"), 1)
894
+ e("header", Rs, [
895
+ e("span", As, f(o.value), 1),
896
+ e("div", Fs, [
897
+ k[0] || (k[0] = e("span", { class: "wi-host-action__label" }, "执行操作", -1)),
898
+ e("code", Ds, f(t.value.name || "未知操作"), 1)
913
899
  ]),
914
- e("span", ln, v(d.value), 1)
900
+ e("span", Bs, f(d.value), 1)
915
901
  ]),
916
- e("p", cn, v(t.value.message || d.value), 1),
917
- w.value ? (l(), c("details", un, [
918
- dn,
919
- e("pre", null, v($.value), 1)
902
+ e("p", zs, f(t.value.message || d.value), 1),
903
+ v.value ? (i(), u("details", qs, [
904
+ k[1] || (k[1] = e("summary", null, "查看参数", -1)),
905
+ e("pre", null, f(S.value), 1)
920
906
  ])) : V("", !0)
921
907
  ], 2));
922
908
  }
923
- }), pn = /* @__PURE__ */ N(_n, [["__scopeId", "data-v-bb5c9850"]]), fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
909
+ }), Ks = /* @__PURE__ */ N(Hs, [["__scopeId", "data-v-4acb4d02"]]), Xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
924
910
  __proto__: null,
925
- default: pn
911
+ default: Ks
926
912
  }, Symbol.toStringTag, { value: "Module" }));
927
913
  export {
928
- bn as AiAnswerBubble,
929
- en as ClarificationCard,
930
- gn as DeepThinkingSteps,
931
- pn as HostActionStatus,
932
- ps as IframePage,
933
- pt as KnowledgeStreamResult,
934
- ns as OutputFile,
935
- qe as createAnswerContentMap,
936
- ds as injectIframeResizerChild,
937
- Sn as provideIframePageConfig,
938
- kn as provideOutputFileConfig,
939
- cs as resolveIframePlaceholders,
940
- us as useIframePage
914
+ Qs as AiAnswerBubble,
915
+ js as ClarificationCard,
916
+ en as DeepThinkingSteps,
917
+ Ks as HostActionStatus,
918
+ Qt as IframePage,
919
+ ot as KnowledgeStreamResult,
920
+ zt as OutputFile,
921
+ Ae as createAnswerContentMap,
922
+ Jt as injectIframeResizerChild,
923
+ sn as provideIframePageConfig,
924
+ tn as provideOutputFileConfig,
925
+ Wt as resolveIframePlaceholders,
926
+ Yt as useIframePage
941
927
  };
942
928
  //# sourceMappingURL=index.js.map