@8wave/ai-elements 0.123.0-beta.2 → 0.123.0-beta.4

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