@_solaris/messenger-widget 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/messenger.js CHANGED
@@ -1,15 +1,15 @@
1
- import { reactive as Ae, openBlock as l, createElementBlock as d, createVNode as z, Transition as Se, withCtx as xe, withKeys as ue, withModifiers as J, createElementVNode as i, toDisplayString as y, createCommentVNode as v, normalizeStyle as H, normalizeClass as B, Fragment as E, renderList as F, resolveComponent as O, createBlock as $, createTextVNode as se, resolveDynamicComponent as Me, renderSlot as Te, withDirectives as q, vModelText as G, vModelCheckbox as Ie, vModelSelect as Oe, createStaticVNode as de, markRaw as he } from "vue";
2
- const Ee = [
1
+ import { reactive as xe, openBlock as l, createElementBlock as c, createVNode as H, Transition as Me, withCtx as Te, withKeys as me, withModifiers as Y, createElementVNode as i, toDisplayString as b, createCommentVNode as y, normalizeStyle as P, normalizeClass as E, Fragment as O, renderList as F, resolveComponent as I, createBlock as $, createTextVNode as se, resolveDynamicComponent as Ie, renderSlot as Oe, withDirectives as V, vModelText as G, vModelCheckbox as Ee, vModelSelect as Be, createStaticVNode as ue, markRaw as fe } from "vue";
2
+ const Le = [
3
3
  "connected",
4
4
  "message",
5
5
  "message_stream",
6
6
  "conversation_updated",
7
7
  "config_updated",
8
8
  "action_status"
9
- ], Be = 5 * 60 * 1e3, Le = 10 * 60 * 1e3, Re = 30 * 1e3;
10
- function $e(t) {
9
+ ], Re = 5 * 60 * 1e3, $e = 10 * 60 * 1e3, Fe = 5 * 60 * 1e3;
10
+ function je(t) {
11
11
  const e = {
12
- baseUrl: Fe(t.baseUrl || ""),
12
+ baseUrl: Ue(t.baseUrl || ""),
13
13
  widgetId: t.widgetId || "",
14
14
  userId: t.userId || "",
15
15
  userHash: t.userHash || "",
@@ -31,21 +31,21 @@ function $e(t) {
31
31
  throw new Error(
32
32
  "[transport] baseUrl, widgetId, userId, userHash are all required"
33
33
  );
34
- function n(m, _) {
35
- return e.listeners.has(m) || e.listeners.set(m, /* @__PURE__ */ new Set()), e.listeners.get(m).add(_), () => e.listeners.get(m).delete(_);
34
+ function n(h, f) {
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(m, _) {
38
- const b = e.listeners.get(m);
39
- b && b.forEach((S) => {
37
+ function a(h, f) {
38
+ const p = e.listeners.get(h);
39
+ p && p.forEach((k) => {
40
40
  try {
41
- S(_);
42
- } catch (M) {
43
- console.error("[transport] listener", m, M);
41
+ k(f);
42
+ } catch (T) {
43
+ console.error("[transport] listener", h, T);
44
44
  }
45
45
  });
46
46
  }
47
- function r(m) {
48
- e.connection !== m && (e.connection = m, a("connection", m));
47
+ function r(h) {
48
+ e.connection !== h && (e.connection = h, a("connection", h));
49
49
  }
50
50
  function s() {
51
51
  return {
@@ -54,36 +54,36 @@ function $e(t) {
54
54
  "X-Widget-Id": e.widgetId
55
55
  };
56
56
  }
57
- async function o(m, _, b) {
58
- const S = await fetch(`${e.baseUrl}${_}`, {
59
- method: m,
57
+ async function o(h, f, p) {
58
+ const k = await fetch(`${e.baseUrl}${f}`, {
59
+ method: h,
60
60
  headers: { "Content-Type": "application/json", ...s() },
61
- body: b !== void 0 ? JSON.stringify(b) : void 0
61
+ body: p !== void 0 ? JSON.stringify(p) : void 0
62
62
  });
63
- if (!S.ok) {
64
- const M = await c(S), D = new Error(
65
- `HTTP ${S.status} ${m} ${_} :: ${(M == null ? void 0 : M.error) || S.statusText}`
63
+ if (!k.ok) {
64
+ const T = await d(k), M = new Error(
65
+ `HTTP ${k.status} ${h} ${f} :: ${(T == null ? void 0 : T.error) || k.statusText}`
66
66
  );
67
- throw D.status = S.status, D.body = M, D;
67
+ throw M.status = k.status, M.body = T, M;
68
68
  }
69
- return S.status === 204 ? null : S.json();
69
+ return k.status === 204 ? null : k.json();
70
70
  }
71
- async function c(m) {
71
+ async function d(h) {
72
72
  try {
73
- return await m.json();
73
+ return await h.json();
74
74
  } catch {
75
75
  return null;
76
76
  }
77
77
  }
78
- async function p() {
79
- const [m, _] = await Promise.all([
78
+ async function v() {
79
+ const [h, f] = await Promise.all([
80
80
  // Public — no HMAC required.
81
- fetch(`${e.baseUrl}/widgets/${encodeURIComponent(e.widgetId)}/config`).then(async (b) => {
82
- if (!b.ok) {
83
- const S = await c(b);
84
- throw new Error(`HTTP ${b.status} GET /widgets/:id/config :: ${(S == null ? void 0 : S.error) || b.statusText}`);
81
+ fetch(`${e.baseUrl}/widgets/${encodeURIComponent(e.widgetId)}/config`).then(async (p) => {
82
+ if (!p.ok) {
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
- return b.json();
86
+ return p.json();
87
87
  }),
88
88
  // HMAC-protected.
89
89
  o("GET", "/customers/me")
@@ -91,212 +91,212 @@ function $e(t) {
91
91
  return {
92
92
  config: (
93
93
  /** @type {import('./types.js').BootstrapConfig} */
94
- m
94
+ h
95
95
  ),
96
- customer: (_ == null ? void 0 : _.customer) ?? null
96
+ customer: (f == null ? void 0 : f.customer) ?? null
97
97
  };
98
98
  }
99
- async function k() {
100
- const m = await o("GET", "/customers/me");
101
- return (m == null ? void 0 : m.customer) ?? null;
99
+ async function C() {
100
+ const h = await o("GET", "/customers/me");
101
+ return (h == null ? void 0 : h.customer) ?? null;
102
102
  }
103
- async function g(m) {
104
- const _ = await o("PATCH", "/customers/me", m);
105
- return (_ == null ? void 0 : _.customer) ?? null;
103
+ async function w(h) {
104
+ const f = await o("PATCH", "/customers/me", h);
105
+ return (f == null ? void 0 : f.customer) ?? null;
106
106
  }
107
- async function T() {
108
- const m = await o("GET", "/conversations");
109
- return (m == null ? void 0 : m.conversations) ?? [];
107
+ async function S() {
108
+ const h = await o("GET", "/conversations");
109
+ return (h == null ? void 0 : h.conversations) ?? [];
110
110
  }
111
- async function R(m = {}) {
112
- return (await o("POST", "/conversations", m)).conversation;
111
+ async function L(h = {}) {
112
+ return (await o("POST", "/conversations", h)).conversation;
113
113
  }
114
- async function x(m) {
115
- return (await o("GET", `/conversations/${encodeURIComponent(m)}`)).conversation;
114
+ async function A(h) {
115
+ return (await o("GET", `/conversations/${encodeURIComponent(h)}`)).conversation;
116
116
  }
117
- async function N(m, _) {
118
- return (await o("PATCH", `/conversations/${encodeURIComponent(m)}`, _)).conversation;
117
+ async function D(h, f) {
118
+ return (await o("PATCH", `/conversations/${encodeURIComponent(h)}`, f)).conversation;
119
119
  }
120
- async function I(m, _ = {}) {
121
- const b = new URLSearchParams();
122
- _.before && b.set("before", _.before), _.since && b.set("since", _.since), _.limit && b.set("limit", String(_.limit));
123
- const S = b.toString() ? `?${b.toString()}` : "";
120
+ async function x(h, f = {}) {
121
+ const p = new URLSearchParams();
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 k = p.toString() ? `?${p.toString()}` : "";
124
124
  return o(
125
125
  "GET",
126
- `/conversations/${encodeURIComponent(m)}/messages${S}`
126
+ `/conversations/${encodeURIComponent(h)}/messages${k}`
127
127
  );
128
128
  }
129
- async function P(m, _) {
129
+ async function N(h, f) {
130
130
  W();
131
- const b = {
132
- client_msg_id: _.client_msg_id,
131
+ const p = {
132
+ client_msg_id: f.client_msg_id,
133
133
  type: "content",
134
- text_md: _.text_md,
134
+ text_md: f.text_md,
135
135
  author: { id: e.userId, type: "user" },
136
- created_at: _.created_at || (/* @__PURE__ */ new Date()).toISOString()
136
+ created_at: f.created_at || (/* @__PURE__ */ new Date()).toISOString()
137
137
  };
138
- return Array.isArray(_.attachments) && _.attachments.length && (b.payload = { type: "content", attachments: _.attachments }), _.metadata && typeof _.metadata == "object" && (b.metadata = _.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), o(
139
139
  "POST",
140
- `/conversations/${encodeURIComponent(m)}/messages`,
141
- b
140
+ `/conversations/${encodeURIComponent(h)}/messages`,
141
+ p
142
142
  );
143
143
  }
144
- async function U(m, _, b) {
144
+ async function j(h, f, p) {
145
145
  return W(), o(
146
146
  "POST",
147
- `/messages/${encodeURIComponent(m)}/callbacks/${encodeURIComponent(_)}`,
148
- b ? { inputs: b } : {}
147
+ `/messages/${encodeURIComponent(h)}/callbacks/${encodeURIComponent(f)}`,
148
+ p ? { inputs: p } : {}
149
149
  );
150
150
  }
151
- async function V(m) {
152
- const _ = (
151
+ async function z(h) {
152
+ const f = (
153
153
  /** @type {File} */
154
- m.name || "attachment"
155
- ), b = m.type || "application/octet-stream", S = m.size || 0, M = (
154
+ h.name || "attachment"
155
+ ), p = h.type || "application/octet-stream", k = h.size || 0, T = (
156
156
  /** @type {import('./types.js').AttachmentUploadTicket} */
157
157
  await o("POST", "/attachments", {
158
- mime_type: b,
159
- size_bytes: S,
160
- name: _
158
+ mime_type: p,
159
+ size_bytes: k,
160
+ name: f
161
161
  })
162
- ), D = await fetch(M.upload_url, {
162
+ ), M = await fetch(T.upload_url, {
163
163
  method: "PUT",
164
- headers: { "Content-Type": b },
165
- body: m
164
+ headers: { "Content-Type": p },
165
+ body: h
166
166
  });
167
- if (!D.ok)
168
- throw new Error(`HTTP ${D.status} PUT signed upload`);
167
+ if (!M.ok)
168
+ throw new Error(`HTTP ${M.status} PUT signed upload`);
169
169
  return {
170
- type: Ue(b),
171
- path: M.path,
172
- mime_type: b,
173
- size_bytes: S
170
+ type: De(p),
171
+ path: T.path,
172
+ mime_type: p,
173
+ size_bytes: k
174
174
  };
175
175
  }
176
- async function Q(m) {
176
+ async function X(h) {
177
177
  return o(
178
178
  "GET",
179
- `/attachments/sign?path=${encodeURIComponent(m)}`
179
+ `/attachments/sign?path=${encodeURIComponent(h)}`
180
180
  );
181
181
  }
182
- function Z() {
183
- const m = new URLSearchParams({
182
+ function re() {
183
+ const h = new URLSearchParams({
184
184
  userId: e.userId,
185
185
  userHash: e.userHash,
186
186
  widgetId: e.widgetId
187
187
  }).toString();
188
- return `${e.baseUrl}/stream?${m}`;
188
+ return `${e.baseUrl}/stream?${h}`;
189
189
  }
190
- function K() {
190
+ function q() {
191
191
  if (!e.eventSource && !(typeof document < "u" && document.hidden))
192
192
  try {
193
- const m = new EventSource(Z());
194
- for (const _ of Ee)
195
- m.addEventListener(_, (b) => re(_, b.data));
196
- m.addEventListener("error", () => a("error", new Error("SSE error"))), e.eventSource = m, r("open");
197
- } catch (m) {
198
- console.error("[transport] SSE open failed", m), a("error", m);
193
+ const h = new EventSource(re());
194
+ for (const f of Le)
195
+ h.addEventListener(f, (p) => ie(f, p.data));
196
+ h.addEventListener("error", () => a("error", new Error("SSE error"))), e.eventSource = h, r("open");
197
+ } catch (h) {
198
+ console.error("[transport] SSE open failed", h), a("error", h);
199
199
  }
200
200
  }
201
- function re(m, _) {
201
+ function ie(h, f) {
202
202
  try {
203
- const b = JSON.parse(_), S = b && typeof b == "object" && "data" in b ? b.data : b;
204
- a(m, S);
205
- } catch (b) {
206
- console.error("[transport] bad SSE payload", m, b);
203
+ const p = JSON.parse(f), k = p && typeof p == "object" && "data" in p ? p.data : p;
204
+ a(h, k);
205
+ } catch (p) {
206
+ console.error("[transport] bad SSE payload", h, p);
207
207
  }
208
208
  }
209
- function Y() {
209
+ function K() {
210
210
  e.eventSource && (e.eventSource.close(), e.eventSource = null), e.connection !== "paused" && r("idle");
211
211
  }
212
212
  function W() {
213
- clearTimeout(e.burstTimer), K(), e.panelOpen || (e.burstTimer = setTimeout(() => {
214
- e.panelOpen || Y();
215
- }, Le));
213
+ clearTimeout(e.burstTimer), q(), e.panelOpen || (e.burstTimer = setTimeout(() => {
214
+ e.panelOpen || K();
215
+ }, $e));
216
216
  }
217
- function ie(m) {
218
- e.panelOpen = !!m, e.panelOpen ? (clearTimeout(e.burstTimer), K()) : W();
217
+ function ae(h) {
218
+ e.panelOpen = !!h, e.panelOpen ? (clearTimeout(e.burstTimer), q()) : W();
219
219
  }
220
- async function u() {
220
+ async function oe() {
221
221
  try {
222
- const m = await T(), _ = m.reduce((S, M) => {
223
- const D = M == null ? void 0 : M.last_message_at;
224
- return D && (!S || D > S) ? D : S;
222
+ const h = await S(), f = h.reduce((k, T) => {
223
+ const M = T == null ? void 0 : T.last_message_at;
224
+ return M && (!k || M > k) ? M : k;
225
225
  }, null);
226
- _ && (!e.lastActivityAt || _ > e.lastActivityAt) && (e.lastActivityAt = _, a("activity", { conversations: m, latestAt: _ }), W());
227
- } catch (m) {
228
- console.error("[transport] poll failed", m);
226
+ f && (!e.lastActivityAt || f > e.lastActivityAt) && (e.lastActivityAt = f, a("activity", { conversations: h, latestAt: f }), W());
227
+ } catch (h) {
228
+ console.error("[transport] poll failed", h);
229
229
  }
230
230
  }
231
- function h() {
232
- f(), !(typeof document < "u" && document.hidden) && (e.pollTimer = setInterval(u, Be));
231
+ function Q() {
232
+ u(), !(typeof document < "u" && document.hidden) && (e.pollTimer = setInterval(oe, Re));
233
233
  }
234
- function f() {
234
+ function u() {
235
235
  e.pollTimer && (clearInterval(e.pollTimer), e.pollTimer = null);
236
236
  }
237
- function w() {
237
+ function m() {
238
238
  if (document.hidden)
239
239
  clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = setTimeout(() => {
240
- e.hiddenGraceTimer = null, document.hidden && (f(), Y(), r("paused"));
241
- }, Re);
240
+ e.hiddenGraceTimer = null, document.hidden && (u(), K(), r("paused"));
241
+ }, Fe);
242
242
  else {
243
243
  if (e.hiddenGraceTimer) {
244
244
  clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null;
245
245
  return;
246
246
  }
247
- r("idle"), h(), e.panelOpen && K();
247
+ r("idle"), Q(), e.panelOpen && q();
248
248
  }
249
249
  }
250
- async function A() {
250
+ async function _() {
251
251
  if (e.started) return e.lastBootstrap;
252
252
  e.started = !0;
253
- const m = await p();
254
- e.lastBootstrap = m;
253
+ const h = await v();
254
+ e.lastBootstrap = h;
255
255
  try {
256
- const _ = await T();
257
- e.lastActivityAt = _.reduce((b, S) => {
258
- const M = S == null ? void 0 : S.last_message_at;
259
- return M && (!b || M > b) ? M : b;
256
+ const f = await S();
257
+ e.lastActivityAt = f.reduce((p, k) => {
258
+ const T = k == null ? void 0 : k.last_message_at;
259
+ return T && (!p || T > p) ? T : p;
260
260
  }, null);
261
- } catch (_) {
262
- console.error("[transport] initial /conversations failed", _);
261
+ } catch (f) {
262
+ console.error("[transport] initial /conversations failed", f);
263
263
  }
264
- return typeof document < "u" && (e.visibilityHandler = w, document.addEventListener("visibilitychange", e.visibilityHandler)), h(), m;
264
+ return typeof document < "u" && (e.visibilityHandler = m, document.addEventListener("visibilitychange", e.visibilityHandler)), Q(), h;
265
265
  }
266
- function C() {
267
- f(), clearTimeout(e.burstTimer), clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null, Y(), e.visibilityHandler && (document.removeEventListener("visibilitychange", e.visibilityHandler), e.visibilityHandler = null), e.started = !1;
266
+ function g() {
267
+ u(), clearTimeout(e.burstTimer), clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null, K(), e.visibilityHandler && (document.removeEventListener("visibilitychange", e.visibilityHandler), e.visibilityHandler = null), e.started = !1;
268
268
  }
269
269
  return {
270
270
  on: n,
271
- start: A,
272
- stop: C,
273
- setPanelOpen: ie,
271
+ start: _,
272
+ stop: g,
273
+ setPanelOpen: ae,
274
274
  // REST
275
- bootstrap: p,
276
- getCustomer: k,
277
- patchCustomer: g,
278
- listConversations: T,
279
- createConversation: R,
280
- getConversation: x,
281
- patchConversation: N,
282
- listMessages: I,
283
- postMessage: P,
284
- postCallback: U,
285
- uploadAttachment: V,
286
- signAttachment: Q,
275
+ bootstrap: v,
276
+ getCustomer: C,
277
+ patchCustomer: w,
278
+ listConversations: S,
279
+ createConversation: L,
280
+ getConversation: A,
281
+ patchConversation: D,
282
+ listMessages: x,
283
+ postMessage: N,
284
+ postCallback: j,
285
+ uploadAttachment: z,
286
+ signAttachment: X,
287
287
  // Read-only state
288
288
  get connection() {
289
289
  return e.connection;
290
290
  }
291
291
  };
292
292
  }
293
- function Fe(t) {
293
+ function Ue(t) {
294
294
  return t.endsWith("/") ? t.slice(0, -1) : t;
295
295
  }
296
- function Ue(t) {
296
+ function De(t) {
297
297
  return t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : "file";
298
298
  }
299
- function De() {
299
+ function Ne() {
300
300
  if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
301
301
  return crypto.randomUUID();
302
302
  const t = new Uint8Array(16);
@@ -308,8 +308,8 @@ function De() {
308
308
  const e = [...t].map((n) => n.toString(16).padStart(2, "0"));
309
309
  return e.slice(0, 4).join("") + "-" + e.slice(4, 6).join("") + "-" + e.slice(6, 8).join("") + "-" + e.slice(8, 10).join("") + "-" + e.slice(10, 16).join("");
310
310
  }
311
- function je(t) {
312
- const e = Ae({
311
+ function Pe(t) {
312
+ const e = xe({
313
313
  ready: !1,
314
314
  error: null,
315
315
  config: null,
@@ -343,32 +343,32 @@ function je(t) {
343
343
  n.push(t.on("connection", (u) => {
344
344
  e.connection = u;
345
345
  })), n.push(t.on("message", (u) => {
346
- const h = u == null ? void 0 : u.conversation_id, f = u == null ? void 0 : u.message;
347
- !h || !(f != null && f.id) || (Z(h, f), f.client_msg_id && delete e.streamingByMsgId[f.client_msg_id], Y(h, f.created_at));
346
+ const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.message;
347
+ !m || !(_ != null && _.id) || (q(m, _), _.client_msg_id && delete e.streamingByMsgId[_.client_msg_id], W(m, _.created_at));
348
348
  })), n.push(t.on("message_stream", (u) => {
349
- const h = u == null ? void 0 : u.message_id, f = u == null ? void 0 : u.token;
350
- !h || typeof f != "string" || (e.streamingByMsgId[h] = (e.streamingByMsgId[h] || "") + f);
349
+ const m = u == null ? void 0 : u.message_id, _ = u == null ? void 0 : u.token;
350
+ !m || typeof _ != "string" || (e.streamingByMsgId[m] = (e.streamingByMsgId[m] || "") + _);
351
351
  })), n.push(t.on("conversation_updated", (u) => {
352
- const h = u == null ? void 0 : u.conversation_id, f = u == null ? void 0 : u.changes;
353
- if (!h || !f) return;
354
- const w = e.conversations.findIndex((A) => A.id === h);
355
- w !== -1 && (e.conversations[w] = { ...e.conversations[w], ...f });
352
+ const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.changes;
353
+ if (!m || !_) return;
354
+ const g = e.conversations.findIndex((h) => h.id === m);
355
+ g !== -1 && (e.conversations[g] = { ...e.conversations[g], ..._ });
356
356
  })), n.push(t.on("config_updated", (u) => {
357
357
  u != null && u.config && (e.config = u.config);
358
358
  })), n.push(t.on("action_status", (u) => {
359
- const h = u == null ? void 0 : u.conversation_id, f = u == null ? void 0 : u.action_id, w = u == null ? void 0 : u.action_name;
360
- if (!h || !f) return;
361
- const A = e.runningActionsByConv[h] || {};
362
- u.state === "running" ? (A[f] = w || f, e.runningActionsByConv[h] = { ...A }) : u.state === "done" && (delete A[f], e.runningActionsByConv[h] = { ...A });
359
+ const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.action_id, g = u == null ? void 0 : u.action_name;
360
+ if (!m || !_) return;
361
+ const h = e.runningActionsByConv[m] || {};
362
+ u.state === "running" ? (h[_] = g || _, e.runningActionsByConv[m] = { ...h }) : u.state === "done" && (delete h[_], e.runningActionsByConv[m] = { ...h });
363
363
  })), n.push(t.on("activity", (u) => {
364
364
  Array.isArray(u == null ? void 0 : u.conversations) && (e.conversations = u.conversations);
365
365
  }));
366
366
  async function a() {
367
367
  try {
368
368
  const u = new Promise(
369
- (f, w) => setTimeout(() => w(new Error("bootstrap timeout (15s) — check baseUrl, CORS, and network")), 15e3)
370
- ), h = await Promise.race([t.start(), u]);
371
- e.config = h.config, e.customer = h.customer, e.conversations = await Promise.race([t.listConversations(), u]), e.ready = !0;
369
+ (_, g) => setTimeout(() => g(new Error("bootstrap timeout (15s) — check baseUrl, CORS, and network")), 15e3)
370
+ ), m = await Promise.race([t.start(), u]);
371
+ e.config = m.config, e.customer = m.customer, e.conversations = await Promise.race([t.listConversations(), u]), e.ready = !0;
372
372
  } catch (u) {
373
373
  console.error("[store] start failed", u), e.error = (u == null ? void 0 : u.message) || String(u);
374
374
  }
@@ -381,239 +381,258 @@ function je(t) {
381
381
  }
382
382
  t.stop();
383
383
  }
384
- async function s(u = {}) {
385
- const h = await t.createConversation(u), f = e.conversations.findIndex((w) => w.id === h.id);
386
- return f === -1 ? e.conversations = [h, ...e.conversations] : e.conversations[f] = h, h;
384
+ async function s(u) {
385
+ const m = oe(u);
386
+ if (!m) return e.customer;
387
+ try {
388
+ const _ = await t.patchCustomer(m);
389
+ _ && (e.customer = _);
390
+ } catch (_) {
391
+ console.error("[store] applyCustomer failed", _);
392
+ }
393
+ return e.customer;
387
394
  }
388
- const o = 50;
389
- async function c(u) {
395
+ async function o(u = {}) {
396
+ const m = await t.createConversation(u), _ = e.conversations.findIndex((g) => g.id === m.id);
397
+ return _ === -1 ? e.conversations = [m, ...e.conversations] : e.conversations[_] = m, m;
398
+ }
399
+ const d = 50;
400
+ async function v(u) {
390
401
  if (e.messagesByConv[u]) return;
391
- const h = await t.listMessages(u, { limit: o });
392
- e.messagesByConv[u] = (h == null ? void 0 : h.messages) ?? [], k(u, {
393
- nextCursor: (h == null ? void 0 : h.next_cursor) ?? null,
402
+ const m = await t.listMessages(u, { limit: d });
403
+ e.messagesByConv[u] = (m == null ? void 0 : m.messages) ?? [], w(u, {
404
+ nextCursor: (m == null ? void 0 : m.next_cursor) ?? null,
394
405
  loading: !1,
395
406
  loaded: !0
396
407
  });
397
408
  }
398
- async function p(u) {
399
- const h = e.paginationByConv[u];
400
- if (!(!h || h.loading || !h.nextCursor)) {
401
- k(u, { ...h, loading: !0 });
409
+ async function C(u) {
410
+ const m = e.paginationByConv[u];
411
+ if (!(!m || m.loading || !m.nextCursor)) {
412
+ w(u, { ...m, loading: !0 });
402
413
  try {
403
- let A = h.nextCursor, C = [], m = 0;
404
- for (; m < 6 && A; m++) {
405
- const M = await t.listMessages(u, {
406
- before: A,
407
- limit: o
408
- }), D = (M == null ? void 0 : M.messages) ?? [];
409
- if (C = [...D, ...C], A = (M == null ? void 0 : M.next_cursor) ?? null, !D.length || C.length >= 60) break;
414
+ let h = m.nextCursor, f = [], p = 0;
415
+ for (; p < 6 && h; p++) {
416
+ const R = await t.listMessages(u, {
417
+ before: h,
418
+ limit: d
419
+ }), Z = (R == null ? void 0 : R.messages) ?? [];
420
+ if (f = [...Z, ...f], h = (R == null ? void 0 : R.next_cursor) ?? null, !Z.length || f.length >= 60) break;
410
421
  }
411
- const _ = e.messagesByConv[u] || [], b = new Set(_.map((M) => String(M == null ? void 0 : M.id))), S = [...C.filter((M) => !b.has(String(M == null ? void 0 : M.id))), ..._];
412
- e.messagesByConv[u] = S, k(u, {
413
- nextCursor: A,
422
+ const k = e.messagesByConv[u] || [], T = new Set(k.map((R) => String(R == null ? void 0 : R.id))), M = [...f.filter((R) => !T.has(String(R == null ? void 0 : R.id))), ...k];
423
+ e.messagesByConv[u] = M, w(u, {
424
+ nextCursor: h,
414
425
  loading: !1,
415
426
  loaded: !0
416
427
  });
417
- } catch (f) {
418
- console.error("[store] loadMore failed", f), k(u, { ...h, loading: !1 });
428
+ } catch (_) {
429
+ console.error("[store] loadMore failed", _), w(u, { ...m, loading: !1 });
419
430
  }
420
431
  }
421
432
  }
422
- function k(u, h) {
423
- e.paginationByConv = { ...e.paginationByConv, [u]: h };
433
+ function w(u, m) {
434
+ e.paginationByConv = { ...e.paginationByConv, [u]: m };
424
435
  }
425
- async function g(u, h) {
426
- const f = await t.patchConversation(u, h), w = e.conversations.findIndex((A) => A.id === u);
427
- w !== -1 && (e.conversations[w] = f);
436
+ async function S(u, m) {
437
+ const _ = await t.patchConversation(u, m), g = e.conversations.findIndex((h) => h.id === u);
438
+ g !== -1 && (e.conversations[g] = _);
428
439
  }
429
- async function T(u, h, { attachments: f, metadata: w } = {}) {
430
- var S;
431
- const A = (h || "").trim(), C = Array.isArray(f) && f.length > 0;
432
- if (!u || !A && !C) return;
433
- const m = De(), _ = ie(u), b = {
434
- id: m,
435
- client_msg_id: m,
440
+ async function L(u, m, { attachments: _, metadata: g } = {}) {
441
+ var M;
442
+ const h = (m || "").trim(), f = Array.isArray(_) && _.length > 0;
443
+ if (!u || !h && !f) return;
444
+ const p = Ne(), k = Q(u), T = {
445
+ id: p,
446
+ client_msg_id: p,
436
447
  conversation_id: u,
437
448
  type: "content",
438
- text_md: A,
449
+ text_md: h,
439
450
  author: {
440
451
  type: "user",
441
- id: ((S = e.customer) == null ? void 0 : S.external_id) || null
452
+ id: ((M = e.customer) == null ? void 0 : M.external_id) || null
442
453
  },
443
- created_at: _,
454
+ created_at: k,
444
455
  // Local-only flag — UI may render dimmed until the SSE echo lands.
445
456
  _pending: !0,
446
- ...C ? { payload: { type: "content", attachments: f } } : {},
447
- ...w && typeof w == "object" ? { metadata: w } : {}
457
+ ...f ? { payload: { type: "content", attachments: _ } } : {},
458
+ ...g && typeof g == "object" ? { metadata: g } : {}
448
459
  };
449
- Z(u, b);
460
+ q(u, T);
450
461
  try {
451
462
  await t.postMessage(u, {
452
- client_msg_id: m,
453
- text_md: A,
454
- created_at: _,
455
- ...C ? { attachments: f } : {},
456
- ...w && typeof w == "object" ? { metadata: w } : {}
463
+ client_msg_id: p,
464
+ text_md: h,
465
+ created_at: k,
466
+ ...f ? { attachments: _ } : {},
467
+ ...g && typeof g == "object" ? { metadata: g } : {}
457
468
  });
458
- } catch (M) {
459
- console.error("[store] send failed", M), re(u, m, { _failed: !0, _pending: !1 });
469
+ } catch (R) {
470
+ console.error("[store] send failed", R), K(u, p, { _failed: !0, _pending: !1 });
460
471
  }
461
472
  }
462
- async function R(u, h, f) {
473
+ async function A(u, m, _) {
463
474
  u != null && (e.awaitingCallback[u] = !0);
464
475
  try {
465
- await t.postCallback(u, h, f);
466
- } catch (w) {
467
- console.error("[store] callback failed", w), u != null && delete e.awaitingCallback[u];
476
+ await t.postCallback(u, m, _);
477
+ } catch (g) {
478
+ console.error("[store] callback failed", g), u != null && delete e.awaitingCallback[u];
468
479
  }
469
480
  }
470
- const x = /* @__PURE__ */ new Map();
471
- async function N(u) {
481
+ const D = /* @__PURE__ */ new Map();
482
+ async function x(u) {
472
483
  if (!u) return null;
473
- const h = x.get(u);
474
- if (h != null && h.url) {
475
- const f = h.expires_at ? Date.parse(h.expires_at) : 0;
476
- if (!f || f - Date.now() > 6e4) return h.url;
484
+ const m = D.get(u);
485
+ if (m != null && m.url) {
486
+ const _ = m.expires_at ? Date.parse(m.expires_at) : 0;
487
+ if (!_ || _ - Date.now() > 6e4) return m.url;
477
488
  }
478
489
  try {
479
- const f = await t.signAttachment(u);
480
- if (f != null && f.signed_url)
481
- return x.set(u, { url: f.signed_url, expires_at: f.expires_at }), f.signed_url;
482
- } catch (f) {
483
- console.error("[store] sign attachment failed", f);
490
+ const _ = await t.signAttachment(u);
491
+ if (_ != null && _.signed_url)
492
+ return D.set(u, { url: _.signed_url, expires_at: _.expires_at }), _.signed_url;
493
+ } catch (_) {
494
+ console.error("[store] sign attachment failed", _);
484
495
  }
485
496
  return null;
486
497
  }
487
- async function I(u, { rating: h, comment: f } = {}) {
488
- const w = e.conversations.find((m) => m.id === u), C = {
489
- ...(w == null ? void 0 : w.metadata) || {},
498
+ async function N(u, { rating: m, comment: _ } = {}) {
499
+ const g = e.conversations.find((p) => p.id === u), f = {
500
+ ...(g == null ? void 0 : g.metadata) || {},
490
501
  feedback: {
491
- rating: h,
492
- comment: f || null,
502
+ rating: m,
503
+ comment: _ || null,
493
504
  submitted_at: (/* @__PURE__ */ new Date()).toISOString()
494
505
  }
495
506
  };
496
- await g(u, { metadata: C });
507
+ await S(u, { metadata: f });
497
508
  }
498
- function P(u) {
499
- var f, w;
500
- const h = e.messagesByConv[u] || [];
501
- for (let A = h.length - 1; A >= 0; A--) {
502
- const C = h[A];
503
- if ((C == null ? void 0 : C.type) === "action" && ((f = C == null ? void 0 : C.payload) == null ? void 0 : f.type) === "action" && ((w = C == null ? void 0 : C.payload) == null ? void 0 : w.state) === "pending" && Array.isArray(C == null ? void 0 : C.callbacks) && C.callbacks.length > 0 && !e.awaitingCallback[C.id])
504
- return C;
509
+ function j(u) {
510
+ var _, g;
511
+ const m = e.messagesByConv[u] || [];
512
+ for (let h = m.length - 1; h >= 0; h--) {
513
+ const f = m[h];
514
+ if ((f == null ? void 0 : f.type) === "action" && ((_ = f == null ? void 0 : f.payload) == null ? void 0 : _.type) === "action" && ((g = f == null ? void 0 : f.payload) == null ? void 0 : g.state) === "pending" && Array.isArray(f == null ? void 0 : f.callbacks) && f.callbacks.length > 0 && !e.awaitingCallback[f.id])
515
+ return f;
505
516
  }
506
517
  return null;
507
518
  }
508
- function U(u) {
509
- var f, w, A;
510
- const h = e.messagesByConv[u] || [];
511
- for (let C = h.length - 1; C >= 0; C--) {
512
- const m = h[C];
513
- if (((f = m == null ? void 0 : m.author) == null ? void 0 : f.type) === "user" || (m == null ? void 0 : m.type) === "action" && ((w = m == null ? void 0 : m.payload) == null ? void 0 : w.state) === "pending") return null;
514
- const _ = (A = m == null ? void 0 : m.metadata) == null ? void 0 : A.form;
515
- if (_ && Array.isArray(_.fields) && _.fields.length > 0)
516
- return { message: m, form: _ };
519
+ function z(u) {
520
+ var _, g, h;
521
+ const m = e.messagesByConv[u] || [];
522
+ for (let f = m.length - 1; f >= 0; f--) {
523
+ const p = m[f];
524
+ 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;
525
+ const k = (h = p == null ? void 0 : p.metadata) == null ? void 0 : h.form;
526
+ if (k && Array.isArray(k.fields) && k.fields.length > 0)
527
+ return { message: p, form: k };
517
528
  }
518
529
  return null;
519
530
  }
520
- function V(u) {
521
- const h = e.runningActionsByConv[u];
522
- if (!h) return null;
523
- const f = Object.keys(h);
524
- if (f.length === 0) return null;
525
- const w = f[0];
526
- return { id: w, payload: { name: h[w] } };
531
+ function X(u) {
532
+ const m = e.runningActionsByConv[u];
533
+ if (!m) return null;
534
+ const _ = Object.keys(m);
535
+ if (_.length === 0) return null;
536
+ const g = _[0];
537
+ return { id: g, payload: { name: m[g] } };
527
538
  }
528
- function Q(u) {
529
- var f, w, A, C;
530
- const h = e.messagesByConv[u] || [];
531
- for (let m = h.length - 1; m >= 0; m--) {
532
- const _ = h[m];
533
- if (((f = _ == null ? void 0 : _.author) == null ? void 0 : f.type) === "user") return [];
534
- if ((_ == null ? void 0 : _.type) === "action" && ((w = _ == null ? void 0 : _.payload) == null ? void 0 : w.state) === "pending") return [];
535
- if (((A = _ == null ? void 0 : _.author) == null ? void 0 : A.type) !== "agent_ia") continue;
536
- const b = (C = _ == null ? void 0 : _.metadata) == null ? void 0 : C.suggested_replies;
537
- return Array.isArray(b) && b.length ? b.map((S) => {
538
- if (typeof S == "string") {
539
- const M = S.trim();
540
- return M ? { label: M, kind: null } : null;
539
+ function re(u) {
540
+ var _, g, h, f;
541
+ const m = e.messagesByConv[u] || [];
542
+ for (let p = m.length - 1; p >= 0; p--) {
543
+ const k = m[p];
544
+ if (((_ = k == null ? void 0 : k.author) == null ? void 0 : _.type) === "user") return [];
545
+ if ((k == null ? void 0 : k.type) === "action" && ((g = k == null ? void 0 : k.payload) == null ? void 0 : g.state) === "pending") return [];
546
+ if (((h = k == null ? void 0 : k.author) == null ? void 0 : h.type) !== "agent_ia") continue;
547
+ const T = (f = k == null ? void 0 : k.metadata) == null ? void 0 : f.suggested_replies;
548
+ return Array.isArray(T) && T.length ? T.map((M) => {
549
+ if (typeof M == "string") {
550
+ const R = M.trim();
551
+ return R ? { label: R, kind: null } : null;
541
552
  }
542
- if (S && typeof S == "object" && typeof S.label == "string") {
543
- const M = S.label.trim();
544
- if (!M) return null;
545
- const D = S.kind === "cta" || S.kind === "choice" || S.kind === "followup" ? S.kind : null;
546
- return { label: M, kind: D };
553
+ if (M && typeof M == "object" && typeof M.label == "string") {
554
+ const R = M.label.trim();
555
+ if (!R) return null;
556
+ const Z = M.kind === "cta" || M.kind === "choice" || M.kind === "followup" ? M.kind : null;
557
+ return { label: R, kind: Z };
547
558
  }
548
559
  return null;
549
560
  }).filter(Boolean).slice(0, 4) : [];
550
561
  }
551
562
  return [];
552
563
  }
553
- function Z(u, h) {
554
- var C;
555
- const f = e.messagesByConv[u] || [];
556
- let w = -1;
557
- h != null && h.client_msg_id && (w = f.findIndex(
558
- (m) => (m == null ? void 0 : m.client_msg_id) && m.client_msg_id === h.client_msg_id
559
- )), w === -1 && (h == null ? void 0 : h.id) !== void 0 && (h == null ? void 0 : h.id) !== null && (w = f.findIndex((m) => K(m == null ? void 0 : m.id, h.id)));
560
- let A;
561
- w === -1 ? A = [...f, h].sort(W) : (A = f.slice(), A[w] = { ...f[w], ...h, _pending: !1, _failed: !1 }), e.messagesByConv[u] = A, (h == null ? void 0 : h.type) === "action" && ((C = h == null ? void 0 : h.payload) != null && C.state) && h.payload.state !== "pending" && (h == null ? void 0 : h.id) != null && e.awaitingCallback[h.id] && delete e.awaitingCallback[h.id];
564
+ function q(u, m) {
565
+ var f;
566
+ const _ = e.messagesByConv[u] || [];
567
+ let g = -1;
568
+ m != null && m.client_msg_id && (g = _.findIndex(
569
+ (p) => (p == null ? void 0 : p.client_msg_id) && p.client_msg_id === m.client_msg_id
570
+ )), g === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (g = _.findIndex((p) => ie(p == null ? void 0 : p.id, m.id)));
571
+ let h;
572
+ g === -1 ? h = [..._, m].sort(ae) : (h = _.slice(), h[g] = { ..._[g], ...m, _pending: !1, _failed: !1 }), e.messagesByConv[u] = h, (m == null ? void 0 : m.type) === "action" && ((f = m == null ? void 0 : m.payload) != null && f.state) && m.payload.state !== "pending" && (m == null ? void 0 : m.id) != null && e.awaitingCallback[m.id] && delete e.awaitingCallback[m.id];
562
573
  }
563
- function K(u, h) {
564
- return u === h ? !0 : u == null || h == null ? !1 : String(u) === String(h);
574
+ function ie(u, m) {
575
+ return u === m ? !0 : u == null || m == null ? !1 : String(u) === String(m);
565
576
  }
566
- function re(u, h, f) {
567
- const w = e.messagesByConv[u];
568
- if (!w) return;
569
- const A = w.findIndex((m) => m.id === h);
570
- if (A === -1) return;
571
- const C = w.slice();
572
- C[A] = { ...w[A], ...f }, e.messagesByConv[u] = C;
577
+ function K(u, m, _) {
578
+ const g = e.messagesByConv[u];
579
+ if (!g) return;
580
+ const h = g.findIndex((p) => p.id === m);
581
+ if (h === -1) return;
582
+ const f = g.slice();
583
+ f[h] = { ...g[h], ..._ }, e.messagesByConv[u] = f;
573
584
  }
574
- function Y(u, h) {
575
- const f = e.conversations.findIndex((A) => A.id === u);
576
- if (f === -1) return;
577
- const w = e.conversations[f];
578
- if (h && (!w.last_message_at || h > w.last_message_at)) {
579
- const A = e.conversations.slice();
580
- A[f] = { ...w, last_message_at: h }, A.sort(
581
- (C, m) => (m.last_message_at || "").localeCompare(C.last_message_at || "")
582
- ), e.conversations = A;
585
+ function W(u, m) {
586
+ const _ = e.conversations.findIndex((h) => h.id === u);
587
+ if (_ === -1) return;
588
+ const g = e.conversations[_];
589
+ if (m && (!g.last_message_at || m > g.last_message_at)) {
590
+ const h = e.conversations.slice();
591
+ h[_] = { ...g, last_message_at: m }, h.sort(
592
+ (f, p) => (p.last_message_at || "").localeCompare(f.last_message_at || "")
593
+ ), e.conversations = h;
583
594
  }
584
595
  }
585
- function W(u, h) {
586
- return (u.created_at || "").localeCompare(h.created_at || "");
596
+ function ae(u, m) {
597
+ return (u.created_at || "").localeCompare(m.created_at || "");
598
+ }
599
+ function oe(u) {
600
+ if (!u || typeof u != "object") return null;
601
+ const m = {}, _ = {};
602
+ for (const [g, h] of Object.entries(u))
603
+ h !== void 0 && (g === "name" || g === "email" ? h != null && String(h).trim() !== "" && (m[g] = h) : (g === "values" || g === "metadata") && h && typeof h == "object" ? Object.assign(_, h) : _[g] = h);
604
+ return Object.keys(_).length && (m.values = _), Object.keys(m).length ? m : null;
587
605
  }
588
- function ie(u) {
589
- const h = e.messagesByConv[u] || [];
590
- let f = "";
591
- for (const C of h)
592
- C != null && C.created_at && C.created_at > f && (f = C.created_at);
593
- const w = (/* @__PURE__ */ new Date()).toISOString();
594
- return !f || w > f ? w : new Date(Date.parse(f) + 1).toISOString();
606
+ function Q(u) {
607
+ const m = e.messagesByConv[u] || [];
608
+ let _ = "";
609
+ for (const f of m)
610
+ f != null && f.created_at && f.created_at > _ && (_ = f.created_at);
611
+ const g = (/* @__PURE__ */ new Date()).toISOString();
612
+ return !_ || g > _ ? g : new Date(Date.parse(_) + 1).toISOString();
595
613
  }
596
614
  return {
597
615
  state: e,
598
616
  start: a,
599
617
  destroy: r,
600
- createConversation: s,
601
- openConversation: c,
602
- loadMore: p,
603
- patchConversation: g,
604
- send: T,
605
- clickCallback: R,
606
- signAttachment: N,
607
- submitFeedback: I,
608
- getPendingApproval: P,
609
- getActionInFlight: V,
610
- getLatestSuggestions: Q,
611
- getLatestForm: U,
618
+ applyCustomer: s,
619
+ createConversation: o,
620
+ openConversation: v,
621
+ loadMore: C,
622
+ patchConversation: S,
623
+ send: L,
624
+ clickCallback: A,
625
+ signAttachment: x,
626
+ submitFeedback: N,
627
+ getPendingApproval: j,
628
+ getActionInFlight: X,
629
+ getLatestSuggestions: re,
630
+ getLatestForm: z,
612
631
  // Pass-through for panel open/close (controls SSE burst).
613
632
  setPanelOpen: t.setPanelOpen
614
633
  };
615
634
  }
616
- const j = {
635
+ const U = {
617
636
  w: "#ffffff",
618
637
  g50: "#F9F9F7",
619
638
  g100: "#F2F1EE",
@@ -629,37 +648,37 @@ const j = {
629
648
  green: "#22C55E",
630
649
  red: "#B91C1C",
631
650
  redBg: "#FDECEC"
632
- }, ae = ["#5B5FEF", "#7C3AED", "#DB2777", "#0891B2", "#D97706", "#059669"];
633
- function ve(t = "") {
634
- return t ? ae[t.charCodeAt(0) % ae.length] : ae[0];
651
+ }, le = ["#5B5FEF", "#7C3AED", "#DB2777", "#0891B2", "#D97706", "#059669"];
652
+ function ye(t = "") {
653
+ return t ? le[t.charCodeAt(0) % le.length] : le[0];
635
654
  }
636
- function ge(t = "") {
655
+ function we(t = "") {
637
656
  return t.split(" ").map((e) => e[0] || "").join("").toUpperCase().slice(0, 2);
638
657
  }
639
- function ye(t = /* @__PURE__ */ new Date()) {
658
+ function be(t = /* @__PURE__ */ new Date()) {
640
659
  return t.toLocaleTimeString("fr-FR", { hour: "2-digit", minute: "2-digit" });
641
660
  }
642
- const Ne = `
661
+ const He = `
643
662
  @import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');
644
663
 
645
664
  .wm-root {
646
665
  --wm-f: 'Geist', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
647
666
  --wm-fm: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
648
- --wm-w: ${j.w};
649
- --wm-g50: ${j.g50};
650
- --wm-g100: ${j.g100};
651
- --wm-g150: ${j.g150};
652
- --wm-g200: ${j.g200};
653
- --wm-g300: ${j.g300};
654
- --wm-g400: ${j.g400};
655
- --wm-g500: ${j.g500};
656
- --wm-g700: ${j.g700};
657
- --wm-g900: ${j.g900};
658
- --wm-a: ${j.accent};
659
- --wm-al: ${j.accentLight};
660
- --wm-green: ${j.green};
661
- --wm-red: ${j.red};
662
- --wm-redBg: ${j.redBg};
667
+ --wm-w: ${U.w};
668
+ --wm-g50: ${U.g50};
669
+ --wm-g100: ${U.g100};
670
+ --wm-g150: ${U.g150};
671
+ --wm-g200: ${U.g200};
672
+ --wm-g300: ${U.g300};
673
+ --wm-g400: ${U.g400};
674
+ --wm-g500: ${U.g500};
675
+ --wm-g700: ${U.g700};
676
+ --wm-g900: ${U.g900};
677
+ --wm-a: ${U.accent};
678
+ --wm-al: ${U.accentLight};
679
+ --wm-green: ${U.green};
680
+ --wm-red: ${U.red};
681
+ --wm-redBg: ${U.redBg};
663
682
  --wm-sh1: 0 1px 3px rgba(0,0,0,.06);
664
683
  --wm-sh2: 0 4px 24px rgba(0,0,0,.09), 0 1px 4px rgba(0,0,0,.05);
665
684
  --wm-shPanel: 0 12px 40px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.06);
@@ -685,12 +704,12 @@ const Ne = `
685
704
  0% { transform: translateX(110%); opacity: 0; }
686
705
  100% { transform: translateX(0); opacity: 1; }
687
706
  }
688
- `, L = (t, e) => {
707
+ `, ze = "https://api.messenger.victorc.fr", B = (t, e) => {
689
708
  const n = t.__vccOpts || t;
690
709
  for (const [a, r] of e)
691
710
  n[a] = r;
692
711
  return n;
693
- }, Pe = {
712
+ }, Ve = {
694
713
  name: "WmLauncher",
695
714
  props: {
696
715
  // Nombre de conversations non lues — pilote la pastille.
@@ -700,12 +719,12 @@ const Ne = `
700
719
  peek: { type: String, default: "" }
701
720
  },
702
721
  emits: ["open", "dismiss"]
703
- }, He = { class: "wm-launcherWrap" }, ze = { class: "wm-peek__text" }, Ve = ["aria-label"];
704
- function qe(t, e, n, a, r, s) {
705
- return l(), d("div", He, [
706
- z(Se, { name: "wm-peek" }, {
707
- default: xe(() => [
708
- n.peek ? (l(), d("div", {
722
+ }, qe = { class: "wm-launcherWrap" }, We = { class: "wm-peek__text" }, Ge = ["aria-label"];
723
+ function Ke(t, e, n, a, r, s) {
724
+ return l(), c("div", qe, [
725
+ H(Me, { name: "wm-peek" }, {
726
+ default: Te(() => [
727
+ n.peek ? (l(), c("div", {
709
728
  key: 0,
710
729
  class: "wm-peek",
711
730
  role: "button",
@@ -713,16 +732,16 @@ function qe(t, e, n, a, r, s) {
713
732
  "aria-label": "Ouvrir le messenger sur le dernier message",
714
733
  onClick: e[1] || (e[1] = (o) => t.$emit("open")),
715
734
  onKeydown: [
716
- e[2] || (e[2] = ue(J((o) => t.$emit("open"), ["prevent"]), ["enter"])),
717
- e[3] || (e[3] = ue(J((o) => t.$emit("open"), ["prevent"]), ["space"]))
735
+ e[2] || (e[2] = me(Y((o) => t.$emit("open"), ["prevent"]), ["enter"])),
736
+ e[3] || (e[3] = me(Y((o) => t.$emit("open"), ["prevent"]), ["space"]))
718
737
  ]
719
738
  }, [
720
- i("p", ze, y(n.peek), 1),
739
+ i("p", We, b(n.peek), 1),
721
740
  i("button", {
722
741
  type: "button",
723
742
  class: "wm-peek__close",
724
743
  "aria-label": "Ignorer",
725
- onClick: e[0] || (e[0] = J((o) => t.$emit("dismiss"), ["stop"]))
744
+ onClick: e[0] || (e[0] = Y((o) => t.$emit("dismiss"), ["stop"]))
726
745
  }, [...e[5] || (e[5] = [
727
746
  i("svg", {
728
747
  width: "11",
@@ -738,7 +757,7 @@ function qe(t, e, n, a, r, s) {
738
757
  i("path", { d: "M18 6L6 18M6 6l12 12" })
739
758
  ], -1)
740
759
  ])])
741
- ], 32)) : v("", !0)
760
+ ], 32)) : y("", !0)
742
761
  ]),
743
762
  _: 1
744
763
  }),
@@ -761,36 +780,36 @@ function qe(t, e, n, a, r, s) {
761
780
  }, [
762
781
  i("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
763
782
  ], -1)),
764
- n.unreadCount > 0 ? (l(), d("span", {
783
+ n.unreadCount > 0 ? (l(), c("span", {
765
784
  key: 0,
766
785
  class: "wm-launcher__badge",
767
786
  "aria-label": `${n.unreadCount} conversation${n.unreadCount > 1 ? "s" : ""} non lue${n.unreadCount > 1 ? "s" : ""}`
768
- }, y(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, Ve)) : v("", !0)
787
+ }, b(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, Ge)) : y("", !0)
769
788
  ])
770
789
  ]);
771
790
  }
772
- const We = /* @__PURE__ */ L(Pe, [["render", qe], ["__scopeId", "data-v-fabef371"]]), Ge = {
791
+ const Ye = /* @__PURE__ */ B(Ve, [["render", Ke], ["__scopeId", "data-v-fabef371"]]), Je = {
773
792
  name: "WmAIAvatar",
774
793
  props: {
775
794
  size: { type: Number, default: 26 },
776
795
  pulse: { type: Boolean, default: !1 }
777
796
  }
778
- }, Ke = ["width", "height"];
779
- function Ye(t, e, n, a, r, s) {
780
- return l(), d("div", {
797
+ }, Xe = ["width", "height"];
798
+ function Qe(t, e, n, a, r, s) {
799
+ return l(), c("div", {
781
800
  class: "wm-aiav",
782
- style: H({ width: n.size + "px", height: n.size + "px" })
801
+ style: P({ width: n.size + "px", height: n.size + "px" })
783
802
  }, [
784
- n.pulse ? (l(), d("div", {
803
+ n.pulse ? (l(), c("div", {
785
804
  key: 0,
786
805
  class: "wm-aiav__pulse",
787
- style: H({ borderRadius: n.size * 0.32 + 3 + "px" })
788
- }, null, 4)) : v("", !0),
806
+ style: P({ borderRadius: n.size * 0.32 + 3 + "px" })
807
+ }, null, 4)) : y("", !0),
789
808
  i("div", {
790
- class: B(["wm-aiav__inner", { "wm-aiav__inner--glow": n.pulse }]),
791
- style: H({ borderRadius: n.size * 0.32 + "px" })
809
+ class: E(["wm-aiav__inner", { "wm-aiav__inner--glow": n.pulse }]),
810
+ style: P({ borderRadius: n.size * 0.32 + "px" })
792
811
  }, [
793
- (l(), d("svg", {
812
+ (l(), c("svg", {
794
813
  width: n.size * 0.5,
795
814
  height: n.size * 0.5,
796
815
  viewBox: "0 0 24 24",
@@ -816,11 +835,11 @@ function Ye(t, e, n, a, r, s) {
816
835
  fill: "white",
817
836
  opacity: "0.38"
818
837
  }, null, -1)
819
- ])], 8, Ke))
838
+ ])], 8, Xe))
820
839
  ], 6)
821
840
  ], 4);
822
841
  }
823
- const X = /* @__PURE__ */ L(Ge, [["render", Ye], ["__scopeId", "data-v-fe042be7"]]), Je = {
842
+ const J = /* @__PURE__ */ B(Je, [["render", Qe], ["__scopeId", "data-v-fe042be7"]]), Ze = {
824
843
  name: "WmHumanAvatar",
825
844
  props: {
826
845
  name: { type: String, default: "" },
@@ -829,34 +848,34 @@ const X = /* @__PURE__ */ L(Ge, [["render", Ye], ["__scopeId", "data-v-fe042be7"
829
848
  },
830
849
  computed: {
831
850
  bg() {
832
- return this.avatarUrl ? "transparent" : ve(this.name);
851
+ return this.avatarUrl ? "transparent" : ye(this.name);
833
852
  },
834
853
  initials() {
835
- return ge(this.name);
854
+ return we(this.name);
836
855
  }
837
856
  }
838
- }, Xe = ["src", "alt"];
839
- function Qe(t, e, n, a, r, s) {
840
- return l(), d("div", {
857
+ }, et = ["src", "alt"];
858
+ function tt(t, e, n, a, r, s) {
859
+ return l(), c("div", {
841
860
  class: "wm-huav",
842
- style: H({
861
+ style: P({
843
862
  width: n.size + "px",
844
863
  height: n.size + "px",
845
864
  borderRadius: Math.round(n.size * 0.32) + "px",
846
865
  background: s.bg
847
866
  })
848
867
  }, [
849
- n.avatarUrl ? (l(), d("img", {
868
+ n.avatarUrl ? (l(), c("img", {
850
869
  key: 0,
851
870
  src: n.avatarUrl,
852
871
  alt: n.name || ""
853
- }, null, 8, Xe)) : (l(), d("span", {
872
+ }, null, 8, et)) : (l(), c("span", {
854
873
  key: 1,
855
- style: H({ fontSize: n.size * 0.36 + "px" })
856
- }, y(s.initials), 5))
874
+ style: P({ fontSize: n.size * 0.36 + "px" })
875
+ }, b(s.initials), 5))
857
876
  ], 4);
858
877
  }
859
- const we = /* @__PURE__ */ L(Je, [["render", Qe], ["__scopeId", "data-v-79449443"]]), Ze = {
878
+ const ke = /* @__PURE__ */ B(Ze, [["render", tt], ["__scopeId", "data-v-79449443"]]), nt = {
860
879
  name: "WmTeamAvatars",
861
880
  props: {
862
881
  members: { type: Array, default: () => [] },
@@ -872,43 +891,43 @@ const we = /* @__PURE__ */ L(Je, [["render", Qe], ["__scopeId", "data-v-79449443
872
891
  },
873
892
  methods: {
874
893
  colorFor(t) {
875
- return t.avatar_url ? "transparent" : ve(t.name || "");
894
+ return t.avatar_url ? "transparent" : ye(t.name || "");
876
895
  },
877
896
  initialsFor(t) {
878
- return ge(t.name || "");
897
+ return we(t.name || "");
879
898
  }
880
899
  }
881
- }, et = {
900
+ }, st = {
882
901
  key: 0,
883
902
  class: "wm-team"
884
- }, tt = ["src", "alt"], nt = { key: 1 }, st = {
903
+ }, rt = ["src", "alt"], it = { key: 1 }, at = {
885
904
  key: 0,
886
905
  class: "wm-team__label"
887
906
  };
888
- function rt(t, e, n, a, r, s) {
889
- return s.visible ? (l(), d("div", et, [
907
+ function ot(t, e, n, a, r, s) {
908
+ return s.visible ? (l(), c("div", st, [
890
909
  i("div", {
891
910
  class: "wm-team__stack",
892
- style: H({ width: s.stackWidth + "px" })
911
+ style: P({ width: s.stackWidth + "px" })
893
912
  }, [
894
- (l(!0), d(E, null, F(n.members.slice(0, 3), (o, c) => (l(), d("div", {
895
- key: c,
913
+ (l(!0), c(O, null, F(n.members.slice(0, 3), (o, d) => (l(), c("div", {
914
+ key: d,
896
915
  class: "wm-team__pill",
897
- style: H({ left: c * 13 + "px", zIndex: 3 - c, background: s.colorFor(o) })
916
+ style: P({ left: d * 13 + "px", zIndex: 3 - d, background: s.colorFor(o) })
898
917
  }, [
899
- o.avatar_url ? (l(), d("img", {
918
+ o.avatar_url ? (l(), c("img", {
900
919
  key: 0,
901
920
  src: o.avatar_url,
902
921
  alt: o.name || ""
903
- }, null, 8, tt)) : (l(), d("span", nt, y(s.initialsFor(o)), 1))
922
+ }, null, 8, rt)) : (l(), c("span", it, b(s.initialsFor(o)), 1))
904
923
  ], 4))), 128))
905
924
  ], 4),
906
- n.responseLabel ? (l(), d("span", st, y(n.responseLabel), 1)) : v("", !0)
907
- ])) : v("", !0);
925
+ n.responseLabel ? (l(), c("span", at, b(n.responseLabel), 1)) : y("", !0)
926
+ ])) : y("", !0);
908
927
  }
909
- const it = /* @__PURE__ */ L(Ze, [["render", rt], ["__scopeId", "data-v-3659b9c1"]]), at = {
928
+ const lt = /* @__PURE__ */ B(nt, [["render", ot], ["__scopeId", "data-v-3659b9c1"]]), ct = {
910
929
  name: "WmHeader",
911
- components: { AIAvatar: X, HumanAvatar: we, TeamAvatars: it },
930
+ components: { AIAvatar: J, HumanAvatar: ke, TeamAvatars: lt },
912
931
  props: {
913
932
  title: { type: String, default: "Nouvelle conversation" },
914
933
  escalated: { type: Boolean, default: !1 },
@@ -939,25 +958,25 @@ const it = /* @__PURE__ */ L(Ze, [["render", rt], ["__scopeId", "data-v-3659b9c1
939
958
  return this.escalated && this.agentName ? this.agentName : "En ligne";
940
959
  }
941
960
  }
942
- }, ot = { class: "wm-header" }, lt = {
961
+ }, dt = { class: "wm-header" }, ut = {
943
962
  key: 1,
944
963
  style: { width: "30px", height: "30px", "flex-shrink": "0" }
945
- }, dt = { class: "wm-header__avatar" }, ct = { class: "wm-header__main" }, ut = { class: "wm-header__title" }, ht = {
964
+ }, ht = { class: "wm-header__avatar" }, mt = { class: "wm-header__main" }, ft = { class: "wm-header__title" }, _t = {
946
965
  key: 0,
947
966
  class: "wm-header__sub"
948
- }, mt = { class: "wm-header__status" }, ft = {
967
+ }, pt = { class: "wm-header__status" }, vt = {
949
968
  key: 3,
950
969
  class: "wm-header__fill"
951
- }, _t = { class: "wm-header__actions" };
952
- function pt(t, e, n, a, r, s) {
953
- const o = O("HumanAvatar"), c = O("AIAvatar"), p = O("TeamAvatars");
954
- return l(), d("div", ot, [
955
- n.showBack ? (l(), d("button", {
970
+ }, gt = { class: "wm-header__actions" };
971
+ function yt(t, e, n, a, r, s) {
972
+ const o = I("HumanAvatar"), d = I("AIAvatar"), v = I("TeamAvatars");
973
+ return l(), c("div", dt, [
974
+ n.showBack ? (l(), c("button", {
956
975
  key: 0,
957
976
  type: "button",
958
977
  class: "wm-header__icon",
959
978
  "aria-label": "Retour à l'accueil",
960
- onClick: e[0] || (e[0] = (k) => t.$emit("back"))
979
+ onClick: e[0] || (e[0] = (C) => t.$emit("back"))
961
980
  }, [...e[3] || (e[3] = [
962
981
  i("svg", {
963
982
  width: "13",
@@ -972,42 +991,42 @@ function pt(t, e, n, a, r, s) {
972
991
  }, [
973
992
  i("path", { d: "M19 12H5M12 5l-7 7 7 7" })
974
993
  ], -1)
975
- ])])) : (l(), d("div", lt)),
976
- n.showIdentity ? (l(), d(E, { key: 2 }, [
977
- i("div", dt, [
994
+ ])])) : (l(), c("div", ut)),
995
+ n.showIdentity ? (l(), c(O, { key: 2 }, [
996
+ i("div", ht, [
978
997
  n.escalated ? (l(), $(o, {
979
998
  key: 0,
980
999
  name: n.agentName,
981
1000
  "avatar-url": n.agentAvatarUrl,
982
1001
  size: 34
983
- }, null, 8, ["name", "avatar-url"])) : (l(), $(c, {
1002
+ }, null, 8, ["name", "avatar-url"])) : (l(), $(d, {
984
1003
  key: 1,
985
1004
  size: 34
986
1005
  }))
987
1006
  ]),
988
- i("div", ct, [
989
- i("div", ut, y(n.title), 1),
990
- s.showPresence ? (l(), d("div", ht, [
991
- s.hasTeam ? (l(), $(p, {
1007
+ i("div", mt, [
1008
+ i("div", ft, b(n.title), 1),
1009
+ s.showPresence ? (l(), c("div", _t, [
1010
+ s.hasTeam ? (l(), $(v, {
992
1011
  key: 0,
993
1012
  members: n.teamMembers,
994
1013
  "response-label": n.responseLabel
995
- }, null, 8, ["members", "response-label"])) : v("", !0),
996
- i("span", mt, [
1014
+ }, null, 8, ["members", "response-label"])) : y("", !0),
1015
+ i("span", pt, [
997
1016
  e[4] || (e[4] = i("span", { class: "wm-header__dot" }, null, -1)),
998
- se(" " + y(s.statusText), 1)
1017
+ se(" " + b(s.statusText), 1)
999
1018
  ])
1000
- ])) : v("", !0)
1019
+ ])) : y("", !0)
1001
1020
  ])
1002
- ], 64)) : (l(), d("div", ft)),
1003
- i("div", _t, [
1004
- n.showMore ? (l(), d("button", {
1021
+ ], 64)) : (l(), c("div", vt)),
1022
+ i("div", gt, [
1023
+ n.showMore ? (l(), c("button", {
1005
1024
  key: 0,
1006
1025
  type: "button",
1007
- class: B(["wm-header__icon", { "wm-header__icon--active": n.moreActive }]),
1026
+ class: E(["wm-header__icon", { "wm-header__icon--active": n.moreActive }]),
1008
1027
  "aria-label": "Plus d'options",
1009
1028
  title: "Plus d'options",
1010
- onClick: e[1] || (e[1] = (k) => t.$emit("more"))
1029
+ onClick: e[1] || (e[1] = (C) => t.$emit("more"))
1011
1030
  }, [...e[5] || (e[5] = [
1012
1031
  i("svg", {
1013
1032
  width: "13",
@@ -1032,14 +1051,14 @@ function pt(t, e, n, a, r, s) {
1032
1051
  r: "1.6"
1033
1052
  })
1034
1053
  ], -1)
1035
- ])], 2)) : v("", !0),
1036
- n.showClose ? (l(), d("button", {
1054
+ ])], 2)) : y("", !0),
1055
+ n.showClose ? (l(), c("button", {
1037
1056
  key: 1,
1038
1057
  type: "button",
1039
1058
  class: "wm-header__icon",
1040
1059
  "aria-label": "Fermer le widget",
1041
1060
  title: "Fermer le widget",
1042
- onClick: e[2] || (e[2] = (k) => t.$emit("close"))
1061
+ onClick: e[2] || (e[2] = (C) => t.$emit("close"))
1043
1062
  }, [...e[6] || (e[6] = [
1044
1063
  i("svg", {
1045
1064
  width: "13",
@@ -1054,19 +1073,19 @@ function pt(t, e, n, a, r, s) {
1054
1073
  }, [
1055
1074
  i("path", { d: "M18 6L6 18M6 6l12 12" })
1056
1075
  ], -1)
1057
- ])])) : v("", !0)
1076
+ ])])) : y("", !0)
1058
1077
  ])
1059
1078
  ]);
1060
1079
  }
1061
- const vt = /* @__PURE__ */ L(at, [["render", pt], ["__scopeId", "data-v-b5f5f6a9"]]), me = {
1080
+ const wt = /* @__PURE__ */ B(ct, [["render", yt], ["__scopeId", "data-v-b5f5f6a9"]]), _e = {
1062
1081
  book: "M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253",
1063
1082
  changelog: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2",
1064
1083
  status: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",
1065
1084
  chat: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z",
1066
1085
  link: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"
1067
- }, gt = {
1086
+ }, bt = {
1068
1087
  name: "WmOnboarding",
1069
- components: { AIAvatar: X },
1088
+ components: { AIAvatar: J },
1070
1089
  props: {
1071
1090
  welcomeMessage: { type: String, default: "" },
1072
1091
  agentName: { type: String, default: "" },
@@ -1086,16 +1105,16 @@ Je réponds en quelques secondes.`;
1086
1105
  },
1087
1106
  methods: {
1088
1107
  iconPath(t) {
1089
- return me[t] || me.link;
1108
+ return _e[t] || _e.link;
1090
1109
  }
1091
1110
  }
1092
- }, yt = { class: "wm-onb" }, wt = { class: "wm-onb__hero" }, bt = { class: "wm-onb__title" }, kt = { class: "wm-onb__sub" }, Ct = {
1111
+ }, kt = { class: "wm-onb" }, Ct = { class: "wm-onb__hero" }, At = { class: "wm-onb__title" }, St = { class: "wm-onb__sub" }, xt = {
1093
1112
  key: 0,
1094
1113
  class: "wm-onb__section"
1095
- }, At = { class: "wm-onb__links" }, St = ["onClick"], xt = { class: "wm-onb__resume-body" }, Mt = { class: "wm-onb__resume-title" }, Tt = { class: "wm-onb__resume-preview" }, It = {
1114
+ }, Mt = { class: "wm-onb__links" }, Tt = ["onClick"], It = { class: "wm-onb__resume-body" }, Ot = { class: "wm-onb__resume-title" }, Et = { class: "wm-onb__resume-preview" }, Bt = {
1096
1115
  key: 1,
1097
1116
  class: "wm-onb__section"
1098
- }, Ot = { class: "wm-onb__links" }, Et = ["onClick"], Bt = { class: "wm-onb__link-icon" }, Lt = {
1117
+ }, Lt = { class: "wm-onb__links" }, Rt = ["onClick"], $t = { class: "wm-onb__link-icon" }, Ft = {
1099
1118
  width: "14",
1100
1119
  height: "14",
1101
1120
  viewBox: "0 0 24 24",
@@ -1105,26 +1124,26 @@ Je réponds en quelques secondes.`;
1105
1124
  "stroke-linecap": "round",
1106
1125
  "stroke-linejoin": "round",
1107
1126
  "aria-hidden": "true"
1108
- }, Rt = ["d"], $t = { class: "wm-onb__link-label" }, Ft = { class: "wm-onb__cta" }, Ut = ["disabled"];
1109
- function Dt(t, e, n, a, r, s) {
1110
- const o = O("AIAvatar");
1111
- return l(), d("div", yt, [
1112
- i("div", wt, [
1113
- z(o, {
1127
+ }, jt = ["d"], Ut = { class: "wm-onb__link-label" }, Dt = { class: "wm-onb__cta" }, Nt = ["disabled"];
1128
+ function Pt(t, e, n, a, r, s) {
1129
+ const o = I("AIAvatar");
1130
+ return l(), c("div", kt, [
1131
+ i("div", Ct, [
1132
+ H(o, {
1114
1133
  size: 56,
1115
1134
  pulse: !0
1116
1135
  }),
1117
- i("div", bt, y(s.heroTitle), 1),
1118
- i("div", kt, y(s.heroSub), 1)
1136
+ i("div", At, b(s.heroTitle), 1),
1137
+ i("div", St, b(s.heroSub), 1)
1119
1138
  ]),
1120
- n.unreadThreads.length ? (l(), d("div", Ct, [
1139
+ n.unreadThreads.length ? (l(), c("div", xt, [
1121
1140
  e[3] || (e[3] = i("div", { class: "wm-onb__section-title" }, "Messages non lus", -1)),
1122
- i("div", At, [
1123
- (l(!0), d(E, null, F(n.unreadThreads, (c) => (l(), d("button", {
1124
- key: c.id,
1141
+ i("div", Mt, [
1142
+ (l(!0), c(O, null, F(n.unreadThreads, (d) => (l(), c("button", {
1143
+ key: d.id,
1125
1144
  type: "button",
1126
1145
  class: "wm-onb__link wm-onb__resume",
1127
- onClick: (p) => t.$emit("resume", c)
1146
+ onClick: (v) => t.$emit("resume", d)
1128
1147
  }, [
1129
1148
  e[1] || (e[1] = i("span", { class: "wm-onb__link-icon wm-onb__resume-icon" }, [
1130
1149
  i("svg", {
@@ -1145,9 +1164,9 @@ function Dt(t, e, n, a, r, s) {
1145
1164
  "aria-label": "Non lu"
1146
1165
  })
1147
1166
  ], -1)),
1148
- i("span", xt, [
1149
- i("span", Mt, y(c.title), 1),
1150
- i("span", Tt, y(c.preview), 1)
1167
+ i("span", It, [
1168
+ i("span", Ot, b(d.title), 1),
1169
+ i("span", Et, b(d.preview), 1)
1151
1170
  ]),
1152
1171
  e[2] || (e[2] = i("svg", {
1153
1172
  width: "13",
@@ -1163,26 +1182,26 @@ function Dt(t, e, n, a, r, s) {
1163
1182
  }, [
1164
1183
  i("path", { d: "M9 18l6-6-6-6" })
1165
1184
  ], -1))
1166
- ], 8, St))), 128))
1185
+ ], 8, Tt))), 128))
1167
1186
  ])
1168
- ])) : v("", !0),
1169
- n.quickLinks.length ? (l(), d("div", It, [
1187
+ ])) : y("", !0),
1188
+ n.quickLinks.length ? (l(), c("div", Bt, [
1170
1189
  e[5] || (e[5] = i("div", { class: "wm-onb__section-title" }, "Accès rapide", -1)),
1171
- i("div", Ot, [
1172
- (l(!0), d(E, null, F(n.quickLinks, (c, p) => (l(), d("button", {
1173
- key: p,
1190
+ i("div", Lt, [
1191
+ (l(!0), c(O, null, F(n.quickLinks, (d, v) => (l(), c("button", {
1192
+ key: v,
1174
1193
  type: "button",
1175
1194
  class: "wm-onb__link",
1176
- onClick: (k) => t.$emit("select", c)
1195
+ onClick: (C) => t.$emit("select", d)
1177
1196
  }, [
1178
- i("span", Bt, [
1179
- (l(), d("svg", Lt, [
1197
+ i("span", $t, [
1198
+ (l(), c("svg", Ft, [
1180
1199
  i("path", {
1181
- d: s.iconPath(c.icon)
1182
- }, null, 8, Rt)
1200
+ d: s.iconPath(d.icon)
1201
+ }, null, 8, jt)
1183
1202
  ]))
1184
1203
  ]),
1185
- i("span", $t, y(c.label), 1),
1204
+ i("span", Ut, b(d.label), 1),
1186
1205
  e[4] || (e[4] = i("svg", {
1187
1206
  width: "13",
1188
1207
  height: "13",
@@ -1197,83 +1216,83 @@ function Dt(t, e, n, a, r, s) {
1197
1216
  }, [
1198
1217
  i("path", { d: "M9 18l6-6-6-6" })
1199
1218
  ], -1))
1200
- ], 8, Et))), 128))
1219
+ ], 8, Rt))), 128))
1201
1220
  ])
1202
- ])) : v("", !0),
1203
- i("div", Ft, [
1221
+ ])) : y("", !0),
1222
+ i("div", Dt, [
1204
1223
  i("button", {
1205
1224
  type: "button",
1206
1225
  class: "wm-onb__startBtn",
1207
1226
  disabled: n.busy,
1208
- onClick: e[0] || (e[0] = (c) => t.$emit("start"))
1209
- }, y(n.busy ? "…" : "Commencer une conversation"), 9, Ut)
1227
+ onClick: e[0] || (e[0] = (d) => t.$emit("start"))
1228
+ }, b(n.busy ? "…" : "Commencer une conversation"), 9, Nt)
1210
1229
  ])
1211
1230
  ]);
1212
1231
  }
1213
- const jt = /* @__PURE__ */ L(gt, [["render", Dt], ["__scopeId", "data-v-bd89bc8f"]]);
1214
- function Nt(t) {
1232
+ const Ht = /* @__PURE__ */ B(bt, [["render", Pt], ["__scopeId", "data-v-bd89bc8f"]]);
1233
+ function zt(t) {
1215
1234
  return String(t).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
1216
1235
  }
1217
- function Pt(t) {
1236
+ function Vt(t) {
1218
1237
  return /^(https?:\/\/|mailto:|tel:)/i.test(String(t).trim());
1219
1238
  }
1220
- const fe = "";
1239
+ const pe = "";
1221
1240
  function ee(t) {
1222
1241
  let e = t;
1223
1242
  const n = [];
1224
1243
  return e = e.replace(/`([^`\n]+)`/g, (a, r) => {
1225
1244
  const s = n.length;
1226
- return n.push(r), `${fe}CODE${s}${fe}`;
1227
- }), e = e.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (a, r, s) => Pt(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;
1245
+ return n.push(r), `${pe}CODE${s}${pe}`;
1246
+ }), e = e.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (a, r, s) => Vt(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;
1228
1247
  }
1229
- function be(t) {
1248
+ function Ce(t) {
1230
1249
  if (!t) return "";
1231
- const e = Nt(t).split(`
1250
+ const e = zt(t).split(`
1232
1251
  `), n = [];
1233
1252
  let a = 0;
1234
1253
  for (; a < e.length; ) {
1235
1254
  const s = e[a];
1236
1255
  if (/^\s*```([\w-]*)\s*$/.exec(s)) {
1237
1256
  a++;
1238
- const k = [];
1257
+ const C = [];
1239
1258
  for (; a < e.length && !/^\s*```\s*$/.test(e[a]); )
1240
- k.push(e[a]), a++;
1259
+ C.push(e[a]), a++;
1241
1260
  a < e.length && a++, n.push({
1242
1261
  type: "block",
1243
- html: `<pre class="wm-md-pre"><code>${k.join(`
1262
+ html: `<pre class="wm-md-pre"><code>${C.join(`
1244
1263
  `)}</code></pre>`
1245
1264
  });
1246
1265
  continue;
1247
1266
  }
1248
1267
  if (/^\s*[-*]\s+/.test(s)) {
1249
- const k = [];
1268
+ const C = [];
1250
1269
  for (; a < e.length; ) {
1251
- const T = /^\s*[-*]\s+(.*)$/.exec(e[a]);
1252
- if (!T) break;
1253
- k.push(T[1]), a++;
1270
+ const S = /^\s*[-*]\s+(.*)$/.exec(e[a]);
1271
+ if (!S) break;
1272
+ C.push(S[1]), a++;
1254
1273
  }
1255
- const g = k.map((T) => `<li>${ee(T)}</li>`).join("");
1256
- n.push({ type: "block", html: `<ul class="wm-md-ul">${g}</ul>` });
1274
+ const w = C.map((S) => `<li>${ee(S)}</li>`).join("");
1275
+ n.push({ type: "block", html: `<ul class="wm-md-ul">${w}</ul>` });
1257
1276
  continue;
1258
1277
  }
1259
- const c = /^\s*(\d+)\.\s+(.*)$/.exec(s);
1260
- if (c) {
1261
- const k = parseInt(c[1], 10), g = [c[2]];
1278
+ const d = /^\s*(\d+)\.\s+(.*)$/.exec(s);
1279
+ if (d) {
1280
+ const C = parseInt(d[1], 10), w = [d[2]];
1262
1281
  for (a++; a < e.length; ) {
1263
- const x = /^\s*\d+\.\s+(.*)$/.exec(e[a]);
1264
- if (!x) break;
1265
- g.push(x[1]), a++;
1282
+ const A = /^\s*\d+\.\s+(.*)$/.exec(e[a]);
1283
+ if (!A) break;
1284
+ w.push(A[1]), a++;
1266
1285
  }
1267
- const T = g.map((x) => `<li>${ee(x)}</li>`).join(""), R = k !== 1 ? ` start="${k}"` : "";
1268
- n.push({ type: "block", html: `<ol class="wm-md-ol"${R}>${T}</ol>` });
1286
+ const S = w.map((A) => `<li>${ee(A)}</li>`).join(""), L = C !== 1 ? ` start="${C}"` : "";
1287
+ n.push({ type: "block", html: `<ol class="wm-md-ol"${L}>${S}</ol>` });
1269
1288
  continue;
1270
1289
  }
1271
- const p = /^(#{1,6})\s+(.*)$/.exec(s);
1272
- if (p) {
1273
- const k = p[1].length;
1290
+ const v = /^(#{1,6})\s+(.*)$/.exec(s);
1291
+ if (v) {
1292
+ const C = v[1].length;
1274
1293
  n.push({
1275
1294
  type: "block",
1276
- html: `<h${k} class="wm-md-h wm-md-h${k}">${ee(p[2])}</h${k}>`
1295
+ html: `<h${C} class="wm-md-h wm-md-h${C}">${ee(v[2])}</h${C}>`
1277
1296
  }), a++;
1278
1297
  continue;
1279
1298
  }
@@ -1283,13 +1302,13 @@ function be(t) {
1283
1302
  for (let s = 0; s < n.length; s++) {
1284
1303
  const o = n[s];
1285
1304
  r += o.html;
1286
- const c = n[s + 1];
1287
- c && o.type !== "block" && c.type !== "block" && (r += `
1305
+ const d = n[s + 1];
1306
+ d && o.type !== "block" && d.type !== "block" && (r += `
1288
1307
  `);
1289
1308
  }
1290
1309
  return r;
1291
1310
  }
1292
- const Ht = {
1311
+ const qt = {
1293
1312
  name: "WmArtifactFormResponse",
1294
1313
  props: {
1295
1314
  data: { type: Object, required: !0 }
@@ -1300,11 +1319,11 @@ const Ht = {
1300
1319
  return Array.isArray((t = this.data) == null ? void 0 : t.fields) ? this.data.fields : [];
1301
1320
  }
1302
1321
  }
1303
- }, zt = { class: "wm-art wm-art--formResponse" }, Vt = { class: "wm-art__head" }, qt = { class: "wm-art__title" }, Wt = { class: "wm-art__body" }, Gt = { class: "wm-art__fieldLabel" };
1304
- function Kt(t, e, n, a, r, s) {
1305
- return l(), d("div", zt, [
1306
- i("div", Vt, [
1307
- i("div", qt, y(n.data.title || "Formulaire"), 1),
1322
+ }, Wt = { class: "wm-art wm-art--formResponse" }, Gt = { class: "wm-art__head" }, Kt = { class: "wm-art__title" }, Yt = { class: "wm-art__body" }, Jt = { class: "wm-art__fieldLabel" };
1323
+ function Xt(t, e, n, a, r, s) {
1324
+ return l(), c("div", Wt, [
1325
+ i("div", Gt, [
1326
+ i("div", Kt, b(n.data.title || "Formulaire"), 1),
1308
1327
  e[0] || (e[0] = i("span", { class: "wm-art__badge wm-art__badge--success" }, [
1309
1328
  i("svg", {
1310
1329
  width: "11",
@@ -1322,20 +1341,20 @@ function Kt(t, e, n, a, r, s) {
1322
1341
  se(" Envoyé ")
1323
1342
  ], -1))
1324
1343
  ]),
1325
- i("div", Wt, [
1326
- (l(!0), d(E, null, F(s.fields, (o, c) => (l(), d("div", {
1327
- key: c,
1344
+ i("div", Yt, [
1345
+ (l(!0), c(O, null, F(s.fields, (o, d) => (l(), c("div", {
1346
+ key: d,
1328
1347
  class: "wm-art__field"
1329
1348
  }, [
1330
- i("div", Gt, y(o.label), 1),
1349
+ i("div", Jt, b(o.label), 1),
1331
1350
  i("div", {
1332
- class: B(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1333
- }, y(o.value), 3)
1351
+ class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1352
+ }, b(o.value), 3)
1334
1353
  ]))), 128))
1335
1354
  ])
1336
1355
  ]);
1337
1356
  }
1338
- const Yt = /* @__PURE__ */ L(Ht, [["render", Kt], ["__scopeId", "data-v-812bda8b"]]), Jt = {
1357
+ const Qt = /* @__PURE__ */ B(qt, [["render", Xt], ["__scopeId", "data-v-812bda8b"]]), Zt = {
1339
1358
  name: "WmArtifactInfoCard",
1340
1359
  props: {
1341
1360
  data: { type: Object, required: !0 }
@@ -1350,61 +1369,61 @@ const Yt = /* @__PURE__ */ L(Ht, [["render", Kt], ["__scopeId", "data-v-812bda8b
1350
1369
  return !!((t = this.data) != null && t.body) || this.fields.length > 0;
1351
1370
  }
1352
1371
  }
1353
- }, Xt = { class: "wm-art wm-art--infoCard" }, Qt = {
1372
+ }, en = { class: "wm-art wm-art--infoCard" }, tn = {
1354
1373
  key: 0,
1355
1374
  class: "wm-art__image"
1356
- }, Zt = ["src", "alt"], en = { class: "wm-art__head" }, tn = { class: "wm-art__headMain" }, nn = { class: "wm-art__title" }, sn = {
1375
+ }, nn = ["src", "alt"], sn = { class: "wm-art__head" }, rn = { class: "wm-art__headMain" }, an = { class: "wm-art__title" }, on = {
1357
1376
  key: 0,
1358
1377
  class: "wm-art__subtitle"
1359
- }, rn = {
1378
+ }, ln = {
1360
1379
  key: 1,
1361
1380
  class: "wm-art__body"
1362
- }, an = {
1381
+ }, cn = {
1363
1382
  key: 0,
1364
1383
  class: "wm-art__text"
1365
- }, on = { class: "wm-art__fieldLabel" };
1366
- function ln(t, e, n, a, r, s) {
1367
- return l(), d("div", Xt, [
1368
- n.data.image_url ? (l(), d("figure", Qt, [
1384
+ }, dn = { class: "wm-art__fieldLabel" };
1385
+ function un(t, e, n, a, r, s) {
1386
+ return l(), c("div", en, [
1387
+ n.data.image_url ? (l(), c("figure", tn, [
1369
1388
  i("img", {
1370
1389
  src: n.data.image_url,
1371
1390
  alt: n.data.title || "",
1372
1391
  loading: "lazy"
1373
- }, null, 8, Zt)
1374
- ])) : v("", !0),
1375
- i("div", en, [
1376
- i("div", tn, [
1377
- i("div", nn, y(n.data.title), 1),
1378
- n.data.subtitle ? (l(), d("div", sn, y(n.data.subtitle), 1)) : v("", !0)
1392
+ }, null, 8, nn)
1393
+ ])) : y("", !0),
1394
+ i("div", sn, [
1395
+ i("div", rn, [
1396
+ i("div", an, b(n.data.title), 1),
1397
+ n.data.subtitle ? (l(), c("div", on, b(n.data.subtitle), 1)) : y("", !0)
1379
1398
  ]),
1380
- n.data.badge && n.data.badge.label ? (l(), d("span", {
1399
+ n.data.badge && n.data.badge.label ? (l(), c("span", {
1381
1400
  key: 0,
1382
- class: B(["wm-art__badge", `wm-art__badge--${n.data.badge.tone || "neutral"}`])
1383
- }, y(n.data.badge.label), 3)) : v("", !0)
1401
+ class: E(["wm-art__badge", `wm-art__badge--${n.data.badge.tone || "neutral"}`])
1402
+ }, b(n.data.badge.label), 3)) : y("", !0)
1384
1403
  ]),
1385
- s.hasBody ? (l(), d("div", rn, [
1386
- n.data.body ? (l(), d("div", an, y(n.data.body), 1)) : v("", !0),
1387
- s.fields.length ? (l(!0), d(E, { key: 1 }, F(s.fields, (o, c) => (l(), d("div", {
1388
- key: c,
1404
+ s.hasBody ? (l(), c("div", ln, [
1405
+ n.data.body ? (l(), c("div", cn, b(n.data.body), 1)) : y("", !0),
1406
+ s.fields.length ? (l(!0), c(O, { key: 1 }, F(s.fields, (o, d) => (l(), c("div", {
1407
+ key: d,
1389
1408
  class: "wm-art__field"
1390
1409
  }, [
1391
- i("div", on, y(o.label), 1),
1410
+ i("div", dn, b(o.label), 1),
1392
1411
  i("div", {
1393
- class: B(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1394
- }, y(o.value), 3)
1395
- ]))), 128)) : v("", !0)
1396
- ])) : v("", !0)
1412
+ class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1413
+ }, b(o.value), 3)
1414
+ ]))), 128)) : y("", !0)
1415
+ ])) : y("", !0)
1397
1416
  ]);
1398
1417
  }
1399
- const dn = /* @__PURE__ */ L(Jt, [["render", ln], ["__scopeId", "data-v-d7369333"]]);
1400
- function cn(t) {
1418
+ const hn = /* @__PURE__ */ B(Zt, [["render", un], ["__scopeId", "data-v-d7369333"]]);
1419
+ function mn(t) {
1401
1420
  if (!t) return "";
1402
1421
  const e = new Date(t);
1403
1422
  if (Number.isNaN(e.getTime())) return t;
1404
1423
  const n = e.toLocaleDateString("fr-FR", { day: "numeric", month: "long", year: "numeric" }), a = e.toLocaleTimeString("fr-FR", { hour: "2-digit", minute: "2-digit" });
1405
1424
  return `${n} à ${a}`;
1406
1425
  }
1407
- const un = {
1426
+ const fn = {
1408
1427
  name: "WmArtifactTicket",
1409
1428
  props: {
1410
1429
  data: { type: Object, required: !0 }
@@ -1420,7 +1439,7 @@ const un = {
1420
1439
  },
1421
1440
  formattedDate() {
1422
1441
  var t;
1423
- return cn((t = this.data) == null ? void 0 : t.created_at);
1442
+ return mn((t = this.data) == null ? void 0 : t.created_at);
1424
1443
  }
1425
1444
  },
1426
1445
  methods: {
@@ -1437,22 +1456,22 @@ const un = {
1437
1456
  return /high|haute|élev|elev|critic|critiq|urgent/.test(e) ? 3 : /low|basse|faible|minor/.test(e) ? 1 : 2;
1438
1457
  }
1439
1458
  }
1440
- }, hn = { class: "wm-art wm-art--ticket" }, mn = { class: "wm-art__head wm-tk__head" }, fn = { class: "wm-art__title wm-tk__title" }, _n = { class: "wm-tk__sub" }, pn = { class: "wm-tk__ref" }, vn = {
1459
+ }, _n = { class: "wm-art wm-art--ticket" }, pn = { class: "wm-art__head wm-tk__head" }, vn = { class: "wm-art__title wm-tk__title" }, gn = { class: "wm-tk__sub" }, yn = { class: "wm-tk__ref" }, wn = {
1441
1460
  key: 0,
1442
1461
  class: "wm-art__body"
1443
- }, gn = {
1462
+ }, bn = {
1444
1463
  key: 0,
1445
1464
  class: "wm-tk__text"
1446
- }, yn = { class: "wm-art__fieldLabel" }, wn = ["data-level"], bn = {
1465
+ }, kn = { class: "wm-art__fieldLabel" }, Cn = ["data-level"], An = {
1447
1466
  key: 1,
1448
1467
  class: "wm-art__footer wm-tk__footer"
1449
1468
  };
1450
- function kn(t, e, n, a, r, s) {
1451
- return l(), d("div", hn, [
1452
- i("div", mn, [
1453
- i("div", fn, y(n.data.title), 1),
1454
- i("div", _n, [
1455
- i("div", pn, [
1469
+ function Sn(t, e, n, a, r, s) {
1470
+ return l(), c("div", _n, [
1471
+ i("div", pn, [
1472
+ i("div", vn, b(n.data.title), 1),
1473
+ i("div", gn, [
1474
+ i("div", yn, [
1456
1475
  e[0] || (e[0] = i("svg", {
1457
1476
  width: "11",
1458
1477
  height: "11",
@@ -1467,30 +1486,30 @@ function kn(t, e, n, a, r, s) {
1467
1486
  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" }),
1468
1487
  i("path", { d: "M13 5v2M13 17v2M13 11v2" })
1469
1488
  ], -1)),
1470
- i("span", null, y(n.data.reference), 1)
1489
+ i("span", null, b(n.data.reference), 1)
1471
1490
  ]),
1472
1491
  i("span", {
1473
- class: B(["wm-art__badge", "wm-tk__badge", `wm-art__badge--${n.data.status.tone || "neutral"}`])
1492
+ class: E(["wm-art__badge", "wm-tk__badge", `wm-art__badge--${n.data.status.tone || "neutral"}`])
1474
1493
  }, [
1475
1494
  e[1] || (e[1] = i("span", {
1476
1495
  class: "wm-tk__dot",
1477
1496
  "aria-hidden": "true"
1478
1497
  }, null, -1)),
1479
- se(" " + y(n.data.status.label), 1)
1498
+ se(" " + b(n.data.status.label), 1)
1480
1499
  ], 2)
1481
1500
  ])
1482
1501
  ]),
1483
- s.hasBody ? (l(), d("div", vn, [
1484
- n.data.body ? (l(), d("div", gn, y(n.data.body), 1)) : v("", !0),
1485
- s.fields.length ? (l(!0), d(E, { key: 1 }, F(s.fields, (o, c) => (l(), d("div", {
1486
- key: c,
1502
+ s.hasBody ? (l(), c("div", wn, [
1503
+ n.data.body ? (l(), c("div", bn, b(n.data.body), 1)) : y("", !0),
1504
+ s.fields.length ? (l(!0), c(O, { key: 1 }, F(s.fields, (o, d) => (l(), c("div", {
1505
+ key: d,
1487
1506
  class: "wm-art__field"
1488
1507
  }, [
1489
- i("div", yn, y(o.label), 1),
1508
+ i("div", kn, b(o.label), 1),
1490
1509
  i("div", {
1491
- class: B(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1510
+ class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1492
1511
  }, [
1493
- s.isPriority(o.label) ? (l(), d("svg", {
1512
+ s.isPriority(o.label) ? (l(), c("svg", {
1494
1513
  key: 0,
1495
1514
  class: "wm-tk__prio",
1496
1515
  "data-level": s.priorityLevel(o.value),
@@ -1520,12 +1539,12 @@ function kn(t, e, n, a, r, s) {
1520
1539
  height: "9",
1521
1540
  rx: "0.5"
1522
1541
  }, null, -1)
1523
- ])], 8, wn)) : v("", !0),
1524
- i("span", null, y(o.value), 1)
1542
+ ])], 8, Cn)) : y("", !0),
1543
+ i("span", null, b(o.value), 1)
1525
1544
  ], 2)
1526
- ]))), 128)) : v("", !0)
1527
- ])) : v("", !0),
1528
- n.data.created_at ? (l(), d("div", bn, [
1545
+ ]))), 128)) : y("", !0)
1546
+ ])) : y("", !0),
1547
+ n.data.created_at ? (l(), c("div", An, [
1529
1548
  e[3] || (e[3] = i("svg", {
1530
1549
  width: "11",
1531
1550
  height: "11",
@@ -1546,15 +1565,15 @@ function kn(t, e, n, a, r, s) {
1546
1565
  }),
1547
1566
  i("path", { d: "M16 2v4M8 2v4M3 10h18" })
1548
1567
  ], -1)),
1549
- i("span", null, y(s.formattedDate), 1)
1550
- ])) : v("", !0)
1568
+ i("span", null, b(s.formattedDate), 1)
1569
+ ])) : y("", !0)
1551
1570
  ]);
1552
1571
  }
1553
- const Cn = /* @__PURE__ */ L(un, [["render", kn], ["__scopeId", "data-v-f0495924"]]), An = {
1554
- form_response: Yt,
1555
- info_card: dn,
1556
- ticket: Cn
1557
- }, Sn = {
1572
+ const xn = /* @__PURE__ */ B(fn, [["render", Sn], ["__scopeId", "data-v-f0495924"]]), Mn = {
1573
+ form_response: Qt,
1574
+ info_card: hn,
1575
+ ticket: xn
1576
+ }, Tn = {
1558
1577
  name: "WmArtifactRenderer",
1559
1578
  props: {
1560
1579
  // Forme : { kind: string, data: any } (le `data` est validé
@@ -1565,19 +1584,19 @@ const Cn = /* @__PURE__ */ L(un, [["render", kn], ["__scopeId", "data-v-f0495924
1565
1584
  component() {
1566
1585
  var e;
1567
1586
  const t = (e = this.artifact) == null ? void 0 : e.kind;
1568
- return t && An[t] || null;
1587
+ return t && Mn[t] || null;
1569
1588
  }
1570
1589
  }
1571
1590
  };
1572
- function xn(t, e, n, a, r, s) {
1573
- return s.component ? (l(), $(Me(s.component), {
1591
+ function In(t, e, n, a, r, s) {
1592
+ return s.component ? (l(), $(Ie(s.component), {
1574
1593
  key: 0,
1575
1594
  data: n.artifact.data
1576
- }, null, 8, ["data"])) : v("", !0);
1595
+ }, null, 8, ["data"])) : y("", !0);
1577
1596
  }
1578
- const ke = /* @__PURE__ */ L(Sn, [["render", xn]]), Mn = {
1597
+ const Ae = /* @__PURE__ */ B(Tn, [["render", In]]), On = {
1579
1598
  name: "WmActionResult",
1580
- components: { ArtifactRenderer: ke },
1599
+ components: { ArtifactRenderer: Ae },
1581
1600
  props: {
1582
1601
  state: { type: String, default: "success" },
1583
1602
  // 'success' | 'failure' | 'rejected'
@@ -1595,10 +1614,10 @@ const ke = /* @__PURE__ */ L(Sn, [["render", xn]]), Mn = {
1595
1614
  // bullet lists / bold emphasis / inline code. Render them through
1596
1615
  // the shared markdown pipeline so they read like the chat bubbles.
1597
1616
  detailHtml() {
1598
- return be(this.detail);
1617
+ return Ce(this.detail);
1599
1618
  }
1600
1619
  }
1601
- }, Tn = { class: "wm-result-wrap" }, In = { class: "wm-result" }, On = {
1620
+ }, En = { class: "wm-result-wrap" }, Bn = { class: "wm-result" }, Ln = {
1602
1621
  key: 0,
1603
1622
  width: "10",
1604
1623
  height: "10",
@@ -1609,7 +1628,7 @@ const ke = /* @__PURE__ */ L(Sn, [["render", xn]]), Mn = {
1609
1628
  "stroke-linecap": "round",
1610
1629
  "stroke-linejoin": "round",
1611
1630
  "aria-hidden": "true"
1612
- }, En = {
1631
+ }, Rn = {
1613
1632
  key: 1,
1614
1633
  width: "10",
1615
1634
  height: "10",
@@ -1620,40 +1639,40 @@ const ke = /* @__PURE__ */ L(Sn, [["render", xn]]), Mn = {
1620
1639
  "stroke-linecap": "round",
1621
1640
  "stroke-linejoin": "round",
1622
1641
  "aria-hidden": "true"
1623
- }, Bn = { class: "wm-result__body" }, Ln = ["innerHTML"], Rn = {
1642
+ }, $n = { class: "wm-result__body" }, Fn = ["innerHTML"], jn = {
1624
1643
  key: 0,
1625
1644
  class: "wm-result-art"
1626
1645
  };
1627
- function $n(t, e, n, a, r, s) {
1628
- const o = O("ArtifactRenderer");
1629
- return l(), d("div", Tn, [
1630
- i("div", In, [
1646
+ function Un(t, e, n, a, r, s) {
1647
+ const o = I("ArtifactRenderer");
1648
+ return l(), c("div", En, [
1649
+ i("div", Bn, [
1631
1650
  i("div", {
1632
- class: B(["wm-result__check", { "wm-result__check--ok": s.ok }])
1651
+ class: E(["wm-result__check", { "wm-result__check--ok": s.ok }])
1633
1652
  }, [
1634
- s.ok ? (l(), d("svg", On, [...e[0] || (e[0] = [
1653
+ s.ok ? (l(), c("svg", Ln, [...e[0] || (e[0] = [
1635
1654
  i("path", { d: "M20 6L9 17l-5-5" }, null, -1)
1636
- ])])) : (l(), d("svg", En, [...e[1] || (e[1] = [
1655
+ ])])) : (l(), c("svg", Rn, [...e[1] || (e[1] = [
1637
1656
  i("path", { d: "M18 6L6 18M6 6l12 12" }, null, -1)
1638
1657
  ])]))
1639
1658
  ], 2),
1640
- i("div", Bn, [
1659
+ i("div", $n, [
1641
1660
  i("div", {
1642
- class: B(["wm-result__label", { "wm-result__label--struck": !s.ok }])
1643
- }, y(n.label), 3),
1644
- n.detail ? (l(), d("div", {
1661
+ class: E(["wm-result__label", { "wm-result__label--struck": !s.ok }])
1662
+ }, b(n.label), 3),
1663
+ n.detail ? (l(), c("div", {
1645
1664
  key: 0,
1646
1665
  class: "wm-result__detail",
1647
1666
  innerHTML: s.detailHtml
1648
- }, null, 8, Ln)) : v("", !0)
1667
+ }, null, 8, Fn)) : y("", !0)
1649
1668
  ])
1650
1669
  ]),
1651
- n.artifact ? (l(), d("div", Rn, [
1652
- z(o, { artifact: n.artifact }, null, 8, ["artifact"])
1653
- ])) : v("", !0)
1670
+ n.artifact ? (l(), c("div", jn, [
1671
+ H(o, { artifact: n.artifact }, null, 8, ["artifact"])
1672
+ ])) : y("", !0)
1654
1673
  ]);
1655
1674
  }
1656
- const Fn = /* @__PURE__ */ L(Mn, [["render", $n], ["__scopeId", "data-v-037fd69e"]]), Un = {
1675
+ const Dn = /* @__PURE__ */ B(On, [["render", Un], ["__scopeId", "data-v-037fd69e"]]), Nn = {
1657
1676
  name: "WmAttachmentPreview",
1658
1677
  inject: {
1659
1678
  signAttachmentFn: { default: null }
@@ -1707,19 +1726,19 @@ const Fn = /* @__PURE__ */ L(Mn, [["render", $n], ["__scopeId", "data-v-037fd69e
1707
1726
  this.url || t.preventDefault();
1708
1727
  }
1709
1728
  }
1710
- }, Dn = ["href"], jn = ["src", "alt"], Nn = ["src"], Pn = ["src"], Hn = ["href", "download"], zn = { class: "wm-att__main" }, Vn = { class: "wm-att__name" }, qn = {
1729
+ }, Pn = ["href"], Hn = ["src", "alt"], zn = ["src"], Vn = ["src"], qn = ["href", "download"], Wn = { class: "wm-att__main" }, Gn = { class: "wm-att__name" }, Kn = {
1711
1730
  key: 0,
1712
1731
  class: "wm-att__meta"
1713
- }, Wn = {
1732
+ }, Yn = {
1714
1733
  key: 0,
1715
1734
  class: "wm-att__spin",
1716
1735
  "aria-hidden": "true"
1717
1736
  };
1718
- function Gn(t, e, n, a, r, s) {
1719
- return l(), d("div", {
1720
- class: B(["wm-att", ["wm-att--" + (s.kind || "file")]])
1737
+ function Jn(t, e, n, a, r, s) {
1738
+ return l(), c("div", {
1739
+ class: E(["wm-att", ["wm-att--" + (s.kind || "file")]])
1721
1740
  }, [
1722
- s.kind === "image" && r.url ? (l(), d("a", {
1741
+ s.kind === "image" && r.url ? (l(), c("a", {
1723
1742
  key: 0,
1724
1743
  href: r.url,
1725
1744
  target: "_blank",
@@ -1730,18 +1749,18 @@ function Gn(t, e, n, a, r, s) {
1730
1749
  src: r.url,
1731
1750
  alt: s.displayName,
1732
1751
  loading: "lazy"
1733
- }, null, 8, jn)
1734
- ], 8, Dn)) : s.kind === "audio" && r.url ? (l(), d("audio", {
1752
+ }, null, 8, Hn)
1753
+ ], 8, Pn)) : s.kind === "audio" && r.url ? (l(), c("audio", {
1735
1754
  key: 1,
1736
1755
  src: r.url,
1737
1756
  controls: "",
1738
1757
  preload: "metadata"
1739
- }, null, 8, Nn)) : s.kind === "video" && r.url ? (l(), d("video", {
1758
+ }, null, 8, zn)) : s.kind === "video" && r.url ? (l(), c("video", {
1740
1759
  key: 2,
1741
1760
  src: r.url,
1742
1761
  controls: "",
1743
1762
  preload: "metadata"
1744
- }, null, 8, Pn)) : (l(), d("a", {
1763
+ }, null, 8, Vn)) : (l(), c("a", {
1745
1764
  key: 3,
1746
1765
  class: "wm-att__file",
1747
1766
  href: r.url || "#",
@@ -1766,15 +1785,15 @@ function Gn(t, e, n, a, r, s) {
1766
1785
  i("path", { d: "M14 2v6h6" })
1767
1786
  ])
1768
1787
  ], -1)),
1769
- i("span", zn, [
1770
- i("span", Vn, y(s.displayName), 1),
1771
- s.sizeLabel ? (l(), d("span", qn, y(s.sizeLabel), 1)) : v("", !0)
1788
+ i("span", Wn, [
1789
+ i("span", Gn, b(s.displayName), 1),
1790
+ s.sizeLabel ? (l(), c("span", Kn, b(s.sizeLabel), 1)) : y("", !0)
1772
1791
  ]),
1773
- r.loading ? (l(), d("span", Wn)) : v("", !0)
1774
- ], 8, Hn))
1792
+ r.loading ? (l(), c("span", Yn)) : y("", !0)
1793
+ ], 8, qn))
1775
1794
  ], 2);
1776
1795
  }
1777
- const Kn = /* @__PURE__ */ L(Un, [["render", Gn], ["__scopeId", "data-v-1cd1267b"]]), Yn = {
1796
+ const Xn = /* @__PURE__ */ B(Nn, [["render", Jn], ["__scopeId", "data-v-1cd1267b"]]), Qn = {
1778
1797
  name: "WmBubble",
1779
1798
  props: {
1780
1799
  role: { type: String, default: "ai" },
@@ -1783,41 +1802,41 @@ const Kn = /* @__PURE__ */ L(Un, [["render", Gn], ["__scopeId", "data-v-1cd1267b
1783
1802
  },
1784
1803
  computed: {
1785
1804
  rendered() {
1786
- return be(this.text);
1805
+ return Ce(this.text);
1787
1806
  }
1788
1807
  }
1789
- }, Jn = ["innerHTML"];
1790
- function Xn(t, e, n, a, r, s) {
1791
- return l(), d("div", {
1792
- class: B(["wm-bubble", "wm-bubble--" + n.role])
1808
+ }, Zn = ["innerHTML"];
1809
+ function es(t, e, n, a, r, s) {
1810
+ return l(), c("div", {
1811
+ class: E(["wm-bubble", "wm-bubble--" + n.role])
1793
1812
  }, [
1794
- Te(t.$slots, "default", {}, () => [
1795
- i("span", { innerHTML: s.rendered }, null, 8, Jn)
1813
+ Oe(t.$slots, "default", {}, () => [
1814
+ i("span", { innerHTML: s.rendered }, null, 8, Zn)
1796
1815
  ], !0)
1797
1816
  ], 2);
1798
1817
  }
1799
- const Qn = /* @__PURE__ */ L(Yn, [["render", Xn], ["__scopeId", "data-v-bcbe5969"]]), Zn = { name: "WmTyping" }, es = { class: "wm-typing" };
1800
- function ts(t, e, n, a, r, s) {
1801
- return l(), d("div", es, [...e[0] || (e[0] = [
1818
+ const ts = /* @__PURE__ */ B(Qn, [["render", es], ["__scopeId", "data-v-bcbe5969"]]), ns = { name: "WmTyping" }, ss = { class: "wm-typing" };
1819
+ function rs(t, e, n, a, r, s) {
1820
+ return l(), c("div", ss, [...e[0] || (e[0] = [
1802
1821
  i("span", { style: { "animation-delay": "0s" } }, null, -1),
1803
1822
  i("span", { style: { "animation-delay": "0.2s" } }, null, -1),
1804
1823
  i("span", { style: { "animation-delay": "0.4s" } }, null, -1)
1805
1824
  ])]);
1806
1825
  }
1807
- const ns = /* @__PURE__ */ L(Zn, [["render", ts], ["__scopeId", "data-v-df2447fd"]]);
1808
- function oe(t) {
1826
+ const is = /* @__PURE__ */ B(ns, [["render", rs], ["__scopeId", "data-v-df2447fd"]]);
1827
+ function ce(t) {
1809
1828
  return t ? t.client_msg_id || t.id : "";
1810
1829
  }
1811
- const ss = {
1830
+ const as = {
1812
1831
  transferred_to_human: "Conversation transférée à un humain",
1813
1832
  assigned: "{name} a rejoint la conversation",
1814
1833
  unassigned: "L'agent a quitté la conversation",
1815
1834
  resolved: "Conversation résolue",
1816
1835
  reopened: "Conversation rouverte",
1817
1836
  idle: "Conversation en pause"
1818
- }, rs = 80, is = 200, as = {
1837
+ }, os = 80, ls = 200, cs = {
1819
1838
  name: "WmMessageList",
1820
- components: { AIAvatar: X, HumanAvatar: we, Bubble: Qn, Typing: ns, ActionResult: Fn, AttachmentPreview: Kn, ArtifactRenderer: ke },
1839
+ components: { AIAvatar: J, HumanAvatar: ke, Bubble: ts, Typing: is, ActionResult: Dn, AttachmentPreview: Xn, ArtifactRenderer: Ae },
1821
1840
  props: {
1822
1841
  messages: { type: Array, default: () => [] },
1823
1842
  streamingActive: { type: Boolean, default: !1 },
@@ -1851,7 +1870,7 @@ const ss = {
1851
1870
  const s = this.roleOf(r);
1852
1871
  if (s === "system") {
1853
1872
  t.push({
1854
- key: `sys-${oe(r)}`,
1873
+ key: `sys-${ce(r)}`,
1855
1874
  role: s,
1856
1875
  messages: [r],
1857
1876
  systemLabel: this.systemLabel(r)
@@ -1860,7 +1879,7 @@ const ss = {
1860
1879
  }
1861
1880
  const o = t[t.length - 1];
1862
1881
  o && o.role === s && (s === "ai" || o.agentName === (((e = r == null ? void 0 : r.author) == null ? void 0 : e.name) || "")) ? o.messages.push(r) : t.push({
1863
- key: `g-${oe(r)}`,
1882
+ key: `g-${ce(r)}`,
1864
1883
  role: s,
1865
1884
  agentName: ((n = r == null ? void 0 : r.author) == null ? void 0 : n.name) || "",
1866
1885
  agentAvatarUrl: ((a = r == null ? void 0 : r.author) == null ? void 0 : a.avatar_url) || null,
@@ -1883,13 +1902,13 @@ const ss = {
1883
1902
  this._lastSeenConvId = this.conversationId, this.scrollToBottom();
1884
1903
  },
1885
1904
  methods: {
1886
- messageKey: oe,
1905
+ messageKey: ce,
1887
1906
  isAtBottom(t) {
1888
- return t.scrollHeight - t.scrollTop - t.clientHeight <= rs;
1907
+ return t.scrollHeight - t.scrollTop - t.clientHeight <= os;
1889
1908
  },
1890
1909
  onScroll() {
1891
1910
  const t = this.$refs.scrollEl;
1892
- t && (this.loadingMore || !this.hasMore || this._pendingLoadMore || t.scrollTop <= is && (this._pendingLoadMore = !0, this.$emit("load-more")));
1911
+ t && (this.loadingMore || !this.hasMore || this._pendingLoadMore || t.scrollTop <= ls && (this._pendingLoadMore = !0, this.$emit("load-more")));
1893
1912
  },
1894
1913
  // Capture pre-patch scroll state and restore it on the next tick.
1895
1914
  //
@@ -1937,11 +1956,11 @@ const ss = {
1937
1956
  }
1938
1957
  if (!r.anchor) return;
1939
1958
  const s = () => {
1940
- var k;
1959
+ var C;
1941
1960
  const o = r.anchor;
1942
- if (!((k = o.el) != null && k.isConnected)) return;
1943
- const p = o.el.getBoundingClientRect().top - t.getBoundingClientRect().top - o.relY;
1944
- Math.abs(p) > 0.5 && (t.scrollTop += p);
1961
+ if (!((C = o.el) != null && C.isConnected)) return;
1962
+ const v = o.el.getBoundingClientRect().top - t.getBoundingClientRect().top - o.relY;
1963
+ Math.abs(v) > 0.5 && (t.scrollTop += v);
1945
1964
  };
1946
1965
  s(), requestAnimationFrame(() => {
1947
1966
  s(), requestAnimationFrame(s);
@@ -2000,9 +2019,9 @@ const ss = {
2000
2019
  // Standalone bubbles (no neighbours) keep the tail design: a
2001
2020
  // small TL for ai/human, small BR for user.
2002
2021
  cornersFor(t, e) {
2003
- const n = t.messages, a = this.itemKindOf(n[e]), r = this.itemKindOf(n[e - 1]), s = this.itemKindOf(n[e + 1]), o = t.role === "user", c = 14, p = 4, k = (N, I) => N === "card" && I === "bubble";
2004
- let g = c, T = c, R = c, x = c;
2005
- return o ? (r && (T = p, k(r, a) && (g = p)), s && (R = p, k(s, a) && (x = p)), !r && !s && a === "bubble" && (R = p)) : (r && (g = p, k(r, a) && (T = p)), s && (x = p, k(s, a) && (R = p)), !r && !s && a === "bubble" && (g = p)), { tl: g, tr: T, br: R, bl: x };
2022
+ const n = t.messages, a = this.itemKindOf(n[e]), r = this.itemKindOf(n[e - 1]), s = this.itemKindOf(n[e + 1]), o = t.role === "user", d = 14, v = 4, C = (D, x) => D === "card" && x === "bubble";
2023
+ let w = d, S = d, L = d, A = d;
2024
+ return o ? (r && (S = v, C(r, a) && (w = v)), s && (L = v, C(s, a) && (A = v)), !r && !s && a === "bubble" && (L = v)) : (r && (w = v, C(r, a) && (S = v)), s && (A = v, C(s, a) && (L = v)), !r && !s && a === "bubble" && (w = v)), { tl: w, tr: S, br: L, bl: A };
2006
2025
  },
2007
2026
  // Inline style emitting the four corner CSS variables. Set on
2008
2027
  // `.wm-list__row` so they cascade to Bubble/ActionResult/
@@ -2025,7 +2044,7 @@ const ss = {
2025
2044
  const e = t.messages[t.messages.length - 1];
2026
2045
  if (!(e != null && e.created_at)) return "";
2027
2046
  try {
2028
- return ye(new Date(e.created_at));
2047
+ return be(new Date(e.created_at));
2029
2048
  } catch {
2030
2049
  return "";
2031
2050
  }
@@ -2049,9 +2068,9 @@ const ss = {
2049
2068
  return ((e = t == null ? void 0 : t.payload) == null ? void 0 : e.name) || (t == null ? void 0 : t.text_md) || "Action";
2050
2069
  },
2051
2070
  actionDetail(t) {
2052
- var n, a, r, s, o, c;
2071
+ var n, a, r, s, o, d;
2053
2072
  const e = t == null ? void 0 : t.payload;
2054
- 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) || ((c = e.failure) == null ? void 0 : c.error)) || "" : "";
2073
+ 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)) || "" : "";
2055
2074
  },
2056
2075
  actionArtifact(t) {
2057
2076
  var n, a;
@@ -2060,7 +2079,7 @@ const ss = {
2060
2079
  },
2061
2080
  systemLabel(t) {
2062
2081
  var r, s, o;
2063
- const e = (r = t == null ? void 0 : t.payload) == null ? void 0 : r.event, n = ss[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) || "";
2082
+ const e = (r = t == null ? void 0 : t.payload) == null ? void 0 : r.event, n = as[e] || (t == null ? void 0 : t.text_md) || "Mise à jour de la conversation", 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) || "";
2064
2083
  return n.replace("{name}", a || "Un agent");
2065
2084
  },
2066
2085
  scrollToBottom() {
@@ -2068,123 +2087,123 @@ const ss = {
2068
2087
  t && (t.scrollTop = t.scrollHeight);
2069
2088
  }
2070
2089
  }
2071
- }, os = {
2090
+ }, ds = {
2072
2091
  key: 0,
2073
2092
  class: "wm-list__loadMore",
2074
2093
  role: "status",
2075
2094
  "aria-live": "polite"
2076
- }, ls = {
2095
+ }, us = {
2077
2096
  key: 1,
2078
2097
  class: "wm-list__historyEnd"
2079
- }, ds = {
2098
+ }, hs = {
2080
2099
  key: 2,
2081
2100
  class: "wm-list__sep"
2082
- }, cs = { class: "wm-list__sep-label" }, us = {
2101
+ }, ms = { class: "wm-list__sep-label" }, fs = {
2083
2102
  key: 0,
2084
2103
  class: "wm-list__sysep"
2085
- }, hs = { class: "wm-list__sysep-label" }, ms = {
2104
+ }, _s = { class: "wm-list__sysep-label" }, ps = {
2086
2105
  key: 0,
2087
2106
  class: "wm-list__role"
2088
- }, fs = {
2107
+ }, vs = {
2089
2108
  key: 0,
2090
2109
  class: "wm-list__avatarSlot"
2091
- }, _s = {
2110
+ }, gs = {
2092
2111
  key: 3,
2093
2112
  class: "wm-list__body"
2094
- }, ps = {
2113
+ }, ys = {
2095
2114
  key: 3,
2096
2115
  class: "wm-list__row wm-list__row--ai fade-up"
2097
- }, vs = { class: "wm-list__avatarSlot" };
2098
- function gs(t, e, n, a, r, s) {
2099
- const o = O("AIAvatar"), c = O("HumanAvatar"), p = O("ActionResult"), k = O("ArtifactRenderer"), g = O("Bubble"), T = O("AttachmentPreview"), R = O("Typing");
2100
- return l(), d("div", {
2116
+ }, ws = { class: "wm-list__avatarSlot" };
2117
+ function bs(t, e, n, a, r, s) {
2118
+ const o = I("AIAvatar"), d = I("HumanAvatar"), v = I("ActionResult"), C = I("ArtifactRenderer"), w = I("Bubble"), S = I("AttachmentPreview"), L = I("Typing");
2119
+ return l(), c("div", {
2101
2120
  ref: "scrollEl",
2102
- class: B(["wm-list", { "wm-list--silent": r.silentFades }]),
2103
- onScrollPassive: e[0] || (e[0] = (...x) => s.onScroll && s.onScroll(...x))
2121
+ class: E(["wm-list", { "wm-list--silent": r.silentFades }]),
2122
+ onScrollPassive: e[0] || (e[0] = (...A) => s.onScroll && s.onScroll(...A))
2104
2123
  }, [
2105
- n.loadingMore ? (l(), d("div", os, [...e[1] || (e[1] = [
2124
+ n.loadingMore ? (l(), c("div", ds, [...e[1] || (e[1] = [
2106
2125
  i("span", {
2107
2126
  class: "wm-list__loadMore-spinner",
2108
2127
  "aria-hidden": "true"
2109
2128
  }, null, -1),
2110
2129
  i("span", { class: "wm-list__loadMore-lbl" }, "Chargement de l'historique…", -1)
2111
- ])])) : s.historyExhausted ? (l(), d("div", ls, "Début de la conversation")) : v("", !0),
2112
- n.dateLabel ? (l(), d("div", ds, [
2130
+ ])])) : s.historyExhausted ? (l(), c("div", us, "Début de la conversation")) : y("", !0),
2131
+ n.dateLabel ? (l(), c("div", hs, [
2113
2132
  e[2] || (e[2] = i("div", { class: "wm-list__line" }, null, -1)),
2114
- i("span", cs, y(n.dateLabel), 1),
2133
+ i("span", ms, b(n.dateLabel), 1),
2115
2134
  e[3] || (e[3] = i("div", { class: "wm-list__line" }, null, -1))
2116
- ])) : v("", !0),
2117
- (l(!0), d(E, null, F(s.groups, (x, N) => (l(), d("div", {
2118
- key: x.key,
2119
- class: B(["wm-list__group", "wm-list__group--" + x.role])
2135
+ ])) : y("", !0),
2136
+ (l(!0), c(O, null, F(s.groups, (A, D) => (l(), c("div", {
2137
+ key: A.key,
2138
+ class: E(["wm-list__group", "wm-list__group--" + A.role])
2120
2139
  }, [
2121
- x.role === "system" ? (l(), d("div", us, [
2140
+ A.role === "system" ? (l(), c("div", fs, [
2122
2141
  e[4] || (e[4] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1)),
2123
- i("span", hs, y(x.systemLabel), 1),
2142
+ i("span", _s, b(A.systemLabel), 1),
2124
2143
  e[5] || (e[5] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
2125
- ])) : (l(), d(E, { key: 1 }, [
2126
- x.role !== "user" ? (l(), d("div", ms, y(s.roleLabel(x)), 1)) : v("", !0),
2127
- (l(!0), d(E, null, F(x.messages, (I, P) => (l(), d("div", {
2128
- key: s.messageKey(I),
2129
- class: B(["wm-list__row fade-up", ["wm-list__row--" + x.role, { "is-pending": I._pending, "is-failed": I._failed }]]),
2130
- style: H(s.cornersStyle(x, P))
2144
+ ])) : (l(), c(O, { key: 1 }, [
2145
+ A.role !== "user" ? (l(), c("div", ps, b(s.roleLabel(A)), 1)) : y("", !0),
2146
+ (l(!0), c(O, null, F(A.messages, (x, N) => (l(), c("div", {
2147
+ key: s.messageKey(x),
2148
+ class: E(["wm-list__row fade-up", ["wm-list__row--" + A.role, { "is-pending": x._pending, "is-failed": x._failed }]]),
2149
+ style: P(s.cornersStyle(A, N))
2131
2150
  }, [
2132
- x.role !== "user" ? (l(), d("div", fs, [
2133
- P === x.messages.length - 1 ? (l(), d(E, { key: 0 }, [
2134
- x.role === "ai" ? (l(), $(o, {
2151
+ A.role !== "user" ? (l(), c("div", vs, [
2152
+ N === A.messages.length - 1 ? (l(), c(O, { key: 0 }, [
2153
+ A.role === "ai" ? (l(), $(o, {
2135
2154
  key: 0,
2136
2155
  size: 26
2137
- })) : (l(), $(c, {
2156
+ })) : (l(), $(d, {
2138
2157
  key: 1,
2139
- name: x.agentName,
2140
- "avatar-url": x.agentAvatarUrl,
2158
+ name: A.agentName,
2159
+ "avatar-url": A.agentAvatarUrl,
2141
2160
  size: 26
2142
2161
  }, null, 8, ["name", "avatar-url"]))
2143
- ], 64)) : v("", !0)
2144
- ])) : v("", !0),
2145
- I.type === "action" && I.payload && I.payload.state !== "pending" ? (l(), $(p, {
2162
+ ], 64)) : y("", !0)
2163
+ ])) : y("", !0),
2164
+ x.type === "action" && x.payload && x.payload.state !== "pending" ? (l(), $(v, {
2146
2165
  key: 1,
2147
- state: I.payload.state,
2148
- label: s.actionLabel(I),
2149
- detail: s.actionDetail(I),
2150
- artifact: s.actionArtifact(I)
2151
- }, null, 8, ["state", "label", "detail", "artifact"])) : s.artifactOf(I) ? (l(), $(k, {
2166
+ state: x.payload.state,
2167
+ label: s.actionLabel(x),
2168
+ detail: s.actionDetail(x),
2169
+ artifact: s.actionArtifact(x)
2170
+ }, null, 8, ["state", "label", "detail", "artifact"])) : s.artifactOf(x) ? (l(), $(C, {
2152
2171
  key: 2,
2153
- artifact: s.artifactOf(I)
2154
- }, null, 8, ["artifact"])) : (l(), d("div", _s, [
2155
- I.text_md ? (l(), $(g, {
2172
+ artifact: s.artifactOf(x)
2173
+ }, null, 8, ["artifact"])) : (l(), c("div", gs, [
2174
+ x.text_md ? (l(), $(w, {
2156
2175
  key: 0,
2157
- role: x.role,
2158
- text: I.text_md
2159
- }, null, 8, ["role", "text"])) : v("", !0),
2160
- s.attachmentsOf(I).length ? (l(), d("div", {
2176
+ role: A.role,
2177
+ text: x.text_md
2178
+ }, null, 8, ["role", "text"])) : y("", !0),
2179
+ s.attachmentsOf(x).length ? (l(), c("div", {
2161
2180
  key: 1,
2162
- class: B(["wm-list__atts", { "wm-list__atts--align-end": x.role === "user" }])
2181
+ class: E(["wm-list__atts", { "wm-list__atts--align-end": A.role === "user" }])
2163
2182
  }, [
2164
- (l(!0), d(E, null, F(s.attachmentsOf(I), (U, V) => (l(), $(T, {
2165
- key: `${s.messageKey(I)}-att-${V}`,
2166
- attachment: U
2183
+ (l(!0), c(O, null, F(s.attachmentsOf(x), (j, z) => (l(), $(S, {
2184
+ key: `${s.messageKey(x)}-att-${z}`,
2185
+ attachment: j
2167
2186
  }, null, 8, ["attachment"]))), 128))
2168
- ], 2)) : v("", !0)
2187
+ ], 2)) : y("", !0)
2169
2188
  ]))
2170
2189
  ], 6))), 128)),
2171
- s.lastTimeOf(x) ? (l(), d("div", {
2190
+ s.lastTimeOf(A) ? (l(), c("div", {
2172
2191
  key: 1,
2173
- class: B(["wm-list__time", { "wm-list__time--right": x.role === "user" }])
2174
- }, y(s.lastTimeOf(x)), 3)) : v("", !0)
2192
+ class: E(["wm-list__time", { "wm-list__time--right": A.role === "user" }])
2193
+ }, b(s.lastTimeOf(A)), 3)) : y("", !0)
2175
2194
  ], 64))
2176
2195
  ], 2))), 128)),
2177
- n.streamingActive ? (l(), d("div", ps, [
2178
- i("div", vs, [
2179
- z(o, { size: 26 })
2196
+ n.streamingActive ? (l(), c("div", ys, [
2197
+ i("div", ws, [
2198
+ H(o, { size: 26 })
2180
2199
  ]),
2181
- z(R)
2182
- ])) : v("", !0)
2200
+ H(L)
2201
+ ])) : y("", !0)
2183
2202
  ], 34);
2184
2203
  }
2185
- const ys = /* @__PURE__ */ L(as, [["render", gs], ["__scopeId", "data-v-f23f2f8c"]]), te = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", ce = typeof window < "u" && typeof window.MediaRecorder < "u";
2186
- function ws() {
2187
- return ce && [
2204
+ const ks = /* @__PURE__ */ B(cs, [["render", bs], ["__scopeId", "data-v-f23f2f8c"]]), te = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", he = typeof window < "u" && typeof window.MediaRecorder < "u";
2205
+ function Cs() {
2206
+ return he && [
2188
2207
  "video/webm;codecs=vp9,opus",
2189
2208
  "video/webm;codecs=vp8,opus",
2190
2209
  "video/webm",
@@ -2194,7 +2213,7 @@ function ws() {
2194
2213
  return (a = (n = window.MediaRecorder).isTypeSupported) == null ? void 0 : a.call(n, e);
2195
2214
  }) || "";
2196
2215
  }
2197
- function Ce({ audio: t }) {
2216
+ function Se({ audio: t }) {
2198
2217
  return {
2199
2218
  video: !0,
2200
2219
  audio: !!t,
@@ -2203,19 +2222,19 @@ function Ce({ audio: t }) {
2203
2222
  systemAudio: t ? "include" : "exclude"
2204
2223
  };
2205
2224
  }
2206
- function Bi(t) {
2225
+ function $i(t) {
2207
2226
  return t ? t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : "file" : "file";
2208
2227
  }
2209
- async function bs() {
2228
+ async function As() {
2210
2229
  if (!te) return null;
2211
2230
  let t;
2212
2231
  try {
2213
- t = await navigator.mediaDevices.getDisplayMedia(Ce({ audio: !1 }));
2232
+ t = await navigator.mediaDevices.getDisplayMedia(Se({ audio: !1 }));
2214
2233
  } catch (e) {
2215
2234
  return (e == null ? void 0 : e.name) !== "NotAllowedError" && console.error("[media] screenshot picker", e), null;
2216
2235
  }
2217
2236
  try {
2218
- return await ks(t);
2237
+ return await Ss(t);
2219
2238
  } catch (e) {
2220
2239
  return console.error("[media] screenshot capture", e), null;
2221
2240
  } finally {
@@ -2224,78 +2243,78 @@ async function bs() {
2224
2243
  });
2225
2244
  }
2226
2245
  }
2227
- async function ks(t) {
2246
+ async function Ss(t) {
2228
2247
  const e = document.createElement("video");
2229
- e.muted = !0, e.playsInline = !0, e.srcObject = t, await e.play(), await new Promise((c) => requestAnimationFrame(c));
2248
+ e.muted = !0, e.playsInline = !0, e.srcObject = t, await e.play(), await new Promise((d) => requestAnimationFrame(d));
2230
2249
  const n = e.videoWidth || 1280, a = e.videoHeight || 720, r = document.createElement("canvas");
2231
2250
  r.width = n, r.height = a, r.getContext("2d").drawImage(e, 0, 0, n, a);
2232
- const s = await new Promise((c, p) => {
2233
- r.toBlob((k) => k ? c(k) : p(new Error("toBlob failed")), "image/png");
2251
+ const s = await new Promise((d, v) => {
2252
+ r.toBlob((C) => C ? d(C) : v(new Error("toBlob failed")), "image/png");
2234
2253
  }), o = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
2235
2254
  return new File([s], `capture-${o}.png`, { type: "image/png" });
2236
2255
  }
2237
- async function Cs(t = {}) {
2238
- var k;
2239
- if (!te || !ce) return null;
2256
+ async function xs(t = {}) {
2257
+ var C;
2258
+ if (!te || !he) return null;
2240
2259
  let e;
2241
2260
  try {
2242
- e = await navigator.mediaDevices.getDisplayMedia(Ce({ audio: !0 }));
2243
- } catch (g) {
2244
- return (g == null ? void 0 : g.name) !== "NotAllowedError" && console.error("[media] record picker", g), null;
2261
+ e = await navigator.mediaDevices.getDisplayMedia(Se({ audio: !0 }));
2262
+ } catch (w) {
2263
+ return (w == null ? void 0 : w.name) !== "NotAllowedError" && console.error("[media] record picker", w), null;
2245
2264
  }
2246
- const n = ws();
2265
+ const n = Cs();
2247
2266
  let a;
2248
2267
  try {
2249
2268
  a = n ? new window.MediaRecorder(e, { mimeType: n }) : new window.MediaRecorder(e);
2250
- } catch (g) {
2251
- return console.error("[media] recorder init", g), e.getTracks().forEach((T) => {
2252
- T.stop();
2269
+ } catch (w) {
2270
+ return console.error("[media] recorder init", w), e.getTracks().forEach((S) => {
2271
+ S.stop();
2253
2272
  }), null;
2254
2273
  }
2255
2274
  const r = [];
2256
2275
  let s = null, o = !1;
2257
- a.addEventListener("dataavailable", (g) => {
2258
- g.data && g.data.size > 0 && r.push(g.data);
2276
+ a.addEventListener("dataavailable", (w) => {
2277
+ w.data && w.data.size > 0 && r.push(w.data);
2259
2278
  }), a.addEventListener("stop", () => {
2260
- var g, T;
2261
- if (s && clearInterval(s), e.getTracks().forEach((R) => {
2262
- R.stop();
2279
+ var w, S;
2280
+ if (s && clearInterval(s), e.getTracks().forEach((L) => {
2281
+ L.stop();
2263
2282
  }), r.length) {
2264
- const R = a.mimeType || n || "video/webm", x = new Blob(r, { type: R }), N = /mp4/.test(R) ? "mp4" : "webm", I = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), P = new File([x], `ecran-${I}.${N}`, { type: R });
2265
- (g = t.onfinalize) == null || g.call(t, P);
2283
+ const L = a.mimeType || n || "video/webm", A = new Blob(r, { type: L }), D = /mp4/.test(L) ? "mp4" : "webm", x = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), N = new File([A], `ecran-${x}.${D}`, { type: L });
2284
+ (w = t.onfinalize) == null || w.call(t, N);
2266
2285
  } else
2267
- (T = t.oncancel) == null || T.call(t);
2268
- }), e.getVideoTracks().forEach((g) => {
2269
- g.addEventListener("ended", () => c(), { once: !0 });
2286
+ (S = t.oncancel) == null || S.call(t);
2287
+ }), e.getVideoTracks().forEach((w) => {
2288
+ w.addEventListener("ended", () => d(), { once: !0 });
2270
2289
  });
2271
- function c() {
2290
+ function d() {
2272
2291
  if (!o && (o = !0, a.state !== "inactive"))
2273
2292
  try {
2274
2293
  a.stop();
2275
- } catch (g) {
2276
- console.error("[media] recorder stop", g);
2294
+ } catch (w) {
2295
+ console.error("[media] recorder stop", w);
2277
2296
  }
2278
2297
  }
2279
2298
  try {
2280
2299
  a.start(1e3);
2281
- } catch (g) {
2282
- return console.error("[media] recorder start", g), e.getTracks().forEach((T) => {
2283
- T.stop();
2300
+ } catch (w) {
2301
+ return console.error("[media] recorder start", w), e.getTracks().forEach((S) => {
2302
+ S.stop();
2284
2303
  }), null;
2285
2304
  }
2286
- (k = t.onstart) == null || k.call(t);
2287
- const p = Date.now();
2305
+ (C = t.onstart) == null || C.call(t);
2306
+ const v = Date.now();
2288
2307
  return s = setInterval(() => {
2289
- var g;
2290
- (g = t.ontick) == null || g.call(t, Date.now() - p);
2308
+ var w;
2309
+ (w = t.ontick) == null || w.call(t, Date.now() - v);
2291
2310
  }, 500), {
2292
- stop: c,
2311
+ stop: d,
2293
2312
  get state() {
2294
2313
  return a.state;
2295
2314
  }
2296
2315
  };
2297
2316
  }
2298
- const As = [
2317
+ const Ms = [
2299
2318
  {
2300
2319
  action: "file",
2301
2320
  label: "Joindre un fichier",
@@ -2311,7 +2330,7 @@ const As = [
2311
2330
  label: "Enregistrer l'écran",
2312
2331
  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"
2313
2332
  }
2314
- ], Ss = {
2333
+ ], Ts = {
2315
2334
  name: "WmComposer",
2316
2335
  props: {
2317
2336
  modelValue: { type: String, default: "" },
@@ -2334,9 +2353,9 @@ const As = [
2334
2353
  return !this.disabled && !!this.local.trim();
2335
2354
  },
2336
2355
  attachItems() {
2337
- return As.map((t) => ({
2356
+ return Ms.map((t) => ({
2338
2357
  ...t,
2339
- disabled: t.action === "screenshot" && !te || t.action === "record" && (!te || !ce)
2358
+ disabled: t.action === "screenshot" && !te || t.action === "record" && (!te || !he)
2340
2359
  }));
2341
2360
  },
2342
2361
  recordingElapsedLabel() {
@@ -2406,13 +2425,13 @@ const As = [
2406
2425
  },
2407
2426
  async captureScreenshot() {
2408
2427
  if (this.disabled) return;
2409
- const t = await bs();
2428
+ const t = await As();
2410
2429
  t && this.$emit("attach", t);
2411
2430
  },
2412
2431
  async startRecording() {
2413
2432
  if (this.recording || this.disabled) return;
2414
2433
  this.recordingElapsed = 0;
2415
- const t = await Cs({
2434
+ const t = await xs({
2416
2435
  onstart: () => {
2417
2436
  this.recording = !0;
2418
2437
  },
@@ -2437,36 +2456,36 @@ const As = [
2437
2456
  }
2438
2457
  }
2439
2458
  }
2440
- }, xs = { class: "wm-compose-wrap" }, Ms = {
2459
+ }, Is = { class: "wm-compose-wrap" }, Os = {
2441
2460
  key: 0,
2442
2461
  class: "wm-rec"
2443
- }, Ts = { class: "wm-rec__lbl" }, Is = {
2462
+ }, Es = { class: "wm-rec__lbl" }, Bs = {
2444
2463
  key: 1,
2445
2464
  class: "wm-compose__menu",
2446
2465
  role: "menu"
2447
- }, Os = ["disabled", "onClick"], Es = { class: "wm-compose__menuIcon" }, Bs = {
2466
+ }, Ls = ["disabled", "onClick"], Rs = { class: "wm-compose__menuIcon" }, $s = {
2448
2467
  viewBox: "0 0 24 24",
2449
2468
  width: "14",
2450
2469
  height: "14",
2451
2470
  "aria-hidden": "true"
2452
- }, Ls = ["d"], Rs = ["placeholder", "disabled"], $s = { class: "wm-compose__actions" }, Fs = ["title", "aria-label", "disabled"], Us = ["disabled"];
2453
- function Ds(t, e, n, a, r, s) {
2454
- return l(), d("div", xs, [
2455
- r.recording ? (l(), d("div", Ms, [
2471
+ }, Fs = ["d"], js = ["placeholder", "disabled"], Us = { class: "wm-compose__actions" }, Ds = ["title", "aria-label", "disabled"], Ns = ["disabled"];
2472
+ function Ps(t, e, n, a, r, s) {
2473
+ return l(), c("div", Is, [
2474
+ r.recording ? (l(), c("div", Os, [
2456
2475
  e[8] || (e[8] = i("span", {
2457
2476
  class: "wm-rec__dot",
2458
2477
  "aria-hidden": "true"
2459
2478
  }, null, -1)),
2460
- i("span", Ts, "Enregistrement · " + y(s.recordingElapsedLabel), 1),
2479
+ i("span", Es, "Enregistrement · " + b(s.recordingElapsedLabel), 1),
2461
2480
  i("button", {
2462
2481
  type: "button",
2463
2482
  class: "wm-rec__stop",
2464
2483
  onClick: e[0] || (e[0] = (...o) => s.stopRecording && s.stopRecording(...o))
2465
2484
  }, "Arrêter")
2466
- ])) : v("", !0),
2485
+ ])) : y("", !0),
2467
2486
  i("form", {
2468
- class: B(["wm-compose", { "has-attach": r.attachOpen }]),
2469
- onSubmit: e[7] || (e[7] = J((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]))
2487
+ class: E(["wm-compose", { "has-attach": r.attachOpen }]),
2488
+ onSubmit: e[7] || (e[7] = Y((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]))
2470
2489
  }, [
2471
2490
  i("input", {
2472
2491
  ref: "fileEl",
@@ -2475,21 +2494,21 @@ function Ds(t, e, n, a, r, s) {
2475
2494
  multiple: "",
2476
2495
  onChange: e[1] || (e[1] = (...o) => s.onFile && s.onFile(...o))
2477
2496
  }, null, 544),
2478
- r.attachOpen ? (l(), d("div", {
2497
+ r.attachOpen ? (l(), c("div", {
2479
2498
  key: 0,
2480
2499
  class: "wm-compose__overlay",
2481
2500
  onClick: e[2] || (e[2] = (o) => r.attachOpen = !1)
2482
- })) : v("", !0),
2483
- r.attachOpen ? (l(), d("div", Is, [
2484
- (l(!0), d(E, null, F(s.attachItems, (o) => (l(), d("button", {
2501
+ })) : y("", !0),
2502
+ r.attachOpen ? (l(), c("div", Bs, [
2503
+ (l(!0), c(O, null, F(s.attachItems, (o) => (l(), c("button", {
2485
2504
  key: o.action,
2486
2505
  type: "button",
2487
2506
  class: "wm-compose__menuItem",
2488
2507
  disabled: o.disabled,
2489
- onClick: (c) => s.onAttachAction(o.action)
2508
+ onClick: (d) => s.onAttachAction(o.action)
2490
2509
  }, [
2491
- i("span", Es, [
2492
- (l(), d("svg", Bs, [
2510
+ i("span", Rs, [
2511
+ (l(), c("svg", $s, [
2493
2512
  i("path", {
2494
2513
  d: o.path,
2495
2514
  stroke: "currentColor",
@@ -2497,13 +2516,13 @@ function Ds(t, e, n, a, r, s) {
2497
2516
  "stroke-linecap": "round",
2498
2517
  "stroke-linejoin": "round",
2499
2518
  fill: "none"
2500
- }, null, 8, Ls)
2519
+ }, null, 8, Fs)
2501
2520
  ]))
2502
2521
  ]),
2503
- i("span", null, y(o.label), 1)
2504
- ], 8, Os))), 128))
2505
- ])) : v("", !0),
2506
- q(i("textarea", {
2522
+ i("span", null, b(o.label), 1)
2523
+ ], 8, Ls))), 128))
2524
+ ])) : y("", !0),
2525
+ V(i("textarea", {
2507
2526
  ref: "inputEl",
2508
2527
  "onUpdate:modelValue": e[3] || (e[3] = (o) => r.local = o),
2509
2528
  class: "wm-compose__input",
@@ -2512,13 +2531,13 @@ function Ds(t, e, n, a, r, s) {
2512
2531
  disabled: n.disabled,
2513
2532
  onKeydown: e[4] || (e[4] = (...o) => s.onKeydown && s.onKeydown(...o)),
2514
2533
  onInput: e[5] || (e[5] = (...o) => s.autosize && s.autosize(...o))
2515
- }, null, 40, Rs), [
2534
+ }, null, 40, js), [
2516
2535
  [G, r.local]
2517
2536
  ]),
2518
- i("div", $s, [
2537
+ i("div", Us, [
2519
2538
  i("button", {
2520
2539
  type: "button",
2521
- class: B(["wm-compose__icon", { "is-open": r.attachOpen }]),
2540
+ class: E(["wm-compose__icon", { "is-open": r.attachOpen }]),
2522
2541
  title: n.attachLabel,
2523
2542
  "aria-label": n.attachLabel,
2524
2543
  disabled: r.recording,
@@ -2537,10 +2556,10 @@ function Ds(t, e, n, a, r, s) {
2537
2556
  }, [
2538
2557
  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" })
2539
2558
  ], -1)
2540
- ])], 10, Fs),
2559
+ ])], 10, Ds),
2541
2560
  i("button", {
2542
2561
  type: "submit",
2543
- class: B(["wm-compose__send", { "is-empty": !s.canSend }]),
2562
+ class: E(["wm-compose__send", { "is-empty": !s.canSend }]),
2544
2563
  disabled: !s.canSend,
2545
2564
  "aria-label": "Envoyer"
2546
2565
  }, [...e[10] || (e[10] = [
@@ -2557,12 +2576,12 @@ function Ds(t, e, n, a, r, s) {
2557
2576
  }, [
2558
2577
  i("path", { d: "M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" })
2559
2578
  ], -1)
2560
- ])], 10, Us)
2579
+ ])], 10, Ns)
2561
2580
  ])
2562
2581
  ], 34)
2563
2582
  ]);
2564
2583
  }
2565
- const js = /* @__PURE__ */ L(Ss, [["render", Ds], ["__scopeId", "data-v-14fa9ec0"]]), Ns = {
2584
+ const Hs = /* @__PURE__ */ B(Ts, [["render", Ps], ["__scopeId", "data-v-14fa9ec0"]]), zs = {
2566
2585
  name: "WmSuggestionChips",
2567
2586
  props: {
2568
2587
  items: { type: Array, default: () => [] },
@@ -2579,24 +2598,24 @@ const js = /* @__PURE__ */ L(Ss, [["render", Ds], ["__scopeId", "data-v-14fa9ec0
2579
2598
  return this.items.map((t) => (t == null ? void 0 : t.label) || (t == null ? void 0 : t.text) || "").join("§");
2580
2599
  }
2581
2600
  }
2582
- }, Ps = ["onClick"];
2583
- function Hs(t, e, n, a, r, s) {
2584
- return n.items.length ? (l(), d("div", {
2601
+ }, Vs = ["onClick"];
2602
+ function qs(t, e, n, a, r, s) {
2603
+ return n.items.length ? (l(), c("div", {
2585
2604
  key: s.batchKey,
2586
2605
  class: "wm-chips"
2587
2606
  }, [
2588
- (l(!0), d(E, null, F(n.items, (o, c) => (l(), d("button", {
2589
- key: c,
2607
+ (l(!0), c(O, null, F(n.items, (o, d) => (l(), c("button", {
2608
+ key: d,
2590
2609
  type: "button",
2591
2610
  class: "wm-chip",
2592
- style: H({ animationDelay: n.baseDelay + c * n.stepDelay + "ms" }),
2593
- onClick: (p) => t.$emit("select", o)
2594
- }, y(o.label), 13, Ps))), 128))
2595
- ])) : v("", !0);
2611
+ style: P({ animationDelay: n.baseDelay + d * n.stepDelay + "ms" }),
2612
+ onClick: (v) => t.$emit("select", o)
2613
+ }, b(o.label), 13, Vs))), 128))
2614
+ ])) : y("", !0);
2596
2615
  }
2597
- const zs = /* @__PURE__ */ L(Ns, [["render", Hs], ["__scopeId", "data-v-55aa529d"]]), Vs = {
2616
+ const Ws = /* @__PURE__ */ B(zs, [["render", qs], ["__scopeId", "data-v-55aa529d"]]), Gs = {
2598
2617
  name: "WmApprovalCard",
2599
- components: { AIAvatar: X },
2618
+ components: { AIAvatar: J },
2600
2619
  props: {
2601
2620
  action: { type: String, required: !0 },
2602
2621
  detail: { type: String, default: "" },
@@ -2627,41 +2646,41 @@ const zs = /* @__PURE__ */ L(Ns, [["render", Hs], ["__scopeId", "data-v-55aa529d
2627
2646
  return ((t = this.rejectCallback) == null ? void 0 : t.label) || "Refuser";
2628
2647
  }
2629
2648
  }
2630
- }, qs = { class: "wm-approval" }, Ws = { class: "wm-approval__head" }, Gs = { class: "wm-approval__icon" }, Ks = { class: "wm-approval__main" }, Ys = { class: "wm-approval__title" }, Js = {
2649
+ }, Ks = { class: "wm-approval" }, Ys = { class: "wm-approval__head" }, Js = { class: "wm-approval__icon" }, Xs = { class: "wm-approval__main" }, Qs = { class: "wm-approval__title" }, Zs = {
2631
2650
  key: 0,
2632
2651
  class: "wm-approval__detail"
2633
- }, Xs = { class: "wm-approval__actions" };
2634
- function Qs(t, e, n, a, r, s) {
2635
- const o = O("AIAvatar");
2636
- return l(), d("div", qs, [
2637
- i("div", Ws, [
2638
- i("div", Gs, [
2639
- z(o, { size: 24 })
2652
+ }, er = { class: "wm-approval__actions" };
2653
+ function tr(t, e, n, a, r, s) {
2654
+ const o = I("AIAvatar");
2655
+ return l(), c("div", Ks, [
2656
+ i("div", Ys, [
2657
+ i("div", Js, [
2658
+ H(o, { size: 24 })
2640
2659
  ]),
2641
- i("div", Ks, [
2642
- i("div", Ys, y(n.action), 1),
2643
- n.detail ? (l(), d("div", Js, y(n.detail), 1)) : v("", !0)
2660
+ i("div", Xs, [
2661
+ i("div", Qs, b(n.action), 1),
2662
+ n.detail ? (l(), c("div", Zs, b(n.detail), 1)) : y("", !0)
2644
2663
  ])
2645
2664
  ]),
2646
- i("div", Xs, [
2647
- s.rejectId ? (l(), d("button", {
2665
+ i("div", er, [
2666
+ s.rejectId ? (l(), c("button", {
2648
2667
  key: 0,
2649
2668
  type: "button",
2650
2669
  class: "wm-approval__btn wm-approval__btn--neutral",
2651
- onClick: e[0] || (e[0] = (c) => t.$emit("callback", s.rejectId))
2652
- }, y(s.rejectLabel), 1)) : v("", !0),
2653
- s.approveId ? (l(), d("button", {
2670
+ onClick: e[0] || (e[0] = (d) => t.$emit("callback", s.rejectId))
2671
+ }, b(s.rejectLabel), 1)) : y("", !0),
2672
+ s.approveId ? (l(), c("button", {
2654
2673
  key: 1,
2655
2674
  type: "button",
2656
2675
  class: "wm-approval__btn wm-approval__btn--primary",
2657
- onClick: e[1] || (e[1] = (c) => t.$emit("callback", s.approveId))
2658
- }, y(s.approveLabel), 1)) : v("", !0)
2676
+ onClick: e[1] || (e[1] = (d) => t.$emit("callback", s.approveId))
2677
+ }, b(s.approveLabel), 1)) : y("", !0)
2659
2678
  ])
2660
2679
  ]);
2661
2680
  }
2662
- const Zs = /* @__PURE__ */ L(Vs, [["render", Qs], ["__scopeId", "data-v-b1be139c"]]);
2663
- let _e = 0;
2664
- const er = /* @__PURE__ */ new Set([
2681
+ const nr = /* @__PURE__ */ B(Gs, [["render", tr], ["__scopeId", "data-v-b1be139c"]]);
2682
+ let ve = 0;
2683
+ const sr = /* @__PURE__ */ new Set([
2665
2684
  "text",
2666
2685
  "textarea",
2667
2686
  "number",
@@ -2669,9 +2688,9 @@ const er = /* @__PURE__ */ new Set([
2669
2688
  "select",
2670
2689
  "multiselect",
2671
2690
  "date"
2672
- ]), tr = {
2691
+ ]), rr = {
2673
2692
  name: "WmFormCard",
2674
- components: { AIAvatar: X },
2693
+ components: { AIAvatar: J },
2675
2694
  props: {
2676
2695
  form: { type: Object, required: !0 },
2677
2696
  readOnly: { type: Boolean, default: !1 },
@@ -2679,8 +2698,8 @@ const er = /* @__PURE__ */ new Set([
2679
2698
  },
2680
2699
  emits: ["submit"],
2681
2700
  data() {
2682
- return _e += 1, {
2683
- _uid: _e,
2701
+ return ve += 1, {
2702
+ _uid: ve,
2684
2703
  values: {},
2685
2704
  busy: !1,
2686
2705
  error: ""
@@ -2692,7 +2711,7 @@ const er = /* @__PURE__ */ new Set([
2692
2711
  // douteux.
2693
2712
  normalizedFields() {
2694
2713
  var e;
2695
- return (Array.isArray((e = this.form) == null ? void 0 : e.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !er.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
2714
+ return (Array.isArray((e = this.form) == null ? void 0 : e.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !sr.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
2696
2715
  }
2697
2716
  },
2698
2717
  created() {
@@ -2743,163 +2762,163 @@ const er = /* @__PURE__ */ new Set([
2743
2762
  }
2744
2763
  }
2745
2764
  }
2746
- }, nr = { class: "wm-form" }, sr = { class: "wm-form__head" }, rr = { class: "wm-form__icon" }, ir = { class: "wm-form__main" }, ar = { class: "wm-form__title" }, or = {
2765
+ }, ir = { class: "wm-form" }, ar = { class: "wm-form__head" }, or = { class: "wm-form__icon" }, lr = { class: "wm-form__main" }, cr = { class: "wm-form__title" }, dr = {
2747
2766
  key: 0,
2748
2767
  class: "wm-form__detail"
2749
- }, lr = ["for"], dr = {
2768
+ }, ur = ["for"], hr = {
2750
2769
  key: 0,
2751
2770
  class: "wm-form__req",
2752
2771
  "aria-hidden": "true"
2753
- }, cr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], ur = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], hr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], mr = ["id", "onUpdate:modelValue", "required", "disabled"], fr = {
2772
+ }, mr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], fr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], _r = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], pr = ["id", "onUpdate:modelValue", "required", "disabled"], vr = {
2754
2773
  key: 4,
2755
2774
  class: "wm-form__bool"
2756
- }, _r = ["id", "onUpdate:modelValue", "disabled"], pr = ["id", "onUpdate:modelValue", "required", "disabled"], vr = {
2775
+ }, gr = ["id", "onUpdate:modelValue", "disabled"], yr = ["id", "onUpdate:modelValue", "required", "disabled"], wr = {
2757
2776
  value: "",
2758
2777
  disabled: ""
2759
- }, gr = ["value"], yr = {
2778
+ }, br = ["value"], kr = {
2760
2779
  key: 6,
2761
2780
  class: "wm-form__multi"
2762
- }, wr = ["value", "checked", "disabled", "onChange"], br = {
2781
+ }, Cr = ["value", "checked", "disabled", "onChange"], Ar = {
2763
2782
  key: 0,
2764
2783
  class: "wm-form__err"
2765
- }, kr = ["disabled"], Cr = {
2784
+ }, Sr = ["disabled"], xr = {
2766
2785
  key: 0,
2767
2786
  class: "wm-form__spinner",
2768
2787
  "aria-hidden": "true"
2769
- }, Ar = {
2788
+ }, Mr = {
2770
2789
  key: 2,
2771
2790
  class: "wm-form__doneLbl"
2772
2791
  };
2773
- function Sr(t, e, n, a, r, s) {
2774
- const o = O("AIAvatar");
2775
- return l(), d("div", nr, [
2776
- i("div", sr, [
2777
- i("div", rr, [
2778
- z(o, { size: 24 })
2792
+ function Tr(t, e, n, a, r, s) {
2793
+ const o = I("AIAvatar");
2794
+ return l(), c("div", ir, [
2795
+ i("div", ar, [
2796
+ i("div", or, [
2797
+ H(o, { size: 24 })
2779
2798
  ]),
2780
- i("div", ir, [
2781
- i("div", ar, y(n.form.title || "Formulaire"), 1),
2782
- n.form.description ? (l(), d("div", or, y(n.form.description), 1)) : v("", !0)
2799
+ i("div", lr, [
2800
+ i("div", cr, b(n.form.title || "Formulaire"), 1),
2801
+ n.form.description ? (l(), c("div", dr, b(n.form.description), 1)) : y("", !0)
2783
2802
  ])
2784
2803
  ]),
2785
2804
  i("form", {
2786
2805
  class: "wm-form__body",
2787
- onSubmit: e[0] || (e[0] = J((...c) => s.onSubmit && s.onSubmit(...c), ["prevent"]))
2806
+ onSubmit: e[0] || (e[0] = Y((...d) => s.onSubmit && s.onSubmit(...d), ["prevent"]))
2788
2807
  }, [
2789
- (l(!0), d(E, null, F(s.normalizedFields, (c) => (l(), d("div", {
2790
- key: c.key,
2808
+ (l(!0), c(O, null, F(s.normalizedFields, (d) => (l(), c("div", {
2809
+ key: d.key,
2791
2810
  class: "wm-form__field"
2792
2811
  }, [
2793
2812
  i("label", {
2794
- for: `wm-f-${r._uid}-${c.key}`,
2813
+ for: `wm-f-${r._uid}-${d.key}`,
2795
2814
  class: "wm-form__label"
2796
2815
  }, [
2797
- se(y(c.label), 1),
2798
- c.required ? (l(), d("span", dr, "*")) : v("", !0)
2799
- ], 8, lr),
2800
- c.type === "text" ? q((l(), d("input", {
2816
+ se(b(d.label), 1),
2817
+ d.required ? (l(), c("span", hr, "*")) : y("", !0)
2818
+ ], 8, ur),
2819
+ d.type === "text" ? V((l(), c("input", {
2801
2820
  key: 0,
2802
- id: `wm-f-${r._uid}-${c.key}`,
2803
- "onUpdate:modelValue": (p) => r.values[c.key] = p,
2821
+ id: `wm-f-${r._uid}-${d.key}`,
2822
+ "onUpdate:modelValue": (v) => r.values[d.key] = v,
2804
2823
  type: "text",
2805
2824
  class: "wm-form__input",
2806
- placeholder: c.placeholder || "",
2807
- required: c.required,
2825
+ placeholder: d.placeholder || "",
2826
+ required: d.required,
2808
2827
  disabled: n.readOnly || r.busy
2809
- }, null, 8, cr)), [
2810
- [G, r.values[c.key]]
2811
- ]) : c.type === "textarea" ? q((l(), d("textarea", {
2828
+ }, null, 8, mr)), [
2829
+ [G, r.values[d.key]]
2830
+ ]) : d.type === "textarea" ? V((l(), c("textarea", {
2812
2831
  key: 1,
2813
- id: `wm-f-${r._uid}-${c.key}`,
2814
- "onUpdate:modelValue": (p) => r.values[c.key] = p,
2832
+ id: `wm-f-${r._uid}-${d.key}`,
2833
+ "onUpdate:modelValue": (v) => r.values[d.key] = v,
2815
2834
  class: "wm-form__textarea",
2816
2835
  rows: "3",
2817
- placeholder: c.placeholder || "",
2818
- required: c.required,
2836
+ placeholder: d.placeholder || "",
2837
+ required: d.required,
2819
2838
  disabled: n.readOnly || r.busy
2820
- }, null, 8, ur)), [
2821
- [G, r.values[c.key]]
2822
- ]) : c.type === "number" ? q((l(), d("input", {
2839
+ }, null, 8, fr)), [
2840
+ [G, r.values[d.key]]
2841
+ ]) : d.type === "number" ? V((l(), c("input", {
2823
2842
  key: 2,
2824
- id: `wm-f-${r._uid}-${c.key}`,
2825
- "onUpdate:modelValue": (p) => r.values[c.key] = p,
2843
+ id: `wm-f-${r._uid}-${d.key}`,
2844
+ "onUpdate:modelValue": (v) => r.values[d.key] = v,
2826
2845
  type: "number",
2827
2846
  class: "wm-form__input",
2828
- placeholder: c.placeholder || "",
2829
- required: c.required,
2847
+ placeholder: d.placeholder || "",
2848
+ required: d.required,
2830
2849
  disabled: n.readOnly || r.busy
2831
- }, null, 8, hr)), [
2850
+ }, null, 8, _r)), [
2832
2851
  [
2833
2852
  G,
2834
- r.values[c.key],
2853
+ r.values[d.key],
2835
2854
  void 0,
2836
2855
  { number: !0 }
2837
2856
  ]
2838
- ]) : c.type === "date" ? q((l(), d("input", {
2857
+ ]) : d.type === "date" ? V((l(), c("input", {
2839
2858
  key: 3,
2840
- id: `wm-f-${r._uid}-${c.key}`,
2841
- "onUpdate:modelValue": (p) => r.values[c.key] = p,
2859
+ id: `wm-f-${r._uid}-${d.key}`,
2860
+ "onUpdate:modelValue": (v) => r.values[d.key] = v,
2842
2861
  type: "date",
2843
2862
  class: "wm-form__input",
2844
- required: c.required,
2863
+ required: d.required,
2845
2864
  disabled: n.readOnly || r.busy
2846
- }, null, 8, mr)), [
2847
- [G, r.values[c.key]]
2848
- ]) : c.type === "boolean" ? (l(), d("label", fr, [
2849
- q(i("input", {
2850
- id: `wm-f-${r._uid}-${c.key}`,
2851
- "onUpdate:modelValue": (p) => r.values[c.key] = p,
2865
+ }, null, 8, pr)), [
2866
+ [G, r.values[d.key]]
2867
+ ]) : d.type === "boolean" ? (l(), c("label", vr, [
2868
+ V(i("input", {
2869
+ id: `wm-f-${r._uid}-${d.key}`,
2870
+ "onUpdate:modelValue": (v) => r.values[d.key] = v,
2852
2871
  type: "checkbox",
2853
2872
  disabled: n.readOnly || r.busy
2854
- }, null, 8, _r), [
2855
- [Ie, r.values[c.key]]
2873
+ }, null, 8, gr), [
2874
+ [Ee, r.values[d.key]]
2856
2875
  ]),
2857
- i("span", null, y(c.placeholder || "Oui"), 1)
2858
- ])) : c.type === "select" ? q((l(), d("select", {
2876
+ i("span", null, b(d.placeholder || "Oui"), 1)
2877
+ ])) : d.type === "select" ? V((l(), c("select", {
2859
2878
  key: 5,
2860
- id: `wm-f-${r._uid}-${c.key}`,
2861
- "onUpdate:modelValue": (p) => r.values[c.key] = p,
2879
+ id: `wm-f-${r._uid}-${d.key}`,
2880
+ "onUpdate:modelValue": (v) => r.values[d.key] = v,
2862
2881
  class: "wm-form__select",
2863
- required: c.required,
2882
+ required: d.required,
2864
2883
  disabled: n.readOnly || r.busy
2865
2884
  }, [
2866
- i("option", vr, y(c.placeholder || "Choisir…"), 1),
2867
- (l(!0), d(E, null, F(c.options, (p) => (l(), d("option", {
2868
- key: p.value,
2869
- value: p.value
2870
- }, y(p.label), 9, gr))), 128))
2871
- ], 8, pr)), [
2872
- [Oe, r.values[c.key]]
2873
- ]) : c.type === "multiselect" ? (l(), d("div", yr, [
2874
- (l(!0), d(E, null, F(c.options, (p) => (l(), d("label", {
2875
- key: p.value,
2885
+ i("option", wr, b(d.placeholder || "Choisir…"), 1),
2886
+ (l(!0), c(O, null, F(d.options, (v) => (l(), c("option", {
2887
+ key: v.value,
2888
+ value: v.value
2889
+ }, b(v.label), 9, br))), 128))
2890
+ ], 8, yr)), [
2891
+ [Be, r.values[d.key]]
2892
+ ]) : d.type === "multiselect" ? (l(), c("div", kr, [
2893
+ (l(!0), c(O, null, F(d.options, (v) => (l(), c("label", {
2894
+ key: v.value,
2876
2895
  class: "wm-form__multiItem"
2877
2896
  }, [
2878
2897
  i("input", {
2879
2898
  type: "checkbox",
2880
- value: p.value,
2881
- checked: Array.isArray(r.values[c.key]) && r.values[c.key].includes(p.value),
2899
+ value: v.value,
2900
+ checked: Array.isArray(r.values[d.key]) && r.values[d.key].includes(v.value),
2882
2901
  disabled: n.readOnly || r.busy,
2883
- onChange: (k) => s.toggleMulti(c.key, p.value, k.target.checked)
2884
- }, null, 40, wr),
2885
- i("span", null, y(p.label), 1)
2902
+ onChange: (C) => s.toggleMulti(d.key, v.value, C.target.checked)
2903
+ }, null, 40, Cr),
2904
+ i("span", null, b(v.label), 1)
2886
2905
  ]))), 128))
2887
- ])) : v("", !0)
2906
+ ])) : y("", !0)
2888
2907
  ]))), 128)),
2889
- r.error ? (l(), d("div", br, y(r.error), 1)) : v("", !0),
2890
- n.readOnly ? (l(), d("div", Ar, "Réponse envoyée")) : (l(), d("button", {
2908
+ r.error ? (l(), c("div", Ar, b(r.error), 1)) : y("", !0),
2909
+ n.readOnly ? (l(), c("div", Mr, "Réponse envoyée")) : (l(), c("button", {
2891
2910
  key: 1,
2892
2911
  type: "submit",
2893
2912
  class: "wm-form__submit",
2894
2913
  disabled: r.busy
2895
2914
  }, [
2896
- r.busy ? (l(), d("span", Cr)) : v("", !0),
2897
- i("span", null, y(r.busy ? "Envoi…" : n.form.submit_label || "Envoyer"), 1)
2898
- ], 8, kr))
2915
+ r.busy ? (l(), c("span", xr)) : y("", !0),
2916
+ i("span", null, b(r.busy ? "Envoi…" : n.form.submit_label || "Envoyer"), 1)
2917
+ ], 8, Sr))
2899
2918
  ], 32)
2900
2919
  ]);
2901
2920
  }
2902
- const xr = /* @__PURE__ */ L(tr, [["render", Sr], ["__scopeId", "data-v-64b40f76"]]), Mr = {
2921
+ const Ir = /* @__PURE__ */ B(rr, [["render", Tr], ["__scopeId", "data-v-64b40f76"]]), Or = {
2903
2922
  name: "WmFeedback",
2904
2923
  props: {
2905
2924
  busy: { type: Boolean, default: !1 },
@@ -2923,43 +2942,43 @@ const xr = /* @__PURE__ */ L(tr, [["render", Sr], ["__scopeId", "data-v-64b40f76
2923
2942
  !this.sel || this.busy || this.$emit("submit", { rating: this.sel });
2924
2943
  }
2925
2944
  }
2926
- }, Tr = { class: "wm-fb" }, Ir = { class: "wm-fb__row" }, Or = ["onClick"], Er = { class: "wm-fb__emoji" }, Br = { class: "wm-fb__label" }, Lr = ["disabled"], Rr = {
2945
+ }, Er = { class: "wm-fb" }, Br = { class: "wm-fb__row" }, Lr = ["onClick"], Rr = { class: "wm-fb__emoji" }, $r = { class: "wm-fb__label" }, Fr = ["disabled"], jr = {
2927
2946
  key: 1,
2928
2947
  class: "wm-fb__done"
2929
2948
  };
2930
- function $r(t, e, n, a, r, s) {
2931
- return l(), d("div", Tr, [
2932
- n.done ? (l(), d("div", Rr, [...e[3] || (e[3] = [
2933
- de('<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)
2934
- ])])) : (l(), d(E, { key: 0 }, [
2949
+ function Ur(t, e, n, a, r, s) {
2950
+ return l(), c("div", Er, [
2951
+ n.done ? (l(), c("div", jr, [...e[3] || (e[3] = [
2952
+ 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)
2953
+ ])])) : (l(), c(O, { key: 0 }, [
2935
2954
  e[1] || (e[1] = i("div", { class: "wm-fb__title" }, "Comment s'est passée cette conversation ?", -1)),
2936
2955
  e[2] || (e[2] = i("div", { class: "wm-fb__sub" }, "Votre avis nous aide à améliorer l'assistant.", -1)),
2937
- i("div", Ir, [
2938
- (l(!0), d(E, null, F(r.options, (o) => (l(), d("button", {
2956
+ i("div", Br, [
2957
+ (l(!0), c(O, null, F(r.options, (o) => (l(), c("button", {
2939
2958
  key: o.v,
2940
2959
  type: "button",
2941
- class: B(["wm-fb__opt", { "is-selected": r.sel === o.v }]),
2942
- onClick: (c) => r.sel = o.v
2960
+ class: E(["wm-fb__opt", { "is-selected": r.sel === o.v }]),
2961
+ onClick: (d) => r.sel = o.v
2943
2962
  }, [
2944
- i("span", Er, y(o.e), 1),
2945
- i("span", Br, y(o.l), 1)
2946
- ], 10, Or))), 128))
2963
+ i("span", Rr, b(o.e), 1),
2964
+ i("span", $r, b(o.l), 1)
2965
+ ], 10, Lr))), 128))
2947
2966
  ]),
2948
2967
  i("button", {
2949
2968
  type: "button",
2950
2969
  class: "wm-fb__send",
2951
2970
  disabled: !r.sel || n.busy,
2952
2971
  onClick: e[0] || (e[0] = (...o) => s.onSend && s.onSend(...o))
2953
- }, y(n.busy ? "Envoi…" : "Envoyer mon avis"), 9, Lr)
2972
+ }, b(n.busy ? "Envoi…" : "Envoyer mon avis"), 9, Fr)
2954
2973
  ], 64))
2955
2974
  ]);
2956
2975
  }
2957
- const Fr = /* @__PURE__ */ L(Mr, [["render", $r], ["__scopeId", "data-v-6f45ff3b"]]);
2958
- function Ur(t) {
2976
+ const Dr = /* @__PURE__ */ B(Or, [["render", Ur], ["__scopeId", "data-v-6f45ff3b"]]);
2977
+ function Nr(t) {
2959
2978
  const e = new Date(t);
2960
2979
  return e.setHours(0, 0, 0, 0), e;
2961
2980
  }
2962
- const Dr = {
2981
+ const Pr = {
2963
2982
  name: "WmHistoryDrawer",
2964
2983
  props: {
2965
2984
  conversations: { type: Array, default: () => [] },
@@ -2993,7 +3012,7 @@ const Dr = {
2993
3012
  ) : this.normalized;
2994
3013
  },
2995
3014
  groups() {
2996
- const e = Ur(/* @__PURE__ */ new Date()).getTime(), n = e - 6 * 864e5, a = [], r = [], s = [];
3015
+ const e = Nr(/* @__PURE__ */ new Date()).getTime(), n = e - 6 * 864e5, a = [], r = [], s = [];
2997
3016
  for (const o of this.filtered) {
2998
3017
  if (!o.stamp) {
2999
3018
  s.push(o);
@@ -3011,29 +3030,29 @@ const Dr = {
3011
3030
  return this.filtered.length > 0;
3012
3031
  }
3013
3032
  }
3014
- }, jr = { class: "wm-hd" }, Nr = {
3033
+ }, Hr = { class: "wm-hd" }, zr = {
3015
3034
  class: "wm-hd__panel",
3016
3035
  role: "dialog",
3017
3036
  "aria-label": "Vos discussions"
3018
- }, Pr = { class: "wm-hd__head" }, Hr = { class: "wm-hd__top" }, zr = { class: "wm-hd__search" }, Vr = { class: "wm-hd__list" }, qr = {
3037
+ }, Vr = { class: "wm-hd__head" }, qr = { class: "wm-hd__top" }, Wr = { class: "wm-hd__search" }, Gr = { class: "wm-hd__list" }, Kr = {
3019
3038
  key: 0,
3020
3039
  class: "wm-hd__group"
3021
- }, Wr = { class: "wm-hd__groupLabel" }, Gr = { class: "wm-hd__rows" }, Kr = ["onClick"], Yr = { class: "wm-hd__rowIcon" }, Jr = {
3040
+ }, Yr = { class: "wm-hd__groupLabel" }, Jr = { class: "wm-hd__rows" }, Xr = ["onClick"], Qr = { class: "wm-hd__rowIcon" }, Zr = {
3022
3041
  key: 0,
3023
3042
  class: "wm-hd__rowDot",
3024
3043
  "aria-label": "Message non lu"
3025
- }, Xr = { class: "wm-hd__rowBody" }, Qr = { class: "wm-hd__rowTop" }, Zr = { class: "wm-hd__rowTitle" }, ei = { class: "wm-hd__rowPreview" }, ti = {
3044
+ }, ei = { class: "wm-hd__rowBody" }, ti = { class: "wm-hd__rowTop" }, ni = { class: "wm-hd__rowTitle" }, si = { class: "wm-hd__rowPreview" }, ri = {
3026
3045
  key: 0,
3027
3046
  class: "wm-hd__empty"
3028
3047
  };
3029
- function ni(t, e, n, a, r, s) {
3030
- return l(), d("div", jr, [
3048
+ function ii(t, e, n, a, r, s) {
3049
+ return l(), c("div", Hr, [
3031
3050
  i("div", {
3032
3051
  class: "wm-hd__scrim",
3033
3052
  onClick: e[0] || (e[0] = (o) => t.$emit("close"))
3034
3053
  }),
3035
- i("aside", Nr, [
3036
- i("div", Pr, [
3054
+ i("aside", zr, [
3055
+ i("div", Vr, [
3037
3056
  e[5] || (e[5] = i("div", { class: "wm-hd__heading" }, [
3038
3057
  i("div", { class: "wm-hd__title" }, "Vos discussions"),
3039
3058
  i("div", { class: "wm-hd__sub" }, "Reprenez là où vous en étiez.")
@@ -3059,7 +3078,7 @@ function ni(t, e, n, a, r, s) {
3059
3078
  ], -1)
3060
3079
  ])])
3061
3080
  ]),
3062
- i("div", Hr, [
3081
+ i("div", qr, [
3063
3082
  i("button", {
3064
3083
  type: "button",
3065
3084
  class: "wm-hd__new",
@@ -3082,7 +3101,7 @@ function ni(t, e, n, a, r, s) {
3082
3101
  ], -1),
3083
3102
  i("span", null, "Démarrer un nouveau fil", -1)
3084
3103
  ])]),
3085
- i("div", zr, [
3104
+ i("div", Wr, [
3086
3105
  e[7] || (e[7] = i("span", { class: "wm-hd__searchIcon" }, [
3087
3106
  i("svg", {
3088
3107
  width: "12",
@@ -3098,7 +3117,7 @@ function ni(t, e, n, a, r, s) {
3098
3117
  i("path", { d: "M21 21l-4.35-4.35M11 17a6 6 0 100-12 6 6 0 000 12z" })
3099
3118
  ])
3100
3119
  ], -1)),
3101
- q(i("input", {
3120
+ V(i("input", {
3102
3121
  "onUpdate:modelValue": e[3] || (e[3] = (o) => r.query = o),
3103
3122
  type: "text",
3104
3123
  placeholder: "Rechercher dans vos messages",
@@ -3108,23 +3127,23 @@ function ni(t, e, n, a, r, s) {
3108
3127
  ])
3109
3128
  ])
3110
3129
  ]),
3111
- i("div", Vr, [
3112
- (l(!0), d(E, null, F(s.groups, (o) => (l(), d(E, {
3130
+ i("div", Gr, [
3131
+ (l(!0), c(O, null, F(s.groups, (o) => (l(), c(O, {
3113
3132
  key: o.key
3114
3133
  }, [
3115
- o.items.length ? (l(), d("div", qr, [
3116
- i("div", Wr, y(o.label), 1),
3117
- i("div", Gr, [
3118
- (l(!0), d(E, null, F(o.items, (c) => (l(), d("button", {
3119
- key: c.id,
3134
+ o.items.length ? (l(), c("div", Kr, [
3135
+ i("div", Yr, b(o.label), 1),
3136
+ i("div", Jr, [
3137
+ (l(!0), c(O, null, F(o.items, (d) => (l(), c("button", {
3138
+ key: d.id,
3120
3139
  type: "button",
3121
- class: B(["wm-hd__row", {
3122
- "wm-hd__row--active": c.id === n.activeId,
3123
- "wm-hd__row--unread": c.unread
3140
+ class: E(["wm-hd__row", {
3141
+ "wm-hd__row--active": d.id === n.activeId,
3142
+ "wm-hd__row--unread": d.unread
3124
3143
  }]),
3125
- onClick: (p) => t.$emit("pick", c)
3144
+ onClick: (v) => t.$emit("pick", d)
3126
3145
  }, [
3127
- i("div", Yr, [
3146
+ i("div", Qr, [
3128
3147
  e[8] || (e[8] = i("svg", {
3129
3148
  width: "11",
3130
3149
  height: "11",
@@ -3138,24 +3157,24 @@ function ni(t, e, n, a, r, s) {
3138
3157
  opacity: "0.92"
3139
3158
  })
3140
3159
  ], -1)),
3141
- c.unread ? (l(), d("span", Jr)) : v("", !0)
3160
+ d.unread ? (l(), c("span", Zr)) : y("", !0)
3142
3161
  ]),
3143
- i("div", Xr, [
3144
- i("div", Qr, [
3145
- i("span", Zr, y(c.title), 1)
3162
+ i("div", ei, [
3163
+ i("div", ti, [
3164
+ i("span", ni, b(d.title), 1)
3146
3165
  ]),
3147
- i("div", ei, y(c.preview || "Aucun message"), 1)
3166
+ i("div", si, b(d.preview || "Aucun message"), 1)
3148
3167
  ])
3149
- ], 10, Kr))), 128))
3168
+ ], 10, Xr))), 128))
3150
3169
  ])
3151
- ])) : v("", !0)
3170
+ ])) : y("", !0)
3152
3171
  ], 64))), 128)),
3153
- s.hasAny ? v("", !0) : (l(), d("div", ti, " Aucun fil pour le moment. "))
3172
+ s.hasAny ? y("", !0) : (l(), c("div", ri, " Aucun fil pour le moment. "))
3154
3173
  ])
3155
3174
  ])
3156
3175
  ]);
3157
3176
  }
3158
- const si = /* @__PURE__ */ L(Dr, [["render", ni], ["__scopeId", "data-v-1259e822"]]), ri = {
3177
+ const ai = /* @__PURE__ */ B(Pr, [["render", ii], ["__scopeId", "data-v-1259e822"]]), oi = {
3159
3178
  name: "WmMoreMenu",
3160
3179
  props: {
3161
3180
  canRename: { type: Boolean, default: !0 },
@@ -3182,18 +3201,18 @@ const si = /* @__PURE__ */ L(Dr, [["render", ni], ["__scopeId", "data-v-1259e822
3182
3201
  this.notifOn = !this.notifOn, this.$emit("notif-toggle", this.notifOn);
3183
3202
  }
3184
3203
  }
3185
- }, ii = { class: "wm-mm" }, ai = {
3204
+ }, li = { class: "wm-mm" }, ci = {
3186
3205
  class: "wm-mm__pop",
3187
3206
  role: "menu"
3188
- }, oi = { class: "wm-mm__section" }, li = { class: "wm-mm__section" }, di = { class: "wm-mm__section" };
3189
- function ci(t, e, n, a, r, s) {
3190
- return l(), d("div", ii, [
3207
+ }, di = { class: "wm-mm__section" }, ui = { class: "wm-mm__section" }, hi = { class: "wm-mm__section" };
3208
+ function mi(t, e, n, a, r, s) {
3209
+ return l(), c("div", li, [
3191
3210
  i("div", {
3192
3211
  class: "wm-mm__scrim",
3193
3212
  onClick: e[0] || (e[0] = (o) => t.$emit("close"))
3194
3213
  }),
3195
- i("div", ai, [
3196
- i("div", oi, [
3214
+ i("div", ci, [
3215
+ i("div", di, [
3197
3216
  i("button", {
3198
3217
  type: "button",
3199
3218
  class: "wm-mm__item",
@@ -3216,15 +3235,15 @@ function ci(t, e, n, a, r, s) {
3216
3235
  ], -1),
3217
3236
  i("span", { class: "wm-mm__label" }, "Historique des discussions", -1)
3218
3237
  ])]),
3219
- n.canRename ? (l(), d("button", {
3238
+ n.canRename ? (l(), c("button", {
3220
3239
  key: 0,
3221
3240
  type: "button",
3222
3241
  class: "wm-mm__item",
3223
3242
  onClick: e[2] || (e[2] = (o) => s.emit("rename"))
3224
3243
  }, [...e[9] || (e[9] = [
3225
- de('<span class="wm-mm__icon" data-v-c1bb81d2><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-c1bb81d2><path d="M12 20h9" data-v-c1bb81d2></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-c1bb81d2></path></svg></span><span class="wm-mm__label" data-v-c1bb81d2>Renommer le fil</span>', 2)
3226
- ])])) : v("", !0),
3227
- n.canClear ? (l(), d("button", {
3244
+ ue('<span class="wm-mm__icon" data-v-c1bb81d2><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-c1bb81d2><path d="M12 20h9" data-v-c1bb81d2></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-c1bb81d2></path></svg></span><span class="wm-mm__label" data-v-c1bb81d2>Renommer le fil</span>', 2)
3245
+ ])])) : y("", !0),
3246
+ n.canClear ? (l(), c("button", {
3228
3247
  key: 1,
3229
3248
  type: "button",
3230
3249
  class: "wm-mm__item",
@@ -3246,18 +3265,18 @@ function ci(t, e, n, a, r, s) {
3246
3265
  ])
3247
3266
  ], -1),
3248
3267
  i("span", { class: "wm-mm__label" }, "Effacer ce fil", -1)
3249
- ])])) : v("", !0),
3250
- n.canExport ? (l(), d("button", {
3268
+ ])])) : y("", !0),
3269
+ n.canExport ? (l(), c("button", {
3251
3270
  key: 2,
3252
3271
  type: "button",
3253
3272
  class: "wm-mm__item",
3254
3273
  onClick: e[4] || (e[4] = (o) => s.emit("export"))
3255
3274
  }, [...e[11] || (e[11] = [
3256
- de('<span class="wm-mm__icon" data-v-c1bb81d2><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-c1bb81d2><path d="M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" data-v-c1bb81d2></path></svg></span><span class="wm-mm__label" data-v-c1bb81d2>Exporter la transcription</span><span class="wm-mm__hint" data-v-c1bb81d2>.txt</span>', 3)
3257
- ])])) : v("", !0)
3275
+ ue('<span class="wm-mm__icon" data-v-c1bb81d2><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-c1bb81d2><path d="M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" data-v-c1bb81d2></path></svg></span><span class="wm-mm__label" data-v-c1bb81d2>Exporter la transcription</span><span class="wm-mm__hint" data-v-c1bb81d2>.txt</span>', 3)
3276
+ ])])) : y("", !0)
3258
3277
  ]),
3259
3278
  e[17] || (e[17] = i("div", { class: "wm-mm__sep" }, null, -1)),
3260
- i("div", li, [
3279
+ i("div", ui, [
3261
3280
  i("button", {
3262
3281
  type: "button",
3263
3282
  class: "wm-mm__item",
@@ -3280,15 +3299,15 @@ function ci(t, e, n, a, r, s) {
3280
3299
  ], -1)),
3281
3300
  e[14] || (e[14] = i("span", { class: "wm-mm__label" }, "Notifications", -1)),
3282
3301
  i("span", {
3283
- class: B(["wm-mm__toggle", { "wm-mm__toggle--on": r.notifOn }])
3302
+ class: E(["wm-mm__toggle", { "wm-mm__toggle--on": r.notifOn }])
3284
3303
  }, [...e[12] || (e[12] = [
3285
3304
  i("span", { class: "wm-mm__knob" }, null, -1)
3286
3305
  ])], 2)
3287
3306
  ])
3288
3307
  ]),
3289
3308
  e[18] || (e[18] = i("div", { class: "wm-mm__sep" }, null, -1)),
3290
- i("div", di, [
3291
- n.statusUrl ? (l(), d("button", {
3309
+ i("div", hi, [
3310
+ n.statusUrl ? (l(), c("button", {
3292
3311
  key: 0,
3293
3312
  type: "button",
3294
3313
  class: "wm-mm__item",
@@ -3310,8 +3329,8 @@ function ci(t, e, n, a, r, s) {
3310
3329
  ])
3311
3330
  ], -1),
3312
3331
  i("span", { class: "wm-mm__label" }, "Statut des services", -1)
3313
- ])])) : v("", !0),
3314
- n.helpUrl ? (l(), d("button", {
3332
+ ])])) : y("", !0),
3333
+ n.helpUrl ? (l(), c("button", {
3315
3334
  key: 1,
3316
3335
  type: "button",
3317
3336
  class: "wm-mm__item",
@@ -3333,18 +3352,18 @@ function ci(t, e, n, a, r, s) {
3333
3352
  ])
3334
3353
  ], -1),
3335
3354
  i("span", { class: "wm-mm__label" }, "Centre d'aide", -1)
3336
- ])])) : v("", !0)
3355
+ ])])) : y("", !0)
3337
3356
  ])
3338
3357
  ])
3339
3358
  ]);
3340
3359
  }
3341
- const ui = /* @__PURE__ */ L(ri, [["render", ci], ["__scopeId", "data-v-c1bb81d2"]]), pe = "ww-messenger-tokens";
3342
- function le(t) {
3360
+ const fi = /* @__PURE__ */ B(oi, [["render", mi], ["__scopeId", "data-v-c1bb81d2"]]), ge = "ww-messenger-tokens";
3361
+ function de(t) {
3343
3362
  var n;
3344
3363
  const e = (n = t == null ? void 0 : t.author) == null ? void 0 : n.type;
3345
3364
  return e === "agent_ia" || e === "agent_human";
3346
3365
  }
3347
- function hi(t, e) {
3366
+ function _i(t, e) {
3348
3367
  if (!t || !e) return "";
3349
3368
  const n = Array.isArray(t.fields) ? t.fields : [], a = [];
3350
3369
  for (const r of n) {
@@ -3353,7 +3372,7 @@ function hi(t, e) {
3353
3372
  if (s == null || s === "") continue;
3354
3373
  let o;
3355
3374
  if (Array.isArray(s)) {
3356
- if (o = s.map((c) => ne(r, String(c))).join(", "), !o) continue;
3375
+ if (o = s.map((d) => ne(r, String(d))).join(", "), !o) continue;
3357
3376
  } else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = ne(r, String(s));
3358
3377
  a.push(`${r.label} :
3359
3378
  ${o}`);
@@ -3367,7 +3386,7 @@ function ne(t, e) {
3367
3386
  const n = t.options.find((a) => (a == null ? void 0 : a.value) === e);
3368
3387
  return (n == null ? void 0 : n.label) || e;
3369
3388
  }
3370
- function mi(t, e) {
3389
+ function pi(t, e) {
3371
3390
  const n = [], a = Array.isArray(t == null ? void 0 : t.fields) ? t.fields : [];
3372
3391
  for (const r of a) {
3373
3392
  if (!(r != null && r.key) || !(r != null && r.label)) continue;
@@ -3375,11 +3394,11 @@ function mi(t, e) {
3375
3394
  if (s == null || s === "") continue;
3376
3395
  let o;
3377
3396
  if (Array.isArray(s)) {
3378
- if (o = s.map((p) => ne(r, String(p))).join(", "), !o) continue;
3397
+ if (o = s.map((v) => ne(r, String(v))).join(", "), !o) continue;
3379
3398
  } else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = ne(r, String(s));
3380
- const c = r.type === "textarea" || typeof o == "string" && (o.length > 60 || o.includes(`
3399
+ const d = r.type === "textarea" || typeof o == "string" && (o.length > 60 || o.includes(`
3381
3400
  `));
3382
- n.push({ label: r.label, value: o, multiline: c });
3401
+ n.push({ label: r.label, value: o, multiline: d });
3383
3402
  }
3384
3403
  return {
3385
3404
  kind: "form_response",
@@ -3389,20 +3408,20 @@ function mi(t, e) {
3389
3408
  }
3390
3409
  };
3391
3410
  }
3392
- const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
3411
+ const vi = 450, gi = 50, yi = 900, wi = 12e3, bi = 300, ki = {
3393
3412
  name: "Messenger",
3394
3413
  components: {
3395
- Launcher: We,
3396
- Header: vt,
3397
- Onboarding: jt,
3398
- MessageList: ys,
3399
- Composer: js,
3400
- SuggestionChips: zs,
3401
- ApprovalCard: Zs,
3402
- FormCard: xr,
3403
- Feedback: Fr,
3404
- HistoryDrawer: si,
3405
- MoreMenu: ui
3414
+ Launcher: Ye,
3415
+ Header: wt,
3416
+ Onboarding: Ht,
3417
+ MessageList: ks,
3418
+ Composer: Hs,
3419
+ SuggestionChips: Ws,
3420
+ ApprovalCard: nr,
3421
+ FormCard: Ir,
3422
+ Feedback: Dr,
3423
+ HistoryDrawer: ai,
3424
+ MoreMenu: fi
3406
3425
  },
3407
3426
  // Make signAttachment available to deep children (AttachmentPreview)
3408
3427
  // without prop drilling. The store may not exist yet at provide-time
@@ -3417,10 +3436,18 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
3417
3436
  };
3418
3437
  },
3419
3438
  props: {
3420
- baseUrl: { type: String, default: "" },
3439
+ // Hardcoded server default (overridable for staging/dev).
3440
+ baseUrl: { type: String, default: ze },
3421
3441
  widgetId: { type: String, default: "" },
3422
3442
  userId: { type: String, default: "" },
3423
3443
  userHash: { type: String, default: "" },
3444
+ // Flat object of consumer-supplied customer data pushed to the
3445
+ // server (PATCH /customers/me) once, on boot, so the agent has it
3446
+ // as context. `name`/`email` map to the customer's canonical
3447
+ // columns; every other key is a named variable value sent under
3448
+ // `values`. e.g. { name, email, plan: 'pro', seats: 5 }. The
3449
+ // server does a partial set (keeps variables you didn't pass).
3450
+ customer: { type: Object, default: null },
3424
3451
  // 'floating' (default) | 'sheet' | 'embedded'
3425
3452
  displayMode: { type: String, default: "floating" },
3426
3453
  // Replaces the old WeWeb `wwEditorState` editor-detection prop.
@@ -3541,8 +3568,8 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
3541
3568
  var n;
3542
3569
  const t = this.readState, e = ((n = this.s) == null ? void 0 : n.messagesByConv) || {};
3543
3570
  return this.allConversations.map((a) => {
3544
- const r = e[a.id] || [], s = this.convLastActivity(a, r), o = t[a.id] || "", c = this.lastMessageAuthorType(r), p = !!s && c !== "user" && (!o || s > o);
3545
- return { ...a, _preview: this.convPreview(a, r), _unread: p };
3571
+ 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);
3572
+ return { ...a, _preview: this.convPreview(a, r), _unread: v };
3546
3573
  });
3547
3574
  },
3548
3575
  // How many threads have an unseen agent/human message. Drives the
@@ -3684,7 +3711,7 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
3684
3711
  var s;
3685
3712
  return (r == null ? void 0 : r.type) === "action" && ((s = r == null ? void 0 : r.payload) == null ? void 0 : s.state) === "pending";
3686
3713
  }, a = this.revealedAt;
3687
- return (this.s.messagesByConv[t.id] || []).filter((r) => !n(r)).filter((r) => le(r) ? a[r.id] > 0 : !0).filter(e);
3714
+ return (this.s.messagesByConv[t.id] || []).filter((r) => !n(r)).filter((r) => de(r) ? a[r.id] > 0 : !0).filter(e);
3688
3715
  },
3689
3716
  // True whenever we should show the "typing" indicator at the bottom
3690
3717
  // of the list: either the LLM is actively streaming tokens, or one
@@ -3693,7 +3720,7 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
3693
3720
  streamingActive() {
3694
3721
  var n, a, r;
3695
3722
  const t = this.currentConv;
3696
- 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) => le(s) && !(this.revealedAt[s.id] > 0)) : !1;
3723
+ 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) => de(s) && !(this.revealedAt[s.id] > 0)) : !1;
3697
3724
  },
3698
3725
  // Internal: the raw persisted list for the current conversation. We
3699
3726
  // watch this to detect new agent messages that need to be paced.
@@ -3725,14 +3752,14 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
3725
3752
  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";
3726
3753
  },
3727
3754
  approvalDetail() {
3728
- var a, r, s, o, c, p;
3755
+ var a, r, s, o, d, v;
3729
3756
  const t = (s = (r = (a = this.pendingApproval) == null ? void 0 : a.payload) == null ? void 0 : r.pending) == null ? void 0 : s.user_explanation;
3730
3757
  if (typeof t == "string" && t.trim())
3731
3758
  return t.trim();
3732
- const e = (p = (c = (o = this.pendingApproval) == null ? void 0 : o.payload) == null ? void 0 : c.pending) == null ? void 0 : p.prepared_params;
3759
+ const e = (v = (d = (o = this.pendingApproval) == null ? void 0 : o.payload) == null ? void 0 : d.pending) == null ? void 0 : v.prepared_params;
3733
3760
  if (!e || typeof e != "object") return "";
3734
3761
  const n = Object.entries(e);
3735
- return n.length ? n.slice(0, 2).map(([k, g]) => `${k}: ${g}`).join(" · ") : "";
3762
+ return n.length ? n.slice(0, 2).map(([C, w]) => `${C}: ${w}`).join(" · ") : "";
3736
3763
  },
3737
3764
  actionInFlight() {
3738
3765
  var t, e;
@@ -3768,13 +3795,13 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
3768
3795
  const t = this.currentConv;
3769
3796
  let e = /* @__PURE__ */ new Date();
3770
3797
  if (t) {
3771
- const o = ((r = (((a = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : a[t.id]) || []).find((c) => c == null ? void 0 : c.created_at)) == null ? void 0 : r.created_at) || t.created_at;
3798
+ 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;
3772
3799
  if (o) {
3773
- const c = new Date(o);
3774
- Number.isNaN(c.getTime()) || (e = c);
3800
+ const d = new Date(o);
3801
+ Number.isNaN(d.getTime()) || (e = d);
3775
3802
  }
3776
3803
  }
3777
- return `Aujourd'hui · ${ye(e)}`;
3804
+ return `Aujourd'hui · ${be(e)}`;
3778
3805
  },
3779
3806
  // Pagination state for the active conversation. Drives the
3780
3807
  // MessageList's scroll-up history loader. Defaults are safe (no
@@ -3864,7 +3891,7 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
3864
3891
  const e = Date.now(), n = { ...this.revealedAt };
3865
3892
  for (const r of t) {
3866
3893
  if ((r == null ? void 0 : r.id) == null || n[r.id] !== void 0) continue;
3867
- if (!le(r)) {
3894
+ if (!de(r)) {
3868
3895
  n[r.id] = e;
3869
3896
  continue;
3870
3897
  }
@@ -3873,8 +3900,8 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
3873
3900
  n[r.id] = e;
3874
3901
  continue;
3875
3902
  }
3876
- const o = typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0, c = Array.isArray((a = r == null ? void 0 : r.payload) == null ? void 0 : a.attachments) && r.payload.attachments.length > 0;
3877
- if (!o && !c) {
3903
+ 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;
3904
+ if (!o && !d) {
3878
3905
  n[r.id] = e;
3879
3906
  continue;
3880
3907
  }
@@ -3891,9 +3918,9 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
3891
3918
  hasWidgetId: !!this.widgetId,
3892
3919
  hasUserId: !!this.userId,
3893
3920
  hasUserHash: !!this.userHash
3894
- }), typeof document < "u" && !document.getElementById(pe)) {
3921
+ }), typeof document < "u" && !document.getElementById(ge)) {
3895
3922
  const t = document.createElement("style");
3896
- t.id = pe, t.textContent = Ne, document.head.appendChild(t);
3923
+ t.id = ge, t.textContent = He, document.head.appendChild(t);
3897
3924
  }
3898
3925
  this.hydrateReadState(), await this.boot(), this.isEmbedded && this.store && await this.open();
3899
3926
  },
@@ -3959,11 +3986,11 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
3959
3986
  for (let s = e.length - 1; s >= 0; s--) {
3960
3987
  const o = e[s];
3961
3988
  if (!o) continue;
3962
- const c = typeof o.text_md == "string" ? o.text_md.trim() : "";
3963
- if (c)
3964
- return (((n = o.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + c.replace(/\s+/g, " ");
3965
- const p = (a = o.payload) == null ? void 0 : a.attachments;
3966
- if (Array.isArray(p) && p.length) return "📎 Pièce jointe";
3989
+ const d = typeof o.text_md == "string" ? o.text_md.trim() : "";
3990
+ if (d)
3991
+ return (((n = o.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + d.replace(/\s+/g, " ");
3992
+ const v = (a = o.payload) == null ? void 0 : a.attachments;
3993
+ if (Array.isArray(v) && v.length) return "📎 Pièce jointe";
3967
3994
  }
3968
3995
  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) || "";
3969
3996
  },
@@ -4044,21 +4071,21 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
4044
4071
  // bounded by MIN/MAX_BETWEEN_MS.
4045
4072
  scheduleReveal(t) {
4046
4073
  const e = Date.now(), n = ((t == null ? void 0 : t.text_md) || "").length, a = Math.min(
4047
- vi,
4048
- Math.max(pi, n * _i)
4074
+ wi,
4075
+ Math.max(yi, n * gi)
4049
4076
  ), s = Math.max(
4050
- e + fi,
4051
- this.nextRevealAt + gi
4077
+ e + vi,
4078
+ this.nextRevealAt + bi
4052
4079
  ) + a;
4053
4080
  this.nextRevealAt = s;
4054
- const o = Math.max(0, s - e), c = t.id, p = setTimeout(() => {
4055
- this.revealedAt = { ...this.revealedAt, [c]: Date.now() }, this.revealTimers = this.revealTimers.filter((g) => g !== p);
4081
+ const o = Math.max(0, s - e), d = t.id, v = setTimeout(() => {
4082
+ this.revealedAt = { ...this.revealedAt, [d]: Date.now() }, this.revealTimers = this.revealTimers.filter((w) => w !== v);
4056
4083
  }, o);
4057
- this.revealTimers.push(p);
4058
- const k = setTimeout(() => {
4059
- this.revealedAt[c] > 0 || (this.revealedAt = { ...this.revealedAt, [c]: Date.now() }), this.revealTimers = this.revealTimers.filter((g) => g !== k);
4084
+ this.revealTimers.push(v);
4085
+ const C = setTimeout(() => {
4086
+ this.revealedAt[d] > 0 || (this.revealedAt = { ...this.revealedAt, [d]: Date.now() }), this.revealTimers = this.revealTimers.filter((w) => w !== C);
4060
4087
  }, o + 4e3);
4061
- this.revealTimers.push(k);
4088
+ this.revealTimers.push(C);
4062
4089
  },
4063
4090
  async boot() {
4064
4091
  if (!this.canBoot) {
@@ -4075,12 +4102,12 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
4075
4102
  baseUrl: this.baseUrl,
4076
4103
  widgetId: this.widgetId,
4077
4104
  userId: this.userId
4078
- }), this.transport = he($e({
4105
+ }), this.transport = fe(je({
4079
4106
  baseUrl: this.baseUrl,
4080
4107
  widgetId: this.widgetId,
4081
4108
  userId: this.userId,
4082
4109
  userHash: this.userHash
4083
- })), this.store = he(je(this.transport)), await this.store.start(), console.log("[ww-messenger] boot done", {
4110
+ })), this.store = fe(Pe(this.transport)), await this.store.start(), this.customer && typeof this.customer == "object" && await this.store.applyCustomer(this.customer), console.log("[ww-messenger] boot done", {
4084
4111
  ready: this.store.state.ready,
4085
4112
  error: this.store.state.error
4086
4113
  });
@@ -4211,7 +4238,7 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
4211
4238
  !t || !this.store || !(!(typeof window < "u" && typeof window.confirm == "function") || window.confirm("Effacer ce fil de votre côté ? Cette action ne supprime pas les messages côté agent.")) || ((n = this.s) != null && n.messagesByConv && (this.s.messagesByConv[t.id] = []), this.activeConvId = null, this.showOnboarding = !0);
4212
4239
  },
4213
4240
  exportCurrentConv() {
4214
- var r, s, o, c, p, k;
4241
+ var r, s, o, d, v, C;
4215
4242
  const t = this.currentConv;
4216
4243
  if (!t) return;
4217
4244
  const e = (((s = (r = this.s) == null ? void 0 : r.messagesByConv) == null ? void 0 : s[t.id]) || []).slice(), n = [
@@ -4219,18 +4246,18 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
4219
4246
  t.created_at ? `Créée le : ${t.created_at}` : "",
4220
4247
  ""
4221
4248
  ];
4222
- for (const g of e) {
4223
- if (!g) continue;
4224
- const T = ((o = g.author) == null ? void 0 : o.name) || (((c = g.author) == null ? void 0 : c.type) === "user" ? "Vous" : ((p = g.author) == null ? void 0 : p.type) === "agent_human" ? "Agent" : ((k = g.author) == null ? void 0 : k.type) === "agent_ia" ? "Assistant IA" : "Système"), R = g.created_at ? new Date(g.created_at).toLocaleString("fr-FR") : "", x = (g.text_md || "").trim();
4225
- x && (n.push(`[${R}] ${T} :`), n.push(x), n.push(""));
4249
+ for (const w of e) {
4250
+ if (!w) continue;
4251
+ const S = ((o = w.author) == null ? void 0 : o.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"), L = w.created_at ? new Date(w.created_at).toLocaleString("fr-FR") : "", A = (w.text_md || "").trim();
4252
+ A && (n.push(`[${L}] ${S} :`), n.push(A), n.push(""));
4226
4253
  }
4227
4254
  const a = new Blob([n.join(`
4228
4255
  `)], { type: "text/plain;charset=utf-8" });
4229
4256
  try {
4230
- const g = URL.createObjectURL(a), T = document.createElement("a");
4231
- T.href = g, T.download = `${(t.name || "conversation").replace(/[^a-z0-9-_]+/gi, "_")}.txt`, document.body.appendChild(T), T.click(), document.body.removeChild(T), setTimeout(() => URL.revokeObjectURL(g), 1e3);
4232
- } catch (g) {
4233
- console.error("[ww-messenger] export failed", g);
4257
+ const w = URL.createObjectURL(a), S = document.createElement("a");
4258
+ 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);
4259
+ } catch (w) {
4260
+ console.error("[ww-messenger] export failed", w);
4234
4261
  }
4235
4262
  },
4236
4263
  async onSend(t) {
@@ -4256,12 +4283,12 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
4256
4283
  async onFormSubmit({ values: t }) {
4257
4284
  const e = this.pendingForm;
4258
4285
  if (!(e != null && e.form)) return;
4259
- const n = hi(e.form, t);
4286
+ const n = _i(e.form, t);
4260
4287
  if (!n) return;
4261
4288
  const a = this.currentConv;
4262
4289
  a && await this.store.send(a.id, n, {
4263
4290
  metadata: {
4264
- artifact: mi(e.form, t)
4291
+ artifact: pi(e.form, t)
4265
4292
  }
4266
4293
  });
4267
4294
  },
@@ -4305,53 +4332,53 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
4305
4332
  }
4306
4333
  }
4307
4334
  }
4308
- }, wi = {
4335
+ }, Ci = {
4309
4336
  key: 0,
4310
4337
  class: "wm-loading",
4311
4338
  "aria-busy": "true",
4312
4339
  "aria-live": "polite"
4313
- }, bi = {
4340
+ }, Ai = {
4314
4341
  key: 0,
4315
4342
  class: "wm-state"
4316
- }, ki = { class: "wm-state__err" }, Ci = { class: "wm-state__errSub" }, Ai = { class: "wm-bottom" }, Si = {
4343
+ }, Si = { class: "wm-state__err" }, xi = { class: "wm-state__errSub" }, Mi = { class: "wm-bottom" }, Ti = {
4317
4344
  key: 0,
4318
4345
  ref: "floatEl",
4319
4346
  class: "wm-float"
4320
- }, xi = {
4347
+ }, Ii = {
4321
4348
  key: 1,
4322
4349
  class: "wm-actionWait",
4323
4350
  role: "status",
4324
4351
  "aria-live": "polite"
4325
- }, Mi = { class: "wm-actionWait__lbl" }, Ti = {
4352
+ }, Oi = { class: "wm-actionWait__lbl" }, Ei = {
4326
4353
  key: 1,
4327
4354
  class: "wm-attached"
4328
- }, Ii = ["onClick"];
4329
- function Oi(t, e, n, a, r, s) {
4330
- const o = O("Launcher"), c = O("Header"), p = O("Onboarding"), k = O("MessageList"), g = O("ApprovalCard"), T = O("FormCard"), R = O("Feedback"), x = O("SuggestionChips"), N = O("Composer"), I = O("MoreMenu"), P = O("HistoryDrawer");
4331
- return l(), d("div", {
4332
- class: B(["wm-root", `wm-root--${n.displayMode}`])
4355
+ }, Bi = ["onClick"];
4356
+ function Li(t, e, n, a, r, s) {
4357
+ const o = I("Launcher"), d = I("Header"), v = I("Onboarding"), C = I("MessageList"), w = I("ApprovalCard"), S = I("FormCard"), L = I("Feedback"), A = I("SuggestionChips"), D = I("Composer"), x = I("MoreMenu"), N = I("HistoryDrawer");
4358
+ return l(), c("div", {
4359
+ class: E(["wm-root", `wm-root--${n.displayMode}`])
4333
4360
  }, [
4334
4361
  !r.isOpen && !s.isEmbedded ? (l(), $(o, {
4335
4362
  key: 0,
4336
4363
  "unread-count": s.unreadCount,
4337
4364
  peek: s.launcherPeek,
4338
4365
  onOpen: s.openFromPeek,
4339
- onDismiss: e[0] || (e[0] = (U) => r.labelDismissed = !0)
4340
- }, null, 8, ["unread-count", "peek", "onOpen"])) : v("", !0),
4341
- r.isOpen || s.isEmbedded ? (l(), d("section", {
4366
+ onDismiss: e[0] || (e[0] = (j) => r.labelDismissed = !0)
4367
+ }, null, 8, ["unread-count", "peek", "onOpen"])) : y("", !0),
4368
+ r.isOpen || s.isEmbedded ? (l(), c("section", {
4342
4369
  key: 1,
4343
- class: B(["wm-panel", `wm-panel--${n.displayMode}`]),
4344
- style: H(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
4370
+ class: E(["wm-panel", `wm-panel--${n.displayMode}`]),
4371
+ style: P(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
4345
4372
  role: "dialog",
4346
4373
  "aria-label": "Messenger"
4347
4374
  }, [
4348
- !s.ready && !s.error ? (l(), d("div", wi, [
4349
- s.isEmbedded ? v("", !0) : (l(), d("button", {
4375
+ !s.ready && !s.error ? (l(), c("div", Ci, [
4376
+ s.isEmbedded ? y("", !0) : (l(), c("button", {
4350
4377
  key: 0,
4351
4378
  type: "button",
4352
4379
  class: "wm-loading__close",
4353
4380
  "aria-label": "Réduire",
4354
- onClick: e[1] || (e[1] = (...U) => s.close && s.close(...U))
4381
+ onClick: e[1] || (e[1] = (...j) => s.close && s.close(...j))
4355
4382
  }, [...e[6] || (e[6] = [
4356
4383
  i("svg", {
4357
4384
  width: "13",
@@ -4371,8 +4398,8 @@ function Oi(t, e, n, a, r, s) {
4371
4398
  class: "wm-loading__spinner",
4372
4399
  "aria-hidden": "true"
4373
4400
  }, null, -1))
4374
- ])) : (l(), d(E, { key: 1 }, [
4375
- z(c, {
4401
+ ])) : (l(), c(O, { key: 1 }, [
4402
+ H(d, {
4376
4403
  title: s.headerTitle,
4377
4404
  escalated: s.isEscalated,
4378
4405
  "agent-name": s.humanAgentName,
@@ -4387,8 +4414,8 @@ function Oi(t, e, n, a, r, s) {
4387
4414
  onMore: s.toggleMore,
4388
4415
  onClose: s.close
4389
4416
  }, null, 8, ["title", "escalated", "agent-name", "agent-avatar-url", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "onBack", "onMore", "onClose"]),
4390
- s.error ? (l(), d("div", bi, [
4391
- i("div", ki, [
4417
+ s.error ? (l(), c("div", Ai, [
4418
+ i("div", Si, [
4392
4419
  e[9] || (e[9] = i("div", { class: "wm-state__errIcon" }, [
4393
4420
  i("svg", {
4394
4421
  width: "14",
@@ -4406,11 +4433,11 @@ function Oi(t, e, n, a, r, s) {
4406
4433
  ], -1)),
4407
4434
  i("div", null, [
4408
4435
  e[8] || (e[8] = i("div", { class: "wm-state__errTitle" }, "Connexion impossible", -1)),
4409
- i("div", Ci, y(s.error), 1)
4436
+ i("div", xi, b(s.error), 1)
4410
4437
  ])
4411
4438
  ])
4412
- ])) : s.currentConv ? (l(), d(E, { key: 2 }, [
4413
- z(k, {
4439
+ ])) : s.currentConv ? (l(), c(O, { key: 2 }, [
4440
+ H(C, {
4414
4441
  ref: "messageList",
4415
4442
  messages: s.displayedMessages,
4416
4443
  "streaming-active": s.streamingActive,
@@ -4420,40 +4447,40 @@ function Oi(t, e, n, a, r, s) {
4420
4447
  "has-more": s.paginationState.hasMore,
4421
4448
  onLoadMore: s.onLoadMore
4422
4449
  }, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "onLoadMore"]),
4423
- i("div", Ai, [
4424
- s.floatVisible ? (l(), d("div", Si, [
4425
- s.approvalReady ? (l(), $(g, {
4450
+ i("div", Mi, [
4451
+ s.floatVisible ? (l(), c("div", Ti, [
4452
+ s.approvalReady ? (l(), $(w, {
4426
4453
  key: 0,
4427
4454
  action: s.approvalTitle,
4428
4455
  detail: s.approvalDetail,
4429
4456
  callbacks: s.pendingApproval.callbacks,
4430
4457
  onCallback: s.onApprovalCallback
4431
- }, null, 8, ["action", "detail", "callbacks", "onCallback"])) : s.pendingForm ? (l(), $(T, {
4458
+ }, null, 8, ["action", "detail", "callbacks", "onCallback"])) : s.pendingForm ? (l(), $(S, {
4432
4459
  key: s.pendingForm.message && s.pendingForm.message.id,
4433
4460
  form: s.pendingForm.form,
4434
4461
  onSubmit: s.onFormSubmit
4435
- }, null, 8, ["form", "onSubmit"])) : s.showFeedback ? (l(), $(R, {
4462
+ }, null, 8, ["form", "onSubmit"])) : s.showFeedback ? (l(), $(L, {
4436
4463
  key: 2,
4437
4464
  busy: r.feedbackBusy,
4438
4465
  done: r.feedbackDone,
4439
4466
  onSubmit: s.onFeedback
4440
- }, null, 8, ["busy", "done", "onSubmit"])) : (l(), $(x, {
4467
+ }, null, 8, ["busy", "done", "onSubmit"])) : (l(), $(A, {
4441
4468
  key: 3,
4442
4469
  items: s.suggestions,
4443
4470
  onSelect: s.onSuggestion
4444
4471
  }, null, 8, ["items", "onSelect"]))
4445
- ], 512)) : v("", !0),
4446
- s.actionInFlight ? (l(), d("div", xi, [
4472
+ ], 512)) : y("", !0),
4473
+ s.actionInFlight ? (l(), c("div", Ii, [
4447
4474
  e[10] || (e[10] = i("span", {
4448
4475
  class: "wm-actionWait__spinner",
4449
4476
  "aria-hidden": "true"
4450
4477
  }, null, -1)),
4451
- i("span", Mi, y(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
4452
- ])) : (l(), $(N, {
4478
+ i("span", Oi, b(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
4479
+ ])) : (l(), $(D, {
4453
4480
  key: 2,
4454
4481
  ref: "composer",
4455
4482
  modelValue: r.draft,
4456
- "onUpdate:modelValue": e[2] || (e[2] = (U) => r.draft = U),
4483
+ "onUpdate:modelValue": e[2] || (e[2] = (j) => r.draft = j),
4457
4484
  placeholder: s.composerPlaceholder,
4458
4485
  disabled: !!s.pendingApproval,
4459
4486
  "attach-label": "Joindre un fichier",
@@ -4461,7 +4488,7 @@ function Oi(t, e, n, a, r, s) {
4461
4488
  onAttach: s.onAttach
4462
4489
  }, null, 8, ["modelValue", "placeholder", "disabled", "onSend", "onAttach"]))
4463
4490
  ]),
4464
- r.moreOpen ? (l(), $(I, {
4491
+ r.moreOpen ? (l(), $(x, {
4465
4492
  key: 0,
4466
4493
  "can-rename": !!s.currentConv,
4467
4494
  "can-clear": !!s.currentConv,
@@ -4469,13 +4496,13 @@ function Oi(t, e, n, a, r, s) {
4469
4496
  "notif-enabled": r.notifEnabled,
4470
4497
  "status-url": s.statusUrl,
4471
4498
  "help-url": s.helpUrl,
4472
- onClose: e[3] || (e[3] = (U) => r.moreOpen = !1),
4499
+ onClose: e[3] || (e[3] = (j) => r.moreOpen = !1),
4473
4500
  onNotifToggle: s.onNotifToggle,
4474
4501
  onAction: s.onMoreAction
4475
- }, null, 8, ["can-rename", "can-clear", "can-export", "notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : v("", !0),
4476
- r.pendingAttachments.length ? (l(), d("div", Ti, [
4477
- (l(!0), d(E, null, F(r.pendingAttachments, (U, V) => (l(), d("div", {
4478
- key: V,
4502
+ }, null, 8, ["can-rename", "can-clear", "can-export", "notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : y("", !0),
4503
+ r.pendingAttachments.length ? (l(), c("div", Ei, [
4504
+ (l(!0), c(O, null, F(r.pendingAttachments, (j, z) => (l(), c("div", {
4505
+ key: z,
4479
4506
  class: "wm-attached__chip"
4480
4507
  }, [
4481
4508
  e[12] || (e[12] = i("svg", {
@@ -4491,11 +4518,11 @@ function Oi(t, e, n, a, r, s) {
4491
4518
  }, [
4492
4519
  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" })
4493
4520
  ], -1)),
4494
- i("span", null, y(U.name), 1),
4521
+ i("span", null, b(j.name), 1),
4495
4522
  i("button", {
4496
4523
  type: "button",
4497
4524
  "aria-label": "Retirer",
4498
- onClick: (Q) => r.pendingAttachments.splice(V, 1)
4525
+ onClick: (X) => r.pendingAttachments.splice(z, 1)
4499
4526
  }, [...e[11] || (e[11] = [
4500
4527
  i("svg", {
4501
4528
  width: "10",
@@ -4510,10 +4537,10 @@ function Oi(t, e, n, a, r, s) {
4510
4537
  }, [
4511
4538
  i("path", { d: "M18 6L6 18M6 6l12 12" })
4512
4539
  ], -1)
4513
- ])], 8, Ii)
4540
+ ])], 8, Bi)
4514
4541
  ]))), 128))
4515
- ])) : v("", !0)
4516
- ], 64)) : (l(), $(p, {
4542
+ ])) : y("", !0)
4543
+ ], 64)) : (l(), $(v, {
4517
4544
  key: 1,
4518
4545
  "welcome-message": s.widgetWelcomeMessage,
4519
4546
  "agent-name": s.agentName,
@@ -4524,15 +4551,15 @@ function Oi(t, e, n, a, r, s) {
4524
4551
  onSelect: s.onQuickLink,
4525
4552
  onResume: s.onDrawerPick
4526
4553
  }, null, 8, ["welcome-message", "agent-name", "quick-links", "unread-threads", "busy", "onStart", "onSelect", "onResume"])),
4527
- r.historyOpen ? (l(), $(P, {
4554
+ r.historyOpen ? (l(), $(N, {
4528
4555
  key: 3,
4529
4556
  conversations: s.drawerConversations,
4530
4557
  "active-id": s.currentConv ? s.currentConv.id : null,
4531
- onClose: e[4] || (e[4] = (U) => r.historyOpen = !1),
4558
+ onClose: e[4] || (e[4] = (j) => r.historyOpen = !1),
4532
4559
  onNew: s.onDrawerNew,
4533
4560
  onPick: s.onDrawerPick
4534
- }, null, 8, ["conversations", "active-id", "onNew", "onPick"])) : v("", !0),
4535
- r.moreOpen && !s.currentConv ? (l(), $(I, {
4561
+ }, null, 8, ["conversations", "active-id", "onNew", "onPick"])) : y("", !0),
4562
+ r.moreOpen && !s.currentConv ? (l(), $(x, {
4536
4563
  key: 4,
4537
4564
  "can-rename": !1,
4538
4565
  "can-clear": !1,
@@ -4540,55 +4567,56 @@ function Oi(t, e, n, a, r, s) {
4540
4567
  "notif-enabled": r.notifEnabled,
4541
4568
  "status-url": s.statusUrl,
4542
4569
  "help-url": s.helpUrl,
4543
- onClose: e[5] || (e[5] = (U) => r.moreOpen = !1),
4570
+ onClose: e[5] || (e[5] = (j) => r.moreOpen = !1),
4544
4571
  onNotifToggle: s.onNotifToggle,
4545
4572
  onAction: s.onMoreAction
4546
- }, null, 8, ["notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : v("", !0)
4573
+ }, null, 8, ["notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : y("", !0)
4547
4574
  ], 64))
4548
- ], 6)) : v("", !0)
4575
+ ], 6)) : y("", !0)
4549
4576
  ], 2);
4550
4577
  }
4551
- const Li = /* @__PURE__ */ L(yi, [["render", Oi], ["__scopeId", "data-v-da51a155"]]);
4578
+ const Fi = /* @__PURE__ */ B(ki, [["render", Li], ["__scopeId", "data-v-bee7b290"]]);
4552
4579
  export {
4553
- X as AIAvatar,
4554
- ae as AVATAR_COLORS,
4555
- Fn as ActionResult,
4556
- Zs as ApprovalCard,
4557
- Yt as ArtifactFormResponse,
4558
- dn as ArtifactInfoCard,
4559
- ke as ArtifactRenderer,
4560
- Cn as ArtifactTicket,
4561
- Kn as AttachmentPreview,
4562
- Qn as Bubble,
4563
- js as Composer,
4564
- Fr as Feedback,
4565
- xr as FormCard,
4566
- vt as Header,
4567
- si as HistoryDrawer,
4568
- we as HumanAvatar,
4569
- We as Launcher,
4570
- ce as MEDIA_RECORDER_SUPPORTED,
4571
- ys as MessageList,
4572
- Li as Messenger,
4573
- ui as MoreMenu,
4574
- jt as Onboarding,
4580
+ J as AIAvatar,
4581
+ le as AVATAR_COLORS,
4582
+ Dn as ActionResult,
4583
+ nr as ApprovalCard,
4584
+ Qt as ArtifactFormResponse,
4585
+ hn as ArtifactInfoCard,
4586
+ Ae as ArtifactRenderer,
4587
+ xn as ArtifactTicket,
4588
+ Xn as AttachmentPreview,
4589
+ ts as Bubble,
4590
+ Hs as Composer,
4591
+ ze as DEFAULT_BASE_URL,
4592
+ Dr as Feedback,
4593
+ Ir as FormCard,
4594
+ wt as Header,
4595
+ ai as HistoryDrawer,
4596
+ ke as HumanAvatar,
4597
+ Ye as Launcher,
4598
+ he as MEDIA_RECORDER_SUPPORTED,
4599
+ ks as MessageList,
4600
+ Fi as Messenger,
4601
+ fi as MoreMenu,
4602
+ Ht as Onboarding,
4575
4603
  te as SCREEN_CAPTURE_SUPPORTED,
4576
- zs as SuggestionChips,
4577
- it as TeamAvatars,
4578
- ns as Typing,
4579
- ve as avatarColor,
4580
- ge as avatarInitials,
4581
- bs as captureScreenshotFile,
4582
- j as colors,
4583
- je as createStore,
4584
- $e as createTransport,
4585
- Li as default,
4586
- ye as formatTime,
4587
- Bi as guessAttachmentKind,
4588
- ws as pickRecorderMime,
4589
- be as renderMarkdown,
4590
- Cs as startScreenRecording,
4591
- Ne as tokensCss,
4592
- De as uuid,
4593
- De as v4
4604
+ Ws as SuggestionChips,
4605
+ lt as TeamAvatars,
4606
+ is as Typing,
4607
+ ye as avatarColor,
4608
+ we as avatarInitials,
4609
+ As as captureScreenshotFile,
4610
+ U as colors,
4611
+ Pe as createStore,
4612
+ je as createTransport,
4613
+ Fi as default,
4614
+ be as formatTime,
4615
+ $i as guessAttachmentKind,
4616
+ Cs as pickRecorderMime,
4617
+ Ce as renderMarkdown,
4618
+ xs as startScreenRecording,
4619
+ He as tokensCss,
4620
+ Ne as uuid,
4621
+ Ne as v4
4594
4622
  };