@_solaris/messenger-widget 0.3.2 → 0.3.4
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 +10 -10
- package/dist/messenger.embed.js +10 -10
- package/dist/messenger.js +447 -424
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/messenger.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reactive as Se, openBlock as l, createElementBlock as c, createVNode as K, Transition as xe, withCtx as Te, withKeys as ae, withModifiers as X, createElementVNode as i, toDisplayString as
|
|
1
|
+
import { reactive as Se, openBlock as l, createElementBlock as c, createVNode as K, Transition as xe, withCtx as Te, withKeys as ae, withModifiers as X, createElementVNode as i, toDisplayString as b, createCommentVNode as y, normalizeStyle as G, normalizeClass as E, Fragment as M, renderList as D, resolveComponent as B, createBlock as L, createTextVNode as te, resolveDynamicComponent as Me, renderSlot as Oe, withDirectives as q, vModelText as J, vModelCheckbox as Ie, vModelSelect as Be, createStaticVNode as ue, markRaw as me } from "vue";
|
|
2
2
|
const Ee = [
|
|
3
3
|
"connected",
|
|
4
4
|
"message",
|
|
@@ -34,7 +34,7 @@ function Fe(t) {
|
|
|
34
34
|
function n(h, f) {
|
|
35
35
|
return e.listeners.has(h) || e.listeners.set(h, /* @__PURE__ */ new Set()), e.listeners.get(h).add(f), () => e.listeners.get(h).delete(f);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function o(h, f) {
|
|
38
38
|
const p = e.listeners.get(h);
|
|
39
39
|
p && p.forEach((C) => {
|
|
40
40
|
try {
|
|
@@ -45,7 +45,7 @@ function Fe(t) {
|
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
function r(h) {
|
|
48
|
-
e.connection !== h && (e.connection = h,
|
|
48
|
+
e.connection !== h && (e.connection = h, o("connection", h));
|
|
49
49
|
}
|
|
50
50
|
function s() {
|
|
51
51
|
return {
|
|
@@ -54,7 +54,7 @@ function Fe(t) {
|
|
|
54
54
|
"X-Widget-Id": e.widgetId
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
async function
|
|
57
|
+
async function a(h, f, p) {
|
|
58
58
|
const C = await fetch(`${e.baseUrl}${fe}${f}`, {
|
|
59
59
|
method: h,
|
|
60
60
|
headers: { "Content-Type": "application/json", ...s() },
|
|
@@ -86,7 +86,7 @@ function Fe(t) {
|
|
|
86
86
|
return p.json();
|
|
87
87
|
}),
|
|
88
88
|
// HMAC-protected.
|
|
89
|
-
|
|
89
|
+
a("GET", "/customers/me")
|
|
90
90
|
]);
|
|
91
91
|
return {
|
|
92
92
|
config: (
|
|
@@ -97,31 +97,31 @@ function Fe(t) {
|
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
99
|
async function k() {
|
|
100
|
-
const h = await
|
|
100
|
+
const h = await a("GET", "/customers/me");
|
|
101
101
|
return (h == null ? void 0 : h.customer) ?? null;
|
|
102
102
|
}
|
|
103
|
-
async function
|
|
104
|
-
const f = await
|
|
103
|
+
async function w(h) {
|
|
104
|
+
const f = await a("PATCH", "/customers/me", h);
|
|
105
105
|
return (f == null ? void 0 : f.customer) ?? null;
|
|
106
106
|
}
|
|
107
107
|
async function S() {
|
|
108
|
-
const h = await
|
|
108
|
+
const h = await a("GET", "/conversations");
|
|
109
109
|
return (h == null ? void 0 : h.conversations) ?? [];
|
|
110
110
|
}
|
|
111
111
|
async function F(h = {}) {
|
|
112
|
-
return (await
|
|
112
|
+
return (await a("POST", "/conversations", h)).conversation;
|
|
113
113
|
}
|
|
114
114
|
async function A(h) {
|
|
115
|
-
return (await
|
|
115
|
+
return (await a("GET", `/conversations/${encodeURIComponent(h)}`)).conversation;
|
|
116
116
|
}
|
|
117
117
|
async function U(h, f) {
|
|
118
|
-
return (await
|
|
118
|
+
return (await a("PATCH", `/conversations/${encodeURIComponent(h)}`, f)).conversation;
|
|
119
119
|
}
|
|
120
120
|
async function x(h, f = {}) {
|
|
121
121
|
const p = new URLSearchParams();
|
|
122
122
|
f.before && p.set("before", f.before), f.since && p.set("since", f.since), f.limit && p.set("limit", String(f.limit));
|
|
123
123
|
const C = p.toString() ? `?${p.toString()}` : "";
|
|
124
|
-
return
|
|
124
|
+
return a(
|
|
125
125
|
"GET",
|
|
126
126
|
`/conversations/${encodeURIComponent(h)}/messages${C}`
|
|
127
127
|
);
|
|
@@ -135,14 +135,14 @@ function Fe(t) {
|
|
|
135
135
|
author: { id: e.userId, type: "user" },
|
|
136
136
|
created_at: f.created_at || (/* @__PURE__ */ new Date()).toISOString()
|
|
137
137
|
};
|
|
138
|
-
return Array.isArray(f.attachments) && f.attachments.length && (p.payload = { type: "content", attachments: f.attachments }), f.metadata && typeof f.metadata == "object" && (p.metadata = f.metadata),
|
|
138
|
+
return Array.isArray(f.attachments) && f.attachments.length && (p.payload = { type: "content", attachments: f.attachments }), f.metadata && typeof f.metadata == "object" && (p.metadata = f.metadata), a(
|
|
139
139
|
"POST",
|
|
140
140
|
`/conversations/${encodeURIComponent(h)}/messages`,
|
|
141
141
|
p
|
|
142
142
|
);
|
|
143
143
|
}
|
|
144
144
|
async function P(h, f, p) {
|
|
145
|
-
return V(),
|
|
145
|
+
return V(), a(
|
|
146
146
|
"POST",
|
|
147
147
|
`/messages/${encodeURIComponent(h)}/callbacks/${encodeURIComponent(f)}`,
|
|
148
148
|
p ? { inputs: p } : {}
|
|
@@ -154,7 +154,7 @@ function Fe(t) {
|
|
|
154
154
|
h.name || "attachment"
|
|
155
155
|
), p = h.type || "application/octet-stream", C = h.size || 0, T = (
|
|
156
156
|
/** @type {import('./types.js').AttachmentUploadTicket} */
|
|
157
|
-
await
|
|
157
|
+
await a("POST", "/attachments", {
|
|
158
158
|
mime_type: p,
|
|
159
159
|
size_bytes: C,
|
|
160
160
|
name: f
|
|
@@ -174,7 +174,7 @@ function Fe(t) {
|
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
176
|
async function H(h) {
|
|
177
|
-
return
|
|
177
|
+
return a(
|
|
178
178
|
"GET",
|
|
179
179
|
`/attachments/sign?path=${encodeURIComponent(h)}`
|
|
180
180
|
);
|
|
@@ -193,15 +193,15 @@ function Fe(t) {
|
|
|
193
193
|
const h = new EventSource(Y());
|
|
194
194
|
for (const f of Ee)
|
|
195
195
|
h.addEventListener(f, (p) => Z(f, p.data));
|
|
196
|
-
h.addEventListener("error", () =>
|
|
196
|
+
h.addEventListener("error", () => o("error", new Error("SSE error"))), e.eventSource = h, r("open");
|
|
197
197
|
} catch (h) {
|
|
198
|
-
console.error("[transport] SSE open failed", h),
|
|
198
|
+
console.error("[transport] SSE open failed", h), o("error", h);
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
function Z(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
|
+
o(h, C);
|
|
205
205
|
} catch (p) {
|
|
206
206
|
console.error("[transport] bad SSE payload", h, p);
|
|
207
207
|
}
|
|
@@ -223,7 +223,7 @@ function Fe(t) {
|
|
|
223
223
|
const O = T == null ? void 0 : T.last_message_at;
|
|
224
224
|
return O && (!C || O > C) ? O : C;
|
|
225
225
|
}, null);
|
|
226
|
-
f && (!e.lastActivityAt || f > e.lastActivityAt) && (e.lastActivityAt = f,
|
|
226
|
+
f && (!e.lastActivityAt || f > e.lastActivityAt) && (e.lastActivityAt = f, o("activity", { conversations: h, latestAt: f }), V());
|
|
227
227
|
} catch (h) {
|
|
228
228
|
console.error("[transport] poll failed", h);
|
|
229
229
|
}
|
|
@@ -274,7 +274,7 @@ function Fe(t) {
|
|
|
274
274
|
// REST
|
|
275
275
|
bootstrap: v,
|
|
276
276
|
getCustomer: k,
|
|
277
|
-
patchCustomer:
|
|
277
|
+
patchCustomer: w,
|
|
278
278
|
listConversations: S,
|
|
279
279
|
createConversation: F,
|
|
280
280
|
getConversation: A,
|
|
@@ -363,7 +363,7 @@ function Ue(t) {
|
|
|
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
|
-
async function
|
|
366
|
+
async function o() {
|
|
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)
|
|
@@ -392,7 +392,7 @@ function Ue(t) {
|
|
|
392
392
|
}
|
|
393
393
|
return e.customer;
|
|
394
394
|
}
|
|
395
|
-
async function
|
|
395
|
+
async function a(u = {}) {
|
|
396
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
|
}
|
|
@@ -400,7 +400,7 @@ function Ue(t) {
|
|
|
400
400
|
async function v(u) {
|
|
401
401
|
if (e.messagesByConv[u]) return;
|
|
402
402
|
const m = await t.listMessages(u, { limit: d });
|
|
403
|
-
e.messagesByConv[u] = (m == null ? void 0 : m.messages) ?? [],
|
|
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,
|
|
406
406
|
loaded: !0
|
|
@@ -412,7 +412,7 @@ function Ue(t) {
|
|
|
412
412
|
if (!m || m.loading || !m.nextCursor) return;
|
|
413
413
|
const g = (h = (e.messagesByConv[u] || []).find((f) => f == null ? void 0 : f.created_at)) == null ? void 0 : h.created_at;
|
|
414
414
|
if (g) {
|
|
415
|
-
|
|
415
|
+
w(u, { ...m, loading: !0 });
|
|
416
416
|
try {
|
|
417
417
|
const f = await t.listMessages(u, {
|
|
418
418
|
before: g,
|
|
@@ -421,17 +421,17 @@ function Ue(t) {
|
|
|
421
421
|
for (const I of C)
|
|
422
422
|
(I == null ? void 0 : I.id) != null && T.add(`id:${String(I.id)}`), I != null && I.client_msg_id && T.add(`c:${I.client_msg_id}`);
|
|
423
423
|
const O = p.filter((I) => !((I == null ? void 0 : I.id) != null && T.has(`id:${String(I.id)}`) || I != null && I.client_msg_id && T.has(`c:${I.client_msg_id}`)));
|
|
424
|
-
e.messagesByConv[u] = [...O, ...C],
|
|
424
|
+
e.messagesByConv[u] = [...O, ...C], w(u, {
|
|
425
425
|
nextCursor: (f == null ? void 0 : f.next_cursor) ?? null,
|
|
426
426
|
loading: !1,
|
|
427
427
|
loaded: !0
|
|
428
428
|
});
|
|
429
429
|
} catch (f) {
|
|
430
|
-
console.error("[store] loadMore failed", f),
|
|
430
|
+
console.error("[store] loadMore failed", f), w(u, { ...m, loading: !1 });
|
|
431
431
|
}
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
|
-
function
|
|
434
|
+
function w(u, m) {
|
|
435
435
|
e.paginationByConv = { ...e.paginationByConv, [u]: m };
|
|
436
436
|
}
|
|
437
437
|
async function S(u, m) {
|
|
@@ -614,10 +614,10 @@ function Ue(t) {
|
|
|
614
614
|
}
|
|
615
615
|
return {
|
|
616
616
|
state: e,
|
|
617
|
-
start:
|
|
617
|
+
start: o,
|
|
618
618
|
destroy: r,
|
|
619
619
|
applyCustomer: s,
|
|
620
|
-
createConversation:
|
|
620
|
+
createConversation: a,
|
|
621
621
|
openConversation: v,
|
|
622
622
|
loadMore: k,
|
|
623
623
|
patchConversation: S,
|
|
@@ -707,8 +707,8 @@ const Pe = `
|
|
|
707
707
|
}
|
|
708
708
|
`, He = "https://api.messenger.victorc.fr", $ = (t, e) => {
|
|
709
709
|
const n = t.__vccOpts || t;
|
|
710
|
-
for (const [
|
|
711
|
-
n[
|
|
710
|
+
for (const [o, r] of e)
|
|
711
|
+
n[o] = r;
|
|
712
712
|
return n;
|
|
713
713
|
}, ze = {
|
|
714
714
|
name: "WmLauncher",
|
|
@@ -721,7 +721,7 @@ const Pe = `
|
|
|
721
721
|
},
|
|
722
722
|
emits: ["open", "dismiss"]
|
|
723
723
|
}, Ve = { class: "wm-launcherWrap" }, qe = { class: "wm-peek__text" }, We = ["aria-label"];
|
|
724
|
-
function Ke(t, e, n,
|
|
724
|
+
function Ke(t, e, n, o, r, s) {
|
|
725
725
|
return l(), c("div", Ve, [
|
|
726
726
|
K(xe, { name: "wm-peek" }, {
|
|
727
727
|
default: Te(() => [
|
|
@@ -731,18 +731,18 @@ function Ke(t, e, n, a, r, s) {
|
|
|
731
731
|
role: "button",
|
|
732
732
|
tabindex: "0",
|
|
733
733
|
"aria-label": "Ouvrir le messenger sur le dernier message",
|
|
734
|
-
onClick: e[1] || (e[1] = (
|
|
734
|
+
onClick: e[1] || (e[1] = (a) => t.$emit("open")),
|
|
735
735
|
onKeydown: [
|
|
736
|
-
e[2] || (e[2] = ae(X((
|
|
737
|
-
e[3] || (e[3] = ae(X((
|
|
736
|
+
e[2] || (e[2] = ae(X((a) => t.$emit("open"), ["prevent"]), ["enter"])),
|
|
737
|
+
e[3] || (e[3] = ae(X((a) => t.$emit("open"), ["prevent"]), ["space"]))
|
|
738
738
|
]
|
|
739
739
|
}, [
|
|
740
|
-
i("p", qe,
|
|
740
|
+
i("p", qe, b(n.peek), 1),
|
|
741
741
|
i("button", {
|
|
742
742
|
type: "button",
|
|
743
743
|
class: "wm-peek__close",
|
|
744
744
|
"aria-label": "Ignorer",
|
|
745
|
-
onClick: e[0] || (e[0] = X((
|
|
745
|
+
onClick: e[0] || (e[0] = X((a) => t.$emit("dismiss"), ["stop"]))
|
|
746
746
|
}, [...e[5] || (e[5] = [
|
|
747
747
|
i("svg", {
|
|
748
748
|
width: "11",
|
|
@@ -766,7 +766,7 @@ function Ke(t, e, n, a, r, s) {
|
|
|
766
766
|
type: "button",
|
|
767
767
|
class: "wm-launcher",
|
|
768
768
|
"aria-label": "Ouvrir le messenger",
|
|
769
|
-
onClick: e[4] || (e[4] = (
|
|
769
|
+
onClick: e[4] || (e[4] = (a) => t.$emit("open"))
|
|
770
770
|
}, [
|
|
771
771
|
e[6] || (e[6] = i("svg", {
|
|
772
772
|
width: "20",
|
|
@@ -785,7 +785,7 @@ function Ke(t, e, n, a, r, s) {
|
|
|
785
785
|
key: 0,
|
|
786
786
|
class: "wm-launcher__badge",
|
|
787
787
|
"aria-label": `${n.unreadCount} conversation${n.unreadCount > 1 ? "s" : ""} non lue${n.unreadCount > 1 ? "s" : ""}`
|
|
788
|
-
},
|
|
788
|
+
}, b(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, We)) : y("", !0)
|
|
789
789
|
])
|
|
790
790
|
]);
|
|
791
791
|
}
|
|
@@ -805,7 +805,7 @@ const Ge = /* @__PURE__ */ $(ze, [["render", Ke], ["__scopeId", "data-v-fabef371
|
|
|
805
805
|
key: 0,
|
|
806
806
|
class: "wm-aiav__pulse"
|
|
807
807
|
}, Xe = ["width", "height"];
|
|
808
|
-
function Ze(t, e, n,
|
|
808
|
+
function Ze(t, e, n, o, r, s) {
|
|
809
809
|
return l(), c("div", {
|
|
810
810
|
class: E(["wm-aiav", { "wm-aiav--tail": n.tail }]),
|
|
811
811
|
style: G({ width: n.size + "px", height: n.size + "px", "--wm-avr": n.size * 0.32 + "px" })
|
|
@@ -860,7 +860,7 @@ const ne = /* @__PURE__ */ $(Ye, [["render", Ze], ["__scopeId", "data-v-8c924688
|
|
|
860
860
|
}
|
|
861
861
|
}
|
|
862
862
|
}, et = ["src", "alt"];
|
|
863
|
-
function tt(t, e, n,
|
|
863
|
+
function tt(t, e, n, o, r, s) {
|
|
864
864
|
return l(), c("div", {
|
|
865
865
|
class: "wm-huav",
|
|
866
866
|
style: G({
|
|
@@ -877,7 +877,7 @@ function tt(t, e, n, a, r, s) {
|
|
|
877
877
|
}, null, 8, et)) : (l(), c("span", {
|
|
878
878
|
key: 1,
|
|
879
879
|
style: G({ fontSize: n.size * 0.36 + "px" })
|
|
880
|
-
},
|
|
880
|
+
}, b(s.initials), 5))
|
|
881
881
|
], 4);
|
|
882
882
|
}
|
|
883
883
|
const ke = /* @__PURE__ */ $(Qe, [["render", tt], ["__scopeId", "data-v-a772b179"]]), nt = {
|
|
@@ -909,25 +909,25 @@ const ke = /* @__PURE__ */ $(Qe, [["render", tt], ["__scopeId", "data-v-a772b179
|
|
|
909
909
|
key: 0,
|
|
910
910
|
class: "wm-team__label"
|
|
911
911
|
};
|
|
912
|
-
function ot(t, e, n,
|
|
912
|
+
function ot(t, e, n, o, r, s) {
|
|
913
913
|
return s.visible ? (l(), c("div", st, [
|
|
914
914
|
i("div", {
|
|
915
915
|
class: "wm-team__stack",
|
|
916
916
|
style: G({ width: s.stackWidth + "px" })
|
|
917
917
|
}, [
|
|
918
|
-
(l(!0), c(M, null, D(n.members.slice(0, 3), (
|
|
918
|
+
(l(!0), c(M, null, D(n.members.slice(0, 3), (a, d) => (l(), c("div", {
|
|
919
919
|
key: d,
|
|
920
920
|
class: "wm-team__pill",
|
|
921
|
-
style: G({ left: d * 13 + "px", zIndex: 3 - d, background: s.colorFor(
|
|
921
|
+
style: G({ left: d * 13 + "px", zIndex: 3 - d, background: s.colorFor(a) })
|
|
922
922
|
}, [
|
|
923
|
-
|
|
923
|
+
a.avatar_url ? (l(), c("img", {
|
|
924
924
|
key: 0,
|
|
925
|
-
src:
|
|
926
|
-
alt:
|
|
927
|
-
}, null, 8, rt)) : (l(), c("span", it,
|
|
925
|
+
src: a.avatar_url,
|
|
926
|
+
alt: a.name || ""
|
|
927
|
+
}, null, 8, rt)) : (l(), c("span", it, b(s.initialsFor(a)), 1))
|
|
928
928
|
], 4))), 128))
|
|
929
929
|
], 4),
|
|
930
|
-
n.responseLabel ? (l(), c("span", at,
|
|
930
|
+
n.responseLabel ? (l(), c("span", at, b(n.responseLabel), 1)) : y("", !0)
|
|
931
931
|
])) : y("", !0);
|
|
932
932
|
}
|
|
933
933
|
const lt = /* @__PURE__ */ $(nt, [["render", ot], ["__scopeId", "data-v-3659b9c1"]]), dt = {
|
|
@@ -973,8 +973,8 @@ const lt = /* @__PURE__ */ $(nt, [["render", ot], ["__scopeId", "data-v-3659b9c1
|
|
|
973
973
|
key: 3,
|
|
974
974
|
class: "wm-header__fill"
|
|
975
975
|
}, gt = { class: "wm-header__actions" };
|
|
976
|
-
function yt(t, e, n,
|
|
977
|
-
const
|
|
976
|
+
function yt(t, e, n, o, r, s) {
|
|
977
|
+
const a = B("HumanAvatar"), d = B("AIAvatar"), v = B("TeamAvatars");
|
|
978
978
|
return l(), c("div", ct, [
|
|
979
979
|
n.showBack ? (l(), c("button", {
|
|
980
980
|
key: 0,
|
|
@@ -999,7 +999,7 @@ function yt(t, e, n, a, r, s) {
|
|
|
999
999
|
])])) : (l(), c("div", ut)),
|
|
1000
1000
|
n.showIdentity ? (l(), c(M, { key: 2 }, [
|
|
1001
1001
|
i("div", ht, [
|
|
1002
|
-
n.escalated ? (l(), L(
|
|
1002
|
+
n.escalated ? (l(), L(a, {
|
|
1003
1003
|
key: 0,
|
|
1004
1004
|
name: n.agentName,
|
|
1005
1005
|
"avatar-url": n.agentAvatarUrl,
|
|
@@ -1010,7 +1010,7 @@ function yt(t, e, n, a, r, s) {
|
|
|
1010
1010
|
}))
|
|
1011
1011
|
]),
|
|
1012
1012
|
i("div", mt, [
|
|
1013
|
-
i("div", ft,
|
|
1013
|
+
i("div", ft, b(n.title), 1),
|
|
1014
1014
|
s.showPresence ? (l(), c("div", _t, [
|
|
1015
1015
|
s.hasTeam ? (l(), L(v, {
|
|
1016
1016
|
key: 0,
|
|
@@ -1019,7 +1019,7 @@ function yt(t, e, n, a, r, s) {
|
|
|
1019
1019
|
}, null, 8, ["members", "response-label"])) : y("", !0),
|
|
1020
1020
|
i("span", pt, [
|
|
1021
1021
|
e[4] || (e[4] = i("span", { class: "wm-header__dot" }, null, -1)),
|
|
1022
|
-
te(" " +
|
|
1022
|
+
te(" " + b(s.statusText), 1)
|
|
1023
1023
|
])
|
|
1024
1024
|
])) : y("", !0)
|
|
1025
1025
|
])
|
|
@@ -1134,16 +1134,16 @@ Je réponds en quelques secondes.`;
|
|
|
1134
1134
|
class: "wm-onb__resume-dot",
|
|
1135
1135
|
"aria-label": "Non lu"
|
|
1136
1136
|
}, Dt = { class: "wm-onb__resume-body" }, Nt = { class: "wm-onb__resume-title" }, jt = { class: "wm-onb__resume-preview" }, Ut = { class: "wm-onb__cta" }, Pt = ["disabled"];
|
|
1137
|
-
function Ht(t, e, n,
|
|
1138
|
-
const
|
|
1137
|
+
function Ht(t, e, n, o, r, s) {
|
|
1138
|
+
const a = B("AIAvatar");
|
|
1139
1139
|
return l(), c("div", kt, [
|
|
1140
1140
|
i("div", Ct, [
|
|
1141
|
-
K(
|
|
1141
|
+
K(a, {
|
|
1142
1142
|
size: 56,
|
|
1143
1143
|
pulse: !0
|
|
1144
1144
|
}),
|
|
1145
|
-
i("div", At,
|
|
1146
|
-
i("div", St,
|
|
1145
|
+
i("div", At, b(s.heroTitle), 1),
|
|
1146
|
+
i("div", St, b(s.heroSub), 1)
|
|
1147
1147
|
]),
|
|
1148
1148
|
n.quickLinks.length ? (l(), c("div", xt, [
|
|
1149
1149
|
e[3] || (e[3] = i("div", { class: "wm-onb__section-title" }, "Accès rapide", -1)),
|
|
@@ -1161,7 +1161,7 @@ function Ht(t, e, n, a, r, s) {
|
|
|
1161
1161
|
}, null, 8, Bt)
|
|
1162
1162
|
]))
|
|
1163
1163
|
]),
|
|
1164
|
-
i("span", Et,
|
|
1164
|
+
i("span", Et, b(d.label), 1),
|
|
1165
1165
|
e[2] || (e[2] = i("svg", {
|
|
1166
1166
|
width: "13",
|
|
1167
1167
|
height: "13",
|
|
@@ -1207,8 +1207,8 @@ function Ht(t, e, n, a, r, s) {
|
|
|
1207
1207
|
d.unread ? (l(), c("span", Ft)) : y("", !0)
|
|
1208
1208
|
], 2),
|
|
1209
1209
|
i("span", Dt, [
|
|
1210
|
-
i("span", Nt,
|
|
1211
|
-
i("span", jt,
|
|
1210
|
+
i("span", Nt, b(d.title), 1),
|
|
1211
|
+
i("span", jt, b(d.preview), 1)
|
|
1212
1212
|
]),
|
|
1213
1213
|
e[5] || (e[5] = i("svg", {
|
|
1214
1214
|
width: "13",
|
|
@@ -1253,7 +1253,7 @@ function Ht(t, e, n, a, r, s) {
|
|
|
1253
1253
|
class: "wm-onb__startBtn",
|
|
1254
1254
|
disabled: n.busy,
|
|
1255
1255
|
onClick: e[1] || (e[1] = (d) => t.$emit("start"))
|
|
1256
|
-
},
|
|
1256
|
+
}, b(n.busy ? "…" : "Commencer une conversation"), 9, Pt)
|
|
1257
1257
|
])
|
|
1258
1258
|
]);
|
|
1259
1259
|
}
|
|
@@ -1318,7 +1318,7 @@ const qt = {
|
|
|
1318
1318
|
"stroke-linecap": "round",
|
|
1319
1319
|
"stroke-linejoin": "round"
|
|
1320
1320
|
}, Xt = { class: "wm-result__body" }, Zt = { class: "wm-result__label" }, Qt = { class: "wm-result__detail" };
|
|
1321
|
-
function en(t, e, n,
|
|
1321
|
+
function en(t, e, n, o, r, s) {
|
|
1322
1322
|
return l(), c("div", {
|
|
1323
1323
|
class: E(["wm-result", `wm-result--${n.state}`])
|
|
1324
1324
|
}, [
|
|
@@ -1351,13 +1351,13 @@ function en(t, e, n, a, r, s) {
|
|
|
1351
1351
|
])]))
|
|
1352
1352
|
]),
|
|
1353
1353
|
i("span", Xt, [
|
|
1354
|
-
i("span", Zt,
|
|
1354
|
+
i("span", Zt, b(n.label), 1),
|
|
1355
1355
|
s.detailText ? (l(), c(M, { key: 0 }, [
|
|
1356
1356
|
e[4] || (e[4] = i("span", {
|
|
1357
1357
|
class: "wm-result__sep",
|
|
1358
1358
|
"aria-hidden": "true"
|
|
1359
1359
|
}, " · ", -1)),
|
|
1360
|
-
i("span", Qt,
|
|
1360
|
+
i("span", Qt, b(s.detailText), 1)
|
|
1361
1361
|
], 64)) : y("", !0)
|
|
1362
1362
|
])
|
|
1363
1363
|
], 2);
|
|
@@ -1374,10 +1374,10 @@ const tn = /* @__PURE__ */ $(qt, [["render", en], ["__scopeId", "data-v-64a83fb8
|
|
|
1374
1374
|
}
|
|
1375
1375
|
}
|
|
1376
1376
|
}, sn = { class: "wm-art wm-art--formResponse" }, rn = { class: "wm-art__head" }, an = { class: "wm-art__title" }, on = { class: "wm-art__body" }, ln = { class: "wm-art__fieldLabel" };
|
|
1377
|
-
function dn(t, e, n,
|
|
1377
|
+
function dn(t, e, n, o, r, s) {
|
|
1378
1378
|
return l(), c("div", sn, [
|
|
1379
1379
|
i("div", rn, [
|
|
1380
|
-
i("div", an,
|
|
1380
|
+
i("div", an, b(n.data.title || "Formulaire"), 1),
|
|
1381
1381
|
e[0] || (e[0] = i("span", { class: "wm-art__badge wm-art__badge--success" }, [
|
|
1382
1382
|
i("svg", {
|
|
1383
1383
|
width: "11",
|
|
@@ -1396,14 +1396,14 @@ function dn(t, e, n, a, r, s) {
|
|
|
1396
1396
|
], -1))
|
|
1397
1397
|
]),
|
|
1398
1398
|
i("div", on, [
|
|
1399
|
-
(l(!0), c(M, null, D(s.fields, (
|
|
1399
|
+
(l(!0), c(M, null, D(s.fields, (a, d) => (l(), c("div", {
|
|
1400
1400
|
key: d,
|
|
1401
1401
|
class: "wm-art__field"
|
|
1402
1402
|
}, [
|
|
1403
|
-
i("div", ln,
|
|
1403
|
+
i("div", ln, b(a.label), 1),
|
|
1404
1404
|
i("div", {
|
|
1405
|
-
class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi":
|
|
1406
|
-
},
|
|
1405
|
+
class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": a.multiline }])
|
|
1406
|
+
}, b(a.value), 3)
|
|
1407
1407
|
]))), 128))
|
|
1408
1408
|
])
|
|
1409
1409
|
]);
|
|
@@ -1436,7 +1436,7 @@ const cn = /* @__PURE__ */ $(nn, [["render", dn], ["__scopeId", "data-v-ca24a9c9
|
|
|
1436
1436
|
key: 0,
|
|
1437
1437
|
class: "wm-art__text"
|
|
1438
1438
|
}, bn = { class: "wm-art__fieldLabel" };
|
|
1439
|
-
function kn(t, e, n,
|
|
1439
|
+
function kn(t, e, n, o, r, s) {
|
|
1440
1440
|
return l(), c("div", hn, [
|
|
1441
1441
|
n.data.image_url ? (l(), c("figure", mn, [
|
|
1442
1442
|
i("img", {
|
|
@@ -1447,24 +1447,24 @@ function kn(t, e, n, a, r, s) {
|
|
|
1447
1447
|
])) : y("", !0),
|
|
1448
1448
|
i("div", _n, [
|
|
1449
1449
|
i("div", pn, [
|
|
1450
|
-
i("div", vn,
|
|
1451
|
-
n.data.subtitle ? (l(), c("div", gn,
|
|
1450
|
+
i("div", vn, b(n.data.title), 1),
|
|
1451
|
+
n.data.subtitle ? (l(), c("div", gn, b(n.data.subtitle), 1)) : y("", !0)
|
|
1452
1452
|
]),
|
|
1453
1453
|
n.data.badge && n.data.badge.label ? (l(), c("span", {
|
|
1454
1454
|
key: 0,
|
|
1455
1455
|
class: E(["wm-art__badge", `wm-art__badge--${n.data.badge.tone || "neutral"}`])
|
|
1456
|
-
},
|
|
1456
|
+
}, b(n.data.badge.label), 3)) : y("", !0)
|
|
1457
1457
|
]),
|
|
1458
1458
|
s.hasBody ? (l(), c("div", yn, [
|
|
1459
|
-
n.data.body ? (l(), c("div", wn,
|
|
1460
|
-
s.fields.length ? (l(!0), c(M, { key: 1 }, D(s.fields, (
|
|
1459
|
+
n.data.body ? (l(), c("div", wn, b(n.data.body), 1)) : y("", !0),
|
|
1460
|
+
s.fields.length ? (l(!0), c(M, { key: 1 }, D(s.fields, (a, d) => (l(), c("div", {
|
|
1461
1461
|
key: d,
|
|
1462
1462
|
class: "wm-art__field"
|
|
1463
1463
|
}, [
|
|
1464
|
-
i("div", bn,
|
|
1464
|
+
i("div", bn, b(a.label), 1),
|
|
1465
1465
|
i("div", {
|
|
1466
|
-
class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi":
|
|
1467
|
-
},
|
|
1466
|
+
class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": a.multiline }])
|
|
1467
|
+
}, b(a.value), 3)
|
|
1468
1468
|
]))), 128)) : y("", !0)
|
|
1469
1469
|
])) : y("", !0)
|
|
1470
1470
|
]);
|
|
@@ -1474,8 +1474,8 @@ function An(t) {
|
|
|
1474
1474
|
if (!t) return "";
|
|
1475
1475
|
const e = new Date(t);
|
|
1476
1476
|
if (Number.isNaN(e.getTime())) return t;
|
|
1477
|
-
const n = e.toLocaleDateString("fr-FR", { day: "numeric", month: "long", year: "numeric" }),
|
|
1478
|
-
return `${n} à ${
|
|
1477
|
+
const n = e.toLocaleDateString("fr-FR", { day: "numeric", month: "long", year: "numeric" }), o = e.toLocaleTimeString("fr-FR", { hour: "2-digit", minute: "2-digit" });
|
|
1478
|
+
return `${n} à ${o}`;
|
|
1479
1479
|
}
|
|
1480
1480
|
const Sn = {
|
|
1481
1481
|
name: "WmArtifactTicket",
|
|
@@ -1533,10 +1533,10 @@ const Sn = {
|
|
|
1533
1533
|
key: 1,
|
|
1534
1534
|
class: "wm-art__footer wm-tk__footer"
|
|
1535
1535
|
};
|
|
1536
|
-
function Dn(t, e, n,
|
|
1536
|
+
function Dn(t, e, n, o, r, s) {
|
|
1537
1537
|
return l(), c("div", xn, [
|
|
1538
1538
|
i("div", Tn, [
|
|
1539
|
-
i("div", Mn,
|
|
1539
|
+
i("div", Mn, b(n.data.title), 1),
|
|
1540
1540
|
i("div", On, [
|
|
1541
1541
|
i("div", In, [
|
|
1542
1542
|
e[0] || (e[0] = i("svg", {
|
|
@@ -1553,7 +1553,7 @@ function Dn(t, e, n, a, r, s) {
|
|
|
1553
1553
|
i("path", { d: "M20 12a2 2 0 0 1 2-2V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v4a2 2 0 0 1 0 4v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 1-2-2z" }),
|
|
1554
1554
|
i("path", { d: "M13 5v2M13 17v2M13 11v2" })
|
|
1555
1555
|
], -1)),
|
|
1556
|
-
i("span", null,
|
|
1556
|
+
i("span", null, b(n.data.reference), 1)
|
|
1557
1557
|
]),
|
|
1558
1558
|
i("span", {
|
|
1559
1559
|
class: E(["wm-art__badge", "wm-tk__badge", `wm-art__badge--${n.data.status.tone || "neutral"}`])
|
|
@@ -1562,24 +1562,24 @@ function Dn(t, e, n, a, r, s) {
|
|
|
1562
1562
|
class: "wm-tk__dot",
|
|
1563
1563
|
"aria-hidden": "true"
|
|
1564
1564
|
}, null, -1)),
|
|
1565
|
-
te(" " +
|
|
1565
|
+
te(" " + b(n.data.status.label), 1)
|
|
1566
1566
|
], 2)
|
|
1567
1567
|
]),
|
|
1568
|
-
n.data.body ? (l(), c("div", Bn,
|
|
1568
|
+
n.data.body ? (l(), c("div", Bn, b(n.data.body), 1)) : y("", !0)
|
|
1569
1569
|
]),
|
|
1570
1570
|
s.fields.length ? (l(), c("div", En, [
|
|
1571
|
-
(l(!0), c(M, null, D(s.fields, (
|
|
1571
|
+
(l(!0), c(M, null, D(s.fields, (a, d) => (l(), c("div", {
|
|
1572
1572
|
key: d,
|
|
1573
1573
|
class: "wm-art__field"
|
|
1574
1574
|
}, [
|
|
1575
|
-
i("div", $n,
|
|
1575
|
+
i("div", $n, b(a.label), 1),
|
|
1576
1576
|
i("div", {
|
|
1577
|
-
class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi":
|
|
1577
|
+
class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": a.multiline }])
|
|
1578
1578
|
}, [
|
|
1579
|
-
s.isPriority(
|
|
1579
|
+
s.isPriority(a.label) ? (l(), c("svg", {
|
|
1580
1580
|
key: 0,
|
|
1581
1581
|
class: "wm-tk__prio",
|
|
1582
|
-
"data-level": s.priorityLevel(
|
|
1582
|
+
"data-level": s.priorityLevel(a.value),
|
|
1583
1583
|
width: "12",
|
|
1584
1584
|
height: "12",
|
|
1585
1585
|
viewBox: "0 0 12 12",
|
|
@@ -1606,7 +1606,7 @@ function Dn(t, e, n, a, r, s) {
|
|
|
1606
1606
|
height: "9",
|
|
1607
1607
|
rx: "0.5"
|
|
1608
1608
|
}, null, -1)
|
|
1609
|
-
])], 8, Ln)) : s.isDate(
|
|
1609
|
+
])], 8, Ln)) : s.isDate(a.label) ? (l(), c("svg", Rn, [...e[3] || (e[3] = [
|
|
1610
1610
|
i("rect", {
|
|
1611
1611
|
x: "3",
|
|
1612
1612
|
y: "4",
|
|
@@ -1616,7 +1616,7 @@ function Dn(t, e, n, a, r, s) {
|
|
|
1616
1616
|
}, null, -1),
|
|
1617
1617
|
i("path", { d: "M16 2v4M8 2v4M3 10h18" }, null, -1)
|
|
1618
1618
|
])])) : y("", !0),
|
|
1619
|
-
i("span", null,
|
|
1619
|
+
i("span", null, b(a.value), 1)
|
|
1620
1620
|
], 2)
|
|
1621
1621
|
]))), 128))
|
|
1622
1622
|
])) : y("", !0),
|
|
@@ -1641,7 +1641,7 @@ function Dn(t, e, n, a, r, s) {
|
|
|
1641
1641
|
}),
|
|
1642
1642
|
i("path", { d: "M16 2v4M8 2v4M3 10h18" })
|
|
1643
1643
|
], -1)),
|
|
1644
|
-
i("span", null,
|
|
1644
|
+
i("span", null, b(s.formattedDate), 1)
|
|
1645
1645
|
])) : y("", !0)
|
|
1646
1646
|
]);
|
|
1647
1647
|
}
|
|
@@ -1664,7 +1664,7 @@ const Nn = /* @__PURE__ */ $(Sn, [["render", Dn], ["__scopeId", "data-v-8b274eb7
|
|
|
1664
1664
|
}
|
|
1665
1665
|
}
|
|
1666
1666
|
};
|
|
1667
|
-
function Pn(t, e, n,
|
|
1667
|
+
function Pn(t, e, n, o, r, s) {
|
|
1668
1668
|
return s.component ? (l(), L(Me(s.component), {
|
|
1669
1669
|
key: 0,
|
|
1670
1670
|
data: n.artifact.data
|
|
@@ -1683,10 +1683,10 @@ const Hn = /* @__PURE__ */ $(Un, [["render", Pn]]), zn = {
|
|
|
1683
1683
|
},
|
|
1684
1684
|
computed: {
|
|
1685
1685
|
kind() {
|
|
1686
|
-
var n,
|
|
1686
|
+
var n, o;
|
|
1687
1687
|
const t = (n = this.attachment) == null ? void 0 : n.type;
|
|
1688
1688
|
if (t) return t;
|
|
1689
|
-
const e = (((
|
|
1689
|
+
const e = (((o = this.attachment) == null ? void 0 : o.mime_type) || "").toLowerCase();
|
|
1690
1690
|
return e.startsWith("image/") ? "image" : e.startsWith("audio/") ? "audio" : e.startsWith("video/") ? "video" : "file";
|
|
1691
1691
|
},
|
|
1692
1692
|
displayName() {
|
|
@@ -1732,7 +1732,7 @@ const Hn = /* @__PURE__ */ $(Un, [["render", Pn]]), zn = {
|
|
|
1732
1732
|
class: "wm-att__spin",
|
|
1733
1733
|
"aria-hidden": "true"
|
|
1734
1734
|
};
|
|
1735
|
-
function Qn(t, e, n,
|
|
1735
|
+
function Qn(t, e, n, o, r, s) {
|
|
1736
1736
|
return l(), c("div", {
|
|
1737
1737
|
class: E(["wm-att", ["wm-att--" + (s.kind || "file")]])
|
|
1738
1738
|
}, [
|
|
@@ -1765,7 +1765,7 @@ function Qn(t, e, n, a, r, s) {
|
|
|
1765
1765
|
download: s.displayName,
|
|
1766
1766
|
target: "_blank",
|
|
1767
1767
|
rel: "noopener",
|
|
1768
|
-
onClick: e[0] || (e[0] = (...
|
|
1768
|
+
onClick: e[0] || (e[0] = (...a) => s.onFileClick && s.onFileClick(...a))
|
|
1769
1769
|
}, [
|
|
1770
1770
|
e[1] || (e[1] = i("span", { class: "wm-att__icon" }, [
|
|
1771
1771
|
i("svg", {
|
|
@@ -1784,8 +1784,8 @@ function Qn(t, e, n, a, r, s) {
|
|
|
1784
1784
|
])
|
|
1785
1785
|
], -1)),
|
|
1786
1786
|
i("span", Yn, [
|
|
1787
|
-
i("span", Jn,
|
|
1788
|
-
s.sizeLabel ? (l(), c("span", Xn,
|
|
1787
|
+
i("span", Jn, b(s.displayName), 1),
|
|
1788
|
+
s.sizeLabel ? (l(), c("span", Xn, b(s.sizeLabel), 1)) : y("", !0)
|
|
1789
1789
|
]),
|
|
1790
1790
|
r.loading ? (l(), c("span", Zn)) : y("", !0)
|
|
1791
1791
|
], 8, Gn))
|
|
@@ -1802,24 +1802,24 @@ const pe = "";
|
|
|
1802
1802
|
function re(t) {
|
|
1803
1803
|
let e = t;
|
|
1804
1804
|
const n = [];
|
|
1805
|
-
return e = e.replace(/`([^`\n]+)`/g, (
|
|
1805
|
+
return e = e.replace(/`([^`\n]+)`/g, (o, r) => {
|
|
1806
1806
|
const s = n.length;
|
|
1807
1807
|
return n.push(r), `${pe}CODE${s}${pe}`;
|
|
1808
|
-
}), e = e.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (
|
|
1808
|
+
}), e = e.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (o, r, s) => ns(s) ? `<a href="${s}" target="_blank" rel="noopener noreferrer">${r}</a>` : r), e = e.replace(/\*\*([^\n*][^\n]*?)\*\*/g, "<strong>$1</strong>"), e = e.replace(/__([^\n_][^\n]*?)__/g, "<u>$1</u>"), e = e.replace(/~~([^\n~][^\n]*?)~~/g, "<s>$1</s>"), e = e.replace(/(^|[^\w*])\*([^\n*]+?)\*(?!\w)/g, "$1<em>$2</em>"), e = e.replace(/(^|[^\w_])_([^\n_]+?)_(?!\w)/g, "$1<em>$2</em>"), e = e.replace(/CODE(\d+)/g, (o, r) => `<code class="wm-md-code">${n[+r]}</code>`), e;
|
|
1809
1809
|
}
|
|
1810
1810
|
function ss(t) {
|
|
1811
1811
|
if (!t) return "";
|
|
1812
1812
|
const e = ts(t).split(`
|
|
1813
1813
|
`), n = [];
|
|
1814
|
-
let
|
|
1815
|
-
for (;
|
|
1816
|
-
const s = e[
|
|
1814
|
+
let o = 0;
|
|
1815
|
+
for (; o < e.length; ) {
|
|
1816
|
+
const s = e[o];
|
|
1817
1817
|
if (/^\s*```([\w-]*)\s*$/.exec(s)) {
|
|
1818
|
-
|
|
1818
|
+
o++;
|
|
1819
1819
|
const k = [];
|
|
1820
|
-
for (;
|
|
1821
|
-
k.push(e[
|
|
1822
|
-
|
|
1820
|
+
for (; o < e.length && !/^\s*```\s*$/.test(e[o]); )
|
|
1821
|
+
k.push(e[o]), o++;
|
|
1822
|
+
o < e.length && o++, n.push({
|
|
1823
1823
|
type: "block",
|
|
1824
1824
|
html: `<pre class="wm-md-pre"><code>${k.join(`
|
|
1825
1825
|
`)}</code></pre>`
|
|
@@ -1828,24 +1828,24 @@ function ss(t) {
|
|
|
1828
1828
|
}
|
|
1829
1829
|
if (/^\s*[-*]\s+/.test(s)) {
|
|
1830
1830
|
const k = [];
|
|
1831
|
-
for (;
|
|
1832
|
-
const S = /^\s*[-*]\s+(.*)$/.exec(e[
|
|
1831
|
+
for (; o < e.length; ) {
|
|
1832
|
+
const S = /^\s*[-*]\s+(.*)$/.exec(e[o]);
|
|
1833
1833
|
if (!S) break;
|
|
1834
|
-
k.push(S[1]),
|
|
1834
|
+
k.push(S[1]), o++;
|
|
1835
1835
|
}
|
|
1836
|
-
const
|
|
1837
|
-
n.push({ type: "block", html: `<ul class="wm-md-ul">${
|
|
1836
|
+
const w = k.map((S) => `<li>${re(S)}</li>`).join("");
|
|
1837
|
+
n.push({ type: "block", html: `<ul class="wm-md-ul">${w}</ul>` });
|
|
1838
1838
|
continue;
|
|
1839
1839
|
}
|
|
1840
1840
|
const d = /^\s*(\d+)\.\s+(.*)$/.exec(s);
|
|
1841
1841
|
if (d) {
|
|
1842
|
-
const k = parseInt(d[1], 10),
|
|
1843
|
-
for (
|
|
1844
|
-
const A = /^\s*\d+\.\s+(.*)$/.exec(e[
|
|
1842
|
+
const k = parseInt(d[1], 10), w = [d[2]];
|
|
1843
|
+
for (o++; o < e.length; ) {
|
|
1844
|
+
const A = /^\s*\d+\.\s+(.*)$/.exec(e[o]);
|
|
1845
1845
|
if (!A) break;
|
|
1846
|
-
|
|
1846
|
+
w.push(A[1]), o++;
|
|
1847
1847
|
}
|
|
1848
|
-
const S =
|
|
1848
|
+
const S = w.map((A) => `<li>${re(A)}</li>`).join(""), F = k !== 1 ? ` start="${k}"` : "";
|
|
1849
1849
|
n.push({ type: "block", html: `<ol class="wm-md-ol"${F}>${S}</ol>` });
|
|
1850
1850
|
continue;
|
|
1851
1851
|
}
|
|
@@ -1855,17 +1855,17 @@ function ss(t) {
|
|
|
1855
1855
|
n.push({
|
|
1856
1856
|
type: "block",
|
|
1857
1857
|
html: `<h${k} class="wm-md-h wm-md-h${k}">${re(v[2])}</h${k}>`
|
|
1858
|
-
}),
|
|
1858
|
+
}), o++;
|
|
1859
1859
|
continue;
|
|
1860
1860
|
}
|
|
1861
|
-
n.push({ type: "text", html: re(s) }),
|
|
1861
|
+
n.push({ type: "text", html: re(s) }), o++;
|
|
1862
1862
|
}
|
|
1863
1863
|
let r = "";
|
|
1864
1864
|
for (let s = 0; s < n.length; s++) {
|
|
1865
|
-
const
|
|
1866
|
-
r +=
|
|
1865
|
+
const a = n[s];
|
|
1866
|
+
r += a.html;
|
|
1867
1867
|
const d = n[s + 1];
|
|
1868
|
-
d &&
|
|
1868
|
+
d && a.type !== "block" && d.type !== "block" && (r += `
|
|
1869
1869
|
`);
|
|
1870
1870
|
}
|
|
1871
1871
|
return r;
|
|
@@ -1883,7 +1883,7 @@ const rs = {
|
|
|
1883
1883
|
}
|
|
1884
1884
|
}
|
|
1885
1885
|
}, is = ["innerHTML"];
|
|
1886
|
-
function as(t, e, n,
|
|
1886
|
+
function as(t, e, n, o, r, s) {
|
|
1887
1887
|
return l(), c("div", {
|
|
1888
1888
|
class: E(["wm-bubble", "wm-bubble--" + n.role])
|
|
1889
1889
|
}, [
|
|
@@ -1893,7 +1893,7 @@ function as(t, e, n, a, r, s) {
|
|
|
1893
1893
|
], 2);
|
|
1894
1894
|
}
|
|
1895
1895
|
const os = /* @__PURE__ */ $(rs, [["render", as], ["__scopeId", "data-v-5c9e9f2b"]]), ls = { name: "WmTyping" }, ds = { class: "wm-typing" };
|
|
1896
|
-
function cs(t, e, n,
|
|
1896
|
+
function cs(t, e, n, o, r, s) {
|
|
1897
1897
|
return l(), c("div", ds, [...e[0] || (e[0] = [
|
|
1898
1898
|
i("span", { style: { "animation-delay": "0s" } }, null, -1),
|
|
1899
1899
|
i("span", { style: { "animation-delay": "0.2s" } }, null, -1),
|
|
@@ -1958,50 +1958,60 @@ const hs = {
|
|
|
1958
1958
|
return !this.hasMore && !this.loadingMore && this.messages.length >= 20;
|
|
1959
1959
|
},
|
|
1960
1960
|
groups() {
|
|
1961
|
-
var
|
|
1961
|
+
var n, o, r, s;
|
|
1962
1962
|
const t = [];
|
|
1963
|
-
for (const
|
|
1964
|
-
const
|
|
1965
|
-
if (
|
|
1966
|
-
if (((
|
|
1967
|
-
const
|
|
1968
|
-
|
|
1969
|
-
key: `g-${ee(
|
|
1963
|
+
for (const a of this.messages) {
|
|
1964
|
+
const d = this.roleOf(a);
|
|
1965
|
+
if (d === "system") {
|
|
1966
|
+
if (((n = a == null ? void 0 : a.payload) == null ? void 0 : n.event) === "action_admin_pending") {
|
|
1967
|
+
const w = t[t.length - 1];
|
|
1968
|
+
w && w.role === "ai" ? w.messages.push(a) : t.push({
|
|
1969
|
+
key: `g-${ee(a)}`,
|
|
1970
1970
|
role: "ai",
|
|
1971
1971
|
agentName: "",
|
|
1972
1972
|
agentAvatarUrl: null,
|
|
1973
|
-
messages: [
|
|
1973
|
+
messages: [a],
|
|
1974
1974
|
items: []
|
|
1975
1975
|
});
|
|
1976
1976
|
continue;
|
|
1977
1977
|
}
|
|
1978
1978
|
t.push({
|
|
1979
|
-
key: `sys-${ee(
|
|
1980
|
-
role:
|
|
1981
|
-
messages: [
|
|
1979
|
+
key: `sys-${ee(a)}`,
|
|
1980
|
+
role: d,
|
|
1981
|
+
messages: [a],
|
|
1982
1982
|
items: [],
|
|
1983
|
-
systemLabel: this.systemLabel(
|
|
1983
|
+
systemLabel: this.systemLabel(a)
|
|
1984
1984
|
});
|
|
1985
1985
|
continue;
|
|
1986
1986
|
}
|
|
1987
|
-
const
|
|
1988
|
-
|
|
1989
|
-
key: `g-${ee(
|
|
1990
|
-
role:
|
|
1991
|
-
agentName: ((
|
|
1992
|
-
agentAvatarUrl: ((
|
|
1993
|
-
messages: [
|
|
1987
|
+
const v = t[t.length - 1];
|
|
1988
|
+
v && v.role === d && (d === "ai" || v.agentName === (((o = a == null ? void 0 : a.author) == null ? void 0 : o.name) || "")) ? v.messages.push(a) : t.push({
|
|
1989
|
+
key: `g-${ee(a)}`,
|
|
1990
|
+
role: d,
|
|
1991
|
+
agentName: ((r = a == null ? void 0 : a.author) == null ? void 0 : r.name) || "",
|
|
1992
|
+
agentAvatarUrl: ((s = a == null ? void 0 : a.author) == null ? void 0 : s.avatar_url) || null,
|
|
1993
|
+
messages: [a],
|
|
1994
1994
|
items: []
|
|
1995
1995
|
});
|
|
1996
1996
|
}
|
|
1997
|
-
for (const
|
|
1998
|
-
if (
|
|
1999
|
-
const
|
|
2000
|
-
for (const
|
|
2001
|
-
for (const
|
|
2002
|
-
|
|
1997
|
+
for (const a of t) {
|
|
1998
|
+
if (a.role === "system") continue;
|
|
1999
|
+
const d = [];
|
|
2000
|
+
for (const v of a.messages)
|
|
2001
|
+
for (const k of this.itemsOf(v)) d.push(k);
|
|
2002
|
+
a.items = d;
|
|
2003
2003
|
}
|
|
2004
|
-
|
|
2004
|
+
const e = [];
|
|
2005
|
+
for (const a of t) {
|
|
2006
|
+
if (a.role !== "system" && !a.items.length) continue;
|
|
2007
|
+
const d = e[e.length - 1];
|
|
2008
|
+
if (d && d.role !== "system" && d.role === a.role && (a.role === "ai" || d.agentName === a.agentName)) {
|
|
2009
|
+
d.messages.push(...a.messages), d.items.push(...a.items);
|
|
2010
|
+
continue;
|
|
2011
|
+
}
|
|
2012
|
+
e.push(a);
|
|
2013
|
+
}
|
|
2014
|
+
return e;
|
|
2005
2015
|
},
|
|
2006
2016
|
// Key of the first non-user group that starts after the unread anchor.
|
|
2007
2017
|
// ISO 8601 timestamps sort lexicographically, so a string `>` compare
|
|
@@ -2072,18 +2082,18 @@ const hs = {
|
|
|
2072
2082
|
const e = this._lastSeenConvId !== this.conversationId;
|
|
2073
2083
|
this._lastSeenConvId = this.conversationId;
|
|
2074
2084
|
const n = this.isAtBottom(t);
|
|
2075
|
-
let
|
|
2085
|
+
let o = null;
|
|
2076
2086
|
if (!e && !n) {
|
|
2077
2087
|
const s = this.pickAnchor(t);
|
|
2078
2088
|
if (s != null && s.el) {
|
|
2079
|
-
const
|
|
2080
|
-
|
|
2089
|
+
const a = t.getBoundingClientRect().top;
|
|
2090
|
+
o = {
|
|
2081
2091
|
el: s.el,
|
|
2082
|
-
relY: s.el.getBoundingClientRect().top -
|
|
2092
|
+
relY: s.el.getBoundingClientRect().top - a
|
|
2083
2093
|
};
|
|
2084
2094
|
}
|
|
2085
2095
|
}
|
|
2086
|
-
const r = { forceBottom: e, wasPinned: n, anchor:
|
|
2096
|
+
const r = { forceBottom: e, wasPinned: n, anchor: o };
|
|
2087
2097
|
this._scrollSnap = r, this.$nextTick(() => {
|
|
2088
2098
|
if (this._scrollSnap = null, r.forceBottom || r.wasPinned) {
|
|
2089
2099
|
t.scrollTop = t.scrollHeight;
|
|
@@ -2092,9 +2102,9 @@ const hs = {
|
|
|
2092
2102
|
if (!r.anchor) return;
|
|
2093
2103
|
const s = () => {
|
|
2094
2104
|
var k;
|
|
2095
|
-
const
|
|
2096
|
-
if (!((k =
|
|
2097
|
-
const v =
|
|
2105
|
+
const a = r.anchor;
|
|
2106
|
+
if (!((k = a.el) != null && k.isConnected)) return;
|
|
2107
|
+
const v = a.el.getBoundingClientRect().top - t.getBoundingClientRect().top - a.relY;
|
|
2098
2108
|
Math.abs(v) > 0.5 && (t.scrollTop += v);
|
|
2099
2109
|
};
|
|
2100
2110
|
s(), requestAnimationFrame(() => {
|
|
@@ -2123,15 +2133,15 @@ const hs = {
|
|
|
2123
2133
|
pickAnchor(t) {
|
|
2124
2134
|
const e = t.scrollTop;
|
|
2125
2135
|
let n = null;
|
|
2126
|
-
for (const
|
|
2127
|
-
if (
|
|
2128
|
-
return { el:
|
|
2136
|
+
for (const o of t.children)
|
|
2137
|
+
if (o.classList.contains("wm-list__group") && (n || (n = o), o.offsetTop + o.offsetHeight >= e))
|
|
2138
|
+
return { el: o, offsetTop: o.offsetTop };
|
|
2129
2139
|
return n ? { el: n, offsetTop: n.offsetTop } : null;
|
|
2130
2140
|
},
|
|
2131
2141
|
roleOf(t) {
|
|
2132
|
-
var n,
|
|
2142
|
+
var n, o;
|
|
2133
2143
|
if ((t == null ? void 0 : t.type) === "system" || ((n = t == null ? void 0 : t.payload) == null ? void 0 : n.type) === "system") return "system";
|
|
2134
|
-
const e = (
|
|
2144
|
+
const e = (o = t == null ? void 0 : t.author) == null ? void 0 : o.type;
|
|
2135
2145
|
return e === "user" ? "user" : e === "agent_human" ? "human" : "ai";
|
|
2136
2146
|
},
|
|
2137
2147
|
roleLabel(t) {
|
|
@@ -2219,9 +2229,9 @@ const hs = {
|
|
|
2219
2229
|
// doit garder son arrondi.
|
|
2220
2230
|
cornersFor(t, e) {
|
|
2221
2231
|
var Y, z, Z;
|
|
2222
|
-
const n = t.items,
|
|
2232
|
+
const n = t.items, o = (Y = n[e]) == null ? void 0 : Y.kind, r = (z = n[e - 1]) == null ? void 0 : z.kind, s = (Z = n[e + 1]) == null ? void 0 : Z.kind, a = 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)], F = this.widthByKey[this.rowKeyOf(t, e - 1)], A = this.widthByKey[this.rowKeyOf(t, e + 1)], U = 0.5, x = (W, V, Q) => W != null && S != null ? W + U >= S : V === Q || V === "card" && Q === "bubble";
|
|
2223
2233
|
let j = d, P = d, R = d, H = d;
|
|
2224
|
-
return
|
|
2234
|
+
return a ? (k && (P = v), (w || !s) && (R = v), k && x(F, k, o == null ? void 0 : o.top) && (j = v), w && x(A, w, o == null ? void 0 : o.bottom) && (H = v)) : (k && (j = v), (w || !s) && (H = v), k && x(F, k, o == null ? void 0 : o.top) && (P = v), w && x(A, w, o == null ? void 0 : o.bottom) && (R = v)), { tl: j, tr: P, br: R, bl: H };
|
|
2225
2235
|
},
|
|
2226
2236
|
// Inline style emitting the four corner CSS variables. Set on
|
|
2227
2237
|
// `.wm-list__row` so they cascade to Bubble/ActionResult/
|
|
@@ -2240,8 +2250,8 @@ const hs = {
|
|
|
2240
2250
|
// Clé unique par item de cluster, alignée avec `:key` /
|
|
2241
2251
|
// `data-row-key` du template. Sert d'index dans `widthByKey`.
|
|
2242
2252
|
rowKeyOf(t, e) {
|
|
2243
|
-
var
|
|
2244
|
-
const n = (
|
|
2253
|
+
var o;
|
|
2254
|
+
const n = (o = t == null ? void 0 : t.items) == null ? void 0 : o[e];
|
|
2245
2255
|
return n ? `${ee(n.message)}-${n.partKey}` : "";
|
|
2246
2256
|
},
|
|
2247
2257
|
// rAF-debouncé : `updated()` peut être appelé en rafale (stream,
|
|
@@ -2260,18 +2270,18 @@ const hs = {
|
|
|
2260
2270
|
if (!t) return;
|
|
2261
2271
|
const e = {};
|
|
2262
2272
|
for (const s of t.querySelectorAll(".wm-list__row[data-row-key]")) {
|
|
2263
|
-
const
|
|
2264
|
-
if (!
|
|
2273
|
+
const a = s.dataset.rowKey;
|
|
2274
|
+
if (!a) continue;
|
|
2265
2275
|
const d = s.querySelector(".wm-bubble, .wm-result, .wm-art, .wm-list__body");
|
|
2266
2276
|
if (!d) continue;
|
|
2267
2277
|
const v = d.getBoundingClientRect().width;
|
|
2268
|
-
v > 0 && (e[
|
|
2278
|
+
v > 0 && (e[a] = v);
|
|
2269
2279
|
}
|
|
2270
|
-
const n = this.widthByKey,
|
|
2271
|
-
if (
|
|
2280
|
+
const n = this.widthByKey, o = Object.keys(n), r = Object.keys(e);
|
|
2281
|
+
if (o.length === r.length) {
|
|
2272
2282
|
let s = !0;
|
|
2273
|
-
for (const
|
|
2274
|
-
if (Math.abs((n[
|
|
2283
|
+
for (const a of r)
|
|
2284
|
+
if (Math.abs((n[a] ?? 0) - e[a]) > 0.5) {
|
|
2275
2285
|
s = !1;
|
|
2276
2286
|
break;
|
|
2277
2287
|
}
|
|
@@ -2316,19 +2326,19 @@ const hs = {
|
|
|
2316
2326
|
return ((e = t == null ? void 0 : t.payload) == null ? void 0 : e.name) || (t == null ? void 0 : t.text_md) || "Action";
|
|
2317
2327
|
},
|
|
2318
2328
|
actionDetail(t) {
|
|
2319
|
-
var n,
|
|
2329
|
+
var n, o, r, s, a, d;
|
|
2320
2330
|
const e = t == null ? void 0 : t.payload;
|
|
2321
|
-
return e ? e.state === "success" ? ((n = e.success) == null ? void 0 : n.summary) || ((r = (
|
|
2331
|
+
return e ? e.state === "success" ? ((n = e.success) == null ? void 0 : n.summary) || ((r = (o = e.success) == null ? void 0 : o.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" && (((a = e.failure) == null ? void 0 : a.summary) || ((d = e.failure) == null ? void 0 : d.error)) || "" : "";
|
|
2322
2332
|
},
|
|
2323
2333
|
actionArtifact(t) {
|
|
2324
|
-
var n,
|
|
2325
|
-
const e = (
|
|
2334
|
+
var n, o;
|
|
2335
|
+
const e = (o = (n = t == null ? void 0 : t.payload) == null ? void 0 : n.success) == null ? void 0 : o.artifact;
|
|
2326
2336
|
return !e || typeof e != "object" || typeof e.kind != "string" ? null : e;
|
|
2327
2337
|
},
|
|
2328
2338
|
systemLabel(t) {
|
|
2329
|
-
var r, s,
|
|
2330
|
-
const e = (r = t == null ? void 0 : t.payload) == null ? void 0 : r.event, n = hs[e] || (t == null ? void 0 : t.text_md) || "Mise à jour de la conversation",
|
|
2331
|
-
return n.replace("{name}",
|
|
2339
|
+
var r, s, a;
|
|
2340
|
+
const e = (r = t == null ? void 0 : t.payload) == null ? void 0 : r.event, n = hs[e] || (t == null ? void 0 : t.text_md) || "Mise à jour de la conversation", o = ((s = t == null ? void 0 : t.metadata) == null ? void 0 : s.agent_name) || ((a = t == null ? void 0 : t.author) == null ? void 0 : a.name) || "";
|
|
2341
|
+
return n.replace("{name}", o || "Un agent");
|
|
2332
2342
|
},
|
|
2333
2343
|
scrollToBottom() {
|
|
2334
2344
|
const t = this.$refs.scrollEl;
|
|
@@ -2365,8 +2375,8 @@ const hs = {
|
|
|
2365
2375
|
key: 3,
|
|
2366
2376
|
class: "wm-list__row wm-list__row--ai fade-up"
|
|
2367
2377
|
}, Is = { class: "wm-list__avatarSlot" };
|
|
2368
|
-
function Bs(t, e, n,
|
|
2369
|
-
const
|
|
2378
|
+
function Bs(t, e, n, o, r, s) {
|
|
2379
|
+
const a = B("AIAvatar"), d = B("HumanAvatar"), v = B("ActionResult"), k = B("ArtifactRenderer"), w = B("Bubble"), S = B("AttachmentPreview"), F = B("Typing");
|
|
2370
2380
|
return l(), c("div", {
|
|
2371
2381
|
ref: "scrollEl",
|
|
2372
2382
|
class: E(["wm-list", { "wm-list--silent": r.silentFades }]),
|
|
@@ -2381,7 +2391,7 @@ function Bs(t, e, n, a, r, s) {
|
|
|
2381
2391
|
])])) : s.historyExhausted ? (l(), c("div", vs, "Début de la conversation")) : y("", !0),
|
|
2382
2392
|
n.dateLabel ? (l(), c("div", gs, [
|
|
2383
2393
|
e[2] || (e[2] = i("div", { class: "wm-list__line" }, null, -1)),
|
|
2384
|
-
i("span", ys,
|
|
2394
|
+
i("span", ys, b(n.dateLabel), 1),
|
|
2385
2395
|
e[3] || (e[3] = i("div", { class: "wm-list__line" }, null, -1))
|
|
2386
2396
|
])) : y("", !0),
|
|
2387
2397
|
(l(!0), c(M, null, D(s.groups, (A, U) => (l(), c(M, {
|
|
@@ -2398,7 +2408,7 @@ function Bs(t, e, n, a, r, s) {
|
|
|
2398
2408
|
}, [
|
|
2399
2409
|
A.role === "system" ? (l(), c("div", bs, [
|
|
2400
2410
|
e[5] || (e[5] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1)),
|
|
2401
|
-
i("span", ks,
|
|
2411
|
+
i("span", ks, b(A.systemLabel), 1),
|
|
2402
2412
|
e[6] || (e[6] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
|
|
2403
2413
|
])) : (l(), c(M, { key: 1 }, [
|
|
2404
2414
|
(l(!0), c(M, null, D(A.items, (x, j) => (l(), c("div", {
|
|
@@ -2409,7 +2419,7 @@ function Bs(t, e, n, a, r, s) {
|
|
|
2409
2419
|
}, [
|
|
2410
2420
|
A.role !== "user" ? (l(), c("div", As, [
|
|
2411
2421
|
j === A.items.length - 1 ? (l(), c(M, { key: 0 }, [
|
|
2412
|
-
A.role === "ai" ? (l(), L(
|
|
2422
|
+
A.role === "ai" ? (l(), L(a, {
|
|
2413
2423
|
key: 0,
|
|
2414
2424
|
size: 26,
|
|
2415
2425
|
tail: !0
|
|
@@ -2438,7 +2448,7 @@ function Bs(t, e, n, a, r, s) {
|
|
|
2438
2448
|
key: 4,
|
|
2439
2449
|
artifact: s.artifactOf(x.message)
|
|
2440
2450
|
}, null, 8, ["artifact"])) : (l(), c("div", Ss, [
|
|
2441
|
-
x.message.text_md ? (l(), L(
|
|
2451
|
+
x.message.text_md ? (l(), L(w, {
|
|
2442
2452
|
key: 0,
|
|
2443
2453
|
role: A.role,
|
|
2444
2454
|
text: x.message.text_md
|
|
@@ -2458,16 +2468,16 @@ function Bs(t, e, n, a, r, s) {
|
|
|
2458
2468
|
key: 0,
|
|
2459
2469
|
class: E(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
|
|
2460
2470
|
}, [
|
|
2461
|
-
A.role !== "user" ? (l(), c("span", xs,
|
|
2471
|
+
A.role !== "user" ? (l(), c("span", xs, b(s.roleLabel(A)), 1)) : y("", !0),
|
|
2462
2472
|
A.role !== "user" && s.lastTimeOf(A) ? (l(), c("span", Ts, "·")) : y("", !0),
|
|
2463
|
-
s.lastTimeOf(A) ? (l(), c("span", Ms,
|
|
2473
|
+
s.lastTimeOf(A) ? (l(), c("span", Ms, b(s.lastTimeOf(A)), 1)) : y("", !0)
|
|
2464
2474
|
], 2)) : y("", !0)
|
|
2465
2475
|
], 64))
|
|
2466
2476
|
], 2)) : y("", !0)
|
|
2467
2477
|
], 64))), 128)),
|
|
2468
2478
|
n.streamingActive ? (l(), c("div", Os, [
|
|
2469
2479
|
i("div", Is, [
|
|
2470
|
-
K(
|
|
2480
|
+
K(a, {
|
|
2471
2481
|
size: 26,
|
|
2472
2482
|
tail: !0
|
|
2473
2483
|
})
|
|
@@ -2476,7 +2486,7 @@ function Bs(t, e, n, a, r, s) {
|
|
|
2476
2486
|
])) : y("", !0)
|
|
2477
2487
|
], 34);
|
|
2478
2488
|
}
|
|
2479
|
-
const Es = /* @__PURE__ */ $(_s, [["render", Bs], ["__scopeId", "data-v-
|
|
2489
|
+
const Es = /* @__PURE__ */ $(_s, [["render", Bs], ["__scopeId", "data-v-54959b73"]]), oe = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", he = typeof window < "u" && typeof window.MediaRecorder < "u";
|
|
2480
2490
|
function $s() {
|
|
2481
2491
|
return he && [
|
|
2482
2492
|
"video/webm;codecs=vp9,opus",
|
|
@@ -2484,8 +2494,8 @@ function $s() {
|
|
|
2484
2494
|
"video/webm",
|
|
2485
2495
|
"video/mp4"
|
|
2486
2496
|
].find((e) => {
|
|
2487
|
-
var n,
|
|
2488
|
-
return (
|
|
2497
|
+
var n, o;
|
|
2498
|
+
return (o = (n = window.MediaRecorder).isTypeSupported) == null ? void 0 : o.call(n, e);
|
|
2489
2499
|
}) || "";
|
|
2490
2500
|
}
|
|
2491
2501
|
function Ce({ audio: t }) {
|
|
@@ -2521,12 +2531,12 @@ async function Ls() {
|
|
|
2521
2531
|
async function Rs(t) {
|
|
2522
2532
|
const e = document.createElement("video");
|
|
2523
2533
|
e.muted = !0, e.playsInline = !0, e.srcObject = t, await e.play(), await new Promise((d) => requestAnimationFrame(d));
|
|
2524
|
-
const n = e.videoWidth || 1280,
|
|
2525
|
-
r.width = n, r.height =
|
|
2534
|
+
const n = e.videoWidth || 1280, o = e.videoHeight || 720, r = document.createElement("canvas");
|
|
2535
|
+
r.width = n, r.height = o, r.getContext("2d").drawImage(e, 0, 0, n, o);
|
|
2526
2536
|
const s = await new Promise((d, v) => {
|
|
2527
2537
|
r.toBlob((k) => k ? d(k) : v(new Error("toBlob failed")), "image/png");
|
|
2528
|
-
}),
|
|
2529
|
-
return new File([s], `capture-${
|
|
2538
|
+
}), a = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
2539
|
+
return new File([s], `capture-${a}.png`, { type: "image/png" });
|
|
2530
2540
|
}
|
|
2531
2541
|
async function Fs(t = {}) {
|
|
2532
2542
|
var k;
|
|
@@ -2534,58 +2544,58 @@ async function Fs(t = {}) {
|
|
|
2534
2544
|
let e;
|
|
2535
2545
|
try {
|
|
2536
2546
|
e = await navigator.mediaDevices.getDisplayMedia(Ce({ audio: !0 }));
|
|
2537
|
-
} catch (
|
|
2538
|
-
return (
|
|
2547
|
+
} catch (w) {
|
|
2548
|
+
return (w == null ? void 0 : w.name) !== "NotAllowedError" && console.error("[media] record picker", w), null;
|
|
2539
2549
|
}
|
|
2540
2550
|
const n = $s();
|
|
2541
|
-
let
|
|
2551
|
+
let o;
|
|
2542
2552
|
try {
|
|
2543
|
-
|
|
2544
|
-
} catch (
|
|
2545
|
-
return console.error("[media] recorder init",
|
|
2553
|
+
o = n ? new window.MediaRecorder(e, { mimeType: n }) : new window.MediaRecorder(e);
|
|
2554
|
+
} catch (w) {
|
|
2555
|
+
return console.error("[media] recorder init", w), e.getTracks().forEach((S) => {
|
|
2546
2556
|
S.stop();
|
|
2547
2557
|
}), null;
|
|
2548
2558
|
}
|
|
2549
2559
|
const r = [];
|
|
2550
|
-
let s = null,
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
}),
|
|
2554
|
-
var
|
|
2560
|
+
let s = null, a = !1;
|
|
2561
|
+
o.addEventListener("dataavailable", (w) => {
|
|
2562
|
+
w.data && w.data.size > 0 && r.push(w.data);
|
|
2563
|
+
}), o.addEventListener("stop", () => {
|
|
2564
|
+
var w, S;
|
|
2555
2565
|
if (s && clearInterval(s), e.getTracks().forEach((F) => {
|
|
2556
2566
|
F.stop();
|
|
2557
2567
|
}), r.length) {
|
|
2558
|
-
const F =
|
|
2559
|
-
(
|
|
2568
|
+
const F = o.mimeType || n || "video/webm", A = new Blob(r, { type: F }), U = /mp4/.test(F) ? "mp4" : "webm", x = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), j = new File([A], `ecran-${x}.${U}`, { type: F });
|
|
2569
|
+
(w = t.onfinalize) == null || w.call(t, j);
|
|
2560
2570
|
} else
|
|
2561
2571
|
(S = t.oncancel) == null || S.call(t);
|
|
2562
|
-
}), e.getVideoTracks().forEach((
|
|
2563
|
-
|
|
2572
|
+
}), e.getVideoTracks().forEach((w) => {
|
|
2573
|
+
w.addEventListener("ended", () => d(), { once: !0 });
|
|
2564
2574
|
});
|
|
2565
2575
|
function d() {
|
|
2566
|
-
if (!
|
|
2576
|
+
if (!a && (a = !0, o.state !== "inactive"))
|
|
2567
2577
|
try {
|
|
2568
|
-
|
|
2569
|
-
} catch (
|
|
2570
|
-
console.error("[media] recorder stop",
|
|
2578
|
+
o.stop();
|
|
2579
|
+
} catch (w) {
|
|
2580
|
+
console.error("[media] recorder stop", w);
|
|
2571
2581
|
}
|
|
2572
2582
|
}
|
|
2573
2583
|
try {
|
|
2574
|
-
|
|
2575
|
-
} catch (
|
|
2576
|
-
return console.error("[media] recorder start",
|
|
2584
|
+
o.start(1e3);
|
|
2585
|
+
} catch (w) {
|
|
2586
|
+
return console.error("[media] recorder start", w), e.getTracks().forEach((S) => {
|
|
2577
2587
|
S.stop();
|
|
2578
2588
|
}), null;
|
|
2579
2589
|
}
|
|
2580
2590
|
(k = t.onstart) == null || k.call(t);
|
|
2581
2591
|
const v = Date.now();
|
|
2582
2592
|
return s = setInterval(() => {
|
|
2583
|
-
var
|
|
2584
|
-
(
|
|
2593
|
+
var w;
|
|
2594
|
+
(w = t.ontick) == null || w.call(t, Date.now() - v);
|
|
2585
2595
|
}, 500), {
|
|
2586
2596
|
stop: d,
|
|
2587
2597
|
get state() {
|
|
2588
|
-
return
|
|
2598
|
+
return o.state;
|
|
2589
2599
|
}
|
|
2590
2600
|
};
|
|
2591
2601
|
}
|
|
@@ -2744,48 +2754,48 @@ const Ds = [
|
|
|
2744
2754
|
height: "14",
|
|
2745
2755
|
"aria-hidden": "true"
|
|
2746
2756
|
}, Ws = ["d"], Ks = ["placeholder", "disabled"], Gs = { class: "wm-compose__actions" }, Ys = ["title", "aria-label", "disabled"], Js = ["disabled"];
|
|
2747
|
-
function Xs(t, e, n,
|
|
2757
|
+
function Xs(t, e, n, o, r, s) {
|
|
2748
2758
|
return l(), c("div", js, [
|
|
2749
2759
|
r.recording ? (l(), c("div", Us, [
|
|
2750
2760
|
e[8] || (e[8] = i("span", {
|
|
2751
2761
|
class: "wm-rec__dot",
|
|
2752
2762
|
"aria-hidden": "true"
|
|
2753
2763
|
}, null, -1)),
|
|
2754
|
-
i("span", Ps, "Enregistrement · " +
|
|
2764
|
+
i("span", Ps, "Enregistrement · " + b(s.recordingElapsedLabel), 1),
|
|
2755
2765
|
i("button", {
|
|
2756
2766
|
type: "button",
|
|
2757
2767
|
class: "wm-rec__stop",
|
|
2758
|
-
onClick: e[0] || (e[0] = (...
|
|
2768
|
+
onClick: e[0] || (e[0] = (...a) => s.stopRecording && s.stopRecording(...a))
|
|
2759
2769
|
}, "Arrêter")
|
|
2760
2770
|
])) : y("", !0),
|
|
2761
2771
|
i("form", {
|
|
2762
2772
|
class: E(["wm-compose", { "has-attach": r.attachOpen }]),
|
|
2763
|
-
onSubmit: e[7] || (e[7] = X((...
|
|
2773
|
+
onSubmit: e[7] || (e[7] = X((...a) => s.onSubmit && s.onSubmit(...a), ["prevent"]))
|
|
2764
2774
|
}, [
|
|
2765
2775
|
i("input", {
|
|
2766
2776
|
ref: "fileEl",
|
|
2767
2777
|
type: "file",
|
|
2768
2778
|
hidden: "",
|
|
2769
2779
|
multiple: "",
|
|
2770
|
-
onChange: e[1] || (e[1] = (...
|
|
2780
|
+
onChange: e[1] || (e[1] = (...a) => s.onFile && s.onFile(...a))
|
|
2771
2781
|
}, null, 544),
|
|
2772
2782
|
r.attachOpen ? (l(), c("div", {
|
|
2773
2783
|
key: 0,
|
|
2774
2784
|
class: "wm-compose__overlay",
|
|
2775
|
-
onClick: e[2] || (e[2] = (
|
|
2785
|
+
onClick: e[2] || (e[2] = (a) => r.attachOpen = !1)
|
|
2776
2786
|
})) : y("", !0),
|
|
2777
2787
|
r.attachOpen ? (l(), c("div", Hs, [
|
|
2778
|
-
(l(!0), c(M, null, D(s.attachItems, (
|
|
2779
|
-
key:
|
|
2788
|
+
(l(!0), c(M, null, D(s.attachItems, (a) => (l(), c("button", {
|
|
2789
|
+
key: a.action,
|
|
2780
2790
|
type: "button",
|
|
2781
2791
|
class: "wm-compose__menuItem",
|
|
2782
|
-
disabled:
|
|
2783
|
-
onClick: (d) => s.onAttachAction(
|
|
2792
|
+
disabled: a.disabled,
|
|
2793
|
+
onClick: (d) => s.onAttachAction(a.action)
|
|
2784
2794
|
}, [
|
|
2785
2795
|
i("span", Vs, [
|
|
2786
2796
|
(l(), c("svg", qs, [
|
|
2787
2797
|
i("path", {
|
|
2788
|
-
d:
|
|
2798
|
+
d: a.path,
|
|
2789
2799
|
stroke: "currentColor",
|
|
2790
2800
|
"stroke-width": "1.8",
|
|
2791
2801
|
"stroke-linecap": "round",
|
|
@@ -2794,18 +2804,18 @@ function Xs(t, e, n, a, r, s) {
|
|
|
2794
2804
|
}, null, 8, Ws)
|
|
2795
2805
|
]))
|
|
2796
2806
|
]),
|
|
2797
|
-
i("span", null,
|
|
2807
|
+
i("span", null, b(a.label), 1)
|
|
2798
2808
|
], 8, zs))), 128))
|
|
2799
2809
|
])) : y("", !0),
|
|
2800
2810
|
q(i("textarea", {
|
|
2801
2811
|
ref: "inputEl",
|
|
2802
|
-
"onUpdate:modelValue": e[3] || (e[3] = (
|
|
2812
|
+
"onUpdate:modelValue": e[3] || (e[3] = (a) => r.local = a),
|
|
2803
2813
|
class: "wm-compose__input",
|
|
2804
2814
|
rows: "3",
|
|
2805
2815
|
placeholder: n.placeholder,
|
|
2806
2816
|
disabled: n.disabled,
|
|
2807
|
-
onKeydown: e[4] || (e[4] = (...
|
|
2808
|
-
onInput: e[5] || (e[5] = (...
|
|
2817
|
+
onKeydown: e[4] || (e[4] = (...a) => s.onKeydown && s.onKeydown(...a)),
|
|
2818
|
+
onInput: e[5] || (e[5] = (...a) => s.autosize && s.autosize(...a))
|
|
2809
2819
|
}, null, 40, Ks), [
|
|
2810
2820
|
[J, r.local]
|
|
2811
2821
|
]),
|
|
@@ -2816,7 +2826,7 @@ function Xs(t, e, n, a, r, s) {
|
|
|
2816
2826
|
title: n.attachLabel,
|
|
2817
2827
|
"aria-label": n.attachLabel,
|
|
2818
2828
|
disabled: r.recording,
|
|
2819
|
-
onClick: e[6] || (e[6] = (
|
|
2829
|
+
onClick: e[6] || (e[6] = (a) => r.attachOpen = !r.attachOpen)
|
|
2820
2830
|
}, [...e[9] || (e[9] = [
|
|
2821
2831
|
i("svg", {
|
|
2822
2832
|
width: "13",
|
|
@@ -2874,18 +2884,18 @@ const Zs = /* @__PURE__ */ $(Ns, [["render", Xs], ["__scopeId", "data-v-14fa9ec0
|
|
|
2874
2884
|
}
|
|
2875
2885
|
}
|
|
2876
2886
|
}, er = ["onClick"];
|
|
2877
|
-
function tr(t, e, n,
|
|
2887
|
+
function tr(t, e, n, o, r, s) {
|
|
2878
2888
|
return n.items.length ? (l(), c("div", {
|
|
2879
2889
|
key: s.batchKey,
|
|
2880
2890
|
class: "wm-chips"
|
|
2881
2891
|
}, [
|
|
2882
|
-
(l(!0), c(M, null, D(n.items, (
|
|
2892
|
+
(l(!0), c(M, null, D(n.items, (a, d) => (l(), c("button", {
|
|
2883
2893
|
key: d,
|
|
2884
2894
|
type: "button",
|
|
2885
2895
|
class: "wm-chip",
|
|
2886
2896
|
style: G({ animationDelay: n.baseDelay + d * n.stepDelay + "ms" }),
|
|
2887
|
-
onClick: (v) => t.$emit("select",
|
|
2888
|
-
},
|
|
2897
|
+
onClick: (v) => t.$emit("select", a)
|
|
2898
|
+
}, b(a.label), 13, er))), 128))
|
|
2889
2899
|
])) : y("", !0);
|
|
2890
2900
|
}
|
|
2891
2901
|
const nr = /* @__PURE__ */ $(Qs, [["render", tr], ["__scopeId", "data-v-55aa529d"]]), sr = {
|
|
@@ -2925,16 +2935,16 @@ const nr = /* @__PURE__ */ $(Qs, [["render", tr], ["__scopeId", "data-v-55aa529d
|
|
|
2925
2935
|
key: 0,
|
|
2926
2936
|
class: "wm-approval__detail"
|
|
2927
2937
|
}, cr = { class: "wm-approval__actions" };
|
|
2928
|
-
function ur(t, e, n,
|
|
2929
|
-
const
|
|
2938
|
+
function ur(t, e, n, o, r, s) {
|
|
2939
|
+
const a = B("AIAvatar");
|
|
2930
2940
|
return l(), c("div", rr, [
|
|
2931
2941
|
i("div", ir, [
|
|
2932
2942
|
i("div", ar, [
|
|
2933
|
-
K(
|
|
2943
|
+
K(a, { size: 24 })
|
|
2934
2944
|
]),
|
|
2935
2945
|
i("div", or, [
|
|
2936
|
-
i("div", lr,
|
|
2937
|
-
n.detail ? (l(), c("div", dr,
|
|
2946
|
+
i("div", lr, b(n.action), 1),
|
|
2947
|
+
n.detail ? (l(), c("div", dr, b(n.detail), 1)) : y("", !0)
|
|
2938
2948
|
])
|
|
2939
2949
|
]),
|
|
2940
2950
|
i("div", cr, [
|
|
@@ -2943,13 +2953,13 @@ function ur(t, e, n, a, r, s) {
|
|
|
2943
2953
|
type: "button",
|
|
2944
2954
|
class: "wm-approval__btn wm-approval__btn--neutral",
|
|
2945
2955
|
onClick: e[0] || (e[0] = (d) => t.$emit("callback", s.rejectId))
|
|
2946
|
-
},
|
|
2956
|
+
}, b(s.rejectLabel), 1)) : y("", !0),
|
|
2947
2957
|
s.approveId ? (l(), c("button", {
|
|
2948
2958
|
key: 1,
|
|
2949
2959
|
type: "button",
|
|
2950
2960
|
class: "wm-approval__btn wm-approval__btn--primary",
|
|
2951
2961
|
onClick: e[1] || (e[1] = (d) => t.$emit("callback", s.approveId))
|
|
2952
|
-
},
|
|
2962
|
+
}, b(s.approveLabel), 1)) : y("", !0)
|
|
2953
2963
|
])
|
|
2954
2964
|
]);
|
|
2955
2965
|
}
|
|
@@ -3005,8 +3015,8 @@ const mr = /* @__PURE__ */ new Set([
|
|
|
3005
3015
|
this.values = e, this.error = "";
|
|
3006
3016
|
},
|
|
3007
3017
|
toggleMulti(t, e, n) {
|
|
3008
|
-
const
|
|
3009
|
-
n && r === -1 ?
|
|
3018
|
+
const o = Array.isArray(this.values[t]) ? this.values[t].slice() : [], r = o.indexOf(e);
|
|
3019
|
+
n && r === -1 ? o.push(e) : !n && r !== -1 && o.splice(r, 1), this.values = { ...this.values, [t]: o };
|
|
3010
3020
|
},
|
|
3011
3021
|
validate() {
|
|
3012
3022
|
for (const t of this.normalizedFields) {
|
|
@@ -3064,16 +3074,16 @@ const mr = /* @__PURE__ */ new Set([
|
|
|
3064
3074
|
key: 2,
|
|
3065
3075
|
class: "wm-form__doneLbl"
|
|
3066
3076
|
};
|
|
3067
|
-
function Nr(t, e, n,
|
|
3068
|
-
const
|
|
3077
|
+
function Nr(t, e, n, o, r, s) {
|
|
3078
|
+
const a = B("AIAvatar");
|
|
3069
3079
|
return l(), c("div", _r, [
|
|
3070
3080
|
i("div", pr, [
|
|
3071
3081
|
i("div", vr, [
|
|
3072
|
-
K(
|
|
3082
|
+
K(a, { size: 24 })
|
|
3073
3083
|
]),
|
|
3074
3084
|
i("div", gr, [
|
|
3075
|
-
i("div", yr,
|
|
3076
|
-
n.form.description ? (l(), c("div", wr,
|
|
3085
|
+
i("div", yr, b(n.form.title || "Formulaire"), 1),
|
|
3086
|
+
n.form.description ? (l(), c("div", wr, b(n.form.description), 1)) : y("", !0)
|
|
3077
3087
|
])
|
|
3078
3088
|
]),
|
|
3079
3089
|
i("form", {
|
|
@@ -3088,7 +3098,7 @@ function Nr(t, e, n, a, r, s) {
|
|
|
3088
3098
|
for: `wm-f-${r._uid}-${d.key}`,
|
|
3089
3099
|
class: "wm-form__label"
|
|
3090
3100
|
}, [
|
|
3091
|
-
te(
|
|
3101
|
+
te(b(d.label), 1),
|
|
3092
3102
|
d.required ? (l(), c("span", kr, "*")) : y("", !0)
|
|
3093
3103
|
], 8, br),
|
|
3094
3104
|
d.type === "text" ? q((l(), c("input", {
|
|
@@ -3148,7 +3158,7 @@ function Nr(t, e, n, a, r, s) {
|
|
|
3148
3158
|
}, null, 8, Mr), [
|
|
3149
3159
|
[Ie, r.values[d.key]]
|
|
3150
3160
|
]),
|
|
3151
|
-
i("span", null,
|
|
3161
|
+
i("span", null, b(d.placeholder || "Oui"), 1)
|
|
3152
3162
|
])) : d.type === "select" ? q((l(), c("select", {
|
|
3153
3163
|
key: 5,
|
|
3154
3164
|
id: `wm-f-${r._uid}-${d.key}`,
|
|
@@ -3157,11 +3167,11 @@ function Nr(t, e, n, a, r, s) {
|
|
|
3157
3167
|
required: d.required,
|
|
3158
3168
|
disabled: n.readOnly || r.busy
|
|
3159
3169
|
}, [
|
|
3160
|
-
i("option", Ir,
|
|
3170
|
+
i("option", Ir, b(d.placeholder || "Choisir…"), 1),
|
|
3161
3171
|
(l(!0), c(M, null, D(d.options, (v) => (l(), c("option", {
|
|
3162
3172
|
key: v.value,
|
|
3163
3173
|
value: v.value
|
|
3164
|
-
},
|
|
3174
|
+
}, b(v.label), 9, Br))), 128))
|
|
3165
3175
|
], 8, Or)), [
|
|
3166
3176
|
[Be, r.values[d.key]]
|
|
3167
3177
|
]) : d.type === "multiselect" ? (l(), c("div", Er, [
|
|
@@ -3176,11 +3186,11 @@ function Nr(t, e, n, a, r, s) {
|
|
|
3176
3186
|
disabled: n.readOnly || r.busy,
|
|
3177
3187
|
onChange: (k) => s.toggleMulti(d.key, v.value, k.target.checked)
|
|
3178
3188
|
}, null, 40, $r),
|
|
3179
|
-
i("span", null,
|
|
3189
|
+
i("span", null, b(v.label), 1)
|
|
3180
3190
|
]))), 128))
|
|
3181
3191
|
])) : y("", !0)
|
|
3182
3192
|
]))), 128)),
|
|
3183
|
-
r.error ? (l(), c("div", Lr,
|
|
3193
|
+
r.error ? (l(), c("div", Lr, b(r.error), 1)) : y("", !0),
|
|
3184
3194
|
n.readOnly ? (l(), c("div", Dr, "Réponse envoyée")) : (l(), c("button", {
|
|
3185
3195
|
key: 1,
|
|
3186
3196
|
type: "submit",
|
|
@@ -3188,7 +3198,7 @@ function Nr(t, e, n, a, r, s) {
|
|
|
3188
3198
|
disabled: r.busy
|
|
3189
3199
|
}, [
|
|
3190
3200
|
r.busy ? (l(), c("span", Fr)) : y("", !0),
|
|
3191
|
-
i("span", null,
|
|
3201
|
+
i("span", null, b(r.busy ? "Envoi…" : n.form.submit_label || "Envoyer"), 1)
|
|
3192
3202
|
], 8, Rr))
|
|
3193
3203
|
], 32)
|
|
3194
3204
|
]);
|
|
@@ -3221,7 +3231,7 @@ const jr = /* @__PURE__ */ $(fr, [["render", Nr], ["__scopeId", "data-v-64b40f76
|
|
|
3221
3231
|
key: 1,
|
|
3222
3232
|
class: "wm-fb__done"
|
|
3223
3233
|
};
|
|
3224
|
-
function Gr(t, e, n,
|
|
3234
|
+
function Gr(t, e, n, o, r, s) {
|
|
3225
3235
|
return l(), c("div", Pr, [
|
|
3226
3236
|
n.done ? (l(), c("div", Kr, [...e[3] || (e[3] = [
|
|
3227
3237
|
ue('<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)
|
|
@@ -3229,22 +3239,22 @@ function Gr(t, e, n, a, r, s) {
|
|
|
3229
3239
|
e[1] || (e[1] = i("div", { class: "wm-fb__title" }, "Comment s'est passée cette conversation ?", -1)),
|
|
3230
3240
|
e[2] || (e[2] = i("div", { class: "wm-fb__sub" }, "Votre avis nous aide à améliorer l'assistant.", -1)),
|
|
3231
3241
|
i("div", Hr, [
|
|
3232
|
-
(l(!0), c(M, null, D(r.options, (
|
|
3233
|
-
key:
|
|
3242
|
+
(l(!0), c(M, null, D(r.options, (a) => (l(), c("button", {
|
|
3243
|
+
key: a.v,
|
|
3234
3244
|
type: "button",
|
|
3235
|
-
class: E(["wm-fb__opt", { "is-selected": r.sel ===
|
|
3236
|
-
onClick: (d) => r.sel =
|
|
3245
|
+
class: E(["wm-fb__opt", { "is-selected": r.sel === a.v }]),
|
|
3246
|
+
onClick: (d) => r.sel = a.v
|
|
3237
3247
|
}, [
|
|
3238
|
-
i("span", Vr,
|
|
3239
|
-
i("span", qr,
|
|
3248
|
+
i("span", Vr, b(a.e), 1),
|
|
3249
|
+
i("span", qr, b(a.l), 1)
|
|
3240
3250
|
], 10, zr))), 128))
|
|
3241
3251
|
]),
|
|
3242
3252
|
i("button", {
|
|
3243
3253
|
type: "button",
|
|
3244
3254
|
class: "wm-fb__send",
|
|
3245
3255
|
disabled: !r.sel || n.busy,
|
|
3246
|
-
onClick: e[0] || (e[0] = (...
|
|
3247
|
-
},
|
|
3256
|
+
onClick: e[0] || (e[0] = (...a) => s.onSend && s.onSend(...a))
|
|
3257
|
+
}, b(n.busy ? "Envoi…" : "Envoyer mon avis"), 9, Wr)
|
|
3248
3258
|
], 64))
|
|
3249
3259
|
]);
|
|
3250
3260
|
}
|
|
@@ -3267,7 +3277,7 @@ const Xr = {
|
|
|
3267
3277
|
normalized() {
|
|
3268
3278
|
return (Array.isArray(this.conversations) ? this.conversations.slice() : []).map((e) => {
|
|
3269
3279
|
var r;
|
|
3270
|
-
const n = e.last_message_at || e.updated_at || e.created_at || null,
|
|
3280
|
+
const n = e.last_message_at || e.updated_at || e.created_at || null, o = n ? Date.parse(n) : 0;
|
|
3271
3281
|
return {
|
|
3272
3282
|
id: e.id,
|
|
3273
3283
|
raw: e,
|
|
@@ -3276,7 +3286,7 @@ const Xr = {
|
|
|
3276
3286
|
// from the cached messages + local read state.
|
|
3277
3287
|
preview: e._preview || e.last_message_preview || e.preview || ((r = e.metadata) == null ? void 0 : r.last_preview) || "",
|
|
3278
3288
|
unread: !!e._unread,
|
|
3279
|
-
stamp:
|
|
3289
|
+
stamp: o
|
|
3280
3290
|
};
|
|
3281
3291
|
}).sort((e, n) => n.stamp - e.stamp);
|
|
3282
3292
|
},
|
|
@@ -3287,16 +3297,16 @@ const Xr = {
|
|
|
3287
3297
|
) : this.normalized;
|
|
3288
3298
|
},
|
|
3289
3299
|
groups() {
|
|
3290
|
-
const e = Jr(/* @__PURE__ */ new Date()).getTime(), n = e - 6 * 864e5,
|
|
3291
|
-
for (const
|
|
3292
|
-
if (!
|
|
3293
|
-
s.push(
|
|
3300
|
+
const e = Jr(/* @__PURE__ */ new Date()).getTime(), n = e - 6 * 864e5, o = [], r = [], s = [];
|
|
3301
|
+
for (const a of this.filtered) {
|
|
3302
|
+
if (!a.stamp) {
|
|
3303
|
+
s.push(a);
|
|
3294
3304
|
continue;
|
|
3295
3305
|
}
|
|
3296
|
-
|
|
3306
|
+
a.stamp >= e ? o.push(a) : a.stamp >= n ? r.push(a) : s.push(a);
|
|
3297
3307
|
}
|
|
3298
3308
|
return [
|
|
3299
|
-
{ key: "today", label: "Aujourd'hui", items:
|
|
3309
|
+
{ key: "today", label: "Aujourd'hui", items: o },
|
|
3300
3310
|
{ key: "week", label: "Cette semaine", items: r },
|
|
3301
3311
|
{ key: "older", label: "Plus ancien", items: s }
|
|
3302
3312
|
];
|
|
@@ -3320,11 +3330,11 @@ const Xr = {
|
|
|
3320
3330
|
key: 0,
|
|
3321
3331
|
class: "wm-hd__empty"
|
|
3322
3332
|
};
|
|
3323
|
-
function _i(t, e, n,
|
|
3333
|
+
function _i(t, e, n, o, r, s) {
|
|
3324
3334
|
return l(), c("div", Zr, [
|
|
3325
3335
|
i("div", {
|
|
3326
3336
|
class: "wm-hd__scrim",
|
|
3327
|
-
onClick: e[0] || (e[0] = (
|
|
3337
|
+
onClick: e[0] || (e[0] = (a) => t.$emit("close"))
|
|
3328
3338
|
}),
|
|
3329
3339
|
i("aside", Qr, [
|
|
3330
3340
|
i("div", ei, [
|
|
@@ -3336,7 +3346,7 @@ function _i(t, e, n, a, r, s) {
|
|
|
3336
3346
|
type: "button",
|
|
3337
3347
|
class: "wm-hd__close",
|
|
3338
3348
|
"aria-label": "Fermer",
|
|
3339
|
-
onClick: e[1] || (e[1] = (
|
|
3349
|
+
onClick: e[1] || (e[1] = (a) => t.$emit("close"))
|
|
3340
3350
|
}, [...e[4] || (e[4] = [
|
|
3341
3351
|
i("svg", {
|
|
3342
3352
|
width: "12",
|
|
@@ -3357,7 +3367,7 @@ function _i(t, e, n, a, r, s) {
|
|
|
3357
3367
|
i("button", {
|
|
3358
3368
|
type: "button",
|
|
3359
3369
|
class: "wm-hd__new",
|
|
3360
|
-
onClick: e[2] || (e[2] = (
|
|
3370
|
+
onClick: e[2] || (e[2] = (a) => t.$emit("new"))
|
|
3361
3371
|
}, [...e[6] || (e[6] = [
|
|
3362
3372
|
i("span", { class: "wm-hd__newIcon" }, [
|
|
3363
3373
|
i("svg", {
|
|
@@ -3393,7 +3403,7 @@ function _i(t, e, n, a, r, s) {
|
|
|
3393
3403
|
])
|
|
3394
3404
|
], -1)),
|
|
3395
3405
|
q(i("input", {
|
|
3396
|
-
"onUpdate:modelValue": e[3] || (e[3] = (
|
|
3406
|
+
"onUpdate:modelValue": e[3] || (e[3] = (a) => r.query = a),
|
|
3397
3407
|
type: "text",
|
|
3398
3408
|
placeholder: "Rechercher dans vos messages",
|
|
3399
3409
|
"aria-label": "Rechercher dans vos messages"
|
|
@@ -3403,13 +3413,13 @@ function _i(t, e, n, a, r, s) {
|
|
|
3403
3413
|
])
|
|
3404
3414
|
]),
|
|
3405
3415
|
i("div", si, [
|
|
3406
|
-
(l(!0), c(M, null, D(s.groups, (
|
|
3407
|
-
key:
|
|
3416
|
+
(l(!0), c(M, null, D(s.groups, (a) => (l(), c(M, {
|
|
3417
|
+
key: a.key
|
|
3408
3418
|
}, [
|
|
3409
|
-
|
|
3410
|
-
i("div", ii,
|
|
3419
|
+
a.items.length ? (l(), c("div", ri, [
|
|
3420
|
+
i("div", ii, b(a.label), 1),
|
|
3411
3421
|
i("div", ai, [
|
|
3412
|
-
(l(!0), c(M, null, D(
|
|
3422
|
+
(l(!0), c(M, null, D(a.items, (d) => (l(), c("button", {
|
|
3413
3423
|
key: d.id,
|
|
3414
3424
|
type: "button",
|
|
3415
3425
|
class: E(["wm-hd__row", {
|
|
@@ -3436,9 +3446,9 @@ function _i(t, e, n, a, r, s) {
|
|
|
3436
3446
|
]),
|
|
3437
3447
|
i("div", ci, [
|
|
3438
3448
|
i("div", ui, [
|
|
3439
|
-
i("span", hi,
|
|
3449
|
+
i("span", hi, b(d.title), 1)
|
|
3440
3450
|
]),
|
|
3441
|
-
i("div", mi,
|
|
3451
|
+
i("div", mi, b(d.preview || "Aucun message"), 1)
|
|
3442
3452
|
])
|
|
3443
3453
|
], 10, oi))), 128))
|
|
3444
3454
|
])
|
|
@@ -3479,18 +3489,18 @@ const pi = /* @__PURE__ */ $(Xr, [["render", _i], ["__scopeId", "data-v-1259e822
|
|
|
3479
3489
|
class: "wm-mm__pop",
|
|
3480
3490
|
role: "menu"
|
|
3481
3491
|
}, wi = { class: "wm-mm__section" }, bi = { class: "wm-mm__section" }, ki = { class: "wm-mm__section" };
|
|
3482
|
-
function Ci(t, e, n,
|
|
3492
|
+
function Ci(t, e, n, o, r, s) {
|
|
3483
3493
|
return l(), c("div", gi, [
|
|
3484
3494
|
i("div", {
|
|
3485
3495
|
class: "wm-mm__scrim",
|
|
3486
|
-
onClick: e[0] || (e[0] = (
|
|
3496
|
+
onClick: e[0] || (e[0] = (a) => t.$emit("close"))
|
|
3487
3497
|
}),
|
|
3488
3498
|
i("div", yi, [
|
|
3489
3499
|
i("div", wi, [
|
|
3490
3500
|
i("button", {
|
|
3491
3501
|
type: "button",
|
|
3492
3502
|
class: "wm-mm__item",
|
|
3493
|
-
onClick: e[1] || (e[1] = (
|
|
3503
|
+
onClick: e[1] || (e[1] = (a) => s.emit("history"))
|
|
3494
3504
|
}, [...e[7] || (e[7] = [
|
|
3495
3505
|
i("span", { class: "wm-mm__icon" }, [
|
|
3496
3506
|
i("svg", {
|
|
@@ -3513,7 +3523,7 @@ function Ci(t, e, n, a, r, s) {
|
|
|
3513
3523
|
key: 0,
|
|
3514
3524
|
type: "button",
|
|
3515
3525
|
class: "wm-mm__item",
|
|
3516
|
-
onClick: e[2] || (e[2] = (
|
|
3526
|
+
onClick: e[2] || (e[2] = (a) => s.emit("rename"))
|
|
3517
3527
|
}, [...e[8] || (e[8] = [
|
|
3518
3528
|
ue('<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)
|
|
3519
3529
|
])])) : y("", !0),
|
|
@@ -3521,7 +3531,7 @@ function Ci(t, e, n, a, r, s) {
|
|
|
3521
3531
|
key: 1,
|
|
3522
3532
|
type: "button",
|
|
3523
3533
|
class: "wm-mm__item",
|
|
3524
|
-
onClick: e[3] || (e[3] = (
|
|
3534
|
+
onClick: e[3] || (e[3] = (a) => s.emit("export"))
|
|
3525
3535
|
}, [...e[9] || (e[9] = [
|
|
3526
3536
|
ue('<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)
|
|
3527
3537
|
])])) : y("", !0)
|
|
@@ -3531,7 +3541,7 @@ function Ci(t, e, n, a, r, s) {
|
|
|
3531
3541
|
i("button", {
|
|
3532
3542
|
type: "button",
|
|
3533
3543
|
class: "wm-mm__item",
|
|
3534
|
-
onClick: e[4] || (e[4] = (...
|
|
3544
|
+
onClick: e[4] || (e[4] = (...a) => s.toggleNotif && s.toggleNotif(...a))
|
|
3535
3545
|
}, [
|
|
3536
3546
|
e[11] || (e[11] = i("span", { class: "wm-mm__icon" }, [
|
|
3537
3547
|
i("svg", {
|
|
@@ -3562,7 +3572,7 @@ function Ci(t, e, n, a, r, s) {
|
|
|
3562
3572
|
key: 0,
|
|
3563
3573
|
type: "button",
|
|
3564
3574
|
class: "wm-mm__item",
|
|
3565
|
-
onClick: e[5] || (e[5] = (
|
|
3575
|
+
onClick: e[5] || (e[5] = (a) => s.emit("status"))
|
|
3566
3576
|
}, [...e[13] || (e[13] = [
|
|
3567
3577
|
i("span", { class: "wm-mm__icon" }, [
|
|
3568
3578
|
i("svg", {
|
|
@@ -3585,7 +3595,7 @@ function Ci(t, e, n, a, r, s) {
|
|
|
3585
3595
|
key: 1,
|
|
3586
3596
|
type: "button",
|
|
3587
3597
|
class: "wm-mm__item",
|
|
3588
|
-
onClick: e[6] || (e[6] = (
|
|
3598
|
+
onClick: e[6] || (e[6] = (a) => s.emit("help"))
|
|
3589
3599
|
}, [...e[14] || (e[14] = [
|
|
3590
3600
|
i("span", { class: "wm-mm__icon" }, [
|
|
3591
3601
|
i("svg", {
|
|
@@ -3647,20 +3657,20 @@ const Ai = /* @__PURE__ */ $(vi, [["render", Ci], ["__scopeId", "data-v-3181ad1b
|
|
|
3647
3657
|
role: "dialog",
|
|
3648
3658
|
"aria-modal": "true"
|
|
3649
3659
|
}, Mi = { class: "wm-dialog__head" }, Oi = { class: "wm-dialog__title" }, Ii = { class: "wm-dialog__body" }, Bi = ["placeholder"], Ei = { class: "wm-dialog__actions" }, $i = ["disabled"];
|
|
3650
|
-
function Li(t, e, n,
|
|
3660
|
+
function Li(t, e, n, o, r, s) {
|
|
3651
3661
|
return l(), c("div", xi, [
|
|
3652
3662
|
i("div", {
|
|
3653
3663
|
class: "wm-dialog__scrim",
|
|
3654
|
-
onClick: e[0] || (e[0] = (
|
|
3664
|
+
onClick: e[0] || (e[0] = (a) => t.$emit("close"))
|
|
3655
3665
|
}),
|
|
3656
3666
|
i("div", Ti, [
|
|
3657
3667
|
i("div", Mi, [
|
|
3658
|
-
i("div", Oi,
|
|
3668
|
+
i("div", Oi, b(n.title), 1),
|
|
3659
3669
|
i("button", {
|
|
3660
3670
|
type: "button",
|
|
3661
3671
|
class: "wm-dialog__close",
|
|
3662
3672
|
"aria-label": "Fermer",
|
|
3663
|
-
onClick: e[1] || (e[1] = (
|
|
3673
|
+
onClick: e[1] || (e[1] = (a) => t.$emit("close"))
|
|
3664
3674
|
}, [...e[7] || (e[7] = [
|
|
3665
3675
|
i("svg", {
|
|
3666
3676
|
width: "12",
|
|
@@ -3680,14 +3690,14 @@ function Li(t, e, n, a, r, s) {
|
|
|
3680
3690
|
i("div", Ii, [
|
|
3681
3691
|
q(i("input", {
|
|
3682
3692
|
ref: "input",
|
|
3683
|
-
"onUpdate:modelValue": e[2] || (e[2] = (
|
|
3693
|
+
"onUpdate:modelValue": e[2] || (e[2] = (a) => r.value = a),
|
|
3684
3694
|
type: "text",
|
|
3685
3695
|
class: "wm-dialog__input",
|
|
3686
3696
|
placeholder: n.placeholder,
|
|
3687
3697
|
maxlength: 120,
|
|
3688
3698
|
onKeydown: [
|
|
3689
|
-
e[3] || (e[3] = ae(X((...
|
|
3690
|
-
e[4] || (e[4] = ae(X((
|
|
3699
|
+
e[3] || (e[3] = ae(X((...a) => s.onSubmit && s.onSubmit(...a), ["prevent"]), ["enter"])),
|
|
3700
|
+
e[4] || (e[4] = ae(X((a) => t.$emit("close"), ["prevent"]), ["esc"]))
|
|
3691
3701
|
]
|
|
3692
3702
|
}, null, 40, Bi), [
|
|
3693
3703
|
[J, r.value]
|
|
@@ -3697,13 +3707,13 @@ function Li(t, e, n, a, r, s) {
|
|
|
3697
3707
|
i("button", {
|
|
3698
3708
|
type: "button",
|
|
3699
3709
|
class: "wm-dialog__btn",
|
|
3700
|
-
onClick: e[5] || (e[5] = (
|
|
3710
|
+
onClick: e[5] || (e[5] = (a) => t.$emit("close"))
|
|
3701
3711
|
}, "Annuler"),
|
|
3702
3712
|
i("button", {
|
|
3703
3713
|
type: "button",
|
|
3704
3714
|
class: "wm-dialog__btn wm-dialog__btn--primary",
|
|
3705
3715
|
disabled: !s.canSubmit,
|
|
3706
|
-
onClick: e[6] || (e[6] = (...
|
|
3716
|
+
onClick: e[6] || (e[6] = (...a) => s.onSubmit && s.onSubmit(...a))
|
|
3707
3717
|
}, "Enregistrer", 8, $i)
|
|
3708
3718
|
])
|
|
3709
3719
|
])
|
|
@@ -3717,40 +3727,40 @@ function ie(t) {
|
|
|
3717
3727
|
}
|
|
3718
3728
|
function Fi(t, e) {
|
|
3719
3729
|
if (!t || !e) return "";
|
|
3720
|
-
const n = Array.isArray(t.fields) ? t.fields : [],
|
|
3730
|
+
const n = Array.isArray(t.fields) ? t.fields : [], o = [];
|
|
3721
3731
|
for (const r of n) {
|
|
3722
3732
|
if (!(r != null && r.key) || !(r != null && r.label)) continue;
|
|
3723
3733
|
const s = e[r.key];
|
|
3724
3734
|
if (s == null || s === "") continue;
|
|
3725
|
-
let
|
|
3735
|
+
let a;
|
|
3726
3736
|
if (Array.isArray(s)) {
|
|
3727
|
-
if (
|
|
3728
|
-
} else typeof s == "boolean" ?
|
|
3729
|
-
|
|
3730
|
-
${
|
|
3737
|
+
if (a = s.map((d) => le(r, String(d))).join(", "), !a) continue;
|
|
3738
|
+
} else typeof s == "boolean" ? a = s ? "Oui" : "Non" : a = le(r, String(s));
|
|
3739
|
+
o.push(`${r.label} :
|
|
3740
|
+
${a}`);
|
|
3731
3741
|
}
|
|
3732
|
-
return
|
|
3742
|
+
return o.join(`
|
|
3733
3743
|
|
|
3734
3744
|
`);
|
|
3735
3745
|
}
|
|
3736
3746
|
function le(t, e) {
|
|
3737
3747
|
if (!Array.isArray(t == null ? void 0 : t.options)) return e;
|
|
3738
|
-
const n = t.options.find((
|
|
3748
|
+
const n = t.options.find((o) => (o == null ? void 0 : o.value) === e);
|
|
3739
3749
|
return (n == null ? void 0 : n.label) || e;
|
|
3740
3750
|
}
|
|
3741
3751
|
function Di(t, e) {
|
|
3742
|
-
const n = [],
|
|
3743
|
-
for (const r of
|
|
3752
|
+
const n = [], o = Array.isArray(t == null ? void 0 : t.fields) ? t.fields : [];
|
|
3753
|
+
for (const r of o) {
|
|
3744
3754
|
if (!(r != null && r.key) || !(r != null && r.label)) continue;
|
|
3745
3755
|
const s = e == null ? void 0 : e[r.key];
|
|
3746
3756
|
if (s == null || s === "") continue;
|
|
3747
|
-
let
|
|
3757
|
+
let a;
|
|
3748
3758
|
if (Array.isArray(s)) {
|
|
3749
|
-
if (
|
|
3750
|
-
} else typeof s == "boolean" ?
|
|
3751
|
-
const d = r.type === "textarea" || typeof
|
|
3759
|
+
if (a = s.map((v) => le(r, String(v))).join(", "), !a) continue;
|
|
3760
|
+
} else typeof s == "boolean" ? a = s ? "Oui" : "Non" : a = le(r, String(s));
|
|
3761
|
+
const d = r.type === "textarea" || typeof a == "string" && (a.length > 60 || a.includes(`
|
|
3752
3762
|
`));
|
|
3753
|
-
n.push({ label: r.label, value:
|
|
3763
|
+
n.push({ label: r.label, value: a, multiline: d });
|
|
3754
3764
|
}
|
|
3755
3765
|
return {
|
|
3756
3766
|
kind: "form_response",
|
|
@@ -3870,6 +3880,12 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
3870
3880
|
// unread dot in the history drawer survives reloads. The server
|
|
3871
3881
|
// has no per-customer read model, so this is purely client-side.
|
|
3872
3882
|
readState: {},
|
|
3883
|
+
// ISO timestamp captured the first time this client boots on a
|
|
3884
|
+
// device (no prior `readState` in localStorage). Used as the floor
|
|
3885
|
+
// for conversations with no explicit read entry, so opening the
|
|
3886
|
+
// messenger on a fresh browser doesn't mark every historical
|
|
3887
|
+
// thread as unread.
|
|
3888
|
+
readBootTs: "",
|
|
3873
3889
|
// ISO timestamp frozen at the moment the user *started viewing*
|
|
3874
3890
|
// the current thread (panel open + thread visible). Drives the
|
|
3875
3891
|
// "Non lus" separator inside the MessageList: messages newer than
|
|
@@ -3952,11 +3968,11 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
3952
3968
|
// so both are derived client-side from the cached messages + the
|
|
3953
3969
|
// local `readState`.
|
|
3954
3970
|
drawerConversations() {
|
|
3955
|
-
var
|
|
3956
|
-
const t = this.readState, e = ((
|
|
3957
|
-
return this.allConversations.map((
|
|
3958
|
-
const
|
|
3959
|
-
return { ...
|
|
3971
|
+
var o;
|
|
3972
|
+
const t = this.readState, e = this.readBootTs, n = ((o = this.s) == null ? void 0 : o.messagesByConv) || {};
|
|
3973
|
+
return this.allConversations.map((r) => {
|
|
3974
|
+
const s = n[r.id] || [], a = this.convLastActivity(r, s), d = t[r.id] || e || "", v = this.lastMessageAuthorType(s), k = !!a && v !== "user" && (!d || a > d);
|
|
3975
|
+
return { ...r, _preview: this.convPreview(r, s), _unread: k };
|
|
3960
3976
|
});
|
|
3961
3977
|
},
|
|
3962
3978
|
// How many threads have an unseen agent/human message. Drives the
|
|
@@ -3977,7 +3993,7 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
3977
3993
|
preview: n._preview || "Nouveau message",
|
|
3978
3994
|
unread: !!n._unread,
|
|
3979
3995
|
_ts: this.convLastActivity(n, t[n.id] || [])
|
|
3980
|
-
})).sort((n,
|
|
3996
|
+
})).sort((n, o) => n._ts < o._ts ? 1 : n._ts > o._ts ? -1 : 0).slice(0, 5);
|
|
3981
3997
|
},
|
|
3982
3998
|
// The unread thread with the freshest activity — what the étiquette
|
|
3983
3999
|
// previews. `{ convId, preview, ts }` or null when nothing's unread.
|
|
@@ -3985,10 +4001,10 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
3985
4001
|
var n;
|
|
3986
4002
|
const t = ((n = this.s) == null ? void 0 : n.messagesByConv) || {};
|
|
3987
4003
|
let e = null;
|
|
3988
|
-
for (const
|
|
3989
|
-
if (!
|
|
3990
|
-
const r = this.convLastActivity(
|
|
3991
|
-
(!e || r > e.ts) && (e = { convId:
|
|
4004
|
+
for (const o of this.drawerConversations) {
|
|
4005
|
+
if (!o._unread) continue;
|
|
4006
|
+
const r = this.convLastActivity(o, t[o.id] || []);
|
|
4007
|
+
(!e || r > e.ts) && (e = { convId: o.id, preview: o._preview, ts: r });
|
|
3992
4008
|
}
|
|
3993
4009
|
return e;
|
|
3994
4010
|
},
|
|
@@ -4025,14 +4041,14 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
4025
4041
|
var n;
|
|
4026
4042
|
const t = (n = this.widget) == null ? void 0 : n.quick_links;
|
|
4027
4043
|
if (!Array.isArray(t)) return "";
|
|
4028
|
-
const e = t.find((
|
|
4044
|
+
const e = t.find((o) => o.icon === "status" && o.url);
|
|
4029
4045
|
return (e == null ? void 0 : e.url) || "";
|
|
4030
4046
|
},
|
|
4031
4047
|
helpUrl() {
|
|
4032
4048
|
var n;
|
|
4033
4049
|
const t = (n = this.widget) == null ? void 0 : n.quick_links;
|
|
4034
4050
|
if (!Array.isArray(t)) return "";
|
|
4035
|
-
const e = t.find((
|
|
4051
|
+
const e = t.find((o) => (o.icon === "chat" || o.icon === "help") && o.url);
|
|
4036
4052
|
return (e == null ? void 0 : e.url) || "";
|
|
4037
4053
|
},
|
|
4038
4054
|
widget() {
|
|
@@ -4066,11 +4082,11 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
4066
4082
|
return ((t = this.widget) == null ? void 0 : t.response_time_label) || "";
|
|
4067
4083
|
},
|
|
4068
4084
|
humanMessageAuthor() {
|
|
4069
|
-
var e, n,
|
|
4085
|
+
var e, n, o;
|
|
4070
4086
|
if (!this.currentConv) return null;
|
|
4071
4087
|
const t = ((e = this.s.messagesByConv) == null ? void 0 : e[this.currentConv.id]) || [];
|
|
4072
4088
|
for (let r = t.length - 1; r >= 0; r--)
|
|
4073
|
-
if (((
|
|
4089
|
+
if (((o = (n = t[r]) == null ? void 0 : n.author) == null ? void 0 : o.type) === "agent_human") return t[r].author;
|
|
4074
4090
|
return null;
|
|
4075
4091
|
},
|
|
4076
4092
|
humanAgentName() {
|
|
@@ -4104,8 +4120,8 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
4104
4120
|
if (!t) return [];
|
|
4105
4121
|
const e = this.revealedAt;
|
|
4106
4122
|
return (this.s.messagesByConv[t.id] || []).filter((n) => {
|
|
4107
|
-
var
|
|
4108
|
-
return (n == null ? void 0 : n.type) === "action" && ((
|
|
4123
|
+
var o, r, s, a, d;
|
|
4124
|
+
return (n == null ? void 0 : n.type) === "action" && ((o = n == null ? void 0 : n.payload) == null ? void 0 : o.state) === "pending" || ie(n) && !(e[n.id] > 0) ? !1 : (n == null ? void 0 : n.type) === "action" || (n == null ? void 0 : n.type) === "system" || ((r = n == null ? void 0 : n.payload) == null ? void 0 : r.type) === "system" || Array.isArray((s = n == null ? void 0 : n.payload) == null ? void 0 : s.attachments) && n.payload.attachments.length || (a = n == null ? void 0 : n.metadata) != null && a.artifact || (d = n == null ? void 0 : n.metadata) != null && d.form ? !0 : typeof (n == null ? void 0 : n.text_md) == "string" && n.text_md.trim().length > 0;
|
|
4109
4125
|
});
|
|
4110
4126
|
},
|
|
4111
4127
|
// True whenever we should show the "typing" indicator at the bottom
|
|
@@ -4113,16 +4129,16 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
4113
4129
|
// or more agent messages are queued and waiting for their reveal
|
|
4114
4130
|
// slot to fire.
|
|
4115
4131
|
streamingActive() {
|
|
4116
|
-
var n,
|
|
4132
|
+
var n, o, r;
|
|
4117
4133
|
const t = this.currentConv;
|
|
4118
|
-
return t ? Object.keys(((n = this.s) == null ? void 0 : n.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : (((r = (
|
|
4134
|
+
return t ? Object.keys(((n = this.s) == null ? void 0 : n.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : (((r = (o = this.s) == null ? void 0 : o.messagesByConv) == null ? void 0 : r[t.id]) || []).some((s) => ie(s) && !(this.revealedAt[s.id] > 0)) : !1;
|
|
4119
4135
|
},
|
|
4120
4136
|
// Internal: the raw persisted list for the current conversation. We
|
|
4121
4137
|
// watch this to detect new agent messages that need to be paced.
|
|
4122
4138
|
currentConvMessages() {
|
|
4123
|
-
var e, n,
|
|
4139
|
+
var e, n, o;
|
|
4124
4140
|
const t = (e = this.currentConv) == null ? void 0 : e.id;
|
|
4125
|
-
return t ? ((
|
|
4141
|
+
return t ? ((o = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : o[t]) || [] : [];
|
|
4126
4142
|
},
|
|
4127
4143
|
pendingApproval() {
|
|
4128
4144
|
return !this.currentConv || !this.store || this.actionInFlight ? null : this.store.getPendingApproval(this.currentConv.id);
|
|
@@ -4147,14 +4163,14 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
4147
4163
|
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";
|
|
4148
4164
|
},
|
|
4149
4165
|
approvalDetail() {
|
|
4150
|
-
var
|
|
4151
|
-
const t = (s = (r = (
|
|
4166
|
+
var o, r, s, a, d, v;
|
|
4167
|
+
const t = (s = (r = (o = this.pendingApproval) == null ? void 0 : o.payload) == null ? void 0 : r.pending) == null ? void 0 : s.user_explanation;
|
|
4152
4168
|
if (typeof t == "string" && t.trim())
|
|
4153
4169
|
return t.trim();
|
|
4154
|
-
const e = (v = (d = (
|
|
4170
|
+
const e = (v = (d = (a = this.pendingApproval) == null ? void 0 : a.payload) == null ? void 0 : d.pending) == null ? void 0 : v.prepared_params;
|
|
4155
4171
|
if (!e || typeof e != "object") return "";
|
|
4156
4172
|
const n = Object.entries(e);
|
|
4157
|
-
return n.length ? n.slice(0, 2).map(([k,
|
|
4173
|
+
return n.length ? n.slice(0, 2).map(([k, w]) => `${k}: ${w}`).join(" · ") : "";
|
|
4158
4174
|
},
|
|
4159
4175
|
actionInFlight() {
|
|
4160
4176
|
var t, e;
|
|
@@ -4186,13 +4202,13 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
4186
4202
|
return this.approvalReady || !!this.pendingForm || this.showFeedback || this.suggestions.length > 0;
|
|
4187
4203
|
},
|
|
4188
4204
|
dateLabel() {
|
|
4189
|
-
var n,
|
|
4205
|
+
var n, o, r;
|
|
4190
4206
|
const t = this.currentConv;
|
|
4191
4207
|
let e = /* @__PURE__ */ new Date();
|
|
4192
4208
|
if (t) {
|
|
4193
|
-
const
|
|
4194
|
-
if (
|
|
4195
|
-
const d = new Date(
|
|
4209
|
+
const a = ((r = (((o = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : o[t.id]) || []).find((d) => d == null ? void 0 : d.created_at)) == null ? void 0 : r.created_at) || t.created_at;
|
|
4210
|
+
if (a) {
|
|
4211
|
+
const d = new Date(a);
|
|
4196
4212
|
Number.isNaN(d.getTime()) || (e = d);
|
|
4197
4213
|
}
|
|
4198
4214
|
}
|
|
@@ -4203,8 +4219,8 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
4203
4219
|
// history available, nothing loading) so the loader stays inert
|
|
4204
4220
|
// until `openConversation` has populated the entry.
|
|
4205
4221
|
paginationState() {
|
|
4206
|
-
var n,
|
|
4207
|
-
const t = (n = this.currentConv) == null ? void 0 : n.id, e = t ? (r = (
|
|
4222
|
+
var n, o, r;
|
|
4223
|
+
const t = (n = this.currentConv) == null ? void 0 : n.id, e = t ? (r = (o = this.s) == null ? void 0 : o.paginationByConv) == null ? void 0 : r[t] : null;
|
|
4208
4224
|
return {
|
|
4209
4225
|
loading: !!(e != null && e.loading),
|
|
4210
4226
|
hasMore: !!(e != null && e.nextCursor)
|
|
@@ -4242,8 +4258,8 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
4242
4258
|
isViewingThread(t, e) {
|
|
4243
4259
|
var n;
|
|
4244
4260
|
if (t && !e) {
|
|
4245
|
-
const
|
|
4246
|
-
this.unreadAnchorTs =
|
|
4261
|
+
const o = (n = this.currentConv) == null ? void 0 : n.id;
|
|
4262
|
+
this.unreadAnchorTs = o && this.readState[o] || "", this.unreadBoundaryTs = o ? (/* @__PURE__ */ new Date()).toISOString() : "";
|
|
4247
4263
|
} else t || (this.unreadAnchorTs = "", this.unreadBoundaryTs = "");
|
|
4248
4264
|
},
|
|
4249
4265
|
// Fresh `pendingApproval` arrival : kick off the settle debounce so
|
|
@@ -4292,7 +4308,7 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
4292
4308
|
immediate: !0
|
|
4293
4309
|
},
|
|
4294
4310
|
currentConvMessages(t) {
|
|
4295
|
-
var
|
|
4311
|
+
var o;
|
|
4296
4312
|
if (!Array.isArray(t) || !t.length) return;
|
|
4297
4313
|
const e = Date.now(), n = { ...this.revealedAt };
|
|
4298
4314
|
for (const r of t) {
|
|
@@ -4306,8 +4322,8 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
4306
4322
|
n[r.id] = e;
|
|
4307
4323
|
continue;
|
|
4308
4324
|
}
|
|
4309
|
-
const
|
|
4310
|
-
if (!
|
|
4325
|
+
const a = typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0, d = Array.isArray((o = r == null ? void 0 : r.payload) == null ? void 0 : o.attachments) && r.payload.attachments.length > 0;
|
|
4326
|
+
if (!a && !d) {
|
|
4311
4327
|
n[r.id] = e;
|
|
4312
4328
|
continue;
|
|
4313
4329
|
}
|
|
@@ -4346,12 +4362,12 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
4346
4362
|
return;
|
|
4347
4363
|
}
|
|
4348
4364
|
this.floatRO = new ResizeObserver((n) => {
|
|
4349
|
-
const
|
|
4350
|
-
if (!
|
|
4351
|
-
const r = Math.ceil(
|
|
4365
|
+
const o = n[0];
|
|
4366
|
+
if (!o) return;
|
|
4367
|
+
const r = Math.ceil(o.contentRect.height + 8);
|
|
4352
4368
|
r !== this.floatHeight && (this.floatHeight = r, this.$nextTick(() => {
|
|
4353
|
-
var s,
|
|
4354
|
-
(
|
|
4369
|
+
var s, a;
|
|
4370
|
+
(a = (s = this.$refs.messageList) == null ? void 0 : s.scrollToBottom) == null || a.call(s);
|
|
4355
4371
|
}));
|
|
4356
4372
|
}), this.floatRO.observe(e);
|
|
4357
4373
|
}
|
|
@@ -4372,14 +4388,14 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
4372
4388
|
// create/update stamps as a floor.
|
|
4373
4389
|
convLastActivity(t, e) {
|
|
4374
4390
|
let n = (t == null ? void 0 : t.last_message_at) || (t == null ? void 0 : t.updated_at) || (t == null ? void 0 : t.created_at) || "";
|
|
4375
|
-
for (const
|
|
4376
|
-
|
|
4391
|
+
for (const o of e)
|
|
4392
|
+
o != null && o.created_at && o.created_at > n && (n = o.created_at);
|
|
4377
4393
|
return n;
|
|
4378
4394
|
},
|
|
4379
4395
|
lastMessageAuthorType(t) {
|
|
4380
4396
|
var e, n;
|
|
4381
|
-
for (let
|
|
4382
|
-
const r = (n = (e = t[
|
|
4397
|
+
for (let o = t.length - 1; o >= 0; o--) {
|
|
4398
|
+
const r = (n = (e = t[o]) == null ? void 0 : e.author) == null ? void 0 : n.type;
|
|
4383
4399
|
if (r) return r;
|
|
4384
4400
|
}
|
|
4385
4401
|
return "";
|
|
@@ -4388,14 +4404,14 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
4388
4404
|
// back to whatever preview the server happened to attach when the
|
|
4389
4405
|
// thread's messages aren't cached yet (never opened this session).
|
|
4390
4406
|
convPreview(t, e) {
|
|
4391
|
-
var n,
|
|
4407
|
+
var n, o, r;
|
|
4392
4408
|
for (let s = e.length - 1; s >= 0; s--) {
|
|
4393
|
-
const
|
|
4394
|
-
if (!
|
|
4395
|
-
const d = typeof
|
|
4409
|
+
const a = e[s];
|
|
4410
|
+
if (!a) continue;
|
|
4411
|
+
const d = typeof a.text_md == "string" ? a.text_md.trim() : "";
|
|
4396
4412
|
if (d)
|
|
4397
|
-
return (((n =
|
|
4398
|
-
const v = (
|
|
4413
|
+
return (((n = a.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + d.replace(/\s+/g, " ");
|
|
4414
|
+
const v = (o = a.payload) == null ? void 0 : o.attachments;
|
|
4399
4415
|
if (Array.isArray(v) && v.length) return "📎 Pièce jointe";
|
|
4400
4416
|
}
|
|
4401
4417
|
return (t == null ? void 0 : t.last_message_preview) || (t == null ? void 0 : t.preview) || ((r = t == null ? void 0 : t.metadata) == null ? void 0 : r.last_preview) || "";
|
|
@@ -4404,13 +4420,20 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
4404
4420
|
const t = this.widgetId || "", e = this.userId || "";
|
|
4405
4421
|
return `wm:read:${t}:${e}`;
|
|
4406
4422
|
},
|
|
4423
|
+
readBootStorageKey() {
|
|
4424
|
+
const t = this.widgetId || "", e = this.userId || "";
|
|
4425
|
+
return `wm:read-boot:${t}:${e}`;
|
|
4426
|
+
},
|
|
4407
4427
|
hydrateReadState() {
|
|
4408
4428
|
try {
|
|
4409
4429
|
if (typeof localStorage > "u") return;
|
|
4410
4430
|
const t = localStorage.getItem(this.readStorageKey());
|
|
4411
|
-
if (
|
|
4412
|
-
|
|
4413
|
-
|
|
4431
|
+
if (t) {
|
|
4432
|
+
const n = JSON.parse(t);
|
|
4433
|
+
n && typeof n == "object" && (this.readState = n);
|
|
4434
|
+
}
|
|
4435
|
+
let e = localStorage.getItem(this.readBootStorageKey()) || "";
|
|
4436
|
+
e || (e = (/* @__PURE__ */ new Date()).toISOString(), localStorage.setItem(this.readBootStorageKey(), e)), this.readBootTs = e;
|
|
4414
4437
|
} catch {
|
|
4415
4438
|
}
|
|
4416
4439
|
},
|
|
@@ -4425,9 +4448,9 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
4425
4448
|
// Called when the user opens/starts a thread and whenever the
|
|
4426
4449
|
// actively-viewed thread receives new messages.
|
|
4427
4450
|
markConvRead(t) {
|
|
4428
|
-
var
|
|
4451
|
+
var o, r;
|
|
4429
4452
|
if (!(t != null && t.id) || t._draft) return;
|
|
4430
|
-
const e = ((r = (
|
|
4453
|
+
const e = ((r = (o = this.s) == null ? void 0 : o.messagesByConv) == null ? void 0 : r[t.id]) || [], n = this.convLastActivity(t, e);
|
|
4431
4454
|
n && this.readState[t.id] !== n && (this.readState = { ...this.readState, [t.id]: n }, this.persistReadState());
|
|
4432
4455
|
},
|
|
4433
4456
|
cancelReveals() {
|
|
@@ -4460,17 +4483,17 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
4460
4483
|
// - inter-bubble gap scales with message length (reading time),
|
|
4461
4484
|
// bounded by MIN/MAX_BETWEEN_MS.
|
|
4462
4485
|
scheduleReveal(t) {
|
|
4463
|
-
const e = Date.now(), n = ((t == null ? void 0 : t.text_md) || "").length,
|
|
4486
|
+
const e = Date.now(), n = ((t == null ? void 0 : t.text_md) || "").length, o = Math.min(
|
|
4464
4487
|
Pi,
|
|
4465
4488
|
Math.max(Ui, n * ji)
|
|
4466
4489
|
), s = Math.max(
|
|
4467
4490
|
e + Ni,
|
|
4468
4491
|
this.nextRevealAt + Hi
|
|
4469
|
-
) +
|
|
4492
|
+
) + o;
|
|
4470
4493
|
this.nextRevealAt = s;
|
|
4471
|
-
const
|
|
4494
|
+
const a = Math.max(0, s - e), d = t.id, v = setTimeout(() => {
|
|
4472
4495
|
this.revealedAt = { ...this.revealedAt, [d]: Date.now() }, this.revealTimers = this.revealTimers.filter((k) => k !== v);
|
|
4473
|
-
},
|
|
4496
|
+
}, a);
|
|
4474
4497
|
this.revealTimers.push(v);
|
|
4475
4498
|
},
|
|
4476
4499
|
async boot() {
|
|
@@ -4636,14 +4659,14 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
4636
4659
|
}
|
|
4637
4660
|
},
|
|
4638
4661
|
onIncomingNotification(t) {
|
|
4639
|
-
var
|
|
4662
|
+
var a;
|
|
4640
4663
|
if (!this.notifEnabled) return;
|
|
4641
4664
|
const e = t == null ? void 0 : t.conversation_id, n = t == null ? void 0 : t.message;
|
|
4642
4665
|
if (!e || !n || !ie(n)) return;
|
|
4643
|
-
const
|
|
4644
|
-
if (Number.isFinite(
|
|
4666
|
+
const o = n != null && n.created_at ? Date.parse(n.created_at) : NaN;
|
|
4667
|
+
if (Number.isFinite(o) && o < this.convOpenedAt - 1e3) return;
|
|
4645
4668
|
const r = typeof document < "u" && document.hidden;
|
|
4646
|
-
this.isOpen && !r && ((
|
|
4669
|
+
this.isOpen && !r && ((a = this.currentConv) == null ? void 0 : a.id) === e || (this.playNotificationSound(), this.showBrowserNotification(e, n));
|
|
4647
4670
|
},
|
|
4648
4671
|
playNotificationSound() {
|
|
4649
4672
|
if (typeof window > "u") return;
|
|
@@ -4657,17 +4680,17 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
4657
4680
|
e.resume();
|
|
4658
4681
|
} catch {
|
|
4659
4682
|
}
|
|
4660
|
-
const n = e.currentTime,
|
|
4661
|
-
|
|
4683
|
+
const n = e.currentTime, o = e.createOscillator(), r = e.createGain();
|
|
4684
|
+
o.connect(r), r.connect(e.destination), o.type = "sine", o.frequency.setValueAtTime(880, n), o.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), o.start(n), o.stop(n + 0.32);
|
|
4662
4685
|
} catch {
|
|
4663
4686
|
}
|
|
4664
4687
|
},
|
|
4665
4688
|
showBrowserNotification(t, e) {
|
|
4666
|
-
var
|
|
4689
|
+
var a;
|
|
4667
4690
|
if (typeof Notification > "u" || Notification.permission !== "granted") return;
|
|
4668
|
-
const n = this.allConversations.find((d) => d.id === t),
|
|
4691
|
+
const n = this.allConversations.find((d) => d.id === t), o = (n == null ? void 0 : n.name) || ((a = this.widget) == null ? void 0 : a.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";
|
|
4669
4692
|
try {
|
|
4670
|
-
const d = new Notification(
|
|
4693
|
+
const d = new Notification(o, {
|
|
4671
4694
|
body: s,
|
|
4672
4695
|
tag: `wm-${t}`,
|
|
4673
4696
|
renotify: !1,
|
|
@@ -4726,12 +4749,12 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
4726
4749
|
if (!(!n || n === e.name))
|
|
4727
4750
|
try {
|
|
4728
4751
|
await this.store.patchConversation(e.id, { name: n });
|
|
4729
|
-
} catch (
|
|
4730
|
-
console.error("[ww-messenger] rename failed",
|
|
4752
|
+
} catch (o) {
|
|
4753
|
+
console.error("[ww-messenger] rename failed", o);
|
|
4731
4754
|
}
|
|
4732
4755
|
},
|
|
4733
4756
|
exportCurrentConv() {
|
|
4734
|
-
var r, s,
|
|
4757
|
+
var r, s, a, d, v, k;
|
|
4735
4758
|
const t = this.currentConv;
|
|
4736
4759
|
if (!t) return;
|
|
4737
4760
|
const e = (((s = (r = this.s) == null ? void 0 : r.messagesByConv) == null ? void 0 : s[t.id]) || []).slice(), n = [
|
|
@@ -4739,26 +4762,26 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
4739
4762
|
t.created_at ? `Créée le : ${t.created_at}` : "",
|
|
4740
4763
|
""
|
|
4741
4764
|
];
|
|
4742
|
-
for (const
|
|
4743
|
-
if (!
|
|
4744
|
-
const S = ((
|
|
4765
|
+
for (const w of e) {
|
|
4766
|
+
if (!w) continue;
|
|
4767
|
+
const S = ((a = w.author) == null ? void 0 : a.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"), F = w.created_at ? new Date(w.created_at).toLocaleString("fr-FR") : "", A = (w.text_md || "").trim();
|
|
4745
4768
|
A && (n.push(`[${F}] ${S} :`), n.push(A), n.push(""));
|
|
4746
4769
|
}
|
|
4747
|
-
const
|
|
4770
|
+
const o = new Blob([n.join(`
|
|
4748
4771
|
`)], { type: "text/plain;charset=utf-8" });
|
|
4749
4772
|
try {
|
|
4750
|
-
const
|
|
4751
|
-
S.href =
|
|
4752
|
-
} catch (
|
|
4753
|
-
console.error("[ww-messenger] export failed",
|
|
4773
|
+
const w = URL.createObjectURL(o), S = document.createElement("a");
|
|
4774
|
+
S.href = w, S.download = `${(t.name || "conversation").replace(/[^a-z0-9-_]+/gi, "_")}.txt`, document.body.appendChild(S), S.click(), document.body.removeChild(S), setTimeout(() => URL.revokeObjectURL(w), 1e3);
|
|
4775
|
+
} catch (w) {
|
|
4776
|
+
console.error("[ww-messenger] export failed", w);
|
|
4754
4777
|
}
|
|
4755
4778
|
},
|
|
4756
4779
|
async onSend(t) {
|
|
4757
4780
|
let e = this.currentConv;
|
|
4758
4781
|
if (!e && (this.startConv(), e = this.currentConv, !e) || e._draft && (e = await this.ensureRealConv(), !e))
|
|
4759
4782
|
return;
|
|
4760
|
-
const n = e.id,
|
|
4761
|
-
this.pendingAttachments = [], this.unreadAnchorTs = "", this.unreadBoundaryTs = "", await this.store.send(n, t, { attachments:
|
|
4783
|
+
const n = e.id, o = this.pendingAttachments.slice();
|
|
4784
|
+
this.pendingAttachments = [], this.unreadAnchorTs = "", this.unreadBoundaryTs = "", await this.store.send(n, t, { attachments: o.length ? o : void 0 });
|
|
4762
4785
|
},
|
|
4763
4786
|
async onSuggestion(t) {
|
|
4764
4787
|
const e = t == null ? void 0 : t.label;
|
|
@@ -4778,8 +4801,8 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
4778
4801
|
if (!(e != null && e.form)) return;
|
|
4779
4802
|
const n = Fi(e.form, t);
|
|
4780
4803
|
if (!n) return;
|
|
4781
|
-
let
|
|
4782
|
-
|
|
4804
|
+
let o = this.currentConv;
|
|
4805
|
+
o && (o._draft && (o = await this.ensureRealConv(), !o) || await this.store.send(o.id, n, {
|
|
4783
4806
|
metadata: {
|
|
4784
4807
|
artifact: Di(e.form, t)
|
|
4785
4808
|
}
|
|
@@ -4846,12 +4869,12 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
|
4846
4869
|
key: 2,
|
|
4847
4870
|
class: "wm-attached"
|
|
4848
4871
|
}, Qi = ["onClick"];
|
|
4849
|
-
function ea(t, e, n,
|
|
4850
|
-
const
|
|
4872
|
+
function ea(t, e, n, o, r, s) {
|
|
4873
|
+
const a = B("Launcher"), d = B("Header"), v = B("Onboarding"), k = B("MessageList"), w = B("ApprovalCard"), S = B("FormCard"), F = B("Feedback"), A = B("SuggestionChips"), U = B("Composer"), x = B("MoreMenu"), j = B("RenameDialog"), P = B("HistoryDrawer");
|
|
4851
4874
|
return l(), c("div", {
|
|
4852
4875
|
class: E(["wm-root", `wm-root--${n.displayMode}`])
|
|
4853
4876
|
}, [
|
|
4854
|
-
!r.isOpen && !s.isEmbedded ? (l(), L(
|
|
4877
|
+
!r.isOpen && !s.isEmbedded ? (l(), L(a, {
|
|
4855
4878
|
key: 0,
|
|
4856
4879
|
"unread-count": s.unreadCount,
|
|
4857
4880
|
peek: s.launcherPeek,
|
|
@@ -4926,7 +4949,7 @@ function ea(t, e, n, a, r, s) {
|
|
|
4926
4949
|
], -1)),
|
|
4927
4950
|
i("div", null, [
|
|
4928
4951
|
e[10] || (e[10] = i("div", { class: "wm-state__errTitle" }, "Connexion impossible", -1)),
|
|
4929
|
-
i("div", Ki,
|
|
4952
|
+
i("div", Ki, b(s.error), 1)
|
|
4930
4953
|
])
|
|
4931
4954
|
])
|
|
4932
4955
|
])) : s.currentConv ? (l(), c(M, { key: 2 }, [
|
|
@@ -4944,7 +4967,7 @@ function ea(t, e, n, a, r, s) {
|
|
|
4944
4967
|
}, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "unread-anchor-ts", "unread-boundary-ts", "onLoadMore"]),
|
|
4945
4968
|
i("div", Gi, [
|
|
4946
4969
|
s.floatVisible ? (l(), c("div", Yi, [
|
|
4947
|
-
s.approvalReady ? (l(), L(
|
|
4970
|
+
s.approvalReady ? (l(), L(w, {
|
|
4948
4971
|
key: 0,
|
|
4949
4972
|
action: s.approvalTitle,
|
|
4950
4973
|
detail: s.approvalDetail,
|
|
@@ -4970,7 +4993,7 @@ function ea(t, e, n, a, r, s) {
|
|
|
4970
4993
|
class: "wm-actionWait__spinner",
|
|
4971
4994
|
"aria-hidden": "true"
|
|
4972
4995
|
}, null, -1)),
|
|
4973
|
-
i("span", Xi,
|
|
4996
|
+
i("span", Xi, b(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
|
|
4974
4997
|
])) : (l(), L(U, {
|
|
4975
4998
|
key: 2,
|
|
4976
4999
|
ref: "composer",
|
|
@@ -5019,7 +5042,7 @@ function ea(t, e, n, a, r, s) {
|
|
|
5019
5042
|
}, [
|
|
5020
5043
|
i("path", { d: "M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48" })
|
|
5021
5044
|
], -1)),
|
|
5022
|
-
i("span", null,
|
|
5045
|
+
i("span", null, b(R.name), 1),
|
|
5023
5046
|
i("button", {
|
|
5024
5047
|
type: "button",
|
|
5025
5048
|
"aria-label": "Retirer",
|
|
@@ -5076,7 +5099,7 @@ function ea(t, e, n, a, r, s) {
|
|
|
5076
5099
|
], 6)) : y("", !0)
|
|
5077
5100
|
], 2);
|
|
5078
5101
|
}
|
|
5079
|
-
const sa = /* @__PURE__ */ $(zi, [["render", ea], ["__scopeId", "data-v-
|
|
5102
|
+
const sa = /* @__PURE__ */ $(zi, [["render", ea], ["__scopeId", "data-v-e5f17e35"]]), ra = "0.3.4";
|
|
5080
5103
|
export {
|
|
5081
5104
|
ne as AIAvatar,
|
|
5082
5105
|
ce as AVATAR_COLORS,
|