@_solaris/messenger-widget 0.5.73 → 0.5.74
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 +5 -5
- package/dist/messenger.cjs +8 -8
- package/dist/messenger.js +512 -503
- package/dist/snippet.js +1 -1
- package/dist/types/mixins/revealPacing.d.ts +1 -1
- 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 Ne, 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",
|
|
@@ -38,7 +38,7 @@ function Ze(e) {
|
|
|
38
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
|
-
function
|
|
41
|
+
function i(u, g) {
|
|
42
42
|
const p = t.listeners.get(u);
|
|
43
43
|
p && p.forEach((S) => {
|
|
44
44
|
try {
|
|
@@ -49,7 +49,7 @@ function Ze(e) {
|
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
function a(u) {
|
|
52
|
-
t.connection !== u && (t.connection = u,
|
|
52
|
+
t.connection !== u && (t.connection = u, i("connection", u));
|
|
53
53
|
}
|
|
54
54
|
function n() {
|
|
55
55
|
return {
|
|
@@ -64,7 +64,7 @@ function Ze(e) {
|
|
|
64
64
|
...t.origin ? { "X-Parent-Origin": t.origin } : {}
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
-
async function
|
|
67
|
+
async function r(u, g, p) {
|
|
68
68
|
const S = await fetch(`${t.baseUrl}${we}${g}`, {
|
|
69
69
|
method: u,
|
|
70
70
|
credentials: "include",
|
|
@@ -132,7 +132,7 @@ function Ze(e) {
|
|
|
132
132
|
}
|
|
133
133
|
return V.json();
|
|
134
134
|
}),
|
|
135
|
-
|
|
135
|
+
r("GET", "/customers/me")
|
|
136
136
|
]), x = { config: S, customer: (O == null ? void 0 : O.customer) ?? null };
|
|
137
137
|
return t.lastBootstrap = x, await k(), typeof document < "u" && (t.visibilityHandler = m, document.addEventListener(
|
|
138
138
|
"visibilitychange",
|
|
@@ -151,45 +151,45 @@ function Ze(e) {
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
async function w() {
|
|
154
|
-
const u = await
|
|
154
|
+
const u = await r("GET", "/customers/me");
|
|
155
155
|
return (u == null ? void 0 : u.customer) ?? null;
|
|
156
156
|
}
|
|
157
157
|
async function T(u) {
|
|
158
|
-
const g = await
|
|
158
|
+
const g = await r("PATCH", "/customers/me", u);
|
|
159
159
|
return (g == null ? void 0 : g.customer) ?? null;
|
|
160
160
|
}
|
|
161
161
|
async function E() {
|
|
162
|
-
const u = await
|
|
162
|
+
const u = await r("GET", "/conversations");
|
|
163
163
|
return (u == null ? void 0 : u.conversations) ?? [];
|
|
164
164
|
}
|
|
165
165
|
async function A(u = {}) {
|
|
166
|
-
return (await
|
|
166
|
+
return (await r("POST", "/conversations", u)).conversation;
|
|
167
167
|
}
|
|
168
168
|
async function q(u) {
|
|
169
|
-
return (await
|
|
169
|
+
return (await r(
|
|
170
170
|
"GET",
|
|
171
171
|
`/conversations/${encodeURIComponent(u)}`
|
|
172
172
|
)).conversation;
|
|
173
173
|
}
|
|
174
174
|
async function M(u, g) {
|
|
175
|
-
return (await
|
|
175
|
+
return (await r(
|
|
176
176
|
"PATCH",
|
|
177
177
|
`/conversations/${encodeURIComponent(u)}`,
|
|
178
178
|
g
|
|
179
179
|
)).conversation;
|
|
180
180
|
}
|
|
181
|
-
async function
|
|
182
|
-
return
|
|
181
|
+
async function U(u, g) {
|
|
182
|
+
return r(
|
|
183
183
|
"PATCH",
|
|
184
184
|
`/conversations/${encodeURIComponent(u)}/read`,
|
|
185
185
|
{ message_id: g }
|
|
186
186
|
);
|
|
187
187
|
}
|
|
188
|
-
async function
|
|
188
|
+
async function N(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()}` : "";
|
|
192
|
-
return
|
|
192
|
+
return r(
|
|
193
193
|
"GET",
|
|
194
194
|
`/conversations/${encodeURIComponent(u)}/messages${S}`
|
|
195
195
|
);
|
|
@@ -203,21 +203,21 @@ function Ze(e) {
|
|
|
203
203
|
author: { id: t.userId, type: "user" },
|
|
204
204
|
created_at: g.created_at || (/* @__PURE__ */ new Date()).toISOString()
|
|
205
205
|
};
|
|
206
|
-
return Array.isArray(g.attachments) && g.attachments.length && (p.payload = { type: "content", attachments: g.attachments }), g.metadata && typeof g.metadata == "object" && (p.metadata = g.metadata), t.currentContext && Object.keys(t.currentContext).length > 0 && (p.context = t.currentContext),
|
|
206
|
+
return Array.isArray(g.attachments) && g.attachments.length && (p.payload = { type: "content", attachments: g.attachments }), g.metadata && typeof g.metadata == "object" && (p.metadata = g.metadata), t.currentContext && Object.keys(t.currentContext).length > 0 && (p.context = t.currentContext), r(
|
|
207
207
|
"POST",
|
|
208
208
|
`/conversations/${encodeURIComponent(u)}/messages`,
|
|
209
209
|
p
|
|
210
210
|
);
|
|
211
211
|
}
|
|
212
212
|
async function K(u, g, p) {
|
|
213
|
-
return ae(),
|
|
213
|
+
return ae(), r(
|
|
214
214
|
"POST",
|
|
215
215
|
`/messages/${encodeURIComponent(u)}/callbacks/${encodeURIComponent(g)}`,
|
|
216
216
|
p ? { inputs: p } : {}
|
|
217
217
|
);
|
|
218
218
|
}
|
|
219
219
|
async function Q(u) {
|
|
220
|
-
const g = u.name || "attachment", p = u.type || "application/octet-stream", S = u.size || 0, O = await
|
|
220
|
+
const g = u.name || "attachment", p = u.type || "application/octet-stream", S = u.size || 0, O = await r("POST", "/attachments", {
|
|
221
221
|
mime_type: p,
|
|
222
222
|
size_bytes: S,
|
|
223
223
|
name: g
|
|
@@ -236,7 +236,7 @@ function Ze(e) {
|
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
238
|
async function se(u) {
|
|
239
|
-
return
|
|
239
|
+
return r(
|
|
240
240
|
"GET",
|
|
241
241
|
`/attachments/sign?path=${encodeURIComponent(u)}`
|
|
242
242
|
);
|
|
@@ -253,16 +253,16 @@ function Ze(e) {
|
|
|
253
253
|
u.addEventListener(g, (p) => ie(g, p.data));
|
|
254
254
|
u.addEventListener(
|
|
255
255
|
"error",
|
|
256
|
-
() =>
|
|
256
|
+
() => i("error", new Error("SSE error"))
|
|
257
257
|
), t.eventSource = u, a("open");
|
|
258
258
|
} catch (u) {
|
|
259
|
-
console.error("[transport] SSE open failed", u),
|
|
259
|
+
console.error("[transport] SSE open failed", u), i("error", u);
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
function ie(u, g) {
|
|
263
263
|
try {
|
|
264
264
|
const p = JSON.parse(g), S = p && typeof p == "object" && "data" in p ? p.data : p;
|
|
265
|
-
|
|
265
|
+
i(u, S);
|
|
266
266
|
} catch (p) {
|
|
267
267
|
console.error("[transport] bad SSE payload", u, p);
|
|
268
268
|
}
|
|
@@ -284,7 +284,7 @@ function Ze(e) {
|
|
|
284
284
|
const x = O == null ? void 0 : O.last_message_at;
|
|
285
285
|
return x && (!S || x > S) ? x : S;
|
|
286
286
|
}, null);
|
|
287
|
-
g && (!t.lastActivityAt || g > t.lastActivityAt) && (t.lastActivityAt = g,
|
|
287
|
+
g && (!t.lastActivityAt || g > t.lastActivityAt) && (t.lastActivityAt = g, i("activity", { conversations: u, latestAt: g }), ae());
|
|
288
288
|
} catch (u) {
|
|
289
289
|
console.error("[transport] poll failed", u);
|
|
290
290
|
}
|
|
@@ -315,7 +315,7 @@ function Ze(e) {
|
|
|
315
315
|
), t.visibilityHandler = null), t.started = !1;
|
|
316
316
|
}
|
|
317
317
|
async function y(u) {
|
|
318
|
-
return !u || typeof u != "object" ? null :
|
|
318
|
+
return !u || typeof u != "object" ? null : r("POST", "/update", u);
|
|
319
319
|
}
|
|
320
320
|
function C(u) {
|
|
321
321
|
if (!(!u || typeof u != "object"))
|
|
@@ -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: U,
|
|
345
|
+
listMessages: N,
|
|
346
346
|
postMessage: L,
|
|
347
347
|
postCallback: K,
|
|
348
348
|
uploadAttachment: Q,
|
|
@@ -443,7 +443,7 @@ function st(e) {
|
|
|
443
443
|
Array.isArray(h == null ? void 0 : h.conversations) && (t.conversations = h.conversations);
|
|
444
444
|
})
|
|
445
445
|
);
|
|
446
|
-
async function
|
|
446
|
+
async function i(h) {
|
|
447
447
|
try {
|
|
448
448
|
const m = new Promise(
|
|
449
449
|
(y, C) => setTimeout(
|
|
@@ -485,7 +485,7 @@ function st(e) {
|
|
|
485
485
|
}
|
|
486
486
|
return t.customer;
|
|
487
487
|
}
|
|
488
|
-
async function
|
|
488
|
+
async function r(h = {}) {
|
|
489
489
|
const m = await e.createConversation(h), f = t.conversations.findIndex((y) => y.id === m.id);
|
|
490
490
|
return f === -1 ? t.conversations = [m, ...t.conversations] : t.conversations[f] = m, m;
|
|
491
491
|
}
|
|
@@ -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 U = /* @__PURE__ */ new Map();
|
|
634
|
+
async function N(h) {
|
|
635
635
|
if (!h) return null;
|
|
636
|
-
const m =
|
|
636
|
+
const m = U.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 U.set(h, {
|
|
645
645
|
url: f.signed_url,
|
|
646
646
|
expires_at: f.expires_at
|
|
647
647
|
}), f.signed_url;
|
|
@@ -775,10 +775,10 @@ function st(e) {
|
|
|
775
775
|
}
|
|
776
776
|
return {
|
|
777
777
|
state: t,
|
|
778
|
-
start:
|
|
778
|
+
start: i,
|
|
779
779
|
destroy: a,
|
|
780
780
|
applyCustomer: n,
|
|
781
|
-
createConversation:
|
|
781
|
+
createConversation: r,
|
|
782
782
|
openConversation: _,
|
|
783
783
|
loadMore: k,
|
|
784
784
|
fetchSinceLast: E,
|
|
@@ -786,7 +786,7 @@ function st(e) {
|
|
|
786
786
|
markConversationRead: A,
|
|
787
787
|
send: q,
|
|
788
788
|
clickCallback: M,
|
|
789
|
-
signAttachment:
|
|
789
|
+
signAttachment: N,
|
|
790
790
|
submitFeedback: L,
|
|
791
791
|
getPendingApproval: K,
|
|
792
792
|
getActionInFlight: se,
|
|
@@ -1151,31 +1151,31 @@ function ne(e) {
|
|
|
1151
1151
|
return Le[xe(e)] || Le[ue];
|
|
1152
1152
|
}
|
|
1153
1153
|
function j(e) {
|
|
1154
|
-
const t = xe(e), s = ke[t] || ke[ue],
|
|
1155
|
-
return function(n,
|
|
1154
|
+
const t = xe(e), s = ke[t] || ke[ue], i = ke[ue];
|
|
1155
|
+
return function(n, r) {
|
|
1156
1156
|
let l = s[n];
|
|
1157
|
-
return l == null && (l =
|
|
1157
|
+
return l == null && (l = i[n]), l == null ? n : (r && (l = l.replace(
|
|
1158
1158
|
/\{(\w+)\}/g,
|
|
1159
|
-
(_, k) =>
|
|
1159
|
+
(_, k) => r[k] != null ? String(r[k]) : _
|
|
1160
1160
|
)), l);
|
|
1161
1161
|
};
|
|
1162
1162
|
}
|
|
1163
1163
|
function Ie(e, t) {
|
|
1164
1164
|
if (!Array.isArray(e == null ? void 0 : e.options)) return t;
|
|
1165
|
-
const s = e.options.find((
|
|
1165
|
+
const s = e.options.find((i) => (i == null ? void 0 : i.value) === t);
|
|
1166
1166
|
return (s == null ? void 0 : s.label) || t;
|
|
1167
1167
|
}
|
|
1168
1168
|
function He(e, t, s) {
|
|
1169
|
-
return Array.isArray(t) ? t.map((
|
|
1169
|
+
return Array.isArray(t) ? t.map((i) => Ie(e, String(i))).join(", ") : typeof t == "boolean" ? s(t ? "common.yes" : "common.no") : Ie(e, String(t));
|
|
1170
1170
|
}
|
|
1171
1171
|
function ht(e, t, s = j()) {
|
|
1172
1172
|
if (!e || !t) return "";
|
|
1173
|
-
const
|
|
1174
|
-
for (const n of
|
|
1173
|
+
const i = Array.isArray(e.fields) ? e.fields : [], a = [];
|
|
1174
|
+
for (const n of i) {
|
|
1175
1175
|
if (!(n != null && n.key) || !(n != null && n.label)) continue;
|
|
1176
|
-
const
|
|
1177
|
-
if (
|
|
1178
|
-
const l = He(n,
|
|
1176
|
+
const r = t[n.key];
|
|
1177
|
+
if (r == null || r === "") continue;
|
|
1178
|
+
const l = He(n, r, s);
|
|
1179
1179
|
l && a.push(`${n.label} :
|
|
1180
1180
|
${l}`);
|
|
1181
1181
|
}
|
|
@@ -1184,22 +1184,22 @@ ${l}`);
|
|
|
1184
1184
|
`);
|
|
1185
1185
|
}
|
|
1186
1186
|
function mt(e, t, s = j()) {
|
|
1187
|
-
const
|
|
1187
|
+
const i = [], a = Array.isArray(e == null ? void 0 : e.fields) ? e.fields : [];
|
|
1188
1188
|
for (const n of a) {
|
|
1189
1189
|
if (!(n != null && n.key) || !(n != null && n.label)) continue;
|
|
1190
|
-
const
|
|
1191
|
-
if (
|
|
1192
|
-
const l = He(n,
|
|
1190
|
+
const r = t == null ? void 0 : t[n.key];
|
|
1191
|
+
if (r == null || r === "") continue;
|
|
1192
|
+
const l = He(n, r, s);
|
|
1193
1193
|
if (!l) continue;
|
|
1194
1194
|
const _ = n.type === "textarea" || typeof l == "string" && (l.length > 60 || l.includes(`
|
|
1195
1195
|
`));
|
|
1196
|
-
|
|
1196
|
+
i.push({ label: n.label, value: l, multiline: _ });
|
|
1197
1197
|
}
|
|
1198
1198
|
return {
|
|
1199
1199
|
kind: "form_response",
|
|
1200
1200
|
data: {
|
|
1201
1201
|
title: (e == null ? void 0 : e.title) || s("form.title"),
|
|
1202
|
-
fields:
|
|
1202
|
+
fields: i
|
|
1203
1203
|
}
|
|
1204
1204
|
};
|
|
1205
1205
|
}
|
|
@@ -1213,10 +1213,10 @@ const Ee = "";
|
|
|
1213
1213
|
function de(e) {
|
|
1214
1214
|
let t = e;
|
|
1215
1215
|
const s = [];
|
|
1216
|
-
return t = t.replace(/`([^`\n]+)`/g, (
|
|
1216
|
+
return t = t.replace(/`([^`\n]+)`/g, (i, a) => {
|
|
1217
1217
|
const n = s.length;
|
|
1218
1218
|
return s.push(a), `${Ee}CODE${n}${Ee}`;
|
|
1219
|
-
}), t = t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (
|
|
1219
|
+
}), t = t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (i, 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, (i, a) => `<code class="wm-md-code">${s[+a]}</code>`), t;
|
|
1220
1220
|
}
|
|
1221
1221
|
function qe(e) {
|
|
1222
1222
|
if (!e) return "";
|
|
@@ -1227,15 +1227,15 @@ function ft(e) {
|
|
|
1227
1227
|
if (!e) return "";
|
|
1228
1228
|
const t = ze(e).split(`
|
|
1229
1229
|
`), s = [];
|
|
1230
|
-
let
|
|
1231
|
-
for (;
|
|
1232
|
-
const n = t[
|
|
1230
|
+
let i = 0;
|
|
1231
|
+
for (; i < t.length; ) {
|
|
1232
|
+
const n = t[i];
|
|
1233
1233
|
if (/^\s*```([\w-]*)\s*$/.exec(n)) {
|
|
1234
|
-
|
|
1234
|
+
i++;
|
|
1235
1235
|
const k = [];
|
|
1236
|
-
for (;
|
|
1237
|
-
k.push(t[
|
|
1238
|
-
|
|
1236
|
+
for (; i < t.length && !/^\s*```\s*$/.test(t[i]); )
|
|
1237
|
+
k.push(t[i]), i++;
|
|
1238
|
+
i < t.length && i++, s.push({
|
|
1239
1239
|
type: "block",
|
|
1240
1240
|
html: `<pre class="wm-md-pre"><code>${k.join(`
|
|
1241
1241
|
`)}</code></pre>`
|
|
@@ -1244,10 +1244,10 @@ function ft(e) {
|
|
|
1244
1244
|
}
|
|
1245
1245
|
if (/^\s*[-*]\s+/.test(n)) {
|
|
1246
1246
|
const k = [];
|
|
1247
|
-
for (;
|
|
1248
|
-
const T = /^\s*[-*]\s+(.*)$/.exec(t[
|
|
1247
|
+
for (; i < t.length; ) {
|
|
1248
|
+
const T = /^\s*[-*]\s+(.*)$/.exec(t[i]);
|
|
1249
1249
|
if (!T) break;
|
|
1250
|
-
k.push(T[1]),
|
|
1250
|
+
k.push(T[1]), i++;
|
|
1251
1251
|
}
|
|
1252
1252
|
const w = k.map((T) => `<li>${de(T)}</li>`).join("");
|
|
1253
1253
|
s.push({
|
|
@@ -1259,10 +1259,10 @@ function ft(e) {
|
|
|
1259
1259
|
const l = /^\s*(\d+)\.\s+(.*)$/.exec(n);
|
|
1260
1260
|
if (l) {
|
|
1261
1261
|
const k = parseInt(l[1], 10), w = [l[2]];
|
|
1262
|
-
for (
|
|
1263
|
-
const A = /^\s*\d+\.\s+(.*)$/.exec(t[
|
|
1262
|
+
for (i++; i < t.length; ) {
|
|
1263
|
+
const A = /^\s*\d+\.\s+(.*)$/.exec(t[i]);
|
|
1264
1264
|
if (!A) break;
|
|
1265
|
-
w.push(A[1]),
|
|
1265
|
+
w.push(A[1]), i++;
|
|
1266
1266
|
}
|
|
1267
1267
|
const T = w.map((A) => `<li>${de(A)}</li>`).join(""), E = k !== 1 ? ` start="${k}"` : "";
|
|
1268
1268
|
s.push({
|
|
@@ -1277,17 +1277,17 @@ function ft(e) {
|
|
|
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
|
+
}), i++;
|
|
1281
1281
|
continue;
|
|
1282
1282
|
}
|
|
1283
|
-
s.push({ type: "text", html: de(n) }),
|
|
1283
|
+
s.push({ type: "text", html: de(n) }), i++;
|
|
1284
1284
|
}
|
|
1285
1285
|
let a = "";
|
|
1286
1286
|
for (let n = 0; n < s.length; n++) {
|
|
1287
|
-
const
|
|
1288
|
-
a +=
|
|
1287
|
+
const r = s[n];
|
|
1288
|
+
a += r.html;
|
|
1289
1289
|
const l = s[n + 1];
|
|
1290
|
-
l &&
|
|
1290
|
+
l && r.type !== "block" && l.type !== "block" && (a += `
|
|
1291
1291
|
`);
|
|
1292
1292
|
}
|
|
1293
1293
|
return a;
|
|
@@ -1304,19 +1304,19 @@ function Y(e) {
|
|
|
1304
1304
|
}
|
|
1305
1305
|
function Be(e, t) {
|
|
1306
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
|
-
for (const
|
|
1308
|
-
|
|
1307
|
+
for (const i of t)
|
|
1308
|
+
i != null && i.created_at && i.created_at > s && (s = i.created_at);
|
|
1309
1309
|
return s;
|
|
1310
1310
|
}
|
|
1311
1311
|
function _t(e, t) {
|
|
1312
|
-
var s,
|
|
1312
|
+
var s, i, a;
|
|
1313
1313
|
for (let n = t.length - 1; n >= 0; n--) {
|
|
1314
|
-
const
|
|
1315
|
-
if (!
|
|
1316
|
-
const l = typeof
|
|
1314
|
+
const r = t[n];
|
|
1315
|
+
if (!r) continue;
|
|
1316
|
+
const l = typeof r.text_md == "string" ? r.text_md.trim() : "";
|
|
1317
1317
|
if (l)
|
|
1318
|
-
return (((s =
|
|
1319
|
-
const _ = (
|
|
1318
|
+
return (((s = r.author) == null ? void 0 : s.type) === "user" ? "Vous : " : "") + l.replace(/\s+/g, " ");
|
|
1319
|
+
const _ = (i = r.payload) == null ? void 0 : i.attachments;
|
|
1320
1320
|
if (Array.isArray(_) && _.length) return "📎 Pièce jointe";
|
|
1321
1321
|
}
|
|
1322
1322
|
return (e == null ? void 0 : e.last_message_preview) || (e == null ? void 0 : e.preview) || ((a = e == null ? void 0 : e.metadata) == null ? void 0 : a.last_preview) || "";
|
|
@@ -1324,32 +1324,32 @@ 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, s,
|
|
1327
|
+
function pt(e, t, s, i) {
|
|
1328
1328
|
const a = [
|
|
1329
1329
|
`# ${e.name || s("common.conversation")}`,
|
|
1330
1330
|
e.created_at ? s("export.createdOn", {
|
|
1331
|
-
date: new Date(e.created_at).toLocaleString(
|
|
1331
|
+
date: new Date(e.created_at).toLocaleString(i)
|
|
1332
1332
|
}) : "",
|
|
1333
1333
|
""
|
|
1334
1334
|
];
|
|
1335
1335
|
for (const n of t) {
|
|
1336
1336
|
if (!n) continue;
|
|
1337
|
-
const
|
|
1338
|
-
if (!
|
|
1339
|
-
const l = gt(n.author, s), _ = n.created_at ? new Date(n.created_at).toLocaleString(
|
|
1340
|
-
a.push(`[${_}] ${l} :`), a.push(
|
|
1337
|
+
const r = (n.text_md || "").trim();
|
|
1338
|
+
if (!r) continue;
|
|
1339
|
+
const l = gt(n.author, s), _ = n.created_at ? new Date(n.created_at).toLocaleString(i) : "";
|
|
1340
|
+
a.push(`[${_}] ${l} :`), a.push(r), a.push("");
|
|
1341
1341
|
}
|
|
1342
1342
|
return a.join(`
|
|
1343
1343
|
`);
|
|
1344
1344
|
}
|
|
1345
|
-
function vt(e, t, s = j(),
|
|
1345
|
+
function vt(e, t, s = j(), i) {
|
|
1346
1346
|
if (!e) return;
|
|
1347
|
-
const a = pt(e, t || [], s, ne(
|
|
1347
|
+
const a = pt(e, t || [], s, ne(i)), n = new Blob([a], { type: "text/plain;charset=utf-8" });
|
|
1348
1348
|
try {
|
|
1349
|
-
const
|
|
1350
|
-
l.href =
|
|
1351
|
-
} catch (
|
|
1352
|
-
console.error("[ww-messenger] export failed",
|
|
1349
|
+
const r = URL.createObjectURL(n), l = document.createElement("a");
|
|
1350
|
+
l.href = r, l.download = `${(e.name || "conversation").replace(/[^a-z0-9-_]+/gi, "_")}.txt`, document.body.appendChild(l), l.click(), document.body.removeChild(l), setTimeout(() => URL.revokeObjectURL(r), 1e3);
|
|
1351
|
+
} catch (r) {
|
|
1352
|
+
console.error("[ww-messenger] export failed", r);
|
|
1353
1353
|
}
|
|
1354
1354
|
}
|
|
1355
1355
|
const yt = {
|
|
@@ -1479,14 +1479,14 @@ const yt = {
|
|
|
1479
1479
|
t.resume();
|
|
1480
1480
|
} catch {
|
|
1481
1481
|
}
|
|
1482
|
-
const s = t.currentTime,
|
|
1483
|
-
|
|
1482
|
+
const s = t.currentTime, i = t.createOscillator(), a = t.createGain();
|
|
1483
|
+
i.connect(a), a.connect(t.destination), i.type = "sine", i.frequency.setValueAtTime(880, s), i.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), i.start(s), i.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 s = t == null ? void 0 : t.author,
|
|
1489
|
+
const s = t == null ? void 0 : t.author, i = !s || s.type === "agent_ia", n = ((s == null ? void 0 : s.name) || (i ? this.agentName : "") || this.t("launcher.theAgent")) + this.t("launcher.repliedToYou"), r = typeof (t == null ? void 0 : t.text_md) == "string" ? t.text_md.trim() : "", l = r ? r.slice(0, 140) : this.t("notification.youHaveNewMessage");
|
|
1490
1490
|
try {
|
|
1491
1491
|
const _ = new Notification(n, {
|
|
1492
1492
|
body: l,
|
|
@@ -1560,10 +1560,14 @@ const yt = {
|
|
|
1560
1560
|
// teardownLiveReveal.
|
|
1561
1561
|
_liveRevealOff: null,
|
|
1562
1562
|
_liveRevealConvSnapshot: null,
|
|
1563
|
-
//
|
|
1564
|
-
//
|
|
1565
|
-
//
|
|
1566
|
-
|
|
1563
|
+
// Per-conv high-water mark: the server `created_at` of the newest
|
|
1564
|
+
// message we've already accounted for. Used by paceLiveMessage to
|
|
1565
|
+
// tell a realtime arrival (created_at > mark → ring) from replayed
|
|
1566
|
+
// history / activity-delta catch-up (<= mark → reveal silently).
|
|
1567
|
+
// Distinct from `_liveRevealConvSnapshot`, which handleLiveActivity
|
|
1568
|
+
// advances eagerly and so can't serve as the notification gate.
|
|
1569
|
+
// Advanced ONLY in paceLiveMessage; persists across conv switches.
|
|
1570
|
+
_liveHwm: {}
|
|
1567
1571
|
};
|
|
1568
1572
|
},
|
|
1569
1573
|
methods: {
|
|
@@ -1584,21 +1588,26 @@ const yt = {
|
|
|
1584
1588
|
// the activity isn't replayed via SSE, so we fetch it explicitly and
|
|
1585
1589
|
// run it through pacing.
|
|
1586
1590
|
setupLiveReveal() {
|
|
1587
|
-
var s;
|
|
1591
|
+
var s, i;
|
|
1588
1592
|
if (!this.transport) return;
|
|
1589
|
-
this.teardownLiveReveal()
|
|
1590
|
-
const e = this.transport.on("message", (
|
|
1591
|
-
const
|
|
1592
|
-
|
|
1593
|
+
this.teardownLiveReveal();
|
|
1594
|
+
const e = this.transport.on("message", (a) => {
|
|
1595
|
+
const n = a == null ? void 0 : a.conversation_id, r = a == null ? void 0 : a.message;
|
|
1596
|
+
n && r && this.paceLiveMessage(r, n);
|
|
1593
1597
|
});
|
|
1594
1598
|
this._liveRevealConvSnapshot = new Map(
|
|
1595
|
-
(((s = this.s) == null ? void 0 : s.conversations) || []).map((
|
|
1596
|
-
|
|
1597
|
-
(
|
|
1599
|
+
(((s = this.s) == null ? void 0 : s.conversations) || []).map((a) => [
|
|
1600
|
+
a.id,
|
|
1601
|
+
(a == null ? void 0 : a.last_message_at) || ""
|
|
1602
|
+
])
|
|
1603
|
+
), this._liveHwm = Object.fromEntries(
|
|
1604
|
+
(((i = this.s) == null ? void 0 : i.conversations) || []).map((a) => [
|
|
1605
|
+
a.id,
|
|
1606
|
+
(a == null ? void 0 : a.last_message_at) || ""
|
|
1598
1607
|
])
|
|
1599
1608
|
);
|
|
1600
|
-
const t = this.transport.on("activity", (
|
|
1601
|
-
this.handleLiveActivity(
|
|
1609
|
+
const t = this.transport.on("activity", (a) => {
|
|
1610
|
+
this.handleLiveActivity(a);
|
|
1602
1611
|
});
|
|
1603
1612
|
this._liveRevealOff = () => {
|
|
1604
1613
|
try {
|
|
@@ -1619,7 +1628,7 @@ const yt = {
|
|
|
1619
1628
|
}
|
|
1620
1629
|
this._liveRevealOff = null;
|
|
1621
1630
|
}
|
|
1622
|
-
this._liveRevealConvSnapshot = null;
|
|
1631
|
+
this._liveRevealConvSnapshot = null, this._liveHwm = {};
|
|
1623
1632
|
},
|
|
1624
1633
|
// Compare the activity payload against the snapshot taken at the
|
|
1625
1634
|
// previous tick (or at setup time). For each conv whose
|
|
@@ -1631,22 +1640,22 @@ const yt = {
|
|
|
1631
1640
|
var a, n;
|
|
1632
1641
|
const t = e == null ? void 0 : e.conversations;
|
|
1633
1642
|
if (!Array.isArray(t) || !this.store) return;
|
|
1634
|
-
const s = this._liveRevealConvSnapshot || /* @__PURE__ */ new Map(),
|
|
1635
|
-
for (const
|
|
1636
|
-
if (!(
|
|
1637
|
-
const l =
|
|
1643
|
+
const s = this._liveRevealConvSnapshot || /* @__PURE__ */ new Map(), i = [];
|
|
1644
|
+
for (const r of t) {
|
|
1645
|
+
if (!(r != null && r.id)) continue;
|
|
1646
|
+
const l = r.last_message_at || "";
|
|
1638
1647
|
if (!l) continue;
|
|
1639
|
-
const _ = s.get(
|
|
1640
|
-
l > _ &&
|
|
1648
|
+
const _ = s.get(r.id) || "";
|
|
1649
|
+
l > _ && i.push(r.id);
|
|
1641
1650
|
}
|
|
1642
1651
|
this._liveRevealConvSnapshot = new Map(
|
|
1643
|
-
t.map((
|
|
1652
|
+
t.map((r) => [r.id, (r == null ? void 0 : r.last_message_at) || ""])
|
|
1644
1653
|
);
|
|
1645
|
-
for (const
|
|
1654
|
+
for (const r of i)
|
|
1646
1655
|
try {
|
|
1647
|
-
const l = await ((n = (a = this.store).fetchSinceLast) == null ? void 0 : n.call(a,
|
|
1656
|
+
const l = await ((n = (a = this.store).fetchSinceLast) == null ? void 0 : n.call(a, r));
|
|
1648
1657
|
if (!Array.isArray(l)) continue;
|
|
1649
|
-
for (const _ of l) this.paceLiveMessage(_,
|
|
1658
|
+
for (const _ of l) this.paceLiveMessage(_, r);
|
|
1650
1659
|
} catch (l) {
|
|
1651
1660
|
console.error(
|
|
1652
1661
|
"[ww-messenger] activity delta fetch failed",
|
|
@@ -1660,15 +1669,15 @@ const yt = {
|
|
|
1660
1669
|
// - inter-bubble gap scales with message length (reading time),
|
|
1661
1670
|
// bounded by MIN/MAX_TYPING_MS.
|
|
1662
1671
|
scheduleReveal(e, t) {
|
|
1663
|
-
const s = this.revealPacing,
|
|
1672
|
+
const s = this.revealPacing, i = Date.now(), a = ((e == null ? void 0 : e.text_md) || "").length, n = Math.min(
|
|
1664
1673
|
s.maxTypingMs,
|
|
1665
1674
|
Math.max(s.minTypingMs, a * s.msPerChar)
|
|
1666
1675
|
), l = Math.max(
|
|
1667
|
-
|
|
1676
|
+
i + s.firstRevealDelayMs,
|
|
1668
1677
|
this.nextRevealAt + s.pauseBetweenMs
|
|
1669
1678
|
) + n;
|
|
1670
1679
|
this.nextRevealAt = l;
|
|
1671
|
-
const _ = Math.max(0, l -
|
|
1680
|
+
const _ = Math.max(0, l - i), k = e.id, w = setTimeout(() => {
|
|
1672
1681
|
this.revealedAt = { ...this.revealedAt, [k]: Date.now() }, this.revealTimers = this.revealTimers.filter((T) => T !== w), typeof this.onMessageRevealed == "function" && this.onMessageRevealed(e, t);
|
|
1673
1682
|
}, _);
|
|
1674
1683
|
this.revealTimers.push(w);
|
|
@@ -1681,26 +1690,26 @@ const yt = {
|
|
|
1681
1690
|
paceMessages(e, t) {
|
|
1682
1691
|
var a;
|
|
1683
1692
|
if (!Array.isArray(e) || !e.length) return;
|
|
1684
|
-
const s = Date.now(),
|
|
1693
|
+
const s = Date.now(), i = { ...this.revealedAt };
|
|
1685
1694
|
for (const n of e) {
|
|
1686
|
-
if ((n == null ? void 0 : n.id) == null ||
|
|
1695
|
+
if ((n == null ? void 0 : n.id) == null || i[n.id] !== void 0) continue;
|
|
1687
1696
|
if (!he(n)) {
|
|
1688
|
-
|
|
1697
|
+
i[n.id] = s;
|
|
1689
1698
|
continue;
|
|
1690
1699
|
}
|
|
1691
|
-
const
|
|
1692
|
-
if (!Number.isFinite(
|
|
1693
|
-
|
|
1700
|
+
const r = n != null && n.created_at ? Date.parse(n.created_at) : NaN;
|
|
1701
|
+
if (!Number.isFinite(r) || r < this.convOpenedAt) {
|
|
1702
|
+
i[n.id] = s;
|
|
1694
1703
|
continue;
|
|
1695
1704
|
}
|
|
1696
1705
|
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;
|
|
1697
1706
|
if (!l && !_) {
|
|
1698
|
-
|
|
1707
|
+
i[n.id] = s;
|
|
1699
1708
|
continue;
|
|
1700
1709
|
}
|
|
1701
|
-
|
|
1710
|
+
i[n.id] = 0, this.scheduleReveal(n, t);
|
|
1702
1711
|
}
|
|
1703
|
-
this.revealedAt =
|
|
1712
|
+
this.revealedAt = i;
|
|
1704
1713
|
},
|
|
1705
1714
|
// Pace a single live message from any conversation. Called from the
|
|
1706
1715
|
// transport 'message' subscription (live SSE arrival) and from the
|
|
@@ -1709,28 +1718,28 @@ const yt = {
|
|
|
1709
1718
|
// the watcher path and the live path can both fire for the same
|
|
1710
1719
|
// message without double-scheduling.
|
|
1711
1720
|
//
|
|
1712
|
-
//
|
|
1713
|
-
//
|
|
1714
|
-
//
|
|
1715
|
-
//
|
|
1716
|
-
//
|
|
1717
|
-
//
|
|
1718
|
-
//
|
|
1719
|
-
//
|
|
1721
|
+
// Realtime gate on a per-conv high-water mark of server `created_at`
|
|
1722
|
+
// (see `_liveHwm`). A transport `message` burst can be replayed and an
|
|
1723
|
+
// activity-delta `fetchSinceLast` returns history the user already saw
|
|
1724
|
+
// — most visibly on reopening the panel. We ring ONLY for a message
|
|
1725
|
+
// strictly newer than the latest one already accounted for in its
|
|
1726
|
+
// conversation; anything at/before the mark reveals instantly and
|
|
1727
|
+
// silently. Both sides of the comparison are server timestamps, so
|
|
1728
|
+
// this is immune to client clock skew.
|
|
1720
1729
|
paceLiveMessage(e, t) {
|
|
1721
|
-
var
|
|
1730
|
+
var l;
|
|
1722
1731
|
if (!(e != null && e.id) || this.revealedAt[e.id] !== void 0) return;
|
|
1723
1732
|
if (!he(e)) {
|
|
1724
1733
|
this.revealedAt = { ...this.revealedAt, [e.id]: Date.now() };
|
|
1725
1734
|
return;
|
|
1726
1735
|
}
|
|
1727
|
-
const s = typeof (e == null ? void 0 : e.text_md) == "string" && e.text_md.trim().length > 0,
|
|
1728
|
-
if (!s && !
|
|
1736
|
+
const s = typeof (e == null ? void 0 : e.text_md) == "string" && e.text_md.trim().length > 0, i = Array.isArray((l = e == null ? void 0 : e.payload) == null ? void 0 : l.attachments) && e.payload.attachments.length > 0;
|
|
1737
|
+
if (!s && !i) {
|
|
1729
1738
|
this.revealedAt = { ...this.revealedAt, [e.id]: Date.now() };
|
|
1730
1739
|
return;
|
|
1731
1740
|
}
|
|
1732
|
-
const a = e
|
|
1733
|
-
if (
|
|
1741
|
+
const a = this._liveHwm[t], n = (e == null ? void 0 : e.created_at) || "";
|
|
1742
|
+
if (n && (a === void 0 || n > a) && (this._liveHwm = { ...this._liveHwm, [t]: n }), !(a !== void 0 && n && n > a)) {
|
|
1734
1743
|
this.revealedAt = { ...this.revealedAt, [e.id]: Date.now() };
|
|
1735
1744
|
return;
|
|
1736
1745
|
}
|
|
@@ -1796,12 +1805,12 @@ const yt = {
|
|
|
1796
1805
|
// messages, or when the pointer is already at/ahead of the
|
|
1797
1806
|
// candidate id.
|
|
1798
1807
|
markConvRead(e) {
|
|
1799
|
-
var n,
|
|
1808
|
+
var n, r;
|
|
1800
1809
|
if (!(e != null && e.id) || e._draft || !this.store) return;
|
|
1801
|
-
const t = ((
|
|
1810
|
+
const t = ((r = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : r[e.id]) || [], s = At(t);
|
|
1802
1811
|
if (s == null) return;
|
|
1803
|
-
const
|
|
1804
|
-
a != null && (
|
|
1812
|
+
const i = Y(e.last_read_message_id), a = Y(s);
|
|
1813
|
+
a != null && (i != null && a <= i || (this._readMarkerPending = { convId: e.id, messageId: s }, !this._readMarkerTimer && (this._readMarkerTimer = setTimeout(() => {
|
|
1805
1814
|
const l = this._readMarkerPending;
|
|
1806
1815
|
this._readMarkerPending = null, this._readMarkerTimer = null, l && this.store && this.store.markConversationRead(
|
|
1807
1816
|
l.convId,
|
|
@@ -1821,8 +1830,8 @@ function At(e) {
|
|
|
1821
1830
|
}
|
|
1822
1831
|
const P = (e, t) => {
|
|
1823
1832
|
const s = e.__vccOpts || e;
|
|
1824
|
-
for (const [
|
|
1825
|
-
s[
|
|
1833
|
+
for (const [i, a] of t)
|
|
1834
|
+
s[i] = a;
|
|
1826
1835
|
return s;
|
|
1827
1836
|
}, St = {
|
|
1828
1837
|
name: "WmHumanAvatar",
|
|
@@ -1845,7 +1854,7 @@ const P = (e, t) => {
|
|
|
1845
1854
|
}
|
|
1846
1855
|
}
|
|
1847
1856
|
}, Mt = ["src", "alt"];
|
|
1848
|
-
function Tt(e, t, s,
|
|
1857
|
+
function Tt(e, t, s, i, a, n) {
|
|
1849
1858
|
return c(), d("div", {
|
|
1850
1859
|
class: R(["wm-huav", { "wm-huav--tail": s.tail }]),
|
|
1851
1860
|
style: z({
|
|
@@ -1891,9 +1900,9 @@ const ve = /* @__PURE__ */ P(St, [["render", Tt], ["__scopeId", "data-v-14e10c0d
|
|
|
1891
1900
|
return this.peeks.slice(0, xt).reverse();
|
|
1892
1901
|
}
|
|
1893
1902
|
}
|
|
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" },
|
|
1895
|
-
function zt(e, t, s,
|
|
1896
|
-
const
|
|
1903
|
+
}, 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" }, Ut = { class: "wm-peek__action" }, Nt = { class: "wm-peek__text" }, Ft = ["onClick"], jt = ["aria-label"], Ht = ["aria-label"];
|
|
1904
|
+
function zt(e, t, s, i, a, n) {
|
|
1905
|
+
const r = B("HumanAvatar");
|
|
1897
1906
|
return c(), d("div", {
|
|
1898
1907
|
class: "wm-launcherWrap",
|
|
1899
1908
|
onMouseenter: t[1] || (t[1] = (l) => e.$emit("hover", !0)),
|
|
@@ -1901,7 +1910,7 @@ function zt(e, t, s, r, a, n) {
|
|
|
1901
1910
|
onFocusin: t[3] || (t[3] = (l) => e.$emit("hover", !0)),
|
|
1902
1911
|
onFocusout: t[4] || (t[4] = (l) => e.$emit("hover", !1))
|
|
1903
1912
|
}, [
|
|
1904
|
-
$(
|
|
1913
|
+
$(Ne, { name: "wm-peek" }, {
|
|
1905
1914
|
default: Fe(() => [
|
|
1906
1915
|
n.visiblePeeks.length ? (c(), d("div", {
|
|
1907
1916
|
key: 0,
|
|
@@ -1946,7 +1955,7 @@ function zt(e, t, s, r, a, n) {
|
|
|
1946
1955
|
], -1)
|
|
1947
1956
|
])], 8, Lt),
|
|
1948
1957
|
o("div", It, [
|
|
1949
|
-
$(
|
|
1958
|
+
$(r, {
|
|
1950
1959
|
name: l.senderName,
|
|
1951
1960
|
"avatar-url": l.senderAvatarUrl,
|
|
1952
1961
|
size: 34
|
|
@@ -1960,9 +1969,9 @@ function zt(e, t, s, r, a, n) {
|
|
|
1960
1969
|
o("div", Bt, [
|
|
1961
1970
|
o("div", Pt, [
|
|
1962
1971
|
o("span", Dt, v(l.senderName || n.t("common.agent")), 1),
|
|
1963
|
-
o("span",
|
|
1972
|
+
o("span", Ut, v(n.t("launcher.repliedToYou")), 1)
|
|
1964
1973
|
]),
|
|
1965
|
-
o("p",
|
|
1974
|
+
o("p", Nt, v(l.preview), 1)
|
|
1966
1975
|
]),
|
|
1967
1976
|
o("button", {
|
|
1968
1977
|
type: "button",
|
|
@@ -2038,7 +2047,7 @@ const qt = /* @__PURE__ */ P(Ot, [["render", zt], ["__scopeId", "data-v-d81459bc
|
|
|
2038
2047
|
key: 0,
|
|
2039
2048
|
class: "wm-aiav__pulse"
|
|
2040
2049
|
}, Kt = ["src", "alt"], Wt = ["width", "height"];
|
|
2041
|
-
function Gt(e, t, s,
|
|
2050
|
+
function Gt(e, t, s, i, a, n) {
|
|
2042
2051
|
return c(), d("div", {
|
|
2043
2052
|
class: R(["wm-aiav", { "wm-aiav--tail": s.tail }]),
|
|
2044
2053
|
style: z({
|
|
@@ -2125,26 +2134,26 @@ const oe = /* @__PURE__ */ P(Vt, [["render", Gt], ["__scopeId", "data-v-6f7f685d
|
|
|
2125
2134
|
key: 0,
|
|
2126
2135
|
class: "wm-team__label"
|
|
2127
2136
|
};
|
|
2128
|
-
function en(e, t, s,
|
|
2137
|
+
function en(e, t, s, i, a, n) {
|
|
2129
2138
|
return n.visible ? (c(), d("div", Jt, [
|
|
2130
2139
|
o("div", {
|
|
2131
2140
|
class: "wm-team__stack",
|
|
2132
2141
|
style: z({ width: n.stackWidth + "px" })
|
|
2133
2142
|
}, [
|
|
2134
|
-
(c(!0), d(I, null, F(s.members.slice(0, 3), (
|
|
2143
|
+
(c(!0), d(I, null, F(s.members.slice(0, 3), (r, l) => (c(), d("div", {
|
|
2135
2144
|
key: l,
|
|
2136
2145
|
class: "wm-team__pill",
|
|
2137
2146
|
style: z({
|
|
2138
2147
|
left: l * 13 + "px",
|
|
2139
2148
|
zIndex: 3 - l,
|
|
2140
|
-
background: n.colorFor(
|
|
2149
|
+
background: n.colorFor(r)
|
|
2141
2150
|
})
|
|
2142
2151
|
}, [
|
|
2143
|
-
|
|
2152
|
+
r.avatar_url ? (c(), d("img", {
|
|
2144
2153
|
key: 0,
|
|
2145
|
-
src:
|
|
2146
|
-
alt:
|
|
2147
|
-
}, null, 8, Xt)) : (c(), d("span", Qt, v(n.initialsFor(
|
|
2154
|
+
src: r.avatar_url,
|
|
2155
|
+
alt: r.name || ""
|
|
2156
|
+
}, null, 8, Xt)) : (c(), d("span", Qt, v(n.initialsFor(r)), 1))
|
|
2148
2157
|
], 4))), 128))
|
|
2149
2158
|
], 4),
|
|
2150
2159
|
s.responseLabel ? (c(), d("span", Zt, v(s.responseLabel), 1)) : b("", !0)
|
|
@@ -2184,8 +2193,8 @@ const tn = /* @__PURE__ */ P(Yt, [["render", en], ["__scopeId", "data-v-e49a9063
|
|
|
2184
2193
|
const e = Array.isArray(this.teamMembers) ? this.teamMembers : [];
|
|
2185
2194
|
if (e.length <= 3) return e;
|
|
2186
2195
|
const t = (/* @__PURE__ */ new Date()).getHours() % e.length, s = [];
|
|
2187
|
-
for (let
|
|
2188
|
-
s.push(e[(t +
|
|
2196
|
+
for (let i = 0; i < 3; i++)
|
|
2197
|
+
s.push(e[(t + i) % e.length]);
|
|
2189
2198
|
return s;
|
|
2190
2199
|
}
|
|
2191
2200
|
}
|
|
@@ -2196,8 +2205,8 @@ const tn = /* @__PURE__ */ P(Yt, [["render", en], ["__scopeId", "data-v-e49a9063
|
|
|
2196
2205
|
key: 3,
|
|
2197
2206
|
class: "wm-header__fill"
|
|
2198
2207
|
}, un = { class: "wm-header__actions" }, hn = ["aria-label", "title"], mn = ["aria-label", "title"];
|
|
2199
|
-
function fn(e, t, s,
|
|
2200
|
-
const
|
|
2208
|
+
function fn(e, t, s, i, a, n) {
|
|
2209
|
+
const r = B("AIAvatar"), l = B("TeamAvatars");
|
|
2201
2210
|
return c(), d("div", sn, [
|
|
2202
2211
|
s.showBack ? (c(), d("button", {
|
|
2203
2212
|
key: 0,
|
|
@@ -2222,7 +2231,7 @@ function fn(e, t, s, r, a, n) {
|
|
|
2222
2231
|
])], 8, rn)) : (c(), d("div", an)),
|
|
2223
2232
|
s.showIdentity ? (c(), d(I, { key: 2 }, [
|
|
2224
2233
|
o("div", on, [
|
|
2225
|
-
$(
|
|
2234
|
+
$(r, {
|
|
2226
2235
|
size: 30,
|
|
2227
2236
|
name: s.agentName,
|
|
2228
2237
|
"image-url": s.agentAvatarUrl
|
|
@@ -2401,15 +2410,15 @@ const _n = /* @__PURE__ */ P(nn, [["render", fn], ["__scopeId", "data-v-7af4c118
|
|
|
2401
2410
|
if (!e) return "";
|
|
2402
2411
|
const t = new Date(e);
|
|
2403
2412
|
if (Number.isNaN(t.getTime())) return "";
|
|
2404
|
-
const s = ne(this.wmLocale()),
|
|
2405
|
-
if (t.toDateString() ===
|
|
2413
|
+
const s = ne(this.wmLocale()), i = /* @__PURE__ */ new Date();
|
|
2414
|
+
if (t.toDateString() === i.toDateString())
|
|
2406
2415
|
return t.toLocaleTimeString(s, {
|
|
2407
2416
|
hour: "2-digit",
|
|
2408
2417
|
minute: "2-digit"
|
|
2409
2418
|
});
|
|
2410
|
-
if (
|
|
2411
|
-
const
|
|
2412
|
-
return
|
|
2419
|
+
if (i.getTime() - t.getTime() < 7 * 864e5) {
|
|
2420
|
+
const r = t.toLocaleDateString(s, { weekday: "short" });
|
|
2421
|
+
return r.charAt(0).toUpperCase() + r.slice(1);
|
|
2413
2422
|
}
|
|
2414
2423
|
return t.toLocaleDateString(s, {
|
|
2415
2424
|
day: "2-digit",
|
|
@@ -2429,7 +2438,7 @@ const _n = /* @__PURE__ */ P(nn, [["render", fn], ["__scopeId", "data-v-7af4c118
|
|
|
2429
2438
|
}, Rn = ["innerHTML"], Ln = { class: "wm-onb__alert-meta" }, In = {
|
|
2430
2439
|
key: 0,
|
|
2431
2440
|
class: "wm-onb__alert-time"
|
|
2432
|
-
}, En = { class: "wm-onb__alert-resume" }, Bn = { class: "wm-onb__actions" }, Pn = ["disabled"], Dn = { class: "wm-onb__btn-label" },
|
|
2441
|
+
}, En = { class: "wm-onb__alert-resume" }, Bn = { class: "wm-onb__actions" }, Pn = ["disabled"], Dn = { class: "wm-onb__btn-label" }, Un = ["onClick"], Nn = { class: "wm-onb__btn-icon" }, Fn = ["aria-label"], jn = {
|
|
2433
2442
|
key: 1,
|
|
2434
2443
|
width: "18",
|
|
2435
2444
|
height: "18",
|
|
@@ -2463,8 +2472,8 @@ const _n = /* @__PURE__ */ P(nn, [["render", fn], ["__scopeId", "data-v-7af4c118
|
|
|
2463
2472
|
"stroke-linejoin": "round",
|
|
2464
2473
|
"aria-hidden": "true"
|
|
2465
2474
|
}, Kn = ["d"], Wn = { class: "wm-onb__btn-label" }, Gn = { class: "wm-onb__btn-count" };
|
|
2466
|
-
function Yn(e, t, s,
|
|
2467
|
-
const
|
|
2475
|
+
function Yn(e, t, s, i, a, n) {
|
|
2476
|
+
const r = B("AIAvatar");
|
|
2468
2477
|
return c(), d("div", pn, [
|
|
2469
2478
|
o("div", vn, [
|
|
2470
2479
|
t[2] || (t[2] = o("svg", {
|
|
@@ -2501,7 +2510,7 @@ function Yn(e, t, s, r, a, n) {
|
|
|
2501
2510
|
opacity: "0.65"
|
|
2502
2511
|
})
|
|
2503
2512
|
], -1)),
|
|
2504
|
-
$(
|
|
2513
|
+
$(r, {
|
|
2505
2514
|
size: 52,
|
|
2506
2515
|
"image-url": s.defaultIconUrl
|
|
2507
2516
|
}, null, 8, ["image-url"]),
|
|
@@ -2588,7 +2597,7 @@ function Yn(e, t, s, r, a, n) {
|
|
|
2588
2597
|
class: "wm-onb__btn",
|
|
2589
2598
|
onClick: (k) => e.$emit("select", l)
|
|
2590
2599
|
}, [
|
|
2591
|
-
o("span",
|
|
2600
|
+
o("span", Nn, [
|
|
2592
2601
|
n.safeIconUrl(l) ? (c(), d("span", {
|
|
2593
2602
|
key: 0,
|
|
2594
2603
|
class: "wm-onb__btn-iconImg",
|
|
@@ -2605,7 +2614,7 @@ function Yn(e, t, s, r, a, n) {
|
|
|
2605
2614
|
n.isExternalLink(l) ? (c(), d("svg", qn, [...t[5] || (t[5] = [
|
|
2606
2615
|
o("path", { d: "M7 17L17 7M9 7h8v8" }, null, -1)
|
|
2607
2616
|
])])) : b("", !0)
|
|
2608
|
-
], 8,
|
|
2617
|
+
], 8, Un))), 128)),
|
|
2609
2618
|
s.openThreads.length ? (c(), d("button", {
|
|
2610
2619
|
key: 0,
|
|
2611
2620
|
type: "button",
|
|
@@ -2692,15 +2701,15 @@ const Jn = /* @__PURE__ */ P(gn, [["render", Yn], ["__scopeId", "data-v-136c3afe
|
|
|
2692
2701
|
if (!e) return "";
|
|
2693
2702
|
const t = new Date(e);
|
|
2694
2703
|
if (Number.isNaN(t.getTime())) return "";
|
|
2695
|
-
const s = ne(this.wmLocale()),
|
|
2696
|
-
if (t.toDateString() ===
|
|
2704
|
+
const s = ne(this.wmLocale()), i = /* @__PURE__ */ new Date();
|
|
2705
|
+
if (t.toDateString() === i.toDateString())
|
|
2697
2706
|
return t.toLocaleTimeString(s, {
|
|
2698
2707
|
hour: "2-digit",
|
|
2699
2708
|
minute: "2-digit"
|
|
2700
2709
|
});
|
|
2701
|
-
if (
|
|
2702
|
-
const
|
|
2703
|
-
return
|
|
2710
|
+
if (i.getTime() - t.getTime() < 7 * 864e5) {
|
|
2711
|
+
const r = t.toLocaleDateString(s, { weekday: "short" });
|
|
2712
|
+
return r.charAt(0).toUpperCase() + r.slice(1);
|
|
2704
2713
|
}
|
|
2705
2714
|
return t.toLocaleDateString(s, {
|
|
2706
2715
|
day: "2-digit",
|
|
@@ -2718,7 +2727,7 @@ const Jn = /* @__PURE__ */ P(gn, [["render", Yn], ["__scopeId", "data-v-136c3afe
|
|
|
2718
2727
|
key: 0,
|
|
2719
2728
|
class: "wm-hist__empty"
|
|
2720
2729
|
};
|
|
2721
|
-
function us(e, t, s,
|
|
2730
|
+
function us(e, t, s, i, a, n) {
|
|
2722
2731
|
return c(), d("div", Qn, [
|
|
2723
2732
|
o("div", Zn, [
|
|
2724
2733
|
t[1] || (t[1] = o("span", { class: "wm-hist__searchIcon" }, [
|
|
@@ -2737,7 +2746,7 @@ function us(e, t, s, r, a, n) {
|
|
|
2737
2746
|
])
|
|
2738
2747
|
], -1)),
|
|
2739
2748
|
G(o("input", {
|
|
2740
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
2749
|
+
"onUpdate:modelValue": t[0] || (t[0] = (r) => a.query = r),
|
|
2741
2750
|
type: "text",
|
|
2742
2751
|
placeholder: n.t("onboarding.search"),
|
|
2743
2752
|
"aria-label": n.t("onboarding.search")
|
|
@@ -2746,16 +2755,16 @@ function us(e, t, s, r, a, n) {
|
|
|
2746
2755
|
])
|
|
2747
2756
|
]),
|
|
2748
2757
|
o("div", ts, [
|
|
2749
|
-
(c(!0), d(I, null, F(n.filteredThreads, (
|
|
2750
|
-
key:
|
|
2758
|
+
(c(!0), d(I, null, F(n.filteredThreads, (r) => (c(), d("button", {
|
|
2759
|
+
key: r.id,
|
|
2751
2760
|
type: "button",
|
|
2752
|
-
class: R(["wm-hist__thread", { "wm-hist__thread--unread":
|
|
2753
|
-
onClick: (l) => e.$emit("resume",
|
|
2761
|
+
class: R(["wm-hist__thread", { "wm-hist__thread--unread": r.unread }]),
|
|
2762
|
+
onClick: (l) => e.$emit("resume", r)
|
|
2754
2763
|
}, [
|
|
2755
2764
|
o("span", {
|
|
2756
|
-
class: R(["wm-hist__thread-avatar", n.avatarWrapperClass(
|
|
2765
|
+
class: R(["wm-hist__thread-avatar", n.avatarWrapperClass(r)])
|
|
2757
2766
|
}, [
|
|
2758
|
-
n.isDefaultAvatar(
|
|
2767
|
+
n.isDefaultAvatar(r) ? (c(), d("span", ss, [...t[2] || (t[2] = [
|
|
2759
2768
|
o("svg", {
|
|
2760
2769
|
width: "18",
|
|
2761
2770
|
height: "18",
|
|
@@ -2769,25 +2778,25 @@ function us(e, t, s, r, a, n) {
|
|
|
2769
2778
|
}, [
|
|
2770
2779
|
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" })
|
|
2771
2780
|
], -1)
|
|
2772
|
-
])])) : (c(), D(Ae(n.avatarComponent(
|
|
2781
|
+
])])) : (c(), D(Ae(n.avatarComponent(r)), je({
|
|
2773
2782
|
key: 1,
|
|
2774
2783
|
ref_for: !0
|
|
2775
|
-
}, n.avatarProps(
|
|
2776
|
-
|
|
2784
|
+
}, n.avatarProps(r)), null, 16)),
|
|
2785
|
+
r.unread ? (c(), d("span", {
|
|
2777
2786
|
key: 2,
|
|
2778
2787
|
class: "wm-hist__thread-dot",
|
|
2779
2788
|
"aria-label": n.t("onboarding.unread")
|
|
2780
2789
|
}, null, 8, rs)) : b("", !0)
|
|
2781
2790
|
], 2),
|
|
2782
2791
|
o("span", is, [
|
|
2783
|
-
o("span", as, v(
|
|
2792
|
+
o("span", as, v(r.title), 1),
|
|
2784
2793
|
o("span", {
|
|
2785
2794
|
class: "wm-hist__thread-preview",
|
|
2786
|
-
innerHTML: n.renderPreview(
|
|
2795
|
+
innerHTML: n.renderPreview(r.preview)
|
|
2787
2796
|
}, null, 8, os)
|
|
2788
2797
|
]),
|
|
2789
2798
|
o("span", ls, [
|
|
2790
|
-
n.formatTs(
|
|
2799
|
+
n.formatTs(r._ts) ? (c(), d("span", cs, v(n.formatTs(r._ts)), 1)) : b("", !0),
|
|
2791
2800
|
t[3] || (t[3] = o("svg", {
|
|
2792
2801
|
width: "14",
|
|
2793
2802
|
height: "14",
|
|
@@ -2869,7 +2878,7 @@ const fs = {
|
|
|
2869
2878
|
"stroke-linecap": "round",
|
|
2870
2879
|
"stroke-linejoin": "round"
|
|
2871
2880
|
}, ws = { class: "wm-result__body" }, bs = { class: "wm-result__label" }, ks = { class: "wm-result__detail" };
|
|
2872
|
-
function Cs(e, t, s,
|
|
2881
|
+
function Cs(e, t, s, i, a, n) {
|
|
2873
2882
|
return c(), d("div", {
|
|
2874
2883
|
class: R(["wm-result", `wm-result--${s.state}`])
|
|
2875
2884
|
}, [
|
|
@@ -2930,7 +2939,7 @@ const As = /* @__PURE__ */ P(fs, [["render", Cs], ["__scopeId", "data-v-7284acd0
|
|
|
2930
2939
|
}
|
|
2931
2940
|
}
|
|
2932
2941
|
}, 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" };
|
|
2933
|
-
function Is(e, t, s,
|
|
2942
|
+
function Is(e, t, s, i, a, n) {
|
|
2934
2943
|
return c(), d("div", Ms, [
|
|
2935
2944
|
o("div", Ts, [
|
|
2936
2945
|
o("div", xs, v(s.data.title || n.t("form.title")), 1),
|
|
@@ -2952,17 +2961,17 @@ function Is(e, t, s, r, a, n) {
|
|
|
2952
2961
|
])
|
|
2953
2962
|
]),
|
|
2954
2963
|
o("div", Rs, [
|
|
2955
|
-
(c(!0), d(I, null, F(n.fields, (
|
|
2964
|
+
(c(!0), d(I, null, F(n.fields, (r, l) => (c(), d("div", {
|
|
2956
2965
|
key: l,
|
|
2957
2966
|
class: "wm-art__field"
|
|
2958
2967
|
}, [
|
|
2959
|
-
o("div", Ls, v(
|
|
2968
|
+
o("div", Ls, v(r.label), 1),
|
|
2960
2969
|
o("div", {
|
|
2961
2970
|
class: R([
|
|
2962
2971
|
"wm-art__fieldValue",
|
|
2963
|
-
{ "wm-art__fieldValue--multi":
|
|
2972
|
+
{ "wm-art__fieldValue--multi": r.multiline }
|
|
2964
2973
|
])
|
|
2965
|
-
}, v(
|
|
2974
|
+
}, v(r.value), 3)
|
|
2966
2975
|
]))), 128))
|
|
2967
2976
|
])
|
|
2968
2977
|
]);
|
|
@@ -2985,7 +2994,7 @@ const Es = /* @__PURE__ */ P(Ss, [["render", Is], ["__scopeId", "data-v-713aecf1
|
|
|
2985
2994
|
}, Ps = { class: "wm-art wm-art--infoCard" }, Ds = {
|
|
2986
2995
|
key: 0,
|
|
2987
2996
|
class: "wm-art__image"
|
|
2988
|
-
},
|
|
2997
|
+
}, Us = ["src", "alt"], Ns = { class: "wm-art__head" }, Fs = { class: "wm-art__headMain" }, js = { class: "wm-art__title" }, Hs = {
|
|
2989
2998
|
key: 0,
|
|
2990
2999
|
class: "wm-art__subtitle"
|
|
2991
3000
|
}, zs = {
|
|
@@ -2995,16 +3004,16 @@ const Es = /* @__PURE__ */ P(Ss, [["render", Is], ["__scopeId", "data-v-713aecf1
|
|
|
2995
3004
|
key: 0,
|
|
2996
3005
|
class: "wm-art__text"
|
|
2997
3006
|
}, Vs = { class: "wm-art__fieldLabel" };
|
|
2998
|
-
function $s(e, t, s,
|
|
3007
|
+
function $s(e, t, s, i, a, n) {
|
|
2999
3008
|
return c(), d("div", Ps, [
|
|
3000
3009
|
s.data.image_url ? (c(), d("figure", Ds, [
|
|
3001
3010
|
o("img", {
|
|
3002
3011
|
src: s.data.image_url,
|
|
3003
3012
|
alt: s.data.title || "",
|
|
3004
3013
|
loading: "lazy"
|
|
3005
|
-
}, null, 8,
|
|
3014
|
+
}, null, 8, Us)
|
|
3006
3015
|
])) : b("", !0),
|
|
3007
|
-
o("div",
|
|
3016
|
+
o("div", Ns, [
|
|
3008
3017
|
o("div", Fs, [
|
|
3009
3018
|
o("div", js, v(s.data.title), 1),
|
|
3010
3019
|
s.data.subtitle ? (c(), d("div", Hs, v(s.data.subtitle), 1)) : b("", !0)
|
|
@@ -3019,17 +3028,17 @@ function $s(e, t, s, r, a, n) {
|
|
|
3019
3028
|
]),
|
|
3020
3029
|
n.hasBody ? (c(), d("div", zs, [
|
|
3021
3030
|
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, (
|
|
3031
|
+
n.fields.length ? (c(!0), d(I, { key: 1 }, F(n.fields, (r, l) => (c(), d("div", {
|
|
3023
3032
|
key: l,
|
|
3024
3033
|
class: "wm-art__field"
|
|
3025
3034
|
}, [
|
|
3026
|
-
o("div", Vs, v(
|
|
3035
|
+
o("div", Vs, v(r.label), 1),
|
|
3027
3036
|
o("div", {
|
|
3028
3037
|
class: R([
|
|
3029
3038
|
"wm-art__fieldValue",
|
|
3030
|
-
{ "wm-art__fieldValue--multi":
|
|
3039
|
+
{ "wm-art__fieldValue--multi": r.multiline }
|
|
3031
3040
|
])
|
|
3032
|
-
}, v(
|
|
3041
|
+
}, v(r.value), 3)
|
|
3033
3042
|
]))), 128)) : b("", !0)
|
|
3034
3043
|
])) : b("", !0)
|
|
3035
3044
|
]);
|
|
@@ -3037,13 +3046,13 @@ function $s(e, t, s, r, a, n) {
|
|
|
3037
3046
|
const Ks = /* @__PURE__ */ P(Bs, [["render", $s], ["__scopeId", "data-v-7eae0e4a"]]);
|
|
3038
3047
|
function Ws(e, t, s) {
|
|
3039
3048
|
if (!e) return "";
|
|
3040
|
-
const
|
|
3041
|
-
if (Number.isNaN(
|
|
3042
|
-
const a =
|
|
3049
|
+
const i = new Date(e);
|
|
3050
|
+
if (Number.isNaN(i.getTime())) return e;
|
|
3051
|
+
const a = i.toLocaleDateString(t, {
|
|
3043
3052
|
day: "numeric",
|
|
3044
3053
|
month: "long",
|
|
3045
3054
|
year: "numeric"
|
|
3046
|
-
}), n =
|
|
3055
|
+
}), n = i.toLocaleTimeString(t, {
|
|
3047
3056
|
hour: "2-digit",
|
|
3048
3057
|
minute: "2-digit"
|
|
3049
3058
|
});
|
|
@@ -3117,7 +3126,7 @@ const Gs = {
|
|
|
3117
3126
|
key: 1,
|
|
3118
3127
|
class: "wm-art__footer wm-tk__footer"
|
|
3119
3128
|
};
|
|
3120
|
-
function ar(e, t, s,
|
|
3129
|
+
function ar(e, t, s, i, a, n) {
|
|
3121
3130
|
return c(), d("div", Ys, [
|
|
3122
3131
|
o("div", Js, [
|
|
3123
3132
|
o("div", Xs, v(s.data.title), 1),
|
|
@@ -3156,21 +3165,21 @@ function ar(e, t, s, r, a, n) {
|
|
|
3156
3165
|
s.data.body ? (c(), d("div", er, v(s.data.body), 1)) : b("", !0)
|
|
3157
3166
|
]),
|
|
3158
3167
|
n.fields.length ? (c(), d("div", tr, [
|
|
3159
|
-
(c(!0), d(I, null, F(n.fields, (
|
|
3168
|
+
(c(!0), d(I, null, F(n.fields, (r, l) => (c(), d("div", {
|
|
3160
3169
|
key: l,
|
|
3161
3170
|
class: "wm-art__field"
|
|
3162
3171
|
}, [
|
|
3163
|
-
o("div", nr, v(
|
|
3172
|
+
o("div", nr, v(r.label), 1),
|
|
3164
3173
|
o("div", {
|
|
3165
3174
|
class: R([
|
|
3166
3175
|
"wm-art__fieldValue",
|
|
3167
|
-
{ "wm-art__fieldValue--multi":
|
|
3176
|
+
{ "wm-art__fieldValue--multi": r.multiline }
|
|
3168
3177
|
])
|
|
3169
3178
|
}, [
|
|
3170
|
-
n.isPriority(
|
|
3179
|
+
n.isPriority(r.label) ? (c(), d("svg", {
|
|
3171
3180
|
key: 0,
|
|
3172
3181
|
class: "wm-tk__prio",
|
|
3173
|
-
"data-level": n.priorityLevel(
|
|
3182
|
+
"data-level": n.priorityLevel(r.value),
|
|
3174
3183
|
width: "12",
|
|
3175
3184
|
height: "12",
|
|
3176
3185
|
viewBox: "0 0 12 12",
|
|
@@ -3197,7 +3206,7 @@ function ar(e, t, s, r, a, n) {
|
|
|
3197
3206
|
height: "9",
|
|
3198
3207
|
rx: "0.5"
|
|
3199
3208
|
}, null, -1)
|
|
3200
|
-
])], 8, sr)) : n.isDate(
|
|
3209
|
+
])], 8, sr)) : n.isDate(r.label) ? (c(), d("svg", rr, [...t[3] || (t[3] = [
|
|
3201
3210
|
o("rect", {
|
|
3202
3211
|
x: "3",
|
|
3203
3212
|
y: "4",
|
|
@@ -3207,7 +3216,7 @@ function ar(e, t, s, r, a, n) {
|
|
|
3207
3216
|
}, null, -1),
|
|
3208
3217
|
o("path", { d: "M16 2v4M8 2v4M3 10h18" }, null, -1)
|
|
3209
3218
|
])])) : b("", !0),
|
|
3210
|
-
o("span", null, v(
|
|
3219
|
+
o("span", null, v(r.value), 1)
|
|
3211
3220
|
], 2)
|
|
3212
3221
|
]))), 128))
|
|
3213
3222
|
])) : b("", !0),
|
|
@@ -3255,7 +3264,7 @@ const or = /* @__PURE__ */ P(Gs, [["render", ar], ["__scopeId", "data-v-5f30c914
|
|
|
3255
3264
|
}
|
|
3256
3265
|
}
|
|
3257
3266
|
};
|
|
3258
|
-
function dr(e, t, s,
|
|
3267
|
+
function dr(e, t, s, i, a, n) {
|
|
3259
3268
|
return n.component ? (c(), D(Ae(n.component), {
|
|
3260
3269
|
key: 0,
|
|
3261
3270
|
data: s.artifact.data
|
|
@@ -3277,10 +3286,10 @@ const ur = /* @__PURE__ */ P(cr, [["render", dr]]), hr = {
|
|
|
3277
3286
|
},
|
|
3278
3287
|
computed: {
|
|
3279
3288
|
kind() {
|
|
3280
|
-
var s,
|
|
3289
|
+
var s, i;
|
|
3281
3290
|
const e = (s = this.attachment) == null ? void 0 : s.type;
|
|
3282
3291
|
if (e) return e;
|
|
3283
|
-
const t = (((
|
|
3292
|
+
const t = (((i = this.attachment) == null ? void 0 : i.mime_type) || "").toLowerCase();
|
|
3284
3293
|
return t.startsWith("image/") ? "image" : t.startsWith("audio/") ? "audio" : t.startsWith("video/") ? "video" : "file";
|
|
3285
3294
|
},
|
|
3286
3295
|
displayName() {
|
|
@@ -3337,7 +3346,7 @@ const ur = /* @__PURE__ */ P(cr, [["render", dr]]), hr = {
|
|
|
3337
3346
|
class: "wm-att__spin",
|
|
3338
3347
|
"aria-hidden": "true"
|
|
3339
3348
|
};
|
|
3340
|
-
function kr(e, t, s,
|
|
3349
|
+
function kr(e, t, s, i, a, n) {
|
|
3341
3350
|
return c(), d("div", {
|
|
3342
3351
|
class: R(["wm-att", ["wm-att--" + (n.kind || "file")]])
|
|
3343
3352
|
}, [
|
|
@@ -3371,7 +3380,7 @@ function kr(e, t, s, r, a, n) {
|
|
|
3371
3380
|
download: n.displayName,
|
|
3372
3381
|
target: "_blank",
|
|
3373
3382
|
rel: "noopener",
|
|
3374
|
-
onClick: t[0] || (t[0] = (...
|
|
3383
|
+
onClick: t[0] || (t[0] = (...r) => n.onFileClick && n.onFileClick(...r))
|
|
3375
3384
|
}, [
|
|
3376
3385
|
t[1] || (t[1] = o("span", { class: "wm-att__icon" }, [
|
|
3377
3386
|
o("svg", {
|
|
@@ -3410,7 +3419,7 @@ const Cr = /* @__PURE__ */ P(hr, [["render", kr], ["__scopeId", "data-v-b207a8bd
|
|
|
3410
3419
|
}
|
|
3411
3420
|
}
|
|
3412
3421
|
}, Sr = ["innerHTML"];
|
|
3413
|
-
function Mr(e, t, s,
|
|
3422
|
+
function Mr(e, t, s, i, a, n) {
|
|
3414
3423
|
return c(), d("div", {
|
|
3415
3424
|
class: R(["wm-bubble", "wm-bubble--" + s.role])
|
|
3416
3425
|
}, [
|
|
@@ -3420,7 +3429,7 @@ function Mr(e, t, s, r, a, n) {
|
|
|
3420
3429
|
], 2);
|
|
3421
3430
|
}
|
|
3422
3431
|
const Tr = /* @__PURE__ */ P(Ar, [["render", Mr], ["__scopeId", "data-v-7ab13147"]]), xr = { name: "WmTyping" }, Or = { class: "wm-typing" };
|
|
3423
|
-
function Rr(e, t, s,
|
|
3432
|
+
function Rr(e, t, s, i, a, n) {
|
|
3424
3433
|
return c(), d("div", Or, [...t[0] || (t[0] = [
|
|
3425
3434
|
o("span", { style: { "animation-delay": "0s" } }, null, -1),
|
|
3426
3435
|
o("span", { style: { "animation-delay": "0.2s" } }, null, -1),
|
|
@@ -3516,61 +3525,61 @@ const Ir = {
|
|
|
3516
3525
|
return !this.hasMore && !this.loadingMore && this.messages.length >= 20;
|
|
3517
3526
|
},
|
|
3518
3527
|
groups() {
|
|
3519
|
-
var s,
|
|
3528
|
+
var s, i, a, n;
|
|
3520
3529
|
const e = [];
|
|
3521
|
-
for (const
|
|
3522
|
-
const l = this.roleOf(
|
|
3530
|
+
for (const r of this.messages) {
|
|
3531
|
+
const l = this.roleOf(r);
|
|
3523
3532
|
if (l === "system") {
|
|
3524
|
-
if (((s =
|
|
3533
|
+
if (((s = r == null ? void 0 : r.payload) == null ? void 0 : s.event) === "action_admin_pending") {
|
|
3525
3534
|
const w = e[e.length - 1];
|
|
3526
|
-
w && w.role === "ai" ? w.messages.push(
|
|
3527
|
-
key: `g-${ee(
|
|
3535
|
+
w && w.role === "ai" ? w.messages.push(r) : e.push({
|
|
3536
|
+
key: `g-${ee(r)}`,
|
|
3528
3537
|
role: "ai",
|
|
3529
3538
|
agentName: "",
|
|
3530
3539
|
agentAvatarUrl: null,
|
|
3531
|
-
messages: [
|
|
3540
|
+
messages: [r],
|
|
3532
3541
|
items: []
|
|
3533
3542
|
});
|
|
3534
3543
|
continue;
|
|
3535
3544
|
}
|
|
3536
3545
|
e.push({
|
|
3537
|
-
key: `sys-${ee(
|
|
3546
|
+
key: `sys-${ee(r)}`,
|
|
3538
3547
|
role: l,
|
|
3539
|
-
messages: [
|
|
3548
|
+
messages: [r],
|
|
3540
3549
|
items: [],
|
|
3541
|
-
systemLabel: this.systemLabel(
|
|
3550
|
+
systemLabel: this.systemLabel(r)
|
|
3542
3551
|
});
|
|
3543
3552
|
continue;
|
|
3544
3553
|
}
|
|
3545
3554
|
const _ = e[e.length - 1];
|
|
3546
|
-
_ && _.role === l && (l === "ai" || _.agentName === (((
|
|
3547
|
-
key: `g-${ee(
|
|
3555
|
+
_ && _.role === l && (l === "ai" || _.agentName === (((i = r == null ? void 0 : r.author) == null ? void 0 : i.name) || "")) ? _.messages.push(r) : e.push({
|
|
3556
|
+
key: `g-${ee(r)}`,
|
|
3548
3557
|
role: l,
|
|
3549
|
-
agentName: ((a =
|
|
3550
|
-
agentAvatarUrl: ((n =
|
|
3551
|
-
messages: [
|
|
3558
|
+
agentName: ((a = r == null ? void 0 : r.author) == null ? void 0 : a.name) || "",
|
|
3559
|
+
agentAvatarUrl: ((n = r == null ? void 0 : r.author) == null ? void 0 : n.avatar_url) || null,
|
|
3560
|
+
messages: [r],
|
|
3552
3561
|
items: []
|
|
3553
3562
|
});
|
|
3554
3563
|
}
|
|
3555
|
-
for (const
|
|
3556
|
-
if (
|
|
3564
|
+
for (const r of e) {
|
|
3565
|
+
if (r.role === "system") continue;
|
|
3557
3566
|
const l = [];
|
|
3558
|
-
for (const _ of
|
|
3567
|
+
for (const _ of r.messages)
|
|
3559
3568
|
for (const k of this.itemsOf(_)) l.push(k);
|
|
3560
|
-
|
|
3569
|
+
r.items = l;
|
|
3561
3570
|
}
|
|
3562
3571
|
const t = [];
|
|
3563
|
-
for (const
|
|
3564
|
-
if (
|
|
3572
|
+
for (const r of e) {
|
|
3573
|
+
if (r.role !== "system" && !r.items.length) continue;
|
|
3565
3574
|
const l = t[t.length - 1];
|
|
3566
|
-
if (l && l.role !== "system" && l.role ===
|
|
3567
|
-
l.messages.push(...
|
|
3575
|
+
if (l && l.role !== "system" && l.role === r.role && (r.role === "ai" || l.agentName === r.agentName)) {
|
|
3576
|
+
l.messages.push(...r.messages), l.items.push(...r.items);
|
|
3568
3577
|
continue;
|
|
3569
3578
|
}
|
|
3570
|
-
t.push(
|
|
3579
|
+
t.push(r);
|
|
3571
3580
|
}
|
|
3572
|
-
for (const
|
|
3573
|
-
|
|
3581
|
+
for (const r of t)
|
|
3582
|
+
r.role !== "system" && (r.key = this.stableGroupKey(r.messages));
|
|
3574
3583
|
return t;
|
|
3575
3584
|
},
|
|
3576
3585
|
// Key of the first non-user group that starts after the unread
|
|
@@ -3581,10 +3590,10 @@ const Ir = {
|
|
|
3581
3590
|
const e = this.unreadAnchorId, t = this.unreadBoundaryTs;
|
|
3582
3591
|
for (const s of this.groups) {
|
|
3583
3592
|
if (s.role === "user" || s.role === "system" || !s.items.length) continue;
|
|
3584
|
-
const
|
|
3585
|
-
if (!
|
|
3586
|
-
const a = Y(
|
|
3587
|
-
if (a != null && !(a <= e) && !(t &&
|
|
3593
|
+
const i = s.messages[0];
|
|
3594
|
+
if (!i) continue;
|
|
3595
|
+
const a = Y(i.id);
|
|
3596
|
+
if (a != null && !(a <= e) && !(t && i.created_at && i.created_at > t))
|
|
3588
3597
|
return s.key;
|
|
3589
3598
|
}
|
|
3590
3599
|
return null;
|
|
@@ -3622,16 +3631,16 @@ const Ir = {
|
|
|
3622
3631
|
this._groupIdByMsgKey || (this._groupIdByMsgKey = /* @__PURE__ */ new Map(), this._groupIdCounter = 0);
|
|
3623
3632
|
const t = this._groupIdByMsgKey;
|
|
3624
3633
|
let s = null;
|
|
3625
|
-
for (const
|
|
3626
|
-
const a = ee(
|
|
3634
|
+
for (const i of e) {
|
|
3635
|
+
const a = ee(i);
|
|
3627
3636
|
if (a && t.has(a)) {
|
|
3628
3637
|
s = t.get(a);
|
|
3629
3638
|
break;
|
|
3630
3639
|
}
|
|
3631
3640
|
}
|
|
3632
3641
|
s == null && (s = ++this._groupIdCounter);
|
|
3633
|
-
for (const
|
|
3634
|
-
const a = ee(
|
|
3642
|
+
for (const i of e) {
|
|
3643
|
+
const a = ee(i);
|
|
3635
3644
|
a && t.set(a, s);
|
|
3636
3645
|
}
|
|
3637
3646
|
return `g-${s}`;
|
|
@@ -3670,21 +3679,21 @@ const Ir = {
|
|
|
3670
3679
|
const t = this._lastSeenConvId !== this.conversationId;
|
|
3671
3680
|
this._lastSeenConvId = this.conversationId;
|
|
3672
3681
|
const s = this.isAtBottom(e);
|
|
3673
|
-
let
|
|
3682
|
+
let i = null;
|
|
3674
3683
|
if (!t && !s) {
|
|
3675
3684
|
const n = this.pickAnchor(e);
|
|
3676
3685
|
if (n != null && n.rowKey) {
|
|
3677
|
-
const
|
|
3678
|
-
if (
|
|
3686
|
+
const r = this.findRowByKey(e, n.rowKey);
|
|
3687
|
+
if (r) {
|
|
3679
3688
|
const l = e.getBoundingClientRect().top;
|
|
3680
|
-
|
|
3689
|
+
i = {
|
|
3681
3690
|
rowKey: n.rowKey,
|
|
3682
|
-
relY:
|
|
3691
|
+
relY: r.getBoundingClientRect().top - l
|
|
3683
3692
|
};
|
|
3684
3693
|
}
|
|
3685
3694
|
}
|
|
3686
3695
|
}
|
|
3687
|
-
const a = { forceBottom: t, wasPinned: s, anchor:
|
|
3696
|
+
const a = { forceBottom: t, wasPinned: s, anchor: i };
|
|
3688
3697
|
this._scrollSnap = a, this.$nextTick(() => {
|
|
3689
3698
|
if (this._scrollSnap = null, a.forceBottom || a.wasPinned) {
|
|
3690
3699
|
e.scrollTop = e.scrollHeight;
|
|
@@ -3692,9 +3701,9 @@ const Ir = {
|
|
|
3692
3701
|
}
|
|
3693
3702
|
if (!a.anchor) return;
|
|
3694
3703
|
const n = () => {
|
|
3695
|
-
const
|
|
3704
|
+
const r = a.anchor, l = this.findRowByKey(e, r.rowKey);
|
|
3696
3705
|
if (!l) return;
|
|
3697
|
-
const k = l.getBoundingClientRect().top - e.getBoundingClientRect().top -
|
|
3706
|
+
const k = l.getBoundingClientRect().top - e.getBoundingClientRect().top - r.relY;
|
|
3698
3707
|
Math.abs(k) > 0.5 && (e.scrollTop += k);
|
|
3699
3708
|
};
|
|
3700
3709
|
n(), requestAnimationFrame(() => {
|
|
@@ -3726,11 +3735,11 @@ const Ir = {
|
|
|
3726
3735
|
// very-top-of-scroll edge case the same way the old logic did.
|
|
3727
3736
|
pickAnchor(e) {
|
|
3728
3737
|
const t = e.getBoundingClientRect().top, s = e.querySelectorAll(".wm-list__row[data-row-key]");
|
|
3729
|
-
let
|
|
3738
|
+
let i = null;
|
|
3730
3739
|
for (const a of s)
|
|
3731
|
-
if (
|
|
3740
|
+
if (i || (i = a), a.getBoundingClientRect().bottom >= t)
|
|
3732
3741
|
return { rowKey: a.dataset.rowKey };
|
|
3733
|
-
return
|
|
3742
|
+
return i ? { rowKey: i.dataset.rowKey } : null;
|
|
3734
3743
|
},
|
|
3735
3744
|
findRowByKey(e, t) {
|
|
3736
3745
|
if (!t) return null;
|
|
@@ -3740,10 +3749,10 @@ const Ir = {
|
|
|
3740
3749
|
);
|
|
3741
3750
|
},
|
|
3742
3751
|
roleOf(e) {
|
|
3743
|
-
var s,
|
|
3752
|
+
var s, i;
|
|
3744
3753
|
if ((e == null ? void 0 : e.type) === "system" || ((s = e == null ? void 0 : e.payload) == null ? void 0 : s.type) === "system")
|
|
3745
3754
|
return "system";
|
|
3746
|
-
const t = (
|
|
3755
|
+
const t = (i = e == null ? void 0 : e.author) == null ? void 0 : i.type;
|
|
3747
3756
|
return t === "user" ? "user" : t === "agent_human" ? "human" : "ai";
|
|
3748
3757
|
},
|
|
3749
3758
|
roleLabel(e) {
|
|
@@ -3842,9 +3851,9 @@ const Ir = {
|
|
|
3842
3851
|
// doit garder son arrondi.
|
|
3843
3852
|
cornersFor(e, t) {
|
|
3844
3853
|
var Q, se, re;
|
|
3845
|
-
const s = e.items,
|
|
3846
|
-
let
|
|
3847
|
-
return
|
|
3854
|
+
const s = e.items, i = (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, r = 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";
|
|
3855
|
+
let U = l, N = l, L = l, K = l;
|
|
3856
|
+
return r ? (k && (N = _), (w || !n) && (L = _), k && M(E, k, i == null ? void 0 : i.top) && (U = _), w && M(A, w, i == null ? void 0 : i.bottom) && (K = _)) : (k && (U = _), (w || !n) && (K = _), k && M(E, k, i == null ? void 0 : i.top) && (N = _), w && M(A, w, i == null ? void 0 : i.bottom) && (L = _)), { tl: U, tr: N, br: L, bl: K };
|
|
3848
3857
|
},
|
|
3849
3858
|
// Inline column-count for the mosaic grid, capped at 4. Single
|
|
3850
3859
|
// attachment falls back to the vertical-list layout (null). Two
|
|
@@ -3867,8 +3876,8 @@ const Ir = {
|
|
|
3867
3876
|
// corners of every top-row cell flatten too.
|
|
3868
3877
|
mosaicCornerStyle(e, t, s) {
|
|
3869
3878
|
if (!t || t < 2) return null;
|
|
3870
|
-
const
|
|
3871
|
-
return (
|
|
3879
|
+
const i = Math.min(t, 4), a = Math.floor(e / i), n = e % i, r = n > 0, l = n < i - 1 && e + 1 < t, _ = a > 0, k = e + i < t, w = "4px", T = {};
|
|
3880
|
+
return (r || _) && (T["--wm-r-tl"] = w), (l || _) && (T["--wm-r-tr"] = w), (r || 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;
|
|
3872
3881
|
},
|
|
3873
3882
|
// Inline style emitting the four corner CSS variables. Set on
|
|
3874
3883
|
// `.wm-list__row` so they cascade to Bubble/ActionResult/
|
|
@@ -3887,8 +3896,8 @@ const Ir = {
|
|
|
3887
3896
|
// Clé unique par item de cluster, alignée avec `:key` /
|
|
3888
3897
|
// `data-row-key` du template. Sert d'index dans `widthByKey`.
|
|
3889
3898
|
rowKeyOf(e, t) {
|
|
3890
|
-
var
|
|
3891
|
-
const s = (
|
|
3899
|
+
var i;
|
|
3900
|
+
const s = (i = e == null ? void 0 : e.items) == null ? void 0 : i[t];
|
|
3892
3901
|
return s ? `${ee(s.message)}-${s.partKey}` : "";
|
|
3893
3902
|
},
|
|
3894
3903
|
// rAF-debouncé : `updated()` peut être appelé en rafale (stream,
|
|
@@ -3909,20 +3918,20 @@ const Ir = {
|
|
|
3909
3918
|
for (const n of e.querySelectorAll(
|
|
3910
3919
|
".wm-list__row[data-row-key]"
|
|
3911
3920
|
)) {
|
|
3912
|
-
const
|
|
3913
|
-
if (!
|
|
3921
|
+
const r = n.dataset.rowKey;
|
|
3922
|
+
if (!r) continue;
|
|
3914
3923
|
const l = n.querySelector(
|
|
3915
3924
|
".wm-bubble, .wm-result, .wm-art, .wm-list__body"
|
|
3916
3925
|
);
|
|
3917
3926
|
if (!l) continue;
|
|
3918
3927
|
const _ = l.getBoundingClientRect().width;
|
|
3919
|
-
_ > 0 && (t[
|
|
3928
|
+
_ > 0 && (t[r] = _);
|
|
3920
3929
|
}
|
|
3921
|
-
const s = this.widthByKey,
|
|
3922
|
-
if (
|
|
3930
|
+
const s = this.widthByKey, i = Object.keys(s), a = Object.keys(t);
|
|
3931
|
+
if (i.length === a.length) {
|
|
3923
3932
|
let n = !0;
|
|
3924
|
-
for (const
|
|
3925
|
-
if (Math.abs((s[
|
|
3933
|
+
for (const r of a)
|
|
3934
|
+
if (Math.abs((s[r] ?? 0) - t[r]) > 0.5) {
|
|
3926
3935
|
n = !1;
|
|
3927
3936
|
break;
|
|
3928
3937
|
}
|
|
@@ -3992,19 +4001,19 @@ const Ir = {
|
|
|
3992
4001
|
return ((t = e == null ? void 0 : e.payload) == null ? void 0 : t.name) || (e == null ? void 0 : e.text_md) || this.t("common.action");
|
|
3993
4002
|
},
|
|
3994
4003
|
actionDetail(e) {
|
|
3995
|
-
var s,
|
|
4004
|
+
var s, i, a, n, r, l;
|
|
3996
4005
|
const t = e == null ? void 0 : e.payload;
|
|
3997
|
-
return t ? t.state === "success" ? ((s = t.success) == null ? void 0 : s.summary) || ((a = (
|
|
4006
|
+
return t ? t.state === "success" ? ((s = t.success) == null ? void 0 : s.summary) || ((a = (i = t.success) == null ? void 0 : i.metadata) == null ? void 0 : a.description) || "" : t.state === "rejected" ? ((n = t.rejected) == null ? void 0 : n.reason) || this.t("action.rejectedByUser") : t.state === "failure" && (((r = t.failure) == null ? void 0 : r.summary) || ((l = t.failure) == null ? void 0 : l.error)) || "" : "";
|
|
3998
4007
|
},
|
|
3999
4008
|
actionArtifact(e) {
|
|
4000
|
-
var s,
|
|
4001
|
-
const t = (
|
|
4009
|
+
var s, i;
|
|
4010
|
+
const t = (i = (s = e == null ? void 0 : e.payload) == null ? void 0 : s.success) == null ? void 0 : i.artifact;
|
|
4002
4011
|
return !t || typeof t != "object" || typeof t.kind != "string" ? null : t;
|
|
4003
4012
|
},
|
|
4004
4013
|
systemLabel(e) {
|
|
4005
|
-
var a, n,
|
|
4006
|
-
const t = (a = e == null ? void 0 : e.payload) == null ? void 0 : a.event, s = Ir[t],
|
|
4007
|
-
return s ? this.t(s, { name:
|
|
4014
|
+
var a, n, r;
|
|
4015
|
+
const t = (a = e == null ? void 0 : e.payload) == null ? void 0 : a.event, s = Ir[t], i = ((n = e == null ? void 0 : e.metadata) == null ? void 0 : n.agent_name) || ((r = e == null ? void 0 : e.author) == null ? void 0 : r.name) || this.t("messageList.anAgent");
|
|
4016
|
+
return s ? this.t(s, { name: i }) : (e == null ? void 0 : e.text_md) || this.t("messageList.conversationUpdate");
|
|
4008
4017
|
},
|
|
4009
4018
|
scrollToBottom() {
|
|
4010
4019
|
const e = this.$refs.scrollEl;
|
|
@@ -4018,12 +4027,12 @@ const Ir = {
|
|
|
4018
4027
|
e && (typeof e.scrollTo == "function" ? e.scrollTo({ top: e.scrollHeight, behavior: "smooth" }) : e.scrollTop = e.scrollHeight, this.showScrollDown = !1);
|
|
4019
4028
|
}
|
|
4020
4029
|
}
|
|
4021
|
-
}, Dr = { class: "wm-list__wrap" },
|
|
4030
|
+
}, Dr = { class: "wm-list__wrap" }, Ur = {
|
|
4022
4031
|
key: 0,
|
|
4023
4032
|
class: "wm-list__loadMore",
|
|
4024
4033
|
role: "status",
|
|
4025
4034
|
"aria-live": "polite"
|
|
4026
|
-
},
|
|
4035
|
+
}, Nr = { class: "wm-list__loadMore-lbl" }, Fr = {
|
|
4027
4036
|
key: 1,
|
|
4028
4037
|
class: "wm-list__historyEnd"
|
|
4029
4038
|
}, jr = {
|
|
@@ -4048,20 +4057,20 @@ const Ir = {
|
|
|
4048
4057
|
key: 3,
|
|
4049
4058
|
class: "wm-list__row wm-list__row--ai fade-up"
|
|
4050
4059
|
}, ti = { class: "wm-list__avatarSlot" }, ni = ["aria-label", "title"];
|
|
4051
|
-
function si(e, t, s,
|
|
4052
|
-
const
|
|
4060
|
+
function si(e, t, s, i, a, n) {
|
|
4061
|
+
const r = B("AIAvatar"), l = B("HumanAvatar"), _ = B("ActionResult"), k = B("ArtifactRenderer"), w = B("Bubble"), T = B("AttachmentPreview"), E = B("Typing");
|
|
4053
4062
|
return c(), d("div", Dr, [
|
|
4054
4063
|
o("div", {
|
|
4055
4064
|
ref: "scrollEl",
|
|
4056
4065
|
class: R(["wm-list", { "wm-list--silent": a.silentFades }]),
|
|
4057
4066
|
onScrollPassive: t[4] || (t[4] = (...A) => n.onScroll && n.onScroll(...A))
|
|
4058
4067
|
}, [
|
|
4059
|
-
s.loadingMore ? (c(), d("div",
|
|
4068
|
+
s.loadingMore ? (c(), d("div", Ur, [
|
|
4060
4069
|
t[6] || (t[6] = o("span", {
|
|
4061
4070
|
class: "wm-list__loadMore-spinner",
|
|
4062
4071
|
"aria-hidden": "true"
|
|
4063
4072
|
}, null, -1)),
|
|
4064
|
-
o("span",
|
|
4073
|
+
o("span", Nr, v(n.t("messageList.loadingHistory")), 1)
|
|
4065
4074
|
])) : n.historyExhausted ? (c(), d("div", Fr, v(n.t("messageList.conversationStart")), 1)) : b("", !0),
|
|
4066
4075
|
s.dateLabel ? (c(), d("div", jr, [
|
|
4067
4076
|
t[7] || (t[7] = o("div", { class: "wm-list__line" }, null, -1)),
|
|
@@ -4085,7 +4094,7 @@ function si(e, t, s, r, a, n) {
|
|
|
4085
4094
|
o("span", $r, v(A.systemLabel), 1),
|
|
4086
4095
|
t[12] || (t[12] = o("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
|
|
4087
4096
|
])) : (c(), d(I, { key: 1 }, [
|
|
4088
|
-
(c(!0), d(I, null, F(A.items, (M,
|
|
4097
|
+
(c(!0), d(I, null, F(A.items, (M, U) => (c(), d(I, {
|
|
4089
4098
|
key: `${n.messageKey(M.message)}-${M.partKey}`
|
|
4090
4099
|
}, [
|
|
4091
4100
|
o("div", {
|
|
@@ -4097,17 +4106,17 @@ function si(e, t, s, r, a, n) {
|
|
|
4097
4106
|
"is-failed": M.message._failed
|
|
4098
4107
|
}
|
|
4099
4108
|
]]),
|
|
4100
|
-
style: z(n.cornersStyle(A,
|
|
4101
|
-
onPointerdown: (
|
|
4102
|
-
onPointerup: t[0] || (t[0] = (
|
|
4103
|
-
onPointercancel: t[1] || (t[1] = (
|
|
4104
|
-
onPointerleave: t[2] || (t[2] = (
|
|
4109
|
+
style: z(n.cornersStyle(A, U)),
|
|
4110
|
+
onPointerdown: (N) => n.onPressStart(`${n.messageKey(M.message)}-${M.partKey}`),
|
|
4111
|
+
onPointerup: t[0] || (t[0] = (N) => n.onPressEnd()),
|
|
4112
|
+
onPointercancel: t[1] || (t[1] = (N) => n.onPressEnd()),
|
|
4113
|
+
onPointerleave: t[2] || (t[2] = (N) => n.onPressEnd()),
|
|
4105
4114
|
onContextmenu: t[3] || (t[3] = J(() => {
|
|
4106
4115
|
}, ["prevent"]))
|
|
4107
4116
|
}, [
|
|
4108
4117
|
A.role !== "user" ? (c(), d("div", Wr, [
|
|
4109
|
-
|
|
4110
|
-
A.role === "ai" ? (c(), D(
|
|
4118
|
+
U === A.items.length - 1 ? (c(), d(I, { key: 0 }, [
|
|
4119
|
+
A.role === "ai" ? (c(), D(r, {
|
|
4111
4120
|
key: 0,
|
|
4112
4121
|
size: 26,
|
|
4113
4122
|
tail: !0,
|
|
@@ -4163,9 +4172,9 @@ function si(e, t, s, r, a, n) {
|
|
|
4163
4172
|
}, [
|
|
4164
4173
|
(c(!0), d(I, null, F(n.attachmentsOf(
|
|
4165
4174
|
M.message
|
|
4166
|
-
), (
|
|
4175
|
+
), (N, L) => (c(), D(T, {
|
|
4167
4176
|
key: `${n.messageKey(M.message)}-att-${L}`,
|
|
4168
|
-
attachment:
|
|
4177
|
+
attachment: N,
|
|
4169
4178
|
style: z(
|
|
4170
4179
|
n.mosaicCornerStyle(
|
|
4171
4180
|
L,
|
|
@@ -4177,7 +4186,7 @@ function si(e, t, s, r, a, n) {
|
|
|
4177
4186
|
], 6)) : b("", !0)
|
|
4178
4187
|
], 2))
|
|
4179
4188
|
], 46, Kr),
|
|
4180
|
-
|
|
4189
|
+
U < A.items.length - 1 && a.pressedItemKey === `${n.messageKey(M.message)}-${M.partKey}` && (A.role !== "user" || n.timeOf(M.message)) ? (c(), d("div", {
|
|
4181
4190
|
key: 0,
|
|
4182
4191
|
class: R(["wm-list__meta wm-list__meta--press", { "wm-list__meta--right": A.role === "user" }])
|
|
4183
4192
|
}, [
|
|
@@ -4199,7 +4208,7 @@ function si(e, t, s, r, a, n) {
|
|
|
4199
4208
|
], 64))), 128)),
|
|
4200
4209
|
s.streamingActive ? (c(), d("div", ei, [
|
|
4201
4210
|
o("div", ti, [
|
|
4202
|
-
$(
|
|
4211
|
+
$(r, {
|
|
4203
4212
|
size: 26,
|
|
4204
4213
|
tail: !0,
|
|
4205
4214
|
name: s.aiAgentName,
|
|
@@ -4209,7 +4218,7 @@ function si(e, t, s, r, a, n) {
|
|
|
4209
4218
|
$(E)
|
|
4210
4219
|
])) : b("", !0)
|
|
4211
4220
|
], 34),
|
|
4212
|
-
$(
|
|
4221
|
+
$(Ne, { name: "wm-scrollDown" }, {
|
|
4213
4222
|
default: Fe(() => [
|
|
4214
4223
|
a.showScrollDown ? (c(), d("button", {
|
|
4215
4224
|
key: 0,
|
|
@@ -4246,8 +4255,8 @@ function ii() {
|
|
|
4246
4255
|
"video/webm",
|
|
4247
4256
|
"video/mp4"
|
|
4248
4257
|
].find((t) => {
|
|
4249
|
-
var s,
|
|
4250
|
-
return (
|
|
4258
|
+
var s, i;
|
|
4259
|
+
return (i = (s = window.MediaRecorder).isTypeSupported) == null ? void 0 : i.call(s, t);
|
|
4251
4260
|
}) || "";
|
|
4252
4261
|
}
|
|
4253
4262
|
function Ve({ audio: e }) {
|
|
@@ -4285,15 +4294,15 @@ async function ai() {
|
|
|
4285
4294
|
async function oi(e) {
|
|
4286
4295
|
const t = document.createElement("video");
|
|
4287
4296
|
t.muted = !0, t.playsInline = !0, t.srcObject = e, await t.play(), await new Promise((l) => requestAnimationFrame(l));
|
|
4288
|
-
const s = t.videoWidth || 1280,
|
|
4289
|
-
a.width = s, a.height =
|
|
4297
|
+
const s = t.videoWidth || 1280, i = t.videoHeight || 720, a = document.createElement("canvas");
|
|
4298
|
+
a.width = s, a.height = i, a.getContext("2d").drawImage(t, 0, 0, s, i);
|
|
4290
4299
|
const n = await new Promise((l, _) => {
|
|
4291
4300
|
a.toBlob(
|
|
4292
4301
|
(k) => k ? l(k) : _(new Error("toBlob failed")),
|
|
4293
4302
|
"image/png"
|
|
4294
4303
|
);
|
|
4295
|
-
}),
|
|
4296
|
-
return new File([n], `capture-${
|
|
4304
|
+
}), r = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
4305
|
+
return new File([n], `capture-${r}.png`, { type: "image/png" });
|
|
4297
4306
|
}
|
|
4298
4307
|
async function li(e = {}) {
|
|
4299
4308
|
var k;
|
|
@@ -4307,42 +4316,42 @@ async function li(e = {}) {
|
|
|
4307
4316
|
return (w == null ? void 0 : w.name) !== "NotAllowedError" && console.error("[media] record picker", w), null;
|
|
4308
4317
|
}
|
|
4309
4318
|
const s = ii();
|
|
4310
|
-
let
|
|
4319
|
+
let i;
|
|
4311
4320
|
try {
|
|
4312
|
-
|
|
4321
|
+
i = s ? new window.MediaRecorder(t, { mimeType: s }) : new window.MediaRecorder(t);
|
|
4313
4322
|
} catch (w) {
|
|
4314
4323
|
return console.error("[media] recorder init", w), t.getTracks().forEach((T) => {
|
|
4315
4324
|
T.stop();
|
|
4316
4325
|
}), null;
|
|
4317
4326
|
}
|
|
4318
4327
|
const a = [];
|
|
4319
|
-
let n = null,
|
|
4320
|
-
|
|
4328
|
+
let n = null, r = !1;
|
|
4329
|
+
i.addEventListener("dataavailable", (w) => {
|
|
4321
4330
|
w.data && w.data.size > 0 && a.push(w.data);
|
|
4322
|
-
}),
|
|
4331
|
+
}), i.addEventListener("stop", () => {
|
|
4323
4332
|
var w, T;
|
|
4324
4333
|
if (n && clearInterval(n), t.getTracks().forEach((E) => {
|
|
4325
4334
|
E.stop();
|
|
4326
4335
|
}), a.length) {
|
|
4327
|
-
const E =
|
|
4336
|
+
const E = i.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), U = new File([A], `ecran-${M}.${q}`, {
|
|
4328
4337
|
type: E
|
|
4329
4338
|
});
|
|
4330
|
-
(w = e.onfinalize) == null || w.call(e,
|
|
4339
|
+
(w = e.onfinalize) == null || w.call(e, U);
|
|
4331
4340
|
} else
|
|
4332
4341
|
(T = e.oncancel) == null || T.call(e);
|
|
4333
4342
|
}), t.getVideoTracks().forEach((w) => {
|
|
4334
4343
|
w.addEventListener("ended", () => l(), { once: !0 });
|
|
4335
4344
|
});
|
|
4336
4345
|
function l() {
|
|
4337
|
-
if (!
|
|
4346
|
+
if (!r && (r = !0, i.state !== "inactive"))
|
|
4338
4347
|
try {
|
|
4339
|
-
|
|
4348
|
+
i.stop();
|
|
4340
4349
|
} catch (w) {
|
|
4341
4350
|
console.error("[media] recorder stop", w);
|
|
4342
4351
|
}
|
|
4343
4352
|
}
|
|
4344
4353
|
try {
|
|
4345
|
-
|
|
4354
|
+
i.start(1e3);
|
|
4346
4355
|
} catch (w) {
|
|
4347
4356
|
return console.error("[media] recorder start", w), t.getTracks().forEach((T) => {
|
|
4348
4357
|
T.stop();
|
|
@@ -4356,7 +4365,7 @@ async function li(e = {}) {
|
|
|
4356
4365
|
}, 500), {
|
|
4357
4366
|
stop: l,
|
|
4358
4367
|
get state() {
|
|
4359
|
-
return
|
|
4368
|
+
return i.state;
|
|
4360
4369
|
}
|
|
4361
4370
|
};
|
|
4362
4371
|
}
|
|
@@ -4545,7 +4554,7 @@ const ci = [
|
|
|
4545
4554
|
height: "14",
|
|
4546
4555
|
"aria-hidden": "true"
|
|
4547
4556
|
}, pi = ["d"], vi = ["placeholder", "disabled"], yi = { class: "wm-compose__actions" }, wi = ["title", "aria-label", "disabled"], bi = ["disabled", "aria-label"];
|
|
4548
|
-
function ki(e, t, s,
|
|
4557
|
+
function ki(e, t, s, i, a, n) {
|
|
4549
4558
|
return c(), d("div", {
|
|
4550
4559
|
class: R(["wm-compose-wrap", { "wm-compose-wrap--sheet": s.displayMode === "sheet" }]),
|
|
4551
4560
|
style: z(a.kbOffset ? { transform: `translateY(-${a.kbOffset}px)` } : null)
|
|
@@ -4559,37 +4568,37 @@ function ki(e, t, s, r, a, n) {
|
|
|
4559
4568
|
o("button", {
|
|
4560
4569
|
type: "button",
|
|
4561
4570
|
class: "wm-rec__stop",
|
|
4562
|
-
onClick: t[0] || (t[0] = (...
|
|
4571
|
+
onClick: t[0] || (t[0] = (...r) => n.stopRecording && n.stopRecording(...r))
|
|
4563
4572
|
}, v(n.t("composer.stop")), 1)
|
|
4564
4573
|
])) : b("", !0),
|
|
4565
4574
|
o("form", {
|
|
4566
4575
|
class: R(["wm-compose", { "has-attach": a.attachOpen }]),
|
|
4567
|
-
onSubmit: t[7] || (t[7] = J((...
|
|
4576
|
+
onSubmit: t[7] || (t[7] = J((...r) => n.onSubmit && n.onSubmit(...r), ["prevent"]))
|
|
4568
4577
|
}, [
|
|
4569
4578
|
o("input", {
|
|
4570
4579
|
ref: "fileEl",
|
|
4571
4580
|
type: "file",
|
|
4572
4581
|
hidden: "",
|
|
4573
4582
|
multiple: "",
|
|
4574
|
-
onChange: t[1] || (t[1] = (...
|
|
4583
|
+
onChange: t[1] || (t[1] = (...r) => n.onFile && n.onFile(...r))
|
|
4575
4584
|
}, null, 544),
|
|
4576
4585
|
a.attachOpen ? (c(), d("div", {
|
|
4577
4586
|
key: 0,
|
|
4578
4587
|
class: "wm-compose__overlay",
|
|
4579
|
-
onClick: t[2] || (t[2] = (
|
|
4588
|
+
onClick: t[2] || (t[2] = (r) => a.attachOpen = !1)
|
|
4580
4589
|
})) : b("", !0),
|
|
4581
4590
|
a.attachOpen ? (c(), d("div", mi, [
|
|
4582
|
-
(c(!0), d(I, null, F(n.attachItems, (
|
|
4583
|
-
key:
|
|
4591
|
+
(c(!0), d(I, null, F(n.attachItems, (r) => (c(), d("button", {
|
|
4592
|
+
key: r.action,
|
|
4584
4593
|
type: "button",
|
|
4585
4594
|
class: "wm-compose__menuItem",
|
|
4586
|
-
disabled:
|
|
4587
|
-
onClick: (l) => n.onAttachAction(
|
|
4595
|
+
disabled: r.disabled,
|
|
4596
|
+
onClick: (l) => n.onAttachAction(r.action)
|
|
4588
4597
|
}, [
|
|
4589
4598
|
o("span", _i, [
|
|
4590
4599
|
(c(), d("svg", gi, [
|
|
4591
4600
|
o("path", {
|
|
4592
|
-
d:
|
|
4601
|
+
d: r.path,
|
|
4593
4602
|
stroke: "currentColor",
|
|
4594
4603
|
"stroke-width": "1.8",
|
|
4595
4604
|
"stroke-linecap": "round",
|
|
@@ -4598,18 +4607,18 @@ function ki(e, t, s, r, a, n) {
|
|
|
4598
4607
|
}, null, 8, pi)
|
|
4599
4608
|
]))
|
|
4600
4609
|
]),
|
|
4601
|
-
o("span", null, v(
|
|
4610
|
+
o("span", null, v(r.label), 1)
|
|
4602
4611
|
], 8, fi))), 128))
|
|
4603
4612
|
])) : b("", !0),
|
|
4604
4613
|
G(o("textarea", {
|
|
4605
4614
|
ref: "inputEl",
|
|
4606
|
-
"onUpdate:modelValue": t[3] || (t[3] = (
|
|
4615
|
+
"onUpdate:modelValue": t[3] || (t[3] = (r) => a.local = r),
|
|
4607
4616
|
class: "wm-compose__input",
|
|
4608
4617
|
rows: "3",
|
|
4609
4618
|
placeholder: s.placeholder,
|
|
4610
4619
|
disabled: s.disabled,
|
|
4611
|
-
onKeydown: t[4] || (t[4] = (...
|
|
4612
|
-
onInput: t[5] || (t[5] = (...
|
|
4620
|
+
onKeydown: t[4] || (t[4] = (...r) => n.onKeydown && n.onKeydown(...r)),
|
|
4621
|
+
onInput: t[5] || (t[5] = (...r) => n.autosize && n.autosize(...r))
|
|
4613
4622
|
}, null, 40, vi), [
|
|
4614
4623
|
[te, a.local]
|
|
4615
4624
|
]),
|
|
@@ -4620,7 +4629,7 @@ function ki(e, t, s, r, a, n) {
|
|
|
4620
4629
|
title: s.attachLabel,
|
|
4621
4630
|
"aria-label": s.attachLabel,
|
|
4622
4631
|
disabled: a.recording,
|
|
4623
|
-
onClick: t[6] || (t[6] = (
|
|
4632
|
+
onClick: t[6] || (t[6] = (r) => a.attachOpen = !a.attachOpen)
|
|
4624
4633
|
}, [...t[9] || (t[9] = [
|
|
4625
4634
|
o("svg", {
|
|
4626
4635
|
width: "13",
|
|
@@ -4678,18 +4687,18 @@ const Ci = /* @__PURE__ */ P(di, [["render", ki], ["__scopeId", "data-v-01e81a27
|
|
|
4678
4687
|
}
|
|
4679
4688
|
}
|
|
4680
4689
|
}, Si = ["onClick"];
|
|
4681
|
-
function Mi(e, t, s,
|
|
4690
|
+
function Mi(e, t, s, i, a, n) {
|
|
4682
4691
|
return s.items.length ? (c(), d("div", {
|
|
4683
4692
|
key: n.batchKey,
|
|
4684
4693
|
class: "wm-chips"
|
|
4685
4694
|
}, [
|
|
4686
|
-
(c(!0), d(I, null, F(s.items, (
|
|
4695
|
+
(c(!0), d(I, null, F(s.items, (r, l) => (c(), d("button", {
|
|
4687
4696
|
key: l,
|
|
4688
4697
|
type: "button",
|
|
4689
4698
|
class: "wm-chip",
|
|
4690
4699
|
style: z({ animationDelay: s.baseDelay + l * s.stepDelay + "ms" }),
|
|
4691
|
-
onClick: (_) => e.$emit("select",
|
|
4692
|
-
}, v(
|
|
4700
|
+
onClick: (_) => e.$emit("select", r)
|
|
4701
|
+
}, v(r.label), 13, Si))), 128))
|
|
4693
4702
|
])) : b("", !0);
|
|
4694
4703
|
}
|
|
4695
4704
|
const Ti = /* @__PURE__ */ P(Ai, [["render", Mi], ["__scopeId", "data-v-47ad8085"]]), xi = {
|
|
@@ -4740,12 +4749,12 @@ const Ti = /* @__PURE__ */ P(Ai, [["render", Mi], ["__scopeId", "data-v-47ad8085
|
|
|
4740
4749
|
key: 0,
|
|
4741
4750
|
class: "wm-approval__detail"
|
|
4742
4751
|
}, Pi = { class: "wm-approval__actions" };
|
|
4743
|
-
function Di(e, t, s,
|
|
4744
|
-
const
|
|
4752
|
+
function Di(e, t, s, i, a, n) {
|
|
4753
|
+
const r = B("AIAvatar");
|
|
4745
4754
|
return c(), d("div", Oi, [
|
|
4746
4755
|
o("div", Ri, [
|
|
4747
4756
|
o("div", Li, [
|
|
4748
|
-
$(
|
|
4757
|
+
$(r, {
|
|
4749
4758
|
size: 24,
|
|
4750
4759
|
name: s.agentName,
|
|
4751
4760
|
"image-url": s.agentAvatarUrl
|
|
@@ -4772,9 +4781,9 @@ function Di(e, t, s, r, a, n) {
|
|
|
4772
4781
|
])
|
|
4773
4782
|
]);
|
|
4774
4783
|
}
|
|
4775
|
-
const
|
|
4784
|
+
const Ui = /* @__PURE__ */ P(xi, [["render", Di], ["__scopeId", "data-v-a2bed37e"]]);
|
|
4776
4785
|
let De = 0;
|
|
4777
|
-
const
|
|
4786
|
+
const Ni = /* @__PURE__ */ new Set([
|
|
4778
4787
|
"text",
|
|
4779
4788
|
"textarea",
|
|
4780
4789
|
"number",
|
|
@@ -4812,7 +4821,7 @@ const Ui = /* @__PURE__ */ new Set([
|
|
|
4812
4821
|
// douteux.
|
|
4813
4822
|
normalizedFields() {
|
|
4814
4823
|
var t;
|
|
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) || !
|
|
4824
|
+
return (Array.isArray((t = this.form) == null ? void 0 : t.fields) ? this.form.fields : []).filter((s) => !(!(s != null && s.key) || !(s != null && s.label) || !Ni.has(s == null ? void 0 : s.type) || (s.type === "select" || s.type === "multiselect") && (!Array.isArray(s.options) || s.options.length === 0)));
|
|
4816
4825
|
}
|
|
4817
4826
|
},
|
|
4818
4827
|
created() {
|
|
@@ -4831,8 +4840,8 @@ const Ui = /* @__PURE__ */ new Set([
|
|
|
4831
4840
|
this.values = t, this.error = "";
|
|
4832
4841
|
},
|
|
4833
4842
|
toggleMulti(e, t, s) {
|
|
4834
|
-
const
|
|
4835
|
-
s && a === -1 ?
|
|
4843
|
+
const i = Array.isArray(this.values[e]) ? this.values[e].slice() : [], a = i.indexOf(t);
|
|
4844
|
+
s && a === -1 ? i.push(t) : !s && a !== -1 && i.splice(a, 1), this.values = { ...this.values, [e]: i };
|
|
4836
4845
|
},
|
|
4837
4846
|
validate() {
|
|
4838
4847
|
for (const e of this.normalizedFields) {
|
|
@@ -4892,12 +4901,12 @@ const Ui = /* @__PURE__ */ new Set([
|
|
|
4892
4901
|
key: 2,
|
|
4893
4902
|
class: "wm-form__doneLbl"
|
|
4894
4903
|
};
|
|
4895
|
-
function ca(e, t, s,
|
|
4896
|
-
const
|
|
4904
|
+
function ca(e, t, s, i, a, n) {
|
|
4905
|
+
const r = B("AIAvatar");
|
|
4897
4906
|
return c(), d("div", ji, [
|
|
4898
4907
|
o("div", Hi, [
|
|
4899
4908
|
o("div", zi, [
|
|
4900
|
-
$(
|
|
4909
|
+
$(r, {
|
|
4901
4910
|
size: 24,
|
|
4902
4911
|
name: s.agentName,
|
|
4903
4912
|
"image-url": s.agentAvatarUrl
|
|
@@ -5067,7 +5076,7 @@ const da = /* @__PURE__ */ P(Fi, [["render", ca], ["__scopeId", "data-v-fe65cc56
|
|
|
5067
5076
|
key: 1,
|
|
5068
5077
|
class: "wm-fb__done"
|
|
5069
5078
|
}, ba = { class: "wm-fb__doneTitle" }, ka = { class: "wm-fb__doneSub" };
|
|
5070
|
-
function Ca(e, t, s,
|
|
5079
|
+
function Ca(e, t, s, i, a, n) {
|
|
5071
5080
|
return c(), d("div", ha, [
|
|
5072
5081
|
s.done ? (c(), d("div", wa, [
|
|
5073
5082
|
t[1] || (t[1] = o("div", { class: "wm-fb__check" }, [
|
|
@@ -5091,21 +5100,21 @@ function Ca(e, t, s, r, a, n) {
|
|
|
5091
5100
|
o("div", ma, v(n.t("feedback.question")), 1),
|
|
5092
5101
|
o("div", fa, v(n.t("feedback.subtitle")), 1),
|
|
5093
5102
|
o("div", _a, [
|
|
5094
|
-
(c(!0), d(I, null, F(n.options, (
|
|
5095
|
-
key:
|
|
5103
|
+
(c(!0), d(I, null, F(n.options, (r) => (c(), d("button", {
|
|
5104
|
+
key: r.v,
|
|
5096
5105
|
type: "button",
|
|
5097
|
-
class: R(["wm-fb__opt", { "is-selected": a.sel ===
|
|
5098
|
-
onClick: (l) => a.sel =
|
|
5106
|
+
class: R(["wm-fb__opt", { "is-selected": a.sel === r.v }]),
|
|
5107
|
+
onClick: (l) => a.sel = r.v
|
|
5099
5108
|
}, [
|
|
5100
|
-
o("span", pa, v(
|
|
5101
|
-
o("span", va, v(
|
|
5109
|
+
o("span", pa, v(r.e), 1),
|
|
5110
|
+
o("span", va, v(r.l), 1)
|
|
5102
5111
|
], 10, ga))), 128))
|
|
5103
5112
|
]),
|
|
5104
5113
|
o("button", {
|
|
5105
5114
|
type: "button",
|
|
5106
5115
|
class: "wm-fb__send",
|
|
5107
5116
|
disabled: !a.sel || s.busy,
|
|
5108
|
-
onClick: t[0] || (t[0] = (...
|
|
5117
|
+
onClick: t[0] || (t[0] = (...r) => n.onSend && n.onSend(...r))
|
|
5109
5118
|
}, v(s.busy ? n.t("common.sending") : n.t("feedback.submit")), 9, ya)
|
|
5110
5119
|
], 64))
|
|
5111
5120
|
]);
|
|
@@ -5155,11 +5164,11 @@ const Aa = /* @__PURE__ */ P(ua, [["render", Ca], ["__scopeId", "data-v-9b630564
|
|
|
5155
5164
|
key: 1,
|
|
5156
5165
|
class: "wm-mm__sep"
|
|
5157
5166
|
}, 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
|
|
5167
|
+
function Ua(e, t, s, i, a, n) {
|
|
5159
5168
|
return c(), d("div", Ma, [
|
|
5160
5169
|
o("div", {
|
|
5161
5170
|
class: "wm-mm__scrim",
|
|
5162
|
-
onClick: t[0] || (t[0] = (
|
|
5171
|
+
onClick: t[0] || (t[0] = (r) => e.$emit("close"))
|
|
5163
5172
|
}),
|
|
5164
5173
|
o("div", Ta, [
|
|
5165
5174
|
s.canRename || s.canExport ? (c(), d("div", xa, [
|
|
@@ -5167,7 +5176,7 @@ function Na(e, t, s, r, a, n) {
|
|
|
5167
5176
|
key: 0,
|
|
5168
5177
|
type: "button",
|
|
5169
5178
|
class: "wm-mm__item",
|
|
5170
|
-
onClick: t[1] || (t[1] = (
|
|
5179
|
+
onClick: t[1] || (t[1] = (r) => n.emit("rename"))
|
|
5171
5180
|
}, [
|
|
5172
5181
|
t[6] || (t[6] = o("span", { class: "wm-mm__icon" }, [
|
|
5173
5182
|
o("svg", {
|
|
@@ -5191,7 +5200,7 @@ function Na(e, t, s, r, a, n) {
|
|
|
5191
5200
|
key: 1,
|
|
5192
5201
|
type: "button",
|
|
5193
5202
|
class: "wm-mm__item",
|
|
5194
|
-
onClick: t[2] || (t[2] = (
|
|
5203
|
+
onClick: t[2] || (t[2] = (r) => n.emit("export"))
|
|
5195
5204
|
}, [
|
|
5196
5205
|
t[7] || (t[7] = o("span", { class: "wm-mm__icon" }, [
|
|
5197
5206
|
o("svg", {
|
|
@@ -5217,7 +5226,7 @@ function Na(e, t, s, r, a, n) {
|
|
|
5217
5226
|
o("button", {
|
|
5218
5227
|
type: "button",
|
|
5219
5228
|
class: "wm-mm__item",
|
|
5220
|
-
onClick: t[3] || (t[3] = (...
|
|
5229
|
+
onClick: t[3] || (t[3] = (...r) => n.toggleSound && n.toggleSound(...r))
|
|
5221
5230
|
}, [
|
|
5222
5231
|
t[10] || (t[10] = o("span", { class: "wm-mm__icon" }, [
|
|
5223
5232
|
o("svg", {
|
|
@@ -5249,7 +5258,7 @@ function Na(e, t, s, r, a, n) {
|
|
|
5249
5258
|
key: 0,
|
|
5250
5259
|
type: "button",
|
|
5251
5260
|
class: "wm-mm__item",
|
|
5252
|
-
onClick: t[4] || (t[4] = (
|
|
5261
|
+
onClick: t[4] || (t[4] = (r) => n.emit("status"))
|
|
5253
5262
|
}, [
|
|
5254
5263
|
t[11] || (t[11] = o("span", { class: "wm-mm__icon" }, [
|
|
5255
5264
|
o("svg", {
|
|
@@ -5272,7 +5281,7 @@ function Na(e, t, s, r, a, n) {
|
|
|
5272
5281
|
key: 1,
|
|
5273
5282
|
type: "button",
|
|
5274
5283
|
class: "wm-mm__item",
|
|
5275
|
-
onClick: t[5] || (t[5] = (
|
|
5284
|
+
onClick: t[5] || (t[5] = (r) => n.emit("help"))
|
|
5276
5285
|
}, [
|
|
5277
5286
|
t[12] || (t[12] = o("span", { class: "wm-mm__icon" }, [
|
|
5278
5287
|
o("svg", {
|
|
@@ -5295,7 +5304,7 @@ function Na(e, t, s, r, a, n) {
|
|
|
5295
5304
|
])
|
|
5296
5305
|
]);
|
|
5297
5306
|
}
|
|
5298
|
-
const
|
|
5307
|
+
const Na = /* @__PURE__ */ P(Sa, [["render", Ua], ["__scopeId", "data-v-4cf6d578"]]), Fa = {
|
|
5299
5308
|
name: "WmRenameDialog",
|
|
5300
5309
|
inject: {
|
|
5301
5310
|
// Translator shared by the Messenger shell; French fallback when
|
|
@@ -5342,11 +5351,11 @@ const Ua = /* @__PURE__ */ P(Sa, [["render", Na], ["__scopeId", "data-v-4cf6d578
|
|
|
5342
5351
|
role: "dialog",
|
|
5343
5352
|
"aria-modal": "true"
|
|
5344
5353
|
}, 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"];
|
|
5345
|
-
function Ya(e, t, s,
|
|
5354
|
+
function Ya(e, t, s, i, a, n) {
|
|
5346
5355
|
return c(), d("div", ja, [
|
|
5347
5356
|
o("div", {
|
|
5348
5357
|
class: "wm-dialog__scrim",
|
|
5349
|
-
onClick: t[0] || (t[0] = (
|
|
5358
|
+
onClick: t[0] || (t[0] = (r) => e.$emit("close"))
|
|
5350
5359
|
}),
|
|
5351
5360
|
o("div", Ha, [
|
|
5352
5361
|
o("div", za, [
|
|
@@ -5355,7 +5364,7 @@ function Ya(e, t, s, r, a, n) {
|
|
|
5355
5364
|
type: "button",
|
|
5356
5365
|
class: "wm-dialog__close",
|
|
5357
5366
|
"aria-label": n.t("common.close"),
|
|
5358
|
-
onClick: t[1] || (t[1] = (
|
|
5367
|
+
onClick: t[1] || (t[1] = (r) => e.$emit("close"))
|
|
5359
5368
|
}, [...t[7] || (t[7] = [
|
|
5360
5369
|
o("svg", {
|
|
5361
5370
|
width: "12",
|
|
@@ -5375,14 +5384,14 @@ function Ya(e, t, s, r, a, n) {
|
|
|
5375
5384
|
o("div", $a, [
|
|
5376
5385
|
G(o("input", {
|
|
5377
5386
|
ref: "input",
|
|
5378
|
-
"onUpdate:modelValue": t[2] || (t[2] = (
|
|
5387
|
+
"onUpdate:modelValue": t[2] || (t[2] = (r) => a.value = r),
|
|
5379
5388
|
type: "text",
|
|
5380
5389
|
class: "wm-dialog__input",
|
|
5381
5390
|
placeholder: s.placeholder || n.t("rename.placeholder"),
|
|
5382
5391
|
maxlength: 120,
|
|
5383
5392
|
onKeydown: [
|
|
5384
|
-
t[3] || (t[3] = ge(J((...
|
|
5385
|
-
t[4] || (t[4] = ge(J((
|
|
5393
|
+
t[3] || (t[3] = ge(J((...r) => n.onSubmit && n.onSubmit(...r), ["prevent"]), ["enter"])),
|
|
5394
|
+
t[4] || (t[4] = ge(J((r) => e.$emit("close"), ["prevent"]), ["esc"]))
|
|
5386
5395
|
]
|
|
5387
5396
|
}, null, 40, Ka), [
|
|
5388
5397
|
[te, a.value]
|
|
@@ -5392,19 +5401,19 @@ function Ya(e, t, s, r, a, n) {
|
|
|
5392
5401
|
o("button", {
|
|
5393
5402
|
type: "button",
|
|
5394
5403
|
class: "wm-dialog__btn",
|
|
5395
|
-
onClick: t[5] || (t[5] = (
|
|
5404
|
+
onClick: t[5] || (t[5] = (r) => e.$emit("close"))
|
|
5396
5405
|
}, v(n.t("common.cancel")), 1),
|
|
5397
5406
|
o("button", {
|
|
5398
5407
|
type: "button",
|
|
5399
5408
|
class: "wm-dialog__btn wm-dialog__btn--primary",
|
|
5400
5409
|
disabled: !n.canSubmit,
|
|
5401
|
-
onClick: t[6] || (t[6] = (...
|
|
5410
|
+
onClick: t[6] || (t[6] = (...r) => n.onSubmit && n.onSubmit(...r))
|
|
5402
5411
|
}, v(n.t("common.save")), 9, Ga)
|
|
5403
5412
|
])
|
|
5404
5413
|
])
|
|
5405
5414
|
]);
|
|
5406
5415
|
}
|
|
5407
|
-
const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8"]]),
|
|
5416
|
+
const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8"]]), Ue = "ww-messenger-tokens", Xa = {
|
|
5408
5417
|
name: "Messenger",
|
|
5409
5418
|
components: {
|
|
5410
5419
|
Launcher: qt,
|
|
@@ -5414,10 +5423,10 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5414
5423
|
MessageList: ri,
|
|
5415
5424
|
Composer: Ci,
|
|
5416
5425
|
SuggestionChips: Ti,
|
|
5417
|
-
ApprovalCard:
|
|
5426
|
+
ApprovalCard: Ui,
|
|
5418
5427
|
FormCard: da,
|
|
5419
5428
|
Feedback: Aa,
|
|
5420
|
-
MoreMenu:
|
|
5429
|
+
MoreMenu: Na,
|
|
5421
5430
|
RenameDialog: Ja
|
|
5422
5431
|
},
|
|
5423
5432
|
mixins: [
|
|
@@ -5576,8 +5585,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5576
5585
|
// so the choice applies immediately, before the boot round-trip
|
|
5577
5586
|
// that materializes `state.customer` has completed.
|
|
5578
5587
|
customerLanguage() {
|
|
5579
|
-
var s,
|
|
5580
|
-
const e = (s = this.s) == null ? void 0 : s.customer, t = e && (e.language || ((
|
|
5588
|
+
var s, i, a, n;
|
|
5589
|
+
const e = (s = this.s) == null ? void 0 : s.customer, t = e && (e.language || ((i = e.values) == null ? void 0 : i.language));
|
|
5581
5590
|
return t || ((n = (a = this.context) == null ? void 0 : a.customer) == null ? void 0 : n.language) || "";
|
|
5582
5591
|
},
|
|
5583
5592
|
// Resolved UI language, by priority:
|
|
@@ -5625,10 +5634,10 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5625
5634
|
drawerConversations() {
|
|
5626
5635
|
var s;
|
|
5627
5636
|
const e = ((s = this.s) == null ? void 0 : s.messagesByConv) || {}, t = this.revealedAt;
|
|
5628
|
-
return this.allConversations.map((
|
|
5637
|
+
return this.allConversations.map((i) => {
|
|
5629
5638
|
var k;
|
|
5630
|
-
const a = e[
|
|
5631
|
-
let
|
|
5639
|
+
const a = e[i.id] || [], n = Y(i.last_read_message_id);
|
|
5640
|
+
let r = 0, l = null;
|
|
5632
5641
|
for (let w = a.length - 1; w >= 0; w--) {
|
|
5633
5642
|
const T = a[w];
|
|
5634
5643
|
if (!T) continue;
|
|
@@ -5636,21 +5645,21 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5636
5645
|
const E = Y(T.id);
|
|
5637
5646
|
if (E != null) {
|
|
5638
5647
|
if (n != null && E <= n) break;
|
|
5639
|
-
t[T.id] !== 0 && (!l && T.author && (l = T.author),
|
|
5648
|
+
t[T.id] !== 0 && (!l && T.author && (l = T.author), r++);
|
|
5640
5649
|
}
|
|
5641
5650
|
}
|
|
5642
5651
|
if (!a.length) {
|
|
5643
|
-
const w = Y(
|
|
5644
|
-
w != null && (n == null || w > n) && (
|
|
5652
|
+
const w = Y(i.last_message_id);
|
|
5653
|
+
w != null && (n == null || w > n) && (r = 1, l = i.last_message_author || null);
|
|
5645
5654
|
}
|
|
5646
5655
|
const _ = a.filter(
|
|
5647
5656
|
(w) => !((w == null ? void 0 : w.id) != null && t[w.id] === 0)
|
|
5648
5657
|
);
|
|
5649
5658
|
return {
|
|
5650
|
-
...
|
|
5651
|
-
_preview: _t(
|
|
5652
|
-
_unread:
|
|
5653
|
-
_unreadCount:
|
|
5659
|
+
...i,
|
|
5660
|
+
_preview: _t(i, _),
|
|
5661
|
+
_unread: r > 0,
|
|
5662
|
+
_unreadCount: r,
|
|
5654
5663
|
_lastAuthor: l
|
|
5655
5664
|
};
|
|
5656
5665
|
});
|
|
@@ -5673,7 +5682,7 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5673
5682
|
unread: !!s._unread,
|
|
5674
5683
|
author: s._lastAuthor || null,
|
|
5675
5684
|
_ts: Be(s, e[s.id] || [])
|
|
5676
|
-
})).sort((s,
|
|
5685
|
+
})).sort((s, i) => s._ts < i._ts ? 1 : s._ts > i._ts ? -1 : 0);
|
|
5677
5686
|
},
|
|
5678
5687
|
// Unread threads (one entry per conv with unseen agent/human
|
|
5679
5688
|
// activity), freshest first. Each entry carries everything the
|
|
@@ -5682,19 +5691,19 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5682
5691
|
latestUnreads() {
|
|
5683
5692
|
var s;
|
|
5684
5693
|
const e = ((s = this.s) == null ? void 0 : s.messagesByConv) || {}, t = [];
|
|
5685
|
-
for (const
|
|
5686
|
-
if (!
|
|
5687
|
-
const a = Be(
|
|
5694
|
+
for (const i of this.drawerConversations) {
|
|
5695
|
+
if (!i._unread) continue;
|
|
5696
|
+
const a = Be(i, e[i.id] || []), n = i._lastAuthor, r = !n || n.type === "agent_ia", l = (n == null ? void 0 : n.name) || (r ? this.agentName : "") || "", _ = (n == null ? void 0 : n.avatar_url) || (r ? this.agentAvatarUrl : null);
|
|
5688
5697
|
t.push({
|
|
5689
|
-
convId:
|
|
5690
|
-
preview:
|
|
5698
|
+
convId: i.id,
|
|
5699
|
+
preview: i._preview || this.t("notification.youHaveNewMessage"),
|
|
5691
5700
|
ts: a,
|
|
5692
|
-
count:
|
|
5701
|
+
count: i._unreadCount || 1,
|
|
5693
5702
|
senderName: l,
|
|
5694
5703
|
senderAvatarUrl: _
|
|
5695
5704
|
});
|
|
5696
5705
|
}
|
|
5697
|
-
return t.sort((
|
|
5706
|
+
return t.sort((i, a) => i.ts < a.ts ? 1 : i.ts > a.ts ? -1 : 0), t;
|
|
5698
5707
|
},
|
|
5699
5708
|
// Notification cards shown in the closed-launcher stack: the unread
|
|
5700
5709
|
// threads above, minus any the user has dismissed (×) for their
|
|
@@ -5730,7 +5739,7 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5730
5739
|
var s;
|
|
5731
5740
|
const e = (s = this.widget) == null ? void 0 : s.quick_links;
|
|
5732
5741
|
if (!Array.isArray(e)) return "";
|
|
5733
|
-
const t = e.find((
|
|
5742
|
+
const t = e.find((i) => i.icon === "status" && i.url);
|
|
5734
5743
|
return (t == null ? void 0 : t.url) || "";
|
|
5735
5744
|
},
|
|
5736
5745
|
helpUrl() {
|
|
@@ -5738,7 +5747,7 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5738
5747
|
const e = (s = this.widget) == null ? void 0 : s.quick_links;
|
|
5739
5748
|
if (!Array.isArray(e)) return "";
|
|
5740
5749
|
const t = e.find(
|
|
5741
|
-
(
|
|
5750
|
+
(i) => (i.icon === "chat" || i.icon === "help") && i.url
|
|
5742
5751
|
);
|
|
5743
5752
|
return (t == null ? void 0 : t.url) || "";
|
|
5744
5753
|
},
|
|
@@ -5805,11 +5814,11 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5805
5814
|
// Last message from a human agent in the current conversation —
|
|
5806
5815
|
// used to surface the human agent's name + avatar in the header.
|
|
5807
5816
|
humanMessageAuthor() {
|
|
5808
|
-
var t, s,
|
|
5817
|
+
var t, s, i;
|
|
5809
5818
|
if (!this.currentConv) return null;
|
|
5810
5819
|
const e = ((t = this.s.messagesByConv) == null ? void 0 : t[this.currentConv.id]) || [];
|
|
5811
5820
|
for (let a = e.length - 1; a >= 0; a--)
|
|
5812
|
-
if (((
|
|
5821
|
+
if (((i = (s = e[a]) == null ? void 0 : s.author) == null ? void 0 : i.type) === "agent_human")
|
|
5813
5822
|
return e[a].author;
|
|
5814
5823
|
return null;
|
|
5815
5824
|
},
|
|
@@ -5847,32 +5856,32 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5847
5856
|
if (!e) return [];
|
|
5848
5857
|
const t = this.welcomeRevealedAt[e.id] > 0 ? this.buildWelcomePrefix(e) : [];
|
|
5849
5858
|
if (!e._draft) {
|
|
5850
|
-
const
|
|
5851
|
-
if (!(
|
|
5859
|
+
const r = (n = (a = this.s) == null ? void 0 : a.paginationByConv) == null ? void 0 : n[e.id];
|
|
5860
|
+
if (!(r != null && r.loaded)) return t;
|
|
5852
5861
|
}
|
|
5853
|
-
const s = this.revealedAt,
|
|
5862
|
+
const s = this.revealedAt, i = (this.s.messagesByConv[e.id] || []).filter((r) => {
|
|
5854
5863
|
var l, _, k, w, T;
|
|
5855
|
-
return (
|
|
5864
|
+
return (r == null ? void 0 : r.type) === "action" && ((l = r == null ? void 0 : r.payload) == null ? void 0 : l.state) === "pending" || he(r) && !(s[r.id] > 0) ? !1 : (r == null ? void 0 : r.type) === "action" || (r == null ? void 0 : r.type) === "system" || ((_ = r == null ? void 0 : r.payload) == null ? void 0 : _.type) === "system" || Array.isArray((k = r == null ? void 0 : r.payload) == null ? void 0 : k.attachments) && r.payload.attachments.length || (w = r == null ? void 0 : r.metadata) != null && w.artifact || (T = r == null ? void 0 : r.metadata) != null && T.form ? !0 : typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0;
|
|
5856
5865
|
});
|
|
5857
|
-
return t.length ? [...t, ...
|
|
5866
|
+
return t.length ? [...t, ...i] : i;
|
|
5858
5867
|
},
|
|
5859
5868
|
// True whenever we should show the "typing" indicator at the bottom
|
|
5860
5869
|
// of the list: either the LLM is actively streaming tokens, or one
|
|
5861
5870
|
// or more agent messages are queued and waiting for their reveal
|
|
5862
5871
|
// slot to fire.
|
|
5863
5872
|
streamingActive() {
|
|
5864
|
-
var s,
|
|
5873
|
+
var s, i, a;
|
|
5865
5874
|
const e = this.currentConv;
|
|
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 = (
|
|
5875
|
+
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 = (i = this.s) == null ? void 0 : i.messagesByConv) == null ? void 0 : a[e.id]) || []).some(
|
|
5867
5876
|
(n) => he(n) && !(this.revealedAt[n.id] > 0)
|
|
5868
5877
|
) : !1;
|
|
5869
5878
|
},
|
|
5870
5879
|
// Internal: the raw persisted list for the current conversation. We
|
|
5871
5880
|
// watch this to detect new agent messages that need to be paced.
|
|
5872
5881
|
currentConvMessages() {
|
|
5873
|
-
var t, s,
|
|
5882
|
+
var t, s, i;
|
|
5874
5883
|
const e = (t = this.currentConv) == null ? void 0 : t.id;
|
|
5875
|
-
return e ? ((
|
|
5884
|
+
return e ? ((i = (s = this.s) == null ? void 0 : s.messagesByConv) == null ? void 0 : i[e]) || [] : [];
|
|
5876
5885
|
},
|
|
5877
5886
|
pendingApproval() {
|
|
5878
5887
|
return !this.currentConv || !this.store || this.actionInFlight ? null : this.store.getPendingApproval(this.currentConv.id);
|
|
@@ -5889,11 +5898,11 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5889
5898
|
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");
|
|
5890
5899
|
},
|
|
5891
5900
|
approvalDetail() {
|
|
5892
|
-
var
|
|
5893
|
-
const e = (n = (a = (
|
|
5901
|
+
var i, a, n, r, l, _;
|
|
5902
|
+
const e = (n = (a = (i = this.pendingApproval) == null ? void 0 : i.payload) == null ? void 0 : a.pending) == null ? void 0 : n.user_explanation;
|
|
5894
5903
|
if (typeof e == "string" && e.trim())
|
|
5895
5904
|
return e.trim();
|
|
5896
|
-
const t = (_ = (l = (
|
|
5905
|
+
const t = (_ = (l = (r = this.pendingApproval) == null ? void 0 : r.payload) == null ? void 0 : l.pending) == null ? void 0 : _.prepared_params;
|
|
5897
5906
|
if (!t || typeof t != "object") return "";
|
|
5898
5907
|
const s = Object.entries(t);
|
|
5899
5908
|
return s.length ? s.slice(0, 2).map(([k, w]) => `${k}: ${w}`).join(" · ") : "";
|
|
@@ -5916,9 +5925,9 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5916
5925
|
// welcome bubble is client-side only and intentionally not
|
|
5917
5926
|
// counted here.
|
|
5918
5927
|
conversationIsEmpty() {
|
|
5919
|
-
var s,
|
|
5928
|
+
var s, i;
|
|
5920
5929
|
const e = this.currentConv;
|
|
5921
|
-
return e ? e._draft ? !0 : (((
|
|
5930
|
+
return e ? e._draft ? !0 : (((i = (s = this.s) == null ? void 0 : s.messagesByConv) == null ? void 0 : i[e.id]) || []).length === 0 : !1;
|
|
5922
5931
|
},
|
|
5923
5932
|
// Maps `widget.starter_prompts` ({ title, message }) into the
|
|
5924
5933
|
// SuggestionChips shape so they render alongside / in place of
|
|
@@ -5931,11 +5940,11 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5931
5940
|
const e = (s = this.widget) == null ? void 0 : s.starter_prompts;
|
|
5932
5941
|
if (!Array.isArray(e)) return [];
|
|
5933
5942
|
const t = [];
|
|
5934
|
-
for (const
|
|
5935
|
-
if (!
|
|
5936
|
-
const a = typeof
|
|
5943
|
+
for (const i of e) {
|
|
5944
|
+
if (!i || typeof i != "object") continue;
|
|
5945
|
+
const a = typeof i.title == "string" ? i.title.trim() : "";
|
|
5937
5946
|
if (!a) continue;
|
|
5938
|
-
const n = typeof
|
|
5947
|
+
const n = typeof i.message == "string" ? i.message.trim() : "";
|
|
5939
5948
|
t.push({
|
|
5940
5949
|
label: a,
|
|
5941
5950
|
text: n || a,
|
|
@@ -5962,13 +5971,13 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5962
5971
|
return this.approvalReady || !!this.pendingForm || this.showFeedback || this.suggestions.length > 0;
|
|
5963
5972
|
},
|
|
5964
5973
|
dateLabel() {
|
|
5965
|
-
var s,
|
|
5974
|
+
var s, i, a;
|
|
5966
5975
|
const e = this.currentConv;
|
|
5967
5976
|
let t = /* @__PURE__ */ new Date();
|
|
5968
5977
|
if (e) {
|
|
5969
|
-
const
|
|
5970
|
-
if (
|
|
5971
|
-
const l = new Date(
|
|
5978
|
+
const r = ((a = (((i = (s = this.s) == null ? void 0 : s.messagesByConv) == null ? void 0 : i[e.id]) || []).find((l) => l == null ? void 0 : l.created_at)) == null ? void 0 : a.created_at) || e.created_at;
|
|
5979
|
+
if (r) {
|
|
5980
|
+
const l = new Date(r);
|
|
5972
5981
|
Number.isNaN(l.getTime()) || (t = l);
|
|
5973
5982
|
}
|
|
5974
5983
|
}
|
|
@@ -5981,8 +5990,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5981
5990
|
// history available, nothing loading) so the loader stays inert
|
|
5982
5991
|
// until `openConversation` has populated the entry.
|
|
5983
5992
|
paginationState() {
|
|
5984
|
-
var s,
|
|
5985
|
-
const e = (s = this.currentConv) == null ? void 0 : s.id, t = e ? (a = (
|
|
5993
|
+
var s, i, a;
|
|
5994
|
+
const e = (s = this.currentConv) == null ? void 0 : s.id, t = e ? (a = (i = this.s) == null ? void 0 : i.paginationByConv) == null ? void 0 : a[e] : null;
|
|
5986
5995
|
return {
|
|
5987
5996
|
loading: !!(t != null && t.loading),
|
|
5988
5997
|
hasMore: !!(t != null && t.nextCursor)
|
|
@@ -5997,12 +6006,12 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5997
6006
|
// ts comparison in `launcherPeeks`.
|
|
5998
6007
|
latestUnreads: {
|
|
5999
6008
|
handler(e) {
|
|
6000
|
-
const t = new Set(e.map((
|
|
6001
|
-
if (!
|
|
6009
|
+
const t = new Set(e.map((r) => r.convId)), s = this.dismissedPeeks || {}, i = Object.keys(s);
|
|
6010
|
+
if (!i.length) return;
|
|
6002
6011
|
const a = {};
|
|
6003
6012
|
let n = !1;
|
|
6004
|
-
for (const
|
|
6005
|
-
t.has(
|
|
6013
|
+
for (const r of i)
|
|
6014
|
+
t.has(r) ? a[r] = s[r] : n = !0;
|
|
6006
6015
|
n && (this.dismissedPeeks = a);
|
|
6007
6016
|
},
|
|
6008
6017
|
deep: !0
|
|
@@ -6078,9 +6087,9 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6078
6087
|
}
|
|
6079
6088
|
},
|
|
6080
6089
|
async mounted() {
|
|
6081
|
-
if (typeof document < "u" && !document.getElementById(
|
|
6090
|
+
if (typeof document < "u" && !document.getElementById(Ue)) {
|
|
6082
6091
|
const e = document.createElement("style");
|
|
6083
|
-
e.id =
|
|
6092
|
+
e.id = Ue, e.textContent = rt, document.head.appendChild(e);
|
|
6084
6093
|
}
|
|
6085
6094
|
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());
|
|
6086
6095
|
},
|
|
@@ -6116,8 +6125,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6116
6125
|
const t = e == null ? void 0 : e.data;
|
|
6117
6126
|
if (!(!t || typeof t != "object")) {
|
|
6118
6127
|
if (t.type === "UPDATE") {
|
|
6119
|
-
this.transport && t.payload && this.transport.update(t.payload).catch((
|
|
6120
|
-
console.warn("[messenger] update failed",
|
|
6128
|
+
this.transport && t.payload && this.transport.update(t.payload).catch((i) => {
|
|
6129
|
+
console.warn("[messenger] update failed", i);
|
|
6121
6130
|
});
|
|
6122
6131
|
return;
|
|
6123
6132
|
}
|
|
@@ -6125,8 +6134,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6125
6134
|
this.transport && t.payload && this.transport.context(t.payload);
|
|
6126
6135
|
return;
|
|
6127
6136
|
}
|
|
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((
|
|
6129
|
-
console.warn("[messenger] eager boot failed",
|
|
6137
|
+
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((i) => {
|
|
6138
|
+
console.warn("[messenger] eager boot failed", i);
|
|
6130
6139
|
}));
|
|
6131
6140
|
}
|
|
6132
6141
|
},
|
|
@@ -6160,8 +6169,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6160
6169
|
variables: e && typeof e == "object" ? e : void 0
|
|
6161
6170
|
}), e && typeof e == "object") {
|
|
6162
6171
|
const t = {};
|
|
6163
|
-
for (const [s,
|
|
6164
|
-
s !== "customer" &&
|
|
6172
|
+
for (const [s, i] of Object.entries(e))
|
|
6173
|
+
s !== "customer" && i && typeof i == "object" && !Array.isArray(i) && (t[s] = i);
|
|
6165
6174
|
Object.keys(t).length > 0 && this.transport.context(t);
|
|
6166
6175
|
}
|
|
6167
6176
|
this.setupLiveReveal();
|
|
@@ -6187,12 +6196,12 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6187
6196
|
return;
|
|
6188
6197
|
}
|
|
6189
6198
|
this.floatRO = new ResizeObserver((s) => {
|
|
6190
|
-
const
|
|
6191
|
-
if (!
|
|
6192
|
-
const a = Math.ceil(
|
|
6199
|
+
const i = s[0];
|
|
6200
|
+
if (!i) return;
|
|
6201
|
+
const a = Math.ceil(i.contentRect.height + 8);
|
|
6193
6202
|
a !== this.floatHeight && (this.floatHeight = a, this.$nextTick(() => {
|
|
6194
|
-
var n,
|
|
6195
|
-
(
|
|
6203
|
+
var n, r;
|
|
6204
|
+
(r = (n = this.$refs.messageList) == null ? void 0 : n.scrollToBottom) == null || r.call(n);
|
|
6196
6205
|
}));
|
|
6197
6206
|
}), this.floatRO.observe(t);
|
|
6198
6207
|
}
|
|
@@ -6246,37 +6255,37 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6246
6255
|
this.launcherHovered = e, this.sendCurrentLauncherSize();
|
|
6247
6256
|
},
|
|
6248
6257
|
sendCurrentLauncherSize() {
|
|
6249
|
-
var w, T, E, A, q, M,
|
|
6258
|
+
var w, T, E, A, q, M, U;
|
|
6250
6259
|
if (this.isOpen) return;
|
|
6251
6260
|
const e = (T = (w = this.$el) == null ? void 0 : w.querySelector) == null ? void 0 : T.call(w, ".wm-launcherWrap");
|
|
6252
6261
|
if (!e) return;
|
|
6253
6262
|
const t = e.getBoundingClientRect();
|
|
6254
6263
|
if (!t.width || !t.height) return;
|
|
6255
|
-
const s = (((E = this.launcherPeeks) == null ? void 0 : E.length) ?? 0) > 0,
|
|
6264
|
+
const s = (((E = this.launcherPeeks) == null ? void 0 : E.length) ?? 0) > 0, i = 16, a = Math.ceil(t.width), n = Math.ceil(t.height), r = (q = (A = this.$el) == null ? void 0 : A.querySelector) == null ? void 0 : q.call(A, ".wm-launcher"), l = (U = (M = this.$el) == null ? void 0 : M.querySelectorAll) == null ? void 0 : U.call(M, ".wm-peek"), _ = l && l.length ? l[l.length - 1] : null;
|
|
6256
6265
|
let k = null;
|
|
6257
6266
|
if (_) {
|
|
6258
|
-
const
|
|
6267
|
+
const N = _.getBoundingClientRect();
|
|
6259
6268
|
k = {
|
|
6260
|
-
width: Math.ceil(
|
|
6261
|
-
height: Math.ceil(
|
|
6262
|
-
rightOffset: Math.max(0, Math.ceil(t.right -
|
|
6263
|
-
bottomOffset: Math.max(0, Math.ceil(t.bottom -
|
|
6269
|
+
width: Math.ceil(N.width),
|
|
6270
|
+
height: Math.ceil(N.height),
|
|
6271
|
+
rightOffset: Math.max(0, Math.ceil(t.right - N.right)),
|
|
6272
|
+
bottomOffset: Math.max(0, Math.ceil(t.bottom - N.bottom))
|
|
6264
6273
|
};
|
|
6265
6274
|
}
|
|
6266
6275
|
this.notifyParentResize("closed", {
|
|
6267
|
-
width: a +
|
|
6268
|
-
height: n +
|
|
6269
|
-
launcherWidth: (
|
|
6270
|
-
launcherHeight: (
|
|
6276
|
+
width: a + i,
|
|
6277
|
+
height: n + i,
|
|
6278
|
+
launcherWidth: (r == null ? void 0 : r.offsetWidth) || null,
|
|
6279
|
+
launcherHeight: (r == null ? void 0 : r.offsetHeight) || null,
|
|
6271
6280
|
launcherHovered: this.launcherHovered,
|
|
6272
6281
|
peek: k,
|
|
6273
6282
|
peekHovered: this.launcherHovered && s
|
|
6274
6283
|
});
|
|
6275
6284
|
},
|
|
6276
6285
|
observeLauncherSize() {
|
|
6277
|
-
var s,
|
|
6286
|
+
var s, i;
|
|
6278
6287
|
if (typeof ResizeObserver > "u") return;
|
|
6279
|
-
const e = (
|
|
6288
|
+
const e = (i = (s = this.$el) == null ? void 0 : s.querySelector) == null ? void 0 : i.call(s, ".wm-launcherWrap");
|
|
6280
6289
|
if (!e) return;
|
|
6281
6290
|
this._launcherRo && this._launcherRo.disconnect();
|
|
6282
6291
|
const t = new ResizeObserver(() => {
|
|
@@ -6287,9 +6296,9 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6287
6296
|
// Opening straight from a notification card: land on that card's
|
|
6288
6297
|
// thread rather than whatever was last active.
|
|
6289
6298
|
async openFromPeek(e) {
|
|
6290
|
-
var s,
|
|
6299
|
+
var s, i;
|
|
6291
6300
|
const t = e || ((s = this.latestUnreads[0]) == null ? void 0 : s.convId);
|
|
6292
|
-
t && t !== ((
|
|
6301
|
+
t && t !== ((i = this.currentConv) == null ? void 0 : i.id) && (this.draftConv = null, this.activeConvId = t, this.showOnboarding = !1, this.showHistory = !1, this.backToHistory = !1), await this.open();
|
|
6293
6302
|
},
|
|
6294
6303
|
// Stamp the dismissed batch ts for a single conv so its card
|
|
6295
6304
|
// disappears from the stack until a fresher message arrives.
|
|
@@ -6389,10 +6398,10 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6389
6398
|
...this.welcomeRevealedAt,
|
|
6390
6399
|
[e]: 0
|
|
6391
6400
|
};
|
|
6392
|
-
const a = this.revealPacing, n = t.trim().length,
|
|
6401
|
+
const a = this.revealPacing, n = t.trim().length, r = Math.min(
|
|
6393
6402
|
a.maxTypingMs,
|
|
6394
6403
|
Math.max(a.minTypingMs, n * a.msPerChar)
|
|
6395
|
-
), l = a.firstRevealDelayMs +
|
|
6404
|
+
), l = a.firstRevealDelayMs + r, _ = setTimeout(() => {
|
|
6396
6405
|
this.welcomeRevealedAt = {
|
|
6397
6406
|
...this.welcomeRevealedAt,
|
|
6398
6407
|
[e]: Date.now()
|
|
@@ -6429,10 +6438,10 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6429
6438
|
this.draftConv = null, this.activeConvId = e.id, this.showOnboarding = !1, this.showHistory = !1, this.backToHistory = t;
|
|
6430
6439
|
try {
|
|
6431
6440
|
await this.store.openConversation(e.id);
|
|
6432
|
-
} catch (
|
|
6433
|
-
console.error("[ww-messenger] open conv failed",
|
|
6441
|
+
} catch (i) {
|
|
6442
|
+
console.error("[ww-messenger] open conv failed", i);
|
|
6434
6443
|
}
|
|
6435
|
-
const s = this.allConversations.find((
|
|
6444
|
+
const s = this.allConversations.find((i) => i.id === e.id);
|
|
6436
6445
|
s && this.markConvRead(s);
|
|
6437
6446
|
},
|
|
6438
6447
|
async onMoreAction(e) {
|
|
@@ -6476,8 +6485,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6476
6485
|
if (!(!s || s === t.name))
|
|
6477
6486
|
try {
|
|
6478
6487
|
await this.store.patchConversation(t.id, { name: s });
|
|
6479
|
-
} catch (
|
|
6480
|
-
console.error("[ww-messenger] rename failed",
|
|
6488
|
+
} catch (i) {
|
|
6489
|
+
console.error("[ww-messenger] rename failed", i);
|
|
6481
6490
|
}
|
|
6482
6491
|
},
|
|
6483
6492
|
// ── Send / suggestion / form / attach / feedback ────────────────
|
|
@@ -6485,10 +6494,10 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6485
6494
|
let t = this.currentConv;
|
|
6486
6495
|
if (!t && (this.startConv(), t = this.currentConv, !t) || t._draft && (t = await this.ensureRealConv(), !t))
|
|
6487
6496
|
return;
|
|
6488
|
-
const s = t.id,
|
|
6497
|
+
const s = t.id, i = this.pendingAttachments.slice();
|
|
6489
6498
|
this.pendingAttachments = [], this.unreadAnchorId = null, this.unreadBoundaryTs = "";
|
|
6490
|
-
const a =
|
|
6491
|
-
const { previewUrl:
|
|
6499
|
+
const a = i.map((n) => {
|
|
6500
|
+
const { previewUrl: r, ...l } = n;
|
|
6492
6501
|
return l;
|
|
6493
6502
|
});
|
|
6494
6503
|
await this.store.send(s, e, {
|
|
@@ -6513,8 +6522,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6513
6522
|
if (!(t != null && t.form)) return;
|
|
6514
6523
|
const s = ht(t.form, e, this.translator);
|
|
6515
6524
|
if (!s) return;
|
|
6516
|
-
let
|
|
6517
|
-
|
|
6525
|
+
let i = this.currentConv;
|
|
6526
|
+
i && (i._draft && (i = await this.ensureRealConv(), !i) || await this.store.send(i.id, s, {
|
|
6518
6527
|
metadata: {
|
|
6519
6528
|
artifact: mt(
|
|
6520
6529
|
t.form,
|
|
@@ -6542,23 +6551,23 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6542
6551
|
var t, s;
|
|
6543
6552
|
if (!(!e || !this.transport))
|
|
6544
6553
|
try {
|
|
6545
|
-
const
|
|
6554
|
+
const i = await this.transport.uploadAttachment(e), a = (i == null ? void 0 : i.type) === "image" || (e.type || "").toLowerCase().startsWith("image/") || ((i == null ? void 0 : i.mime_type) || "").toLowerCase().startsWith("image/");
|
|
6546
6555
|
let n = null;
|
|
6547
6556
|
if (a)
|
|
6548
6557
|
try {
|
|
6549
|
-
n = await ((s = (t = this.store) == null ? void 0 : t.signAttachment) == null ? void 0 : s.call(t,
|
|
6558
|
+
n = await ((s = (t = this.store) == null ? void 0 : t.signAttachment) == null ? void 0 : s.call(t, i.path)) || null;
|
|
6550
6559
|
} catch {
|
|
6551
6560
|
}
|
|
6552
6561
|
this.pendingAttachments.push({
|
|
6553
|
-
type:
|
|
6554
|
-
path:
|
|
6562
|
+
type: i.type || "file",
|
|
6563
|
+
path: i.path,
|
|
6555
6564
|
name: e.name || this.t("attachment.fileFallbackName"),
|
|
6556
6565
|
mime_type: e.type,
|
|
6557
6566
|
size_bytes: e.size,
|
|
6558
6567
|
previewUrl: n
|
|
6559
6568
|
});
|
|
6560
|
-
} catch (
|
|
6561
|
-
console.error("[ww-messenger] attachment upload failed",
|
|
6569
|
+
} catch (i) {
|
|
6570
|
+
console.error("[ww-messenger] attachment upload failed", i);
|
|
6562
6571
|
}
|
|
6563
6572
|
},
|
|
6564
6573
|
// Délégation des clics sur les liens `<a href="#...">` rendus dans le
|
|
@@ -6648,13 +6657,13 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6648
6657
|
key: 0,
|
|
6649
6658
|
class: "wm-attached__fileSize"
|
|
6650
6659
|
}, _o = ["aria-label", "onClick"];
|
|
6651
|
-
function go(e, t, s,
|
|
6652
|
-
const
|
|
6660
|
+
function go(e, t, s, i, a, n) {
|
|
6661
|
+
const r = 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"), U = B("MoreMenu"), N = B("RenameDialog");
|
|
6653
6662
|
return c(), d("div", {
|
|
6654
6663
|
class: R(["wm-root", `wm-root--${s.displayMode}`]),
|
|
6655
6664
|
style: z(n.rootStyle)
|
|
6656
6665
|
}, [
|
|
6657
|
-
!a.isOpen && !n.isEmbedded ? (c(), D(
|
|
6666
|
+
!a.isOpen && !n.isEmbedded ? (c(), D(r, {
|
|
6658
6667
|
key: 0,
|
|
6659
6668
|
"unread-count": n.unreadCount,
|
|
6660
6669
|
peeks: n.launcherPeeks,
|
|
@@ -6861,7 +6870,7 @@ function go(e, t, s, r, a, n) {
|
|
|
6861
6870
|
onAttach: n.onAttach
|
|
6862
6871
|
}, null, 8, ["modelValue", "placeholder", "disabled", "attach-label", "display-mode", "onSend", "onAttach"]))
|
|
6863
6872
|
]),
|
|
6864
|
-
a.moreOpen ? (c(), D(
|
|
6873
|
+
a.moreOpen ? (c(), D(U, {
|
|
6865
6874
|
key: 0,
|
|
6866
6875
|
"can-rename": !!n.currentConv && !n.currentConv._draft,
|
|
6867
6876
|
"can-export": !!n.currentConv && !n.currentConv._draft,
|
|
@@ -6872,7 +6881,7 @@ function go(e, t, s, r, a, n) {
|
|
|
6872
6881
|
onSoundToggle: e.onSoundToggle,
|
|
6873
6882
|
onAction: n.onMoreAction
|
|
6874
6883
|
}, null, 8, ["can-rename", "can-export", "sound-enabled", "status-url", "help-url", "onSoundToggle", "onAction"])) : b("", !0),
|
|
6875
|
-
a.renameDialogOpen && n.currentConv && !n.currentConv._draft ? (c(), D(
|
|
6884
|
+
a.renameDialogOpen && n.currentConv && !n.currentConv._draft ? (c(), D(N, {
|
|
6876
6885
|
key: 1,
|
|
6877
6886
|
"initial-value": n.currentConv.name || "",
|
|
6878
6887
|
title: n.t("rename.dialogTitle"),
|
|
@@ -6893,7 +6902,7 @@ function go(e, t, s, r, a, n) {
|
|
|
6893
6902
|
onResume: n.onDrawerPick,
|
|
6894
6903
|
onViewHistory: t[1] || (t[1] = (L) => a.showHistory = !0)
|
|
6895
6904
|
}, null, 8, ["title", "subtitle", "agent-name", "default-icon-url", "quick-links", "open-threads", "busy", "onStart", "onSelect", "onResume"])),
|
|
6896
|
-
a.moreOpen && !n.currentConv ? (c(), D(
|
|
6905
|
+
a.moreOpen && !n.currentConv ? (c(), D(U, {
|
|
6897
6906
|
key: 4,
|
|
6898
6907
|
"can-rename": !1,
|
|
6899
6908
|
"can-export": !1,
|
|
@@ -6908,12 +6917,12 @@ function go(e, t, s, r, a, n) {
|
|
|
6908
6917
|
], 6)) : b("", !0)
|
|
6909
6918
|
], 6);
|
|
6910
6919
|
}
|
|
6911
|
-
const yo = /* @__PURE__ */ P(Xa, [["render", go], ["__scopeId", "data-v-fa8045f9"]]), wo = "0.5.
|
|
6920
|
+
const yo = /* @__PURE__ */ P(Xa, [["render", go], ["__scopeId", "data-v-fa8045f9"]]), wo = "0.5.74";
|
|
6912
6921
|
export {
|
|
6913
6922
|
oe as AIAvatar,
|
|
6914
6923
|
be as AVATAR_COLORS,
|
|
6915
6924
|
As as ActionResult,
|
|
6916
|
-
|
|
6925
|
+
Ui as ApprovalCard,
|
|
6917
6926
|
Es as ArtifactFormResponse,
|
|
6918
6927
|
Ks as ArtifactInfoCard,
|
|
6919
6928
|
ur as ArtifactRenderer,
|
|
@@ -6931,7 +6940,7 @@ export {
|
|
|
6931
6940
|
Oe as MEDIA_RECORDER_SUPPORTED,
|
|
6932
6941
|
ri as MessageList,
|
|
6933
6942
|
yo as Messenger,
|
|
6934
|
-
|
|
6943
|
+
Na as MoreMenu,
|
|
6935
6944
|
Jn as Onboarding,
|
|
6936
6945
|
pe as SCREEN_CAPTURE_SUPPORTED,
|
|
6937
6946
|
ut as SUPPORTED_LANGUAGES,
|