@_solaris/messenger-widget 0.5.71 → 0.5.73
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/iframe/iframe.js +1 -1
- package/dist/messenger.cjs +8 -8
- package/dist/messenger.js +825 -811
- package/dist/snippet.js +1 -1
- package/dist/types/mixins/revealPacing.d.ts +1 -0
- package/package.json +1 -1
package/dist/messenger.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reactive as $e, openBlock as c, createElementBlock as d, normalizeStyle as z, normalizeClass as R, toDisplayString as v, resolveComponent as B, createVNode as $, Transition as
|
|
1
|
+
import { reactive as $e, openBlock as c, createElementBlock as d, normalizeStyle as z, normalizeClass as R, toDisplayString as v, resolveComponent as B, createVNode as $, Transition as Ue, withCtx as Fe, Fragment as I, renderList as F, withKeys as ge, withModifiers as J, createElementVNode as o, createCommentVNode as b, createBlock as D, resolveDynamicComponent as Ae, mergeProps as je, withDirectives as G, vModelText as te, createTextVNode as Se, renderSlot as Ke, vModelCheckbox as We, vModelSelect as Ge, markRaw as Re } from "vue";
|
|
2
2
|
const Ye = [
|
|
3
3
|
"connected",
|
|
4
4
|
"message",
|
|
@@ -35,7 +35,7 @@ function Ze(e) {
|
|
|
35
35
|
};
|
|
36
36
|
if (!t.baseUrl || !t.widgetId)
|
|
37
37
|
throw new Error("[transport] baseUrl and widgetId are required");
|
|
38
|
-
function
|
|
38
|
+
function s(u, g) {
|
|
39
39
|
return t.listeners.has(u) || t.listeners.set(u, /* @__PURE__ */ new Set()), t.listeners.get(u).add(g), () => t.listeners.get(u).delete(g);
|
|
40
40
|
}
|
|
41
41
|
function r(u, g) {
|
|
@@ -51,7 +51,7 @@ function Ze(e) {
|
|
|
51
51
|
function a(u) {
|
|
52
52
|
t.connection !== u && (t.connection = u, r("connection", u));
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function n() {
|
|
55
55
|
return {
|
|
56
56
|
"Content-Type": "application/json",
|
|
57
57
|
"X-Widget-Id": t.widgetId,
|
|
@@ -68,7 +68,7 @@ function Ze(e) {
|
|
|
68
68
|
const S = await fetch(`${t.baseUrl}${we}${g}`, {
|
|
69
69
|
method: u,
|
|
70
70
|
credentials: "include",
|
|
71
|
-
headers:
|
|
71
|
+
headers: n(),
|
|
72
72
|
body: p !== void 0 ? JSON.stringify(p) : void 0
|
|
73
73
|
});
|
|
74
74
|
if (!S.ok) {
|
|
@@ -96,7 +96,7 @@ function Ze(e) {
|
|
|
96
96
|
{
|
|
97
97
|
method: "POST",
|
|
98
98
|
credentials: "include",
|
|
99
|
-
headers:
|
|
99
|
+
headers: n(),
|
|
100
100
|
body: JSON.stringify({
|
|
101
101
|
origin: t.origin,
|
|
102
102
|
...t.token ? { token: t.token } : {},
|
|
@@ -178,14 +178,14 @@ function Ze(e) {
|
|
|
178
178
|
g
|
|
179
179
|
)).conversation;
|
|
180
180
|
}
|
|
181
|
-
async function
|
|
181
|
+
async function N(u, g) {
|
|
182
182
|
return i(
|
|
183
183
|
"PATCH",
|
|
184
184
|
`/conversations/${encodeURIComponent(u)}/read`,
|
|
185
185
|
{ message_id: g }
|
|
186
186
|
);
|
|
187
187
|
}
|
|
188
|
-
async function
|
|
188
|
+
async function U(u, g = {}) {
|
|
189
189
|
const p = new URLSearchParams();
|
|
190
190
|
g.before && p.set("before", g.before), g.since && p.set("since", g.since), g.limit && p.set("limit", String(g.limit));
|
|
191
191
|
const S = p.toString() ? `?${p.toString()}` : "";
|
|
@@ -328,7 +328,7 @@ function Ze(e) {
|
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
return {
|
|
331
|
-
on:
|
|
331
|
+
on: s,
|
|
332
332
|
start: _,
|
|
333
333
|
stop: f,
|
|
334
334
|
setPanelOpen: me,
|
|
@@ -341,8 +341,8 @@ function Ze(e) {
|
|
|
341
341
|
createConversation: A,
|
|
342
342
|
getConversation: q,
|
|
343
343
|
patchConversation: M,
|
|
344
|
-
markConversationRead:
|
|
345
|
-
listMessages:
|
|
344
|
+
markConversationRead: N,
|
|
345
|
+
listMessages: U,
|
|
346
346
|
postMessage: L,
|
|
347
347
|
postCallback: K,
|
|
348
348
|
uploadAttachment: Q,
|
|
@@ -366,9 +366,9 @@ function nt() {
|
|
|
366
366
|
if (typeof crypto < "u" && crypto.getRandomValues)
|
|
367
367
|
crypto.getRandomValues(e);
|
|
368
368
|
else
|
|
369
|
-
for (let
|
|
369
|
+
for (let s = 0; s < 16; s++) e[s] = Math.floor(Math.random() * 256);
|
|
370
370
|
e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128;
|
|
371
|
-
const t = [...e].map((
|
|
371
|
+
const t = [...e].map((s) => s.toString(16).padStart(2, "0"));
|
|
372
372
|
return t.slice(0, 4).join("") + "-" + t.slice(4, 6).join("") + "-" + t.slice(6, 8).join("") + "-" + t.slice(8, 10).join("") + "-" + t.slice(10, 16).join("");
|
|
373
373
|
}
|
|
374
374
|
function st(e) {
|
|
@@ -402,22 +402,22 @@ function st(e) {
|
|
|
402
402
|
// l'indicateur de frappe quand une action s'exécute.
|
|
403
403
|
runningActionsByConv: {},
|
|
404
404
|
connection: "idle"
|
|
405
|
-
}),
|
|
406
|
-
|
|
405
|
+
}), s = [];
|
|
406
|
+
s.push(
|
|
407
407
|
e.on("connection", (h) => {
|
|
408
408
|
t.connection = h;
|
|
409
409
|
})
|
|
410
|
-
),
|
|
410
|
+
), s.push(
|
|
411
411
|
e.on("message", (h) => {
|
|
412
412
|
const m = h == null ? void 0 : h.conversation_id, f = h == null ? void 0 : h.message;
|
|
413
413
|
!m || !(f != null && f.id) || (W(m, f), f.client_msg_id && delete t.streamingByMsgId[f.client_msg_id], ae(m, f.created_at));
|
|
414
414
|
})
|
|
415
|
-
),
|
|
415
|
+
), s.push(
|
|
416
416
|
e.on("message_stream", (h) => {
|
|
417
417
|
const m = h == null ? void 0 : h.message_id, f = h == null ? void 0 : h.token;
|
|
418
418
|
!m || typeof f != "string" || (t.streamingByMsgId[m] = (t.streamingByMsgId[m] || "") + f);
|
|
419
419
|
})
|
|
420
|
-
),
|
|
420
|
+
), s.push(
|
|
421
421
|
e.on("conversation_updated", (h) => {
|
|
422
422
|
const m = h == null ? void 0 : h.conversation_id, f = h == null ? void 0 : h.changes;
|
|
423
423
|
if (!m || !f) return;
|
|
@@ -427,18 +427,18 @@ function st(e) {
|
|
|
427
427
|
...f
|
|
428
428
|
});
|
|
429
429
|
})
|
|
430
|
-
),
|
|
430
|
+
), s.push(
|
|
431
431
|
e.on("config_updated", (h) => {
|
|
432
432
|
h != null && h.config && (t.config = h.config);
|
|
433
433
|
})
|
|
434
|
-
),
|
|
434
|
+
), s.push(
|
|
435
435
|
e.on("action_status", (h) => {
|
|
436
436
|
const m = h == null ? void 0 : h.conversation_id, f = h == null ? void 0 : h.action_id, y = h == null ? void 0 : h.action_name;
|
|
437
437
|
if (!m || !f) return;
|
|
438
438
|
const C = t.runningActionsByConv[m] || {};
|
|
439
439
|
h.state === "running" ? (C[f] = y || f, t.runningActionsByConv[m] = { ...C }) : h.state === "done" && (delete C[f], t.runningActionsByConv[m] = { ...C });
|
|
440
440
|
})
|
|
441
|
-
),
|
|
441
|
+
), s.push(
|
|
442
442
|
e.on("activity", (h) => {
|
|
443
443
|
Array.isArray(h == null ? void 0 : h.conversations) && (t.conversations = h.conversations);
|
|
444
444
|
})
|
|
@@ -467,14 +467,14 @@ function st(e) {
|
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
469
|
function a() {
|
|
470
|
-
for (const h of
|
|
470
|
+
for (const h of s)
|
|
471
471
|
try {
|
|
472
472
|
h();
|
|
473
473
|
} catch {
|
|
474
474
|
}
|
|
475
475
|
e.stop();
|
|
476
476
|
}
|
|
477
|
-
async function
|
|
477
|
+
async function n(h) {
|
|
478
478
|
const m = ye(h);
|
|
479
479
|
if (!m) return t.customer;
|
|
480
480
|
try {
|
|
@@ -630,10 +630,10 @@ function st(e) {
|
|
|
630
630
|
console.error("[store] callback failed", y), h != null && delete t.awaitingCallback[h];
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
|
-
const
|
|
634
|
-
async function
|
|
633
|
+
const N = /* @__PURE__ */ new Map();
|
|
634
|
+
async function U(h) {
|
|
635
635
|
if (!h) return null;
|
|
636
|
-
const m =
|
|
636
|
+
const m = N.get(h);
|
|
637
637
|
if (m != null && m.url) {
|
|
638
638
|
const f = m.expires_at ? Date.parse(m.expires_at) : 0;
|
|
639
639
|
if (!f || f - Date.now() > 6e4) return m.url;
|
|
@@ -641,7 +641,7 @@ function st(e) {
|
|
|
641
641
|
try {
|
|
642
642
|
const f = await e.signAttachment(h);
|
|
643
643
|
if (f != null && f.signed_url)
|
|
644
|
-
return
|
|
644
|
+
return N.set(h, {
|
|
645
645
|
url: f.signed_url,
|
|
646
646
|
expires_at: f.expires_at
|
|
647
647
|
}), f.signed_url;
|
|
@@ -777,7 +777,7 @@ function st(e) {
|
|
|
777
777
|
state: t,
|
|
778
778
|
start: r,
|
|
779
779
|
destroy: a,
|
|
780
|
-
applyCustomer:
|
|
780
|
+
applyCustomer: n,
|
|
781
781
|
createConversation: i,
|
|
782
782
|
openConversation: _,
|
|
783
783
|
loadMore: k,
|
|
@@ -786,7 +786,7 @@ function st(e) {
|
|
|
786
786
|
markConversationRead: A,
|
|
787
787
|
send: q,
|
|
788
788
|
clickCallback: M,
|
|
789
|
-
signAttachment:
|
|
789
|
+
signAttachment: U,
|
|
790
790
|
submitFeedback: L,
|
|
791
791
|
getPendingApproval: K,
|
|
792
792
|
getActionInFlight: se,
|
|
@@ -1151,10 +1151,10 @@ function ne(e) {
|
|
|
1151
1151
|
return Le[xe(e)] || Le[ue];
|
|
1152
1152
|
}
|
|
1153
1153
|
function j(e) {
|
|
1154
|
-
const t = xe(e),
|
|
1155
|
-
return function(
|
|
1156
|
-
let l = n
|
|
1157
|
-
return l == null && (l = r[
|
|
1154
|
+
const t = xe(e), s = ke[t] || ke[ue], r = ke[ue];
|
|
1155
|
+
return function(n, i) {
|
|
1156
|
+
let l = s[n];
|
|
1157
|
+
return l == null && (l = r[n]), l == null ? n : (i && (l = l.replace(
|
|
1158
1158
|
/\{(\w+)\}/g,
|
|
1159
1159
|
(_, k) => i[k] != null ? String(i[k]) : _
|
|
1160
1160
|
)), l);
|
|
@@ -1162,43 +1162,43 @@ function j(e) {
|
|
|
1162
1162
|
}
|
|
1163
1163
|
function Ie(e, t) {
|
|
1164
1164
|
if (!Array.isArray(e == null ? void 0 : e.options)) return t;
|
|
1165
|
-
const
|
|
1166
|
-
return (
|
|
1165
|
+
const s = e.options.find((r) => (r == null ? void 0 : r.value) === t);
|
|
1166
|
+
return (s == null ? void 0 : s.label) || t;
|
|
1167
1167
|
}
|
|
1168
|
-
function He(e, t,
|
|
1169
|
-
return Array.isArray(t) ? t.map((r) => Ie(e, String(r))).join(", ") : typeof t == "boolean" ?
|
|
1168
|
+
function He(e, t, s) {
|
|
1169
|
+
return Array.isArray(t) ? t.map((r) => Ie(e, String(r))).join(", ") : typeof t == "boolean" ? s(t ? "common.yes" : "common.no") : Ie(e, String(t));
|
|
1170
1170
|
}
|
|
1171
|
-
function ht(e, t,
|
|
1171
|
+
function ht(e, t, s = j()) {
|
|
1172
1172
|
if (!e || !t) return "";
|
|
1173
1173
|
const r = Array.isArray(e.fields) ? e.fields : [], a = [];
|
|
1174
|
-
for (const
|
|
1175
|
-
if (!(
|
|
1176
|
-
const i = t[
|
|
1174
|
+
for (const n of r) {
|
|
1175
|
+
if (!(n != null && n.key) || !(n != null && n.label)) continue;
|
|
1176
|
+
const i = t[n.key];
|
|
1177
1177
|
if (i == null || i === "") continue;
|
|
1178
|
-
const l = He(
|
|
1179
|
-
l && a.push(`${
|
|
1178
|
+
const l = He(n, i, s);
|
|
1179
|
+
l && a.push(`${n.label} :
|
|
1180
1180
|
${l}`);
|
|
1181
1181
|
}
|
|
1182
1182
|
return a.join(`
|
|
1183
1183
|
|
|
1184
1184
|
`);
|
|
1185
1185
|
}
|
|
1186
|
-
function mt(e, t,
|
|
1186
|
+
function mt(e, t, s = j()) {
|
|
1187
1187
|
const r = [], a = Array.isArray(e == null ? void 0 : e.fields) ? e.fields : [];
|
|
1188
|
-
for (const
|
|
1189
|
-
if (!(
|
|
1190
|
-
const i = t == null ? void 0 : t[
|
|
1188
|
+
for (const n of a) {
|
|
1189
|
+
if (!(n != null && n.key) || !(n != null && n.label)) continue;
|
|
1190
|
+
const i = t == null ? void 0 : t[n.key];
|
|
1191
1191
|
if (i == null || i === "") continue;
|
|
1192
|
-
const l = He(
|
|
1192
|
+
const l = He(n, i, s);
|
|
1193
1193
|
if (!l) continue;
|
|
1194
|
-
const _ =
|
|
1194
|
+
const _ = n.type === "textarea" || typeof l == "string" && (l.length > 60 || l.includes(`
|
|
1195
1195
|
`));
|
|
1196
|
-
r.push({ label:
|
|
1196
|
+
r.push({ label: n.label, value: l, multiline: _ });
|
|
1197
1197
|
}
|
|
1198
1198
|
return {
|
|
1199
1199
|
kind: "form_response",
|
|
1200
1200
|
data: {
|
|
1201
|
-
title: (e == null ? void 0 : e.title) ||
|
|
1201
|
+
title: (e == null ? void 0 : e.title) || s("form.title"),
|
|
1202
1202
|
fields: r
|
|
1203
1203
|
}
|
|
1204
1204
|
};
|
|
@@ -1212,11 +1212,11 @@ function _e(e) {
|
|
|
1212
1212
|
const Ee = "";
|
|
1213
1213
|
function de(e) {
|
|
1214
1214
|
let t = e;
|
|
1215
|
-
const
|
|
1215
|
+
const s = [];
|
|
1216
1216
|
return t = t.replace(/`([^`\n]+)`/g, (r, a) => {
|
|
1217
|
-
const
|
|
1218
|
-
return
|
|
1219
|
-
}), t = t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (r, a,
|
|
1217
|
+
const n = s.length;
|
|
1218
|
+
return s.push(a), `${Ee}CODE${n}${Ee}`;
|
|
1219
|
+
}), t = t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (r, a, n) => _e(n) ? `<a href="${n}" target="_blank" rel="noopener noreferrer">${a}</a>` : a), t = t.replace(/\*\*([^\n*][^\n]*?)\*\*/g, "<strong>$1</strong>"), t = t.replace(/__([^\n_][^\n]*?)__/g, "<u>$1</u>"), t = t.replace(/~~([^\n~][^\n]*?)~~/g, "<s>$1</s>"), t = t.replace(/(^|[^\w*])\*([^\n*]+?)\*(?!\w)/g, "$1<em>$2</em>"), t = t.replace(/(^|[^\w_])_([^\n_]+?)_(?!\w)/g, "$1<em>$2</em>"), t = t.replace(/CODE(\d+)/g, (r, a) => `<code class="wm-md-code">${s[+a]}</code>`), t;
|
|
1220
1220
|
}
|
|
1221
1221
|
function qe(e) {
|
|
1222
1222
|
if (!e) return "";
|
|
@@ -1226,23 +1226,23 @@ function qe(e) {
|
|
|
1226
1226
|
function ft(e) {
|
|
1227
1227
|
if (!e) return "";
|
|
1228
1228
|
const t = ze(e).split(`
|
|
1229
|
-
`),
|
|
1229
|
+
`), s = [];
|
|
1230
1230
|
let r = 0;
|
|
1231
1231
|
for (; r < t.length; ) {
|
|
1232
|
-
const
|
|
1233
|
-
if (/^\s*```([\w-]*)\s*$/.exec(
|
|
1232
|
+
const n = t[r];
|
|
1233
|
+
if (/^\s*```([\w-]*)\s*$/.exec(n)) {
|
|
1234
1234
|
r++;
|
|
1235
1235
|
const k = [];
|
|
1236
1236
|
for (; r < t.length && !/^\s*```\s*$/.test(t[r]); )
|
|
1237
1237
|
k.push(t[r]), r++;
|
|
1238
|
-
r < t.length && r++,
|
|
1238
|
+
r < t.length && r++, s.push({
|
|
1239
1239
|
type: "block",
|
|
1240
1240
|
html: `<pre class="wm-md-pre"><code>${k.join(`
|
|
1241
1241
|
`)}</code></pre>`
|
|
1242
1242
|
});
|
|
1243
1243
|
continue;
|
|
1244
1244
|
}
|
|
1245
|
-
if (/^\s*[-*]\s+/.test(
|
|
1245
|
+
if (/^\s*[-*]\s+/.test(n)) {
|
|
1246
1246
|
const k = [];
|
|
1247
1247
|
for (; r < t.length; ) {
|
|
1248
1248
|
const T = /^\s*[-*]\s+(.*)$/.exec(t[r]);
|
|
@@ -1250,13 +1250,13 @@ function ft(e) {
|
|
|
1250
1250
|
k.push(T[1]), r++;
|
|
1251
1251
|
}
|
|
1252
1252
|
const w = k.map((T) => `<li>${de(T)}</li>`).join("");
|
|
1253
|
-
|
|
1253
|
+
s.push({
|
|
1254
1254
|
type: "block",
|
|
1255
1255
|
html: `<ul class="wm-md-ul">${w}</ul>`
|
|
1256
1256
|
});
|
|
1257
1257
|
continue;
|
|
1258
1258
|
}
|
|
1259
|
-
const l = /^\s*(\d+)\.\s+(.*)$/.exec(
|
|
1259
|
+
const l = /^\s*(\d+)\.\s+(.*)$/.exec(n);
|
|
1260
1260
|
if (l) {
|
|
1261
1261
|
const k = parseInt(l[1], 10), w = [l[2]];
|
|
1262
1262
|
for (r++; r < t.length; ) {
|
|
@@ -1265,36 +1265,36 @@ function ft(e) {
|
|
|
1265
1265
|
w.push(A[1]), r++;
|
|
1266
1266
|
}
|
|
1267
1267
|
const T = w.map((A) => `<li>${de(A)}</li>`).join(""), E = k !== 1 ? ` start="${k}"` : "";
|
|
1268
|
-
|
|
1268
|
+
s.push({
|
|
1269
1269
|
type: "block",
|
|
1270
1270
|
html: `<ol class="wm-md-ol"${E}>${T}</ol>`
|
|
1271
1271
|
});
|
|
1272
1272
|
continue;
|
|
1273
1273
|
}
|
|
1274
|
-
const _ = /^(#{1,6})\s+(.*)$/.exec(
|
|
1274
|
+
const _ = /^(#{1,6})\s+(.*)$/.exec(n);
|
|
1275
1275
|
if (_) {
|
|
1276
1276
|
const k = _[1].length;
|
|
1277
|
-
|
|
1277
|
+
s.push({
|
|
1278
1278
|
type: "block",
|
|
1279
1279
|
html: `<h${k} class="wm-md-h wm-md-h${k}">${de(_[2])}</h${k}>`
|
|
1280
1280
|
}), r++;
|
|
1281
1281
|
continue;
|
|
1282
1282
|
}
|
|
1283
|
-
|
|
1283
|
+
s.push({ type: "text", html: de(n) }), r++;
|
|
1284
1284
|
}
|
|
1285
1285
|
let a = "";
|
|
1286
|
-
for (let
|
|
1287
|
-
const i = n
|
|
1286
|
+
for (let n = 0; n < s.length; n++) {
|
|
1287
|
+
const i = s[n];
|
|
1288
1288
|
a += i.html;
|
|
1289
|
-
const l = n
|
|
1289
|
+
const l = s[n + 1];
|
|
1290
1290
|
l && i.type !== "block" && l.type !== "block" && (a += `
|
|
1291
1291
|
`);
|
|
1292
1292
|
}
|
|
1293
1293
|
return a;
|
|
1294
1294
|
}
|
|
1295
1295
|
function he(e) {
|
|
1296
|
-
var
|
|
1297
|
-
const t = (
|
|
1296
|
+
var s;
|
|
1297
|
+
const t = (s = e == null ? void 0 : e.author) == null ? void 0 : s.type;
|
|
1298
1298
|
return t === "agent_ia" || t === "agent_human";
|
|
1299
1299
|
}
|
|
1300
1300
|
function Y(e) {
|
|
@@ -1303,19 +1303,19 @@ function Y(e) {
|
|
|
1303
1303
|
return Number.isFinite(t) ? t : null;
|
|
1304
1304
|
}
|
|
1305
1305
|
function Be(e, t) {
|
|
1306
|
-
let
|
|
1306
|
+
let s = (e == null ? void 0 : e.last_message_at) || (e == null ? void 0 : e.updated_at) || (e == null ? void 0 : e.created_at) || "";
|
|
1307
1307
|
for (const r of t)
|
|
1308
|
-
r != null && r.created_at && r.created_at >
|
|
1309
|
-
return
|
|
1308
|
+
r != null && r.created_at && r.created_at > s && (s = r.created_at);
|
|
1309
|
+
return s;
|
|
1310
1310
|
}
|
|
1311
1311
|
function _t(e, t) {
|
|
1312
|
-
var
|
|
1313
|
-
for (let
|
|
1314
|
-
const i = t[
|
|
1312
|
+
var s, r, a;
|
|
1313
|
+
for (let n = t.length - 1; n >= 0; n--) {
|
|
1314
|
+
const i = t[n];
|
|
1315
1315
|
if (!i) continue;
|
|
1316
1316
|
const l = typeof i.text_md == "string" ? i.text_md.trim() : "";
|
|
1317
1317
|
if (l)
|
|
1318
|
-
return (((
|
|
1318
|
+
return (((s = i.author) == null ? void 0 : s.type) === "user" ? "Vous : " : "") + l.replace(/\s+/g, " ");
|
|
1319
1319
|
const _ = (r = i.payload) == null ? void 0 : r.attachments;
|
|
1320
1320
|
if (Array.isArray(_) && _.length) return "📎 Pièce jointe";
|
|
1321
1321
|
}
|
|
@@ -1324,29 +1324,29 @@ function _t(e, t) {
|
|
|
1324
1324
|
function gt(e, t) {
|
|
1325
1325
|
return (e == null ? void 0 : e.name) || ((e == null ? void 0 : e.type) === "user" ? t("common.you") : (e == null ? void 0 : e.type) === "agent_human" ? t("common.agent") : (e == null ? void 0 : e.type) === "agent_ia" ? t("common.aiAssistant") : t("common.system"));
|
|
1326
1326
|
}
|
|
1327
|
-
function pt(e, t,
|
|
1327
|
+
function pt(e, t, s, r) {
|
|
1328
1328
|
const a = [
|
|
1329
|
-
`# ${e.name ||
|
|
1330
|
-
e.created_at ?
|
|
1329
|
+
`# ${e.name || s("common.conversation")}`,
|
|
1330
|
+
e.created_at ? s("export.createdOn", {
|
|
1331
1331
|
date: new Date(e.created_at).toLocaleString(r)
|
|
1332
1332
|
}) : "",
|
|
1333
1333
|
""
|
|
1334
1334
|
];
|
|
1335
|
-
for (const
|
|
1336
|
-
if (!
|
|
1337
|
-
const i = (
|
|
1335
|
+
for (const n of t) {
|
|
1336
|
+
if (!n) continue;
|
|
1337
|
+
const i = (n.text_md || "").trim();
|
|
1338
1338
|
if (!i) continue;
|
|
1339
|
-
const l = gt(
|
|
1339
|
+
const l = gt(n.author, s), _ = n.created_at ? new Date(n.created_at).toLocaleString(r) : "";
|
|
1340
1340
|
a.push(`[${_}] ${l} :`), a.push(i), a.push("");
|
|
1341
1341
|
}
|
|
1342
1342
|
return a.join(`
|
|
1343
1343
|
`);
|
|
1344
1344
|
}
|
|
1345
|
-
function vt(e, t,
|
|
1345
|
+
function vt(e, t, s = j(), r) {
|
|
1346
1346
|
if (!e) return;
|
|
1347
|
-
const a = pt(e, t || [],
|
|
1347
|
+
const a = pt(e, t || [], s, ne(r)), n = new Blob([a], { type: "text/plain;charset=utf-8" });
|
|
1348
1348
|
try {
|
|
1349
|
-
const i = URL.createObjectURL(
|
|
1349
|
+
const i = URL.createObjectURL(n), l = document.createElement("a");
|
|
1350
1350
|
l.href = i, l.download = `${(e.name || "conversation").replace(/[^a-z0-9-_]+/gi, "_")}.txt`, document.body.appendChild(l), l.click(), document.body.removeChild(l), setTimeout(() => URL.revokeObjectURL(i), 1e3);
|
|
1351
1351
|
} catch (i) {
|
|
1352
1352
|
console.error("[ww-messenger] export failed", i);
|
|
@@ -1442,10 +1442,10 @@ const yt = {
|
|
|
1442
1442
|
if (t === "default") {
|
|
1443
1443
|
try {
|
|
1444
1444
|
t = await Notification.requestPermission();
|
|
1445
|
-
} catch (
|
|
1445
|
+
} catch (s) {
|
|
1446
1446
|
console.warn(
|
|
1447
1447
|
"[ww-messenger] notif permission request failed",
|
|
1448
|
-
|
|
1448
|
+
s
|
|
1449
1449
|
), t = "denied";
|
|
1450
1450
|
}
|
|
1451
1451
|
this.notifPermission = t;
|
|
@@ -1464,8 +1464,8 @@ const yt = {
|
|
|
1464
1464
|
onMessageRevealed(e, t) {
|
|
1465
1465
|
var a;
|
|
1466
1466
|
if (!this.soundEnabled && !this.browserNotifEnabled || !t || !e || !he(e)) return;
|
|
1467
|
-
const
|
|
1468
|
-
this.isOpen && !
|
|
1467
|
+
const s = typeof document < "u" && document.hidden;
|
|
1468
|
+
this.isOpen && !s && ((a = this.currentConv) == null ? void 0 : a.id) === t || (this.soundEnabled && this.playNotificationSound(), this.browserNotifEnabled && this.showBrowserNotification(t, e));
|
|
1469
1469
|
},
|
|
1470
1470
|
playNotificationSound() {
|
|
1471
1471
|
if (typeof window > "u") return;
|
|
@@ -1479,16 +1479,16 @@ const yt = {
|
|
|
1479
1479
|
t.resume();
|
|
1480
1480
|
} catch {
|
|
1481
1481
|
}
|
|
1482
|
-
const
|
|
1483
|
-
r.connect(a), a.connect(t.destination), r.type = "sine", r.frequency.setValueAtTime(880,
|
|
1482
|
+
const s = t.currentTime, r = t.createOscillator(), a = t.createGain();
|
|
1483
|
+
r.connect(a), a.connect(t.destination), r.type = "sine", r.frequency.setValueAtTime(880, s), r.frequency.exponentialRampToValueAtTime(1320, s + 0.08), a.gain.setValueAtTime(0, s), a.gain.linearRampToValueAtTime(0.12, s + 0.02), a.gain.exponentialRampToValueAtTime(1e-4, s + 0.28), r.start(s), r.stop(s + 0.32);
|
|
1484
1484
|
} catch {
|
|
1485
1485
|
}
|
|
1486
1486
|
},
|
|
1487
1487
|
showBrowserNotification(e, t) {
|
|
1488
1488
|
if (typeof Notification > "u" || Notification.permission !== "granted") return;
|
|
1489
|
-
const
|
|
1489
|
+
const s = t == null ? void 0 : t.author, r = !s || s.type === "agent_ia", n = ((s == null ? void 0 : s.name) || (r ? this.agentName : "") || this.t("launcher.theAgent")) + this.t("launcher.repliedToYou"), i = typeof (t == null ? void 0 : t.text_md) == "string" ? t.text_md.trim() : "", l = i ? i.slice(0, 140) : this.t("notification.youHaveNewMessage");
|
|
1490
1490
|
try {
|
|
1491
|
-
const _ = new Notification(
|
|
1491
|
+
const _ = new Notification(n, {
|
|
1492
1492
|
body: l,
|
|
1493
1493
|
tag: `wm-${e}`,
|
|
1494
1494
|
renotify: !1,
|
|
@@ -1559,7 +1559,11 @@ const yt = {
|
|
|
1559
1559
|
// used by the activity-driven background fetch. Reset by
|
|
1560
1560
|
// teardownLiveReveal.
|
|
1561
1561
|
_liveRevealOff: null,
|
|
1562
|
-
_liveRevealConvSnapshot: null
|
|
1562
|
+
_liveRevealConvSnapshot: null,
|
|
1563
|
+
// Wall-clock instant we started listening for live messages.
|
|
1564
|
+
// Anything created before this is history, not realtime, and must
|
|
1565
|
+
// not ring the notification (see paceLiveMessage freshness gate).
|
|
1566
|
+
_liveRevealStartedAt: 0
|
|
1563
1567
|
};
|
|
1564
1568
|
},
|
|
1565
1569
|
methods: {
|
|
@@ -1580,15 +1584,15 @@ const yt = {
|
|
|
1580
1584
|
// the activity isn't replayed via SSE, so we fetch it explicitly and
|
|
1581
1585
|
// run it through pacing.
|
|
1582
1586
|
setupLiveReveal() {
|
|
1583
|
-
var
|
|
1587
|
+
var s;
|
|
1584
1588
|
if (!this.transport) return;
|
|
1585
|
-
this.teardownLiveReveal();
|
|
1589
|
+
this.teardownLiveReveal(), this._liveRevealStartedAt = Date.now();
|
|
1586
1590
|
const e = this.transport.on("message", (r) => {
|
|
1587
|
-
const a = r == null ? void 0 : r.conversation_id,
|
|
1588
|
-
a &&
|
|
1591
|
+
const a = r == null ? void 0 : r.conversation_id, n = r == null ? void 0 : r.message;
|
|
1592
|
+
a && n && this.paceLiveMessage(n, a);
|
|
1589
1593
|
});
|
|
1590
1594
|
this._liveRevealConvSnapshot = new Map(
|
|
1591
|
-
(((
|
|
1595
|
+
(((s = this.s) == null ? void 0 : s.conversations) || []).map((r) => [
|
|
1592
1596
|
r.id,
|
|
1593
1597
|
(r == null ? void 0 : r.last_message_at) || ""
|
|
1594
1598
|
])
|
|
@@ -1624,15 +1628,15 @@ const yt = {
|
|
|
1624
1628
|
// on background convs when SSE wasn't open at the moment they
|
|
1625
1629
|
// arrived.
|
|
1626
1630
|
async handleLiveActivity(e) {
|
|
1627
|
-
var a,
|
|
1631
|
+
var a, n;
|
|
1628
1632
|
const t = e == null ? void 0 : e.conversations;
|
|
1629
1633
|
if (!Array.isArray(t) || !this.store) return;
|
|
1630
|
-
const
|
|
1634
|
+
const s = this._liveRevealConvSnapshot || /* @__PURE__ */ new Map(), r = [];
|
|
1631
1635
|
for (const i of t) {
|
|
1632
1636
|
if (!(i != null && i.id)) continue;
|
|
1633
1637
|
const l = i.last_message_at || "";
|
|
1634
1638
|
if (!l) continue;
|
|
1635
|
-
const _ =
|
|
1639
|
+
const _ = s.get(i.id) || "";
|
|
1636
1640
|
l > _ && r.push(i.id);
|
|
1637
1641
|
}
|
|
1638
1642
|
this._liveRevealConvSnapshot = new Map(
|
|
@@ -1640,7 +1644,7 @@ const yt = {
|
|
|
1640
1644
|
);
|
|
1641
1645
|
for (const i of r)
|
|
1642
1646
|
try {
|
|
1643
|
-
const l = await ((
|
|
1647
|
+
const l = await ((n = (a = this.store).fetchSinceLast) == null ? void 0 : n.call(a, i));
|
|
1644
1648
|
if (!Array.isArray(l)) continue;
|
|
1645
1649
|
for (const _ of l) this.paceLiveMessage(_, i);
|
|
1646
1650
|
} catch (l) {
|
|
@@ -1656,13 +1660,13 @@ const yt = {
|
|
|
1656
1660
|
// - inter-bubble gap scales with message length (reading time),
|
|
1657
1661
|
// bounded by MIN/MAX_TYPING_MS.
|
|
1658
1662
|
scheduleReveal(e, t) {
|
|
1659
|
-
const
|
|
1660
|
-
|
|
1661
|
-
Math.max(
|
|
1663
|
+
const s = this.revealPacing, r = Date.now(), a = ((e == null ? void 0 : e.text_md) || "").length, n = Math.min(
|
|
1664
|
+
s.maxTypingMs,
|
|
1665
|
+
Math.max(s.minTypingMs, a * s.msPerChar)
|
|
1662
1666
|
), l = Math.max(
|
|
1663
|
-
r +
|
|
1664
|
-
this.nextRevealAt +
|
|
1665
|
-
) +
|
|
1667
|
+
r + s.firstRevealDelayMs,
|
|
1668
|
+
this.nextRevealAt + s.pauseBetweenMs
|
|
1669
|
+
) + n;
|
|
1666
1670
|
this.nextRevealAt = l;
|
|
1667
1671
|
const _ = Math.max(0, l - r), k = e.id, w = setTimeout(() => {
|
|
1668
1672
|
this.revealedAt = { ...this.revealedAt, [k]: Date.now() }, this.revealTimers = this.revealTimers.filter((T) => T !== w), typeof this.onMessageRevealed == "function" && this.onMessageRevealed(e, t);
|
|
@@ -1677,24 +1681,24 @@ const yt = {
|
|
|
1677
1681
|
paceMessages(e, t) {
|
|
1678
1682
|
var a;
|
|
1679
1683
|
if (!Array.isArray(e) || !e.length) return;
|
|
1680
|
-
const
|
|
1681
|
-
for (const
|
|
1682
|
-
if ((
|
|
1683
|
-
if (!he(
|
|
1684
|
-
r[
|
|
1684
|
+
const s = Date.now(), r = { ...this.revealedAt };
|
|
1685
|
+
for (const n of e) {
|
|
1686
|
+
if ((n == null ? void 0 : n.id) == null || r[n.id] !== void 0) continue;
|
|
1687
|
+
if (!he(n)) {
|
|
1688
|
+
r[n.id] = s;
|
|
1685
1689
|
continue;
|
|
1686
1690
|
}
|
|
1687
|
-
const i =
|
|
1691
|
+
const i = n != null && n.created_at ? Date.parse(n.created_at) : NaN;
|
|
1688
1692
|
if (!Number.isFinite(i) || i < this.convOpenedAt) {
|
|
1689
|
-
r[
|
|
1693
|
+
r[n.id] = s;
|
|
1690
1694
|
continue;
|
|
1691
1695
|
}
|
|
1692
|
-
const l = typeof (
|
|
1696
|
+
const l = typeof (n == null ? void 0 : n.text_md) == "string" && n.text_md.trim().length > 0, _ = Array.isArray((a = n == null ? void 0 : n.payload) == null ? void 0 : a.attachments) && n.payload.attachments.length > 0;
|
|
1693
1697
|
if (!l && !_) {
|
|
1694
|
-
r[
|
|
1698
|
+
r[n.id] = s;
|
|
1695
1699
|
continue;
|
|
1696
1700
|
}
|
|
1697
|
-
r[
|
|
1701
|
+
r[n.id] = 0, this.scheduleReveal(n, t);
|
|
1698
1702
|
}
|
|
1699
1703
|
this.revealedAt = r;
|
|
1700
1704
|
},
|
|
@@ -1705,18 +1709,28 @@ const yt = {
|
|
|
1705
1709
|
// the watcher path and the live path can both fire for the same
|
|
1706
1710
|
// message without double-scheduling.
|
|
1707
1711
|
//
|
|
1708
|
-
//
|
|
1709
|
-
//
|
|
1710
|
-
//
|
|
1712
|
+
// Freshness gate on `_liveRevealStartedAt`: only messages created
|
|
1713
|
+
// AFTER we started listening are truly realtime and ring the
|
|
1714
|
+
// notification. A transport `message` burst can be replayed, and the
|
|
1715
|
+
// activity-driven `fetchSinceLast` delta can return history the user
|
|
1716
|
+
// already saw — most visibly on reopening the panel, where it would
|
|
1717
|
+
// otherwise schedule a reveal (and a whistle) for every past message.
|
|
1718
|
+
// Old messages reveal instantly and silently; new ones go through
|
|
1719
|
+
// scheduleReveal (the path that fires onMessageRevealed).
|
|
1711
1720
|
paceLiveMessage(e, t) {
|
|
1712
|
-
var
|
|
1721
|
+
var n;
|
|
1713
1722
|
if (!(e != null && e.id) || this.revealedAt[e.id] !== void 0) return;
|
|
1714
1723
|
if (!he(e)) {
|
|
1715
1724
|
this.revealedAt = { ...this.revealedAt, [e.id]: Date.now() };
|
|
1716
1725
|
return;
|
|
1717
1726
|
}
|
|
1718
|
-
const
|
|
1719
|
-
if (!
|
|
1727
|
+
const s = typeof (e == null ? void 0 : e.text_md) == "string" && e.text_md.trim().length > 0, r = Array.isArray((n = e == null ? void 0 : e.payload) == null ? void 0 : n.attachments) && e.payload.attachments.length > 0;
|
|
1728
|
+
if (!s && !r) {
|
|
1729
|
+
this.revealedAt = { ...this.revealedAt, [e.id]: Date.now() };
|
|
1730
|
+
return;
|
|
1731
|
+
}
|
|
1732
|
+
const a = e != null && e.created_at ? Date.parse(e.created_at) : NaN;
|
|
1733
|
+
if (!Number.isFinite(a) || a < this._liveRevealStartedAt) {
|
|
1720
1734
|
this.revealedAt = { ...this.revealedAt, [e.id]: Date.now() };
|
|
1721
1735
|
return;
|
|
1722
1736
|
}
|
|
@@ -1782,12 +1796,12 @@ const yt = {
|
|
|
1782
1796
|
// messages, or when the pointer is already at/ahead of the
|
|
1783
1797
|
// candidate id.
|
|
1784
1798
|
markConvRead(e) {
|
|
1785
|
-
var
|
|
1799
|
+
var n, i;
|
|
1786
1800
|
if (!(e != null && e.id) || e._draft || !this.store) return;
|
|
1787
|
-
const t = ((i = (
|
|
1788
|
-
if (
|
|
1789
|
-
const r = Y(e.last_read_message_id), a = Y(
|
|
1790
|
-
a != null && (r != null && a <= r || (this._readMarkerPending = { convId: e.id, messageId:
|
|
1801
|
+
const t = ((i = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : i[e.id]) || [], s = At(t);
|
|
1802
|
+
if (s == null) return;
|
|
1803
|
+
const r = Y(e.last_read_message_id), a = Y(s);
|
|
1804
|
+
a != null && (r != null && a <= r || (this._readMarkerPending = { convId: e.id, messageId: s }, !this._readMarkerTimer && (this._readMarkerTimer = setTimeout(() => {
|
|
1791
1805
|
const l = this._readMarkerPending;
|
|
1792
1806
|
this._readMarkerPending = null, this._readMarkerTimer = null, l && this.store && this.store.markConversationRead(
|
|
1793
1807
|
l.convId,
|
|
@@ -1799,17 +1813,17 @@ const yt = {
|
|
|
1799
1813
|
};
|
|
1800
1814
|
function At(e) {
|
|
1801
1815
|
for (let t = e.length - 1; t >= 0; t--) {
|
|
1802
|
-
const
|
|
1803
|
-
if (!(!
|
|
1804
|
-
return
|
|
1816
|
+
const s = e[t];
|
|
1817
|
+
if (!(!s || s._pending) && Y(s.id) != null)
|
|
1818
|
+
return s.id;
|
|
1805
1819
|
}
|
|
1806
1820
|
return null;
|
|
1807
1821
|
}
|
|
1808
1822
|
const P = (e, t) => {
|
|
1809
|
-
const
|
|
1823
|
+
const s = e.__vccOpts || e;
|
|
1810
1824
|
for (const [r, a] of t)
|
|
1811
|
-
|
|
1812
|
-
return
|
|
1825
|
+
s[r] = a;
|
|
1826
|
+
return s;
|
|
1813
1827
|
}, St = {
|
|
1814
1828
|
name: "WmHumanAvatar",
|
|
1815
1829
|
props: {
|
|
@@ -1831,24 +1845,24 @@ const P = (e, t) => {
|
|
|
1831
1845
|
}
|
|
1832
1846
|
}
|
|
1833
1847
|
}, Mt = ["src", "alt"];
|
|
1834
|
-
function Tt(e, t,
|
|
1848
|
+
function Tt(e, t, s, r, a, n) {
|
|
1835
1849
|
return c(), d("div", {
|
|
1836
|
-
class: R(["wm-huav", { "wm-huav--tail":
|
|
1850
|
+
class: R(["wm-huav", { "wm-huav--tail": s.tail }]),
|
|
1837
1851
|
style: z({
|
|
1838
|
-
width:
|
|
1839
|
-
height:
|
|
1840
|
-
"--wm-avr": Math.round(
|
|
1841
|
-
background:
|
|
1852
|
+
width: s.size + "px",
|
|
1853
|
+
height: s.size + "px",
|
|
1854
|
+
"--wm-avr": Math.round(s.size * 0.32) + "px",
|
|
1855
|
+
background: n.bg
|
|
1842
1856
|
})
|
|
1843
1857
|
}, [
|
|
1844
|
-
|
|
1858
|
+
s.avatarUrl ? (c(), d("img", {
|
|
1845
1859
|
key: 0,
|
|
1846
|
-
src:
|
|
1847
|
-
alt:
|
|
1860
|
+
src: s.avatarUrl,
|
|
1861
|
+
alt: s.name || ""
|
|
1848
1862
|
}, null, 8, Mt)) : (c(), d("span", {
|
|
1849
1863
|
key: 1,
|
|
1850
|
-
style: z({ fontSize:
|
|
1851
|
-
}, v(
|
|
1864
|
+
style: z({ fontSize: s.size * 0.36 + "px" })
|
|
1865
|
+
}, v(n.initials), 5))
|
|
1852
1866
|
], 6);
|
|
1853
1867
|
}
|
|
1854
1868
|
const ve = /* @__PURE__ */ P(St, [["render", Tt], ["__scopeId", "data-v-14e10c0d"]]), xt = 3, Ot = {
|
|
@@ -1877,8 +1891,8 @@ const ve = /* @__PURE__ */ P(St, [["render", Tt], ["__scopeId", "data-v-14e10c0d
|
|
|
1877
1891
|
return this.peeks.slice(0, xt).reverse();
|
|
1878
1892
|
}
|
|
1879
1893
|
}
|
|
1880
|
-
}, Rt = ["aria-label", "onClick", "onKeydown"], Lt = ["aria-label", "onClick"], It = { class: "wm-peek__avatar" }, Et = ["aria-label"], Bt = { class: "wm-peek__body" }, Pt = { class: "wm-peek__head" },
|
|
1881
|
-
function zt(e, t,
|
|
1894
|
+
}, Rt = ["aria-label", "onClick", "onKeydown"], Lt = ["aria-label", "onClick"], It = { class: "wm-peek__avatar" }, Et = ["aria-label"], Bt = { class: "wm-peek__body" }, Pt = { class: "wm-peek__head" }, Dt = { class: "wm-peek__name" }, Nt = { class: "wm-peek__action" }, Ut = { class: "wm-peek__text" }, Ft = ["onClick"], jt = ["aria-label"], Ht = ["aria-label"];
|
|
1895
|
+
function zt(e, t, s, r, a, n) {
|
|
1882
1896
|
const i = B("HumanAvatar");
|
|
1883
1897
|
return c(), d("div", {
|
|
1884
1898
|
class: "wm-launcherWrap",
|
|
@@ -1887,23 +1901,23 @@ function zt(e, t, n, r, a, s) {
|
|
|
1887
1901
|
onFocusin: t[3] || (t[3] = (l) => e.$emit("hover", !0)),
|
|
1888
1902
|
onFocusout: t[4] || (t[4] = (l) => e.$emit("hover", !1))
|
|
1889
1903
|
}, [
|
|
1890
|
-
$(
|
|
1904
|
+
$(Ue, { name: "wm-peek" }, {
|
|
1891
1905
|
default: Fe(() => [
|
|
1892
|
-
|
|
1906
|
+
n.visiblePeeks.length ? (c(), d("div", {
|
|
1893
1907
|
key: 0,
|
|
1894
|
-
class: R(["wm-peekStack", { "wm-peekStack--multi":
|
|
1908
|
+
class: R(["wm-peekStack", { "wm-peekStack--multi": n.visiblePeeks.length > 1 }])
|
|
1895
1909
|
}, [
|
|
1896
|
-
(c(!0), d(I, null, F(
|
|
1910
|
+
(c(!0), d(I, null, F(n.visiblePeeks, (l, _) => (c(), d("div", {
|
|
1897
1911
|
key: l.convId,
|
|
1898
1912
|
class: "wm-peek",
|
|
1899
1913
|
style: z({
|
|
1900
|
-
"--depth":
|
|
1914
|
+
"--depth": n.visiblePeeks.length - 1 - _,
|
|
1901
1915
|
zIndex: _ + 1
|
|
1902
1916
|
}),
|
|
1903
1917
|
role: "button",
|
|
1904
1918
|
tabindex: "0",
|
|
1905
|
-
"aria-label":
|
|
1906
|
-
name: l.senderName ||
|
|
1919
|
+
"aria-label": n.t("launcher.openConversationWith", {
|
|
1920
|
+
name: l.senderName || n.t("launcher.theAgent")
|
|
1907
1921
|
}),
|
|
1908
1922
|
onClick: (k) => e.$emit("open", l.convId),
|
|
1909
1923
|
onKeydown: [
|
|
@@ -1914,7 +1928,7 @@ function zt(e, t, n, r, a, s) {
|
|
|
1914
1928
|
o("button", {
|
|
1915
1929
|
type: "button",
|
|
1916
1930
|
class: "wm-peek__close",
|
|
1917
|
-
"aria-label":
|
|
1931
|
+
"aria-label": n.t("launcher.dismiss"),
|
|
1918
1932
|
onClick: J((k) => e.$emit("dismiss", l.convId), ["stop"])
|
|
1919
1933
|
}, [...t[5] || (t[5] = [
|
|
1920
1934
|
o("svg", {
|
|
@@ -1940,21 +1954,21 @@ function zt(e, t, n, r, a, s) {
|
|
|
1940
1954
|
l.count > 1 ? (c(), d("span", {
|
|
1941
1955
|
key: 0,
|
|
1942
1956
|
class: "wm-peek__avatarBadge",
|
|
1943
|
-
"aria-label":
|
|
1957
|
+
"aria-label": n.t("launcher.unreadMessages", { count: l.count })
|
|
1944
1958
|
}, v(l.count > 9 ? "9+" : l.count), 9, Et)) : b("", !0)
|
|
1945
1959
|
]),
|
|
1946
1960
|
o("div", Bt, [
|
|
1947
1961
|
o("div", Pt, [
|
|
1948
|
-
o("span",
|
|
1949
|
-
o("span",
|
|
1962
|
+
o("span", Dt, v(l.senderName || n.t("common.agent")), 1),
|
|
1963
|
+
o("span", Nt, v(n.t("launcher.repliedToYou")), 1)
|
|
1950
1964
|
]),
|
|
1951
|
-
o("p",
|
|
1965
|
+
o("p", Ut, v(l.preview), 1)
|
|
1952
1966
|
]),
|
|
1953
1967
|
o("button", {
|
|
1954
1968
|
type: "button",
|
|
1955
1969
|
class: "wm-peek__open",
|
|
1956
1970
|
onClick: J((k) => e.$emit("open", l.convId), ["stop"])
|
|
1957
|
-
}, v(
|
|
1971
|
+
}, v(n.t("common.open")), 9, Ft)
|
|
1958
1972
|
], 44, Rt))), 128))
|
|
1959
1973
|
], 2)) : b("", !0)
|
|
1960
1974
|
]),
|
|
@@ -1963,7 +1977,7 @@ function zt(e, t, n, r, a, s) {
|
|
|
1963
1977
|
o("button", {
|
|
1964
1978
|
type: "button",
|
|
1965
1979
|
class: "wm-launcher",
|
|
1966
|
-
"aria-label":
|
|
1980
|
+
"aria-label": n.t("launcher.open"),
|
|
1967
1981
|
onClick: t[0] || (t[0] = (l) => e.$emit("open"))
|
|
1968
1982
|
}, [
|
|
1969
1983
|
t[6] || (t[6] = o("svg", {
|
|
@@ -1979,15 +1993,15 @@ function zt(e, t, n, r, a, s) {
|
|
|
1979
1993
|
}, [
|
|
1980
1994
|
o("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
|
|
1981
1995
|
], -1)),
|
|
1982
|
-
|
|
1996
|
+
s.unreadCount > 0 ? (c(), d("span", {
|
|
1983
1997
|
key: 0,
|
|
1984
1998
|
class: "wm-launcher__badge",
|
|
1985
|
-
"aria-label":
|
|
1986
|
-
count:
|
|
1987
|
-
}) :
|
|
1988
|
-
count:
|
|
1999
|
+
"aria-label": s.unreadCount > 1 ? n.t("launcher.unreadConversationsMany", {
|
|
2000
|
+
count: s.unreadCount
|
|
2001
|
+
}) : n.t("launcher.unreadConversationsOne", {
|
|
2002
|
+
count: s.unreadCount
|
|
1989
2003
|
})
|
|
1990
|
-
}, v(
|
|
2004
|
+
}, v(s.unreadCount > 9 ? "9+" : s.unreadCount), 9, Ht)) : b("", !0)
|
|
1991
2005
|
], 8, jt)
|
|
1992
2006
|
], 32);
|
|
1993
2007
|
}
|
|
@@ -2024,37 +2038,37 @@ const qt = /* @__PURE__ */ P(Ot, [["render", zt], ["__scopeId", "data-v-d81459bc
|
|
|
2024
2038
|
key: 0,
|
|
2025
2039
|
class: "wm-aiav__pulse"
|
|
2026
2040
|
}, Kt = ["src", "alt"], Wt = ["width", "height"];
|
|
2027
|
-
function Gt(e, t,
|
|
2041
|
+
function Gt(e, t, s, r, a, n) {
|
|
2028
2042
|
return c(), d("div", {
|
|
2029
|
-
class: R(["wm-aiav", { "wm-aiav--tail":
|
|
2043
|
+
class: R(["wm-aiav", { "wm-aiav--tail": s.tail }]),
|
|
2030
2044
|
style: z({
|
|
2031
|
-
width:
|
|
2032
|
-
height:
|
|
2033
|
-
"--wm-avr":
|
|
2045
|
+
width: s.size + "px",
|
|
2046
|
+
height: s.size + "px",
|
|
2047
|
+
"--wm-avr": s.size * 0.32 + "px"
|
|
2034
2048
|
})
|
|
2035
2049
|
}, [
|
|
2036
|
-
|
|
2050
|
+
s.pulse ? (c(), d("div", $t)) : b("", !0),
|
|
2037
2051
|
o("div", {
|
|
2038
2052
|
class: R(["wm-aiav__inner", {
|
|
2039
|
-
"wm-aiav__inner--glow":
|
|
2040
|
-
"wm-aiav__inner--img": !!
|
|
2041
|
-
"wm-aiav__inner--initials": !
|
|
2053
|
+
"wm-aiav__inner--glow": s.pulse,
|
|
2054
|
+
"wm-aiav__inner--img": !!s.imageUrl,
|
|
2055
|
+
"wm-aiav__inner--initials": !s.imageUrl && !!n.initials
|
|
2042
2056
|
}]),
|
|
2043
2057
|
style: z(
|
|
2044
|
-
!
|
|
2058
|
+
!s.imageUrl && n.initials ? { background: n.bgColor } : null
|
|
2045
2059
|
)
|
|
2046
2060
|
}, [
|
|
2047
|
-
|
|
2061
|
+
s.imageUrl ? (c(), d("img", {
|
|
2048
2062
|
key: 0,
|
|
2049
|
-
src:
|
|
2050
|
-
alt:
|
|
2051
|
-
}, null, 8, Kt)) :
|
|
2063
|
+
src: s.imageUrl,
|
|
2064
|
+
alt: s.name || ""
|
|
2065
|
+
}, null, 8, Kt)) : n.initials ? (c(), d("span", {
|
|
2052
2066
|
key: 1,
|
|
2053
|
-
style: z({ fontSize:
|
|
2054
|
-
}, v(
|
|
2067
|
+
style: z({ fontSize: s.size * 0.36 + "px" })
|
|
2068
|
+
}, v(n.initials), 5)) : (c(), d("svg", {
|
|
2055
2069
|
key: 2,
|
|
2056
|
-
width:
|
|
2057
|
-
height:
|
|
2070
|
+
width: s.size * 0.5,
|
|
2071
|
+
height: s.size * 0.5,
|
|
2058
2072
|
viewBox: "0 0 24 24",
|
|
2059
2073
|
fill: "none",
|
|
2060
2074
|
"aria-hidden": "true"
|
|
@@ -2111,29 +2125,29 @@ const oe = /* @__PURE__ */ P(Vt, [["render", Gt], ["__scopeId", "data-v-6f7f685d
|
|
|
2111
2125
|
key: 0,
|
|
2112
2126
|
class: "wm-team__label"
|
|
2113
2127
|
};
|
|
2114
|
-
function en(e, t,
|
|
2115
|
-
return
|
|
2128
|
+
function en(e, t, s, r, a, n) {
|
|
2129
|
+
return n.visible ? (c(), d("div", Jt, [
|
|
2116
2130
|
o("div", {
|
|
2117
2131
|
class: "wm-team__stack",
|
|
2118
|
-
style: z({ width:
|
|
2132
|
+
style: z({ width: n.stackWidth + "px" })
|
|
2119
2133
|
}, [
|
|
2120
|
-
(c(!0), d(I, null, F(
|
|
2134
|
+
(c(!0), d(I, null, F(s.members.slice(0, 3), (i, l) => (c(), d("div", {
|
|
2121
2135
|
key: l,
|
|
2122
2136
|
class: "wm-team__pill",
|
|
2123
2137
|
style: z({
|
|
2124
2138
|
left: l * 13 + "px",
|
|
2125
2139
|
zIndex: 3 - l,
|
|
2126
|
-
background:
|
|
2140
|
+
background: n.colorFor(i)
|
|
2127
2141
|
})
|
|
2128
2142
|
}, [
|
|
2129
2143
|
i.avatar_url ? (c(), d("img", {
|
|
2130
2144
|
key: 0,
|
|
2131
2145
|
src: i.avatar_url,
|
|
2132
2146
|
alt: i.name || ""
|
|
2133
|
-
}, null, 8, Xt)) : (c(), d("span", Qt, v(
|
|
2147
|
+
}, null, 8, Xt)) : (c(), d("span", Qt, v(n.initialsFor(i)), 1))
|
|
2134
2148
|
], 4))), 128))
|
|
2135
2149
|
], 4),
|
|
2136
|
-
|
|
2150
|
+
s.responseLabel ? (c(), d("span", Zt, v(s.responseLabel), 1)) : b("", !0)
|
|
2137
2151
|
])) : b("", !0);
|
|
2138
2152
|
}
|
|
2139
2153
|
const tn = /* @__PURE__ */ P(Yt, [["render", en], ["__scopeId", "data-v-e49a9063"]]), nn = {
|
|
@@ -2169,10 +2183,10 @@ const tn = /* @__PURE__ */ P(Yt, [["render", en], ["__scopeId", "data-v-e49a9063
|
|
|
2169
2183
|
displayedTeamMembers() {
|
|
2170
2184
|
const e = Array.isArray(this.teamMembers) ? this.teamMembers : [];
|
|
2171
2185
|
if (e.length <= 3) return e;
|
|
2172
|
-
const t = (/* @__PURE__ */ new Date()).getHours() % e.length,
|
|
2186
|
+
const t = (/* @__PURE__ */ new Date()).getHours() % e.length, s = [];
|
|
2173
2187
|
for (let r = 0; r < 3; r++)
|
|
2174
|
-
|
|
2175
|
-
return
|
|
2188
|
+
s.push(e[(t + r) % e.length]);
|
|
2189
|
+
return s;
|
|
2176
2190
|
}
|
|
2177
2191
|
}
|
|
2178
2192
|
}, sn = { class: "wm-header" }, rn = ["aria-label"], an = {
|
|
@@ -2182,14 +2196,14 @@ const tn = /* @__PURE__ */ P(Yt, [["render", en], ["__scopeId", "data-v-e49a9063
|
|
|
2182
2196
|
key: 3,
|
|
2183
2197
|
class: "wm-header__fill"
|
|
2184
2198
|
}, un = { class: "wm-header__actions" }, hn = ["aria-label", "title"], mn = ["aria-label", "title"];
|
|
2185
|
-
function fn(e, t,
|
|
2199
|
+
function fn(e, t, s, r, a, n) {
|
|
2186
2200
|
const i = B("AIAvatar"), l = B("TeamAvatars");
|
|
2187
2201
|
return c(), d("div", sn, [
|
|
2188
|
-
|
|
2202
|
+
s.showBack ? (c(), d("button", {
|
|
2189
2203
|
key: 0,
|
|
2190
2204
|
type: "button",
|
|
2191
2205
|
class: "wm-header__icon",
|
|
2192
|
-
"aria-label":
|
|
2206
|
+
"aria-label": n.t("header.backToHome"),
|
|
2193
2207
|
onClick: t[0] || (t[0] = (_) => e.$emit("back"))
|
|
2194
2208
|
}, [...t[3] || (t[3] = [
|
|
2195
2209
|
o("svg", {
|
|
@@ -2206,30 +2220,30 @@ function fn(e, t, n, r, a, s) {
|
|
|
2206
2220
|
o("path", { d: "M19 12H5M12 5l-7 7 7 7" })
|
|
2207
2221
|
], -1)
|
|
2208
2222
|
])], 8, rn)) : (c(), d("div", an)),
|
|
2209
|
-
|
|
2223
|
+
s.showIdentity ? (c(), d(I, { key: 2 }, [
|
|
2210
2224
|
o("div", on, [
|
|
2211
2225
|
$(i, {
|
|
2212
2226
|
size: 30,
|
|
2213
|
-
name:
|
|
2214
|
-
"image-url":
|
|
2227
|
+
name: s.agentName,
|
|
2228
|
+
"image-url": s.agentAvatarUrl
|
|
2215
2229
|
}, null, 8, ["name", "image-url"])
|
|
2216
2230
|
]),
|
|
2217
2231
|
o("div", ln, [
|
|
2218
|
-
o("div", cn, v(
|
|
2232
|
+
o("div", cn, v(s.title), 1)
|
|
2219
2233
|
]),
|
|
2220
|
-
|
|
2234
|
+
n.hasTeam ? (c(), D(l, {
|
|
2221
2235
|
key: 0,
|
|
2222
|
-
members:
|
|
2236
|
+
members: n.displayedTeamMembers,
|
|
2223
2237
|
"response-label": ""
|
|
2224
2238
|
}, null, 8, ["members"])) : b("", !0)
|
|
2225
2239
|
], 64)) : (c(), d("div", dn)),
|
|
2226
2240
|
o("div", un, [
|
|
2227
|
-
|
|
2241
|
+
s.showMore ? (c(), d("button", {
|
|
2228
2242
|
key: 0,
|
|
2229
2243
|
type: "button",
|
|
2230
|
-
class: R(["wm-header__icon", { "wm-header__icon--active":
|
|
2231
|
-
"aria-label":
|
|
2232
|
-
title:
|
|
2244
|
+
class: R(["wm-header__icon", { "wm-header__icon--active": s.moreActive }]),
|
|
2245
|
+
"aria-label": n.t("header.moreOptions"),
|
|
2246
|
+
title: n.t("header.moreOptions"),
|
|
2233
2247
|
onClick: t[1] || (t[1] = (_) => e.$emit("more"))
|
|
2234
2248
|
}, [...t[4] || (t[4] = [
|
|
2235
2249
|
o("svg", {
|
|
@@ -2256,12 +2270,12 @@ function fn(e, t, n, r, a, s) {
|
|
|
2256
2270
|
})
|
|
2257
2271
|
], -1)
|
|
2258
2272
|
])], 10, hn)) : b("", !0),
|
|
2259
|
-
|
|
2273
|
+
s.showClose ? (c(), d("button", {
|
|
2260
2274
|
key: 1,
|
|
2261
2275
|
type: "button",
|
|
2262
2276
|
class: "wm-header__icon",
|
|
2263
|
-
"aria-label":
|
|
2264
|
-
title:
|
|
2277
|
+
"aria-label": n.t("header.closeWidget"),
|
|
2278
|
+
title: n.t("header.closeWidget"),
|
|
2265
2279
|
onClick: t[2] || (t[2] = (_) => e.$emit("close"))
|
|
2266
2280
|
}, [...t[5] || (t[5] = [
|
|
2267
2281
|
o("svg", {
|
|
@@ -2387,17 +2401,17 @@ const _n = /* @__PURE__ */ P(nn, [["render", fn], ["__scopeId", "data-v-7af4c118
|
|
|
2387
2401
|
if (!e) return "";
|
|
2388
2402
|
const t = new Date(e);
|
|
2389
2403
|
if (Number.isNaN(t.getTime())) return "";
|
|
2390
|
-
const
|
|
2404
|
+
const s = ne(this.wmLocale()), r = /* @__PURE__ */ new Date();
|
|
2391
2405
|
if (t.toDateString() === r.toDateString())
|
|
2392
|
-
return t.toLocaleTimeString(
|
|
2406
|
+
return t.toLocaleTimeString(s, {
|
|
2393
2407
|
hour: "2-digit",
|
|
2394
2408
|
minute: "2-digit"
|
|
2395
2409
|
});
|
|
2396
2410
|
if (r.getTime() - t.getTime() < 7 * 864e5) {
|
|
2397
|
-
const i = t.toLocaleDateString(
|
|
2411
|
+
const i = t.toLocaleDateString(s, { weekday: "short" });
|
|
2398
2412
|
return i.charAt(0).toUpperCase() + i.slice(1);
|
|
2399
2413
|
}
|
|
2400
|
-
return t.toLocaleDateString(
|
|
2414
|
+
return t.toLocaleDateString(s, {
|
|
2401
2415
|
day: "2-digit",
|
|
2402
2416
|
month: "2-digit"
|
|
2403
2417
|
});
|
|
@@ -2415,7 +2429,7 @@ const _n = /* @__PURE__ */ P(nn, [["render", fn], ["__scopeId", "data-v-7af4c118
|
|
|
2415
2429
|
}, Rn = ["innerHTML"], Ln = { class: "wm-onb__alert-meta" }, In = {
|
|
2416
2430
|
key: 0,
|
|
2417
2431
|
class: "wm-onb__alert-time"
|
|
2418
|
-
}, En = { class: "wm-onb__alert-resume" }, Bn = { class: "wm-onb__actions" }, Pn = ["disabled"],
|
|
2432
|
+
}, En = { class: "wm-onb__alert-resume" }, Bn = { class: "wm-onb__actions" }, Pn = ["disabled"], Dn = { class: "wm-onb__btn-label" }, Nn = ["onClick"], Un = { class: "wm-onb__btn-icon" }, Fn = ["aria-label"], jn = {
|
|
2419
2433
|
key: 1,
|
|
2420
2434
|
width: "18",
|
|
2421
2435
|
height: "18",
|
|
@@ -2449,7 +2463,7 @@ const _n = /* @__PURE__ */ P(nn, [["render", fn], ["__scopeId", "data-v-7af4c118
|
|
|
2449
2463
|
"stroke-linejoin": "round",
|
|
2450
2464
|
"aria-hidden": "true"
|
|
2451
2465
|
}, Kn = ["d"], Wn = { class: "wm-onb__btn-label" }, Gn = { class: "wm-onb__btn-count" };
|
|
2452
|
-
function Yn(e, t,
|
|
2466
|
+
function Yn(e, t, s, r, a, n) {
|
|
2453
2467
|
const i = B("AIAvatar");
|
|
2454
2468
|
return c(), d("div", pn, [
|
|
2455
2469
|
o("div", vn, [
|
|
@@ -2489,24 +2503,24 @@ function Yn(e, t, n, r, a, s) {
|
|
|
2489
2503
|
], -1)),
|
|
2490
2504
|
$(i, {
|
|
2491
2505
|
size: 52,
|
|
2492
|
-
"image-url":
|
|
2506
|
+
"image-url": s.defaultIconUrl
|
|
2493
2507
|
}, null, 8, ["image-url"]),
|
|
2494
2508
|
o("div", yn, [
|
|
2495
|
-
o("div", wn, v(
|
|
2496
|
-
o("div", bn, v(
|
|
2509
|
+
o("div", wn, v(n.heroTitle), 1),
|
|
2510
|
+
o("div", bn, v(n.heroSub), 1)
|
|
2497
2511
|
])
|
|
2498
2512
|
]),
|
|
2499
|
-
|
|
2500
|
-
(c(!0), d(I, null, F(
|
|
2513
|
+
n.unreadThreads.length ? (c(), d("div", kn, [
|
|
2514
|
+
(c(!0), d(I, null, F(n.unreadThreads, (l) => (c(), d("button", {
|
|
2501
2515
|
key: l.id,
|
|
2502
2516
|
type: "button",
|
|
2503
2517
|
class: "wm-onb__alert",
|
|
2504
2518
|
onClick: (_) => e.$emit("resume", l)
|
|
2505
2519
|
}, [
|
|
2506
2520
|
o("span", {
|
|
2507
|
-
class: R(["wm-onb__alert-avatar",
|
|
2521
|
+
class: R(["wm-onb__alert-avatar", n.avatarWrapperClass(l)])
|
|
2508
2522
|
}, [
|
|
2509
|
-
|
|
2523
|
+
n.isDefaultAvatar(l) ? (c(), d("span", An, [...t[3] || (t[3] = [
|
|
2510
2524
|
o("svg", {
|
|
2511
2525
|
width: "20",
|
|
2512
2526
|
height: "20",
|
|
@@ -2520,27 +2534,27 @@ function Yn(e, t, n, r, a, s) {
|
|
|
2520
2534
|
}, [
|
|
2521
2535
|
o("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
|
|
2522
2536
|
], -1)
|
|
2523
|
-
])])) : (c(),
|
|
2537
|
+
])])) : (c(), D(Ae(n.avatarComponent(l)), je({
|
|
2524
2538
|
key: 1,
|
|
2525
2539
|
ref_for: !0
|
|
2526
|
-
},
|
|
2540
|
+
}, n.avatarProps(l)), null, 16)),
|
|
2527
2541
|
o("span", {
|
|
2528
2542
|
class: "wm-onb__alert-dot",
|
|
2529
|
-
"aria-label":
|
|
2543
|
+
"aria-label": n.t("onboarding.unread")
|
|
2530
2544
|
}, null, 8, Sn)
|
|
2531
2545
|
], 2),
|
|
2532
2546
|
o("span", Mn, [
|
|
2533
2547
|
o("span", Tn, v(l.title), 1),
|
|
2534
2548
|
o("span", xn, [
|
|
2535
|
-
|
|
2549
|
+
n.senderLabel(l) ? (c(), d("span", On, v(n.senderLabel(l)) + " · ", 1)) : b("", !0),
|
|
2536
2550
|
o("span", {
|
|
2537
|
-
innerHTML:
|
|
2551
|
+
innerHTML: n.renderPreview(l.preview)
|
|
2538
2552
|
}, null, 8, Rn)
|
|
2539
2553
|
])
|
|
2540
2554
|
]),
|
|
2541
2555
|
o("span", Ln, [
|
|
2542
|
-
|
|
2543
|
-
o("span", En, v(
|
|
2556
|
+
n.formatTs(l._ts) ? (c(), d("span", In, v(n.formatTs(l._ts)), 1)) : b("", !0),
|
|
2557
|
+
o("span", En, v(n.t("onboarding.resume")), 1)
|
|
2544
2558
|
])
|
|
2545
2559
|
], 8, Cn))), 128))
|
|
2546
2560
|
])) : b("", !0),
|
|
@@ -2548,7 +2562,7 @@ function Yn(e, t, n, r, a, s) {
|
|
|
2548
2562
|
o("button", {
|
|
2549
2563
|
type: "button",
|
|
2550
2564
|
class: "wm-onb__btn wm-onb__btn--start",
|
|
2551
|
-
disabled:
|
|
2565
|
+
disabled: s.busy,
|
|
2552
2566
|
onClick: t[0] || (t[0] = (l) => e.$emit("start"))
|
|
2553
2567
|
}, [
|
|
2554
2568
|
t[4] || (t[4] = o("span", { class: "wm-onb__btn-icon" }, [
|
|
@@ -2566,33 +2580,33 @@ function Yn(e, t, n, r, a, s) {
|
|
|
2566
2580
|
o("path", { d: "M12 5v14M5 12h14" })
|
|
2567
2581
|
])
|
|
2568
2582
|
], -1)),
|
|
2569
|
-
o("span",
|
|
2583
|
+
o("span", Dn, v(s.busy ? "…" : n.t("onboarding.start")), 1)
|
|
2570
2584
|
], 8, Pn),
|
|
2571
|
-
(c(!0), d(I, null, F(
|
|
2585
|
+
(c(!0), d(I, null, F(s.quickLinks, (l, _) => (c(), d("button", {
|
|
2572
2586
|
key: "ql-" + _,
|
|
2573
2587
|
type: "button",
|
|
2574
2588
|
class: "wm-onb__btn",
|
|
2575
2589
|
onClick: (k) => e.$emit("select", l)
|
|
2576
2590
|
}, [
|
|
2577
|
-
o("span",
|
|
2578
|
-
|
|
2591
|
+
o("span", Un, [
|
|
2592
|
+
n.safeIconUrl(l) ? (c(), d("span", {
|
|
2579
2593
|
key: 0,
|
|
2580
2594
|
class: "wm-onb__btn-iconImg",
|
|
2581
|
-
style: z(
|
|
2595
|
+
style: z(n.iconUrlStyle(l)),
|
|
2582
2596
|
role: "img",
|
|
2583
2597
|
"aria-label": l.label || ""
|
|
2584
2598
|
}, null, 12, Fn)) : (c(), d("svg", jn, [
|
|
2585
2599
|
o("path", {
|
|
2586
|
-
d:
|
|
2600
|
+
d: n.iconPath(l.icon)
|
|
2587
2601
|
}, null, 8, Hn)
|
|
2588
2602
|
]))
|
|
2589
2603
|
]),
|
|
2590
2604
|
o("span", zn, v(l.label), 1),
|
|
2591
|
-
|
|
2605
|
+
n.isExternalLink(l) ? (c(), d("svg", qn, [...t[5] || (t[5] = [
|
|
2592
2606
|
o("path", { d: "M7 17L17 7M9 7h8v8" }, null, -1)
|
|
2593
2607
|
])])) : b("", !0)
|
|
2594
|
-
], 8,
|
|
2595
|
-
|
|
2608
|
+
], 8, Nn))), 128)),
|
|
2609
|
+
s.openThreads.length ? (c(), d("button", {
|
|
2596
2610
|
key: 0,
|
|
2597
2611
|
type: "button",
|
|
2598
2612
|
class: "wm-onb__btn",
|
|
@@ -2601,12 +2615,12 @@ function Yn(e, t, n, r, a, s) {
|
|
|
2601
2615
|
o("span", Vn, [
|
|
2602
2616
|
(c(), d("svg", $n, [
|
|
2603
2617
|
o("path", {
|
|
2604
|
-
d:
|
|
2618
|
+
d: n.iconPath("chat")
|
|
2605
2619
|
}, null, 8, Kn)
|
|
2606
2620
|
]))
|
|
2607
2621
|
]),
|
|
2608
|
-
o("span", Wn, v(
|
|
2609
|
-
o("span", Gn, v(
|
|
2622
|
+
o("span", Wn, v(n.t("onboarding.allConversations")), 1),
|
|
2623
|
+
o("span", Gn, v(s.openThreads.length), 1),
|
|
2610
2624
|
t[6] || (t[6] = o("svg", {
|
|
2611
2625
|
class: "wm-onb__btn-trail",
|
|
2612
2626
|
width: "13",
|
|
@@ -2678,17 +2692,17 @@ const Jn = /* @__PURE__ */ P(gn, [["render", Yn], ["__scopeId", "data-v-136c3afe
|
|
|
2678
2692
|
if (!e) return "";
|
|
2679
2693
|
const t = new Date(e);
|
|
2680
2694
|
if (Number.isNaN(t.getTime())) return "";
|
|
2681
|
-
const
|
|
2695
|
+
const s = ne(this.wmLocale()), r = /* @__PURE__ */ new Date();
|
|
2682
2696
|
if (t.toDateString() === r.toDateString())
|
|
2683
|
-
return t.toLocaleTimeString(
|
|
2697
|
+
return t.toLocaleTimeString(s, {
|
|
2684
2698
|
hour: "2-digit",
|
|
2685
2699
|
minute: "2-digit"
|
|
2686
2700
|
});
|
|
2687
2701
|
if (r.getTime() - t.getTime() < 7 * 864e5) {
|
|
2688
|
-
const i = t.toLocaleDateString(
|
|
2702
|
+
const i = t.toLocaleDateString(s, { weekday: "short" });
|
|
2689
2703
|
return i.charAt(0).toUpperCase() + i.slice(1);
|
|
2690
2704
|
}
|
|
2691
|
-
return t.toLocaleDateString(
|
|
2705
|
+
return t.toLocaleDateString(s, {
|
|
2692
2706
|
day: "2-digit",
|
|
2693
2707
|
month: "2-digit"
|
|
2694
2708
|
});
|
|
@@ -2704,7 +2718,7 @@ const Jn = /* @__PURE__ */ P(gn, [["render", Yn], ["__scopeId", "data-v-136c3afe
|
|
|
2704
2718
|
key: 0,
|
|
2705
2719
|
class: "wm-hist__empty"
|
|
2706
2720
|
};
|
|
2707
|
-
function us(e, t,
|
|
2721
|
+
function us(e, t, s, r, a, n) {
|
|
2708
2722
|
return c(), d("div", Qn, [
|
|
2709
2723
|
o("div", Zn, [
|
|
2710
2724
|
t[1] || (t[1] = o("span", { class: "wm-hist__searchIcon" }, [
|
|
@@ -2725,23 +2739,23 @@ function us(e, t, n, r, a, s) {
|
|
|
2725
2739
|
G(o("input", {
|
|
2726
2740
|
"onUpdate:modelValue": t[0] || (t[0] = (i) => a.query = i),
|
|
2727
2741
|
type: "text",
|
|
2728
|
-
placeholder:
|
|
2729
|
-
"aria-label":
|
|
2742
|
+
placeholder: n.t("onboarding.search"),
|
|
2743
|
+
"aria-label": n.t("onboarding.search")
|
|
2730
2744
|
}, null, 8, es), [
|
|
2731
2745
|
[te, a.query]
|
|
2732
2746
|
])
|
|
2733
2747
|
]),
|
|
2734
2748
|
o("div", ts, [
|
|
2735
|
-
(c(!0), d(I, null, F(
|
|
2749
|
+
(c(!0), d(I, null, F(n.filteredThreads, (i) => (c(), d("button", {
|
|
2736
2750
|
key: i.id,
|
|
2737
2751
|
type: "button",
|
|
2738
2752
|
class: R(["wm-hist__thread", { "wm-hist__thread--unread": i.unread }]),
|
|
2739
2753
|
onClick: (l) => e.$emit("resume", i)
|
|
2740
2754
|
}, [
|
|
2741
2755
|
o("span", {
|
|
2742
|
-
class: R(["wm-hist__thread-avatar",
|
|
2756
|
+
class: R(["wm-hist__thread-avatar", n.avatarWrapperClass(i)])
|
|
2743
2757
|
}, [
|
|
2744
|
-
|
|
2758
|
+
n.isDefaultAvatar(i) ? (c(), d("span", ss, [...t[2] || (t[2] = [
|
|
2745
2759
|
o("svg", {
|
|
2746
2760
|
width: "18",
|
|
2747
2761
|
height: "18",
|
|
@@ -2755,25 +2769,25 @@ function us(e, t, n, r, a, s) {
|
|
|
2755
2769
|
}, [
|
|
2756
2770
|
o("path", { d: "M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z" })
|
|
2757
2771
|
], -1)
|
|
2758
|
-
])])) : (c(),
|
|
2772
|
+
])])) : (c(), D(Ae(n.avatarComponent(i)), je({
|
|
2759
2773
|
key: 1,
|
|
2760
2774
|
ref_for: !0
|
|
2761
|
-
},
|
|
2775
|
+
}, n.avatarProps(i)), null, 16)),
|
|
2762
2776
|
i.unread ? (c(), d("span", {
|
|
2763
2777
|
key: 2,
|
|
2764
2778
|
class: "wm-hist__thread-dot",
|
|
2765
|
-
"aria-label":
|
|
2779
|
+
"aria-label": n.t("onboarding.unread")
|
|
2766
2780
|
}, null, 8, rs)) : b("", !0)
|
|
2767
2781
|
], 2),
|
|
2768
2782
|
o("span", is, [
|
|
2769
2783
|
o("span", as, v(i.title), 1),
|
|
2770
2784
|
o("span", {
|
|
2771
2785
|
class: "wm-hist__thread-preview",
|
|
2772
|
-
innerHTML:
|
|
2786
|
+
innerHTML: n.renderPreview(i.preview)
|
|
2773
2787
|
}, null, 8, os)
|
|
2774
2788
|
]),
|
|
2775
2789
|
o("span", ls, [
|
|
2776
|
-
|
|
2790
|
+
n.formatTs(i._ts) ? (c(), d("span", cs, v(n.formatTs(i._ts)), 1)) : b("", !0),
|
|
2777
2791
|
t[3] || (t[3] = o("svg", {
|
|
2778
2792
|
width: "14",
|
|
2779
2793
|
height: "14",
|
|
@@ -2790,7 +2804,7 @@ function us(e, t, n, r, a, s) {
|
|
|
2790
2804
|
], -1))
|
|
2791
2805
|
])
|
|
2792
2806
|
], 10, ns))), 128)),
|
|
2793
|
-
|
|
2807
|
+
n.filteredThreads.length ? b("", !0) : (c(), d("div", ds, v(a.query ? n.t("onboarding.noResults", { query: a.query }) : n.t("onboarding.noConversations")), 1))
|
|
2794
2808
|
])
|
|
2795
2809
|
]);
|
|
2796
2810
|
}
|
|
@@ -2855,16 +2869,16 @@ const fs = {
|
|
|
2855
2869
|
"stroke-linecap": "round",
|
|
2856
2870
|
"stroke-linejoin": "round"
|
|
2857
2871
|
}, ws = { class: "wm-result__body" }, bs = { class: "wm-result__label" }, ks = { class: "wm-result__detail" };
|
|
2858
|
-
function Cs(e, t,
|
|
2872
|
+
function Cs(e, t, s, r, a, n) {
|
|
2859
2873
|
return c(), d("div", {
|
|
2860
|
-
class: R(["wm-result", `wm-result--${
|
|
2874
|
+
class: R(["wm-result", `wm-result--${s.state}`])
|
|
2861
2875
|
}, [
|
|
2862
2876
|
o("span", _s, [
|
|
2863
|
-
|
|
2877
|
+
s.state === "success" ? (c(), d("svg", gs, [...t[0] || (t[0] = [
|
|
2864
2878
|
o("path", { d: "M20 6L9 17l-5-5" }, null, -1)
|
|
2865
|
-
])])) :
|
|
2879
|
+
])])) : s.state === "rejected" ? (c(), d("svg", ps, [...t[1] || (t[1] = [
|
|
2866
2880
|
o("path", { d: "M18 6L6 18M6 6l12 12" }, null, -1)
|
|
2867
|
-
])])) :
|
|
2881
|
+
])])) : s.state === "awaiting" ? (c(), d("svg", vs, [...t[2] || (t[2] = [
|
|
2868
2882
|
o("circle", {
|
|
2869
2883
|
cx: "12",
|
|
2870
2884
|
cy: "12",
|
|
@@ -2888,13 +2902,13 @@ function Cs(e, t, n, r, a, s) {
|
|
|
2888
2902
|
])]))
|
|
2889
2903
|
]),
|
|
2890
2904
|
o("span", ws, [
|
|
2891
|
-
o("span", bs, v(
|
|
2892
|
-
|
|
2905
|
+
o("span", bs, v(s.label), 1),
|
|
2906
|
+
n.detailText ? (c(), d(I, { key: 0 }, [
|
|
2893
2907
|
t[4] || (t[4] = o("span", {
|
|
2894
2908
|
class: "wm-result__sep",
|
|
2895
2909
|
"aria-hidden": "true"
|
|
2896
2910
|
}, " · ", -1)),
|
|
2897
|
-
o("span", ks, v(
|
|
2911
|
+
o("span", ks, v(n.detailText), 1)
|
|
2898
2912
|
], 64)) : b("", !0)
|
|
2899
2913
|
])
|
|
2900
2914
|
], 2);
|
|
@@ -2916,10 +2930,10 @@ const As = /* @__PURE__ */ P(fs, [["render", Cs], ["__scopeId", "data-v-7284acd0
|
|
|
2916
2930
|
}
|
|
2917
2931
|
}
|
|
2918
2932
|
}, Ms = { class: "wm-art wm-art--formResponse" }, Ts = { class: "wm-art__head" }, xs = { class: "wm-art__title" }, Os = { class: "wm-art__badge wm-art__badge--success" }, Rs = { class: "wm-art__body" }, Ls = { class: "wm-art__fieldLabel" };
|
|
2919
|
-
function Is(e, t,
|
|
2933
|
+
function Is(e, t, s, r, a, n) {
|
|
2920
2934
|
return c(), d("div", Ms, [
|
|
2921
2935
|
o("div", Ts, [
|
|
2922
|
-
o("div", xs, v(
|
|
2936
|
+
o("div", xs, v(s.data.title || n.t("form.title")), 1),
|
|
2923
2937
|
o("span", Os, [
|
|
2924
2938
|
t[0] || (t[0] = o("svg", {
|
|
2925
2939
|
width: "11",
|
|
@@ -2934,11 +2948,11 @@ function Is(e, t, n, r, a, s) {
|
|
|
2934
2948
|
}, [
|
|
2935
2949
|
o("polyline", { points: "20 6 9 17 4 12" })
|
|
2936
2950
|
], -1)),
|
|
2937
|
-
Se(" " + v(
|
|
2951
|
+
Se(" " + v(n.t("form.sent")), 1)
|
|
2938
2952
|
])
|
|
2939
2953
|
]),
|
|
2940
2954
|
o("div", Rs, [
|
|
2941
|
-
(c(!0), d(I, null, F(
|
|
2955
|
+
(c(!0), d(I, null, F(n.fields, (i, l) => (c(), d("div", {
|
|
2942
2956
|
key: l,
|
|
2943
2957
|
class: "wm-art__field"
|
|
2944
2958
|
}, [
|
|
@@ -2968,10 +2982,10 @@ const Es = /* @__PURE__ */ P(Ss, [["render", Is], ["__scopeId", "data-v-713aecf1
|
|
|
2968
2982
|
return !!((e = this.data) != null && e.body) || this.fields.length > 0;
|
|
2969
2983
|
}
|
|
2970
2984
|
}
|
|
2971
|
-
}, Ps = { class: "wm-art wm-art--infoCard" },
|
|
2985
|
+
}, Ps = { class: "wm-art wm-art--infoCard" }, Ds = {
|
|
2972
2986
|
key: 0,
|
|
2973
2987
|
class: "wm-art__image"
|
|
2974
|
-
},
|
|
2988
|
+
}, Ns = ["src", "alt"], Us = { class: "wm-art__head" }, Fs = { class: "wm-art__headMain" }, js = { class: "wm-art__title" }, Hs = {
|
|
2975
2989
|
key: 0,
|
|
2976
2990
|
class: "wm-art__subtitle"
|
|
2977
2991
|
}, zs = {
|
|
@@ -2981,31 +2995,31 @@ const Es = /* @__PURE__ */ P(Ss, [["render", Is], ["__scopeId", "data-v-713aecf1
|
|
|
2981
2995
|
key: 0,
|
|
2982
2996
|
class: "wm-art__text"
|
|
2983
2997
|
}, Vs = { class: "wm-art__fieldLabel" };
|
|
2984
|
-
function $s(e, t,
|
|
2998
|
+
function $s(e, t, s, r, a, n) {
|
|
2985
2999
|
return c(), d("div", Ps, [
|
|
2986
|
-
|
|
3000
|
+
s.data.image_url ? (c(), d("figure", Ds, [
|
|
2987
3001
|
o("img", {
|
|
2988
|
-
src:
|
|
2989
|
-
alt:
|
|
3002
|
+
src: s.data.image_url,
|
|
3003
|
+
alt: s.data.title || "",
|
|
2990
3004
|
loading: "lazy"
|
|
2991
|
-
}, null, 8,
|
|
3005
|
+
}, null, 8, Ns)
|
|
2992
3006
|
])) : b("", !0),
|
|
2993
|
-
o("div",
|
|
3007
|
+
o("div", Us, [
|
|
2994
3008
|
o("div", Fs, [
|
|
2995
|
-
o("div", js, v(
|
|
2996
|
-
|
|
3009
|
+
o("div", js, v(s.data.title), 1),
|
|
3010
|
+
s.data.subtitle ? (c(), d("div", Hs, v(s.data.subtitle), 1)) : b("", !0)
|
|
2997
3011
|
]),
|
|
2998
|
-
|
|
3012
|
+
s.data.badge && s.data.badge.label ? (c(), d("span", {
|
|
2999
3013
|
key: 0,
|
|
3000
3014
|
class: R([
|
|
3001
3015
|
"wm-art__badge",
|
|
3002
|
-
`wm-art__badge--${
|
|
3016
|
+
`wm-art__badge--${s.data.badge.tone || "neutral"}`
|
|
3003
3017
|
])
|
|
3004
|
-
}, v(
|
|
3018
|
+
}, v(s.data.badge.label), 3)) : b("", !0)
|
|
3005
3019
|
]),
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3020
|
+
n.hasBody ? (c(), d("div", zs, [
|
|
3021
|
+
s.data.body ? (c(), d("div", qs, v(s.data.body), 1)) : b("", !0),
|
|
3022
|
+
n.fields.length ? (c(!0), d(I, { key: 1 }, F(n.fields, (i, l) => (c(), d("div", {
|
|
3009
3023
|
key: l,
|
|
3010
3024
|
class: "wm-art__field"
|
|
3011
3025
|
}, [
|
|
@@ -3021,7 +3035,7 @@ function $s(e, t, n, r, a, s) {
|
|
|
3021
3035
|
]);
|
|
3022
3036
|
}
|
|
3023
3037
|
const Ks = /* @__PURE__ */ P(Bs, [["render", $s], ["__scopeId", "data-v-7eae0e4a"]]);
|
|
3024
|
-
function Ws(e, t,
|
|
3038
|
+
function Ws(e, t, s) {
|
|
3025
3039
|
if (!e) return "";
|
|
3026
3040
|
const r = new Date(e);
|
|
3027
3041
|
if (Number.isNaN(r.getTime())) return e;
|
|
@@ -3029,11 +3043,11 @@ function Ws(e, t, n) {
|
|
|
3029
3043
|
day: "numeric",
|
|
3030
3044
|
month: "long",
|
|
3031
3045
|
year: "numeric"
|
|
3032
|
-
}),
|
|
3046
|
+
}), n = r.toLocaleTimeString(t, {
|
|
3033
3047
|
hour: "2-digit",
|
|
3034
3048
|
minute: "2-digit"
|
|
3035
3049
|
});
|
|
3036
|
-
return `${a}${
|
|
3050
|
+
return `${a}${s}${n}`;
|
|
3037
3051
|
}
|
|
3038
3052
|
const Gs = {
|
|
3039
3053
|
name: "WmArtifactTicket",
|
|
@@ -3103,10 +3117,10 @@ const Gs = {
|
|
|
3103
3117
|
key: 1,
|
|
3104
3118
|
class: "wm-art__footer wm-tk__footer"
|
|
3105
3119
|
};
|
|
3106
|
-
function ar(e, t,
|
|
3120
|
+
function ar(e, t, s, r, a, n) {
|
|
3107
3121
|
return c(), d("div", Ys, [
|
|
3108
3122
|
o("div", Js, [
|
|
3109
|
-
o("div", Xs, v(
|
|
3123
|
+
o("div", Xs, v(s.data.title), 1),
|
|
3110
3124
|
o("div", Qs, [
|
|
3111
3125
|
o("div", Zs, [
|
|
3112
3126
|
t[0] || (t[0] = o("svg", {
|
|
@@ -3123,26 +3137,26 @@ function ar(e, t, n, r, a, s) {
|
|
|
3123
3137
|
o("path", { d: "M20 12a2 2 0 0 1 2-2V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v4a2 2 0 0 1 0 4v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 1-2-2z" }),
|
|
3124
3138
|
o("path", { d: "M13 5v2M13 17v2M13 11v2" })
|
|
3125
3139
|
], -1)),
|
|
3126
|
-
o("span", null, v(
|
|
3140
|
+
o("span", null, v(s.data.reference), 1)
|
|
3127
3141
|
]),
|
|
3128
3142
|
o("span", {
|
|
3129
3143
|
class: R([
|
|
3130
3144
|
"wm-art__badge",
|
|
3131
3145
|
"wm-tk__badge",
|
|
3132
|
-
`wm-art__badge--${
|
|
3146
|
+
`wm-art__badge--${s.data.status.tone || "neutral"}`
|
|
3133
3147
|
])
|
|
3134
3148
|
}, [
|
|
3135
3149
|
t[1] || (t[1] = o("span", {
|
|
3136
3150
|
class: "wm-tk__dot",
|
|
3137
3151
|
"aria-hidden": "true"
|
|
3138
3152
|
}, null, -1)),
|
|
3139
|
-
Se(" " + v(
|
|
3153
|
+
Se(" " + v(s.data.status.label), 1)
|
|
3140
3154
|
], 2)
|
|
3141
3155
|
]),
|
|
3142
|
-
|
|
3156
|
+
s.data.body ? (c(), d("div", er, v(s.data.body), 1)) : b("", !0)
|
|
3143
3157
|
]),
|
|
3144
|
-
|
|
3145
|
-
(c(!0), d(I, null, F(
|
|
3158
|
+
n.fields.length ? (c(), d("div", tr, [
|
|
3159
|
+
(c(!0), d(I, null, F(n.fields, (i, l) => (c(), d("div", {
|
|
3146
3160
|
key: l,
|
|
3147
3161
|
class: "wm-art__field"
|
|
3148
3162
|
}, [
|
|
@@ -3153,10 +3167,10 @@ function ar(e, t, n, r, a, s) {
|
|
|
3153
3167
|
{ "wm-art__fieldValue--multi": i.multiline }
|
|
3154
3168
|
])
|
|
3155
3169
|
}, [
|
|
3156
|
-
|
|
3170
|
+
n.isPriority(i.label) ? (c(), d("svg", {
|
|
3157
3171
|
key: 0,
|
|
3158
3172
|
class: "wm-tk__prio",
|
|
3159
|
-
"data-level":
|
|
3173
|
+
"data-level": n.priorityLevel(i.value),
|
|
3160
3174
|
width: "12",
|
|
3161
3175
|
height: "12",
|
|
3162
3176
|
viewBox: "0 0 12 12",
|
|
@@ -3183,7 +3197,7 @@ function ar(e, t, n, r, a, s) {
|
|
|
3183
3197
|
height: "9",
|
|
3184
3198
|
rx: "0.5"
|
|
3185
3199
|
}, null, -1)
|
|
3186
|
-
])], 8, sr)) :
|
|
3200
|
+
])], 8, sr)) : n.isDate(i.label) ? (c(), d("svg", rr, [...t[3] || (t[3] = [
|
|
3187
3201
|
o("rect", {
|
|
3188
3202
|
x: "3",
|
|
3189
3203
|
y: "4",
|
|
@@ -3197,7 +3211,7 @@ function ar(e, t, n, r, a, s) {
|
|
|
3197
3211
|
], 2)
|
|
3198
3212
|
]))), 128))
|
|
3199
3213
|
])) : b("", !0),
|
|
3200
|
-
|
|
3214
|
+
s.data.created_at ? (c(), d("div", ir, [
|
|
3201
3215
|
t[4] || (t[4] = o("svg", {
|
|
3202
3216
|
width: "11",
|
|
3203
3217
|
height: "11",
|
|
@@ -3218,7 +3232,7 @@ function ar(e, t, n, r, a, s) {
|
|
|
3218
3232
|
}),
|
|
3219
3233
|
o("path", { d: "M16 2v4M8 2v4M3 10h18" })
|
|
3220
3234
|
], -1)),
|
|
3221
|
-
o("span", null, v(
|
|
3235
|
+
o("span", null, v(n.formattedDate), 1)
|
|
3222
3236
|
])) : b("", !0)
|
|
3223
3237
|
]);
|
|
3224
3238
|
}
|
|
@@ -3241,10 +3255,10 @@ const or = /* @__PURE__ */ P(Gs, [["render", ar], ["__scopeId", "data-v-5f30c914
|
|
|
3241
3255
|
}
|
|
3242
3256
|
}
|
|
3243
3257
|
};
|
|
3244
|
-
function dr(e, t,
|
|
3245
|
-
return
|
|
3258
|
+
function dr(e, t, s, r, a, n) {
|
|
3259
|
+
return n.component ? (c(), D(Ae(n.component), {
|
|
3246
3260
|
key: 0,
|
|
3247
|
-
data:
|
|
3261
|
+
data: s.artifact.data
|
|
3248
3262
|
}, null, 8, ["data"])) : b("", !0);
|
|
3249
3263
|
}
|
|
3250
3264
|
const ur = /* @__PURE__ */ P(cr, [["render", dr]]), hr = {
|
|
@@ -3263,15 +3277,15 @@ const ur = /* @__PURE__ */ P(cr, [["render", dr]]), hr = {
|
|
|
3263
3277
|
},
|
|
3264
3278
|
computed: {
|
|
3265
3279
|
kind() {
|
|
3266
|
-
var
|
|
3267
|
-
const e = (
|
|
3280
|
+
var s, r;
|
|
3281
|
+
const e = (s = this.attachment) == null ? void 0 : s.type;
|
|
3268
3282
|
if (e) return e;
|
|
3269
3283
|
const t = (((r = this.attachment) == null ? void 0 : r.mime_type) || "").toLowerCase();
|
|
3270
3284
|
return t.startsWith("image/") ? "image" : t.startsWith("audio/") ? "audio" : t.startsWith("video/") ? "video" : "file";
|
|
3271
3285
|
},
|
|
3272
3286
|
displayName() {
|
|
3273
|
-
var e, t,
|
|
3274
|
-
return ((t = (e = this.attachment) == null ? void 0 : e.metadata) == null ? void 0 : t.name) || ((
|
|
3287
|
+
var e, t, s;
|
|
3288
|
+
return ((t = (e = this.attachment) == null ? void 0 : e.metadata) == null ? void 0 : t.name) || ((s = this.attachment) == null ? void 0 : s.name) || this.guessNameFromPath() || this.t("attachment.fallbackName");
|
|
3275
3289
|
},
|
|
3276
3290
|
safeHref() {
|
|
3277
3291
|
const e = String(this.url || "").trim();
|
|
@@ -3297,8 +3311,8 @@ const ur = /* @__PURE__ */ P(cr, [["render", dr]]), hr = {
|
|
|
3297
3311
|
},
|
|
3298
3312
|
methods: {
|
|
3299
3313
|
guessNameFromPath() {
|
|
3300
|
-
var
|
|
3301
|
-
return ((((
|
|
3314
|
+
var s;
|
|
3315
|
+
return ((((s = this.attachment) == null ? void 0 : s.path) || "").split("/").pop() || "").replace(/^[0-9a-f-]{8,}-/, "");
|
|
3302
3316
|
},
|
|
3303
3317
|
async refresh() {
|
|
3304
3318
|
var e;
|
|
@@ -3323,28 +3337,28 @@ const ur = /* @__PURE__ */ P(cr, [["render", dr]]), hr = {
|
|
|
3323
3337
|
class: "wm-att__spin",
|
|
3324
3338
|
"aria-hidden": "true"
|
|
3325
3339
|
};
|
|
3326
|
-
function kr(e, t,
|
|
3340
|
+
function kr(e, t, s, r, a, n) {
|
|
3327
3341
|
return c(), d("div", {
|
|
3328
|
-
class: R(["wm-att", ["wm-att--" + (
|
|
3342
|
+
class: R(["wm-att", ["wm-att--" + (n.kind || "file")]])
|
|
3329
3343
|
}, [
|
|
3330
|
-
|
|
3344
|
+
n.kind === "image" && a.url ? (c(), d("a", {
|
|
3331
3345
|
key: 0,
|
|
3332
|
-
href:
|
|
3346
|
+
href: n.safeHref,
|
|
3333
3347
|
target: "_blank",
|
|
3334
3348
|
rel: "noopener",
|
|
3335
3349
|
class: "wm-att__imgWrap"
|
|
3336
3350
|
}, [
|
|
3337
3351
|
o("img", {
|
|
3338
3352
|
src: a.url,
|
|
3339
|
-
alt:
|
|
3353
|
+
alt: n.displayName,
|
|
3340
3354
|
loading: "lazy"
|
|
3341
3355
|
}, null, 8, fr)
|
|
3342
|
-
], 8, mr)) :
|
|
3356
|
+
], 8, mr)) : n.kind === "audio" && a.url ? (c(), d("audio", {
|
|
3343
3357
|
key: 1,
|
|
3344
3358
|
src: a.url,
|
|
3345
3359
|
controls: "",
|
|
3346
3360
|
preload: "metadata"
|
|
3347
|
-
}, null, 8, _r)) :
|
|
3361
|
+
}, null, 8, _r)) : n.kind === "video" && a.url ? (c(), d("video", {
|
|
3348
3362
|
key: 2,
|
|
3349
3363
|
src: a.url,
|
|
3350
3364
|
controls: "",
|
|
@@ -3353,11 +3367,11 @@ function kr(e, t, n, r, a, s) {
|
|
|
3353
3367
|
}, null, 8, gr)) : (c(), d("a", {
|
|
3354
3368
|
key: 3,
|
|
3355
3369
|
class: "wm-att__file",
|
|
3356
|
-
href:
|
|
3357
|
-
download:
|
|
3370
|
+
href: n.safeHref,
|
|
3371
|
+
download: n.displayName,
|
|
3358
3372
|
target: "_blank",
|
|
3359
3373
|
rel: "noopener",
|
|
3360
|
-
onClick: t[0] || (t[0] = (...i) =>
|
|
3374
|
+
onClick: t[0] || (t[0] = (...i) => n.onFileClick && n.onFileClick(...i))
|
|
3361
3375
|
}, [
|
|
3362
3376
|
t[1] || (t[1] = o("span", { class: "wm-att__icon" }, [
|
|
3363
3377
|
o("svg", {
|
|
@@ -3376,8 +3390,8 @@ function kr(e, t, n, r, a, s) {
|
|
|
3376
3390
|
])
|
|
3377
3391
|
], -1)),
|
|
3378
3392
|
o("span", vr, [
|
|
3379
|
-
o("span", yr, v(
|
|
3380
|
-
|
|
3393
|
+
o("span", yr, v(n.displayName), 1),
|
|
3394
|
+
n.sizeLabel ? (c(), d("span", wr, v(n.sizeLabel), 1)) : b("", !0)
|
|
3381
3395
|
]),
|
|
3382
3396
|
a.loading ? (c(), d("span", br)) : b("", !0)
|
|
3383
3397
|
], 8, pr))
|
|
@@ -3396,17 +3410,17 @@ const Cr = /* @__PURE__ */ P(hr, [["render", kr], ["__scopeId", "data-v-b207a8bd
|
|
|
3396
3410
|
}
|
|
3397
3411
|
}
|
|
3398
3412
|
}, Sr = ["innerHTML"];
|
|
3399
|
-
function Mr(e, t,
|
|
3413
|
+
function Mr(e, t, s, r, a, n) {
|
|
3400
3414
|
return c(), d("div", {
|
|
3401
|
-
class: R(["wm-bubble", "wm-bubble--" +
|
|
3415
|
+
class: R(["wm-bubble", "wm-bubble--" + s.role])
|
|
3402
3416
|
}, [
|
|
3403
3417
|
Ke(e.$slots, "default", {}, () => [
|
|
3404
|
-
o("span", { innerHTML:
|
|
3418
|
+
o("span", { innerHTML: n.rendered }, null, 8, Sr)
|
|
3405
3419
|
], !0)
|
|
3406
3420
|
], 2);
|
|
3407
3421
|
}
|
|
3408
3422
|
const Tr = /* @__PURE__ */ P(Ar, [["render", Mr], ["__scopeId", "data-v-7ab13147"]]), xr = { name: "WmTyping" }, Or = { class: "wm-typing" };
|
|
3409
|
-
function Rr(e, t,
|
|
3423
|
+
function Rr(e, t, s, r, a, n) {
|
|
3410
3424
|
return c(), d("div", Or, [...t[0] || (t[0] = [
|
|
3411
3425
|
o("span", { style: { "animation-delay": "0s" } }, null, -1),
|
|
3412
3426
|
o("span", { style: { "animation-delay": "0.2s" } }, null, -1),
|
|
@@ -3502,12 +3516,12 @@ const Ir = {
|
|
|
3502
3516
|
return !this.hasMore && !this.loadingMore && this.messages.length >= 20;
|
|
3503
3517
|
},
|
|
3504
3518
|
groups() {
|
|
3505
|
-
var
|
|
3519
|
+
var s, r, a, n;
|
|
3506
3520
|
const e = [];
|
|
3507
3521
|
for (const i of this.messages) {
|
|
3508
3522
|
const l = this.roleOf(i);
|
|
3509
3523
|
if (l === "system") {
|
|
3510
|
-
if (((
|
|
3524
|
+
if (((s = i == null ? void 0 : i.payload) == null ? void 0 : s.event) === "action_admin_pending") {
|
|
3511
3525
|
const w = e[e.length - 1];
|
|
3512
3526
|
w && w.role === "ai" ? w.messages.push(i) : e.push({
|
|
3513
3527
|
key: `g-${ee(i)}`,
|
|
@@ -3533,7 +3547,7 @@ const Ir = {
|
|
|
3533
3547
|
key: `g-${ee(i)}`,
|
|
3534
3548
|
role: l,
|
|
3535
3549
|
agentName: ((a = i == null ? void 0 : i.author) == null ? void 0 : a.name) || "",
|
|
3536
|
-
agentAvatarUrl: ((
|
|
3550
|
+
agentAvatarUrl: ((n = i == null ? void 0 : i.author) == null ? void 0 : n.avatar_url) || null,
|
|
3537
3551
|
messages: [i],
|
|
3538
3552
|
items: []
|
|
3539
3553
|
});
|
|
@@ -3565,13 +3579,13 @@ const Ir = {
|
|
|
3565
3579
|
unreadGroupKey() {
|
|
3566
3580
|
if (this.unreadAnchorId == null) return null;
|
|
3567
3581
|
const e = this.unreadAnchorId, t = this.unreadBoundaryTs;
|
|
3568
|
-
for (const
|
|
3569
|
-
if (
|
|
3570
|
-
const r =
|
|
3582
|
+
for (const s of this.groups) {
|
|
3583
|
+
if (s.role === "user" || s.role === "system" || !s.items.length) continue;
|
|
3584
|
+
const r = s.messages[0];
|
|
3571
3585
|
if (!r) continue;
|
|
3572
3586
|
const a = Y(r.id);
|
|
3573
3587
|
if (a != null && !(a <= e) && !(t && r.created_at && r.created_at > t))
|
|
3574
|
-
return
|
|
3588
|
+
return s.key;
|
|
3575
3589
|
}
|
|
3576
3590
|
return null;
|
|
3577
3591
|
}
|
|
@@ -3607,20 +3621,20 @@ const Ir = {
|
|
|
3607
3621
|
stableGroupKey(e) {
|
|
3608
3622
|
this._groupIdByMsgKey || (this._groupIdByMsgKey = /* @__PURE__ */ new Map(), this._groupIdCounter = 0);
|
|
3609
3623
|
const t = this._groupIdByMsgKey;
|
|
3610
|
-
let
|
|
3624
|
+
let s = null;
|
|
3611
3625
|
for (const r of e) {
|
|
3612
3626
|
const a = ee(r);
|
|
3613
3627
|
if (a && t.has(a)) {
|
|
3614
|
-
|
|
3628
|
+
s = t.get(a);
|
|
3615
3629
|
break;
|
|
3616
3630
|
}
|
|
3617
3631
|
}
|
|
3618
|
-
|
|
3632
|
+
s == null && (s = ++this._groupIdCounter);
|
|
3619
3633
|
for (const r of e) {
|
|
3620
3634
|
const a = ee(r);
|
|
3621
|
-
a && t.set(a,
|
|
3635
|
+
a && t.set(a, s);
|
|
3622
3636
|
}
|
|
3623
|
-
return `g-${
|
|
3637
|
+
return `g-${s}`;
|
|
3624
3638
|
},
|
|
3625
3639
|
isAtBottom(e) {
|
|
3626
3640
|
return e.scrollHeight - e.scrollTop - e.clientHeight <= Er;
|
|
@@ -3655,36 +3669,36 @@ const Ir = {
|
|
|
3655
3669
|
if (!e || this._scrollSnap) return;
|
|
3656
3670
|
const t = this._lastSeenConvId !== this.conversationId;
|
|
3657
3671
|
this._lastSeenConvId = this.conversationId;
|
|
3658
|
-
const
|
|
3672
|
+
const s = this.isAtBottom(e);
|
|
3659
3673
|
let r = null;
|
|
3660
|
-
if (!t && !
|
|
3661
|
-
const
|
|
3662
|
-
if (
|
|
3663
|
-
const i = this.findRowByKey(e,
|
|
3674
|
+
if (!t && !s) {
|
|
3675
|
+
const n = this.pickAnchor(e);
|
|
3676
|
+
if (n != null && n.rowKey) {
|
|
3677
|
+
const i = this.findRowByKey(e, n.rowKey);
|
|
3664
3678
|
if (i) {
|
|
3665
3679
|
const l = e.getBoundingClientRect().top;
|
|
3666
3680
|
r = {
|
|
3667
|
-
rowKey:
|
|
3681
|
+
rowKey: n.rowKey,
|
|
3668
3682
|
relY: i.getBoundingClientRect().top - l
|
|
3669
3683
|
};
|
|
3670
3684
|
}
|
|
3671
3685
|
}
|
|
3672
3686
|
}
|
|
3673
|
-
const a = { forceBottom: t, wasPinned:
|
|
3687
|
+
const a = { forceBottom: t, wasPinned: s, anchor: r };
|
|
3674
3688
|
this._scrollSnap = a, this.$nextTick(() => {
|
|
3675
3689
|
if (this._scrollSnap = null, a.forceBottom || a.wasPinned) {
|
|
3676
3690
|
e.scrollTop = e.scrollHeight;
|
|
3677
3691
|
return;
|
|
3678
3692
|
}
|
|
3679
3693
|
if (!a.anchor) return;
|
|
3680
|
-
const
|
|
3694
|
+
const n = () => {
|
|
3681
3695
|
const i = a.anchor, l = this.findRowByKey(e, i.rowKey);
|
|
3682
3696
|
if (!l) return;
|
|
3683
3697
|
const k = l.getBoundingClientRect().top - e.getBoundingClientRect().top - i.relY;
|
|
3684
3698
|
Math.abs(k) > 0.5 && (e.scrollTop += k);
|
|
3685
3699
|
};
|
|
3686
|
-
|
|
3687
|
-
|
|
3700
|
+
n(), requestAnimationFrame(() => {
|
|
3701
|
+
n(), requestAnimationFrame(n);
|
|
3688
3702
|
});
|
|
3689
3703
|
});
|
|
3690
3704
|
},
|
|
@@ -3711,23 +3725,23 @@ const Ir = {
|
|
|
3711
3725
|
// `scrollTop`) when nothing matches handles the
|
|
3712
3726
|
// very-top-of-scroll edge case the same way the old logic did.
|
|
3713
3727
|
pickAnchor(e) {
|
|
3714
|
-
const t = e.getBoundingClientRect().top,
|
|
3728
|
+
const t = e.getBoundingClientRect().top, s = e.querySelectorAll(".wm-list__row[data-row-key]");
|
|
3715
3729
|
let r = null;
|
|
3716
|
-
for (const a of
|
|
3730
|
+
for (const a of s)
|
|
3717
3731
|
if (r || (r = a), a.getBoundingClientRect().bottom >= t)
|
|
3718
3732
|
return { rowKey: a.dataset.rowKey };
|
|
3719
3733
|
return r ? { rowKey: r.dataset.rowKey } : null;
|
|
3720
3734
|
},
|
|
3721
3735
|
findRowByKey(e, t) {
|
|
3722
3736
|
if (!t) return null;
|
|
3723
|
-
const
|
|
3737
|
+
const s = typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/["\\]/g, "\\$&");
|
|
3724
3738
|
return e.querySelector(
|
|
3725
|
-
`.wm-list__row[data-row-key="${
|
|
3739
|
+
`.wm-list__row[data-row-key="${s}"]`
|
|
3726
3740
|
);
|
|
3727
3741
|
},
|
|
3728
3742
|
roleOf(e) {
|
|
3729
|
-
var
|
|
3730
|
-
if ((e == null ? void 0 : e.type) === "system" || ((
|
|
3743
|
+
var s, r;
|
|
3744
|
+
if ((e == null ? void 0 : e.type) === "system" || ((s = e == null ? void 0 : e.payload) == null ? void 0 : s.type) === "system")
|
|
3731
3745
|
return "system";
|
|
3732
3746
|
const t = (r = e == null ? void 0 : e.author) == null ? void 0 : r.type;
|
|
3733
3747
|
return t === "user" ? "user" : t === "agent_human" ? "human" : "ai";
|
|
@@ -3766,7 +3780,7 @@ const Ir = {
|
|
|
3766
3780
|
}
|
|
3767
3781
|
];
|
|
3768
3782
|
if (e.type === "action" && e.payload && e.payload.state !== "pending") {
|
|
3769
|
-
const
|
|
3783
|
+
const s = [
|
|
3770
3784
|
{
|
|
3771
3785
|
message: e,
|
|
3772
3786
|
partKey: "main",
|
|
@@ -3774,12 +3788,12 @@ const Ir = {
|
|
|
3774
3788
|
kind: { top: "bubble", bottom: "bubble" }
|
|
3775
3789
|
}
|
|
3776
3790
|
];
|
|
3777
|
-
return this.actionArtifact(e) &&
|
|
3791
|
+
return this.actionArtifact(e) && s.push({
|
|
3778
3792
|
message: e,
|
|
3779
3793
|
partKey: "artifact",
|
|
3780
3794
|
renderAs: "artifact-of-action",
|
|
3781
3795
|
kind: { top: "card", bottom: "card" }
|
|
3782
|
-
}),
|
|
3796
|
+
}), s;
|
|
3783
3797
|
}
|
|
3784
3798
|
return this.artifactOf(e) ? [
|
|
3785
3799
|
{
|
|
@@ -3828,9 +3842,9 @@ const Ir = {
|
|
|
3828
3842
|
// doit garder son arrondi.
|
|
3829
3843
|
cornersFor(e, t) {
|
|
3830
3844
|
var Q, se, re;
|
|
3831
|
-
const
|
|
3832
|
-
let
|
|
3833
|
-
return i ? (k && (
|
|
3845
|
+
const s = e.items, r = (Q = s[t]) == null ? void 0 : Q.kind, a = (se = s[t - 1]) == null ? void 0 : se.kind, n = (re = s[t + 1]) == null ? void 0 : re.kind, i = e.role === "user", l = 14, _ = 4, k = a == null ? void 0 : a.bottom, w = n == null ? void 0 : n.top, T = this.widthByKey[this.rowKeyOf(e, t)], E = this.widthByKey[this.rowKeyOf(e, t - 1)], A = this.widthByKey[this.rowKeyOf(e, t + 1)], q = 0.5, M = (W, ie, X) => W != null && T != null ? W + q >= T : ie === X || ie === "card" && X === "bubble";
|
|
3846
|
+
let N = l, U = l, L = l, K = l;
|
|
3847
|
+
return i ? (k && (U = _), (w || !n) && (L = _), k && M(E, k, r == null ? void 0 : r.top) && (N = _), w && M(A, w, r == null ? void 0 : r.bottom) && (K = _)) : (k && (N = _), (w || !n) && (K = _), k && M(E, k, r == null ? void 0 : r.top) && (U = _), w && M(A, w, r == null ? void 0 : r.bottom) && (L = _)), { tl: N, tr: U, br: L, bl: K };
|
|
3834
3848
|
},
|
|
3835
3849
|
// Inline column-count for the mosaic grid, capped at 4. Single
|
|
3836
3850
|
// attachment falls back to the vertical-list layout (null). Two
|
|
@@ -3851,10 +3865,10 @@ const Ir = {
|
|
|
3851
3865
|
// sits above the mosaic — in that case the top edge of the
|
|
3852
3866
|
// grid is connected to the bubble's flat bottom, so the top
|
|
3853
3867
|
// corners of every top-row cell flatten too.
|
|
3854
|
-
mosaicCornerStyle(e, t,
|
|
3868
|
+
mosaicCornerStyle(e, t, s) {
|
|
3855
3869
|
if (!t || t < 2) return null;
|
|
3856
|
-
const r = Math.min(t, 4), a = Math.floor(e / r),
|
|
3857
|
-
return (i || _) && (T["--wm-r-tl"] = w), (l || _) && (T["--wm-r-tr"] = w), (i || k) && (T["--wm-r-bl"] = w), (l || k) && (T["--wm-r-br"] = w),
|
|
3870
|
+
const r = Math.min(t, 4), a = Math.floor(e / r), n = e % r, i = n > 0, l = n < r - 1 && e + 1 < t, _ = a > 0, k = e + r < t, w = "4px", T = {};
|
|
3871
|
+
return (i || _) && (T["--wm-r-tl"] = w), (l || _) && (T["--wm-r-tr"] = w), (i || k) && (T["--wm-r-bl"] = w), (l || k) && (T["--wm-r-br"] = w), s && (T["--wm-r-tl"] = w, T["--wm-r-tr"] = w), Object.keys(T).length ? T : null;
|
|
3858
3872
|
},
|
|
3859
3873
|
// Inline style emitting the four corner CSS variables. Set on
|
|
3860
3874
|
// `.wm-list__row` so they cascade to Bubble/ActionResult/
|
|
@@ -3862,20 +3876,20 @@ const Ir = {
|
|
|
3862
3876
|
// those components fall back to their native border-radius.
|
|
3863
3877
|
cornersStyle(e, t) {
|
|
3864
3878
|
if (e.items.length < 2) return null;
|
|
3865
|
-
const
|
|
3879
|
+
const s = this.cornersFor(e, t);
|
|
3866
3880
|
return {
|
|
3867
|
-
"--wm-r-tl": `${
|
|
3868
|
-
"--wm-r-tr": `${
|
|
3869
|
-
"--wm-r-br": `${
|
|
3870
|
-
"--wm-r-bl": `${
|
|
3881
|
+
"--wm-r-tl": `${s.tl}px`,
|
|
3882
|
+
"--wm-r-tr": `${s.tr}px`,
|
|
3883
|
+
"--wm-r-br": `${s.br}px`,
|
|
3884
|
+
"--wm-r-bl": `${s.bl}px`
|
|
3871
3885
|
};
|
|
3872
3886
|
},
|
|
3873
3887
|
// Clé unique par item de cluster, alignée avec `:key` /
|
|
3874
3888
|
// `data-row-key` du template. Sert d'index dans `widthByKey`.
|
|
3875
3889
|
rowKeyOf(e, t) {
|
|
3876
3890
|
var r;
|
|
3877
|
-
const
|
|
3878
|
-
return
|
|
3891
|
+
const s = (r = e == null ? void 0 : e.items) == null ? void 0 : r[t];
|
|
3892
|
+
return s ? `${ee(s.message)}-${s.partKey}` : "";
|
|
3879
3893
|
},
|
|
3880
3894
|
// rAF-debouncé : `updated()` peut être appelé en rafale (stream,
|
|
3881
3895
|
// typing, scroll), un seul flush layout par frame suffit.
|
|
@@ -3892,27 +3906,27 @@ const Ir = {
|
|
|
3892
3906
|
const e = this.$refs.scrollEl;
|
|
3893
3907
|
if (!e) return;
|
|
3894
3908
|
const t = {};
|
|
3895
|
-
for (const
|
|
3909
|
+
for (const n of e.querySelectorAll(
|
|
3896
3910
|
".wm-list__row[data-row-key]"
|
|
3897
3911
|
)) {
|
|
3898
|
-
const i =
|
|
3912
|
+
const i = n.dataset.rowKey;
|
|
3899
3913
|
if (!i) continue;
|
|
3900
|
-
const l =
|
|
3914
|
+
const l = n.querySelector(
|
|
3901
3915
|
".wm-bubble, .wm-result, .wm-art, .wm-list__body"
|
|
3902
3916
|
);
|
|
3903
3917
|
if (!l) continue;
|
|
3904
3918
|
const _ = l.getBoundingClientRect().width;
|
|
3905
3919
|
_ > 0 && (t[i] = _);
|
|
3906
3920
|
}
|
|
3907
|
-
const
|
|
3921
|
+
const s = this.widthByKey, r = Object.keys(s), a = Object.keys(t);
|
|
3908
3922
|
if (r.length === a.length) {
|
|
3909
|
-
let
|
|
3923
|
+
let n = !0;
|
|
3910
3924
|
for (const i of a)
|
|
3911
|
-
if (Math.abs((
|
|
3912
|
-
|
|
3925
|
+
if (Math.abs((s[i] ?? 0) - t[i]) > 0.5) {
|
|
3926
|
+
n = !1;
|
|
3913
3927
|
break;
|
|
3914
3928
|
}
|
|
3915
|
-
if (
|
|
3929
|
+
if (n) return;
|
|
3916
3930
|
}
|
|
3917
3931
|
this.widthByKey = Object.freeze(t);
|
|
3918
3932
|
},
|
|
@@ -3939,11 +3953,11 @@ const Ir = {
|
|
|
3939
3953
|
}
|
|
3940
3954
|
},
|
|
3941
3955
|
lastTimeOf(e) {
|
|
3942
|
-
const t = e.items[e.items.length - 1],
|
|
3943
|
-
if (!(
|
|
3956
|
+
const t = e.items[e.items.length - 1], s = (t == null ? void 0 : t.message) || e.messages[e.messages.length - 1];
|
|
3957
|
+
if (!(s != null && s.created_at)) return "";
|
|
3944
3958
|
try {
|
|
3945
3959
|
return Ce(
|
|
3946
|
-
new Date(
|
|
3960
|
+
new Date(s.created_at),
|
|
3947
3961
|
ne(this.wmLocale())
|
|
3948
3962
|
);
|
|
3949
3963
|
} catch {
|
|
@@ -3956,12 +3970,12 @@ const Ir = {
|
|
|
3956
3970
|
// séparée par une estampille rôle + heure.
|
|
3957
3971
|
hasTrailingOverlay(e) {
|
|
3958
3972
|
if (!e.messages.length) return !1;
|
|
3959
|
-
const t = e.messages[e.messages.length - 1],
|
|
3960
|
-
return !!t && (
|
|
3973
|
+
const t = e.messages[e.messages.length - 1], s = e.items[e.items.length - 1];
|
|
3974
|
+
return !!t && (s == null ? void 0 : s.message) !== t;
|
|
3961
3975
|
},
|
|
3962
3976
|
attachmentsOf(e) {
|
|
3963
|
-
var
|
|
3964
|
-
const t = (
|
|
3977
|
+
var s;
|
|
3978
|
+
const t = (s = e == null ? void 0 : e.payload) == null ? void 0 : s.attachments;
|
|
3965
3979
|
return Array.isArray(t) ? t : [];
|
|
3966
3980
|
},
|
|
3967
3981
|
// Returns the artifact descriptor `{ kind, data }` if this message
|
|
@@ -3969,8 +3983,8 @@ const Ir = {
|
|
|
3969
3983
|
// bubble for a dedicated card via `ArtifactRenderer`. Le registry
|
|
3970
3984
|
// côté ArtifactRenderer décide quoi afficher pour chaque `kind`.
|
|
3971
3985
|
artifactOf(e) {
|
|
3972
|
-
var
|
|
3973
|
-
const t = (
|
|
3986
|
+
var s;
|
|
3987
|
+
const t = (s = e == null ? void 0 : e.metadata) == null ? void 0 : s.artifact;
|
|
3974
3988
|
return !t || typeof t != "object" || typeof t.kind != "string" ? null : t;
|
|
3975
3989
|
},
|
|
3976
3990
|
actionLabel(e) {
|
|
@@ -3978,19 +3992,19 @@ const Ir = {
|
|
|
3978
3992
|
return ((t = e == null ? void 0 : e.payload) == null ? void 0 : t.name) || (e == null ? void 0 : e.text_md) || this.t("common.action");
|
|
3979
3993
|
},
|
|
3980
3994
|
actionDetail(e) {
|
|
3981
|
-
var
|
|
3995
|
+
var s, r, a, n, i, l;
|
|
3982
3996
|
const t = e == null ? void 0 : e.payload;
|
|
3983
|
-
return t ? t.state === "success" ? ((
|
|
3997
|
+
return t ? t.state === "success" ? ((s = t.success) == null ? void 0 : s.summary) || ((a = (r = t.success) == null ? void 0 : r.metadata) == null ? void 0 : a.description) || "" : t.state === "rejected" ? ((n = t.rejected) == null ? void 0 : n.reason) || this.t("action.rejectedByUser") : t.state === "failure" && (((i = t.failure) == null ? void 0 : i.summary) || ((l = t.failure) == null ? void 0 : l.error)) || "" : "";
|
|
3984
3998
|
},
|
|
3985
3999
|
actionArtifact(e) {
|
|
3986
|
-
var
|
|
3987
|
-
const t = (r = (
|
|
4000
|
+
var s, r;
|
|
4001
|
+
const t = (r = (s = e == null ? void 0 : e.payload) == null ? void 0 : s.success) == null ? void 0 : r.artifact;
|
|
3988
4002
|
return !t || typeof t != "object" || typeof t.kind != "string" ? null : t;
|
|
3989
4003
|
},
|
|
3990
4004
|
systemLabel(e) {
|
|
3991
|
-
var a,
|
|
3992
|
-
const t = (a = e == null ? void 0 : e.payload) == null ? void 0 : a.event,
|
|
3993
|
-
return
|
|
4005
|
+
var a, n, i;
|
|
4006
|
+
const t = (a = e == null ? void 0 : e.payload) == null ? void 0 : a.event, s = Ir[t], r = ((n = e == null ? void 0 : e.metadata) == null ? void 0 : n.agent_name) || ((i = e == null ? void 0 : e.author) == null ? void 0 : i.name) || this.t("messageList.anAgent");
|
|
4007
|
+
return s ? this.t(s, { name: r }) : (e == null ? void 0 : e.text_md) || this.t("messageList.conversationUpdate");
|
|
3994
4008
|
},
|
|
3995
4009
|
scrollToBottom() {
|
|
3996
4010
|
const e = this.$refs.scrollEl;
|
|
@@ -4004,12 +4018,12 @@ const Ir = {
|
|
|
4004
4018
|
e && (typeof e.scrollTo == "function" ? e.scrollTo({ top: e.scrollHeight, behavior: "smooth" }) : e.scrollTop = e.scrollHeight, this.showScrollDown = !1);
|
|
4005
4019
|
}
|
|
4006
4020
|
}
|
|
4007
|
-
},
|
|
4021
|
+
}, Dr = { class: "wm-list__wrap" }, Nr = {
|
|
4008
4022
|
key: 0,
|
|
4009
4023
|
class: "wm-list__loadMore",
|
|
4010
4024
|
role: "status",
|
|
4011
4025
|
"aria-live": "polite"
|
|
4012
|
-
},
|
|
4026
|
+
}, Ur = { class: "wm-list__loadMore-lbl" }, Fr = {
|
|
4013
4027
|
key: 1,
|
|
4014
4028
|
class: "wm-list__historyEnd"
|
|
4015
4029
|
}, jr = {
|
|
@@ -4034,32 +4048,32 @@ const Ir = {
|
|
|
4034
4048
|
key: 3,
|
|
4035
4049
|
class: "wm-list__row wm-list__row--ai fade-up"
|
|
4036
4050
|
}, ti = { class: "wm-list__avatarSlot" }, ni = ["aria-label", "title"];
|
|
4037
|
-
function si(e, t,
|
|
4051
|
+
function si(e, t, s, r, a, n) {
|
|
4038
4052
|
const i = B("AIAvatar"), l = B("HumanAvatar"), _ = B("ActionResult"), k = B("ArtifactRenderer"), w = B("Bubble"), T = B("AttachmentPreview"), E = B("Typing");
|
|
4039
|
-
return c(), d("div",
|
|
4053
|
+
return c(), d("div", Dr, [
|
|
4040
4054
|
o("div", {
|
|
4041
4055
|
ref: "scrollEl",
|
|
4042
4056
|
class: R(["wm-list", { "wm-list--silent": a.silentFades }]),
|
|
4043
|
-
onScrollPassive: t[4] || (t[4] = (...A) =>
|
|
4057
|
+
onScrollPassive: t[4] || (t[4] = (...A) => n.onScroll && n.onScroll(...A))
|
|
4044
4058
|
}, [
|
|
4045
|
-
|
|
4059
|
+
s.loadingMore ? (c(), d("div", Nr, [
|
|
4046
4060
|
t[6] || (t[6] = o("span", {
|
|
4047
4061
|
class: "wm-list__loadMore-spinner",
|
|
4048
4062
|
"aria-hidden": "true"
|
|
4049
4063
|
}, null, -1)),
|
|
4050
|
-
o("span",
|
|
4051
|
-
])) :
|
|
4052
|
-
|
|
4064
|
+
o("span", Ur, v(n.t("messageList.loadingHistory")), 1)
|
|
4065
|
+
])) : n.historyExhausted ? (c(), d("div", Fr, v(n.t("messageList.conversationStart")), 1)) : b("", !0),
|
|
4066
|
+
s.dateLabel ? (c(), d("div", jr, [
|
|
4053
4067
|
t[7] || (t[7] = o("div", { class: "wm-list__line" }, null, -1)),
|
|
4054
|
-
o("span", Hr, v(
|
|
4068
|
+
o("span", Hr, v(s.dateLabel), 1),
|
|
4055
4069
|
t[8] || (t[8] = o("div", { class: "wm-list__line" }, null, -1))
|
|
4056
4070
|
])) : b("", !0),
|
|
4057
|
-
(c(!0), d(I, null, F(
|
|
4071
|
+
(c(!0), d(I, null, F(n.groups, (A, q) => (c(), d(I, {
|
|
4058
4072
|
key: A.key
|
|
4059
4073
|
}, [
|
|
4060
|
-
A.key ===
|
|
4074
|
+
A.key === n.unreadGroupKey ? (c(), d("div", zr, [
|
|
4061
4075
|
t[9] || (t[9] = o("div", { class: "wm-list__line wm-list__line--unread" }, null, -1)),
|
|
4062
|
-
o("span", qr, v(
|
|
4076
|
+
o("span", qr, v(n.t("messageList.unread")), 1),
|
|
4063
4077
|
t[10] || (t[10] = o("div", { class: "wm-list__line wm-list__line--unread" }, null, -1))
|
|
4064
4078
|
])) : b("", !0),
|
|
4065
4079
|
A.role === "system" || A.items.length ? (c(), d("div", {
|
|
@@ -4071,11 +4085,11 @@ function si(e, t, n, r, a, s) {
|
|
|
4071
4085
|
o("span", $r, v(A.systemLabel), 1),
|
|
4072
4086
|
t[12] || (t[12] = o("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
|
|
4073
4087
|
])) : (c(), d(I, { key: 1 }, [
|
|
4074
|
-
(c(!0), d(I, null, F(A.items, (M,
|
|
4075
|
-
key: `${
|
|
4088
|
+
(c(!0), d(I, null, F(A.items, (M, N) => (c(), d(I, {
|
|
4089
|
+
key: `${n.messageKey(M.message)}-${M.partKey}`
|
|
4076
4090
|
}, [
|
|
4077
4091
|
o("div", {
|
|
4078
|
-
"data-row-key": `${
|
|
4092
|
+
"data-row-key": `${n.messageKey(M.message)}-${M.partKey}`,
|
|
4079
4093
|
class: R(["wm-list__row fade-up", [
|
|
4080
4094
|
"wm-list__row--" + A.role,
|
|
4081
4095
|
{
|
|
@@ -4083,23 +4097,23 @@ function si(e, t, n, r, a, s) {
|
|
|
4083
4097
|
"is-failed": M.message._failed
|
|
4084
4098
|
}
|
|
4085
4099
|
]]),
|
|
4086
|
-
style: z(
|
|
4087
|
-
onPointerdown: (
|
|
4088
|
-
onPointerup: t[0] || (t[0] = (
|
|
4089
|
-
onPointercancel: t[1] || (t[1] = (
|
|
4090
|
-
onPointerleave: t[2] || (t[2] = (
|
|
4100
|
+
style: z(n.cornersStyle(A, N)),
|
|
4101
|
+
onPointerdown: (U) => n.onPressStart(`${n.messageKey(M.message)}-${M.partKey}`),
|
|
4102
|
+
onPointerup: t[0] || (t[0] = (U) => n.onPressEnd()),
|
|
4103
|
+
onPointercancel: t[1] || (t[1] = (U) => n.onPressEnd()),
|
|
4104
|
+
onPointerleave: t[2] || (t[2] = (U) => n.onPressEnd()),
|
|
4091
4105
|
onContextmenu: t[3] || (t[3] = J(() => {
|
|
4092
4106
|
}, ["prevent"]))
|
|
4093
4107
|
}, [
|
|
4094
4108
|
A.role !== "user" ? (c(), d("div", Wr, [
|
|
4095
|
-
|
|
4096
|
-
A.role === "ai" ? (c(),
|
|
4109
|
+
N === A.items.length - 1 ? (c(), d(I, { key: 0 }, [
|
|
4110
|
+
A.role === "ai" ? (c(), D(i, {
|
|
4097
4111
|
key: 0,
|
|
4098
4112
|
size: 26,
|
|
4099
4113
|
tail: !0,
|
|
4100
|
-
name:
|
|
4101
|
-
"image-url":
|
|
4102
|
-
}, null, 8, ["name", "image-url"])) : (c(),
|
|
4114
|
+
name: s.aiAgentName,
|
|
4115
|
+
"image-url": s.aiAgentAvatarUrl
|
|
4116
|
+
}, null, 8, ["name", "image-url"])) : (c(), D(l, {
|
|
4103
4117
|
key: 1,
|
|
4104
4118
|
name: A.agentName,
|
|
4105
4119
|
"avatar-url": A.agentAvatarUrl,
|
|
@@ -4108,54 +4122,54 @@ function si(e, t, n, r, a, s) {
|
|
|
4108
4122
|
}, null, 8, ["name", "avatar-url"]))
|
|
4109
4123
|
], 64)) : b("", !0)
|
|
4110
4124
|
])) : b("", !0),
|
|
4111
|
-
M.renderAs === "action" ? (c(),
|
|
4125
|
+
M.renderAs === "action" ? (c(), D(_, {
|
|
4112
4126
|
key: 1,
|
|
4113
4127
|
state: M.message.payload.state,
|
|
4114
|
-
label:
|
|
4115
|
-
detail:
|
|
4116
|
-
}, null, 8, ["state", "label", "detail"])) : M.renderAs === "admin-pending" ? (c(),
|
|
4128
|
+
label: n.actionLabel(M.message),
|
|
4129
|
+
detail: n.actionDetail(M.message)
|
|
4130
|
+
}, null, 8, ["state", "label", "detail"])) : M.renderAs === "admin-pending" ? (c(), D(_, {
|
|
4117
4131
|
key: 2,
|
|
4118
4132
|
state: "awaiting",
|
|
4119
|
-
label:
|
|
4133
|
+
label: n.t("messageList.approvalRequestSent"),
|
|
4120
4134
|
detail: M.message.text_md || ""
|
|
4121
|
-
}, null, 8, ["label", "detail"])) : M.renderAs === "artifact-of-action" ? (c(),
|
|
4135
|
+
}, null, 8, ["label", "detail"])) : M.renderAs === "artifact-of-action" ? (c(), D(k, {
|
|
4122
4136
|
key: 3,
|
|
4123
|
-
artifact:
|
|
4124
|
-
}, null, 8, ["artifact"])) : M.renderAs === "artifact" ? (c(),
|
|
4137
|
+
artifact: n.actionArtifact(M.message)
|
|
4138
|
+
}, null, 8, ["artifact"])) : M.renderAs === "artifact" ? (c(), D(k, {
|
|
4125
4139
|
key: 4,
|
|
4126
|
-
artifact:
|
|
4140
|
+
artifact: n.artifactOf(M.message)
|
|
4127
4141
|
}, null, 8, ["artifact"])) : (c(), d("div", {
|
|
4128
4142
|
key: 5,
|
|
4129
4143
|
class: R(["wm-list__body", {
|
|
4130
|
-
"wm-list__body--mixed": !!M.message.text_md &&
|
|
4144
|
+
"wm-list__body--mixed": !!M.message.text_md && n.attachmentsOf(M.message).length > 0
|
|
4131
4145
|
}])
|
|
4132
4146
|
}, [
|
|
4133
|
-
M.message.text_md ? (c(),
|
|
4147
|
+
M.message.text_md ? (c(), D(w, {
|
|
4134
4148
|
key: 0,
|
|
4135
4149
|
role: A.role,
|
|
4136
4150
|
text: M.message.text_md
|
|
4137
4151
|
}, null, 8, ["role", "text"])) : b("", !0),
|
|
4138
|
-
|
|
4152
|
+
n.attachmentsOf(M.message).length ? (c(), d("div", {
|
|
4139
4153
|
key: 1,
|
|
4140
4154
|
class: R(["wm-list__atts", {
|
|
4141
4155
|
"wm-list__atts--align-end": A.role === "user",
|
|
4142
|
-
"wm-list__atts--mosaic":
|
|
4156
|
+
"wm-list__atts--mosaic": n.attachmentsOf(M.message).length >= 2
|
|
4143
4157
|
}]),
|
|
4144
4158
|
style: z(
|
|
4145
|
-
|
|
4146
|
-
|
|
4159
|
+
n.mosaicGridStyle(
|
|
4160
|
+
n.attachmentsOf(M.message).length
|
|
4147
4161
|
)
|
|
4148
4162
|
)
|
|
4149
4163
|
}, [
|
|
4150
|
-
(c(!0), d(I, null, F(
|
|
4164
|
+
(c(!0), d(I, null, F(n.attachmentsOf(
|
|
4151
4165
|
M.message
|
|
4152
|
-
), (
|
|
4153
|
-
key: `${
|
|
4154
|
-
attachment:
|
|
4166
|
+
), (U, L) => (c(), D(T, {
|
|
4167
|
+
key: `${n.messageKey(M.message)}-att-${L}`,
|
|
4168
|
+
attachment: U,
|
|
4155
4169
|
style: z(
|
|
4156
|
-
|
|
4170
|
+
n.mosaicCornerStyle(
|
|
4157
4171
|
L,
|
|
4158
|
-
|
|
4172
|
+
n.attachmentsOf(M.message).length,
|
|
4159
4173
|
!!M.message.text_md
|
|
4160
4174
|
)
|
|
4161
4175
|
)
|
|
@@ -4163,47 +4177,47 @@ function si(e, t, n, r, a, s) {
|
|
|
4163
4177
|
], 6)) : b("", !0)
|
|
4164
4178
|
], 2))
|
|
4165
4179
|
], 46, Kr),
|
|
4166
|
-
|
|
4180
|
+
N < A.items.length - 1 && a.pressedItemKey === `${n.messageKey(M.message)}-${M.partKey}` && (A.role !== "user" || n.timeOf(M.message)) ? (c(), d("div", {
|
|
4167
4181
|
key: 0,
|
|
4168
4182
|
class: R(["wm-list__meta wm-list__meta--press", { "wm-list__meta--right": A.role === "user" }])
|
|
4169
4183
|
}, [
|
|
4170
|
-
A.role !== "user" ? (c(), d("span", Gr, v(
|
|
4171
|
-
A.role !== "user" &&
|
|
4172
|
-
|
|
4184
|
+
A.role !== "user" ? (c(), d("span", Gr, v(n.roleLabel(A)), 1)) : b("", !0),
|
|
4185
|
+
A.role !== "user" && n.timeOf(M.message) ? (c(), d("span", Yr, "•")) : b("", !0),
|
|
4186
|
+
n.timeOf(M.message) ? (c(), d("span", Jr, v(n.timeOf(M.message)), 1)) : b("", !0)
|
|
4173
4187
|
], 2)) : b("", !0)
|
|
4174
4188
|
], 64))), 128)),
|
|
4175
|
-
(A.role !== "user" ||
|
|
4189
|
+
(A.role !== "user" || n.lastTimeOf(A)) && !n.hasTrailingOverlay(A) ? (c(), d("div", {
|
|
4176
4190
|
key: 0,
|
|
4177
4191
|
class: R(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
|
|
4178
4192
|
}, [
|
|
4179
|
-
A.role !== "user" ? (c(), d("span", Xr, v(
|
|
4180
|
-
A.role !== "user" &&
|
|
4181
|
-
|
|
4193
|
+
A.role !== "user" ? (c(), d("span", Xr, v(n.roleLabel(A)), 1)) : b("", !0),
|
|
4194
|
+
A.role !== "user" && n.lastTimeOf(A) ? (c(), d("span", Qr, "•")) : b("", !0),
|
|
4195
|
+
n.lastTimeOf(A) ? (c(), d("span", Zr, v(n.lastTimeOf(A)), 1)) : b("", !0)
|
|
4182
4196
|
], 2)) : b("", !0)
|
|
4183
4197
|
], 64))
|
|
4184
4198
|
], 2)) : b("", !0)
|
|
4185
4199
|
], 64))), 128)),
|
|
4186
|
-
|
|
4200
|
+
s.streamingActive ? (c(), d("div", ei, [
|
|
4187
4201
|
o("div", ti, [
|
|
4188
4202
|
$(i, {
|
|
4189
4203
|
size: 26,
|
|
4190
4204
|
tail: !0,
|
|
4191
|
-
name:
|
|
4192
|
-
"image-url":
|
|
4205
|
+
name: s.aiAgentName,
|
|
4206
|
+
"image-url": s.aiAgentAvatarUrl
|
|
4193
4207
|
}, null, 8, ["name", "image-url"])
|
|
4194
4208
|
]),
|
|
4195
4209
|
$(E)
|
|
4196
4210
|
])) : b("", !0)
|
|
4197
4211
|
], 34),
|
|
4198
|
-
$(
|
|
4212
|
+
$(Ue, { name: "wm-scrollDown" }, {
|
|
4199
4213
|
default: Fe(() => [
|
|
4200
4214
|
a.showScrollDown ? (c(), d("button", {
|
|
4201
4215
|
key: 0,
|
|
4202
4216
|
type: "button",
|
|
4203
4217
|
class: "wm-list__scrollDown",
|
|
4204
|
-
"aria-label":
|
|
4205
|
-
title:
|
|
4206
|
-
onClick: t[5] || (t[5] = (...A) =>
|
|
4218
|
+
"aria-label": n.t("messageList.scrollToBottom"),
|
|
4219
|
+
title: n.t("messageList.scrollToBottom"),
|
|
4220
|
+
onClick: t[5] || (t[5] = (...A) => n.scrollToBottomSmooth && n.scrollToBottomSmooth(...A))
|
|
4207
4221
|
}, [...t[13] || (t[13] = [
|
|
4208
4222
|
o("svg", {
|
|
4209
4223
|
width: "14",
|
|
@@ -4232,8 +4246,8 @@ function ii() {
|
|
|
4232
4246
|
"video/webm",
|
|
4233
4247
|
"video/mp4"
|
|
4234
4248
|
].find((t) => {
|
|
4235
|
-
var
|
|
4236
|
-
return (r = (
|
|
4249
|
+
var s, r;
|
|
4250
|
+
return (r = (s = window.MediaRecorder).isTypeSupported) == null ? void 0 : r.call(s, t);
|
|
4237
4251
|
}) || "";
|
|
4238
4252
|
}
|
|
4239
4253
|
function Ve({ audio: e }) {
|
|
@@ -4271,15 +4285,15 @@ async function ai() {
|
|
|
4271
4285
|
async function oi(e) {
|
|
4272
4286
|
const t = document.createElement("video");
|
|
4273
4287
|
t.muted = !0, t.playsInline = !0, t.srcObject = e, await t.play(), await new Promise((l) => requestAnimationFrame(l));
|
|
4274
|
-
const
|
|
4275
|
-
a.width =
|
|
4276
|
-
const
|
|
4288
|
+
const s = t.videoWidth || 1280, r = t.videoHeight || 720, a = document.createElement("canvas");
|
|
4289
|
+
a.width = s, a.height = r, a.getContext("2d").drawImage(t, 0, 0, s, r);
|
|
4290
|
+
const n = await new Promise((l, _) => {
|
|
4277
4291
|
a.toBlob(
|
|
4278
4292
|
(k) => k ? l(k) : _(new Error("toBlob failed")),
|
|
4279
4293
|
"image/png"
|
|
4280
4294
|
);
|
|
4281
4295
|
}), i = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
4282
|
-
return new File([
|
|
4296
|
+
return new File([n], `capture-${i}.png`, { type: "image/png" });
|
|
4283
4297
|
}
|
|
4284
4298
|
async function li(e = {}) {
|
|
4285
4299
|
var k;
|
|
@@ -4292,28 +4306,28 @@ async function li(e = {}) {
|
|
|
4292
4306
|
} catch (w) {
|
|
4293
4307
|
return (w == null ? void 0 : w.name) !== "NotAllowedError" && console.error("[media] record picker", w), null;
|
|
4294
4308
|
}
|
|
4295
|
-
const
|
|
4309
|
+
const s = ii();
|
|
4296
4310
|
let r;
|
|
4297
4311
|
try {
|
|
4298
|
-
r =
|
|
4312
|
+
r = s ? new window.MediaRecorder(t, { mimeType: s }) : new window.MediaRecorder(t);
|
|
4299
4313
|
} catch (w) {
|
|
4300
4314
|
return console.error("[media] recorder init", w), t.getTracks().forEach((T) => {
|
|
4301
4315
|
T.stop();
|
|
4302
4316
|
}), null;
|
|
4303
4317
|
}
|
|
4304
4318
|
const a = [];
|
|
4305
|
-
let
|
|
4319
|
+
let n = null, i = !1;
|
|
4306
4320
|
r.addEventListener("dataavailable", (w) => {
|
|
4307
4321
|
w.data && w.data.size > 0 && a.push(w.data);
|
|
4308
4322
|
}), r.addEventListener("stop", () => {
|
|
4309
4323
|
var w, T;
|
|
4310
|
-
if (
|
|
4324
|
+
if (n && clearInterval(n), t.getTracks().forEach((E) => {
|
|
4311
4325
|
E.stop();
|
|
4312
4326
|
}), a.length) {
|
|
4313
|
-
const E = r.mimeType ||
|
|
4327
|
+
const E = r.mimeType || s || "video/webm", A = new Blob(a, { type: E }), q = /mp4/.test(E) ? "mp4" : "webm", M = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), N = new File([A], `ecran-${M}.${q}`, {
|
|
4314
4328
|
type: E
|
|
4315
4329
|
});
|
|
4316
|
-
(w = e.onfinalize) == null || w.call(e,
|
|
4330
|
+
(w = e.onfinalize) == null || w.call(e, N);
|
|
4317
4331
|
} else
|
|
4318
4332
|
(T = e.oncancel) == null || T.call(e);
|
|
4319
4333
|
}), t.getVideoTracks().forEach((w) => {
|
|
@@ -4336,7 +4350,7 @@ async function li(e = {}) {
|
|
|
4336
4350
|
}
|
|
4337
4351
|
(k = e.onstart) == null || k.call(e);
|
|
4338
4352
|
const _ = Date.now();
|
|
4339
|
-
return
|
|
4353
|
+
return n = setInterval(() => {
|
|
4340
4354
|
var w;
|
|
4341
4355
|
(w = e.ontick) == null || w.call(e, Date.now() - _);
|
|
4342
4356
|
}, 500), {
|
|
@@ -4403,8 +4417,8 @@ const ci = [
|
|
|
4403
4417
|
}));
|
|
4404
4418
|
},
|
|
4405
4419
|
recordingElapsedLabel() {
|
|
4406
|
-
const e = Math.floor(this.recordingElapsed / 1e3), t = Math.floor(e / 60),
|
|
4407
|
-
return `${t}:${
|
|
4420
|
+
const e = Math.floor(this.recordingElapsed / 1e3), t = Math.floor(e / 60), s = e % 60;
|
|
4421
|
+
return `${t}:${s.toString().padStart(2, "0")}`;
|
|
4408
4422
|
}
|
|
4409
4423
|
},
|
|
4410
4424
|
watch: {
|
|
@@ -4458,7 +4472,7 @@ const ci = [
|
|
|
4458
4472
|
},
|
|
4459
4473
|
onFile(e) {
|
|
4460
4474
|
const t = Array.from(e.target.files || []);
|
|
4461
|
-
for (const
|
|
4475
|
+
for (const s of t) this.$emit("attach", s);
|
|
4462
4476
|
e.target.value = "";
|
|
4463
4477
|
},
|
|
4464
4478
|
onAttachAction(e) {
|
|
@@ -4531,9 +4545,9 @@ const ci = [
|
|
|
4531
4545
|
height: "14",
|
|
4532
4546
|
"aria-hidden": "true"
|
|
4533
4547
|
}, pi = ["d"], vi = ["placeholder", "disabled"], yi = { class: "wm-compose__actions" }, wi = ["title", "aria-label", "disabled"], bi = ["disabled", "aria-label"];
|
|
4534
|
-
function ki(e, t,
|
|
4548
|
+
function ki(e, t, s, r, a, n) {
|
|
4535
4549
|
return c(), d("div", {
|
|
4536
|
-
class: R(["wm-compose-wrap", { "wm-compose-wrap--sheet":
|
|
4550
|
+
class: R(["wm-compose-wrap", { "wm-compose-wrap--sheet": s.displayMode === "sheet" }]),
|
|
4537
4551
|
style: z(a.kbOffset ? { transform: `translateY(-${a.kbOffset}px)` } : null)
|
|
4538
4552
|
}, [
|
|
4539
4553
|
a.recording ? (c(), d("div", ui, [
|
|
@@ -4541,23 +4555,23 @@ function ki(e, t, n, r, a, s) {
|
|
|
4541
4555
|
class: "wm-rec__dot",
|
|
4542
4556
|
"aria-hidden": "true"
|
|
4543
4557
|
}, null, -1)),
|
|
4544
|
-
o("span", hi, v(
|
|
4558
|
+
o("span", hi, v(n.t("composer.recording", { time: n.recordingElapsedLabel })), 1),
|
|
4545
4559
|
o("button", {
|
|
4546
4560
|
type: "button",
|
|
4547
4561
|
class: "wm-rec__stop",
|
|
4548
|
-
onClick: t[0] || (t[0] = (...i) =>
|
|
4549
|
-
}, v(
|
|
4562
|
+
onClick: t[0] || (t[0] = (...i) => n.stopRecording && n.stopRecording(...i))
|
|
4563
|
+
}, v(n.t("composer.stop")), 1)
|
|
4550
4564
|
])) : b("", !0),
|
|
4551
4565
|
o("form", {
|
|
4552
4566
|
class: R(["wm-compose", { "has-attach": a.attachOpen }]),
|
|
4553
|
-
onSubmit: t[7] || (t[7] = J((...i) =>
|
|
4567
|
+
onSubmit: t[7] || (t[7] = J((...i) => n.onSubmit && n.onSubmit(...i), ["prevent"]))
|
|
4554
4568
|
}, [
|
|
4555
4569
|
o("input", {
|
|
4556
4570
|
ref: "fileEl",
|
|
4557
4571
|
type: "file",
|
|
4558
4572
|
hidden: "",
|
|
4559
4573
|
multiple: "",
|
|
4560
|
-
onChange: t[1] || (t[1] = (...i) =>
|
|
4574
|
+
onChange: t[1] || (t[1] = (...i) => n.onFile && n.onFile(...i))
|
|
4561
4575
|
}, null, 544),
|
|
4562
4576
|
a.attachOpen ? (c(), d("div", {
|
|
4563
4577
|
key: 0,
|
|
@@ -4565,12 +4579,12 @@ function ki(e, t, n, r, a, s) {
|
|
|
4565
4579
|
onClick: t[2] || (t[2] = (i) => a.attachOpen = !1)
|
|
4566
4580
|
})) : b("", !0),
|
|
4567
4581
|
a.attachOpen ? (c(), d("div", mi, [
|
|
4568
|
-
(c(!0), d(I, null, F(
|
|
4582
|
+
(c(!0), d(I, null, F(n.attachItems, (i) => (c(), d("button", {
|
|
4569
4583
|
key: i.action,
|
|
4570
4584
|
type: "button",
|
|
4571
4585
|
class: "wm-compose__menuItem",
|
|
4572
4586
|
disabled: i.disabled,
|
|
4573
|
-
onClick: (l) =>
|
|
4587
|
+
onClick: (l) => n.onAttachAction(i.action)
|
|
4574
4588
|
}, [
|
|
4575
4589
|
o("span", _i, [
|
|
4576
4590
|
(c(), d("svg", gi, [
|
|
@@ -4592,10 +4606,10 @@ function ki(e, t, n, r, a, s) {
|
|
|
4592
4606
|
"onUpdate:modelValue": t[3] || (t[3] = (i) => a.local = i),
|
|
4593
4607
|
class: "wm-compose__input",
|
|
4594
4608
|
rows: "3",
|
|
4595
|
-
placeholder:
|
|
4596
|
-
disabled:
|
|
4597
|
-
onKeydown: t[4] || (t[4] = (...i) =>
|
|
4598
|
-
onInput: t[5] || (t[5] = (...i) =>
|
|
4609
|
+
placeholder: s.placeholder,
|
|
4610
|
+
disabled: s.disabled,
|
|
4611
|
+
onKeydown: t[4] || (t[4] = (...i) => n.onKeydown && n.onKeydown(...i)),
|
|
4612
|
+
onInput: t[5] || (t[5] = (...i) => n.autosize && n.autosize(...i))
|
|
4599
4613
|
}, null, 40, vi), [
|
|
4600
4614
|
[te, a.local]
|
|
4601
4615
|
]),
|
|
@@ -4603,8 +4617,8 @@ function ki(e, t, n, r, a, s) {
|
|
|
4603
4617
|
o("button", {
|
|
4604
4618
|
type: "button",
|
|
4605
4619
|
class: R(["wm-compose__icon", { "is-open": a.attachOpen }]),
|
|
4606
|
-
title:
|
|
4607
|
-
"aria-label":
|
|
4620
|
+
title: s.attachLabel,
|
|
4621
|
+
"aria-label": s.attachLabel,
|
|
4608
4622
|
disabled: a.recording,
|
|
4609
4623
|
onClick: t[6] || (t[6] = (i) => a.attachOpen = !a.attachOpen)
|
|
4610
4624
|
}, [...t[9] || (t[9] = [
|
|
@@ -4624,9 +4638,9 @@ function ki(e, t, n, r, a, s) {
|
|
|
4624
4638
|
])], 10, wi),
|
|
4625
4639
|
o("button", {
|
|
4626
4640
|
type: "submit",
|
|
4627
|
-
class: R(["wm-compose__send", { "is-empty": !
|
|
4628
|
-
disabled: !
|
|
4629
|
-
"aria-label":
|
|
4641
|
+
class: R(["wm-compose__send", { "is-empty": !n.canSend }]),
|
|
4642
|
+
disabled: !n.canSend,
|
|
4643
|
+
"aria-label": n.t("composer.send")
|
|
4630
4644
|
}, [...t[10] || (t[10] = [
|
|
4631
4645
|
o("svg", {
|
|
4632
4646
|
width: "13",
|
|
@@ -4664,16 +4678,16 @@ const Ci = /* @__PURE__ */ P(di, [["render", ki], ["__scopeId", "data-v-01e81a27
|
|
|
4664
4678
|
}
|
|
4665
4679
|
}
|
|
4666
4680
|
}, Si = ["onClick"];
|
|
4667
|
-
function Mi(e, t,
|
|
4668
|
-
return
|
|
4669
|
-
key:
|
|
4681
|
+
function Mi(e, t, s, r, a, n) {
|
|
4682
|
+
return s.items.length ? (c(), d("div", {
|
|
4683
|
+
key: n.batchKey,
|
|
4670
4684
|
class: "wm-chips"
|
|
4671
4685
|
}, [
|
|
4672
|
-
(c(!0), d(I, null, F(
|
|
4686
|
+
(c(!0), d(I, null, F(s.items, (i, l) => (c(), d("button", {
|
|
4673
4687
|
key: l,
|
|
4674
4688
|
type: "button",
|
|
4675
4689
|
class: "wm-chip",
|
|
4676
|
-
style: z({ animationDelay:
|
|
4690
|
+
style: z({ animationDelay: s.baseDelay + l * s.stepDelay + "ms" }),
|
|
4677
4691
|
onClick: (_) => e.$emit("select", i)
|
|
4678
4692
|
}, v(i.label), 13, Si))), 128))
|
|
4679
4693
|
])) : b("", !0);
|
|
@@ -4726,41 +4740,41 @@ const Ti = /* @__PURE__ */ P(Ai, [["render", Mi], ["__scopeId", "data-v-47ad8085
|
|
|
4726
4740
|
key: 0,
|
|
4727
4741
|
class: "wm-approval__detail"
|
|
4728
4742
|
}, Pi = { class: "wm-approval__actions" };
|
|
4729
|
-
function
|
|
4743
|
+
function Di(e, t, s, r, a, n) {
|
|
4730
4744
|
const i = B("AIAvatar");
|
|
4731
4745
|
return c(), d("div", Oi, [
|
|
4732
4746
|
o("div", Ri, [
|
|
4733
4747
|
o("div", Li, [
|
|
4734
4748
|
$(i, {
|
|
4735
4749
|
size: 24,
|
|
4736
|
-
name:
|
|
4737
|
-
"image-url":
|
|
4750
|
+
name: s.agentName,
|
|
4751
|
+
"image-url": s.agentAvatarUrl
|
|
4738
4752
|
}, null, 8, ["name", "image-url"])
|
|
4739
4753
|
]),
|
|
4740
4754
|
o("div", Ii, [
|
|
4741
|
-
o("div", Ei, v(
|
|
4742
|
-
|
|
4755
|
+
o("div", Ei, v(s.action), 1),
|
|
4756
|
+
s.detail ? (c(), d("div", Bi, v(s.detail), 1)) : b("", !0)
|
|
4743
4757
|
])
|
|
4744
4758
|
]),
|
|
4745
4759
|
o("div", Pi, [
|
|
4746
|
-
|
|
4760
|
+
n.rejectId ? (c(), d("button", {
|
|
4747
4761
|
key: 0,
|
|
4748
4762
|
type: "button",
|
|
4749
4763
|
class: "wm-approval__btn wm-approval__btn--neutral",
|
|
4750
|
-
onClick: t[0] || (t[0] = (l) => e.$emit("callback",
|
|
4751
|
-
}, v(
|
|
4752
|
-
|
|
4764
|
+
onClick: t[0] || (t[0] = (l) => e.$emit("callback", n.rejectId))
|
|
4765
|
+
}, v(n.rejectLabel), 1)) : b("", !0),
|
|
4766
|
+
n.approveId ? (c(), d("button", {
|
|
4753
4767
|
key: 1,
|
|
4754
4768
|
type: "button",
|
|
4755
4769
|
class: "wm-approval__btn wm-approval__btn--primary",
|
|
4756
|
-
onClick: t[1] || (t[1] = (l) => e.$emit("callback",
|
|
4757
|
-
}, v(
|
|
4770
|
+
onClick: t[1] || (t[1] = (l) => e.$emit("callback", n.approveId))
|
|
4771
|
+
}, v(n.approveLabel), 1)) : b("", !0)
|
|
4758
4772
|
])
|
|
4759
4773
|
]);
|
|
4760
4774
|
}
|
|
4761
|
-
const
|
|
4762
|
-
let
|
|
4763
|
-
const
|
|
4775
|
+
const Ni = /* @__PURE__ */ P(xi, [["render", Di], ["__scopeId", "data-v-a2bed37e"]]);
|
|
4776
|
+
let De = 0;
|
|
4777
|
+
const Ui = /* @__PURE__ */ new Set([
|
|
4764
4778
|
"text",
|
|
4765
4779
|
"textarea",
|
|
4766
4780
|
"number",
|
|
@@ -4785,8 +4799,8 @@ const Ni = /* @__PURE__ */ new Set([
|
|
|
4785
4799
|
},
|
|
4786
4800
|
emits: ["submit"],
|
|
4787
4801
|
data() {
|
|
4788
|
-
return
|
|
4789
|
-
_uid:
|
|
4802
|
+
return De += 1, {
|
|
4803
|
+
_uid: De,
|
|
4790
4804
|
values: {},
|
|
4791
4805
|
busy: !1,
|
|
4792
4806
|
error: ""
|
|
@@ -4798,7 +4812,7 @@ const Ni = /* @__PURE__ */ new Set([
|
|
|
4798
4812
|
// douteux.
|
|
4799
4813
|
normalizedFields() {
|
|
4800
4814
|
var t;
|
|
4801
|
-
return (Array.isArray((t = this.form) == null ? void 0 : t.fields) ? this.form.fields : []).filter((
|
|
4815
|
+
return (Array.isArray((t = this.form) == null ? void 0 : t.fields) ? this.form.fields : []).filter((s) => !(!(s != null && s.key) || !(s != null && s.label) || !Ui.has(s == null ? void 0 : s.type) || (s.type === "select" || s.type === "multiselect") && (!Array.isArray(s.options) || s.options.length === 0)));
|
|
4802
4816
|
}
|
|
4803
4817
|
},
|
|
4804
4818
|
created() {
|
|
@@ -4807,18 +4821,18 @@ const Ni = /* @__PURE__ */ new Set([
|
|
|
4807
4821
|
methods: {
|
|
4808
4822
|
resetValues() {
|
|
4809
4823
|
const e = this.initialValues && typeof this.initialValues == "object" ? this.initialValues : {}, t = {};
|
|
4810
|
-
for (const
|
|
4811
|
-
if (e[
|
|
4812
|
-
t[
|
|
4824
|
+
for (const s of this.normalizedFields) {
|
|
4825
|
+
if (e[s.key] !== void 0) {
|
|
4826
|
+
t[s.key] = e[s.key];
|
|
4813
4827
|
continue;
|
|
4814
4828
|
}
|
|
4815
|
-
|
|
4829
|
+
s.type === "boolean" ? t[s.key] = !1 : s.type === "multiselect" ? t[s.key] = [] : t[s.key] = "";
|
|
4816
4830
|
}
|
|
4817
4831
|
this.values = t, this.error = "";
|
|
4818
4832
|
},
|
|
4819
|
-
toggleMulti(e, t,
|
|
4833
|
+
toggleMulti(e, t, s) {
|
|
4820
4834
|
const r = Array.isArray(this.values[e]) ? this.values[e].slice() : [], a = r.indexOf(t);
|
|
4821
|
-
|
|
4835
|
+
s && a === -1 ? r.push(t) : !s && a !== -1 && r.splice(a, 1), this.values = { ...this.values, [e]: r };
|
|
4822
4836
|
},
|
|
4823
4837
|
validate() {
|
|
4824
4838
|
for (const e of this.normalizedFields) {
|
|
@@ -4878,27 +4892,27 @@ const Ni = /* @__PURE__ */ new Set([
|
|
|
4878
4892
|
key: 2,
|
|
4879
4893
|
class: "wm-form__doneLbl"
|
|
4880
4894
|
};
|
|
4881
|
-
function ca(e, t,
|
|
4895
|
+
function ca(e, t, s, r, a, n) {
|
|
4882
4896
|
const i = B("AIAvatar");
|
|
4883
4897
|
return c(), d("div", ji, [
|
|
4884
4898
|
o("div", Hi, [
|
|
4885
4899
|
o("div", zi, [
|
|
4886
4900
|
$(i, {
|
|
4887
4901
|
size: 24,
|
|
4888
|
-
name:
|
|
4889
|
-
"image-url":
|
|
4902
|
+
name: s.agentName,
|
|
4903
|
+
"image-url": s.agentAvatarUrl
|
|
4890
4904
|
}, null, 8, ["name", "image-url"])
|
|
4891
4905
|
]),
|
|
4892
4906
|
o("div", qi, [
|
|
4893
|
-
o("div", Vi, v(
|
|
4894
|
-
|
|
4907
|
+
o("div", Vi, v(s.form.title || n.t("form.title")), 1),
|
|
4908
|
+
s.form.description ? (c(), d("div", $i, v(s.form.description), 1)) : b("", !0)
|
|
4895
4909
|
])
|
|
4896
4910
|
]),
|
|
4897
4911
|
o("form", {
|
|
4898
4912
|
class: "wm-form__body",
|
|
4899
|
-
onSubmit: t[0] || (t[0] = J((...l) =>
|
|
4913
|
+
onSubmit: t[0] || (t[0] = J((...l) => n.onSubmit && n.onSubmit(...l), ["prevent"]))
|
|
4900
4914
|
}, [
|
|
4901
|
-
(c(!0), d(I, null, F(
|
|
4915
|
+
(c(!0), d(I, null, F(n.normalizedFields, (l) => (c(), d("div", {
|
|
4902
4916
|
key: l.key,
|
|
4903
4917
|
class: "wm-form__field"
|
|
4904
4918
|
}, [
|
|
@@ -4917,7 +4931,7 @@ function ca(e, t, n, r, a, s) {
|
|
|
4917
4931
|
class: "wm-form__input",
|
|
4918
4932
|
placeholder: l.placeholder || "",
|
|
4919
4933
|
required: l.required,
|
|
4920
|
-
disabled:
|
|
4934
|
+
disabled: s.readOnly || a.busy
|
|
4921
4935
|
}, null, 8, Gi)), [
|
|
4922
4936
|
[te, a.values[l.key]]
|
|
4923
4937
|
]) : l.type === "textarea" ? G((c(), d("textarea", {
|
|
@@ -4928,7 +4942,7 @@ function ca(e, t, n, r, a, s) {
|
|
|
4928
4942
|
rows: "3",
|
|
4929
4943
|
placeholder: l.placeholder || "",
|
|
4930
4944
|
required: l.required,
|
|
4931
|
-
disabled:
|
|
4945
|
+
disabled: s.readOnly || a.busy
|
|
4932
4946
|
}, null, 8, Yi)), [
|
|
4933
4947
|
[te, a.values[l.key]]
|
|
4934
4948
|
]) : l.type === "number" ? G((c(), d("input", {
|
|
@@ -4939,7 +4953,7 @@ function ca(e, t, n, r, a, s) {
|
|
|
4939
4953
|
class: "wm-form__input",
|
|
4940
4954
|
placeholder: l.placeholder || "",
|
|
4941
4955
|
required: l.required,
|
|
4942
|
-
disabled:
|
|
4956
|
+
disabled: s.readOnly || a.busy
|
|
4943
4957
|
}, null, 8, Ji)), [
|
|
4944
4958
|
[
|
|
4945
4959
|
te,
|
|
@@ -4954,7 +4968,7 @@ function ca(e, t, n, r, a, s) {
|
|
|
4954
4968
|
type: "date",
|
|
4955
4969
|
class: "wm-form__input",
|
|
4956
4970
|
required: l.required,
|
|
4957
|
-
disabled:
|
|
4971
|
+
disabled: s.readOnly || a.busy
|
|
4958
4972
|
}, null, 8, Xi)), [
|
|
4959
4973
|
[te, a.values[l.key]]
|
|
4960
4974
|
]) : l.type === "boolean" ? (c(), d("label", Qi, [
|
|
@@ -4962,20 +4976,20 @@ function ca(e, t, n, r, a, s) {
|
|
|
4962
4976
|
id: `wm-f-${a._uid}-${l.key}`,
|
|
4963
4977
|
"onUpdate:modelValue": (_) => a.values[l.key] = _,
|
|
4964
4978
|
type: "checkbox",
|
|
4965
|
-
disabled:
|
|
4979
|
+
disabled: s.readOnly || a.busy
|
|
4966
4980
|
}, null, 8, Zi), [
|
|
4967
4981
|
[We, a.values[l.key]]
|
|
4968
4982
|
]),
|
|
4969
|
-
o("span", null, v(l.placeholder ||
|
|
4983
|
+
o("span", null, v(l.placeholder || n.t("common.yes")), 1)
|
|
4970
4984
|
])) : l.type === "select" ? G((c(), d("select", {
|
|
4971
4985
|
key: 5,
|
|
4972
4986
|
id: `wm-f-${a._uid}-${l.key}`,
|
|
4973
4987
|
"onUpdate:modelValue": (_) => a.values[l.key] = _,
|
|
4974
4988
|
class: "wm-form__select",
|
|
4975
4989
|
required: l.required,
|
|
4976
|
-
disabled:
|
|
4990
|
+
disabled: s.readOnly || a.busy
|
|
4977
4991
|
}, [
|
|
4978
|
-
o("option", ta, v(l.placeholder ||
|
|
4992
|
+
o("option", ta, v(l.placeholder || n.t("form.choose")), 1),
|
|
4979
4993
|
(c(!0), d(I, null, F(l.options, (_) => (c(), d("option", {
|
|
4980
4994
|
key: _.value,
|
|
4981
4995
|
value: _.value
|
|
@@ -4991,8 +5005,8 @@ function ca(e, t, n, r, a, s) {
|
|
|
4991
5005
|
type: "checkbox",
|
|
4992
5006
|
value: _.value,
|
|
4993
5007
|
checked: Array.isArray(a.values[l.key]) && a.values[l.key].includes(_.value),
|
|
4994
|
-
disabled:
|
|
4995
|
-
onChange: (k) =>
|
|
5008
|
+
disabled: s.readOnly || a.busy,
|
|
5009
|
+
onChange: (k) => n.toggleMulti(
|
|
4996
5010
|
l.key,
|
|
4997
5011
|
_.value,
|
|
4998
5012
|
k.target.checked
|
|
@@ -5003,14 +5017,14 @@ function ca(e, t, n, r, a, s) {
|
|
|
5003
5017
|
])) : b("", !0)
|
|
5004
5018
|
]))), 128)),
|
|
5005
5019
|
a.error ? (c(), d("div", ia, v(a.error), 1)) : b("", !0),
|
|
5006
|
-
|
|
5020
|
+
s.readOnly ? (c(), d("div", la, v(n.t("form.responseSent")), 1)) : (c(), d("button", {
|
|
5007
5021
|
key: 1,
|
|
5008
5022
|
type: "submit",
|
|
5009
5023
|
class: "wm-form__submit",
|
|
5010
5024
|
disabled: a.busy
|
|
5011
5025
|
}, [
|
|
5012
5026
|
a.busy ? (c(), d("span", oa)) : b("", !0),
|
|
5013
|
-
o("span", null, v(a.busy ?
|
|
5027
|
+
o("span", null, v(a.busy ? n.t("common.sending") : s.form.submit_label || n.t("common.send")), 1)
|
|
5014
5028
|
], 8, aa))
|
|
5015
5029
|
], 32)
|
|
5016
5030
|
]);
|
|
@@ -5053,9 +5067,9 @@ const da = /* @__PURE__ */ P(Fi, [["render", ca], ["__scopeId", "data-v-fe65cc56
|
|
|
5053
5067
|
key: 1,
|
|
5054
5068
|
class: "wm-fb__done"
|
|
5055
5069
|
}, ba = { class: "wm-fb__doneTitle" }, ka = { class: "wm-fb__doneSub" };
|
|
5056
|
-
function Ca(e, t,
|
|
5070
|
+
function Ca(e, t, s, r, a, n) {
|
|
5057
5071
|
return c(), d("div", ha, [
|
|
5058
|
-
|
|
5072
|
+
s.done ? (c(), d("div", wa, [
|
|
5059
5073
|
t[1] || (t[1] = o("div", { class: "wm-fb__check" }, [
|
|
5060
5074
|
o("svg", {
|
|
5061
5075
|
width: "16",
|
|
@@ -5071,13 +5085,13 @@ function Ca(e, t, n, r, a, s) {
|
|
|
5071
5085
|
o("path", { d: "M20 6L9 17l-5-5" })
|
|
5072
5086
|
])
|
|
5073
5087
|
], -1)),
|
|
5074
|
-
o("div", ba, v(
|
|
5075
|
-
o("div", ka, v(
|
|
5088
|
+
o("div", ba, v(n.t("feedback.doneTitle")), 1),
|
|
5089
|
+
o("div", ka, v(n.t("feedback.doneSubtitle")), 1)
|
|
5076
5090
|
])) : (c(), d(I, { key: 0 }, [
|
|
5077
|
-
o("div", ma, v(
|
|
5078
|
-
o("div", fa, v(
|
|
5091
|
+
o("div", ma, v(n.t("feedback.question")), 1),
|
|
5092
|
+
o("div", fa, v(n.t("feedback.subtitle")), 1),
|
|
5079
5093
|
o("div", _a, [
|
|
5080
|
-
(c(!0), d(I, null, F(
|
|
5094
|
+
(c(!0), d(I, null, F(n.options, (i) => (c(), d("button", {
|
|
5081
5095
|
key: i.v,
|
|
5082
5096
|
type: "button",
|
|
5083
5097
|
class: R(["wm-fb__opt", { "is-selected": a.sel === i.v }]),
|
|
@@ -5090,9 +5104,9 @@ function Ca(e, t, n, r, a, s) {
|
|
|
5090
5104
|
o("button", {
|
|
5091
5105
|
type: "button",
|
|
5092
5106
|
class: "wm-fb__send",
|
|
5093
|
-
disabled: !a.sel ||
|
|
5094
|
-
onClick: t[0] || (t[0] = (...i) =>
|
|
5095
|
-
}, v(
|
|
5107
|
+
disabled: !a.sel || s.busy,
|
|
5108
|
+
onClick: t[0] || (t[0] = (...i) => n.onSend && n.onSend(...i))
|
|
5109
|
+
}, v(s.busy ? n.t("common.sending") : n.t("feedback.submit")), 9, ya)
|
|
5096
5110
|
], 64))
|
|
5097
5111
|
]);
|
|
5098
5112
|
}
|
|
@@ -5140,20 +5154,20 @@ const Aa = /* @__PURE__ */ P(ua, [["render", Ca], ["__scopeId", "data-v-9b630564
|
|
|
5140
5154
|
}, Oa = { class: "wm-mm__label" }, Ra = { class: "wm-mm__label" }, La = {
|
|
5141
5155
|
key: 1,
|
|
5142
5156
|
class: "wm-mm__sep"
|
|
5143
|
-
}, Ia = { class: "wm-mm__section" }, Ea = { class: "wm-mm__label" }, Ba = { class: "wm-mm__section" }, Pa = { class: "wm-mm__label" },
|
|
5144
|
-
function
|
|
5157
|
+
}, Ia = { class: "wm-mm__section" }, Ea = { class: "wm-mm__label" }, Ba = { class: "wm-mm__section" }, Pa = { class: "wm-mm__label" }, Da = { class: "wm-mm__label" };
|
|
5158
|
+
function Na(e, t, s, r, a, n) {
|
|
5145
5159
|
return c(), d("div", Ma, [
|
|
5146
5160
|
o("div", {
|
|
5147
5161
|
class: "wm-mm__scrim",
|
|
5148
5162
|
onClick: t[0] || (t[0] = (i) => e.$emit("close"))
|
|
5149
5163
|
}),
|
|
5150
5164
|
o("div", Ta, [
|
|
5151
|
-
|
|
5152
|
-
|
|
5165
|
+
s.canRename || s.canExport ? (c(), d("div", xa, [
|
|
5166
|
+
s.canRename ? (c(), d("button", {
|
|
5153
5167
|
key: 0,
|
|
5154
5168
|
type: "button",
|
|
5155
5169
|
class: "wm-mm__item",
|
|
5156
|
-
onClick: t[1] || (t[1] = (i) =>
|
|
5170
|
+
onClick: t[1] || (t[1] = (i) => n.emit("rename"))
|
|
5157
5171
|
}, [
|
|
5158
5172
|
t[6] || (t[6] = o("span", { class: "wm-mm__icon" }, [
|
|
5159
5173
|
o("svg", {
|
|
@@ -5171,13 +5185,13 @@ function Da(e, t, n, r, a, s) {
|
|
|
5171
5185
|
o("path", { d: "M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z" })
|
|
5172
5186
|
])
|
|
5173
5187
|
], -1)),
|
|
5174
|
-
o("span", Oa, v(
|
|
5188
|
+
o("span", Oa, v(n.t("moreMenu.editTitle")), 1)
|
|
5175
5189
|
])) : b("", !0),
|
|
5176
|
-
|
|
5190
|
+
s.canExport ? (c(), d("button", {
|
|
5177
5191
|
key: 1,
|
|
5178
5192
|
type: "button",
|
|
5179
5193
|
class: "wm-mm__item",
|
|
5180
|
-
onClick: t[2] || (t[2] = (i) =>
|
|
5194
|
+
onClick: t[2] || (t[2] = (i) => n.emit("export"))
|
|
5181
5195
|
}, [
|
|
5182
5196
|
t[7] || (t[7] = o("span", { class: "wm-mm__icon" }, [
|
|
5183
5197
|
o("svg", {
|
|
@@ -5194,16 +5208,16 @@ function Da(e, t, n, r, a, s) {
|
|
|
5194
5208
|
o("path", { d: "M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" })
|
|
5195
5209
|
])
|
|
5196
5210
|
], -1)),
|
|
5197
|
-
o("span", Ra, v(
|
|
5211
|
+
o("span", Ra, v(n.t("moreMenu.exportTranscript")), 1),
|
|
5198
5212
|
t[8] || (t[8] = o("span", { class: "wm-mm__hint" }, ".txt", -1))
|
|
5199
5213
|
])) : b("", !0)
|
|
5200
5214
|
])) : b("", !0),
|
|
5201
|
-
|
|
5215
|
+
s.canRename || s.canExport ? (c(), d("div", La)) : b("", !0),
|
|
5202
5216
|
o("div", Ia, [
|
|
5203
5217
|
o("button", {
|
|
5204
5218
|
type: "button",
|
|
5205
5219
|
class: "wm-mm__item",
|
|
5206
|
-
onClick: t[3] || (t[3] = (...i) =>
|
|
5220
|
+
onClick: t[3] || (t[3] = (...i) => n.toggleSound && n.toggleSound(...i))
|
|
5207
5221
|
}, [
|
|
5208
5222
|
t[10] || (t[10] = o("span", { class: "wm-mm__icon" }, [
|
|
5209
5223
|
o("svg", {
|
|
@@ -5221,7 +5235,7 @@ function Da(e, t, n, r, a, s) {
|
|
|
5221
5235
|
o("path", { d: "M15.54 8.46a5 5 0 010 7.07M19.07 4.93a10 10 0 010 14.14" })
|
|
5222
5236
|
])
|
|
5223
5237
|
], -1)),
|
|
5224
|
-
o("span", Ea, v(
|
|
5238
|
+
o("span", Ea, v(n.t("moreMenu.sound")), 1),
|
|
5225
5239
|
o("span", {
|
|
5226
5240
|
class: R(["wm-mm__toggle", { "wm-mm__toggle--on": a.soundOn }])
|
|
5227
5241
|
}, [...t[9] || (t[9] = [
|
|
@@ -5231,11 +5245,11 @@ function Da(e, t, n, r, a, s) {
|
|
|
5231
5245
|
]),
|
|
5232
5246
|
t[13] || (t[13] = o("div", { class: "wm-mm__sep" }, null, -1)),
|
|
5233
5247
|
o("div", Ba, [
|
|
5234
|
-
|
|
5248
|
+
s.statusUrl ? (c(), d("button", {
|
|
5235
5249
|
key: 0,
|
|
5236
5250
|
type: "button",
|
|
5237
5251
|
class: "wm-mm__item",
|
|
5238
|
-
onClick: t[4] || (t[4] = (i) =>
|
|
5252
|
+
onClick: t[4] || (t[4] = (i) => n.emit("status"))
|
|
5239
5253
|
}, [
|
|
5240
5254
|
t[11] || (t[11] = o("span", { class: "wm-mm__icon" }, [
|
|
5241
5255
|
o("svg", {
|
|
@@ -5252,13 +5266,13 @@ function Da(e, t, n, r, a, s) {
|
|
|
5252
5266
|
o("path", { d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zM10 6v4l3 2" })
|
|
5253
5267
|
])
|
|
5254
5268
|
], -1)),
|
|
5255
|
-
o("span", Pa, v(
|
|
5269
|
+
o("span", Pa, v(n.t("moreMenu.serviceStatus")), 1)
|
|
5256
5270
|
])) : b("", !0),
|
|
5257
|
-
|
|
5271
|
+
s.helpUrl ? (c(), d("button", {
|
|
5258
5272
|
key: 1,
|
|
5259
5273
|
type: "button",
|
|
5260
5274
|
class: "wm-mm__item",
|
|
5261
|
-
onClick: t[5] || (t[5] = (i) =>
|
|
5275
|
+
onClick: t[5] || (t[5] = (i) => n.emit("help"))
|
|
5262
5276
|
}, [
|
|
5263
5277
|
t[12] || (t[12] = o("span", { class: "wm-mm__icon" }, [
|
|
5264
5278
|
o("svg", {
|
|
@@ -5275,13 +5289,13 @@ function Da(e, t, n, r, a, s) {
|
|
|
5275
5289
|
o("path", { d: "M9 11a3 3 0 116 0c0 2-3 2-3 5M12 19h.01M12 22a10 10 0 110-20 10 10 0 010 20z" })
|
|
5276
5290
|
])
|
|
5277
5291
|
], -1)),
|
|
5278
|
-
o("span",
|
|
5292
|
+
o("span", Da, v(n.t("moreMenu.helpCenter")), 1)
|
|
5279
5293
|
])) : b("", !0)
|
|
5280
5294
|
])
|
|
5281
5295
|
])
|
|
5282
5296
|
]);
|
|
5283
5297
|
}
|
|
5284
|
-
const
|
|
5298
|
+
const Ua = /* @__PURE__ */ P(Sa, [["render", Na], ["__scopeId", "data-v-4cf6d578"]]), Fa = {
|
|
5285
5299
|
name: "WmRenameDialog",
|
|
5286
5300
|
inject: {
|
|
5287
5301
|
// Translator shared by the Messenger shell; French fallback when
|
|
@@ -5328,7 +5342,7 @@ const Na = /* @__PURE__ */ P(Sa, [["render", Da], ["__scopeId", "data-v-4cf6d578
|
|
|
5328
5342
|
role: "dialog",
|
|
5329
5343
|
"aria-modal": "true"
|
|
5330
5344
|
}, za = { class: "wm-dialog__head" }, qa = { class: "wm-dialog__title" }, Va = ["aria-label"], $a = { class: "wm-dialog__body" }, Ka = ["placeholder"], Wa = { class: "wm-dialog__actions" }, Ga = ["disabled"];
|
|
5331
|
-
function Ya(e, t,
|
|
5345
|
+
function Ya(e, t, s, r, a, n) {
|
|
5332
5346
|
return c(), d("div", ja, [
|
|
5333
5347
|
o("div", {
|
|
5334
5348
|
class: "wm-dialog__scrim",
|
|
@@ -5336,11 +5350,11 @@ function Ya(e, t, n, r, a, s) {
|
|
|
5336
5350
|
}),
|
|
5337
5351
|
o("div", Ha, [
|
|
5338
5352
|
o("div", za, [
|
|
5339
|
-
o("div", qa, v(
|
|
5353
|
+
o("div", qa, v(s.title || n.t("rename.title")), 1),
|
|
5340
5354
|
o("button", {
|
|
5341
5355
|
type: "button",
|
|
5342
5356
|
class: "wm-dialog__close",
|
|
5343
|
-
"aria-label":
|
|
5357
|
+
"aria-label": n.t("common.close"),
|
|
5344
5358
|
onClick: t[1] || (t[1] = (i) => e.$emit("close"))
|
|
5345
5359
|
}, [...t[7] || (t[7] = [
|
|
5346
5360
|
o("svg", {
|
|
@@ -5364,10 +5378,10 @@ function Ya(e, t, n, r, a, s) {
|
|
|
5364
5378
|
"onUpdate:modelValue": t[2] || (t[2] = (i) => a.value = i),
|
|
5365
5379
|
type: "text",
|
|
5366
5380
|
class: "wm-dialog__input",
|
|
5367
|
-
placeholder:
|
|
5381
|
+
placeholder: s.placeholder || n.t("rename.placeholder"),
|
|
5368
5382
|
maxlength: 120,
|
|
5369
5383
|
onKeydown: [
|
|
5370
|
-
t[3] || (t[3] = ge(J((...i) =>
|
|
5384
|
+
t[3] || (t[3] = ge(J((...i) => n.onSubmit && n.onSubmit(...i), ["prevent"]), ["enter"])),
|
|
5371
5385
|
t[4] || (t[4] = ge(J((i) => e.$emit("close"), ["prevent"]), ["esc"]))
|
|
5372
5386
|
]
|
|
5373
5387
|
}, null, 40, Ka), [
|
|
@@ -5379,18 +5393,18 @@ function Ya(e, t, n, r, a, s) {
|
|
|
5379
5393
|
type: "button",
|
|
5380
5394
|
class: "wm-dialog__btn",
|
|
5381
5395
|
onClick: t[5] || (t[5] = (i) => e.$emit("close"))
|
|
5382
|
-
}, v(
|
|
5396
|
+
}, v(n.t("common.cancel")), 1),
|
|
5383
5397
|
o("button", {
|
|
5384
5398
|
type: "button",
|
|
5385
5399
|
class: "wm-dialog__btn wm-dialog__btn--primary",
|
|
5386
|
-
disabled: !
|
|
5387
|
-
onClick: t[6] || (t[6] = (...i) =>
|
|
5388
|
-
}, v(
|
|
5400
|
+
disabled: !n.canSubmit,
|
|
5401
|
+
onClick: t[6] || (t[6] = (...i) => n.onSubmit && n.onSubmit(...i))
|
|
5402
|
+
}, v(n.t("common.save")), 9, Ga)
|
|
5389
5403
|
])
|
|
5390
5404
|
])
|
|
5391
5405
|
]);
|
|
5392
5406
|
}
|
|
5393
|
-
const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8"]]),
|
|
5407
|
+
const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8"]]), Ne = "ww-messenger-tokens", Xa = {
|
|
5394
5408
|
name: "Messenger",
|
|
5395
5409
|
components: {
|
|
5396
5410
|
Launcher: qt,
|
|
@@ -5400,10 +5414,10 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5400
5414
|
MessageList: ri,
|
|
5401
5415
|
Composer: Ci,
|
|
5402
5416
|
SuggestionChips: Ti,
|
|
5403
|
-
ApprovalCard:
|
|
5417
|
+
ApprovalCard: Ni,
|
|
5404
5418
|
FormCard: da,
|
|
5405
5419
|
Feedback: Aa,
|
|
5406
|
-
MoreMenu:
|
|
5420
|
+
MoreMenu: Ua,
|
|
5407
5421
|
RenameDialog: Ja
|
|
5408
5422
|
},
|
|
5409
5423
|
mixins: [
|
|
@@ -5419,8 +5433,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5419
5433
|
provide() {
|
|
5420
5434
|
return {
|
|
5421
5435
|
signAttachmentFn: (e) => {
|
|
5422
|
-
var t,
|
|
5423
|
-
return ((
|
|
5436
|
+
var t, s;
|
|
5437
|
+
return ((s = (t = this.store) == null ? void 0 : t.signAttachment) == null ? void 0 : s.call(t, e)) || null;
|
|
5424
5438
|
},
|
|
5425
5439
|
// Translator + resolved language, shared with every descendant
|
|
5426
5440
|
// via inject. Both go through a closure over `this` so they stay
|
|
@@ -5562,9 +5576,9 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5562
5576
|
// so the choice applies immediately, before the boot round-trip
|
|
5563
5577
|
// that materializes `state.customer` has completed.
|
|
5564
5578
|
customerLanguage() {
|
|
5565
|
-
var
|
|
5566
|
-
const e = (
|
|
5567
|
-
return t || ((
|
|
5579
|
+
var s, r, a, n;
|
|
5580
|
+
const e = (s = this.s) == null ? void 0 : s.customer, t = e && (e.language || ((r = e.values) == null ? void 0 : r.language));
|
|
5581
|
+
return t || ((n = (a = this.context) == null ? void 0 : a.customer) == null ? void 0 : n.language) || "";
|
|
5568
5582
|
},
|
|
5569
5583
|
// Resolved UI language, by priority:
|
|
5570
5584
|
// 1. explicit `language` prop (consumer override)
|
|
@@ -5609,11 +5623,11 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5609
5623
|
// the cached messages. The server exposes no preview field, so
|
|
5610
5624
|
// that one stays client-derived.
|
|
5611
5625
|
drawerConversations() {
|
|
5612
|
-
var
|
|
5613
|
-
const e = ((
|
|
5626
|
+
var s;
|
|
5627
|
+
const e = ((s = this.s) == null ? void 0 : s.messagesByConv) || {}, t = this.revealedAt;
|
|
5614
5628
|
return this.allConversations.map((r) => {
|
|
5615
5629
|
var k;
|
|
5616
|
-
const a = e[r.id] || [],
|
|
5630
|
+
const a = e[r.id] || [], n = Y(r.last_read_message_id);
|
|
5617
5631
|
let i = 0, l = null;
|
|
5618
5632
|
for (let w = a.length - 1; w >= 0; w--) {
|
|
5619
5633
|
const T = a[w];
|
|
@@ -5621,13 +5635,13 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5621
5635
|
if (((k = T.author) == null ? void 0 : k.type) === "user") break;
|
|
5622
5636
|
const E = Y(T.id);
|
|
5623
5637
|
if (E != null) {
|
|
5624
|
-
if (
|
|
5638
|
+
if (n != null && E <= n) break;
|
|
5625
5639
|
t[T.id] !== 0 && (!l && T.author && (l = T.author), i++);
|
|
5626
5640
|
}
|
|
5627
5641
|
}
|
|
5628
5642
|
if (!a.length) {
|
|
5629
5643
|
const w = Y(r.last_message_id);
|
|
5630
|
-
w != null && (
|
|
5644
|
+
w != null && (n == null || w > n) && (i = 1, l = r.last_message_author || null);
|
|
5631
5645
|
}
|
|
5632
5646
|
const _ = a.filter(
|
|
5633
5647
|
(w) => !((w == null ? void 0 : w.id) != null && t[w.id] === 0)
|
|
@@ -5652,25 +5666,25 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5652
5666
|
openThreads() {
|
|
5653
5667
|
var t;
|
|
5654
5668
|
const e = ((t = this.s) == null ? void 0 : t.messagesByConv) || {};
|
|
5655
|
-
return this.drawerConversations.filter((
|
|
5656
|
-
id:
|
|
5657
|
-
title:
|
|
5658
|
-
preview:
|
|
5659
|
-
unread: !!
|
|
5660
|
-
author:
|
|
5661
|
-
_ts: Be(
|
|
5662
|
-
})).sort((
|
|
5669
|
+
return this.drawerConversations.filter((s) => s.status !== "resolved").map((s) => ({
|
|
5670
|
+
id: s.id,
|
|
5671
|
+
title: s.name || this.t("common.newConversation"),
|
|
5672
|
+
preview: s._preview || this.t("onboarding.newMessage"),
|
|
5673
|
+
unread: !!s._unread,
|
|
5674
|
+
author: s._lastAuthor || null,
|
|
5675
|
+
_ts: Be(s, e[s.id] || [])
|
|
5676
|
+
})).sort((s, r) => s._ts < r._ts ? 1 : s._ts > r._ts ? -1 : 0);
|
|
5663
5677
|
},
|
|
5664
5678
|
// Unread threads (one entry per conv with unseen agent/human
|
|
5665
5679
|
// activity), freshest first. Each entry carries everything the
|
|
5666
5680
|
// closed-launcher notification card needs: sender identity,
|
|
5667
5681
|
// preview, and the count of unseen messages in that thread.
|
|
5668
5682
|
latestUnreads() {
|
|
5669
|
-
var
|
|
5670
|
-
const e = ((
|
|
5683
|
+
var s;
|
|
5684
|
+
const e = ((s = this.s) == null ? void 0 : s.messagesByConv) || {}, t = [];
|
|
5671
5685
|
for (const r of this.drawerConversations) {
|
|
5672
5686
|
if (!r._unread) continue;
|
|
5673
|
-
const a = Be(r, e[r.id] || []),
|
|
5687
|
+
const a = Be(r, e[r.id] || []), n = r._lastAuthor, i = !n || n.type === "agent_ia", l = (n == null ? void 0 : n.name) || (i ? this.agentName : "") || "", _ = (n == null ? void 0 : n.avatar_url) || (i ? this.agentAvatarUrl : null);
|
|
5674
5688
|
t.push({
|
|
5675
5689
|
convId: r.id,
|
|
5676
5690
|
preview: r._preview || this.t("notification.youHaveNewMessage"),
|
|
@@ -5704,7 +5718,7 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5704
5718
|
const e = this.allConversations;
|
|
5705
5719
|
if (!e.length) return null;
|
|
5706
5720
|
if (this.activeConvId != null) {
|
|
5707
|
-
const t = e.find((
|
|
5721
|
+
const t = e.find((s) => s.id === this.activeConvId);
|
|
5708
5722
|
if (t) return t;
|
|
5709
5723
|
}
|
|
5710
5724
|
return e[0] || null;
|
|
@@ -5713,15 +5727,15 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5713
5727
|
return !!this.currentConv || this.showHistory;
|
|
5714
5728
|
},
|
|
5715
5729
|
statusUrl() {
|
|
5716
|
-
var
|
|
5717
|
-
const e = (
|
|
5730
|
+
var s;
|
|
5731
|
+
const e = (s = this.widget) == null ? void 0 : s.quick_links;
|
|
5718
5732
|
if (!Array.isArray(e)) return "";
|
|
5719
5733
|
const t = e.find((r) => r.icon === "status" && r.url);
|
|
5720
5734
|
return (t == null ? void 0 : t.url) || "";
|
|
5721
5735
|
},
|
|
5722
5736
|
helpUrl() {
|
|
5723
|
-
var
|
|
5724
|
-
const e = (
|
|
5737
|
+
var s;
|
|
5738
|
+
const e = (s = this.widget) == null ? void 0 : s.quick_links;
|
|
5725
5739
|
if (!Array.isArray(e)) return "";
|
|
5726
5740
|
const t = e.find(
|
|
5727
5741
|
(r) => (r.icon === "chat" || r.icon === "help") && r.url
|
|
@@ -5767,12 +5781,12 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5767
5781
|
return ((e = this.widget) == null ? void 0 : e.default_icon_url) || null;
|
|
5768
5782
|
},
|
|
5769
5783
|
agentName() {
|
|
5770
|
-
var e, t,
|
|
5771
|
-
return ((
|
|
5784
|
+
var e, t, s;
|
|
5785
|
+
return ((s = (t = (e = this.s) == null ? void 0 : e.config) == null ? void 0 : t.agent) == null ? void 0 : s.name) || "";
|
|
5772
5786
|
},
|
|
5773
5787
|
agentAvatarUrl() {
|
|
5774
|
-
var e, t,
|
|
5775
|
-
return ((
|
|
5788
|
+
var e, t, s;
|
|
5789
|
+
return ((s = (t = (e = this.s) == null ? void 0 : e.config) == null ? void 0 : t.agent) == null ? void 0 : s.avatar_url) || null;
|
|
5776
5790
|
},
|
|
5777
5791
|
quickLinks() {
|
|
5778
5792
|
var t;
|
|
@@ -5791,11 +5805,11 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5791
5805
|
// Last message from a human agent in the current conversation —
|
|
5792
5806
|
// used to surface the human agent's name + avatar in the header.
|
|
5793
5807
|
humanMessageAuthor() {
|
|
5794
|
-
var t,
|
|
5808
|
+
var t, s, r;
|
|
5795
5809
|
if (!this.currentConv) return null;
|
|
5796
5810
|
const e = ((t = this.s.messagesByConv) == null ? void 0 : t[this.currentConv.id]) || [];
|
|
5797
5811
|
for (let a = e.length - 1; a >= 0; a--)
|
|
5798
|
-
if (((r = (
|
|
5812
|
+
if (((r = (s = e[a]) == null ? void 0 : s.author) == null ? void 0 : r.type) === "agent_human")
|
|
5799
5813
|
return e[a].author;
|
|
5800
5814
|
return null;
|
|
5801
5815
|
},
|
|
@@ -5828,17 +5842,17 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5828
5842
|
}) : this.isWaitingHuman ? this.t("composer.agentTakingOver") : this.t("composer.placeholder");
|
|
5829
5843
|
},
|
|
5830
5844
|
displayedMessages() {
|
|
5831
|
-
var a,
|
|
5845
|
+
var a, n;
|
|
5832
5846
|
const e = this.currentConv;
|
|
5833
5847
|
if (!e) return [];
|
|
5834
5848
|
const t = this.welcomeRevealedAt[e.id] > 0 ? this.buildWelcomePrefix(e) : [];
|
|
5835
5849
|
if (!e._draft) {
|
|
5836
|
-
const i = (
|
|
5850
|
+
const i = (n = (a = this.s) == null ? void 0 : a.paginationByConv) == null ? void 0 : n[e.id];
|
|
5837
5851
|
if (!(i != null && i.loaded)) return t;
|
|
5838
5852
|
}
|
|
5839
|
-
const
|
|
5853
|
+
const s = this.revealedAt, r = (this.s.messagesByConv[e.id] || []).filter((i) => {
|
|
5840
5854
|
var l, _, k, w, T;
|
|
5841
|
-
return (i == null ? void 0 : i.type) === "action" && ((l = i == null ? void 0 : i.payload) == null ? void 0 : l.state) === "pending" || he(i) && !(
|
|
5855
|
+
return (i == null ? void 0 : i.type) === "action" && ((l = i == null ? void 0 : i.payload) == null ? void 0 : l.state) === "pending" || he(i) && !(s[i.id] > 0) ? !1 : (i == null ? void 0 : i.type) === "action" || (i == null ? void 0 : i.type) === "system" || ((_ = i == null ? void 0 : i.payload) == null ? void 0 : _.type) === "system" || Array.isArray((k = i == null ? void 0 : i.payload) == null ? void 0 : k.attachments) && i.payload.attachments.length || (w = i == null ? void 0 : i.metadata) != null && w.artifact || (T = i == null ? void 0 : i.metadata) != null && T.form ? !0 : typeof (i == null ? void 0 : i.text_md) == "string" && i.text_md.trim().length > 0;
|
|
5842
5856
|
});
|
|
5843
5857
|
return t.length ? [...t, ...r] : r;
|
|
5844
5858
|
},
|
|
@@ -5847,18 +5861,18 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5847
5861
|
// or more agent messages are queued and waiting for their reveal
|
|
5848
5862
|
// slot to fire.
|
|
5849
5863
|
streamingActive() {
|
|
5850
|
-
var
|
|
5864
|
+
var s, r, a;
|
|
5851
5865
|
const e = this.currentConv;
|
|
5852
|
-
return e ? Object.keys(((
|
|
5853
|
-
(
|
|
5866
|
+
return e ? Object.keys(((s = this.s) == null ? void 0 : s.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : this.widgetWelcomeMessage && this.welcomeRevealedAt[e.id] === 0 ? !0 : (((a = (r = this.s) == null ? void 0 : r.messagesByConv) == null ? void 0 : a[e.id]) || []).some(
|
|
5867
|
+
(n) => he(n) && !(this.revealedAt[n.id] > 0)
|
|
5854
5868
|
) : !1;
|
|
5855
5869
|
},
|
|
5856
5870
|
// Internal: the raw persisted list for the current conversation. We
|
|
5857
5871
|
// watch this to detect new agent messages that need to be paced.
|
|
5858
5872
|
currentConvMessages() {
|
|
5859
|
-
var t,
|
|
5873
|
+
var t, s, r;
|
|
5860
5874
|
const e = (t = this.currentConv) == null ? void 0 : t.id;
|
|
5861
|
-
return e ? ((r = (
|
|
5875
|
+
return e ? ((r = (s = this.s) == null ? void 0 : s.messagesByConv) == null ? void 0 : r[e]) || [] : [];
|
|
5862
5876
|
},
|
|
5863
5877
|
pendingApproval() {
|
|
5864
5878
|
return !this.currentConv || !this.store || this.actionInFlight ? null : this.store.getPendingApproval(this.currentConv.id);
|
|
@@ -5871,18 +5885,18 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5871
5885
|
return this.pendingApproval ? this.pendingApproval.id === this.approvalLatchId ? !0 : !(this.streamingActive || !this.approvalSettled) : !1;
|
|
5872
5886
|
},
|
|
5873
5887
|
approvalTitle() {
|
|
5874
|
-
var e, t,
|
|
5875
|
-
return ((t = (e = this.pendingApproval) == null ? void 0 : e.payload) == null ? void 0 : t.name) || ((
|
|
5888
|
+
var e, t, s;
|
|
5889
|
+
return ((t = (e = this.pendingApproval) == null ? void 0 : e.payload) == null ? void 0 : t.name) || ((s = this.pendingApproval) == null ? void 0 : s.text_md) || this.t("action.title");
|
|
5876
5890
|
},
|
|
5877
5891
|
approvalDetail() {
|
|
5878
|
-
var r, a,
|
|
5879
|
-
const e = (
|
|
5892
|
+
var r, a, n, i, l, _;
|
|
5893
|
+
const e = (n = (a = (r = this.pendingApproval) == null ? void 0 : r.payload) == null ? void 0 : a.pending) == null ? void 0 : n.user_explanation;
|
|
5880
5894
|
if (typeof e == "string" && e.trim())
|
|
5881
5895
|
return e.trim();
|
|
5882
5896
|
const t = (_ = (l = (i = this.pendingApproval) == null ? void 0 : i.payload) == null ? void 0 : l.pending) == null ? void 0 : _.prepared_params;
|
|
5883
5897
|
if (!t || typeof t != "object") return "";
|
|
5884
|
-
const
|
|
5885
|
-
return
|
|
5898
|
+
const s = Object.entries(t);
|
|
5899
|
+
return s.length ? s.slice(0, 2).map(([k, w]) => `${k}: ${w}`).join(" · ") : "";
|
|
5886
5900
|
},
|
|
5887
5901
|
actionInFlight() {
|
|
5888
5902
|
var e, t;
|
|
@@ -5902,9 +5916,9 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5902
5916
|
// welcome bubble is client-side only and intentionally not
|
|
5903
5917
|
// counted here.
|
|
5904
5918
|
conversationIsEmpty() {
|
|
5905
|
-
var
|
|
5919
|
+
var s, r;
|
|
5906
5920
|
const e = this.currentConv;
|
|
5907
|
-
return e ? e._draft ? !0 : (((r = (
|
|
5921
|
+
return e ? e._draft ? !0 : (((r = (s = this.s) == null ? void 0 : s.messagesByConv) == null ? void 0 : r[e.id]) || []).length === 0 : !1;
|
|
5908
5922
|
},
|
|
5909
5923
|
// Maps `widget.starter_prompts` ({ title, message }) into the
|
|
5910
5924
|
// SuggestionChips shape so they render alongside / in place of
|
|
@@ -5913,18 +5927,18 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5913
5927
|
// the user-visible `title` used as a defensive fallback when
|
|
5914
5928
|
// a malformed entry is missing `message`.
|
|
5915
5929
|
starterPrompts() {
|
|
5916
|
-
var
|
|
5917
|
-
const e = (
|
|
5930
|
+
var s;
|
|
5931
|
+
const e = (s = this.widget) == null ? void 0 : s.starter_prompts;
|
|
5918
5932
|
if (!Array.isArray(e)) return [];
|
|
5919
5933
|
const t = [];
|
|
5920
5934
|
for (const r of e) {
|
|
5921
5935
|
if (!r || typeof r != "object") continue;
|
|
5922
5936
|
const a = typeof r.title == "string" ? r.title.trim() : "";
|
|
5923
5937
|
if (!a) continue;
|
|
5924
|
-
const
|
|
5938
|
+
const n = typeof r.message == "string" ? r.message.trim() : "";
|
|
5925
5939
|
t.push({
|
|
5926
5940
|
label: a,
|
|
5927
|
-
text:
|
|
5941
|
+
text: n || a,
|
|
5928
5942
|
kind: "starter"
|
|
5929
5943
|
});
|
|
5930
5944
|
}
|
|
@@ -5948,11 +5962,11 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5948
5962
|
return this.approvalReady || !!this.pendingForm || this.showFeedback || this.suggestions.length > 0;
|
|
5949
5963
|
},
|
|
5950
5964
|
dateLabel() {
|
|
5951
|
-
var
|
|
5965
|
+
var s, r, a;
|
|
5952
5966
|
const e = this.currentConv;
|
|
5953
5967
|
let t = /* @__PURE__ */ new Date();
|
|
5954
5968
|
if (e) {
|
|
5955
|
-
const i = ((a = (((r = (
|
|
5969
|
+
const i = ((a = (((r = (s = this.s) == null ? void 0 : s.messagesByConv) == null ? void 0 : r[e.id]) || []).find((l) => l == null ? void 0 : l.created_at)) == null ? void 0 : a.created_at) || e.created_at;
|
|
5956
5970
|
if (i) {
|
|
5957
5971
|
const l = new Date(i);
|
|
5958
5972
|
Number.isNaN(l.getTime()) || (t = l);
|
|
@@ -5967,8 +5981,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5967
5981
|
// history available, nothing loading) so the loader stays inert
|
|
5968
5982
|
// until `openConversation` has populated the entry.
|
|
5969
5983
|
paginationState() {
|
|
5970
|
-
var
|
|
5971
|
-
const e = (
|
|
5984
|
+
var s, r, a;
|
|
5985
|
+
const e = (s = this.currentConv) == null ? void 0 : s.id, t = e ? (a = (r = this.s) == null ? void 0 : r.paginationByConv) == null ? void 0 : a[e] : null;
|
|
5972
5986
|
return {
|
|
5973
5987
|
loading: !!(t != null && t.loading),
|
|
5974
5988
|
hasMore: !!(t != null && t.nextCursor)
|
|
@@ -5983,13 +5997,13 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5983
5997
|
// ts comparison in `launcherPeeks`.
|
|
5984
5998
|
latestUnreads: {
|
|
5985
5999
|
handler(e) {
|
|
5986
|
-
const t = new Set(e.map((i) => i.convId)),
|
|
6000
|
+
const t = new Set(e.map((i) => i.convId)), s = this.dismissedPeeks || {}, r = Object.keys(s);
|
|
5987
6001
|
if (!r.length) return;
|
|
5988
6002
|
const a = {};
|
|
5989
|
-
let
|
|
6003
|
+
let n = !1;
|
|
5990
6004
|
for (const i of r)
|
|
5991
|
-
t.has(i) ? a[i] =
|
|
5992
|
-
|
|
6005
|
+
t.has(i) ? a[i] = s[i] : n = !0;
|
|
6006
|
+
n && (this.dismissedPeeks = a);
|
|
5993
6007
|
},
|
|
5994
6008
|
deep: !0
|
|
5995
6009
|
},
|
|
@@ -6010,9 +6024,9 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6010
6024
|
// markConvRead will immediately push it forward as the messages
|
|
6011
6025
|
// render.
|
|
6012
6026
|
isViewingThread(e, t) {
|
|
6013
|
-
var
|
|
6027
|
+
var s;
|
|
6014
6028
|
e && !t ? (this.unreadAnchorId = Y(
|
|
6015
|
-
(
|
|
6029
|
+
(s = this.currentConv) == null ? void 0 : s.last_read_message_id
|
|
6016
6030
|
), this.unreadBoundaryTs = (/* @__PURE__ */ new Date()).toISOString()) : e || (this.unreadAnchorId = null, this.unreadBoundaryTs = "");
|
|
6017
6031
|
},
|
|
6018
6032
|
// Fresh `pendingApproval` arrival : kick off the settle debounce so
|
|
@@ -6023,8 +6037,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6023
6037
|
pendingApproval: {
|
|
6024
6038
|
handler(e, t) {
|
|
6025
6039
|
if (e && !t) {
|
|
6026
|
-
const
|
|
6027
|
-
if (!(Number.isFinite(
|
|
6040
|
+
const s = e != null && e.created_at ? Date.parse(e.created_at) : NaN;
|
|
6041
|
+
if (!(Number.isFinite(s) && s >= this.convOpenedAt)) {
|
|
6028
6042
|
this.resetApprovalPacing();
|
|
6029
6043
|
return;
|
|
6030
6044
|
}
|
|
@@ -6064,9 +6078,9 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6064
6078
|
}
|
|
6065
6079
|
},
|
|
6066
6080
|
async mounted() {
|
|
6067
|
-
if (typeof document < "u" && !document.getElementById(
|
|
6081
|
+
if (typeof document < "u" && !document.getElementById(Ne)) {
|
|
6068
6082
|
const e = document.createElement("style");
|
|
6069
|
-
e.id =
|
|
6083
|
+
e.id = Ne, e.textContent = rt, document.head.appendChild(e);
|
|
6070
6084
|
}
|
|
6071
6085
|
this._parentMessageHandler = this.onParentMessage.bind(this), window.addEventListener("message", this._parentMessageHandler), window.parent && window.parent !== window && window.parent.postMessage({ type: "READY" }, "*"), this.isEmbedded ? (await this.boot(), this.store && await this.open()) : (await this.$nextTick(), this.sendCurrentLauncherSize(), this.observeLauncherSize());
|
|
6072
6086
|
},
|
|
@@ -6098,7 +6112,7 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6098
6112
|
// par le browser via `event.origin`, non-spoofable), le token linked
|
|
6099
6113
|
// optionnel, et relaie les pushes `UPDATE` / `CONTEXT` post-init.
|
|
6100
6114
|
onParentMessage(e) {
|
|
6101
|
-
var
|
|
6115
|
+
var s;
|
|
6102
6116
|
const t = e == null ? void 0 : e.data;
|
|
6103
6117
|
if (!(!t || typeof t != "object")) {
|
|
6104
6118
|
if (t.type === "UPDATE") {
|
|
@@ -6111,7 +6125,7 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6111
6125
|
this.transport && t.payload && this.transport.context(t.payload);
|
|
6112
6126
|
return;
|
|
6113
6127
|
}
|
|
6114
|
-
t.type === "INIT" && (this.parentOrigin = e.origin, this.parentToken = typeof t.token == "string" ? t.token : "", this.parentVariables = t.variables && typeof t.variables == "object" ? t.variables : t.context && typeof t.context == "object" ? t.context : null, this.parentAllowUnauthenticated = t.allowUnauthenticated === !0, this.parentInitReceived = !0, (
|
|
6128
|
+
t.type === "INIT" && (this.parentOrigin = e.origin, this.parentToken = typeof t.token == "string" ? t.token : "", this.parentVariables = t.variables && typeof t.variables == "object" ? t.variables : t.context && typeof t.context == "object" ? t.context : null, this.parentAllowUnauthenticated = t.allowUnauthenticated === !0, this.parentInitReceived = !0, (s = this.parentInitDeferred) != null && s._resolve && this.parentInitDeferred._resolve(), !this.isEmbedded && !this.isOpen && !this.parentAllowUnauthenticated && this.parentToken && this.hasValidSessionMarker() && this.boot().catch((r) => {
|
|
6115
6129
|
console.warn("[messenger] eager boot failed", r);
|
|
6116
6130
|
}));
|
|
6117
6131
|
}
|
|
@@ -6123,8 +6137,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6123
6137
|
if (typeof document > "u") return !1;
|
|
6124
6138
|
const t = (document.cookie || "").match(/(?:^|; )messenger_session_marker=([^;]+)/);
|
|
6125
6139
|
if (!t) return !1;
|
|
6126
|
-
const
|
|
6127
|
-
return Number.isFinite(
|
|
6140
|
+
const s = parseInt(t[1], 10);
|
|
6141
|
+
return Number.isFinite(s) ? s > Date.now() : !1;
|
|
6128
6142
|
},
|
|
6129
6143
|
async boot() {
|
|
6130
6144
|
if (!this.canBoot) {
|
|
@@ -6146,8 +6160,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6146
6160
|
variables: e && typeof e == "object" ? e : void 0
|
|
6147
6161
|
}), e && typeof e == "object") {
|
|
6148
6162
|
const t = {};
|
|
6149
|
-
for (const [
|
|
6150
|
-
|
|
6163
|
+
for (const [s, r] of Object.entries(e))
|
|
6164
|
+
s !== "customer" && r && typeof r == "object" && !Array.isArray(r) && (t[s] = r);
|
|
6151
6165
|
Object.keys(t).length > 0 && this.transport.context(t);
|
|
6152
6166
|
}
|
|
6153
6167
|
this.setupLiveReveal();
|
|
@@ -6172,13 +6186,13 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6172
6186
|
);
|
|
6173
6187
|
return;
|
|
6174
6188
|
}
|
|
6175
|
-
this.floatRO = new ResizeObserver((
|
|
6176
|
-
const r =
|
|
6189
|
+
this.floatRO = new ResizeObserver((s) => {
|
|
6190
|
+
const r = s[0];
|
|
6177
6191
|
if (!r) return;
|
|
6178
6192
|
const a = Math.ceil(r.contentRect.height + 8);
|
|
6179
6193
|
a !== this.floatHeight && (this.floatHeight = a, this.$nextTick(() => {
|
|
6180
|
-
var
|
|
6181
|
-
(i = (
|
|
6194
|
+
var n, i;
|
|
6195
|
+
(i = (n = this.$refs.messageList) == null ? void 0 : n.scrollToBottom) == null || i.call(n);
|
|
6182
6196
|
}));
|
|
6183
6197
|
}), this.floatRO.observe(t);
|
|
6184
6198
|
}
|
|
@@ -6221,8 +6235,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6221
6235
|
},
|
|
6222
6236
|
"*"
|
|
6223
6237
|
);
|
|
6224
|
-
} catch (
|
|
6225
|
-
console.warn("[ww-messenger] notifyParentResize failed",
|
|
6238
|
+
} catch (s) {
|
|
6239
|
+
console.warn("[ww-messenger] notifyParentResize failed", s);
|
|
6226
6240
|
}
|
|
6227
6241
|
},
|
|
6228
6242
|
// Mesure la taille rendue du wm-launcherWrap (launcher + peeks éventuels)
|
|
@@ -6232,37 +6246,37 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6232
6246
|
this.launcherHovered = e, this.sendCurrentLauncherSize();
|
|
6233
6247
|
},
|
|
6234
6248
|
sendCurrentLauncherSize() {
|
|
6235
|
-
var w, T, E, A, q, M,
|
|
6249
|
+
var w, T, E, A, q, M, N;
|
|
6236
6250
|
if (this.isOpen) return;
|
|
6237
6251
|
const e = (T = (w = this.$el) == null ? void 0 : w.querySelector) == null ? void 0 : T.call(w, ".wm-launcherWrap");
|
|
6238
6252
|
if (!e) return;
|
|
6239
6253
|
const t = e.getBoundingClientRect();
|
|
6240
6254
|
if (!t.width || !t.height) return;
|
|
6241
|
-
const
|
|
6255
|
+
const s = (((E = this.launcherPeeks) == null ? void 0 : E.length) ?? 0) > 0, r = 16, a = Math.ceil(t.width), n = Math.ceil(t.height), i = (q = (A = this.$el) == null ? void 0 : A.querySelector) == null ? void 0 : q.call(A, ".wm-launcher"), l = (N = (M = this.$el) == null ? void 0 : M.querySelectorAll) == null ? void 0 : N.call(M, ".wm-peek"), _ = l && l.length ? l[l.length - 1] : null;
|
|
6242
6256
|
let k = null;
|
|
6243
6257
|
if (_) {
|
|
6244
|
-
const
|
|
6258
|
+
const U = _.getBoundingClientRect();
|
|
6245
6259
|
k = {
|
|
6246
|
-
width: Math.ceil(
|
|
6247
|
-
height: Math.ceil(
|
|
6248
|
-
rightOffset: Math.max(0, Math.ceil(t.right -
|
|
6249
|
-
bottomOffset: Math.max(0, Math.ceil(t.bottom -
|
|
6260
|
+
width: Math.ceil(U.width),
|
|
6261
|
+
height: Math.ceil(U.height),
|
|
6262
|
+
rightOffset: Math.max(0, Math.ceil(t.right - U.right)),
|
|
6263
|
+
bottomOffset: Math.max(0, Math.ceil(t.bottom - U.bottom))
|
|
6250
6264
|
};
|
|
6251
6265
|
}
|
|
6252
6266
|
this.notifyParentResize("closed", {
|
|
6253
6267
|
width: a + r,
|
|
6254
|
-
height:
|
|
6268
|
+
height: n + r,
|
|
6255
6269
|
launcherWidth: (i == null ? void 0 : i.offsetWidth) || null,
|
|
6256
6270
|
launcherHeight: (i == null ? void 0 : i.offsetHeight) || null,
|
|
6257
6271
|
launcherHovered: this.launcherHovered,
|
|
6258
6272
|
peek: k,
|
|
6259
|
-
peekHovered: this.launcherHovered &&
|
|
6273
|
+
peekHovered: this.launcherHovered && s
|
|
6260
6274
|
});
|
|
6261
6275
|
},
|
|
6262
6276
|
observeLauncherSize() {
|
|
6263
|
-
var
|
|
6277
|
+
var s, r;
|
|
6264
6278
|
if (typeof ResizeObserver > "u") return;
|
|
6265
|
-
const e = (r = (
|
|
6279
|
+
const e = (r = (s = this.$el) == null ? void 0 : s.querySelector) == null ? void 0 : r.call(s, ".wm-launcherWrap");
|
|
6266
6280
|
if (!e) return;
|
|
6267
6281
|
this._launcherRo && this._launcherRo.disconnect();
|
|
6268
6282
|
const t = new ResizeObserver(() => {
|
|
@@ -6273,14 +6287,14 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6273
6287
|
// Opening straight from a notification card: land on that card's
|
|
6274
6288
|
// thread rather than whatever was last active.
|
|
6275
6289
|
async openFromPeek(e) {
|
|
6276
|
-
var
|
|
6277
|
-
const t = e || ((
|
|
6290
|
+
var s, r;
|
|
6291
|
+
const t = e || ((s = this.latestUnreads[0]) == null ? void 0 : s.convId);
|
|
6278
6292
|
t && t !== ((r = this.currentConv) == null ? void 0 : r.id) && (this.draftConv = null, this.activeConvId = t, this.showOnboarding = !1, this.showHistory = !1, this.backToHistory = !1), await this.open();
|
|
6279
6293
|
},
|
|
6280
6294
|
// Stamp the dismissed batch ts for a single conv so its card
|
|
6281
6295
|
// disappears from the stack until a fresher message arrives.
|
|
6282
6296
|
dismissPeek(e) {
|
|
6283
|
-
const t = this.latestUnreads.find((
|
|
6297
|
+
const t = this.latestUnreads.find((s) => s.convId === e);
|
|
6284
6298
|
t && (this.dismissedPeeks = { ...this.dismissedPeeks, [e]: t.ts });
|
|
6285
6299
|
},
|
|
6286
6300
|
// Enter "draft" mode : the composer is rendered immediately but no
|
|
@@ -6306,10 +6320,10 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6306
6320
|
if (this.busy) return null;
|
|
6307
6321
|
this.busy = !0;
|
|
6308
6322
|
try {
|
|
6309
|
-
const t = await this.store.createConversation({}),
|
|
6310
|
-
return
|
|
6323
|
+
const t = await this.store.createConversation({}), s = this.welcomeRevealedAt.__draft__;
|
|
6324
|
+
return s !== void 0 && (this.welcomeRevealedAt = {
|
|
6311
6325
|
...this.welcomeRevealedAt,
|
|
6312
|
-
[t.id]:
|
|
6326
|
+
[t.id]: s > 0 ? s : Date.now()
|
|
6313
6327
|
}), this.draftConv = null, this.activeConvId = t.id, await this.store.openConversation(t.id), this.markConvRead(t), t;
|
|
6314
6328
|
} catch (t) {
|
|
6315
6329
|
return console.error("[ww-messenger] create conv failed", t), this.bootError = (t == null ? void 0 : t.message) || String(t), null;
|
|
@@ -6363,8 +6377,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6363
6377
|
if (!e) return;
|
|
6364
6378
|
const t = this.widgetWelcomeMessage;
|
|
6365
6379
|
if (!t || typeof t != "string" || !t.trim() || this.welcomeRevealedAt[e] !== void 0) return;
|
|
6366
|
-
const
|
|
6367
|
-
if (!((
|
|
6380
|
+
const s = this.currentConv;
|
|
6381
|
+
if (!((s == null ? void 0 : s._draft) || !(s != null && s.last_message_id))) {
|
|
6368
6382
|
this.welcomeRevealedAt = {
|
|
6369
6383
|
...this.welcomeRevealedAt,
|
|
6370
6384
|
[e]: Date.now()
|
|
@@ -6375,9 +6389,9 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6375
6389
|
...this.welcomeRevealedAt,
|
|
6376
6390
|
[e]: 0
|
|
6377
6391
|
};
|
|
6378
|
-
const a = this.revealPacing,
|
|
6392
|
+
const a = this.revealPacing, n = t.trim().length, i = Math.min(
|
|
6379
6393
|
a.maxTypingMs,
|
|
6380
|
-
Math.max(a.minTypingMs,
|
|
6394
|
+
Math.max(a.minTypingMs, n * a.msPerChar)
|
|
6381
6395
|
), l = a.firstRevealDelayMs + i, _ = setTimeout(() => {
|
|
6382
6396
|
this.welcomeRevealedAt = {
|
|
6383
6397
|
...this.welcomeRevealedAt,
|
|
@@ -6418,11 +6432,11 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6418
6432
|
} catch (r) {
|
|
6419
6433
|
console.error("[ww-messenger] open conv failed", r);
|
|
6420
6434
|
}
|
|
6421
|
-
const
|
|
6422
|
-
|
|
6435
|
+
const s = this.allConversations.find((r) => r.id === e.id);
|
|
6436
|
+
s && this.markConvRead(s);
|
|
6423
6437
|
},
|
|
6424
6438
|
async onMoreAction(e) {
|
|
6425
|
-
var t,
|
|
6439
|
+
var t, s;
|
|
6426
6440
|
switch (this.moreOpen = !1, e) {
|
|
6427
6441
|
case "rename":
|
|
6428
6442
|
this.openRenameDialog();
|
|
@@ -6430,7 +6444,7 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6430
6444
|
case "export":
|
|
6431
6445
|
vt(
|
|
6432
6446
|
this.currentConv,
|
|
6433
|
-
this.currentConv ? (
|
|
6447
|
+
this.currentConv ? (s = (t = this.s) == null ? void 0 : t.messagesByConv) == null ? void 0 : s[this.currentConv.id] : [],
|
|
6434
6448
|
this.translator,
|
|
6435
6449
|
this.locale
|
|
6436
6450
|
);
|
|
@@ -6458,10 +6472,10 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6458
6472
|
async onRenameSubmit(e) {
|
|
6459
6473
|
const t = this.currentConv;
|
|
6460
6474
|
if (this.renameDialogOpen = !1, !t || t._draft || !this.store) return;
|
|
6461
|
-
const
|
|
6462
|
-
if (!(!
|
|
6475
|
+
const s = (e || "").trim();
|
|
6476
|
+
if (!(!s || s === t.name))
|
|
6463
6477
|
try {
|
|
6464
|
-
await this.store.patchConversation(t.id, { name:
|
|
6478
|
+
await this.store.patchConversation(t.id, { name: s });
|
|
6465
6479
|
} catch (r) {
|
|
6466
6480
|
console.error("[ww-messenger] rename failed", r);
|
|
6467
6481
|
}
|
|
@@ -6471,13 +6485,13 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6471
6485
|
let t = this.currentConv;
|
|
6472
6486
|
if (!t && (this.startConv(), t = this.currentConv, !t) || t._draft && (t = await this.ensureRealConv(), !t))
|
|
6473
6487
|
return;
|
|
6474
|
-
const
|
|
6488
|
+
const s = t.id, r = this.pendingAttachments.slice();
|
|
6475
6489
|
this.pendingAttachments = [], this.unreadAnchorId = null, this.unreadBoundaryTs = "";
|
|
6476
|
-
const a = r.map((
|
|
6477
|
-
const { previewUrl: i, ...l } =
|
|
6490
|
+
const a = r.map((n) => {
|
|
6491
|
+
const { previewUrl: i, ...l } = n;
|
|
6478
6492
|
return l;
|
|
6479
6493
|
});
|
|
6480
|
-
await this.store.send(
|
|
6494
|
+
await this.store.send(s, e, {
|
|
6481
6495
|
attachments: a.length ? a : void 0
|
|
6482
6496
|
});
|
|
6483
6497
|
},
|
|
@@ -6497,10 +6511,10 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6497
6511
|
async onFormSubmit({ values: e }) {
|
|
6498
6512
|
const t = this.pendingForm;
|
|
6499
6513
|
if (!(t != null && t.form)) return;
|
|
6500
|
-
const
|
|
6501
|
-
if (!
|
|
6514
|
+
const s = ht(t.form, e, this.translator);
|
|
6515
|
+
if (!s) return;
|
|
6502
6516
|
let r = this.currentConv;
|
|
6503
|
-
r && (r._draft && (r = await this.ensureRealConv(), !r) || await this.store.send(r.id,
|
|
6517
|
+
r && (r._draft && (r = await this.ensureRealConv(), !r) || await this.store.send(r.id, s, {
|
|
6504
6518
|
metadata: {
|
|
6505
6519
|
artifact: mt(
|
|
6506
6520
|
t.form,
|
|
@@ -6525,14 +6539,14 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6525
6539
|
this.pendingAttachments.splice(e, 1);
|
|
6526
6540
|
},
|
|
6527
6541
|
async onAttach(e) {
|
|
6528
|
-
var t,
|
|
6542
|
+
var t, s;
|
|
6529
6543
|
if (!(!e || !this.transport))
|
|
6530
6544
|
try {
|
|
6531
6545
|
const r = await this.transport.uploadAttachment(e), a = (r == null ? void 0 : r.type) === "image" || (e.type || "").toLowerCase().startsWith("image/") || ((r == null ? void 0 : r.mime_type) || "").toLowerCase().startsWith("image/");
|
|
6532
|
-
let
|
|
6546
|
+
let n = null;
|
|
6533
6547
|
if (a)
|
|
6534
6548
|
try {
|
|
6535
|
-
|
|
6549
|
+
n = await ((s = (t = this.store) == null ? void 0 : t.signAttachment) == null ? void 0 : s.call(t, r.path)) || null;
|
|
6536
6550
|
} catch {
|
|
6537
6551
|
}
|
|
6538
6552
|
this.pendingAttachments.push({
|
|
@@ -6541,7 +6555,7 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6541
6555
|
name: e.name || this.t("attachment.fileFallbackName"),
|
|
6542
6556
|
mime_type: e.type,
|
|
6543
6557
|
size_bytes: e.size,
|
|
6544
|
-
previewUrl:
|
|
6558
|
+
previewUrl: n
|
|
6545
6559
|
});
|
|
6546
6560
|
} catch (r) {
|
|
6547
6561
|
console.error("[ww-messenger] attachment upload failed", r);
|
|
@@ -6566,8 +6580,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6566
6580
|
if (t === "new" || t === "new-conversation")
|
|
6567
6581
|
return this.isOpen || await this.open(), this.startConv(), !0;
|
|
6568
6582
|
if (t.startsWith("conversation/")) {
|
|
6569
|
-
const
|
|
6570
|
-
return
|
|
6583
|
+
const s = t.slice(13);
|
|
6584
|
+
return s && await this.openFromPeek(s), !0;
|
|
6571
6585
|
}
|
|
6572
6586
|
return console.warn("[messenger] unknown internal url", e), !0;
|
|
6573
6587
|
},
|
|
@@ -6599,8 +6613,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6599
6613
|
rating: e,
|
|
6600
6614
|
comment: t
|
|
6601
6615
|
}), this.feedbackDone = !0;
|
|
6602
|
-
} catch (
|
|
6603
|
-
console.error("[ww-messenger] feedback failed",
|
|
6616
|
+
} catch (s) {
|
|
6617
|
+
console.error("[ww-messenger] feedback failed", s);
|
|
6604
6618
|
} finally {
|
|
6605
6619
|
this.feedbackBusy = !1;
|
|
6606
6620
|
}
|
|
@@ -6634,39 +6648,39 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6634
6648
|
key: 0,
|
|
6635
6649
|
class: "wm-attached__fileSize"
|
|
6636
6650
|
}, _o = ["aria-label", "onClick"];
|
|
6637
|
-
function go(e, t,
|
|
6638
|
-
const i = B("Launcher"), l = B("Header"), _ = B("History"), k = B("Onboarding"), w = B("MessageList"), T = B("ApprovalCard"), E = B("FormCard"), A = B("Feedback"), q = B("SuggestionChips"), M = B("Composer"),
|
|
6651
|
+
function go(e, t, s, r, a, n) {
|
|
6652
|
+
const i = B("Launcher"), l = B("Header"), _ = B("History"), k = B("Onboarding"), w = B("MessageList"), T = B("ApprovalCard"), E = B("FormCard"), A = B("Feedback"), q = B("SuggestionChips"), M = B("Composer"), N = B("MoreMenu"), U = B("RenameDialog");
|
|
6639
6653
|
return c(), d("div", {
|
|
6640
|
-
class: R(["wm-root", `wm-root--${
|
|
6641
|
-
style: z(
|
|
6654
|
+
class: R(["wm-root", `wm-root--${s.displayMode}`]),
|
|
6655
|
+
style: z(n.rootStyle)
|
|
6642
6656
|
}, [
|
|
6643
|
-
!a.isOpen && !
|
|
6657
|
+
!a.isOpen && !n.isEmbedded ? (c(), D(i, {
|
|
6644
6658
|
key: 0,
|
|
6645
|
-
"unread-count":
|
|
6646
|
-
peeks:
|
|
6647
|
-
onOpen:
|
|
6648
|
-
onDismiss:
|
|
6649
|
-
onHover:
|
|
6659
|
+
"unread-count": n.unreadCount,
|
|
6660
|
+
peeks: n.launcherPeeks,
|
|
6661
|
+
onOpen: n.openFromPeek,
|
|
6662
|
+
onDismiss: n.dismissPeek,
|
|
6663
|
+
onHover: n.onLauncherHover
|
|
6650
6664
|
}, null, 8, ["unread-count", "peeks", "onOpen", "onDismiss", "onHover"])) : b("", !0),
|
|
6651
|
-
a.isOpen ||
|
|
6665
|
+
a.isOpen || n.isEmbedded ? (c(), d("section", {
|
|
6652
6666
|
key: 1,
|
|
6653
6667
|
class: R([
|
|
6654
6668
|
"wm-panel",
|
|
6655
|
-
`wm-panel--${
|
|
6656
|
-
{ "wm-panel--welcome":
|
|
6669
|
+
`wm-panel--${s.displayMode}`,
|
|
6670
|
+
{ "wm-panel--welcome": n.ready && !n.error && !n.currentConv }
|
|
6657
6671
|
]),
|
|
6658
6672
|
style: z(a.floatHeight ? { "--wm-float-h": a.floatHeight + "px" } : null),
|
|
6659
6673
|
role: "dialog",
|
|
6660
6674
|
"aria-label": "Messenger",
|
|
6661
|
-
onClick: t[6] || (t[6] = (...L) =>
|
|
6675
|
+
onClick: t[6] || (t[6] = (...L) => n.onPanelClick && n.onPanelClick(...L))
|
|
6662
6676
|
}, [
|
|
6663
|
-
!
|
|
6664
|
-
|
|
6677
|
+
!n.ready && !n.error ? (c(), d("div", Qa, [
|
|
6678
|
+
n.isEmbedded ? b("", !0) : (c(), d("button", {
|
|
6665
6679
|
key: 0,
|
|
6666
6680
|
type: "button",
|
|
6667
6681
|
class: "wm-loading__close",
|
|
6668
|
-
"aria-label":
|
|
6669
|
-
onClick: t[0] || (t[0] = (...L) =>
|
|
6682
|
+
"aria-label": n.t("loading.minimize"),
|
|
6683
|
+
onClick: t[0] || (t[0] = (...L) => n.close && n.close(...L))
|
|
6670
6684
|
}, [...t[7] || (t[7] = [
|
|
6671
6685
|
o("svg", {
|
|
6672
6686
|
width: "13",
|
|
@@ -6688,20 +6702,20 @@ function go(e, t, n, r, a, s) {
|
|
|
6688
6702
|
}, null, -1))
|
|
6689
6703
|
])) : (c(), d(I, { key: 1 }, [
|
|
6690
6704
|
$(l, {
|
|
6691
|
-
title:
|
|
6692
|
-
"team-members":
|
|
6693
|
-
"response-label":
|
|
6694
|
-
"show-identity": !!
|
|
6695
|
-
"show-back":
|
|
6696
|
-
"show-close": !
|
|
6705
|
+
title: n.headerTitle,
|
|
6706
|
+
"team-members": n.teamMembers,
|
|
6707
|
+
"response-label": n.responseLabel,
|
|
6708
|
+
"show-identity": !!n.currentConv,
|
|
6709
|
+
"show-back": n.canBack,
|
|
6710
|
+
"show-close": !n.isEmbedded,
|
|
6697
6711
|
"more-active": a.moreOpen,
|
|
6698
|
-
"agent-name":
|
|
6699
|
-
"agent-avatar-url":
|
|
6700
|
-
onBack:
|
|
6701
|
-
onMore:
|
|
6702
|
-
onClose:
|
|
6712
|
+
"agent-name": n.agentName,
|
|
6713
|
+
"agent-avatar-url": n.agentAvatarUrl,
|
|
6714
|
+
onBack: n.goHome,
|
|
6715
|
+
onMore: n.toggleMore,
|
|
6716
|
+
onClose: n.close
|
|
6703
6717
|
}, null, 8, ["title", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "agent-name", "agent-avatar-url", "onBack", "onMore", "onClose"]),
|
|
6704
|
-
|
|
6718
|
+
n.error ? (c(), d("div", eo, [
|
|
6705
6719
|
o("div", to, [
|
|
6706
6720
|
t[9] || (t[9] = o("div", { class: "wm-state__errIcon" }, [
|
|
6707
6721
|
o("svg", {
|
|
@@ -6719,63 +6733,63 @@ function go(e, t, n, r, a, s) {
|
|
|
6719
6733
|
])
|
|
6720
6734
|
], -1)),
|
|
6721
6735
|
o("div", null, [
|
|
6722
|
-
o("div", no, v(
|
|
6723
|
-
o("div", so, v(
|
|
6736
|
+
o("div", no, v(n.t("error.connectionFailed")), 1),
|
|
6737
|
+
o("div", so, v(n.error), 1)
|
|
6724
6738
|
])
|
|
6725
6739
|
])
|
|
6726
|
-
])) : !
|
|
6740
|
+
])) : !n.currentConv && a.showHistory ? (c(), D(_, {
|
|
6727
6741
|
key: 1,
|
|
6728
|
-
threads:
|
|
6729
|
-
onResume:
|
|
6730
|
-
}, null, 8, ["threads", "onResume"])) :
|
|
6742
|
+
threads: n.openThreads,
|
|
6743
|
+
onResume: n.onDrawerPick
|
|
6744
|
+
}, null, 8, ["threads", "onResume"])) : n.currentConv ? (c(), d(I, { key: 3 }, [
|
|
6731
6745
|
$(w, {
|
|
6732
6746
|
ref: "messageList",
|
|
6733
|
-
messages:
|
|
6734
|
-
"streaming-active":
|
|
6735
|
-
"date-label":
|
|
6736
|
-
"conversation-id":
|
|
6737
|
-
"loading-more":
|
|
6738
|
-
"has-more":
|
|
6747
|
+
messages: n.displayedMessages,
|
|
6748
|
+
"streaming-active": n.streamingActive,
|
|
6749
|
+
"date-label": n.dateLabel,
|
|
6750
|
+
"conversation-id": n.currentConv ? n.currentConv.id : null,
|
|
6751
|
+
"loading-more": n.paginationState.loading,
|
|
6752
|
+
"has-more": n.paginationState.hasMore,
|
|
6739
6753
|
"unread-anchor-id": e.unreadAnchorId,
|
|
6740
6754
|
"unread-boundary-ts": e.unreadBoundaryTs,
|
|
6741
|
-
"ai-agent-name":
|
|
6742
|
-
"ai-agent-avatar-url":
|
|
6743
|
-
onLoadMore:
|
|
6755
|
+
"ai-agent-name": n.agentName,
|
|
6756
|
+
"ai-agent-avatar-url": n.agentAvatarUrl,
|
|
6757
|
+
onLoadMore: n.onLoadMore
|
|
6744
6758
|
}, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "unread-anchor-id", "unread-boundary-ts", "ai-agent-name", "ai-agent-avatar-url", "onLoadMore"]),
|
|
6745
6759
|
o("div", ro, [
|
|
6746
|
-
|
|
6747
|
-
|
|
6760
|
+
n.floatVisible ? (c(), d("div", io, [
|
|
6761
|
+
n.approvalReady ? (c(), D(T, {
|
|
6748
6762
|
key: 0,
|
|
6749
|
-
action:
|
|
6750
|
-
detail:
|
|
6751
|
-
callbacks:
|
|
6752
|
-
"agent-name":
|
|
6753
|
-
"agent-avatar-url":
|
|
6754
|
-
onCallback:
|
|
6755
|
-
}, null, 8, ["action", "detail", "callbacks", "agent-name", "agent-avatar-url", "onCallback"])) :
|
|
6756
|
-
key:
|
|
6757
|
-
form:
|
|
6758
|
-
"agent-name":
|
|
6759
|
-
"agent-avatar-url":
|
|
6760
|
-
onSubmit:
|
|
6761
|
-
}, null, 8, ["form", "agent-name", "agent-avatar-url", "onSubmit"])) :
|
|
6763
|
+
action: n.approvalTitle,
|
|
6764
|
+
detail: n.approvalDetail,
|
|
6765
|
+
callbacks: n.pendingApproval.callbacks,
|
|
6766
|
+
"agent-name": n.agentName,
|
|
6767
|
+
"agent-avatar-url": n.agentAvatarUrl,
|
|
6768
|
+
onCallback: n.onApprovalCallback
|
|
6769
|
+
}, null, 8, ["action", "detail", "callbacks", "agent-name", "agent-avatar-url", "onCallback"])) : n.pendingForm ? (c(), D(E, {
|
|
6770
|
+
key: n.pendingForm.message && n.pendingForm.message.id,
|
|
6771
|
+
form: n.pendingForm.form,
|
|
6772
|
+
"agent-name": n.agentName,
|
|
6773
|
+
"agent-avatar-url": n.agentAvatarUrl,
|
|
6774
|
+
onSubmit: n.onFormSubmit
|
|
6775
|
+
}, null, 8, ["form", "agent-name", "agent-avatar-url", "onSubmit"])) : n.showFeedback ? (c(), D(A, {
|
|
6762
6776
|
key: 2,
|
|
6763
6777
|
busy: a.feedbackBusy,
|
|
6764
6778
|
done: a.feedbackDone,
|
|
6765
|
-
onSubmit:
|
|
6766
|
-
}, null, 8, ["busy", "done", "onSubmit"])) : (c(),
|
|
6779
|
+
onSubmit: n.onFeedback
|
|
6780
|
+
}, null, 8, ["busy", "done", "onSubmit"])) : (c(), D(q, {
|
|
6767
6781
|
key: 3,
|
|
6768
|
-
items:
|
|
6769
|
-
onSelect:
|
|
6782
|
+
items: n.suggestions,
|
|
6783
|
+
onSelect: n.onSuggestion
|
|
6770
6784
|
}, null, 8, ["items", "onSelect"]))
|
|
6771
6785
|
], 512)) : b("", !0),
|
|
6772
|
-
|
|
6786
|
+
n.actionInFlight ? (c(), d("div", ao, [
|
|
6773
6787
|
t[10] || (t[10] = o("span", {
|
|
6774
6788
|
class: "wm-actionWait__spinner",
|
|
6775
6789
|
"aria-hidden": "true"
|
|
6776
6790
|
}, null, -1)),
|
|
6777
|
-
o("span", oo, v(
|
|
6778
|
-
name:
|
|
6791
|
+
o("span", oo, v(n.t("action.inProgress", {
|
|
6792
|
+
name: n.actionInFlightName
|
|
6779
6793
|
})), 1)
|
|
6780
6794
|
])) : b("", !0),
|
|
6781
6795
|
a.pendingAttachments.length ? (c(), d("div", lo, [
|
|
@@ -6807,7 +6821,7 @@ function go(e, t, n, r, a, s) {
|
|
|
6807
6821
|
], -1)),
|
|
6808
6822
|
o("span", ho, [
|
|
6809
6823
|
o("span", mo, v(L.name), 1),
|
|
6810
|
-
|
|
6824
|
+
n.formatAttachmentSize(L.size_bytes) ? (c(), d("span", fo, v(n.formatAttachmentSize(
|
|
6811
6825
|
L.size_bytes
|
|
6812
6826
|
)), 1)) : b("", !0)
|
|
6813
6827
|
])
|
|
@@ -6815,8 +6829,8 @@ function go(e, t, n, r, a, s) {
|
|
|
6815
6829
|
o("button", {
|
|
6816
6830
|
type: "button",
|
|
6817
6831
|
class: "wm-attached__remove",
|
|
6818
|
-
"aria-label":
|
|
6819
|
-
onClick: (Q) =>
|
|
6832
|
+
"aria-label": n.t("attachment.remove"),
|
|
6833
|
+
onClick: (Q) => n.removePendingAttachment(K)
|
|
6820
6834
|
}, [...t[12] || (t[12] = [
|
|
6821
6835
|
o("svg", {
|
|
6822
6836
|
width: "10",
|
|
@@ -6834,72 +6848,72 @@ function go(e, t, n, r, a, s) {
|
|
|
6834
6848
|
])], 8, _o)
|
|
6835
6849
|
]))), 128))
|
|
6836
6850
|
])) : b("", !0),
|
|
6837
|
-
|
|
6851
|
+
n.actionInFlight ? b("", !0) : (c(), D(M, {
|
|
6838
6852
|
key: 3,
|
|
6839
6853
|
ref: "composer",
|
|
6840
6854
|
modelValue: a.draft,
|
|
6841
6855
|
"onUpdate:modelValue": t[2] || (t[2] = (L) => a.draft = L),
|
|
6842
|
-
placeholder:
|
|
6843
|
-
disabled: !!
|
|
6844
|
-
"attach-label":
|
|
6845
|
-
"display-mode":
|
|
6846
|
-
onSend:
|
|
6847
|
-
onAttach:
|
|
6856
|
+
placeholder: n.composerPlaceholder,
|
|
6857
|
+
disabled: !!n.pendingApproval,
|
|
6858
|
+
"attach-label": n.t("composer.attachFile"),
|
|
6859
|
+
"display-mode": s.displayMode,
|
|
6860
|
+
onSend: n.onSend,
|
|
6861
|
+
onAttach: n.onAttach
|
|
6848
6862
|
}, null, 8, ["modelValue", "placeholder", "disabled", "attach-label", "display-mode", "onSend", "onAttach"]))
|
|
6849
6863
|
]),
|
|
6850
|
-
a.moreOpen ? (c(),
|
|
6864
|
+
a.moreOpen ? (c(), D(N, {
|
|
6851
6865
|
key: 0,
|
|
6852
|
-
"can-rename": !!
|
|
6853
|
-
"can-export": !!
|
|
6866
|
+
"can-rename": !!n.currentConv && !n.currentConv._draft,
|
|
6867
|
+
"can-export": !!n.currentConv && !n.currentConv._draft,
|
|
6854
6868
|
"sound-enabled": e.soundEnabled,
|
|
6855
|
-
"status-url":
|
|
6856
|
-
"help-url":
|
|
6869
|
+
"status-url": n.statusUrl,
|
|
6870
|
+
"help-url": n.helpUrl,
|
|
6857
6871
|
onClose: t[3] || (t[3] = (L) => a.moreOpen = !1),
|
|
6858
6872
|
onSoundToggle: e.onSoundToggle,
|
|
6859
|
-
onAction:
|
|
6873
|
+
onAction: n.onMoreAction
|
|
6860
6874
|
}, null, 8, ["can-rename", "can-export", "sound-enabled", "status-url", "help-url", "onSoundToggle", "onAction"])) : b("", !0),
|
|
6861
|
-
a.renameDialogOpen &&
|
|
6875
|
+
a.renameDialogOpen && n.currentConv && !n.currentConv._draft ? (c(), D(U, {
|
|
6862
6876
|
key: 1,
|
|
6863
|
-
"initial-value":
|
|
6864
|
-
title:
|
|
6877
|
+
"initial-value": n.currentConv.name || "",
|
|
6878
|
+
title: n.t("rename.dialogTitle"),
|
|
6865
6879
|
onClose: t[4] || (t[4] = (L) => a.renameDialogOpen = !1),
|
|
6866
|
-
onSubmit:
|
|
6880
|
+
onSubmit: n.onRenameSubmit
|
|
6867
6881
|
}, null, 8, ["initial-value", "title", "onSubmit"])) : b("", !0)
|
|
6868
|
-
], 64)) : (c(),
|
|
6882
|
+
], 64)) : (c(), D(k, {
|
|
6869
6883
|
key: 2,
|
|
6870
|
-
title:
|
|
6871
|
-
subtitle:
|
|
6872
|
-
"agent-name":
|
|
6873
|
-
"default-icon-url":
|
|
6874
|
-
"quick-links":
|
|
6875
|
-
"open-threads":
|
|
6884
|
+
title: n.widgetTitle,
|
|
6885
|
+
subtitle: n.widgetSubtitle,
|
|
6886
|
+
"agent-name": n.agentName,
|
|
6887
|
+
"default-icon-url": n.defaultIconUrl,
|
|
6888
|
+
"quick-links": n.quickLinks,
|
|
6889
|
+
"open-threads": n.openThreads,
|
|
6876
6890
|
busy: a.busy,
|
|
6877
|
-
onStart:
|
|
6878
|
-
onSelect:
|
|
6879
|
-
onResume:
|
|
6891
|
+
onStart: n.startConv,
|
|
6892
|
+
onSelect: n.onQuickLink,
|
|
6893
|
+
onResume: n.onDrawerPick,
|
|
6880
6894
|
onViewHistory: t[1] || (t[1] = (L) => a.showHistory = !0)
|
|
6881
6895
|
}, null, 8, ["title", "subtitle", "agent-name", "default-icon-url", "quick-links", "open-threads", "busy", "onStart", "onSelect", "onResume"])),
|
|
6882
|
-
a.moreOpen && !
|
|
6896
|
+
a.moreOpen && !n.currentConv ? (c(), D(N, {
|
|
6883
6897
|
key: 4,
|
|
6884
6898
|
"can-rename": !1,
|
|
6885
6899
|
"can-export": !1,
|
|
6886
6900
|
"sound-enabled": e.soundEnabled,
|
|
6887
|
-
"status-url":
|
|
6888
|
-
"help-url":
|
|
6901
|
+
"status-url": n.statusUrl,
|
|
6902
|
+
"help-url": n.helpUrl,
|
|
6889
6903
|
onClose: t[5] || (t[5] = (L) => a.moreOpen = !1),
|
|
6890
6904
|
onSoundToggle: e.onSoundToggle,
|
|
6891
|
-
onAction:
|
|
6905
|
+
onAction: n.onMoreAction
|
|
6892
6906
|
}, null, 8, ["sound-enabled", "status-url", "help-url", "onSoundToggle", "onAction"])) : b("", !0)
|
|
6893
6907
|
], 64))
|
|
6894
6908
|
], 6)) : b("", !0)
|
|
6895
6909
|
], 6);
|
|
6896
6910
|
}
|
|
6897
|
-
const yo = /* @__PURE__ */ P(Xa, [["render", go], ["__scopeId", "data-v-fa8045f9"]]), wo = "0.5.
|
|
6911
|
+
const yo = /* @__PURE__ */ P(Xa, [["render", go], ["__scopeId", "data-v-fa8045f9"]]), wo = "0.5.73";
|
|
6898
6912
|
export {
|
|
6899
6913
|
oe as AIAvatar,
|
|
6900
6914
|
be as AVATAR_COLORS,
|
|
6901
6915
|
As as ActionResult,
|
|
6902
|
-
|
|
6916
|
+
Ni as ApprovalCard,
|
|
6903
6917
|
Es as ArtifactFormResponse,
|
|
6904
6918
|
Ks as ArtifactInfoCard,
|
|
6905
6919
|
ur as ArtifactRenderer,
|
|
@@ -6917,7 +6931,7 @@ export {
|
|
|
6917
6931
|
Oe as MEDIA_RECORDER_SUPPORTED,
|
|
6918
6932
|
ri as MessageList,
|
|
6919
6933
|
yo as Messenger,
|
|
6920
|
-
|
|
6934
|
+
Ua as MoreMenu,
|
|
6921
6935
|
Jn as Onboarding,
|
|
6922
6936
|
pe as SCREEN_CAPTURE_SUPPORTED,
|
|
6923
6937
|
ut as SUPPORTED_LANGUAGES,
|