@8wave/ai-elements 0.125.0-beta.39 → 0.125.0-beta.40

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