@8wave/ai-elements 0.102.0 → 0.103.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{Agent-Cq-9OZHI.js → Agent-hWgZhu7L.js} +99 -100
- package/dist/_chunks/{Agent-Cq-9OZHI.js.map → Agent-hWgZhu7L.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-hAaQJW-t.js → PkToolRequestGeolocation-T16QI-Uv.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-hAaQJW-t.js.map → PkToolRequestGeolocation-T16QI-Uv.js.map} +1 -1
- package/dist/_chunks/PkToolRequestOAuthConnection-C8e5np2q.js +116 -0
- package/dist/_chunks/PkToolRequestOAuthConnection-C8e5np2q.js.map +1 -0
- package/dist/_chunks/{PkToolShowForm-CdUUAjPc.js → PkToolShowForm-ztQFyFd9.js} +2 -2
- package/dist/_chunks/{PkToolShowForm-CdUUAjPc.js.map → PkToolShowForm-ztQFyFd9.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-BvHgjMQ4.js → PkToolShowSuggestedReply-Dqe4gtEY.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-BvHgjMQ4.js.map → PkToolShowSuggestedReply-Dqe4gtEY.js.map} +1 -1
- package/dist/ai-elements.es.js +5987 -5995
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotMessages.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-Cy-XE9N1.js → Agent-CGp48ayw.js} +62 -63
- package/dist-vue/_chunks/{Agent-Cy-XE9N1.js.map → Agent-CGp48ayw.js.map} +1 -1
- package/dist-vue/_chunks/{Document-B6xVkCfQ.js → Document-CjfNDh6w.js} +15 -15
- package/dist-vue/_chunks/{Document-B6xVkCfQ.js.map → Document-CjfNDh6w.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbot-CHe6t-LR.js → PkChatbot-C4SPneVX.js} +6 -6
- package/dist-vue/_chunks/{PkChatbot-CHe6t-LR.js.map → PkChatbot-C4SPneVX.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotMessages-BgsyN-mB.js +771 -0
- package/dist-vue/_chunks/PkChatbotMessages-BgsyN-mB.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewChat-DeeGCFJf.js → PkChatbotViewChat-BMr1DpNY.js} +912 -898
- package/dist-vue/_chunks/PkChatbotViewChat-BMr1DpNY.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-DXwqumyn.js → PkChatbotViewConversations-p72SEhU-.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-DXwqumyn.js.map → PkChatbotViewConversations-p72SEhU-.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-B4u87oH6.js → PkChatbotViewFiles-C2PUVFV2.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-B4u87oH6.js.map → PkChatbotViewFiles-C2PUVFV2.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-C_A0AP8x.js → PkChatbotViewProfile-BqWLlla-.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-C_A0AP8x.js.map → PkChatbotViewProfile-BqWLlla-.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-CaHo_418.js → PkToolRequestGeolocation-CsQghLEb.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-CaHo_418.js.map → PkToolRequestGeolocation-CsQghLEb.js.map} +1 -1
- package/dist-vue/_chunks/PkToolRequestOAuthConnection-D5Jq6UZh.js +116 -0
- package/dist-vue/_chunks/PkToolRequestOAuthConnection-D5Jq6UZh.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowDiagram-CuQyY0uv.js → PkToolShowDiagram-DoklcF3f.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-CuQyY0uv.js.map → PkToolShowDiagram-DoklcF3f.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-vXgu3bZO.js → PkToolShowForm-CpY1KKUt.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowForm-vXgu3bZO.js.map → PkToolShowForm-CpY1KKUt.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-Die_j1bn.js → PkToolShowSources-CLsbqcDd.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSources-Die_j1bn.js.map → PkToolShowSources-CLsbqcDd.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-CryAdy6t.js → PkToolShowSuggestedReply-B-QwwART.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-CryAdy6t.js.map → PkToolShowSuggestedReply-B-QwwART.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-CoTSUkuj.js → createChatbotApiClient-nOLu9GAQ.js} +32 -28
- package/dist-vue/_chunks/{createChatbotApiClient-CoTSUkuj.js.map → createChatbotApiClient-nOLu9GAQ.js.map} +1 -1
- package/dist-vue/_chunks/{useChatbotStore-BcLvyaIV.js → useChatbotStore-DhWHlZwO.js} +756 -783
- package/dist-vue/_chunks/{useChatbotStore-BcLvyaIV.js.map → useChatbotStore-DhWHlZwO.js.map} +1 -1
- package/dist-vue/api.js +1 -1
- package/dist-vue/composables.js +2 -2
- package/dist-vue/index.js +304 -304
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +6 -2
- package/dist-vue/packages/components/src/chat/PkToolRequestOAuthConnection.d.ts +4 -0
- package/dist-vue/packages/components/src/chat/useVoiceSession.d.ts +0 -7
- package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +4 -0
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +6 -14
- package/dist-vue/packages/models/src/schema/Agent.d.ts +12 -5
- package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +2 -2
- package/dist-vue/packages/models/src/schema/SubAgent.d.ts +2 -2
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/PkToolRequestOAuthConnection-Bf_zoT2r.js +0 -73
- package/dist/_chunks/PkToolRequestOAuthConnection-Bf_zoT2r.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-CWPSx2ce.js +0 -770
- package/dist-vue/_chunks/PkChatbotMessages-CWPSx2ce.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewChat-DeeGCFJf.js.map +0 -1
- package/dist-vue/_chunks/PkToolRequestOAuthConnection-URjYDFhm.js +0 -73
- package/dist-vue/_chunks/PkToolRequestOAuthConnection-URjYDFhm.js.map +0 -1
|
@@ -1,770 +0,0 @@
|
|
|
1
|
-
import { O as e } from "./Agent-Cy-XE9N1.js";
|
|
2
|
-
import { t } from "./PkChatbotError-B2iob9cQ.js";
|
|
3
|
-
import { t as n } from "./PkStreamingMarkdown-BBni7OTn.js";
|
|
4
|
-
import "./src-BbpxM17m.js";
|
|
5
|
-
import { a as r, c as i, o as a, r as o, s, t as c } from "./message-RohfrdWS.js";
|
|
6
|
-
import { t as l } from "./PkRelativeTime--1cIphlA.js";
|
|
7
|
-
import { t as u } from "./PkChatbotFilePreview-DPQn4Xnq.js";
|
|
8
|
-
import { t as d } from "./PkChatbotFeedbackForm-nEevDHmI.js";
|
|
9
|
-
import { t as f } from "./PkChatbotMessageFeedback-BYmrVaCE.js";
|
|
10
|
-
import { a as p, c as m, d as h, g, h as _, i as ee, m as v, o as te, p as y, s as b, t as x } from "./utils-CgxndZld.js";
|
|
11
|
-
import { n as ne, t as re } from "./PkChatbotSteps-DlZpwc_a.js";
|
|
12
|
-
import { t as S } from "./PkChatbotOutlineRail-np4g6vsz.js";
|
|
13
|
-
import { VvButton as C, VvButtonGroup as w, VvIcon as ie } from "@volverjs/ui-vue/components";
|
|
14
|
-
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, mergeProps as oe, nextTick as F, normalizeClass as I, normalizeStyle as se, onBeforeUnmount as L, onMounted as ce, openBlock as R, ref as z, renderList as le, renderSlot as ue, resolveDynamicComponent as de, toDisplayString as B, unref as V, useSlots as fe, useTemplateRef as pe, watch as H, withCtx as U, withModifiers as W } from "vue";
|
|
15
|
-
import { useI18n as me } from "vue-i18n";
|
|
16
|
-
//#region ../../packages/utils/src/text.ts
|
|
17
|
-
var G = (e) => e.normalize("NFD").replace(/[\u0300-\u036f]/g, ""), he = (e) => e ? e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/[-_]+/g, " ") : "", ge = (e) => e ? G(e).replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[^a-zA-Z0-9]+/g, "-").toLowerCase() : "", _e = (e) => e ? G(e).replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[^a-zA-Z0-9]+/g, "_").toLowerCase() : "", ve = (e) => e ? e.charAt(0).toUpperCase() + e.slice(1) : "", ye = {
|
|
18
|
-
requestOAuthConnection: N(() => import("./PkToolRequestOAuthConnection-URjYDFhm.js")),
|
|
19
|
-
showArtifact: N(() => import("./PkToolShowArtifact-BGGsbY-0.js").then((e) => e.n)),
|
|
20
|
-
showCalendarEvent: N(() => import("./PkToolShowCalendarEvent-CK5KnNxq.js").then((e) => e.n)),
|
|
21
|
-
showComparison: N(() => import("./PkToolShowComparison-D0iMf7JW.js").then((e) => e.n)),
|
|
22
|
-
showContactForm: N(() => import("./PkToolShowContactForm-CMK4zR2J.js").then((e) => e.n)),
|
|
23
|
-
showDiagram: N(() => import("./PkToolShowDiagram-CuQyY0uv.js")),
|
|
24
|
-
showEmail: N(() => import("./PkToolShowEmail-tUYlAzar.js").then((e) => e.n)),
|
|
25
|
-
showImageGallery: N(() => import("./PkToolShowImageGallery-6MmMV2y_.js").then((e) => e.n)),
|
|
26
|
-
showLocation: N(() => import("./PkToolShowLocation-BBdeY0Ae.js").then((e) => e.n)),
|
|
27
|
-
showMessage: N(() => import("./PkToolShowMessage-BezAdT5s.js").then((e) => e.n)),
|
|
28
|
-
showForm: N(() => import("./PkToolShowForm-vXgu3bZO.js").then((e) => e.n)),
|
|
29
|
-
showMultipleChoice: N(() => import("./PkToolShowForm-vXgu3bZO.js").then((e) => e.n)),
|
|
30
|
-
showProductList: N(() => import("./PkToolShowProductList-B4QeNa1a.js").then((e) => e.n)),
|
|
31
|
-
showQrCode: N(() => import("./PkToolShowQrCode-DEAvfLFu.js").then((e) => e.n)),
|
|
32
|
-
showSources: N(() => import("./PkToolShowSources-Die_j1bn.js").then((e) => e.n)),
|
|
33
|
-
showSuggestedReply: N(() => import("./PkToolShowSuggestedReply-CryAdy6t.js").then((e) => e.n)),
|
|
34
|
-
showVideo: N(() => import("./PkToolShowVideo-DCHy_8US.js")),
|
|
35
|
-
showWeather: N(() => import("./PkToolShowWeather-CKx1MJOB.js")),
|
|
36
|
-
showWebPages: N(() => import("./PkToolShowWebPages-Bu9cxKIk.js").then((e) => e.n))
|
|
37
|
-
}, K = {
|
|
38
|
-
key: 0,
|
|
39
|
-
class: "text-12 text-word-3 m-0 mb-xs"
|
|
40
|
-
}, q = /* @__PURE__ */ P({
|
|
41
|
-
__name: "PkToolApprovalPreviewMessage",
|
|
42
|
-
props: { input: {} },
|
|
43
|
-
setup(e) {
|
|
44
|
-
let t = e, n = D(() => {
|
|
45
|
-
let e = t.input;
|
|
46
|
-
return typeof e?.message == "string" ? e.message : "";
|
|
47
|
-
});
|
|
48
|
-
return (e, t) => n.value ? (R(), A("p", K, B(n.value), 1)) : k("", !0);
|
|
49
|
-
}
|
|
50
|
-
}), be = { [x]: q }, xe = {
|
|
51
|
-
key: 0,
|
|
52
|
-
class: "text-12 text-word-3 m-0 mb-xs"
|
|
53
|
-
}, Se = /* @__PURE__ */ P({
|
|
54
|
-
__name: "PkToolApprovalCard",
|
|
55
|
-
props: {
|
|
56
|
-
part: {},
|
|
57
|
-
actionable: { type: Boolean },
|
|
58
|
-
callVerdict: { type: Boolean }
|
|
59
|
-
},
|
|
60
|
-
emits: ["respond"],
|
|
61
|
-
setup(t, { emit: n }) {
|
|
62
|
-
let r = t, i = n, { t: a } = me({ useScope: "global" }), s = D(() => r.part), c = D(() => o(r.part)), l = D(() => c.value === x), u = D(() => l.value ? (s.value.state === "input-available" || e(s.value.output)) && r.callVerdict === void 0 : s.value.state === "approval-requested"), d = D(() => u.value && r.actionable === !0), f = D(() => u.value && r.actionable !== !0), p = D(() => l.value ? s.value.output === "confirmed" || r.callVerdict === !0 : s.value.approval?.approved === !0), m = D(() => l.value ? s.value.output === "cancelled" || r.callVerdict === !1 : s.value.approval?.approved === !1 || s.value.state === "output-denied"), h = D(() => be[c.value]), g = D(() => {
|
|
63
|
-
if (f.value) return {
|
|
64
|
-
icon: "ri:time-line",
|
|
65
|
-
message: a("toolApproval.expired")
|
|
66
|
-
};
|
|
67
|
-
if (p.value) return {
|
|
68
|
-
icon: "ri:check-line",
|
|
69
|
-
message: a(l.value ? "toolApproval.confirmed" : "toolApproval.approved")
|
|
70
|
-
};
|
|
71
|
-
if (m.value) return {
|
|
72
|
-
icon: "ri:close-line",
|
|
73
|
-
message: a(l.value ? "toolApproval.cancelled" : "toolApproval.denied")
|
|
74
|
-
};
|
|
75
|
-
}), _ = D(() => !!g.value && !h.value);
|
|
76
|
-
return (e, n) => {
|
|
77
|
-
let r = C, o = w, c = ie;
|
|
78
|
-
return R(), A("div", { class: I(["w-full overflow-hidden transition-all duration-300", { "bg-surface p-sm rounded-xl border border-surface-3": !_.value }]) }, [
|
|
79
|
-
M(E, null, {
|
|
80
|
-
default: U(() => [!l.value && u.value ? (R(), A("p", xe, B(V(a)("toolApproval.prompt")), 1)) : k("", !0)]),
|
|
81
|
-
_: 1
|
|
82
|
-
}),
|
|
83
|
-
h.value ? (R(), O(de(h.value), {
|
|
84
|
-
key: 0,
|
|
85
|
-
part: t.part,
|
|
86
|
-
input: s.value.input
|
|
87
|
-
}, null, 8, ["part", "input"])) : k("", !0),
|
|
88
|
-
M(E, { mode: "out-in" }, {
|
|
89
|
-
default: U(() => [g.value ? (R(), A("p", {
|
|
90
|
-
key: 1,
|
|
91
|
-
class: I(["flex items-center gap-4 text-12 text-word-3 m-0", { "mt-xs": h.value }])
|
|
92
|
-
}, [M(c, {
|
|
93
|
-
name: g.value.icon,
|
|
94
|
-
class: "shrink-0"
|
|
95
|
-
}, null, 8, ["name"]), ae(" " + B(g.value.message), 1)], 2)) : (R(), O(o, { key: 0 }, {
|
|
96
|
-
default: U(() => [M(r, {
|
|
97
|
-
modifiers: "primary-small",
|
|
98
|
-
disabled: !d.value,
|
|
99
|
-
icon: "ri:check-line",
|
|
100
|
-
label: V(a)("action.proceed"),
|
|
101
|
-
onClick: n[0] ||= W((e) => i("respond", !0), ["stop"])
|
|
102
|
-
}, null, 8, ["disabled", "label"]), M(r, {
|
|
103
|
-
modifiers: "action-quiet-small",
|
|
104
|
-
disabled: !d.value,
|
|
105
|
-
icon: "ri:close-line",
|
|
106
|
-
label: V(a)("action.cancel"),
|
|
107
|
-
onClick: n[1] ||= W((e) => i("respond", !1), ["stop"])
|
|
108
|
-
}, null, 8, ["disabled", "label"])]),
|
|
109
|
-
_: 1
|
|
110
|
-
}))]),
|
|
111
|
-
_: 1
|
|
112
|
-
})
|
|
113
|
-
], 2);
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
}), Ce = 30, we = 500;
|
|
117
|
-
function Te(e) {
|
|
118
|
-
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") => {
|
|
119
|
-
if (!t.value || l.value) {
|
|
120
|
-
d = !1;
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
d = !0, t.value.scrollTo({
|
|
124
|
-
top: t.value.scrollHeight,
|
|
125
|
-
behavior: e
|
|
126
|
-
}), setTimeout(() => {
|
|
127
|
-
d = !1;
|
|
128
|
-
}, e === "instant" ? 0 : we);
|
|
129
|
-
}, ee = (e) => {
|
|
130
|
-
e.deltaY < 0 && (l.value = !0);
|
|
131
|
-
}, v = 0, te = (e) => {
|
|
132
|
-
v = e.touches[0]?.clientY ?? 0;
|
|
133
|
-
}, y = (e) => {
|
|
134
|
-
let t = e.touches[0]?.clientY ?? 0;
|
|
135
|
-
t > v && (l.value = !0), v = t;
|
|
136
|
-
}, b = () => {
|
|
137
|
-
if (!t.value) return;
|
|
138
|
-
let { scrollTop: e, scrollHeight: n, clientHeight: r } = t.value;
|
|
139
|
-
if (u.value = n - r - e < Ce, d) {
|
|
140
|
-
g = e;
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
e < g && s?.(), e > g && (u.value && (l.value = !1), c?.()), g = e;
|
|
144
|
-
}, x = () => {
|
|
145
|
-
if (d || l.value || !t.value) return;
|
|
146
|
-
let e = t.value, n = e.scrollHeight - e.clientHeight;
|
|
147
|
-
n <= e.scrollTop || (u.value = !0, d = !0, e.scrollTop = n, requestAnimationFrame(() => {
|
|
148
|
-
d = !1;
|
|
149
|
-
}));
|
|
150
|
-
}, ne = () => {
|
|
151
|
-
f || !t.value || (f = new MutationObserver(x), f.observe(t.value, {
|
|
152
|
-
childList: !0,
|
|
153
|
-
subtree: !0,
|
|
154
|
-
characterData: !0
|
|
155
|
-
}));
|
|
156
|
-
}, re = () => {
|
|
157
|
-
f?.disconnect(), f = null;
|
|
158
|
-
};
|
|
159
|
-
H(n, (e, t) => {
|
|
160
|
-
if (e === "streaming" || e === "submitted") {
|
|
161
|
-
ne();
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
(e !== "ready" || t !== "streaming") && re();
|
|
165
|
-
}), H(r, async () => {
|
|
166
|
-
if (r() && i() !== "assistant") {
|
|
167
|
-
w(), l.value = !1, d = !0;
|
|
168
|
-
try {
|
|
169
|
-
await F(), await o?.(), await F();
|
|
170
|
-
} finally {
|
|
171
|
-
_();
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
let S = null, C = () => {
|
|
176
|
-
t.value && (t.value.scrollHeight <= t.value.clientHeight || (t.value.scrollTop = t.value.scrollHeight, S && clearTimeout(S), S = setTimeout(w, 300)));
|
|
177
|
-
}, w = () => {
|
|
178
|
-
p?.disconnect(), p = null, m?.disconnect(), m = null, S &&= (clearTimeout(S), null);
|
|
179
|
-
};
|
|
180
|
-
return ce(() => {
|
|
181
|
-
if (!t.value) return;
|
|
182
|
-
t.value.addEventListener("wheel", ee, { passive: !0 }), t.value.addEventListener("touchstart", te, { passive: !0 }), t.value.addEventListener("touchmove", y, { passive: !0 });
|
|
183
|
-
let e = n() === "submitted" || n() === "streaming";
|
|
184
|
-
e ? ne() : (p = new ResizeObserver(C), p.observe(t.value), m = new MutationObserver(C), m.observe(t.value, {
|
|
185
|
-
childList: !0,
|
|
186
|
-
subtree: !0
|
|
187
|
-
}));
|
|
188
|
-
let r = a?.() ?? t.value.firstElementChild;
|
|
189
|
-
r && (h = new ResizeObserver(x), h.observe(r)), e || C();
|
|
190
|
-
}), L(() => {
|
|
191
|
-
t.value?.removeEventListener("wheel", ee), t.value?.removeEventListener("touchstart", te), t.value?.removeEventListener("touchmove", y), h?.disconnect(), h = null, re(), w();
|
|
192
|
-
}), {
|
|
193
|
-
handleScroll: b,
|
|
194
|
-
scrollToBottom: _,
|
|
195
|
-
userScrolledUp: l,
|
|
196
|
-
isAtBottom: u
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
//#endregion
|
|
200
|
-
//#region ../../packages/components/src/chat/PkChatbotMessages.vue?vue&type=script&setup=true&lang.ts
|
|
201
|
-
var Ee = ["aria-busy"], De = {
|
|
202
|
-
key: 0,
|
|
203
|
-
class: "pk-chatbot-messages__outline"
|
|
204
|
-
}, Oe = {
|
|
205
|
-
key: 0,
|
|
206
|
-
class: "pk-chatbot-divider"
|
|
207
|
-
}, ke = { class: "pk-chatbot-divider__label" }, Ae = { class: "pk-chatbot-message__text" }, je = ["title"], Me = {
|
|
208
|
-
key: 0,
|
|
209
|
-
class: "pk-chatbot-message__reaction-emoji"
|
|
210
|
-
}, Ne = {
|
|
211
|
-
key: 0,
|
|
212
|
-
class: "pk-chatbot-message__loading-info"
|
|
213
|
-
}, Pe = { class: "flex gap-8 items-center" }, Fe = { class: "font-mono rounded text-12" }, Ie = { class: "flex gap-8 items-center" }, Le = {
|
|
214
|
-
key: 0,
|
|
215
|
-
class: "pk-chatbot-message__footer"
|
|
216
|
-
}, Re = {
|
|
217
|
-
key: 0,
|
|
218
|
-
class: "pk-chatbot-message__hover-meta"
|
|
219
|
-
}, ze = ["datetime", "title"], Be = { class: "truncate" }, Ve = {
|
|
220
|
-
key: 0,
|
|
221
|
-
class: "flex items-center gap-4 min-w-0"
|
|
222
|
-
}, He = { class: "truncate" }, Ue = {
|
|
223
|
-
key: 1,
|
|
224
|
-
class: "flex items-center gap-4 text-12 text-word-3"
|
|
225
|
-
}, We = { class: "truncate" }, Ge = ["datetime"], Ke = { class: "truncate" }, qe = {
|
|
226
|
-
key: 3,
|
|
227
|
-
class: "flex items-center gap-4 text-12 text-word-3"
|
|
228
|
-
}, Je = {
|
|
229
|
-
key: 0,
|
|
230
|
-
class: "pk-chatbot-message pk-chatbot-message--assistant pk-chatbot-message--loading"
|
|
231
|
-
}, Ye = { class: "pk-chatbot-message__loading-info" }, Xe = { class: "flex gap-8 items-center" }, Ze = { class: "text-12" }, Qe = ["title", "aria-label"], $e = /* @__PURE__ */ P({
|
|
232
|
-
__name: "PkChatbotMessages",
|
|
233
|
-
props: {
|
|
234
|
-
status: {},
|
|
235
|
-
messages: {},
|
|
236
|
-
error: {},
|
|
237
|
-
actions: {},
|
|
238
|
-
mainColor: {},
|
|
239
|
-
textColor: {},
|
|
240
|
-
revisedAnswers: {},
|
|
241
|
-
messageFeedbacks: {},
|
|
242
|
-
readonlyFeedback: { type: Boolean },
|
|
243
|
-
disableHeightAdjustment: { type: Boolean },
|
|
244
|
-
showMessageDateTime: { type: Boolean },
|
|
245
|
-
showMessageTokensCount: { type: Boolean },
|
|
246
|
-
showAllMessageParts: { type: Boolean },
|
|
247
|
-
interactive: { type: Boolean },
|
|
248
|
-
showExtendedSteps: { type: Boolean },
|
|
249
|
-
awaitingSpokenAnswer: { type: Boolean },
|
|
250
|
-
confirmVerdictsOnCall: {},
|
|
251
|
-
isDark: { type: Boolean },
|
|
252
|
-
showScrollToBottom: { type: Boolean },
|
|
253
|
-
feedbackMessageId: {},
|
|
254
|
-
feedbackLoading: { type: Boolean },
|
|
255
|
-
feedbackSubmitted: { type: Boolean },
|
|
256
|
-
feedbackError: {}
|
|
257
|
-
},
|
|
258
|
-
emits: [
|
|
259
|
-
"show-info",
|
|
260
|
-
"regenerate",
|
|
261
|
-
"revise",
|
|
262
|
-
"upvote",
|
|
263
|
-
"downvote",
|
|
264
|
-
"feedback",
|
|
265
|
-
"feedback-submit",
|
|
266
|
-
"feedback-close",
|
|
267
|
-
"scroll-up",
|
|
268
|
-
"scroll-down",
|
|
269
|
-
"auto-retry",
|
|
270
|
-
"reset-chat",
|
|
271
|
-
"approval-respond",
|
|
272
|
-
"confirm-respond"
|
|
273
|
-
],
|
|
274
|
-
setup(e, { emit: x }) {
|
|
275
|
-
let N = e, P = x, { t: L, d: G, n: he } = me({ useScope: "global" }), _e = fe(), ve = (e, t) => {
|
|
276
|
-
if (v(e)) {
|
|
277
|
-
let n = e.toolCallId;
|
|
278
|
-
n && P("confirm-respond", {
|
|
279
|
-
toolCallId: n,
|
|
280
|
-
confirmed: t
|
|
281
|
-
});
|
|
282
|
-
return;
|
|
283
|
-
}
|
|
284
|
-
let n = b(e);
|
|
285
|
-
n && P("approval-respond", {
|
|
286
|
-
id: n,
|
|
287
|
-
approved: t
|
|
288
|
-
});
|
|
289
|
-
}, K = pe("scrollEl"), q = pe("wrapperEl"), be = D(() => g(N.textColor, N.mainColor)), { handleScroll: xe, scrollToBottom: Ce, userScrolledUp: we, isAtBottom: $e } = Te({
|
|
290
|
-
scrollEl: K,
|
|
291
|
-
status: () => N.status,
|
|
292
|
-
messagesLength: () => N.messages?.length,
|
|
293
|
-
lastMessageRole: () => N.messages?.[N.messages.length - 1]?.role,
|
|
294
|
-
contentEl: () => q.value,
|
|
295
|
-
beforeNewMessageScroll: () => ct(),
|
|
296
|
-
onScrollUp: () => P("scroll-up"),
|
|
297
|
-
onScrollDown: () => P("scroll-down")
|
|
298
|
-
}), et = () => {
|
|
299
|
-
we.value = !1, Ce();
|
|
300
|
-
}, J = D(() => (N.messages ?? []).filter((e) => e.role === "user").map((e) => ({
|
|
301
|
-
id: e.id,
|
|
302
|
-
preview: e.parts.find(s)?.text.trim().slice(0, 120) || "…"
|
|
303
|
-
}))), tt = z(), nt = () => K.value?.querySelectorAll(".pk-chatbot-message--user") ?? [], rt = () => {
|
|
304
|
-
let e = K.value;
|
|
305
|
-
if (!e || !N.showScrollToBottom) return;
|
|
306
|
-
let t = e.getBoundingClientRect().top + e.clientHeight / 2, n = J.value[0]?.id;
|
|
307
|
-
nt().forEach((e, r) => {
|
|
308
|
-
e.getBoundingClientRect().top <= t && (n = J.value[r]?.id);
|
|
309
|
-
}), tt.value = n;
|
|
310
|
-
};
|
|
311
|
-
H(J, async () => {
|
|
312
|
-
await F(), rt();
|
|
313
|
-
});
|
|
314
|
-
let it = () => {
|
|
315
|
-
xe(), rt();
|
|
316
|
-
}, at = (e) => {
|
|
317
|
-
let t = K.value, n = J.value.findIndex((t) => t.id === e), r = nt()[n];
|
|
318
|
-
!t || !r || (we.value = !0, t.scrollTo({
|
|
319
|
-
top: t.scrollTop + r.getBoundingClientRect().top - t.getBoundingClientRect().top - Number.parseFloat(getComputedStyle(t).paddingTop),
|
|
320
|
-
behavior: "smooth"
|
|
321
|
-
}));
|
|
322
|
-
}, ot = z(0), st = z(!1), ct = async () => {
|
|
323
|
-
let e = N.messages;
|
|
324
|
-
if (!e?.length || N.disableHeightAdjustment || e[e.length - 1].role !== "user" && N.status !== "submitted" && N.status !== "streaming" || (st.value = !1, await F(), !K.value)) return;
|
|
325
|
-
let { paddingTop: t, paddingBottom: n } = getComputedStyle(K.value), r = K.value.clientHeight - Number.parseFloat(t) - Number.parseFloat(n), i = q.value && Number.parseFloat(getComputedStyle(q.value).rowGap) || 0, a = nt(), o = r - (a[a.length - 1]?.clientHeight ?? 0) - i;
|
|
326
|
-
o > 0 && (ot.value = o), await F();
|
|
327
|
-
};
|
|
328
|
-
H(() => [N.messages?.length, N.messages?.[N.messages.length - 1]?.id], () => ct()), ce(() => {
|
|
329
|
-
(N.status === "submitted" || N.status === "streaming") && ct();
|
|
330
|
-
}), H(() => N.status, (e) => {
|
|
331
|
-
(e === "ready" || e === "error") && (st.value = !0, ot.value = 0);
|
|
332
|
-
});
|
|
333
|
-
let lt = (e) => N.revisedAnswers?.some((t) => t.messageId === e), Y = (e) => N.messageFeedbacks?.find((t) => t.messageId === e), ut = (e, t) => !N.readonlyFeedback && Et(e, t), dt = (e) => N.readonlyFeedback ? Y(e) : void 0, ft = (e) => dt(e)?.vote, pt = (e) => {
|
|
334
|
-
let t = dt(e);
|
|
335
|
-
if (t?.vote) return;
|
|
336
|
-
let n = t?.metadata?.reactionEmoji;
|
|
337
|
-
return typeof n == "string" && /\p{Extended_Pictographic}/u.test(n) ? n : void 0;
|
|
338
|
-
}, mt = (e) => !!(ft(e) || pt(e)), ht = (e) => {
|
|
339
|
-
if (pt(e)) return "pk-chatbot-message__reaction--neutral";
|
|
340
|
-
let t = ft(e);
|
|
341
|
-
return t === "upvote" ? "pk-chatbot-message__reaction--positive" : t === "downvote" ? "pk-chatbot-message__reaction--negative" : "pk-chatbot-message__reaction--neutral";
|
|
342
|
-
}, gt = (e) => {
|
|
343
|
-
let t = ft(e);
|
|
344
|
-
return L(t === "upvote" ? "hint.userFeedbackPositive" : t === "downvote" ? "hint.userFeedbackNegative" : "hint.userFeedbackReaction");
|
|
345
|
-
}, _t = (e) => {
|
|
346
|
-
let t = bt(e);
|
|
347
|
-
for (let e = t.length - 1; e >= 0; --e) if (s(t[e])) return e;
|
|
348
|
-
return -1;
|
|
349
|
-
}, vt = D(() => N.messages?.[N.messages.length - 1]), X = D(() => {
|
|
350
|
-
let e = vt.value;
|
|
351
|
-
return e ? e.parts[e.parts.length - 1] : null;
|
|
352
|
-
}), yt = D(() => {
|
|
353
|
-
let e = /* @__PURE__ */ new Map();
|
|
354
|
-
for (let t of N.messages ?? []) t.role === "assistant" && e.set(t.id, _(t.parts));
|
|
355
|
-
return e;
|
|
356
|
-
}), bt = (e) => yt.value.get(e.id) ?? e.parts, Z = D(() => N.status === "submitted" || N.status === "streaming"), xt = D(() => N.status === "error"), St = D(() => {
|
|
357
|
-
let e = X.value;
|
|
358
|
-
return m(L, e);
|
|
359
|
-
}), Ct = D(() => {
|
|
360
|
-
let e = X.value;
|
|
361
|
-
return p(e);
|
|
362
|
-
}), wt = (e) => N.messages?.findIndex((t) => t.id === e), Q = (e) => e === void 0 || !N.messages ? !1 : e === N.messages.length - 1, Tt = (e) => Q(e) && N.status === "ready" && !!N.actions?.includes("regenerate"), Et = (e, t) => (!Q(t) || N.status === "ready") && !!N.actions?.includes(e), Dt = (e) => {
|
|
363
|
-
let t = e.parts[e.parts.length - 1];
|
|
364
|
-
return s(t);
|
|
365
|
-
}, Ot = (e) => e.parts.some((e) => a(e) || i(e)), kt = (e) => !!N.showExtendedSteps && $(e) && Ot(e), $ = (e) => e.role === "assistant", At = (e) => e.role === "user", jt = (e) => N.messages?.slice(0, e).reverse().find((e) => $(e)), Mt = (e) => N.messages?.slice(e + 1).find((e) => $(e)), Nt = (e) => {
|
|
366
|
-
let t = jt(e)?.metadata?.createdAt, n = Mt(e)?.metadata?.createdAt;
|
|
367
|
-
if (!t || !n) return;
|
|
368
|
-
let r = new Date(t), i = new Date(n);
|
|
369
|
-
return r.toDateString() === i.toDateString() ? void 0 : i;
|
|
370
|
-
}, Pt = (e, t) => t === 0 || e.role !== "assistant" ? !1 : !!(N.actions?.length || N.showMessageDateTime && e.metadata?.createdAt !== void 0 || e.metadata?.completedAt !== void 0 || N.showMessageTokensCount && e.metadata?.totalTokens !== void 0), Ft = (e) => {
|
|
371
|
-
let t = new Date(e), n = t.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
|
|
372
|
-
return G(t, n ? "time" : "date-time");
|
|
373
|
-
}, It = (e) => {
|
|
374
|
-
let { createdAt: t, completedAt: n } = e.metadata ?? {};
|
|
375
|
-
if (!(!t || !n)) return ee(he, n - t);
|
|
376
|
-
}, Lt = pe("feedbackMessageEl");
|
|
377
|
-
return H(() => N.feedbackMessageId, async () => {
|
|
378
|
-
if (await F(), !N.feedbackMessageId) return;
|
|
379
|
-
let e = Lt.value?.[0]?.$el;
|
|
380
|
-
if (e) {
|
|
381
|
-
if (Q(wt(N.feedbackMessageId))) {
|
|
382
|
-
Ce();
|
|
383
|
-
return;
|
|
384
|
-
}
|
|
385
|
-
e.scrollIntoView({
|
|
386
|
-
behavior: "smooth",
|
|
387
|
-
block: "center"
|
|
388
|
-
});
|
|
389
|
-
}
|
|
390
|
-
}), (a, m) => {
|
|
391
|
-
let g = ie, _ = C, ee = w;
|
|
392
|
-
return R(), A("div", {
|
|
393
|
-
ref_key: "scrollEl",
|
|
394
|
-
ref: K,
|
|
395
|
-
class: I(["pk-chatbot-messages", { "pk-chatbot-messages--settling": st.value }]),
|
|
396
|
-
role: "log",
|
|
397
|
-
"aria-live": "polite",
|
|
398
|
-
"aria-relevant": "additions text",
|
|
399
|
-
"aria-busy": Z.value,
|
|
400
|
-
style: se({
|
|
401
|
-
"--chatbot-main-color": e.mainColor,
|
|
402
|
-
"--chatbot-contrast-color": be.value
|
|
403
|
-
}),
|
|
404
|
-
onScroll: it
|
|
405
|
-
}, [
|
|
406
|
-
e.showScrollToBottom && J.value.length > 1 ? (R(), A("div", De, [M(S, {
|
|
407
|
-
items: J.value,
|
|
408
|
-
"active-id": tt.value,
|
|
409
|
-
onSelect: at
|
|
410
|
-
}, null, 8, ["items", "active-id"])])) : k("", !0),
|
|
411
|
-
j("div", {
|
|
412
|
-
ref_key: "wrapperEl",
|
|
413
|
-
ref: q,
|
|
414
|
-
class: "pk-chatbot-messages__wrapper"
|
|
415
|
-
}, [
|
|
416
|
-
(R(!0), A(T, null, le(e.messages, (t, b) => (R(), A(T, { key: t.id }, [At(t) && Nt(b) ? (R(), A("div", Oe, [j("span", ke, B(V(G)(Nt(b), "short")), 1)])) : k("", !0), t.parts.length || Q(b) && Z.value && $(t) ? (R(), A("div", {
|
|
417
|
-
key: 1,
|
|
418
|
-
class: I(["pk-chatbot-message", [`pk-chatbot-message--${t.role}`, { "pk-chatbot-message--loading": Z.value && Q(b) && $(t) }]]),
|
|
419
|
-
style: se({ minHeight: Q(b) && $(t) && !xt.value ? `${ot.value}px` : void 0 })
|
|
420
|
-
}, [
|
|
421
|
-
M(E, {
|
|
422
|
-
appear: "",
|
|
423
|
-
name: "pk-chatbot-part"
|
|
424
|
-
}, {
|
|
425
|
-
default: U(() => [kt(t) ? (R(), O(re, {
|
|
426
|
-
key: 0,
|
|
427
|
-
message: t,
|
|
428
|
-
"is-streaming": Z.value && Q(b),
|
|
429
|
-
"is-dark": e.isDark
|
|
430
|
-
}, null, 8, [
|
|
431
|
-
"message",
|
|
432
|
-
"is-streaming",
|
|
433
|
-
"is-dark"
|
|
434
|
-
])) : k("", !0)]),
|
|
435
|
-
_: 2
|
|
436
|
-
}, 1024),
|
|
437
|
-
(R(!0), A(T, null, le(bt(t), (l, d) => (R(), A(T, { key: d }, [V(s)(l) && l.text.trim() ? (R(), O(E, {
|
|
438
|
-
key: 0,
|
|
439
|
-
appear: "",
|
|
440
|
-
name: "pk-chatbot-part"
|
|
441
|
-
}, {
|
|
442
|
-
default: U(() => [j("div", Ae, [ue(a.$slots, "text", oe({ ref_for: !0 }, {
|
|
443
|
-
message: t,
|
|
444
|
-
part: l,
|
|
445
|
-
index: b,
|
|
446
|
-
isLoading: Z.value
|
|
447
|
-
}), () => [$(t) ? (R(), O(n, {
|
|
448
|
-
key: 0,
|
|
449
|
-
class: "wysiwyg",
|
|
450
|
-
markdown: l.text,
|
|
451
|
-
"is-dark": e.isDark,
|
|
452
|
-
loading: Q(b) && e.status === "streaming"
|
|
453
|
-
}, null, 8, [
|
|
454
|
-
"markdown",
|
|
455
|
-
"is-dark",
|
|
456
|
-
"loading"
|
|
457
|
-
])) : (R(), A(T, { key: 1 }, [ae(B(l.text), 1)], 64))]), mt(t.id) && !Y(t.id)?.comment && d === _t(t) ? (R(), A("span", {
|
|
458
|
-
key: 0,
|
|
459
|
-
class: I(["pk-chatbot-message__reaction", ht(t.id)]),
|
|
460
|
-
title: gt(t.id)
|
|
461
|
-
}, [pt(t.id) ? (R(), A("span", Me, B(pt(t.id)), 1)) : (R(), O(g, {
|
|
462
|
-
key: 1,
|
|
463
|
-
name: ft(t.id) === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-up-fill"
|
|
464
|
-
}, null, 8, ["name"]))], 10, je)) : k("", !0)])]),
|
|
465
|
-
_: 2
|
|
466
|
-
}, 1024)) : V(r)(l) ? (R(), O(E, {
|
|
467
|
-
key: 1,
|
|
468
|
-
appear: "",
|
|
469
|
-
name: "pk-chatbot-part"
|
|
470
|
-
}, {
|
|
471
|
-
default: U(() => [M(u, {
|
|
472
|
-
"media-type": l.mediaType,
|
|
473
|
-
url: l.url,
|
|
474
|
-
filename: l.filename,
|
|
475
|
-
size: V(c)(l)?.bytesCount
|
|
476
|
-
}, null, 8, [
|
|
477
|
-
"media-type",
|
|
478
|
-
"url",
|
|
479
|
-
"filename",
|
|
480
|
-
"size"
|
|
481
|
-
])]),
|
|
482
|
-
_: 2
|
|
483
|
-
}, 1024)) : V(h)(l) && !V(y)(l) ? (R(), O(E, {
|
|
484
|
-
key: 2,
|
|
485
|
-
appear: "",
|
|
486
|
-
name: "pk-chatbot-part"
|
|
487
|
-
}, {
|
|
488
|
-
default: U(() => [(R(), O(Se, {
|
|
489
|
-
key: `approval-${d}`,
|
|
490
|
-
part: l,
|
|
491
|
-
actionable: e.interactive === !0 && (V(v)(l) || Q(b)),
|
|
492
|
-
"call-verdict": e.confirmVerdictsOnCall?.get(l.toolCallId ?? ""),
|
|
493
|
-
onRespond: (e) => ve(l, e)
|
|
494
|
-
}, null, 8, [
|
|
495
|
-
"part",
|
|
496
|
-
"actionable",
|
|
497
|
-
"call-verdict",
|
|
498
|
-
"onRespond"
|
|
499
|
-
]))]),
|
|
500
|
-
_: 2
|
|
501
|
-
}, 1024)) : V(i)(l) && !V(y)(l) && (V(ye)[V(o)(l)] || V(_e)[l.type] || e.showAllMessageParts) ? (R(), O(E, {
|
|
502
|
-
key: 3,
|
|
503
|
-
appear: "",
|
|
504
|
-
name: "pk-chatbot-part"
|
|
505
|
-
}, {
|
|
506
|
-
default: U(() => [!V(_e)[l.type] && V(ye)[V(o)(l)] ? (R(), O(de(V(ye)[V(o)(l)]), {
|
|
507
|
-
key: `component-${d}-${V(te)(l)}`,
|
|
508
|
-
part: l
|
|
509
|
-
}, null, 8, ["part"])) : ue(a.$slots, l.type, oe({ ref_for: !0 }, {
|
|
510
|
-
message: t,
|
|
511
|
-
part: l,
|
|
512
|
-
index: b,
|
|
513
|
-
isLoading: Z.value
|
|
514
|
-
}), () => [e.showAllMessageParts ? (R(), A("div", Ne, [j("div", Pe, [V(p)(l) ? (R(), O(g, {
|
|
515
|
-
key: 0,
|
|
516
|
-
name: V(p)(l),
|
|
517
|
-
class: "shrink-0"
|
|
518
|
-
}, null, 8, ["name"])) : k("", !0), j("code", Fe, B(V(ge)(l.type)), 1)])])) : k("", !0)], void 0, 1)]),
|
|
519
|
-
_: 2
|
|
520
|
-
}, 1024)) : k("", !0), M(E, { mode: "out-in" }, {
|
|
521
|
-
default: U(() => [d === _t(t) && e.readonlyFeedback && Y(t.id)?.comment ? (R(), O(f, {
|
|
522
|
-
key: 0,
|
|
523
|
-
feedback: Y(t.id)
|
|
524
|
-
}, null, 8, ["feedback"])) : k("", !0)]),
|
|
525
|
-
_: 2
|
|
526
|
-
}, 1024)], 64))), 128)),
|
|
527
|
-
M(E, {
|
|
528
|
-
name: "fade-in",
|
|
529
|
-
mode: "out-in"
|
|
530
|
-
}, {
|
|
531
|
-
default: U(() => [Z.value && Q(b) && !Dt(t) && $(t) && !kt(t) ? (R(), A("div", {
|
|
532
|
-
key: `loading-info-${t.id}`,
|
|
533
|
-
class: "pk-chatbot-message__loading-info"
|
|
534
|
-
}, [j("div", Ie, [
|
|
535
|
-
M(g, {
|
|
536
|
-
name: "line-md:loading-loop",
|
|
537
|
-
class: "shrink-0"
|
|
538
|
-
}),
|
|
539
|
-
M(E, { mode: "out-in" }, {
|
|
540
|
-
default: U(() => [Ct.value ? (R(), O(g, {
|
|
541
|
-
key: Ct.value,
|
|
542
|
-
class: "shrink-0",
|
|
543
|
-
name: Ct.value
|
|
544
|
-
}, null, 8, ["name"])) : k("", !0)]),
|
|
545
|
-
_: 1
|
|
546
|
-
}),
|
|
547
|
-
M(E, { mode: "out-in" }, {
|
|
548
|
-
default: U(() => [St.value ? (R(), A("span", {
|
|
549
|
-
key: St.value,
|
|
550
|
-
class: "text-12"
|
|
551
|
-
}, B(St.value), 1)) : k("", !0)]),
|
|
552
|
-
_: 1
|
|
553
|
-
})
|
|
554
|
-
]), M(E, {
|
|
555
|
-
name: "fade-in",
|
|
556
|
-
mode: "out-in"
|
|
557
|
-
}, {
|
|
558
|
-
default: U(() => [X.value && "text" in X.value && X.value.text.trim() ? (R(), O(ne, {
|
|
559
|
-
key: 0,
|
|
560
|
-
markdown: X.value.text,
|
|
561
|
-
"is-dark": e.isDark,
|
|
562
|
-
"inner-class": "wysiwyg",
|
|
563
|
-
class: "border border-surface-4 rounded p-4 mt-8 bg-surface-1 max-h-64 text-12 w-full"
|
|
564
|
-
}, null, 8, ["markdown", "is-dark"])) : k("", !0)]),
|
|
565
|
-
_: 1
|
|
566
|
-
})])) : k("", !0)]),
|
|
567
|
-
_: 2
|
|
568
|
-
}, 1024),
|
|
569
|
-
M(E, { mode: "out-in" }, {
|
|
570
|
-
default: U(() => [Pt(t, b) ? (R(), A("div", Le, [
|
|
571
|
-
M(ee, {
|
|
572
|
-
modifiers: "compact",
|
|
573
|
-
class: "mr-auto shrink-0"
|
|
574
|
-
}, {
|
|
575
|
-
default: U(() => [
|
|
576
|
-
M(E, { mode: "out-in" }, {
|
|
577
|
-
default: U(() => [Tt(b) ? (R(), O(_, {
|
|
578
|
-
key: 0,
|
|
579
|
-
icon: "ri:reset-right-line",
|
|
580
|
-
modifiers: "action-quiet-small",
|
|
581
|
-
title: V(L)("action.regenerate"),
|
|
582
|
-
"aria-label": V(L)("action.regenerate"),
|
|
583
|
-
onClick: m[0] ||= W((e) => a.$emit("regenerate"), ["stop"])
|
|
584
|
-
}, null, 8, ["title", "aria-label"])) : k("", !0)]),
|
|
585
|
-
_: 2
|
|
586
|
-
}, 1024),
|
|
587
|
-
M(E, { mode: "out-in" }, {
|
|
588
|
-
default: U(() => [Et("show-info", b) ? (R(), O(_, {
|
|
589
|
-
key: 0,
|
|
590
|
-
icon: "ri:information-line",
|
|
591
|
-
title: V(L)("action.getMoreInfo"),
|
|
592
|
-
"aria-label": V(L)("action.getMoreInfo"),
|
|
593
|
-
modifiers: "action-quiet-small",
|
|
594
|
-
onClick: W((e) => a.$emit("show-info", t), ["stop"])
|
|
595
|
-
}, null, 8, [
|
|
596
|
-
"title",
|
|
597
|
-
"aria-label",
|
|
598
|
-
"onClick"
|
|
599
|
-
])) : k("", !0)]),
|
|
600
|
-
_: 2
|
|
601
|
-
}, 1024),
|
|
602
|
-
M(E, { mode: "out-in" }, {
|
|
603
|
-
default: U(() => [Et("revise", b) ? (R(), O(_, {
|
|
604
|
-
key: 0,
|
|
605
|
-
icon: lt(t.id) ? "ri:file-edit-fill" : "ri:file-edit-line",
|
|
606
|
-
title: lt(t.id) ? V(L)("action.editRevise") : V(L)("action.createRevise"),
|
|
607
|
-
"aria-label": lt(t.id) ? V(L)("action.editRevise") : V(L)("action.createRevise"),
|
|
608
|
-
modifiers: "action-quiet-small",
|
|
609
|
-
class: I({ "text-brand": lt(t.id) }),
|
|
610
|
-
onClick: W((e) => a.$emit("revise", t), ["stop"])
|
|
611
|
-
}, null, 8, [
|
|
612
|
-
"icon",
|
|
613
|
-
"title",
|
|
614
|
-
"aria-label",
|
|
615
|
-
"class",
|
|
616
|
-
"onClick"
|
|
617
|
-
])) : k("", !0)]),
|
|
618
|
-
_: 2
|
|
619
|
-
}, 1024),
|
|
620
|
-
M(E, { mode: "out-in" }, {
|
|
621
|
-
default: U(() => [ut("upvote", b) ? (R(), O(_, {
|
|
622
|
-
key: 0,
|
|
623
|
-
icon: Y(t.id)?.vote === "upvote" ? "ri:thumb-up-fill" : "ri:thumb-up-line",
|
|
624
|
-
title: V(L)("action.upvote"),
|
|
625
|
-
"aria-label": V(L)("action.upvote"),
|
|
626
|
-
modifiers: "action-quiet-small",
|
|
627
|
-
onClick: W((e) => a.$emit("upvote", t), ["stop"])
|
|
628
|
-
}, null, 8, [
|
|
629
|
-
"icon",
|
|
630
|
-
"title",
|
|
631
|
-
"aria-label",
|
|
632
|
-
"onClick"
|
|
633
|
-
])) : k("", !0)]),
|
|
634
|
-
_: 2
|
|
635
|
-
}, 1024),
|
|
636
|
-
M(E, { mode: "out-in" }, {
|
|
637
|
-
default: U(() => [ut("downvote", b) ? (R(), O(_, {
|
|
638
|
-
key: 0,
|
|
639
|
-
icon: Y(t.id)?.vote === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-down-line",
|
|
640
|
-
title: V(L)("action.downvote"),
|
|
641
|
-
"aria-label": V(L)("action.downvote"),
|
|
642
|
-
modifiers: "action-quiet-small",
|
|
643
|
-
onClick: W((e) => a.$emit("downvote", t), ["stop"])
|
|
644
|
-
}, null, 8, [
|
|
645
|
-
"icon",
|
|
646
|
-
"title",
|
|
647
|
-
"aria-label",
|
|
648
|
-
"onClick"
|
|
649
|
-
])) : k("", !0)]),
|
|
650
|
-
_: 2
|
|
651
|
-
}, 1024),
|
|
652
|
-
M(E, { mode: "out-in" }, {
|
|
653
|
-
default: U(() => [ut("feedback", b) ? (R(), O(_, {
|
|
654
|
-
key: 0,
|
|
655
|
-
icon: Y(t.id)?.comment ? "ri:feedback-fill" : "ri:feedback-line",
|
|
656
|
-
title: V(L)("action.feedback"),
|
|
657
|
-
"aria-label": V(L)("action.feedback"),
|
|
658
|
-
modifiers: "action-quiet-small",
|
|
659
|
-
onClick: W((e) => a.$emit("feedback", t), ["stop"])
|
|
660
|
-
}, null, 8, [
|
|
661
|
-
"icon",
|
|
662
|
-
"title",
|
|
663
|
-
"aria-label",
|
|
664
|
-
"onClick"
|
|
665
|
-
])) : k("", !0)]),
|
|
666
|
-
_: 2
|
|
667
|
-
}, 1024)
|
|
668
|
-
]),
|
|
669
|
-
_: 2
|
|
670
|
-
}, 1024),
|
|
671
|
-
!e.showMessageDateTime && t.metadata?.createdAt && t.metadata?.completedAt ? (R(), A("div", Re, [j("time", {
|
|
672
|
-
datetime: new Date(t.metadata.createdAt).toISOString(),
|
|
673
|
-
title: V(G)(new Date(t.metadata.createdAt), "date-time"),
|
|
674
|
-
class: "flex items-center gap-4 min-w-0"
|
|
675
|
-
}, [M(g, {
|
|
676
|
-
name: "ri:time-line",
|
|
677
|
-
class: "shrink-0"
|
|
678
|
-
}), j("span", Be, B(Ft(t.metadata.createdAt)), 1)], 8, ze), It(t) ? (R(), A("span", Ve, [M(g, {
|
|
679
|
-
name: "ri:hourglass-line",
|
|
680
|
-
class: "shrink-0"
|
|
681
|
-
}), j("span", He, B(It(t)), 1)])) : k("", !0)])) : k("", !0),
|
|
682
|
-
e.showMessageTokensCount && t.metadata?.totalTokens ? (R(), A("span", Ue, [M(g, {
|
|
683
|
-
name: "ri:ai-generate-2-line",
|
|
684
|
-
class: "shrink-0"
|
|
685
|
-
}), j("span", We, B(V(he)(t.metadata.totalTokens, "integer")) + " " + B(V(L)("label.tokens")), 1)])) : k("", !0),
|
|
686
|
-
e.showMessageDateTime && t.metadata?.createdAt ? (R(), A("time", {
|
|
687
|
-
key: 2,
|
|
688
|
-
datetime: new Date(t.metadata?.createdAt).toISOString(),
|
|
689
|
-
class: "flex items-center gap-4 text-12 text-word-3"
|
|
690
|
-
}, [M(g, {
|
|
691
|
-
name: "ri:time-line",
|
|
692
|
-
class: "shrink-0"
|
|
693
|
-
}), j("span", Ke, B(V(G)(new Date(t.metadata?.createdAt), "date-time")), 1)], 8, Ge)) : k("", !0),
|
|
694
|
-
e.showMessageDateTime && t?.metadata?.completedAt && t?.metadata?.createdAt ? (R(), A("div", qe, [M(g, {
|
|
695
|
-
name: "ri:hourglass-line",
|
|
696
|
-
class: "shrink-0"
|
|
697
|
-
}), M(l, {
|
|
698
|
-
class: "truncate",
|
|
699
|
-
date: t.metadata?.createdAt,
|
|
700
|
-
"end-date": t.metadata?.completedAt
|
|
701
|
-
}, null, 8, ["date", "end-date"])])) : k("", !0)
|
|
702
|
-
])) : k("", !0)]),
|
|
703
|
-
_: 2
|
|
704
|
-
}, 1024),
|
|
705
|
-
M(E, { mode: "out-in" }, {
|
|
706
|
-
default: U(() => [t.id === e.feedbackMessageId ? (R(), O(d, {
|
|
707
|
-
key: 0,
|
|
708
|
-
ref_for: !0,
|
|
709
|
-
ref_key: "feedbackMessageEl",
|
|
710
|
-
ref: Lt,
|
|
711
|
-
loading: e.feedbackLoading,
|
|
712
|
-
submitted: e.feedbackSubmitted,
|
|
713
|
-
error: e.feedbackError,
|
|
714
|
-
onSubmit: m[1] ||= (e) => a.$emit("feedback-submit", e),
|
|
715
|
-
onClose: m[2] ||= (e) => a.$emit("feedback-close")
|
|
716
|
-
}, null, 8, [
|
|
717
|
-
"loading",
|
|
718
|
-
"submitted",
|
|
719
|
-
"error"
|
|
720
|
-
])) : k("", !0)]),
|
|
721
|
-
_: 2
|
|
722
|
-
}, 1024)
|
|
723
|
-
], 6)) : k("", !0)], 64))), 128)),
|
|
724
|
-
M(E, {
|
|
725
|
-
appear: "",
|
|
726
|
-
name: "pk-chatbot-part"
|
|
727
|
-
}, {
|
|
728
|
-
default: U(() => [e.awaitingSpokenAnswer ? (R(), A("div", Je, [j("div", Ye, [j("div", Xe, [M(g, {
|
|
729
|
-
name: "line-md:loading-loop",
|
|
730
|
-
class: "shrink-0"
|
|
731
|
-
}), j("span", Ze, B(V(L)("label.answeringOnTheCall")), 1)])])])) : k("", !0)]),
|
|
732
|
-
_: 1
|
|
733
|
-
}),
|
|
734
|
-
M(E, {
|
|
735
|
-
appear: "",
|
|
736
|
-
name: "pk-chatbot-part"
|
|
737
|
-
}, {
|
|
738
|
-
default: U(() => [xt.value ? (R(), O(t, {
|
|
739
|
-
key: 0,
|
|
740
|
-
error: e.error,
|
|
741
|
-
onRetry: m[3] ||= (e) => a.$emit("auto-retry"),
|
|
742
|
-
onReset: m[4] ||= (e) => a.$emit("reset-chat")
|
|
743
|
-
}, null, 8, ["error"])) : k("", !0)]),
|
|
744
|
-
_: 1
|
|
745
|
-
}),
|
|
746
|
-
vt.value?.role === "user" || xt.value ? (R(), A("div", {
|
|
747
|
-
key: 0,
|
|
748
|
-
class: "pk-chatbot-messages__spacer",
|
|
749
|
-
style: se({ minHeight: `${ot.value}px` })
|
|
750
|
-
}, null, 4)) : k("", !0)
|
|
751
|
-
], 512),
|
|
752
|
-
M(E, { name: "pk-chatbot-messages-fab" }, {
|
|
753
|
-
default: U(() => [e.showScrollToBottom && (V(we) || !V($e)) ? (R(), A("button", {
|
|
754
|
-
key: 0,
|
|
755
|
-
type: "button",
|
|
756
|
-
class: "pk-chatbot-messages__scroll-to-bottom",
|
|
757
|
-
title: V(L)("action.scrollToBottom"),
|
|
758
|
-
"aria-label": V(L)("action.scrollToBottom"),
|
|
759
|
-
onClick: et
|
|
760
|
-
}, [M(g, { name: "ri:arrow-down-line" })], 8, Qe)) : k("", !0)]),
|
|
761
|
-
_: 1
|
|
762
|
-
})
|
|
763
|
-
], 46, Ee);
|
|
764
|
-
};
|
|
765
|
-
}
|
|
766
|
-
});
|
|
767
|
-
//#endregion
|
|
768
|
-
export { _e as a, ge as i, ve as n, he as r, $e as t };
|
|
769
|
-
|
|
770
|
-
//# sourceMappingURL=PkChatbotMessages-CWPSx2ce.js.map
|