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