@8wave/ai-elements 0.125.0-beta.17 → 0.125.0-beta.19

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 (114) hide show
  1. package/README.md +1 -0
  2. package/dist/_chunks/{PkChatbotFilePreview-xDlDvl5m.js → PkChatbotFilePreview-CFGqa-tX.js} +2 -2
  3. package/dist/_chunks/{PkChatbotFilePreview-xDlDvl5m.js.map → PkChatbotFilePreview-CFGqa-tX.js.map} +1 -1
  4. package/dist/_chunks/{PkFilePreview-BIFkMsAC.js → PkFilePreview-BzNLupQS.js} +318 -315
  5. package/dist/_chunks/PkFilePreview-BzNLupQS.js.map +1 -0
  6. package/dist/_chunks/{PkFilePreviewDialog-NLk4gZMd.js → PkFilePreviewDialog-BfZFgdOi.js} +2 -2
  7. package/dist/_chunks/{PkFilePreviewDialog-NLk4gZMd.js.map → PkFilePreviewDialog-BfZFgdOi.js.map} +1 -1
  8. package/dist/_chunks/{PkStreamingMarkdown-BFTTLuPc.js → PkStreamingMarkdown-CqLpNWQv.js} +2 -2
  9. package/dist/_chunks/{PkStreamingMarkdown-BFTTLuPc.js.map → PkStreamingMarkdown-CqLpNWQv.js.map} +1 -1
  10. package/dist/_chunks/{PkToolChatFile-Buv7Qkes.js → PkToolChatFile-iE4ZokYD.js} +2 -2
  11. package/dist/_chunks/{PkToolChatFile-Buv7Qkes.js.map → PkToolChatFile-iE4ZokYD.js.map} +1 -1
  12. package/dist/_chunks/{PkToolShareDocument-kB0qoQda.js → PkToolShareDocument-lTHNZodf.js} +2 -2
  13. package/dist/_chunks/{PkToolShareDocument-kB0qoQda.js.map → PkToolShareDocument-lTHNZodf.js.map} +1 -1
  14. package/dist/_chunks/{PkToolShowArtifact-ClYqvIqB.js → PkToolShowArtifact-BNQrM5fY.js} +2 -2
  15. package/dist/_chunks/{PkToolShowArtifact-ClYqvIqB.js.map → PkToolShowArtifact-BNQrM5fY.js.map} +1 -1
  16. package/dist/_chunks/{PkToolShowContactForm-C0ABjvtZ.js → PkToolShowContactForm-CvQoLumn.js} +2 -2
  17. package/dist/_chunks/{PkToolShowContactForm-C0ABjvtZ.js.map → PkToolShowContactForm-CvQoLumn.js.map} +1 -1
  18. package/dist/_chunks/{PkToolShowDiagram-BZbHtEs5.js → PkToolShowDiagram-COt1Z3q9.js} +2 -2
  19. package/dist/_chunks/{PkToolShowDiagram-BZbHtEs5.js.map → PkToolShowDiagram-COt1Z3q9.js.map} +1 -1
  20. package/dist/_chunks/{PkToolShowForm-DUjR-9o1.js → PkToolShowForm-DcPccCEU.js} +2 -2
  21. package/dist/_chunks/{PkToolShowForm-DUjR-9o1.js.map → PkToolShowForm-DcPccCEU.js.map} +1 -1
  22. package/dist/_chunks/{PkToolShowImageGallery-CNU2Zvso.js → PkToolShowImageGallery-DefXra8-.js} +2 -2
  23. package/dist/_chunks/{PkToolShowImageGallery-CNU2Zvso.js.map → PkToolShowImageGallery-DefXra8-.js.map} +1 -1
  24. package/dist/_chunks/{PkToolShowSources-DhDjNIFa.js → PkToolShowSources-BE3Zv_uz.js} +2 -2
  25. package/dist/_chunks/{PkToolShowSources-DhDjNIFa.js.map → PkToolShowSources-BE3Zv_uz.js.map} +1 -1
  26. package/dist/_chunks/{useLightbox-BEEzZ0qT.js → useLightbox-D2Zi-Fpe.js} +72 -13
  27. package/dist/_chunks/useLightbox-D2Zi-Fpe.js.map +1 -0
  28. package/dist/ai-elements.es.js +461 -429
  29. package/dist/ai-elements.es.js.map +1 -1
  30. package/dist-vue/PkChatbot.js +1 -1
  31. package/dist-vue/PkChatbotEmptyState.js +1 -1
  32. package/dist-vue/PkChatbotFilePreview.js +1 -1
  33. package/dist-vue/PkChatbotInput.js +1 -1
  34. package/dist-vue/PkChatbotMessages.js +1 -1
  35. package/dist-vue/PkChatbotSteps.js +1 -1
  36. package/dist-vue/PkChatbotViewChat.js +1 -1
  37. package/dist-vue/PkChatbotViewConversations.js +1 -1
  38. package/dist-vue/PkChatbotViewFiles.js +1 -1
  39. package/dist-vue/PkChatbotViewProfile.js +1 -1
  40. package/dist-vue/_chunks/{PkChatbot-BtUaZ-LR.js → PkChatbot-BVZgvanv.js} +7 -7
  41. package/dist-vue/_chunks/{PkChatbot-BtUaZ-LR.js.map → PkChatbot-BVZgvanv.js.map} +1 -1
  42. package/dist-vue/_chunks/{PkChatbotEmptyState-DJIkAskP.js → PkChatbotEmptyState-COya3H3C.js} +2 -2
  43. package/dist-vue/_chunks/{PkChatbotEmptyState-DJIkAskP.js.map → PkChatbotEmptyState-COya3H3C.js.map} +1 -1
  44. package/dist-vue/_chunks/{PkChatbotFilePreview-BpVM850N.js → PkChatbotFilePreview-BsvT6orx.js} +2 -2
  45. package/dist-vue/_chunks/{PkChatbotFilePreview-BpVM850N.js.map → PkChatbotFilePreview-BsvT6orx.js.map} +1 -1
  46. package/dist-vue/_chunks/{PkChatbotInput-DzqaW3EE.js → PkChatbotInput-D0KUEkAs.js} +5 -4
  47. package/dist-vue/_chunks/PkChatbotInput-D0KUEkAs.js.map +1 -0
  48. package/dist-vue/_chunks/{PkChatbotMessages-vkbq5p1X.js → PkChatbotMessages-l-IzEWsN.js} +17 -17
  49. package/dist-vue/_chunks/{PkChatbotMessages-vkbq5p1X.js.map → PkChatbotMessages-l-IzEWsN.js.map} +1 -1
  50. package/dist-vue/_chunks/{PkChatbotSteps-D5yz8lut.js → PkChatbotSteps-_Aqft0em.js} +2 -2
  51. package/dist-vue/_chunks/{PkChatbotSteps-D5yz8lut.js.map → PkChatbotSteps-_Aqft0em.js.map} +1 -1
  52. package/dist-vue/_chunks/{PkChatbotViewChat-DCPRePrE.js → PkChatbotViewChat-C1uzFQCJ.js} +458 -453
  53. package/dist-vue/_chunks/PkChatbotViewChat-C1uzFQCJ.js.map +1 -0
  54. package/dist-vue/_chunks/{PkChatbotViewConversations-BBd3XMmM.js → PkChatbotViewConversations-DjhiHp8-.js} +2 -2
  55. package/dist-vue/_chunks/{PkChatbotViewConversations-BBd3XMmM.js.map → PkChatbotViewConversations-DjhiHp8-.js.map} +1 -1
  56. package/dist-vue/_chunks/{PkChatbotViewFiles-BiQzDqJg.js → PkChatbotViewFiles-CtOhnFCc.js} +2 -2
  57. package/dist-vue/_chunks/{PkChatbotViewFiles-BiQzDqJg.js.map → PkChatbotViewFiles-CtOhnFCc.js.map} +1 -1
  58. package/dist-vue/_chunks/{PkChatbotViewProfile-7266UiRM.js → PkChatbotViewProfile-NfTamy9j.js} +2 -2
  59. package/dist-vue/_chunks/{PkChatbotViewProfile-7266UiRM.js.map → PkChatbotViewProfile-NfTamy9j.js.map} +1 -1
  60. package/dist-vue/_chunks/{PkFilePreview-DLo9nI2g.js → PkFilePreview-C2VOU99H.js} +469 -466
  61. package/dist-vue/_chunks/PkFilePreview-C2VOU99H.js.map +1 -0
  62. package/dist-vue/_chunks/{PkFilePreviewDialog-CgDJQgIJ.js → PkFilePreviewDialog-C6QQMntW.js} +2 -2
  63. package/dist-vue/_chunks/{PkFilePreviewDialog-CgDJQgIJ.js.map → PkFilePreviewDialog-C6QQMntW.js.map} +1 -1
  64. package/dist-vue/_chunks/{PkStreamingMarkdown-C3UGCEXm.js → PkStreamingMarkdown-2FN4WMQD.js} +2 -2
  65. package/dist-vue/_chunks/{PkStreamingMarkdown-C3UGCEXm.js.map → PkStreamingMarkdown-2FN4WMQD.js.map} +1 -1
  66. package/dist-vue/_chunks/{PkSvgViewer-DmkElalq.js → PkSvgViewer-BsdSOBpH.js} +2 -2
  67. package/dist-vue/_chunks/{PkSvgViewer-DmkElalq.js.map → PkSvgViewer-BsdSOBpH.js.map} +1 -1
  68. package/dist-vue/_chunks/{PkToolChatFile-Dy0rGC29.js → PkToolChatFile-DAT1tv52.js} +2 -2
  69. package/dist-vue/_chunks/{PkToolChatFile-Dy0rGC29.js.map → PkToolChatFile-DAT1tv52.js.map} +1 -1
  70. package/dist-vue/_chunks/{PkToolShareDocument-BIZkgcJ3.js → PkToolShareDocument-Qb2Lu5vh.js} +2 -2
  71. package/dist-vue/_chunks/{PkToolShareDocument-BIZkgcJ3.js.map → PkToolShareDocument-Qb2Lu5vh.js.map} +1 -1
  72. package/dist-vue/_chunks/{PkToolShowArtifact-B7udnhpb.js → PkToolShowArtifact-Bskomw05.js} +2 -2
  73. package/dist-vue/_chunks/{PkToolShowArtifact-B7udnhpb.js.map → PkToolShowArtifact-Bskomw05.js.map} +1 -1
  74. package/dist-vue/_chunks/{PkToolShowContactForm-0SEgxn2S.js → PkToolShowContactForm-iQrlqv7j.js} +2 -2
  75. package/dist-vue/_chunks/{PkToolShowContactForm-0SEgxn2S.js.map → PkToolShowContactForm-iQrlqv7j.js.map} +1 -1
  76. package/dist-vue/_chunks/{PkToolShowDiagram-BqHBhZgd.js → PkToolShowDiagram-C-43uUoh.js} +2 -2
  77. package/dist-vue/_chunks/{PkToolShowDiagram-BqHBhZgd.js.map → PkToolShowDiagram-C-43uUoh.js.map} +1 -1
  78. package/dist-vue/_chunks/{PkToolShowForm-C4n_3mFL.js → PkToolShowForm-CKXpqQxy.js} +2 -2
  79. package/dist-vue/_chunks/{PkToolShowForm-C4n_3mFL.js.map → PkToolShowForm-CKXpqQxy.js.map} +1 -1
  80. package/dist-vue/_chunks/{PkToolShowImageGallery-DEpdtLns.js → PkToolShowImageGallery-DLTn6JmU.js} +3 -3
  81. package/dist-vue/_chunks/{PkToolShowImageGallery-DEpdtLns.js.map → PkToolShowImageGallery-DLTn6JmU.js.map} +1 -1
  82. package/dist-vue/_chunks/{PkToolShowLocation-DCPaDtBI.js → PkToolShowLocation-B8FE_Sqd.js} +2 -2
  83. package/dist-vue/_chunks/{PkToolShowLocation-DCPaDtBI.js.map → PkToolShowLocation-B8FE_Sqd.js.map} +1 -1
  84. package/dist-vue/_chunks/{PkToolShowProductList-Bm2NLUGS.js → PkToolShowProductList-hhSBAQVC.js} +2 -2
  85. package/dist-vue/_chunks/{PkToolShowProductList-Bm2NLUGS.js.map → PkToolShowProductList-hhSBAQVC.js.map} +1 -1
  86. package/dist-vue/_chunks/{PkToolShowSources-DwFqlit2.js → PkToolShowSources-BiP9fVV2.js} +2 -2
  87. package/dist-vue/_chunks/{PkToolShowSources-DwFqlit2.js.map → PkToolShowSources-BiP9fVV2.js.map} +1 -1
  88. package/dist-vue/_chunks/{PkToolShowVideo-BLEJ8tng.js → PkToolShowVideo-DJhsbDuX.js} +2 -2
  89. package/dist-vue/_chunks/{PkToolShowVideo-BLEJ8tng.js.map → PkToolShowVideo-DJhsbDuX.js.map} +1 -1
  90. package/dist-vue/_chunks/{PkToolShowWebPages-CeAXllAF.js → PkToolShowWebPages-BAv66f5H.js} +2 -2
  91. package/dist-vue/_chunks/{PkToolShowWebPages-CeAXllAF.js.map → PkToolShowWebPages-BAv66f5H.js.map} +1 -1
  92. package/dist-vue/_chunks/{createChatbotApiClient-BPN6cLGF.js → createChatbotApiClient-DO4_I5hT.js} +8 -1
  93. package/dist-vue/_chunks/createChatbotApiClient-DO4_I5hT.js.map +1 -0
  94. package/dist-vue/_chunks/{useChatbotStore-C4xhJtrb.js → useChatbotStore-BZ1n3Hyx.js} +662 -649
  95. package/dist-vue/_chunks/useChatbotStore-BZ1n3Hyx.js.map +1 -0
  96. package/dist-vue/_chunks/{useLightbox-gSzoBgNv.js → useLightbox-FDyQrPWe.js} +72 -13
  97. package/dist-vue/_chunks/useLightbox-FDyQrPWe.js.map +1 -0
  98. package/dist-vue/api.js +1 -1
  99. package/dist-vue/composables.js +8 -2
  100. package/dist-vue/composables.js.map +1 -1
  101. package/dist-vue/index.js +25 -25
  102. package/dist-vue/locales.js +6 -0
  103. package/dist-vue/packages/components/src/chat/PkChatbotInput.d.ts +2 -0
  104. package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +6 -0
  105. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +4 -1
  106. package/package.json +1 -1
  107. package/dist/_chunks/PkFilePreview-BIFkMsAC.js.map +0 -1
  108. package/dist/_chunks/useLightbox-BEEzZ0qT.js.map +0 -1
  109. package/dist-vue/_chunks/PkChatbotInput-DzqaW3EE.js.map +0 -1
  110. package/dist-vue/_chunks/PkChatbotViewChat-DCPRePrE.js.map +0 -1
  111. package/dist-vue/_chunks/PkFilePreview-DLo9nI2g.js.map +0 -1
  112. package/dist-vue/_chunks/createChatbotApiClient-BPN6cLGF.js.map +0 -1
  113. package/dist-vue/_chunks/useChatbotStore-C4xhJtrb.js.map +0 -1
  114. package/dist-vue/_chunks/useLightbox-gSzoBgNv.js.map +0 -1
@@ -3,7 +3,7 @@ import { C as e, E as t, S as n, T as r, _ as i, a, b as o, d as s, f as c, g as
3
3
  import { $ as ee, A as w, B as te, C as T, Ct as E, D as ne, Dt as re, E as D, Et as O, F as k, H as ie, I as ae, J as A, L as oe, N as se, O as ce, Ot as le, P as ue, Q as j, R as de, S as M, St as N, T as fe, Tt as P, V as pe, W as F, X as me, Y as he, _ as I, at as ge, b as _e, bt as ve, ct as ye, d as be, dt as xe, f as L, ft as Se, g as R, gt as z, h as B, i as Ce, it as we, k as V, kt as H, l as Te, lt as Ee, mt as De, n as Oe, nt as ke, ot as U, p as Ae, pt as je, q as Me, r as Ne, t as W, tt as G, u as Pe, ut as Fe, v as K, vt as Ie, w as q, wt as J, x as Le, xt as Re, y as Y, yt as ze, z as X } from "./_chunks/vue.runtime.esm-bundler-C2U5uTqB.js";
4
4
  import { n as Be, r as Ve, t as He } from "./_chunks/vue-i18n-POtLvOl1.js";
5
5
  import { i as Ue, n as We, r as Ge } from "./_chunks/iconify-oSMMdRMF.js";
6
- import { t as Ke } from "./_chunks/PkStreamingMarkdown-BFTTLuPc.js";
6
+ import { t as Ke } from "./_chunks/PkStreamingMarkdown-CqLpNWQv.js";
7
7
  import { A as qe, B as Je, D as Ye, E as Xe, F as Ze, I as Qe, L as $e, M as et, N as tt, O as nt, R as rt, S as it, T as at, _ as Z, a as ot, b as st, c as ct, d as lt, g as ut, h as dt, i as ft, j as pt, k as mt, l as ht, n as gt, o as _t, r as vt, s as yt, u as bt, w as xt, x as St } from "./_chunks/Agent-CCBs3D5I.js";
8
8
  import { a as Ct, i as wt, n as Tt, t as Et } from "./_chunks/markdown-Ou0WulrH.js";
9
9
  import { n as Dt } from "./_chunks/src-JJyCGvqH.js";
@@ -18,8 +18,8 @@ import { t as Gn } from "./_chunks/useImageFallback-BePGTrF3.js";
18
18
  import { n as Kn, t as qn } from "./_chunks/PkSelectionActions-CUymhwsG.js";
19
19
  import { t as Jn } from "./_chunks/_plugin-vue_export-helper-Djzt4Yr7.js";
20
20
  import { t as Yn } from "./_chunks/chatImagePolicy-Df31QSRJ.js";
21
- import { t as Xn } from "./_chunks/useLightbox-BEEzZ0qT.js";
22
- import { t as Zn } from "./_chunks/PkChatbotFilePreview-xDlDvl5m.js";
21
+ import { t as Xn } from "./_chunks/useLightbox-D2Zi-Fpe.js";
22
+ import { t as Zn } from "./_chunks/PkChatbotFilePreview-CFGqa-tX.js";
23
23
  // ../../node_modules/.pnpm/pinia@4.1.0_@vue+devtools-api@8.2.1_typescript@6.0.3_vue@3.5.44_typescript@6.0.3_/node_modules/pinia/dist/pinia.js
24
24
  V(), U();
25
25
  var Qn = typeof window < "u", $n, er = (e) => $n = e, tr = Symbol();
@@ -1492,6 +1492,9 @@ var jr = {
1492
1492
  noHeadings: "Il documento non ha titoli."
1493
1493
  },
1494
1494
  lightbox: {
1495
+ copy: "Copia immagine",
1496
+ copied: "Immagine copiata",
1497
+ copyFailed: "Non è stato possibile copiare l'immagine",
1495
1498
  openInNewTab: "Apri in una nuova scheda",
1496
1499
  zoom: "Ingrandisci o riduci"
1497
1500
  },
@@ -3641,6 +3644,9 @@ var jr = {
3641
3644
  noHeadings: "The document has no headings."
3642
3645
  },
3643
3646
  lightbox: {
3647
+ copy: "Copy image",
3648
+ copied: "Image copied",
3649
+ copyFailed: "The image could not be copied",
3644
3650
  openInNewTab: "Open in a new tab",
3645
3651
  zoom: "Zoom in or out"
3646
3652
  },
@@ -7188,6 +7194,13 @@ function Lc(e) {
7188
7194
  }
7189
7195
  return o.json();
7190
7196
  },
7197
+ async discardMedia(e) {
7198
+ await i("/medias/discard", {
7199
+ method: "POST",
7200
+ headers: { "Content-Type": "application/json" },
7201
+ body: JSON.stringify(e)
7202
+ }, "void");
7203
+ },
7191
7204
  getChatEndpoint(e, t = "chat") {
7192
7205
  return `${n}/agents/${encodeURIComponent(e)}/${t === "reasoning" ? "reasoning-chat" : "chat"}`;
7193
7206
  },
@@ -11108,7 +11121,7 @@ function ep(e) {
11108
11121
  Ye.value.includes(e) || (Ye.value = [...Ye.value, e]), Qe.set(e, Date.now()), n ? et.add(e) : et.delete(e), t && (Ze.value = {
11109
11122
  ...Ze.value,
11110
11123
  [e]: t
11111
- }), Mn || Fn();
11124
+ }), Nn || In();
11112
11125
  }
11113
11126
  function rt(e) {
11114
11127
  Ze.value = Object.fromEntries(Object.entries(Ze.value).filter(([t]) => t !== e));
@@ -11168,15 +11181,15 @@ function ep(e) {
11168
11181
  },
11169
11182
  onFinish: () => {
11170
11183
  let e = F.value;
11171
- !fe.value && !ft.value.some((t) => t.id === e) && qt(o.value);
11184
+ !fe.value && !ft.value.some((t) => t.id === e) && Jt(o.value);
11172
11185
  }
11173
11186
  })), Z = B(() => De(at)), ot = () => Z.value.messages[Z.value.messages.length - 1];
11174
11187
  j(F, (e, t) => {
11175
- if (t && !fe.value && (an() || We?.chatId === t)) {
11188
+ if (t && !fe.value && (on() || We?.chatId === t)) {
11176
11189
  let e = Z.value.messages.filter((e) => e.role === "user"), n = e[e.length - 1];
11177
11190
  nt(t, n ? Kt(n) ?? "" : "", Z.value.status === "streaming" || We?.chatId === t);
11178
11191
  }
11179
- it(e), Ke = void 0, clearTimeout(On), En.value = !1, Z.value.stop();
11192
+ it(e), Ke = void 0, clearTimeout(kn), On.value = !1, Z.value.stop();
11180
11193
  }, { flush: "sync" });
11181
11194
  let st = B(() => {
11182
11195
  let e = u.value?.initialMessage;
@@ -11211,29 +11224,29 @@ function ep(e) {
11211
11224
  }), dt = B(() => {
11212
11225
  let e = u.value?.messagePlaceholder;
11213
11226
  return e?.[r.value] ? e[r.value] : n("placeholder.askAnything") ? t("placeholder.askAnything") : "";
11214
- }), ft = z([]), ht = z(!1), gt = z(1), _t = z(!1), vt = z(!1), yt, bt = z([]), xt = z(!1), St = z("chat"), Ct = z(0), wt = z([]), Tt = z(), Et = z(!1), Ot = z(!1), kt = z(), At = z(!1), jt = z(!1), Mt = z(), Nt = z(""), Pt = z([]), Ft = z(""), It = Ie(), Lt = z(0), Rt = Bn(B(() => `${o.value}-queue`), {}), zt = B(() => Rt.value[F.value] ?? []), Bt = B(() => !fe.value);
11215
- function Vt(e, t) {
11216
- let n = Object.fromEntries(Object.entries(Rt.value).filter(([t]) => t !== e));
11217
- Rt.value = t.length > 0 ? {
11227
+ }), ft = z([]), ht = z(!1), gt = z(1), _t = z(!1), vt = z(!1), yt, bt = z([]), xt = z(!1), St = z("chat"), Ct = z(0), wt = z([]), Tt = z(), Et = z(!1), Ot = z(!1), kt = z(), At = z(!1), jt = z(!1), Mt = z(), Nt = z(""), Pt = z([]), Ft = z(""), It = z(!0), Lt = Ie(), Rt = z(0), zt = Bn(B(() => `${o.value}-queue`), {}), Bt = B(() => zt.value[F.value] ?? []), Vt = B(() => !fe.value);
11228
+ function Ht(e, t) {
11229
+ let n = Object.fromEntries(Object.entries(zt.value).filter(([t]) => t !== e));
11230
+ zt.value = t.length > 0 ? {
11218
11231
  ...n,
11219
11232
  [e]: t
11220
11233
  } : n;
11221
11234
  }
11222
- function Ht(e) {
11223
- let t = (Rt.value[e] ?? []).join(Xf);
11224
- return Vt(e, []), t;
11225
- }
11226
11235
  function Ut(e) {
11227
- e && (Nt.value = Nt.value ? `${Nt.value}${Xf}${e}` : e);
11236
+ let t = (zt.value[e] ?? []).join(Xf);
11237
+ return Ht(e, []), t;
11228
11238
  }
11229
11239
  function Wt(e) {
11230
- Vt(F.value, zt.value.filter((t, n) => n !== e));
11240
+ e && (Nt.value = Nt.value ? `${Nt.value}${Xf}${e}` : e);
11231
11241
  }
11232
11242
  function Gt(e) {
11233
- let t = zt.value[e];
11234
- Wt(e), Ut(t ?? "");
11243
+ Ht(F.value, Bt.value.filter((t, n) => n !== e));
11235
11244
  }
11236
- async function qt(e) {
11245
+ function qt(e) {
11246
+ let t = Bt.value[e];
11247
+ Gt(e), Wt(t ?? "");
11248
+ }
11249
+ async function Jt(e) {
11237
11250
  if (fe.value) ft.value = [];
11238
11251
  else {
11239
11252
  ht.value = !0;
@@ -11259,10 +11272,10 @@ function ep(e) {
11259
11272
  } finally {
11260
11273
  ht.value = !1;
11261
11274
  }
11262
- In([.../* @__PURE__ */ new Set([...An(), ...ft.value.map((e) => e.id)])]);
11275
+ Ln([.../* @__PURE__ */ new Set([...jn(), ...ft.value.map((e) => e.id)])]);
11263
11276
  }
11264
11277
  }
11265
- async function Jt() {
11278
+ async function Yt() {
11266
11279
  if (!_t.value || vt.value || fe.value) return;
11267
11280
  vt.value = !0;
11268
11281
  let e = yt;
@@ -11275,10 +11288,10 @@ function ep(e) {
11275
11288
  vt.value = !1;
11276
11289
  }
11277
11290
  }
11278
- async function Yt(e) {
11291
+ async function Xt(e) {
11279
11292
  return fe.value ? [] : Ee.value.getConversations(o.value, l.value, { search: e });
11280
11293
  }
11281
- async function Xt() {
11294
+ async function Zt() {
11282
11295
  let e = F.value;
11283
11296
  if (!e) bt.value = [];
11284
11297
  else {
@@ -11292,33 +11305,33 @@ function ep(e) {
11292
11305
  }
11293
11306
  }
11294
11307
  }
11295
- function Zt(e, t = !1) {
11308
+ function Qt(e, t = !1) {
11296
11309
  return Ee.value.getChatFileDownloadUrl(e, t);
11297
11310
  }
11298
- function Qt(e) {
11311
+ function $t(e) {
11299
11312
  return Ee.value.getChatFilePreviewUrl(e);
11300
11313
  }
11301
- async function $t(e) {
11314
+ async function en(e) {
11302
11315
  await Ee.value.deleteChatFile(e);
11303
11316
  let t = bt.value.find((t) => t.documentId === e), n = t?.kind === "spreadsheet" ? t.sourceAttachmentId ?? t.documentId : void 0;
11304
11317
  bt.value = bt.value.filter((t) => t.documentId !== e && (!n || t.documentId !== n && t.sourceAttachmentId !== n));
11305
11318
  }
11306
- async function en(e, t) {
11319
+ async function tn(e, t) {
11307
11320
  if (!fe.value) try {
11308
11321
  let n = await Ee.value.getChat(e, t);
11309
11322
  if (t !== F.value || Z.value.status !== "ready" || Z.value.messages.length > 0) return;
11310
- n && (Z.value.messages = n.messages, we.value = n.blocked ?? !1, tn(e, t, n.turnInProgress === !0));
11323
+ n && (Z.value.messages = n.messages, we.value = n.blocked ?? !1, nn(e, t, n.turnInProgress === !0));
11311
11324
  } catch {}
11312
11325
  }
11313
- async function tn(e, t, n) {
11314
- n && (await nn(t), t !== F.value || an()) || (await rn(e, t), t === F.value && await un());
11326
+ async function nn(e, t, n) {
11327
+ n && (await rn(t), t !== F.value || on()) || (await an(e, t), t === F.value && await dn());
11315
11328
  }
11316
- async function nn(e) {
11329
+ async function rn(e) {
11317
11330
  let t = { chatId: e };
11318
11331
  We = t, Ge.value = e;
11319
11332
  let n = () => We === t && e === F.value, r = Date.now() + Hf;
11320
11333
  try {
11321
- for (; n() && !an() && Date.now() < r;) {
11334
+ for (; n() && !on() && Date.now() < r;) {
11322
11335
  Ue = !0;
11323
11336
  try {
11324
11337
  await Z.value.resumeStream();
@@ -11328,7 +11341,7 @@ function ep(e) {
11328
11341
  if (!n()) return;
11329
11342
  Z.value.clearError();
11330
11343
  let t = await Ee.value.getChat(o.value, e).catch(() => null);
11331
- if (!t || !n() || an()) return;
11344
+ if (!t || !n() || on()) return;
11332
11345
  if (!t.turnInProgress) {
11333
11346
  Z.value.messages = t.messages;
11334
11347
  return;
@@ -11339,7 +11352,7 @@ function ep(e) {
11339
11352
  We === t && (We = void 0, Ge.value = void 0);
11340
11353
  }
11341
11354
  }
11342
- async function rn(e, t) {
11355
+ async function an(e, t) {
11343
11356
  let n;
11344
11357
  try {
11345
11358
  n = Number(sessionStorage.getItem(Bc)), sessionStorage.removeItem(Bc);
@@ -11372,75 +11385,75 @@ function ep(e) {
11372
11385
  }
11373
11386
  }
11374
11387
  }
11375
- let an = () => {
11388
+ let on = () => {
11376
11389
  let e = Z.value.status;
11377
11390
  return e === "submitted" || e === "streaming";
11378
- }, on = () => an() || We?.chatId === F.value || w.value > 0, sn = () => {
11391
+ }, sn = () => on() || We?.chatId === F.value || w.value > 0, ln = () => {
11379
11392
  let e = ot();
11380
11393
  return Ae.value !== void 0 || Lf(e) || Qf(e);
11381
- }, ln = /* @__PURE__ */ new Set();
11382
- async function un() {
11394
+ }, un = /* @__PURE__ */ new Set();
11395
+ async function dn() {
11383
11396
  let e = F.value;
11384
- if (!(ln.has(e) || zt.value.length === 0 || on() || Ce.value)) {
11385
- if (sn()) Ut(Ht(e));
11397
+ if (!(un.has(e) || Bt.value.length === 0 || sn() || Ce.value)) {
11398
+ if (ln()) Wt(Ut(e));
11386
11399
  else {
11387
- ln.add(e);
11400
+ un.add(e);
11388
11401
  try {
11389
11402
  let t = Date.now() + qf;
11390
11403
  for (; Date.now() < t && (await Promise.race([Ee.value.getRunningTurns(o.value, [e]).catch(() => []), new Promise((t) => setTimeout(() => t([e]), Yf))])).includes(e);) await new Promise((e) => setTimeout(e, Jf));
11391
- if (e !== F.value || on()) return;
11392
- let n = Ht(e);
11393
- n && xn(n);
11404
+ if (e !== F.value || sn()) return;
11405
+ let n = Ut(e);
11406
+ n && Cn(n);
11394
11407
  } finally {
11395
- ln.delete(e);
11408
+ un.delete(e);
11396
11409
  }
11397
11410
  }
11398
11411
  }
11399
11412
  }
11400
- let dn = 0, fn = 0;
11401
- async function pn() {
11402
- if (fe.value || an()) return "indeterminate";
11403
- let e = F.value, t = dn += 1;
11413
+ let fn = 0, pn = 0;
11414
+ async function mn() {
11415
+ if (fe.value || on()) return "indeterminate";
11416
+ let e = F.value, t = fn += 1;
11404
11417
  try {
11405
11418
  let n = await Ee.value.getChat(o.value, e);
11406
- if (!n || e !== F.value || an() || t <= fn) return "indeterminate";
11407
- fn = t;
11419
+ if (!n || e !== F.value || on() || t <= pn) return "indeterminate";
11420
+ pn = t;
11408
11421
  let r = n.messages, i = Vf(r, Z.value.messages);
11409
11422
  return Z.value.messages = [...r, ...i], we.value = n.blocked ?? !1, i.length > 0 ? "pending" : "caught-up";
11410
11423
  } catch {}
11411
11424
  return "indeterminate";
11412
11425
  }
11413
- function mn(e) {
11426
+ function hn(e) {
11414
11427
  Z.value.messages = [...Z.value.messages, e];
11415
11428
  }
11416
- async function hn(e) {
11429
+ async function gn(e) {
11417
11430
  try {
11418
11431
  wt.value = await Ee.value.getMessageFeedbacks(e);
11419
11432
  } catch {
11420
11433
  wt.value = [];
11421
11434
  }
11422
11435
  }
11423
- function gn(e) {
11436
+ function _n(e) {
11424
11437
  let t = wt.value.findIndex((t) => t.messageId === e.messageId);
11425
11438
  t >= 0 ? wt.value[t] = e : wt.value.push(e);
11426
11439
  }
11427
- function _n(e) {
11440
+ function vn(e) {
11428
11441
  let t = ut.value, n = t.findIndex((t) => t.id === e.id), r = Kt(e) ?? "", i = t.slice(0, n).reverse().find((e) => e.role === "user");
11429
11442
  return {
11430
11443
  userQuestion: Kt(i ?? e) ?? "",
11431
11444
  assistantMessage: r
11432
11445
  };
11433
11446
  }
11434
- async function vn(e, t) {
11447
+ async function yn(e, t) {
11435
11448
  await Promise.all([
11436
- en(e, t),
11437
- qt(e),
11438
- hn(t)
11449
+ tn(e, t),
11450
+ Jt(e),
11451
+ gn(t)
11439
11452
  ]), Oe.value || ai((e, t) => Ee.value.reverseGeocode(e, t, r.value)).then((e) => {
11440
11453
  e && (Oe.value = e);
11441
11454
  });
11442
11455
  }
11443
- async function yn() {
11456
+ async function bn() {
11444
11457
  let e = Nt.value.trim(), t = Pt.value.filter((e) => e.state === "done" && e.mediaSource !== void 0).map((e) => ({
11445
11458
  type: "file",
11446
11459
  mediaType: e.mediaSource.mimeType,
@@ -11448,14 +11461,14 @@ function ep(e) {
11448
11461
  filename: e.mediaSource.name,
11449
11462
  providerMetadata: { "8bot": { media: e.mediaSource } }
11450
11463
  })), n = xe.value ? ie.value : void 0;
11451
- !fe.value && on() ? e && t.length === 0 && !n && (Vt(F.value, [...zt.value, e]), Nt.value = "") : (fe.value && ut.value.length > 0 && await Un(), xn(e, t, n && { pagePointer: n }), Nt.value = "", ie.value = void 0, Vn());
11464
+ !fe.value && sn() ? e && t.length === 0 && !n && (Ht(F.value, [...Bt.value, e]), Nt.value = "") : (fe.value && ut.value.length > 0 && await Wn(), Cn(e, t, n && { pagePointer: n }), Nt.value = "", ie.value = void 0, Un());
11452
11465
  }
11453
- function bn(e, t) {
11466
+ function xn(e, t) {
11454
11467
  let n = e.trim();
11455
- return !n || we.value || on() || Z.value.status !== "ready" ? !1 : (xn(n, [], t, { rollback: !1 }), !0);
11468
+ return !n || we.value || sn() || Z.value.status !== "ready" ? !1 : (Cn(n, [], t, { toInput: !1 }), !0);
11456
11469
  }
11457
- function xn(e, t = [], n, { rollback: r = !0 } = {}) {
11458
- Be(), Ft.value = r ? e : "", It.value = r && n && "pagePointer" in n ? n.pagePointer : void 0, Lt.value = Z.value.messages.length;
11470
+ function Cn(e, t = [], n, { toInput: r = !0 } = {}) {
11471
+ Be(), Ft.value = e, It.value = r, Lt.value = r && n && "pagePointer" in n ? n.pagePointer : void 0, Rt.value = Z.value.messages.length;
11459
11472
  let i = Z.value.sendMessage;
11460
11473
  i({
11461
11474
  text: e,
@@ -11463,7 +11476,7 @@ function ep(e) {
11463
11476
  ...n && { metadata: n }
11464
11477
  });
11465
11478
  }
11466
- function Cn(e) {
11479
+ function wn(e) {
11467
11480
  let t = e.trim();
11468
11481
  if (!t) return;
11469
11482
  if (Z.value.status !== "ready") {
@@ -11473,25 +11486,25 @@ function ep(e) {
11473
11486
  let n = Z.value.sendMessage;
11474
11487
  Be(), n({ text: t });
11475
11488
  }
11476
- async function wn() {
11477
- let e = Z.value.messages.slice(Lt.value).some((e) => e.parts.some($e)), t = Ft.value, n = It.value, r = t.length > 0 && !e, i = F.value, a = Lt.value, s = We?.chatId === i, c = Ke, l = Ht(i), u = (e = "") => {
11489
+ async function Tn() {
11490
+ let e = Z.value.messages.slice(Rt.value).some((e) => e.parts.some($e)), t = Ft.value, n = It.value, r = Lt.value, i = t.length > 0 && !e, a = F.value, s = Rt.value, c = We?.chatId === a, l = Ke, u = Ut(a), d = (e = "") => {
11478
11491
  Nt.value = [
11479
11492
  e,
11480
- l,
11493
+ u,
11481
11494
  Nt.value
11482
11495
  ].filter(Boolean).join(Xf);
11483
- }, d = () => i === F.value && !an() && Lt.value === a ? !1 : (l && Vt(i, [l, ...Rt.value[i] ?? []]), !0);
11496
+ }, f = () => a === F.value && !on() && Rt.value === s ? !1 : (u && Ht(a, [u, ...zt.value[a] ?? []]), !0);
11484
11497
  We = void 0, Ge.value = void 0, Be(), await Z.value.stop();
11485
- let f = fe.value || e && !s || await Ee.value.stopChatTurn(o.value, i, c).catch(() => !0);
11486
- if (!d()) {
11487
- if (s || !f) {
11488
- if (await pn(), d()) return;
11489
- if (s || Z.value.messages.length > Lt.value) {
11490
- Ft.value = "", u();
11498
+ let p = fe.value || e && !c || await Ee.value.stopChatTurn(o.value, a, l).catch(() => !0);
11499
+ if (!f()) {
11500
+ if (c || !p) {
11501
+ if (await mn(), f()) return;
11502
+ if (c || Z.value.messages.length > Rt.value) {
11503
+ Ft.value = "", d();
11491
11504
  return;
11492
11505
  }
11493
11506
  }
11494
- r ? (u(t), ie.value ??= n, Z.value.messages = Z.value.messages.slice(0, Lt.value), Ft.value = "") : u();
11507
+ i ? (d(n ? t : ""), ie.value ??= r, Z.value.messages = Z.value.messages.slice(0, Rt.value), Ft.value = "") : d();
11495
11508
  }
11496
11509
  }
11497
11510
  j(() => Z.value.messages, (e) => {
@@ -11500,92 +11513,92 @@ function ep(e) {
11500
11513
  }), j(() => Z.value.status, (e) => {
11501
11514
  e === "submitted" && (le.value++, Ke = void 0);
11502
11515
  });
11503
- let Tn;
11516
+ let En;
11504
11517
  j(() => [
11505
11518
  Z.value.status,
11506
11519
  w.value,
11507
11520
  te.value
11508
11521
  ], ([e, t, n]) => {
11509
- clearTimeout(Tn), e === "ready" && t === 0 && n === 0 && (Tn = setTimeout(() => {
11522
+ clearTimeout(En), e === "ready" && t === 0 && n === 0 && (En = setTimeout(() => {
11510
11523
  ce.value = !1;
11511
11524
  }, 1500));
11512
11525
  });
11513
- let En = z(!1), On;
11514
- j(() => !Ae.value && !Lf(ot()) && (an() || w.value > 0), (e) => {
11515
- clearTimeout(On), e ? En.value = !0 : On = setTimeout(() => {
11516
- En.value = !1;
11526
+ let On = z(!1), kn;
11527
+ j(() => !Ae.value && !Lf(ot()) && (on() || w.value > 0), (e) => {
11528
+ clearTimeout(kn), e ? On.value = !0 : kn = setTimeout(() => {
11529
+ On.value = !1;
11517
11530
  }, 400);
11518
11531
  }, { immediate: !0 });
11519
- let kn = B(() => {
11532
+ let An = B(() => {
11520
11533
  let e = Je.value.filter((e) => e !== F.value);
11521
- return En.value || Ge.value === F.value ? [...e, F.value] : e;
11522
- }), An = () => [.../* @__PURE__ */ new Set([...Je.value, ...Ye.value])], jn = Sn(), Mn, Nn = 0, Pn = 0;
11523
- function Fn() {
11524
- clearTimeout(Mn), Mn = void 0, An().length !== 0 && jn.value === "visible" && (Mn = setTimeout(() => {
11525
- Mn = void 0, In(An());
11534
+ return On.value || Ge.value === F.value ? [...e, F.value] : e;
11535
+ }), jn = () => [.../* @__PURE__ */ new Set([...Je.value, ...Ye.value])], Mn = Sn(), Nn, Pn = 0, Fn = 0;
11536
+ function In() {
11537
+ clearTimeout(Nn), Nn = void 0, jn().length !== 0 && Mn.value === "visible" && (Nn = setTimeout(() => {
11538
+ Nn = void 0, Ln(jn());
11526
11539
  }, Wf));
11527
11540
  }
11528
- async function In(e) {
11541
+ async function Ln(e) {
11529
11542
  let t = e.slice(0, Gf);
11530
11543
  if (fe.value || t.length === 0) {
11531
- Fn();
11544
+ In();
11532
11545
  return;
11533
11546
  }
11534
- let n = Nn += 1, r;
11547
+ let n = Pn += 1, r;
11535
11548
  try {
11536
11549
  r = await Ee.value.getRunningTurns(o.value, t);
11537
11550
  } catch {
11538
- Fn();
11551
+ In();
11539
11552
  return;
11540
11553
  }
11541
- if (n <= Pn) return;
11542
- Pn = n;
11554
+ if (n <= Fn) return;
11555
+ Fn = n;
11543
11556
  for (let e of r) et.add(e);
11544
- let i = new Set(t), a = An().filter((e) => i.has(e) && !r.includes(e)), s = (e) => Ye.value.includes(e) && !et.has(e), c = a.filter((e) => s(e) && Date.now() - (Qe.get(e) ?? 0) > Kf), l = a.filter((e) => !s(e));
11557
+ let i = new Set(t), a = jn().filter((e) => i.has(e) && !r.includes(e)), s = (e) => Ye.value.includes(e) && !et.has(e), c = a.filter((e) => s(e) && Date.now() - (Qe.get(e) ?? 0) > Kf), l = a.filter((e) => !s(e));
11545
11558
  Je.value = [...Je.value.filter((e) => !i.has(e)), ...r];
11546
11559
  let u = l.filter((e) => Ye.value.includes(e));
11547
- (u.length > 0 || c.length > 0) && (Ye.value = Ye.value.filter((e) => !u.includes(e) && !c.includes(e)), Xe.value = [...Xe.value, ...u.filter((e) => e !== F.value && !Xe.value.includes(e))]), l.length > 0 && qt(o.value), Fn();
11560
+ (u.length > 0 || c.length > 0) && (Ye.value = Ye.value.filter((e) => !u.includes(e) && !c.includes(e)), Xe.value = [...Xe.value, ...u.filter((e) => e !== F.value && !Xe.value.includes(e))]), l.length > 0 && Jt(o.value), In();
11548
11561
  }
11549
- j(jn, (e) => {
11550
- e === "visible" ? In(An()) : (clearTimeout(Mn), Mn = void 0);
11551
- }), je(() => clearTimeout(Mn));
11552
- let Ln = B(() => Xe.value.map((e) => ({
11562
+ j(Mn, (e) => {
11563
+ e === "visible" ? Ln(jn()) : (clearTimeout(Nn), Nn = void 0);
11564
+ }), je(() => clearTimeout(Nn));
11565
+ let Rn = B(() => Xe.value.map((e) => ({
11553
11566
  chatId: e,
11554
11567
  title: ft.value.find((t) => t.id === e)?.title || Ze.value[e] || void 0
11555
11568
  })));
11556
- function Rn(e) {
11557
- it(e), F.value = e, lr("chat");
11558
- }
11559
11569
  function zn(e) {
11570
+ it(e), F.value = e, fr("chat");
11571
+ }
11572
+ function Vn(e) {
11560
11573
  Xe.value = Xe.value.filter((t) => t !== e), rt(e);
11561
11574
  }
11562
11575
  j(() => [Z.value.status, Z.value.id], ([e, t], [n, r]) => {
11563
11576
  if (t === r) {
11564
- if (e === "error") We?.chatId !== F.value && Ut(Ht(F.value));
11577
+ if (e === "error") We?.chatId !== F.value && Wt(Ut(F.value));
11565
11578
  else if (e === "ready" && (n === "streaming" || n === "submitted")) {
11566
- if (sn()) {
11567
- Ut(Ht(F.value));
11579
+ if (ln()) {
11580
+ Wt(Ut(F.value));
11568
11581
  return;
11569
11582
  }
11570
- un();
11583
+ dn();
11571
11584
  }
11572
11585
  }
11573
11586
  }), j(w, (e) => {
11574
- e === 0 && Z.value.status === "ready" && un();
11587
+ e === 0 && Z.value.status === "ready" && dn();
11575
11588
  }), j(() => Z.value.status, (e) => {
11576
11589
  e === "ready" && Ft.value.length > 0 && (Ft.value = "");
11577
11590
  });
11578
- function Vn(e = !1) {
11591
+ function Un(e = !1) {
11579
11592
  for (let t of Pt.value) (e || t.state !== "done") && URL.revokeObjectURL(t.localUrl);
11580
- Pt.value = [], Qn.value = null;
11593
+ Pt.value = [], $n.value = null;
11581
11594
  }
11582
- async function Un() {
11583
- return Ft.value = "", oe.value = {}, se.value = {}, F.value = Fl(), await k(), Z.value.clearError(), Ce.value = void 0, we.value = !1, Vn(!0), lr("chat"), F.value;
11595
+ async function Wn() {
11596
+ return Ft.value = "", oe.value = {}, se.value = {}, F.value = Fl(), await k(), Z.value.clearError(), Ce.value = void 0, we.value = !1, Un(!0), fr("chat"), F.value;
11584
11597
  }
11585
- async function Wn(e) {
11586
- Z.value.status !== "ready" && (Ft.value = "", await wn()), Be(), await Z.value.regenerate(e);
11598
+ async function Gn(e) {
11599
+ Z.value.status !== "ready" && (Ft.value = "", await Tn()), Be(), await Z.value.regenerate(e);
11587
11600
  }
11588
- function Gn(e) {
11601
+ function Kn(e) {
11589
11602
  if (e.tool === "requestGeolocation") {
11590
11603
  let t = e.output;
11591
11604
  "latitude" in t && (Oe.value = {
@@ -11597,23 +11610,23 @@ function ep(e) {
11597
11610
  }
11598
11611
  Z.value.addToolOutput(e);
11599
11612
  }
11600
- function Kn(e) {
11613
+ function qn(e) {
11601
11614
  Z.value.addToolApprovalResponse(e);
11602
11615
  }
11603
- let qn = B(() => Z.value.messages.reduce((e, t) => e + t.parts.filter((e) => e.type === "file").length, 0)), Jn = B(() => _.value?.maxFilesPerMessage ?? 5), Yn = B(() => _.value?.maxFilesPerChat ?? 20), Xn = B(() => Math.max(0, Math.min(Jn.value - Pt.value.length, Yn.value - qn.value - Pt.value.length))), Zn = B(() => Xn.value <= 0), Qn = z(null), $n = () => {
11604
- Qn.value = null;
11616
+ let Jn = B(() => Z.value.messages.reduce((e, t) => e + t.parts.filter((e) => e.type === "file").length, 0)), Yn = B(() => _.value?.maxFilesPerMessage ?? 5), Xn = B(() => _.value?.maxFilesPerChat ?? 20), Zn = B(() => Math.max(0, Math.min(Yn.value - Pt.value.length, Xn.value - Jn.value - Pt.value.length))), Qn = B(() => Zn.value <= 0), $n = z(null), er = () => {
11617
+ $n.value = null;
11605
11618
  };
11606
- j(Zn, (e) => {
11607
- e || (Qn.value = null);
11619
+ j(Qn, (e) => {
11620
+ e || ($n.value = null);
11608
11621
  });
11609
- async function er(e) {
11610
- if (Zn.value) {
11611
- Qn.value = Yn.value - qn.value - Pt.value.length <= Jn.value - Pt.value.length ? {
11622
+ async function tr(e) {
11623
+ if (Qn.value) {
11624
+ $n.value = Xn.value - Jn.value - Pt.value.length <= Yn.value - Pt.value.length ? {
11612
11625
  reason: "per-chat",
11613
- max: Yn.value
11626
+ max: Xn.value
11614
11627
  } : {
11615
11628
  reason: "per-message",
11616
- max: Jn.value
11629
+ max: Yn.value
11617
11630
  };
11618
11631
  return;
11619
11632
  }
@@ -11626,6 +11639,10 @@ function ep(e) {
11626
11639
  Pt.value = [...Pt.value, n];
11627
11640
  try {
11628
11641
  let n = await Ee.value.uploadMedia(o.value, F.value, e);
11642
+ if (!Pt.value.some((e) => e.id === t)) {
11643
+ await rr(n);
11644
+ return;
11645
+ }
11629
11646
  Pt.value = Pt.value.map((e) => e.id === t ? {
11630
11647
  ...e,
11631
11648
  state: "done",
@@ -11640,9 +11657,17 @@ function ep(e) {
11640
11657
  } : e);
11641
11658
  }
11642
11659
  }
11643
- async function tr(e, t) {
11644
- let { userQuestion: n, assistantMessage: r } = _n(e);
11645
- gn(await Ee.value.submitMessageFeedback({
11660
+ async function nr(e) {
11661
+ e.mediaSource && await rr(e.mediaSource);
11662
+ }
11663
+ async function rr(e) {
11664
+ try {
11665
+ await Ee.value.discardMedia(e);
11666
+ } catch {}
11667
+ }
11668
+ async function ir(e, t) {
11669
+ let { userQuestion: n, assistantMessage: r } = vn(e);
11670
+ _n(await Ee.value.submitMessageFeedback({
11646
11671
  messageId: e.id,
11647
11672
  chatId: F.value,
11648
11673
  agentId: o.value,
@@ -11651,34 +11676,34 @@ function ep(e) {
11651
11676
  assistantMessage: r
11652
11677
  }));
11653
11678
  }
11654
- async function nr(e) {
11655
- await tr(e, "upvote");
11679
+ async function ar(e) {
11680
+ await ir(e, "upvote");
11656
11681
  }
11657
- async function rr(e) {
11658
- await tr(e, "downvote");
11682
+ async function or(e) {
11683
+ await ir(e, "downvote");
11659
11684
  }
11660
- function ir(e) {
11685
+ function sr(e) {
11661
11686
  Ot.value = !1, kt.value = void 0, Tt.value = e;
11662
11687
  }
11663
- async function ar(e) {
11688
+ async function cr(e) {
11664
11689
  if (Tt.value) try {
11665
11690
  Et.value = !0, Ot.value = !1, kt.value = void 0;
11666
- let { userQuestion: t, assistantMessage: n } = _n(Tt.value);
11667
- gn(await Ee.value.submitMessageFeedback({
11691
+ let { userQuestion: t, assistantMessage: n } = vn(Tt.value);
11692
+ _n(await Ee.value.submitMessageFeedback({
11668
11693
  messageId: Tt.value.id,
11669
11694
  chatId: F.value,
11670
11695
  agentId: o.value,
11671
11696
  userQuestion: t,
11672
11697
  assistantMessage: n,
11673
11698
  comment: e
11674
- })), Ot.value = !0, await hn(F.value);
11699
+ })), Ot.value = !0, await gn(F.value);
11675
11700
  } catch {
11676
11701
  kt.value = n("message.feedbackSubmitError") ? t("message.feedbackSubmitError") : "Failed to submit feedback";
11677
11702
  } finally {
11678
11703
  Et.value = !1;
11679
11704
  }
11680
11705
  }
11681
- async function or(e) {
11706
+ async function lr(e) {
11682
11707
  try {
11683
11708
  jt.value = !0, At.value = !1, Mt.value = void 0, await Ee.value.submitLead({
11684
11709
  agentId: o.value,
@@ -11691,33 +11716,33 @@ function ep(e) {
11691
11716
  jt.value = !1;
11692
11717
  }
11693
11718
  }
11694
- async function sr(e, t) {
11719
+ async function ur(e, t) {
11695
11720
  let n = await Ee.value.updateChatTitle(o.value, e, t);
11696
11721
  ft.value = ft.value.map((t) => t.id === e ? {
11697
11722
  ...t,
11698
11723
  title: n.title
11699
11724
  } : t);
11700
11725
  }
11701
- async function cr(e) {
11702
- await Ee.value.deleteChat(o.value, e), ft.value = ft.value.filter((t) => t.id !== e), F.value === e && await Un();
11726
+ async function dr(e) {
11727
+ await Ee.value.deleteChat(o.value, e), ft.value = ft.value.filter((t) => t.id !== e), F.value === e && await Wn();
11703
11728
  }
11704
- function lr(e) {
11729
+ function fr(e) {
11705
11730
  St.value = e;
11706
11731
  }
11707
- function ur() {
11708
- lr("chat"), Ct.value++;
11732
+ function pr() {
11733
+ fr("chat"), Ct.value++;
11709
11734
  }
11710
- let dr;
11711
- function fr(e) {
11735
+ let mr;
11736
+ function hr(e) {
11712
11737
  let t = () => Ee.value.getChat(o.value, e).then((e) => e !== null);
11713
11738
  return t().catch(() => t().catch(() => !1));
11714
11739
  }
11715
11740
  return j(l, async (e) => {
11716
- if (!e || e === dr) return;
11717
- let t = dr;
11718
- if (dr = e, t === void 0) return;
11719
- let n = F.value, r = !fe.value && await fr(n);
11720
- l.value === e && F.value === n && (r ? qt(o.value) : (ft.value = [], wt.value = [], bt.value = [], Je.value = [], Ye.value = [], Xe.value = [], Ze.value = {}, await Un(), Nt.value = ""));
11741
+ if (!e || e === mr) return;
11742
+ let t = mr;
11743
+ if (mr = e, t === void 0) return;
11744
+ let n = F.value, r = !fe.value && await hr(n);
11745
+ l.value === e && F.value === n && (r ? Jt(o.value) : (ft.value = [], wt.value = [], bt.value = [], Je.value = [], Ye.value = [], Xe.value = [], Ze.value = {}, await Wn(), Nt.value = ""));
11721
11746
  }), {
11722
11747
  apiClient: Ee,
11723
11748
  baseUrl: i,
@@ -11749,7 +11774,7 @@ function ep(e) {
11749
11774
  hostStepTitles: oe,
11750
11775
  hostStepChanges: se,
11751
11776
  pageControlActive: ce,
11752
- isWorking: En,
11777
+ isWorking: On,
11753
11778
  stopHostActions: X,
11754
11779
  voicePageTools: Y,
11755
11780
  cancelVoicePageCalls: ze,
@@ -11762,7 +11787,7 @@ function ep(e) {
11762
11787
  setPageAccessOff: He,
11763
11788
  agentConfirmations: E,
11764
11789
  agentSelectionActions: ne,
11765
- sendSelection: bn,
11790
+ sendSelection: xn,
11766
11791
  confirmationsAvailable: ve,
11767
11792
  confirmationMode: ye,
11768
11793
  setConfirmationMode: be,
@@ -11783,20 +11808,20 @@ function ep(e) {
11783
11808
  isLoadingChatFiles: xt,
11784
11809
  input: Nt,
11785
11810
  pendingAttachments: Pt,
11786
- isAttachmentLimitReached: Zn,
11787
- fileLimitError: Qn,
11811
+ isAttachmentLimitReached: Qn,
11812
+ fileLimitError: $n,
11788
11813
  localChatId: F,
11789
11814
  isConversationBlocked: we,
11790
11815
  inputMessagePlaceholder: dt,
11791
11816
  chatError: Ce,
11792
- runningChatIds: kn,
11793
- backgroundAnswers: Ln,
11794
- openBackgroundAnswer: Rn,
11795
- dismissBackgroundAnswer: zn,
11796
- canQueue: Bt,
11797
- queuedMessages: zt,
11798
- removeQueuedMessage: Wt,
11799
- editQueuedMessage: Gt,
11817
+ runningChatIds: An,
11818
+ backgroundAnswers: Rn,
11819
+ openBackgroundAnswer: zn,
11820
+ dismissBackgroundAnswer: Vn,
11821
+ canQueue: Vt,
11822
+ queuedMessages: Bt,
11823
+ removeQueuedMessage: Gt,
11824
+ editQueuedMessage: qt,
11800
11825
  activeView: St,
11801
11826
  inputFocusRequest: Ct,
11802
11827
  messageFeedbacks: wt,
@@ -11808,35 +11833,36 @@ function ep(e) {
11808
11833
  isLoadingSubmitLead: jt,
11809
11834
  submitLeadError: Mt,
11810
11835
  buildDeviceContext: ke,
11811
- initialize: vn,
11812
- loadConversations: qt,
11813
- loadMoreConversations: Jt,
11814
- searchConversations: Yt,
11815
- loadChatFiles: Xt,
11816
- refreshMessages: pn,
11817
- appendMessage: mn,
11818
- getChatFileUrl: Zt,
11819
- getChatFilePreviewUrl: Qt,
11820
- deleteChatFile: $t,
11821
- handleSubmit: yn,
11822
- sendMessage: Cn,
11823
- stopGeneration: wn,
11824
- startNewChat: Un,
11825
- regenerate: Wn,
11826
- addToolOutput: Gn,
11827
- addToolApprovalResponse: Kn,
11828
- handleFileSelect: er,
11829
- clearFileLimitError: $n,
11830
- clearPendingAttachments: Vn,
11831
- onUpvote: nr,
11832
- onDownvote: rr,
11833
- onFeedback: ir,
11834
- onFeedbackSubmit: ar,
11835
- onLeadSubmit: or,
11836
- navigate: lr,
11837
- focusInput: ur,
11838
- renameChatTitle: sr,
11839
- deleteChat: cr
11836
+ initialize: yn,
11837
+ loadConversations: Jt,
11838
+ loadMoreConversations: Yt,
11839
+ searchConversations: Xt,
11840
+ loadChatFiles: Zt,
11841
+ refreshMessages: mn,
11842
+ appendMessage: hn,
11843
+ getChatFileUrl: Qt,
11844
+ getChatFilePreviewUrl: $t,
11845
+ deleteChatFile: en,
11846
+ handleSubmit: bn,
11847
+ sendMessage: wn,
11848
+ stopGeneration: Tn,
11849
+ startNewChat: Wn,
11850
+ regenerate: Gn,
11851
+ addToolOutput: Kn,
11852
+ addToolApprovalResponse: qn,
11853
+ handleFileSelect: tr,
11854
+ discardPendingAttachment: nr,
11855
+ clearFileLimitError: er,
11856
+ clearPendingAttachments: Un,
11857
+ onUpvote: ar,
11858
+ onDownvote: or,
11859
+ onFeedback: sr,
11860
+ onFeedbackSubmit: cr,
11861
+ onLeadSubmit: lr,
11862
+ navigate: fr,
11863
+ focusInput: pr,
11864
+ renameChatTitle: ur,
11865
+ deleteChat: dr
11840
11866
  };
11841
11867
  })();
11842
11868
  }
@@ -15710,21 +15736,21 @@ var vy = ["datetime"], yy = 6e4, by = /* @__PURE__ */ q({
15710
15736
  V();
15711
15737
  var xy = {
15712
15738
  requestOAuthConnection: T(() => import("./_chunks/PkToolRequestOAuthConnection-CoK7s1HA.js")),
15713
- shareDocument: T(() => import("./_chunks/PkToolShareDocument-kB0qoQda.js")),
15714
- showArtifact: T(() => import("./_chunks/PkToolShowArtifact-ClYqvIqB.js")),
15739
+ shareDocument: T(() => import("./_chunks/PkToolShareDocument-lTHNZodf.js")),
15740
+ showArtifact: T(() => import("./_chunks/PkToolShowArtifact-BNQrM5fY.js")),
15715
15741
  showCalendarEvent: T(() => import("./_chunks/PkToolShowCalendarEvent-Cq_ApwVL.js")),
15716
15742
  showComparison: T(() => import("./_chunks/PkToolShowComparison-CmIDi-5O.js")),
15717
- showContactForm: T(() => import("./_chunks/PkToolShowContactForm-C0ABjvtZ.js")),
15718
- showDiagram: T(() => import("./_chunks/PkToolShowDiagram-BZbHtEs5.js")),
15743
+ showContactForm: T(() => import("./_chunks/PkToolShowContactForm-CvQoLumn.js")),
15744
+ showDiagram: T(() => import("./_chunks/PkToolShowDiagram-COt1Z3q9.js")),
15719
15745
  showEmail: T(() => import("./_chunks/PkToolShowEmail-Cdwe_01-.js")),
15720
- showImageGallery: T(() => import("./_chunks/PkToolShowImageGallery-CNU2Zvso.js")),
15746
+ showImageGallery: T(() => import("./_chunks/PkToolShowImageGallery-DefXra8-.js")),
15721
15747
  showLocation: T(() => import("./_chunks/PkToolShowLocation-7Uqe4JnF.js")),
15722
15748
  showMessage: T(() => import("./_chunks/PkToolShowMessage-BPugVukY.js")),
15723
- showForm: T(() => import("./_chunks/PkToolShowForm-DUjR-9o1.js")),
15724
- showMultipleChoice: T(() => import("./_chunks/PkToolShowForm-DUjR-9o1.js")),
15749
+ showForm: T(() => import("./_chunks/PkToolShowForm-DcPccCEU.js")),
15750
+ showMultipleChoice: T(() => import("./_chunks/PkToolShowForm-DcPccCEU.js")),
15725
15751
  showProductList: T(() => import("./_chunks/PkToolShowProductList-D6Df6dtq.js")),
15726
15752
  showQrCode: T(() => import("./_chunks/PkToolShowQrCode-QcJxu2vI.js")),
15727
- showSources: T(() => import("./_chunks/PkToolShowSources-DhDjNIFa.js")),
15753
+ showSources: T(() => import("./_chunks/PkToolShowSources-BE3Zv_uz.js")),
15728
15754
  showSuggestedReply: T(() => import("./_chunks/PkToolShowSuggestedReply-B-s_ERZF.js")),
15729
15755
  showVideo: T(() => import("./_chunks/PkToolShowVideo-CKpJ1O7O.js")),
15730
15756
  showWeather: T(() => import("./_chunks/PkToolShowWeather-B9HWOU7p.js")),
@@ -17456,6 +17482,7 @@ var zx = { class: "pk-chatbot-input" }, Bx = {
17456
17482
  "submit",
17457
17483
  "stop-generation",
17458
17484
  "file-select",
17485
+ "remove-attachment",
17459
17486
  "dismiss-attachment-notice",
17460
17487
  "dismiss-page-notice",
17461
17488
  "open-answer-notice",
@@ -17496,7 +17523,7 @@ var zx = { class: "pk-chatbot-input" }, Bx = {
17496
17523
  ce(Array.from(t.files ?? [])), t.value = "";
17497
17524
  }, de = (e) => {
17498
17525
  let t = i.value.find((t) => t.id === e);
17499
- t && URL.revokeObjectURL(t.localUrl), i.value = i.value.filter((t) => t.id !== e);
17526
+ t && (URL.revokeObjectURL(t.localUrl), i.value = i.value.filter((t) => t.id !== e), a("remove-attachment", t));
17500
17527
  }, N = z(!0), fe = () => {
17501
17528
  N.value = !1;
17502
17529
  }, P = B(() => {
@@ -18312,7 +18339,7 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
18312
18339
  "selection-action"
18313
18340
  ],
18314
18341
  setup(e, { emit: t }) {
18315
- let n = T(() => import("./_chunks/PkToolShowForm-DUjR-9o1.js")), r = T(() => import("./_chunks/PkToolShowContactForm-C0ABjvtZ.js")), i = T(() => import("./_chunks/PkToolShowSuggestedReply-B-s_ERZF.js")), a = T(() => import("./_chunks/PkToolShowSources-DhDjNIFa.js")), o = T(() => import("./_chunks/PkToolRequestGeolocation-CUXB6Lkw.js")), s = T(() => import("./_chunks/PkToolRequestOAuthConnection-CoK7s1HA.js")), c = T(() => import("./_chunks/PkToolShowLocation-7Uqe4JnF.js")), l = T(() => import("./_chunks/PkToolShowDiagram-BZbHtEs5.js")), u = T(() => import("./_chunks/PkToolChatFile-Buv7Qkes.js")), d = T(() => import("./_chunks/PkToolShareDocument-kB0qoQda.js")), f = T(() => import("./_chunks/PkFilePreview-BIFkMsAC.js").then((e) => e.n)), p = T(() => import("./_chunks/PkFilePreviewDialog-NLk4gZMd.js")), m = e, h = t, g = ep(m.agentId), { agentInterface: _, agentFileUpload: v, agentType: y, agentVoice: b, actions: x, revisedAnswers: S, messages: C, chat: ee, messageFeedbacks: w, feedbackDialogMessage: E, isFeedbackSubmitting: ne, isFeedbackSubmitted: re, feedbackSubmitError: D, isLeadSubmitted: k, isLoadingSubmitLead: ie, submitLeadError: A, input: oe, inputMessagePlaceholder: se, isConversationBlocked: ce, baseUrl: le, pendingAttachments: ue, isAttachmentLimitReached: de, fileLimitError: N, apiClient: fe, isDark: P, hostToolsPending: pe, pageNoticeLevel: F, hostConfirmation: he, agentPageAccess: ge, hostStepTitles: ve, hostStepChanges: ye, confirmationMode: be, canQueue: xe, queuedMessages: L, backgroundAnswers: Se, inputFocusRequest: Ce, pagePointer: we, pagePointerAvailable: V, pagePointing: Te, agentSelectionActions: Ee } = Ar(g);
18342
+ let n = T(() => import("./_chunks/PkToolShowForm-DcPccCEU.js")), r = T(() => import("./_chunks/PkToolShowContactForm-CvQoLumn.js")), i = T(() => import("./_chunks/PkToolShowSuggestedReply-B-s_ERZF.js")), a = T(() => import("./_chunks/PkToolShowSources-BE3Zv_uz.js")), o = T(() => import("./_chunks/PkToolRequestGeolocation-CUXB6Lkw.js")), s = T(() => import("./_chunks/PkToolRequestOAuthConnection-CoK7s1HA.js")), c = T(() => import("./_chunks/PkToolShowLocation-7Uqe4JnF.js")), l = T(() => import("./_chunks/PkToolShowDiagram-COt1Z3q9.js")), u = T(() => import("./_chunks/PkToolChatFile-iE4ZokYD.js")), d = T(() => import("./_chunks/PkToolShareDocument-lTHNZodf.js")), f = T(() => import("./_chunks/PkFilePreview-BzNLupQS.js").then((e) => e.n)), p = T(() => import("./_chunks/PkFilePreviewDialog-BfZFgdOi.js")), m = e, h = t, g = ep(m.agentId), { agentInterface: _, agentFileUpload: v, agentType: y, agentVoice: b, actions: x, revisedAnswers: S, messages: C, chat: ee, messageFeedbacks: w, feedbackDialogMessage: E, isFeedbackSubmitting: ne, isFeedbackSubmitted: re, feedbackSubmitError: D, isLeadSubmitted: k, isLoadingSubmitLead: ie, submitLeadError: A, input: oe, inputMessagePlaceholder: se, isConversationBlocked: ce, baseUrl: le, pendingAttachments: ue, isAttachmentLimitReached: de, fileLimitError: N, apiClient: fe, isDark: P, hostToolsPending: pe, pageNoticeLevel: F, hostConfirmation: he, agentPageAccess: ge, hostStepTitles: ve, hostStepChanges: ye, confirmationMode: be, canQueue: xe, queuedMessages: L, backgroundAnswers: Se, inputFocusRequest: Ce, pagePointer: we, pagePointerAvailable: V, pagePointing: Te, agentSelectionActions: Ee } = Ar(g);
18316
18343
  te(un, ve), te(sn, ye);
18317
18344
  let De = me("inputEl");
18318
18345
  j(Ce, () => {
@@ -18323,184 +18350,187 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
18323
18350
  let Oe = B(() => we.value ? {
18324
18351
  kind: we.value.kind,
18325
18352
  label: we.value.label
18326
- } : void 0), ke = B(() => y.value === "reasoning" ? void 0 : v.value), U = (e) => fe.value.getMediaDownloadUrl(m.agentId, g.localChatId, e), { handleSubmit: je, stopGeneration: Me, regenerate: Ne, onUpvote: Pe, onDownvote: Ie, onFeedback: q, onFeedbackSubmit: Le, onLeadSubmit: Re, startNewChat: ze, addToolOutput: Be, addToolApprovalResponse: He, handleFileSelect: Ue, clearFileLimitError: We, refreshMessages: Ge, appendMessage: Ke, closePageNotice: qe, respondHostConfirmation: Je, editQueuedMessage: Ye, removeQueuedMessage: Ze, openBackgroundAnswer: Qe, dismissBackgroundAnswer: $e } = g, { t: et } = Ve({ useScope: "global" }), tt = B(() => pe.value > 0), nt = B(() => tt.value && ee.value.status === "ready" ? "streaming" : ee.value.status), rt = Vn(() => ge.value?.notice), it = B(() => F.value ? rt.value || et(`message.pageAccessNotice.${F.value}`) : void 0), at = B(() => {
18353
+ } : void 0), ke = B(() => y.value === "reasoning" ? void 0 : v.value), U = (e) => fe.value.getMediaDownloadUrl(m.agentId, g.localChatId, e), { handleSubmit: je, stopGeneration: Me, regenerate: Ne, onUpvote: Pe, onDownvote: Ie, onFeedback: q, onFeedbackSubmit: Le, onLeadSubmit: Re, startNewChat: ze, addToolOutput: Be, addToolApprovalResponse: He, handleFileSelect: Ue, discardPendingAttachment: We, clearFileLimitError: Ge, refreshMessages: Ke, appendMessage: qe, closePageNotice: Je, respondHostConfirmation: Ye, editQueuedMessage: Ze, removeQueuedMessage: Qe, openBackgroundAnswer: $e, dismissBackgroundAnswer: et } = g, { t: tt } = Ve({ useScope: "global" }), nt = B(() => pe.value > 0), rt = B(() => nt.value && ee.value.status === "ready" ? "streaming" : ee.value.status), it = Vn(() => ge.value?.notice), at = B(() => F.value ? it.value || tt(`message.pageAccessNotice.${F.value}`) : void 0), Z = B(() => {
18327
18354
  let e = N.value;
18328
- if (e) return e.reason === "per-chat" ? et("message.fileLimitPerChat", { max: e.max }) : et("message.fileLimitPerMessage", { max: e.max });
18329
- }), Z = B(() => Se.value.map(({ chatId: e, title: t }) => ({
18355
+ if (e) return e.reason === "per-chat" ? tt("message.fileLimitPerChat", { max: e.max }) : tt("message.fileLimitPerMessage", { max: e.max });
18356
+ }), ot = B(() => Se.value.map(({ chatId: e, title: t }) => ({
18330
18357
  id: e,
18331
- text: t ? et("message.backgroundAnswerReady", { title: t }) : et("message.backgroundAnswerReadyUntitled")
18332
- }))), ot = Vn(() => _.value?.dismissableNotice), st = B(() => C.value.some((e) => e.role === "user")), ct = B(() => m.modifier === "fullscreen" && !st.value), lt = fp(_, () => m.userName), ut = me("chatViewEl"), dt = wS(), ft = B(() => !!dt?.value), pt = B(() => dt?.value ?? "body"), mt = z(0), ht = z(0);
18333
- On([ut, B(() => dt?.value ?? void 0)], (e) => {
18358
+ text: t ? tt("message.backgroundAnswerReady", { title: t }) : tt("message.backgroundAnswerReadyUntitled")
18359
+ }))), st = Vn(() => _.value?.dismissableNotice), ct = B(() => C.value.some((e) => e.role === "user")), lt = B(() => m.modifier === "fullscreen" && !ct.value), ut = fp(_, () => m.userName), dt = me("chatViewEl"), ft = wS(), pt = B(() => !!ft?.value), mt = B(() => ft?.value ?? "body"), ht = z(0), gt = z(0);
18360
+ On([dt, B(() => ft?.value ?? void 0)], (e) => {
18334
18361
  for (let t of e) {
18335
18362
  let e = t.borderBoxSize?.[0]?.inlineSize ?? t.contentRect.width;
18336
- t.target === ut.value ? mt.value = e : ht.value = e;
18363
+ t.target === dt.value ? ht.value = e : gt.value = e;
18337
18364
  }
18338
18365
  }, { box: "border-box" });
18339
- let gt = B(() => mt.value + (ft.value ? ht.value : 0) >= IS), _t = B(() => mt.value > 0 && mt.value < 576), { target: vt, preview: yt, loading: bt, error: xt, open: St, close: Ct, reset: wt } = AS((e) => fe.value.getChatFilePreview(m.agentId, g.localChatId, e)), Tt = z({}), Et = (e) => {
18366
+ let _t = B(() => ht.value + (pt.value ? gt.value : 0) >= IS), vt = B(() => ht.value > 0 && ht.value < 576), { target: yt, preview: bt, loading: xt, error: St, open: Ct, close: wt, reset: Tt } = AS((e) => fe.value.getChatFilePreview(m.agentId, g.localChatId, e)), Et = z({}), Dt = (e) => {
18340
18367
  let t = (e) => e?.fileId ?? e?.storedFileName;
18341
- return t(e) !== t(vt.value) && (Tt.value = {}), St(e);
18342
- }, Dt = z(!1), Ot = B(() => !!vt.value && gt.value && !Dt.value), kt = () => {
18343
- Ct(), Dt.value = !1;
18344
- }, At = /* @__PURE__ */ new Set([
18368
+ return t(e) !== t(yt.value) && (Et.value = {}), Ct(e);
18369
+ }, Ot = z(!1), kt = B(() => !!yt.value && _t.value && !Ot.value), At = () => {
18370
+ wt(), Ot.value = !1;
18371
+ }, jt = /* @__PURE__ */ new Set([
18345
18372
  "tool-editSpreadsheet",
18346
18373
  "tool-editWordDocument",
18347
18374
  "tool-createSpreadsheet",
18348
18375
  "tool-createWordDocument"
18349
- ]), jt = B(() => {
18376
+ ]), Mt = B(() => {
18350
18377
  let e = /* @__PURE__ */ new Map();
18351
18378
  for (let t of C.value) for (let n of t.parts) {
18352
18379
  let { type: t, state: r, output: i } = n;
18353
- if (At.has(t) && r === "output-available" && i?.fileId && i.version && i.storedFileName) {
18380
+ if (jt.has(t) && r === "output-available" && i?.fileId && i.version && i.storedFileName) {
18354
18381
  let t = e.get(i.fileId) ?? /* @__PURE__ */ new Map();
18355
18382
  t.set(i.version, i.storedFileName), e.set(i.fileId, t);
18356
18383
  }
18357
18384
  }
18358
18385
  for (let [t, n] of e) n.has(1) || n.set(1, t);
18359
18386
  return e;
18360
- }), Mt = B(() => [...jt.value.get(vt.value?.fileId ?? "")?.keys() ?? []].sort((e, t) => e - t)), Nt = (e) => {
18361
- let t = vt.value, n = jt.value.get(t?.fileId ?? "")?.get(e);
18362
- t && n && Et({
18387
+ }), Nt = B(() => [...Mt.value.get(yt.value?.fileId ?? "")?.keys() ?? []].sort((e, t) => e - t)), Pt = (e) => {
18388
+ let t = yt.value, n = Mt.value.get(t?.fileId ?? "")?.get(e);
18389
+ t && n && Dt({
18363
18390
  ...t,
18364
18391
  version: e,
18365
18392
  storedFileName: n
18366
18393
  });
18367
- }, Pt = B(() => {
18368
- let e = vt.value, t = Mt.value;
18369
- return !!jn.value && !!e?.fileId && !!e.version && t.length > 0 && e.version < t[t.length - 1];
18370
- }), Ft = () => {
18371
- let e = vt.value;
18372
- e?.fileId && e.version && (jn.value?.({
18394
+ }, Ft = B(() => {
18395
+ let e = yt.value, t = Nt.value;
18396
+ return !!Mn.value && !!e?.fileId && !!e.version && t.length > 0 && e.version < t[t.length - 1];
18397
+ }), It = () => {
18398
+ let e = yt.value;
18399
+ e?.fileId && e.version && (Mn.value?.({
18373
18400
  fileId: e.fileId,
18374
18401
  version: e.version,
18375
18402
  filename: e.filename
18376
- }), kt());
18403
+ }), At());
18377
18404
  };
18378
- j(() => g.localChatId, wt), j(jt, (e, t) => {
18379
- let n = vt.value, r = n?.fileId;
18380
- if (!r || !n.version) return;
18381
- let i = (e) => Math.max(0, ...e?.get(r)?.keys() ?? []), a = i(e);
18382
- a > i(t) && n.version === i(t) && Nt(a);
18405
+ j(() => g.localChatId, Tt), j(() => {
18406
+ let e = yt.value?.fileId;
18407
+ return e ? {
18408
+ fileId: e,
18409
+ newest: Math.max(0, ...Nt.value)
18410
+ } : void 0;
18411
+ }, (e, t) => {
18412
+ e && t && e.fileId === t.fileId && e.newest > t.newest && yt.value?.version === t.newest && Pt(e.newest);
18383
18413
  });
18384
- let It = B(() => {
18414
+ let Lt = B(() => {
18385
18415
  let e = ee.value?.status;
18386
- if (!(ce.value || e === "submitted" || e === "streaming")) return vt.value?.kind === "word" ? Ee.value?.word : Ee.value?.excel;
18387
- }), Lt = (e, t, n) => {
18416
+ if (!(ce.value || e === "submitted" || e === "streaming")) return yt.value?.kind === "word" ? Ee.value?.word : Ee.value?.excel;
18417
+ }), Rt = (e, t, n) => {
18388
18418
  g.sendSelection(e, { filePointer: t }) && h("selection-action", {
18389
18419
  surface: t.format === "docx" ? "word" : "excel",
18390
18420
  action: n.id,
18391
18421
  state: "chat",
18392
18422
  size: String(n.size)
18393
18423
  });
18394
- }, Rt = async (e) => (await fe.value.expandSourceContext(m.agentId, e.documentId, e.chunkIndex)).content, zt = async (e) => {
18424
+ }, zt = async (e) => (await fe.value.expandSourceContext(m.agentId, e.documentId, e.chunkIndex)).content, Bt = async (e) => {
18395
18425
  let t = await fe.value.downloadSourceDocument(m.agentId, e);
18396
18426
  window.open(t.downloadUrl, "_blank");
18397
- }, { isOverDropZone: Bt } = Tn(ut, {
18427
+ }, { isOverDropZone: Ht } = Tn(dt, {
18398
18428
  dataTypes: (e) => Xe(e, ke.value?.allowedMimeTypes ?? []),
18399
18429
  onDrop: (e) => {
18400
18430
  if (ke.value?.enabled && e) for (let t of e) Ue(t);
18401
18431
  }
18402
- }), Ht = z(!1), Ut = !1, Wt = z(!1), Gt = [
18432
+ }), Ut = z(!1), Wt = !1, Gt = z(!1), Kt = [
18403
18433
  3e3,
18404
18434
  5e3,
18405
18435
  1e4
18406
- ], Kt, qt, Jt = !1, Yt = 0, Xt = !1;
18407
- function Zt() {
18408
- clearTimeout(Kt), Kt = void 0, qt = void 0, Jt = !1, Yt = 0, Wt.value = !1;
18436
+ ], qt, Jt, Yt = !1, Xt = 0, Zt = !1;
18437
+ function Qt() {
18438
+ clearTimeout(qt), qt = void 0, Jt = void 0, Yt = !1, Xt = 0, Gt.value = !1;
18409
18439
  }
18410
- function Qt(e) {
18411
- Ut || (clearTimeout(Kt), Kt = setTimeout(() => {
18412
- en();
18440
+ function en(e) {
18441
+ Wt || (clearTimeout(qt), qt = setTimeout(() => {
18442
+ tn();
18413
18443
  }, e));
18414
18444
  }
18415
- async function en() {
18416
- if (Ut || Xt) return;
18417
- Xt = !0;
18445
+ async function tn() {
18446
+ if (Wt || Zt) return;
18447
+ Zt = !0;
18418
18448
  let e;
18419
18449
  try {
18420
- e = await Ge();
18450
+ e = await Ke();
18421
18451
  } finally {
18422
- Xt = !1;
18452
+ Zt = !1;
18423
18453
  }
18424
- if (Ut) return;
18425
- if (e === "caught-up" && (Wt.value = !1, Hn()), rn.isActive.value) {
18426
- qt = void 0, Jt = !1, Yt = 0, Qt(LS);
18454
+ if (Wt) return;
18455
+ if (e === "caught-up" && (Gt.value = !1, Un()), an.isActive.value) {
18456
+ Jt = void 0, Yt = !1, Xt = 0, en(LS);
18427
18457
  return;
18428
18458
  }
18429
- qt === void 0 && (qt = Date.now(), Jt = !!rn.error.value);
18430
- let t = Date.now() - qt;
18431
- if (e === "caught-up" && t >= (Jt ? zS : RS) || t >= BS) {
18432
- Zt(), Un();
18459
+ Jt === void 0 && (Jt = Date.now(), Yt = !!an.error.value);
18460
+ let t = Date.now() - Jt;
18461
+ if (e === "caught-up" && t >= (Yt ? zS : RS) || t >= BS) {
18462
+ Qt(), Wn();
18433
18463
  return;
18434
18464
  }
18435
- let n = Gt[Math.min(Yt, Gt.length - 1)];
18436
- Yt += 1, Qt(n);
18465
+ let n = Kt[Math.min(Xt, Kt.length - 1)];
18466
+ Xt += 1, en(n);
18437
18467
  }
18438
- let tn = (e = 1200) => {
18439
- Qt(e);
18440
- }, nn, rn = SS({
18468
+ let nn = (e = 1200) => {
18469
+ en(e);
18470
+ }, rn, an = SS({
18441
18471
  fetchGrant: async () => {
18442
- nn = g.voicePageTools();
18472
+ rn = g.voicePageTools();
18443
18473
  let e = await fe.value.createVoiceSession(m.agentId, g.localChatId, {
18444
18474
  deviceContext: g.buildDeviceContext(),
18445
18475
  externalContext: g.externalContext,
18446
- pageTools: nn?.declaration,
18476
+ pageTools: rn?.declaration,
18447
18477
  ...g.confirmationMode === "automatic" && { confirmations: "automatic" }
18448
18478
  });
18449
18479
  return e.chatId !== g.localChatId && (g.localChatId = e.chatId), e;
18450
18480
  },
18451
18481
  closeGrant: (e) => fe.value.closeVoiceSession(m.agentId, e),
18452
- clientTools: () => nn?.clientTools,
18482
+ clientTools: () => rn?.clientTools,
18453
18483
  onTranscript: (e) => {
18454
- e.role === "user" ? (Wt.value = !0, Bn(), Ke({
18484
+ e.role === "user" ? (Gt.value = !0, Hn(), qe({
18455
18485
  id: `${Ff}user-${Fl()}`,
18456
18486
  role: "user",
18457
18487
  parts: [{
18458
18488
  type: "text",
18459
18489
  text: e.text
18460
18490
  }]
18461
- })) : Wt.value = !1;
18491
+ })) : Gt.value = !1;
18462
18492
  },
18463
18493
  onTurnEnd: () => {
18464
- tn();
18494
+ nn();
18465
18495
  }
18466
18496
  });
18467
- j(() => rn.isActive.value, (e) => {
18497
+ j(() => an.isActive.value, (e) => {
18468
18498
  e || g.cancelVoicePageCalls();
18469
- }), j(() => rn.error.value, (e) => {
18470
- e && (Wt.value = !1);
18499
+ }), j(() => an.error.value, (e) => {
18500
+ e && (Gt.value = !1);
18471
18501
  });
18472
- let an = B(() => b.value?.enabled === !0), cn = B(() => rn.error.value ? "error" : rn.isConnecting.value ? "connecting" : rn.isSpeaking.value ? "speaking" : rn.isActive.value ? "listening" : "idle"), dn = B(() => {
18473
- let e = rn.error.value;
18474
- if (e) return /took too long/i.test(e) ? et("message.voiceTookTooLong") : /cascade|no response|custom_llm_error/i.test(e) ? et("message.voiceNoAnswer") : et("message.voiceInterrupted");
18475
- }), fn = B(() => rn.isSpeaking.value ? "output" : "input"), pn = () => rn.readLevel(fn.value), mn = () => rn.readSpectrum(fn.value), hn = async () => {
18476
- Ht.value = !1, await rn.start(), rn.isActive.value && (Zt(), Qt(LS));
18477
- }, gn = async () => {
18478
- Wt.value = !1, await rn.stop(), !Ut && tn(0);
18479
- }, _n = () => {
18480
- rn.dismissError();
18481
- }, yn = async () => {
18482
- rn.dismissError(), await rn.stop(), await hn();
18483
- }, bn = (e) => e?.toolCallId ?? "", xn = z(/* @__PURE__ */ new Set()), Sn = (e) => xn.value.has(bn(e)), Cn = z(/* @__PURE__ */ new Map()), wn = (e, t) => rn.isActive.value ? (rn.sendUserMessage(t) && (xn.value = new Set(xn.value).add(bn(e)), tn()), !0) : !1, En = (e, t, n) => {
18484
- wn(t, $t(t, n)) || Be({
18502
+ let cn = B(() => b.value?.enabled === !0), dn = B(() => an.error.value ? "error" : an.isConnecting.value ? "connecting" : an.isSpeaking.value ? "speaking" : an.isActive.value ? "listening" : "idle"), fn = B(() => {
18503
+ let e = an.error.value;
18504
+ if (e) return /took too long/i.test(e) ? tt("message.voiceTookTooLong") : /cascade|no response|custom_llm_error/i.test(e) ? tt("message.voiceNoAnswer") : tt("message.voiceInterrupted");
18505
+ }), pn = B(() => an.isSpeaking.value ? "output" : "input"), mn = () => an.readLevel(pn.value), hn = () => an.readSpectrum(pn.value), gn = async () => {
18506
+ Ut.value = !1, await an.start(), an.isActive.value && (Qt(), en(LS));
18507
+ }, _n = async () => {
18508
+ Gt.value = !1, await an.stop(), !Wt && nn(0);
18509
+ }, yn = () => {
18510
+ an.dismissError();
18511
+ }, bn = async () => {
18512
+ an.dismissError(), await an.stop(), await gn();
18513
+ }, xn = (e) => e?.toolCallId ?? "", Sn = z(/* @__PURE__ */ new Set()), Cn = (e) => Sn.value.has(xn(e)), wn = z(/* @__PURE__ */ new Map()), En = (e, t) => an.isActive.value ? (an.sendUserMessage(t) && (Sn.value = new Set(Sn.value).add(xn(e)), nn()), !0) : !1, Dn = (e, t, n) => {
18514
+ En(t, $t(t, n)) || Be({
18485
18515
  tool: e,
18486
- toolCallId: bn(t),
18516
+ toolCallId: xn(t),
18487
18517
  output: n
18488
18518
  });
18489
- }, Dn = (e) => {
18490
- let t = e.confirmed ? et("message.voiceConfirmed") : et("message.voiceCancelled");
18491
- wn({ toolCallId: e.toolCallId }, t) ? xn.value.has(e.toolCallId) && (Cn.value = new Map(Cn.value).set(e.toolCallId, e.confirmed)) : Be({
18519
+ }, kn = (e) => {
18520
+ let t = e.confirmed ? tt("message.voiceConfirmed") : tt("message.voiceCancelled");
18521
+ En({ toolCallId: e.toolCallId }, t) ? Sn.value.has(e.toolCallId) && (wn.value = new Map(wn.value).set(e.toolCallId, e.confirmed)) : Be({
18492
18522
  tool: "requestConfirm",
18493
18523
  toolCallId: e.toolCallId,
18494
18524
  output: e.confirmed ? "confirmed" : "cancelled"
18495
18525
  });
18496
- }, kn = B(() => {
18526
+ }, An = B(() => {
18497
18527
  let e = /* @__PURE__ */ new Map();
18498
18528
  for (let t of C.value) for (let n of t.parts) {
18499
18529
  let { type: t, state: r, output: i } = n;
18500
- At.has(t) && r === "output-available" && i?.fileId && i.version && e.set(i.fileId, Math.max(e.get(i.fileId) ?? 0, i.version));
18530
+ jt.has(t) && r === "output-available" && i?.fileId && i.version && e.set(i.fileId, Math.max(e.get(i.fileId) ?? 0, i.version));
18501
18531
  }
18502
18532
  return e;
18503
- }), An = B(() => {
18533
+ }), jn = B(() => {
18504
18534
  let e = /* @__PURE__ */ new Map(), t = (t, n) => {
18505
18535
  if (t && n) {
18506
18536
  let r = t.toLowerCase();
@@ -18513,62 +18543,62 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
18513
18543
  continue;
18514
18544
  }
18515
18545
  let { type: e, state: r, output: i } = n;
18516
- At.has(e) && r === "output-available" && i?.filename && t(on(i.filename, i.version), i.fileId);
18546
+ jt.has(e) && r === "output-available" && i?.filename && t(on(i.filename, i.version), i.fileId);
18517
18547
  }
18518
18548
  return e;
18519
- }), jn = B(() => ce.value ? void 0 : (e) => {
18520
- let t = (An.value.get(e.filename.toLowerCase())?.size ?? 0) > 1;
18521
- oe.value = et(t ? "messagePart.chatFileRestoreRequestById" : "messagePart.chatFileRestoreRequest", e), je();
18522
- }), Mn = (e, t) => {
18523
- wn(e, t) || (oe.value = t, je());
18524
- }, Nn = (e, t) => {
18525
- let n = t.error ? et("message.voiceLocationRefused") : et("message.voiceLocationShared", { place: t.displayName ?? `${t.latitude}, ${t.longitude}` });
18526
- wn(e, n) || Be({
18549
+ }), Mn = B(() => ce.value ? void 0 : (e) => {
18550
+ let t = (jn.value.get(e.filename.toLowerCase())?.size ?? 0) > 1;
18551
+ oe.value = tt(t ? "messagePart.chatFileRestoreRequestById" : "messagePart.chatFileRestoreRequest", e), je();
18552
+ }), Nn = (e, t) => {
18553
+ En(e, t) || (oe.value = t, je());
18554
+ }, Pn = (e, t) => {
18555
+ let n = t.error ? tt("message.voiceLocationRefused") : tt("message.voiceLocationShared", { place: t.displayName ?? `${t.latitude}, ${t.longitude}` });
18556
+ En(e, n) || Be({
18527
18557
  tool: "requestGeolocation",
18528
- toolCallId: bn(e),
18558
+ toolCallId: xn(e),
18529
18559
  output: t
18530
18560
  });
18531
- }, Pn = (e, t) => {
18532
- wn(e, et("message.voiceConnectionDone")) || Be({
18561
+ }, Fn = (e, t) => {
18562
+ En(e, tt("message.voiceConnectionDone")) || Be({
18533
18563
  tool: "requestOAuthConnection",
18534
- toolCallId: bn(e),
18564
+ toolCallId: xn(e),
18535
18565
  output: {
18536
18566
  connected: !0,
18537
18567
  mcpServerId: t
18538
18568
  }
18539
18569
  });
18540
- }, Fn = () => {
18541
- Ht.value = !Ht.value, rn.setMuted(Ht.value);
18570
+ }, In = () => {
18571
+ Ut.value = !Ut.value, an.setMuted(Ut.value);
18542
18572
  };
18543
18573
  ae(() => {
18544
- Ut = !0, Zt();
18574
+ Wt = !0, Qt();
18545
18575
  });
18546
- let { pendingWakeup: In, isStopping: Rn, stop: zn, spokenTurnStarted: Bn, spokenTurnsWritten: Hn, forgetSpokenTurns: Un } = kS({
18576
+ let { pendingWakeup: Rn, isStopping: zn, stop: Bn, spokenTurnStarted: Hn, spokenTurnsWritten: Un, forgetSpokenTurns: Wn } = kS({
18547
18577
  agentId: () => m.agentId,
18548
18578
  chatId: () => g.localChatId,
18549
18579
  apiClient: () => fe.value,
18550
18580
  messages: () => C.value,
18551
- refreshMessages: Ge,
18581
+ refreshMessages: Ke,
18552
18582
  status: () => ee.value.status
18553
18583
  });
18554
18584
  return (t, v) => {
18555
18585
  let y = Ln;
18556
18586
  return X(), Y("div", {
18557
18587
  ref_key: "chatViewEl",
18558
- ref: ut,
18588
+ ref: dt,
18559
18589
  class: O(["pk-chatbot-view-chat", {
18560
- "pk-chatbot-view-chat--dragover": J(Bt) && ke.value?.enabled,
18561
- "pk-chatbot-view-chat--empty": ct.value,
18562
- "pk-chatbot-view-chat--with-preview": Ot.value && !ft.value
18590
+ "pk-chatbot-view-chat--dragover": J(Ht) && ke.value?.enabled,
18591
+ "pk-chatbot-view-chat--empty": lt.value,
18592
+ "pk-chatbot-view-chat--with-preview": kt.value && !pt.value
18563
18593
  }])
18564
18594
  }, [
18565
18595
  M(W, {
18566
18596
  name: "pk-chatbot-view-chat-fade",
18567
18597
  mode: "out-in"
18568
18598
  }, {
18569
- default: G(() => [ct.value ? (X(), I(sS, {
18599
+ default: G(() => [lt.value ? (X(), I(sS, {
18570
18600
  key: 0,
18571
- greeting: J(lt),
18601
+ greeting: J(ut),
18572
18602
  logo: J(_)?.logo,
18573
18603
  name: J(g).name
18574
18604
  }, null, 8, [
@@ -18580,7 +18610,7 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
18580
18610
  class: "flex flex-col flex-1 min-h-0 p-md overflow-y-auto",
18581
18611
  interactive: "",
18582
18612
  messages: J(C),
18583
- "confirm-verdicts-on-call": Cn.value,
18613
+ "confirm-verdicts-on-call": wn.value,
18584
18614
  status: J(ee).status,
18585
18615
  error: J(ee).error,
18586
18616
  "main-color": J(_)?.mainColor,
@@ -18594,8 +18624,8 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
18594
18624
  "feedback-error": J(D),
18595
18625
  "show-extended-steps": J(_)?.showExtendedSteps,
18596
18626
  "hide-reasoning": J(_)?.showReasoning === !1,
18597
- "awaiting-spoken-answer": Wt.value,
18598
- "host-working": tt.value,
18627
+ "awaiting-spoken-answer": Gt.value,
18628
+ "host-working": nt.value,
18599
18629
  "host-confirmation": J(he),
18600
18630
  "is-dark": J(P),
18601
18631
  "show-scroll-to-bottom": e.modifier === "fullscreen",
@@ -18610,8 +18640,8 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
18610
18640
  onDownvote: J(Ie),
18611
18641
  onFeedback: J(q),
18612
18642
  onApprovalRespond: J(He),
18613
- onConfirmRespond: Dn,
18614
- onHostConfirmRespond: J(Je)
18643
+ onConfirmRespond: kn,
18644
+ onHostConfirmRespond: J(Ye)
18615
18645
  }, {
18616
18646
  "tool-showContactForm": G(({ part: e }) => [M(J(r), {
18617
18647
  part: e,
@@ -18632,18 +18662,18 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
18632
18662
  ])]),
18633
18663
  "tool-showSuggestedReply": G(({ part: e }) => [M(J(i), {
18634
18664
  part: e,
18635
- onSelect: (t) => Mn(e, t)
18665
+ onSelect: (t) => Nn(e, t)
18636
18666
  }, null, 8, ["part", "onSelect"])]),
18637
18667
  "tool-showSources": G(({ part: e }) => [M(J(a), {
18638
18668
  part: e,
18639
- "on-expand-context": Rt,
18640
- "on-download": zt
18669
+ "on-expand-context": zt,
18670
+ "on-download": Bt
18641
18671
  }, null, 8, ["part"])]),
18642
18672
  "tool-showForm": G(({ part: e }) => [M(W, { mode: "out-in" }, {
18643
18673
  default: G(() => [M(J(n), {
18644
18674
  part: e,
18645
- answered: Sn(e),
18646
- onSelect: (t) => En("showForm", e, t)
18675
+ answered: Cn(e),
18676
+ onSelect: (t) => Dn("showForm", e, t)
18647
18677
  }, null, 8, [
18648
18678
  "part",
18649
18679
  "answered",
@@ -18655,8 +18685,8 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
18655
18685
  default: G(() => [M(J(n), {
18656
18686
  part: e,
18657
18687
  "allow-custom-answer": "",
18658
- answered: Sn(e),
18659
- onSelect: (t) => En("showMultipleChoice", e, t)
18688
+ answered: Cn(e),
18689
+ onSelect: (t) => Dn("showMultipleChoice", e, t)
18660
18690
  }, null, 8, [
18661
18691
  "part",
18662
18692
  "answered",
@@ -18669,7 +18699,7 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
18669
18699
  "backend-url": J(le),
18670
18700
  "resolve-connection": (e) => J(fe).getOAuthAuthorizeUrl(m.agentId, e),
18671
18701
  "check-connection": (e) => J(fe).getOAuthConnectionStatus(m.agentId, e),
18672
- onConnected: (t) => Pn(e, t)
18702
+ onConnected: (t) => Fn(e, t)
18673
18703
  }, null, 8, [
18674
18704
  "part",
18675
18705
  "backend-url",
@@ -18679,9 +18709,9 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
18679
18709
  ])]),
18680
18710
  "tool-requestGeolocation": G(({ part: e }) => [M(J(o), {
18681
18711
  part: e,
18682
- "call-live": J(rn).isActive.value,
18712
+ "call-live": J(an).isActive.value,
18683
18713
  "reverse-geocode": (e, t) => J(fe).reverseGeocode(e, t),
18684
- onResult: (t) => Nn(e, t)
18714
+ onResult: (t) => Pn(e, t)
18685
18715
  }, null, 8, [
18686
18716
  "part",
18687
18717
  "call-live",
@@ -18707,9 +18737,9 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
18707
18737
  key: J(vn)(e),
18708
18738
  part: e,
18709
18739
  "file-url": U,
18710
- preview: Et,
18711
- "latest-versions": kn.value,
18712
- restore: jn.value
18740
+ preview: Dt,
18741
+ "latest-versions": An.value,
18742
+ restore: Mn.value
18713
18743
  }, null, 8, [
18714
18744
  "part",
18715
18745
  "latest-versions",
@@ -18719,9 +18749,9 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
18719
18749
  key: J(vn)(e),
18720
18750
  part: e,
18721
18751
  "file-url": U,
18722
- preview: Et,
18723
- "latest-versions": kn.value,
18724
- restore: jn.value
18752
+ preview: Dt,
18753
+ "latest-versions": An.value,
18754
+ restore: Mn.value
18725
18755
  }, null, 8, [
18726
18756
  "part",
18727
18757
  "latest-versions",
@@ -18731,9 +18761,9 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
18731
18761
  key: J(vn)(e),
18732
18762
  part: e,
18733
18763
  "file-url": U,
18734
- preview: Et,
18735
- "latest-versions": kn.value,
18736
- restore: jn.value
18764
+ preview: Dt,
18765
+ "latest-versions": An.value,
18766
+ restore: Mn.value
18737
18767
  }, null, 8, [
18738
18768
  "part",
18739
18769
  "latest-versions",
@@ -18743,9 +18773,9 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
18743
18773
  key: J(vn)(e),
18744
18774
  part: e,
18745
18775
  "file-url": U,
18746
- preview: Et,
18747
- "latest-versions": kn.value,
18748
- restore: jn.value
18776
+ preview: Dt,
18777
+ "latest-versions": An.value,
18778
+ restore: Mn.value
18749
18779
  }, null, 8, [
18750
18780
  "part",
18751
18781
  "latest-versions",
@@ -18754,7 +18784,7 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
18754
18784
  "tool-shareDocument": G(({ part: e }) => [(X(), I(J(d), {
18755
18785
  key: J(vn)(e),
18756
18786
  part: e,
18757
- "on-download": zt
18787
+ "on-download": Bt
18758
18788
  }, null, 8, ["part"]))]),
18759
18789
  _: 1
18760
18790
  }, 8, /* @__PURE__ */ "messages.confirm-verdicts-on-call.status.error.main-color.text-color.revised-answers.actions.message-feedbacks.feedback-message-id.feedback-loading.feedback-submitted.feedback-error.show-extended-steps.hide-reasoning.awaiting-spoken-answer.host-working.host-confirmation.is-dark.show-scroll-to-bottom.onRegenerate.onAutoRetry.onResetChat.onUpvote.onDownvote.onFeedback.onApprovalRespond.onHostConfirmRespond".split(".")))]),
@@ -18763,8 +18793,8 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
18763
18793
  J(L).length ? (X(), I(aS, {
18764
18794
  key: 0,
18765
18795
  messages: J(L),
18766
- onEdit: J(Ye),
18767
- onRemove: J(Ze)
18796
+ onEdit: J(Ze),
18797
+ onRemove: J(Qe)
18768
18798
  }, null, 8, [
18769
18799
  "messages",
18770
18800
  "onEdit",
@@ -18772,7 +18802,7 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
18772
18802
  ])) : K("", !0),
18773
18803
  R("div", jS, [
18774
18804
  M(W, { name: "pk-chatbot-view-chat-fade" }, {
18775
- default: G(() => [ct.value ? (X(), I(Hv, {
18805
+ default: G(() => [lt.value ? (X(), I(Hv, {
18776
18806
  key: 0,
18777
18807
  class: "pk-chatbot-view-chat__aurora",
18778
18808
  "source-selector": ".pk-chatbot-input__form",
@@ -18786,17 +18816,17 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
18786
18816
  ])) : K("", !0)]),
18787
18817
  _: 1
18788
18818
  }),
18789
- J(In) && !J(ce) ? (X(), I(xS, {
18819
+ J(Rn) && !J(ce) ? (X(), I(xS, {
18790
18820
  key: 0,
18791
- pending: J(In),
18792
- stopping: J(Rn),
18793
- onStop: J(zn)
18821
+ pending: J(Rn),
18822
+ stopping: J(zn),
18823
+ onStop: J(Bn)
18794
18824
  }, null, 8, [
18795
18825
  "pending",
18796
18826
  "stopping",
18797
18827
  "onStop"
18798
18828
  ])) : K("", !0),
18799
- J(ce) ? (X(), Y("div", MS, H(J(et)("message.chatErrorConversationBlocked")), 1)) : cn.value === "idle" ? (X(), I(eS, {
18829
+ J(ce) ? (X(), Y("div", MS, H(J(tt)("message.chatErrorConversationBlocked")), 1)) : dn.value === "idle" ? (X(), I(eS, {
18800
18830
  key: 3,
18801
18831
  ref_key: "inputEl",
18802
18832
  ref: De,
@@ -18805,16 +18835,16 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
18805
18835
  "pending-attachments": J(ue),
18806
18836
  "onUpdate:pendingAttachments": v[5] ||= (e) => Fe(ue) ? ue.value = e : null,
18807
18837
  placeholder: J(se),
18808
- "dismissable-notice": J(ot) && J(ee).messages.length <= 1 ? J(ot) : void 0,
18809
- "page-notice": it.value,
18810
- status: nt.value,
18838
+ "dismissable-notice": J(st) && J(ee).messages.length <= 1 ? J(st) : void 0,
18839
+ "page-notice": at.value,
18840
+ status: rt.value,
18811
18841
  "max-message-length": J(_)?.maxMessageLength,
18812
18842
  "file-upload": ke.value,
18813
18843
  "attachment-limit-reached": J(de),
18814
- "attachment-notice": at.value,
18815
- "voice-enabled": an.value,
18844
+ "attachment-notice": Z.value,
18845
+ "voice-enabled": cn.value,
18816
18846
  "queue-enabled": J(xe),
18817
- "answer-notices": Z.value,
18847
+ "answer-notices": ot.value,
18818
18848
  "pointer-available": J(V),
18819
18849
  pointing: J(Te),
18820
18850
  pointer: Oe.value,
@@ -18825,11 +18855,12 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
18825
18855
  onStopGeneration: J(Me),
18826
18856
  onSubmit: J(je),
18827
18857
  onFileSelect: J(Ue),
18828
- onDismissAttachmentNotice: J(We),
18829
- onDismissPageNotice: J(qe),
18830
- onOpenAnswerNotice: J(Qe),
18831
- onDismissAnswerNotice: J($e),
18832
- onVoiceStart: hn
18858
+ onRemoveAttachment: J(We),
18859
+ onDismissAttachmentNotice: J(Ge),
18860
+ onDismissPageNotice: J(Je),
18861
+ onOpenAnswerNotice: J($e),
18862
+ onDismissAnswerNotice: J(et),
18863
+ onVoiceStart: gn
18833
18864
  }, _e({ _: 2 }, [e.modifier === "fullscreen" ? {
18834
18865
  name: "prepend",
18835
18866
  fn: G(() => [R("span", NS, [M(Rv, {
@@ -18859,25 +18890,26 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
18859
18890
  "onStopGeneration",
18860
18891
  "onSubmit",
18861
18892
  "onFileSelect",
18893
+ "onRemoveAttachment",
18862
18894
  "onDismissAttachmentNotice",
18863
18895
  "onDismissPageNotice",
18864
18896
  "onOpenAnswerNotice",
18865
18897
  "onDismissAnswerNotice"
18866
18898
  ])) : (X(), I(_S, {
18867
18899
  key: 2,
18868
- state: cn.value,
18869
- sample: pn,
18870
- spectrum: mn,
18871
- "remaining-seconds": J(rn).remainingSeconds.value,
18872
- muted: Ht.value,
18873
- error: dn.value,
18874
- "raw-error": J(rn).error.value,
18875
- live: J(rn).isActive.value,
18900
+ state: dn.value,
18901
+ sample: mn,
18902
+ spectrum: hn,
18903
+ "remaining-seconds": J(an).remainingSeconds.value,
18904
+ muted: Ut.value,
18905
+ error: fn.value,
18906
+ "raw-error": J(an).error.value,
18907
+ live: J(an).isActive.value,
18876
18908
  class: "pk-chatbot-view-chat__voice",
18877
- onToggleMute: Fn,
18878
- onHangUp: gn,
18879
- onRetry: yn,
18880
- onDismiss: _n
18909
+ onToggleMute: In,
18910
+ onHangUp: _n,
18911
+ onRetry: bn,
18912
+ onDismiss: yn
18881
18913
  }, null, 8, [
18882
18914
  "state",
18883
18915
  "remaining-seconds",
@@ -18888,44 +18920,44 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
18888
18920
  ]))
18889
18921
  ]),
18890
18922
  M(W, null, {
18891
- default: G(() => [J(Bt) && ke.value?.enabled ? (X(), Y("div", FS, [M(y, {
18923
+ default: G(() => [J(Ht) && ke.value?.enabled ? (X(), Y("div", FS, [M(y, {
18892
18924
  name: "ri:upload-cloud-2-line",
18893
18925
  class: "pk-chatbot-view-chat__drop-overlay-icon"
18894
- }), R("span", null, H(J(et)("action.dropFile")), 1)])) : K("", !0)]),
18926
+ }), R("span", null, H(J(tt)("action.dropFile")), 1)])) : K("", !0)]),
18895
18927
  _: 1
18896
18928
  }),
18897
- Ot.value ? (X(), I(Ae, {
18929
+ kt.value ? (X(), I(Ae, {
18898
18930
  key: 1,
18899
- to: pt.value,
18900
- disabled: !ft.value
18901
- }, [R("aside", { class: O(["pk-chatbot-view-chat__preview", { "pk-chatbot-view-chat__preview--docked": ft.value }]) }, [J(vt) ? (X(), I(J(f), {
18931
+ to: mt.value,
18932
+ disabled: !pt.value
18933
+ }, [R("aside", { class: O(["pk-chatbot-view-chat__preview", { "pk-chatbot-view-chat__preview--docked": pt.value }]) }, [J(yt) ? (X(), I(J(f), {
18902
18934
  key: 0,
18903
- mode: Tt.value.mode,
18904
- "onUpdate:mode": v[9] ||= (e) => Tt.value.mode = e,
18905
- sheet: Tt.value.sheet,
18906
- "onUpdate:sheet": v[10] ||= (e) => Tt.value.sheet = e,
18907
- zoom: Tt.value.zoom,
18908
- "onUpdate:zoom": v[11] ||= (e) => Tt.value.zoom = e,
18909
- fit: Tt.value.fit,
18910
- "onUpdate:fit": v[12] ||= (e) => Tt.value.fit = e,
18911
- kind: J(vt).kind,
18912
- filename: J(vt).filename,
18913
- version: J(vt).version,
18914
- versions: Mt.value,
18915
- "download-url": U(J(vt).storedFileName),
18916
- preview: J(yt),
18917
- loading: J(bt),
18918
- error: J(xt),
18919
- restorable: Pt.value,
18935
+ mode: Et.value.mode,
18936
+ "onUpdate:mode": v[9] ||= (e) => Et.value.mode = e,
18937
+ sheet: Et.value.sheet,
18938
+ "onUpdate:sheet": v[10] ||= (e) => Et.value.sheet = e,
18939
+ zoom: Et.value.zoom,
18940
+ "onUpdate:zoom": v[11] ||= (e) => Et.value.zoom = e,
18941
+ fit: Et.value.fit,
18942
+ "onUpdate:fit": v[12] ||= (e) => Et.value.fit = e,
18943
+ kind: J(yt).kind,
18944
+ filename: J(yt).filename,
18945
+ version: J(yt).version,
18946
+ versions: Nt.value,
18947
+ "download-url": U(J(yt).storedFileName),
18948
+ preview: J(bt),
18949
+ loading: J(xt),
18950
+ error: J(St),
18951
+ restorable: Ft.value,
18920
18952
  resize: "expand",
18921
- "file-id": J(vt).fileId,
18922
- "stored-file-name": J(vt).storedFileName,
18923
- "selection-actions": It.value,
18924
- onVersion: Nt,
18925
- onRestore: Ft,
18926
- onResize: v[13] ||= (e) => Dt.value = !0,
18927
- onSelectionSend: Lt,
18928
- onClose: kt
18953
+ "file-id": J(yt).fileId,
18954
+ "stored-file-name": J(yt).storedFileName,
18955
+ "selection-actions": Lt.value,
18956
+ onVersion: Pt,
18957
+ onRestore: It,
18958
+ onResize: v[13] ||= (e) => Ot.value = !0,
18959
+ onSelectionSend: Rt,
18960
+ onClose: At
18929
18961
  }, null, 8, [
18930
18962
  "mode",
18931
18963
  "sheet",
@@ -18944,31 +18976,31 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
18944
18976
  "stored-file-name",
18945
18977
  "selection-actions"
18946
18978
  ])) : K("", !0)], 2)], 8, ["to", "disabled"])) : K("", !0),
18947
- J(vt) && !Ot.value ? (X(), I(J(p), {
18979
+ J(yt) && !kt.value ? (X(), I(J(p), {
18948
18980
  key: 2,
18949
- mode: Tt.value.mode,
18950
- "onUpdate:mode": v[14] ||= (e) => Tt.value.mode = e,
18951
- sheet: Tt.value.sheet,
18952
- "onUpdate:sheet": v[15] ||= (e) => Tt.value.sheet = e,
18953
- zoom: Tt.value.zoom,
18954
- "onUpdate:zoom": v[16] ||= (e) => Tt.value.zoom = e,
18955
- fit: Tt.value.fit,
18956
- "onUpdate:fit": v[17] ||= (e) => Tt.value.fit = e,
18957
- target: J(vt),
18958
- versions: Mt.value,
18959
- "download-url": U(J(vt).storedFileName),
18960
- preview: J(yt),
18961
- loading: J(bt),
18962
- error: J(xt),
18963
- restorable: Pt.value,
18964
- resize: gt.value ? "shrink" : void 0,
18965
- fullscreen: _t.value,
18966
- "selection-actions": It.value,
18967
- onVersion: Nt,
18968
- onRestore: Ft,
18969
- onResize: v[18] ||= (e) => Dt.value = !1,
18970
- onSelectionSend: Lt,
18971
- onClose: kt
18981
+ mode: Et.value.mode,
18982
+ "onUpdate:mode": v[14] ||= (e) => Et.value.mode = e,
18983
+ sheet: Et.value.sheet,
18984
+ "onUpdate:sheet": v[15] ||= (e) => Et.value.sheet = e,
18985
+ zoom: Et.value.zoom,
18986
+ "onUpdate:zoom": v[16] ||= (e) => Et.value.zoom = e,
18987
+ fit: Et.value.fit,
18988
+ "onUpdate:fit": v[17] ||= (e) => Et.value.fit = e,
18989
+ target: J(yt),
18990
+ versions: Nt.value,
18991
+ "download-url": U(J(yt).storedFileName),
18992
+ preview: J(bt),
18993
+ loading: J(xt),
18994
+ error: J(St),
18995
+ restorable: Ft.value,
18996
+ resize: _t.value ? "shrink" : void 0,
18997
+ fullscreen: vt.value,
18998
+ "selection-actions": Lt.value,
18999
+ onVersion: Pt,
19000
+ onRestore: It,
19001
+ onResize: v[18] ||= (e) => Ot.value = !1,
19002
+ onSelectionSend: Rt,
19003
+ onClose: At
18972
19004
  }, null, 8, [
18973
19005
  "mode",
18974
19006
  "sheet",