@_solaris/messenger-widget 0.3.5 → 0.3.6

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.js CHANGED
@@ -1,4 +1,4 @@
1
- import { reactive as Se, openBlock as l, createElementBlock as c, createVNode as K, Transition as xe, withCtx as Te, withKeys as ae, withModifiers as Z, createElementVNode as i, toDisplayString as k, createCommentVNode as b, normalizeStyle as G, normalizeClass as E, Fragment as M, renderList as D, resolveComponent as B, createBlock as L, createTextVNode as te, resolveDynamicComponent as Me, renderSlot as Oe, withDirectives as q, vModelText as X, vModelCheckbox as Ie, vModelSelect as Be, createStaticVNode as ue, markRaw as me } from "vue";
1
+ import { reactive as Se, openBlock as d, createElementBlock as c, normalizeStyle as z, toDisplayString as k, resolveComponent as I, createVNode as K, Transition as xe, withCtx as Te, Fragment as M, renderList as F, createElementVNode as i, withKeys as oe, withModifiers as Y, createCommentVNode as b, normalizeClass as E, createBlock as L, createTextVNode as te, resolveDynamicComponent as Me, renderSlot as Oe, withDirectives as W, vModelText as Z, vModelCheckbox as Ie, vModelSelect as Be, createStaticVNode as ae, markRaw as fe } from "vue";
2
2
  const Ee = [
3
3
  "connected",
4
4
  "message",
@@ -6,10 +6,10 @@ const Ee = [
6
6
  "conversation_updated",
7
7
  "config_updated",
8
8
  "action_status"
9
- ], fe = "/client", $e = 5 * 60 * 1e3, Le = 10 * 60 * 1e3, Re = 5 * 60 * 1e3;
10
- function Fe(t) {
9
+ ], _e = "/client", $e = 5 * 60 * 1e3, Ne = 10 * 60 * 1e3, Le = 5 * 60 * 1e3;
10
+ function Re(t) {
11
11
  const e = {
12
- baseUrl: De(t.baseUrl || ""),
12
+ baseUrl: Fe(t.baseUrl || ""),
13
13
  widgetId: t.widgetId || "",
14
14
  userId: t.userId || "",
15
15
  userHash: t.userHash || "",
@@ -55,20 +55,20 @@ function Fe(t) {
55
55
  };
56
56
  }
57
57
  async function a(h, f, p) {
58
- const v = await fetch(`${e.baseUrl}${fe}${f}`, {
58
+ const v = await fetch(`${e.baseUrl}${_e}${f}`, {
59
59
  method: h,
60
60
  headers: { "Content-Type": "application/json", ...s() },
61
61
  body: p !== void 0 ? JSON.stringify(p) : void 0
62
62
  });
63
63
  if (!v.ok) {
64
- const T = await d(v), O = new Error(
64
+ const T = await l(v), O = new Error(
65
65
  `HTTP ${v.status} ${h} ${f} :: ${(T == null ? void 0 : T.error) || v.statusText}`
66
66
  );
67
67
  throw O.status = v.status, O.body = T, O;
68
68
  }
69
69
  return v.status === 204 ? null : v.json();
70
70
  }
71
- async function d(h) {
71
+ async function l(h) {
72
72
  try {
73
73
  return await h.json();
74
74
  } catch {
@@ -80,7 +80,7 @@ function Fe(t) {
80
80
  // Public — no HMAC required.
81
81
  fetch(`${e.baseUrl}/widgets/${encodeURIComponent(e.widgetId)}/config`).then(async (p) => {
82
82
  if (!p.ok) {
83
- const v = await d(p);
83
+ const v = await l(p);
84
84
  throw new Error(`HTTP ${p.status} GET /widgets/:id/config :: ${(v == null ? void 0 : v.error) || p.statusText}`);
85
85
  }
86
86
  return p.json();
@@ -100,7 +100,7 @@ function Fe(t) {
100
100
  const h = await a("GET", "/customers/me");
101
101
  return (h == null ? void 0 : h.customer) ?? null;
102
102
  }
103
- async function w(h) {
103
+ async function y(h) {
104
104
  const f = await a("PATCH", "/customers/me", h);
105
105
  return (f == null ? void 0 : f.customer) ?? null;
106
106
  }
@@ -108,13 +108,13 @@ function Fe(t) {
108
108
  const h = await a("GET", "/conversations");
109
109
  return (h == null ? void 0 : h.conversations) ?? [];
110
110
  }
111
- async function F(h = {}) {
111
+ async function N(h = {}) {
112
112
  return (await a("POST", "/conversations", h)).conversation;
113
113
  }
114
114
  async function A(h) {
115
115
  return (await a("GET", `/conversations/${encodeURIComponent(h)}`)).conversation;
116
116
  }
117
- async function U(h, f) {
117
+ async function D(h, f) {
118
118
  return (await a("PATCH", `/conversations/${encodeURIComponent(h)}`, f)).conversation;
119
119
  }
120
120
  async function x(h, f = {}) {
@@ -126,8 +126,8 @@ function Fe(t) {
126
126
  `/conversations/${encodeURIComponent(h)}/messages${v}`
127
127
  );
128
128
  }
129
- async function j(h, f) {
130
- V();
129
+ async function U(h, f) {
130
+ q();
131
131
  const p = {
132
132
  client_msg_id: f.client_msg_id,
133
133
  type: "content",
@@ -142,7 +142,7 @@ function Fe(t) {
142
142
  );
143
143
  }
144
144
  async function P(h, f, p) {
145
- return V(), a(
145
+ return q(), a(
146
146
  "POST",
147
147
  `/messages/${encodeURIComponent(h)}/callbacks/${encodeURIComponent(f)}`,
148
148
  p ? { inputs: p } : {}
@@ -167,7 +167,7 @@ function Fe(t) {
167
167
  if (!O.ok)
168
168
  throw new Error(`HTTP ${O.status} PUT signed upload`);
169
169
  return {
170
- type: Ne(p),
170
+ type: De(p),
171
171
  path: T.path,
172
172
  mime_type: p,
173
173
  size_bytes: v
@@ -179,18 +179,18 @@ function Fe(t) {
179
179
  `/attachments/sign?path=${encodeURIComponent(h)}`
180
180
  );
181
181
  }
182
- function Y() {
182
+ function J() {
183
183
  const h = new URLSearchParams({
184
184
  userId: e.userId,
185
185
  userHash: e.userHash,
186
186
  widgetId: e.widgetId
187
187
  }).toString();
188
- return `${e.baseUrl}${fe}/stream?${h}`;
188
+ return `${e.baseUrl}${_e}/stream?${h}`;
189
189
  }
190
- function z() {
190
+ function V() {
191
191
  if (!e.eventSource && !(typeof document < "u" && document.hidden))
192
192
  try {
193
- const h = new EventSource(Y());
193
+ const h = new EventSource(J());
194
194
  for (const f of Ee)
195
195
  h.addEventListener(f, (p) => Q(f, p.data));
196
196
  h.addEventListener("error", () => o("error", new Error("SSE error"))), e.eventSource = h, r("open");
@@ -206,30 +206,30 @@ function Fe(t) {
206
206
  console.error("[transport] bad SSE payload", h, p);
207
207
  }
208
208
  }
209
- function W() {
209
+ function G() {
210
210
  e.eventSource && (e.eventSource.close(), e.eventSource = null), e.connection !== "paused" && r("idle");
211
211
  }
212
- function V() {
213
- clearTimeout(e.burstTimer), z(), e.panelOpen || (e.burstTimer = setTimeout(() => {
214
- e.panelOpen || W();
215
- }, Le));
212
+ function q() {
213
+ clearTimeout(e.burstTimer), V(), e.panelOpen || (e.burstTimer = setTimeout(() => {
214
+ e.panelOpen || G();
215
+ }, Ne));
216
216
  }
217
- function J(h) {
218
- e.panelOpen = !!h, e.panelOpen ? (clearTimeout(e.burstTimer), z()) : V();
217
+ function X(h) {
218
+ e.panelOpen = !!h, e.panelOpen ? (clearTimeout(e.burstTimer), V()) : q();
219
219
  }
220
- async function de() {
220
+ async function ce() {
221
221
  try {
222
222
  const h = await S(), f = h.reduce((v, T) => {
223
223
  const O = T == null ? void 0 : T.last_message_at;
224
224
  return O && (!v || O > v) ? O : v;
225
225
  }, null);
226
- f && (!e.lastActivityAt || f > e.lastActivityAt) && (e.lastActivityAt = f, o("activity", { conversations: h, latestAt: f }), V());
226
+ f && (!e.lastActivityAt || f > e.lastActivityAt) && (e.lastActivityAt = f, o("activity", { conversations: h, latestAt: f }), q());
227
227
  } catch (h) {
228
228
  console.error("[transport] poll failed", h);
229
229
  }
230
230
  }
231
231
  function se() {
232
- u(), !(typeof document < "u" && document.hidden) && (e.pollTimer = setInterval(de, $e));
232
+ u(), !(typeof document < "u" && document.hidden) && (e.pollTimer = setInterval(ce, $e));
233
233
  }
234
234
  function u() {
235
235
  e.pollTimer && (clearInterval(e.pollTimer), e.pollTimer = null);
@@ -237,14 +237,14 @@ function Fe(t) {
237
237
  function m() {
238
238
  if (document.hidden)
239
239
  clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = setTimeout(() => {
240
- e.hiddenGraceTimer = null, document.hidden && (u(), W(), r("paused"));
241
- }, Re);
240
+ e.hiddenGraceTimer = null, document.hidden && (u(), G(), r("paused"));
241
+ }, Le);
242
242
  else {
243
243
  if (e.hiddenGraceTimer) {
244
244
  clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null;
245
245
  return;
246
246
  }
247
- r("idle"), se(), e.panelOpen && z();
247
+ r("idle"), se(), e.panelOpen && V();
248
248
  }
249
249
  }
250
250
  async function _() {
@@ -263,24 +263,24 @@ function Fe(t) {
263
263
  }
264
264
  return typeof document < "u" && (e.visibilityHandler = m, document.addEventListener("visibilitychange", e.visibilityHandler)), se(), h;
265
265
  }
266
- function y() {
267
- u(), clearTimeout(e.burstTimer), clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null, W(), e.visibilityHandler && (document.removeEventListener("visibilitychange", e.visibilityHandler), e.visibilityHandler = null), e.started = !1;
266
+ function w() {
267
+ u(), clearTimeout(e.burstTimer), clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null, G(), e.visibilityHandler && (document.removeEventListener("visibilitychange", e.visibilityHandler), e.visibilityHandler = null), e.started = !1;
268
268
  }
269
269
  return {
270
270
  on: n,
271
271
  start: _,
272
- stop: y,
273
- setPanelOpen: J,
272
+ stop: w,
273
+ setPanelOpen: X,
274
274
  // REST
275
275
  bootstrap: g,
276
276
  getCustomer: C,
277
- patchCustomer: w,
277
+ patchCustomer: y,
278
278
  listConversations: S,
279
- createConversation: F,
279
+ createConversation: N,
280
280
  getConversation: A,
281
- patchConversation: U,
281
+ patchConversation: D,
282
282
  listMessages: x,
283
- postMessage: j,
283
+ postMessage: U,
284
284
  postCallback: P,
285
285
  uploadAttachment: R,
286
286
  signAttachment: H,
@@ -290,10 +290,10 @@ function Fe(t) {
290
290
  }
291
291
  };
292
292
  }
293
- function De(t) {
293
+ function Fe(t) {
294
294
  return t.endsWith("/") ? t.slice(0, -1) : t;
295
295
  }
296
- function Ne(t) {
296
+ function De(t) {
297
297
  return t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : "file";
298
298
  }
299
299
  function je() {
@@ -344,29 +344,29 @@ function Ue(t) {
344
344
  e.connection = u;
345
345
  })), n.push(t.on("message", (u) => {
346
346
  const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.message;
347
- !m || !(_ != null && _.id) || (z(m, _), _.client_msg_id && delete e.streamingByMsgId[_.client_msg_id], V(m, _.created_at));
347
+ !m || !(_ != null && _.id) || (V(m, _), _.client_msg_id && delete e.streamingByMsgId[_.client_msg_id], q(m, _.created_at));
348
348
  })), n.push(t.on("message_stream", (u) => {
349
349
  const m = u == null ? void 0 : u.message_id, _ = u == null ? void 0 : u.token;
350
350
  !m || typeof _ != "string" || (e.streamingByMsgId[m] = (e.streamingByMsgId[m] || "") + _);
351
351
  })), n.push(t.on("conversation_updated", (u) => {
352
352
  const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.changes;
353
353
  if (!m || !_) return;
354
- const y = e.conversations.findIndex((h) => h.id === m);
355
- y !== -1 && (e.conversations[y] = { ...e.conversations[y], ..._ });
354
+ const w = e.conversations.findIndex((h) => h.id === m);
355
+ w !== -1 && (e.conversations[w] = { ...e.conversations[w], ..._ });
356
356
  })), n.push(t.on("config_updated", (u) => {
357
357
  u != null && u.config && (e.config = u.config);
358
358
  })), n.push(t.on("action_status", (u) => {
359
- const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.action_id, y = u == null ? void 0 : u.action_name;
359
+ const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.action_id, w = u == null ? void 0 : u.action_name;
360
360
  if (!m || !_) return;
361
361
  const h = e.runningActionsByConv[m] || {};
362
- u.state === "running" ? (h[_] = y || _, e.runningActionsByConv[m] = { ...h }) : u.state === "done" && (delete h[_], e.runningActionsByConv[m] = { ...h });
362
+ u.state === "running" ? (h[_] = w || _, e.runningActionsByConv[m] = { ...h }) : u.state === "done" && (delete h[_], e.runningActionsByConv[m] = { ...h });
363
363
  })), n.push(t.on("activity", (u) => {
364
364
  Array.isArray(u == null ? void 0 : u.conversations) && (e.conversations = u.conversations);
365
365
  }));
366
366
  async function o() {
367
367
  try {
368
368
  const u = new Promise(
369
- (_, y) => setTimeout(() => y(new Error("bootstrap timeout (15s) — check baseUrl, CORS, and network")), 15e3)
369
+ (_, w) => setTimeout(() => w(new Error("bootstrap timeout (15s) — check baseUrl, CORS, and network")), 15e3)
370
370
  ), m = await Promise.race([t.start(), u]);
371
371
  e.config = m.config, e.customer = m.customer, e.conversations = await Promise.race([t.listConversations(), u]), e.ready = !0;
372
372
  } catch (u) {
@@ -382,7 +382,7 @@ function Ue(t) {
382
382
  t.stop();
383
383
  }
384
384
  async function s(u) {
385
- const m = de(u);
385
+ const m = ce(u);
386
386
  if (!m) return e.customer;
387
387
  try {
388
388
  const _ = await t.patchCustomer(m);
@@ -393,26 +393,26 @@ function Ue(t) {
393
393
  return e.customer;
394
394
  }
395
395
  async function a(u = {}) {
396
- const m = await t.createConversation(u), _ = e.conversations.findIndex((y) => y.id === m.id);
396
+ const m = await t.createConversation(u), _ = e.conversations.findIndex((w) => w.id === m.id);
397
397
  return _ === -1 ? e.conversations = [m, ...e.conversations] : e.conversations[_] = m, m;
398
398
  }
399
- const d = 50;
399
+ const l = 50;
400
400
  async function g(u) {
401
401
  const m = e.paginationByConv[u];
402
402
  if (!(m != null && m.loaded || m != null && m.loading)) {
403
- w(u, { nextCursor: null, loading: !0, loaded: !1 });
403
+ y(u, { nextCursor: null, loading: !0, loaded: !1 });
404
404
  try {
405
- const _ = await t.listMessages(u, { limit: d }), y = (_ == null ? void 0 : _.messages) ?? [], h = e.messagesByConv[u] || [], f = /* @__PURE__ */ new Set();
406
- for (const v of y)
405
+ const _ = await t.listMessages(u, { limit: l }), w = (_ == null ? void 0 : _.messages) ?? [], h = e.messagesByConv[u] || [], f = /* @__PURE__ */ new Set();
406
+ for (const v of w)
407
407
  (v == null ? void 0 : v.id) != null && f.add(`id:${String(v.id)}`), v != null && v.client_msg_id && f.add(`c:${v.client_msg_id}`);
408
408
  const p = h.filter((v) => !((v == null ? void 0 : v.id) != null && f.has(`id:${String(v.id)}`) || v != null && v.client_msg_id && f.has(`c:${v.client_msg_id}`)));
409
- e.messagesByConv[u] = [...y, ...p].sort(J), w(u, {
409
+ e.messagesByConv[u] = [...w, ...p].sort(X), y(u, {
410
410
  nextCursor: (_ == null ? void 0 : _.next_cursor) ?? null,
411
411
  loading: !1,
412
412
  loaded: !0
413
413
  });
414
414
  } catch (_) {
415
- console.error("[store] openConversation failed", _), w(u, { nextCursor: null, loading: !1, loaded: !1 });
415
+ console.error("[store] openConversation failed", _), y(u, { nextCursor: null, loading: !1, loaded: !1 });
416
416
  }
417
417
  }
418
418
  }
@@ -420,35 +420,35 @@ function Ue(t) {
420
420
  var h;
421
421
  const m = e.paginationByConv[u];
422
422
  if (!m || m.loading || !m.nextCursor) return;
423
- const y = (h = (e.messagesByConv[u] || []).find((f) => f == null ? void 0 : f.created_at)) == null ? void 0 : h.created_at;
424
- if (y) {
425
- w(u, { ...m, loading: !0 });
423
+ const w = (h = (e.messagesByConv[u] || []).find((f) => f == null ? void 0 : f.created_at)) == null ? void 0 : h.created_at;
424
+ if (w) {
425
+ y(u, { ...m, loading: !0 });
426
426
  try {
427
427
  const f = await t.listMessages(u, {
428
- before: y,
429
- limit: d
428
+ before: w,
429
+ limit: l
430
430
  }), p = (f == null ? void 0 : f.messages) ?? [], v = e.messagesByConv[u] || [], T = /* @__PURE__ */ new Set();
431
- for (const I of v)
432
- (I == null ? void 0 : I.id) != null && T.add(`id:${String(I.id)}`), I != null && I.client_msg_id && T.add(`c:${I.client_msg_id}`);
433
- const O = p.filter((I) => !((I == null ? void 0 : I.id) != null && T.has(`id:${String(I.id)}`) || I != null && I.client_msg_id && T.has(`c:${I.client_msg_id}`)));
434
- e.messagesByConv[u] = [...O, ...v], w(u, {
431
+ for (const B of v)
432
+ (B == null ? void 0 : B.id) != null && T.add(`id:${String(B.id)}`), B != null && B.client_msg_id && T.add(`c:${B.client_msg_id}`);
433
+ const O = p.filter((B) => !((B == null ? void 0 : B.id) != null && T.has(`id:${String(B.id)}`) || B != null && B.client_msg_id && T.has(`c:${B.client_msg_id}`)));
434
+ e.messagesByConv[u] = [...O, ...v], y(u, {
435
435
  nextCursor: (f == null ? void 0 : f.next_cursor) ?? null,
436
436
  loading: !1,
437
437
  loaded: !0
438
438
  });
439
439
  } catch (f) {
440
- console.error("[store] loadMore failed", f), w(u, { ...m, loading: !1 });
440
+ console.error("[store] loadMore failed", f), y(u, { ...m, loading: !1 });
441
441
  }
442
442
  }
443
443
  }
444
- function w(u, m) {
444
+ function y(u, m) {
445
445
  e.paginationByConv = { ...e.paginationByConv, [u]: m };
446
446
  }
447
447
  async function S(u, m) {
448
- const _ = await t.patchConversation(u, m), y = e.conversations.findIndex((h) => h.id === u);
449
- y !== -1 && (e.conversations[y] = _);
448
+ const _ = await t.patchConversation(u, m), w = e.conversations.findIndex((h) => h.id === u);
449
+ w !== -1 && (e.conversations[w] = _);
450
450
  }
451
- async function F(u, m, { attachments: _, metadata: y } = {}) {
451
+ async function N(u, m, { attachments: _, metadata: w } = {}) {
452
452
  var O;
453
453
  const h = (m || "").trim(), f = Array.isArray(_) && _.length > 0;
454
454
  if (!u || !h && !f) return;
@@ -466,33 +466,33 @@ function Ue(t) {
466
466
  // Local-only flag — UI may render dimmed until the SSE echo lands.
467
467
  _pending: !0,
468
468
  ...f ? { payload: { type: "content", attachments: _ } } : {},
469
- ...y && typeof y == "object" ? { metadata: y } : {}
469
+ ...w && typeof w == "object" ? { metadata: w } : {}
470
470
  };
471
- z(u, T);
471
+ V(u, T);
472
472
  try {
473
473
  await t.postMessage(u, {
474
474
  client_msg_id: p,
475
475
  text_md: h,
476
476
  created_at: v,
477
477
  ...f ? { attachments: _ } : {},
478
- ...y && typeof y == "object" ? { metadata: y } : {}
478
+ ...w && typeof w == "object" ? { metadata: w } : {}
479
479
  });
480
- } catch (I) {
481
- console.error("[store] send failed", I), W(u, p, { _failed: !0, _pending: !1 });
480
+ } catch (B) {
481
+ console.error("[store] send failed", B), G(u, p, { _failed: !0, _pending: !1 });
482
482
  }
483
483
  }
484
484
  async function A(u, m, _) {
485
485
  u != null && (e.awaitingCallback[u] = !0);
486
486
  try {
487
487
  await t.postCallback(u, m, _);
488
- } catch (y) {
489
- console.error("[store] callback failed", y), u != null && delete e.awaitingCallback[u];
488
+ } catch (w) {
489
+ console.error("[store] callback failed", w), u != null && delete e.awaitingCallback[u];
490
490
  }
491
491
  }
492
- const U = /* @__PURE__ */ new Map();
492
+ const D = /* @__PURE__ */ new Map();
493
493
  async function x(u) {
494
494
  if (!u) return null;
495
- const m = U.get(u);
495
+ const m = D.get(u);
496
496
  if (m != null && m.url) {
497
497
  const _ = m.expires_at ? Date.parse(m.expires_at) : 0;
498
498
  if (!_ || _ - Date.now() > 6e4) return m.url;
@@ -500,15 +500,15 @@ function Ue(t) {
500
500
  try {
501
501
  const _ = await t.signAttachment(u);
502
502
  if (_ != null && _.signed_url)
503
- return U.set(u, { url: _.signed_url, expires_at: _.expires_at }), _.signed_url;
503
+ return D.set(u, { url: _.signed_url, expires_at: _.expires_at }), _.signed_url;
504
504
  } catch (_) {
505
505
  console.error("[store] sign attachment failed", _);
506
506
  }
507
507
  return null;
508
508
  }
509
- async function j(u, { rating: m, comment: _ } = {}) {
510
- const y = e.conversations.find((p) => p.id === u), f = {
511
- ...(y == null ? void 0 : y.metadata) || {},
509
+ async function U(u, { rating: m, comment: _ } = {}) {
510
+ const w = e.conversations.find((p) => p.id === u), f = {
511
+ ...(w == null ? void 0 : w.metadata) || {},
512
512
  feedback: {
513
513
  rating: m,
514
514
  comment: _ || null,
@@ -518,21 +518,21 @@ function Ue(t) {
518
518
  await S(u, { metadata: f });
519
519
  }
520
520
  function P(u) {
521
- var _, y;
521
+ var _, w;
522
522
  const m = e.messagesByConv[u] || [];
523
523
  for (let h = m.length - 1; h >= 0; h--) {
524
524
  const f = m[h];
525
- if ((f == null ? void 0 : f.type) === "action" && ((_ = f == null ? void 0 : f.payload) == null ? void 0 : _.type) === "action" && ((y = f == null ? void 0 : f.payload) == null ? void 0 : y.state) === "pending" && Array.isArray(f == null ? void 0 : f.callbacks) && f.callbacks.length > 0 && !e.awaitingCallback[f.id])
525
+ if ((f == null ? void 0 : f.type) === "action" && ((_ = f == null ? void 0 : f.payload) == null ? void 0 : _.type) === "action" && ((w = f == null ? void 0 : f.payload) == null ? void 0 : w.state) === "pending" && Array.isArray(f == null ? void 0 : f.callbacks) && f.callbacks.length > 0 && !e.awaitingCallback[f.id])
526
526
  return f;
527
527
  }
528
528
  return null;
529
529
  }
530
530
  function R(u) {
531
- var _, y, h;
531
+ var _, w, h;
532
532
  const m = e.messagesByConv[u] || [];
533
533
  for (let f = m.length - 1; f >= 0; f--) {
534
534
  const p = m[f];
535
- if (((_ = p == null ? void 0 : p.author) == null ? void 0 : _.type) === "user" || (p == null ? void 0 : p.type) === "action" && ((y = p == null ? void 0 : p.payload) == null ? void 0 : y.state) === "pending") return null;
535
+ if (((_ = p == null ? void 0 : p.author) == null ? void 0 : _.type) === "user" || (p == null ? void 0 : p.type) === "action" && ((w = p == null ? void 0 : p.payload) == null ? void 0 : w.state) === "pending") return null;
536
536
  const v = (h = p == null ? void 0 : p.metadata) == null ? void 0 : h.form;
537
537
  if (v && Array.isArray(v.fields) && v.fields.length > 0)
538
538
  return { message: p, form: v };
@@ -544,74 +544,74 @@ function Ue(t) {
544
544
  if (!m) return null;
545
545
  const _ = Object.keys(m);
546
546
  if (_.length === 0) return null;
547
- const y = _[0];
548
- return { id: y, payload: { name: m[y] } };
547
+ const w = _[0];
548
+ return { id: w, payload: { name: m[w] } };
549
549
  }
550
- function Y(u) {
551
- var _, y, h, f;
550
+ function J(u) {
551
+ var _, w, h, f;
552
552
  const m = e.messagesByConv[u] || [];
553
553
  for (let p = m.length - 1; p >= 0; p--) {
554
554
  const v = m[p];
555
555
  if (((_ = v == null ? void 0 : v.author) == null ? void 0 : _.type) === "user") return [];
556
- if ((v == null ? void 0 : v.type) === "action" && ((y = v == null ? void 0 : v.payload) == null ? void 0 : y.state) === "pending") return [];
556
+ if ((v == null ? void 0 : v.type) === "action" && ((w = v == null ? void 0 : v.payload) == null ? void 0 : w.state) === "pending") return [];
557
557
  if (((h = v == null ? void 0 : v.author) == null ? void 0 : h.type) !== "agent_ia") continue;
558
558
  const T = (f = v == null ? void 0 : v.metadata) == null ? void 0 : f.suggested_replies;
559
559
  return Array.isArray(T) && T.length ? T.map((O) => {
560
560
  if (typeof O == "string") {
561
- const I = O.trim();
562
- return I ? { label: I, kind: null } : null;
561
+ const B = O.trim();
562
+ return B ? { label: B, kind: null } : null;
563
563
  }
564
564
  if (O && typeof O == "object" && typeof O.label == "string") {
565
- const I = O.label.trim();
566
- if (!I) return null;
565
+ const B = O.label.trim();
566
+ if (!B) return null;
567
567
  const Ae = O.kind === "cta" || O.kind === "choice" || O.kind === "followup" ? O.kind : null;
568
- return { label: I, kind: Ae };
568
+ return { label: B, kind: Ae };
569
569
  }
570
570
  return null;
571
571
  }).filter(Boolean).slice(0, 4) : [];
572
572
  }
573
573
  return [];
574
574
  }
575
- function z(u, m) {
575
+ function V(u, m) {
576
576
  var f;
577
577
  const _ = e.messagesByConv[u] || [];
578
- let y = -1;
579
- m != null && m.client_msg_id && (y = _.findIndex(
578
+ let w = -1;
579
+ m != null && m.client_msg_id && (w = _.findIndex(
580
580
  (p) => (p == null ? void 0 : p.client_msg_id) && p.client_msg_id === m.client_msg_id
581
- )), y === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (y = _.findIndex((p) => Q(p == null ? void 0 : p.id, m.id)));
581
+ )), w === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (w = _.findIndex((p) => Q(p == null ? void 0 : p.id, m.id)));
582
582
  let h;
583
- y === -1 ? h = [..._, m].sort(J) : (h = _.slice(), h[y] = { ..._[y], ...m, _pending: !1, _failed: !1 }), e.messagesByConv[u] = h, (m == null ? void 0 : m.type) === "action" && ((f = m == null ? void 0 : m.payload) != null && f.state) && m.payload.state !== "pending" && (m == null ? void 0 : m.id) != null && e.awaitingCallback[m.id] && delete e.awaitingCallback[m.id];
583
+ w === -1 ? h = [..._, m].sort(X) : (h = _.slice(), h[w] = { ..._[w], ...m, _pending: !1, _failed: !1 }), e.messagesByConv[u] = h, (m == null ? void 0 : m.type) === "action" && ((f = m == null ? void 0 : m.payload) != null && f.state) && m.payload.state !== "pending" && (m == null ? void 0 : m.id) != null && e.awaitingCallback[m.id] && delete e.awaitingCallback[m.id];
584
584
  }
585
585
  function Q(u, m) {
586
586
  return u === m ? !0 : u == null || m == null ? !1 : String(u) === String(m);
587
587
  }
588
- function W(u, m, _) {
589
- const y = e.messagesByConv[u];
590
- if (!y) return;
591
- const h = y.findIndex((p) => p.id === m);
588
+ function G(u, m, _) {
589
+ const w = e.messagesByConv[u];
590
+ if (!w) return;
591
+ const h = w.findIndex((p) => p.id === m);
592
592
  if (h === -1) return;
593
- const f = y.slice();
594
- f[h] = { ...y[h], ..._ }, e.messagesByConv[u] = f;
593
+ const f = w.slice();
594
+ f[h] = { ...w[h], ..._ }, e.messagesByConv[u] = f;
595
595
  }
596
- function V(u, m) {
596
+ function q(u, m) {
597
597
  const _ = e.conversations.findIndex((h) => h.id === u);
598
598
  if (_ === -1) return;
599
- const y = e.conversations[_];
600
- if (m && (!y.last_message_at || m > y.last_message_at)) {
599
+ const w = e.conversations[_];
600
+ if (m && (!w.last_message_at || m > w.last_message_at)) {
601
601
  const h = e.conversations.slice();
602
- h[_] = { ...y, last_message_at: m }, h.sort(
602
+ h[_] = { ...w, last_message_at: m }, h.sort(
603
603
  (f, p) => (p.last_message_at || "").localeCompare(f.last_message_at || "")
604
604
  ), e.conversations = h;
605
605
  }
606
606
  }
607
- function J(u, m) {
607
+ function X(u, m) {
608
608
  return (u.created_at || "").localeCompare(m.created_at || "");
609
609
  }
610
- function de(u) {
610
+ function ce(u) {
611
611
  if (!u || typeof u != "object") return null;
612
612
  const m = {}, _ = {};
613
- for (const [y, h] of Object.entries(u))
614
- h !== void 0 && (y === "name" || y === "email" ? h != null && String(h).trim() !== "" && (m[y] = h) : (y === "values" || y === "metadata") && h && typeof h == "object" ? Object.assign(_, h) : _[y] = h);
613
+ for (const [w, h] of Object.entries(u))
614
+ h !== void 0 && (w === "name" || w === "email" ? h != null && String(h).trim() !== "" && (m[w] = h) : (w === "values" || w === "metadata") && h && typeof h == "object" ? Object.assign(_, h) : _[w] = h);
615
615
  return Object.keys(_).length && (m.values = _), Object.keys(m).length ? m : null;
616
616
  }
617
617
  function se(u) {
@@ -619,8 +619,8 @@ function Ue(t) {
619
619
  let _ = "";
620
620
  for (const f of m)
621
621
  f != null && f.created_at && f.created_at > _ && (_ = f.created_at);
622
- const y = (/* @__PURE__ */ new Date()).toISOString();
623
- return !_ || y > _ ? y : new Date(Date.parse(_) + 1).toISOString();
622
+ const w = (/* @__PURE__ */ new Date()).toISOString();
623
+ return !_ || w > _ ? w : new Date(Date.parse(_) + 1).toISOString();
624
624
  }
625
625
  return {
626
626
  state: e,
@@ -631,19 +631,19 @@ function Ue(t) {
631
631
  openConversation: g,
632
632
  loadMore: C,
633
633
  patchConversation: S,
634
- send: F,
634
+ send: N,
635
635
  clickCallback: A,
636
636
  signAttachment: x,
637
- submitFeedback: j,
637
+ submitFeedback: U,
638
638
  getPendingApproval: P,
639
639
  getActionInFlight: H,
640
- getLatestSuggestions: Y,
640
+ getLatestSuggestions: J,
641
641
  getLatestForm: R,
642
642
  // Pass-through for panel open/close (controls SSE burst).
643
643
  setPanelOpen: t.setPanelOpen
644
644
  };
645
645
  }
646
- const N = {
646
+ const j = {
647
647
  w: "#ffffff",
648
648
  g50: "#F9F9F7",
649
649
  g100: "#F2F1EE",
@@ -659,14 +659,14 @@ const N = {
659
659
  green: "#22C55E",
660
660
  red: "#B91C1C",
661
661
  redBg: "#FDECEC"
662
- }, ce = ["#5B5FEF", "#7C3AED", "#DB2777", "#0891B2", "#D97706", "#059669"];
663
- function ye(t = "") {
664
- return t ? ce[t.charCodeAt(0) % ce.length] : ce[0];
665
- }
662
+ }, ue = ["#5B5FEF", "#7C3AED", "#DB2777", "#0891B2", "#D97706", "#059669"];
666
663
  function we(t = "") {
664
+ return t ? ue[t.charCodeAt(0) % ue.length] : ue[0];
665
+ }
666
+ function be(t = "") {
667
667
  return t.split(" ").map((e) => e[0] || "").join("").toUpperCase().slice(0, 2);
668
668
  }
669
- function be(t = /* @__PURE__ */ new Date()) {
669
+ function ke(t = /* @__PURE__ */ new Date()) {
670
670
  return t.toLocaleTimeString("fr-FR", { hour: "2-digit", minute: "2-digit" });
671
671
  }
672
672
  const Pe = `
@@ -675,21 +675,21 @@ const Pe = `
675
675
  .wm-root {
676
676
  --wm-f: 'Geist', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
677
677
  --wm-fm: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
678
- --wm-w: ${N.w};
679
- --wm-g50: ${N.g50};
680
- --wm-g100: ${N.g100};
681
- --wm-g150: ${N.g150};
682
- --wm-g200: ${N.g200};
683
- --wm-g300: ${N.g300};
684
- --wm-g400: ${N.g400};
685
- --wm-g500: ${N.g500};
686
- --wm-g700: ${N.g700};
687
- --wm-g900: ${N.g900};
688
- --wm-a: ${N.accent};
689
- --wm-al: ${N.accentLight};
690
- --wm-green: ${N.green};
691
- --wm-red: ${N.red};
692
- --wm-redBg: ${N.redBg};
678
+ --wm-w: ${j.w};
679
+ --wm-g50: ${j.g50};
680
+ --wm-g100: ${j.g100};
681
+ --wm-g150: ${j.g150};
682
+ --wm-g200: ${j.g200};
683
+ --wm-g300: ${j.g300};
684
+ --wm-g400: ${j.g400};
685
+ --wm-g500: ${j.g500};
686
+ --wm-g700: ${j.g700};
687
+ --wm-g900: ${j.g900};
688
+ --wm-a: ${j.accent};
689
+ --wm-al: ${j.accentLight};
690
+ --wm-green: ${j.green};
691
+ --wm-red: ${j.red};
692
+ --wm-redBg: ${j.redBg};
693
693
  --wm-sh1: 0 1px 3px rgba(0,0,0,.06);
694
694
  --wm-sh2: 0 4px 24px rgba(0,0,0,.09), 0 1px 4px rgba(0,0,0,.05);
695
695
  --wm-shPanel: 0 12px 40px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.06);
@@ -721,54 +721,136 @@ const Pe = `
721
721
  n[o] = r;
722
722
  return n;
723
723
  }, ze = {
724
+ name: "WmHumanAvatar",
725
+ props: {
726
+ name: { type: String, default: "" },
727
+ avatarUrl: { type: String, default: null },
728
+ size: { type: Number, default: 26 }
729
+ },
730
+ computed: {
731
+ bg() {
732
+ return this.avatarUrl ? "transparent" : we(this.name);
733
+ },
734
+ initials() {
735
+ return be(this.name);
736
+ }
737
+ }
738
+ }, Ve = ["src", "alt"];
739
+ function qe(t, e, n, o, r, s) {
740
+ return d(), c("div", {
741
+ class: "wm-huav",
742
+ style: z({
743
+ width: n.size + "px",
744
+ height: n.size + "px",
745
+ "--wm-avr": Math.round(n.size * 0.32) + "px",
746
+ background: s.bg
747
+ })
748
+ }, [
749
+ n.avatarUrl ? (d(), c("img", {
750
+ key: 0,
751
+ src: n.avatarUrl,
752
+ alt: n.name || ""
753
+ }, null, 8, Ve)) : (d(), c("span", {
754
+ key: 1,
755
+ style: z({ fontSize: n.size * 0.36 + "px" })
756
+ }, k(s.initials), 5))
757
+ ], 4);
758
+ }
759
+ const he = /* @__PURE__ */ $(ze, [["render", qe], ["__scopeId", "data-v-a772b179"]]), We = 2, Ke = 6, Ge = {
724
760
  name: "WmLauncher",
761
+ components: { HumanAvatar: he },
725
762
  props: {
726
763
  // Nombre de conversations non lues — pilote la pastille.
727
764
  unreadCount: { type: Number, default: 0 },
728
- // Aperçu du dernier message non lu à afficher en étiquette.
729
- // Chaîne vide => pas d'étiquette (launcher normal).
730
- peek: { type: String, default: "" }
765
+ // Notification cards to render. Each entry =
766
+ // `{ convId, senderName, senderAvatarUrl, preview, count, ts }`.
767
+ // Empty array => no card, plain launcher.
768
+ peeks: { type: Array, default: () => [] }
731
769
  },
732
- emits: ["open", "dismiss"]
733
- }, Ve = { class: "wm-launcherWrap" }, qe = { class: "wm-peek__text" }, We = ["aria-label"];
734
- function Ke(t, e, n, o, r, s) {
735
- return l(), c("div", Ve, [
770
+ emits: ["open", "dismiss"],
771
+ computed: {
772
+ behindCount() {
773
+ return Math.min(Math.max(this.peeks.length - 1, 0), We);
774
+ },
775
+ // Top padding the stack reserves for the ghost cards peeking out.
776
+ stackExtra() {
777
+ return this.behindCount * Ke;
778
+ }
779
+ }
780
+ }, Ye = { class: "wm-launcherWrap" }, Je = ["aria-label"], Xe = { class: "wm-peek__avatar" }, Ze = ["aria-label"], Qe = { class: "wm-peek__body" }, et = { class: "wm-peek__head" }, tt = { class: "wm-peek__name" }, nt = { class: "wm-peek__text" }, st = ["aria-label"];
781
+ function rt(t, e, n, o, r, s) {
782
+ const a = I("HumanAvatar");
783
+ return d(), c("div", Ye, [
736
784
  K(xe, { name: "wm-peek" }, {
737
785
  default: Te(() => [
738
- n.peek ? (l(), c("div", {
786
+ n.peeks.length ? (d(), c("div", {
739
787
  key: 0,
740
- class: "wm-peek",
741
- role: "button",
742
- tabindex: "0",
743
- "aria-label": "Ouvrir le messenger sur le dernier message",
744
- onClick: e[1] || (e[1] = (a) => t.$emit("open")),
745
- onKeydown: [
746
- e[2] || (e[2] = ae(Z((a) => t.$emit("open"), ["prevent"]), ["enter"])),
747
- e[3] || (e[3] = ae(Z((a) => t.$emit("open"), ["prevent"]), ["space"]))
748
- ]
788
+ class: "wm-peekStack",
789
+ style: z({ "--wm-stack-extra": s.stackExtra + "px" })
749
790
  }, [
750
- i("p", qe, k(n.peek), 1),
751
- i("button", {
752
- type: "button",
753
- class: "wm-peek__close",
754
- "aria-label": "Ignorer",
755
- onClick: e[0] || (e[0] = Z((a) => t.$emit("dismiss"), ["stop"]))
756
- }, [...e[5] || (e[5] = [
757
- i("svg", {
758
- width: "11",
759
- height: "11",
760
- viewBox: "0 0 24 24",
761
- fill: "none",
762
- stroke: "currentColor",
763
- "stroke-width": "2.4",
764
- "stroke-linecap": "round",
765
- "stroke-linejoin": "round",
766
- "aria-hidden": "true"
767
- }, [
768
- i("path", { d: "M18 6L6 18M6 6l12 12" })
769
- ], -1)
770
- ])])
771
- ], 32)) : b("", !0)
791
+ (d(!0), c(M, null, F(s.behindCount, (l) => (d(), c("div", {
792
+ key: `behind-${l}`,
793
+ class: "wm-peek wm-peek--ghost",
794
+ style: z({ "--i": l }),
795
+ "aria-hidden": "true"
796
+ }, null, 4))), 128)),
797
+ i("div", {
798
+ class: "wm-peek wm-peek--top",
799
+ role: "button",
800
+ tabindex: "0",
801
+ "aria-label": `Ouvrir la conversation avec ${n.peeks[0].senderName || "l'agent"}`,
802
+ onClick: e[2] || (e[2] = (l) => t.$emit("open", n.peeks[0].convId)),
803
+ onKeydown: [
804
+ e[3] || (e[3] = oe(Y((l) => t.$emit("open", n.peeks[0].convId), ["prevent"]), ["enter"])),
805
+ e[4] || (e[4] = oe(Y((l) => t.$emit("open", n.peeks[0].convId), ["prevent"]), ["space"]))
806
+ ]
807
+ }, [
808
+ i("button", {
809
+ type: "button",
810
+ class: "wm-peek__close",
811
+ "aria-label": "Ignorer",
812
+ onClick: e[0] || (e[0] = Y((l) => t.$emit("dismiss", n.peeks[0].convId), ["stop"]))
813
+ }, [...e[6] || (e[6] = [
814
+ i("svg", {
815
+ width: "9",
816
+ height: "9",
817
+ viewBox: "0 0 24 24",
818
+ fill: "none",
819
+ stroke: "currentColor",
820
+ "stroke-width": "2.8",
821
+ "stroke-linecap": "round",
822
+ "stroke-linejoin": "round",
823
+ "aria-hidden": "true"
824
+ }, [
825
+ i("path", { d: "M18 6L6 18M6 6l12 12" })
826
+ ], -1)
827
+ ])]),
828
+ i("div", Xe, [
829
+ K(a, {
830
+ name: n.peeks[0].senderName,
831
+ "avatar-url": n.peeks[0].senderAvatarUrl,
832
+ size: 34
833
+ }, null, 8, ["name", "avatar-url"]),
834
+ n.peeks[0].count > 1 ? (d(), c("span", {
835
+ key: 0,
836
+ class: "wm-peek__avatarBadge",
837
+ "aria-label": `${n.peeks[0].count} messages non lus`
838
+ }, k(n.peeks[0].count > 9 ? "9+" : n.peeks[0].count), 9, Ze)) : b("", !0)
839
+ ]),
840
+ i("div", Qe, [
841
+ i("div", et, [
842
+ i("span", tt, k(n.peeks[0].senderName || "Agent"), 1),
843
+ e[7] || (e[7] = i("span", { class: "wm-peek__action" }, " vous a répondu", -1))
844
+ ]),
845
+ i("p", nt, k(n.peeks[0].preview), 1)
846
+ ]),
847
+ i("button", {
848
+ type: "button",
849
+ class: "wm-peek__open",
850
+ onClick: e[1] || (e[1] = Y((l) => t.$emit("open", n.peeks[0].convId), ["stop"]))
851
+ }, "Ouvrir")
852
+ ], 40, Je)
853
+ ], 4)) : b("", !0)
772
854
  ]),
773
855
  _: 1
774
856
  }),
@@ -776,9 +858,9 @@ function Ke(t, e, n, o, r, s) {
776
858
  type: "button",
777
859
  class: "wm-launcher",
778
860
  "aria-label": "Ouvrir le messenger",
779
- onClick: e[4] || (e[4] = (a) => t.$emit("open"))
861
+ onClick: e[5] || (e[5] = (l) => t.$emit("open"))
780
862
  }, [
781
- e[6] || (e[6] = i("svg", {
863
+ e[8] || (e[8] = i("svg", {
782
864
  width: "20",
783
865
  height: "20",
784
866
  viewBox: "0 0 24 24",
@@ -791,15 +873,15 @@ function Ke(t, e, n, o, r, s) {
791
873
  }, [
792
874
  i("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
793
875
  ], -1)),
794
- n.unreadCount > 0 ? (l(), c("span", {
876
+ n.unreadCount > 0 ? (d(), c("span", {
795
877
  key: 0,
796
878
  class: "wm-launcher__badge",
797
879
  "aria-label": `${n.unreadCount} conversation${n.unreadCount > 1 ? "s" : ""} non lue${n.unreadCount > 1 ? "s" : ""}`
798
- }, k(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, We)) : b("", !0)
880
+ }, k(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, st)) : b("", !0)
799
881
  ])
800
882
  ]);
801
883
  }
802
- const Ge = /* @__PURE__ */ $(ze, [["render", Ke], ["__scopeId", "data-v-fabef371"]]), Ye = {
884
+ const it = /* @__PURE__ */ $(Ge, [["render", rt], ["__scopeId", "data-v-e7ea0209"]]), at = {
803
885
  name: "WmAIAvatar",
804
886
  props: {
805
887
  size: { type: Number, default: 26 },
@@ -811,20 +893,20 @@ const Ge = /* @__PURE__ */ $(ze, [["render", Ke], ["__scopeId", "data-v-fabef371
811
893
  // pour garder l'avatar pleinement arrondi.
812
894
  tail: { type: Boolean, default: !1 }
813
895
  }
814
- }, Je = {
896
+ }, ot = {
815
897
  key: 0,
816
898
  class: "wm-aiav__pulse"
817
- }, Xe = ["width", "height"];
818
- function Ze(t, e, n, o, r, s) {
819
- return l(), c("div", {
899
+ }, lt = ["width", "height"];
900
+ function dt(t, e, n, o, r, s) {
901
+ return d(), c("div", {
820
902
  class: E(["wm-aiav", { "wm-aiav--tail": n.tail }]),
821
- style: G({ width: n.size + "px", height: n.size + "px", "--wm-avr": n.size * 0.32 + "px" })
903
+ style: z({ width: n.size + "px", height: n.size + "px", "--wm-avr": n.size * 0.32 + "px" })
822
904
  }, [
823
- n.pulse ? (l(), c("div", Je)) : b("", !0),
905
+ n.pulse ? (d(), c("div", ot)) : b("", !0),
824
906
  i("div", {
825
907
  class: E(["wm-aiav__inner", { "wm-aiav__inner--glow": n.pulse }])
826
908
  }, [
827
- (l(), c("svg", {
909
+ (d(), c("svg", {
828
910
  width: n.size * 0.5,
829
911
  height: n.size * 0.5,
830
912
  viewBox: "0 0 24 24",
@@ -850,47 +932,11 @@ function Ze(t, e, n, o, r, s) {
850
932
  fill: "white",
851
933
  opacity: "0.38"
852
934
  }, null, -1)
853
- ])], 8, Xe))
935
+ ])], 8, lt))
854
936
  ], 2)
855
937
  ], 6);
856
938
  }
857
- const ne = /* @__PURE__ */ $(Ye, [["render", Ze], ["__scopeId", "data-v-8c924688"]]), Qe = {
858
- name: "WmHumanAvatar",
859
- props: {
860
- name: { type: String, default: "" },
861
- avatarUrl: { type: String, default: null },
862
- size: { type: Number, default: 26 }
863
- },
864
- computed: {
865
- bg() {
866
- return this.avatarUrl ? "transparent" : ye(this.name);
867
- },
868
- initials() {
869
- return we(this.name);
870
- }
871
- }
872
- }, et = ["src", "alt"];
873
- function tt(t, e, n, o, r, s) {
874
- return l(), c("div", {
875
- class: "wm-huav",
876
- style: G({
877
- width: n.size + "px",
878
- height: n.size + "px",
879
- "--wm-avr": Math.round(n.size * 0.32) + "px",
880
- background: s.bg
881
- })
882
- }, [
883
- n.avatarUrl ? (l(), c("img", {
884
- key: 0,
885
- src: n.avatarUrl,
886
- alt: n.name || ""
887
- }, null, 8, et)) : (l(), c("span", {
888
- key: 1,
889
- style: G({ fontSize: n.size * 0.36 + "px" })
890
- }, k(s.initials), 5))
891
- ], 4);
892
- }
893
- const ke = /* @__PURE__ */ $(Qe, [["render", tt], ["__scopeId", "data-v-a772b179"]]), nt = {
939
+ const ne = /* @__PURE__ */ $(at, [["render", dt], ["__scopeId", "data-v-8c924688"]]), ct = {
894
940
  name: "WmTeamAvatars",
895
941
  props: {
896
942
  members: { type: Array, default: () => [] },
@@ -906,43 +952,43 @@ const ke = /* @__PURE__ */ $(Qe, [["render", tt], ["__scopeId", "data-v-a772b179
906
952
  },
907
953
  methods: {
908
954
  colorFor(t) {
909
- return t.avatar_url ? "transparent" : ye(t.name || "");
955
+ return t.avatar_url ? "transparent" : we(t.name || "");
910
956
  },
911
957
  initialsFor(t) {
912
- return we(t.name || "");
958
+ return be(t.name || "");
913
959
  }
914
960
  }
915
- }, st = {
961
+ }, ut = {
916
962
  key: 0,
917
963
  class: "wm-team"
918
- }, rt = ["src", "alt"], it = { key: 1 }, at = {
964
+ }, ht = ["src", "alt"], mt = { key: 1 }, ft = {
919
965
  key: 0,
920
966
  class: "wm-team__label"
921
967
  };
922
- function ot(t, e, n, o, r, s) {
923
- return s.visible ? (l(), c("div", st, [
968
+ function _t(t, e, n, o, r, s) {
969
+ return s.visible ? (d(), c("div", ut, [
924
970
  i("div", {
925
971
  class: "wm-team__stack",
926
- style: G({ width: s.stackWidth + "px" })
972
+ style: z({ width: s.stackWidth + "px" })
927
973
  }, [
928
- (l(!0), c(M, null, D(n.members.slice(0, 3), (a, d) => (l(), c("div", {
929
- key: d,
974
+ (d(!0), c(M, null, F(n.members.slice(0, 3), (a, l) => (d(), c("div", {
975
+ key: l,
930
976
  class: "wm-team__pill",
931
- style: G({ left: d * 13 + "px", zIndex: 3 - d, background: s.colorFor(a) })
977
+ style: z({ left: l * 13 + "px", zIndex: 3 - l, background: s.colorFor(a) })
932
978
  }, [
933
- a.avatar_url ? (l(), c("img", {
979
+ a.avatar_url ? (d(), c("img", {
934
980
  key: 0,
935
981
  src: a.avatar_url,
936
982
  alt: a.name || ""
937
- }, null, 8, rt)) : (l(), c("span", it, k(s.initialsFor(a)), 1))
983
+ }, null, 8, ht)) : (d(), c("span", mt, k(s.initialsFor(a)), 1))
938
984
  ], 4))), 128))
939
985
  ], 4),
940
- n.responseLabel ? (l(), c("span", at, k(n.responseLabel), 1)) : b("", !0)
986
+ n.responseLabel ? (d(), c("span", ft, k(n.responseLabel), 1)) : b("", !0)
941
987
  ])) : b("", !0);
942
988
  }
943
- const lt = /* @__PURE__ */ $(nt, [["render", ot], ["__scopeId", "data-v-3659b9c1"]]), dt = {
989
+ const pt = /* @__PURE__ */ $(ct, [["render", _t], ["__scopeId", "data-v-3659b9c1"]]), gt = {
944
990
  name: "WmHeader",
945
- components: { AIAvatar: ne, HumanAvatar: ke, TeamAvatars: lt },
991
+ components: { AIAvatar: ne, HumanAvatar: he, TeamAvatars: pt },
946
992
  props: {
947
993
  title: { type: String, default: "Nouvelle conversation" },
948
994
  escalated: { type: Boolean, default: !1 },
@@ -973,20 +1019,20 @@ const lt = /* @__PURE__ */ $(nt, [["render", ot], ["__scopeId", "data-v-3659b9c1
973
1019
  return this.escalated && this.agentName ? this.agentName : "En ligne";
974
1020
  }
975
1021
  }
976
- }, ct = { class: "wm-header" }, ut = {
1022
+ }, vt = { class: "wm-header" }, yt = {
977
1023
  key: 1,
978
1024
  style: { width: "30px", height: "30px", "flex-shrink": "0" }
979
- }, ht = { class: "wm-header__avatar" }, mt = { class: "wm-header__main" }, ft = { class: "wm-header__title" }, _t = {
1025
+ }, wt = { class: "wm-header__avatar" }, bt = { class: "wm-header__main" }, kt = { class: "wm-header__title" }, Ct = {
980
1026
  key: 0,
981
1027
  class: "wm-header__sub"
982
- }, pt = { class: "wm-header__status" }, gt = {
1028
+ }, At = { class: "wm-header__status" }, St = {
983
1029
  key: 3,
984
1030
  class: "wm-header__fill"
985
- }, vt = { class: "wm-header__actions" };
986
- function yt(t, e, n, o, r, s) {
987
- const a = B("HumanAvatar"), d = B("AIAvatar"), g = B("TeamAvatars");
988
- return l(), c("div", ct, [
989
- n.showBack ? (l(), c("button", {
1031
+ }, xt = { class: "wm-header__actions" };
1032
+ function Tt(t, e, n, o, r, s) {
1033
+ const a = I("HumanAvatar"), l = I("AIAvatar"), g = I("TeamAvatars");
1034
+ return d(), c("div", vt, [
1035
+ n.showBack ? (d(), c("button", {
990
1036
  key: 0,
991
1037
  type: "button",
992
1038
  class: "wm-header__icon",
@@ -1006,36 +1052,36 @@ function yt(t, e, n, o, r, s) {
1006
1052
  }, [
1007
1053
  i("path", { d: "M19 12H5M12 5l-7 7 7 7" })
1008
1054
  ], -1)
1009
- ])])) : (l(), c("div", ut)),
1010
- n.showIdentity ? (l(), c(M, { key: 2 }, [
1011
- i("div", ht, [
1012
- n.escalated ? (l(), L(a, {
1055
+ ])])) : (d(), c("div", yt)),
1056
+ n.showIdentity ? (d(), c(M, { key: 2 }, [
1057
+ i("div", wt, [
1058
+ n.escalated ? (d(), L(a, {
1013
1059
  key: 0,
1014
1060
  name: n.agentName,
1015
1061
  "avatar-url": n.agentAvatarUrl,
1016
1062
  size: 34
1017
- }, null, 8, ["name", "avatar-url"])) : (l(), L(d, {
1063
+ }, null, 8, ["name", "avatar-url"])) : (d(), L(l, {
1018
1064
  key: 1,
1019
1065
  size: 34
1020
1066
  }))
1021
1067
  ]),
1022
- i("div", mt, [
1023
- i("div", ft, k(n.title), 1),
1024
- s.showPresence ? (l(), c("div", _t, [
1025
- s.hasTeam ? (l(), L(g, {
1068
+ i("div", bt, [
1069
+ i("div", kt, k(n.title), 1),
1070
+ s.showPresence ? (d(), c("div", Ct, [
1071
+ s.hasTeam ? (d(), L(g, {
1026
1072
  key: 0,
1027
1073
  members: n.teamMembers,
1028
1074
  "response-label": n.responseLabel
1029
1075
  }, null, 8, ["members", "response-label"])) : b("", !0),
1030
- i("span", pt, [
1076
+ i("span", At, [
1031
1077
  e[4] || (e[4] = i("span", { class: "wm-header__dot" }, null, -1)),
1032
1078
  te(" " + k(s.statusText), 1)
1033
1079
  ])
1034
1080
  ])) : b("", !0)
1035
1081
  ])
1036
- ], 64)) : (l(), c("div", gt)),
1037
- i("div", vt, [
1038
- n.showMore ? (l(), c("button", {
1082
+ ], 64)) : (d(), c("div", St)),
1083
+ i("div", xt, [
1084
+ n.showMore ? (d(), c("button", {
1039
1085
  key: 0,
1040
1086
  type: "button",
1041
1087
  class: E(["wm-header__icon", { "wm-header__icon--active": n.moreActive }]),
@@ -1067,7 +1113,7 @@ function yt(t, e, n, o, r, s) {
1067
1113
  })
1068
1114
  ], -1)
1069
1115
  ])], 2)) : b("", !0),
1070
- n.showClose ? (l(), c("button", {
1116
+ n.showClose ? (d(), c("button", {
1071
1117
  key: 1,
1072
1118
  type: "button",
1073
1119
  class: "wm-header__icon",
@@ -1092,13 +1138,13 @@ function yt(t, e, n, o, r, s) {
1092
1138
  ])
1093
1139
  ]);
1094
1140
  }
1095
- const wt = /* @__PURE__ */ $(dt, [["render", yt], ["__scopeId", "data-v-b5f5f6a9"]]), _e = {
1141
+ const Mt = /* @__PURE__ */ $(gt, [["render", Tt], ["__scopeId", "data-v-b5f5f6a9"]]), pe = {
1096
1142
  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",
1097
1143
  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",
1098
1144
  status: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",
1099
1145
  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",
1100
1146
  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"
1101
- }, bt = {
1147
+ }, Ot = {
1102
1148
  name: "WmOnboarding",
1103
1149
  components: { AIAvatar: ne },
1104
1150
  props: {
@@ -1120,15 +1166,30 @@ Je réponds en quelques secondes.`;
1120
1166
  },
1121
1167
  methods: {
1122
1168
  iconPath(t) {
1123
- return _e[t] || _e.link;
1169
+ return pe[t] || pe.link;
1170
+ },
1171
+ formatTs(t) {
1172
+ if (!t) return "";
1173
+ const e = new Date(t);
1174
+ if (Number.isNaN(e.getTime())) return "";
1175
+ const n = /* @__PURE__ */ new Date();
1176
+ if (e.toDateString() === n.toDateString()) {
1177
+ const s = String(e.getHours()).padStart(2, "0"), a = String(e.getMinutes()).padStart(2, "0");
1178
+ return `${s}h${a}`;
1179
+ }
1180
+ if (n.getTime() - e.getTime() < 7 * 864e5) {
1181
+ const s = e.toLocaleDateString("fr-FR", { weekday: "short" });
1182
+ return s.charAt(0).toUpperCase() + s.slice(1);
1183
+ }
1184
+ return e.toLocaleDateString("fr-FR", { day: "2-digit", month: "2-digit" });
1124
1185
  }
1125
1186
  }
1126
- }, kt = { class: "wm-onb" }, Ct = { class: "wm-onb__hero" }, At = { class: "wm-onb__title" }, St = { class: "wm-onb__sub" }, xt = {
1187
+ }, It = { class: "wm-onb" }, Bt = { class: "wm-onb__hero" }, Et = { class: "wm-onb__title" }, $t = { class: "wm-onb__sub" }, Nt = {
1127
1188
  key: 0,
1128
1189
  class: "wm-onb__section"
1129
- }, Tt = { class: "wm-onb__links" }, Mt = ["onClick"], Ot = { class: "wm-onb__link-icon" }, It = {
1130
- width: "14",
1131
- height: "14",
1190
+ }, Lt = { class: "wm-onb__grid" }, Rt = ["onClick"], Ft = { class: "wm-onb__card-icon" }, Dt = {
1191
+ width: "16",
1192
+ height: "16",
1132
1193
  viewBox: "0 0 24 24",
1133
1194
  fill: "none",
1134
1195
  stroke: "currentColor",
@@ -1136,110 +1197,104 @@ Je réponds en quelques secondes.`;
1136
1197
  "stroke-linecap": "round",
1137
1198
  "stroke-linejoin": "round",
1138
1199
  "aria-hidden": "true"
1139
- }, Bt = ["d"], Et = { class: "wm-onb__link-label" }, $t = {
1200
+ }, jt = ["d"], Ut = { class: "wm-onb__card-title" }, Pt = {
1201
+ key: 0,
1202
+ class: "wm-onb__card-sub"
1203
+ }, Ht = {
1140
1204
  key: 1,
1141
1205
  class: "wm-onb__section"
1142
- }, Lt = { class: "wm-onb__links" }, Rt = ["onClick"], Ft = {
1206
+ }, zt = { class: "wm-onb__list" }, Vt = ["onClick"], qt = { class: "wm-onb__thread-icon" }, Wt = {
1143
1207
  key: 0,
1144
- class: "wm-onb__resume-dot",
1208
+ class: "wm-onb__thread-dot",
1145
1209
  "aria-label": "Non lu"
1146
- }, Dt = { class: "wm-onb__resume-body" }, Nt = { class: "wm-onb__resume-title" }, jt = { class: "wm-onb__resume-preview" }, Ut = { class: "wm-onb__cta" }, Pt = ["disabled"];
1147
- function Ht(t, e, n, o, r, s) {
1148
- const a = B("AIAvatar");
1149
- return l(), c("div", kt, [
1150
- i("div", Ct, [
1210
+ }, Kt = { class: "wm-onb__thread-body" }, Gt = { class: "wm-onb__thread-title" }, Yt = { class: "wm-onb__thread-preview" }, Jt = { class: "wm-onb__thread-meta" }, Xt = {
1211
+ key: 0,
1212
+ class: "wm-onb__thread-time"
1213
+ }, Zt = { class: "wm-onb__cta" }, Qt = ["disabled"];
1214
+ function en(t, e, n, o, r, s) {
1215
+ const a = I("AIAvatar");
1216
+ return d(), c("div", It, [
1217
+ i("div", Bt, [
1151
1218
  K(a, {
1152
1219
  size: 56,
1153
1220
  pulse: !0
1154
1221
  }),
1155
- i("div", At, k(s.heroTitle), 1),
1156
- i("div", St, k(s.heroSub), 1)
1222
+ i("div", Et, k(s.heroTitle), 1),
1223
+ i("div", $t, k(s.heroSub), 1)
1157
1224
  ]),
1158
- n.quickLinks.length ? (l(), c("div", xt, [
1159
- e[3] || (e[3] = i("div", { class: "wm-onb__section-title" }, "Accès rapide", -1)),
1160
- i("div", Tt, [
1161
- (l(!0), c(M, null, D(n.quickLinks, (d, g) => (l(), c("button", {
1225
+ n.quickLinks.length ? (d(), c("div", Nt, [
1226
+ e[2] || (e[2] = i("div", { class: "wm-onb__section-title" }, "Accès rapide", -1)),
1227
+ i("div", Lt, [
1228
+ (d(!0), c(M, null, F(n.quickLinks, (l, g) => (d(), c("button", {
1162
1229
  key: g,
1163
1230
  type: "button",
1164
- class: "wm-onb__link",
1165
- onClick: (C) => t.$emit("select", d)
1231
+ class: "wm-onb__card",
1232
+ onClick: (C) => t.$emit("select", l)
1166
1233
  }, [
1167
- i("span", Ot, [
1168
- (l(), c("svg", It, [
1234
+ i("span", Ft, [
1235
+ (d(), c("svg", Dt, [
1169
1236
  i("path", {
1170
- d: s.iconPath(d.icon)
1171
- }, null, 8, Bt)
1237
+ d: s.iconPath(l.icon)
1238
+ }, null, 8, jt)
1172
1239
  ]))
1173
1240
  ]),
1174
- i("span", Et, k(d.label), 1),
1175
- e[2] || (e[2] = i("svg", {
1176
- width: "13",
1177
- height: "13",
1178
- viewBox: "0 0 24 24",
1179
- fill: "none",
1180
- stroke: "currentColor",
1181
- "stroke-width": "1.8",
1182
- "stroke-linecap": "round",
1183
- "stroke-linejoin": "round",
1184
- class: "wm-onb__link-chev",
1185
- "aria-hidden": "true"
1186
- }, [
1187
- i("path", { d: "M9 18l6-6-6-6" })
1188
- ], -1))
1189
- ], 8, Mt))), 128))
1241
+ i("span", Ut, k(l.label), 1),
1242
+ l.description ? (d(), c("span", Pt, k(l.description), 1)) : b("", !0)
1243
+ ], 8, Rt))), 128))
1190
1244
  ])
1191
1245
  ])) : b("", !0),
1192
- n.openThreads.length ? (l(), c("div", $t, [
1193
- e[7] || (e[7] = i("div", { class: "wm-onb__section-title" }, "Vos conversations", -1)),
1194
- i("div", Lt, [
1195
- (l(!0), c(M, null, D(n.openThreads, (d) => (l(), c("button", {
1196
- key: d.id,
1246
+ n.openThreads.length ? (d(), c("div", Ht, [
1247
+ e[6] || (e[6] = i("div", { class: "wm-onb__section-title" }, "Conversations récentes", -1)),
1248
+ i("div", zt, [
1249
+ (d(!0), c(M, null, F(n.openThreads, (l) => (d(), c("button", {
1250
+ key: l.id,
1197
1251
  type: "button",
1198
- class: "wm-onb__link wm-onb__resume",
1199
- onClick: (g) => t.$emit("resume", d)
1252
+ class: "wm-onb__thread",
1253
+ onClick: (g) => t.$emit("resume", l)
1200
1254
  }, [
1201
- i("span", {
1202
- class: E(["wm-onb__link-icon", { "wm-onb__resume-icon": d.unread }])
1203
- }, [
1204
- e[4] || (e[4] = i("svg", {
1205
- width: "14",
1206
- height: "14",
1255
+ i("span", qt, [
1256
+ e[3] || (e[3] = i("svg", {
1257
+ width: "18",
1258
+ height: "18",
1207
1259
  viewBox: "0 0 24 24",
1208
1260
  fill: "none",
1209
1261
  stroke: "currentColor",
1210
- "stroke-width": "1.7",
1262
+ "stroke-width": "1.8",
1211
1263
  "stroke-linecap": "round",
1212
1264
  "stroke-linejoin": "round",
1213
1265
  "aria-hidden": "true"
1214
1266
  }, [
1215
- i("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
1267
+ i("path", { d: "M12 5v14M5 12h14" })
1216
1268
  ], -1)),
1217
- d.unread ? (l(), c("span", Ft)) : b("", !0)
1218
- ], 2),
1219
- i("span", Dt, [
1220
- i("span", Nt, k(d.title), 1),
1221
- i("span", jt, k(d.preview), 1)
1269
+ l.unread ? (d(), c("span", Wt)) : b("", !0)
1222
1270
  ]),
1223
- e[5] || (e[5] = i("svg", {
1224
- width: "13",
1225
- height: "13",
1226
- viewBox: "0 0 24 24",
1227
- fill: "none",
1228
- stroke: "currentColor",
1229
- "stroke-width": "1.8",
1230
- "stroke-linecap": "round",
1231
- "stroke-linejoin": "round",
1232
- class: "wm-onb__link-chev",
1233
- "aria-hidden": "true"
1234
- }, [
1235
- i("path", { d: "M9 18l6-6-6-6" })
1236
- ], -1))
1237
- ], 8, Rt))), 128)),
1271
+ i("span", Kt, [
1272
+ i("span", Gt, k(l.title), 1),
1273
+ i("span", Yt, k(l.preview), 1)
1274
+ ]),
1275
+ i("span", Jt, [
1276
+ s.formatTs(l._ts) ? (d(), c("span", Xt, k(s.formatTs(l._ts)), 1)) : b("", !0),
1277
+ e[4] || (e[4] = i("svg", {
1278
+ width: "13",
1279
+ height: "13",
1280
+ viewBox: "0 0 24 24",
1281
+ fill: "none",
1282
+ stroke: "currentColor",
1283
+ "stroke-width": "1.8",
1284
+ "stroke-linecap": "round",
1285
+ "stroke-linejoin": "round",
1286
+ class: "wm-onb__thread-chev",
1287
+ "aria-hidden": "true"
1288
+ }, [
1289
+ i("path", { d: "M9 18l6-6-6-6" })
1290
+ ], -1))
1291
+ ])
1292
+ ], 8, Vt))), 128)),
1238
1293
  i("button", {
1239
1294
  type: "button",
1240
1295
  class: "wm-onb__viewAll",
1241
- onClick: e[0] || (e[0] = (d) => t.$emit("view-all"))
1242
- }, [...e[6] || (e[6] = [
1296
+ onClick: e[0] || (e[0] = (l) => t.$emit("view-all"))
1297
+ }, [...e[5] || (e[5] = [
1243
1298
  te(" Voir toutes les conversations ", -1),
1244
1299
  i("svg", {
1245
1300
  width: "12",
@@ -1257,21 +1312,21 @@ function Ht(t, e, n, o, r, s) {
1257
1312
  ])])
1258
1313
  ])
1259
1314
  ])) : b("", !0),
1260
- i("div", Ut, [
1315
+ i("div", Zt, [
1261
1316
  i("button", {
1262
1317
  type: "button",
1263
1318
  class: "wm-onb__startBtn",
1264
1319
  disabled: n.busy,
1265
- onClick: e[1] || (e[1] = (d) => t.$emit("start"))
1266
- }, k(n.busy ? "…" : "Commencer une conversation"), 9, Pt)
1320
+ onClick: e[1] || (e[1] = (l) => t.$emit("start"))
1321
+ }, k(n.busy ? "…" : "Commencer une conversation"), 9, Qt)
1267
1322
  ])
1268
1323
  ]);
1269
1324
  }
1270
- const zt = /* @__PURE__ */ $(bt, [["render", Ht], ["__scopeId", "data-v-13584fe8"]]);
1271
- function Vt(t) {
1325
+ const tn = /* @__PURE__ */ $(Ot, [["render", en], ["__scopeId", "data-v-770bfafa"]]);
1326
+ function nn(t) {
1272
1327
  return typeof t != "string" ? "" : t.replace(/`([^`]+)`/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(new RegExp("(?<!\\*)\\*([^*]+)\\*(?!\\*)", "g"), "$1").replace(/__([^_]+)__/g, "$1").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/\s+/g, " ").trim();
1273
1328
  }
1274
- const qt = {
1329
+ const sn = {
1275
1330
  name: "WmActionResult",
1276
1331
  props: {
1277
1332
  state: { type: String, default: "success" },
@@ -1281,13 +1336,13 @@ const qt = {
1281
1336
  },
1282
1337
  computed: {
1283
1338
  detailText() {
1284
- return Vt(this.detail);
1339
+ return nn(this.detail);
1285
1340
  }
1286
1341
  }
1287
- }, Wt = {
1342
+ }, rn = {
1288
1343
  class: "wm-result__icon",
1289
1344
  "aria-hidden": "true"
1290
- }, Kt = {
1345
+ }, an = {
1291
1346
  key: 0,
1292
1347
  width: "11",
1293
1348
  height: "11",
@@ -1297,7 +1352,7 @@ const qt = {
1297
1352
  "stroke-width": "2.8",
1298
1353
  "stroke-linecap": "round",
1299
1354
  "stroke-linejoin": "round"
1300
- }, Gt = {
1355
+ }, on = {
1301
1356
  key: 1,
1302
1357
  width: "11",
1303
1358
  height: "11",
@@ -1307,7 +1362,7 @@ const qt = {
1307
1362
  "stroke-width": "2.6",
1308
1363
  "stroke-linecap": "round",
1309
1364
  "stroke-linejoin": "round"
1310
- }, Yt = {
1365
+ }, ln = {
1311
1366
  key: 2,
1312
1367
  width: "11",
1313
1368
  height: "11",
@@ -1317,7 +1372,7 @@ const qt = {
1317
1372
  "stroke-width": "2.4",
1318
1373
  "stroke-linecap": "round",
1319
1374
  "stroke-linejoin": "round"
1320
- }, Jt = {
1375
+ }, dn = {
1321
1376
  key: 3,
1322
1377
  width: "12",
1323
1378
  height: "12",
@@ -1327,24 +1382,24 @@ const qt = {
1327
1382
  "stroke-width": "2.2",
1328
1383
  "stroke-linecap": "round",
1329
1384
  "stroke-linejoin": "round"
1330
- }, Xt = { class: "wm-result__body" }, Zt = { class: "wm-result__label" }, Qt = { class: "wm-result__detail" };
1331
- function en(t, e, n, o, r, s) {
1332
- return l(), c("div", {
1385
+ }, cn = { class: "wm-result__body" }, un = { class: "wm-result__label" }, hn = { class: "wm-result__detail" };
1386
+ function mn(t, e, n, o, r, s) {
1387
+ return d(), c("div", {
1333
1388
  class: E(["wm-result", `wm-result--${n.state}`])
1334
1389
  }, [
1335
- i("span", Wt, [
1336
- n.state === "success" ? (l(), c("svg", Kt, [...e[0] || (e[0] = [
1390
+ i("span", rn, [
1391
+ n.state === "success" ? (d(), c("svg", an, [...e[0] || (e[0] = [
1337
1392
  i("path", { d: "M20 6L9 17l-5-5" }, null, -1)
1338
- ])])) : n.state === "rejected" ? (l(), c("svg", Gt, [...e[1] || (e[1] = [
1393
+ ])])) : n.state === "rejected" ? (d(), c("svg", on, [...e[1] || (e[1] = [
1339
1394
  i("path", { d: "M18 6L6 18M6 6l12 12" }, null, -1)
1340
- ])])) : n.state === "awaiting" ? (l(), c("svg", Yt, [...e[2] || (e[2] = [
1395
+ ])])) : n.state === "awaiting" ? (d(), c("svg", ln, [...e[2] || (e[2] = [
1341
1396
  i("circle", {
1342
1397
  cx: "12",
1343
1398
  cy: "12",
1344
1399
  r: "10"
1345
1400
  }, null, -1),
1346
1401
  i("polyline", { points: "12 7 12 12 15 14" }, null, -1)
1347
- ])])) : (l(), c("svg", Jt, [...e[3] || (e[3] = [
1402
+ ])])) : (d(), c("svg", dn, [...e[3] || (e[3] = [
1348
1403
  i("path", { d: "M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }, null, -1),
1349
1404
  i("line", {
1350
1405
  x1: "12",
@@ -1360,19 +1415,19 @@ function en(t, e, n, o, r, s) {
1360
1415
  }, null, -1)
1361
1416
  ])]))
1362
1417
  ]),
1363
- i("span", Xt, [
1364
- i("span", Zt, k(n.label), 1),
1365
- s.detailText ? (l(), c(M, { key: 0 }, [
1418
+ i("span", cn, [
1419
+ i("span", un, k(n.label), 1),
1420
+ s.detailText ? (d(), c(M, { key: 0 }, [
1366
1421
  e[4] || (e[4] = i("span", {
1367
1422
  class: "wm-result__sep",
1368
1423
  "aria-hidden": "true"
1369
1424
  }, " · ", -1)),
1370
- i("span", Qt, k(s.detailText), 1)
1425
+ i("span", hn, k(s.detailText), 1)
1371
1426
  ], 64)) : b("", !0)
1372
1427
  ])
1373
1428
  ], 2);
1374
1429
  }
1375
- const tn = /* @__PURE__ */ $(qt, [["render", en], ["__scopeId", "data-v-64a83fb8"]]), nn = {
1430
+ const fn = /* @__PURE__ */ $(sn, [["render", mn], ["__scopeId", "data-v-64a83fb8"]]), _n = {
1376
1431
  name: "WmArtifactFormResponse",
1377
1432
  props: {
1378
1433
  data: { type: Object, required: !0 }
@@ -1383,11 +1438,11 @@ const tn = /* @__PURE__ */ $(qt, [["render", en], ["__scopeId", "data-v-64a83fb8
1383
1438
  return Array.isArray((t = this.data) == null ? void 0 : t.fields) ? this.data.fields : [];
1384
1439
  }
1385
1440
  }
1386
- }, sn = { class: "wm-art wm-art--formResponse" }, rn = { class: "wm-art__head" }, an = { class: "wm-art__title" }, on = { class: "wm-art__body" }, ln = { class: "wm-art__fieldLabel" };
1387
- function dn(t, e, n, o, r, s) {
1388
- return l(), c("div", sn, [
1389
- i("div", rn, [
1390
- i("div", an, k(n.data.title || "Formulaire"), 1),
1441
+ }, pn = { class: "wm-art wm-art--formResponse" }, gn = { class: "wm-art__head" }, vn = { class: "wm-art__title" }, yn = { class: "wm-art__body" }, wn = { class: "wm-art__fieldLabel" };
1442
+ function bn(t, e, n, o, r, s) {
1443
+ return d(), c("div", pn, [
1444
+ i("div", gn, [
1445
+ i("div", vn, k(n.data.title || "Formulaire"), 1),
1391
1446
  e[0] || (e[0] = i("span", { class: "wm-art__badge wm-art__badge--success" }, [
1392
1447
  i("svg", {
1393
1448
  width: "11",
@@ -1405,12 +1460,12 @@ function dn(t, e, n, o, r, s) {
1405
1460
  te(" Envoyé ")
1406
1461
  ], -1))
1407
1462
  ]),
1408
- i("div", on, [
1409
- (l(!0), c(M, null, D(s.fields, (a, d) => (l(), c("div", {
1410
- key: d,
1463
+ i("div", yn, [
1464
+ (d(!0), c(M, null, F(s.fields, (a, l) => (d(), c("div", {
1465
+ key: l,
1411
1466
  class: "wm-art__field"
1412
1467
  }, [
1413
- i("div", ln, k(a.label), 1),
1468
+ i("div", wn, k(a.label), 1),
1414
1469
  i("div", {
1415
1470
  class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": a.multiline }])
1416
1471
  }, k(a.value), 3)
@@ -1418,7 +1473,7 @@ function dn(t, e, n, o, r, s) {
1418
1473
  ])
1419
1474
  ]);
1420
1475
  }
1421
- const cn = /* @__PURE__ */ $(nn, [["render", dn], ["__scopeId", "data-v-ca24a9c9"]]), un = {
1476
+ const kn = /* @__PURE__ */ $(_n, [["render", bn], ["__scopeId", "data-v-ca24a9c9"]]), Cn = {
1422
1477
  name: "WmArtifactInfoCard",
1423
1478
  props: {
1424
1479
  data: { type: Object, required: !0 }
@@ -1433,45 +1488,45 @@ const cn = /* @__PURE__ */ $(nn, [["render", dn], ["__scopeId", "data-v-ca24a9c9
1433
1488
  return !!((t = this.data) != null && t.body) || this.fields.length > 0;
1434
1489
  }
1435
1490
  }
1436
- }, hn = { class: "wm-art wm-art--infoCard" }, mn = {
1491
+ }, An = { class: "wm-art wm-art--infoCard" }, Sn = {
1437
1492
  key: 0,
1438
1493
  class: "wm-art__image"
1439
- }, fn = ["src", "alt"], _n = { class: "wm-art__head" }, pn = { class: "wm-art__headMain" }, gn = { class: "wm-art__title" }, vn = {
1494
+ }, xn = ["src", "alt"], Tn = { class: "wm-art__head" }, Mn = { class: "wm-art__headMain" }, On = { class: "wm-art__title" }, In = {
1440
1495
  key: 0,
1441
1496
  class: "wm-art__subtitle"
1442
- }, yn = {
1497
+ }, Bn = {
1443
1498
  key: 1,
1444
1499
  class: "wm-art__body"
1445
- }, wn = {
1500
+ }, En = {
1446
1501
  key: 0,
1447
1502
  class: "wm-art__text"
1448
- }, bn = { class: "wm-art__fieldLabel" };
1449
- function kn(t, e, n, o, r, s) {
1450
- return l(), c("div", hn, [
1451
- n.data.image_url ? (l(), c("figure", mn, [
1503
+ }, $n = { class: "wm-art__fieldLabel" };
1504
+ function Nn(t, e, n, o, r, s) {
1505
+ return d(), c("div", An, [
1506
+ n.data.image_url ? (d(), c("figure", Sn, [
1452
1507
  i("img", {
1453
1508
  src: n.data.image_url,
1454
1509
  alt: n.data.title || "",
1455
1510
  loading: "lazy"
1456
- }, null, 8, fn)
1511
+ }, null, 8, xn)
1457
1512
  ])) : b("", !0),
1458
- i("div", _n, [
1459
- i("div", pn, [
1460
- i("div", gn, k(n.data.title), 1),
1461
- n.data.subtitle ? (l(), c("div", vn, k(n.data.subtitle), 1)) : b("", !0)
1513
+ i("div", Tn, [
1514
+ i("div", Mn, [
1515
+ i("div", On, k(n.data.title), 1),
1516
+ n.data.subtitle ? (d(), c("div", In, k(n.data.subtitle), 1)) : b("", !0)
1462
1517
  ]),
1463
- n.data.badge && n.data.badge.label ? (l(), c("span", {
1518
+ n.data.badge && n.data.badge.label ? (d(), c("span", {
1464
1519
  key: 0,
1465
1520
  class: E(["wm-art__badge", `wm-art__badge--${n.data.badge.tone || "neutral"}`])
1466
1521
  }, k(n.data.badge.label), 3)) : b("", !0)
1467
1522
  ]),
1468
- s.hasBody ? (l(), c("div", yn, [
1469
- n.data.body ? (l(), c("div", wn, k(n.data.body), 1)) : b("", !0),
1470
- s.fields.length ? (l(!0), c(M, { key: 1 }, D(s.fields, (a, d) => (l(), c("div", {
1471
- key: d,
1523
+ s.hasBody ? (d(), c("div", Bn, [
1524
+ n.data.body ? (d(), c("div", En, k(n.data.body), 1)) : b("", !0),
1525
+ s.fields.length ? (d(!0), c(M, { key: 1 }, F(s.fields, (a, l) => (d(), c("div", {
1526
+ key: l,
1472
1527
  class: "wm-art__field"
1473
1528
  }, [
1474
- i("div", bn, k(a.label), 1),
1529
+ i("div", $n, k(a.label), 1),
1475
1530
  i("div", {
1476
1531
  class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": a.multiline }])
1477
1532
  }, k(a.value), 3)
@@ -1479,15 +1534,15 @@ function kn(t, e, n, o, r, s) {
1479
1534
  ])) : b("", !0)
1480
1535
  ]);
1481
1536
  }
1482
- const Cn = /* @__PURE__ */ $(un, [["render", kn], ["__scopeId", "data-v-d7369333"]]);
1483
- function An(t) {
1537
+ const Ln = /* @__PURE__ */ $(Cn, [["render", Nn], ["__scopeId", "data-v-d7369333"]]);
1538
+ function Rn(t) {
1484
1539
  if (!t) return "";
1485
1540
  const e = new Date(t);
1486
1541
  if (Number.isNaN(e.getTime())) return t;
1487
1542
  const n = e.toLocaleDateString("fr-FR", { day: "numeric", month: "long", year: "numeric" }), o = e.toLocaleTimeString("fr-FR", { hour: "2-digit", minute: "2-digit" });
1488
1543
  return `${n} à ${o}`;
1489
1544
  }
1490
- const Sn = {
1545
+ const Fn = {
1491
1546
  name: "WmArtifactTicket",
1492
1547
  props: {
1493
1548
  data: { type: Object, required: !0 }
@@ -1499,7 +1554,7 @@ const Sn = {
1499
1554
  },
1500
1555
  formattedDate() {
1501
1556
  var t;
1502
- return An((t = this.data) == null ? void 0 : t.created_at);
1557
+ return Rn((t = this.data) == null ? void 0 : t.created_at);
1503
1558
  }
1504
1559
  },
1505
1560
  methods: {
@@ -1521,13 +1576,13 @@ const Sn = {
1521
1576
  return /high|haute|élev|elev|critic|critiq|urgent/.test(e) ? 3 : /low|basse|faible|minor/.test(e) ? 1 : 2;
1522
1577
  }
1523
1578
  }
1524
- }, xn = { class: "wm-art wm-art--ticket" }, Tn = { class: "wm-art__head wm-tk__head" }, Mn = { class: "wm-art__title wm-tk__title" }, On = { class: "wm-tk__sub" }, In = { class: "wm-tk__ref" }, Bn = {
1579
+ }, Dn = { class: "wm-art wm-art--ticket" }, jn = { class: "wm-art__head wm-tk__head" }, Un = { class: "wm-art__title wm-tk__title" }, Pn = { class: "wm-tk__sub" }, Hn = { class: "wm-tk__ref" }, zn = {
1525
1580
  key: 0,
1526
1581
  class: "wm-tk__text"
1527
- }, En = {
1582
+ }, Vn = {
1528
1583
  key: 0,
1529
1584
  class: "wm-art__body"
1530
- }, $n = { class: "wm-art__fieldLabel" }, Ln = ["data-level"], Rn = {
1585
+ }, qn = { class: "wm-art__fieldLabel" }, Wn = ["data-level"], Kn = {
1531
1586
  key: 1,
1532
1587
  class: "wm-tk__date",
1533
1588
  width: "12",
@@ -1539,16 +1594,16 @@ const Sn = {
1539
1594
  "stroke-linecap": "round",
1540
1595
  "stroke-linejoin": "round",
1541
1596
  "aria-hidden": "true"
1542
- }, Fn = {
1597
+ }, Gn = {
1543
1598
  key: 1,
1544
1599
  class: "wm-art__footer wm-tk__footer"
1545
1600
  };
1546
- function Dn(t, e, n, o, r, s) {
1547
- return l(), c("div", xn, [
1548
- i("div", Tn, [
1549
- i("div", Mn, k(n.data.title), 1),
1550
- i("div", On, [
1551
- i("div", In, [
1601
+ function Yn(t, e, n, o, r, s) {
1602
+ return d(), c("div", Dn, [
1603
+ i("div", jn, [
1604
+ i("div", Un, k(n.data.title), 1),
1605
+ i("div", Pn, [
1606
+ i("div", Hn, [
1552
1607
  e[0] || (e[0] = i("svg", {
1553
1608
  width: "11",
1554
1609
  height: "11",
@@ -1575,18 +1630,18 @@ function Dn(t, e, n, o, r, s) {
1575
1630
  te(" " + k(n.data.status.label), 1)
1576
1631
  ], 2)
1577
1632
  ]),
1578
- n.data.body ? (l(), c("div", Bn, k(n.data.body), 1)) : b("", !0)
1633
+ n.data.body ? (d(), c("div", zn, k(n.data.body), 1)) : b("", !0)
1579
1634
  ]),
1580
- s.fields.length ? (l(), c("div", En, [
1581
- (l(!0), c(M, null, D(s.fields, (a, d) => (l(), c("div", {
1582
- key: d,
1635
+ s.fields.length ? (d(), c("div", Vn, [
1636
+ (d(!0), c(M, null, F(s.fields, (a, l) => (d(), c("div", {
1637
+ key: l,
1583
1638
  class: "wm-art__field"
1584
1639
  }, [
1585
- i("div", $n, k(a.label), 1),
1640
+ i("div", qn, k(a.label), 1),
1586
1641
  i("div", {
1587
1642
  class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": a.multiline }])
1588
1643
  }, [
1589
- s.isPriority(a.label) ? (l(), c("svg", {
1644
+ s.isPriority(a.label) ? (d(), c("svg", {
1590
1645
  key: 0,
1591
1646
  class: "wm-tk__prio",
1592
1647
  "data-level": s.priorityLevel(a.value),
@@ -1616,7 +1671,7 @@ function Dn(t, e, n, o, r, s) {
1616
1671
  height: "9",
1617
1672
  rx: "0.5"
1618
1673
  }, null, -1)
1619
- ])], 8, Ln)) : s.isDate(a.label) ? (l(), c("svg", Rn, [...e[3] || (e[3] = [
1674
+ ])], 8, Wn)) : s.isDate(a.label) ? (d(), c("svg", Kn, [...e[3] || (e[3] = [
1620
1675
  i("rect", {
1621
1676
  x: "3",
1622
1677
  y: "4",
@@ -1630,7 +1685,7 @@ function Dn(t, e, n, o, r, s) {
1630
1685
  ], 2)
1631
1686
  ]))), 128))
1632
1687
  ])) : b("", !0),
1633
- n.data.created_at ? (l(), c("div", Fn, [
1688
+ n.data.created_at ? (d(), c("div", Gn, [
1634
1689
  e[4] || (e[4] = i("svg", {
1635
1690
  width: "11",
1636
1691
  height: "11",
@@ -1655,11 +1710,11 @@ function Dn(t, e, n, o, r, s) {
1655
1710
  ])) : b("", !0)
1656
1711
  ]);
1657
1712
  }
1658
- const Nn = /* @__PURE__ */ $(Sn, [["render", Dn], ["__scopeId", "data-v-8b274eb7"]]), jn = {
1659
- form_response: cn,
1660
- info_card: Cn,
1661
- ticket: Nn
1662
- }, Un = {
1713
+ const Jn = /* @__PURE__ */ $(Fn, [["render", Yn], ["__scopeId", "data-v-8b274eb7"]]), Xn = {
1714
+ form_response: kn,
1715
+ info_card: Ln,
1716
+ ticket: Jn
1717
+ }, Zn = {
1663
1718
  name: "WmArtifactRenderer",
1664
1719
  props: {
1665
1720
  // Forme : { kind: string, data: any } (le `data` est validé
@@ -1670,17 +1725,17 @@ const Nn = /* @__PURE__ */ $(Sn, [["render", Dn], ["__scopeId", "data-v-8b274eb7
1670
1725
  component() {
1671
1726
  var e;
1672
1727
  const t = (e = this.artifact) == null ? void 0 : e.kind;
1673
- return t && jn[t] || null;
1728
+ return t && Xn[t] || null;
1674
1729
  }
1675
1730
  }
1676
1731
  };
1677
- function Pn(t, e, n, o, r, s) {
1678
- return s.component ? (l(), L(Me(s.component), {
1732
+ function Qn(t, e, n, o, r, s) {
1733
+ return s.component ? (d(), L(Me(s.component), {
1679
1734
  key: 0,
1680
1735
  data: n.artifact.data
1681
1736
  }, null, 8, ["data"])) : b("", !0);
1682
1737
  }
1683
- const Hn = /* @__PURE__ */ $(Un, [["render", Pn]]), zn = {
1738
+ const es = /* @__PURE__ */ $(Zn, [["render", Qn]]), ts = {
1684
1739
  name: "WmAttachmentPreview",
1685
1740
  inject: {
1686
1741
  signAttachmentFn: { default: null }
@@ -1734,19 +1789,19 @@ const Hn = /* @__PURE__ */ $(Un, [["render", Pn]]), zn = {
1734
1789
  this.url || t.preventDefault();
1735
1790
  }
1736
1791
  }
1737
- }, Vn = ["href"], qn = ["src", "alt"], Wn = ["src"], Kn = ["src"], Gn = ["href", "download"], Yn = { class: "wm-att__main" }, Jn = { class: "wm-att__name" }, Xn = {
1792
+ }, ns = ["href"], ss = ["src", "alt"], rs = ["src"], is = ["src"], as = ["href", "download"], os = { class: "wm-att__main" }, ls = { class: "wm-att__name" }, ds = {
1738
1793
  key: 0,
1739
1794
  class: "wm-att__meta"
1740
- }, Zn = {
1795
+ }, cs = {
1741
1796
  key: 0,
1742
1797
  class: "wm-att__spin",
1743
1798
  "aria-hidden": "true"
1744
1799
  };
1745
- function Qn(t, e, n, o, r, s) {
1746
- return l(), c("div", {
1800
+ function us(t, e, n, o, r, s) {
1801
+ return d(), c("div", {
1747
1802
  class: E(["wm-att", ["wm-att--" + (s.kind || "file")]])
1748
1803
  }, [
1749
- s.kind === "image" && r.url ? (l(), c("a", {
1804
+ s.kind === "image" && r.url ? (d(), c("a", {
1750
1805
  key: 0,
1751
1806
  href: r.url,
1752
1807
  target: "_blank",
@@ -1757,18 +1812,18 @@ function Qn(t, e, n, o, r, s) {
1757
1812
  src: r.url,
1758
1813
  alt: s.displayName,
1759
1814
  loading: "lazy"
1760
- }, null, 8, qn)
1761
- ], 8, Vn)) : s.kind === "audio" && r.url ? (l(), c("audio", {
1815
+ }, null, 8, ss)
1816
+ ], 8, ns)) : s.kind === "audio" && r.url ? (d(), c("audio", {
1762
1817
  key: 1,
1763
1818
  src: r.url,
1764
1819
  controls: "",
1765
1820
  preload: "metadata"
1766
- }, null, 8, Wn)) : s.kind === "video" && r.url ? (l(), c("video", {
1821
+ }, null, 8, rs)) : s.kind === "video" && r.url ? (d(), c("video", {
1767
1822
  key: 2,
1768
1823
  src: r.url,
1769
1824
  controls: "",
1770
1825
  preload: "metadata"
1771
- }, null, 8, Kn)) : (l(), c("a", {
1826
+ }, null, 8, is)) : (d(), c("a", {
1772
1827
  key: 3,
1773
1828
  class: "wm-att__file",
1774
1829
  href: r.url || "#",
@@ -1793,33 +1848,33 @@ function Qn(t, e, n, o, r, s) {
1793
1848
  i("path", { d: "M14 2v6h6" })
1794
1849
  ])
1795
1850
  ], -1)),
1796
- i("span", Yn, [
1797
- i("span", Jn, k(s.displayName), 1),
1798
- s.sizeLabel ? (l(), c("span", Xn, k(s.sizeLabel), 1)) : b("", !0)
1851
+ i("span", os, [
1852
+ i("span", ls, k(s.displayName), 1),
1853
+ s.sizeLabel ? (d(), c("span", ds, k(s.sizeLabel), 1)) : b("", !0)
1799
1854
  ]),
1800
- r.loading ? (l(), c("span", Zn)) : b("", !0)
1801
- ], 8, Gn))
1855
+ r.loading ? (d(), c("span", cs)) : b("", !0)
1856
+ ], 8, as))
1802
1857
  ], 2);
1803
1858
  }
1804
- const es = /* @__PURE__ */ $(zn, [["render", Qn], ["__scopeId", "data-v-1cd1267b"]]);
1805
- function ts(t) {
1859
+ const hs = /* @__PURE__ */ $(ts, [["render", us], ["__scopeId", "data-v-1cd1267b"]]);
1860
+ function ms(t) {
1806
1861
  return String(t).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
1807
1862
  }
1808
- function ns(t) {
1863
+ function fs(t) {
1809
1864
  return /^(https?:\/\/|mailto:|tel:)/i.test(String(t).trim());
1810
1865
  }
1811
- const pe = "";
1866
+ const ge = "";
1812
1867
  function re(t) {
1813
1868
  let e = t;
1814
1869
  const n = [];
1815
1870
  return e = e.replace(/`([^`\n]+)`/g, (o, r) => {
1816
1871
  const s = n.length;
1817
- return n.push(r), `${pe}CODE${s}${pe}`;
1818
- }), e = e.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (o, r, s) => ns(s) ? `<a href="${s}" target="_blank" rel="noopener noreferrer">${r}</a>` : r), e = e.replace(/\*\*([^\n*][^\n]*?)\*\*/g, "<strong>$1</strong>"), e = e.replace(/__([^\n_][^\n]*?)__/g, "<u>$1</u>"), e = e.replace(/~~([^\n~][^\n]*?)~~/g, "<s>$1</s>"), e = e.replace(/(^|[^\w*])\*([^\n*]+?)\*(?!\w)/g, "$1<em>$2</em>"), e = e.replace(/(^|[^\w_])_([^\n_]+?)_(?!\w)/g, "$1<em>$2</em>"), e = e.replace(/CODE(\d+)/g, (o, r) => `<code class="wm-md-code">${n[+r]}</code>`), e;
1872
+ return n.push(r), `${ge}CODE${s}${ge}`;
1873
+ }), e = e.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (o, r, s) => fs(s) ? `<a href="${s}" target="_blank" rel="noopener noreferrer">${r}</a>` : r), e = e.replace(/\*\*([^\n*][^\n]*?)\*\*/g, "<strong>$1</strong>"), e = e.replace(/__([^\n_][^\n]*?)__/g, "<u>$1</u>"), e = e.replace(/~~([^\n~][^\n]*?)~~/g, "<s>$1</s>"), e = e.replace(/(^|[^\w*])\*([^\n*]+?)\*(?!\w)/g, "$1<em>$2</em>"), e = e.replace(/(^|[^\w_])_([^\n_]+?)_(?!\w)/g, "$1<em>$2</em>"), e = e.replace(/CODE(\d+)/g, (o, r) => `<code class="wm-md-code">${n[+r]}</code>`), e;
1819
1874
  }
1820
- function ss(t) {
1875
+ function _s(t) {
1821
1876
  if (!t) return "";
1822
- const e = ts(t).split(`
1877
+ const e = ms(t).split(`
1823
1878
  `), n = [];
1824
1879
  let o = 0;
1825
1880
  for (; o < e.length; ) {
@@ -1843,20 +1898,20 @@ function ss(t) {
1843
1898
  if (!S) break;
1844
1899
  C.push(S[1]), o++;
1845
1900
  }
1846
- const w = C.map((S) => `<li>${re(S)}</li>`).join("");
1847
- n.push({ type: "block", html: `<ul class="wm-md-ul">${w}</ul>` });
1901
+ const y = C.map((S) => `<li>${re(S)}</li>`).join("");
1902
+ n.push({ type: "block", html: `<ul class="wm-md-ul">${y}</ul>` });
1848
1903
  continue;
1849
1904
  }
1850
- const d = /^\s*(\d+)\.\s+(.*)$/.exec(s);
1851
- if (d) {
1852
- const C = parseInt(d[1], 10), w = [d[2]];
1905
+ const l = /^\s*(\d+)\.\s+(.*)$/.exec(s);
1906
+ if (l) {
1907
+ const C = parseInt(l[1], 10), y = [l[2]];
1853
1908
  for (o++; o < e.length; ) {
1854
1909
  const A = /^\s*\d+\.\s+(.*)$/.exec(e[o]);
1855
1910
  if (!A) break;
1856
- w.push(A[1]), o++;
1911
+ y.push(A[1]), o++;
1857
1912
  }
1858
- const S = w.map((A) => `<li>${re(A)}</li>`).join(""), F = C !== 1 ? ` start="${C}"` : "";
1859
- n.push({ type: "block", html: `<ol class="wm-md-ol"${F}>${S}</ol>` });
1913
+ const S = y.map((A) => `<li>${re(A)}</li>`).join(""), N = C !== 1 ? ` start="${C}"` : "";
1914
+ n.push({ type: "block", html: `<ol class="wm-md-ol"${N}>${S}</ol>` });
1860
1915
  continue;
1861
1916
  }
1862
1917
  const g = /^(#{1,6})\s+(.*)$/.exec(s);
@@ -1874,13 +1929,13 @@ function ss(t) {
1874
1929
  for (let s = 0; s < n.length; s++) {
1875
1930
  const a = n[s];
1876
1931
  r += a.html;
1877
- const d = n[s + 1];
1878
- d && a.type !== "block" && d.type !== "block" && (r += `
1932
+ const l = n[s + 1];
1933
+ l && a.type !== "block" && l.type !== "block" && (r += `
1879
1934
  `);
1880
1935
  }
1881
1936
  return r;
1882
1937
  }
1883
- const rs = {
1938
+ const ps = {
1884
1939
  name: "WmBubble",
1885
1940
  props: {
1886
1941
  role: { type: String, default: "ai" },
@@ -1889,41 +1944,41 @@ const rs = {
1889
1944
  },
1890
1945
  computed: {
1891
1946
  rendered() {
1892
- return ss(this.text);
1947
+ return _s(this.text);
1893
1948
  }
1894
1949
  }
1895
- }, is = ["innerHTML"];
1896
- function as(t, e, n, o, r, s) {
1897
- return l(), c("div", {
1950
+ }, gs = ["innerHTML"];
1951
+ function vs(t, e, n, o, r, s) {
1952
+ return d(), c("div", {
1898
1953
  class: E(["wm-bubble", "wm-bubble--" + n.role])
1899
1954
  }, [
1900
1955
  Oe(t.$slots, "default", {}, () => [
1901
- i("span", { innerHTML: s.rendered }, null, 8, is)
1956
+ i("span", { innerHTML: s.rendered }, null, 8, gs)
1902
1957
  ], !0)
1903
1958
  ], 2);
1904
1959
  }
1905
- const os = /* @__PURE__ */ $(rs, [["render", as], ["__scopeId", "data-v-5c9e9f2b"]]), ls = { name: "WmTyping" }, ds = { class: "wm-typing" };
1906
- function cs(t, e, n, o, r, s) {
1907
- return l(), c("div", ds, [...e[0] || (e[0] = [
1960
+ const ys = /* @__PURE__ */ $(ps, [["render", vs], ["__scopeId", "data-v-5c9e9f2b"]]), ws = { name: "WmTyping" }, bs = { class: "wm-typing" };
1961
+ function ks(t, e, n, o, r, s) {
1962
+ return d(), c("div", bs, [...e[0] || (e[0] = [
1908
1963
  i("span", { style: { "animation-delay": "0s" } }, null, -1),
1909
1964
  i("span", { style: { "animation-delay": "0.2s" } }, null, -1),
1910
1965
  i("span", { style: { "animation-delay": "0.4s" } }, null, -1)
1911
1966
  ])]);
1912
1967
  }
1913
- const us = /* @__PURE__ */ $(ls, [["render", cs], ["__scopeId", "data-v-df2447fd"]]);
1968
+ const Cs = /* @__PURE__ */ $(ws, [["render", ks], ["__scopeId", "data-v-df2447fd"]]);
1914
1969
  function ee(t) {
1915
1970
  return t ? t.client_msg_id || t.id : "";
1916
1971
  }
1917
- const hs = {
1972
+ const As = {
1918
1973
  transferred_to_human: "Conversation transférée à un humain",
1919
1974
  assigned: "{name} a rejoint la conversation",
1920
1975
  unassigned: "L'agent a quitté la conversation",
1921
1976
  resolved: "Conversation résolue",
1922
1977
  reopened: "Conversation rouverte",
1923
1978
  idle: "Conversation en pause"
1924
- }, ms = 80, fs = 200, _s = {
1979
+ }, Ss = 80, xs = 200, Ts = {
1925
1980
  name: "WmMessageList",
1926
- components: { AIAvatar: ne, HumanAvatar: ke, Bubble: os, Typing: us, ActionResult: tn, AttachmentPreview: es, ArtifactRenderer: Hn },
1981
+ components: { AIAvatar: ne, HumanAvatar: he, Bubble: ys, Typing: Cs, ActionResult: fn, AttachmentPreview: hs, ArtifactRenderer: es },
1927
1982
  props: {
1928
1983
  messages: { type: Array, default: () => [] },
1929
1984
  streamingActive: { type: Boolean, default: !1 },
@@ -1971,11 +2026,11 @@ const hs = {
1971
2026
  var n, o, r, s;
1972
2027
  const t = [];
1973
2028
  for (const a of this.messages) {
1974
- const d = this.roleOf(a);
1975
- if (d === "system") {
2029
+ const l = this.roleOf(a);
2030
+ if (l === "system") {
1976
2031
  if (((n = a == null ? void 0 : a.payload) == null ? void 0 : n.event) === "action_admin_pending") {
1977
- const w = t[t.length - 1];
1978
- w && w.role === "ai" ? w.messages.push(a) : t.push({
2032
+ const y = t[t.length - 1];
2033
+ y && y.role === "ai" ? y.messages.push(a) : t.push({
1979
2034
  key: `g-${ee(a)}`,
1980
2035
  role: "ai",
1981
2036
  agentName: "",
@@ -1987,7 +2042,7 @@ const hs = {
1987
2042
  }
1988
2043
  t.push({
1989
2044
  key: `sys-${ee(a)}`,
1990
- role: d,
2045
+ role: l,
1991
2046
  messages: [a],
1992
2047
  items: [],
1993
2048
  systemLabel: this.systemLabel(a)
@@ -1995,9 +2050,9 @@ const hs = {
1995
2050
  continue;
1996
2051
  }
1997
2052
  const g = t[t.length - 1];
1998
- g && g.role === d && (d === "ai" || g.agentName === (((o = a == null ? void 0 : a.author) == null ? void 0 : o.name) || "")) ? g.messages.push(a) : t.push({
2053
+ g && g.role === l && (l === "ai" || g.agentName === (((o = a == null ? void 0 : a.author) == null ? void 0 : o.name) || "")) ? g.messages.push(a) : t.push({
1999
2054
  key: `g-${ee(a)}`,
2000
- role: d,
2055
+ role: l,
2001
2056
  agentName: ((r = a == null ? void 0 : a.author) == null ? void 0 : r.name) || "",
2002
2057
  agentAvatarUrl: ((s = a == null ? void 0 : a.author) == null ? void 0 : s.avatar_url) || null,
2003
2058
  messages: [a],
@@ -2006,17 +2061,17 @@ const hs = {
2006
2061
  }
2007
2062
  for (const a of t) {
2008
2063
  if (a.role === "system") continue;
2009
- const d = [];
2064
+ const l = [];
2010
2065
  for (const g of a.messages)
2011
- for (const C of this.itemsOf(g)) d.push(C);
2012
- a.items = d;
2066
+ for (const C of this.itemsOf(g)) l.push(C);
2067
+ a.items = l;
2013
2068
  }
2014
2069
  const e = [];
2015
2070
  for (const a of t) {
2016
2071
  if (a.role !== "system" && !a.items.length) continue;
2017
- const d = e[e.length - 1];
2018
- if (d && d.role !== "system" && d.role === a.role && (a.role === "ai" || d.agentName === a.agentName)) {
2019
- d.messages.push(...a.messages), d.items.push(...a.items);
2072
+ const l = e[e.length - 1];
2073
+ if (l && l.role !== "system" && l.role === a.role && (a.role === "ai" || l.agentName === a.agentName)) {
2074
+ l.messages.push(...a.messages), l.items.push(...a.items);
2020
2075
  continue;
2021
2076
  }
2022
2077
  e.push(a);
@@ -2059,11 +2114,11 @@ const hs = {
2059
2114
  methods: {
2060
2115
  messageKey: ee,
2061
2116
  isAtBottom(t) {
2062
- return t.scrollHeight - t.scrollTop - t.clientHeight <= ms;
2117
+ return t.scrollHeight - t.scrollTop - t.clientHeight <= Ss;
2063
2118
  },
2064
2119
  onScroll() {
2065
2120
  const t = this.$refs.scrollEl;
2066
- t && (this.loadingMore || !this.hasMore || this._pendingLoadMore || t.scrollTop <= fs && (this._pendingLoadMore = !0, this.$emit("load-more")));
2121
+ t && (this.loadingMore || !this.hasMore || this._pendingLoadMore || t.scrollTop <= xs && (this._pendingLoadMore = !0, this.$emit("load-more")));
2067
2122
  },
2068
2123
  // Capture pre-patch scroll state and restore it on the next tick.
2069
2124
  //
@@ -2238,10 +2293,10 @@ const hs = {
2238
2293
  // adjacent à une `bubble`) : mon coin déborde le voisin et
2239
2294
  // doit garder son arrondi.
2240
2295
  cornersFor(t, e) {
2241
- var Y, z, Q;
2242
- const n = t.items, o = (Y = n[e]) == null ? void 0 : Y.kind, r = (z = n[e - 1]) == null ? void 0 : z.kind, s = (Q = n[e + 1]) == null ? void 0 : Q.kind, a = t.role === "user", d = 14, g = 4, C = r == null ? void 0 : r.bottom, w = s == null ? void 0 : s.top, S = this.widthByKey[this.rowKeyOf(t, e)], F = this.widthByKey[this.rowKeyOf(t, e - 1)], A = this.widthByKey[this.rowKeyOf(t, e + 1)], U = 0.5, x = (W, V, J) => W != null && S != null ? W + U >= S : V === J || V === "card" && J === "bubble";
2243
- let j = d, P = d, R = d, H = d;
2244
- return a ? (C && (P = g), (w || !s) && (R = g), C && x(F, C, o == null ? void 0 : o.top) && (j = g), w && x(A, w, o == null ? void 0 : o.bottom) && (H = g)) : (C && (j = g), (w || !s) && (H = g), C && x(F, C, o == null ? void 0 : o.top) && (P = g), w && x(A, w, o == null ? void 0 : o.bottom) && (R = g)), { tl: j, tr: P, br: R, bl: H };
2296
+ var J, V, Q;
2297
+ const n = t.items, o = (J = n[e]) == null ? void 0 : J.kind, r = (V = n[e - 1]) == null ? void 0 : V.kind, s = (Q = n[e + 1]) == null ? void 0 : Q.kind, a = t.role === "user", l = 14, g = 4, C = r == null ? void 0 : r.bottom, y = s == null ? void 0 : s.top, S = this.widthByKey[this.rowKeyOf(t, e)], N = this.widthByKey[this.rowKeyOf(t, e - 1)], A = this.widthByKey[this.rowKeyOf(t, e + 1)], D = 0.5, x = (G, q, X) => G != null && S != null ? G + D >= S : q === X || q === "card" && X === "bubble";
2298
+ let U = l, P = l, R = l, H = l;
2299
+ return a ? (C && (P = g), (y || !s) && (R = g), C && x(N, C, o == null ? void 0 : o.top) && (U = g), y && x(A, y, o == null ? void 0 : o.bottom) && (H = g)) : (C && (U = g), (y || !s) && (H = g), C && x(N, C, o == null ? void 0 : o.top) && (P = g), y && x(A, y, o == null ? void 0 : o.bottom) && (R = g)), { tl: U, tr: P, br: R, bl: H };
2245
2300
  },
2246
2301
  // Inline style emitting the four corner CSS variables. Set on
2247
2302
  // `.wm-list__row` so they cascade to Bubble/ActionResult/
@@ -2282,9 +2337,9 @@ const hs = {
2282
2337
  for (const s of t.querySelectorAll(".wm-list__row[data-row-key]")) {
2283
2338
  const a = s.dataset.rowKey;
2284
2339
  if (!a) continue;
2285
- const d = s.querySelector(".wm-bubble, .wm-result, .wm-art, .wm-list__body");
2286
- if (!d) continue;
2287
- const g = d.getBoundingClientRect().width;
2340
+ const l = s.querySelector(".wm-bubble, .wm-result, .wm-art, .wm-list__body");
2341
+ if (!l) continue;
2342
+ const g = l.getBoundingClientRect().width;
2288
2343
  g > 0 && (e[a] = g);
2289
2344
  }
2290
2345
  const n = this.widthByKey, o = Object.keys(n), r = Object.keys(e);
@@ -2303,7 +2358,7 @@ const hs = {
2303
2358
  const e = t.items[t.items.length - 1], n = (e == null ? void 0 : e.message) || t.messages[t.messages.length - 1];
2304
2359
  if (!(n != null && n.created_at)) return "";
2305
2360
  try {
2306
- return be(new Date(n.created_at));
2361
+ return ke(new Date(n.created_at));
2307
2362
  } catch {
2308
2363
  return "";
2309
2364
  }
@@ -2336,9 +2391,9 @@ const hs = {
2336
2391
  return ((e = t == null ? void 0 : t.payload) == null ? void 0 : e.name) || (t == null ? void 0 : t.text_md) || "Action";
2337
2392
  },
2338
2393
  actionDetail(t) {
2339
- var n, o, r, s, a, d;
2394
+ var n, o, r, s, a, l;
2340
2395
  const e = t == null ? void 0 : t.payload;
2341
- return e ? e.state === "success" ? ((n = e.success) == null ? void 0 : n.summary) || ((r = (o = e.success) == null ? void 0 : o.metadata) == null ? void 0 : r.description) || "" : e.state === "rejected" ? ((s = e.rejected) == null ? void 0 : s.reason) || "Action annulée par l'utilisateur." : e.state === "failure" && (((a = e.failure) == null ? void 0 : a.summary) || ((d = e.failure) == null ? void 0 : d.error)) || "" : "";
2396
+ return e ? e.state === "success" ? ((n = e.success) == null ? void 0 : n.summary) || ((r = (o = e.success) == null ? void 0 : o.metadata) == null ? void 0 : r.description) || "" : e.state === "rejected" ? ((s = e.rejected) == null ? void 0 : s.reason) || "Action annulée par l'utilisateur." : e.state === "failure" && (((a = e.failure) == null ? void 0 : a.summary) || ((l = e.failure) == null ? void 0 : l.error)) || "" : "";
2342
2397
  },
2343
2398
  actionArtifact(t) {
2344
2399
  var n, o;
@@ -2347,7 +2402,7 @@ const hs = {
2347
2402
  },
2348
2403
  systemLabel(t) {
2349
2404
  var r, s, a;
2350
- const e = (r = t == null ? void 0 : t.payload) == null ? void 0 : r.event, n = hs[e] || (t == null ? void 0 : t.text_md) || "Mise à jour de la conversation", o = ((s = t == null ? void 0 : t.metadata) == null ? void 0 : s.agent_name) || ((a = t == null ? void 0 : t.author) == null ? void 0 : a.name) || "";
2405
+ const e = (r = t == null ? void 0 : t.payload) == null ? void 0 : r.event, n = As[e] || (t == null ? void 0 : t.text_md) || "Mise à jour de la conversation", o = ((s = t == null ? void 0 : t.metadata) == null ? void 0 : s.agent_name) || ((a = t == null ? void 0 : t.author) == null ? void 0 : a.name) || "";
2351
2406
  return n.replace("{name}", o || "Un agent");
2352
2407
  },
2353
2408
  scrollToBottom() {
@@ -2355,85 +2410,85 @@ const hs = {
2355
2410
  t && (t.scrollTop = t.scrollHeight);
2356
2411
  }
2357
2412
  }
2358
- }, ps = {
2413
+ }, Ms = {
2359
2414
  key: 0,
2360
2415
  class: "wm-list__loadMore",
2361
2416
  role: "status",
2362
2417
  "aria-live": "polite"
2363
- }, gs = {
2418
+ }, Os = {
2364
2419
  key: 1,
2365
2420
  class: "wm-list__historyEnd"
2366
- }, vs = {
2421
+ }, Is = {
2367
2422
  key: 2,
2368
2423
  class: "wm-list__sep"
2369
- }, ys = { class: "wm-list__sep-label" }, ws = {
2424
+ }, Bs = { class: "wm-list__sep-label" }, Es = {
2370
2425
  key: 0,
2371
2426
  class: "wm-list__sep wm-list__sep--unread"
2372
- }, bs = {
2427
+ }, $s = {
2373
2428
  key: 0,
2374
2429
  class: "wm-list__sysep"
2375
- }, ks = { class: "wm-list__sysep-label" }, Cs = ["data-row-key"], As = {
2430
+ }, Ns = { class: "wm-list__sysep-label" }, Ls = ["data-row-key"], Rs = {
2376
2431
  key: 0,
2377
2432
  class: "wm-list__avatarSlot"
2378
- }, Ss = {
2433
+ }, Fs = {
2379
2434
  key: 5,
2380
2435
  class: "wm-list__body"
2381
- }, xs = { key: 0 }, Ts = {
2436
+ }, Ds = { key: 0 }, js = {
2382
2437
  key: 1,
2383
2438
  "aria-hidden": "true"
2384
- }, Ms = { key: 2 }, Os = {
2439
+ }, Us = { key: 2 }, Ps = {
2385
2440
  key: 3,
2386
2441
  class: "wm-list__row wm-list__row--ai fade-up"
2387
- }, Is = { class: "wm-list__avatarSlot" };
2388
- function Bs(t, e, n, o, r, s) {
2389
- const a = B("AIAvatar"), d = B("HumanAvatar"), g = B("ActionResult"), C = B("ArtifactRenderer"), w = B("Bubble"), S = B("AttachmentPreview"), F = B("Typing");
2390
- return l(), c("div", {
2442
+ }, Hs = { class: "wm-list__avatarSlot" };
2443
+ function zs(t, e, n, o, r, s) {
2444
+ const a = I("AIAvatar"), l = I("HumanAvatar"), g = I("ActionResult"), C = I("ArtifactRenderer"), y = I("Bubble"), S = I("AttachmentPreview"), N = I("Typing");
2445
+ return d(), c("div", {
2391
2446
  ref: "scrollEl",
2392
2447
  class: E(["wm-list", { "wm-list--silent": r.silentFades }]),
2393
2448
  onScrollPassive: e[0] || (e[0] = (...A) => s.onScroll && s.onScroll(...A))
2394
2449
  }, [
2395
- n.loadingMore ? (l(), c("div", ps, [...e[1] || (e[1] = [
2450
+ n.loadingMore ? (d(), c("div", Ms, [...e[1] || (e[1] = [
2396
2451
  i("span", {
2397
2452
  class: "wm-list__loadMore-spinner",
2398
2453
  "aria-hidden": "true"
2399
2454
  }, null, -1),
2400
2455
  i("span", { class: "wm-list__loadMore-lbl" }, "Chargement de l'historique…", -1)
2401
- ])])) : s.historyExhausted ? (l(), c("div", gs, "Début de la conversation")) : b("", !0),
2402
- n.dateLabel ? (l(), c("div", vs, [
2456
+ ])])) : s.historyExhausted ? (d(), c("div", Os, "Début de la conversation")) : b("", !0),
2457
+ n.dateLabel ? (d(), c("div", Is, [
2403
2458
  e[2] || (e[2] = i("div", { class: "wm-list__line" }, null, -1)),
2404
- i("span", ys, k(n.dateLabel), 1),
2459
+ i("span", Bs, k(n.dateLabel), 1),
2405
2460
  e[3] || (e[3] = i("div", { class: "wm-list__line" }, null, -1))
2406
2461
  ])) : b("", !0),
2407
- (l(!0), c(M, null, D(s.groups, (A, U) => (l(), c(M, {
2462
+ (d(!0), c(M, null, F(s.groups, (A, D) => (d(), c(M, {
2408
2463
  key: A.key
2409
2464
  }, [
2410
- A.key === s.unreadGroupKey ? (l(), c("div", ws, [...e[4] || (e[4] = [
2465
+ A.key === s.unreadGroupKey ? (d(), c("div", Es, [...e[4] || (e[4] = [
2411
2466
  i("div", { class: "wm-list__line wm-list__line--unread" }, null, -1),
2412
2467
  i("span", { class: "wm-list__sep-label wm-list__sep-label--unread" }, "Non lus", -1),
2413
2468
  i("div", { class: "wm-list__line wm-list__line--unread" }, null, -1)
2414
2469
  ])])) : b("", !0),
2415
- A.role === "system" || A.items.length ? (l(), c("div", {
2470
+ A.role === "system" || A.items.length ? (d(), c("div", {
2416
2471
  key: 1,
2417
2472
  class: E(["wm-list__group", "wm-list__group--" + A.role])
2418
2473
  }, [
2419
- A.role === "system" ? (l(), c("div", bs, [
2474
+ A.role === "system" ? (d(), c("div", $s, [
2420
2475
  e[5] || (e[5] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1)),
2421
- i("span", ks, k(A.systemLabel), 1),
2476
+ i("span", Ns, k(A.systemLabel), 1),
2422
2477
  e[6] || (e[6] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
2423
- ])) : (l(), c(M, { key: 1 }, [
2424
- (l(!0), c(M, null, D(A.items, (x, j) => (l(), c("div", {
2478
+ ])) : (d(), c(M, { key: 1 }, [
2479
+ (d(!0), c(M, null, F(A.items, (x, U) => (d(), c("div", {
2425
2480
  key: `${s.messageKey(x.message)}-${x.partKey}`,
2426
2481
  "data-row-key": `${s.messageKey(x.message)}-${x.partKey}`,
2427
2482
  class: E(["wm-list__row fade-up", ["wm-list__row--" + A.role, { "is-pending": x.message._pending, "is-failed": x.message._failed }]]),
2428
- style: G(s.cornersStyle(A, j))
2483
+ style: z(s.cornersStyle(A, U))
2429
2484
  }, [
2430
- A.role !== "user" ? (l(), c("div", As, [
2431
- j === A.items.length - 1 ? (l(), c(M, { key: 0 }, [
2432
- A.role === "ai" ? (l(), L(a, {
2485
+ A.role !== "user" ? (d(), c("div", Rs, [
2486
+ U === A.items.length - 1 ? (d(), c(M, { key: 0 }, [
2487
+ A.role === "ai" ? (d(), L(a, {
2433
2488
  key: 0,
2434
2489
  size: 26,
2435
2490
  tail: !0
2436
- })) : (l(), L(d, {
2491
+ })) : (d(), L(l, {
2437
2492
  key: 1,
2438
2493
  name: A.agentName,
2439
2494
  "avatar-url": A.agentAvatarUrl,
@@ -2441,64 +2496,64 @@ function Bs(t, e, n, o, r, s) {
2441
2496
  }, null, 8, ["name", "avatar-url"]))
2442
2497
  ], 64)) : b("", !0)
2443
2498
  ])) : b("", !0),
2444
- x.renderAs === "action" ? (l(), L(g, {
2499
+ x.renderAs === "action" ? (d(), L(g, {
2445
2500
  key: 1,
2446
2501
  state: x.message.payload.state,
2447
2502
  label: s.actionLabel(x.message),
2448
2503
  detail: s.actionDetail(x.message)
2449
- }, null, 8, ["state", "label", "detail"])) : x.renderAs === "admin-pending" ? (l(), L(g, {
2504
+ }, null, 8, ["state", "label", "detail"])) : x.renderAs === "admin-pending" ? (d(), L(g, {
2450
2505
  key: 2,
2451
2506
  state: "awaiting",
2452
2507
  label: "Demande d'approbation envoyée",
2453
2508
  detail: x.message.text_md || ""
2454
- }, null, 8, ["detail"])) : x.renderAs === "artifact-of-action" ? (l(), L(C, {
2509
+ }, null, 8, ["detail"])) : x.renderAs === "artifact-of-action" ? (d(), L(C, {
2455
2510
  key: 3,
2456
2511
  artifact: s.actionArtifact(x.message)
2457
- }, null, 8, ["artifact"])) : x.renderAs === "artifact" ? (l(), L(C, {
2512
+ }, null, 8, ["artifact"])) : x.renderAs === "artifact" ? (d(), L(C, {
2458
2513
  key: 4,
2459
2514
  artifact: s.artifactOf(x.message)
2460
- }, null, 8, ["artifact"])) : (l(), c("div", Ss, [
2461
- x.message.text_md ? (l(), L(w, {
2515
+ }, null, 8, ["artifact"])) : (d(), c("div", Fs, [
2516
+ x.message.text_md ? (d(), L(y, {
2462
2517
  key: 0,
2463
2518
  role: A.role,
2464
2519
  text: x.message.text_md
2465
2520
  }, null, 8, ["role", "text"])) : b("", !0),
2466
- s.attachmentsOf(x.message).length ? (l(), c("div", {
2521
+ s.attachmentsOf(x.message).length ? (d(), c("div", {
2467
2522
  key: 1,
2468
2523
  class: E(["wm-list__atts", { "wm-list__atts--align-end": A.role === "user" }])
2469
2524
  }, [
2470
- (l(!0), c(M, null, D(s.attachmentsOf(x.message), (P, R) => (l(), L(S, {
2525
+ (d(!0), c(M, null, F(s.attachmentsOf(x.message), (P, R) => (d(), L(S, {
2471
2526
  key: `${s.messageKey(x.message)}-att-${R}`,
2472
2527
  attachment: P
2473
2528
  }, null, 8, ["attachment"]))), 128))
2474
2529
  ], 2)) : b("", !0)
2475
2530
  ]))
2476
- ], 14, Cs))), 128)),
2477
- (A.role !== "user" || s.lastTimeOf(A)) && !s.hasTrailingOverlay(A) ? (l(), c("div", {
2531
+ ], 14, Ls))), 128)),
2532
+ (A.role !== "user" || s.lastTimeOf(A)) && !s.hasTrailingOverlay(A) ? (d(), c("div", {
2478
2533
  key: 0,
2479
2534
  class: E(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
2480
2535
  }, [
2481
- A.role !== "user" ? (l(), c("span", xs, k(s.roleLabel(A)), 1)) : b("", !0),
2482
- A.role !== "user" && s.lastTimeOf(A) ? (l(), c("span", Ts, "·")) : b("", !0),
2483
- s.lastTimeOf(A) ? (l(), c("span", Ms, k(s.lastTimeOf(A)), 1)) : b("", !0)
2536
+ A.role !== "user" ? (d(), c("span", Ds, k(s.roleLabel(A)), 1)) : b("", !0),
2537
+ A.role !== "user" && s.lastTimeOf(A) ? (d(), c("span", js, "·")) : b("", !0),
2538
+ s.lastTimeOf(A) ? (d(), c("span", Us, k(s.lastTimeOf(A)), 1)) : b("", !0)
2484
2539
  ], 2)) : b("", !0)
2485
2540
  ], 64))
2486
2541
  ], 2)) : b("", !0)
2487
2542
  ], 64))), 128)),
2488
- n.streamingActive ? (l(), c("div", Os, [
2489
- i("div", Is, [
2543
+ n.streamingActive ? (d(), c("div", Ps, [
2544
+ i("div", Hs, [
2490
2545
  K(a, {
2491
2546
  size: 26,
2492
2547
  tail: !0
2493
2548
  })
2494
2549
  ]),
2495
- K(F)
2550
+ K(N)
2496
2551
  ])) : b("", !0)
2497
2552
  ], 34);
2498
2553
  }
2499
- const Es = /* @__PURE__ */ $(_s, [["render", Bs], ["__scopeId", "data-v-54959b73"]]), oe = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", he = typeof window < "u" && typeof window.MediaRecorder < "u";
2500
- function $s() {
2501
- return he && [
2554
+ const Vs = /* @__PURE__ */ $(Ts, [["render", zs], ["__scopeId", "data-v-54959b73"]]), le = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", me = typeof window < "u" && typeof window.MediaRecorder < "u";
2555
+ function qs() {
2556
+ return me && [
2502
2557
  "video/webm;codecs=vp9,opus",
2503
2558
  "video/webm;codecs=vp8,opus",
2504
2559
  "video/webm",
@@ -2517,11 +2572,11 @@ function Ce({ audio: t }) {
2517
2572
  systemAudio: t ? "include" : "exclude"
2518
2573
  };
2519
2574
  }
2520
- function na(t) {
2575
+ function fa(t) {
2521
2576
  return t ? t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : "file" : "file";
2522
2577
  }
2523
- async function Ls() {
2524
- if (!oe) return null;
2578
+ async function Ws() {
2579
+ if (!le) return null;
2525
2580
  let t;
2526
2581
  try {
2527
2582
  t = await navigator.mediaDevices.getDisplayMedia(Ce({ audio: !1 }));
@@ -2529,7 +2584,7 @@ async function Ls() {
2529
2584
  return (e == null ? void 0 : e.name) !== "NotAllowedError" && console.error("[media] screenshot picker", e), null;
2530
2585
  }
2531
2586
  try {
2532
- return await Rs(t);
2587
+ return await Ks(t);
2533
2588
  } catch (e) {
2534
2589
  return console.error("[media] screenshot capture", e), null;
2535
2590
  } finally {
@@ -2538,78 +2593,78 @@ async function Ls() {
2538
2593
  });
2539
2594
  }
2540
2595
  }
2541
- async function Rs(t) {
2596
+ async function Ks(t) {
2542
2597
  const e = document.createElement("video");
2543
- e.muted = !0, e.playsInline = !0, e.srcObject = t, await e.play(), await new Promise((d) => requestAnimationFrame(d));
2598
+ e.muted = !0, e.playsInline = !0, e.srcObject = t, await e.play(), await new Promise((l) => requestAnimationFrame(l));
2544
2599
  const n = e.videoWidth || 1280, o = e.videoHeight || 720, r = document.createElement("canvas");
2545
2600
  r.width = n, r.height = o, r.getContext("2d").drawImage(e, 0, 0, n, o);
2546
- const s = await new Promise((d, g) => {
2547
- r.toBlob((C) => C ? d(C) : g(new Error("toBlob failed")), "image/png");
2601
+ const s = await new Promise((l, g) => {
2602
+ r.toBlob((C) => C ? l(C) : g(new Error("toBlob failed")), "image/png");
2548
2603
  }), a = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
2549
2604
  return new File([s], `capture-${a}.png`, { type: "image/png" });
2550
2605
  }
2551
- async function Fs(t = {}) {
2606
+ async function Gs(t = {}) {
2552
2607
  var C;
2553
- if (!oe || !he) return null;
2608
+ if (!le || !me) return null;
2554
2609
  let e;
2555
2610
  try {
2556
2611
  e = await navigator.mediaDevices.getDisplayMedia(Ce({ audio: !0 }));
2557
- } catch (w) {
2558
- return (w == null ? void 0 : w.name) !== "NotAllowedError" && console.error("[media] record picker", w), null;
2612
+ } catch (y) {
2613
+ return (y == null ? void 0 : y.name) !== "NotAllowedError" && console.error("[media] record picker", y), null;
2559
2614
  }
2560
- const n = $s();
2615
+ const n = qs();
2561
2616
  let o;
2562
2617
  try {
2563
2618
  o = n ? new window.MediaRecorder(e, { mimeType: n }) : new window.MediaRecorder(e);
2564
- } catch (w) {
2565
- return console.error("[media] recorder init", w), e.getTracks().forEach((S) => {
2619
+ } catch (y) {
2620
+ return console.error("[media] recorder init", y), e.getTracks().forEach((S) => {
2566
2621
  S.stop();
2567
2622
  }), null;
2568
2623
  }
2569
2624
  const r = [];
2570
2625
  let s = null, a = !1;
2571
- o.addEventListener("dataavailable", (w) => {
2572
- w.data && w.data.size > 0 && r.push(w.data);
2626
+ o.addEventListener("dataavailable", (y) => {
2627
+ y.data && y.data.size > 0 && r.push(y.data);
2573
2628
  }), o.addEventListener("stop", () => {
2574
- var w, S;
2575
- if (s && clearInterval(s), e.getTracks().forEach((F) => {
2576
- F.stop();
2629
+ var y, S;
2630
+ if (s && clearInterval(s), e.getTracks().forEach((N) => {
2631
+ N.stop();
2577
2632
  }), r.length) {
2578
- const F = o.mimeType || n || "video/webm", A = new Blob(r, { type: F }), U = /mp4/.test(F) ? "mp4" : "webm", x = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), j = new File([A], `ecran-${x}.${U}`, { type: F });
2579
- (w = t.onfinalize) == null || w.call(t, j);
2633
+ const N = o.mimeType || n || "video/webm", A = new Blob(r, { type: N }), D = /mp4/.test(N) ? "mp4" : "webm", x = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), U = new File([A], `ecran-${x}.${D}`, { type: N });
2634
+ (y = t.onfinalize) == null || y.call(t, U);
2580
2635
  } else
2581
2636
  (S = t.oncancel) == null || S.call(t);
2582
- }), e.getVideoTracks().forEach((w) => {
2583
- w.addEventListener("ended", () => d(), { once: !0 });
2637
+ }), e.getVideoTracks().forEach((y) => {
2638
+ y.addEventListener("ended", () => l(), { once: !0 });
2584
2639
  });
2585
- function d() {
2640
+ function l() {
2586
2641
  if (!a && (a = !0, o.state !== "inactive"))
2587
2642
  try {
2588
2643
  o.stop();
2589
- } catch (w) {
2590
- console.error("[media] recorder stop", w);
2644
+ } catch (y) {
2645
+ console.error("[media] recorder stop", y);
2591
2646
  }
2592
2647
  }
2593
2648
  try {
2594
2649
  o.start(1e3);
2595
- } catch (w) {
2596
- return console.error("[media] recorder start", w), e.getTracks().forEach((S) => {
2650
+ } catch (y) {
2651
+ return console.error("[media] recorder start", y), e.getTracks().forEach((S) => {
2597
2652
  S.stop();
2598
2653
  }), null;
2599
2654
  }
2600
2655
  (C = t.onstart) == null || C.call(t);
2601
2656
  const g = Date.now();
2602
2657
  return s = setInterval(() => {
2603
- var w;
2604
- (w = t.ontick) == null || w.call(t, Date.now() - g);
2658
+ var y;
2659
+ (y = t.ontick) == null || y.call(t, Date.now() - g);
2605
2660
  }, 500), {
2606
- stop: d,
2661
+ stop: l,
2607
2662
  get state() {
2608
2663
  return o.state;
2609
2664
  }
2610
2665
  };
2611
2666
  }
2612
- const Ds = [
2667
+ const Ys = [
2613
2668
  {
2614
2669
  action: "file",
2615
2670
  label: "Joindre un fichier",
@@ -2625,7 +2680,7 @@ const Ds = [
2625
2680
  label: "Enregistrer l'écran",
2626
2681
  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"
2627
2682
  }
2628
- ], Ns = {
2683
+ ], Js = {
2629
2684
  name: "WmComposer",
2630
2685
  props: {
2631
2686
  modelValue: { type: String, default: "" },
@@ -2648,9 +2703,9 @@ const Ds = [
2648
2703
  return !this.disabled && !!this.local.trim();
2649
2704
  },
2650
2705
  attachItems() {
2651
- return Ds.map((t) => ({
2706
+ return Ys.map((t) => ({
2652
2707
  ...t,
2653
- disabled: t.action === "screenshot" && !oe || t.action === "record" && (!oe || !he)
2708
+ disabled: t.action === "screenshot" && !le || t.action === "record" && (!le || !me)
2654
2709
  }));
2655
2710
  },
2656
2711
  recordingElapsedLabel() {
@@ -2720,13 +2775,13 @@ const Ds = [
2720
2775
  },
2721
2776
  async captureScreenshot() {
2722
2777
  if (this.disabled) return;
2723
- const t = await Ls();
2778
+ const t = await Ws();
2724
2779
  t && this.$emit("attach", t);
2725
2780
  },
2726
2781
  async startRecording() {
2727
2782
  if (this.recording || this.disabled) return;
2728
2783
  this.recordingElapsed = 0;
2729
- const t = await Fs({
2784
+ const t = await Gs({
2730
2785
  onstart: () => {
2731
2786
  this.recording = !0;
2732
2787
  },
@@ -2751,27 +2806,27 @@ const Ds = [
2751
2806
  }
2752
2807
  }
2753
2808
  }
2754
- }, js = { class: "wm-compose-wrap" }, Us = {
2809
+ }, Xs = { class: "wm-compose-wrap" }, Zs = {
2755
2810
  key: 0,
2756
2811
  class: "wm-rec"
2757
- }, Ps = { class: "wm-rec__lbl" }, Hs = {
2812
+ }, Qs = { class: "wm-rec__lbl" }, er = {
2758
2813
  key: 1,
2759
2814
  class: "wm-compose__menu",
2760
2815
  role: "menu"
2761
- }, zs = ["disabled", "onClick"], Vs = { class: "wm-compose__menuIcon" }, qs = {
2816
+ }, tr = ["disabled", "onClick"], nr = { class: "wm-compose__menuIcon" }, sr = {
2762
2817
  viewBox: "0 0 24 24",
2763
2818
  width: "14",
2764
2819
  height: "14",
2765
2820
  "aria-hidden": "true"
2766
- }, Ws = ["d"], Ks = ["placeholder", "disabled"], Gs = { class: "wm-compose__actions" }, Ys = ["title", "aria-label", "disabled"], Js = ["disabled"];
2767
- function Xs(t, e, n, o, r, s) {
2768
- return l(), c("div", js, [
2769
- r.recording ? (l(), c("div", Us, [
2821
+ }, rr = ["d"], ir = ["placeholder", "disabled"], ar = { class: "wm-compose__actions" }, or = ["title", "aria-label", "disabled"], lr = ["disabled"];
2822
+ function dr(t, e, n, o, r, s) {
2823
+ return d(), c("div", Xs, [
2824
+ r.recording ? (d(), c("div", Zs, [
2770
2825
  e[8] || (e[8] = i("span", {
2771
2826
  class: "wm-rec__dot",
2772
2827
  "aria-hidden": "true"
2773
2828
  }, null, -1)),
2774
- i("span", Ps, "Enregistrement · " + k(s.recordingElapsedLabel), 1),
2829
+ i("span", Qs, "Enregistrement · " + k(s.recordingElapsedLabel), 1),
2775
2830
  i("button", {
2776
2831
  type: "button",
2777
2832
  class: "wm-rec__stop",
@@ -2780,7 +2835,7 @@ function Xs(t, e, n, o, r, s) {
2780
2835
  ])) : b("", !0),
2781
2836
  i("form", {
2782
2837
  class: E(["wm-compose", { "has-attach": r.attachOpen }]),
2783
- onSubmit: e[7] || (e[7] = Z((...a) => s.onSubmit && s.onSubmit(...a), ["prevent"]))
2838
+ onSubmit: e[7] || (e[7] = Y((...a) => s.onSubmit && s.onSubmit(...a), ["prevent"]))
2784
2839
  }, [
2785
2840
  i("input", {
2786
2841
  ref: "fileEl",
@@ -2789,21 +2844,21 @@ function Xs(t, e, n, o, r, s) {
2789
2844
  multiple: "",
2790
2845
  onChange: e[1] || (e[1] = (...a) => s.onFile && s.onFile(...a))
2791
2846
  }, null, 544),
2792
- r.attachOpen ? (l(), c("div", {
2847
+ r.attachOpen ? (d(), c("div", {
2793
2848
  key: 0,
2794
2849
  class: "wm-compose__overlay",
2795
2850
  onClick: e[2] || (e[2] = (a) => r.attachOpen = !1)
2796
2851
  })) : b("", !0),
2797
- r.attachOpen ? (l(), c("div", Hs, [
2798
- (l(!0), c(M, null, D(s.attachItems, (a) => (l(), c("button", {
2852
+ r.attachOpen ? (d(), c("div", er, [
2853
+ (d(!0), c(M, null, F(s.attachItems, (a) => (d(), c("button", {
2799
2854
  key: a.action,
2800
2855
  type: "button",
2801
2856
  class: "wm-compose__menuItem",
2802
2857
  disabled: a.disabled,
2803
- onClick: (d) => s.onAttachAction(a.action)
2858
+ onClick: (l) => s.onAttachAction(a.action)
2804
2859
  }, [
2805
- i("span", Vs, [
2806
- (l(), c("svg", qs, [
2860
+ i("span", nr, [
2861
+ (d(), c("svg", sr, [
2807
2862
  i("path", {
2808
2863
  d: a.path,
2809
2864
  stroke: "currentColor",
@@ -2811,13 +2866,13 @@ function Xs(t, e, n, o, r, s) {
2811
2866
  "stroke-linecap": "round",
2812
2867
  "stroke-linejoin": "round",
2813
2868
  fill: "none"
2814
- }, null, 8, Ws)
2869
+ }, null, 8, rr)
2815
2870
  ]))
2816
2871
  ]),
2817
2872
  i("span", null, k(a.label), 1)
2818
- ], 8, zs))), 128))
2873
+ ], 8, tr))), 128))
2819
2874
  ])) : b("", !0),
2820
- q(i("textarea", {
2875
+ W(i("textarea", {
2821
2876
  ref: "inputEl",
2822
2877
  "onUpdate:modelValue": e[3] || (e[3] = (a) => r.local = a),
2823
2878
  class: "wm-compose__input",
@@ -2826,10 +2881,10 @@ function Xs(t, e, n, o, r, s) {
2826
2881
  disabled: n.disabled,
2827
2882
  onKeydown: e[4] || (e[4] = (...a) => s.onKeydown && s.onKeydown(...a)),
2828
2883
  onInput: e[5] || (e[5] = (...a) => s.autosize && s.autosize(...a))
2829
- }, null, 40, Ks), [
2830
- [X, r.local]
2884
+ }, null, 40, ir), [
2885
+ [Z, r.local]
2831
2886
  ]),
2832
- i("div", Gs, [
2887
+ i("div", ar, [
2833
2888
  i("button", {
2834
2889
  type: "button",
2835
2890
  class: E(["wm-compose__icon", { "is-open": r.attachOpen }]),
@@ -2851,7 +2906,7 @@ function Xs(t, e, n, o, r, s) {
2851
2906
  }, [
2852
2907
  i("path", { d: "M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48" })
2853
2908
  ], -1)
2854
- ])], 10, Ys),
2909
+ ])], 10, or),
2855
2910
  i("button", {
2856
2911
  type: "submit",
2857
2912
  class: E(["wm-compose__send", { "is-empty": !s.canSend }]),
@@ -2871,12 +2926,12 @@ function Xs(t, e, n, o, r, s) {
2871
2926
  }, [
2872
2927
  i("path", { d: "M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" })
2873
2928
  ], -1)
2874
- ])], 10, Js)
2929
+ ])], 10, lr)
2875
2930
  ])
2876
2931
  ], 34)
2877
2932
  ]);
2878
2933
  }
2879
- const Zs = /* @__PURE__ */ $(Ns, [["render", Xs], ["__scopeId", "data-v-14fa9ec0"]]), Qs = {
2934
+ const cr = /* @__PURE__ */ $(Js, [["render", dr], ["__scopeId", "data-v-14fa9ec0"]]), ur = {
2880
2935
  name: "WmSuggestionChips",
2881
2936
  props: {
2882
2937
  items: { type: Array, default: () => [] },
@@ -2893,22 +2948,22 @@ const Zs = /* @__PURE__ */ $(Ns, [["render", Xs], ["__scopeId", "data-v-14fa9ec0
2893
2948
  return this.items.map((t) => (t == null ? void 0 : t.label) || (t == null ? void 0 : t.text) || "").join("§");
2894
2949
  }
2895
2950
  }
2896
- }, er = ["onClick"];
2897
- function tr(t, e, n, o, r, s) {
2898
- return n.items.length ? (l(), c("div", {
2951
+ }, hr = ["onClick"];
2952
+ function mr(t, e, n, o, r, s) {
2953
+ return n.items.length ? (d(), c("div", {
2899
2954
  key: s.batchKey,
2900
2955
  class: "wm-chips"
2901
2956
  }, [
2902
- (l(!0), c(M, null, D(n.items, (a, d) => (l(), c("button", {
2903
- key: d,
2957
+ (d(!0), c(M, null, F(n.items, (a, l) => (d(), c("button", {
2958
+ key: l,
2904
2959
  type: "button",
2905
2960
  class: "wm-chip",
2906
- style: G({ animationDelay: n.baseDelay + d * n.stepDelay + "ms" }),
2961
+ style: z({ animationDelay: n.baseDelay + l * n.stepDelay + "ms" }),
2907
2962
  onClick: (g) => t.$emit("select", a)
2908
- }, k(a.label), 13, er))), 128))
2963
+ }, k(a.label), 13, hr))), 128))
2909
2964
  ])) : b("", !0);
2910
2965
  }
2911
- const nr = /* @__PURE__ */ $(Qs, [["render", tr], ["__scopeId", "data-v-55aa529d"]]), sr = {
2966
+ const fr = /* @__PURE__ */ $(ur, [["render", mr], ["__scopeId", "data-v-55aa529d"]]), _r = {
2912
2967
  name: "WmApprovalCard",
2913
2968
  components: { AIAvatar: ne },
2914
2969
  props: {
@@ -2941,41 +2996,41 @@ const nr = /* @__PURE__ */ $(Qs, [["render", tr], ["__scopeId", "data-v-55aa529d
2941
2996
  return ((t = this.rejectCallback) == null ? void 0 : t.label) || "Refuser";
2942
2997
  }
2943
2998
  }
2944
- }, rr = { class: "wm-approval" }, ir = { class: "wm-approval__head" }, ar = { class: "wm-approval__icon" }, or = { class: "wm-approval__main" }, lr = { class: "wm-approval__title" }, dr = {
2999
+ }, pr = { class: "wm-approval" }, gr = { class: "wm-approval__head" }, vr = { class: "wm-approval__icon" }, yr = { class: "wm-approval__main" }, wr = { class: "wm-approval__title" }, br = {
2945
3000
  key: 0,
2946
3001
  class: "wm-approval__detail"
2947
- }, cr = { class: "wm-approval__actions" };
2948
- function ur(t, e, n, o, r, s) {
2949
- const a = B("AIAvatar");
2950
- return l(), c("div", rr, [
2951
- i("div", ir, [
2952
- i("div", ar, [
3002
+ }, kr = { class: "wm-approval__actions" };
3003
+ function Cr(t, e, n, o, r, s) {
3004
+ const a = I("AIAvatar");
3005
+ return d(), c("div", pr, [
3006
+ i("div", gr, [
3007
+ i("div", vr, [
2953
3008
  K(a, { size: 24 })
2954
3009
  ]),
2955
- i("div", or, [
2956
- i("div", lr, k(n.action), 1),
2957
- n.detail ? (l(), c("div", dr, k(n.detail), 1)) : b("", !0)
3010
+ i("div", yr, [
3011
+ i("div", wr, k(n.action), 1),
3012
+ n.detail ? (d(), c("div", br, k(n.detail), 1)) : b("", !0)
2958
3013
  ])
2959
3014
  ]),
2960
- i("div", cr, [
2961
- s.rejectId ? (l(), c("button", {
3015
+ i("div", kr, [
3016
+ s.rejectId ? (d(), c("button", {
2962
3017
  key: 0,
2963
3018
  type: "button",
2964
3019
  class: "wm-approval__btn wm-approval__btn--neutral",
2965
- onClick: e[0] || (e[0] = (d) => t.$emit("callback", s.rejectId))
3020
+ onClick: e[0] || (e[0] = (l) => t.$emit("callback", s.rejectId))
2966
3021
  }, k(s.rejectLabel), 1)) : b("", !0),
2967
- s.approveId ? (l(), c("button", {
3022
+ s.approveId ? (d(), c("button", {
2968
3023
  key: 1,
2969
3024
  type: "button",
2970
3025
  class: "wm-approval__btn wm-approval__btn--primary",
2971
- onClick: e[1] || (e[1] = (d) => t.$emit("callback", s.approveId))
3026
+ onClick: e[1] || (e[1] = (l) => t.$emit("callback", s.approveId))
2972
3027
  }, k(s.approveLabel), 1)) : b("", !0)
2973
3028
  ])
2974
3029
  ]);
2975
3030
  }
2976
- const hr = /* @__PURE__ */ $(sr, [["render", ur], ["__scopeId", "data-v-b1be139c"]]);
2977
- let ge = 0;
2978
- const mr = /* @__PURE__ */ new Set([
3031
+ const Ar = /* @__PURE__ */ $(_r, [["render", Cr], ["__scopeId", "data-v-b1be139c"]]);
3032
+ let ve = 0;
3033
+ const Sr = /* @__PURE__ */ new Set([
2979
3034
  "text",
2980
3035
  "textarea",
2981
3036
  "number",
@@ -2983,7 +3038,7 @@ const mr = /* @__PURE__ */ new Set([
2983
3038
  "select",
2984
3039
  "multiselect",
2985
3040
  "date"
2986
- ]), fr = {
3041
+ ]), xr = {
2987
3042
  name: "WmFormCard",
2988
3043
  components: { AIAvatar: ne },
2989
3044
  props: {
@@ -2993,8 +3048,8 @@ const mr = /* @__PURE__ */ new Set([
2993
3048
  },
2994
3049
  emits: ["submit"],
2995
3050
  data() {
2996
- return ge += 1, {
2997
- _uid: ge,
3051
+ return ve += 1, {
3052
+ _uid: ve,
2998
3053
  values: {},
2999
3054
  busy: !1,
3000
3055
  error: ""
@@ -3006,7 +3061,7 @@ const mr = /* @__PURE__ */ new Set([
3006
3061
  // douteux.
3007
3062
  normalizedFields() {
3008
3063
  var e;
3009
- return (Array.isArray((e = this.form) == null ? void 0 : e.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !mr.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
3064
+ return (Array.isArray((e = this.form) == null ? void 0 : e.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !Sr.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
3010
3065
  }
3011
3066
  },
3012
3067
  created() {
@@ -3057,163 +3112,163 @@ const mr = /* @__PURE__ */ new Set([
3057
3112
  }
3058
3113
  }
3059
3114
  }
3060
- }, _r = { class: "wm-form" }, pr = { class: "wm-form__head" }, gr = { class: "wm-form__icon" }, vr = { class: "wm-form__main" }, yr = { class: "wm-form__title" }, wr = {
3115
+ }, Tr = { class: "wm-form" }, Mr = { class: "wm-form__head" }, Or = { class: "wm-form__icon" }, Ir = { class: "wm-form__main" }, Br = { class: "wm-form__title" }, Er = {
3061
3116
  key: 0,
3062
3117
  class: "wm-form__detail"
3063
- }, br = ["for"], kr = {
3118
+ }, $r = ["for"], Nr = {
3064
3119
  key: 0,
3065
3120
  class: "wm-form__req",
3066
3121
  "aria-hidden": "true"
3067
- }, Cr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], Ar = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], Sr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], xr = ["id", "onUpdate:modelValue", "required", "disabled"], Tr = {
3122
+ }, Lr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], Rr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], Fr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], Dr = ["id", "onUpdate:modelValue", "required", "disabled"], jr = {
3068
3123
  key: 4,
3069
3124
  class: "wm-form__bool"
3070
- }, Mr = ["id", "onUpdate:modelValue", "disabled"], Or = ["id", "onUpdate:modelValue", "required", "disabled"], Ir = {
3125
+ }, Ur = ["id", "onUpdate:modelValue", "disabled"], Pr = ["id", "onUpdate:modelValue", "required", "disabled"], Hr = {
3071
3126
  value: "",
3072
3127
  disabled: ""
3073
- }, Br = ["value"], Er = {
3128
+ }, zr = ["value"], Vr = {
3074
3129
  key: 6,
3075
3130
  class: "wm-form__multi"
3076
- }, $r = ["value", "checked", "disabled", "onChange"], Lr = {
3131
+ }, qr = ["value", "checked", "disabled", "onChange"], Wr = {
3077
3132
  key: 0,
3078
3133
  class: "wm-form__err"
3079
- }, Rr = ["disabled"], Fr = {
3134
+ }, Kr = ["disabled"], Gr = {
3080
3135
  key: 0,
3081
3136
  class: "wm-form__spinner",
3082
3137
  "aria-hidden": "true"
3083
- }, Dr = {
3138
+ }, Yr = {
3084
3139
  key: 2,
3085
3140
  class: "wm-form__doneLbl"
3086
3141
  };
3087
- function Nr(t, e, n, o, r, s) {
3088
- const a = B("AIAvatar");
3089
- return l(), c("div", _r, [
3090
- i("div", pr, [
3091
- i("div", gr, [
3142
+ function Jr(t, e, n, o, r, s) {
3143
+ const a = I("AIAvatar");
3144
+ return d(), c("div", Tr, [
3145
+ i("div", Mr, [
3146
+ i("div", Or, [
3092
3147
  K(a, { size: 24 })
3093
3148
  ]),
3094
- i("div", vr, [
3095
- i("div", yr, k(n.form.title || "Formulaire"), 1),
3096
- n.form.description ? (l(), c("div", wr, k(n.form.description), 1)) : b("", !0)
3149
+ i("div", Ir, [
3150
+ i("div", Br, k(n.form.title || "Formulaire"), 1),
3151
+ n.form.description ? (d(), c("div", Er, k(n.form.description), 1)) : b("", !0)
3097
3152
  ])
3098
3153
  ]),
3099
3154
  i("form", {
3100
3155
  class: "wm-form__body",
3101
- onSubmit: e[0] || (e[0] = Z((...d) => s.onSubmit && s.onSubmit(...d), ["prevent"]))
3156
+ onSubmit: e[0] || (e[0] = Y((...l) => s.onSubmit && s.onSubmit(...l), ["prevent"]))
3102
3157
  }, [
3103
- (l(!0), c(M, null, D(s.normalizedFields, (d) => (l(), c("div", {
3104
- key: d.key,
3158
+ (d(!0), c(M, null, F(s.normalizedFields, (l) => (d(), c("div", {
3159
+ key: l.key,
3105
3160
  class: "wm-form__field"
3106
3161
  }, [
3107
3162
  i("label", {
3108
- for: `wm-f-${r._uid}-${d.key}`,
3163
+ for: `wm-f-${r._uid}-${l.key}`,
3109
3164
  class: "wm-form__label"
3110
3165
  }, [
3111
- te(k(d.label), 1),
3112
- d.required ? (l(), c("span", kr, "*")) : b("", !0)
3113
- ], 8, br),
3114
- d.type === "text" ? q((l(), c("input", {
3166
+ te(k(l.label), 1),
3167
+ l.required ? (d(), c("span", Nr, "*")) : b("", !0)
3168
+ ], 8, $r),
3169
+ l.type === "text" ? W((d(), c("input", {
3115
3170
  key: 0,
3116
- id: `wm-f-${r._uid}-${d.key}`,
3117
- "onUpdate:modelValue": (g) => r.values[d.key] = g,
3171
+ id: `wm-f-${r._uid}-${l.key}`,
3172
+ "onUpdate:modelValue": (g) => r.values[l.key] = g,
3118
3173
  type: "text",
3119
3174
  class: "wm-form__input",
3120
- placeholder: d.placeholder || "",
3121
- required: d.required,
3175
+ placeholder: l.placeholder || "",
3176
+ required: l.required,
3122
3177
  disabled: n.readOnly || r.busy
3123
- }, null, 8, Cr)), [
3124
- [X, r.values[d.key]]
3125
- ]) : d.type === "textarea" ? q((l(), c("textarea", {
3178
+ }, null, 8, Lr)), [
3179
+ [Z, r.values[l.key]]
3180
+ ]) : l.type === "textarea" ? W((d(), c("textarea", {
3126
3181
  key: 1,
3127
- id: `wm-f-${r._uid}-${d.key}`,
3128
- "onUpdate:modelValue": (g) => r.values[d.key] = g,
3182
+ id: `wm-f-${r._uid}-${l.key}`,
3183
+ "onUpdate:modelValue": (g) => r.values[l.key] = g,
3129
3184
  class: "wm-form__textarea",
3130
3185
  rows: "3",
3131
- placeholder: d.placeholder || "",
3132
- required: d.required,
3186
+ placeholder: l.placeholder || "",
3187
+ required: l.required,
3133
3188
  disabled: n.readOnly || r.busy
3134
- }, null, 8, Ar)), [
3135
- [X, r.values[d.key]]
3136
- ]) : d.type === "number" ? q((l(), c("input", {
3189
+ }, null, 8, Rr)), [
3190
+ [Z, r.values[l.key]]
3191
+ ]) : l.type === "number" ? W((d(), c("input", {
3137
3192
  key: 2,
3138
- id: `wm-f-${r._uid}-${d.key}`,
3139
- "onUpdate:modelValue": (g) => r.values[d.key] = g,
3193
+ id: `wm-f-${r._uid}-${l.key}`,
3194
+ "onUpdate:modelValue": (g) => r.values[l.key] = g,
3140
3195
  type: "number",
3141
3196
  class: "wm-form__input",
3142
- placeholder: d.placeholder || "",
3143
- required: d.required,
3197
+ placeholder: l.placeholder || "",
3198
+ required: l.required,
3144
3199
  disabled: n.readOnly || r.busy
3145
- }, null, 8, Sr)), [
3200
+ }, null, 8, Fr)), [
3146
3201
  [
3147
- X,
3148
- r.values[d.key],
3202
+ Z,
3203
+ r.values[l.key],
3149
3204
  void 0,
3150
3205
  { number: !0 }
3151
3206
  ]
3152
- ]) : d.type === "date" ? q((l(), c("input", {
3207
+ ]) : l.type === "date" ? W((d(), c("input", {
3153
3208
  key: 3,
3154
- id: `wm-f-${r._uid}-${d.key}`,
3155
- "onUpdate:modelValue": (g) => r.values[d.key] = g,
3209
+ id: `wm-f-${r._uid}-${l.key}`,
3210
+ "onUpdate:modelValue": (g) => r.values[l.key] = g,
3156
3211
  type: "date",
3157
3212
  class: "wm-form__input",
3158
- required: d.required,
3213
+ required: l.required,
3159
3214
  disabled: n.readOnly || r.busy
3160
- }, null, 8, xr)), [
3161
- [X, r.values[d.key]]
3162
- ]) : d.type === "boolean" ? (l(), c("label", Tr, [
3163
- q(i("input", {
3164
- id: `wm-f-${r._uid}-${d.key}`,
3165
- "onUpdate:modelValue": (g) => r.values[d.key] = g,
3215
+ }, null, 8, Dr)), [
3216
+ [Z, r.values[l.key]]
3217
+ ]) : l.type === "boolean" ? (d(), c("label", jr, [
3218
+ W(i("input", {
3219
+ id: `wm-f-${r._uid}-${l.key}`,
3220
+ "onUpdate:modelValue": (g) => r.values[l.key] = g,
3166
3221
  type: "checkbox",
3167
3222
  disabled: n.readOnly || r.busy
3168
- }, null, 8, Mr), [
3169
- [Ie, r.values[d.key]]
3223
+ }, null, 8, Ur), [
3224
+ [Ie, r.values[l.key]]
3170
3225
  ]),
3171
- i("span", null, k(d.placeholder || "Oui"), 1)
3172
- ])) : d.type === "select" ? q((l(), c("select", {
3226
+ i("span", null, k(l.placeholder || "Oui"), 1)
3227
+ ])) : l.type === "select" ? W((d(), c("select", {
3173
3228
  key: 5,
3174
- id: `wm-f-${r._uid}-${d.key}`,
3175
- "onUpdate:modelValue": (g) => r.values[d.key] = g,
3229
+ id: `wm-f-${r._uid}-${l.key}`,
3230
+ "onUpdate:modelValue": (g) => r.values[l.key] = g,
3176
3231
  class: "wm-form__select",
3177
- required: d.required,
3232
+ required: l.required,
3178
3233
  disabled: n.readOnly || r.busy
3179
3234
  }, [
3180
- i("option", Ir, k(d.placeholder || "Choisir…"), 1),
3181
- (l(!0), c(M, null, D(d.options, (g) => (l(), c("option", {
3235
+ i("option", Hr, k(l.placeholder || "Choisir…"), 1),
3236
+ (d(!0), c(M, null, F(l.options, (g) => (d(), c("option", {
3182
3237
  key: g.value,
3183
3238
  value: g.value
3184
- }, k(g.label), 9, Br))), 128))
3185
- ], 8, Or)), [
3186
- [Be, r.values[d.key]]
3187
- ]) : d.type === "multiselect" ? (l(), c("div", Er, [
3188
- (l(!0), c(M, null, D(d.options, (g) => (l(), c("label", {
3239
+ }, k(g.label), 9, zr))), 128))
3240
+ ], 8, Pr)), [
3241
+ [Be, r.values[l.key]]
3242
+ ]) : l.type === "multiselect" ? (d(), c("div", Vr, [
3243
+ (d(!0), c(M, null, F(l.options, (g) => (d(), c("label", {
3189
3244
  key: g.value,
3190
3245
  class: "wm-form__multiItem"
3191
3246
  }, [
3192
3247
  i("input", {
3193
3248
  type: "checkbox",
3194
3249
  value: g.value,
3195
- checked: Array.isArray(r.values[d.key]) && r.values[d.key].includes(g.value),
3250
+ checked: Array.isArray(r.values[l.key]) && r.values[l.key].includes(g.value),
3196
3251
  disabled: n.readOnly || r.busy,
3197
- onChange: (C) => s.toggleMulti(d.key, g.value, C.target.checked)
3198
- }, null, 40, $r),
3252
+ onChange: (C) => s.toggleMulti(l.key, g.value, C.target.checked)
3253
+ }, null, 40, qr),
3199
3254
  i("span", null, k(g.label), 1)
3200
3255
  ]))), 128))
3201
3256
  ])) : b("", !0)
3202
3257
  ]))), 128)),
3203
- r.error ? (l(), c("div", Lr, k(r.error), 1)) : b("", !0),
3204
- n.readOnly ? (l(), c("div", Dr, "Réponse envoyée")) : (l(), c("button", {
3258
+ r.error ? (d(), c("div", Wr, k(r.error), 1)) : b("", !0),
3259
+ n.readOnly ? (d(), c("div", Yr, "Réponse envoyée")) : (d(), c("button", {
3205
3260
  key: 1,
3206
3261
  type: "submit",
3207
3262
  class: "wm-form__submit",
3208
3263
  disabled: r.busy
3209
3264
  }, [
3210
- r.busy ? (l(), c("span", Fr)) : b("", !0),
3265
+ r.busy ? (d(), c("span", Gr)) : b("", !0),
3211
3266
  i("span", null, k(r.busy ? "Envoi…" : n.form.submit_label || "Envoyer"), 1)
3212
- ], 8, Rr))
3267
+ ], 8, Kr))
3213
3268
  ], 32)
3214
3269
  ]);
3215
3270
  }
3216
- const jr = /* @__PURE__ */ $(fr, [["render", Nr], ["__scopeId", "data-v-64b40f76"]]), Ur = {
3271
+ const Xr = /* @__PURE__ */ $(xr, [["render", Jr], ["__scopeId", "data-v-64b40f76"]]), Zr = {
3217
3272
  name: "WmFeedback",
3218
3273
  props: {
3219
3274
  busy: { type: Boolean, default: !1 },
@@ -3237,43 +3292,43 @@ const jr = /* @__PURE__ */ $(fr, [["render", Nr], ["__scopeId", "data-v-64b40f76
3237
3292
  !this.sel || this.busy || this.$emit("submit", { rating: this.sel });
3238
3293
  }
3239
3294
  }
3240
- }, Pr = { class: "wm-fb" }, Hr = { class: "wm-fb__row" }, zr = ["onClick"], Vr = { class: "wm-fb__emoji" }, qr = { class: "wm-fb__label" }, Wr = ["disabled"], Kr = {
3295
+ }, Qr = { class: "wm-fb" }, ei = { class: "wm-fb__row" }, ti = ["onClick"], ni = { class: "wm-fb__emoji" }, si = { class: "wm-fb__label" }, ri = ["disabled"], ii = {
3241
3296
  key: 1,
3242
3297
  class: "wm-fb__done"
3243
3298
  };
3244
- function Gr(t, e, n, o, r, s) {
3245
- return l(), c("div", Pr, [
3246
- n.done ? (l(), c("div", Kr, [...e[3] || (e[3] = [
3247
- ue('<div class="wm-fb__check" data-v-6f45ff3b><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-6f45ff3b><path d="M20 6L9 17l-5-5" data-v-6f45ff3b></path></svg></div><div class="wm-fb__doneTitle" data-v-6f45ff3b>Merci pour votre retour !</div><div class="wm-fb__doneSub" data-v-6f45ff3b>Votre avis a bien été pris en compte.</div>', 3)
3248
- ])])) : (l(), c(M, { key: 0 }, [
3299
+ function ai(t, e, n, o, r, s) {
3300
+ return d(), c("div", Qr, [
3301
+ n.done ? (d(), c("div", ii, [...e[3] || (e[3] = [
3302
+ ae('<div class="wm-fb__check" data-v-6f45ff3b><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-6f45ff3b><path d="M20 6L9 17l-5-5" data-v-6f45ff3b></path></svg></div><div class="wm-fb__doneTitle" data-v-6f45ff3b>Merci pour votre retour !</div><div class="wm-fb__doneSub" data-v-6f45ff3b>Votre avis a bien été pris en compte.</div>', 3)
3303
+ ])])) : (d(), c(M, { key: 0 }, [
3249
3304
  e[1] || (e[1] = i("div", { class: "wm-fb__title" }, "Comment s'est passée cette conversation ?", -1)),
3250
3305
  e[2] || (e[2] = i("div", { class: "wm-fb__sub" }, "Votre avis nous aide à améliorer l'assistant.", -1)),
3251
- i("div", Hr, [
3252
- (l(!0), c(M, null, D(r.options, (a) => (l(), c("button", {
3306
+ i("div", ei, [
3307
+ (d(!0), c(M, null, F(r.options, (a) => (d(), c("button", {
3253
3308
  key: a.v,
3254
3309
  type: "button",
3255
3310
  class: E(["wm-fb__opt", { "is-selected": r.sel === a.v }]),
3256
- onClick: (d) => r.sel = a.v
3311
+ onClick: (l) => r.sel = a.v
3257
3312
  }, [
3258
- i("span", Vr, k(a.e), 1),
3259
- i("span", qr, k(a.l), 1)
3260
- ], 10, zr))), 128))
3313
+ i("span", ni, k(a.e), 1),
3314
+ i("span", si, k(a.l), 1)
3315
+ ], 10, ti))), 128))
3261
3316
  ]),
3262
3317
  i("button", {
3263
3318
  type: "button",
3264
3319
  class: "wm-fb__send",
3265
3320
  disabled: !r.sel || n.busy,
3266
3321
  onClick: e[0] || (e[0] = (...a) => s.onSend && s.onSend(...a))
3267
- }, k(n.busy ? "Envoi…" : "Envoyer mon avis"), 9, Wr)
3322
+ }, k(n.busy ? "Envoi…" : "Envoyer mon avis"), 9, ri)
3268
3323
  ], 64))
3269
3324
  ]);
3270
3325
  }
3271
- const Yr = /* @__PURE__ */ $(Ur, [["render", Gr], ["__scopeId", "data-v-6f45ff3b"]]);
3272
- function Jr(t) {
3326
+ const oi = /* @__PURE__ */ $(Zr, [["render", ai], ["__scopeId", "data-v-6f45ff3b"]]);
3327
+ function li(t) {
3273
3328
  const e = new Date(t);
3274
3329
  return e.setHours(0, 0, 0, 0), e;
3275
3330
  }
3276
- const Xr = {
3331
+ const di = {
3277
3332
  name: "WmHistoryDrawer",
3278
3333
  props: {
3279
3334
  conversations: { type: Array, default: () => [] },
@@ -3307,7 +3362,7 @@ const Xr = {
3307
3362
  ) : this.normalized;
3308
3363
  },
3309
3364
  groups() {
3310
- const e = Jr(/* @__PURE__ */ new Date()).getTime(), n = e - 6 * 864e5, o = [], r = [], s = [];
3365
+ const e = li(/* @__PURE__ */ new Date()).getTime(), n = e - 6 * 864e5, o = [], r = [], s = [];
3311
3366
  for (const a of this.filtered) {
3312
3367
  if (!a.stamp) {
3313
3368
  s.push(a);
@@ -3325,29 +3380,29 @@ const Xr = {
3325
3380
  return this.filtered.length > 0;
3326
3381
  }
3327
3382
  }
3328
- }, Zr = { class: "wm-hd" }, Qr = {
3383
+ }, ci = { class: "wm-hd" }, ui = {
3329
3384
  class: "wm-hd__panel",
3330
3385
  role: "dialog",
3331
3386
  "aria-label": "Vos discussions"
3332
- }, ei = { class: "wm-hd__head" }, ti = { class: "wm-hd__top" }, ni = { class: "wm-hd__search" }, si = { class: "wm-hd__list" }, ri = {
3387
+ }, hi = { class: "wm-hd__head" }, mi = { class: "wm-hd__top" }, fi = { class: "wm-hd__search" }, _i = { class: "wm-hd__list" }, pi = {
3333
3388
  key: 0,
3334
3389
  class: "wm-hd__group"
3335
- }, ii = { class: "wm-hd__groupLabel" }, ai = { class: "wm-hd__rows" }, oi = ["onClick"], li = { class: "wm-hd__rowIcon" }, di = {
3390
+ }, gi = { class: "wm-hd__groupLabel" }, vi = { class: "wm-hd__rows" }, yi = ["onClick"], wi = { class: "wm-hd__rowIcon" }, bi = {
3336
3391
  key: 0,
3337
3392
  class: "wm-hd__rowDot",
3338
3393
  "aria-label": "Message non lu"
3339
- }, ci = { class: "wm-hd__rowBody" }, ui = { class: "wm-hd__rowTop" }, hi = { class: "wm-hd__rowTitle" }, mi = { class: "wm-hd__rowPreview" }, fi = {
3394
+ }, ki = { class: "wm-hd__rowBody" }, Ci = { class: "wm-hd__rowTop" }, Ai = { class: "wm-hd__rowTitle" }, Si = { class: "wm-hd__rowPreview" }, xi = {
3340
3395
  key: 0,
3341
3396
  class: "wm-hd__empty"
3342
3397
  };
3343
- function _i(t, e, n, o, r, s) {
3344
- return l(), c("div", Zr, [
3398
+ function Ti(t, e, n, o, r, s) {
3399
+ return d(), c("div", ci, [
3345
3400
  i("div", {
3346
3401
  class: "wm-hd__scrim",
3347
3402
  onClick: e[0] || (e[0] = (a) => t.$emit("close"))
3348
3403
  }),
3349
- i("aside", Qr, [
3350
- i("div", ei, [
3404
+ i("aside", ui, [
3405
+ i("div", hi, [
3351
3406
  e[5] || (e[5] = i("div", { class: "wm-hd__heading" }, [
3352
3407
  i("div", { class: "wm-hd__title" }, "Vos discussions"),
3353
3408
  i("div", { class: "wm-hd__sub" }, "Reprenez là où vous en étiez.")
@@ -3373,7 +3428,7 @@ function _i(t, e, n, o, r, s) {
3373
3428
  ], -1)
3374
3429
  ])])
3375
3430
  ]),
3376
- i("div", ti, [
3431
+ i("div", mi, [
3377
3432
  i("button", {
3378
3433
  type: "button",
3379
3434
  class: "wm-hd__new",
@@ -3396,7 +3451,7 @@ function _i(t, e, n, o, r, s) {
3396
3451
  ], -1),
3397
3452
  i("span", null, "Démarrer un nouveau fil", -1)
3398
3453
  ])]),
3399
- i("div", ni, [
3454
+ i("div", fi, [
3400
3455
  e[7] || (e[7] = i("span", { class: "wm-hd__searchIcon" }, [
3401
3456
  i("svg", {
3402
3457
  width: "12",
@@ -3412,33 +3467,33 @@ function _i(t, e, n, o, r, s) {
3412
3467
  i("path", { d: "M21 21l-4.35-4.35M11 17a6 6 0 100-12 6 6 0 000 12z" })
3413
3468
  ])
3414
3469
  ], -1)),
3415
- q(i("input", {
3470
+ W(i("input", {
3416
3471
  "onUpdate:modelValue": e[3] || (e[3] = (a) => r.query = a),
3417
3472
  type: "text",
3418
3473
  placeholder: "Rechercher dans vos messages",
3419
3474
  "aria-label": "Rechercher dans vos messages"
3420
3475
  }, null, 512), [
3421
- [X, r.query]
3476
+ [Z, r.query]
3422
3477
  ])
3423
3478
  ])
3424
3479
  ]),
3425
- i("div", si, [
3426
- (l(!0), c(M, null, D(s.groups, (a) => (l(), c(M, {
3480
+ i("div", _i, [
3481
+ (d(!0), c(M, null, F(s.groups, (a) => (d(), c(M, {
3427
3482
  key: a.key
3428
3483
  }, [
3429
- a.items.length ? (l(), c("div", ri, [
3430
- i("div", ii, k(a.label), 1),
3431
- i("div", ai, [
3432
- (l(!0), c(M, null, D(a.items, (d) => (l(), c("button", {
3433
- key: d.id,
3484
+ a.items.length ? (d(), c("div", pi, [
3485
+ i("div", gi, k(a.label), 1),
3486
+ i("div", vi, [
3487
+ (d(!0), c(M, null, F(a.items, (l) => (d(), c("button", {
3488
+ key: l.id,
3434
3489
  type: "button",
3435
3490
  class: E(["wm-hd__row", {
3436
- "wm-hd__row--active": d.id === n.activeId,
3437
- "wm-hd__row--unread": d.unread
3491
+ "wm-hd__row--active": l.id === n.activeId,
3492
+ "wm-hd__row--unread": l.unread
3438
3493
  }]),
3439
- onClick: (g) => t.$emit("pick", d)
3494
+ onClick: (g) => t.$emit("pick", l)
3440
3495
  }, [
3441
- i("div", li, [
3496
+ i("div", wi, [
3442
3497
  e[8] || (e[8] = i("svg", {
3443
3498
  width: "11",
3444
3499
  height: "11",
@@ -3452,66 +3507,78 @@ function _i(t, e, n, o, r, s) {
3452
3507
  opacity: "0.92"
3453
3508
  })
3454
3509
  ], -1)),
3455
- d.unread ? (l(), c("span", di)) : b("", !0)
3510
+ l.unread ? (d(), c("span", bi)) : b("", !0)
3456
3511
  ]),
3457
- i("div", ci, [
3458
- i("div", ui, [
3459
- i("span", hi, k(d.title), 1)
3512
+ i("div", ki, [
3513
+ i("div", Ci, [
3514
+ i("span", Ai, k(l.title), 1)
3460
3515
  ]),
3461
- i("div", mi, k(d.preview || "Aucun message"), 1)
3516
+ i("div", Si, k(l.preview || "Aucun message"), 1)
3462
3517
  ])
3463
- ], 10, oi))), 128))
3518
+ ], 10, yi))), 128))
3464
3519
  ])
3465
3520
  ])) : b("", !0)
3466
3521
  ], 64))), 128)),
3467
- s.hasAny ? b("", !0) : (l(), c("div", fi, " Aucun fil pour le moment. "))
3522
+ s.hasAny ? b("", !0) : (d(), c("div", xi, " Aucun fil pour le moment. "))
3468
3523
  ])
3469
3524
  ])
3470
3525
  ]);
3471
3526
  }
3472
- const pi = /* @__PURE__ */ $(Xr, [["render", _i], ["__scopeId", "data-v-1259e822"]]), gi = {
3527
+ const Mi = /* @__PURE__ */ $(di, [["render", Ti], ["__scopeId", "data-v-1259e822"]]), Oi = {
3473
3528
  name: "WmMoreMenu",
3474
3529
  props: {
3475
3530
  canRename: { type: Boolean, default: !0 },
3476
3531
  canExport: { type: Boolean, default: !0 },
3477
- notifEnabled: { type: Boolean, default: !0 },
3532
+ soundEnabled: { type: Boolean, default: !0 },
3533
+ browserNotifEnabled: { type: Boolean, default: !1 },
3478
3534
  statusUrl: { type: String, default: "" },
3479
3535
  helpUrl: { type: String, default: "" }
3480
3536
  },
3481
- emits: ["close", "action", "notif-toggle"],
3537
+ emits: ["close", "action", "sound-toggle", "browser-notif-toggle"],
3482
3538
  data() {
3483
- return { notifOn: this.notifEnabled };
3539
+ return {
3540
+ soundOn: this.soundEnabled,
3541
+ browserNotifOn: this.browserNotifEnabled
3542
+ };
3484
3543
  },
3485
3544
  watch: {
3486
- notifEnabled(t) {
3487
- this.notifOn = !!t;
3545
+ // Parent reverts the toggle when permission is denied — sync the
3546
+ // local optimistic flip with the authoritative value.
3547
+ soundEnabled(t) {
3548
+ this.soundOn = !!t;
3549
+ },
3550
+ browserNotifEnabled(t) {
3551
+ this.browserNotifOn = !!t;
3488
3552
  }
3489
3553
  },
3490
3554
  methods: {
3491
3555
  emit(t) {
3492
3556
  this.$emit("action", t);
3493
3557
  },
3494
- toggleNotif() {
3495
- this.notifOn = !this.notifOn, this.$emit("notif-toggle", this.notifOn);
3558
+ toggleSound() {
3559
+ this.soundOn = !this.soundOn, this.$emit("sound-toggle", this.soundOn);
3560
+ },
3561
+ toggleBrowserNotif() {
3562
+ this.browserNotifOn = !this.browserNotifOn, this.$emit("browser-notif-toggle", this.browserNotifOn);
3496
3563
  }
3497
3564
  }
3498
- }, vi = { class: "wm-mm" }, yi = {
3565
+ }, Ii = { class: "wm-mm" }, Bi = {
3499
3566
  class: "wm-mm__pop",
3500
3567
  role: "menu"
3501
- }, wi = { class: "wm-mm__section" }, bi = { class: "wm-mm__section" }, ki = { class: "wm-mm__section" };
3502
- function Ci(t, e, n, o, r, s) {
3503
- return l(), c("div", vi, [
3568
+ }, Ei = { class: "wm-mm__section" }, $i = { class: "wm-mm__section" }, Ni = { class: "wm-mm__section" };
3569
+ function Li(t, e, n, o, r, s) {
3570
+ return d(), c("div", Ii, [
3504
3571
  i("div", {
3505
3572
  class: "wm-mm__scrim",
3506
3573
  onClick: e[0] || (e[0] = (a) => t.$emit("close"))
3507
3574
  }),
3508
- i("div", yi, [
3509
- i("div", wi, [
3575
+ i("div", Bi, [
3576
+ i("div", Ei, [
3510
3577
  i("button", {
3511
3578
  type: "button",
3512
3579
  class: "wm-mm__item",
3513
3580
  onClick: e[1] || (e[1] = (a) => s.emit("history"))
3514
- }, [...e[7] || (e[7] = [
3581
+ }, [...e[8] || (e[8] = [
3515
3582
  i("span", { class: "wm-mm__icon" }, [
3516
3583
  i("svg", {
3517
3584
  width: "12",
@@ -3529,31 +3596,43 @@ function Ci(t, e, n, o, r, s) {
3529
3596
  ], -1),
3530
3597
  i("span", { class: "wm-mm__label" }, "Historique des discussions", -1)
3531
3598
  ])]),
3532
- n.canRename ? (l(), c("button", {
3599
+ n.canRename ? (d(), c("button", {
3533
3600
  key: 0,
3534
3601
  type: "button",
3535
3602
  class: "wm-mm__item",
3536
3603
  onClick: e[2] || (e[2] = (a) => s.emit("rename"))
3537
- }, [...e[8] || (e[8] = [
3538
- ue('<span class="wm-mm__icon" data-v-3181ad1b><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-3181ad1b><path d="M12 20h9" data-v-3181ad1b></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z" data-v-3181ad1b></path></svg></span><span class="wm-mm__label" data-v-3181ad1b>Modifier le titre</span>', 2)
3604
+ }, [...e[9] || (e[9] = [
3605
+ ae('<span class="wm-mm__icon" data-v-e300b2de><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-e300b2de><path d="M12 20h9" data-v-e300b2de></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z" data-v-e300b2de></path></svg></span><span class="wm-mm__label" data-v-e300b2de>Modifier le titre</span>', 2)
3539
3606
  ])])) : b("", !0),
3540
- n.canExport ? (l(), c("button", {
3607
+ n.canExport ? (d(), c("button", {
3541
3608
  key: 1,
3542
3609
  type: "button",
3543
3610
  class: "wm-mm__item",
3544
3611
  onClick: e[3] || (e[3] = (a) => s.emit("export"))
3545
- }, [...e[9] || (e[9] = [
3546
- ue('<span class="wm-mm__icon" data-v-3181ad1b><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-3181ad1b><path d="M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" data-v-3181ad1b></path></svg></span><span class="wm-mm__label" data-v-3181ad1b>Exporter la transcription</span><span class="wm-mm__hint" data-v-3181ad1b>.txt</span>', 3)
3612
+ }, [...e[10] || (e[10] = [
3613
+ ae('<span class="wm-mm__icon" data-v-e300b2de><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-e300b2de><path d="M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" data-v-e300b2de></path></svg></span><span class="wm-mm__label" data-v-e300b2de>Exporter la transcription</span><span class="wm-mm__hint" data-v-e300b2de>.txt</span>', 3)
3547
3614
  ])])) : b("", !0)
3548
3615
  ]),
3549
- e[15] || (e[15] = i("div", { class: "wm-mm__sep" }, null, -1)),
3550
- i("div", bi, [
3616
+ e[18] || (e[18] = i("div", { class: "wm-mm__sep" }, null, -1)),
3617
+ i("div", $i, [
3551
3618
  i("button", {
3552
3619
  type: "button",
3553
3620
  class: "wm-mm__item",
3554
- onClick: e[4] || (e[4] = (...a) => s.toggleNotif && s.toggleNotif(...a))
3621
+ onClick: e[4] || (e[4] = (...a) => s.toggleSound && s.toggleSound(...a))
3555
3622
  }, [
3556
- e[11] || (e[11] = i("span", { class: "wm-mm__icon" }, [
3623
+ e[12] || (e[12] = ae('<span class="wm-mm__icon" data-v-e300b2de><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-e300b2de><path d="M11 5L6 9H2v6h4l5 4V5z" data-v-e300b2de></path><path d="M15.54 8.46a5 5 0 010 7.07M19.07 4.93a10 10 0 010 14.14" data-v-e300b2de></path></svg></span><span class="wm-mm__label" data-v-e300b2de>Son</span>', 2)),
3624
+ i("span", {
3625
+ class: E(["wm-mm__toggle", { "wm-mm__toggle--on": r.soundOn }])
3626
+ }, [...e[11] || (e[11] = [
3627
+ i("span", { class: "wm-mm__knob" }, null, -1)
3628
+ ])], 2)
3629
+ ]),
3630
+ i("button", {
3631
+ type: "button",
3632
+ class: "wm-mm__item",
3633
+ onClick: e[5] || (e[5] = (...a) => s.toggleBrowserNotif && s.toggleBrowserNotif(...a))
3634
+ }, [
3635
+ e[14] || (e[14] = i("span", { class: "wm-mm__icon" }, [
3557
3636
  i("svg", {
3558
3637
  width: "12",
3559
3638
  height: "12",
@@ -3568,22 +3647,22 @@ function Ci(t, e, n, o, r, s) {
3568
3647
  i("path", { d: "M15 17h5l-1.4-1.4A2 2 0 0118 14.2V11a6 6 0 10-12 0v3.2c0 .5-.2 1-.6 1.4L4 17h5m6 0a3 3 0 11-6 0" })
3569
3648
  ])
3570
3649
  ], -1)),
3571
- e[12] || (e[12] = i("span", { class: "wm-mm__label" }, "Notifications", -1)),
3650
+ e[15] || (e[15] = i("span", { class: "wm-mm__label" }, "Notifications navigateur", -1)),
3572
3651
  i("span", {
3573
- class: E(["wm-mm__toggle", { "wm-mm__toggle--on": r.notifOn }])
3574
- }, [...e[10] || (e[10] = [
3652
+ class: E(["wm-mm__toggle", { "wm-mm__toggle--on": r.browserNotifOn }])
3653
+ }, [...e[13] || (e[13] = [
3575
3654
  i("span", { class: "wm-mm__knob" }, null, -1)
3576
3655
  ])], 2)
3577
3656
  ])
3578
3657
  ]),
3579
- e[16] || (e[16] = i("div", { class: "wm-mm__sep" }, null, -1)),
3580
- i("div", ki, [
3581
- n.statusUrl ? (l(), c("button", {
3658
+ e[19] || (e[19] = i("div", { class: "wm-mm__sep" }, null, -1)),
3659
+ i("div", Ni, [
3660
+ n.statusUrl ? (d(), c("button", {
3582
3661
  key: 0,
3583
3662
  type: "button",
3584
3663
  class: "wm-mm__item",
3585
- onClick: e[5] || (e[5] = (a) => s.emit("status"))
3586
- }, [...e[13] || (e[13] = [
3664
+ onClick: e[6] || (e[6] = (a) => s.emit("status"))
3665
+ }, [...e[16] || (e[16] = [
3587
3666
  i("span", { class: "wm-mm__icon" }, [
3588
3667
  i("svg", {
3589
3668
  width: "12",
@@ -3601,12 +3680,12 @@ function Ci(t, e, n, o, r, s) {
3601
3680
  ], -1),
3602
3681
  i("span", { class: "wm-mm__label" }, "Statut des services", -1)
3603
3682
  ])])) : b("", !0),
3604
- n.helpUrl ? (l(), c("button", {
3683
+ n.helpUrl ? (d(), c("button", {
3605
3684
  key: 1,
3606
3685
  type: "button",
3607
3686
  class: "wm-mm__item",
3608
- onClick: e[6] || (e[6] = (a) => s.emit("help"))
3609
- }, [...e[14] || (e[14] = [
3687
+ onClick: e[7] || (e[7] = (a) => s.emit("help"))
3688
+ }, [...e[17] || (e[17] = [
3610
3689
  i("span", { class: "wm-mm__icon" }, [
3611
3690
  i("svg", {
3612
3691
  width: "12",
@@ -3628,7 +3707,7 @@ function Ci(t, e, n, o, r, s) {
3628
3707
  ])
3629
3708
  ]);
3630
3709
  }
3631
- const Ai = /* @__PURE__ */ $(gi, [["render", Ci], ["__scopeId", "data-v-3181ad1b"]]), Si = {
3710
+ const Ri = /* @__PURE__ */ $(Oi, [["render", Li], ["__scopeId", "data-v-e300b2de"]]), Fi = {
3632
3711
  name: "WmRenameDialog",
3633
3712
  props: {
3634
3713
  title: { type: String, default: "Modifier le titre" },
@@ -3662,20 +3741,20 @@ const Ai = /* @__PURE__ */ $(gi, [["render", Ci], ["__scopeId", "data-v-3181ad1b
3662
3741
  this.canSubmit && this.$emit("submit", this.value.trim());
3663
3742
  }
3664
3743
  }
3665
- }, xi = { class: "wm-dialog" }, Ti = {
3744
+ }, Di = { class: "wm-dialog" }, ji = {
3666
3745
  class: "wm-dialog__card",
3667
3746
  role: "dialog",
3668
3747
  "aria-modal": "true"
3669
- }, Mi = { class: "wm-dialog__head" }, Oi = { class: "wm-dialog__title" }, Ii = { class: "wm-dialog__body" }, Bi = ["placeholder"], Ei = { class: "wm-dialog__actions" }, $i = ["disabled"];
3670
- function Li(t, e, n, o, r, s) {
3671
- return l(), c("div", xi, [
3748
+ }, Ui = { class: "wm-dialog__head" }, Pi = { class: "wm-dialog__title" }, Hi = { class: "wm-dialog__body" }, zi = ["placeholder"], Vi = { class: "wm-dialog__actions" }, qi = ["disabled"];
3749
+ function Wi(t, e, n, o, r, s) {
3750
+ return d(), c("div", Di, [
3672
3751
  i("div", {
3673
3752
  class: "wm-dialog__scrim",
3674
3753
  onClick: e[0] || (e[0] = (a) => t.$emit("close"))
3675
3754
  }),
3676
- i("div", Ti, [
3677
- i("div", Mi, [
3678
- i("div", Oi, k(n.title), 1),
3755
+ i("div", ji, [
3756
+ i("div", Ui, [
3757
+ i("div", Pi, k(n.title), 1),
3679
3758
  i("button", {
3680
3759
  type: "button",
3681
3760
  class: "wm-dialog__close",
@@ -3697,8 +3776,8 @@ function Li(t, e, n, o, r, s) {
3697
3776
  ], -1)
3698
3777
  ])])
3699
3778
  ]),
3700
- i("div", Ii, [
3701
- q(i("input", {
3779
+ i("div", Hi, [
3780
+ W(i("input", {
3702
3781
  ref: "input",
3703
3782
  "onUpdate:modelValue": e[2] || (e[2] = (a) => r.value = a),
3704
3783
  type: "text",
@@ -3706,14 +3785,14 @@ function Li(t, e, n, o, r, s) {
3706
3785
  placeholder: n.placeholder,
3707
3786
  maxlength: 120,
3708
3787
  onKeydown: [
3709
- e[3] || (e[3] = ae(Z((...a) => s.onSubmit && s.onSubmit(...a), ["prevent"]), ["enter"])),
3710
- e[4] || (e[4] = ae(Z((a) => t.$emit("close"), ["prevent"]), ["esc"]))
3788
+ e[3] || (e[3] = oe(Y((...a) => s.onSubmit && s.onSubmit(...a), ["prevent"]), ["enter"])),
3789
+ e[4] || (e[4] = oe(Y((a) => t.$emit("close"), ["prevent"]), ["esc"]))
3711
3790
  ]
3712
- }, null, 40, Bi), [
3713
- [X, r.value]
3791
+ }, null, 40, zi), [
3792
+ [Z, r.value]
3714
3793
  ])
3715
3794
  ]),
3716
- i("div", Ei, [
3795
+ i("div", Vi, [
3717
3796
  i("button", {
3718
3797
  type: "button",
3719
3798
  class: "wm-dialog__btn",
@@ -3724,18 +3803,18 @@ function Li(t, e, n, o, r, s) {
3724
3803
  class: "wm-dialog__btn wm-dialog__btn--primary",
3725
3804
  disabled: !s.canSubmit,
3726
3805
  onClick: e[6] || (e[6] = (...a) => s.onSubmit && s.onSubmit(...a))
3727
- }, "Enregistrer", 8, $i)
3806
+ }, "Enregistrer", 8, qi)
3728
3807
  ])
3729
3808
  ])
3730
3809
  ]);
3731
3810
  }
3732
- const Ri = /* @__PURE__ */ $(Si, [["render", Li], ["__scopeId", "data-v-4f4b37c9"]]), ve = "ww-messenger-tokens";
3811
+ const Ki = /* @__PURE__ */ $(Fi, [["render", Wi], ["__scopeId", "data-v-4f4b37c9"]]), ye = "ww-messenger-tokens";
3733
3812
  function ie(t) {
3734
3813
  var n;
3735
3814
  const e = (n = t == null ? void 0 : t.author) == null ? void 0 : n.type;
3736
3815
  return e === "agent_ia" || e === "agent_human";
3737
3816
  }
3738
- function Fi(t, e) {
3817
+ function Gi(t, e) {
3739
3818
  if (!t || !e) return "";
3740
3819
  const n = Array.isArray(t.fields) ? t.fields : [], o = [];
3741
3820
  for (const r of n) {
@@ -3744,8 +3823,8 @@ function Fi(t, e) {
3744
3823
  if (s == null || s === "") continue;
3745
3824
  let a;
3746
3825
  if (Array.isArray(s)) {
3747
- if (a = s.map((d) => le(r, String(d))).join(", "), !a) continue;
3748
- } else typeof s == "boolean" ? a = s ? "Oui" : "Non" : a = le(r, String(s));
3826
+ if (a = s.map((l) => de(r, String(l))).join(", "), !a) continue;
3827
+ } else typeof s == "boolean" ? a = s ? "Oui" : "Non" : a = de(r, String(s));
3749
3828
  o.push(`${r.label} :
3750
3829
  ${a}`);
3751
3830
  }
@@ -3753,12 +3832,12 @@ ${a}`);
3753
3832
 
3754
3833
  `);
3755
3834
  }
3756
- function le(t, e) {
3835
+ function de(t, e) {
3757
3836
  if (!Array.isArray(t == null ? void 0 : t.options)) return e;
3758
3837
  const n = t.options.find((o) => (o == null ? void 0 : o.value) === e);
3759
3838
  return (n == null ? void 0 : n.label) || e;
3760
3839
  }
3761
- function Di(t, e) {
3840
+ function Yi(t, e) {
3762
3841
  const n = [], o = Array.isArray(t == null ? void 0 : t.fields) ? t.fields : [];
3763
3842
  for (const r of o) {
3764
3843
  if (!(r != null && r.key) || !(r != null && r.label)) continue;
@@ -3766,11 +3845,11 @@ function Di(t, e) {
3766
3845
  if (s == null || s === "") continue;
3767
3846
  let a;
3768
3847
  if (Array.isArray(s)) {
3769
- if (a = s.map((g) => le(r, String(g))).join(", "), !a) continue;
3770
- } else typeof s == "boolean" ? a = s ? "Oui" : "Non" : a = le(r, String(s));
3771
- const d = r.type === "textarea" || typeof a == "string" && (a.length > 60 || a.includes(`
3848
+ if (a = s.map((g) => de(r, String(g))).join(", "), !a) continue;
3849
+ } else typeof s == "boolean" ? a = s ? "Oui" : "Non" : a = de(r, String(s));
3850
+ const l = r.type === "textarea" || typeof a == "string" && (a.length > 60 || a.includes(`
3772
3851
  `));
3773
- n.push({ label: r.label, value: a, multiline: d });
3852
+ n.push({ label: r.label, value: a, multiline: l });
3774
3853
  }
3775
3854
  return {
3776
3855
  kind: "form_response",
@@ -3780,21 +3859,21 @@ function Di(t, e) {
3780
3859
  }
3781
3860
  };
3782
3861
  }
3783
- const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
3862
+ const Ji = 450, Xi = 50, Zi = 900, Qi = 12e3, ea = 300, ta = {
3784
3863
  name: "Messenger",
3785
3864
  components: {
3786
- Launcher: Ge,
3787
- Header: wt,
3788
- Onboarding: zt,
3789
- MessageList: Es,
3790
- Composer: Zs,
3791
- SuggestionChips: nr,
3792
- ApprovalCard: hr,
3793
- FormCard: jr,
3794
- Feedback: Yr,
3795
- HistoryDrawer: pi,
3796
- MoreMenu: Ai,
3797
- RenameDialog: Ri
3865
+ Launcher: it,
3866
+ Header: Mt,
3867
+ Onboarding: tn,
3868
+ MessageList: Vs,
3869
+ Composer: cr,
3870
+ SuggestionChips: fr,
3871
+ ApprovalCard: Ar,
3872
+ FormCard: Xr,
3873
+ Feedback: oi,
3874
+ HistoryDrawer: Mi,
3875
+ MoreMenu: Ri,
3876
+ RenameDialog: Ki
3798
3877
  },
3799
3878
  // Make signAttachment available to deep children (AttachmentPreview)
3800
3879
  // without prop drilling. The store may not exist yet at provide-time
@@ -3879,12 +3958,22 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
3879
3958
  // When true, force the onboarding screen even if conversations
3880
3959
  // exist (e.g. user tapped the "back to home" header button).
3881
3960
  showOnboarding: !1,
3882
- // Local UI preference; mirrors the toggle in MoreMenu.
3883
- notifEnabled: !0,
3884
- // True once the user has dismissed (×) the closed-launcher
3885
- // étiquette for the current unread batch. Reset automatically
3886
- // when a newer unread message arrives (see latestUnread watch).
3887
- labelDismissed: !1,
3961
+ // Local UI preferences ; mirror the two toggles in MoreMenu.
3962
+ // Sound : ON by default — no system permission needed, only the
3963
+ // browser's autoplay gesture rule applies (user has clicked the
3964
+ // launcher / composer well before the first agent reply lands).
3965
+ // Browser notif : default reflects the current `Notification.permission`
3966
+ // — pre-granted permissions stay on, otherwise we wait for the
3967
+ // user to toggle (which triggers the permission prompt).
3968
+ soundEnabled: !0,
3969
+ browserNotifEnabled: typeof Notification < "u" && Notification.permission === "granted",
3970
+ // convId → ISO ts of the unread batch the user has dismissed
3971
+ // (×) on the closed-launcher notification stack. A new message
3972
+ // on the same thread bumps the ts, which makes the comparison
3973
+ // in `launcherPeeks` fail and the card re-appears. Cleared
3974
+ // entries (conv no longer unread) are pruned by the
3975
+ // latestUnreads watcher.
3976
+ dismissedPeeks: {},
3888
3977
  // conversation_id → ISO timestamp of the newest message the user
3889
3978
  // has seen for that thread. Persisted to localStorage so the
3890
3979
  // unread dot in the history drawer survives reloads. The server
@@ -3981,8 +4070,23 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
3981
4070
  var o;
3982
4071
  const t = this.readState, e = this.readBootTs, n = ((o = this.s) == null ? void 0 : o.messagesByConv) || {};
3983
4072
  return this.allConversations.map((r) => {
3984
- const s = n[r.id] || [], a = this.convLastActivity(r, s), d = t[r.id] || e || "", g = this.lastMessageAuthorType(s), C = !!a && g !== "user" && (!d || a > d);
3985
- return { ...r, _preview: this.convPreview(r, s), _unread: C };
4073
+ var N;
4074
+ const s = n[r.id] || [], a = this.convLastActivity(r, s), l = t[r.id] || e || "", g = this.lastMessageAuthorType(s), C = !!a && g !== "user" && (!l || a > l);
4075
+ let y = 0, S = null;
4076
+ for (let A = s.length - 1; A >= 0; A--) {
4077
+ const D = s[A];
4078
+ if (D) {
4079
+ if (((N = D.author) == null ? void 0 : N.type) === "user" || l && D.created_at && D.created_at <= l) break;
4080
+ !S && D.author && (S = D.author), y++;
4081
+ }
4082
+ }
4083
+ return C && y === 0 && (y = 1), {
4084
+ ...r,
4085
+ _preview: this.convPreview(r, s),
4086
+ _unread: C,
4087
+ _unreadCount: y,
4088
+ _lastAuthor: S
4089
+ };
3986
4090
  });
3987
4091
  },
3988
4092
  // How many threads have an unseen agent/human message. Drives the
@@ -4005,26 +4109,35 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4005
4109
  _ts: this.convLastActivity(n, t[n.id] || [])
4006
4110
  })).sort((n, o) => n._ts < o._ts ? 1 : n._ts > o._ts ? -1 : 0).slice(0, 5);
4007
4111
  },
4008
- // The unread thread with the freshest activity what the étiquette
4009
- // previews. `{ convId, preview, ts }` or null when nothing's unread.
4010
- latestUnread() {
4112
+ // Unread threads (one entry per conv with unseen agent/human
4113
+ // activity), freshest first. Each entry carries everything the
4114
+ // closed-launcher notification card needs: sender identity,
4115
+ // preview, and the count of unseen messages in that thread.
4116
+ latestUnreads() {
4011
4117
  var n;
4012
- const t = ((n = this.s) == null ? void 0 : n.messagesByConv) || {};
4013
- let e = null;
4118
+ const t = ((n = this.s) == null ? void 0 : n.messagesByConv) || {}, e = [];
4014
4119
  for (const o of this.drawerConversations) {
4015
4120
  if (!o._unread) continue;
4016
- const r = this.convLastActivity(o, t[o.id] || []);
4017
- (!e || r > e.ts) && (e = { convId: o.id, preview: o._preview, ts: r });
4121
+ const r = this.convLastActivity(o, t[o.id] || []), s = o._lastAuthor, a = !s || s.type === "agent_ai", l = (s == null ? void 0 : s.name) || (a ? this.agentName : "") || "", g = (s == null ? void 0 : s.avatar_url) || (a ? this.agentAvatarUrl : null);
4122
+ e.push({
4123
+ convId: o.id,
4124
+ preview: o._preview || "Vous avez un nouveau message",
4125
+ ts: r,
4126
+ count: o._unreadCount || 1,
4127
+ senderName: l,
4128
+ senderAvatarUrl: g
4129
+ });
4018
4130
  }
4019
- return e;
4131
+ return e.sort((o, r) => o.ts < r.ts ? 1 : o.ts > r.ts ? -1 : 0), e;
4020
4132
  },
4021
- // Text shown in the closed-launcher étiquette: the last unread
4022
- // message, only while the panel is closed and not dismissed. Empty
4023
- // string => plain launcher.
4024
- launcherPeek() {
4025
- if (this.isOpen || this.isEmbedded || this.labelDismissed) return "";
4026
- const t = this.latestUnread;
4027
- return t ? t.preview || "Vous avez un nouveau message" : "";
4133
+ // Notification cards shown in the closed-launcher stack: the unread
4134
+ // threads above, minus any the user has dismissed (×) for their
4135
+ // current batch. A dismissal is stamped against the conv's current
4136
+ // ts, so a fresh message (new ts) re-shows the card.
4137
+ launcherPeeks() {
4138
+ if (this.isOpen || this.isEmbedded) return [];
4139
+ const t = this.dismissedPeeks || {};
4140
+ return this.latestUnreads.filter((e) => t[e.convId] !== e.ts);
4028
4141
  },
4029
4142
  // True when the user is actively looking at a thread (panel open or
4030
4143
  // embedded, no history drawer overlay, a currentConv exists). Used as
@@ -4130,8 +4243,8 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4130
4243
  if (!t) return [];
4131
4244
  const e = this.revealedAt;
4132
4245
  return (this.s.messagesByConv[t.id] || []).filter((n) => {
4133
- var o, r, s, a, d;
4134
- return (n == null ? void 0 : n.type) === "action" && ((o = n == null ? void 0 : n.payload) == null ? void 0 : o.state) === "pending" || ie(n) && !(e[n.id] > 0) ? !1 : (n == null ? void 0 : n.type) === "action" || (n == null ? void 0 : n.type) === "system" || ((r = n == null ? void 0 : n.payload) == null ? void 0 : r.type) === "system" || Array.isArray((s = n == null ? void 0 : n.payload) == null ? void 0 : s.attachments) && n.payload.attachments.length || (a = n == null ? void 0 : n.metadata) != null && a.artifact || (d = n == null ? void 0 : n.metadata) != null && d.form ? !0 : typeof (n == null ? void 0 : n.text_md) == "string" && n.text_md.trim().length > 0;
4246
+ var o, r, s, a, l;
4247
+ return (n == null ? void 0 : n.type) === "action" && ((o = n == null ? void 0 : n.payload) == null ? void 0 : o.state) === "pending" || ie(n) && !(e[n.id] > 0) ? !1 : (n == null ? void 0 : n.type) === "action" || (n == null ? void 0 : n.type) === "system" || ((r = n == null ? void 0 : n.payload) == null ? void 0 : r.type) === "system" || Array.isArray((s = n == null ? void 0 : n.payload) == null ? void 0 : s.attachments) && n.payload.attachments.length || (a = n == null ? void 0 : n.metadata) != null && a.artifact || (l = n == null ? void 0 : n.metadata) != null && l.form ? !0 : typeof (n == null ? void 0 : n.text_md) == "string" && n.text_md.trim().length > 0;
4135
4248
  });
4136
4249
  },
4137
4250
  // True whenever we should show the "typing" indicator at the bottom
@@ -4173,14 +4286,14 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4173
4286
  return ((e = (t = this.pendingApproval) == null ? void 0 : t.payload) == null ? void 0 : e.name) || ((n = this.pendingApproval) == null ? void 0 : n.text_md) || "Confirmer l'action";
4174
4287
  },
4175
4288
  approvalDetail() {
4176
- var o, r, s, a, d, g;
4289
+ var o, r, s, a, l, g;
4177
4290
  const t = (s = (r = (o = this.pendingApproval) == null ? void 0 : o.payload) == null ? void 0 : r.pending) == null ? void 0 : s.user_explanation;
4178
4291
  if (typeof t == "string" && t.trim())
4179
4292
  return t.trim();
4180
- const e = (g = (d = (a = this.pendingApproval) == null ? void 0 : a.payload) == null ? void 0 : d.pending) == null ? void 0 : g.prepared_params;
4293
+ const e = (g = (l = (a = this.pendingApproval) == null ? void 0 : a.payload) == null ? void 0 : l.pending) == null ? void 0 : g.prepared_params;
4181
4294
  if (!e || typeof e != "object") return "";
4182
4295
  const n = Object.entries(e);
4183
- return n.length ? n.slice(0, 2).map(([C, w]) => `${C}: ${w}`).join(" · ") : "";
4296
+ return n.length ? n.slice(0, 2).map(([C, y]) => `${C}: ${y}`).join(" · ") : "";
4184
4297
  },
4185
4298
  actionInFlight() {
4186
4299
  var t, e;
@@ -4216,13 +4329,13 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4216
4329
  const t = this.currentConv;
4217
4330
  let e = /* @__PURE__ */ new Date();
4218
4331
  if (t) {
4219
- const a = ((r = (((o = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : o[t.id]) || []).find((d) => d == null ? void 0 : d.created_at)) == null ? void 0 : r.created_at) || t.created_at;
4332
+ const a = ((r = (((o = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : o[t.id]) || []).find((l) => l == null ? void 0 : l.created_at)) == null ? void 0 : r.created_at) || t.created_at;
4220
4333
  if (a) {
4221
- const d = new Date(a);
4222
- Number.isNaN(d.getTime()) || (e = d);
4334
+ const l = new Date(a);
4335
+ Number.isNaN(l.getTime()) || (e = l);
4223
4336
  }
4224
4337
  }
4225
- return `Aujourd'hui · ${be(e)}`;
4338
+ return `Aujourd'hui · ${ke(e)}`;
4226
4339
  },
4227
4340
  // Pagination state for the active conversation. Drives the
4228
4341
  // MessageList's scroll-up history loader. Defaults are safe (no
@@ -4238,17 +4351,20 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4238
4351
  }
4239
4352
  },
4240
4353
  watch: {
4241
- // Closed-launcher étiquette: a dismissal only silences the *current*
4242
- // unread batch. A fresh message (newer timestamp, or a different
4243
- // thread) re-expands it; everything read again clears the flag so
4244
- // it's primed for next time.
4245
- latestUnread: {
4246
- handler(t, e) {
4247
- if (!t) {
4248
- this.labelDismissed = !1;
4249
- return;
4250
- }
4251
- (!e || t.convId !== e.convId || t.ts > e.ts) && (this.labelDismissed = !1);
4354
+ // Prune `dismissedPeeks` entries for threads that are no longer
4355
+ // unread (user opened them, or a user reply cleared the unread
4356
+ // flag). Without this, the map would grow unbounded across a
4357
+ // session; the per-batch silencing semantics still come from the
4358
+ // ts comparison in `launcherPeeks`.
4359
+ latestUnreads: {
4360
+ handler(t) {
4361
+ const e = new Set(t.map((a) => a.convId)), n = this.dismissedPeeks || {}, o = Object.keys(n);
4362
+ if (!o.length) return;
4363
+ const r = {};
4364
+ let s = !1;
4365
+ for (const a of o)
4366
+ e.has(a) ? r[a] = n[a] : s = !0;
4367
+ s && (this.dismissedPeeks = r);
4252
4368
  },
4253
4369
  deep: !0
4254
4370
  },
@@ -4332,8 +4448,8 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4332
4448
  n[r.id] = e;
4333
4449
  continue;
4334
4450
  }
4335
- const a = typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0, d = Array.isArray((o = r == null ? void 0 : r.payload) == null ? void 0 : o.attachments) && r.payload.attachments.length > 0;
4336
- if (!a && !d) {
4451
+ const a = typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0, l = Array.isArray((o = r == null ? void 0 : r.payload) == null ? void 0 : o.attachments) && r.payload.attachments.length > 0;
4452
+ if (!a && !l) {
4337
4453
  n[r.id] = e;
4338
4454
  continue;
4339
4455
  }
@@ -4350,9 +4466,9 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4350
4466
  hasWidgetId: !!this.widgetId,
4351
4467
  hasUserId: !!this.userId,
4352
4468
  hasUserHash: !!this.userHash
4353
- }), typeof document < "u" && !document.getElementById(ve)) {
4469
+ }), typeof document < "u" && !document.getElementById(ye)) {
4354
4470
  const t = document.createElement("style");
4355
- t.id = ve, t.textContent = Pe, document.head.appendChild(t);
4471
+ t.id = ye, t.textContent = Pe, document.head.appendChild(t);
4356
4472
  }
4357
4473
  this.hydrateReadState(), await this.boot(), this.isEmbedded && this.store && await this.open();
4358
4474
  },
@@ -4418,9 +4534,9 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4418
4534
  for (let s = e.length - 1; s >= 0; s--) {
4419
4535
  const a = e[s];
4420
4536
  if (!a) continue;
4421
- const d = typeof a.text_md == "string" ? a.text_md.trim() : "";
4422
- if (d)
4423
- return (((n = a.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + d.replace(/\s+/g, " ");
4537
+ const l = typeof a.text_md == "string" ? a.text_md.trim() : "";
4538
+ if (l)
4539
+ return (((n = a.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + l.replace(/\s+/g, " ");
4424
4540
  const g = (o = a.payload) == null ? void 0 : o.attachments;
4425
4541
  if (Array.isArray(g) && g.length) return "📎 Pièce jointe";
4426
4542
  }
@@ -4494,15 +4610,15 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4494
4610
  // bounded by MIN/MAX_BETWEEN_MS.
4495
4611
  scheduleReveal(t) {
4496
4612
  const e = Date.now(), n = ((t == null ? void 0 : t.text_md) || "").length, o = Math.min(
4497
- Pi,
4498
- Math.max(Ui, n * ji)
4613
+ Qi,
4614
+ Math.max(Zi, n * Xi)
4499
4615
  ), s = Math.max(
4500
- e + Ni,
4501
- this.nextRevealAt + Hi
4616
+ e + Ji,
4617
+ this.nextRevealAt + ea
4502
4618
  ) + o;
4503
4619
  this.nextRevealAt = s;
4504
- const a = Math.max(0, s - e), d = t.id, g = setTimeout(() => {
4505
- this.revealedAt = { ...this.revealedAt, [d]: Date.now() }, this.revealTimers = this.revealTimers.filter((C) => C !== g);
4620
+ const a = Math.max(0, s - e), l = t.id, g = setTimeout(() => {
4621
+ this.revealedAt = { ...this.revealedAt, [l]: Date.now() }, this.revealTimers = this.revealTimers.filter((C) => C !== g);
4506
4622
  }, a);
4507
4623
  this.revealTimers.push(g);
4508
4624
  },
@@ -4521,12 +4637,12 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4521
4637
  baseUrl: this.baseUrl,
4522
4638
  widgetId: this.widgetId,
4523
4639
  userId: this.userId
4524
- }), this.transport = me(Fe({
4640
+ }), this.transport = fe(Re({
4525
4641
  baseUrl: this.baseUrl,
4526
4642
  widgetId: this.widgetId,
4527
4643
  userId: this.userId,
4528
4644
  userHash: this.userHash
4529
- })), this.store = me(Ue(this.transport)), this.hydrateNotifPref(), this.setupNotifications(), await this.store.start(), this.customer && typeof this.customer == "object" && await this.store.applyCustomer(this.customer), console.log("[ww-messenger] boot done", {
4645
+ })), this.store = fe(Ue(this.transport)), this.hydrateNotifPref(), this.setupNotifications(), await this.store.start(), this.customer && typeof this.customer == "object" && await this.store.applyCustomer(this.customer), console.log("[ww-messenger] boot done", {
4530
4646
  ready: this.store.state.ready,
4531
4647
  error: this.store.state.error
4532
4648
  });
@@ -4537,17 +4653,26 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4537
4653
  async refresh() {
4538
4654
  this.store && this.store.destroy(), this.cancelReveals(), this.teardownNotifications(), this.revealedAt = {}, this.nextRevealAt = 0, this.convOpenedAt = 0, this.transport = null, this.store = null, this.isOpen = !1, this.draft = "", this.busy = !1, this.bootError = null, this.pendingAttachments = [], this.feedbackBusy = !1, this.feedbackDone = !1, this.historyOpen = !1, this.moreOpen = !1, this.renameDialogOpen = !1, this.draftConv = null, this.activeConvId = null, this.showOnboarding = !1, await this.boot(), this.isEmbedded && this.store && await this.open();
4539
4655
  },
4540
- // Opening straight from the étiquette: land on the unread thread it
4541
- // was previewing rather than whatever was last active.
4542
- async openFromPeek() {
4543
- var e, n;
4544
- const t = (e = this.latestUnread) == null ? void 0 : e.convId;
4545
- t && t !== ((n = this.currentConv) == null ? void 0 : n.id) && (this.draftConv = null, this.activeConvId = t, this.showOnboarding = !1), await this.open();
4656
+ // Opening straight from a notification card: land on that card's
4657
+ // thread rather than whatever was last active. Called with the
4658
+ // convId for the clicked card; falls back to the freshest unread
4659
+ // when invoked without an id (defensive).
4660
+ async openFromPeek(t) {
4661
+ var n, o;
4662
+ const e = t || ((n = this.latestUnreads[0]) == null ? void 0 : n.convId);
4663
+ e && e !== ((o = this.currentConv) == null ? void 0 : o.id) && (this.draftConv = null, this.activeConvId = e, this.showOnboarding = !1), await this.open();
4664
+ },
4665
+ // Stamp the dismissed batch ts for a single conv so its card
4666
+ // disappears from the stack until a fresher message arrives.
4667
+ dismissPeek(t) {
4668
+ const e = this.latestUnreads.find((n) => n.convId === t);
4669
+ e && (this.dismissedPeeks = { ...this.dismissedPeeks, [t]: e.ts });
4546
4670
  },
4547
4671
  async open() {
4548
4672
  this.isOpen = !0, this.store && this.store.setPanelOpen(!0);
4549
4673
  const t = this.currentConv;
4550
4674
  if (t && !t._draft) {
4675
+ this.activeConvId == null && (this.activeConvId = t.id);
4551
4676
  try {
4552
4677
  await this.store.openConversation(t.id);
4553
4678
  } catch (e) {
@@ -4620,14 +4745,28 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4620
4745
  async onDrawerNew() {
4621
4746
  this.historyOpen = !1, await this.startConv();
4622
4747
  },
4623
- async onNotifToggle(t) {
4624
- if (this.notifEnabled = !!t, this.persistNotifPref(), this.notifEnabled && typeof Notification < "u" && Notification.permission === "default")
4748
+ onSoundToggle(t) {
4749
+ this.soundEnabled = !!t, this.persistSoundPref();
4750
+ },
4751
+ async onBrowserNotifToggle(t) {
4752
+ if (typeof Notification > "u") {
4753
+ this.browserNotifEnabled = !1, this.persistBrowserNotifPref();
4754
+ return;
4755
+ }
4756
+ if (!t) {
4757
+ this.browserNotifEnabled = !1, this.persistBrowserNotifPref();
4758
+ return;
4759
+ }
4760
+ let e = Notification.permission;
4761
+ if (e === "default") {
4625
4762
  try {
4626
- const e = await Notification.requestPermission();
4627
- this.notifPermission = e;
4628
- } catch (e) {
4629
- console.warn("[ww-messenger] notif permission request failed", e);
4763
+ e = await Notification.requestPermission();
4764
+ } catch (n) {
4765
+ console.warn("[ww-messenger] notif permission request failed", n), e = "denied";
4630
4766
  }
4767
+ this.notifPermission = e;
4768
+ }
4769
+ this.browserNotifEnabled = e === "granted", this.persistBrowserNotifPref();
4631
4770
  },
4632
4771
  // ── Notifications (sound + browser push) ──────────────────────────
4633
4772
  setupNotifications() {
@@ -4650,33 +4789,45 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4650
4789
  this._audioCtx = null;
4651
4790
  }
4652
4791
  },
4653
- notifStorageKey() {
4654
- return `wm:notif:${this.widgetId || ""}:${this.userId || ""}`;
4792
+ soundStorageKey() {
4793
+ return `wm:notif:sound:${this.widgetId || ""}:${this.userId || ""}`;
4794
+ },
4795
+ browserNotifStorageKey() {
4796
+ return `wm:notif:browser:${this.widgetId || ""}:${this.userId || ""}`;
4655
4797
  },
4656
4798
  hydrateNotifPref() {
4657
4799
  try {
4658
4800
  if (typeof localStorage > "u") return;
4659
- const t = localStorage.getItem(this.notifStorageKey());
4660
- t === "0" ? this.notifEnabled = !1 : t === "1" && (this.notifEnabled = !0);
4801
+ const t = localStorage.getItem(this.soundStorageKey());
4802
+ t === "0" ? this.soundEnabled = !1 : t === "1" && (this.soundEnabled = !0);
4803
+ const e = localStorage.getItem(this.browserNotifStorageKey());
4804
+ e === "0" ? this.browserNotifEnabled = !1 : e === "1" && (this.browserNotifEnabled = typeof Notification < "u" && Notification.permission === "granted");
4805
+ } catch {
4806
+ }
4807
+ },
4808
+ persistSoundPref() {
4809
+ try {
4810
+ if (typeof localStorage > "u") return;
4811
+ localStorage.setItem(this.soundStorageKey(), this.soundEnabled ? "1" : "0");
4661
4812
  } catch {
4662
4813
  }
4663
4814
  },
4664
- persistNotifPref() {
4815
+ persistBrowserNotifPref() {
4665
4816
  try {
4666
4817
  if (typeof localStorage > "u") return;
4667
- localStorage.setItem(this.notifStorageKey(), this.notifEnabled ? "1" : "0");
4818
+ localStorage.setItem(this.browserNotifStorageKey(), this.browserNotifEnabled ? "1" : "0");
4668
4819
  } catch {
4669
4820
  }
4670
4821
  },
4671
4822
  onIncomingNotification(t) {
4672
4823
  var a;
4673
- if (!this.notifEnabled) return;
4824
+ if (!this.soundEnabled && !this.browserNotifEnabled) return;
4674
4825
  const e = t == null ? void 0 : t.conversation_id, n = t == null ? void 0 : t.message;
4675
4826
  if (!e || !n || !ie(n)) return;
4676
4827
  const o = n != null && n.created_at ? Date.parse(n.created_at) : NaN;
4677
4828
  if (Number.isFinite(o) && o < this.convOpenedAt - 1e3) return;
4678
4829
  const r = typeof document < "u" && document.hidden;
4679
- this.isOpen && !r && ((a = this.currentConv) == null ? void 0 : a.id) === e || (this.playNotificationSound(), this.showBrowserNotification(e, n));
4830
+ this.isOpen && !r && ((a = this.currentConv) == null ? void 0 : a.id) === e || (this.soundEnabled && this.playNotificationSound(), this.browserNotifEnabled && this.showBrowserNotification(e, n));
4680
4831
  },
4681
4832
  playNotificationSound() {
4682
4833
  if (typeof window > "u") return;
@@ -4698,27 +4849,27 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4698
4849
  showBrowserNotification(t, e) {
4699
4850
  var a;
4700
4851
  if (typeof Notification > "u" || Notification.permission !== "granted") return;
4701
- const n = this.allConversations.find((d) => d.id === t), o = (n == null ? void 0 : n.name) || ((a = this.widget) == null ? void 0 : a.name) || "Nouveau message", r = typeof (e == null ? void 0 : e.text_md) == "string" ? e.text_md.trim() : "", s = r ? r.slice(0, 140) : "Vous avez un nouveau message";
4852
+ const n = this.allConversations.find((l) => l.id === t), o = (n == null ? void 0 : n.name) || ((a = this.widget) == null ? void 0 : a.name) || "Nouveau message", r = typeof (e == null ? void 0 : e.text_md) == "string" ? e.text_md.trim() : "", s = r ? r.slice(0, 140) : "Vous avez un nouveau message";
4702
4853
  try {
4703
- const d = new Notification(o, {
4854
+ const l = new Notification(o, {
4704
4855
  body: s,
4705
4856
  tag: `wm-${t}`,
4706
4857
  renotify: !1,
4707
4858
  silent: !0
4708
4859
  });
4709
- d.onclick = () => {
4860
+ l.onclick = () => {
4710
4861
  try {
4711
4862
  window.focus();
4712
4863
  } catch {
4713
4864
  }
4714
4865
  this.draftConv = null, this.showOnboarding = !1, this.activeConvId = t, this.isOpen = !0, this.store && this.store.setPanelOpen(!0);
4715
4866
  try {
4716
- d.close();
4867
+ l.close();
4717
4868
  } catch {
4718
4869
  }
4719
4870
  };
4720
- } catch (d) {
4721
- console.warn("[ww-messenger] notification failed", d);
4871
+ } catch (l) {
4872
+ console.warn("[ww-messenger] notification failed", l);
4722
4873
  }
4723
4874
  },
4724
4875
  async onMoreAction(t) {
@@ -4764,7 +4915,7 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4764
4915
  }
4765
4916
  },
4766
4917
  exportCurrentConv() {
4767
- var r, s, a, d, g, C;
4918
+ var r, s, a, l, g, C;
4768
4919
  const t = this.currentConv;
4769
4920
  if (!t) return;
4770
4921
  const e = (((s = (r = this.s) == null ? void 0 : r.messagesByConv) == null ? void 0 : s[t.id]) || []).slice(), n = [
@@ -4772,18 +4923,18 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4772
4923
  t.created_at ? `Créée le : ${t.created_at}` : "",
4773
4924
  ""
4774
4925
  ];
4775
- for (const w of e) {
4776
- if (!w) continue;
4777
- const S = ((a = w.author) == null ? void 0 : a.name) || (((d = w.author) == null ? void 0 : d.type) === "user" ? "Vous" : ((g = w.author) == null ? void 0 : g.type) === "agent_human" ? "Agent" : ((C = w.author) == null ? void 0 : C.type) === "agent_ia" ? "Assistant IA" : "Système"), F = w.created_at ? new Date(w.created_at).toLocaleString("fr-FR") : "", A = (w.text_md || "").trim();
4778
- A && (n.push(`[${F}] ${S} :`), n.push(A), n.push(""));
4926
+ for (const y of e) {
4927
+ if (!y) continue;
4928
+ const S = ((a = y.author) == null ? void 0 : a.name) || (((l = y.author) == null ? void 0 : l.type) === "user" ? "Vous" : ((g = y.author) == null ? void 0 : g.type) === "agent_human" ? "Agent" : ((C = y.author) == null ? void 0 : C.type) === "agent_ia" ? "Assistant IA" : "Système"), N = y.created_at ? new Date(y.created_at).toLocaleString("fr-FR") : "", A = (y.text_md || "").trim();
4929
+ A && (n.push(`[${N}] ${S} :`), n.push(A), n.push(""));
4779
4930
  }
4780
4931
  const o = new Blob([n.join(`
4781
4932
  `)], { type: "text/plain;charset=utf-8" });
4782
4933
  try {
4783
- const w = URL.createObjectURL(o), S = document.createElement("a");
4784
- S.href = w, S.download = `${(t.name || "conversation").replace(/[^a-z0-9-_]+/gi, "_")}.txt`, document.body.appendChild(S), S.click(), document.body.removeChild(S), setTimeout(() => URL.revokeObjectURL(w), 1e3);
4785
- } catch (w) {
4786
- console.error("[ww-messenger] export failed", w);
4934
+ const y = URL.createObjectURL(o), S = document.createElement("a");
4935
+ S.href = y, S.download = `${(t.name || "conversation").replace(/[^a-z0-9-_]+/gi, "_")}.txt`, document.body.appendChild(S), S.click(), document.body.removeChild(S), setTimeout(() => URL.revokeObjectURL(y), 1e3);
4936
+ } catch (y) {
4937
+ console.error("[ww-messenger] export failed", y);
4787
4938
  }
4788
4939
  },
4789
4940
  async onSend(t) {
@@ -4809,12 +4960,12 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4809
4960
  async onFormSubmit({ values: t }) {
4810
4961
  const e = this.pendingForm;
4811
4962
  if (!(e != null && e.form)) return;
4812
- const n = Fi(e.form, t);
4963
+ const n = Gi(e.form, t);
4813
4964
  if (!n) return;
4814
4965
  let o = this.currentConv;
4815
4966
  o && (o._draft && (o = await this.ensureRealConv(), !o) || await this.store.send(o.id, n, {
4816
4967
  metadata: {
4817
- artifact: Di(e.form, t)
4968
+ artifact: Yi(e.form, t)
4818
4969
  }
4819
4970
  }));
4820
4971
  },
@@ -4858,54 +5009,54 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4858
5009
  }
4859
5010
  }
4860
5011
  }
4861
- }, Vi = {
5012
+ }, na = {
4862
5013
  key: 0,
4863
5014
  class: "wm-loading",
4864
5015
  "aria-busy": "true",
4865
5016
  "aria-live": "polite"
4866
- }, qi = {
5017
+ }, sa = {
4867
5018
  key: 0,
4868
5019
  class: "wm-state"
4869
- }, Wi = { class: "wm-state__err" }, Ki = { class: "wm-state__errSub" }, Gi = { class: "wm-bottom" }, Yi = {
5020
+ }, ra = { class: "wm-state__err" }, ia = { class: "wm-state__errSub" }, aa = { class: "wm-bottom" }, oa = {
4870
5021
  key: 0,
4871
5022
  ref: "floatEl",
4872
5023
  class: "wm-float"
4873
- }, Ji = {
5024
+ }, la = {
4874
5025
  key: 1,
4875
5026
  class: "wm-actionWait",
4876
5027
  role: "status",
4877
5028
  "aria-live": "polite"
4878
- }, Xi = { class: "wm-actionWait__lbl" }, Zi = {
5029
+ }, da = { class: "wm-actionWait__lbl" }, ca = {
4879
5030
  key: 2,
4880
5031
  class: "wm-attached"
4881
- }, Qi = ["onClick"];
4882
- function ea(t, e, n, o, r, s) {
4883
- const a = B("Launcher"), d = B("Header"), g = B("Onboarding"), C = B("MessageList"), w = B("ApprovalCard"), S = B("FormCard"), F = B("Feedback"), A = B("SuggestionChips"), U = B("Composer"), x = B("MoreMenu"), j = B("RenameDialog"), P = B("HistoryDrawer");
4884
- return l(), c("div", {
5032
+ }, ua = ["onClick"];
5033
+ function ha(t, e, n, o, r, s) {
5034
+ const a = I("Launcher"), l = I("Header"), g = I("Onboarding"), C = I("MessageList"), y = I("ApprovalCard"), S = I("FormCard"), N = I("Feedback"), A = I("SuggestionChips"), D = I("Composer"), x = I("MoreMenu"), U = I("RenameDialog"), P = I("HistoryDrawer");
5035
+ return d(), c("div", {
4885
5036
  class: E(["wm-root", `wm-root--${n.displayMode}`])
4886
5037
  }, [
4887
- !r.isOpen && !s.isEmbedded ? (l(), L(a, {
5038
+ !r.isOpen && !s.isEmbedded ? (d(), L(a, {
4888
5039
  key: 0,
4889
5040
  "unread-count": s.unreadCount,
4890
- peek: s.launcherPeek,
5041
+ peeks: s.launcherPeeks,
4891
5042
  onOpen: s.openFromPeek,
4892
- onDismiss: e[0] || (e[0] = (R) => r.labelDismissed = !0)
4893
- }, null, 8, ["unread-count", "peek", "onOpen"])) : b("", !0),
4894
- r.isOpen || s.isEmbedded ? (l(), c("section", {
5043
+ onDismiss: s.dismissPeek
5044
+ }, null, 8, ["unread-count", "peeks", "onOpen", "onDismiss"])) : b("", !0),
5045
+ r.isOpen || s.isEmbedded ? (d(), c("section", {
4895
5046
  key: 1,
4896
5047
  class: E(["wm-panel", `wm-panel--${n.displayMode}`]),
4897
- style: G(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
5048
+ style: z(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
4898
5049
  role: "dialog",
4899
5050
  "aria-label": "Messenger"
4900
5051
  }, [
4901
- !s.ready && !s.error ? (l(), c("div", Vi, [
4902
- s.isEmbedded ? b("", !0) : (l(), c("button", {
5052
+ !s.ready && !s.error ? (d(), c("div", na, [
5053
+ s.isEmbedded ? b("", !0) : (d(), c("button", {
4903
5054
  key: 0,
4904
5055
  type: "button",
4905
5056
  class: "wm-loading__close",
4906
5057
  "aria-label": "Réduire",
4907
- onClick: e[1] || (e[1] = (...R) => s.close && s.close(...R))
4908
- }, [...e[8] || (e[8] = [
5058
+ onClick: e[0] || (e[0] = (...R) => s.close && s.close(...R))
5059
+ }, [...e[7] || (e[7] = [
4909
5060
  i("svg", {
4910
5061
  width: "13",
4911
5062
  height: "13",
@@ -4920,12 +5071,12 @@ function ea(t, e, n, o, r, s) {
4920
5071
  i("path", { d: "M18 6L6 18M6 6l12 12" })
4921
5072
  ], -1)
4922
5073
  ])])),
4923
- e[9] || (e[9] = i("div", {
5074
+ e[8] || (e[8] = i("div", {
4924
5075
  class: "wm-loading__spinner",
4925
5076
  "aria-hidden": "true"
4926
5077
  }, null, -1))
4927
- ])) : (l(), c(M, { key: 1 }, [
4928
- K(d, {
5078
+ ])) : (d(), c(M, { key: 1 }, [
5079
+ K(l, {
4929
5080
  title: s.headerTitle,
4930
5081
  escalated: s.isEscalated,
4931
5082
  "agent-name": s.humanAgentName,
@@ -4940,9 +5091,9 @@ function ea(t, e, n, o, r, s) {
4940
5091
  onMore: s.toggleMore,
4941
5092
  onClose: s.close
4942
5093
  }, null, 8, ["title", "escalated", "agent-name", "agent-avatar-url", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "onBack", "onMore", "onClose"]),
4943
- s.error ? (l(), c("div", qi, [
4944
- i("div", Wi, [
4945
- e[11] || (e[11] = i("div", { class: "wm-state__errIcon" }, [
5094
+ s.error ? (d(), c("div", sa, [
5095
+ i("div", ra, [
5096
+ e[10] || (e[10] = i("div", { class: "wm-state__errIcon" }, [
4946
5097
  i("svg", {
4947
5098
  width: "14",
4948
5099
  height: "14",
@@ -4958,11 +5109,11 @@ function ea(t, e, n, o, r, s) {
4958
5109
  ])
4959
5110
  ], -1)),
4960
5111
  i("div", null, [
4961
- e[10] || (e[10] = i("div", { class: "wm-state__errTitle" }, "Connexion impossible", -1)),
4962
- i("div", Ki, k(s.error), 1)
5112
+ e[9] || (e[9] = i("div", { class: "wm-state__errTitle" }, "Connexion impossible", -1)),
5113
+ i("div", ia, k(s.error), 1)
4963
5114
  ])
4964
5115
  ])
4965
- ])) : s.currentConv ? (l(), c(M, { key: 2 }, [
5116
+ ])) : s.currentConv ? (d(), c(M, { key: 2 }, [
4966
5117
  K(C, {
4967
5118
  ref: "messageList",
4968
5119
  messages: s.displayedMessages,
@@ -4975,40 +5126,40 @@ function ea(t, e, n, o, r, s) {
4975
5126
  "unread-boundary-ts": r.unreadBoundaryTs,
4976
5127
  onLoadMore: s.onLoadMore
4977
5128
  }, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "unread-anchor-ts", "unread-boundary-ts", "onLoadMore"]),
4978
- i("div", Gi, [
4979
- s.floatVisible ? (l(), c("div", Yi, [
4980
- s.approvalReady ? (l(), L(w, {
5129
+ i("div", aa, [
5130
+ s.floatVisible ? (d(), c("div", oa, [
5131
+ s.approvalReady ? (d(), L(y, {
4981
5132
  key: 0,
4982
5133
  action: s.approvalTitle,
4983
5134
  detail: s.approvalDetail,
4984
5135
  callbacks: s.pendingApproval.callbacks,
4985
5136
  onCallback: s.onApprovalCallback
4986
- }, null, 8, ["action", "detail", "callbacks", "onCallback"])) : s.pendingForm ? (l(), L(S, {
5137
+ }, null, 8, ["action", "detail", "callbacks", "onCallback"])) : s.pendingForm ? (d(), L(S, {
4987
5138
  key: s.pendingForm.message && s.pendingForm.message.id,
4988
5139
  form: s.pendingForm.form,
4989
5140
  onSubmit: s.onFormSubmit
4990
- }, null, 8, ["form", "onSubmit"])) : s.showFeedback ? (l(), L(F, {
5141
+ }, null, 8, ["form", "onSubmit"])) : s.showFeedback ? (d(), L(N, {
4991
5142
  key: 2,
4992
5143
  busy: r.feedbackBusy,
4993
5144
  done: r.feedbackDone,
4994
5145
  onSubmit: s.onFeedback
4995
- }, null, 8, ["busy", "done", "onSubmit"])) : (l(), L(A, {
5146
+ }, null, 8, ["busy", "done", "onSubmit"])) : (d(), L(A, {
4996
5147
  key: 3,
4997
5148
  items: s.suggestions,
4998
5149
  onSelect: s.onSuggestion
4999
5150
  }, null, 8, ["items", "onSelect"]))
5000
5151
  ], 512)) : b("", !0),
5001
- s.actionInFlight ? (l(), c("div", Ji, [
5002
- e[12] || (e[12] = i("span", {
5152
+ s.actionInFlight ? (d(), c("div", la, [
5153
+ e[11] || (e[11] = i("span", {
5003
5154
  class: "wm-actionWait__spinner",
5004
5155
  "aria-hidden": "true"
5005
5156
  }, null, -1)),
5006
- i("span", Xi, k(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
5007
- ])) : (l(), L(U, {
5157
+ i("span", da, k(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
5158
+ ])) : (d(), L(D, {
5008
5159
  key: 2,
5009
5160
  ref: "composer",
5010
5161
  modelValue: r.draft,
5011
- "onUpdate:modelValue": e[3] || (e[3] = (R) => r.draft = R),
5162
+ "onUpdate:modelValue": e[2] || (e[2] = (R) => r.draft = R),
5012
5163
  placeholder: s.composerPlaceholder,
5013
5164
  disabled: !!s.pendingApproval,
5014
5165
  "attach-label": "Joindre un fichier",
@@ -5016,30 +5167,32 @@ function ea(t, e, n, o, r, s) {
5016
5167
  onAttach: s.onAttach
5017
5168
  }, null, 8, ["modelValue", "placeholder", "disabled", "onSend", "onAttach"]))
5018
5169
  ]),
5019
- r.moreOpen ? (l(), L(x, {
5170
+ r.moreOpen ? (d(), L(x, {
5020
5171
  key: 0,
5021
5172
  "can-rename": !!s.currentConv && !s.currentConv._draft,
5022
5173
  "can-export": !!s.currentConv && !s.currentConv._draft,
5023
- "notif-enabled": r.notifEnabled,
5174
+ "sound-enabled": r.soundEnabled,
5175
+ "browser-notif-enabled": r.browserNotifEnabled,
5024
5176
  "status-url": s.statusUrl,
5025
5177
  "help-url": s.helpUrl,
5026
- onClose: e[4] || (e[4] = (R) => r.moreOpen = !1),
5027
- onNotifToggle: s.onNotifToggle,
5178
+ onClose: e[3] || (e[3] = (R) => r.moreOpen = !1),
5179
+ onSoundToggle: s.onSoundToggle,
5180
+ onBrowserNotifToggle: s.onBrowserNotifToggle,
5028
5181
  onAction: s.onMoreAction
5029
- }, null, 8, ["can-rename", "can-export", "notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : b("", !0),
5030
- r.renameDialogOpen && s.currentConv && !s.currentConv._draft ? (l(), L(j, {
5182
+ }, null, 8, ["can-rename", "can-export", "sound-enabled", "browser-notif-enabled", "status-url", "help-url", "onSoundToggle", "onBrowserNotifToggle", "onAction"])) : b("", !0),
5183
+ r.renameDialogOpen && s.currentConv && !s.currentConv._draft ? (d(), L(U, {
5031
5184
  key: 1,
5032
5185
  "initial-value": s.currentConv.name || "",
5033
5186
  title: "Modifier le titre de la conversation",
5034
- onClose: e[5] || (e[5] = (R) => r.renameDialogOpen = !1),
5187
+ onClose: e[4] || (e[4] = (R) => r.renameDialogOpen = !1),
5035
5188
  onSubmit: s.onRenameSubmit
5036
5189
  }, null, 8, ["initial-value", "onSubmit"])) : b("", !0),
5037
- r.pendingAttachments.length ? (l(), c("div", Zi, [
5038
- (l(!0), c(M, null, D(r.pendingAttachments, (R, H) => (l(), c("div", {
5190
+ r.pendingAttachments.length ? (d(), c("div", ca, [
5191
+ (d(!0), c(M, null, F(r.pendingAttachments, (R, H) => (d(), c("div", {
5039
5192
  key: H,
5040
5193
  class: "wm-attached__chip"
5041
5194
  }, [
5042
- e[14] || (e[14] = i("svg", {
5195
+ e[13] || (e[13] = i("svg", {
5043
5196
  width: "11",
5044
5197
  height: "11",
5045
5198
  viewBox: "0 0 24 24",
@@ -5056,8 +5209,8 @@ function ea(t, e, n, o, r, s) {
5056
5209
  i("button", {
5057
5210
  type: "button",
5058
5211
  "aria-label": "Retirer",
5059
- onClick: (Y) => r.pendingAttachments.splice(H, 1)
5060
- }, [...e[13] || (e[13] = [
5212
+ onClick: (J) => r.pendingAttachments.splice(H, 1)
5213
+ }, [...e[12] || (e[12] = [
5061
5214
  i("svg", {
5062
5215
  width: "10",
5063
5216
  height: "10",
@@ -5071,10 +5224,10 @@ function ea(t, e, n, o, r, s) {
5071
5224
  }, [
5072
5225
  i("path", { d: "M18 6L6 18M6 6l12 12" })
5073
5226
  ], -1)
5074
- ])], 8, Qi)
5227
+ ])], 8, ua)
5075
5228
  ]))), 128))
5076
5229
  ])) : b("", !0)
5077
- ], 64)) : (l(), L(g, {
5230
+ ], 64)) : (d(), L(g, {
5078
5231
  key: 1,
5079
5232
  "welcome-message": s.widgetWelcomeMessage,
5080
5233
  "agent-name": s.agentName,
@@ -5084,73 +5237,75 @@ function ea(t, e, n, o, r, s) {
5084
5237
  onStart: s.startConv,
5085
5238
  onSelect: s.onQuickLink,
5086
5239
  onResume: s.onDrawerPick,
5087
- onViewAll: e[2] || (e[2] = (R) => r.historyOpen = !0)
5240
+ onViewAll: e[1] || (e[1] = (R) => r.historyOpen = !0)
5088
5241
  }, null, 8, ["welcome-message", "agent-name", "quick-links", "open-threads", "busy", "onStart", "onSelect", "onResume"])),
5089
- r.historyOpen ? (l(), L(P, {
5242
+ r.historyOpen ? (d(), L(P, {
5090
5243
  key: 3,
5091
5244
  conversations: s.drawerConversations,
5092
5245
  "active-id": s.currentConv ? s.currentConv.id : null,
5093
- onClose: e[6] || (e[6] = (R) => r.historyOpen = !1),
5246
+ onClose: e[5] || (e[5] = (R) => r.historyOpen = !1),
5094
5247
  onNew: s.onDrawerNew,
5095
5248
  onPick: s.onDrawerPick
5096
5249
  }, null, 8, ["conversations", "active-id", "onNew", "onPick"])) : b("", !0),
5097
- r.moreOpen && !s.currentConv ? (l(), L(x, {
5250
+ r.moreOpen && !s.currentConv ? (d(), L(x, {
5098
5251
  key: 4,
5099
5252
  "can-rename": !1,
5100
5253
  "can-export": !1,
5101
- "notif-enabled": r.notifEnabled,
5254
+ "sound-enabled": r.soundEnabled,
5255
+ "browser-notif-enabled": r.browserNotifEnabled,
5102
5256
  "status-url": s.statusUrl,
5103
5257
  "help-url": s.helpUrl,
5104
- onClose: e[7] || (e[7] = (R) => r.moreOpen = !1),
5105
- onNotifToggle: s.onNotifToggle,
5258
+ onClose: e[6] || (e[6] = (R) => r.moreOpen = !1),
5259
+ onSoundToggle: s.onSoundToggle,
5260
+ onBrowserNotifToggle: s.onBrowserNotifToggle,
5106
5261
  onAction: s.onMoreAction
5107
- }, null, 8, ["notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : b("", !0)
5262
+ }, null, 8, ["sound-enabled", "browser-notif-enabled", "status-url", "help-url", "onSoundToggle", "onBrowserNotifToggle", "onAction"])) : b("", !0)
5108
5263
  ], 64))
5109
5264
  ], 6)) : b("", !0)
5110
5265
  ], 2);
5111
5266
  }
5112
- const sa = /* @__PURE__ */ $(zi, [["render", ea], ["__scopeId", "data-v-e5f17e35"]]), ra = "0.3.5";
5267
+ const _a = /* @__PURE__ */ $(ta, [["render", ha], ["__scopeId", "data-v-a000a0f5"]]), pa = "0.3.6";
5113
5268
  export {
5114
5269
  ne as AIAvatar,
5115
- ce as AVATAR_COLORS,
5116
- tn as ActionResult,
5117
- hr as ApprovalCard,
5118
- cn as ArtifactFormResponse,
5119
- Cn as ArtifactInfoCard,
5120
- Hn as ArtifactRenderer,
5121
- Nn as ArtifactTicket,
5122
- es as AttachmentPreview,
5123
- os as Bubble,
5124
- Zs as Composer,
5270
+ ue as AVATAR_COLORS,
5271
+ fn as ActionResult,
5272
+ Ar as ApprovalCard,
5273
+ kn as ArtifactFormResponse,
5274
+ Ln as ArtifactInfoCard,
5275
+ es as ArtifactRenderer,
5276
+ Jn as ArtifactTicket,
5277
+ hs as AttachmentPreview,
5278
+ ys as Bubble,
5279
+ cr as Composer,
5125
5280
  He as DEFAULT_BASE_URL,
5126
- Yr as Feedback,
5127
- jr as FormCard,
5128
- wt as Header,
5129
- pi as HistoryDrawer,
5130
- ke as HumanAvatar,
5131
- Ge as Launcher,
5132
- he as MEDIA_RECORDER_SUPPORTED,
5133
- Es as MessageList,
5134
- sa as Messenger,
5135
- Ai as MoreMenu,
5136
- zt as Onboarding,
5137
- oe as SCREEN_CAPTURE_SUPPORTED,
5138
- nr as SuggestionChips,
5139
- lt as TeamAvatars,
5140
- us as Typing,
5141
- ra as VERSION,
5142
- ye as avatarColor,
5143
- we as avatarInitials,
5144
- Ls as captureScreenshotFile,
5145
- N as colors,
5281
+ oi as Feedback,
5282
+ Xr as FormCard,
5283
+ Mt as Header,
5284
+ Mi as HistoryDrawer,
5285
+ he as HumanAvatar,
5286
+ it as Launcher,
5287
+ me as MEDIA_RECORDER_SUPPORTED,
5288
+ Vs as MessageList,
5289
+ _a as Messenger,
5290
+ Ri as MoreMenu,
5291
+ tn as Onboarding,
5292
+ le as SCREEN_CAPTURE_SUPPORTED,
5293
+ fr as SuggestionChips,
5294
+ pt as TeamAvatars,
5295
+ Cs as Typing,
5296
+ pa as VERSION,
5297
+ we as avatarColor,
5298
+ be as avatarInitials,
5299
+ Ws as captureScreenshotFile,
5300
+ j as colors,
5146
5301
  Ue as createStore,
5147
- Fe as createTransport,
5148
- sa as default,
5149
- be as formatTime,
5150
- na as guessAttachmentKind,
5151
- $s as pickRecorderMime,
5152
- ss as renderMarkdown,
5153
- Fs as startScreenRecording,
5302
+ Re as createTransport,
5303
+ _a as default,
5304
+ ke as formatTime,
5305
+ fa as guessAttachmentKind,
5306
+ qs as pickRecorderMime,
5307
+ _s as renderMarkdown,
5308
+ Gs as startScreenRecording,
5154
5309
  Pe as tokensCss,
5155
5310
  je as uuid,
5156
5311
  je as v4