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

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