@8wave/ai-elements 0.126.0-beta.32 → 0.126.0-beta.34

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 (147) hide show
  1. package/dist/_chunks/{Agent-COa7L9GK.js → Agent-DZEyfr8D.js} +2 -1
  2. package/dist/_chunks/Agent-DZEyfr8D.js.map +1 -0
  3. package/dist/_chunks/{PkFilePreview-SBGa95Ca.js → PkFilePreview-C6ZZablL.js} +3 -3
  4. package/dist/_chunks/{PkFilePreview-SBGa95Ca.js.map → PkFilePreview-C6ZZablL.js.map} +1 -1
  5. package/dist/_chunks/{PkFilePreviewDialog-Cc7iZWCl.js → PkFilePreviewDialog-BzBHAt8l.js} +2 -2
  6. package/dist/_chunks/{PkFilePreviewDialog-Cc7iZWCl.js.map → PkFilePreviewDialog-BzBHAt8l.js.map} +1 -1
  7. package/dist/_chunks/{PkImageEditorDialog-D13bWv-N.js → PkImageEditorDialog-Dm34WFmS.js} +2 -2
  8. package/dist/_chunks/{PkImageEditorDialog-D13bWv-N.js.map → PkImageEditorDialog-Dm34WFmS.js.map} +1 -1
  9. package/dist/_chunks/{PkSelectionActions-BaX_rsCt.js → PkSelectionActions-CYqbMEjg.js} +2 -2
  10. package/dist/_chunks/{PkSelectionActions-BaX_rsCt.js.map → PkSelectionActions-CYqbMEjg.js.map} +1 -1
  11. package/dist/_chunks/{PkStreamingMarkdown-GRB3Gg_x.js → PkStreamingMarkdown-B8rZbprU.js} +3 -3
  12. package/dist/_chunks/{PkStreamingMarkdown-GRB3Gg_x.js.map → PkStreamingMarkdown-B8rZbprU.js.map} +1 -1
  13. package/dist/_chunks/{PkToolChatFile-DTm5-CE4.js → PkToolChatFile-C0emIVfS.js} +3 -3
  14. package/dist/_chunks/{PkToolChatFile-DTm5-CE4.js.map → PkToolChatFile-C0emIVfS.js.map} +1 -1
  15. package/dist/_chunks/{PkToolRequestGeolocation-DZenn1az.js → PkToolRequestGeolocation-DNzNRszE.js} +2 -2
  16. package/dist/_chunks/{PkToolRequestGeolocation-DZenn1az.js.map → PkToolRequestGeolocation-DNzNRszE.js.map} +1 -1
  17. package/dist/_chunks/{PkToolRequestOAuthConnection-Dz0qfYu5.js → PkToolRequestOAuthConnection-BDxYXz4s.js} +2 -2
  18. package/dist/_chunks/{PkToolRequestOAuthConnection-Dz0qfYu5.js.map → PkToolRequestOAuthConnection-BDxYXz4s.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowArtifact-C9_DHr5Y.js → PkToolShowArtifact-B_KIIjEn.js} +2 -2
  20. package/dist/_chunks/{PkToolShowArtifact-C9_DHr5Y.js.map → PkToolShowArtifact-B_KIIjEn.js.map} +1 -1
  21. package/dist/_chunks/{PkToolShowContactForm-DhyelktO.js → PkToolShowContactForm-DiHb3fRQ.js} +2 -2
  22. package/dist/_chunks/{PkToolShowContactForm-DhyelktO.js.map → PkToolShowContactForm-DiHb3fRQ.js.map} +1 -1
  23. package/dist/_chunks/{PkToolShowForm-Dz2Hnzts.js → PkToolShowForm-BmUAhIQy.js} +4 -4
  24. package/dist/_chunks/{PkToolShowForm-Dz2Hnzts.js.map → PkToolShowForm-BmUAhIQy.js.map} +1 -1
  25. package/dist/_chunks/{PkToolShowImageGallery-CiDfIboY.js → PkToolShowImageGallery-CZ394fdT.js} +2 -2
  26. package/dist/_chunks/{PkToolShowImageGallery-CiDfIboY.js.map → PkToolShowImageGallery-CZ394fdT.js.map} +1 -1
  27. package/dist/_chunks/{PkToolShowProductList-CY96IGWn.js → PkToolShowProductList-uNvUr2s9.js} +2 -2
  28. package/dist/_chunks/{PkToolShowProductList-CY96IGWn.js.map → PkToolShowProductList-uNvUr2s9.js.map} +1 -1
  29. package/dist/_chunks/{PkToolShowSources-CRk-MOoE.js → PkToolShowSources-Dm0L4prK.js} +3 -3
  30. package/dist/_chunks/{PkToolShowSources-CRk-MOoE.js.map → PkToolShowSources-Dm0L4prK.js.map} +1 -1
  31. package/dist/_chunks/{PkToolShowSuggestedReply-DKuV4mmV.js → PkToolShowSuggestedReply-B_dRrZfj.js} +2 -2
  32. package/dist/_chunks/{PkToolShowSuggestedReply-DKuV4mmV.js.map → PkToolShowSuggestedReply-B_dRrZfj.js.map} +1 -1
  33. package/dist/_chunks/{PkToolShowVideo-DI6ohcVU.js → PkToolShowVideo-DLgQjTq_.js} +2 -2
  34. package/dist/_chunks/{PkToolShowVideo-DI6ohcVU.js.map → PkToolShowVideo-DLgQjTq_.js.map} +1 -1
  35. package/dist/_chunks/{PkToolShowWebPages-Dh6L_n9T.js → PkToolShowWebPages-Cj2mJrs5.js} +2 -2
  36. package/dist/_chunks/{PkToolShowWebPages-Dh6L_n9T.js.map → PkToolShowWebPages-Cj2mJrs5.js.map} +1 -1
  37. package/dist/_chunks/{chatImagePolicy-Ckz-KAHA.js → chatImagePolicy-DMt6O5iK.js} +2 -2
  38. package/dist/_chunks/{chatImagePolicy-Ckz-KAHA.js.map → chatImagePolicy-DMt6O5iK.js.map} +1 -1
  39. package/dist/_chunks/{markdown-DHayRAiy.js → markdown-nw5sXwU0.js} +2 -2
  40. package/dist/_chunks/{markdown-DHayRAiy.js.map → markdown-nw5sXwU0.js.map} +1 -1
  41. package/dist/_chunks/{utils-3jpXeGGy.js → utils-DPGBO-HU.js} +2 -2
  42. package/dist/_chunks/{utils-3jpXeGGy.js.map → utils-DPGBO-HU.js.map} +1 -1
  43. package/dist/ai-elements.es.js +3927 -3858
  44. package/dist/ai-elements.es.js.map +1 -1
  45. package/dist-vue/PkChatbot.js +1 -1
  46. package/dist-vue/PkChatbotEmptyState.js +1 -1
  47. package/dist-vue/PkChatbotInput.js +1 -1
  48. package/dist-vue/PkChatbotMessages.js +1 -1
  49. package/dist-vue/PkChatbotStepPayload.js +1 -1
  50. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  51. package/dist-vue/PkChatbotSteps.js +1 -1
  52. package/dist-vue/PkChatbotViewChat.js +1 -1
  53. package/dist-vue/PkChatbotViewConversations.js +1 -1
  54. package/dist-vue/PkChatbotViewFiles.js +1 -1
  55. package/dist-vue/PkChatbotViewProfile.js +1 -1
  56. package/dist-vue/_chunks/{Agent-CRwhrv5Z.js → Agent-CBAd3F7k.js} +2 -1
  57. package/dist-vue/_chunks/Agent-CBAd3F7k.js.map +1 -0
  58. package/dist-vue/_chunks/{Document-Bp-qpa8v.js → Document-B3w5H0R0.js} +2 -2
  59. package/dist-vue/_chunks/{Document-Bp-qpa8v.js.map → Document-B3w5H0R0.js.map} +1 -1
  60. package/dist-vue/_chunks/{PkChatbot-CtrcDgBe.js → PkChatbot-CXpftmWm.js} +8 -8
  61. package/dist-vue/_chunks/{PkChatbot-CtrcDgBe.js.map → PkChatbot-CXpftmWm.js.map} +1 -1
  62. package/dist-vue/_chunks/{PkChatbotEmptyState-BF3Odn3v.js → PkChatbotEmptyState-vA2v4FES.js} +2 -2
  63. package/dist-vue/_chunks/{PkChatbotEmptyState-BF3Odn3v.js.map → PkChatbotEmptyState-vA2v4FES.js.map} +1 -1
  64. package/dist-vue/_chunks/PkChatbotInput-CIIJ1bpF.js +584 -0
  65. package/dist-vue/_chunks/PkChatbotInput-CIIJ1bpF.js.map +1 -0
  66. package/dist-vue/_chunks/{PkChatbotMessages-10eBKpC5.js → PkChatbotMessages-15R8RxAq.js} +18 -18
  67. package/dist-vue/_chunks/{PkChatbotMessages-10eBKpC5.js.map → PkChatbotMessages-15R8RxAq.js.map} +1 -1
  68. package/dist-vue/_chunks/{PkChatbotStepPayload-C4ahOq6Z.js → PkChatbotStepPayload-BbNSav-U.js} +2 -2
  69. package/dist-vue/_chunks/{PkChatbotStepPayload-C4ahOq6Z.js.map → PkChatbotStepPayload-BbNSav-U.js.map} +1 -1
  70. package/dist-vue/_chunks/{PkChatbotStepToolDetail-CkIX0aKu.js → PkChatbotStepToolDetail-B_4pmbLe.js} +3 -3
  71. package/dist-vue/_chunks/{PkChatbotStepToolDetail-CkIX0aKu.js.map → PkChatbotStepToolDetail-B_4pmbLe.js.map} +1 -1
  72. package/dist-vue/_chunks/{PkChatbotSteps-BalLo6DZ.js → PkChatbotSteps-h4E6DH_g.js} +5 -5
  73. package/dist-vue/_chunks/{PkChatbotSteps-BalLo6DZ.js.map → PkChatbotSteps-h4E6DH_g.js.map} +1 -1
  74. package/dist-vue/_chunks/PkChatbotViewChat-CLQ0J9_f.js +1382 -0
  75. package/dist-vue/_chunks/PkChatbotViewChat-CLQ0J9_f.js.map +1 -0
  76. package/dist-vue/_chunks/{PkChatbotViewConversations-D0vDYTyo.js → PkChatbotViewConversations-DFBbypGg.js} +3 -3
  77. package/dist-vue/_chunks/{PkChatbotViewConversations-D0vDYTyo.js.map → PkChatbotViewConversations-DFBbypGg.js.map} +1 -1
  78. package/dist-vue/_chunks/{PkChatbotViewFiles-BwfAnywk.js → PkChatbotViewFiles-PHdrHZOf.js} +3 -3
  79. package/dist-vue/_chunks/{PkChatbotViewFiles-BwfAnywk.js.map → PkChatbotViewFiles-PHdrHZOf.js.map} +1 -1
  80. package/dist-vue/_chunks/{PkChatbotViewProfile-GW0WuMOy.js → PkChatbotViewProfile-B0AZvHTr.js} +2 -2
  81. package/dist-vue/_chunks/{PkChatbotViewProfile-GW0WuMOy.js.map → PkChatbotViewProfile-B0AZvHTr.js.map} +1 -1
  82. package/dist-vue/_chunks/{PkFilePreview-qizsvSVW.js → PkFilePreview-Cb-1YRPN.js} +616 -666
  83. package/dist-vue/_chunks/PkFilePreview-Cb-1YRPN.js.map +1 -0
  84. package/dist-vue/_chunks/{PkFilePreviewDialog-WsVzH9hg.js → PkFilePreviewDialog-Bd7kEoCB.js} +2 -2
  85. package/dist-vue/_chunks/{PkFilePreviewDialog-WsVzH9hg.js.map → PkFilePreviewDialog-Bd7kEoCB.js.map} +1 -1
  86. package/dist-vue/_chunks/{PkImageEditorDialog-NQFpdqCU.js → PkImageEditorDialog-Bj4sUHXM.js} +2 -2
  87. package/dist-vue/_chunks/{PkImageEditorDialog-NQFpdqCU.js.map → PkImageEditorDialog-Bj4sUHXM.js.map} +1 -1
  88. package/dist-vue/_chunks/{PkStreamingMarkdown-CMxiJTMR.js → PkStreamingMarkdown-BcUq4ThC.js} +3 -3
  89. package/dist-vue/_chunks/{PkStreamingMarkdown-CMxiJTMR.js.map → PkStreamingMarkdown-BcUq4ThC.js.map} +1 -1
  90. package/dist-vue/_chunks/{PkToolChatFile-Bd6Ci7i1.js → PkToolChatFile-BOexrlLt.js} +3 -3
  91. package/dist-vue/_chunks/{PkToolChatFile-Bd6Ci7i1.js.map → PkToolChatFile-BOexrlLt.js.map} +1 -1
  92. package/dist-vue/_chunks/{PkToolRequestGeolocation-C2OmF31d.js → PkToolRequestGeolocation-CyL_M1Rm.js} +2 -2
  93. package/dist-vue/_chunks/{PkToolRequestGeolocation-C2OmF31d.js.map → PkToolRequestGeolocation-CyL_M1Rm.js.map} +1 -1
  94. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-CgD-o99C.js → PkToolRequestOAuthConnection-DWkeVLpx.js} +2 -2
  95. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-CgD-o99C.js.map → PkToolRequestOAuthConnection-DWkeVLpx.js.map} +1 -1
  96. package/dist-vue/_chunks/{PkToolShowArtifact-rlZ-AGWh.js → PkToolShowArtifact-C4gHB6lH.js} +2 -2
  97. package/dist-vue/_chunks/{PkToolShowArtifact-rlZ-AGWh.js.map → PkToolShowArtifact-C4gHB6lH.js.map} +1 -1
  98. package/dist-vue/_chunks/{PkToolShowChart-B8xJi1yY.js → PkToolShowChart-CsPXNAb9.js} +2 -2
  99. package/dist-vue/_chunks/{PkToolShowChart-B8xJi1yY.js.map → PkToolShowChart-CsPXNAb9.js.map} +1 -1
  100. package/dist-vue/_chunks/{PkToolShowContactForm-BVBL7Unx.js → PkToolShowContactForm-2_HBPZaa.js} +2 -2
  101. package/dist-vue/_chunks/{PkToolShowContactForm-BVBL7Unx.js.map → PkToolShowContactForm-2_HBPZaa.js.map} +1 -1
  102. package/dist-vue/_chunks/{PkToolShowDiagram-Bs39QQZ3.js → PkToolShowDiagram-cCbeL6MK.js} +2 -2
  103. package/dist-vue/_chunks/{PkToolShowDiagram-Bs39QQZ3.js.map → PkToolShowDiagram-cCbeL6MK.js.map} +1 -1
  104. package/dist-vue/_chunks/{PkToolShowForm-D-RJeA2F.js → PkToolShowForm-DjB3fji5.js} +4 -4
  105. package/dist-vue/_chunks/{PkToolShowForm-D-RJeA2F.js.map → PkToolShowForm-DjB3fji5.js.map} +1 -1
  106. package/dist-vue/_chunks/{PkToolShowImageGallery-CrkkKCVI.js → PkToolShowImageGallery-C22TCUKW.js} +2 -2
  107. package/dist-vue/_chunks/{PkToolShowImageGallery-CrkkKCVI.js.map → PkToolShowImageGallery-C22TCUKW.js.map} +1 -1
  108. package/dist-vue/_chunks/{PkToolShowProductList-BwfUG41_.js → PkToolShowProductList-BvtmiHBf.js} +2 -2
  109. package/dist-vue/_chunks/{PkToolShowProductList-BwfUG41_.js.map → PkToolShowProductList-BvtmiHBf.js.map} +1 -1
  110. package/dist-vue/_chunks/{PkToolShowSources-q9gQIuam.js → PkToolShowSources-uKO4MQgd.js} +3 -3
  111. package/dist-vue/_chunks/{PkToolShowSources-q9gQIuam.js.map → PkToolShowSources-uKO4MQgd.js.map} +1 -1
  112. package/dist-vue/_chunks/{PkToolShowSuggestedReply-75Kc8-OQ.js → PkToolShowSuggestedReply-wKgwHTRO.js} +2 -2
  113. package/dist-vue/_chunks/{PkToolShowSuggestedReply-75Kc8-OQ.js.map → PkToolShowSuggestedReply-wKgwHTRO.js.map} +1 -1
  114. package/dist-vue/_chunks/{PkToolShowVideo-BK-jDVJd.js → PkToolShowVideo-DKj5N1vo.js} +2 -2
  115. package/dist-vue/_chunks/{PkToolShowVideo-BK-jDVJd.js.map → PkToolShowVideo-DKj5N1vo.js.map} +1 -1
  116. package/dist-vue/_chunks/{PkToolShowWebPages-K3Jml1f7.js → PkToolShowWebPages-BNZmbCSf.js} +2 -2
  117. package/dist-vue/_chunks/{PkToolShowWebPages-K3Jml1f7.js.map → PkToolShowWebPages-BNZmbCSf.js.map} +1 -1
  118. package/dist-vue/_chunks/{createChatbotApiClient-Pb7_cU2s.js → createChatbotApiClient-DBKfGL6y.js} +5 -2
  119. package/dist-vue/_chunks/{createChatbotApiClient-Pb7_cU2s.js.map → createChatbotApiClient-DBKfGL6y.js.map} +1 -1
  120. package/dist-vue/_chunks/{useChatbotStore-ChrZVIDt.js → useChatbotStore-Hb5EjISl.js} +94 -85
  121. package/dist-vue/_chunks/useChatbotStore-Hb5EjISl.js.map +1 -0
  122. package/dist-vue/_chunks/{utils-Bdk5kFfi.js → utils-waie4Gfn.js} +2 -2
  123. package/dist-vue/_chunks/{utils-Bdk5kFfi.js.map → utils-waie4Gfn.js.map} +1 -1
  124. package/dist-vue/api.js +1 -1
  125. package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +2 -0
  126. package/dist-vue/composables.js +8 -8
  127. package/dist-vue/index.js +408 -389
  128. package/dist-vue/index.js.map +1 -1
  129. package/dist-vue/locales.js +6 -0
  130. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +9 -2
  131. package/dist-vue/packages/components/src/chat/PkChatbotInput.d.ts +6 -0
  132. package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +5 -0
  133. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +10 -1
  134. package/dist-vue/packages/models/src/schema/Agent.d.ts +8 -0
  135. package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +2 -0
  136. package/dist-vue/packages/models/src/schema/SubAgent.d.ts +2 -0
  137. package/dist-vue/packages/models/src/schema/constants.d.ts +11 -2
  138. package/dist-vue/style.css +1 -1
  139. package/package.json +1 -1
  140. package/dist/_chunks/Agent-COa7L9GK.js.map +0 -1
  141. package/dist-vue/_chunks/Agent-CRwhrv5Z.js.map +0 -1
  142. package/dist-vue/_chunks/PkChatbotInput-DNXvFvyG.js +0 -520
  143. package/dist-vue/_chunks/PkChatbotInput-DNXvFvyG.js.map +0 -1
  144. package/dist-vue/_chunks/PkChatbotViewChat-U6T-gG-c.js +0 -1336
  145. package/dist-vue/_chunks/PkChatbotViewChat-U6T-gG-c.js.map +0 -1
  146. package/dist-vue/_chunks/PkFilePreview-qizsvSVW.js.map +0 -1
  147. package/dist-vue/_chunks/useChatbotStore-ChrZVIDt.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { $ as e, A as t, B as n, D as r, E as i, F as a, G as o, H as s, I as c, J as l, K as u, L as d, M as f, N as p, P as m, Q as h, R as g, S as _, T as v, U as y, W as b, X as ee, Y as te, Z as ne, _t as re, a as ie, at as ae, b as oe, bt as x, ct as se, dt as ce, et as le, g as ue, gt as de, h as fe, ht as pe, i as me, it as he, k as ge, l as _e, lt as ve, m as ye, mt as S, nt as C, o as be, ot as xe, p as w, q as Se, rt as Ce, s as we, st as Te, tt as Ee, u as De, ut as Oe, vt as ke, x as Ae, xt as je, y as Me, yt as Ne, z as Pe } from "./schemas-CwcNxjnD.js";
2
2
  import { n as Fe, t as Ie } from "./useSafeLocalStorage-Bn4SsL8C.js";
3
- import { i as Le, r as Re, t as ze } from "./createChatbotApiClient-Pb7_cU2s.js";
4
- import { Q as Be, V as Ve, Z as He, at as Ue, et as We, nt as Ge, ot as Ke, st as qe } from "./Agent-CRwhrv5Z.js";
3
+ import { i as Le, r as Re, t as ze } from "./createChatbotApiClient-DBKfGL6y.js";
4
+ import { Q as Be, V as Ve, Z as He, at as Ue, et as We, nt as Ge, ot as Ke, st as qe } from "./Agent-CBAd3F7k.js";
5
5
  import { d as Je, r as Ye } from "./message-DuibQyHy.js";
6
6
  import { n as Xe } from "./src-nb8MU1sh.js";
7
7
  import { computed as T, getCurrentScope as E, isReadonly as Ze, nextTick as Qe, onScopeDispose as $e, reactive as et, ref as D, shallowRef as O, toRefs as tt, toValue as nt, watch as k, watchEffect as rt } from "vue";
@@ -4454,7 +4454,7 @@ function Wa(e) {
4454
4454
  } finally {
4455
4455
  $t.value = !1;
4456
4456
  }
4457
- or([.../* @__PURE__ */ new Set([...er(), ...R.value.map((e) => e.id)])]);
4457
+ sr([.../* @__PURE__ */ new Set([...er(), ...R.value.map((e) => e.id)])]);
4458
4458
  }
4459
4459
  }
4460
4460
  async function Cn() {
@@ -4650,7 +4650,7 @@ function Wa(e) {
4650
4650
  filename: e.mediaSource.name,
4651
4651
  providerMetadata: { "8bot": { media: e.mediaSource } }
4652
4652
  })), n = Ae.value ? ue.value : void 0;
4653
- !C.value && Pn() ? e && t.length === 0 && !n && (yn(w.value, [...vn.value, e]), H.value = "") : (C.value && Ut.value.length > 0 && await dr(), qn(e, t, n && { pagePointer: n }), H.value = "", ue.value = void 0, ur());
4653
+ !C.value && Pn() ? e && t.length === 0 && !n && (yn(w.value, [...vn.value, e]), H.value = "") : (C.value && Ut.value.length > 0 && await fr(), qn(e, t, n && { pagePointer: n }), H.value = "", ue.value = void 0, dr());
4654
4654
  }
4655
4655
  function J(e, t) {
4656
4656
  let n = e.trim();
@@ -4725,10 +4725,18 @@ function Wa(e) {
4725
4725
  }), er = () => [.../* @__PURE__ */ new Set([...jt.value, ...N.value])], tr = at(), nr, rr = 0, ir = 0;
4726
4726
  function ar() {
4727
4727
  clearTimeout(nr), nr = void 0, er().length !== 0 && tr.value === "visible" && (nr = setTimeout(() => {
4728
- nr = void 0, or(er());
4728
+ nr = void 0, sr(er());
4729
4729
  }, Pa));
4730
4730
  }
4731
4731
  async function or(e) {
4732
+ let t = w.value;
4733
+ if (u.value?.nextMessageSuggestion && !C.value && t) try {
4734
+ return await E.value.suggestNextMessage(o.value, t, e) ?? void 0;
4735
+ } catch {
4736
+ return;
4737
+ }
4738
+ }
4739
+ async function sr(e) {
4732
4740
  let t = e.slice(0, Fa);
4733
4741
  if (C.value || t.length === 0) {
4734
4742
  ar();
@@ -4750,16 +4758,16 @@ function Wa(e) {
4750
4758
  (u.length > 0 || c.length > 0) && (N.value = N.value.filter((e) => !u.includes(e) && !c.includes(e)), P.value = [...P.value, ...u.filter((e) => e !== w.value && !P.value.includes(e))]), l.length > 0 && q(o.value), ar();
4751
4759
  }
4752
4760
  k(tr, (e) => {
4753
- e === "visible" ? or(er()) : (clearTimeout(nr), nr = void 0);
4761
+ e === "visible" ? sr(er()) : (clearTimeout(nr), nr = void 0);
4754
4762
  }), $e(() => clearTimeout(nr));
4755
- let sr = T(() => P.value.map((e) => ({
4763
+ let cr = T(() => P.value.map((e) => ({
4756
4764
  chatId: e,
4757
4765
  title: R.value.find((t) => t.id === e)?.title || Mt.value[e] || void 0
4758
4766
  })));
4759
- function cr(e) {
4760
- Lt(e), w.value = e, Ir("chat");
4761
- }
4762
4767
  function lr(e) {
4768
+ Lt(e), w.value = e, Lr("chat");
4769
+ }
4770
+ function ur(e) {
4763
4771
  P.value = P.value.filter((t) => t !== e), It(e);
4764
4772
  }
4765
4773
  k(() => [F.value.status, F.value.id], ([e, t], [n, r]) => {
@@ -4778,18 +4786,18 @@ function Wa(e) {
4778
4786
  }), k(() => F.value.status, (e) => {
4779
4787
  e === "ready" && W.value.length > 0 && (W.value = "");
4780
4788
  });
4781
- function ur(e = !1) {
4789
+ function dr(e = !1) {
4782
4790
  for (let t of U.value) (e || t.state !== "done") && URL.revokeObjectURL(t.localUrl);
4783
- U.value = [], yr.value = null;
4791
+ U.value = [], br.value = null;
4784
4792
  }
4785
- async function dr(e) {
4793
+ async function fr(e) {
4786
4794
  let t = typeof e?.projectId == "string" ? e.projectId : void 0;
4787
- return W.value = "", pe.value = {}, me.value = {}, w.value = Qt(), qt(w.value, { projectId: t }), await Qe(), F.value.clearError(), Pe.value = void 0, Le.value = !1, ur(!0), Ir("chat"), w.value;
4795
+ return W.value = "", pe.value = {}, me.value = {}, w.value = Qt(), qt(w.value, { projectId: t }), await Qe(), F.value.clearError(), Pe.value = void 0, Le.value = !1, dr(!0), Lr("chat"), w.value;
4788
4796
  }
4789
- async function fr(e) {
4797
+ async function Y(e) {
4790
4798
  I.value || (F.value.status !== "ready" && (W.value = "", await Yn()), Et(), await F.value.regenerate(e));
4791
4799
  }
4792
- function Y(e) {
4800
+ function pr(e) {
4793
4801
  if (!I.value) {
4794
4802
  if (e.tool === "requestGeolocation") {
4795
4803
  let t = e.output;
@@ -4803,46 +4811,46 @@ function Wa(e) {
4803
4811
  F.value.addToolOutput(e);
4804
4812
  }
4805
4813
  }
4806
- function pr(e) {
4814
+ function mr(e) {
4807
4815
  I.value || F.value.addToolApprovalResponse(e);
4808
4816
  }
4809
- let mr = T(() => F.value.messages.reduce((e, t) => e + t.parts.filter((e) => e.type === "file").length, 0)), hr = T(() => _.value?.maxFilesPerMessage ?? 5), gr = T(() => _.value?.maxFilesPerChat ?? 20), _r = T(() => Math.max(0, Math.min(hr.value - U.value.length, gr.value - mr.value - U.value.length))), vr = T(() => _r.value <= 0), yr = D(null), br = () => {
4810
- yr.value = null;
4817
+ let hr = T(() => F.value.messages.reduce((e, t) => e + t.parts.filter((e) => e.type === "file").length, 0)), gr = T(() => _.value?.maxFilesPerMessage ?? 5), _r = T(() => _.value?.maxFilesPerChat ?? 20), vr = T(() => Math.max(0, Math.min(gr.value - U.value.length, _r.value - hr.value - U.value.length))), yr = T(() => vr.value <= 0), br = D(null), xr = () => {
4818
+ br.value = null;
4811
4819
  };
4812
- k(vr, (e) => {
4813
- e || (yr.value = null);
4820
+ k(yr, (e) => {
4821
+ e || (br.value = null);
4814
4822
  });
4815
- async function xr(e) {
4823
+ async function Sr(e) {
4816
4824
  if (I.value) return;
4817
- if (vr.value) {
4818
- yr.value = gr.value - mr.value - U.value.length <= hr.value - U.value.length ? {
4825
+ if (yr.value) {
4826
+ br.value = _r.value - hr.value - U.value.length <= gr.value - U.value.length ? {
4819
4827
  reason: "per-chat",
4820
- max: gr.value
4828
+ max: _r.value
4821
4829
  } : {
4822
4830
  reason: "per-message",
4823
- max: hr.value
4831
+ max: gr.value
4824
4832
  };
4825
4833
  return;
4826
4834
  }
4827
- let t = wr(e);
4828
- U.value = [...U.value, t], await Tr(t);
4835
+ let t = Tr(e);
4836
+ U.value = [...U.value, t], await Er(t);
4829
4837
  }
4830
- async function Sr(e, t) {
4838
+ async function Cr(e, t) {
4831
4839
  let n = U.value.find((t) => t.id === e.id);
4832
4840
  if (!n) return;
4833
4841
  URL.revokeObjectURL(n.localUrl);
4834
- let r = wr(t);
4835
- U.value = U.value.map((e) => e.id === n.id ? r : e), await Promise.all([Er(n), Tr(r)]);
4842
+ let r = Tr(t);
4843
+ U.value = U.value.map((e) => e.id === n.id ? r : e), await Promise.all([Dr(n), Er(r)]);
4836
4844
  }
4837
- async function Cr(e) {
4845
+ async function wr(e) {
4838
4846
  let t = U.value.find((t) => t.id === e.id && t.state === "error");
4839
4847
  t && (U.value = U.value.map((e) => e.id === t.id ? {
4840
4848
  ...e,
4841
4849
  state: "uploading",
4842
4850
  error: void 0
4843
- } : e), await Tr(t));
4851
+ } : e), await Er(t));
4844
4852
  }
4845
- function wr(e) {
4853
+ function Tr(e) {
4846
4854
  return {
4847
4855
  id: Qt(),
4848
4856
  file: e,
@@ -4850,11 +4858,11 @@ function Wa(e) {
4850
4858
  state: "uploading"
4851
4859
  };
4852
4860
  }
4853
- async function Tr({ id: e, file: t }) {
4861
+ async function Er({ id: e, file: t }) {
4854
4862
  try {
4855
4863
  let n = await E.value.uploadMedia(o.value, w.value, t);
4856
4864
  if (!U.value.some((t) => t.id === e)) {
4857
- await Dr(n);
4865
+ await Or(n);
4858
4866
  return;
4859
4867
  }
4860
4868
  U.value = U.value.map((t) => t.id === e ? {
@@ -4871,15 +4879,15 @@ function Wa(e) {
4871
4879
  } : t);
4872
4880
  }
4873
4881
  }
4874
- async function Er(e) {
4875
- e.mediaSource && await Dr(e.mediaSource);
4876
- }
4877
4882
  async function Dr(e) {
4883
+ e.mediaSource && await Or(e.mediaSource);
4884
+ }
4885
+ async function Or(e) {
4878
4886
  try {
4879
4887
  await E.value.discardMedia(e);
4880
4888
  } catch {}
4881
4889
  }
4882
- async function Or(e, t) {
4890
+ async function kr(e, t) {
4883
4891
  let { userQuestion: n, assistantMessage: r } = Wn(e);
4884
4892
  Un(await E.value.submitMessageFeedback({
4885
4893
  messageId: e.id,
@@ -4890,16 +4898,16 @@ function Wa(e) {
4890
4898
  assistantMessage: r
4891
4899
  }));
4892
4900
  }
4893
- async function kr(e) {
4894
- await Or(e, "upvote");
4895
- }
4896
4901
  async function Ar(e) {
4897
- await Or(e, "downvote");
4902
+ await kr(e, "upvote");
4903
+ }
4904
+ async function jr(e) {
4905
+ await kr(e, "downvote");
4898
4906
  }
4899
- function jr(e) {
4907
+ function Mr(e) {
4900
4908
  ln.value = !1, un.value = void 0, V.value = e;
4901
4909
  }
4902
- async function Mr(e) {
4910
+ async function Nr(e) {
4903
4911
  if (V.value) try {
4904
4912
  cn.value = !0, ln.value = !1, un.value = void 0;
4905
4913
  let { userQuestion: t, assistantMessage: n } = Wn(V.value);
@@ -4917,7 +4925,7 @@ function Wa(e) {
4917
4925
  cn.value = !1;
4918
4926
  }
4919
4927
  }
4920
- async function Nr(e) {
4928
+ async function Pr(e) {
4921
4929
  try {
4922
4930
  fn.value = !0, dn.value = !1, pn.value = void 0, await E.value.submitLead({
4923
4931
  agentId: o.value,
@@ -4930,36 +4938,36 @@ function Wa(e) {
4930
4938
  fn.value = !1;
4931
4939
  }
4932
4940
  }
4933
- async function Pr(e, t) {
4941
+ async function Fr(e, t) {
4934
4942
  let n = await E.value.updateChatTitle(o.value, e, t);
4935
4943
  R.value = R.value.map((t) => t.id === e ? {
4936
4944
  ...t,
4937
4945
  title: n.title
4938
4946
  } : t);
4939
4947
  }
4940
- async function Fr(e) {
4941
- await E.value.deleteChat(o.value, e), R.value = R.value.filter((t) => t.id !== e), w.value === e && await dr();
4948
+ async function Ir(e) {
4949
+ await E.value.deleteChat(o.value, e), R.value = R.value.filter((t) => t.id !== e), w.value === e && await fr();
4942
4950
  }
4943
- function Ir(e) {
4951
+ function Lr(e) {
4944
4952
  an.value = e;
4945
4953
  }
4946
- function Lr() {
4947
- Ir("chat"), on.value++;
4954
+ function Rr() {
4955
+ Lr("chat"), on.value++;
4948
4956
  }
4949
- let Rr;
4950
- function zr(e) {
4957
+ let zr;
4958
+ function Br(e) {
4951
4959
  let t = () => E.value.getChat(o.value, e);
4952
4960
  return t().catch(() => t().catch(() => null));
4953
4961
  }
4954
4962
  return k(l, async (e) => {
4955
- if (!e || e === Rr) return;
4956
- let t = Rr;
4957
- if (Rr = e, t === void 0) return;
4958
- let n = w.value, r = C.value ? null : await zr(n);
4963
+ if (!e || e === zr) return;
4964
+ let t = zr;
4965
+ if (zr = e, t === void 0) return;
4966
+ let n = w.value, r = C.value ? null : await Br(n);
4959
4967
  l.value === e && w.value === n && (r ? (qt(n, {
4960
4968
  authorId: r.userId,
4961
4969
  projectId: r.projectId
4962
- }), q(o.value)) : (R.value = [], sn.value = [], z.value = [], jt.value = [], N.value = [], P.value = [], Mt.value = {}, await dr(), H.value = ""));
4970
+ }), q(o.value)) : (R.value = [], sn.value = [], z.value = [], jt.value = [], N.value = [], P.value = [], Mt.value = {}, await fr(), H.value = ""));
4963
4971
  }), {
4964
4972
  apiClient: E,
4965
4973
  baseUrl: i,
@@ -4969,6 +4977,7 @@ function Wa(e) {
4969
4977
  agentType: c,
4970
4978
  userId: l,
4971
4979
  agentInterface: u,
4980
+ suggestNextMessage: or,
4972
4981
  agentModel: d,
4973
4982
  agentTools: f,
4974
4983
  headers: p,
@@ -5025,16 +5034,16 @@ function Wa(e) {
5025
5034
  isLoadingChatFiles: B,
5026
5035
  input: H,
5027
5036
  pendingAttachments: U,
5028
- isAttachmentLimitReached: vr,
5029
- fileLimitError: yr,
5037
+ isAttachmentLimitReached: yr,
5038
+ fileLimitError: br,
5030
5039
  localChatId: w,
5031
5040
  isConversationBlocked: Le,
5032
5041
  inputMessagePlaceholder: Wt,
5033
5042
  chatError: Pe,
5034
5043
  runningChatIds: $n,
5035
- backgroundAnswers: sr,
5036
- openBackgroundAnswer: cr,
5037
- dismissBackgroundAnswer: lr,
5044
+ backgroundAnswers: cr,
5045
+ openBackgroundAnswer: lr,
5046
+ dismissBackgroundAnswer: ur,
5038
5047
  canQueue: G,
5039
5048
  queuedMessages: vn,
5040
5049
  removeQueuedMessage: Sn,
@@ -5068,28 +5077,28 @@ function Wa(e) {
5068
5077
  handleSubmit: Kn,
5069
5078
  sendMessage: Jn,
5070
5079
  stopGeneration: Yn,
5071
- startNewChat: dr,
5072
- regenerate: fr,
5073
- addToolOutput: Y,
5074
- addToolApprovalResponse: pr,
5075
- handleFileSelect: xr,
5076
- discardPendingAttachment: Er,
5077
- replacePendingAttachment: Sr,
5078
- retryPendingAttachment: Cr,
5079
- clearFileLimitError: br,
5080
- clearPendingAttachments: ur,
5081
- onUpvote: kr,
5082
- onDownvote: Ar,
5083
- onFeedback: jr,
5084
- onFeedbackSubmit: Mr,
5085
- onLeadSubmit: Nr,
5086
- navigate: Ir,
5087
- focusInput: Lr,
5088
- renameChatTitle: Pr,
5089
- deleteChat: Fr
5080
+ startNewChat: fr,
5081
+ regenerate: Y,
5082
+ addToolOutput: pr,
5083
+ addToolApprovalResponse: mr,
5084
+ handleFileSelect: Sr,
5085
+ discardPendingAttachment: Dr,
5086
+ replacePendingAttachment: Cr,
5087
+ retryPendingAttachment: wr,
5088
+ clearFileLimitError: xr,
5089
+ clearPendingAttachments: dr,
5090
+ onUpvote: Ar,
5091
+ onDownvote: jr,
5092
+ onFeedback: Mr,
5093
+ onFeedbackSubmit: Nr,
5094
+ onLeadSubmit: Pr,
5095
+ navigate: Lr,
5096
+ focusInput: Rr,
5097
+ renameChatTitle: Fr,
5098
+ deleteChat: Ir
5090
5099
  };
5091
5100
  })();
5092
5101
  }
5093
5102
  export { Qt as a, qi as i, Wa as n, wa as r, Ta as t };
5094
5103
 
5095
- //# sourceMappingURL=useChatbotStore-ChrZVIDt.js.map
5104
+ //# sourceMappingURL=useChatbotStore-Hb5EjISl.js.map