@8wave/ai-elements 0.121.0-beta.55 → 0.121.0-beta.57

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