@opencxh/domain 1.154.0 → 1.158.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.
Files changed (35) hide show
  1. package/dist/entities/activity/catalog.d.ts +23 -0
  2. package/dist/entities/ai-profile/types.d.ts +19 -6
  3. package/dist/entities/ai-settings/types.d.ts +27 -0
  4. package/dist/entities/ai-settings/types.test.d.ts +1 -0
  5. package/dist/entities/assignment/index.d.ts +1 -0
  6. package/dist/entities/assignment/types.d.ts +142 -0
  7. package/dist/entities/assignment/types.test.d.ts +1 -0
  8. package/dist/entities/live-lens/index.d.ts +1 -0
  9. package/dist/entities/live-lens/types.d.ts +81 -0
  10. package/dist/entities/live-lens/types.test.d.ts +1 -0
  11. package/dist/entities/playbook/actor.d.ts +20 -0
  12. package/dist/entities/playbook/assignment.d.ts +123 -0
  13. package/dist/entities/playbook/assignment.test.d.ts +1 -0
  14. package/dist/entities/playbook/index.d.ts +1 -0
  15. package/dist/entities/playbook/status.test.d.ts +1 -0
  16. package/dist/entities/playbook/trigger-vars.d.ts +34 -3
  17. package/dist/entities/playbook/types.d.ts +412 -33
  18. package/dist/entities/read-state/types.d.ts +1 -5
  19. package/dist/entities/user/types.d.ts +56 -0
  20. package/dist/index.cjs +8 -8
  21. package/dist/index.d.ts +6 -0
  22. package/dist/index.js +1022 -523
  23. package/dist/platform/ai-tools.d.ts +20 -0
  24. package/dist/platform/audio-gate.test.d.ts +1 -0
  25. package/dist/platform/context.d.ts +16 -0
  26. package/dist/platform/presence.d.ts +59 -0
  27. package/dist/platform/resource.d.ts +39 -0
  28. package/dist/platform/sdk.d.ts +6 -0
  29. package/dist/platform/tool-sources.test.d.ts +1 -0
  30. package/dist/platform/transcript-cadence.d.ts +93 -0
  31. package/dist/platform/transcript-cadence.test.d.ts +1 -0
  32. package/dist/platform/transcript-sanitize.d.ts +1 -0
  33. package/dist/platform/transcript-sanitize.test.d.ts +1 -0
  34. package/dist/platform/work-mode.test.d.ts +1 -0
  35. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const Kt = 10, Bt = 10, Gt = 10, Ft = 5, ye = /* @__PURE__ */ new Set([
1
+ const un = 10, dn = 10, pn = 10, fn = 5, Ee = /* @__PURE__ */ new Set([
2
2
  "header",
3
3
  "section",
4
4
  "context",
@@ -8,13 +8,13 @@ const Kt = 10, Bt = 10, Gt = 10, Ft = 5, ye = /* @__PURE__ */ new Set([
8
8
  "actions",
9
9
  "attachments"
10
10
  ]);
11
- function S(e) {
11
+ function _(e) {
12
12
  if (typeof e == "string") return e.length > 0;
13
13
  if (!e || typeof e != "object") return !1;
14
14
  const t = e;
15
15
  return typeof t.key == "string" || typeof t.value == "string";
16
16
  }
17
- function Ht(e, t = () => {
17
+ function mn(e, t = () => {
18
18
  }) {
19
19
  if (!Array.isArray(e)) return [];
20
20
  const n = [];
@@ -25,19 +25,19 @@ function Ht(e, t = () => {
25
25
  }
26
26
  if (!i || typeof i != "object") continue;
27
27
  const r = i;
28
- if (!ye.has(r.type)) {
28
+ if (!Ee.has(r.type)) {
29
29
  t("unknown block type " + String(r.type));
30
30
  continue;
31
31
  }
32
32
  switch (r.type) {
33
33
  case "header":
34
- if (!S(r.text)) {
34
+ if (!_(r.text)) {
35
35
  t("a header without text");
36
36
  continue;
37
37
  }
38
38
  break;
39
39
  case "context":
40
- if (!S(r.text)) {
40
+ if (!_(r.text)) {
41
41
  t("a context block without text");
42
42
  continue;
43
43
  }
@@ -59,7 +59,7 @@ function Ht(e, t = () => {
59
59
  r.items.length > 10 && (t("more than 10 list items"), r.items = r.items.slice(0, 10));
60
60
  break;
61
61
  case "actions": {
62
- const a = Array.isArray(r.elements) ? r.elements : [], o = a.filter((s) => s && s.action_id && s.invoke && S(s.text));
62
+ const a = Array.isArray(r.elements) ? r.elements : [], o = a.filter((s) => s && s.action_id && s.invoke && _(s.text));
63
63
  if (o.length !== a.length && t("an action without action_id, invoke or text"), o.length === 0) continue;
64
64
  o.length > 5 && t("more than 5 actions"), r.elements = o.slice(0, 5);
65
65
  break;
@@ -69,24 +69,24 @@ function Ht(e, t = () => {
69
69
  }
70
70
  return n;
71
71
  }
72
- function be(e) {
72
+ function Se(e) {
73
73
  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();
74
74
  }
75
- function b(e) {
75
+ function y(e) {
76
76
  if (!e || e < 0) return "";
77
77
  const t = Math.floor(e / 60), n = Math.floor(e % 60);
78
78
  return `${t}:${n.toString().padStart(2, "0")}`;
79
79
  }
80
- function O(e) {
80
+ function x(e) {
81
81
  return e ? ` — ${Math.floor(e / 60)}m ${e % 60}s` : "";
82
82
  }
83
83
  function I(e) {
84
84
  return e?.split("@")?.[0] || e || "";
85
85
  }
86
- function E(e) {
86
+ function b(e) {
87
87
  return e.map((t) => t.name).join(", ");
88
88
  }
89
- function L(e) {
89
+ function O(e) {
90
90
  return e === "meeting" ? "Meeting" : e === "video" ? "Video call" : "Audio call";
91
91
  }
92
92
  const m = {
@@ -102,6 +102,7 @@ const m = {
102
102
  shape: "event",
103
103
  channelKind: "voice",
104
104
  icon: "phone",
105
+ connected: !0,
105
106
  snippet: () => "Gesprek aangenomen",
106
107
  timeline: (e, t) => `Call answered — ${t}`
107
108
  },
@@ -122,8 +123,8 @@ const m = {
122
123
  shape: "event",
123
124
  channelKind: "voice",
124
125
  icon: "phone",
125
- snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${b(e.payload.duration)})` : ""}`,
126
- timeline: (e) => `Call ended${O(e.payload.duration)}`
126
+ snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${y(e.payload.duration)})` : ""}`,
127
+ timeline: (e) => `Call ended${x(e.payload.duration)}`
127
128
  },
128
129
  VOICE_CALL_MISSED: {
129
130
  shape: "event",
@@ -157,6 +158,7 @@ const m = {
157
158
  shape: "event",
158
159
  channelKind: "video",
159
160
  icon: "video",
161
+ connected: !0,
160
162
  snippet: () => "Gesprek aangenomen",
161
163
  timeline: () => "Video call answered"
162
164
  },
@@ -176,7 +178,7 @@ const m = {
176
178
  shape: "event",
177
179
  channelKind: "video",
178
180
  icon: "video",
179
- snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${b(e.payload.duration)})` : ""}`,
181
+ snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${y(e.payload.duration)})` : ""}`,
180
182
  timeline: () => "Video call ended"
181
183
  },
182
184
  VIDEO_CALL_MISSED: {
@@ -204,7 +206,7 @@ const m = {
204
206
  replyable: !0,
205
207
  carriesText: !0,
206
208
  countsAs: "inbound_message",
207
- snippet: $
209
+ snippet: L
208
210
  },
209
211
  EMAIL_SENT: {
210
212
  shape: "message",
@@ -214,7 +216,7 @@ const m = {
214
216
  replyable: !0,
215
217
  carriesText: !0,
216
218
  countsAs: "outbound_message",
217
- snippet: $
219
+ snippet: L
218
220
  },
219
221
  /* ---- chat ---- */
220
222
  CHAT_MESSAGE_SENT: {
@@ -243,9 +245,9 @@ const m = {
243
245
  shape: "event",
244
246
  channelKind: "chat",
245
247
  icon: "message-circle",
246
- snippet: (e) => `${E(e.payload.members)} toegevoegd`,
248
+ snippet: (e) => `${b(e.payload.members)} toegevoegd`,
247
249
  timeline: (e) => {
248
- const t = E(e.payload.members) || "Someone", n = e.payload.initiator?.name ? ` · added by ${e.payload.initiator.name}` : "";
250
+ const t = b(e.payload.members) || "Someone", n = e.payload.initiator?.name ? ` · added by ${e.payload.initiator.name}` : "";
249
251
  return `${t} joined the chat${n}`;
250
252
  }
251
253
  },
@@ -253,9 +255,9 @@ const m = {
253
255
  shape: "event",
254
256
  channelKind: "chat",
255
257
  icon: "message-circle",
256
- snippet: (e) => `${E(e.payload.members)} verlaten`,
258
+ snippet: (e) => `${b(e.payload.members)} verlaten`,
257
259
  timeline: (e) => {
258
- const t = E(e.payload.members) || "Someone", n = e.payload.initiator?.name ? ` · removed by ${e.payload.initiator.name}` : "";
260
+ const t = b(e.payload.members) || "Someone", n = e.payload.initiator?.name ? ` · removed by ${e.payload.initiator.name}` : "";
259
261
  return `${t} left the chat${n}`;
260
262
  }
261
263
  },
@@ -271,15 +273,15 @@ const m = {
271
273
  channelKind: "chat",
272
274
  icon: "message-circle",
273
275
  snippet: () => "Gesprek gestart",
274
- timeline: (e) => `${L(e.payload.callType)} started${e.payload.initiator ? ` by ${e.payload.initiator.name}` : ""}`,
276
+ timeline: (e) => `${O(e.payload.callType)} started${e.payload.initiator ? ` by ${e.payload.initiator.name}` : ""}`,
275
277
  joinUrl: (e) => e.payload.joinUrl
276
278
  },
277
279
  CHAT_CALL_ENDED: {
278
280
  shape: "event",
279
281
  channelKind: "chat",
280
282
  icon: "message-circle",
281
- snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${b(e.payload.duration)})` : ""}`,
282
- timeline: (e) => `${L(e.payload.callType)} ended${O(e.payload.duration)}`,
283
+ snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${y(e.payload.duration)})` : ""}`,
284
+ timeline: (e) => `${O(e.payload.callType)} ended${x(e.payload.duration)}`,
283
285
  joinUrl: (e) => e.payload.joinUrl
284
286
  },
285
287
  CHAT_EVENT: {
@@ -360,6 +362,7 @@ const m = {
360
362
  MEETING_STARTED: {
361
363
  shape: "event",
362
364
  icon: "calendar",
365
+ connected: !0,
363
366
  snippet: (e) => `Vergadering gestart: ${e.payload.title}`,
364
367
  timeline: () => "Meeting started",
365
368
  joinUrl: (e) => e.payload.joinUrl
@@ -367,7 +370,7 @@ const m = {
367
370
  MEETING_ENDED: {
368
371
  shape: "event",
369
372
  icon: "calendar",
370
- snippet: (e) => `Vergadering beëindigd${e.payload.duration ? ` (${b(e.payload.duration)})` : ""}`,
373
+ snippet: (e) => `Vergadering beëindigd${e.payload.duration ? ` (${y(e.payload.duration)})` : ""}`,
371
374
  timeline: () => "Meeting ended"
372
375
  },
373
376
  MEETING_PARTICIPANT_JOINED: {
@@ -404,48 +407,55 @@ const m = {
404
407
  timeline: (e, t) => `Assigned by ${t}`
405
408
  }
406
409
  };
407
- function $(e) {
408
- const t = e.payload, n = t.bodySnippet?.trim() || be(t.body ?? "");
410
+ function L(e) {
411
+ const t = e.payload, n = t.bodySnippet?.trim() || Se(t.body ?? "");
409
412
  return t.subject ? `${t.subject} — ${n}` : n;
410
413
  }
411
- function f(e) {
414
+ function d(e) {
412
415
  return m[e];
413
416
  }
414
- function Vt(e) {
415
- return f(e)?.icon ?? "circle";
417
+ function gn(e) {
418
+ return d(e)?.icon ?? "circle";
416
419
  }
417
- function jt(e) {
418
- return f(e)?.channelKind;
420
+ function hn(e) {
421
+ return d(e)?.channelKind;
419
422
  }
420
- function Xt(e) {
421
- const t = f(e)?.shape;
423
+ function An(e) {
424
+ const t = d(e)?.shape;
422
425
  return t === "message" || t === "note";
423
426
  }
424
- function Wt(e) {
425
- return f(e)?.replyable === !0;
427
+ function yn(e) {
428
+ return d(e)?.replyable === !0;
429
+ }
430
+ function bn(e) {
431
+ return d(e)?.carriesText === !0;
432
+ }
433
+ function En(e) {
434
+ return d(e)?.countsAs;
426
435
  }
427
- function Yt(e) {
428
- return f(e)?.carriesText === !0;
436
+ function Sn(e) {
437
+ return d(e)?.playbookAuthored === !0;
429
438
  }
430
- function zt(e) {
431
- return f(e)?.countsAs;
439
+ function Tn(e) {
440
+ return d(e)?.connected === !0;
432
441
  }
433
- function qt(e) {
434
- return f(e)?.playbookAuthored === !0;
442
+ function _n(e) {
443
+ const t = d(e);
444
+ return t?.shape === "artifact" && t?.carriesText === !0;
435
445
  }
436
- function Ee(e) {
437
- const t = f(e.type)?.snippet;
446
+ function Te(e) {
447
+ const t = d(e.type)?.snippet;
438
448
  return t ? t(e) : "";
439
449
  }
440
- function Jt(e, t) {
441
- const n = f(e.type)?.timeline;
450
+ function In(e, t) {
451
+ const n = d(e.type)?.timeline;
442
452
  return n ? n(e, t) : e.type.replace(/_/g, " ").toLowerCase();
443
453
  }
444
- function Qt(e) {
445
- const t = f(e.type)?.joinUrl;
454
+ function Mn(e) {
455
+ const t = d(e.type)?.joinUrl;
446
456
  return t ? t(e) : void 0;
447
457
  }
448
- function N(e, t) {
458
+ function w(e, t) {
449
459
  let n = e;
450
460
  for (const i of t.split(".")) {
451
461
  if (n == null || typeof n != "object") return "";
@@ -453,26 +463,26 @@ function N(e, t) {
453
463
  }
454
464
  return n == null ? "" : typeof n == "string" ? n : typeof n == "number" || typeof n == "boolean" ? String(n) : "";
455
465
  }
456
- function v(e, t, n) {
466
+ function k(e, t, n) {
457
467
  if (e === void 0) return null;
458
468
  if (typeof e == "string") return e || null;
459
469
  if ("value" in e)
460
- return N(t, e.value) || null;
470
+ return w(t, e.value) || null;
461
471
  const i = {};
462
472
  for (const [a, o] of Object.entries(e.params ?? {}))
463
- i[a] = N(t, o);
473
+ i[a] = w(t, o);
464
474
  const r = n(e.key, i);
465
475
  return r === e.key ? null : r;
466
476
  }
467
- function Ae(e, t) {
477
+ function _e(e, t) {
468
478
  if (!e || typeof e == "string" || "value" in e) return null;
469
479
  const n = {};
470
480
  for (const [i, r] of Object.entries(e.params ?? {}))
471
- n[i] = N(t, r);
481
+ n[i] = w(t, r);
472
482
  return { key: e.key, params: n };
473
483
  }
474
- const _e = (e) => e;
475
- function R(e) {
484
+ const Ie = (e) => e;
485
+ function $(e) {
476
486
  const t = m[e];
477
487
  return {
478
488
  type: e,
@@ -488,7 +498,7 @@ function R(e) {
488
498
  displayNameKey: t.displayNameKey
489
499
  };
490
500
  }
491
- function w(e) {
501
+ function D(e) {
492
502
  return {
493
503
  type: e.type,
494
504
  shape: e.shape,
@@ -503,21 +513,21 @@ function w(e) {
503
513
  displayNameKey: e.displayNameKey
504
514
  };
505
515
  }
506
- class Te {
507
- constructor(t = [], n = _e) {
516
+ class Me {
517
+ constructor(t = [], n = Ie) {
508
518
  this.translate = n;
509
519
  for (const i of t)
510
520
  i?.type && (i.type in m || this.declared.has(i.type) || this.declared.set(i.type, i));
511
521
  }
512
522
  declared = /* @__PURE__ */ new Map();
513
523
  get(t) {
514
- if (t in m) return R(t);
524
+ if (t in m) return $(t);
515
525
  const n = this.declared.get(t);
516
- return n ? w(n) : void 0;
526
+ return n ? D(n) : void 0;
517
527
  }
518
528
  /** Alles wat als trigger aangeboden mag worden, ingebouwd en gedeclareerd. */
519
529
  triggerable() {
520
- const t = Object.keys(m).filter((i) => m[i].triggerable).map(R), n = [...this.declared.values()].map(w).filter((i) => i.triggerable);
530
+ const t = Object.keys(m).filter((i) => m[i].triggerable).map($), n = [...this.declared.values()].map(D).filter((i) => i.triggerable);
521
531
  return [...t, ...n];
522
532
  }
523
533
  /**
@@ -529,14 +539,14 @@ class Te {
529
539
  const i = m[t.type];
530
540
  if (i?.timeline) return i.timeline(t, n);
531
541
  const r = this.declared.get(t.type);
532
- return v(r?.text, t, this.translate) ?? t.type.replace(/_/g, " ").toLowerCase();
542
+ return k(r?.text, t, this.translate) ?? t.type.replace(/_/g, " ").toLowerCase();
533
543
  }
534
544
  /** De regel voor de inboxlijst. Leeg wanneer het type niets te tonen heeft. */
535
545
  snippet(t) {
536
546
  const n = m[t.type];
537
547
  if (n?.snippet) return n.snippet(t);
538
548
  const i = this.declared.get(t.type);
539
- return v(i?.text, t, this.translate) ?? "";
549
+ return k(i?.text, t, this.translate) ?? "";
540
550
  }
541
551
  /** De descriptor zoals hij binnenkwam; nodig om `text` als sleutel op te slaan. */
542
552
  descriptor(t) {
@@ -552,33 +562,33 @@ class Te {
552
562
  return this.translate;
553
563
  }
554
564
  }
555
- const Zt = new Te(), D = 140;
556
- function Se(e) {
565
+ const Cn = new Me(), R = 140;
566
+ function Ce(e) {
557
567
  const t = e.trim();
558
- return t.length <= D ? t : t.slice(0, D - 1).trimEnd() + "…";
568
+ return t.length <= R ? t : t.slice(0, R - 1).trimEnd() + "…";
559
569
  }
560
- function en(e, t) {
561
- const n = Ae(t?.text, e), i = t ? v(t.text, e, (r) => r) : null;
570
+ function vn(e, t) {
571
+ const n = _e(t?.text, e), i = t ? k(t.text, e, (r) => r) : null;
562
572
  return {
563
573
  activityId: e.id,
564
574
  type: e.type,
565
- snippet: Se(i ?? Ee(e)),
575
+ snippet: Ce(i ?? Te(e)),
566
576
  authorName: e.author?.name ?? "",
567
577
  direction: e.direction,
568
578
  createdAt: e.createdAt ?? Date.now(),
569
579
  ...n ? { snippetKey: n.key, snippetParams: n.params } : {}
570
580
  };
571
581
  }
572
- function tn(e, t, n = []) {
582
+ function wn(e, t, n = []) {
573
583
  const i = e.createdAt;
574
584
  if (!i) return [];
575
585
  const r = new Set(n);
576
586
  return e.author.type === "user" && e.author.id && r.add(e.author.id), Object.entries(t).filter(([a, o]) => o >= i && !r.has(a)).map(([a]) => a);
577
587
  }
578
- function nn(e) {
588
+ function kn(e) {
579
589
  return e.createdAt ?? 0;
580
590
  }
581
- const rn = [
591
+ const Nn = [
582
592
  { id: "agent", label: "Agent", labelSource: "user" },
583
593
  { id: "team", label: "Team", labelSource: "team" },
584
594
  { id: "inbox", label: "Inbox", labelSource: "inbox" },
@@ -588,7 +598,7 @@ const rn = [
588
598
  { id: "handledBy", label: "Afhandelaar", labelSource: "raw" },
589
599
  { id: "time", label: "Tijd", labelSource: "raw" }
590
600
  ];
591
- function an(e) {
601
+ function xn(e) {
592
602
  const t = [];
593
603
  for (const n of Object.keys(e))
594
604
  for (const i of Object.keys(e[n]))
@@ -598,44 +608,44 @@ function an(e) {
598
608
  function M(e) {
599
609
  return e < 10 ? `0${e}` : `${e}`;
600
610
  }
601
- function Ie(e, t) {
611
+ function ve(e, t) {
602
612
  const n = new Date(e), i = `${n.getUTCFullYear()}-${M(n.getUTCMonth() + 1)}-${M(n.getUTCDate())}`;
603
613
  return t === "day" ? i : `${i}T${M(n.getUTCHours())}`;
604
614
  }
605
- function Me(e, t) {
615
+ function we(e, t) {
606
616
  const n = new Date(e);
607
617
  return n.setUTCMinutes(0, 0, 0), t === "day" && n.setUTCHours(0), n.getTime();
608
618
  }
609
- const Ce = 36e5, xe = 864e5;
610
- function on(e, t, n) {
611
- const i = n === "hour" ? Ce : xe, r = [];
612
- for (let a = Me(e, n); a <= t; a += i)
613
- r.push(Ie(a, n));
619
+ const ke = 36e5, Ne = 864e5;
620
+ function On(e, t, n) {
621
+ const i = n === "hour" ? ke : Ne, r = [];
622
+ for (let a = we(e, n); a <= t; a += i)
623
+ r.push(ve(a, n));
614
624
  return r;
615
625
  }
616
- const Ne = [
626
+ const xe = [
617
627
  { id: "resource", label: "Resource", labelSource: "raw" },
618
628
  { id: "origin", label: "Herkomst", labelSource: "raw" }
619
- ], ve = Ne.map((e) => e.id);
620
- function ke(e, t) {
629
+ ], Oe = xe.map((e) => e.id);
630
+ function Le(e, t) {
621
631
  return `${e}.usage.${t}`;
622
632
  }
623
- function sn(e, t) {
633
+ function Ln(e, t) {
624
634
  return t.map((n) => ({
625
- id: ke(e, n.unit),
635
+ id: Le(e, n.unit),
626
636
  label: n.label,
627
637
  category: "Verbruik",
628
638
  valueType: n.valueType ?? "count",
629
639
  aggregation: "sum",
630
640
  supportedDimensions: [
631
641
  "provider",
632
- ...ve,
642
+ ...Oe,
633
643
  ...n.extraDimensions ?? [],
634
644
  "time"
635
645
  ]
636
646
  }));
637
647
  }
638
- const ne = /* @__PURE__ */ new Set(["info", "success", "warning", "destructive"]), P = 200, U = 100, K = 200, B = 12, G = 4, ie = 4e3, C = 500, ln = 256 * 1024, Oe = /* @__PURE__ */ new Set([
648
+ const re = /* @__PURE__ */ new Set(["info", "success", "warning", "destructive"]), P = 200, U = 100, K = 200, j = 12, B = 4, ae = 4e3, C = 500, $n = 256 * 1024, $e = /* @__PURE__ */ new Set([
639
649
  "heading",
640
650
  "paragraph",
641
651
  "list",
@@ -645,15 +655,15 @@ const ne = /* @__PURE__ */ new Set(["info", "success", "warning", "destructive"]
645
655
  "table",
646
656
  "kpi",
647
657
  "callout"
648
- ]), Le = ["http:", "https:", "mailto:", "tel:"], $e = /^[a-z][a-z0-9+.-]*:/i;
649
- function re(e) {
658
+ ]), De = ["http:", "https:", "mailto:", "tel:"], Re = /^[a-z][a-z0-9+.-]*:/i;
659
+ function oe(e) {
650
660
  const t = e.trim().replace(/^<|>$/g, "");
651
661
  if (!t) return !1;
652
- const n = $e.exec(t)?.[0];
653
- return n ? Le.includes(n.toLowerCase()) : !t.startsWith("//");
662
+ const n = Re.exec(t)?.[0];
663
+ return n ? De.includes(n.toLowerCase()) : !t.startsWith("//");
654
664
  }
655
- const Re = /^[ \t]{0,3}\[([^\]]+)\]:[ \t]*(\S+).*$/gm;
656
- function we(e) {
665
+ const Pe = /^[ \t]{0,3}\[([^\]]+)\]:[ \t]*(\S+).*$/gm;
666
+ function Ue(e) {
657
667
  let t = "", n = 0;
658
668
  for (; n < e.length; ) {
659
669
  const i = e[n] === "!" && e[n + 1] === "[";
@@ -661,22 +671,22 @@ function we(e) {
661
671
  t += e[n], n += 1;
662
672
  continue;
663
673
  }
664
- const r = n + (i ? 2 : 1), a = F(e, r, "[", "]");
674
+ const r = n + (i ? 2 : 1), a = G(e, r, "[", "]");
665
675
  if (a < 0 || e[a + 1] !== "(") {
666
676
  t += e[n], n += 1;
667
677
  continue;
668
678
  }
669
- const o = F(e, a + 2, "(", ")");
679
+ const o = G(e, a + 2, "(", ")");
670
680
  if (o < 0) {
671
681
  t += e[n], n += 1;
672
682
  continue;
673
683
  }
674
684
  const s = e.slice(r, a), l = e.slice(a + 2, o).trim().split(/\s+/)[0] ?? "";
675
- t += i || !re(l) ? s : e.slice(n, o + 1), n = o + 1;
685
+ t += i || !oe(l) ? s : e.slice(n, o + 1), n = o + 1;
676
686
  }
677
687
  return t;
678
688
  }
679
- function F(e, t, n, i) {
689
+ function G(e, t, n, i) {
680
690
  let r = 1;
681
691
  for (let a = t; a < e.length; a += 1) {
682
692
  if (e[a] === "\\") {
@@ -689,22 +699,22 @@ function F(e, t, n, i) {
689
699
  }
690
700
  return -1;
691
701
  }
692
- function De(e) {
693
- return we(e).replace(
694
- Re,
695
- (t, n, i) => re(i) ? t : ""
702
+ function Ke(e) {
703
+ return Ue(e).replace(
704
+ Pe,
705
+ (t, n, i) => oe(i) ? t : ""
696
706
  );
697
707
  }
698
- function u(e, t = ie) {
699
- return typeof e == "string" ? De(e).slice(0, t) : "";
708
+ function u(e, t = ae) {
709
+ return typeof e == "string" ? Ke(e).slice(0, t) : "";
700
710
  }
701
- function Pe(e, t = ie) {
711
+ function je(e, t = ae) {
702
712
  return typeof e == "string" ? e.slice(0, t) : "";
703
713
  }
704
- function Ue(e, t = "info") {
705
- return typeof e == "string" && ne.has(e) ? e : t;
714
+ function Be(e, t = "info") {
715
+ return typeof e == "string" && re.has(e) ? e : t;
706
716
  }
707
- function cn(e, t = () => {
717
+ function Dn(e, t = () => {
708
718
  }) {
709
719
  if (!Array.isArray(e)) return [];
710
720
  const n = [];
@@ -715,7 +725,7 @@ function cn(e, t = () => {
715
725
  }
716
726
  if (!i || typeof i != "object") continue;
717
727
  const r = i;
718
- if (!Oe.has(r.type)) {
728
+ if (!$e.has(r.type)) {
719
729
  t("unknown block type " + String(r.type));
720
730
  continue;
721
731
  }
@@ -750,7 +760,7 @@ function cn(e, t = () => {
750
760
  break;
751
761
  }
752
762
  case "code": {
753
- const o = Pe(r.text);
763
+ const o = je(r.text);
754
764
  if (!o) {
755
765
  t("a code block without text");
756
766
  continue;
@@ -769,10 +779,10 @@ function cn(e, t = () => {
769
779
  t("more than " + U + " list items");
770
780
  break;
771
781
  }
772
- const d = u(p?.text);
773
- if (!d) continue;
782
+ const f = u(p?.text);
783
+ if (!f) continue;
774
784
  const c = u(p?.lead, 200);
775
- s.push(c ? { lead: c, text: d } : { text: d });
785
+ s.push(c ? { lead: c, text: f } : { text: f });
776
786
  }
777
787
  if (s.length === 0) {
778
788
  t("a list without usable items");
@@ -785,12 +795,12 @@ function cn(e, t = () => {
785
795
  case "table": {
786
796
  const o = Array.isArray(r.columns) ? r.columns : [], s = [];
787
797
  for (const c of o) {
788
- if (s.length >= B) {
789
- t("more than " + B + " table columns");
798
+ if (s.length >= j) {
799
+ t("more than " + j + " table columns");
790
800
  break;
791
801
  }
792
- const y = u(c?.label, C), T = c?.align === "right" ? "right" : void 0;
793
- s.push(T ? { label: y, align: T } : { label: y });
802
+ const A = u(c?.label, C), T = c?.align === "right" ? "right" : void 0;
803
+ s.push(T ? { label: A, align: T } : { label: A });
794
804
  }
795
805
  if (s.length === 0) {
796
806
  t("a table without columns");
@@ -802,33 +812,33 @@ function cn(e, t = () => {
802
812
  t("more than " + K + " table rows");
803
813
  break;
804
814
  }
805
- const y = Array.isArray(c) ? c : [];
815
+ const A = Array.isArray(c) ? c : [];
806
816
  p.push(
807
- s.map((T, he) => u(y[he], C))
817
+ s.map((T, be) => u(A[be], C))
808
818
  );
809
819
  }
810
- const d = u(r.caption, C);
820
+ const f = u(r.caption, C);
811
821
  n.push({
812
822
  ...a,
813
823
  type: "table",
814
824
  columns: s,
815
825
  rows: p,
816
- ...d ? { caption: d } : {}
826
+ ...f ? { caption: f } : {}
817
827
  });
818
828
  break;
819
829
  }
820
830
  case "kpi": {
821
831
  const o = Array.isArray(r.items) ? r.items : [], s = [];
822
832
  for (const l of o) {
823
- if (s.length >= G) {
824
- t("more than " + G + " kpi items");
833
+ if (s.length >= B) {
834
+ t("more than " + B + " kpi items");
825
835
  break;
826
836
  }
827
- const p = u(l?.value, 40), d = u(l?.label, 80);
828
- if (!p || !d) continue;
837
+ const p = u(l?.value, 40), f = u(l?.label, 80);
838
+ if (!p || !f) continue;
829
839
  const c = l?.tone;
830
840
  s.push(
831
- typeof c == "string" && ne.has(c) ? { value: p, label: d, tone: c } : { value: p, label: d }
841
+ typeof c == "string" && re.has(c) ? { value: p, label: f, tone: c } : { value: p, label: f }
832
842
  );
833
843
  }
834
844
  if (s.length === 0) {
@@ -848,7 +858,7 @@ function cn(e, t = () => {
848
858
  n.push({
849
859
  ...a,
850
860
  type: "callout",
851
- tone: Ue(r.tone),
861
+ tone: Be(r.tone),
852
862
  ...s ? { title: s } : {},
853
863
  text: o
854
864
  });
@@ -858,28 +868,28 @@ function cn(e, t = () => {
858
868
  }
859
869
  return n;
860
870
  }
861
- function un(e) {
871
+ function Rn(e) {
862
872
  return JSON.stringify(e).length;
863
873
  }
864
- function pn(e) {
874
+ function Pn(e) {
865
875
  return {
866
876
  blocks: e.length,
867
877
  types: e.map((t) => t.type),
868
878
  headings: e.flatMap((t) => t.type === "heading" ? [t.text] : [])
869
879
  };
870
880
  }
871
- function H(e) {
881
+ function F(e) {
872
882
  return e.replace(/\|/g, "\\|").replace(/\r?\n/g, " ").trim();
873
883
  }
874
- function V(e, t, n) {
884
+ function H(e, t, n) {
875
885
  const i = e.map((r, a) => n?.[a] === "right" ? "---:" : "---");
876
886
  return [
877
- `| ${e.map(H).join(" | ")} |`,
887
+ `| ${e.map(F).join(" | ")} |`,
878
888
  `| ${i.join(" | ")} |`,
879
- ...t.map((r) => `| ${r.map(H).join(" | ")} |`)
889
+ ...t.map((r) => `| ${r.map(F).join(" | ")} |`)
880
890
  ];
881
891
  }
882
- function Ke(e) {
892
+ function Ge(e) {
883
893
  switch (e.type) {
884
894
  case "heading":
885
895
  return [`${"#".repeat(e.level)} ${e.text}`];
@@ -897,7 +907,7 @@ function Ke(e) {
897
907
  return t.lead ? `${i} **${t.lead}** ${t.text}` : `${i} ${t.text}`;
898
908
  });
899
909
  case "table": {
900
- const t = V(
910
+ const t = H(
901
911
  e.columns.map((n) => n.label),
902
912
  e.rows,
903
913
  e.columns.map((n) => n.align ?? "left")
@@ -905,7 +915,7 @@ function Ke(e) {
905
915
  return e.caption ? [...t, "", `*${e.caption}*`] : t;
906
916
  }
907
917
  case "kpi":
908
- return V(
918
+ return H(
909
919
  e.items.map((t) => t.value),
910
920
  [e.items.map((t) => t.label)]
911
921
  );
@@ -913,11 +923,11 @@ function Ke(e) {
913
923
  return (e.title ? `**${e.title}** ${e.text}` : e.text).split(/\r?\n/).map((n) => `> ${n}`);
914
924
  }
915
925
  }
916
- function dn(e, t) {
926
+ function Un(e, t) {
917
927
  const n = [], i = e.some((r) => r.type === "heading" && r.level === 1);
918
928
  t && !i && n.push(`# ${t}`);
919
929
  for (const r of e) {
920
- const a = Ke(r);
930
+ const a = Ge(r);
921
931
  a.length > 0 && n.push(a.join(`
922
932
  `));
923
933
  }
@@ -926,26 +936,82 @@ function dn(e, t) {
926
936
  `)}
927
937
  `;
928
938
  }
929
- const ae = (e) => `user:${e}`, oe = (e) => `team:${e}`;
930
- function fn(e) {
939
+ const se = (e) => `user:${e}`, le = (e) => `team:${e}`;
940
+ function Kn(e) {
931
941
  const t = /* @__PURE__ */ new Set();
932
942
  for (const n of e ?? [])
933
- n?.id && (n.kind === "user" && t.add(ae(n.id)), n.kind === "team" && t.add(oe(n.id)));
943
+ n?.id && (n.kind === "user" && t.add(se(n.id)), n.kind === "team" && t.add(le(n.id)));
934
944
  return [...t].sort();
935
945
  }
936
- function mn(e, t) {
937
- return [ae(e), ...t.map(oe)];
946
+ function jn(e, t) {
947
+ return [se(e), ...t.map(le)];
938
948
  }
939
- function gn(e) {
949
+ function Bn(e) {
940
950
  const t = /* @__PURE__ */ new Set();
941
951
  for (const n of e ?? [])
942
952
  n?.kind && t.add(n.kind);
943
953
  return [...t];
944
954
  }
945
- function hn(e) {
955
+ const Fe = ["done", "escalated"];
956
+ function Gn(e) {
957
+ return Fe.includes(e);
958
+ }
959
+ const He = "assignment";
960
+ function Fn(e) {
961
+ return `${He}:${e}`;
962
+ }
963
+ function Hn(e) {
964
+ return e.subjectKind && e.subjectId ? { type: e.subjectKind, id: e.subjectId } : void 0;
965
+ }
966
+ const Ve = 12;
967
+ function Vn(e, t, n = Ve) {
968
+ const i = t + 1;
969
+ return e ? e.kind === "done" ? { status: "done", waitingOn: null, turns: i, reason: e.note } : e.kind === "escalate" ? { status: "escalated", waitingOn: null, turns: i, reason: e.reason } : i >= n ? {
970
+ status: "escalated",
971
+ waitingOn: null,
972
+ turns: i,
973
+ reason: `na ${n} beurten nog niet afgerond, dus een mens neemt het over`
974
+ } : { status: "waiting", waitingOn: e.on, turns: i } : {
975
+ status: "escalated",
976
+ waitingOn: null,
977
+ turns: i,
978
+ reason: "de agent rondde zijn beurt af zonder te zeggen wat er moet gebeuren (wachten, afronden of overdragen)"
979
+ };
980
+ }
981
+ const V = ["lookup", "condition", "parallel", "for-each"];
982
+ function W(e) {
983
+ for (const t of e) {
984
+ if (!V.includes(t.type))
985
+ return `staptype "${t.type}" mag niet meelezen (alleen ${V.join(", ")})`;
986
+ if (t.type === "parallel")
987
+ for (const n of t.branches ?? []) {
988
+ const i = W(n);
989
+ if (i) return i;
990
+ }
991
+ if (t.type === "for-each") {
992
+ const n = W(t.body ?? []);
993
+ if (n) return n;
994
+ }
995
+ }
996
+ return null;
997
+ }
998
+ function We(e, t) {
999
+ switch (e.kind) {
1000
+ case "org":
1001
+ return !0;
1002
+ case "team":
1003
+ return !!t.teamId && e.teamId === t.teamId;
1004
+ case "personal":
1005
+ return e.userId === t.userId;
1006
+ }
1007
+ }
1008
+ function Wn(e, t) {
1009
+ return e.filter((n) => n.enabled && We(n.ownerScope, t));
1010
+ }
1011
+ function Xn(e) {
946
1012
  return (e.startsWith("tool:") ? e.slice(5) : e).replace(/__/g, " · ").replace(/\./g, " · ").replace(/_/g, " ");
947
1013
  }
948
- const yn = [
1014
+ const zn = [
949
1015
  { name: "text", type: "string" },
950
1016
  { name: "subject", type: "string" },
951
1017
  { name: "from", type: "string" },
@@ -967,19 +1033,27 @@ const yn = [
967
1033
  // Leeg zolang de identiteit niet is opgelost (een onbekend nummer, een eerste bericht van
968
1034
  // een nieuw adres) — een stap die hierop leunt hoort dus een `condition` te hebben.
969
1035
  { name: "contactId", type: "string" },
970
- { name: "companyId", type: "string" }
971
- ], bn = {
1036
+ { name: "companyId", type: "string" },
1037
+ // Aan wie dit werk is toegewezen, bij een activity die een toewijzing aankondigt. Waar dat
1038
+ // op de activity staat is per bron **gedeclareerd** (`AssignmentTargetKind.assigneePath`),
1039
+ // dus `buildTriggerVars` kan hem niet zelf vullen: de job doet dat met de catalogus in de
1040
+ // hand, vóór het trigger-filter draait — net als contactId/companyId hierboven.
1041
+ { name: "assigneeUserId", type: "string" }
1042
+ ], Yn = {
972
1043
  topics: [
1044
+ { name: "topicId", type: "string" },
973
1045
  { name: "topic", type: "string" },
974
- { name: "confidence", type: "number" }
1046
+ { name: "confidence", type: "number" },
1047
+ { name: "reasoning", type: "string" }
975
1048
  ],
976
1049
  question: [
977
1050
  { name: "answer", type: "boolean" },
978
- { name: "confidence", type: "number" }
1051
+ { name: "reasoning", type: "string" }
979
1052
  ],
1053
+ // Leeg met opzet: de velden komen uit `ClassifyStep.fields` en zijn dus per stap anders.
980
1054
  extract: []
981
1055
  };
982
- function Be(e) {
1056
+ function Xe(e) {
983
1057
  switch (e.kind) {
984
1058
  case "user":
985
1059
  return `user:${e.userId}`;
@@ -989,7 +1063,7 @@ function Be(e) {
989
1063
  return "org";
990
1064
  }
991
1065
  }
992
- function En(e) {
1066
+ function qn(e) {
993
1067
  if (typeof e != "string") return;
994
1068
  const t = e.trim();
995
1069
  if (t === "org") return { kind: "org" };
@@ -1001,10 +1075,10 @@ function En(e) {
1001
1075
  if (i === "team") return { kind: "team", teamId: r };
1002
1076
  }
1003
1077
  }
1004
- function Ge(e) {
1005
- return Be(e);
1078
+ function ze(e) {
1079
+ return Xe(e);
1006
1080
  }
1007
- function An(e) {
1081
+ function Ye(e) {
1008
1082
  switch (e.kind) {
1009
1083
  case "personal":
1010
1084
  return { kind: "user", userId: e.userId };
@@ -1014,34 +1088,84 @@ function An(e) {
1014
1088
  return { kind: "org" };
1015
1089
  }
1016
1090
  }
1017
- function _n(e) {
1018
- return Ge(e);
1091
+ function Jn(e) {
1092
+ return e.agentId ? { kind: "user", userId: e.agentId } : Ye(e.ownerScope);
1019
1093
  }
1020
- const Fe = 64, He = 8e3;
1021
- function Tn(e) {
1094
+ function Qn(e) {
1095
+ return ze(e);
1096
+ }
1097
+ function Zn(e, t) {
1098
+ if (!t) return;
1099
+ let n = e;
1100
+ for (const i of t.split(".")) {
1101
+ if (n === null || typeof n != "object") return;
1102
+ n = n[i];
1103
+ }
1104
+ return n;
1105
+ }
1106
+ function ei(e, t) {
1107
+ return e.targets.find((n) => n.activityTypes.includes(t));
1108
+ }
1109
+ function ti(e, t) {
1110
+ if (t)
1111
+ return e.targets.find((n) => n.id === t);
1112
+ }
1113
+ function qe(e) {
1114
+ return e?.kind === "assignment";
1115
+ }
1116
+ function ni(e) {
1117
+ const { trigger: t, agentId: n, target: i, activityType: r, assigneeUserId: a, authorUserId: o } = e;
1118
+ return qe(t) ? n ? i ? i.activityTypes.includes(r) ? a ? a !== n ? "assigned to someone else" : o && o === n ? "the agent assigned this to itself, which would restart its own run" : null : `no assignee found at ${i.assigneePath}` : `activity type ${r} does not announce an assignment for ${i.id}` : `assignment target kind "${t.targetKind}" is not declared by any installed app` : "this playbook has no agent, so an assignment can never be for it" : "trigger is not an assignment trigger";
1119
+ }
1120
+ function Je(e) {
1121
+ return `${e.type}:${e.id}`;
1122
+ }
1123
+ const Qe = "interaction";
1124
+ function Ze(e) {
1125
+ return e?.type === Qe ? e.id : void 0;
1126
+ }
1127
+ const et = 64, tt = 8e3;
1128
+ function ii(e) {
1022
1129
  const t = typeof e == "number" ? e : Number(String(e ?? "").trim());
1023
1130
  if (!(!Number.isFinite(t) || t <= 0))
1024
- return Math.min(Math.max(Math.round(t), Fe), He);
1131
+ return Math.min(Math.max(Math.round(t), et), tt);
1025
1132
  }
1026
- const Ve = ["done", "escalated", "failed", "timed_out", "stopped"], je = ["awaiting_approval", "awaiting_reply"];
1027
- function Xe(e) {
1028
- return Ve.includes(e);
1133
+ const ri = { kind: "workflow", steps: [] };
1134
+ function ai(e) {
1135
+ return e?.kind === "workflow" ? e.steps : [];
1029
1136
  }
1030
- function Sn(e) {
1031
- return Xe(e);
1137
+ function oi(e) {
1138
+ return e?.kind === "procedure" ? e.procedure : void 0;
1139
+ }
1140
+ const nt = ["done", "escalated", "failed", "stopped"];
1141
+ function si(e) {
1142
+ return nt.includes(e);
1143
+ }
1144
+ function it(e) {
1145
+ return e === "waiting";
1146
+ }
1147
+ function li(e) {
1148
+ return e === "running" || it(e);
1149
+ }
1150
+ function ce(e) {
1151
+ return e.subjectKind && e.subjectId ? { type: e.subjectKind, id: e.subjectId } : void 0;
1152
+ }
1153
+ function ci(e) {
1154
+ const t = ce(e);
1155
+ return t ? Je(t) : void 0;
1032
1156
  }
1033
- function In(e) {
1034
- return je.includes(e);
1157
+ function ui(e) {
1158
+ return Ze(ce(e));
1035
1159
  }
1036
- function Mn(e, t) {
1160
+ function di(e, t) {
1037
1161
  const n = e.labels ?? [];
1038
1162
  return n.find((i) => i.locale === t)?.label ?? n[0]?.label ?? e.url;
1039
1163
  }
1040
- function Cn(e, t, n) {
1164
+ function pi(e, t, n) {
1041
1165
  const i = e.translations ?? [];
1042
1166
  return i.find((r) => r.locale === t) ?? (n ? i.find((r) => r.locale === n) : void 0) ?? { locale: t };
1043
1167
  }
1044
- const j = [
1168
+ const X = [
1045
1169
  { code: "nl", label: "Nederlands", english: "Dutch" },
1046
1170
  { code: "en", label: "English", english: "English" },
1047
1171
  { code: "de", label: "Deutsch", english: "German" },
@@ -1056,36 +1180,36 @@ const j = [
1056
1180
  { code: "fi", label: "Suomi", english: "Finnish" },
1057
1181
  { code: "tr", label: "Türkçe", english: "Turkish" }
1058
1182
  ];
1059
- function se(e) {
1183
+ function ue(e) {
1060
1184
  const t = (e ?? "").toLowerCase();
1061
- return j.find((n) => n.code === t) ?? j.find((n) => n.code === t.split("-")[0]);
1185
+ return X.find((n) => n.code === t) ?? X.find((n) => n.code === t.split("-")[0]);
1062
1186
  }
1063
- function xn(e) {
1064
- return se(e)?.label ?? e;
1187
+ function fi(e) {
1188
+ return ue(e)?.label ?? e;
1065
1189
  }
1066
- function Nn(e) {
1067
- const t = se(e);
1190
+ function mi(e) {
1191
+ const t = ue(e);
1068
1192
  return t ? t.english === t.label ? `${t.english} (${t.code})` : `${t.english} — ${t.label} (${t.code})` : e;
1069
1193
  }
1070
- const le = 3;
1071
- function We(e, t) {
1194
+ const de = 3;
1195
+ function rt(e, t) {
1072
1196
  const n = /* @__PURE__ */ new Set();
1073
1197
  let i = 1, r = t.get(e)?.parentId;
1074
1198
  for (; r; ) {
1075
- if (n.has(r) || (n.add(r), i++, i > le + 1)) return 1 / 0;
1199
+ if (n.has(r) || (n.add(r), i++, i > de + 1)) return 1 / 0;
1076
1200
  r = t.get(r)?.parentId;
1077
1201
  }
1078
1202
  return i;
1079
1203
  }
1080
- function vn(e, t, n) {
1204
+ function gi(e, t, n) {
1081
1205
  if (!e) return !0;
1082
1206
  if (e === t) return !1;
1083
1207
  const i = new Map(n.map((o) => [o.id, o]));
1084
- if (!i.has(e) || t && Ye(e, t, i)) return !1;
1085
- const r = We(e, i), a = t ? ce(t, n) : 1;
1086
- return r + a <= le;
1208
+ if (!i.has(e) || t && at(e, t, i)) return !1;
1209
+ const r = rt(e, i), a = t ? pe(t, n) : 1;
1210
+ return r + a <= de;
1087
1211
  }
1088
- function Ye(e, t, n) {
1212
+ function at(e, t, n) {
1089
1213
  const i = /* @__PURE__ */ new Set();
1090
1214
  let r = n.get(e)?.parentId;
1091
1215
  for (; r; ) {
@@ -1095,66 +1219,66 @@ function Ye(e, t, n) {
1095
1219
  }
1096
1220
  return !1;
1097
1221
  }
1098
- function ce(e, t, n = /* @__PURE__ */ new Set()) {
1222
+ function pe(e, t, n = /* @__PURE__ */ new Set()) {
1099
1223
  if (n.has(e)) return 1;
1100
1224
  n.add(e);
1101
1225
  const i = t.filter((r) => r.parentId === e);
1102
- return i.length ? 1 + Math.max(...i.map((r) => ce(r.id, t, n))) : 1;
1226
+ return i.length ? 1 + Math.max(...i.map((r) => pe(r.id, t, n))) : 1;
1103
1227
  }
1104
- const ze = "en";
1105
- function qe(e) {
1106
- return e.defaultLocale || e.locale || ze;
1228
+ const ot = "en";
1229
+ function st(e) {
1230
+ return e.defaultLocale || e.locale || ot;
1107
1231
  }
1108
- function kn(e) {
1232
+ function hi(e) {
1109
1233
  const t = /* @__PURE__ */ new Set(), n = [];
1110
- for (const i of [qe(e), ...e.locales ?? []])
1234
+ for (const i of [st(e), ...e.locales ?? []])
1111
1235
  !i || t.has(i) || (t.add(i), n.push(i));
1112
1236
  return n;
1113
1237
  }
1114
- function On(e, t, n) {
1238
+ function Ai(e, t, n) {
1115
1239
  const i = e.translations ?? [];
1116
1240
  return i.find((r) => r.locale === t)?.name ?? (n ? i.find((r) => r.locale === n)?.name : void 0) ?? e.name;
1117
1241
  }
1118
- const Je = 20, Qe = 20, x = 300;
1242
+ const lt = 20, ct = 20, v = 300;
1119
1243
  function g(e) {
1120
1244
  return e.toLowerCase().replace(/[^\p{L}\p{N}\s]/gu, " ").replace(/\s+/g, " ").trim();
1121
1245
  }
1122
- function Ze(e) {
1246
+ function ut(e) {
1123
1247
  const t = e.replace(/\s+/g, " ").trim();
1124
- if (t.length <= x) return t;
1125
- const n = t.slice(0, x), i = Math.max(n.lastIndexOf(". "), n.lastIndexOf("! "), n.lastIndexOf("? "));
1126
- return i > x * 0.6 ? n.slice(0, i + 1) : `${n.trimEnd()}…`;
1248
+ if (t.length <= v) return t;
1249
+ const n = t.slice(0, v), i = Math.max(n.lastIndexOf(". "), n.lastIndexOf("! "), n.lastIndexOf("? "));
1250
+ return i > v * 0.6 ? n.slice(0, i + 1) : `${n.trimEnd()}…`;
1127
1251
  }
1128
- function Ln(e, t) {
1129
- const n = Ze(t.text), i = g(n);
1252
+ function yi(e, t) {
1253
+ const n = ut(t.text), i = g(n);
1130
1254
  if (!i || (e.examples ?? []).some((o) => g(o) === i)) return null;
1131
1255
  const r = e.exampleCandidates ?? [], a = r.findIndex((o) => g(o.text) === i);
1132
1256
  if (a >= 0) {
1133
1257
  if (r[a].corrected || !t.corrected) return null;
1134
1258
  const o = [...r];
1135
- return o[a] = { ...o[a], corrected: !0, addedAt: t.addedAt }, X(o);
1259
+ return o[a] = { ...o[a], corrected: !0, addedAt: t.addedAt }, z(o);
1136
1260
  }
1137
- return X([{ ...t, text: n }, ...r]).slice(0, Qe);
1261
+ return z([{ ...t, text: n }, ...r]).slice(0, ct);
1138
1262
  }
1139
- function X(e) {
1263
+ function z(e) {
1140
1264
  return [...e].sort((t, n) => Number(n.corrected) - Number(t.corrected) || n.addedAt - t.addedAt);
1141
1265
  }
1142
- function $n(e, t) {
1266
+ function bi(e, t) {
1143
1267
  const n = g(t), i = (e.examples ?? []).filter((a) => a.trim());
1144
- return { examples: i.some((a) => g(a) === n) ? i : [...i, t].slice(-Je), exampleCandidates: et(e, t) };
1268
+ return { examples: i.some((a) => g(a) === n) ? i : [...i, t].slice(-lt), exampleCandidates: dt(e, t) };
1145
1269
  }
1146
- function et(e, t) {
1270
+ function dt(e, t) {
1147
1271
  const n = g(t);
1148
1272
  return (e.exampleCandidates ?? []).filter((i) => g(i.text) !== n);
1149
1273
  }
1150
- function tt(e, t) {
1274
+ function pt(e, t) {
1151
1275
  const n = e.ownerScope;
1152
1276
  return n ? n.kind === "org" ? !0 : n.kind === "team" ? !!t && n.teamId === t : !1 : !1;
1153
1277
  }
1154
- function Rn(e, t) {
1155
- return e.filter((n) => tt(n, t));
1278
+ function Ei(e, t) {
1279
+ return e.filter((n) => pt(n, t));
1156
1280
  }
1157
- const ue = [
1281
+ const fe = [
1158
1282
  {
1159
1283
  id: "openai",
1160
1284
  attachmentKinds: ["image", "pdf"],
@@ -1245,72 +1369,78 @@ const ue = [
1245
1369
  defaultModel: "default"
1246
1370
  }
1247
1371
  ];
1248
- function _(e) {
1249
- return ue.find((t) => t.id === e);
1372
+ function S(e) {
1373
+ return fe.find((t) => t.id === e);
1250
1374
  }
1251
- function wn(e) {
1252
- return _(e)?.label ?? e;
1375
+ function Si(e) {
1376
+ return S(e)?.label ?? e;
1253
1377
  }
1254
- function Dn(e, t = "gpt-5-mini") {
1255
- return _(e)?.defaultModel ?? t;
1378
+ function Ti(e, t = "gpt-5-mini") {
1379
+ return S(e)?.defaultModel ?? t;
1256
1380
  }
1257
- function Pn(e) {
1258
- return ue.filter((t) => t.capabilities.includes(e));
1381
+ function _i(e) {
1382
+ return fe.filter((t) => t.capabilities.includes(e));
1259
1383
  }
1260
- function Un(e) {
1261
- const t = _(e);
1384
+ function Ii(e) {
1385
+ const t = S(e);
1262
1386
  return !!t && !t.baseUrl;
1263
1387
  }
1264
- function Kn(e, t) {
1265
- return t === "text" ? !0 : _(e)?.attachmentKinds?.includes(t) === !0;
1388
+ function Mi(e, t) {
1389
+ return t === "text" ? !0 : S(e)?.attachmentKinds?.includes(t) === !0;
1266
1390
  }
1267
- function Bn(e, t) {
1391
+ function Ci(e, t) {
1268
1392
  if (!e.enabled) return "ok";
1269
- const n = W(e.hardLimitNanos), i = W(e.softLimitNanos);
1393
+ const n = Y(e.hardLimitNanos), i = Y(e.softLimitNanos);
1270
1394
  return n !== void 0 && t >= n ? "hard" : i !== void 0 && t >= i ? "soft" : "ok";
1271
1395
  }
1272
- function W(e) {
1396
+ function Y(e) {
1273
1397
  return typeof e == "number" ? e : void 0;
1274
1398
  }
1275
- function nt(e, t = "month") {
1399
+ function ft(e, t = "month") {
1276
1400
  const n = new Date(e);
1277
1401
  return Date.UTC(n.getUTCFullYear(), n.getUTCMonth(), 1);
1278
1402
  }
1279
- function Gn(e, t = "month") {
1280
- const n = new Date(nt(e, t));
1403
+ function vi(e, t = "month") {
1404
+ const n = new Date(ft(e, t));
1281
1405
  return `${n.getUTCFullYear()}-${String(n.getUTCMonth() + 1).padStart(2, "0")}`;
1282
1406
  }
1283
- const Fn = /* @__PURE__ */ new Set(["mail", "message"]);
1284
- function it(e, t) {
1407
+ function wi(e) {
1408
+ return e?.listeningEnabled !== !1;
1409
+ }
1410
+ const ki = /* @__PURE__ */ new Set(["mail", "message"]);
1411
+ function mt(e, t) {
1285
1412
  const n = e.settings?.signatures?.[t];
1286
1413
  return !n || !n.enabled || !n.body || n.body.trim() === "" ? null : n;
1287
1414
  }
1288
- function Hn(e, t, n, i = "html") {
1415
+ function Ni(e, t, n, i = "html") {
1289
1416
  if (!e) return n;
1290
- const r = it(e, t);
1417
+ const r = mt(e, t);
1291
1418
  return r ? `${n}${i === "text" ? `
1292
1419
 
1293
1420
  ` : t === "mail" ? "<br><br>-- <br>" : "<br><br>"}${r.body}` : n;
1294
1421
  }
1295
- function Vn(e) {
1422
+ function xi(e) {
1296
1423
  return e.endpoints ?? [];
1297
1424
  }
1298
- const jn = (e) => !!e.assignedUserId || !!e.assignedInboxId, Xn = (e) => e.status === "closed", Wn = (e) => ({
1425
+ const Oi = (e) => !!e.assignedUserId || !!e.assignedInboxId, Li = (e) => e.status === "closed", $i = (e) => ({
1299
1426
  urgent: 10,
1300
1427
  high: 5,
1301
1428
  normal: 2,
1302
1429
  low: 1
1303
- })[e.priority] || 0, Yn = (e, t = 30) => e.title?.length <= t ? e.title : `${e.title.substring(0, t)}...`;
1304
- function zn(e, t) {
1430
+ })[e.priority] || 0, Di = (e, t = 30) => e.title?.length <= t ? e.title : `${e.title.substring(0, t)}...`;
1431
+ function Ri(e, t) {
1305
1432
  return e.lastActivityAt ? !(e.seenBy ?? []).includes(t) : !1;
1306
1433
  }
1307
- const qn = 1e3, Jn = 2e3, Qn = 500, Zn = 12e3, ei = 4e3, rt = ["contact", "company"];
1308
- function ti(e) {
1434
+ const Pi = 1e3, Ui = 2e3, Ki = 500, ji = 12e3, Bi = 4e3, gt = ["contact", "company"];
1435
+ function Gi(e) {
1309
1436
  if (!e) return !1;
1310
1437
  const t = e.slice(0, e.indexOf(":"));
1311
- return rt.includes(t);
1438
+ return gt.includes(t);
1312
1439
  }
1313
- const k = {
1440
+ function Fi(e) {
1441
+ return e.type === "agent";
1442
+ }
1443
+ const N = {
1314
1444
  // The lower bounds are deliberately generous: service ranges (0800/0900) are
1315
1445
  // shorter than geographic numbers, and a too-strict minimum silently drops them.
1316
1446
  // An over-permissive key is harmless — it simply matches nothing.
@@ -1333,81 +1463,81 @@ const k = {
1333
1463
  PL: { callingCode: "48", nsnMin: 9, nsnMax: 9 },
1334
1464
  US: { callingCode: "1", nsnMin: 10, nsnMax: 10 },
1335
1465
  CA: { callingCode: "1", nsnMin: 10, nsnMax: 10 }
1336
- }, at = "NL", ot = 15, st = 8, lt = Array.from(
1337
- new Set(Object.values(k).map((e) => e.callingCode))
1466
+ }, ht = "NL", At = 15, yt = 8, bt = Array.from(
1467
+ new Set(Object.values(N).map((e) => e.callingCode))
1338
1468
  ).sort((e, t) => t.length - e.length);
1339
- function Y(e) {
1469
+ function q(e) {
1340
1470
  if (e)
1341
- return k[e.trim().toUpperCase()];
1471
+ return N[e.trim().toUpperCase()];
1342
1472
  }
1343
- function A(e, t) {
1473
+ function E(e, t) {
1344
1474
  return e.length >= t.nsnMin && e.length <= t.nsnMax;
1345
1475
  }
1346
- function z(e) {
1347
- if (e.length > ot) return null;
1348
- for (const t of lt) {
1476
+ function J(e) {
1477
+ if (e.length > At) return null;
1478
+ for (const t of bt) {
1349
1479
  if (!e.startsWith(t)) continue;
1350
1480
  const n = e.slice(t.length);
1351
- for (const i of Object.values(k)) {
1481
+ for (const i of Object.values(N)) {
1352
1482
  if (i.callingCode !== t) continue;
1353
1483
  const r = i.trunkPrefix, a = r && n.startsWith(r) ? n.slice(r.length) : n;
1354
- if (A(a, i)) return `+${t}${a}`;
1484
+ if (E(a, i)) return `+${t}${a}`;
1355
1485
  }
1356
1486
  return null;
1357
1487
  }
1358
- return e.length < st ? null : `+${e}`;
1488
+ return e.length < yt ? null : `+${e}`;
1359
1489
  }
1360
- function ct(e) {
1490
+ function Et(e) {
1361
1491
  let t = e.trim();
1362
1492
  const n = t.match(/^(sips?|tel|whatsapp):/i);
1363
1493
  n && (t = t.slice(n[0].length));
1364
1494
  const i = t.indexOf("@");
1365
1495
  return i >= 0 && (t = t.slice(0, i)), t.trim();
1366
1496
  }
1367
- function ni(e) {
1497
+ function Hi(e) {
1368
1498
  if (!e) return !1;
1369
1499
  const t = e.indexOf("@");
1370
1500
  if (t <= 0) return !1;
1371
1501
  const n = e.slice(0, t).trim();
1372
1502
  return !/^[+\d\s().-]+$/.test(n);
1373
1503
  }
1374
- function q(e, t) {
1504
+ function Q(e, t) {
1375
1505
  if (!e) return null;
1376
- const n = ct(e);
1506
+ const n = Et(e);
1377
1507
  if (!n) return null;
1378
1508
  const i = n.startsWith("+"), r = n.replace(/\D/g, "");
1379
1509
  if (!r) return null;
1380
- if (i) return z(r);
1381
- if (r.startsWith("00")) return z(r.slice(2));
1382
- const a = Y(t) ?? Y(at);
1510
+ if (i) return J(r);
1511
+ if (r.startsWith("00")) return J(r.slice(2));
1512
+ const a = q(t) ?? q(ht);
1383
1513
  if (!a) return null;
1384
1514
  const o = a.trunkPrefix;
1385
1515
  if (o && r.startsWith(o)) {
1386
1516
  const s = r.slice(o.length);
1387
- return A(s, a) ? `+${a.callingCode}${s}` : null;
1517
+ return E(s, a) ? `+${a.callingCode}${s}` : null;
1388
1518
  }
1389
1519
  if (r.startsWith(a.callingCode)) {
1390
1520
  const s = r.slice(a.callingCode.length);
1391
- if (A(s, a)) return `+${a.callingCode}${s}`;
1521
+ if (E(s, a)) return `+${a.callingCode}${s}`;
1392
1522
  }
1393
- return !o && A(r, a) ? `+${a.callingCode}${r}` : null;
1523
+ return !o && E(r, a) ? `+${a.callingCode}${r}` : null;
1394
1524
  }
1395
- function ii(e, t = 9) {
1525
+ function Vi(e, t = 9) {
1396
1526
  const n = (e ?? "").replace(/\D/g, "");
1397
1527
  return n.length < t ? null : n.slice(-t);
1398
1528
  }
1399
- function pe(e) {
1529
+ function me(e) {
1400
1530
  if (!e) return null;
1401
1531
  const t = e.trim().toLowerCase(), n = t.lastIndexOf("@");
1402
1532
  if (n <= 0 || n === t.length - 1) return null;
1403
1533
  const i = t.slice(0, n).split("+")[0], r = t.slice(n + 1);
1404
1534
  return !i || !r.includes(".") ? null : `${i}@${r}`;
1405
1535
  }
1406
- function ri(e) {
1407
- const t = pe(e);
1536
+ function Wi(e) {
1537
+ const t = me(e);
1408
1538
  return t ? t.slice(t.lastIndexOf("@") + 1) : null;
1409
1539
  }
1410
- const ut = /* @__PURE__ */ new Set([
1540
+ const St = /* @__PURE__ */ new Set([
1411
1541
  "co.uk",
1412
1542
  "org.uk",
1413
1543
  "gov.uk",
@@ -1417,14 +1547,14 @@ const ut = /* @__PURE__ */ new Set([
1417
1547
  "com.br",
1418
1548
  "co.za"
1419
1549
  ]);
1420
- function pt(e) {
1550
+ function Tt(e) {
1421
1551
  if (!e) return null;
1422
1552
  const t = e.trim().toLowerCase().replace(/\.$/, "").split(".").filter(Boolean);
1423
1553
  if (t.length < 2) return null;
1424
1554
  const n = t.slice(-2).join(".");
1425
- return ut.has(n) && t.length >= 3 ? t.slice(-3).join(".") : n;
1555
+ return St.has(n) && t.length >= 3 ? t.slice(-3).join(".") : n;
1426
1556
  }
1427
- const dt = /* @__PURE__ */ new Set([
1557
+ const _t = /* @__PURE__ */ new Set([
1428
1558
  "gmail.com",
1429
1559
  "googlemail.com",
1430
1560
  "outlook.com",
@@ -1469,44 +1599,44 @@ const dt = /* @__PURE__ */ new Set([
1469
1599
  "proximus.be",
1470
1600
  "scarlet.be"
1471
1601
  ]);
1472
- function ai(e) {
1473
- const t = pt(e);
1474
- return t ? dt.has(t) : !1;
1602
+ function Xi(e) {
1603
+ const t = Tt(e);
1604
+ return t ? _t.has(t) : !1;
1475
1605
  }
1476
- function oi(e) {
1606
+ function zi(e) {
1477
1607
  if (!e) return !1;
1478
1608
  const t = e.trim().toLowerCase();
1479
1609
  return t === "tel" || t === "sms" || t === "whatsapp" || t === "fax";
1480
1610
  }
1481
- function si(e, t, n) {
1611
+ function Yi(e, t, n) {
1482
1612
  if (!e || !t) return null;
1483
1613
  const i = e.trim().toLowerCase();
1484
1614
  if (i === "tel" || i === "sms" || i === "whatsapp") {
1485
- const a = q(t, n);
1615
+ const a = Q(t, n);
1486
1616
  return a ? `tel:${a}` : null;
1487
1617
  }
1488
1618
  if (i === "fax") {
1489
- const a = q(t, n);
1619
+ const a = Q(t, n);
1490
1620
  return a ? `fax:${a}` : null;
1491
1621
  }
1492
1622
  if (i === "mailto" || i === "email") {
1493
- const a = pe(t);
1623
+ const a = me(t);
1494
1624
  return a ? `mailto:${a}` : null;
1495
1625
  }
1496
1626
  const r = t.trim().toLowerCase();
1497
1627
  return r ? `${i}:${r}` : null;
1498
1628
  }
1499
- const ft = /(\*\*|__)(?=\S)([\s\S]*?\S)\1/g, mt = /(\*|_)(?=\S)([^*_\n]*?\S)\1/g;
1500
- function li(e) {
1629
+ const It = /(\*\*|__)(?=\S)([\s\S]*?\S)\1/g, Mt = /(\*|_)(?=\S)([^*_\n]*?\S)\1/g;
1630
+ function qi(e) {
1501
1631
  if (typeof e != "string" || !e) return "";
1502
1632
  let t = e;
1503
1633
  return t = t.replace(/```[a-z]*\n?/gi, "").replace(/~~~[a-z]*\n?/gi, ""), t = t.replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1"), t = t.replace(/\[([^\]]*)\]\([^)]*\)/g, "$1"), t = t.replace(/\[([^\]]*)\]\[[^\]]*\]/g, "$1"), t = t.replace(/<((?:https?|mailto):[^>\s]+)>/gi, "$1"), t = t.split(`
1504
1634
  `).map(
1505
1635
  (n) => n.replace(/^\s{0,3}#{1,6}\s+/, "").replace(/^\s{0,3}>\s?/, "").replace(/^\s*[-*+]\s+/, "").replace(/^\s*\d+[.)]\s+/, "").replace(/^\s*(?:[-*_]\s*){3,}$/, "")
1506
1636
  ).join(`
1507
- `), t = t.replace(ft, "$2"), t = t.replace(mt, "$2"), t = t.replace(/~~(?=\S)([\s\S]*?\S)~~/g, "$1"), t = t.replace(/`([^`\n]+)`/g, "$1"), t.replace(/\s+/g, " ").trim();
1637
+ `), t = t.replace(It, "$2"), t = t.replace(Mt, "$2"), t = t.replace(/~~(?=\S)([\s\S]*?\S)~~/g, "$1"), t = t.replace(/`([^`\n]+)`/g, "$1"), t.replace(/\s+/g, " ").trim();
1508
1638
  }
1509
- const gt = [
1639
+ const Ct = [
1510
1640
  /<blockquote/i,
1511
1641
  /class="?gmail_quote/i,
1512
1642
  // Gmail quote container
@@ -1519,17 +1649,17 @@ const gt = [
1519
1649
  // Outlook underscore separator before "From:"
1520
1650
  /\bOn\b[\s\S]{0,200}?\bwrote:/i
1521
1651
  // Gmail "On <date> <name> wrote:"
1522
- ], J = /^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i, ht = /^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;
1523
- function yt(e) {
1652
+ ], Z = /^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i, vt = /^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;
1653
+ function wt(e) {
1524
1654
  const t = e.split(`
1525
1655
  `);
1526
1656
  for (let n = 0; n < t.length; n++)
1527
- if (ht.test(t[n]) || J.test(t[n]) && t.slice(n + 1, n + 4).some((i) => J.test(i)))
1657
+ if (vt.test(t[n]) || Z.test(t[n]) && t.slice(n + 1, n + 4).some((i) => Z.test(i)))
1528
1658
  return t.slice(0, n).join(`
1529
1659
  `).trim();
1530
1660
  return e;
1531
1661
  }
1532
- function Q(e) {
1662
+ function ee(e) {
1533
1663
  let t = e;
1534
1664
  return t = t.replace(/<(script|style)[\s\S]*?<\/\1>/gi, ""), t = t.replace(/<br\s*\/?>/gi, `
1535
1665
  `), t = t.replace(/<\/(p|h[1-6]|ul|ol|table|blockquote)>/gi, `
@@ -1537,38 +1667,38 @@ function Q(e) {
1537
1667
  `), t = t.replace(/<\/(div|li|tr)>/gi, `
1538
1668
  `), t = t.replace(/<\/(td|th)>/gi, " "), t = t.replace(/<[^>]+>/g, ""), t = t.replace(/<[^>]*$/, ""), t;
1539
1669
  }
1540
- function Z(e) {
1670
+ function te(e) {
1541
1671
  return !Number.isInteger(e) || e < 0 || e > 1114111 ? null : String.fromCodePoint(e);
1542
1672
  }
1543
- function ee(e) {
1544
- return e.replace(/&nbsp;/gi, " ").replace(/&lt;/gi, "<").replace(/&gt;/gi, ">").replace(/&quot;/gi, '"').replace(/&#(\d+);/g, (t, n) => Z(Number(n)) ?? t).replace(/&#x([0-9a-f]+);/gi, (t, n) => Z(parseInt(n, 16)) ?? t).replace(/&amp;/gi, "&");
1673
+ function ne(e) {
1674
+ return e.replace(/&nbsp;/gi, " ").replace(/&lt;/gi, "<").replace(/&gt;/gi, ">").replace(/&quot;/gi, '"').replace(/&#(\d+);/g, (t, n) => te(Number(n)) ?? t).replace(/&#x([0-9a-f]+);/gi, (t, n) => te(parseInt(n, 16)) ?? t).replace(/&amp;/gi, "&");
1545
1675
  }
1546
- function te(e) {
1676
+ function ie(e) {
1547
1677
  return e.replace(/\r/g, "").replace(/[ \t]+/g, " ").replace(/ *\n */g, `
1548
1678
  `).replace(/\n{3,}/g, `
1549
1679
 
1550
1680
  `).trim();
1551
1681
  }
1552
- function ci(e) {
1682
+ function Ji(e) {
1553
1683
  if (typeof e != "string" || !e) return "";
1554
1684
  let t = e.length;
1555
- for (const a of gt) {
1685
+ for (const a of Ct) {
1556
1686
  const o = e.search(a);
1557
1687
  o >= 0 && o < t && (t = o);
1558
1688
  }
1559
1689
  const n = e.slice(0, t);
1560
- let i = te(ee(Q(n)));
1561
- return i || (i = te(ee(Q(e)))), yt(i) || i;
1690
+ let i = ie(ne(ee(n)));
1691
+ return i || (i = ie(ne(ee(e)))), wt(i) || i;
1562
1692
  }
1563
- const bt = /(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i, Et = /\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;
1564
- function ui(e, t) {
1565
- return !!(e && bt.test(e) || t && Et.test(t));
1693
+ const kt = /(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i, Nt = /\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;
1694
+ function Qi(e, t) {
1695
+ return !!(e && kt.test(e) || t && Nt.test(t));
1566
1696
  }
1567
- const At = 3, _t = 600;
1568
- function pi(e, t) {
1569
- return e >= At || t >= _t;
1697
+ const xt = 3, Ot = 600;
1698
+ function Zi(e, t) {
1699
+ return e >= xt || t >= Ot;
1570
1700
  }
1571
- const Tt = /* @__PURE__ */ new Set(["image/png", "image/jpeg", "image/jpg", "image/gif", "image/webp"]), St = /* @__PURE__ */ new Set([
1701
+ const Lt = /* @__PURE__ */ new Set(["image/png", "image/jpeg", "image/jpg", "image/gif", "image/webp"]), $t = /* @__PURE__ */ new Set([
1572
1702
  "text/plain",
1573
1703
  "text/markdown",
1574
1704
  "text/csv",
@@ -1577,29 +1707,40 @@ const Tt = /* @__PURE__ */ new Set(["image/png", "image/jpeg", "image/jpg", "ima
1577
1707
  "application/xml",
1578
1708
  "text/xml"
1579
1709
  ]);
1580
- function It(e) {
1710
+ function Dt(e) {
1581
1711
  const t = (e ?? "").trim().toLowerCase().split(";")[0];
1582
- return t ? Tt.has(t) ? "image" : t === "application/pdf" ? "pdf" : St.has(t) ? "text" : t.startsWith("audio/") ? "audio" : "unsupported" : "unsupported";
1712
+ return t ? Lt.has(t) ? "image" : t === "application/pdf" ? "pdf" : $t.has(t) ? "text" : t.startsWith("audio/") ? "audio" : "unsupported" : "unsupported";
1583
1713
  }
1584
- const h = 1024 * 1024, Mt = {
1714
+ const h = 1024 * 1024, Rt = {
1585
1715
  image: 5 * h,
1586
1716
  pdf: 20 * h,
1587
1717
  text: 1 * h,
1588
1718
  audio: 20 * h
1589
- }, di = 25 * h, fi = 5;
1590
- function mi(e, t) {
1591
- const n = It(e);
1592
- return n === "unsupported" ? "unsupported" : t > Mt[n] ? "too-large" : null;
1719
+ }, er = 25 * h, tr = 5;
1720
+ function nr(e, t) {
1721
+ const n = Dt(e);
1722
+ return n === "unsupported" ? "unsupported" : t > Rt[n] ? "too-large" : null;
1723
+ }
1724
+ function Pt(e) {
1725
+ return `${e.kind}:${e.id || e.url || e.title}`;
1726
+ }
1727
+ function ir(e, t = []) {
1728
+ const n = new Set(t), i = [], r = [];
1729
+ for (const a of e) {
1730
+ const o = Pt(a);
1731
+ n.has(o) || (n.add(o), i.push(a), r.push(o));
1732
+ }
1733
+ return { sources: i, keys: r };
1593
1734
  }
1594
- function Ct(e, t) {
1595
- const n = new Set(e.disabledIntents ?? []), i = e.intentOverrides ?? {}, r = t.intents.filter((o) => !n.has(o.intent)).map((o) => Nt(o, i[o.intent]));
1735
+ function Ut(e, t) {
1736
+ const n = new Set(e.disabledIntents ?? []), i = e.intentOverrides ?? {}, r = t.intents.filter((o) => !n.has(o.intent)).map((o) => jt(o, i[o.intent]));
1596
1737
  if (!e.extraIntents || e.extraIntents.length === 0) return r;
1597
1738
  const a = new Set(r.map((o) => o.intent));
1598
1739
  for (const o of e.extraIntents)
1599
1740
  a.has(o.intent) || (r.push(o), a.add(o.intent));
1600
1741
  return r;
1601
1742
  }
1602
- function xt(e, t) {
1743
+ function Kt(e, t) {
1603
1744
  const n = {};
1604
1745
  for (const i of e.intents) {
1605
1746
  if (!i.togglable) continue;
@@ -1608,46 +1749,46 @@ function xt(e, t) {
1608
1749
  }
1609
1750
  return n;
1610
1751
  }
1611
- function gi(e, t) {
1612
- const n = xt(e, t);
1752
+ function rr(e, t) {
1753
+ const n = Kt(e, t);
1613
1754
  return Object.entries(n).filter(([, i]) => !i).map(([i]) => i);
1614
1755
  }
1615
- function Nt(e, t) {
1756
+ function jt(e, t) {
1616
1757
  return t ? {
1617
1758
  intent: t.intent ?? e.intent,
1618
1759
  targetSchemes: t.targetSchemes ?? e.targetSchemes,
1619
1760
  transport: t.transport ?? e.transport
1620
1761
  } : e;
1621
1762
  }
1622
- function hi(e, t) {
1763
+ function ar(e, t) {
1623
1764
  const n = [];
1624
1765
  for (const i of e) {
1625
1766
  if (!i.enabled) continue;
1626
1767
  const r = t[i.providerId];
1627
1768
  if (r)
1628
- for (const a of Ct(i, r))
1769
+ for (const a of Ut(i, r))
1629
1770
  n.push({ channel: i, description: r, capability: a });
1630
1771
  }
1631
1772
  return n;
1632
1773
  }
1633
- function yi(e, t) {
1774
+ function or(e, t) {
1634
1775
  return t.filter((n) => n.capability.intent === e);
1635
1776
  }
1636
- function vt(e, t) {
1777
+ function Bt(e, t) {
1637
1778
  return t.filter((n) => n.capability.targetSchemes.includes(e));
1638
1779
  }
1639
- function bi(e, t) {
1640
- return vt(e.scheme, t);
1780
+ function sr(e, t) {
1781
+ return Bt(e.scheme, t);
1641
1782
  }
1642
- function Ei(e, t, n) {
1783
+ function lr(e, t, n) {
1643
1784
  const i = [];
1644
1785
  for (const r of e)
1645
1786
  for (const a of n)
1646
1787
  a.capability.intent === t && a.capability.targetSchemes.includes(r.scheme) && i.push({ channelIntent: a, endpoint: r });
1647
1788
  return i;
1648
1789
  }
1649
- var kt = /* @__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))(kt || {});
1650
- const Ot = {
1790
+ var Gt = /* @__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))(Gt || {});
1791
+ const Ft = {
1651
1792
  mailto: "mail",
1652
1793
  sip: "tel",
1653
1794
  tel: "tel",
@@ -1669,10 +1810,10 @@ const Ot = {
1669
1810
  id: "note",
1670
1811
  custom: "note"
1671
1812
  };
1672
- function Ai(e) {
1673
- return e ? Ot[e] ?? "note" : "note";
1813
+ function cr(e) {
1814
+ return e ? Ft[e] ?? "note" : "note";
1674
1815
  }
1675
- const _i = "message_window", Ti = "message_templates", Si = {
1816
+ const ur = "message_window", dr = "message_templates", pr = {
1676
1817
  // E-mail
1677
1818
  FROM: "from",
1678
1819
  TO: "to",
@@ -1689,26 +1830,26 @@ const _i = "message_window", Ti = "message_templates", Si = {
1689
1830
  // Voice/conference
1690
1831
  HOST: "host",
1691
1832
  PARTICIPANT: "participant"
1692
- }, Ii = (e, t) => ({ intent: e, ...t }), Mi = "folder_management", Ci = "remote_search", xi = { ok: !1, code: "UNSUPPORTED", message: "Provider does not support this op" }, de = "auth";
1693
- function fe(e) {
1833
+ }, fr = (e, t) => ({ intent: e, ...t }), mr = "folder_management", gr = "remote_search", hr = { ok: !1, code: "UNSUPPORTED", message: "Provider does not support this op" }, ge = "auth";
1834
+ function he(e) {
1694
1835
  const t = typeof e == "string" ? e.match(/apps\/([^/?#]+)/) : null;
1695
1836
  return t ? t[1] : null;
1696
1837
  }
1697
- function Ni(e) {
1698
- const t = fe(e);
1699
- return t ? t !== de : typeof e == "string" && e.startsWith("/wake");
1838
+ function Ar(e) {
1839
+ const t = he(e);
1840
+ return t ? t !== ge : typeof e == "string" && e.startsWith("/wake");
1700
1841
  }
1701
- function vi(e) {
1702
- return typeof e != "string" || e === "" || e === "/" ? !0 : fe(e) === de;
1842
+ function yr(e) {
1843
+ return typeof e != "string" || e === "" || e === "/" ? !0 : he(e) === ge;
1703
1844
  }
1704
- function Lt(e) {
1845
+ function Ht(e) {
1705
1846
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1706
1847
  }
1707
- function $t(e) {
1708
- const n = e.split("/").filter(Boolean).map((i) => i.startsWith(":") ? i.endsWith("?") ? "(?:/[^/]+)?" : "/[^/]+" : "/" + Lt(i)).join("");
1848
+ function Vt(e) {
1849
+ const n = e.split("/").filter(Boolean).map((i) => i.startsWith(":") ? i.endsWith("?") ? "(?:/[^/]+)?" : "/[^/]+" : "/" + Ht(i)).join("");
1709
1850
  return new RegExp(`^${n}\\/?$`);
1710
1851
  }
1711
- function Rt(e, t) {
1852
+ function Wt(e, t) {
1712
1853
  const n = e.split("/").filter(Boolean), i = t.split("/").filter(Boolean), r = {};
1713
1854
  return n.forEach((a, o) => {
1714
1855
  if (a.startsWith(":")) {
@@ -1717,14 +1858,14 @@ function Rt(e, t) {
1717
1858
  }
1718
1859
  }), r;
1719
1860
  }
1720
- function wt(e) {
1861
+ function Xt(e) {
1721
1862
  return e.publicBasePath ?? `/apps/${e.name}`;
1722
1863
  }
1723
- function ki(e) {
1864
+ function br(e) {
1724
1865
  const t = [];
1725
1866
  for (const n of e) {
1726
1867
  if (!n?.name) continue;
1727
- const i = wt(n);
1868
+ const i = Xt(n);
1728
1869
  for (const r of n.routes ?? []) {
1729
1870
  if (!r.public) continue;
1730
1871
  const a = r.path === "/" ? "" : r.path;
@@ -1738,7 +1879,7 @@ function ki(e) {
1738
1879
  }
1739
1880
  return t;
1740
1881
  }
1741
- function Dt(e, t) {
1882
+ function zt(e, t) {
1742
1883
  const n = e.split("/").filter(Boolean), i = t.split("/").filter(Boolean);
1743
1884
  for (let r = 0; r < Math.min(n.length, i.length); r++) {
1744
1885
  const a = n[r].startsWith(":"), o = i[r].startsWith(":");
@@ -1746,204 +1887,562 @@ function Dt(e, t) {
1746
1887
  }
1747
1888
  return n.length > i.length;
1748
1889
  }
1749
- function Pt(e, t) {
1890
+ function Yt(e, t) {
1750
1891
  if (typeof e != "string") return null;
1751
1892
  let n = null;
1752
1893
  for (const i of t)
1753
- $t(i.pattern).test(e) && (!n || Dt(i.pattern, n.pattern)) && (n = i);
1754
- return n ? { ...n, params: { ...n.props, ...Rt(n.pattern, e) } } : null;
1755
- }
1756
- function Oi(e, t) {
1757
- return Pt(e, t) !== null;
1894
+ Vt(i.pattern).test(e) && (!n || zt(i.pattern, n.pattern)) && (n = i);
1895
+ return n ? { ...n, params: { ...n.props, ...Wt(n.pattern, e) } } : null;
1896
+ }
1897
+ function Er(e, t) {
1898
+ return Yt(e, t) !== null;
1899
+ }
1900
+ const qt = {
1901
+ afrikaans: [
1902
+ "[Muziek]",
1903
+ "(C) TV GELDERLAND 2021",
1904
+ "*Thomp thomp thomp*",
1905
+ "www.youtube.com",
1906
+ "ä n wood s",
1907
+ "!.."
1908
+ ],
1909
+ english: [
1910
+ "[applause]",
1911
+ "[APPLAUSE]",
1912
+ "(claps)",
1913
+ "(clapping)",
1914
+ "(audience applauds)",
1915
+ "(keyboard clicking)",
1916
+ "(keyboard clacking)",
1917
+ "(clicking)",
1918
+ "[CLICK]",
1919
+ "[BLANK_AUDIO]",
1920
+ "(upbeat music)",
1921
+ "(dramatic music)",
1922
+ "[music playing]",
1923
+ "(electronic music)",
1924
+ "(audience cheering)",
1925
+ "(audience cheers)",
1926
+ "[MUSIC]",
1927
+ "( ( ( ( ) ( ) ( ) ( )",
1928
+ "(laughs)",
1929
+ "(air whooshing)",
1930
+ "<u>Transcribed</u> by https://otter.ai",
1931
+ "All new tonight at 6... coming up. A new look at your forecast is A new look at your forecast is",
1932
+ "www.mooji.org",
1933
+ "KATHRYN A new forecast is coming up... A new forecast is coming up...",
1934
+ "KATHRYN pandemic started. increasing since the The pandemic has been",
1935
+ "A new look at your forecast this morning... A new look at your",
1936
+ "We'll be right back.",
1937
+ "We'll see you next week.",
1938
+ "Thanks for watching!",
1939
+ "❤️ Translated by Amara.org Communit"
1940
+ ],
1941
+ flemish: [
1942
+ "*clap*",
1943
+ "TV GELDERLAND 2020",
1944
+ "TV Gelderland 2021",
1945
+ "(C) TV GELDERLAND 2021",
1946
+ "[Muziek]",
1947
+ "Kuman",
1948
+ "Ondertitels ingediend door de Amara.org gemeenschap",
1949
+ "Ondertiteld door de Amara.org gemeenschap",
1950
+ "Dank u wel voor het kijken.",
1951
+ "Ondertiteling door de Amara.org gemeenschap",
1952
+ "GELUID VAN MAHIH U similarly"
1953
+ ],
1954
+ french: [
1955
+ "(applaudissements)",
1956
+ "[Applaudissements]",
1957
+ "Sous-titres réalisés par la communauté d'Amara.org",
1958
+ "- Bonne journée. - Bonjour.",
1959
+ "POP POP הי",
1960
+ "Merci d'avoir regardé cette vidéo.",
1961
+ "Merci d'avoir regardé cette vidéo!",
1962
+ "Merci d'avoir regardé la vidéo.",
1963
+ "J'espère que vous avez apprécié la vidéo.",
1964
+ "Je vous remercie de vous abonner",
1965
+ "Merci d'avoir regardé!",
1966
+ "❤️ par SousTitreur.com",
1967
+ "— Sous-titrage ST'501 —",
1968
+ "Thanks for watching!",
1969
+ "Sous-titres réalisés par l'Amara.org",
1970
+ "Sous-titres réalisés para la communauté d'Amara.org",
1971
+ "Sous-titres réalisés par la communauté d'Amara.org",
1972
+ "Sous-titres fait par Sous-titres par Amara.org",
1973
+ "Sous-titres réalisés par les SousTitres d'Amara.org",
1974
+ "Sous-titres par Amara.org",
1975
+ "Sous-titres par la communauté d'Amara.org",
1976
+ "Sous-titres réalisés pour la communauté d'Amara.org",
1977
+ "Sous-titres réalisés par la communauté de l'Amara.org",
1978
+ "Sous-Titres faits par la communauté d'Amara.org",
1979
+ "Sous-titres par l'Amara.org",
1980
+ "Sous-titres fait par la communauté d'Amara.org",
1981
+ "Sous-titrage ST' 501",
1982
+ "Sous-titrage ST'501",
1983
+ "Cliquez-vous sur les sous-titres et abonnez-vous à la chaîne d'Amara.org",
1984
+ "❤️ par SousTitreur.com"
1985
+ ],
1986
+ german: [
1987
+ "[Klicken]",
1988
+ "(Jubel)",
1989
+ "*lacht*",
1990
+ "[Anhaltender Beifall]",
1991
+ "[Applaus]",
1992
+ "(Applaus)",
1993
+ "* Applaus *",
1994
+ "[MUSIK]",
1995
+ "* mustard ml Drumglöck und knack in einem Handbewerb *",
1996
+ "Untertitelung aufgrund der Amara.org-Community",
1997
+ "Untertitel im Auftrag des ZDF für funk, 2017",
1998
+ "Untertitel von Stephanie Geiges",
1999
+ "Untertitel der Amara.org-Community",
2000
+ "Untertitel im Auftrag des ZDF, 2017",
2001
+ "Untertitel im Auftrag des ZDF, 2020",
2002
+ "Untertitel im Auftrag des ZDF, 2018",
2003
+ "Untertitel im Auftrag des ZDF, 2021",
2004
+ "Untertitelung im Auftrag des ZDF, 2021",
2005
+ "Copyright WDR 2021",
2006
+ "Copyright WDR 2020",
2007
+ "Copyright WDR 2019",
2008
+ "SWR 2021",
2009
+ "SWR 2020"
2010
+ ],
2011
+ italian: [
2012
+ "Alla prossima!",
2013
+ "*applauso*",
2014
+ "[Musica]",
2015
+ "[Musica]",
2016
+ "[Applausi]",
2017
+ "*Bip bip bip bip*",
2018
+ "(musica del NS shore)",
2019
+ "D' 1962 alle tribunte del Gulf",
2020
+ "Sottotitoli creati dalla comunità Amara.org",
2021
+ "Sottotitoli di Sottotitoli di Amara.org",
2022
+ "Sottotitoli e revisione al canale di Amara.org",
2023
+ "Sottotitoli e revisione a cura di Amara.org",
2024
+ "Sottotitoli e revisione a cura di QTSS",
2025
+ "Sottotitoli e revisione a cura di QTSS.",
2026
+ "Sottotitoli a cura di QTSS",
2027
+ "Sottotitoli a cura di Sottotitoli"
2028
+ ],
2029
+ spanish: [
2030
+ "[música]",
2031
+ "[Música de cierre]",
2032
+ "[Aplausos]",
2033
+ "(Aplausos)",
2034
+ "www.alimmenta.com",
2035
+ "¡Gracias por ver el vídeo!",
2036
+ "(sonidos del celular) (Inudible distorsión)",
2037
+ "¡Suscríbete!",
2038
+ "Subtítulos realizados por la comunidad de Amara.org",
2039
+ "Subtitulado por la comunidad de Amara.org",
2040
+ "Subtítulos por la comunidad de Amara.org",
2041
+ "Subtítulos creados por la comunidad de Amara.org",
2042
+ "Subtítulos en español de Amara.org",
2043
+ "Subtítulos hechos por la comunidad de Amara.org",
2044
+ "Subtitulos por la comunidad de Amara.org",
2045
+ "Más información www.alimmenta.com",
2046
+ "www.mooji.org",
2047
+ "[MÚSICA]",
2048
+ "[Music cuts in British]"
2049
+ ]
2050
+ }, Jt = (e) => {
2051
+ let t = e;
2052
+ return Object.values(qt).forEach((n) => {
2053
+ n.forEach((i) => {
2054
+ t = t.replaceAll(i, "");
2055
+ });
2056
+ }), t = t.replace(/\(.*?\)/g, ""), t = t.replace(/\[.*?\]/g, ""), t;
2057
+ }, Qt = 6e4, Zt = 8e3, en = 2, tn = 0.4, nn = 3, rn = /* @__PURE__ */ new Set([
2058
+ "aan",
2059
+ "als",
2060
+ "ben",
2061
+ "bent",
2062
+ "bij",
2063
+ "dan",
2064
+ "dat",
2065
+ "deze",
2066
+ "die",
2067
+ "dit",
2068
+ "doen",
2069
+ "door",
2070
+ "dus",
2071
+ "echt",
2072
+ "een",
2073
+ "eens",
2074
+ "even",
2075
+ "gaan",
2076
+ "gaat",
2077
+ "geen",
2078
+ "geweest",
2079
+ "goed",
2080
+ "graag",
2081
+ "had",
2082
+ "heb",
2083
+ "hebben",
2084
+ "hebt",
2085
+ "heeft",
2086
+ "het",
2087
+ "hier",
2088
+ "hoe",
2089
+ "hoor",
2090
+ "iets",
2091
+ "inderdaad",
2092
+ "kan",
2093
+ "klopt",
2094
+ "kunnen",
2095
+ "kunt",
2096
+ "maar",
2097
+ "mag",
2098
+ "mee",
2099
+ "meer",
2100
+ "met",
2101
+ "mij",
2102
+ "mijn",
2103
+ "misschien",
2104
+ "moet",
2105
+ "moeten",
2106
+ "naar",
2107
+ "net",
2108
+ "niet",
2109
+ "nog",
2110
+ "nou",
2111
+ "oke",
2112
+ "ook",
2113
+ "over",
2114
+ "prima",
2115
+ "toch",
2116
+ "uhm",
2117
+ "uit",
2118
+ "van",
2119
+ "veel",
2120
+ "voor",
2121
+ "wat",
2122
+ "weer",
2123
+ "weet",
2124
+ "wel",
2125
+ "wij",
2126
+ "wil",
2127
+ "wilt",
2128
+ "worden",
2129
+ "wordt",
2130
+ "zeg",
2131
+ "zeggen",
2132
+ "zijn",
2133
+ "zou",
2134
+ "zult",
2135
+ "about",
2136
+ "and",
2137
+ "are",
2138
+ "been",
2139
+ "but",
2140
+ "can",
2141
+ "does",
2142
+ "for",
2143
+ "have",
2144
+ "just",
2145
+ "know",
2146
+ "like",
2147
+ "not",
2148
+ "okay",
2149
+ "right",
2150
+ "she",
2151
+ "that",
2152
+ "the",
2153
+ "them",
2154
+ "then",
2155
+ "there",
2156
+ "they",
2157
+ "this",
2158
+ "want",
2159
+ "was",
2160
+ "well",
2161
+ "were",
2162
+ "what",
2163
+ "will",
2164
+ "with",
2165
+ "would",
2166
+ "yeah",
2167
+ "you",
2168
+ "your"
2169
+ ]);
2170
+ function an(e) {
2171
+ const t = /* @__PURE__ */ new Set();
2172
+ for (const n of e.toLowerCase().split(/[^a-z0-9À-ɏ]+/))
2173
+ n.length < nn || rn.has(n) || t.add(n);
2174
+ return [...t];
1758
2175
  }
1759
- const me = 9e4, Ut = ["out_of_office"], ge = (e) => Ut.includes(e);
1760
- function Li(e, t, n) {
1761
- const i = n - e < me, r = t?.status && (!t.expiresAt || t.expiresAt > n) ? t : void 0;
2176
+ function on(e, t) {
2177
+ if (!e.length) return 0;
2178
+ if (!t.length) return 1;
2179
+ const n = new Set(t), i = new Set(e);
2180
+ let r = 0;
2181
+ for (const a of i) n.has(a) || (r += 1);
2182
+ return r / i.size;
2183
+ }
2184
+ function sn(e, t = Qt) {
2185
+ const n = e.filter((o) => !o.partial && typeof o.text == "string");
2186
+ if (!n.length) return { text: "", segmentCount: 0 };
2187
+ const r = n.reduce((o, s) => Math.max(o, s.endedAt ?? 0), 0) - t;
2188
+ return { text: n.filter((o) => (o.endedAt ?? 0) >= r).map((o) => Jt(o.text).trim()).filter(Boolean).join(" ").replace(/\s+/g, " ").trim(), segmentCount: n.length };
2189
+ }
2190
+ const ln = 60;
2191
+ function Sr(e, t, n = ln) {
2192
+ const i = new Set(e), r = [...e];
2193
+ for (const a of t)
2194
+ !a || i.has(a) || (i.add(a), r.push(a));
2195
+ return r.slice(-n);
2196
+ }
2197
+ function Tr(e) {
2198
+ const { segments: t, now: n, state: i } = e;
2199
+ if (i.lastTriggerAt && n - i.lastTriggerAt < Zt)
2200
+ return { trigger: !1, reason: "too_soon" };
2201
+ const r = sn(t, e.windowMs);
2202
+ if (!r.text) return { trigger: !1, reason: "no_speech" };
2203
+ const a = r.segmentCount - (i.lastSegmentCount ?? 0);
2204
+ if (i.lastQueryTerms && a < en)
2205
+ return { trigger: !1, reason: "too_few_new" };
2206
+ const o = an(r.text);
2207
+ return o.length ? i.lastQueryTerms?.length && on(o, i.lastQueryTerms) < tn ? { trigger: !1, reason: "same_topic" } : { trigger: !0, text: r.text, terms: o, segmentCount: r.segmentCount } : { trigger: !1, reason: "no_speech" };
2208
+ }
2209
+ const Ae = 9e4, cn = ["out_of_office"], ye = (e) => cn.includes(e);
2210
+ function _r(e, t, n) {
2211
+ const i = n - e < Ae, r = t?.status && (!t.expiresAt || t.expiresAt > n) ? t : void 0;
1762
2212
  if (!r?.status) return { online: i, status: i ? "available" : "offline" };
1763
2213
  const a = r.status;
1764
- return !i && !ge(a) ? { online: !1, status: "offline" } : { online: i, status: a, message: r.message };
2214
+ return !i && !ye(a) ? { online: !1, status: "offline" } : { online: i, status: a, message: r.message };
1765
2215
  }
1766
- function $i(e, t) {
1767
- const n = t - e.lastSeenAt < me, i = n || ge(e.status) ? e.status : "offline";
2216
+ function Ir(e, t) {
2217
+ const n = t - e.lastSeenAt < Ae, i = n || ye(e.status) ? e.status : "offline";
1768
2218
  return n === e.online && i === e.status ? e : { ...e, online: n, status: i };
1769
2219
  }
1770
- const Ri = "installation-id";
2220
+ function Mr(e, t) {
2221
+ return e?.teamId && t.includes(e.teamId) ? { teamId: e.teamId, mustChoose: !1 } : t.length === 1 ? { teamId: t[0], mustChoose: !1 } : { teamId: void 0, mustChoose: t.length > 1 };
2222
+ }
2223
+ function Cr(e) {
2224
+ return e.providerAvailable && e.allowed;
2225
+ }
2226
+ const vr = "installation-id";
1771
2227
  export {
1772
2228
  m as ACTIVITY_CATALOG,
1773
- Mt as AI_ATTACHMENT_LIMITS,
1774
- fi as AI_ATTACHMENT_MAX_PER_TURN,
1775
- di as AI_ATTACHMENT_TURN_BUDGET,
1776
- ue as AI_VENDORS,
1777
- Le as ALLOWED_LINK_SCHEMES,
2229
+ Rt as AI_ATTACHMENT_LIMITS,
2230
+ tr as AI_ATTACHMENT_MAX_PER_TURN,
2231
+ er as AI_ATTACHMENT_TURN_BUDGET,
2232
+ fe as AI_VENDORS,
2233
+ De as ALLOWED_LINK_SCHEMES,
1778
2234
  P as ARTIFACT_MAX_BLOCKS,
1779
- ln as ARTIFACT_MAX_BODY_BYTES,
2235
+ $n as ARTIFACT_MAX_BODY_BYTES,
1780
2236
  C as ARTIFACT_MAX_CELL_LEN,
1781
- G as ARTIFACT_MAX_KPI_ITEMS,
2237
+ B as ARTIFACT_MAX_KPI_ITEMS,
1782
2238
  U as ARTIFACT_MAX_LIST_ITEMS,
1783
- B as ARTIFACT_MAX_TABLE_COLUMNS,
2239
+ j as ARTIFACT_MAX_TABLE_COLUMNS,
1784
2240
  K as ARTIFACT_MAX_TABLE_ROWS,
1785
- ie as ARTIFACT_MAX_TEXT_LEN,
1786
- de as AUTH_APP_NAME,
1787
- Te as ActivityTypeRegistry,
1788
- Zt as BUILT_IN_ONLY,
1789
- bn as CLASSIFY_VARS,
1790
- rn as CORE_DIMENSIONS,
1791
- kt as CommunicationScheme,
1792
- ei as DEFAULT_MEMORY_BUDGET,
1793
- at as DEFAULT_PHONE_REGION,
1794
- Mi as FEATURE_FOLDER_MANAGEMENT,
1795
- Ci as FEATURE_REMOTE_SEARCH,
1796
- Ri as INSTALLATION_HEADER,
1797
- Si as InteractionParticipantRole,
1798
- ze as KB_FALLBACK_LOCALE,
1799
- j as KB_LOCALES,
1800
- Ft as MAX_ACTIONS,
1801
- Kt as MAX_BLOCKS,
1802
- le as MAX_COLLECTION_DEPTH,
1803
- Bt as MAX_FIELDS,
1804
- Gt as MAX_LIST_ITEMS,
1805
- qn as MAX_MEMORY_BROWSE,
1806
- Zn as MAX_MEMORY_BUDGET,
1807
- Jn as MAX_MEMORY_CHARS,
1808
- Qe as MAX_TOPIC_CANDIDATES,
1809
- Je as MAX_TOPIC_EXAMPLES,
1810
- x as MAX_TOPIC_EXAMPLE_CHARS,
1811
- Qn as MIN_MEMORY_BUDGET,
1812
- je as PAUSED_RUN_STATUSES,
1813
- k as PHONE_REGIONS,
1814
- me as PRESENCE_ONLINE_WINDOW_MS,
1815
- Ut as PRESENCE_SURVIVES_OFFLINE,
1816
- Ti as PROVIDER_FEATURE_MESSAGE_TEMPLATES,
1817
- _i as PROVIDER_FEATURE_MESSAGE_WINDOW,
1818
- dt as PUBLIC_EMAIL_DOMAINS,
1819
- rt as RELATED_SUBJECT_KINDS,
1820
- Fn as SIGNATURE_INTENTS,
1821
- He as STEP_MAX_TOKENS_MAX,
1822
- Fe as STEP_MAX_TOKENS_MIN,
1823
- _t as SUMMARY_MIN_LAST_CHARS,
1824
- At as SUMMARY_MIN_MESSAGES,
1825
- Ve as TERMINAL_RUN_STATUSES,
1826
- yn as TRIGGER_VARS,
1827
- xi as UNSUPPORTED,
1828
- Ne as USAGE_DIMENSIONS,
1829
- ve as USAGE_DIMENSION_IDS,
1830
- $n as acceptExampleCandidate,
1831
- Ge as actingIdentityKey,
1832
- Vt as activityIconOf,
1833
- Qt as activityJoinUrl,
1834
- Ee as activitySnippet,
1835
- Ae as activityTextParams,
1836
- Jt as activityTimelineText,
1837
- nn as activityTimestamp,
1838
- f as activityTypeInfo,
1839
- _n as actorKey,
1840
- Ln as addExampleCandidate,
1841
- $i as agePresenceEntry,
1842
- It as aiAttachmentKind,
1843
- mi as aiAttachmentRejection,
1844
- W as aiBudgetLimit,
1845
- Gn as aiBudgetPeriodKey,
1846
- nt as aiBudgetPeriodStart,
1847
- Bn as aiBudgetState,
1848
- Kn as aiVendorAcceptsAttachment,
1849
- Dn as aiVendorDefaultModel,
1850
- wn as aiVendorLabel,
1851
- Un as aiVendorNeedsBaseUrl,
1852
- Pn as aiVendorsWith,
1853
- fe as appNameFromPath,
1854
- Hn as applySignature,
1855
- un as artifactBodyBytes,
1856
- pn as artifactOutline,
1857
- dn as artifactToMarkdown,
1858
- en as buildActivityPreview,
1859
- hi as buildChannelIntents,
1860
- fn as buildShareKeys,
1861
- vn as canNestUnder,
1862
- Yt as carriesText,
1863
- On as categoryLabel,
1864
- Ai as channelKindForScheme,
1865
- jt as channelKindOf,
1866
- Tn as clampStepMaxTokens,
1867
- ci as cleanMessageText,
1868
- qe as defaultLocaleOf,
1869
- Ii as defineIntent,
1870
- We as depthOf,
1871
- Li as derivePresence,
1872
- gi as disabledIntentsFromCapabilities,
1873
- ri as emailDomain,
1874
- si as endpointKey,
1875
- Rt as extractParams,
1876
- bi as filterByEndpoint,
1877
- yi as filterByIntent,
1878
- vt as filterByTargetScheme,
1879
- _ as findAiVendor,
1880
- an as flattenLocales,
1881
- Me as floorToPeriod,
1882
- Be as formatActingIdentity,
1883
- Ie as formatPeriod,
1884
- tn as getActivitySeenUserIds,
1885
- Vn as getContactEndpoints,
1886
- Yn as getShortTitle,
1887
- Wn as getUrgencyScore,
1888
- ce as heightOf,
1889
- Cn as helpCenterText,
1890
- hn as humanizeAction,
1891
- jn as isAssigned,
1892
- Xn as isClosed,
1893
- Ni as isDeepLink,
1894
- Ye as isDescendant,
1895
- zn as isInteractionUnseen,
1896
- vi as isLandingPath,
1897
- ui as isLikelyBulk,
1898
- Xt as isMessageType,
1899
- Dt as isMoreSpecificPattern,
1900
- In as isPaused,
1901
- qt as isPlaybookAuthoredType,
1902
- ai as isPublicEmailDomain,
1903
- Oi as isPublicPath,
1904
- Wt as isReplyableType,
1905
- Sn as isRetryable,
1906
- Xe as isTerminal,
1907
- pi as isThreadLongEnough,
1908
- Mn as linkLabel,
1909
- Nn as localeInstruction,
1910
- xn as localeName,
1911
- kn as localesOf,
1912
- ni as looksLikeEmail,
1913
- Ei as matchContactToIntents,
1914
- Pt as matchPublicRoute,
1915
- zt as messageCountsAs,
1916
- oi as needsPhoneRegion,
1917
- cn as normalizeArtifactBlocks,
1918
- Ht as normalizeBlocks,
1919
- pe as normalizeEmail,
2241
+ ae as ARTIFACT_MAX_TEXT_LEN,
2242
+ He as ASSIGNMENT_SCOPE_KIND,
2243
+ ge as AUTH_APP_NAME,
2244
+ Me as ActivityTypeRegistry,
2245
+ Cn as BUILT_IN_ONLY,
2246
+ Zt as CADENCE_FLOOR_MS,
2247
+ en as CADENCE_MIN_NEW_SEGMENTS,
2248
+ tn as CADENCE_MIN_NOVELTY,
2249
+ Qt as CADENCE_WINDOW_MS,
2250
+ Yn as CLASSIFY_VARS,
2251
+ Nn as CORE_DIMENSIONS,
2252
+ Gt as CommunicationScheme,
2253
+ Bi as DEFAULT_MEMORY_BUDGET,
2254
+ ht as DEFAULT_PHONE_REGION,
2255
+ ri as EMPTY_WORKFLOW,
2256
+ mr as FEATURE_FOLDER_MANAGEMENT,
2257
+ gr as FEATURE_REMOTE_SEARCH,
2258
+ vr as INSTALLATION_HEADER,
2259
+ Qe as INTERACTION_KIND,
2260
+ pr as InteractionParticipantRole,
2261
+ ot as KB_FALLBACK_LOCALE,
2262
+ X as KB_LOCALES,
2263
+ fn as MAX_ACTIONS,
2264
+ Ve as MAX_ASSIGNMENT_TURNS,
2265
+ un as MAX_BLOCKS,
2266
+ de as MAX_COLLECTION_DEPTH,
2267
+ dn as MAX_FIELDS,
2268
+ pn as MAX_LIST_ITEMS,
2269
+ Pi as MAX_MEMORY_BROWSE,
2270
+ ji as MAX_MEMORY_BUDGET,
2271
+ Ui as MAX_MEMORY_CHARS,
2272
+ ln as MAX_SHOWN_KEYS,
2273
+ ct as MAX_TOPIC_CANDIDATES,
2274
+ lt as MAX_TOPIC_EXAMPLES,
2275
+ v as MAX_TOPIC_EXAMPLE_CHARS,
2276
+ Ki as MIN_MEMORY_BUDGET,
2277
+ N as PHONE_REGIONS,
2278
+ Ae as PRESENCE_ONLINE_WINDOW_MS,
2279
+ cn as PRESENCE_SURVIVES_OFFLINE,
2280
+ dr as PROVIDER_FEATURE_MESSAGE_TEMPLATES,
2281
+ ur as PROVIDER_FEATURE_MESSAGE_WINDOW,
2282
+ _t as PUBLIC_EMAIL_DOMAINS,
2283
+ V as READ_STEP_TYPES,
2284
+ gt as RELATED_SUBJECT_KINDS,
2285
+ ki as SIGNATURE_INTENTS,
2286
+ tt as STEP_MAX_TOKENS_MAX,
2287
+ et as STEP_MAX_TOKENS_MIN,
2288
+ Ot as SUMMARY_MIN_LAST_CHARS,
2289
+ xt as SUMMARY_MIN_MESSAGES,
2290
+ Fe as TERMINAL_ASSIGNMENT_STATUSES,
2291
+ nt as TERMINAL_RUN_STATUSES,
2292
+ zn as TRIGGER_VARS,
2293
+ hr as UNSUPPORTED,
2294
+ xe as USAGE_DIMENSIONS,
2295
+ Oe as USAGE_DIMENSION_IDS,
2296
+ bi as acceptExampleCandidate,
2297
+ ze as actingIdentityKey,
2298
+ gn as activityIconOf,
2299
+ Mn as activityJoinUrl,
2300
+ Te as activitySnippet,
2301
+ _e as activityTextParams,
2302
+ In as activityTimelineText,
2303
+ kn as activityTimestamp,
2304
+ d as activityTypeInfo,
2305
+ Qn as actorKey,
2306
+ yi as addExampleCandidate,
2307
+ Ir as agePresenceEntry,
2308
+ Dt as aiAttachmentKind,
2309
+ nr as aiAttachmentRejection,
2310
+ Y as aiBudgetLimit,
2311
+ vi as aiBudgetPeriodKey,
2312
+ ft as aiBudgetPeriodStart,
2313
+ Ci as aiBudgetState,
2314
+ Mi as aiVendorAcceptsAttachment,
2315
+ Ti as aiVendorDefaultModel,
2316
+ Si as aiVendorLabel,
2317
+ Ii as aiVendorNeedsBaseUrl,
2318
+ _i as aiVendorsWith,
2319
+ he as appNameFromPath,
2320
+ Ni as applySignature,
2321
+ Rn as artifactBodyBytes,
2322
+ Pn as artifactOutline,
2323
+ Un as artifactToMarkdown,
2324
+ ni as assignmentMismatch,
2325
+ Fn as assignmentScopeKey,
2326
+ Hn as assignmentSubject,
2327
+ vn as buildActivityPreview,
2328
+ ar as buildChannelIntents,
2329
+ Kn as buildShareKeys,
2330
+ sn as buildWindow,
2331
+ gi as canNestUnder,
2332
+ bn as carriesText,
2333
+ Ai as categoryLabel,
2334
+ cr as channelKindForScheme,
2335
+ hn as channelKindOf,
2336
+ ii as clampStepMaxTokens,
2337
+ Ji as cleanMessageText,
2338
+ Vn as decideAssignmentState,
2339
+ Tr as decideCadence,
2340
+ st as defaultLocaleOf,
2341
+ fr as defineIntent,
2342
+ rt as depthOf,
2343
+ _r as derivePresence,
2344
+ rr as disabledIntentsFromCapabilities,
2345
+ Wi as emailDomain,
2346
+ Yi as endpointKey,
2347
+ Wt as extractParams,
2348
+ an as extractTerms,
2349
+ sr as filterByEndpoint,
2350
+ or as filterByIntent,
2351
+ Bt as filterByTargetScheme,
2352
+ S as findAiVendor,
2353
+ xn as flattenLocales,
2354
+ we as floorToPeriod,
2355
+ Xe as formatActingIdentity,
2356
+ ve as formatPeriod,
2357
+ ir as freshSources,
2358
+ wn as getActivitySeenUserIds,
2359
+ xi as getContactEndpoints,
2360
+ Di as getShortTitle,
2361
+ $i as getUrgencyScore,
2362
+ pe as heightOf,
2363
+ pi as helpCenterText,
2364
+ Xn as humanizeAction,
2365
+ Ze as interactionIdOf,
2366
+ Fi as isAgentUser,
2367
+ Oi as isAssigned,
2368
+ Gn as isAssignmentTerminal,
2369
+ qe as isAssignmentTrigger,
2370
+ Li as isClosed,
2371
+ Tn as isConnectedType,
2372
+ Ar as isDeepLink,
2373
+ at as isDescendant,
2374
+ li as isInFlight,
2375
+ Ri as isInteractionUnseen,
2376
+ yr as isLandingPath,
2377
+ Qi as isLikelyBulk,
2378
+ An as isMessageType,
2379
+ zt as isMoreSpecificPattern,
2380
+ it as isPaused,
2381
+ Sn as isPlaybookAuthoredType,
2382
+ Xi as isPublicEmailDomain,
2383
+ Er as isPublicPath,
2384
+ yn as isReplyableType,
2385
+ si as isTerminal,
2386
+ Zi as isThreadLongEnough,
2387
+ _n as isTranscriptType,
2388
+ di as linkLabel,
2389
+ wi as listeningAllowed,
2390
+ mi as localeInstruction,
2391
+ fi as localeName,
2392
+ hi as localesOf,
2393
+ Hi as looksLikeEmail,
2394
+ lr as matchContactToIntents,
2395
+ Yt as matchPublicRoute,
2396
+ Sr as mergeShownKeys,
2397
+ En as messageCountsAs,
2398
+ zi as needsPhoneRegion,
2399
+ Dn as normalizeArtifactBlocks,
2400
+ mn as normalizeBlocks,
2401
+ me as normalizeEmail,
1920
2402
  g as normalizeExample,
1921
- En as parseActingIdentity,
1922
- $t as pathToRegex,
1923
- on as periodsInRange,
1924
- ii as phoneSuffix,
1925
- li as plainTextFromMarkdown,
1926
- An as playbookActor,
1927
- wt as publicBasePathFor,
1928
- ki as publicRoutePatterns,
1929
- N as readPath,
1930
- pt as registrableDomain,
1931
- et as rejectExampleCandidate,
1932
- ti as relatedByDefault,
1933
- xt as resolveAccountCapabilities,
1934
- v as resolveActivityText,
1935
- Ct as resolveChannelIntents,
1936
- it as resolveSignature,
1937
- De as sanitizeInline,
1938
- oe as shareKeyForTeam,
1939
- ae as shareKeyForUser,
1940
- mn as shareKeysForViewer,
1941
- be as stripHtml,
1942
- q as toE164,
1943
- gn as toolSourceKinds,
1944
- tt as topicOfferedForTeam,
1945
- Rn as topicsForTeam,
1946
- Ze as truncateExample,
1947
- ke as usageMetricId,
1948
- sn as usageMetrics
2403
+ on as novelty,
2404
+ qn as parseActingIdentity,
2405
+ Vt as pathToRegex,
2406
+ On as periodsInRange,
2407
+ Vi as phoneSuffix,
2408
+ qi as plainTextFromMarkdown,
2409
+ Ye as playbookActor,
2410
+ oi as procedureOf,
2411
+ Xt as publicBasePathFor,
2412
+ br as publicRoutePatterns,
2413
+ w as readPath,
2414
+ W as readStepError,
2415
+ Je as refKey,
2416
+ Tt as registrableDomain,
2417
+ dt as rejectExampleCandidate,
2418
+ Gi as relatedByDefault,
2419
+ Kt as resolveAccountCapabilities,
2420
+ k as resolveActivityText,
2421
+ Ut as resolveChannelIntents,
2422
+ mt as resolveSignature,
2423
+ Mr as resolveWorkMode,
2424
+ Jn as runActor,
2425
+ ui as runInteractionId,
2426
+ Ke as sanitizeInline,
2427
+ Jt as sanitizeTranscript,
2428
+ Wn as selectLenses,
2429
+ le as shareKeyForTeam,
2430
+ se as shareKeyForUser,
2431
+ jn as shareKeysForViewer,
2432
+ Cr as shouldRunAudioPipeline,
2433
+ Pt as sourceKey,
2434
+ ai as stepsOf,
2435
+ Se as stripHtml,
2436
+ ci as subjectKeyOf,
2437
+ ce as subjectOf,
2438
+ ti as targetById,
2439
+ ei as targetForActivityType,
2440
+ Q as toE164,
2441
+ Bn as toolSourceKinds,
2442
+ pt as topicOfferedForTeam,
2443
+ Ei as topicsForTeam,
2444
+ ut as truncateExample,
2445
+ Le as usageMetricId,
2446
+ Ln as usageMetrics,
2447
+ Zn as valueAtPath
1949
2448
  };