@8wave/ai-elements 0.119.0-beta.31 → 0.119.0-beta.33

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 (141) hide show
  1. package/dist/_chunks/{PkChatbotFilePreview-DiuzVVKH.js → PkChatbotFilePreview-3i9jZIdS.js} +2 -2
  2. package/dist/_chunks/{PkChatbotFilePreview-DiuzVVKH.js.map → PkChatbotFilePreview-3i9jZIdS.js.map} +1 -1
  3. package/dist/_chunks/{PkStreamingMarkdown-DKyHYHUN.js → PkStreamingMarkdown-B1t1tBvW.js} +3 -3
  4. package/dist/_chunks/{PkStreamingMarkdown-DKyHYHUN.js.map → PkStreamingMarkdown-B1t1tBvW.js.map} +1 -1
  5. package/dist/_chunks/{PkToolEditSpreadsheet-CfJ3BWMe.js → PkToolEditSpreadsheet-Xzum_9NH.js} +2 -2
  6. package/dist/_chunks/{PkToolEditSpreadsheet-CfJ3BWMe.js.map → PkToolEditSpreadsheet-Xzum_9NH.js.map} +1 -1
  7. package/dist/_chunks/{PkToolRequestOAuthConnection-klmrRZWz.js → PkToolRequestOAuthConnection-W3ilzpr7.js} +2 -2
  8. package/dist/_chunks/{PkToolRequestOAuthConnection-klmrRZWz.js.map → PkToolRequestOAuthConnection-W3ilzpr7.js.map} +1 -1
  9. package/dist/_chunks/{PkToolShowArtifact-ChDm6ZEK.js → PkToolShowArtifact-DGGEb2LF.js} +2 -2
  10. package/dist/_chunks/{PkToolShowArtifact-ChDm6ZEK.js.map → PkToolShowArtifact-DGGEb2LF.js.map} +1 -1
  11. package/dist/_chunks/{PkToolShowCalendarEvent-CRVtR3oP.js → PkToolShowCalendarEvent-D8DMh3-P.js} +2 -2
  12. package/dist/_chunks/{PkToolShowCalendarEvent-CRVtR3oP.js.map → PkToolShowCalendarEvent-D8DMh3-P.js.map} +1 -1
  13. package/dist/_chunks/PkToolShowContactForm-Dn6CEXF_.js +158 -0
  14. package/dist/_chunks/PkToolShowContactForm-Dn6CEXF_.js.map +1 -0
  15. package/dist/_chunks/{PkToolShowDiagram-JpRMa4Jj.js → PkToolShowDiagram-WregKAJO.js} +3 -3
  16. package/dist/_chunks/{PkToolShowDiagram-JpRMa4Jj.js.map → PkToolShowDiagram-WregKAJO.js.map} +1 -1
  17. package/dist/_chunks/{PkToolShowForm-DnIwTGl4.js → PkToolShowForm-CbuToc8O.js} +2 -2
  18. package/dist/_chunks/{PkToolShowForm-DnIwTGl4.js.map → PkToolShowForm-CbuToc8O.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowImageGallery-Ab8fJ9jY.js → PkToolShowImageGallery-Dh0v2Df8.js} +4 -4
  20. package/dist/_chunks/{PkToolShowImageGallery-Ab8fJ9jY.js.map → PkToolShowImageGallery-Dh0v2Df8.js.map} +1 -1
  21. package/dist/_chunks/{PkToolShowLocation-D5d6bbP-.js → PkToolShowLocation-jRZtqoBO.js} +2 -2
  22. package/dist/_chunks/{PkToolShowLocation-D5d6bbP-.js.map → PkToolShowLocation-jRZtqoBO.js.map} +1 -1
  23. package/dist/_chunks/{PkToolShowProductList-DztzZVDd.js → PkToolShowProductList-bAis8u1t.js} +2 -2
  24. package/dist/_chunks/{PkToolShowProductList-DztzZVDd.js.map → PkToolShowProductList-bAis8u1t.js.map} +1 -1
  25. package/dist/_chunks/{PkToolShowSources-Bvg3f3GC.js → PkToolShowSources-D532Worv.js} +3 -3
  26. package/dist/_chunks/{PkToolShowSources-Bvg3f3GC.js.map → PkToolShowSources-D532Worv.js.map} +1 -1
  27. package/dist/_chunks/{PkToolShowVideo-DdoYLl7R.js → PkToolShowVideo-DcMzLibC.js} +3 -3
  28. package/dist/_chunks/{PkToolShowVideo-DdoYLl7R.js.map → PkToolShowVideo-DcMzLibC.js.map} +1 -1
  29. package/dist/_chunks/{PkToolShowWeather-CnpPZCLm.js → PkToolShowWeather-DTrZ7r1t.js} +2 -2
  30. package/dist/_chunks/{PkToolShowWeather-CnpPZCLm.js.map → PkToolShowWeather-DTrZ7r1t.js.map} +1 -1
  31. package/dist/_chunks/{PkToolShowWebPages-BooCEJrs.js → PkToolShowWebPages-RuwkZDMH.js} +3 -3
  32. package/dist/_chunks/{PkToolShowWebPages-BooCEJrs.js.map → PkToolShowWebPages-RuwkZDMH.js.map} +1 -1
  33. package/dist/_chunks/{chatImagePolicy-CfJt8_9Z.js → chatImagePolicy-BL4O14e9.js} +2 -2
  34. package/dist/_chunks/{chatImagePolicy-CfJt8_9Z.js.map → chatImagePolicy-BL4O14e9.js.map} +1 -1
  35. package/dist/_chunks/{index.es-oI6RqNZW.js → index.es-DkFMpDsf.js} +2 -2
  36. package/dist/_chunks/{index.es-oI6RqNZW.js.map → index.es-DkFMpDsf.js.map} +1 -1
  37. package/dist/_chunks/{src-DL9TKN-Z.js → src-CggZ5M7x.js} +46 -3
  38. package/dist/_chunks/src-CggZ5M7x.js.map +1 -0
  39. package/dist/_chunks/{useLightbox-1KKLemEE.js → useLightbox-3HiaRtzY.js} +2 -2
  40. package/dist/_chunks/{useLightbox-1KKLemEE.js.map → useLightbox-3HiaRtzY.js.map} +1 -1
  41. package/dist/ai-elements.es.js +836 -820
  42. package/dist/ai-elements.es.js.map +1 -1
  43. package/dist-vue/PkChatbot.js +1 -1
  44. package/dist-vue/PkChatbotAudioTranscript.js +1 -1
  45. package/dist-vue/PkChatbotEmptyState.js +1 -1
  46. package/dist-vue/PkChatbotFilePreview.js +1 -1
  47. package/dist-vue/PkChatbotInput.js +1 -1
  48. package/dist-vue/PkChatbotMessages.js +1 -1
  49. package/dist-vue/PkChatbotStepPayload.js +1 -1
  50. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  51. package/dist-vue/PkChatbotSteps.js +1 -1
  52. package/dist-vue/PkChatbotViewChat.js +1 -1
  53. package/dist-vue/PkChatbotViewConversations.js +1 -1
  54. package/dist-vue/PkChatbotViewFiles.js +1 -1
  55. package/dist-vue/PkChatbotViewProfile.js +1 -1
  56. package/dist-vue/_chunks/{PkChatbot-C18mnGJ9.js → PkChatbot-wODOAtOD.js} +8 -8
  57. package/dist-vue/_chunks/{PkChatbot-C18mnGJ9.js.map → PkChatbot-wODOAtOD.js.map} +1 -1
  58. package/dist-vue/_chunks/{PkChatbotAudioTranscript-0rvrhSRQ.js → PkChatbotAudioTranscript-CC9M-zDv.js} +2 -2
  59. package/dist-vue/_chunks/{PkChatbotAudioTranscript-0rvrhSRQ.js.map → PkChatbotAudioTranscript-CC9M-zDv.js.map} +1 -1
  60. package/dist-vue/_chunks/{PkChatbotEmptyState-BKiyP0Ga.js → PkChatbotEmptyState-Dx4mTkTX.js} +2 -2
  61. package/dist-vue/_chunks/{PkChatbotEmptyState-BKiyP0Ga.js.map → PkChatbotEmptyState-Dx4mTkTX.js.map} +1 -1
  62. package/dist-vue/_chunks/{PkChatbotFilePreview-D5H-RIk2.js → PkChatbotFilePreview-Lxgu89Hg.js} +2 -2
  63. package/dist-vue/_chunks/{PkChatbotFilePreview-D5H-RIk2.js.map → PkChatbotFilePreview-Lxgu89Hg.js.map} +1 -1
  64. package/dist-vue/_chunks/{PkChatbotInput-GvgsYsUw.js → PkChatbotInput-jj3qQl_f.js} +3 -3
  65. package/dist-vue/_chunks/{PkChatbotInput-GvgsYsUw.js.map → PkChatbotInput-jj3qQl_f.js.map} +1 -1
  66. package/dist-vue/_chunks/PkChatbotMessages-5wPl7-j-.js +876 -0
  67. package/dist-vue/_chunks/PkChatbotMessages-5wPl7-j-.js.map +1 -0
  68. package/dist-vue/_chunks/{PkChatbotStepPayload-Dm-HCHcG.js → PkChatbotStepPayload-f2mYAVpu.js} +2 -2
  69. package/dist-vue/_chunks/{PkChatbotStepPayload-Dm-HCHcG.js.map → PkChatbotStepPayload-f2mYAVpu.js.map} +1 -1
  70. package/dist-vue/_chunks/{PkChatbotStepToolDetail-Bpd_cZEO.js → PkChatbotStepToolDetail-BcYheOnU.js} +3 -3
  71. package/dist-vue/_chunks/{PkChatbotStepToolDetail-Bpd_cZEO.js.map → PkChatbotStepToolDetail-BcYheOnU.js.map} +1 -1
  72. package/dist-vue/_chunks/{PkChatbotSteps-C4qBM3_t.js → PkChatbotSteps-DKyF0ykL.js} +5 -5
  73. package/dist-vue/_chunks/{PkChatbotSteps-C4qBM3_t.js.map → PkChatbotSteps-DKyF0ykL.js.map} +1 -1
  74. package/dist-vue/_chunks/{PkChatbotViewChat-By2TY72m.js → PkChatbotViewChat-DZqXDwzk.js} +8 -8
  75. package/dist-vue/_chunks/{PkChatbotViewChat-By2TY72m.js.map → PkChatbotViewChat-DZqXDwzk.js.map} +1 -1
  76. package/dist-vue/_chunks/{PkChatbotViewConversations-CU5NfEO4.js → PkChatbotViewConversations-CXcToApC.js} +4 -4
  77. package/dist-vue/_chunks/{PkChatbotViewConversations-CU5NfEO4.js.map → PkChatbotViewConversations-CXcToApC.js.map} +1 -1
  78. package/dist-vue/_chunks/{PkChatbotViewFiles-CD-UZPT5.js → PkChatbotViewFiles-O8lhbXAX.js} +2 -2
  79. package/dist-vue/_chunks/{PkChatbotViewFiles-CD-UZPT5.js.map → PkChatbotViewFiles-O8lhbXAX.js.map} +1 -1
  80. package/dist-vue/_chunks/{PkChatbotViewProfile-DPlb_Wca.js → PkChatbotViewProfile-kryFJi0l.js} +2 -2
  81. package/dist-vue/_chunks/{PkChatbotViewProfile-DPlb_Wca.js.map → PkChatbotViewProfile-kryFJi0l.js.map} +1 -1
  82. package/dist-vue/_chunks/{PkStreamingMarkdown-CsHzdW69.js → PkStreamingMarkdown-CywawRVj.js} +3 -3
  83. package/dist-vue/_chunks/{PkStreamingMarkdown-CsHzdW69.js.map → PkStreamingMarkdown-CywawRVj.js.map} +1 -1
  84. package/dist-vue/_chunks/{PkSvgViewer-D6DJ2jVO.js → PkSvgViewer-DU8K_gAD.js} +2 -2
  85. package/dist-vue/_chunks/{PkSvgViewer-D6DJ2jVO.js.map → PkSvgViewer-DU8K_gAD.js.map} +1 -1
  86. package/dist-vue/_chunks/{PkToolEditSpreadsheet-D8Zp9gzW.js → PkToolEditSpreadsheet-BT4HueLs.js} +2 -2
  87. package/dist-vue/_chunks/{PkToolEditSpreadsheet-D8Zp9gzW.js.map → PkToolEditSpreadsheet-BT4HueLs.js.map} +1 -1
  88. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DosWR9I4.js → PkToolRequestOAuthConnection-Ck2tRuls.js} +2 -2
  89. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DosWR9I4.js.map → PkToolRequestOAuthConnection-Ck2tRuls.js.map} +1 -1
  90. package/dist-vue/_chunks/{PkToolShowArtifact-BVofKJ7b.js → PkToolShowArtifact-BiFJoOTT.js} +2 -2
  91. package/dist-vue/_chunks/{PkToolShowArtifact-BVofKJ7b.js.map → PkToolShowArtifact-BiFJoOTT.js.map} +1 -1
  92. package/dist-vue/_chunks/{PkToolShowCalendarEvent-u9O_Sl3-.js → PkToolShowCalendarEvent-CFODjoDV.js} +2 -2
  93. package/dist-vue/_chunks/{PkToolShowCalendarEvent-u9O_Sl3-.js.map → PkToolShowCalendarEvent-CFODjoDV.js.map} +1 -1
  94. package/dist-vue/_chunks/PkToolShowContactForm-B7DvA6O1.js +160 -0
  95. package/dist-vue/_chunks/PkToolShowContactForm-B7DvA6O1.js.map +1 -0
  96. package/dist-vue/_chunks/{PkToolShowDiagram-CaoB4k6y.js → PkToolShowDiagram-DGMwlxqB.js} +4 -4
  97. package/dist-vue/_chunks/{PkToolShowDiagram-CaoB4k6y.js.map → PkToolShowDiagram-DGMwlxqB.js.map} +1 -1
  98. package/dist-vue/_chunks/{PkToolShowForm-vYuaPtu0.js → PkToolShowForm-BZmAnMSD.js} +3 -3
  99. package/dist-vue/_chunks/{PkToolShowForm-vYuaPtu0.js.map → PkToolShowForm-BZmAnMSD.js.map} +1 -1
  100. package/dist-vue/_chunks/{PkToolShowImageGallery-ooygXk7j.js → PkToolShowImageGallery-BsYTRg_W.js} +4 -4
  101. package/dist-vue/_chunks/{PkToolShowImageGallery-ooygXk7j.js.map → PkToolShowImageGallery-BsYTRg_W.js.map} +1 -1
  102. package/dist-vue/_chunks/{PkToolShowLocation-DVMpFdRk.js → PkToolShowLocation-BipZrvw7.js} +2 -2
  103. package/dist-vue/_chunks/{PkToolShowLocation-DVMpFdRk.js.map → PkToolShowLocation-BipZrvw7.js.map} +1 -1
  104. package/dist-vue/_chunks/{PkToolShowProductList-D-HJ9a_h.js → PkToolShowProductList-D1_v79Xm.js} +2 -2
  105. package/dist-vue/_chunks/{PkToolShowProductList-D-HJ9a_h.js.map → PkToolShowProductList-D1_v79Xm.js.map} +1 -1
  106. package/dist-vue/_chunks/{PkToolShowSources-DJ35l3Z3.js → PkToolShowSources-Czu2IiGq.js} +3 -3
  107. package/dist-vue/_chunks/{PkToolShowSources-DJ35l3Z3.js.map → PkToolShowSources-Czu2IiGq.js.map} +1 -1
  108. package/dist-vue/_chunks/{PkToolShowVideo-xcg1gdIE.js → PkToolShowVideo-D3D2sTAP.js} +3 -3
  109. package/dist-vue/_chunks/{PkToolShowVideo-xcg1gdIE.js.map → PkToolShowVideo-D3D2sTAP.js.map} +1 -1
  110. package/dist-vue/_chunks/{PkToolShowWeather-DJxKxVp_.js → PkToolShowWeather-BD0w6BA1.js} +2 -2
  111. package/dist-vue/_chunks/{PkToolShowWeather-DJxKxVp_.js.map → PkToolShowWeather-BD0w6BA1.js.map} +1 -1
  112. package/dist-vue/_chunks/{PkToolShowWebPages-BuaRjavD.js → PkToolShowWebPages-DTq0811l.js} +3 -3
  113. package/dist-vue/_chunks/{PkToolShowWebPages-BuaRjavD.js.map → PkToolShowWebPages-DTq0811l.js.map} +1 -1
  114. package/dist-vue/_chunks/{createChatbotApiClient-G3Tt1I67.js → createChatbotApiClient-BlJ952Kb.js} +2 -2
  115. package/dist-vue/_chunks/{createChatbotApiClient-G3Tt1I67.js.map → createChatbotApiClient-BlJ952Kb.js.map} +1 -1
  116. package/dist-vue/_chunks/{mcpOAuthReport-3A9v_gW_.js → mcpOAuthReport-BHCMTtgf.js} +2 -2
  117. package/dist-vue/_chunks/{mcpOAuthReport-3A9v_gW_.js.map → mcpOAuthReport-BHCMTtgf.js.map} +1 -1
  118. package/dist-vue/_chunks/{src-DpkuiHam.js → src-BZRiAJsH.js} +46 -3
  119. package/dist-vue/_chunks/src-BZRiAJsH.js.map +1 -0
  120. package/dist-vue/_chunks/{useChatbotStore-C1sgxgD1.js → useChatbotStore-CueyhDPB.js} +4 -4
  121. package/dist-vue/_chunks/{useChatbotStore-C1sgxgD1.js.map → useChatbotStore-CueyhDPB.js.map} +1 -1
  122. package/dist-vue/_chunks/{useSafeLocalStorage-DLIc8pkn.js → useSafeLocalStorage-B1mX0eKb.js} +2 -2
  123. package/dist-vue/_chunks/{useSafeLocalStorage-DLIc8pkn.js.map → useSafeLocalStorage-B1mX0eKb.js.map} +1 -1
  124. package/dist-vue/_chunks/{utils-DsnEcdW3.js → utils-DmRXPCqa.js} +2 -2
  125. package/dist-vue/_chunks/{utils-DsnEcdW3.js.map → utils-DmRXPCqa.js.map} +1 -1
  126. package/dist-vue/api.js +1 -1
  127. package/dist-vue/composables.js +24 -8
  128. package/dist-vue/composables.js.map +1 -1
  129. package/dist-vue/index.js +28 -28
  130. package/dist-vue/locales.js +6 -2
  131. package/dist-vue/packages/components/src/chat/PkToolShowContactForm.d.ts +6 -0
  132. package/dist-vue/packages/models/src/schema/Member.d.ts +15 -0
  133. package/package.json +1 -1
  134. package/dist/_chunks/PkToolShowContactForm-CfCy-b8w.js +0 -120
  135. package/dist/_chunks/PkToolShowContactForm-CfCy-b8w.js.map +0 -1
  136. package/dist/_chunks/src-DL9TKN-Z.js.map +0 -1
  137. package/dist-vue/_chunks/PkChatbotMessages-CDLsj7qw.js +0 -876
  138. package/dist-vue/_chunks/PkChatbotMessages-CDLsj7qw.js.map +0 -1
  139. package/dist-vue/_chunks/PkToolShowContactForm-BzdIFTnC.js +0 -122
  140. package/dist-vue/_chunks/PkToolShowContactForm-BzdIFTnC.js.map +0 -1
  141. package/dist-vue/_chunks/src-DpkuiHam.js.map +0 -1
@@ -0,0 +1,876 @@
1
+ import { A as e, E as t, S as n, n as r, v as i } from "./schemas-Bu1lick6.js";
2
+ import { a } from "./Media-C6RS-s98.js";
3
+ import { P as o, T as s, r as c, w as l } from "./Agent-DU1WWaHR.js";
4
+ import { t as u } from "./VvButtonLocalized-BuzLsXp3.js";
5
+ import { t as d } from "./PkStreamingMarkdown-CywawRVj.js";
6
+ import "./src-BZRiAJsH.js";
7
+ import { c as f, i as p, l as m, n as h, o as g, s as _, t as v } from "./message-BOiF6Bt5.js";
8
+ import { t as y } from "./PkChatbotAudioTranscript-CC9M-zDv.js";
9
+ import { A as ee, C as te, E as b, O as ne, S as x, T as re, a as S, b as C, f as w, g as ie, h as ae, m as oe, n as se, o as ce, p as le, t as T, u as ue } from "./utils-DmRXPCqa.js";
10
+ import { t as de } from "./PkChatbotError-BV5ga7hk.js";
11
+ import { t as fe } from "./PkRelativeTime--1cIphlA.js";
12
+ import { t as pe } from "./PkChatbotFilePreview-Lxgu89Hg.js";
13
+ import { t as me } from "./PkChatbotFeedbackForm-B5cYsWBr.js";
14
+ import { t as he } from "./PkChatbotMessageFeedback-BYmrVaCE.js";
15
+ import { n as ge, t as _e } from "./PkChatbotSteps-DKyF0ykL.js";
16
+ import { t as ve } from "./PkChatbotOutlineRail-np4g6vsz.js";
17
+ import { VvButtonGroup as ye, VvIcon as be } from "@volverjs/ui-vue/components";
18
+ import { Fragment as E, Transition as D, computed as O, createBlock as k, createCommentVNode as A, createElementBlock as j, createElementVNode as M, createTextVNode as xe, createVNode as N, defineAsyncComponent as P, defineComponent as Se, mergeProps as Ce, nextTick as F, normalizeClass as I, normalizeStyle as we, onBeforeUnmount as Te, onMounted as Ee, openBlock as L, ref as R, renderList as De, renderSlot as Oe, resolveDynamicComponent as ke, toDisplayString as z, unref as B, useSlots as Ae, useTemplateRef as je, watch as V, withCtx as H, withModifiers as U } from "vue";
19
+ import { useI18n as Me } from "vue-i18n";
20
+ //#region ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/iso.js
21
+ function Ne(t) {
22
+ return e(r, t);
23
+ }
24
+ i({
25
+ platform: n(),
26
+ threadId: n()
27
+ });
28
+ var Pe = i({
29
+ wakeId: t(),
30
+ dueAt: Ne(),
31
+ reason: n()
32
+ });
33
+ i({ pendingWakeup: Pe.nullable() }), i({ wakeId: t() });
34
+ var W = (e) => e?.role === "user" && !!e.metadata?.wakeup, Fe = /* @__PURE__ */ new Set([
35
+ "input-streaming",
36
+ "input-available",
37
+ "approval-requested"
38
+ ]), Ie = /* @__PURE__ */ new Set([
39
+ ...s,
40
+ ...l,
41
+ "editSpreadsheet"
42
+ ]);
43
+ [...l, c.ShowContactForm];
44
+ var G = (e) => e.state, Le = (e) => e.type.startsWith("tool-") ? e.type.slice(5) : void 0, Re = (e) => e?.role === "assistant" && e.parts.some((e) => {
45
+ if (e.type === "text") return e.text.trim().length > 0;
46
+ if (e.type === "file") return !0;
47
+ let t = G(e);
48
+ if (t && Fe.has(t)) return !0;
49
+ let n = Le(e);
50
+ return n !== void 0 && Ie.has(n) && t === "output-available";
51
+ }), ze = (e) => {
52
+ if (e?.role !== "assistant" || Re(e)) return !1;
53
+ let t = !1;
54
+ for (let n of e.parts) n.type === "tool-scheduleWakeup" && (t = G(n) === "output-available" && n.input?.noop === !0);
55
+ return t;
56
+ }, Be = {
57
+ requestOAuthConnection: P(() => import("./PkToolRequestOAuthConnection-Ck2tRuls.js")),
58
+ showArtifact: P(() => import("./PkToolShowArtifact-BiFJoOTT.js").then((e) => e.n)),
59
+ showCalendarEvent: P(() => import("./PkToolShowCalendarEvent-CFODjoDV.js").then((e) => e.n)),
60
+ showComparison: P(() => import("./PkToolShowComparison-c2e239T4.js").then((e) => e.n)),
61
+ showContactForm: P(() => import("./PkToolShowContactForm-B7DvA6O1.js").then((e) => e.n)),
62
+ showDiagram: P(() => import("./PkToolShowDiagram-DGMwlxqB.js")),
63
+ showEmail: P(() => import("./PkToolShowEmail-CUgZN0J5.js").then((e) => e.n)),
64
+ showImageGallery: P(() => import("./PkToolShowImageGallery-BsYTRg_W.js").then((e) => e.n)),
65
+ showLocation: P(() => import("./PkToolShowLocation-BipZrvw7.js").then((e) => e.n)),
66
+ showMessage: P(() => import("./PkToolShowMessage-ATTN5Hac.js").then((e) => e.n)),
67
+ showForm: P(() => import("./PkToolShowForm-BZmAnMSD.js").then((e) => e.n)),
68
+ showMultipleChoice: P(() => import("./PkToolShowForm-BZmAnMSD.js").then((e) => e.n)),
69
+ showProductList: P(() => import("./PkToolShowProductList-D1_v79Xm.js").then((e) => e.n)),
70
+ showQrCode: P(() => import("./PkToolShowQrCode-D_5VUtEB.js").then((e) => e.n)),
71
+ showSources: P(() => import("./PkToolShowSources-Czu2IiGq.js").then((e) => e.n)),
72
+ showSuggestedReply: P(() => import("./PkToolShowSuggestedReply-I6FBos-F.js").then((e) => e.n)),
73
+ showVideo: P(() => import("./PkToolShowVideo-D3D2sTAP.js")),
74
+ showWeather: P(() => import("./PkToolShowWeather-BD0w6BA1.js")),
75
+ showWebPages: P(() => import("./PkToolShowWebPages-DTq0811l.js").then((e) => e.n))
76
+ }, Ve = {
77
+ key: 0,
78
+ class: "text-12 text-word-3 m-0 mb-xs"
79
+ }, He = /* @__PURE__ */ Se({
80
+ __name: "PkToolApprovalPreviewMessage",
81
+ props: { input: {} },
82
+ setup(e) {
83
+ let t = e, n = O(() => {
84
+ let e = t.input;
85
+ return typeof e?.message == "string" ? e.message : "";
86
+ });
87
+ return (e, t) => n.value ? (L(), j("p", Ve, z(n.value), 1)) : A("", !0);
88
+ }
89
+ }), K = { [T]: He }, Ue = {
90
+ key: 0,
91
+ class: "text-12 text-word-3 m-0 mb-xs"
92
+ }, We = /* @__PURE__ */ Se({
93
+ __name: "PkToolApprovalCard",
94
+ props: {
95
+ part: {},
96
+ actionable: { type: Boolean },
97
+ callVerdict: { type: Boolean }
98
+ },
99
+ emits: ["respond"],
100
+ setup(e, { emit: t }) {
101
+ let n = e, r = t, { t: i, te: a } = Me({ useScope: "global" }), s = O(() => n.part), c = O(() => p(n.part)), l = O(() => c.value === T), d = O(() => l.value ? (s.value.state === "input-available" || o(s.value.output)) && n.callVerdict === void 0 : s.value.state === "approval-requested"), f = O(() => d.value && n.actionable === !0), m = O(() => d.value && n.actionable !== !0), h = O(() => l.value ? s.value.output === "confirmed" || n.callVerdict === !0 : s.value.approval?.approved === !0), g = O(() => l.value ? s.value.output === "cancelled" || n.callVerdict === !1 : s.value.approval?.approved === !1 || s.value.state === "output-denied"), _ = O(() => K[c.value]), v = O(() => _.value ? i("toolApproval.prompt") : i("toolApproval.promptNamed", { tool: ee(c.value, {
102
+ t: i,
103
+ te: a
104
+ }) })), y = O(() => {
105
+ if (m.value) return {
106
+ icon: "ri:time-line",
107
+ message: i("toolApproval.expired")
108
+ };
109
+ if (h.value) return {
110
+ icon: "ri:check-line",
111
+ message: i(l.value ? "toolApproval.confirmed" : "toolApproval.approved")
112
+ };
113
+ if (g.value) return {
114
+ icon: "ri:close-line",
115
+ message: i(l.value ? "toolApproval.cancelled" : "toolApproval.denied")
116
+ };
117
+ }), te = O(() => !!y.value && !_.value);
118
+ return (t, n) => {
119
+ let a = u, o = ye, c = be;
120
+ return L(), j("div", { class: I(["w-full overflow-hidden transition-all duration-300", { "bg-surface p-sm rounded-xl border border-surface-3": !te.value }]) }, [
121
+ N(D, null, {
122
+ default: H(() => [!l.value && d.value ? (L(), j("p", Ue, z(v.value), 1)) : A("", !0)]),
123
+ _: 1
124
+ }),
125
+ _.value ? (L(), k(ke(_.value), {
126
+ key: 0,
127
+ part: e.part,
128
+ input: s.value.input
129
+ }, null, 8, ["part", "input"])) : A("", !0),
130
+ N(D, { mode: "out-in" }, {
131
+ default: H(() => [y.value ? (L(), j("p", {
132
+ key: 1,
133
+ class: I(["flex items-center gap-4 text-12 text-word-3 m-0", { "mt-xs": _.value }])
134
+ }, [N(c, {
135
+ name: y.value.icon,
136
+ class: "shrink-0"
137
+ }, null, 8, ["name"]), xe(" " + z(y.value.message), 1)], 2)) : (L(), k(o, { key: 0 }, {
138
+ default: H(() => [N(a, {
139
+ modifiers: "primary-small",
140
+ disabled: !f.value,
141
+ icon: "ri:check-line",
142
+ label: B(i)("action.proceed"),
143
+ onClick: n[0] ||= U((e) => r("respond", !0), ["stop"])
144
+ }, null, 8, ["disabled", "label"]), N(a, {
145
+ modifiers: "action-quiet-small",
146
+ disabled: !f.value,
147
+ icon: "ri:close-line",
148
+ label: B(i)("action.cancel"),
149
+ onClick: n[1] ||= U((e) => r("respond", !1), ["stop"])
150
+ }, null, 8, ["disabled", "label"])]),
151
+ _: 1
152
+ }))]),
153
+ _: 1
154
+ })
155
+ ], 2);
156
+ };
157
+ }
158
+ }), Ge = 30, q = 500;
159
+ function Ke(e) {
160
+ let { scrollEl: t, status: n, messagesLength: r, lastMessageRole: i, contentEl: a, beforeNewMessageScroll: o, onScrollUp: s, onScrollDown: c } = e, l = R(!1), u = R(!0), d = !1, f = null, p = null, m = null, h = null, g = 0, _ = (e = "smooth") => {
161
+ !t.value || l.value ? d = !1 : (d = !0, t.value.scrollTo({
162
+ top: t.value.scrollHeight,
163
+ behavior: e
164
+ }), setTimeout(() => {
165
+ d = !1;
166
+ }, e === "instant" ? 0 : q));
167
+ }, v = (e) => {
168
+ e.deltaY < 0 && (l.value = !0);
169
+ }, y = 0, ee = (e) => {
170
+ y = e.touches[0]?.clientY ?? 0;
171
+ }, te = (e) => {
172
+ let t = e.touches[0]?.clientY ?? 0;
173
+ t > y && (l.value = !0), y = t;
174
+ }, b = () => {
175
+ if (!t.value) return;
176
+ let { scrollTop: e, scrollHeight: n, clientHeight: r } = t.value;
177
+ u.value = n - r - e < Ge, d || (e < g && s?.(), e > g && (u.value && (l.value = !1), c?.())), g = e;
178
+ }, ne = () => {
179
+ if (d || l.value || !t.value) return;
180
+ let e = t.value, n = e.scrollHeight - e.clientHeight;
181
+ n <= e.scrollTop || (u.value = !0, d = !0, e.scrollTop = n, requestAnimationFrame(() => {
182
+ d = !1;
183
+ }));
184
+ }, x = () => {
185
+ !f && t.value && (f = new MutationObserver(ne), f.observe(t.value, {
186
+ childList: !0,
187
+ subtree: !0,
188
+ characterData: !0
189
+ }));
190
+ }, re = () => {
191
+ f?.disconnect(), f = null;
192
+ };
193
+ V(n, (e, t) => {
194
+ e === "streaming" || e === "submitted" ? x() : (e !== "ready" || t !== "streaming") && re();
195
+ }), V(r, async () => {
196
+ if (r() && i() !== "assistant") {
197
+ w(), l.value = !1, d = !0;
198
+ try {
199
+ await F(), await o?.(), await F();
200
+ } finally {
201
+ _();
202
+ }
203
+ }
204
+ });
205
+ let S = null, C = () => {
206
+ t.value && (t.value.scrollHeight <= t.value.clientHeight || (t.value.scrollTop = t.value.scrollHeight, S && clearTimeout(S), S = setTimeout(w, 300)));
207
+ }, w = () => {
208
+ p?.disconnect(), p = null, m?.disconnect(), m = null, S &&= (clearTimeout(S), null);
209
+ };
210
+ return Ee(() => {
211
+ if (!t.value) return;
212
+ t.value.addEventListener("wheel", v, { passive: !0 }), t.value.addEventListener("touchstart", ee, { passive: !0 }), t.value.addEventListener("touchmove", te, { passive: !0 });
213
+ let e = n() === "submitted" || n() === "streaming";
214
+ e ? x() : (p = new ResizeObserver(C), p.observe(t.value), m = new MutationObserver(C), m.observe(t.value, {
215
+ childList: !0,
216
+ subtree: !0
217
+ }));
218
+ let r = a?.() ?? t.value.firstElementChild;
219
+ r && (h = new ResizeObserver(ne), h.observe(r)), e || C();
220
+ }), Te(() => {
221
+ t.value?.removeEventListener("wheel", v), t.value?.removeEventListener("touchstart", ee), t.value?.removeEventListener("touchmove", te), h?.disconnect(), h = null, re(), w();
222
+ }), {
223
+ handleScroll: b,
224
+ scrollToBottom: _,
225
+ userScrolledUp: l,
226
+ isAtBottom: u
227
+ };
228
+ }
229
+ //#endregion
230
+ //#region ../../packages/components/src/chat/wakeupFeed.ts
231
+ function qe(e, t = () => !1) {
232
+ let n = (e) => ze(e) && !t(e), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map(), a = 0;
233
+ for (; a < e.length;) {
234
+ let t = e[a];
235
+ if (W(t) && n(e[a + 1])) {
236
+ let o = t.id, s = 0, c;
237
+ for (; W(e[a]) && n(e[a + 1]);) s += 1, c = e[a].metadata?.createdAt ?? c, r.add(e[a].id), r.add(e[a + 1].id), a += 2;
238
+ i.set(o, {
239
+ count: s,
240
+ lastAt: c
241
+ });
242
+ } else n(t) && r.add(t.id), a += 1;
243
+ }
244
+ return {
245
+ hidden: r,
246
+ quietRuns: i
247
+ };
248
+ }
249
+ //#endregion
250
+ //#region ../../packages/components/src/chat/PkChatbotMessages.vue?vue&type=script&setup=true&lang.ts
251
+ var Je = ["aria-busy"], Ye = {
252
+ key: 0,
253
+ class: "pk-chatbot-messages__outline"
254
+ }, Xe = {
255
+ key: 0,
256
+ class: "pk-chatbot-divider vv-separator"
257
+ }, Ze = { class: "pk-chatbot-divider__label" }, Qe = {
258
+ key: 1,
259
+ class: "pk-chatbot-wakeup"
260
+ }, $e = ["title"], et = { class: "pk-chatbot-message__text" }, tt = ["title"], nt = {
261
+ key: 0,
262
+ class: "pk-chatbot-message__reaction-emoji"
263
+ }, rt = {
264
+ key: 0,
265
+ class: "flex flex-col items-end gap-8 w-full"
266
+ }, it = {
267
+ key: 0,
268
+ class: "pk-chatbot-message__loading-info"
269
+ }, at = { class: "flex gap-8 items-center" }, ot = { class: "text-12" }, st = { class: "flex gap-8 items-center" }, ct = {
270
+ key: 0,
271
+ class: "pk-chatbot-message__footer"
272
+ }, lt = {
273
+ key: 0,
274
+ class: "pk-chatbot-message__hover-meta"
275
+ }, ut = ["datetime", "title"], dt = { class: "truncate" }, ft = {
276
+ key: 0,
277
+ class: "flex items-center gap-4 min-w-0"
278
+ }, pt = { class: "truncate" }, mt = ["title"], ht = {
279
+ key: 2,
280
+ class: "flex items-center gap-4 text-12 text-word-3"
281
+ }, gt = { class: "truncate" }, _t = ["datetime"], vt = { class: "truncate" }, yt = {
282
+ key: 4,
283
+ class: "flex items-center gap-4 text-12 text-word-3"
284
+ }, bt = { class: "pk-chatbot-message__loading-info" }, xt = { class: "flex gap-8 items-center" }, St = { class: "text-12" }, Ct = ["title", "aria-label"], J = /* @__PURE__ */ Se({
285
+ __name: "PkChatbotMessages",
286
+ props: {
287
+ status: {},
288
+ messages: {},
289
+ error: {},
290
+ actions: {},
291
+ mainColor: {},
292
+ textColor: {},
293
+ revisedAnswers: {},
294
+ messageFeedbacks: {},
295
+ readonlyFeedback: { type: Boolean },
296
+ disableHeightAdjustment: { type: Boolean },
297
+ showMessageDateTime: { type: Boolean },
298
+ showMessageTokensCount: { type: Boolean },
299
+ showMessageNumber: { type: Boolean },
300
+ showAllMessageParts: { type: Boolean },
301
+ interactive: { type: Boolean },
302
+ showExtendedSteps: { type: Boolean },
303
+ awaitingSpokenAnswer: { type: Boolean },
304
+ confirmVerdictsOnCall: {},
305
+ isDark: { type: Boolean },
306
+ showScrollToBottom: { type: Boolean },
307
+ feedbackMessageId: {},
308
+ feedbackLoading: { type: Boolean },
309
+ feedbackSubmitted: { type: Boolean },
310
+ feedbackError: {}
311
+ },
312
+ emits: [
313
+ "show-info",
314
+ "regenerate",
315
+ "revise",
316
+ "upvote",
317
+ "downvote",
318
+ "feedback",
319
+ "feedback-submit",
320
+ "feedback-close",
321
+ "scroll-up",
322
+ "scroll-down",
323
+ "auto-retry",
324
+ "reset-chat",
325
+ "approval-respond",
326
+ "confirm-respond"
327
+ ],
328
+ setup(e, { emit: t }) {
329
+ let n = e, r = t, { t: i, te: o, d: s, n: c } = Me({ useScope: "global" }), l = Ae(), ee = (e, t) => {
330
+ if (te(e)) {
331
+ let n = e.toolCallId;
332
+ n && r("confirm-respond", {
333
+ toolCallId: n,
334
+ confirmed: t
335
+ });
336
+ return;
337
+ }
338
+ let n = ae(e);
339
+ n && r("approval-respond", {
340
+ id: n,
341
+ approved: t
342
+ });
343
+ }, T = je("scrollEl"), P = je("wrapperEl"), Se = O(() => ne(n.textColor, n.mainColor)), { handleScroll: Te, scrollToBottom: Ne, userScrolledUp: Pe, isAtBottom: Fe } = Ke({
344
+ scrollEl: T,
345
+ status: () => n.status,
346
+ messagesLength: () => n.messages?.length,
347
+ lastMessageRole: () => n.messages?.[n.messages.length - 1]?.role,
348
+ contentEl: () => P.value,
349
+ beforeNewMessageScroll: () => Ge(),
350
+ onScrollUp: () => r("scroll-up"),
351
+ onScrollDown: () => r("scroll-down")
352
+ }), Ie = () => {
353
+ Pe.value = !1, Ne();
354
+ }, G = O(() => (n.messages ?? []).filter((e) => e.role === "user" && !W(e)).map((e) => ({
355
+ id: e.id,
356
+ preview: e.parts.find(f)?.text.trim().slice(0, 120) || "…"
357
+ }))), Le = R(), Re = () => T.value?.querySelectorAll(".pk-chatbot-message--user") ?? [], ze = () => {
358
+ let e = T.value;
359
+ if (!e || !n.showScrollToBottom) return;
360
+ let t = e.getBoundingClientRect().top + e.clientHeight / 2, r = G.value[0]?.id;
361
+ Re().forEach((e, n) => {
362
+ e.getBoundingClientRect().top <= t && (r = G.value[n]?.id);
363
+ }), Le.value = r;
364
+ };
365
+ V(G, async () => {
366
+ await F(), ze();
367
+ });
368
+ let Ve = () => {
369
+ Te(), ze();
370
+ }, He = (e) => {
371
+ let t = T.value, n = G.value.findIndex((t) => t.id === e), r = Re()[n];
372
+ t && r && (Pe.value = !0, t.scrollTo({
373
+ top: t.scrollTop + r.getBoundingClientRect().top - t.getBoundingClientRect().top - Number.parseFloat(getComputedStyle(t).paddingTop),
374
+ behavior: "smooth"
375
+ }));
376
+ }, K = R(0), Ue = R(!1), Ge = async () => {
377
+ let e = n.messages;
378
+ if (!e?.length || n.disableHeightAdjustment || e[e.length - 1].role !== "user" && n.status !== "submitted" && n.status !== "streaming" || (Ue.value = !1, await F(), !T.value)) return;
379
+ let { paddingTop: t, paddingBottom: r } = getComputedStyle(T.value), i = T.value.clientHeight - Number.parseFloat(t) - Number.parseFloat(r), a = P.value && Number.parseFloat(getComputedStyle(P.value).rowGap) || 0, o = Re(), s = i - (o[o.length - 1]?.clientHeight ?? 0) - a;
380
+ i > 0 && (K.value = Math.max(s, 0)), await F();
381
+ };
382
+ V(() => [n.messages?.length, n.messages?.[n.messages.length - 1]?.id], () => Ge()), Ee(() => {
383
+ (n.status === "submitted" || n.status === "streaming" || n.awaitingSpokenAnswer) && Ge();
384
+ }), V(() => n.status, (e) => {
385
+ (e === "ready" || e === "error") && (Ue.value = !0, K.value = 0);
386
+ });
387
+ let q = (e) => n.revisedAnswers?.some((t) => t.messageId === e), J = (e) => n.messageFeedbacks?.find((t) => t.messageId === e), wt = /* @__PURE__ */ new Set(["showContactForm"]), Tt = (e) => !n.interactive && wt.has(p(e)) ? { record: !0 } : {}, Et = (e, t) => !n.readonlyFeedback && Wt(e, t), Dt = (e) => n.readonlyFeedback ? J(e) : void 0, Ot = (e) => Dt(e)?.vote, kt = (e) => {
388
+ let t = Dt(e);
389
+ if (t?.vote) return;
390
+ let n = t?.metadata?.reactionEmoji;
391
+ return typeof n == "string" && /\p{Extended_Pictographic}/u.test(n) ? n : void 0;
392
+ }, At = (e) => !!(Ot(e) || kt(e)), jt = (e) => {
393
+ if (kt(e)) return "pk-chatbot-message__reaction--neutral";
394
+ let t = Ot(e);
395
+ return t === "upvote" ? "pk-chatbot-message__reaction--positive" : t === "downvote" ? "pk-chatbot-message__reaction--negative" : "pk-chatbot-message__reaction--neutral";
396
+ }, Mt = (e) => {
397
+ let t = Ot(e);
398
+ return i(t === "upvote" ? "hint.userFeedbackPositive" : t === "downvote" ? "hint.userFeedbackNegative" : "hint.userFeedbackReaction");
399
+ }, Nt = (e) => {
400
+ let t = It(e);
401
+ for (let e = t.length - 1; e >= 0; --e) if (f(t[e])) return e;
402
+ return -1;
403
+ }, Pt = O(() => n.messages?.[n.messages.length - 1]), Y = O(() => {
404
+ let e = Pt.value;
405
+ return e ? e.parts[e.parts.length - 1] : null;
406
+ }), Ft = O(() => {
407
+ let e = /* @__PURE__ */ new Map();
408
+ for (let t of n.messages ?? []) t.role === "assistant" && e.set(t.id, b(S(re(t.parts))));
409
+ return e;
410
+ }), It = (e) => Ft.value.get(e.id) ?? e.parts, X = O(() => n.status === "submitted" || n.status === "streaming"), Lt = O(() => n.status === "error"), Rt = O(() => n.awaitingSpokenAnswer === !0 && !X.value), zt = O(() => Rt.value && Pt.value?.role === "user" && !Lt.value), Bt = O(() => {
411
+ let e = Y.value;
412
+ return ie(i, e);
413
+ }), Vt = O(() => {
414
+ let e = Y.value;
415
+ return w(e);
416
+ }), Ht = (e) => n.messages?.findIndex((t) => t.id === e), Z = (e) => e === void 0 || !n.messages ? !1 : e === n.messages.length - 1, Ut = (e) => Z(e) && n.status === "ready" && !!n.actions?.includes("regenerate"), Wt = (e, t) => (!Z(t) || n.status === "ready") && !!n.actions?.includes(e), Gt = (e) => {
417
+ let t = e.parts[e.parts.length - 1];
418
+ return f(t);
419
+ }, Kt = (e) => e.parts.some((e) => _(e) || m(e)), qt = (e) => !!n.showExtendedSteps && Q(e) && Kt(e), Jt = (e) => m(e) && !x(e) && !!(Be[p(e)] || l[e.type] || n.showAllMessageParts), Yt = (e) => e.parts.some((e) => f(e) && !!e.text.trim() || g(e) || C(e) && !x(e) || Jt(e)), Q = (e) => e.role === "assistant", Xt = (e) => e.role === "user", Zt = (e) => n.messages?.slice(0, e).reverse().find((e) => Q(e)), Qt = (e) => n.messages?.slice(e + 1).find((e) => Q(e)), $t = (e) => {
420
+ let t = Zt(e)?.metadata?.createdAt, n = Qt(e)?.metadata?.createdAt;
421
+ if (!t || !n) return;
422
+ let r = new Date(t), i = new Date(n);
423
+ return r.toDateString() === i.toDateString() ? void 0 : i;
424
+ }, $ = O(() => n.showAllMessageParts ? qe([]) : qe(n.messages ?? [], Yt)), en = O(() => {
425
+ let e = 0;
426
+ return (n.messages ?? []).map((t) => t.parts.length > 0 ? ++e : void 0);
427
+ }), tn = (e, t) => t === 0 || e.role !== "assistant" ? !1 : !!(n.actions?.length || n.showMessageNumber || n.showMessageDateTime && e.metadata?.createdAt !== void 0 || e.metadata?.completedAt !== void 0 || n.showMessageTokensCount && e.metadata?.totalTokens !== void 0), nn = (e) => {
428
+ let t = new Date(e), n = t.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
429
+ return s(t, n ? "time" : "date-time");
430
+ }, rn = (e) => {
431
+ let { createdAt: t, completedAt: n } = e.metadata ?? {};
432
+ if (t && n) return ue(c, n - t);
433
+ }, an = je("feedbackMessageEl");
434
+ return V(() => n.feedbackMessageId, async () => {
435
+ if (await F(), !n.feedbackMessageId) return;
436
+ let e = an.value?.[0]?.$el;
437
+ e && (Z(Ht(n.feedbackMessageId)) ? Ne() : e.scrollIntoView({
438
+ behavior: "smooth",
439
+ block: "center"
440
+ }));
441
+ }), (t, n) => {
442
+ let r = be, m = u, _ = ye;
443
+ return L(), j("div", {
444
+ ref_key: "scrollEl",
445
+ ref: T,
446
+ class: I(["pk-chatbot-messages scrollbar-thin", { "pk-chatbot-messages--settling": Ue.value }]),
447
+ role: "log",
448
+ "aria-live": "polite",
449
+ "aria-relevant": "additions text",
450
+ "aria-busy": X.value,
451
+ style: we({
452
+ "--chatbot-main-color": e.mainColor,
453
+ "--chatbot-contrast-color": Se.value
454
+ }),
455
+ onScroll: Ve
456
+ }, [
457
+ e.showScrollToBottom && G.value.length > 1 ? (L(), j("div", Ye, [N(ve, {
458
+ items: G.value,
459
+ "active-id": Le.value,
460
+ onSelect: He
461
+ }, null, 8, ["items", "active-id"])])) : A("", !0),
462
+ M("div", {
463
+ ref_key: "wrapperEl",
464
+ ref: P,
465
+ class: "pk-chatbot-messages__wrapper"
466
+ }, [
467
+ (L(!0), j(E, null, De(e.messages, (u, b) => (L(), j(E, { key: u.id }, [
468
+ Xt(u) && $t(b) ? (L(), j("div", Xe, [M("span", Ze, z(B(s)($t(b), "short")), 1)])) : A("", !0),
469
+ $.value.quietRuns.has(u.id) ? (L(), j("div", Qe, [N(r, {
470
+ name: "ri:alarm-line",
471
+ class: "shrink-0"
472
+ }), M("span", null, z(B(i)("label.wakeupQuietRun", {
473
+ count: $.value.quietRuns.get(u.id).count,
474
+ time: B(s)($.value.quietRuns.get(u.id).lastAt ?? Date.now(), "time")
475
+ }, $.value.quietRuns.get(u.id).count)), 1)])) : B(W)(u) && !$.value.hidden.has(u.id) && !e.showAllMessageParts ? (L(), j("div", {
476
+ key: 2,
477
+ class: "pk-chatbot-wakeup",
478
+ title: u.metadata?.wakeup?.reason
479
+ }, [N(r, {
480
+ name: "ri:alarm-line",
481
+ class: "shrink-0"
482
+ }), M("span", null, [xe(z(B(i)("label.wakeupCheck")) + " ", 1), u.metadata?.createdAt ? (L(), j(E, { key: 0 }, [xe(" · " + z(B(s)(u.metadata.createdAt, "time")), 1)], 64)) : A("", !0)])], 8, $e)) : A("", !0),
483
+ (!B(W)(u) || e.showAllMessageParts) && (!$.value.hidden.has(u.id) || X.value && Z(b)) && (u.parts.length || Z(b) && X.value && Q(u)) ? (L(), j("div", {
484
+ key: 3,
485
+ class: I(["pk-chatbot-message", [`pk-chatbot-message--${u.role}`, { "pk-chatbot-message--loading": X.value && Z(b) && Q(u) }]]),
486
+ style: we({ minHeight: Z(b) && Q(u) && !Lt.value ? `${K.value}px` : void 0 })
487
+ }, [
488
+ N(D, {
489
+ appear: "",
490
+ name: "pk-chatbot-part"
491
+ }, {
492
+ default: H(() => [qt(u) ? (L(), k(_e, {
493
+ key: 0,
494
+ message: u,
495
+ "is-streaming": X.value && Z(b),
496
+ "has-content": Yt(u),
497
+ "is-dark": e.isDark
498
+ }, null, 8, [
499
+ "message",
500
+ "is-streaming",
501
+ "has-content",
502
+ "is-dark"
503
+ ])) : A("", !0)]),
504
+ _: 2
505
+ }, 1024),
506
+ (L(!0), j(E, null, De(It(u), (n, s) => (L(), j(E, { key: B(ce)(n, s) }, [B(f)(n) && n.text.trim() ? (L(), k(D, {
507
+ key: 0,
508
+ appear: "",
509
+ name: "pk-chatbot-part"
510
+ }, {
511
+ default: H(() => [M("div", et, [Oe(t.$slots, "text", Ce({ ref_for: !0 }, {
512
+ message: u,
513
+ part: n,
514
+ index: b,
515
+ isLoading: X.value
516
+ }), () => [Q(u) ? (L(), k(d, {
517
+ key: 0,
518
+ class: "wysiwyg",
519
+ markdown: n.text,
520
+ "is-dark": e.isDark,
521
+ loading: Z(b) && e.status === "streaming"
522
+ }, null, 8, [
523
+ "markdown",
524
+ "is-dark",
525
+ "loading"
526
+ ])) : (L(), j(E, { key: 1 }, [xe(z(n.text), 1)], 64))]), At(u.id) && !J(u.id)?.comment && s === Nt(u) ? (L(), j("span", {
527
+ key: 0,
528
+ class: I(["pk-chatbot-message__reaction", jt(u.id)]),
529
+ title: Mt(u.id)
530
+ }, [kt(u.id) ? (L(), j("span", nt, z(kt(u.id)), 1)) : (L(), k(r, {
531
+ key: 1,
532
+ name: Ot(u.id) === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-up-fill"
533
+ }, null, 8, ["name"]))], 10, tt)) : A("", !0)])]),
534
+ _: 2
535
+ }, 1024)) : B(g)(n) ? (L(), k(D, {
536
+ key: 1,
537
+ appear: "",
538
+ name: "pk-chatbot-part"
539
+ }, {
540
+ default: H(() => [B(a)(n.filename, n.mediaType) ? (L(), j("div", rt, [N(pe, {
541
+ "media-type": n.mediaType,
542
+ url: n.url,
543
+ filename: n.filename,
544
+ size: B(v)(n)?.bytesCount
545
+ }, null, 8, [
546
+ "media-type",
547
+ "url",
548
+ "filename",
549
+ "size"
550
+ ]), N(y, {
551
+ url: n.url,
552
+ transcript: B(h)(n),
553
+ pending: e.status === "submitted" && Z(b)
554
+ }, null, 8, [
555
+ "url",
556
+ "transcript",
557
+ "pending"
558
+ ])])) : (L(), k(pe, {
559
+ key: 1,
560
+ "media-type": n.mediaType,
561
+ url: n.url,
562
+ filename: n.filename,
563
+ size: B(v)(n)?.bytesCount
564
+ }, null, 8, [
565
+ "media-type",
566
+ "url",
567
+ "filename",
568
+ "size"
569
+ ]))]),
570
+ _: 2
571
+ }, 1024)) : B(C)(n) && !B(x)(n) ? (L(), k(D, {
572
+ key: 2,
573
+ appear: "",
574
+ name: "pk-chatbot-part"
575
+ }, {
576
+ default: H(() => [(L(), k(We, {
577
+ key: `approval-${s}`,
578
+ part: n,
579
+ actionable: e.interactive === !0 && (B(te)(n) || Z(b)),
580
+ "call-verdict": e.confirmVerdictsOnCall?.get(n.toolCallId ?? ""),
581
+ onRespond: (e) => ee(n, e)
582
+ }, null, 8, [
583
+ "part",
584
+ "actionable",
585
+ "call-verdict",
586
+ "onRespond"
587
+ ]))]),
588
+ _: 2
589
+ }, 1024)) : Jt(n) ? (L(), k(D, {
590
+ key: 3,
591
+ appear: "",
592
+ name: "pk-chatbot-part"
593
+ }, {
594
+ default: H(() => [!B(l)[n.type] && B(Be)[B(p)(n)] ? (L(), k(ke(B(Be)[B(p)(n)]), Ce({
595
+ key: `component-${s}-${B(le)(n)}`,
596
+ part: n
597
+ }, { ref_for: !0 }, Tt(n)), null, 16, ["part"])) : Oe(t.$slots, n.type, Ce({ ref_for: !0 }, {
598
+ message: u,
599
+ part: n,
600
+ index: b,
601
+ isLoading: X.value
602
+ }), () => [e.showAllMessageParts ? (L(), j("div", it, [M("div", at, [B(w)(n) ? (L(), k(r, {
603
+ key: 0,
604
+ name: B(w)(n),
605
+ class: "shrink-0"
606
+ }, null, 8, ["name"])) : A("", !0), M("span", ot, z(B(oe)(n, {
607
+ t: B(i),
608
+ te: B(o)
609
+ })), 1)])])) : A("", !0)], void 0, 1)]),
610
+ _: 2
611
+ }, 1024)) : A("", !0), N(D, { mode: "out-in" }, {
612
+ default: H(() => [s === Nt(u) && e.readonlyFeedback && J(u.id)?.comment ? (L(), k(he, {
613
+ key: 0,
614
+ feedback: J(u.id)
615
+ }, null, 8, ["feedback"])) : A("", !0)]),
616
+ _: 2
617
+ }, 1024)], 64))), 128)),
618
+ N(D, {
619
+ name: "fade-in",
620
+ mode: "out-in"
621
+ }, {
622
+ default: H(() => [X.value && Z(b) && !Gt(u) && Q(u) && (!qt(u) || Yt(u)) ? (L(), j("div", {
623
+ key: `loading-info-${u.id}`,
624
+ class: "pk-chatbot-message__loading-info"
625
+ }, [M("div", st, [
626
+ N(r, {
627
+ name: "loading-loop",
628
+ class: "shrink-0"
629
+ }),
630
+ N(D, { mode: "out-in" }, {
631
+ default: H(() => [Vt.value ? (L(), k(r, {
632
+ key: Vt.value,
633
+ class: "shrink-0",
634
+ name: Vt.value
635
+ }, null, 8, ["name"])) : A("", !0)]),
636
+ _: 1
637
+ }),
638
+ N(D, { mode: "out-in" }, {
639
+ default: H(() => [Bt.value ? (L(), j("span", {
640
+ key: Bt.value,
641
+ class: "text-12"
642
+ }, z(Bt.value), 1)) : A("", !0)]),
643
+ _: 1
644
+ })
645
+ ]), N(D, {
646
+ name: "fade-in",
647
+ mode: "out-in"
648
+ }, {
649
+ default: H(() => [!qt(u) && Y.value && "text" in Y.value && Y.value.text.trim() ? (L(), k(ge, {
650
+ key: 0,
651
+ markdown: Y.value.text,
652
+ "is-dark": e.isDark,
653
+ "tail-length": B(se),
654
+ "inner-class": "wysiwyg",
655
+ class: "border border-surface-3 rounded-md p-4 mt-8 bg-surface-1 max-h-64 text-12 w-full"
656
+ }, null, 8, [
657
+ "markdown",
658
+ "is-dark",
659
+ "tail-length"
660
+ ])) : A("", !0)]),
661
+ _: 2
662
+ }, 1024)])) : A("", !0)]),
663
+ _: 2
664
+ }, 1024),
665
+ N(D, { mode: "out-in" }, {
666
+ default: H(() => [tn(u, b) ? (L(), j("div", ct, [
667
+ N(_, {
668
+ modifiers: "compact",
669
+ class: "mr-auto shrink-0"
670
+ }, {
671
+ default: H(() => [
672
+ N(D, { mode: "out-in" }, {
673
+ default: H(() => [Ut(b) ? (L(), k(m, {
674
+ key: 0,
675
+ icon: "ri:reset-right-line",
676
+ modifiers: "action-quiet-small",
677
+ title: B(i)("action.regenerate"),
678
+ "aria-label": B(i)("action.regenerate"),
679
+ onClick: n[0] ||= U((e) => t.$emit("regenerate"), ["stop"])
680
+ }, null, 8, ["title", "aria-label"])) : A("", !0)]),
681
+ _: 2
682
+ }, 1024),
683
+ N(D, { mode: "out-in" }, {
684
+ default: H(() => [Wt("show-info", b) ? (L(), k(m, {
685
+ key: 0,
686
+ icon: "ri:information-line",
687
+ title: B(i)("action.getMoreInfo"),
688
+ "aria-label": B(i)("action.getMoreInfo"),
689
+ modifiers: "action-quiet-small",
690
+ onClick: U((e) => t.$emit("show-info", u), ["stop"])
691
+ }, null, 8, [
692
+ "title",
693
+ "aria-label",
694
+ "onClick"
695
+ ])) : A("", !0)]),
696
+ _: 2
697
+ }, 1024),
698
+ N(D, { mode: "out-in" }, {
699
+ default: H(() => [Wt("revise", b) ? (L(), k(m, {
700
+ key: 0,
701
+ icon: q(u.id) ? "ri:file-edit-fill" : "ri:file-edit-line",
702
+ title: q(u.id) ? B(i)("action.editRevise") : B(i)("action.createRevise"),
703
+ "aria-label": q(u.id) ? B(i)("action.editRevise") : B(i)("action.createRevise"),
704
+ modifiers: "action-quiet-small",
705
+ class: I({ "text-brand-graphic": q(u.id) }),
706
+ onClick: U((e) => t.$emit("revise", u), ["stop"])
707
+ }, null, 8, [
708
+ "icon",
709
+ "title",
710
+ "aria-label",
711
+ "class",
712
+ "onClick"
713
+ ])) : A("", !0)]),
714
+ _: 2
715
+ }, 1024),
716
+ N(D, { mode: "out-in" }, {
717
+ default: H(() => [Et("upvote", b) ? (L(), k(m, {
718
+ key: 0,
719
+ icon: J(u.id)?.vote === "upvote" ? "ri:thumb-up-fill" : "ri:thumb-up-line",
720
+ title: B(i)("action.upvote"),
721
+ "aria-label": B(i)("action.upvote"),
722
+ modifiers: "action-quiet-small",
723
+ onClick: U((e) => t.$emit("upvote", u), ["stop"])
724
+ }, null, 8, [
725
+ "icon",
726
+ "title",
727
+ "aria-label",
728
+ "onClick"
729
+ ])) : A("", !0)]),
730
+ _: 2
731
+ }, 1024),
732
+ N(D, { mode: "out-in" }, {
733
+ default: H(() => [Et("downvote", b) ? (L(), k(m, {
734
+ key: 0,
735
+ icon: J(u.id)?.vote === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-down-line",
736
+ title: B(i)("action.downvote"),
737
+ "aria-label": B(i)("action.downvote"),
738
+ modifiers: "action-quiet-small",
739
+ onClick: U((e) => t.$emit("downvote", u), ["stop"])
740
+ }, null, 8, [
741
+ "icon",
742
+ "title",
743
+ "aria-label",
744
+ "onClick"
745
+ ])) : A("", !0)]),
746
+ _: 2
747
+ }, 1024),
748
+ N(D, { mode: "out-in" }, {
749
+ default: H(() => [Et("feedback", b) ? (L(), k(m, {
750
+ key: 0,
751
+ icon: J(u.id)?.comment ? "ri:feedback-fill" : "ri:feedback-line",
752
+ title: B(i)("action.feedback"),
753
+ "aria-label": B(i)("action.feedback"),
754
+ modifiers: "action-quiet-small",
755
+ onClick: U((e) => t.$emit("feedback", u), ["stop"])
756
+ }, null, 8, [
757
+ "icon",
758
+ "title",
759
+ "aria-label",
760
+ "onClick"
761
+ ])) : A("", !0)]),
762
+ _: 2
763
+ }, 1024)
764
+ ]),
765
+ _: 2
766
+ }, 1024),
767
+ !e.showMessageDateTime && u.metadata?.createdAt && u.metadata?.completedAt ? (L(), j("div", lt, [M("time", {
768
+ datetime: new Date(u.metadata.createdAt).toISOString(),
769
+ title: B(s)(new Date(u.metadata.createdAt), "date-time"),
770
+ class: "flex items-center gap-4 min-w-0"
771
+ }, [N(r, {
772
+ name: "ri:time-line",
773
+ class: "shrink-0"
774
+ }), M("span", dt, z(nn(u.metadata.createdAt)), 1)], 8, ut), rn(u) ? (L(), j("span", ft, [N(r, {
775
+ name: "ri:hourglass-line",
776
+ class: "shrink-0"
777
+ }), M("span", pt, z(rn(u)), 1)])) : A("", !0)])) : A("", !0),
778
+ e.showMessageNumber ? (L(), j("span", {
779
+ key: 1,
780
+ title: B(i)("label.messageNumber", { n: en.value[b] }),
781
+ class: "text-12 text-word-3 tabular-nums"
782
+ }, " #" + z(en.value[b]), 9, mt)) : A("", !0),
783
+ e.showMessageTokensCount && u.metadata?.totalTokens ? (L(), j("span", ht, [N(r, {
784
+ name: "ri:ai-generate-2-line",
785
+ class: "shrink-0"
786
+ }), M("span", gt, z(B(c)(u.metadata.totalTokens, "integer")) + " " + z(B(i)("label.tokens")), 1)])) : A("", !0),
787
+ e.showMessageDateTime && u.metadata?.createdAt ? (L(), j("time", {
788
+ key: 3,
789
+ datetime: new Date(u.metadata?.createdAt).toISOString(),
790
+ class: "flex items-center gap-4 text-12 text-word-3"
791
+ }, [N(r, {
792
+ name: "ri:time-line",
793
+ class: "shrink-0"
794
+ }), M("span", vt, z(B(s)(new Date(u.metadata?.createdAt), "date-time")), 1)], 8, _t)) : A("", !0),
795
+ e.showMessageDateTime && u?.metadata?.completedAt && u?.metadata?.createdAt ? (L(), j("div", yt, [N(r, {
796
+ name: "ri:hourglass-line",
797
+ class: "shrink-0"
798
+ }), N(fe, {
799
+ class: "truncate",
800
+ date: u.metadata?.createdAt,
801
+ "end-date": u.metadata?.completedAt
802
+ }, null, 8, ["date", "end-date"])])) : A("", !0)
803
+ ])) : A("", !0)]),
804
+ _: 2
805
+ }, 1024),
806
+ N(D, { mode: "out-in" }, {
807
+ default: H(() => [u.id === e.feedbackMessageId ? (L(), k(me, {
808
+ key: 0,
809
+ ref_for: !0,
810
+ ref_key: "feedbackMessageEl",
811
+ ref: an,
812
+ loading: e.feedbackLoading,
813
+ submitted: e.feedbackSubmitted,
814
+ error: e.feedbackError,
815
+ onSubmit: n[1] ||= (e) => t.$emit("feedback-submit", e),
816
+ onClose: n[2] ||= (e) => t.$emit("feedback-close")
817
+ }, null, 8, [
818
+ "loading",
819
+ "submitted",
820
+ "error"
821
+ ])) : A("", !0)]),
822
+ _: 2
823
+ }, 1024)
824
+ ], 6)) : A("", !0)
825
+ ], 64))), 128)),
826
+ N(D, {
827
+ appear: "",
828
+ name: "pk-chatbot-part"
829
+ }, {
830
+ default: H(() => [Rt.value ? (L(), j("div", {
831
+ key: 0,
832
+ class: "pk-chatbot-message pk-chatbot-message--assistant pk-chatbot-message--loading",
833
+ style: we({ minHeight: zt.value ? `${K.value}px` : void 0 })
834
+ }, [M("div", bt, [M("div", xt, [N(r, {
835
+ name: "loading-loop",
836
+ class: "shrink-0"
837
+ }), M("span", St, z(B(i)("label.answeringOnTheCall")), 1)])])], 4)) : A("", !0)]),
838
+ _: 1
839
+ }),
840
+ N(D, {
841
+ appear: "",
842
+ name: "pk-chatbot-part"
843
+ }, {
844
+ default: H(() => [Lt.value ? (L(), k(de, {
845
+ key: 0,
846
+ error: e.error,
847
+ onRetry: n[3] ||= (e) => t.$emit("auto-retry"),
848
+ onReset: n[4] ||= (e) => t.$emit("reset-chat")
849
+ }, null, 8, ["error"])) : A("", !0)]),
850
+ _: 1
851
+ }),
852
+ Pt.value?.role === "user" && !zt.value || Lt.value ? (L(), j("div", {
853
+ key: 0,
854
+ class: "pk-chatbot-messages__spacer",
855
+ style: we({ minHeight: `${K.value}px` })
856
+ }, null, 4)) : A("", !0)
857
+ ], 512),
858
+ N(D, { name: "pk-chatbot-messages-fab" }, {
859
+ default: H(() => [e.showScrollToBottom && (B(Pe) || !B(Fe)) ? (L(), j("button", {
860
+ key: 0,
861
+ type: "button",
862
+ class: "pk-chatbot-messages__scroll-to-bottom",
863
+ title: B(i)("action.scrollToBottom"),
864
+ "aria-label": B(i)("action.scrollToBottom"),
865
+ onClick: Ie
866
+ }, [N(r, { name: "ri:arrow-down-line" })], 8, Ct)) : A("", !0)]),
867
+ _: 1
868
+ })
869
+ ], 46, Je);
870
+ };
871
+ }
872
+ });
873
+ //#endregion
874
+ export { J as t };
875
+
876
+ //# sourceMappingURL=PkChatbotMessages-5wPl7-j-.js.map