@opencxh/domain 1.151.0 → 1.153.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/ai-budget/index.d.ts +1 -0
- package/dist/entities/ai-budget/types.d.ts +138 -0
- package/dist/index.cjs +8 -8
- package/dist/index.d.ts +1 -0
- package/dist/index.js +645 -611
- package/dist/platform/ai-tools.d.ts +12 -6
- package/dist/platform/presence.d.ts +55 -1
- package/dist/platform/presence.test.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './types';
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { OwnerScope } from '../contact/types';
|
|
2
|
+
/**
|
|
3
|
+
* A ceiling on what may be spent on AI in one period.
|
|
4
|
+
*
|
|
5
|
+
* The accounting already exists: every provider call writes an `ai_usage` row
|
|
6
|
+
* with its cost frozen at write time. A budget adds no measurement — it adds an
|
|
7
|
+
* answer to "and then?". That is why this type is small: it is policy, and the
|
|
8
|
+
* facts live elsewhere.
|
|
9
|
+
*/
|
|
10
|
+
export interface AiBudget {
|
|
11
|
+
id: string;
|
|
12
|
+
organizationId: string;
|
|
13
|
+
/**
|
|
14
|
+
* Who this budget is for — the same three rungs as a task, a template or a
|
|
15
|
+
* contact, so one set of helpers answers "does this apply to me".
|
|
16
|
+
*
|
|
17
|
+
* `org` is not "everyone's budgets added up": it counts **every** row in the
|
|
18
|
+
* tenant, including the ones attributed to nobody (kb indexing, transcription,
|
|
19
|
+
* playbooks running as the organisation). That unattributed spend is real and
|
|
20
|
+
* it has to land somewhere.
|
|
21
|
+
*/
|
|
22
|
+
scope: OwnerScope;
|
|
23
|
+
/**
|
|
24
|
+
* Warn here. Absent = never warn, only block. Both absent is allowed and means
|
|
25
|
+
* the budget does nothing — the UI says so rather than pretending it is armed.
|
|
26
|
+
*/
|
|
27
|
+
softLimitNanos?: number;
|
|
28
|
+
/** Refuse the next call here. Absent = never block, only warn. */
|
|
29
|
+
hardLimitNanos?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Currently only `"month"`: a calendar month, because that is the rhythm a bill
|
|
32
|
+
* arrives in. A field rather than a constant so a quarter later breaks nothing.
|
|
33
|
+
*/
|
|
34
|
+
period: AiBudgetPeriod;
|
|
35
|
+
/**
|
|
36
|
+
* Off keeps the amounts. An emergency release that does not cost you the
|
|
37
|
+
* configuration you will want back tomorrow.
|
|
38
|
+
*/
|
|
39
|
+
enabled: boolean;
|
|
40
|
+
createdBy: string;
|
|
41
|
+
createdAt?: number;
|
|
42
|
+
updatedAt?: number;
|
|
43
|
+
}
|
|
44
|
+
export type AiBudgetPeriod = "month";
|
|
45
|
+
/** Fields an update may empty. See {@link AiBudgetInput.clear}. */
|
|
46
|
+
export type AiBudgetClearable = "softLimitNanos" | "hardLimitNanos";
|
|
47
|
+
/**
|
|
48
|
+
* What a client may send. The server owns everything not in here.
|
|
49
|
+
*
|
|
50
|
+
* An absent limit means "leave it alone"; **removing** one goes through
|
|
51
|
+
* {@link AiBudgetInput.clear}.
|
|
52
|
+
*
|
|
53
|
+
* That indirection is not taste. The app SDK's `invoke` strips every `null` from
|
|
54
|
+
* the body along with `undefined` (`removeUndefined`, `app-sdk/src/modules/api.ts`),
|
|
55
|
+
* so a `null` never reaches the server and "there is no ceiling any more" has no
|
|
56
|
+
* value that can express it. A named list survives the transport and says out loud
|
|
57
|
+
* what an ambiguous sentinel (`0`? that is a real limit) never could.
|
|
58
|
+
*/
|
|
59
|
+
export interface AiBudgetInput {
|
|
60
|
+
scope?: OwnerScope;
|
|
61
|
+
softLimitNanos?: number;
|
|
62
|
+
hardLimitNanos?: number;
|
|
63
|
+
period?: AiBudgetPeriod;
|
|
64
|
+
enabled?: boolean;
|
|
65
|
+
/** Limits to remove. Wins over a value for the same field. */
|
|
66
|
+
clear?: AiBudgetClearable[];
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* A budget plus what has been spent against it — the only shape any screen wants.
|
|
70
|
+
*
|
|
71
|
+
* Kept together on purpose: a budget without its spend is a number nobody can act
|
|
72
|
+
* on, and two round trips to pair them up would let the page render a bar that is
|
|
73
|
+
* briefly, confidently wrong.
|
|
74
|
+
*/
|
|
75
|
+
export interface AiBudgetView extends AiBudget {
|
|
76
|
+
spend: AiSpend;
|
|
77
|
+
/** `soft` once past the soft limit, `hard` once past the hard one. */
|
|
78
|
+
state: AiBudgetState;
|
|
79
|
+
}
|
|
80
|
+
export type AiBudgetState = "ok" | "soft" | "hard";
|
|
81
|
+
/** What was spent in one period, for one scope. */
|
|
82
|
+
export interface AiSpend {
|
|
83
|
+
/** Start of the period this covers (epoch ms), so a client can label it. */
|
|
84
|
+
periodStart: number;
|
|
85
|
+
/** Sum of the priced rows, in nano-USD. */
|
|
86
|
+
spentNanos: number;
|
|
87
|
+
/** How many provider calls it took. */
|
|
88
|
+
calls: number;
|
|
89
|
+
/**
|
|
90
|
+
* Calls whose rate was unknown, which therefore contributed **nothing**.
|
|
91
|
+
*
|
|
92
|
+
* An empty `costNanos` means "no rate known", not "free". Counting those as
|
|
93
|
+
* zero is the only honest option — but it means an unknown model can walk past
|
|
94
|
+
* a ceiling without touching it, so the number is surfaced rather than hidden:
|
|
95
|
+
* a budget that is not working should not look like a budget that is.
|
|
96
|
+
*/
|
|
97
|
+
unpricedCalls: number;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* What the personal usage page shows: your own spend, plus every ceiling that
|
|
101
|
+
* applies to you.
|
|
102
|
+
*
|
|
103
|
+
* `budgets` deliberately includes the team and organisation ones, with their
|
|
104
|
+
* amounts. The alternative — being refused by a ceiling you cannot see — is a
|
|
105
|
+
* worse answer than letting a colleague read the team total. It is a disclosure
|
|
106
|
+
* choice, so it lives in one place: the `/budget/me` handler decides it, and
|
|
107
|
+
* narrowing it later means changing that handler and nothing else.
|
|
108
|
+
*/
|
|
109
|
+
export interface AiMyUsage {
|
|
110
|
+
/** Your own spend this period, whether or not you have a budget. */
|
|
111
|
+
spend: AiSpend;
|
|
112
|
+
/** Personal, team and organisation ceilings that apply to you. */
|
|
113
|
+
budgets: AiBudgetView[];
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Decide the state of a budget from its spend. Shared so the server, the admin
|
|
117
|
+
* page and the personal page cannot drift on where "almost" ends.
|
|
118
|
+
*/
|
|
119
|
+
export declare function aiBudgetState(budget: Pick<AiBudget, "softLimitNanos" | "hardLimitNanos" | "enabled">, spentNanos: number): AiBudgetState;
|
|
120
|
+
/**
|
|
121
|
+
* "Geen plafond" heeft twee vormen en die moeten hetzelfde betekenen.
|
|
122
|
+
*
|
|
123
|
+
* Een gewist plafond wordt als `null` weggeschreven — `undefined` in een `$set`
|
|
124
|
+
* laat het veld staan in plaats van het te legen. Bij het teruglezen is `null`
|
|
125
|
+
* dus een echte waarde, en `x !== undefined` zou hem als het getal nul opvatten:
|
|
126
|
+
* een plafond van nul blokkeert onmiddellijk, zonder dat iemand dat instelde.
|
|
127
|
+
*/
|
|
128
|
+
export declare function aiBudgetLimit(value: number | null | undefined): number | undefined;
|
|
129
|
+
/**
|
|
130
|
+
* Start of the calendar month containing `at`, in UTC.
|
|
131
|
+
*
|
|
132
|
+
* UTC and not the tenant's timezone: the usage rows are stamped with `Date.now()`,
|
|
133
|
+
* so a local-midnight boundary would put a row on one side of the period and its
|
|
134
|
+
* own timestamp on the other. One clock, all the way through.
|
|
135
|
+
*/
|
|
136
|
+
export declare function aiBudgetPeriodStart(at: number, period?: AiBudgetPeriod): number;
|
|
137
|
+
/** Stable key for one budget's period — used for caching and for warn-once state. */
|
|
138
|
+
export declare function aiBudgetPeriodKey(at: number, period?: AiBudgetPeriod): string;
|
package/dist/index.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=10,T=10,b=10,I=5,st=new Set(["header","section","context","divider","image","list","actions","attachments"]);function x(e){if(typeof e=="string")return e.length>0;if(!e||typeof e!="object")return!1;const t=e;return typeof t.key=="string"||typeof t.value=="string"}function lt(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const a of e){if(n.length>=D){t("more than "+D+" blocks; the rest was dropped");break}if(!a||typeof a!="object")continue;const i=a;if(!st.has(i.type)){t("unknown block type "+String(i.type));continue}switch(i.type){case"header":if(!x(i.text)){t("a header without text");continue}break;case"context":if(!x(i.text)){t("a context block without text");continue}break;case"image":if(!i.url||!i.alt){t("an image without url or alt");continue}break;case"section":Array.isArray(i.fields)&&i.fields.length>T&&(t("more than "+T+" fields in a section"),i.fields=i.fields.slice(0,T));break;case"list":if(!Array.isArray(i.items)||i.items.length===0){t("a list without items");continue}i.items.length>b&&(t("more than "+b+" list items"),i.items=i.items.slice(0,b));break;case"actions":{const r=Array.isArray(i.elements)?i.elements:[],o=r.filter(s=>s&&s.action_id&&s.invoke&&x(s.text));if(o.length!==r.length&&t("an action without action_id, invoke or text"),o.length===0)continue;o.length>I&&t("more than "+I+" actions"),i.elements=o.slice(0,I);break}}n.push(i)}return n}function me(e){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()}function y(e){if(!e||e<0)return"";const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`}function J(e){return e?` — ${Math.floor(e/60)}m ${e%60}s`:""}function v(e){return e?.split("@")?.[0]||e||""}function _(e){return e.map(t=>t.name).join(", ")}function Q(e){return e==="meeting"?"Meeting":e==="video"?"Video call":"Audio call"}const m={VOICE_CALL_STARTED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek gestart",timeline:e=>e.direction==="inbound"?`Inbound call started — ${v(e.payload.from)}`:`Outbound call started — ${v(e.payload.to)}`},VOICE_CALL_ANSWERED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek aangenomen",timeline:(e,t)=>`Call answered — ${t}`},VOICE_CALL_HOLD:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"In de wacht",timeline:(e,t)=>`Call on hold — ${t}`},VOICE_CALL_UNHOLD:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Hervat"},VOICE_CALL_ENDED:{shape:"event",channelKind:"voice",icon:"phone",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${y(e.payload.duration)})`:""}`,timeline:e=>`Call ended${J(e.payload.duration)}`},VOICE_CALL_MISSED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gemiste oproep",timeline:e=>`Missed call — ${v(e.payload.from)}`},VOICE_CALL_FAILED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek mislukt",timeline:()=>"Call failed"},VOICE_CALL_VOICEMAIL:{shape:"artifact",channelKind:"voice",icon:"phone",snippet:e=>e.payload.transcription?.trim()?e.payload.transcription:"Voicemail ontvangen"},VIDEO_CALL_STARTED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gesprek gestart",timeline:()=>"Video call started"},VIDEO_CALL_ANSWERED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gesprek aangenomen",timeline:()=>"Video call answered"},VIDEO_CALL_HOLD:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"In de wacht"},VIDEO_CALL_UNHOLD:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Hervat"},VIDEO_CALL_ENDED:{shape:"event",channelKind:"video",icon:"video",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${y(e.payload.duration)})`:""}`,timeline:()=>"Video call ended"},VIDEO_CALL_MISSED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gemiste oproep",timeline:()=>"Missed video call"},VIDEO_CALL_FAILED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gesprek mislukt",timeline:()=>"Video call failed"},EMAIL_RECEIVED:{shape:"message",triggerable:!0,displayNameKey:"communication:activity.EMAIL_RECEIVED",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"inbound_message",snippet:Z},EMAIL_SENT:{shape:"message",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:Z},CHAT_MESSAGE_SENT:{shape:"message",component:"communication:ChatMessage",channelKind:"chat",icon:"message-circle",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:e=>e.payload.text??""},CHAT_MESSAGE_RECEIVED:{shape:"message",triggerable:!0,displayNameKey:"communication:activity.CHAT_MESSAGE_RECEIVED",component:"communication:ChatMessage",channelKind:"chat",icon:"message-circle",replyable:!0,carriesText:!0,countsAs:"inbound_message",snippet:e=>e.payload.text??""},CHAT_MEMBER_JOINED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`${_(e.payload.members)} toegevoegd`,timeline:e=>{const t=_(e.payload.members)||"Someone",n=e.payload.initiator?.name?` · added by ${e.payload.initiator.name}`:"";return`${t} joined the chat${n}`}},CHAT_MEMBER_LEFT:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`${_(e.payload.members)} verlaten`,timeline:e=>{const t=_(e.payload.members)||"Someone",n=e.payload.initiator?.name?` · removed by ${e.payload.initiator.name}`:"";return`${t} left the chat${n}`}},CHAT_RENAMED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`Hernoemd naar "${e.payload.newName}"`,timeline:e=>`Chat renamed to "${e.payload.newName}"${e.payload.initiator?` by ${e.payload.initiator.name}`:""}`},CHAT_CALL_STARTED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:()=>"Gesprek gestart",timeline:e=>`${Q(e.payload.callType)} started${e.payload.initiator?` by ${e.payload.initiator.name}`:""}`,joinUrl:e=>e.payload.joinUrl},CHAT_CALL_ENDED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${y(e.payload.duration)})`:""}`,timeline:e=>`${Q(e.payload.callType)} ended${J(e.payload.duration)}`,joinUrl:e=>e.payload.joinUrl},CHAT_EVENT:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>e.payload.text??e.payload.eventType,timeline:e=>e.payload.text||e.payload.eventType},TRANSCRIPT_ADDED:{shape:"artifact",triggerable:!0,displayNameKey:"communication:activity.TRANSCRIPT_ADDED",component:"communication:TranscriptionActivity",icon:"captions",carriesText:!0,snippet:e=>(e.payload.segments??[]).map(t=>t.text).join(" ")},COMMENT_ADDED:{shape:"note",component:"communication:CommentActivity",icon:"sticky-note",carriesText:!0,snippet:e=>e.payload.text??""},FILE_UPLOADED:{shape:"artifact",component:"communication:FileActivity",icon:"paperclip",snippet:e=>`Bestand: ${e.payload.fileName}`},AI_MESSAGE_ADDED:{shape:"event",triggerable:!0,displayNameKey:"communication:activity.AI_MESSAGE_ADDED",icon:"circle",snippet:e=>e.payload.output?.text??e.payload.input?.text??"",timeline:()=>"AI message added"},AI_ACTION_PROPOSED:{shape:"event",component:"communication:ProposedActionCard",icon:"circle",playbookAuthored:!0,snippet:e=>`Voorstel wacht op goedkeuring (${e.payload.actions?.length??0} actie(s))`},PLAYBOOK_STARTED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:e=>`Playbook gestart${e.payload.playbookName?`: ${e.payload.playbookName}`:""}`,timeline:e=>`Playbook gestart${e.payload.playbookName?` — ${e.payload.playbookName}`:""}`},PLAYBOOK_COMPLETED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:()=>"Playbook afgerond",timeline:()=>"Playbook afgerond"},PLAYBOOK_ESCALATED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:()=>"Playbook geëscaleerd naar een mens",timeline:()=>"Playbook geëscaleerd naar een mens"},MEETING_SCHEDULED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering gepland: ${e.payload.title}`,timeline:()=>"Meeting scheduled",joinUrl:e=>e.payload.joinUrl},MEETING_STARTED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering gestart: ${e.payload.title}`,timeline:()=>"Meeting started",joinUrl:e=>e.payload.joinUrl},MEETING_ENDED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering beëindigd${e.payload.duration?` (${y(e.payload.duration)})`:""}`,timeline:()=>"Meeting ended"},MEETING_PARTICIPANT_JOINED:{shape:"event",icon:"calendar",snippet:e=>`${e.payload.name} deelgenomen`,timeline:(e,t)=>`${t} joined the meeting`},MEETING_PARTICIPANT_LEFT:{shape:"event",icon:"calendar",snippet:e=>`${e.payload.name} verlaten`,timeline:(e,t)=>`${t} left the meeting`},INTERACTION_CREATED:{shape:"event",icon:"circle",snippet:()=>"Interactie aangemaakt",timeline:(e,t)=>`Interaction started by ${t}`},INTERACTION_STATUS_CHANGED:{shape:"event",triggerable:!0,displayNameKey:"communication:activity.INTERACTION_STATUS_CHANGED",icon:"circle-dot",snippet:e=>`Status: ${e.payload.fromStatus} → ${e.payload.toStatus}`,timeline:(e,t)=>`Status changed to ${e.payload.toStatus} by ${t}`},INTERACTION_ASSIGNED:{shape:"event",icon:"user",snippet:()=>"Interactie toegewezen",timeline:(e,t)=>`Assigned by ${t}`}};function Z(e){const t=e.payload,n=t.bodySnippet?.trim()||me(t.body??"");return t.subject?`${t.subject} — ${n}`:n}function p(e){return m[e]}function ct(e){return p(e)?.icon??"circle"}function ut(e){return p(e)?.channelKind}function pt(e){const t=p(e)?.shape;return t==="message"||t==="note"}function dt(e){return p(e)?.replyable===!0}function ft(e){return p(e)?.carriesText===!0}function mt(e){return p(e)?.countsAs}function gt(e){return p(e)?.playbookAuthored===!0}function ge(e){const t=p(e.type)?.snippet;return t?t(e):""}function ht(e,t){const n=p(e.type)?.timeline;return n?n(e,t):e.type.replace(/_/g," ").toLowerCase()}function At(e){const t=p(e.type)?.joinUrl;return t?t(e):void 0}function N(e,t){let n=e;for(const a of t.split(".")){if(n==null||typeof n!="object")return"";n=n[a]}return n==null?"":typeof n=="string"?n:typeof n=="number"||typeof n=="boolean"?String(n):""}function O(e,t,n){if(e===void 0)return null;if(typeof e=="string")return e||null;if("value"in e)return N(t,e.value)||null;const a={};for(const[r,o]of Object.entries(e.params??{}))a[r]=N(t,o);const i=n(e.key,a);return i===e.key?null:i}function he(e,t){if(!e||typeof e=="string"||"value"in e)return null;const n={};for(const[a,i]of Object.entries(e.params??{}))n[a]=N(t,i);return{key:e.key,params:n}}const Et=e=>e;function ee(e){const t=m[e];return{type:e,shape:t.shape,channelKind:t.channelKind,icon:t.icon,replyable:t.replyable===!0,countsAs:t.countsAs,carriesText:t.carriesText===!0,triggerable:t.triggerable===!0,component:t.component,builtIn:!0,displayNameKey:t.displayNameKey}}function te(e){return{type:e.type,shape:e.shape,channelKind:e.channelKind,icon:e.icon||"circle",replyable:e.replyable===!0,countsAs:e.countsAs,carriesText:e.carriesText===!0,triggerable:e.triggerable===!0,component:e.component,builtIn:!1,displayNameKey:e.displayNameKey}}class Ae{constructor(t=[],n=Et){this.translate=n;for(const a of t)a?.type&&(a.type in m||this.declared.has(a.type)||this.declared.set(a.type,a))}declared=new Map;get(t){if(t in m)return ee(t);const n=this.declared.get(t);return n?te(n):void 0}triggerable(){const t=Object.keys(m).filter(a=>m[a].triggerable).map(ee),n=[...this.declared.values()].map(te).filter(a=>a.triggerable);return[...t,...n]}timelineText(t,n){const a=m[t.type];if(a?.timeline)return a.timeline(t,n);const i=this.declared.get(t.type);return O(i?.text,t,this.translate)??t.type.replace(/_/g," ").toLowerCase()}snippet(t){const n=m[t.type];if(n?.snippet)return n.snippet(t);const a=this.declared.get(t.type);return O(a?.text,t,this.translate)??""}descriptor(t){return this.declared.get(t)}blocks(t){const n=this.declared.get(t)?.render;return n?.length?n:void 0}get translator(){return this.translate}}const yt=new Ae,ne=140;function _t(e){const t=e.trim();return t.length<=ne?t:t.slice(0,ne-1).trimEnd()+"…"}function Tt(e,t){const n=he(t?.text,e),a=t?O(t.text,e,i=>i):null;return{activityId:e.id,type:e.type,snippet:_t(a??ge(e)),authorName:e.author?.name??"",direction:e.direction,createdAt:e.createdAt??Date.now(),...n?{snippetKey:n.key,snippetParams:n.params}:{}}}function bt(e,t,n=[]){const a=e.createdAt;if(!a)return[];const i=new Set(n);return e.author.type==="user"&&e.author.id&&i.add(e.author.id),Object.entries(t).filter(([r,o])=>o>=a&&!i.has(r)).map(([r])=>r)}function It(e){return e.createdAt??0}const St=[{id:"agent",label:"Agent",labelSource:"user"},{id:"team",label:"Team",labelSource:"team"},{id:"inbox",label:"Inbox",labelSource:"inbox"},{id:"channel",label:"Kanaal",labelSource:"channel"},{id:"provider",label:"Provider",labelSource:"raw"},{id:"status",label:"Status",labelSource:"raw"},{id:"handledBy",label:"Afhandelaar",labelSource:"raw"},{id:"time",label:"Tijd",labelSource:"raw"}];function Mt(e){const t=[];for(const n of Object.keys(e))for(const a of Object.keys(e[n]))t.push({lang:n,key:a,value:e[n][a]});return t}function k(e){return e<10?`0${e}`:`${e}`}function Ee(e,t){const n=new Date(e),a=`${n.getUTCFullYear()}-${k(n.getUTCMonth()+1)}-${k(n.getUTCDate())}`;return t==="day"?a:`${a}T${k(n.getUTCHours())}`}function ye(e,t){const n=new Date(e);return n.setUTCMinutes(0,0,0),t==="day"&&n.setUTCHours(0),n.getTime()}const Ct=36e5,Nt=864e5;function Ot(e,t,n){const a=n==="hour"?Ct:Nt,i=[];for(let r=ye(e,n);r<=t;r+=a)i.push(Ee(r,n));return i}const _e=[{id:"resource",label:"Resource",labelSource:"raw"},{id:"origin",label:"Herkomst",labelSource:"raw"}],Te=_e.map(e=>e.id);function be(e,t){return`${e}.usage.${t}`}function Lt(e,t){return t.map(n=>({id:be(e,n.unit),label:n.label,category:"Verbruik",valueType:n.valueType??"count",aggregation:"sum",supportedDimensions:["provider",...Te,...n.extraDimensions??[],"time"]}))}const Ie=new Set(["info","success","warning","destructive"]),P=200,$=100,U=200,w=12,K=4,G=4e3,S=500,Rt=256*1024,xt=new Set(["heading","paragraph","list","quote","code","divider","table","kpi","callout"]),Se=["http:","https:","mailto:","tel:"],vt=/^[a-z][a-z0-9+.-]*:/i;function Me(e){const t=e.trim().replace(/^<|>$/g,"");if(!t)return!1;const n=vt.exec(t)?.[0];return n?Se.includes(n.toLowerCase()):!t.startsWith("//")}const kt=/^[ \t]{0,3}\[([^\]]+)\]:[ \t]*(\S+).*$/gm;function Dt(e){let t="",n=0;for(;n<e.length;){const a=e[n]==="!"&&e[n+1]==="[";if(e[n]!=="["&&!a){t+=e[n],n+=1;continue}const i=n+(a?2:1),r=ie(e,i,"[","]");if(r<0||e[r+1]!=="("){t+=e[n],n+=1;continue}const o=ie(e,r+2,"(",")");if(o<0){t+=e[n],n+=1;continue}const s=e.slice(i,r),l=e.slice(r+2,o).trim().split(/\s+/)[0]??"";t+=a||!Me(l)?s:e.slice(n,o+1),n=o+1}return t}function ie(e,t,n,a){let i=1;for(let r=t;r<e.length;r+=1){if(e[r]==="\\"){r+=1;continue}if(e[r]===n)i+=1;else if(e[r]===a&&(i-=1,i===0))return r}return-1}function Ce(e){return Dt(e).replace(kt,(t,n,a)=>Me(a)?t:"")}function u(e,t=G){return typeof e=="string"?Ce(e).slice(0,t):""}function Pt(e,t=G){return typeof e=="string"?e.slice(0,t):""}function $t(e,t="info"){return typeof e=="string"&&Ie.has(e)?e:t}function Ut(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const a of e){if(n.length>=P){t("more than "+P+" blocks; the rest was dropped");break}if(!a||typeof a!="object")continue;const i=a;if(!xt.has(i.type)){t("unknown block type "+String(i.type));continue}const r=typeof i.block_id=="string"?{block_id:i.block_id}:{};switch(i.type){case"heading":{const o=u(i.text);if(!o){t("a heading without text");continue}const s=i.level===2||i.level===3?i.level:1;n.push({...r,type:"heading",level:s,text:o});break}case"paragraph":{const o=u(i.text);if(!o){t("a paragraph without text");continue}n.push({...r,type:"paragraph",text:o});break}case"quote":{const o=u(i.text);if(!o){t("a quote without text");continue}n.push({...r,type:"quote",text:o});break}case"code":{const o=Pt(i.text);if(!o){t("a code block without text");continue}const s=typeof i.lang=="string"?{lang:i.lang.slice(0,32)}:{};n.push({...r,type:"code",...s,text:o});break}case"divider":n.push({...r,type:"divider"});break;case"list":{const o=Array.isArray(i.items)?i.items:[],s=[];for(const d of o){if(s.length>=$){t("more than "+$+" list items");break}const f=u(d?.text);if(!f)continue;const c=u(d?.lead,200);s.push(c?{lead:c,text:f}:{text:f})}if(s.length===0){t("a list without usable items");continue}const l=i.style==="numbered"?"numbered":"bulleted";n.push({...r,type:"list",style:l,items:s});break}case"table":{const o=Array.isArray(i.columns)?i.columns:[],s=[];for(const c of o){if(s.length>=w){t("more than "+w+" table columns");break}const E=u(c?.label,S),R=c?.align==="right"?"right":void 0;s.push(R?{label:E,align:R}:{label:E})}if(s.length===0){t("a table without columns");continue}const l=Array.isArray(i.rows)?i.rows:[],d=[];for(const c of l){if(d.length>=U){t("more than "+U+" table rows");break}const E=Array.isArray(c)?c:[];d.push(s.map((R,ot)=>u(E[ot],S)))}const f=u(i.caption,S);n.push({...r,type:"table",columns:s,rows:d,...f?{caption:f}:{}});break}case"kpi":{const o=Array.isArray(i.items)?i.items:[],s=[];for(const l of o){if(s.length>=K){t("more than "+K+" kpi items");break}const d=u(l?.value,40),f=u(l?.label,80);if(!d||!f)continue;const c=l?.tone;s.push(typeof c=="string"&&Ie.has(c)?{value:d,label:f,tone:c}:{value:d,label:f})}if(s.length===0){t("a kpi block without usable items");continue}n.push({...r,type:"kpi",items:s});break}case"callout":{const o=u(i.text);if(!o){t("a callout without text");continue}const s=u(i.title,200);n.push({...r,type:"callout",tone:$t(i.tone),...s?{title:s}:{},text:o});break}}}return n}function wt(e){return JSON.stringify(e).length}function Kt(e){return{blocks:e.length,types:e.map(t=>t.type),headings:e.flatMap(t=>t.type==="heading"?[t.text]:[])}}function ae(e){return e.replace(/\|/g,"\\|").replace(/\r?\n/g," ").trim()}function re(e,t,n){const a=e.map((i,r)=>n?.[r]==="right"?"---:":"---");return[`| ${e.map(ae).join(" | ")} |`,`| ${a.join(" | ")} |`,...t.map(i=>`| ${i.map(ae).join(" | ")} |`)]}function Bt(e){switch(e.type){case"heading":return[`${"#".repeat(e.level)} ${e.text}`];case"paragraph":return[e.text];case"quote":return e.text.split(/\r?\n/).map(t=>`> ${t}`);case"code":return[`\`\`\`${e.lang??""}`,e.text,"```"];case"divider":return["---"];case"list":return e.items.map((t,n)=>{const a=e.style==="numbered"?`${n+1}.`:"-";return t.lead?`${a} **${t.lead}** ${t.text}`:`${a} ${t.text}`});case"table":{const t=re(e.columns.map(n=>n.label),e.rows,e.columns.map(n=>n.align??"left"));return e.caption?[...t,"",`*${e.caption}*`]:t}case"kpi":return re(e.items.map(t=>t.value),[e.items.map(t=>t.label)]);case"callout":return(e.title?`**${e.title}** ${e.text}`:e.text).split(/\r?\n/).map(n=>`> ${n}`)}}function Ft(e,t){const n=[],a=e.some(i=>i.type==="heading"&&i.level===1);t&&!a&&n.push(`# ${t}`);for(const i of e){const r=Bt(i);r.length>0&&n.push(r.join(`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=10,T=10,b=10,S=5,dt=new Set(["header","section","context","divider","image","list","actions","attachments"]);function x(e){if(typeof e=="string")return e.length>0;if(!e||typeof e!="object")return!1;const t=e;return typeof t.key=="string"||typeof t.value=="string"}function ft(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const i of e){if(n.length>=P){t("more than "+P+" blocks; the rest was dropped");break}if(!i||typeof i!="object")continue;const a=i;if(!dt.has(a.type)){t("unknown block type "+String(a.type));continue}switch(a.type){case"header":if(!x(a.text)){t("a header without text");continue}break;case"context":if(!x(a.text)){t("a context block without text");continue}break;case"image":if(!a.url||!a.alt){t("an image without url or alt");continue}break;case"section":Array.isArray(a.fields)&&a.fields.length>T&&(t("more than "+T+" fields in a section"),a.fields=a.fields.slice(0,T));break;case"list":if(!Array.isArray(a.items)||a.items.length===0){t("a list without items");continue}a.items.length>b&&(t("more than "+b+" list items"),a.items=a.items.slice(0,b));break;case"actions":{const r=Array.isArray(a.elements)?a.elements:[],o=r.filter(s=>s&&s.action_id&&s.invoke&&x(s.text));if(o.length!==r.length&&t("an action without action_id, invoke or text"),o.length===0)continue;o.length>S&&t("more than "+S+" actions"),a.elements=o.slice(0,S);break}}n.push(a)}return n}function he(e){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()}function y(e){if(!e||e<0)return"";const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`}function Z(e){return e?` — ${Math.floor(e/60)}m ${e%60}s`:""}function v(e){return e?.split("@")?.[0]||e||""}function _(e){return e.map(t=>t.name).join(", ")}function ee(e){return e==="meeting"?"Meeting":e==="video"?"Video call":"Audio call"}const m={VOICE_CALL_STARTED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek gestart",timeline:e=>e.direction==="inbound"?`Inbound call started — ${v(e.payload.from)}`:`Outbound call started — ${v(e.payload.to)}`},VOICE_CALL_ANSWERED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek aangenomen",timeline:(e,t)=>`Call answered — ${t}`},VOICE_CALL_HOLD:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"In de wacht",timeline:(e,t)=>`Call on hold — ${t}`},VOICE_CALL_UNHOLD:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Hervat"},VOICE_CALL_ENDED:{shape:"event",channelKind:"voice",icon:"phone",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${y(e.payload.duration)})`:""}`,timeline:e=>`Call ended${Z(e.payload.duration)}`},VOICE_CALL_MISSED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gemiste oproep",timeline:e=>`Missed call — ${v(e.payload.from)}`},VOICE_CALL_FAILED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek mislukt",timeline:()=>"Call failed"},VOICE_CALL_VOICEMAIL:{shape:"artifact",channelKind:"voice",icon:"phone",snippet:e=>e.payload.transcription?.trim()?e.payload.transcription:"Voicemail ontvangen"},VIDEO_CALL_STARTED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gesprek gestart",timeline:()=>"Video call started"},VIDEO_CALL_ANSWERED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gesprek aangenomen",timeline:()=>"Video call answered"},VIDEO_CALL_HOLD:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"In de wacht"},VIDEO_CALL_UNHOLD:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Hervat"},VIDEO_CALL_ENDED:{shape:"event",channelKind:"video",icon:"video",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${y(e.payload.duration)})`:""}`,timeline:()=>"Video call ended"},VIDEO_CALL_MISSED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gemiste oproep",timeline:()=>"Missed video call"},VIDEO_CALL_FAILED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gesprek mislukt",timeline:()=>"Video call failed"},EMAIL_RECEIVED:{shape:"message",triggerable:!0,displayNameKey:"communication:activity.EMAIL_RECEIVED",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"inbound_message",snippet:te},EMAIL_SENT:{shape:"message",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:te},CHAT_MESSAGE_SENT:{shape:"message",component:"communication:ChatMessage",channelKind:"chat",icon:"message-circle",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:e=>e.payload.text??""},CHAT_MESSAGE_RECEIVED:{shape:"message",triggerable:!0,displayNameKey:"communication:activity.CHAT_MESSAGE_RECEIVED",component:"communication:ChatMessage",channelKind:"chat",icon:"message-circle",replyable:!0,carriesText:!0,countsAs:"inbound_message",snippet:e=>e.payload.text??""},CHAT_MEMBER_JOINED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`${_(e.payload.members)} toegevoegd`,timeline:e=>{const t=_(e.payload.members)||"Someone",n=e.payload.initiator?.name?` · added by ${e.payload.initiator.name}`:"";return`${t} joined the chat${n}`}},CHAT_MEMBER_LEFT:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`${_(e.payload.members)} verlaten`,timeline:e=>{const t=_(e.payload.members)||"Someone",n=e.payload.initiator?.name?` · removed by ${e.payload.initiator.name}`:"";return`${t} left the chat${n}`}},CHAT_RENAMED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`Hernoemd naar "${e.payload.newName}"`,timeline:e=>`Chat renamed to "${e.payload.newName}"${e.payload.initiator?` by ${e.payload.initiator.name}`:""}`},CHAT_CALL_STARTED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:()=>"Gesprek gestart",timeline:e=>`${ee(e.payload.callType)} started${e.payload.initiator?` by ${e.payload.initiator.name}`:""}`,joinUrl:e=>e.payload.joinUrl},CHAT_CALL_ENDED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${y(e.payload.duration)})`:""}`,timeline:e=>`${ee(e.payload.callType)} ended${Z(e.payload.duration)}`,joinUrl:e=>e.payload.joinUrl},CHAT_EVENT:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>e.payload.text??e.payload.eventType,timeline:e=>e.payload.text||e.payload.eventType},TRANSCRIPT_ADDED:{shape:"artifact",triggerable:!0,displayNameKey:"communication:activity.TRANSCRIPT_ADDED",component:"communication:TranscriptionActivity",icon:"captions",carriesText:!0,snippet:e=>(e.payload.segments??[]).map(t=>t.text).join(" ")},COMMENT_ADDED:{shape:"note",component:"communication:CommentActivity",icon:"sticky-note",carriesText:!0,snippet:e=>e.payload.text??""},FILE_UPLOADED:{shape:"artifact",component:"communication:FileActivity",icon:"paperclip",snippet:e=>`Bestand: ${e.payload.fileName}`},AI_MESSAGE_ADDED:{shape:"event",triggerable:!0,displayNameKey:"communication:activity.AI_MESSAGE_ADDED",icon:"circle",snippet:e=>e.payload.output?.text??e.payload.input?.text??"",timeline:()=>"AI message added"},AI_ACTION_PROPOSED:{shape:"event",component:"communication:ProposedActionCard",icon:"circle",playbookAuthored:!0,snippet:e=>`Voorstel wacht op goedkeuring (${e.payload.actions?.length??0} actie(s))`},PLAYBOOK_STARTED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:e=>`Playbook gestart${e.payload.playbookName?`: ${e.payload.playbookName}`:""}`,timeline:e=>`Playbook gestart${e.payload.playbookName?` — ${e.payload.playbookName}`:""}`},PLAYBOOK_COMPLETED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:()=>"Playbook afgerond",timeline:()=>"Playbook afgerond"},PLAYBOOK_ESCALATED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:()=>"Playbook geëscaleerd naar een mens",timeline:()=>"Playbook geëscaleerd naar een mens"},MEETING_SCHEDULED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering gepland: ${e.payload.title}`,timeline:()=>"Meeting scheduled",joinUrl:e=>e.payload.joinUrl},MEETING_STARTED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering gestart: ${e.payload.title}`,timeline:()=>"Meeting started",joinUrl:e=>e.payload.joinUrl},MEETING_ENDED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering beëindigd${e.payload.duration?` (${y(e.payload.duration)})`:""}`,timeline:()=>"Meeting ended"},MEETING_PARTICIPANT_JOINED:{shape:"event",icon:"calendar",snippet:e=>`${e.payload.name} deelgenomen`,timeline:(e,t)=>`${t} joined the meeting`},MEETING_PARTICIPANT_LEFT:{shape:"event",icon:"calendar",snippet:e=>`${e.payload.name} verlaten`,timeline:(e,t)=>`${t} left the meeting`},INTERACTION_CREATED:{shape:"event",icon:"circle",snippet:()=>"Interactie aangemaakt",timeline:(e,t)=>`Interaction started by ${t}`},INTERACTION_STATUS_CHANGED:{shape:"event",triggerable:!0,displayNameKey:"communication:activity.INTERACTION_STATUS_CHANGED",icon:"circle-dot",snippet:e=>`Status: ${e.payload.fromStatus} → ${e.payload.toStatus}`,timeline:(e,t)=>`Status changed to ${e.payload.toStatus} by ${t}`},INTERACTION_ASSIGNED:{shape:"event",icon:"user",snippet:()=>"Interactie toegewezen",timeline:(e,t)=>`Assigned by ${t}`}};function te(e){const t=e.payload,n=t.bodySnippet?.trim()||he(t.body??"");return t.subject?`${t.subject} — ${n}`:n}function p(e){return m[e]}function mt(e){return p(e)?.icon??"circle"}function gt(e){return p(e)?.channelKind}function ht(e){const t=p(e)?.shape;return t==="message"||t==="note"}function Et(e){return p(e)?.replyable===!0}function At(e){return p(e)?.carriesText===!0}function yt(e){return p(e)?.countsAs}function _t(e){return p(e)?.playbookAuthored===!0}function Ee(e){const t=p(e.type)?.snippet;return t?t(e):""}function Tt(e,t){const n=p(e.type)?.timeline;return n?n(e,t):e.type.replace(/_/g," ").toLowerCase()}function bt(e){const t=p(e.type)?.joinUrl;return t?t(e):void 0}function N(e,t){let n=e;for(const i of t.split(".")){if(n==null||typeof n!="object")return"";n=n[i]}return n==null?"":typeof n=="string"?n:typeof n=="number"||typeof n=="boolean"?String(n):""}function L(e,t,n){if(e===void 0)return null;if(typeof e=="string")return e||null;if("value"in e)return N(t,e.value)||null;const i={};for(const[r,o]of Object.entries(e.params??{}))i[r]=N(t,o);const a=n(e.key,i);return a===e.key?null:a}function Ae(e,t){if(!e||typeof e=="string"||"value"in e)return null;const n={};for(const[i,a]of Object.entries(e.params??{}))n[i]=N(t,a);return{key:e.key,params:n}}const St=e=>e;function ne(e){const t=m[e];return{type:e,shape:t.shape,channelKind:t.channelKind,icon:t.icon,replyable:t.replyable===!0,countsAs:t.countsAs,carriesText:t.carriesText===!0,triggerable:t.triggerable===!0,component:t.component,builtIn:!0,displayNameKey:t.displayNameKey}}function ie(e){return{type:e.type,shape:e.shape,channelKind:e.channelKind,icon:e.icon||"circle",replyable:e.replyable===!0,countsAs:e.countsAs,carriesText:e.carriesText===!0,triggerable:e.triggerable===!0,component:e.component,builtIn:!1,displayNameKey:e.displayNameKey}}class ye{constructor(t=[],n=St){this.translate=n;for(const i of t)i?.type&&(i.type in m||this.declared.has(i.type)||this.declared.set(i.type,i))}declared=new Map;get(t){if(t in m)return ne(t);const n=this.declared.get(t);return n?ie(n):void 0}triggerable(){const t=Object.keys(m).filter(i=>m[i].triggerable).map(ne),n=[...this.declared.values()].map(ie).filter(i=>i.triggerable);return[...t,...n]}timelineText(t,n){const i=m[t.type];if(i?.timeline)return i.timeline(t,n);const a=this.declared.get(t.type);return L(a?.text,t,this.translate)??t.type.replace(/_/g," ").toLowerCase()}snippet(t){const n=m[t.type];if(n?.snippet)return n.snippet(t);const i=this.declared.get(t.type);return L(i?.text,t,this.translate)??""}descriptor(t){return this.declared.get(t)}blocks(t){const n=this.declared.get(t)?.render;return n?.length?n:void 0}get translator(){return this.translate}}const It=new ye,ae=140;function Mt(e){const t=e.trim();return t.length<=ae?t:t.slice(0,ae-1).trimEnd()+"…"}function Ct(e,t){const n=Ae(t?.text,e),i=t?L(t.text,e,a=>a):null;return{activityId:e.id,type:e.type,snippet:Mt(i??Ee(e)),authorName:e.author?.name??"",direction:e.direction,createdAt:e.createdAt??Date.now(),...n?{snippetKey:n.key,snippetParams:n.params}:{}}}function Nt(e,t,n=[]){const i=e.createdAt;if(!i)return[];const a=new Set(n);return e.author.type==="user"&&e.author.id&&a.add(e.author.id),Object.entries(t).filter(([r,o])=>o>=i&&!a.has(r)).map(([r])=>r)}function Lt(e){return e.createdAt??0}const Ot=[{id:"agent",label:"Agent",labelSource:"user"},{id:"team",label:"Team",labelSource:"team"},{id:"inbox",label:"Inbox",labelSource:"inbox"},{id:"channel",label:"Kanaal",labelSource:"channel"},{id:"provider",label:"Provider",labelSource:"raw"},{id:"status",label:"Status",labelSource:"raw"},{id:"handledBy",label:"Afhandelaar",labelSource:"raw"},{id:"time",label:"Tijd",labelSource:"raw"}];function Rt(e){const t=[];for(const n of Object.keys(e))for(const i of Object.keys(e[n]))t.push({lang:n,key:i,value:e[n][i]});return t}function k(e){return e<10?`0${e}`:`${e}`}function _e(e,t){const n=new Date(e),i=`${n.getUTCFullYear()}-${k(n.getUTCMonth()+1)}-${k(n.getUTCDate())}`;return t==="day"?i:`${i}T${k(n.getUTCHours())}`}function Te(e,t){const n=new Date(e);return n.setUTCMinutes(0,0,0),t==="day"&&n.setUTCHours(0),n.getTime()}const xt=36e5,vt=864e5;function kt(e,t,n){const i=n==="hour"?xt:vt,a=[];for(let r=Te(e,n);r<=t;r+=i)a.push(_e(r,n));return a}const be=[{id:"resource",label:"Resource",labelSource:"raw"},{id:"origin",label:"Herkomst",labelSource:"raw"}],Se=be.map(e=>e.id);function Ie(e,t){return`${e}.usage.${t}`}function Pt(e,t){return t.map(n=>({id:Ie(e,n.unit),label:n.label,category:"Verbruik",valueType:n.valueType??"count",aggregation:"sum",supportedDimensions:["provider",...Se,...n.extraDimensions??[],"time"]}))}const Me=new Set(["info","success","warning","destructive"]),D=200,$=100,U=200,w=12,K=4,V=4e3,I=500,Dt=256*1024,$t=new Set(["heading","paragraph","list","quote","code","divider","table","kpi","callout"]),Ce=["http:","https:","mailto:","tel:"],Ut=/^[a-z][a-z0-9+.-]*:/i;function Ne(e){const t=e.trim().replace(/^<|>$/g,"");if(!t)return!1;const n=Ut.exec(t)?.[0];return n?Ce.includes(n.toLowerCase()):!t.startsWith("//")}const wt=/^[ \t]{0,3}\[([^\]]+)\]:[ \t]*(\S+).*$/gm;function Kt(e){let t="",n=0;for(;n<e.length;){const i=e[n]==="!"&&e[n+1]==="[";if(e[n]!=="["&&!i){t+=e[n],n+=1;continue}const a=n+(i?2:1),r=re(e,a,"[","]");if(r<0||e[r+1]!=="("){t+=e[n],n+=1;continue}const o=re(e,r+2,"(",")");if(o<0){t+=e[n],n+=1;continue}const s=e.slice(a,r),l=e.slice(r+2,o).trim().split(/\s+/)[0]??"";t+=i||!Ne(l)?s:e.slice(n,o+1),n=o+1}return t}function re(e,t,n,i){let a=1;for(let r=t;r<e.length;r+=1){if(e[r]==="\\"){r+=1;continue}if(e[r]===n)a+=1;else if(e[r]===i&&(a-=1,a===0))return r}return-1}function Le(e){return Kt(e).replace(wt,(t,n,i)=>Ne(i)?t:"")}function u(e,t=V){return typeof e=="string"?Le(e).slice(0,t):""}function Bt(e,t=V){return typeof e=="string"?e.slice(0,t):""}function Ft(e,t="info"){return typeof e=="string"&&Me.has(e)?e:t}function Gt(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const i of e){if(n.length>=D){t("more than "+D+" blocks; the rest was dropped");break}if(!i||typeof i!="object")continue;const a=i;if(!$t.has(a.type)){t("unknown block type "+String(a.type));continue}const r=typeof a.block_id=="string"?{block_id:a.block_id}:{};switch(a.type){case"heading":{const o=u(a.text);if(!o){t("a heading without text");continue}const s=a.level===2||a.level===3?a.level:1;n.push({...r,type:"heading",level:s,text:o});break}case"paragraph":{const o=u(a.text);if(!o){t("a paragraph without text");continue}n.push({...r,type:"paragraph",text:o});break}case"quote":{const o=u(a.text);if(!o){t("a quote without text");continue}n.push({...r,type:"quote",text:o});break}case"code":{const o=Bt(a.text);if(!o){t("a code block without text");continue}const s=typeof a.lang=="string"?{lang:a.lang.slice(0,32)}:{};n.push({...r,type:"code",...s,text:o});break}case"divider":n.push({...r,type:"divider"});break;case"list":{const o=Array.isArray(a.items)?a.items:[],s=[];for(const d of o){if(s.length>=$){t("more than "+$+" list items");break}const f=u(d?.text);if(!f)continue;const c=u(d?.lead,200);s.push(c?{lead:c,text:f}:{text:f})}if(s.length===0){t("a list without usable items");continue}const l=a.style==="numbered"?"numbered":"bulleted";n.push({...r,type:"list",style:l,items:s});break}case"table":{const o=Array.isArray(a.columns)?a.columns:[],s=[];for(const c of o){if(s.length>=w){t("more than "+w+" table columns");break}const A=u(c?.label,I),R=c?.align==="right"?"right":void 0;s.push(R?{label:A,align:R}:{label:A})}if(s.length===0){t("a table without columns");continue}const l=Array.isArray(a.rows)?a.rows:[],d=[];for(const c of l){if(d.length>=U){t("more than "+U+" table rows");break}const A=Array.isArray(c)?c:[];d.push(s.map((R,pt)=>u(A[pt],I)))}const f=u(a.caption,I);n.push({...r,type:"table",columns:s,rows:d,...f?{caption:f}:{}});break}case"kpi":{const o=Array.isArray(a.items)?a.items:[],s=[];for(const l of o){if(s.length>=K){t("more than "+K+" kpi items");break}const d=u(l?.value,40),f=u(l?.label,80);if(!d||!f)continue;const c=l?.tone;s.push(typeof c=="string"&&Me.has(c)?{value:d,label:f,tone:c}:{value:d,label:f})}if(s.length===0){t("a kpi block without usable items");continue}n.push({...r,type:"kpi",items:s});break}case"callout":{const o=u(a.text);if(!o){t("a callout without text");continue}const s=u(a.title,200);n.push({...r,type:"callout",tone:Ft(a.tone),...s?{title:s}:{},text:o});break}}}return n}function Vt(e){return JSON.stringify(e).length}function Ht(e){return{blocks:e.length,types:e.map(t=>t.type),headings:e.flatMap(t=>t.type==="heading"?[t.text]:[])}}function oe(e){return e.replace(/\|/g,"\\|").replace(/\r?\n/g," ").trim()}function se(e,t,n){const i=e.map((a,r)=>n?.[r]==="right"?"---:":"---");return[`| ${e.map(oe).join(" | ")} |`,`| ${i.join(" | ")} |`,...t.map(a=>`| ${a.map(oe).join(" | ")} |`)]}function Xt(e){switch(e.type){case"heading":return[`${"#".repeat(e.level)} ${e.text}`];case"paragraph":return[e.text];case"quote":return e.text.split(/\r?\n/).map(t=>`> ${t}`);case"code":return[`\`\`\`${e.lang??""}`,e.text,"```"];case"divider":return["---"];case"list":return e.items.map((t,n)=>{const i=e.style==="numbered"?`${n+1}.`:"-";return t.lead?`${i} **${t.lead}** ${t.text}`:`${i} ${t.text}`});case"table":{const t=se(e.columns.map(n=>n.label),e.rows,e.columns.map(n=>n.align??"left"));return e.caption?[...t,"",`*${e.caption}*`]:t}case"kpi":return se(e.items.map(t=>t.value),[e.items.map(t=>t.label)]);case"callout":return(e.title?`**${e.title}** ${e.text}`:e.text).split(/\r?\n/).map(n=>`> ${n}`)}}function jt(e,t){const n=[],i=e.some(a=>a.type==="heading"&&a.level===1);t&&!i&&n.push(`# ${t}`);for(const a of e){const r=Xt(a);r.length>0&&n.push(r.join(`
|
|
2
2
|
`))}return`${n.join(`
|
|
3
3
|
|
|
4
4
|
`)}
|
|
5
|
-
`}const H=e=>`user:${e}`,
|
|
5
|
+
`}const H=e=>`user:${e}`,X=e=>`team:${e}`;function Wt(e){const t=new Set;for(const n of e??[])n?.id&&(n.kind==="user"&&t.add(H(n.id)),n.kind==="team"&&t.add(X(n.id)));return[...t].sort()}function Yt(e,t){return[H(e),...t.map(X)]}function zt(e){const t=new Set;for(const n of e??[])n?.kind&&t.add(n.kind);return[...t]}function qt(e){return(e.startsWith("tool:")?e.slice(5):e).replace(/__/g," · ").replace(/\./g," · ").replace(/_/g," ")}const Jt=[{name:"text",type:"string"},{name:"subject",type:"string"},{name:"from",type:"string"},{name:"type",type:"string"},{name:"direction",type:"string"},{name:"channelId",type:"string"},{name:"interactionId",type:"string"},{name:"activityId",type:"string"},{name:"authorType",type:"string"},{name:"authorName",type:"string"},{name:"textRaw",type:"string"},{name:"fromStatus",type:"string"},{name:"toStatus",type:"string"},{name:"contactId",type:"string"},{name:"companyId",type:"string"}],Qt={topics:[{name:"topic",type:"string"},{name:"confidence",type:"number"}],question:[{name:"answer",type:"boolean"},{name:"confidence",type:"number"}],extract:[]};function Oe(e){switch(e.kind){case"user":return`user:${e.userId}`;case"team":return`team:${e.teamId}`;case"org":return"org"}}function Zt(e){if(typeof e!="string")return;const t=e.trim();if(t==="org")return{kind:"org"};const n=t.indexOf(":");if(n<=0)return;const i=t.slice(0,n),a=t.slice(n+1).trim();if(a){if(i==="user")return{kind:"user",userId:a};if(i==="team")return{kind:"team",teamId:a}}}function Re(e){return Oe(e)}function en(e){switch(e.kind){case"personal":return{kind:"user",userId:e.userId};case"team":return{kind:"team",teamId:e.teamId};case"org":return{kind:"org"}}}function tn(e){return Re(e)}const xe=["done","escalated","failed","timed_out","stopped"],ve=["awaiting_approval","awaiting_reply"];function ke(e){return xe.includes(e)}function nn(e){return ke(e)}function an(e){return ve.includes(e)}function rn(e,t){const n=e.labels??[];return n.find(i=>i.locale===t)?.label??n[0]?.label??e.url}function on(e,t,n){const i=e.translations??[];return i.find(a=>a.locale===t)??(n?i.find(a=>a.locale===n):void 0)??{locale:t}}const B=[{code:"nl",label:"Nederlands",english:"Dutch"},{code:"en",label:"English",english:"English"},{code:"de",label:"Deutsch",english:"German"},{code:"fr",label:"Français",english:"French"},{code:"es",label:"Español",english:"Spanish"},{code:"it",label:"Italiano",english:"Italian"},{code:"pt",label:"Português",english:"Portuguese"},{code:"pl",label:"Polski",english:"Polish"},{code:"sv",label:"Svenska",english:"Swedish"},{code:"da",label:"Dansk",english:"Danish"},{code:"nb",label:"Norsk bokmål",english:"Norwegian Bokmål"},{code:"fi",label:"Suomi",english:"Finnish"},{code:"tr",label:"Türkçe",english:"Turkish"}];function Pe(e){const t=(e??"").toLowerCase();return B.find(n=>n.code===t)??B.find(n=>n.code===t.split("-")[0])}function sn(e){return Pe(e)?.label??e}function ln(e){const t=Pe(e);return t?t.english===t.label?`${t.english} (${t.code})`:`${t.english} — ${t.label} (${t.code})`:e}const j=3;function De(e,t){const n=new Set;let i=1,a=t.get(e)?.parentId;for(;a;){if(n.has(a)||(n.add(a),i++,i>j+1))return 1/0;a=t.get(a)?.parentId}return i}function cn(e,t,n){if(!e)return!0;if(e===t)return!1;const i=new Map(n.map(o=>[o.id,o]));if(!i.has(e)||t&&$e(e,t,i))return!1;const a=De(e,i),r=t?W(t,n):1;return a+r<=j}function $e(e,t,n){const i=new Set;let a=n.get(e)?.parentId;for(;a;){if(a===t)return!0;if(i.has(a))return!1;i.add(a),a=n.get(a)?.parentId}return!1}function W(e,t,n=new Set){if(n.has(e))return 1;n.add(e);const i=t.filter(a=>a.parentId===e);return i.length?1+Math.max(...i.map(a=>W(a.id,t,n))):1}const Ue="en";function we(e){return e.defaultLocale||e.locale||Ue}function un(e){const t=new Set,n=[];for(const i of[we(e),...e.locales??[]])!i||t.has(i)||(t.add(i),n.push(i));return n}function pn(e,t,n){const i=e.translations??[];return i.find(a=>a.locale===t)?.name??(n?i.find(a=>a.locale===n)?.name:void 0)??e.name}const Ke=20,Be=20,M=300;function g(e){return e.toLowerCase().replace(/[^\p{L}\p{N}\s]/gu," ").replace(/\s+/g," ").trim()}function Fe(e){const t=e.replace(/\s+/g," ").trim();if(t.length<=M)return t;const n=t.slice(0,M),i=Math.max(n.lastIndexOf(". "),n.lastIndexOf("! "),n.lastIndexOf("? "));return i>M*.6?n.slice(0,i+1):`${n.trimEnd()}…`}function dn(e,t){const n=Fe(t.text),i=g(n);if(!i||(e.examples??[]).some(o=>g(o)===i))return null;const a=e.exampleCandidates??[],r=a.findIndex(o=>g(o.text)===i);if(r>=0){if(a[r].corrected||!t.corrected)return null;const o=[...a];return o[r]={...o[r],corrected:!0,addedAt:t.addedAt},le(o)}return le([{...t,text:n},...a]).slice(0,Be)}function le(e){return[...e].sort((t,n)=>Number(n.corrected)-Number(t.corrected)||n.addedAt-t.addedAt)}function fn(e,t){const n=g(t),i=(e.examples??[]).filter(r=>r.trim());return{examples:i.some(r=>g(r)===n)?i:[...i,t].slice(-Ke),exampleCandidates:Ge(e,t)}}function Ge(e,t){const n=g(t);return(e.exampleCandidates??[]).filter(i=>g(i.text)!==n)}function Ve(e,t){const n=e.ownerScope;return n?n.kind==="org"?!0:n.kind==="team"?!!t&&n.teamId===t:!1:!1}function mn(e,t){return e.filter(n=>Ve(n,t))}const Y=[{id:"openai",attachmentKinds:["image","pdf"],label:"OpenAI",capabilities:["chat","transcription","embedding"],defaultModel:"gpt-5-mini",baseUrl:"https://api.openai.com/v1"},{id:"gemini",attachmentKinds:["image","pdf"],label:"Google Gemini",capabilities:["chat","transcription","embedding"],defaultModel:"gemini-3.5-flash",baseUrl:"https://generativelanguage.googleapis.com/v1beta"},{id:"anthropic",attachmentKinds:["image","pdf"],label:"Anthropic",capabilities:["chat"],defaultModel:"claude-haiku-4-5",baseUrl:"https://api.anthropic.com/v1"},{id:"elevenlabs",label:"ElevenLabs",capabilities:["transcription"],baseUrl:"https://api.elevenlabs.io/v1"},{id:"moonshot",label:"Moonshot (Kimi)",capabilities:["chat"],defaultModel:"kimi-k3",baseUrl:"https://api.moonshot.ai/v1"},{id:"deepseek",label:"DeepSeek",capabilities:["chat"],defaultModel:"deepseek-v4-flash",baseUrl:"https://api.deepseek.com/v1"},{id:"groq",label:"Groq",capabilities:["chat"],defaultModel:"openai/gpt-oss-120b",baseUrl:"https://api.groq.com/openai/v1"},{id:"mistral",label:"Mistral",capabilities:["chat"],defaultModel:"mistral-large-latest",baseUrl:"https://api.mistral.ai/v1"},{id:"openrouter",label:"OpenRouter",capabilities:["chat"],defaultModel:"openrouter/auto",baseUrl:"https://openrouter.ai/api/v1"},{id:"ollama",label:"Ollama (self-hosted)",capabilities:["chat"],defaultModel:"llama3.3"},{id:"openai-compatible",label:"OpenAI-compatible (eigen endpoint)",capabilities:["chat"],defaultModel:"default"}];function E(e){return Y.find(t=>t.id===e)}function gn(e){return E(e)?.label??e}function hn(e,t="gpt-5-mini"){return E(e)?.defaultModel??t}function En(e){return Y.filter(t=>t.capabilities.includes(e))}function An(e){const t=E(e);return!!t&&!t.baseUrl}function yn(e,t){return t==="text"?!0:E(e)?.attachmentKinds?.includes(t)===!0}function _n(e,t){if(!e.enabled)return"ok";const n=F(e.hardLimitNanos),i=F(e.softLimitNanos);return n!==void 0&&t>=n?"hard":i!==void 0&&t>=i?"soft":"ok"}function F(e){return typeof e=="number"?e:void 0}function He(e,t="month"){const n=new Date(e);return Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),1)}function Tn(e,t="month"){const n=new Date(He(e,t));return`${n.getUTCFullYear()}-${String(n.getUTCMonth()+1).padStart(2,"0")}`}const bn=new Set(["mail","message"]);function Xe(e,t){const n=e.settings?.signatures?.[t];return!n||!n.enabled||!n.body||n.body.trim()===""?null:n}function Sn(e,t,n,i="html"){if(!e)return n;const a=Xe(e,t);return a?`${n}${i==="text"?`
|
|
6
6
|
|
|
7
|
-
`:t==="mail"?"<br><br>-- <br>":"<br><br>"}${
|
|
7
|
+
`:t==="mail"?"<br><br>-- <br>":"<br><br>"}${a.body}`:n}function In(e){return e.endpoints??[]}const Mn=e=>!!e.assignedUserId||!!e.assignedInboxId,Cn=e=>e.status==="closed",Nn=e=>({urgent:10,high:5,normal:2,low:1})[e.priority]||0,Ln=(e,t=30)=>e.title?.length<=t?e.title:`${e.title.substring(0,t)}...`;function On(e,t){return e.lastActivityAt?!(e.seenBy??[]).includes(t):!1}const Rn=1e3,xn=2e3,vn=500,kn=12e3,Pn=4e3,je=["contact","company"];function Dn(e){if(!e)return!1;const t=e.slice(0,e.indexOf(":"));return je.includes(t)}const O={NL:{callingCode:"31",trunkPrefix:"0",nsnMin:7,nsnMax:9},BE:{callingCode:"32",trunkPrefix:"0",nsnMin:8,nsnMax:9},LU:{callingCode:"352",nsnMin:6,nsnMax:9},DE:{callingCode:"49",trunkPrefix:"0",nsnMin:6,nsnMax:13},FR:{callingCode:"33",trunkPrefix:"0",nsnMin:9,nsnMax:9},GB:{callingCode:"44",trunkPrefix:"0",nsnMin:9,nsnMax:10},IE:{callingCode:"353",trunkPrefix:"0",nsnMin:7,nsnMax:9},ES:{callingCode:"34",nsnMin:9,nsnMax:9},PT:{callingCode:"351",nsnMin:9,nsnMax:9},IT:{callingCode:"39",nsnMin:6,nsnMax:11},AT:{callingCode:"43",trunkPrefix:"0",nsnMin:7,nsnMax:13},CH:{callingCode:"41",trunkPrefix:"0",nsnMin:9,nsnMax:9},DK:{callingCode:"45",nsnMin:8,nsnMax:8},SE:{callingCode:"46",trunkPrefix:"0",nsnMin:7,nsnMax:13},NO:{callingCode:"47",nsnMin:8,nsnMax:8},FI:{callingCode:"358",trunkPrefix:"0",nsnMin:5,nsnMax:12},PL:{callingCode:"48",nsnMin:9,nsnMax:9},US:{callingCode:"1",nsnMin:10,nsnMax:10},CA:{callingCode:"1",nsnMin:10,nsnMax:10}},We="NL",$n=15,Un=8,wn=Array.from(new Set(Object.values(O).map(e=>e.callingCode))).sort((e,t)=>t.length-e.length);function ce(e){if(e)return O[e.trim().toUpperCase()]}function C(e,t){return e.length>=t.nsnMin&&e.length<=t.nsnMax}function ue(e){if(e.length>$n)return null;for(const t of wn){if(!e.startsWith(t))continue;const n=e.slice(t.length);for(const i of Object.values(O)){if(i.callingCode!==t)continue;const a=i.trunkPrefix,r=a&&n.startsWith(a)?n.slice(a.length):n;if(C(r,i))return`+${t}${r}`}return null}return e.length<Un?null:`+${e}`}function Kn(e){let t=e.trim();const n=t.match(/^(sips?|tel|whatsapp):/i);n&&(t=t.slice(n[0].length));const i=t.indexOf("@");return i>=0&&(t=t.slice(0,i)),t.trim()}function Bn(e){if(!e)return!1;const t=e.indexOf("@");if(t<=0)return!1;const n=e.slice(0,t).trim();return!/^[+\d\s().-]+$/.test(n)}function G(e,t){if(!e)return null;const n=Kn(e);if(!n)return null;const i=n.startsWith("+"),a=n.replace(/\D/g,"");if(!a)return null;if(i)return ue(a);if(a.startsWith("00"))return ue(a.slice(2));const r=ce(t)??ce(We);if(!r)return null;const o=r.trunkPrefix;if(o&&a.startsWith(o)){const s=a.slice(o.length);return C(s,r)?`+${r.callingCode}${s}`:null}if(a.startsWith(r.callingCode)){const s=a.slice(r.callingCode.length);if(C(s,r))return`+${r.callingCode}${s}`}return!o&&C(a,r)?`+${r.callingCode}${a}`:null}function Fn(e,t=9){const n=(e??"").replace(/\D/g,"");return n.length<t?null:n.slice(-t)}function z(e){if(!e)return null;const t=e.trim().toLowerCase(),n=t.lastIndexOf("@");if(n<=0||n===t.length-1)return null;const i=t.slice(0,n).split("+")[0],a=t.slice(n+1);return!i||!a.includes(".")?null:`${i}@${a}`}function Gn(e){const t=z(e);return t?t.slice(t.lastIndexOf("@")+1):null}const Vn=new Set(["co.uk","org.uk","gov.uk","ac.uk","com.au","co.nz","com.br","co.za"]);function Ye(e){if(!e)return null;const t=e.trim().toLowerCase().replace(/\.$/,"").split(".").filter(Boolean);if(t.length<2)return null;const n=t.slice(-2).join(".");return Vn.has(n)&&t.length>=3?t.slice(-3).join("."):n}const ze=new Set(["gmail.com","googlemail.com","outlook.com","hotmail.com","hotmail.nl","hotmail.be","hotmail.co.uk","live.com","live.nl","live.be","msn.com","yahoo.com","yahoo.co.uk","ymail.com","icloud.com","me.com","mac.com","aol.com","gmx.net","gmx.de","web.de","protonmail.com","proton.me","pm.me","tutanota.com","zoho.com","mail.com","ziggo.nl","kpnmail.nl","planet.nl","home.nl","casema.nl","chello.nl","xs4all.nl","telfort.nl","hetnet.nl","zonnet.nl","upcmail.nl","quicknet.nl","telenet.be","skynet.be","proximus.be","scarlet.be"]);function Hn(e){const t=Ye(e);return t?ze.has(t):!1}function Xn(e){if(!e)return!1;const t=e.trim().toLowerCase();return t==="tel"||t==="sms"||t==="whatsapp"||t==="fax"}function jn(e,t,n){if(!e||!t)return null;const i=e.trim().toLowerCase();if(i==="tel"||i==="sms"||i==="whatsapp"){const r=G(t,n);return r?`tel:${r}`:null}if(i==="fax"){const r=G(t,n);return r?`fax:${r}`:null}if(i==="mailto"||i==="email"){const r=z(t);return r?`mailto:${r}`:null}const a=t.trim().toLowerCase();return a?`${i}:${a}`:null}const Wn=/(\*\*|__)(?=\S)([\s\S]*?\S)\1/g,Yn=/(\*|_)(?=\S)([^*_\n]*?\S)\1/g;function zn(e){if(typeof e!="string"||!e)return"";let t=e;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(`
|
|
8
8
|
`).map(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,}$/,"")).join(`
|
|
9
|
-
`),t=t.replace(
|
|
10
|
-
`);for(let n=0;n<t.length;n++)if(
|
|
11
|
-
`).trim();return e}function
|
|
9
|
+
`),t=t.replace(Wn,"$2"),t=t.replace(Yn,"$2"),t=t.replace(/~~(?=\S)([\s\S]*?\S)~~/g,"$1"),t=t.replace(/`([^`\n]+)`/g,"$1"),t.replace(/\s+/g," ").trim()}const qn=[/<blockquote/i,/class="?gmail_quote/i,/id="?[^"]*divRplyFwdMsg/i,/id="?[^"]*mail-editor-reference-message-container/i,/-{3,}\s*Original Message\s*-{3,}/i,/\n_{5,}\s*\n/,/\bOn\b[\s\S]{0,200}?\bwrote:/i],pe=/^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i,Jn=/^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;function Qn(e){const t=e.split(`
|
|
10
|
+
`);for(let n=0;n<t.length;n++)if(Jn.test(t[n])||pe.test(t[n])&&t.slice(n+1,n+4).some(i=>pe.test(i)))return t.slice(0,n).join(`
|
|
11
|
+
`).trim();return e}function de(e){let t=e;return t=t.replace(/<(script|style)[\s\S]*?<\/\1>/gi,""),t=t.replace(/<br\s*\/?>/gi,`
|
|
12
12
|
`),t=t.replace(/<\/(p|h[1-6]|ul|ol|table|blockquote)>/gi,`
|
|
13
13
|
|
|
14
14
|
`),t=t.replace(/<\/(div|li|tr)>/gi,`
|
|
15
|
-
`),t=t.replace(/<\/(td|th)>/gi," "),t=t.replace(/<[^>]+>/g,""),t=t.replace(/<[^>]*$/,""),t}function
|
|
15
|
+
`),t=t.replace(/<\/(td|th)>/gi," "),t=t.replace(/<[^>]+>/g,""),t=t.replace(/<[^>]*$/,""),t}function fe(e){return!Number.isInteger(e)||e<0||e>1114111?null:String.fromCodePoint(e)}function me(e){return e.replace(/ /gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/&#(\d+);/g,(t,n)=>fe(Number(n))??t).replace(/&#x([0-9a-f]+);/gi,(t,n)=>fe(parseInt(n,16))??t).replace(/&/gi,"&")}function ge(e){return e.replace(/\r/g,"").replace(/[ \t]+/g," ").replace(/ *\n */g,`
|
|
16
16
|
`).replace(/\n{3,}/g,`
|
|
17
17
|
|
|
18
|
-
`).trim()}function jn(e){if(typeof e!="string"||!e)return"";let t=e.length;for(const r of Hn){const o=e.search(r);o>=0&&o<t&&(t=o)}const n=e.slice(0,t);let a=fe(de(ue(n)));return a||(a=fe(de(ue(e)))),Xn(a)||a}const Wn=/(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i,Yn=/\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;function zn(e,t){return!!(e&&Wn.test(e)||t&&Yn.test(t))}const We=3,Ye=600;function qn(e,t){return e>=We||t>=Ye}const Jn=new Set(["image/png","image/jpeg","image/jpg","image/gif","image/webp"]),Qn=new Set(["text/plain","text/markdown","text/csv","application/json","text/html","application/xml","text/xml"]);function ze(e){const t=(e??"").trim().toLowerCase().split(";")[0];return t?Jn.has(t)?"image":t==="application/pdf"?"pdf":Qn.has(t)?"text":t.startsWith("audio/")?"audio":"unsupported":"unsupported"}const h=1024*1024,qe={image:5*h,pdf:20*h,text:1*h,audio:20*h},Zn=25*h,ei=5;function ti(e,t){const n=ze(e);return n==="unsupported"?"unsupported":t>qe[n]?"too-large":null}function Je(e,t){const n=new Set(e.disabledIntents??[]),a=e.intentOverrides??{},i=t.intents.filter(o=>!n.has(o.intent)).map(o=>ii(o,a[o.intent]));if(!e.extraIntents||e.extraIntents.length===0)return i;const r=new Set(i.map(o=>o.intent));for(const o of e.extraIntents)r.has(o.intent)||(i.push(o),r.add(o.intent));return i}function Qe(e,t){const n={};for(const a of e.intents){if(!a.togglable)continue;const i=t?.[a.intent];n[a.intent]=i??a.defaultEnabled??!0}return n}function ni(e,t){const n=Qe(e,t);return Object.entries(n).filter(([,a])=>!a).map(([a])=>a)}function ii(e,t){return t?{intent:t.intent??e.intent,targetSchemes:t.targetSchemes??e.targetSchemes,transport:t.transport??e.transport}:e}function ai(e,t){const n=[];for(const a of e){if(!a.enabled)continue;const i=t[a.providerId];if(i)for(const r of Je(a,i))n.push({channel:a,description:i,capability:r})}return n}function ri(e,t){return t.filter(n=>n.capability.intent===e)}function Ze(e,t){return t.filter(n=>n.capability.targetSchemes.includes(e))}function oi(e,t){return Ze(e.scheme,t)}function si(e,t,n){const a=[];for(const i of e)for(const r of n)r.capability.intent===t&&r.capability.targetSchemes.includes(i.scheme)&&a.push({channelIntent:r,endpoint:i});return a}var et=(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))(et||{});const li={mailto:"mail",sip:"tel",tel:"tel",fax:"tel",sms:"chat",teams:"chat",telegram:"chat",messenger:"chat",instagram:"chat",viber:"chat",whatsapp:"wa",webhook:"note",url:"note",calendar:"note",username:"note",id:"note",custom:"note"};function ci(e){return e?li[e]??"note":"note"}const ui="message_window",pi="message_templates",di={FROM:"from",TO:"to",CC:"cc",BCC:"bcc",ORGANIZER:"organizer",PRESENTER:"presenter",ATTENDEE:"attendee",OWNER:"owner",MEMBER:"member",GUEST:"guest",HOST:"host",PARTICIPANT:"participant"},fi=(e,t)=>({intent:e,...t}),mi="folder_management",gi="remote_search",hi={ok:!1,code:"UNSUPPORTED",message:"Provider does not support this op"},z="auth";function q(e){const t=typeof e=="string"?e.match(/apps\/([^/?#]+)/):null;return t?t[1]:null}function Ai(e){const t=q(e);return t?t!==z:typeof e=="string"&&e.startsWith("/wake")}function Ei(e){return typeof e!="string"||e===""||e==="/"?!0:q(e)===z}function yi(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tt(e){const n=e.split("/").filter(Boolean).map(a=>a.startsWith(":")?a.endsWith("?")?"(?:/[^/]+)?":"/[^/]+":"/"+yi(a)).join("");return new RegExp(`^${n}\\/?$`)}function nt(e,t){const n=e.split("/").filter(Boolean),a=t.split("/").filter(Boolean),i={};return n.forEach((r,o)=>{if(r.startsWith(":")){const s=r.endsWith("?")?r.slice(1,-1):r.slice(1),l=a[o];l&&(i[s]=l)}}),i}function it(e){return e.publicBasePath??`/apps/${e.name}`}function _i(e){const t=[];for(const n of e){if(!n?.name)continue;const a=it(n);for(const i of n.routes??[]){if(!i.public)continue;const r=i.path==="/"?"":i.path;t.push({appName:n.name,resource:i.resource,pattern:`${a}${r}`,props:i.props})}}return t}function at(e,t){const n=e.split("/").filter(Boolean),a=t.split("/").filter(Boolean);for(let i=0;i<Math.min(n.length,a.length);i++){const r=n[i].startsWith(":"),o=a[i].startsWith(":");if(r!==o)return o}return n.length>a.length}function rt(e,t){if(typeof e!="string")return null;let n=null;for(const a of t)tt(a.pattern).test(e)&&(!n||at(a.pattern,n.pattern))&&(n=a);return n?{...n,params:{...n.props,...nt(n.pattern,e)}}:null}function Ti(e,t){return rt(e,t)!==null}const bi=9e4,Ii="installation-id";exports.ACTIVITY_CATALOG=m;exports.AI_ATTACHMENT_LIMITS=qe;exports.AI_ATTACHMENT_MAX_PER_TURN=ei;exports.AI_ATTACHMENT_TURN_BUDGET=Zn;exports.AI_VENDORS=W;exports.ALLOWED_LINK_SCHEMES=Se;exports.ARTIFACT_MAX_BLOCKS=P;exports.ARTIFACT_MAX_BODY_BYTES=Rt;exports.ARTIFACT_MAX_CELL_LEN=S;exports.ARTIFACT_MAX_KPI_ITEMS=K;exports.ARTIFACT_MAX_LIST_ITEMS=$;exports.ARTIFACT_MAX_TABLE_COLUMNS=w;exports.ARTIFACT_MAX_TABLE_ROWS=U;exports.ARTIFACT_MAX_TEXT_LEN=G;exports.AUTH_APP_NAME=z;exports.ActivityTypeRegistry=Ae;exports.BUILT_IN_ONLY=yt;exports.CLASSIFY_VARS=Wt;exports.CORE_DIMENSIONS=St;exports.CommunicationScheme=et;exports.DEFAULT_MEMORY_BUDGET=Nn;exports.DEFAULT_PHONE_REGION=Ve;exports.FEATURE_FOLDER_MANAGEMENT=mi;exports.FEATURE_REMOTE_SEARCH=gi;exports.INSTALLATION_HEADER=Ii;exports.InteractionParticipantRole=di;exports.KB_FALLBACK_LOCALE=Pe;exports.KB_LOCALES=B;exports.MAX_ACTIONS=I;exports.MAX_BLOCKS=D;exports.MAX_COLLECTION_DEPTH=X;exports.MAX_FIELDS=T;exports.MAX_LIST_ITEMS=b;exports.MAX_MEMORY_BROWSE=In;exports.MAX_MEMORY_BUDGET=Cn;exports.MAX_MEMORY_CHARS=Sn;exports.MAX_TOPIC_CANDIDATES=we;exports.MAX_TOPIC_EXAMPLES=Ue;exports.MAX_TOPIC_EXAMPLE_CHARS=M;exports.MIN_MEMORY_BUDGET=Mn;exports.PAUSED_RUN_STATUSES=Re;exports.PHONE_REGIONS=L;exports.PRESENCE_ONLINE_WINDOW_MS=bi;exports.PROVIDER_FEATURE_MESSAGE_TEMPLATES=pi;exports.PROVIDER_FEATURE_MESSAGE_WINDOW=ui;exports.PUBLIC_EMAIL_DOMAINS=je;exports.RELATED_SUBJECT_KINDS=He;exports.SIGNATURE_INTENTS=gn;exports.SUMMARY_MIN_LAST_CHARS=Ye;exports.SUMMARY_MIN_MESSAGES=We;exports.TERMINAL_RUN_STATUSES=Le;exports.TRIGGER_VARS=jt;exports.UNSUPPORTED=hi;exports.USAGE_DIMENSIONS=_e;exports.USAGE_DIMENSION_IDS=Te;exports.acceptExampleCandidate=ln;exports.actingIdentityKey=Oe;exports.activityIconOf=ct;exports.activityJoinUrl=At;exports.activitySnippet=ge;exports.activityTextParams=he;exports.activityTimelineText=ht;exports.activityTimestamp=It;exports.activityTypeInfo=p;exports.actorKey=qt;exports.addExampleCandidate=sn;exports.aiAttachmentKind=ze;exports.aiAttachmentRejection=ti;exports.aiVendorAcceptsAttachment=mn;exports.aiVendorDefaultModel=pn;exports.aiVendorLabel=un;exports.aiVendorNeedsBaseUrl=fn;exports.aiVendorsWith=dn;exports.appNameFromPath=q;exports.applySignature=hn;exports.artifactBodyBytes=wt;exports.artifactOutline=Kt;exports.artifactToMarkdown=Ft;exports.buildActivityPreview=Tt;exports.buildChannelIntents=ai;exports.buildShareKeys=Gt;exports.canNestUnder=an;exports.carriesText=ft;exports.categoryLabel=on;exports.channelKindForScheme=ci;exports.channelKindOf=ut;exports.cleanMessageText=jn;exports.defaultLocaleOf=$e;exports.defineIntent=fi;exports.depthOf=ke;exports.disabledIntentsFromCapabilities=ni;exports.emailDomain=Pn;exports.endpointKey=Kn;exports.extractParams=nt;exports.filterByEndpoint=oi;exports.filterByIntent=ri;exports.filterByTargetScheme=Ze;exports.findAiVendor=A;exports.flattenLocales=Mt;exports.floorToPeriod=ye;exports.formatActingIdentity=Ne;exports.formatPeriod=Ee;exports.getActivitySeenUserIds=bt;exports.getContactEndpoints=An;exports.getShortTitle=Tn;exports.getUrgencyScore=_n;exports.heightOf=j;exports.helpCenterText=en;exports.humanizeAction=Xt;exports.isAssigned=En;exports.isClosed=yn;exports.isDeepLink=Ai;exports.isDescendant=De;exports.isInteractionUnseen=bn;exports.isLandingPath=Ei;exports.isLikelyBulk=zn;exports.isMessageType=pt;exports.isMoreSpecificPattern=at;exports.isPaused=Qt;exports.isPlaybookAuthoredType=gt;exports.isPublicEmailDomain=Un;exports.isPublicPath=Ti;exports.isReplyableType=dt;exports.isRetryable=Jt;exports.isTerminal=xe;exports.isThreadLongEnough=qn;exports.linkLabel=Zt;exports.localeInstruction=nn;exports.localeName=tn;exports.localesOf=rn;exports.looksLikeEmail=kn;exports.matchContactToIntents=si;exports.matchPublicRoute=rt;exports.messageCountsAs=mt;exports.needsPhoneRegion=wn;exports.normalizeArtifactBlocks=Ut;exports.normalizeBlocks=lt;exports.normalizeEmail=Y;exports.normalizeExample=g;exports.parseActingIdentity=Yt;exports.pathToRegex=tt;exports.periodsInRange=Ot;exports.phoneSuffix=Dn;exports.plainTextFromMarkdown=Gn;exports.playbookActor=zt;exports.publicBasePathFor=it;exports.publicRoutePatterns=_i;exports.readPath=N;exports.registrableDomain=Xe;exports.rejectExampleCandidate=Be;exports.relatedByDefault=On;exports.resolveAccountCapabilities=Qe;exports.resolveActivityText=O;exports.resolveChannelIntents=Je;exports.resolveSignature=Ge;exports.sanitizeInline=Ce;exports.shareKeyForTeam=V;exports.shareKeyForUser=H;exports.shareKeysForViewer=Ht;exports.stripHtml=me;exports.toE164=F;exports.toolSourceKinds=Vt;exports.topicOfferedForTeam=Fe;exports.topicsForTeam=cn;exports.truncateExample=Ke;exports.usageMetricId=be;exports.usageMetrics=Lt;
|
|
18
|
+
`).trim()}function Zn(e){if(typeof e!="string"||!e)return"";let t=e.length;for(const r of qn){const o=e.search(r);o>=0&&o<t&&(t=o)}const n=e.slice(0,t);let i=ge(me(de(n)));return i||(i=ge(me(de(e)))),Qn(i)||i}const ei=/(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i,ti=/\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;function ni(e,t){return!!(e&&ei.test(e)||t&&ti.test(t))}const qe=3,Je=600;function ii(e,t){return e>=qe||t>=Je}const ai=new Set(["image/png","image/jpeg","image/jpg","image/gif","image/webp"]),ri=new Set(["text/plain","text/markdown","text/csv","application/json","text/html","application/xml","text/xml"]);function Qe(e){const t=(e??"").trim().toLowerCase().split(";")[0];return t?ai.has(t)?"image":t==="application/pdf"?"pdf":ri.has(t)?"text":t.startsWith("audio/")?"audio":"unsupported":"unsupported"}const h=1024*1024,Ze={image:5*h,pdf:20*h,text:1*h,audio:20*h},oi=25*h,si=5;function li(e,t){const n=Qe(e);return n==="unsupported"?"unsupported":t>Ze[n]?"too-large":null}function et(e,t){const n=new Set(e.disabledIntents??[]),i=e.intentOverrides??{},a=t.intents.filter(o=>!n.has(o.intent)).map(o=>ui(o,i[o.intent]));if(!e.extraIntents||e.extraIntents.length===0)return a;const r=new Set(a.map(o=>o.intent));for(const o of e.extraIntents)r.has(o.intent)||(a.push(o),r.add(o.intent));return a}function tt(e,t){const n={};for(const i of e.intents){if(!i.togglable)continue;const a=t?.[i.intent];n[i.intent]=a??i.defaultEnabled??!0}return n}function ci(e,t){const n=tt(e,t);return Object.entries(n).filter(([,i])=>!i).map(([i])=>i)}function ui(e,t){return t?{intent:t.intent??e.intent,targetSchemes:t.targetSchemes??e.targetSchemes,transport:t.transport??e.transport}:e}function pi(e,t){const n=[];for(const i of e){if(!i.enabled)continue;const a=t[i.providerId];if(a)for(const r of et(i,a))n.push({channel:i,description:a,capability:r})}return n}function di(e,t){return t.filter(n=>n.capability.intent===e)}function nt(e,t){return t.filter(n=>n.capability.targetSchemes.includes(e))}function fi(e,t){return nt(e.scheme,t)}function mi(e,t,n){const i=[];for(const a of e)for(const r of n)r.capability.intent===t&&r.capability.targetSchemes.includes(a.scheme)&&i.push({channelIntent:r,endpoint:a});return i}var it=(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))(it||{});const gi={mailto:"mail",sip:"tel",tel:"tel",fax:"tel",sms:"chat",teams:"chat",telegram:"chat",messenger:"chat",instagram:"chat",viber:"chat",whatsapp:"wa",webhook:"note",url:"note",calendar:"note",username:"note",id:"note",custom:"note"};function hi(e){return e?gi[e]??"note":"note"}const Ei="message_window",Ai="message_templates",yi={FROM:"from",TO:"to",CC:"cc",BCC:"bcc",ORGANIZER:"organizer",PRESENTER:"presenter",ATTENDEE:"attendee",OWNER:"owner",MEMBER:"member",GUEST:"guest",HOST:"host",PARTICIPANT:"participant"},_i=(e,t)=>({intent:e,...t}),Ti="folder_management",bi="remote_search",Si={ok:!1,code:"UNSUPPORTED",message:"Provider does not support this op"},q="auth";function J(e){const t=typeof e=="string"?e.match(/apps\/([^/?#]+)/):null;return t?t[1]:null}function Ii(e){const t=J(e);return t?t!==q:typeof e=="string"&&e.startsWith("/wake")}function Mi(e){return typeof e!="string"||e===""||e==="/"?!0:J(e)===q}function Ci(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function at(e){const n=e.split("/").filter(Boolean).map(i=>i.startsWith(":")?i.endsWith("?")?"(?:/[^/]+)?":"/[^/]+":"/"+Ci(i)).join("");return new RegExp(`^${n}\\/?$`)}function rt(e,t){const n=e.split("/").filter(Boolean),i=t.split("/").filter(Boolean),a={};return n.forEach((r,o)=>{if(r.startsWith(":")){const s=r.endsWith("?")?r.slice(1,-1):r.slice(1),l=i[o];l&&(a[s]=l)}}),a}function ot(e){return e.publicBasePath??`/apps/${e.name}`}function Ni(e){const t=[];for(const n of e){if(!n?.name)continue;const i=ot(n);for(const a of n.routes??[]){if(!a.public)continue;const r=a.path==="/"?"":a.path;t.push({appName:n.name,resource:a.resource,pattern:`${i}${r}`,props:a.props})}}return t}function st(e,t){const n=e.split("/").filter(Boolean),i=t.split("/").filter(Boolean);for(let a=0;a<Math.min(n.length,i.length);a++){const r=n[a].startsWith(":"),o=i[a].startsWith(":");if(r!==o)return o}return n.length>i.length}function lt(e,t){if(typeof e!="string")return null;let n=null;for(const i of t)at(i.pattern).test(e)&&(!n||st(i.pattern,n.pattern))&&(n=i);return n?{...n,params:{...n.props,...rt(n.pattern,e)}}:null}function Li(e,t){return lt(e,t)!==null}const Q=9e4,ct=["out_of_office"],ut=e=>ct.includes(e);function Oi(e,t,n){const i=n-e<Q,a=t?.status&&(!t.expiresAt||t.expiresAt>n)?t:void 0;if(!a?.status)return{online:i,status:i?"available":"offline"};const r=a.status;return!i&&!ut(r)?{online:!1,status:"offline"}:{online:i,status:r,message:a.message}}function Ri(e,t){const n=t-e.lastSeenAt<Q,i=n||ut(e.status)?e.status:"offline";return n===e.online&&i===e.status?e:{...e,online:n,status:i}}const xi="installation-id";exports.ACTIVITY_CATALOG=m;exports.AI_ATTACHMENT_LIMITS=Ze;exports.AI_ATTACHMENT_MAX_PER_TURN=si;exports.AI_ATTACHMENT_TURN_BUDGET=oi;exports.AI_VENDORS=Y;exports.ALLOWED_LINK_SCHEMES=Ce;exports.ARTIFACT_MAX_BLOCKS=D;exports.ARTIFACT_MAX_BODY_BYTES=Dt;exports.ARTIFACT_MAX_CELL_LEN=I;exports.ARTIFACT_MAX_KPI_ITEMS=K;exports.ARTIFACT_MAX_LIST_ITEMS=$;exports.ARTIFACT_MAX_TABLE_COLUMNS=w;exports.ARTIFACT_MAX_TABLE_ROWS=U;exports.ARTIFACT_MAX_TEXT_LEN=V;exports.AUTH_APP_NAME=q;exports.ActivityTypeRegistry=ye;exports.BUILT_IN_ONLY=It;exports.CLASSIFY_VARS=Qt;exports.CORE_DIMENSIONS=Ot;exports.CommunicationScheme=it;exports.DEFAULT_MEMORY_BUDGET=Pn;exports.DEFAULT_PHONE_REGION=We;exports.FEATURE_FOLDER_MANAGEMENT=Ti;exports.FEATURE_REMOTE_SEARCH=bi;exports.INSTALLATION_HEADER=xi;exports.InteractionParticipantRole=yi;exports.KB_FALLBACK_LOCALE=Ue;exports.KB_LOCALES=B;exports.MAX_ACTIONS=S;exports.MAX_BLOCKS=P;exports.MAX_COLLECTION_DEPTH=j;exports.MAX_FIELDS=T;exports.MAX_LIST_ITEMS=b;exports.MAX_MEMORY_BROWSE=Rn;exports.MAX_MEMORY_BUDGET=kn;exports.MAX_MEMORY_CHARS=xn;exports.MAX_TOPIC_CANDIDATES=Be;exports.MAX_TOPIC_EXAMPLES=Ke;exports.MAX_TOPIC_EXAMPLE_CHARS=M;exports.MIN_MEMORY_BUDGET=vn;exports.PAUSED_RUN_STATUSES=ve;exports.PHONE_REGIONS=O;exports.PRESENCE_ONLINE_WINDOW_MS=Q;exports.PRESENCE_SURVIVES_OFFLINE=ct;exports.PROVIDER_FEATURE_MESSAGE_TEMPLATES=Ai;exports.PROVIDER_FEATURE_MESSAGE_WINDOW=Ei;exports.PUBLIC_EMAIL_DOMAINS=ze;exports.RELATED_SUBJECT_KINDS=je;exports.SIGNATURE_INTENTS=bn;exports.SUMMARY_MIN_LAST_CHARS=Je;exports.SUMMARY_MIN_MESSAGES=qe;exports.TERMINAL_RUN_STATUSES=xe;exports.TRIGGER_VARS=Jt;exports.UNSUPPORTED=Si;exports.USAGE_DIMENSIONS=be;exports.USAGE_DIMENSION_IDS=Se;exports.acceptExampleCandidate=fn;exports.actingIdentityKey=Re;exports.activityIconOf=mt;exports.activityJoinUrl=bt;exports.activitySnippet=Ee;exports.activityTextParams=Ae;exports.activityTimelineText=Tt;exports.activityTimestamp=Lt;exports.activityTypeInfo=p;exports.actorKey=tn;exports.addExampleCandidate=dn;exports.agePresenceEntry=Ri;exports.aiAttachmentKind=Qe;exports.aiAttachmentRejection=li;exports.aiBudgetLimit=F;exports.aiBudgetPeriodKey=Tn;exports.aiBudgetPeriodStart=He;exports.aiBudgetState=_n;exports.aiVendorAcceptsAttachment=yn;exports.aiVendorDefaultModel=hn;exports.aiVendorLabel=gn;exports.aiVendorNeedsBaseUrl=An;exports.aiVendorsWith=En;exports.appNameFromPath=J;exports.applySignature=Sn;exports.artifactBodyBytes=Vt;exports.artifactOutline=Ht;exports.artifactToMarkdown=jt;exports.buildActivityPreview=Ct;exports.buildChannelIntents=pi;exports.buildShareKeys=Wt;exports.canNestUnder=cn;exports.carriesText=At;exports.categoryLabel=pn;exports.channelKindForScheme=hi;exports.channelKindOf=gt;exports.cleanMessageText=Zn;exports.defaultLocaleOf=we;exports.defineIntent=_i;exports.depthOf=De;exports.derivePresence=Oi;exports.disabledIntentsFromCapabilities=ci;exports.emailDomain=Gn;exports.endpointKey=jn;exports.extractParams=rt;exports.filterByEndpoint=fi;exports.filterByIntent=di;exports.filterByTargetScheme=nt;exports.findAiVendor=E;exports.flattenLocales=Rt;exports.floorToPeriod=Te;exports.formatActingIdentity=Oe;exports.formatPeriod=_e;exports.getActivitySeenUserIds=Nt;exports.getContactEndpoints=In;exports.getShortTitle=Ln;exports.getUrgencyScore=Nn;exports.heightOf=W;exports.helpCenterText=on;exports.humanizeAction=qt;exports.isAssigned=Mn;exports.isClosed=Cn;exports.isDeepLink=Ii;exports.isDescendant=$e;exports.isInteractionUnseen=On;exports.isLandingPath=Mi;exports.isLikelyBulk=ni;exports.isMessageType=ht;exports.isMoreSpecificPattern=st;exports.isPaused=an;exports.isPlaybookAuthoredType=_t;exports.isPublicEmailDomain=Hn;exports.isPublicPath=Li;exports.isReplyableType=Et;exports.isRetryable=nn;exports.isTerminal=ke;exports.isThreadLongEnough=ii;exports.linkLabel=rn;exports.localeInstruction=ln;exports.localeName=sn;exports.localesOf=un;exports.looksLikeEmail=Bn;exports.matchContactToIntents=mi;exports.matchPublicRoute=lt;exports.messageCountsAs=yt;exports.needsPhoneRegion=Xn;exports.normalizeArtifactBlocks=Gt;exports.normalizeBlocks=ft;exports.normalizeEmail=z;exports.normalizeExample=g;exports.parseActingIdentity=Zt;exports.pathToRegex=at;exports.periodsInRange=kt;exports.phoneSuffix=Fn;exports.plainTextFromMarkdown=zn;exports.playbookActor=en;exports.publicBasePathFor=ot;exports.publicRoutePatterns=Ni;exports.readPath=N;exports.registrableDomain=Ye;exports.rejectExampleCandidate=Ge;exports.relatedByDefault=Dn;exports.resolveAccountCapabilities=tt;exports.resolveActivityText=L;exports.resolveChannelIntents=et;exports.resolveSignature=Xe;exports.sanitizeInline=Le;exports.shareKeyForTeam=X;exports.shareKeyForUser=H;exports.shareKeysForViewer=Yt;exports.stripHtml=he;exports.toE164=G;exports.toolSourceKinds=zt;exports.topicOfferedForTeam=Ve;exports.topicsForTeam=mn;exports.truncateExample=Fe;exports.usageMetricId=Ie;exports.usageMetrics=Pt;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './entities/playbook';
|
|
|
6
6
|
export * from './entities/kb';
|
|
7
7
|
export * from './entities/topic';
|
|
8
8
|
export * from './entities/ai-account';
|
|
9
|
+
export * from './entities/ai-budget';
|
|
9
10
|
export * from './entities/ai-context';
|
|
10
11
|
export * from './entities/ai-conversation';
|
|
11
12
|
export * from './entities/ai-message';
|