@8wave/ai-elements 0.119.0-beta.55 → 0.119.0-beta.56

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.
@@ -347,7 +347,7 @@ var Ye = ["aria-busy"], Xe = {
347
347
  messagesLength: () => n.messages?.length,
348
348
  lastMessageRole: () => n.messages?.[n.messages.length - 1]?.role,
349
349
  contentEl: () => F.value,
350
- beforeNewMessageScroll: () => Et(),
350
+ beforeNewMessageScroll: () => Ot(),
351
351
  onScrollUp: () => r("scroll-up"),
352
352
  onScrollDown: () => r("scroll-down")
353
353
  }), Le = () => {
@@ -374,72 +374,78 @@ var Ye = ["aria-busy"], Xe = {
374
374
  top: t.scrollTop + r.getBoundingClientRect().top - t.getBoundingClientRect().top - Number.parseFloat(getComputedStyle(t).paddingTop),
375
375
  behavior: "smooth"
376
376
  }));
377
- }, q = k(() => n.status === "submitted" || n.status === "streaming"), J = z(0), Ge = z(!1), Ke = !1, Tt = ke(), Et = async () => {
378
- let e = n.messages;
379
- if (!e?.length || n.disableHeightAdjustment || !(e[e.length - 1].role === "user" || q.value) || (Ke = !0, Ge.value = !1, await I(), !E.value)) return;
380
- let { paddingTop: t, paddingBottom: r } = getComputedStyle(E.value), i = E.value.clientHeight - Number.parseFloat(t) - Number.parseFloat(r), a = F.value && Number.parseFloat(getComputedStyle(F.value).rowGap) || 0, o = ze();
381
- Tt.value = o[o.length - 1];
382
- let s = i - (Tt.value?.clientHeight ?? 0) - a;
383
- i > 0 && (J.value = Math.max(s, 0)), await I();
377
+ }, q = k(() => n.status === "submitted" || n.status === "streaming"), J = z(0), Ge = z(!1), Ke = !1, Tt = ke(), Et = () => n.messages?.[n.messages.length - 1]?.role === "user" || q.value, Dt = () => {
378
+ Ke = !1, Ge.value = !0, J.value = 0;
379
+ }, Ot = async () => {
380
+ if (!n.messages?.length || n.disableHeightAdjustment) return;
381
+ if (!Et()) {
382
+ Ke && (await I(), E.value?.scrollHeight, Et() || Dt());
383
+ return;
384
+ }
385
+ if (Ke = !0, Ge.value = !1, await I(), !E.value) return;
386
+ let { paddingTop: e, paddingBottom: t } = getComputedStyle(E.value), r = E.value.clientHeight - Number.parseFloat(e) - Number.parseFloat(t), i = F.value && Number.parseFloat(getComputedStyle(F.value).rowGap) || 0, a = ze();
387
+ Tt.value = a[a.length - 1];
388
+ let o = r - (Tt.value?.clientHeight ?? 0) - i;
389
+ r > 0 && (J.value = Math.max(o, 0)), await I();
384
390
  };
385
- H([() => n.messages?.length, () => n.messages?.[n.messages.length - 1]?.id], () => Et()), Ne([E, Tt], () => {
386
- Ke && Et();
391
+ H([() => n.messages?.length, () => n.messages?.[n.messages.length - 1]?.id], () => Ot()), Ne([E, Tt], () => {
392
+ Ke && Ot();
387
393
  }), Te(() => {
388
- (q.value || n.awaitingSpokenAnswer) && Et();
394
+ (q.value || n.awaitingSpokenAnswer) && Ot();
389
395
  }), H(q, (e) => {
390
- e || (Ke = !1, Ge.value = !0, J.value = 0);
396
+ e || Dt();
391
397
  });
392
- let Dt = (e) => n.revisedAnswers?.some((t) => t.messageId === e), Y = (e) => n.messageFeedbacks?.find((t) => t.messageId === e), Ot = /* @__PURE__ */ new Set(["showContactForm"]), kt = (e) => !n.interactive && Ot.has(p(e)) ? { record: !0 } : {}, At = (e, t) => !n.readonlyFeedback && Jt(e, t), jt = (e) => n.readonlyFeedback ? Y(e) : void 0, Mt = (e) => jt(e)?.vote, Nt = (e) => {
393
- let t = jt(e);
398
+ let kt = (e) => n.revisedAnswers?.some((t) => t.messageId === e), Y = (e) => n.messageFeedbacks?.find((t) => t.messageId === e), At = /* @__PURE__ */ new Set(["showContactForm"]), jt = (e) => !n.interactive && At.has(p(e)) ? { record: !0 } : {}, Mt = (e, t) => !n.readonlyFeedback && Zt(e, t), Nt = (e) => n.readonlyFeedback ? Y(e) : void 0, Pt = (e) => Nt(e)?.vote, Ft = (e) => {
399
+ let t = Nt(e);
394
400
  if (t?.vote) return;
395
401
  let n = t?.metadata?.reactionEmoji;
396
402
  return typeof n == "string" && /\p{Extended_Pictographic}/u.test(n) ? n : void 0;
397
- }, Pt = (e) => !!(Mt(e) || Nt(e)), Ft = (e) => {
398
- if (Nt(e)) return "pk-chatbot-message__reaction--neutral";
399
- let t = Mt(e);
403
+ }, It = (e) => !!(Pt(e) || Ft(e)), Lt = (e) => {
404
+ if (Ft(e)) return "pk-chatbot-message__reaction--neutral";
405
+ let t = Pt(e);
400
406
  return t === "upvote" ? "pk-chatbot-message__reaction--positive" : t === "downvote" ? "pk-chatbot-message__reaction--negative" : "pk-chatbot-message__reaction--neutral";
401
- }, It = (e) => {
402
- let t = Mt(e);
407
+ }, Rt = (e) => {
408
+ let t = Pt(e);
403
409
  return i(t === "upvote" ? "hint.userFeedbackPositive" : t === "downvote" ? "hint.userFeedbackNegative" : "hint.userFeedbackReaction");
404
- }, Lt = (e) => {
405
- let t = Bt(e);
410
+ }, zt = (e) => {
411
+ let t = Ht(e);
406
412
  for (let e = t.length - 1; e >= 0; --e) if (f(t[e])) return e;
407
413
  return -1;
408
- }, Rt = k(() => n.messages?.[n.messages.length - 1]), X = k(() => {
409
- let e = Rt.value;
414
+ }, Bt = k(() => n.messages?.[n.messages.length - 1]), X = k(() => {
415
+ let e = Bt.value;
410
416
  return e ? e.parts[e.parts.length - 1] : null;
411
- }), zt = k(() => {
417
+ }), Vt = k(() => {
412
418
  let e = /* @__PURE__ */ new Map();
413
419
  for (let t of n.messages ?? []) t.role === "assistant" && e.set(t.id, x(C(ne(t.parts))));
414
420
  return e;
415
- }), Bt = (e) => zt.value.get(e.id) ?? e.parts, Vt = k(() => n.status === "error"), Ht = k(() => n.awaitingSpokenAnswer === !0 && !q.value), Ut = k(() => Ht.value && Rt.value?.role === "user" && !Vt.value), Wt = k(() => {
421
+ }), Ht = (e) => Vt.value.get(e.id) ?? e.parts, Ut = k(() => n.status === "error"), Wt = k(() => n.awaitingSpokenAnswer === !0 && !q.value), Gt = k(() => Wt.value && Bt.value?.role === "user" && !Ut.value), Kt = (e, t) => t(), qt = k(() => {
416
422
  let e = X.value;
417
423
  return re(i, e);
418
- }), Gt = k(() => {
424
+ }), Jt = k(() => {
419
425
  let e = X.value;
420
426
  return T(e);
421
- }), Kt = (e) => n.messages?.findIndex((t) => t.id === e), Z = (e) => e === void 0 || !n.messages ? !1 : e === n.messages.length - 1, qt = (e) => Z(e) && n.status === "ready" && !!n.actions?.includes("regenerate"), Jt = (e, t) => (!Z(t) || n.status === "ready") && !!n.actions?.includes(e), Yt = (e) => {
427
+ }), Yt = (e) => n.messages?.findIndex((t) => t.id === e), Z = (e) => e === void 0 || !n.messages ? !1 : e === n.messages.length - 1, Xt = (e) => Z(e) && n.status === "ready" && !!n.actions?.includes("regenerate"), Zt = (e, t) => (!Z(t) || n.status === "ready") && !!n.actions?.includes(e), Qt = (e) => {
422
428
  let t = e.parts[e.parts.length - 1];
423
429
  return f(t);
424
- }, Xt = (e) => e.parts.some((e) => _(e) || m(e)), Zt = (e) => !!n.showExtendedSteps && Q(e) && Xt(e), Qt = (e) => m(e) && !S(e) && !!(Ve[p(e)] || l[e.type] || n.showAllMessageParts), $t = (e) => e.parts.some((e) => f(e) && !!e.text.trim() || g(e) || w(e) && !S(e) || Qt(e)), Q = (e) => e.role === "assistant", en = (e) => e.role === "user", tn = (e) => n.messages?.slice(0, e).reverse().find((e) => Q(e)), nn = (e) => n.messages?.slice(e + 1).find((e) => Q(e)), rn = (e) => {
425
- let t = tn(e)?.metadata?.createdAt, n = nn(e)?.metadata?.createdAt;
430
+ }, $t = (e) => e.parts.some((e) => _(e) || m(e)), en = (e) => !!n.showExtendedSteps && Q(e) && $t(e), tn = (e) => m(e) && !S(e) && !!(Ve[p(e)] || l[e.type] || n.showAllMessageParts), nn = (e) => e.parts.some((e) => f(e) && !!e.text.trim() || g(e) || w(e) && !S(e) || tn(e)), Q = (e) => e.role === "assistant", rn = (e) => e.role === "user", an = (e) => n.messages?.slice(0, e).reverse().find((e) => Q(e)), on = (e) => n.messages?.slice(e + 1).find((e) => Q(e)), sn = (e) => {
431
+ let t = an(e)?.metadata?.createdAt, n = on(e)?.metadata?.createdAt;
426
432
  if (!t || !n) return;
427
433
  let r = new Date(t), i = new Date(n);
428
434
  return r.toDateString() === i.toDateString() ? void 0 : i;
429
- }, $ = k(() => n.showAllMessageParts ? Je([]) : Je(n.messages ?? [], $t)), an = k(() => {
435
+ }, $ = k(() => n.showAllMessageParts ? Je([]) : Je(n.messages ?? [], nn)), cn = k(() => {
430
436
  let e = 0;
431
437
  return (n.messages ?? []).map((t) => t.parts.length > 0 ? ++e : void 0);
432
- }), on = (e, t) => t === 0 || e.role !== "assistant" ? !1 : !!(n.actions?.length || n.showMessageNumber || n.showMessageDateTime && e.metadata?.createdAt !== void 0 || e.metadata?.completedAt !== void 0 || n.showMessageTokensCount && e.metadata?.totalTokens !== void 0), sn = (e) => {
438
+ }), ln = (e, t) => t === 0 || e.role !== "assistant" ? !1 : !!(n.actions?.length || n.showMessageNumber || n.showMessageDateTime && e.metadata?.createdAt !== void 0 || e.metadata?.completedAt !== void 0 || n.showMessageTokensCount && e.metadata?.totalTokens !== void 0), un = (e) => {
433
439
  let t = new Date(e), n = t.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
434
440
  return s(t, n ? "time" : "date-time");
435
- }, cn = (e) => {
441
+ }, dn = (e) => {
436
442
  let { createdAt: t, completedAt: n } = e.metadata ?? {};
437
443
  if (t && n) return le(c, n - t);
438
- }, ln = je("feedbackMessageEl");
444
+ }, fn = je("feedbackMessageEl");
439
445
  return H(() => n.feedbackMessageId, async () => {
440
446
  if (await I(), !n.feedbackMessageId) return;
441
- let e = ln.value?.[0]?.$el;
442
- e && (Z(Kt(n.feedbackMessageId)) ? Pe() : e.scrollIntoView({
447
+ let e = fn.value?.[0]?.$el;
448
+ e && (Z(Yt(n.feedbackMessageId)) ? Pe() : e.scrollIntoView({
443
449
  behavior: "smooth",
444
450
  block: "center"
445
451
  }));
@@ -470,7 +476,7 @@ var Ye = ["aria-busy"], Xe = {
470
476
  class: "pk-chatbot-messages__wrapper"
471
477
  }, [
472
478
  (R(!0), M(D, null, Ee(e.messages, (u, x) => (R(), M(D, { key: u.id }, [
473
- en(u) && rn(x) ? (R(), M("div", Ze, [N("span", Qe, B(V(s)(rn(x), "short")), 1)])) : j("", !0),
479
+ rn(u) && sn(x) ? (R(), M("div", Ze, [N("span", Qe, B(V(s)(sn(x), "short")), 1)])) : j("", !0),
474
480
  $.value.quietRuns.has(u.id) ? (R(), M("div", $e, [P(r, {
475
481
  name: "ri:alarm-line",
476
482
  class: "shrink-0"
@@ -488,17 +494,17 @@ var Ye = ["aria-busy"], Xe = {
488
494
  (!V(G)(u) || e.showAllMessageParts) && (!$.value.hidden.has(u.id) || q.value && Z(x)) && (u.parts.length || Z(x) && q.value && Q(u)) ? (R(), M("div", {
489
495
  key: 3,
490
496
  class: L(["pk-chatbot-message", [`pk-chatbot-message--${u.role}`, { "pk-chatbot-message--loading": q.value && Z(x) && Q(u) }]]),
491
- style: Ce({ minHeight: Z(x) && Q(u) && !Vt.value ? `${J.value}px` : void 0 })
497
+ style: Ce({ minHeight: Z(x) && Q(u) && !Ut.value ? `${J.value}px` : void 0 })
492
498
  }, [
493
499
  P(O, {
494
500
  appear: "",
495
501
  name: "pk-chatbot-part"
496
502
  }, {
497
- default: U(() => [Zt(u) ? (R(), A(ge, {
503
+ default: U(() => [en(u) ? (R(), A(ge, {
498
504
  key: 0,
499
505
  message: u,
500
506
  "is-streaming": q.value && Z(x),
501
- "has-content": $t(u),
507
+ "has-content": nn(u),
502
508
  "is-dark": e.isDark
503
509
  }, null, 8, [
504
510
  "message",
@@ -508,7 +514,7 @@ var Ye = ["aria-busy"], Xe = {
508
514
  ])) : j("", !0)]),
509
515
  _: 2
510
516
  }, 1024),
511
- (R(!0), M(D, null, Ee(Bt(u), (n, s) => (R(), M(D, { key: V(se)(n, s) }, [V(f)(n) && n.text.trim() ? (R(), A(O, {
517
+ (R(!0), M(D, null, Ee(Ht(u), (n, s) => (R(), M(D, { key: V(se)(n, s) }, [V(f)(n) && n.text.trim() ? (R(), A(O, {
512
518
  key: 0,
513
519
  appear: "",
514
520
  name: "pk-chatbot-part"
@@ -528,13 +534,13 @@ var Ye = ["aria-busy"], Xe = {
528
534
  "markdown",
529
535
  "is-dark",
530
536
  "loading"
531
- ])) : (R(), M(D, { key: 1 }, [be(B(n.text), 1)], 64))]), Pt(u.id) && !Y(u.id)?.comment && s === Lt(u) ? (R(), M("span", {
537
+ ])) : (R(), M(D, { key: 1 }, [be(B(n.text), 1)], 64))]), It(u.id) && !Y(u.id)?.comment && s === zt(u) ? (R(), M("span", {
532
538
  key: 0,
533
- class: L(["pk-chatbot-message__reaction", Ft(u.id)]),
534
- title: It(u.id)
535
- }, [Nt(u.id) ? (R(), M("span", rt, B(Nt(u.id)), 1)) : (R(), A(r, {
539
+ class: L(["pk-chatbot-message__reaction", Lt(u.id)]),
540
+ title: Rt(u.id)
541
+ }, [Ft(u.id) ? (R(), M("span", rt, B(Ft(u.id)), 1)) : (R(), A(r, {
536
542
  key: 1,
537
- name: Mt(u.id) === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-up-fill"
543
+ name: Pt(u.id) === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-up-fill"
538
544
  }, null, 8, ["name"]))], 10, nt)) : j("", !0)])]),
539
545
  _: 2
540
546
  }, 1024)) : V(g)(n) ? (R(), A(O, {
@@ -591,7 +597,7 @@ var Ye = ["aria-busy"], Xe = {
591
597
  "onRespond"
592
598
  ]))]),
593
599
  _: 2
594
- }, 1024)) : Qt(n) ? (R(), A(O, {
600
+ }, 1024)) : tn(n) ? (R(), A(O, {
595
601
  key: 3,
596
602
  appear: "",
597
603
  name: "pk-chatbot-part"
@@ -599,7 +605,7 @@ var Ye = ["aria-busy"], Xe = {
599
605
  default: U(() => [!V(l)[n.type] && V(Ve)[V(p)(n)] ? (R(), A(Oe(V(Ve)[V(p)(n)]), Se({
600
606
  key: `component-${s}-${V(ce)(n)}`,
601
607
  part: n
602
- }, { ref_for: !0 }, kt(n)), null, 16, ["part"])) : De(t.$slots, n.type, Se({ ref_for: !0 }, {
608
+ }, { ref_for: !0 }, jt(n)), null, 16, ["part"])) : De(t.$slots, n.type, Se({ ref_for: !0 }, {
603
609
  message: u,
604
610
  part: n,
605
611
  index: x,
@@ -614,7 +620,7 @@ var Ye = ["aria-busy"], Xe = {
614
620
  })), 1)])])) : j("", !0)], void 0, 1)]),
615
621
  _: 2
616
622
  }, 1024)) : j("", !0), P(O, { mode: "out-in" }, {
617
- default: U(() => [s === Lt(u) && e.readonlyFeedback && Y(u.id)?.comment ? (R(), A(me, {
623
+ default: U(() => [s === zt(u) && e.readonlyFeedback && Y(u.id)?.comment ? (R(), A(me, {
618
624
  key: 0,
619
625
  feedback: Y(u.id)
620
626
  }, null, 8, ["feedback"])) : j("", !0)]),
@@ -624,7 +630,7 @@ var Ye = ["aria-busy"], Xe = {
624
630
  name: "fade-in",
625
631
  mode: "out-in"
626
632
  }, {
627
- default: U(() => [q.value && Z(x) && !Yt(u) && Q(u) && (!Zt(u) || $t(u)) ? (R(), M("div", {
633
+ default: U(() => [q.value && Z(x) && !Qt(u) && Q(u) && (!en(u) || nn(u)) ? (R(), M("div", {
628
634
  key: `loading-info-${u.id}`,
629
635
  class: "pk-chatbot-message__loading-info"
630
636
  }, [N("div", ct, [
@@ -633,25 +639,25 @@ var Ye = ["aria-busy"], Xe = {
633
639
  class: "shrink-0"
634
640
  }),
635
641
  P(O, { mode: "out-in" }, {
636
- default: U(() => [Gt.value ? (R(), A(r, {
637
- key: Gt.value,
642
+ default: U(() => [Jt.value ? (R(), A(r, {
643
+ key: Jt.value,
638
644
  class: "shrink-0",
639
- name: Gt.value
645
+ name: Jt.value
640
646
  }, null, 8, ["name"])) : j("", !0)]),
641
647
  _: 1
642
648
  }),
643
649
  P(O, { mode: "out-in" }, {
644
- default: U(() => [Wt.value ? (R(), M("span", {
645
- key: Wt.value,
650
+ default: U(() => [qt.value ? (R(), M("span", {
651
+ key: qt.value,
646
652
  class: "text-12"
647
- }, B(Wt.value), 1)) : j("", !0)]),
653
+ }, B(qt.value), 1)) : j("", !0)]),
648
654
  _: 1
649
655
  })
650
656
  ]), P(O, {
651
657
  name: "fade-in",
652
658
  mode: "out-in"
653
659
  }, {
654
- default: U(() => [!Zt(u) && X.value && "text" in X.value && X.value.text.trim() ? (R(), A(he, {
660
+ default: U(() => [!en(u) && X.value && "text" in X.value && X.value.text.trim() ? (R(), A(he, {
655
661
  key: 0,
656
662
  markdown: X.value.text,
657
663
  "is-dark": e.isDark,
@@ -668,14 +674,14 @@ var Ye = ["aria-busy"], Xe = {
668
674
  _: 2
669
675
  }, 1024),
670
676
  P(O, { mode: "out-in" }, {
671
- default: U(() => [on(u, x) ? (R(), M("div", lt, [
677
+ default: U(() => [ln(u, x) ? (R(), M("div", lt, [
672
678
  P(_, {
673
679
  modifiers: "compact",
674
680
  class: "mr-auto shrink-0"
675
681
  }, {
676
682
  default: U(() => [
677
683
  P(O, { mode: "out-in" }, {
678
- default: U(() => [qt(x) ? (R(), A(m, {
684
+ default: U(() => [Xt(x) ? (R(), A(m, {
679
685
  key: 0,
680
686
  icon: "ri:reset-right-line",
681
687
  modifiers: "action-quiet-small",
@@ -686,7 +692,7 @@ var Ye = ["aria-busy"], Xe = {
686
692
  _: 2
687
693
  }, 1024),
688
694
  P(O, { mode: "out-in" }, {
689
- default: U(() => [Jt("show-info", x) ? (R(), A(m, {
695
+ default: U(() => [Zt("show-info", x) ? (R(), A(m, {
690
696
  key: 0,
691
697
  icon: "ri:information-line",
692
698
  title: V(i)("action.getMoreInfo"),
@@ -701,13 +707,13 @@ var Ye = ["aria-busy"], Xe = {
701
707
  _: 2
702
708
  }, 1024),
703
709
  P(O, { mode: "out-in" }, {
704
- default: U(() => [Jt("revise", x) ? (R(), A(m, {
710
+ default: U(() => [Zt("revise", x) ? (R(), A(m, {
705
711
  key: 0,
706
- icon: Dt(u.id) ? "ri:file-edit-fill" : "ri:file-edit-line",
707
- title: Dt(u.id) ? V(i)("action.editRevise") : V(i)("action.createRevise"),
708
- "aria-label": Dt(u.id) ? V(i)("action.editRevise") : V(i)("action.createRevise"),
712
+ icon: kt(u.id) ? "ri:file-edit-fill" : "ri:file-edit-line",
713
+ title: kt(u.id) ? V(i)("action.editRevise") : V(i)("action.createRevise"),
714
+ "aria-label": kt(u.id) ? V(i)("action.editRevise") : V(i)("action.createRevise"),
709
715
  modifiers: "action-quiet-small",
710
- class: L({ "text-brand-graphic": Dt(u.id) }),
716
+ class: L({ "text-brand-graphic": kt(u.id) }),
711
717
  onClick: W((e) => t.$emit("revise", u), ["stop"])
712
718
  }, null, 8, [
713
719
  "icon",
@@ -719,7 +725,7 @@ var Ye = ["aria-busy"], Xe = {
719
725
  _: 2
720
726
  }, 1024),
721
727
  P(O, { mode: "out-in" }, {
722
- default: U(() => [At("upvote", x) ? (R(), A(m, {
728
+ default: U(() => [Mt("upvote", x) ? (R(), A(m, {
723
729
  key: 0,
724
730
  icon: Y(u.id)?.vote === "upvote" ? "ri:thumb-up-fill" : "ri:thumb-up-line",
725
731
  title: V(i)("action.upvote"),
@@ -735,7 +741,7 @@ var Ye = ["aria-busy"], Xe = {
735
741
  _: 2
736
742
  }, 1024),
737
743
  P(O, { mode: "out-in" }, {
738
- default: U(() => [At("downvote", x) ? (R(), A(m, {
744
+ default: U(() => [Mt("downvote", x) ? (R(), A(m, {
739
745
  key: 0,
740
746
  icon: Y(u.id)?.vote === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-down-line",
741
747
  title: V(i)("action.downvote"),
@@ -751,7 +757,7 @@ var Ye = ["aria-busy"], Xe = {
751
757
  _: 2
752
758
  }, 1024),
753
759
  P(O, { mode: "out-in" }, {
754
- default: U(() => [At("feedback", x) ? (R(), A(m, {
760
+ default: U(() => [Mt("feedback", x) ? (R(), A(m, {
755
761
  key: 0,
756
762
  icon: Y(u.id)?.comment ? "ri:feedback-fill" : "ri:feedback-line",
757
763
  title: V(i)("action.feedback"),
@@ -776,15 +782,15 @@ var Ye = ["aria-busy"], Xe = {
776
782
  }, [P(r, {
777
783
  name: "ri:time-line",
778
784
  class: "shrink-0"
779
- }), N("span", ft, B(sn(u.metadata.createdAt)), 1)], 8, dt), cn(u) ? (R(), M("span", pt, [P(r, {
785
+ }), N("span", ft, B(un(u.metadata.createdAt)), 1)], 8, dt), dn(u) ? (R(), M("span", pt, [P(r, {
780
786
  name: "ri:hourglass-line",
781
787
  class: "shrink-0"
782
- }), N("span", mt, B(cn(u)), 1)])) : j("", !0)])) : j("", !0),
788
+ }), N("span", mt, B(dn(u)), 1)])) : j("", !0)])) : j("", !0),
783
789
  e.showMessageNumber ? (R(), M("span", {
784
790
  key: 1,
785
- title: V(i)("label.messageNumber", { n: an.value[x] }),
791
+ title: V(i)("label.messageNumber", { n: cn.value[x] }),
786
792
  class: "text-12 text-word-3 tabular-nums"
787
- }, " #" + B(an.value[x]), 9, ht)) : j("", !0),
793
+ }, " #" + B(cn.value[x]), 9, ht)) : j("", !0),
788
794
  e.showMessageTokensCount && u.metadata?.totalTokens ? (R(), M("span", gt, [P(r, {
789
795
  name: "ri:ai-generate-2-line",
790
796
  class: "shrink-0"
@@ -813,7 +819,7 @@ var Ye = ["aria-busy"], Xe = {
813
819
  key: 0,
814
820
  ref_for: !0,
815
821
  ref_key: "feedbackMessageEl",
816
- ref: ln,
822
+ ref: fn,
817
823
  loading: e.feedbackLoading,
818
824
  submitted: e.feedbackSubmitted,
819
825
  error: e.feedbackError,
@@ -830,12 +836,13 @@ var Ye = ["aria-busy"], Xe = {
830
836
  ], 64))), 128)),
831
837
  P(O, {
832
838
  appear: "",
833
- name: "pk-chatbot-part"
839
+ name: "pk-chatbot-part",
840
+ onLeave: Kt
834
841
  }, {
835
- default: U(() => [Ht.value ? (R(), M("div", {
842
+ default: U(() => [Wt.value ? (R(), M("div", {
836
843
  key: 0,
837
844
  class: "pk-chatbot-message pk-chatbot-message--assistant pk-chatbot-message--loading",
838
- style: Ce({ minHeight: Ut.value ? `${J.value}px` : void 0 })
845
+ style: Ce({ minHeight: Gt.value ? `${J.value}px` : void 0 })
839
846
  }, [N("div", xt, [N("div", St, [P(r, {
840
847
  name: "loading-loop",
841
848
  class: "shrink-0"
@@ -846,7 +853,7 @@ var Ye = ["aria-busy"], Xe = {
846
853
  appear: "",
847
854
  name: "pk-chatbot-part"
848
855
  }, {
849
- default: U(() => [Vt.value ? (R(), A(ue, {
856
+ default: U(() => [Ut.value ? (R(), A(ue, {
850
857
  key: 0,
851
858
  error: e.error,
852
859
  onRetry: n[3] ||= (e) => t.$emit("auto-retry"),
@@ -854,7 +861,7 @@ var Ye = ["aria-busy"], Xe = {
854
861
  }, null, 8, ["error"])) : j("", !0)]),
855
862
  _: 1
856
863
  }),
857
- Rt.value?.role === "user" && !Ut.value || Vt.value ? (R(), M("div", {
864
+ Bt.value?.role === "user" && !Gt.value || Ut.value ? (R(), M("div", {
858
865
  key: 0,
859
866
  class: "pk-chatbot-messages__spacer",
860
867
  style: Ce({ minHeight: `${J.value}px` })
@@ -878,4 +885,4 @@ var Ye = ["aria-busy"], Xe = {
878
885
  //#endregion
879
886
  export { Tt as t };
880
887
 
881
- //# sourceMappingURL=PkChatbotMessages-Bni4EjEB.js.map
888
+ //# sourceMappingURL=PkChatbotMessages-B2e1MQ_d.js.map