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