@_solaris/messenger-widget 0.2.32 → 0.3.0
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/messenger.cjs +9 -9
- package/dist/messenger.embed.js +15 -15
- package/dist/messenger.js +908 -697
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/messenger.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reactive as Ae, openBlock as l, createElementBlock as
|
|
1
|
+
import { reactive as Ae, openBlock as l, createElementBlock as c, createVNode as K, Transition as Se, withCtx as xe, withKeys as ae, withModifiers as X, createElementVNode as i, toDisplayString as b, createCommentVNode as y, normalizeStyle as G, normalizeClass as B, Fragment as T, renderList as D, resolveComponent as I, createBlock as $, createTextVNode as de, resolveDynamicComponent as Te, renderSlot as Me, withDirectives as q, vModelText as J, vModelCheckbox as Oe, vModelSelect as Ie, createStaticVNode as he, markRaw as fe } from "vue";
|
|
2
2
|
const Be = [
|
|
3
3
|
"connected",
|
|
4
4
|
"message",
|
|
@@ -6,7 +6,7 @@ const Be = [
|
|
|
6
6
|
"conversation_updated",
|
|
7
7
|
"config_updated",
|
|
8
8
|
"action_status"
|
|
9
|
-
], Ee = 5 * 60 * 1e3,
|
|
9
|
+
], Ee = 5 * 60 * 1e3, $e = 10 * 60 * 1e3, Le = 5 * 60 * 1e3;
|
|
10
10
|
function Re(t) {
|
|
11
11
|
const e = {
|
|
12
12
|
baseUrl: Fe(t.baseUrl || ""),
|
|
@@ -61,14 +61,14 @@ function Re(t) {
|
|
|
61
61
|
body: p !== void 0 ? JSON.stringify(p) : void 0
|
|
62
62
|
});
|
|
63
63
|
if (!C.ok) {
|
|
64
|
-
const O = await
|
|
64
|
+
const O = await d(C), M = new Error(
|
|
65
65
|
`HTTP ${C.status} ${h} ${f} :: ${(O == null ? void 0 : O.error) || C.statusText}`
|
|
66
66
|
);
|
|
67
|
-
throw
|
|
67
|
+
throw M.status = C.status, M.body = O, M;
|
|
68
68
|
}
|
|
69
69
|
return C.status === 204 ? null : C.json();
|
|
70
70
|
}
|
|
71
|
-
async function
|
|
71
|
+
async function d(h) {
|
|
72
72
|
try {
|
|
73
73
|
return await h.json();
|
|
74
74
|
} catch {
|
|
@@ -80,7 +80,7 @@ function Re(t) {
|
|
|
80
80
|
// Public — no HMAC required.
|
|
81
81
|
fetch(`${e.baseUrl}/widgets/${encodeURIComponent(e.widgetId)}/config`).then(async (p) => {
|
|
82
82
|
if (!p.ok) {
|
|
83
|
-
const C = await
|
|
83
|
+
const C = await d(p);
|
|
84
84
|
throw new Error(`HTTP ${p.status} GET /widgets/:id/config :: ${(C == null ? void 0 : C.error) || p.statusText}`);
|
|
85
85
|
}
|
|
86
86
|
return p.json();
|
|
@@ -114,7 +114,7 @@ function Re(t) {
|
|
|
114
114
|
async function A(h) {
|
|
115
115
|
return (await o("GET", `/conversations/${encodeURIComponent(h)}`)).conversation;
|
|
116
116
|
}
|
|
117
|
-
async function
|
|
117
|
+
async function U(h, f) {
|
|
118
118
|
return (await o("PATCH", `/conversations/${encodeURIComponent(h)}`, f)).conversation;
|
|
119
119
|
}
|
|
120
120
|
async function x(h, f = {}) {
|
|
@@ -126,8 +126,8 @@ function Re(t) {
|
|
|
126
126
|
`/conversations/${encodeURIComponent(h)}/messages${C}`
|
|
127
127
|
);
|
|
128
128
|
}
|
|
129
|
-
async function
|
|
130
|
-
|
|
129
|
+
async function j(h, f) {
|
|
130
|
+
V();
|
|
131
131
|
const p = {
|
|
132
132
|
client_msg_id: f.client_msg_id,
|
|
133
133
|
type: "content",
|
|
@@ -141,14 +141,14 @@ function Re(t) {
|
|
|
141
141
|
p
|
|
142
142
|
);
|
|
143
143
|
}
|
|
144
|
-
async function
|
|
145
|
-
return
|
|
144
|
+
async function P(h, f, p) {
|
|
145
|
+
return V(), o(
|
|
146
146
|
"POST",
|
|
147
147
|
`/messages/${encodeURIComponent(h)}/callbacks/${encodeURIComponent(f)}`,
|
|
148
148
|
p ? { inputs: p } : {}
|
|
149
149
|
);
|
|
150
150
|
}
|
|
151
|
-
async function
|
|
151
|
+
async function F(h) {
|
|
152
152
|
const f = (
|
|
153
153
|
/** @type {File} */
|
|
154
154
|
h.name || "attachment"
|
|
@@ -159,21 +159,21 @@ function Re(t) {
|
|
|
159
159
|
size_bytes: C,
|
|
160
160
|
name: f
|
|
161
161
|
})
|
|
162
|
-
),
|
|
162
|
+
), M = await fetch(O.upload_url, {
|
|
163
163
|
method: "PUT",
|
|
164
164
|
headers: { "Content-Type": p },
|
|
165
165
|
body: h
|
|
166
166
|
});
|
|
167
|
-
if (!
|
|
168
|
-
throw new Error(`HTTP ${
|
|
167
|
+
if (!M.ok)
|
|
168
|
+
throw new Error(`HTTP ${M.status} PUT signed upload`);
|
|
169
169
|
return {
|
|
170
|
-
type:
|
|
170
|
+
type: De(p),
|
|
171
171
|
path: O.path,
|
|
172
172
|
mime_type: p,
|
|
173
173
|
size_bytes: C
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
|
-
async function
|
|
176
|
+
async function H(h) {
|
|
177
177
|
return o(
|
|
178
178
|
"GET",
|
|
179
179
|
`/attachments/sign?path=${encodeURIComponent(h)}`
|
|
@@ -187,18 +187,18 @@ function Re(t) {
|
|
|
187
187
|
}).toString();
|
|
188
188
|
return `${e.baseUrl}/stream?${h}`;
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function z() {
|
|
191
191
|
if (!e.eventSource && !(typeof document < "u" && document.hidden))
|
|
192
192
|
try {
|
|
193
193
|
const h = new EventSource(Y());
|
|
194
194
|
for (const f of Be)
|
|
195
|
-
h.addEventListener(f, (p) =>
|
|
195
|
+
h.addEventListener(f, (p) => Q(f, p.data));
|
|
196
196
|
h.addEventListener("error", () => a("error", new Error("SSE error"))), e.eventSource = h, r("open");
|
|
197
197
|
} catch (h) {
|
|
198
198
|
console.error("[transport] SSE open failed", h), a("error", h);
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function Q(h, f) {
|
|
202
202
|
try {
|
|
203
203
|
const p = JSON.parse(f), C = p && typeof p == "object" && "data" in p ? p.data : p;
|
|
204
204
|
a(h, C);
|
|
@@ -206,30 +206,30 @@ function Re(t) {
|
|
|
206
206
|
console.error("[transport] bad SSE payload", h, p);
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function W() {
|
|
210
210
|
e.eventSource && (e.eventSource.close(), e.eventSource = null), e.connection !== "paused" && r("idle");
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
clearTimeout(e.burstTimer),
|
|
214
|
-
e.panelOpen ||
|
|
215
|
-
},
|
|
212
|
+
function V() {
|
|
213
|
+
clearTimeout(e.burstTimer), z(), e.panelOpen || (e.burstTimer = setTimeout(() => {
|
|
214
|
+
e.panelOpen || W();
|
|
215
|
+
}, $e));
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
e.panelOpen = !!h, e.panelOpen ? (clearTimeout(e.burstTimer),
|
|
217
|
+
function Z(h) {
|
|
218
|
+
e.panelOpen = !!h, e.panelOpen ? (clearTimeout(e.burstTimer), z()) : V();
|
|
219
219
|
}
|
|
220
|
-
async function
|
|
220
|
+
async function ce() {
|
|
221
221
|
try {
|
|
222
222
|
const h = await S(), f = h.reduce((C, O) => {
|
|
223
|
-
const
|
|
224
|
-
return
|
|
223
|
+
const M = O == null ? void 0 : O.last_message_at;
|
|
224
|
+
return M && (!C || M > C) ? M : C;
|
|
225
225
|
}, null);
|
|
226
|
-
f && (!e.lastActivityAt || f > e.lastActivityAt) && (e.lastActivityAt = f, a("activity", { conversations: h, latestAt: f }),
|
|
226
|
+
f && (!e.lastActivityAt || f > e.lastActivityAt) && (e.lastActivityAt = f, a("activity", { conversations: h, latestAt: f }), V());
|
|
227
227
|
} catch (h) {
|
|
228
228
|
console.error("[transport] poll failed", h);
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
function ne() {
|
|
232
|
-
u(), !(typeof document < "u" && document.hidden) && (e.pollTimer = setInterval(
|
|
232
|
+
u(), !(typeof document < "u" && document.hidden) && (e.pollTimer = setInterval(ce, Ee));
|
|
233
233
|
}
|
|
234
234
|
function u() {
|
|
235
235
|
e.pollTimer && (clearInterval(e.pollTimer), e.pollTimer = null);
|
|
@@ -237,14 +237,14 @@ function Re(t) {
|
|
|
237
237
|
function m() {
|
|
238
238
|
if (document.hidden)
|
|
239
239
|
clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = setTimeout(() => {
|
|
240
|
-
e.hiddenGraceTimer = null, document.hidden && (u(),
|
|
241
|
-
},
|
|
240
|
+
e.hiddenGraceTimer = null, document.hidden && (u(), W(), r("paused"));
|
|
241
|
+
}, Le);
|
|
242
242
|
else {
|
|
243
243
|
if (e.hiddenGraceTimer) {
|
|
244
244
|
clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null;
|
|
245
245
|
return;
|
|
246
246
|
}
|
|
247
|
-
r("idle"), ne(), e.panelOpen &&
|
|
247
|
+
r("idle"), ne(), e.panelOpen && z();
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
async function _() {
|
|
@@ -263,14 +263,14 @@ function Re(t) {
|
|
|
263
263
|
}
|
|
264
264
|
return typeof document < "u" && (e.visibilityHandler = m, document.addEventListener("visibilitychange", e.visibilityHandler)), ne(), h;
|
|
265
265
|
}
|
|
266
|
-
function
|
|
267
|
-
u(), clearTimeout(e.burstTimer), clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null,
|
|
266
|
+
function g() {
|
|
267
|
+
u(), clearTimeout(e.burstTimer), clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null, W(), e.visibilityHandler && (document.removeEventListener("visibilitychange", e.visibilityHandler), e.visibilityHandler = null), e.started = !1;
|
|
268
268
|
}
|
|
269
269
|
return {
|
|
270
270
|
on: n,
|
|
271
271
|
start: _,
|
|
272
|
-
stop:
|
|
273
|
-
setPanelOpen:
|
|
272
|
+
stop: g,
|
|
273
|
+
setPanelOpen: Z,
|
|
274
274
|
// REST
|
|
275
275
|
bootstrap: v,
|
|
276
276
|
getCustomer: k,
|
|
@@ -278,12 +278,12 @@ function Re(t) {
|
|
|
278
278
|
listConversations: S,
|
|
279
279
|
createConversation: R,
|
|
280
280
|
getConversation: A,
|
|
281
|
-
patchConversation:
|
|
281
|
+
patchConversation: U,
|
|
282
282
|
listMessages: x,
|
|
283
|
-
postMessage:
|
|
284
|
-
postCallback:
|
|
285
|
-
uploadAttachment:
|
|
286
|
-
signAttachment:
|
|
283
|
+
postMessage: j,
|
|
284
|
+
postCallback: P,
|
|
285
|
+
uploadAttachment: F,
|
|
286
|
+
signAttachment: H,
|
|
287
287
|
// Read-only state
|
|
288
288
|
get connection() {
|
|
289
289
|
return e.connection;
|
|
@@ -293,10 +293,10 @@ function Re(t) {
|
|
|
293
293
|
function Fe(t) {
|
|
294
294
|
return t.endsWith("/") ? t.slice(0, -1) : t;
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function De(t) {
|
|
297
297
|
return t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : "file";
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function Ne() {
|
|
300
300
|
if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
|
|
301
301
|
return crypto.randomUUID();
|
|
302
302
|
const t = new Uint8Array(16);
|
|
@@ -308,7 +308,7 @@ function De() {
|
|
|
308
308
|
const e = [...t].map((n) => n.toString(16).padStart(2, "0"));
|
|
309
309
|
return e.slice(0, 4).join("") + "-" + e.slice(4, 6).join("") + "-" + e.slice(6, 8).join("") + "-" + e.slice(8, 10).join("") + "-" + e.slice(10, 16).join("");
|
|
310
310
|
}
|
|
311
|
-
function
|
|
311
|
+
function je(t) {
|
|
312
312
|
const e = Ae({
|
|
313
313
|
ready: !1,
|
|
314
314
|
error: null,
|
|
@@ -344,29 +344,29 @@ function Ue(t) {
|
|
|
344
344
|
e.connection = u;
|
|
345
345
|
})), n.push(t.on("message", (u) => {
|
|
346
346
|
const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.message;
|
|
347
|
-
!m || !(_ != null && _.id) || (
|
|
347
|
+
!m || !(_ != null && _.id) || (z(m, _), _.client_msg_id && delete e.streamingByMsgId[_.client_msg_id], V(m, _.created_at));
|
|
348
348
|
})), n.push(t.on("message_stream", (u) => {
|
|
349
349
|
const m = u == null ? void 0 : u.message_id, _ = u == null ? void 0 : u.token;
|
|
350
350
|
!m || typeof _ != "string" || (e.streamingByMsgId[m] = (e.streamingByMsgId[m] || "") + _);
|
|
351
351
|
})), n.push(t.on("conversation_updated", (u) => {
|
|
352
352
|
const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.changes;
|
|
353
353
|
if (!m || !_) return;
|
|
354
|
-
const
|
|
355
|
-
|
|
354
|
+
const g = e.conversations.findIndex((h) => h.id === m);
|
|
355
|
+
g !== -1 && (e.conversations[g] = { ...e.conversations[g], ..._ });
|
|
356
356
|
})), n.push(t.on("config_updated", (u) => {
|
|
357
357
|
u != null && u.config && (e.config = u.config);
|
|
358
358
|
})), n.push(t.on("action_status", (u) => {
|
|
359
|
-
const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.action_id,
|
|
359
|
+
const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.action_id, g = u == null ? void 0 : u.action_name;
|
|
360
360
|
if (!m || !_) return;
|
|
361
361
|
const h = e.runningActionsByConv[m] || {};
|
|
362
|
-
u.state === "running" ? (h[_] =
|
|
362
|
+
u.state === "running" ? (h[_] = g || _, e.runningActionsByConv[m] = { ...h }) : u.state === "done" && (delete h[_], e.runningActionsByConv[m] = { ...h });
|
|
363
363
|
})), n.push(t.on("activity", (u) => {
|
|
364
364
|
Array.isArray(u == null ? void 0 : u.conversations) && (e.conversations = u.conversations);
|
|
365
365
|
}));
|
|
366
366
|
async function a() {
|
|
367
367
|
try {
|
|
368
368
|
const u = new Promise(
|
|
369
|
-
(_,
|
|
369
|
+
(_, g) => setTimeout(() => g(new Error("bootstrap timeout (15s) — check baseUrl, CORS, and network")), 15e3)
|
|
370
370
|
), m = await Promise.race([t.start(), u]);
|
|
371
371
|
e.config = m.config, e.customer = m.customer, e.conversations = await Promise.race([t.listConversations(), u]), e.ready = !0;
|
|
372
372
|
} catch (u) {
|
|
@@ -382,7 +382,7 @@ function Ue(t) {
|
|
|
382
382
|
t.stop();
|
|
383
383
|
}
|
|
384
384
|
async function s(u) {
|
|
385
|
-
const m =
|
|
385
|
+
const m = ce(u);
|
|
386
386
|
if (!m) return e.customer;
|
|
387
387
|
try {
|
|
388
388
|
const _ = await t.patchCustomer(m);
|
|
@@ -393,13 +393,13 @@ function Ue(t) {
|
|
|
393
393
|
return e.customer;
|
|
394
394
|
}
|
|
395
395
|
async function o(u = {}) {
|
|
396
|
-
const m = await t.createConversation(u), _ = e.conversations.findIndex((
|
|
396
|
+
const m = await t.createConversation(u), _ = e.conversations.findIndex((g) => g.id === m.id);
|
|
397
397
|
return _ === -1 ? e.conversations = [m, ...e.conversations] : e.conversations[_] = m, m;
|
|
398
398
|
}
|
|
399
|
-
const
|
|
399
|
+
const d = 50;
|
|
400
400
|
async function v(u) {
|
|
401
401
|
if (e.messagesByConv[u]) return;
|
|
402
|
-
const m = await t.listMessages(u, { limit:
|
|
402
|
+
const m = await t.listMessages(u, { limit: d });
|
|
403
403
|
e.messagesByConv[u] = (m == null ? void 0 : m.messages) ?? [], w(u, {
|
|
404
404
|
nextCursor: (m == null ? void 0 : m.next_cursor) ?? null,
|
|
405
405
|
loading: !1,
|
|
@@ -415,12 +415,12 @@ function Ue(t) {
|
|
|
415
415
|
for (; p < 6 && h; p++) {
|
|
416
416
|
const L = await t.listMessages(u, {
|
|
417
417
|
before: h,
|
|
418
|
-
limit:
|
|
418
|
+
limit: d
|
|
419
419
|
}), se = (L == null ? void 0 : L.messages) ?? [];
|
|
420
420
|
if (f = [...se, ...f], h = (L == null ? void 0 : L.next_cursor) ?? null, !se.length || f.length >= 60) break;
|
|
421
421
|
}
|
|
422
|
-
const C = e.messagesByConv[u] || [], O = new Set(C.map((L) => String(L == null ? void 0 : L.id))),
|
|
423
|
-
e.messagesByConv[u] =
|
|
422
|
+
const C = e.messagesByConv[u] || [], O = new Set(C.map((L) => String(L == null ? void 0 : L.id))), M = [...f.filter((L) => !O.has(String(L == null ? void 0 : L.id))), ...C];
|
|
423
|
+
e.messagesByConv[u] = M, w(u, {
|
|
424
424
|
nextCursor: h,
|
|
425
425
|
loading: !1,
|
|
426
426
|
loaded: !0
|
|
@@ -434,14 +434,14 @@ function Ue(t) {
|
|
|
434
434
|
e.paginationByConv = { ...e.paginationByConv, [u]: m };
|
|
435
435
|
}
|
|
436
436
|
async function S(u, m) {
|
|
437
|
-
const _ = await t.patchConversation(u, m),
|
|
438
|
-
|
|
437
|
+
const _ = await t.patchConversation(u, m), g = e.conversations.findIndex((h) => h.id === u);
|
|
438
|
+
g !== -1 && (e.conversations[g] = _);
|
|
439
439
|
}
|
|
440
|
-
async function R(u, m, { attachments: _, metadata:
|
|
441
|
-
var
|
|
440
|
+
async function R(u, m, { attachments: _, metadata: g } = {}) {
|
|
441
|
+
var M;
|
|
442
442
|
const h = (m || "").trim(), f = Array.isArray(_) && _.length > 0;
|
|
443
443
|
if (!u || !h && !f) return;
|
|
444
|
-
const p =
|
|
444
|
+
const p = Ne(), C = ne(u), O = {
|
|
445
445
|
id: p,
|
|
446
446
|
client_msg_id: p,
|
|
447
447
|
conversation_id: u,
|
|
@@ -449,39 +449,39 @@ function Ue(t) {
|
|
|
449
449
|
text_md: h,
|
|
450
450
|
author: {
|
|
451
451
|
type: "user",
|
|
452
|
-
id: ((
|
|
452
|
+
id: ((M = e.customer) == null ? void 0 : M.external_id) || null
|
|
453
453
|
},
|
|
454
454
|
created_at: C,
|
|
455
455
|
// Local-only flag — UI may render dimmed until the SSE echo lands.
|
|
456
456
|
_pending: !0,
|
|
457
457
|
...f ? { payload: { type: "content", attachments: _ } } : {},
|
|
458
|
-
...
|
|
458
|
+
...g && typeof g == "object" ? { metadata: g } : {}
|
|
459
459
|
};
|
|
460
|
-
|
|
460
|
+
z(u, O);
|
|
461
461
|
try {
|
|
462
462
|
await t.postMessage(u, {
|
|
463
463
|
client_msg_id: p,
|
|
464
464
|
text_md: h,
|
|
465
465
|
created_at: C,
|
|
466
466
|
...f ? { attachments: _ } : {},
|
|
467
|
-
...
|
|
467
|
+
...g && typeof g == "object" ? { metadata: g } : {}
|
|
468
468
|
});
|
|
469
469
|
} catch (L) {
|
|
470
|
-
console.error("[store] send failed", L),
|
|
470
|
+
console.error("[store] send failed", L), W(u, p, { _failed: !0, _pending: !1 });
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
async function A(u, m, _) {
|
|
474
474
|
u != null && (e.awaitingCallback[u] = !0);
|
|
475
475
|
try {
|
|
476
476
|
await t.postCallback(u, m, _);
|
|
477
|
-
} catch (
|
|
478
|
-
console.error("[store] callback failed",
|
|
477
|
+
} catch (g) {
|
|
478
|
+
console.error("[store] callback failed", g), u != null && delete e.awaitingCallback[u];
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
|
-
const
|
|
481
|
+
const U = /* @__PURE__ */ new Map();
|
|
482
482
|
async function x(u) {
|
|
483
483
|
if (!u) return null;
|
|
484
|
-
const m =
|
|
484
|
+
const m = U.get(u);
|
|
485
485
|
if (m != null && m.url) {
|
|
486
486
|
const _ = m.expires_at ? Date.parse(m.expires_at) : 0;
|
|
487
487
|
if (!_ || _ - Date.now() > 6e4) return m.url;
|
|
@@ -489,15 +489,15 @@ function Ue(t) {
|
|
|
489
489
|
try {
|
|
490
490
|
const _ = await t.signAttachment(u);
|
|
491
491
|
if (_ != null && _.signed_url)
|
|
492
|
-
return
|
|
492
|
+
return U.set(u, { url: _.signed_url, expires_at: _.expires_at }), _.signed_url;
|
|
493
493
|
} catch (_) {
|
|
494
494
|
console.error("[store] sign attachment failed", _);
|
|
495
495
|
}
|
|
496
496
|
return null;
|
|
497
497
|
}
|
|
498
|
-
async function
|
|
499
|
-
const
|
|
500
|
-
...(
|
|
498
|
+
async function j(u, { rating: m, comment: _ } = {}) {
|
|
499
|
+
const g = e.conversations.find((p) => p.id === u), f = {
|
|
500
|
+
...(g == null ? void 0 : g.metadata) || {},
|
|
501
501
|
feedback: {
|
|
502
502
|
rating: m,
|
|
503
503
|
comment: _ || null,
|
|
@@ -506,54 +506,54 @@ function Ue(t) {
|
|
|
506
506
|
};
|
|
507
507
|
await S(u, { metadata: f });
|
|
508
508
|
}
|
|
509
|
-
function
|
|
510
|
-
var _,
|
|
509
|
+
function P(u) {
|
|
510
|
+
var _, g;
|
|
511
511
|
const m = e.messagesByConv[u] || [];
|
|
512
512
|
for (let h = m.length - 1; h >= 0; h--) {
|
|
513
513
|
const f = m[h];
|
|
514
|
-
if ((f == null ? void 0 : f.type) === "action" && ((_ = f == null ? void 0 : f.payload) == null ? void 0 : _.type) === "action" && ((
|
|
514
|
+
if ((f == null ? void 0 : f.type) === "action" && ((_ = f == null ? void 0 : f.payload) == null ? void 0 : _.type) === "action" && ((g = f == null ? void 0 : f.payload) == null ? void 0 : g.state) === "pending" && Array.isArray(f == null ? void 0 : f.callbacks) && f.callbacks.length > 0 && !e.awaitingCallback[f.id])
|
|
515
515
|
return f;
|
|
516
516
|
}
|
|
517
517
|
return null;
|
|
518
518
|
}
|
|
519
|
-
function
|
|
520
|
-
var _,
|
|
519
|
+
function F(u) {
|
|
520
|
+
var _, g, h;
|
|
521
521
|
const m = e.messagesByConv[u] || [];
|
|
522
522
|
for (let f = m.length - 1; f >= 0; f--) {
|
|
523
523
|
const p = m[f];
|
|
524
|
-
if (((_ = p == null ? void 0 : p.author) == null ? void 0 : _.type) === "user" || (p == null ? void 0 : p.type) === "action" && ((
|
|
524
|
+
if (((_ = p == null ? void 0 : p.author) == null ? void 0 : _.type) === "user" || (p == null ? void 0 : p.type) === "action" && ((g = p == null ? void 0 : p.payload) == null ? void 0 : g.state) === "pending") return null;
|
|
525
525
|
const C = (h = p == null ? void 0 : p.metadata) == null ? void 0 : h.form;
|
|
526
526
|
if (C && Array.isArray(C.fields) && C.fields.length > 0)
|
|
527
527
|
return { message: p, form: C };
|
|
528
528
|
}
|
|
529
529
|
return null;
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function H(u) {
|
|
532
532
|
const m = e.runningActionsByConv[u];
|
|
533
533
|
if (!m) return null;
|
|
534
534
|
const _ = Object.keys(m);
|
|
535
535
|
if (_.length === 0) return null;
|
|
536
|
-
const
|
|
537
|
-
return { id:
|
|
536
|
+
const g = _[0];
|
|
537
|
+
return { id: g, payload: { name: m[g] } };
|
|
538
538
|
}
|
|
539
539
|
function Y(u) {
|
|
540
|
-
var _,
|
|
540
|
+
var _, g, h, f;
|
|
541
541
|
const m = e.messagesByConv[u] || [];
|
|
542
542
|
for (let p = m.length - 1; p >= 0; p--) {
|
|
543
543
|
const C = m[p];
|
|
544
544
|
if (((_ = C == null ? void 0 : C.author) == null ? void 0 : _.type) === "user") return [];
|
|
545
|
-
if ((C == null ? void 0 : C.type) === "action" && ((
|
|
545
|
+
if ((C == null ? void 0 : C.type) === "action" && ((g = C == null ? void 0 : C.payload) == null ? void 0 : g.state) === "pending") return [];
|
|
546
546
|
if (((h = C == null ? void 0 : C.author) == null ? void 0 : h.type) !== "agent_ia") continue;
|
|
547
547
|
const O = (f = C == null ? void 0 : C.metadata) == null ? void 0 : f.suggested_replies;
|
|
548
|
-
return Array.isArray(O) && O.length ? O.map((
|
|
549
|
-
if (typeof
|
|
550
|
-
const L =
|
|
548
|
+
return Array.isArray(O) && O.length ? O.map((M) => {
|
|
549
|
+
if (typeof M == "string") {
|
|
550
|
+
const L = M.trim();
|
|
551
551
|
return L ? { label: L, kind: null } : null;
|
|
552
552
|
}
|
|
553
|
-
if (
|
|
554
|
-
const L =
|
|
553
|
+
if (M && typeof M == "object" && typeof M.label == "string") {
|
|
554
|
+
const L = M.label.trim();
|
|
555
555
|
if (!L) return null;
|
|
556
|
-
const se =
|
|
556
|
+
const se = M.kind === "cta" || M.kind === "choice" || M.kind === "followup" ? M.kind : null;
|
|
557
557
|
return { label: L, kind: se };
|
|
558
558
|
}
|
|
559
559
|
return null;
|
|
@@ -561,46 +561,46 @@ function Ue(t) {
|
|
|
561
561
|
}
|
|
562
562
|
return [];
|
|
563
563
|
}
|
|
564
|
-
function
|
|
564
|
+
function z(u, m) {
|
|
565
565
|
var f;
|
|
566
566
|
const _ = e.messagesByConv[u] || [];
|
|
567
|
-
let
|
|
568
|
-
m != null && m.client_msg_id && (
|
|
567
|
+
let g = -1;
|
|
568
|
+
m != null && m.client_msg_id && (g = _.findIndex(
|
|
569
569
|
(p) => (p == null ? void 0 : p.client_msg_id) && p.client_msg_id === m.client_msg_id
|
|
570
|
-
)),
|
|
570
|
+
)), g === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (g = _.findIndex((p) => Q(p == null ? void 0 : p.id, m.id)));
|
|
571
571
|
let h;
|
|
572
|
-
|
|
572
|
+
g === -1 ? h = [..._, m].sort(Z) : (h = _.slice(), h[g] = { ..._[g], ...m, _pending: !1, _failed: !1 }), e.messagesByConv[u] = h, (m == null ? void 0 : m.type) === "action" && ((f = m == null ? void 0 : m.payload) != null && f.state) && m.payload.state !== "pending" && (m == null ? void 0 : m.id) != null && e.awaitingCallback[m.id] && delete e.awaitingCallback[m.id];
|
|
573
573
|
}
|
|
574
|
-
function
|
|
574
|
+
function Q(u, m) {
|
|
575
575
|
return u === m ? !0 : u == null || m == null ? !1 : String(u) === String(m);
|
|
576
576
|
}
|
|
577
|
-
function
|
|
578
|
-
const
|
|
579
|
-
if (!
|
|
580
|
-
const h =
|
|
577
|
+
function W(u, m, _) {
|
|
578
|
+
const g = e.messagesByConv[u];
|
|
579
|
+
if (!g) return;
|
|
580
|
+
const h = g.findIndex((p) => p.id === m);
|
|
581
581
|
if (h === -1) return;
|
|
582
|
-
const f =
|
|
583
|
-
f[h] = { ...
|
|
582
|
+
const f = g.slice();
|
|
583
|
+
f[h] = { ...g[h], ..._ }, e.messagesByConv[u] = f;
|
|
584
584
|
}
|
|
585
|
-
function
|
|
585
|
+
function V(u, m) {
|
|
586
586
|
const _ = e.conversations.findIndex((h) => h.id === u);
|
|
587
587
|
if (_ === -1) return;
|
|
588
|
-
const
|
|
589
|
-
if (m && (!
|
|
588
|
+
const g = e.conversations[_];
|
|
589
|
+
if (m && (!g.last_message_at || m > g.last_message_at)) {
|
|
590
590
|
const h = e.conversations.slice();
|
|
591
|
-
h[_] = { ...
|
|
591
|
+
h[_] = { ...g, last_message_at: m }, h.sort(
|
|
592
592
|
(f, p) => (p.last_message_at || "").localeCompare(f.last_message_at || "")
|
|
593
593
|
), e.conversations = h;
|
|
594
594
|
}
|
|
595
595
|
}
|
|
596
|
-
function
|
|
596
|
+
function Z(u, m) {
|
|
597
597
|
return (u.created_at || "").localeCompare(m.created_at || "");
|
|
598
598
|
}
|
|
599
|
-
function
|
|
599
|
+
function ce(u) {
|
|
600
600
|
if (!u || typeof u != "object") return null;
|
|
601
601
|
const m = {}, _ = {};
|
|
602
|
-
for (const [
|
|
603
|
-
h !== void 0 && (
|
|
602
|
+
for (const [g, h] of Object.entries(u))
|
|
603
|
+
h !== void 0 && (g === "name" || g === "email" ? h != null && String(h).trim() !== "" && (m[g] = h) : (g === "values" || g === "metadata") && h && typeof h == "object" ? Object.assign(_, h) : _[g] = h);
|
|
604
604
|
return Object.keys(_).length && (m.values = _), Object.keys(m).length ? m : null;
|
|
605
605
|
}
|
|
606
606
|
function ne(u) {
|
|
@@ -608,8 +608,8 @@ function Ue(t) {
|
|
|
608
608
|
let _ = "";
|
|
609
609
|
for (const f of m)
|
|
610
610
|
f != null && f.created_at && f.created_at > _ && (_ = f.created_at);
|
|
611
|
-
const
|
|
612
|
-
return !_ ||
|
|
611
|
+
const g = (/* @__PURE__ */ new Date()).toISOString();
|
|
612
|
+
return !_ || g > _ ? g : new Date(Date.parse(_) + 1).toISOString();
|
|
613
613
|
}
|
|
614
614
|
return {
|
|
615
615
|
state: e,
|
|
@@ -623,16 +623,16 @@ function Ue(t) {
|
|
|
623
623
|
send: R,
|
|
624
624
|
clickCallback: A,
|
|
625
625
|
signAttachment: x,
|
|
626
|
-
submitFeedback:
|
|
627
|
-
getPendingApproval:
|
|
628
|
-
getActionInFlight:
|
|
626
|
+
submitFeedback: j,
|
|
627
|
+
getPendingApproval: P,
|
|
628
|
+
getActionInFlight: H,
|
|
629
629
|
getLatestSuggestions: Y,
|
|
630
|
-
getLatestForm:
|
|
630
|
+
getLatestForm: F,
|
|
631
631
|
// Pass-through for panel open/close (controls SSE burst).
|
|
632
632
|
setPanelOpen: t.setPanelOpen
|
|
633
633
|
};
|
|
634
634
|
}
|
|
635
|
-
const
|
|
635
|
+
const N = {
|
|
636
636
|
w: "#ffffff",
|
|
637
637
|
g50: "#F9F9F7",
|
|
638
638
|
g100: "#F2F1EE",
|
|
@@ -648,9 +648,9 @@ const D = {
|
|
|
648
648
|
green: "#22C55E",
|
|
649
649
|
red: "#B91C1C",
|
|
650
650
|
redBg: "#FDECEC"
|
|
651
|
-
},
|
|
652
|
-
function
|
|
653
|
-
return t ?
|
|
651
|
+
}, ue = ["#5B5FEF", "#7C3AED", "#DB2777", "#0891B2", "#D97706", "#059669"];
|
|
652
|
+
function ye(t = "") {
|
|
653
|
+
return t ? ue[t.charCodeAt(0) % ue.length] : ue[0];
|
|
654
654
|
}
|
|
655
655
|
function we(t = "") {
|
|
656
656
|
return t.split(" ").map((e) => e[0] || "").join("").toUpperCase().slice(0, 2);
|
|
@@ -658,27 +658,27 @@ function we(t = "") {
|
|
|
658
658
|
function be(t = /* @__PURE__ */ new Date()) {
|
|
659
659
|
return t.toLocaleTimeString("fr-FR", { hour: "2-digit", minute: "2-digit" });
|
|
660
660
|
}
|
|
661
|
-
const
|
|
661
|
+
const Ue = `
|
|
662
662
|
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');
|
|
663
663
|
|
|
664
664
|
.wm-root {
|
|
665
665
|
--wm-f: 'Geist', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
666
666
|
--wm-fm: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
667
|
-
--wm-w: ${
|
|
668
|
-
--wm-g50: ${
|
|
669
|
-
--wm-g100: ${
|
|
670
|
-
--wm-g150: ${
|
|
671
|
-
--wm-g200: ${
|
|
672
|
-
--wm-g300: ${
|
|
673
|
-
--wm-g400: ${
|
|
674
|
-
--wm-g500: ${
|
|
675
|
-
--wm-g700: ${
|
|
676
|
-
--wm-g900: ${
|
|
677
|
-
--wm-a: ${
|
|
678
|
-
--wm-al: ${
|
|
679
|
-
--wm-green: ${
|
|
680
|
-
--wm-red: ${
|
|
681
|
-
--wm-redBg: ${
|
|
667
|
+
--wm-w: ${N.w};
|
|
668
|
+
--wm-g50: ${N.g50};
|
|
669
|
+
--wm-g100: ${N.g100};
|
|
670
|
+
--wm-g150: ${N.g150};
|
|
671
|
+
--wm-g200: ${N.g200};
|
|
672
|
+
--wm-g300: ${N.g300};
|
|
673
|
+
--wm-g400: ${N.g400};
|
|
674
|
+
--wm-g500: ${N.g500};
|
|
675
|
+
--wm-g700: ${N.g700};
|
|
676
|
+
--wm-g900: ${N.g900};
|
|
677
|
+
--wm-a: ${N.accent};
|
|
678
|
+
--wm-al: ${N.accentLight};
|
|
679
|
+
--wm-green: ${N.green};
|
|
680
|
+
--wm-red: ${N.red};
|
|
681
|
+
--wm-redBg: ${N.redBg};
|
|
682
682
|
--wm-sh1: 0 1px 3px rgba(0,0,0,.06);
|
|
683
683
|
--wm-sh2: 0 4px 24px rgba(0,0,0,.09), 0 1px 4px rgba(0,0,0,.05);
|
|
684
684
|
--wm-shPanel: 0 12px 40px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.06);
|
|
@@ -721,10 +721,10 @@ const Ne = `
|
|
|
721
721
|
emits: ["open", "dismiss"]
|
|
722
722
|
}, ze = { class: "wm-launcherWrap" }, Ve = { class: "wm-peek__text" }, qe = ["aria-label"];
|
|
723
723
|
function We(t, e, n, a, r, s) {
|
|
724
|
-
return l(),
|
|
724
|
+
return l(), c("div", ze, [
|
|
725
725
|
K(Se, { name: "wm-peek" }, {
|
|
726
726
|
default: xe(() => [
|
|
727
|
-
n.peek ? (l(),
|
|
727
|
+
n.peek ? (l(), c("div", {
|
|
728
728
|
key: 0,
|
|
729
729
|
class: "wm-peek",
|
|
730
730
|
role: "button",
|
|
@@ -732,8 +732,8 @@ function We(t, e, n, a, r, s) {
|
|
|
732
732
|
"aria-label": "Ouvrir le messenger sur le dernier message",
|
|
733
733
|
onClick: e[1] || (e[1] = (o) => t.$emit("open")),
|
|
734
734
|
onKeydown: [
|
|
735
|
-
e[2] || (e[2] =
|
|
736
|
-
e[3] || (e[3] =
|
|
735
|
+
e[2] || (e[2] = ae(X((o) => t.$emit("open"), ["prevent"]), ["enter"])),
|
|
736
|
+
e[3] || (e[3] = ae(X((o) => t.$emit("open"), ["prevent"]), ["space"]))
|
|
737
737
|
]
|
|
738
738
|
}, [
|
|
739
739
|
i("p", Ve, b(n.peek), 1),
|
|
@@ -741,7 +741,7 @@ function We(t, e, n, a, r, s) {
|
|
|
741
741
|
type: "button",
|
|
742
742
|
class: "wm-peek__close",
|
|
743
743
|
"aria-label": "Ignorer",
|
|
744
|
-
onClick: e[0] || (e[0] =
|
|
744
|
+
onClick: e[0] || (e[0] = X((o) => t.$emit("dismiss"), ["stop"]))
|
|
745
745
|
}, [...e[5] || (e[5] = [
|
|
746
746
|
i("svg", {
|
|
747
747
|
width: "11",
|
|
@@ -757,7 +757,7 @@ function We(t, e, n, a, r, s) {
|
|
|
757
757
|
i("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
758
758
|
], -1)
|
|
759
759
|
])])
|
|
760
|
-
], 32)) :
|
|
760
|
+
], 32)) : y("", !0)
|
|
761
761
|
]),
|
|
762
762
|
_: 1
|
|
763
763
|
}),
|
|
@@ -780,11 +780,11 @@ function We(t, e, n, a, r, s) {
|
|
|
780
780
|
}, [
|
|
781
781
|
i("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
|
|
782
782
|
], -1)),
|
|
783
|
-
n.unreadCount > 0 ? (l(),
|
|
783
|
+
n.unreadCount > 0 ? (l(), c("span", {
|
|
784
784
|
key: 0,
|
|
785
785
|
class: "wm-launcher__badge",
|
|
786
786
|
"aria-label": `${n.unreadCount} conversation${n.unreadCount > 1 ? "s" : ""} non lue${n.unreadCount > 1 ? "s" : ""}`
|
|
787
|
-
}, b(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, qe)) :
|
|
787
|
+
}, b(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, qe)) : y("", !0)
|
|
788
788
|
])
|
|
789
789
|
]);
|
|
790
790
|
}
|
|
@@ -805,15 +805,15 @@ const Ke = /* @__PURE__ */ E(He, [["render", We], ["__scopeId", "data-v-fabef371
|
|
|
805
805
|
class: "wm-aiav__pulse"
|
|
806
806
|
}, Je = ["width", "height"];
|
|
807
807
|
function Xe(t, e, n, a, r, s) {
|
|
808
|
-
return l(),
|
|
808
|
+
return l(), c("div", {
|
|
809
809
|
class: B(["wm-aiav", { "wm-aiav--tail": n.tail }]),
|
|
810
810
|
style: G({ width: n.size + "px", height: n.size + "px", "--wm-avr": n.size * 0.32 + "px" })
|
|
811
811
|
}, [
|
|
812
|
-
n.pulse ? (l(),
|
|
812
|
+
n.pulse ? (l(), c("div", Ye)) : y("", !0),
|
|
813
813
|
i("div", {
|
|
814
814
|
class: B(["wm-aiav__inner", { "wm-aiav__inner--glow": n.pulse }])
|
|
815
815
|
}, [
|
|
816
|
-
(l(),
|
|
816
|
+
(l(), c("svg", {
|
|
817
817
|
width: n.size * 0.5,
|
|
818
818
|
height: n.size * 0.5,
|
|
819
819
|
viewBox: "0 0 24 24",
|
|
@@ -852,7 +852,7 @@ const te = /* @__PURE__ */ E(Ge, [["render", Xe], ["__scopeId", "data-v-8c924688
|
|
|
852
852
|
},
|
|
853
853
|
computed: {
|
|
854
854
|
bg() {
|
|
855
|
-
return this.avatarUrl ? "transparent" :
|
|
855
|
+
return this.avatarUrl ? "transparent" : ye(this.name);
|
|
856
856
|
},
|
|
857
857
|
initials() {
|
|
858
858
|
return we(this.name);
|
|
@@ -860,7 +860,7 @@ const te = /* @__PURE__ */ E(Ge, [["render", Xe], ["__scopeId", "data-v-8c924688
|
|
|
860
860
|
}
|
|
861
861
|
}, Ze = ["src", "alt"];
|
|
862
862
|
function et(t, e, n, a, r, s) {
|
|
863
|
-
return l(),
|
|
863
|
+
return l(), c("div", {
|
|
864
864
|
class: "wm-huav",
|
|
865
865
|
style: G({
|
|
866
866
|
width: n.size + "px",
|
|
@@ -869,11 +869,11 @@ function et(t, e, n, a, r, s) {
|
|
|
869
869
|
background: s.bg
|
|
870
870
|
})
|
|
871
871
|
}, [
|
|
872
|
-
n.avatarUrl ? (l(),
|
|
872
|
+
n.avatarUrl ? (l(), c("img", {
|
|
873
873
|
key: 0,
|
|
874
874
|
src: n.avatarUrl,
|
|
875
875
|
alt: n.name || ""
|
|
876
|
-
}, null, 8, Ze)) : (l(),
|
|
876
|
+
}, null, 8, Ze)) : (l(), c("span", {
|
|
877
877
|
key: 1,
|
|
878
878
|
style: G({ fontSize: n.size * 0.36 + "px" })
|
|
879
879
|
}, b(s.initials), 5))
|
|
@@ -895,7 +895,7 @@ const ke = /* @__PURE__ */ E(Qe, [["render", et], ["__scopeId", "data-v-a772b179
|
|
|
895
895
|
},
|
|
896
896
|
methods: {
|
|
897
897
|
colorFor(t) {
|
|
898
|
-
return t.avatar_url ? "transparent" :
|
|
898
|
+
return t.avatar_url ? "transparent" : ye(t.name || "");
|
|
899
899
|
},
|
|
900
900
|
initialsFor(t) {
|
|
901
901
|
return we(t.name || "");
|
|
@@ -909,25 +909,25 @@ const ke = /* @__PURE__ */ E(Qe, [["render", et], ["__scopeId", "data-v-a772b179
|
|
|
909
909
|
class: "wm-team__label"
|
|
910
910
|
};
|
|
911
911
|
function at(t, e, n, a, r, s) {
|
|
912
|
-
return s.visible ? (l(),
|
|
912
|
+
return s.visible ? (l(), c("div", nt, [
|
|
913
913
|
i("div", {
|
|
914
914
|
class: "wm-team__stack",
|
|
915
915
|
style: G({ width: s.stackWidth + "px" })
|
|
916
916
|
}, [
|
|
917
|
-
(l(!0),
|
|
918
|
-
key:
|
|
917
|
+
(l(!0), c(T, null, D(n.members.slice(0, 3), (o, d) => (l(), c("div", {
|
|
918
|
+
key: d,
|
|
919
919
|
class: "wm-team__pill",
|
|
920
|
-
style: G({ left:
|
|
920
|
+
style: G({ left: d * 13 + "px", zIndex: 3 - d, background: s.colorFor(o) })
|
|
921
921
|
}, [
|
|
922
|
-
o.avatar_url ? (l(),
|
|
922
|
+
o.avatar_url ? (l(), c("img", {
|
|
923
923
|
key: 0,
|
|
924
924
|
src: o.avatar_url,
|
|
925
925
|
alt: o.name || ""
|
|
926
|
-
}, null, 8, st)) : (l(),
|
|
926
|
+
}, null, 8, st)) : (l(), c("span", rt, b(s.initialsFor(o)), 1))
|
|
927
927
|
], 4))), 128))
|
|
928
928
|
], 4),
|
|
929
|
-
n.responseLabel ? (l(),
|
|
930
|
-
])) :
|
|
929
|
+
n.responseLabel ? (l(), c("span", it, b(n.responseLabel), 1)) : y("", !0)
|
|
930
|
+
])) : y("", !0);
|
|
931
931
|
}
|
|
932
932
|
const ot = /* @__PURE__ */ E(tt, [["render", at], ["__scopeId", "data-v-3659b9c1"]]), lt = {
|
|
933
933
|
name: "WmHeader",
|
|
@@ -962,7 +962,7 @@ const ot = /* @__PURE__ */ E(tt, [["render", at], ["__scopeId", "data-v-3659b9c1
|
|
|
962
962
|
return this.escalated && this.agentName ? this.agentName : "En ligne";
|
|
963
963
|
}
|
|
964
964
|
}
|
|
965
|
-
},
|
|
965
|
+
}, dt = { class: "wm-header" }, ct = {
|
|
966
966
|
key: 1,
|
|
967
967
|
style: { width: "30px", height: "30px", "flex-shrink": "0" }
|
|
968
968
|
}, ut = { class: "wm-header__avatar" }, ht = { class: "wm-header__main" }, mt = { class: "wm-header__title" }, ft = {
|
|
@@ -972,10 +972,10 @@ const ot = /* @__PURE__ */ E(tt, [["render", at], ["__scopeId", "data-v-3659b9c1
|
|
|
972
972
|
key: 3,
|
|
973
973
|
class: "wm-header__fill"
|
|
974
974
|
}, vt = { class: "wm-header__actions" };
|
|
975
|
-
function
|
|
976
|
-
const o = I("HumanAvatar"),
|
|
977
|
-
return l(),
|
|
978
|
-
n.showBack ? (l(),
|
|
975
|
+
function gt(t, e, n, a, r, s) {
|
|
976
|
+
const o = I("HumanAvatar"), d = I("AIAvatar"), v = I("TeamAvatars");
|
|
977
|
+
return l(), c("div", dt, [
|
|
978
|
+
n.showBack ? (l(), c("button", {
|
|
979
979
|
key: 0,
|
|
980
980
|
type: "button",
|
|
981
981
|
class: "wm-header__icon",
|
|
@@ -995,36 +995,36 @@ function yt(t, e, n, a, r, s) {
|
|
|
995
995
|
}, [
|
|
996
996
|
i("path", { d: "M19 12H5M12 5l-7 7 7 7" })
|
|
997
997
|
], -1)
|
|
998
|
-
])])) : (l(),
|
|
999
|
-
n.showIdentity ? (l(),
|
|
998
|
+
])])) : (l(), c("div", ct)),
|
|
999
|
+
n.showIdentity ? (l(), c(T, { key: 2 }, [
|
|
1000
1000
|
i("div", ut, [
|
|
1001
1001
|
n.escalated ? (l(), $(o, {
|
|
1002
1002
|
key: 0,
|
|
1003
1003
|
name: n.agentName,
|
|
1004
1004
|
"avatar-url": n.agentAvatarUrl,
|
|
1005
1005
|
size: 34
|
|
1006
|
-
}, null, 8, ["name", "avatar-url"])) : (l(), $(
|
|
1006
|
+
}, null, 8, ["name", "avatar-url"])) : (l(), $(d, {
|
|
1007
1007
|
key: 1,
|
|
1008
1008
|
size: 34
|
|
1009
1009
|
}))
|
|
1010
1010
|
]),
|
|
1011
1011
|
i("div", ht, [
|
|
1012
1012
|
i("div", mt, b(n.title), 1),
|
|
1013
|
-
s.showPresence ? (l(),
|
|
1013
|
+
s.showPresence ? (l(), c("div", ft, [
|
|
1014
1014
|
s.hasTeam ? (l(), $(v, {
|
|
1015
1015
|
key: 0,
|
|
1016
1016
|
members: n.teamMembers,
|
|
1017
1017
|
"response-label": n.responseLabel
|
|
1018
|
-
}, null, 8, ["members", "response-label"])) :
|
|
1018
|
+
}, null, 8, ["members", "response-label"])) : y("", !0),
|
|
1019
1019
|
i("span", _t, [
|
|
1020
1020
|
e[4] || (e[4] = i("span", { class: "wm-header__dot" }, null, -1)),
|
|
1021
|
-
|
|
1021
|
+
de(" " + b(s.statusText), 1)
|
|
1022
1022
|
])
|
|
1023
|
-
])) :
|
|
1023
|
+
])) : y("", !0)
|
|
1024
1024
|
])
|
|
1025
|
-
], 64)) : (l(),
|
|
1025
|
+
], 64)) : (l(), c("div", pt)),
|
|
1026
1026
|
i("div", vt, [
|
|
1027
|
-
n.showMore ? (l(),
|
|
1027
|
+
n.showMore ? (l(), c("button", {
|
|
1028
1028
|
key: 0,
|
|
1029
1029
|
type: "button",
|
|
1030
1030
|
class: B(["wm-header__icon", { "wm-header__icon--active": n.moreActive }]),
|
|
@@ -1055,8 +1055,8 @@ function yt(t, e, n, a, r, s) {
|
|
|
1055
1055
|
r: "1.6"
|
|
1056
1056
|
})
|
|
1057
1057
|
], -1)
|
|
1058
|
-
])], 2)) :
|
|
1059
|
-
n.showClose ? (l(),
|
|
1058
|
+
])], 2)) : y("", !0),
|
|
1059
|
+
n.showClose ? (l(), c("button", {
|
|
1060
1060
|
key: 1,
|
|
1061
1061
|
type: "button",
|
|
1062
1062
|
class: "wm-header__icon",
|
|
@@ -1077,11 +1077,11 @@ function yt(t, e, n, a, r, s) {
|
|
|
1077
1077
|
}, [
|
|
1078
1078
|
i("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
1079
1079
|
], -1)
|
|
1080
|
-
])])) :
|
|
1080
|
+
])])) : y("", !0)
|
|
1081
1081
|
])
|
|
1082
1082
|
]);
|
|
1083
1083
|
}
|
|
1084
|
-
const
|
|
1084
|
+
const yt = /* @__PURE__ */ E(lt, [["render", gt], ["__scopeId", "data-v-b5f5f6a9"]]), _e = {
|
|
1085
1085
|
book: "M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253",
|
|
1086
1086
|
changelog: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2",
|
|
1087
1087
|
status: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",
|
|
@@ -1115,10 +1115,10 @@ Je réponds en quelques secondes.`;
|
|
|
1115
1115
|
}, bt = { class: "wm-onb" }, kt = { class: "wm-onb__hero" }, Ct = { class: "wm-onb__title" }, At = { class: "wm-onb__sub" }, St = {
|
|
1116
1116
|
key: 0,
|
|
1117
1117
|
class: "wm-onb__section"
|
|
1118
|
-
}, xt = { class: "wm-onb__links" },
|
|
1118
|
+
}, xt = { class: "wm-onb__links" }, Tt = ["onClick"], Mt = { class: "wm-onb__resume-body" }, Ot = { class: "wm-onb__resume-title" }, It = { class: "wm-onb__resume-preview" }, Bt = {
|
|
1119
1119
|
key: 1,
|
|
1120
1120
|
class: "wm-onb__section"
|
|
1121
|
-
}, Et = { class: "wm-onb__links" },
|
|
1121
|
+
}, Et = { class: "wm-onb__links" }, $t = ["onClick"], Lt = { class: "wm-onb__link-icon" }, Rt = {
|
|
1122
1122
|
width: "14",
|
|
1123
1123
|
height: "14",
|
|
1124
1124
|
viewBox: "0 0 24 24",
|
|
@@ -1128,10 +1128,10 @@ Je réponds en quelques secondes.`;
|
|
|
1128
1128
|
"stroke-linecap": "round",
|
|
1129
1129
|
"stroke-linejoin": "round",
|
|
1130
1130
|
"aria-hidden": "true"
|
|
1131
|
-
}, Ft = ["d"],
|
|
1132
|
-
function
|
|
1131
|
+
}, Ft = ["d"], Dt = { class: "wm-onb__link-label" }, Nt = { class: "wm-onb__cta" }, jt = ["disabled"];
|
|
1132
|
+
function Ut(t, e, n, a, r, s) {
|
|
1133
1133
|
const o = I("AIAvatar");
|
|
1134
|
-
return l(),
|
|
1134
|
+
return l(), c("div", bt, [
|
|
1135
1135
|
i("div", kt, [
|
|
1136
1136
|
K(o, {
|
|
1137
1137
|
size: 56,
|
|
@@ -1140,14 +1140,14 @@ function Nt(t, e, n, a, r, s) {
|
|
|
1140
1140
|
i("div", Ct, b(s.heroTitle), 1),
|
|
1141
1141
|
i("div", At, b(s.heroSub), 1)
|
|
1142
1142
|
]),
|
|
1143
|
-
n.unreadThreads.length ? (l(),
|
|
1143
|
+
n.unreadThreads.length ? (l(), c("div", St, [
|
|
1144
1144
|
e[3] || (e[3] = i("div", { class: "wm-onb__section-title" }, "Messages non lus", -1)),
|
|
1145
1145
|
i("div", xt, [
|
|
1146
|
-
(l(!0),
|
|
1147
|
-
key:
|
|
1146
|
+
(l(!0), c(T, null, D(n.unreadThreads, (d) => (l(), c("button", {
|
|
1147
|
+
key: d.id,
|
|
1148
1148
|
type: "button",
|
|
1149
1149
|
class: "wm-onb__link wm-onb__resume",
|
|
1150
|
-
onClick: (v) => t.$emit("resume",
|
|
1150
|
+
onClick: (v) => t.$emit("resume", d)
|
|
1151
1151
|
}, [
|
|
1152
1152
|
e[1] || (e[1] = i("span", { class: "wm-onb__link-icon wm-onb__resume-icon" }, [
|
|
1153
1153
|
i("svg", {
|
|
@@ -1168,9 +1168,9 @@ function Nt(t, e, n, a, r, s) {
|
|
|
1168
1168
|
"aria-label": "Non lu"
|
|
1169
1169
|
})
|
|
1170
1170
|
], -1)),
|
|
1171
|
-
i("span",
|
|
1172
|
-
i("span", Ot, b(
|
|
1173
|
-
i("span", It, b(
|
|
1171
|
+
i("span", Mt, [
|
|
1172
|
+
i("span", Ot, b(d.title), 1),
|
|
1173
|
+
i("span", It, b(d.preview), 1)
|
|
1174
1174
|
]),
|
|
1175
1175
|
e[2] || (e[2] = i("svg", {
|
|
1176
1176
|
width: "13",
|
|
@@ -1186,26 +1186,26 @@ function Nt(t, e, n, a, r, s) {
|
|
|
1186
1186
|
}, [
|
|
1187
1187
|
i("path", { d: "M9 18l6-6-6-6" })
|
|
1188
1188
|
], -1))
|
|
1189
|
-
], 8,
|
|
1189
|
+
], 8, Tt))), 128))
|
|
1190
1190
|
])
|
|
1191
|
-
])) :
|
|
1192
|
-
n.quickLinks.length ? (l(),
|
|
1191
|
+
])) : y("", !0),
|
|
1192
|
+
n.quickLinks.length ? (l(), c("div", Bt, [
|
|
1193
1193
|
e[5] || (e[5] = i("div", { class: "wm-onb__section-title" }, "Accès rapide", -1)),
|
|
1194
1194
|
i("div", Et, [
|
|
1195
|
-
(l(!0),
|
|
1195
|
+
(l(!0), c(T, null, D(n.quickLinks, (d, v) => (l(), c("button", {
|
|
1196
1196
|
key: v,
|
|
1197
1197
|
type: "button",
|
|
1198
1198
|
class: "wm-onb__link",
|
|
1199
|
-
onClick: (k) => t.$emit("select",
|
|
1199
|
+
onClick: (k) => t.$emit("select", d)
|
|
1200
1200
|
}, [
|
|
1201
|
-
i("span",
|
|
1202
|
-
(l(),
|
|
1201
|
+
i("span", Lt, [
|
|
1202
|
+
(l(), c("svg", Rt, [
|
|
1203
1203
|
i("path", {
|
|
1204
|
-
d: s.iconPath(
|
|
1204
|
+
d: s.iconPath(d.icon)
|
|
1205
1205
|
}, null, 8, Ft)
|
|
1206
1206
|
]))
|
|
1207
1207
|
]),
|
|
1208
|
-
i("span",
|
|
1208
|
+
i("span", Dt, b(d.label), 1),
|
|
1209
1209
|
e[4] || (e[4] = i("svg", {
|
|
1210
1210
|
width: "13",
|
|
1211
1211
|
height: "13",
|
|
@@ -1220,20 +1220,20 @@ function Nt(t, e, n, a, r, s) {
|
|
|
1220
1220
|
}, [
|
|
1221
1221
|
i("path", { d: "M9 18l6-6-6-6" })
|
|
1222
1222
|
], -1))
|
|
1223
|
-
], 8,
|
|
1223
|
+
], 8, $t))), 128))
|
|
1224
1224
|
])
|
|
1225
|
-
])) :
|
|
1226
|
-
i("div",
|
|
1225
|
+
])) : y("", !0),
|
|
1226
|
+
i("div", Nt, [
|
|
1227
1227
|
i("button", {
|
|
1228
1228
|
type: "button",
|
|
1229
1229
|
class: "wm-onb__startBtn",
|
|
1230
1230
|
disabled: n.busy,
|
|
1231
|
-
onClick: e[0] || (e[0] = (
|
|
1232
|
-
}, b(n.busy ? "…" : "Commencer une conversation"), 9,
|
|
1231
|
+
onClick: e[0] || (e[0] = (d) => t.$emit("start"))
|
|
1232
|
+
}, b(n.busy ? "…" : "Commencer une conversation"), 9, jt)
|
|
1233
1233
|
])
|
|
1234
1234
|
]);
|
|
1235
1235
|
}
|
|
1236
|
-
const Pt = /* @__PURE__ */ E(wt, [["render",
|
|
1236
|
+
const Pt = /* @__PURE__ */ E(wt, [["render", Ut], ["__scopeId", "data-v-bd89bc8f"]]);
|
|
1237
1237
|
function Ht(t) {
|
|
1238
1238
|
return typeof t != "string" ? "" : t.replace(/`([^`]+)`/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(new RegExp("(?<!\\*)\\*([^*]+)\\*(?!\\*)", "g"), "$1").replace(/__([^_]+)__/g, "$1").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/\s+/g, " ").trim();
|
|
1239
1239
|
}
|
|
@@ -1295,22 +1295,22 @@ const zt = {
|
|
|
1295
1295
|
"stroke-linejoin": "round"
|
|
1296
1296
|
}, Yt = { class: "wm-result__body" }, Jt = { class: "wm-result__label" }, Xt = { class: "wm-result__detail" };
|
|
1297
1297
|
function Qt(t, e, n, a, r, s) {
|
|
1298
|
-
return l(),
|
|
1298
|
+
return l(), c("div", {
|
|
1299
1299
|
class: B(["wm-result", `wm-result--${n.state}`])
|
|
1300
1300
|
}, [
|
|
1301
1301
|
i("span", Vt, [
|
|
1302
|
-
n.state === "success" ? (l(),
|
|
1302
|
+
n.state === "success" ? (l(), c("svg", qt, [...e[0] || (e[0] = [
|
|
1303
1303
|
i("path", { d: "M20 6L9 17l-5-5" }, null, -1)
|
|
1304
|
-
])])) : n.state === "rejected" ? (l(),
|
|
1304
|
+
])])) : n.state === "rejected" ? (l(), c("svg", Wt, [...e[1] || (e[1] = [
|
|
1305
1305
|
i("path", { d: "M18 6L6 18M6 6l12 12" }, null, -1)
|
|
1306
|
-
])])) : n.state === "awaiting" ? (l(),
|
|
1306
|
+
])])) : n.state === "awaiting" ? (l(), c("svg", Kt, [...e[2] || (e[2] = [
|
|
1307
1307
|
i("circle", {
|
|
1308
1308
|
cx: "12",
|
|
1309
1309
|
cy: "12",
|
|
1310
1310
|
r: "10"
|
|
1311
1311
|
}, null, -1),
|
|
1312
1312
|
i("polyline", { points: "12 7 12 12 15 14" }, null, -1)
|
|
1313
|
-
])])) : (l(),
|
|
1313
|
+
])])) : (l(), c("svg", Gt, [...e[3] || (e[3] = [
|
|
1314
1314
|
i("path", { d: "M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }, null, -1),
|
|
1315
1315
|
i("line", {
|
|
1316
1316
|
x1: "12",
|
|
@@ -1328,13 +1328,13 @@ function Qt(t, e, n, a, r, s) {
|
|
|
1328
1328
|
]),
|
|
1329
1329
|
i("span", Yt, [
|
|
1330
1330
|
i("span", Jt, b(n.label), 1),
|
|
1331
|
-
s.detailText ? (l(),
|
|
1331
|
+
s.detailText ? (l(), c(T, { key: 0 }, [
|
|
1332
1332
|
e[4] || (e[4] = i("span", {
|
|
1333
1333
|
class: "wm-result__sep",
|
|
1334
1334
|
"aria-hidden": "true"
|
|
1335
1335
|
}, " · ", -1)),
|
|
1336
1336
|
i("span", Xt, b(s.detailText), 1)
|
|
1337
|
-
], 64)) :
|
|
1337
|
+
], 64)) : y("", !0)
|
|
1338
1338
|
])
|
|
1339
1339
|
], 2);
|
|
1340
1340
|
}
|
|
@@ -1351,7 +1351,7 @@ const Zt = /* @__PURE__ */ E(zt, [["render", Qt], ["__scopeId", "data-v-64a83fb8
|
|
|
1351
1351
|
}
|
|
1352
1352
|
}, tn = { class: "wm-art wm-art--formResponse" }, nn = { class: "wm-art__head" }, sn = { class: "wm-art__title" }, rn = { class: "wm-art__body" }, an = { class: "wm-art__fieldLabel" };
|
|
1353
1353
|
function on(t, e, n, a, r, s) {
|
|
1354
|
-
return l(),
|
|
1354
|
+
return l(), c("div", tn, [
|
|
1355
1355
|
i("div", nn, [
|
|
1356
1356
|
i("div", sn, b(n.data.title || "Formulaire"), 1),
|
|
1357
1357
|
e[0] || (e[0] = i("span", { class: "wm-art__badge wm-art__badge--success" }, [
|
|
@@ -1368,12 +1368,12 @@ function on(t, e, n, a, r, s) {
|
|
|
1368
1368
|
}, [
|
|
1369
1369
|
i("polyline", { points: "20 6 9 17 4 12" })
|
|
1370
1370
|
]),
|
|
1371
|
-
|
|
1371
|
+
de(" Envoyé ")
|
|
1372
1372
|
], -1))
|
|
1373
1373
|
]),
|
|
1374
1374
|
i("div", rn, [
|
|
1375
|
-
(l(!0),
|
|
1376
|
-
key:
|
|
1375
|
+
(l(!0), c(T, null, D(s.fields, (o, d) => (l(), c("div", {
|
|
1376
|
+
key: d,
|
|
1377
1377
|
class: "wm-art__field"
|
|
1378
1378
|
}, [
|
|
1379
1379
|
i("div", an, b(o.label), 1),
|
|
@@ -1384,7 +1384,7 @@ function on(t, e, n, a, r, s) {
|
|
|
1384
1384
|
])
|
|
1385
1385
|
]);
|
|
1386
1386
|
}
|
|
1387
|
-
const ln = /* @__PURE__ */ E(en, [["render", on], ["__scopeId", "data-v-ca24a9c9"]]),
|
|
1387
|
+
const ln = /* @__PURE__ */ E(en, [["render", on], ["__scopeId", "data-v-ca24a9c9"]]), dn = {
|
|
1388
1388
|
name: "WmArtifactInfoCard",
|
|
1389
1389
|
props: {
|
|
1390
1390
|
data: { type: Object, required: !0 }
|
|
@@ -1399,7 +1399,7 @@ const ln = /* @__PURE__ */ E(en, [["render", on], ["__scopeId", "data-v-ca24a9c9
|
|
|
1399
1399
|
return !!((t = this.data) != null && t.body) || this.fields.length > 0;
|
|
1400
1400
|
}
|
|
1401
1401
|
}
|
|
1402
|
-
},
|
|
1402
|
+
}, cn = { class: "wm-art wm-art--infoCard" }, un = {
|
|
1403
1403
|
key: 0,
|
|
1404
1404
|
class: "wm-art__image"
|
|
1405
1405
|
}, hn = ["src", "alt"], mn = { class: "wm-art__head" }, fn = { class: "wm-art__headMain" }, _n = { class: "wm-art__title" }, pn = {
|
|
@@ -1408,44 +1408,44 @@ const ln = /* @__PURE__ */ E(en, [["render", on], ["__scopeId", "data-v-ca24a9c9
|
|
|
1408
1408
|
}, vn = {
|
|
1409
1409
|
key: 1,
|
|
1410
1410
|
class: "wm-art__body"
|
|
1411
|
-
},
|
|
1411
|
+
}, gn = {
|
|
1412
1412
|
key: 0,
|
|
1413
1413
|
class: "wm-art__text"
|
|
1414
|
-
},
|
|
1414
|
+
}, yn = { class: "wm-art__fieldLabel" };
|
|
1415
1415
|
function wn(t, e, n, a, r, s) {
|
|
1416
|
-
return l(),
|
|
1417
|
-
n.data.image_url ? (l(),
|
|
1416
|
+
return l(), c("div", cn, [
|
|
1417
|
+
n.data.image_url ? (l(), c("figure", un, [
|
|
1418
1418
|
i("img", {
|
|
1419
1419
|
src: n.data.image_url,
|
|
1420
1420
|
alt: n.data.title || "",
|
|
1421
1421
|
loading: "lazy"
|
|
1422
1422
|
}, null, 8, hn)
|
|
1423
|
-
])) :
|
|
1423
|
+
])) : y("", !0),
|
|
1424
1424
|
i("div", mn, [
|
|
1425
1425
|
i("div", fn, [
|
|
1426
1426
|
i("div", _n, b(n.data.title), 1),
|
|
1427
|
-
n.data.subtitle ? (l(),
|
|
1427
|
+
n.data.subtitle ? (l(), c("div", pn, b(n.data.subtitle), 1)) : y("", !0)
|
|
1428
1428
|
]),
|
|
1429
|
-
n.data.badge && n.data.badge.label ? (l(),
|
|
1429
|
+
n.data.badge && n.data.badge.label ? (l(), c("span", {
|
|
1430
1430
|
key: 0,
|
|
1431
1431
|
class: B(["wm-art__badge", `wm-art__badge--${n.data.badge.tone || "neutral"}`])
|
|
1432
|
-
}, b(n.data.badge.label), 3)) :
|
|
1432
|
+
}, b(n.data.badge.label), 3)) : y("", !0)
|
|
1433
1433
|
]),
|
|
1434
|
-
s.hasBody ? (l(),
|
|
1435
|
-
n.data.body ? (l(),
|
|
1436
|
-
s.fields.length ? (l(!0),
|
|
1437
|
-
key:
|
|
1434
|
+
s.hasBody ? (l(), c("div", vn, [
|
|
1435
|
+
n.data.body ? (l(), c("div", gn, b(n.data.body), 1)) : y("", !0),
|
|
1436
|
+
s.fields.length ? (l(!0), c(T, { key: 1 }, D(s.fields, (o, d) => (l(), c("div", {
|
|
1437
|
+
key: d,
|
|
1438
1438
|
class: "wm-art__field"
|
|
1439
1439
|
}, [
|
|
1440
|
-
i("div",
|
|
1440
|
+
i("div", yn, b(o.label), 1),
|
|
1441
1441
|
i("div", {
|
|
1442
1442
|
class: B(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
|
|
1443
1443
|
}, b(o.value), 3)
|
|
1444
|
-
]))), 128)) :
|
|
1445
|
-
])) :
|
|
1444
|
+
]))), 128)) : y("", !0)
|
|
1445
|
+
])) : y("", !0)
|
|
1446
1446
|
]);
|
|
1447
1447
|
}
|
|
1448
|
-
const bn = /* @__PURE__ */ E(
|
|
1448
|
+
const bn = /* @__PURE__ */ E(dn, [["render", wn], ["__scopeId", "data-v-d7369333"]]);
|
|
1449
1449
|
function kn(t) {
|
|
1450
1450
|
if (!t) return "";
|
|
1451
1451
|
const e = new Date(t);
|
|
@@ -1487,13 +1487,13 @@ const Cn = {
|
|
|
1487
1487
|
return /high|haute|élev|elev|critic|critiq|urgent/.test(e) ? 3 : /low|basse|faible|minor/.test(e) ? 1 : 2;
|
|
1488
1488
|
}
|
|
1489
1489
|
}
|
|
1490
|
-
}, An = { class: "wm-art wm-art--ticket" }, Sn = { class: "wm-art__head wm-tk__head" }, xn = { class: "wm-art__title wm-tk__title" },
|
|
1490
|
+
}, An = { class: "wm-art wm-art--ticket" }, Sn = { class: "wm-art__head wm-tk__head" }, xn = { class: "wm-art__title wm-tk__title" }, Tn = { class: "wm-tk__sub" }, Mn = { class: "wm-tk__ref" }, On = {
|
|
1491
1491
|
key: 0,
|
|
1492
1492
|
class: "wm-tk__text"
|
|
1493
1493
|
}, In = {
|
|
1494
1494
|
key: 0,
|
|
1495
1495
|
class: "wm-art__body"
|
|
1496
|
-
}, Bn = { class: "wm-art__fieldLabel" }, En = ["data-level"],
|
|
1496
|
+
}, Bn = { class: "wm-art__fieldLabel" }, En = ["data-level"], $n = {
|
|
1497
1497
|
key: 1,
|
|
1498
1498
|
class: "wm-tk__date",
|
|
1499
1499
|
width: "12",
|
|
@@ -1505,16 +1505,16 @@ const Cn = {
|
|
|
1505
1505
|
"stroke-linecap": "round",
|
|
1506
1506
|
"stroke-linejoin": "round",
|
|
1507
1507
|
"aria-hidden": "true"
|
|
1508
|
-
},
|
|
1508
|
+
}, Ln = {
|
|
1509
1509
|
key: 1,
|
|
1510
1510
|
class: "wm-art__footer wm-tk__footer"
|
|
1511
1511
|
};
|
|
1512
1512
|
function Rn(t, e, n, a, r, s) {
|
|
1513
|
-
return l(),
|
|
1513
|
+
return l(), c("div", An, [
|
|
1514
1514
|
i("div", Sn, [
|
|
1515
1515
|
i("div", xn, b(n.data.title), 1),
|
|
1516
|
-
i("div",
|
|
1517
|
-
i("div",
|
|
1516
|
+
i("div", Tn, [
|
|
1517
|
+
i("div", Mn, [
|
|
1518
1518
|
e[0] || (e[0] = i("svg", {
|
|
1519
1519
|
width: "11",
|
|
1520
1520
|
height: "11",
|
|
@@ -1538,21 +1538,21 @@ function Rn(t, e, n, a, r, s) {
|
|
|
1538
1538
|
class: "wm-tk__dot",
|
|
1539
1539
|
"aria-hidden": "true"
|
|
1540
1540
|
}, null, -1)),
|
|
1541
|
-
|
|
1541
|
+
de(" " + b(n.data.status.label), 1)
|
|
1542
1542
|
], 2)
|
|
1543
1543
|
]),
|
|
1544
|
-
n.data.body ? (l(),
|
|
1544
|
+
n.data.body ? (l(), c("div", On, b(n.data.body), 1)) : y("", !0)
|
|
1545
1545
|
]),
|
|
1546
|
-
s.fields.length ? (l(),
|
|
1547
|
-
(l(!0),
|
|
1548
|
-
key:
|
|
1546
|
+
s.fields.length ? (l(), c("div", In, [
|
|
1547
|
+
(l(!0), c(T, null, D(s.fields, (o, d) => (l(), c("div", {
|
|
1548
|
+
key: d,
|
|
1549
1549
|
class: "wm-art__field"
|
|
1550
1550
|
}, [
|
|
1551
1551
|
i("div", Bn, b(o.label), 1),
|
|
1552
1552
|
i("div", {
|
|
1553
1553
|
class: B(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
|
|
1554
1554
|
}, [
|
|
1555
|
-
s.isPriority(o.label) ? (l(),
|
|
1555
|
+
s.isPriority(o.label) ? (l(), c("svg", {
|
|
1556
1556
|
key: 0,
|
|
1557
1557
|
class: "wm-tk__prio",
|
|
1558
1558
|
"data-level": s.priorityLevel(o.value),
|
|
@@ -1582,7 +1582,7 @@ function Rn(t, e, n, a, r, s) {
|
|
|
1582
1582
|
height: "9",
|
|
1583
1583
|
rx: "0.5"
|
|
1584
1584
|
}, null, -1)
|
|
1585
|
-
])], 8, En)) : s.isDate(o.label) ? (l(),
|
|
1585
|
+
])], 8, En)) : s.isDate(o.label) ? (l(), c("svg", $n, [...e[3] || (e[3] = [
|
|
1586
1586
|
i("rect", {
|
|
1587
1587
|
x: "3",
|
|
1588
1588
|
y: "4",
|
|
@@ -1591,12 +1591,12 @@ function Rn(t, e, n, a, r, s) {
|
|
|
1591
1591
|
rx: "2"
|
|
1592
1592
|
}, null, -1),
|
|
1593
1593
|
i("path", { d: "M16 2v4M8 2v4M3 10h18" }, null, -1)
|
|
1594
|
-
])])) :
|
|
1594
|
+
])])) : y("", !0),
|
|
1595
1595
|
i("span", null, b(o.value), 1)
|
|
1596
1596
|
], 2)
|
|
1597
1597
|
]))), 128))
|
|
1598
|
-
])) :
|
|
1599
|
-
n.data.created_at ? (l(),
|
|
1598
|
+
])) : y("", !0),
|
|
1599
|
+
n.data.created_at ? (l(), c("div", Ln, [
|
|
1600
1600
|
e[4] || (e[4] = i("svg", {
|
|
1601
1601
|
width: "11",
|
|
1602
1602
|
height: "11",
|
|
@@ -1618,14 +1618,14 @@ function Rn(t, e, n, a, r, s) {
|
|
|
1618
1618
|
i("path", { d: "M16 2v4M8 2v4M3 10h18" })
|
|
1619
1619
|
], -1)),
|
|
1620
1620
|
i("span", null, b(s.formattedDate), 1)
|
|
1621
|
-
])) :
|
|
1621
|
+
])) : y("", !0)
|
|
1622
1622
|
]);
|
|
1623
1623
|
}
|
|
1624
|
-
const Fn = /* @__PURE__ */ E(Cn, [["render", Rn], ["__scopeId", "data-v-8b274eb7"]]),
|
|
1624
|
+
const Fn = /* @__PURE__ */ E(Cn, [["render", Rn], ["__scopeId", "data-v-8b274eb7"]]), Dn = {
|
|
1625
1625
|
form_response: ln,
|
|
1626
1626
|
info_card: bn,
|
|
1627
1627
|
ticket: Fn
|
|
1628
|
-
},
|
|
1628
|
+
}, Nn = {
|
|
1629
1629
|
name: "WmArtifactRenderer",
|
|
1630
1630
|
props: {
|
|
1631
1631
|
// Forme : { kind: string, data: any } (le `data` est validé
|
|
@@ -1636,17 +1636,17 @@ const Fn = /* @__PURE__ */ E(Cn, [["render", Rn], ["__scopeId", "data-v-8b274eb7
|
|
|
1636
1636
|
component() {
|
|
1637
1637
|
var e;
|
|
1638
1638
|
const t = (e = this.artifact) == null ? void 0 : e.kind;
|
|
1639
|
-
return t &&
|
|
1639
|
+
return t && Dn[t] || null;
|
|
1640
1640
|
}
|
|
1641
1641
|
}
|
|
1642
1642
|
};
|
|
1643
|
-
function
|
|
1644
|
-
return s.component ? (l(), $(
|
|
1643
|
+
function jn(t, e, n, a, r, s) {
|
|
1644
|
+
return s.component ? (l(), $(Te(s.component), {
|
|
1645
1645
|
key: 0,
|
|
1646
1646
|
data: n.artifact.data
|
|
1647
|
-
}, null, 8, ["data"])) :
|
|
1647
|
+
}, null, 8, ["data"])) : y("", !0);
|
|
1648
1648
|
}
|
|
1649
|
-
const
|
|
1649
|
+
const Un = /* @__PURE__ */ E(Nn, [["render", jn]]), Pn = {
|
|
1650
1650
|
name: "WmAttachmentPreview",
|
|
1651
1651
|
inject: {
|
|
1652
1652
|
signAttachmentFn: { default: null }
|
|
@@ -1709,10 +1709,10 @@ const Nn = /* @__PURE__ */ E(Dn, [["render", Un]]), Pn = {
|
|
|
1709
1709
|
"aria-hidden": "true"
|
|
1710
1710
|
};
|
|
1711
1711
|
function Xn(t, e, n, a, r, s) {
|
|
1712
|
-
return l(),
|
|
1712
|
+
return l(), c("div", {
|
|
1713
1713
|
class: B(["wm-att", ["wm-att--" + (s.kind || "file")]])
|
|
1714
1714
|
}, [
|
|
1715
|
-
s.kind === "image" && r.url ? (l(),
|
|
1715
|
+
s.kind === "image" && r.url ? (l(), c("a", {
|
|
1716
1716
|
key: 0,
|
|
1717
1717
|
href: r.url,
|
|
1718
1718
|
target: "_blank",
|
|
@@ -1724,17 +1724,17 @@ function Xn(t, e, n, a, r, s) {
|
|
|
1724
1724
|
alt: s.displayName,
|
|
1725
1725
|
loading: "lazy"
|
|
1726
1726
|
}, null, 8, zn)
|
|
1727
|
-
], 8, Hn)) : s.kind === "audio" && r.url ? (l(),
|
|
1727
|
+
], 8, Hn)) : s.kind === "audio" && r.url ? (l(), c("audio", {
|
|
1728
1728
|
key: 1,
|
|
1729
1729
|
src: r.url,
|
|
1730
1730
|
controls: "",
|
|
1731
1731
|
preload: "metadata"
|
|
1732
|
-
}, null, 8, Vn)) : s.kind === "video" && r.url ? (l(),
|
|
1732
|
+
}, null, 8, Vn)) : s.kind === "video" && r.url ? (l(), c("video", {
|
|
1733
1733
|
key: 2,
|
|
1734
1734
|
src: r.url,
|
|
1735
1735
|
controls: "",
|
|
1736
1736
|
preload: "metadata"
|
|
1737
|
-
}, null, 8, qn)) : (l(),
|
|
1737
|
+
}, null, 8, qn)) : (l(), c("a", {
|
|
1738
1738
|
key: 3,
|
|
1739
1739
|
class: "wm-att__file",
|
|
1740
1740
|
href: r.url || "#",
|
|
@@ -1761,9 +1761,9 @@ function Xn(t, e, n, a, r, s) {
|
|
|
1761
1761
|
], -1)),
|
|
1762
1762
|
i("span", Kn, [
|
|
1763
1763
|
i("span", Gn, b(s.displayName), 1),
|
|
1764
|
-
s.sizeLabel ? (l(),
|
|
1764
|
+
s.sizeLabel ? (l(), c("span", Yn, b(s.sizeLabel), 1)) : y("", !0)
|
|
1765
1765
|
]),
|
|
1766
|
-
r.loading ? (l(),
|
|
1766
|
+
r.loading ? (l(), c("span", Jn)) : y("", !0)
|
|
1767
1767
|
], 8, Wn))
|
|
1768
1768
|
], 2);
|
|
1769
1769
|
}
|
|
@@ -1813,9 +1813,9 @@ function ts(t) {
|
|
|
1813
1813
|
n.push({ type: "block", html: `<ul class="wm-md-ul">${w}</ul>` });
|
|
1814
1814
|
continue;
|
|
1815
1815
|
}
|
|
1816
|
-
const
|
|
1817
|
-
if (
|
|
1818
|
-
const k = parseInt(
|
|
1816
|
+
const d = /^\s*(\d+)\.\s+(.*)$/.exec(s);
|
|
1817
|
+
if (d) {
|
|
1818
|
+
const k = parseInt(d[1], 10), w = [d[2]];
|
|
1819
1819
|
for (a++; a < e.length; ) {
|
|
1820
1820
|
const A = /^\s*\d+\.\s+(.*)$/.exec(e[a]);
|
|
1821
1821
|
if (!A) break;
|
|
@@ -1840,8 +1840,8 @@ function ts(t) {
|
|
|
1840
1840
|
for (let s = 0; s < n.length; s++) {
|
|
1841
1841
|
const o = n[s];
|
|
1842
1842
|
r += o.html;
|
|
1843
|
-
const
|
|
1844
|
-
|
|
1843
|
+
const d = n[s + 1];
|
|
1844
|
+
d && o.type !== "block" && d.type !== "block" && (r += `
|
|
1845
1845
|
`);
|
|
1846
1846
|
}
|
|
1847
1847
|
return r;
|
|
@@ -1860,27 +1860,27 @@ const ns = {
|
|
|
1860
1860
|
}
|
|
1861
1861
|
}, ss = ["innerHTML"];
|
|
1862
1862
|
function rs(t, e, n, a, r, s) {
|
|
1863
|
-
return l(),
|
|
1863
|
+
return l(), c("div", {
|
|
1864
1864
|
class: B(["wm-bubble", "wm-bubble--" + n.role])
|
|
1865
1865
|
}, [
|
|
1866
|
-
|
|
1866
|
+
Me(t.$slots, "default", {}, () => [
|
|
1867
1867
|
i("span", { innerHTML: s.rendered }, null, 8, ss)
|
|
1868
1868
|
], !0)
|
|
1869
1869
|
], 2);
|
|
1870
1870
|
}
|
|
1871
1871
|
const is = /* @__PURE__ */ E(ns, [["render", rs], ["__scopeId", "data-v-5c9e9f2b"]]), as = { name: "WmTyping" }, os = { class: "wm-typing" };
|
|
1872
1872
|
function ls(t, e, n, a, r, s) {
|
|
1873
|
-
return l(),
|
|
1873
|
+
return l(), c("div", os, [...e[0] || (e[0] = [
|
|
1874
1874
|
i("span", { style: { "animation-delay": "0s" } }, null, -1),
|
|
1875
1875
|
i("span", { style: { "animation-delay": "0.2s" } }, null, -1),
|
|
1876
1876
|
i("span", { style: { "animation-delay": "0.4s" } }, null, -1)
|
|
1877
1877
|
])]);
|
|
1878
1878
|
}
|
|
1879
|
-
const
|
|
1880
|
-
function
|
|
1879
|
+
const ds = /* @__PURE__ */ E(as, [["render", ls], ["__scopeId", "data-v-df2447fd"]]);
|
|
1880
|
+
function ee(t) {
|
|
1881
1881
|
return t ? t.client_msg_id || t.id : "";
|
|
1882
1882
|
}
|
|
1883
|
-
const
|
|
1883
|
+
const cs = {
|
|
1884
1884
|
transferred_to_human: "Conversation transférée à un humain",
|
|
1885
1885
|
assigned: "{name} a rejoint la conversation",
|
|
1886
1886
|
unassigned: "L'agent a quitté la conversation",
|
|
@@ -1889,7 +1889,7 @@ const ds = {
|
|
|
1889
1889
|
idle: "Conversation en pause"
|
|
1890
1890
|
}, us = 80, hs = 200, ms = {
|
|
1891
1891
|
name: "WmMessageList",
|
|
1892
|
-
components: { AIAvatar: te, HumanAvatar: ke, Bubble: is, Typing:
|
|
1892
|
+
components: { AIAvatar: te, HumanAvatar: ke, Bubble: is, Typing: ds, ActionResult: Zt, AttachmentPreview: Qn, ArtifactRenderer: Un },
|
|
1893
1893
|
props: {
|
|
1894
1894
|
messages: { type: Array, default: () => [] },
|
|
1895
1895
|
streamingActive: { type: Boolean, default: !1 },
|
|
@@ -1942,7 +1942,7 @@ const ds = {
|
|
|
1942
1942
|
if (((e = s == null ? void 0 : s.payload) == null ? void 0 : e.event) === "action_admin_pending") {
|
|
1943
1943
|
const k = t[t.length - 1];
|
|
1944
1944
|
k && k.role === "ai" ? k.messages.push(s) : t.push({
|
|
1945
|
-
key: `g-${
|
|
1945
|
+
key: `g-${ee(s)}`,
|
|
1946
1946
|
role: "ai",
|
|
1947
1947
|
agentName: "",
|
|
1948
1948
|
agentAvatarUrl: null,
|
|
@@ -1952,7 +1952,7 @@ const ds = {
|
|
|
1952
1952
|
continue;
|
|
1953
1953
|
}
|
|
1954
1954
|
t.push({
|
|
1955
|
-
key: `sys-${
|
|
1955
|
+
key: `sys-${ee(s)}`,
|
|
1956
1956
|
role: o,
|
|
1957
1957
|
messages: [s],
|
|
1958
1958
|
items: [],
|
|
@@ -1960,9 +1960,9 @@ const ds = {
|
|
|
1960
1960
|
});
|
|
1961
1961
|
continue;
|
|
1962
1962
|
}
|
|
1963
|
-
const
|
|
1964
|
-
|
|
1965
|
-
key: `g-${
|
|
1963
|
+
const d = t[t.length - 1];
|
|
1964
|
+
d && d.role === o && (o === "ai" || d.agentName === (((n = s == null ? void 0 : s.author) == null ? void 0 : n.name) || "")) ? d.messages.push(s) : t.push({
|
|
1965
|
+
key: `g-${ee(s)}`,
|
|
1966
1966
|
role: o,
|
|
1967
1967
|
agentName: ((a = s == null ? void 0 : s.author) == null ? void 0 : a.name) || "",
|
|
1968
1968
|
agentAvatarUrl: ((r = s == null ? void 0 : s.author) == null ? void 0 : r.avatar_url) || null,
|
|
@@ -1973,8 +1973,8 @@ const ds = {
|
|
|
1973
1973
|
for (const s of t) {
|
|
1974
1974
|
if (s.role === "system") continue;
|
|
1975
1975
|
const o = [];
|
|
1976
|
-
for (const
|
|
1977
|
-
for (const v of this.itemsOf(
|
|
1976
|
+
for (const d of s.messages)
|
|
1977
|
+
for (const v of this.itemsOf(d)) o.push(v);
|
|
1978
1978
|
s.items = o;
|
|
1979
1979
|
}
|
|
1980
1980
|
return t;
|
|
@@ -2013,7 +2013,7 @@ const ds = {
|
|
|
2013
2013
|
this.scheduleMeasure();
|
|
2014
2014
|
},
|
|
2015
2015
|
methods: {
|
|
2016
|
-
messageKey:
|
|
2016
|
+
messageKey: ee,
|
|
2017
2017
|
isAtBottom(t) {
|
|
2018
2018
|
return t.scrollHeight - t.scrollTop - t.clientHeight <= us;
|
|
2019
2019
|
},
|
|
@@ -2194,10 +2194,10 @@ const ds = {
|
|
|
2194
2194
|
// adjacent à une `bubble`) : mon coin déborde le voisin et
|
|
2195
2195
|
// doit garder son arrondi.
|
|
2196
2196
|
cornersFor(t, e) {
|
|
2197
|
-
var Y,
|
|
2198
|
-
const n = t.items, a = (Y = n[e]) == null ? void 0 : Y.kind, r = (
|
|
2199
|
-
let
|
|
2200
|
-
return o ? (k && (
|
|
2197
|
+
var Y, z, Q;
|
|
2198
|
+
const n = t.items, a = (Y = n[e]) == null ? void 0 : Y.kind, r = (z = n[e - 1]) == null ? void 0 : z.kind, s = (Q = n[e + 1]) == null ? void 0 : Q.kind, o = t.role === "user", d = 14, v = 4, k = r == null ? void 0 : r.bottom, w = s == null ? void 0 : s.top, S = this.widthByKey[this.rowKeyOf(t, e)], R = this.widthByKey[this.rowKeyOf(t, e - 1)], A = this.widthByKey[this.rowKeyOf(t, e + 1)], U = 0.5, x = (W, V, Z) => W != null && S != null ? W + U >= S : V === Z || V === "card" && Z === "bubble";
|
|
2199
|
+
let j = d, P = d, F = d, H = d;
|
|
2200
|
+
return o ? (k && (P = v), (w || !s) && (F = v), k && x(R, k, a == null ? void 0 : a.top) && (j = v), w && x(A, w, a == null ? void 0 : a.bottom) && (H = v)) : (k && (j = v), (w || !s) && (H = v), k && x(R, k, a == null ? void 0 : a.top) && (P = v), w && x(A, w, a == null ? void 0 : a.bottom) && (F = v)), { tl: j, tr: P, br: F, bl: H };
|
|
2201
2201
|
},
|
|
2202
2202
|
// Inline style emitting the four corner CSS variables. Set on
|
|
2203
2203
|
// `.wm-list__row` so they cascade to Bubble/ActionResult/
|
|
@@ -2218,7 +2218,7 @@ const ds = {
|
|
|
2218
2218
|
rowKeyOf(t, e) {
|
|
2219
2219
|
var a;
|
|
2220
2220
|
const n = (a = t == null ? void 0 : t.items) == null ? void 0 : a[e];
|
|
2221
|
-
return n ? `${
|
|
2221
|
+
return n ? `${ee(n.message)}-${n.partKey}` : "";
|
|
2222
2222
|
},
|
|
2223
2223
|
// rAF-debouncé : `updated()` peut être appelé en rafale (stream,
|
|
2224
2224
|
// typing, scroll), un seul flush layout par frame suffit.
|
|
@@ -2238,9 +2238,9 @@ const ds = {
|
|
|
2238
2238
|
for (const s of t.querySelectorAll(".wm-list__row[data-row-key]")) {
|
|
2239
2239
|
const o = s.dataset.rowKey;
|
|
2240
2240
|
if (!o) continue;
|
|
2241
|
-
const
|
|
2242
|
-
if (!
|
|
2243
|
-
const v =
|
|
2241
|
+
const d = s.querySelector(".wm-bubble, .wm-result, .wm-art, .wm-list__body");
|
|
2242
|
+
if (!d) continue;
|
|
2243
|
+
const v = d.getBoundingClientRect().width;
|
|
2244
2244
|
v > 0 && (e[o] = v);
|
|
2245
2245
|
}
|
|
2246
2246
|
const n = this.widthByKey, a = Object.keys(n), r = Object.keys(e);
|
|
@@ -2292,9 +2292,9 @@ const ds = {
|
|
|
2292
2292
|
return ((e = t == null ? void 0 : t.payload) == null ? void 0 : e.name) || (t == null ? void 0 : t.text_md) || "Action";
|
|
2293
2293
|
},
|
|
2294
2294
|
actionDetail(t) {
|
|
2295
|
-
var n, a, r, s, o,
|
|
2295
|
+
var n, a, r, s, o, d;
|
|
2296
2296
|
const e = t == null ? void 0 : t.payload;
|
|
2297
|
-
return e ? e.state === "success" ? ((n = e.success) == null ? void 0 : n.summary) || ((r = (a = e.success) == null ? void 0 : a.metadata) == null ? void 0 : r.description) || "" : e.state === "rejected" ? ((s = e.rejected) == null ? void 0 : s.reason) || "Action annulée par l'utilisateur." : e.state === "failure" && (((o = e.failure) == null ? void 0 : o.summary) || ((
|
|
2297
|
+
return e ? e.state === "success" ? ((n = e.success) == null ? void 0 : n.summary) || ((r = (a = e.success) == null ? void 0 : a.metadata) == null ? void 0 : r.description) || "" : e.state === "rejected" ? ((s = e.rejected) == null ? void 0 : s.reason) || "Action annulée par l'utilisateur." : e.state === "failure" && (((o = e.failure) == null ? void 0 : o.summary) || ((d = e.failure) == null ? void 0 : d.error)) || "" : "";
|
|
2298
2298
|
},
|
|
2299
2299
|
actionArtifact(t) {
|
|
2300
2300
|
var n, a;
|
|
@@ -2303,7 +2303,7 @@ const ds = {
|
|
|
2303
2303
|
},
|
|
2304
2304
|
systemLabel(t) {
|
|
2305
2305
|
var r, s, o;
|
|
2306
|
-
const e = (r = t == null ? void 0 : t.payload) == null ? void 0 : r.event, n =
|
|
2306
|
+
const e = (r = t == null ? void 0 : t.payload) == null ? void 0 : r.event, n = cs[e] || (t == null ? void 0 : t.text_md) || "Mise à jour de la conversation", a = ((s = t == null ? void 0 : t.metadata) == null ? void 0 : s.agent_name) || ((o = t == null ? void 0 : t.author) == null ? void 0 : o.name) || "";
|
|
2307
2307
|
return n.replace("{name}", a || "Un agent");
|
|
2308
2308
|
},
|
|
2309
2309
|
scrollToBottom() {
|
|
@@ -2322,10 +2322,10 @@ const ds = {
|
|
|
2322
2322
|
}, ps = {
|
|
2323
2323
|
key: 2,
|
|
2324
2324
|
class: "wm-list__sep"
|
|
2325
|
-
}, vs = { class: "wm-list__sep-label" },
|
|
2325
|
+
}, vs = { class: "wm-list__sep-label" }, gs = {
|
|
2326
2326
|
key: 0,
|
|
2327
2327
|
class: "wm-list__sep wm-list__sep--unread"
|
|
2328
|
-
},
|
|
2328
|
+
}, ys = {
|
|
2329
2329
|
key: 0,
|
|
2330
2330
|
class: "wm-list__sysep"
|
|
2331
2331
|
}, ws = { class: "wm-list__sysep-label" }, bs = ["data-row-key"], ks = {
|
|
@@ -2337,66 +2337,66 @@ const ds = {
|
|
|
2337
2337
|
}, As = { key: 0 }, Ss = {
|
|
2338
2338
|
key: 1,
|
|
2339
2339
|
"aria-hidden": "true"
|
|
2340
|
-
}, xs = { key: 2 },
|
|
2340
|
+
}, xs = { key: 2 }, Ts = {
|
|
2341
2341
|
key: 3,
|
|
2342
2342
|
class: "wm-list__row wm-list__row--ai fade-up"
|
|
2343
|
-
},
|
|
2343
|
+
}, Ms = { class: "wm-list__avatarSlot" };
|
|
2344
2344
|
function Os(t, e, n, a, r, s) {
|
|
2345
|
-
const o = I("AIAvatar"),
|
|
2346
|
-
return l(),
|
|
2345
|
+
const o = I("AIAvatar"), d = I("HumanAvatar"), v = I("ActionResult"), k = I("ArtifactRenderer"), w = I("Bubble"), S = I("AttachmentPreview"), R = I("Typing");
|
|
2346
|
+
return l(), c("div", {
|
|
2347
2347
|
ref: "scrollEl",
|
|
2348
2348
|
class: B(["wm-list", { "wm-list--silent": r.silentFades }]),
|
|
2349
2349
|
onScrollPassive: e[0] || (e[0] = (...A) => s.onScroll && s.onScroll(...A))
|
|
2350
2350
|
}, [
|
|
2351
|
-
n.loadingMore ? (l(),
|
|
2351
|
+
n.loadingMore ? (l(), c("div", fs, [...e[1] || (e[1] = [
|
|
2352
2352
|
i("span", {
|
|
2353
2353
|
class: "wm-list__loadMore-spinner",
|
|
2354
2354
|
"aria-hidden": "true"
|
|
2355
2355
|
}, null, -1),
|
|
2356
2356
|
i("span", { class: "wm-list__loadMore-lbl" }, "Chargement de l'historique…", -1)
|
|
2357
|
-
])])) : s.historyExhausted ? (l(),
|
|
2358
|
-
n.dateLabel ? (l(),
|
|
2357
|
+
])])) : s.historyExhausted ? (l(), c("div", _s, "Début de la conversation")) : y("", !0),
|
|
2358
|
+
n.dateLabel ? (l(), c("div", ps, [
|
|
2359
2359
|
e[2] || (e[2] = i("div", { class: "wm-list__line" }, null, -1)),
|
|
2360
2360
|
i("span", vs, b(n.dateLabel), 1),
|
|
2361
2361
|
e[3] || (e[3] = i("div", { class: "wm-list__line" }, null, -1))
|
|
2362
|
-
])) :
|
|
2363
|
-
(l(!0),
|
|
2362
|
+
])) : y("", !0),
|
|
2363
|
+
(l(!0), c(T, null, D(s.groups, (A, U) => (l(), c(T, {
|
|
2364
2364
|
key: A.key
|
|
2365
2365
|
}, [
|
|
2366
|
-
A.key === s.unreadGroupKey ? (l(),
|
|
2366
|
+
A.key === s.unreadGroupKey ? (l(), c("div", gs, [...e[4] || (e[4] = [
|
|
2367
2367
|
i("div", { class: "wm-list__line wm-list__line--unread" }, null, -1),
|
|
2368
2368
|
i("span", { class: "wm-list__sep-label wm-list__sep-label--unread" }, "Non lus", -1),
|
|
2369
2369
|
i("div", { class: "wm-list__line wm-list__line--unread" }, null, -1)
|
|
2370
|
-
])])) :
|
|
2371
|
-
A.role === "system" || A.items.length ? (l(),
|
|
2370
|
+
])])) : y("", !0),
|
|
2371
|
+
A.role === "system" || A.items.length ? (l(), c("div", {
|
|
2372
2372
|
key: 1,
|
|
2373
2373
|
class: B(["wm-list__group", "wm-list__group--" + A.role])
|
|
2374
2374
|
}, [
|
|
2375
|
-
A.role === "system" ? (l(),
|
|
2375
|
+
A.role === "system" ? (l(), c("div", ys, [
|
|
2376
2376
|
e[5] || (e[5] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1)),
|
|
2377
2377
|
i("span", ws, b(A.systemLabel), 1),
|
|
2378
2378
|
e[6] || (e[6] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
|
|
2379
|
-
])) : (l(),
|
|
2380
|
-
(l(!0),
|
|
2379
|
+
])) : (l(), c(T, { key: 1 }, [
|
|
2380
|
+
(l(!0), c(T, null, D(A.items, (x, j) => (l(), c("div", {
|
|
2381
2381
|
key: `${s.messageKey(x.message)}-${x.partKey}`,
|
|
2382
2382
|
"data-row-key": `${s.messageKey(x.message)}-${x.partKey}`,
|
|
2383
2383
|
class: B(["wm-list__row fade-up", ["wm-list__row--" + A.role, { "is-pending": x.message._pending, "is-failed": x.message._failed }]]),
|
|
2384
|
-
style: G(s.cornersStyle(A,
|
|
2384
|
+
style: G(s.cornersStyle(A, j))
|
|
2385
2385
|
}, [
|
|
2386
|
-
A.role !== "user" ? (l(),
|
|
2387
|
-
|
|
2386
|
+
A.role !== "user" ? (l(), c("div", ks, [
|
|
2387
|
+
j === A.items.length - 1 ? (l(), c(T, { key: 0 }, [
|
|
2388
2388
|
A.role === "ai" ? (l(), $(o, {
|
|
2389
2389
|
key: 0,
|
|
2390
2390
|
size: 26,
|
|
2391
2391
|
tail: !0
|
|
2392
|
-
})) : (l(), $(
|
|
2392
|
+
})) : (l(), $(d, {
|
|
2393
2393
|
key: 1,
|
|
2394
2394
|
name: A.agentName,
|
|
2395
2395
|
"avatar-url": A.agentAvatarUrl,
|
|
2396
2396
|
size: 26
|
|
2397
2397
|
}, null, 8, ["name", "avatar-url"]))
|
|
2398
|
-
], 64)) :
|
|
2399
|
-
])) :
|
|
2398
|
+
], 64)) : y("", !0)
|
|
2399
|
+
])) : y("", !0),
|
|
2400
2400
|
x.renderAs === "action" ? (l(), $(v, {
|
|
2401
2401
|
key: 1,
|
|
2402
2402
|
state: x.message.payload.state,
|
|
@@ -2413,48 +2413,48 @@ function Os(t, e, n, a, r, s) {
|
|
|
2413
2413
|
}, null, 8, ["artifact"])) : x.renderAs === "artifact" ? (l(), $(k, {
|
|
2414
2414
|
key: 4,
|
|
2415
2415
|
artifact: s.artifactOf(x.message)
|
|
2416
|
-
}, null, 8, ["artifact"])) : (l(),
|
|
2416
|
+
}, null, 8, ["artifact"])) : (l(), c("div", Cs, [
|
|
2417
2417
|
x.message.text_md ? (l(), $(w, {
|
|
2418
2418
|
key: 0,
|
|
2419
2419
|
role: A.role,
|
|
2420
2420
|
text: x.message.text_md
|
|
2421
|
-
}, null, 8, ["role", "text"])) :
|
|
2422
|
-
s.attachmentsOf(x.message).length ? (l(),
|
|
2421
|
+
}, null, 8, ["role", "text"])) : y("", !0),
|
|
2422
|
+
s.attachmentsOf(x.message).length ? (l(), c("div", {
|
|
2423
2423
|
key: 1,
|
|
2424
2424
|
class: B(["wm-list__atts", { "wm-list__atts--align-end": A.role === "user" }])
|
|
2425
2425
|
}, [
|
|
2426
|
-
(l(!0),
|
|
2427
|
-
key: `${s.messageKey(x.message)}-att-${
|
|
2428
|
-
attachment:
|
|
2426
|
+
(l(!0), c(T, null, D(s.attachmentsOf(x.message), (P, F) => (l(), $(S, {
|
|
2427
|
+
key: `${s.messageKey(x.message)}-att-${F}`,
|
|
2428
|
+
attachment: P
|
|
2429
2429
|
}, null, 8, ["attachment"]))), 128))
|
|
2430
|
-
], 2)) :
|
|
2430
|
+
], 2)) : y("", !0)
|
|
2431
2431
|
]))
|
|
2432
2432
|
], 14, bs))), 128)),
|
|
2433
|
-
(A.role !== "user" || s.lastTimeOf(A)) && !s.hasTrailingOverlay(A) ? (l(),
|
|
2433
|
+
(A.role !== "user" || s.lastTimeOf(A)) && !s.hasTrailingOverlay(A) ? (l(), c("div", {
|
|
2434
2434
|
key: 0,
|
|
2435
2435
|
class: B(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
|
|
2436
2436
|
}, [
|
|
2437
|
-
A.role !== "user" ? (l(),
|
|
2438
|
-
A.role !== "user" && s.lastTimeOf(A) ? (l(),
|
|
2439
|
-
s.lastTimeOf(A) ? (l(),
|
|
2440
|
-
], 2)) :
|
|
2437
|
+
A.role !== "user" ? (l(), c("span", As, b(s.roleLabel(A)), 1)) : y("", !0),
|
|
2438
|
+
A.role !== "user" && s.lastTimeOf(A) ? (l(), c("span", Ss, "·")) : y("", !0),
|
|
2439
|
+
s.lastTimeOf(A) ? (l(), c("span", xs, b(s.lastTimeOf(A)), 1)) : y("", !0)
|
|
2440
|
+
], 2)) : y("", !0)
|
|
2441
2441
|
], 64))
|
|
2442
|
-
], 2)) :
|
|
2442
|
+
], 2)) : y("", !0)
|
|
2443
2443
|
], 64))), 128)),
|
|
2444
|
-
n.streamingActive ? (l(),
|
|
2445
|
-
i("div",
|
|
2444
|
+
n.streamingActive ? (l(), c("div", Ts, [
|
|
2445
|
+
i("div", Ms, [
|
|
2446
2446
|
K(o, {
|
|
2447
2447
|
size: 26,
|
|
2448
2448
|
tail: !0
|
|
2449
2449
|
})
|
|
2450
2450
|
]),
|
|
2451
2451
|
K(R)
|
|
2452
|
-
])) :
|
|
2452
|
+
])) : y("", !0)
|
|
2453
2453
|
], 34);
|
|
2454
2454
|
}
|
|
2455
|
-
const Is = /* @__PURE__ */ E(ms, [["render", Os], ["__scopeId", "data-v-6bd35fa5"]]),
|
|
2455
|
+
const Is = /* @__PURE__ */ E(ms, [["render", Os], ["__scopeId", "data-v-6bd35fa5"]]), oe = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", me = typeof window < "u" && typeof window.MediaRecorder < "u";
|
|
2456
2456
|
function Bs() {
|
|
2457
|
-
return
|
|
2457
|
+
return me && [
|
|
2458
2458
|
"video/webm;codecs=vp9,opus",
|
|
2459
2459
|
"video/webm;codecs=vp8,opus",
|
|
2460
2460
|
"video/webm",
|
|
@@ -2473,11 +2473,11 @@ function Ce({ audio: t }) {
|
|
|
2473
2473
|
systemAudio: t ? "include" : "exclude"
|
|
2474
2474
|
};
|
|
2475
2475
|
}
|
|
2476
|
-
function
|
|
2476
|
+
function ea(t) {
|
|
2477
2477
|
return t ? t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : "file" : "file";
|
|
2478
2478
|
}
|
|
2479
2479
|
async function Es() {
|
|
2480
|
-
if (!
|
|
2480
|
+
if (!oe) return null;
|
|
2481
2481
|
let t;
|
|
2482
2482
|
try {
|
|
2483
2483
|
t = await navigator.mediaDevices.getDisplayMedia(Ce({ audio: !1 }));
|
|
@@ -2485,7 +2485,7 @@ async function Es() {
|
|
|
2485
2485
|
return (e == null ? void 0 : e.name) !== "NotAllowedError" && console.error("[media] screenshot picker", e), null;
|
|
2486
2486
|
}
|
|
2487
2487
|
try {
|
|
2488
|
-
return await
|
|
2488
|
+
return await $s(t);
|
|
2489
2489
|
} catch (e) {
|
|
2490
2490
|
return console.error("[media] screenshot capture", e), null;
|
|
2491
2491
|
} finally {
|
|
@@ -2494,19 +2494,19 @@ async function Es() {
|
|
|
2494
2494
|
});
|
|
2495
2495
|
}
|
|
2496
2496
|
}
|
|
2497
|
-
async function
|
|
2497
|
+
async function $s(t) {
|
|
2498
2498
|
const e = document.createElement("video");
|
|
2499
|
-
e.muted = !0, e.playsInline = !0, e.srcObject = t, await e.play(), await new Promise((
|
|
2499
|
+
e.muted = !0, e.playsInline = !0, e.srcObject = t, await e.play(), await new Promise((d) => requestAnimationFrame(d));
|
|
2500
2500
|
const n = e.videoWidth || 1280, a = e.videoHeight || 720, r = document.createElement("canvas");
|
|
2501
2501
|
r.width = n, r.height = a, r.getContext("2d").drawImage(e, 0, 0, n, a);
|
|
2502
|
-
const s = await new Promise((
|
|
2503
|
-
r.toBlob((k) => k ?
|
|
2502
|
+
const s = await new Promise((d, v) => {
|
|
2503
|
+
r.toBlob((k) => k ? d(k) : v(new Error("toBlob failed")), "image/png");
|
|
2504
2504
|
}), o = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
2505
2505
|
return new File([s], `capture-${o}.png`, { type: "image/png" });
|
|
2506
2506
|
}
|
|
2507
|
-
async function
|
|
2507
|
+
async function Ls(t = {}) {
|
|
2508
2508
|
var k;
|
|
2509
|
-
if (!
|
|
2509
|
+
if (!oe || !me) return null;
|
|
2510
2510
|
let e;
|
|
2511
2511
|
try {
|
|
2512
2512
|
e = await navigator.mediaDevices.getDisplayMedia(Ce({ audio: !0 }));
|
|
@@ -2531,14 +2531,14 @@ async function $s(t = {}) {
|
|
|
2531
2531
|
if (s && clearInterval(s), e.getTracks().forEach((R) => {
|
|
2532
2532
|
R.stop();
|
|
2533
2533
|
}), r.length) {
|
|
2534
|
-
const R = a.mimeType || n || "video/webm", A = new Blob(r, { type: R }),
|
|
2535
|
-
(w = t.onfinalize) == null || w.call(t,
|
|
2534
|
+
const R = a.mimeType || n || "video/webm", A = new Blob(r, { type: R }), U = /mp4/.test(R) ? "mp4" : "webm", x = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), j = new File([A], `ecran-${x}.${U}`, { type: R });
|
|
2535
|
+
(w = t.onfinalize) == null || w.call(t, j);
|
|
2536
2536
|
} else
|
|
2537
2537
|
(S = t.oncancel) == null || S.call(t);
|
|
2538
2538
|
}), e.getVideoTracks().forEach((w) => {
|
|
2539
|
-
w.addEventListener("ended", () =>
|
|
2539
|
+
w.addEventListener("ended", () => d(), { once: !0 });
|
|
2540
2540
|
});
|
|
2541
|
-
function
|
|
2541
|
+
function d() {
|
|
2542
2542
|
if (!o && (o = !0, a.state !== "inactive"))
|
|
2543
2543
|
try {
|
|
2544
2544
|
a.stop();
|
|
@@ -2559,7 +2559,7 @@ async function $s(t = {}) {
|
|
|
2559
2559
|
var w;
|
|
2560
2560
|
(w = t.ontick) == null || w.call(t, Date.now() - v);
|
|
2561
2561
|
}, 500), {
|
|
2562
|
-
stop:
|
|
2562
|
+
stop: d,
|
|
2563
2563
|
get state() {
|
|
2564
2564
|
return a.state;
|
|
2565
2565
|
}
|
|
@@ -2606,7 +2606,7 @@ const Rs = [
|
|
|
2606
2606
|
attachItems() {
|
|
2607
2607
|
return Rs.map((t) => ({
|
|
2608
2608
|
...t,
|
|
2609
|
-
disabled: t.action === "screenshot" && !
|
|
2609
|
+
disabled: t.action === "screenshot" && !oe || t.action === "record" && (!oe || !me)
|
|
2610
2610
|
}));
|
|
2611
2611
|
},
|
|
2612
2612
|
recordingElapsedLabel() {
|
|
@@ -2682,7 +2682,7 @@ const Rs = [
|
|
|
2682
2682
|
async startRecording() {
|
|
2683
2683
|
if (this.recording || this.disabled) return;
|
|
2684
2684
|
this.recordingElapsed = 0;
|
|
2685
|
-
const t = await
|
|
2685
|
+
const t = await Ls({
|
|
2686
2686
|
onstart: () => {
|
|
2687
2687
|
this.recording = !0;
|
|
2688
2688
|
},
|
|
@@ -2707,10 +2707,10 @@ const Rs = [
|
|
|
2707
2707
|
}
|
|
2708
2708
|
}
|
|
2709
2709
|
}
|
|
2710
|
-
},
|
|
2710
|
+
}, Ds = { class: "wm-compose-wrap" }, Ns = {
|
|
2711
2711
|
key: 0,
|
|
2712
2712
|
class: "wm-rec"
|
|
2713
|
-
},
|
|
2713
|
+
}, js = { class: "wm-rec__lbl" }, Us = {
|
|
2714
2714
|
key: 1,
|
|
2715
2715
|
class: "wm-compose__menu",
|
|
2716
2716
|
role: "menu"
|
|
@@ -2721,22 +2721,22 @@ const Rs = [
|
|
|
2721
2721
|
"aria-hidden": "true"
|
|
2722
2722
|
}, Vs = ["d"], qs = ["placeholder", "disabled"], Ws = { class: "wm-compose__actions" }, Ks = ["title", "aria-label", "disabled"], Gs = ["disabled"];
|
|
2723
2723
|
function Ys(t, e, n, a, r, s) {
|
|
2724
|
-
return l(),
|
|
2725
|
-
r.recording ? (l(),
|
|
2724
|
+
return l(), c("div", Ds, [
|
|
2725
|
+
r.recording ? (l(), c("div", Ns, [
|
|
2726
2726
|
e[8] || (e[8] = i("span", {
|
|
2727
2727
|
class: "wm-rec__dot",
|
|
2728
2728
|
"aria-hidden": "true"
|
|
2729
2729
|
}, null, -1)),
|
|
2730
|
-
i("span",
|
|
2730
|
+
i("span", js, "Enregistrement · " + b(s.recordingElapsedLabel), 1),
|
|
2731
2731
|
i("button", {
|
|
2732
2732
|
type: "button",
|
|
2733
2733
|
class: "wm-rec__stop",
|
|
2734
2734
|
onClick: e[0] || (e[0] = (...o) => s.stopRecording && s.stopRecording(...o))
|
|
2735
2735
|
}, "Arrêter")
|
|
2736
|
-
])) :
|
|
2736
|
+
])) : y("", !0),
|
|
2737
2737
|
i("form", {
|
|
2738
2738
|
class: B(["wm-compose", { "has-attach": r.attachOpen }]),
|
|
2739
|
-
onSubmit: e[7] || (e[7] =
|
|
2739
|
+
onSubmit: e[7] || (e[7] = X((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]))
|
|
2740
2740
|
}, [
|
|
2741
2741
|
i("input", {
|
|
2742
2742
|
ref: "fileEl",
|
|
@@ -2745,21 +2745,21 @@ function Ys(t, e, n, a, r, s) {
|
|
|
2745
2745
|
multiple: "",
|
|
2746
2746
|
onChange: e[1] || (e[1] = (...o) => s.onFile && s.onFile(...o))
|
|
2747
2747
|
}, null, 544),
|
|
2748
|
-
r.attachOpen ? (l(),
|
|
2748
|
+
r.attachOpen ? (l(), c("div", {
|
|
2749
2749
|
key: 0,
|
|
2750
2750
|
class: "wm-compose__overlay",
|
|
2751
2751
|
onClick: e[2] || (e[2] = (o) => r.attachOpen = !1)
|
|
2752
|
-
})) :
|
|
2753
|
-
r.attachOpen ? (l(),
|
|
2754
|
-
(l(!0),
|
|
2752
|
+
})) : y("", !0),
|
|
2753
|
+
r.attachOpen ? (l(), c("div", Us, [
|
|
2754
|
+
(l(!0), c(T, null, D(s.attachItems, (o) => (l(), c("button", {
|
|
2755
2755
|
key: o.action,
|
|
2756
2756
|
type: "button",
|
|
2757
2757
|
class: "wm-compose__menuItem",
|
|
2758
2758
|
disabled: o.disabled,
|
|
2759
|
-
onClick: (
|
|
2759
|
+
onClick: (d) => s.onAttachAction(o.action)
|
|
2760
2760
|
}, [
|
|
2761
2761
|
i("span", Hs, [
|
|
2762
|
-
(l(),
|
|
2762
|
+
(l(), c("svg", zs, [
|
|
2763
2763
|
i("path", {
|
|
2764
2764
|
d: o.path,
|
|
2765
2765
|
stroke: "currentColor",
|
|
@@ -2772,8 +2772,8 @@ function Ys(t, e, n, a, r, s) {
|
|
|
2772
2772
|
]),
|
|
2773
2773
|
i("span", null, b(o.label), 1)
|
|
2774
2774
|
], 8, Ps))), 128))
|
|
2775
|
-
])) :
|
|
2776
|
-
|
|
2775
|
+
])) : y("", !0),
|
|
2776
|
+
q(i("textarea", {
|
|
2777
2777
|
ref: "inputEl",
|
|
2778
2778
|
"onUpdate:modelValue": e[3] || (e[3] = (o) => r.local = o),
|
|
2779
2779
|
class: "wm-compose__input",
|
|
@@ -2783,7 +2783,7 @@ function Ys(t, e, n, a, r, s) {
|
|
|
2783
2783
|
onKeydown: e[4] || (e[4] = (...o) => s.onKeydown && s.onKeydown(...o)),
|
|
2784
2784
|
onInput: e[5] || (e[5] = (...o) => s.autosize && s.autosize(...o))
|
|
2785
2785
|
}, null, 40, qs), [
|
|
2786
|
-
[
|
|
2786
|
+
[J, r.local]
|
|
2787
2787
|
]),
|
|
2788
2788
|
i("div", Ws, [
|
|
2789
2789
|
i("button", {
|
|
@@ -2851,18 +2851,18 @@ const Js = /* @__PURE__ */ E(Fs, [["render", Ys], ["__scopeId", "data-v-14fa9ec0
|
|
|
2851
2851
|
}
|
|
2852
2852
|
}, Qs = ["onClick"];
|
|
2853
2853
|
function Zs(t, e, n, a, r, s) {
|
|
2854
|
-
return n.items.length ? (l(),
|
|
2854
|
+
return n.items.length ? (l(), c("div", {
|
|
2855
2855
|
key: s.batchKey,
|
|
2856
2856
|
class: "wm-chips"
|
|
2857
2857
|
}, [
|
|
2858
|
-
(l(!0),
|
|
2859
|
-
key:
|
|
2858
|
+
(l(!0), c(T, null, D(n.items, (o, d) => (l(), c("button", {
|
|
2859
|
+
key: d,
|
|
2860
2860
|
type: "button",
|
|
2861
2861
|
class: "wm-chip",
|
|
2862
|
-
style: G({ animationDelay: n.baseDelay +
|
|
2862
|
+
style: G({ animationDelay: n.baseDelay + d * n.stepDelay + "ms" }),
|
|
2863
2863
|
onClick: (v) => t.$emit("select", o)
|
|
2864
2864
|
}, b(o.label), 13, Qs))), 128))
|
|
2865
|
-
])) :
|
|
2865
|
+
])) : y("", !0);
|
|
2866
2866
|
}
|
|
2867
2867
|
const er = /* @__PURE__ */ E(Xs, [["render", Zs], ["__scopeId", "data-v-55aa529d"]]), tr = {
|
|
2868
2868
|
name: "WmApprovalCard",
|
|
@@ -2901,35 +2901,35 @@ const er = /* @__PURE__ */ E(Xs, [["render", Zs], ["__scopeId", "data-v-55aa529d
|
|
|
2901
2901
|
key: 0,
|
|
2902
2902
|
class: "wm-approval__detail"
|
|
2903
2903
|
}, lr = { class: "wm-approval__actions" };
|
|
2904
|
-
function
|
|
2904
|
+
function dr(t, e, n, a, r, s) {
|
|
2905
2905
|
const o = I("AIAvatar");
|
|
2906
|
-
return l(),
|
|
2906
|
+
return l(), c("div", nr, [
|
|
2907
2907
|
i("div", sr, [
|
|
2908
2908
|
i("div", rr, [
|
|
2909
2909
|
K(o, { size: 24 })
|
|
2910
2910
|
]),
|
|
2911
2911
|
i("div", ir, [
|
|
2912
2912
|
i("div", ar, b(n.action), 1),
|
|
2913
|
-
n.detail ? (l(),
|
|
2913
|
+
n.detail ? (l(), c("div", or, b(n.detail), 1)) : y("", !0)
|
|
2914
2914
|
])
|
|
2915
2915
|
]),
|
|
2916
2916
|
i("div", lr, [
|
|
2917
|
-
s.rejectId ? (l(),
|
|
2917
|
+
s.rejectId ? (l(), c("button", {
|
|
2918
2918
|
key: 0,
|
|
2919
2919
|
type: "button",
|
|
2920
2920
|
class: "wm-approval__btn wm-approval__btn--neutral",
|
|
2921
|
-
onClick: e[0] || (e[0] = (
|
|
2922
|
-
}, b(s.rejectLabel), 1)) :
|
|
2923
|
-
s.approveId ? (l(),
|
|
2921
|
+
onClick: e[0] || (e[0] = (d) => t.$emit("callback", s.rejectId))
|
|
2922
|
+
}, b(s.rejectLabel), 1)) : y("", !0),
|
|
2923
|
+
s.approveId ? (l(), c("button", {
|
|
2924
2924
|
key: 1,
|
|
2925
2925
|
type: "button",
|
|
2926
2926
|
class: "wm-approval__btn wm-approval__btn--primary",
|
|
2927
|
-
onClick: e[1] || (e[1] = (
|
|
2928
|
-
}, b(s.approveLabel), 1)) :
|
|
2927
|
+
onClick: e[1] || (e[1] = (d) => t.$emit("callback", s.approveId))
|
|
2928
|
+
}, b(s.approveLabel), 1)) : y("", !0)
|
|
2929
2929
|
])
|
|
2930
2930
|
]);
|
|
2931
2931
|
}
|
|
2932
|
-
const
|
|
2932
|
+
const cr = /* @__PURE__ */ E(tr, [["render", dr], ["__scopeId", "data-v-b1be139c"]]);
|
|
2933
2933
|
let ve = 0;
|
|
2934
2934
|
const ur = /* @__PURE__ */ new Set([
|
|
2935
2935
|
"text",
|
|
@@ -3013,17 +3013,17 @@ const ur = /* @__PURE__ */ new Set([
|
|
|
3013
3013
|
}
|
|
3014
3014
|
}
|
|
3015
3015
|
}
|
|
3016
|
-
}, mr = { class: "wm-form" }, fr = { class: "wm-form__head" }, _r = { class: "wm-form__icon" }, pr = { class: "wm-form__main" }, vr = { class: "wm-form__title" },
|
|
3016
|
+
}, mr = { class: "wm-form" }, fr = { class: "wm-form__head" }, _r = { class: "wm-form__icon" }, pr = { class: "wm-form__main" }, vr = { class: "wm-form__title" }, gr = {
|
|
3017
3017
|
key: 0,
|
|
3018
3018
|
class: "wm-form__detail"
|
|
3019
|
-
},
|
|
3019
|
+
}, yr = ["for"], wr = {
|
|
3020
3020
|
key: 0,
|
|
3021
3021
|
class: "wm-form__req",
|
|
3022
3022
|
"aria-hidden": "true"
|
|
3023
3023
|
}, br = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], kr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], Cr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], Ar = ["id", "onUpdate:modelValue", "required", "disabled"], Sr = {
|
|
3024
3024
|
key: 4,
|
|
3025
3025
|
class: "wm-form__bool"
|
|
3026
|
-
}, xr = ["id", "onUpdate:modelValue", "disabled"],
|
|
3026
|
+
}, xr = ["id", "onUpdate:modelValue", "disabled"], Tr = ["id", "onUpdate:modelValue", "required", "disabled"], Mr = {
|
|
3027
3027
|
value: "",
|
|
3028
3028
|
disabled: ""
|
|
3029
3029
|
}, Or = ["value"], Ir = {
|
|
@@ -3032,7 +3032,7 @@ const ur = /* @__PURE__ */ new Set([
|
|
|
3032
3032
|
}, Br = ["value", "checked", "disabled", "onChange"], Er = {
|
|
3033
3033
|
key: 0,
|
|
3034
3034
|
class: "wm-form__err"
|
|
3035
|
-
},
|
|
3035
|
+
}, $r = ["disabled"], Lr = {
|
|
3036
3036
|
key: 0,
|
|
3037
3037
|
class: "wm-form__spinner",
|
|
3038
3038
|
"aria-hidden": "true"
|
|
@@ -3042,134 +3042,134 @@ const ur = /* @__PURE__ */ new Set([
|
|
|
3042
3042
|
};
|
|
3043
3043
|
function Fr(t, e, n, a, r, s) {
|
|
3044
3044
|
const o = I("AIAvatar");
|
|
3045
|
-
return l(),
|
|
3045
|
+
return l(), c("div", mr, [
|
|
3046
3046
|
i("div", fr, [
|
|
3047
3047
|
i("div", _r, [
|
|
3048
3048
|
K(o, { size: 24 })
|
|
3049
3049
|
]),
|
|
3050
3050
|
i("div", pr, [
|
|
3051
3051
|
i("div", vr, b(n.form.title || "Formulaire"), 1),
|
|
3052
|
-
n.form.description ? (l(),
|
|
3052
|
+
n.form.description ? (l(), c("div", gr, b(n.form.description), 1)) : y("", !0)
|
|
3053
3053
|
])
|
|
3054
3054
|
]),
|
|
3055
3055
|
i("form", {
|
|
3056
3056
|
class: "wm-form__body",
|
|
3057
|
-
onSubmit: e[0] || (e[0] =
|
|
3057
|
+
onSubmit: e[0] || (e[0] = X((...d) => s.onSubmit && s.onSubmit(...d), ["prevent"]))
|
|
3058
3058
|
}, [
|
|
3059
|
-
(l(!0),
|
|
3060
|
-
key:
|
|
3059
|
+
(l(!0), c(T, null, D(s.normalizedFields, (d) => (l(), c("div", {
|
|
3060
|
+
key: d.key,
|
|
3061
3061
|
class: "wm-form__field"
|
|
3062
3062
|
}, [
|
|
3063
3063
|
i("label", {
|
|
3064
|
-
for: `wm-f-${r._uid}-${
|
|
3064
|
+
for: `wm-f-${r._uid}-${d.key}`,
|
|
3065
3065
|
class: "wm-form__label"
|
|
3066
3066
|
}, [
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
], 8,
|
|
3070
|
-
|
|
3067
|
+
de(b(d.label), 1),
|
|
3068
|
+
d.required ? (l(), c("span", wr, "*")) : y("", !0)
|
|
3069
|
+
], 8, yr),
|
|
3070
|
+
d.type === "text" ? q((l(), c("input", {
|
|
3071
3071
|
key: 0,
|
|
3072
|
-
id: `wm-f-${r._uid}-${
|
|
3073
|
-
"onUpdate:modelValue": (v) => r.values[
|
|
3072
|
+
id: `wm-f-${r._uid}-${d.key}`,
|
|
3073
|
+
"onUpdate:modelValue": (v) => r.values[d.key] = v,
|
|
3074
3074
|
type: "text",
|
|
3075
3075
|
class: "wm-form__input",
|
|
3076
|
-
placeholder:
|
|
3077
|
-
required:
|
|
3076
|
+
placeholder: d.placeholder || "",
|
|
3077
|
+
required: d.required,
|
|
3078
3078
|
disabled: n.readOnly || r.busy
|
|
3079
3079
|
}, null, 8, br)), [
|
|
3080
|
-
[
|
|
3081
|
-
]) :
|
|
3080
|
+
[J, r.values[d.key]]
|
|
3081
|
+
]) : d.type === "textarea" ? q((l(), c("textarea", {
|
|
3082
3082
|
key: 1,
|
|
3083
|
-
id: `wm-f-${r._uid}-${
|
|
3084
|
-
"onUpdate:modelValue": (v) => r.values[
|
|
3083
|
+
id: `wm-f-${r._uid}-${d.key}`,
|
|
3084
|
+
"onUpdate:modelValue": (v) => r.values[d.key] = v,
|
|
3085
3085
|
class: "wm-form__textarea",
|
|
3086
3086
|
rows: "3",
|
|
3087
|
-
placeholder:
|
|
3088
|
-
required:
|
|
3087
|
+
placeholder: d.placeholder || "",
|
|
3088
|
+
required: d.required,
|
|
3089
3089
|
disabled: n.readOnly || r.busy
|
|
3090
3090
|
}, null, 8, kr)), [
|
|
3091
|
-
[
|
|
3092
|
-
]) :
|
|
3091
|
+
[J, r.values[d.key]]
|
|
3092
|
+
]) : d.type === "number" ? q((l(), c("input", {
|
|
3093
3093
|
key: 2,
|
|
3094
|
-
id: `wm-f-${r._uid}-${
|
|
3095
|
-
"onUpdate:modelValue": (v) => r.values[
|
|
3094
|
+
id: `wm-f-${r._uid}-${d.key}`,
|
|
3095
|
+
"onUpdate:modelValue": (v) => r.values[d.key] = v,
|
|
3096
3096
|
type: "number",
|
|
3097
3097
|
class: "wm-form__input",
|
|
3098
|
-
placeholder:
|
|
3099
|
-
required:
|
|
3098
|
+
placeholder: d.placeholder || "",
|
|
3099
|
+
required: d.required,
|
|
3100
3100
|
disabled: n.readOnly || r.busy
|
|
3101
3101
|
}, null, 8, Cr)), [
|
|
3102
3102
|
[
|
|
3103
|
-
|
|
3104
|
-
r.values[
|
|
3103
|
+
J,
|
|
3104
|
+
r.values[d.key],
|
|
3105
3105
|
void 0,
|
|
3106
3106
|
{ number: !0 }
|
|
3107
3107
|
]
|
|
3108
|
-
]) :
|
|
3108
|
+
]) : d.type === "date" ? q((l(), c("input", {
|
|
3109
3109
|
key: 3,
|
|
3110
|
-
id: `wm-f-${r._uid}-${
|
|
3111
|
-
"onUpdate:modelValue": (v) => r.values[
|
|
3110
|
+
id: `wm-f-${r._uid}-${d.key}`,
|
|
3111
|
+
"onUpdate:modelValue": (v) => r.values[d.key] = v,
|
|
3112
3112
|
type: "date",
|
|
3113
3113
|
class: "wm-form__input",
|
|
3114
|
-
required:
|
|
3114
|
+
required: d.required,
|
|
3115
3115
|
disabled: n.readOnly || r.busy
|
|
3116
3116
|
}, null, 8, Ar)), [
|
|
3117
|
-
[
|
|
3118
|
-
]) :
|
|
3119
|
-
|
|
3120
|
-
id: `wm-f-${r._uid}-${
|
|
3121
|
-
"onUpdate:modelValue": (v) => r.values[
|
|
3117
|
+
[J, r.values[d.key]]
|
|
3118
|
+
]) : d.type === "boolean" ? (l(), c("label", Sr, [
|
|
3119
|
+
q(i("input", {
|
|
3120
|
+
id: `wm-f-${r._uid}-${d.key}`,
|
|
3121
|
+
"onUpdate:modelValue": (v) => r.values[d.key] = v,
|
|
3122
3122
|
type: "checkbox",
|
|
3123
3123
|
disabled: n.readOnly || r.busy
|
|
3124
3124
|
}, null, 8, xr), [
|
|
3125
|
-
[Oe, r.values[
|
|
3125
|
+
[Oe, r.values[d.key]]
|
|
3126
3126
|
]),
|
|
3127
|
-
i("span", null, b(
|
|
3128
|
-
])) :
|
|
3127
|
+
i("span", null, b(d.placeholder || "Oui"), 1)
|
|
3128
|
+
])) : d.type === "select" ? q((l(), c("select", {
|
|
3129
3129
|
key: 5,
|
|
3130
|
-
id: `wm-f-${r._uid}-${
|
|
3131
|
-
"onUpdate:modelValue": (v) => r.values[
|
|
3130
|
+
id: `wm-f-${r._uid}-${d.key}`,
|
|
3131
|
+
"onUpdate:modelValue": (v) => r.values[d.key] = v,
|
|
3132
3132
|
class: "wm-form__select",
|
|
3133
|
-
required:
|
|
3133
|
+
required: d.required,
|
|
3134
3134
|
disabled: n.readOnly || r.busy
|
|
3135
3135
|
}, [
|
|
3136
|
-
i("option",
|
|
3137
|
-
(l(!0),
|
|
3136
|
+
i("option", Mr, b(d.placeholder || "Choisir…"), 1),
|
|
3137
|
+
(l(!0), c(T, null, D(d.options, (v) => (l(), c("option", {
|
|
3138
3138
|
key: v.value,
|
|
3139
3139
|
value: v.value
|
|
3140
3140
|
}, b(v.label), 9, Or))), 128))
|
|
3141
|
-
], 8,
|
|
3142
|
-
[Ie, r.values[
|
|
3143
|
-
]) :
|
|
3144
|
-
(l(!0),
|
|
3141
|
+
], 8, Tr)), [
|
|
3142
|
+
[Ie, r.values[d.key]]
|
|
3143
|
+
]) : d.type === "multiselect" ? (l(), c("div", Ir, [
|
|
3144
|
+
(l(!0), c(T, null, D(d.options, (v) => (l(), c("label", {
|
|
3145
3145
|
key: v.value,
|
|
3146
3146
|
class: "wm-form__multiItem"
|
|
3147
3147
|
}, [
|
|
3148
3148
|
i("input", {
|
|
3149
3149
|
type: "checkbox",
|
|
3150
3150
|
value: v.value,
|
|
3151
|
-
checked: Array.isArray(r.values[
|
|
3151
|
+
checked: Array.isArray(r.values[d.key]) && r.values[d.key].includes(v.value),
|
|
3152
3152
|
disabled: n.readOnly || r.busy,
|
|
3153
|
-
onChange: (k) => s.toggleMulti(
|
|
3153
|
+
onChange: (k) => s.toggleMulti(d.key, v.value, k.target.checked)
|
|
3154
3154
|
}, null, 40, Br),
|
|
3155
3155
|
i("span", null, b(v.label), 1)
|
|
3156
3156
|
]))), 128))
|
|
3157
|
-
])) :
|
|
3157
|
+
])) : y("", !0)
|
|
3158
3158
|
]))), 128)),
|
|
3159
|
-
r.error ? (l(),
|
|
3160
|
-
n.readOnly ? (l(),
|
|
3159
|
+
r.error ? (l(), c("div", Er, b(r.error), 1)) : y("", !0),
|
|
3160
|
+
n.readOnly ? (l(), c("div", Rr, "Réponse envoyée")) : (l(), c("button", {
|
|
3161
3161
|
key: 1,
|
|
3162
3162
|
type: "submit",
|
|
3163
3163
|
class: "wm-form__submit",
|
|
3164
3164
|
disabled: r.busy
|
|
3165
3165
|
}, [
|
|
3166
|
-
r.busy ? (l(),
|
|
3166
|
+
r.busy ? (l(), c("span", Lr)) : y("", !0),
|
|
3167
3167
|
i("span", null, b(r.busy ? "Envoi…" : n.form.submit_label || "Envoyer"), 1)
|
|
3168
|
-
], 8,
|
|
3168
|
+
], 8, $r))
|
|
3169
3169
|
], 32)
|
|
3170
3170
|
]);
|
|
3171
3171
|
}
|
|
3172
|
-
const
|
|
3172
|
+
const Dr = /* @__PURE__ */ E(hr, [["render", Fr], ["__scopeId", "data-v-64b40f76"]]), Nr = {
|
|
3173
3173
|
name: "WmFeedback",
|
|
3174
3174
|
props: {
|
|
3175
3175
|
busy: { type: Boolean, default: !1 },
|
|
@@ -3193,23 +3193,23 @@ const jr = /* @__PURE__ */ E(hr, [["render", Fr], ["__scopeId", "data-v-64b40f76
|
|
|
3193
3193
|
!this.sel || this.busy || this.$emit("submit", { rating: this.sel });
|
|
3194
3194
|
}
|
|
3195
3195
|
}
|
|
3196
|
-
},
|
|
3196
|
+
}, jr = { class: "wm-fb" }, Ur = { class: "wm-fb__row" }, Pr = ["onClick"], Hr = { class: "wm-fb__emoji" }, zr = { class: "wm-fb__label" }, Vr = ["disabled"], qr = {
|
|
3197
3197
|
key: 1,
|
|
3198
3198
|
class: "wm-fb__done"
|
|
3199
3199
|
};
|
|
3200
3200
|
function Wr(t, e, n, a, r, s) {
|
|
3201
|
-
return l(),
|
|
3202
|
-
n.done ? (l(),
|
|
3203
|
-
|
|
3204
|
-
])])) : (l(),
|
|
3201
|
+
return l(), c("div", jr, [
|
|
3202
|
+
n.done ? (l(), c("div", qr, [...e[3] || (e[3] = [
|
|
3203
|
+
he('<div class="wm-fb__check" data-v-6f45ff3b><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-6f45ff3b><path d="M20 6L9 17l-5-5" data-v-6f45ff3b></path></svg></div><div class="wm-fb__doneTitle" data-v-6f45ff3b>Merci pour votre retour !</div><div class="wm-fb__doneSub" data-v-6f45ff3b>Votre avis a bien été pris en compte.</div>', 3)
|
|
3204
|
+
])])) : (l(), c(T, { key: 0 }, [
|
|
3205
3205
|
e[1] || (e[1] = i("div", { class: "wm-fb__title" }, "Comment s'est passée cette conversation ?", -1)),
|
|
3206
3206
|
e[2] || (e[2] = i("div", { class: "wm-fb__sub" }, "Votre avis nous aide à améliorer l'assistant.", -1)),
|
|
3207
|
-
i("div",
|
|
3208
|
-
(l(!0),
|
|
3207
|
+
i("div", Ur, [
|
|
3208
|
+
(l(!0), c(T, null, D(r.options, (o) => (l(), c("button", {
|
|
3209
3209
|
key: o.v,
|
|
3210
3210
|
type: "button",
|
|
3211
3211
|
class: B(["wm-fb__opt", { "is-selected": r.sel === o.v }]),
|
|
3212
|
-
onClick: (
|
|
3212
|
+
onClick: (d) => r.sel = o.v
|
|
3213
3213
|
}, [
|
|
3214
3214
|
i("span", Hr, b(o.e), 1),
|
|
3215
3215
|
i("span", zr, b(o.l), 1)
|
|
@@ -3224,7 +3224,7 @@ function Wr(t, e, n, a, r, s) {
|
|
|
3224
3224
|
], 64))
|
|
3225
3225
|
]);
|
|
3226
3226
|
}
|
|
3227
|
-
const Kr = /* @__PURE__ */ E(
|
|
3227
|
+
const Kr = /* @__PURE__ */ E(Nr, [["render", Wr], ["__scopeId", "data-v-6f45ff3b"]]);
|
|
3228
3228
|
function Gr(t) {
|
|
3229
3229
|
const e = new Date(t);
|
|
3230
3230
|
return e.setHours(0, 0, 0, 0), e;
|
|
@@ -3292,12 +3292,12 @@ const Yr = {
|
|
|
3292
3292
|
key: 0,
|
|
3293
3293
|
class: "wm-hd__rowDot",
|
|
3294
3294
|
"aria-label": "Message non lu"
|
|
3295
|
-
}, li = { class: "wm-hd__rowBody" },
|
|
3295
|
+
}, li = { class: "wm-hd__rowBody" }, di = { class: "wm-hd__rowTop" }, ci = { class: "wm-hd__rowTitle" }, ui = { class: "wm-hd__rowPreview" }, hi = {
|
|
3296
3296
|
key: 0,
|
|
3297
3297
|
class: "wm-hd__empty"
|
|
3298
3298
|
};
|
|
3299
3299
|
function mi(t, e, n, a, r, s) {
|
|
3300
|
-
return l(),
|
|
3300
|
+
return l(), c("div", Jr, [
|
|
3301
3301
|
i("div", {
|
|
3302
3302
|
class: "wm-hd__scrim",
|
|
3303
3303
|
onClick: e[0] || (e[0] = (o) => t.$emit("close"))
|
|
@@ -3368,31 +3368,31 @@ function mi(t, e, n, a, r, s) {
|
|
|
3368
3368
|
i("path", { d: "M21 21l-4.35-4.35M11 17a6 6 0 100-12 6 6 0 000 12z" })
|
|
3369
3369
|
])
|
|
3370
3370
|
], -1)),
|
|
3371
|
-
|
|
3371
|
+
q(i("input", {
|
|
3372
3372
|
"onUpdate:modelValue": e[3] || (e[3] = (o) => r.query = o),
|
|
3373
3373
|
type: "text",
|
|
3374
3374
|
placeholder: "Rechercher dans vos messages",
|
|
3375
3375
|
"aria-label": "Rechercher dans vos messages"
|
|
3376
3376
|
}, null, 512), [
|
|
3377
|
-
[
|
|
3377
|
+
[J, r.query]
|
|
3378
3378
|
])
|
|
3379
3379
|
])
|
|
3380
3380
|
]),
|
|
3381
3381
|
i("div", ti, [
|
|
3382
|
-
(l(!0),
|
|
3382
|
+
(l(!0), c(T, null, D(s.groups, (o) => (l(), c(T, {
|
|
3383
3383
|
key: o.key
|
|
3384
3384
|
}, [
|
|
3385
|
-
o.items.length ? (l(),
|
|
3385
|
+
o.items.length ? (l(), c("div", ni, [
|
|
3386
3386
|
i("div", si, b(o.label), 1),
|
|
3387
3387
|
i("div", ri, [
|
|
3388
|
-
(l(!0),
|
|
3389
|
-
key:
|
|
3388
|
+
(l(!0), c(T, null, D(o.items, (d) => (l(), c("button", {
|
|
3389
|
+
key: d.id,
|
|
3390
3390
|
type: "button",
|
|
3391
3391
|
class: B(["wm-hd__row", {
|
|
3392
|
-
"wm-hd__row--active":
|
|
3393
|
-
"wm-hd__row--unread":
|
|
3392
|
+
"wm-hd__row--active": d.id === n.activeId,
|
|
3393
|
+
"wm-hd__row--unread": d.unread
|
|
3394
3394
|
}]),
|
|
3395
|
-
onClick: (v) => t.$emit("pick",
|
|
3395
|
+
onClick: (v) => t.$emit("pick", d)
|
|
3396
3396
|
}, [
|
|
3397
3397
|
i("div", ai, [
|
|
3398
3398
|
e[8] || (e[8] = i("svg", {
|
|
@@ -3408,19 +3408,19 @@ function mi(t, e, n, a, r, s) {
|
|
|
3408
3408
|
opacity: "0.92"
|
|
3409
3409
|
})
|
|
3410
3410
|
], -1)),
|
|
3411
|
-
|
|
3411
|
+
d.unread ? (l(), c("span", oi)) : y("", !0)
|
|
3412
3412
|
]),
|
|
3413
3413
|
i("div", li, [
|
|
3414
|
-
i("div",
|
|
3415
|
-
i("span",
|
|
3414
|
+
i("div", di, [
|
|
3415
|
+
i("span", ci, b(d.title), 1)
|
|
3416
3416
|
]),
|
|
3417
|
-
i("div", ui, b(
|
|
3417
|
+
i("div", ui, b(d.preview || "Aucun message"), 1)
|
|
3418
3418
|
])
|
|
3419
3419
|
], 10, ii))), 128))
|
|
3420
3420
|
])
|
|
3421
|
-
])) :
|
|
3421
|
+
])) : y("", !0)
|
|
3422
3422
|
], 64))), 128)),
|
|
3423
|
-
s.hasAny ?
|
|
3423
|
+
s.hasAny ? y("", !0) : (l(), c("div", hi, " Aucun fil pour le moment. "))
|
|
3424
3424
|
])
|
|
3425
3425
|
])
|
|
3426
3426
|
]);
|
|
@@ -3429,7 +3429,6 @@ const fi = /* @__PURE__ */ E(Yr, [["render", mi], ["__scopeId", "data-v-1259e822
|
|
|
3429
3429
|
name: "WmMoreMenu",
|
|
3430
3430
|
props: {
|
|
3431
3431
|
canRename: { type: Boolean, default: !0 },
|
|
3432
|
-
canClear: { type: Boolean, default: !0 },
|
|
3433
3432
|
canExport: { type: Boolean, default: !0 },
|
|
3434
3433
|
notifEnabled: { type: Boolean, default: !0 },
|
|
3435
3434
|
statusUrl: { type: String, default: "" },
|
|
@@ -3455,20 +3454,20 @@ const fi = /* @__PURE__ */ E(Yr, [["render", mi], ["__scopeId", "data-v-1259e822
|
|
|
3455
3454
|
}, pi = { class: "wm-mm" }, vi = {
|
|
3456
3455
|
class: "wm-mm__pop",
|
|
3457
3456
|
role: "menu"
|
|
3458
|
-
},
|
|
3457
|
+
}, gi = { class: "wm-mm__section" }, yi = { class: "wm-mm__section" }, wi = { class: "wm-mm__section" };
|
|
3459
3458
|
function bi(t, e, n, a, r, s) {
|
|
3460
|
-
return l(),
|
|
3459
|
+
return l(), c("div", pi, [
|
|
3461
3460
|
i("div", {
|
|
3462
3461
|
class: "wm-mm__scrim",
|
|
3463
3462
|
onClick: e[0] || (e[0] = (o) => t.$emit("close"))
|
|
3464
3463
|
}),
|
|
3465
3464
|
i("div", vi, [
|
|
3466
|
-
i("div",
|
|
3465
|
+
i("div", gi, [
|
|
3467
3466
|
i("button", {
|
|
3468
3467
|
type: "button",
|
|
3469
3468
|
class: "wm-mm__item",
|
|
3470
3469
|
onClick: e[1] || (e[1] = (o) => s.emit("history"))
|
|
3471
|
-
}, [...e[
|
|
3470
|
+
}, [...e[7] || (e[7] = [
|
|
3472
3471
|
i("span", { class: "wm-mm__icon" }, [
|
|
3473
3472
|
i("svg", {
|
|
3474
3473
|
width: "12",
|
|
@@ -3486,54 +3485,31 @@ function bi(t, e, n, a, r, s) {
|
|
|
3486
3485
|
], -1),
|
|
3487
3486
|
i("span", { class: "wm-mm__label" }, "Historique des discussions", -1)
|
|
3488
3487
|
])]),
|
|
3489
|
-
n.canRename ? (l(),
|
|
3488
|
+
n.canRename ? (l(), c("button", {
|
|
3490
3489
|
key: 0,
|
|
3491
3490
|
type: "button",
|
|
3492
3491
|
class: "wm-mm__item",
|
|
3493
3492
|
onClick: e[2] || (e[2] = (o) => s.emit("rename"))
|
|
3494
|
-
}, [...e[
|
|
3495
|
-
|
|
3496
|
-
])])) :
|
|
3497
|
-
n.
|
|
3493
|
+
}, [...e[8] || (e[8] = [
|
|
3494
|
+
he('<span class="wm-mm__icon" data-v-3181ad1b><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-3181ad1b><path d="M12 20h9" data-v-3181ad1b></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z" data-v-3181ad1b></path></svg></span><span class="wm-mm__label" data-v-3181ad1b>Modifier le titre</span>', 2)
|
|
3495
|
+
])])) : y("", !0),
|
|
3496
|
+
n.canExport ? (l(), c("button", {
|
|
3498
3497
|
key: 1,
|
|
3499
3498
|
type: "button",
|
|
3500
3499
|
class: "wm-mm__item",
|
|
3501
|
-
onClick: e[3] || (e[3] = (o) => s.emit("
|
|
3502
|
-
}, [...e[
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
width: "12",
|
|
3506
|
-
height: "12",
|
|
3507
|
-
viewBox: "0 0 24 24",
|
|
3508
|
-
fill: "none",
|
|
3509
|
-
stroke: "currentColor",
|
|
3510
|
-
"stroke-width": "1.8",
|
|
3511
|
-
"stroke-linecap": "round",
|
|
3512
|
-
"stroke-linejoin": "round",
|
|
3513
|
-
"aria-hidden": "true"
|
|
3514
|
-
}, [
|
|
3515
|
-
i("path", { d: "M4 7h16M10 11v6M14 11v6M5 7l1 13a2 2 0 002 2h8a2 2 0 002-2l1-13M9 7V4a1 1 0 011-1h4a1 1 0 011 1v3" })
|
|
3516
|
-
])
|
|
3517
|
-
], -1),
|
|
3518
|
-
i("span", { class: "wm-mm__label" }, "Effacer ce fil", -1)
|
|
3519
|
-
])])) : g("", !0),
|
|
3520
|
-
n.canExport ? (l(), d("button", {
|
|
3521
|
-
key: 2,
|
|
3522
|
-
type: "button",
|
|
3523
|
-
class: "wm-mm__item",
|
|
3524
|
-
onClick: e[4] || (e[4] = (o) => s.emit("export"))
|
|
3525
|
-
}, [...e[11] || (e[11] = [
|
|
3526
|
-
ue('<span class="wm-mm__icon" data-v-c1bb81d2><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-c1bb81d2><path d="M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" data-v-c1bb81d2></path></svg></span><span class="wm-mm__label" data-v-c1bb81d2>Exporter la transcription</span><span class="wm-mm__hint" data-v-c1bb81d2>.txt</span>', 3)
|
|
3527
|
-
])])) : g("", !0)
|
|
3500
|
+
onClick: e[3] || (e[3] = (o) => s.emit("export"))
|
|
3501
|
+
}, [...e[9] || (e[9] = [
|
|
3502
|
+
he('<span class="wm-mm__icon" data-v-3181ad1b><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-3181ad1b><path d="M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" data-v-3181ad1b></path></svg></span><span class="wm-mm__label" data-v-3181ad1b>Exporter la transcription</span><span class="wm-mm__hint" data-v-3181ad1b>.txt</span>', 3)
|
|
3503
|
+
])])) : y("", !0)
|
|
3528
3504
|
]),
|
|
3529
|
-
e[
|
|
3530
|
-
i("div",
|
|
3505
|
+
e[15] || (e[15] = i("div", { class: "wm-mm__sep" }, null, -1)),
|
|
3506
|
+
i("div", yi, [
|
|
3531
3507
|
i("button", {
|
|
3532
3508
|
type: "button",
|
|
3533
3509
|
class: "wm-mm__item",
|
|
3534
|
-
onClick: e[
|
|
3510
|
+
onClick: e[4] || (e[4] = (...o) => s.toggleNotif && s.toggleNotif(...o))
|
|
3535
3511
|
}, [
|
|
3536
|
-
e[
|
|
3512
|
+
e[11] || (e[11] = i("span", { class: "wm-mm__icon" }, [
|
|
3537
3513
|
i("svg", {
|
|
3538
3514
|
width: "12",
|
|
3539
3515
|
height: "12",
|
|
@@ -3548,22 +3524,22 @@ function bi(t, e, n, a, r, s) {
|
|
|
3548
3524
|
i("path", { d: "M15 17h5l-1.4-1.4A2 2 0 0118 14.2V11a6 6 0 10-12 0v3.2c0 .5-.2 1-.6 1.4L4 17h5m6 0a3 3 0 11-6 0" })
|
|
3549
3525
|
])
|
|
3550
3526
|
], -1)),
|
|
3551
|
-
e[
|
|
3527
|
+
e[12] || (e[12] = i("span", { class: "wm-mm__label" }, "Notifications", -1)),
|
|
3552
3528
|
i("span", {
|
|
3553
3529
|
class: B(["wm-mm__toggle", { "wm-mm__toggle--on": r.notifOn }])
|
|
3554
|
-
}, [...e[
|
|
3530
|
+
}, [...e[10] || (e[10] = [
|
|
3555
3531
|
i("span", { class: "wm-mm__knob" }, null, -1)
|
|
3556
3532
|
])], 2)
|
|
3557
3533
|
])
|
|
3558
3534
|
]),
|
|
3559
|
-
e[
|
|
3535
|
+
e[16] || (e[16] = i("div", { class: "wm-mm__sep" }, null, -1)),
|
|
3560
3536
|
i("div", wi, [
|
|
3561
|
-
n.statusUrl ? (l(),
|
|
3537
|
+
n.statusUrl ? (l(), c("button", {
|
|
3562
3538
|
key: 0,
|
|
3563
3539
|
type: "button",
|
|
3564
3540
|
class: "wm-mm__item",
|
|
3565
|
-
onClick: e[
|
|
3566
|
-
}, [...e[
|
|
3541
|
+
onClick: e[5] || (e[5] = (o) => s.emit("status"))
|
|
3542
|
+
}, [...e[13] || (e[13] = [
|
|
3567
3543
|
i("span", { class: "wm-mm__icon" }, [
|
|
3568
3544
|
i("svg", {
|
|
3569
3545
|
width: "12",
|
|
@@ -3580,13 +3556,13 @@ function bi(t, e, n, a, r, s) {
|
|
|
3580
3556
|
])
|
|
3581
3557
|
], -1),
|
|
3582
3558
|
i("span", { class: "wm-mm__label" }, "Statut des services", -1)
|
|
3583
|
-
])])) :
|
|
3584
|
-
n.helpUrl ? (l(),
|
|
3559
|
+
])])) : y("", !0),
|
|
3560
|
+
n.helpUrl ? (l(), c("button", {
|
|
3585
3561
|
key: 1,
|
|
3586
3562
|
type: "button",
|
|
3587
3563
|
class: "wm-mm__item",
|
|
3588
|
-
onClick: e[
|
|
3589
|
-
}, [...e[
|
|
3564
|
+
onClick: e[6] || (e[6] = (o) => s.emit("help"))
|
|
3565
|
+
}, [...e[14] || (e[14] = [
|
|
3590
3566
|
i("span", { class: "wm-mm__icon" }, [
|
|
3591
3567
|
i("svg", {
|
|
3592
3568
|
width: "12",
|
|
@@ -3603,18 +3579,119 @@ function bi(t, e, n, a, r, s) {
|
|
|
3603
3579
|
])
|
|
3604
3580
|
], -1),
|
|
3605
3581
|
i("span", { class: "wm-mm__label" }, "Centre d'aide", -1)
|
|
3606
|
-
])])) :
|
|
3582
|
+
])])) : y("", !0)
|
|
3583
|
+
])
|
|
3584
|
+
])
|
|
3585
|
+
]);
|
|
3586
|
+
}
|
|
3587
|
+
const ki = /* @__PURE__ */ E(_i, [["render", bi], ["__scopeId", "data-v-3181ad1b"]]), Ci = {
|
|
3588
|
+
name: "WmRenameDialog",
|
|
3589
|
+
props: {
|
|
3590
|
+
title: { type: String, default: "Modifier le titre" },
|
|
3591
|
+
initialValue: { type: String, default: "" },
|
|
3592
|
+
placeholder: { type: String, default: "Titre de la conversation" }
|
|
3593
|
+
},
|
|
3594
|
+
emits: ["close", "submit"],
|
|
3595
|
+
data() {
|
|
3596
|
+
return { value: this.initialValue || "" };
|
|
3597
|
+
},
|
|
3598
|
+
computed: {
|
|
3599
|
+
canSubmit() {
|
|
3600
|
+
const t = (this.value || "").trim();
|
|
3601
|
+
return !!t && t !== (this.initialValue || "").trim();
|
|
3602
|
+
}
|
|
3603
|
+
},
|
|
3604
|
+
mounted() {
|
|
3605
|
+
this.$nextTick(() => {
|
|
3606
|
+
const t = this.$refs.input;
|
|
3607
|
+
if (t) {
|
|
3608
|
+
t.focus();
|
|
3609
|
+
try {
|
|
3610
|
+
t.select();
|
|
3611
|
+
} catch {
|
|
3612
|
+
}
|
|
3613
|
+
}
|
|
3614
|
+
});
|
|
3615
|
+
},
|
|
3616
|
+
methods: {
|
|
3617
|
+
onSubmit() {
|
|
3618
|
+
this.canSubmit && this.$emit("submit", this.value.trim());
|
|
3619
|
+
}
|
|
3620
|
+
}
|
|
3621
|
+
}, Ai = { class: "wm-dialog" }, Si = {
|
|
3622
|
+
class: "wm-dialog__card",
|
|
3623
|
+
role: "dialog",
|
|
3624
|
+
"aria-modal": "true"
|
|
3625
|
+
}, xi = { class: "wm-dialog__head" }, Ti = { class: "wm-dialog__title" }, Mi = { class: "wm-dialog__body" }, Oi = ["placeholder"], Ii = { class: "wm-dialog__actions" }, Bi = ["disabled"];
|
|
3626
|
+
function Ei(t, e, n, a, r, s) {
|
|
3627
|
+
return l(), c("div", Ai, [
|
|
3628
|
+
i("div", {
|
|
3629
|
+
class: "wm-dialog__scrim",
|
|
3630
|
+
onClick: e[0] || (e[0] = (o) => t.$emit("close"))
|
|
3631
|
+
}),
|
|
3632
|
+
i("div", Si, [
|
|
3633
|
+
i("div", xi, [
|
|
3634
|
+
i("div", Ti, b(n.title), 1),
|
|
3635
|
+
i("button", {
|
|
3636
|
+
type: "button",
|
|
3637
|
+
class: "wm-dialog__close",
|
|
3638
|
+
"aria-label": "Fermer",
|
|
3639
|
+
onClick: e[1] || (e[1] = (o) => t.$emit("close"))
|
|
3640
|
+
}, [...e[7] || (e[7] = [
|
|
3641
|
+
i("svg", {
|
|
3642
|
+
width: "12",
|
|
3643
|
+
height: "12",
|
|
3644
|
+
viewBox: "0 0 24 24",
|
|
3645
|
+
fill: "none",
|
|
3646
|
+
stroke: "currentColor",
|
|
3647
|
+
"stroke-width": "2",
|
|
3648
|
+
"stroke-linecap": "round",
|
|
3649
|
+
"stroke-linejoin": "round",
|
|
3650
|
+
"aria-hidden": "true"
|
|
3651
|
+
}, [
|
|
3652
|
+
i("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
3653
|
+
], -1)
|
|
3654
|
+
])])
|
|
3655
|
+
]),
|
|
3656
|
+
i("div", Mi, [
|
|
3657
|
+
q(i("input", {
|
|
3658
|
+
ref: "input",
|
|
3659
|
+
"onUpdate:modelValue": e[2] || (e[2] = (o) => r.value = o),
|
|
3660
|
+
type: "text",
|
|
3661
|
+
class: "wm-dialog__input",
|
|
3662
|
+
placeholder: n.placeholder,
|
|
3663
|
+
maxlength: 120,
|
|
3664
|
+
onKeydown: [
|
|
3665
|
+
e[3] || (e[3] = ae(X((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]), ["enter"])),
|
|
3666
|
+
e[4] || (e[4] = ae(X((o) => t.$emit("close"), ["prevent"]), ["esc"]))
|
|
3667
|
+
]
|
|
3668
|
+
}, null, 40, Oi), [
|
|
3669
|
+
[J, r.value]
|
|
3670
|
+
])
|
|
3671
|
+
]),
|
|
3672
|
+
i("div", Ii, [
|
|
3673
|
+
i("button", {
|
|
3674
|
+
type: "button",
|
|
3675
|
+
class: "wm-dialog__btn",
|
|
3676
|
+
onClick: e[5] || (e[5] = (o) => t.$emit("close"))
|
|
3677
|
+
}, "Annuler"),
|
|
3678
|
+
i("button", {
|
|
3679
|
+
type: "button",
|
|
3680
|
+
class: "wm-dialog__btn wm-dialog__btn--primary",
|
|
3681
|
+
disabled: !s.canSubmit,
|
|
3682
|
+
onClick: e[6] || (e[6] = (...o) => s.onSubmit && s.onSubmit(...o))
|
|
3683
|
+
}, "Enregistrer", 8, Bi)
|
|
3607
3684
|
])
|
|
3608
3685
|
])
|
|
3609
3686
|
]);
|
|
3610
3687
|
}
|
|
3611
|
-
const
|
|
3612
|
-
function
|
|
3688
|
+
const $i = /* @__PURE__ */ E(Ci, [["render", Ei], ["__scopeId", "data-v-4f4b37c9"]]), ge = "ww-messenger-tokens";
|
|
3689
|
+
function ie(t) {
|
|
3613
3690
|
var n;
|
|
3614
3691
|
const e = (n = t == null ? void 0 : t.author) == null ? void 0 : n.type;
|
|
3615
3692
|
return e === "agent_ia" || e === "agent_human";
|
|
3616
3693
|
}
|
|
3617
|
-
function
|
|
3694
|
+
function Li(t, e) {
|
|
3618
3695
|
if (!t || !e) return "";
|
|
3619
3696
|
const n = Array.isArray(t.fields) ? t.fields : [], a = [];
|
|
3620
3697
|
for (const r of n) {
|
|
@@ -3623,8 +3700,8 @@ function Ci(t, e) {
|
|
|
3623
3700
|
if (s == null || s === "") continue;
|
|
3624
3701
|
let o;
|
|
3625
3702
|
if (Array.isArray(s)) {
|
|
3626
|
-
if (o = s.map((
|
|
3627
|
-
} else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o =
|
|
3703
|
+
if (o = s.map((d) => le(r, String(d))).join(", "), !o) continue;
|
|
3704
|
+
} else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = le(r, String(s));
|
|
3628
3705
|
a.push(`${r.label} :
|
|
3629
3706
|
${o}`);
|
|
3630
3707
|
}
|
|
@@ -3632,12 +3709,12 @@ ${o}`);
|
|
|
3632
3709
|
|
|
3633
3710
|
`);
|
|
3634
3711
|
}
|
|
3635
|
-
function
|
|
3712
|
+
function le(t, e) {
|
|
3636
3713
|
if (!Array.isArray(t == null ? void 0 : t.options)) return e;
|
|
3637
3714
|
const n = t.options.find((a) => (a == null ? void 0 : a.value) === e);
|
|
3638
3715
|
return (n == null ? void 0 : n.label) || e;
|
|
3639
3716
|
}
|
|
3640
|
-
function
|
|
3717
|
+
function Ri(t, e) {
|
|
3641
3718
|
const n = [], a = Array.isArray(t == null ? void 0 : t.fields) ? t.fields : [];
|
|
3642
3719
|
for (const r of a) {
|
|
3643
3720
|
if (!(r != null && r.key) || !(r != null && r.label)) continue;
|
|
@@ -3645,11 +3722,11 @@ function Ai(t, e) {
|
|
|
3645
3722
|
if (s == null || s === "") continue;
|
|
3646
3723
|
let o;
|
|
3647
3724
|
if (Array.isArray(s)) {
|
|
3648
|
-
if (o = s.map((v) =>
|
|
3649
|
-
} else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o =
|
|
3650
|
-
const
|
|
3725
|
+
if (o = s.map((v) => le(r, String(v))).join(", "), !o) continue;
|
|
3726
|
+
} else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = le(r, String(s));
|
|
3727
|
+
const d = r.type === "textarea" || typeof o == "string" && (o.length > 60 || o.includes(`
|
|
3651
3728
|
`));
|
|
3652
|
-
n.push({ label: r.label, value: o, multiline:
|
|
3729
|
+
n.push({ label: r.label, value: o, multiline: d });
|
|
3653
3730
|
}
|
|
3654
3731
|
return {
|
|
3655
3732
|
kind: "form_response",
|
|
@@ -3659,20 +3736,21 @@ function Ai(t, e) {
|
|
|
3659
3736
|
}
|
|
3660
3737
|
};
|
|
3661
3738
|
}
|
|
3662
|
-
const
|
|
3739
|
+
const Fi = 450, Di = 50, Ni = 900, ji = 12e3, Ui = 300, Pi = {
|
|
3663
3740
|
name: "Messenger",
|
|
3664
3741
|
components: {
|
|
3665
3742
|
Launcher: Ke,
|
|
3666
|
-
Header:
|
|
3743
|
+
Header: yt,
|
|
3667
3744
|
Onboarding: Pt,
|
|
3668
3745
|
MessageList: Is,
|
|
3669
3746
|
Composer: Js,
|
|
3670
3747
|
SuggestionChips: er,
|
|
3671
|
-
ApprovalCard:
|
|
3672
|
-
FormCard:
|
|
3748
|
+
ApprovalCard: cr,
|
|
3749
|
+
FormCard: Dr,
|
|
3673
3750
|
Feedback: Kr,
|
|
3674
3751
|
HistoryDrawer: fi,
|
|
3675
|
-
MoreMenu: ki
|
|
3752
|
+
MoreMenu: ki,
|
|
3753
|
+
RenameDialog: $i
|
|
3676
3754
|
},
|
|
3677
3755
|
// Make signAttachment available to deep children (AttachmentPreview)
|
|
3678
3756
|
// without prop drilling. The store may not exist yet at provide-time
|
|
@@ -3730,6 +3808,26 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
3730
3808
|
// Overlays anchored to the header. Only one open at a time.
|
|
3731
3809
|
historyOpen: !1,
|
|
3732
3810
|
moreOpen: !1,
|
|
3811
|
+
// In-app rename dialog. Replaces the previous `window.prompt`
|
|
3812
|
+
// call so the rename flow stays inside the widget (and works
|
|
3813
|
+
// on platforms where prompts are blocked).
|
|
3814
|
+
renameDialogOpen: !1,
|
|
3815
|
+
// Draft conversation : composer ouvert sans création server-side.
|
|
3816
|
+
// La conversation réelle n'est créée qu'au premier envoi (texte,
|
|
3817
|
+
// PJ, formulaire, quick-link sans URL). Évite de polluer la liste
|
|
3818
|
+
// côté serveur avec des fils vides abandonnés.
|
|
3819
|
+
draftConv: null,
|
|
3820
|
+
// Permission API pour les notifications navigateur. Tracke l'état
|
|
3821
|
+
// courant ('default'|'granted'|'denied') pour décider quand
|
|
3822
|
+
// déclencher une demande explicite.
|
|
3823
|
+
notifPermission: typeof Notification < "u" ? Notification.permission : "denied",
|
|
3824
|
+
// Unsubscribe handle for the transport's `message` event (used
|
|
3825
|
+
// to drive sound + browser notifications). Set during boot.
|
|
3826
|
+
_notifUnsub: null,
|
|
3827
|
+
// Cached AudioContext for the ping sound. Lazily created on the
|
|
3828
|
+
// first notification; reused across plays to avoid the per-call
|
|
3829
|
+
// construction cost (and the autoplay-policy warning on Safari).
|
|
3830
|
+
_audioCtx: null,
|
|
3733
3831
|
// When set, takes precedence over the latest-conversation
|
|
3734
3832
|
// selection so the user can browse another thread from the
|
|
3735
3833
|
// history drawer without losing live updates on the others.
|
|
@@ -3833,7 +3931,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
3833
3931
|
var n;
|
|
3834
3932
|
const t = this.readState, e = ((n = this.s) == null ? void 0 : n.messagesByConv) || {};
|
|
3835
3933
|
return this.allConversations.map((a) => {
|
|
3836
|
-
const r = e[a.id] || [], s = this.convLastActivity(a, r), o = t[a.id] || "",
|
|
3934
|
+
const r = e[a.id] || [], s = this.convLastActivity(a, r), o = t[a.id] || "", d = this.lastMessageAuthorType(r), v = !!s && d !== "user" && (!o || s > o);
|
|
3837
3935
|
return { ...a, _preview: this.convPreview(a, r), _unread: v };
|
|
3838
3936
|
});
|
|
3839
3937
|
},
|
|
@@ -3883,6 +3981,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
3883
3981
|
return (this.isOpen || this.isEmbedded) && !this.historyOpen && !!this.currentConv;
|
|
3884
3982
|
},
|
|
3885
3983
|
currentConv() {
|
|
3984
|
+
if (this.draftConv) return this.draftConv;
|
|
3886
3985
|
if (this.showOnboarding) return null;
|
|
3887
3986
|
const t = this.allConversations;
|
|
3888
3987
|
if (!t.length) return null;
|
|
@@ -3977,13 +4076,13 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
3977
4076
|
const t = this.currentConv;
|
|
3978
4077
|
if (!t) return [];
|
|
3979
4078
|
const e = (r) => {
|
|
3980
|
-
var s, o,
|
|
3981
|
-
return (r == null ? void 0 : r.type) === "action" || (r == null ? void 0 : r.type) === "system" || ((s = r == null ? void 0 : r.payload) == null ? void 0 : s.type) === "system" || Array.isArray((o = r == null ? void 0 : r.payload) == null ? void 0 : o.attachments) && r.payload.attachments.length || (
|
|
4079
|
+
var s, o, d, v;
|
|
4080
|
+
return (r == null ? void 0 : r.type) === "action" || (r == null ? void 0 : r.type) === "system" || ((s = r == null ? void 0 : r.payload) == null ? void 0 : s.type) === "system" || Array.isArray((o = r == null ? void 0 : r.payload) == null ? void 0 : o.attachments) && r.payload.attachments.length || (d = r == null ? void 0 : r.metadata) != null && d.artifact || (v = r == null ? void 0 : r.metadata) != null && v.form ? !0 : typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0;
|
|
3982
4081
|
}, n = (r) => {
|
|
3983
4082
|
var s;
|
|
3984
4083
|
return (r == null ? void 0 : r.type) === "action" && ((s = r == null ? void 0 : r.payload) == null ? void 0 : s.state) === "pending";
|
|
3985
4084
|
}, a = this.revealedAt;
|
|
3986
|
-
return (this.s.messagesByConv[t.id] || []).filter((r) => !n(r)).filter((r) =>
|
|
4085
|
+
return (this.s.messagesByConv[t.id] || []).filter((r) => !n(r)).filter((r) => ie(r) ? a[r.id] > 0 : !0).filter(e);
|
|
3987
4086
|
},
|
|
3988
4087
|
// True whenever we should show the "typing" indicator at the bottom
|
|
3989
4088
|
// of the list: either the LLM is actively streaming tokens, or one
|
|
@@ -3992,7 +4091,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
3992
4091
|
streamingActive() {
|
|
3993
4092
|
var n, a, r;
|
|
3994
4093
|
const t = this.currentConv;
|
|
3995
|
-
return t ? Object.keys(((n = this.s) == null ? void 0 : n.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : (((r = (a = this.s) == null ? void 0 : a.messagesByConv) == null ? void 0 : r[t.id]) || []).some((s) =>
|
|
4094
|
+
return t ? Object.keys(((n = this.s) == null ? void 0 : n.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : (((r = (a = this.s) == null ? void 0 : a.messagesByConv) == null ? void 0 : r[t.id]) || []).some((s) => ie(s) && !(this.revealedAt[s.id] > 0)) : !1;
|
|
3996
4095
|
},
|
|
3997
4096
|
// Internal: the raw persisted list for the current conversation. We
|
|
3998
4097
|
// watch this to detect new agent messages that need to be paced.
|
|
@@ -4024,11 +4123,11 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4024
4123
|
return ((e = (t = this.pendingApproval) == null ? void 0 : t.payload) == null ? void 0 : e.name) || ((n = this.pendingApproval) == null ? void 0 : n.text_md) || "Confirmer l'action";
|
|
4025
4124
|
},
|
|
4026
4125
|
approvalDetail() {
|
|
4027
|
-
var a, r, s, o,
|
|
4126
|
+
var a, r, s, o, d, v;
|
|
4028
4127
|
const t = (s = (r = (a = this.pendingApproval) == null ? void 0 : a.payload) == null ? void 0 : r.pending) == null ? void 0 : s.user_explanation;
|
|
4029
4128
|
if (typeof t == "string" && t.trim())
|
|
4030
4129
|
return t.trim();
|
|
4031
|
-
const e = (v = (
|
|
4130
|
+
const e = (v = (d = (o = this.pendingApproval) == null ? void 0 : o.payload) == null ? void 0 : d.pending) == null ? void 0 : v.prepared_params;
|
|
4032
4131
|
if (!e || typeof e != "object") return "";
|
|
4033
4132
|
const n = Object.entries(e);
|
|
4034
4133
|
return n.length ? n.slice(0, 2).map(([k, w]) => `${k}: ${w}`).join(" · ") : "";
|
|
@@ -4067,10 +4166,10 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4067
4166
|
const t = this.currentConv;
|
|
4068
4167
|
let e = /* @__PURE__ */ new Date();
|
|
4069
4168
|
if (t) {
|
|
4070
|
-
const o = ((r = (((a = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : a[t.id]) || []).find((
|
|
4169
|
+
const o = ((r = (((a = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : a[t.id]) || []).find((d) => d == null ? void 0 : d.created_at)) == null ? void 0 : r.created_at) || t.created_at;
|
|
4071
4170
|
if (o) {
|
|
4072
|
-
const
|
|
4073
|
-
Number.isNaN(
|
|
4171
|
+
const d = new Date(o);
|
|
4172
|
+
Number.isNaN(d.getTime()) || (e = d);
|
|
4074
4173
|
}
|
|
4075
4174
|
}
|
|
4076
4175
|
return `Aujourd'hui · ${be(e)}`;
|
|
@@ -4108,7 +4207,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4108
4207
|
// we're about to load count as history and bypass pacing.
|
|
4109
4208
|
"currentConv.id": {
|
|
4110
4209
|
handler(t) {
|
|
4111
|
-
this.cancelReveals(), this.revealedAt = {}, this.nextRevealAt = 0, this.convOpenedAt = Date.now(), this.moreOpen = !1, this.resetApprovalPacing(), this.isViewingThread && (this.unreadAnchorTs = t && this.readState[t] || "", this.unreadBoundaryTs = t ? (/* @__PURE__ */ new Date()).toISOString() : "");
|
|
4210
|
+
this.cancelReveals(), this.revealedAt = {}, this.nextRevealAt = 0, this.convOpenedAt = Date.now(), this.moreOpen = !1, this.renameDialogOpen = !1, this.resetApprovalPacing(), this.isViewingThread && (this.unreadAnchorTs = t && this.readState[t] || "", this.unreadBoundaryTs = t ? (/* @__PURE__ */ new Date()).toISOString() : "");
|
|
4112
4211
|
},
|
|
4113
4212
|
immediate: !0
|
|
4114
4213
|
},
|
|
@@ -4174,7 +4273,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4174
4273
|
const e = Date.now(), n = { ...this.revealedAt };
|
|
4175
4274
|
for (const r of t) {
|
|
4176
4275
|
if ((r == null ? void 0 : r.id) == null || n[r.id] !== void 0) continue;
|
|
4177
|
-
if (!
|
|
4276
|
+
if (!ie(r)) {
|
|
4178
4277
|
n[r.id] = e;
|
|
4179
4278
|
continue;
|
|
4180
4279
|
}
|
|
@@ -4183,8 +4282,8 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4183
4282
|
n[r.id] = e;
|
|
4184
4283
|
continue;
|
|
4185
4284
|
}
|
|
4186
|
-
const o = typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0,
|
|
4187
|
-
if (!o && !
|
|
4285
|
+
const o = typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0, d = Array.isArray((a = r == null ? void 0 : r.payload) == null ? void 0 : a.attachments) && r.payload.attachments.length > 0;
|
|
4286
|
+
if (!o && !d) {
|
|
4188
4287
|
n[r.id] = e;
|
|
4189
4288
|
continue;
|
|
4190
4289
|
}
|
|
@@ -4201,14 +4300,14 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4201
4300
|
hasWidgetId: !!this.widgetId,
|
|
4202
4301
|
hasUserId: !!this.userId,
|
|
4203
4302
|
hasUserHash: !!this.userHash
|
|
4204
|
-
}), typeof document < "u" && !document.getElementById(
|
|
4303
|
+
}), typeof document < "u" && !document.getElementById(ge)) {
|
|
4205
4304
|
const t = document.createElement("style");
|
|
4206
|
-
t.id =
|
|
4305
|
+
t.id = ge, t.textContent = Ue, document.head.appendChild(t);
|
|
4207
4306
|
}
|
|
4208
4307
|
this.hydrateReadState(), await this.boot(), this.isEmbedded && this.store && await this.open();
|
|
4209
4308
|
},
|
|
4210
4309
|
beforeUnmount() {
|
|
4211
|
-
this.cancelReveals(), this.disconnectFloatRO(), this.resetApprovalPacing(), this.store && this.store.destroy();
|
|
4310
|
+
this.cancelReveals(), this.disconnectFloatRO(), this.resetApprovalPacing(), this.teardownNotifications(), this.store && this.store.destroy();
|
|
4212
4311
|
},
|
|
4213
4312
|
methods: {
|
|
4214
4313
|
syncFloatObserver(t) {
|
|
@@ -4269,9 +4368,9 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4269
4368
|
for (let s = e.length - 1; s >= 0; s--) {
|
|
4270
4369
|
const o = e[s];
|
|
4271
4370
|
if (!o) continue;
|
|
4272
|
-
const
|
|
4273
|
-
if (
|
|
4274
|
-
return (((n = o.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") +
|
|
4371
|
+
const d = typeof o.text_md == "string" ? o.text_md.trim() : "";
|
|
4372
|
+
if (d)
|
|
4373
|
+
return (((n = o.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + d.replace(/\s+/g, " ");
|
|
4275
4374
|
const v = (a = o.payload) == null ? void 0 : a.attachments;
|
|
4276
4375
|
if (Array.isArray(v) && v.length) return "📎 Pièce jointe";
|
|
4277
4376
|
}
|
|
@@ -4303,7 +4402,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4303
4402
|
// actively-viewed thread receives new messages.
|
|
4304
4403
|
markConvRead(t) {
|
|
4305
4404
|
var a, r;
|
|
4306
|
-
if (!(t != null && t.id)) return;
|
|
4405
|
+
if (!(t != null && t.id) || t._draft) return;
|
|
4307
4406
|
const e = ((r = (a = this.s) == null ? void 0 : a.messagesByConv) == null ? void 0 : r[t.id]) || [], n = this.convLastActivity(t, e);
|
|
4308
4407
|
n && this.readState[t.id] !== n && (this.readState = { ...this.readState, [t.id]: n }, this.persistReadState());
|
|
4309
4408
|
},
|
|
@@ -4354,19 +4453,19 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4354
4453
|
// bounded by MIN/MAX_BETWEEN_MS.
|
|
4355
4454
|
scheduleReveal(t) {
|
|
4356
4455
|
const e = Date.now(), n = ((t == null ? void 0 : t.text_md) || "").length, a = Math.min(
|
|
4357
|
-
|
|
4358
|
-
Math.max(
|
|
4456
|
+
ji,
|
|
4457
|
+
Math.max(Ni, n * Di)
|
|
4359
4458
|
), s = Math.max(
|
|
4360
|
-
e +
|
|
4361
|
-
this.nextRevealAt +
|
|
4459
|
+
e + Fi,
|
|
4460
|
+
this.nextRevealAt + Ui
|
|
4362
4461
|
) + a;
|
|
4363
4462
|
this.nextRevealAt = s;
|
|
4364
|
-
const o = Math.max(0, s - e),
|
|
4365
|
-
this.revealedAt = { ...this.revealedAt, [
|
|
4463
|
+
const o = Math.max(0, s - e), d = t.id, v = setTimeout(() => {
|
|
4464
|
+
this.revealedAt = { ...this.revealedAt, [d]: Date.now() }, this.revealTimers = this.revealTimers.filter((w) => w !== v);
|
|
4366
4465
|
}, o);
|
|
4367
4466
|
this.revealTimers.push(v);
|
|
4368
4467
|
const k = setTimeout(() => {
|
|
4369
|
-
this.revealedAt[
|
|
4468
|
+
this.revealedAt[d] > 0 || (this.revealedAt = { ...this.revealedAt, [d]: Date.now() }), this.revealTimers = this.revealTimers.filter((w) => w !== k);
|
|
4370
4469
|
}, o + 4e3);
|
|
4371
4470
|
this.revealTimers.push(k);
|
|
4372
4471
|
},
|
|
@@ -4390,7 +4489,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4390
4489
|
widgetId: this.widgetId,
|
|
4391
4490
|
userId: this.userId,
|
|
4392
4491
|
userHash: this.userHash
|
|
4393
|
-
})), this.store = fe(
|
|
4492
|
+
})), this.store = fe(je(this.transport)), this.hydrateNotifPref(), this.setupNotifications(), await this.store.start(), this.customer && typeof this.customer == "object" && await this.store.applyCustomer(this.customer), console.log("[ww-messenger] boot done", {
|
|
4394
4493
|
ready: this.store.state.ready,
|
|
4395
4494
|
error: this.store.state.error
|
|
4396
4495
|
});
|
|
@@ -4399,39 +4498,59 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4399
4498
|
}
|
|
4400
4499
|
},
|
|
4401
4500
|
async refresh() {
|
|
4402
|
-
this.store && this.store.destroy(), this.cancelReveals(), this.revealedAt = {}, this.nextRevealAt = 0, this.convOpenedAt = 0, this.transport = null, this.store = null, this.isOpen = !1, this.draft = "", this.busy = !1, this.bootError = null, this.pendingAttachments = [], this.feedbackBusy = !1, this.feedbackDone = !1, this.historyOpen = !1, this.moreOpen = !1, this.activeConvId = null, this.showOnboarding = !1, await this.boot(), this.isEmbedded && this.store && await this.open();
|
|
4501
|
+
this.store && this.store.destroy(), this.cancelReveals(), this.teardownNotifications(), this.revealedAt = {}, this.nextRevealAt = 0, this.convOpenedAt = 0, this.transport = null, this.store = null, this.isOpen = !1, this.draft = "", this.busy = !1, this.bootError = null, this.pendingAttachments = [], this.feedbackBusy = !1, this.feedbackDone = !1, this.historyOpen = !1, this.moreOpen = !1, this.renameDialogOpen = !1, this.draftConv = null, this.activeConvId = null, this.showOnboarding = !1, await this.boot(), this.isEmbedded && this.store && await this.open();
|
|
4403
4502
|
},
|
|
4404
4503
|
// Opening straight from the étiquette: land on the unread thread it
|
|
4405
4504
|
// was previewing rather than whatever was last active.
|
|
4406
4505
|
async openFromPeek() {
|
|
4407
4506
|
var e, n;
|
|
4408
4507
|
const t = (e = this.latestUnread) == null ? void 0 : e.convId;
|
|
4409
|
-
t && t !== ((n = this.currentConv) == null ? void 0 : n.id) && (this.activeConvId = t, this.showOnboarding = !1), await this.open();
|
|
4508
|
+
t && t !== ((n = this.currentConv) == null ? void 0 : n.id) && (this.draftConv = null, this.activeConvId = t, this.showOnboarding = !1), await this.open();
|
|
4410
4509
|
},
|
|
4411
4510
|
async open() {
|
|
4412
|
-
|
|
4511
|
+
this.isOpen = !0, this.store && this.store.setPanelOpen(!0);
|
|
4512
|
+
const t = this.currentConv;
|
|
4513
|
+
if (t && !t._draft) {
|
|
4413
4514
|
try {
|
|
4414
|
-
await this.store.openConversation(
|
|
4415
|
-
} catch (
|
|
4416
|
-
console.error("[ww-messenger] load messages failed",
|
|
4515
|
+
await this.store.openConversation(t.id);
|
|
4516
|
+
} catch (e) {
|
|
4517
|
+
console.error("[ww-messenger] load messages failed", e);
|
|
4417
4518
|
}
|
|
4418
|
-
this.markConvRead(
|
|
4519
|
+
this.markConvRead(t);
|
|
4419
4520
|
}
|
|
4420
4521
|
},
|
|
4421
4522
|
close() {
|
|
4422
4523
|
this.isOpen = !1, this.store && this.store.setPanelOpen(!1);
|
|
4423
4524
|
},
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4525
|
+
// Enter "draft" mode : the composer is rendered immediately but no
|
|
4526
|
+
// server-side conversation is created yet. `ensureRealConv` runs
|
|
4527
|
+
// lazily on the first outbound action (text / attachment / form /
|
|
4528
|
+
// quick-link without URL), so users who open the chat and walk away
|
|
4529
|
+
// don't leave empty threads behind.
|
|
4530
|
+
startConv() {
|
|
4531
|
+
this.draftConv = {
|
|
4532
|
+
id: "__draft__",
|
|
4533
|
+
_draft: !0,
|
|
4534
|
+
name: "",
|
|
4535
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4536
|
+
}, this.activeConvId = null, this.showOnboarding = !1, this.focusComposer();
|
|
4537
|
+
},
|
|
4538
|
+
// Materialize the draft into a real server-side conversation. Returns
|
|
4539
|
+
// the freshly-created conv (so callers can `send` against its id) or
|
|
4540
|
+
// `null` if the creation failed.
|
|
4541
|
+
async ensureRealConv() {
|
|
4542
|
+
const t = this.currentConv;
|
|
4543
|
+
if (!t) return null;
|
|
4544
|
+
if (!t._draft) return t;
|
|
4545
|
+
if (this.busy) return null;
|
|
4546
|
+
this.busy = !0;
|
|
4547
|
+
try {
|
|
4548
|
+
const e = await this.store.createConversation({});
|
|
4549
|
+
return this.draftConv = null, this.activeConvId = e.id, await this.store.openConversation(e.id), this.markConvRead(e), e;
|
|
4550
|
+
} catch (e) {
|
|
4551
|
+
return console.error("[ww-messenger] create conv failed", e), this.bootError = (e == null ? void 0 : e.message) || String(e), null;
|
|
4552
|
+
} finally {
|
|
4553
|
+
this.busy = !1;
|
|
4435
4554
|
}
|
|
4436
4555
|
},
|
|
4437
4556
|
// After a fresh conversation renders, drop the caret straight into
|
|
@@ -4448,11 +4567,11 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4448
4567
|
this.historyOpen = !1, this.moreOpen = !this.moreOpen;
|
|
4449
4568
|
},
|
|
4450
4569
|
goHome() {
|
|
4451
|
-
this.historyOpen = !1, this.moreOpen = !1, this.activeConvId = null, this.showOnboarding = !0;
|
|
4570
|
+
this.historyOpen = !1, this.moreOpen = !1, this.draftConv = null, this.activeConvId = null, this.showOnboarding = !0;
|
|
4452
4571
|
},
|
|
4453
4572
|
async onDrawerPick(t) {
|
|
4454
4573
|
if (!(t != null && t.id) || !this.store) return;
|
|
4455
|
-
this.historyOpen = !1, this.activeConvId = t.id, this.showOnboarding = !1;
|
|
4574
|
+
this.historyOpen = !1, this.draftConv = null, this.activeConvId = t.id, this.showOnboarding = !1;
|
|
4456
4575
|
try {
|
|
4457
4576
|
await this.store.openConversation(t.id);
|
|
4458
4577
|
} catch (n) {
|
|
@@ -4464,8 +4583,106 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4464
4583
|
async onDrawerNew() {
|
|
4465
4584
|
this.historyOpen = !1, await this.startConv();
|
|
4466
4585
|
},
|
|
4467
|
-
onNotifToggle(t) {
|
|
4468
|
-
this.notifEnabled = !!t
|
|
4586
|
+
async onNotifToggle(t) {
|
|
4587
|
+
if (this.notifEnabled = !!t, this.persistNotifPref(), this.notifEnabled && typeof Notification < "u" && Notification.permission === "default")
|
|
4588
|
+
try {
|
|
4589
|
+
const e = await Notification.requestPermission();
|
|
4590
|
+
this.notifPermission = e;
|
|
4591
|
+
} catch (e) {
|
|
4592
|
+
console.warn("[ww-messenger] notif permission request failed", e);
|
|
4593
|
+
}
|
|
4594
|
+
},
|
|
4595
|
+
// ── Notifications (sound + browser push) ──────────────────────────
|
|
4596
|
+
setupNotifications() {
|
|
4597
|
+
this.transport && (this.teardownNotifications(), this._notifUnsub = this.transport.on("message", this.onIncomingNotification));
|
|
4598
|
+
},
|
|
4599
|
+
teardownNotifications() {
|
|
4600
|
+
var t, e;
|
|
4601
|
+
if (this._notifUnsub) {
|
|
4602
|
+
try {
|
|
4603
|
+
this._notifUnsub();
|
|
4604
|
+
} catch {
|
|
4605
|
+
}
|
|
4606
|
+
this._notifUnsub = null;
|
|
4607
|
+
}
|
|
4608
|
+
if (this._audioCtx) {
|
|
4609
|
+
try {
|
|
4610
|
+
(e = (t = this._audioCtx).close) == null || e.call(t);
|
|
4611
|
+
} catch {
|
|
4612
|
+
}
|
|
4613
|
+
this._audioCtx = null;
|
|
4614
|
+
}
|
|
4615
|
+
},
|
|
4616
|
+
notifStorageKey() {
|
|
4617
|
+
return `wm:notif:${this.widgetId || ""}:${this.userId || ""}`;
|
|
4618
|
+
},
|
|
4619
|
+
hydrateNotifPref() {
|
|
4620
|
+
try {
|
|
4621
|
+
if (typeof localStorage > "u") return;
|
|
4622
|
+
const t = localStorage.getItem(this.notifStorageKey());
|
|
4623
|
+
t === "0" ? this.notifEnabled = !1 : t === "1" && (this.notifEnabled = !0);
|
|
4624
|
+
} catch {
|
|
4625
|
+
}
|
|
4626
|
+
},
|
|
4627
|
+
persistNotifPref() {
|
|
4628
|
+
try {
|
|
4629
|
+
if (typeof localStorage > "u") return;
|
|
4630
|
+
localStorage.setItem(this.notifStorageKey(), this.notifEnabled ? "1" : "0");
|
|
4631
|
+
} catch {
|
|
4632
|
+
}
|
|
4633
|
+
},
|
|
4634
|
+
onIncomingNotification(t) {
|
|
4635
|
+
var o;
|
|
4636
|
+
if (!this.notifEnabled) return;
|
|
4637
|
+
const e = t == null ? void 0 : t.conversation_id, n = t == null ? void 0 : t.message;
|
|
4638
|
+
if (!e || !n || !ie(n)) return;
|
|
4639
|
+
const a = n != null && n.created_at ? Date.parse(n.created_at) : NaN;
|
|
4640
|
+
if (Number.isFinite(a) && a < this.convOpenedAt - 1e3) return;
|
|
4641
|
+
const r = typeof document < "u" && document.hidden;
|
|
4642
|
+
this.isOpen && !r && ((o = this.currentConv) == null ? void 0 : o.id) === e || (this.playNotificationSound(), this.showBrowserNotification(e, n));
|
|
4643
|
+
},
|
|
4644
|
+
playNotificationSound() {
|
|
4645
|
+
if (typeof window > "u") return;
|
|
4646
|
+
const t = window.AudioContext || window.webkitAudioContext;
|
|
4647
|
+
if (t)
|
|
4648
|
+
try {
|
|
4649
|
+
this._audioCtx || (this._audioCtx = new t());
|
|
4650
|
+
const e = this._audioCtx;
|
|
4651
|
+
if (e.state === "suspended")
|
|
4652
|
+
try {
|
|
4653
|
+
e.resume();
|
|
4654
|
+
} catch {
|
|
4655
|
+
}
|
|
4656
|
+
const n = e.currentTime, a = e.createOscillator(), r = e.createGain();
|
|
4657
|
+
a.connect(r), r.connect(e.destination), a.type = "sine", a.frequency.setValueAtTime(880, n), a.frequency.exponentialRampToValueAtTime(1320, n + 0.08), r.gain.setValueAtTime(0, n), r.gain.linearRampToValueAtTime(0.12, n + 0.02), r.gain.exponentialRampToValueAtTime(1e-4, n + 0.28), a.start(n), a.stop(n + 0.32);
|
|
4658
|
+
} catch {
|
|
4659
|
+
}
|
|
4660
|
+
},
|
|
4661
|
+
showBrowserNotification(t, e) {
|
|
4662
|
+
var o;
|
|
4663
|
+
if (typeof Notification > "u" || Notification.permission !== "granted") return;
|
|
4664
|
+
const n = this.allConversations.find((d) => d.id === t), a = (n == null ? void 0 : n.name) || ((o = this.widget) == null ? void 0 : o.name) || "Nouveau message", r = typeof (e == null ? void 0 : e.text_md) == "string" ? e.text_md.trim() : "", s = r ? r.slice(0, 140) : "Vous avez un nouveau message";
|
|
4665
|
+
try {
|
|
4666
|
+
const d = new Notification(a, {
|
|
4667
|
+
body: s,
|
|
4668
|
+
tag: `wm-${t}`,
|
|
4669
|
+
renotify: !1,
|
|
4670
|
+
silent: !0
|
|
4671
|
+
});
|
|
4672
|
+
d.onclick = () => {
|
|
4673
|
+
try {
|
|
4674
|
+
window.focus();
|
|
4675
|
+
} catch {
|
|
4676
|
+
}
|
|
4677
|
+
this.draftConv = null, this.showOnboarding = !1, this.activeConvId = t, this.isOpen = !0, this.store && this.store.setPanelOpen(!0);
|
|
4678
|
+
try {
|
|
4679
|
+
d.close();
|
|
4680
|
+
} catch {
|
|
4681
|
+
}
|
|
4682
|
+
};
|
|
4683
|
+
} catch (d) {
|
|
4684
|
+
console.warn("[ww-messenger] notification failed", d);
|
|
4685
|
+
}
|
|
4469
4686
|
},
|
|
4470
4687
|
async onMoreAction(t) {
|
|
4471
4688
|
switch (this.moreOpen = !1, t) {
|
|
@@ -4473,10 +4690,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4473
4690
|
this.historyOpen = !0;
|
|
4474
4691
|
break;
|
|
4475
4692
|
case "rename":
|
|
4476
|
-
|
|
4477
|
-
break;
|
|
4478
|
-
case "clear":
|
|
4479
|
-
await this.clearCurrentConv();
|
|
4693
|
+
this.openRenameDialog();
|
|
4480
4694
|
break;
|
|
4481
4695
|
case "export":
|
|
4482
4696
|
this.exportCurrentConv();
|
|
@@ -4497,31 +4711,23 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4497
4711
|
break;
|
|
4498
4712
|
}
|
|
4499
4713
|
},
|
|
4500
|
-
|
|
4714
|
+
openRenameDialog() {
|
|
4501
4715
|
const t = this.currentConv;
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
if (e == null) return;
|
|
4510
|
-
const n = e.trim();
|
|
4511
|
-
if (!(!n || n === t.name))
|
|
4716
|
+
!t || t._draft || (this.renameDialogOpen = !0);
|
|
4717
|
+
},
|
|
4718
|
+
async onRenameSubmit(t) {
|
|
4719
|
+
const e = this.currentConv;
|
|
4720
|
+
if (this.renameDialogOpen = !1, !e || e._draft || !this.store) return;
|
|
4721
|
+
const n = (t || "").trim();
|
|
4722
|
+
if (!(!n || n === e.name))
|
|
4512
4723
|
try {
|
|
4513
|
-
await this.store.patchConversation(
|
|
4724
|
+
await this.store.patchConversation(e.id, { name: n });
|
|
4514
4725
|
} catch (a) {
|
|
4515
4726
|
console.error("[ww-messenger] rename failed", a);
|
|
4516
4727
|
}
|
|
4517
4728
|
},
|
|
4518
|
-
async clearCurrentConv() {
|
|
4519
|
-
var n;
|
|
4520
|
-
const t = this.currentConv;
|
|
4521
|
-
!t || !this.store || !(!(typeof window < "u" && typeof window.confirm == "function") || window.confirm("Effacer ce fil de votre côté ? Cette action ne supprime pas les messages côté agent.")) || ((n = this.s) != null && n.messagesByConv && (this.s.messagesByConv[t.id] = []), this.activeConvId = null, this.showOnboarding = !0);
|
|
4522
|
-
},
|
|
4523
4729
|
exportCurrentConv() {
|
|
4524
|
-
var r, s, o,
|
|
4730
|
+
var r, s, o, d, v, k;
|
|
4525
4731
|
const t = this.currentConv;
|
|
4526
4732
|
if (!t) return;
|
|
4527
4733
|
const e = (((s = (r = this.s) == null ? void 0 : r.messagesByConv) == null ? void 0 : s[t.id]) || []).slice(), n = [
|
|
@@ -4531,7 +4737,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4531
4737
|
];
|
|
4532
4738
|
for (const w of e) {
|
|
4533
4739
|
if (!w) continue;
|
|
4534
|
-
const S = ((o = w.author) == null ? void 0 : o.name) || (((
|
|
4740
|
+
const S = ((o = w.author) == null ? void 0 : o.name) || (((d = w.author) == null ? void 0 : d.type) === "user" ? "Vous" : ((v = w.author) == null ? void 0 : v.type) === "agent_human" ? "Agent" : ((k = w.author) == null ? void 0 : k.type) === "agent_ia" ? "Assistant IA" : "Système"), R = w.created_at ? new Date(w.created_at).toLocaleString("fr-FR") : "", A = (w.text_md || "").trim();
|
|
4535
4741
|
A && (n.push(`[${R}] ${S} :`), n.push(A), n.push(""));
|
|
4536
4742
|
}
|
|
4537
4743
|
const a = new Blob([n.join(`
|
|
@@ -4544,10 +4750,10 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4544
4750
|
}
|
|
4545
4751
|
},
|
|
4546
4752
|
async onSend(t) {
|
|
4547
|
-
|
|
4548
|
-
if (!e && (
|
|
4753
|
+
let e = this.currentConv;
|
|
4754
|
+
if (!e && (this.startConv(), e = this.currentConv, !e) || e._draft && (e = await this.ensureRealConv(), !e))
|
|
4549
4755
|
return;
|
|
4550
|
-
const n =
|
|
4756
|
+
const n = e.id, a = this.pendingAttachments.slice();
|
|
4551
4757
|
this.pendingAttachments = [], this.unreadAnchorTs = "", this.unreadBoundaryTs = "", await this.store.send(n, t, { attachments: a.length ? a : void 0 });
|
|
4552
4758
|
},
|
|
4553
4759
|
async onSuggestion(t) {
|
|
@@ -4566,14 +4772,14 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4566
4772
|
async onFormSubmit({ values: t }) {
|
|
4567
4773
|
const e = this.pendingForm;
|
|
4568
4774
|
if (!(e != null && e.form)) return;
|
|
4569
|
-
const n =
|
|
4775
|
+
const n = Li(e.form, t);
|
|
4570
4776
|
if (!n) return;
|
|
4571
|
-
|
|
4572
|
-
a && await this.store.send(a.id, n, {
|
|
4777
|
+
let a = this.currentConv;
|
|
4778
|
+
a && (a._draft && (a = await this.ensureRealConv(), !a) || await this.store.send(a.id, n, {
|
|
4573
4779
|
metadata: {
|
|
4574
|
-
artifact:
|
|
4780
|
+
artifact: Ri(e.form, t)
|
|
4575
4781
|
}
|
|
4576
|
-
});
|
|
4782
|
+
}));
|
|
4577
4783
|
},
|
|
4578
4784
|
async onAttach(t) {
|
|
4579
4785
|
if (!(!t || !this.transport))
|
|
@@ -4599,7 +4805,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4599
4805
|
}
|
|
4600
4806
|
return;
|
|
4601
4807
|
}
|
|
4602
|
-
|
|
4808
|
+
this.currentConv || this.startConv(), await this.onSend(t.label);
|
|
4603
4809
|
}
|
|
4604
4810
|
},
|
|
4605
4811
|
async onFeedback({ rating: t, comment: e }) {
|
|
@@ -4615,30 +4821,30 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4615
4821
|
}
|
|
4616
4822
|
}
|
|
4617
4823
|
}
|
|
4618
|
-
},
|
|
4824
|
+
}, Hi = {
|
|
4619
4825
|
key: 0,
|
|
4620
4826
|
class: "wm-loading",
|
|
4621
4827
|
"aria-busy": "true",
|
|
4622
4828
|
"aria-live": "polite"
|
|
4623
|
-
},
|
|
4829
|
+
}, zi = {
|
|
4624
4830
|
key: 0,
|
|
4625
4831
|
class: "wm-state"
|
|
4626
|
-
},
|
|
4832
|
+
}, Vi = { class: "wm-state__err" }, qi = { class: "wm-state__errSub" }, Wi = { class: "wm-bottom" }, Ki = {
|
|
4627
4833
|
key: 0,
|
|
4628
4834
|
ref: "floatEl",
|
|
4629
4835
|
class: "wm-float"
|
|
4630
|
-
},
|
|
4836
|
+
}, Gi = {
|
|
4631
4837
|
key: 1,
|
|
4632
4838
|
class: "wm-actionWait",
|
|
4633
4839
|
role: "status",
|
|
4634
4840
|
"aria-live": "polite"
|
|
4635
|
-
},
|
|
4636
|
-
key:
|
|
4841
|
+
}, Yi = { class: "wm-actionWait__lbl" }, Ji = {
|
|
4842
|
+
key: 2,
|
|
4637
4843
|
class: "wm-attached"
|
|
4638
|
-
},
|
|
4639
|
-
function
|
|
4640
|
-
const o = I("Launcher"),
|
|
4641
|
-
return l(),
|
|
4844
|
+
}, Xi = ["onClick"];
|
|
4845
|
+
function Qi(t, e, n, a, r, s) {
|
|
4846
|
+
const o = I("Launcher"), d = I("Header"), v = I("Onboarding"), k = I("MessageList"), w = I("ApprovalCard"), S = I("FormCard"), R = I("Feedback"), A = I("SuggestionChips"), U = I("Composer"), x = I("MoreMenu"), j = I("RenameDialog"), P = I("HistoryDrawer");
|
|
4847
|
+
return l(), c("div", {
|
|
4642
4848
|
class: B(["wm-root", `wm-root--${n.displayMode}`])
|
|
4643
4849
|
}, [
|
|
4644
4850
|
!r.isOpen && !s.isEmbedded ? (l(), $(o, {
|
|
@@ -4647,22 +4853,22 @@ function Pi(t, e, n, a, r, s) {
|
|
|
4647
4853
|
peek: s.launcherPeek,
|
|
4648
4854
|
onOpen: s.openFromPeek,
|
|
4649
4855
|
onDismiss: e[0] || (e[0] = (F) => r.labelDismissed = !0)
|
|
4650
|
-
}, null, 8, ["unread-count", "peek", "onOpen"])) :
|
|
4651
|
-
r.isOpen || s.isEmbedded ? (l(),
|
|
4856
|
+
}, null, 8, ["unread-count", "peek", "onOpen"])) : y("", !0),
|
|
4857
|
+
r.isOpen || s.isEmbedded ? (l(), c("section", {
|
|
4652
4858
|
key: 1,
|
|
4653
4859
|
class: B(["wm-panel", `wm-panel--${n.displayMode}`]),
|
|
4654
4860
|
style: G(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
|
|
4655
4861
|
role: "dialog",
|
|
4656
4862
|
"aria-label": "Messenger"
|
|
4657
4863
|
}, [
|
|
4658
|
-
!s.ready && !s.error ? (l(),
|
|
4659
|
-
s.isEmbedded ?
|
|
4864
|
+
!s.ready && !s.error ? (l(), c("div", Hi, [
|
|
4865
|
+
s.isEmbedded ? y("", !0) : (l(), c("button", {
|
|
4660
4866
|
key: 0,
|
|
4661
4867
|
type: "button",
|
|
4662
4868
|
class: "wm-loading__close",
|
|
4663
4869
|
"aria-label": "Réduire",
|
|
4664
4870
|
onClick: e[1] || (e[1] = (...F) => s.close && s.close(...F))
|
|
4665
|
-
}, [...e[
|
|
4871
|
+
}, [...e[7] || (e[7] = [
|
|
4666
4872
|
i("svg", {
|
|
4667
4873
|
width: "13",
|
|
4668
4874
|
height: "13",
|
|
@@ -4677,12 +4883,12 @@ function Pi(t, e, n, a, r, s) {
|
|
|
4677
4883
|
i("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
4678
4884
|
], -1)
|
|
4679
4885
|
])])),
|
|
4680
|
-
e[
|
|
4886
|
+
e[8] || (e[8] = i("div", {
|
|
4681
4887
|
class: "wm-loading__spinner",
|
|
4682
4888
|
"aria-hidden": "true"
|
|
4683
4889
|
}, null, -1))
|
|
4684
|
-
])) : (l(),
|
|
4685
|
-
K(
|
|
4890
|
+
])) : (l(), c(T, { key: 1 }, [
|
|
4891
|
+
K(d, {
|
|
4686
4892
|
title: s.headerTitle,
|
|
4687
4893
|
escalated: s.isEscalated,
|
|
4688
4894
|
"agent-name": s.humanAgentName,
|
|
@@ -4697,9 +4903,9 @@ function Pi(t, e, n, a, r, s) {
|
|
|
4697
4903
|
onMore: s.toggleMore,
|
|
4698
4904
|
onClose: s.close
|
|
4699
4905
|
}, null, 8, ["title", "escalated", "agent-name", "agent-avatar-url", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "onBack", "onMore", "onClose"]),
|
|
4700
|
-
s.error ? (l(),
|
|
4701
|
-
i("div",
|
|
4702
|
-
e[
|
|
4906
|
+
s.error ? (l(), c("div", zi, [
|
|
4907
|
+
i("div", Vi, [
|
|
4908
|
+
e[10] || (e[10] = i("div", { class: "wm-state__errIcon" }, [
|
|
4703
4909
|
i("svg", {
|
|
4704
4910
|
width: "14",
|
|
4705
4911
|
height: "14",
|
|
@@ -4715,11 +4921,11 @@ function Pi(t, e, n, a, r, s) {
|
|
|
4715
4921
|
])
|
|
4716
4922
|
], -1)),
|
|
4717
4923
|
i("div", null, [
|
|
4718
|
-
e[
|
|
4719
|
-
i("div",
|
|
4924
|
+
e[9] || (e[9] = i("div", { class: "wm-state__errTitle" }, "Connexion impossible", -1)),
|
|
4925
|
+
i("div", qi, b(s.error), 1)
|
|
4720
4926
|
])
|
|
4721
4927
|
])
|
|
4722
|
-
])) : s.currentConv ? (l(),
|
|
4928
|
+
])) : s.currentConv ? (l(), c(T, { key: 2 }, [
|
|
4723
4929
|
K(k, {
|
|
4724
4930
|
ref: "messageList",
|
|
4725
4931
|
messages: s.displayedMessages,
|
|
@@ -4732,8 +4938,8 @@ function Pi(t, e, n, a, r, s) {
|
|
|
4732
4938
|
"unread-boundary-ts": r.unreadBoundaryTs,
|
|
4733
4939
|
onLoadMore: s.onLoadMore
|
|
4734
4940
|
}, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "unread-anchor-ts", "unread-boundary-ts", "onLoadMore"]),
|
|
4735
|
-
i("div",
|
|
4736
|
-
s.floatVisible ? (l(),
|
|
4941
|
+
i("div", Wi, [
|
|
4942
|
+
s.floatVisible ? (l(), c("div", Ki, [
|
|
4737
4943
|
s.approvalReady ? (l(), $(w, {
|
|
4738
4944
|
key: 0,
|
|
4739
4945
|
action: s.approvalTitle,
|
|
@@ -4754,14 +4960,14 @@ function Pi(t, e, n, a, r, s) {
|
|
|
4754
4960
|
items: s.suggestions,
|
|
4755
4961
|
onSelect: s.onSuggestion
|
|
4756
4962
|
}, null, 8, ["items", "onSelect"]))
|
|
4757
|
-
], 512)) :
|
|
4758
|
-
s.actionInFlight ? (l(),
|
|
4759
|
-
e[
|
|
4963
|
+
], 512)) : y("", !0),
|
|
4964
|
+
s.actionInFlight ? (l(), c("div", Gi, [
|
|
4965
|
+
e[11] || (e[11] = i("span", {
|
|
4760
4966
|
class: "wm-actionWait__spinner",
|
|
4761
4967
|
"aria-hidden": "true"
|
|
4762
4968
|
}, null, -1)),
|
|
4763
|
-
i("span",
|
|
4764
|
-
])) : (l(), $(
|
|
4969
|
+
i("span", Yi, b(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
|
|
4970
|
+
])) : (l(), $(U, {
|
|
4765
4971
|
key: 2,
|
|
4766
4972
|
ref: "composer",
|
|
4767
4973
|
modelValue: r.draft,
|
|
@@ -4775,22 +4981,28 @@ function Pi(t, e, n, a, r, s) {
|
|
|
4775
4981
|
]),
|
|
4776
4982
|
r.moreOpen ? (l(), $(x, {
|
|
4777
4983
|
key: 0,
|
|
4778
|
-
"can-rename": !!s.currentConv,
|
|
4779
|
-
"can-
|
|
4780
|
-
"can-export": !!s.currentConv,
|
|
4984
|
+
"can-rename": !!s.currentConv && !s.currentConv._draft,
|
|
4985
|
+
"can-export": !!s.currentConv && !s.currentConv._draft,
|
|
4781
4986
|
"notif-enabled": r.notifEnabled,
|
|
4782
4987
|
"status-url": s.statusUrl,
|
|
4783
4988
|
"help-url": s.helpUrl,
|
|
4784
4989
|
onClose: e[3] || (e[3] = (F) => r.moreOpen = !1),
|
|
4785
4990
|
onNotifToggle: s.onNotifToggle,
|
|
4786
4991
|
onAction: s.onMoreAction
|
|
4787
|
-
}, null, 8, ["can-rename", "can-
|
|
4788
|
-
r.
|
|
4789
|
-
|
|
4790
|
-
|
|
4992
|
+
}, null, 8, ["can-rename", "can-export", "notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : y("", !0),
|
|
4993
|
+
r.renameDialogOpen && s.currentConv && !s.currentConv._draft ? (l(), $(j, {
|
|
4994
|
+
key: 1,
|
|
4995
|
+
"initial-value": s.currentConv.name || "",
|
|
4996
|
+
title: "Modifier le titre de la conversation",
|
|
4997
|
+
onClose: e[4] || (e[4] = (F) => r.renameDialogOpen = !1),
|
|
4998
|
+
onSubmit: s.onRenameSubmit
|
|
4999
|
+
}, null, 8, ["initial-value", "onSubmit"])) : y("", !0),
|
|
5000
|
+
r.pendingAttachments.length ? (l(), c("div", Ji, [
|
|
5001
|
+
(l(!0), c(T, null, D(r.pendingAttachments, (F, H) => (l(), c("div", {
|
|
5002
|
+
key: H,
|
|
4791
5003
|
class: "wm-attached__chip"
|
|
4792
5004
|
}, [
|
|
4793
|
-
e[
|
|
5005
|
+
e[13] || (e[13] = i("svg", {
|
|
4794
5006
|
width: "11",
|
|
4795
5007
|
height: "11",
|
|
4796
5008
|
viewBox: "0 0 24 24",
|
|
@@ -4807,8 +5019,8 @@ function Pi(t, e, n, a, r, s) {
|
|
|
4807
5019
|
i("button", {
|
|
4808
5020
|
type: "button",
|
|
4809
5021
|
"aria-label": "Retirer",
|
|
4810
|
-
onClick: (
|
|
4811
|
-
}, [...e[
|
|
5022
|
+
onClick: (Y) => r.pendingAttachments.splice(H, 1)
|
|
5023
|
+
}, [...e[12] || (e[12] = [
|
|
4812
5024
|
i("svg", {
|
|
4813
5025
|
width: "10",
|
|
4814
5026
|
height: "10",
|
|
@@ -4822,9 +5034,9 @@ function Pi(t, e, n, a, r, s) {
|
|
|
4822
5034
|
}, [
|
|
4823
5035
|
i("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
4824
5036
|
], -1)
|
|
4825
|
-
])], 8,
|
|
5037
|
+
])], 8, Xi)
|
|
4826
5038
|
]))), 128))
|
|
4827
|
-
])) :
|
|
5039
|
+
])) : y("", !0)
|
|
4828
5040
|
], 64)) : (l(), $(v, {
|
|
4829
5041
|
key: 1,
|
|
4830
5042
|
"welcome-message": s.widgetWelcomeMessage,
|
|
@@ -4836,73 +5048,72 @@ function Pi(t, e, n, a, r, s) {
|
|
|
4836
5048
|
onSelect: s.onQuickLink,
|
|
4837
5049
|
onResume: s.onDrawerPick
|
|
4838
5050
|
}, null, 8, ["welcome-message", "agent-name", "quick-links", "unread-threads", "busy", "onStart", "onSelect", "onResume"])),
|
|
4839
|
-
r.historyOpen ? (l(), $(
|
|
5051
|
+
r.historyOpen ? (l(), $(P, {
|
|
4840
5052
|
key: 3,
|
|
4841
5053
|
conversations: s.drawerConversations,
|
|
4842
5054
|
"active-id": s.currentConv ? s.currentConv.id : null,
|
|
4843
|
-
onClose: e[
|
|
5055
|
+
onClose: e[5] || (e[5] = (F) => r.historyOpen = !1),
|
|
4844
5056
|
onNew: s.onDrawerNew,
|
|
4845
5057
|
onPick: s.onDrawerPick
|
|
4846
|
-
}, null, 8, ["conversations", "active-id", "onNew", "onPick"])) :
|
|
5058
|
+
}, null, 8, ["conversations", "active-id", "onNew", "onPick"])) : y("", !0),
|
|
4847
5059
|
r.moreOpen && !s.currentConv ? (l(), $(x, {
|
|
4848
5060
|
key: 4,
|
|
4849
5061
|
"can-rename": !1,
|
|
4850
|
-
"can-clear": !1,
|
|
4851
5062
|
"can-export": !1,
|
|
4852
5063
|
"notif-enabled": r.notifEnabled,
|
|
4853
5064
|
"status-url": s.statusUrl,
|
|
4854
5065
|
"help-url": s.helpUrl,
|
|
4855
|
-
onClose: e[
|
|
5066
|
+
onClose: e[6] || (e[6] = (F) => r.moreOpen = !1),
|
|
4856
5067
|
onNotifToggle: s.onNotifToggle,
|
|
4857
5068
|
onAction: s.onMoreAction
|
|
4858
|
-
}, null, 8, ["notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) :
|
|
5069
|
+
}, null, 8, ["notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : y("", !0)
|
|
4859
5070
|
], 64))
|
|
4860
|
-
], 6)) :
|
|
5071
|
+
], 6)) : y("", !0)
|
|
4861
5072
|
], 2);
|
|
4862
5073
|
}
|
|
4863
|
-
const
|
|
5074
|
+
const ta = /* @__PURE__ */ E(Pi, [["render", Qi], ["__scopeId", "data-v-1d79cc79"]]), na = "0.3.0";
|
|
4864
5075
|
export {
|
|
4865
5076
|
te as AIAvatar,
|
|
4866
|
-
|
|
5077
|
+
ue as AVATAR_COLORS,
|
|
4867
5078
|
Zt as ActionResult,
|
|
4868
|
-
|
|
5079
|
+
cr as ApprovalCard,
|
|
4869
5080
|
ln as ArtifactFormResponse,
|
|
4870
5081
|
bn as ArtifactInfoCard,
|
|
4871
|
-
|
|
5082
|
+
Un as ArtifactRenderer,
|
|
4872
5083
|
Fn as ArtifactTicket,
|
|
4873
5084
|
Qn as AttachmentPreview,
|
|
4874
5085
|
is as Bubble,
|
|
4875
5086
|
Js as Composer,
|
|
4876
5087
|
Pe as DEFAULT_BASE_URL,
|
|
4877
5088
|
Kr as Feedback,
|
|
4878
|
-
|
|
4879
|
-
|
|
5089
|
+
Dr as FormCard,
|
|
5090
|
+
yt as Header,
|
|
4880
5091
|
fi as HistoryDrawer,
|
|
4881
5092
|
ke as HumanAvatar,
|
|
4882
5093
|
Ke as Launcher,
|
|
4883
|
-
|
|
5094
|
+
me as MEDIA_RECORDER_SUPPORTED,
|
|
4884
5095
|
Is as MessageList,
|
|
4885
|
-
|
|
5096
|
+
ta as Messenger,
|
|
4886
5097
|
ki as MoreMenu,
|
|
4887
5098
|
Pt as Onboarding,
|
|
4888
|
-
|
|
5099
|
+
oe as SCREEN_CAPTURE_SUPPORTED,
|
|
4889
5100
|
er as SuggestionChips,
|
|
4890
5101
|
ot as TeamAvatars,
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
5102
|
+
ds as Typing,
|
|
5103
|
+
na as VERSION,
|
|
5104
|
+
ye as avatarColor,
|
|
4894
5105
|
we as avatarInitials,
|
|
4895
5106
|
Es as captureScreenshotFile,
|
|
4896
|
-
|
|
4897
|
-
|
|
5107
|
+
N as colors,
|
|
5108
|
+
je as createStore,
|
|
4898
5109
|
Re as createTransport,
|
|
4899
|
-
|
|
5110
|
+
ta as default,
|
|
4900
5111
|
be as formatTime,
|
|
4901
|
-
|
|
5112
|
+
ea as guessAttachmentKind,
|
|
4902
5113
|
Bs as pickRecorderMime,
|
|
4903
5114
|
ts as renderMarkdown,
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
5115
|
+
Ls as startScreenRecording,
|
|
5116
|
+
Ue as tokensCss,
|
|
5117
|
+
Ne as uuid,
|
|
5118
|
+
Ne as v4
|
|
4908
5119
|
};
|