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