@opencxh/domain 1.131.0 → 1.132.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,116 +1,504 @@
1
- function S(e) {
1
+ function $(e) {
2
2
  return e.replace(/<style[\s\S]*?<\/style>/gi, " ").replace(/<script[\s\S]*?<\/script>/gi, " ").replace(/<[^>]+>/g, " ").replace(/&nbsp;/g, " ").replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/\s+/g, " ").trim();
3
3
  }
4
- function T(e) {
5
- const n = e.trim();
6
- return n.length <= 140 ? n : n.slice(0, 139).trimEnd() + "…";
7
- }
8
- function c(e) {
4
+ function p(e) {
9
5
  if (!e || e < 0) return "";
10
6
  const n = Math.floor(e / 60), t = Math.floor(e % 60);
11
7
  return `${n}:${t.toString().padStart(2, "0")}`;
12
8
  }
13
- function h(e) {
14
- switch (e.type) {
15
- case "EMAIL_RECEIVED":
16
- case "EMAIL_SENT": {
17
- const n = e.payload, t = n.bodySnippet?.trim() || S(n.body ?? "");
18
- return n.subject ? `${n.subject} — ${t}` : t;
9
+ function b(e) {
10
+ return e ? ` — ${Math.floor(e / 60)}m ${e % 60}s` : "";
11
+ }
12
+ function m(e) {
13
+ return e?.split("@")?.[0] || e || "";
14
+ }
15
+ function u(e) {
16
+ return e.map((n) => n.name).join(", ");
17
+ }
18
+ function A(e) {
19
+ return e === "meeting" ? "Meeting" : e === "video" ? "Video call" : "Audio call";
20
+ }
21
+ const s = {
22
+ /* ---- voice ---- */
23
+ VOICE_CALL_STARTED: {
24
+ shape: "event",
25
+ channelKind: "voice",
26
+ icon: "phone",
27
+ snippet: () => "Gesprek gestart",
28
+ timeline: (e) => e.direction === "inbound" ? `Inbound call started — ${m(e.payload.from)}` : `Outbound call started — ${m(e.payload.to)}`
29
+ },
30
+ VOICE_CALL_ANSWERED: {
31
+ shape: "event",
32
+ channelKind: "voice",
33
+ icon: "phone",
34
+ snippet: () => "Gesprek aangenomen",
35
+ timeline: (e, n) => `Call answered — ${n}`
36
+ },
37
+ VOICE_CALL_HOLD: {
38
+ shape: "event",
39
+ channelKind: "voice",
40
+ icon: "phone",
41
+ snippet: () => "In de wacht",
42
+ timeline: (e, n) => `Call on hold — ${n}`
43
+ },
44
+ VOICE_CALL_UNHOLD: {
45
+ shape: "event",
46
+ channelKind: "voice",
47
+ icon: "phone",
48
+ snippet: () => "Hervat"
49
+ },
50
+ VOICE_CALL_ENDED: {
51
+ shape: "event",
52
+ channelKind: "voice",
53
+ icon: "phone",
54
+ snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${p(e.payload.duration)})` : ""}`,
55
+ timeline: (e) => `Call ended${b(e.payload.duration)}`
56
+ },
57
+ VOICE_CALL_MISSED: {
58
+ shape: "event",
59
+ channelKind: "voice",
60
+ icon: "phone",
61
+ snippet: () => "Gemiste oproep",
62
+ timeline: (e) => `Missed call — ${m(e.payload.from)}`
63
+ },
64
+ VOICE_CALL_FAILED: {
65
+ shape: "event",
66
+ channelKind: "voice",
67
+ icon: "phone",
68
+ snippet: () => "Gesprek mislukt",
69
+ timeline: () => "Call failed"
70
+ },
71
+ VOICE_CALL_VOICEMAIL: {
72
+ shape: "artifact",
73
+ channelKind: "voice",
74
+ icon: "phone",
75
+ snippet: (e) => e.payload.transcription?.trim() ? e.payload.transcription : "Voicemail ontvangen"
76
+ },
77
+ /* ---- video ---- */
78
+ VIDEO_CALL_STARTED: {
79
+ shape: "event",
80
+ channelKind: "video",
81
+ icon: "video",
82
+ snippet: () => "Gesprek gestart",
83
+ timeline: () => "Video call started"
84
+ },
85
+ VIDEO_CALL_ANSWERED: {
86
+ shape: "event",
87
+ channelKind: "video",
88
+ icon: "video",
89
+ snippet: () => "Gesprek aangenomen",
90
+ timeline: () => "Video call answered"
91
+ },
92
+ VIDEO_CALL_HOLD: {
93
+ shape: "event",
94
+ channelKind: "video",
95
+ icon: "video",
96
+ snippet: () => "In de wacht"
97
+ },
98
+ VIDEO_CALL_UNHOLD: {
99
+ shape: "event",
100
+ channelKind: "video",
101
+ icon: "video",
102
+ snippet: () => "Hervat"
103
+ },
104
+ VIDEO_CALL_ENDED: {
105
+ shape: "event",
106
+ channelKind: "video",
107
+ icon: "video",
108
+ snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${p(e.payload.duration)})` : ""}`,
109
+ timeline: () => "Video call ended"
110
+ },
111
+ VIDEO_CALL_MISSED: {
112
+ shape: "event",
113
+ channelKind: "video",
114
+ icon: "video",
115
+ snippet: () => "Gemiste oproep",
116
+ timeline: () => "Missed video call"
117
+ },
118
+ VIDEO_CALL_FAILED: {
119
+ shape: "event",
120
+ channelKind: "video",
121
+ icon: "video",
122
+ snippet: () => "Gesprek mislukt",
123
+ timeline: () => "Video call failed"
124
+ },
125
+ /* ---- mail ---- */
126
+ EMAIL_RECEIVED: {
127
+ shape: "message",
128
+ triggerable: !0,
129
+ displayNameKey: "communication:activity.EMAIL_RECEIVED",
130
+ component: "communication:EmailActivity",
131
+ channelKind: "mail",
132
+ icon: "mail",
133
+ replyable: !0,
134
+ carriesText: !0,
135
+ countsAs: "inbound_message",
136
+ snippet: I
137
+ },
138
+ EMAIL_SENT: {
139
+ shape: "message",
140
+ component: "communication:EmailActivity",
141
+ channelKind: "mail",
142
+ icon: "mail",
143
+ replyable: !0,
144
+ carriesText: !0,
145
+ countsAs: "outbound_message",
146
+ snippet: I
147
+ },
148
+ /* ---- chat ---- */
149
+ CHAT_MESSAGE_SENT: {
150
+ shape: "message",
151
+ component: "communication:ChatMessage",
152
+ channelKind: "chat",
153
+ icon: "message-circle",
154
+ replyable: !0,
155
+ carriesText: !0,
156
+ countsAs: "outbound_message",
157
+ snippet: (e) => e.payload.text ?? ""
158
+ },
159
+ CHAT_MESSAGE_RECEIVED: {
160
+ shape: "message",
161
+ triggerable: !0,
162
+ displayNameKey: "communication:activity.CHAT_MESSAGE_RECEIVED",
163
+ component: "communication:ChatMessage",
164
+ channelKind: "chat",
165
+ icon: "message-circle",
166
+ replyable: !0,
167
+ carriesText: !0,
168
+ countsAs: "inbound_message",
169
+ snippet: (e) => e.payload.text ?? ""
170
+ },
171
+ CHAT_MEMBER_JOINED: {
172
+ shape: "event",
173
+ channelKind: "chat",
174
+ icon: "message-circle",
175
+ snippet: (e) => `${u(e.payload.members)} toegevoegd`,
176
+ timeline: (e) => {
177
+ const n = u(e.payload.members) || "Someone", t = e.payload.initiator?.name ? ` · added by ${e.payload.initiator.name}` : "";
178
+ return `${n} joined the chat${t}`;
179
+ }
180
+ },
181
+ CHAT_MEMBER_LEFT: {
182
+ shape: "event",
183
+ channelKind: "chat",
184
+ icon: "message-circle",
185
+ snippet: (e) => `${u(e.payload.members)} verlaten`,
186
+ timeline: (e) => {
187
+ const n = u(e.payload.members) || "Someone", t = e.payload.initiator?.name ? ` · removed by ${e.payload.initiator.name}` : "";
188
+ return `${n} left the chat${t}`;
19
189
  }
20
- case "CHAT_MESSAGE_SENT":
21
- case "CHAT_MESSAGE_RECEIVED":
22
- return e.payload.text ?? "";
23
- case "CHAT_RENAMED":
24
- return `Hernoemd naar "${e.payload.newName}"`;
25
- case "CHAT_MEMBER_JOINED":
26
- return `${e.payload.members.map((n) => n.name).join(", ")} toegevoegd`;
27
- case "CHAT_MEMBER_LEFT":
28
- return `${e.payload.members.map((n) => n.name).join(", ")} verlaten`;
29
- case "CHAT_CALL_STARTED":
30
- return "Gesprek gestart";
31
- case "CHAT_CALL_ENDED":
32
- return `Gesprek beëindigd${e.payload.duration ? ` (${c(e.payload.duration)})` : ""}`;
33
- case "CHAT_EVENT":
34
- return e.payload.text ?? e.payload.eventType;
35
- case "VOICE_CALL_STARTED":
36
- case "VIDEO_CALL_STARTED":
37
- return "Gesprek gestart";
38
- case "VOICE_CALL_ANSWERED":
39
- case "VIDEO_CALL_ANSWERED":
40
- return "Gesprek aangenomen";
41
- case "VOICE_CALL_HOLD":
42
- case "VIDEO_CALL_HOLD":
43
- return "In de wacht";
44
- case "VOICE_CALL_UNHOLD":
45
- case "VIDEO_CALL_UNHOLD":
46
- return "Hervat";
47
- case "VOICE_CALL_ENDED":
48
- case "VIDEO_CALL_ENDED":
49
- return `Gesprek beëindigd${e.payload.duration ? ` (${c(e.payload.duration)})` : ""}`;
50
- case "VOICE_CALL_MISSED":
51
- case "VIDEO_CALL_MISSED":
52
- return "Gemiste oproep";
53
- case "VOICE_CALL_FAILED":
54
- case "VIDEO_CALL_FAILED":
55
- return "Gesprek mislukt";
56
- case "VOICE_CALL_VOICEMAIL":
57
- return e.payload.transcription?.trim() ? e.payload.transcription : "Voicemail ontvangen";
58
- case "TRANSCRIPT_ADDED":
59
- return (e.payload.segments ?? []).map((n) => n.text).join(" ");
60
- case "AI_MESSAGE_ADDED":
61
- return e.payload.output?.text ?? e.payload.input?.text ?? "";
62
- case "AI_ACTION_PROPOSED":
63
- return `Voorstel wacht op goedkeuring (${e.payload.actions?.length ?? 0} actie(s))`;
64
- case "PLAYBOOK_STARTED":
65
- return `Playbook gestart${e.payload.playbookName ? `: ${e.payload.playbookName}` : ""}`;
66
- case "PLAYBOOK_COMPLETED":
67
- return "Playbook afgerond";
68
- case "PLAYBOOK_ESCALATED":
69
- return "Playbook geëscaleerd naar een mens";
70
- case "MEETING_SCHEDULED":
71
- return `Vergadering gepland: ${e.payload.title}`;
72
- case "MEETING_STARTED":
73
- return `Vergadering gestart: ${e.payload.title}`;
74
- case "MEETING_ENDED":
75
- return `Vergadering beëindigd${e.payload.duration ? ` (${c(e.payload.duration)})` : ""}`;
76
- case "MEETING_PARTICIPANT_JOINED":
77
- return `${e.payload.name} deelgenomen`;
78
- case "MEETING_PARTICIPANT_LEFT":
79
- return `${e.payload.name} verlaten`;
80
- case "COMMENT_ADDED":
81
- return e.payload.text ?? "";
82
- case "FILE_UPLOADED":
83
- return `Bestand: ${e.payload.fileName}`;
84
- case "INTERACTION_CREATED":
85
- return "Interactie aangemaakt";
86
- case "INTERACTION_STATUS_CHANGED":
87
- return `Status: ${e.payload.fromStatus} → ${e.payload.toStatus}`;
88
- case "INTERACTION_ASSIGNED":
89
- return "Interactie toegewezen";
90
- default:
91
- return "";
190
+ },
191
+ CHAT_RENAMED: {
192
+ shape: "event",
193
+ channelKind: "chat",
194
+ icon: "message-circle",
195
+ snippet: (e) => `Hernoemd naar "${e.payload.newName}"`,
196
+ timeline: (e) => `Chat renamed to "${e.payload.newName}"${e.payload.initiator ? ` by ${e.payload.initiator.name}` : ""}`
197
+ },
198
+ CHAT_CALL_STARTED: {
199
+ shape: "event",
200
+ channelKind: "chat",
201
+ icon: "message-circle",
202
+ snippet: () => "Gesprek gestart",
203
+ timeline: (e) => `${A(e.payload.callType)} started${e.payload.initiator ? ` by ${e.payload.initiator.name}` : ""}`,
204
+ joinUrl: (e) => e.payload.joinUrl
205
+ },
206
+ CHAT_CALL_ENDED: {
207
+ shape: "event",
208
+ channelKind: "chat",
209
+ icon: "message-circle",
210
+ snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${p(e.payload.duration)})` : ""}`,
211
+ timeline: (e) => `${A(e.payload.callType)} ended${b(e.payload.duration)}`,
212
+ joinUrl: (e) => e.payload.joinUrl
213
+ },
214
+ CHAT_EVENT: {
215
+ shape: "event",
216
+ channelKind: "chat",
217
+ icon: "message-circle",
218
+ snippet: (e) => e.payload.text ?? e.payload.eventType,
219
+ timeline: (e) => e.payload.text || e.payload.eventType
220
+ },
221
+ /* ---- inhoud ---- */
222
+ TRANSCRIPT_ADDED: {
223
+ shape: "artifact",
224
+ triggerable: !0,
225
+ displayNameKey: "communication:activity.TRANSCRIPT_ADDED",
226
+ component: "communication:TranscriptionActivity",
227
+ icon: "captions",
228
+ carriesText: !0,
229
+ snippet: (e) => (e.payload.segments ?? []).map((n) => n.text).join(" ")
230
+ },
231
+ COMMENT_ADDED: {
232
+ shape: "note",
233
+ component: "communication:CommentActivity",
234
+ icon: "sticky-note",
235
+ carriesText: !0,
236
+ snippet: (e) => e.payload.text ?? ""
237
+ },
238
+ FILE_UPLOADED: {
239
+ shape: "artifact",
240
+ component: "communication:FileActivity",
241
+ icon: "paperclip",
242
+ snippet: (e) => `Bestand: ${e.payload.fileName}`
243
+ },
244
+ /* ---- AI & playbooks ---- */
245
+ AI_MESSAGE_ADDED: {
246
+ shape: "event",
247
+ triggerable: !0,
248
+ displayNameKey: "communication:activity.AI_MESSAGE_ADDED",
249
+ icon: "circle",
250
+ snippet: (e) => e.payload.output?.text ?? e.payload.input?.text ?? "",
251
+ timeline: () => "AI message added"
252
+ },
253
+ AI_ACTION_PROPOSED: {
254
+ shape: "event",
255
+ component: "communication:ProposedActionCard",
256
+ icon: "circle",
257
+ playbookAuthored: !0,
258
+ snippet: (e) => `Voorstel wacht op goedkeuring (${e.payload.actions?.length ?? 0} actie(s))`
259
+ },
260
+ PLAYBOOK_STARTED: {
261
+ shape: "event",
262
+ icon: "circle",
263
+ playbookAuthored: !0,
264
+ snippet: (e) => `Playbook gestart${e.payload.playbookName ? `: ${e.payload.playbookName}` : ""}`,
265
+ timeline: (e) => `Playbook gestart${e.payload.playbookName ? ` — ${e.payload.playbookName}` : ""}`
266
+ },
267
+ PLAYBOOK_COMPLETED: {
268
+ shape: "event",
269
+ icon: "circle",
270
+ playbookAuthored: !0,
271
+ snippet: () => "Playbook afgerond",
272
+ timeline: () => "Playbook afgerond"
273
+ },
274
+ PLAYBOOK_ESCALATED: {
275
+ shape: "event",
276
+ icon: "circle",
277
+ playbookAuthored: !0,
278
+ snippet: () => "Playbook geëscaleerd naar een mens",
279
+ timeline: () => "Playbook geëscaleerd naar een mens"
280
+ },
281
+ /* ---- meetings ---- */
282
+ MEETING_SCHEDULED: {
283
+ shape: "event",
284
+ icon: "calendar",
285
+ snippet: (e) => `Vergadering gepland: ${e.payload.title}`,
286
+ timeline: () => "Meeting scheduled",
287
+ joinUrl: (e) => e.payload.joinUrl
288
+ },
289
+ MEETING_STARTED: {
290
+ shape: "event",
291
+ icon: "calendar",
292
+ snippet: (e) => `Vergadering gestart: ${e.payload.title}`,
293
+ timeline: () => "Meeting started",
294
+ joinUrl: (e) => e.payload.joinUrl
295
+ },
296
+ MEETING_ENDED: {
297
+ shape: "event",
298
+ icon: "calendar",
299
+ snippet: (e) => `Vergadering beëindigd${e.payload.duration ? ` (${p(e.payload.duration)})` : ""}`,
300
+ timeline: () => "Meeting ended"
301
+ },
302
+ MEETING_PARTICIPANT_JOINED: {
303
+ shape: "event",
304
+ icon: "calendar",
305
+ snippet: (e) => `${e.payload.name} deelgenomen`,
306
+ timeline: (e, n) => `${n} joined the meeting`
307
+ },
308
+ MEETING_PARTICIPANT_LEFT: {
309
+ shape: "event",
310
+ icon: "calendar",
311
+ snippet: (e) => `${e.payload.name} verlaten`,
312
+ timeline: (e, n) => `${n} left the meeting`
313
+ },
314
+ /* ---- interactie-levenscyclus ---- */
315
+ INTERACTION_CREATED: {
316
+ shape: "event",
317
+ icon: "circle",
318
+ snippet: () => "Interactie aangemaakt",
319
+ timeline: (e, n) => `Interaction started by ${n}`
320
+ },
321
+ INTERACTION_STATUS_CHANGED: {
322
+ shape: "event",
323
+ triggerable: !0,
324
+ displayNameKey: "communication:activity.INTERACTION_STATUS_CHANGED",
325
+ icon: "circle-dot",
326
+ snippet: (e) => `Status: ${e.payload.fromStatus} → ${e.payload.toStatus}`,
327
+ timeline: (e, n) => `Status changed to ${e.payload.toStatus} by ${n}`
328
+ },
329
+ INTERACTION_ASSIGNED: {
330
+ shape: "event",
331
+ icon: "user",
332
+ snippet: () => "Interactie toegewezen",
333
+ timeline: (e, n) => `Assigned by ${n}`
334
+ }
335
+ };
336
+ function I(e) {
337
+ const n = e.payload, t = n.bodySnippet?.trim() || $(n.body ?? "");
338
+ return n.subject ? `${n.subject} — ${t}` : t;
339
+ }
340
+ function l(e) {
341
+ return s[e];
342
+ }
343
+ function Ae(e) {
344
+ return l(e)?.icon ?? "circle";
345
+ }
346
+ function Ie(e) {
347
+ return l(e)?.channelKind;
348
+ }
349
+ function _e(e) {
350
+ const n = l(e)?.shape;
351
+ return n === "message" || n === "note";
352
+ }
353
+ function Te(e) {
354
+ return l(e)?.replyable === !0;
355
+ }
356
+ function Me(e) {
357
+ return l(e)?.carriesText === !0;
358
+ }
359
+ function Se(e) {
360
+ return l(e)?.countsAs;
361
+ }
362
+ function ve(e) {
363
+ return l(e)?.playbookAuthored === !0;
364
+ }
365
+ function x(e) {
366
+ const n = l(e.type)?.snippet;
367
+ return n ? n(e) : "";
368
+ }
369
+ function Ce(e, n) {
370
+ const t = l(e.type)?.timeline;
371
+ return t ? t(e, n) : e.type.replace(/_/g, " ").toLowerCase();
372
+ }
373
+ function De(e) {
374
+ const n = l(e.type)?.joinUrl;
375
+ return n ? n(e) : void 0;
376
+ }
377
+ function g(e, n) {
378
+ let t = e;
379
+ for (const i of n.split(".")) {
380
+ if (t == null || typeof t != "object") return "";
381
+ t = t[i];
92
382
  }
383
+ return t == null ? "" : typeof t == "string" ? t : typeof t == "number" || typeof t == "boolean" ? String(t) : "";
93
384
  }
94
- function ie(e) {
385
+ function h(e, n, t) {
386
+ if (e === void 0) return null;
387
+ if (typeof e == "string") return e || null;
388
+ if ("value" in e)
389
+ return g(n, e.value) || null;
390
+ const i = {};
391
+ for (const [r, o] of Object.entries(e.params ?? {}))
392
+ i[r] = g(n, o);
393
+ const a = t(e.key, i);
394
+ return a === e.key ? null : a;
395
+ }
396
+ function U(e, n) {
397
+ if (!e || typeof e == "string" || "value" in e) return null;
398
+ const t = {};
399
+ for (const [i, a] of Object.entries(e.params ?? {}))
400
+ t[i] = g(n, a);
401
+ return { key: e.key, params: t };
402
+ }
403
+ const P = (e) => e;
404
+ function _(e) {
405
+ const n = s[e];
406
+ return {
407
+ type: e,
408
+ shape: n.shape,
409
+ channelKind: n.channelKind,
410
+ icon: n.icon,
411
+ replyable: n.replyable === !0,
412
+ countsAs: n.countsAs,
413
+ carriesText: n.carriesText === !0,
414
+ triggerable: n.triggerable === !0,
415
+ component: n.component,
416
+ builtIn: !0,
417
+ displayNameKey: n.displayNameKey
418
+ };
419
+ }
420
+ function T(e) {
421
+ return {
422
+ type: e.type,
423
+ shape: e.shape,
424
+ channelKind: e.channelKind,
425
+ icon: e.icon || "circle",
426
+ replyable: e.replyable === !0,
427
+ countsAs: e.countsAs,
428
+ carriesText: e.carriesText === !0,
429
+ triggerable: e.triggerable === !0,
430
+ component: e.component,
431
+ builtIn: !1,
432
+ displayNameKey: e.displayNameKey
433
+ };
434
+ }
435
+ class K {
436
+ constructor(n = [], t = P) {
437
+ this.translate = t;
438
+ for (const i of n)
439
+ i?.type && (i.type in s || this.declared.has(i.type) || this.declared.set(i.type, i));
440
+ }
441
+ declared = /* @__PURE__ */ new Map();
442
+ get(n) {
443
+ if (n in s) return _(n);
444
+ const t = this.declared.get(n);
445
+ return t ? T(t) : void 0;
446
+ }
447
+ /** Alles wat als trigger aangeboden mag worden, ingebouwd en gedeclareerd. */
448
+ triggerable() {
449
+ const n = Object.keys(s).filter((i) => s[i].triggerable).map(_), t = [...this.declared.values()].map(T).filter((i) => i.triggerable);
450
+ return [...n, ...t];
451
+ }
452
+ /**
453
+ * De tijdlijnregel. Ingebouwd komt uit de catalogus, gedeclareerd uit `text` + de
454
+ * meegeleverde vertaling. Zonder bruikbare tekst valt het terug op de ontstreepte
455
+ * typenaam — dezelfde regel die de feed altijd al toonde voor onbekende types.
456
+ */
457
+ timelineText(n, t) {
458
+ const i = s[n.type];
459
+ if (i?.timeline) return i.timeline(n, t);
460
+ const a = this.declared.get(n.type);
461
+ return h(a?.text, n, this.translate) ?? n.type.replace(/_/g, " ").toLowerCase();
462
+ }
463
+ /** De regel voor de inboxlijst. Leeg wanneer het type niets te tonen heeft. */
464
+ snippet(n) {
465
+ const t = s[n.type];
466
+ if (t?.snippet) return t.snippet(n);
467
+ const i = this.declared.get(n.type);
468
+ return h(i?.text, n, this.translate) ?? "";
469
+ }
470
+ /** De descriptor zoals hij binnenkwam; nodig om `text` als sleutel op te slaan. */
471
+ descriptor(n) {
472
+ return this.declared.get(n);
473
+ }
474
+ }
475
+ const Ne = new K(), M = 140;
476
+ function G(e) {
477
+ const n = e.trim();
478
+ return n.length <= M ? n : n.slice(0, M - 1).trimEnd() + "…";
479
+ }
480
+ function Oe(e, n) {
481
+ const t = U(n?.text, e), i = n ? h(n.text, e, (a) => a) : null;
95
482
  return {
96
483
  activityId: e.id,
97
484
  type: e.type,
98
- snippet: T(h(e)),
485
+ snippet: G(i ?? x(e)),
99
486
  authorName: e.author?.name ?? "",
100
487
  direction: e.direction,
101
- createdAt: e.createdAt ?? Date.now()
488
+ createdAt: e.createdAt ?? Date.now(),
489
+ ...t ? { snippetKey: t.key, snippetParams: t.params } : {}
102
490
  };
103
491
  }
104
- function se(e, n, t = []) {
105
- const r = e.createdAt;
106
- if (!r) return [];
492
+ function Le(e, n, t = []) {
493
+ const i = e.createdAt;
494
+ if (!i) return [];
107
495
  const a = new Set(t);
108
- return e.author.type === "user" && e.author.id && a.add(e.author.id), Object.entries(n).filter(([i, s]) => s >= r && !a.has(i)).map(([i]) => i);
496
+ return e.author.type === "user" && e.author.id && a.add(e.author.id), Object.entries(n).filter(([r, o]) => o >= i && !a.has(r)).map(([r]) => r);
109
497
  }
110
- function oe(e) {
498
+ function ke(e) {
111
499
  return e.createdAt ?? 0;
112
500
  }
113
- const le = [
501
+ const Re = [
114
502
  { id: "agent", label: "Agent", labelSource: "user" },
115
503
  { id: "team", label: "Team", labelSource: "team" },
116
504
  { id: "inbox", label: "Inbox", labelSource: "inbox" },
@@ -120,57 +508,57 @@ const le = [
120
508
  { id: "handledBy", label: "Afhandelaar", labelSource: "raw" },
121
509
  { id: "time", label: "Tijd", labelSource: "raw" }
122
510
  ];
123
- function ce(e) {
511
+ function $e(e) {
124
512
  const n = [];
125
513
  for (const t of Object.keys(e))
126
- for (const r of Object.keys(e[t]))
127
- n.push({ lang: t, key: r, value: e[t][r] });
514
+ for (const i of Object.keys(e[t]))
515
+ n.push({ lang: t, key: i, value: e[t][i] });
128
516
  return n;
129
517
  }
130
- function u(e) {
518
+ function f(e) {
131
519
  return e < 10 ? `0${e}` : `${e}`;
132
520
  }
133
- function D(e, n) {
134
- const t = new Date(e), r = `${t.getUTCFullYear()}-${u(t.getUTCMonth() + 1)}-${u(t.getUTCDate())}`;
135
- return n === "day" ? r : `${r}T${u(t.getUTCHours())}`;
521
+ function w(e, n) {
522
+ const t = new Date(e), i = `${t.getUTCFullYear()}-${f(t.getUTCMonth() + 1)}-${f(t.getUTCDate())}`;
523
+ return n === "day" ? i : `${i}T${f(t.getUTCHours())}`;
136
524
  }
137
- function C(e, n) {
525
+ function V(e, n) {
138
526
  const t = new Date(e);
139
527
  return t.setUTCMinutes(0, 0, 0), n === "day" && t.setUTCHours(0), t.getTime();
140
528
  }
141
- const O = 36e5, N = 864e5;
142
- function ue(e, n, t) {
143
- const r = t === "hour" ? O : N, a = [];
144
- for (let i = C(e, t); i <= n; i += r)
145
- a.push(D(i, t));
529
+ const H = 36e5, j = 864e5;
530
+ function xe(e, n, t) {
531
+ const i = t === "hour" ? H : j, a = [];
532
+ for (let r = V(e, t); r <= n; r += i)
533
+ a.push(w(r, t));
146
534
  return a;
147
535
  }
148
- const L = [
536
+ const B = [
149
537
  { id: "resource", label: "Resource", labelSource: "raw" },
150
538
  { id: "origin", label: "Herkomst", labelSource: "raw" }
151
- ], R = L.map((e) => e.id);
152
- function y(e, n) {
539
+ ], F = B.map((e) => e.id);
540
+ function W(e, n) {
153
541
  return `${e}.usage.${n}`;
154
542
  }
155
- function de(e, n) {
543
+ function Ue(e, n) {
156
544
  return n.map((t) => ({
157
- id: y(e, t.unit),
545
+ id: W(e, t.unit),
158
546
  label: t.label,
159
547
  category: "Verbruik",
160
548
  valueType: t.valueType ?? "count",
161
549
  aggregation: "sum",
162
550
  supportedDimensions: [
163
551
  "provider",
164
- ...R,
552
+ ...F,
165
553
  ...t.extraDimensions ?? [],
166
554
  "time"
167
555
  ]
168
556
  }));
169
557
  }
170
- function pe(e) {
558
+ function Pe(e) {
171
559
  return (e.startsWith("tool:") ? e.slice(5) : e).replace(/__/g, " · ").replace(/\./g, " · ").replace(/_/g, " ");
172
560
  }
173
- const fe = [
561
+ const Ke = [
174
562
  { name: "text", type: "string" },
175
563
  { name: "subject", type: "string" },
176
564
  { name: "from", type: "string" },
@@ -193,7 +581,7 @@ const fe = [
193
581
  // een nieuw adres) — een stap die hierop leunt hoort dus een `condition` te hebben.
194
582
  { name: "contactId", type: "string" },
195
583
  { name: "companyId", type: "string" }
196
- ], ge = {
584
+ ], Ge = {
197
585
  topics: [
198
586
  { name: "topic", type: "string" },
199
587
  { name: "confidence", type: "number" }
@@ -204,7 +592,7 @@ const fe = [
204
592
  ],
205
593
  extract: []
206
594
  };
207
- function k(e) {
595
+ function Y(e) {
208
596
  switch (e.kind) {
209
597
  case "user":
210
598
  return `user:${e.userId}`;
@@ -214,22 +602,22 @@ function k(e) {
214
602
  return "org";
215
603
  }
216
604
  }
217
- function Ee(e) {
605
+ function we(e) {
218
606
  if (typeof e != "string") return;
219
607
  const n = e.trim();
220
608
  if (n === "org") return { kind: "org" };
221
609
  const t = n.indexOf(":");
222
610
  if (t <= 0) return;
223
- const r = n.slice(0, t), a = n.slice(t + 1).trim();
611
+ const i = n.slice(0, t), a = n.slice(t + 1).trim();
224
612
  if (a) {
225
- if (r === "user") return { kind: "user", userId: a };
226
- if (r === "team") return { kind: "team", teamId: a };
613
+ if (i === "user") return { kind: "user", userId: a };
614
+ if (i === "team") return { kind: "team", teamId: a };
227
615
  }
228
616
  }
229
- function x(e) {
230
- return k(e);
617
+ function z(e) {
618
+ return Y(e);
231
619
  }
232
- function me(e) {
620
+ function Ve(e) {
233
621
  switch (e.kind) {
234
622
  case "personal":
235
623
  return { kind: "user", userId: e.userId };
@@ -239,20 +627,20 @@ function me(e) {
239
627
  return { kind: "org" };
240
628
  }
241
629
  }
242
- function be(e) {
243
- return x(e);
630
+ function He(e) {
631
+ return z(e);
244
632
  }
245
- const U = ["done", "escalated", "failed", "timed_out", "stopped"], P = ["awaiting_approval", "awaiting_reply"];
246
- function $(e) {
247
- return U.includes(e);
633
+ const q = ["done", "escalated", "failed", "timed_out", "stopped"], X = ["awaiting_approval", "awaiting_reply"];
634
+ function J(e) {
635
+ return q.includes(e);
248
636
  }
249
- function Ae(e) {
250
- return $(e);
637
+ function je(e) {
638
+ return J(e);
251
639
  }
252
- function Ie(e) {
253
- return P.includes(e);
640
+ function Be(e) {
641
+ return X.includes(e);
254
642
  }
255
- const _ = [
643
+ const k = [
256
644
  {
257
645
  id: "openai",
258
646
  label: "OpenAI",
@@ -340,53 +728,53 @@ const _ = [
340
728
  defaultModel: "default"
341
729
  }
342
730
  ];
343
- function d(e) {
344
- return _.find((n) => n.id === e);
731
+ function E(e) {
732
+ return k.find((n) => n.id === e);
345
733
  }
346
- function _e(e) {
347
- return d(e)?.label ?? e;
734
+ function Fe(e) {
735
+ return E(e)?.label ?? e;
348
736
  }
349
- function Me(e, n = "gpt-5-mini") {
350
- return d(e)?.defaultModel ?? n;
737
+ function We(e, n = "gpt-5-mini") {
738
+ return E(e)?.defaultModel ?? n;
351
739
  }
352
- function Se(e) {
353
- return _.filter((n) => n.capabilities.includes(e));
740
+ function Ye(e) {
741
+ return k.filter((n) => n.capabilities.includes(e));
354
742
  }
355
- function Te(e) {
356
- const n = d(e);
743
+ function ze(e) {
744
+ const n = E(e);
357
745
  return !!n && !n.baseUrl;
358
746
  }
359
- const he = /* @__PURE__ */ new Set(["mail", "message"]);
360
- function w(e, n) {
747
+ const qe = /* @__PURE__ */ new Set(["mail", "message"]);
748
+ function Q(e, n) {
361
749
  const t = e.settings?.signatures?.[n];
362
750
  return !t || !t.enabled || !t.body || t.body.trim() === "" ? null : t;
363
751
  }
364
- function De(e, n, t, r = "html") {
752
+ function Xe(e, n, t, i = "html") {
365
753
  if (!e) return t;
366
- const a = w(e, n);
367
- return a ? `${t}${r === "text" ? `
754
+ const a = Q(e, n);
755
+ return a ? `${t}${i === "text" ? `
368
756
 
369
757
  ` : n === "mail" ? "<br><br>-- <br>" : "<br><br>"}${a.body}` : t;
370
758
  }
371
- function Ce(e) {
759
+ function Je(e) {
372
760
  return e.endpoints ?? [];
373
761
  }
374
- const Oe = (e) => !!e.assignedUserId || !!e.assignedInboxId, Ne = (e) => e.status === "closed", Le = (e) => ({
762
+ const Qe = (e) => !!e.assignedUserId || !!e.assignedInboxId, Ze = (e) => e.status === "closed", en = (e) => ({
375
763
  urgent: 10,
376
764
  high: 5,
377
765
  normal: 2,
378
766
  low: 1
379
- })[e.priority] || 0, Re = (e, n = 30) => e.title?.length <= n ? e.title : `${e.title.substring(0, n)}...`;
380
- function ye(e, n) {
767
+ })[e.priority] || 0, nn = (e, n = 30) => e.title?.length <= n ? e.title : `${e.title.substring(0, n)}...`;
768
+ function tn(e, n) {
381
769
  return e.lastActivityAt ? !(e.seenBy ?? []).includes(n) : !1;
382
770
  }
383
- const ke = 2e3, xe = 500, Ue = 12e3, Pe = 4e3, G = ["contact", "company"];
384
- function $e(e) {
771
+ const an = 2e3, rn = 500, on = 12e3, ln = 4e3, Z = ["contact", "company"];
772
+ function sn(e) {
385
773
  if (!e) return !1;
386
774
  const n = e.slice(0, e.indexOf(":"));
387
- return G.includes(n);
775
+ return Z.includes(n);
388
776
  }
389
- const p = {
777
+ const y = {
390
778
  // The lower bounds are deliberately generous: service ranges (0800/0900) are
391
779
  // shorter than geographic numbers, and a too-strict minimum silently drops them.
392
780
  // An over-permissive key is harmless — it simply matches nothing.
@@ -409,81 +797,81 @@ const p = {
409
797
  PL: { callingCode: "48", nsnMin: 9, nsnMax: 9 },
410
798
  US: { callingCode: "1", nsnMin: 10, nsnMax: 10 },
411
799
  CA: { callingCode: "1", nsnMin: 10, nsnMax: 10 }
412
- }, V = "NL", H = 15, B = 8, F = Array.from(
413
- new Set(Object.values(p).map((e) => e.callingCode))
800
+ }, ee = "NL", ne = 15, te = 8, ie = Array.from(
801
+ new Set(Object.values(y).map((e) => e.callingCode))
414
802
  ).sort((e, n) => n.length - e.length);
415
- function f(e) {
803
+ function S(e) {
416
804
  if (e)
417
- return p[e.trim().toUpperCase()];
805
+ return y[e.trim().toUpperCase()];
418
806
  }
419
- function l(e, n) {
807
+ function d(e, n) {
420
808
  return e.length >= n.nsnMin && e.length <= n.nsnMax;
421
809
  }
422
- function g(e) {
423
- if (e.length > H) return null;
424
- for (const n of F) {
810
+ function v(e) {
811
+ if (e.length > ne) return null;
812
+ for (const n of ie) {
425
813
  if (!e.startsWith(n)) continue;
426
814
  const t = e.slice(n.length);
427
- for (const r of Object.values(p)) {
428
- if (r.callingCode !== n) continue;
429
- const a = r.trunkPrefix, i = a && t.startsWith(a) ? t.slice(a.length) : t;
430
- if (l(i, r)) return `+${n}${i}`;
815
+ for (const i of Object.values(y)) {
816
+ if (i.callingCode !== n) continue;
817
+ const a = i.trunkPrefix, r = a && t.startsWith(a) ? t.slice(a.length) : t;
818
+ if (d(r, i)) return `+${n}${r}`;
431
819
  }
432
820
  return null;
433
821
  }
434
- return e.length < B ? null : `+${e}`;
822
+ return e.length < te ? null : `+${e}`;
435
823
  }
436
- function v(e) {
824
+ function ae(e) {
437
825
  let n = e.trim();
438
826
  const t = n.match(/^(sips?|tel|whatsapp):/i);
439
827
  t && (n = n.slice(t[0].length));
440
- const r = n.indexOf("@");
441
- return r >= 0 && (n = n.slice(0, r)), n.trim();
828
+ const i = n.indexOf("@");
829
+ return i >= 0 && (n = n.slice(0, i)), n.trim();
442
830
  }
443
- function we(e) {
831
+ function cn(e) {
444
832
  if (!e) return !1;
445
833
  const n = e.indexOf("@");
446
834
  if (n <= 0) return !1;
447
835
  const t = e.slice(0, n).trim();
448
836
  return !/^[+\d\s().-]+$/.test(t);
449
837
  }
450
- function E(e, n) {
838
+ function C(e, n) {
451
839
  if (!e) return null;
452
- const t = v(e);
840
+ const t = ae(e);
453
841
  if (!t) return null;
454
- const r = t.startsWith("+"), a = t.replace(/\D/g, "");
842
+ const i = t.startsWith("+"), a = t.replace(/\D/g, "");
455
843
  if (!a) return null;
456
- if (r) return g(a);
457
- if (a.startsWith("00")) return g(a.slice(2));
458
- const i = f(n) ?? f(V);
459
- if (!i) return null;
460
- const s = i.trunkPrefix;
461
- if (s && a.startsWith(s)) {
462
- const o = a.slice(s.length);
463
- return l(o, i) ? `+${i.callingCode}${o}` : null;
844
+ if (i) return v(a);
845
+ if (a.startsWith("00")) return v(a.slice(2));
846
+ const r = S(n) ?? S(ee);
847
+ if (!r) return null;
848
+ const o = r.trunkPrefix;
849
+ if (o && a.startsWith(o)) {
850
+ const c = a.slice(o.length);
851
+ return d(c, r) ? `+${r.callingCode}${c}` : null;
464
852
  }
465
- if (a.startsWith(i.callingCode)) {
466
- const o = a.slice(i.callingCode.length);
467
- if (l(o, i)) return `+${i.callingCode}${o}`;
853
+ if (a.startsWith(r.callingCode)) {
854
+ const c = a.slice(r.callingCode.length);
855
+ if (d(c, r)) return `+${r.callingCode}${c}`;
468
856
  }
469
- return !s && l(a, i) ? `+${i.callingCode}${a}` : null;
857
+ return !o && d(a, r) ? `+${r.callingCode}${a}` : null;
470
858
  }
471
- function Ge(e, n = 9) {
859
+ function pn(e, n = 9) {
472
860
  const t = (e ?? "").replace(/\D/g, "");
473
861
  return t.length < n ? null : t.slice(-n);
474
862
  }
475
- function M(e) {
863
+ function R(e) {
476
864
  if (!e) return null;
477
865
  const n = e.trim().toLowerCase(), t = n.lastIndexOf("@");
478
866
  if (t <= 0 || t === n.length - 1) return null;
479
- const r = n.slice(0, t).split("+")[0], a = n.slice(t + 1);
480
- return !r || !a.includes(".") ? null : `${r}@${a}`;
867
+ const i = n.slice(0, t).split("+")[0], a = n.slice(t + 1);
868
+ return !i || !a.includes(".") ? null : `${i}@${a}`;
481
869
  }
482
- function Ve(e) {
483
- const n = M(e);
870
+ function un(e) {
871
+ const n = R(e);
484
872
  return n ? n.slice(n.lastIndexOf("@") + 1) : null;
485
873
  }
486
- const W = /* @__PURE__ */ new Set([
874
+ const re = /* @__PURE__ */ new Set([
487
875
  "co.uk",
488
876
  "org.uk",
489
877
  "gov.uk",
@@ -493,14 +881,14 @@ const W = /* @__PURE__ */ new Set([
493
881
  "com.br",
494
882
  "co.za"
495
883
  ]);
496
- function j(e) {
884
+ function oe(e) {
497
885
  if (!e) return null;
498
886
  const n = e.trim().toLowerCase().replace(/\.$/, "").split(".").filter(Boolean);
499
887
  if (n.length < 2) return null;
500
888
  const t = n.slice(-2).join(".");
501
- return W.has(t) && n.length >= 3 ? n.slice(-3).join(".") : t;
889
+ return re.has(t) && n.length >= 3 ? n.slice(-3).join(".") : t;
502
890
  }
503
- const K = /* @__PURE__ */ new Set([
891
+ const le = /* @__PURE__ */ new Set([
504
892
  "gmail.com",
505
893
  "googlemail.com",
506
894
  "outlook.com",
@@ -545,34 +933,34 @@ const K = /* @__PURE__ */ new Set([
545
933
  "proximus.be",
546
934
  "scarlet.be"
547
935
  ]);
548
- function He(e) {
549
- const n = j(e);
550
- return n ? K.has(n) : !1;
936
+ function dn(e) {
937
+ const n = oe(e);
938
+ return n ? le.has(n) : !1;
551
939
  }
552
- function Be(e) {
940
+ function mn(e) {
553
941
  if (!e) return !1;
554
942
  const n = e.trim().toLowerCase();
555
943
  return n === "tel" || n === "sms" || n === "whatsapp" || n === "fax";
556
944
  }
557
- function Fe(e, n, t) {
945
+ function fn(e, n, t) {
558
946
  if (!e || !n) return null;
559
- const r = e.trim().toLowerCase();
560
- if (r === "tel" || r === "sms" || r === "whatsapp") {
561
- const i = E(n, t);
562
- return i ? `tel:${i}` : null;
947
+ const i = e.trim().toLowerCase();
948
+ if (i === "tel" || i === "sms" || i === "whatsapp") {
949
+ const r = C(n, t);
950
+ return r ? `tel:${r}` : null;
563
951
  }
564
- if (r === "fax") {
565
- const i = E(n, t);
566
- return i ? `fax:${i}` : null;
952
+ if (i === "fax") {
953
+ const r = C(n, t);
954
+ return r ? `fax:${r}` : null;
567
955
  }
568
- if (r === "mailto" || r === "email") {
569
- const i = M(n);
570
- return i ? `mailto:${i}` : null;
956
+ if (i === "mailto" || i === "email") {
957
+ const r = R(n);
958
+ return r ? `mailto:${r}` : null;
571
959
  }
572
960
  const a = n.trim().toLowerCase();
573
- return a ? `${r}:${a}` : null;
961
+ return a ? `${i}:${a}` : null;
574
962
  }
575
- const Y = [
963
+ const se = [
576
964
  /<blockquote/i,
577
965
  /class="?gmail_quote/i,
578
966
  // Gmail quote container
@@ -585,107 +973,107 @@ const Y = [
585
973
  // Outlook underscore separator before "From:"
586
974
  /\bOn\b[\s\S]{0,200}?\bwrote:/i
587
975
  // Gmail "On <date> <name> wrote:"
588
- ], m = /^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i, z = /^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;
589
- function q(e) {
976
+ ], D = /^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i, ce = /^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;
977
+ function pe(e) {
590
978
  const n = e.split(`
591
979
  `);
592
980
  for (let t = 0; t < n.length; t++)
593
- if (z.test(n[t]) || m.test(n[t]) && n.slice(t + 1, t + 4).some((r) => m.test(r)))
981
+ if (ce.test(n[t]) || D.test(n[t]) && n.slice(t + 1, t + 4).some((i) => D.test(i)))
594
982
  return n.slice(0, t).join(`
595
983
  `).trim();
596
984
  return e;
597
985
  }
598
- function b(e) {
986
+ function N(e) {
599
987
  let n = e;
600
988
  return n = n.replace(/<(script|style)[\s\S]*?<\/\1>/gi, ""), n = n.replace(/<br\s*\/?>/gi, `
601
989
  `), n = n.replace(/<\/(p|div|li|tr|h[1-6]|ul|ol|table)>/gi, `
602
990
  `), n = n.replace(/<[^>]+>/g, ""), n = n.replace(/<[^>]*$/, ""), n;
603
991
  }
604
- function A(e) {
992
+ function O(e) {
605
993
  return e.replace(/&nbsp;/gi, " ").replace(/&lt;/gi, "<").replace(/&gt;/gi, ">").replace(/&quot;/gi, '"').replace(/&#39;/gi, "'").replace(/&#(\d+);/g, (n, t) => String.fromCharCode(Number(t))).replace(/&amp;/gi, "&");
606
994
  }
607
- function I(e) {
995
+ function L(e) {
608
996
  return e.replace(/\r/g, "").replace(/[ \t]+/g, " ").replace(/ *\n */g, `
609
997
  `).replace(/\n{3,}/g, `
610
998
 
611
999
  `).trim();
612
1000
  }
613
- function ve(e) {
1001
+ function gn(e) {
614
1002
  if (typeof e != "string" || !e) return "";
615
1003
  let n = e.length;
616
- for (const i of Y) {
617
- const s = e.search(i);
618
- s >= 0 && s < n && (n = s);
1004
+ for (const r of se) {
1005
+ const o = e.search(r);
1006
+ o >= 0 && o < n && (n = o);
619
1007
  }
620
1008
  const t = e.slice(0, n);
621
- let r = I(A(b(t)));
622
- return r || (r = I(A(b(e)))), q(r) || r;
1009
+ let i = L(O(N(t)));
1010
+ return i || (i = L(O(N(e)))), pe(i) || i;
623
1011
  }
624
- const X = /(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i, J = /\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;
625
- function We(e, n) {
626
- return !!(e && X.test(e) || n && J.test(n));
1012
+ const ue = /(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i, de = /\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;
1013
+ function hn(e, n) {
1014
+ return !!(e && ue.test(e) || n && de.test(n));
627
1015
  }
628
- const Q = 3, Z = 600;
629
- function je(e, n) {
630
- return e >= Q || n >= Z;
1016
+ const me = 3, fe = 600;
1017
+ function En(e, n) {
1018
+ return e >= me || n >= fe;
631
1019
  }
632
- function ee(e, n) {
633
- const t = new Set(e.disabledIntents ?? []), r = e.intentOverrides ?? {}, a = n.intents.filter((s) => !t.has(s.intent)).map((s) => te(s, r[s.intent]));
1020
+ function ge(e, n) {
1021
+ const t = new Set(e.disabledIntents ?? []), i = e.intentOverrides ?? {}, a = n.intents.filter((o) => !t.has(o.intent)).map((o) => Ee(o, i[o.intent]));
634
1022
  if (!e.extraIntents || e.extraIntents.length === 0) return a;
635
- const i = new Set(a.map((s) => s.intent));
636
- for (const s of e.extraIntents)
637
- i.has(s.intent) || (a.push(s), i.add(s.intent));
1023
+ const r = new Set(a.map((o) => o.intent));
1024
+ for (const o of e.extraIntents)
1025
+ r.has(o.intent) || (a.push(o), r.add(o.intent));
638
1026
  return a;
639
1027
  }
640
- function ne(e, n) {
1028
+ function he(e, n) {
641
1029
  const t = {};
642
- for (const r of e.intents) {
643
- if (!r.togglable) continue;
644
- const a = n?.[r.intent];
645
- t[r.intent] = a ?? r.defaultEnabled ?? !0;
1030
+ for (const i of e.intents) {
1031
+ if (!i.togglable) continue;
1032
+ const a = n?.[i.intent];
1033
+ t[i.intent] = a ?? i.defaultEnabled ?? !0;
646
1034
  }
647
1035
  return t;
648
1036
  }
649
- function Ke(e, n) {
650
- const t = ne(e, n);
651
- return Object.entries(t).filter(([, r]) => !r).map(([r]) => r);
1037
+ function yn(e, n) {
1038
+ const t = he(e, n);
1039
+ return Object.entries(t).filter(([, i]) => !i).map(([i]) => i);
652
1040
  }
653
- function te(e, n) {
1041
+ function Ee(e, n) {
654
1042
  return n ? {
655
1043
  intent: n.intent ?? e.intent,
656
1044
  targetSchemes: n.targetSchemes ?? e.targetSchemes,
657
1045
  transport: n.transport ?? e.transport
658
1046
  } : e;
659
1047
  }
660
- function Ye(e, n) {
1048
+ function bn(e, n) {
661
1049
  const t = [];
662
- for (const r of e) {
663
- if (!r.enabled) continue;
664
- const a = n[r.providerId];
1050
+ for (const i of e) {
1051
+ if (!i.enabled) continue;
1052
+ const a = n[i.providerId];
665
1053
  if (a)
666
- for (const i of ee(r, a))
667
- t.push({ channel: r, description: a, capability: i });
1054
+ for (const r of ge(i, a))
1055
+ t.push({ channel: i, description: a, capability: r });
668
1056
  }
669
1057
  return t;
670
1058
  }
671
- function ze(e, n) {
1059
+ function An(e, n) {
672
1060
  return n.filter((t) => t.capability.intent === e);
673
1061
  }
674
- function re(e, n) {
1062
+ function ye(e, n) {
675
1063
  return n.filter((t) => t.capability.targetSchemes.includes(e));
676
1064
  }
677
- function qe(e, n) {
678
- return re(e.scheme, n);
1065
+ function In(e, n) {
1066
+ return ye(e.scheme, n);
679
1067
  }
680
- function Xe(e, n, t) {
681
- const r = [];
1068
+ function _n(e, n, t) {
1069
+ const i = [];
682
1070
  for (const a of e)
683
- for (const i of t)
684
- i.capability.intent === n && i.capability.targetSchemes.includes(a.scheme) && r.push({ channelIntent: i, endpoint: a });
685
- return r;
1071
+ for (const r of t)
1072
+ r.capability.intent === n && r.capability.targetSchemes.includes(a.scheme) && i.push({ channelIntent: r, endpoint: a });
1073
+ return i;
686
1074
  }
687
- var ae = /* @__PURE__ */ ((e) => (e.MAILTO = "mailto", e.SIP = "sip", e.TEL = "tel", e.WEBHOOK = "webhook", e.USERNAME = "username", e.ID = "id", e.CUSTOM = "custom", e.URL = "url", e.TELEGRAM = "telegram", e.WHATSAPP = "whatsapp", e.MESSENGER = "messenger", e.INSTAGRAM = "instagram", e.VIBER = "viber", e.SMS = "sms", e.FAX = "fax", e.TEAMS = "teams", e.CALENDAR = "calendar", e))(ae || {});
688
- const Je = "message_window", Qe = "message_templates", Ze = {
1075
+ var be = /* @__PURE__ */ ((e) => (e.MAILTO = "mailto", e.SIP = "sip", e.TEL = "tel", e.WEBHOOK = "webhook", e.USERNAME = "username", e.ID = "id", e.CUSTOM = "custom", e.URL = "url", e.TELEGRAM = "telegram", e.WHATSAPP = "whatsapp", e.MESSENGER = "messenger", e.INSTAGRAM = "instagram", e.VIBER = "viber", e.SMS = "sms", e.FAX = "fax", e.TEAMS = "teams", e.CALENDAR = "calendar", e))(be || {});
1076
+ const Tn = "message_window", Mn = "message_templates", Sn = {
689
1077
  // E-mail
690
1078
  FROM: "from",
691
1079
  TO: "to",
@@ -702,88 +1090,105 @@ const Je = "message_window", Qe = "message_templates", Ze = {
702
1090
  // Voice/conference
703
1091
  HOST: "host",
704
1092
  PARTICIPANT: "participant"
705
- }, en = (e, n) => ({ intent: e, ...n }), nn = "folder_management", tn = "remote_search", rn = { ok: !1, code: "UNSUPPORTED", message: "Provider does not support this op" }, an = 9e4, sn = "installation-id";
1093
+ }, vn = (e, n) => ({ intent: e, ...n }), Cn = "folder_management", Dn = "remote_search", Nn = { ok: !1, code: "UNSUPPORTED", message: "Provider does not support this op" }, On = 9e4, Ln = "installation-id";
706
1094
  export {
707
- _ as AI_VENDORS,
708
- ge as CLASSIFY_VARS,
709
- le as CORE_DIMENSIONS,
710
- ae as CommunicationScheme,
711
- Pe as DEFAULT_MEMORY_BUDGET,
712
- V as DEFAULT_PHONE_REGION,
713
- nn as FEATURE_FOLDER_MANAGEMENT,
714
- tn as FEATURE_REMOTE_SEARCH,
715
- sn as INSTALLATION_HEADER,
716
- Ze as InteractionParticipantRole,
717
- Ue as MAX_MEMORY_BUDGET,
718
- ke as MAX_MEMORY_CHARS,
719
- xe as MIN_MEMORY_BUDGET,
720
- P as PAUSED_RUN_STATUSES,
721
- p as PHONE_REGIONS,
722
- an as PRESENCE_ONLINE_WINDOW_MS,
723
- Qe as PROVIDER_FEATURE_MESSAGE_TEMPLATES,
724
- Je as PROVIDER_FEATURE_MESSAGE_WINDOW,
725
- K as PUBLIC_EMAIL_DOMAINS,
726
- G as RELATED_SUBJECT_KINDS,
727
- he as SIGNATURE_INTENTS,
728
- Z as SUMMARY_MIN_LAST_CHARS,
729
- Q as SUMMARY_MIN_MESSAGES,
730
- U as TERMINAL_RUN_STATUSES,
731
- fe as TRIGGER_VARS,
732
- rn as UNSUPPORTED,
733
- L as USAGE_DIMENSIONS,
734
- R as USAGE_DIMENSION_IDS,
735
- x as actingIdentityKey,
736
- oe as activityTimestamp,
737
- be as actorKey,
738
- Me as aiVendorDefaultModel,
739
- _e as aiVendorLabel,
740
- Te as aiVendorNeedsBaseUrl,
741
- Se as aiVendorsWith,
742
- De as applySignature,
743
- ie as buildActivityPreview,
744
- Ye as buildChannelIntents,
745
- ve as cleanMessageText,
746
- en as defineIntent,
747
- Ke as disabledIntentsFromCapabilities,
748
- Ve as emailDomain,
749
- Fe as endpointKey,
750
- qe as filterByEndpoint,
751
- ze as filterByIntent,
752
- re as filterByTargetScheme,
753
- d as findAiVendor,
754
- ce as flattenLocales,
755
- C as floorToPeriod,
756
- k as formatActingIdentity,
757
- D as formatPeriod,
758
- se as getActivitySeenUserIds,
759
- Ce as getContactEndpoints,
760
- Re as getShortTitle,
761
- Le as getUrgencyScore,
762
- pe as humanizeAction,
763
- Oe as isAssigned,
764
- Ne as isClosed,
765
- ye as isInteractionUnseen,
766
- We as isLikelyBulk,
767
- Ie as isPaused,
768
- He as isPublicEmailDomain,
769
- Ae as isRetryable,
770
- $ as isTerminal,
771
- je as isThreadLongEnough,
772
- we as looksLikeEmail,
773
- Xe as matchContactToIntents,
774
- Be as needsPhoneRegion,
775
- M as normalizeEmail,
776
- Ee as parseActingIdentity,
777
- ue as periodsInRange,
778
- Ge as phoneSuffix,
779
- me as playbookActor,
780
- j as registrableDomain,
781
- $e as relatedByDefault,
782
- ne as resolveAccountCapabilities,
783
- ee as resolveChannelIntents,
784
- w as resolveSignature,
785
- S as stripHtml,
786
- E as toE164,
787
- y as usageMetricId,
788
- de as usageMetrics
1095
+ s as ACTIVITY_CATALOG,
1096
+ k as AI_VENDORS,
1097
+ K as ActivityTypeRegistry,
1098
+ Ne as BUILT_IN_ONLY,
1099
+ Ge as CLASSIFY_VARS,
1100
+ Re as CORE_DIMENSIONS,
1101
+ be as CommunicationScheme,
1102
+ ln as DEFAULT_MEMORY_BUDGET,
1103
+ ee as DEFAULT_PHONE_REGION,
1104
+ Cn as FEATURE_FOLDER_MANAGEMENT,
1105
+ Dn as FEATURE_REMOTE_SEARCH,
1106
+ Ln as INSTALLATION_HEADER,
1107
+ Sn as InteractionParticipantRole,
1108
+ on as MAX_MEMORY_BUDGET,
1109
+ an as MAX_MEMORY_CHARS,
1110
+ rn as MIN_MEMORY_BUDGET,
1111
+ X as PAUSED_RUN_STATUSES,
1112
+ y as PHONE_REGIONS,
1113
+ On as PRESENCE_ONLINE_WINDOW_MS,
1114
+ Mn as PROVIDER_FEATURE_MESSAGE_TEMPLATES,
1115
+ Tn as PROVIDER_FEATURE_MESSAGE_WINDOW,
1116
+ le as PUBLIC_EMAIL_DOMAINS,
1117
+ Z as RELATED_SUBJECT_KINDS,
1118
+ qe as SIGNATURE_INTENTS,
1119
+ fe as SUMMARY_MIN_LAST_CHARS,
1120
+ me as SUMMARY_MIN_MESSAGES,
1121
+ q as TERMINAL_RUN_STATUSES,
1122
+ Ke as TRIGGER_VARS,
1123
+ Nn as UNSUPPORTED,
1124
+ B as USAGE_DIMENSIONS,
1125
+ F as USAGE_DIMENSION_IDS,
1126
+ z as actingIdentityKey,
1127
+ Ae as activityIconOf,
1128
+ De as activityJoinUrl,
1129
+ x as activitySnippet,
1130
+ U as activityTextParams,
1131
+ Ce as activityTimelineText,
1132
+ ke as activityTimestamp,
1133
+ l as activityTypeInfo,
1134
+ He as actorKey,
1135
+ We as aiVendorDefaultModel,
1136
+ Fe as aiVendorLabel,
1137
+ ze as aiVendorNeedsBaseUrl,
1138
+ Ye as aiVendorsWith,
1139
+ Xe as applySignature,
1140
+ Oe as buildActivityPreview,
1141
+ bn as buildChannelIntents,
1142
+ Me as carriesText,
1143
+ Ie as channelKindOf,
1144
+ gn as cleanMessageText,
1145
+ vn as defineIntent,
1146
+ yn as disabledIntentsFromCapabilities,
1147
+ un as emailDomain,
1148
+ fn as endpointKey,
1149
+ In as filterByEndpoint,
1150
+ An as filterByIntent,
1151
+ ye as filterByTargetScheme,
1152
+ E as findAiVendor,
1153
+ $e as flattenLocales,
1154
+ V as floorToPeriod,
1155
+ Y as formatActingIdentity,
1156
+ w as formatPeriod,
1157
+ Le as getActivitySeenUserIds,
1158
+ Je as getContactEndpoints,
1159
+ nn as getShortTitle,
1160
+ en as getUrgencyScore,
1161
+ Pe as humanizeAction,
1162
+ Qe as isAssigned,
1163
+ Ze as isClosed,
1164
+ tn as isInteractionUnseen,
1165
+ hn as isLikelyBulk,
1166
+ _e as isMessageType,
1167
+ Be as isPaused,
1168
+ ve as isPlaybookAuthoredType,
1169
+ dn as isPublicEmailDomain,
1170
+ Te as isReplyableType,
1171
+ je as isRetryable,
1172
+ J as isTerminal,
1173
+ En as isThreadLongEnough,
1174
+ cn as looksLikeEmail,
1175
+ _n as matchContactToIntents,
1176
+ Se as messageCountsAs,
1177
+ mn as needsPhoneRegion,
1178
+ R as normalizeEmail,
1179
+ we as parseActingIdentity,
1180
+ xe as periodsInRange,
1181
+ pn as phoneSuffix,
1182
+ Ve as playbookActor,
1183
+ g as readPath,
1184
+ oe as registrableDomain,
1185
+ sn as relatedByDefault,
1186
+ he as resolveAccountCapabilities,
1187
+ h as resolveActivityText,
1188
+ ge as resolveChannelIntents,
1189
+ Q as resolveSignature,
1190
+ $ as stripHtml,
1191
+ C as toE164,
1192
+ W as usageMetricId,
1193
+ Ue as usageMetrics
789
1194
  };