@8wave/ai-elements 0.115.0-beta.13 → 0.115.0-beta.16
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.
- package/dist/ai-elements.es.js +1609 -1560
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-DtyZYAzj.js → PkChatbot-Cw5sScma.js} +6 -6
- package/dist-vue/_chunks/{PkChatbot-DtyZYAzj.js.map → PkChatbot-Cw5sScma.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-CrhRrcBs.js → PkChatbotMessages-62rYpwcM.js} +108 -99
- package/dist-vue/_chunks/PkChatbotMessages-62rYpwcM.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewChat-B13nCznB.js → PkChatbotViewChat-ML8aaCVN.js} +4 -4
- package/dist-vue/_chunks/{PkChatbotViewChat-B13nCznB.js.map → PkChatbotViewChat-ML8aaCVN.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-CHpN4vhm.js → PkChatbotViewConversations-DvmRjVND.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-CHpN4vhm.js.map → PkChatbotViewConversations-DvmRjVND.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-cRyG5X3P.js → PkChatbotViewFiles-DrMUsTv5.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewFiles-cRyG5X3P.js.map → PkChatbotViewFiles-DrMUsTv5.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-CosaHA-g.js → PkChatbotViewProfile-C1eLHU7x.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-CosaHA-g.js.map → PkChatbotViewProfile-C1eLHU7x.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-BnbkymPD.js → PkToolShowDiagram-CssUiP3o.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-BnbkymPD.js.map → PkToolShowDiagram-CssUiP3o.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-BlWs282E.js → createChatbotApiClient-BJz36z7v.js} +110 -110
- package/dist-vue/_chunks/createChatbotApiClient-BJz36z7v.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-CMo47fnS.js → useChatbotStore-D3Q1ZgQg.js} +2 -2
- package/dist-vue/_chunks/{useChatbotStore-CMo47fnS.js.map → useChatbotStore-D3Q1ZgQg.js.map} +1 -1
- package/dist-vue/api.js +1 -1
- package/dist-vue/composables.js +50 -10
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +11 -10
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +2 -0
- package/dist-vue/packages/components/src/chat/PkChatbotMessages.d.ts +5 -0
- package/dist-vue/packages/models/src/schema/AgentApiTool.d.ts +40 -8
- package/dist-vue/packages/models/src/schema/ConversationAnalysis.d.ts +6 -1
- package/dist-vue/packages/models/src/schema/McpServer.d.ts +56 -0
- package/dist-vue/packages/models/src/schema/Notification.d.ts +2 -0
- package/package.json +1 -1
- package/dist-vue/_chunks/PkChatbotMessages-CrhRrcBs.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-BlWs282E.js.map +0 -1
|
@@ -20,7 +20,7 @@ var U = (e) => e.normalize("NFD").replace(/[\u0300-\u036f]/g, ""), ye = (e) => e
|
|
|
20
20
|
showCalendarEvent: j(() => import("./PkToolShowCalendarEvent-BsBdsbV0.js").then((e) => e.n)),
|
|
21
21
|
showComparison: j(() => import("./PkToolShowComparison-DQs3E6-k.js").then((e) => e.n)),
|
|
22
22
|
showContactForm: j(() => import("./PkToolShowContactForm-1TFKvG_s.js").then((e) => e.n)),
|
|
23
|
-
showDiagram: j(() => import("./PkToolShowDiagram-
|
|
23
|
+
showDiagram: j(() => import("./PkToolShowDiagram-CssUiP3o.js")),
|
|
24
24
|
showEmail: j(() => import("./PkToolShowEmail-BDsBoETQ.js").then((e) => e.n)),
|
|
25
25
|
showImageGallery: j(() => import("./PkToolShowImageGallery-DudQzBx4.js").then((e) => e.n)),
|
|
26
26
|
showLocation: j(() => import("./PkToolShowLocation-Bv6sLN5P.js").then((e) => e.n)),
|
|
@@ -219,13 +219,13 @@ var ke = ["aria-busy"], Ae = {
|
|
|
219
219
|
}, He = ["datetime", "title"], Ue = { class: "truncate" }, We = {
|
|
220
220
|
key: 0,
|
|
221
221
|
class: "flex items-center gap-4 min-w-0"
|
|
222
|
-
}, Ge = { class: "truncate" }, Ke = {
|
|
223
|
-
key:
|
|
222
|
+
}, Ge = { class: "truncate" }, Ke = ["title"], qe = {
|
|
223
|
+
key: 2,
|
|
224
224
|
class: "flex items-center gap-4 text-12 text-word-3"
|
|
225
|
-
},
|
|
226
|
-
key:
|
|
225
|
+
}, Je = { class: "truncate" }, Ye = ["datetime"], Xe = { class: "truncate" }, Ze = {
|
|
226
|
+
key: 4,
|
|
227
227
|
class: "flex items-center gap-4 text-12 text-word-3"
|
|
228
|
-
},
|
|
228
|
+
}, Qe = { class: "pk-chatbot-message__loading-info" }, $e = { class: "flex gap-8 items-center" }, et = { class: "text-12" }, tt = ["title", "aria-label"], nt = /* @__PURE__ */ M({
|
|
229
229
|
__name: "PkChatbotMessages",
|
|
230
230
|
props: {
|
|
231
231
|
status: {},
|
|
@@ -240,6 +240,7 @@ var ke = ["aria-busy"], Ae = {
|
|
|
240
240
|
disableHeightAdjustment: { type: Boolean },
|
|
241
241
|
showMessageDateTime: { type: Boolean },
|
|
242
242
|
showMessageTokensCount: { type: Boolean },
|
|
243
|
+
showMessageNumber: { type: Boolean },
|
|
243
244
|
showAllMessageParts: { type: Boolean },
|
|
244
245
|
interactive: { type: Boolean },
|
|
245
246
|
showExtendedSteps: { type: Boolean },
|
|
@@ -283,99 +284,102 @@ var ke = ["aria-busy"], Ae = {
|
|
|
283
284
|
id: n,
|
|
284
285
|
approved: t
|
|
285
286
|
});
|
|
286
|
-
}, W = _e("scrollEl"), G = _e("wrapperEl"), we = T(() => u(j.textColor, j.mainColor)), { handleScroll: Te, scrollToBottom: De, userScrolledUp: K, isAtBottom:
|
|
287
|
+
}, W = _e("scrollEl"), G = _e("wrapperEl"), we = T(() => u(j.textColor, j.mainColor)), { handleScroll: Te, scrollToBottom: De, userScrolledUp: K, isAtBottom: nt } = Oe({
|
|
287
288
|
scrollEl: W,
|
|
288
289
|
status: () => j.status,
|
|
289
290
|
messagesLength: () => j.messages?.length,
|
|
290
291
|
lastMessageRole: () => j.messages?.[j.messages.length - 1]?.role,
|
|
291
292
|
contentEl: () => G.value,
|
|
292
|
-
beforeNewMessageScroll: () =>
|
|
293
|
+
beforeNewMessageScroll: () => ut(),
|
|
293
294
|
onScrollUp: () => M("scroll-up"),
|
|
294
295
|
onScrollDown: () => M("scroll-down")
|
|
295
|
-
}),
|
|
296
|
+
}), rt = () => {
|
|
296
297
|
K.value = !1, De();
|
|
297
298
|
}, q = T(() => (j.messages ?? []).filter((e) => e.role === "user").map((e) => ({
|
|
298
299
|
id: e.id,
|
|
299
300
|
preview: e.parts.find(o)?.text.trim().slice(0, 120) || "…"
|
|
300
|
-
}))),
|
|
301
|
+
}))), it = L(), at = () => W.value?.querySelectorAll(".pk-chatbot-message--user") ?? [], ot = () => {
|
|
301
302
|
let e = W.value;
|
|
302
303
|
if (!e || !j.showScrollToBottom) return;
|
|
303
304
|
let t = e.getBoundingClientRect().top + e.clientHeight / 2, n = q.value[0]?.id;
|
|
304
|
-
|
|
305
|
+
at().forEach((e, r) => {
|
|
305
306
|
e.getBoundingClientRect().top <= t && (n = q.value[r]?.id);
|
|
306
|
-
}),
|
|
307
|
+
}), it.value = n;
|
|
307
308
|
};
|
|
308
309
|
B(q, async () => {
|
|
309
|
-
await N(),
|
|
310
|
+
await N(), ot();
|
|
310
311
|
});
|
|
311
|
-
let
|
|
312
|
-
Te(),
|
|
313
|
-
},
|
|
314
|
-
let t = W.value, n = q.value.findIndex((t) => t.id === e), r =
|
|
312
|
+
let st = () => {
|
|
313
|
+
Te(), ot();
|
|
314
|
+
}, ct = (e) => {
|
|
315
|
+
let t = W.value, n = q.value.findIndex((t) => t.id === e), r = at()[n];
|
|
315
316
|
t && r && (K.value = !0, t.scrollTo({
|
|
316
317
|
top: t.scrollTop + r.getBoundingClientRect().top - t.getBoundingClientRect().top - Number.parseFloat(getComputedStyle(t).paddingTop),
|
|
317
318
|
behavior: "smooth"
|
|
318
319
|
}));
|
|
319
|
-
}, J = L(0),
|
|
320
|
+
}, J = L(0), lt = L(!1), ut = async () => {
|
|
320
321
|
let e = j.messages;
|
|
321
|
-
if (!e?.length || j.disableHeightAdjustment || e[e.length - 1].role !== "user" && j.status !== "submitted" && j.status !== "streaming" || (
|
|
322
|
-
let { paddingTop: t, paddingBottom: n } = getComputedStyle(W.value), r = W.value.clientHeight - Number.parseFloat(t) - Number.parseFloat(n), i = G.value && Number.parseFloat(getComputedStyle(G.value).rowGap) || 0, a =
|
|
322
|
+
if (!e?.length || j.disableHeightAdjustment || e[e.length - 1].role !== "user" && j.status !== "submitted" && j.status !== "streaming" || (lt.value = !1, await N(), !W.value)) return;
|
|
323
|
+
let { paddingTop: t, paddingBottom: n } = getComputedStyle(W.value), r = W.value.clientHeight - Number.parseFloat(t) - Number.parseFloat(n), i = G.value && Number.parseFloat(getComputedStyle(G.value).rowGap) || 0, a = at(), o = r - (a[a.length - 1]?.clientHeight ?? 0) - i;
|
|
323
324
|
r > 0 && (J.value = Math.max(o, 0)), await N();
|
|
324
325
|
};
|
|
325
|
-
B(() => [j.messages?.length, j.messages?.[j.messages.length - 1]?.id], () =>
|
|
326
|
-
(j.status === "submitted" || j.status === "streaming" || j.awaitingSpokenAnswer) &&
|
|
326
|
+
B(() => [j.messages?.length, j.messages?.[j.messages.length - 1]?.id], () => ut()), fe(() => {
|
|
327
|
+
(j.status === "submitted" || j.status === "streaming" || j.awaitingSpokenAnswer) && ut();
|
|
327
328
|
}), B(() => j.status, (e) => {
|
|
328
|
-
(e === "ready" || e === "error") && (
|
|
329
|
+
(e === "ready" || e === "error") && (lt.value = !0, J.value = 0);
|
|
329
330
|
});
|
|
330
|
-
let
|
|
331
|
-
let t =
|
|
331
|
+
let dt = (e) => j.revisedAnswers?.some((t) => t.messageId === e), Y = (e) => j.messageFeedbacks?.find((t) => t.messageId === e), ft = (e, t) => !j.readonlyFeedback && At(e, t), pt = (e) => j.readonlyFeedback ? Y(e) : void 0, mt = (e) => pt(e)?.vote, ht = (e) => {
|
|
332
|
+
let t = pt(e);
|
|
332
333
|
if (t?.vote) return;
|
|
333
334
|
let n = t?.metadata?.reactionEmoji;
|
|
334
335
|
return typeof n == "string" && /\p{Extended_Pictographic}/u.test(n) ? n : void 0;
|
|
335
|
-
},
|
|
336
|
-
if (
|
|
337
|
-
let t =
|
|
336
|
+
}, gt = (e) => !!(mt(e) || ht(e)), _t = (e) => {
|
|
337
|
+
if (ht(e)) return "pk-chatbot-message__reaction--neutral";
|
|
338
|
+
let t = mt(e);
|
|
338
339
|
return t === "upvote" ? "pk-chatbot-message__reaction--positive" : t === "downvote" ? "pk-chatbot-message__reaction--negative" : "pk-chatbot-message__reaction--neutral";
|
|
339
|
-
}, _t = (e) => {
|
|
340
|
-
let t = pt(e);
|
|
341
|
-
return F(t === "upvote" ? "hint.userFeedbackPositive" : t === "downvote" ? "hint.userFeedbackNegative" : "hint.userFeedbackReaction");
|
|
342
340
|
}, vt = (e) => {
|
|
343
|
-
let t =
|
|
341
|
+
let t = mt(e);
|
|
342
|
+
return F(t === "upvote" ? "hint.userFeedbackPositive" : t === "downvote" ? "hint.userFeedbackNegative" : "hint.userFeedbackReaction");
|
|
343
|
+
}, yt = (e) => {
|
|
344
|
+
let t = St(e);
|
|
344
345
|
for (let e = t.length - 1; e >= 0; --e) if (o(t[e])) return e;
|
|
345
346
|
return -1;
|
|
346
|
-
},
|
|
347
|
-
let e =
|
|
347
|
+
}, bt = T(() => j.messages?.[j.messages.length - 1]), X = T(() => {
|
|
348
|
+
let e = bt.value;
|
|
348
349
|
return e ? e.parts[e.parts.length - 1] : null;
|
|
349
|
-
}),
|
|
350
|
+
}), xt = T(() => {
|
|
350
351
|
let e = /* @__PURE__ */ new Map();
|
|
351
352
|
for (let t of j.messages ?? []) t.role === "assistant" && e.set(t.id, g(ne(t.parts)));
|
|
352
353
|
return e;
|
|
353
|
-
}),
|
|
354
|
+
}), St = (e) => xt.value.get(e.id) ?? e.parts, Z = T(() => j.status === "submitted" || j.status === "streaming"), Ct = T(() => j.status === "error"), wt = T(() => j.awaitingSpokenAnswer === !0 && !Z.value), Tt = T(() => wt.value && bt.value?.role === "user" && !Ct.value), Et = T(() => {
|
|
354
355
|
let e = X.value;
|
|
355
356
|
return te(F, e);
|
|
356
|
-
}),
|
|
357
|
+
}), Dt = T(() => {
|
|
357
358
|
let e = X.value;
|
|
358
359
|
return v(e);
|
|
359
|
-
}),
|
|
360
|
+
}), Ot = (e) => j.messages?.findIndex((t) => t.id === e), Q = (e) => e === void 0 || !j.messages ? !1 : e === j.messages.length - 1, kt = (e) => Q(e) && j.status === "ready" && !!j.actions?.includes("regenerate"), At = (e, t) => (!Q(t) || j.status === "ready") && !!j.actions?.includes(e), jt = (e) => {
|
|
360
361
|
let t = e.parts[e.parts.length - 1];
|
|
361
362
|
return o(t);
|
|
362
|
-
},
|
|
363
|
-
let t =
|
|
363
|
+
}, Mt = (e) => e.parts.some((e) => i(e) || r(e)), Nt = (e) => !!j.showExtendedSteps && $(e) && Mt(e), Pt = (e) => r(e) && !y(e) && !!(Ce[a(e)] || xe[e.type] || j.showAllMessageParts), Ft = (e) => e.parts.some((e) => o(e) && !!e.text.trim() || n(e) || d(e) && !y(e) || Pt(e)), $ = (e) => e.role === "assistant", It = (e) => e.role === "user", Lt = (e) => j.messages?.slice(0, e).reverse().find((e) => $(e)), Rt = (e) => j.messages?.slice(e + 1).find((e) => $(e)), zt = (e) => {
|
|
364
|
+
let t = Lt(e)?.metadata?.createdAt, n = Rt(e)?.metadata?.createdAt;
|
|
364
365
|
if (!t || !n) return;
|
|
365
366
|
let r = new Date(t), i = new Date(n);
|
|
366
367
|
return r.toDateString() === i.toDateString() ? void 0 : i;
|
|
367
|
-
},
|
|
368
|
+
}, Bt = T(() => {
|
|
369
|
+
let e = 0;
|
|
370
|
+
return (j.messages ?? []).map((t) => t.parts.length > 0 ? ++e : void 0);
|
|
371
|
+
}), Vt = (e, t) => t === 0 || e.role !== "assistant" ? !1 : !!(j.actions?.length || j.showMessageNumber || j.showMessageDateTime && e.metadata?.createdAt !== void 0 || e.metadata?.completedAt !== void 0 || j.showMessageTokensCount && e.metadata?.totalTokens !== void 0), Ht = (e) => {
|
|
368
372
|
let t = new Date(e), n = t.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
|
|
369
373
|
return U(t, n ? "time" : "date-time");
|
|
370
|
-
},
|
|
374
|
+
}, Ut = (e) => {
|
|
371
375
|
let { createdAt: t, completedAt: n } = e.metadata ?? {};
|
|
372
376
|
if (t && n) return p(ye, n - t);
|
|
373
|
-
},
|
|
377
|
+
}, Wt = _e("feedbackMessageEl");
|
|
374
378
|
return B(() => j.feedbackMessageId, async () => {
|
|
375
379
|
if (await N(), !j.feedbackMessageId) return;
|
|
376
|
-
let e =
|
|
380
|
+
let e = Wt.value?.[0]?.$el;
|
|
377
381
|
if (e) {
|
|
378
|
-
if (Q(
|
|
382
|
+
if (Q(Ot(j.feedbackMessageId))) {
|
|
379
383
|
De();
|
|
380
384
|
return;
|
|
381
385
|
}
|
|
@@ -389,7 +393,7 @@ var ke = ["aria-busy"], Ae = {
|
|
|
389
393
|
return I(), O("div", {
|
|
390
394
|
ref_key: "scrollEl",
|
|
391
395
|
ref: W,
|
|
392
|
-
class: P(["pk-chatbot-messages", { "pk-chatbot-messages--settling":
|
|
396
|
+
class: P(["pk-chatbot-messages", { "pk-chatbot-messages--settling": lt.value }]),
|
|
393
397
|
role: "log",
|
|
394
398
|
"aria-live": "polite",
|
|
395
399
|
"aria-relevant": "additions text",
|
|
@@ -398,32 +402,32 @@ var ke = ["aria-busy"], Ae = {
|
|
|
398
402
|
"--chatbot-main-color": e.mainColor,
|
|
399
403
|
"--chatbot-contrast-color": we.value
|
|
400
404
|
}),
|
|
401
|
-
onScroll:
|
|
405
|
+
onScroll: st
|
|
402
406
|
}, [
|
|
403
407
|
e.showScrollToBottom && q.value.length > 1 ? (I(), O("div", Ae, [A(S, {
|
|
404
408
|
items: q.value,
|
|
405
|
-
"active-id":
|
|
406
|
-
onSelect:
|
|
409
|
+
"active-id": it.value,
|
|
410
|
+
onSelect: ct
|
|
407
411
|
}, null, 8, ["items", "active-id"])])) : D("", !0),
|
|
408
412
|
k("div", {
|
|
409
413
|
ref_key: "wrapperEl",
|
|
410
414
|
ref: G,
|
|
411
415
|
class: "pk-chatbot-messages__wrapper"
|
|
412
416
|
}, [
|
|
413
|
-
(I(!0), O(C, null, pe(e.messages, (c, g) => (I(), O(C, { key: c.id }, [
|
|
417
|
+
(I(!0), O(C, null, pe(e.messages, (c, g) => (I(), O(C, { key: c.id }, [It(c) && zt(g) ? (I(), O("div", je, [k("span", Me, R(z(U)(zt(g), "short")), 1)])) : D("", !0), c.parts.length || Q(g) && Z.value && $(c) ? (I(), O("div", {
|
|
414
418
|
key: 1,
|
|
415
419
|
class: P(["pk-chatbot-message", [`pk-chatbot-message--${c.role}`, { "pk-chatbot-message--loading": Z.value && Q(g) && $(c) }]]),
|
|
416
|
-
style: de({ minHeight: Q(g) && $(c) && !
|
|
420
|
+
style: de({ minHeight: Q(g) && $(c) && !Ct.value ? `${J.value}px` : void 0 })
|
|
417
421
|
}, [
|
|
418
422
|
A(w, {
|
|
419
423
|
appear: "",
|
|
420
424
|
name: "pk-chatbot-part"
|
|
421
425
|
}, {
|
|
422
|
-
default: V(() => [
|
|
426
|
+
default: V(() => [Nt(c) ? (I(), E(x, {
|
|
423
427
|
key: 0,
|
|
424
428
|
message: c,
|
|
425
429
|
"is-streaming": Z.value && Q(g),
|
|
426
|
-
"has-content":
|
|
430
|
+
"has-content": Ft(c),
|
|
427
431
|
"is-dark": e.isDark
|
|
428
432
|
}, null, 8, [
|
|
429
433
|
"message",
|
|
@@ -433,7 +437,7 @@ var ke = ["aria-busy"], Ae = {
|
|
|
433
437
|
])) : D("", !0)]),
|
|
434
438
|
_: 2
|
|
435
439
|
}, 1024),
|
|
436
|
-
(I(!0), O(C, null, pe(
|
|
440
|
+
(I(!0), O(C, null, pe(St(c), (i, l) => (I(), O(C, { key: l }, [z(o)(i) && i.text.trim() ? (I(), E(w, {
|
|
437
441
|
key: 0,
|
|
438
442
|
appear: "",
|
|
439
443
|
name: "pk-chatbot-part"
|
|
@@ -453,13 +457,13 @@ var ke = ["aria-busy"], Ae = {
|
|
|
453
457
|
"markdown",
|
|
454
458
|
"is-dark",
|
|
455
459
|
"loading"
|
|
456
|
-
])) : (I(), O(C, { key: 1 }, [le(R(i.text), 1)], 64))]),
|
|
460
|
+
])) : (I(), O(C, { key: 1 }, [le(R(i.text), 1)], 64))]), gt(c.id) && !Y(c.id)?.comment && l === yt(c) ? (I(), O("span", {
|
|
457
461
|
key: 0,
|
|
458
|
-
class: P(["pk-chatbot-message__reaction",
|
|
459
|
-
title:
|
|
460
|
-
}, [
|
|
462
|
+
class: P(["pk-chatbot-message__reaction", _t(c.id)]),
|
|
463
|
+
title: vt(c.id)
|
|
464
|
+
}, [ht(c.id) ? (I(), O("span", Fe, R(ht(c.id)), 1)) : (I(), E(u, {
|
|
461
465
|
key: 1,
|
|
462
|
-
name:
|
|
466
|
+
name: mt(c.id) === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-up-fill"
|
|
463
467
|
}, null, 8, ["name"]))], 10, Pe)) : D("", !0)])]),
|
|
464
468
|
_: 2
|
|
465
469
|
}, 1024)) : z(n)(i) ? (I(), E(w, {
|
|
@@ -497,7 +501,7 @@ var ke = ["aria-busy"], Ae = {
|
|
|
497
501
|
"onRespond"
|
|
498
502
|
]))]),
|
|
499
503
|
_: 2
|
|
500
|
-
}, 1024)) :
|
|
504
|
+
}, 1024)) : Pt(i) ? (I(), E(w, {
|
|
501
505
|
key: 3,
|
|
502
506
|
appear: "",
|
|
503
507
|
name: "pk-chatbot-part"
|
|
@@ -517,7 +521,7 @@ var ke = ["aria-busy"], Ae = {
|
|
|
517
521
|
}, null, 8, ["name"])) : D("", !0), k("code", Re, R(z(be)(i.type)), 1)])])) : D("", !0)], void 0, 1)]),
|
|
518
522
|
_: 2
|
|
519
523
|
}, 1024)) : D("", !0), A(w, { mode: "out-in" }, {
|
|
520
|
-
default: V(() => [l ===
|
|
524
|
+
default: V(() => [l === yt(c) && e.readonlyFeedback && Y(c.id)?.comment ? (I(), E(ae, {
|
|
521
525
|
key: 0,
|
|
522
526
|
feedback: Y(c.id)
|
|
523
527
|
}, null, 8, ["feedback"])) : D("", !0)]),
|
|
@@ -527,7 +531,7 @@ var ke = ["aria-busy"], Ae = {
|
|
|
527
531
|
name: "fade-in",
|
|
528
532
|
mode: "out-in"
|
|
529
533
|
}, {
|
|
530
|
-
default: V(() => [Z.value && Q(g) && !
|
|
534
|
+
default: V(() => [Z.value && Q(g) && !jt(c) && $(c) && (!Nt(c) || Ft(c)) ? (I(), O("div", {
|
|
531
535
|
key: `loading-info-${c.id}`,
|
|
532
536
|
class: "pk-chatbot-message__loading-info"
|
|
533
537
|
}, [k("div", ze, [
|
|
@@ -536,25 +540,25 @@ var ke = ["aria-busy"], Ae = {
|
|
|
536
540
|
class: "shrink-0"
|
|
537
541
|
}),
|
|
538
542
|
A(w, { mode: "out-in" }, {
|
|
539
|
-
default: V(() => [
|
|
540
|
-
key:
|
|
543
|
+
default: V(() => [Dt.value ? (I(), E(u, {
|
|
544
|
+
key: Dt.value,
|
|
541
545
|
class: "shrink-0",
|
|
542
|
-
name:
|
|
546
|
+
name: Dt.value
|
|
543
547
|
}, null, 8, ["name"])) : D("", !0)]),
|
|
544
548
|
_: 1
|
|
545
549
|
}),
|
|
546
550
|
A(w, { mode: "out-in" }, {
|
|
547
|
-
default: V(() => [
|
|
548
|
-
key:
|
|
551
|
+
default: V(() => [Et.value ? (I(), O("span", {
|
|
552
|
+
key: Et.value,
|
|
549
553
|
class: "text-12"
|
|
550
|
-
}, R(
|
|
554
|
+
}, R(Et.value), 1)) : D("", !0)]),
|
|
551
555
|
_: 1
|
|
552
556
|
})
|
|
553
557
|
]), A(w, {
|
|
554
558
|
name: "fade-in",
|
|
555
559
|
mode: "out-in"
|
|
556
560
|
}, {
|
|
557
|
-
default: V(() => [!
|
|
561
|
+
default: V(() => [!Nt(c) && X.value && "text" in X.value && X.value.text.trim() ? (I(), E(b, {
|
|
558
562
|
key: 0,
|
|
559
563
|
markdown: X.value.text,
|
|
560
564
|
"is-dark": e.isDark,
|
|
@@ -571,14 +575,14 @@ var ke = ["aria-busy"], Ae = {
|
|
|
571
575
|
_: 2
|
|
572
576
|
}, 1024),
|
|
573
577
|
A(w, { mode: "out-in" }, {
|
|
574
|
-
default: V(() => [
|
|
578
|
+
default: V(() => [Vt(c, g) ? (I(), O("div", Be, [
|
|
575
579
|
A(h, {
|
|
576
580
|
modifiers: "compact",
|
|
577
581
|
class: "mr-auto shrink-0"
|
|
578
582
|
}, {
|
|
579
583
|
default: V(() => [
|
|
580
584
|
A(w, { mode: "out-in" }, {
|
|
581
|
-
default: V(() => [
|
|
585
|
+
default: V(() => [kt(g) ? (I(), E(p, {
|
|
582
586
|
key: 0,
|
|
583
587
|
icon: "ri:reset-right-line",
|
|
584
588
|
modifiers: "action-quiet-small",
|
|
@@ -589,7 +593,7 @@ var ke = ["aria-busy"], Ae = {
|
|
|
589
593
|
_: 2
|
|
590
594
|
}, 1024),
|
|
591
595
|
A(w, { mode: "out-in" }, {
|
|
592
|
-
default: V(() => [
|
|
596
|
+
default: V(() => [At("show-info", g) ? (I(), E(p, {
|
|
593
597
|
key: 0,
|
|
594
598
|
icon: "ri:information-line",
|
|
595
599
|
title: z(F)("action.getMoreInfo"),
|
|
@@ -604,13 +608,13 @@ var ke = ["aria-busy"], Ae = {
|
|
|
604
608
|
_: 2
|
|
605
609
|
}, 1024),
|
|
606
610
|
A(w, { mode: "out-in" }, {
|
|
607
|
-
default: V(() => [
|
|
611
|
+
default: V(() => [At("revise", g) ? (I(), E(p, {
|
|
608
612
|
key: 0,
|
|
609
|
-
icon:
|
|
610
|
-
title:
|
|
611
|
-
"aria-label":
|
|
613
|
+
icon: dt(c.id) ? "ri:file-edit-fill" : "ri:file-edit-line",
|
|
614
|
+
title: dt(c.id) ? z(F)("action.editRevise") : z(F)("action.createRevise"),
|
|
615
|
+
"aria-label": dt(c.id) ? z(F)("action.editRevise") : z(F)("action.createRevise"),
|
|
612
616
|
modifiers: "action-quiet-small",
|
|
613
|
-
class: P({ "text-brand":
|
|
617
|
+
class: P({ "text-brand": dt(c.id) }),
|
|
614
618
|
onClick: H((e) => r.$emit("revise", c), ["stop"])
|
|
615
619
|
}, null, 8, [
|
|
616
620
|
"icon",
|
|
@@ -622,7 +626,7 @@ var ke = ["aria-busy"], Ae = {
|
|
|
622
626
|
_: 2
|
|
623
627
|
}, 1024),
|
|
624
628
|
A(w, { mode: "out-in" }, {
|
|
625
|
-
default: V(() => [
|
|
629
|
+
default: V(() => [ft("upvote", g) ? (I(), E(p, {
|
|
626
630
|
key: 0,
|
|
627
631
|
icon: Y(c.id)?.vote === "upvote" ? "ri:thumb-up-fill" : "ri:thumb-up-line",
|
|
628
632
|
title: z(F)("action.upvote"),
|
|
@@ -638,7 +642,7 @@ var ke = ["aria-busy"], Ae = {
|
|
|
638
642
|
_: 2
|
|
639
643
|
}, 1024),
|
|
640
644
|
A(w, { mode: "out-in" }, {
|
|
641
|
-
default: V(() => [
|
|
645
|
+
default: V(() => [ft("downvote", g) ? (I(), E(p, {
|
|
642
646
|
key: 0,
|
|
643
647
|
icon: Y(c.id)?.vote === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-down-line",
|
|
644
648
|
title: z(F)("action.downvote"),
|
|
@@ -654,7 +658,7 @@ var ke = ["aria-busy"], Ae = {
|
|
|
654
658
|
_: 2
|
|
655
659
|
}, 1024),
|
|
656
660
|
A(w, { mode: "out-in" }, {
|
|
657
|
-
default: V(() => [
|
|
661
|
+
default: V(() => [ft("feedback", g) ? (I(), E(p, {
|
|
658
662
|
key: 0,
|
|
659
663
|
icon: Y(c.id)?.comment ? "ri:feedback-fill" : "ri:feedback-line",
|
|
660
664
|
title: z(F)("action.feedback"),
|
|
@@ -679,23 +683,28 @@ var ke = ["aria-busy"], Ae = {
|
|
|
679
683
|
}, [A(u, {
|
|
680
684
|
name: "ri:time-line",
|
|
681
685
|
class: "shrink-0"
|
|
682
|
-
}), k("span", Ue, R(
|
|
686
|
+
}), k("span", Ue, R(Ht(c.metadata.createdAt)), 1)], 8, He), Ut(c) ? (I(), O("span", We, [A(u, {
|
|
683
687
|
name: "ri:hourglass-line",
|
|
684
688
|
class: "shrink-0"
|
|
685
|
-
}), k("span", Ge, R(
|
|
686
|
-
e.
|
|
689
|
+
}), k("span", Ge, R(Ut(c)), 1)])) : D("", !0)])) : D("", !0),
|
|
690
|
+
e.showMessageNumber ? (I(), O("span", {
|
|
691
|
+
key: 1,
|
|
692
|
+
title: z(F)("label.messageNumber", { n: Bt.value[g] }),
|
|
693
|
+
class: "text-12 text-word-3 tabular-nums"
|
|
694
|
+
}, " #" + R(Bt.value[g]), 9, Ke)) : D("", !0),
|
|
695
|
+
e.showMessageTokensCount && c.metadata?.totalTokens ? (I(), O("span", qe, [A(u, {
|
|
687
696
|
name: "ri:ai-generate-2-line",
|
|
688
697
|
class: "shrink-0"
|
|
689
|
-
}), k("span",
|
|
698
|
+
}), k("span", Je, R(z(ye)(c.metadata.totalTokens, "integer")) + " " + R(z(F)("label.tokens")), 1)])) : D("", !0),
|
|
690
699
|
e.showMessageDateTime && c.metadata?.createdAt ? (I(), O("time", {
|
|
691
|
-
key:
|
|
700
|
+
key: 3,
|
|
692
701
|
datetime: new Date(c.metadata?.createdAt).toISOString(),
|
|
693
702
|
class: "flex items-center gap-4 text-12 text-word-3"
|
|
694
703
|
}, [A(u, {
|
|
695
704
|
name: "ri:time-line",
|
|
696
705
|
class: "shrink-0"
|
|
697
|
-
}), k("span",
|
|
698
|
-
e.showMessageDateTime && c?.metadata?.completedAt && c?.metadata?.createdAt ? (I(), O("div",
|
|
706
|
+
}), k("span", Xe, R(z(U)(new Date(c.metadata?.createdAt), "date-time")), 1)], 8, Ye)) : D("", !0),
|
|
707
|
+
e.showMessageDateTime && c?.metadata?.completedAt && c?.metadata?.createdAt ? (I(), O("div", Ze, [A(u, {
|
|
699
708
|
name: "ri:hourglass-line",
|
|
700
709
|
class: "shrink-0"
|
|
701
710
|
}), A(l, {
|
|
@@ -711,7 +720,7 @@ var ke = ["aria-busy"], Ae = {
|
|
|
711
720
|
key: 0,
|
|
712
721
|
ref_for: !0,
|
|
713
722
|
ref_key: "feedbackMessageEl",
|
|
714
|
-
ref:
|
|
723
|
+
ref: Wt,
|
|
715
724
|
loading: e.feedbackLoading,
|
|
716
725
|
submitted: e.feedbackSubmitted,
|
|
717
726
|
error: e.feedbackError,
|
|
@@ -729,21 +738,21 @@ var ke = ["aria-busy"], Ae = {
|
|
|
729
738
|
appear: "",
|
|
730
739
|
name: "pk-chatbot-part"
|
|
731
740
|
}, {
|
|
732
|
-
default: V(() => [
|
|
741
|
+
default: V(() => [wt.value ? (I(), O("div", {
|
|
733
742
|
key: 0,
|
|
734
743
|
class: "pk-chatbot-message pk-chatbot-message--assistant pk-chatbot-message--loading",
|
|
735
|
-
style: de({ minHeight:
|
|
736
|
-
}, [k("div",
|
|
744
|
+
style: de({ minHeight: Tt.value ? `${J.value}px` : void 0 })
|
|
745
|
+
}, [k("div", Qe, [k("div", $e, [A(u, {
|
|
737
746
|
name: "loading-loop",
|
|
738
747
|
class: "shrink-0"
|
|
739
|
-
}), k("span",
|
|
748
|
+
}), k("span", et, R(z(F)("label.answeringOnTheCall")), 1)])])], 4)) : D("", !0)]),
|
|
740
749
|
_: 1
|
|
741
750
|
}),
|
|
742
751
|
A(w, {
|
|
743
752
|
appear: "",
|
|
744
753
|
name: "pk-chatbot-part"
|
|
745
754
|
}, {
|
|
746
|
-
default: V(() => [
|
|
755
|
+
default: V(() => [Ct.value ? (I(), E(c, {
|
|
747
756
|
key: 0,
|
|
748
757
|
error: e.error,
|
|
749
758
|
onRetry: i[3] ||= (e) => r.$emit("auto-retry"),
|
|
@@ -751,21 +760,21 @@ var ke = ["aria-busy"], Ae = {
|
|
|
751
760
|
}, null, 8, ["error"])) : D("", !0)]),
|
|
752
761
|
_: 1
|
|
753
762
|
}),
|
|
754
|
-
|
|
763
|
+
bt.value?.role === "user" && !Tt.value || Ct.value ? (I(), O("div", {
|
|
755
764
|
key: 0,
|
|
756
765
|
class: "pk-chatbot-messages__spacer",
|
|
757
766
|
style: de({ minHeight: `${J.value}px` })
|
|
758
767
|
}, null, 4)) : D("", !0)
|
|
759
768
|
], 512),
|
|
760
769
|
A(w, { name: "pk-chatbot-messages-fab" }, {
|
|
761
|
-
default: V(() => [e.showScrollToBottom && (z(K) || !z(
|
|
770
|
+
default: V(() => [e.showScrollToBottom && (z(K) || !z(nt)) ? (I(), O("button", {
|
|
762
771
|
key: 0,
|
|
763
772
|
type: "button",
|
|
764
773
|
class: "pk-chatbot-messages__scroll-to-bottom",
|
|
765
774
|
title: z(F)("action.scrollToBottom"),
|
|
766
775
|
"aria-label": z(F)("action.scrollToBottom"),
|
|
767
|
-
onClick:
|
|
768
|
-
}, [A(u, { name: "ri:arrow-down-line" })], 8,
|
|
776
|
+
onClick: rt
|
|
777
|
+
}, [A(u, { name: "ri:arrow-down-line" })], 8, tt)) : D("", !0)]),
|
|
769
778
|
_: 1
|
|
770
779
|
})
|
|
771
780
|
], 46, ke);
|
|
@@ -773,6 +782,6 @@ var ke = ["aria-busy"], Ae = {
|
|
|
773
782
|
}
|
|
774
783
|
});
|
|
775
784
|
//#endregion
|
|
776
|
-
export { xe as a, be as i, Se as n, ye as r,
|
|
785
|
+
export { xe as a, be as i, Se as n, ye as r, nt as t };
|
|
777
786
|
|
|
778
|
-
//# sourceMappingURL=PkChatbotMessages-
|
|
787
|
+
//# sourceMappingURL=PkChatbotMessages-62rYpwcM.js.map
|