@_solaris/messenger-widget 0.3.2 → 0.3.3

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