@8wave/ai-elements 0.121.0-beta.50 → 0.121.0-beta.52

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 (29) hide show
  1. package/README.md +30 -0
  2. package/dist/ai-elements.es.js +2062 -1850
  3. package/dist/ai-elements.es.js.map +1 -1
  4. package/dist-vue/PkChatbot.js +1 -1
  5. package/dist-vue/PkChatbotViewChat.js +1 -1
  6. package/dist-vue/PkChatbotViewConversations.js +1 -1
  7. package/dist-vue/PkChatbotViewFiles.js +1 -1
  8. package/dist-vue/PkChatbotViewProfile.js +1 -1
  9. package/dist-vue/_chunks/{PkChatbot-rM9EYhUu.js → PkChatbot-DgKkkbCs.js} +6 -6
  10. package/dist-vue/_chunks/{PkChatbot-rM9EYhUu.js.map → PkChatbot-DgKkkbCs.js.map} +1 -1
  11. package/dist-vue/_chunks/{PkChatbotViewChat-GiEjvFUZ.js → PkChatbotViewChat-58rvFSbr.js} +140 -127
  12. package/dist-vue/_chunks/PkChatbotViewChat-58rvFSbr.js.map +1 -0
  13. package/dist-vue/_chunks/{PkChatbotViewConversations-lf6kADE0.js → PkChatbotViewConversations-DP1zMA-B.js} +2 -2
  14. package/dist-vue/_chunks/{PkChatbotViewConversations-lf6kADE0.js.map → PkChatbotViewConversations-DP1zMA-B.js.map} +1 -1
  15. package/dist-vue/_chunks/{PkChatbotViewFiles-wJKiqU5k.js → PkChatbotViewFiles-DCo-erhU.js} +2 -2
  16. package/dist-vue/_chunks/{PkChatbotViewFiles-wJKiqU5k.js.map → PkChatbotViewFiles-DCo-erhU.js.map} +1 -1
  17. package/dist-vue/_chunks/{PkChatbotViewProfile-2nUnefc2.js → PkChatbotViewProfile-Da6iqXLn.js} +2 -2
  18. package/dist-vue/_chunks/{PkChatbotViewProfile-2nUnefc2.js.map → PkChatbotViewProfile-Da6iqXLn.js.map} +1 -1
  19. package/dist-vue/_chunks/{useChatbotStore-Drb-YRsc.js → useChatbotStore-DhVxJwn6.js} +4 -4
  20. package/dist-vue/_chunks/useChatbotStore-DhVxJwn6.js.map +1 -0
  21. package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +7 -0
  22. package/dist-vue/apps/web-component/src/composables/usePageModal.d.ts +18 -0
  23. package/dist-vue/apps/web-component/src/lib.d.ts +3 -0
  24. package/dist-vue/composables.js +1 -1
  25. package/dist-vue/index.js +5 -5
  26. package/dist-vue/packages/components/src/chat/useWakeupWatch.d.ts +4 -1
  27. package/package.json +1 -1
  28. package/dist-vue/_chunks/PkChatbotViewChat-GiEjvFUZ.js.map +0 -1
  29. package/dist-vue/_chunks/useChatbotStore-Drb-YRsc.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./PkChatbotMessages-Ce7BtcBf.js";
2
2
  import { o as t } from "./Media-DylqhvaF.js";
3
- import { a as n, n as r, t as i } from "./useChatbotStore-Drb-YRsc.js";
3
+ import { a as n, n as r, t as i } from "./useChatbotStore-DhVxJwn6.js";
4
4
  import { n as a } from "./src-B-ZKEhTU.js";
5
5
  import { c as o, h as s, n as c } from "./utils-BpnTWYko.js";
6
6
  import { t as l } from "./useLocalizedString-Dmn92nix.js";
@@ -159,14 +159,14 @@ var ge = {
159
159
  key: 0,
160
160
  class: "pk-voice-session__badge",
161
161
  "aria-hidden": "true"
162
- }, Se = {
162
+ }, z = {
163
163
  class: "pk-voice-session__status",
164
164
  role: "status"
165
- }, z = {
165
+ }, B = {
166
166
  key: 0,
167
167
  class: "pk-voice-session__live-dot",
168
168
  "aria-hidden": "true"
169
- }, Ce = ["title"], we = ["title"], Te = { class: "pk-voice-session__actions" }, Ee = /* @__PURE__ */ E({
169
+ }, Se = ["title"], Ce = ["title"], we = { class: "pk-voice-session__actions" }, Te = /* @__PURE__ */ E({
170
170
  __name: "PkVoiceSession",
171
171
  props: {
172
172
  state: {},
@@ -205,18 +205,18 @@ var ge = {
205
205
  "sample",
206
206
  "spectrum"
207
207
  ])),
208
- C("div", Se, [C("span", { class: D(["pk-voice-session__state", l.value && `pk-voice-session__state--${l.value}`]) }, [c.value ? (k(), S("span", z)) : x("", !0), te(" " + j(a.value), 1)], 2), e.error ? (k(), S("p", {
208
+ C("div", z, [C("span", { class: D(["pk-voice-session__state", l.value && `pk-voice-session__state--${l.value}`]) }, [c.value ? (k(), S("span", B)) : x("", !0), te(" " + j(a.value), 1)], 2), e.error ? (k(), S("p", {
209
209
  key: 0,
210
210
  class: "pk-voice-session__detail",
211
211
  title: e.rawError ?? e.error
212
- }, j(e.error), 9, Ce)) : x("", !0)]),
212
+ }, j(e.error), 9, Se)) : x("", !0)]),
213
213
  o.value ? (k(), S("span", {
214
214
  key: 2,
215
215
  class: D(["pk-voice-session__timer", { "pk-voice-session__timer--warning": s.value }]),
216
216
  title: M(i)("hint.voiceRemaining"),
217
217
  "aria-hidden": "true"
218
- }, j(o.value), 11, we)) : x("", !0),
219
- C("div", Te, [e.error ? (k(), S(_, { key: 0 }, [w(d, {
218
+ }, j(o.value), 11, Ce)) : x("", !0),
219
+ C("div", we, [e.error ? (k(), S(_, { key: 0 }, [w(d, {
220
220
  icon: "ri:refresh-line",
221
221
  label: M(i)("action.retry"),
222
222
  onClick: n[0] ||= (e) => r("retry")
@@ -253,7 +253,7 @@ var ge = {
253
253
  ], 2);
254
254
  };
255
255
  }
256
- }), De = (e) => {
256
+ }), Ee = (e) => {
257
257
  let t = le(), n = A("disconnected"), r = A("listening"), i = A(), o = A([]), s = A(), c = A(), l, u, d = 0, f = !1, p = () => {
258
258
  u &&= (clearInterval(u), void 0), s.value = void 0;
259
259
  }, m = (e) => {
@@ -377,12 +377,12 @@ var ge = {
377
377
  readLevel: S,
378
378
  readSpectrum: C
379
379
  };
380
- }, Oe = 4e3, ke = [
380
+ }, De = 4e3, Oe = [
381
381
  3e3,
382
382
  5e3,
383
383
  1e4
384
- ], Ae = 12e4, je = 3e4;
385
- function Me(e) {
384
+ ], ke = 12e4, Ae = 3e4;
385
+ function je(e) {
386
386
  let t = A(null), n = A(!1), r, i = !1, a = () => {
387
387
  clearTimeout(r), r = void 0;
388
388
  }, o = (e, t) => {
@@ -400,12 +400,12 @@ function Me(e) {
400
400
  }
401
401
  let r = t.value;
402
402
  if (r) {
403
- let e = Date.parse(r.dueAt) - Date.now() + Oe;
404
- o(Math.max(Oe, e), () => l(r.wakeId, Date.now(), 0));
403
+ let e = Date.parse(r.dueAt) - Date.now() + De;
404
+ o(Math.max(De, e), () => l(r.wakeId, Date.now(), 0));
405
405
  }
406
406
  }
407
407
  async function l(t, n, r) {
408
- await e.refreshMessages(), !i && (s(t) || Date.now() - n >= Ae ? await c() : o(ke[Math.min(r, ke.length - 1)], () => l(t, n, r + 1)));
408
+ await e.refreshMessages(), !i && (s(t) || Date.now() - n >= ke ? await c() : o(Oe[Math.min(r, Oe.length - 1)], () => l(t, n, r + 1)));
409
409
  }
410
410
  async function u() {
411
411
  n.value = !0;
@@ -419,42 +419,55 @@ function Me(e) {
419
419
  function d() {
420
420
  a(), t.value = null;
421
421
  }
422
- let f = y(() => e.messages().some((e) => e.role === "user"));
423
- N([e.chatId, f], ([, t]) => {
422
+ let f;
423
+ function p() {
424
+ f = e.chatId();
425
+ }
426
+ function m() {
427
+ f === e.chatId() && (f = void 0, c());
428
+ }
429
+ function h() {
430
+ f = void 0;
431
+ }
432
+ let g = y(() => e.messages().some((e) => e.role === "user"));
433
+ N([e.chatId, g], ([, t]) => {
424
434
  d();
425
- let n = e.status();
426
- t && n !== "submitted" && n !== "streaming" && c();
435
+ let n = e.status(), r = n === "submitted" || n === "streaming" || f === e.chatId();
436
+ t && !r && c();
427
437
  }, { immediate: !0 }), N(e.status, (e, t) => {
428
- e === "ready" && t !== "ready" && f.value && c();
438
+ e === "ready" && t !== "ready" && g.value && c();
429
439
  });
430
- let p;
431
- function m() {
440
+ let _;
441
+ function v() {
432
442
  t.value && document.visibilityState === "visible" && e.apiClient().markChatWakeupPresence(e.agentId(), e.chatId()).catch(() => void 0);
433
443
  }
434
- let h = () => m();
435
- return document.addEventListener("visibilitychange", h), N(() => t.value?.wakeId, (e) => {
436
- clearInterval(p), p = void 0, e && !i && (m(), p = setInterval(m, je));
444
+ let b = () => v();
445
+ return document.addEventListener("visibilitychange", b), N(() => t.value?.wakeId, (e) => {
446
+ clearInterval(_), _ = void 0, e && !i && (v(), _ = setInterval(v, Ae));
437
447
  }), O(() => {
438
- i = !0, a(), clearInterval(p), document.removeEventListener("visibilitychange", h);
448
+ i = !0, a(), clearInterval(_), document.removeEventListener("visibilitychange", b);
439
449
  }), {
440
450
  pendingWakeup: t,
441
451
  isStopping: n,
442
452
  check: c,
443
453
  reset: d,
444
- stop: u
454
+ stop: u,
455
+ spokenTurnStarted: p,
456
+ spokenTurnsWritten: m,
457
+ forgetSpokenTurns: h
445
458
  };
446
459
  }
447
460
  // ../../packages/components/src/chat/PkChatbotViewChat.vue?vue&type=script&setup=true&lang.ts
448
- var Ne = { class: "pk-chatbot-view-chat__input-stage" }, Pe = {
461
+ var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
449
462
  key: 1,
450
463
  class: "p-md border-t border-surface-3 text-center text-12 text-danger bg-surface-danger"
451
- }, Fe = { class: "pk-chatbot-view-chat__agent-chip" }, Ie = {
464
+ }, Pe = { class: "pk-chatbot-view-chat__agent-chip" }, Fe = {
452
465
  key: 0,
453
466
  class: "pk-chatbot-view-chat__agent-chip-name"
454
- }, Le = {
467
+ }, Ie = {
455
468
  key: 0,
456
469
  class: "pk-chatbot-view-chat__drop-overlay"
457
- }, Re = 3e3, ze = 6e4, Be = 3e5, Ve = 6e5, He = /* @__PURE__ */ E({
470
+ }, Le = 3e3, Re = 6e4, ze = 3e5, Be = 6e5, Ve = /* @__PURE__ */ E({
458
471
  __name: "PkChatbotViewChat",
459
472
  props: {
460
473
  agentId: {},
@@ -463,71 +476,71 @@ var Ne = { class: "pk-chatbot-view-chat__input-stage" }, Pe = {
463
476
  },
464
477
  emits: ["show-info", "revise"],
465
478
  setup(a, { emit: d }) {
466
- let _ = T(() => import("./PkToolShowForm-gUfRbKJS.js").then((e) => e.n)), te = T(() => import("./PkToolShowContactForm-CdDx1Jxl.js").then((e) => e.n)), E = T(() => import("./PkToolShowSuggestedReply-DVYeAkEp.js").then((e) => e.n)), re = T(() => import("./PkToolShowSources-B_4taLGg.js").then((e) => e.n)), ie = T(() => import("./PkToolRequestGeolocation-CK_AAzwh.js")), ae = T(() => import("./PkToolRequestOAuthConnection-CXfvULza.js")), oe = T(() => import("./PkToolShowLocation-Cq0IXye1.js").then((e) => e.n)), ce = T(() => import("./PkToolShowDiagram-D22AS39F.js")), le = T(() => import("./PkToolEditedFile-ppesvE8O.js")), ue = T(() => import("./PkToolShareDocument-CRghPfep.js").then((e) => e.n)), F = a, ge = d, I = r(F.agentId), { agentInterface: L, agentFileUpload: _e, agentType: R, agentVoice: ye, actions: be, revisedAnswers: xe, messages: Se, chat: z, messageFeedbacks: Ce, feedbackDialogMessage: we, isFeedbackSubmitting: Te, isFeedbackSubmitted: Oe, feedbackSubmitError: ke, isLeadSubmitted: Ae, isLoadingSubmitLead: je, submitLeadError: He, input: Ue, inputMessagePlaceholder: We, isConversationBlocked: Ge, baseUrl: Ke, pendingAttachments: qe, isAttachmentLimitReached: Je, fileLimitError: Ye, apiClient: B, isDark: Xe, hostToolsPending: Ze, pageNoticeLevel: Qe, hostConfirmation: $e, agentPageAccess: et, hostStepTitles: tt, canQueue: nt, queuedMessages: rt, backgroundAnswers: it } = me(I);
467
- se(c, tt);
468
- let V = y(() => R.value === "reasoning" ? void 0 : _e.value), at = (e) => B.value.getMediaDownloadUrl(F.agentId, I.localChatId, e), { handleSubmit: ot, stopGeneration: st, regenerate: ct, onUpvote: lt, onDownvote: ut, onFeedback: dt, onFeedbackSubmit: ft, onLeadSubmit: pt, startNewChat: mt, addToolOutput: H, addToolApprovalResponse: ht, handleFileSelect: gt, clearFileLimitError: _t, refreshMessages: vt, appendMessage: yt, closePageNotice: bt, respondHostConfirmation: xt, editQueuedMessage: St, removeQueuedMessage: Ct, openBackgroundAnswer: wt, dismissBackgroundAnswer: Tt } = I, { t: U } = fe({ useScope: "global" }), Et = y(() => Ze.value > 0), Dt = y(() => Et.value && z.value.status === "ready" ? "streaming" : z.value.status), Ot = l(() => et.value?.notice), kt = y(() => Qe.value ? Ot.value || U(`message.pageAccessNotice.${Qe.value}`) : void 0), At = y(() => {
469
- let e = Ye.value;
479
+ let _ = T(() => import("./PkToolShowForm-gUfRbKJS.js").then((e) => e.n)), te = T(() => import("./PkToolShowContactForm-CdDx1Jxl.js").then((e) => e.n)), E = T(() => import("./PkToolShowSuggestedReply-DVYeAkEp.js").then((e) => e.n)), re = T(() => import("./PkToolShowSources-B_4taLGg.js").then((e) => e.n)), ie = T(() => import("./PkToolRequestGeolocation-CK_AAzwh.js")), ae = T(() => import("./PkToolRequestOAuthConnection-CXfvULza.js")), oe = T(() => import("./PkToolShowLocation-Cq0IXye1.js").then((e) => e.n)), ce = T(() => import("./PkToolShowDiagram-D22AS39F.js")), le = T(() => import("./PkToolEditedFile-ppesvE8O.js")), ue = T(() => import("./PkToolShareDocument-CRghPfep.js").then((e) => e.n)), F = a, ge = d, I = r(F.agentId), { agentInterface: L, agentFileUpload: _e, agentType: R, agentVoice: ye, actions: be, revisedAnswers: xe, messages: z, chat: B, messageFeedbacks: Se, feedbackDialogMessage: Ce, isFeedbackSubmitting: we, isFeedbackSubmitted: De, feedbackSubmitError: Oe, isLeadSubmitted: ke, isLoadingSubmitLead: Ae, submitLeadError: Ve, input: He, inputMessagePlaceholder: Ue, isConversationBlocked: We, baseUrl: Ge, pendingAttachments: Ke, isAttachmentLimitReached: qe, fileLimitError: Je, apiClient: V, isDark: Ye, hostToolsPending: Xe, pageNoticeLevel: Ze, hostConfirmation: Qe, agentPageAccess: $e, hostStepTitles: et, canQueue: tt, queuedMessages: nt, backgroundAnswers: rt } = me(I);
480
+ se(c, et);
481
+ let H = y(() => R.value === "reasoning" ? void 0 : _e.value), it = (e) => V.value.getMediaDownloadUrl(F.agentId, I.localChatId, e), { handleSubmit: at, stopGeneration: ot, regenerate: st, onUpvote: ct, onDownvote: lt, onFeedback: ut, onFeedbackSubmit: dt, onLeadSubmit: ft, startNewChat: pt, addToolOutput: mt, addToolApprovalResponse: ht, handleFileSelect: gt, clearFileLimitError: _t, refreshMessages: vt, appendMessage: yt, closePageNotice: bt, respondHostConfirmation: xt, editQueuedMessage: St, removeQueuedMessage: Ct, openBackgroundAnswer: wt, dismissBackgroundAnswer: Tt } = I, { t: U } = fe({ useScope: "global" }), Et = y(() => Xe.value > 0), Dt = y(() => Et.value && B.value.status === "ready" ? "streaming" : B.value.status), Ot = l(() => $e.value?.notice), kt = y(() => Ze.value ? Ot.value || U(`message.pageAccessNotice.${Ze.value}`) : void 0), At = y(() => {
482
+ let e = Je.value;
470
483
  if (e) return e.reason === "per-chat" ? U("message.fileLimitPerChat", { max: e.max }) : U("message.fileLimitPerMessage", { max: e.max });
471
- }), jt = y(() => it.value.map(({ chatId: e, title: t }) => ({
484
+ }), jt = y(() => rt.value.map(({ chatId: e, title: t }) => ({
472
485
  id: e,
473
486
  text: t ? U("message.backgroundAnswerReady", { title: t }) : U("message.backgroundAnswerReadyUntitled")
474
- }))), Mt = l(() => L.value?.dismissableNotice), Nt = y(() => Se.value.some((e) => e.role === "user")), Pt = y(() => F.modifier === "fullscreen" && !Nt.value), Ft = he(L, () => F.userName), It = de("chatViewEl"), Lt = async (e) => (await B.value.expandSourceContext(F.agentId, e.documentId, e.chunkIndex)).content, Rt = async (e) => {
475
- let t = await B.value.downloadSourceDocument(F.agentId, e);
487
+ }))), Mt = l(() => L.value?.dismissableNotice), Nt = y(() => z.value.some((e) => e.role === "user")), Pt = y(() => F.modifier === "fullscreen" && !Nt.value), Ft = he(L, () => F.userName), It = de("chatViewEl"), Lt = async (e) => (await V.value.expandSourceContext(F.agentId, e.documentId, e.chunkIndex)).content, Rt = async (e) => {
488
+ let t = await V.value.downloadSourceDocument(F.agentId, e);
476
489
  window.open(t.downloadUrl, "_blank");
477
490
  }, { isOverDropZone: zt } = pe(It, {
478
- dataTypes: (e) => t(e, V.value?.allowedMimeTypes ?? []),
491
+ dataTypes: (e) => t(e, H.value?.allowedMimeTypes ?? []),
479
492
  onDrop: (e) => {
480
- if (V.value?.enabled && e) for (let t of e) gt(t);
493
+ if (H.value?.enabled && e) for (let t of e) gt(t);
481
494
  }
482
495
  }), W = A(!1), G = !1, K = A(!1), Bt = [
483
496
  3e3,
484
497
  5e3,
485
498
  1e4
486
- ], q, J, Y = !1, X = 0, Vt = !1;
487
- function Ht() {
488
- clearTimeout(q), q = void 0, J = void 0, Y = !1, X = 0, K.value = !1;
499
+ ], Vt, q, J = !1, Y = 0, Ht = !1;
500
+ function Ut() {
501
+ clearTimeout(Vt), Vt = void 0, q = void 0, J = !1, Y = 0, K.value = !1;
489
502
  }
490
- function Ut(e) {
491
- G || (clearTimeout(q), q = setTimeout(() => {
503
+ function X(e) {
504
+ G || (clearTimeout(Vt), Vt = setTimeout(() => {
492
505
  Wt();
493
506
  }, e));
494
507
  }
495
508
  async function Wt() {
496
- if (G || Vt) return;
497
- Vt = !0;
509
+ if (G || Ht) return;
510
+ Ht = !0;
498
511
  let e;
499
512
  try {
500
513
  e = await vt();
501
514
  } finally {
502
- Vt = !1;
515
+ Ht = !1;
503
516
  }
504
517
  if (G) return;
505
- if (e === "caught-up" && (K.value = !1), Z.isActive.value) {
506
- J = void 0, Y = !1, X = 0, Ut(Re);
518
+ if (e === "caught-up" && (K.value = !1, gn()), Z.isActive.value) {
519
+ q = void 0, J = !1, Y = 0, X(Le);
507
520
  return;
508
521
  }
509
- J === void 0 && (J = Date.now(), Y = !!Z.error.value);
510
- let t = Date.now() - J;
511
- if (e === "caught-up" && t >= (Y ? Be : ze) || t >= Ve) {
512
- Ht();
522
+ q === void 0 && (q = Date.now(), J = !!Z.error.value);
523
+ let t = Date.now() - q;
524
+ if (e === "caught-up" && t >= (J ? ze : Re) || t >= Be) {
525
+ Ut(), _n();
513
526
  return;
514
527
  }
515
- let n = Bt[Math.min(X, Bt.length - 1)];
516
- X += 1, Ut(n);
528
+ let n = Bt[Math.min(Y, Bt.length - 1)];
529
+ Y += 1, X(n);
517
530
  }
518
531
  let Gt = (e = 1200) => {
519
- Ut(e);
520
- }, Z = De({
532
+ X(e);
533
+ }, Z = Ee({
521
534
  fetchGrant: async () => {
522
- let e = await B.value.createVoiceSession(F.agentId, I.localChatId, {
535
+ let e = await V.value.createVoiceSession(F.agentId, I.localChatId, {
523
536
  deviceContext: I.buildDeviceContext(),
524
537
  externalContext: I.externalContext
525
538
  });
526
539
  return e.chatId !== I.localChatId && (I.localChatId = e.chatId), e;
527
540
  },
528
- closeGrant: (e) => B.value.closeVoiceSession(F.agentId, e),
541
+ closeGrant: (e) => V.value.closeVoiceSession(F.agentId, e),
529
542
  onTranscript: (e) => {
530
- e.role === "user" ? (K.value = !0, yt({
543
+ e.role === "user" ? (K.value = !0, hn(), yt({
531
544
  id: `${i}user-${n()}`,
532
545
  role: "user",
533
546
  parts: [{
@@ -547,7 +560,7 @@ var Ne = { class: "pk-chatbot-view-chat__input-stage" }, Pe = {
547
560
  let e = Z.error.value;
548
561
  if (e) return /took too long/i.test(e) ? U("message.voiceTookTooLong") : /cascade|no response|custom_llm_error/i.test(e) ? U("message.voiceNoAnswer") : U("message.voiceInterrupted");
549
562
  }), Yt = y(() => Z.isSpeaking.value ? "output" : "input"), Xt = () => Z.readLevel(Yt.value), Zt = () => Z.readSpectrum(Yt.value), Qt = async () => {
550
- W.value = !1, await Z.start(), Z.isActive.value && (Ht(), Ut(Re));
563
+ W.value = !1, await Z.start(), Z.isActive.value && (Ut(), X(Le));
551
564
  }, $t = async () => {
552
565
  K.value = !1, await Z.stop(), !G && Gt(0);
553
566
  }, en = () => {
@@ -555,29 +568,29 @@ var Ne = { class: "pk-chatbot-view-chat__input-stage" }, Pe = {
555
568
  }, tn = async () => {
556
569
  Z.dismissError(), await Z.stop(), await Qt();
557
570
  }, Q = (e) => e?.toolCallId ?? "", nn = A(/* @__PURE__ */ new Set()), rn = (e) => nn.value.has(Q(e)), an = A(/* @__PURE__ */ new Map()), $ = (e, t) => Z.isActive.value ? (Z.sendUserMessage(t) && (nn.value = new Set(nn.value).add(Q(e)), Gt()), !0) : !1, on = (e, t, n) => {
558
- $(t, o(t, n)) || H({
571
+ $(t, o(t, n)) || mt({
559
572
  tool: e,
560
573
  toolCallId: Q(t),
561
574
  output: n
562
575
  });
563
576
  }, sn = (e) => {
564
577
  let t = e.confirmed ? U("message.voiceConfirmed") : U("message.voiceCancelled");
565
- $({ toolCallId: e.toolCallId }, t) ? nn.value.has(e.toolCallId) && (an.value = new Map(an.value).set(e.toolCallId, e.confirmed)) : H({
578
+ $({ toolCallId: e.toolCallId }, t) ? nn.value.has(e.toolCallId) && (an.value = new Map(an.value).set(e.toolCallId, e.confirmed)) : mt({
566
579
  tool: "requestConfirm",
567
580
  toolCallId: e.toolCallId,
568
581
  output: e.confirmed ? "confirmed" : "cancelled"
569
582
  });
570
583
  }, cn = (e, t) => {
571
- $(e, t) || (Ue.value = t, ot());
584
+ $(e, t) || (He.value = t, at());
572
585
  }, ln = (e, t) => {
573
586
  let n = t.error ? U("message.voiceLocationRefused") : U("message.voiceLocationShared", { place: t.displayName ?? `${t.latitude}, ${t.longitude}` });
574
- $(e, n) || H({
587
+ $(e, n) || mt({
575
588
  tool: "requestGeolocation",
576
589
  toolCallId: Q(e),
577
590
  output: t
578
591
  });
579
592
  }, un = (e, t) => {
580
- $(e, U("message.voiceConnectionDone")) || H({
593
+ $(e, U("message.voiceConnectionDone")) || mt({
581
594
  tool: "requestOAuthConnection",
582
595
  toolCallId: Q(e),
583
596
  output: {
@@ -589,15 +602,15 @@ var Ne = { class: "pk-chatbot-view-chat__input-stage" }, Pe = {
589
602
  W.value = !W.value, Z.setMuted(W.value);
590
603
  };
591
604
  O(() => {
592
- G = !0, Ht();
605
+ G = !0, Ut();
593
606
  });
594
- let { pendingWakeup: fn, isStopping: pn, stop: mn } = Me({
607
+ let { pendingWakeup: fn, isStopping: pn, stop: mn, spokenTurnStarted: hn, spokenTurnsWritten: gn, forgetSpokenTurns: _n } = je({
595
608
  agentId: () => F.agentId,
596
609
  chatId: () => I.localChatId,
597
- apiClient: () => B.value,
598
- messages: () => Se.value,
610
+ apiClient: () => V.value,
611
+ messages: () => z.value,
599
612
  refreshMessages: vt,
600
- status: () => z.value.status
613
+ status: () => B.value.status
601
614
  });
602
615
  return (t, n) => {
603
616
  let r = g;
@@ -605,7 +618,7 @@ var Ne = { class: "pk-chatbot-view-chat__input-stage" }, Pe = {
605
618
  ref_key: "chatViewEl",
606
619
  ref: It,
607
620
  class: D(["pk-chatbot-view-chat", {
608
- "pk-chatbot-view-chat--dragover": M(zt) && V.value?.enabled,
621
+ "pk-chatbot-view-chat--dragover": M(zt) && H.value?.enabled,
609
622
  "pk-chatbot-view-chat--empty": Pt.value
610
623
  }])
611
624
  }, [
@@ -626,47 +639,47 @@ var Ne = { class: "pk-chatbot-view-chat__input-stage" }, Pe = {
626
639
  key: 1,
627
640
  class: "flex flex-col flex-1 min-h-0 p-md overflow-y-auto",
628
641
  interactive: "",
629
- messages: M(Se),
642
+ messages: M(z),
630
643
  "confirm-verdicts-on-call": an.value,
631
- status: M(z).status,
632
- error: M(z).error,
644
+ status: M(B).status,
645
+ error: M(B).error,
633
646
  "main-color": M(L)?.mainColor,
634
647
  "text-color": M(L)?.textColor,
635
648
  "revised-answers": M(xe),
636
649
  actions: M(be),
637
- "message-feedbacks": M(Ce),
638
- "feedback-message-id": M(we)?.id,
639
- "feedback-loading": M(Te),
640
- "feedback-submitted": M(Oe),
641
- "feedback-error": M(ke),
650
+ "message-feedbacks": M(Se),
651
+ "feedback-message-id": M(Ce)?.id,
652
+ "feedback-loading": M(we),
653
+ "feedback-submitted": M(De),
654
+ "feedback-error": M(Oe),
642
655
  "show-extended-steps": M(L)?.showExtendedSteps,
643
656
  "awaiting-spoken-answer": K.value,
644
657
  "host-working": Et.value,
645
- "host-confirmation": M($e),
646
- "is-dark": M(Xe),
658
+ "host-confirmation": M(Qe),
659
+ "is-dark": M(Ye),
647
660
  "show-scroll-to-bottom": a.modifier === "fullscreen",
648
- onFeedbackSubmit: n[0] ||= (e) => M(ft)(e),
649
- onFeedbackClose: n[1] ||= (e) => we.value = void 0,
650
- onRegenerate: M(ct),
651
- onAutoRetry: M(ct),
652
- onResetChat: M(mt),
661
+ onFeedbackSubmit: n[0] ||= (e) => M(dt)(e),
662
+ onFeedbackClose: n[1] ||= (e) => Ce.value = void 0,
663
+ onRegenerate: M(st),
664
+ onAutoRetry: M(st),
665
+ onResetChat: M(pt),
653
666
  onShowInfo: n[2] ||= (e) => ge("show-info", e),
654
667
  onRevise: n[3] ||= (e) => ge("revise", e),
655
- onUpvote: M(lt),
656
- onDownvote: M(ut),
657
- onFeedback: M(dt),
668
+ onUpvote: M(ct),
669
+ onDownvote: M(lt),
670
+ onFeedback: M(ut),
658
671
  onApprovalRespond: M(ht),
659
672
  onConfirmRespond: sn,
660
673
  onHostConfirmRespond: M(xt)
661
674
  }, {
662
675
  "tool-showContactForm": P(({ part: e }) => [w(M(te), {
663
676
  part: e,
664
- readonly: !M(Ke),
665
- submitted: M(Ae),
666
- loading: M(je),
667
- error: M(He),
677
+ readonly: !M(Ge),
678
+ submitted: M(ke),
679
+ loading: M(Ae),
680
+ error: M(Ve),
668
681
  "privacy-policy-notice": M(L)?.privacyPolicyNotice,
669
- onSubmit: M(pt)
682
+ onSubmit: M(ft)
670
683
  }, null, 8, [
671
684
  "part",
672
685
  "readonly",
@@ -712,9 +725,9 @@ var Ne = { class: "pk-chatbot-view-chat__input-stage" }, Pe = {
712
725
  }, 1024)]),
713
726
  "tool-requestOAuthConnection": P(({ part: e }) => [w(M(ae), {
714
727
  part: e,
715
- "backend-url": M(Ke),
716
- "resolve-connection": (e) => M(B).getOAuthAuthorizeUrl(F.agentId, e),
717
- "check-connection": (e) => M(B).getOAuthConnectionStatus(F.agentId, e),
728
+ "backend-url": M(Ge),
729
+ "resolve-connection": (e) => M(V).getOAuthAuthorizeUrl(F.agentId, e),
730
+ "check-connection": (e) => M(V).getOAuthConnectionStatus(F.agentId, e),
718
731
  onConnected: (t) => un(e, t)
719
732
  }, null, 8, [
720
733
  "part",
@@ -726,7 +739,7 @@ var Ne = { class: "pk-chatbot-view-chat__input-stage" }, Pe = {
726
739
  "tool-requestGeolocation": P(({ part: e }) => [w(M(ie), {
727
740
  part: e,
728
741
  "call-live": M(Z).isActive.value,
729
- "reverse-geocode": (e, t) => M(B).reverseGeocode(e, t),
742
+ "reverse-geocode": (e, t) => M(V).reverseGeocode(e, t),
730
743
  onResult: (t) => ln(e, t)
731
744
  }, null, 8, [
732
745
  "part",
@@ -736,9 +749,9 @@ var Ne = { class: "pk-chatbot-view-chat__input-stage" }, Pe = {
736
749
  ])]),
737
750
  "tool-showLocation": P(({ part: e }) => [w(M(oe), {
738
751
  part: e,
739
- "is-dark": M(Xe),
752
+ "is-dark": M(Ye),
740
753
  "main-color": M(L)?.mainColor,
741
- "forward-geocode": (e, t) => M(B).forwardGeocode(e, t)
754
+ "forward-geocode": (e, t) => M(V).forwardGeocode(e, t)
742
755
  }, null, 8, [
743
756
  "part",
744
757
  "is-dark",
@@ -747,17 +760,17 @@ var Ne = { class: "pk-chatbot-view-chat__input-stage" }, Pe = {
747
760
  ])]),
748
761
  "tool-showDiagram": P(({ part: e }) => [w(M(ce), {
749
762
  part: e,
750
- "is-dark": M(Xe)
763
+ "is-dark": M(Ye)
751
764
  }, null, 8, ["part", "is-dark"])]),
752
765
  "tool-editSpreadsheet": P(({ part: e }) => [(k(), b(M(le), {
753
766
  key: M(s)(e),
754
767
  part: e,
755
- "file-url": at
768
+ "file-url": it
756
769
  }, null, 8, ["part"]))]),
757
770
  "tool-editWordDocument": P(({ part: e }) => [(k(), b(M(le), {
758
771
  key: M(s)(e),
759
772
  part: e,
760
- "file-url": at
773
+ "file-url": it
761
774
  }, null, 8, ["part"]))]),
762
775
  "tool-shareDocument": P(({ part: e }) => [(k(), b(M(ue), {
763
776
  key: M(s)(e),
@@ -768,9 +781,9 @@ var Ne = { class: "pk-chatbot-view-chat__input-stage" }, Pe = {
768
781
  }, 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.awaiting-spoken-answer.host-working.host-confirmation.is-dark.show-scroll-to-bottom.onRegenerate.onAutoRetry.onResetChat.onUpvote.onDownvote.onFeedback.onApprovalRespond.onHostConfirmRespond".split(".")))]),
769
782
  _: 1
770
783
  }),
771
- M(rt).length ? (k(), b(p, {
784
+ M(nt).length ? (k(), b(p, {
772
785
  key: 0,
773
- messages: M(rt),
786
+ messages: M(nt),
774
787
  onEdit: M(St),
775
788
  onRemove: M(Ct)
776
789
  }, null, 8, [
@@ -778,7 +791,7 @@ var Ne = { class: "pk-chatbot-view-chat__input-stage" }, Pe = {
778
791
  "onEdit",
779
792
  "onRemove"
780
793
  ])) : x("", !0),
781
- C("div", Ne, [
794
+ C("div", Me, [
782
795
  w(v, { name: "pk-chatbot-view-chat-fade" }, {
783
796
  default: P(() => [Pt.value ? (k(), b(ve, {
784
797
  key: 0,
@@ -787,7 +800,7 @@ var Ne = { class: "pk-chatbot-view-chat__input-stage" }, Pe = {
787
800
  })) : x("", !0)]),
788
801
  _: 1
789
802
  }),
790
- M(fn) && !M(Ge) ? (k(), b(h, {
803
+ M(fn) && !M(We) ? (k(), b(h, {
791
804
  key: 0,
792
805
  pending: M(fn),
793
806
  stopping: M(pn),
@@ -797,25 +810,25 @@ var Ne = { class: "pk-chatbot-view-chat__input-stage" }, Pe = {
797
810
  "stopping",
798
811
  "onStop"
799
812
  ])) : x("", !0),
800
- M(Ge) ? (k(), S("div", Pe, j(M(U)("message.chatErrorConversationBlocked")), 1)) : qt.value === "idle" ? (k(), b(f, {
813
+ M(We) ? (k(), S("div", Ne, j(M(U)("message.chatErrorConversationBlocked")), 1)) : qt.value === "idle" ? (k(), b(f, {
801
814
  key: 3,
802
- modelValue: M(Ue),
803
- "onUpdate:modelValue": n[4] ||= (e) => ne(Ue) ? Ue.value = e : null,
804
- "pending-attachments": M(qe),
805
- "onUpdate:pendingAttachments": n[5] ||= (e) => ne(qe) ? qe.value = e : null,
806
- placeholder: M(We),
807
- "dismissable-notice": M(Mt) && M(z).messages.length <= 1 ? M(Mt) : void 0,
815
+ modelValue: M(He),
816
+ "onUpdate:modelValue": n[4] ||= (e) => ne(He) ? He.value = e : null,
817
+ "pending-attachments": M(Ke),
818
+ "onUpdate:pendingAttachments": n[5] ||= (e) => ne(Ke) ? Ke.value = e : null,
819
+ placeholder: M(Ue),
820
+ "dismissable-notice": M(Mt) && M(B).messages.length <= 1 ? M(Mt) : void 0,
808
821
  "page-notice": kt.value,
809
822
  status: Dt.value,
810
823
  "max-message-length": M(L)?.maxMessageLength,
811
- "file-upload": V.value,
812
- "attachment-limit-reached": M(Je),
824
+ "file-upload": H.value,
825
+ "attachment-limit-reached": M(qe),
813
826
  "attachment-notice": At.value,
814
827
  "voice-enabled": Kt.value,
815
- "queue-enabled": M(nt),
828
+ "queue-enabled": M(tt),
816
829
  "answer-notices": jt.value,
817
- onStopGeneration: M(st),
818
- onSubmit: M(ot),
830
+ onStopGeneration: M(ot),
831
+ onSubmit: M(at),
819
832
  onFileSelect: M(gt),
820
833
  onDismissAttachmentNotice: M(_t),
821
834
  onDismissPageNotice: M(bt),
@@ -824,12 +837,12 @@ var Ne = { class: "pk-chatbot-view-chat__input-stage" }, Pe = {
824
837
  onVoiceStart: Qt
825
838
  }, ee({ _: 2 }, [a.modifier === "fullscreen" ? {
826
839
  name: "prepend",
827
- fn: P(() => [C("span", Fe, [w(u, {
840
+ fn: P(() => [C("span", Pe, [w(u, {
828
841
  modifiers: "surface",
829
842
  class: "pk-chatbot-view-chat__agent-chip-avatar",
830
843
  "img-src": M(L)?.logo,
831
844
  name: M(I).name
832
- }, null, 8, ["img-src", "name"]), M(I).name ? (k(), S("strong", Ie, j(M(I).name), 1)) : x("", !0)])]),
845
+ }, null, 8, ["img-src", "name"]), M(I).name ? (k(), S("strong", Fe, j(M(I).name), 1)) : x("", !0)])]),
833
846
  key: "0"
834
847
  } : void 0]), 1032, [
835
848
  "modelValue",
@@ -852,7 +865,7 @@ var Ne = { class: "pk-chatbot-view-chat__input-stage" }, Pe = {
852
865
  "onDismissPageNotice",
853
866
  "onOpenAnswerNotice",
854
867
  "onDismissAnswerNotice"
855
- ])) : (k(), b(Ee, {
868
+ ])) : (k(), b(Te, {
856
869
  key: 2,
857
870
  state: qt.value,
858
871
  sample: Xt,
@@ -877,7 +890,7 @@ var Ne = { class: "pk-chatbot-view-chat__input-stage" }, Pe = {
877
890
  ]))
878
891
  ]),
879
892
  w(v, null, {
880
- default: P(() => [M(zt) && V.value?.enabled ? (k(), S("div", Le, [w(r, {
893
+ default: P(() => [M(zt) && H.value?.enabled ? (k(), S("div", Ie, [w(r, {
881
894
  name: "ri:upload-cloud-2-line",
882
895
  class: "pk-chatbot-view-chat__drop-overlay-icon"
883
896
  }), C("span", null, j(M(U)("action.dropFile")), 1)])) : x("", !0)]),
@@ -887,6 +900,6 @@ var Ne = { class: "pk-chatbot-view-chat__input-stage" }, Pe = {
887
900
  };
888
901
  }
889
902
  });
890
- export { ve as i, Ee as n, be as r, He as t };
903
+ export { ve as i, Te as n, be as r, Ve as t };
891
904
 
892
- //# sourceMappingURL=PkChatbotViewChat-GiEjvFUZ.js.map
905
+ //# sourceMappingURL=PkChatbotViewChat-58rvFSbr.js.map