@_solaris/messenger-widget 0.1.1 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -1
- package/dist/messenger.cjs +9 -9
- package/dist/messenger.embed.js +30 -30
- package/dist/messenger.js +1182 -1150
- package/dist/style.css +1 -1
- package/dist/types/core/config.d.ts +11 -0
- package/dist/types/core/store.d.ts +5 -0
- package/dist/types/core/transport.d.ts +1 -1
- package/dist/types/core/types.d.ts +24 -2
- package/dist/types/embed.d.ts +12 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/messenger.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
const
|
|
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 g, 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
|
-
],
|
|
10
|
-
function
|
|
9
|
+
], Re = 5 * 60 * 1e3, $e = 10 * 60 * 1e3, Fe = 5 * 60 * 1e3;
|
|
10
|
+
function je(t) {
|
|
11
11
|
const e = {
|
|
12
|
-
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(
|
|
35
|
-
return e.listeners.has(
|
|
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(
|
|
38
|
-
const
|
|
39
|
-
|
|
37
|
+
function a(h, f) {
|
|
38
|
+
const p = e.listeners.get(h);
|
|
39
|
+
p && p.forEach((k) => {
|
|
40
40
|
try {
|
|
41
|
-
|
|
42
|
-
} catch (
|
|
43
|
-
console.error("[transport] listener",
|
|
41
|
+
k(f);
|
|
42
|
+
} catch (T) {
|
|
43
|
+
console.error("[transport] listener", h, T);
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
function r(
|
|
48
|
-
e.connection !==
|
|
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(
|
|
58
|
-
const
|
|
59
|
-
method:
|
|
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:
|
|
61
|
+
body: p !== void 0 ? JSON.stringify(p) : void 0
|
|
62
62
|
});
|
|
63
|
-
if (!
|
|
64
|
-
const
|
|
65
|
-
`HTTP ${
|
|
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
|
|
67
|
+
throw M.status = k.status, M.body = T, M;
|
|
68
68
|
}
|
|
69
|
-
return
|
|
69
|
+
return k.status === 204 ? null : k.json();
|
|
70
70
|
}
|
|
71
|
-
async function
|
|
71
|
+
async function d(h) {
|
|
72
72
|
try {
|
|
73
|
-
return await
|
|
73
|
+
return await h.json();
|
|
74
74
|
} catch {
|
|
75
75
|
return null;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
async function
|
|
79
|
-
const [
|
|
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 (
|
|
82
|
-
if (!
|
|
83
|
-
const
|
|
84
|
-
throw new Error(`HTTP ${
|
|
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
|
|
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
|
-
|
|
94
|
+
h
|
|
95
95
|
),
|
|
96
|
-
customer: (
|
|
96
|
+
customer: (f == null ? void 0 : f.customer) ?? null
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
|
-
async function
|
|
100
|
-
const
|
|
101
|
-
return (
|
|
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
|
|
104
|
-
const
|
|
105
|
-
return (
|
|
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
|
|
108
|
-
const
|
|
109
|
-
return (
|
|
107
|
+
async function S() {
|
|
108
|
+
const h = await o("GET", "/conversations");
|
|
109
|
+
return (h == null ? void 0 : h.conversations) ?? [];
|
|
110
110
|
}
|
|
111
|
-
async function
|
|
112
|
-
return (await o("POST", "/conversations",
|
|
111
|
+
async function L(h = {}) {
|
|
112
|
+
return (await o("POST", "/conversations", h)).conversation;
|
|
113
113
|
}
|
|
114
|
-
async function
|
|
115
|
-
return (await o("GET", `/conversations/${encodeURIComponent(
|
|
114
|
+
async function A(h) {
|
|
115
|
+
return (await o("GET", `/conversations/${encodeURIComponent(h)}`)).conversation;
|
|
116
116
|
}
|
|
117
|
-
async function
|
|
118
|
-
return (await o("PATCH", `/conversations/${encodeURIComponent(
|
|
117
|
+
async function D(h, f) {
|
|
118
|
+
return (await o("PATCH", `/conversations/${encodeURIComponent(h)}`, f)).conversation;
|
|
119
119
|
}
|
|
120
|
-
async function
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
const
|
|
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(
|
|
126
|
+
`/conversations/${encodeURIComponent(h)}/messages${k}`
|
|
127
127
|
);
|
|
128
128
|
}
|
|
129
|
-
async function
|
|
129
|
+
async function N(h, f) {
|
|
130
130
|
W();
|
|
131
|
-
const
|
|
132
|
-
client_msg_id:
|
|
131
|
+
const p = {
|
|
132
|
+
client_msg_id: f.client_msg_id,
|
|
133
133
|
type: "content",
|
|
134
|
-
text_md:
|
|
134
|
+
text_md: f.text_md,
|
|
135
135
|
author: { id: e.userId, type: "user" },
|
|
136
|
-
created_at:
|
|
136
|
+
created_at: f.created_at || (/* @__PURE__ */ new Date()).toISOString()
|
|
137
137
|
};
|
|
138
|
-
return Array.isArray(
|
|
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(
|
|
141
|
-
|
|
140
|
+
`/conversations/${encodeURIComponent(h)}/messages`,
|
|
141
|
+
p
|
|
142
142
|
);
|
|
143
143
|
}
|
|
144
|
-
async function
|
|
144
|
+
async function j(h, f, p) {
|
|
145
145
|
return W(), o(
|
|
146
146
|
"POST",
|
|
147
|
-
`/messages/${encodeURIComponent(
|
|
148
|
-
|
|
147
|
+
`/messages/${encodeURIComponent(h)}/callbacks/${encodeURIComponent(f)}`,
|
|
148
|
+
p ? { inputs: p } : {}
|
|
149
149
|
);
|
|
150
150
|
}
|
|
151
|
-
async function
|
|
152
|
-
const
|
|
151
|
+
async function z(h) {
|
|
152
|
+
const f = (
|
|
153
153
|
/** @type {File} */
|
|
154
|
-
|
|
155
|
-
),
|
|
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:
|
|
159
|
-
size_bytes:
|
|
160
|
-
name:
|
|
158
|
+
mime_type: p,
|
|
159
|
+
size_bytes: k,
|
|
160
|
+
name: f
|
|
161
161
|
})
|
|
162
|
-
),
|
|
162
|
+
), M = await fetch(T.upload_url, {
|
|
163
163
|
method: "PUT",
|
|
164
|
-
headers: { "Content-Type":
|
|
165
|
-
body:
|
|
164
|
+
headers: { "Content-Type": p },
|
|
165
|
+
body: h
|
|
166
166
|
});
|
|
167
|
-
if (!
|
|
168
|
-
throw new Error(`HTTP ${
|
|
167
|
+
if (!M.ok)
|
|
168
|
+
throw new Error(`HTTP ${M.status} PUT signed upload`);
|
|
169
169
|
return {
|
|
170
|
-
type:
|
|
171
|
-
path:
|
|
172
|
-
mime_type:
|
|
173
|
-
size_bytes:
|
|
170
|
+
type: De(p),
|
|
171
|
+
path: T.path,
|
|
172
|
+
mime_type: p,
|
|
173
|
+
size_bytes: k
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
|
-
async function
|
|
176
|
+
async function X(h) {
|
|
177
177
|
return o(
|
|
178
178
|
"GET",
|
|
179
|
-
`/attachments/sign?path=${encodeURIComponent(
|
|
179
|
+
`/attachments/sign?path=${encodeURIComponent(h)}`
|
|
180
180
|
);
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
const
|
|
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?${
|
|
188
|
+
return `${e.baseUrl}/stream?${h}`;
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function q() {
|
|
191
191
|
if (!e.eventSource && !(typeof document < "u" && document.hidden))
|
|
192
192
|
try {
|
|
193
|
-
const
|
|
194
|
-
for (const
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
} catch (
|
|
198
|
-
console.error("[transport] SSE open failed",
|
|
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
|
|
201
|
+
function ie(h, f) {
|
|
202
202
|
try {
|
|
203
|
-
const
|
|
204
|
-
a(
|
|
205
|
-
} catch (
|
|
206
|
-
console.error("[transport] bad SSE payload",
|
|
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
|
|
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),
|
|
214
|
-
e.panelOpen ||
|
|
215
|
-
},
|
|
213
|
+
clearTimeout(e.burstTimer), q(), e.panelOpen || (e.burstTimer = setTimeout(() => {
|
|
214
|
+
e.panelOpen || K();
|
|
215
|
+
}, $e));
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
e.panelOpen = !!
|
|
217
|
+
function ae(h) {
|
|
218
|
+
e.panelOpen = !!h, e.panelOpen ? (clearTimeout(e.burstTimer), q()) : W();
|
|
219
219
|
}
|
|
220
|
-
async function
|
|
220
|
+
async function oe() {
|
|
221
221
|
try {
|
|
222
|
-
const
|
|
223
|
-
const
|
|
224
|
-
return
|
|
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
|
-
|
|
227
|
-
} catch (
|
|
228
|
-
console.error("[transport] poll failed",
|
|
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
|
|
232
|
-
|
|
231
|
+
function Q() {
|
|
232
|
+
u(), !(typeof document < "u" && document.hidden) && (e.pollTimer = setInterval(oe, Re));
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function u() {
|
|
235
235
|
e.pollTimer && (clearInterval(e.pollTimer), e.pollTimer = null);
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function m() {
|
|
238
238
|
if (document.hidden)
|
|
239
239
|
clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = setTimeout(() => {
|
|
240
|
-
e.hiddenGraceTimer = null, document.hidden && (
|
|
241
|
-
},
|
|
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"),
|
|
247
|
+
r("idle"), Q(), e.panelOpen && q();
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
|
-
async function
|
|
250
|
+
async function _() {
|
|
251
251
|
if (e.started) return e.lastBootstrap;
|
|
252
252
|
e.started = !0;
|
|
253
|
-
const
|
|
254
|
-
e.lastBootstrap =
|
|
253
|
+
const h = await v();
|
|
254
|
+
e.lastBootstrap = h;
|
|
255
255
|
try {
|
|
256
|
-
const
|
|
257
|
-
e.lastActivityAt =
|
|
258
|
-
const
|
|
259
|
-
return
|
|
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 =
|
|
264
|
+
return typeof document < "u" && (e.visibilityHandler = m, document.addEventListener("visibilitychange", e.visibilityHandler)), Q(), h;
|
|
265
265
|
}
|
|
266
|
-
function
|
|
267
|
-
|
|
266
|
+
function y() {
|
|
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:
|
|
272
|
-
stop:
|
|
273
|
-
setPanelOpen:
|
|
271
|
+
start: _,
|
|
272
|
+
stop: y,
|
|
273
|
+
setPanelOpen: ae,
|
|
274
274
|
// REST
|
|
275
|
-
bootstrap:
|
|
276
|
-
getCustomer:
|
|
277
|
-
patchCustomer:
|
|
278
|
-
listConversations:
|
|
279
|
-
createConversation:
|
|
280
|
-
getConversation:
|
|
281
|
-
patchConversation:
|
|
282
|
-
listMessages:
|
|
283
|
-
postMessage:
|
|
284
|
-
postCallback:
|
|
285
|
-
uploadAttachment:
|
|
286
|
-
signAttachment:
|
|
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
|
|
293
|
+
function Ue(t) {
|
|
294
294
|
return t.endsWith("/") ? t.slice(0, -1) : t;
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function De(t) {
|
|
297
297
|
return t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : "file";
|
|
298
298
|
}
|
|
299
|
-
function
|
|
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
|
|
312
|
-
const e =
|
|
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
|
|
347
|
-
!
|
|
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
|
|
350
|
-
!
|
|
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
|
|
353
|
-
if (!
|
|
354
|
-
const
|
|
355
|
-
|
|
352
|
+
const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.changes;
|
|
353
|
+
if (!m || !_) return;
|
|
354
|
+
const y = e.conversations.findIndex((h) => h.id === m);
|
|
355
|
+
y !== -1 && (e.conversations[y] = { ...e.conversations[y], ..._ });
|
|
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
|
|
360
|
-
if (!
|
|
361
|
-
const
|
|
362
|
-
u.state === "running" ? (
|
|
359
|
+
const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.action_id, y = u == null ? void 0 : u.action_name;
|
|
360
|
+
if (!m || !_) return;
|
|
361
|
+
const h = e.runningActionsByConv[m] || {};
|
|
362
|
+
u.state === "running" ? (h[_] = y || _, e.runningActionsByConv[m] = { ...h }) : u.state === "done" && (delete h[_], e.runningActionsByConv[m] = { ...h });
|
|
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
|
-
(
|
|
370
|
-
),
|
|
371
|
-
e.config =
|
|
369
|
+
(_, y) => setTimeout(() => y(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
|
|
386
|
-
|
|
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
|
-
|
|
389
|
-
|
|
395
|
+
async function o(u = {}) {
|
|
396
|
+
const m = await t.createConversation(u), _ = e.conversations.findIndex((y) => y.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
|
|
392
|
-
e.messagesByConv[u] = (
|
|
393
|
-
nextCursor: (
|
|
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
|
|
399
|
-
const
|
|
400
|
-
if (!(!
|
|
401
|
-
|
|
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
|
|
404
|
-
for (;
|
|
405
|
-
const
|
|
406
|
-
before:
|
|
407
|
-
limit:
|
|
408
|
-
}),
|
|
409
|
-
if (
|
|
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
|
|
412
|
-
e.messagesByConv[u] =
|
|
413
|
-
nextCursor:
|
|
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 (
|
|
418
|
-
console.error("[store] loadMore failed",
|
|
428
|
+
} catch (_) {
|
|
429
|
+
console.error("[store] loadMore failed", _), w(u, { ...m, loading: !1 });
|
|
419
430
|
}
|
|
420
431
|
}
|
|
421
432
|
}
|
|
422
|
-
function
|
|
423
|
-
e.paginationByConv = { ...e.paginationByConv, [u]:
|
|
433
|
+
function w(u, m) {
|
|
434
|
+
e.paginationByConv = { ...e.paginationByConv, [u]: m };
|
|
424
435
|
}
|
|
425
|
-
async function
|
|
426
|
-
const
|
|
427
|
-
|
|
436
|
+
async function S(u, m) {
|
|
437
|
+
const _ = await t.patchConversation(u, m), y = e.conversations.findIndex((h) => h.id === u);
|
|
438
|
+
y !== -1 && (e.conversations[y] = _);
|
|
428
439
|
}
|
|
429
|
-
async function
|
|
430
|
-
var
|
|
431
|
-
const
|
|
432
|
-
if (!u || !
|
|
433
|
-
const
|
|
434
|
-
id:
|
|
435
|
-
client_msg_id:
|
|
440
|
+
async function L(u, m, { attachments: _, metadata: y } = {}) {
|
|
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:
|
|
449
|
+
text_md: h,
|
|
439
450
|
author: {
|
|
440
451
|
type: "user",
|
|
441
|
-
id: ((
|
|
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
|
-
...
|
|
447
|
-
...
|
|
457
|
+
...f ? { payload: { type: "content", attachments: _ } } : {},
|
|
458
|
+
...y && typeof y == "object" ? { metadata: y } : {}
|
|
448
459
|
};
|
|
449
|
-
|
|
460
|
+
q(u, T);
|
|
450
461
|
try {
|
|
451
462
|
await t.postMessage(u, {
|
|
452
|
-
client_msg_id:
|
|
453
|
-
text_md:
|
|
454
|
-
created_at:
|
|
455
|
-
...
|
|
456
|
-
...
|
|
463
|
+
client_msg_id: p,
|
|
464
|
+
text_md: h,
|
|
465
|
+
created_at: k,
|
|
466
|
+
...f ? { attachments: _ } : {},
|
|
467
|
+
...y && typeof y == "object" ? { metadata: y } : {}
|
|
457
468
|
});
|
|
458
|
-
} catch (
|
|
459
|
-
console.error("[store] send failed",
|
|
469
|
+
} catch (R) {
|
|
470
|
+
console.error("[store] send failed", R), K(u, p, { _failed: !0, _pending: !1 });
|
|
460
471
|
}
|
|
461
472
|
}
|
|
462
|
-
async function
|
|
473
|
+
async function A(u, m, _) {
|
|
463
474
|
u != null && (e.awaitingCallback[u] = !0);
|
|
464
475
|
try {
|
|
465
|
-
await t.postCallback(u,
|
|
466
|
-
} catch (
|
|
467
|
-
console.error("[store] callback failed",
|
|
476
|
+
await t.postCallback(u, m, _);
|
|
477
|
+
} catch (y) {
|
|
478
|
+
console.error("[store] callback failed", y), u != null && delete e.awaitingCallback[u];
|
|
468
479
|
}
|
|
469
480
|
}
|
|
470
|
-
const
|
|
471
|
-
async function
|
|
481
|
+
const D = /* @__PURE__ */ new Map();
|
|
482
|
+
async function x(u) {
|
|
472
483
|
if (!u) return null;
|
|
473
|
-
const
|
|
474
|
-
if (
|
|
475
|
-
const
|
|
476
|
-
if (!
|
|
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
|
|
480
|
-
if (
|
|
481
|
-
return
|
|
482
|
-
} catch (
|
|
483
|
-
console.error("[store] sign attachment failed",
|
|
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
|
|
488
|
-
const
|
|
489
|
-
...(
|
|
498
|
+
async function N(u, { rating: m, comment: _ } = {}) {
|
|
499
|
+
const y = e.conversations.find((p) => p.id === u), f = {
|
|
500
|
+
...(y == null ? void 0 : y.metadata) || {},
|
|
490
501
|
feedback: {
|
|
491
|
-
rating:
|
|
492
|
-
comment:
|
|
502
|
+
rating: m,
|
|
503
|
+
comment: _ || null,
|
|
493
504
|
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
494
505
|
}
|
|
495
506
|
};
|
|
496
|
-
await
|
|
507
|
+
await S(u, { metadata: f });
|
|
497
508
|
}
|
|
498
|
-
function
|
|
499
|
-
var
|
|
500
|
-
const
|
|
501
|
-
for (let
|
|
502
|
-
const
|
|
503
|
-
if ((
|
|
504
|
-
return
|
|
509
|
+
function j(u) {
|
|
510
|
+
var _, y;
|
|
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" && ((y = f == null ? void 0 : f.payload) == null ? void 0 : y.state) === "pending" && Array.isArray(f == null ? void 0 : f.callbacks) && f.callbacks.length > 0 && !e.awaitingCallback[f.id])
|
|
515
|
+
return f;
|
|
505
516
|
}
|
|
506
517
|
return null;
|
|
507
518
|
}
|
|
508
|
-
function
|
|
509
|
-
var
|
|
510
|
-
const
|
|
511
|
-
for (let
|
|
512
|
-
const
|
|
513
|
-
if (((
|
|
514
|
-
const
|
|
515
|
-
if (
|
|
516
|
-
return { message:
|
|
519
|
+
function z(u) {
|
|
520
|
+
var _, y, 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" && ((y = p == null ? void 0 : p.payload) == null ? void 0 : y.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
|
|
521
|
-
const
|
|
522
|
-
if (!
|
|
523
|
-
const
|
|
524
|
-
if (
|
|
525
|
-
const
|
|
526
|
-
return { id:
|
|
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 y = _[0];
|
|
537
|
+
return { id: y, payload: { name: m[y] } };
|
|
527
538
|
}
|
|
528
|
-
function
|
|
529
|
-
var
|
|
530
|
-
const
|
|
531
|
-
for (let
|
|
532
|
-
const
|
|
533
|
-
if (((
|
|
534
|
-
if ((
|
|
535
|
-
if (((
|
|
536
|
-
const
|
|
537
|
-
return Array.isArray(
|
|
538
|
-
if (typeof
|
|
539
|
-
const
|
|
540
|
-
return
|
|
539
|
+
function re(u) {
|
|
540
|
+
var _, y, 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" && ((y = k == null ? void 0 : k.payload) == null ? void 0 : y.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 (
|
|
543
|
-
const
|
|
544
|
-
if (!
|
|
545
|
-
const
|
|
546
|
-
return { label:
|
|
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
|
|
554
|
-
var
|
|
555
|
-
const
|
|
556
|
-
let
|
|
557
|
-
|
|
558
|
-
(
|
|
559
|
-
)),
|
|
560
|
-
let
|
|
561
|
-
|
|
564
|
+
function q(u, m) {
|
|
565
|
+
var f;
|
|
566
|
+
const _ = e.messagesByConv[u] || [];
|
|
567
|
+
let y = -1;
|
|
568
|
+
m != null && m.client_msg_id && (y = _.findIndex(
|
|
569
|
+
(p) => (p == null ? void 0 : p.client_msg_id) && p.client_msg_id === m.client_msg_id
|
|
570
|
+
)), y === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (y = _.findIndex((p) => ie(p == null ? void 0 : p.id, m.id)));
|
|
571
|
+
let h;
|
|
572
|
+
y === -1 ? h = [..._, m].sort(ae) : (h = _.slice(), h[y] = { ..._[y], ...m, _pending: !1, _failed: !1 }), e.messagesByConv[u] = h, (m == null ? void 0 : m.type) === "action" && ((f = m == null ? void 0 : m.payload) != null && f.state) && m.payload.state !== "pending" && (m == null ? void 0 : m.id) != null && e.awaitingCallback[m.id] && delete e.awaitingCallback[m.id];
|
|
562
573
|
}
|
|
563
|
-
function
|
|
564
|
-
return u ===
|
|
574
|
+
function ie(u, m) {
|
|
575
|
+
return u === m ? !0 : u == null || m == null ? !1 : String(u) === String(m);
|
|
565
576
|
}
|
|
566
|
-
function
|
|
567
|
-
const
|
|
568
|
-
if (!
|
|
569
|
-
const
|
|
570
|
-
if (
|
|
571
|
-
const
|
|
572
|
-
|
|
577
|
+
function K(u, m, _) {
|
|
578
|
+
const y = e.messagesByConv[u];
|
|
579
|
+
if (!y) return;
|
|
580
|
+
const h = y.findIndex((p) => p.id === m);
|
|
581
|
+
if (h === -1) return;
|
|
582
|
+
const f = y.slice();
|
|
583
|
+
f[h] = { ...y[h], ..._ }, e.messagesByConv[u] = f;
|
|
573
584
|
}
|
|
574
|
-
function
|
|
575
|
-
const
|
|
576
|
-
if (
|
|
577
|
-
const
|
|
578
|
-
if (
|
|
579
|
-
const
|
|
580
|
-
|
|
581
|
-
(
|
|
582
|
-
), e.conversations =
|
|
585
|
+
function W(u, m) {
|
|
586
|
+
const _ = e.conversations.findIndex((h) => h.id === u);
|
|
587
|
+
if (_ === -1) return;
|
|
588
|
+
const y = e.conversations[_];
|
|
589
|
+
if (m && (!y.last_message_at || m > y.last_message_at)) {
|
|
590
|
+
const h = e.conversations.slice();
|
|
591
|
+
h[_] = { ...y, 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
|
|
586
|
-
return (u.created_at || "").localeCompare(
|
|
596
|
+
function ae(u, m) {
|
|
597
|
+
return (u.created_at || "").localeCompare(m.created_at || "");
|
|
587
598
|
}
|
|
588
|
-
function
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
for (const
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
599
|
+
function oe(u) {
|
|
600
|
+
if (!u || typeof u != "object") return null;
|
|
601
|
+
const m = {}, _ = {};
|
|
602
|
+
for (const [y, h] of Object.entries(u))
|
|
603
|
+
h !== void 0 && (y === "name" || y === "email" ? h != null && String(h).trim() !== "" && (m[y] = h) : (y === "values" || y === "metadata") && h && typeof h == "object" ? Object.assign(_, h) : _[y] = h);
|
|
604
|
+
return Object.keys(_).length && (m.values = _), Object.keys(m).length ? m : null;
|
|
605
|
+
}
|
|
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 y = (/* @__PURE__ */ new Date()).toISOString();
|
|
612
|
+
return !_ || y > _ ? y : new Date(Date.parse(_) + 1).toISOString();
|
|
595
613
|
}
|
|
596
614
|
return {
|
|
597
615
|
state: e,
|
|
598
616
|
start: a,
|
|
599
617
|
destroy: r,
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
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
|
|
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
|
-
},
|
|
633
|
-
function ve(t = "") {
|
|
634
|
-
return t ? ae[t.charCodeAt(0) % ae.length] : ae[0];
|
|
635
|
-
}
|
|
651
|
+
}, le = ["#5B5FEF", "#7C3AED", "#DB2777", "#0891B2", "#D97706", "#059669"];
|
|
636
652
|
function ge(t = "") {
|
|
653
|
+
return t ? le[t.charCodeAt(0) % le.length] : le[0];
|
|
654
|
+
}
|
|
655
|
+
function we(t = "") {
|
|
637
656
|
return t.split(" ").map((e) => e[0] || "").join("").toUpperCase().slice(0, 2);
|
|
638
657
|
}
|
|
639
|
-
function
|
|
658
|
+
function be(t = /* @__PURE__ */ new Date()) {
|
|
640
659
|
return t.toLocaleTimeString("fr-FR", { hour: "2-digit", minute: "2-digit" });
|
|
641
660
|
}
|
|
642
|
-
const
|
|
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: ${
|
|
649
|
-
--wm-g50: ${
|
|
650
|
-
--wm-g100: ${
|
|
651
|
-
--wm-g150: ${
|
|
652
|
-
--wm-g200: ${
|
|
653
|
-
--wm-g300: ${
|
|
654
|
-
--wm-g400: ${
|
|
655
|
-
--wm-g500: ${
|
|
656
|
-
--wm-g700: ${
|
|
657
|
-
--wm-g900: ${
|
|
658
|
-
--wm-a: ${
|
|
659
|
-
--wm-al: ${
|
|
660
|
-
--wm-green: ${
|
|
661
|
-
--wm-red: ${
|
|
662
|
-
--wm-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
|
-
`,
|
|
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
|
-
},
|
|
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
|
-
},
|
|
704
|
-
function
|
|
705
|
-
return l(),
|
|
706
|
-
|
|
707
|
-
default:
|
|
708
|
-
n.peek ? (l(),
|
|
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] =
|
|
717
|
-
e[3] || (e[3] =
|
|
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",
|
|
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] =
|
|
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)) :
|
|
760
|
+
], 32)) : g("", !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(),
|
|
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
|
-
},
|
|
787
|
+
}, b(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, Ge)) : g("", !0)
|
|
769
788
|
])
|
|
770
789
|
]);
|
|
771
790
|
}
|
|
772
|
-
const
|
|
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
|
-
},
|
|
779
|
-
function
|
|
780
|
-
return l(),
|
|
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:
|
|
801
|
+
style: P({ width: n.size + "px", height: n.size + "px" })
|
|
783
802
|
}, [
|
|
784
|
-
n.pulse ? (l(),
|
|
803
|
+
n.pulse ? (l(), c("div", {
|
|
785
804
|
key: 0,
|
|
786
805
|
class: "wm-aiav__pulse",
|
|
787
|
-
style:
|
|
788
|
-
}, null, 4)) :
|
|
806
|
+
style: P({ borderRadius: n.size * 0.32 + 3 + "px" })
|
|
807
|
+
}, null, 4)) : g("", !0),
|
|
789
808
|
i("div", {
|
|
790
|
-
class:
|
|
791
|
-
style:
|
|
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(),
|
|
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,
|
|
838
|
+
])], 8, Xe))
|
|
820
839
|
], 6)
|
|
821
840
|
], 4);
|
|
822
841
|
}
|
|
823
|
-
const
|
|
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" :
|
|
851
|
+
return this.avatarUrl ? "transparent" : ge(this.name);
|
|
833
852
|
},
|
|
834
853
|
initials() {
|
|
835
|
-
return
|
|
854
|
+
return we(this.name);
|
|
836
855
|
}
|
|
837
856
|
}
|
|
838
|
-
},
|
|
839
|
-
function
|
|
840
|
-
return l(),
|
|
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:
|
|
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(),
|
|
868
|
+
n.avatarUrl ? (l(), c("img", {
|
|
850
869
|
key: 0,
|
|
851
870
|
src: n.avatarUrl,
|
|
852
871
|
alt: n.name || ""
|
|
853
|
-
}, null, 8,
|
|
872
|
+
}, null, 8, et)) : (l(), c("span", {
|
|
854
873
|
key: 1,
|
|
855
|
-
style:
|
|
856
|
-
},
|
|
874
|
+
style: P({ fontSize: n.size * 0.36 + "px" })
|
|
875
|
+
}, b(s.initials), 5))
|
|
857
876
|
], 4);
|
|
858
877
|
}
|
|
859
|
-
const
|
|
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" :
|
|
894
|
+
return t.avatar_url ? "transparent" : ge(t.name || "");
|
|
876
895
|
},
|
|
877
896
|
initialsFor(t) {
|
|
878
|
-
return
|
|
897
|
+
return we(t.name || "");
|
|
879
898
|
}
|
|
880
899
|
}
|
|
881
|
-
},
|
|
900
|
+
}, st = {
|
|
882
901
|
key: 0,
|
|
883
902
|
class: "wm-team"
|
|
884
|
-
},
|
|
903
|
+
}, rt = ["src", "alt"], it = { key: 1 }, at = {
|
|
885
904
|
key: 0,
|
|
886
905
|
class: "wm-team__label"
|
|
887
906
|
};
|
|
888
|
-
function
|
|
889
|
-
return s.visible ? (l(),
|
|
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:
|
|
911
|
+
style: P({ width: s.stackWidth + "px" })
|
|
893
912
|
}, [
|
|
894
|
-
(l(!0),
|
|
895
|
-
key:
|
|
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:
|
|
916
|
+
style: P({ left: d * 13 + "px", zIndex: 3 - d, background: s.colorFor(o) })
|
|
898
917
|
}, [
|
|
899
|
-
o.avatar_url ? (l(),
|
|
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,
|
|
922
|
+
}, null, 8, rt)) : (l(), c("span", it, b(s.initialsFor(o)), 1))
|
|
904
923
|
], 4))), 128))
|
|
905
924
|
], 4),
|
|
906
|
-
n.responseLabel ? (l(),
|
|
907
|
-
])) :
|
|
925
|
+
n.responseLabel ? (l(), c("span", at, b(n.responseLabel), 1)) : g("", !0)
|
|
926
|
+
])) : g("", !0);
|
|
908
927
|
}
|
|
909
|
-
const
|
|
928
|
+
const lt = /* @__PURE__ */ B(nt, [["render", ot], ["__scopeId", "data-v-3659b9c1"]]), ct = {
|
|
910
929
|
name: "WmHeader",
|
|
911
|
-
components: { AIAvatar:
|
|
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
|
-
},
|
|
961
|
+
}, dt = { class: "wm-header" }, ut = {
|
|
943
962
|
key: 1,
|
|
944
963
|
style: { width: "30px", height: "30px", "flex-shrink": "0" }
|
|
945
|
-
},
|
|
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
|
-
},
|
|
967
|
+
}, pt = { class: "wm-header__status" }, vt = {
|
|
949
968
|
key: 3,
|
|
950
969
|
class: "wm-header__fill"
|
|
951
|
-
},
|
|
952
|
-
function
|
|
953
|
-
const o =
|
|
954
|
-
return l(),
|
|
955
|
-
n.showBack ? (l(),
|
|
970
|
+
}, yt = { class: "wm-header__actions" };
|
|
971
|
+
function gt(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] = (
|
|
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(),
|
|
976
|
-
n.showIdentity ? (l(),
|
|
977
|
-
i("div",
|
|
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(), $(
|
|
1002
|
+
}, null, 8, ["name", "avatar-url"])) : (l(), $(d, {
|
|
984
1003
|
key: 1,
|
|
985
1004
|
size: 34
|
|
986
1005
|
}))
|
|
987
1006
|
]),
|
|
988
|
-
i("div",
|
|
989
|
-
i("div",
|
|
990
|
-
s.showPresence ? (l(),
|
|
991
|
-
s.hasTeam ? (l(), $(
|
|
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"])) :
|
|
996
|
-
i("span",
|
|
1014
|
+
}, null, 8, ["members", "response-label"])) : g("", !0),
|
|
1015
|
+
i("span", pt, [
|
|
997
1016
|
e[4] || (e[4] = i("span", { class: "wm-header__dot" }, null, -1)),
|
|
998
|
-
se(" " +
|
|
1017
|
+
se(" " + b(s.statusText), 1)
|
|
999
1018
|
])
|
|
1000
|
-
])) :
|
|
1019
|
+
])) : g("", !0)
|
|
1001
1020
|
])
|
|
1002
|
-
], 64)) : (l(),
|
|
1003
|
-
i("div",
|
|
1004
|
-
n.showMore ? (l(),
|
|
1021
|
+
], 64)) : (l(), c("div", vt)),
|
|
1022
|
+
i("div", yt, [
|
|
1023
|
+
n.showMore ? (l(), c("button", {
|
|
1005
1024
|
key: 0,
|
|
1006
1025
|
type: "button",
|
|
1007
|
-
class:
|
|
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] = (
|
|
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)) :
|
|
1036
|
-
n.showClose ? (l(),
|
|
1054
|
+
])], 2)) : g("", !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] = (
|
|
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
|
-
])])) :
|
|
1076
|
+
])])) : g("", !0)
|
|
1058
1077
|
])
|
|
1059
1078
|
]);
|
|
1060
1079
|
}
|
|
1061
|
-
const
|
|
1080
|
+
const wt = /* @__PURE__ */ B(ct, [["render", gt], ["__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
|
-
},
|
|
1086
|
+
}, bt = {
|
|
1068
1087
|
name: "WmOnboarding",
|
|
1069
|
-
components: { AIAvatar:
|
|
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
|
|
1108
|
+
return _e[t] || _e.link;
|
|
1090
1109
|
}
|
|
1091
1110
|
}
|
|
1092
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
1109
|
-
function
|
|
1110
|
-
const o =
|
|
1111
|
-
return l(),
|
|
1112
|
-
i("div",
|
|
1113
|
-
|
|
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",
|
|
1118
|
-
i("div",
|
|
1136
|
+
i("div", At, b(s.heroTitle), 1),
|
|
1137
|
+
i("div", St, b(s.heroSub), 1)
|
|
1119
1138
|
]),
|
|
1120
|
-
n.unreadThreads.length ? (l(),
|
|
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",
|
|
1123
|
-
(l(!0),
|
|
1124
|
-
key:
|
|
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: (
|
|
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",
|
|
1149
|
-
i("span",
|
|
1150
|
-
i("span",
|
|
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,
|
|
1185
|
+
], 8, Tt))), 128))
|
|
1167
1186
|
])
|
|
1168
|
-
])) :
|
|
1169
|
-
n.quickLinks.length ? (l(),
|
|
1187
|
+
])) : g("", !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",
|
|
1172
|
-
(l(!0),
|
|
1173
|
-
key:
|
|
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: (
|
|
1195
|
+
onClick: (C) => t.$emit("select", d)
|
|
1177
1196
|
}, [
|
|
1178
|
-
i("span",
|
|
1179
|
-
(l(),
|
|
1197
|
+
i("span", $t, [
|
|
1198
|
+
(l(), c("svg", Ft, [
|
|
1180
1199
|
i("path", {
|
|
1181
|
-
d: s.iconPath(
|
|
1182
|
-
}, null, 8,
|
|
1200
|
+
d: s.iconPath(d.icon)
|
|
1201
|
+
}, null, 8, jt)
|
|
1183
1202
|
]))
|
|
1184
1203
|
]),
|
|
1185
|
-
i("span",
|
|
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,
|
|
1219
|
+
], 8, Rt))), 128))
|
|
1201
1220
|
])
|
|
1202
|
-
])) :
|
|
1203
|
-
i("div",
|
|
1221
|
+
])) : g("", !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] = (
|
|
1209
|
-
},
|
|
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
|
|
1214
|
-
function
|
|
1232
|
+
const Ht = /* @__PURE__ */ B(bt, [["render", Pt], ["__scopeId", "data-v-bd89bc8f"]]);
|
|
1233
|
+
function zt(t) {
|
|
1215
1234
|
return String(t).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1216
1235
|
}
|
|
1217
|
-
function
|
|
1236
|
+
function Vt(t) {
|
|
1218
1237
|
return /^(https?:\/\/|mailto:|tel:)/i.test(String(t).trim());
|
|
1219
1238
|
}
|
|
1220
|
-
const
|
|
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), `${
|
|
1227
|
-
}), e = e.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (a, r, s) =>
|
|
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
|
|
1248
|
+
function Ce(t) {
|
|
1230
1249
|
if (!t) return "";
|
|
1231
|
-
const e =
|
|
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
|
|
1257
|
+
const C = [];
|
|
1239
1258
|
for (; a < e.length && !/^\s*```\s*$/.test(e[a]); )
|
|
1240
|
-
|
|
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>${
|
|
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
|
|
1268
|
+
const C = [];
|
|
1250
1269
|
for (; a < e.length; ) {
|
|
1251
|
-
const
|
|
1252
|
-
if (!
|
|
1253
|
-
|
|
1270
|
+
const S = /^\s*[-*]\s+(.*)$/.exec(e[a]);
|
|
1271
|
+
if (!S) break;
|
|
1272
|
+
C.push(S[1]), a++;
|
|
1254
1273
|
}
|
|
1255
|
-
const
|
|
1256
|
-
n.push({ type: "block", html: `<ul class="wm-md-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
|
|
1260
|
-
if (
|
|
1261
|
-
const
|
|
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
|
|
1264
|
-
if (!
|
|
1265
|
-
|
|
1282
|
+
const A = /^\s*\d+\.\s+(.*)$/.exec(e[a]);
|
|
1283
|
+
if (!A) break;
|
|
1284
|
+
w.push(A[1]), a++;
|
|
1266
1285
|
}
|
|
1267
|
-
const
|
|
1268
|
-
n.push({ type: "block", html: `<ol class="wm-md-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
|
|
1272
|
-
if (
|
|
1273
|
-
const
|
|
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${
|
|
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
|
|
1287
|
-
|
|
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
|
|
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
|
-
},
|
|
1304
|
-
function
|
|
1305
|
-
return l(),
|
|
1306
|
-
i("div",
|
|
1307
|
-
i("div",
|
|
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",
|
|
1326
|
-
(l(!0),
|
|
1327
|
-
key:
|
|
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",
|
|
1349
|
+
i("div", Jt, b(o.label), 1),
|
|
1331
1350
|
i("div", {
|
|
1332
|
-
class:
|
|
1333
|
-
},
|
|
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
|
|
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
|
-
},
|
|
1372
|
+
}, en = { class: "wm-art wm-art--infoCard" }, tn = {
|
|
1354
1373
|
key: 0,
|
|
1355
1374
|
class: "wm-art__image"
|
|
1356
|
-
},
|
|
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
|
-
},
|
|
1378
|
+
}, ln = {
|
|
1360
1379
|
key: 1,
|
|
1361
1380
|
class: "wm-art__body"
|
|
1362
|
-
},
|
|
1381
|
+
}, cn = {
|
|
1363
1382
|
key: 0,
|
|
1364
1383
|
class: "wm-art__text"
|
|
1365
|
-
},
|
|
1366
|
-
function
|
|
1367
|
-
return l(),
|
|
1368
|
-
n.data.image_url ? (l(),
|
|
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,
|
|
1374
|
-
])) :
|
|
1375
|
-
i("div",
|
|
1376
|
-
i("div",
|
|
1377
|
-
i("div",
|
|
1378
|
-
n.data.subtitle ? (l(),
|
|
1392
|
+
}, null, 8, nn)
|
|
1393
|
+
])) : g("", !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)) : g("", !0)
|
|
1379
1398
|
]),
|
|
1380
|
-
n.data.badge && n.data.badge.label ? (l(),
|
|
1399
|
+
n.data.badge && n.data.badge.label ? (l(), c("span", {
|
|
1381
1400
|
key: 0,
|
|
1382
|
-
class:
|
|
1383
|
-
},
|
|
1401
|
+
class: E(["wm-art__badge", `wm-art__badge--${n.data.badge.tone || "neutral"}`])
|
|
1402
|
+
}, b(n.data.badge.label), 3)) : g("", !0)
|
|
1384
1403
|
]),
|
|
1385
|
-
s.hasBody ? (l(),
|
|
1386
|
-
n.data.body ? (l(),
|
|
1387
|
-
s.fields.length ? (l(!0),
|
|
1388
|
-
key:
|
|
1404
|
+
s.hasBody ? (l(), c("div", ln, [
|
|
1405
|
+
n.data.body ? (l(), c("div", cn, b(n.data.body), 1)) : g("", !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",
|
|
1410
|
+
i("div", dn, b(o.label), 1),
|
|
1392
1411
|
i("div", {
|
|
1393
|
-
class:
|
|
1394
|
-
},
|
|
1395
|
-
]))), 128)) :
|
|
1396
|
-
])) :
|
|
1412
|
+
class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
|
|
1413
|
+
}, b(o.value), 3)
|
|
1414
|
+
]))), 128)) : g("", !0)
|
|
1415
|
+
])) : g("", !0)
|
|
1397
1416
|
]);
|
|
1398
1417
|
}
|
|
1399
|
-
const
|
|
1400
|
-
function
|
|
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
|
|
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
|
|
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
|
-
},
|
|
1459
|
+
}, _n = { class: "wm-art wm-art--ticket" }, pn = { class: "wm-art__head wm-tk__head" }, vn = { class: "wm-art__title wm-tk__title" }, yn = { class: "wm-tk__sub" }, gn = { class: "wm-tk__ref" }, wn = {
|
|
1441
1460
|
key: 0,
|
|
1442
1461
|
class: "wm-art__body"
|
|
1443
|
-
},
|
|
1462
|
+
}, bn = {
|
|
1444
1463
|
key: 0,
|
|
1445
1464
|
class: "wm-tk__text"
|
|
1446
|
-
},
|
|
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
|
|
1451
|
-
return l(),
|
|
1452
|
-
i("div",
|
|
1453
|
-
i("div",
|
|
1454
|
-
i("div",
|
|
1455
|
-
i("div",
|
|
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", yn, [
|
|
1474
|
+
i("div", gn, [
|
|
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,
|
|
1489
|
+
i("span", null, b(n.data.reference), 1)
|
|
1471
1490
|
]),
|
|
1472
1491
|
i("span", {
|
|
1473
|
-
class:
|
|
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(" " +
|
|
1498
|
+
se(" " + b(n.data.status.label), 1)
|
|
1480
1499
|
], 2)
|
|
1481
1500
|
])
|
|
1482
1501
|
]),
|
|
1483
|
-
s.hasBody ? (l(),
|
|
1484
|
-
n.data.body ? (l(),
|
|
1485
|
-
s.fields.length ? (l(!0),
|
|
1486
|
-
key:
|
|
1502
|
+
s.hasBody ? (l(), c("div", wn, [
|
|
1503
|
+
n.data.body ? (l(), c("div", bn, b(n.data.body), 1)) : g("", !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",
|
|
1508
|
+
i("div", kn, b(o.label), 1),
|
|
1490
1509
|
i("div", {
|
|
1491
|
-
class:
|
|
1510
|
+
class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
|
|
1492
1511
|
}, [
|
|
1493
|
-
s.isPriority(o.label) ? (l(),
|
|
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,
|
|
1524
|
-
i("span", null,
|
|
1542
|
+
])], 8, Cn)) : g("", !0),
|
|
1543
|
+
i("span", null, b(o.value), 1)
|
|
1525
1544
|
], 2)
|
|
1526
|
-
]))), 128)) :
|
|
1527
|
-
])) :
|
|
1528
|
-
n.data.created_at ? (l(),
|
|
1545
|
+
]))), 128)) : g("", !0)
|
|
1546
|
+
])) : g("", !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,
|
|
1550
|
-
])) :
|
|
1568
|
+
i("span", null, b(s.formattedDate), 1)
|
|
1569
|
+
])) : g("", !0)
|
|
1551
1570
|
]);
|
|
1552
1571
|
}
|
|
1553
|
-
const
|
|
1554
|
-
form_response:
|
|
1555
|
-
info_card:
|
|
1556
|
-
ticket:
|
|
1557
|
-
},
|
|
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 &&
|
|
1587
|
+
return t && Mn[t] || null;
|
|
1569
1588
|
}
|
|
1570
1589
|
}
|
|
1571
1590
|
};
|
|
1572
|
-
function
|
|
1573
|
-
return s.component ? (l(), $(
|
|
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"])) :
|
|
1595
|
+
}, null, 8, ["data"])) : g("", !0);
|
|
1577
1596
|
}
|
|
1578
|
-
const
|
|
1597
|
+
const Ae = /* @__PURE__ */ B(Tn, [["render", In]]), On = {
|
|
1579
1598
|
name: "WmActionResult",
|
|
1580
|
-
components: { ArtifactRenderer:
|
|
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
|
|
1617
|
+
return Ce(this.detail);
|
|
1599
1618
|
}
|
|
1600
1619
|
}
|
|
1601
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
1642
|
+
}, $n = { class: "wm-result__body" }, Fn = ["innerHTML"], jn = {
|
|
1624
1643
|
key: 0,
|
|
1625
1644
|
class: "wm-result-art"
|
|
1626
1645
|
};
|
|
1627
|
-
function
|
|
1628
|
-
const o =
|
|
1629
|
-
return l(),
|
|
1630
|
-
i("div",
|
|
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:
|
|
1651
|
+
class: E(["wm-result__check", { "wm-result__check--ok": s.ok }])
|
|
1633
1652
|
}, [
|
|
1634
|
-
s.ok ? (l(),
|
|
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(),
|
|
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",
|
|
1659
|
+
i("div", $n, [
|
|
1641
1660
|
i("div", {
|
|
1642
|
-
class:
|
|
1643
|
-
},
|
|
1644
|
-
n.detail ? (l(),
|
|
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,
|
|
1667
|
+
}, null, 8, Fn)) : g("", !0)
|
|
1649
1668
|
])
|
|
1650
1669
|
]),
|
|
1651
|
-
n.artifact ? (l(),
|
|
1652
|
-
|
|
1653
|
-
])) :
|
|
1670
|
+
n.artifact ? (l(), c("div", jn, [
|
|
1671
|
+
H(o, { artifact: n.artifact }, null, 8, ["artifact"])
|
|
1672
|
+
])) : g("", !0)
|
|
1654
1673
|
]);
|
|
1655
1674
|
}
|
|
1656
|
-
const
|
|
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
|
-
},
|
|
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
|
-
},
|
|
1732
|
+
}, Yn = {
|
|
1714
1733
|
key: 0,
|
|
1715
1734
|
class: "wm-att__spin",
|
|
1716
1735
|
"aria-hidden": "true"
|
|
1717
1736
|
};
|
|
1718
|
-
function
|
|
1719
|
-
return l(),
|
|
1720
|
-
class:
|
|
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(),
|
|
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,
|
|
1734
|
-
], 8,
|
|
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,
|
|
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,
|
|
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",
|
|
1770
|
-
i("span",
|
|
1771
|
-
s.sizeLabel ? (l(),
|
|
1788
|
+
i("span", Wn, [
|
|
1789
|
+
i("span", Gn, b(s.displayName), 1),
|
|
1790
|
+
s.sizeLabel ? (l(), c("span", Kn, b(s.sizeLabel), 1)) : g("", !0)
|
|
1772
1791
|
]),
|
|
1773
|
-
r.loading ? (l(),
|
|
1774
|
-
], 8,
|
|
1792
|
+
r.loading ? (l(), c("span", Yn)) : g("", !0)
|
|
1793
|
+
], 8, qn))
|
|
1775
1794
|
], 2);
|
|
1776
1795
|
}
|
|
1777
|
-
const
|
|
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
|
|
1805
|
+
return Ce(this.text);
|
|
1787
1806
|
}
|
|
1788
1807
|
}
|
|
1789
|
-
},
|
|
1790
|
-
function
|
|
1791
|
-
return l(),
|
|
1792
|
-
class:
|
|
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
|
-
|
|
1795
|
-
i("span", { innerHTML: s.rendered }, null, 8,
|
|
1813
|
+
Oe(t.$slots, "default", {}, () => [
|
|
1814
|
+
i("span", { innerHTML: s.rendered }, null, 8, Zn)
|
|
1796
1815
|
], !0)
|
|
1797
1816
|
], 2);
|
|
1798
1817
|
}
|
|
1799
|
-
const
|
|
1800
|
-
function
|
|
1801
|
-
return l(),
|
|
1818
|
+
const ts = /* @__PURE__ */ B(Qn, [["render", es], ["__scopeId", "data-v-c52bb028"]]), 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
|
|
1808
|
-
function
|
|
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
|
|
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
|
-
},
|
|
1837
|
+
}, os = 80, ls = 200, cs = {
|
|
1819
1838
|
name: "WmMessageList",
|
|
1820
|
-
components: { AIAvatar:
|
|
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-${
|
|
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-${
|
|
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:
|
|
1905
|
+
messageKey: ce,
|
|
1887
1906
|
isAtBottom(t) {
|
|
1888
|
-
return t.scrollHeight - t.scrollTop - t.clientHeight <=
|
|
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 <=
|
|
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
|
|
1959
|
+
var C;
|
|
1941
1960
|
const o = r.anchor;
|
|
1942
|
-
if (!((
|
|
1943
|
-
const
|
|
1944
|
-
Math.abs(
|
|
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);
|
|
@@ -1997,12 +2016,13 @@ const ss = {
|
|
|
1997
2016
|
// - The two corners on the *opposite* edge stay rounded
|
|
1998
2017
|
// unless the neighbour is a strictly-wider item (card vs
|
|
1999
2018
|
// bubble) that physically covers them.
|
|
2000
|
-
//
|
|
2001
|
-
//
|
|
2019
|
+
// Bubbles also get a small "tail" on their bottom lateral
|
|
2020
|
+
// corner whenever they're the last item of the cluster
|
|
2021
|
+
// (standalone counts as last) — BL for ai/human, BR for user.
|
|
2002
2022
|
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",
|
|
2004
|
-
let
|
|
2005
|
-
return o ? (r && (
|
|
2023
|
+
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";
|
|
2024
|
+
let w = d, S = d, L = d, A = d;
|
|
2025
|
+
return o ? (r && (S = v, C(r, a) && (w = v)), s && (L = v, C(s, a) && (A = v)), !s && a === "bubble" && (L = v)) : (r && (w = v, C(r, a) && (S = v)), s && (A = v, C(s, a) && (L = v)), !s && a === "bubble" && (A = v)), { tl: w, tr: S, br: L, bl: A };
|
|
2006
2026
|
},
|
|
2007
2027
|
// Inline style emitting the four corner CSS variables. Set on
|
|
2008
2028
|
// `.wm-list__row` so they cascade to Bubble/ActionResult/
|
|
@@ -2025,7 +2045,7 @@ const ss = {
|
|
|
2025
2045
|
const e = t.messages[t.messages.length - 1];
|
|
2026
2046
|
if (!(e != null && e.created_at)) return "";
|
|
2027
2047
|
try {
|
|
2028
|
-
return
|
|
2048
|
+
return be(new Date(e.created_at));
|
|
2029
2049
|
} catch {
|
|
2030
2050
|
return "";
|
|
2031
2051
|
}
|
|
@@ -2049,9 +2069,9 @@ const ss = {
|
|
|
2049
2069
|
return ((e = t == null ? void 0 : t.payload) == null ? void 0 : e.name) || (t == null ? void 0 : t.text_md) || "Action";
|
|
2050
2070
|
},
|
|
2051
2071
|
actionDetail(t) {
|
|
2052
|
-
var n, a, r, s, o,
|
|
2072
|
+
var n, a, r, s, o, d;
|
|
2053
2073
|
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) || ((
|
|
2074
|
+
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
2075
|
},
|
|
2056
2076
|
actionArtifact(t) {
|
|
2057
2077
|
var n, a;
|
|
@@ -2060,7 +2080,7 @@ const ss = {
|
|
|
2060
2080
|
},
|
|
2061
2081
|
systemLabel(t) {
|
|
2062
2082
|
var r, s, o;
|
|
2063
|
-
const e = (r = t == null ? void 0 : t.payload) == null ? void 0 : r.event, n =
|
|
2083
|
+
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
2084
|
return n.replace("{name}", a || "Un agent");
|
|
2065
2085
|
},
|
|
2066
2086
|
scrollToBottom() {
|
|
@@ -2068,123 +2088,126 @@ const ss = {
|
|
|
2068
2088
|
t && (t.scrollTop = t.scrollHeight);
|
|
2069
2089
|
}
|
|
2070
2090
|
}
|
|
2071
|
-
},
|
|
2091
|
+
}, ds = {
|
|
2072
2092
|
key: 0,
|
|
2073
2093
|
class: "wm-list__loadMore",
|
|
2074
2094
|
role: "status",
|
|
2075
2095
|
"aria-live": "polite"
|
|
2076
|
-
},
|
|
2096
|
+
}, us = {
|
|
2077
2097
|
key: 1,
|
|
2078
2098
|
class: "wm-list__historyEnd"
|
|
2079
|
-
},
|
|
2099
|
+
}, hs = {
|
|
2080
2100
|
key: 2,
|
|
2081
2101
|
class: "wm-list__sep"
|
|
2082
|
-
},
|
|
2102
|
+
}, ms = { class: "wm-list__sep-label" }, fs = {
|
|
2083
2103
|
key: 0,
|
|
2084
2104
|
class: "wm-list__sysep"
|
|
2085
|
-
},
|
|
2086
|
-
key: 0,
|
|
2087
|
-
class: "wm-list__role"
|
|
2088
|
-
}, fs = {
|
|
2105
|
+
}, _s = { class: "wm-list__sysep-label" }, ps = {
|
|
2089
2106
|
key: 0,
|
|
2090
2107
|
class: "wm-list__avatarSlot"
|
|
2091
|
-
},
|
|
2108
|
+
}, vs = {
|
|
2092
2109
|
key: 3,
|
|
2093
2110
|
class: "wm-list__body"
|
|
2094
|
-
},
|
|
2111
|
+
}, ys = { key: 0 }, gs = {
|
|
2112
|
+
key: 1,
|
|
2113
|
+
"aria-hidden": "true"
|
|
2114
|
+
}, ws = { key: 2 }, bs = {
|
|
2095
2115
|
key: 3,
|
|
2096
2116
|
class: "wm-list__row wm-list__row--ai fade-up"
|
|
2097
|
-
},
|
|
2098
|
-
function
|
|
2099
|
-
const o =
|
|
2100
|
-
return l(),
|
|
2117
|
+
}, ks = { class: "wm-list__avatarSlot" };
|
|
2118
|
+
function Cs(t, e, n, a, r, s) {
|
|
2119
|
+
const o = I("AIAvatar"), d = I("HumanAvatar"), v = I("ActionResult"), C = I("ArtifactRenderer"), w = I("Bubble"), S = I("AttachmentPreview"), L = I("Typing");
|
|
2120
|
+
return l(), c("div", {
|
|
2101
2121
|
ref: "scrollEl",
|
|
2102
|
-
class:
|
|
2103
|
-
onScrollPassive: e[0] || (e[0] = (...
|
|
2122
|
+
class: E(["wm-list", { "wm-list--silent": r.silentFades }]),
|
|
2123
|
+
onScrollPassive: e[0] || (e[0] = (...A) => s.onScroll && s.onScroll(...A))
|
|
2104
2124
|
}, [
|
|
2105
|
-
n.loadingMore ? (l(),
|
|
2125
|
+
n.loadingMore ? (l(), c("div", ds, [...e[1] || (e[1] = [
|
|
2106
2126
|
i("span", {
|
|
2107
2127
|
class: "wm-list__loadMore-spinner",
|
|
2108
2128
|
"aria-hidden": "true"
|
|
2109
2129
|
}, null, -1),
|
|
2110
2130
|
i("span", { class: "wm-list__loadMore-lbl" }, "Chargement de l'historique…", -1)
|
|
2111
|
-
])])) : s.historyExhausted ? (l(),
|
|
2112
|
-
n.dateLabel ? (l(),
|
|
2131
|
+
])])) : s.historyExhausted ? (l(), c("div", us, "Début de la conversation")) : g("", !0),
|
|
2132
|
+
n.dateLabel ? (l(), c("div", hs, [
|
|
2113
2133
|
e[2] || (e[2] = i("div", { class: "wm-list__line" }, null, -1)),
|
|
2114
|
-
i("span",
|
|
2134
|
+
i("span", ms, b(n.dateLabel), 1),
|
|
2115
2135
|
e[3] || (e[3] = i("div", { class: "wm-list__line" }, null, -1))
|
|
2116
|
-
])) :
|
|
2117
|
-
(l(!0),
|
|
2118
|
-
key:
|
|
2119
|
-
class:
|
|
2136
|
+
])) : g("", !0),
|
|
2137
|
+
(l(!0), c(O, null, F(s.groups, (A, D) => (l(), c("div", {
|
|
2138
|
+
key: A.key,
|
|
2139
|
+
class: E(["wm-list__group", "wm-list__group--" + A.role])
|
|
2120
2140
|
}, [
|
|
2121
|
-
|
|
2141
|
+
A.role === "system" ? (l(), c("div", fs, [
|
|
2122
2142
|
e[4] || (e[4] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1)),
|
|
2123
|
-
i("span",
|
|
2143
|
+
i("span", _s, b(A.systemLabel), 1),
|
|
2124
2144
|
e[5] || (e[5] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
|
|
2125
|
-
])) : (l(),
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
style: H(s.cornersStyle(x, P))
|
|
2145
|
+
])) : (l(), c(O, { key: 1 }, [
|
|
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
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2151
|
+
A.role !== "user" ? (l(), c("div", ps, [
|
|
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(), $(
|
|
2156
|
+
})) : (l(), $(d, {
|
|
2138
2157
|
key: 1,
|
|
2139
|
-
name:
|
|
2140
|
-
"avatar-url":
|
|
2158
|
+
name: A.agentName,
|
|
2159
|
+
"avatar-url": A.agentAvatarUrl,
|
|
2141
2160
|
size: 26
|
|
2142
2161
|
}, null, 8, ["name", "avatar-url"]))
|
|
2143
|
-
], 64)) :
|
|
2144
|
-
])) :
|
|
2145
|
-
|
|
2162
|
+
], 64)) : g("", !0)
|
|
2163
|
+
])) : g("", !0),
|
|
2164
|
+
x.type === "action" && x.payload && x.payload.state !== "pending" ? (l(), $(v, {
|
|
2146
2165
|
key: 1,
|
|
2147
|
-
state:
|
|
2148
|
-
label: s.actionLabel(
|
|
2149
|
-
detail: s.actionDetail(
|
|
2150
|
-
artifact: s.actionArtifact(
|
|
2151
|
-
}, null, 8, ["state", "label", "detail", "artifact"])) : s.artifactOf(
|
|
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(
|
|
2154
|
-
}, null, 8, ["artifact"])) : (l(),
|
|
2155
|
-
|
|
2172
|
+
artifact: s.artifactOf(x)
|
|
2173
|
+
}, null, 8, ["artifact"])) : (l(), c("div", vs, [
|
|
2174
|
+
x.text_md ? (l(), $(w, {
|
|
2156
2175
|
key: 0,
|
|
2157
|
-
role:
|
|
2158
|
-
text:
|
|
2159
|
-
}, null, 8, ["role", "text"])) :
|
|
2160
|
-
s.attachmentsOf(
|
|
2176
|
+
role: A.role,
|
|
2177
|
+
text: x.text_md
|
|
2178
|
+
}, null, 8, ["role", "text"])) : g("", !0),
|
|
2179
|
+
s.attachmentsOf(x).length ? (l(), c("div", {
|
|
2161
2180
|
key: 1,
|
|
2162
|
-
class:
|
|
2181
|
+
class: E(["wm-list__atts", { "wm-list__atts--align-end": A.role === "user" }])
|
|
2163
2182
|
}, [
|
|
2164
|
-
(l(!0),
|
|
2165
|
-
key: `${s.messageKey(
|
|
2166
|
-
attachment:
|
|
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)) :
|
|
2187
|
+
], 2)) : g("", !0)
|
|
2169
2188
|
]))
|
|
2170
2189
|
], 6))), 128)),
|
|
2171
|
-
s.lastTimeOf(
|
|
2172
|
-
key:
|
|
2173
|
-
class:
|
|
2174
|
-
},
|
|
2190
|
+
A.role !== "user" || s.lastTimeOf(A) ? (l(), c("div", {
|
|
2191
|
+
key: 0,
|
|
2192
|
+
class: E(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
|
|
2193
|
+
}, [
|
|
2194
|
+
A.role !== "user" ? (l(), c("span", ys, b(s.roleLabel(A)), 1)) : g("", !0),
|
|
2195
|
+
A.role !== "user" && s.lastTimeOf(A) ? (l(), c("span", gs, "·")) : g("", !0),
|
|
2196
|
+
s.lastTimeOf(A) ? (l(), c("span", ws, b(s.lastTimeOf(A)), 1)) : g("", !0)
|
|
2197
|
+
], 2)) : g("", !0)
|
|
2175
2198
|
], 64))
|
|
2176
2199
|
], 2))), 128)),
|
|
2177
|
-
n.streamingActive ? (l(),
|
|
2178
|
-
i("div",
|
|
2179
|
-
|
|
2200
|
+
n.streamingActive ? (l(), c("div", bs, [
|
|
2201
|
+
i("div", ks, [
|
|
2202
|
+
H(o, { size: 26 })
|
|
2180
2203
|
]),
|
|
2181
|
-
|
|
2182
|
-
])) :
|
|
2204
|
+
H(L)
|
|
2205
|
+
])) : g("", !0)
|
|
2183
2206
|
], 34);
|
|
2184
2207
|
}
|
|
2185
|
-
const
|
|
2186
|
-
function
|
|
2187
|
-
return
|
|
2208
|
+
const As = /* @__PURE__ */ B(cs, [["render", Cs], ["__scopeId", "data-v-02fa95cc"]]), te = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", he = typeof window < "u" && typeof window.MediaRecorder < "u";
|
|
2209
|
+
function Ss() {
|
|
2210
|
+
return he && [
|
|
2188
2211
|
"video/webm;codecs=vp9,opus",
|
|
2189
2212
|
"video/webm;codecs=vp8,opus",
|
|
2190
2213
|
"video/webm",
|
|
@@ -2194,7 +2217,7 @@ function ws() {
|
|
|
2194
2217
|
return (a = (n = window.MediaRecorder).isTypeSupported) == null ? void 0 : a.call(n, e);
|
|
2195
2218
|
}) || "";
|
|
2196
2219
|
}
|
|
2197
|
-
function
|
|
2220
|
+
function Se({ audio: t }) {
|
|
2198
2221
|
return {
|
|
2199
2222
|
video: !0,
|
|
2200
2223
|
audio: !!t,
|
|
@@ -2203,19 +2226,19 @@ function Ce({ audio: t }) {
|
|
|
2203
2226
|
systemAudio: t ? "include" : "exclude"
|
|
2204
2227
|
};
|
|
2205
2228
|
}
|
|
2206
|
-
function
|
|
2229
|
+
function ji(t) {
|
|
2207
2230
|
return t ? t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : "file" : "file";
|
|
2208
2231
|
}
|
|
2209
|
-
async function
|
|
2232
|
+
async function xs() {
|
|
2210
2233
|
if (!te) return null;
|
|
2211
2234
|
let t;
|
|
2212
2235
|
try {
|
|
2213
|
-
t = await navigator.mediaDevices.getDisplayMedia(
|
|
2236
|
+
t = await navigator.mediaDevices.getDisplayMedia(Se({ audio: !1 }));
|
|
2214
2237
|
} catch (e) {
|
|
2215
2238
|
return (e == null ? void 0 : e.name) !== "NotAllowedError" && console.error("[media] screenshot picker", e), null;
|
|
2216
2239
|
}
|
|
2217
2240
|
try {
|
|
2218
|
-
return await
|
|
2241
|
+
return await Ms(t);
|
|
2219
2242
|
} catch (e) {
|
|
2220
2243
|
return console.error("[media] screenshot capture", e), null;
|
|
2221
2244
|
} finally {
|
|
@@ -2224,78 +2247,78 @@ async function bs() {
|
|
|
2224
2247
|
});
|
|
2225
2248
|
}
|
|
2226
2249
|
}
|
|
2227
|
-
async function
|
|
2250
|
+
async function Ms(t) {
|
|
2228
2251
|
const e = document.createElement("video");
|
|
2229
|
-
e.muted = !0, e.playsInline = !0, e.srcObject = t, await e.play(), await new Promise((
|
|
2252
|
+
e.muted = !0, e.playsInline = !0, e.srcObject = t, await e.play(), await new Promise((d) => requestAnimationFrame(d));
|
|
2230
2253
|
const n = e.videoWidth || 1280, a = e.videoHeight || 720, r = document.createElement("canvas");
|
|
2231
2254
|
r.width = n, r.height = a, r.getContext("2d").drawImage(e, 0, 0, n, a);
|
|
2232
|
-
const s = await new Promise((
|
|
2233
|
-
r.toBlob((
|
|
2255
|
+
const s = await new Promise((d, v) => {
|
|
2256
|
+
r.toBlob((C) => C ? d(C) : v(new Error("toBlob failed")), "image/png");
|
|
2234
2257
|
}), o = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
2235
2258
|
return new File([s], `capture-${o}.png`, { type: "image/png" });
|
|
2236
2259
|
}
|
|
2237
|
-
async function
|
|
2238
|
-
var
|
|
2239
|
-
if (!te || !
|
|
2260
|
+
async function Ts(t = {}) {
|
|
2261
|
+
var C;
|
|
2262
|
+
if (!te || !he) return null;
|
|
2240
2263
|
let e;
|
|
2241
2264
|
try {
|
|
2242
|
-
e = await navigator.mediaDevices.getDisplayMedia(
|
|
2243
|
-
} catch (
|
|
2244
|
-
return (
|
|
2265
|
+
e = await navigator.mediaDevices.getDisplayMedia(Se({ audio: !0 }));
|
|
2266
|
+
} catch (w) {
|
|
2267
|
+
return (w == null ? void 0 : w.name) !== "NotAllowedError" && console.error("[media] record picker", w), null;
|
|
2245
2268
|
}
|
|
2246
|
-
const n =
|
|
2269
|
+
const n = Ss();
|
|
2247
2270
|
let a;
|
|
2248
2271
|
try {
|
|
2249
2272
|
a = n ? new window.MediaRecorder(e, { mimeType: n }) : new window.MediaRecorder(e);
|
|
2250
|
-
} catch (
|
|
2251
|
-
return console.error("[media] recorder init",
|
|
2252
|
-
|
|
2273
|
+
} catch (w) {
|
|
2274
|
+
return console.error("[media] recorder init", w), e.getTracks().forEach((S) => {
|
|
2275
|
+
S.stop();
|
|
2253
2276
|
}), null;
|
|
2254
2277
|
}
|
|
2255
2278
|
const r = [];
|
|
2256
2279
|
let s = null, o = !1;
|
|
2257
|
-
a.addEventListener("dataavailable", (
|
|
2258
|
-
|
|
2280
|
+
a.addEventListener("dataavailable", (w) => {
|
|
2281
|
+
w.data && w.data.size > 0 && r.push(w.data);
|
|
2259
2282
|
}), a.addEventListener("stop", () => {
|
|
2260
|
-
var
|
|
2261
|
-
if (s && clearInterval(s), e.getTracks().forEach((
|
|
2262
|
-
|
|
2283
|
+
var w, S;
|
|
2284
|
+
if (s && clearInterval(s), e.getTracks().forEach((L) => {
|
|
2285
|
+
L.stop();
|
|
2263
2286
|
}), r.length) {
|
|
2264
|
-
const
|
|
2265
|
-
(
|
|
2287
|
+
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 });
|
|
2288
|
+
(w = t.onfinalize) == null || w.call(t, N);
|
|
2266
2289
|
} else
|
|
2267
|
-
(
|
|
2268
|
-
}), e.getVideoTracks().forEach((
|
|
2269
|
-
|
|
2290
|
+
(S = t.oncancel) == null || S.call(t);
|
|
2291
|
+
}), e.getVideoTracks().forEach((w) => {
|
|
2292
|
+
w.addEventListener("ended", () => d(), { once: !0 });
|
|
2270
2293
|
});
|
|
2271
|
-
function
|
|
2294
|
+
function d() {
|
|
2272
2295
|
if (!o && (o = !0, a.state !== "inactive"))
|
|
2273
2296
|
try {
|
|
2274
2297
|
a.stop();
|
|
2275
|
-
} catch (
|
|
2276
|
-
console.error("[media] recorder stop",
|
|
2298
|
+
} catch (w) {
|
|
2299
|
+
console.error("[media] recorder stop", w);
|
|
2277
2300
|
}
|
|
2278
2301
|
}
|
|
2279
2302
|
try {
|
|
2280
2303
|
a.start(1e3);
|
|
2281
|
-
} catch (
|
|
2282
|
-
return console.error("[media] recorder start",
|
|
2283
|
-
|
|
2304
|
+
} catch (w) {
|
|
2305
|
+
return console.error("[media] recorder start", w), e.getTracks().forEach((S) => {
|
|
2306
|
+
S.stop();
|
|
2284
2307
|
}), null;
|
|
2285
2308
|
}
|
|
2286
|
-
(
|
|
2287
|
-
const
|
|
2309
|
+
(C = t.onstart) == null || C.call(t);
|
|
2310
|
+
const v = Date.now();
|
|
2288
2311
|
return s = setInterval(() => {
|
|
2289
|
-
var
|
|
2290
|
-
(
|
|
2312
|
+
var w;
|
|
2313
|
+
(w = t.ontick) == null || w.call(t, Date.now() - v);
|
|
2291
2314
|
}, 500), {
|
|
2292
|
-
stop:
|
|
2315
|
+
stop: d,
|
|
2293
2316
|
get state() {
|
|
2294
2317
|
return a.state;
|
|
2295
2318
|
}
|
|
2296
2319
|
};
|
|
2297
2320
|
}
|
|
2298
|
-
const
|
|
2321
|
+
const Is = [
|
|
2299
2322
|
{
|
|
2300
2323
|
action: "file",
|
|
2301
2324
|
label: "Joindre un fichier",
|
|
@@ -2311,7 +2334,7 @@ const As = [
|
|
|
2311
2334
|
label: "Enregistrer l'écran",
|
|
2312
2335
|
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
2336
|
}
|
|
2314
|
-
],
|
|
2337
|
+
], Os = {
|
|
2315
2338
|
name: "WmComposer",
|
|
2316
2339
|
props: {
|
|
2317
2340
|
modelValue: { type: String, default: "" },
|
|
@@ -2334,9 +2357,9 @@ const As = [
|
|
|
2334
2357
|
return !this.disabled && !!this.local.trim();
|
|
2335
2358
|
},
|
|
2336
2359
|
attachItems() {
|
|
2337
|
-
return
|
|
2360
|
+
return Is.map((t) => ({
|
|
2338
2361
|
...t,
|
|
2339
|
-
disabled: t.action === "screenshot" && !te || t.action === "record" && (!te || !
|
|
2362
|
+
disabled: t.action === "screenshot" && !te || t.action === "record" && (!te || !he)
|
|
2340
2363
|
}));
|
|
2341
2364
|
},
|
|
2342
2365
|
recordingElapsedLabel() {
|
|
@@ -2406,13 +2429,13 @@ const As = [
|
|
|
2406
2429
|
},
|
|
2407
2430
|
async captureScreenshot() {
|
|
2408
2431
|
if (this.disabled) return;
|
|
2409
|
-
const t = await
|
|
2432
|
+
const t = await xs();
|
|
2410
2433
|
t && this.$emit("attach", t);
|
|
2411
2434
|
},
|
|
2412
2435
|
async startRecording() {
|
|
2413
2436
|
if (this.recording || this.disabled) return;
|
|
2414
2437
|
this.recordingElapsed = 0;
|
|
2415
|
-
const t = await
|
|
2438
|
+
const t = await Ts({
|
|
2416
2439
|
onstart: () => {
|
|
2417
2440
|
this.recording = !0;
|
|
2418
2441
|
},
|
|
@@ -2437,36 +2460,36 @@ const As = [
|
|
|
2437
2460
|
}
|
|
2438
2461
|
}
|
|
2439
2462
|
}
|
|
2440
|
-
},
|
|
2463
|
+
}, Es = { class: "wm-compose-wrap" }, Bs = {
|
|
2441
2464
|
key: 0,
|
|
2442
2465
|
class: "wm-rec"
|
|
2443
|
-
},
|
|
2466
|
+
}, Ls = { class: "wm-rec__lbl" }, Rs = {
|
|
2444
2467
|
key: 1,
|
|
2445
2468
|
class: "wm-compose__menu",
|
|
2446
2469
|
role: "menu"
|
|
2447
|
-
},
|
|
2470
|
+
}, $s = ["disabled", "onClick"], Fs = { class: "wm-compose__menuIcon" }, js = {
|
|
2448
2471
|
viewBox: "0 0 24 24",
|
|
2449
2472
|
width: "14",
|
|
2450
2473
|
height: "14",
|
|
2451
2474
|
"aria-hidden": "true"
|
|
2452
|
-
},
|
|
2453
|
-
function
|
|
2454
|
-
return l(),
|
|
2455
|
-
r.recording ? (l(),
|
|
2475
|
+
}, Us = ["d"], Ds = ["placeholder", "disabled"], Ns = { class: "wm-compose__actions" }, Ps = ["title", "aria-label", "disabled"], Hs = ["disabled"];
|
|
2476
|
+
function zs(t, e, n, a, r, s) {
|
|
2477
|
+
return l(), c("div", Es, [
|
|
2478
|
+
r.recording ? (l(), c("div", Bs, [
|
|
2456
2479
|
e[8] || (e[8] = i("span", {
|
|
2457
2480
|
class: "wm-rec__dot",
|
|
2458
2481
|
"aria-hidden": "true"
|
|
2459
2482
|
}, null, -1)),
|
|
2460
|
-
i("span",
|
|
2483
|
+
i("span", Ls, "Enregistrement · " + b(s.recordingElapsedLabel), 1),
|
|
2461
2484
|
i("button", {
|
|
2462
2485
|
type: "button",
|
|
2463
2486
|
class: "wm-rec__stop",
|
|
2464
2487
|
onClick: e[0] || (e[0] = (...o) => s.stopRecording && s.stopRecording(...o))
|
|
2465
2488
|
}, "Arrêter")
|
|
2466
|
-
])) :
|
|
2489
|
+
])) : g("", !0),
|
|
2467
2490
|
i("form", {
|
|
2468
|
-
class:
|
|
2469
|
-
onSubmit: e[7] || (e[7] =
|
|
2491
|
+
class: E(["wm-compose", { "has-attach": r.attachOpen }]),
|
|
2492
|
+
onSubmit: e[7] || (e[7] = Y((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]))
|
|
2470
2493
|
}, [
|
|
2471
2494
|
i("input", {
|
|
2472
2495
|
ref: "fileEl",
|
|
@@ -2475,21 +2498,21 @@ function Ds(t, e, n, a, r, s) {
|
|
|
2475
2498
|
multiple: "",
|
|
2476
2499
|
onChange: e[1] || (e[1] = (...o) => s.onFile && s.onFile(...o))
|
|
2477
2500
|
}, null, 544),
|
|
2478
|
-
r.attachOpen ? (l(),
|
|
2501
|
+
r.attachOpen ? (l(), c("div", {
|
|
2479
2502
|
key: 0,
|
|
2480
2503
|
class: "wm-compose__overlay",
|
|
2481
2504
|
onClick: e[2] || (e[2] = (o) => r.attachOpen = !1)
|
|
2482
|
-
})) :
|
|
2483
|
-
r.attachOpen ? (l(),
|
|
2484
|
-
(l(!0),
|
|
2505
|
+
})) : g("", !0),
|
|
2506
|
+
r.attachOpen ? (l(), c("div", Rs, [
|
|
2507
|
+
(l(!0), c(O, null, F(s.attachItems, (o) => (l(), c("button", {
|
|
2485
2508
|
key: o.action,
|
|
2486
2509
|
type: "button",
|
|
2487
2510
|
class: "wm-compose__menuItem",
|
|
2488
2511
|
disabled: o.disabled,
|
|
2489
|
-
onClick: (
|
|
2512
|
+
onClick: (d) => s.onAttachAction(o.action)
|
|
2490
2513
|
}, [
|
|
2491
|
-
i("span",
|
|
2492
|
-
(l(),
|
|
2514
|
+
i("span", Fs, [
|
|
2515
|
+
(l(), c("svg", js, [
|
|
2493
2516
|
i("path", {
|
|
2494
2517
|
d: o.path,
|
|
2495
2518
|
stroke: "currentColor",
|
|
@@ -2497,13 +2520,13 @@ function Ds(t, e, n, a, r, s) {
|
|
|
2497
2520
|
"stroke-linecap": "round",
|
|
2498
2521
|
"stroke-linejoin": "round",
|
|
2499
2522
|
fill: "none"
|
|
2500
|
-
}, null, 8,
|
|
2523
|
+
}, null, 8, Us)
|
|
2501
2524
|
]))
|
|
2502
2525
|
]),
|
|
2503
|
-
i("span", null,
|
|
2504
|
-
], 8,
|
|
2505
|
-
])) :
|
|
2506
|
-
|
|
2526
|
+
i("span", null, b(o.label), 1)
|
|
2527
|
+
], 8, $s))), 128))
|
|
2528
|
+
])) : g("", !0),
|
|
2529
|
+
V(i("textarea", {
|
|
2507
2530
|
ref: "inputEl",
|
|
2508
2531
|
"onUpdate:modelValue": e[3] || (e[3] = (o) => r.local = o),
|
|
2509
2532
|
class: "wm-compose__input",
|
|
@@ -2512,13 +2535,13 @@ function Ds(t, e, n, a, r, s) {
|
|
|
2512
2535
|
disabled: n.disabled,
|
|
2513
2536
|
onKeydown: e[4] || (e[4] = (...o) => s.onKeydown && s.onKeydown(...o)),
|
|
2514
2537
|
onInput: e[5] || (e[5] = (...o) => s.autosize && s.autosize(...o))
|
|
2515
|
-
}, null, 40,
|
|
2538
|
+
}, null, 40, Ds), [
|
|
2516
2539
|
[G, r.local]
|
|
2517
2540
|
]),
|
|
2518
|
-
i("div",
|
|
2541
|
+
i("div", Ns, [
|
|
2519
2542
|
i("button", {
|
|
2520
2543
|
type: "button",
|
|
2521
|
-
class:
|
|
2544
|
+
class: E(["wm-compose__icon", { "is-open": r.attachOpen }]),
|
|
2522
2545
|
title: n.attachLabel,
|
|
2523
2546
|
"aria-label": n.attachLabel,
|
|
2524
2547
|
disabled: r.recording,
|
|
@@ -2537,10 +2560,10 @@ function Ds(t, e, n, a, r, s) {
|
|
|
2537
2560
|
}, [
|
|
2538
2561
|
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
2562
|
], -1)
|
|
2540
|
-
])], 10,
|
|
2563
|
+
])], 10, Ps),
|
|
2541
2564
|
i("button", {
|
|
2542
2565
|
type: "submit",
|
|
2543
|
-
class:
|
|
2566
|
+
class: E(["wm-compose__send", { "is-empty": !s.canSend }]),
|
|
2544
2567
|
disabled: !s.canSend,
|
|
2545
2568
|
"aria-label": "Envoyer"
|
|
2546
2569
|
}, [...e[10] || (e[10] = [
|
|
@@ -2557,12 +2580,12 @@ function Ds(t, e, n, a, r, s) {
|
|
|
2557
2580
|
}, [
|
|
2558
2581
|
i("path", { d: "M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" })
|
|
2559
2582
|
], -1)
|
|
2560
|
-
])], 10,
|
|
2583
|
+
])], 10, Hs)
|
|
2561
2584
|
])
|
|
2562
2585
|
], 34)
|
|
2563
2586
|
]);
|
|
2564
2587
|
}
|
|
2565
|
-
const
|
|
2588
|
+
const Vs = /* @__PURE__ */ B(Os, [["render", zs], ["__scopeId", "data-v-14fa9ec0"]]), qs = {
|
|
2566
2589
|
name: "WmSuggestionChips",
|
|
2567
2590
|
props: {
|
|
2568
2591
|
items: { type: Array, default: () => [] },
|
|
@@ -2579,24 +2602,24 @@ const js = /* @__PURE__ */ L(Ss, [["render", Ds], ["__scopeId", "data-v-14fa9ec0
|
|
|
2579
2602
|
return this.items.map((t) => (t == null ? void 0 : t.label) || (t == null ? void 0 : t.text) || "").join("§");
|
|
2580
2603
|
}
|
|
2581
2604
|
}
|
|
2582
|
-
},
|
|
2583
|
-
function
|
|
2584
|
-
return n.items.length ? (l(),
|
|
2605
|
+
}, Ws = ["onClick"];
|
|
2606
|
+
function Gs(t, e, n, a, r, s) {
|
|
2607
|
+
return n.items.length ? (l(), c("div", {
|
|
2585
2608
|
key: s.batchKey,
|
|
2586
2609
|
class: "wm-chips"
|
|
2587
2610
|
}, [
|
|
2588
|
-
(l(!0),
|
|
2589
|
-
key:
|
|
2611
|
+
(l(!0), c(O, null, F(n.items, (o, d) => (l(), c("button", {
|
|
2612
|
+
key: d,
|
|
2590
2613
|
type: "button",
|
|
2591
2614
|
class: "wm-chip",
|
|
2592
|
-
style:
|
|
2593
|
-
onClick: (
|
|
2594
|
-
},
|
|
2595
|
-
])) :
|
|
2615
|
+
style: P({ animationDelay: n.baseDelay + d * n.stepDelay + "ms" }),
|
|
2616
|
+
onClick: (v) => t.$emit("select", o)
|
|
2617
|
+
}, b(o.label), 13, Ws))), 128))
|
|
2618
|
+
])) : g("", !0);
|
|
2596
2619
|
}
|
|
2597
|
-
const
|
|
2620
|
+
const Ks = /* @__PURE__ */ B(qs, [["render", Gs], ["__scopeId", "data-v-55aa529d"]]), Ys = {
|
|
2598
2621
|
name: "WmApprovalCard",
|
|
2599
|
-
components: { AIAvatar:
|
|
2622
|
+
components: { AIAvatar: J },
|
|
2600
2623
|
props: {
|
|
2601
2624
|
action: { type: String, required: !0 },
|
|
2602
2625
|
detail: { type: String, default: "" },
|
|
@@ -2627,41 +2650,41 @@ const zs = /* @__PURE__ */ L(Ns, [["render", Hs], ["__scopeId", "data-v-55aa529d
|
|
|
2627
2650
|
return ((t = this.rejectCallback) == null ? void 0 : t.label) || "Refuser";
|
|
2628
2651
|
}
|
|
2629
2652
|
}
|
|
2630
|
-
},
|
|
2653
|
+
}, Js = { class: "wm-approval" }, Xs = { class: "wm-approval__head" }, Qs = { class: "wm-approval__icon" }, Zs = { class: "wm-approval__main" }, er = { class: "wm-approval__title" }, tr = {
|
|
2631
2654
|
key: 0,
|
|
2632
2655
|
class: "wm-approval__detail"
|
|
2633
|
-
},
|
|
2634
|
-
function
|
|
2635
|
-
const o =
|
|
2636
|
-
return l(),
|
|
2637
|
-
i("div",
|
|
2638
|
-
i("div",
|
|
2639
|
-
|
|
2656
|
+
}, nr = { class: "wm-approval__actions" };
|
|
2657
|
+
function sr(t, e, n, a, r, s) {
|
|
2658
|
+
const o = I("AIAvatar");
|
|
2659
|
+
return l(), c("div", Js, [
|
|
2660
|
+
i("div", Xs, [
|
|
2661
|
+
i("div", Qs, [
|
|
2662
|
+
H(o, { size: 24 })
|
|
2640
2663
|
]),
|
|
2641
|
-
i("div",
|
|
2642
|
-
i("div",
|
|
2643
|
-
n.detail ? (l(),
|
|
2664
|
+
i("div", Zs, [
|
|
2665
|
+
i("div", er, b(n.action), 1),
|
|
2666
|
+
n.detail ? (l(), c("div", tr, b(n.detail), 1)) : g("", !0)
|
|
2644
2667
|
])
|
|
2645
2668
|
]),
|
|
2646
|
-
i("div",
|
|
2647
|
-
s.rejectId ? (l(),
|
|
2669
|
+
i("div", nr, [
|
|
2670
|
+
s.rejectId ? (l(), c("button", {
|
|
2648
2671
|
key: 0,
|
|
2649
2672
|
type: "button",
|
|
2650
2673
|
class: "wm-approval__btn wm-approval__btn--neutral",
|
|
2651
|
-
onClick: e[0] || (e[0] = (
|
|
2652
|
-
},
|
|
2653
|
-
s.approveId ? (l(),
|
|
2674
|
+
onClick: e[0] || (e[0] = (d) => t.$emit("callback", s.rejectId))
|
|
2675
|
+
}, b(s.rejectLabel), 1)) : g("", !0),
|
|
2676
|
+
s.approveId ? (l(), c("button", {
|
|
2654
2677
|
key: 1,
|
|
2655
2678
|
type: "button",
|
|
2656
2679
|
class: "wm-approval__btn wm-approval__btn--primary",
|
|
2657
|
-
onClick: e[1] || (e[1] = (
|
|
2658
|
-
},
|
|
2680
|
+
onClick: e[1] || (e[1] = (d) => t.$emit("callback", s.approveId))
|
|
2681
|
+
}, b(s.approveLabel), 1)) : g("", !0)
|
|
2659
2682
|
])
|
|
2660
2683
|
]);
|
|
2661
2684
|
}
|
|
2662
|
-
const
|
|
2663
|
-
let
|
|
2664
|
-
const
|
|
2685
|
+
const rr = /* @__PURE__ */ B(Ys, [["render", sr], ["__scopeId", "data-v-b1be139c"]]);
|
|
2686
|
+
let ve = 0;
|
|
2687
|
+
const ir = /* @__PURE__ */ new Set([
|
|
2665
2688
|
"text",
|
|
2666
2689
|
"textarea",
|
|
2667
2690
|
"number",
|
|
@@ -2669,9 +2692,9 @@ const er = /* @__PURE__ */ new Set([
|
|
|
2669
2692
|
"select",
|
|
2670
2693
|
"multiselect",
|
|
2671
2694
|
"date"
|
|
2672
|
-
]),
|
|
2695
|
+
]), ar = {
|
|
2673
2696
|
name: "WmFormCard",
|
|
2674
|
-
components: { AIAvatar:
|
|
2697
|
+
components: { AIAvatar: J },
|
|
2675
2698
|
props: {
|
|
2676
2699
|
form: { type: Object, required: !0 },
|
|
2677
2700
|
readOnly: { type: Boolean, default: !1 },
|
|
@@ -2679,8 +2702,8 @@ const er = /* @__PURE__ */ new Set([
|
|
|
2679
2702
|
},
|
|
2680
2703
|
emits: ["submit"],
|
|
2681
2704
|
data() {
|
|
2682
|
-
return
|
|
2683
|
-
_uid:
|
|
2705
|
+
return ve += 1, {
|
|
2706
|
+
_uid: ve,
|
|
2684
2707
|
values: {},
|
|
2685
2708
|
busy: !1,
|
|
2686
2709
|
error: ""
|
|
@@ -2692,7 +2715,7 @@ const er = /* @__PURE__ */ new Set([
|
|
|
2692
2715
|
// douteux.
|
|
2693
2716
|
normalizedFields() {
|
|
2694
2717
|
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) || !
|
|
2718
|
+
return (Array.isArray((e = this.form) == null ? void 0 : e.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !ir.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
|
|
2696
2719
|
}
|
|
2697
2720
|
},
|
|
2698
2721
|
created() {
|
|
@@ -2743,163 +2766,163 @@ const er = /* @__PURE__ */ new Set([
|
|
|
2743
2766
|
}
|
|
2744
2767
|
}
|
|
2745
2768
|
}
|
|
2746
|
-
},
|
|
2769
|
+
}, or = { class: "wm-form" }, lr = { class: "wm-form__head" }, cr = { class: "wm-form__icon" }, dr = { class: "wm-form__main" }, ur = { class: "wm-form__title" }, hr = {
|
|
2747
2770
|
key: 0,
|
|
2748
2771
|
class: "wm-form__detail"
|
|
2749
|
-
},
|
|
2772
|
+
}, mr = ["for"], fr = {
|
|
2750
2773
|
key: 0,
|
|
2751
2774
|
class: "wm-form__req",
|
|
2752
2775
|
"aria-hidden": "true"
|
|
2753
|
-
},
|
|
2776
|
+
}, _r = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], pr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], vr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], yr = ["id", "onUpdate:modelValue", "required", "disabled"], gr = {
|
|
2754
2777
|
key: 4,
|
|
2755
2778
|
class: "wm-form__bool"
|
|
2756
|
-
},
|
|
2779
|
+
}, wr = ["id", "onUpdate:modelValue", "disabled"], br = ["id", "onUpdate:modelValue", "required", "disabled"], kr = {
|
|
2757
2780
|
value: "",
|
|
2758
2781
|
disabled: ""
|
|
2759
|
-
},
|
|
2782
|
+
}, Cr = ["value"], Ar = {
|
|
2760
2783
|
key: 6,
|
|
2761
2784
|
class: "wm-form__multi"
|
|
2762
|
-
},
|
|
2785
|
+
}, Sr = ["value", "checked", "disabled", "onChange"], xr = {
|
|
2763
2786
|
key: 0,
|
|
2764
2787
|
class: "wm-form__err"
|
|
2765
|
-
},
|
|
2788
|
+
}, Mr = ["disabled"], Tr = {
|
|
2766
2789
|
key: 0,
|
|
2767
2790
|
class: "wm-form__spinner",
|
|
2768
2791
|
"aria-hidden": "true"
|
|
2769
|
-
},
|
|
2792
|
+
}, Ir = {
|
|
2770
2793
|
key: 2,
|
|
2771
2794
|
class: "wm-form__doneLbl"
|
|
2772
2795
|
};
|
|
2773
|
-
function
|
|
2774
|
-
const o =
|
|
2775
|
-
return l(),
|
|
2776
|
-
i("div",
|
|
2777
|
-
i("div",
|
|
2778
|
-
|
|
2796
|
+
function Or(t, e, n, a, r, s) {
|
|
2797
|
+
const o = I("AIAvatar");
|
|
2798
|
+
return l(), c("div", or, [
|
|
2799
|
+
i("div", lr, [
|
|
2800
|
+
i("div", cr, [
|
|
2801
|
+
H(o, { size: 24 })
|
|
2779
2802
|
]),
|
|
2780
|
-
i("div",
|
|
2781
|
-
i("div",
|
|
2782
|
-
n.form.description ? (l(),
|
|
2803
|
+
i("div", dr, [
|
|
2804
|
+
i("div", ur, b(n.form.title || "Formulaire"), 1),
|
|
2805
|
+
n.form.description ? (l(), c("div", hr, b(n.form.description), 1)) : g("", !0)
|
|
2783
2806
|
])
|
|
2784
2807
|
]),
|
|
2785
2808
|
i("form", {
|
|
2786
2809
|
class: "wm-form__body",
|
|
2787
|
-
onSubmit: e[0] || (e[0] =
|
|
2810
|
+
onSubmit: e[0] || (e[0] = Y((...d) => s.onSubmit && s.onSubmit(...d), ["prevent"]))
|
|
2788
2811
|
}, [
|
|
2789
|
-
(l(!0),
|
|
2790
|
-
key:
|
|
2812
|
+
(l(!0), c(O, null, F(s.normalizedFields, (d) => (l(), c("div", {
|
|
2813
|
+
key: d.key,
|
|
2791
2814
|
class: "wm-form__field"
|
|
2792
2815
|
}, [
|
|
2793
2816
|
i("label", {
|
|
2794
|
-
for: `wm-f-${r._uid}-${
|
|
2817
|
+
for: `wm-f-${r._uid}-${d.key}`,
|
|
2795
2818
|
class: "wm-form__label"
|
|
2796
2819
|
}, [
|
|
2797
|
-
se(
|
|
2798
|
-
|
|
2799
|
-
], 8,
|
|
2800
|
-
|
|
2820
|
+
se(b(d.label), 1),
|
|
2821
|
+
d.required ? (l(), c("span", fr, "*")) : g("", !0)
|
|
2822
|
+
], 8, mr),
|
|
2823
|
+
d.type === "text" ? V((l(), c("input", {
|
|
2801
2824
|
key: 0,
|
|
2802
|
-
id: `wm-f-${r._uid}-${
|
|
2803
|
-
"onUpdate:modelValue": (
|
|
2825
|
+
id: `wm-f-${r._uid}-${d.key}`,
|
|
2826
|
+
"onUpdate:modelValue": (v) => r.values[d.key] = v,
|
|
2804
2827
|
type: "text",
|
|
2805
2828
|
class: "wm-form__input",
|
|
2806
|
-
placeholder:
|
|
2807
|
-
required:
|
|
2829
|
+
placeholder: d.placeholder || "",
|
|
2830
|
+
required: d.required,
|
|
2808
2831
|
disabled: n.readOnly || r.busy
|
|
2809
|
-
}, null, 8,
|
|
2810
|
-
[G, r.values[
|
|
2811
|
-
]) :
|
|
2832
|
+
}, null, 8, _r)), [
|
|
2833
|
+
[G, r.values[d.key]]
|
|
2834
|
+
]) : d.type === "textarea" ? V((l(), c("textarea", {
|
|
2812
2835
|
key: 1,
|
|
2813
|
-
id: `wm-f-${r._uid}-${
|
|
2814
|
-
"onUpdate:modelValue": (
|
|
2836
|
+
id: `wm-f-${r._uid}-${d.key}`,
|
|
2837
|
+
"onUpdate:modelValue": (v) => r.values[d.key] = v,
|
|
2815
2838
|
class: "wm-form__textarea",
|
|
2816
2839
|
rows: "3",
|
|
2817
|
-
placeholder:
|
|
2818
|
-
required:
|
|
2840
|
+
placeholder: d.placeholder || "",
|
|
2841
|
+
required: d.required,
|
|
2819
2842
|
disabled: n.readOnly || r.busy
|
|
2820
|
-
}, null, 8,
|
|
2821
|
-
[G, r.values[
|
|
2822
|
-
]) :
|
|
2843
|
+
}, null, 8, pr)), [
|
|
2844
|
+
[G, r.values[d.key]]
|
|
2845
|
+
]) : d.type === "number" ? V((l(), c("input", {
|
|
2823
2846
|
key: 2,
|
|
2824
|
-
id: `wm-f-${r._uid}-${
|
|
2825
|
-
"onUpdate:modelValue": (
|
|
2847
|
+
id: `wm-f-${r._uid}-${d.key}`,
|
|
2848
|
+
"onUpdate:modelValue": (v) => r.values[d.key] = v,
|
|
2826
2849
|
type: "number",
|
|
2827
2850
|
class: "wm-form__input",
|
|
2828
|
-
placeholder:
|
|
2829
|
-
required:
|
|
2851
|
+
placeholder: d.placeholder || "",
|
|
2852
|
+
required: d.required,
|
|
2830
2853
|
disabled: n.readOnly || r.busy
|
|
2831
|
-
}, null, 8,
|
|
2854
|
+
}, null, 8, vr)), [
|
|
2832
2855
|
[
|
|
2833
2856
|
G,
|
|
2834
|
-
r.values[
|
|
2857
|
+
r.values[d.key],
|
|
2835
2858
|
void 0,
|
|
2836
2859
|
{ number: !0 }
|
|
2837
2860
|
]
|
|
2838
|
-
]) :
|
|
2861
|
+
]) : d.type === "date" ? V((l(), c("input", {
|
|
2839
2862
|
key: 3,
|
|
2840
|
-
id: `wm-f-${r._uid}-${
|
|
2841
|
-
"onUpdate:modelValue": (
|
|
2863
|
+
id: `wm-f-${r._uid}-${d.key}`,
|
|
2864
|
+
"onUpdate:modelValue": (v) => r.values[d.key] = v,
|
|
2842
2865
|
type: "date",
|
|
2843
2866
|
class: "wm-form__input",
|
|
2844
|
-
required:
|
|
2867
|
+
required: d.required,
|
|
2845
2868
|
disabled: n.readOnly || r.busy
|
|
2846
|
-
}, null, 8,
|
|
2847
|
-
[G, r.values[
|
|
2848
|
-
]) :
|
|
2849
|
-
|
|
2850
|
-
id: `wm-f-${r._uid}-${
|
|
2851
|
-
"onUpdate:modelValue": (
|
|
2869
|
+
}, null, 8, yr)), [
|
|
2870
|
+
[G, r.values[d.key]]
|
|
2871
|
+
]) : d.type === "boolean" ? (l(), c("label", gr, [
|
|
2872
|
+
V(i("input", {
|
|
2873
|
+
id: `wm-f-${r._uid}-${d.key}`,
|
|
2874
|
+
"onUpdate:modelValue": (v) => r.values[d.key] = v,
|
|
2852
2875
|
type: "checkbox",
|
|
2853
2876
|
disabled: n.readOnly || r.busy
|
|
2854
|
-
}, null, 8,
|
|
2855
|
-
[
|
|
2877
|
+
}, null, 8, wr), [
|
|
2878
|
+
[Ee, r.values[d.key]]
|
|
2856
2879
|
]),
|
|
2857
|
-
i("span", null,
|
|
2858
|
-
])) :
|
|
2880
|
+
i("span", null, b(d.placeholder || "Oui"), 1)
|
|
2881
|
+
])) : d.type === "select" ? V((l(), c("select", {
|
|
2859
2882
|
key: 5,
|
|
2860
|
-
id: `wm-f-${r._uid}-${
|
|
2861
|
-
"onUpdate:modelValue": (
|
|
2883
|
+
id: `wm-f-${r._uid}-${d.key}`,
|
|
2884
|
+
"onUpdate:modelValue": (v) => r.values[d.key] = v,
|
|
2862
2885
|
class: "wm-form__select",
|
|
2863
|
-
required:
|
|
2886
|
+
required: d.required,
|
|
2864
2887
|
disabled: n.readOnly || r.busy
|
|
2865
2888
|
}, [
|
|
2866
|
-
i("option",
|
|
2867
|
-
(l(!0),
|
|
2868
|
-
key:
|
|
2869
|
-
value:
|
|
2870
|
-
},
|
|
2871
|
-
], 8,
|
|
2872
|
-
[
|
|
2873
|
-
]) :
|
|
2874
|
-
(l(!0),
|
|
2875
|
-
key:
|
|
2889
|
+
i("option", kr, b(d.placeholder || "Choisir…"), 1),
|
|
2890
|
+
(l(!0), c(O, null, F(d.options, (v) => (l(), c("option", {
|
|
2891
|
+
key: v.value,
|
|
2892
|
+
value: v.value
|
|
2893
|
+
}, b(v.label), 9, Cr))), 128))
|
|
2894
|
+
], 8, br)), [
|
|
2895
|
+
[Be, r.values[d.key]]
|
|
2896
|
+
]) : d.type === "multiselect" ? (l(), c("div", Ar, [
|
|
2897
|
+
(l(!0), c(O, null, F(d.options, (v) => (l(), c("label", {
|
|
2898
|
+
key: v.value,
|
|
2876
2899
|
class: "wm-form__multiItem"
|
|
2877
2900
|
}, [
|
|
2878
2901
|
i("input", {
|
|
2879
2902
|
type: "checkbox",
|
|
2880
|
-
value:
|
|
2881
|
-
checked: Array.isArray(r.values[
|
|
2903
|
+
value: v.value,
|
|
2904
|
+
checked: Array.isArray(r.values[d.key]) && r.values[d.key].includes(v.value),
|
|
2882
2905
|
disabled: n.readOnly || r.busy,
|
|
2883
|
-
onChange: (
|
|
2884
|
-
}, null, 40,
|
|
2885
|
-
i("span", null,
|
|
2906
|
+
onChange: (C) => s.toggleMulti(d.key, v.value, C.target.checked)
|
|
2907
|
+
}, null, 40, Sr),
|
|
2908
|
+
i("span", null, b(v.label), 1)
|
|
2886
2909
|
]))), 128))
|
|
2887
|
-
])) :
|
|
2910
|
+
])) : g("", !0)
|
|
2888
2911
|
]))), 128)),
|
|
2889
|
-
r.error ? (l(),
|
|
2890
|
-
n.readOnly ? (l(),
|
|
2912
|
+
r.error ? (l(), c("div", xr, b(r.error), 1)) : g("", !0),
|
|
2913
|
+
n.readOnly ? (l(), c("div", Ir, "Réponse envoyée")) : (l(), c("button", {
|
|
2891
2914
|
key: 1,
|
|
2892
2915
|
type: "submit",
|
|
2893
2916
|
class: "wm-form__submit",
|
|
2894
2917
|
disabled: r.busy
|
|
2895
2918
|
}, [
|
|
2896
|
-
r.busy ? (l(),
|
|
2897
|
-
i("span", null,
|
|
2898
|
-
], 8,
|
|
2919
|
+
r.busy ? (l(), c("span", Tr)) : g("", !0),
|
|
2920
|
+
i("span", null, b(r.busy ? "Envoi…" : n.form.submit_label || "Envoyer"), 1)
|
|
2921
|
+
], 8, Mr))
|
|
2899
2922
|
], 32)
|
|
2900
2923
|
]);
|
|
2901
2924
|
}
|
|
2902
|
-
const
|
|
2925
|
+
const Er = /* @__PURE__ */ B(ar, [["render", Or], ["__scopeId", "data-v-64b40f76"]]), Br = {
|
|
2903
2926
|
name: "WmFeedback",
|
|
2904
2927
|
props: {
|
|
2905
2928
|
busy: { type: Boolean, default: !1 },
|
|
@@ -2923,43 +2946,43 @@ const xr = /* @__PURE__ */ L(tr, [["render", Sr], ["__scopeId", "data-v-64b40f76
|
|
|
2923
2946
|
!this.sel || this.busy || this.$emit("submit", { rating: this.sel });
|
|
2924
2947
|
}
|
|
2925
2948
|
}
|
|
2926
|
-
},
|
|
2949
|
+
}, Lr = { class: "wm-fb" }, Rr = { class: "wm-fb__row" }, $r = ["onClick"], Fr = { class: "wm-fb__emoji" }, jr = { class: "wm-fb__label" }, Ur = ["disabled"], Dr = {
|
|
2927
2950
|
key: 1,
|
|
2928
2951
|
class: "wm-fb__done"
|
|
2929
2952
|
};
|
|
2930
|
-
function
|
|
2931
|
-
return l(),
|
|
2932
|
-
n.done ? (l(),
|
|
2933
|
-
|
|
2934
|
-
])])) : (l(),
|
|
2953
|
+
function Nr(t, e, n, a, r, s) {
|
|
2954
|
+
return l(), c("div", Lr, [
|
|
2955
|
+
n.done ? (l(), c("div", Dr, [...e[3] || (e[3] = [
|
|
2956
|
+
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)
|
|
2957
|
+
])])) : (l(), c(O, { key: 0 }, [
|
|
2935
2958
|
e[1] || (e[1] = i("div", { class: "wm-fb__title" }, "Comment s'est passée cette conversation ?", -1)),
|
|
2936
2959
|
e[2] || (e[2] = i("div", { class: "wm-fb__sub" }, "Votre avis nous aide à améliorer l'assistant.", -1)),
|
|
2937
|
-
i("div",
|
|
2938
|
-
(l(!0),
|
|
2960
|
+
i("div", Rr, [
|
|
2961
|
+
(l(!0), c(O, null, F(r.options, (o) => (l(), c("button", {
|
|
2939
2962
|
key: o.v,
|
|
2940
2963
|
type: "button",
|
|
2941
|
-
class:
|
|
2942
|
-
onClick: (
|
|
2964
|
+
class: E(["wm-fb__opt", { "is-selected": r.sel === o.v }]),
|
|
2965
|
+
onClick: (d) => r.sel = o.v
|
|
2943
2966
|
}, [
|
|
2944
|
-
i("span",
|
|
2945
|
-
i("span",
|
|
2946
|
-
], 10,
|
|
2967
|
+
i("span", Fr, b(o.e), 1),
|
|
2968
|
+
i("span", jr, b(o.l), 1)
|
|
2969
|
+
], 10, $r))), 128))
|
|
2947
2970
|
]),
|
|
2948
2971
|
i("button", {
|
|
2949
2972
|
type: "button",
|
|
2950
2973
|
class: "wm-fb__send",
|
|
2951
2974
|
disabled: !r.sel || n.busy,
|
|
2952
2975
|
onClick: e[0] || (e[0] = (...o) => s.onSend && s.onSend(...o))
|
|
2953
|
-
},
|
|
2976
|
+
}, b(n.busy ? "Envoi…" : "Envoyer mon avis"), 9, Ur)
|
|
2954
2977
|
], 64))
|
|
2955
2978
|
]);
|
|
2956
2979
|
}
|
|
2957
|
-
const
|
|
2958
|
-
function
|
|
2980
|
+
const Pr = /* @__PURE__ */ B(Br, [["render", Nr], ["__scopeId", "data-v-6f45ff3b"]]);
|
|
2981
|
+
function Hr(t) {
|
|
2959
2982
|
const e = new Date(t);
|
|
2960
2983
|
return e.setHours(0, 0, 0, 0), e;
|
|
2961
2984
|
}
|
|
2962
|
-
const
|
|
2985
|
+
const zr = {
|
|
2963
2986
|
name: "WmHistoryDrawer",
|
|
2964
2987
|
props: {
|
|
2965
2988
|
conversations: { type: Array, default: () => [] },
|
|
@@ -2993,7 +3016,7 @@ const Dr = {
|
|
|
2993
3016
|
) : this.normalized;
|
|
2994
3017
|
},
|
|
2995
3018
|
groups() {
|
|
2996
|
-
const e =
|
|
3019
|
+
const e = Hr(/* @__PURE__ */ new Date()).getTime(), n = e - 6 * 864e5, a = [], r = [], s = [];
|
|
2997
3020
|
for (const o of this.filtered) {
|
|
2998
3021
|
if (!o.stamp) {
|
|
2999
3022
|
s.push(o);
|
|
@@ -3011,29 +3034,29 @@ const Dr = {
|
|
|
3011
3034
|
return this.filtered.length > 0;
|
|
3012
3035
|
}
|
|
3013
3036
|
}
|
|
3014
|
-
},
|
|
3037
|
+
}, Vr = { class: "wm-hd" }, qr = {
|
|
3015
3038
|
class: "wm-hd__panel",
|
|
3016
3039
|
role: "dialog",
|
|
3017
3040
|
"aria-label": "Vos discussions"
|
|
3018
|
-
},
|
|
3041
|
+
}, Wr = { class: "wm-hd__head" }, Gr = { class: "wm-hd__top" }, Kr = { class: "wm-hd__search" }, Yr = { class: "wm-hd__list" }, Jr = {
|
|
3019
3042
|
key: 0,
|
|
3020
3043
|
class: "wm-hd__group"
|
|
3021
|
-
},
|
|
3044
|
+
}, Xr = { class: "wm-hd__groupLabel" }, Qr = { class: "wm-hd__rows" }, Zr = ["onClick"], ei = { class: "wm-hd__rowIcon" }, ti = {
|
|
3022
3045
|
key: 0,
|
|
3023
3046
|
class: "wm-hd__rowDot",
|
|
3024
3047
|
"aria-label": "Message non lu"
|
|
3025
|
-
},
|
|
3048
|
+
}, ni = { class: "wm-hd__rowBody" }, si = { class: "wm-hd__rowTop" }, ri = { class: "wm-hd__rowTitle" }, ii = { class: "wm-hd__rowPreview" }, ai = {
|
|
3026
3049
|
key: 0,
|
|
3027
3050
|
class: "wm-hd__empty"
|
|
3028
3051
|
};
|
|
3029
|
-
function
|
|
3030
|
-
return l(),
|
|
3052
|
+
function oi(t, e, n, a, r, s) {
|
|
3053
|
+
return l(), c("div", Vr, [
|
|
3031
3054
|
i("div", {
|
|
3032
3055
|
class: "wm-hd__scrim",
|
|
3033
3056
|
onClick: e[0] || (e[0] = (o) => t.$emit("close"))
|
|
3034
3057
|
}),
|
|
3035
|
-
i("aside",
|
|
3036
|
-
i("div",
|
|
3058
|
+
i("aside", qr, [
|
|
3059
|
+
i("div", Wr, [
|
|
3037
3060
|
e[5] || (e[5] = i("div", { class: "wm-hd__heading" }, [
|
|
3038
3061
|
i("div", { class: "wm-hd__title" }, "Vos discussions"),
|
|
3039
3062
|
i("div", { class: "wm-hd__sub" }, "Reprenez là où vous en étiez.")
|
|
@@ -3059,7 +3082,7 @@ function ni(t, e, n, a, r, s) {
|
|
|
3059
3082
|
], -1)
|
|
3060
3083
|
])])
|
|
3061
3084
|
]),
|
|
3062
|
-
i("div",
|
|
3085
|
+
i("div", Gr, [
|
|
3063
3086
|
i("button", {
|
|
3064
3087
|
type: "button",
|
|
3065
3088
|
class: "wm-hd__new",
|
|
@@ -3082,7 +3105,7 @@ function ni(t, e, n, a, r, s) {
|
|
|
3082
3105
|
], -1),
|
|
3083
3106
|
i("span", null, "Démarrer un nouveau fil", -1)
|
|
3084
3107
|
])]),
|
|
3085
|
-
i("div",
|
|
3108
|
+
i("div", Kr, [
|
|
3086
3109
|
e[7] || (e[7] = i("span", { class: "wm-hd__searchIcon" }, [
|
|
3087
3110
|
i("svg", {
|
|
3088
3111
|
width: "12",
|
|
@@ -3098,7 +3121,7 @@ function ni(t, e, n, a, r, s) {
|
|
|
3098
3121
|
i("path", { d: "M21 21l-4.35-4.35M11 17a6 6 0 100-12 6 6 0 000 12z" })
|
|
3099
3122
|
])
|
|
3100
3123
|
], -1)),
|
|
3101
|
-
|
|
3124
|
+
V(i("input", {
|
|
3102
3125
|
"onUpdate:modelValue": e[3] || (e[3] = (o) => r.query = o),
|
|
3103
3126
|
type: "text",
|
|
3104
3127
|
placeholder: "Rechercher dans vos messages",
|
|
@@ -3108,23 +3131,23 @@ function ni(t, e, n, a, r, s) {
|
|
|
3108
3131
|
])
|
|
3109
3132
|
])
|
|
3110
3133
|
]),
|
|
3111
|
-
i("div",
|
|
3112
|
-
(l(!0),
|
|
3134
|
+
i("div", Yr, [
|
|
3135
|
+
(l(!0), c(O, null, F(s.groups, (o) => (l(), c(O, {
|
|
3113
3136
|
key: o.key
|
|
3114
3137
|
}, [
|
|
3115
|
-
o.items.length ? (l(),
|
|
3116
|
-
i("div",
|
|
3117
|
-
i("div",
|
|
3118
|
-
(l(!0),
|
|
3119
|
-
key:
|
|
3138
|
+
o.items.length ? (l(), c("div", Jr, [
|
|
3139
|
+
i("div", Xr, b(o.label), 1),
|
|
3140
|
+
i("div", Qr, [
|
|
3141
|
+
(l(!0), c(O, null, F(o.items, (d) => (l(), c("button", {
|
|
3142
|
+
key: d.id,
|
|
3120
3143
|
type: "button",
|
|
3121
|
-
class:
|
|
3122
|
-
"wm-hd__row--active":
|
|
3123
|
-
"wm-hd__row--unread":
|
|
3144
|
+
class: E(["wm-hd__row", {
|
|
3145
|
+
"wm-hd__row--active": d.id === n.activeId,
|
|
3146
|
+
"wm-hd__row--unread": d.unread
|
|
3124
3147
|
}]),
|
|
3125
|
-
onClick: (
|
|
3148
|
+
onClick: (v) => t.$emit("pick", d)
|
|
3126
3149
|
}, [
|
|
3127
|
-
i("div",
|
|
3150
|
+
i("div", ei, [
|
|
3128
3151
|
e[8] || (e[8] = i("svg", {
|
|
3129
3152
|
width: "11",
|
|
3130
3153
|
height: "11",
|
|
@@ -3138,24 +3161,24 @@ function ni(t, e, n, a, r, s) {
|
|
|
3138
3161
|
opacity: "0.92"
|
|
3139
3162
|
})
|
|
3140
3163
|
], -1)),
|
|
3141
|
-
|
|
3164
|
+
d.unread ? (l(), c("span", ti)) : g("", !0)
|
|
3142
3165
|
]),
|
|
3143
|
-
i("div",
|
|
3144
|
-
i("div",
|
|
3145
|
-
i("span",
|
|
3166
|
+
i("div", ni, [
|
|
3167
|
+
i("div", si, [
|
|
3168
|
+
i("span", ri, b(d.title), 1)
|
|
3146
3169
|
]),
|
|
3147
|
-
i("div",
|
|
3170
|
+
i("div", ii, b(d.preview || "Aucun message"), 1)
|
|
3148
3171
|
])
|
|
3149
|
-
], 10,
|
|
3172
|
+
], 10, Zr))), 128))
|
|
3150
3173
|
])
|
|
3151
|
-
])) :
|
|
3174
|
+
])) : g("", !0)
|
|
3152
3175
|
], 64))), 128)),
|
|
3153
|
-
s.hasAny ?
|
|
3176
|
+
s.hasAny ? g("", !0) : (l(), c("div", ai, " Aucun fil pour le moment. "))
|
|
3154
3177
|
])
|
|
3155
3178
|
])
|
|
3156
3179
|
]);
|
|
3157
3180
|
}
|
|
3158
|
-
const
|
|
3181
|
+
const li = /* @__PURE__ */ B(zr, [["render", oi], ["__scopeId", "data-v-1259e822"]]), ci = {
|
|
3159
3182
|
name: "WmMoreMenu",
|
|
3160
3183
|
props: {
|
|
3161
3184
|
canRename: { type: Boolean, default: !0 },
|
|
@@ -3182,18 +3205,18 @@ const si = /* @__PURE__ */ L(Dr, [["render", ni], ["__scopeId", "data-v-1259e822
|
|
|
3182
3205
|
this.notifOn = !this.notifOn, this.$emit("notif-toggle", this.notifOn);
|
|
3183
3206
|
}
|
|
3184
3207
|
}
|
|
3185
|
-
},
|
|
3208
|
+
}, di = { class: "wm-mm" }, ui = {
|
|
3186
3209
|
class: "wm-mm__pop",
|
|
3187
3210
|
role: "menu"
|
|
3188
|
-
},
|
|
3189
|
-
function
|
|
3190
|
-
return l(),
|
|
3211
|
+
}, hi = { class: "wm-mm__section" }, mi = { class: "wm-mm__section" }, fi = { class: "wm-mm__section" };
|
|
3212
|
+
function _i(t, e, n, a, r, s) {
|
|
3213
|
+
return l(), c("div", di, [
|
|
3191
3214
|
i("div", {
|
|
3192
3215
|
class: "wm-mm__scrim",
|
|
3193
3216
|
onClick: e[0] || (e[0] = (o) => t.$emit("close"))
|
|
3194
3217
|
}),
|
|
3195
|
-
i("div",
|
|
3196
|
-
i("div",
|
|
3218
|
+
i("div", ui, [
|
|
3219
|
+
i("div", hi, [
|
|
3197
3220
|
i("button", {
|
|
3198
3221
|
type: "button",
|
|
3199
3222
|
class: "wm-mm__item",
|
|
@@ -3216,15 +3239,15 @@ function ci(t, e, n, a, r, s) {
|
|
|
3216
3239
|
], -1),
|
|
3217
3240
|
i("span", { class: "wm-mm__label" }, "Historique des discussions", -1)
|
|
3218
3241
|
])]),
|
|
3219
|
-
n.canRename ? (l(),
|
|
3242
|
+
n.canRename ? (l(), c("button", {
|
|
3220
3243
|
key: 0,
|
|
3221
3244
|
type: "button",
|
|
3222
3245
|
class: "wm-mm__item",
|
|
3223
3246
|
onClick: e[2] || (e[2] = (o) => s.emit("rename"))
|
|
3224
3247
|
}, [...e[9] || (e[9] = [
|
|
3225
|
-
|
|
3226
|
-
])])) :
|
|
3227
|
-
n.canClear ? (l(),
|
|
3248
|
+
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)
|
|
3249
|
+
])])) : g("", !0),
|
|
3250
|
+
n.canClear ? (l(), c("button", {
|
|
3228
3251
|
key: 1,
|
|
3229
3252
|
type: "button",
|
|
3230
3253
|
class: "wm-mm__item",
|
|
@@ -3246,18 +3269,18 @@ function ci(t, e, n, a, r, s) {
|
|
|
3246
3269
|
])
|
|
3247
3270
|
], -1),
|
|
3248
3271
|
i("span", { class: "wm-mm__label" }, "Effacer ce fil", -1)
|
|
3249
|
-
])])) :
|
|
3250
|
-
n.canExport ? (l(),
|
|
3272
|
+
])])) : g("", !0),
|
|
3273
|
+
n.canExport ? (l(), c("button", {
|
|
3251
3274
|
key: 2,
|
|
3252
3275
|
type: "button",
|
|
3253
3276
|
class: "wm-mm__item",
|
|
3254
3277
|
onClick: e[4] || (e[4] = (o) => s.emit("export"))
|
|
3255
3278
|
}, [...e[11] || (e[11] = [
|
|
3256
|
-
|
|
3257
|
-
])])) :
|
|
3279
|
+
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)
|
|
3280
|
+
])])) : g("", !0)
|
|
3258
3281
|
]),
|
|
3259
3282
|
e[17] || (e[17] = i("div", { class: "wm-mm__sep" }, null, -1)),
|
|
3260
|
-
i("div",
|
|
3283
|
+
i("div", mi, [
|
|
3261
3284
|
i("button", {
|
|
3262
3285
|
type: "button",
|
|
3263
3286
|
class: "wm-mm__item",
|
|
@@ -3280,15 +3303,15 @@ function ci(t, e, n, a, r, s) {
|
|
|
3280
3303
|
], -1)),
|
|
3281
3304
|
e[14] || (e[14] = i("span", { class: "wm-mm__label" }, "Notifications", -1)),
|
|
3282
3305
|
i("span", {
|
|
3283
|
-
class:
|
|
3306
|
+
class: E(["wm-mm__toggle", { "wm-mm__toggle--on": r.notifOn }])
|
|
3284
3307
|
}, [...e[12] || (e[12] = [
|
|
3285
3308
|
i("span", { class: "wm-mm__knob" }, null, -1)
|
|
3286
3309
|
])], 2)
|
|
3287
3310
|
])
|
|
3288
3311
|
]),
|
|
3289
3312
|
e[18] || (e[18] = i("div", { class: "wm-mm__sep" }, null, -1)),
|
|
3290
|
-
i("div",
|
|
3291
|
-
n.statusUrl ? (l(),
|
|
3313
|
+
i("div", fi, [
|
|
3314
|
+
n.statusUrl ? (l(), c("button", {
|
|
3292
3315
|
key: 0,
|
|
3293
3316
|
type: "button",
|
|
3294
3317
|
class: "wm-mm__item",
|
|
@@ -3310,8 +3333,8 @@ function ci(t, e, n, a, r, s) {
|
|
|
3310
3333
|
])
|
|
3311
3334
|
], -1),
|
|
3312
3335
|
i("span", { class: "wm-mm__label" }, "Statut des services", -1)
|
|
3313
|
-
])])) :
|
|
3314
|
-
n.helpUrl ? (l(),
|
|
3336
|
+
])])) : g("", !0),
|
|
3337
|
+
n.helpUrl ? (l(), c("button", {
|
|
3315
3338
|
key: 1,
|
|
3316
3339
|
type: "button",
|
|
3317
3340
|
class: "wm-mm__item",
|
|
@@ -3333,18 +3356,18 @@ function ci(t, e, n, a, r, s) {
|
|
|
3333
3356
|
])
|
|
3334
3357
|
], -1),
|
|
3335
3358
|
i("span", { class: "wm-mm__label" }, "Centre d'aide", -1)
|
|
3336
|
-
])])) :
|
|
3359
|
+
])])) : g("", !0)
|
|
3337
3360
|
])
|
|
3338
3361
|
])
|
|
3339
3362
|
]);
|
|
3340
3363
|
}
|
|
3341
|
-
const
|
|
3342
|
-
function
|
|
3364
|
+
const pi = /* @__PURE__ */ B(ci, [["render", _i], ["__scopeId", "data-v-c1bb81d2"]]), ye = "ww-messenger-tokens";
|
|
3365
|
+
function de(t) {
|
|
3343
3366
|
var n;
|
|
3344
3367
|
const e = (n = t == null ? void 0 : t.author) == null ? void 0 : n.type;
|
|
3345
3368
|
return e === "agent_ia" || e === "agent_human";
|
|
3346
3369
|
}
|
|
3347
|
-
function
|
|
3370
|
+
function vi(t, e) {
|
|
3348
3371
|
if (!t || !e) return "";
|
|
3349
3372
|
const n = Array.isArray(t.fields) ? t.fields : [], a = [];
|
|
3350
3373
|
for (const r of n) {
|
|
@@ -3353,7 +3376,7 @@ function hi(t, e) {
|
|
|
3353
3376
|
if (s == null || s === "") continue;
|
|
3354
3377
|
let o;
|
|
3355
3378
|
if (Array.isArray(s)) {
|
|
3356
|
-
if (o = s.map((
|
|
3379
|
+
if (o = s.map((d) => ne(r, String(d))).join(", "), !o) continue;
|
|
3357
3380
|
} else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = ne(r, String(s));
|
|
3358
3381
|
a.push(`${r.label} :
|
|
3359
3382
|
${o}`);
|
|
@@ -3367,7 +3390,7 @@ function ne(t, e) {
|
|
|
3367
3390
|
const n = t.options.find((a) => (a == null ? void 0 : a.value) === e);
|
|
3368
3391
|
return (n == null ? void 0 : n.label) || e;
|
|
3369
3392
|
}
|
|
3370
|
-
function
|
|
3393
|
+
function yi(t, e) {
|
|
3371
3394
|
const n = [], a = Array.isArray(t == null ? void 0 : t.fields) ? t.fields : [];
|
|
3372
3395
|
for (const r of a) {
|
|
3373
3396
|
if (!(r != null && r.key) || !(r != null && r.label)) continue;
|
|
@@ -3375,11 +3398,11 @@ function mi(t, e) {
|
|
|
3375
3398
|
if (s == null || s === "") continue;
|
|
3376
3399
|
let o;
|
|
3377
3400
|
if (Array.isArray(s)) {
|
|
3378
|
-
if (o = s.map((
|
|
3401
|
+
if (o = s.map((v) => ne(r, String(v))).join(", "), !o) continue;
|
|
3379
3402
|
} else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = ne(r, String(s));
|
|
3380
|
-
const
|
|
3403
|
+
const d = r.type === "textarea" || typeof o == "string" && (o.length > 60 || o.includes(`
|
|
3381
3404
|
`));
|
|
3382
|
-
n.push({ label: r.label, value: o, multiline:
|
|
3405
|
+
n.push({ label: r.label, value: o, multiline: d });
|
|
3383
3406
|
}
|
|
3384
3407
|
return {
|
|
3385
3408
|
kind: "form_response",
|
|
@@ -3389,20 +3412,20 @@ function mi(t, e) {
|
|
|
3389
3412
|
}
|
|
3390
3413
|
};
|
|
3391
3414
|
}
|
|
3392
|
-
const
|
|
3415
|
+
const gi = 450, wi = 50, bi = 900, ki = 12e3, Ci = 300, Ai = {
|
|
3393
3416
|
name: "Messenger",
|
|
3394
3417
|
components: {
|
|
3395
|
-
Launcher:
|
|
3396
|
-
Header:
|
|
3397
|
-
Onboarding:
|
|
3398
|
-
MessageList:
|
|
3399
|
-
Composer:
|
|
3400
|
-
SuggestionChips:
|
|
3401
|
-
ApprovalCard:
|
|
3402
|
-
FormCard:
|
|
3403
|
-
Feedback:
|
|
3404
|
-
HistoryDrawer:
|
|
3405
|
-
MoreMenu:
|
|
3418
|
+
Launcher: Ye,
|
|
3419
|
+
Header: wt,
|
|
3420
|
+
Onboarding: Ht,
|
|
3421
|
+
MessageList: As,
|
|
3422
|
+
Composer: Vs,
|
|
3423
|
+
SuggestionChips: Ks,
|
|
3424
|
+
ApprovalCard: rr,
|
|
3425
|
+
FormCard: Er,
|
|
3426
|
+
Feedback: Pr,
|
|
3427
|
+
HistoryDrawer: li,
|
|
3428
|
+
MoreMenu: pi
|
|
3406
3429
|
},
|
|
3407
3430
|
// Make signAttachment available to deep children (AttachmentPreview)
|
|
3408
3431
|
// without prop drilling. The store may not exist yet at provide-time
|
|
@@ -3417,10 +3440,18 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
|
|
|
3417
3440
|
};
|
|
3418
3441
|
},
|
|
3419
3442
|
props: {
|
|
3420
|
-
|
|
3443
|
+
// Hardcoded server default (overridable for staging/dev).
|
|
3444
|
+
baseUrl: { type: String, default: ze },
|
|
3421
3445
|
widgetId: { type: String, default: "" },
|
|
3422
3446
|
userId: { type: String, default: "" },
|
|
3423
3447
|
userHash: { type: String, default: "" },
|
|
3448
|
+
// Flat object of consumer-supplied customer data pushed to the
|
|
3449
|
+
// server (PATCH /customers/me) once, on boot, so the agent has it
|
|
3450
|
+
// as context. `name`/`email` map to the customer's canonical
|
|
3451
|
+
// columns; every other key is a named variable value sent under
|
|
3452
|
+
// `values`. e.g. { name, email, plan: 'pro', seats: 5 }. The
|
|
3453
|
+
// server does a partial set (keeps variables you didn't pass).
|
|
3454
|
+
customer: { type: Object, default: null },
|
|
3424
3455
|
// 'floating' (default) | 'sheet' | 'embedded'
|
|
3425
3456
|
displayMode: { type: String, default: "floating" },
|
|
3426
3457
|
// Replaces the old WeWeb `wwEditorState` editor-detection prop.
|
|
@@ -3541,8 +3572,8 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
|
|
|
3541
3572
|
var n;
|
|
3542
3573
|
const t = this.readState, e = ((n = this.s) == null ? void 0 : n.messagesByConv) || {};
|
|
3543
3574
|
return this.allConversations.map((a) => {
|
|
3544
|
-
const r = e[a.id] || [], s = this.convLastActivity(a, r), o = t[a.id] || "",
|
|
3545
|
-
return { ...a, _preview: this.convPreview(a, r), _unread:
|
|
3575
|
+
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);
|
|
3576
|
+
return { ...a, _preview: this.convPreview(a, r), _unread: v };
|
|
3546
3577
|
});
|
|
3547
3578
|
},
|
|
3548
3579
|
// How many threads have an unseen agent/human message. Drives the
|
|
@@ -3684,7 +3715,7 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
|
|
|
3684
3715
|
var s;
|
|
3685
3716
|
return (r == null ? void 0 : r.type) === "action" && ((s = r == null ? void 0 : r.payload) == null ? void 0 : s.state) === "pending";
|
|
3686
3717
|
}, a = this.revealedAt;
|
|
3687
|
-
return (this.s.messagesByConv[t.id] || []).filter((r) => !n(r)).filter((r) =>
|
|
3718
|
+
return (this.s.messagesByConv[t.id] || []).filter((r) => !n(r)).filter((r) => de(r) ? a[r.id] > 0 : !0).filter(e);
|
|
3688
3719
|
},
|
|
3689
3720
|
// True whenever we should show the "typing" indicator at the bottom
|
|
3690
3721
|
// of the list: either the LLM is actively streaming tokens, or one
|
|
@@ -3693,7 +3724,7 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
|
|
|
3693
3724
|
streamingActive() {
|
|
3694
3725
|
var n, a, r;
|
|
3695
3726
|
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) =>
|
|
3727
|
+
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
3728
|
},
|
|
3698
3729
|
// Internal: the raw persisted list for the current conversation. We
|
|
3699
3730
|
// watch this to detect new agent messages that need to be paced.
|
|
@@ -3725,14 +3756,14 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
|
|
|
3725
3756
|
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
3757
|
},
|
|
3727
3758
|
approvalDetail() {
|
|
3728
|
-
var a, r, s, o,
|
|
3759
|
+
var a, r, s, o, d, v;
|
|
3729
3760
|
const t = (s = (r = (a = this.pendingApproval) == null ? void 0 : a.payload) == null ? void 0 : r.pending) == null ? void 0 : s.user_explanation;
|
|
3730
3761
|
if (typeof t == "string" && t.trim())
|
|
3731
3762
|
return t.trim();
|
|
3732
|
-
const e = (
|
|
3763
|
+
const e = (v = (d = (o = this.pendingApproval) == null ? void 0 : o.payload) == null ? void 0 : d.pending) == null ? void 0 : v.prepared_params;
|
|
3733
3764
|
if (!e || typeof e != "object") return "";
|
|
3734
3765
|
const n = Object.entries(e);
|
|
3735
|
-
return n.length ? n.slice(0, 2).map(([
|
|
3766
|
+
return n.length ? n.slice(0, 2).map(([C, w]) => `${C}: ${w}`).join(" · ") : "";
|
|
3736
3767
|
},
|
|
3737
3768
|
actionInFlight() {
|
|
3738
3769
|
var t, e;
|
|
@@ -3768,13 +3799,13 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
|
|
|
3768
3799
|
const t = this.currentConv;
|
|
3769
3800
|
let e = /* @__PURE__ */ new Date();
|
|
3770
3801
|
if (t) {
|
|
3771
|
-
const o = ((r = (((a = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : a[t.id]) || []).find((
|
|
3802
|
+
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
3803
|
if (o) {
|
|
3773
|
-
const
|
|
3774
|
-
Number.isNaN(
|
|
3804
|
+
const d = new Date(o);
|
|
3805
|
+
Number.isNaN(d.getTime()) || (e = d);
|
|
3775
3806
|
}
|
|
3776
3807
|
}
|
|
3777
|
-
return `Aujourd'hui · ${
|
|
3808
|
+
return `Aujourd'hui · ${be(e)}`;
|
|
3778
3809
|
},
|
|
3779
3810
|
// Pagination state for the active conversation. Drives the
|
|
3780
3811
|
// MessageList's scroll-up history loader. Defaults are safe (no
|
|
@@ -3864,7 +3895,7 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
|
|
|
3864
3895
|
const e = Date.now(), n = { ...this.revealedAt };
|
|
3865
3896
|
for (const r of t) {
|
|
3866
3897
|
if ((r == null ? void 0 : r.id) == null || n[r.id] !== void 0) continue;
|
|
3867
|
-
if (!
|
|
3898
|
+
if (!de(r)) {
|
|
3868
3899
|
n[r.id] = e;
|
|
3869
3900
|
continue;
|
|
3870
3901
|
}
|
|
@@ -3873,8 +3904,8 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
|
|
|
3873
3904
|
n[r.id] = e;
|
|
3874
3905
|
continue;
|
|
3875
3906
|
}
|
|
3876
|
-
const o = typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0,
|
|
3877
|
-
if (!o && !
|
|
3907
|
+
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;
|
|
3908
|
+
if (!o && !d) {
|
|
3878
3909
|
n[r.id] = e;
|
|
3879
3910
|
continue;
|
|
3880
3911
|
}
|
|
@@ -3891,9 +3922,9 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
|
|
|
3891
3922
|
hasWidgetId: !!this.widgetId,
|
|
3892
3923
|
hasUserId: !!this.userId,
|
|
3893
3924
|
hasUserHash: !!this.userHash
|
|
3894
|
-
}), typeof document < "u" && !document.getElementById(
|
|
3925
|
+
}), typeof document < "u" && !document.getElementById(ye)) {
|
|
3895
3926
|
const t = document.createElement("style");
|
|
3896
|
-
t.id =
|
|
3927
|
+
t.id = ye, t.textContent = He, document.head.appendChild(t);
|
|
3897
3928
|
}
|
|
3898
3929
|
this.hydrateReadState(), await this.boot(), this.isEmbedded && this.store && await this.open();
|
|
3899
3930
|
},
|
|
@@ -3959,11 +3990,11 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
|
|
|
3959
3990
|
for (let s = e.length - 1; s >= 0; s--) {
|
|
3960
3991
|
const o = e[s];
|
|
3961
3992
|
if (!o) continue;
|
|
3962
|
-
const
|
|
3963
|
-
if (
|
|
3964
|
-
return (((n = o.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") +
|
|
3965
|
-
const
|
|
3966
|
-
if (Array.isArray(
|
|
3993
|
+
const d = typeof o.text_md == "string" ? o.text_md.trim() : "";
|
|
3994
|
+
if (d)
|
|
3995
|
+
return (((n = o.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + d.replace(/\s+/g, " ");
|
|
3996
|
+
const v = (a = o.payload) == null ? void 0 : a.attachments;
|
|
3997
|
+
if (Array.isArray(v) && v.length) return "📎 Pièce jointe";
|
|
3967
3998
|
}
|
|
3968
3999
|
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
4000
|
},
|
|
@@ -4044,21 +4075,21 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
|
|
|
4044
4075
|
// bounded by MIN/MAX_BETWEEN_MS.
|
|
4045
4076
|
scheduleReveal(t) {
|
|
4046
4077
|
const e = Date.now(), n = ((t == null ? void 0 : t.text_md) || "").length, a = Math.min(
|
|
4047
|
-
|
|
4048
|
-
Math.max(
|
|
4078
|
+
ki,
|
|
4079
|
+
Math.max(bi, n * wi)
|
|
4049
4080
|
), s = Math.max(
|
|
4050
|
-
e +
|
|
4051
|
-
this.nextRevealAt +
|
|
4081
|
+
e + gi,
|
|
4082
|
+
this.nextRevealAt + Ci
|
|
4052
4083
|
) + a;
|
|
4053
4084
|
this.nextRevealAt = s;
|
|
4054
|
-
const o = Math.max(0, s - e),
|
|
4055
|
-
this.revealedAt = { ...this.revealedAt, [
|
|
4085
|
+
const o = Math.max(0, s - e), d = t.id, v = setTimeout(() => {
|
|
4086
|
+
this.revealedAt = { ...this.revealedAt, [d]: Date.now() }, this.revealTimers = this.revealTimers.filter((w) => w !== v);
|
|
4056
4087
|
}, o);
|
|
4057
|
-
this.revealTimers.push(
|
|
4058
|
-
const
|
|
4059
|
-
this.revealedAt[
|
|
4088
|
+
this.revealTimers.push(v);
|
|
4089
|
+
const C = setTimeout(() => {
|
|
4090
|
+
this.revealedAt[d] > 0 || (this.revealedAt = { ...this.revealedAt, [d]: Date.now() }), this.revealTimers = this.revealTimers.filter((w) => w !== C);
|
|
4060
4091
|
}, o + 4e3);
|
|
4061
|
-
this.revealTimers.push(
|
|
4092
|
+
this.revealTimers.push(C);
|
|
4062
4093
|
},
|
|
4063
4094
|
async boot() {
|
|
4064
4095
|
if (!this.canBoot) {
|
|
@@ -4075,12 +4106,12 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
|
|
|
4075
4106
|
baseUrl: this.baseUrl,
|
|
4076
4107
|
widgetId: this.widgetId,
|
|
4077
4108
|
userId: this.userId
|
|
4078
|
-
}), this.transport =
|
|
4109
|
+
}), this.transport = fe(je({
|
|
4079
4110
|
baseUrl: this.baseUrl,
|
|
4080
4111
|
widgetId: this.widgetId,
|
|
4081
4112
|
userId: this.userId,
|
|
4082
4113
|
userHash: this.userHash
|
|
4083
|
-
})), this.store =
|
|
4114
|
+
})), 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
4115
|
ready: this.store.state.ready,
|
|
4085
4116
|
error: this.store.state.error
|
|
4086
4117
|
});
|
|
@@ -4211,7 +4242,7 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
|
|
|
4211
4242
|
!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
4243
|
},
|
|
4213
4244
|
exportCurrentConv() {
|
|
4214
|
-
var r, s, o,
|
|
4245
|
+
var r, s, o, d, v, C;
|
|
4215
4246
|
const t = this.currentConv;
|
|
4216
4247
|
if (!t) return;
|
|
4217
4248
|
const e = (((s = (r = this.s) == null ? void 0 : r.messagesByConv) == null ? void 0 : s[t.id]) || []).slice(), n = [
|
|
@@ -4219,18 +4250,18 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
|
|
|
4219
4250
|
t.created_at ? `Créée le : ${t.created_at}` : "",
|
|
4220
4251
|
""
|
|
4221
4252
|
];
|
|
4222
|
-
for (const
|
|
4223
|
-
if (!
|
|
4224
|
-
const
|
|
4225
|
-
|
|
4253
|
+
for (const w of e) {
|
|
4254
|
+
if (!w) continue;
|
|
4255
|
+
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();
|
|
4256
|
+
A && (n.push(`[${L}] ${S} :`), n.push(A), n.push(""));
|
|
4226
4257
|
}
|
|
4227
4258
|
const a = new Blob([n.join(`
|
|
4228
4259
|
`)], { type: "text/plain;charset=utf-8" });
|
|
4229
4260
|
try {
|
|
4230
|
-
const
|
|
4231
|
-
|
|
4232
|
-
} catch (
|
|
4233
|
-
console.error("[ww-messenger] export failed",
|
|
4261
|
+
const w = URL.createObjectURL(a), S = document.createElement("a");
|
|
4262
|
+
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);
|
|
4263
|
+
} catch (w) {
|
|
4264
|
+
console.error("[ww-messenger] export failed", w);
|
|
4234
4265
|
}
|
|
4235
4266
|
},
|
|
4236
4267
|
async onSend(t) {
|
|
@@ -4256,12 +4287,12 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
|
|
|
4256
4287
|
async onFormSubmit({ values: t }) {
|
|
4257
4288
|
const e = this.pendingForm;
|
|
4258
4289
|
if (!(e != null && e.form)) return;
|
|
4259
|
-
const n =
|
|
4290
|
+
const n = vi(e.form, t);
|
|
4260
4291
|
if (!n) return;
|
|
4261
4292
|
const a = this.currentConv;
|
|
4262
4293
|
a && await this.store.send(a.id, n, {
|
|
4263
4294
|
metadata: {
|
|
4264
|
-
artifact:
|
|
4295
|
+
artifact: yi(e.form, t)
|
|
4265
4296
|
}
|
|
4266
4297
|
});
|
|
4267
4298
|
},
|
|
@@ -4305,53 +4336,53 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
|
|
|
4305
4336
|
}
|
|
4306
4337
|
}
|
|
4307
4338
|
}
|
|
4308
|
-
},
|
|
4339
|
+
}, Si = {
|
|
4309
4340
|
key: 0,
|
|
4310
4341
|
class: "wm-loading",
|
|
4311
4342
|
"aria-busy": "true",
|
|
4312
4343
|
"aria-live": "polite"
|
|
4313
|
-
},
|
|
4344
|
+
}, xi = {
|
|
4314
4345
|
key: 0,
|
|
4315
4346
|
class: "wm-state"
|
|
4316
|
-
},
|
|
4347
|
+
}, Mi = { class: "wm-state__err" }, Ti = { class: "wm-state__errSub" }, Ii = { class: "wm-bottom" }, Oi = {
|
|
4317
4348
|
key: 0,
|
|
4318
4349
|
ref: "floatEl",
|
|
4319
4350
|
class: "wm-float"
|
|
4320
|
-
},
|
|
4351
|
+
}, Ei = {
|
|
4321
4352
|
key: 1,
|
|
4322
4353
|
class: "wm-actionWait",
|
|
4323
4354
|
role: "status",
|
|
4324
4355
|
"aria-live": "polite"
|
|
4325
|
-
},
|
|
4356
|
+
}, Bi = { class: "wm-actionWait__lbl" }, Li = {
|
|
4326
4357
|
key: 1,
|
|
4327
4358
|
class: "wm-attached"
|
|
4328
|
-
},
|
|
4329
|
-
function
|
|
4330
|
-
const o =
|
|
4331
|
-
return l(),
|
|
4332
|
-
class:
|
|
4359
|
+
}, Ri = ["onClick"];
|
|
4360
|
+
function $i(t, e, n, a, r, s) {
|
|
4361
|
+
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");
|
|
4362
|
+
return l(), c("div", {
|
|
4363
|
+
class: E(["wm-root", `wm-root--${n.displayMode}`])
|
|
4333
4364
|
}, [
|
|
4334
4365
|
!r.isOpen && !s.isEmbedded ? (l(), $(o, {
|
|
4335
4366
|
key: 0,
|
|
4336
4367
|
"unread-count": s.unreadCount,
|
|
4337
4368
|
peek: s.launcherPeek,
|
|
4338
4369
|
onOpen: s.openFromPeek,
|
|
4339
|
-
onDismiss: e[0] || (e[0] = (
|
|
4340
|
-
}, null, 8, ["unread-count", "peek", "onOpen"])) :
|
|
4341
|
-
r.isOpen || s.isEmbedded ? (l(),
|
|
4370
|
+
onDismiss: e[0] || (e[0] = (j) => r.labelDismissed = !0)
|
|
4371
|
+
}, null, 8, ["unread-count", "peek", "onOpen"])) : g("", !0),
|
|
4372
|
+
r.isOpen || s.isEmbedded ? (l(), c("section", {
|
|
4342
4373
|
key: 1,
|
|
4343
|
-
class:
|
|
4344
|
-
style:
|
|
4374
|
+
class: E(["wm-panel", `wm-panel--${n.displayMode}`]),
|
|
4375
|
+
style: P(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
|
|
4345
4376
|
role: "dialog",
|
|
4346
4377
|
"aria-label": "Messenger"
|
|
4347
4378
|
}, [
|
|
4348
|
-
!s.ready && !s.error ? (l(),
|
|
4349
|
-
s.isEmbedded ?
|
|
4379
|
+
!s.ready && !s.error ? (l(), c("div", Si, [
|
|
4380
|
+
s.isEmbedded ? g("", !0) : (l(), c("button", {
|
|
4350
4381
|
key: 0,
|
|
4351
4382
|
type: "button",
|
|
4352
4383
|
class: "wm-loading__close",
|
|
4353
4384
|
"aria-label": "Réduire",
|
|
4354
|
-
onClick: e[1] || (e[1] = (...
|
|
4385
|
+
onClick: e[1] || (e[1] = (...j) => s.close && s.close(...j))
|
|
4355
4386
|
}, [...e[6] || (e[6] = [
|
|
4356
4387
|
i("svg", {
|
|
4357
4388
|
width: "13",
|
|
@@ -4371,8 +4402,8 @@ function Oi(t, e, n, a, r, s) {
|
|
|
4371
4402
|
class: "wm-loading__spinner",
|
|
4372
4403
|
"aria-hidden": "true"
|
|
4373
4404
|
}, null, -1))
|
|
4374
|
-
])) : (l(),
|
|
4375
|
-
|
|
4405
|
+
])) : (l(), c(O, { key: 1 }, [
|
|
4406
|
+
H(d, {
|
|
4376
4407
|
title: s.headerTitle,
|
|
4377
4408
|
escalated: s.isEscalated,
|
|
4378
4409
|
"agent-name": s.humanAgentName,
|
|
@@ -4387,8 +4418,8 @@ function Oi(t, e, n, a, r, s) {
|
|
|
4387
4418
|
onMore: s.toggleMore,
|
|
4388
4419
|
onClose: s.close
|
|
4389
4420
|
}, 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(),
|
|
4391
|
-
i("div",
|
|
4421
|
+
s.error ? (l(), c("div", xi, [
|
|
4422
|
+
i("div", Mi, [
|
|
4392
4423
|
e[9] || (e[9] = i("div", { class: "wm-state__errIcon" }, [
|
|
4393
4424
|
i("svg", {
|
|
4394
4425
|
width: "14",
|
|
@@ -4406,11 +4437,11 @@ function Oi(t, e, n, a, r, s) {
|
|
|
4406
4437
|
], -1)),
|
|
4407
4438
|
i("div", null, [
|
|
4408
4439
|
e[8] || (e[8] = i("div", { class: "wm-state__errTitle" }, "Connexion impossible", -1)),
|
|
4409
|
-
i("div",
|
|
4440
|
+
i("div", Ti, b(s.error), 1)
|
|
4410
4441
|
])
|
|
4411
4442
|
])
|
|
4412
|
-
])) : s.currentConv ? (l(),
|
|
4413
|
-
|
|
4443
|
+
])) : s.currentConv ? (l(), c(O, { key: 2 }, [
|
|
4444
|
+
H(C, {
|
|
4414
4445
|
ref: "messageList",
|
|
4415
4446
|
messages: s.displayedMessages,
|
|
4416
4447
|
"streaming-active": s.streamingActive,
|
|
@@ -4420,40 +4451,40 @@ function Oi(t, e, n, a, r, s) {
|
|
|
4420
4451
|
"has-more": s.paginationState.hasMore,
|
|
4421
4452
|
onLoadMore: s.onLoadMore
|
|
4422
4453
|
}, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "onLoadMore"]),
|
|
4423
|
-
i("div",
|
|
4424
|
-
s.floatVisible ? (l(),
|
|
4425
|
-
s.approvalReady ? (l(), $(
|
|
4454
|
+
i("div", Ii, [
|
|
4455
|
+
s.floatVisible ? (l(), c("div", Oi, [
|
|
4456
|
+
s.approvalReady ? (l(), $(w, {
|
|
4426
4457
|
key: 0,
|
|
4427
4458
|
action: s.approvalTitle,
|
|
4428
4459
|
detail: s.approvalDetail,
|
|
4429
4460
|
callbacks: s.pendingApproval.callbacks,
|
|
4430
4461
|
onCallback: s.onApprovalCallback
|
|
4431
|
-
}, null, 8, ["action", "detail", "callbacks", "onCallback"])) : s.pendingForm ? (l(), $(
|
|
4462
|
+
}, null, 8, ["action", "detail", "callbacks", "onCallback"])) : s.pendingForm ? (l(), $(S, {
|
|
4432
4463
|
key: s.pendingForm.message && s.pendingForm.message.id,
|
|
4433
4464
|
form: s.pendingForm.form,
|
|
4434
4465
|
onSubmit: s.onFormSubmit
|
|
4435
|
-
}, null, 8, ["form", "onSubmit"])) : s.showFeedback ? (l(), $(
|
|
4466
|
+
}, null, 8, ["form", "onSubmit"])) : s.showFeedback ? (l(), $(L, {
|
|
4436
4467
|
key: 2,
|
|
4437
4468
|
busy: r.feedbackBusy,
|
|
4438
4469
|
done: r.feedbackDone,
|
|
4439
4470
|
onSubmit: s.onFeedback
|
|
4440
|
-
}, null, 8, ["busy", "done", "onSubmit"])) : (l(), $(
|
|
4471
|
+
}, null, 8, ["busy", "done", "onSubmit"])) : (l(), $(A, {
|
|
4441
4472
|
key: 3,
|
|
4442
4473
|
items: s.suggestions,
|
|
4443
4474
|
onSelect: s.onSuggestion
|
|
4444
4475
|
}, null, 8, ["items", "onSelect"]))
|
|
4445
|
-
], 512)) :
|
|
4446
|
-
s.actionInFlight ? (l(),
|
|
4476
|
+
], 512)) : g("", !0),
|
|
4477
|
+
s.actionInFlight ? (l(), c("div", Ei, [
|
|
4447
4478
|
e[10] || (e[10] = i("span", {
|
|
4448
4479
|
class: "wm-actionWait__spinner",
|
|
4449
4480
|
"aria-hidden": "true"
|
|
4450
4481
|
}, null, -1)),
|
|
4451
|
-
i("span",
|
|
4452
|
-
])) : (l(), $(
|
|
4482
|
+
i("span", Bi, b(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
|
|
4483
|
+
])) : (l(), $(D, {
|
|
4453
4484
|
key: 2,
|
|
4454
4485
|
ref: "composer",
|
|
4455
4486
|
modelValue: r.draft,
|
|
4456
|
-
"onUpdate:modelValue": e[2] || (e[2] = (
|
|
4487
|
+
"onUpdate:modelValue": e[2] || (e[2] = (j) => r.draft = j),
|
|
4457
4488
|
placeholder: s.composerPlaceholder,
|
|
4458
4489
|
disabled: !!s.pendingApproval,
|
|
4459
4490
|
"attach-label": "Joindre un fichier",
|
|
@@ -4461,7 +4492,7 @@ function Oi(t, e, n, a, r, s) {
|
|
|
4461
4492
|
onAttach: s.onAttach
|
|
4462
4493
|
}, null, 8, ["modelValue", "placeholder", "disabled", "onSend", "onAttach"]))
|
|
4463
4494
|
]),
|
|
4464
|
-
r.moreOpen ? (l(), $(
|
|
4495
|
+
r.moreOpen ? (l(), $(x, {
|
|
4465
4496
|
key: 0,
|
|
4466
4497
|
"can-rename": !!s.currentConv,
|
|
4467
4498
|
"can-clear": !!s.currentConv,
|
|
@@ -4469,13 +4500,13 @@ function Oi(t, e, n, a, r, s) {
|
|
|
4469
4500
|
"notif-enabled": r.notifEnabled,
|
|
4470
4501
|
"status-url": s.statusUrl,
|
|
4471
4502
|
"help-url": s.helpUrl,
|
|
4472
|
-
onClose: e[3] || (e[3] = (
|
|
4503
|
+
onClose: e[3] || (e[3] = (j) => r.moreOpen = !1),
|
|
4473
4504
|
onNotifToggle: s.onNotifToggle,
|
|
4474
4505
|
onAction: s.onMoreAction
|
|
4475
|
-
}, null, 8, ["can-rename", "can-clear", "can-export", "notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) :
|
|
4476
|
-
r.pendingAttachments.length ? (l(),
|
|
4477
|
-
(l(!0),
|
|
4478
|
-
key:
|
|
4506
|
+
}, null, 8, ["can-rename", "can-clear", "can-export", "notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : g("", !0),
|
|
4507
|
+
r.pendingAttachments.length ? (l(), c("div", Li, [
|
|
4508
|
+
(l(!0), c(O, null, F(r.pendingAttachments, (j, z) => (l(), c("div", {
|
|
4509
|
+
key: z,
|
|
4479
4510
|
class: "wm-attached__chip"
|
|
4480
4511
|
}, [
|
|
4481
4512
|
e[12] || (e[12] = i("svg", {
|
|
@@ -4491,11 +4522,11 @@ function Oi(t, e, n, a, r, s) {
|
|
|
4491
4522
|
}, [
|
|
4492
4523
|
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
4524
|
], -1)),
|
|
4494
|
-
i("span", null,
|
|
4525
|
+
i("span", null, b(j.name), 1),
|
|
4495
4526
|
i("button", {
|
|
4496
4527
|
type: "button",
|
|
4497
4528
|
"aria-label": "Retirer",
|
|
4498
|
-
onClick: (
|
|
4529
|
+
onClick: (X) => r.pendingAttachments.splice(z, 1)
|
|
4499
4530
|
}, [...e[11] || (e[11] = [
|
|
4500
4531
|
i("svg", {
|
|
4501
4532
|
width: "10",
|
|
@@ -4510,10 +4541,10 @@ function Oi(t, e, n, a, r, s) {
|
|
|
4510
4541
|
}, [
|
|
4511
4542
|
i("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
4512
4543
|
], -1)
|
|
4513
|
-
])], 8,
|
|
4544
|
+
])], 8, Ri)
|
|
4514
4545
|
]))), 128))
|
|
4515
|
-
])) :
|
|
4516
|
-
], 64)) : (l(), $(
|
|
4546
|
+
])) : g("", !0)
|
|
4547
|
+
], 64)) : (l(), $(v, {
|
|
4517
4548
|
key: 1,
|
|
4518
4549
|
"welcome-message": s.widgetWelcomeMessage,
|
|
4519
4550
|
"agent-name": s.agentName,
|
|
@@ -4524,15 +4555,15 @@ function Oi(t, e, n, a, r, s) {
|
|
|
4524
4555
|
onSelect: s.onQuickLink,
|
|
4525
4556
|
onResume: s.onDrawerPick
|
|
4526
4557
|
}, null, 8, ["welcome-message", "agent-name", "quick-links", "unread-threads", "busy", "onStart", "onSelect", "onResume"])),
|
|
4527
|
-
r.historyOpen ? (l(), $(
|
|
4558
|
+
r.historyOpen ? (l(), $(N, {
|
|
4528
4559
|
key: 3,
|
|
4529
4560
|
conversations: s.drawerConversations,
|
|
4530
4561
|
"active-id": s.currentConv ? s.currentConv.id : null,
|
|
4531
|
-
onClose: e[4] || (e[4] = (
|
|
4562
|
+
onClose: e[4] || (e[4] = (j) => r.historyOpen = !1),
|
|
4532
4563
|
onNew: s.onDrawerNew,
|
|
4533
4564
|
onPick: s.onDrawerPick
|
|
4534
|
-
}, null, 8, ["conversations", "active-id", "onNew", "onPick"])) :
|
|
4535
|
-
r.moreOpen && !s.currentConv ? (l(), $(
|
|
4565
|
+
}, null, 8, ["conversations", "active-id", "onNew", "onPick"])) : g("", !0),
|
|
4566
|
+
r.moreOpen && !s.currentConv ? (l(), $(x, {
|
|
4536
4567
|
key: 4,
|
|
4537
4568
|
"can-rename": !1,
|
|
4538
4569
|
"can-clear": !1,
|
|
@@ -4540,55 +4571,56 @@ function Oi(t, e, n, a, r, s) {
|
|
|
4540
4571
|
"notif-enabled": r.notifEnabled,
|
|
4541
4572
|
"status-url": s.statusUrl,
|
|
4542
4573
|
"help-url": s.helpUrl,
|
|
4543
|
-
onClose: e[5] || (e[5] = (
|
|
4574
|
+
onClose: e[5] || (e[5] = (j) => r.moreOpen = !1),
|
|
4544
4575
|
onNotifToggle: s.onNotifToggle,
|
|
4545
4576
|
onAction: s.onMoreAction
|
|
4546
|
-
}, null, 8, ["notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) :
|
|
4577
|
+
}, null, 8, ["notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : g("", !0)
|
|
4547
4578
|
], 64))
|
|
4548
|
-
], 6)) :
|
|
4579
|
+
], 6)) : g("", !0)
|
|
4549
4580
|
], 2);
|
|
4550
4581
|
}
|
|
4551
|
-
const
|
|
4582
|
+
const Ui = /* @__PURE__ */ B(Ai, [["render", $i], ["__scopeId", "data-v-bee7b290"]]);
|
|
4552
4583
|
export {
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4584
|
+
J as AIAvatar,
|
|
4585
|
+
le as AVATAR_COLORS,
|
|
4586
|
+
Dn as ActionResult,
|
|
4587
|
+
rr as ApprovalCard,
|
|
4588
|
+
Qt as ArtifactFormResponse,
|
|
4589
|
+
hn as ArtifactInfoCard,
|
|
4590
|
+
Ae as ArtifactRenderer,
|
|
4591
|
+
xn as ArtifactTicket,
|
|
4592
|
+
Xn as AttachmentPreview,
|
|
4593
|
+
ts as Bubble,
|
|
4594
|
+
Vs as Composer,
|
|
4595
|
+
ze as DEFAULT_BASE_URL,
|
|
4596
|
+
Pr as Feedback,
|
|
4597
|
+
Er as FormCard,
|
|
4598
|
+
wt as Header,
|
|
4599
|
+
li as HistoryDrawer,
|
|
4600
|
+
ke as HumanAvatar,
|
|
4601
|
+
Ye as Launcher,
|
|
4602
|
+
he as MEDIA_RECORDER_SUPPORTED,
|
|
4603
|
+
As as MessageList,
|
|
4604
|
+
Ui as Messenger,
|
|
4605
|
+
pi as MoreMenu,
|
|
4606
|
+
Ht as Onboarding,
|
|
4575
4607
|
te as SCREEN_CAPTURE_SUPPORTED,
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4608
|
+
Ks as SuggestionChips,
|
|
4609
|
+
lt as TeamAvatars,
|
|
4610
|
+
is as Typing,
|
|
4611
|
+
ge as avatarColor,
|
|
4612
|
+
we as avatarInitials,
|
|
4613
|
+
xs as captureScreenshotFile,
|
|
4614
|
+
U as colors,
|
|
4615
|
+
Pe as createStore,
|
|
4616
|
+
je as createTransport,
|
|
4617
|
+
Ui as default,
|
|
4618
|
+
be as formatTime,
|
|
4619
|
+
ji as guessAttachmentKind,
|
|
4620
|
+
Ss as pickRecorderMime,
|
|
4621
|
+
Ce as renderMarkdown,
|
|
4622
|
+
Ts as startScreenRecording,
|
|
4623
|
+
He as tokensCss,
|
|
4624
|
+
Ne as uuid,
|
|
4625
|
+
Ne as v4
|
|
4594
4626
|
};
|