@_solaris/messenger-widget 0.5.74 → 0.5.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/iframe/iframe.css +1 -1
- package/dist/iframe/iframe.js +3 -3
- package/dist/messenger.cjs +10 -10
- package/dist/messenger.js +310 -300
- package/dist/snippet.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/core/i18n.d.ts +2 -0
- package/package.json +1 -1
package/dist/messenger.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reactive as $e, openBlock as c, createElementBlock as d, normalizeStyle as z, normalizeClass as R, toDisplayString as v, resolveComponent as B, createVNode as $, Transition as Ne, withCtx as
|
|
1
|
+
import { reactive as $e, openBlock as c, createElementBlock as d, normalizeStyle as z, normalizeClass as R, toDisplayString as v, resolveComponent as B, createVNode as $, Transition as Ne, withCtx as je, Fragment as I, renderList as j, withKeys as ge, withModifiers as J, createElementVNode as o, createCommentVNode as b, createBlock as D, resolveDynamicComponent as Ae, mergeProps as Fe, withDirectives as G, vModelText as te, createTextVNode as Se, renderSlot as Ke, vModelCheckbox as We, vModelSelect as Ge, markRaw as Re } from "vue";
|
|
2
2
|
const Ye = [
|
|
3
3
|
"connected",
|
|
4
4
|
"message",
|
|
@@ -86,7 +86,7 @@ function Ze(e) {
|
|
|
86
86
|
return null;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
async function
|
|
89
|
+
async function f(u) {
|
|
90
90
|
if (t.started) return t.lastBootstrap;
|
|
91
91
|
if (!(u != null && u.origin))
|
|
92
92
|
throw new Error("[transport] start requires origin");
|
|
@@ -150,7 +150,7 @@ function Ze(e) {
|
|
|
150
150
|
console.error("[transport] initial /conversations failed", u);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
async function
|
|
153
|
+
async function y() {
|
|
154
154
|
const u = await r("GET", "/customers/me");
|
|
155
155
|
return (u == null ? void 0 : u.customer) ?? null;
|
|
156
156
|
}
|
|
@@ -308,13 +308,13 @@ function Ze(e) {
|
|
|
308
308
|
a("idle"), fe(), t.panelOpen && W();
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
|
-
function
|
|
311
|
+
function _() {
|
|
312
312
|
h(), clearTimeout(t.burstTimer), clearTimeout(t.hiddenGraceTimer), t.hiddenGraceTimer = null, X(), t.visibilityHandler && (document.removeEventListener(
|
|
313
313
|
"visibilitychange",
|
|
314
314
|
t.visibilityHandler
|
|
315
315
|
), t.visibilityHandler = null), t.started = !1;
|
|
316
316
|
}
|
|
317
|
-
async function
|
|
317
|
+
async function w(u) {
|
|
318
318
|
return !u || typeof u != "object" ? null : r("POST", "/update", u);
|
|
319
319
|
}
|
|
320
320
|
function C(u) {
|
|
@@ -329,13 +329,13 @@ function Ze(e) {
|
|
|
329
329
|
}
|
|
330
330
|
return {
|
|
331
331
|
on: s,
|
|
332
|
-
start:
|
|
333
|
-
stop:
|
|
332
|
+
start: f,
|
|
333
|
+
stop: _,
|
|
334
334
|
setPanelOpen: me,
|
|
335
|
-
update:
|
|
335
|
+
update: w,
|
|
336
336
|
context: C,
|
|
337
337
|
// REST
|
|
338
|
-
getCustomer:
|
|
338
|
+
getCustomer: y,
|
|
339
339
|
patchCustomer: T,
|
|
340
340
|
listConversations: E,
|
|
341
341
|
createConversation: A,
|
|
@@ -409,22 +409,22 @@ function st(e) {
|
|
|
409
409
|
})
|
|
410
410
|
), s.push(
|
|
411
411
|
e.on("message", (h) => {
|
|
412
|
-
const m = h == null ? void 0 : h.conversation_id,
|
|
413
|
-
!m || !(
|
|
412
|
+
const m = h == null ? void 0 : h.conversation_id, _ = h == null ? void 0 : h.message;
|
|
413
|
+
!m || !(_ != null && _.id) || (W(m, _), _.client_msg_id && delete t.streamingByMsgId[_.client_msg_id], ae(m, _.created_at));
|
|
414
414
|
})
|
|
415
415
|
), s.push(
|
|
416
416
|
e.on("message_stream", (h) => {
|
|
417
|
-
const m = h == null ? void 0 : h.message_id,
|
|
418
|
-
!m || typeof
|
|
417
|
+
const m = h == null ? void 0 : h.message_id, _ = h == null ? void 0 : h.token;
|
|
418
|
+
!m || typeof _ != "string" || (t.streamingByMsgId[m] = (t.streamingByMsgId[m] || "") + _);
|
|
419
419
|
})
|
|
420
420
|
), s.push(
|
|
421
421
|
e.on("conversation_updated", (h) => {
|
|
422
|
-
const m = h == null ? void 0 : h.conversation_id,
|
|
423
|
-
if (!m || !
|
|
424
|
-
const
|
|
425
|
-
|
|
426
|
-
...t.conversations[
|
|
427
|
-
...
|
|
422
|
+
const m = h == null ? void 0 : h.conversation_id, _ = h == null ? void 0 : h.changes;
|
|
423
|
+
if (!m || !_) return;
|
|
424
|
+
const w = t.conversations.findIndex((C) => C.id === m);
|
|
425
|
+
w !== -1 && (t.conversations[w] = {
|
|
426
|
+
...t.conversations[w],
|
|
427
|
+
..._
|
|
428
428
|
});
|
|
429
429
|
})
|
|
430
430
|
), s.push(
|
|
@@ -433,10 +433,10 @@ function st(e) {
|
|
|
433
433
|
})
|
|
434
434
|
), s.push(
|
|
435
435
|
e.on("action_status", (h) => {
|
|
436
|
-
const m = h == null ? void 0 : h.conversation_id,
|
|
437
|
-
if (!m || !
|
|
436
|
+
const m = h == null ? void 0 : h.conversation_id, _ = h == null ? void 0 : h.action_id, w = h == null ? void 0 : h.action_name;
|
|
437
|
+
if (!m || !_) return;
|
|
438
438
|
const C = t.runningActionsByConv[m] || {};
|
|
439
|
-
h.state === "running" ? (C[
|
|
439
|
+
h.state === "running" ? (C[_] = w || _, t.runningActionsByConv[m] = { ...C }) : h.state === "done" && (delete C[_], t.runningActionsByConv[m] = { ...C });
|
|
440
440
|
})
|
|
441
441
|
), s.push(
|
|
442
442
|
e.on("activity", (h) => {
|
|
@@ -446,7 +446,7 @@ function st(e) {
|
|
|
446
446
|
async function i(h) {
|
|
447
447
|
try {
|
|
448
448
|
const m = new Promise(
|
|
449
|
-
(
|
|
449
|
+
(w, C) => setTimeout(
|
|
450
450
|
() => C(
|
|
451
451
|
new Error(
|
|
452
452
|
"bootstrap timeout (15s) — check baseUrl, CORS, and network"
|
|
@@ -454,11 +454,11 @@ function st(e) {
|
|
|
454
454
|
),
|
|
455
455
|
15e3
|
|
456
456
|
)
|
|
457
|
-
),
|
|
457
|
+
), _ = await Promise.race([
|
|
458
458
|
e.start(h),
|
|
459
459
|
m
|
|
460
460
|
]);
|
|
461
|
-
t.config =
|
|
461
|
+
t.config = _.config, t.customer = _.customer, t.conversations = await Promise.race([
|
|
462
462
|
e.listConversations(),
|
|
463
463
|
m
|
|
464
464
|
]), t.ready = !0;
|
|
@@ -478,38 +478,38 @@ function st(e) {
|
|
|
478
478
|
const m = ye(h);
|
|
479
479
|
if (!m) return t.customer;
|
|
480
480
|
try {
|
|
481
|
-
const
|
|
482
|
-
|
|
483
|
-
} catch (
|
|
484
|
-
console.error("[store] applyCustomer failed",
|
|
481
|
+
const _ = await e.patchCustomer(m);
|
|
482
|
+
_ && (t.customer = _);
|
|
483
|
+
} catch (_) {
|
|
484
|
+
console.error("[store] applyCustomer failed", _);
|
|
485
485
|
}
|
|
486
486
|
return t.customer;
|
|
487
487
|
}
|
|
488
488
|
async function r(h = {}) {
|
|
489
|
-
const m = await e.createConversation(h),
|
|
490
|
-
return
|
|
489
|
+
const m = await e.createConversation(h), _ = t.conversations.findIndex((w) => w.id === m.id);
|
|
490
|
+
return _ === -1 ? t.conversations = [m, ...t.conversations] : t.conversations[_] = m, m;
|
|
491
491
|
}
|
|
492
492
|
const l = 50;
|
|
493
|
-
async function
|
|
493
|
+
async function f(h) {
|
|
494
494
|
const m = t.paginationByConv[h];
|
|
495
495
|
if (!(m != null && m.loaded || m != null && m.loading)) {
|
|
496
|
-
|
|
496
|
+
y(h, { nextCursor: null, loading: !0, loaded: !1 });
|
|
497
497
|
try {
|
|
498
|
-
const
|
|
498
|
+
const _ = await e.listMessages(h, {
|
|
499
499
|
limit: l
|
|
500
|
-
}),
|
|
501
|
-
for (const p of
|
|
500
|
+
}), w = (_ == null ? void 0 : _.messages) ?? [], C = t.messagesByConv[h] || [], u = /* @__PURE__ */ new Set();
|
|
501
|
+
for (const p of w)
|
|
502
502
|
(p == null ? void 0 : p.id) != null && u.add(`id:${String(p.id)}`), p != null && p.client_msg_id && u.add(`c:${p.client_msg_id}`);
|
|
503
503
|
const g = C.filter((p) => !((p == null ? void 0 : p.id) != null && u.has(`id:${String(p.id)}`) || p != null && p.client_msg_id && u.has(`c:${p.client_msg_id}`)));
|
|
504
|
-
t.messagesByConv[h] = [...
|
|
504
|
+
t.messagesByConv[h] = [...w, ...g].sort(
|
|
505
505
|
me
|
|
506
|
-
),
|
|
507
|
-
nextCursor: (
|
|
506
|
+
), y(h, {
|
|
507
|
+
nextCursor: (_ == null ? void 0 : _.next_cursor) ?? null,
|
|
508
508
|
loading: !1,
|
|
509
509
|
loaded: !0
|
|
510
510
|
});
|
|
511
|
-
} catch (
|
|
512
|
-
console.error("[store] openConversation failed",
|
|
511
|
+
} catch (_) {
|
|
512
|
+
console.error("[store] openConversation failed", _), y(h, {
|
|
513
513
|
nextCursor: null,
|
|
514
514
|
loading: !1,
|
|
515
515
|
loaded: !1
|
|
@@ -521,45 +521,45 @@ function st(e) {
|
|
|
521
521
|
var C;
|
|
522
522
|
const m = t.paginationByConv[h];
|
|
523
523
|
if (!m || m.loading || !m.nextCursor) return;
|
|
524
|
-
const
|
|
525
|
-
if (
|
|
526
|
-
|
|
524
|
+
const w = (C = (t.messagesByConv[h] || []).find((u) => u == null ? void 0 : u.created_at)) == null ? void 0 : C.created_at;
|
|
525
|
+
if (w) {
|
|
526
|
+
y(h, { ...m, loading: !0 });
|
|
527
527
|
try {
|
|
528
528
|
const u = await e.listMessages(h, {
|
|
529
|
-
before:
|
|
529
|
+
before: w,
|
|
530
530
|
limit: l
|
|
531
531
|
}), g = (u == null ? void 0 : u.messages) ?? [], p = t.messagesByConv[h] || [], S = /* @__PURE__ */ new Set();
|
|
532
532
|
for (const x of p)
|
|
533
533
|
(x == null ? void 0 : x.id) != null && S.add(`id:${String(x.id)}`), x != null && x.client_msg_id && S.add(`c:${x.client_msg_id}`);
|
|
534
534
|
const O = g.filter((x) => !((x == null ? void 0 : x.id) != null && S.has(`id:${String(x.id)}`) || x != null && x.client_msg_id && S.has(`c:${x.client_msg_id}`)));
|
|
535
|
-
t.messagesByConv[h] = [...O, ...p],
|
|
535
|
+
t.messagesByConv[h] = [...O, ...p], y(h, {
|
|
536
536
|
nextCursor: (u == null ? void 0 : u.next_cursor) ?? null,
|
|
537
537
|
loading: !1,
|
|
538
538
|
loaded: !0
|
|
539
539
|
});
|
|
540
540
|
} catch (u) {
|
|
541
|
-
console.error("[store] loadMore failed", u),
|
|
541
|
+
console.error("[store] loadMore failed", u), y(h, { ...m, loading: !1 });
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function y(h, m) {
|
|
546
546
|
t.paginationByConv = { ...t.paginationByConv, [h]: m };
|
|
547
547
|
}
|
|
548
548
|
async function T(h, m) {
|
|
549
|
-
const
|
|
550
|
-
|
|
549
|
+
const _ = await e.patchConversation(h, m), w = t.conversations.findIndex((C) => C.id === h);
|
|
550
|
+
w !== -1 && (t.conversations[w] = _);
|
|
551
551
|
}
|
|
552
552
|
async function E(h) {
|
|
553
553
|
if (!h) return [];
|
|
554
554
|
const m = t.messagesByConv[h] || [];
|
|
555
|
-
let
|
|
556
|
-
for (const
|
|
557
|
-
|
|
555
|
+
let _ = "";
|
|
556
|
+
for (const w of m)
|
|
557
|
+
w != null && w.created_at && w.created_at > _ && (_ = w.created_at);
|
|
558
558
|
try {
|
|
559
|
-
const
|
|
559
|
+
const w = await e.listMessages(
|
|
560
560
|
h,
|
|
561
|
-
|
|
562
|
-
), C = (
|
|
561
|
+
_ ? { since: _ } : {}
|
|
562
|
+
), C = (w == null ? void 0 : w.messages) || [];
|
|
563
563
|
if (!C.length) return [];
|
|
564
564
|
const u = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Set();
|
|
565
565
|
for (const S of m)
|
|
@@ -570,25 +570,25 @@ function st(e) {
|
|
|
570
570
|
W(h, S), O || p.push(S);
|
|
571
571
|
}
|
|
572
572
|
return p;
|
|
573
|
-
} catch (
|
|
574
|
-
return console.error("[store] fetchSinceLast failed",
|
|
573
|
+
} catch (w) {
|
|
574
|
+
return console.error("[store] fetchSinceLast failed", w), [];
|
|
575
575
|
}
|
|
576
576
|
}
|
|
577
577
|
async function A(h, m) {
|
|
578
578
|
if (!(!h || m == null))
|
|
579
579
|
try {
|
|
580
|
-
const
|
|
580
|
+
const _ = await e.markConversationRead(h, m), w = (_ == null ? void 0 : _.last_read_message_id) ?? m, C = t.conversations.findIndex((u) => (u == null ? void 0 : u.id) === h);
|
|
581
581
|
C !== -1 && (t.conversations[C] = {
|
|
582
582
|
...t.conversations[C],
|
|
583
|
-
last_read_message_id:
|
|
583
|
+
last_read_message_id: w
|
|
584
584
|
});
|
|
585
|
-
} catch (
|
|
586
|
-
console.error("[store] markConversationRead failed",
|
|
585
|
+
} catch (_) {
|
|
586
|
+
console.error("[store] markConversationRead failed", _);
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
|
-
async function q(h, m, { attachments:
|
|
589
|
+
async function q(h, m, { attachments: _, metadata: w } = {}) {
|
|
590
590
|
var O;
|
|
591
|
-
const C = (m || "").trim(), u = Array.isArray(
|
|
591
|
+
const C = (m || "").trim(), u = Array.isArray(_) && _.length > 0;
|
|
592
592
|
if (!h || !C && !u) return;
|
|
593
593
|
const g = nt(), p = fe(h), S = {
|
|
594
594
|
id: g,
|
|
@@ -603,8 +603,8 @@ function st(e) {
|
|
|
603
603
|
created_at: p,
|
|
604
604
|
// Local-only flag — UI may render dimmed until the SSE echo lands.
|
|
605
605
|
_pending: !0,
|
|
606
|
-
...u ? { payload: { type: "content", attachments:
|
|
607
|
-
...
|
|
606
|
+
...u ? { payload: { type: "content", attachments: _ } } : {},
|
|
607
|
+
...w && typeof w == "object" ? { metadata: w } : {}
|
|
608
608
|
};
|
|
609
609
|
W(h, S);
|
|
610
610
|
try {
|
|
@@ -612,8 +612,8 @@ function st(e) {
|
|
|
612
612
|
client_msg_id: g,
|
|
613
613
|
text_md: C,
|
|
614
614
|
created_at: p,
|
|
615
|
-
...u ? { attachments:
|
|
616
|
-
...
|
|
615
|
+
...u ? { attachments: _ } : {},
|
|
616
|
+
...w && typeof w == "object" ? { metadata: w } : {}
|
|
617
617
|
});
|
|
618
618
|
} catch (x) {
|
|
619
619
|
console.error("[store] send failed", x), X(h, g, {
|
|
@@ -622,12 +622,12 @@ function st(e) {
|
|
|
622
622
|
});
|
|
623
623
|
}
|
|
624
624
|
}
|
|
625
|
-
async function M(h, m,
|
|
625
|
+
async function M(h, m, _) {
|
|
626
626
|
h != null && (t.awaitingCallback[h] = !0);
|
|
627
627
|
try {
|
|
628
|
-
await e.postCallback(h, m,
|
|
629
|
-
} catch (
|
|
630
|
-
console.error("[store] callback failed",
|
|
628
|
+
await e.postCallback(h, m, _);
|
|
629
|
+
} catch (w) {
|
|
630
|
+
console.error("[store] callback failed", w), h != null && delete t.awaitingCallback[h];
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
633
|
const U = /* @__PURE__ */ new Map();
|
|
@@ -635,48 +635,48 @@ function st(e) {
|
|
|
635
635
|
if (!h) return null;
|
|
636
636
|
const m = U.get(h);
|
|
637
637
|
if (m != null && m.url) {
|
|
638
|
-
const
|
|
639
|
-
if (!
|
|
638
|
+
const _ = m.expires_at ? Date.parse(m.expires_at) : 0;
|
|
639
|
+
if (!_ || _ - Date.now() > 6e4) return m.url;
|
|
640
640
|
}
|
|
641
641
|
try {
|
|
642
|
-
const
|
|
643
|
-
if (
|
|
642
|
+
const _ = await e.signAttachment(h);
|
|
643
|
+
if (_ != null && _.signed_url)
|
|
644
644
|
return U.set(h, {
|
|
645
|
-
url:
|
|
646
|
-
expires_at:
|
|
647
|
-
}),
|
|
648
|
-
} catch (
|
|
649
|
-
console.error("[store] sign attachment failed",
|
|
645
|
+
url: _.signed_url,
|
|
646
|
+
expires_at: _.expires_at
|
|
647
|
+
}), _.signed_url;
|
|
648
|
+
} catch (_) {
|
|
649
|
+
console.error("[store] sign attachment failed", _);
|
|
650
650
|
}
|
|
651
651
|
return null;
|
|
652
652
|
}
|
|
653
|
-
async function L(h, { rating: m, comment:
|
|
654
|
-
const
|
|
655
|
-
...(
|
|
653
|
+
async function L(h, { rating: m, comment: _ } = {}) {
|
|
654
|
+
const w = t.conversations.find((g) => g.id === h), u = {
|
|
655
|
+
...(w == null ? void 0 : w.metadata) || {},
|
|
656
656
|
feedback: {
|
|
657
657
|
rating: m,
|
|
658
|
-
comment:
|
|
658
|
+
comment: _ || null,
|
|
659
659
|
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
660
660
|
}
|
|
661
661
|
};
|
|
662
662
|
await T(h, { metadata: u });
|
|
663
663
|
}
|
|
664
664
|
function K(h) {
|
|
665
|
-
var
|
|
665
|
+
var _, w;
|
|
666
666
|
const m = t.messagesByConv[h] || [];
|
|
667
667
|
for (let C = m.length - 1; C >= 0; C--) {
|
|
668
668
|
const u = m[C];
|
|
669
|
-
if ((u == null ? void 0 : u.type) === "action" && ((
|
|
669
|
+
if ((u == null ? void 0 : u.type) === "action" && ((_ = u == null ? void 0 : u.payload) == null ? void 0 : _.type) === "action" && ((w = u == null ? void 0 : u.payload) == null ? void 0 : w.state) === "pending" && Array.isArray(u == null ? void 0 : u.callbacks) && u.callbacks.length > 0 && !t.awaitingCallback[u.id])
|
|
670
670
|
return u;
|
|
671
671
|
}
|
|
672
672
|
return null;
|
|
673
673
|
}
|
|
674
674
|
function Q(h) {
|
|
675
|
-
var
|
|
675
|
+
var _, w, C;
|
|
676
676
|
const m = t.messagesByConv[h] || [];
|
|
677
677
|
for (let u = m.length - 1; u >= 0; u--) {
|
|
678
678
|
const g = m[u];
|
|
679
|
-
if (((
|
|
679
|
+
if (((_ = g == null ? void 0 : g.author) == null ? void 0 : _.type) === "user" || (g == null ? void 0 : g.type) === "action" && ((w = g == null ? void 0 : g.payload) == null ? void 0 : w.state) === "pending")
|
|
680
680
|
return null;
|
|
681
681
|
const p = (C = g == null ? void 0 : g.metadata) == null ? void 0 : C.form;
|
|
682
682
|
if (p && Array.isArray(p.fields) && p.fields.length > 0)
|
|
@@ -687,18 +687,18 @@ function st(e) {
|
|
|
687
687
|
function se(h) {
|
|
688
688
|
const m = t.runningActionsByConv[h];
|
|
689
689
|
if (!m) return null;
|
|
690
|
-
const
|
|
691
|
-
if (
|
|
692
|
-
const
|
|
693
|
-
return { id:
|
|
690
|
+
const _ = Object.keys(m);
|
|
691
|
+
if (_.length === 0) return null;
|
|
692
|
+
const w = _[0];
|
|
693
|
+
return { id: w, payload: { name: m[w] } };
|
|
694
694
|
}
|
|
695
695
|
function re(h) {
|
|
696
|
-
var
|
|
696
|
+
var _, w, C, u;
|
|
697
697
|
const m = t.messagesByConv[h] || [];
|
|
698
698
|
for (let g = m.length - 1; g >= 0; g--) {
|
|
699
699
|
const p = m[g];
|
|
700
|
-
if (((
|
|
701
|
-
if ((p == null ? void 0 : p.type) === "action" && ((
|
|
700
|
+
if (((_ = p == null ? void 0 : p.author) == null ? void 0 : _.type) === "user") return [];
|
|
701
|
+
if ((p == null ? void 0 : p.type) === "action" && ((w = p == null ? void 0 : p.payload) == null ? void 0 : w.state) === "pending")
|
|
702
702
|
return [];
|
|
703
703
|
if (((C = p == null ? void 0 : p.author) == null ? void 0 : C.type) !== "agent_ia") continue;
|
|
704
704
|
const S = (u = p == null ? void 0 : p.metadata) == null ? void 0 : u.suggested_replies;
|
|
@@ -720,14 +720,14 @@ function st(e) {
|
|
|
720
720
|
}
|
|
721
721
|
function W(h, m) {
|
|
722
722
|
var u;
|
|
723
|
-
const
|
|
724
|
-
let
|
|
725
|
-
m != null && m.client_msg_id && (
|
|
723
|
+
const _ = t.messagesByConv[h] || [];
|
|
724
|
+
let w = -1;
|
|
725
|
+
m != null && m.client_msg_id && (w = _.findIndex(
|
|
726
726
|
(g) => (g == null ? void 0 : g.client_msg_id) && g.client_msg_id === m.client_msg_id
|
|
727
|
-
)),
|
|
727
|
+
)), w === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (w = _.findIndex((g) => ie(g == null ? void 0 : g.id, m.id)));
|
|
728
728
|
let C;
|
|
729
|
-
|
|
730
|
-
...
|
|
729
|
+
w === -1 ? C = [..._, m].sort(me) : (C = _.slice(), C[w] = {
|
|
730
|
+
..._[w],
|
|
731
731
|
...m,
|
|
732
732
|
_pending: !1,
|
|
733
733
|
_failed: !1
|
|
@@ -736,21 +736,21 @@ function st(e) {
|
|
|
736
736
|
function ie(h, m) {
|
|
737
737
|
return h === m ? !0 : h == null || m == null ? !1 : String(h) === String(m);
|
|
738
738
|
}
|
|
739
|
-
function X(h, m,
|
|
740
|
-
const
|
|
741
|
-
if (!
|
|
742
|
-
const C =
|
|
739
|
+
function X(h, m, _) {
|
|
740
|
+
const w = t.messagesByConv[h];
|
|
741
|
+
if (!w) return;
|
|
742
|
+
const C = w.findIndex((g) => g.id === m);
|
|
743
743
|
if (C === -1) return;
|
|
744
|
-
const u =
|
|
745
|
-
u[C] = { ...
|
|
744
|
+
const u = w.slice();
|
|
745
|
+
u[C] = { ...w[C], ..._ }, t.messagesByConv[h] = u;
|
|
746
746
|
}
|
|
747
747
|
function ae(h, m) {
|
|
748
|
-
const
|
|
749
|
-
if (
|
|
750
|
-
const
|
|
751
|
-
if (m && (!
|
|
748
|
+
const _ = t.conversations.findIndex((C) => C.id === h);
|
|
749
|
+
if (_ === -1) return;
|
|
750
|
+
const w = t.conversations[_];
|
|
751
|
+
if (m && (!w.last_message_at || m > w.last_message_at)) {
|
|
752
752
|
const C = t.conversations.slice();
|
|
753
|
-
C[
|
|
753
|
+
C[_] = { ...w, last_message_at: m }, C.sort(
|
|
754
754
|
(u, g) => (g.last_message_at || "").localeCompare(u.last_message_at || "")
|
|
755
755
|
), t.conversations = C;
|
|
756
756
|
}
|
|
@@ -760,18 +760,18 @@ function st(e) {
|
|
|
760
760
|
}
|
|
761
761
|
function ye(h) {
|
|
762
762
|
if (!h || typeof h != "object") return null;
|
|
763
|
-
const m = {},
|
|
764
|
-
for (const [
|
|
765
|
-
C !== void 0 && (
|
|
766
|
-
return Object.keys(
|
|
763
|
+
const m = {}, _ = {};
|
|
764
|
+
for (const [w, C] of Object.entries(h))
|
|
765
|
+
C !== void 0 && (w === "name" || w === "email" || w === "language" ? C != null && String(C).trim() !== "" && (m[w] = C) : (w === "values" || w === "metadata") && C && typeof C == "object" ? Object.assign(_, C) : _[w] = C);
|
|
766
|
+
return Object.keys(_).length && (m.values = _), Object.keys(m).length ? m : null;
|
|
767
767
|
}
|
|
768
768
|
function fe(h) {
|
|
769
769
|
const m = t.messagesByConv[h] || [];
|
|
770
|
-
let
|
|
770
|
+
let _ = "";
|
|
771
771
|
for (const u of m)
|
|
772
|
-
u != null && u.created_at && u.created_at >
|
|
773
|
-
const
|
|
774
|
-
return !
|
|
772
|
+
u != null && u.created_at && u.created_at > _ && (_ = u.created_at);
|
|
773
|
+
const w = (/* @__PURE__ */ new Date()).toISOString();
|
|
774
|
+
return !_ || w > _ ? w : new Date(Date.parse(_) + 1).toISOString();
|
|
775
775
|
}
|
|
776
776
|
return {
|
|
777
777
|
state: t,
|
|
@@ -779,7 +779,7 @@ function st(e) {
|
|
|
779
779
|
destroy: a,
|
|
780
780
|
applyCustomer: n,
|
|
781
781
|
createConversation: r,
|
|
782
|
-
openConversation:
|
|
782
|
+
openConversation: f,
|
|
783
783
|
loadMore: k,
|
|
784
784
|
fetchSinceLast: E,
|
|
785
785
|
patchConversation: T,
|
|
@@ -972,6 +972,7 @@ Je réponds en quelques secondes.`,
|
|
|
972
972
|
"action.title": "Confirmer l'action",
|
|
973
973
|
"action.inProgress": "{name} en cours, veuillez patienter…",
|
|
974
974
|
"action.rejectedByUser": "Action annulée par l'utilisateur.",
|
|
975
|
+
"action.rejectedByAdmin": "Action refusée par un agent.",
|
|
975
976
|
"approval.approve": "Autoriser",
|
|
976
977
|
"approval.reject": "Refuser",
|
|
977
978
|
// ── More menu ────────────────────────────────────────────────────
|
|
@@ -1097,6 +1098,7 @@ I reply within seconds.`,
|
|
|
1097
1098
|
"action.title": "Confirm the action",
|
|
1098
1099
|
"action.inProgress": "{name} in progress, please wait…",
|
|
1099
1100
|
"action.rejectedByUser": "Action cancelled by the user.",
|
|
1101
|
+
"action.rejectedByAdmin": "Action declined by an agent.",
|
|
1100
1102
|
"approval.approve": "Approve",
|
|
1101
1103
|
"approval.reject": "Decline",
|
|
1102
1104
|
// ── More menu ────────────────────────────────────────────────────
|
|
@@ -1150,13 +1152,13 @@ function xe(e) {
|
|
|
1150
1152
|
function ne(e) {
|
|
1151
1153
|
return Le[xe(e)] || Le[ue];
|
|
1152
1154
|
}
|
|
1153
|
-
function
|
|
1155
|
+
function F(e) {
|
|
1154
1156
|
const t = xe(e), s = ke[t] || ke[ue], i = ke[ue];
|
|
1155
1157
|
return function(n, r) {
|
|
1156
1158
|
let l = s[n];
|
|
1157
1159
|
return l == null && (l = i[n]), l == null ? n : (r && (l = l.replace(
|
|
1158
1160
|
/\{(\w+)\}/g,
|
|
1159
|
-
(
|
|
1161
|
+
(f, k) => r[k] != null ? String(r[k]) : f
|
|
1160
1162
|
)), l);
|
|
1161
1163
|
};
|
|
1162
1164
|
}
|
|
@@ -1168,7 +1170,7 @@ function Ie(e, t) {
|
|
|
1168
1170
|
function He(e, t, s) {
|
|
1169
1171
|
return Array.isArray(t) ? t.map((i) => Ie(e, String(i))).join(", ") : typeof t == "boolean" ? s(t ? "common.yes" : "common.no") : Ie(e, String(t));
|
|
1170
1172
|
}
|
|
1171
|
-
function ht(e, t, s =
|
|
1173
|
+
function ht(e, t, s = F()) {
|
|
1172
1174
|
if (!e || !t) return "";
|
|
1173
1175
|
const i = Array.isArray(e.fields) ? e.fields : [], a = [];
|
|
1174
1176
|
for (const n of i) {
|
|
@@ -1183,7 +1185,7 @@ ${l}`);
|
|
|
1183
1185
|
|
|
1184
1186
|
`);
|
|
1185
1187
|
}
|
|
1186
|
-
function mt(e, t, s =
|
|
1188
|
+
function mt(e, t, s = F()) {
|
|
1187
1189
|
const i = [], a = Array.isArray(e == null ? void 0 : e.fields) ? e.fields : [];
|
|
1188
1190
|
for (const n of a) {
|
|
1189
1191
|
if (!(n != null && n.key) || !(n != null && n.label)) continue;
|
|
@@ -1191,9 +1193,9 @@ function mt(e, t, s = j()) {
|
|
|
1191
1193
|
if (r == null || r === "") continue;
|
|
1192
1194
|
const l = He(n, r, s);
|
|
1193
1195
|
if (!l) continue;
|
|
1194
|
-
const
|
|
1196
|
+
const f = n.type === "textarea" || typeof l == "string" && (l.length > 60 || l.includes(`
|
|
1195
1197
|
`));
|
|
1196
|
-
i.push({ label: n.label, value: l, multiline:
|
|
1198
|
+
i.push({ label: n.label, value: l, multiline: f });
|
|
1197
1199
|
}
|
|
1198
1200
|
return {
|
|
1199
1201
|
kind: "form_response",
|
|
@@ -1249,34 +1251,34 @@ function ft(e) {
|
|
|
1249
1251
|
if (!T) break;
|
|
1250
1252
|
k.push(T[1]), i++;
|
|
1251
1253
|
}
|
|
1252
|
-
const
|
|
1254
|
+
const y = k.map((T) => `<li>${de(T)}</li>`).join("");
|
|
1253
1255
|
s.push({
|
|
1254
1256
|
type: "block",
|
|
1255
|
-
html: `<ul class="wm-md-ul">${
|
|
1257
|
+
html: `<ul class="wm-md-ul">${y}</ul>`
|
|
1256
1258
|
});
|
|
1257
1259
|
continue;
|
|
1258
1260
|
}
|
|
1259
1261
|
const l = /^\s*(\d+)\.\s+(.*)$/.exec(n);
|
|
1260
1262
|
if (l) {
|
|
1261
|
-
const k = parseInt(l[1], 10),
|
|
1263
|
+
const k = parseInt(l[1], 10), y = [l[2]];
|
|
1262
1264
|
for (i++; i < t.length; ) {
|
|
1263
1265
|
const A = /^\s*\d+\.\s+(.*)$/.exec(t[i]);
|
|
1264
1266
|
if (!A) break;
|
|
1265
|
-
|
|
1267
|
+
y.push(A[1]), i++;
|
|
1266
1268
|
}
|
|
1267
|
-
const T =
|
|
1269
|
+
const T = y.map((A) => `<li>${de(A)}</li>`).join(""), E = k !== 1 ? ` start="${k}"` : "";
|
|
1268
1270
|
s.push({
|
|
1269
1271
|
type: "block",
|
|
1270
1272
|
html: `<ol class="wm-md-ol"${E}>${T}</ol>`
|
|
1271
1273
|
});
|
|
1272
1274
|
continue;
|
|
1273
1275
|
}
|
|
1274
|
-
const
|
|
1275
|
-
if (
|
|
1276
|
-
const k =
|
|
1276
|
+
const f = /^(#{1,6})\s+(.*)$/.exec(n);
|
|
1277
|
+
if (f) {
|
|
1278
|
+
const k = f[1].length;
|
|
1277
1279
|
s.push({
|
|
1278
1280
|
type: "block",
|
|
1279
|
-
html: `<h${k} class="wm-md-h wm-md-h${k}">${de(
|
|
1281
|
+
html: `<h${k} class="wm-md-h wm-md-h${k}">${de(f[2])}</h${k}>`
|
|
1280
1282
|
}), i++;
|
|
1281
1283
|
continue;
|
|
1282
1284
|
}
|
|
@@ -1316,8 +1318,8 @@ function _t(e, t) {
|
|
|
1316
1318
|
const l = typeof r.text_md == "string" ? r.text_md.trim() : "";
|
|
1317
1319
|
if (l)
|
|
1318
1320
|
return (((s = r.author) == null ? void 0 : s.type) === "user" ? "Vous : " : "") + l.replace(/\s+/g, " ");
|
|
1319
|
-
const
|
|
1320
|
-
if (Array.isArray(
|
|
1321
|
+
const f = (i = r.payload) == null ? void 0 : i.attachments;
|
|
1322
|
+
if (Array.isArray(f) && f.length) return "📎 Pièce jointe";
|
|
1321
1323
|
}
|
|
1322
1324
|
return (e == null ? void 0 : e.last_message_preview) || (e == null ? void 0 : e.preview) || ((a = e == null ? void 0 : e.metadata) == null ? void 0 : a.last_preview) || "";
|
|
1323
1325
|
}
|
|
@@ -1336,13 +1338,13 @@ function pt(e, t, s, i) {
|
|
|
1336
1338
|
if (!n) continue;
|
|
1337
1339
|
const r = (n.text_md || "").trim();
|
|
1338
1340
|
if (!r) continue;
|
|
1339
|
-
const l = gt(n.author, s),
|
|
1340
|
-
a.push(`[${
|
|
1341
|
+
const l = gt(n.author, s), f = n.created_at ? new Date(n.created_at).toLocaleString(i) : "";
|
|
1342
|
+
a.push(`[${f}] ${l} :`), a.push(r), a.push("");
|
|
1341
1343
|
}
|
|
1342
1344
|
return a.join(`
|
|
1343
1345
|
`);
|
|
1344
1346
|
}
|
|
1345
|
-
function vt(e, t, s =
|
|
1347
|
+
function vt(e, t, s = F(), i) {
|
|
1346
1348
|
if (!e) return;
|
|
1347
1349
|
const a = pt(e, t || [], s, ne(i)), n = new Blob([a], { type: "text/plain;charset=utf-8" });
|
|
1348
1350
|
try {
|
|
@@ -1488,25 +1490,25 @@ const yt = {
|
|
|
1488
1490
|
if (typeof Notification > "u" || Notification.permission !== "granted") return;
|
|
1489
1491
|
const s = t == null ? void 0 : t.author, i = !s || s.type === "agent_ia", n = ((s == null ? void 0 : s.name) || (i ? this.agentName : "") || this.t("launcher.theAgent")) + this.t("launcher.repliedToYou"), r = typeof (t == null ? void 0 : t.text_md) == "string" ? t.text_md.trim() : "", l = r ? r.slice(0, 140) : this.t("notification.youHaveNewMessage");
|
|
1490
1492
|
try {
|
|
1491
|
-
const
|
|
1493
|
+
const f = new Notification(n, {
|
|
1492
1494
|
body: l,
|
|
1493
1495
|
tag: `wm-${e}`,
|
|
1494
1496
|
renotify: !1,
|
|
1495
1497
|
silent: !0
|
|
1496
1498
|
});
|
|
1497
|
-
|
|
1499
|
+
f.onclick = () => {
|
|
1498
1500
|
try {
|
|
1499
1501
|
window.focus();
|
|
1500
1502
|
} catch {
|
|
1501
1503
|
}
|
|
1502
1504
|
this.draftConv = null, this.showOnboarding = !1, this.activeConvId = e, this.isOpen = !0, this.store && this.store.setPanelOpen(!0);
|
|
1503
1505
|
try {
|
|
1504
|
-
|
|
1506
|
+
f.close();
|
|
1505
1507
|
} catch {
|
|
1506
1508
|
}
|
|
1507
1509
|
};
|
|
1508
|
-
} catch (
|
|
1509
|
-
console.warn("[ww-messenger] notification failed",
|
|
1510
|
+
} catch (f) {
|
|
1511
|
+
console.warn("[ww-messenger] notification failed", f);
|
|
1510
1512
|
}
|
|
1511
1513
|
}
|
|
1512
1514
|
}
|
|
@@ -1645,8 +1647,8 @@ const yt = {
|
|
|
1645
1647
|
if (!(r != null && r.id)) continue;
|
|
1646
1648
|
const l = r.last_message_at || "";
|
|
1647
1649
|
if (!l) continue;
|
|
1648
|
-
const
|
|
1649
|
-
l >
|
|
1650
|
+
const f = s.get(r.id) || "";
|
|
1651
|
+
l > f && i.push(r.id);
|
|
1650
1652
|
}
|
|
1651
1653
|
this._liveRevealConvSnapshot = new Map(
|
|
1652
1654
|
t.map((r) => [r.id, (r == null ? void 0 : r.last_message_at) || ""])
|
|
@@ -1655,7 +1657,7 @@ const yt = {
|
|
|
1655
1657
|
try {
|
|
1656
1658
|
const l = await ((n = (a = this.store).fetchSinceLast) == null ? void 0 : n.call(a, r));
|
|
1657
1659
|
if (!Array.isArray(l)) continue;
|
|
1658
|
-
for (const
|
|
1660
|
+
for (const f of l) this.paceLiveMessage(f, r);
|
|
1659
1661
|
} catch (l) {
|
|
1660
1662
|
console.error(
|
|
1661
1663
|
"[ww-messenger] activity delta fetch failed",
|
|
@@ -1677,10 +1679,10 @@ const yt = {
|
|
|
1677
1679
|
this.nextRevealAt + s.pauseBetweenMs
|
|
1678
1680
|
) + n;
|
|
1679
1681
|
this.nextRevealAt = l;
|
|
1680
|
-
const
|
|
1681
|
-
this.revealedAt = { ...this.revealedAt, [k]: Date.now() }, this.revealTimers = this.revealTimers.filter((T) => T !==
|
|
1682
|
-
},
|
|
1683
|
-
this.revealTimers.push(
|
|
1682
|
+
const f = Math.max(0, l - i), k = e.id, y = setTimeout(() => {
|
|
1683
|
+
this.revealedAt = { ...this.revealedAt, [k]: Date.now() }, this.revealTimers = this.revealTimers.filter((T) => T !== y), typeof this.onMessageRevealed == "function" && this.onMessageRevealed(e, t);
|
|
1684
|
+
}, f);
|
|
1685
|
+
this.revealTimers.push(y);
|
|
1684
1686
|
},
|
|
1685
1687
|
// Walk the message list and queue / instantly-reveal every new
|
|
1686
1688
|
// entry according to its origin. Used by the `currentConvMessages`
|
|
@@ -1702,8 +1704,8 @@ const yt = {
|
|
|
1702
1704
|
i[n.id] = s;
|
|
1703
1705
|
continue;
|
|
1704
1706
|
}
|
|
1705
|
-
const l = typeof (n == null ? void 0 : n.text_md) == "string" && n.text_md.trim().length > 0,
|
|
1706
|
-
if (!l && !
|
|
1707
|
+
const l = typeof (n == null ? void 0 : n.text_md) == "string" && n.text_md.trim().length > 0, f = Array.isArray((a = n == null ? void 0 : n.payload) == null ? void 0 : a.attachments) && n.payload.attachments.length > 0;
|
|
1708
|
+
if (!l && !f) {
|
|
1707
1709
|
i[n.id] = s;
|
|
1708
1710
|
continue;
|
|
1709
1711
|
}
|
|
@@ -1880,7 +1882,7 @@ const ve = /* @__PURE__ */ P(St, [["render", Tt], ["__scopeId", "data-v-14e10c0d
|
|
|
1880
1882
|
inject: {
|
|
1881
1883
|
// Translator shared by the Messenger shell; French fallback when
|
|
1882
1884
|
// the component is used standalone.
|
|
1883
|
-
t: { default: () =>
|
|
1885
|
+
t: { default: () => F() }
|
|
1884
1886
|
},
|
|
1885
1887
|
props: {
|
|
1886
1888
|
// Nombre de conversations non lues — pilote la pastille.
|
|
@@ -1900,7 +1902,7 @@ const ve = /* @__PURE__ */ P(St, [["render", Tt], ["__scopeId", "data-v-14e10c0d
|
|
|
1900
1902
|
return this.peeks.slice(0, xt).reverse();
|
|
1901
1903
|
}
|
|
1902
1904
|
}
|
|
1903
|
-
}, Rt = ["aria-label", "onClick", "onKeydown"], Lt = ["aria-label", "onClick"], It = { class: "wm-peek__avatar" }, Et = ["aria-label"], Bt = { class: "wm-peek__body" }, Pt = { class: "wm-peek__head" }, Dt = { class: "wm-peek__name" }, Ut = { class: "wm-peek__action" }, Nt = { class: "wm-peek__text" },
|
|
1905
|
+
}, Rt = ["aria-label", "onClick", "onKeydown"], Lt = ["aria-label", "onClick"], It = { class: "wm-peek__avatar" }, Et = ["aria-label"], Bt = { class: "wm-peek__body" }, Pt = { class: "wm-peek__head" }, Dt = { class: "wm-peek__name" }, Ut = { class: "wm-peek__action" }, Nt = { class: "wm-peek__text" }, jt = ["onClick"], Ft = ["aria-label"], Ht = ["aria-label"];
|
|
1904
1906
|
function zt(e, t, s, i, a, n) {
|
|
1905
1907
|
const r = B("HumanAvatar");
|
|
1906
1908
|
return c(), d("div", {
|
|
@@ -1911,17 +1913,17 @@ function zt(e, t, s, i, a, n) {
|
|
|
1911
1913
|
onFocusout: t[4] || (t[4] = (l) => e.$emit("hover", !1))
|
|
1912
1914
|
}, [
|
|
1913
1915
|
$(Ne, { name: "wm-peek" }, {
|
|
1914
|
-
default:
|
|
1916
|
+
default: je(() => [
|
|
1915
1917
|
n.visiblePeeks.length ? (c(), d("div", {
|
|
1916
1918
|
key: 0,
|
|
1917
1919
|
class: R(["wm-peekStack", { "wm-peekStack--multi": n.visiblePeeks.length > 1 }])
|
|
1918
1920
|
}, [
|
|
1919
|
-
(c(!0), d(I, null,
|
|
1921
|
+
(c(!0), d(I, null, j(n.visiblePeeks, (l, f) => (c(), d("div", {
|
|
1920
1922
|
key: l.convId,
|
|
1921
1923
|
class: "wm-peek",
|
|
1922
1924
|
style: z({
|
|
1923
|
-
"--depth": n.visiblePeeks.length - 1 -
|
|
1924
|
-
zIndex:
|
|
1925
|
+
"--depth": n.visiblePeeks.length - 1 - f,
|
|
1926
|
+
zIndex: f + 1
|
|
1925
1927
|
}),
|
|
1926
1928
|
role: "button",
|
|
1927
1929
|
tabindex: "0",
|
|
@@ -1977,7 +1979,7 @@ function zt(e, t, s, i, a, n) {
|
|
|
1977
1979
|
type: "button",
|
|
1978
1980
|
class: "wm-peek__open",
|
|
1979
1981
|
onClick: J((k) => e.$emit("open", l.convId), ["stop"])
|
|
1980
|
-
}, v(n.t("common.open")), 9,
|
|
1982
|
+
}, v(n.t("common.open")), 9, jt)
|
|
1981
1983
|
], 44, Rt))), 128))
|
|
1982
1984
|
], 2)) : b("", !0)
|
|
1983
1985
|
]),
|
|
@@ -2011,7 +2013,7 @@ function zt(e, t, s, i, a, n) {
|
|
|
2011
2013
|
count: s.unreadCount
|
|
2012
2014
|
})
|
|
2013
2015
|
}, v(s.unreadCount > 9 ? "9+" : s.unreadCount), 9, Ht)) : b("", !0)
|
|
2014
|
-
], 8,
|
|
2016
|
+
], 8, Ft)
|
|
2015
2017
|
], 32);
|
|
2016
2018
|
}
|
|
2017
2019
|
const qt = /* @__PURE__ */ P(Ot, [["render", zt], ["__scopeId", "data-v-d81459bc"]]), Vt = {
|
|
@@ -2140,7 +2142,7 @@ function en(e, t, s, i, a, n) {
|
|
|
2140
2142
|
class: "wm-team__stack",
|
|
2141
2143
|
style: z({ width: n.stackWidth + "px" })
|
|
2142
2144
|
}, [
|
|
2143
|
-
(c(!0), d(I, null,
|
|
2145
|
+
(c(!0), d(I, null, j(s.members.slice(0, 3), (r, l) => (c(), d("div", {
|
|
2144
2146
|
key: l,
|
|
2145
2147
|
class: "wm-team__pill",
|
|
2146
2148
|
style: z({
|
|
@@ -2165,7 +2167,7 @@ const tn = /* @__PURE__ */ P(Yt, [["render", en], ["__scopeId", "data-v-e49a9063
|
|
|
2165
2167
|
inject: {
|
|
2166
2168
|
// Translator shared by the Messenger shell. Falls back to a French
|
|
2167
2169
|
// translator when the component is used standalone (no provider).
|
|
2168
|
-
t: { default: () =>
|
|
2170
|
+
t: { default: () => F() }
|
|
2169
2171
|
},
|
|
2170
2172
|
props: {
|
|
2171
2173
|
title: { type: String, default: "Nouvelle conversation" },
|
|
@@ -2213,7 +2215,7 @@ function fn(e, t, s, i, a, n) {
|
|
|
2213
2215
|
type: "button",
|
|
2214
2216
|
class: "wm-header__icon",
|
|
2215
2217
|
"aria-label": n.t("header.backToHome"),
|
|
2216
|
-
onClick: t[0] || (t[0] = (
|
|
2218
|
+
onClick: t[0] || (t[0] = (f) => e.$emit("back"))
|
|
2217
2219
|
}, [...t[3] || (t[3] = [
|
|
2218
2220
|
o("svg", {
|
|
2219
2221
|
width: "13",
|
|
@@ -2253,7 +2255,7 @@ function fn(e, t, s, i, a, n) {
|
|
|
2253
2255
|
class: R(["wm-header__icon", { "wm-header__icon--active": s.moreActive }]),
|
|
2254
2256
|
"aria-label": n.t("header.moreOptions"),
|
|
2255
2257
|
title: n.t("header.moreOptions"),
|
|
2256
|
-
onClick: t[1] || (t[1] = (
|
|
2258
|
+
onClick: t[1] || (t[1] = (f) => e.$emit("more"))
|
|
2257
2259
|
}, [...t[4] || (t[4] = [
|
|
2258
2260
|
o("svg", {
|
|
2259
2261
|
width: "13",
|
|
@@ -2285,7 +2287,7 @@ function fn(e, t, s, i, a, n) {
|
|
|
2285
2287
|
class: "wm-header__icon",
|
|
2286
2288
|
"aria-label": n.t("header.closeWidget"),
|
|
2287
2289
|
title: n.t("header.closeWidget"),
|
|
2288
|
-
onClick: t[2] || (t[2] = (
|
|
2290
|
+
onClick: t[2] || (t[2] = (f) => e.$emit("close"))
|
|
2289
2291
|
}, [...t[5] || (t[5] = [
|
|
2290
2292
|
o("svg", {
|
|
2291
2293
|
width: "13",
|
|
@@ -2318,7 +2320,7 @@ const _n = /* @__PURE__ */ P(nn, [["render", fn], ["__scopeId", "data-v-7af4c118
|
|
|
2318
2320
|
// shell. The language getter feeds `formatTs` (relative date
|
|
2319
2321
|
// labels on unread alerts) ; falls back to French when the
|
|
2320
2322
|
// component is used standalone.
|
|
2321
|
-
t: { default: () =>
|
|
2323
|
+
t: { default: () => F() },
|
|
2322
2324
|
wmLocale: { default: () => () => "fr" }
|
|
2323
2325
|
},
|
|
2324
2326
|
props: {
|
|
@@ -2438,7 +2440,7 @@ const _n = /* @__PURE__ */ P(nn, [["render", fn], ["__scopeId", "data-v-7af4c118
|
|
|
2438
2440
|
}, Rn = ["innerHTML"], Ln = { class: "wm-onb__alert-meta" }, In = {
|
|
2439
2441
|
key: 0,
|
|
2440
2442
|
class: "wm-onb__alert-time"
|
|
2441
|
-
}, En = { class: "wm-onb__alert-resume" }, Bn = { class: "wm-onb__actions" }, Pn = ["disabled"], Dn = { class: "wm-onb__btn-label" }, Un = ["onClick"], Nn = { class: "wm-onb__btn-icon" },
|
|
2443
|
+
}, En = { class: "wm-onb__alert-resume" }, Bn = { class: "wm-onb__actions" }, Pn = ["disabled"], Dn = { class: "wm-onb__btn-label" }, Un = ["onClick"], Nn = { class: "wm-onb__btn-icon" }, jn = ["aria-label"], Fn = {
|
|
2442
2444
|
key: 1,
|
|
2443
2445
|
width: "18",
|
|
2444
2446
|
height: "18",
|
|
@@ -2520,11 +2522,11 @@ function Yn(e, t, s, i, a, n) {
|
|
|
2520
2522
|
])
|
|
2521
2523
|
]),
|
|
2522
2524
|
n.unreadThreads.length ? (c(), d("div", kn, [
|
|
2523
|
-
(c(!0), d(I, null,
|
|
2525
|
+
(c(!0), d(I, null, j(n.unreadThreads, (l) => (c(), d("button", {
|
|
2524
2526
|
key: l.id,
|
|
2525
2527
|
type: "button",
|
|
2526
2528
|
class: "wm-onb__alert",
|
|
2527
|
-
onClick: (
|
|
2529
|
+
onClick: (f) => e.$emit("resume", l)
|
|
2528
2530
|
}, [
|
|
2529
2531
|
o("span", {
|
|
2530
2532
|
class: R(["wm-onb__alert-avatar", n.avatarWrapperClass(l)])
|
|
@@ -2543,7 +2545,7 @@ function Yn(e, t, s, i, a, n) {
|
|
|
2543
2545
|
}, [
|
|
2544
2546
|
o("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
|
|
2545
2547
|
], -1)
|
|
2546
|
-
])])) : (c(), D(Ae(n.avatarComponent(l)),
|
|
2548
|
+
])])) : (c(), D(Ae(n.avatarComponent(l)), Fe({
|
|
2547
2549
|
key: 1,
|
|
2548
2550
|
ref_for: !0
|
|
2549
2551
|
}, n.avatarProps(l)), null, 16)),
|
|
@@ -2591,8 +2593,8 @@ function Yn(e, t, s, i, a, n) {
|
|
|
2591
2593
|
], -1)),
|
|
2592
2594
|
o("span", Dn, v(s.busy ? "…" : n.t("onboarding.start")), 1)
|
|
2593
2595
|
], 8, Pn),
|
|
2594
|
-
(c(!0), d(I, null,
|
|
2595
|
-
key: "ql-" +
|
|
2596
|
+
(c(!0), d(I, null, j(s.quickLinks, (l, f) => (c(), d("button", {
|
|
2597
|
+
key: "ql-" + f,
|
|
2596
2598
|
type: "button",
|
|
2597
2599
|
class: "wm-onb__btn",
|
|
2598
2600
|
onClick: (k) => e.$emit("select", l)
|
|
@@ -2604,7 +2606,7 @@ function Yn(e, t, s, i, a, n) {
|
|
|
2604
2606
|
style: z(n.iconUrlStyle(l)),
|
|
2605
2607
|
role: "img",
|
|
2606
2608
|
"aria-label": l.label || ""
|
|
2607
|
-
}, null, 12,
|
|
2609
|
+
}, null, 12, jn)) : (c(), d("svg", Fn, [
|
|
2608
2610
|
o("path", {
|
|
2609
2611
|
d: n.iconPath(l.icon)
|
|
2610
2612
|
}, null, 8, Hn)
|
|
@@ -2652,7 +2654,7 @@ const Jn = /* @__PURE__ */ P(gn, [["render", Yn], ["__scopeId", "data-v-136c3afe
|
|
|
2652
2654
|
name: "WmHistory",
|
|
2653
2655
|
components: { AIAvatar: oe, HumanAvatar: ve },
|
|
2654
2656
|
inject: {
|
|
2655
|
-
t: { default: () =>
|
|
2657
|
+
t: { default: () => F() },
|
|
2656
2658
|
wmLocale: { default: () => () => "fr" }
|
|
2657
2659
|
},
|
|
2658
2660
|
props: {
|
|
@@ -2755,7 +2757,7 @@ function us(e, t, s, i, a, n) {
|
|
|
2755
2757
|
])
|
|
2756
2758
|
]),
|
|
2757
2759
|
o("div", ts, [
|
|
2758
|
-
(c(!0), d(I, null,
|
|
2760
|
+
(c(!0), d(I, null, j(n.filteredThreads, (r) => (c(), d("button", {
|
|
2759
2761
|
key: r.id,
|
|
2760
2762
|
type: "button",
|
|
2761
2763
|
class: R(["wm-hist__thread", { "wm-hist__thread--unread": r.unread }]),
|
|
@@ -2778,7 +2780,7 @@ function us(e, t, s, i, a, n) {
|
|
|
2778
2780
|
}, [
|
|
2779
2781
|
o("path", { d: "M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z" })
|
|
2780
2782
|
], -1)
|
|
2781
|
-
])])) : (c(), D(Ae(n.avatarComponent(r)),
|
|
2783
|
+
])])) : (c(), D(Ae(n.avatarComponent(r)), Fe({
|
|
2782
2784
|
key: 1,
|
|
2783
2785
|
ref_for: !0
|
|
2784
2786
|
}, n.avatarProps(r)), null, 16)),
|
|
@@ -2927,7 +2929,7 @@ const As = /* @__PURE__ */ P(fs, [["render", Cs], ["__scopeId", "data-v-7284acd0
|
|
|
2927
2929
|
inject: {
|
|
2928
2930
|
// Translator shared by the Messenger shell; French fallback when
|
|
2929
2931
|
// the component is used standalone.
|
|
2930
|
-
t: { default: () =>
|
|
2932
|
+
t: { default: () => F() }
|
|
2931
2933
|
},
|
|
2932
2934
|
props: {
|
|
2933
2935
|
data: { type: Object, required: !0 }
|
|
@@ -2961,7 +2963,7 @@ function Is(e, t, s, i, a, n) {
|
|
|
2961
2963
|
])
|
|
2962
2964
|
]),
|
|
2963
2965
|
o("div", Rs, [
|
|
2964
|
-
(c(!0), d(I, null,
|
|
2966
|
+
(c(!0), d(I, null, j(n.fields, (r, l) => (c(), d("div", {
|
|
2965
2967
|
key: l,
|
|
2966
2968
|
class: "wm-art__field"
|
|
2967
2969
|
}, [
|
|
@@ -2994,7 +2996,7 @@ const Es = /* @__PURE__ */ P(Ss, [["render", Is], ["__scopeId", "data-v-713aecf1
|
|
|
2994
2996
|
}, Ps = { class: "wm-art wm-art--infoCard" }, Ds = {
|
|
2995
2997
|
key: 0,
|
|
2996
2998
|
class: "wm-art__image"
|
|
2997
|
-
}, Us = ["src", "alt"], Ns = { class: "wm-art__head" },
|
|
2999
|
+
}, Us = ["src", "alt"], Ns = { class: "wm-art__head" }, js = { class: "wm-art__headMain" }, Fs = { class: "wm-art__title" }, Hs = {
|
|
2998
3000
|
key: 0,
|
|
2999
3001
|
class: "wm-art__subtitle"
|
|
3000
3002
|
}, zs = {
|
|
@@ -3014,8 +3016,8 @@ function $s(e, t, s, i, a, n) {
|
|
|
3014
3016
|
}, null, 8, Us)
|
|
3015
3017
|
])) : b("", !0),
|
|
3016
3018
|
o("div", Ns, [
|
|
3017
|
-
o("div",
|
|
3018
|
-
o("div",
|
|
3019
|
+
o("div", js, [
|
|
3020
|
+
o("div", Fs, v(s.data.title), 1),
|
|
3019
3021
|
s.data.subtitle ? (c(), d("div", Hs, v(s.data.subtitle), 1)) : b("", !0)
|
|
3020
3022
|
]),
|
|
3021
3023
|
s.data.badge && s.data.badge.label ? (c(), d("span", {
|
|
@@ -3028,7 +3030,7 @@ function $s(e, t, s, i, a, n) {
|
|
|
3028
3030
|
]),
|
|
3029
3031
|
n.hasBody ? (c(), d("div", zs, [
|
|
3030
3032
|
s.data.body ? (c(), d("div", qs, v(s.data.body), 1)) : b("", !0),
|
|
3031
|
-
n.fields.length ? (c(!0), d(I, { key: 1 },
|
|
3033
|
+
n.fields.length ? (c(!0), d(I, { key: 1 }, j(n.fields, (r, l) => (c(), d("div", {
|
|
3032
3034
|
key: l,
|
|
3033
3035
|
class: "wm-art__field"
|
|
3034
3036
|
}, [
|
|
@@ -3063,7 +3065,7 @@ const Gs = {
|
|
|
3063
3065
|
inject: {
|
|
3064
3066
|
// Translator + resolved-language getter shared by the Messenger
|
|
3065
3067
|
// shell. Fall back to French wording when used standalone.
|
|
3066
|
-
t: { default: () =>
|
|
3068
|
+
t: { default: () => F() },
|
|
3067
3069
|
wmLocale: { default: () => () => "fr" }
|
|
3068
3070
|
},
|
|
3069
3071
|
props: {
|
|
@@ -3165,7 +3167,7 @@ function ar(e, t, s, i, a, n) {
|
|
|
3165
3167
|
s.data.body ? (c(), d("div", er, v(s.data.body), 1)) : b("", !0)
|
|
3166
3168
|
]),
|
|
3167
3169
|
n.fields.length ? (c(), d("div", tr, [
|
|
3168
|
-
(c(!0), d(I, null,
|
|
3170
|
+
(c(!0), d(I, null, j(n.fields, (r, l) => (c(), d("div", {
|
|
3169
3171
|
key: l,
|
|
3170
3172
|
class: "wm-art__field"
|
|
3171
3173
|
}, [
|
|
@@ -3276,7 +3278,7 @@ const ur = /* @__PURE__ */ P(cr, [["render", dr]]), hr = {
|
|
|
3276
3278
|
signAttachmentFn: { default: null },
|
|
3277
3279
|
// Translator shared by the Messenger shell; French fallback when
|
|
3278
3280
|
// the component is used standalone.
|
|
3279
|
-
t: { default: () =>
|
|
3281
|
+
t: { default: () => F() }
|
|
3280
3282
|
},
|
|
3281
3283
|
props: {
|
|
3282
3284
|
attachment: { type: Object, required: !0 }
|
|
@@ -3461,7 +3463,7 @@ const Ir = {
|
|
|
3461
3463
|
inject: {
|
|
3462
3464
|
// Translator + resolved-language getter shared by the Messenger
|
|
3463
3465
|
// shell. Fall back to French wording when used standalone.
|
|
3464
|
-
t: { default: () =>
|
|
3466
|
+
t: { default: () => F() },
|
|
3465
3467
|
wmLocale: { default: () => () => "fr" }
|
|
3466
3468
|
},
|
|
3467
3469
|
props: {
|
|
@@ -3531,8 +3533,8 @@ const Ir = {
|
|
|
3531
3533
|
const l = this.roleOf(r);
|
|
3532
3534
|
if (l === "system") {
|
|
3533
3535
|
if (((s = r == null ? void 0 : r.payload) == null ? void 0 : s.event) === "action_admin_pending") {
|
|
3534
|
-
const
|
|
3535
|
-
|
|
3536
|
+
const y = e[e.length - 1];
|
|
3537
|
+
y && y.role === "ai" ? y.messages.push(r) : e.push({
|
|
3536
3538
|
key: `g-${ee(r)}`,
|
|
3537
3539
|
role: "ai",
|
|
3538
3540
|
agentName: "",
|
|
@@ -3551,8 +3553,8 @@ const Ir = {
|
|
|
3551
3553
|
});
|
|
3552
3554
|
continue;
|
|
3553
3555
|
}
|
|
3554
|
-
const
|
|
3555
|
-
|
|
3556
|
+
const f = e[e.length - 1];
|
|
3557
|
+
f && f.role === l && (l === "ai" || f.agentName === (((i = r == null ? void 0 : r.author) == null ? void 0 : i.name) || "")) ? f.messages.push(r) : e.push({
|
|
3556
3558
|
key: `g-${ee(r)}`,
|
|
3557
3559
|
role: l,
|
|
3558
3560
|
agentName: ((a = r == null ? void 0 : r.author) == null ? void 0 : a.name) || "",
|
|
@@ -3564,8 +3566,8 @@ const Ir = {
|
|
|
3564
3566
|
for (const r of e) {
|
|
3565
3567
|
if (r.role === "system") continue;
|
|
3566
3568
|
const l = [];
|
|
3567
|
-
for (const
|
|
3568
|
-
for (const k of this.itemsOf(
|
|
3569
|
+
for (const f of r.messages)
|
|
3570
|
+
for (const k of this.itemsOf(f)) l.push(k);
|
|
3569
3571
|
r.items = l;
|
|
3570
3572
|
}
|
|
3571
3573
|
const t = [];
|
|
@@ -3851,9 +3853,9 @@ const Ir = {
|
|
|
3851
3853
|
// doit garder son arrondi.
|
|
3852
3854
|
cornersFor(e, t) {
|
|
3853
3855
|
var Q, se, re;
|
|
3854
|
-
const s = e.items, i = (Q = s[t]) == null ? void 0 : Q.kind, a = (se = s[t - 1]) == null ? void 0 : se.kind, n = (re = s[t + 1]) == null ? void 0 : re.kind, r = e.role === "user", l = 14,
|
|
3856
|
+
const s = e.items, i = (Q = s[t]) == null ? void 0 : Q.kind, a = (se = s[t - 1]) == null ? void 0 : se.kind, n = (re = s[t + 1]) == null ? void 0 : re.kind, r = e.role === "user", l = 14, f = 4, k = a == null ? void 0 : a.bottom, y = n == null ? void 0 : n.top, T = this.widthByKey[this.rowKeyOf(e, t)], E = this.widthByKey[this.rowKeyOf(e, t - 1)], A = this.widthByKey[this.rowKeyOf(e, t + 1)], q = 0.5, M = (W, ie, X) => W != null && T != null ? W + q >= T : ie === X || ie === "card" && X === "bubble";
|
|
3855
3857
|
let U = l, N = l, L = l, K = l;
|
|
3856
|
-
return r ? (k && (N =
|
|
3858
|
+
return r ? (k && (N = f), (y || !n) && (L = f), k && M(E, k, i == null ? void 0 : i.top) && (U = f), y && M(A, y, i == null ? void 0 : i.bottom) && (K = f)) : (k && (U = f), (y || !n) && (K = f), k && M(E, k, i == null ? void 0 : i.top) && (N = f), y && M(A, y, i == null ? void 0 : i.bottom) && (L = f)), { tl: U, tr: N, br: L, bl: K };
|
|
3857
3859
|
},
|
|
3858
3860
|
// Inline column-count for the mosaic grid, capped at 4. Single
|
|
3859
3861
|
// attachment falls back to the vertical-list layout (null). Two
|
|
@@ -3876,8 +3878,8 @@ const Ir = {
|
|
|
3876
3878
|
// corners of every top-row cell flatten too.
|
|
3877
3879
|
mosaicCornerStyle(e, t, s) {
|
|
3878
3880
|
if (!t || t < 2) return null;
|
|
3879
|
-
const i = Math.min(t, 4), a = Math.floor(e / i), n = e % i, r = n > 0, l = n < i - 1 && e + 1 < t,
|
|
3880
|
-
return (r ||
|
|
3881
|
+
const i = Math.min(t, 4), a = Math.floor(e / i), n = e % i, r = n > 0, l = n < i - 1 && e + 1 < t, f = a > 0, k = e + i < t, y = "4px", T = {};
|
|
3882
|
+
return (r || f) && (T["--wm-r-tl"] = y), (l || f) && (T["--wm-r-tr"] = y), (r || k) && (T["--wm-r-bl"] = y), (l || k) && (T["--wm-r-br"] = y), s && (T["--wm-r-tl"] = y, T["--wm-r-tr"] = y), Object.keys(T).length ? T : null;
|
|
3881
3883
|
},
|
|
3882
3884
|
// Inline style emitting the four corner CSS variables. Set on
|
|
3883
3885
|
// `.wm-list__row` so they cascade to Bubble/ActionResult/
|
|
@@ -3924,8 +3926,8 @@ const Ir = {
|
|
|
3924
3926
|
".wm-bubble, .wm-result, .wm-art, .wm-list__body"
|
|
3925
3927
|
);
|
|
3926
3928
|
if (!l) continue;
|
|
3927
|
-
const
|
|
3928
|
-
|
|
3929
|
+
const f = l.getBoundingClientRect().width;
|
|
3930
|
+
f > 0 && (t[r] = f);
|
|
3929
3931
|
}
|
|
3930
3932
|
const s = this.widthByKey, i = Object.keys(s), a = Object.keys(t);
|
|
3931
3933
|
if (i.length === a.length) {
|
|
@@ -4001,9 +4003,17 @@ const Ir = {
|
|
|
4001
4003
|
return ((t = e == null ? void 0 : e.payload) == null ? void 0 : t.name) || (e == null ? void 0 : e.text_md) || this.t("common.action");
|
|
4002
4004
|
},
|
|
4003
4005
|
actionDetail(e) {
|
|
4004
|
-
var s, i, a, n, r, l;
|
|
4006
|
+
var s, i, a, n, r, l, f, k;
|
|
4005
4007
|
const t = e == null ? void 0 : e.payload;
|
|
4006
|
-
|
|
4008
|
+
if (!t) return "";
|
|
4009
|
+
if (t.state === "success")
|
|
4010
|
+
return ((s = t.success) == null ? void 0 : s.summary) || ((a = (i = t.success) == null ? void 0 : i.metadata) == null ? void 0 : a.description) || "";
|
|
4011
|
+
if (t.state === "rejected") {
|
|
4012
|
+
if ((n = t.rejected) != null && n.reason) return t.rejected.reason;
|
|
4013
|
+
const y = (l = (r = t.rejected) == null ? void 0 : r.metadata) == null ? void 0 : l.resolution, T = typeof y == "string" && y.startsWith("admin") ? "action.rejectedByAdmin" : "action.rejectedByUser";
|
|
4014
|
+
return this.t(T);
|
|
4015
|
+
}
|
|
4016
|
+
return t.state === "failure" && (((f = t.failure) == null ? void 0 : f.summary) || ((k = t.failure) == null ? void 0 : k.error)) || "";
|
|
4007
4017
|
},
|
|
4008
4018
|
actionArtifact(e) {
|
|
4009
4019
|
var s, i;
|
|
@@ -4032,10 +4042,10 @@ const Ir = {
|
|
|
4032
4042
|
class: "wm-list__loadMore",
|
|
4033
4043
|
role: "status",
|
|
4034
4044
|
"aria-live": "polite"
|
|
4035
|
-
}, Nr = { class: "wm-list__loadMore-lbl" },
|
|
4045
|
+
}, Nr = { class: "wm-list__loadMore-lbl" }, jr = {
|
|
4036
4046
|
key: 1,
|
|
4037
4047
|
class: "wm-list__historyEnd"
|
|
4038
|
-
},
|
|
4048
|
+
}, Fr = {
|
|
4039
4049
|
key: 2,
|
|
4040
4050
|
class: "wm-list__sep"
|
|
4041
4051
|
}, Hr = { class: "wm-list__sep-label" }, zr = {
|
|
@@ -4058,7 +4068,7 @@ const Ir = {
|
|
|
4058
4068
|
class: "wm-list__row wm-list__row--ai fade-up"
|
|
4059
4069
|
}, ti = { class: "wm-list__avatarSlot" }, ni = ["aria-label", "title"];
|
|
4060
4070
|
function si(e, t, s, i, a, n) {
|
|
4061
|
-
const r = B("AIAvatar"), l = B("HumanAvatar"),
|
|
4071
|
+
const r = B("AIAvatar"), l = B("HumanAvatar"), f = B("ActionResult"), k = B("ArtifactRenderer"), y = B("Bubble"), T = B("AttachmentPreview"), E = B("Typing");
|
|
4062
4072
|
return c(), d("div", Dr, [
|
|
4063
4073
|
o("div", {
|
|
4064
4074
|
ref: "scrollEl",
|
|
@@ -4071,13 +4081,13 @@ function si(e, t, s, i, a, n) {
|
|
|
4071
4081
|
"aria-hidden": "true"
|
|
4072
4082
|
}, null, -1)),
|
|
4073
4083
|
o("span", Nr, v(n.t("messageList.loadingHistory")), 1)
|
|
4074
|
-
])) : n.historyExhausted ? (c(), d("div",
|
|
4075
|
-
s.dateLabel ? (c(), d("div",
|
|
4084
|
+
])) : n.historyExhausted ? (c(), d("div", jr, v(n.t("messageList.conversationStart")), 1)) : b("", !0),
|
|
4085
|
+
s.dateLabel ? (c(), d("div", Fr, [
|
|
4076
4086
|
t[7] || (t[7] = o("div", { class: "wm-list__line" }, null, -1)),
|
|
4077
4087
|
o("span", Hr, v(s.dateLabel), 1),
|
|
4078
4088
|
t[8] || (t[8] = o("div", { class: "wm-list__line" }, null, -1))
|
|
4079
4089
|
])) : b("", !0),
|
|
4080
|
-
(c(!0), d(I, null,
|
|
4090
|
+
(c(!0), d(I, null, j(n.groups, (A, q) => (c(), d(I, {
|
|
4081
4091
|
key: A.key
|
|
4082
4092
|
}, [
|
|
4083
4093
|
A.key === n.unreadGroupKey ? (c(), d("div", zr, [
|
|
@@ -4094,7 +4104,7 @@ function si(e, t, s, i, a, n) {
|
|
|
4094
4104
|
o("span", $r, v(A.systemLabel), 1),
|
|
4095
4105
|
t[12] || (t[12] = o("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
|
|
4096
4106
|
])) : (c(), d(I, { key: 1 }, [
|
|
4097
|
-
(c(!0), d(I, null,
|
|
4107
|
+
(c(!0), d(I, null, j(A.items, (M, U) => (c(), d(I, {
|
|
4098
4108
|
key: `${n.messageKey(M.message)}-${M.partKey}`
|
|
4099
4109
|
}, [
|
|
4100
4110
|
o("div", {
|
|
@@ -4131,12 +4141,12 @@ function si(e, t, s, i, a, n) {
|
|
|
4131
4141
|
}, null, 8, ["name", "avatar-url"]))
|
|
4132
4142
|
], 64)) : b("", !0)
|
|
4133
4143
|
])) : b("", !0),
|
|
4134
|
-
M.renderAs === "action" ? (c(), D(
|
|
4144
|
+
M.renderAs === "action" ? (c(), D(f, {
|
|
4135
4145
|
key: 1,
|
|
4136
4146
|
state: M.message.payload.state,
|
|
4137
4147
|
label: n.actionLabel(M.message),
|
|
4138
4148
|
detail: n.actionDetail(M.message)
|
|
4139
|
-
}, null, 8, ["state", "label", "detail"])) : M.renderAs === "admin-pending" ? (c(), D(
|
|
4149
|
+
}, null, 8, ["state", "label", "detail"])) : M.renderAs === "admin-pending" ? (c(), D(f, {
|
|
4140
4150
|
key: 2,
|
|
4141
4151
|
state: "awaiting",
|
|
4142
4152
|
label: n.t("messageList.approvalRequestSent"),
|
|
@@ -4153,7 +4163,7 @@ function si(e, t, s, i, a, n) {
|
|
|
4153
4163
|
"wm-list__body--mixed": !!M.message.text_md && n.attachmentsOf(M.message).length > 0
|
|
4154
4164
|
}])
|
|
4155
4165
|
}, [
|
|
4156
|
-
M.message.text_md ? (c(), D(
|
|
4166
|
+
M.message.text_md ? (c(), D(y, {
|
|
4157
4167
|
key: 0,
|
|
4158
4168
|
role: A.role,
|
|
4159
4169
|
text: M.message.text_md
|
|
@@ -4170,7 +4180,7 @@ function si(e, t, s, i, a, n) {
|
|
|
4170
4180
|
)
|
|
4171
4181
|
)
|
|
4172
4182
|
}, [
|
|
4173
|
-
(c(!0), d(I, null,
|
|
4183
|
+
(c(!0), d(I, null, j(n.attachmentsOf(
|
|
4174
4184
|
M.message
|
|
4175
4185
|
), (N, L) => (c(), D(T, {
|
|
4176
4186
|
key: `${n.messageKey(M.message)}-att-${L}`,
|
|
@@ -4219,7 +4229,7 @@ function si(e, t, s, i, a, n) {
|
|
|
4219
4229
|
])) : b("", !0)
|
|
4220
4230
|
], 34),
|
|
4221
4231
|
$(Ne, { name: "wm-scrollDown" }, {
|
|
4222
|
-
default:
|
|
4232
|
+
default: je(() => [
|
|
4223
4233
|
a.showScrollDown ? (c(), d("button", {
|
|
4224
4234
|
key: 0,
|
|
4225
4235
|
type: "button",
|
|
@@ -4247,7 +4257,7 @@ function si(e, t, s, i, a, n) {
|
|
|
4247
4257
|
})
|
|
4248
4258
|
]);
|
|
4249
4259
|
}
|
|
4250
|
-
const ri = /* @__PURE__ */ P(Pr, [["render", si], ["__scopeId", "data-v-
|
|
4260
|
+
const ri = /* @__PURE__ */ P(Pr, [["render", si], ["__scopeId", "data-v-434994a4"]]), pe = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", Oe = typeof window < "u" && typeof window.MediaRecorder < "u";
|
|
4251
4261
|
function ii() {
|
|
4252
4262
|
return Oe && [
|
|
4253
4263
|
"video/webm;codecs=vp9,opus",
|
|
@@ -4296,9 +4306,9 @@ async function oi(e) {
|
|
|
4296
4306
|
t.muted = !0, t.playsInline = !0, t.srcObject = e, await t.play(), await new Promise((l) => requestAnimationFrame(l));
|
|
4297
4307
|
const s = t.videoWidth || 1280, i = t.videoHeight || 720, a = document.createElement("canvas");
|
|
4298
4308
|
a.width = s, a.height = i, a.getContext("2d").drawImage(t, 0, 0, s, i);
|
|
4299
|
-
const n = await new Promise((l,
|
|
4309
|
+
const n = await new Promise((l, f) => {
|
|
4300
4310
|
a.toBlob(
|
|
4301
|
-
(k) => k ? l(k) :
|
|
4311
|
+
(k) => k ? l(k) : f(new Error("toBlob failed")),
|
|
4302
4312
|
"image/png"
|
|
4303
4313
|
);
|
|
4304
4314
|
}), r = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
@@ -4312,56 +4322,56 @@ async function li(e = {}) {
|
|
|
4312
4322
|
t = await navigator.mediaDevices.getDisplayMedia(
|
|
4313
4323
|
Ve({ audio: !0 })
|
|
4314
4324
|
);
|
|
4315
|
-
} catch (
|
|
4316
|
-
return (
|
|
4325
|
+
} catch (y) {
|
|
4326
|
+
return (y == null ? void 0 : y.name) !== "NotAllowedError" && console.error("[media] record picker", y), null;
|
|
4317
4327
|
}
|
|
4318
4328
|
const s = ii();
|
|
4319
4329
|
let i;
|
|
4320
4330
|
try {
|
|
4321
4331
|
i = s ? new window.MediaRecorder(t, { mimeType: s }) : new window.MediaRecorder(t);
|
|
4322
|
-
} catch (
|
|
4323
|
-
return console.error("[media] recorder init",
|
|
4332
|
+
} catch (y) {
|
|
4333
|
+
return console.error("[media] recorder init", y), t.getTracks().forEach((T) => {
|
|
4324
4334
|
T.stop();
|
|
4325
4335
|
}), null;
|
|
4326
4336
|
}
|
|
4327
4337
|
const a = [];
|
|
4328
4338
|
let n = null, r = !1;
|
|
4329
|
-
i.addEventListener("dataavailable", (
|
|
4330
|
-
|
|
4339
|
+
i.addEventListener("dataavailable", (y) => {
|
|
4340
|
+
y.data && y.data.size > 0 && a.push(y.data);
|
|
4331
4341
|
}), i.addEventListener("stop", () => {
|
|
4332
|
-
var
|
|
4342
|
+
var y, T;
|
|
4333
4343
|
if (n && clearInterval(n), t.getTracks().forEach((E) => {
|
|
4334
4344
|
E.stop();
|
|
4335
4345
|
}), a.length) {
|
|
4336
4346
|
const E = i.mimeType || s || "video/webm", A = new Blob(a, { type: E }), q = /mp4/.test(E) ? "mp4" : "webm", M = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), U = new File([A], `ecran-${M}.${q}`, {
|
|
4337
4347
|
type: E
|
|
4338
4348
|
});
|
|
4339
|
-
(
|
|
4349
|
+
(y = e.onfinalize) == null || y.call(e, U);
|
|
4340
4350
|
} else
|
|
4341
4351
|
(T = e.oncancel) == null || T.call(e);
|
|
4342
|
-
}), t.getVideoTracks().forEach((
|
|
4343
|
-
|
|
4352
|
+
}), t.getVideoTracks().forEach((y) => {
|
|
4353
|
+
y.addEventListener("ended", () => l(), { once: !0 });
|
|
4344
4354
|
});
|
|
4345
4355
|
function l() {
|
|
4346
4356
|
if (!r && (r = !0, i.state !== "inactive"))
|
|
4347
4357
|
try {
|
|
4348
4358
|
i.stop();
|
|
4349
|
-
} catch (
|
|
4350
|
-
console.error("[media] recorder stop",
|
|
4359
|
+
} catch (y) {
|
|
4360
|
+
console.error("[media] recorder stop", y);
|
|
4351
4361
|
}
|
|
4352
4362
|
}
|
|
4353
4363
|
try {
|
|
4354
4364
|
i.start(1e3);
|
|
4355
|
-
} catch (
|
|
4356
|
-
return console.error("[media] recorder start",
|
|
4365
|
+
} catch (y) {
|
|
4366
|
+
return console.error("[media] recorder start", y), t.getTracks().forEach((T) => {
|
|
4357
4367
|
T.stop();
|
|
4358
4368
|
}), null;
|
|
4359
4369
|
}
|
|
4360
4370
|
(k = e.onstart) == null || k.call(e);
|
|
4361
|
-
const
|
|
4371
|
+
const f = Date.now();
|
|
4362
4372
|
return n = setInterval(() => {
|
|
4363
|
-
var
|
|
4364
|
-
(
|
|
4373
|
+
var y;
|
|
4374
|
+
(y = e.ontick) == null || y.call(e, Date.now() - f);
|
|
4365
4375
|
}, 500), {
|
|
4366
4376
|
stop: l,
|
|
4367
4377
|
get state() {
|
|
@@ -4390,7 +4400,7 @@ const ci = [
|
|
|
4390
4400
|
inject: {
|
|
4391
4401
|
// Translator shared by the Messenger shell; French fallback when
|
|
4392
4402
|
// the component is used standalone.
|
|
4393
|
-
t: { default: () =>
|
|
4403
|
+
t: { default: () => F() }
|
|
4394
4404
|
},
|
|
4395
4405
|
props: {
|
|
4396
4406
|
modelValue: { type: String, default: "" },
|
|
@@ -4588,7 +4598,7 @@ function ki(e, t, s, i, a, n) {
|
|
|
4588
4598
|
onClick: t[2] || (t[2] = (r) => a.attachOpen = !1)
|
|
4589
4599
|
})) : b("", !0),
|
|
4590
4600
|
a.attachOpen ? (c(), d("div", mi, [
|
|
4591
|
-
(c(!0), d(I, null,
|
|
4601
|
+
(c(!0), d(I, null, j(n.attachItems, (r) => (c(), d("button", {
|
|
4592
4602
|
key: r.action,
|
|
4593
4603
|
type: "button",
|
|
4594
4604
|
class: "wm-compose__menuItem",
|
|
@@ -4669,7 +4679,7 @@ function ki(e, t, s, i, a, n) {
|
|
|
4669
4679
|
], 34)
|
|
4670
4680
|
], 6);
|
|
4671
4681
|
}
|
|
4672
|
-
const Ci = /* @__PURE__ */ P(di, [["render", ki], ["__scopeId", "data-v-
|
|
4682
|
+
const Ci = /* @__PURE__ */ P(di, [["render", ki], ["__scopeId", "data-v-bba29b9c"]]), Ai = {
|
|
4673
4683
|
name: "WmSuggestionChips",
|
|
4674
4684
|
props: {
|
|
4675
4685
|
items: { type: Array, default: () => [] },
|
|
@@ -4692,12 +4702,12 @@ function Mi(e, t, s, i, a, n) {
|
|
|
4692
4702
|
key: n.batchKey,
|
|
4693
4703
|
class: "wm-chips"
|
|
4694
4704
|
}, [
|
|
4695
|
-
(c(!0), d(I, null,
|
|
4705
|
+
(c(!0), d(I, null, j(s.items, (r, l) => (c(), d("button", {
|
|
4696
4706
|
key: l,
|
|
4697
4707
|
type: "button",
|
|
4698
4708
|
class: "wm-chip",
|
|
4699
4709
|
style: z({ animationDelay: s.baseDelay + l * s.stepDelay + "ms" }),
|
|
4700
|
-
onClick: (
|
|
4710
|
+
onClick: (f) => e.$emit("select", r)
|
|
4701
4711
|
}, v(r.label), 13, Si))), 128))
|
|
4702
4712
|
])) : b("", !0);
|
|
4703
4713
|
}
|
|
@@ -4707,7 +4717,7 @@ const Ti = /* @__PURE__ */ P(Ai, [["render", Mi], ["__scopeId", "data-v-47ad8085
|
|
|
4707
4717
|
inject: {
|
|
4708
4718
|
// Translator shared by the Messenger shell; French fallback when
|
|
4709
4719
|
// the component is used standalone.
|
|
4710
|
-
t: { default: () =>
|
|
4720
|
+
t: { default: () => F() }
|
|
4711
4721
|
},
|
|
4712
4722
|
props: {
|
|
4713
4723
|
action: { type: String, required: !0 },
|
|
@@ -4791,13 +4801,13 @@ const Ni = /* @__PURE__ */ new Set([
|
|
|
4791
4801
|
"select",
|
|
4792
4802
|
"multiselect",
|
|
4793
4803
|
"date"
|
|
4794
|
-
]),
|
|
4804
|
+
]), ji = {
|
|
4795
4805
|
name: "WmFormCard",
|
|
4796
4806
|
components: { AIAvatar: oe },
|
|
4797
4807
|
inject: {
|
|
4798
4808
|
// Translator shared by the Messenger shell; French fallback when
|
|
4799
4809
|
// the component is used standalone.
|
|
4800
|
-
t: { default: () =>
|
|
4810
|
+
t: { default: () => F() }
|
|
4801
4811
|
},
|
|
4802
4812
|
props: {
|
|
4803
4813
|
form: { type: Object, required: !0 },
|
|
@@ -4874,7 +4884,7 @@ const Ni = /* @__PURE__ */ new Set([
|
|
|
4874
4884
|
}
|
|
4875
4885
|
}
|
|
4876
4886
|
}
|
|
4877
|
-
},
|
|
4887
|
+
}, Fi = { class: "wm-form" }, Hi = { class: "wm-form__head" }, zi = { class: "wm-form__icon" }, qi = { class: "wm-form__main" }, Vi = { class: "wm-form__title" }, $i = {
|
|
4878
4888
|
key: 0,
|
|
4879
4889
|
class: "wm-form__detail"
|
|
4880
4890
|
}, Ki = ["for"], Wi = {
|
|
@@ -4903,7 +4913,7 @@ const Ni = /* @__PURE__ */ new Set([
|
|
|
4903
4913
|
};
|
|
4904
4914
|
function ca(e, t, s, i, a, n) {
|
|
4905
4915
|
const r = B("AIAvatar");
|
|
4906
|
-
return c(), d("div",
|
|
4916
|
+
return c(), d("div", Fi, [
|
|
4907
4917
|
o("div", Hi, [
|
|
4908
4918
|
o("div", zi, [
|
|
4909
4919
|
$(r, {
|
|
@@ -4921,7 +4931,7 @@ function ca(e, t, s, i, a, n) {
|
|
|
4921
4931
|
class: "wm-form__body",
|
|
4922
4932
|
onSubmit: t[0] || (t[0] = J((...l) => n.onSubmit && n.onSubmit(...l), ["prevent"]))
|
|
4923
4933
|
}, [
|
|
4924
|
-
(c(!0), d(I, null,
|
|
4934
|
+
(c(!0), d(I, null, j(n.normalizedFields, (l) => (c(), d("div", {
|
|
4925
4935
|
key: l.key,
|
|
4926
4936
|
class: "wm-form__field"
|
|
4927
4937
|
}, [
|
|
@@ -4935,7 +4945,7 @@ function ca(e, t, s, i, a, n) {
|
|
|
4935
4945
|
l.type === "text" ? G((c(), d("input", {
|
|
4936
4946
|
key: 0,
|
|
4937
4947
|
id: `wm-f-${a._uid}-${l.key}`,
|
|
4938
|
-
"onUpdate:modelValue": (
|
|
4948
|
+
"onUpdate:modelValue": (f) => a.values[l.key] = f,
|
|
4939
4949
|
type: "text",
|
|
4940
4950
|
class: "wm-form__input",
|
|
4941
4951
|
placeholder: l.placeholder || "",
|
|
@@ -4946,7 +4956,7 @@ function ca(e, t, s, i, a, n) {
|
|
|
4946
4956
|
]) : l.type === "textarea" ? G((c(), d("textarea", {
|
|
4947
4957
|
key: 1,
|
|
4948
4958
|
id: `wm-f-${a._uid}-${l.key}`,
|
|
4949
|
-
"onUpdate:modelValue": (
|
|
4959
|
+
"onUpdate:modelValue": (f) => a.values[l.key] = f,
|
|
4950
4960
|
class: "wm-form__textarea",
|
|
4951
4961
|
rows: "3",
|
|
4952
4962
|
placeholder: l.placeholder || "",
|
|
@@ -4957,7 +4967,7 @@ function ca(e, t, s, i, a, n) {
|
|
|
4957
4967
|
]) : l.type === "number" ? G((c(), d("input", {
|
|
4958
4968
|
key: 2,
|
|
4959
4969
|
id: `wm-f-${a._uid}-${l.key}`,
|
|
4960
|
-
"onUpdate:modelValue": (
|
|
4970
|
+
"onUpdate:modelValue": (f) => a.values[l.key] = f,
|
|
4961
4971
|
type: "number",
|
|
4962
4972
|
class: "wm-form__input",
|
|
4963
4973
|
placeholder: l.placeholder || "",
|
|
@@ -4973,7 +4983,7 @@ function ca(e, t, s, i, a, n) {
|
|
|
4973
4983
|
]) : l.type === "date" ? G((c(), d("input", {
|
|
4974
4984
|
key: 3,
|
|
4975
4985
|
id: `wm-f-${a._uid}-${l.key}`,
|
|
4976
|
-
"onUpdate:modelValue": (
|
|
4986
|
+
"onUpdate:modelValue": (f) => a.values[l.key] = f,
|
|
4977
4987
|
type: "date",
|
|
4978
4988
|
class: "wm-form__input",
|
|
4979
4989
|
required: l.required,
|
|
@@ -4983,7 +4993,7 @@ function ca(e, t, s, i, a, n) {
|
|
|
4983
4993
|
]) : l.type === "boolean" ? (c(), d("label", Qi, [
|
|
4984
4994
|
G(o("input", {
|
|
4985
4995
|
id: `wm-f-${a._uid}-${l.key}`,
|
|
4986
|
-
"onUpdate:modelValue": (
|
|
4996
|
+
"onUpdate:modelValue": (f) => a.values[l.key] = f,
|
|
4987
4997
|
type: "checkbox",
|
|
4988
4998
|
disabled: s.readOnly || a.busy
|
|
4989
4999
|
}, null, 8, Zi), [
|
|
@@ -4993,35 +5003,35 @@ function ca(e, t, s, i, a, n) {
|
|
|
4993
5003
|
])) : l.type === "select" ? G((c(), d("select", {
|
|
4994
5004
|
key: 5,
|
|
4995
5005
|
id: `wm-f-${a._uid}-${l.key}`,
|
|
4996
|
-
"onUpdate:modelValue": (
|
|
5006
|
+
"onUpdate:modelValue": (f) => a.values[l.key] = f,
|
|
4997
5007
|
class: "wm-form__select",
|
|
4998
5008
|
required: l.required,
|
|
4999
5009
|
disabled: s.readOnly || a.busy
|
|
5000
5010
|
}, [
|
|
5001
5011
|
o("option", ta, v(l.placeholder || n.t("form.choose")), 1),
|
|
5002
|
-
(c(!0), d(I, null,
|
|
5003
|
-
key:
|
|
5004
|
-
value:
|
|
5005
|
-
}, v(
|
|
5012
|
+
(c(!0), d(I, null, j(l.options, (f) => (c(), d("option", {
|
|
5013
|
+
key: f.value,
|
|
5014
|
+
value: f.value
|
|
5015
|
+
}, v(f.label), 9, na))), 128))
|
|
5006
5016
|
], 8, ea)), [
|
|
5007
5017
|
[Ge, a.values[l.key]]
|
|
5008
5018
|
]) : l.type === "multiselect" ? (c(), d("div", sa, [
|
|
5009
|
-
(c(!0), d(I, null,
|
|
5010
|
-
key:
|
|
5019
|
+
(c(!0), d(I, null, j(l.options, (f) => (c(), d("label", {
|
|
5020
|
+
key: f.value,
|
|
5011
5021
|
class: "wm-form__multiItem"
|
|
5012
5022
|
}, [
|
|
5013
5023
|
o("input", {
|
|
5014
5024
|
type: "checkbox",
|
|
5015
|
-
value:
|
|
5016
|
-
checked: Array.isArray(a.values[l.key]) && a.values[l.key].includes(
|
|
5025
|
+
value: f.value,
|
|
5026
|
+
checked: Array.isArray(a.values[l.key]) && a.values[l.key].includes(f.value),
|
|
5017
5027
|
disabled: s.readOnly || a.busy,
|
|
5018
5028
|
onChange: (k) => n.toggleMulti(
|
|
5019
5029
|
l.key,
|
|
5020
|
-
|
|
5030
|
+
f.value,
|
|
5021
5031
|
k.target.checked
|
|
5022
5032
|
)
|
|
5023
5033
|
}, null, 40, ra),
|
|
5024
|
-
o("span", null, v(
|
|
5034
|
+
o("span", null, v(f.label), 1)
|
|
5025
5035
|
]))), 128))
|
|
5026
5036
|
])) : b("", !0)
|
|
5027
5037
|
]))), 128)),
|
|
@@ -5038,12 +5048,12 @@ function ca(e, t, s, i, a, n) {
|
|
|
5038
5048
|
], 32)
|
|
5039
5049
|
]);
|
|
5040
5050
|
}
|
|
5041
|
-
const da = /* @__PURE__ */ P(
|
|
5051
|
+
const da = /* @__PURE__ */ P(ji, [["render", ca], ["__scopeId", "data-v-fe65cc56"]]), ua = {
|
|
5042
5052
|
name: "WmFeedback",
|
|
5043
5053
|
inject: {
|
|
5044
5054
|
// Translator shared by the Messenger shell; French fallback when
|
|
5045
5055
|
// the component is used standalone.
|
|
5046
|
-
t: { default: () =>
|
|
5056
|
+
t: { default: () => F() }
|
|
5047
5057
|
},
|
|
5048
5058
|
props: {
|
|
5049
5059
|
busy: { type: Boolean, default: !1 },
|
|
@@ -5100,7 +5110,7 @@ function Ca(e, t, s, i, a, n) {
|
|
|
5100
5110
|
o("div", ma, v(n.t("feedback.question")), 1),
|
|
5101
5111
|
o("div", fa, v(n.t("feedback.subtitle")), 1),
|
|
5102
5112
|
o("div", _a, [
|
|
5103
|
-
(c(!0), d(I, null,
|
|
5113
|
+
(c(!0), d(I, null, j(n.options, (r) => (c(), d("button", {
|
|
5104
5114
|
key: r.v,
|
|
5105
5115
|
type: "button",
|
|
5106
5116
|
class: R(["wm-fb__opt", { "is-selected": a.sel === r.v }]),
|
|
@@ -5124,7 +5134,7 @@ const Aa = /* @__PURE__ */ P(ua, [["render", Ca], ["__scopeId", "data-v-9b630564
|
|
|
5124
5134
|
inject: {
|
|
5125
5135
|
// Translator shared by the Messenger shell; French fallback when
|
|
5126
5136
|
// the component is used standalone.
|
|
5127
|
-
t: { default: () =>
|
|
5137
|
+
t: { default: () => F() }
|
|
5128
5138
|
},
|
|
5129
5139
|
props: {
|
|
5130
5140
|
canRename: { type: Boolean, default: !0 },
|
|
@@ -5304,12 +5314,12 @@ function Ua(e, t, s, i, a, n) {
|
|
|
5304
5314
|
])
|
|
5305
5315
|
]);
|
|
5306
5316
|
}
|
|
5307
|
-
const Na = /* @__PURE__ */ P(Sa, [["render", Ua], ["__scopeId", "data-v-4cf6d578"]]),
|
|
5317
|
+
const Na = /* @__PURE__ */ P(Sa, [["render", Ua], ["__scopeId", "data-v-4cf6d578"]]), ja = {
|
|
5308
5318
|
name: "WmRenameDialog",
|
|
5309
5319
|
inject: {
|
|
5310
5320
|
// Translator shared by the Messenger shell; French fallback when
|
|
5311
5321
|
// the component is used standalone.
|
|
5312
|
-
t: { default: () =>
|
|
5322
|
+
t: { default: () => F() }
|
|
5313
5323
|
},
|
|
5314
5324
|
props: {
|
|
5315
5325
|
// Empty defaults: the resolved fallback comes from the translator
|
|
@@ -5346,13 +5356,13 @@ const Na = /* @__PURE__ */ P(Sa, [["render", Ua], ["__scopeId", "data-v-4cf6d578
|
|
|
5346
5356
|
this.canSubmit && this.$emit("submit", this.value.trim());
|
|
5347
5357
|
}
|
|
5348
5358
|
}
|
|
5349
|
-
},
|
|
5359
|
+
}, Fa = { class: "wm-dialog" }, Ha = {
|
|
5350
5360
|
class: "wm-dialog__card",
|
|
5351
5361
|
role: "dialog",
|
|
5352
5362
|
"aria-modal": "true"
|
|
5353
5363
|
}, za = { class: "wm-dialog__head" }, qa = { class: "wm-dialog__title" }, Va = ["aria-label"], $a = { class: "wm-dialog__body" }, Ka = ["placeholder"], Wa = { class: "wm-dialog__actions" }, Ga = ["disabled"];
|
|
5354
5364
|
function Ya(e, t, s, i, a, n) {
|
|
5355
|
-
return c(), d("div",
|
|
5365
|
+
return c(), d("div", Fa, [
|
|
5356
5366
|
o("div", {
|
|
5357
5367
|
class: "wm-dialog__scrim",
|
|
5358
5368
|
onClick: t[0] || (t[0] = (r) => e.$emit("close"))
|
|
@@ -5413,7 +5423,7 @@ function Ya(e, t, s, i, a, n) {
|
|
|
5413
5423
|
])
|
|
5414
5424
|
]);
|
|
5415
5425
|
}
|
|
5416
|
-
const Ja = /* @__PURE__ */ P(
|
|
5426
|
+
const Ja = /* @__PURE__ */ P(ja, [["render", Ya], ["__scopeId", "data-v-6d5f94a8"]]), Ue = "ww-messenger-tokens", Xa = {
|
|
5417
5427
|
name: "Messenger",
|
|
5418
5428
|
components: {
|
|
5419
5429
|
Launcher: qt,
|
|
@@ -5604,7 +5614,7 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5604
5614
|
// `locale` changes. `t()` below (and the provided closure) delegate
|
|
5605
5615
|
// to it so every string resolves against the current language.
|
|
5606
5616
|
translator() {
|
|
5607
|
-
return
|
|
5617
|
+
return F(this.locale);
|
|
5608
5618
|
},
|
|
5609
5619
|
error() {
|
|
5610
5620
|
var e;
|
|
@@ -5638,8 +5648,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5638
5648
|
var k;
|
|
5639
5649
|
const a = e[i.id] || [], n = Y(i.last_read_message_id);
|
|
5640
5650
|
let r = 0, l = null;
|
|
5641
|
-
for (let
|
|
5642
|
-
const T = a[
|
|
5651
|
+
for (let y = a.length - 1; y >= 0; y--) {
|
|
5652
|
+
const T = a[y];
|
|
5643
5653
|
if (!T) continue;
|
|
5644
5654
|
if (((k = T.author) == null ? void 0 : k.type) === "user") break;
|
|
5645
5655
|
const E = Y(T.id);
|
|
@@ -5649,15 +5659,15 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5649
5659
|
}
|
|
5650
5660
|
}
|
|
5651
5661
|
if (!a.length) {
|
|
5652
|
-
const
|
|
5653
|
-
|
|
5662
|
+
const y = Y(i.last_message_id);
|
|
5663
|
+
y != null && (n == null || y > n) && (r = 1, l = i.last_message_author || null);
|
|
5654
5664
|
}
|
|
5655
|
-
const
|
|
5656
|
-
(
|
|
5665
|
+
const f = a.filter(
|
|
5666
|
+
(y) => !((y == null ? void 0 : y.id) != null && t[y.id] === 0)
|
|
5657
5667
|
);
|
|
5658
5668
|
return {
|
|
5659
5669
|
...i,
|
|
5660
|
-
_preview: _t(i,
|
|
5670
|
+
_preview: _t(i, f),
|
|
5661
5671
|
_unread: r > 0,
|
|
5662
5672
|
_unreadCount: r,
|
|
5663
5673
|
_lastAuthor: l
|
|
@@ -5693,14 +5703,14 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5693
5703
|
const e = ((s = this.s) == null ? void 0 : s.messagesByConv) || {}, t = [];
|
|
5694
5704
|
for (const i of this.drawerConversations) {
|
|
5695
5705
|
if (!i._unread) continue;
|
|
5696
|
-
const a = Be(i, e[i.id] || []), n = i._lastAuthor, r = !n || n.type === "agent_ia", l = (n == null ? void 0 : n.name) || (r ? this.agentName : "") || "",
|
|
5706
|
+
const a = Be(i, e[i.id] || []), n = i._lastAuthor, r = !n || n.type === "agent_ia", l = (n == null ? void 0 : n.name) || (r ? this.agentName : "") || "", f = (n == null ? void 0 : n.avatar_url) || (r ? this.agentAvatarUrl : null);
|
|
5697
5707
|
t.push({
|
|
5698
5708
|
convId: i.id,
|
|
5699
5709
|
preview: i._preview || this.t("notification.youHaveNewMessage"),
|
|
5700
5710
|
ts: a,
|
|
5701
5711
|
count: i._unreadCount || 1,
|
|
5702
5712
|
senderName: l,
|
|
5703
|
-
senderAvatarUrl:
|
|
5713
|
+
senderAvatarUrl: f
|
|
5704
5714
|
});
|
|
5705
5715
|
}
|
|
5706
5716
|
return t.sort((i, a) => i.ts < a.ts ? 1 : i.ts > a.ts ? -1 : 0), t;
|
|
@@ -5860,8 +5870,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5860
5870
|
if (!(r != null && r.loaded)) return t;
|
|
5861
5871
|
}
|
|
5862
5872
|
const s = this.revealedAt, i = (this.s.messagesByConv[e.id] || []).filter((r) => {
|
|
5863
|
-
var l,
|
|
5864
|
-
return (r == null ? void 0 : r.type) === "action" && ((l = r == null ? void 0 : r.payload) == null ? void 0 : l.state) === "pending" || he(r) && !(s[r.id] > 0) ? !1 : (r == null ? void 0 : r.type) === "action" || (r == null ? void 0 : r.type) === "system" || ((
|
|
5873
|
+
var l, f, k, y, T;
|
|
5874
|
+
return (r == null ? void 0 : r.type) === "action" && ((l = r == null ? void 0 : r.payload) == null ? void 0 : l.state) === "pending" || he(r) && !(s[r.id] > 0) ? !1 : (r == null ? void 0 : r.type) === "action" || (r == null ? void 0 : r.type) === "system" || ((f = r == null ? void 0 : r.payload) == null ? void 0 : f.type) === "system" || Array.isArray((k = r == null ? void 0 : r.payload) == null ? void 0 : k.attachments) && r.payload.attachments.length || (y = r == null ? void 0 : r.metadata) != null && y.artifact || (T = r == null ? void 0 : r.metadata) != null && T.form ? !0 : typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0;
|
|
5865
5875
|
});
|
|
5866
5876
|
return t.length ? [...t, ...i] : i;
|
|
5867
5877
|
},
|
|
@@ -5898,14 +5908,14 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
5898
5908
|
return ((t = (e = this.pendingApproval) == null ? void 0 : e.payload) == null ? void 0 : t.name) || ((s = this.pendingApproval) == null ? void 0 : s.text_md) || this.t("action.title");
|
|
5899
5909
|
},
|
|
5900
5910
|
approvalDetail() {
|
|
5901
|
-
var i, a, n, r, l,
|
|
5911
|
+
var i, a, n, r, l, f;
|
|
5902
5912
|
const e = (n = (a = (i = this.pendingApproval) == null ? void 0 : i.payload) == null ? void 0 : a.pending) == null ? void 0 : n.user_explanation;
|
|
5903
5913
|
if (typeof e == "string" && e.trim())
|
|
5904
5914
|
return e.trim();
|
|
5905
|
-
const t = (
|
|
5915
|
+
const t = (f = (l = (r = this.pendingApproval) == null ? void 0 : r.payload) == null ? void 0 : l.pending) == null ? void 0 : f.prepared_params;
|
|
5906
5916
|
if (!t || typeof t != "object") return "";
|
|
5907
5917
|
const s = Object.entries(t);
|
|
5908
|
-
return s.length ? s.slice(0, 2).map(([k,
|
|
5918
|
+
return s.length ? s.slice(0, 2).map(([k, y]) => `${k}: ${y}`).join(" · ") : "";
|
|
5909
5919
|
},
|
|
5910
5920
|
actionInFlight() {
|
|
5911
5921
|
var e, t;
|
|
@@ -6255,16 +6265,16 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6255
6265
|
this.launcherHovered = e, this.sendCurrentLauncherSize();
|
|
6256
6266
|
},
|
|
6257
6267
|
sendCurrentLauncherSize() {
|
|
6258
|
-
var
|
|
6268
|
+
var y, T, E, A, q, M, U;
|
|
6259
6269
|
if (this.isOpen) return;
|
|
6260
|
-
const e = (T = (
|
|
6270
|
+
const e = (T = (y = this.$el) == null ? void 0 : y.querySelector) == null ? void 0 : T.call(y, ".wm-launcherWrap");
|
|
6261
6271
|
if (!e) return;
|
|
6262
6272
|
const t = e.getBoundingClientRect();
|
|
6263
6273
|
if (!t.width || !t.height) return;
|
|
6264
|
-
const s = (((E = this.launcherPeeks) == null ? void 0 : E.length) ?? 0) > 0, i = 16, a = Math.ceil(t.width), n = Math.ceil(t.height), r = (q = (A = this.$el) == null ? void 0 : A.querySelector) == null ? void 0 : q.call(A, ".wm-launcher"), l = (U = (M = this.$el) == null ? void 0 : M.querySelectorAll) == null ? void 0 : U.call(M, ".wm-peek"),
|
|
6274
|
+
const s = (((E = this.launcherPeeks) == null ? void 0 : E.length) ?? 0) > 0, i = 16, a = Math.ceil(t.width), n = Math.ceil(t.height), r = (q = (A = this.$el) == null ? void 0 : A.querySelector) == null ? void 0 : q.call(A, ".wm-launcher"), l = (U = (M = this.$el) == null ? void 0 : M.querySelectorAll) == null ? void 0 : U.call(M, ".wm-peek"), f = l && l.length ? l[l.length - 1] : null;
|
|
6265
6275
|
let k = null;
|
|
6266
|
-
if (
|
|
6267
|
-
const N =
|
|
6276
|
+
if (f) {
|
|
6277
|
+
const N = f.getBoundingClientRect();
|
|
6268
6278
|
k = {
|
|
6269
6279
|
width: Math.ceil(N.width),
|
|
6270
6280
|
height: Math.ceil(N.height),
|
|
@@ -6401,7 +6411,7 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6401
6411
|
const a = this.revealPacing, n = t.trim().length, r = Math.min(
|
|
6402
6412
|
a.maxTypingMs,
|
|
6403
6413
|
Math.max(a.minTypingMs, n * a.msPerChar)
|
|
6404
|
-
), l = a.firstRevealDelayMs + r,
|
|
6414
|
+
), l = a.firstRevealDelayMs + r, f = setTimeout(() => {
|
|
6405
6415
|
this.welcomeRevealedAt = {
|
|
6406
6416
|
...this.welcomeRevealedAt,
|
|
6407
6417
|
[e]: Date.now()
|
|
@@ -6411,7 +6421,7 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6411
6421
|
}, l);
|
|
6412
6422
|
this.welcomeRevealTimers = {
|
|
6413
6423
|
...this.welcomeRevealTimers,
|
|
6414
|
-
[e]:
|
|
6424
|
+
[e]: f
|
|
6415
6425
|
};
|
|
6416
6426
|
},
|
|
6417
6427
|
// Clear pending welcome timers (panel unmount, refresh). Doesn't
|
|
@@ -6658,7 +6668,7 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
|
|
|
6658
6668
|
class: "wm-attached__fileSize"
|
|
6659
6669
|
}, _o = ["aria-label", "onClick"];
|
|
6660
6670
|
function go(e, t, s, i, a, n) {
|
|
6661
|
-
const r = B("Launcher"), l = B("Header"),
|
|
6671
|
+
const r = B("Launcher"), l = B("Header"), f = B("History"), k = B("Onboarding"), y = B("MessageList"), T = B("ApprovalCard"), E = B("FormCard"), A = B("Feedback"), q = B("SuggestionChips"), M = B("Composer"), U = B("MoreMenu"), N = B("RenameDialog");
|
|
6662
6672
|
return c(), d("div", {
|
|
6663
6673
|
class: R(["wm-root", `wm-root--${s.displayMode}`]),
|
|
6664
6674
|
style: z(n.rootStyle)
|
|
@@ -6746,12 +6756,12 @@ function go(e, t, s, i, a, n) {
|
|
|
6746
6756
|
o("div", so, v(n.error), 1)
|
|
6747
6757
|
])
|
|
6748
6758
|
])
|
|
6749
|
-
])) : !n.currentConv && a.showHistory ? (c(), D(
|
|
6759
|
+
])) : !n.currentConv && a.showHistory ? (c(), D(f, {
|
|
6750
6760
|
key: 1,
|
|
6751
6761
|
threads: n.openThreads,
|
|
6752
6762
|
onResume: n.onDrawerPick
|
|
6753
6763
|
}, null, 8, ["threads", "onResume"])) : n.currentConv ? (c(), d(I, { key: 3 }, [
|
|
6754
|
-
$(
|
|
6764
|
+
$(y, {
|
|
6755
6765
|
ref: "messageList",
|
|
6756
6766
|
messages: n.displayedMessages,
|
|
6757
6767
|
"streaming-active": n.streamingActive,
|
|
@@ -6802,7 +6812,7 @@ function go(e, t, s, i, a, n) {
|
|
|
6802
6812
|
})), 1)
|
|
6803
6813
|
])) : b("", !0),
|
|
6804
6814
|
a.pendingAttachments.length ? (c(), d("div", lo, [
|
|
6805
|
-
(c(!0), d(I, null,
|
|
6815
|
+
(c(!0), d(I, null, j(a.pendingAttachments, (L, K) => (c(), d("div", {
|
|
6806
6816
|
key: L.path || K,
|
|
6807
6817
|
class: "wm-attached__item"
|
|
6808
6818
|
}, [
|
|
@@ -6917,7 +6927,7 @@ function go(e, t, s, i, a, n) {
|
|
|
6917
6927
|
], 6)) : b("", !0)
|
|
6918
6928
|
], 6);
|
|
6919
6929
|
}
|
|
6920
|
-
const yo = /* @__PURE__ */ P(Xa, [["render", go], ["__scopeId", "data-v-fa8045f9"]]), wo = "0.5.
|
|
6930
|
+
const yo = /* @__PURE__ */ P(Xa, [["render", go], ["__scopeId", "data-v-fa8045f9"]]), wo = "0.5.76";
|
|
6921
6931
|
export {
|
|
6922
6932
|
oe as AIAvatar,
|
|
6923
6933
|
be as AVATAR_COLORS,
|
|
@@ -6953,7 +6963,7 @@ export {
|
|
|
6953
6963
|
ai as captureScreenshotFile,
|
|
6954
6964
|
H as colors,
|
|
6955
6965
|
st as createStore,
|
|
6956
|
-
|
|
6966
|
+
F as createTranslator,
|
|
6957
6967
|
Ze as createTransport,
|
|
6958
6968
|
ne as dateLocale,
|
|
6959
6969
|
yo as default,
|