@8wave/ai-elements 0.122.0-beta.9 → 0.123.0-beta.1
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/_chunks/PkFilePreview-eKok4xdc.js +211 -0
- package/dist/_chunks/PkFilePreview-eKok4xdc.js.map +1 -0
- package/dist/_chunks/PkStreamingMarkdown-Dc0R0GHe.js.map +1 -1
- package/dist/_chunks/PkToolChatFile-3fYhbFSi.js +222 -0
- package/dist/_chunks/PkToolChatFile-3fYhbFSi.js.map +1 -0
- package/dist/ai-elements.es.js +592 -405
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.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-B7JaLUZw.js → PkChatbot-D3KGDerg.js} +6 -6
- package/dist-vue/_chunks/{PkChatbot-B7JaLUZw.js.map → PkChatbot-D3KGDerg.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotViewChat-BNaSv86u.js +1047 -0
- package/dist-vue/_chunks/PkChatbotViewChat-BNaSv86u.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-4ZJF-y5q.js → PkChatbotViewConversations-C1vl8z4o.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-4ZJF-y5q.js.map → PkChatbotViewConversations-C1vl8z4o.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-CfPwNcvf.js → PkChatbotViewFiles-DiKHsdPE.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewFiles-CfPwNcvf.js.map → PkChatbotViewFiles-DiKHsdPE.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-Dd8EhOx3.js → PkChatbotViewProfile-CuQ0MAX7.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-Dd8EhOx3.js.map → PkChatbotViewProfile-CuQ0MAX7.js.map} +1 -1
- package/dist-vue/_chunks/PkFilePreview-Cx6jmJCD.js +200 -0
- package/dist-vue/_chunks/PkFilePreview-Cx6jmJCD.js.map +1 -0
- package/dist-vue/_chunks/PkToolChatFile-BJsDSu1Q.js +220 -0
- package/dist-vue/_chunks/PkToolChatFile-BJsDSu1Q.js.map +1 -0
- package/dist-vue/_chunks/{createChatbotApiClient-y6jA42S0.js → createChatbotApiClient-DAh91HyT.js} +4 -1
- package/dist-vue/_chunks/{createChatbotApiClient-y6jA42S0.js.map → createChatbotApiClient-DAh91HyT.js.map} +1 -1
- package/dist-vue/_chunks/{useChatbotStore-DCXyql8U.js → useChatbotStore-D1U24qc8.js} +2 -2
- package/dist-vue/_chunks/{useChatbotStore-DCXyql8U.js.map → useChatbotStore-D1U24qc8.js.map} +1 -1
- package/dist-vue/_chunks/utils-DaAIWTtt.js.map +1 -1
- package/dist-vue/api.js +1 -1
- package/dist-vue/composables.js +60 -2
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +6 -6
- package/dist-vue/locales.js +56 -0
- package/dist-vue/packages/components/src/chat/PkFilePreview.d.ts +28 -0
- package/dist-vue/packages/components/src/chat/PkSpreadsheetPreview.d.ts +15 -0
- package/dist-vue/packages/components/src/chat/PkToolChatFile.d.ts +13 -0
- package/dist-vue/packages/components/src/chat/PkWordPreview.d.ts +16 -0
- package/dist-vue/packages/components/src/chat/PkWordPreviewRuns.d.ts +13 -0
- package/dist-vue/packages/components/src/chat/utils.d.ts +7 -0
- package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +3 -1
- package/dist-vue/packages/models/src/schema/SpreadsheetPreview.d.ts +137 -0
- package/dist-vue/packages/models/src/schema/WordPreview.d.ts +135 -0
- package/dist-vue/packages/models/src/schema/index.d.ts +2 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/PkToolChatFile-BsvJIdgo.js +0 -181
- package/dist/_chunks/PkToolChatFile-BsvJIdgo.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewChat-Djts78Oq.js +0 -921
- package/dist-vue/_chunks/PkChatbotViewChat-Djts78Oq.js.map +0 -1
- package/dist-vue/_chunks/PkToolChatFile-s46esp0O.js +0 -179
- package/dist-vue/_chunks/PkToolChatFile-s46esp0O.js.map +0 -1
|
@@ -0,0 +1,1047 @@
|
|
|
1
|
+
import { t as e } from "./PkChatbotMessages-qkodgdDE.js";
|
|
2
|
+
import { o as t } from "./Media-DylqhvaF.js";
|
|
3
|
+
import { a as n, n as r, t as i } from "./useChatbotStore-D1U24qc8.js";
|
|
4
|
+
import { n as a } from "./src-B-ZKEhTU.js";
|
|
5
|
+
import { c as o, h as s, n as c } from "./utils-DaAIWTtt.js";
|
|
6
|
+
import { t as l } from "./useLocalizedString-Dmn92nix.js";
|
|
7
|
+
import { t as u } from "./PkAvatar-DwtZWSW4.js";
|
|
8
|
+
import { n as d, t as f } from "./PkChatbotInput-BT51V-v4.js";
|
|
9
|
+
import { t as p } from "./PkChatbotQueuedMessages-CIJFAvE2.js";
|
|
10
|
+
import { t as ee } from "./PkChatbotEmptyState-B76oD7fB.js";
|
|
11
|
+
import { t as m } from "./PkChatbotWakeupBar-DEP-d-Fp.js";
|
|
12
|
+
import { VvDialog as h, VvIcon as g } from "@volverjs/ui-vue/components";
|
|
13
|
+
import { Fragment as _, Transition as v, computed as y, createBlock as b, createCommentVNode as x, createElementBlock as S, createElementVNode as C, createSlots as te, createTextVNode as ne, createVNode as w, defineAsyncComponent as T, defineComponent as E, isRef as re, nextTick as ie, normalizeClass as D, onBeforeUnmount as ae, onMounted as oe, onScopeDispose as se, onUnmounted as ce, openBlock as O, provide as le, ref as k, renderList as ue, shallowRef as A, toDisplayString as j, toValue as de, unref as M, useTemplateRef as fe, watch as N, withCtx as P } from "vue";
|
|
14
|
+
import { useI18n as pe } from "vue-i18n";
|
|
15
|
+
import { useDropZone as me, useElementSize as he } from "@vueuse/core";
|
|
16
|
+
import { storeToRefs as ge } from "pinia";
|
|
17
|
+
// ../../packages/composable/src/chatbot/useGreeting.ts
|
|
18
|
+
function _e(e, t) {
|
|
19
|
+
let { locale: n, t: r, te: i } = pe({ useScope: "global" });
|
|
20
|
+
return y(() => ve(de(e)?.greeting?.[0]?.[n.value] ?? "", de(t)) || (i("message.defaultAgentWelcome") ? r("message.defaultAgentWelcome") : ""));
|
|
21
|
+
}
|
|
22
|
+
function ve(e, t) {
|
|
23
|
+
return (t ? e.replace(/\{name\}/g, t) : e.replace(/[,\s]*\{name\}[!?]?/g, "")).trim();
|
|
24
|
+
}
|
|
25
|
+
// ../../packages/components/src/chat/PkAuroraCanvas.vue?vue&type=script&setup=true&lang.ts
|
|
26
|
+
var F = {
|
|
27
|
+
class: "pk-aurora",
|
|
28
|
+
"aria-hidden": "true"
|
|
29
|
+
}, ye = {
|
|
30
|
+
key: 1,
|
|
31
|
+
class: "pk-aurora__fallback"
|
|
32
|
+
}, I = "\nattribute vec2 a_position;\nvoid main() {\n gl_Position = vec4(a_position, 0.0, 1.0);\n}", L = "\nprecision mediump float;\nuniform vec2 u_resolution;\nuniform float u_time;\nuniform vec3 u_color;\nuniform vec2 u_center;\nuniform vec2 u_half;\nuniform float u_spread;\n\nvec3 permute(vec3 x) { return mod(((x * 34.0) + 1.0) * x, 289.0); }\n\nfloat snoise(vec2 v) {\n const vec4 C = vec4(0.211324865405187, 0.366025403784439,\n -0.577350269189626, 0.024390243902439);\n vec2 i = floor(v + dot(v, C.yy));\n vec2 x0 = v - i + dot(i, C.xx);\n vec2 i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n i = mod(i, 289.0);\n vec3 p = permute(permute(i.y + vec3(0.0, i1.y, 1.0))\n + i.x + vec3(0.0, i1.x, 1.0));\n vec3 m = max(0.5 - vec3(dot(x0, x0), dot(x12.xy, x12.xy),\n dot(x12.zw, x12.zw)), 0.0);\n m = m * m;\n m = m * m;\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n m *= 1.79284291400159 - 0.85373472095314 * (a0 * a0 + h * h);\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n\nvoid main() {\n vec2 px = gl_FragCoord.xy;\n vec2 rel = px - u_center;\n\n // Ignition: the ellipse lights up expanding from the center on mount\n float intro = smoothstep(0.0, 1.4, u_time);\n\n // Breathing: size and brightness oscillate gently but visibly\n float breath = 1.0\n + 0.12 * sin(u_time * 0.55)\n + 0.06 * snoise(vec2(u_time * 0.1, 3.7));\n float pulse = 1.0 + 0.2 * sin(u_time * 0.55 + 1.3);\n\n // Keep it simple (Gemini-style): one huge soft elliptical glow\n // centered on the pill\n vec2 radii = vec2(u_half.x * 0.95, u_half.y * 6.5)\n * u_spread\n * breath\n * mix(0.15, 1.0, intro);\n float r = length(rel / max(radii, vec2(1.0)));\n float glow = exp(-r * r * 2.2);\n\n // Never cut hard against the canvas bounds\n vec2 m = min(px, u_resolution - px);\n glow *= smoothstep(0.0, 32.0, min(m.x, m.y));\n\n // Dither: breaks the 8-bit banding rings of the very soft gradient\n // (no CSS blur on the canvas, the noise must fully mask the bands)\n glow = max(glow + (snoise(px * 0.9) - 0.5) * 0.03, 0.0);\n\n float alpha = glow * 0.2 * pulse * intro;\n\n // Premultiplied alpha (default canvas compositing)\n gl_FragColor = vec4(u_color * alpha, alpha);\n}", be = /* @__PURE__ */ E({
|
|
33
|
+
__name: "PkAuroraCanvas",
|
|
34
|
+
props: { sourceSelector: {} },
|
|
35
|
+
setup(e) {
|
|
36
|
+
let t = e, n = fe("canvasEl"), r = k(!1), i = null, a = 0, o = null, s = null, c = null, l = null, u = null, d = null, f = performance.now(), p = (e, t) => {
|
|
37
|
+
if (!i) return null;
|
|
38
|
+
let n = i.createShader(e);
|
|
39
|
+
return !n || (i.shaderSource(n, t), i.compileShader(n), !i.getShaderParameter(n, i.COMPILE_STATUS)) ? null : n;
|
|
40
|
+
}, ee = () => {
|
|
41
|
+
if (!n.value) return null;
|
|
42
|
+
let e = getComputedStyle(n.value).color.match(/rgba?\(([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)/);
|
|
43
|
+
return e ? [
|
|
44
|
+
Number(e[1]) / 255,
|
|
45
|
+
Number(e[2]) / 255,
|
|
46
|
+
Number(e[3]) / 255
|
|
47
|
+
] : null;
|
|
48
|
+
}, m = () => {
|
|
49
|
+
if (!i || !n.value) return;
|
|
50
|
+
let e = Math.min(window.devicePixelRatio || 1, 1.5), { clientWidth: r, clientHeight: a } = n.value;
|
|
51
|
+
n.value.width = Math.max(1, Math.round(r * e)), n.value.height = Math.max(1, Math.round(a * e)), i.viewport(0, 0, n.value.width, n.value.height);
|
|
52
|
+
let o = n.value.parentElement?.offsetParent, s = (t.sourceSelector ? o?.querySelector(t.sourceSelector) : o) ?? o, c = n.value.getBoundingClientRect(), f = s?.getBoundingClientRect();
|
|
53
|
+
if (f && c.width > 0) {
|
|
54
|
+
let e = n.value.width / c.width, t = n.value.height / c.height, r = (f.left + f.width / 2 - c.left) * e, a = (c.bottom - (f.top + f.height / 2)) * t, o = f.width / 2 * e, s = f.height / 2 * t;
|
|
55
|
+
i.uniform2f(l, r, a), i.uniform2f(u, o, s);
|
|
56
|
+
let p = Number.parseFloat(getComputedStyle(n.value).getPropertyValue("--aurora-spread"));
|
|
57
|
+
i.uniform1f(d, Number.isNaN(p) ? 1 : p);
|
|
58
|
+
}
|
|
59
|
+
g(h() ? 10 : void 0);
|
|
60
|
+
}, h = () => window.matchMedia("(prefers-reduced-motion: reduce)").matches, g = (e) => {
|
|
61
|
+
i && n.value && (i.uniform1f(s, e ?? (performance.now() - f) / 1e3), i.uniform2f(c, n.value.width, n.value.height), i.drawArrays(i.TRIANGLE_STRIP, 0, 4));
|
|
62
|
+
}, _ = () => {
|
|
63
|
+
g(), a = requestAnimationFrame(_);
|
|
64
|
+
};
|
|
65
|
+
return oe(() => {
|
|
66
|
+
let e = n.value;
|
|
67
|
+
i = e?.getContext("webgl", { alpha: !0 }) ?? null;
|
|
68
|
+
let t = ee();
|
|
69
|
+
if (!e || !i || !t) {
|
|
70
|
+
r.value = !0;
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
let a = p(i.VERTEX_SHADER, I), f = p(i.FRAGMENT_SHADER, L), v = i.createProgram();
|
|
74
|
+
if (!a || !f || !v || (i.attachShader(v, a), i.attachShader(v, f), i.linkProgram(v), !i.getProgramParameter(v, i.LINK_STATUS))) {
|
|
75
|
+
r.value = !0;
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
i.useProgram(v);
|
|
79
|
+
let y = i.createBuffer();
|
|
80
|
+
i.bindBuffer(i.ARRAY_BUFFER, y), i.bufferData(i.ARRAY_BUFFER, new Float32Array([
|
|
81
|
+
-1,
|
|
82
|
+
-1,
|
|
83
|
+
1,
|
|
84
|
+
-1,
|
|
85
|
+
-1,
|
|
86
|
+
1,
|
|
87
|
+
1,
|
|
88
|
+
1
|
|
89
|
+
]), i.STATIC_DRAW);
|
|
90
|
+
let b = i.getAttribLocation(v, "a_position");
|
|
91
|
+
i.enableVertexAttribArray(b), i.vertexAttribPointer(b, 2, i.FLOAT, !1, 0, 0), s = i.getUniformLocation(v, "u_time"), c = i.getUniformLocation(v, "u_resolution"), l = i.getUniformLocation(v, "u_center"), u = i.getUniformLocation(v, "u_half"), d = i.getUniformLocation(v, "u_spread"), i.uniform3f(i.getUniformLocation(v, "u_color"), ...t), o = new ResizeObserver(m), o.observe(e), m(), ie(m), h() ? g(10) : _();
|
|
92
|
+
}), ae(() => {
|
|
93
|
+
cancelAnimationFrame(a), o?.disconnect();
|
|
94
|
+
}), ce(() => {
|
|
95
|
+
let e = i;
|
|
96
|
+
i = null, setTimeout(() => {
|
|
97
|
+
e?.getExtension("WEBGL_lose_context")?.loseContext();
|
|
98
|
+
}, 150);
|
|
99
|
+
}), (e, t) => (O(), S("div", F, [r.value ? (O(), S("div", ye)) : (O(), S("canvas", {
|
|
100
|
+
key: 0,
|
|
101
|
+
ref_key: "canvasEl",
|
|
102
|
+
ref: n,
|
|
103
|
+
class: "pk-aurora__canvas"
|
|
104
|
+
}, null, 512))]));
|
|
105
|
+
}
|
|
106
|
+
}), R = .18, xe = .35, Se = /* @__PURE__ */ E({
|
|
107
|
+
__name: "PkVoiceOrb",
|
|
108
|
+
props: {
|
|
109
|
+
sample: {},
|
|
110
|
+
spectrum: {
|
|
111
|
+
type: Function,
|
|
112
|
+
default: void 0
|
|
113
|
+
},
|
|
114
|
+
state: {},
|
|
115
|
+
bars: { default: 5 }
|
|
116
|
+
},
|
|
117
|
+
setup(e) {
|
|
118
|
+
let t = e, n = fe("barsEl"), r = Array.from({ length: t.bars }, () => R), i, a = () => typeof window < "u" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches === !0, o = () => {
|
|
119
|
+
let e = Math.min(1, Math.max(0, t.sample())), n = t.spectrum?.(), i = r.length;
|
|
120
|
+
if (!n?.length) {
|
|
121
|
+
let t = Date.now() / 260;
|
|
122
|
+
return Array.from({ length: i }, (n, r) => {
|
|
123
|
+
let i = .65 + .35 * Math.sin(t + r * .9);
|
|
124
|
+
return R + e * 2.4 * i;
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
let a = Math.max(1, Math.floor(n.length / 2)), o = Math.max(1, Math.floor(a / i));
|
|
128
|
+
return Array.from({ length: i }, (e, t) => {
|
|
129
|
+
let r = 0;
|
|
130
|
+
for (let e = 0; e < o; e += 1) r += n[t * o + e] ?? 0;
|
|
131
|
+
return R + r / o / 255 * 2.2;
|
|
132
|
+
});
|
|
133
|
+
}, s = () => {
|
|
134
|
+
let e = n.value?.children;
|
|
135
|
+
e && r.forEach((t, n) => {
|
|
136
|
+
e[n]?.style.setProperty("--pk-voice-orb-scale", String(t));
|
|
137
|
+
});
|
|
138
|
+
}, c = () => {
|
|
139
|
+
let e = o();
|
|
140
|
+
r = r.map((t, n) => t + (Math.min(1, Math.max(R, e[n] ?? R)) - t) * xe), s(), i = requestAnimationFrame(c);
|
|
141
|
+
}, l = () => {
|
|
142
|
+
i !== void 0 && (cancelAnimationFrame(i), i = void 0);
|
|
143
|
+
};
|
|
144
|
+
return N(() => t.state, async (e) => {
|
|
145
|
+
e !== "listening" && e !== "speaking" || a() ? (l(), r = r.map(() => R * 1.6), await ie(), s()) : i === void 0 && (i = requestAnimationFrame(c));
|
|
146
|
+
}, { immediate: !0 }), ae(l), (t, r) => (O(), S("div", {
|
|
147
|
+
class: D(["pk-voice-orb", `pk-voice-orb--${e.state}`]),
|
|
148
|
+
"aria-hidden": "true"
|
|
149
|
+
}, [C("div", {
|
|
150
|
+
ref_key: "barsEl",
|
|
151
|
+
ref: n,
|
|
152
|
+
class: "pk-voice-orb__bars"
|
|
153
|
+
}, [(O(!0), S(_, null, ue(e.bars, (e) => (O(), S("span", {
|
|
154
|
+
key: e,
|
|
155
|
+
class: "pk-voice-orb__bar"
|
|
156
|
+
}))), 128))], 512)], 2));
|
|
157
|
+
}
|
|
158
|
+
}), Ce = {
|
|
159
|
+
key: 0,
|
|
160
|
+
class: "pk-voice-session__badge",
|
|
161
|
+
"aria-hidden": "true"
|
|
162
|
+
}, we = {
|
|
163
|
+
class: "pk-voice-session__status",
|
|
164
|
+
role: "status"
|
|
165
|
+
}, z = {
|
|
166
|
+
key: 0,
|
|
167
|
+
class: "pk-voice-session__live-dot",
|
|
168
|
+
"aria-hidden": "true"
|
|
169
|
+
}, B = ["title"], Te = ["title"], Ee = { class: "pk-voice-session__actions" }, De = /* @__PURE__ */ E({
|
|
170
|
+
__name: "PkVoiceSession",
|
|
171
|
+
props: {
|
|
172
|
+
state: {},
|
|
173
|
+
sample: { type: Function },
|
|
174
|
+
spectrum: { type: Function },
|
|
175
|
+
remainingSeconds: {},
|
|
176
|
+
muted: { type: Boolean },
|
|
177
|
+
error: {},
|
|
178
|
+
rawError: {},
|
|
179
|
+
live: { type: Boolean }
|
|
180
|
+
},
|
|
181
|
+
emits: [
|
|
182
|
+
"toggle-mute",
|
|
183
|
+
"hang-up",
|
|
184
|
+
"retry",
|
|
185
|
+
"dismiss"
|
|
186
|
+
],
|
|
187
|
+
setup(e, { emit: t }) {
|
|
188
|
+
let n = e, r = t, { t: i } = pe({ useScope: "global" }), a = y(() => n.error ? i("message.voiceFailed") : n.state === "connecting" ? i("message.voiceConnecting") : n.state === "speaking" ? i("message.voiceSpeaking") : n.muted ? i("message.voiceMuted") : i("message.voiceListening")), o = y(() => {
|
|
189
|
+
if (n.remainingSeconds === void 0) return;
|
|
190
|
+
let e = Math.floor(n.remainingSeconds / 60), t = n.remainingSeconds % 60;
|
|
191
|
+
return `${e}:${String(t).padStart(2, "0")}`;
|
|
192
|
+
}), s = y(() => n.remainingSeconds !== void 0 && n.remainingSeconds <= 30), c = y(() => !n.error && (n.state === "listening" || n.state === "speaking")), l = y(() => {
|
|
193
|
+
if (c.value) return n.state === "speaking" ? "speaking" : n.muted ? void 0 : "listening";
|
|
194
|
+
});
|
|
195
|
+
return (t, n) => {
|
|
196
|
+
let u = g;
|
|
197
|
+
return O(), S("div", { class: D(["pk-voice-session", { "pk-voice-session--failed": !!e.error }]) }, [
|
|
198
|
+
e.error ? (O(), S("span", Ce, [w(u, { name: "ri:error-warning-line" })])) : (O(), b(Se, {
|
|
199
|
+
key: 1,
|
|
200
|
+
state: e.state,
|
|
201
|
+
sample: e.sample,
|
|
202
|
+
spectrum: e.spectrum
|
|
203
|
+
}, null, 8, [
|
|
204
|
+
"state",
|
|
205
|
+
"sample",
|
|
206
|
+
"spectrum"
|
|
207
|
+
])),
|
|
208
|
+
C("div", we, [C("span", { class: D(["pk-voice-session__state", l.value && `pk-voice-session__state--${l.value}`]) }, [c.value ? (O(), S("span", z)) : x("", !0), ne(" " + j(a.value), 1)], 2), e.error ? (O(), S("p", {
|
|
209
|
+
key: 0,
|
|
210
|
+
class: "pk-voice-session__detail",
|
|
211
|
+
title: e.rawError ?? e.error
|
|
212
|
+
}, j(e.error), 9, B)) : x("", !0)]),
|
|
213
|
+
o.value ? (O(), S("span", {
|
|
214
|
+
key: 2,
|
|
215
|
+
class: D(["pk-voice-session__timer", { "pk-voice-session__timer--warning": s.value }]),
|
|
216
|
+
title: M(i)("hint.voiceRemaining"),
|
|
217
|
+
"aria-hidden": "true"
|
|
218
|
+
}, j(o.value), 11, Te)) : x("", !0),
|
|
219
|
+
C("div", Ee, [e.error ? (O(), S(_, { key: 0 }, [w(d, {
|
|
220
|
+
icon: "ri:refresh-line",
|
|
221
|
+
label: M(i)("action.retry"),
|
|
222
|
+
onClick: n[0] ||= (e) => r("retry")
|
|
223
|
+
}, null, 8, ["label"]), e.live ? (O(), b(d, {
|
|
224
|
+
key: 0,
|
|
225
|
+
icon: "ri:stop-circle-line",
|
|
226
|
+
modifiers: "danger",
|
|
227
|
+
title: M(i)("action.hangUp"),
|
|
228
|
+
"aria-label": M(i)("action.hangUp"),
|
|
229
|
+
onClick: n[1] ||= (e) => r("hang-up")
|
|
230
|
+
}, null, 8, ["title", "aria-label"])) : (O(), b(d, {
|
|
231
|
+
key: 1,
|
|
232
|
+
icon: "ri:close-line",
|
|
233
|
+
label: M(i)("action.close"),
|
|
234
|
+
onClick: n[2] ||= (e) => r("dismiss")
|
|
235
|
+
}, null, 8, ["label"]))], 64)) : (O(), S(_, { key: 1 }, [w(d, {
|
|
236
|
+
icon: e.muted ? "ri:mic-off-line" : "ri:mic-line",
|
|
237
|
+
title: e.muted ? M(i)("action.unmute") : M(i)("action.mute"),
|
|
238
|
+
"aria-label": e.muted ? M(i)("action.unmute") : M(i)("action.mute"),
|
|
239
|
+
"aria-pressed": e.muted,
|
|
240
|
+
onClick: n[3] ||= (e) => r("toggle-mute")
|
|
241
|
+
}, null, 8, [
|
|
242
|
+
"icon",
|
|
243
|
+
"title",
|
|
244
|
+
"aria-label",
|
|
245
|
+
"aria-pressed"
|
|
246
|
+
]), w(d, {
|
|
247
|
+
icon: "ri:stop-circle-line",
|
|
248
|
+
modifiers: "danger",
|
|
249
|
+
title: M(i)("action.hangUp"),
|
|
250
|
+
"aria-label": M(i)("action.hangUp"),
|
|
251
|
+
onClick: n[4] ||= (e) => r("hang-up")
|
|
252
|
+
}, null, 8, ["title", "aria-label"])], 64))])
|
|
253
|
+
], 2);
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
}), Oe = (e) => {
|
|
257
|
+
let t = A(), n = k("disconnected"), r = k("listening"), i = k(), o = k([]), s = k(), c = k(), l, u, d = 0, f = !1, p = () => {
|
|
258
|
+
u &&= (clearInterval(u), void 0), s.value = void 0;
|
|
259
|
+
}, ee = (e) => {
|
|
260
|
+
let t = Date.now() + e * 1e3, n = () => {
|
|
261
|
+
let e = Math.max(0, Math.ceil((t - Date.now()) / 1e3));
|
|
262
|
+
s.value = e, e === 0 && h();
|
|
263
|
+
};
|
|
264
|
+
n(), u = setInterval(n, 1e3);
|
|
265
|
+
}, m = async (t) => {
|
|
266
|
+
t && (l === t && (l = void 0), await e.closeGrant?.(t).catch(() => void 0));
|
|
267
|
+
}, h = async () => {
|
|
268
|
+
d += 1, p();
|
|
269
|
+
let e = l;
|
|
270
|
+
l = void 0;
|
|
271
|
+
let i = t.value;
|
|
272
|
+
t.value = void 0, await i?.endSession().catch(() => void 0), await m(e), n.value = "disconnected", r.value = "listening";
|
|
273
|
+
}, g = async () => {
|
|
274
|
+
if (f || t.value || n.value === "connecting") return;
|
|
275
|
+
i.value = void 0, o.value = [], r.value = "listening", c.value = void 0, n.value = "connecting", d += 1;
|
|
276
|
+
let a = d, s = () => a === d && !f, u;
|
|
277
|
+
try {
|
|
278
|
+
let a = import("./web-BIOlKgFq.js");
|
|
279
|
+
a.catch(() => void 0);
|
|
280
|
+
let d = await e.fetchGrant();
|
|
281
|
+
if (!s()) {
|
|
282
|
+
await e.closeGrant?.(d.sessionId).catch(() => void 0);
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
l = d.sessionId, u = d.sessionId, c.value = d.chatId;
|
|
286
|
+
let { VoiceConversation: f } = await a;
|
|
287
|
+
if (!s()) {
|
|
288
|
+
await m(d.sessionId);
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
let h = await f.startSession({
|
|
292
|
+
signedUrl: d.signedUrl,
|
|
293
|
+
customLlmExtraBody: { voice_session_id: d.sessionId },
|
|
294
|
+
onStatusChange: ({ status: e }) => {
|
|
295
|
+
s() && (n.value = e);
|
|
296
|
+
},
|
|
297
|
+
onModeChange: ({ mode: t }) => {
|
|
298
|
+
if (!s()) return;
|
|
299
|
+
let n = r.value === "speaking";
|
|
300
|
+
r.value = t, n && t !== "speaking" && e.onTurnEnd?.();
|
|
301
|
+
},
|
|
302
|
+
onMessage: ({ message: t, role: n }) => {
|
|
303
|
+
if (!s()) return;
|
|
304
|
+
let r = {
|
|
305
|
+
role: n,
|
|
306
|
+
text: t
|
|
307
|
+
};
|
|
308
|
+
o.value = [...o.value, r], e.onTranscript?.(r);
|
|
309
|
+
},
|
|
310
|
+
onError: (e) => {
|
|
311
|
+
s() && (i.value = e);
|
|
312
|
+
},
|
|
313
|
+
onDisconnect: (a) => {
|
|
314
|
+
s() && (p(), t.value = void 0, n.value = "disconnected", r.value = "listening", a.reason === "error" && (i.value = a.message), m(d.sessionId), e.onTurnEnd?.());
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
if (!s()) {
|
|
318
|
+
await h.endSession().catch(() => void 0), await m(d.sessionId);
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
t.value = h, ee(d.maxSessionSeconds);
|
|
322
|
+
} catch (e) {
|
|
323
|
+
if (await m(u), !s()) return;
|
|
324
|
+
t.value = void 0, p(), n.value = "disconnected", i.value = e instanceof Error ? e.message : String(e);
|
|
325
|
+
}
|
|
326
|
+
}, _ = () => {
|
|
327
|
+
i.value = void 0;
|
|
328
|
+
}, v = (e) => {
|
|
329
|
+
t.value?.setMicMuted(e);
|
|
330
|
+
}, b = (e) => {
|
|
331
|
+
let n = t.value;
|
|
332
|
+
if (!n || !e.trim()) return !1;
|
|
333
|
+
try {
|
|
334
|
+
return n.sendUserMessage(e), !0;
|
|
335
|
+
} catch (e) {
|
|
336
|
+
return a.warn("The spoken answer could not be sent", e), !1;
|
|
337
|
+
}
|
|
338
|
+
}, x = (e) => {
|
|
339
|
+
let n = t.value;
|
|
340
|
+
if (!n) return 0;
|
|
341
|
+
try {
|
|
342
|
+
return e === "input" ? n.getInputVolume() : n.getOutputVolume();
|
|
343
|
+
} catch {
|
|
344
|
+
return 0;
|
|
345
|
+
}
|
|
346
|
+
}, S = (e) => {
|
|
347
|
+
let n = t.value;
|
|
348
|
+
if (n) try {
|
|
349
|
+
return e === "input" ? n.getInputByteFrequencyData() : n.getOutputByteFrequencyData();
|
|
350
|
+
} catch {
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
}, C = () => {
|
|
354
|
+
let e = l;
|
|
355
|
+
l = void 0, d += 1, p(), m(e);
|
|
356
|
+
let r = t.value;
|
|
357
|
+
t.value = void 0, r?.endSession().catch(() => void 0), n.value = "disconnected";
|
|
358
|
+
};
|
|
359
|
+
return typeof window < "u" && window.addEventListener("pagehide", C), se(() => {
|
|
360
|
+
f = !0, typeof window < "u" && window.removeEventListener("pagehide", C), h();
|
|
361
|
+
}), {
|
|
362
|
+
status: n,
|
|
363
|
+
mode: r,
|
|
364
|
+
error: i,
|
|
365
|
+
transcript: o,
|
|
366
|
+
remainingSeconds: s,
|
|
367
|
+
chatId: c,
|
|
368
|
+
isActive: y(() => n.value === "connected" || n.value === "connecting"),
|
|
369
|
+
isConnecting: y(() => n.value === "connecting"),
|
|
370
|
+
isSpeaking: y(() => n.value === "connected" && r.value === "speaking"),
|
|
371
|
+
isListening: y(() => n.value === "connected" && r.value === "listening"),
|
|
372
|
+
start: g,
|
|
373
|
+
stop: h,
|
|
374
|
+
dismissError: _,
|
|
375
|
+
setMuted: v,
|
|
376
|
+
sendUserMessage: b,
|
|
377
|
+
readLevel: x,
|
|
378
|
+
readSpectrum: S
|
|
379
|
+
};
|
|
380
|
+
}, ke = 4e3, Ae = [
|
|
381
|
+
3e3,
|
|
382
|
+
5e3,
|
|
383
|
+
1e4
|
|
384
|
+
], je = 12e4, Me = 3e4;
|
|
385
|
+
function Ne(e) {
|
|
386
|
+
let t = k(null), n = k(!1), r, i = !1, a = () => {
|
|
387
|
+
clearTimeout(r), r = void 0;
|
|
388
|
+
}, o = (e, t) => {
|
|
389
|
+
a(), i || (r = setTimeout(() => void t(), e));
|
|
390
|
+
}, s = (t) => e.messages().some((e) => e.metadata?.wakeup?.id === t);
|
|
391
|
+
async function c() {
|
|
392
|
+
a();
|
|
393
|
+
let n = e.chatId();
|
|
394
|
+
try {
|
|
395
|
+
let r = await e.apiClient().getChatWakeup(e.agentId(), n);
|
|
396
|
+
if (n !== e.chatId()) return;
|
|
397
|
+
t.value = r.pendingWakeup;
|
|
398
|
+
} catch {
|
|
399
|
+
t.value = null;
|
|
400
|
+
}
|
|
401
|
+
let r = t.value;
|
|
402
|
+
if (r) {
|
|
403
|
+
let e = Date.parse(r.dueAt) - Date.now() + ke;
|
|
404
|
+
o(Math.max(ke, e), () => l(r.wakeId, Date.now(), 0));
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
async function l(t, n, r) {
|
|
408
|
+
await e.refreshMessages(), !i && (s(t) || Date.now() - n >= je ? await c() : o(Ae[Math.min(r, Ae.length - 1)], () => l(t, n, r + 1)));
|
|
409
|
+
}
|
|
410
|
+
async function u() {
|
|
411
|
+
n.value = !0;
|
|
412
|
+
try {
|
|
413
|
+
let n = await e.apiClient().stopChatWakeup(e.agentId(), e.chatId());
|
|
414
|
+
a(), t.value = n.pendingWakeup;
|
|
415
|
+
} finally {
|
|
416
|
+
n.value = !1;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
function d() {
|
|
420
|
+
a(), t.value = null;
|
|
421
|
+
}
|
|
422
|
+
let f;
|
|
423
|
+
function p() {
|
|
424
|
+
f = e.chatId();
|
|
425
|
+
}
|
|
426
|
+
function ee() {
|
|
427
|
+
f === e.chatId() && (f = void 0, c());
|
|
428
|
+
}
|
|
429
|
+
function m() {
|
|
430
|
+
f = void 0;
|
|
431
|
+
}
|
|
432
|
+
let h = y(() => e.messages().some((e) => e.role === "user"));
|
|
433
|
+
N([e.chatId, h], ([, t]) => {
|
|
434
|
+
d();
|
|
435
|
+
let n = e.status(), r = n === "submitted" || n === "streaming" || f === e.chatId();
|
|
436
|
+
t && !r && c();
|
|
437
|
+
}, { immediate: !0 }), N(e.status, (e, t) => {
|
|
438
|
+
e === "ready" && t !== "ready" && h.value && c();
|
|
439
|
+
});
|
|
440
|
+
let g;
|
|
441
|
+
function _() {
|
|
442
|
+
t.value && document.visibilityState === "visible" && e.apiClient().markChatWakeupPresence(e.agentId(), e.chatId()).catch(() => void 0);
|
|
443
|
+
}
|
|
444
|
+
let v = () => _();
|
|
445
|
+
return document.addEventListener("visibilitychange", v), N(() => t.value?.wakeId, (e) => {
|
|
446
|
+
clearInterval(g), g = void 0, e && !i && (_(), g = setInterval(_, Me));
|
|
447
|
+
}), ae(() => {
|
|
448
|
+
i = !0, a(), clearInterval(g), document.removeEventListener("visibilitychange", v);
|
|
449
|
+
}), {
|
|
450
|
+
pendingWakeup: t,
|
|
451
|
+
isStopping: n,
|
|
452
|
+
check: c,
|
|
453
|
+
reset: d,
|
|
454
|
+
stop: u,
|
|
455
|
+
spokenTurnStarted: p,
|
|
456
|
+
spokenTurnsWritten: ee,
|
|
457
|
+
forgetSpokenTurns: m
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
// ../../packages/components/src/chat/PkChatbotViewChat.vue?vue&type=script&setup=true&lang.ts
|
|
461
|
+
var Pe = { class: "pk-chatbot-view-chat__input-stage" }, Fe = {
|
|
462
|
+
key: 1,
|
|
463
|
+
class: "p-md border-t border-surface-3 text-center text-12 text-danger bg-surface-danger"
|
|
464
|
+
}, Ie = { class: "pk-chatbot-view-chat__agent-chip" }, Le = {
|
|
465
|
+
key: 0,
|
|
466
|
+
class: "pk-chatbot-view-chat__agent-chip-name"
|
|
467
|
+
}, Re = {
|
|
468
|
+
key: 0,
|
|
469
|
+
class: "pk-chatbot-view-chat__drop-overlay"
|
|
470
|
+
}, ze = {
|
|
471
|
+
key: 1,
|
|
472
|
+
class: "pk-chatbot-view-chat__preview"
|
|
473
|
+
}, Be = 1e3, Ve = 3e3, He = 6e4, Ue = 3e5, We = 6e5, Ge = /* @__PURE__ */ E({
|
|
474
|
+
__name: "PkChatbotViewChat",
|
|
475
|
+
props: {
|
|
476
|
+
agentId: {},
|
|
477
|
+
modifier: {},
|
|
478
|
+
userName: {}
|
|
479
|
+
},
|
|
480
|
+
emits: ["show-info", "revise"],
|
|
481
|
+
setup(a, { emit: d }) {
|
|
482
|
+
let _ = T(() => import("./PkToolShowForm-Fv4iV0VY.js").then((e) => e.n)), ne = T(() => import("./PkToolShowContactForm-xHBTmITM.js").then((e) => e.n)), E = T(() => import("./PkToolShowSuggestedReply-Bnhgsh4l.js").then((e) => e.n)), ie = T(() => import("./PkToolShowSources-C4rKpypf.js").then((e) => e.n)), oe = T(() => import("./PkToolRequestGeolocation-e8vyxTI_.js")), se = T(() => import("./PkToolRequestOAuthConnection-3zLvNF_c.js")), ce = T(() => import("./PkToolShowLocation-Cq0IXye1.js").then((e) => e.n)), ue = T(() => import("./PkToolShowDiagram-DrJs92dg.js")), A = T(() => import("./PkToolChatFile-BJsDSu1Q.js")), de = T(() => import("./PkToolShareDocument-CRghPfep.js").then((e) => e.n)), ve = T(() => import("./PkFilePreview-Cx6jmJCD.js")), F = a, ye = d, I = r(F.agentId), { agentInterface: L, agentFileUpload: R, agentType: xe, agentVoice: Se, actions: Ce, revisedAnswers: we, messages: z, chat: B, messageFeedbacks: Te, feedbackDialogMessage: Ee, isFeedbackSubmitting: ke, isFeedbackSubmitted: Ae, feedbackSubmitError: je, isLeadSubmitted: Me, isLoadingSubmitLead: Ge, submitLeadError: Ke, input: V, inputMessagePlaceholder: qe, isConversationBlocked: Je, baseUrl: Ye, pendingAttachments: Xe, isAttachmentLimitReached: Ze, fileLimitError: Qe, apiClient: H, isDark: $e, hostToolsPending: et, pageNoticeLevel: tt, hostConfirmation: nt, agentPageAccess: rt, hostStepTitles: it, canQueue: at, queuedMessages: ot, backgroundAnswers: st, inputFocusRequest: ct } = ge(I);
|
|
483
|
+
le(c, it);
|
|
484
|
+
let lt = fe("inputEl");
|
|
485
|
+
N(ct, () => {
|
|
486
|
+
lt.value?.focus();
|
|
487
|
+
});
|
|
488
|
+
let U = y(() => xe.value === "reasoning" ? void 0 : R.value), W = (e) => H.value.getMediaDownloadUrl(F.agentId, I.localChatId, e), { handleSubmit: ut, stopGeneration: dt, regenerate: ft, onUpvote: pt, onDownvote: mt, onFeedback: ht, onFeedbackSubmit: gt, onLeadSubmit: _t, startNewChat: vt, addToolOutput: yt, addToolApprovalResponse: bt, handleFileSelect: xt, clearFileLimitError: St, refreshMessages: Ct, appendMessage: wt, closePageNotice: Tt, respondHostConfirmation: Et, editQueuedMessage: Dt, removeQueuedMessage: Ot, openBackgroundAnswer: kt, dismissBackgroundAnswer: At } = I, { t: G } = pe({ useScope: "global" }), jt = y(() => et.value > 0), Mt = y(() => jt.value && B.value.status === "ready" ? "streaming" : B.value.status), Nt = l(() => rt.value?.notice), Pt = y(() => tt.value ? Nt.value || G(`message.pageAccessNotice.${tt.value}`) : void 0), Ft = y(() => {
|
|
489
|
+
let e = Qe.value;
|
|
490
|
+
if (e) return e.reason === "per-chat" ? G("message.fileLimitPerChat", { max: e.max }) : G("message.fileLimitPerMessage", { max: e.max });
|
|
491
|
+
}), It = y(() => st.value.map(({ chatId: e, title: t }) => ({
|
|
492
|
+
id: e,
|
|
493
|
+
text: t ? G("message.backgroundAnswerReady", { title: t }) : G("message.backgroundAnswerReadyUntitled")
|
|
494
|
+
}))), Lt = l(() => L.value?.dismissableNotice), Rt = y(() => z.value.some((e) => e.role === "user")), zt = y(() => F.modifier === "fullscreen" && !Rt.value), Bt = _e(L, () => F.userName), Vt = fe("chatViewEl"), { width: Ht } = he(Vt, {
|
|
495
|
+
width: 0,
|
|
496
|
+
height: 0
|
|
497
|
+
}, { box: "border-box" }), Ut = y(() => Ht.value >= Be), Wt = y(() => Ht.value > 0 && Ht.value < 576), K = k(), Gt = k(), q = k(!1), Kt = k(!1), qt = /* @__PURE__ */ new Map(), Jt = async (e) => {
|
|
498
|
+
K.value = e, Kt.value = !1;
|
|
499
|
+
let t = qt.get(e.storedFileName);
|
|
500
|
+
if (Gt.value = t, q.value = !1, t) return;
|
|
501
|
+
q.value = !0;
|
|
502
|
+
let n = () => K.value?.storedFileName === e.storedFileName;
|
|
503
|
+
try {
|
|
504
|
+
let t = await H.value.getChatFilePreview(F.agentId, I.localChatId, e.storedFileName);
|
|
505
|
+
qt.set(e.storedFileName, t), n() && (Gt.value = t);
|
|
506
|
+
} catch {
|
|
507
|
+
n() && (Kt.value = !0);
|
|
508
|
+
} finally {
|
|
509
|
+
n() && (q.value = !1);
|
|
510
|
+
}
|
|
511
|
+
}, Yt = () => {
|
|
512
|
+
K.value = void 0;
|
|
513
|
+
}, Xt = y({
|
|
514
|
+
get: () => !!K.value && !Ut.value,
|
|
515
|
+
set: (e) => {
|
|
516
|
+
e || Yt();
|
|
517
|
+
}
|
|
518
|
+
});
|
|
519
|
+
N(() => I.localChatId, () => {
|
|
520
|
+
Yt(), qt.clear();
|
|
521
|
+
});
|
|
522
|
+
let Zt = async (e) => (await H.value.expandSourceContext(F.agentId, e.documentId, e.chunkIndex)).content, Qt = async (e) => {
|
|
523
|
+
let t = await H.value.downloadSourceDocument(F.agentId, e);
|
|
524
|
+
window.open(t.downloadUrl, "_blank");
|
|
525
|
+
}, { isOverDropZone: $t } = me(Vt, {
|
|
526
|
+
dataTypes: (e) => t(e, U.value?.allowedMimeTypes ?? []),
|
|
527
|
+
onDrop: (e) => {
|
|
528
|
+
if (U.value?.enabled && e) for (let t of e) xt(t);
|
|
529
|
+
}
|
|
530
|
+
}), J = k(!1), Y = !1, X = k(!1), en = [
|
|
531
|
+
3e3,
|
|
532
|
+
5e3,
|
|
533
|
+
1e4
|
|
534
|
+
], tn, Z, nn = !1, rn = 0, an = !1;
|
|
535
|
+
function on() {
|
|
536
|
+
clearTimeout(tn), tn = void 0, Z = void 0, nn = !1, rn = 0, X.value = !1;
|
|
537
|
+
}
|
|
538
|
+
function sn(e) {
|
|
539
|
+
Y || (clearTimeout(tn), tn = setTimeout(() => {
|
|
540
|
+
cn();
|
|
541
|
+
}, e));
|
|
542
|
+
}
|
|
543
|
+
async function cn() {
|
|
544
|
+
if (Y || an) return;
|
|
545
|
+
an = !0;
|
|
546
|
+
let e;
|
|
547
|
+
try {
|
|
548
|
+
e = await Ct();
|
|
549
|
+
} finally {
|
|
550
|
+
an = !1;
|
|
551
|
+
}
|
|
552
|
+
if (Y) return;
|
|
553
|
+
if (e === "caught-up" && (X.value = !1, Ln()), Q.isActive.value) {
|
|
554
|
+
Z = void 0, nn = !1, rn = 0, sn(Ve);
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
Z === void 0 && (Z = Date.now(), nn = !!Q.error.value);
|
|
558
|
+
let t = Date.now() - Z;
|
|
559
|
+
if (e === "caught-up" && t >= (nn ? Ue : He) || t >= We) {
|
|
560
|
+
on(), Rn();
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
let n = en[Math.min(rn, en.length - 1)];
|
|
564
|
+
rn += 1, sn(n);
|
|
565
|
+
}
|
|
566
|
+
let ln = (e = 1200) => {
|
|
567
|
+
sn(e);
|
|
568
|
+
}, Q = Oe({
|
|
569
|
+
fetchGrant: async () => {
|
|
570
|
+
let e = await H.value.createVoiceSession(F.agentId, I.localChatId, {
|
|
571
|
+
deviceContext: I.buildDeviceContext(),
|
|
572
|
+
externalContext: I.externalContext
|
|
573
|
+
});
|
|
574
|
+
return e.chatId !== I.localChatId && (I.localChatId = e.chatId), e;
|
|
575
|
+
},
|
|
576
|
+
closeGrant: (e) => H.value.closeVoiceSession(F.agentId, e),
|
|
577
|
+
onTranscript: (e) => {
|
|
578
|
+
e.role === "user" ? (X.value = !0, In(), wt({
|
|
579
|
+
id: `${i}user-${n()}`,
|
|
580
|
+
role: "user",
|
|
581
|
+
parts: [{
|
|
582
|
+
type: "text",
|
|
583
|
+
text: e.text
|
|
584
|
+
}]
|
|
585
|
+
})) : X.value = !1;
|
|
586
|
+
},
|
|
587
|
+
onTurnEnd: () => {
|
|
588
|
+
ln();
|
|
589
|
+
}
|
|
590
|
+
});
|
|
591
|
+
N(() => Q.error.value, (e) => {
|
|
592
|
+
e && (X.value = !1);
|
|
593
|
+
});
|
|
594
|
+
let un = y(() => Se.value?.enabled === !0), dn = y(() => Q.error.value ? "error" : Q.isConnecting.value ? "connecting" : Q.isSpeaking.value ? "speaking" : Q.isActive.value ? "listening" : "idle"), fn = y(() => {
|
|
595
|
+
let e = Q.error.value;
|
|
596
|
+
if (e) return /took too long/i.test(e) ? G("message.voiceTookTooLong") : /cascade|no response|custom_llm_error/i.test(e) ? G("message.voiceNoAnswer") : G("message.voiceInterrupted");
|
|
597
|
+
}), pn = y(() => Q.isSpeaking.value ? "output" : "input"), mn = () => Q.readLevel(pn.value), hn = () => Q.readSpectrum(pn.value), gn = async () => {
|
|
598
|
+
J.value = !1, await Q.start(), Q.isActive.value && (on(), sn(Ve));
|
|
599
|
+
}, _n = async () => {
|
|
600
|
+
X.value = !1, await Q.stop(), !Y && ln(0);
|
|
601
|
+
}, vn = () => {
|
|
602
|
+
Q.dismissError();
|
|
603
|
+
}, yn = async () => {
|
|
604
|
+
Q.dismissError(), await Q.stop(), await gn();
|
|
605
|
+
}, $ = (e) => e?.toolCallId ?? "", bn = k(/* @__PURE__ */ new Set()), xn = (e) => bn.value.has($(e)), Sn = k(/* @__PURE__ */ new Map()), Cn = (e, t) => Q.isActive.value ? (Q.sendUserMessage(t) && (bn.value = new Set(bn.value).add($(e)), ln()), !0) : !1, wn = (e, t, n) => {
|
|
606
|
+
Cn(t, o(t, n)) || yt({
|
|
607
|
+
tool: e,
|
|
608
|
+
toolCallId: $(t),
|
|
609
|
+
output: n
|
|
610
|
+
});
|
|
611
|
+
}, Tn = (e) => {
|
|
612
|
+
let t = e.confirmed ? G("message.voiceConfirmed") : G("message.voiceCancelled");
|
|
613
|
+
Cn({ toolCallId: e.toolCallId }, t) ? bn.value.has(e.toolCallId) && (Sn.value = new Map(Sn.value).set(e.toolCallId, e.confirmed)) : yt({
|
|
614
|
+
tool: "requestConfirm",
|
|
615
|
+
toolCallId: e.toolCallId,
|
|
616
|
+
output: e.confirmed ? "confirmed" : "cancelled"
|
|
617
|
+
});
|
|
618
|
+
}, En = /* @__PURE__ */ new Set([
|
|
619
|
+
"tool-editSpreadsheet",
|
|
620
|
+
"tool-editWordDocument",
|
|
621
|
+
"tool-createSpreadsheet",
|
|
622
|
+
"tool-createWordDocument"
|
|
623
|
+
]), Dn = y(() => {
|
|
624
|
+
let e = /* @__PURE__ */ new Map();
|
|
625
|
+
for (let t of z.value) for (let n of t.parts) {
|
|
626
|
+
let { type: t, state: r, output: i } = n;
|
|
627
|
+
En.has(t) && r === "output-available" && i?.fileId && i.version && e.set(i.fileId, Math.max(e.get(i.fileId) ?? 0, i.version));
|
|
628
|
+
}
|
|
629
|
+
return e;
|
|
630
|
+
}), On = y(() => Je.value ? void 0 : (e) => {
|
|
631
|
+
V.value = G("messagePart.chatFileRestoreRequest", e), ut();
|
|
632
|
+
}), kn = (e, t) => {
|
|
633
|
+
Cn(e, t) || (V.value = t, ut());
|
|
634
|
+
}, An = (e, t) => {
|
|
635
|
+
let n = t.error ? G("message.voiceLocationRefused") : G("message.voiceLocationShared", { place: t.displayName ?? `${t.latitude}, ${t.longitude}` });
|
|
636
|
+
Cn(e, n) || yt({
|
|
637
|
+
tool: "requestGeolocation",
|
|
638
|
+
toolCallId: $(e),
|
|
639
|
+
output: t
|
|
640
|
+
});
|
|
641
|
+
}, jn = (e, t) => {
|
|
642
|
+
Cn(e, G("message.voiceConnectionDone")) || yt({
|
|
643
|
+
tool: "requestOAuthConnection",
|
|
644
|
+
toolCallId: $(e),
|
|
645
|
+
output: {
|
|
646
|
+
connected: !0,
|
|
647
|
+
mcpServerId: t
|
|
648
|
+
}
|
|
649
|
+
});
|
|
650
|
+
}, Mn = () => {
|
|
651
|
+
J.value = !J.value, Q.setMuted(J.value);
|
|
652
|
+
};
|
|
653
|
+
ae(() => {
|
|
654
|
+
Y = !0, on();
|
|
655
|
+
});
|
|
656
|
+
let { pendingWakeup: Nn, isStopping: Pn, stop: Fn, spokenTurnStarted: In, spokenTurnsWritten: Ln, forgetSpokenTurns: Rn } = Ne({
|
|
657
|
+
agentId: () => F.agentId,
|
|
658
|
+
chatId: () => I.localChatId,
|
|
659
|
+
apiClient: () => H.value,
|
|
660
|
+
messages: () => z.value,
|
|
661
|
+
refreshMessages: Ct,
|
|
662
|
+
status: () => B.value.status
|
|
663
|
+
});
|
|
664
|
+
return (t, n) => {
|
|
665
|
+
let r = g, i = h;
|
|
666
|
+
return O(), S("div", {
|
|
667
|
+
ref_key: "chatViewEl",
|
|
668
|
+
ref: Vt,
|
|
669
|
+
class: D(["pk-chatbot-view-chat", {
|
|
670
|
+
"pk-chatbot-view-chat--dragover": M($t) && U.value?.enabled,
|
|
671
|
+
"pk-chatbot-view-chat--empty": zt.value,
|
|
672
|
+
"pk-chatbot-view-chat--with-preview": !!K.value && Ut.value
|
|
673
|
+
}])
|
|
674
|
+
}, [
|
|
675
|
+
w(v, {
|
|
676
|
+
name: "pk-chatbot-view-chat-fade",
|
|
677
|
+
mode: "out-in"
|
|
678
|
+
}, {
|
|
679
|
+
default: P(() => [zt.value ? (O(), b(ee, {
|
|
680
|
+
key: 0,
|
|
681
|
+
greeting: M(Bt),
|
|
682
|
+
logo: M(L)?.logo,
|
|
683
|
+
name: M(I).name
|
|
684
|
+
}, null, 8, [
|
|
685
|
+
"greeting",
|
|
686
|
+
"logo",
|
|
687
|
+
"name"
|
|
688
|
+
])) : (O(), b(e, {
|
|
689
|
+
key: 1,
|
|
690
|
+
class: "flex flex-col flex-1 min-h-0 p-md overflow-y-auto",
|
|
691
|
+
interactive: "",
|
|
692
|
+
messages: M(z),
|
|
693
|
+
"confirm-verdicts-on-call": Sn.value,
|
|
694
|
+
status: M(B).status,
|
|
695
|
+
error: M(B).error,
|
|
696
|
+
"main-color": M(L)?.mainColor,
|
|
697
|
+
"text-color": M(L)?.textColor,
|
|
698
|
+
"revised-answers": M(we),
|
|
699
|
+
actions: M(Ce),
|
|
700
|
+
"message-feedbacks": M(Te),
|
|
701
|
+
"feedback-message-id": M(Ee)?.id,
|
|
702
|
+
"feedback-loading": M(ke),
|
|
703
|
+
"feedback-submitted": M(Ae),
|
|
704
|
+
"feedback-error": M(je),
|
|
705
|
+
"show-extended-steps": M(L)?.showExtendedSteps,
|
|
706
|
+
"hide-reasoning": M(L)?.showReasoning === !1,
|
|
707
|
+
"awaiting-spoken-answer": X.value,
|
|
708
|
+
"host-working": jt.value,
|
|
709
|
+
"host-confirmation": M(nt),
|
|
710
|
+
"is-dark": M($e),
|
|
711
|
+
"show-scroll-to-bottom": a.modifier === "fullscreen",
|
|
712
|
+
onFeedbackSubmit: n[0] ||= (e) => M(gt)(e),
|
|
713
|
+
onFeedbackClose: n[1] ||= (e) => Ee.value = void 0,
|
|
714
|
+
onRegenerate: M(ft),
|
|
715
|
+
onAutoRetry: M(ft),
|
|
716
|
+
onResetChat: M(vt),
|
|
717
|
+
onShowInfo: n[2] ||= (e) => ye("show-info", e),
|
|
718
|
+
onRevise: n[3] ||= (e) => ye("revise", e),
|
|
719
|
+
onUpvote: M(pt),
|
|
720
|
+
onDownvote: M(mt),
|
|
721
|
+
onFeedback: M(ht),
|
|
722
|
+
onApprovalRespond: M(bt),
|
|
723
|
+
onConfirmRespond: Tn,
|
|
724
|
+
onHostConfirmRespond: M(Et)
|
|
725
|
+
}, {
|
|
726
|
+
"tool-showContactForm": P(({ part: e }) => [w(M(ne), {
|
|
727
|
+
part: e,
|
|
728
|
+
readonly: !M(Ye),
|
|
729
|
+
submitted: M(Me),
|
|
730
|
+
loading: M(Ge),
|
|
731
|
+
error: M(Ke),
|
|
732
|
+
"privacy-policy-notice": M(L)?.privacyPolicyNotice,
|
|
733
|
+
onSubmit: M(_t)
|
|
734
|
+
}, null, 8, [
|
|
735
|
+
"part",
|
|
736
|
+
"readonly",
|
|
737
|
+
"submitted",
|
|
738
|
+
"loading",
|
|
739
|
+
"error",
|
|
740
|
+
"privacy-policy-notice",
|
|
741
|
+
"onSubmit"
|
|
742
|
+
])]),
|
|
743
|
+
"tool-showSuggestedReply": P(({ part: e }) => [w(M(E), {
|
|
744
|
+
part: e,
|
|
745
|
+
onSelect: (t) => kn(e, t)
|
|
746
|
+
}, null, 8, ["part", "onSelect"])]),
|
|
747
|
+
"tool-showSources": P(({ part: e }) => [w(M(ie), {
|
|
748
|
+
part: e,
|
|
749
|
+
"on-expand-context": Zt,
|
|
750
|
+
"on-download": Qt
|
|
751
|
+
}, null, 8, ["part"])]),
|
|
752
|
+
"tool-showForm": P(({ part: e }) => [w(v, { mode: "out-in" }, {
|
|
753
|
+
default: P(() => [w(M(_), {
|
|
754
|
+
part: e,
|
|
755
|
+
answered: xn(e),
|
|
756
|
+
onSelect: (t) => wn("showForm", e, t)
|
|
757
|
+
}, null, 8, [
|
|
758
|
+
"part",
|
|
759
|
+
"answered",
|
|
760
|
+
"onSelect"
|
|
761
|
+
])]),
|
|
762
|
+
_: 2
|
|
763
|
+
}, 1024)]),
|
|
764
|
+
"tool-showMultipleChoice": P(({ part: e }) => [w(v, { mode: "out-in" }, {
|
|
765
|
+
default: P(() => [w(M(_), {
|
|
766
|
+
part: e,
|
|
767
|
+
"allow-custom-answer": "",
|
|
768
|
+
answered: xn(e),
|
|
769
|
+
onSelect: (t) => wn("showMultipleChoice", e, t)
|
|
770
|
+
}, null, 8, [
|
|
771
|
+
"part",
|
|
772
|
+
"answered",
|
|
773
|
+
"onSelect"
|
|
774
|
+
])]),
|
|
775
|
+
_: 2
|
|
776
|
+
}, 1024)]),
|
|
777
|
+
"tool-requestOAuthConnection": P(({ part: e }) => [w(M(se), {
|
|
778
|
+
part: e,
|
|
779
|
+
"backend-url": M(Ye),
|
|
780
|
+
"resolve-connection": (e) => M(H).getOAuthAuthorizeUrl(F.agentId, e),
|
|
781
|
+
"check-connection": (e) => M(H).getOAuthConnectionStatus(F.agentId, e),
|
|
782
|
+
onConnected: (t) => jn(e, t)
|
|
783
|
+
}, null, 8, [
|
|
784
|
+
"part",
|
|
785
|
+
"backend-url",
|
|
786
|
+
"resolve-connection",
|
|
787
|
+
"check-connection",
|
|
788
|
+
"onConnected"
|
|
789
|
+
])]),
|
|
790
|
+
"tool-requestGeolocation": P(({ part: e }) => [w(M(oe), {
|
|
791
|
+
part: e,
|
|
792
|
+
"call-live": M(Q).isActive.value,
|
|
793
|
+
"reverse-geocode": (e, t) => M(H).reverseGeocode(e, t),
|
|
794
|
+
onResult: (t) => An(e, t)
|
|
795
|
+
}, null, 8, [
|
|
796
|
+
"part",
|
|
797
|
+
"call-live",
|
|
798
|
+
"reverse-geocode",
|
|
799
|
+
"onResult"
|
|
800
|
+
])]),
|
|
801
|
+
"tool-showLocation": P(({ part: e }) => [w(M(ce), {
|
|
802
|
+
part: e,
|
|
803
|
+
"is-dark": M($e),
|
|
804
|
+
"main-color": M(L)?.mainColor,
|
|
805
|
+
"forward-geocode": (e, t) => M(H).forwardGeocode(e, t)
|
|
806
|
+
}, null, 8, [
|
|
807
|
+
"part",
|
|
808
|
+
"is-dark",
|
|
809
|
+
"main-color",
|
|
810
|
+
"forward-geocode"
|
|
811
|
+
])]),
|
|
812
|
+
"tool-showDiagram": P(({ part: e }) => [w(M(ue), {
|
|
813
|
+
part: e,
|
|
814
|
+
"is-dark": M($e)
|
|
815
|
+
}, null, 8, ["part", "is-dark"])]),
|
|
816
|
+
"tool-editSpreadsheet": P(({ part: e }) => [(O(), b(M(A), {
|
|
817
|
+
key: M(s)(e),
|
|
818
|
+
part: e,
|
|
819
|
+
"file-url": W,
|
|
820
|
+
preview: Jt,
|
|
821
|
+
"latest-versions": Dn.value,
|
|
822
|
+
restore: On.value
|
|
823
|
+
}, null, 8, [
|
|
824
|
+
"part",
|
|
825
|
+
"latest-versions",
|
|
826
|
+
"restore"
|
|
827
|
+
]))]),
|
|
828
|
+
"tool-editWordDocument": P(({ part: e }) => [(O(), b(M(A), {
|
|
829
|
+
key: M(s)(e),
|
|
830
|
+
part: e,
|
|
831
|
+
"file-url": W,
|
|
832
|
+
preview: Jt,
|
|
833
|
+
"latest-versions": Dn.value,
|
|
834
|
+
restore: On.value
|
|
835
|
+
}, null, 8, [
|
|
836
|
+
"part",
|
|
837
|
+
"latest-versions",
|
|
838
|
+
"restore"
|
|
839
|
+
]))]),
|
|
840
|
+
"tool-createSpreadsheet": P(({ part: e }) => [(O(), b(M(A), {
|
|
841
|
+
key: M(s)(e),
|
|
842
|
+
part: e,
|
|
843
|
+
"file-url": W,
|
|
844
|
+
preview: Jt,
|
|
845
|
+
"latest-versions": Dn.value,
|
|
846
|
+
restore: On.value
|
|
847
|
+
}, null, 8, [
|
|
848
|
+
"part",
|
|
849
|
+
"latest-versions",
|
|
850
|
+
"restore"
|
|
851
|
+
]))]),
|
|
852
|
+
"tool-createWordDocument": P(({ part: e }) => [(O(), b(M(A), {
|
|
853
|
+
key: M(s)(e),
|
|
854
|
+
part: e,
|
|
855
|
+
"file-url": W,
|
|
856
|
+
preview: Jt,
|
|
857
|
+
"latest-versions": Dn.value,
|
|
858
|
+
restore: On.value
|
|
859
|
+
}, null, 8, [
|
|
860
|
+
"part",
|
|
861
|
+
"latest-versions",
|
|
862
|
+
"restore"
|
|
863
|
+
]))]),
|
|
864
|
+
"tool-shareDocument": P(({ part: e }) => [(O(), b(M(de), {
|
|
865
|
+
key: M(s)(e),
|
|
866
|
+
part: e,
|
|
867
|
+
"on-download": Qt
|
|
868
|
+
}, null, 8, ["part"]))]),
|
|
869
|
+
_: 1
|
|
870
|
+
}, 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(".")))]),
|
|
871
|
+
_: 1
|
|
872
|
+
}),
|
|
873
|
+
M(ot).length ? (O(), b(p, {
|
|
874
|
+
key: 0,
|
|
875
|
+
messages: M(ot),
|
|
876
|
+
onEdit: M(Dt),
|
|
877
|
+
onRemove: M(Ot)
|
|
878
|
+
}, null, 8, [
|
|
879
|
+
"messages",
|
|
880
|
+
"onEdit",
|
|
881
|
+
"onRemove"
|
|
882
|
+
])) : x("", !0),
|
|
883
|
+
C("div", Pe, [
|
|
884
|
+
w(v, { name: "pk-chatbot-view-chat-fade" }, {
|
|
885
|
+
default: P(() => [zt.value ? (O(), b(be, {
|
|
886
|
+
key: 0,
|
|
887
|
+
class: "pk-chatbot-view-chat__aurora",
|
|
888
|
+
"source-selector": ".pk-chatbot-input__form"
|
|
889
|
+
})) : x("", !0)]),
|
|
890
|
+
_: 1
|
|
891
|
+
}),
|
|
892
|
+
M(Nn) && !M(Je) ? (O(), b(m, {
|
|
893
|
+
key: 0,
|
|
894
|
+
pending: M(Nn),
|
|
895
|
+
stopping: M(Pn),
|
|
896
|
+
onStop: M(Fn)
|
|
897
|
+
}, null, 8, [
|
|
898
|
+
"pending",
|
|
899
|
+
"stopping",
|
|
900
|
+
"onStop"
|
|
901
|
+
])) : x("", !0),
|
|
902
|
+
M(Je) ? (O(), S("div", Fe, j(M(G)("message.chatErrorConversationBlocked")), 1)) : dn.value === "idle" ? (O(), b(f, {
|
|
903
|
+
key: 3,
|
|
904
|
+
ref_key: "inputEl",
|
|
905
|
+
ref: lt,
|
|
906
|
+
modelValue: M(V),
|
|
907
|
+
"onUpdate:modelValue": n[4] ||= (e) => re(V) ? V.value = e : null,
|
|
908
|
+
"pending-attachments": M(Xe),
|
|
909
|
+
"onUpdate:pendingAttachments": n[5] ||= (e) => re(Xe) ? Xe.value = e : null,
|
|
910
|
+
placeholder: M(qe),
|
|
911
|
+
"dismissable-notice": M(Lt) && M(B).messages.length <= 1 ? M(Lt) : void 0,
|
|
912
|
+
"page-notice": Pt.value,
|
|
913
|
+
status: Mt.value,
|
|
914
|
+
"max-message-length": M(L)?.maxMessageLength,
|
|
915
|
+
"file-upload": U.value,
|
|
916
|
+
"attachment-limit-reached": M(Ze),
|
|
917
|
+
"attachment-notice": Ft.value,
|
|
918
|
+
"voice-enabled": un.value,
|
|
919
|
+
"queue-enabled": M(at),
|
|
920
|
+
"answer-notices": It.value,
|
|
921
|
+
onStopGeneration: M(dt),
|
|
922
|
+
onSubmit: M(ut),
|
|
923
|
+
onFileSelect: M(xt),
|
|
924
|
+
onDismissAttachmentNotice: M(St),
|
|
925
|
+
onDismissPageNotice: M(Tt),
|
|
926
|
+
onOpenAnswerNotice: M(kt),
|
|
927
|
+
onDismissAnswerNotice: M(At),
|
|
928
|
+
onVoiceStart: gn
|
|
929
|
+
}, te({ _: 2 }, [a.modifier === "fullscreen" ? {
|
|
930
|
+
name: "prepend",
|
|
931
|
+
fn: P(() => [C("span", Ie, [w(u, {
|
|
932
|
+
class: "pk-chatbot-view-chat__agent-chip-avatar",
|
|
933
|
+
"img-src": M(L)?.logo,
|
|
934
|
+
name: M(I).name
|
|
935
|
+
}, null, 8, ["img-src", "name"]), M(I).name ? (O(), S("strong", Le, j(M(I).name), 1)) : x("", !0)])]),
|
|
936
|
+
key: "0"
|
|
937
|
+
} : void 0]), 1032, [
|
|
938
|
+
"modelValue",
|
|
939
|
+
"pending-attachments",
|
|
940
|
+
"placeholder",
|
|
941
|
+
"dismissable-notice",
|
|
942
|
+
"page-notice",
|
|
943
|
+
"status",
|
|
944
|
+
"max-message-length",
|
|
945
|
+
"file-upload",
|
|
946
|
+
"attachment-limit-reached",
|
|
947
|
+
"attachment-notice",
|
|
948
|
+
"voice-enabled",
|
|
949
|
+
"queue-enabled",
|
|
950
|
+
"answer-notices",
|
|
951
|
+
"onStopGeneration",
|
|
952
|
+
"onSubmit",
|
|
953
|
+
"onFileSelect",
|
|
954
|
+
"onDismissAttachmentNotice",
|
|
955
|
+
"onDismissPageNotice",
|
|
956
|
+
"onOpenAnswerNotice",
|
|
957
|
+
"onDismissAnswerNotice"
|
|
958
|
+
])) : (O(), b(De, {
|
|
959
|
+
key: 2,
|
|
960
|
+
state: dn.value,
|
|
961
|
+
sample: mn,
|
|
962
|
+
spectrum: hn,
|
|
963
|
+
"remaining-seconds": M(Q).remainingSeconds.value,
|
|
964
|
+
muted: J.value,
|
|
965
|
+
error: fn.value,
|
|
966
|
+
"raw-error": M(Q).error.value,
|
|
967
|
+
live: M(Q).isActive.value,
|
|
968
|
+
class: "pk-chatbot-view-chat__voice",
|
|
969
|
+
onToggleMute: Mn,
|
|
970
|
+
onHangUp: _n,
|
|
971
|
+
onRetry: yn,
|
|
972
|
+
onDismiss: vn
|
|
973
|
+
}, null, 8, [
|
|
974
|
+
"state",
|
|
975
|
+
"remaining-seconds",
|
|
976
|
+
"muted",
|
|
977
|
+
"error",
|
|
978
|
+
"raw-error",
|
|
979
|
+
"live"
|
|
980
|
+
]))
|
|
981
|
+
]),
|
|
982
|
+
w(v, null, {
|
|
983
|
+
default: P(() => [M($t) && U.value?.enabled ? (O(), S("div", Re, [w(r, {
|
|
984
|
+
name: "ri:upload-cloud-2-line",
|
|
985
|
+
class: "pk-chatbot-view-chat__drop-overlay-icon"
|
|
986
|
+
}), C("span", null, j(M(G)("action.dropFile")), 1)])) : x("", !0)]),
|
|
987
|
+
_: 1
|
|
988
|
+
}),
|
|
989
|
+
K.value && Ut.value ? (O(), S("aside", ze, [w(M(ve), {
|
|
990
|
+
closable: "",
|
|
991
|
+
kind: K.value.kind,
|
|
992
|
+
filename: K.value.filename,
|
|
993
|
+
version: K.value.version,
|
|
994
|
+
"download-url": W(K.value.storedFileName),
|
|
995
|
+
preview: Gt.value,
|
|
996
|
+
loading: q.value,
|
|
997
|
+
error: Kt.value,
|
|
998
|
+
onClose: Yt
|
|
999
|
+
}, null, 8, [
|
|
1000
|
+
"kind",
|
|
1001
|
+
"filename",
|
|
1002
|
+
"version",
|
|
1003
|
+
"download-url",
|
|
1004
|
+
"preview",
|
|
1005
|
+
"loading",
|
|
1006
|
+
"error"
|
|
1007
|
+
])])) : x("", !0),
|
|
1008
|
+
K.value && !Ut.value ? (O(), b(i, {
|
|
1009
|
+
key: 2,
|
|
1010
|
+
modelValue: Xt.value,
|
|
1011
|
+
"onUpdate:modelValue": n[6] ||= (e) => Xt.value = e,
|
|
1012
|
+
title: K.value.filename,
|
|
1013
|
+
"label-close": M(G)("chatFilePreview.close"),
|
|
1014
|
+
modifiers: Wt.value ? "fullscreen" : void 0,
|
|
1015
|
+
class: "pk-chatbot-view-chat__preview-dialog"
|
|
1016
|
+
}, {
|
|
1017
|
+
default: P(() => [w(M(ve), {
|
|
1018
|
+
kind: K.value.kind,
|
|
1019
|
+
filename: K.value.filename,
|
|
1020
|
+
version: K.value.version,
|
|
1021
|
+
"download-url": W(K.value.storedFileName),
|
|
1022
|
+
preview: Gt.value,
|
|
1023
|
+
loading: q.value,
|
|
1024
|
+
error: Kt.value
|
|
1025
|
+
}, null, 8, [
|
|
1026
|
+
"kind",
|
|
1027
|
+
"filename",
|
|
1028
|
+
"version",
|
|
1029
|
+
"download-url",
|
|
1030
|
+
"preview",
|
|
1031
|
+
"loading",
|
|
1032
|
+
"error"
|
|
1033
|
+
])]),
|
|
1034
|
+
_: 1
|
|
1035
|
+
}, 8, [
|
|
1036
|
+
"modelValue",
|
|
1037
|
+
"title",
|
|
1038
|
+
"label-close",
|
|
1039
|
+
"modifiers"
|
|
1040
|
+
])) : x("", !0)
|
|
1041
|
+
], 2);
|
|
1042
|
+
};
|
|
1043
|
+
}
|
|
1044
|
+
});
|
|
1045
|
+
export { be as i, De as n, Se as r, Ge as t };
|
|
1046
|
+
|
|
1047
|
+
//# sourceMappingURL=PkChatbotViewChat-BNaSv86u.js.map
|