@_solaris/messenger-widget 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/messenger.cjs +9 -9
- package/dist/messenger.embed.js +14 -14
- package/dist/messenger.js +1202 -1175
- package/dist/style.css +1 -1
- package/dist/types/core/markdown.d.ts +14 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/messenger.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
const
|
|
1
|
+
import { reactive as Fe, openBlock as c, createElementBlock as u, normalizeStyle as W, normalizeClass as x, toDisplayString as v, resolveComponent as I, createVNode as z, Transition as je, withCtx as Pe, Fragment as L, renderList as j, withKeys as ue, withModifiers as X, createElementVNode as o, createCommentVNode as b, createBlock as R, withDirectives as V, vModelText as Z, createTextVNode as pe, resolveDynamicComponent as De, renderSlot as Ue, vModelCheckbox as $e, vModelSelect as He, markRaw as ye } from "vue";
|
|
2
|
+
const ze = [
|
|
3
3
|
"connected",
|
|
4
4
|
"message",
|
|
5
5
|
"message_stream",
|
|
6
6
|
"conversation_updated",
|
|
7
7
|
"config_updated",
|
|
8
8
|
"action_status"
|
|
9
|
-
], be = "/client",
|
|
10
|
-
function
|
|
9
|
+
], be = "/client", qe = 5 * 60 * 1e3, Ve = 10 * 60 * 1e3, We = 5 * 60 * 1e3;
|
|
10
|
+
function Ke(e) {
|
|
11
11
|
const t = {
|
|
12
|
-
baseUrl:
|
|
12
|
+
baseUrl: Ge(e.baseUrl || ""),
|
|
13
13
|
widgetId: e.widgetId || "",
|
|
14
14
|
userId: e.userId || "",
|
|
15
15
|
userHash: e.userHash || "",
|
|
@@ -34,7 +34,7 @@ function We(e) {
|
|
|
34
34
|
function n(d, f) {
|
|
35
35
|
return t.listeners.has(d) || t.listeners.set(d, /* @__PURE__ */ new Set()), t.listeners.get(d).add(f), () => t.listeners.get(d).delete(f);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function i(d, f) {
|
|
38
38
|
const _ = t.listeners.get(d);
|
|
39
39
|
_ && _.forEach((y) => {
|
|
40
40
|
try {
|
|
@@ -44,8 +44,8 @@ function We(e) {
|
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
t.connection !== d && (t.connection = d,
|
|
47
|
+
function r(d) {
|
|
48
|
+
t.connection !== d && (t.connection = d, i("connection", d));
|
|
49
49
|
}
|
|
50
50
|
function s() {
|
|
51
51
|
return {
|
|
@@ -54,7 +54,7 @@ function We(e) {
|
|
|
54
54
|
"X-Widget-Id": t.widgetId
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
async function
|
|
57
|
+
async function a(d, f, _) {
|
|
58
58
|
const y = await fetch(`${t.baseUrl}${be}${f}`, {
|
|
59
59
|
method: d,
|
|
60
60
|
headers: { "Content-Type": "application/json", ...s() },
|
|
@@ -90,7 +90,7 @@ function We(e) {
|
|
|
90
90
|
return _.json();
|
|
91
91
|
}),
|
|
92
92
|
// HMAC-protected.
|
|
93
|
-
|
|
93
|
+
a("GET", "/customers/me")
|
|
94
94
|
]);
|
|
95
95
|
return {
|
|
96
96
|
config: (
|
|
@@ -101,45 +101,45 @@ function We(e) {
|
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
103
|
async function C() {
|
|
104
|
-
const d = await
|
|
104
|
+
const d = await a("GET", "/customers/me");
|
|
105
105
|
return (d == null ? void 0 : d.customer) ?? null;
|
|
106
106
|
}
|
|
107
107
|
async function k(d) {
|
|
108
|
-
const f = await
|
|
108
|
+
const f = await a("PATCH", "/customers/me", d);
|
|
109
109
|
return (f == null ? void 0 : f.customer) ?? null;
|
|
110
110
|
}
|
|
111
111
|
async function T() {
|
|
112
|
-
const d = await
|
|
112
|
+
const d = await a("GET", "/conversations");
|
|
113
113
|
return (d == null ? void 0 : d.conversations) ?? [];
|
|
114
114
|
}
|
|
115
115
|
async function B(d = {}) {
|
|
116
|
-
return (await
|
|
116
|
+
return (await a("POST", "/conversations", d)).conversation;
|
|
117
117
|
}
|
|
118
118
|
async function A(d) {
|
|
119
|
-
return (await
|
|
119
|
+
return (await a(
|
|
120
120
|
"GET",
|
|
121
121
|
`/conversations/${encodeURIComponent(d)}`
|
|
122
122
|
)).conversation;
|
|
123
123
|
}
|
|
124
124
|
async function H(d, f) {
|
|
125
|
-
return (await
|
|
125
|
+
return (await a(
|
|
126
126
|
"PATCH",
|
|
127
127
|
`/conversations/${encodeURIComponent(d)}`,
|
|
128
128
|
f
|
|
129
129
|
)).conversation;
|
|
130
130
|
}
|
|
131
131
|
async function M(d, f) {
|
|
132
|
-
return
|
|
132
|
+
return a(
|
|
133
133
|
"PATCH",
|
|
134
134
|
`/conversations/${encodeURIComponent(d)}/read`,
|
|
135
135
|
{ message_id: f }
|
|
136
136
|
);
|
|
137
137
|
}
|
|
138
|
-
async function
|
|
138
|
+
async function D(d, f = {}) {
|
|
139
139
|
const _ = new URLSearchParams();
|
|
140
140
|
f.before && _.set("before", f.before), f.since && _.set("since", f.since), f.limit && _.set("limit", String(f.limit));
|
|
141
141
|
const y = _.toString() ? `?${_.toString()}` : "";
|
|
142
|
-
return
|
|
142
|
+
return a(
|
|
143
143
|
"GET",
|
|
144
144
|
`/conversations/${encodeURIComponent(d)}/messages${y}`
|
|
145
145
|
);
|
|
@@ -153,14 +153,14 @@ function We(e) {
|
|
|
153
153
|
author: { id: t.userId, type: "user" },
|
|
154
154
|
created_at: f.created_at || (/* @__PURE__ */ new Date()).toISOString()
|
|
155
155
|
};
|
|
156
|
-
return Array.isArray(f.attachments) && f.attachments.length && (_.payload = { type: "content", attachments: f.attachments }), f.metadata && typeof f.metadata == "object" && (_.metadata = f.metadata),
|
|
156
|
+
return Array.isArray(f.attachments) && f.attachments.length && (_.payload = { type: "content", attachments: f.attachments }), f.metadata && typeof f.metadata == "object" && (_.metadata = f.metadata), a(
|
|
157
157
|
"POST",
|
|
158
158
|
`/conversations/${encodeURIComponent(d)}/messages`,
|
|
159
159
|
_
|
|
160
160
|
);
|
|
161
161
|
}
|
|
162
162
|
async function $(d, f, _) {
|
|
163
|
-
return q(),
|
|
163
|
+
return q(), a(
|
|
164
164
|
"POST",
|
|
165
165
|
`/messages/${encodeURIComponent(d)}/callbacks/${encodeURIComponent(f)}`,
|
|
166
166
|
_ ? { inputs: _ } : {}
|
|
@@ -172,7 +172,7 @@ function We(e) {
|
|
|
172
172
|
d.name || "attachment"
|
|
173
173
|
), _ = d.type || "application/octet-stream", y = d.size || 0, w = (
|
|
174
174
|
/** @type {import('./types.js').AttachmentUploadTicket} */
|
|
175
|
-
await
|
|
175
|
+
await a("POST", "/attachments", {
|
|
176
176
|
mime_type: _,
|
|
177
177
|
size_bytes: y,
|
|
178
178
|
name: f
|
|
@@ -185,14 +185,14 @@ function We(e) {
|
|
|
185
185
|
if (!S.ok)
|
|
186
186
|
throw new Error(`HTTP ${S.status} PUT signed upload`);
|
|
187
187
|
return {
|
|
188
|
-
type:
|
|
188
|
+
type: Ye(_),
|
|
189
189
|
path: w.path,
|
|
190
190
|
mime_type: _,
|
|
191
191
|
size_bytes: y
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
194
|
async function ee(d) {
|
|
195
|
-
return
|
|
195
|
+
return a(
|
|
196
196
|
"GET",
|
|
197
197
|
`/attachments/sign?path=${encodeURIComponent(d)}`
|
|
198
198
|
);
|
|
@@ -209,66 +209,66 @@ function We(e) {
|
|
|
209
209
|
if (!t.eventSource && !(typeof document < "u" && document.hidden))
|
|
210
210
|
try {
|
|
211
211
|
const d = new EventSource(te());
|
|
212
|
-
for (const f of
|
|
212
|
+
for (const f of ze)
|
|
213
213
|
d.addEventListener(f, (_) => Y(f, _.data));
|
|
214
214
|
d.addEventListener(
|
|
215
215
|
"error",
|
|
216
|
-
() =>
|
|
217
|
-
), t.eventSource = d,
|
|
216
|
+
() => i("error", new Error("SSE error"))
|
|
217
|
+
), t.eventSource = d, r("open");
|
|
218
218
|
} catch (d) {
|
|
219
|
-
console.error("[transport] SSE open failed", d),
|
|
219
|
+
console.error("[transport] SSE open failed", d), i("error", d);
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
function Y(d, f) {
|
|
223
223
|
try {
|
|
224
224
|
const _ = JSON.parse(f), y = _ && typeof _ == "object" && "data" in _ ? _.data : _;
|
|
225
|
-
|
|
225
|
+
i(d, y);
|
|
226
226
|
} catch (_) {
|
|
227
227
|
console.error("[transport] bad SSE payload", d, _);
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
function Q() {
|
|
231
|
-
t.eventSource && (t.eventSource.close(), t.eventSource = null), t.connection !== "paused" &&
|
|
231
|
+
t.eventSource && (t.eventSource.close(), t.eventSource = null), t.connection !== "paused" && r("idle");
|
|
232
232
|
}
|
|
233
233
|
function q() {
|
|
234
234
|
clearTimeout(t.burstTimer), G(), t.panelOpen || (t.burstTimer = setTimeout(() => {
|
|
235
235
|
t.panelOpen || Q();
|
|
236
|
-
},
|
|
236
|
+
}, Ve));
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function me(d) {
|
|
239
239
|
t.panelOpen = !!d, t.panelOpen ? (clearTimeout(t.burstTimer), G()) : q();
|
|
240
240
|
}
|
|
241
|
-
async function
|
|
241
|
+
async function ce() {
|
|
242
242
|
try {
|
|
243
243
|
const d = await T(), f = d.reduce((y, w) => {
|
|
244
244
|
const S = w == null ? void 0 : w.last_message_at;
|
|
245
245
|
return S && (!y || S > y) ? S : y;
|
|
246
246
|
}, null);
|
|
247
|
-
f && (!t.lastActivityAt || f > t.lastActivityAt) && (t.lastActivityAt = f,
|
|
247
|
+
f && (!t.lastActivityAt || f > t.lastActivityAt) && (t.lastActivityAt = f, i("activity", { conversations: d, latestAt: f }), q());
|
|
248
248
|
} catch (d) {
|
|
249
249
|
console.error("[transport] poll failed", d);
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
function
|
|
253
|
-
ne(), !(typeof document < "u" && document.hidden) && (t.pollTimer = setInterval(
|
|
252
|
+
function de() {
|
|
253
|
+
ne(), !(typeof document < "u" && document.hidden) && (t.pollTimer = setInterval(ce, qe));
|
|
254
254
|
}
|
|
255
255
|
function ne() {
|
|
256
256
|
t.pollTimer && (clearInterval(t.pollTimer), t.pollTimer = null);
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function h() {
|
|
259
259
|
if (document.hidden)
|
|
260
260
|
clearTimeout(t.hiddenGraceTimer), t.hiddenGraceTimer = setTimeout(() => {
|
|
261
|
-
t.hiddenGraceTimer = null, document.hidden && (ne(), Q(),
|
|
262
|
-
},
|
|
261
|
+
t.hiddenGraceTimer = null, document.hidden && (ne(), Q(), r("paused"));
|
|
262
|
+
}, We);
|
|
263
263
|
else {
|
|
264
264
|
if (t.hiddenGraceTimer) {
|
|
265
265
|
clearTimeout(t.hiddenGraceTimer), t.hiddenGraceTimer = null;
|
|
266
266
|
return;
|
|
267
267
|
}
|
|
268
|
-
|
|
268
|
+
r("idle"), de(), t.panelOpen && G();
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
|
-
async function
|
|
271
|
+
async function m() {
|
|
272
272
|
if (t.started) return t.lastBootstrap;
|
|
273
273
|
t.started = !0;
|
|
274
274
|
const d = await g();
|
|
@@ -282,10 +282,10 @@ function We(e) {
|
|
|
282
282
|
} catch (f) {
|
|
283
283
|
console.error("[transport] initial /conversations failed", f);
|
|
284
284
|
}
|
|
285
|
-
return typeof document < "u" && (t.visibilityHandler =
|
|
285
|
+
return typeof document < "u" && (t.visibilityHandler = h, document.addEventListener(
|
|
286
286
|
"visibilitychange",
|
|
287
287
|
t.visibilityHandler
|
|
288
|
-
)),
|
|
288
|
+
)), de(), d;
|
|
289
289
|
}
|
|
290
290
|
function p() {
|
|
291
291
|
ne(), clearTimeout(t.burstTimer), clearTimeout(t.hiddenGraceTimer), t.hiddenGraceTimer = null, Q(), t.visibilityHandler && (document.removeEventListener(
|
|
@@ -295,9 +295,9 @@ function We(e) {
|
|
|
295
295
|
}
|
|
296
296
|
return {
|
|
297
297
|
on: n,
|
|
298
|
-
start:
|
|
298
|
+
start: m,
|
|
299
299
|
stop: p,
|
|
300
|
-
setPanelOpen:
|
|
300
|
+
setPanelOpen: me,
|
|
301
301
|
// REST
|
|
302
302
|
bootstrap: g,
|
|
303
303
|
getCustomer: C,
|
|
@@ -307,7 +307,7 @@ function We(e) {
|
|
|
307
307
|
getConversation: A,
|
|
308
308
|
patchConversation: H,
|
|
309
309
|
markConversationRead: M,
|
|
310
|
-
listMessages:
|
|
310
|
+
listMessages: D,
|
|
311
311
|
postMessage: N,
|
|
312
312
|
postCallback: $,
|
|
313
313
|
uploadAttachment: K,
|
|
@@ -318,13 +318,13 @@ function We(e) {
|
|
|
318
318
|
}
|
|
319
319
|
};
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function Ge(e) {
|
|
322
322
|
return e.endsWith("/") ? e.slice(0, -1) : e;
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function Ye(e) {
|
|
325
325
|
return e.startsWith("image/") ? "image" : e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : "file";
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function Qe() {
|
|
328
328
|
if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
|
|
329
329
|
return crypto.randomUUID();
|
|
330
330
|
const e = new Uint8Array(16);
|
|
@@ -336,8 +336,8 @@ function Ye() {
|
|
|
336
336
|
const t = [...e].map((n) => n.toString(16).padStart(2, "0"));
|
|
337
337
|
return t.slice(0, 4).join("") + "-" + t.slice(4, 6).join("") + "-" + t.slice(6, 8).join("") + "-" + t.slice(8, 10).join("") + "-" + t.slice(10, 16).join("");
|
|
338
338
|
}
|
|
339
|
-
function
|
|
340
|
-
const t =
|
|
339
|
+
function Xe(e) {
|
|
340
|
+
const t = Fe({
|
|
341
341
|
ready: !1,
|
|
342
342
|
error: null,
|
|
343
343
|
config: null,
|
|
@@ -369,48 +369,48 @@ function Qe(e) {
|
|
|
369
369
|
connection: "idle"
|
|
370
370
|
}), n = [];
|
|
371
371
|
n.push(
|
|
372
|
-
e.on("connection", (
|
|
373
|
-
t.connection =
|
|
372
|
+
e.on("connection", (h) => {
|
|
373
|
+
t.connection = h;
|
|
374
374
|
})
|
|
375
375
|
), n.push(
|
|
376
|
-
e.on("message", (
|
|
377
|
-
const
|
|
378
|
-
!
|
|
376
|
+
e.on("message", (h) => {
|
|
377
|
+
const m = h == null ? void 0 : h.conversation_id, p = h == null ? void 0 : h.message;
|
|
378
|
+
!m || !(p != null && p.id) || (Y(m, p), p.client_msg_id && delete t.streamingByMsgId[p.client_msg_id], me(m, p.created_at));
|
|
379
379
|
})
|
|
380
380
|
), n.push(
|
|
381
|
-
e.on("message_stream", (
|
|
382
|
-
const
|
|
383
|
-
!
|
|
381
|
+
e.on("message_stream", (h) => {
|
|
382
|
+
const m = h == null ? void 0 : h.message_id, p = h == null ? void 0 : h.token;
|
|
383
|
+
!m || typeof p != "string" || (t.streamingByMsgId[m] = (t.streamingByMsgId[m] || "") + p);
|
|
384
384
|
})
|
|
385
385
|
), n.push(
|
|
386
|
-
e.on("conversation_updated", (
|
|
387
|
-
const
|
|
388
|
-
if (!
|
|
389
|
-
const d = t.conversations.findIndex((f) => f.id ===
|
|
386
|
+
e.on("conversation_updated", (h) => {
|
|
387
|
+
const m = h == null ? void 0 : h.conversation_id, p = h == null ? void 0 : h.changes;
|
|
388
|
+
if (!m || !p) return;
|
|
389
|
+
const d = t.conversations.findIndex((f) => f.id === m);
|
|
390
390
|
d !== -1 && (t.conversations[d] = {
|
|
391
391
|
...t.conversations[d],
|
|
392
392
|
...p
|
|
393
393
|
});
|
|
394
394
|
})
|
|
395
395
|
), n.push(
|
|
396
|
-
e.on("config_updated", (
|
|
397
|
-
|
|
396
|
+
e.on("config_updated", (h) => {
|
|
397
|
+
h != null && h.config && (t.config = h.config);
|
|
398
398
|
})
|
|
399
399
|
), n.push(
|
|
400
|
-
e.on("action_status", (
|
|
401
|
-
const
|
|
402
|
-
if (!
|
|
403
|
-
const f = t.runningActionsByConv[
|
|
404
|
-
|
|
400
|
+
e.on("action_status", (h) => {
|
|
401
|
+
const m = h == null ? void 0 : h.conversation_id, p = h == null ? void 0 : h.action_id, d = h == null ? void 0 : h.action_name;
|
|
402
|
+
if (!m || !p) return;
|
|
403
|
+
const f = t.runningActionsByConv[m] || {};
|
|
404
|
+
h.state === "running" ? (f[p] = d || p, t.runningActionsByConv[m] = { ...f }) : h.state === "done" && (delete f[p], t.runningActionsByConv[m] = { ...f });
|
|
405
405
|
})
|
|
406
406
|
), n.push(
|
|
407
|
-
e.on("activity", (
|
|
408
|
-
Array.isArray(
|
|
407
|
+
e.on("activity", (h) => {
|
|
408
|
+
Array.isArray(h == null ? void 0 : h.conversations) && (t.conversations = h.conversations);
|
|
409
409
|
})
|
|
410
410
|
);
|
|
411
|
-
async function
|
|
411
|
+
async function i() {
|
|
412
412
|
try {
|
|
413
|
-
const
|
|
413
|
+
const h = new Promise(
|
|
414
414
|
(p, d) => setTimeout(
|
|
415
415
|
() => d(
|
|
416
416
|
new Error(
|
|
@@ -419,59 +419,59 @@ function Qe(e) {
|
|
|
419
419
|
),
|
|
420
420
|
15e3
|
|
421
421
|
)
|
|
422
|
-
),
|
|
423
|
-
t.config =
|
|
422
|
+
), m = await Promise.race([e.start(), h]);
|
|
423
|
+
t.config = m.config, t.customer = m.customer, t.conversations = await Promise.race([
|
|
424
424
|
e.listConversations(),
|
|
425
|
-
|
|
425
|
+
h
|
|
426
426
|
]), t.ready = !0;
|
|
427
|
-
} catch (
|
|
428
|
-
console.error("[store] start failed",
|
|
427
|
+
} catch (h) {
|
|
428
|
+
console.error("[store] start failed", h), t.error = (h == null ? void 0 : h.message) || String(h);
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
|
-
function
|
|
432
|
-
for (const
|
|
431
|
+
function r() {
|
|
432
|
+
for (const h of n)
|
|
433
433
|
try {
|
|
434
|
-
|
|
434
|
+
h();
|
|
435
435
|
} catch {
|
|
436
436
|
}
|
|
437
437
|
e.stop();
|
|
438
438
|
}
|
|
439
|
-
async function s(
|
|
440
|
-
const
|
|
441
|
-
if (!
|
|
439
|
+
async function s(h) {
|
|
440
|
+
const m = de(h);
|
|
441
|
+
if (!m) return t.customer;
|
|
442
442
|
try {
|
|
443
|
-
const p = await e.patchCustomer(
|
|
443
|
+
const p = await e.patchCustomer(m);
|
|
444
444
|
p && (t.customer = p);
|
|
445
445
|
} catch (p) {
|
|
446
446
|
console.error("[store] applyCustomer failed", p);
|
|
447
447
|
}
|
|
448
448
|
return t.customer;
|
|
449
449
|
}
|
|
450
|
-
async function
|
|
451
|
-
const
|
|
452
|
-
return p === -1 ? t.conversations = [
|
|
450
|
+
async function a(h = {}) {
|
|
451
|
+
const m = await e.createConversation(h), p = t.conversations.findIndex((d) => d.id === m.id);
|
|
452
|
+
return p === -1 ? t.conversations = [m, ...t.conversations] : t.conversations[p] = m, m;
|
|
453
453
|
}
|
|
454
454
|
const l = 50;
|
|
455
|
-
async function g(
|
|
456
|
-
const
|
|
457
|
-
if (!(
|
|
458
|
-
k(
|
|
455
|
+
async function g(h) {
|
|
456
|
+
const m = t.paginationByConv[h];
|
|
457
|
+
if (!(m != null && m.loaded || m != null && m.loading)) {
|
|
458
|
+
k(h, { nextCursor: null, loading: !0, loaded: !1 });
|
|
459
459
|
try {
|
|
460
|
-
const p = await e.listMessages(
|
|
460
|
+
const p = await e.listMessages(h, {
|
|
461
461
|
limit: l
|
|
462
|
-
}), d = (p == null ? void 0 : p.messages) ?? [], f = t.messagesByConv[
|
|
462
|
+
}), d = (p == null ? void 0 : p.messages) ?? [], f = t.messagesByConv[h] || [], _ = /* @__PURE__ */ new Set();
|
|
463
463
|
for (const w of d)
|
|
464
464
|
(w == null ? void 0 : w.id) != null && _.add(`id:${String(w.id)}`), w != null && w.client_msg_id && _.add(`c:${w.client_msg_id}`);
|
|
465
465
|
const y = f.filter((w) => !((w == null ? void 0 : w.id) != null && _.has(`id:${String(w.id)}`) || w != null && w.client_msg_id && _.has(`c:${w.client_msg_id}`)));
|
|
466
|
-
t.messagesByConv[
|
|
467
|
-
|
|
468
|
-
), k(
|
|
466
|
+
t.messagesByConv[h] = [...d, ...y].sort(
|
|
467
|
+
ce
|
|
468
|
+
), k(h, {
|
|
469
469
|
nextCursor: (p == null ? void 0 : p.next_cursor) ?? null,
|
|
470
470
|
loading: !1,
|
|
471
471
|
loaded: !0
|
|
472
472
|
});
|
|
473
473
|
} catch (p) {
|
|
474
|
-
console.error("[store] openConversation failed", p), k(
|
|
474
|
+
console.error("[store] openConversation failed", p), k(h, {
|
|
475
475
|
nextCursor: null,
|
|
476
476
|
loading: !1,
|
|
477
477
|
loaded: !1
|
|
@@ -479,67 +479,67 @@ function Qe(e) {
|
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
|
-
async function C(
|
|
482
|
+
async function C(h) {
|
|
483
483
|
var f;
|
|
484
|
-
const
|
|
485
|
-
if (!
|
|
486
|
-
const d = (f = (t.messagesByConv[
|
|
484
|
+
const m = t.paginationByConv[h];
|
|
485
|
+
if (!m || m.loading || !m.nextCursor) return;
|
|
486
|
+
const d = (f = (t.messagesByConv[h] || []).find((_) => _ == null ? void 0 : _.created_at)) == null ? void 0 : f.created_at;
|
|
487
487
|
if (d) {
|
|
488
|
-
k(
|
|
488
|
+
k(h, { ...m, loading: !0 });
|
|
489
489
|
try {
|
|
490
|
-
const _ = await e.listMessages(
|
|
490
|
+
const _ = await e.listMessages(h, {
|
|
491
491
|
before: d,
|
|
492
492
|
limit: l
|
|
493
|
-
}), y = (_ == null ? void 0 : _.messages) ?? [], w = t.messagesByConv[
|
|
493
|
+
}), y = (_ == null ? void 0 : _.messages) ?? [], w = t.messagesByConv[h] || [], S = /* @__PURE__ */ new Set();
|
|
494
494
|
for (const O of w)
|
|
495
495
|
(O == null ? void 0 : O.id) != null && S.add(`id:${String(O.id)}`), O != null && O.client_msg_id && S.add(`c:${O.client_msg_id}`);
|
|
496
496
|
const F = y.filter((O) => !((O == null ? void 0 : O.id) != null && S.has(`id:${String(O.id)}`) || O != null && O.client_msg_id && S.has(`c:${O.client_msg_id}`)));
|
|
497
|
-
t.messagesByConv[
|
|
497
|
+
t.messagesByConv[h] = [...F, ...w], k(h, {
|
|
498
498
|
nextCursor: (_ == null ? void 0 : _.next_cursor) ?? null,
|
|
499
499
|
loading: !1,
|
|
500
500
|
loaded: !0
|
|
501
501
|
});
|
|
502
502
|
} catch (_) {
|
|
503
|
-
console.error("[store] loadMore failed", _), k(
|
|
503
|
+
console.error("[store] loadMore failed", _), k(h, { ...m, loading: !1 });
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
function k(
|
|
508
|
-
t.paginationByConv = { ...t.paginationByConv, [
|
|
507
|
+
function k(h, m) {
|
|
508
|
+
t.paginationByConv = { ...t.paginationByConv, [h]: m };
|
|
509
509
|
}
|
|
510
|
-
async function T(
|
|
511
|
-
const p = await e.patchConversation(
|
|
510
|
+
async function T(h, m) {
|
|
511
|
+
const p = await e.patchConversation(h, m), d = t.conversations.findIndex((f) => f.id === h);
|
|
512
512
|
d !== -1 && (t.conversations[d] = p);
|
|
513
513
|
}
|
|
514
|
-
async function B(
|
|
515
|
-
if (!
|
|
516
|
-
const
|
|
514
|
+
async function B(h) {
|
|
515
|
+
if (!h) return [];
|
|
516
|
+
const m = t.messagesByConv[h] || [];
|
|
517
517
|
let p = "";
|
|
518
|
-
for (const d of
|
|
518
|
+
for (const d of m)
|
|
519
519
|
d != null && d.created_at && d.created_at > p && (p = d.created_at);
|
|
520
520
|
try {
|
|
521
521
|
const d = await e.listMessages(
|
|
522
|
-
|
|
522
|
+
h,
|
|
523
523
|
p ? { since: p } : {}
|
|
524
524
|
), f = (d == null ? void 0 : d.messages) || [];
|
|
525
525
|
if (!f.length) return [];
|
|
526
526
|
const _ = /* @__PURE__ */ new Set(), y = /* @__PURE__ */ new Set();
|
|
527
|
-
for (const S of
|
|
527
|
+
for (const S of m)
|
|
528
528
|
(S == null ? void 0 : S.id) != null && _.add(String(S.id)), S != null && S.client_msg_id && y.add(S.client_msg_id);
|
|
529
529
|
const w = [];
|
|
530
530
|
for (const S of f) {
|
|
531
531
|
const F = (S == null ? void 0 : S.id) != null && _.has(String(S.id)) || (S == null ? void 0 : S.client_msg_id) && y.has(S.client_msg_id);
|
|
532
|
-
Y(
|
|
532
|
+
Y(h, S), F || w.push(S);
|
|
533
533
|
}
|
|
534
534
|
return w;
|
|
535
535
|
} catch (d) {
|
|
536
536
|
return console.error("[store] fetchSinceLast failed", d), [];
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
|
-
async function A(
|
|
540
|
-
if (!(!
|
|
539
|
+
async function A(h, m) {
|
|
540
|
+
if (!(!h || m == null))
|
|
541
541
|
try {
|
|
542
|
-
const p = await e.markConversationRead(
|
|
542
|
+
const p = await e.markConversationRead(h, m), d = (p == null ? void 0 : p.last_read_message_id) ?? m, f = t.conversations.findIndex((_) => (_ == null ? void 0 : _.id) === h);
|
|
543
543
|
f !== -1 && (t.conversations[f] = {
|
|
544
544
|
...t.conversations[f],
|
|
545
545
|
last_read_message_id: d
|
|
@@ -548,14 +548,14 @@ function Qe(e) {
|
|
|
548
548
|
console.error("[store] markConversationRead failed", p);
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
|
-
async function H(
|
|
551
|
+
async function H(h, m, { attachments: p, metadata: d } = {}) {
|
|
552
552
|
var F;
|
|
553
|
-
const f = (
|
|
554
|
-
if (!
|
|
555
|
-
const y =
|
|
553
|
+
const f = (m || "").trim(), _ = Array.isArray(p) && p.length > 0;
|
|
554
|
+
if (!h || !f && !_) return;
|
|
555
|
+
const y = Qe(), w = ne(h), S = {
|
|
556
556
|
id: y,
|
|
557
557
|
client_msg_id: y,
|
|
558
|
-
conversation_id:
|
|
558
|
+
conversation_id: h,
|
|
559
559
|
type: "content",
|
|
560
560
|
text_md: f,
|
|
561
561
|
author: {
|
|
@@ -568,9 +568,9 @@ function Qe(e) {
|
|
|
568
568
|
..._ ? { payload: { type: "content", attachments: p } } : {},
|
|
569
569
|
...d && typeof d == "object" ? { metadata: d } : {}
|
|
570
570
|
};
|
|
571
|
-
Y(
|
|
571
|
+
Y(h, S);
|
|
572
572
|
try {
|
|
573
|
-
await e.postMessage(
|
|
573
|
+
await e.postMessage(h, {
|
|
574
574
|
client_msg_id: y,
|
|
575
575
|
text_md: f,
|
|
576
576
|
created_at: w,
|
|
@@ -578,32 +578,32 @@ function Qe(e) {
|
|
|
578
578
|
...d && typeof d == "object" ? { metadata: d } : {}
|
|
579
579
|
});
|
|
580
580
|
} catch (O) {
|
|
581
|
-
console.error("[store] send failed", O), q(
|
|
581
|
+
console.error("[store] send failed", O), q(h, y, {
|
|
582
582
|
_failed: !0,
|
|
583
583
|
_pending: !1
|
|
584
584
|
});
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
|
-
async function M(
|
|
588
|
-
|
|
587
|
+
async function M(h, m, p) {
|
|
588
|
+
h != null && (t.awaitingCallback[h] = !0);
|
|
589
589
|
try {
|
|
590
|
-
await e.postCallback(
|
|
590
|
+
await e.postCallback(h, m, p);
|
|
591
591
|
} catch (d) {
|
|
592
|
-
console.error("[store] callback failed", d),
|
|
592
|
+
console.error("[store] callback failed", d), h != null && delete t.awaitingCallback[h];
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
|
-
const
|
|
596
|
-
async function N(
|
|
597
|
-
if (!
|
|
598
|
-
const
|
|
599
|
-
if (
|
|
600
|
-
const p =
|
|
601
|
-
if (!p || p - Date.now() > 6e4) return
|
|
595
|
+
const D = /* @__PURE__ */ new Map();
|
|
596
|
+
async function N(h) {
|
|
597
|
+
if (!h) return null;
|
|
598
|
+
const m = D.get(h);
|
|
599
|
+
if (m != null && m.url) {
|
|
600
|
+
const p = m.expires_at ? Date.parse(m.expires_at) : 0;
|
|
601
|
+
if (!p || p - Date.now() > 6e4) return m.url;
|
|
602
602
|
}
|
|
603
603
|
try {
|
|
604
|
-
const p = await e.signAttachment(
|
|
604
|
+
const p = await e.signAttachment(h);
|
|
605
605
|
if (p != null && p.signed_url)
|
|
606
|
-
return
|
|
606
|
+
return D.set(h, {
|
|
607
607
|
url: p.signed_url,
|
|
608
608
|
expires_at: p.expires_at
|
|
609
609
|
}), p.signed_url;
|
|
@@ -612,32 +612,32 @@ function Qe(e) {
|
|
|
612
612
|
}
|
|
613
613
|
return null;
|
|
614
614
|
}
|
|
615
|
-
async function $(
|
|
616
|
-
const d = t.conversations.find((y) => y.id ===
|
|
615
|
+
async function $(h, { rating: m, comment: p } = {}) {
|
|
616
|
+
const d = t.conversations.find((y) => y.id === h), _ = {
|
|
617
617
|
...(d == null ? void 0 : d.metadata) || {},
|
|
618
618
|
feedback: {
|
|
619
|
-
rating:
|
|
619
|
+
rating: m,
|
|
620
620
|
comment: p || null,
|
|
621
621
|
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
622
622
|
}
|
|
623
623
|
};
|
|
624
|
-
await T(
|
|
624
|
+
await T(h, { metadata: _ });
|
|
625
625
|
}
|
|
626
|
-
function K(
|
|
626
|
+
function K(h) {
|
|
627
627
|
var p, d;
|
|
628
|
-
const
|
|
629
|
-
for (let f =
|
|
630
|
-
const _ =
|
|
628
|
+
const m = t.messagesByConv[h] || [];
|
|
629
|
+
for (let f = m.length - 1; f >= 0; f--) {
|
|
630
|
+
const _ = m[f];
|
|
631
631
|
if ((_ == null ? void 0 : _.type) === "action" && ((p = _ == null ? void 0 : _.payload) == null ? void 0 : p.type) === "action" && ((d = _ == null ? void 0 : _.payload) == null ? void 0 : d.state) === "pending" && Array.isArray(_ == null ? void 0 : _.callbacks) && _.callbacks.length > 0 && !t.awaitingCallback[_.id])
|
|
632
632
|
return _;
|
|
633
633
|
}
|
|
634
634
|
return null;
|
|
635
635
|
}
|
|
636
|
-
function ee(
|
|
636
|
+
function ee(h) {
|
|
637
637
|
var p, d, f;
|
|
638
|
-
const
|
|
639
|
-
for (let _ =
|
|
640
|
-
const y =
|
|
638
|
+
const m = t.messagesByConv[h] || [];
|
|
639
|
+
for (let _ = m.length - 1; _ >= 0; _--) {
|
|
640
|
+
const y = m[_];
|
|
641
641
|
if (((p = y == null ? void 0 : y.author) == null ? void 0 : p.type) === "user" || (y == null ? void 0 : y.type) === "action" && ((d = y == null ? void 0 : y.payload) == null ? void 0 : d.state) === "pending")
|
|
642
642
|
return null;
|
|
643
643
|
const w = (f = y == null ? void 0 : y.metadata) == null ? void 0 : f.form;
|
|
@@ -646,19 +646,19 @@ function Qe(e) {
|
|
|
646
646
|
}
|
|
647
647
|
return null;
|
|
648
648
|
}
|
|
649
|
-
function te(
|
|
650
|
-
const
|
|
651
|
-
if (!
|
|
652
|
-
const p = Object.keys(
|
|
649
|
+
function te(h) {
|
|
650
|
+
const m = t.runningActionsByConv[h];
|
|
651
|
+
if (!m) return null;
|
|
652
|
+
const p = Object.keys(m);
|
|
653
653
|
if (p.length === 0) return null;
|
|
654
654
|
const d = p[0];
|
|
655
|
-
return { id: d, payload: { name:
|
|
655
|
+
return { id: d, payload: { name: m[d] } };
|
|
656
656
|
}
|
|
657
|
-
function G(
|
|
657
|
+
function G(h) {
|
|
658
658
|
var p, d, f, _;
|
|
659
|
-
const
|
|
660
|
-
for (let y =
|
|
661
|
-
const w =
|
|
659
|
+
const m = t.messagesByConv[h] || [];
|
|
660
|
+
for (let y = m.length - 1; y >= 0; y--) {
|
|
661
|
+
const w = m[y];
|
|
662
662
|
if (((p = w == null ? void 0 : w.author) == null ? void 0 : p.type) === "user") return [];
|
|
663
663
|
if ((w == null ? void 0 : w.type) === "action" && ((d = w == null ? void 0 : w.payload) == null ? void 0 : d.state) === "pending")
|
|
664
664
|
return [];
|
|
@@ -672,75 +672,75 @@ function Qe(e) {
|
|
|
672
672
|
if (F && typeof F == "object" && typeof F.label == "string") {
|
|
673
673
|
const O = F.label.trim();
|
|
674
674
|
if (!O) return null;
|
|
675
|
-
const
|
|
676
|
-
return { label: O, kind:
|
|
675
|
+
const Ne = F.kind === "cta" || F.kind === "choice" || F.kind === "followup" ? F.kind : null;
|
|
676
|
+
return { label: O, kind: Ne };
|
|
677
677
|
}
|
|
678
678
|
return null;
|
|
679
679
|
}).filter(Boolean).slice(0, 4) : [];
|
|
680
680
|
}
|
|
681
681
|
return [];
|
|
682
682
|
}
|
|
683
|
-
function Y(
|
|
683
|
+
function Y(h, m) {
|
|
684
684
|
var _;
|
|
685
|
-
const p = t.messagesByConv[
|
|
685
|
+
const p = t.messagesByConv[h] || [];
|
|
686
686
|
let d = -1;
|
|
687
|
-
|
|
688
|
-
(y) => (y == null ? void 0 : y.client_msg_id) && y.client_msg_id ===
|
|
689
|
-
)), d === -1 && (
|
|
687
|
+
m != null && m.client_msg_id && (d = p.findIndex(
|
|
688
|
+
(y) => (y == null ? void 0 : y.client_msg_id) && y.client_msg_id === m.client_msg_id
|
|
689
|
+
)), d === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (d = p.findIndex((y) => Q(y == null ? void 0 : y.id, m.id)));
|
|
690
690
|
let f;
|
|
691
|
-
d === -1 ? f = [...p,
|
|
691
|
+
d === -1 ? f = [...p, m].sort(ce) : (f = p.slice(), f[d] = {
|
|
692
692
|
...p[d],
|
|
693
|
-
...
|
|
693
|
+
...m,
|
|
694
694
|
_pending: !1,
|
|
695
695
|
_failed: !1
|
|
696
|
-
}), t.messagesByConv[
|
|
696
|
+
}), t.messagesByConv[h] = f, (m == null ? void 0 : m.type) === "action" && ((_ = m == null ? void 0 : m.payload) != null && _.state) && m.payload.state !== "pending" && (m == null ? void 0 : m.id) != null && t.awaitingCallback[m.id] && delete t.awaitingCallback[m.id];
|
|
697
697
|
}
|
|
698
|
-
function Q(
|
|
699
|
-
return
|
|
698
|
+
function Q(h, m) {
|
|
699
|
+
return h === m ? !0 : h == null || m == null ? !1 : String(h) === String(m);
|
|
700
700
|
}
|
|
701
|
-
function q(
|
|
702
|
-
const d = t.messagesByConv[
|
|
701
|
+
function q(h, m, p) {
|
|
702
|
+
const d = t.messagesByConv[h];
|
|
703
703
|
if (!d) return;
|
|
704
|
-
const f = d.findIndex((y) => y.id ===
|
|
704
|
+
const f = d.findIndex((y) => y.id === m);
|
|
705
705
|
if (f === -1) return;
|
|
706
706
|
const _ = d.slice();
|
|
707
|
-
_[f] = { ...d[f], ...p }, t.messagesByConv[
|
|
707
|
+
_[f] = { ...d[f], ...p }, t.messagesByConv[h] = _;
|
|
708
708
|
}
|
|
709
|
-
function
|
|
710
|
-
const p = t.conversations.findIndex((f) => f.id ===
|
|
709
|
+
function me(h, m) {
|
|
710
|
+
const p = t.conversations.findIndex((f) => f.id === h);
|
|
711
711
|
if (p === -1) return;
|
|
712
712
|
const d = t.conversations[p];
|
|
713
|
-
if (
|
|
713
|
+
if (m && (!d.last_message_at || m > d.last_message_at)) {
|
|
714
714
|
const f = t.conversations.slice();
|
|
715
|
-
f[p] = { ...d, last_message_at:
|
|
715
|
+
f[p] = { ...d, last_message_at: m }, f.sort(
|
|
716
716
|
(_, y) => (y.last_message_at || "").localeCompare(_.last_message_at || "")
|
|
717
717
|
), t.conversations = f;
|
|
718
718
|
}
|
|
719
719
|
}
|
|
720
|
-
function
|
|
721
|
-
return (
|
|
720
|
+
function ce(h, m) {
|
|
721
|
+
return (h.created_at || "").localeCompare(m.created_at || "");
|
|
722
722
|
}
|
|
723
|
-
function
|
|
724
|
-
if (!
|
|
725
|
-
const
|
|
726
|
-
for (const [d, f] of Object.entries(
|
|
727
|
-
f !== void 0 && (d === "name" || d === "email" ? f != null && String(f).trim() !== "" && (
|
|
728
|
-
return Object.keys(p).length && (
|
|
723
|
+
function de(h) {
|
|
724
|
+
if (!h || typeof h != "object") return null;
|
|
725
|
+
const m = {}, p = {};
|
|
726
|
+
for (const [d, f] of Object.entries(h))
|
|
727
|
+
f !== void 0 && (d === "name" || d === "email" ? f != null && String(f).trim() !== "" && (m[d] = f) : (d === "values" || d === "metadata") && f && typeof f == "object" ? Object.assign(p, f) : p[d] = f);
|
|
728
|
+
return Object.keys(p).length && (m.values = p), Object.keys(m).length ? m : null;
|
|
729
729
|
}
|
|
730
|
-
function ne(
|
|
731
|
-
const
|
|
730
|
+
function ne(h) {
|
|
731
|
+
const m = t.messagesByConv[h] || [];
|
|
732
732
|
let p = "";
|
|
733
|
-
for (const _ of
|
|
733
|
+
for (const _ of m)
|
|
734
734
|
_ != null && _.created_at && _.created_at > p && (p = _.created_at);
|
|
735
735
|
const d = (/* @__PURE__ */ new Date()).toISOString();
|
|
736
736
|
return !p || d > p ? d : new Date(Date.parse(p) + 1).toISOString();
|
|
737
737
|
}
|
|
738
738
|
return {
|
|
739
739
|
state: t,
|
|
740
|
-
start:
|
|
741
|
-
destroy:
|
|
740
|
+
start: i,
|
|
741
|
+
destroy: r,
|
|
742
742
|
applyCustomer: s,
|
|
743
|
-
createConversation:
|
|
743
|
+
createConversation: a,
|
|
744
744
|
openConversation: g,
|
|
745
745
|
loadMore: C,
|
|
746
746
|
fetchSinceLast: B,
|
|
@@ -791,7 +791,7 @@ function Oe(e = "") {
|
|
|
791
791
|
function Le(e = /* @__PURE__ */ new Date(), t = "fr-FR") {
|
|
792
792
|
return e.toLocaleTimeString(t, { hour: "2-digit", minute: "2-digit" });
|
|
793
793
|
}
|
|
794
|
-
const
|
|
794
|
+
const Je = `
|
|
795
795
|
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');
|
|
796
796
|
|
|
797
797
|
.wm-root {
|
|
@@ -837,7 +837,7 @@ const Xe = `
|
|
|
837
837
|
0% { transform: translateX(110%); opacity: 0; }
|
|
838
838
|
100% { transform: translateX(0); opacity: 1; }
|
|
839
839
|
}
|
|
840
|
-
`,
|
|
840
|
+
`, Ze = "https://api.messenger.victorc.fr", ie = "fr", et = ["fr", "en"], we = { fr: "fr-FR", en: "en-US" }, _e = {
|
|
841
841
|
fr: {
|
|
842
842
|
// ── Common ───────────────────────────────────────────────────────
|
|
843
843
|
"common.newConversation": "Nouvelle conversation",
|
|
@@ -1080,67 +1080,67 @@ I reply within seconds.`,
|
|
|
1080
1080
|
}
|
|
1081
1081
|
};
|
|
1082
1082
|
function ge(e) {
|
|
1083
|
-
if (typeof e != "string") return
|
|
1083
|
+
if (typeof e != "string") return ie;
|
|
1084
1084
|
const t = e.trim().toLowerCase().slice(0, 2);
|
|
1085
|
-
return
|
|
1085
|
+
return et.includes(t) ? t : ie;
|
|
1086
1086
|
}
|
|
1087
|
-
function
|
|
1088
|
-
return we[ge(e)] || we[
|
|
1087
|
+
function oe(e) {
|
|
1088
|
+
return we[ge(e)] || we[ie];
|
|
1089
1089
|
}
|
|
1090
|
-
function
|
|
1091
|
-
const t = ge(e), n = _e[t] || _e[
|
|
1092
|
-
return function(s,
|
|
1090
|
+
function P(e) {
|
|
1091
|
+
const t = ge(e), n = _e[t] || _e[ie], i = _e[ie];
|
|
1092
|
+
return function(s, a) {
|
|
1093
1093
|
let l = n[s];
|
|
1094
|
-
return l == null && (l =
|
|
1094
|
+
return l == null && (l = i[s]), l == null ? s : (a && (l = l.replace(
|
|
1095
1095
|
/\{(\w+)\}/g,
|
|
1096
|
-
(g, C) =>
|
|
1096
|
+
(g, C) => a[C] != null ? String(a[C]) : g
|
|
1097
1097
|
)), l);
|
|
1098
1098
|
};
|
|
1099
1099
|
}
|
|
1100
1100
|
function ke(e, t) {
|
|
1101
1101
|
if (!Array.isArray(e == null ? void 0 : e.options)) return t;
|
|
1102
|
-
const n = e.options.find((
|
|
1102
|
+
const n = e.options.find((i) => (i == null ? void 0 : i.value) === t);
|
|
1103
1103
|
return (n == null ? void 0 : n.label) || t;
|
|
1104
1104
|
}
|
|
1105
|
-
function
|
|
1106
|
-
return Array.isArray(t) ? t.map((
|
|
1105
|
+
function Ie(e, t, n) {
|
|
1106
|
+
return Array.isArray(t) ? t.map((i) => ke(e, String(i))).join(", ") : typeof t == "boolean" ? n(t ? "common.yes" : "common.no") : ke(e, String(t));
|
|
1107
1107
|
}
|
|
1108
|
-
function
|
|
1108
|
+
function tt(e, t, n = P()) {
|
|
1109
1109
|
if (!e || !t) return "";
|
|
1110
|
-
const
|
|
1111
|
-
for (const s of
|
|
1110
|
+
const i = Array.isArray(e.fields) ? e.fields : [], r = [];
|
|
1111
|
+
for (const s of i) {
|
|
1112
1112
|
if (!(s != null && s.key) || !(s != null && s.label)) continue;
|
|
1113
|
-
const
|
|
1114
|
-
if (
|
|
1115
|
-
const l =
|
|
1116
|
-
l &&
|
|
1113
|
+
const a = t[s.key];
|
|
1114
|
+
if (a == null || a === "") continue;
|
|
1115
|
+
const l = Ie(s, a, n);
|
|
1116
|
+
l && r.push(`${s.label} :
|
|
1117
1117
|
${l}`);
|
|
1118
1118
|
}
|
|
1119
|
-
return
|
|
1119
|
+
return r.join(`
|
|
1120
1120
|
|
|
1121
1121
|
`);
|
|
1122
1122
|
}
|
|
1123
|
-
function
|
|
1124
|
-
const
|
|
1125
|
-
for (const s of
|
|
1123
|
+
function nt(e, t, n = P()) {
|
|
1124
|
+
const i = [], r = Array.isArray(e == null ? void 0 : e.fields) ? e.fields : [];
|
|
1125
|
+
for (const s of r) {
|
|
1126
1126
|
if (!(s != null && s.key) || !(s != null && s.label)) continue;
|
|
1127
|
-
const
|
|
1128
|
-
if (
|
|
1129
|
-
const l =
|
|
1127
|
+
const a = t == null ? void 0 : t[s.key];
|
|
1128
|
+
if (a == null || a === "") continue;
|
|
1129
|
+
const l = Ie(s, a, n);
|
|
1130
1130
|
if (!l) continue;
|
|
1131
1131
|
const g = s.type === "textarea" || typeof l == "string" && (l.length > 60 || l.includes(`
|
|
1132
1132
|
`));
|
|
1133
|
-
|
|
1133
|
+
i.push({ label: s.label, value: l, multiline: g });
|
|
1134
1134
|
}
|
|
1135
1135
|
return {
|
|
1136
1136
|
kind: "form_response",
|
|
1137
1137
|
data: {
|
|
1138
1138
|
title: (e == null ? void 0 : e.title) || n("form.title"),
|
|
1139
|
-
fields:
|
|
1139
|
+
fields: i
|
|
1140
1140
|
}
|
|
1141
1141
|
};
|
|
1142
1142
|
}
|
|
1143
|
-
function
|
|
1143
|
+
function ae(e) {
|
|
1144
1144
|
var n;
|
|
1145
1145
|
const t = (n = e == null ? void 0 : e.author) == null ? void 0 : n.type;
|
|
1146
1146
|
return t === "agent_ia" || t === "agent_human";
|
|
@@ -1152,53 +1152,55 @@ function J(e) {
|
|
|
1152
1152
|
}
|
|
1153
1153
|
function Ce(e, t) {
|
|
1154
1154
|
let n = (e == null ? void 0 : e.last_message_at) || (e == null ? void 0 : e.updated_at) || (e == null ? void 0 : e.created_at) || "";
|
|
1155
|
-
for (const
|
|
1156
|
-
|
|
1155
|
+
for (const i of t)
|
|
1156
|
+
i != null && i.created_at && i.created_at > n && (n = i.created_at);
|
|
1157
1157
|
return n;
|
|
1158
1158
|
}
|
|
1159
|
-
function
|
|
1160
|
-
var n,
|
|
1159
|
+
function st(e, t) {
|
|
1160
|
+
var n, i, r;
|
|
1161
1161
|
for (let s = t.length - 1; s >= 0; s--) {
|
|
1162
|
-
const
|
|
1163
|
-
if (!
|
|
1164
|
-
const l = typeof
|
|
1162
|
+
const a = t[s];
|
|
1163
|
+
if (!a) continue;
|
|
1164
|
+
const l = typeof a.text_md == "string" ? a.text_md.trim() : "";
|
|
1165
1165
|
if (l)
|
|
1166
|
-
return (((n =
|
|
1167
|
-
const g = (
|
|
1166
|
+
return (((n = a.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + l.replace(/\s+/g, " ");
|
|
1167
|
+
const g = (i = a.payload) == null ? void 0 : i.attachments;
|
|
1168
1168
|
if (Array.isArray(g) && g.length) return "📎 Pièce jointe";
|
|
1169
1169
|
}
|
|
1170
|
-
return (e == null ? void 0 : e.last_message_preview) || (e == null ? void 0 : e.preview) || ((
|
|
1170
|
+
return (e == null ? void 0 : e.last_message_preview) || (e == null ? void 0 : e.preview) || ((r = e == null ? void 0 : e.metadata) == null ? void 0 : r.last_preview) || "";
|
|
1171
1171
|
}
|
|
1172
|
-
function
|
|
1172
|
+
function rt(e, t) {
|
|
1173
1173
|
return (e == null ? void 0 : e.name) || ((e == null ? void 0 : e.type) === "user" ? t("common.you") : (e == null ? void 0 : e.type) === "agent_human" ? t("common.agent") : (e == null ? void 0 : e.type) === "agent_ia" ? t("common.aiAssistant") : t("common.system"));
|
|
1174
1174
|
}
|
|
1175
|
-
function
|
|
1176
|
-
const
|
|
1175
|
+
function it(e, t, n, i) {
|
|
1176
|
+
const r = [
|
|
1177
1177
|
`# ${e.name || n("common.conversation")}`,
|
|
1178
|
-
e.created_at ? n("export.createdOn", {
|
|
1178
|
+
e.created_at ? n("export.createdOn", {
|
|
1179
|
+
date: new Date(e.created_at).toLocaleString(i)
|
|
1180
|
+
}) : "",
|
|
1179
1181
|
""
|
|
1180
1182
|
];
|
|
1181
1183
|
for (const s of t) {
|
|
1182
1184
|
if (!s) continue;
|
|
1183
|
-
const
|
|
1184
|
-
if (!
|
|
1185
|
-
const l =
|
|
1186
|
-
|
|
1185
|
+
const a = (s.text_md || "").trim();
|
|
1186
|
+
if (!a) continue;
|
|
1187
|
+
const l = rt(s.author, n), g = s.created_at ? new Date(s.created_at).toLocaleString(i) : "";
|
|
1188
|
+
r.push(`[${g}] ${l} :`), r.push(a), r.push("");
|
|
1187
1189
|
}
|
|
1188
|
-
return
|
|
1190
|
+
return r.join(`
|
|
1189
1191
|
`);
|
|
1190
1192
|
}
|
|
1191
|
-
function
|
|
1193
|
+
function at(e, t, n = P(), i) {
|
|
1192
1194
|
if (!e) return;
|
|
1193
|
-
const
|
|
1195
|
+
const r = it(e, t || [], n, oe(i)), s = new Blob([r], { type: "text/plain;charset=utf-8" });
|
|
1194
1196
|
try {
|
|
1195
|
-
const
|
|
1196
|
-
l.href =
|
|
1197
|
-
} catch (
|
|
1198
|
-
console.error("[ww-messenger] export failed",
|
|
1197
|
+
const a = URL.createObjectURL(s), l = document.createElement("a");
|
|
1198
|
+
l.href = a, l.download = `${(e.name || "conversation").replace(/[^a-z0-9-_]+/gi, "_")}.txt`, document.body.appendChild(l), l.click(), document.body.removeChild(l), setTimeout(() => URL.revokeObjectURL(a), 1e3);
|
|
1199
|
+
} catch (a) {
|
|
1200
|
+
console.error("[ww-messenger] export failed", a);
|
|
1199
1201
|
}
|
|
1200
1202
|
}
|
|
1201
|
-
const
|
|
1203
|
+
const ot = {
|
|
1202
1204
|
data() {
|
|
1203
1205
|
const e = typeof Notification < "u";
|
|
1204
1206
|
return {
|
|
@@ -1308,10 +1310,10 @@ const at = {
|
|
|
1308
1310
|
// at message-arrival time because the user may have closed the
|
|
1309
1311
|
// panel or switched threads during the typing dwell.
|
|
1310
1312
|
onMessageRevealed(e, t) {
|
|
1311
|
-
var
|
|
1312
|
-
if (!this.soundEnabled && !this.browserNotifEnabled || !t || !e || !
|
|
1313
|
+
var r;
|
|
1314
|
+
if (!this.soundEnabled && !this.browserNotifEnabled || !t || !e || !ae(e)) return;
|
|
1313
1315
|
const n = typeof document < "u" && document.hidden;
|
|
1314
|
-
this.isOpen && !n && ((
|
|
1316
|
+
this.isOpen && !n && ((r = this.currentConv) == null ? void 0 : r.id) === t || (this.soundEnabled && this.playNotificationSound(), this.browserNotifEnabled && this.showBrowserNotification(t, e));
|
|
1315
1317
|
},
|
|
1316
1318
|
playNotificationSound() {
|
|
1317
1319
|
if (typeof window > "u") return;
|
|
@@ -1325,41 +1327,38 @@ const at = {
|
|
|
1325
1327
|
t.resume();
|
|
1326
1328
|
} catch {
|
|
1327
1329
|
}
|
|
1328
|
-
const n = t.currentTime,
|
|
1329
|
-
|
|
1330
|
+
const n = t.currentTime, i = t.createOscillator(), r = t.createGain();
|
|
1331
|
+
i.connect(r), r.connect(t.destination), i.type = "sine", i.frequency.setValueAtTime(880, n), i.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), i.start(n), i.stop(n + 0.32);
|
|
1330
1332
|
} catch {
|
|
1331
1333
|
}
|
|
1332
1334
|
},
|
|
1333
1335
|
showBrowserNotification(e, t) {
|
|
1334
|
-
var i;
|
|
1335
1336
|
if (typeof Notification > "u" || Notification.permission !== "granted") return;
|
|
1336
|
-
const n = this.
|
|
1337
|
-
(l) => (l == null ? void 0 : l.id) === e
|
|
1338
|
-
), r = (n == null ? void 0 : n.name) || ((i = this.widget) == null ? void 0 : i.name) || this.t("notification.newMessage"), a = typeof (t == null ? void 0 : t.text_md) == "string" ? t.text_md.trim() : "", s = a ? a.slice(0, 140) : this.t("notification.youHaveNewMessage");
|
|
1337
|
+
const n = t == null ? void 0 : t.author, i = !n || n.type === "agent_ia", s = ((n == null ? void 0 : n.name) || (i ? this.agentName : "") || this.t("launcher.theAgent")) + this.t("launcher.repliedToYou"), a = typeof (t == null ? void 0 : t.text_md) == "string" ? t.text_md.trim() : "", l = a ? a.slice(0, 140) : this.t("notification.youHaveNewMessage");
|
|
1339
1338
|
try {
|
|
1340
|
-
const
|
|
1341
|
-
body:
|
|
1339
|
+
const g = new Notification(s, {
|
|
1340
|
+
body: l,
|
|
1342
1341
|
tag: `wm-${e}`,
|
|
1343
1342
|
renotify: !1,
|
|
1344
1343
|
silent: !0
|
|
1345
1344
|
});
|
|
1346
|
-
|
|
1345
|
+
g.onclick = () => {
|
|
1347
1346
|
try {
|
|
1348
1347
|
window.focus();
|
|
1349
1348
|
} catch {
|
|
1350
1349
|
}
|
|
1351
1350
|
this.draftConv = null, this.showOnboarding = !1, this.activeConvId = e, this.isOpen = !0, this.store && this.store.setPanelOpen(!0);
|
|
1352
1351
|
try {
|
|
1353
|
-
|
|
1352
|
+
g.close();
|
|
1354
1353
|
} catch {
|
|
1355
1354
|
}
|
|
1356
1355
|
};
|
|
1357
|
-
} catch (
|
|
1358
|
-
console.warn("[ww-messenger] notification failed",
|
|
1356
|
+
} catch (g) {
|
|
1357
|
+
console.warn("[ww-messenger] notification failed", g);
|
|
1359
1358
|
}
|
|
1360
1359
|
}
|
|
1361
1360
|
}
|
|
1362
|
-
},
|
|
1361
|
+
}, lt = 450, ct = 50, dt = 900, ut = 12e3, ht = 300, mt = {
|
|
1363
1362
|
data() {
|
|
1364
1363
|
return {
|
|
1365
1364
|
// Map: messageId → ms timestamp once shown.
|
|
@@ -1394,18 +1393,18 @@ const at = {
|
|
|
1394
1393
|
var n;
|
|
1395
1394
|
if (!this.transport) return;
|
|
1396
1395
|
this.teardownLiveReveal();
|
|
1397
|
-
const e = this.transport.on("message", (
|
|
1398
|
-
const
|
|
1399
|
-
|
|
1396
|
+
const e = this.transport.on("message", (i) => {
|
|
1397
|
+
const r = i == null ? void 0 : i.conversation_id, s = i == null ? void 0 : i.message;
|
|
1398
|
+
r && s && this.paceLiveMessage(s, r);
|
|
1400
1399
|
});
|
|
1401
1400
|
this._liveRevealConvSnapshot = new Map(
|
|
1402
|
-
(((n = this.s) == null ? void 0 : n.conversations) || []).map((
|
|
1403
|
-
|
|
1404
|
-
(
|
|
1401
|
+
(((n = this.s) == null ? void 0 : n.conversations) || []).map((i) => [
|
|
1402
|
+
i.id,
|
|
1403
|
+
(i == null ? void 0 : i.last_message_at) || ""
|
|
1405
1404
|
])
|
|
1406
1405
|
);
|
|
1407
|
-
const t = this.transport.on("activity", (
|
|
1408
|
-
this.handleLiveActivity(
|
|
1406
|
+
const t = this.transport.on("activity", (i) => {
|
|
1407
|
+
this.handleLiveActivity(i);
|
|
1409
1408
|
});
|
|
1410
1409
|
this._liveRevealOff = () => {
|
|
1411
1410
|
try {
|
|
@@ -1435,25 +1434,25 @@ const at = {
|
|
|
1435
1434
|
// on background convs when SSE wasn't open at the moment they
|
|
1436
1435
|
// arrived.
|
|
1437
1436
|
async handleLiveActivity(e) {
|
|
1438
|
-
var
|
|
1437
|
+
var r, s;
|
|
1439
1438
|
const t = e == null ? void 0 : e.conversations;
|
|
1440
1439
|
if (!Array.isArray(t) || !this.store) return;
|
|
1441
|
-
const n = this._liveRevealConvSnapshot || /* @__PURE__ */ new Map(),
|
|
1442
|
-
for (const
|
|
1443
|
-
if (!(
|
|
1444
|
-
const l =
|
|
1440
|
+
const n = this._liveRevealConvSnapshot || /* @__PURE__ */ new Map(), i = [];
|
|
1441
|
+
for (const a of t) {
|
|
1442
|
+
if (!(a != null && a.id)) continue;
|
|
1443
|
+
const l = a.last_message_at || "";
|
|
1445
1444
|
if (!l) continue;
|
|
1446
|
-
const g = n.get(
|
|
1447
|
-
l > g &&
|
|
1445
|
+
const g = n.get(a.id) || "";
|
|
1446
|
+
l > g && i.push(a.id);
|
|
1448
1447
|
}
|
|
1449
1448
|
this._liveRevealConvSnapshot = new Map(
|
|
1450
|
-
t.map((
|
|
1449
|
+
t.map((a) => [a.id, (a == null ? void 0 : a.last_message_at) || ""])
|
|
1451
1450
|
);
|
|
1452
|
-
for (const
|
|
1451
|
+
for (const a of i)
|
|
1453
1452
|
try {
|
|
1454
|
-
const l = await ((s = (
|
|
1453
|
+
const l = await ((s = (r = this.store).fetchSinceLast) == null ? void 0 : s.call(r, a));
|
|
1455
1454
|
if (!Array.isArray(l)) continue;
|
|
1456
|
-
for (const g of l) this.paceLiveMessage(g,
|
|
1455
|
+
for (const g of l) this.paceLiveMessage(g, a);
|
|
1457
1456
|
} catch (l) {
|
|
1458
1457
|
console.error(
|
|
1459
1458
|
"[ww-messenger] activity delta fetch failed",
|
|
@@ -1467,15 +1466,15 @@ const at = {
|
|
|
1467
1466
|
// - inter-bubble gap scales with message length (reading time),
|
|
1468
1467
|
// bounded by MIN/MAX_TYPING_MS.
|
|
1469
1468
|
scheduleReveal(e, t) {
|
|
1470
|
-
const n = Date.now(),
|
|
1471
|
-
|
|
1472
|
-
Math.max(
|
|
1473
|
-
),
|
|
1474
|
-
n +
|
|
1475
|
-
this.nextRevealAt +
|
|
1476
|
-
) +
|
|
1477
|
-
this.nextRevealAt =
|
|
1478
|
-
const l = Math.max(0,
|
|
1469
|
+
const n = Date.now(), i = ((e == null ? void 0 : e.text_md) || "").length, r = Math.min(
|
|
1470
|
+
ut,
|
|
1471
|
+
Math.max(dt, i * ct)
|
|
1472
|
+
), a = Math.max(
|
|
1473
|
+
n + lt,
|
|
1474
|
+
this.nextRevealAt + ht
|
|
1475
|
+
) + r;
|
|
1476
|
+
this.nextRevealAt = a;
|
|
1477
|
+
const l = Math.max(0, a - n), g = e.id, C = setTimeout(() => {
|
|
1479
1478
|
this.revealedAt = { ...this.revealedAt, [g]: Date.now() }, this.revealTimers = this.revealTimers.filter((k) => k !== C), typeof this.onMessageRevealed == "function" && this.onMessageRevealed(e, t);
|
|
1480
1479
|
}, l);
|
|
1481
1480
|
this.revealTimers.push(C);
|
|
@@ -1486,28 +1485,28 @@ const at = {
|
|
|
1486
1485
|
// history (instant) and any live message that the transport
|
|
1487
1486
|
// subscription already paced (idempotent on msg.id).
|
|
1488
1487
|
paceMessages(e, t) {
|
|
1489
|
-
var
|
|
1488
|
+
var r;
|
|
1490
1489
|
if (!Array.isArray(e) || !e.length) return;
|
|
1491
|
-
const n = Date.now(),
|
|
1490
|
+
const n = Date.now(), i = { ...this.revealedAt };
|
|
1492
1491
|
for (const s of e) {
|
|
1493
|
-
if ((s == null ? void 0 : s.id) == null ||
|
|
1494
|
-
if (!
|
|
1495
|
-
|
|
1492
|
+
if ((s == null ? void 0 : s.id) == null || i[s.id] !== void 0) continue;
|
|
1493
|
+
if (!ae(s)) {
|
|
1494
|
+
i[s.id] = n;
|
|
1496
1495
|
continue;
|
|
1497
1496
|
}
|
|
1498
|
-
const
|
|
1499
|
-
if (!Number.isFinite(
|
|
1500
|
-
|
|
1497
|
+
const a = s != null && s.created_at ? Date.parse(s.created_at) : NaN;
|
|
1498
|
+
if (!Number.isFinite(a) || a < this.convOpenedAt) {
|
|
1499
|
+
i[s.id] = n;
|
|
1501
1500
|
continue;
|
|
1502
1501
|
}
|
|
1503
|
-
const l = typeof (s == null ? void 0 : s.text_md) == "string" && s.text_md.trim().length > 0, g = Array.isArray((
|
|
1502
|
+
const l = typeof (s == null ? void 0 : s.text_md) == "string" && s.text_md.trim().length > 0, g = Array.isArray((r = s == null ? void 0 : s.payload) == null ? void 0 : r.attachments) && s.payload.attachments.length > 0;
|
|
1504
1503
|
if (!l && !g) {
|
|
1505
|
-
|
|
1504
|
+
i[s.id] = n;
|
|
1506
1505
|
continue;
|
|
1507
1506
|
}
|
|
1508
|
-
|
|
1507
|
+
i[s.id] = 0, this.scheduleReveal(s, t);
|
|
1509
1508
|
}
|
|
1510
|
-
this.revealedAt =
|
|
1509
|
+
this.revealedAt = i;
|
|
1511
1510
|
},
|
|
1512
1511
|
// Pace a single live message from any conversation. Called from the
|
|
1513
1512
|
// transport 'message' subscription (live SSE arrival) and from the
|
|
@@ -1520,21 +1519,21 @@ const at = {
|
|
|
1520
1519
|
// by definition live, even on convs the user never viewed this
|
|
1521
1520
|
// session.
|
|
1522
1521
|
paceLiveMessage(e, t) {
|
|
1523
|
-
var
|
|
1522
|
+
var r;
|
|
1524
1523
|
if (!(e != null && e.id) || this.revealedAt[e.id] !== void 0) return;
|
|
1525
|
-
if (!
|
|
1524
|
+
if (!ae(e)) {
|
|
1526
1525
|
this.revealedAt = { ...this.revealedAt, [e.id]: Date.now() };
|
|
1527
1526
|
return;
|
|
1528
1527
|
}
|
|
1529
|
-
const n = typeof (e == null ? void 0 : e.text_md) == "string" && e.text_md.trim().length > 0,
|
|
1530
|
-
if (!n && !
|
|
1528
|
+
const n = typeof (e == null ? void 0 : e.text_md) == "string" && e.text_md.trim().length > 0, i = Array.isArray((r = e == null ? void 0 : e.payload) == null ? void 0 : r.attachments) && e.payload.attachments.length > 0;
|
|
1529
|
+
if (!n && !i) {
|
|
1531
1530
|
this.revealedAt = { ...this.revealedAt, [e.id]: Date.now() };
|
|
1532
1531
|
return;
|
|
1533
1532
|
}
|
|
1534
1533
|
this.revealedAt = { ...this.revealedAt, [e.id]: 0 }, this.scheduleReveal(e, t);
|
|
1535
1534
|
}
|
|
1536
1535
|
}
|
|
1537
|
-
},
|
|
1536
|
+
}, ft = {
|
|
1538
1537
|
data() {
|
|
1539
1538
|
return {
|
|
1540
1539
|
approvalSettled: !0,
|
|
@@ -1564,7 +1563,7 @@ const at = {
|
|
|
1564
1563
|
}, e);
|
|
1565
1564
|
}
|
|
1566
1565
|
}
|
|
1567
|
-
},
|
|
1566
|
+
}, _t = 300, pt = {
|
|
1568
1567
|
data() {
|
|
1569
1568
|
return {
|
|
1570
1569
|
// Numeric message id snapshot frozen the moment the user
|
|
@@ -1593,22 +1592,22 @@ const at = {
|
|
|
1593
1592
|
// messages, or when the pointer is already at/ahead of the
|
|
1594
1593
|
// candidate id.
|
|
1595
1594
|
markConvRead(e) {
|
|
1596
|
-
var s,
|
|
1595
|
+
var s, a;
|
|
1597
1596
|
if (!(e != null && e.id) || e._draft || !this.store) return;
|
|
1598
|
-
const t = ((
|
|
1597
|
+
const t = ((a = (s = this.s) == null ? void 0 : s.messagesByConv) == null ? void 0 : a[e.id]) || [], n = gt(t);
|
|
1599
1598
|
if (n == null) return;
|
|
1600
|
-
const
|
|
1601
|
-
|
|
1599
|
+
const i = J(e.last_read_message_id), r = J(n);
|
|
1600
|
+
r != null && (i != null && r <= i || (this._readMarkerPending = { convId: e.id, messageId: n }, !this._readMarkerTimer && (this._readMarkerTimer = setTimeout(() => {
|
|
1602
1601
|
const l = this._readMarkerPending;
|
|
1603
1602
|
this._readMarkerPending = null, this._readMarkerTimer = null, l && this.store && this.store.markConversationRead(
|
|
1604
1603
|
l.convId,
|
|
1605
1604
|
l.messageId
|
|
1606
1605
|
);
|
|
1607
|
-
},
|
|
1606
|
+
}, _t))));
|
|
1608
1607
|
}
|
|
1609
1608
|
}
|
|
1610
1609
|
};
|
|
1611
|
-
function
|
|
1610
|
+
function gt(e) {
|
|
1612
1611
|
for (let t = e.length - 1; t >= 0; t--) {
|
|
1613
1612
|
const n = e[t];
|
|
1614
1613
|
if (!(!n || n._pending) && J(n.id) != null)
|
|
@@ -1616,12 +1615,12 @@ function pt(e) {
|
|
|
1616
1615
|
}
|
|
1617
1616
|
return null;
|
|
1618
1617
|
}
|
|
1619
|
-
const
|
|
1618
|
+
const E = (e, t) => {
|
|
1620
1619
|
const n = e.__vccOpts || e;
|
|
1621
|
-
for (const [
|
|
1622
|
-
n[
|
|
1620
|
+
for (const [i, r] of t)
|
|
1621
|
+
n[i] = r;
|
|
1623
1622
|
return n;
|
|
1624
|
-
},
|
|
1623
|
+
}, vt = {
|
|
1625
1624
|
name: "WmHumanAvatar",
|
|
1626
1625
|
props: {
|
|
1627
1626
|
name: { type: String, default: "" },
|
|
@@ -1641,8 +1640,8 @@ const I = (e, t) => {
|
|
|
1641
1640
|
return Oe(this.name);
|
|
1642
1641
|
}
|
|
1643
1642
|
}
|
|
1644
|
-
},
|
|
1645
|
-
function
|
|
1643
|
+
}, yt = ["src", "alt"];
|
|
1644
|
+
function bt(e, t, n, i, r, s) {
|
|
1646
1645
|
return c(), u("div", {
|
|
1647
1646
|
class: x(["wm-huav", { "wm-huav--tail": n.tail }]),
|
|
1648
1647
|
style: W({
|
|
@@ -1656,19 +1655,19 @@ function yt(e, t, n, r, a, s) {
|
|
|
1656
1655
|
key: 0,
|
|
1657
1656
|
src: n.avatarUrl,
|
|
1658
1657
|
alt: n.name || ""
|
|
1659
|
-
}, null, 8,
|
|
1658
|
+
}, null, 8, yt)) : (c(), u("span", {
|
|
1660
1659
|
key: 1,
|
|
1661
1660
|
style: W({ fontSize: n.size * 0.36 + "px" })
|
|
1662
1661
|
}, v(s.initials), 5))
|
|
1663
1662
|
], 6);
|
|
1664
1663
|
}
|
|
1665
|
-
const
|
|
1664
|
+
const Ee = /* @__PURE__ */ E(vt, [["render", bt], ["__scopeId", "data-v-14e10c0d"]]), wt = 3, kt = {
|
|
1666
1665
|
name: "WmLauncher",
|
|
1667
|
-
components: { HumanAvatar:
|
|
1666
|
+
components: { HumanAvatar: Ee },
|
|
1668
1667
|
inject: {
|
|
1669
1668
|
// Translator shared by the Messenger shell; French fallback when
|
|
1670
1669
|
// the component is used standalone.
|
|
1671
|
-
t: { default: () =>
|
|
1670
|
+
t: { default: () => P() }
|
|
1672
1671
|
},
|
|
1673
1672
|
props: {
|
|
1674
1673
|
// Nombre de conversations non lues — pilote la pastille.
|
|
@@ -1685,15 +1684,15 @@ const Ie = /* @__PURE__ */ I(gt, [["render", yt], ["__scopeId", "data-v-14e10c0d
|
|
|
1685
1684
|
// élément en ordre DOM avec un flex column normal). Les plus
|
|
1686
1685
|
// anciens remontent dans la pile.
|
|
1687
1686
|
visiblePeeks() {
|
|
1688
|
-
return this.peeks.slice(0,
|
|
1687
|
+
return this.peeks.slice(0, wt).reverse();
|
|
1689
1688
|
}
|
|
1690
1689
|
}
|
|
1691
|
-
},
|
|
1692
|
-
function
|
|
1693
|
-
const
|
|
1694
|
-
return c(), u("div",
|
|
1695
|
-
z(
|
|
1696
|
-
default:
|
|
1690
|
+
}, Ct = { class: "wm-launcherWrap" }, At = ["aria-label", "onClick", "onKeydown"], St = ["aria-label", "onClick"], Mt = { class: "wm-peek__avatar" }, Tt = ["aria-label"], xt = { class: "wm-peek__body" }, Ot = { class: "wm-peek__head" }, Lt = { class: "wm-peek__name" }, It = { class: "wm-peek__action" }, Et = { class: "wm-peek__text" }, Bt = ["onClick"], Rt = ["aria-label"], Nt = ["aria-label"];
|
|
1691
|
+
function Ft(e, t, n, i, r, s) {
|
|
1692
|
+
const a = I("HumanAvatar");
|
|
1693
|
+
return c(), u("div", Ct, [
|
|
1694
|
+
z(je, { name: "wm-peek" }, {
|
|
1695
|
+
default: Pe(() => [
|
|
1697
1696
|
s.visiblePeeks.length ? (c(), u("div", {
|
|
1698
1697
|
key: 0,
|
|
1699
1698
|
class: x(["wm-peekStack", { "wm-peekStack--multi": s.visiblePeeks.length > 1 }])
|
|
@@ -1735,9 +1734,9 @@ function Nt(e, t, n, r, a, s) {
|
|
|
1735
1734
|
}, [
|
|
1736
1735
|
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
1737
1736
|
], -1)
|
|
1738
|
-
])], 8,
|
|
1739
|
-
o("div",
|
|
1740
|
-
z(
|
|
1737
|
+
])], 8, St),
|
|
1738
|
+
o("div", Mt, [
|
|
1739
|
+
z(a, {
|
|
1741
1740
|
name: l.senderName,
|
|
1742
1741
|
"avatar-url": l.senderAvatarUrl,
|
|
1743
1742
|
size: 34
|
|
@@ -1746,12 +1745,12 @@ function Nt(e, t, n, r, a, s) {
|
|
|
1746
1745
|
key: 0,
|
|
1747
1746
|
class: "wm-peek__avatarBadge",
|
|
1748
1747
|
"aria-label": s.t("launcher.unreadMessages", { count: l.count })
|
|
1749
|
-
}, v(l.count > 9 ? "9+" : l.count), 9,
|
|
1748
|
+
}, v(l.count > 9 ? "9+" : l.count), 9, Tt)) : b("", !0)
|
|
1750
1749
|
]),
|
|
1751
|
-
o("div",
|
|
1752
|
-
o("div",
|
|
1753
|
-
o("span",
|
|
1754
|
-
o("span",
|
|
1750
|
+
o("div", xt, [
|
|
1751
|
+
o("div", Ot, [
|
|
1752
|
+
o("span", Lt, v(l.senderName || s.t("common.agent")), 1),
|
|
1753
|
+
o("span", It, v(s.t("launcher.repliedToYou")), 1)
|
|
1755
1754
|
]),
|
|
1756
1755
|
o("p", Et, v(l.preview), 1)
|
|
1757
1756
|
]),
|
|
@@ -1759,8 +1758,8 @@ function Nt(e, t, n, r, a, s) {
|
|
|
1759
1758
|
type: "button",
|
|
1760
1759
|
class: "wm-peek__open",
|
|
1761
1760
|
onClick: X((C) => e.$emit("open", l.convId), ["stop"])
|
|
1762
|
-
}, v(s.t("common.open")), 9,
|
|
1763
|
-
], 44,
|
|
1761
|
+
}, v(s.t("common.open")), 9, Bt)
|
|
1762
|
+
], 44, At))), 128))
|
|
1764
1763
|
], 2)) : b("", !0)
|
|
1765
1764
|
]),
|
|
1766
1765
|
_: 1
|
|
@@ -1792,11 +1791,11 @@ function Nt(e, t, n, r, a, s) {
|
|
|
1792
1791
|
}) : s.t("launcher.unreadConversationsOne", {
|
|
1793
1792
|
count: n.unreadCount
|
|
1794
1793
|
})
|
|
1795
|
-
}, v(n.unreadCount > 9 ? "9+" : n.unreadCount), 9,
|
|
1796
|
-
], 8,
|
|
1794
|
+
}, v(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, Nt)) : b("", !0)
|
|
1795
|
+
], 8, Rt)
|
|
1797
1796
|
]);
|
|
1798
1797
|
}
|
|
1799
|
-
const
|
|
1798
|
+
const jt = /* @__PURE__ */ E(kt, [["render", Ft], ["__scopeId", "data-v-5193a529"]]), Pt = {
|
|
1800
1799
|
name: "WmAIAvatar",
|
|
1801
1800
|
props: {
|
|
1802
1801
|
size: { type: Number, default: 26 },
|
|
@@ -1811,8 +1810,8 @@ const Ft = /* @__PURE__ */ I(wt, [["render", Nt], ["__scopeId", "data-v-5193a529
|
|
|
1811
1810
|
}, Dt = {
|
|
1812
1811
|
key: 0,
|
|
1813
1812
|
class: "wm-aiav__pulse"
|
|
1814
|
-
},
|
|
1815
|
-
function
|
|
1813
|
+
}, Ut = ["width", "height"];
|
|
1814
|
+
function $t(e, t, n, i, r, s) {
|
|
1816
1815
|
return c(), u("div", {
|
|
1817
1816
|
class: x(["wm-aiav", { "wm-aiav--tail": n.tail }]),
|
|
1818
1817
|
style: W({
|
|
@@ -1851,11 +1850,11 @@ function Ut(e, t, n, r, a, s) {
|
|
|
1851
1850
|
fill: "white",
|
|
1852
1851
|
opacity: "0.38"
|
|
1853
1852
|
}, null, -1)
|
|
1854
|
-
])], 8,
|
|
1853
|
+
])], 8, Ut))
|
|
1855
1854
|
], 2)
|
|
1856
1855
|
], 6);
|
|
1857
1856
|
}
|
|
1858
|
-
const
|
|
1857
|
+
const le = /* @__PURE__ */ E(Pt, [["render", $t], ["__scopeId", "data-v-d621a129"]]), Ht = {
|
|
1859
1858
|
name: "WmTeamAvatars",
|
|
1860
1859
|
props: {
|
|
1861
1860
|
members: { type: Array, default: () => [] },
|
|
@@ -1877,45 +1876,45 @@ const oe = /* @__PURE__ */ I(jt, [["render", Ut], ["__scopeId", "data-v-d621a129
|
|
|
1877
1876
|
return Oe(e.name || "");
|
|
1878
1877
|
}
|
|
1879
1878
|
}
|
|
1880
|
-
},
|
|
1879
|
+
}, zt = {
|
|
1881
1880
|
key: 0,
|
|
1882
1881
|
class: "wm-team"
|
|
1883
|
-
},
|
|
1882
|
+
}, qt = ["src", "alt"], Vt = { key: 1 }, Wt = {
|
|
1884
1883
|
key: 0,
|
|
1885
1884
|
class: "wm-team__label"
|
|
1886
1885
|
};
|
|
1887
|
-
function
|
|
1888
|
-
return s.visible ? (c(), u("div",
|
|
1886
|
+
function Kt(e, t, n, i, r, s) {
|
|
1887
|
+
return s.visible ? (c(), u("div", zt, [
|
|
1889
1888
|
o("div", {
|
|
1890
1889
|
class: "wm-team__stack",
|
|
1891
1890
|
style: W({ width: s.stackWidth + "px" })
|
|
1892
1891
|
}, [
|
|
1893
|
-
(c(!0), u(L, null, j(n.members.slice(0, 3), (
|
|
1892
|
+
(c(!0), u(L, null, j(n.members.slice(0, 3), (a, l) => (c(), u("div", {
|
|
1894
1893
|
key: l,
|
|
1895
1894
|
class: "wm-team__pill",
|
|
1896
1895
|
style: W({
|
|
1897
1896
|
left: l * 13 + "px",
|
|
1898
1897
|
zIndex: 3 - l,
|
|
1899
|
-
background: s.colorFor(
|
|
1898
|
+
background: s.colorFor(a)
|
|
1900
1899
|
})
|
|
1901
1900
|
}, [
|
|
1902
|
-
|
|
1901
|
+
a.avatar_url ? (c(), u("img", {
|
|
1903
1902
|
key: 0,
|
|
1904
|
-
src:
|
|
1905
|
-
alt:
|
|
1906
|
-
}, null, 8,
|
|
1903
|
+
src: a.avatar_url,
|
|
1904
|
+
alt: a.name || ""
|
|
1905
|
+
}, null, 8, qt)) : (c(), u("span", Vt, v(s.initialsFor(a)), 1))
|
|
1907
1906
|
], 4))), 128))
|
|
1908
1907
|
], 4),
|
|
1909
|
-
n.responseLabel ? (c(), u("span",
|
|
1908
|
+
n.responseLabel ? (c(), u("span", Wt, v(n.responseLabel), 1)) : b("", !0)
|
|
1910
1909
|
])) : b("", !0);
|
|
1911
1910
|
}
|
|
1912
|
-
const
|
|
1911
|
+
const Gt = /* @__PURE__ */ E(Ht, [["render", Kt], ["__scopeId", "data-v-e49a9063"]]), Yt = {
|
|
1913
1912
|
name: "WmHeader",
|
|
1914
|
-
components: { AIAvatar:
|
|
1913
|
+
components: { AIAvatar: le, TeamAvatars: Gt },
|
|
1915
1914
|
inject: {
|
|
1916
1915
|
// Translator shared by the Messenger shell. Falls back to a French
|
|
1917
1916
|
// translator when the component is used standalone (no provider).
|
|
1918
|
-
t: { default: () =>
|
|
1917
|
+
t: { default: () => P() }
|
|
1919
1918
|
},
|
|
1920
1919
|
props: {
|
|
1921
1920
|
title: { type: String, default: "Nouvelle conversation" },
|
|
@@ -1941,21 +1940,21 @@ const Kt = /* @__PURE__ */ I($t, [["render", Wt], ["__scopeId", "data-v-e49a9063
|
|
|
1941
1940
|
const e = Array.isArray(this.teamMembers) ? this.teamMembers : [];
|
|
1942
1941
|
if (e.length <= 3) return e;
|
|
1943
1942
|
const t = (/* @__PURE__ */ new Date()).getHours() % e.length, n = [];
|
|
1944
|
-
for (let
|
|
1945
|
-
n.push(e[(t +
|
|
1943
|
+
for (let i = 0; i < 3; i++)
|
|
1944
|
+
n.push(e[(t + i) % e.length]);
|
|
1946
1945
|
return n;
|
|
1947
1946
|
}
|
|
1948
1947
|
}
|
|
1949
|
-
},
|
|
1948
|
+
}, Qt = { class: "wm-header" }, Xt = ["aria-label"], Jt = {
|
|
1950
1949
|
key: 1,
|
|
1951
1950
|
style: { width: "30px", height: "30px", "flex-shrink": "0" }
|
|
1952
|
-
},
|
|
1951
|
+
}, Zt = { class: "wm-header__avatar" }, en = { class: "wm-header__main" }, tn = { class: "wm-header__title" }, nn = {
|
|
1953
1952
|
key: 3,
|
|
1954
1953
|
class: "wm-header__fill"
|
|
1955
|
-
},
|
|
1956
|
-
function
|
|
1957
|
-
const
|
|
1958
|
-
return c(), u("div",
|
|
1954
|
+
}, sn = { class: "wm-header__actions" }, rn = ["aria-label", "title"], an = ["aria-label", "title"];
|
|
1955
|
+
function on(e, t, n, i, r, s) {
|
|
1956
|
+
const a = I("AIAvatar"), l = I("TeamAvatars");
|
|
1957
|
+
return c(), u("div", Qt, [
|
|
1959
1958
|
n.showBack ? (c(), u("button", {
|
|
1960
1959
|
key: 0,
|
|
1961
1960
|
type: "button",
|
|
@@ -1976,21 +1975,21 @@ function an(e, t, n, r, a, s) {
|
|
|
1976
1975
|
}, [
|
|
1977
1976
|
o("path", { d: "M19 12H5M12 5l-7 7 7 7" })
|
|
1978
1977
|
], -1)
|
|
1979
|
-
])], 8,
|
|
1978
|
+
])], 8, Xt)) : (c(), u("div", Jt)),
|
|
1980
1979
|
n.showIdentity ? (c(), u(L, { key: 2 }, [
|
|
1981
|
-
o("div", Jt, [
|
|
1982
|
-
z(i, { size: 30 })
|
|
1983
|
-
]),
|
|
1984
1980
|
o("div", Zt, [
|
|
1985
|
-
|
|
1981
|
+
z(a, { size: 30 })
|
|
1982
|
+
]),
|
|
1983
|
+
o("div", en, [
|
|
1984
|
+
o("div", tn, v(n.title), 1)
|
|
1986
1985
|
]),
|
|
1987
1986
|
s.hasTeam ? (c(), R(l, {
|
|
1988
1987
|
key: 0,
|
|
1989
1988
|
members: s.displayedTeamMembers,
|
|
1990
1989
|
"response-label": ""
|
|
1991
1990
|
}, null, 8, ["members"])) : b("", !0)
|
|
1992
|
-
], 64)) : (c(), u("div",
|
|
1993
|
-
o("div",
|
|
1991
|
+
], 64)) : (c(), u("div", nn)),
|
|
1992
|
+
o("div", sn, [
|
|
1994
1993
|
n.showMore ? (c(), u("button", {
|
|
1995
1994
|
key: 0,
|
|
1996
1995
|
type: "button",
|
|
@@ -2022,7 +2021,7 @@ function an(e, t, n, r, a, s) {
|
|
|
2022
2021
|
r: "1.6"
|
|
2023
2022
|
})
|
|
2024
2023
|
], -1)
|
|
2025
|
-
])], 10,
|
|
2024
|
+
])], 10, rn)) : b("", !0),
|
|
2026
2025
|
n.showClose ? (c(), u("button", {
|
|
2027
2026
|
key: 1,
|
|
2028
2027
|
type: "button",
|
|
@@ -2044,23 +2043,113 @@ function an(e, t, n, r, a, s) {
|
|
|
2044
2043
|
}, [
|
|
2045
2044
|
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
2046
2045
|
], -1)
|
|
2047
|
-
])], 8,
|
|
2046
|
+
])], 8, an)) : b("", !0)
|
|
2048
2047
|
])
|
|
2049
2048
|
]);
|
|
2050
2049
|
}
|
|
2051
|
-
const
|
|
2050
|
+
const ln = /* @__PURE__ */ E(Yt, [["render", on], ["__scopeId", "data-v-e5ed4931"]]);
|
|
2051
|
+
function Be(e) {
|
|
2052
|
+
return String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2053
|
+
}
|
|
2054
|
+
function cn(e) {
|
|
2055
|
+
return /^(https?:\/\/|mailto:|tel:)/i.test(String(e).trim());
|
|
2056
|
+
}
|
|
2057
|
+
const Ae = "";
|
|
2058
|
+
function re(e) {
|
|
2059
|
+
let t = e;
|
|
2060
|
+
const n = [];
|
|
2061
|
+
return t = t.replace(/`([^`\n]+)`/g, (i, r) => {
|
|
2062
|
+
const s = n.length;
|
|
2063
|
+
return n.push(r), `${Ae}CODE${s}${Ae}`;
|
|
2064
|
+
}), t = t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (i, r, s) => cn(s) ? `<a href="${s}" target="_blank" rel="noopener noreferrer">${r}</a>` : r), t = t.replace(/\*\*([^\n*][^\n]*?)\*\*/g, "<strong>$1</strong>"), t = t.replace(/__([^\n_][^\n]*?)__/g, "<u>$1</u>"), t = t.replace(/~~([^\n~][^\n]*?)~~/g, "<s>$1</s>"), t = t.replace(/(^|[^\w*])\*([^\n*]+?)\*(?!\w)/g, "$1<em>$2</em>"), t = t.replace(/(^|[^\w_])_([^\n_]+?)_(?!\w)/g, "$1<em>$2</em>"), t = t.replace(/CODE(\d+)/g, (i, r) => `<code class="wm-md-code">${n[+r]}</code>`), t;
|
|
2065
|
+
}
|
|
2066
|
+
function dn(e) {
|
|
2067
|
+
if (!e) return "";
|
|
2068
|
+
const t = String(e).replace(/\[([^\]\n]+)\]\([^)\s]+\)/g, "$1");
|
|
2069
|
+
return re(Be(t));
|
|
2070
|
+
}
|
|
2071
|
+
function un(e) {
|
|
2072
|
+
if (!e) return "";
|
|
2073
|
+
const t = Be(e).split(`
|
|
2074
|
+
`), n = [];
|
|
2075
|
+
let i = 0;
|
|
2076
|
+
for (; i < t.length; ) {
|
|
2077
|
+
const s = t[i];
|
|
2078
|
+
if (/^\s*```([\w-]*)\s*$/.exec(s)) {
|
|
2079
|
+
i++;
|
|
2080
|
+
const C = [];
|
|
2081
|
+
for (; i < t.length && !/^\s*```\s*$/.test(t[i]); )
|
|
2082
|
+
C.push(t[i]), i++;
|
|
2083
|
+
i < t.length && i++, n.push({
|
|
2084
|
+
type: "block",
|
|
2085
|
+
html: `<pre class="wm-md-pre"><code>${C.join(`
|
|
2086
|
+
`)}</code></pre>`
|
|
2087
|
+
});
|
|
2088
|
+
continue;
|
|
2089
|
+
}
|
|
2090
|
+
if (/^\s*[-*]\s+/.test(s)) {
|
|
2091
|
+
const C = [];
|
|
2092
|
+
for (; i < t.length; ) {
|
|
2093
|
+
const T = /^\s*[-*]\s+(.*)$/.exec(t[i]);
|
|
2094
|
+
if (!T) break;
|
|
2095
|
+
C.push(T[1]), i++;
|
|
2096
|
+
}
|
|
2097
|
+
const k = C.map((T) => `<li>${re(T)}</li>`).join("");
|
|
2098
|
+
n.push({
|
|
2099
|
+
type: "block",
|
|
2100
|
+
html: `<ul class="wm-md-ul">${k}</ul>`
|
|
2101
|
+
});
|
|
2102
|
+
continue;
|
|
2103
|
+
}
|
|
2104
|
+
const l = /^\s*(\d+)\.\s+(.*)$/.exec(s);
|
|
2105
|
+
if (l) {
|
|
2106
|
+
const C = parseInt(l[1], 10), k = [l[2]];
|
|
2107
|
+
for (i++; i < t.length; ) {
|
|
2108
|
+
const A = /^\s*\d+\.\s+(.*)$/.exec(t[i]);
|
|
2109
|
+
if (!A) break;
|
|
2110
|
+
k.push(A[1]), i++;
|
|
2111
|
+
}
|
|
2112
|
+
const T = k.map((A) => `<li>${re(A)}</li>`).join(""), B = C !== 1 ? ` start="${C}"` : "";
|
|
2113
|
+
n.push({
|
|
2114
|
+
type: "block",
|
|
2115
|
+
html: `<ol class="wm-md-ol"${B}>${T}</ol>`
|
|
2116
|
+
});
|
|
2117
|
+
continue;
|
|
2118
|
+
}
|
|
2119
|
+
const g = /^(#{1,6})\s+(.*)$/.exec(s);
|
|
2120
|
+
if (g) {
|
|
2121
|
+
const C = g[1].length;
|
|
2122
|
+
n.push({
|
|
2123
|
+
type: "block",
|
|
2124
|
+
html: `<h${C} class="wm-md-h wm-md-h${C}">${re(g[2])}</h${C}>`
|
|
2125
|
+
}), i++;
|
|
2126
|
+
continue;
|
|
2127
|
+
}
|
|
2128
|
+
n.push({ type: "text", html: re(s) }), i++;
|
|
2129
|
+
}
|
|
2130
|
+
let r = "";
|
|
2131
|
+
for (let s = 0; s < n.length; s++) {
|
|
2132
|
+
const a = n[s];
|
|
2133
|
+
r += a.html;
|
|
2134
|
+
const l = n[s + 1];
|
|
2135
|
+
l && a.type !== "block" && l.type !== "block" && (r += `
|
|
2136
|
+
`);
|
|
2137
|
+
}
|
|
2138
|
+
return r;
|
|
2139
|
+
}
|
|
2140
|
+
const Se = {
|
|
2052
2141
|
book: "M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253",
|
|
2053
2142
|
changelog: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2",
|
|
2054
2143
|
status: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",
|
|
2055
2144
|
chat: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z",
|
|
2056
2145
|
link: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"
|
|
2057
|
-
},
|
|
2146
|
+
}, hn = {
|
|
2058
2147
|
name: "WmOnboarding",
|
|
2059
|
-
components: { AIAvatar:
|
|
2148
|
+
components: { AIAvatar: le },
|
|
2060
2149
|
inject: {
|
|
2061
2150
|
// Translator + resolved-language getter shared by the Messenger
|
|
2062
2151
|
// shell. Fall back to French wording when used standalone.
|
|
2063
|
-
t: { default: () =>
|
|
2152
|
+
t: { default: () => P() },
|
|
2064
2153
|
wmLocale: { default: () => () => "fr" }
|
|
2065
2154
|
},
|
|
2066
2155
|
props: {
|
|
@@ -2096,21 +2185,24 @@ const on = /* @__PURE__ */ I(Gt, [["render", an], ["__scopeId", "data-v-e5ed4931
|
|
|
2096
2185
|
},
|
|
2097
2186
|
methods: {
|
|
2098
2187
|
iconPath(e) {
|
|
2099
|
-
return
|
|
2188
|
+
return Se[e] || Se.link;
|
|
2189
|
+
},
|
|
2190
|
+
renderPreview(e) {
|
|
2191
|
+
return dn(e);
|
|
2100
2192
|
},
|
|
2101
2193
|
formatTs(e) {
|
|
2102
2194
|
if (!e) return "";
|
|
2103
2195
|
const t = new Date(e);
|
|
2104
2196
|
if (Number.isNaN(t.getTime())) return "";
|
|
2105
|
-
const n =
|
|
2106
|
-
if (t.toDateString() ===
|
|
2197
|
+
const n = oe(this.wmLocale()), i = /* @__PURE__ */ new Date();
|
|
2198
|
+
if (t.toDateString() === i.toDateString())
|
|
2107
2199
|
return t.toLocaleTimeString(n, {
|
|
2108
2200
|
hour: "2-digit",
|
|
2109
2201
|
minute: "2-digit"
|
|
2110
2202
|
});
|
|
2111
|
-
if (
|
|
2112
|
-
const
|
|
2113
|
-
return
|
|
2203
|
+
if (i.getTime() - t.getTime() < 7 * 864e5) {
|
|
2204
|
+
const a = t.toLocaleDateString(n, { weekday: "short" });
|
|
2205
|
+
return a.charAt(0).toUpperCase() + a.slice(1);
|
|
2114
2206
|
}
|
|
2115
2207
|
return t.toLocaleDateString(n, {
|
|
2116
2208
|
day: "2-digit",
|
|
@@ -2118,10 +2210,10 @@ const on = /* @__PURE__ */ I(Gt, [["render", an], ["__scopeId", "data-v-e5ed4931
|
|
|
2118
2210
|
});
|
|
2119
2211
|
}
|
|
2120
2212
|
}
|
|
2121
|
-
},
|
|
2213
|
+
}, mn = { class: "wm-onb" }, fn = { class: "wm-onb__hero" }, _n = { class: "wm-onb__title" }, pn = { class: "wm-onb__sub" }, gn = { class: "wm-onb__cta" }, vn = ["disabled"], yn = {
|
|
2122
2214
|
key: 0,
|
|
2123
2215
|
class: "wm-onb__section"
|
|
2124
|
-
},
|
|
2216
|
+
}, bn = { class: "wm-onb__section-title" }, wn = ["onClick"], kn = { class: "wm-onb__card-icon" }, Cn = {
|
|
2125
2217
|
width: "16",
|
|
2126
2218
|
height: "16",
|
|
2127
2219
|
viewBox: "0 0 24 24",
|
|
@@ -2131,31 +2223,31 @@ const on = /* @__PURE__ */ I(Gt, [["render", an], ["__scopeId", "data-v-e5ed4931
|
|
|
2131
2223
|
"stroke-linecap": "round",
|
|
2132
2224
|
"stroke-linejoin": "round",
|
|
2133
2225
|
"aria-hidden": "true"
|
|
2134
|
-
},
|
|
2226
|
+
}, An = ["d"], Sn = { class: "wm-onb__card-body" }, Mn = { class: "wm-onb__card-title" }, Tn = {
|
|
2135
2227
|
key: 0,
|
|
2136
2228
|
class: "wm-onb__card-sub"
|
|
2137
|
-
},
|
|
2229
|
+
}, xn = {
|
|
2138
2230
|
key: 1,
|
|
2139
2231
|
class: "wm-onb__section"
|
|
2140
|
-
},
|
|
2232
|
+
}, On = { class: "wm-onb__section-title" }, Ln = { class: "wm-onb__search" }, In = ["placeholder", "aria-label"], En = { class: "wm-onb__list" }, Bn = ["onClick"], Rn = ["aria-label"], Nn = { class: "wm-onb__thread-body" }, Fn = { class: "wm-onb__thread-title" }, jn = ["innerHTML"], Pn = { class: "wm-onb__thread-meta" }, Dn = {
|
|
2141
2233
|
key: 0,
|
|
2142
2234
|
class: "wm-onb__thread-time"
|
|
2143
|
-
},
|
|
2235
|
+
}, Un = {
|
|
2144
2236
|
key: 0,
|
|
2145
2237
|
class: "wm-onb__empty"
|
|
2146
2238
|
};
|
|
2147
|
-
function
|
|
2148
|
-
const
|
|
2149
|
-
return c(), u("div",
|
|
2150
|
-
o("div",
|
|
2151
|
-
z(
|
|
2239
|
+
function $n(e, t, n, i, r, s) {
|
|
2240
|
+
const a = I("AIAvatar");
|
|
2241
|
+
return c(), u("div", mn, [
|
|
2242
|
+
o("div", fn, [
|
|
2243
|
+
z(a, {
|
|
2152
2244
|
size: 56,
|
|
2153
2245
|
pulse: !0
|
|
2154
2246
|
}),
|
|
2155
|
-
o("div",
|
|
2156
|
-
o("div",
|
|
2247
|
+
o("div", _n, v(s.heroTitle), 1),
|
|
2248
|
+
o("div", pn, v(s.heroSub), 1)
|
|
2157
2249
|
]),
|
|
2158
|
-
o("div",
|
|
2250
|
+
o("div", gn, [
|
|
2159
2251
|
o("button", {
|
|
2160
2252
|
type: "button",
|
|
2161
2253
|
class: "wm-onb__startBtn",
|
|
@@ -2178,10 +2270,10 @@ function jn(e, t, n, r, a, s) {
|
|
|
2178
2270
|
])
|
|
2179
2271
|
], -1)),
|
|
2180
2272
|
o("span", null, v(n.busy ? "…" : s.t("onboarding.start")), 1)
|
|
2181
|
-
], 8,
|
|
2273
|
+
], 8, vn)
|
|
2182
2274
|
]),
|
|
2183
|
-
n.quickLinks.length ? (c(), u("div",
|
|
2184
|
-
o("div",
|
|
2275
|
+
n.quickLinks.length ? (c(), u("div", yn, [
|
|
2276
|
+
o("div", bn, v(s.t("onboarding.quickAccess")), 1),
|
|
2185
2277
|
o("div", {
|
|
2186
2278
|
class: x(s.quickLinksLayout)
|
|
2187
2279
|
}, [
|
|
@@ -2191,23 +2283,23 @@ function jn(e, t, n, r, a, s) {
|
|
|
2191
2283
|
class: x(["wm-onb__card", { "wm-onb__card--row": s.isOddQuickLinks }]),
|
|
2192
2284
|
onClick: (C) => e.$emit("select", l)
|
|
2193
2285
|
}, [
|
|
2194
|
-
o("span",
|
|
2195
|
-
(c(), u("svg",
|
|
2286
|
+
o("span", kn, [
|
|
2287
|
+
(c(), u("svg", Cn, [
|
|
2196
2288
|
o("path", {
|
|
2197
2289
|
d: s.iconPath(l.icon)
|
|
2198
|
-
}, null, 8,
|
|
2290
|
+
}, null, 8, An)
|
|
2199
2291
|
]))
|
|
2200
2292
|
]),
|
|
2201
|
-
o("span",
|
|
2202
|
-
o("span",
|
|
2203
|
-
l.description ? (c(), u("span",
|
|
2293
|
+
o("span", Sn, [
|
|
2294
|
+
o("span", Mn, v(l.label), 1),
|
|
2295
|
+
l.description ? (c(), u("span", Tn, v(l.description), 1)) : b("", !0)
|
|
2204
2296
|
])
|
|
2205
|
-
], 10,
|
|
2297
|
+
], 10, wn))), 128))
|
|
2206
2298
|
], 2)
|
|
2207
2299
|
])) : b("", !0),
|
|
2208
|
-
n.openThreads.length ? (c(), u("div",
|
|
2209
|
-
o("div",
|
|
2210
|
-
o("div",
|
|
2300
|
+
n.openThreads.length ? (c(), u("div", xn, [
|
|
2301
|
+
o("div", On, v(s.t("onboarding.recentConversations")), 1),
|
|
2302
|
+
o("div", Ln, [
|
|
2211
2303
|
t[3] || (t[3] = o("span", { class: "wm-onb__searchIcon" }, [
|
|
2212
2304
|
o("svg", {
|
|
2213
2305
|
width: "12",
|
|
@@ -2224,15 +2316,15 @@ function jn(e, t, n, r, a, s) {
|
|
|
2224
2316
|
])
|
|
2225
2317
|
], -1)),
|
|
2226
2318
|
V(o("input", {
|
|
2227
|
-
"onUpdate:modelValue": t[1] || (t[1] = (l) =>
|
|
2319
|
+
"onUpdate:modelValue": t[1] || (t[1] = (l) => r.query = l),
|
|
2228
2320
|
type: "text",
|
|
2229
2321
|
placeholder: s.t("onboarding.search"),
|
|
2230
2322
|
"aria-label": s.t("onboarding.search")
|
|
2231
|
-
}, null, 8,
|
|
2232
|
-
[Z,
|
|
2323
|
+
}, null, 8, In), [
|
|
2324
|
+
[Z, r.query]
|
|
2233
2325
|
])
|
|
2234
2326
|
]),
|
|
2235
|
-
o("div",
|
|
2327
|
+
o("div", En, [
|
|
2236
2328
|
(c(!0), u(L, null, j(s.filteredThreads, (l) => (c(), u("button", {
|
|
2237
2329
|
key: l.id,
|
|
2238
2330
|
type: "button",
|
|
@@ -2259,14 +2351,17 @@ function jn(e, t, n, r, a, s) {
|
|
|
2259
2351
|
key: 0,
|
|
2260
2352
|
class: "wm-onb__thread-dot",
|
|
2261
2353
|
"aria-label": s.t("onboarding.unread")
|
|
2262
|
-
}, null, 8,
|
|
2354
|
+
}, null, 8, Rn)) : b("", !0)
|
|
2263
2355
|
], 2),
|
|
2264
|
-
o("span",
|
|
2265
|
-
o("span",
|
|
2266
|
-
o("span",
|
|
2356
|
+
o("span", Nn, [
|
|
2357
|
+
o("span", Fn, v(l.title), 1),
|
|
2358
|
+
o("span", {
|
|
2359
|
+
class: "wm-onb__thread-preview",
|
|
2360
|
+
innerHTML: s.renderPreview(l.preview)
|
|
2361
|
+
}, null, 8, jn)
|
|
2267
2362
|
]),
|
|
2268
|
-
o("span",
|
|
2269
|
-
s.formatTs(l._ts) ? (c(), u("span",
|
|
2363
|
+
o("span", Pn, [
|
|
2364
|
+
s.formatTs(l._ts) ? (c(), u("span", Dn, v(s.formatTs(l._ts)), 1)) : b("", !0),
|
|
2270
2365
|
t[5] || (t[5] = o("svg", {
|
|
2271
2366
|
width: "14",
|
|
2272
2367
|
height: "14",
|
|
@@ -2282,17 +2377,17 @@ function jn(e, t, n, r, a, s) {
|
|
|
2282
2377
|
o("path", { d: "M5 12h14M13 5l7 7-7 7" })
|
|
2283
2378
|
], -1))
|
|
2284
2379
|
])
|
|
2285
|
-
], 8,
|
|
2286
|
-
s.filteredThreads.length ? b("", !0) : (c(), u("div",
|
|
2380
|
+
], 8, Bn))), 128)),
|
|
2381
|
+
s.filteredThreads.length ? b("", !0) : (c(), u("div", Un, v(s.t("onboarding.noResults", { query: r.query })), 1))
|
|
2287
2382
|
])
|
|
2288
2383
|
])) : b("", !0)
|
|
2289
2384
|
]);
|
|
2290
2385
|
}
|
|
2291
|
-
const
|
|
2292
|
-
function
|
|
2386
|
+
const Hn = /* @__PURE__ */ E(hn, [["render", $n], ["__scopeId", "data-v-d0d5f5b1"]]);
|
|
2387
|
+
function zn(e) {
|
|
2293
2388
|
return typeof e != "string" ? "" : e.replace(/`([^`]+)`/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(new RegExp("(?<!\\*)\\*([^*]+)\\*(?!\\*)", "g"), "$1").replace(/__([^_]+)__/g, "$1").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/\s+/g, " ").trim();
|
|
2294
2389
|
}
|
|
2295
|
-
const
|
|
2390
|
+
const qn = {
|
|
2296
2391
|
name: "WmActionResult",
|
|
2297
2392
|
props: {
|
|
2298
2393
|
state: { type: String, default: "success" },
|
|
@@ -2302,13 +2397,13 @@ const Un = {
|
|
|
2302
2397
|
},
|
|
2303
2398
|
computed: {
|
|
2304
2399
|
detailText() {
|
|
2305
|
-
return
|
|
2400
|
+
return zn(this.detail);
|
|
2306
2401
|
}
|
|
2307
2402
|
}
|
|
2308
|
-
},
|
|
2403
|
+
}, Vn = {
|
|
2309
2404
|
class: "wm-result__icon",
|
|
2310
2405
|
"aria-hidden": "true"
|
|
2311
|
-
},
|
|
2406
|
+
}, Wn = {
|
|
2312
2407
|
key: 0,
|
|
2313
2408
|
width: "11",
|
|
2314
2409
|
height: "11",
|
|
@@ -2318,7 +2413,7 @@ const Un = {
|
|
|
2318
2413
|
"stroke-width": "2.8",
|
|
2319
2414
|
"stroke-linecap": "round",
|
|
2320
2415
|
"stroke-linejoin": "round"
|
|
2321
|
-
},
|
|
2416
|
+
}, Kn = {
|
|
2322
2417
|
key: 1,
|
|
2323
2418
|
width: "11",
|
|
2324
2419
|
height: "11",
|
|
@@ -2328,7 +2423,7 @@ const Un = {
|
|
|
2328
2423
|
"stroke-width": "2.6",
|
|
2329
2424
|
"stroke-linecap": "round",
|
|
2330
2425
|
"stroke-linejoin": "round"
|
|
2331
|
-
},
|
|
2426
|
+
}, Gn = {
|
|
2332
2427
|
key: 2,
|
|
2333
2428
|
width: "11",
|
|
2334
2429
|
height: "11",
|
|
@@ -2338,7 +2433,7 @@ const Un = {
|
|
|
2338
2433
|
"stroke-width": "2.4",
|
|
2339
2434
|
"stroke-linecap": "round",
|
|
2340
2435
|
"stroke-linejoin": "round"
|
|
2341
|
-
},
|
|
2436
|
+
}, Yn = {
|
|
2342
2437
|
key: 3,
|
|
2343
2438
|
width: "12",
|
|
2344
2439
|
height: "12",
|
|
@@ -2348,24 +2443,24 @@ const Un = {
|
|
|
2348
2443
|
"stroke-width": "2.2",
|
|
2349
2444
|
"stroke-linecap": "round",
|
|
2350
2445
|
"stroke-linejoin": "round"
|
|
2351
|
-
},
|
|
2352
|
-
function
|
|
2446
|
+
}, Qn = { class: "wm-result__body" }, Xn = { class: "wm-result__label" }, Jn = { class: "wm-result__detail" };
|
|
2447
|
+
function Zn(e, t, n, i, r, s) {
|
|
2353
2448
|
return c(), u("div", {
|
|
2354
2449
|
class: x(["wm-result", `wm-result--${n.state}`])
|
|
2355
2450
|
}, [
|
|
2356
|
-
o("span",
|
|
2357
|
-
n.state === "success" ? (c(), u("svg",
|
|
2451
|
+
o("span", Vn, [
|
|
2452
|
+
n.state === "success" ? (c(), u("svg", Wn, [...t[0] || (t[0] = [
|
|
2358
2453
|
o("path", { d: "M20 6L9 17l-5-5" }, null, -1)
|
|
2359
|
-
])])) : n.state === "rejected" ? (c(), u("svg",
|
|
2454
|
+
])])) : n.state === "rejected" ? (c(), u("svg", Kn, [...t[1] || (t[1] = [
|
|
2360
2455
|
o("path", { d: "M18 6L6 18M6 6l12 12" }, null, -1)
|
|
2361
|
-
])])) : n.state === "awaiting" ? (c(), u("svg",
|
|
2456
|
+
])])) : n.state === "awaiting" ? (c(), u("svg", Gn, [...t[2] || (t[2] = [
|
|
2362
2457
|
o("circle", {
|
|
2363
2458
|
cx: "12",
|
|
2364
2459
|
cy: "12",
|
|
2365
2460
|
r: "10"
|
|
2366
2461
|
}, null, -1),
|
|
2367
2462
|
o("polyline", { points: "12 7 12 12 15 14" }, null, -1)
|
|
2368
|
-
])])) : (c(), u("svg",
|
|
2463
|
+
])])) : (c(), u("svg", Yn, [...t[3] || (t[3] = [
|
|
2369
2464
|
o("path", { d: "M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }, null, -1),
|
|
2370
2465
|
o("line", {
|
|
2371
2466
|
x1: "12",
|
|
@@ -2381,24 +2476,24 @@ function Yn(e, t, n, r, a, s) {
|
|
|
2381
2476
|
}, null, -1)
|
|
2382
2477
|
])]))
|
|
2383
2478
|
]),
|
|
2384
|
-
o("span",
|
|
2385
|
-
o("span",
|
|
2479
|
+
o("span", Qn, [
|
|
2480
|
+
o("span", Xn, v(n.label), 1),
|
|
2386
2481
|
s.detailText ? (c(), u(L, { key: 0 }, [
|
|
2387
2482
|
t[4] || (t[4] = o("span", {
|
|
2388
2483
|
class: "wm-result__sep",
|
|
2389
2484
|
"aria-hidden": "true"
|
|
2390
2485
|
}, " · ", -1)),
|
|
2391
|
-
o("span",
|
|
2486
|
+
o("span", Jn, v(s.detailText), 1)
|
|
2392
2487
|
], 64)) : b("", !0)
|
|
2393
2488
|
])
|
|
2394
2489
|
], 2);
|
|
2395
2490
|
}
|
|
2396
|
-
const
|
|
2491
|
+
const es = /* @__PURE__ */ E(qn, [["render", Zn], ["__scopeId", "data-v-7284acd0"]]), ts = {
|
|
2397
2492
|
name: "WmArtifactFormResponse",
|
|
2398
2493
|
inject: {
|
|
2399
2494
|
// Translator shared by the Messenger shell; French fallback when
|
|
2400
2495
|
// the component is used standalone.
|
|
2401
|
-
t: { default: () =>
|
|
2496
|
+
t: { default: () => P() }
|
|
2402
2497
|
},
|
|
2403
2498
|
props: {
|
|
2404
2499
|
data: { type: Object, required: !0 }
|
|
@@ -2409,12 +2504,12 @@ const Qn = /* @__PURE__ */ I(Un, [["render", Yn], ["__scopeId", "data-v-7284acd0
|
|
|
2409
2504
|
return Array.isArray((e = this.data) == null ? void 0 : e.fields) ? this.data.fields : [];
|
|
2410
2505
|
}
|
|
2411
2506
|
}
|
|
2412
|
-
},
|
|
2413
|
-
function
|
|
2414
|
-
return c(), u("div",
|
|
2415
|
-
o("div",
|
|
2416
|
-
o("div",
|
|
2417
|
-
o("span",
|
|
2507
|
+
}, ns = { class: "wm-art wm-art--formResponse" }, ss = { class: "wm-art__head" }, rs = { class: "wm-art__title" }, is = { class: "wm-art__badge wm-art__badge--success" }, as = { class: "wm-art__body" }, os = { class: "wm-art__fieldLabel" };
|
|
2508
|
+
function ls(e, t, n, i, r, s) {
|
|
2509
|
+
return c(), u("div", ns, [
|
|
2510
|
+
o("div", ss, [
|
|
2511
|
+
o("div", rs, v(n.data.title || s.t("form.title")), 1),
|
|
2512
|
+
o("span", is, [
|
|
2418
2513
|
t[0] || (t[0] = o("svg", {
|
|
2419
2514
|
width: "11",
|
|
2420
2515
|
height: "11",
|
|
@@ -2431,23 +2526,23 @@ function rs(e, t, n, r, a, s) {
|
|
|
2431
2526
|
pe(" " + v(s.t("form.sent")), 1)
|
|
2432
2527
|
])
|
|
2433
2528
|
]),
|
|
2434
|
-
o("div",
|
|
2435
|
-
(c(!0), u(L, null, j(s.fields, (
|
|
2529
|
+
o("div", as, [
|
|
2530
|
+
(c(!0), u(L, null, j(s.fields, (a, l) => (c(), u("div", {
|
|
2436
2531
|
key: l,
|
|
2437
2532
|
class: "wm-art__field"
|
|
2438
2533
|
}, [
|
|
2439
|
-
o("div",
|
|
2534
|
+
o("div", os, v(a.label), 1),
|
|
2440
2535
|
o("div", {
|
|
2441
2536
|
class: x([
|
|
2442
2537
|
"wm-art__fieldValue",
|
|
2443
|
-
{ "wm-art__fieldValue--multi":
|
|
2538
|
+
{ "wm-art__fieldValue--multi": a.multiline }
|
|
2444
2539
|
])
|
|
2445
|
-
}, v(
|
|
2540
|
+
}, v(a.value), 3)
|
|
2446
2541
|
]))), 128))
|
|
2447
2542
|
])
|
|
2448
2543
|
]);
|
|
2449
2544
|
}
|
|
2450
|
-
const
|
|
2545
|
+
const cs = /* @__PURE__ */ E(ts, [["render", ls], ["__scopeId", "data-v-713aecf1"]]), ds = {
|
|
2451
2546
|
name: "WmArtifactInfoCard",
|
|
2452
2547
|
props: {
|
|
2453
2548
|
data: { type: Object, required: !0 }
|
|
@@ -2462,32 +2557,32 @@ const is = /* @__PURE__ */ I(Xn, [["render", rs], ["__scopeId", "data-v-713aecf1
|
|
|
2462
2557
|
return !!((e = this.data) != null && e.body) || this.fields.length > 0;
|
|
2463
2558
|
}
|
|
2464
2559
|
}
|
|
2465
|
-
},
|
|
2560
|
+
}, us = { class: "wm-art wm-art--infoCard" }, hs = {
|
|
2466
2561
|
key: 0,
|
|
2467
2562
|
class: "wm-art__image"
|
|
2468
|
-
},
|
|
2563
|
+
}, ms = ["src", "alt"], fs = { class: "wm-art__head" }, _s = { class: "wm-art__headMain" }, ps = { class: "wm-art__title" }, gs = {
|
|
2469
2564
|
key: 0,
|
|
2470
2565
|
class: "wm-art__subtitle"
|
|
2471
|
-
},
|
|
2566
|
+
}, vs = {
|
|
2472
2567
|
key: 1,
|
|
2473
2568
|
class: "wm-art__body"
|
|
2474
|
-
},
|
|
2569
|
+
}, ys = {
|
|
2475
2570
|
key: 0,
|
|
2476
2571
|
class: "wm-art__text"
|
|
2477
|
-
},
|
|
2478
|
-
function
|
|
2479
|
-
return c(), u("div",
|
|
2480
|
-
n.data.image_url ? (c(), u("figure",
|
|
2572
|
+
}, bs = { class: "wm-art__fieldLabel" };
|
|
2573
|
+
function ws(e, t, n, i, r, s) {
|
|
2574
|
+
return c(), u("div", us, [
|
|
2575
|
+
n.data.image_url ? (c(), u("figure", hs, [
|
|
2481
2576
|
o("img", {
|
|
2482
2577
|
src: n.data.image_url,
|
|
2483
2578
|
alt: n.data.title || "",
|
|
2484
2579
|
loading: "lazy"
|
|
2485
|
-
}, null, 8,
|
|
2580
|
+
}, null, 8, ms)
|
|
2486
2581
|
])) : b("", !0),
|
|
2487
|
-
o("div",
|
|
2488
|
-
o("div",
|
|
2489
|
-
o("div",
|
|
2490
|
-
n.data.subtitle ? (c(), u("div",
|
|
2582
|
+
o("div", fs, [
|
|
2583
|
+
o("div", _s, [
|
|
2584
|
+
o("div", ps, v(n.data.title), 1),
|
|
2585
|
+
n.data.subtitle ? (c(), u("div", gs, v(n.data.subtitle), 1)) : b("", !0)
|
|
2491
2586
|
]),
|
|
2492
2587
|
n.data.badge && n.data.badge.label ? (c(), u("span", {
|
|
2493
2588
|
key: 0,
|
|
@@ -2497,44 +2592,44 @@ function gs(e, t, n, r, a, s) {
|
|
|
2497
2592
|
])
|
|
2498
2593
|
}, v(n.data.badge.label), 3)) : b("", !0)
|
|
2499
2594
|
]),
|
|
2500
|
-
s.hasBody ? (c(), u("div",
|
|
2501
|
-
n.data.body ? (c(), u("div",
|
|
2502
|
-
s.fields.length ? (c(!0), u(L, { key: 1 }, j(s.fields, (
|
|
2595
|
+
s.hasBody ? (c(), u("div", vs, [
|
|
2596
|
+
n.data.body ? (c(), u("div", ys, v(n.data.body), 1)) : b("", !0),
|
|
2597
|
+
s.fields.length ? (c(!0), u(L, { key: 1 }, j(s.fields, (a, l) => (c(), u("div", {
|
|
2503
2598
|
key: l,
|
|
2504
2599
|
class: "wm-art__field"
|
|
2505
2600
|
}, [
|
|
2506
|
-
o("div",
|
|
2601
|
+
o("div", bs, v(a.label), 1),
|
|
2507
2602
|
o("div", {
|
|
2508
2603
|
class: x([
|
|
2509
2604
|
"wm-art__fieldValue",
|
|
2510
|
-
{ "wm-art__fieldValue--multi":
|
|
2605
|
+
{ "wm-art__fieldValue--multi": a.multiline }
|
|
2511
2606
|
])
|
|
2512
|
-
}, v(
|
|
2607
|
+
}, v(a.value), 3)
|
|
2513
2608
|
]))), 128)) : b("", !0)
|
|
2514
2609
|
])) : b("", !0)
|
|
2515
2610
|
]);
|
|
2516
2611
|
}
|
|
2517
|
-
const
|
|
2518
|
-
function
|
|
2612
|
+
const ks = /* @__PURE__ */ E(ds, [["render", ws], ["__scopeId", "data-v-7eae0e4a"]]);
|
|
2613
|
+
function Cs(e, t, n) {
|
|
2519
2614
|
if (!e) return "";
|
|
2520
|
-
const
|
|
2521
|
-
if (Number.isNaN(
|
|
2522
|
-
const
|
|
2615
|
+
const i = new Date(e);
|
|
2616
|
+
if (Number.isNaN(i.getTime())) return e;
|
|
2617
|
+
const r = i.toLocaleDateString(t, {
|
|
2523
2618
|
day: "numeric",
|
|
2524
2619
|
month: "long",
|
|
2525
2620
|
year: "numeric"
|
|
2526
|
-
}), s =
|
|
2621
|
+
}), s = i.toLocaleTimeString(t, {
|
|
2527
2622
|
hour: "2-digit",
|
|
2528
2623
|
minute: "2-digit"
|
|
2529
2624
|
});
|
|
2530
|
-
return `${
|
|
2625
|
+
return `${r}${n}${s}`;
|
|
2531
2626
|
}
|
|
2532
|
-
const
|
|
2627
|
+
const As = {
|
|
2533
2628
|
name: "WmArtifactTicket",
|
|
2534
2629
|
inject: {
|
|
2535
2630
|
// Translator + resolved-language getter shared by the Messenger
|
|
2536
2631
|
// shell. Fall back to French wording when used standalone.
|
|
2537
|
-
t: { default: () =>
|
|
2632
|
+
t: { default: () => P() },
|
|
2538
2633
|
wmLocale: { default: () => () => "fr" }
|
|
2539
2634
|
},
|
|
2540
2635
|
props: {
|
|
@@ -2547,9 +2642,9 @@ const bs = {
|
|
|
2547
2642
|
},
|
|
2548
2643
|
formattedDate() {
|
|
2549
2644
|
var e;
|
|
2550
|
-
return
|
|
2645
|
+
return Cs(
|
|
2551
2646
|
(e = this.data) == null ? void 0 : e.created_at,
|
|
2552
|
-
|
|
2647
|
+
oe(this.wmLocale()),
|
|
2553
2648
|
this.t("ticket.dateAt")
|
|
2554
2649
|
);
|
|
2555
2650
|
}
|
|
@@ -2575,13 +2670,13 @@ const bs = {
|
|
|
2575
2670
|
return /high|haute|élev|elev|critic|critiq|urgent/.test(t) ? 3 : /low|basse|faible|minor/.test(t) ? 1 : 2;
|
|
2576
2671
|
}
|
|
2577
2672
|
}
|
|
2578
|
-
},
|
|
2673
|
+
}, Ss = { class: "wm-art wm-art--ticket" }, Ms = { class: "wm-art__head wm-tk__head" }, Ts = { class: "wm-art__title wm-tk__title" }, xs = { class: "wm-tk__sub" }, Os = { class: "wm-tk__ref" }, Ls = {
|
|
2579
2674
|
key: 0,
|
|
2580
2675
|
class: "wm-tk__text"
|
|
2581
|
-
},
|
|
2676
|
+
}, Is = {
|
|
2582
2677
|
key: 0,
|
|
2583
2678
|
class: "wm-art__body"
|
|
2584
|
-
},
|
|
2679
|
+
}, Es = { class: "wm-art__fieldLabel" }, Bs = ["data-level"], Rs = {
|
|
2585
2680
|
key: 1,
|
|
2586
2681
|
class: "wm-tk__date",
|
|
2587
2682
|
width: "12",
|
|
@@ -2593,16 +2688,16 @@ const bs = {
|
|
|
2593
2688
|
"stroke-linecap": "round",
|
|
2594
2689
|
"stroke-linejoin": "round",
|
|
2595
2690
|
"aria-hidden": "true"
|
|
2596
|
-
},
|
|
2691
|
+
}, Ns = {
|
|
2597
2692
|
key: 1,
|
|
2598
2693
|
class: "wm-art__footer wm-tk__footer"
|
|
2599
2694
|
};
|
|
2600
|
-
function
|
|
2601
|
-
return c(), u("div",
|
|
2602
|
-
o("div",
|
|
2603
|
-
o("div",
|
|
2604
|
-
o("div",
|
|
2605
|
-
o("div",
|
|
2695
|
+
function Fs(e, t, n, i, r, s) {
|
|
2696
|
+
return c(), u("div", Ss, [
|
|
2697
|
+
o("div", Ms, [
|
|
2698
|
+
o("div", Ts, v(n.data.title), 1),
|
|
2699
|
+
o("div", xs, [
|
|
2700
|
+
o("div", Os, [
|
|
2606
2701
|
t[0] || (t[0] = o("svg", {
|
|
2607
2702
|
width: "11",
|
|
2608
2703
|
height: "11",
|
|
@@ -2633,24 +2728,24 @@ function Is(e, t, n, r, a, s) {
|
|
|
2633
2728
|
pe(" " + v(n.data.status.label), 1)
|
|
2634
2729
|
], 2)
|
|
2635
2730
|
]),
|
|
2636
|
-
n.data.body ? (c(), u("div",
|
|
2731
|
+
n.data.body ? (c(), u("div", Ls, v(n.data.body), 1)) : b("", !0)
|
|
2637
2732
|
]),
|
|
2638
|
-
s.fields.length ? (c(), u("div",
|
|
2639
|
-
(c(!0), u(L, null, j(s.fields, (
|
|
2733
|
+
s.fields.length ? (c(), u("div", Is, [
|
|
2734
|
+
(c(!0), u(L, null, j(s.fields, (a, l) => (c(), u("div", {
|
|
2640
2735
|
key: l,
|
|
2641
2736
|
class: "wm-art__field"
|
|
2642
2737
|
}, [
|
|
2643
|
-
o("div",
|
|
2738
|
+
o("div", Es, v(a.label), 1),
|
|
2644
2739
|
o("div", {
|
|
2645
2740
|
class: x([
|
|
2646
2741
|
"wm-art__fieldValue",
|
|
2647
|
-
{ "wm-art__fieldValue--multi":
|
|
2742
|
+
{ "wm-art__fieldValue--multi": a.multiline }
|
|
2648
2743
|
])
|
|
2649
2744
|
}, [
|
|
2650
|
-
s.isPriority(
|
|
2745
|
+
s.isPriority(a.label) ? (c(), u("svg", {
|
|
2651
2746
|
key: 0,
|
|
2652
2747
|
class: "wm-tk__prio",
|
|
2653
|
-
"data-level": s.priorityLevel(
|
|
2748
|
+
"data-level": s.priorityLevel(a.value),
|
|
2654
2749
|
width: "12",
|
|
2655
2750
|
height: "12",
|
|
2656
2751
|
viewBox: "0 0 12 12",
|
|
@@ -2677,7 +2772,7 @@ function Is(e, t, n, r, a, s) {
|
|
|
2677
2772
|
height: "9",
|
|
2678
2773
|
rx: "0.5"
|
|
2679
2774
|
}, null, -1)
|
|
2680
|
-
])], 8,
|
|
2775
|
+
])], 8, Bs)) : s.isDate(a.label) ? (c(), u("svg", Rs, [...t[3] || (t[3] = [
|
|
2681
2776
|
o("rect", {
|
|
2682
2777
|
x: "3",
|
|
2683
2778
|
y: "4",
|
|
@@ -2687,11 +2782,11 @@ function Is(e, t, n, r, a, s) {
|
|
|
2687
2782
|
}, null, -1),
|
|
2688
2783
|
o("path", { d: "M16 2v4M8 2v4M3 10h18" }, null, -1)
|
|
2689
2784
|
])])) : b("", !0),
|
|
2690
|
-
o("span", null, v(
|
|
2785
|
+
o("span", null, v(a.value), 1)
|
|
2691
2786
|
], 2)
|
|
2692
2787
|
]))), 128))
|
|
2693
2788
|
])) : b("", !0),
|
|
2694
|
-
n.data.created_at ? (c(), u("div",
|
|
2789
|
+
n.data.created_at ? (c(), u("div", Ns, [
|
|
2695
2790
|
t[4] || (t[4] = o("svg", {
|
|
2696
2791
|
width: "11",
|
|
2697
2792
|
height: "11",
|
|
@@ -2716,11 +2811,11 @@ function Is(e, t, n, r, a, s) {
|
|
|
2716
2811
|
])) : b("", !0)
|
|
2717
2812
|
]);
|
|
2718
2813
|
}
|
|
2719
|
-
const
|
|
2720
|
-
form_response:
|
|
2721
|
-
info_card:
|
|
2722
|
-
ticket:
|
|
2723
|
-
},
|
|
2814
|
+
const js = /* @__PURE__ */ E(As, [["render", Fs], ["__scopeId", "data-v-5f30c914"]]), Ps = {
|
|
2815
|
+
form_response: cs,
|
|
2816
|
+
info_card: ks,
|
|
2817
|
+
ticket: js
|
|
2818
|
+
}, Ds = {
|
|
2724
2819
|
name: "WmArtifactRenderer",
|
|
2725
2820
|
props: {
|
|
2726
2821
|
// Forme : { kind: string, data: any } (le `data` est validé
|
|
@@ -2731,23 +2826,23 @@ const Bs = /* @__PURE__ */ I(bs, [["render", Is], ["__scopeId", "data-v-5f30c914
|
|
|
2731
2826
|
component() {
|
|
2732
2827
|
var t;
|
|
2733
2828
|
const e = (t = this.artifact) == null ? void 0 : t.kind;
|
|
2734
|
-
return e &&
|
|
2829
|
+
return e && Ps[e] || null;
|
|
2735
2830
|
}
|
|
2736
2831
|
}
|
|
2737
2832
|
};
|
|
2738
|
-
function
|
|
2833
|
+
function Us(e, t, n, i, r, s) {
|
|
2739
2834
|
return s.component ? (c(), R(De(s.component), {
|
|
2740
2835
|
key: 0,
|
|
2741
2836
|
data: n.artifact.data
|
|
2742
2837
|
}, null, 8, ["data"])) : b("", !0);
|
|
2743
2838
|
}
|
|
2744
|
-
const
|
|
2839
|
+
const $s = /* @__PURE__ */ E(Ds, [["render", Us]]), Hs = {
|
|
2745
2840
|
name: "WmAttachmentPreview",
|
|
2746
2841
|
inject: {
|
|
2747
2842
|
signAttachmentFn: { default: null },
|
|
2748
2843
|
// Translator shared by the Messenger shell; French fallback when
|
|
2749
2844
|
// the component is used standalone.
|
|
2750
|
-
t: { default: () =>
|
|
2845
|
+
t: { default: () => P() }
|
|
2751
2846
|
},
|
|
2752
2847
|
props: {
|
|
2753
2848
|
attachment: { type: Object, required: !0 }
|
|
@@ -2757,10 +2852,10 @@ const js = /* @__PURE__ */ I(Ns, [["render", Fs]]), Ds = {
|
|
|
2757
2852
|
},
|
|
2758
2853
|
computed: {
|
|
2759
2854
|
kind() {
|
|
2760
|
-
var n,
|
|
2855
|
+
var n, i;
|
|
2761
2856
|
const e = (n = this.attachment) == null ? void 0 : n.type;
|
|
2762
2857
|
if (e) return e;
|
|
2763
|
-
const t = (((
|
|
2858
|
+
const t = (((i = this.attachment) == null ? void 0 : i.mime_type) || "").toLowerCase();
|
|
2764
2859
|
return t.startsWith("image/") ? "image" : t.startsWith("audio/") ? "audio" : t.startsWith("video/") ? "video" : "file";
|
|
2765
2860
|
},
|
|
2766
2861
|
displayName() {
|
|
@@ -2805,48 +2900,48 @@ const js = /* @__PURE__ */ I(Ns, [["render", Fs]]), Ds = {
|
|
|
2805
2900
|
this.url || e.preventDefault();
|
|
2806
2901
|
}
|
|
2807
2902
|
}
|
|
2808
|
-
},
|
|
2903
|
+
}, zs = ["href"], qs = ["src", "alt"], Vs = ["src"], Ws = ["src"], Ks = ["href", "download"], Gs = { class: "wm-att__main" }, Ys = { class: "wm-att__name" }, Qs = {
|
|
2809
2904
|
key: 0,
|
|
2810
2905
|
class: "wm-att__meta"
|
|
2811
|
-
},
|
|
2906
|
+
}, Xs = {
|
|
2812
2907
|
key: 0,
|
|
2813
2908
|
class: "wm-att__spin",
|
|
2814
2909
|
"aria-hidden": "true"
|
|
2815
2910
|
};
|
|
2816
|
-
function
|
|
2911
|
+
function Js(e, t, n, i, r, s) {
|
|
2817
2912
|
return c(), u("div", {
|
|
2818
2913
|
class: x(["wm-att", ["wm-att--" + (s.kind || "file")]])
|
|
2819
2914
|
}, [
|
|
2820
|
-
s.kind === "image" &&
|
|
2915
|
+
s.kind === "image" && r.url ? (c(), u("a", {
|
|
2821
2916
|
key: 0,
|
|
2822
|
-
href:
|
|
2917
|
+
href: r.url,
|
|
2823
2918
|
target: "_blank",
|
|
2824
2919
|
rel: "noopener",
|
|
2825
2920
|
class: "wm-att__imgWrap"
|
|
2826
2921
|
}, [
|
|
2827
2922
|
o("img", {
|
|
2828
|
-
src:
|
|
2923
|
+
src: r.url,
|
|
2829
2924
|
alt: s.displayName,
|
|
2830
2925
|
loading: "lazy"
|
|
2831
|
-
}, null, 8,
|
|
2832
|
-
], 8,
|
|
2926
|
+
}, null, 8, qs)
|
|
2927
|
+
], 8, zs)) : s.kind === "audio" && r.url ? (c(), u("audio", {
|
|
2833
2928
|
key: 1,
|
|
2834
|
-
src:
|
|
2929
|
+
src: r.url,
|
|
2835
2930
|
controls: "",
|
|
2836
2931
|
preload: "metadata"
|
|
2837
|
-
}, null, 8,
|
|
2932
|
+
}, null, 8, Vs)) : s.kind === "video" && r.url ? (c(), u("video", {
|
|
2838
2933
|
key: 2,
|
|
2839
|
-
src:
|
|
2934
|
+
src: r.url,
|
|
2840
2935
|
controls: "",
|
|
2841
2936
|
preload: "metadata"
|
|
2842
|
-
}, null, 8,
|
|
2937
|
+
}, null, 8, Ws)) : (c(), u("a", {
|
|
2843
2938
|
key: 3,
|
|
2844
2939
|
class: "wm-att__file",
|
|
2845
|
-
href:
|
|
2940
|
+
href: r.url || "#",
|
|
2846
2941
|
download: s.displayName,
|
|
2847
2942
|
target: "_blank",
|
|
2848
2943
|
rel: "noopener",
|
|
2849
|
-
onClick: t[0] || (t[0] = (...
|
|
2944
|
+
onClick: t[0] || (t[0] = (...a) => s.onFileClick && s.onFileClick(...a))
|
|
2850
2945
|
}, [
|
|
2851
2946
|
t[1] || (t[1] = o("span", { class: "wm-att__icon" }, [
|
|
2852
2947
|
o("svg", {
|
|
@@ -2864,100 +2959,15 @@ function Gs(e, t, n, r, a, s) {
|
|
|
2864
2959
|
o("path", { d: "M14 2v6h6" })
|
|
2865
2960
|
])
|
|
2866
2961
|
], -1)),
|
|
2867
|
-
o("span",
|
|
2868
|
-
o("span",
|
|
2869
|
-
s.sizeLabel ? (c(), u("span",
|
|
2962
|
+
o("span", Gs, [
|
|
2963
|
+
o("span", Ys, v(s.displayName), 1),
|
|
2964
|
+
s.sizeLabel ? (c(), u("span", Qs, v(s.sizeLabel), 1)) : b("", !0)
|
|
2870
2965
|
]),
|
|
2871
|
-
|
|
2872
|
-
], 8,
|
|
2966
|
+
r.loading ? (c(), u("span", Xs)) : b("", !0)
|
|
2967
|
+
], 8, Ks))
|
|
2873
2968
|
], 2);
|
|
2874
2969
|
}
|
|
2875
|
-
const
|
|
2876
|
-
function Qs(e) {
|
|
2877
|
-
return String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2878
|
-
}
|
|
2879
|
-
function Xs(e) {
|
|
2880
|
-
return /^(https?:\/\/|mailto:|tel:)/i.test(String(e).trim());
|
|
2881
|
-
}
|
|
2882
|
-
const Se = "";
|
|
2883
|
-
function de(e) {
|
|
2884
|
-
let t = e;
|
|
2885
|
-
const n = [];
|
|
2886
|
-
return t = t.replace(/`([^`\n]+)`/g, (r, a) => {
|
|
2887
|
-
const s = n.length;
|
|
2888
|
-
return n.push(a), `${Se}CODE${s}${Se}`;
|
|
2889
|
-
}), t = t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (r, a, s) => Xs(s) ? `<a href="${s}" target="_blank" rel="noopener noreferrer">${a}</a>` : a), t = t.replace(/\*\*([^\n*][^\n]*?)\*\*/g, "<strong>$1</strong>"), t = t.replace(/__([^\n_][^\n]*?)__/g, "<u>$1</u>"), t = t.replace(/~~([^\n~][^\n]*?)~~/g, "<s>$1</s>"), t = t.replace(/(^|[^\w*])\*([^\n*]+?)\*(?!\w)/g, "$1<em>$2</em>"), t = t.replace(/(^|[^\w_])_([^\n_]+?)_(?!\w)/g, "$1<em>$2</em>"), t = t.replace(/CODE(\d+)/g, (r, a) => `<code class="wm-md-code">${n[+a]}</code>`), t;
|
|
2890
|
-
}
|
|
2891
|
-
function Js(e) {
|
|
2892
|
-
if (!e) return "";
|
|
2893
|
-
const t = Qs(e).split(`
|
|
2894
|
-
`), n = [];
|
|
2895
|
-
let r = 0;
|
|
2896
|
-
for (; r < t.length; ) {
|
|
2897
|
-
const s = t[r];
|
|
2898
|
-
if (/^\s*```([\w-]*)\s*$/.exec(s)) {
|
|
2899
|
-
r++;
|
|
2900
|
-
const C = [];
|
|
2901
|
-
for (; r < t.length && !/^\s*```\s*$/.test(t[r]); )
|
|
2902
|
-
C.push(t[r]), r++;
|
|
2903
|
-
r < t.length && r++, n.push({
|
|
2904
|
-
type: "block",
|
|
2905
|
-
html: `<pre class="wm-md-pre"><code>${C.join(`
|
|
2906
|
-
`)}</code></pre>`
|
|
2907
|
-
});
|
|
2908
|
-
continue;
|
|
2909
|
-
}
|
|
2910
|
-
if (/^\s*[-*]\s+/.test(s)) {
|
|
2911
|
-
const C = [];
|
|
2912
|
-
for (; r < t.length; ) {
|
|
2913
|
-
const T = /^\s*[-*]\s+(.*)$/.exec(t[r]);
|
|
2914
|
-
if (!T) break;
|
|
2915
|
-
C.push(T[1]), r++;
|
|
2916
|
-
}
|
|
2917
|
-
const k = C.map((T) => `<li>${de(T)}</li>`).join("");
|
|
2918
|
-
n.push({
|
|
2919
|
-
type: "block",
|
|
2920
|
-
html: `<ul class="wm-md-ul">${k}</ul>`
|
|
2921
|
-
});
|
|
2922
|
-
continue;
|
|
2923
|
-
}
|
|
2924
|
-
const l = /^\s*(\d+)\.\s+(.*)$/.exec(s);
|
|
2925
|
-
if (l) {
|
|
2926
|
-
const C = parseInt(l[1], 10), k = [l[2]];
|
|
2927
|
-
for (r++; r < t.length; ) {
|
|
2928
|
-
const A = /^\s*\d+\.\s+(.*)$/.exec(t[r]);
|
|
2929
|
-
if (!A) break;
|
|
2930
|
-
k.push(A[1]), r++;
|
|
2931
|
-
}
|
|
2932
|
-
const T = k.map((A) => `<li>${de(A)}</li>`).join(""), B = C !== 1 ? ` start="${C}"` : "";
|
|
2933
|
-
n.push({
|
|
2934
|
-
type: "block",
|
|
2935
|
-
html: `<ol class="wm-md-ol"${B}>${T}</ol>`
|
|
2936
|
-
});
|
|
2937
|
-
continue;
|
|
2938
|
-
}
|
|
2939
|
-
const g = /^(#{1,6})\s+(.*)$/.exec(s);
|
|
2940
|
-
if (g) {
|
|
2941
|
-
const C = g[1].length;
|
|
2942
|
-
n.push({
|
|
2943
|
-
type: "block",
|
|
2944
|
-
html: `<h${C} class="wm-md-h wm-md-h${C}">${de(g[2])}</h${C}>`
|
|
2945
|
-
}), r++;
|
|
2946
|
-
continue;
|
|
2947
|
-
}
|
|
2948
|
-
n.push({ type: "text", html: de(s) }), r++;
|
|
2949
|
-
}
|
|
2950
|
-
let a = "";
|
|
2951
|
-
for (let s = 0; s < n.length; s++) {
|
|
2952
|
-
const i = n[s];
|
|
2953
|
-
a += i.html;
|
|
2954
|
-
const l = n[s + 1];
|
|
2955
|
-
l && i.type !== "block" && l.type !== "block" && (a += `
|
|
2956
|
-
`);
|
|
2957
|
-
}
|
|
2958
|
-
return a;
|
|
2959
|
-
}
|
|
2960
|
-
const Zs = {
|
|
2970
|
+
const Zs = /* @__PURE__ */ E(Hs, [["render", Js], ["__scopeId", "data-v-afc7b0d3"]]), er = {
|
|
2961
2971
|
name: "WmBubble",
|
|
2962
2972
|
props: {
|
|
2963
2973
|
role: { type: String, default: "ai" },
|
|
@@ -2966,53 +2976,53 @@ const Zs = {
|
|
|
2966
2976
|
},
|
|
2967
2977
|
computed: {
|
|
2968
2978
|
rendered() {
|
|
2969
|
-
return
|
|
2979
|
+
return un(this.text);
|
|
2970
2980
|
}
|
|
2971
2981
|
}
|
|
2972
|
-
},
|
|
2973
|
-
function
|
|
2982
|
+
}, tr = ["innerHTML"];
|
|
2983
|
+
function nr(e, t, n, i, r, s) {
|
|
2974
2984
|
return c(), u("div", {
|
|
2975
2985
|
class: x(["wm-bubble", "wm-bubble--" + n.role])
|
|
2976
2986
|
}, [
|
|
2977
|
-
|
|
2978
|
-
o("span", { innerHTML: s.rendered }, null, 8,
|
|
2987
|
+
Ue(e.$slots, "default", {}, () => [
|
|
2988
|
+
o("span", { innerHTML: s.rendered }, null, 8, tr)
|
|
2979
2989
|
], !0)
|
|
2980
2990
|
], 2);
|
|
2981
2991
|
}
|
|
2982
|
-
const
|
|
2983
|
-
function
|
|
2984
|
-
return c(), u("div",
|
|
2992
|
+
const sr = /* @__PURE__ */ E(er, [["render", nr], ["__scopeId", "data-v-7ab13147"]]), rr = { name: "WmTyping" }, ir = { class: "wm-typing" };
|
|
2993
|
+
function ar(e, t, n, i, r, s) {
|
|
2994
|
+
return c(), u("div", ir, [...t[0] || (t[0] = [
|
|
2985
2995
|
o("span", { style: { "animation-delay": "0s" } }, null, -1),
|
|
2986
2996
|
o("span", { style: { "animation-delay": "0.2s" } }, null, -1),
|
|
2987
2997
|
o("span", { style: { "animation-delay": "0.4s" } }, null, -1)
|
|
2988
2998
|
])]);
|
|
2989
2999
|
}
|
|
2990
|
-
const
|
|
3000
|
+
const or = /* @__PURE__ */ E(rr, [["render", ar], ["__scopeId", "data-v-df2447fd"]]);
|
|
2991
3001
|
function se(e) {
|
|
2992
3002
|
return e ? e.client_msg_id || e.id : "";
|
|
2993
3003
|
}
|
|
2994
|
-
const
|
|
3004
|
+
const lr = {
|
|
2995
3005
|
transferred_to_human: "system.transferredToHuman",
|
|
2996
3006
|
assigned: "system.assigned",
|
|
2997
3007
|
unassigned: "system.unassigned",
|
|
2998
3008
|
resolved: "system.resolved",
|
|
2999
3009
|
reopened: "system.reopened",
|
|
3000
3010
|
idle: "system.idle"
|
|
3001
|
-
},
|
|
3011
|
+
}, cr = 80, dr = 200, ur = {
|
|
3002
3012
|
name: "WmMessageList",
|
|
3003
3013
|
components: {
|
|
3004
|
-
AIAvatar:
|
|
3005
|
-
HumanAvatar:
|
|
3006
|
-
Bubble:
|
|
3007
|
-
Typing:
|
|
3008
|
-
ActionResult:
|
|
3009
|
-
AttachmentPreview:
|
|
3010
|
-
ArtifactRenderer:
|
|
3014
|
+
AIAvatar: le,
|
|
3015
|
+
HumanAvatar: Ee,
|
|
3016
|
+
Bubble: sr,
|
|
3017
|
+
Typing: or,
|
|
3018
|
+
ActionResult: es,
|
|
3019
|
+
AttachmentPreview: Zs,
|
|
3020
|
+
ArtifactRenderer: $s
|
|
3011
3021
|
},
|
|
3012
3022
|
inject: {
|
|
3013
3023
|
// Translator + resolved-language getter shared by the Messenger
|
|
3014
3024
|
// shell. Fall back to French wording when used standalone.
|
|
3015
|
-
t: { default: () =>
|
|
3025
|
+
t: { default: () => P() },
|
|
3016
3026
|
wmLocale: { default: () => () => "fr" }
|
|
3017
3027
|
},
|
|
3018
3028
|
props: {
|
|
@@ -3061,58 +3071,58 @@ const or = {
|
|
|
3061
3071
|
return !this.hasMore && !this.loadingMore && this.messages.length >= 20;
|
|
3062
3072
|
},
|
|
3063
3073
|
groups() {
|
|
3064
|
-
var n,
|
|
3074
|
+
var n, i, r, s;
|
|
3065
3075
|
const e = [];
|
|
3066
|
-
for (const
|
|
3067
|
-
const l = this.roleOf(
|
|
3076
|
+
for (const a of this.messages) {
|
|
3077
|
+
const l = this.roleOf(a);
|
|
3068
3078
|
if (l === "system") {
|
|
3069
|
-
if (((n =
|
|
3079
|
+
if (((n = a == null ? void 0 : a.payload) == null ? void 0 : n.event) === "action_admin_pending") {
|
|
3070
3080
|
const k = e[e.length - 1];
|
|
3071
|
-
k && k.role === "ai" ? k.messages.push(
|
|
3072
|
-
key: `g-${se(
|
|
3081
|
+
k && k.role === "ai" ? k.messages.push(a) : e.push({
|
|
3082
|
+
key: `g-${se(a)}`,
|
|
3073
3083
|
role: "ai",
|
|
3074
3084
|
agentName: "",
|
|
3075
3085
|
agentAvatarUrl: null,
|
|
3076
|
-
messages: [
|
|
3086
|
+
messages: [a],
|
|
3077
3087
|
items: []
|
|
3078
3088
|
});
|
|
3079
3089
|
continue;
|
|
3080
3090
|
}
|
|
3081
3091
|
e.push({
|
|
3082
|
-
key: `sys-${se(
|
|
3092
|
+
key: `sys-${se(a)}`,
|
|
3083
3093
|
role: l,
|
|
3084
|
-
messages: [
|
|
3094
|
+
messages: [a],
|
|
3085
3095
|
items: [],
|
|
3086
|
-
systemLabel: this.systemLabel(
|
|
3096
|
+
systemLabel: this.systemLabel(a)
|
|
3087
3097
|
});
|
|
3088
3098
|
continue;
|
|
3089
3099
|
}
|
|
3090
3100
|
const g = e[e.length - 1];
|
|
3091
|
-
g && g.role === l && (l === "ai" || g.agentName === (((
|
|
3092
|
-
key: `g-${se(
|
|
3101
|
+
g && g.role === l && (l === "ai" || g.agentName === (((i = a == null ? void 0 : a.author) == null ? void 0 : i.name) || "")) ? g.messages.push(a) : e.push({
|
|
3102
|
+
key: `g-${se(a)}`,
|
|
3093
3103
|
role: l,
|
|
3094
|
-
agentName: ((
|
|
3095
|
-
agentAvatarUrl: ((s =
|
|
3096
|
-
messages: [
|
|
3104
|
+
agentName: ((r = a == null ? void 0 : a.author) == null ? void 0 : r.name) || "",
|
|
3105
|
+
agentAvatarUrl: ((s = a == null ? void 0 : a.author) == null ? void 0 : s.avatar_url) || null,
|
|
3106
|
+
messages: [a],
|
|
3097
3107
|
items: []
|
|
3098
3108
|
});
|
|
3099
3109
|
}
|
|
3100
|
-
for (const
|
|
3101
|
-
if (
|
|
3110
|
+
for (const a of e) {
|
|
3111
|
+
if (a.role === "system") continue;
|
|
3102
3112
|
const l = [];
|
|
3103
|
-
for (const g of
|
|
3113
|
+
for (const g of a.messages)
|
|
3104
3114
|
for (const C of this.itemsOf(g)) l.push(C);
|
|
3105
|
-
|
|
3115
|
+
a.items = l;
|
|
3106
3116
|
}
|
|
3107
3117
|
const t = [];
|
|
3108
|
-
for (const
|
|
3109
|
-
if (
|
|
3118
|
+
for (const a of e) {
|
|
3119
|
+
if (a.role !== "system" && !a.items.length) continue;
|
|
3110
3120
|
const l = t[t.length - 1];
|
|
3111
|
-
if (l && l.role !== "system" && l.role ===
|
|
3112
|
-
l.messages.push(...
|
|
3121
|
+
if (l && l.role !== "system" && l.role === a.role && (a.role === "ai" || l.agentName === a.agentName)) {
|
|
3122
|
+
l.messages.push(...a.messages), l.items.push(...a.items);
|
|
3113
3123
|
continue;
|
|
3114
3124
|
}
|
|
3115
|
-
t.push(
|
|
3125
|
+
t.push(a);
|
|
3116
3126
|
}
|
|
3117
3127
|
return t;
|
|
3118
3128
|
},
|
|
@@ -3124,10 +3134,10 @@ const or = {
|
|
|
3124
3134
|
const e = this.unreadAnchorId, t = this.unreadBoundaryTs;
|
|
3125
3135
|
for (const n of this.groups) {
|
|
3126
3136
|
if (n.role === "user" || n.role === "system" || !n.items.length) continue;
|
|
3127
|
-
const
|
|
3128
|
-
if (!
|
|
3129
|
-
const
|
|
3130
|
-
if (
|
|
3137
|
+
const i = n.messages[0];
|
|
3138
|
+
if (!i) continue;
|
|
3139
|
+
const r = J(i.id);
|
|
3140
|
+
if (r != null && !(r <= e) && !(t && i.created_at && i.created_at > t))
|
|
3131
3141
|
return n.key;
|
|
3132
3142
|
}
|
|
3133
3143
|
return null;
|
|
@@ -3155,11 +3165,11 @@ const or = {
|
|
|
3155
3165
|
methods: {
|
|
3156
3166
|
messageKey: se,
|
|
3157
3167
|
isAtBottom(e) {
|
|
3158
|
-
return e.scrollHeight - e.scrollTop - e.clientHeight <=
|
|
3168
|
+
return e.scrollHeight - e.scrollTop - e.clientHeight <= cr;
|
|
3159
3169
|
},
|
|
3160
3170
|
onScroll() {
|
|
3161
3171
|
const e = this.$refs.scrollEl;
|
|
3162
|
-
e && (this.loadingMore || !this.hasMore || this._pendingLoadMore || e.scrollTop <=
|
|
3172
|
+
e && (this.loadingMore || !this.hasMore || this._pendingLoadMore || e.scrollTop <= dr && (this._pendingLoadMore = !0, this.$emit("load-more")));
|
|
3163
3173
|
},
|
|
3164
3174
|
// Capture pre-patch scroll state and restore it on the next tick.
|
|
3165
3175
|
//
|
|
@@ -3188,29 +3198,29 @@ const or = {
|
|
|
3188
3198
|
const t = this._lastSeenConvId !== this.conversationId;
|
|
3189
3199
|
this._lastSeenConvId = this.conversationId;
|
|
3190
3200
|
const n = this.isAtBottom(e);
|
|
3191
|
-
let
|
|
3201
|
+
let i = null;
|
|
3192
3202
|
if (!t && !n) {
|
|
3193
3203
|
const s = this.pickAnchor(e);
|
|
3194
3204
|
if (s != null && s.el) {
|
|
3195
|
-
const
|
|
3196
|
-
|
|
3205
|
+
const a = e.getBoundingClientRect().top;
|
|
3206
|
+
i = {
|
|
3197
3207
|
el: s.el,
|
|
3198
|
-
relY: s.el.getBoundingClientRect().top -
|
|
3208
|
+
relY: s.el.getBoundingClientRect().top - a
|
|
3199
3209
|
};
|
|
3200
3210
|
}
|
|
3201
3211
|
}
|
|
3202
|
-
const
|
|
3203
|
-
this._scrollSnap =
|
|
3204
|
-
if (this._scrollSnap = null,
|
|
3212
|
+
const r = { forceBottom: t, wasPinned: n, anchor: i };
|
|
3213
|
+
this._scrollSnap = r, this.$nextTick(() => {
|
|
3214
|
+
if (this._scrollSnap = null, r.forceBottom || r.wasPinned) {
|
|
3205
3215
|
e.scrollTop = e.scrollHeight;
|
|
3206
3216
|
return;
|
|
3207
3217
|
}
|
|
3208
|
-
if (!
|
|
3218
|
+
if (!r.anchor) return;
|
|
3209
3219
|
const s = () => {
|
|
3210
3220
|
var C;
|
|
3211
|
-
const
|
|
3212
|
-
if (!((C =
|
|
3213
|
-
const g =
|
|
3221
|
+
const a = r.anchor;
|
|
3222
|
+
if (!((C = a.el) != null && C.isConnected)) return;
|
|
3223
|
+
const g = a.el.getBoundingClientRect().top - e.getBoundingClientRect().top - a.relY;
|
|
3214
3224
|
Math.abs(g) > 0.5 && (e.scrollTop += g);
|
|
3215
3225
|
};
|
|
3216
3226
|
s(), requestAnimationFrame(() => {
|
|
@@ -3239,16 +3249,16 @@ const or = {
|
|
|
3239
3249
|
pickAnchor(e) {
|
|
3240
3250
|
const t = e.scrollTop;
|
|
3241
3251
|
let n = null;
|
|
3242
|
-
for (const
|
|
3243
|
-
if (
|
|
3244
|
-
return { el:
|
|
3252
|
+
for (const i of e.children)
|
|
3253
|
+
if (i.classList.contains("wm-list__group") && (n || (n = i), i.offsetTop + i.offsetHeight >= t))
|
|
3254
|
+
return { el: i, offsetTop: i.offsetTop };
|
|
3245
3255
|
return n ? { el: n, offsetTop: n.offsetTop } : null;
|
|
3246
3256
|
},
|
|
3247
3257
|
roleOf(e) {
|
|
3248
|
-
var n,
|
|
3258
|
+
var n, i;
|
|
3249
3259
|
if ((e == null ? void 0 : e.type) === "system" || ((n = e == null ? void 0 : e.payload) == null ? void 0 : n.type) === "system")
|
|
3250
3260
|
return "system";
|
|
3251
|
-
const t = (
|
|
3261
|
+
const t = (i = e == null ? void 0 : e.author) == null ? void 0 : i.type;
|
|
3252
3262
|
return t === "user" ? "user" : t === "agent_human" ? "human" : "ai";
|
|
3253
3263
|
},
|
|
3254
3264
|
roleLabel(e) {
|
|
@@ -3344,9 +3354,9 @@ const or = {
|
|
|
3344
3354
|
// doit garder son arrondi.
|
|
3345
3355
|
cornersFor(e, t) {
|
|
3346
3356
|
var ee, te, G;
|
|
3347
|
-
const n = e.items,
|
|
3348
|
-
let
|
|
3349
|
-
return
|
|
3357
|
+
const n = e.items, i = (ee = n[t]) == null ? void 0 : ee.kind, r = (te = n[t - 1]) == null ? void 0 : te.kind, s = (G = n[t + 1]) == null ? void 0 : G.kind, a = e.role === "user", l = 14, g = 4, C = r == null ? void 0 : r.bottom, k = s == null ? void 0 : s.top, T = this.widthByKey[this.rowKeyOf(e, t)], B = this.widthByKey[this.rowKeyOf(e, t - 1)], A = this.widthByKey[this.rowKeyOf(e, t + 1)], H = 0.5, M = (Y, Q, q) => Y != null && T != null ? Y + H >= T : Q === q || Q === "card" && q === "bubble";
|
|
3358
|
+
let D = l, N = l, $ = l, K = l;
|
|
3359
|
+
return a ? (C && (N = g), (k || !s) && ($ = g), C && M(B, C, i == null ? void 0 : i.top) && (D = g), k && M(A, k, i == null ? void 0 : i.bottom) && (K = g)) : (C && (D = g), (k || !s) && (K = g), C && M(B, C, i == null ? void 0 : i.top) && (N = g), k && M(A, k, i == null ? void 0 : i.bottom) && ($ = g)), { tl: D, tr: N, br: $, bl: K };
|
|
3350
3360
|
},
|
|
3351
3361
|
// Inline style emitting the four corner CSS variables. Set on
|
|
3352
3362
|
// `.wm-list__row` so they cascade to Bubble/ActionResult/
|
|
@@ -3365,8 +3375,8 @@ const or = {
|
|
|
3365
3375
|
// Clé unique par item de cluster, alignée avec `:key` /
|
|
3366
3376
|
// `data-row-key` du template. Sert d'index dans `widthByKey`.
|
|
3367
3377
|
rowKeyOf(e, t) {
|
|
3368
|
-
var
|
|
3369
|
-
const n = (
|
|
3378
|
+
var i;
|
|
3379
|
+
const n = (i = e == null ? void 0 : e.items) == null ? void 0 : i[t];
|
|
3370
3380
|
return n ? `${se(n.message)}-${n.partKey}` : "";
|
|
3371
3381
|
},
|
|
3372
3382
|
// rAF-debouncé : `updated()` peut être appelé en rafale (stream,
|
|
@@ -3387,20 +3397,20 @@ const or = {
|
|
|
3387
3397
|
for (const s of e.querySelectorAll(
|
|
3388
3398
|
".wm-list__row[data-row-key]"
|
|
3389
3399
|
)) {
|
|
3390
|
-
const
|
|
3391
|
-
if (!
|
|
3400
|
+
const a = s.dataset.rowKey;
|
|
3401
|
+
if (!a) continue;
|
|
3392
3402
|
const l = s.querySelector(
|
|
3393
3403
|
".wm-bubble, .wm-result, .wm-art, .wm-list__body"
|
|
3394
3404
|
);
|
|
3395
3405
|
if (!l) continue;
|
|
3396
3406
|
const g = l.getBoundingClientRect().width;
|
|
3397
|
-
g > 0 && (t[
|
|
3407
|
+
g > 0 && (t[a] = g);
|
|
3398
3408
|
}
|
|
3399
|
-
const n = this.widthByKey,
|
|
3400
|
-
if (
|
|
3409
|
+
const n = this.widthByKey, i = Object.keys(n), r = Object.keys(t);
|
|
3410
|
+
if (i.length === r.length) {
|
|
3401
3411
|
let s = !0;
|
|
3402
|
-
for (const
|
|
3403
|
-
if (Math.abs((n[
|
|
3412
|
+
for (const a of r)
|
|
3413
|
+
if (Math.abs((n[a] ?? 0) - t[a]) > 0.5) {
|
|
3404
3414
|
s = !1;
|
|
3405
3415
|
break;
|
|
3406
3416
|
}
|
|
@@ -3414,7 +3424,7 @@ const or = {
|
|
|
3414
3424
|
try {
|
|
3415
3425
|
return Le(
|
|
3416
3426
|
new Date(n.created_at),
|
|
3417
|
-
|
|
3427
|
+
oe(this.wmLocale())
|
|
3418
3428
|
);
|
|
3419
3429
|
} catch {
|
|
3420
3430
|
return "";
|
|
@@ -3448,92 +3458,103 @@ const or = {
|
|
|
3448
3458
|
return ((t = e == null ? void 0 : e.payload) == null ? void 0 : t.name) || (e == null ? void 0 : e.text_md) || this.t("common.action");
|
|
3449
3459
|
},
|
|
3450
3460
|
actionDetail(e) {
|
|
3451
|
-
var n,
|
|
3461
|
+
var n, i, r, s, a, l;
|
|
3452
3462
|
const t = e == null ? void 0 : e.payload;
|
|
3453
|
-
return t ? t.state === "success" ? ((n = t.success) == null ? void 0 : n.summary) || ((
|
|
3463
|
+
return t ? t.state === "success" ? ((n = t.success) == null ? void 0 : n.summary) || ((r = (i = t.success) == null ? void 0 : i.metadata) == null ? void 0 : r.description) || "" : t.state === "rejected" ? ((s = t.rejected) == null ? void 0 : s.reason) || this.t("action.rejectedByUser") : t.state === "failure" && (((a = t.failure) == null ? void 0 : a.summary) || ((l = t.failure) == null ? void 0 : l.error)) || "" : "";
|
|
3454
3464
|
},
|
|
3455
3465
|
actionArtifact(e) {
|
|
3456
|
-
var n,
|
|
3457
|
-
const t = (
|
|
3466
|
+
var n, i;
|
|
3467
|
+
const t = (i = (n = e == null ? void 0 : e.payload) == null ? void 0 : n.success) == null ? void 0 : i.artifact;
|
|
3458
3468
|
return !t || typeof t != "object" || typeof t.kind != "string" ? null : t;
|
|
3459
3469
|
},
|
|
3460
3470
|
systemLabel(e) {
|
|
3461
|
-
var
|
|
3462
|
-
const t = (
|
|
3463
|
-
return n ? this.t(n, { name:
|
|
3471
|
+
var r, s, a;
|
|
3472
|
+
const t = (r = e == null ? void 0 : e.payload) == null ? void 0 : r.event, n = lr[t], i = ((s = e == null ? void 0 : e.metadata) == null ? void 0 : s.agent_name) || ((a = e == null ? void 0 : e.author) == null ? void 0 : a.name) || this.t("messageList.anAgent");
|
|
3473
|
+
return n ? this.t(n, { name: i }) : (e == null ? void 0 : e.text_md) || this.t("messageList.conversationUpdate");
|
|
3464
3474
|
},
|
|
3465
3475
|
scrollToBottom() {
|
|
3466
3476
|
const e = this.$refs.scrollEl;
|
|
3467
3477
|
e && (e.scrollTop = e.scrollHeight);
|
|
3468
3478
|
}
|
|
3469
3479
|
}
|
|
3470
|
-
},
|
|
3480
|
+
}, hr = {
|
|
3471
3481
|
key: 0,
|
|
3482
|
+
class: "wm-list__initialLoad",
|
|
3483
|
+
role: "status",
|
|
3484
|
+
"aria-live": "polite",
|
|
3485
|
+
"aria-busy": "true"
|
|
3486
|
+
}, mr = {
|
|
3487
|
+
key: 1,
|
|
3472
3488
|
class: "wm-list__loadMore",
|
|
3473
3489
|
role: "status",
|
|
3474
3490
|
"aria-live": "polite"
|
|
3475
|
-
},
|
|
3476
|
-
key: 1,
|
|
3477
|
-
class: "wm-list__historyEnd"
|
|
3478
|
-
}, fr = {
|
|
3491
|
+
}, fr = { class: "wm-list__loadMore-lbl" }, _r = {
|
|
3479
3492
|
key: 2,
|
|
3493
|
+
class: "wm-list__historyEnd"
|
|
3494
|
+
}, pr = {
|
|
3495
|
+
key: 3,
|
|
3480
3496
|
class: "wm-list__sep"
|
|
3481
|
-
},
|
|
3497
|
+
}, gr = { class: "wm-list__sep-label" }, vr = {
|
|
3482
3498
|
key: 0,
|
|
3483
3499
|
class: "wm-list__sep wm-list__sep--unread"
|
|
3484
|
-
},
|
|
3500
|
+
}, yr = { class: "wm-list__sep-label wm-list__sep-label--unread" }, br = {
|
|
3485
3501
|
key: 0,
|
|
3486
3502
|
class: "wm-list__sysep"
|
|
3487
|
-
},
|
|
3503
|
+
}, wr = { class: "wm-list__sysep-label" }, kr = ["data-row-key"], Cr = {
|
|
3488
3504
|
key: 0,
|
|
3489
3505
|
class: "wm-list__avatarSlot"
|
|
3490
|
-
},
|
|
3506
|
+
}, Ar = {
|
|
3491
3507
|
key: 5,
|
|
3492
3508
|
class: "wm-list__body"
|
|
3493
|
-
},
|
|
3509
|
+
}, Sr = { key: 0 }, Mr = {
|
|
3494
3510
|
key: 1,
|
|
3495
3511
|
"aria-hidden": "true"
|
|
3496
|
-
},
|
|
3497
|
-
key:
|
|
3512
|
+
}, Tr = { key: 2 }, xr = {
|
|
3513
|
+
key: 4,
|
|
3498
3514
|
class: "wm-list__row wm-list__row--ai fade-up"
|
|
3499
|
-
},
|
|
3500
|
-
function
|
|
3501
|
-
const
|
|
3515
|
+
}, Or = { class: "wm-list__avatarSlot" };
|
|
3516
|
+
function Lr(e, t, n, i, r, s) {
|
|
3517
|
+
const a = I("AIAvatar"), l = I("HumanAvatar"), g = I("ActionResult"), C = I("ArtifactRenderer"), k = I("Bubble"), T = I("AttachmentPreview"), B = I("Typing");
|
|
3502
3518
|
return c(), u("div", {
|
|
3503
3519
|
ref: "scrollEl",
|
|
3504
|
-
class: x(["wm-list", { "wm-list--silent":
|
|
3520
|
+
class: x(["wm-list", { "wm-list--silent": r.silentFades }]),
|
|
3505
3521
|
onScrollPassive: t[0] || (t[0] = (...A) => s.onScroll && s.onScroll(...A))
|
|
3506
3522
|
}, [
|
|
3507
|
-
n.loadingMore ? (c(), u("div",
|
|
3508
|
-
|
|
3523
|
+
n.loadingMore && !n.messages.length ? (c(), u("div", hr, [...t[1] || (t[1] = [
|
|
3524
|
+
o("span", {
|
|
3525
|
+
class: "wm-list__loadMore-spinner",
|
|
3526
|
+
"aria-hidden": "true"
|
|
3527
|
+
}, null, -1)
|
|
3528
|
+
])])) : n.loadingMore ? (c(), u("div", mr, [
|
|
3529
|
+
t[2] || (t[2] = o("span", {
|
|
3509
3530
|
class: "wm-list__loadMore-spinner",
|
|
3510
3531
|
"aria-hidden": "true"
|
|
3511
3532
|
}, null, -1)),
|
|
3512
|
-
o("span",
|
|
3513
|
-
])) : s.historyExhausted ? (c(), u("div",
|
|
3514
|
-
n.dateLabel ? (c(), u("div",
|
|
3515
|
-
t[
|
|
3516
|
-
o("span",
|
|
3517
|
-
t[
|
|
3533
|
+
o("span", fr, v(s.t("messageList.loadingHistory")), 1)
|
|
3534
|
+
])) : s.historyExhausted ? (c(), u("div", _r, v(s.t("messageList.conversationStart")), 1)) : b("", !0),
|
|
3535
|
+
n.dateLabel ? (c(), u("div", pr, [
|
|
3536
|
+
t[3] || (t[3] = o("div", { class: "wm-list__line" }, null, -1)),
|
|
3537
|
+
o("span", gr, v(n.dateLabel), 1),
|
|
3538
|
+
t[4] || (t[4] = o("div", { class: "wm-list__line" }, null, -1))
|
|
3518
3539
|
])) : b("", !0),
|
|
3519
3540
|
(c(!0), u(L, null, j(s.groups, (A, H) => (c(), u(L, {
|
|
3520
3541
|
key: A.key
|
|
3521
3542
|
}, [
|
|
3522
|
-
A.key === s.unreadGroupKey ? (c(), u("div",
|
|
3523
|
-
t[
|
|
3524
|
-
o("span",
|
|
3525
|
-
t[
|
|
3543
|
+
A.key === s.unreadGroupKey ? (c(), u("div", vr, [
|
|
3544
|
+
t[5] || (t[5] = o("div", { class: "wm-list__line wm-list__line--unread" }, null, -1)),
|
|
3545
|
+
o("span", yr, v(s.t("messageList.unread")), 1),
|
|
3546
|
+
t[6] || (t[6] = o("div", { class: "wm-list__line wm-list__line--unread" }, null, -1))
|
|
3526
3547
|
])) : b("", !0),
|
|
3527
3548
|
A.role === "system" || A.items.length ? (c(), u("div", {
|
|
3528
3549
|
key: 1,
|
|
3529
3550
|
class: x(["wm-list__group", "wm-list__group--" + A.role])
|
|
3530
3551
|
}, [
|
|
3531
|
-
A.role === "system" ? (c(), u("div",
|
|
3532
|
-
t[
|
|
3533
|
-
o("span",
|
|
3534
|
-
t[
|
|
3552
|
+
A.role === "system" ? (c(), u("div", br, [
|
|
3553
|
+
t[7] || (t[7] = o("div", { class: "wm-list__line wm-list__line--strong" }, null, -1)),
|
|
3554
|
+
o("span", wr, v(A.systemLabel), 1),
|
|
3555
|
+
t[8] || (t[8] = o("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
|
|
3535
3556
|
])) : (c(), u(L, { key: 1 }, [
|
|
3536
|
-
(c(!0), u(L, null, j(A.items, (M,
|
|
3557
|
+
(c(!0), u(L, null, j(A.items, (M, D) => (c(), u("div", {
|
|
3537
3558
|
key: `${s.messageKey(M.message)}-${M.partKey}`,
|
|
3538
3559
|
"data-row-key": `${s.messageKey(M.message)}-${M.partKey}`,
|
|
3539
3560
|
class: x(["wm-list__row fade-up", [
|
|
@@ -3543,11 +3564,11 @@ function xr(e, t, n, r, a, s) {
|
|
|
3543
3564
|
"is-failed": M.message._failed
|
|
3544
3565
|
}
|
|
3545
3566
|
]]),
|
|
3546
|
-
style: W(s.cornersStyle(A,
|
|
3567
|
+
style: W(s.cornersStyle(A, D))
|
|
3547
3568
|
}, [
|
|
3548
|
-
A.role !== "user" ? (c(), u("div",
|
|
3549
|
-
|
|
3550
|
-
A.role === "ai" ? (c(), R(
|
|
3569
|
+
A.role !== "user" ? (c(), u("div", Cr, [
|
|
3570
|
+
D === A.items.length - 1 ? (c(), u(L, { key: 0 }, [
|
|
3571
|
+
A.role === "ai" ? (c(), R(a, {
|
|
3551
3572
|
key: 0,
|
|
3552
3573
|
size: 26,
|
|
3553
3574
|
tail: !0
|
|
@@ -3576,7 +3597,7 @@ function xr(e, t, n, r, a, s) {
|
|
|
3576
3597
|
}, null, 8, ["artifact"])) : M.renderAs === "artifact" ? (c(), R(C, {
|
|
3577
3598
|
key: 4,
|
|
3578
3599
|
artifact: s.artifactOf(M.message)
|
|
3579
|
-
}, null, 8, ["artifact"])) : (c(), u("div",
|
|
3600
|
+
}, null, 8, ["artifact"])) : (c(), u("div", Ar, [
|
|
3580
3601
|
M.message.text_md ? (c(), R(k, {
|
|
3581
3602
|
key: 0,
|
|
3582
3603
|
role: A.role,
|
|
@@ -3596,21 +3617,21 @@ function xr(e, t, n, r, a, s) {
|
|
|
3596
3617
|
}, null, 8, ["attachment"]))), 128))
|
|
3597
3618
|
], 2)) : b("", !0)
|
|
3598
3619
|
]))
|
|
3599
|
-
], 14,
|
|
3620
|
+
], 14, kr))), 128)),
|
|
3600
3621
|
(A.role !== "user" || s.lastTimeOf(A)) && !s.hasTrailingOverlay(A) ? (c(), u("div", {
|
|
3601
3622
|
key: 0,
|
|
3602
3623
|
class: x(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
|
|
3603
3624
|
}, [
|
|
3604
|
-
A.role !== "user" ? (c(), u("span",
|
|
3605
|
-
A.role !== "user" && s.lastTimeOf(A) ? (c(), u("span",
|
|
3606
|
-
s.lastTimeOf(A) ? (c(), u("span",
|
|
3625
|
+
A.role !== "user" ? (c(), u("span", Sr, v(s.roleLabel(A)), 1)) : b("", !0),
|
|
3626
|
+
A.role !== "user" && s.lastTimeOf(A) ? (c(), u("span", Mr, "·")) : b("", !0),
|
|
3627
|
+
s.lastTimeOf(A) ? (c(), u("span", Tr, v(s.lastTimeOf(A)), 1)) : b("", !0)
|
|
3607
3628
|
], 2)) : b("", !0)
|
|
3608
3629
|
], 64))
|
|
3609
3630
|
], 2)) : b("", !0)
|
|
3610
3631
|
], 64))), 128)),
|
|
3611
|
-
n.streamingActive ? (c(), u("div",
|
|
3612
|
-
o("div",
|
|
3613
|
-
z(
|
|
3632
|
+
n.streamingActive ? (c(), u("div", xr, [
|
|
3633
|
+
o("div", Or, [
|
|
3634
|
+
z(a, {
|
|
3614
3635
|
size: 26,
|
|
3615
3636
|
tail: !0
|
|
3616
3637
|
})
|
|
@@ -3619,19 +3640,19 @@ function xr(e, t, n, r, a, s) {
|
|
|
3619
3640
|
])) : b("", !0)
|
|
3620
3641
|
], 34);
|
|
3621
3642
|
}
|
|
3622
|
-
const
|
|
3623
|
-
function
|
|
3643
|
+
const Ir = /* @__PURE__ */ E(ur, [["render", Lr], ["__scopeId", "data-v-9748afc2"]]), he = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", ve = typeof window < "u" && typeof window.MediaRecorder < "u";
|
|
3644
|
+
function Er() {
|
|
3624
3645
|
return ve && [
|
|
3625
3646
|
"video/webm;codecs=vp9,opus",
|
|
3626
3647
|
"video/webm;codecs=vp8,opus",
|
|
3627
3648
|
"video/webm",
|
|
3628
3649
|
"video/mp4"
|
|
3629
3650
|
].find((t) => {
|
|
3630
|
-
var n,
|
|
3631
|
-
return (
|
|
3651
|
+
var n, i;
|
|
3652
|
+
return (i = (n = window.MediaRecorder).isTypeSupported) == null ? void 0 : i.call(n, t);
|
|
3632
3653
|
}) || "";
|
|
3633
3654
|
}
|
|
3634
|
-
function
|
|
3655
|
+
function Re({ audio: e }) {
|
|
3635
3656
|
return {
|
|
3636
3657
|
video: !0,
|
|
3637
3658
|
audio: !!e,
|
|
@@ -3640,21 +3661,21 @@ function Be({ audio: e }) {
|
|
|
3640
3661
|
systemAudio: e ? "include" : "exclude"
|
|
3641
3662
|
};
|
|
3642
3663
|
}
|
|
3643
|
-
function
|
|
3664
|
+
function $a(e) {
|
|
3644
3665
|
return e ? e.startsWith("image/") ? "image" : e.startsWith("video/") ? "video" : "file" : "file";
|
|
3645
3666
|
}
|
|
3646
|
-
async function
|
|
3647
|
-
if (!
|
|
3667
|
+
async function Br() {
|
|
3668
|
+
if (!he) return null;
|
|
3648
3669
|
let e;
|
|
3649
3670
|
try {
|
|
3650
3671
|
e = await navigator.mediaDevices.getDisplayMedia(
|
|
3651
|
-
|
|
3672
|
+
Re({ audio: !1 })
|
|
3652
3673
|
);
|
|
3653
3674
|
} catch (t) {
|
|
3654
3675
|
return (t == null ? void 0 : t.name) !== "NotAllowedError" && console.error("[media] screenshot picker", t), null;
|
|
3655
3676
|
}
|
|
3656
3677
|
try {
|
|
3657
|
-
return await
|
|
3678
|
+
return await Rr(e);
|
|
3658
3679
|
} catch (t) {
|
|
3659
3680
|
return console.error("[media] screenshot capture", t), null;
|
|
3660
3681
|
} finally {
|
|
@@ -3663,67 +3684,67 @@ async function Er() {
|
|
|
3663
3684
|
});
|
|
3664
3685
|
}
|
|
3665
3686
|
}
|
|
3666
|
-
async function
|
|
3687
|
+
async function Rr(e) {
|
|
3667
3688
|
const t = document.createElement("video");
|
|
3668
3689
|
t.muted = !0, t.playsInline = !0, t.srcObject = e, await t.play(), await new Promise((l) => requestAnimationFrame(l));
|
|
3669
|
-
const n = t.videoWidth || 1280,
|
|
3670
|
-
|
|
3690
|
+
const n = t.videoWidth || 1280, i = t.videoHeight || 720, r = document.createElement("canvas");
|
|
3691
|
+
r.width = n, r.height = i, r.getContext("2d").drawImage(t, 0, 0, n, i);
|
|
3671
3692
|
const s = await new Promise((l, g) => {
|
|
3672
|
-
|
|
3693
|
+
r.toBlob(
|
|
3673
3694
|
(C) => C ? l(C) : g(new Error("toBlob failed")),
|
|
3674
3695
|
"image/png"
|
|
3675
3696
|
);
|
|
3676
|
-
}),
|
|
3677
|
-
return new File([s], `capture-${
|
|
3697
|
+
}), a = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
3698
|
+
return new File([s], `capture-${a}.png`, { type: "image/png" });
|
|
3678
3699
|
}
|
|
3679
|
-
async function
|
|
3700
|
+
async function Nr(e = {}) {
|
|
3680
3701
|
var C;
|
|
3681
|
-
if (!
|
|
3702
|
+
if (!he || !ve) return null;
|
|
3682
3703
|
let t;
|
|
3683
3704
|
try {
|
|
3684
3705
|
t = await navigator.mediaDevices.getDisplayMedia(
|
|
3685
|
-
|
|
3706
|
+
Re({ audio: !0 })
|
|
3686
3707
|
);
|
|
3687
3708
|
} catch (k) {
|
|
3688
3709
|
return (k == null ? void 0 : k.name) !== "NotAllowedError" && console.error("[media] record picker", k), null;
|
|
3689
3710
|
}
|
|
3690
|
-
const n =
|
|
3691
|
-
let
|
|
3711
|
+
const n = Er();
|
|
3712
|
+
let i;
|
|
3692
3713
|
try {
|
|
3693
|
-
|
|
3714
|
+
i = n ? new window.MediaRecorder(t, { mimeType: n }) : new window.MediaRecorder(t);
|
|
3694
3715
|
} catch (k) {
|
|
3695
3716
|
return console.error("[media] recorder init", k), t.getTracks().forEach((T) => {
|
|
3696
3717
|
T.stop();
|
|
3697
3718
|
}), null;
|
|
3698
3719
|
}
|
|
3699
|
-
const
|
|
3700
|
-
let s = null,
|
|
3701
|
-
|
|
3702
|
-
k.data && k.data.size > 0 &&
|
|
3703
|
-
}),
|
|
3720
|
+
const r = [];
|
|
3721
|
+
let s = null, a = !1;
|
|
3722
|
+
i.addEventListener("dataavailable", (k) => {
|
|
3723
|
+
k.data && k.data.size > 0 && r.push(k.data);
|
|
3724
|
+
}), i.addEventListener("stop", () => {
|
|
3704
3725
|
var k, T;
|
|
3705
3726
|
if (s && clearInterval(s), t.getTracks().forEach((B) => {
|
|
3706
3727
|
B.stop();
|
|
3707
|
-
}),
|
|
3708
|
-
const B =
|
|
3728
|
+
}), r.length) {
|
|
3729
|
+
const B = i.mimeType || n || "video/webm", A = new Blob(r, { type: B }), H = /mp4/.test(B) ? "mp4" : "webm", M = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), D = new File([A], `ecran-${M}.${H}`, {
|
|
3709
3730
|
type: B
|
|
3710
3731
|
});
|
|
3711
|
-
(k = e.onfinalize) == null || k.call(e,
|
|
3732
|
+
(k = e.onfinalize) == null || k.call(e, D);
|
|
3712
3733
|
} else
|
|
3713
3734
|
(T = e.oncancel) == null || T.call(e);
|
|
3714
3735
|
}), t.getVideoTracks().forEach((k) => {
|
|
3715
3736
|
k.addEventListener("ended", () => l(), { once: !0 });
|
|
3716
3737
|
});
|
|
3717
3738
|
function l() {
|
|
3718
|
-
if (!
|
|
3739
|
+
if (!a && (a = !0, i.state !== "inactive"))
|
|
3719
3740
|
try {
|
|
3720
|
-
|
|
3741
|
+
i.stop();
|
|
3721
3742
|
} catch (k) {
|
|
3722
3743
|
console.error("[media] recorder stop", k);
|
|
3723
3744
|
}
|
|
3724
3745
|
}
|
|
3725
3746
|
try {
|
|
3726
|
-
|
|
3747
|
+
i.start(1e3);
|
|
3727
3748
|
} catch (k) {
|
|
3728
3749
|
return console.error("[media] recorder start", k), t.getTracks().forEach((T) => {
|
|
3729
3750
|
T.stop();
|
|
@@ -3737,11 +3758,11 @@ async function Br(e = {}) {
|
|
|
3737
3758
|
}, 500), {
|
|
3738
3759
|
stop: l,
|
|
3739
3760
|
get state() {
|
|
3740
|
-
return
|
|
3761
|
+
return i.state;
|
|
3741
3762
|
}
|
|
3742
3763
|
};
|
|
3743
3764
|
}
|
|
3744
|
-
const
|
|
3765
|
+
const Fr = [
|
|
3745
3766
|
{
|
|
3746
3767
|
action: "file",
|
|
3747
3768
|
labelKey: "composer.attachFile",
|
|
@@ -3757,12 +3778,12 @@ const Rr = [
|
|
|
3757
3778
|
labelKey: "composer.recordScreen",
|
|
3758
3779
|
path: "M23 7l-7 5 7 5V7z M1 5a2 2 0 012-2h12a2 2 0 012 2v14a2 2 0 01-2 2H3a2 2 0 01-2-2V5z"
|
|
3759
3780
|
}
|
|
3760
|
-
],
|
|
3781
|
+
], jr = {
|
|
3761
3782
|
name: "WmComposer",
|
|
3762
3783
|
inject: {
|
|
3763
3784
|
// Translator shared by the Messenger shell; French fallback when
|
|
3764
3785
|
// the component is used standalone.
|
|
3765
|
-
t: { default: () =>
|
|
3786
|
+
t: { default: () => P() }
|
|
3766
3787
|
},
|
|
3767
3788
|
props: {
|
|
3768
3789
|
modelValue: { type: String, default: "" },
|
|
@@ -3785,10 +3806,10 @@ const Rr = [
|
|
|
3785
3806
|
return !this.disabled && !!this.local.trim();
|
|
3786
3807
|
},
|
|
3787
3808
|
attachItems() {
|
|
3788
|
-
return
|
|
3809
|
+
return Fr.map((e) => ({
|
|
3789
3810
|
...e,
|
|
3790
3811
|
label: this.t(e.labelKey),
|
|
3791
|
-
disabled: e.action === "screenshot" && !
|
|
3812
|
+
disabled: e.action === "screenshot" && !he || e.action === "record" && (!he || !ve)
|
|
3792
3813
|
}));
|
|
3793
3814
|
},
|
|
3794
3815
|
recordingElapsedLabel() {
|
|
@@ -3858,13 +3879,13 @@ const Rr = [
|
|
|
3858
3879
|
},
|
|
3859
3880
|
async captureScreenshot() {
|
|
3860
3881
|
if (this.disabled) return;
|
|
3861
|
-
const e = await
|
|
3882
|
+
const e = await Br();
|
|
3862
3883
|
e && this.$emit("attach", e);
|
|
3863
3884
|
},
|
|
3864
3885
|
async startRecording() {
|
|
3865
3886
|
if (this.recording || this.disabled) return;
|
|
3866
3887
|
this.recordingElapsed = 0;
|
|
3867
|
-
const e = await
|
|
3888
|
+
const e = await Nr({
|
|
3868
3889
|
onstart: () => {
|
|
3869
3890
|
this.recording = !0;
|
|
3870
3891
|
},
|
|
@@ -3889,92 +3910,92 @@ const Rr = [
|
|
|
3889
3910
|
}
|
|
3890
3911
|
}
|
|
3891
3912
|
}
|
|
3892
|
-
},
|
|
3913
|
+
}, Pr = { class: "wm-compose-wrap" }, Dr = {
|
|
3893
3914
|
key: 0,
|
|
3894
3915
|
class: "wm-rec"
|
|
3895
|
-
},
|
|
3916
|
+
}, Ur = { class: "wm-rec__lbl" }, $r = {
|
|
3896
3917
|
key: 1,
|
|
3897
3918
|
class: "wm-compose__menu",
|
|
3898
3919
|
role: "menu"
|
|
3899
|
-
},
|
|
3920
|
+
}, Hr = ["disabled", "onClick"], zr = { class: "wm-compose__menuIcon" }, qr = {
|
|
3900
3921
|
viewBox: "0 0 24 24",
|
|
3901
3922
|
width: "14",
|
|
3902
3923
|
height: "14",
|
|
3903
3924
|
"aria-hidden": "true"
|
|
3904
|
-
},
|
|
3905
|
-
function
|
|
3906
|
-
return c(), u("div",
|
|
3907
|
-
|
|
3925
|
+
}, Vr = ["d"], Wr = ["placeholder", "disabled"], Kr = { class: "wm-compose__actions" }, Gr = ["title", "aria-label", "disabled"], Yr = ["disabled", "aria-label"];
|
|
3926
|
+
function Qr(e, t, n, i, r, s) {
|
|
3927
|
+
return c(), u("div", Pr, [
|
|
3928
|
+
r.recording ? (c(), u("div", Dr, [
|
|
3908
3929
|
t[8] || (t[8] = o("span", {
|
|
3909
3930
|
class: "wm-rec__dot",
|
|
3910
3931
|
"aria-hidden": "true"
|
|
3911
3932
|
}, null, -1)),
|
|
3912
|
-
o("span",
|
|
3933
|
+
o("span", Ur, v(s.t("composer.recording", { time: s.recordingElapsedLabel })), 1),
|
|
3913
3934
|
o("button", {
|
|
3914
3935
|
type: "button",
|
|
3915
3936
|
class: "wm-rec__stop",
|
|
3916
|
-
onClick: t[0] || (t[0] = (...
|
|
3937
|
+
onClick: t[0] || (t[0] = (...a) => s.stopRecording && s.stopRecording(...a))
|
|
3917
3938
|
}, v(s.t("composer.stop")), 1)
|
|
3918
3939
|
])) : b("", !0),
|
|
3919
3940
|
o("form", {
|
|
3920
|
-
class: x(["wm-compose", { "has-attach":
|
|
3921
|
-
onSubmit: t[7] || (t[7] = X((...
|
|
3941
|
+
class: x(["wm-compose", { "has-attach": r.attachOpen }]),
|
|
3942
|
+
onSubmit: t[7] || (t[7] = X((...a) => s.onSubmit && s.onSubmit(...a), ["prevent"]))
|
|
3922
3943
|
}, [
|
|
3923
3944
|
o("input", {
|
|
3924
3945
|
ref: "fileEl",
|
|
3925
3946
|
type: "file",
|
|
3926
3947
|
hidden: "",
|
|
3927
3948
|
multiple: "",
|
|
3928
|
-
onChange: t[1] || (t[1] = (...
|
|
3949
|
+
onChange: t[1] || (t[1] = (...a) => s.onFile && s.onFile(...a))
|
|
3929
3950
|
}, null, 544),
|
|
3930
|
-
|
|
3951
|
+
r.attachOpen ? (c(), u("div", {
|
|
3931
3952
|
key: 0,
|
|
3932
3953
|
class: "wm-compose__overlay",
|
|
3933
|
-
onClick: t[2] || (t[2] = (
|
|
3954
|
+
onClick: t[2] || (t[2] = (a) => r.attachOpen = !1)
|
|
3934
3955
|
})) : b("", !0),
|
|
3935
|
-
|
|
3936
|
-
(c(!0), u(L, null, j(s.attachItems, (
|
|
3937
|
-
key:
|
|
3956
|
+
r.attachOpen ? (c(), u("div", $r, [
|
|
3957
|
+
(c(!0), u(L, null, j(s.attachItems, (a) => (c(), u("button", {
|
|
3958
|
+
key: a.action,
|
|
3938
3959
|
type: "button",
|
|
3939
3960
|
class: "wm-compose__menuItem",
|
|
3940
|
-
disabled:
|
|
3941
|
-
onClick: (l) => s.onAttachAction(
|
|
3961
|
+
disabled: a.disabled,
|
|
3962
|
+
onClick: (l) => s.onAttachAction(a.action)
|
|
3942
3963
|
}, [
|
|
3943
|
-
o("span",
|
|
3944
|
-
(c(), u("svg",
|
|
3964
|
+
o("span", zr, [
|
|
3965
|
+
(c(), u("svg", qr, [
|
|
3945
3966
|
o("path", {
|
|
3946
|
-
d:
|
|
3967
|
+
d: a.path,
|
|
3947
3968
|
stroke: "currentColor",
|
|
3948
3969
|
"stroke-width": "1.8",
|
|
3949
3970
|
"stroke-linecap": "round",
|
|
3950
3971
|
"stroke-linejoin": "round",
|
|
3951
3972
|
fill: "none"
|
|
3952
|
-
}, null, 8,
|
|
3973
|
+
}, null, 8, Vr)
|
|
3953
3974
|
]))
|
|
3954
3975
|
]),
|
|
3955
|
-
o("span", null, v(
|
|
3956
|
-
], 8,
|
|
3976
|
+
o("span", null, v(a.label), 1)
|
|
3977
|
+
], 8, Hr))), 128))
|
|
3957
3978
|
])) : b("", !0),
|
|
3958
3979
|
V(o("textarea", {
|
|
3959
3980
|
ref: "inputEl",
|
|
3960
|
-
"onUpdate:modelValue": t[3] || (t[3] = (
|
|
3981
|
+
"onUpdate:modelValue": t[3] || (t[3] = (a) => r.local = a),
|
|
3961
3982
|
class: "wm-compose__input",
|
|
3962
3983
|
rows: "3",
|
|
3963
3984
|
placeholder: n.placeholder,
|
|
3964
3985
|
disabled: n.disabled,
|
|
3965
|
-
onKeydown: t[4] || (t[4] = (...
|
|
3966
|
-
onInput: t[5] || (t[5] = (...
|
|
3967
|
-
}, null, 40,
|
|
3968
|
-
[Z,
|
|
3986
|
+
onKeydown: t[4] || (t[4] = (...a) => s.onKeydown && s.onKeydown(...a)),
|
|
3987
|
+
onInput: t[5] || (t[5] = (...a) => s.autosize && s.autosize(...a))
|
|
3988
|
+
}, null, 40, Wr), [
|
|
3989
|
+
[Z, r.local]
|
|
3969
3990
|
]),
|
|
3970
|
-
o("div",
|
|
3991
|
+
o("div", Kr, [
|
|
3971
3992
|
o("button", {
|
|
3972
3993
|
type: "button",
|
|
3973
|
-
class: x(["wm-compose__icon", { "is-open":
|
|
3994
|
+
class: x(["wm-compose__icon", { "is-open": r.attachOpen }]),
|
|
3974
3995
|
title: n.attachLabel,
|
|
3975
3996
|
"aria-label": n.attachLabel,
|
|
3976
|
-
disabled:
|
|
3977
|
-
onClick: t[6] || (t[6] = (
|
|
3997
|
+
disabled: r.recording,
|
|
3998
|
+
onClick: t[6] || (t[6] = (a) => r.attachOpen = !r.attachOpen)
|
|
3978
3999
|
}, [...t[9] || (t[9] = [
|
|
3979
4000
|
o("svg", {
|
|
3980
4001
|
width: "13",
|
|
@@ -3989,7 +4010,7 @@ function Gr(e, t, n, r, a, s) {
|
|
|
3989
4010
|
}, [
|
|
3990
4011
|
o("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" })
|
|
3991
4012
|
], -1)
|
|
3992
|
-
])], 10,
|
|
4013
|
+
])], 10, Gr),
|
|
3993
4014
|
o("button", {
|
|
3994
4015
|
type: "submit",
|
|
3995
4016
|
class: x(["wm-compose__send", { "is-empty": !s.canSend }]),
|
|
@@ -4009,12 +4030,12 @@ function Gr(e, t, n, r, a, s) {
|
|
|
4009
4030
|
}, [
|
|
4010
4031
|
o("path", { d: "M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" })
|
|
4011
4032
|
], -1)
|
|
4012
|
-
])], 10,
|
|
4033
|
+
])], 10, Yr)
|
|
4013
4034
|
])
|
|
4014
4035
|
], 34)
|
|
4015
4036
|
]);
|
|
4016
4037
|
}
|
|
4017
|
-
const
|
|
4038
|
+
const Xr = /* @__PURE__ */ E(jr, [["render", Qr], ["__scopeId", "data-v-aa81dbb8"]]), Jr = {
|
|
4018
4039
|
name: "WmSuggestionChips",
|
|
4019
4040
|
props: {
|
|
4020
4041
|
items: { type: Array, default: () => [] },
|
|
@@ -4031,28 +4052,28 @@ const Yr = /* @__PURE__ */ I(Nr, [["render", Gr], ["__scopeId", "data-v-aa81dbb8
|
|
|
4031
4052
|
return this.items.map((e) => (e == null ? void 0 : e.label) || (e == null ? void 0 : e.text) || "").join("§");
|
|
4032
4053
|
}
|
|
4033
4054
|
}
|
|
4034
|
-
},
|
|
4035
|
-
function
|
|
4055
|
+
}, Zr = ["onClick"];
|
|
4056
|
+
function ei(e, t, n, i, r, s) {
|
|
4036
4057
|
return n.items.length ? (c(), u("div", {
|
|
4037
4058
|
key: s.batchKey,
|
|
4038
4059
|
class: "wm-chips"
|
|
4039
4060
|
}, [
|
|
4040
|
-
(c(!0), u(L, null, j(n.items, (
|
|
4061
|
+
(c(!0), u(L, null, j(n.items, (a, l) => (c(), u("button", {
|
|
4041
4062
|
key: l,
|
|
4042
4063
|
type: "button",
|
|
4043
4064
|
class: "wm-chip",
|
|
4044
4065
|
style: W({ animationDelay: n.baseDelay + l * n.stepDelay + "ms" }),
|
|
4045
|
-
onClick: (g) => e.$emit("select",
|
|
4046
|
-
}, v(
|
|
4066
|
+
onClick: (g) => e.$emit("select", a)
|
|
4067
|
+
}, v(a.label), 13, Zr))), 128))
|
|
4047
4068
|
])) : b("", !0);
|
|
4048
4069
|
}
|
|
4049
|
-
const
|
|
4070
|
+
const ti = /* @__PURE__ */ E(Jr, [["render", ei], ["__scopeId", "data-v-47ad8085"]]), ni = {
|
|
4050
4071
|
name: "WmApprovalCard",
|
|
4051
|
-
components: { AIAvatar:
|
|
4072
|
+
components: { AIAvatar: le },
|
|
4052
4073
|
inject: {
|
|
4053
4074
|
// Translator shared by the Messenger shell; French fallback when
|
|
4054
4075
|
// the component is used standalone.
|
|
4055
|
-
t: { default: () =>
|
|
4076
|
+
t: { default: () => P() }
|
|
4056
4077
|
},
|
|
4057
4078
|
props: {
|
|
4058
4079
|
action: { type: String, required: !0 },
|
|
@@ -4088,23 +4109,23 @@ const Zr = /* @__PURE__ */ I(Qr, [["render", Jr], ["__scopeId", "data-v-47ad8085
|
|
|
4088
4109
|
return ((e = this.rejectCallback) == null ? void 0 : e.label) || this.t("approval.reject");
|
|
4089
4110
|
}
|
|
4090
4111
|
}
|
|
4091
|
-
},
|
|
4112
|
+
}, si = { class: "wm-approval" }, ri = { class: "wm-approval__head" }, ii = { class: "wm-approval__icon" }, ai = { class: "wm-approval__main" }, oi = { class: "wm-approval__title" }, li = {
|
|
4092
4113
|
key: 0,
|
|
4093
4114
|
class: "wm-approval__detail"
|
|
4094
|
-
},
|
|
4095
|
-
function
|
|
4096
|
-
const
|
|
4097
|
-
return c(), u("div",
|
|
4098
|
-
o("div",
|
|
4099
|
-
o("div",
|
|
4100
|
-
z(
|
|
4115
|
+
}, ci = { class: "wm-approval__actions" };
|
|
4116
|
+
function di(e, t, n, i, r, s) {
|
|
4117
|
+
const a = I("AIAvatar");
|
|
4118
|
+
return c(), u("div", si, [
|
|
4119
|
+
o("div", ri, [
|
|
4120
|
+
o("div", ii, [
|
|
4121
|
+
z(a, { size: 24 })
|
|
4101
4122
|
]),
|
|
4102
|
-
o("div",
|
|
4103
|
-
o("div",
|
|
4104
|
-
n.detail ? (c(), u("div",
|
|
4123
|
+
o("div", ai, [
|
|
4124
|
+
o("div", oi, v(n.action), 1),
|
|
4125
|
+
n.detail ? (c(), u("div", li, v(n.detail), 1)) : b("", !0)
|
|
4105
4126
|
])
|
|
4106
4127
|
]),
|
|
4107
|
-
o("div",
|
|
4128
|
+
o("div", ci, [
|
|
4108
4129
|
s.rejectId ? (c(), u("button", {
|
|
4109
4130
|
key: 0,
|
|
4110
4131
|
type: "button",
|
|
@@ -4120,9 +4141,9 @@ function li(e, t, n, r, a, s) {
|
|
|
4120
4141
|
])
|
|
4121
4142
|
]);
|
|
4122
4143
|
}
|
|
4123
|
-
const
|
|
4144
|
+
const ui = /* @__PURE__ */ E(ni, [["render", di], ["__scopeId", "data-v-53ddf2b2"]]);
|
|
4124
4145
|
let Me = 0;
|
|
4125
|
-
const
|
|
4146
|
+
const hi = /* @__PURE__ */ new Set([
|
|
4126
4147
|
"text",
|
|
4127
4148
|
"textarea",
|
|
4128
4149
|
"number",
|
|
@@ -4130,13 +4151,13 @@ const di = /* @__PURE__ */ new Set([
|
|
|
4130
4151
|
"select",
|
|
4131
4152
|
"multiselect",
|
|
4132
4153
|
"date"
|
|
4133
|
-
]),
|
|
4154
|
+
]), mi = {
|
|
4134
4155
|
name: "WmFormCard",
|
|
4135
|
-
components: { AIAvatar:
|
|
4156
|
+
components: { AIAvatar: le },
|
|
4136
4157
|
inject: {
|
|
4137
4158
|
// Translator shared by the Messenger shell; French fallback when
|
|
4138
4159
|
// the component is used standalone.
|
|
4139
|
-
t: { default: () =>
|
|
4160
|
+
t: { default: () => P() }
|
|
4140
4161
|
},
|
|
4141
4162
|
props: {
|
|
4142
4163
|
form: { type: Object, required: !0 },
|
|
@@ -4158,7 +4179,7 @@ const di = /* @__PURE__ */ new Set([
|
|
|
4158
4179
|
// douteux.
|
|
4159
4180
|
normalizedFields() {
|
|
4160
4181
|
var t;
|
|
4161
|
-
return (Array.isArray((t = this.form) == null ? void 0 : t.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !
|
|
4182
|
+
return (Array.isArray((t = this.form) == null ? void 0 : t.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !hi.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
|
|
4162
4183
|
}
|
|
4163
4184
|
},
|
|
4164
4185
|
created() {
|
|
@@ -4177,8 +4198,8 @@ const di = /* @__PURE__ */ new Set([
|
|
|
4177
4198
|
this.values = t, this.error = "";
|
|
4178
4199
|
},
|
|
4179
4200
|
toggleMulti(e, t, n) {
|
|
4180
|
-
const
|
|
4181
|
-
n &&
|
|
4201
|
+
const i = Array.isArray(this.values[e]) ? this.values[e].slice() : [], r = i.indexOf(t);
|
|
4202
|
+
n && r === -1 ? i.push(t) : !n && r !== -1 && i.splice(r, 1), this.values = { ...this.values, [e]: i };
|
|
4182
4203
|
},
|
|
4183
4204
|
validate() {
|
|
4184
4205
|
for (const e of this.normalizedFields) {
|
|
@@ -4211,43 +4232,43 @@ const di = /* @__PURE__ */ new Set([
|
|
|
4211
4232
|
}
|
|
4212
4233
|
}
|
|
4213
4234
|
}
|
|
4214
|
-
},
|
|
4235
|
+
}, fi = { class: "wm-form" }, _i = { class: "wm-form__head" }, pi = { class: "wm-form__icon" }, gi = { class: "wm-form__main" }, vi = { class: "wm-form__title" }, yi = {
|
|
4215
4236
|
key: 0,
|
|
4216
4237
|
class: "wm-form__detail"
|
|
4217
|
-
},
|
|
4238
|
+
}, bi = ["for"], wi = {
|
|
4218
4239
|
key: 0,
|
|
4219
4240
|
class: "wm-form__req",
|
|
4220
4241
|
"aria-hidden": "true"
|
|
4221
|
-
},
|
|
4242
|
+
}, ki = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], Ci = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], Ai = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], Si = ["id", "onUpdate:modelValue", "required", "disabled"], Mi = {
|
|
4222
4243
|
key: 4,
|
|
4223
4244
|
class: "wm-form__bool"
|
|
4224
|
-
},
|
|
4245
|
+
}, Ti = ["id", "onUpdate:modelValue", "disabled"], xi = ["id", "onUpdate:modelValue", "required", "disabled"], Oi = {
|
|
4225
4246
|
value: "",
|
|
4226
4247
|
disabled: ""
|
|
4227
|
-
},
|
|
4248
|
+
}, Li = ["value"], Ii = {
|
|
4228
4249
|
key: 6,
|
|
4229
4250
|
class: "wm-form__multi"
|
|
4230
|
-
},
|
|
4251
|
+
}, Ei = ["value", "checked", "disabled", "onChange"], Bi = {
|
|
4231
4252
|
key: 0,
|
|
4232
4253
|
class: "wm-form__err"
|
|
4233
|
-
},
|
|
4254
|
+
}, Ri = ["disabled"], Ni = {
|
|
4234
4255
|
key: 0,
|
|
4235
4256
|
class: "wm-form__spinner",
|
|
4236
4257
|
"aria-hidden": "true"
|
|
4237
|
-
},
|
|
4258
|
+
}, Fi = {
|
|
4238
4259
|
key: 2,
|
|
4239
4260
|
class: "wm-form__doneLbl"
|
|
4240
4261
|
};
|
|
4241
|
-
function
|
|
4242
|
-
const
|
|
4243
|
-
return c(), u("div",
|
|
4244
|
-
o("div",
|
|
4245
|
-
o("div",
|
|
4246
|
-
z(
|
|
4262
|
+
function ji(e, t, n, i, r, s) {
|
|
4263
|
+
const a = I("AIAvatar");
|
|
4264
|
+
return c(), u("div", fi, [
|
|
4265
|
+
o("div", _i, [
|
|
4266
|
+
o("div", pi, [
|
|
4267
|
+
z(a, { size: 24 })
|
|
4247
4268
|
]),
|
|
4248
|
-
o("div",
|
|
4249
|
-
o("div",
|
|
4250
|
-
n.form.description ? (c(), u("div",
|
|
4269
|
+
o("div", gi, [
|
|
4270
|
+
o("div", vi, v(n.form.title || s.t("form.title")), 1),
|
|
4271
|
+
n.form.description ? (c(), u("div", yi, v(n.form.description), 1)) : b("", !0)
|
|
4251
4272
|
])
|
|
4252
4273
|
]),
|
|
4253
4274
|
o("form", {
|
|
@@ -4259,86 +4280,86 @@ function Ni(e, t, n, r, a, s) {
|
|
|
4259
4280
|
class: "wm-form__field"
|
|
4260
4281
|
}, [
|
|
4261
4282
|
o("label", {
|
|
4262
|
-
for: `wm-f-${
|
|
4283
|
+
for: `wm-f-${r._uid}-${l.key}`,
|
|
4263
4284
|
class: "wm-form__label"
|
|
4264
4285
|
}, [
|
|
4265
4286
|
pe(v(l.label), 1),
|
|
4266
|
-
l.required ? (c(), u("span",
|
|
4267
|
-
], 8,
|
|
4287
|
+
l.required ? (c(), u("span", wi, "*")) : b("", !0)
|
|
4288
|
+
], 8, bi),
|
|
4268
4289
|
l.type === "text" ? V((c(), u("input", {
|
|
4269
4290
|
key: 0,
|
|
4270
|
-
id: `wm-f-${
|
|
4271
|
-
"onUpdate:modelValue": (g) =>
|
|
4291
|
+
id: `wm-f-${r._uid}-${l.key}`,
|
|
4292
|
+
"onUpdate:modelValue": (g) => r.values[l.key] = g,
|
|
4272
4293
|
type: "text",
|
|
4273
4294
|
class: "wm-form__input",
|
|
4274
4295
|
placeholder: l.placeholder || "",
|
|
4275
4296
|
required: l.required,
|
|
4276
|
-
disabled: n.readOnly ||
|
|
4277
|
-
}, null, 8,
|
|
4278
|
-
[Z,
|
|
4297
|
+
disabled: n.readOnly || r.busy
|
|
4298
|
+
}, null, 8, ki)), [
|
|
4299
|
+
[Z, r.values[l.key]]
|
|
4279
4300
|
]) : l.type === "textarea" ? V((c(), u("textarea", {
|
|
4280
4301
|
key: 1,
|
|
4281
|
-
id: `wm-f-${
|
|
4282
|
-
"onUpdate:modelValue": (g) =>
|
|
4302
|
+
id: `wm-f-${r._uid}-${l.key}`,
|
|
4303
|
+
"onUpdate:modelValue": (g) => r.values[l.key] = g,
|
|
4283
4304
|
class: "wm-form__textarea",
|
|
4284
4305
|
rows: "3",
|
|
4285
4306
|
placeholder: l.placeholder || "",
|
|
4286
4307
|
required: l.required,
|
|
4287
|
-
disabled: n.readOnly ||
|
|
4288
|
-
}, null, 8,
|
|
4289
|
-
[Z,
|
|
4308
|
+
disabled: n.readOnly || r.busy
|
|
4309
|
+
}, null, 8, Ci)), [
|
|
4310
|
+
[Z, r.values[l.key]]
|
|
4290
4311
|
]) : l.type === "number" ? V((c(), u("input", {
|
|
4291
4312
|
key: 2,
|
|
4292
|
-
id: `wm-f-${
|
|
4293
|
-
"onUpdate:modelValue": (g) =>
|
|
4313
|
+
id: `wm-f-${r._uid}-${l.key}`,
|
|
4314
|
+
"onUpdate:modelValue": (g) => r.values[l.key] = g,
|
|
4294
4315
|
type: "number",
|
|
4295
4316
|
class: "wm-form__input",
|
|
4296
4317
|
placeholder: l.placeholder || "",
|
|
4297
4318
|
required: l.required,
|
|
4298
|
-
disabled: n.readOnly ||
|
|
4299
|
-
}, null, 8,
|
|
4319
|
+
disabled: n.readOnly || r.busy
|
|
4320
|
+
}, null, 8, Ai)), [
|
|
4300
4321
|
[
|
|
4301
4322
|
Z,
|
|
4302
|
-
|
|
4323
|
+
r.values[l.key],
|
|
4303
4324
|
void 0,
|
|
4304
4325
|
{ number: !0 }
|
|
4305
4326
|
]
|
|
4306
4327
|
]) : l.type === "date" ? V((c(), u("input", {
|
|
4307
4328
|
key: 3,
|
|
4308
|
-
id: `wm-f-${
|
|
4309
|
-
"onUpdate:modelValue": (g) =>
|
|
4329
|
+
id: `wm-f-${r._uid}-${l.key}`,
|
|
4330
|
+
"onUpdate:modelValue": (g) => r.values[l.key] = g,
|
|
4310
4331
|
type: "date",
|
|
4311
4332
|
class: "wm-form__input",
|
|
4312
4333
|
required: l.required,
|
|
4313
|
-
disabled: n.readOnly ||
|
|
4314
|
-
}, null, 8,
|
|
4315
|
-
[Z,
|
|
4316
|
-
]) : l.type === "boolean" ? (c(), u("label",
|
|
4334
|
+
disabled: n.readOnly || r.busy
|
|
4335
|
+
}, null, 8, Si)), [
|
|
4336
|
+
[Z, r.values[l.key]]
|
|
4337
|
+
]) : l.type === "boolean" ? (c(), u("label", Mi, [
|
|
4317
4338
|
V(o("input", {
|
|
4318
|
-
id: `wm-f-${
|
|
4319
|
-
"onUpdate:modelValue": (g) =>
|
|
4339
|
+
id: `wm-f-${r._uid}-${l.key}`,
|
|
4340
|
+
"onUpdate:modelValue": (g) => r.values[l.key] = g,
|
|
4320
4341
|
type: "checkbox",
|
|
4321
|
-
disabled: n.readOnly ||
|
|
4322
|
-
}, null, 8,
|
|
4323
|
-
[
|
|
4342
|
+
disabled: n.readOnly || r.busy
|
|
4343
|
+
}, null, 8, Ti), [
|
|
4344
|
+
[$e, r.values[l.key]]
|
|
4324
4345
|
]),
|
|
4325
4346
|
o("span", null, v(l.placeholder || s.t("common.yes")), 1)
|
|
4326
4347
|
])) : l.type === "select" ? V((c(), u("select", {
|
|
4327
4348
|
key: 5,
|
|
4328
|
-
id: `wm-f-${
|
|
4329
|
-
"onUpdate:modelValue": (g) =>
|
|
4349
|
+
id: `wm-f-${r._uid}-${l.key}`,
|
|
4350
|
+
"onUpdate:modelValue": (g) => r.values[l.key] = g,
|
|
4330
4351
|
class: "wm-form__select",
|
|
4331
4352
|
required: l.required,
|
|
4332
|
-
disabled: n.readOnly ||
|
|
4353
|
+
disabled: n.readOnly || r.busy
|
|
4333
4354
|
}, [
|
|
4334
|
-
o("option",
|
|
4355
|
+
o("option", Oi, v(l.placeholder || s.t("form.choose")), 1),
|
|
4335
4356
|
(c(!0), u(L, null, j(l.options, (g) => (c(), u("option", {
|
|
4336
4357
|
key: g.value,
|
|
4337
4358
|
value: g.value
|
|
4338
|
-
}, v(g.label), 9,
|
|
4339
|
-
], 8,
|
|
4340
|
-
[
|
|
4341
|
-
]) : l.type === "multiselect" ? (c(), u("div",
|
|
4359
|
+
}, v(g.label), 9, Li))), 128))
|
|
4360
|
+
], 8, xi)), [
|
|
4361
|
+
[He, r.values[l.key]]
|
|
4362
|
+
]) : l.type === "multiselect" ? (c(), u("div", Ii, [
|
|
4342
4363
|
(c(!0), u(L, null, j(l.options, (g) => (c(), u("label", {
|
|
4343
4364
|
key: g.value,
|
|
4344
4365
|
class: "wm-form__multiItem"
|
|
@@ -4346,37 +4367,37 @@ function Ni(e, t, n, r, a, s) {
|
|
|
4346
4367
|
o("input", {
|
|
4347
4368
|
type: "checkbox",
|
|
4348
4369
|
value: g.value,
|
|
4349
|
-
checked: Array.isArray(
|
|
4350
|
-
disabled: n.readOnly ||
|
|
4370
|
+
checked: Array.isArray(r.values[l.key]) && r.values[l.key].includes(g.value),
|
|
4371
|
+
disabled: n.readOnly || r.busy,
|
|
4351
4372
|
onChange: (C) => s.toggleMulti(
|
|
4352
4373
|
l.key,
|
|
4353
4374
|
g.value,
|
|
4354
4375
|
C.target.checked
|
|
4355
4376
|
)
|
|
4356
|
-
}, null, 40,
|
|
4377
|
+
}, null, 40, Ei),
|
|
4357
4378
|
o("span", null, v(g.label), 1)
|
|
4358
4379
|
]))), 128))
|
|
4359
4380
|
])) : b("", !0)
|
|
4360
4381
|
]))), 128)),
|
|
4361
|
-
|
|
4362
|
-
n.readOnly ? (c(), u("div",
|
|
4382
|
+
r.error ? (c(), u("div", Bi, v(r.error), 1)) : b("", !0),
|
|
4383
|
+
n.readOnly ? (c(), u("div", Fi, v(s.t("form.responseSent")), 1)) : (c(), u("button", {
|
|
4363
4384
|
key: 1,
|
|
4364
4385
|
type: "submit",
|
|
4365
4386
|
class: "wm-form__submit",
|
|
4366
|
-
disabled:
|
|
4387
|
+
disabled: r.busy
|
|
4367
4388
|
}, [
|
|
4368
|
-
|
|
4369
|
-
o("span", null, v(
|
|
4370
|
-
], 8,
|
|
4389
|
+
r.busy ? (c(), u("span", Ni)) : b("", !0),
|
|
4390
|
+
o("span", null, v(r.busy ? s.t("common.sending") : n.form.submit_label || s.t("common.send")), 1)
|
|
4391
|
+
], 8, Ri))
|
|
4371
4392
|
], 32)
|
|
4372
4393
|
]);
|
|
4373
4394
|
}
|
|
4374
|
-
const
|
|
4395
|
+
const Pi = /* @__PURE__ */ E(mi, [["render", ji], ["__scopeId", "data-v-75332dad"]]), Di = {
|
|
4375
4396
|
name: "WmFeedback",
|
|
4376
4397
|
inject: {
|
|
4377
4398
|
// Translator shared by the Messenger shell; French fallback when
|
|
4378
4399
|
// the component is used standalone.
|
|
4379
|
-
t: { default: () =>
|
|
4400
|
+
t: { default: () => P() }
|
|
4380
4401
|
},
|
|
4381
4402
|
props: {
|
|
4382
4403
|
busy: { type: Boolean, default: !1 },
|
|
@@ -4405,13 +4426,13 @@ const Fi = /* @__PURE__ */ I(ui, [["render", Ni], ["__scopeId", "data-v-75332dad
|
|
|
4405
4426
|
!this.sel || this.busy || this.$emit("submit", { rating: this.sel });
|
|
4406
4427
|
}
|
|
4407
4428
|
}
|
|
4408
|
-
},
|
|
4429
|
+
}, Ui = { class: "wm-fb" }, $i = { class: "wm-fb__title" }, Hi = { class: "wm-fb__sub" }, zi = { class: "wm-fb__row" }, qi = ["onClick"], Vi = { class: "wm-fb__emoji" }, Wi = { class: "wm-fb__label" }, Ki = ["disabled"], Gi = {
|
|
4409
4430
|
key: 1,
|
|
4410
4431
|
class: "wm-fb__done"
|
|
4411
|
-
},
|
|
4412
|
-
function
|
|
4413
|
-
return c(), u("div",
|
|
4414
|
-
n.done ? (c(), u("div",
|
|
4432
|
+
}, Yi = { class: "wm-fb__doneTitle" }, Qi = { class: "wm-fb__doneSub" };
|
|
4433
|
+
function Xi(e, t, n, i, r, s) {
|
|
4434
|
+
return c(), u("div", Ui, [
|
|
4435
|
+
n.done ? (c(), u("div", Gi, [
|
|
4415
4436
|
t[1] || (t[1] = o("div", { class: "wm-fb__check" }, [
|
|
4416
4437
|
o("svg", {
|
|
4417
4438
|
width: "16",
|
|
@@ -4427,37 +4448,37 @@ function Yi(e, t, n, r, a, s) {
|
|
|
4427
4448
|
o("path", { d: "M20 6L9 17l-5-5" })
|
|
4428
4449
|
])
|
|
4429
4450
|
], -1)),
|
|
4430
|
-
o("div",
|
|
4431
|
-
o("div",
|
|
4451
|
+
o("div", Yi, v(s.t("feedback.doneTitle")), 1),
|
|
4452
|
+
o("div", Qi, v(s.t("feedback.doneSubtitle")), 1)
|
|
4432
4453
|
])) : (c(), u(L, { key: 0 }, [
|
|
4433
|
-
o("div",
|
|
4434
|
-
o("div",
|
|
4435
|
-
o("div",
|
|
4436
|
-
(c(!0), u(L, null, j(s.options, (
|
|
4437
|
-
key:
|
|
4454
|
+
o("div", $i, v(s.t("feedback.question")), 1),
|
|
4455
|
+
o("div", Hi, v(s.t("feedback.subtitle")), 1),
|
|
4456
|
+
o("div", zi, [
|
|
4457
|
+
(c(!0), u(L, null, j(s.options, (a) => (c(), u("button", {
|
|
4458
|
+
key: a.v,
|
|
4438
4459
|
type: "button",
|
|
4439
|
-
class: x(["wm-fb__opt", { "is-selected":
|
|
4440
|
-
onClick: (l) =>
|
|
4460
|
+
class: x(["wm-fb__opt", { "is-selected": r.sel === a.v }]),
|
|
4461
|
+
onClick: (l) => r.sel = a.v
|
|
4441
4462
|
}, [
|
|
4442
|
-
o("span",
|
|
4443
|
-
o("span",
|
|
4444
|
-
], 10,
|
|
4463
|
+
o("span", Vi, v(a.e), 1),
|
|
4464
|
+
o("span", Wi, v(a.l), 1)
|
|
4465
|
+
], 10, qi))), 128))
|
|
4445
4466
|
]),
|
|
4446
4467
|
o("button", {
|
|
4447
4468
|
type: "button",
|
|
4448
4469
|
class: "wm-fb__send",
|
|
4449
|
-
disabled: !
|
|
4450
|
-
onClick: t[0] || (t[0] = (...
|
|
4451
|
-
}, v(n.busy ? s.t("common.sending") : s.t("feedback.submit")), 9,
|
|
4470
|
+
disabled: !r.sel || n.busy,
|
|
4471
|
+
onClick: t[0] || (t[0] = (...a) => s.onSend && s.onSend(...a))
|
|
4472
|
+
}, v(n.busy ? s.t("common.sending") : s.t("feedback.submit")), 9, Ki)
|
|
4452
4473
|
], 64))
|
|
4453
4474
|
]);
|
|
4454
4475
|
}
|
|
4455
|
-
const
|
|
4476
|
+
const Ji = /* @__PURE__ */ E(Di, [["render", Xi], ["__scopeId", "data-v-9b630564"]]), Zi = {
|
|
4456
4477
|
name: "WmMoreMenu",
|
|
4457
4478
|
inject: {
|
|
4458
4479
|
// Translator shared by the Messenger shell; French fallback when
|
|
4459
4480
|
// the component is used standalone.
|
|
4460
|
-
t: { default: () =>
|
|
4481
|
+
t: { default: () => P() }
|
|
4461
4482
|
},
|
|
4462
4483
|
props: {
|
|
4463
4484
|
canRename: { type: Boolean, default: !0 },
|
|
@@ -4495,29 +4516,29 @@ const Qi = /* @__PURE__ */ I(ji, [["render", Yi], ["__scopeId", "data-v-9b630564
|
|
|
4495
4516
|
this.browserNotifOn = !this.browserNotifOn, this.$emit("browser-notif-toggle", this.browserNotifOn);
|
|
4496
4517
|
}
|
|
4497
4518
|
}
|
|
4498
|
-
},
|
|
4519
|
+
}, ea = { class: "wm-mm" }, ta = {
|
|
4499
4520
|
class: "wm-mm__pop",
|
|
4500
4521
|
role: "menu"
|
|
4501
|
-
},
|
|
4522
|
+
}, na = {
|
|
4502
4523
|
key: 0,
|
|
4503
4524
|
class: "wm-mm__section"
|
|
4504
|
-
},
|
|
4525
|
+
}, sa = { class: "wm-mm__label" }, ra = { class: "wm-mm__label" }, ia = {
|
|
4505
4526
|
key: 1,
|
|
4506
4527
|
class: "wm-mm__sep"
|
|
4507
|
-
},
|
|
4508
|
-
function
|
|
4509
|
-
return c(), u("div",
|
|
4528
|
+
}, aa = { class: "wm-mm__section" }, oa = { class: "wm-mm__label" }, la = { class: "wm-mm__label" }, ca = { class: "wm-mm__section" }, da = { class: "wm-mm__label" }, ua = { class: "wm-mm__label" };
|
|
4529
|
+
function ha(e, t, n, i, r, s) {
|
|
4530
|
+
return c(), u("div", ea, [
|
|
4510
4531
|
o("div", {
|
|
4511
4532
|
class: "wm-mm__scrim",
|
|
4512
|
-
onClick: t[0] || (t[0] = (
|
|
4533
|
+
onClick: t[0] || (t[0] = (a) => e.$emit("close"))
|
|
4513
4534
|
}),
|
|
4514
|
-
o("div",
|
|
4515
|
-
n.canRename || n.canExport ? (c(), u("div",
|
|
4535
|
+
o("div", ta, [
|
|
4536
|
+
n.canRename || n.canExport ? (c(), u("div", na, [
|
|
4516
4537
|
n.canRename ? (c(), u("button", {
|
|
4517
4538
|
key: 0,
|
|
4518
4539
|
type: "button",
|
|
4519
4540
|
class: "wm-mm__item",
|
|
4520
|
-
onClick: t[1] || (t[1] = (
|
|
4541
|
+
onClick: t[1] || (t[1] = (a) => s.emit("rename"))
|
|
4521
4542
|
}, [
|
|
4522
4543
|
t[7] || (t[7] = o("span", { class: "wm-mm__icon" }, [
|
|
4523
4544
|
o("svg", {
|
|
@@ -4535,13 +4556,13 @@ function da(e, t, n, r, a, s) {
|
|
|
4535
4556
|
o("path", { d: "M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z" })
|
|
4536
4557
|
])
|
|
4537
4558
|
], -1)),
|
|
4538
|
-
o("span",
|
|
4559
|
+
o("span", sa, v(s.t("moreMenu.editTitle")), 1)
|
|
4539
4560
|
])) : b("", !0),
|
|
4540
4561
|
n.canExport ? (c(), u("button", {
|
|
4541
4562
|
key: 1,
|
|
4542
4563
|
type: "button",
|
|
4543
4564
|
class: "wm-mm__item",
|
|
4544
|
-
onClick: t[2] || (t[2] = (
|
|
4565
|
+
onClick: t[2] || (t[2] = (a) => s.emit("export"))
|
|
4545
4566
|
}, [
|
|
4546
4567
|
t[8] || (t[8] = o("span", { class: "wm-mm__icon" }, [
|
|
4547
4568
|
o("svg", {
|
|
@@ -4558,16 +4579,16 @@ function da(e, t, n, r, a, s) {
|
|
|
4558
4579
|
o("path", { d: "M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" })
|
|
4559
4580
|
])
|
|
4560
4581
|
], -1)),
|
|
4561
|
-
o("span",
|
|
4582
|
+
o("span", ra, v(s.t("moreMenu.exportTranscript")), 1),
|
|
4562
4583
|
t[9] || (t[9] = o("span", { class: "wm-mm__hint" }, ".txt", -1))
|
|
4563
4584
|
])) : b("", !0)
|
|
4564
4585
|
])) : b("", !0),
|
|
4565
|
-
n.canRename || n.canExport ? (c(), u("div",
|
|
4566
|
-
o("div",
|
|
4586
|
+
n.canRename || n.canExport ? (c(), u("div", ia)) : b("", !0),
|
|
4587
|
+
o("div", aa, [
|
|
4567
4588
|
o("button", {
|
|
4568
4589
|
type: "button",
|
|
4569
4590
|
class: "wm-mm__item",
|
|
4570
|
-
onClick: t[3] || (t[3] = (...
|
|
4591
|
+
onClick: t[3] || (t[3] = (...a) => s.toggleSound && s.toggleSound(...a))
|
|
4571
4592
|
}, [
|
|
4572
4593
|
t[11] || (t[11] = o("span", { class: "wm-mm__icon" }, [
|
|
4573
4594
|
o("svg", {
|
|
@@ -4585,9 +4606,9 @@ function da(e, t, n, r, a, s) {
|
|
|
4585
4606
|
o("path", { d: "M15.54 8.46a5 5 0 010 7.07M19.07 4.93a10 10 0 010 14.14" })
|
|
4586
4607
|
])
|
|
4587
4608
|
], -1)),
|
|
4588
|
-
o("span",
|
|
4609
|
+
o("span", oa, v(s.t("moreMenu.sound")), 1),
|
|
4589
4610
|
o("span", {
|
|
4590
|
-
class: x(["wm-mm__toggle", { "wm-mm__toggle--on":
|
|
4611
|
+
class: x(["wm-mm__toggle", { "wm-mm__toggle--on": r.soundOn }])
|
|
4591
4612
|
}, [...t[10] || (t[10] = [
|
|
4592
4613
|
o("span", { class: "wm-mm__knob" }, null, -1)
|
|
4593
4614
|
])], 2)
|
|
@@ -4595,7 +4616,7 @@ function da(e, t, n, r, a, s) {
|
|
|
4595
4616
|
o("button", {
|
|
4596
4617
|
type: "button",
|
|
4597
4618
|
class: "wm-mm__item",
|
|
4598
|
-
onClick: t[4] || (t[4] = (...
|
|
4619
|
+
onClick: t[4] || (t[4] = (...a) => s.toggleBrowserNotif && s.toggleBrowserNotif(...a))
|
|
4599
4620
|
}, [
|
|
4600
4621
|
t[13] || (t[13] = o("span", { class: "wm-mm__icon" }, [
|
|
4601
4622
|
o("svg", {
|
|
@@ -4612,21 +4633,21 @@ function da(e, t, n, r, a, s) {
|
|
|
4612
4633
|
o("path", { d: "M15 17h5l-1.4-1.4A2 2 0 0118 14.2V11a6 6 0 10-12 0v3.2c0 .5-.2 1-.6 1.4L4 17h5m6 0a3 3 0 11-6 0" })
|
|
4613
4634
|
])
|
|
4614
4635
|
], -1)),
|
|
4615
|
-
o("span",
|
|
4636
|
+
o("span", la, v(s.t("moreMenu.browserNotifications")), 1),
|
|
4616
4637
|
o("span", {
|
|
4617
|
-
class: x(["wm-mm__toggle", { "wm-mm__toggle--on":
|
|
4638
|
+
class: x(["wm-mm__toggle", { "wm-mm__toggle--on": r.browserNotifOn }])
|
|
4618
4639
|
}, [...t[12] || (t[12] = [
|
|
4619
4640
|
o("span", { class: "wm-mm__knob" }, null, -1)
|
|
4620
4641
|
])], 2)
|
|
4621
4642
|
])
|
|
4622
4643
|
]),
|
|
4623
4644
|
t[16] || (t[16] = o("div", { class: "wm-mm__sep" }, null, -1)),
|
|
4624
|
-
o("div",
|
|
4645
|
+
o("div", ca, [
|
|
4625
4646
|
n.statusUrl ? (c(), u("button", {
|
|
4626
4647
|
key: 0,
|
|
4627
4648
|
type: "button",
|
|
4628
4649
|
class: "wm-mm__item",
|
|
4629
|
-
onClick: t[5] || (t[5] = (
|
|
4650
|
+
onClick: t[5] || (t[5] = (a) => s.emit("status"))
|
|
4630
4651
|
}, [
|
|
4631
4652
|
t[14] || (t[14] = o("span", { class: "wm-mm__icon" }, [
|
|
4632
4653
|
o("svg", {
|
|
@@ -4643,13 +4664,13 @@ function da(e, t, n, r, a, s) {
|
|
|
4643
4664
|
o("path", { d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zM10 6v4l3 2" })
|
|
4644
4665
|
])
|
|
4645
4666
|
], -1)),
|
|
4646
|
-
o("span",
|
|
4667
|
+
o("span", da, v(s.t("moreMenu.serviceStatus")), 1)
|
|
4647
4668
|
])) : b("", !0),
|
|
4648
4669
|
n.helpUrl ? (c(), u("button", {
|
|
4649
4670
|
key: 1,
|
|
4650
4671
|
type: "button",
|
|
4651
4672
|
class: "wm-mm__item",
|
|
4652
|
-
onClick: t[6] || (t[6] = (
|
|
4673
|
+
onClick: t[6] || (t[6] = (a) => s.emit("help"))
|
|
4653
4674
|
}, [
|
|
4654
4675
|
t[15] || (t[15] = o("span", { class: "wm-mm__icon" }, [
|
|
4655
4676
|
o("svg", {
|
|
@@ -4666,18 +4687,18 @@ function da(e, t, n, r, a, s) {
|
|
|
4666
4687
|
o("path", { d: "M9 11a3 3 0 116 0c0 2-3 2-3 5M12 19h.01M12 22a10 10 0 110-20 10 10 0 010 20z" })
|
|
4667
4688
|
])
|
|
4668
4689
|
], -1)),
|
|
4669
|
-
o("span",
|
|
4690
|
+
o("span", ua, v(s.t("moreMenu.helpCenter")), 1)
|
|
4670
4691
|
])) : b("", !0)
|
|
4671
4692
|
])
|
|
4672
4693
|
])
|
|
4673
4694
|
]);
|
|
4674
4695
|
}
|
|
4675
|
-
const
|
|
4696
|
+
const ma = /* @__PURE__ */ E(Zi, [["render", ha], ["__scopeId", "data-v-76281e95"]]), fa = {
|
|
4676
4697
|
name: "WmRenameDialog",
|
|
4677
4698
|
inject: {
|
|
4678
4699
|
// Translator shared by the Messenger shell; French fallback when
|
|
4679
4700
|
// the component is used standalone.
|
|
4680
|
-
t: { default: () =>
|
|
4701
|
+
t: { default: () => P() }
|
|
4681
4702
|
},
|
|
4682
4703
|
props: {
|
|
4683
4704
|
// Empty defaults: the resolved fallback comes from the translator
|
|
@@ -4714,25 +4735,25 @@ const ua = /* @__PURE__ */ I(Xi, [["render", da], ["__scopeId", "data-v-76281e95
|
|
|
4714
4735
|
this.canSubmit && this.$emit("submit", this.value.trim());
|
|
4715
4736
|
}
|
|
4716
4737
|
}
|
|
4717
|
-
},
|
|
4738
|
+
}, _a = { class: "wm-dialog" }, pa = {
|
|
4718
4739
|
class: "wm-dialog__card",
|
|
4719
4740
|
role: "dialog",
|
|
4720
4741
|
"aria-modal": "true"
|
|
4721
|
-
},
|
|
4722
|
-
function
|
|
4723
|
-
return c(), u("div",
|
|
4742
|
+
}, ga = { class: "wm-dialog__head" }, va = { class: "wm-dialog__title" }, ya = ["aria-label"], ba = { class: "wm-dialog__body" }, wa = ["placeholder"], ka = { class: "wm-dialog__actions" }, Ca = ["disabled"];
|
|
4743
|
+
function Aa(e, t, n, i, r, s) {
|
|
4744
|
+
return c(), u("div", _a, [
|
|
4724
4745
|
o("div", {
|
|
4725
4746
|
class: "wm-dialog__scrim",
|
|
4726
|
-
onClick: t[0] || (t[0] = (
|
|
4747
|
+
onClick: t[0] || (t[0] = (a) => e.$emit("close"))
|
|
4727
4748
|
}),
|
|
4728
|
-
o("div",
|
|
4729
|
-
o("div",
|
|
4730
|
-
o("div",
|
|
4749
|
+
o("div", pa, [
|
|
4750
|
+
o("div", ga, [
|
|
4751
|
+
o("div", va, v(n.title || s.t("rename.title")), 1),
|
|
4731
4752
|
o("button", {
|
|
4732
4753
|
type: "button",
|
|
4733
4754
|
class: "wm-dialog__close",
|
|
4734
4755
|
"aria-label": s.t("common.close"),
|
|
4735
|
-
onClick: t[1] || (t[1] = (
|
|
4756
|
+
onClick: t[1] || (t[1] = (a) => e.$emit("close"))
|
|
4736
4757
|
}, [...t[7] || (t[7] = [
|
|
4737
4758
|
o("svg", {
|
|
4738
4759
|
width: "12",
|
|
@@ -4747,60 +4768,60 @@ function ka(e, t, n, r, a, s) {
|
|
|
4747
4768
|
}, [
|
|
4748
4769
|
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
4749
4770
|
], -1)
|
|
4750
|
-
])], 8,
|
|
4771
|
+
])], 8, ya)
|
|
4751
4772
|
]),
|
|
4752
|
-
o("div",
|
|
4773
|
+
o("div", ba, [
|
|
4753
4774
|
V(o("input", {
|
|
4754
4775
|
ref: "input",
|
|
4755
|
-
"onUpdate:modelValue": t[2] || (t[2] = (
|
|
4776
|
+
"onUpdate:modelValue": t[2] || (t[2] = (a) => r.value = a),
|
|
4756
4777
|
type: "text",
|
|
4757
4778
|
class: "wm-dialog__input",
|
|
4758
4779
|
placeholder: n.placeholder || s.t("rename.placeholder"),
|
|
4759
4780
|
maxlength: 120,
|
|
4760
4781
|
onKeydown: [
|
|
4761
|
-
t[3] || (t[3] = ue(X((...
|
|
4762
|
-
t[4] || (t[4] = ue(X((
|
|
4782
|
+
t[3] || (t[3] = ue(X((...a) => s.onSubmit && s.onSubmit(...a), ["prevent"]), ["enter"])),
|
|
4783
|
+
t[4] || (t[4] = ue(X((a) => e.$emit("close"), ["prevent"]), ["esc"]))
|
|
4763
4784
|
]
|
|
4764
|
-
}, null, 40,
|
|
4765
|
-
[Z,
|
|
4785
|
+
}, null, 40, wa), [
|
|
4786
|
+
[Z, r.value]
|
|
4766
4787
|
])
|
|
4767
4788
|
]),
|
|
4768
|
-
o("div",
|
|
4789
|
+
o("div", ka, [
|
|
4769
4790
|
o("button", {
|
|
4770
4791
|
type: "button",
|
|
4771
4792
|
class: "wm-dialog__btn",
|
|
4772
|
-
onClick: t[5] || (t[5] = (
|
|
4793
|
+
onClick: t[5] || (t[5] = (a) => e.$emit("close"))
|
|
4773
4794
|
}, v(s.t("common.cancel")), 1),
|
|
4774
4795
|
o("button", {
|
|
4775
4796
|
type: "button",
|
|
4776
4797
|
class: "wm-dialog__btn wm-dialog__btn--primary",
|
|
4777
4798
|
disabled: !s.canSubmit,
|
|
4778
|
-
onClick: t[6] || (t[6] = (...
|
|
4779
|
-
}, v(s.t("common.save")), 9,
|
|
4799
|
+
onClick: t[6] || (t[6] = (...a) => s.onSubmit && s.onSubmit(...a))
|
|
4800
|
+
}, v(s.t("common.save")), 9, Ca)
|
|
4780
4801
|
])
|
|
4781
4802
|
])
|
|
4782
4803
|
]);
|
|
4783
4804
|
}
|
|
4784
|
-
const
|
|
4805
|
+
const Sa = /* @__PURE__ */ E(fa, [["render", Aa], ["__scopeId", "data-v-6d5f94a8"]]), Te = "ww-messenger-tokens", Ma = {
|
|
4785
4806
|
name: "Messenger",
|
|
4786
4807
|
components: {
|
|
4787
|
-
Launcher:
|
|
4788
|
-
Header:
|
|
4789
|
-
Onboarding:
|
|
4790
|
-
MessageList:
|
|
4791
|
-
Composer:
|
|
4792
|
-
SuggestionChips:
|
|
4793
|
-
ApprovalCard:
|
|
4794
|
-
FormCard:
|
|
4795
|
-
Feedback:
|
|
4796
|
-
MoreMenu:
|
|
4797
|
-
RenameDialog:
|
|
4808
|
+
Launcher: jt,
|
|
4809
|
+
Header: ln,
|
|
4810
|
+
Onboarding: Hn,
|
|
4811
|
+
MessageList: Ir,
|
|
4812
|
+
Composer: Xr,
|
|
4813
|
+
SuggestionChips: ti,
|
|
4814
|
+
ApprovalCard: ui,
|
|
4815
|
+
FormCard: Pi,
|
|
4816
|
+
Feedback: Ji,
|
|
4817
|
+
MoreMenu: ma,
|
|
4818
|
+
RenameDialog: Sa
|
|
4798
4819
|
},
|
|
4799
4820
|
mixins: [
|
|
4800
|
-
|
|
4821
|
+
ot,
|
|
4801
4822
|
mt,
|
|
4802
|
-
|
|
4803
|
-
|
|
4823
|
+
ft,
|
|
4824
|
+
pt
|
|
4804
4825
|
],
|
|
4805
4826
|
// Make signAttachment available to deep children (AttachmentPreview)
|
|
4806
4827
|
// without prop drilling. The store may not exist yet at provide-time
|
|
@@ -4822,7 +4843,7 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
4822
4843
|
},
|
|
4823
4844
|
props: {
|
|
4824
4845
|
// Hardcoded server default (overridable for staging/dev).
|
|
4825
|
-
baseUrl: { type: String, default:
|
|
4846
|
+
baseUrl: { type: String, default: Ze },
|
|
4826
4847
|
widgetId: { type: String, default: "" },
|
|
4827
4848
|
userId: { type: String, default: "" },
|
|
4828
4849
|
userHash: { type: String, default: "" },
|
|
@@ -4904,9 +4925,9 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
4904
4925
|
// so the choice applies immediately, before the boot round-trip
|
|
4905
4926
|
// that materializes `state.customer` has completed.
|
|
4906
4927
|
customerLanguage() {
|
|
4907
|
-
var n,
|
|
4908
|
-
const e = (n = this.s) == null ? void 0 : n.customer, t = e && (e.language || ((
|
|
4909
|
-
return t || ((s = (
|
|
4928
|
+
var n, i, r, s;
|
|
4929
|
+
const e = (n = this.s) == null ? void 0 : n.customer, t = e && (e.language || ((i = e.values) == null ? void 0 : i.language));
|
|
4930
|
+
return t || ((s = (r = this.context) == null ? void 0 : r.customer) == null ? void 0 : s.language) || "";
|
|
4910
4931
|
},
|
|
4911
4932
|
// Resolved UI language, by priority:
|
|
4912
4933
|
// 1. explicit `language` prop (consumer override)
|
|
@@ -4923,7 +4944,7 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
4923
4944
|
// `locale` changes. `t()` below (and the provided closure) delegate
|
|
4924
4945
|
// to it so every string resolves against the current language.
|
|
4925
4946
|
translator() {
|
|
4926
|
-
return
|
|
4947
|
+
return P(this.locale);
|
|
4927
4948
|
},
|
|
4928
4949
|
error() {
|
|
4929
4950
|
var e;
|
|
@@ -4953,28 +4974,28 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
4953
4974
|
drawerConversations() {
|
|
4954
4975
|
var n;
|
|
4955
4976
|
const e = ((n = this.s) == null ? void 0 : n.messagesByConv) || {}, t = this.revealedAt;
|
|
4956
|
-
return this.allConversations.map((
|
|
4977
|
+
return this.allConversations.map((i) => {
|
|
4957
4978
|
var C;
|
|
4958
|
-
const
|
|
4959
|
-
let
|
|
4960
|
-
for (let k =
|
|
4961
|
-
const T =
|
|
4979
|
+
const r = e[i.id] || [], s = J(i.last_read_message_id);
|
|
4980
|
+
let a = 0, l = null;
|
|
4981
|
+
for (let k = r.length - 1; k >= 0; k--) {
|
|
4982
|
+
const T = r[k];
|
|
4962
4983
|
if (!T) continue;
|
|
4963
4984
|
if (((C = T.author) == null ? void 0 : C.type) === "user") break;
|
|
4964
4985
|
const B = J(T.id);
|
|
4965
4986
|
if (B != null) {
|
|
4966
4987
|
if (s != null && B <= s) break;
|
|
4967
|
-
t[T.id] !== 0 && (!l && T.author && (l = T.author),
|
|
4988
|
+
t[T.id] !== 0 && (!l && T.author && (l = T.author), a++);
|
|
4968
4989
|
}
|
|
4969
4990
|
}
|
|
4970
|
-
const g =
|
|
4991
|
+
const g = r.filter(
|
|
4971
4992
|
(k) => !((k == null ? void 0 : k.id) != null && t[k.id] === 0)
|
|
4972
4993
|
);
|
|
4973
4994
|
return {
|
|
4974
|
-
...
|
|
4975
|
-
_preview:
|
|
4976
|
-
_unread:
|
|
4977
|
-
_unreadCount:
|
|
4995
|
+
...i,
|
|
4996
|
+
_preview: st(i, g),
|
|
4997
|
+
_unread: a > 0,
|
|
4998
|
+
_unreadCount: a,
|
|
4978
4999
|
_lastAuthor: l
|
|
4979
5000
|
};
|
|
4980
5001
|
});
|
|
@@ -4996,7 +5017,7 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
4996
5017
|
preview: n._preview || this.t("onboarding.newMessage"),
|
|
4997
5018
|
unread: !!n._unread,
|
|
4998
5019
|
_ts: Ce(n, e[n.id] || [])
|
|
4999
|
-
})).sort((n,
|
|
5020
|
+
})).sort((n, i) => n._ts < i._ts ? 1 : n._ts > i._ts ? -1 : 0);
|
|
5000
5021
|
},
|
|
5001
5022
|
// Unread threads (one entry per conv with unseen agent/human
|
|
5002
5023
|
// activity), freshest first. Each entry carries everything the
|
|
@@ -5005,19 +5026,19 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5005
5026
|
latestUnreads() {
|
|
5006
5027
|
var n;
|
|
5007
5028
|
const e = ((n = this.s) == null ? void 0 : n.messagesByConv) || {}, t = [];
|
|
5008
|
-
for (const
|
|
5009
|
-
if (!
|
|
5010
|
-
const
|
|
5029
|
+
for (const i of this.drawerConversations) {
|
|
5030
|
+
if (!i._unread) continue;
|
|
5031
|
+
const r = Ce(i, e[i.id] || []), s = i._lastAuthor, a = !s || s.type === "agent_ia", l = (s == null ? void 0 : s.name) || (a ? this.agentName : "") || "", g = (s == null ? void 0 : s.avatar_url) || (a ? this.agentAvatarUrl : null);
|
|
5011
5032
|
t.push({
|
|
5012
|
-
convId:
|
|
5013
|
-
preview:
|
|
5014
|
-
ts:
|
|
5015
|
-
count:
|
|
5033
|
+
convId: i.id,
|
|
5034
|
+
preview: i._preview || this.t("notification.youHaveNewMessage"),
|
|
5035
|
+
ts: r,
|
|
5036
|
+
count: i._unreadCount || 1,
|
|
5016
5037
|
senderName: l,
|
|
5017
5038
|
senderAvatarUrl: g
|
|
5018
5039
|
});
|
|
5019
5040
|
}
|
|
5020
|
-
return t.sort((
|
|
5041
|
+
return t.sort((i, r) => i.ts < r.ts ? 1 : i.ts > r.ts ? -1 : 0), t;
|
|
5021
5042
|
},
|
|
5022
5043
|
// Notification cards shown in the closed-launcher stack: the unread
|
|
5023
5044
|
// threads above, minus any the user has dismissed (×) for their
|
|
@@ -5053,7 +5074,7 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5053
5074
|
var n;
|
|
5054
5075
|
const e = (n = this.widget) == null ? void 0 : n.quick_links;
|
|
5055
5076
|
if (!Array.isArray(e)) return "";
|
|
5056
|
-
const t = e.find((
|
|
5077
|
+
const t = e.find((i) => i.icon === "status" && i.url);
|
|
5057
5078
|
return (t == null ? void 0 : t.url) || "";
|
|
5058
5079
|
},
|
|
5059
5080
|
helpUrl() {
|
|
@@ -5061,7 +5082,7 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5061
5082
|
const e = (n = this.widget) == null ? void 0 : n.quick_links;
|
|
5062
5083
|
if (!Array.isArray(e)) return "";
|
|
5063
5084
|
const t = e.find(
|
|
5064
|
-
(
|
|
5085
|
+
(i) => (i.icon === "chat" || i.icon === "help") && i.url
|
|
5065
5086
|
);
|
|
5066
5087
|
return (t == null ? void 0 : t.url) || "";
|
|
5067
5088
|
},
|
|
@@ -5098,12 +5119,12 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5098
5119
|
// Last message from a human agent in the current conversation —
|
|
5099
5120
|
// used to surface the human agent's name + avatar in the header.
|
|
5100
5121
|
humanMessageAuthor() {
|
|
5101
|
-
var t, n,
|
|
5122
|
+
var t, n, i;
|
|
5102
5123
|
if (!this.currentConv) return null;
|
|
5103
5124
|
const e = ((t = this.s.messagesByConv) == null ? void 0 : t[this.currentConv.id]) || [];
|
|
5104
|
-
for (let
|
|
5105
|
-
if (((
|
|
5106
|
-
return e[
|
|
5125
|
+
for (let r = e.length - 1; r >= 0; r--)
|
|
5126
|
+
if (((i = (n = e[r]) == null ? void 0 : n.author) == null ? void 0 : i.type) === "agent_human")
|
|
5127
|
+
return e[r].author;
|
|
5107
5128
|
return null;
|
|
5108
5129
|
},
|
|
5109
5130
|
humanAgentName() {
|
|
@@ -5135,12 +5156,17 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5135
5156
|
}) : this.isWaitingHuman ? this.t("composer.agentTakingOver") : this.t("composer.placeholder");
|
|
5136
5157
|
},
|
|
5137
5158
|
displayedMessages() {
|
|
5159
|
+
var n, i;
|
|
5138
5160
|
const e = this.currentConv;
|
|
5139
5161
|
if (!e) return [];
|
|
5162
|
+
if (!e._draft) {
|
|
5163
|
+
const r = (i = (n = this.s) == null ? void 0 : n.paginationByConv) == null ? void 0 : i[e.id];
|
|
5164
|
+
if (!(r != null && r.loaded)) return [];
|
|
5165
|
+
}
|
|
5140
5166
|
const t = this.revealedAt;
|
|
5141
|
-
return (this.s.messagesByConv[e.id] || []).filter((
|
|
5142
|
-
var
|
|
5143
|
-
return (
|
|
5167
|
+
return (this.s.messagesByConv[e.id] || []).filter((r) => {
|
|
5168
|
+
var s, a, l, g, C;
|
|
5169
|
+
return (r == null ? void 0 : r.type) === "action" && ((s = r == null ? void 0 : r.payload) == null ? void 0 : s.state) === "pending" || ae(r) && !(t[r.id] > 0) ? !1 : (r == null ? void 0 : r.type) === "action" || (r == null ? void 0 : r.type) === "system" || ((a = r == null ? void 0 : r.payload) == null ? void 0 : a.type) === "system" || Array.isArray((l = r == null ? void 0 : r.payload) == null ? void 0 : l.attachments) && r.payload.attachments.length || (g = r == null ? void 0 : r.metadata) != null && g.artifact || (C = r == null ? void 0 : r.metadata) != null && C.form ? !0 : typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0;
|
|
5144
5170
|
});
|
|
5145
5171
|
},
|
|
5146
5172
|
// True whenever we should show the "typing" indicator at the bottom
|
|
@@ -5148,18 +5174,18 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5148
5174
|
// or more agent messages are queued and waiting for their reveal
|
|
5149
5175
|
// slot to fire.
|
|
5150
5176
|
streamingActive() {
|
|
5151
|
-
var n,
|
|
5177
|
+
var n, i, r;
|
|
5152
5178
|
const e = this.currentConv;
|
|
5153
|
-
return e ? Object.keys(((n = this.s) == null ? void 0 : n.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : (((
|
|
5154
|
-
(s) =>
|
|
5179
|
+
return e ? Object.keys(((n = this.s) == null ? void 0 : n.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : (((r = (i = this.s) == null ? void 0 : i.messagesByConv) == null ? void 0 : r[e.id]) || []).some(
|
|
5180
|
+
(s) => ae(s) && !(this.revealedAt[s.id] > 0)
|
|
5155
5181
|
) : !1;
|
|
5156
5182
|
},
|
|
5157
5183
|
// Internal: the raw persisted list for the current conversation. We
|
|
5158
5184
|
// watch this to detect new agent messages that need to be paced.
|
|
5159
5185
|
currentConvMessages() {
|
|
5160
|
-
var t, n,
|
|
5186
|
+
var t, n, i;
|
|
5161
5187
|
const e = (t = this.currentConv) == null ? void 0 : t.id;
|
|
5162
|
-
return e ? ((
|
|
5188
|
+
return e ? ((i = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : i[e]) || [] : [];
|
|
5163
5189
|
},
|
|
5164
5190
|
pendingApproval() {
|
|
5165
5191
|
return !this.currentConv || !this.store || this.actionInFlight ? null : this.store.getPendingApproval(this.currentConv.id);
|
|
@@ -5176,11 +5202,11 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5176
5202
|
return ((t = (e = this.pendingApproval) == null ? void 0 : e.payload) == null ? void 0 : t.name) || ((n = this.pendingApproval) == null ? void 0 : n.text_md) || this.t("action.title");
|
|
5177
5203
|
},
|
|
5178
5204
|
approvalDetail() {
|
|
5179
|
-
var
|
|
5180
|
-
const e = (s = (
|
|
5205
|
+
var i, r, s, a, l, g;
|
|
5206
|
+
const e = (s = (r = (i = this.pendingApproval) == null ? void 0 : i.payload) == null ? void 0 : r.pending) == null ? void 0 : s.user_explanation;
|
|
5181
5207
|
if (typeof e == "string" && e.trim())
|
|
5182
5208
|
return e.trim();
|
|
5183
|
-
const t = (g = (l = (
|
|
5209
|
+
const t = (g = (l = (a = this.pendingApproval) == null ? void 0 : a.payload) == null ? void 0 : l.pending) == null ? void 0 : g.prepared_params;
|
|
5184
5210
|
if (!t || typeof t != "object") return "";
|
|
5185
5211
|
const n = Object.entries(t);
|
|
5186
5212
|
return n.length ? n.slice(0, 2).map(([C, k]) => `${C}: ${k}`).join(" · ") : "";
|
|
@@ -5215,18 +5241,18 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5215
5241
|
return this.approvalReady || !!this.pendingForm || this.showFeedback || this.suggestions.length > 0;
|
|
5216
5242
|
},
|
|
5217
5243
|
dateLabel() {
|
|
5218
|
-
var n,
|
|
5244
|
+
var n, i, r;
|
|
5219
5245
|
const e = this.currentConv;
|
|
5220
5246
|
let t = /* @__PURE__ */ new Date();
|
|
5221
5247
|
if (e) {
|
|
5222
|
-
const
|
|
5223
|
-
if (
|
|
5224
|
-
const l = new Date(
|
|
5248
|
+
const a = ((r = (((i = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : i[e.id]) || []).find((l) => l == null ? void 0 : l.created_at)) == null ? void 0 : r.created_at) || e.created_at;
|
|
5249
|
+
if (a) {
|
|
5250
|
+
const l = new Date(a);
|
|
5225
5251
|
Number.isNaN(l.getTime()) || (t = l);
|
|
5226
5252
|
}
|
|
5227
5253
|
}
|
|
5228
5254
|
return this.t("messageList.today", {
|
|
5229
|
-
time: Le(t,
|
|
5255
|
+
time: Le(t, oe(this.locale))
|
|
5230
5256
|
});
|
|
5231
5257
|
},
|
|
5232
5258
|
// Pagination state for the active conversation. Drives the
|
|
@@ -5234,8 +5260,8 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5234
5260
|
// history available, nothing loading) so the loader stays inert
|
|
5235
5261
|
// until `openConversation` has populated the entry.
|
|
5236
5262
|
paginationState() {
|
|
5237
|
-
var n,
|
|
5238
|
-
const e = (n = this.currentConv) == null ? void 0 : n.id, t = e ? (
|
|
5263
|
+
var n, i, r;
|
|
5264
|
+
const e = (n = this.currentConv) == null ? void 0 : n.id, t = e ? (r = (i = this.s) == null ? void 0 : i.paginationByConv) == null ? void 0 : r[e] : null;
|
|
5239
5265
|
return {
|
|
5240
5266
|
loading: !!(t != null && t.loading),
|
|
5241
5267
|
hasMore: !!(t != null && t.nextCursor)
|
|
@@ -5250,13 +5276,13 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5250
5276
|
// ts comparison in `launcherPeeks`.
|
|
5251
5277
|
latestUnreads: {
|
|
5252
5278
|
handler(e) {
|
|
5253
|
-
const t = new Set(e.map((
|
|
5254
|
-
if (!
|
|
5255
|
-
const
|
|
5279
|
+
const t = new Set(e.map((a) => a.convId)), n = this.dismissedPeeks || {}, i = Object.keys(n);
|
|
5280
|
+
if (!i.length) return;
|
|
5281
|
+
const r = {};
|
|
5256
5282
|
let s = !1;
|
|
5257
|
-
for (const
|
|
5258
|
-
t.has(
|
|
5259
|
-
s && (this.dismissedPeeks =
|
|
5283
|
+
for (const a of i)
|
|
5284
|
+
t.has(a) ? r[a] = n[a] : s = !0;
|
|
5285
|
+
s && (this.dismissedPeeks = r);
|
|
5260
5286
|
},
|
|
5261
5287
|
deep: !0
|
|
5262
5288
|
},
|
|
@@ -5333,7 +5359,7 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5333
5359
|
async mounted() {
|
|
5334
5360
|
if (typeof document < "u" && !document.getElementById(Te)) {
|
|
5335
5361
|
const e = document.createElement("style");
|
|
5336
|
-
e.id = Te, e.textContent =
|
|
5362
|
+
e.id = Te, e.textContent = Je, document.head.appendChild(e);
|
|
5337
5363
|
}
|
|
5338
5364
|
await this.boot(), this.isEmbedded && this.store && await this.open();
|
|
5339
5365
|
},
|
|
@@ -5356,13 +5382,13 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5356
5382
|
}
|
|
5357
5383
|
try {
|
|
5358
5384
|
this.transport = ye(
|
|
5359
|
-
|
|
5385
|
+
Ke({
|
|
5360
5386
|
baseUrl: this.baseUrl,
|
|
5361
5387
|
widgetId: this.widgetId,
|
|
5362
5388
|
userId: this.userId,
|
|
5363
5389
|
userHash: this.userHash
|
|
5364
5390
|
})
|
|
5365
|
-
), this.store = ye(
|
|
5391
|
+
), this.store = ye(Xe(this.transport)), this.hydrateNotifPref(), await this.store.start(), this.setupLiveReveal();
|
|
5366
5392
|
const t = (e = this.context) == null ? void 0 : e.customer;
|
|
5367
5393
|
t && typeof t == "object" && await this.store.applyCustomer(t);
|
|
5368
5394
|
} catch (t) {
|
|
@@ -5387,12 +5413,12 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5387
5413
|
return;
|
|
5388
5414
|
}
|
|
5389
5415
|
this.floatRO = new ResizeObserver((n) => {
|
|
5390
|
-
const
|
|
5391
|
-
if (!
|
|
5392
|
-
const
|
|
5393
|
-
|
|
5394
|
-
var s,
|
|
5395
|
-
(
|
|
5416
|
+
const i = n[0];
|
|
5417
|
+
if (!i) return;
|
|
5418
|
+
const r = Math.ceil(i.contentRect.height + 8);
|
|
5419
|
+
r !== this.floatHeight && (this.floatHeight = r, this.$nextTick(() => {
|
|
5420
|
+
var s, a;
|
|
5421
|
+
(a = (s = this.$refs.messageList) == null ? void 0 : s.scrollToBottom) == null || a.call(s);
|
|
5396
5422
|
}));
|
|
5397
5423
|
}), this.floatRO.observe(t);
|
|
5398
5424
|
}
|
|
@@ -5426,9 +5452,9 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5426
5452
|
// Opening straight from a notification card: land on that card's
|
|
5427
5453
|
// thread rather than whatever was last active.
|
|
5428
5454
|
async openFromPeek(e) {
|
|
5429
|
-
var n,
|
|
5455
|
+
var n, i;
|
|
5430
5456
|
const t = e || ((n = this.latestUnreads[0]) == null ? void 0 : n.convId);
|
|
5431
|
-
t && t !== ((
|
|
5457
|
+
t && t !== ((i = this.currentConv) == null ? void 0 : i.id) && (this.draftConv = null, this.activeConvId = t, this.showOnboarding = !1), await this.open();
|
|
5432
5458
|
},
|
|
5433
5459
|
// Stamp the dismissed batch ts for a single conv so its card
|
|
5434
5460
|
// disappears from the stack until a fresher message arrives.
|
|
@@ -5502,7 +5528,7 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5502
5528
|
this.openRenameDialog();
|
|
5503
5529
|
break;
|
|
5504
5530
|
case "export":
|
|
5505
|
-
|
|
5531
|
+
at(
|
|
5506
5532
|
this.currentConv,
|
|
5507
5533
|
this.currentConv ? (n = (t = this.s) == null ? void 0 : t.messagesByConv) == null ? void 0 : n[this.currentConv.id] : [],
|
|
5508
5534
|
this.translator,
|
|
@@ -5536,8 +5562,8 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5536
5562
|
if (!(!n || n === t.name))
|
|
5537
5563
|
try {
|
|
5538
5564
|
await this.store.patchConversation(t.id, { name: n });
|
|
5539
|
-
} catch (
|
|
5540
|
-
console.error("[ww-messenger] rename failed",
|
|
5565
|
+
} catch (i) {
|
|
5566
|
+
console.error("[ww-messenger] rename failed", i);
|
|
5541
5567
|
}
|
|
5542
5568
|
},
|
|
5543
5569
|
// ── Send / suggestion / form / attach / feedback ────────────────
|
|
@@ -5545,9 +5571,9 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5545
5571
|
let t = this.currentConv;
|
|
5546
5572
|
if (!t && (this.startConv(), t = this.currentConv, !t) || t._draft && (t = await this.ensureRealConv(), !t))
|
|
5547
5573
|
return;
|
|
5548
|
-
const n = t.id,
|
|
5574
|
+
const n = t.id, i = this.pendingAttachments.slice();
|
|
5549
5575
|
this.pendingAttachments = [], this.unreadAnchorId = null, this.unreadBoundaryTs = "", await this.store.send(n, e, {
|
|
5550
|
-
attachments:
|
|
5576
|
+
attachments: i.length ? i : void 0
|
|
5551
5577
|
});
|
|
5552
5578
|
},
|
|
5553
5579
|
async onSuggestion(e) {
|
|
@@ -5566,12 +5592,12 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5566
5592
|
async onFormSubmit({ values: e }) {
|
|
5567
5593
|
const t = this.pendingForm;
|
|
5568
5594
|
if (!(t != null && t.form)) return;
|
|
5569
|
-
const n =
|
|
5595
|
+
const n = tt(t.form, e, this.translator);
|
|
5570
5596
|
if (!n) return;
|
|
5571
|
-
let
|
|
5572
|
-
|
|
5597
|
+
let i = this.currentConv;
|
|
5598
|
+
i && (i._draft && (i = await this.ensureRealConv(), !i) || await this.store.send(i.id, n, {
|
|
5573
5599
|
metadata: {
|
|
5574
|
-
artifact:
|
|
5600
|
+
artifact: nt(
|
|
5575
5601
|
t.form,
|
|
5576
5602
|
e,
|
|
5577
5603
|
this.translator
|
|
@@ -5622,47 +5648,47 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5622
5648
|
}
|
|
5623
5649
|
}
|
|
5624
5650
|
}
|
|
5625
|
-
},
|
|
5651
|
+
}, Ta = {
|
|
5626
5652
|
key: 0,
|
|
5627
5653
|
class: "wm-loading",
|
|
5628
5654
|
"aria-busy": "true",
|
|
5629
5655
|
"aria-live": "polite"
|
|
5630
|
-
},
|
|
5656
|
+
}, xa = ["aria-label"], Oa = {
|
|
5631
5657
|
key: 0,
|
|
5632
5658
|
class: "wm-state"
|
|
5633
|
-
},
|
|
5659
|
+
}, La = { class: "wm-state__err" }, Ia = { class: "wm-state__errTitle" }, Ea = { class: "wm-state__errSub" }, Ba = { class: "wm-bottom" }, Ra = {
|
|
5634
5660
|
key: 0,
|
|
5635
5661
|
ref: "floatEl",
|
|
5636
5662
|
class: "wm-float"
|
|
5637
|
-
},
|
|
5663
|
+
}, Na = {
|
|
5638
5664
|
key: 1,
|
|
5639
5665
|
class: "wm-actionWait",
|
|
5640
5666
|
role: "status",
|
|
5641
5667
|
"aria-live": "polite"
|
|
5642
|
-
},
|
|
5668
|
+
}, Fa = { class: "wm-actionWait__lbl" }, ja = {
|
|
5643
5669
|
key: 2,
|
|
5644
5670
|
class: "wm-attached"
|
|
5645
|
-
},
|
|
5646
|
-
function
|
|
5647
|
-
const
|
|
5671
|
+
}, Pa = ["aria-label", "onClick"];
|
|
5672
|
+
function Da(e, t, n, i, r, s) {
|
|
5673
|
+
const a = I("Launcher"), l = I("Header"), g = I("Onboarding"), C = I("MessageList"), k = I("ApprovalCard"), T = I("FormCard"), B = I("Feedback"), A = I("SuggestionChips"), H = I("Composer"), M = I("MoreMenu"), D = I("RenameDialog");
|
|
5648
5674
|
return c(), u("div", {
|
|
5649
5675
|
class: x(["wm-root", `wm-root--${n.displayMode}`])
|
|
5650
5676
|
}, [
|
|
5651
|
-
!
|
|
5677
|
+
!r.isOpen && !s.isEmbedded ? (c(), R(a, {
|
|
5652
5678
|
key: 0,
|
|
5653
5679
|
"unread-count": s.unreadCount,
|
|
5654
5680
|
peeks: s.launcherPeeks,
|
|
5655
5681
|
onOpen: s.openFromPeek,
|
|
5656
5682
|
onDismiss: s.dismissPeek
|
|
5657
5683
|
}, null, 8, ["unread-count", "peeks", "onOpen", "onDismiss"])) : b("", !0),
|
|
5658
|
-
|
|
5684
|
+
r.isOpen || s.isEmbedded ? (c(), u("section", {
|
|
5659
5685
|
key: 1,
|
|
5660
5686
|
class: x(["wm-panel", `wm-panel--${n.displayMode}`]),
|
|
5661
|
-
style: W(
|
|
5687
|
+
style: W(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
|
|
5662
5688
|
role: "dialog",
|
|
5663
5689
|
"aria-label": "Messenger"
|
|
5664
5690
|
}, [
|
|
5665
|
-
!s.ready && !s.error ? (c(), u("div",
|
|
5691
|
+
!s.ready && !s.error ? (c(), u("div", Ta, [
|
|
5666
5692
|
s.isEmbedded ? b("", !0) : (c(), u("button", {
|
|
5667
5693
|
key: 0,
|
|
5668
5694
|
type: "button",
|
|
@@ -5683,7 +5709,7 @@ function ja(e, t, n, r, a, s) {
|
|
|
5683
5709
|
}, [
|
|
5684
5710
|
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
5685
5711
|
], -1)
|
|
5686
|
-
])], 8,
|
|
5712
|
+
])], 8, xa)),
|
|
5687
5713
|
t[6] || (t[6] = o("div", {
|
|
5688
5714
|
class: "wm-loading__spinner",
|
|
5689
5715
|
"aria-hidden": "true"
|
|
@@ -5696,13 +5722,13 @@ function ja(e, t, n, r, a, s) {
|
|
|
5696
5722
|
"show-identity": !!s.currentConv,
|
|
5697
5723
|
"show-back": s.canBack,
|
|
5698
5724
|
"show-close": !s.isEmbedded,
|
|
5699
|
-
"more-active":
|
|
5725
|
+
"more-active": r.moreOpen,
|
|
5700
5726
|
onBack: s.goHome,
|
|
5701
5727
|
onMore: s.toggleMore,
|
|
5702
5728
|
onClose: s.close
|
|
5703
5729
|
}, null, 8, ["title", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "onBack", "onMore", "onClose"]),
|
|
5704
|
-
s.error ? (c(), u("div",
|
|
5705
|
-
o("div",
|
|
5730
|
+
s.error ? (c(), u("div", Oa, [
|
|
5731
|
+
o("div", La, [
|
|
5706
5732
|
t[7] || (t[7] = o("div", { class: "wm-state__errIcon" }, [
|
|
5707
5733
|
o("svg", {
|
|
5708
5734
|
width: "14",
|
|
@@ -5719,8 +5745,8 @@ function ja(e, t, n, r, a, s) {
|
|
|
5719
5745
|
])
|
|
5720
5746
|
], -1)),
|
|
5721
5747
|
o("div", null, [
|
|
5722
|
-
o("div",
|
|
5723
|
-
o("div",
|
|
5748
|
+
o("div", Ia, v(s.t("error.connectionFailed")), 1),
|
|
5749
|
+
o("div", Ea, v(s.error), 1)
|
|
5724
5750
|
])
|
|
5725
5751
|
])
|
|
5726
5752
|
])) : s.currentConv ? (c(), u(L, { key: 2 }, [
|
|
@@ -5736,8 +5762,8 @@ function ja(e, t, n, r, a, s) {
|
|
|
5736
5762
|
"unread-boundary-ts": e.unreadBoundaryTs,
|
|
5737
5763
|
onLoadMore: s.onLoadMore
|
|
5738
5764
|
}, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "unread-anchor-id", "unread-boundary-ts", "onLoadMore"]),
|
|
5739
|
-
o("div",
|
|
5740
|
-
s.floatVisible ? (c(), u("div",
|
|
5765
|
+
o("div", Ba, [
|
|
5766
|
+
s.floatVisible ? (c(), u("div", Ra, [
|
|
5741
5767
|
s.approvalReady ? (c(), R(k, {
|
|
5742
5768
|
key: 0,
|
|
5743
5769
|
action: s.approvalTitle,
|
|
@@ -5750,8 +5776,8 @@ function ja(e, t, n, r, a, s) {
|
|
|
5750
5776
|
onSubmit: s.onFormSubmit
|
|
5751
5777
|
}, null, 8, ["form", "onSubmit"])) : s.showFeedback ? (c(), R(B, {
|
|
5752
5778
|
key: 2,
|
|
5753
|
-
busy:
|
|
5754
|
-
done:
|
|
5779
|
+
busy: r.feedbackBusy,
|
|
5780
|
+
done: r.feedbackDone,
|
|
5755
5781
|
onSubmit: s.onFeedback
|
|
5756
5782
|
}, null, 8, ["busy", "done", "onSubmit"])) : (c(), R(A, {
|
|
5757
5783
|
key: 3,
|
|
@@ -5759,19 +5785,19 @@ function ja(e, t, n, r, a, s) {
|
|
|
5759
5785
|
onSelect: s.onSuggestion
|
|
5760
5786
|
}, null, 8, ["items", "onSelect"]))
|
|
5761
5787
|
], 512)) : b("", !0),
|
|
5762
|
-
s.actionInFlight ? (c(), u("div",
|
|
5788
|
+
s.actionInFlight ? (c(), u("div", Na, [
|
|
5763
5789
|
t[8] || (t[8] = o("span", {
|
|
5764
5790
|
class: "wm-actionWait__spinner",
|
|
5765
5791
|
"aria-hidden": "true"
|
|
5766
5792
|
}, null, -1)),
|
|
5767
|
-
o("span",
|
|
5793
|
+
o("span", Fa, v(s.t("action.inProgress", {
|
|
5768
5794
|
name: s.actionInFlightName
|
|
5769
5795
|
})), 1)
|
|
5770
5796
|
])) : (c(), R(H, {
|
|
5771
5797
|
key: 2,
|
|
5772
5798
|
ref: "composer",
|
|
5773
|
-
modelValue:
|
|
5774
|
-
"onUpdate:modelValue": t[1] || (t[1] = (N) =>
|
|
5799
|
+
modelValue: r.draft,
|
|
5800
|
+
"onUpdate:modelValue": t[1] || (t[1] = (N) => r.draft = N),
|
|
5775
5801
|
placeholder: s.composerPlaceholder,
|
|
5776
5802
|
disabled: !!s.pendingApproval,
|
|
5777
5803
|
"attach-label": s.t("composer.attachFile"),
|
|
@@ -5779,7 +5805,7 @@ function ja(e, t, n, r, a, s) {
|
|
|
5779
5805
|
onAttach: s.onAttach
|
|
5780
5806
|
}, null, 8, ["modelValue", "placeholder", "disabled", "attach-label", "onSend", "onAttach"]))
|
|
5781
5807
|
]),
|
|
5782
|
-
|
|
5808
|
+
r.moreOpen ? (c(), R(M, {
|
|
5783
5809
|
key: 0,
|
|
5784
5810
|
"can-rename": !!s.currentConv && !s.currentConv._draft,
|
|
5785
5811
|
"can-export": !!s.currentConv && !s.currentConv._draft,
|
|
@@ -5787,20 +5813,20 @@ function ja(e, t, n, r, a, s) {
|
|
|
5787
5813
|
"browser-notif-enabled": e.browserNotifEnabled,
|
|
5788
5814
|
"status-url": s.statusUrl,
|
|
5789
5815
|
"help-url": s.helpUrl,
|
|
5790
|
-
onClose: t[2] || (t[2] = (N) =>
|
|
5816
|
+
onClose: t[2] || (t[2] = (N) => r.moreOpen = !1),
|
|
5791
5817
|
onSoundToggle: e.onSoundToggle,
|
|
5792
5818
|
onBrowserNotifToggle: e.onBrowserNotifToggle,
|
|
5793
5819
|
onAction: s.onMoreAction
|
|
5794
5820
|
}, null, 8, ["can-rename", "can-export", "sound-enabled", "browser-notif-enabled", "status-url", "help-url", "onSoundToggle", "onBrowserNotifToggle", "onAction"])) : b("", !0),
|
|
5795
|
-
|
|
5821
|
+
r.renameDialogOpen && s.currentConv && !s.currentConv._draft ? (c(), R(D, {
|
|
5796
5822
|
key: 1,
|
|
5797
5823
|
"initial-value": s.currentConv.name || "",
|
|
5798
5824
|
title: s.t("rename.dialogTitle"),
|
|
5799
|
-
onClose: t[3] || (t[3] = (N) =>
|
|
5825
|
+
onClose: t[3] || (t[3] = (N) => r.renameDialogOpen = !1),
|
|
5800
5826
|
onSubmit: s.onRenameSubmit
|
|
5801
5827
|
}, null, 8, ["initial-value", "title", "onSubmit"])) : b("", !0),
|
|
5802
|
-
|
|
5803
|
-
(c(!0), u(L, null, j(
|
|
5828
|
+
r.pendingAttachments.length ? (c(), u("div", ja, [
|
|
5829
|
+
(c(!0), u(L, null, j(r.pendingAttachments, (N, $) => (c(), u("div", {
|
|
5804
5830
|
key: $,
|
|
5805
5831
|
class: "wm-attached__chip"
|
|
5806
5832
|
}, [
|
|
@@ -5821,7 +5847,7 @@ function ja(e, t, n, r, a, s) {
|
|
|
5821
5847
|
o("button", {
|
|
5822
5848
|
type: "button",
|
|
5823
5849
|
"aria-label": s.t("attachment.remove"),
|
|
5824
|
-
onClick: (K) =>
|
|
5850
|
+
onClick: (K) => r.pendingAttachments.splice($, 1)
|
|
5825
5851
|
}, [...t[9] || (t[9] = [
|
|
5826
5852
|
o("svg", {
|
|
5827
5853
|
width: "10",
|
|
@@ -5836,7 +5862,7 @@ function ja(e, t, n, r, a, s) {
|
|
|
5836
5862
|
}, [
|
|
5837
5863
|
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
5838
5864
|
], -1)
|
|
5839
|
-
])], 8,
|
|
5865
|
+
])], 8, Pa)
|
|
5840
5866
|
]))), 128))
|
|
5841
5867
|
])) : b("", !0)
|
|
5842
5868
|
], 64)) : (c(), R(g, {
|
|
@@ -5845,12 +5871,12 @@ function ja(e, t, n, r, a, s) {
|
|
|
5845
5871
|
"agent-name": s.agentName,
|
|
5846
5872
|
"quick-links": s.quickLinks,
|
|
5847
5873
|
"open-threads": s.openThreads,
|
|
5848
|
-
busy:
|
|
5874
|
+
busy: r.busy,
|
|
5849
5875
|
onStart: s.startConv,
|
|
5850
5876
|
onSelect: s.onQuickLink,
|
|
5851
5877
|
onResume: s.onDrawerPick
|
|
5852
5878
|
}, null, 8, ["welcome-message", "agent-name", "quick-links", "open-threads", "busy", "onStart", "onSelect", "onResume"])),
|
|
5853
|
-
|
|
5879
|
+
r.moreOpen && !s.currentConv ? (c(), R(M, {
|
|
5854
5880
|
key: 3,
|
|
5855
5881
|
"can-rename": !1,
|
|
5856
5882
|
"can-export": !1,
|
|
@@ -5858,7 +5884,7 @@ function ja(e, t, n, r, a, s) {
|
|
|
5858
5884
|
"browser-notif-enabled": e.browserNotifEnabled,
|
|
5859
5885
|
"status-url": s.statusUrl,
|
|
5860
5886
|
"help-url": s.helpUrl,
|
|
5861
|
-
onClose: t[4] || (t[4] = (N) =>
|
|
5887
|
+
onClose: t[4] || (t[4] = (N) => r.moreOpen = !1),
|
|
5862
5888
|
onSoundToggle: e.onSoundToggle,
|
|
5863
5889
|
onBrowserNotifToggle: e.onBrowserNotifToggle,
|
|
5864
5890
|
onAction: s.onMoreAction
|
|
@@ -5867,53 +5893,54 @@ function ja(e, t, n, r, a, s) {
|
|
|
5867
5893
|
], 6)) : b("", !0)
|
|
5868
5894
|
], 2);
|
|
5869
5895
|
}
|
|
5870
|
-
const
|
|
5896
|
+
const Ha = /* @__PURE__ */ E(Ma, [["render", Da], ["__scopeId", "data-v-d9dce1ad"]]), za = "0.4.2";
|
|
5871
5897
|
export {
|
|
5872
|
-
|
|
5898
|
+
le as AIAvatar,
|
|
5873
5899
|
fe as AVATAR_COLORS,
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5900
|
+
es as ActionResult,
|
|
5901
|
+
ui as ApprovalCard,
|
|
5902
|
+
cs as ArtifactFormResponse,
|
|
5903
|
+
ks as ArtifactInfoCard,
|
|
5904
|
+
$s as ArtifactRenderer,
|
|
5905
|
+
js as ArtifactTicket,
|
|
5906
|
+
Zs as AttachmentPreview,
|
|
5907
|
+
sr as Bubble,
|
|
5908
|
+
Xr as Composer,
|
|
5909
|
+
Ze as DEFAULT_BASE_URL,
|
|
5910
|
+
ie as DEFAULT_LANGUAGE,
|
|
5911
|
+
Ji as Feedback,
|
|
5912
|
+
Pi as FormCard,
|
|
5913
|
+
ln as Header,
|
|
5914
|
+
Ee as HumanAvatar,
|
|
5915
|
+
jt as Launcher,
|
|
5890
5916
|
ve as MEDIA_RECORDER_SUPPORTED,
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5917
|
+
Ir as MessageList,
|
|
5918
|
+
Ha as Messenger,
|
|
5919
|
+
ma as MoreMenu,
|
|
5920
|
+
Hn as Onboarding,
|
|
5921
|
+
he as SCREEN_CAPTURE_SUPPORTED,
|
|
5922
|
+
et as SUPPORTED_LANGUAGES,
|
|
5923
|
+
ti as SuggestionChips,
|
|
5924
|
+
Gt as TeamAvatars,
|
|
5925
|
+
or as Typing,
|
|
5926
|
+
za as VERSION,
|
|
5901
5927
|
xe as avatarColor,
|
|
5902
5928
|
Oe as avatarInitials,
|
|
5903
|
-
|
|
5929
|
+
Br as captureScreenshotFile,
|
|
5904
5930
|
U as colors,
|
|
5905
|
-
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5931
|
+
Xe as createStore,
|
|
5932
|
+
P as createTranslator,
|
|
5933
|
+
Ke as createTransport,
|
|
5934
|
+
oe as dateLocale,
|
|
5935
|
+
Ha as default,
|
|
5910
5936
|
Le as formatTime,
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5937
|
+
$a as guessAttachmentKind,
|
|
5938
|
+
Er as pickRecorderMime,
|
|
5939
|
+
dn as renderInlineMarkdown,
|
|
5940
|
+
un as renderMarkdown,
|
|
5914
5941
|
ge as resolveLanguage,
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5942
|
+
Nr as startScreenRecording,
|
|
5943
|
+
Je as tokensCss,
|
|
5944
|
+
Qe as uuid,
|
|
5945
|
+
Qe as v4
|
|
5919
5946
|
};
|