@8wave/ai-elements 0.125.0-beta.27 → 0.125.0-beta.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{PkChatbotFilePreview-CFGqa-tX.js → PkChatbotFilePreview-CqxtVySb.js} +100 -59
- package/dist/_chunks/PkChatbotFilePreview-CqxtVySb.js.map +1 -0
- package/dist/_chunks/{PkFilePreview-BPsD2P7s.js → PkFilePreview-DiLMoL-6.js} +32 -32
- package/dist/_chunks/{PkFilePreview-BPsD2P7s.js.map → PkFilePreview-DiLMoL-6.js.map} +1 -1
- package/dist/_chunks/{PkFilePreviewDialog-BW-Rubk2.js → PkFilePreviewDialog-CHBtxpoB.js} +2 -2
- package/dist/_chunks/{PkFilePreviewDialog-BW-Rubk2.js.map → PkFilePreviewDialog-CHBtxpoB.js.map} +1 -1
- package/dist/_chunks/PkImageEditorDialog-Cq8y_PtC.js +555 -0
- package/dist/_chunks/PkImageEditorDialog-Cq8y_PtC.js.map +1 -0
- package/dist/_chunks/{PkSelectionActions-DkETXtSL.js → PkSelectionActions-DFyvcEyl.js} +2 -2
- package/dist/_chunks/{PkSelectionActions-DkETXtSL.js.map → PkSelectionActions-DFyvcEyl.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-CqLpNWQv.js → PkStreamingMarkdown-0hE_Cx4W.js} +2 -2
- package/dist/_chunks/{PkStreamingMarkdown-CqLpNWQv.js.map → PkStreamingMarkdown-0hE_Cx4W.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-iE4ZokYD.js → PkToolChatFile-DtQ9xY4w.js} +3 -3
- package/dist/_chunks/{PkToolChatFile-iE4ZokYD.js.map → PkToolChatFile-DtQ9xY4w.js.map} +1 -1
- package/dist/_chunks/{PkToolShareDocument-lTHNZodf.js → PkToolShareDocument-BvHklbzb.js} +2 -2
- package/dist/_chunks/{PkToolShareDocument-lTHNZodf.js.map → PkToolShareDocument-BvHklbzb.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-BNQrM5fY.js → PkToolShowArtifact-BdkKU6P1.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-BNQrM5fY.js.map → PkToolShowArtifact-BdkKU6P1.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-CvQoLumn.js → PkToolShowContactForm-BmM2MbOK.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-CvQoLumn.js.map → PkToolShowContactForm-BmM2MbOK.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-DcPccCEU.js → PkToolShowForm-CoFlgA-I.js} +3 -3
- package/dist/_chunks/{PkToolShowForm-DcPccCEU.js.map → PkToolShowForm-CoFlgA-I.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-B3VpJBVE.js → PkToolShowSources-DDBlLBt6.js} +2 -2
- package/dist/_chunks/{PkToolShowSources-B3VpJBVE.js.map → PkToolShowSources-DDBlLBt6.js.map} +1 -1
- package/dist/_chunks/{utils-BZuri2jT.js → utils-ChmRkK0t.js} +12 -5
- package/dist/_chunks/utils-ChmRkK0t.js.map +1 -0
- package/dist/ai-elements.es.js +3196 -3114
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotFilePreview.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepPayload.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-N5lgU3-k.js → PkChatbot-BjJzskl7.js} +8 -8
- package/dist-vue/_chunks/{PkChatbot-N5lgU3-k.js.map → PkChatbot-BjJzskl7.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-COya3H3C.js → PkChatbotEmptyState-CZC2gP3I.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-COya3H3C.js.map → PkChatbotEmptyState-CZC2gP3I.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotFilePreview-BsvT6orx.js → PkChatbotFilePreview-j_8sDZUE.js} +112 -71
- package/dist-vue/_chunks/PkChatbotFilePreview-j_8sDZUE.js.map +1 -0
- package/dist-vue/_chunks/PkChatbotInput-BmTdIJZ9.js +509 -0
- package/dist-vue/_chunks/PkChatbotInput-BmTdIJZ9.js.map +1 -0
- package/dist-vue/_chunks/PkChatbotMessages-b2lupEv9.js +1049 -0
- package/dist-vue/_chunks/{PkChatbotMessages-BISaZu4z.js.map → PkChatbotMessages-b2lupEv9.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepPayload-cuYclK_2.js → PkChatbotStepPayload-D4w1XlF2.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-cuYclK_2.js.map → PkChatbotStepPayload-D4w1XlF2.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-Yd8cUQJP.js → PkChatbotStepToolDetail-DFTcjzoX.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-Yd8cUQJP.js.map → PkChatbotStepToolDetail-DFTcjzoX.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-_Aqft0em.js → PkChatbotSteps-D3zLulMo.js} +5 -5
- package/dist-vue/_chunks/{PkChatbotSteps-_Aqft0em.js.map → PkChatbotSteps-D3zLulMo.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-B3Nr7-kY.js → PkChatbotViewChat-DawyiUjq.js} +322 -344
- package/dist-vue/_chunks/PkChatbotViewChat-DawyiUjq.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-DjhiHp8-.js → PkChatbotViewConversations-Bs246dtL.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewConversations-DjhiHp8-.js.map → PkChatbotViewConversations-Bs246dtL.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-C4oGN4Xj.js → PkChatbotViewFiles-uzZ5H4Fd.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewFiles-C4oGN4Xj.js.map → PkChatbotViewFiles-uzZ5H4Fd.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-NfTamy9j.js → PkChatbotViewProfile-BhIvfT_n.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-NfTamy9j.js.map → PkChatbotViewProfile-BhIvfT_n.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreview-D-BGFp9C.js → PkFilePreview-DfD48QQ_.js} +48 -48
- package/dist-vue/_chunks/{PkFilePreview-D-BGFp9C.js.map → PkFilePreview-DfD48QQ_.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreviewDialog-By2TQolA.js → PkFilePreviewDialog-DFCBpQf3.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-By2TQolA.js.map → PkFilePreviewDialog-DFCBpQf3.js.map} +1 -1
- package/dist-vue/_chunks/PkImageEditorDialog-BLUyILVi.js +550 -0
- package/dist-vue/_chunks/PkImageEditorDialog-BLUyILVi.js.map +1 -0
- package/dist-vue/_chunks/{PkStreamingMarkdown-2FN4WMQD.js → PkStreamingMarkdown-ChMbSviw.js} +2 -2
- package/dist-vue/_chunks/{PkStreamingMarkdown-2FN4WMQD.js.map → PkStreamingMarkdown-ChMbSviw.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-DAT1tv52.js → PkToolChatFile-DQtABEaI.js} +3 -3
- package/dist-vue/_chunks/{PkToolChatFile-DAT1tv52.js.map → PkToolChatFile-DQtABEaI.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShareDocument-Qb2Lu5vh.js → PkToolShareDocument-cMUqik6v.js} +2 -2
- package/dist-vue/_chunks/{PkToolShareDocument-Qb2Lu5vh.js.map → PkToolShareDocument-cMUqik6v.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-Bskomw05.js → PkToolShowArtifact-w6SxjLPW.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-Bskomw05.js.map → PkToolShowArtifact-w6SxjLPW.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-iQrlqv7j.js → PkToolShowContactForm-BQ7bBTQU.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-iQrlqv7j.js.map → PkToolShowContactForm-BQ7bBTQU.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-C-43uUoh.js → PkToolShowDiagram-D-yQgdOL.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-C-43uUoh.js.map → PkToolShowDiagram-D-yQgdOL.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-CKXpqQxy.js → PkToolShowForm-CF00JLpa.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowForm-CKXpqQxy.js.map → PkToolShowForm-CF00JLpa.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-DLTn6JmU.js → PkToolShowImageGallery-ZJMWOWHq.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-DLTn6JmU.js.map → PkToolShowImageGallery-ZJMWOWHq.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-hhSBAQVC.js → PkToolShowProductList-CeKI9H36.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-hhSBAQVC.js.map → PkToolShowProductList-CeKI9H36.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-BMo_i8sv.js → PkToolShowSources-CXZqanmw.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSources-BMo_i8sv.js.map → PkToolShowSources-CXZqanmw.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-DJhsbDuX.js → PkToolShowVideo-BCs-i6xQ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-DJhsbDuX.js.map → PkToolShowVideo-BCs-i6xQ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-BAv66f5H.js → PkToolShowWebPages-Bixa0CjQ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-BAv66f5H.js.map → PkToolShowWebPages-Bixa0CjQ.js.map} +1 -1
- package/dist-vue/_chunks/{useChatbotStore-BZ1n3Hyx.js → useChatbotStore-BIjCGX0B.js} +858 -835
- package/dist-vue/_chunks/useChatbotStore-BIjCGX0B.js.map +1 -0
- package/dist-vue/_chunks/{utils-RwaXl9-x.js → utils-CaYEz-0A.js} +11 -4
- package/dist-vue/_chunks/utils-CaYEz-0A.js.map +1 -0
- package/dist-vue/composables.js +56 -4
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +49 -49
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +56 -0
- package/dist-vue/packages/components/src/chat/PkChatbotFilePreview.d.ts +14 -0
- package/dist-vue/packages/components/src/chat/PkChatbotInput.d.ts +17 -3
- package/dist-vue/packages/components/src/chat/PkImageEditor.d.ts +37 -0
- package/dist-vue/packages/components/src/chat/PkImageEditorDialog.d.ts +19 -0
- package/dist-vue/packages/components/src/chat/imageEdits.d.ts +106 -0
- package/dist-vue/packages/components/src/chat/utils.d.ts +7 -0
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +7 -1
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/PkChatbotFilePreview-CFGqa-tX.js.map +0 -1
- package/dist/_chunks/utils-BZuri2jT.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotFilePreview-BsvT6orx.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotInput-D0KUEkAs.js +0 -478
- package/dist-vue/_chunks/PkChatbotInput-D0KUEkAs.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-BISaZu4z.js +0 -1049
- package/dist-vue/_chunks/PkChatbotViewChat-B3Nr7-kY.js.map +0 -1
- package/dist-vue/_chunks/useChatbotStore-BZ1n3Hyx.js.map +0 -1
- package/dist-vue/_chunks/utils-RwaXl9-x.js.map +0 -1
|
@@ -0,0 +1,1049 @@
|
|
|
1
|
+
import { A as e, E as t, S as n, n as r, v as i } from "./schemas-BO5QlXAp.js";
|
|
2
|
+
import { c as a } from "./Media-DylqhvaF.js";
|
|
3
|
+
import { A as o, H as s, _ as c, k as l, r as u } from "./Agent-Cm1LrkYm.js";
|
|
4
|
+
import { t as d } from "./VvButtonLocalized-C-vx25u4.js";
|
|
5
|
+
import { t as f } from "./useLightbox-FDyQrPWe.js";
|
|
6
|
+
import { t as p } from "./PkStreamingMarkdown-ChMbSviw.js";
|
|
7
|
+
import "./src-nb8MU1sh.js";
|
|
8
|
+
import { c as m, i as h, l as g, n as _, o as ee, s as v, t as te, u as y } from "./message-DuibQyHy.js";
|
|
9
|
+
import { t as ne } from "./PkChatbotAudioTranscript-DgmuXalb.js";
|
|
10
|
+
import { D as re, F as ie, L as ae, M as b, P as oe, S as x, V as se, b as ce, d as le, g as S, h as ue, i as de, j as fe, k as pe, n as me, r as he, t as ge, u as _e, v as ve, x as ye, y as be } from "./utils-CaYEz-0A.js";
|
|
11
|
+
import { t as xe } from "./PkChatbotError-BS84xuiu.js";
|
|
12
|
+
import { t as Se } from "./PkRelativeTime-CZF5CYHv.js";
|
|
13
|
+
import { t as Ce } from "./PkChatbotFeedbackForm-Bh3tvNUW.js";
|
|
14
|
+
import { t as we } from "./PkChatbotMessageFeedback-DltXugdR.js";
|
|
15
|
+
import { t as Te } from "./PkChatbotFilePreview-j_8sDZUE.js";
|
|
16
|
+
import { n as Ee, r as De, t as Oe } from "./PkChatbotSteps-D3zLulMo.js";
|
|
17
|
+
import { t as ke } from "./PkChatbotOutlineRail-BI-DMvZi.js";
|
|
18
|
+
import { VvAccordion as Ae, VvButtonGroup as je, VvIcon as Me } from "@volverjs/ui-vue/components";
|
|
19
|
+
import { Fragment as C, Transition as w, computed as T, createBlock as E, createCommentVNode as D, createElementBlock as O, createElementVNode as k, createTextVNode as Ne, createVNode as A, defineAsyncComponent as j, defineComponent as M, inject as Pe, mergeProps as Fe, nextTick as N, normalizeClass as P, normalizeStyle as Ie, onBeforeUnmount as F, onMounted as Le, openBlock as I, ref as L, renderList as Re, renderSlot as ze, resolveDynamicComponent as Be, shallowRef as Ve, toDisplayString as R, unref as z, useSlots as He, useTemplateRef as Ue, watch as B, withCtx as V, withModifiers as H } from "vue";
|
|
20
|
+
import { useI18n as We } from "vue-i18n";
|
|
21
|
+
import { useResizeObserver as Ge } from "@vueuse/core";
|
|
22
|
+
// ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/iso.js
|
|
23
|
+
function Ke(t) {
|
|
24
|
+
return e(r, t);
|
|
25
|
+
}
|
|
26
|
+
i({
|
|
27
|
+
platform: n(),
|
|
28
|
+
threadId: n()
|
|
29
|
+
});
|
|
30
|
+
var qe = i({
|
|
31
|
+
wakeId: t(),
|
|
32
|
+
dueAt: Ke(),
|
|
33
|
+
reason: n()
|
|
34
|
+
});
|
|
35
|
+
i({ pendingWakeup: qe.nullable() }), i({ wakeId: t() });
|
|
36
|
+
var U = (e) => e?.role === "user" && !!e.metadata?.wakeup, Je = /* @__PURE__ */ new Set([
|
|
37
|
+
"input-streaming",
|
|
38
|
+
"input-available",
|
|
39
|
+
"approval-requested"
|
|
40
|
+
]), Ye = /* @__PURE__ */ new Set([
|
|
41
|
+
...o,
|
|
42
|
+
...l,
|
|
43
|
+
...c
|
|
44
|
+
]);
|
|
45
|
+
[...l, u.ShowContactForm];
|
|
46
|
+
var Xe = (e) => e.state, Ze = (e) => e.type.startsWith("tool-") ? e.type.slice(5) : void 0, W = (e) => e?.role === "assistant" && e.parts.some((e) => {
|
|
47
|
+
if (e.type === "text") return e.text.trim().length > 0;
|
|
48
|
+
if (e.type === "file") return !0;
|
|
49
|
+
let t = Xe(e);
|
|
50
|
+
if (t && Je.has(t)) return !0;
|
|
51
|
+
let n = Ze(e);
|
|
52
|
+
return n !== void 0 && Ye.has(n) && t === "output-available";
|
|
53
|
+
}), Qe = (e) => {
|
|
54
|
+
if (e?.role !== "assistant" || W(e)) return !1;
|
|
55
|
+
let t = !1;
|
|
56
|
+
for (let n of e.parts) n.type === "tool-scheduleWakeup" && (t = Xe(n) === "output-available" && n.input?.noop === !0);
|
|
57
|
+
return t;
|
|
58
|
+
}, $e = {
|
|
59
|
+
requestOAuthConnection: j(() => import("./PkToolRequestOAuthConnection-CtXSzKzM.js")),
|
|
60
|
+
shareDocument: j(() => import("./PkToolShareDocument-cMUqik6v.js").then((e) => e.n)),
|
|
61
|
+
showArtifact: j(() => import("./PkToolShowArtifact-w6SxjLPW.js").then((e) => e.n)),
|
|
62
|
+
showCalendarEvent: j(() => import("./PkToolShowCalendarEvent-CAejFLQI.js").then((e) => e.n)),
|
|
63
|
+
showComparison: j(() => import("./PkToolShowComparison-BEHyRNXE.js").then((e) => e.n)),
|
|
64
|
+
showContactForm: j(() => import("./PkToolShowContactForm-BQ7bBTQU.js").then((e) => e.n)),
|
|
65
|
+
showDiagram: j(() => import("./PkToolShowDiagram-D-yQgdOL.js")),
|
|
66
|
+
showEmail: j(() => import("./PkToolShowEmail-BehvoNsz.js").then((e) => e.n)),
|
|
67
|
+
showImageGallery: j(() => import("./PkToolShowImageGallery-ZJMWOWHq.js").then((e) => e.n)),
|
|
68
|
+
showLocation: j(() => import("./PkToolShowLocation-B8FE_Sqd.js").then((e) => e.n)),
|
|
69
|
+
showMessage: j(() => import("./PkToolShowMessage-Cca7K7GQ.js").then((e) => e.n)),
|
|
70
|
+
showForm: j(() => import("./PkToolShowForm-CF00JLpa.js").then((e) => e.n)),
|
|
71
|
+
showMultipleChoice: j(() => import("./PkToolShowForm-CF00JLpa.js").then((e) => e.n)),
|
|
72
|
+
showProductList: j(() => import("./PkToolShowProductList-CeKI9H36.js").then((e) => e.n)),
|
|
73
|
+
showQrCode: j(() => import("./PkToolShowQrCode-96KzD1rX.js").then((e) => e.n)),
|
|
74
|
+
showSources: j(() => import("./PkToolShowSources-CXZqanmw.js").then((e) => e.n)),
|
|
75
|
+
showSuggestedReply: j(() => import("./PkToolShowSuggestedReply-BRIzGNwx.js").then((e) => e.n)),
|
|
76
|
+
showVideo: j(() => import("./PkToolShowVideo-BCs-i6xQ.js")),
|
|
77
|
+
showWeather: j(() => import("./PkToolShowWeather-1NJwawC7.js")),
|
|
78
|
+
showWebPages: j(() => import("./PkToolShowWebPages-Bixa0CjQ.js").then((e) => e.n))
|
|
79
|
+
}, et = {
|
|
80
|
+
key: 0,
|
|
81
|
+
class: "text-12 text-word-3 m-0 mb-xs"
|
|
82
|
+
}, tt = /* @__PURE__ */ M({
|
|
83
|
+
__name: "PkToolApprovalPreviewMessage",
|
|
84
|
+
props: { input: {} },
|
|
85
|
+
setup(e) {
|
|
86
|
+
let t = e, n = T(() => {
|
|
87
|
+
let e = t.input;
|
|
88
|
+
return typeof e?.message == "string" ? e.message : "";
|
|
89
|
+
});
|
|
90
|
+
return (e, t) => n.value ? (I(), O("p", et, R(n.value), 1)) : D("", !0);
|
|
91
|
+
}
|
|
92
|
+
}), nt = { [ge]: tt }, rt = {
|
|
93
|
+
key: 0,
|
|
94
|
+
class: "text-12 text-word-3 m-0 mb-xs"
|
|
95
|
+
}, it = /* @__PURE__ */ M({
|
|
96
|
+
__name: "PkToolApprovalCard",
|
|
97
|
+
props: {
|
|
98
|
+
part: {},
|
|
99
|
+
actionable: { type: Boolean },
|
|
100
|
+
callVerdict: { type: Boolean }
|
|
101
|
+
},
|
|
102
|
+
emits: ["respond"],
|
|
103
|
+
setup(e, { emit: t }) {
|
|
104
|
+
let n = e, r = t, { t: i, te: a } = We({ useScope: "global" }), o = T(() => n.part), c = T(() => h(n.part)), l = T(() => c.value === ge), u = T(() => l.value ? (o.value.state === "input-available" || s(o.value.output)) && n.callVerdict === void 0 : o.value.state === "approval-requested"), f = T(() => u.value && n.actionable === !0), p = T(() => u.value && n.actionable !== !0), m = T(() => l.value ? o.value.output === "confirmed" || n.callVerdict === !0 : o.value.approval?.approved === !0), g = T(() => l.value ? o.value.output === "cancelled" || n.callVerdict === !1 : o.value.approval?.approved === !1 || o.value.state === "output-denied"), _ = T(() => nt[c.value]), ee = T(() => _.value ? i("toolApproval.prompt") : i("toolApproval.promptNamed", { tool: se(c.value, {
|
|
105
|
+
t: i,
|
|
106
|
+
te: a
|
|
107
|
+
}) })), v = T(() => {
|
|
108
|
+
if (p.value) return {
|
|
109
|
+
icon: "ri:time-line",
|
|
110
|
+
message: i("toolApproval.expired")
|
|
111
|
+
};
|
|
112
|
+
if (m.value) return {
|
|
113
|
+
icon: "ri:check-line",
|
|
114
|
+
message: i(l.value ? "toolApproval.confirmed" : "toolApproval.approved")
|
|
115
|
+
};
|
|
116
|
+
if (g.value) return {
|
|
117
|
+
icon: "ri:close-line",
|
|
118
|
+
message: i(l.value ? "toolApproval.cancelled" : "toolApproval.denied")
|
|
119
|
+
};
|
|
120
|
+
}), te = T(() => !!v.value && !_.value);
|
|
121
|
+
return (t, n) => {
|
|
122
|
+
let a = d, s = je, c = Me;
|
|
123
|
+
return I(), O("div", { class: P(["w-full overflow-hidden transition-all duration-300", { "bg-surface p-sm rounded-xl border border-surface-3": !te.value }]) }, [
|
|
124
|
+
A(w, null, {
|
|
125
|
+
default: V(() => [!l.value && u.value ? (I(), O("p", rt, R(ee.value), 1)) : D("", !0)]),
|
|
126
|
+
_: 1
|
|
127
|
+
}),
|
|
128
|
+
_.value ? (I(), E(Be(_.value), {
|
|
129
|
+
key: 0,
|
|
130
|
+
part: e.part,
|
|
131
|
+
input: o.value.input
|
|
132
|
+
}, null, 8, ["part", "input"])) : D("", !0),
|
|
133
|
+
A(w, { mode: "out-in" }, {
|
|
134
|
+
default: V(() => [v.value ? (I(), O("p", {
|
|
135
|
+
key: 1,
|
|
136
|
+
class: P(["flex items-center gap-4 text-12 text-word-3 m-0", { "mt-xs": _.value }])
|
|
137
|
+
}, [A(c, {
|
|
138
|
+
name: v.value.icon,
|
|
139
|
+
class: "shrink-0"
|
|
140
|
+
}, null, 8, ["name"]), Ne(" " + R(v.value.message), 1)], 2)) : (I(), E(s, { key: 0 }, {
|
|
141
|
+
default: V(() => [A(a, {
|
|
142
|
+
modifiers: "primary-small",
|
|
143
|
+
disabled: !f.value,
|
|
144
|
+
icon: "ri:check-line",
|
|
145
|
+
label: z(i)("action.proceed"),
|
|
146
|
+
onClick: n[0] ||= H((e) => r("respond", !0), ["stop"])
|
|
147
|
+
}, null, 8, ["disabled", "label"]), A(a, {
|
|
148
|
+
modifiers: "action-quiet-small",
|
|
149
|
+
disabled: !f.value,
|
|
150
|
+
icon: "ri:close-line",
|
|
151
|
+
label: z(i)("action.cancel"),
|
|
152
|
+
onClick: n[1] ||= H((e) => r("respond", !1), ["stop"])
|
|
153
|
+
}, null, 8, ["disabled", "label"])]),
|
|
154
|
+
_: 1
|
|
155
|
+
}))]),
|
|
156
|
+
_: 1
|
|
157
|
+
})
|
|
158
|
+
], 2);
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}), G = { class: "pk-host-call-confirm-card w-full bg-surface p-sm rounded-xl border border-surface-3" }, K = { class: "text-14 text-word-2 m-0 mb-xs" }, at = {
|
|
162
|
+
key: 1,
|
|
163
|
+
class: "pk-host-call-confirm-card__details text-14 m-0 mb-xs"
|
|
164
|
+
}, q = {
|
|
165
|
+
key: 0,
|
|
166
|
+
class: "text-word-3 truncate"
|
|
167
|
+
}, ot = {
|
|
168
|
+
key: 2,
|
|
169
|
+
class: "text-12 text-word-3 m-0 mb-xs"
|
|
170
|
+
}, st = { class: "pk-host-call-confirm-card__details text-12 m-0" }, ct = { class: "text-word-3" }, J = { class: "text-word-2 m-0" }, lt = /* @__PURE__ */ M({
|
|
171
|
+
__name: "PkHostCallConfirmCard",
|
|
172
|
+
props: {
|
|
173
|
+
question: {},
|
|
174
|
+
details: {},
|
|
175
|
+
unchanged: {}
|
|
176
|
+
},
|
|
177
|
+
emits: ["respond"],
|
|
178
|
+
setup(e, { emit: t }) {
|
|
179
|
+
let n = e, r = t, i = T(() => n.details?.some((e) => e.before !== void 0) ?? !1);
|
|
180
|
+
return (t, n) => {
|
|
181
|
+
let a = Ae, o = d, s = je;
|
|
182
|
+
return I(), O("div", G, [
|
|
183
|
+
k("p", K, R(e.question), 1),
|
|
184
|
+
e.details?.length && i.value ? (I(), E(De, {
|
|
185
|
+
key: 0,
|
|
186
|
+
changes: e.details,
|
|
187
|
+
class: "mb-xs"
|
|
188
|
+
}, null, 8, ["changes"])) : e.details?.length ? (I(), O("dl", at, [(I(!0), O(C, null, Re(e.details, (e, t) => (I(), O(C, { key: t }, [e.label ? (I(), O("dt", q, R(e.label), 1)) : D("", !0), k("dd", { class: P(["text-word-1 m-0 truncate", { "pk-host-call-confirm-card__alone": !e.label }]) }, R(e.value), 3)], 64))), 128))])) : e.unchanged?.length ? (I(), O("p", ot, R(t.$t("toolApproval.noChanges")), 1)) : D("", !0),
|
|
189
|
+
e.unchanged?.length ? (I(), E(a, {
|
|
190
|
+
key: 3,
|
|
191
|
+
title: t.$t("toolApproval.unchangedFields", e.unchanged.length),
|
|
192
|
+
modifiers: "compact",
|
|
193
|
+
class: "mb-xs"
|
|
194
|
+
}, {
|
|
195
|
+
default: V(() => [k("dl", st, [(I(!0), O(C, null, Re(e.unchanged, (e, t) => (I(), O(C, { key: t }, [k("dt", ct, R(e.label), 1), k("dd", J, R(e.value), 1)], 64))), 128))])]),
|
|
196
|
+
_: 1
|
|
197
|
+
}, 8, ["title"])) : D("", !0),
|
|
198
|
+
A(s, null, {
|
|
199
|
+
default: V(() => [A(o, {
|
|
200
|
+
modifiers: "primary-small",
|
|
201
|
+
icon: "ri:check-line",
|
|
202
|
+
label: t.$t("action.proceed"),
|
|
203
|
+
onClick: n[0] ||= H((e) => r("respond", !0), ["stop"])
|
|
204
|
+
}, null, 8, ["label"]), A(o, {
|
|
205
|
+
modifiers: "action-quiet-small",
|
|
206
|
+
icon: "ri:close-line",
|
|
207
|
+
label: t.$t("action.cancel"),
|
|
208
|
+
onClick: n[1] ||= H((e) => r("respond", !1), ["stop"])
|
|
209
|
+
}, null, 8, ["label"])]),
|
|
210
|
+
_: 1
|
|
211
|
+
})
|
|
212
|
+
]);
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
}), ut = 30, Y = 500;
|
|
216
|
+
function dt(e) {
|
|
217
|
+
let { scrollEl: t, status: n, messagesLength: r, lastMessageRole: i, contentEl: a, beforeNewMessageScroll: o, onScrollUp: s, onScrollDown: c } = e, l = L(!1), u = L(!0), d = !1, f = null, p = null, m = null, h = null, g = 0, _ = (e = "smooth") => {
|
|
218
|
+
!t.value || l.value ? d = !1 : (d = !0, t.value.scrollTo({
|
|
219
|
+
top: t.value.scrollHeight,
|
|
220
|
+
behavior: e
|
|
221
|
+
}), setTimeout(() => {
|
|
222
|
+
d = !1;
|
|
223
|
+
}, e === "instant" ? 0 : Y));
|
|
224
|
+
}, ee = (e) => {
|
|
225
|
+
e.deltaY < 0 && (l.value = !0);
|
|
226
|
+
}, v = 0, te = (e) => {
|
|
227
|
+
v = e.touches[0]?.clientY ?? 0;
|
|
228
|
+
}, y = (e) => {
|
|
229
|
+
let t = e.touches[0]?.clientY ?? 0;
|
|
230
|
+
t > v && (l.value = !0), v = t;
|
|
231
|
+
}, ne = () => {
|
|
232
|
+
if (!t.value) return;
|
|
233
|
+
let { scrollTop: e, scrollHeight: n, clientHeight: r } = t.value;
|
|
234
|
+
u.value = n - r - e < ut, d || (e < g && s?.(), e > g && (u.value && (l.value = !1), c?.())), g = e;
|
|
235
|
+
}, re = () => {
|
|
236
|
+
if (d || l.value || !t.value) return;
|
|
237
|
+
let e = t.value, n = e.scrollHeight - e.clientHeight;
|
|
238
|
+
n <= e.scrollTop || (u.value = !0, d = !0, e.scrollTop = n, requestAnimationFrame(() => {
|
|
239
|
+
d = !1;
|
|
240
|
+
}));
|
|
241
|
+
}, ie = () => {
|
|
242
|
+
!f && t.value && (f = new MutationObserver(re), f.observe(t.value, {
|
|
243
|
+
childList: !0,
|
|
244
|
+
subtree: !0,
|
|
245
|
+
characterData: !0
|
|
246
|
+
}));
|
|
247
|
+
}, ae = () => {
|
|
248
|
+
f?.disconnect(), f = null;
|
|
249
|
+
};
|
|
250
|
+
B(n, (e, t) => {
|
|
251
|
+
e === "streaming" || e === "submitted" ? ie() : (e !== "ready" || t !== "streaming") && ae();
|
|
252
|
+
}), B(r, async () => {
|
|
253
|
+
if (r() && i() !== "assistant") {
|
|
254
|
+
x(), l.value = !1, d = !0;
|
|
255
|
+
try {
|
|
256
|
+
await N(), await o?.(), await N();
|
|
257
|
+
} finally {
|
|
258
|
+
_();
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
let b = null, oe = () => {
|
|
263
|
+
t.value && (t.value.scrollHeight <= t.value.clientHeight || (t.value.scrollTop = t.value.scrollHeight, b && clearTimeout(b), b = setTimeout(x, 300)));
|
|
264
|
+
}, x = () => {
|
|
265
|
+
p?.disconnect(), p = null, m?.disconnect(), m = null, b &&= (clearTimeout(b), null);
|
|
266
|
+
};
|
|
267
|
+
return Le(() => {
|
|
268
|
+
if (!t.value) return;
|
|
269
|
+
t.value.addEventListener("wheel", ee, { passive: !0 }), t.value.addEventListener("touchstart", te, { passive: !0 }), t.value.addEventListener("touchmove", y, { passive: !0 });
|
|
270
|
+
let e = n() === "submitted" || n() === "streaming";
|
|
271
|
+
e ? ie() : (p = new ResizeObserver(oe), p.observe(t.value), m = new MutationObserver(oe), m.observe(t.value, {
|
|
272
|
+
childList: !0,
|
|
273
|
+
subtree: !0
|
|
274
|
+
}));
|
|
275
|
+
let r = a?.() ?? t.value.firstElementChild;
|
|
276
|
+
r && (h = new ResizeObserver(re), h.observe(r)), e || oe();
|
|
277
|
+
}), F(() => {
|
|
278
|
+
t.value?.removeEventListener("wheel", ee), t.value?.removeEventListener("touchstart", te), t.value?.removeEventListener("touchmove", y), h?.disconnect(), h = null, ae(), x();
|
|
279
|
+
}), {
|
|
280
|
+
handleScroll: ne,
|
|
281
|
+
scrollToBottom: _,
|
|
282
|
+
userScrolledUp: l,
|
|
283
|
+
isAtBottom: u
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
// ../../packages/components/src/chat/wakeupFeed.ts
|
|
287
|
+
function ft(e, t = () => !1) {
|
|
288
|
+
let n = (e) => Qe(e) && !t(e), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map(), a = 0;
|
|
289
|
+
for (; a < e.length;) {
|
|
290
|
+
let t = e[a];
|
|
291
|
+
if (U(t) && n(e[a + 1])) {
|
|
292
|
+
let o = t.id, s = 0, c;
|
|
293
|
+
for (; U(e[a]) && n(e[a + 1]);) s += 1, c = e[a].metadata?.createdAt ?? c, r.add(e[a].id), r.add(e[a + 1].id), a += 2;
|
|
294
|
+
i.set(o, {
|
|
295
|
+
count: s,
|
|
296
|
+
lastAt: c
|
|
297
|
+
});
|
|
298
|
+
} else n(t) && r.add(t.id), a += 1;
|
|
299
|
+
}
|
|
300
|
+
return {
|
|
301
|
+
hidden: r,
|
|
302
|
+
quietRuns: i
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
// ../../packages/components/src/chat/PkChatbotMessages.vue?vue&type=script&setup=true&lang.ts
|
|
306
|
+
var pt = ["aria-busy"], mt = {
|
|
307
|
+
key: 0,
|
|
308
|
+
class: "pk-chatbot-messages__outline"
|
|
309
|
+
}, ht = {
|
|
310
|
+
key: 0,
|
|
311
|
+
class: "pk-chatbot-divider vv-separator"
|
|
312
|
+
}, gt = { class: "pk-chatbot-divider__label" }, _t = {
|
|
313
|
+
key: 1,
|
|
314
|
+
class: "pk-chatbot-wakeup"
|
|
315
|
+
}, vt = ["title"], yt = { class: "pk-chatbot-message__text" }, bt = ["title"], xt = {
|
|
316
|
+
key: 0,
|
|
317
|
+
class: "pk-chatbot-message__reaction-emoji"
|
|
318
|
+
}, St = {
|
|
319
|
+
key: 0,
|
|
320
|
+
class: "flex flex-col items-end gap-8 w-full"
|
|
321
|
+
}, Ct = { class: "pk-chatbot-message__host-step" }, wt = { class: "pk-chatbot-message__host-call" }, Tt = { class: "pk-chatbot-message__host-call-label" }, Et = {
|
|
322
|
+
key: 0,
|
|
323
|
+
class: "pk-chatbot-message__host-call-outcome"
|
|
324
|
+
}, Dt = {
|
|
325
|
+
key: 0,
|
|
326
|
+
class: "pk-chatbot-message__loading-info"
|
|
327
|
+
}, Ot = { class: "flex gap-8 items-center" }, kt = { class: "text-12" }, At = ["title"], jt = { class: "pk-chatbot-message__pointer-label" }, Mt = ["title"], Nt = { class: "pk-chatbot-message__pointer-label" }, Pt = { class: "flex gap-8 items-center" }, Ft = {
|
|
328
|
+
key: 0,
|
|
329
|
+
class: "pk-chatbot-message__footer"
|
|
330
|
+
}, It = {
|
|
331
|
+
key: 0,
|
|
332
|
+
class: "pk-chatbot-message__hover-meta"
|
|
333
|
+
}, Lt = ["datetime", "title"], Rt = { class: "truncate" }, zt = {
|
|
334
|
+
key: 0,
|
|
335
|
+
class: "flex items-center gap-4 min-w-0"
|
|
336
|
+
}, Bt = { class: "truncate" }, Vt = ["title"], Ht = {
|
|
337
|
+
key: 2,
|
|
338
|
+
class: "flex items-center gap-4 text-12 text-word-3"
|
|
339
|
+
}, Ut = { class: "truncate" }, Wt = ["datetime"], Gt = { class: "truncate" }, Kt = {
|
|
340
|
+
key: 4,
|
|
341
|
+
class: "flex items-center gap-4 text-12 text-word-3"
|
|
342
|
+
}, qt = { class: "pk-chatbot-message__loading-info" }, Jt = { class: "flex gap-8 items-center" }, Yt = { class: "text-12" }, Xt = {
|
|
343
|
+
key: 0,
|
|
344
|
+
class: "pk-chatbot-message pk-chatbot-message--assistant"
|
|
345
|
+
}, Zt = ["title", "aria-label"], Qt = /* @__PURE__ */ M({
|
|
346
|
+
__name: "PkChatbotMessages",
|
|
347
|
+
props: {
|
|
348
|
+
status: {},
|
|
349
|
+
messages: {},
|
|
350
|
+
error: {},
|
|
351
|
+
actions: {},
|
|
352
|
+
mainColor: {},
|
|
353
|
+
textColor: {},
|
|
354
|
+
revisedAnswers: {},
|
|
355
|
+
messageFeedbacks: {},
|
|
356
|
+
readonlyFeedback: { type: Boolean },
|
|
357
|
+
disableHeightAdjustment: { type: Boolean },
|
|
358
|
+
showMessageDateTime: { type: Boolean },
|
|
359
|
+
showMessageTokensCount: { type: Boolean },
|
|
360
|
+
showMessageNumber: { type: Boolean },
|
|
361
|
+
showAllMessageParts: { type: Boolean },
|
|
362
|
+
interactive: { type: Boolean },
|
|
363
|
+
showExtendedSteps: { type: Boolean },
|
|
364
|
+
hideReasoning: { type: Boolean },
|
|
365
|
+
awaitingSpokenAnswer: { type: Boolean },
|
|
366
|
+
hostWorking: { type: Boolean },
|
|
367
|
+
hostConfirmation: {},
|
|
368
|
+
confirmVerdictsOnCall: {},
|
|
369
|
+
isDark: { type: Boolean },
|
|
370
|
+
showScrollToBottom: { type: Boolean },
|
|
371
|
+
parentScrolls: { type: Boolean },
|
|
372
|
+
feedbackMessageId: {},
|
|
373
|
+
feedbackLoading: { type: Boolean },
|
|
374
|
+
feedbackSubmitted: { type: Boolean },
|
|
375
|
+
feedbackError: {}
|
|
376
|
+
},
|
|
377
|
+
emits: [
|
|
378
|
+
"show-info",
|
|
379
|
+
"regenerate",
|
|
380
|
+
"revise",
|
|
381
|
+
"upvote",
|
|
382
|
+
"downvote",
|
|
383
|
+
"feedback",
|
|
384
|
+
"feedback-submit",
|
|
385
|
+
"feedback-close",
|
|
386
|
+
"scroll-up",
|
|
387
|
+
"scroll-down",
|
|
388
|
+
"auto-retry",
|
|
389
|
+
"reset-chat",
|
|
390
|
+
"approval-respond",
|
|
391
|
+
"confirm-respond",
|
|
392
|
+
"host-confirm-respond"
|
|
393
|
+
],
|
|
394
|
+
setup(e, { emit: t }) {
|
|
395
|
+
let n = e, r = t, { t: i, te: o, d: s, n: c } = We({ useScope: "global" }), l = Pe(he, void 0), u = Pe(me, void 0), se = (e) => {
|
|
396
|
+
let t = e.toolCallId;
|
|
397
|
+
return typeof t == "string" ? u?.value[t]?.details : void 0;
|
|
398
|
+
}, ge = He(), j = (e, t) => {
|
|
399
|
+
if (b(e)) {
|
|
400
|
+
let n = e.toolCallId;
|
|
401
|
+
n && r("confirm-respond", {
|
|
402
|
+
toolCallId: n,
|
|
403
|
+
confirmed: t
|
|
404
|
+
});
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
let n = ye(e);
|
|
408
|
+
n && r("approval-respond", {
|
|
409
|
+
id: n,
|
|
410
|
+
approved: t
|
|
411
|
+
});
|
|
412
|
+
}, M = Ue("scrollEl"), F = Ue("wrapperEl"), Ke = T(() => ae(n.textColor, n.mainColor));
|
|
413
|
+
f(F);
|
|
414
|
+
let { handleScroll: qe, scrollToBottom: Je, userScrolledUp: Ye, isAtBottom: Xe } = dt({
|
|
415
|
+
scrollEl: M,
|
|
416
|
+
status: () => n.status,
|
|
417
|
+
messagesLength: () => n.messages?.length,
|
|
418
|
+
lastMessageRole: () => n.messages?.[n.messages.length - 1]?.role,
|
|
419
|
+
contentEl: () => F.value,
|
|
420
|
+
beforeNewMessageScroll: () => J(),
|
|
421
|
+
onScrollUp: () => r("scroll-up"),
|
|
422
|
+
onScrollDown: () => r("scroll-down")
|
|
423
|
+
}), Ze = () => {
|
|
424
|
+
Ye.value = !1, Je();
|
|
425
|
+
}, W = T(() => (n.messages ?? []).filter((e) => e.role === "user" && !U(e)).map((e) => ({
|
|
426
|
+
id: e.id,
|
|
427
|
+
preview: e.parts.find(g)?.text.trim().slice(0, 120) || "…"
|
|
428
|
+
}))), Qe = L(), et = () => M.value?.querySelectorAll(".pk-chatbot-message--user") ?? [], tt = () => {
|
|
429
|
+
let e = M.value;
|
|
430
|
+
if (!e || !n.showScrollToBottom) return;
|
|
431
|
+
let t = e.getBoundingClientRect().top + e.clientHeight / 2, r = W.value[0]?.id;
|
|
432
|
+
et().forEach((e, n) => {
|
|
433
|
+
e.getBoundingClientRect().top <= t && (r = W.value[n]?.id);
|
|
434
|
+
}), Qe.value = r;
|
|
435
|
+
};
|
|
436
|
+
B(W, async () => {
|
|
437
|
+
await N(), tt();
|
|
438
|
+
});
|
|
439
|
+
let nt = () => {
|
|
440
|
+
qe(), tt();
|
|
441
|
+
}, rt = (e) => {
|
|
442
|
+
let t = M.value, n = W.value.findIndex((t) => t.id === e), r = et()[n];
|
|
443
|
+
t && r && (Ye.value = !0, t.scrollTo({
|
|
444
|
+
top: t.scrollTop + r.getBoundingClientRect().top - t.getBoundingClientRect().top - Number.parseFloat(getComputedStyle(t).paddingTop),
|
|
445
|
+
behavior: "smooth"
|
|
446
|
+
}));
|
|
447
|
+
}, G = T(() => n.status === "submitted" || n.status === "streaming" || n.hostWorking === !0), K = L(0), at = L(!1), q = !1, ot = Ve(), st = () => n.messages?.[n.messages.length - 1]?.role === "user" || G.value, ct = () => {
|
|
448
|
+
q = !1, at.value = !0, K.value = 0;
|
|
449
|
+
}, J = async () => {
|
|
450
|
+
if (!n.messages?.length || n.disableHeightAdjustment) return;
|
|
451
|
+
if (!st()) {
|
|
452
|
+
q && (await N(), M.value?.scrollHeight, st() || ct());
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
if (q = !0, at.value = !1, await N(), !M.value) return;
|
|
456
|
+
let { paddingTop: e, paddingBottom: t } = getComputedStyle(M.value), r = M.value.clientHeight - Number.parseFloat(e) - Number.parseFloat(t), i = F.value && Number.parseFloat(getComputedStyle(F.value).rowGap) || 0, a = et();
|
|
457
|
+
ot.value = a[a.length - 1];
|
|
458
|
+
let o = r - (ot.value?.clientHeight ?? 0) - i;
|
|
459
|
+
r > 0 && (K.value = Math.max(o, 0)), await N();
|
|
460
|
+
};
|
|
461
|
+
B([() => n.messages?.length, () => n.messages?.[n.messages.length - 1]?.id], () => J()), Ge([M, ot], () => {
|
|
462
|
+
q && J();
|
|
463
|
+
}), Le(() => {
|
|
464
|
+
(G.value || n.awaitingSpokenAnswer) && J();
|
|
465
|
+
}), B(G, (e) => {
|
|
466
|
+
e || ct();
|
|
467
|
+
});
|
|
468
|
+
let ut = (e) => n.revisedAnswers?.some((t) => t.messageId === e), Y = (e) => n.messageFeedbacks?.find((t) => t.messageId === e), Qt = /* @__PURE__ */ new Set([
|
|
469
|
+
"showContactForm",
|
|
470
|
+
"showForm",
|
|
471
|
+
"showMultipleChoice",
|
|
472
|
+
"showSuggestedReply"
|
|
473
|
+
]), $t = /* @__PURE__ */ new Set(["showDiagram", "showLocation"]), en = (e) => {
|
|
474
|
+
let t = h(e);
|
|
475
|
+
return {
|
|
476
|
+
...!n.interactive && Qt.has(t) ? { record: !0 } : {},
|
|
477
|
+
...$t.has(t) ? { isDark: n.isDark } : {}
|
|
478
|
+
};
|
|
479
|
+
}, tn = (e, t) => !n.readonlyFeedback && xn(e, t), nn = (e) => n.readonlyFeedback ? Y(e) : void 0, rn = (e) => nn(e)?.vote, an = (e) => {
|
|
480
|
+
let t = nn(e);
|
|
481
|
+
if (t?.vote) return;
|
|
482
|
+
let n = t?.metadata?.reactionEmoji;
|
|
483
|
+
return typeof n == "string" && /\p{Extended_Pictographic}/u.test(n) ? n : void 0;
|
|
484
|
+
}, on = (e) => !!(rn(e) || an(e)), sn = (e) => {
|
|
485
|
+
if (an(e)) return "pk-chatbot-message__reaction--neutral";
|
|
486
|
+
let t = rn(e);
|
|
487
|
+
return t === "upvote" ? "pk-chatbot-message__reaction--positive" : t === "downvote" ? "pk-chatbot-message__reaction--negative" : "pk-chatbot-message__reaction--neutral";
|
|
488
|
+
}, cn = (e) => {
|
|
489
|
+
let t = rn(e);
|
|
490
|
+
return i(t === "upvote" ? "hint.userFeedbackPositive" : t === "downvote" ? "hint.userFeedbackNegative" : "hint.userFeedbackReaction");
|
|
491
|
+
}, ln = (e) => {
|
|
492
|
+
let t = fn(e);
|
|
493
|
+
for (let e = t.length - 1; e >= 0; --e) if (g(t[e])) return e;
|
|
494
|
+
return -1;
|
|
495
|
+
}, un = T(() => n.messages?.[n.messages.length - 1]), X = T(() => {
|
|
496
|
+
let e = un.value;
|
|
497
|
+
return e ? e.parts[e.parts.length - 1] : null;
|
|
498
|
+
}), dn = T(() => {
|
|
499
|
+
let e = /* @__PURE__ */ new Map();
|
|
500
|
+
for (let t of n.messages ?? []) t.role === "assistant" && e.set(t.id, ie(_e(oe(t.parts))));
|
|
501
|
+
return e;
|
|
502
|
+
}), fn = (e) => dn.value.get(e.id) ?? e.parts, pn = T(() => n.status === "error"), mn = T(() => n.awaitingSpokenAnswer === !0 && !G.value), hn = T(() => mn.value && un.value?.role === "user" && !pn.value), gn = (e, t) => t(), _n = T(() => {
|
|
503
|
+
let e = X.value;
|
|
504
|
+
return x(i, e, l?.value);
|
|
505
|
+
}), vn = T(() => {
|
|
506
|
+
let e = X.value;
|
|
507
|
+
return ve(e);
|
|
508
|
+
}), yn = (e) => n.messages?.findIndex((t) => t.id === e), Z = (e) => e === void 0 || !n.messages ? !1 : e === n.messages.length - 1, bn = (e) => Z(e) && n.status === "ready" && !n.hostWorking && !!n.actions?.includes("regenerate"), xn = (e, t) => (!Z(t) || n.status === "ready" && !n.hostWorking) && !!n.actions?.includes(e), Sn = (e) => {
|
|
509
|
+
let t = e.parts[e.parts.length - 1];
|
|
510
|
+
return g(t);
|
|
511
|
+
}, Cn = (e) => e.parts.some((e) => m(e) || y(e) || !!S(e)), wn = (e) => !!n.showExtendedSteps && Q(e) && Cn(e), Tn = (e) => n.hostConfirmation !== void 0 && S(e) !== void 0 && e.toolCallId === n.hostConfirmation.toolCallId, En = T(() => n.hostConfirmation !== void 0 && !n.messages?.some((e) => e.parts.some(Tn))), Dn = (e, t) => G.value && Z(e) && S(t)?.state === "input-available", On = (e, t, n, r) => {
|
|
512
|
+
if (!S(n) || wn(e)) return !1;
|
|
513
|
+
let i = Dn(t, n);
|
|
514
|
+
return i && r === fn(e).length - 1 ? !1 : i || pe(n) || !ee(e);
|
|
515
|
+
}, kn = (e, t) => {
|
|
516
|
+
let n = S(t);
|
|
517
|
+
return n?.state === "output-error" ? i(n.errorText === "The user refused this call. Do not repeat it unless the user asks." ? "toolApproval.denied" : "messagePart.hostToolFailed") : n?.state === "input-available" && !Dn(e, t) ? i("messagePart.hostToolNoAnswer") : void 0;
|
|
518
|
+
}, An = (e) => y(e) && !fe(e) && !!($e[h(e)] || ge[e.type] || n.showAllMessageParts), jn = (e) => e.parts.some((e) => g(e) && !!e.text.trim() || v(e) || re(e) && !fe(e) || An(e)), Q = (e) => e.role === "assistant", Mn = (e) => e.role === "user", Nn = (e) => n.messages?.slice(0, e).reverse().find((e) => Q(e)), Pn = (e) => n.messages?.slice(e + 1).find((e) => Q(e)), Fn = (e) => {
|
|
519
|
+
let t = Nn(e)?.metadata?.createdAt, n = Pn(e)?.metadata?.createdAt;
|
|
520
|
+
if (!t || !n) return;
|
|
521
|
+
let r = new Date(t), i = new Date(n);
|
|
522
|
+
return r.toDateString() === i.toDateString() ? void 0 : i;
|
|
523
|
+
}, $ = T(() => n.showAllMessageParts ? ft([]) : ft(n.messages ?? [], jn)), In = T(() => {
|
|
524
|
+
let e = 0;
|
|
525
|
+
return (n.messages ?? []).map((t) => t.parts.length > 0 ? ++e : void 0);
|
|
526
|
+
}), Ln = (e, t) => t === 0 || e.role !== "assistant" ? !1 : !!(n.actions?.length || n.showMessageNumber || n.showMessageDateTime && e.metadata?.createdAt !== void 0 || e.metadata?.completedAt !== void 0 || n.showMessageTokensCount && e.metadata?.totalTokens !== void 0), Rn = (e) => {
|
|
527
|
+
let t = new Date(e), n = t.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
|
|
528
|
+
return s(t, n ? "time" : "date-time");
|
|
529
|
+
}, zn = (e) => {
|
|
530
|
+
let { createdAt: t, completedAt: n } = e.metadata ?? {};
|
|
531
|
+
if (t && n) return ue(c, n - t);
|
|
532
|
+
}, Bn = Ue("feedbackMessageEl");
|
|
533
|
+
return B(() => n.feedbackMessageId, async () => {
|
|
534
|
+
if (await N(), !n.feedbackMessageId) return;
|
|
535
|
+
let e = Bn.value?.[0]?.$el;
|
|
536
|
+
e && (Z(yn(n.feedbackMessageId)) ? Je() : e.scrollIntoView({
|
|
537
|
+
behavior: "smooth",
|
|
538
|
+
block: "center"
|
|
539
|
+
}));
|
|
540
|
+
}), (t, n) => {
|
|
541
|
+
let u = Me, f = Ae, m = d, ee = je;
|
|
542
|
+
return I(), O("div", {
|
|
543
|
+
ref_key: "scrollEl",
|
|
544
|
+
ref: M,
|
|
545
|
+
class: P(["pk-chatbot-messages scrollbar-thin", {
|
|
546
|
+
"pk-chatbot-messages--settling": at.value,
|
|
547
|
+
"pk-chatbot-messages--parent-scrolls": e.parentScrolls
|
|
548
|
+
}]),
|
|
549
|
+
role: "log",
|
|
550
|
+
"aria-live": "polite",
|
|
551
|
+
"aria-relevant": "additions text",
|
|
552
|
+
"aria-busy": G.value,
|
|
553
|
+
style: Ie({
|
|
554
|
+
"--chatbot-main-color": e.mainColor,
|
|
555
|
+
"--chatbot-contrast-color": Ke.value
|
|
556
|
+
}),
|
|
557
|
+
onScroll: nt
|
|
558
|
+
}, [
|
|
559
|
+
e.showScrollToBottom && W.value.length > 1 ? (I(), O("div", mt, [A(ke, {
|
|
560
|
+
items: W.value,
|
|
561
|
+
"active-id": Qe.value,
|
|
562
|
+
onSelect: rt
|
|
563
|
+
}, null, 8, ["items", "active-id"])])) : D("", !0),
|
|
564
|
+
k("div", {
|
|
565
|
+
ref_key: "wrapperEl",
|
|
566
|
+
ref: F,
|
|
567
|
+
class: "pk-chatbot-messages__wrapper"
|
|
568
|
+
}, [
|
|
569
|
+
(I(!0), O(C, null, Re(e.messages, (d, y) => (I(), O(C, { key: d.id }, [
|
|
570
|
+
Mn(d) && Fn(y) ? (I(), O("div", ht, [k("span", gt, R(z(s)(Fn(y), "short")), 1)])) : D("", !0),
|
|
571
|
+
$.value.quietRuns.has(d.id) ? (I(), O("div", _t, [A(u, {
|
|
572
|
+
name: "ri:alarm-line",
|
|
573
|
+
class: "shrink-0"
|
|
574
|
+
}), k("span", null, R(z(i)("label.wakeupQuietRun", {
|
|
575
|
+
count: $.value.quietRuns.get(d.id).count,
|
|
576
|
+
time: z(s)($.value.quietRuns.get(d.id).lastAt ?? Date.now(), "time")
|
|
577
|
+
}, $.value.quietRuns.get(d.id).count)), 1)])) : z(U)(d) && !$.value.hidden.has(d.id) && !e.showAllMessageParts ? (I(), O("div", {
|
|
578
|
+
key: 2,
|
|
579
|
+
class: "pk-chatbot-wakeup",
|
|
580
|
+
title: d.metadata?.wakeup?.reason
|
|
581
|
+
}, [A(u, {
|
|
582
|
+
name: "ri:alarm-line",
|
|
583
|
+
class: "shrink-0"
|
|
584
|
+
}), k("span", null, [Ne(R(z(i)("label.wakeupCheck")) + " ", 1), d.metadata?.createdAt ? (I(), O(C, { key: 0 }, [Ne(" · " + R(z(s)(d.metadata.createdAt, "time")), 1)], 64)) : D("", !0)])], 8, vt)) : D("", !0),
|
|
585
|
+
(!z(U)(d) || e.showAllMessageParts) && (!$.value.hidden.has(d.id) || G.value && Z(y)) && (d.parts.length || Z(y) && G.value && Q(d)) ? (I(), O("div", {
|
|
586
|
+
key: 3,
|
|
587
|
+
class: P(["pk-chatbot-message", [`pk-chatbot-message--${d.role}`, { "pk-chatbot-message--loading": G.value && Z(y) && Q(d) }]]),
|
|
588
|
+
style: Ie({ minHeight: Z(y) && Q(d) && !pn.value ? `${K.value}px` : void 0 })
|
|
589
|
+
}, [
|
|
590
|
+
A(w, {
|
|
591
|
+
appear: "",
|
|
592
|
+
name: "pk-chatbot-part"
|
|
593
|
+
}, {
|
|
594
|
+
default: V(() => [wn(d) ? (I(), E(Oe, {
|
|
595
|
+
key: 0,
|
|
596
|
+
message: d,
|
|
597
|
+
"is-streaming": G.value && Z(y),
|
|
598
|
+
"has-content": jn(d),
|
|
599
|
+
"hide-reasoning": e.hideReasoning,
|
|
600
|
+
"is-dark": e.isDark
|
|
601
|
+
}, null, 8, [
|
|
602
|
+
"message",
|
|
603
|
+
"is-streaming",
|
|
604
|
+
"has-content",
|
|
605
|
+
"hide-reasoning",
|
|
606
|
+
"is-dark"
|
|
607
|
+
])) : D("", !0)]),
|
|
608
|
+
_: 2
|
|
609
|
+
}, 1024),
|
|
610
|
+
(I(!0), O(C, null, Re(fn(d), (s, c) => (I(), O(C, { key: z(le)(s, c) }, [z(g)(s) && s.text.trim() ? (I(), E(w, {
|
|
611
|
+
key: 0,
|
|
612
|
+
appear: "",
|
|
613
|
+
name: "pk-chatbot-part"
|
|
614
|
+
}, {
|
|
615
|
+
default: V(() => [k("div", yt, [ze(t.$slots, "text", Fe({ ref_for: !0 }, {
|
|
616
|
+
message: d,
|
|
617
|
+
part: s,
|
|
618
|
+
index: y,
|
|
619
|
+
isLoading: G.value
|
|
620
|
+
}), () => [Q(d) ? (I(), E(p, {
|
|
621
|
+
key: 0,
|
|
622
|
+
class: "wysiwyg",
|
|
623
|
+
markdown: s.text,
|
|
624
|
+
"is-dark": e.isDark,
|
|
625
|
+
loading: Z(y) && e.status === "streaming"
|
|
626
|
+
}, null, 8, [
|
|
627
|
+
"markdown",
|
|
628
|
+
"is-dark",
|
|
629
|
+
"loading"
|
|
630
|
+
])) : (I(), O(C, { key: 1 }, [Ne(R(s.text), 1)], 64))]), on(d.id) && !Y(d.id)?.comment && c === ln(d) ? (I(), O("span", {
|
|
631
|
+
key: 0,
|
|
632
|
+
class: P(["pk-chatbot-message__reaction", sn(d.id)]),
|
|
633
|
+
title: cn(d.id)
|
|
634
|
+
}, [an(d.id) ? (I(), O("span", xt, R(an(d.id)), 1)) : (I(), E(u, {
|
|
635
|
+
key: 1,
|
|
636
|
+
name: rn(d.id) === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-up-fill"
|
|
637
|
+
}, null, 8, ["name"]))], 10, bt)) : D("", !0)])]),
|
|
638
|
+
_: 2
|
|
639
|
+
}, 1024)) : z(v)(s) ? (I(), E(w, {
|
|
640
|
+
key: 1,
|
|
641
|
+
appear: "",
|
|
642
|
+
name: "pk-chatbot-part"
|
|
643
|
+
}, {
|
|
644
|
+
default: V(() => [z(a)(s.filename, s.mediaType) ? (I(), O("div", St, [A(Te, {
|
|
645
|
+
"media-type": s.mediaType,
|
|
646
|
+
url: s.url,
|
|
647
|
+
filename: s.filename,
|
|
648
|
+
size: z(te)(s)?.bytesCount
|
|
649
|
+
}, null, 8, [
|
|
650
|
+
"media-type",
|
|
651
|
+
"url",
|
|
652
|
+
"filename",
|
|
653
|
+
"size"
|
|
654
|
+
]), A(ne, {
|
|
655
|
+
url: s.url,
|
|
656
|
+
transcript: z(_)(s),
|
|
657
|
+
pending: e.status === "submitted" && Z(y)
|
|
658
|
+
}, null, 8, [
|
|
659
|
+
"url",
|
|
660
|
+
"transcript",
|
|
661
|
+
"pending"
|
|
662
|
+
])])) : (I(), E(Te, {
|
|
663
|
+
key: 1,
|
|
664
|
+
"media-type": s.mediaType,
|
|
665
|
+
url: s.url,
|
|
666
|
+
filename: s.filename,
|
|
667
|
+
size: z(te)(s)?.bytesCount
|
|
668
|
+
}, null, 8, [
|
|
669
|
+
"media-type",
|
|
670
|
+
"url",
|
|
671
|
+
"filename",
|
|
672
|
+
"size"
|
|
673
|
+
]))]),
|
|
674
|
+
_: 2
|
|
675
|
+
}, 1024)) : z(re)(s) && !z(fe)(s) ? (I(), E(w, {
|
|
676
|
+
key: 2,
|
|
677
|
+
appear: "",
|
|
678
|
+
name: "pk-chatbot-part"
|
|
679
|
+
}, {
|
|
680
|
+
default: V(() => [(I(), E(it, {
|
|
681
|
+
key: `approval-${c}`,
|
|
682
|
+
part: s,
|
|
683
|
+
actionable: e.interactive === !0 && (z(b)(s) || Z(y)),
|
|
684
|
+
"call-verdict": e.confirmVerdictsOnCall?.get(s.toolCallId ?? ""),
|
|
685
|
+
onRespond: (e) => j(s, e)
|
|
686
|
+
}, null, 8, [
|
|
687
|
+
"part",
|
|
688
|
+
"actionable",
|
|
689
|
+
"call-verdict",
|
|
690
|
+
"onRespond"
|
|
691
|
+
]))]),
|
|
692
|
+
_: 2
|
|
693
|
+
}, 1024)) : Tn(s) ? (I(), E(w, {
|
|
694
|
+
key: 3,
|
|
695
|
+
appear: "",
|
|
696
|
+
name: "pk-chatbot-part"
|
|
697
|
+
}, {
|
|
698
|
+
default: V(() => [A(lt, {
|
|
699
|
+
question: e.hostConfirmation?.question ?? z(i)("toolApproval.hostCall", { name: z(x)(z(i), s) }),
|
|
700
|
+
details: e.hostConfirmation?.details,
|
|
701
|
+
unchanged: e.hostConfirmation?.unchanged,
|
|
702
|
+
onRespond: n[0] ||= (e) => r("host-confirm-respond", e)
|
|
703
|
+
}, null, 8, [
|
|
704
|
+
"question",
|
|
705
|
+
"details",
|
|
706
|
+
"unchanged"
|
|
707
|
+
])]),
|
|
708
|
+
_: 2
|
|
709
|
+
}, 1024)) : On(d, y, s, c) ? (I(), E(w, {
|
|
710
|
+
key: 4,
|
|
711
|
+
appear: "",
|
|
712
|
+
name: "pk-chatbot-part"
|
|
713
|
+
}, {
|
|
714
|
+
default: V(() => [k("div", Ct, [k("div", wt, [
|
|
715
|
+
A(u, {
|
|
716
|
+
name: Dn(y, s) ? "loading-loop" : z(ve)(s) ?? "ri:apps-line",
|
|
717
|
+
class: "shrink-0"
|
|
718
|
+
}, null, 8, ["name"]),
|
|
719
|
+
k("span", Tt, R(z(x)(z(i), s, z(l))), 1),
|
|
720
|
+
kn(y, s) ? (I(), O("span", Et, " · " + R(kn(y, s)), 1)) : D("", !0)
|
|
721
|
+
]), se(s)?.length ? (I(), E(f, {
|
|
722
|
+
key: 0,
|
|
723
|
+
title: z(i)("toolApproval.changesCount", se(s).length),
|
|
724
|
+
modifiers: "compact",
|
|
725
|
+
class: "pk-chatbot-message__host-changes"
|
|
726
|
+
}, {
|
|
727
|
+
default: V(() => [A(De, { changes: se(s) }, null, 8, ["changes"])]),
|
|
728
|
+
_: 2
|
|
729
|
+
}, 1032, ["title"])) : D("", !0)])]),
|
|
730
|
+
_: 2
|
|
731
|
+
}, 1024)) : An(s) ? (I(), E(w, {
|
|
732
|
+
key: 5,
|
|
733
|
+
appear: "",
|
|
734
|
+
name: "pk-chatbot-part"
|
|
735
|
+
}, {
|
|
736
|
+
default: V(() => [!z(ge)[s.type] && z($e)[z(h)(s)] ? (I(), E(Be(z($e)[z(h)(s)]), Fe({
|
|
737
|
+
key: `component-${c}-${z(be)(s)}`,
|
|
738
|
+
part: s
|
|
739
|
+
}, { ref_for: !0 }, en(s)), null, 16, ["part"])) : ze(t.$slots, s.type, Fe({ ref_for: !0 }, {
|
|
740
|
+
message: d,
|
|
741
|
+
part: s,
|
|
742
|
+
index: y,
|
|
743
|
+
isLoading: G.value
|
|
744
|
+
}), () => [e.showAllMessageParts ? (I(), O("div", Dt, [k("div", Ot, [z(ve)(s) ? (I(), E(u, {
|
|
745
|
+
key: 0,
|
|
746
|
+
name: z(ve)(s),
|
|
747
|
+
class: "shrink-0"
|
|
748
|
+
}, null, 8, ["name"])) : D("", !0), k("span", kt, R(z(ce)(s, {
|
|
749
|
+
t: z(i),
|
|
750
|
+
te: z(o)
|
|
751
|
+
})), 1)])])) : D("", !0)], void 0, 1)]),
|
|
752
|
+
_: 2
|
|
753
|
+
}, 1024)) : D("", !0), A(w, { mode: "out-in" }, {
|
|
754
|
+
default: V(() => [c === ln(d) && e.readonlyFeedback && Y(d.id)?.comment ? (I(), E(we, {
|
|
755
|
+
key: 0,
|
|
756
|
+
feedback: Y(d.id)
|
|
757
|
+
}, null, 8, ["feedback"])) : D("", !0)]),
|
|
758
|
+
_: 2
|
|
759
|
+
}, 1024)], 64))), 128)),
|
|
760
|
+
Mn(d) && d.metadata?.pagePointer ? (I(), O("div", {
|
|
761
|
+
key: 0,
|
|
762
|
+
class: "pk-chatbot-message__pointer",
|
|
763
|
+
title: d.metadata.pagePointer.kind === "text" ? z(i)("pagePointer.selected") : z(i)("pagePointer.pointed")
|
|
764
|
+
}, [A(u, {
|
|
765
|
+
name: d.metadata.pagePointer.kind === "text" ? "ri:double-quotes-l" : "ri:focus-3-line",
|
|
766
|
+
class: "pk-chatbot-message__pointer-icon"
|
|
767
|
+
}, null, 8, ["name"]), k("span", jt, R(d.metadata.pagePointer.kind === "text" ? `«${d.metadata.pagePointer.label}»` : d.metadata.pagePointer.label), 1)], 8, At)) : Mn(d) && d.metadata?.filePointer ? (I(), O("div", {
|
|
768
|
+
key: 1,
|
|
769
|
+
class: "pk-chatbot-message__pointer",
|
|
770
|
+
title: z(i)("selectionActions.selectedInFile")
|
|
771
|
+
}, [A(u, {
|
|
772
|
+
name: d.metadata.filePointer.format === "docx" ? "ri:file-word-2-line" : "ri:file-excel-2-line",
|
|
773
|
+
class: "pk-chatbot-message__pointer-icon"
|
|
774
|
+
}, null, 8, ["name"]), k("span", Nt, R(d.metadata.filePointer.label), 1)], 8, Mt)) : D("", !0),
|
|
775
|
+
A(w, {
|
|
776
|
+
name: "fade-in",
|
|
777
|
+
mode: "out-in"
|
|
778
|
+
}, {
|
|
779
|
+
default: V(() => [G.value && Z(y) && !Sn(d) && !e.hostConfirmation && Q(d) && (!wn(d) || jn(d)) ? (I(), O("div", {
|
|
780
|
+
key: `loading-info-${d.id}`,
|
|
781
|
+
class: "pk-chatbot-message__loading-info"
|
|
782
|
+
}, [k("div", Pt, [
|
|
783
|
+
A(u, {
|
|
784
|
+
name: "loading-loop",
|
|
785
|
+
class: "shrink-0"
|
|
786
|
+
}),
|
|
787
|
+
A(w, { mode: "out-in" }, {
|
|
788
|
+
default: V(() => [vn.value ? (I(), E(u, {
|
|
789
|
+
key: vn.value,
|
|
790
|
+
class: "shrink-0",
|
|
791
|
+
name: vn.value
|
|
792
|
+
}, null, 8, ["name"])) : D("", !0)]),
|
|
793
|
+
_: 1
|
|
794
|
+
}),
|
|
795
|
+
A(w, { mode: "out-in" }, {
|
|
796
|
+
default: V(() => [_n.value ? (I(), O("span", {
|
|
797
|
+
key: _n.value,
|
|
798
|
+
class: "text-12"
|
|
799
|
+
}, R(_n.value), 1)) : D("", !0)]),
|
|
800
|
+
_: 1
|
|
801
|
+
})
|
|
802
|
+
]), A(w, {
|
|
803
|
+
name: "fade-in",
|
|
804
|
+
mode: "out-in"
|
|
805
|
+
}, {
|
|
806
|
+
default: V(() => [!e.hideReasoning && !wn(d) && X.value && "text" in X.value && X.value.text.trim() ? (I(), E(Ee, {
|
|
807
|
+
key: 0,
|
|
808
|
+
markdown: X.value.text,
|
|
809
|
+
"is-dark": e.isDark,
|
|
810
|
+
"tail-length": z(de),
|
|
811
|
+
"inner-class": "wysiwyg",
|
|
812
|
+
class: "border border-surface-3 rounded-md p-4 mt-8 bg-surface-1 max-h-64 text-12 w-full"
|
|
813
|
+
}, null, 8, [
|
|
814
|
+
"markdown",
|
|
815
|
+
"is-dark",
|
|
816
|
+
"tail-length"
|
|
817
|
+
])) : D("", !0)]),
|
|
818
|
+
_: 2
|
|
819
|
+
}, 1024)])) : D("", !0)]),
|
|
820
|
+
_: 2
|
|
821
|
+
}, 1024),
|
|
822
|
+
A(w, { mode: "out-in" }, {
|
|
823
|
+
default: V(() => [Ln(d, y) ? (I(), O("div", Ft, [
|
|
824
|
+
A(ee, {
|
|
825
|
+
modifiers: "compact",
|
|
826
|
+
class: "mr-auto shrink-0"
|
|
827
|
+
}, {
|
|
828
|
+
default: V(() => [
|
|
829
|
+
A(w, { mode: "out-in" }, {
|
|
830
|
+
default: V(() => [bn(y) ? (I(), E(m, {
|
|
831
|
+
key: 0,
|
|
832
|
+
icon: "ri:reset-right-line",
|
|
833
|
+
modifiers: "action-quiet-small",
|
|
834
|
+
title: z(i)("action.regenerate"),
|
|
835
|
+
"aria-label": z(i)("action.regenerate"),
|
|
836
|
+
onClick: n[1] ||= H((e) => t.$emit("regenerate"), ["stop"])
|
|
837
|
+
}, null, 8, ["title", "aria-label"])) : D("", !0)]),
|
|
838
|
+
_: 2
|
|
839
|
+
}, 1024),
|
|
840
|
+
A(w, { mode: "out-in" }, {
|
|
841
|
+
default: V(() => [xn("show-info", y) ? (I(), E(m, {
|
|
842
|
+
key: 0,
|
|
843
|
+
icon: "ri:information-line",
|
|
844
|
+
title: z(i)("action.getMoreInfo"),
|
|
845
|
+
"aria-label": z(i)("action.getMoreInfo"),
|
|
846
|
+
modifiers: "action-quiet-small",
|
|
847
|
+
onClick: H((e) => t.$emit("show-info", d), ["stop"])
|
|
848
|
+
}, null, 8, [
|
|
849
|
+
"title",
|
|
850
|
+
"aria-label",
|
|
851
|
+
"onClick"
|
|
852
|
+
])) : D("", !0)]),
|
|
853
|
+
_: 2
|
|
854
|
+
}, 1024),
|
|
855
|
+
A(w, { mode: "out-in" }, {
|
|
856
|
+
default: V(() => [xn("revise", y) ? (I(), E(m, {
|
|
857
|
+
key: 0,
|
|
858
|
+
icon: ut(d.id) ? "ri:file-edit-fill" : "ri:file-edit-line",
|
|
859
|
+
title: ut(d.id) ? z(i)("action.editRevise") : z(i)("action.createRevise"),
|
|
860
|
+
"aria-label": ut(d.id) ? z(i)("action.editRevise") : z(i)("action.createRevise"),
|
|
861
|
+
modifiers: "action-quiet-small",
|
|
862
|
+
class: P({ "text-brand-graphic": ut(d.id) }),
|
|
863
|
+
onClick: H((e) => t.$emit("revise", d), ["stop"])
|
|
864
|
+
}, null, 8, [
|
|
865
|
+
"icon",
|
|
866
|
+
"title",
|
|
867
|
+
"aria-label",
|
|
868
|
+
"class",
|
|
869
|
+
"onClick"
|
|
870
|
+
])) : D("", !0)]),
|
|
871
|
+
_: 2
|
|
872
|
+
}, 1024),
|
|
873
|
+
A(w, { mode: "out-in" }, {
|
|
874
|
+
default: V(() => [tn("upvote", y) ? (I(), E(m, {
|
|
875
|
+
key: 0,
|
|
876
|
+
icon: Y(d.id)?.vote === "upvote" ? "ri:thumb-up-fill" : "ri:thumb-up-line",
|
|
877
|
+
title: z(i)("action.upvote"),
|
|
878
|
+
"aria-label": z(i)("action.upvote"),
|
|
879
|
+
modifiers: "action-quiet-small",
|
|
880
|
+
onClick: H((e) => t.$emit("upvote", d), ["stop"])
|
|
881
|
+
}, null, 8, [
|
|
882
|
+
"icon",
|
|
883
|
+
"title",
|
|
884
|
+
"aria-label",
|
|
885
|
+
"onClick"
|
|
886
|
+
])) : D("", !0)]),
|
|
887
|
+
_: 2
|
|
888
|
+
}, 1024),
|
|
889
|
+
A(w, { mode: "out-in" }, {
|
|
890
|
+
default: V(() => [tn("downvote", y) ? (I(), E(m, {
|
|
891
|
+
key: 0,
|
|
892
|
+
icon: Y(d.id)?.vote === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-down-line",
|
|
893
|
+
title: z(i)("action.downvote"),
|
|
894
|
+
"aria-label": z(i)("action.downvote"),
|
|
895
|
+
modifiers: "action-quiet-small",
|
|
896
|
+
onClick: H((e) => t.$emit("downvote", d), ["stop"])
|
|
897
|
+
}, null, 8, [
|
|
898
|
+
"icon",
|
|
899
|
+
"title",
|
|
900
|
+
"aria-label",
|
|
901
|
+
"onClick"
|
|
902
|
+
])) : D("", !0)]),
|
|
903
|
+
_: 2
|
|
904
|
+
}, 1024),
|
|
905
|
+
A(w, { mode: "out-in" }, {
|
|
906
|
+
default: V(() => [tn("feedback", y) ? (I(), E(m, {
|
|
907
|
+
key: 0,
|
|
908
|
+
icon: Y(d.id)?.comment ? "ri:feedback-fill" : "ri:feedback-line",
|
|
909
|
+
title: z(i)("action.feedback"),
|
|
910
|
+
"aria-label": z(i)("action.feedback"),
|
|
911
|
+
modifiers: "action-quiet-small",
|
|
912
|
+
onClick: H((e) => t.$emit("feedback", d), ["stop"])
|
|
913
|
+
}, null, 8, [
|
|
914
|
+
"icon",
|
|
915
|
+
"title",
|
|
916
|
+
"aria-label",
|
|
917
|
+
"onClick"
|
|
918
|
+
])) : D("", !0)]),
|
|
919
|
+
_: 2
|
|
920
|
+
}, 1024)
|
|
921
|
+
]),
|
|
922
|
+
_: 2
|
|
923
|
+
}, 1024),
|
|
924
|
+
!e.showMessageDateTime && d.metadata?.createdAt && d.metadata?.completedAt ? (I(), O("div", It, [k("time", {
|
|
925
|
+
datetime: new Date(d.metadata.createdAt).toISOString(),
|
|
926
|
+
title: z(s)(new Date(d.metadata.createdAt), "date-time"),
|
|
927
|
+
class: "flex items-center gap-4 min-w-0"
|
|
928
|
+
}, [A(u, {
|
|
929
|
+
name: "ri:time-line",
|
|
930
|
+
class: "shrink-0"
|
|
931
|
+
}), k("span", Rt, R(Rn(d.metadata.createdAt)), 1)], 8, Lt), zn(d) ? (I(), O("span", zt, [A(u, {
|
|
932
|
+
name: "ri:hourglass-line",
|
|
933
|
+
class: "shrink-0"
|
|
934
|
+
}), k("span", Bt, R(zn(d)), 1)])) : D("", !0)])) : D("", !0),
|
|
935
|
+
e.showMessageNumber ? (I(), O("span", {
|
|
936
|
+
key: 1,
|
|
937
|
+
title: z(i)("label.messageNumber", { n: In.value[y] }),
|
|
938
|
+
class: "text-12 text-word-3 tabular-nums"
|
|
939
|
+
}, " #" + R(In.value[y]), 9, Vt)) : D("", !0),
|
|
940
|
+
e.showMessageTokensCount && d.metadata?.totalTokens ? (I(), O("span", Ht, [A(u, {
|
|
941
|
+
name: "ri:ai-generate-2-line",
|
|
942
|
+
class: "shrink-0"
|
|
943
|
+
}), k("span", Ut, R(z(c)(d.metadata.totalTokens, "integer")) + " " + R(z(i)("label.tokens")), 1)])) : D("", !0),
|
|
944
|
+
e.showMessageDateTime && d.metadata?.createdAt ? (I(), O("time", {
|
|
945
|
+
key: 3,
|
|
946
|
+
datetime: new Date(d.metadata?.createdAt).toISOString(),
|
|
947
|
+
class: "flex items-center gap-4 text-12 text-word-3"
|
|
948
|
+
}, [A(u, {
|
|
949
|
+
name: "ri:time-line",
|
|
950
|
+
class: "shrink-0"
|
|
951
|
+
}), k("span", Gt, R(z(s)(new Date(d.metadata?.createdAt), "date-time")), 1)], 8, Wt)) : D("", !0),
|
|
952
|
+
e.showMessageDateTime && d?.metadata?.completedAt && d?.metadata?.createdAt ? (I(), O("div", Kt, [A(u, {
|
|
953
|
+
name: "ri:hourglass-line",
|
|
954
|
+
class: "shrink-0"
|
|
955
|
+
}), A(Se, {
|
|
956
|
+
class: "truncate",
|
|
957
|
+
date: d.metadata?.createdAt,
|
|
958
|
+
"end-date": d.metadata?.completedAt
|
|
959
|
+
}, null, 8, ["date", "end-date"])])) : D("", !0)
|
|
960
|
+
])) : D("", !0)]),
|
|
961
|
+
_: 2
|
|
962
|
+
}, 1024),
|
|
963
|
+
A(w, { mode: "out-in" }, {
|
|
964
|
+
default: V(() => [d.id === e.feedbackMessageId ? (I(), E(Ce, {
|
|
965
|
+
key: 0,
|
|
966
|
+
ref_for: !0,
|
|
967
|
+
ref_key: "feedbackMessageEl",
|
|
968
|
+
ref: Bn,
|
|
969
|
+
loading: e.feedbackLoading,
|
|
970
|
+
submitted: e.feedbackSubmitted,
|
|
971
|
+
error: e.feedbackError,
|
|
972
|
+
onSubmit: n[2] ||= (e) => t.$emit("feedback-submit", e),
|
|
973
|
+
onClose: n[3] ||= (e) => t.$emit("feedback-close")
|
|
974
|
+
}, null, 8, [
|
|
975
|
+
"loading",
|
|
976
|
+
"submitted",
|
|
977
|
+
"error"
|
|
978
|
+
])) : D("", !0)]),
|
|
979
|
+
_: 2
|
|
980
|
+
}, 1024)
|
|
981
|
+
], 6)) : D("", !0)
|
|
982
|
+
], 64))), 128)),
|
|
983
|
+
A(w, {
|
|
984
|
+
appear: "",
|
|
985
|
+
name: "pk-chatbot-part",
|
|
986
|
+
onLeave: gn
|
|
987
|
+
}, {
|
|
988
|
+
default: V(() => [mn.value ? (I(), O("div", {
|
|
989
|
+
key: 0,
|
|
990
|
+
class: "pk-chatbot-message pk-chatbot-message--assistant pk-chatbot-message--loading",
|
|
991
|
+
style: Ie({ minHeight: hn.value ? `${K.value}px` : void 0 })
|
|
992
|
+
}, [k("div", qt, [k("div", Jt, [A(u, {
|
|
993
|
+
name: "loading-loop",
|
|
994
|
+
class: "shrink-0"
|
|
995
|
+
}), k("span", Yt, R(z(i)("label.answeringOnTheCall")), 1)])])], 4)) : D("", !0)]),
|
|
996
|
+
_: 1
|
|
997
|
+
}),
|
|
998
|
+
A(w, {
|
|
999
|
+
appear: "",
|
|
1000
|
+
name: "pk-chatbot-part"
|
|
1001
|
+
}, {
|
|
1002
|
+
default: V(() => [En.value ? (I(), O("div", Xt, [A(lt, {
|
|
1003
|
+
question: e.hostConfirmation?.question ?? z(i)("toolApproval.prompt"),
|
|
1004
|
+
details: e.hostConfirmation?.details,
|
|
1005
|
+
unchanged: e.hostConfirmation?.unchanged,
|
|
1006
|
+
onRespond: n[4] ||= (e) => r("host-confirm-respond", e)
|
|
1007
|
+
}, null, 8, [
|
|
1008
|
+
"question",
|
|
1009
|
+
"details",
|
|
1010
|
+
"unchanged"
|
|
1011
|
+
])])) : D("", !0)]),
|
|
1012
|
+
_: 1
|
|
1013
|
+
}),
|
|
1014
|
+
A(w, {
|
|
1015
|
+
appear: "",
|
|
1016
|
+
name: "pk-chatbot-part"
|
|
1017
|
+
}, {
|
|
1018
|
+
default: V(() => [pn.value ? (I(), E(xe, {
|
|
1019
|
+
key: 0,
|
|
1020
|
+
error: e.error,
|
|
1021
|
+
onRetry: n[5] ||= (e) => t.$emit("auto-retry"),
|
|
1022
|
+
onReset: n[6] ||= (e) => t.$emit("reset-chat")
|
|
1023
|
+
}, null, 8, ["error"])) : D("", !0)]),
|
|
1024
|
+
_: 1
|
|
1025
|
+
}),
|
|
1026
|
+
un.value?.role === "user" && !hn.value || pn.value ? (I(), O("div", {
|
|
1027
|
+
key: 0,
|
|
1028
|
+
class: "pk-chatbot-messages__spacer",
|
|
1029
|
+
style: Ie({ minHeight: `${K.value}px` })
|
|
1030
|
+
}, null, 4)) : D("", !0)
|
|
1031
|
+
], 512),
|
|
1032
|
+
A(w, { name: "pk-chatbot-messages-fab" }, {
|
|
1033
|
+
default: V(() => [e.showScrollToBottom && (z(Ye) || !z(Xe)) ? (I(), O("button", {
|
|
1034
|
+
key: 0,
|
|
1035
|
+
type: "button",
|
|
1036
|
+
class: "pk-chatbot-messages__scroll-to-bottom",
|
|
1037
|
+
title: z(i)("action.scrollToBottom"),
|
|
1038
|
+
"aria-label": z(i)("action.scrollToBottom"),
|
|
1039
|
+
onClick: Ze
|
|
1040
|
+
}, [A(u, { name: "ri:arrow-down-line" })], 8, Zt)) : D("", !0)]),
|
|
1041
|
+
_: 1
|
|
1042
|
+
})
|
|
1043
|
+
], 46, pt);
|
|
1044
|
+
};
|
|
1045
|
+
}
|
|
1046
|
+
});
|
|
1047
|
+
export { Qt as t };
|
|
1048
|
+
|
|
1049
|
+
//# sourceMappingURL=PkChatbotMessages-b2lupEv9.js.map
|