@8wave/ai-elements 0.111.0-beta.7 → 0.111.0-beta.8

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