@opencxh/domain 1.130.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/entities/activity/catalog.d.ts +123 -0
- package/dist/entities/activity/catalog.test.d.ts +1 -0
- package/dist/entities/activity/descriptor.d.ts +79 -0
- package/dist/entities/activity/descriptor.test.d.ts +1 -0
- package/dist/entities/activity/index.d.ts +4 -0
- package/dist/entities/activity/preview.d.ts +13 -2
- package/dist/entities/activity/resolve.d.ts +59 -0
- package/dist/entities/activity/timestamp.d.ts +15 -0
- package/dist/entities/interaction/types.d.ts +19 -1
- package/dist/index.cjs +6 -6
- package/dist/index.js +754 -345
- package/dist/platform/sdk.d.ts +8 -1
- package/dist/platform/services.d.ts +7 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,113 +1,504 @@
|
|
|
1
|
-
function
|
|
1
|
+
function $(e) {
|
|
2
2
|
return e.replace(/<style[\s\S]*?<\/style>/gi, " ").replace(/<script[\s\S]*?<\/script>/gi, " ").replace(/<[^>]+>/g, " ").replace(/ /g, " ").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/\s+/g, " ").trim();
|
|
3
3
|
}
|
|
4
|
-
function
|
|
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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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}`;
|
|
19
179
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return `${
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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}`;
|
|
189
|
+
}
|
|
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}`
|
|
92
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];
|
|
93
342
|
}
|
|
94
|
-
function
|
|
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];
|
|
382
|
+
}
|
|
383
|
+
return t == null ? "" : typeof t == "string" ? t : typeof t == "number" || typeof t == "boolean" ? String(t) : "";
|
|
384
|
+
}
|
|
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:
|
|
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
|
|
105
|
-
const
|
|
106
|
-
if (!
|
|
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(([
|
|
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
|
-
|
|
498
|
+
function ke(e) {
|
|
499
|
+
return e.createdAt ?? 0;
|
|
500
|
+
}
|
|
501
|
+
const Re = [
|
|
111
502
|
{ id: "agent", label: "Agent", labelSource: "user" },
|
|
112
503
|
{ id: "team", label: "Team", labelSource: "team" },
|
|
113
504
|
{ id: "inbox", label: "Inbox", labelSource: "inbox" },
|
|
@@ -117,57 +508,57 @@ const oe = [
|
|
|
117
508
|
{ id: "handledBy", label: "Afhandelaar", labelSource: "raw" },
|
|
118
509
|
{ id: "time", label: "Tijd", labelSource: "raw" }
|
|
119
510
|
];
|
|
120
|
-
function
|
|
511
|
+
function $e(e) {
|
|
121
512
|
const n = [];
|
|
122
513
|
for (const t of Object.keys(e))
|
|
123
|
-
for (const
|
|
124
|
-
n.push({ lang: t, key:
|
|
514
|
+
for (const i of Object.keys(e[t]))
|
|
515
|
+
n.push({ lang: t, key: i, value: e[t][i] });
|
|
125
516
|
return n;
|
|
126
517
|
}
|
|
127
|
-
function
|
|
518
|
+
function f(e) {
|
|
128
519
|
return e < 10 ? `0${e}` : `${e}`;
|
|
129
520
|
}
|
|
130
|
-
function
|
|
131
|
-
const t = new Date(e),
|
|
132
|
-
return n === "day" ?
|
|
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())}`;
|
|
133
524
|
}
|
|
134
|
-
function
|
|
525
|
+
function V(e, n) {
|
|
135
526
|
const t = new Date(e);
|
|
136
527
|
return t.setUTCMinutes(0, 0, 0), n === "day" && t.setUTCHours(0), t.getTime();
|
|
137
528
|
}
|
|
138
|
-
const
|
|
139
|
-
function
|
|
140
|
-
const
|
|
141
|
-
for (let
|
|
142
|
-
a.push(
|
|
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));
|
|
143
534
|
return a;
|
|
144
535
|
}
|
|
145
|
-
const
|
|
536
|
+
const B = [
|
|
146
537
|
{ id: "resource", label: "Resource", labelSource: "raw" },
|
|
147
538
|
{ id: "origin", label: "Herkomst", labelSource: "raw" }
|
|
148
|
-
],
|
|
149
|
-
function
|
|
539
|
+
], F = B.map((e) => e.id);
|
|
540
|
+
function W(e, n) {
|
|
150
541
|
return `${e}.usage.${n}`;
|
|
151
542
|
}
|
|
152
|
-
function
|
|
543
|
+
function Ue(e, n) {
|
|
153
544
|
return n.map((t) => ({
|
|
154
|
-
id:
|
|
545
|
+
id: W(e, t.unit),
|
|
155
546
|
label: t.label,
|
|
156
547
|
category: "Verbruik",
|
|
157
548
|
valueType: t.valueType ?? "count",
|
|
158
549
|
aggregation: "sum",
|
|
159
550
|
supportedDimensions: [
|
|
160
551
|
"provider",
|
|
161
|
-
...
|
|
552
|
+
...F,
|
|
162
553
|
...t.extraDimensions ?? [],
|
|
163
554
|
"time"
|
|
164
555
|
]
|
|
165
556
|
}));
|
|
166
557
|
}
|
|
167
|
-
function
|
|
558
|
+
function Pe(e) {
|
|
168
559
|
return (e.startsWith("tool:") ? e.slice(5) : e).replace(/__/g, " · ").replace(/\./g, " · ").replace(/_/g, " ");
|
|
169
560
|
}
|
|
170
|
-
const
|
|
561
|
+
const Ke = [
|
|
171
562
|
{ name: "text", type: "string" },
|
|
172
563
|
{ name: "subject", type: "string" },
|
|
173
564
|
{ name: "from", type: "string" },
|
|
@@ -190,7 +581,7 @@ const pe = [
|
|
|
190
581
|
// een nieuw adres) — een stap die hierop leunt hoort dus een `condition` te hebben.
|
|
191
582
|
{ name: "contactId", type: "string" },
|
|
192
583
|
{ name: "companyId", type: "string" }
|
|
193
|
-
],
|
|
584
|
+
], Ge = {
|
|
194
585
|
topics: [
|
|
195
586
|
{ name: "topic", type: "string" },
|
|
196
587
|
{ name: "confidence", type: "number" }
|
|
@@ -201,7 +592,7 @@ const pe = [
|
|
|
201
592
|
],
|
|
202
593
|
extract: []
|
|
203
594
|
};
|
|
204
|
-
function
|
|
595
|
+
function Y(e) {
|
|
205
596
|
switch (e.kind) {
|
|
206
597
|
case "user":
|
|
207
598
|
return `user:${e.userId}`;
|
|
@@ -211,22 +602,22 @@ function k(e) {
|
|
|
211
602
|
return "org";
|
|
212
603
|
}
|
|
213
604
|
}
|
|
214
|
-
function
|
|
605
|
+
function we(e) {
|
|
215
606
|
if (typeof e != "string") return;
|
|
216
607
|
const n = e.trim();
|
|
217
608
|
if (n === "org") return { kind: "org" };
|
|
218
609
|
const t = n.indexOf(":");
|
|
219
610
|
if (t <= 0) return;
|
|
220
|
-
const
|
|
611
|
+
const i = n.slice(0, t), a = n.slice(t + 1).trim();
|
|
221
612
|
if (a) {
|
|
222
|
-
if (
|
|
223
|
-
if (
|
|
613
|
+
if (i === "user") return { kind: "user", userId: a };
|
|
614
|
+
if (i === "team") return { kind: "team", teamId: a };
|
|
224
615
|
}
|
|
225
616
|
}
|
|
226
|
-
function
|
|
227
|
-
return
|
|
617
|
+
function z(e) {
|
|
618
|
+
return Y(e);
|
|
228
619
|
}
|
|
229
|
-
function
|
|
620
|
+
function Ve(e) {
|
|
230
621
|
switch (e.kind) {
|
|
231
622
|
case "personal":
|
|
232
623
|
return { kind: "user", userId: e.userId };
|
|
@@ -236,20 +627,20 @@ function Ee(e) {
|
|
|
236
627
|
return { kind: "org" };
|
|
237
628
|
}
|
|
238
629
|
}
|
|
239
|
-
function
|
|
240
|
-
return
|
|
630
|
+
function He(e) {
|
|
631
|
+
return z(e);
|
|
241
632
|
}
|
|
242
|
-
const
|
|
243
|
-
function
|
|
244
|
-
return
|
|
633
|
+
const q = ["done", "escalated", "failed", "timed_out", "stopped"], X = ["awaiting_approval", "awaiting_reply"];
|
|
634
|
+
function J(e) {
|
|
635
|
+
return q.includes(e);
|
|
245
636
|
}
|
|
246
|
-
function
|
|
247
|
-
return
|
|
637
|
+
function je(e) {
|
|
638
|
+
return J(e);
|
|
248
639
|
}
|
|
249
|
-
function
|
|
250
|
-
return
|
|
640
|
+
function Be(e) {
|
|
641
|
+
return X.includes(e);
|
|
251
642
|
}
|
|
252
|
-
const
|
|
643
|
+
const k = [
|
|
253
644
|
{
|
|
254
645
|
id: "openai",
|
|
255
646
|
label: "OpenAI",
|
|
@@ -337,53 +728,53 @@ const _ = [
|
|
|
337
728
|
defaultModel: "default"
|
|
338
729
|
}
|
|
339
730
|
];
|
|
340
|
-
function
|
|
341
|
-
return
|
|
731
|
+
function E(e) {
|
|
732
|
+
return k.find((n) => n.id === e);
|
|
342
733
|
}
|
|
343
|
-
function
|
|
344
|
-
return
|
|
734
|
+
function Fe(e) {
|
|
735
|
+
return E(e)?.label ?? e;
|
|
345
736
|
}
|
|
346
|
-
function
|
|
347
|
-
return
|
|
737
|
+
function We(e, n = "gpt-5-mini") {
|
|
738
|
+
return E(e)?.defaultModel ?? n;
|
|
348
739
|
}
|
|
349
|
-
function
|
|
350
|
-
return
|
|
740
|
+
function Ye(e) {
|
|
741
|
+
return k.filter((n) => n.capabilities.includes(e));
|
|
351
742
|
}
|
|
352
|
-
function
|
|
353
|
-
const n =
|
|
743
|
+
function ze(e) {
|
|
744
|
+
const n = E(e);
|
|
354
745
|
return !!n && !n.baseUrl;
|
|
355
746
|
}
|
|
356
|
-
const
|
|
357
|
-
function
|
|
747
|
+
const qe = /* @__PURE__ */ new Set(["mail", "message"]);
|
|
748
|
+
function Q(e, n) {
|
|
358
749
|
const t = e.settings?.signatures?.[n];
|
|
359
750
|
return !t || !t.enabled || !t.body || t.body.trim() === "" ? null : t;
|
|
360
751
|
}
|
|
361
|
-
function
|
|
752
|
+
function Xe(e, n, t, i = "html") {
|
|
362
753
|
if (!e) return t;
|
|
363
|
-
const a =
|
|
364
|
-
return a ? `${t}${
|
|
754
|
+
const a = Q(e, n);
|
|
755
|
+
return a ? `${t}${i === "text" ? `
|
|
365
756
|
|
|
366
757
|
` : n === "mail" ? "<br><br>-- <br>" : "<br><br>"}${a.body}` : t;
|
|
367
758
|
}
|
|
368
|
-
function
|
|
759
|
+
function Je(e) {
|
|
369
760
|
return e.endpoints ?? [];
|
|
370
761
|
}
|
|
371
|
-
const
|
|
762
|
+
const Qe = (e) => !!e.assignedUserId || !!e.assignedInboxId, Ze = (e) => e.status === "closed", en = (e) => ({
|
|
372
763
|
urgent: 10,
|
|
373
764
|
high: 5,
|
|
374
765
|
normal: 2,
|
|
375
766
|
low: 1
|
|
376
|
-
})[e.priority] || 0,
|
|
377
|
-
function
|
|
767
|
+
})[e.priority] || 0, nn = (e, n = 30) => e.title?.length <= n ? e.title : `${e.title.substring(0, n)}...`;
|
|
768
|
+
function tn(e, n) {
|
|
378
769
|
return e.lastActivityAt ? !(e.seenBy ?? []).includes(n) : !1;
|
|
379
770
|
}
|
|
380
|
-
const
|
|
381
|
-
function
|
|
771
|
+
const an = 2e3, rn = 500, on = 12e3, ln = 4e3, Z = ["contact", "company"];
|
|
772
|
+
function sn(e) {
|
|
382
773
|
if (!e) return !1;
|
|
383
774
|
const n = e.slice(0, e.indexOf(":"));
|
|
384
|
-
return
|
|
775
|
+
return Z.includes(n);
|
|
385
776
|
}
|
|
386
|
-
const
|
|
777
|
+
const y = {
|
|
387
778
|
// The lower bounds are deliberately generous: service ranges (0800/0900) are
|
|
388
779
|
// shorter than geographic numbers, and a too-strict minimum silently drops them.
|
|
389
780
|
// An over-permissive key is harmless — it simply matches nothing.
|
|
@@ -406,81 +797,81 @@ const p = {
|
|
|
406
797
|
PL: { callingCode: "48", nsnMin: 9, nsnMax: 9 },
|
|
407
798
|
US: { callingCode: "1", nsnMin: 10, nsnMax: 10 },
|
|
408
799
|
CA: { callingCode: "1", nsnMin: 10, nsnMax: 10 }
|
|
409
|
-
},
|
|
410
|
-
new Set(Object.values(
|
|
800
|
+
}, ee = "NL", ne = 15, te = 8, ie = Array.from(
|
|
801
|
+
new Set(Object.values(y).map((e) => e.callingCode))
|
|
411
802
|
).sort((e, n) => n.length - e.length);
|
|
412
|
-
function
|
|
803
|
+
function S(e) {
|
|
413
804
|
if (e)
|
|
414
|
-
return
|
|
805
|
+
return y[e.trim().toUpperCase()];
|
|
415
806
|
}
|
|
416
|
-
function
|
|
807
|
+
function d(e, n) {
|
|
417
808
|
return e.length >= n.nsnMin && e.length <= n.nsnMax;
|
|
418
809
|
}
|
|
419
|
-
function
|
|
420
|
-
if (e.length >
|
|
421
|
-
for (const n of
|
|
810
|
+
function v(e) {
|
|
811
|
+
if (e.length > ne) return null;
|
|
812
|
+
for (const n of ie) {
|
|
422
813
|
if (!e.startsWith(n)) continue;
|
|
423
814
|
const t = e.slice(n.length);
|
|
424
|
-
for (const
|
|
425
|
-
if (
|
|
426
|
-
const a =
|
|
427
|
-
if (
|
|
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}`;
|
|
428
819
|
}
|
|
429
820
|
return null;
|
|
430
821
|
}
|
|
431
|
-
return e.length <
|
|
822
|
+
return e.length < te ? null : `+${e}`;
|
|
432
823
|
}
|
|
433
|
-
function
|
|
824
|
+
function ae(e) {
|
|
434
825
|
let n = e.trim();
|
|
435
826
|
const t = n.match(/^(sips?|tel|whatsapp):/i);
|
|
436
827
|
t && (n = n.slice(t[0].length));
|
|
437
|
-
const
|
|
438
|
-
return
|
|
828
|
+
const i = n.indexOf("@");
|
|
829
|
+
return i >= 0 && (n = n.slice(0, i)), n.trim();
|
|
439
830
|
}
|
|
440
|
-
function
|
|
831
|
+
function cn(e) {
|
|
441
832
|
if (!e) return !1;
|
|
442
833
|
const n = e.indexOf("@");
|
|
443
834
|
if (n <= 0) return !1;
|
|
444
835
|
const t = e.slice(0, n).trim();
|
|
445
836
|
return !/^[+\d\s().-]+$/.test(t);
|
|
446
837
|
}
|
|
447
|
-
function
|
|
838
|
+
function C(e, n) {
|
|
448
839
|
if (!e) return null;
|
|
449
|
-
const t =
|
|
840
|
+
const t = ae(e);
|
|
450
841
|
if (!t) return null;
|
|
451
|
-
const
|
|
842
|
+
const i = t.startsWith("+"), a = t.replace(/\D/g, "");
|
|
452
843
|
if (!a) return null;
|
|
453
|
-
if (
|
|
454
|
-
if (a.startsWith("00")) return
|
|
455
|
-
const
|
|
456
|
-
if (!
|
|
457
|
-
const
|
|
458
|
-
if (
|
|
459
|
-
const
|
|
460
|
-
return
|
|
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;
|
|
461
852
|
}
|
|
462
|
-
if (a.startsWith(
|
|
463
|
-
const
|
|
464
|
-
if (
|
|
853
|
+
if (a.startsWith(r.callingCode)) {
|
|
854
|
+
const c = a.slice(r.callingCode.length);
|
|
855
|
+
if (d(c, r)) return `+${r.callingCode}${c}`;
|
|
465
856
|
}
|
|
466
|
-
return !
|
|
857
|
+
return !o && d(a, r) ? `+${r.callingCode}${a}` : null;
|
|
467
858
|
}
|
|
468
|
-
function
|
|
859
|
+
function pn(e, n = 9) {
|
|
469
860
|
const t = (e ?? "").replace(/\D/g, "");
|
|
470
861
|
return t.length < n ? null : t.slice(-n);
|
|
471
862
|
}
|
|
472
|
-
function
|
|
863
|
+
function R(e) {
|
|
473
864
|
if (!e) return null;
|
|
474
865
|
const n = e.trim().toLowerCase(), t = n.lastIndexOf("@");
|
|
475
866
|
if (t <= 0 || t === n.length - 1) return null;
|
|
476
|
-
const
|
|
477
|
-
return !
|
|
867
|
+
const i = n.slice(0, t).split("+")[0], a = n.slice(t + 1);
|
|
868
|
+
return !i || !a.includes(".") ? null : `${i}@${a}`;
|
|
478
869
|
}
|
|
479
|
-
function
|
|
480
|
-
const n =
|
|
870
|
+
function un(e) {
|
|
871
|
+
const n = R(e);
|
|
481
872
|
return n ? n.slice(n.lastIndexOf("@") + 1) : null;
|
|
482
873
|
}
|
|
483
|
-
const
|
|
874
|
+
const re = /* @__PURE__ */ new Set([
|
|
484
875
|
"co.uk",
|
|
485
876
|
"org.uk",
|
|
486
877
|
"gov.uk",
|
|
@@ -490,14 +881,14 @@ const W = /* @__PURE__ */ new Set([
|
|
|
490
881
|
"com.br",
|
|
491
882
|
"co.za"
|
|
492
883
|
]);
|
|
493
|
-
function
|
|
884
|
+
function oe(e) {
|
|
494
885
|
if (!e) return null;
|
|
495
886
|
const n = e.trim().toLowerCase().replace(/\.$/, "").split(".").filter(Boolean);
|
|
496
887
|
if (n.length < 2) return null;
|
|
497
888
|
const t = n.slice(-2).join(".");
|
|
498
|
-
return
|
|
889
|
+
return re.has(t) && n.length >= 3 ? n.slice(-3).join(".") : t;
|
|
499
890
|
}
|
|
500
|
-
const
|
|
891
|
+
const le = /* @__PURE__ */ new Set([
|
|
501
892
|
"gmail.com",
|
|
502
893
|
"googlemail.com",
|
|
503
894
|
"outlook.com",
|
|
@@ -542,34 +933,34 @@ const K = /* @__PURE__ */ new Set([
|
|
|
542
933
|
"proximus.be",
|
|
543
934
|
"scarlet.be"
|
|
544
935
|
]);
|
|
545
|
-
function
|
|
546
|
-
const n =
|
|
547
|
-
return n ?
|
|
936
|
+
function dn(e) {
|
|
937
|
+
const n = oe(e);
|
|
938
|
+
return n ? le.has(n) : !1;
|
|
548
939
|
}
|
|
549
|
-
function
|
|
940
|
+
function mn(e) {
|
|
550
941
|
if (!e) return !1;
|
|
551
942
|
const n = e.trim().toLowerCase();
|
|
552
943
|
return n === "tel" || n === "sms" || n === "whatsapp" || n === "fax";
|
|
553
944
|
}
|
|
554
|
-
function
|
|
945
|
+
function fn(e, n, t) {
|
|
555
946
|
if (!e || !n) return null;
|
|
556
|
-
const
|
|
557
|
-
if (
|
|
558
|
-
const
|
|
559
|
-
return
|
|
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;
|
|
560
951
|
}
|
|
561
|
-
if (
|
|
562
|
-
const
|
|
563
|
-
return
|
|
952
|
+
if (i === "fax") {
|
|
953
|
+
const r = C(n, t);
|
|
954
|
+
return r ? `fax:${r}` : null;
|
|
564
955
|
}
|
|
565
|
-
if (
|
|
566
|
-
const
|
|
567
|
-
return
|
|
956
|
+
if (i === "mailto" || i === "email") {
|
|
957
|
+
const r = R(n);
|
|
958
|
+
return r ? `mailto:${r}` : null;
|
|
568
959
|
}
|
|
569
960
|
const a = n.trim().toLowerCase();
|
|
570
|
-
return a ? `${
|
|
961
|
+
return a ? `${i}:${a}` : null;
|
|
571
962
|
}
|
|
572
|
-
const
|
|
963
|
+
const se = [
|
|
573
964
|
/<blockquote/i,
|
|
574
965
|
/class="?gmail_quote/i,
|
|
575
966
|
// Gmail quote container
|
|
@@ -582,107 +973,107 @@ const Y = [
|
|
|
582
973
|
// Outlook underscore separator before "From:"
|
|
583
974
|
/\bOn\b[\s\S]{0,200}?\bwrote:/i
|
|
584
975
|
// Gmail "On <date> <name> wrote:"
|
|
585
|
-
],
|
|
586
|
-
function
|
|
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) {
|
|
587
978
|
const n = e.split(`
|
|
588
979
|
`);
|
|
589
980
|
for (let t = 0; t < n.length; t++)
|
|
590
|
-
if (
|
|
981
|
+
if (ce.test(n[t]) || D.test(n[t]) && n.slice(t + 1, t + 4).some((i) => D.test(i)))
|
|
591
982
|
return n.slice(0, t).join(`
|
|
592
983
|
`).trim();
|
|
593
984
|
return e;
|
|
594
985
|
}
|
|
595
|
-
function
|
|
986
|
+
function N(e) {
|
|
596
987
|
let n = e;
|
|
597
988
|
return n = n.replace(/<(script|style)[\s\S]*?<\/\1>/gi, ""), n = n.replace(/<br\s*\/?>/gi, `
|
|
598
989
|
`), n = n.replace(/<\/(p|div|li|tr|h[1-6]|ul|ol|table)>/gi, `
|
|
599
990
|
`), n = n.replace(/<[^>]+>/g, ""), n = n.replace(/<[^>]*$/, ""), n;
|
|
600
991
|
}
|
|
601
|
-
function
|
|
992
|
+
function O(e) {
|
|
602
993
|
return e.replace(/ /gi, " ").replace(/</gi, "<").replace(/>/gi, ">").replace(/"/gi, '"').replace(/'/gi, "'").replace(/&#(\d+);/g, (n, t) => String.fromCharCode(Number(t))).replace(/&/gi, "&");
|
|
603
994
|
}
|
|
604
|
-
function
|
|
995
|
+
function L(e) {
|
|
605
996
|
return e.replace(/\r/g, "").replace(/[ \t]+/g, " ").replace(/ *\n */g, `
|
|
606
997
|
`).replace(/\n{3,}/g, `
|
|
607
998
|
|
|
608
999
|
`).trim();
|
|
609
1000
|
}
|
|
610
|
-
function
|
|
1001
|
+
function gn(e) {
|
|
611
1002
|
if (typeof e != "string" || !e) return "";
|
|
612
1003
|
let n = e.length;
|
|
613
|
-
for (const
|
|
614
|
-
const
|
|
615
|
-
|
|
1004
|
+
for (const r of se) {
|
|
1005
|
+
const o = e.search(r);
|
|
1006
|
+
o >= 0 && o < n && (n = o);
|
|
616
1007
|
}
|
|
617
1008
|
const t = e.slice(0, n);
|
|
618
|
-
let
|
|
619
|
-
return
|
|
1009
|
+
let i = L(O(N(t)));
|
|
1010
|
+
return i || (i = L(O(N(e)))), pe(i) || i;
|
|
620
1011
|
}
|
|
621
|
-
const
|
|
622
|
-
function
|
|
623
|
-
return !!(e &&
|
|
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));
|
|
624
1015
|
}
|
|
625
|
-
const
|
|
626
|
-
function
|
|
627
|
-
return e >=
|
|
1016
|
+
const me = 3, fe = 600;
|
|
1017
|
+
function En(e, n) {
|
|
1018
|
+
return e >= me || n >= fe;
|
|
628
1019
|
}
|
|
629
|
-
function
|
|
630
|
-
const t = new Set(e.disabledIntents ?? []),
|
|
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]));
|
|
631
1022
|
if (!e.extraIntents || e.extraIntents.length === 0) return a;
|
|
632
|
-
const
|
|
633
|
-
for (const
|
|
634
|
-
|
|
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));
|
|
635
1026
|
return a;
|
|
636
1027
|
}
|
|
637
|
-
function
|
|
1028
|
+
function he(e, n) {
|
|
638
1029
|
const t = {};
|
|
639
|
-
for (const
|
|
640
|
-
if (!
|
|
641
|
-
const a = n?.[
|
|
642
|
-
t[
|
|
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;
|
|
643
1034
|
}
|
|
644
1035
|
return t;
|
|
645
1036
|
}
|
|
646
|
-
function
|
|
647
|
-
const t =
|
|
648
|
-
return Object.entries(t).filter(([,
|
|
1037
|
+
function yn(e, n) {
|
|
1038
|
+
const t = he(e, n);
|
|
1039
|
+
return Object.entries(t).filter(([, i]) => !i).map(([i]) => i);
|
|
649
1040
|
}
|
|
650
|
-
function
|
|
1041
|
+
function Ee(e, n) {
|
|
651
1042
|
return n ? {
|
|
652
1043
|
intent: n.intent ?? e.intent,
|
|
653
1044
|
targetSchemes: n.targetSchemes ?? e.targetSchemes,
|
|
654
1045
|
transport: n.transport ?? e.transport
|
|
655
1046
|
} : e;
|
|
656
1047
|
}
|
|
657
|
-
function
|
|
1048
|
+
function bn(e, n) {
|
|
658
1049
|
const t = [];
|
|
659
|
-
for (const
|
|
660
|
-
if (!
|
|
661
|
-
const a = n[
|
|
1050
|
+
for (const i of e) {
|
|
1051
|
+
if (!i.enabled) continue;
|
|
1052
|
+
const a = n[i.providerId];
|
|
662
1053
|
if (a)
|
|
663
|
-
for (const
|
|
664
|
-
t.push({ channel:
|
|
1054
|
+
for (const r of ge(i, a))
|
|
1055
|
+
t.push({ channel: i, description: a, capability: r });
|
|
665
1056
|
}
|
|
666
1057
|
return t;
|
|
667
1058
|
}
|
|
668
|
-
function
|
|
1059
|
+
function An(e, n) {
|
|
669
1060
|
return n.filter((t) => t.capability.intent === e);
|
|
670
1061
|
}
|
|
671
|
-
function
|
|
1062
|
+
function ye(e, n) {
|
|
672
1063
|
return n.filter((t) => t.capability.targetSchemes.includes(e));
|
|
673
1064
|
}
|
|
674
|
-
function
|
|
675
|
-
return
|
|
1065
|
+
function In(e, n) {
|
|
1066
|
+
return ye(e.scheme, n);
|
|
676
1067
|
}
|
|
677
|
-
function
|
|
678
|
-
const
|
|
1068
|
+
function _n(e, n, t) {
|
|
1069
|
+
const i = [];
|
|
679
1070
|
for (const a of e)
|
|
680
|
-
for (const
|
|
681
|
-
|
|
682
|
-
return
|
|
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;
|
|
683
1074
|
}
|
|
684
|
-
var
|
|
685
|
-
const
|
|
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 = {
|
|
686
1077
|
// E-mail
|
|
687
1078
|
FROM: "from",
|
|
688
1079
|
TO: "to",
|
|
@@ -699,87 +1090,105 @@ const Xe = "message_window", Je = "message_templates", Qe = {
|
|
|
699
1090
|
// Voice/conference
|
|
700
1091
|
HOST: "host",
|
|
701
1092
|
PARTICIPANT: "participant"
|
|
702
|
-
},
|
|
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";
|
|
703
1094
|
export {
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
rn as
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
ze as
|
|
747
|
-
Ye as
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
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
|
|
785
1194
|
};
|