@8wave/ai-elements 0.123.0-beta.16 → 0.123.0-beta.18
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/PkFilePreview-DXmgMwwu.js +1143 -0
- package/dist/_chunks/PkFilePreview-DXmgMwwu.js.map +1 -0
- package/dist/_chunks/{PkFilePreviewDialog-nibxELSF.js → PkFilePreviewDialog-Bzt534GA.js} +2 -2
- package/dist/_chunks/{PkFilePreviewDialog-nibxELSF.js.map → PkFilePreviewDialog-Bzt534GA.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-C6cFkf82.js → PkStreamingMarkdown-PQ3X83Fq.js} +2 -2
- package/dist/_chunks/{PkStreamingMarkdown-C6cFkf82.js.map → PkStreamingMarkdown-PQ3X83Fq.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-5t_1vL81.js → PkToolChatFile-CYxqugvO.js} +2 -2
- package/dist/_chunks/{PkToolChatFile-5t_1vL81.js.map → PkToolChatFile-CYxqugvO.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-DV78g_yD.js → PkToolShowArtifact-BIpD-GkV.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-DV78g_yD.js.map → PkToolShowArtifact-BIpD-GkV.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-Bnjy0g50.js → PkToolShowContactForm-2_YDqjeM.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-Bnjy0g50.js.map → PkToolShowContactForm-2_YDqjeM.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-CT5_ln9b.js → PkToolShowForm-Bu4igmQL.js} +5 -5
- package/dist/_chunks/{PkToolShowForm-CT5_ln9b.js.map → PkToolShowForm-Bu4igmQL.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-DhZ5I_J-.js → PkToolShowSources-DKtdU_Bq.js} +2 -2
- package/dist/_chunks/{PkToolShowSources-DhZ5I_J-.js.map → PkToolShowSources-DKtdU_Bq.js.map} +1 -1
- package/dist/_chunks/{utils-B5VcWm3g.js → utils-Bz1Gb3iO.js} +114 -77
- package/dist/_chunks/utils-Bz1Gb3iO.js.map +1 -0
- package/dist/ai-elements.es.js +252 -252
- 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/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/_chunks/{PkChatbot-tq-fJUij.js → PkChatbot-MEYD0XUR.js} +5 -5
- package/dist-vue/_chunks/{PkChatbot-tq-fJUij.js.map → PkChatbot-MEYD0XUR.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-Dp0_UPJm.js → PkChatbotEmptyState-qKpfIuvI.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-Dp0_UPJm.js.map → PkChatbotEmptyState-qKpfIuvI.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-B_kPnNNB.js → PkChatbotInput-DSH5IrO6.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotInput-B_kPnNNB.js.map → PkChatbotInput-DSH5IrO6.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-BTZOic9V.js → PkChatbotMessages-BcHNPZUB.js} +327 -327
- package/dist-vue/_chunks/{PkChatbotMessages-BTZOic9V.js.map → PkChatbotMessages-BcHNPZUB.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepPayload-CoGCHBhJ.js → PkChatbotStepPayload-BT-Xg18D.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-CoGCHBhJ.js.map → PkChatbotStepPayload-BT-Xg18D.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-BJtIZBF0.js → PkChatbotStepToolDetail-Cs322RDk.js} +16 -16
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-BJtIZBF0.js.map → PkChatbotStepToolDetail-Cs322RDk.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-CEJNclG4.js → PkChatbotSteps-Dd62GEXJ.js} +23 -23
- package/dist-vue/_chunks/{PkChatbotSteps-CEJNclG4.js.map → PkChatbotSteps-Dd62GEXJ.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-CnEOSH32.js → PkChatbotViewChat-CfpGWukX.js} +9 -9
- package/dist-vue/_chunks/{PkChatbotViewChat-CnEOSH32.js.map → PkChatbotViewChat-CfpGWukX.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-D7j5P1RO.js → PkChatbotViewConversations-JCrQIoGf.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-D7j5P1RO.js.map → PkChatbotViewConversations-JCrQIoGf.js.map} +1 -1
- package/dist-vue/_chunks/PkFilePreview-CFqcO3vY.js +1126 -0
- package/dist-vue/_chunks/PkFilePreview-CFqcO3vY.js.map +1 -0
- package/dist-vue/_chunks/{PkFilePreviewDialog-Cic7gmVR.js → PkFilePreviewDialog-DeNnbXWq.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-Cic7gmVR.js.map → PkFilePreviewDialog-DeNnbXWq.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-CYlCIfA0.js → PkStreamingMarkdown-QDsT-4jC.js} +2 -2
- package/dist-vue/_chunks/{PkStreamingMarkdown-CYlCIfA0.js.map → PkStreamingMarkdown-QDsT-4jC.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-B_PeJef8.js → PkToolChatFile-UZeUytvT.js} +2 -2
- package/dist-vue/_chunks/{PkToolChatFile-B_PeJef8.js.map → PkToolChatFile-UZeUytvT.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-Bh-jIo0V.js → PkToolShowArtifact-ldnH-U3h.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-Bh-jIo0V.js.map → PkToolShowArtifact-ldnH-U3h.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-BjfRuNuj.js → PkToolShowContactForm-4hISKYqb.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-BjfRuNuj.js.map → PkToolShowContactForm-4hISKYqb.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-_NnrFDGT.js → PkToolShowDiagram-uHFCQ0FJ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-_NnrFDGT.js.map → PkToolShowDiagram-uHFCQ0FJ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-AqEY4_do.js → PkToolShowForm-DiUz5_Ct.js} +5 -5
- package/dist-vue/_chunks/{PkToolShowForm-AqEY4_do.js.map → PkToolShowForm-DiUz5_Ct.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-DM5AJNZ3.js → PkToolShowImageGallery-CEzeXupr.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-DM5AJNZ3.js.map → PkToolShowImageGallery-CEzeXupr.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-CAV8be9a.js → PkToolShowProductList-h4Dqvk1V.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-CAV8be9a.js.map → PkToolShowProductList-h4Dqvk1V.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-CriswKr_.js → PkToolShowSources-BJd4zYAY.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSources-CriswKr_.js.map → PkToolShowSources-BJd4zYAY.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-FSWM5MOl.js → PkToolShowVideo-DgkpZriW.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-FSWM5MOl.js.map → PkToolShowVideo-DgkpZriW.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-CPhm2ba3.js → PkToolShowWebPages-DQr3SEGC.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-CPhm2ba3.js.map → PkToolShowWebPages-DQr3SEGC.js.map} +1 -1
- package/dist-vue/_chunks/{utils-BgvjC1Pu.js → utils-DmBnucJs.js} +129 -92
- package/dist-vue/_chunks/utils-DmBnucJs.js.map +1 -0
- package/dist-vue/composables.js +1 -1
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +32 -32
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/packages/components/src/chat/PkWordPreview.d.ts +3 -1
- package/dist-vue/packages/components/src/chat/PkWordPreviewBlock.d.ts +9 -3
- package/dist-vue/packages/components/src/chat/PkWordPreviewPart.d.ts +20 -0
- package/dist-vue/packages/components/src/chat/PkWordPreviewRuns.d.ts +12 -3
- package/dist-vue/packages/components/src/chat/useChatFilePreview.d.ts +420 -0
- package/dist-vue/packages/components/src/chat/utils.d.ts +49 -1
- package/dist-vue/packages/models/src/schema/SpreadsheetPreview.d.ts +339 -0
- package/dist-vue/packages/models/src/schema/WordPreview.d.ts +571 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/PkFilePreview-Bcdfci6i.js +0 -948
- package/dist/_chunks/PkFilePreview-Bcdfci6i.js.map +0 -1
- package/dist/_chunks/utils-B5VcWm3g.js.map +0 -1
- package/dist-vue/_chunks/PkFilePreview-BKwnNsyV.js +0 -934
- package/dist-vue/_chunks/PkFilePreview-BKwnNsyV.js.map +0 -1
- package/dist-vue/_chunks/utils-BgvjC1Pu.js.map +0 -1
|
@@ -2,20 +2,20 @@ import { A as e, E as t, S as n, n as r, v as i } from "./schemas-BO5QlXAp.js";
|
|
|
2
2
|
import { c as a } from "./Media-DylqhvaF.js";
|
|
3
3
|
import { O as o, V as s, _ as c, k as l, r as u } from "./Agent-D3US-D1x.js";
|
|
4
4
|
import { t as d } from "./VvButtonLocalized-C-vx25u4.js";
|
|
5
|
-
import { t as f } from "./PkStreamingMarkdown-
|
|
5
|
+
import { t as f } from "./PkStreamingMarkdown-QDsT-4jC.js";
|
|
6
6
|
import "./src-nb8MU1sh.js";
|
|
7
|
-
import { c as p, i as m, l as h, n as
|
|
8
|
-
import { t as
|
|
9
|
-
import { A as
|
|
10
|
-
import { t as
|
|
11
|
-
import { t as
|
|
12
|
-
import { t as
|
|
13
|
-
import { t as
|
|
14
|
-
import { t as
|
|
15
|
-
import { n as
|
|
16
|
-
import { t as
|
|
17
|
-
import { VvButtonGroup as
|
|
18
|
-
import { Fragment as
|
|
7
|
+
import { c as p, i as m, l as h, n as g, o as _, s as v, t as y, u as b } from "./message-DuibQyHy.js";
|
|
8
|
+
import { t as ee } from "./PkChatbotAudioTranscript-SSTh074Z.js";
|
|
9
|
+
import { A as x, D as S, F as te, N as ne, O as C, T as re, _ as ie, b as ae, c as oe, g as se, j as ce, l as le, m as w, n as ue, p as de, r as fe, t as T, v as pe, w as me, y as he } from "./utils-DmBnucJs.js";
|
|
10
|
+
import { t as ge } from "./PkChatbotError-BS84xuiu.js";
|
|
11
|
+
import { t as _e } from "./PkRelativeTime-CZF5CYHv.js";
|
|
12
|
+
import { t as ve } from "./PkChatbotFilePreview-KxVpL0UT.js";
|
|
13
|
+
import { t as ye } from "./PkChatbotFeedbackForm-Bh3tvNUW.js";
|
|
14
|
+
import { t as be } from "./PkChatbotMessageFeedback-DltXugdR.js";
|
|
15
|
+
import { n as xe, t as Se } from "./PkChatbotSteps-Dd62GEXJ.js";
|
|
16
|
+
import { t as Ce } from "./PkChatbotOutlineRail-BI-DMvZi.js";
|
|
17
|
+
import { VvButtonGroup as we, VvIcon as Te } from "@volverjs/ui-vue/components";
|
|
18
|
+
import { Fragment as E, Transition as D, computed as O, createBlock as k, createCommentVNode as A, createElementBlock as j, createElementVNode as M, createTextVNode as Ee, createVNode as N, defineAsyncComponent as P, defineComponent as De, inject as Oe, mergeProps as ke, nextTick as F, normalizeClass as I, normalizeStyle as Ae, onBeforeUnmount as je, onMounted as Me, openBlock as L, ref as Ne, renderList as Pe, renderSlot as Fe, resolveDynamicComponent as Ie, shallowRef as Le, toDisplayString as R, unref as z, useSlots as Re, useTemplateRef as ze, watch as B, withCtx as V, withModifiers as H } from "vue";
|
|
19
19
|
import { useI18n as Be } from "vue-i18n";
|
|
20
20
|
import { useResizeObserver as Ve } from "@vueuse/core";
|
|
21
21
|
// ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/iso.js
|
|
@@ -32,66 +32,66 @@ var Ue = i({
|
|
|
32
32
|
reason: n()
|
|
33
33
|
});
|
|
34
34
|
i({ pendingWakeup: Ue.nullable() }), i({ wakeId: t() });
|
|
35
|
-
var
|
|
35
|
+
var We = (e) => e?.role === "user" && !!e.metadata?.wakeup, Ge = /* @__PURE__ */ new Set([
|
|
36
36
|
"input-streaming",
|
|
37
37
|
"input-available",
|
|
38
38
|
"approval-requested"
|
|
39
|
-
]),
|
|
39
|
+
]), Ke = /* @__PURE__ */ new Set([
|
|
40
40
|
...l,
|
|
41
41
|
...o,
|
|
42
42
|
...c
|
|
43
43
|
]);
|
|
44
44
|
[...o, u.ShowContactForm];
|
|
45
|
-
var
|
|
45
|
+
var U = (e) => e.state, qe = (e) => e.type.startsWith("tool-") ? e.type.slice(5) : void 0, Je = (e) => e?.role === "assistant" && e.parts.some((e) => {
|
|
46
46
|
if (e.type === "text") return e.text.trim().length > 0;
|
|
47
47
|
if (e.type === "file") return !0;
|
|
48
|
-
let t =
|
|
49
|
-
if (t &&
|
|
50
|
-
let n =
|
|
51
|
-
return n !== void 0 &&
|
|
52
|
-
}),
|
|
53
|
-
if (e?.role !== "assistant" ||
|
|
48
|
+
let t = U(e);
|
|
49
|
+
if (t && Ge.has(t)) return !0;
|
|
50
|
+
let n = qe(e);
|
|
51
|
+
return n !== void 0 && Ke.has(n) && t === "output-available";
|
|
52
|
+
}), Ye = (e) => {
|
|
53
|
+
if (e?.role !== "assistant" || Je(e)) return !1;
|
|
54
54
|
let t = !1;
|
|
55
|
-
for (let n of e.parts) n.type === "tool-scheduleWakeup" && (t =
|
|
55
|
+
for (let n of e.parts) n.type === "tool-scheduleWakeup" && (t = U(n) === "output-available" && n.input?.noop === !0);
|
|
56
56
|
return t;
|
|
57
|
-
}, Ye = {
|
|
58
|
-
requestOAuthConnection: N(() => import("./PkToolRequestOAuthConnection-C9_w8V0T.js")),
|
|
59
|
-
shareDocument: N(() => import("./PkToolShareDocument-CsS5OTDj.js").then((e) => e.n)),
|
|
60
|
-
showArtifact: N(() => import("./PkToolShowArtifact-Bh-jIo0V.js").then((e) => e.n)),
|
|
61
|
-
showCalendarEvent: N(() => import("./PkToolShowCalendarEvent-BsAOYLjp.js").then((e) => e.n)),
|
|
62
|
-
showComparison: N(() => import("./PkToolShowComparison-BEHyRNXE.js").then((e) => e.n)),
|
|
63
|
-
showContactForm: N(() => import("./PkToolShowContactForm-BjfRuNuj.js").then((e) => e.n)),
|
|
64
|
-
showDiagram: N(() => import("./PkToolShowDiagram-_NnrFDGT.js")),
|
|
65
|
-
showEmail: N(() => import("./PkToolShowEmail-BehvoNsz.js").then((e) => e.n)),
|
|
66
|
-
showImageGallery: N(() => import("./PkToolShowImageGallery-DM5AJNZ3.js").then((e) => e.n)),
|
|
67
|
-
showLocation: N(() => import("./PkToolShowLocation-DAQEuCuQ.js").then((e) => e.n)),
|
|
68
|
-
showMessage: N(() => import("./PkToolShowMessage-Cca7K7GQ.js").then((e) => e.n)),
|
|
69
|
-
showForm: N(() => import("./PkToolShowForm-AqEY4_do.js").then((e) => e.n)),
|
|
70
|
-
showMultipleChoice: N(() => import("./PkToolShowForm-AqEY4_do.js").then((e) => e.n)),
|
|
71
|
-
showProductList: N(() => import("./PkToolShowProductList-CAV8be9a.js").then((e) => e.n)),
|
|
72
|
-
showQrCode: N(() => import("./PkToolShowQrCode-skWaARYV.js").then((e) => e.n)),
|
|
73
|
-
showSources: N(() => import("./PkToolShowSources-CriswKr_.js").then((e) => e.n)),
|
|
74
|
-
showSuggestedReply: N(() => import("./PkToolShowSuggestedReply-Bb7Inxa4.js").then((e) => e.n)),
|
|
75
|
-
showVideo: N(() => import("./PkToolShowVideo-FSWM5MOl.js")),
|
|
76
|
-
showWeather: N(() => import("./PkToolShowWeather-BC-Rx-sI.js")),
|
|
77
|
-
showWebPages: N(() => import("./PkToolShowWebPages-CPhm2ba3.js").then((e) => e.n))
|
|
78
57
|
}, Xe = {
|
|
58
|
+
requestOAuthConnection: P(() => import("./PkToolRequestOAuthConnection-C9_w8V0T.js")),
|
|
59
|
+
shareDocument: P(() => import("./PkToolShareDocument-CsS5OTDj.js").then((e) => e.n)),
|
|
60
|
+
showArtifact: P(() => import("./PkToolShowArtifact-ldnH-U3h.js").then((e) => e.n)),
|
|
61
|
+
showCalendarEvent: P(() => import("./PkToolShowCalendarEvent-BsAOYLjp.js").then((e) => e.n)),
|
|
62
|
+
showComparison: P(() => import("./PkToolShowComparison-BEHyRNXE.js").then((e) => e.n)),
|
|
63
|
+
showContactForm: P(() => import("./PkToolShowContactForm-4hISKYqb.js").then((e) => e.n)),
|
|
64
|
+
showDiagram: P(() => import("./PkToolShowDiagram-uHFCQ0FJ.js")),
|
|
65
|
+
showEmail: P(() => import("./PkToolShowEmail-BehvoNsz.js").then((e) => e.n)),
|
|
66
|
+
showImageGallery: P(() => import("./PkToolShowImageGallery-CEzeXupr.js").then((e) => e.n)),
|
|
67
|
+
showLocation: P(() => import("./PkToolShowLocation-DAQEuCuQ.js").then((e) => e.n)),
|
|
68
|
+
showMessage: P(() => import("./PkToolShowMessage-Cca7K7GQ.js").then((e) => e.n)),
|
|
69
|
+
showForm: P(() => import("./PkToolShowForm-DiUz5_Ct.js").then((e) => e.n)),
|
|
70
|
+
showMultipleChoice: P(() => import("./PkToolShowForm-DiUz5_Ct.js").then((e) => e.n)),
|
|
71
|
+
showProductList: P(() => import("./PkToolShowProductList-h4Dqvk1V.js").then((e) => e.n)),
|
|
72
|
+
showQrCode: P(() => import("./PkToolShowQrCode-skWaARYV.js").then((e) => e.n)),
|
|
73
|
+
showSources: P(() => import("./PkToolShowSources-BJd4zYAY.js").then((e) => e.n)),
|
|
74
|
+
showSuggestedReply: P(() => import("./PkToolShowSuggestedReply-Bb7Inxa4.js").then((e) => e.n)),
|
|
75
|
+
showVideo: P(() => import("./PkToolShowVideo-DgkpZriW.js")),
|
|
76
|
+
showWeather: P(() => import("./PkToolShowWeather-BC-Rx-sI.js")),
|
|
77
|
+
showWebPages: P(() => import("./PkToolShowWebPages-DQr3SEGC.js").then((e) => e.n))
|
|
78
|
+
}, Ze = {
|
|
79
79
|
key: 0,
|
|
80
80
|
class: "text-12 text-word-3 m-0 mb-xs"
|
|
81
|
-
},
|
|
81
|
+
}, Qe = /* @__PURE__ */ De({
|
|
82
82
|
__name: "PkToolApprovalPreviewMessage",
|
|
83
83
|
props: { input: {} },
|
|
84
84
|
setup(e) {
|
|
85
|
-
let t = e, n =
|
|
85
|
+
let t = e, n = O(() => {
|
|
86
86
|
let e = t.input;
|
|
87
87
|
return typeof e?.message == "string" ? e.message : "";
|
|
88
88
|
});
|
|
89
|
-
return (e, t) => n.value ? (L(),
|
|
89
|
+
return (e, t) => n.value ? (L(), j("p", Ze, R(n.value), 1)) : A("", !0);
|
|
90
90
|
}
|
|
91
|
-
}),
|
|
91
|
+
}), W = { [T]: Qe }, G = {
|
|
92
92
|
key: 0,
|
|
93
93
|
class: "text-12 text-word-3 m-0 mb-xs"
|
|
94
|
-
},
|
|
94
|
+
}, $e = /* @__PURE__ */ De({
|
|
95
95
|
__name: "PkToolApprovalCard",
|
|
96
96
|
props: {
|
|
97
97
|
part: {},
|
|
@@ -100,10 +100,10 @@ var W = (e) => e.state, Ke = (e) => e.type.startsWith("tool-") ? e.type.slice(5)
|
|
|
100
100
|
},
|
|
101
101
|
emits: ["respond"],
|
|
102
102
|
setup(e, { emit: t }) {
|
|
103
|
-
let n = e, r = t, { t: i, te: a } = Be({ useScope: "global" }), o =
|
|
103
|
+
let n = e, r = t, { t: i, te: a } = Be({ useScope: "global" }), o = O(() => n.part), c = O(() => m(n.part)), l = O(() => c.value === T), u = O(() => l.value ? (o.value.state === "input-available" || s(o.value.output)) && n.callVerdict === void 0 : o.value.state === "approval-requested"), f = O(() => u.value && n.actionable === !0), p = O(() => u.value && n.actionable !== !0), h = O(() => l.value ? o.value.output === "confirmed" || n.callVerdict === !0 : o.value.approval?.approved === !0), g = O(() => l.value ? o.value.output === "cancelled" || n.callVerdict === !1 : o.value.approval?.approved === !1 || o.value.state === "output-denied"), _ = O(() => W[c.value]), v = O(() => _.value ? i("toolApproval.prompt") : i("toolApproval.promptNamed", { tool: te(c.value, {
|
|
104
104
|
t: i,
|
|
105
105
|
te: a
|
|
106
|
-
}) })),
|
|
106
|
+
}) })), y = O(() => {
|
|
107
107
|
if (p.value) return {
|
|
108
108
|
icon: "ri:time-line",
|
|
109
109
|
message: i("toolApproval.expired")
|
|
@@ -112,38 +112,38 @@ var W = (e) => e.state, Ke = (e) => e.type.startsWith("tool-") ? e.type.slice(5)
|
|
|
112
112
|
icon: "ri:check-line",
|
|
113
113
|
message: i(l.value ? "toolApproval.confirmed" : "toolApproval.approved")
|
|
114
114
|
};
|
|
115
|
-
if (
|
|
115
|
+
if (g.value) return {
|
|
116
116
|
icon: "ri:close-line",
|
|
117
117
|
message: i(l.value ? "toolApproval.cancelled" : "toolApproval.denied")
|
|
118
118
|
};
|
|
119
|
-
}),
|
|
119
|
+
}), b = O(() => !!y.value && !_.value);
|
|
120
120
|
return (t, n) => {
|
|
121
|
-
let a = d, s =
|
|
122
|
-
return L(),
|
|
123
|
-
|
|
124
|
-
default: V(() => [!l.value && u.value ? (L(),
|
|
121
|
+
let a = d, s = we, c = Te;
|
|
122
|
+
return L(), j("div", { class: I(["w-full overflow-hidden transition-all duration-300", { "bg-surface p-sm rounded-xl border border-surface-3": !b.value }]) }, [
|
|
123
|
+
N(D, null, {
|
|
124
|
+
default: V(() => [!l.value && u.value ? (L(), j("p", G, R(v.value), 1)) : A("", !0)]),
|
|
125
125
|
_: 1
|
|
126
126
|
}),
|
|
127
|
-
|
|
127
|
+
_.value ? (L(), k(Ie(_.value), {
|
|
128
128
|
key: 0,
|
|
129
129
|
part: e.part,
|
|
130
130
|
input: o.value.input
|
|
131
|
-
}, null, 8, ["part", "input"])) :
|
|
132
|
-
|
|
133
|
-
default: V(() => [
|
|
131
|
+
}, null, 8, ["part", "input"])) : A("", !0),
|
|
132
|
+
N(D, { mode: "out-in" }, {
|
|
133
|
+
default: V(() => [y.value ? (L(), j("p", {
|
|
134
134
|
key: 1,
|
|
135
|
-
class: I(["flex items-center gap-4 text-12 text-word-3 m-0", { "mt-xs":
|
|
136
|
-
}, [
|
|
137
|
-
name:
|
|
135
|
+
class: I(["flex items-center gap-4 text-12 text-word-3 m-0", { "mt-xs": _.value }])
|
|
136
|
+
}, [N(c, {
|
|
137
|
+
name: y.value.icon,
|
|
138
138
|
class: "shrink-0"
|
|
139
|
-
}, null, 8, ["name"]),
|
|
140
|
-
default: V(() => [
|
|
139
|
+
}, null, 8, ["name"]), Ee(" " + R(y.value.message), 1)], 2)) : (L(), k(s, { key: 0 }, {
|
|
140
|
+
default: V(() => [N(a, {
|
|
141
141
|
modifiers: "primary-small",
|
|
142
142
|
disabled: !f.value,
|
|
143
143
|
icon: "ri:check-line",
|
|
144
144
|
label: z(i)("action.proceed"),
|
|
145
145
|
onClick: n[0] ||= H((e) => r("respond", !0), ["stop"])
|
|
146
|
-
}, null, 8, ["disabled", "label"]),
|
|
146
|
+
}, null, 8, ["disabled", "label"]), N(a, {
|
|
147
147
|
modifiers: "action-quiet-small",
|
|
148
148
|
disabled: !f.value,
|
|
149
149
|
icon: "ri:close-line",
|
|
@@ -157,13 +157,13 @@ var W = (e) => e.state, Ke = (e) => e.type.startsWith("tool-") ? e.type.slice(5)
|
|
|
157
157
|
], 2);
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
|
-
}),
|
|
160
|
+
}), et = { 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" }, tt = {
|
|
161
161
|
key: 0,
|
|
162
162
|
class: "pk-host-call-confirm-card__details text-14 m-0 mb-xs"
|
|
163
|
-
},
|
|
163
|
+
}, nt = {
|
|
164
164
|
key: 0,
|
|
165
165
|
class: "text-word-3 truncate"
|
|
166
|
-
},
|
|
166
|
+
}, rt = /* @__PURE__ */ De({
|
|
167
167
|
__name: "PkHostCallConfirmCard",
|
|
168
168
|
props: {
|
|
169
169
|
question: {},
|
|
@@ -173,17 +173,17 @@ var W = (e) => e.state, Ke = (e) => e.type.startsWith("tool-") ? e.type.slice(5)
|
|
|
173
173
|
setup(e, { emit: t }) {
|
|
174
174
|
let n = t;
|
|
175
175
|
return (t, r) => {
|
|
176
|
-
let i = d, a =
|
|
177
|
-
return L(),
|
|
178
|
-
|
|
179
|
-
e.details?.length ? (L(),
|
|
180
|
-
|
|
181
|
-
default: V(() => [
|
|
176
|
+
let i = d, a = we;
|
|
177
|
+
return L(), j("div", et, [
|
|
178
|
+
M("p", K, R(e.question), 1),
|
|
179
|
+
e.details?.length ? (L(), j("dl", tt, [(L(!0), j(E, null, Pe(e.details, (e, t) => (L(), j(E, { key: t }, [e.label ? (L(), j("dt", nt, R(e.label), 1)) : A("", !0), M("dd", { class: I(["text-word-1 m-0 truncate", { "pk-host-call-confirm-card__alone": !e.label }]) }, R(e.value), 3)], 64))), 128))])) : A("", !0),
|
|
180
|
+
N(a, null, {
|
|
181
|
+
default: V(() => [N(i, {
|
|
182
182
|
modifiers: "primary-small",
|
|
183
183
|
icon: "ri:check-line",
|
|
184
184
|
label: t.$t("action.proceed"),
|
|
185
185
|
onClick: r[0] ||= H((e) => n("respond", !0), ["stop"])
|
|
186
|
-
}, null, 8, ["label"]),
|
|
186
|
+
}, null, 8, ["label"]), N(i, {
|
|
187
187
|
modifiers: "action-quiet-small",
|
|
188
188
|
icon: "ri:close-line",
|
|
189
189
|
label: t.$t("action.cancel"),
|
|
@@ -194,85 +194,85 @@ var W = (e) => e.state, Ke = (e) => e.type.startsWith("tool-") ? e.type.slice(5)
|
|
|
194
194
|
]);
|
|
195
195
|
};
|
|
196
196
|
}
|
|
197
|
-
}),
|
|
198
|
-
function
|
|
199
|
-
let { scrollEl: t, status: n, messagesLength: r, lastMessageRole: i, contentEl: a, beforeNewMessageScroll: o, onScrollUp: s, onScrollDown: c } = e, l = Ne(!1), u = Ne(!0), d = !1, f = null, p = null, m = null, h = null,
|
|
197
|
+
}), it = 30, q = 500;
|
|
198
|
+
function at(e) {
|
|
199
|
+
let { scrollEl: t, status: n, messagesLength: r, lastMessageRole: i, contentEl: a, beforeNewMessageScroll: o, onScrollUp: s, onScrollDown: c } = e, l = Ne(!1), u = Ne(!0), d = !1, f = null, p = null, m = null, h = null, g = 0, _ = (e = "smooth") => {
|
|
200
200
|
!t.value || l.value ? d = !1 : (d = !0, t.value.scrollTo({
|
|
201
201
|
top: t.value.scrollHeight,
|
|
202
202
|
behavior: e
|
|
203
203
|
}), setTimeout(() => {
|
|
204
204
|
d = !1;
|
|
205
|
-
}, e === "instant" ? 0 :
|
|
206
|
-
},
|
|
205
|
+
}, e === "instant" ? 0 : q));
|
|
206
|
+
}, v = (e) => {
|
|
207
207
|
e.deltaY < 0 && (l.value = !0);
|
|
208
|
-
},
|
|
209
|
-
|
|
210
|
-
},
|
|
208
|
+
}, y = 0, b = (e) => {
|
|
209
|
+
y = e.touches[0]?.clientY ?? 0;
|
|
210
|
+
}, ee = (e) => {
|
|
211
211
|
let t = e.touches[0]?.clientY ?? 0;
|
|
212
|
-
t >
|
|
213
|
-
},
|
|
212
|
+
t > y && (l.value = !0), y = t;
|
|
213
|
+
}, x = () => {
|
|
214
214
|
if (!t.value) return;
|
|
215
215
|
let { scrollTop: e, scrollHeight: n, clientHeight: r } = t.value;
|
|
216
|
-
u.value = n - r - e <
|
|
217
|
-
},
|
|
216
|
+
u.value = n - r - e < it, d || (e < g && s?.(), e > g && (u.value && (l.value = !1), c?.())), g = e;
|
|
217
|
+
}, S = () => {
|
|
218
218
|
if (d || l.value || !t.value) return;
|
|
219
219
|
let e = t.value, n = e.scrollHeight - e.clientHeight;
|
|
220
220
|
n <= e.scrollTop || (u.value = !0, d = !0, e.scrollTop = n, requestAnimationFrame(() => {
|
|
221
221
|
d = !1;
|
|
222
222
|
}));
|
|
223
|
-
},
|
|
224
|
-
!f && t.value && (f = new MutationObserver(
|
|
223
|
+
}, te = () => {
|
|
224
|
+
!f && t.value && (f = new MutationObserver(S), f.observe(t.value, {
|
|
225
225
|
childList: !0,
|
|
226
226
|
subtree: !0,
|
|
227
227
|
characterData: !0
|
|
228
228
|
}));
|
|
229
|
-
},
|
|
229
|
+
}, ne = () => {
|
|
230
230
|
f?.disconnect(), f = null;
|
|
231
231
|
};
|
|
232
232
|
B(n, (e, t) => {
|
|
233
|
-
e === "streaming" || e === "submitted" ?
|
|
233
|
+
e === "streaming" || e === "submitted" ? te() : (e !== "ready" || t !== "streaming") && ne();
|
|
234
234
|
}), B(r, async () => {
|
|
235
235
|
if (r() && i() !== "assistant") {
|
|
236
|
-
|
|
236
|
+
ie(), l.value = !1, d = !0;
|
|
237
237
|
try {
|
|
238
238
|
await F(), await o?.(), await F();
|
|
239
239
|
} finally {
|
|
240
|
-
|
|
240
|
+
_();
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
});
|
|
244
|
-
let
|
|
245
|
-
t.value && (t.value.scrollHeight <= t.value.clientHeight || (t.value.scrollTop = t.value.scrollHeight,
|
|
246
|
-
},
|
|
247
|
-
p?.disconnect(), p = null, m?.disconnect(), m = null,
|
|
244
|
+
let C = null, re = () => {
|
|
245
|
+
t.value && (t.value.scrollHeight <= t.value.clientHeight || (t.value.scrollTop = t.value.scrollHeight, C && clearTimeout(C), C = setTimeout(ie, 300)));
|
|
246
|
+
}, ie = () => {
|
|
247
|
+
p?.disconnect(), p = null, m?.disconnect(), m = null, C &&= (clearTimeout(C), null);
|
|
248
248
|
};
|
|
249
249
|
return Me(() => {
|
|
250
250
|
if (!t.value) return;
|
|
251
|
-
t.value.addEventListener("wheel",
|
|
251
|
+
t.value.addEventListener("wheel", v, { passive: !0 }), t.value.addEventListener("touchstart", b, { passive: !0 }), t.value.addEventListener("touchmove", ee, { passive: !0 });
|
|
252
252
|
let e = n() === "submitted" || n() === "streaming";
|
|
253
|
-
e ?
|
|
253
|
+
e ? te() : (p = new ResizeObserver(re), p.observe(t.value), m = new MutationObserver(re), m.observe(t.value, {
|
|
254
254
|
childList: !0,
|
|
255
255
|
subtree: !0
|
|
256
256
|
}));
|
|
257
257
|
let r = a?.() ?? t.value.firstElementChild;
|
|
258
|
-
r && (h = new ResizeObserver(
|
|
258
|
+
r && (h = new ResizeObserver(S), h.observe(r)), e || re();
|
|
259
259
|
}), je(() => {
|
|
260
|
-
t.value?.removeEventListener("wheel",
|
|
260
|
+
t.value?.removeEventListener("wheel", v), t.value?.removeEventListener("touchstart", b), t.value?.removeEventListener("touchmove", ee), h?.disconnect(), h = null, ne(), ie();
|
|
261
261
|
}), {
|
|
262
|
-
handleScroll:
|
|
263
|
-
scrollToBottom:
|
|
262
|
+
handleScroll: x,
|
|
263
|
+
scrollToBottom: _,
|
|
264
264
|
userScrolledUp: l,
|
|
265
265
|
isAtBottom: u
|
|
266
266
|
};
|
|
267
267
|
}
|
|
268
268
|
// ../../packages/components/src/chat/wakeupFeed.ts
|
|
269
|
-
function
|
|
270
|
-
let n = (e) =>
|
|
269
|
+
function ot(e, t = () => !1) {
|
|
270
|
+
let n = (e) => Ye(e) && !t(e), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map(), a = 0;
|
|
271
271
|
for (; a < e.length;) {
|
|
272
272
|
let t = e[a];
|
|
273
|
-
if (
|
|
273
|
+
if (We(t) && n(e[a + 1])) {
|
|
274
274
|
let o = t.id, s = 0, c;
|
|
275
|
-
for (;
|
|
275
|
+
for (; We(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;
|
|
276
276
|
i.set(o, {
|
|
277
277
|
count: s,
|
|
278
278
|
lastAt: c
|
|
@@ -285,46 +285,46 @@ function at(e, t = () => !1) {
|
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
287
|
// ../../packages/components/src/chat/PkChatbotMessages.vue?vue&type=script&setup=true&lang.ts
|
|
288
|
-
var
|
|
288
|
+
var st = ["aria-busy"], ct = {
|
|
289
289
|
key: 0,
|
|
290
290
|
class: "pk-chatbot-messages__outline"
|
|
291
|
-
},
|
|
291
|
+
}, lt = {
|
|
292
292
|
key: 0,
|
|
293
293
|
class: "pk-chatbot-divider vv-separator"
|
|
294
|
-
},
|
|
294
|
+
}, ut = { class: "pk-chatbot-divider__label" }, dt = {
|
|
295
295
|
key: 1,
|
|
296
296
|
class: "pk-chatbot-wakeup"
|
|
297
|
-
},
|
|
297
|
+
}, ft = ["title"], pt = { class: "pk-chatbot-message__text" }, mt = ["title"], ht = {
|
|
298
298
|
key: 0,
|
|
299
299
|
class: "pk-chatbot-message__reaction-emoji"
|
|
300
|
-
},
|
|
300
|
+
}, gt = {
|
|
301
301
|
key: 0,
|
|
302
302
|
class: "flex flex-col items-end gap-8 w-full"
|
|
303
|
-
},
|
|
303
|
+
}, _t = { class: "pk-chatbot-message__host-call" }, vt = { class: "pk-chatbot-message__host-call-label" }, yt = {
|
|
304
304
|
key: 0,
|
|
305
305
|
class: "pk-chatbot-message__host-call-outcome"
|
|
306
|
-
},
|
|
306
|
+
}, bt = {
|
|
307
307
|
key: 0,
|
|
308
308
|
class: "pk-chatbot-message__loading-info"
|
|
309
|
-
},
|
|
309
|
+
}, xt = { class: "flex gap-8 items-center" }, St = { class: "text-12" }, Ct = ["title"], wt = { class: "pk-chatbot-message__pointer-label" }, Tt = { class: "flex gap-8 items-center" }, Et = {
|
|
310
310
|
key: 0,
|
|
311
311
|
class: "pk-chatbot-message__footer"
|
|
312
|
-
},
|
|
312
|
+
}, Dt = {
|
|
313
313
|
key: 0,
|
|
314
314
|
class: "pk-chatbot-message__hover-meta"
|
|
315
|
-
},
|
|
315
|
+
}, Ot = ["datetime", "title"], kt = { class: "truncate" }, At = {
|
|
316
316
|
key: 0,
|
|
317
317
|
class: "flex items-center gap-4 min-w-0"
|
|
318
|
-
},
|
|
318
|
+
}, jt = { class: "truncate" }, Mt = ["title"], Nt = {
|
|
319
319
|
key: 2,
|
|
320
320
|
class: "flex items-center gap-4 text-12 text-word-3"
|
|
321
|
-
},
|
|
321
|
+
}, Pt = { class: "truncate" }, Ft = ["datetime"], It = { class: "truncate" }, Lt = {
|
|
322
322
|
key: 4,
|
|
323
323
|
class: "flex items-center gap-4 text-12 text-word-3"
|
|
324
|
-
},
|
|
324
|
+
}, Rt = { class: "pk-chatbot-message__loading-info" }, zt = { class: "flex gap-8 items-center" }, Bt = { class: "text-12" }, Vt = {
|
|
325
325
|
key: 0,
|
|
326
326
|
class: "pk-chatbot-message pk-chatbot-message--assistant"
|
|
327
|
-
},
|
|
327
|
+
}, Ht = ["title", "aria-label"], J = /* @__PURE__ */ De({
|
|
328
328
|
__name: "PkChatbotMessages",
|
|
329
329
|
props: {
|
|
330
330
|
status: {},
|
|
@@ -374,8 +374,8 @@ var ot = ["aria-busy"], st = {
|
|
|
374
374
|
"host-confirm-respond"
|
|
375
375
|
],
|
|
376
376
|
setup(e, { emit: t }) {
|
|
377
|
-
let n = e, r = t, { t: i, te: o, d: s, n: c } = Be({ useScope: "global" }), l = Oe(
|
|
378
|
-
if (
|
|
377
|
+
let n = e, r = t, { t: i, te: o, d: s, n: c } = Be({ useScope: "global" }), l = Oe(ue, void 0), u = Re(), te = (e, t) => {
|
|
378
|
+
if (C(e)) {
|
|
379
379
|
let n = e.toolCallId;
|
|
380
380
|
n && r("confirm-respond", {
|
|
381
381
|
toolCallId: n,
|
|
@@ -383,66 +383,66 @@ var ot = ["aria-busy"], st = {
|
|
|
383
383
|
});
|
|
384
384
|
return;
|
|
385
385
|
}
|
|
386
|
-
let n =
|
|
386
|
+
let n = he(e);
|
|
387
387
|
n && r("approval-respond", {
|
|
388
388
|
id: n,
|
|
389
389
|
approved: t
|
|
390
390
|
});
|
|
391
|
-
},
|
|
392
|
-
scrollEl:
|
|
391
|
+
}, T = ze("scrollEl"), P = ze("wrapperEl"), De = O(() => ne(n.textColor, n.mainColor)), { handleScroll: je, scrollToBottom: He, userScrolledUp: Ue, isAtBottom: Ge } = at({
|
|
392
|
+
scrollEl: T,
|
|
393
393
|
status: () => n.status,
|
|
394
394
|
messagesLength: () => n.messages?.length,
|
|
395
395
|
lastMessageRole: () => n.messages?.[n.messages.length - 1]?.role,
|
|
396
|
-
contentEl: () =>
|
|
397
|
-
beforeNewMessageScroll: () =>
|
|
396
|
+
contentEl: () => P.value,
|
|
397
|
+
beforeNewMessageScroll: () => q(),
|
|
398
398
|
onScrollUp: () => r("scroll-up"),
|
|
399
399
|
onScrollDown: () => r("scroll-down")
|
|
400
|
-
}),
|
|
400
|
+
}), Ke = () => {
|
|
401
401
|
Ue.value = !1, He();
|
|
402
|
-
},
|
|
402
|
+
}, U = O(() => (n.messages ?? []).filter((e) => e.role === "user" && !We(e)).map((e) => ({
|
|
403
403
|
id: e.id,
|
|
404
404
|
preview: e.parts.find(h)?.text.trim().slice(0, 120) || "…"
|
|
405
|
-
}))),
|
|
406
|
-
let e =
|
|
405
|
+
}))), qe = Ne(), Je = () => T.value?.querySelectorAll(".pk-chatbot-message--user") ?? [], Ye = () => {
|
|
406
|
+
let e = T.value;
|
|
407
407
|
if (!e || !n.showScrollToBottom) return;
|
|
408
|
-
let t = e.getBoundingClientRect().top + e.clientHeight / 2, r =
|
|
409
|
-
|
|
410
|
-
e.getBoundingClientRect().top <= t && (r =
|
|
411
|
-
}),
|
|
408
|
+
let t = e.getBoundingClientRect().top + e.clientHeight / 2, r = U.value[0]?.id;
|
|
409
|
+
Je().forEach((e, n) => {
|
|
410
|
+
e.getBoundingClientRect().top <= t && (r = U.value[n]?.id);
|
|
411
|
+
}), qe.value = r;
|
|
412
412
|
};
|
|
413
|
-
B(
|
|
414
|
-
await F(),
|
|
413
|
+
B(U, async () => {
|
|
414
|
+
await F(), Ye();
|
|
415
415
|
});
|
|
416
|
-
let
|
|
417
|
-
je(),
|
|
418
|
-
},
|
|
419
|
-
let t =
|
|
416
|
+
let Ze = () => {
|
|
417
|
+
je(), Ye();
|
|
418
|
+
}, Qe = (e) => {
|
|
419
|
+
let t = T.value, n = U.value.findIndex((t) => t.id === e), r = Je()[n];
|
|
420
420
|
t && r && (Ue.value = !0, t.scrollTo({
|
|
421
421
|
top: t.scrollTop + r.getBoundingClientRect().top - t.getBoundingClientRect().top - Number.parseFloat(getComputedStyle(t).paddingTop),
|
|
422
422
|
behavior: "smooth"
|
|
423
423
|
}));
|
|
424
|
-
},
|
|
425
|
-
|
|
426
|
-
},
|
|
424
|
+
}, W = O(() => n.status === "submitted" || n.status === "streaming" || n.hostWorking === !0), G = Ne(0), et = Ne(!1), K = !1, tt = Le(), nt = () => n.messages?.[n.messages.length - 1]?.role === "user" || W.value, it = () => {
|
|
425
|
+
K = !1, et.value = !0, G.value = 0;
|
|
426
|
+
}, q = async () => {
|
|
427
427
|
if (!n.messages?.length || n.disableHeightAdjustment) return;
|
|
428
|
-
if (!
|
|
429
|
-
|
|
428
|
+
if (!nt()) {
|
|
429
|
+
K && (await F(), T.value?.scrollHeight, nt() || it());
|
|
430
430
|
return;
|
|
431
431
|
}
|
|
432
|
-
if (
|
|
433
|
-
let { paddingTop: e, paddingBottom: t } = getComputedStyle(
|
|
434
|
-
|
|
435
|
-
let o = r - (
|
|
436
|
-
r > 0 && (
|
|
432
|
+
if (K = !0, et.value = !1, await F(), !T.value) return;
|
|
433
|
+
let { paddingTop: e, paddingBottom: t } = getComputedStyle(T.value), r = T.value.clientHeight - Number.parseFloat(e) - Number.parseFloat(t), i = P.value && Number.parseFloat(getComputedStyle(P.value).rowGap) || 0, a = Je();
|
|
434
|
+
tt.value = a[a.length - 1];
|
|
435
|
+
let o = r - (tt.value?.clientHeight ?? 0) - i;
|
|
436
|
+
r > 0 && (G.value = Math.max(o, 0)), await F();
|
|
437
437
|
};
|
|
438
|
-
B([() => n.messages?.length, () => n.messages?.[n.messages.length - 1]?.id], () =>
|
|
439
|
-
|
|
438
|
+
B([() => n.messages?.length, () => n.messages?.[n.messages.length - 1]?.id], () => q()), Ve([T, tt], () => {
|
|
439
|
+
K && q();
|
|
440
440
|
}), Me(() => {
|
|
441
|
-
(
|
|
442
|
-
}), B(
|
|
443
|
-
e ||
|
|
441
|
+
(W.value || n.awaitingSpokenAnswer) && q();
|
|
442
|
+
}), B(W, (e) => {
|
|
443
|
+
e || it();
|
|
444
444
|
});
|
|
445
|
-
let
|
|
445
|
+
let J = (e) => n.revisedAnswers?.some((t) => t.messageId === e), Y = (e) => n.messageFeedbacks?.find((t) => t.messageId === e), Ut = /* @__PURE__ */ new Set([
|
|
446
446
|
"showContactForm",
|
|
447
447
|
"showForm",
|
|
448
448
|
"showMultipleChoice",
|
|
@@ -469,35 +469,35 @@ var ot = ["aria-busy"], st = {
|
|
|
469
469
|
let t = nn(e);
|
|
470
470
|
for (let e = t.length - 1; e >= 0; --e) if (h(t[e])) return e;
|
|
471
471
|
return -1;
|
|
472
|
-
}, en =
|
|
472
|
+
}, en = O(() => n.messages?.[n.messages.length - 1]), X = O(() => {
|
|
473
473
|
let e = en.value;
|
|
474
474
|
return e ? e.parts[e.parts.length - 1] : null;
|
|
475
|
-
}), tn =
|
|
475
|
+
}), tn = O(() => {
|
|
476
476
|
let e = /* @__PURE__ */ new Map();
|
|
477
|
-
for (let t of n.messages ?? []) t.role === "assistant" && e.set(t.id,
|
|
477
|
+
for (let t of n.messages ?? []) t.role === "assistant" && e.set(t.id, ce(oe(x(t.parts))));
|
|
478
478
|
return e;
|
|
479
|
-
}), nn = (e) => tn.value.get(e.id) ?? e.parts, rn =
|
|
479
|
+
}), nn = (e) => tn.value.get(e.id) ?? e.parts, rn = O(() => n.status === "error"), an = O(() => n.awaitingSpokenAnswer === !0 && !W.value), on = O(() => an.value && en.value?.role === "user" && !rn.value), sn = (e, t) => t(), cn = O(() => {
|
|
480
480
|
let e = X.value;
|
|
481
|
-
return
|
|
482
|
-
}), ln =
|
|
481
|
+
return ae(i, e, l?.value);
|
|
482
|
+
}), ln = O(() => {
|
|
483
483
|
let e = X.value;
|
|
484
|
-
return
|
|
484
|
+
return se(e);
|
|
485
485
|
}), un = (e) => n.messages?.findIndex((t) => t.id === e), Z = (e) => e === void 0 || !n.messages ? !1 : e === n.messages.length - 1, dn = (e) => Z(e) && n.status === "ready" && !n.hostWorking && !!n.actions?.includes("regenerate"), fn = (e, t) => (!Z(t) || n.status === "ready" && !n.hostWorking) && !!n.actions?.includes(e), pn = (e) => {
|
|
486
486
|
let t = e.parts[e.parts.length - 1];
|
|
487
487
|
return h(t);
|
|
488
|
-
}, mn = (e) => e.parts.some((e) => p(e) ||
|
|
489
|
-
if (!
|
|
488
|
+
}, mn = (e) => e.parts.some((e) => p(e) || b(e) || !!w(e)), hn = (e) => !!n.showExtendedSteps && Q(e) && mn(e), gn = (e) => n.hostConfirmation !== void 0 && w(e) !== void 0 && e.toolCallId === n.hostConfirmation.toolCallId, _n = O(() => n.hostConfirmation !== void 0 && !n.messages?.some((e) => e.parts.some(gn))), vn = (e, t) => W.value && Z(e) && w(t)?.state === "input-available", yn = (e, t, n, r) => {
|
|
489
|
+
if (!w(n) || hn(e)) return !1;
|
|
490
490
|
let i = vn(t, n);
|
|
491
|
-
return i && r === nn(e).length - 1 ? !1 : i ||
|
|
491
|
+
return i && r === nn(e).length - 1 ? !1 : i || re(n) || !_(e);
|
|
492
492
|
}, bn = (e, t) => {
|
|
493
|
-
let n =
|
|
493
|
+
let n = w(t);
|
|
494
494
|
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" && !vn(e, t) ? i("messagePart.hostToolNoAnswer") : void 0;
|
|
495
|
-
}, xn = (e) =>
|
|
495
|
+
}, xn = (e) => b(e) && !S(e) && !!(Xe[m(e)] || u[e.type] || n.showAllMessageParts), Sn = (e) => e.parts.some((e) => h(e) && !!e.text.trim() || v(e) || me(e) && !S(e) || xn(e)), Q = (e) => e.role === "assistant", Cn = (e) => e.role === "user", wn = (e) => n.messages?.slice(0, e).reverse().find((e) => Q(e)), Tn = (e) => n.messages?.slice(e + 1).find((e) => Q(e)), En = (e) => {
|
|
496
496
|
let t = wn(e)?.metadata?.createdAt, n = Tn(e)?.metadata?.createdAt;
|
|
497
497
|
if (!t || !n) return;
|
|
498
498
|
let r = new Date(t), i = new Date(n);
|
|
499
499
|
return r.toDateString() === i.toDateString() ? void 0 : i;
|
|
500
|
-
}, $ =
|
|
500
|
+
}, $ = O(() => n.showAllMessageParts ? ot([]) : ot(n.messages ?? [], Sn)), Dn = O(() => {
|
|
501
501
|
let e = 0;
|
|
502
502
|
return (n.messages ?? []).map((t) => t.parts.length > 0 ? ++e : void 0);
|
|
503
503
|
}), On = (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), kn = (e) => {
|
|
@@ -505,7 +505,7 @@ var ot = ["aria-busy"], st = {
|
|
|
505
505
|
return s(t, n ? "time" : "date-time");
|
|
506
506
|
}, An = (e) => {
|
|
507
507
|
let { createdAt: t, completedAt: n } = e.metadata ?? {};
|
|
508
|
-
if (t && n) return
|
|
508
|
+
if (t && n) return de(c, n - t);
|
|
509
509
|
}, jn = ze("feedbackMessageEl");
|
|
510
510
|
return B(() => n.feedbackMessageId, async () => {
|
|
511
511
|
if (await F(), !n.feedbackMessageId) return;
|
|
@@ -515,63 +515,63 @@ var ot = ["aria-busy"], st = {
|
|
|
515
515
|
block: "center"
|
|
516
516
|
}));
|
|
517
517
|
}), (t, n) => {
|
|
518
|
-
let p =
|
|
519
|
-
return L(),
|
|
518
|
+
let p = Te, _ = d, b = we;
|
|
519
|
+
return L(), j("div", {
|
|
520
520
|
ref_key: "scrollEl",
|
|
521
|
-
ref:
|
|
521
|
+
ref: T,
|
|
522
522
|
class: I(["pk-chatbot-messages scrollbar-thin", {
|
|
523
|
-
"pk-chatbot-messages--settling":
|
|
523
|
+
"pk-chatbot-messages--settling": et.value,
|
|
524
524
|
"pk-chatbot-messages--parent-scrolls": e.parentScrolls
|
|
525
525
|
}]),
|
|
526
526
|
role: "log",
|
|
527
527
|
"aria-live": "polite",
|
|
528
528
|
"aria-relevant": "additions text",
|
|
529
|
-
"aria-busy":
|
|
529
|
+
"aria-busy": W.value,
|
|
530
530
|
style: Ae({
|
|
531
531
|
"--chatbot-main-color": e.mainColor,
|
|
532
|
-
"--chatbot-contrast-color":
|
|
532
|
+
"--chatbot-contrast-color": De.value
|
|
533
533
|
}),
|
|
534
|
-
onScroll:
|
|
534
|
+
onScroll: Ze
|
|
535
535
|
}, [
|
|
536
|
-
e.showScrollToBottom &&
|
|
537
|
-
items:
|
|
538
|
-
"active-id":
|
|
539
|
-
onSelect:
|
|
540
|
-
}, null, 8, ["items", "active-id"])])) :
|
|
541
|
-
|
|
536
|
+
e.showScrollToBottom && U.value.length > 1 ? (L(), j("div", ct, [N(Ce, {
|
|
537
|
+
items: U.value,
|
|
538
|
+
"active-id": qe.value,
|
|
539
|
+
onSelect: Qe
|
|
540
|
+
}, null, 8, ["items", "active-id"])])) : A("", !0),
|
|
541
|
+
M("div", {
|
|
542
542
|
ref_key: "wrapperEl",
|
|
543
|
-
ref:
|
|
543
|
+
ref: P,
|
|
544
544
|
class: "pk-chatbot-messages__wrapper"
|
|
545
545
|
}, [
|
|
546
|
-
(L(!0),
|
|
547
|
-
Cn(d) && En(
|
|
548
|
-
$.value.quietRuns.has(d.id) ? (L(),
|
|
546
|
+
(L(!0), j(E, null, Pe(e.messages, (d, x) => (L(), j(E, { key: d.id }, [
|
|
547
|
+
Cn(d) && En(x) ? (L(), j("div", lt, [M("span", ut, R(z(s)(En(x), "short")), 1)])) : A("", !0),
|
|
548
|
+
$.value.quietRuns.has(d.id) ? (L(), j("div", dt, [N(p, {
|
|
549
549
|
name: "ri:alarm-line",
|
|
550
550
|
class: "shrink-0"
|
|
551
|
-
}),
|
|
551
|
+
}), M("span", null, R(z(i)("label.wakeupQuietRun", {
|
|
552
552
|
count: $.value.quietRuns.get(d.id).count,
|
|
553
553
|
time: z(s)($.value.quietRuns.get(d.id).lastAt ?? Date.now(), "time")
|
|
554
|
-
}, $.value.quietRuns.get(d.id).count)), 1)])) : z(
|
|
554
|
+
}, $.value.quietRuns.get(d.id).count)), 1)])) : z(We)(d) && !$.value.hidden.has(d.id) && !e.showAllMessageParts ? (L(), j("div", {
|
|
555
555
|
key: 2,
|
|
556
556
|
class: "pk-chatbot-wakeup",
|
|
557
557
|
title: d.metadata?.wakeup?.reason
|
|
558
|
-
}, [
|
|
558
|
+
}, [N(p, {
|
|
559
559
|
name: "ri:alarm-line",
|
|
560
560
|
class: "shrink-0"
|
|
561
|
-
}),
|
|
562
|
-
(!z(
|
|
561
|
+
}), M("span", null, [Ee(R(z(i)("label.wakeupCheck")) + " ", 1), d.metadata?.createdAt ? (L(), j(E, { key: 0 }, [Ee(" · " + R(z(s)(d.metadata.createdAt, "time")), 1)], 64)) : A("", !0)])], 8, ft)) : A("", !0),
|
|
562
|
+
(!z(We)(d) || e.showAllMessageParts) && (!$.value.hidden.has(d.id) || W.value && Z(x)) && (d.parts.length || Z(x) && W.value && Q(d)) ? (L(), j("div", {
|
|
563
563
|
key: 3,
|
|
564
|
-
class: I(["pk-chatbot-message", [`pk-chatbot-message--${d.role}`, { "pk-chatbot-message--loading":
|
|
565
|
-
style: Ae({ minHeight: Z(
|
|
564
|
+
class: I(["pk-chatbot-message", [`pk-chatbot-message--${d.role}`, { "pk-chatbot-message--loading": W.value && Z(x) && Q(d) }]]),
|
|
565
|
+
style: Ae({ minHeight: Z(x) && Q(d) && !rn.value ? `${G.value}px` : void 0 })
|
|
566
566
|
}, [
|
|
567
|
-
|
|
567
|
+
N(D, {
|
|
568
568
|
appear: "",
|
|
569
569
|
name: "pk-chatbot-part"
|
|
570
570
|
}, {
|
|
571
|
-
default: V(() => [hn(d) ? (L(),
|
|
571
|
+
default: V(() => [hn(d) ? (L(), k(Se, {
|
|
572
572
|
key: 0,
|
|
573
573
|
message: d,
|
|
574
|
-
"is-streaming":
|
|
574
|
+
"is-streaming": W.value && Z(x),
|
|
575
575
|
"has-content": Sn(d),
|
|
576
576
|
"hide-reasoning": e.hideReasoning,
|
|
577
577
|
"is-dark": e.isDark
|
|
@@ -581,67 +581,67 @@ var ot = ["aria-busy"], st = {
|
|
|
581
581
|
"has-content",
|
|
582
582
|
"hide-reasoning",
|
|
583
583
|
"is-dark"
|
|
584
|
-
])) :
|
|
584
|
+
])) : A("", !0)]),
|
|
585
585
|
_: 2
|
|
586
586
|
}, 1024),
|
|
587
|
-
(L(!0),
|
|
587
|
+
(L(!0), j(E, null, Pe(nn(d), (s, c) => (L(), j(E, { key: z(le)(s, c) }, [z(h)(s) && s.text.trim() ? (L(), k(D, {
|
|
588
588
|
key: 0,
|
|
589
589
|
appear: "",
|
|
590
590
|
name: "pk-chatbot-part"
|
|
591
591
|
}, {
|
|
592
|
-
default: V(() => [
|
|
592
|
+
default: V(() => [M("div", pt, [Fe(t.$slots, "text", ke({ ref_for: !0 }, {
|
|
593
593
|
message: d,
|
|
594
594
|
part: s,
|
|
595
|
-
index:
|
|
596
|
-
isLoading:
|
|
597
|
-
}), () => [Q(d) ? (L(),
|
|
595
|
+
index: x,
|
|
596
|
+
isLoading: W.value
|
|
597
|
+
}), () => [Q(d) ? (L(), k(f, {
|
|
598
598
|
key: 0,
|
|
599
599
|
class: "wysiwyg",
|
|
600
600
|
markdown: s.text,
|
|
601
601
|
"is-dark": e.isDark,
|
|
602
|
-
loading: Z(
|
|
602
|
+
loading: Z(x) && e.status === "streaming"
|
|
603
603
|
}, null, 8, [
|
|
604
604
|
"markdown",
|
|
605
605
|
"is-dark",
|
|
606
606
|
"loading"
|
|
607
|
-
])) : (L(),
|
|
607
|
+
])) : (L(), j(E, { key: 1 }, [Ee(R(s.text), 1)], 64))]), Xt(d.id) && !Y(d.id)?.comment && c === $t(d) ? (L(), j("span", {
|
|
608
608
|
key: 0,
|
|
609
609
|
class: I(["pk-chatbot-message__reaction", Zt(d.id)]),
|
|
610
610
|
title: Qt(d.id)
|
|
611
|
-
}, [Yt(d.id) ? (L(),
|
|
611
|
+
}, [Yt(d.id) ? (L(), j("span", ht, R(Yt(d.id)), 1)) : (L(), k(p, {
|
|
612
612
|
key: 1,
|
|
613
613
|
name: Jt(d.id) === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-up-fill"
|
|
614
|
-
}, null, 8, ["name"]))], 10,
|
|
614
|
+
}, null, 8, ["name"]))], 10, mt)) : A("", !0)])]),
|
|
615
615
|
_: 2
|
|
616
|
-
}, 1024)) : z(
|
|
616
|
+
}, 1024)) : z(v)(s) ? (L(), k(D, {
|
|
617
617
|
key: 1,
|
|
618
618
|
appear: "",
|
|
619
619
|
name: "pk-chatbot-part"
|
|
620
620
|
}, {
|
|
621
|
-
default: V(() => [z(a)(s.filename, s.mediaType) ? (L(),
|
|
621
|
+
default: V(() => [z(a)(s.filename, s.mediaType) ? (L(), j("div", gt, [N(ve, {
|
|
622
622
|
"media-type": s.mediaType,
|
|
623
623
|
url: s.url,
|
|
624
624
|
filename: s.filename,
|
|
625
|
-
size: z(
|
|
625
|
+
size: z(y)(s)?.bytesCount
|
|
626
626
|
}, null, 8, [
|
|
627
627
|
"media-type",
|
|
628
628
|
"url",
|
|
629
629
|
"filename",
|
|
630
630
|
"size"
|
|
631
|
-
]),
|
|
631
|
+
]), N(ee, {
|
|
632
632
|
url: s.url,
|
|
633
|
-
transcript: z(
|
|
634
|
-
pending: e.status === "submitted" && Z(
|
|
633
|
+
transcript: z(g)(s),
|
|
634
|
+
pending: e.status === "submitted" && Z(x)
|
|
635
635
|
}, null, 8, [
|
|
636
636
|
"url",
|
|
637
637
|
"transcript",
|
|
638
638
|
"pending"
|
|
639
|
-
])])) : (L(),
|
|
639
|
+
])])) : (L(), k(ve, {
|
|
640
640
|
key: 1,
|
|
641
641
|
"media-type": s.mediaType,
|
|
642
642
|
url: s.url,
|
|
643
643
|
filename: s.filename,
|
|
644
|
-
size: z(
|
|
644
|
+
size: z(y)(s)?.bytesCount
|
|
645
645
|
}, null, 8, [
|
|
646
646
|
"media-type",
|
|
647
647
|
"url",
|
|
@@ -649,17 +649,17 @@ var ot = ["aria-busy"], st = {
|
|
|
649
649
|
"size"
|
|
650
650
|
]))]),
|
|
651
651
|
_: 2
|
|
652
|
-
}, 1024)) : z(
|
|
652
|
+
}, 1024)) : z(me)(s) && !z(S)(s) ? (L(), k(D, {
|
|
653
653
|
key: 2,
|
|
654
654
|
appear: "",
|
|
655
655
|
name: "pk-chatbot-part"
|
|
656
656
|
}, {
|
|
657
|
-
default: V(() => [(L(),
|
|
657
|
+
default: V(() => [(L(), k($e, {
|
|
658
658
|
key: `approval-${c}`,
|
|
659
659
|
part: s,
|
|
660
|
-
actionable: e.interactive === !0 && (z(
|
|
660
|
+
actionable: e.interactive === !0 && (z(C)(s) || Z(x)),
|
|
661
661
|
"call-verdict": e.confirmVerdictsOnCall?.get(s.toolCallId ?? ""),
|
|
662
|
-
onRespond: (e) =>
|
|
662
|
+
onRespond: (e) => te(s, e)
|
|
663
663
|
}, null, 8, [
|
|
664
664
|
"part",
|
|
665
665
|
"actionable",
|
|
@@ -667,100 +667,100 @@ var ot = ["aria-busy"], st = {
|
|
|
667
667
|
"onRespond"
|
|
668
668
|
]))]),
|
|
669
669
|
_: 2
|
|
670
|
-
}, 1024)) : gn(s) ? (L(),
|
|
670
|
+
}, 1024)) : gn(s) ? (L(), k(D, {
|
|
671
671
|
key: 3,
|
|
672
672
|
appear: "",
|
|
673
673
|
name: "pk-chatbot-part"
|
|
674
674
|
}, {
|
|
675
|
-
default: V(() => [
|
|
676
|
-
question: e.hostConfirmation?.question ?? z(i)("toolApproval.hostCall", { name: z(
|
|
675
|
+
default: V(() => [N(rt, {
|
|
676
|
+
question: e.hostConfirmation?.question ?? z(i)("toolApproval.hostCall", { name: z(ae)(z(i), s) }),
|
|
677
677
|
details: e.hostConfirmation?.details,
|
|
678
678
|
onRespond: n[0] ||= (e) => r("host-confirm-respond", e)
|
|
679
679
|
}, null, 8, ["question", "details"])]),
|
|
680
680
|
_: 2
|
|
681
|
-
}, 1024)) : yn(d,
|
|
681
|
+
}, 1024)) : yn(d, x, s, c) ? (L(), k(D, {
|
|
682
682
|
key: 4,
|
|
683
683
|
appear: "",
|
|
684
684
|
name: "pk-chatbot-part"
|
|
685
685
|
}, {
|
|
686
|
-
default: V(() => [
|
|
687
|
-
|
|
688
|
-
name: vn(
|
|
686
|
+
default: V(() => [M("div", _t, [
|
|
687
|
+
N(p, {
|
|
688
|
+
name: vn(x, s) ? "loading-loop" : z(se)(s) ?? "ri:apps-line",
|
|
689
689
|
class: "shrink-0"
|
|
690
690
|
}, null, 8, ["name"]),
|
|
691
|
-
|
|
692
|
-
bn(
|
|
691
|
+
M("span", vt, R(z(ae)(z(i), s, z(l))), 1),
|
|
692
|
+
bn(x, s) ? (L(), j("span", yt, " · " + R(bn(x, s)), 1)) : A("", !0)
|
|
693
693
|
])]),
|
|
694
694
|
_: 2
|
|
695
|
-
}, 1024)) : xn(s) ? (L(),
|
|
695
|
+
}, 1024)) : xn(s) ? (L(), k(D, {
|
|
696
696
|
key: 5,
|
|
697
697
|
appear: "",
|
|
698
698
|
name: "pk-chatbot-part"
|
|
699
699
|
}, {
|
|
700
|
-
default: V(() => [!z(u)[s.type] && z(
|
|
701
|
-
key: `component-${c}-${z(
|
|
700
|
+
default: V(() => [!z(u)[s.type] && z(Xe)[z(m)(s)] ? (L(), k(Ie(z(Xe)[z(m)(s)]), ke({
|
|
701
|
+
key: `component-${c}-${z(ie)(s)}`,
|
|
702
702
|
part: s
|
|
703
703
|
}, { ref_for: !0 }, Gt(s)), null, 16, ["part"])) : Fe(t.$slots, s.type, ke({ ref_for: !0 }, {
|
|
704
704
|
message: d,
|
|
705
705
|
part: s,
|
|
706
|
-
index:
|
|
707
|
-
isLoading:
|
|
708
|
-
}), () => [e.showAllMessageParts ? (L(),
|
|
706
|
+
index: x,
|
|
707
|
+
isLoading: W.value
|
|
708
|
+
}), () => [e.showAllMessageParts ? (L(), j("div", bt, [M("div", xt, [z(se)(s) ? (L(), k(p, {
|
|
709
709
|
key: 0,
|
|
710
|
-
name: z(
|
|
710
|
+
name: z(se)(s),
|
|
711
711
|
class: "shrink-0"
|
|
712
|
-
}, null, 8, ["name"])) :
|
|
712
|
+
}, null, 8, ["name"])) : A("", !0), M("span", St, R(z(pe)(s, {
|
|
713
713
|
t: z(i),
|
|
714
714
|
te: z(o)
|
|
715
|
-
})), 1)])])) :
|
|
715
|
+
})), 1)])])) : A("", !0)], void 0, 1)]),
|
|
716
716
|
_: 2
|
|
717
|
-
}, 1024)) :
|
|
718
|
-
default: V(() => [c === $t(d) && e.readonlyFeedback && Y(d.id)?.comment ? (L(),
|
|
717
|
+
}, 1024)) : A("", !0), N(D, { mode: "out-in" }, {
|
|
718
|
+
default: V(() => [c === $t(d) && e.readonlyFeedback && Y(d.id)?.comment ? (L(), k(be, {
|
|
719
719
|
key: 0,
|
|
720
720
|
feedback: Y(d.id)
|
|
721
|
-
}, null, 8, ["feedback"])) :
|
|
721
|
+
}, null, 8, ["feedback"])) : A("", !0)]),
|
|
722
722
|
_: 2
|
|
723
723
|
}, 1024)], 64))), 128)),
|
|
724
|
-
Cn(d) && d.metadata?.pagePointer ? (L(),
|
|
724
|
+
Cn(d) && d.metadata?.pagePointer ? (L(), j("div", {
|
|
725
725
|
key: 0,
|
|
726
726
|
class: "pk-chatbot-message__pointer",
|
|
727
727
|
title: d.metadata.pagePointer.kind === "text" ? z(i)("pagePointer.selected") : z(i)("pagePointer.pointed")
|
|
728
|
-
}, [
|
|
728
|
+
}, [N(p, {
|
|
729
729
|
name: d.metadata.pagePointer.kind === "text" ? "ri:double-quotes-l" : "ri:focus-3-line",
|
|
730
730
|
class: "pk-chatbot-message__pointer-icon"
|
|
731
|
-
}, null, 8, ["name"]),
|
|
732
|
-
|
|
731
|
+
}, null, 8, ["name"]), M("span", wt, R(d.metadata.pagePointer.kind === "text" ? `«${d.metadata.pagePointer.label}»` : d.metadata.pagePointer.label), 1)], 8, Ct)) : A("", !0),
|
|
732
|
+
N(D, {
|
|
733
733
|
name: "fade-in",
|
|
734
734
|
mode: "out-in"
|
|
735
735
|
}, {
|
|
736
|
-
default: V(() => [
|
|
736
|
+
default: V(() => [W.value && Z(x) && !pn(d) && !e.hostConfirmation && Q(d) && (!hn(d) || Sn(d)) ? (L(), j("div", {
|
|
737
737
|
key: `loading-info-${d.id}`,
|
|
738
738
|
class: "pk-chatbot-message__loading-info"
|
|
739
|
-
}, [
|
|
740
|
-
|
|
739
|
+
}, [M("div", Tt, [
|
|
740
|
+
N(p, {
|
|
741
741
|
name: "loading-loop",
|
|
742
742
|
class: "shrink-0"
|
|
743
743
|
}),
|
|
744
|
-
|
|
745
|
-
default: V(() => [ln.value ? (L(),
|
|
744
|
+
N(D, { mode: "out-in" }, {
|
|
745
|
+
default: V(() => [ln.value ? (L(), k(p, {
|
|
746
746
|
key: ln.value,
|
|
747
747
|
class: "shrink-0",
|
|
748
748
|
name: ln.value
|
|
749
|
-
}, null, 8, ["name"])) :
|
|
749
|
+
}, null, 8, ["name"])) : A("", !0)]),
|
|
750
750
|
_: 1
|
|
751
751
|
}),
|
|
752
|
-
|
|
753
|
-
default: V(() => [cn.value ? (L(),
|
|
752
|
+
N(D, { mode: "out-in" }, {
|
|
753
|
+
default: V(() => [cn.value ? (L(), j("span", {
|
|
754
754
|
key: cn.value,
|
|
755
755
|
class: "text-12"
|
|
756
|
-
}, R(cn.value), 1)) :
|
|
756
|
+
}, R(cn.value), 1)) : A("", !0)]),
|
|
757
757
|
_: 1
|
|
758
758
|
})
|
|
759
|
-
]),
|
|
759
|
+
]), N(D, {
|
|
760
760
|
name: "fade-in",
|
|
761
761
|
mode: "out-in"
|
|
762
762
|
}, {
|
|
763
|
-
default: V(() => [!e.hideReasoning && !hn(d) && X.value && "text" in X.value && X.value.text.trim() ? (L(),
|
|
763
|
+
default: V(() => [!e.hideReasoning && !hn(d) && X.value && "text" in X.value && X.value.text.trim() ? (L(), k(xe, {
|
|
764
764
|
key: 0,
|
|
765
765
|
markdown: X.value.text,
|
|
766
766
|
"is-dark": e.isDark,
|
|
@@ -771,31 +771,31 @@ var ot = ["aria-busy"], st = {
|
|
|
771
771
|
"markdown",
|
|
772
772
|
"is-dark",
|
|
773
773
|
"tail-length"
|
|
774
|
-
])) :
|
|
774
|
+
])) : A("", !0)]),
|
|
775
775
|
_: 2
|
|
776
|
-
}, 1024)])) :
|
|
776
|
+
}, 1024)])) : A("", !0)]),
|
|
777
777
|
_: 2
|
|
778
778
|
}, 1024),
|
|
779
|
-
|
|
780
|
-
default: V(() => [On(d,
|
|
781
|
-
|
|
779
|
+
N(D, { mode: "out-in" }, {
|
|
780
|
+
default: V(() => [On(d, x) ? (L(), j("div", Et, [
|
|
781
|
+
N(b, {
|
|
782
782
|
modifiers: "compact",
|
|
783
783
|
class: "mr-auto shrink-0"
|
|
784
784
|
}, {
|
|
785
785
|
default: V(() => [
|
|
786
|
-
|
|
787
|
-
default: V(() => [dn(
|
|
786
|
+
N(D, { mode: "out-in" }, {
|
|
787
|
+
default: V(() => [dn(x) ? (L(), k(_, {
|
|
788
788
|
key: 0,
|
|
789
789
|
icon: "ri:reset-right-line",
|
|
790
790
|
modifiers: "action-quiet-small",
|
|
791
791
|
title: z(i)("action.regenerate"),
|
|
792
792
|
"aria-label": z(i)("action.regenerate"),
|
|
793
793
|
onClick: n[1] ||= H((e) => t.$emit("regenerate"), ["stop"])
|
|
794
|
-
}, null, 8, ["title", "aria-label"])) :
|
|
794
|
+
}, null, 8, ["title", "aria-label"])) : A("", !0)]),
|
|
795
795
|
_: 2
|
|
796
796
|
}, 1024),
|
|
797
|
-
|
|
798
|
-
default: V(() => [fn("show-info",
|
|
797
|
+
N(D, { mode: "out-in" }, {
|
|
798
|
+
default: V(() => [fn("show-info", x) ? (L(), k(_, {
|
|
799
799
|
key: 0,
|
|
800
800
|
icon: "ri:information-line",
|
|
801
801
|
title: z(i)("action.getMoreInfo"),
|
|
@@ -806,17 +806,17 @@ var ot = ["aria-busy"], st = {
|
|
|
806
806
|
"title",
|
|
807
807
|
"aria-label",
|
|
808
808
|
"onClick"
|
|
809
|
-
])) :
|
|
809
|
+
])) : A("", !0)]),
|
|
810
810
|
_: 2
|
|
811
811
|
}, 1024),
|
|
812
|
-
|
|
813
|
-
default: V(() => [fn("revise",
|
|
812
|
+
N(D, { mode: "out-in" }, {
|
|
813
|
+
default: V(() => [fn("revise", x) ? (L(), k(_, {
|
|
814
814
|
key: 0,
|
|
815
|
-
icon:
|
|
816
|
-
title:
|
|
817
|
-
"aria-label":
|
|
815
|
+
icon: J(d.id) ? "ri:file-edit-fill" : "ri:file-edit-line",
|
|
816
|
+
title: J(d.id) ? z(i)("action.editRevise") : z(i)("action.createRevise"),
|
|
817
|
+
"aria-label": J(d.id) ? z(i)("action.editRevise") : z(i)("action.createRevise"),
|
|
818
818
|
modifiers: "action-quiet-small",
|
|
819
|
-
class: I({ "text-brand-graphic":
|
|
819
|
+
class: I({ "text-brand-graphic": J(d.id) }),
|
|
820
820
|
onClick: H((e) => t.$emit("revise", d), ["stop"])
|
|
821
821
|
}, null, 8, [
|
|
822
822
|
"icon",
|
|
@@ -824,11 +824,11 @@ var ot = ["aria-busy"], st = {
|
|
|
824
824
|
"aria-label",
|
|
825
825
|
"class",
|
|
826
826
|
"onClick"
|
|
827
|
-
])) :
|
|
827
|
+
])) : A("", !0)]),
|
|
828
828
|
_: 2
|
|
829
829
|
}, 1024),
|
|
830
|
-
|
|
831
|
-
default: V(() => [Kt("upvote",
|
|
830
|
+
N(D, { mode: "out-in" }, {
|
|
831
|
+
default: V(() => [Kt("upvote", x) ? (L(), k(_, {
|
|
832
832
|
key: 0,
|
|
833
833
|
icon: Y(d.id)?.vote === "upvote" ? "ri:thumb-up-fill" : "ri:thumb-up-line",
|
|
834
834
|
title: z(i)("action.upvote"),
|
|
@@ -840,11 +840,11 @@ var ot = ["aria-busy"], st = {
|
|
|
840
840
|
"title",
|
|
841
841
|
"aria-label",
|
|
842
842
|
"onClick"
|
|
843
|
-
])) :
|
|
843
|
+
])) : A("", !0)]),
|
|
844
844
|
_: 2
|
|
845
845
|
}, 1024),
|
|
846
|
-
|
|
847
|
-
default: V(() => [Kt("downvote",
|
|
846
|
+
N(D, { mode: "out-in" }, {
|
|
847
|
+
default: V(() => [Kt("downvote", x) ? (L(), k(_, {
|
|
848
848
|
key: 0,
|
|
849
849
|
icon: Y(d.id)?.vote === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-down-line",
|
|
850
850
|
title: z(i)("action.downvote"),
|
|
@@ -856,11 +856,11 @@ var ot = ["aria-busy"], st = {
|
|
|
856
856
|
"title",
|
|
857
857
|
"aria-label",
|
|
858
858
|
"onClick"
|
|
859
|
-
])) :
|
|
859
|
+
])) : A("", !0)]),
|
|
860
860
|
_: 2
|
|
861
861
|
}, 1024),
|
|
862
|
-
|
|
863
|
-
default: V(() => [Kt("feedback",
|
|
862
|
+
N(D, { mode: "out-in" }, {
|
|
863
|
+
default: V(() => [Kt("feedback", x) ? (L(), k(_, {
|
|
864
864
|
key: 0,
|
|
865
865
|
icon: Y(d.id)?.comment ? "ri:feedback-fill" : "ri:feedback-line",
|
|
866
866
|
title: z(i)("action.feedback"),
|
|
@@ -872,53 +872,53 @@ var ot = ["aria-busy"], st = {
|
|
|
872
872
|
"title",
|
|
873
873
|
"aria-label",
|
|
874
874
|
"onClick"
|
|
875
|
-
])) :
|
|
875
|
+
])) : A("", !0)]),
|
|
876
876
|
_: 2
|
|
877
877
|
}, 1024)
|
|
878
878
|
]),
|
|
879
879
|
_: 2
|
|
880
880
|
}, 1024),
|
|
881
|
-
!e.showMessageDateTime && d.metadata?.createdAt && d.metadata?.completedAt ? (L(),
|
|
881
|
+
!e.showMessageDateTime && d.metadata?.createdAt && d.metadata?.completedAt ? (L(), j("div", Dt, [M("time", {
|
|
882
882
|
datetime: new Date(d.metadata.createdAt).toISOString(),
|
|
883
883
|
title: z(s)(new Date(d.metadata.createdAt), "date-time"),
|
|
884
884
|
class: "flex items-center gap-4 min-w-0"
|
|
885
|
-
}, [
|
|
885
|
+
}, [N(p, {
|
|
886
886
|
name: "ri:time-line",
|
|
887
887
|
class: "shrink-0"
|
|
888
|
-
}),
|
|
888
|
+
}), M("span", kt, R(kn(d.metadata.createdAt)), 1)], 8, Ot), An(d) ? (L(), j("span", At, [N(p, {
|
|
889
889
|
name: "ri:hourglass-line",
|
|
890
890
|
class: "shrink-0"
|
|
891
|
-
}),
|
|
892
|
-
e.showMessageNumber ? (L(),
|
|
891
|
+
}), M("span", jt, R(An(d)), 1)])) : A("", !0)])) : A("", !0),
|
|
892
|
+
e.showMessageNumber ? (L(), j("span", {
|
|
893
893
|
key: 1,
|
|
894
|
-
title: z(i)("label.messageNumber", { n: Dn.value[
|
|
894
|
+
title: z(i)("label.messageNumber", { n: Dn.value[x] }),
|
|
895
895
|
class: "text-12 text-word-3 tabular-nums"
|
|
896
|
-
}, " #" + R(Dn.value[
|
|
897
|
-
e.showMessageTokensCount && d.metadata?.totalTokens ? (L(),
|
|
896
|
+
}, " #" + R(Dn.value[x]), 9, Mt)) : A("", !0),
|
|
897
|
+
e.showMessageTokensCount && d.metadata?.totalTokens ? (L(), j("span", Nt, [N(p, {
|
|
898
898
|
name: "ri:ai-generate-2-line",
|
|
899
899
|
class: "shrink-0"
|
|
900
|
-
}),
|
|
901
|
-
e.showMessageDateTime && d.metadata?.createdAt ? (L(),
|
|
900
|
+
}), M("span", Pt, R(z(c)(d.metadata.totalTokens, "integer")) + " " + R(z(i)("label.tokens")), 1)])) : A("", !0),
|
|
901
|
+
e.showMessageDateTime && d.metadata?.createdAt ? (L(), j("time", {
|
|
902
902
|
key: 3,
|
|
903
903
|
datetime: new Date(d.metadata?.createdAt).toISOString(),
|
|
904
904
|
class: "flex items-center gap-4 text-12 text-word-3"
|
|
905
|
-
}, [
|
|
905
|
+
}, [N(p, {
|
|
906
906
|
name: "ri:time-line",
|
|
907
907
|
class: "shrink-0"
|
|
908
|
-
}),
|
|
909
|
-
e.showMessageDateTime && d?.metadata?.completedAt && d?.metadata?.createdAt ? (L(),
|
|
908
|
+
}), M("span", It, R(z(s)(new Date(d.metadata?.createdAt), "date-time")), 1)], 8, Ft)) : A("", !0),
|
|
909
|
+
e.showMessageDateTime && d?.metadata?.completedAt && d?.metadata?.createdAt ? (L(), j("div", Lt, [N(p, {
|
|
910
910
|
name: "ri:hourglass-line",
|
|
911
911
|
class: "shrink-0"
|
|
912
|
-
}),
|
|
912
|
+
}), N(_e, {
|
|
913
913
|
class: "truncate",
|
|
914
914
|
date: d.metadata?.createdAt,
|
|
915
915
|
"end-date": d.metadata?.completedAt
|
|
916
|
-
}, null, 8, ["date", "end-date"])])) :
|
|
917
|
-
])) :
|
|
916
|
+
}, null, 8, ["date", "end-date"])])) : A("", !0)
|
|
917
|
+
])) : A("", !0)]),
|
|
918
918
|
_: 2
|
|
919
919
|
}, 1024),
|
|
920
|
-
|
|
921
|
-
default: V(() => [d.id === e.feedbackMessageId ? (L(),
|
|
920
|
+
N(D, { mode: "out-in" }, {
|
|
921
|
+
default: V(() => [d.id === e.feedbackMessageId ? (L(), k(ye, {
|
|
922
922
|
key: 0,
|
|
923
923
|
ref_for: !0,
|
|
924
924
|
ref_key: "feedbackMessageEl",
|
|
@@ -932,70 +932,70 @@ var ot = ["aria-busy"], st = {
|
|
|
932
932
|
"loading",
|
|
933
933
|
"submitted",
|
|
934
934
|
"error"
|
|
935
|
-
])) :
|
|
935
|
+
])) : A("", !0)]),
|
|
936
936
|
_: 2
|
|
937
937
|
}, 1024)
|
|
938
|
-
], 6)) :
|
|
938
|
+
], 6)) : A("", !0)
|
|
939
939
|
], 64))), 128)),
|
|
940
|
-
|
|
940
|
+
N(D, {
|
|
941
941
|
appear: "",
|
|
942
942
|
name: "pk-chatbot-part",
|
|
943
943
|
onLeave: sn
|
|
944
944
|
}, {
|
|
945
|
-
default: V(() => [an.value ? (L(),
|
|
945
|
+
default: V(() => [an.value ? (L(), j("div", {
|
|
946
946
|
key: 0,
|
|
947
947
|
class: "pk-chatbot-message pk-chatbot-message--assistant pk-chatbot-message--loading",
|
|
948
|
-
style: Ae({ minHeight: on.value ? `${
|
|
949
|
-
}, [
|
|
948
|
+
style: Ae({ minHeight: on.value ? `${G.value}px` : void 0 })
|
|
949
|
+
}, [M("div", Rt, [M("div", zt, [N(p, {
|
|
950
950
|
name: "loading-loop",
|
|
951
951
|
class: "shrink-0"
|
|
952
|
-
}),
|
|
952
|
+
}), M("span", Bt, R(z(i)("label.answeringOnTheCall")), 1)])])], 4)) : A("", !0)]),
|
|
953
953
|
_: 1
|
|
954
954
|
}),
|
|
955
|
-
|
|
955
|
+
N(D, {
|
|
956
956
|
appear: "",
|
|
957
957
|
name: "pk-chatbot-part"
|
|
958
958
|
}, {
|
|
959
|
-
default: V(() => [_n.value ? (L(),
|
|
959
|
+
default: V(() => [_n.value ? (L(), j("div", Vt, [N(rt, {
|
|
960
960
|
question: e.hostConfirmation?.question ?? z(i)("toolApproval.prompt"),
|
|
961
961
|
details: e.hostConfirmation?.details,
|
|
962
962
|
onRespond: n[4] ||= (e) => r("host-confirm-respond", e)
|
|
963
|
-
}, null, 8, ["question", "details"])])) :
|
|
963
|
+
}, null, 8, ["question", "details"])])) : A("", !0)]),
|
|
964
964
|
_: 1
|
|
965
965
|
}),
|
|
966
|
-
|
|
966
|
+
N(D, {
|
|
967
967
|
appear: "",
|
|
968
968
|
name: "pk-chatbot-part"
|
|
969
969
|
}, {
|
|
970
|
-
default: V(() => [rn.value ? (L(),
|
|
970
|
+
default: V(() => [rn.value ? (L(), k(ge, {
|
|
971
971
|
key: 0,
|
|
972
972
|
error: e.error,
|
|
973
973
|
onRetry: n[5] ||= (e) => t.$emit("auto-retry"),
|
|
974
974
|
onReset: n[6] ||= (e) => t.$emit("reset-chat")
|
|
975
|
-
}, null, 8, ["error"])) :
|
|
975
|
+
}, null, 8, ["error"])) : A("", !0)]),
|
|
976
976
|
_: 1
|
|
977
977
|
}),
|
|
978
|
-
en.value?.role === "user" && !on.value || rn.value ? (L(),
|
|
978
|
+
en.value?.role === "user" && !on.value || rn.value ? (L(), j("div", {
|
|
979
979
|
key: 0,
|
|
980
980
|
class: "pk-chatbot-messages__spacer",
|
|
981
|
-
style: Ae({ minHeight: `${
|
|
982
|
-
}, null, 4)) :
|
|
981
|
+
style: Ae({ minHeight: `${G.value}px` })
|
|
982
|
+
}, null, 4)) : A("", !0)
|
|
983
983
|
], 512),
|
|
984
|
-
|
|
985
|
-
default: V(() => [e.showScrollToBottom && (z(Ue) || !z(
|
|
984
|
+
N(D, { name: "pk-chatbot-messages-fab" }, {
|
|
985
|
+
default: V(() => [e.showScrollToBottom && (z(Ue) || !z(Ge)) ? (L(), j("button", {
|
|
986
986
|
key: 0,
|
|
987
987
|
type: "button",
|
|
988
988
|
class: "pk-chatbot-messages__scroll-to-bottom",
|
|
989
989
|
title: z(i)("action.scrollToBottom"),
|
|
990
990
|
"aria-label": z(i)("action.scrollToBottom"),
|
|
991
|
-
onClick:
|
|
992
|
-
}, [
|
|
991
|
+
onClick: Ke
|
|
992
|
+
}, [N(p, { name: "ri:arrow-down-line" })], 8, Ht)) : A("", !0)]),
|
|
993
993
|
_: 1
|
|
994
994
|
})
|
|
995
|
-
], 46,
|
|
995
|
+
], 46, st);
|
|
996
996
|
};
|
|
997
997
|
}
|
|
998
998
|
});
|
|
999
|
-
export {
|
|
999
|
+
export { J as t };
|
|
1000
1000
|
|
|
1001
|
-
//# sourceMappingURL=PkChatbotMessages-
|
|
1001
|
+
//# sourceMappingURL=PkChatbotMessages-BcHNPZUB.js.map
|