@opencxh/domain 1.236.0 → 1.239.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-message/types.d.ts +21 -6
- package/dist/entities/document-template/tokens.d.ts +14 -2
- package/dist/entities/kb/locales.d.ts +6 -32
- package/dist/index.cjs +6 -6
- package/dist/index.d.ts +1 -0
- package/dist/index.js +91 -84
- package/dist/platform/locales.d.ts +38 -0
- package/package.json +1 -1
- /package/dist/{entities/kb → platform}/locales.test.d.ts +0 -0
|
@@ -23,6 +23,21 @@ export interface AIMessageOutput {
|
|
|
23
23
|
text: string;
|
|
24
24
|
type: "text";
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* What the user asked this turn to be, beside *who* answers it (the profile).
|
|
28
|
+
*
|
|
29
|
+
* - `"ask"` — read, do not change anything. Toolset narrows to read tools.
|
|
30
|
+
* - `"draft"` — prepare, do not send. Reads plus internal writes (`create_draft`).
|
|
31
|
+
* - `"agent"` — do the work, sending included. The profile's full toolset.
|
|
32
|
+
*
|
|
33
|
+
* **Narrowing only, and resolved server-side.** A mode can never widen what the profile allows,
|
|
34
|
+
* and the client never sends a tool list: `agent/runner.ts` has no approval gate, so the toolset
|
|
35
|
+
* is the whole guarantee. Same rule as `Procedure.tools ⊆ brain.enabledTools`.
|
|
36
|
+
*
|
|
37
|
+
* Unlike the profile — locked once a thread has turns — the mode is free per turn: asking a
|
|
38
|
+
* question and then having the same thread draft a reply is the normal flow.
|
|
39
|
+
*/
|
|
40
|
+
export type AssistantMode = "ask" | "draft" | "agent";
|
|
26
41
|
export interface AIMessage {
|
|
27
42
|
id: string;
|
|
28
43
|
organizationId: string;
|
|
@@ -48,6 +63,8 @@ export interface AIMessage {
|
|
|
48
63
|
toolsDeclared?: number;
|
|
49
64
|
/** Tools available in this conversation when the turn started. Absent with `toolsDeclared`. */
|
|
50
65
|
toolsTotal?: number;
|
|
66
|
+
/** Which mode this turn ran as. Absent = `"agent"`: every row written before modes existed. */
|
|
67
|
+
mode?: AssistantMode;
|
|
51
68
|
}
|
|
52
69
|
export type AIMessageFeedback = "up" | "down";
|
|
53
70
|
/**
|
|
@@ -62,14 +79,12 @@ export interface AIMessageAskPayload {
|
|
|
62
79
|
previousExternalId?: string;
|
|
63
80
|
context?: Record<string, any>;
|
|
64
81
|
/**
|
|
65
|
-
*
|
|
82
|
+
* What this turn is for. Default `"agent"` — today's behaviour.
|
|
66
83
|
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* queue's instruction bar sends `false`, because a card that answers a customer while you were
|
|
70
|
-
* still reading it is the one thing that must not happen there.
|
|
84
|
+
* Replaces the older `outward` boolean: that expressed only the draft lane, and a second flag
|
|
85
|
+
* beside this one would allow combinations nobody can explain (`"agent"` + no outward).
|
|
71
86
|
*/
|
|
72
|
-
|
|
87
|
+
mode?: AssistantMode;
|
|
73
88
|
}
|
|
74
89
|
export interface AIMessageAskResponse {
|
|
75
90
|
output: AIMessageOutput;
|
|
@@ -18,10 +18,22 @@ export interface FillDocumentResult {
|
|
|
18
18
|
unresolved: string[];
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* Blocks the caller computes, keyed by the `block_id` of the template block they replace.
|
|
22
|
+
*
|
|
23
|
+
* The one thing a token cannot say: *"the lines go here"*. A quote's line table and its totals are
|
|
24
|
+
* derived from the document, not written by the template author — so the author places an empty
|
|
25
|
+
* `table` with `block_id: "lines"` and the caller hands over what belongs there.
|
|
26
|
+
*
|
|
27
|
+
* Deliberately a replacement and not a repetition primitive: a loop would need an expression
|
|
28
|
+
* language to say what it loops over, and the caller already holds the data.
|
|
29
|
+
*/
|
|
30
|
+
export type DocumentSlots = Record<string, readonly DocumentBlock[]>;
|
|
31
|
+
/**
|
|
32
|
+
* A whole template, filled in: conditions applied, slots substituted, tokens replaced everywhere
|
|
33
|
+
* text lives.
|
|
22
34
|
*
|
|
23
35
|
* Every text-bearing field is walked, not just `text` — a token in a table cell or a letterhead
|
|
24
36
|
* value is the ordinary case for an invoice, and missing one would leave `{factuur.nummer}`
|
|
25
37
|
* printed on a document that went out the door.
|
|
26
38
|
*/
|
|
27
|
-
export declare function fillDocument(blocks: readonly DocumentBlock[], context: TemplateContext, conditions?: Record<string, TemplateCondition
|
|
39
|
+
export declare function fillDocument(blocks: readonly DocumentBlock[], context: TemplateContext, conditions?: Record<string, TemplateCondition>, slots?: DocumentSlots): FillDocumentResult;
|
|
@@ -1,35 +1,9 @@
|
|
|
1
|
-
import { KbLocale } from './types';
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
2
|
+
* The language list under its knowledge-base names.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* The labels are endonyms — a language names itself the same way whoever reads
|
|
10
|
-
* the picker. So this is a fixed map on purpose, and not the "never freeze
|
|
11
|
-
* labels at module load" case the design system warns about.
|
|
12
|
-
*
|
|
13
|
-
* In domain rather than in the kb app because both ends need the same answer:
|
|
14
|
-
* the language picker in the editor, and the writing assistant's system prompt,
|
|
15
|
-
* which has to name the language it must write in. Two copies would drift, and
|
|
16
|
-
* the way you would find out is an article coming back in the wrong language.
|
|
17
|
-
*/
|
|
18
|
-
export interface KbLocaleOption {
|
|
19
|
-
code: KbLocale;
|
|
20
|
-
/** The language's own name, for a picker. */
|
|
21
|
-
label: string;
|
|
22
|
-
/** Its English name, for telling a model which language to write in. */
|
|
23
|
-
english: string;
|
|
24
|
-
}
|
|
25
|
-
export declare const KB_LOCALES: KbLocaleOption[];
|
|
26
|
-
/** The language's own name, or the bare code for one we do not list. */
|
|
27
|
-
export declare function localeName(code: string): string;
|
|
28
|
-
/**
|
|
29
|
-
* How to name this language to a model.
|
|
30
|
-
*
|
|
31
|
-
* A bare BCP-47 tag is a weak instruction — `"nl"` inside an otherwise English
|
|
32
|
-
* prompt is not enough to stop a model answering in English. Both names plus
|
|
33
|
-
* the tag leaves nothing to infer.
|
|
4
|
+
* It moved to `platform/locales.ts` when a second caller appeared: a contact and a company now
|
|
5
|
+
* carry the language to write to them in, and `apps/crm` importing something called `KB_LOCALES`
|
|
6
|
+
* reads like a mistake. These aliases exist so the nineteen files in `apps/kb` that use the old
|
|
7
|
+
* names keep working unchanged.
|
|
34
8
|
*/
|
|
35
|
-
export
|
|
9
|
+
export { LOCALES as KB_LOCALES, type LocaleOption as KbLocaleOption, localeInstruction, localeName, } from '../../platform/locales';
|
package/dist/index.cjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Le=10,Z=10,Q=10,ee=5,_o=new Set(["header","section","context","divider","image","list","actions","attachments"]);function Re(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 So(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const r of e){if(n.length>=Le){t(`more than ${Le} blocks; the rest was dropped`);break}if(!r||typeof r!="object")continue;const o=r;if(!_o.has(o.type)){t(`unknown block type ${String(o.type)}`);continue}switch(o.type){case"header":if(!Re(o.text)){t("a header without text");continue}break;case"context":if(!Re(o.text)){t("a context block without text");continue}break;case"image":if(!o.url||!o.alt){t("an image without url or alt");continue}break;case"section":Array.isArray(o.fields)&&o.fields.length>Z&&(t(`more than ${Z} fields in a section`),o.fields=o.fields.slice(0,Z));break;case"list":if(!Array.isArray(o.items)||o.items.length===0){t("a list without items");continue}o.items.length>Q&&(t(`more than ${Q} list items`),o.items=o.items.slice(0,Q));break;case"actions":{const i=Array.isArray(o.elements)?o.elements:[],s=i.filter(a=>a?.action_id&&a.invoke&&Re(a.text));if(s.length!==i.length&&t("an action without action_id, invoke or text"),s.length===0)continue;s.length>ee&&t(`more than ${ee} actions`),o.elements=s.slice(0,ee);break}}n.push(o)}return n}const Ao=/(\*\*|__)(?=\S)([\s\S]*?\S)\1/g,bo=/(\*|_)(?=\S)([^*_\n]*?\S)\1/g;function jt(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(`
|
|
2
2
|
`).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(`
|
|
3
|
-
`),t=t.replace(Ao,"$2"),t=t.replace(bo,"$2"),t=t.replace(/~~(?=\S)([\s\S]*?\S)~~/g,"$1"),t=t.replace(/`([^`\n]+)`/g,"$1"),t.replace(/\s+/g," ").trim()}function Yt(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 q(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 _t(e){return e?` — ${Math.floor(e/60)}m ${e%60}s`:""}function Re(e){return e?.split("@")?.[0]||e||""}function J(e){return e.map(t=>t.name).join(", ")}function St(e){return e==="meeting"?"Meeting":e==="video"?"Video call":"Audio call"}const D={VOICE_CALL_STARTED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek gestart",timeline:e=>e.direction==="inbound"?`Inbound call started — ${Re(e.payload.from)}`:`Outbound call started — ${Re(e.payload.to)}`},VOICE_CALL_ANSWERED:{shape:"event",channelKind:"voice",icon:"phone",connected:!0,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?` (${q(e.payload.duration)})`:""}`,timeline:e=>`Call ended${_t(e.payload.duration)}`},VOICE_CALL_MISSED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gemiste oproep",timeline:e=>`Missed call — ${Re(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",connected:!0,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?` (${q(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:At},EMAIL_SENT:{shape:"message",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:At},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=>`${J(e.payload.members)} toegevoegd`,timeline:e=>{const t=J(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=>`${J(e.payload.members)} verlaten`,timeline:e=>{const t=J(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=>`${St(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?` (${q(e.payload.duration)})`:""}`,timeline:e=>`${St(e.payload.callType)} ended${_t(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",connected:!0,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?` (${q(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}`},SLA_BREACHED:{shape:"event",triggerable:!0,displayNameKey:"communication:activity.SLA_BREACHED",icon:"alarm-clock",snippet:e=>`SLA verlopen: ${e.payload.metric}`,timeline:e=>`SLA target ${e.payload.metric} passed its deadline`},WORK_COMMENT_ADDED:{shape:"note",icon:"sticky-note",carriesText:!0,snippet:()=>"Reactie"},WORK_ITEM_ASSIGNED:{shape:"event",icon:"user",snippet:()=>"Taak toegewezen",timeline:(e,t)=>`Assigned by ${t}`},WORK_ITEM_STATUS_CHANGED:{shape:"event",triggerable:!0,icon:"circle-dot",snippet:()=>"Status gewijzigd",timeline:(e,t)=>`Status changed by ${t}`}};function At(e){const t=e.payload,n=jt(t.bodyText).trim()||t.bodySnippet?.trim()||Yt(t.body??"");return t.subject?`${t.subject} — ${n}`:n}function M(e){return D[e]}function To(e){return M(e)?.icon??"circle"}function Io(e){return M(e)?.channelKind}function Xe(e){return e==="message"||e==="note"}function Mo(e){return Xe(M(e)?.shape)}function ze(e){return e==="note"}function Oo(e){return ze(M(e)?.shape)}function wo(e){return M(e)?.replyable===!0}function Ro(e){return M(e)?.carriesText===!0}function Xt(e){return M(e)?.countsAs}function Co(e){return M(e)?.playbookAuthored===!0}function ko(e){return M(e)?.connected===!0}function No(e){const t=M(e);return t?.shape==="artifact"&&t?.carriesText===!0}function zt(e){const t=M(e.type)?.snippet;return t?t(e):""}function vo(e,t){const n=M(e.type)?.timeline;return n?n(e,t):e.type.replace(/_/g," ").toLowerCase()}function Do(e){const t=M(e.type)?.joinUrl;return t?t(e):void 0}function ie(e,t){let n=e;for(const r of t.split(".")){if(n==null||typeof n!="object")return"";n=n[r]}return n==null?"":typeof n=="string"?n:typeof n=="number"||typeof n=="boolean"?String(n):""}function se(e,t,n){if(e===void 0)return null;if(typeof e=="string")return e||null;if("value"in e)return ie(t,e.value)||null;const r={};for(const[i,s]of Object.entries(e.params??{}))r[i]=ie(t,s);const o=n(e.key,r);return o===e.key?null:o}function qt(e,t){if(!e||typeof e=="string"||"value"in e)return null;const n={};for(const[r,o]of Object.entries(e.params??{}))n[r]=ie(t,o);return{key:e.key,params:n}}const bt=140;function xo(e){const t=e.trim();return t.length<=bt?t:`${t.slice(0,bt-1).trimEnd()}…`}function Lo(e,t){const n=qt(t?.text,e),r=t?se(t.text,e,o=>o):null;return{activityId:e.id,type:e.type,snippet:xo(r??zt(e)),authorName:e.author?.name??"",direction:e.direction,createdAt:e.createdAt??Date.now(),...n?{snippetKey:n.key,snippetParams:n.params}:{}}}const Po=e=>e;function Tt(e){const t=D[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 It(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 Jt{constructor(t=[],n=Po){this.translate=n;for(const r of t)r?.type&&(r.type in D||this.declared.has(r.type)||this.declared.set(r.type,r))}declared=new Map;get(t){if(t in D)return Tt(t);const n=this.declared.get(t);return n?It(n):void 0}triggerable(){const t=Object.keys(D).filter(r=>D[r].triggerable).map(Tt),n=[...this.declared.values()].map(It).filter(r=>r.triggerable);return[...t,...n]}timelineText(t,n){const r=D[t.type];if(r?.timeline)return r.timeline(t,n);const o=this.declared.get(t.type);return se(o?.text,t,this.translate)??t.type.replace(/_/g," ").toLowerCase()}snippet(t){const n=D[t.type];if(n?.snippet)return n.snippet(t);const r=this.declared.get(t.type);return se(r?.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}isMessage(t){return Xe(this.get(t)?.shape)}nestsUnderParent(t){return ze(this.get(t)?.shape)}isReplyable(t){return this.get(t)?.replyable===!0}carriesText(t){return this.get(t)?.carriesText===!0}countsAs(t){return this.get(t)?.countsAs}channelKind(t){return this.get(t)?.channelKind}isTranscript(t){const n=this.get(t);return n?.shape==="artifact"&&n.carriesText}get translator(){return this.translate}}const Uo=new Jt;function $o(e,t,n=[]){const r=e.createdAt;if(!r)return[];const o=new Set(n);return e.author.type==="user"&&e.author.id&&o.add(e.author.id),Object.entries(t).filter(([i,s])=>s>=r&&!o.has(i)).map(([i])=>i)}function Zt(e){return e.createdAt??0}function Ko(e){return e.type==="EMAIL_RECEIVED"||e.type==="EMAIL_SENT"}function Fo(e){return e.type==="CHAT_MESSAGE_SENT"||e.type==="CHAT_MESSAGE_RECEIVED"}const qe=[{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 Y(e){return qe.find(t=>t.id===e)}function Bo(e){return Y(e)?.label??e}function Ho(e,t="gpt-5-mini"){return Y(e)?.defaultModel??t}function Wo(e){return qe.filter(t=>t.capabilities.includes(e))}function Go(e){const t=Y(e);return!!t&&!t.baseUrl}function Vo(e,t){return t==="text"?!0:Y(e)?.attachmentKinds?.includes(t)===!0}function jo(e,t){if(!e.enabled)return"ok";const n=Le(e.hardLimitNanos),r=Le(e.softLimitNanos);return n!==void 0&&t>=n?"hard":r!==void 0&&t>=r?"soft":"ok"}function Le(e){return typeof e=="number"?e:void 0}function Qt(e,t="month"){const n=new Date(e);return Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),1)}function Yo(e,t="month"){const n=new Date(Qt(e,t));return`${n.getUTCFullYear()}-${String(n.getUTCMonth()+1).padStart(2,"0")}`}function Xo(e){return e?.listeningEnabled!==!1}const zo=[{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 Ce(e){return e<10?`0${e}`:`${e}`}function K(e,t){const n=new Date(e),r=`${n.getUTCFullYear()}-${Ce(n.getUTCMonth()+1)}-${Ce(n.getUTCDate())}`;return t==="day"?r:`${r}T${Ce(n.getUTCHours())}`}function F(e,t){const n=new Date(e);return n.setUTCMinutes(0,0,0),t==="day"&&n.setUTCHours(0),n.getTime()}const qo=36e5,Jo=864e5;function Zo(e,t,n){const r=n==="hour"?qo:Jo,o=[];for(let i=F(e,n);i<=t;i+=r)o.push(K(i,n));return o}const Qo=new Set(["time"]);function ei(e,t,n){if(!e)return[];const r=new Set(e.supportedDimensions??[]);return t.filter(o=>r.has(o.id)&&!Qo.has(o.id)).map(o=>({id:o.id,label:o.label,options:o.options?.length?o.options:n[o.id]??[]})).filter(o=>o.options.length>0)}function ti(e,t){const n=t.find(o=>o.id===e.dimensionId),r=n?.options.find(o=>o.value===e.value);return`${n?.label??e.dimensionId} · ${r?.label??e.value}`}function ni(e){return{value:e.id,label:`${e.category} · ${e.label}`}}const en=[{id:"resource",label:"Resource",labelSource:"raw"},{id:"origin",label:"Herkomst",labelSource:"raw"}],tn=en.map(e=>e.id);function nn(e,t){return`${e}.usage.${t}`}function ri(e,t){return t.map(n=>({id:nn(e,n.unit),label:n.label,category:"Verbruik",valueType:n.valueType??"count",aggregation:"sum",supportedDimensions:["provider",...tn,...n.extraDimensions??[],"time"]}))}const rn=new Set(["info","success","warning","destructive"]),ae=200,ce=100,le=200,ue=12,de=4,Pe=10,on=8,Ue=12,ye=4e3,U=500,sn=1024*1024,oi=new Set(["heading","paragraph","list","quote","code","divider","table","kpi","callout","image","letterhead","totals","pagebreak"]),an=["http:","https:","mailto:","tel:"],ii=/^[a-z][a-z0-9+.-]*:/i;function Je(e){const t=e.trim().replace(/^<|>$/g,"");if(!t)return!1;const n=ii.exec(t)?.[0];return n?an.includes(n.toLowerCase()):!t.startsWith("//")}const si=/^[ \t]{0,3}\[([^\]]+)\]:[ \t]*(\S+).*$/gm;function ai(e){let t="",n=0;for(;n<e.length;){const r=e[n]==="!"&&e[n+1]==="[";if(e[n]!=="["&&!r){t+=e[n],n+=1;continue}const o=n+(r?2:1),i=Mt(e,o,"[","]");if(i<0||e[i+1]!=="("){t+=e[n],n+=1;continue}const s=Mt(e,i+2,"(",")");if(s<0){t+=e[n],n+=1;continue}const a=e.slice(o,i),l=e.slice(i+2,s).trim().split(/\s+/)[0]??"";t+=r||!Je(l)?a:e.slice(n,s+1),n=s+1}return t}function Mt(e,t,n,r){let o=1;for(let i=t;i<e.length;i+=1){if(e[i]==="\\"){i+=1;continue}if(e[i]===n)o+=1;else if(e[i]===r&&(o-=1,o===0))return i}return-1}function cn(e){return ai(e).replace(si,(t,n,r)=>Je(r)?t:"")}function I(e,t=ye){return typeof e=="string"?cn(e).slice(0,t):""}function ci(e,t=ye){return typeof e=="string"?e.slice(0,t):""}function H(e,t=200){return I(e,t)}function li(e,t="info"){return typeof e=="string"&&rn.has(e)?e:t}function ln(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const r of e){if(n.length>=ae){t(`more than ${ae} blocks; the rest was dropped`);break}if(!r||typeof r!="object")continue;const o=r;if(!oi.has(o.type)){t(`unknown block type ${String(o.type)}`);continue}const i=typeof o.block_id=="string"?{block_id:o.block_id}:{};switch(o.type){case"heading":{const s=I(o.text);if(!s){t("a heading without text");continue}const a=o.level===2||o.level===3?o.level:1;n.push({...i,type:"heading",level:a,text:s});break}case"paragraph":{const s=I(o.text);if(!s){t("a paragraph without text");continue}n.push({...i,type:"paragraph",text:s});break}case"quote":{const s=I(o.text);if(!s){t("a quote without text");continue}n.push({...i,type:"quote",text:s});break}case"code":{const s=ci(o.text);if(!s){t("a code block without text");continue}const a=typeof o.lang=="string"?{lang:o.lang.slice(0,32)}:{};n.push({...i,type:"code",...a,text:s});break}case"divider":n.push({...i,type:"divider"});break;case"list":{const s=Array.isArray(o.items)?o.items:[],a=[];for(const u of s){if(a.length>=ce){t(`more than ${ce} list items`);break}const p=I(u?.text);if(!p)continue;const c=I(u?.lead,200);a.push(c?{lead:c,text:p}:{text:p})}if(a.length===0){t("a list without usable items");continue}const l=o.style==="numbered"?"numbered":"bulleted";n.push({...i,type:"list",style:l,items:a});break}case"table":{const s=Array.isArray(o.columns)?o.columns:[],a=[];for(const c of s){if(a.length>=ue){t(`more than ${ue} table columns`);break}const d=I(c?.label,U),m=c?.align==="right"?"right":void 0;a.push(m?{label:d,align:m}:{label:d})}if(a.length===0){t("a table without columns");continue}const l=Array.isArray(o.rows)?o.rows:[],u=[];for(const c of l){if(u.length>=le){t(`more than ${le} table rows`);break}const d=Array.isArray(c)?c:[];u.push(a.map((m,S)=>I(d[S],U)))}const p=I(o.caption,U);n.push({...i,type:"table",columns:a,rows:u,...p?{caption:p}:{}});break}case"kpi":{const s=Array.isArray(o.items)?o.items:[],a=[];for(const l of s){if(a.length>=de){t(`more than ${de} kpi items`);break}const u=I(l?.value,40),p=I(l?.label,80);if(!u||!p)continue;const c=l?.tone;a.push(typeof c=="string"&&rn.has(c)?{value:u,label:p,tone:c}:{value:u,label:p})}if(a.length===0){t("a kpi block without usable items");continue}n.push({...i,type:"kpi",items:a});break}case"image":{const s=typeof o.url=="string"?o.url.trim():"";if(!s||!Je(s)){t("an image without a usable url");continue}const a=I(o.alt,200),l=I(o.caption,U);n.push({...i,type:"image",url:s,...a?{alt:a}:{},...l?{caption:l}:{}});break}case"letterhead":{const s=Array.isArray(o.fields)?o.fields:[],a=[];for(const p of s){if(a.length>=Pe){t(`more than ${Pe} letterhead fields`);break}const c=p,d=typeof c?.key=="string"?c.key.slice(0,48):"",m=H(c?.value);if(!d||!m)continue;const S=H(c?.label,80);a.push(S?{key:d,label:S,value:m}:{key:d,value:m})}const u=(Array.isArray(o.recipient)?o.recipient:[]).slice(0,on).map(p=>H(p)).filter(Boolean);if(a.length===0&&u.length===0){t("a letterhead without fields or recipient");continue}n.push({...i,type:"letterhead",fields:a,...u.length>0?{recipient:u}:{}});break}case"totals":{const s=u=>{const p=Array.isArray(u)?u:[],c=[];for(const d of p){if(c.length>=Ue){t(`more than ${Ue} totals rows`);break}const m=d,S=H(m?.label),g=H(m?.amount,40);!S||!g||c.push(m?.emphasis===!0?{label:S,amount:g,emphasis:!0}:{label:S,amount:g})}return c},a=s(o.rows);if(a.length===0){t("a totals block without usable rows");continue}const l=s(o.taxRows);n.push({...i,type:"totals",rows:a,...l.length>0?{taxRows:l}:{}});break}case"pagebreak":n.push({...i,type:"pagebreak"});break;case"callout":{const s=I(o.text);if(!s){t("a callout without text");continue}const a=I(o.title,200);n.push({...i,type:"callout",tone:li(o.tone),...a?{title:a}:{},text:s});break}}}return n}function un(e){return JSON.stringify(e).length}function dn(e){return{blocks:e.length,types:e.map(t=>t.type),headings:e.flatMap(t=>t.type==="heading"?[t.text]:[])}}function Ot(e){return e.replace(/\|/g,"\\|").replace(/\r?\n/g," ").trim()}function ke(e,t,n){const r=e.map((o,i)=>n?.[i]==="right"?"---:":"---");return[`| ${e.map(Ot).join(" | ")} |`,`| ${r.join(" | ")} |`,...t.map(o=>`| ${o.map(Ot).join(" | ")} |`)]}function ui(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 r=e.style==="numbered"?`${n+1}.`:"-";return t.lead?`${r} **${t.lead}** ${t.text}`:`${r} ${t.text}`});case"table":{const t=ke(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 ke(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}`);case"image":{const t=``;return e.caption?[t,"",`*${e.caption}*`]:[t]}case"letterhead":{const t=[...e.recipient??[]];t.length>0&&e.fields.length>0&&t.push("");for(const n of e.fields)t.push(n.label?`**${n.label}:** ${n.value}`:n.value);return t.map((n,r)=>r<t.length-1?`${n} `:n)}case"totals":return ke(["",""],[...e.rows,...e.taxRows??[]].map(t=>[t.emphasis?`**${t.label}**`:t.label,t.emphasis?`**${t.amount}**`:t.amount]),["left","right"]);case"pagebreak":return["---"]}}function Ze(e,t){const n=[],r=e.some(o=>o.type==="heading"&&o.level===1);t&&!r&&n.push(`# ${t}`);for(const o of e){const i=ui(o);i.length>0&&n.push(i.join(`
|
|
3
|
+
`),t=t.replace(Ao,"$2"),t=t.replace(bo,"$2"),t=t.replace(/~~(?=\S)([\s\S]*?\S)~~/g,"$1"),t=t.replace(/`([^`\n]+)`/g,"$1"),t.replace(/\s+/g," ").trim()}function Yt(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 q(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 _t(e){return e?` — ${Math.floor(e/60)}m ${e%60}s`:""}function Ce(e){return e?.split("@")?.[0]||e||""}function J(e){return e.map(t=>t.name).join(", ")}function St(e){return e==="meeting"?"Meeting":e==="video"?"Video call":"Audio call"}const D={VOICE_CALL_STARTED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek gestart",timeline:e=>e.direction==="inbound"?`Inbound call started — ${Ce(e.payload.from)}`:`Outbound call started — ${Ce(e.payload.to)}`},VOICE_CALL_ANSWERED:{shape:"event",channelKind:"voice",icon:"phone",connected:!0,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?` (${q(e.payload.duration)})`:""}`,timeline:e=>`Call ended${_t(e.payload.duration)}`},VOICE_CALL_MISSED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gemiste oproep",timeline:e=>`Missed call — ${Ce(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",connected:!0,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?` (${q(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:At},EMAIL_SENT:{shape:"message",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:At},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=>`${J(e.payload.members)} toegevoegd`,timeline:e=>{const t=J(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=>`${J(e.payload.members)} verlaten`,timeline:e=>{const t=J(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=>`${St(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?` (${q(e.payload.duration)})`:""}`,timeline:e=>`${St(e.payload.callType)} ended${_t(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",connected:!0,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?` (${q(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}`},SLA_BREACHED:{shape:"event",triggerable:!0,displayNameKey:"communication:activity.SLA_BREACHED",icon:"alarm-clock",snippet:e=>`SLA verlopen: ${e.payload.metric}`,timeline:e=>`SLA target ${e.payload.metric} passed its deadline`},WORK_COMMENT_ADDED:{shape:"note",icon:"sticky-note",carriesText:!0,snippet:()=>"Reactie"},WORK_ITEM_ASSIGNED:{shape:"event",icon:"user",snippet:()=>"Taak toegewezen",timeline:(e,t)=>`Assigned by ${t}`},WORK_ITEM_STATUS_CHANGED:{shape:"event",triggerable:!0,icon:"circle-dot",snippet:()=>"Status gewijzigd",timeline:(e,t)=>`Status changed by ${t}`}};function At(e){const t=e.payload,n=jt(t.bodyText).trim()||t.bodySnippet?.trim()||Yt(t.body??"");return t.subject?`${t.subject} — ${n}`:n}function M(e){return D[e]}function To(e){return M(e)?.icon??"circle"}function Io(e){return M(e)?.channelKind}function Xe(e){return e==="message"||e==="note"}function Mo(e){return Xe(M(e)?.shape)}function ze(e){return e==="note"}function Oo(e){return ze(M(e)?.shape)}function wo(e){return M(e)?.replyable===!0}function Ro(e){return M(e)?.carriesText===!0}function Xt(e){return M(e)?.countsAs}function Co(e){return M(e)?.playbookAuthored===!0}function ko(e){return M(e)?.connected===!0}function No(e){const t=M(e);return t?.shape==="artifact"&&t?.carriesText===!0}function zt(e){const t=M(e.type)?.snippet;return t?t(e):""}function vo(e,t){const n=M(e.type)?.timeline;return n?n(e,t):e.type.replace(/_/g," ").toLowerCase()}function Do(e){const t=M(e.type)?.joinUrl;return t?t(e):void 0}function ie(e,t){let n=e;for(const r of t.split(".")){if(n==null||typeof n!="object")return"";n=n[r]}return n==null?"":typeof n=="string"?n:typeof n=="number"||typeof n=="boolean"?String(n):""}function se(e,t,n){if(e===void 0)return null;if(typeof e=="string")return e||null;if("value"in e)return ie(t,e.value)||null;const r={};for(const[i,s]of Object.entries(e.params??{}))r[i]=ie(t,s);const o=n(e.key,r);return o===e.key?null:o}function qt(e,t){if(!e||typeof e=="string"||"value"in e)return null;const n={};for(const[r,o]of Object.entries(e.params??{}))n[r]=ie(t,o);return{key:e.key,params:n}}const bt=140;function xo(e){const t=e.trim();return t.length<=bt?t:`${t.slice(0,bt-1).trimEnd()}…`}function Lo(e,t){const n=qt(t?.text,e),r=t?se(t.text,e,o=>o):null;return{activityId:e.id,type:e.type,snippet:xo(r??zt(e)),authorName:e.author?.name??"",direction:e.direction,createdAt:e.createdAt??Date.now(),...n?{snippetKey:n.key,snippetParams:n.params}:{}}}const Po=e=>e;function Tt(e){const t=D[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 It(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 Jt{constructor(t=[],n=Po){this.translate=n;for(const r of t)r?.type&&(r.type in D||this.declared.has(r.type)||this.declared.set(r.type,r))}declared=new Map;get(t){if(t in D)return Tt(t);const n=this.declared.get(t);return n?It(n):void 0}triggerable(){const t=Object.keys(D).filter(r=>D[r].triggerable).map(Tt),n=[...this.declared.values()].map(It).filter(r=>r.triggerable);return[...t,...n]}timelineText(t,n){const r=D[t.type];if(r?.timeline)return r.timeline(t,n);const o=this.declared.get(t.type);return se(o?.text,t,this.translate)??t.type.replace(/_/g," ").toLowerCase()}snippet(t){const n=D[t.type];if(n?.snippet)return n.snippet(t);const r=this.declared.get(t.type);return se(r?.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}isMessage(t){return Xe(this.get(t)?.shape)}nestsUnderParent(t){return ze(this.get(t)?.shape)}isReplyable(t){return this.get(t)?.replyable===!0}carriesText(t){return this.get(t)?.carriesText===!0}countsAs(t){return this.get(t)?.countsAs}channelKind(t){return this.get(t)?.channelKind}isTranscript(t){const n=this.get(t);return n?.shape==="artifact"&&n.carriesText}get translator(){return this.translate}}const Uo=new Jt;function $o(e,t,n=[]){const r=e.createdAt;if(!r)return[];const o=new Set(n);return e.author.type==="user"&&e.author.id&&o.add(e.author.id),Object.entries(t).filter(([i,s])=>s>=r&&!o.has(i)).map(([i])=>i)}function Zt(e){return e.createdAt??0}function Ko(e){return e.type==="EMAIL_RECEIVED"||e.type==="EMAIL_SENT"}function Fo(e){return e.type==="CHAT_MESSAGE_SENT"||e.type==="CHAT_MESSAGE_RECEIVED"}const qe=[{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 Y(e){return qe.find(t=>t.id===e)}function Bo(e){return Y(e)?.label??e}function Ho(e,t="gpt-5-mini"){return Y(e)?.defaultModel??t}function Wo(e){return qe.filter(t=>t.capabilities.includes(e))}function Go(e){const t=Y(e);return!!t&&!t.baseUrl}function Vo(e,t){return t==="text"?!0:Y(e)?.attachmentKinds?.includes(t)===!0}function jo(e,t){if(!e.enabled)return"ok";const n=Pe(e.hardLimitNanos),r=Pe(e.softLimitNanos);return n!==void 0&&t>=n?"hard":r!==void 0&&t>=r?"soft":"ok"}function Pe(e){return typeof e=="number"?e:void 0}function Qt(e,t="month"){const n=new Date(e);return Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),1)}function Yo(e,t="month"){const n=new Date(Qt(e,t));return`${n.getUTCFullYear()}-${String(n.getUTCMonth()+1).padStart(2,"0")}`}function Xo(e){return e?.listeningEnabled!==!1}const zo=[{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 ke(e){return e<10?`0${e}`:`${e}`}function K(e,t){const n=new Date(e),r=`${n.getUTCFullYear()}-${ke(n.getUTCMonth()+1)}-${ke(n.getUTCDate())}`;return t==="day"?r:`${r}T${ke(n.getUTCHours())}`}function F(e,t){const n=new Date(e);return n.setUTCMinutes(0,0,0),t==="day"&&n.setUTCHours(0),n.getTime()}const qo=36e5,Jo=864e5;function Zo(e,t,n){const r=n==="hour"?qo:Jo,o=[];for(let i=F(e,n);i<=t;i+=r)o.push(K(i,n));return o}const Qo=new Set(["time"]);function ei(e,t,n){if(!e)return[];const r=new Set(e.supportedDimensions??[]);return t.filter(o=>r.has(o.id)&&!Qo.has(o.id)).map(o=>({id:o.id,label:o.label,options:o.options?.length?o.options:n[o.id]??[]})).filter(o=>o.options.length>0)}function ti(e,t){const n=t.find(o=>o.id===e.dimensionId),r=n?.options.find(o=>o.value===e.value);return`${n?.label??e.dimensionId} · ${r?.label??e.value}`}function ni(e){return{value:e.id,label:`${e.category} · ${e.label}`}}const en=[{id:"resource",label:"Resource",labelSource:"raw"},{id:"origin",label:"Herkomst",labelSource:"raw"}],tn=en.map(e=>e.id);function nn(e,t){return`${e}.usage.${t}`}function ri(e,t){return t.map(n=>({id:nn(e,n.unit),label:n.label,category:"Verbruik",valueType:n.valueType??"count",aggregation:"sum",supportedDimensions:["provider",...tn,...n.extraDimensions??[],"time"]}))}const rn=new Set(["info","success","warning","destructive"]),ae=200,ce=100,le=200,ue=12,de=4,Ue=10,on=8,$e=12,_e=4e3,U=500,sn=1024*1024,oi=new Set(["heading","paragraph","list","quote","code","divider","table","kpi","callout","image","letterhead","totals","pagebreak"]),an=["http:","https:","mailto:","tel:"],ii=/^[a-z][a-z0-9+.-]*:/i;function Je(e){const t=e.trim().replace(/^<|>$/g,"");if(!t)return!1;const n=ii.exec(t)?.[0];return n?an.includes(n.toLowerCase()):!t.startsWith("//")}const si=/^[ \t]{0,3}\[([^\]]+)\]:[ \t]*(\S+).*$/gm;function ai(e){let t="",n=0;for(;n<e.length;){const r=e[n]==="!"&&e[n+1]==="[";if(e[n]!=="["&&!r){t+=e[n],n+=1;continue}const o=n+(r?2:1),i=Mt(e,o,"[","]");if(i<0||e[i+1]!=="("){t+=e[n],n+=1;continue}const s=Mt(e,i+2,"(",")");if(s<0){t+=e[n],n+=1;continue}const a=e.slice(o,i),l=e.slice(i+2,s).trim().split(/\s+/)[0]??"";t+=r||!Je(l)?a:e.slice(n,s+1),n=s+1}return t}function Mt(e,t,n,r){let o=1;for(let i=t;i<e.length;i+=1){if(e[i]==="\\"){i+=1;continue}if(e[i]===n)o+=1;else if(e[i]===r&&(o-=1,o===0))return i}return-1}function cn(e){return ai(e).replace(si,(t,n,r)=>Je(r)?t:"")}function I(e,t=_e){return typeof e=="string"?cn(e).slice(0,t):""}function ci(e,t=_e){return typeof e=="string"?e.slice(0,t):""}function H(e,t=200){return I(e,t)}function li(e,t="info"){return typeof e=="string"&&rn.has(e)?e:t}function ln(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const r of e){if(n.length>=ae){t(`more than ${ae} blocks; the rest was dropped`);break}if(!r||typeof r!="object")continue;const o=r;if(!oi.has(o.type)){t(`unknown block type ${String(o.type)}`);continue}const i=typeof o.block_id=="string"?{block_id:o.block_id}:{};switch(o.type){case"heading":{const s=I(o.text);if(!s){t("a heading without text");continue}const a=o.level===2||o.level===3?o.level:1;n.push({...i,type:"heading",level:a,text:s});break}case"paragraph":{const s=I(o.text);if(!s){t("a paragraph without text");continue}n.push({...i,type:"paragraph",text:s});break}case"quote":{const s=I(o.text);if(!s){t("a quote without text");continue}n.push({...i,type:"quote",text:s});break}case"code":{const s=ci(o.text);if(!s){t("a code block without text");continue}const a=typeof o.lang=="string"?{lang:o.lang.slice(0,32)}:{};n.push({...i,type:"code",...a,text:s});break}case"divider":n.push({...i,type:"divider"});break;case"list":{const s=Array.isArray(o.items)?o.items:[],a=[];for(const u of s){if(a.length>=ce){t(`more than ${ce} list items`);break}const p=I(u?.text);if(!p)continue;const c=I(u?.lead,200);a.push(c?{lead:c,text:p}:{text:p})}if(a.length===0){t("a list without usable items");continue}const l=o.style==="numbered"?"numbered":"bulleted";n.push({...i,type:"list",style:l,items:a});break}case"table":{const s=Array.isArray(o.columns)?o.columns:[],a=[];for(const c of s){if(a.length>=ue){t(`more than ${ue} table columns`);break}const d=I(c?.label,U),m=c?.align==="right"?"right":void 0;a.push(m?{label:d,align:m}:{label:d})}if(a.length===0){t("a table without columns");continue}const l=Array.isArray(o.rows)?o.rows:[],u=[];for(const c of l){if(u.length>=le){t(`more than ${le} table rows`);break}const d=Array.isArray(c)?c:[];u.push(a.map((m,S)=>I(d[S],U)))}const p=I(o.caption,U);n.push({...i,type:"table",columns:a,rows:u,...p?{caption:p}:{}});break}case"kpi":{const s=Array.isArray(o.items)?o.items:[],a=[];for(const l of s){if(a.length>=de){t(`more than ${de} kpi items`);break}const u=I(l?.value,40),p=I(l?.label,80);if(!u||!p)continue;const c=l?.tone;a.push(typeof c=="string"&&rn.has(c)?{value:u,label:p,tone:c}:{value:u,label:p})}if(a.length===0){t("a kpi block without usable items");continue}n.push({...i,type:"kpi",items:a});break}case"image":{const s=typeof o.url=="string"?o.url.trim():"";if(!s||!Je(s)){t("an image without a usable url");continue}const a=I(o.alt,200),l=I(o.caption,U);n.push({...i,type:"image",url:s,...a?{alt:a}:{},...l?{caption:l}:{}});break}case"letterhead":{const s=Array.isArray(o.fields)?o.fields:[],a=[];for(const p of s){if(a.length>=Ue){t(`more than ${Ue} letterhead fields`);break}const c=p,d=typeof c?.key=="string"?c.key.slice(0,48):"",m=H(c?.value);if(!d||!m)continue;const S=H(c?.label,80);a.push(S?{key:d,label:S,value:m}:{key:d,value:m})}const u=(Array.isArray(o.recipient)?o.recipient:[]).slice(0,on).map(p=>H(p)).filter(Boolean);if(a.length===0&&u.length===0){t("a letterhead without fields or recipient");continue}n.push({...i,type:"letterhead",fields:a,...u.length>0?{recipient:u}:{}});break}case"totals":{const s=u=>{const p=Array.isArray(u)?u:[],c=[];for(const d of p){if(c.length>=$e){t(`more than ${$e} totals rows`);break}const m=d,S=H(m?.label),g=H(m?.amount,40);!S||!g||c.push(m?.emphasis===!0?{label:S,amount:g,emphasis:!0}:{label:S,amount:g})}return c},a=s(o.rows);if(a.length===0){t("a totals block without usable rows");continue}const l=s(o.taxRows);n.push({...i,type:"totals",rows:a,...l.length>0?{taxRows:l}:{}});break}case"pagebreak":n.push({...i,type:"pagebreak"});break;case"callout":{const s=I(o.text);if(!s){t("a callout without text");continue}const a=I(o.title,200);n.push({...i,type:"callout",tone:li(o.tone),...a?{title:a}:{},text:s});break}}}return n}function un(e){return JSON.stringify(e).length}function dn(e){return{blocks:e.length,types:e.map(t=>t.type),headings:e.flatMap(t=>t.type==="heading"?[t.text]:[])}}function Ot(e){return e.replace(/\|/g,"\\|").replace(/\r?\n/g," ").trim()}function Ne(e,t,n){const r=e.map((o,i)=>n?.[i]==="right"?"---:":"---");return[`| ${e.map(Ot).join(" | ")} |`,`| ${r.join(" | ")} |`,...t.map(o=>`| ${o.map(Ot).join(" | ")} |`)]}function ui(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 r=e.style==="numbered"?`${n+1}.`:"-";return t.lead?`${r} **${t.lead}** ${t.text}`:`${r} ${t.text}`});case"table":{const t=Ne(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 Ne(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}`);case"image":{const t=``;return e.caption?[t,"",`*${e.caption}*`]:[t]}case"letterhead":{const t=[...e.recipient??[]];t.length>0&&e.fields.length>0&&t.push("");for(const n of e.fields)t.push(n.label?`**${n.label}:** ${n.value}`:n.value);return t.map((n,r)=>r<t.length-1?`${n} `:n)}case"totals":return Ne(["",""],[...e.rows,...e.taxRows??[]].map(t=>[t.emphasis?`**${t.label}**`:t.label,t.emphasis?`**${t.amount}**`:t.amount]),["left","right"]);case"pagebreak":return["---"]}}function Ze(e,t){const n=[],r=e.some(o=>o.type==="heading"&&o.level===1);t&&!r&&n.push(`# ${t}`);for(const o of e){const i=ui(o);i.length>0&&n.push(i.join(`
|
|
4
4
|
`))}return`${n.join(`
|
|
5
5
|
|
|
6
6
|
`)}
|
|
7
7
|
`}const Qe=e=>`user:${e}`,et=e=>`team:${e}`;function di(e){const t=new Set;for(const n of e??[])n?.id&&(n.kind==="user"&&t.add(Qe(n.id)),n.kind==="team"&&t.add(et(n.id)));return[...t].sort()}function pi(e,t){return[Qe(e),...t.map(et)]}function fi(e){const t=new Set;for(const n of e??[])n?.kind&&t.add(n.kind);return[...t]}const pn=["done","escalated"],mi=["open","waiting"];function hi(e){return pn.includes(e)}const fn="assignment";function gi(e){return`${fn}:${e}`}function Ei(e,t,n,r){if(e.direction==="inbound")return!0;if(e.author?.type==="user"&&e.author.id===t)return!1;const o=e.payload?.mentions;return Array.isArray(o)&&o.includes(t)||r&&r===t?!0:n==="reply"}function yi(e){const{targetAuthorId:t,reactorId:n,agentId:r,on:o}=e;return!o||!t||t!==r?!1:n!==r}function _i(e){return e.subjectKind&&e.subjectId?{type:e.subjectKind,id:e.subjectId}:void 0}const mn=12;function Si(e,t,n=mn){const r=t+1;return e?e.kind==="done"?{status:"done",waitingOn:null,turns:r,reason:e.note}:e.kind==="escalate"?{status:"escalated",waitingOn:null,turns:r,reason:e.reason}:r>=n?{status:"escalated",waitingOn:null,turns:r,reason:`na ${n} beurten nog niet afgerond, dus een mens neemt het over`}:{status:"waiting",waitingOn:e.on,turns:r}:{status:"escalated",waitingOn:null,turns:r,reason:"de agent rondde zijn beurt af zonder te zeggen wat er moet gebeuren (wachten, afronden of overdragen)"}}const Ai=new Set(["mail","message"]);function hn(e,t){const n=e.settings?.signatures?.[t];return!n?.enabled||!n.body||n.body.trim()===""?null:n}function bi(e,t,n,r="html"){if(!e)return n;const o=hn(e,t);return o?`${n}${r==="text"?`
|
|
8
8
|
|
|
9
|
-
`:t==="mail"?"<br><br>-- <br>":"<br><br>"}${o.body}`:n}function Ti(e){return e.endpoints??[]}function P(e){const t=(e??"").trim().toLowerCase();if(t)return t.split(/[-_]/)[0]||void 0}function Ii(e){return P(e.contactLocale)??P(e.companyLocale)??P(e.organizationLocale)}function Mi(e,t,n,r){const o=e.filter(a=>a.key===t&&!a.archived);if(o.length===0)return;const i=P(n),s=P(r);return o.find(a=>P(a.locale)===i)??o.find(a=>P(a.locale)===s)??o.find(a=>!a.locale)??o[0]}const Oi=/\{([a-zA-Z0-9_.]+)\}/g;function tt(e,t){let n=e;for(const r of t.split(".")){if(n==null||typeof n!="object")return;n=n[r]}return n}function wi(e){return typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):""}function gn(e,t){const n=[];return{text:e.replace(Oi,(o,i)=>{const s=tt(t,i);return s==null||s===""?(n.includes(i)||n.push(i),`{${i}}`):wi(s)}),unresolved:n}}function En(e,t){if(!e)return!0;const n=tt(t,e.key);if(e.exists!==void 0){const r=n!=null&&n!==""&&n!==!1;return e.exists?r:!r}return e.equals!==void 0?n===e.equals:!0}function Ri(e,t,n){const r=[],o=[],i=s=>{const a=gn(s,t);for(const l of a.unresolved)r.includes(l)||r.push(l);return a.text};for(const s of e)if(!(s.block_id&&!En(n?.[s.block_id],t)))switch(s.type){case"heading":case"paragraph":case"quote":o.push({...s,text:i(s.text)});break;case"callout":o.push({...s,...s.title?{title:i(s.title)}:{},text:i(s.text)});break;case"code":o.push(s);break;case"list":o.push({...s,items:s.items.map(a=>({...a.lead?{lead:i(a.lead)}:{},text:i(a.text)}))});break;case"table":o.push({...s,columns:s.columns.map(a=>({...a,label:i(a.label)})),rows:s.rows.map(a=>a.map(i)),...s.caption?{caption:i(s.caption)}:{}});break;case"kpi":o.push({...s,items:s.items.map(a=>({...a,value:i(a.value),label:i(a.label)}))});break;case"letterhead":o.push({...s,fields:s.fields.map(a=>({...a,value:i(a.value)})),...s.recipient?{recipient:s.recipient.map(i)}:{}});break;case"totals":o.push({...s,rows:s.rows.map(a=>({...a,label:i(a.label),amount:i(a.amount)})),...s.taxRows?{taxRows:s.taxRows.map(a=>({...a,label:i(a.label),amount:i(a.amount)}))}:{}});break;case"image":o.push({...s,url:i(s.url),...s.alt?{alt:i(s.alt)}:{}});break;default:o.push(s)}return{blocks:o,unresolved:r}}const yn=36e5,_n=864e5,x=-1/0,Ci=e=>e.score>x,V={urgent:40,high:25,normal:10,low:0};function ki(e){return Object.fromEntries(e.map(t=>[t.resourceId,t]))}const Ni=/(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i,Sn=/\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;function An(e,t){return!!(e&&Ni.test(e)||t&&Sn.test(t))}const bn=3,Tn=600;function vi(e,t){return e>=bn||t>=Tn}const In=["list-unsubscribe","list-unsubscribe-post","list-id","precedence","auto-submitted","x-auto-response-suppress","feedback-id","x-mailer"];function Di(e){const t={};for(const n of e){const r=n.name?.toLowerCase();r&&n.value!==void 0&&In.includes(r)&&(t[r]=n.value)}return t}const xi=/(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|notifications?|bounce|postmaster|mailer)@/i,Li=/(^|[._+-])(newsletter|nieuwsbrief|marketing|mailing)@/i;function Pi(e){const t=e.headers??{},n=e.from?.email,r=t["auto-submitted"]?.toLowerCase();if(r&&r!=="no"||t["x-auto-response-suppress"]||n&&xi.test(n))return"automated";const o=t.precedence?.toLowerCase();if(t["list-unsubscribe"]||t["list-unsubscribe-post"]||t["list-id"]||o==="bulk"||o==="list"||e.body&&Sn.test(e.body)||n&&Li.test(n))return"marketing"}function Mn(e,t){return e.lastActivityAt?!(e.seenBy??[]).includes(t):!1}const On=["open"],wn=1e3,Rn={urgent:1,high:4,normal:8,low:24},Cn=72;function kn(e){return e.lastActivityAt??(e.createdAt?new Date(Zt(e)).getTime():0)}function Nn(e,t){return vn(t.remindersById?.[e.id],e,t.now)}function vn(e,t,n){return!e||e.remindAt<=n?!1:!((t.lastActivityAt??0)>e.parkedAt&&t.lastActivityPreview?.direction==="inbound")}const Dn=e=>Xt(e)==="outbound_message",xn=e=>On.includes(e);function _e(e,t){return Math.max(0,(t-kn(e))/yn)}function Ln(e,t){const n=e.assignedInboxId?t?.[e.assignedInboxId]:void 0;return typeof n=="number"&&n>0?n:Rn[e.priority??"normal"]}function Ui(e){const t={};for(const n of e)typeof n.slaHours=="number"&&n.slaHours>0&&(t[n.id]=n.slaHours);return t}function $i(e,t,n){return!xn(e.status)||e.firstResponseAt?!1:_e(e,t)>Ln(e,n)}function Pn(e,t){const n=e.lastActivityPreview;return n?.direction!=="outbound"||!Dn(n.type)?!1:_e(e,t)<Cn}function Ki(e,t){if(!xn(e.status))return{score:x,reasons:[]};if(e.snoozedTill&&e.snoozedTill>t.now)return{score:x,reasons:[]};if(Pn(e,t.now))return{score:x,reasons:[]};if(Nn(e,t))return{score:x,reasons:[]};let n=0;const r=[],o=e.priority??"normal";V[o]>0&&(n+=V[o],r.push(`priority:${o}`)),Mn(e,t.userId)&&(n+=20,r.push("unseen")),e.assignedUserId&&e.assignedUserId===t.userId&&(n+=15,r.push("assigned-to-you"));const i=_e(e,t.now);if(i>0){const l=Math.min(i*2,30);n+=l,i>=1&&r.push(`waiting:${Math.round(i)}h`)}const s=e.lastActivityPreview;return s?.type==="AI_ACTION_PROPOSED"&&(n+=30,r.push("awaiting-approval")),s?.direction==="outbound"&&Dn(s.type)&&(n+=10,r.push("no-reply")),!e.firstResponseAt&&e.lastActivityPreview?.direction==="inbound"&&(n+=10,r.push("awaiting-reply")),(e.tags?.some(l=>l==="marketing"||l==="automated")||An(e.remoteParty?.resource,e.lastActivityPreview?.snippet))&&(n-=wn,r.push("bulk")),{score:n,reasons:r}}const Fi=e=>!!e.assignedUserId||!!e.assignedInboxId,Bi=e=>e.status==="closed",Hi=e=>({urgent:10,high:5,normal:2,low:1})[e.priority]||0,Wi=(e,t=30)=>e.title?.length<=t?e.title:`${e.title.substring(0,t)}...`;function Gi(e,t){const n=e.labels??[];return n.find(r=>r.locale===t)?.label??n[0]?.label??e.url}function Vi(e,t,n){const r=e.translations??[];return r.find(o=>o.locale===t)??(n?r.find(o=>o.locale===n):void 0)??{locale:t}}const $e=[{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 Un(e){const t=(e??"").toLowerCase();return $e.find(n=>n.code===t)??$e.find(n=>n.code===t.split("-")[0])}function ji(e){return Un(e)?.label??e}function Yi(e){const t=Un(e);return t?t.english===t.label?`${t.english} (${t.code})`:`${t.english} — ${t.label} (${t.code})`:e}const nt=3;function $n(e,t){const n=new Set;let r=1,o=t.get(e)?.parentId;for(;o;){if(n.has(o)||(n.add(o),r++,r>nt+1))return 1/0;o=t.get(o)?.parentId}return r}function Xi(e,t,n){if(!e)return!0;if(e===t)return!1;const r=new Map(n.map(s=>[s.id,s]));if(!r.has(e)||t&&Kn(e,t,r))return!1;const o=$n(e,r),i=t?rt(t,n):1;return o+i<=nt}function Kn(e,t,n){const r=new Set;let o=n.get(e)?.parentId;for(;o;){if(o===t)return!0;if(r.has(o))return!1;r.add(o),o=n.get(o)?.parentId}return!1}function rt(e,t,n=new Set){if(n.has(e))return 1;n.add(e);const r=t.filter(o=>o.parentId===e);return r.length?1+Math.max(...r.map(o=>rt(o.id,t,n))):1}const Fn="en";function Bn(e){return e.defaultLocale||e.locale||Fn}function zi(e){const t=new Set,n=[];for(const r of[Bn(e),...e.locales??[]])!r||t.has(r)||(t.add(r),n.push(r));return n}function qi(e,t,n){const r=e.translations??[];return r.find(o=>o.locale===t)?.name??(n?r.find(o=>o.locale===n)?.name:void 0)??e.name}const Ke=["lookup","condition","parallel","for-each"];function Fe(e){for(const t of e){if(!Ke.includes(t.type))return`staptype "${t.type}" mag niet meelezen (alleen ${Ke.join(", ")})`;if(t.type==="parallel")for(const n of t.branches??[]){const r=Fe(n);if(r)return r}if(t.type==="for-each"){const n=Fe(t.body??[]);if(n)return n}}return null}function Ji(e,t){switch(e.kind){case"org":return!0;case"team":return!!t.teamId&&e.teamId===t.teamId;case"personal":return e.userId===t.userId}}function Zi(e,t){return e.filter(n=>n.enabled&&Ji(n.ownerScope,t))}function Qi(e){return e.credentialScope?e.credentialScope:(e.authMode??"header")==="header"||e.oauth?.scope==="org"?"shared":"per-user"}function es(e){return`mcp__${e}__`}const ts=1e3,ns=2e3,rs=500,os=12e3,is=4e3,Hn=["contact","company","work_item"];function ss(e){if(!e)return!1;const t=e.slice(0,e.indexOf(":"));return Hn.includes(t)}const as="onboarding-source",cs=["support","billing","availability","sales","onboarding"],ls=["keep","replace"],Se=[{key:"shift",label:"kind_shift",capacity:!0,productive:!1,absent:!1,icon:"calendar-clock"},{key:"allocation",label:"kind_allocation",capacity:!1,productive:!0,absent:!1,icon:"briefcase"},{key:"meeting",label:"kind_meeting",capacity:!1,productive:!1,absent:!1,icon:"users"},{key:"travel",label:"kind_travel",capacity:!1,productive:!1,absent:!1,icon:"car"},{key:"training",label:"kind_training",capacity:!1,productive:!1,absent:!1,icon:"graduation-cap"},{key:"break",label:"kind_break",capacity:!1,productive:!1,absent:!1,icon:"coffee"},{key:"absence",label:"kind_absence",capacity:!1,productive:!1,absent:!0,approvable:!0,icon:"palmtree"},{key:"sick",label:"kind_sick",capacity:!1,productive:!1,absent:!0,icon:"thermometer"},{key:"holiday",label:"kind_holiday",capacity:!1,productive:!1,absent:!0,icon:"party-popper"}],Wn={key:"unknown",label:"kind_unknown",capacity:!1,productive:!1,absent:!1};function N(e,t=Se){return t.find(n=>n.key===e)??{...Wn,key:e}}function B(e){return e==="published"||e==="approved"}function ot(e,t,n=Se){if(e.workstreamId!==t)return!1;const r=N(e.kindKey,n);return r.absent?!1:r.productive||r.capacity}function us(e,t=Se){if(!e.userId||!B(e.status))return!1;const n=N(e.kindKey,t);return n.capacity||n.productive||n.absent}const ds=864e5;function Gn(e,t){return Math.round((t-e)/ds)}function it(e,t){const n=e.cycleMinutes.length;return n===0?0:(Gn(e.anchor,t)%n+n)%n}function st(e,t){return e.effectiveFrom!==void 0&&t<e.effectiveFrom?0:e.cycleMinutes[it(e,t)]??0}function at(e,t){return e.startTimes?.[it(e,t)]}function ct(e,t,n,r){const o=e.filter(a=>a.effectiveFrom===void 0||a.effectiveFrom<=r),i=a=>a.sort((l,u)=>(u.effectiveFrom??0)-(l.effectiveFrom??0))[0],s=i(o.filter(a=>a.userId===t));return s||i(o.filter(a=>!a.userId&&a.teamId&&n.includes(a.teamId)))}function Vn(e,t,n){return e.filter(r=>r.userId===t&&(r.effectiveFrom===void 0||r.effectiveFrom<=n)).sort((r,o)=>(o.effectiveFrom??0)-(r.effectiveFrom??0))[0]}const Be=864e5;function ps(e){const t=Math.max(1,Math.round((e.to-e.from)/Be));return Array.from({length:t},(n,r)=>e.from+r*Be)}function He(e,t,n,r){const o=Math.min(t,r)-Math.max(e,n);return o>0?o/1e3:0}const wt={interval:0,day:1,week:2};function fs(e,t){const{entries:n,patterns:r=[],terms:o=[]}=t,i=n.filter(c=>c.userId&&B(c.status)&&N(c.kindKey).capacity),s=n.filter(c=>c.userId&&B(c.status)&&N(c.kindKey).absent),a=t.userIds??[...new Set([...i.map(c=>c.userId),...r.map(c=>c.userId),...o.map(c=>c.userId)])].filter(c=>!!c),l={};let u="interval";const p=c=>{wt[c]>wt[u]&&(u=c)};for(const c of a){const d=t.teamIdsOf?.(c)??[];let m=0,S=0,g=0;for(const f of ps(e)){const A=Math.max(f,e.from),v=Math.min(f+Be,e.to);g++;const C=i.filter(O=>O.userId===c).reduce((O,yt)=>O+He(yt.start,yt.end,A,v),0);if(C>0){m+=C;continue}const w=ct(r,c,d,f),k=w?st(w,f):0;if(w&&k>0){m+=k*60,p(at(w,f)?"interval":"day");continue}w||S++}if(S>0){const f=Vn(o,c,e.from);f&&(m+=f.weeklyMinutes*60*(S/7),p("week"))}const T=s.filter(f=>f.userId===c).reduce((f,A)=>f+He(A.start,A.end,e.from,e.to),0),h=Math.max(0,m-T);(h>0||g>0)&&(l[c]=h)}return{seconds:Object.values(l).reduce((c,d)=>c+d,0),precision:u,byUser:l}}function ms(e,t){if(!e.some(a=>a.userId))return[];const n="",r=new Map;for(const a of e){const l=a.userId??n;r.set(l,(r.get(l)??0)+a.seconds)}const i=[...new Set([...Object.keys(t.byUser),...[...r.keys()].filter(a=>a!==n)])].map(a=>{const l=r.get(a)??0,u=t.byUser[a]??0;return{userId:a,requiredSeconds:l,capacitySeconds:u,netSeconds:u-l}});i.sort((a,l)=>a.netSeconds-l.netSeconds);const s=r.get(n)??0;return s>0&&i.push({requiredSeconds:s,capacitySeconds:0,netSeconds:-s}),i}function hs(e,t,n,r){const o=e.filter(s=>s.userId&&B(s.status)&&!N(s.kindKey).absent),i=Object.entries(r.byUser).map(([s,a])=>{let l=0,u=0;for(const p of o){if(p.userId!==s||N(p.kindKey).capacity&&!p.workstreamId)continue;const c=He(p.start,p.end,n.from,n.to);c<=0||(ot(p,t)?l+=c:u+=c)}return{userId:s,capacitySeconds:a,onThisSeconds:l,elsewhereSeconds:u,freeSeconds:Math.max(0,a-l-u)}});return i.sort((s,a)=>a.freeSeconds-s.freeSeconds),i}const gs="demand-source",Rt=1e3;function Es(e,t){let n=1;for(let r=1;r<=e;r++)n=t*n/(r+t*n);return n}function jn(e,t){if(e<=0)return 1;if(t<=0)return 0;if(e<=t)return 1;const n=Es(e,t),r=t/e;return n/(1-r*(1-n))}function Yn(e,t,n,r){return r<=0?1:e<=t?0:1-jn(e,t)*Math.exp(-(e-t)*n/r)}function Xn(e,t,n){return n<=0?0:e*t/n}function zn(e,t,n,r){if(e<=0||t<=0)return 0;const o=Xn(e,t,n);if(o<=0)return 0;const i=r.serviceLevelPercent/100,s=r.maxOccupancyPercent?r.maxOccupancyPercent/100:void 0;for(let a=Math.max(1,Math.ceil(o));a<=Rt;a++)if(!(a<=o)&&!(Yn(a,o,r.targetSeconds,t)<i)&&!(s&&o/a>s))return a;return Rt}const ys=36e5,_s=864e5;function Ss(e){return e==="day"?_s:ys}function As(e,t){return e.start<t.end&&t.start<e.end}function te(e,t,n){const r=Math.min(e.end,n)-Math.max(e.start,t);return r>0?r/1e3:0}function qn(e,t,n){const r=e.handleSeconds??0,o=e.seconds??(e.volume!==void 0?e.volume*r:0);if(o<=0&&!e.volume)return{seconds:0,headcount:0};const i=(t.unplannedLossPercent??0)/100,s=i>0&&i<1?1/(1-i):1;if(t.model==="queue"&&e.volume!==void 0&&r>0){const a=zn(e.volume,r,n,t);return{seconds:o,headcount:a*s}}return{seconds:o,headcount:o/n*s}}function bs(e){const{entries:t,workstreamId:n,staffing:r,demand:o,range:i}=e,s=e.grain??"hour",a=Ss(s),l=a/1e3,u=e.kinds,p=t.filter(g=>B(g.status)),c=p.filter(g=>ot(g,n,u)),d=p.filter(g=>N(g.kindKey,u).capacity),m=p.filter(g=>N(g.kindKey,u).absent),S=[];for(let g=F(i.from,s);g<i.to;g+=a){const T=g+a,h=K(g,s);let f=0;for(const O of c)f+=te(O,g,T);let A=0;for(const O of d)A+=te(O,g,T);let v=0;for(const O of m)v+=te(O,g,T);const C=o?.[h]??{},w=qn(C,r,l),k=f/l;S.push({period:h,forecastVolume:C.volume,requiredSeconds:w.seconds,requiredHeadcount:w.headcount,scheduledSeconds:f,scheduledHeadcount:k,netHeadcount:k-w.headcount,capacitySeconds:A,absentSeconds:v})}return S}function Jn(e,t){return e.workTypeKey??t?.defaultWorkTypeKey}function Ts(e,t,n){const r=Jn(e,t);return r?n.find(o=>o.key===r)?.defaultBillable??!1:!1}function Is(e){return e.filter(t=>t.netHeadcount<0&&t.requiredHeadcount>0)}const Ms=36e5,We=6048e5,Zn=8,Os=.5,ws=2;function Rs(e){const t=Number(e.slice(0,4)),n=Number(e.slice(5,7)),r=Number(e.slice(8,10)),o=e.length>10?Number(e.slice(11,13)):0;return Date.UTC(t,n-1,r,o)}function Cs(e,t,n){const r=[];for(let i=0;i<n;i++){const s=t-i*We,a=s-We;let l=0,u=!1;for(const[p,c]of e)p>=a&&p<s&&(l+=c,u=!0);u&&r.push(l)}if(r.length<2)return 1;const o=r.reduce((i,s)=>i+s,0)/r.length;return o<=0?1:Math.min(ws,Math.max(Os,r[0]/o))}function ks(e,t){if(!e?.length)return;let n;for(const r of e)t>=r.from&&t<r.to&&(n=r);return n}function Ns(e,t,n){const r=Math.max(1,n?.weeks??Zn),o=new Map,i=new Set;for(const l of e)o.set(Rs(l.period),l.value),i.add(l.period.slice(0,10));const s=Cs(o,F(t.from,"hour"),r),a=[];for(let l=F(t.from,"hour");l<t.to;l+=Ms){let u=0,p=0;for(let m=1;m<=r;m++){const S=l-m*We,T=o.get(S)??(i.has(K(S,"day"))?0:void 0);if(T===void 0)continue;const h=r-m+1;u+=T*h,p+=h}let c=p>0?u/p*s:0;const d=ks(n?.adjustments,l);d?.absoluteVolume!==void 0?c=d.absoluteVolume:d?.factor!==void 0&&(c*=d.factor),a.push({period:K(l,"hour"),volume:c})}return a}const Qn="schedule_entry",er="workstream";function vs(e){return`${Qn}:${e}`}function Ds(e){return`${er}:${e}`}const Ge=36e5,$=864e5;function xs(e,t){const n=t==="day"?$:Ge,r=[];for(let o=F(e.from,t);o<e.to;o+=n)r.push(o);return r}function Ct(e){const t=Math.max(1,Math.round((e.to-e.from)/$));return Array.from({length:t},(n,r)=>e.from+r*$)}function Ne(e,t,n,r){const o=Math.min(t,r)-Math.max(e,n);return o>0?o/1e3:0}function Ls(e,t,n={}){const r=n.grain??"hour",o=xs(t,r),i=r==="day"?$:Ge,s=new Map(o.map(c=>[c,0])),a=e.filter(c=>c.userId&&N(c.kindKey).capacity),l=n.userIds?.length?new Set(n.userIds):null,u=new Set;for(const c of a)if(!(l&&c.userId&&!l.has(c.userId))){for(const d of o){const m=Ne(c.start,c.end,d,d+i);m>0&&s.set(d,(s.get(d)??0)+m)}for(const d of Ct(t))Ne(c.start,c.end,d,d+$)>0&&u.add(`${c.userId}:${d}`)}const p=n.userIds??[...new Set([...a.map(c=>c.userId),...(n.patterns??[]).map(c=>c.userId)])].filter(c=>!!c);if(n.patterns?.length)for(const c of p){const d=n.teamIdsOf?.(c)??[];for(const m of Ct(t)){if(u.has(`${c}:${m}`))continue;const S=ct(n.patterns,c,d,m);if(!S)continue;const g=st(S,m);if(g<=0)continue;const T=at(S,m);if(T){const[A,v]=T.split(":").map(Number),C=m+A*Ge+(v??0)*6e4,w=C+g*6e4;for(const k of o){const O=Ne(C,w,k,k+i);O>0&&s.set(k,(s.get(k)??0)+O)}continue}const h=o.filter(A=>A>=m&&A<m+$);if(!h.length)continue;const f=g*60/h.length;for(const A of h)s.set(A,(s.get(A)??0)+f)}}return o.map(c=>({period:K(c,r),weight:s.get(c)??0}))}function tr(e,t){if(e<=0||!t.length)return[];const n=t.reduce((r,o)=>r+Math.max(0,o.weight),0);if(n<=0){const r=e/t.length;return t.map(o=>({period:o.period,seconds:r}))}return t.filter(r=>r.weight>0).map(r=>({period:r.period,seconds:e*r.weight/n}))}function Ps(e,t,n){const r=new Map;for(const o of e){const i=o.by?t.filter(a=>n(a.period)<o.by):t,s=i.length?i:t;for(const a of tr(o.seconds,s)){const l=`${a.period}|${o.userId??""}`,u=r.get(l);u?u.seconds+=a.seconds:r.set(l,{...a,userId:o.userId})}}return[...r.values()].sort((o,i)=>o.period.localeCompare(i.period)||(o.userId??"").localeCompare(i.userId??""))}function nr(e){switch(e.kind){case"user":return`user:${e.userId}`;case"team":return`team:${e.teamId}`;case"org":return"org"}}function Us(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 r=t.slice(0,n),o=t.slice(n+1).trim();if(o){if(r==="user")return{kind:"user",userId:o};if(r==="team")return{kind:"team",teamId:o}}}function rr(e){return nr(e)}function or(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"}}}const ir=or;function $s(e){return e.agentId?{kind:"user",userId:e.agentId}:ir(e.ownerScope)}function Ks(e){return rr(e)}function Fs(e,t){if(!t)return;let n=e;for(const r of t.split(".")){if(n===null||typeof n!="object")return;n=n[r]}return n}function Bs(e,t){return e.targets.find(n=>n.activityTypes.includes(t))}function Hs(e,t){if(t)return e.targets.find(n=>n.id===t)}function sr(e){return e?.kind==="assignment"}function Ws(e){const{trigger:t,agentId:n,target:r,activityType:o,assigneeUserId:i,authorUserId:s}=e;return sr(t)?n?r?r.activityTypes.includes(o)?i?i!==n?"assigned to someone else":s&&s===n?"the agent assigned this to itself, which would restart its own run":null:`no assignee found at ${r.assigneePath}`:`activity type ${o} does not announce an assignment for ${r.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"}function Gs(e){return(e.startsWith("tool:")?e.slice(5):e).replace(/__/g," · ").replace(/\./g," · ").replace(/_/g," ")}const Vs=[{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:"itemId",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:"toCategory",type:"string"},{name:"contactId",type:"string"},{name:"companyId",type:"string"},{name:"priority",type:"string"},{name:"inboxId",type:"string"},{name:"topicId",type:"string"},{name:"assigneeUserId",type:"string"}],js={topics:[{name:"topicId",type:"string"},{name:"topic",type:"string"},{name:"confidence",type:"number"},{name:"reasoning",type:"string"}],question:[{name:"answer",type:"boolean"},{name:"reasoning",type:"string"}],extract:[]};function ar(e){return`${e.type}:${e.id}`}const cr="interaction";function lr(e){return e?.type===cr?e.id:void 0}const ur=64,dr=8e3;function Ys(e){const t=typeof e=="number"?e:Number(String(e??"").trim());if(!(!Number.isFinite(t)||t<=0))return Math.min(Math.max(Math.round(t),ur),dr)}const Xs={kind:"workflow",steps:[]};function zs(e){return e?.kind==="workflow"?e.steps:[]}function qs(e){return e?.kind==="procedure"?e.procedure:void 0}function pr(e){const t=e?.approved??0,n=t+(e?.rejected??0);return{total:n,rate:n?t/n:0}}const fr=10,mr=.9;function Js(e){const{total:t,rate:n}=pr(e);return t>=fr&&n>=mr}const hr=["done","escalated","failed","stopped"];function Zs(e){return hr.includes(e)}function gr(e){return e==="waiting"}function Qs(e){return e==="running"||gr(e)}function lt(e){return e.subjectKind&&e.subjectId?{type:e.subjectKind,id:e.subjectId}:void 0}function ea(e){const t=lt(e);return t?ar(t):void 0}function ta(e){return lr(lt(e))}function na(e){const t=[],n=new Map;for(const r of[...e].sort(ra)){const o=n.get(r.emoji);if(o){o.push(r.actor);continue}t.push(r.emoji),n.set(r.emoji,[r.actor])}return t.map(r=>{const o=n.get(r);return{emoji:r,count:o.length,actors:o}}).sort((r,o)=>o.count-r.count||t.indexOf(r.emoji)-t.indexOf(o.emoji))}const ra=(e,t)=>(e.createdAt??0)-(t.createdAt??0);function oa(e,t){return t?e.actors.some(n=>n.type==="user"&&n.id===t):!1}const Ve=6e4,ia=36e5,j=864e5,Er=800;function kt(e,t){const n=Date.UTC(e,t+1,0);return n-new Date(n).getUTCDay()*j+ia}function sa(e){const t=new Date(e).getUTCFullYear();return e>=kt(t,2)&&e<kt(t,9)}function yr(e,t){const n=t.dst==="eu"&&sa(e)?60:0;return(t.utcOffsetMinutes+n)*Ve}function aa(e){return(e+3)%7+1}function _r(e,t){const n=yr(e,t),r=e+n,o=Math.floor(r/j);if(!t.days.includes(aa(o)))return null;const i=o*j;return{open:i+t.fromMinutes*Ve-n,close:i+t.toMinutes*Ve-n}}function Sr(e,t){const n=yr(e,t),r=e+n;return(Math.floor(r/j)+1)*j-n}function pe(e,t,n){if(t<=e)return 0;if(!n)return t-e;let r=0,o=e;for(let i=0;i<Er&&o<t;i++){const s=_r(o,n);if(s){const a=Math.max(o,s.open),l=Math.min(t,s.close);l>a&&(r+=l-a)}o=Sr(o,n)}return r}function Ae(e,t,n){if(!n)return e+t;let r=t,o=e;for(let i=0;i<Er;i++){const s=_r(o,n);if(s){const a=Math.max(o,s.open);if(s.close>a){const l=s.close-a;if(r<=l)return a+r;r-=l}}o=Sr(o,n)}return e+t}function ca(e){const t=/^([01]\d|2[0-3]):([0-5]\d)$/.exec(e);return t?Number(t[1])*60+Number(t[2]):null}const fe=1,me=2;function la(e){return e==="snoozed"?fe:me}function be(e){const t=e.calendar;return t&&Array.isArray(t.days)?t:null}const ua=["speed_of_answer","first_response","next_response","resolution","close"],da=["snoozed","waiting_for_customer"],pa=6e4,Ar=["speed_of_answer","first_response","next_response"],fa=[...Ar,"resolution","close"];function X(e){return e.state==="running"||e.state==="paused"}function ma(e,t){return X(e)?{state:(e.state==="paused"?e.remainingMs>0:t<=e.dueAt)?"hit":"missed",settledAt:Math.max(t,e.startedAt)}:null}function Nt(e){return X(e)?{state:"void"}:null}function ha(e,t,n,r){if(!X(e)||(e.pauseBits&t)!==0)return null;const o=e.pauseBits|t;return e.state==="paused"?{pauseBits:o}:{pauseBits:o,state:"paused",remainingMs:pe(n,e.dueAt,r)}}function ga(e,t,n,r){if(!X(e)||(e.pauseBits&t)===0)return null;const o=e.pauseBits&~t;return o!==0?{pauseBits:o}:{pauseBits:o,state:"running",dueAt:Ae(n,e.remainingMs,r)}}function Ea({event:e,at:t,now:n,clocks:r,profile:o}){const i=be(o),s=Math.min(t,n),a=r.map(h=>({...h})),l=[],u=(h,f)=>{f&&(l.push({op:"patch",clockId:h.id,patch:f}),Object.assign(h,f))},p=h=>{for(const f of a)f.metric===h&&u(f,ma(f,s))},c=h=>{for(const f of a)h.includes(f.metric)&&u(f,Nt(f))},d=h=>{for(const f of a)u(f,ha(f,h,s,i))},m=h=>{for(const f of a)u(f,ga(f,h,s,i))},S=h=>a.reduce((f,A)=>A.metric===h?Math.max(f,A.attempt):f,0)+1,g=h=>a.some(f=>f.metric===h&&X(f)),T=(h,f)=>{const A=o.targets.find(C=>C.metric===h);if(!A)return;const v=A.minutes*pa;l.push({op:"start",metric:h,attempt:S(h),startedAt:f,targetMs:v,dueAt:Ae(f,v,i)})};switch(e){case"apply":{for(const h of a)h.profileId!==o.id&&u(h,Nt(h));for(const h of o.targets){if(h.metric==="next_response")continue;a.some(A=>A.metric===h.metric&&A.profileId===o.id)||T(h.metric,s)}break}case"answered":p("speed_of_answer");break;case"outbound":{p("first_response"),p("next_response"),o.pauseOn.includes("waiting_for_customer")&&d(me);break}case"inbound":{m(me),!g("first_response")&&!g("next_response")&&T("next_response",s);break}case"resolved":p("resolution");break;case"closed":p("close"),p("resolution"),c(Ar);break;case"reopened":g("resolution")||T("resolution",s),g("close")||T("close",s);break;case"snoozed":o.pauseOn.includes("snoozed")&&d(fe);break;case"unsnoozed":m(fe);break;case"discarded":c(fa);break}return l}function br(e){return e.state==="running"||e.state==="paused"}function he(e,t){const n=be(e);return e.state==="paused"?e.remainingMs:t>=e.dueAt?-pe(e.dueAt,t,n):pe(t,e.dueAt,n)}function ya(e,t){return e.state==="paused"?Ae(t,e.remainingMs,be(e)):e.dueAt}function _a(e,t){const n=e.filter(br);if(!n.length)return;const r=n.filter(i=>i.state==="running");return(r.length?r:n).reduce((i,s)=>he(s,t)<he(i,t)?s:i)}function Sa(e,t){if(e.state==="missed")return"breached";if(e.state==="hit")return"met";if(e.state==="paused")return"paused";if(e.state==="void")return"met";const n=he(e,t);return n<=0?"breached":n<=e.targetMs/5?"urgent":"running"}function Aa(e){const t=Math.floor(Math.abs(e)/1e3),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),o=Math.floor(t%3600/60);return n?r?`${n}d ${r}u`:`${n}d`:r?o?`${r}u ${o}m`:`${r}u`:o?`${o}m`:`${t%60}s`}const Tr="strategy_item";function ut(e){return`${Tr}:${e}`}function ba(e,t=25){const n=new Set([ut(e.id)]);for(const r of e.ancestorKeys??[])n.add(r);return Array.from(n).slice(0,t)}function Ta(e){return e?[...e.ancestorKeys??[],ut(e.id)]:[]}const z=[{key:"area",label:"level_area",order:10,measurable:!1,icon:"compass"},{key:"objective",label:"level_objective",order:20,measurable:!0,icon:"target"},{key:"key_result",label:"level_key_result",order:30,measurable:!0,icon:"gauge"}],Ir=999,Mr=7;function Or(e,t=z){return t.find(n=>n.key===e)}function ge(e,t=z){return Or(e,t)?.order??Ir}function Ia(e,t,n=z){return ge(t,n)<=ge(e,n)}function Ma(e,t=z){const n=ge(e,t);return t.filter(o=>o.order>n).sort((o,i)=>o.order-i.order)[0]?.key??e}function Oa(e){const t=e.trim().toLowerCase();return t?t.includes("key result")||t.includes("keyresult")||t==="kr"?"key_result":t.includes("objective")||t.includes("goal")||t.includes("doel")?"objective":t.includes("focus")||t.includes("area")||t.includes("theme")?"area":null:null}const je={pending:"open",on_track:"open",at_risk:"open",off_track:"open",paused:"paused",achieved:"closed",missed:"closed"};function wa(e){return je[e]??"open"}function Ra(e){return Object.keys(je).filter(t=>e.includes(je[t]))}const Ca=864e5,Te=e=>e<=0?0:e>1?1:e;function ka(e,t){const{direction:n}=e,r=e.startValue??0,o=e.targetValue??0;if(!Number.isFinite(t))return 0;const i=n==="down"?t<=o:t>=o,s=o-r;return(n==="down"?s<0:s>0)?Te((t-r)/s):i?1:0}function Na(e,t){const{startDate:n,targetDate:r}=e;if(!(typeof n!="number"||typeof r!="number")&&!(r<=n))return Te((t-n)/(r-n))}const wr=.1,Rr=.25;function va(e,t){if(typeof e!="number"||typeof t!="number")return;if(e>=1)return"achieved";const n=t-e;return n>=Rr?"off_track":n>=wr?"at_risk":"on_track"}function Da(e,t){if(t)return Te(e/t)}function xa(e){const t=e.map(n=>n.progress?.ratio).filter(n=>typeof n=="number"&&Number.isFinite(n));if(t.length)return Te(t.reduce((n,r)=>n+r,0)/t.length)}function La(e,t){const n=e.lastCheckInAt??e.createdAt;if(typeof n!="number")return 0;const r=(e.checkInEveryDays??Mr)*Ca,o=t-n-r;return o>0?o:0}function Pa(e){return e.targetDate??Number.MAX_SAFE_INTEGER}function Ua(e,t){const n=e.accumulatedSeconds||0;return e.runningSince?n+Math.max(0,Math.floor((t-e.runningSince)/1e3)):n}function $a(e,t){const n=Math.max(1,Math.ceil(Math.max(0,e)/60));if(!t||t==="exact")return n*60;const r=Number(t);return!Number.isFinite(r)||r<=0?n*60:Math.ceil(n/r)*r*60}function Ka(e){const t=Math.max(0,Math.round(e/60));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function Fa(e){const t=Math.max(0,Math.floor(e)),n=i=>String(i).padStart(2,"0"),r=Math.floor(t/60)%60,o=Math.floor(t/3600);return o>0?`${o}:${n(r)}:${n(t%60)}`:`${n(r)}:${n(t%60)}`}function Cr(e){return(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").slice(0,48).replace(/^-+|-+$/g,"")}function Ba(e,t){const n=Cr(e)||"werksoort",r=new Set(t);if(!r.has(n))return n;for(let o=2;o<500;o++){const i=`${n}-${o}`;if(!r.has(i))return i}return`${n}-${r.size+1}`}function Ha(e,t){const n=e.ownerScope;return!n||n.kind==="org"?!0:t.includes(n.teamId)}function Wa(e){return e.filter(t=>!t.archived).sort(kr)}function kr(e,t){const n=(e.order??0)-(t.order??0);return n!==0?n:(e.label||"").localeCompare(t.label||"")}const Nr=20,vr=20,ne=300;function L(e){return e.toLowerCase().replace(/[^\p{L}\p{N}\s]/gu," ").replace(/\s+/g," ").trim()}function Dr(e){const t=e.replace(/\s+/g," ").trim();if(t.length<=ne)return t;const n=t.slice(0,ne),r=Math.max(n.lastIndexOf(". "),n.lastIndexOf("! "),n.lastIndexOf("? "));return r>ne*.6?n.slice(0,r+1):`${n.trimEnd()}…`}function Ga(e,t){const n=Dr(t.text),r=L(n);if(!r||(e.examples??[]).some(s=>L(s)===r))return null;const o=e.exampleCandidates??[],i=o.findIndex(s=>L(s.text)===r);if(i>=0){if(o[i].corrected||!t.corrected)return null;const s=[...o];return s[i]={...s[i],corrected:!0,addedAt:t.addedAt},vt(s)}return vt([{...t,text:n},...o]).slice(0,vr)}function vt(e){return[...e].sort((t,n)=>Number(n.corrected)-Number(t.corrected)||n.addedAt-t.addedAt)}function Va(e,t){const n=L(t),r=(e.examples??[]).filter(i=>i.trim());return{examples:r.some(i=>L(i)===n)?r:[...r,t].slice(-Nr),exampleCandidates:xr(e,t)}}function xr(e,t){const n=L(t);return(e.exampleCandidates??[]).filter(r=>L(r.text)!==n)}function Lr(e,t){const n=e.ownerScope;return n?n.kind==="org"?!0:n.kind==="team"?!!t&&n.teamId===t:!1:!1}function ja(e,t){return e.filter(n=>Lr(n,t))}function Ya(e){return e.type==="agent"}const Xa="WORK_COMMENT_ADDED",za="WORK_ITEM_ASSIGNED",qa="WORK_ITEM_STATUS_CHANGED";function Ja(e,t){const n=r=>{const o=new Date(r);return o.setHours(0,0,0,0),o.getTime()};return Math.round((n(e)-n(t))/_n)}function Za(e,t){if(e.closedAt!=null)return{score:x,reasons:[]};const n=t.remindersById?.[e.id];if(n&&n.remindAt>t.now)return{score:x,reasons:[]};let r=0;const o=[],i=e.priority??"normal";if(V[i]>0&&(r+=V[i],o.push(`priority:${i}`)),typeof e.dueDate=="number"){const s=Ja(e.dueDate,t.now);s<0?(r+=35,o.push("overdue")):s===0&&(r+=20,o.push("due-today"))}return e.source?.initiator==="system"&&e.source.systemReason&&(r+=15,o.push(`auto:${e.source.systemReason}`)),{score:r,reasons:o}}const Ie=[{key:"task",label:"type_task"},{key:"bug",label:"type_bug"},{key:"story",label:"type_story"},{key:"epic",label:"type_epic"},{key:"subtask",label:"type_subtask"},{key:"case",label:"type_case"},{key:"deal",label:"type_deal"}],Qa=Ie.map(e=>e.key);function ec(e){return e?.types?.length?e.types:Ie}function tc(e,t){return t.find(n=>n.key===e)}function nc(e){const t=e.trim().toLowerCase();return t?t.includes("sub-task")||t.includes("subtask")||t.includes("sub task")?"subtask":t.includes("bug")||t.includes("defect")?"bug":t.includes("epic")?"epic":t.includes("story")?"story":t.includes("incident")||t.includes("problem")||t.includes("service request")||t.includes("change")?"case":t.includes("task")?"task":null:null}function rc(...e){return e.map(t=>Ie.find(n=>n.key===t)).filter(t=>!!t)}const Pr="work_item",Ur="work_project",$r="work_activity",oc="work_cycle";function Kr(e){return`${Pr}:${e}`}function dt(e){return`${Ur}:${e}`}function ic(e){return`${$r}:${e}`}function sc(e,t,n){const r=`${e}-${t}`;return n?`${r}-${n}`:r}function ac(e){const t=/^([A-Za-z0-9]{2,8})-(\d+)(?:-(\d+))?$/.exec((e||"").trim());return t?{projectKey:t[1].toUpperCase(),sequenceNumber:Number(t[2]),...t[3]?{subSequence:Number(t[3])}:{}}:null}function cc(e){return(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,3)||"PRJ"}function lc(e,t=25){const n=new Set([Kr(e.id)]);e.projectId&&n.add(dt(e.projectId));for(const r of e.ancestorKeys??[])n.add(r);for(const r of e.partyKeys??[])n.add(r);return Array.from(n).slice(0,t)}function uc(e){return[dt(e.id)]}const Me=[{key:"open",label:"status_open",category:"todo",order:0},{key:"in_progress",label:"status_in_progress",category:"in_progress",order:1},{key:"done",label:"status_done",category:"done",order:2},{key:"cancelled",label:"status_cancelled",category:"done",order:3}],pt=Me.map(e=>e.key);function Fr(e){return e?.statuses?.length?e.statuses:Me}function Br(e,t){return t.find(n=>n.key===e)?.category??"todo"}function dc(e,t){return t.find(n=>n.key===e)}function pc(e){const t=Fr(e),n=e?.defaultStatusKey;return n&&t.some(r=>r.key===n)?n:Hr(t)[0]?.key??Me[0].key}function Hr(e){return[...e].sort((t,n)=>{const r=(t.order??0)-(n.order??0);return r!==0?r:(t.label||"").localeCompare(n.label||"")})}function fc(e,t){return Br(e,t)==="done"}function Wr(e){return(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").slice(0,48).replace(/^-+|-+$/g,"")}function mc(e,t){const n=Wr(e)||"status",r=new Set([...t,...pt]);if(!r.has(n))return n;for(let o=2;o<500;o++){const i=`${n}-${o}`;if(!r.has(i))return i}return`${n}-${r.size+1}`}function hc(e){const t=[];if(!e.length)return[{index:-1,reason:"empty"}];const n=new Set;return e.forEach((r,o)=>{if(!r.key){t.push({index:o,reason:"missing_key"});return}pt.includes(r.key)&&t.push({index:o,reason:"reserved_key",key:r.key}),n.has(r.key)&&t.push({index:o,reason:"duplicate_key",key:r.key}),n.add(r.key)}),e.some(r=>r.category==="todo"||r.category==="in_progress")||t.push({index:-1,reason:"no_open"}),e.some(r=>r.category==="done")||t.push({index:-1,reason:"no_done"}),t}function gc(e){return e.startDate??Number.MAX_SAFE_INTEGER}function Ec(e){return e.completedAt?"completed":e.startedAt?"active":"planned"}const yc=new Set(["image/png","image/jpeg","image/jpg","image/gif","image/webp"]),_c=new Set(["text/plain","text/markdown","text/csv","application/json","text/html","application/xml","text/xml"]);function Gr(e){const t=(e??"").trim().toLowerCase().split(";")[0];return t?yc.has(t)?"image":t==="application/pdf"?"pdf":_c.has(t)?"text":t.startsWith("audio/")?"audio":"unsupported":"unsupported"}const W=1024*1024,Vr={image:5*W,pdf:20*W,text:1*W,audio:20*W},Sc=25*W,Ac=5;function bc(e,t){const n=Gr(e);return n==="unsupported"?"unsupported":t>Vr[n]?"too-large":null}function Tc(e){return e.access!=="read"&&e.effect!=="internal"}function jr(e){return`${e.kind}:${e.id||e.url||e.title}`}function Ic(e,t=[]){const n=new Set(t),r=[],o=[];for(const i of e){const s=jr(i);n.has(s)||(n.add(s),r.push(i),o.push(s))}return{sources:r,keys:o}}const Mc="assist-source",Oc=["blocking","due","open"];function wc(e,t){const[n,r]=(e.subjectKey??"").split(":");return n===t&&r?r:void 0}const Dt={blocking:0,due:1,open:2};function Rc(e,t){return Dt[e.band??"open"]-Dt[t.band??"open"]||(t.priority??0)-(e.priority??0)||e.id.localeCompare(t.id)}function Cc(e){return e.sessions.filter(t=>t.id!==e.exceptSessionId&&t.state==="connected"&&e.canHold(t.providerId))}function kc(e){return e.sessions.filter(t=>t.id!==e.exceptSessionId&&t.state==="connected"&&!e.canHold(t.providerId))}function Nc(e){return e.sessions.some(n=>n.id!==e.exceptSessionId&&(n.state==="connected"||n.state==="on_hold"))?{admit:!1,reason:"busy"}:{admit:!0}}function Yr(e,t){const n=new Set(e.disabledIntents??[]),r=e.intentOverrides??{},o=t.intents.filter(s=>!n.has(s.intent)).map(s=>Dc(s,r[s.intent]));if(!e.extraIntents||e.extraIntents.length===0)return o;const i=new Set(o.map(s=>s.intent));for(const s of e.extraIntents)i.has(s.intent)||(o.push(s),i.add(s.intent));return o}function Xr(e,t){const n={};for(const r of e.intents){if(!r.togglable)continue;const o=t?.[r.intent];n[r.intent]=o??r.defaultEnabled??!0}return n}function vc(e,t){const n=Xr(e,t);return Object.entries(n).filter(([,r])=>!r).map(([r])=>r)}function Dc(e,t){return t?{intent:t.intent??e.intent,targetSchemes:t.targetSchemes??e.targetSchemes,transport:t.transport??e.transport}:e}function xc(e,t){const n=[];for(const r of e){if(!r.enabled)continue;const o=t[r.providerId];if(o)for(const i of Yr(r,o))n.push({channel:r,description:o,capability:i})}return n}function Lc(e,t){return t.filter(n=>n.capability.intent===e)}function zr(e,t){return t.filter(n=>n.capability.targetSchemes.includes(e))}function Pc(e,t){return zr(e.scheme,t)}function Uc(e,t,n){const r=[];for(const o of e)for(const i of n)i.capability.intent===t&&i.capability.targetSchemes.includes(o.scheme)&&r.push({channelIntent:i,endpoint:o});return r}var qr=(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))(qr||{});const $c={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 Kc(e){return e?$c[e]??"note":"note"}const Fc="message_window",Bc="message_templates",Hc={FROM:"from",TO:"to",CC:"cc",BCC:"bcc",ORGANIZER:"organizer",PRESENTER:"presenter",ATTENDEE:"attendee",OWNER:"owner",MEMBER:"member",GUEST:"guest",HOST:"host",PARTICIPANT:"participant"},Wc=(e,t)=>({intent:e,...t}),Gc="folder_management",Vc="remote_search",jc="message_reactions",Yc={ok:!1,code:"UNSUPPORTED",message:"Provider does not support this op"},Xc="connector",zc="context.collect",_=e=>({type:"string",description:e}),y=e=>({type:"number",description:e}),re=e=>({type:"boolean",description:e}),R=_("Sheet name. Omit for the sheet the user is looking at."),xt=_("Slide id, as `inspect` reports it.");function E(e,t,n,r,o,i){return{op:e,kinds:t,summary:n,parameters:{type:"object",properties:r,required:o},undoable:i.undoable,visible:i.visible}}const G={undoable:!1,visible:!0},b={undoable:!0,visible:!0},Lt={undoable:!1,visible:!0},Ee={undoable:!1,visible:!1},qc=[E("pdf.goToPage",["pdf"],"Scroll the viewer to a page.",{page:y("1-based page number.")},["page"],G),E("pdf.search",["pdf"],"Search the document and highlight the matches, as the find bar does.",{query:_("Text to find."),next:re("Jump to the next match instead of the first.")},["query"],G),E("pdf.setTool",["pdf"],"Select a markup tool for the user, so their next click draws it.",{tool:{type:"string",enum:["highlight","text","draw","image","signature","none"],description:"Which tool to arm. `none` puts the tool row back to reading."}},["tool"],G),E("pdf.fillField",["pdf"],"Fill one form field of a fillable PDF.",{field:_("Field name, exactly as `inspect` reports it under `fields`."),value:{type:["string","boolean"],description:"Text for a text field, true/false for a checkbox or radio."}},["field","value"],b),E("pdf.reorderPages",["pdf"],"Put the pages in a different order. Pages left out are deleted.",{order:{type:"array",items:{type:"number"},description:"1-based source page numbers, in the order they should end up in."}},["order"],Lt),E("pdf.deletePages",["pdf"],"Remove pages, keeping the rest in order.",{pages:{type:"array",items:{type:"number"},description:"1-based page numbers."}},["pages"],Lt),E("pdf.addNote",["pdf"],"Place a text note on a page. Written on save; not visible before that.",{page:y("1-based page number."),text:_("The note's text."),left:y("Distance from the left edge, in PDF points (72 per inch)."),top:y("Distance from the top edge, in PDF points."),width:y("Box width in points. Omit for a sensible default."),height:y("Box height in points. Omit for a sensible default."),fontSize:y("Font size in points. Omit for 12.")},["page","text","left","top"],Ee),E("pdf.highlightText",["pdf"],"Highlight a phrase on a page. Written on save; not visible before that.",{page:y("1-based page number."),text:_("The exact phrase to highlight, as it appears in the page's text."),occurrence:y("Which occurrence on that page, 1-based. Omit for the first.")},["page","text"],Ee)],Jc=[E("sheet.setValues",["sheet"],"Write a block of values. The block's shape must match the range.",{sheet:R,range:_("A1 notation, e.g. `B2:D5` or a single `A1`."),values:{type:"array",items:{type:"array",items:{type:["string","number","boolean","null"]}},description:"Rows of cells, top-left first. `null` clears a cell."}},["range","values"],b),E("sheet.setFormula",["sheet"],"Put a formula in every cell of a range.",{sheet:R,range:_("A1 notation."),formula:_("Including the leading `=`.")},["range","formula"],b),E("sheet.setStyle",["sheet"],"Change the look of a range. Only the properties you pass are touched.",{sheet:R,range:_("A1 notation."),bold:re("Bold on or off."),italic:re("Italic on or off."),fontSize:y("Point size."),fontColor:_("CSS colour, e.g. `#b91c1c`."),background:_("CSS colour for the cell fill."),horizontalAlignment:{type:"string",enum:["left","center","right"],description:"Horizontal alignment."},numberFormat:_("Number format pattern, e.g. `#,##0.00` or `0%`.")},["range"],b),E("sheet.insertRows",["sheet"],"Insert empty rows, pushing the rest down.",{sheet:R,at:y("1-based row number to insert before."),count:y("How many. Omit for 1.")},["at"],b),E("sheet.deleteRows",["sheet"],"Delete rows, pulling the rest up.",{sheet:R,at:y("1-based first row to delete."),count:y("How many. Omit for 1.")},["at"],b),E("sheet.insertColumns",["sheet"],"Insert empty columns, pushing the rest right.",{sheet:R,at:y("1-based column number to insert before."),count:y("How many. Omit for 1.")},["at"],b),E("sheet.deleteColumns",["sheet"],"Delete columns, pulling the rest left.",{sheet:R,at:y("1-based first column to delete."),count:y("How many. Omit for 1.")},["at"],b),E("sheet.merge",["sheet"],"Merge a range into one cell.",{sheet:R,range:_("A1 notation.")},["range"],b),E("sheet.unmerge",["sheet"],"Break merged cells in a range apart.",{sheet:R,range:_("A1 notation.")},["range"],b),E("sheet.sort",["sheet"],"Sort a range on one of its columns.",{sheet:R,range:_("A1 notation covering the rows to sort, header excluded."),column:y("1-based column *within the range*, not within the sheet."),ascending:re("Ascending. Omit for ascending.")},["range","column"],b),E("sheet.insertSheet",["sheet"],"Add a new sheet.",{name:_("Name for the new sheet.")},["name"],b),E("sheet.renameSheet",["sheet"],"Rename a sheet.",{sheet:_("Current name."),name:_("New name.")},["sheet","name"],b),E("sheet.deleteSheet",["sheet"],"Remove a sheet and everything on it.",{sheet:_("Name of the sheet to delete.")},["sheet"],b),E("sheet.activate",["sheet"],"Show the user a sheet and select a range on it.",{sheet:R,range:_("A1 notation to select. Omit to only switch sheets.")},[],G)],Zc=[E("word.replaceParagraph",["word"],"Rewrite one whole paragraph, keeping its style. This is the verb for shortening or rephrasing something; call it once per paragraph.",{at:y("The offset the paragraph starts at, exactly as `inspect` prints it."),text:_("The new text for that paragraph. A newline starts a further paragraph.")},["at","text"],b),E("word.replaceRange",["word"],"Replace a stretch of text inside a paragraph - a sentence, a phrase. To rewrite whole paragraphs use word.replaceParagraph: a range covering several paragraph styles is refused, because a replacement carries one style and would set the whole span in the first.",{start:y("Character offset where the replaced text starts, as `inspect` reports offsets."),end:y("Character offset just past the last character to replace."),text:_("The replacement text. A newline starts a new paragraph.")},["start","end","text"],b),E("word.insertText",["word"],"Insert text at a character offset, without removing anything.",{index:y("Character offset, as `inspect` reports offsets."),text:_("The text to insert.")},["index","text"],b),E("word.appendText",["word"],"Add text at the end of the document.",{text:_("The text to append.")},["text"],b),E("word.insertParagraph",["word"],"Start a new paragraph, optionally with text in it.",{text:_("Paragraph text. Newlines start further paragraphs."),index:y("Character offset to insert at. Omit for the end of the document.")},[],b),E("word.setSelection",["word"],"Put the user's cursor on a stretch of text, and move the reading window there: the page context carries one window of a long document, and the text around this offset arrives in the next turn.",{start:y("Start character offset."),end:y("End character offset. Omit for a caret.")},["start"],G)],Qc=[E("slides.setText",["slides"],"Replace the text of one shape. Written on save; not visible before that, and not undoable.",{slide:xt,element:_("Element id, as `inspect` reports it."),text:_("The new text.")},["slide","element","text"],Ee),E("slides.setTransform",["slides"],"Move or resize one shape. Only the values you pass change. Written on save; not visible before that, and not undoable.",{slide:xt,element:_("Element id."),left:y("Distance from the left edge, in pixels."),top:y("Distance from the top edge, in pixels."),width:y("Width in pixels."),height:y("Height in pixels.")},["slide","element"],Ee)],ft=[...qc,...Jc,...Zc,...Qc];function el(e){return ft.filter(t=>t.kinds.includes(e))}function tl(e){return ft.find(t=>t.op===e)}const Pt=/(?: {2,}|\\)$/,nl=/^\*\*([^*]+)\*\*\s+(.*)$/;function Ut(e){const t=nl.exec(e);return t?{lead:t[1],text:t[2]}:{text:e}}function rl(e){const t=(e??"").replace(/\r\n/g,`
|
|
9
|
+
`:t==="mail"?"<br><br>-- <br>":"<br><br>"}${o.body}`:n}function Ti(e){return e.endpoints??[]}function P(e){const t=(e??"").trim().toLowerCase();if(t)return t.split(/[-_]/)[0]||void 0}function Ii(e){return P(e.contactLocale)??P(e.companyLocale)??P(e.organizationLocale)}function Mi(e,t,n,r){const o=e.filter(a=>a.key===t&&!a.archived);if(o.length===0)return;const i=P(n),s=P(r);return o.find(a=>P(a.locale)===i)??o.find(a=>P(a.locale)===s)??o.find(a=>!a.locale)??o[0]}const Oi=/\{([a-zA-Z0-9_.]+)\}/g;function tt(e,t){let n=e;for(const r of t.split(".")){if(n==null||typeof n!="object")return;n=n[r]}return n}function wi(e){return typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):""}function gn(e,t){const n=[];return{text:e.replace(Oi,(o,i)=>{const s=tt(t,i);return s==null||s===""?(n.includes(i)||n.push(i),`{${i}}`):wi(s)}),unresolved:n}}function En(e,t){if(!e)return!0;const n=tt(t,e.key);if(e.exists!==void 0){const r=n!=null&&n!==""&&n!==!1;return e.exists?r:!r}return e.equals!==void 0?n===e.equals:!0}function Ri(e,t,n,r){const o=[],i=[],s=a=>{const l=gn(a,t);for(const u of l.unresolved)o.includes(u)||o.push(u);return l.text};for(const a of e){if(a.block_id&&!En(n?.[a.block_id],t))continue;const l=a.block_id?r?.[a.block_id]:void 0;if(l){i.push(...l);continue}switch(a.type){case"heading":case"paragraph":case"quote":i.push({...a,text:s(a.text)});break;case"callout":i.push({...a,...a.title?{title:s(a.title)}:{},text:s(a.text)});break;case"code":i.push(a);break;case"list":i.push({...a,items:a.items.map(u=>({...u.lead?{lead:s(u.lead)}:{},text:s(u.text)}))});break;case"table":i.push({...a,columns:a.columns.map(u=>({...u,label:s(u.label)})),rows:a.rows.map(u=>u.map(s)),...a.caption?{caption:s(a.caption)}:{}});break;case"kpi":i.push({...a,items:a.items.map(u=>({...u,value:s(u.value),label:s(u.label)}))});break;case"letterhead":i.push({...a,fields:a.fields.map(u=>({...u,value:s(u.value)})),...a.recipient?{recipient:a.recipient.map(s)}:{}});break;case"totals":i.push({...a,rows:a.rows.map(u=>({...u,label:s(u.label),amount:s(u.amount)})),...a.taxRows?{taxRows:a.taxRows.map(u=>({...u,label:s(u.label),amount:s(u.amount)}))}:{}});break;case"image":i.push({...a,url:s(a.url),...a.alt?{alt:s(a.alt)}:{}});break;default:i.push(a)}}return{blocks:i,unresolved:o}}const yn=36e5,_n=864e5,x=-1/0,Ci=e=>e.score>x,V={urgent:40,high:25,normal:10,low:0};function ki(e){return Object.fromEntries(e.map(t=>[t.resourceId,t]))}const Ni=/(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i,Sn=/\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;function An(e,t){return!!(e&&Ni.test(e)||t&&Sn.test(t))}const bn=3,Tn=600;function vi(e,t){return e>=bn||t>=Tn}const In=["list-unsubscribe","list-unsubscribe-post","list-id","precedence","auto-submitted","x-auto-response-suppress","feedback-id","x-mailer"];function Di(e){const t={};for(const n of e){const r=n.name?.toLowerCase();r&&n.value!==void 0&&In.includes(r)&&(t[r]=n.value)}return t}const xi=/(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|notifications?|bounce|postmaster|mailer)@/i,Li=/(^|[._+-])(newsletter|nieuwsbrief|marketing|mailing)@/i;function Pi(e){const t=e.headers??{},n=e.from?.email,r=t["auto-submitted"]?.toLowerCase();if(r&&r!=="no"||t["x-auto-response-suppress"]||n&&xi.test(n))return"automated";const o=t.precedence?.toLowerCase();if(t["list-unsubscribe"]||t["list-unsubscribe-post"]||t["list-id"]||o==="bulk"||o==="list"||e.body&&Sn.test(e.body)||n&&Li.test(n))return"marketing"}function Mn(e,t){return e.lastActivityAt?!(e.seenBy??[]).includes(t):!1}const On=["open"],wn=1e3,Rn={urgent:1,high:4,normal:8,low:24},Cn=72;function kn(e){return e.lastActivityAt??(e.createdAt?new Date(Zt(e)).getTime():0)}function Nn(e,t){return vn(t.remindersById?.[e.id],e,t.now)}function vn(e,t,n){return!e||e.remindAt<=n?!1:!((t.lastActivityAt??0)>e.parkedAt&&t.lastActivityPreview?.direction==="inbound")}const Dn=e=>Xt(e)==="outbound_message",xn=e=>On.includes(e);function Se(e,t){return Math.max(0,(t-kn(e))/yn)}function Ln(e,t){const n=e.assignedInboxId?t?.[e.assignedInboxId]:void 0;return typeof n=="number"&&n>0?n:Rn[e.priority??"normal"]}function Ui(e){const t={};for(const n of e)typeof n.slaHours=="number"&&n.slaHours>0&&(t[n.id]=n.slaHours);return t}function $i(e,t,n){return!xn(e.status)||e.firstResponseAt?!1:Se(e,t)>Ln(e,n)}function Pn(e,t){const n=e.lastActivityPreview;return n?.direction!=="outbound"||!Dn(n.type)?!1:Se(e,t)<Cn}function Ki(e,t){if(!xn(e.status))return{score:x,reasons:[]};if(e.snoozedTill&&e.snoozedTill>t.now)return{score:x,reasons:[]};if(Pn(e,t.now))return{score:x,reasons:[]};if(Nn(e,t))return{score:x,reasons:[]};let n=0;const r=[],o=e.priority??"normal";V[o]>0&&(n+=V[o],r.push(`priority:${o}`)),Mn(e,t.userId)&&(n+=20,r.push("unseen")),e.assignedUserId&&e.assignedUserId===t.userId&&(n+=15,r.push("assigned-to-you"));const i=Se(e,t.now);if(i>0){const l=Math.min(i*2,30);n+=l,i>=1&&r.push(`waiting:${Math.round(i)}h`)}const s=e.lastActivityPreview;return s?.type==="AI_ACTION_PROPOSED"&&(n+=30,r.push("awaiting-approval")),s?.direction==="outbound"&&Dn(s.type)&&(n+=10,r.push("no-reply")),!e.firstResponseAt&&e.lastActivityPreview?.direction==="inbound"&&(n+=10,r.push("awaiting-reply")),(e.tags?.some(l=>l==="marketing"||l==="automated")||An(e.remoteParty?.resource,e.lastActivityPreview?.snippet))&&(n-=wn,r.push("bulk")),{score:n,reasons:r}}const Fi=e=>!!e.assignedUserId||!!e.assignedInboxId,Bi=e=>e.status==="closed",Hi=e=>({urgent:10,high:5,normal:2,low:1})[e.priority]||0,Wi=(e,t=30)=>e.title?.length<=t?e.title:`${e.title.substring(0,t)}...`;function Gi(e,t){const n=e.labels??[];return n.find(r=>r.locale===t)?.label??n[0]?.label??e.url}function Vi(e,t,n){const r=e.translations??[];return r.find(o=>o.locale===t)??(n?r.find(o=>o.locale===n):void 0)??{locale:t}}const pe=[{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 Un(e){const t=(e??"").toLowerCase();return pe.find(n=>n.code===t)??pe.find(n=>n.code===t.split("-")[0])}function ji(e){return Un(e)?.label??e}function Yi(e){const t=Un(e);return t?t.english===t.label?`${t.english} (${t.code})`:`${t.english} — ${t.label} (${t.code})`:e}const nt=3;function $n(e,t){const n=new Set;let r=1,o=t.get(e)?.parentId;for(;o;){if(n.has(o)||(n.add(o),r++,r>nt+1))return 1/0;o=t.get(o)?.parentId}return r}function Xi(e,t,n){if(!e)return!0;if(e===t)return!1;const r=new Map(n.map(s=>[s.id,s]));if(!r.has(e)||t&&Kn(e,t,r))return!1;const o=$n(e,r),i=t?rt(t,n):1;return o+i<=nt}function Kn(e,t,n){const r=new Set;let o=n.get(e)?.parentId;for(;o;){if(o===t)return!0;if(r.has(o))return!1;r.add(o),o=n.get(o)?.parentId}return!1}function rt(e,t,n=new Set){if(n.has(e))return 1;n.add(e);const r=t.filter(o=>o.parentId===e);return r.length?1+Math.max(...r.map(o=>rt(o.id,t,n))):1}const Fn="en";function Bn(e){return e.defaultLocale||e.locale||Fn}function zi(e){const t=new Set,n=[];for(const r of[Bn(e),...e.locales??[]])!r||t.has(r)||(t.add(r),n.push(r));return n}function qi(e,t,n){const r=e.translations??[];return r.find(o=>o.locale===t)?.name??(n?r.find(o=>o.locale===n)?.name:void 0)??e.name}const Ke=["lookup","condition","parallel","for-each"];function Fe(e){for(const t of e){if(!Ke.includes(t.type))return`staptype "${t.type}" mag niet meelezen (alleen ${Ke.join(", ")})`;if(t.type==="parallel")for(const n of t.branches??[]){const r=Fe(n);if(r)return r}if(t.type==="for-each"){const n=Fe(t.body??[]);if(n)return n}}return null}function Ji(e,t){switch(e.kind){case"org":return!0;case"team":return!!t.teamId&&e.teamId===t.teamId;case"personal":return e.userId===t.userId}}function Zi(e,t){return e.filter(n=>n.enabled&&Ji(n.ownerScope,t))}function Qi(e){return e.credentialScope?e.credentialScope:(e.authMode??"header")==="header"||e.oauth?.scope==="org"?"shared":"per-user"}function es(e){return`mcp__${e}__`}const ts=1e3,ns=2e3,rs=500,os=12e3,is=4e3,Hn=["contact","company","work_item"];function ss(e){if(!e)return!1;const t=e.slice(0,e.indexOf(":"));return Hn.includes(t)}const as="onboarding-source",cs=["support","billing","availability","sales","onboarding"],ls=["keep","replace"],Ae=[{key:"shift",label:"kind_shift",capacity:!0,productive:!1,absent:!1,icon:"calendar-clock"},{key:"allocation",label:"kind_allocation",capacity:!1,productive:!0,absent:!1,icon:"briefcase"},{key:"meeting",label:"kind_meeting",capacity:!1,productive:!1,absent:!1,icon:"users"},{key:"travel",label:"kind_travel",capacity:!1,productive:!1,absent:!1,icon:"car"},{key:"training",label:"kind_training",capacity:!1,productive:!1,absent:!1,icon:"graduation-cap"},{key:"break",label:"kind_break",capacity:!1,productive:!1,absent:!1,icon:"coffee"},{key:"absence",label:"kind_absence",capacity:!1,productive:!1,absent:!0,approvable:!0,icon:"palmtree"},{key:"sick",label:"kind_sick",capacity:!1,productive:!1,absent:!0,icon:"thermometer"},{key:"holiday",label:"kind_holiday",capacity:!1,productive:!1,absent:!0,icon:"party-popper"}],Wn={key:"unknown",label:"kind_unknown",capacity:!1,productive:!1,absent:!1};function N(e,t=Ae){return t.find(n=>n.key===e)??{...Wn,key:e}}function B(e){return e==="published"||e==="approved"}function ot(e,t,n=Ae){if(e.workstreamId!==t)return!1;const r=N(e.kindKey,n);return r.absent?!1:r.productive||r.capacity}function us(e,t=Ae){if(!e.userId||!B(e.status))return!1;const n=N(e.kindKey,t);return n.capacity||n.productive||n.absent}const ds=864e5;function Gn(e,t){return Math.round((t-e)/ds)}function it(e,t){const n=e.cycleMinutes.length;return n===0?0:(Gn(e.anchor,t)%n+n)%n}function st(e,t){return e.effectiveFrom!==void 0&&t<e.effectiveFrom?0:e.cycleMinutes[it(e,t)]??0}function at(e,t){return e.startTimes?.[it(e,t)]}function ct(e,t,n,r){const o=e.filter(a=>a.effectiveFrom===void 0||a.effectiveFrom<=r),i=a=>a.sort((l,u)=>(u.effectiveFrom??0)-(l.effectiveFrom??0))[0],s=i(o.filter(a=>a.userId===t));return s||i(o.filter(a=>!a.userId&&a.teamId&&n.includes(a.teamId)))}function Vn(e,t,n){return e.filter(r=>r.userId===t&&(r.effectiveFrom===void 0||r.effectiveFrom<=n)).sort((r,o)=>(o.effectiveFrom??0)-(r.effectiveFrom??0))[0]}const Be=864e5;function ps(e){const t=Math.max(1,Math.round((e.to-e.from)/Be));return Array.from({length:t},(n,r)=>e.from+r*Be)}function He(e,t,n,r){const o=Math.min(t,r)-Math.max(e,n);return o>0?o/1e3:0}const wt={interval:0,day:1,week:2};function fs(e,t){const{entries:n,patterns:r=[],terms:o=[]}=t,i=n.filter(c=>c.userId&&B(c.status)&&N(c.kindKey).capacity),s=n.filter(c=>c.userId&&B(c.status)&&N(c.kindKey).absent),a=t.userIds??[...new Set([...i.map(c=>c.userId),...r.map(c=>c.userId),...o.map(c=>c.userId)])].filter(c=>!!c),l={};let u="interval";const p=c=>{wt[c]>wt[u]&&(u=c)};for(const c of a){const d=t.teamIdsOf?.(c)??[];let m=0,S=0,g=0;for(const f of ps(e)){const A=Math.max(f,e.from),v=Math.min(f+Be,e.to);g++;const C=i.filter(O=>O.userId===c).reduce((O,yt)=>O+He(yt.start,yt.end,A,v),0);if(C>0){m+=C;continue}const w=ct(r,c,d,f),k=w?st(w,f):0;if(w&&k>0){m+=k*60,p(at(w,f)?"interval":"day");continue}w||S++}if(S>0){const f=Vn(o,c,e.from);f&&(m+=f.weeklyMinutes*60*(S/7),p("week"))}const T=s.filter(f=>f.userId===c).reduce((f,A)=>f+He(A.start,A.end,e.from,e.to),0),h=Math.max(0,m-T);(h>0||g>0)&&(l[c]=h)}return{seconds:Object.values(l).reduce((c,d)=>c+d,0),precision:u,byUser:l}}function ms(e,t){if(!e.some(a=>a.userId))return[];const n="",r=new Map;for(const a of e){const l=a.userId??n;r.set(l,(r.get(l)??0)+a.seconds)}const i=[...new Set([...Object.keys(t.byUser),...[...r.keys()].filter(a=>a!==n)])].map(a=>{const l=r.get(a)??0,u=t.byUser[a]??0;return{userId:a,requiredSeconds:l,capacitySeconds:u,netSeconds:u-l}});i.sort((a,l)=>a.netSeconds-l.netSeconds);const s=r.get(n)??0;return s>0&&i.push({requiredSeconds:s,capacitySeconds:0,netSeconds:-s}),i}function hs(e,t,n,r){const o=e.filter(s=>s.userId&&B(s.status)&&!N(s.kindKey).absent),i=Object.entries(r.byUser).map(([s,a])=>{let l=0,u=0;for(const p of o){if(p.userId!==s||N(p.kindKey).capacity&&!p.workstreamId)continue;const c=He(p.start,p.end,n.from,n.to);c<=0||(ot(p,t)?l+=c:u+=c)}return{userId:s,capacitySeconds:a,onThisSeconds:l,elsewhereSeconds:u,freeSeconds:Math.max(0,a-l-u)}});return i.sort((s,a)=>a.freeSeconds-s.freeSeconds),i}const gs="demand-source",Rt=1e3;function Es(e,t){let n=1;for(let r=1;r<=e;r++)n=t*n/(r+t*n);return n}function jn(e,t){if(e<=0)return 1;if(t<=0)return 0;if(e<=t)return 1;const n=Es(e,t),r=t/e;return n/(1-r*(1-n))}function Yn(e,t,n,r){return r<=0?1:e<=t?0:1-jn(e,t)*Math.exp(-(e-t)*n/r)}function Xn(e,t,n){return n<=0?0:e*t/n}function zn(e,t,n,r){if(e<=0||t<=0)return 0;const o=Xn(e,t,n);if(o<=0)return 0;const i=r.serviceLevelPercent/100,s=r.maxOccupancyPercent?r.maxOccupancyPercent/100:void 0;for(let a=Math.max(1,Math.ceil(o));a<=Rt;a++)if(!(a<=o)&&!(Yn(a,o,r.targetSeconds,t)<i)&&!(s&&o/a>s))return a;return Rt}const ys=36e5,_s=864e5;function Ss(e){return e==="day"?_s:ys}function As(e,t){return e.start<t.end&&t.start<e.end}function te(e,t,n){const r=Math.min(e.end,n)-Math.max(e.start,t);return r>0?r/1e3:0}function qn(e,t,n){const r=e.handleSeconds??0,o=e.seconds??(e.volume!==void 0?e.volume*r:0);if(o<=0&&!e.volume)return{seconds:0,headcount:0};const i=(t.unplannedLossPercent??0)/100,s=i>0&&i<1?1/(1-i):1;if(t.model==="queue"&&e.volume!==void 0&&r>0){const a=zn(e.volume,r,n,t);return{seconds:o,headcount:a*s}}return{seconds:o,headcount:o/n*s}}function bs(e){const{entries:t,workstreamId:n,staffing:r,demand:o,range:i}=e,s=e.grain??"hour",a=Ss(s),l=a/1e3,u=e.kinds,p=t.filter(g=>B(g.status)),c=p.filter(g=>ot(g,n,u)),d=p.filter(g=>N(g.kindKey,u).capacity),m=p.filter(g=>N(g.kindKey,u).absent),S=[];for(let g=F(i.from,s);g<i.to;g+=a){const T=g+a,h=K(g,s);let f=0;for(const O of c)f+=te(O,g,T);let A=0;for(const O of d)A+=te(O,g,T);let v=0;for(const O of m)v+=te(O,g,T);const C=o?.[h]??{},w=qn(C,r,l),k=f/l;S.push({period:h,forecastVolume:C.volume,requiredSeconds:w.seconds,requiredHeadcount:w.headcount,scheduledSeconds:f,scheduledHeadcount:k,netHeadcount:k-w.headcount,capacitySeconds:A,absentSeconds:v})}return S}function Jn(e,t){return e.workTypeKey??t?.defaultWorkTypeKey}function Ts(e,t,n){const r=Jn(e,t);return r?n.find(o=>o.key===r)?.defaultBillable??!1:!1}function Is(e){return e.filter(t=>t.netHeadcount<0&&t.requiredHeadcount>0)}const Ms=36e5,We=6048e5,Zn=8,Os=.5,ws=2;function Rs(e){const t=Number(e.slice(0,4)),n=Number(e.slice(5,7)),r=Number(e.slice(8,10)),o=e.length>10?Number(e.slice(11,13)):0;return Date.UTC(t,n-1,r,o)}function Cs(e,t,n){const r=[];for(let i=0;i<n;i++){const s=t-i*We,a=s-We;let l=0,u=!1;for(const[p,c]of e)p>=a&&p<s&&(l+=c,u=!0);u&&r.push(l)}if(r.length<2)return 1;const o=r.reduce((i,s)=>i+s,0)/r.length;return o<=0?1:Math.min(ws,Math.max(Os,r[0]/o))}function ks(e,t){if(!e?.length)return;let n;for(const r of e)t>=r.from&&t<r.to&&(n=r);return n}function Ns(e,t,n){const r=Math.max(1,n?.weeks??Zn),o=new Map,i=new Set;for(const l of e)o.set(Rs(l.period),l.value),i.add(l.period.slice(0,10));const s=Cs(o,F(t.from,"hour"),r),a=[];for(let l=F(t.from,"hour");l<t.to;l+=Ms){let u=0,p=0;for(let m=1;m<=r;m++){const S=l-m*We,T=o.get(S)??(i.has(K(S,"day"))?0:void 0);if(T===void 0)continue;const h=r-m+1;u+=T*h,p+=h}let c=p>0?u/p*s:0;const d=ks(n?.adjustments,l);d?.absoluteVolume!==void 0?c=d.absoluteVolume:d?.factor!==void 0&&(c*=d.factor),a.push({period:K(l,"hour"),volume:c})}return a}const Qn="schedule_entry",er="workstream";function vs(e){return`${Qn}:${e}`}function Ds(e){return`${er}:${e}`}const Ge=36e5,$=864e5;function xs(e,t){const n=t==="day"?$:Ge,r=[];for(let o=F(e.from,t);o<e.to;o+=n)r.push(o);return r}function Ct(e){const t=Math.max(1,Math.round((e.to-e.from)/$));return Array.from({length:t},(n,r)=>e.from+r*$)}function ve(e,t,n,r){const o=Math.min(t,r)-Math.max(e,n);return o>0?o/1e3:0}function Ls(e,t,n={}){const r=n.grain??"hour",o=xs(t,r),i=r==="day"?$:Ge,s=new Map(o.map(c=>[c,0])),a=e.filter(c=>c.userId&&N(c.kindKey).capacity),l=n.userIds?.length?new Set(n.userIds):null,u=new Set;for(const c of a)if(!(l&&c.userId&&!l.has(c.userId))){for(const d of o){const m=ve(c.start,c.end,d,d+i);m>0&&s.set(d,(s.get(d)??0)+m)}for(const d of Ct(t))ve(c.start,c.end,d,d+$)>0&&u.add(`${c.userId}:${d}`)}const p=n.userIds??[...new Set([...a.map(c=>c.userId),...(n.patterns??[]).map(c=>c.userId)])].filter(c=>!!c);if(n.patterns?.length)for(const c of p){const d=n.teamIdsOf?.(c)??[];for(const m of Ct(t)){if(u.has(`${c}:${m}`))continue;const S=ct(n.patterns,c,d,m);if(!S)continue;const g=st(S,m);if(g<=0)continue;const T=at(S,m);if(T){const[A,v]=T.split(":").map(Number),C=m+A*Ge+(v??0)*6e4,w=C+g*6e4;for(const k of o){const O=ve(C,w,k,k+i);O>0&&s.set(k,(s.get(k)??0)+O)}continue}const h=o.filter(A=>A>=m&&A<m+$);if(!h.length)continue;const f=g*60/h.length;for(const A of h)s.set(A,(s.get(A)??0)+f)}}return o.map(c=>({period:K(c,r),weight:s.get(c)??0}))}function tr(e,t){if(e<=0||!t.length)return[];const n=t.reduce((r,o)=>r+Math.max(0,o.weight),0);if(n<=0){const r=e/t.length;return t.map(o=>({period:o.period,seconds:r}))}return t.filter(r=>r.weight>0).map(r=>({period:r.period,seconds:e*r.weight/n}))}function Ps(e,t,n){const r=new Map;for(const o of e){const i=o.by?t.filter(a=>n(a.period)<o.by):t,s=i.length?i:t;for(const a of tr(o.seconds,s)){const l=`${a.period}|${o.userId??""}`,u=r.get(l);u?u.seconds+=a.seconds:r.set(l,{...a,userId:o.userId})}}return[...r.values()].sort((o,i)=>o.period.localeCompare(i.period)||(o.userId??"").localeCompare(i.userId??""))}function nr(e){switch(e.kind){case"user":return`user:${e.userId}`;case"team":return`team:${e.teamId}`;case"org":return"org"}}function Us(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 r=t.slice(0,n),o=t.slice(n+1).trim();if(o){if(r==="user")return{kind:"user",userId:o};if(r==="team")return{kind:"team",teamId:o}}}function rr(e){return nr(e)}function or(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"}}}const ir=or;function $s(e){return e.agentId?{kind:"user",userId:e.agentId}:ir(e.ownerScope)}function Ks(e){return rr(e)}function Fs(e,t){if(!t)return;let n=e;for(const r of t.split(".")){if(n===null||typeof n!="object")return;n=n[r]}return n}function Bs(e,t){return e.targets.find(n=>n.activityTypes.includes(t))}function Hs(e,t){if(t)return e.targets.find(n=>n.id===t)}function sr(e){return e?.kind==="assignment"}function Ws(e){const{trigger:t,agentId:n,target:r,activityType:o,assigneeUserId:i,authorUserId:s}=e;return sr(t)?n?r?r.activityTypes.includes(o)?i?i!==n?"assigned to someone else":s&&s===n?"the agent assigned this to itself, which would restart its own run":null:`no assignee found at ${r.assigneePath}`:`activity type ${o} does not announce an assignment for ${r.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"}function Gs(e){return(e.startsWith("tool:")?e.slice(5):e).replace(/__/g," · ").replace(/\./g," · ").replace(/_/g," ")}const Vs=[{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:"itemId",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:"toCategory",type:"string"},{name:"contactId",type:"string"},{name:"companyId",type:"string"},{name:"priority",type:"string"},{name:"inboxId",type:"string"},{name:"topicId",type:"string"},{name:"assigneeUserId",type:"string"}],js={topics:[{name:"topicId",type:"string"},{name:"topic",type:"string"},{name:"confidence",type:"number"},{name:"reasoning",type:"string"}],question:[{name:"answer",type:"boolean"},{name:"reasoning",type:"string"}],extract:[]};function ar(e){return`${e.type}:${e.id}`}const cr="interaction";function lr(e){return e?.type===cr?e.id:void 0}const ur=64,dr=8e3;function Ys(e){const t=typeof e=="number"?e:Number(String(e??"").trim());if(!(!Number.isFinite(t)||t<=0))return Math.min(Math.max(Math.round(t),ur),dr)}const Xs={kind:"workflow",steps:[]};function zs(e){return e?.kind==="workflow"?e.steps:[]}function qs(e){return e?.kind==="procedure"?e.procedure:void 0}function pr(e){const t=e?.approved??0,n=t+(e?.rejected??0);return{total:n,rate:n?t/n:0}}const fr=10,mr=.9;function Js(e){const{total:t,rate:n}=pr(e);return t>=fr&&n>=mr}const hr=["done","escalated","failed","stopped"];function Zs(e){return hr.includes(e)}function gr(e){return e==="waiting"}function Qs(e){return e==="running"||gr(e)}function lt(e){return e.subjectKind&&e.subjectId?{type:e.subjectKind,id:e.subjectId}:void 0}function ea(e){const t=lt(e);return t?ar(t):void 0}function ta(e){return lr(lt(e))}function na(e){const t=[],n=new Map;for(const r of[...e].sort(ra)){const o=n.get(r.emoji);if(o){o.push(r.actor);continue}t.push(r.emoji),n.set(r.emoji,[r.actor])}return t.map(r=>{const o=n.get(r);return{emoji:r,count:o.length,actors:o}}).sort((r,o)=>o.count-r.count||t.indexOf(r.emoji)-t.indexOf(o.emoji))}const ra=(e,t)=>(e.createdAt??0)-(t.createdAt??0);function oa(e,t){return t?e.actors.some(n=>n.type==="user"&&n.id===t):!1}const Ve=6e4,ia=36e5,j=864e5,Er=800;function kt(e,t){const n=Date.UTC(e,t+1,0);return n-new Date(n).getUTCDay()*j+ia}function sa(e){const t=new Date(e).getUTCFullYear();return e>=kt(t,2)&&e<kt(t,9)}function yr(e,t){const n=t.dst==="eu"&&sa(e)?60:0;return(t.utcOffsetMinutes+n)*Ve}function aa(e){return(e+3)%7+1}function _r(e,t){const n=yr(e,t),r=e+n,o=Math.floor(r/j);if(!t.days.includes(aa(o)))return null;const i=o*j;return{open:i+t.fromMinutes*Ve-n,close:i+t.toMinutes*Ve-n}}function Sr(e,t){const n=yr(e,t),r=e+n;return(Math.floor(r/j)+1)*j-n}function fe(e,t,n){if(t<=e)return 0;if(!n)return t-e;let r=0,o=e;for(let i=0;i<Er&&o<t;i++){const s=_r(o,n);if(s){const a=Math.max(o,s.open),l=Math.min(t,s.close);l>a&&(r+=l-a)}o=Sr(o,n)}return r}function be(e,t,n){if(!n)return e+t;let r=t,o=e;for(let i=0;i<Er;i++){const s=_r(o,n);if(s){const a=Math.max(o,s.open);if(s.close>a){const l=s.close-a;if(r<=l)return a+r;r-=l}}o=Sr(o,n)}return e+t}function ca(e){const t=/^([01]\d|2[0-3]):([0-5]\d)$/.exec(e);return t?Number(t[1])*60+Number(t[2]):null}const me=1,he=2;function la(e){return e==="snoozed"?me:he}function Te(e){const t=e.calendar;return t&&Array.isArray(t.days)?t:null}const ua=["speed_of_answer","first_response","next_response","resolution","close"],da=["snoozed","waiting_for_customer"],pa=6e4,Ar=["speed_of_answer","first_response","next_response"],fa=[...Ar,"resolution","close"];function X(e){return e.state==="running"||e.state==="paused"}function ma(e,t){return X(e)?{state:(e.state==="paused"?e.remainingMs>0:t<=e.dueAt)?"hit":"missed",settledAt:Math.max(t,e.startedAt)}:null}function Nt(e){return X(e)?{state:"void"}:null}function ha(e,t,n,r){if(!X(e)||(e.pauseBits&t)!==0)return null;const o=e.pauseBits|t;return e.state==="paused"?{pauseBits:o}:{pauseBits:o,state:"paused",remainingMs:fe(n,e.dueAt,r)}}function ga(e,t,n,r){if(!X(e)||(e.pauseBits&t)===0)return null;const o=e.pauseBits&~t;return o!==0?{pauseBits:o}:{pauseBits:o,state:"running",dueAt:be(n,e.remainingMs,r)}}function Ea({event:e,at:t,now:n,clocks:r,profile:o}){const i=Te(o),s=Math.min(t,n),a=r.map(h=>({...h})),l=[],u=(h,f)=>{f&&(l.push({op:"patch",clockId:h.id,patch:f}),Object.assign(h,f))},p=h=>{for(const f of a)f.metric===h&&u(f,ma(f,s))},c=h=>{for(const f of a)h.includes(f.metric)&&u(f,Nt(f))},d=h=>{for(const f of a)u(f,ha(f,h,s,i))},m=h=>{for(const f of a)u(f,ga(f,h,s,i))},S=h=>a.reduce((f,A)=>A.metric===h?Math.max(f,A.attempt):f,0)+1,g=h=>a.some(f=>f.metric===h&&X(f)),T=(h,f)=>{const A=o.targets.find(C=>C.metric===h);if(!A)return;const v=A.minutes*pa;l.push({op:"start",metric:h,attempt:S(h),startedAt:f,targetMs:v,dueAt:be(f,v,i)})};switch(e){case"apply":{for(const h of a)h.profileId!==o.id&&u(h,Nt(h));for(const h of o.targets){if(h.metric==="next_response")continue;a.some(A=>A.metric===h.metric&&A.profileId===o.id)||T(h.metric,s)}break}case"answered":p("speed_of_answer");break;case"outbound":{p("first_response"),p("next_response"),o.pauseOn.includes("waiting_for_customer")&&d(he);break}case"inbound":{m(he),!g("first_response")&&!g("next_response")&&T("next_response",s);break}case"resolved":p("resolution");break;case"closed":p("close"),p("resolution"),c(Ar);break;case"reopened":g("resolution")||T("resolution",s),g("close")||T("close",s);break;case"snoozed":o.pauseOn.includes("snoozed")&&d(me);break;case"unsnoozed":m(me);break;case"discarded":c(fa);break}return l}function br(e){return e.state==="running"||e.state==="paused"}function ge(e,t){const n=Te(e);return e.state==="paused"?e.remainingMs:t>=e.dueAt?-fe(e.dueAt,t,n):fe(t,e.dueAt,n)}function ya(e,t){return e.state==="paused"?be(t,e.remainingMs,Te(e)):e.dueAt}function _a(e,t){const n=e.filter(br);if(!n.length)return;const r=n.filter(i=>i.state==="running");return(r.length?r:n).reduce((i,s)=>ge(s,t)<ge(i,t)?s:i)}function Sa(e,t){if(e.state==="missed")return"breached";if(e.state==="hit")return"met";if(e.state==="paused")return"paused";if(e.state==="void")return"met";const n=ge(e,t);return n<=0?"breached":n<=e.targetMs/5?"urgent":"running"}function Aa(e){const t=Math.floor(Math.abs(e)/1e3),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),o=Math.floor(t%3600/60);return n?r?`${n}d ${r}u`:`${n}d`:r?o?`${r}u ${o}m`:`${r}u`:o?`${o}m`:`${t%60}s`}const Tr="strategy_item";function ut(e){return`${Tr}:${e}`}function ba(e,t=25){const n=new Set([ut(e.id)]);for(const r of e.ancestorKeys??[])n.add(r);return Array.from(n).slice(0,t)}function Ta(e){return e?[...e.ancestorKeys??[],ut(e.id)]:[]}const z=[{key:"area",label:"level_area",order:10,measurable:!1,icon:"compass"},{key:"objective",label:"level_objective",order:20,measurable:!0,icon:"target"},{key:"key_result",label:"level_key_result",order:30,measurable:!0,icon:"gauge"}],Ir=999,Mr=7;function Or(e,t=z){return t.find(n=>n.key===e)}function Ee(e,t=z){return Or(e,t)?.order??Ir}function Ia(e,t,n=z){return Ee(t,n)<=Ee(e,n)}function Ma(e,t=z){const n=Ee(e,t);return t.filter(o=>o.order>n).sort((o,i)=>o.order-i.order)[0]?.key??e}function Oa(e){const t=e.trim().toLowerCase();return t?t.includes("key result")||t.includes("keyresult")||t==="kr"?"key_result":t.includes("objective")||t.includes("goal")||t.includes("doel")?"objective":t.includes("focus")||t.includes("area")||t.includes("theme")?"area":null:null}const je={pending:"open",on_track:"open",at_risk:"open",off_track:"open",paused:"paused",achieved:"closed",missed:"closed"};function wa(e){return je[e]??"open"}function Ra(e){return Object.keys(je).filter(t=>e.includes(je[t]))}const Ca=864e5,Ie=e=>e<=0?0:e>1?1:e;function ka(e,t){const{direction:n}=e,r=e.startValue??0,o=e.targetValue??0;if(!Number.isFinite(t))return 0;const i=n==="down"?t<=o:t>=o,s=o-r;return(n==="down"?s<0:s>0)?Ie((t-r)/s):i?1:0}function Na(e,t){const{startDate:n,targetDate:r}=e;if(!(typeof n!="number"||typeof r!="number")&&!(r<=n))return Ie((t-n)/(r-n))}const wr=.1,Rr=.25;function va(e,t){if(typeof e!="number"||typeof t!="number")return;if(e>=1)return"achieved";const n=t-e;return n>=Rr?"off_track":n>=wr?"at_risk":"on_track"}function Da(e,t){if(t)return Ie(e/t)}function xa(e){const t=e.map(n=>n.progress?.ratio).filter(n=>typeof n=="number"&&Number.isFinite(n));if(t.length)return Ie(t.reduce((n,r)=>n+r,0)/t.length)}function La(e,t){const n=e.lastCheckInAt??e.createdAt;if(typeof n!="number")return 0;const r=(e.checkInEveryDays??Mr)*Ca,o=t-n-r;return o>0?o:0}function Pa(e){return e.targetDate??Number.MAX_SAFE_INTEGER}function Ua(e,t){const n=e.accumulatedSeconds||0;return e.runningSince?n+Math.max(0,Math.floor((t-e.runningSince)/1e3)):n}function $a(e,t){const n=Math.max(1,Math.ceil(Math.max(0,e)/60));if(!t||t==="exact")return n*60;const r=Number(t);return!Number.isFinite(r)||r<=0?n*60:Math.ceil(n/r)*r*60}function Ka(e){const t=Math.max(0,Math.round(e/60));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function Fa(e){const t=Math.max(0,Math.floor(e)),n=i=>String(i).padStart(2,"0"),r=Math.floor(t/60)%60,o=Math.floor(t/3600);return o>0?`${o}:${n(r)}:${n(t%60)}`:`${n(r)}:${n(t%60)}`}function Cr(e){return(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").slice(0,48).replace(/^-+|-+$/g,"")}function Ba(e,t){const n=Cr(e)||"werksoort",r=new Set(t);if(!r.has(n))return n;for(let o=2;o<500;o++){const i=`${n}-${o}`;if(!r.has(i))return i}return`${n}-${r.size+1}`}function Ha(e,t){const n=e.ownerScope;return!n||n.kind==="org"?!0:t.includes(n.teamId)}function Wa(e){return e.filter(t=>!t.archived).sort(kr)}function kr(e,t){const n=(e.order??0)-(t.order??0);return n!==0?n:(e.label||"").localeCompare(t.label||"")}const Nr=20,vr=20,ne=300;function L(e){return e.toLowerCase().replace(/[^\p{L}\p{N}\s]/gu," ").replace(/\s+/g," ").trim()}function Dr(e){const t=e.replace(/\s+/g," ").trim();if(t.length<=ne)return t;const n=t.slice(0,ne),r=Math.max(n.lastIndexOf(". "),n.lastIndexOf("! "),n.lastIndexOf("? "));return r>ne*.6?n.slice(0,r+1):`${n.trimEnd()}…`}function Ga(e,t){const n=Dr(t.text),r=L(n);if(!r||(e.examples??[]).some(s=>L(s)===r))return null;const o=e.exampleCandidates??[],i=o.findIndex(s=>L(s.text)===r);if(i>=0){if(o[i].corrected||!t.corrected)return null;const s=[...o];return s[i]={...s[i],corrected:!0,addedAt:t.addedAt},vt(s)}return vt([{...t,text:n},...o]).slice(0,vr)}function vt(e){return[...e].sort((t,n)=>Number(n.corrected)-Number(t.corrected)||n.addedAt-t.addedAt)}function Va(e,t){const n=L(t),r=(e.examples??[]).filter(i=>i.trim());return{examples:r.some(i=>L(i)===n)?r:[...r,t].slice(-Nr),exampleCandidates:xr(e,t)}}function xr(e,t){const n=L(t);return(e.exampleCandidates??[]).filter(r=>L(r.text)!==n)}function Lr(e,t){const n=e.ownerScope;return n?n.kind==="org"?!0:n.kind==="team"?!!t&&n.teamId===t:!1:!1}function ja(e,t){return e.filter(n=>Lr(n,t))}function Ya(e){return e.type==="agent"}const Xa="WORK_COMMENT_ADDED",za="WORK_ITEM_ASSIGNED",qa="WORK_ITEM_STATUS_CHANGED";function Ja(e,t){const n=r=>{const o=new Date(r);return o.setHours(0,0,0,0),o.getTime()};return Math.round((n(e)-n(t))/_n)}function Za(e,t){if(e.closedAt!=null)return{score:x,reasons:[]};const n=t.remindersById?.[e.id];if(n&&n.remindAt>t.now)return{score:x,reasons:[]};let r=0;const o=[],i=e.priority??"normal";if(V[i]>0&&(r+=V[i],o.push(`priority:${i}`)),typeof e.dueDate=="number"){const s=Ja(e.dueDate,t.now);s<0?(r+=35,o.push("overdue")):s===0&&(r+=20,o.push("due-today"))}return e.source?.initiator==="system"&&e.source.systemReason&&(r+=15,o.push(`auto:${e.source.systemReason}`)),{score:r,reasons:o}}const Me=[{key:"task",label:"type_task"},{key:"bug",label:"type_bug"},{key:"story",label:"type_story"},{key:"epic",label:"type_epic"},{key:"subtask",label:"type_subtask"},{key:"case",label:"type_case"},{key:"deal",label:"type_deal"}],Qa=Me.map(e=>e.key);function ec(e){return e?.types?.length?e.types:Me}function tc(e,t){return t.find(n=>n.key===e)}function nc(e){const t=e.trim().toLowerCase();return t?t.includes("sub-task")||t.includes("subtask")||t.includes("sub task")?"subtask":t.includes("bug")||t.includes("defect")?"bug":t.includes("epic")?"epic":t.includes("story")?"story":t.includes("incident")||t.includes("problem")||t.includes("service request")||t.includes("change")?"case":t.includes("task")?"task":null:null}function rc(...e){return e.map(t=>Me.find(n=>n.key===t)).filter(t=>!!t)}const Pr="work_item",Ur="work_project",$r="work_activity",oc="work_cycle";function Kr(e){return`${Pr}:${e}`}function dt(e){return`${Ur}:${e}`}function ic(e){return`${$r}:${e}`}function sc(e,t,n){const r=`${e}-${t}`;return n?`${r}-${n}`:r}function ac(e){const t=/^([A-Za-z0-9]{2,8})-(\d+)(?:-(\d+))?$/.exec((e||"").trim());return t?{projectKey:t[1].toUpperCase(),sequenceNumber:Number(t[2]),...t[3]?{subSequence:Number(t[3])}:{}}:null}function cc(e){return(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,3)||"PRJ"}function lc(e,t=25){const n=new Set([Kr(e.id)]);e.projectId&&n.add(dt(e.projectId));for(const r of e.ancestorKeys??[])n.add(r);for(const r of e.partyKeys??[])n.add(r);return Array.from(n).slice(0,t)}function uc(e){return[dt(e.id)]}const Oe=[{key:"open",label:"status_open",category:"todo",order:0},{key:"in_progress",label:"status_in_progress",category:"in_progress",order:1},{key:"done",label:"status_done",category:"done",order:2},{key:"cancelled",label:"status_cancelled",category:"done",order:3}],pt=Oe.map(e=>e.key);function Fr(e){return e?.statuses?.length?e.statuses:Oe}function Br(e,t){return t.find(n=>n.key===e)?.category??"todo"}function dc(e,t){return t.find(n=>n.key===e)}function pc(e){const t=Fr(e),n=e?.defaultStatusKey;return n&&t.some(r=>r.key===n)?n:Hr(t)[0]?.key??Oe[0].key}function Hr(e){return[...e].sort((t,n)=>{const r=(t.order??0)-(n.order??0);return r!==0?r:(t.label||"").localeCompare(n.label||"")})}function fc(e,t){return Br(e,t)==="done"}function Wr(e){return(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").slice(0,48).replace(/^-+|-+$/g,"")}function mc(e,t){const n=Wr(e)||"status",r=new Set([...t,...pt]);if(!r.has(n))return n;for(let o=2;o<500;o++){const i=`${n}-${o}`;if(!r.has(i))return i}return`${n}-${r.size+1}`}function hc(e){const t=[];if(!e.length)return[{index:-1,reason:"empty"}];const n=new Set;return e.forEach((r,o)=>{if(!r.key){t.push({index:o,reason:"missing_key"});return}pt.includes(r.key)&&t.push({index:o,reason:"reserved_key",key:r.key}),n.has(r.key)&&t.push({index:o,reason:"duplicate_key",key:r.key}),n.add(r.key)}),e.some(r=>r.category==="todo"||r.category==="in_progress")||t.push({index:-1,reason:"no_open"}),e.some(r=>r.category==="done")||t.push({index:-1,reason:"no_done"}),t}function gc(e){return e.startDate??Number.MAX_SAFE_INTEGER}function Ec(e){return e.completedAt?"completed":e.startedAt?"active":"planned"}const yc=new Set(["image/png","image/jpeg","image/jpg","image/gif","image/webp"]),_c=new Set(["text/plain","text/markdown","text/csv","application/json","text/html","application/xml","text/xml"]);function Gr(e){const t=(e??"").trim().toLowerCase().split(";")[0];return t?yc.has(t)?"image":t==="application/pdf"?"pdf":_c.has(t)?"text":t.startsWith("audio/")?"audio":"unsupported":"unsupported"}const W=1024*1024,Vr={image:5*W,pdf:20*W,text:1*W,audio:20*W},Sc=25*W,Ac=5;function bc(e,t){const n=Gr(e);return n==="unsupported"?"unsupported":t>Vr[n]?"too-large":null}function Tc(e){return e.access!=="read"&&e.effect!=="internal"}function jr(e){return`${e.kind}:${e.id||e.url||e.title}`}function Ic(e,t=[]){const n=new Set(t),r=[],o=[];for(const i of e){const s=jr(i);n.has(s)||(n.add(s),r.push(i),o.push(s))}return{sources:r,keys:o}}const Mc="assist-source",Oc=["blocking","due","open"];function wc(e,t){const[n,r]=(e.subjectKey??"").split(":");return n===t&&r?r:void 0}const Dt={blocking:0,due:1,open:2};function Rc(e,t){return Dt[e.band??"open"]-Dt[t.band??"open"]||(t.priority??0)-(e.priority??0)||e.id.localeCompare(t.id)}function Cc(e){return e.sessions.filter(t=>t.id!==e.exceptSessionId&&t.state==="connected"&&e.canHold(t.providerId))}function kc(e){return e.sessions.filter(t=>t.id!==e.exceptSessionId&&t.state==="connected"&&!e.canHold(t.providerId))}function Nc(e){return e.sessions.some(n=>n.id!==e.exceptSessionId&&(n.state==="connected"||n.state==="on_hold"))?{admit:!1,reason:"busy"}:{admit:!0}}function Yr(e,t){const n=new Set(e.disabledIntents??[]),r=e.intentOverrides??{},o=t.intents.filter(s=>!n.has(s.intent)).map(s=>Dc(s,r[s.intent]));if(!e.extraIntents||e.extraIntents.length===0)return o;const i=new Set(o.map(s=>s.intent));for(const s of e.extraIntents)i.has(s.intent)||(o.push(s),i.add(s.intent));return o}function Xr(e,t){const n={};for(const r of e.intents){if(!r.togglable)continue;const o=t?.[r.intent];n[r.intent]=o??r.defaultEnabled??!0}return n}function vc(e,t){const n=Xr(e,t);return Object.entries(n).filter(([,r])=>!r).map(([r])=>r)}function Dc(e,t){return t?{intent:t.intent??e.intent,targetSchemes:t.targetSchemes??e.targetSchemes,transport:t.transport??e.transport}:e}function xc(e,t){const n=[];for(const r of e){if(!r.enabled)continue;const o=t[r.providerId];if(o)for(const i of Yr(r,o))n.push({channel:r,description:o,capability:i})}return n}function Lc(e,t){return t.filter(n=>n.capability.intent===e)}function zr(e,t){return t.filter(n=>n.capability.targetSchemes.includes(e))}function Pc(e,t){return zr(e.scheme,t)}function Uc(e,t,n){const r=[];for(const o of e)for(const i of n)i.capability.intent===t&&i.capability.targetSchemes.includes(o.scheme)&&r.push({channelIntent:i,endpoint:o});return r}var qr=(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))(qr||{});const $c={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 Kc(e){return e?$c[e]??"note":"note"}const Fc="message_window",Bc="message_templates",Hc={FROM:"from",TO:"to",CC:"cc",BCC:"bcc",ORGANIZER:"organizer",PRESENTER:"presenter",ATTENDEE:"attendee",OWNER:"owner",MEMBER:"member",GUEST:"guest",HOST:"host",PARTICIPANT:"participant"},Wc=(e,t)=>({intent:e,...t}),Gc="folder_management",Vc="remote_search",jc="message_reactions",Yc={ok:!1,code:"UNSUPPORTED",message:"Provider does not support this op"},Xc="connector",zc="context.collect",_=e=>({type:"string",description:e}),y=e=>({type:"number",description:e}),re=e=>({type:"boolean",description:e}),R=_("Sheet name. Omit for the sheet the user is looking at."),xt=_("Slide id, as `inspect` reports it.");function E(e,t,n,r,o,i){return{op:e,kinds:t,summary:n,parameters:{type:"object",properties:r,required:o},undoable:i.undoable,visible:i.visible}}const G={undoable:!1,visible:!0},b={undoable:!0,visible:!0},Lt={undoable:!1,visible:!0},ye={undoable:!1,visible:!1},qc=[E("pdf.goToPage",["pdf"],"Scroll the viewer to a page.",{page:y("1-based page number.")},["page"],G),E("pdf.search",["pdf"],"Search the document and highlight the matches, as the find bar does.",{query:_("Text to find."),next:re("Jump to the next match instead of the first.")},["query"],G),E("pdf.setTool",["pdf"],"Select a markup tool for the user, so their next click draws it.",{tool:{type:"string",enum:["highlight","text","draw","image","signature","none"],description:"Which tool to arm. `none` puts the tool row back to reading."}},["tool"],G),E("pdf.fillField",["pdf"],"Fill one form field of a fillable PDF.",{field:_("Field name, exactly as `inspect` reports it under `fields`."),value:{type:["string","boolean"],description:"Text for a text field, true/false for a checkbox or radio."}},["field","value"],b),E("pdf.reorderPages",["pdf"],"Put the pages in a different order. Pages left out are deleted.",{order:{type:"array",items:{type:"number"},description:"1-based source page numbers, in the order they should end up in."}},["order"],Lt),E("pdf.deletePages",["pdf"],"Remove pages, keeping the rest in order.",{pages:{type:"array",items:{type:"number"},description:"1-based page numbers."}},["pages"],Lt),E("pdf.addNote",["pdf"],"Place a text note on a page. Written on save; not visible before that.",{page:y("1-based page number."),text:_("The note's text."),left:y("Distance from the left edge, in PDF points (72 per inch)."),top:y("Distance from the top edge, in PDF points."),width:y("Box width in points. Omit for a sensible default."),height:y("Box height in points. Omit for a sensible default."),fontSize:y("Font size in points. Omit for 12.")},["page","text","left","top"],ye),E("pdf.highlightText",["pdf"],"Highlight a phrase on a page. Written on save; not visible before that.",{page:y("1-based page number."),text:_("The exact phrase to highlight, as it appears in the page's text."),occurrence:y("Which occurrence on that page, 1-based. Omit for the first.")},["page","text"],ye)],Jc=[E("sheet.setValues",["sheet"],"Write a block of values. The block's shape must match the range.",{sheet:R,range:_("A1 notation, e.g. `B2:D5` or a single `A1`."),values:{type:"array",items:{type:"array",items:{type:["string","number","boolean","null"]}},description:"Rows of cells, top-left first. `null` clears a cell."}},["range","values"],b),E("sheet.setFormula",["sheet"],"Put a formula in every cell of a range.",{sheet:R,range:_("A1 notation."),formula:_("Including the leading `=`.")},["range","formula"],b),E("sheet.setStyle",["sheet"],"Change the look of a range. Only the properties you pass are touched.",{sheet:R,range:_("A1 notation."),bold:re("Bold on or off."),italic:re("Italic on or off."),fontSize:y("Point size."),fontColor:_("CSS colour, e.g. `#b91c1c`."),background:_("CSS colour for the cell fill."),horizontalAlignment:{type:"string",enum:["left","center","right"],description:"Horizontal alignment."},numberFormat:_("Number format pattern, e.g. `#,##0.00` or `0%`.")},["range"],b),E("sheet.insertRows",["sheet"],"Insert empty rows, pushing the rest down.",{sheet:R,at:y("1-based row number to insert before."),count:y("How many. Omit for 1.")},["at"],b),E("sheet.deleteRows",["sheet"],"Delete rows, pulling the rest up.",{sheet:R,at:y("1-based first row to delete."),count:y("How many. Omit for 1.")},["at"],b),E("sheet.insertColumns",["sheet"],"Insert empty columns, pushing the rest right.",{sheet:R,at:y("1-based column number to insert before."),count:y("How many. Omit for 1.")},["at"],b),E("sheet.deleteColumns",["sheet"],"Delete columns, pulling the rest left.",{sheet:R,at:y("1-based first column to delete."),count:y("How many. Omit for 1.")},["at"],b),E("sheet.merge",["sheet"],"Merge a range into one cell.",{sheet:R,range:_("A1 notation.")},["range"],b),E("sheet.unmerge",["sheet"],"Break merged cells in a range apart.",{sheet:R,range:_("A1 notation.")},["range"],b),E("sheet.sort",["sheet"],"Sort a range on one of its columns.",{sheet:R,range:_("A1 notation covering the rows to sort, header excluded."),column:y("1-based column *within the range*, not within the sheet."),ascending:re("Ascending. Omit for ascending.")},["range","column"],b),E("sheet.insertSheet",["sheet"],"Add a new sheet.",{name:_("Name for the new sheet.")},["name"],b),E("sheet.renameSheet",["sheet"],"Rename a sheet.",{sheet:_("Current name."),name:_("New name.")},["sheet","name"],b),E("sheet.deleteSheet",["sheet"],"Remove a sheet and everything on it.",{sheet:_("Name of the sheet to delete.")},["sheet"],b),E("sheet.activate",["sheet"],"Show the user a sheet and select a range on it.",{sheet:R,range:_("A1 notation to select. Omit to only switch sheets.")},[],G)],Zc=[E("word.replaceParagraph",["word"],"Rewrite one whole paragraph, keeping its style. This is the verb for shortening or rephrasing something; call it once per paragraph.",{at:y("The offset the paragraph starts at, exactly as `inspect` prints it."),text:_("The new text for that paragraph. A newline starts a further paragraph.")},["at","text"],b),E("word.replaceRange",["word"],"Replace a stretch of text inside a paragraph - a sentence, a phrase. To rewrite whole paragraphs use word.replaceParagraph: a range covering several paragraph styles is refused, because a replacement carries one style and would set the whole span in the first.",{start:y("Character offset where the replaced text starts, as `inspect` reports offsets."),end:y("Character offset just past the last character to replace."),text:_("The replacement text. A newline starts a new paragraph.")},["start","end","text"],b),E("word.insertText",["word"],"Insert text at a character offset, without removing anything.",{index:y("Character offset, as `inspect` reports offsets."),text:_("The text to insert.")},["index","text"],b),E("word.appendText",["word"],"Add text at the end of the document.",{text:_("The text to append.")},["text"],b),E("word.insertParagraph",["word"],"Start a new paragraph, optionally with text in it.",{text:_("Paragraph text. Newlines start further paragraphs."),index:y("Character offset to insert at. Omit for the end of the document.")},[],b),E("word.setSelection",["word"],"Put the user's cursor on a stretch of text, and move the reading window there: the page context carries one window of a long document, and the text around this offset arrives in the next turn.",{start:y("Start character offset."),end:y("End character offset. Omit for a caret.")},["start"],G)],Qc=[E("slides.setText",["slides"],"Replace the text of one shape. Written on save; not visible before that, and not undoable.",{slide:xt,element:_("Element id, as `inspect` reports it."),text:_("The new text.")},["slide","element","text"],ye),E("slides.setTransform",["slides"],"Move or resize one shape. Only the values you pass change. Written on save; not visible before that, and not undoable.",{slide:xt,element:_("Element id."),left:y("Distance from the left edge, in pixels."),top:y("Distance from the top edge, in pixels."),width:y("Width in pixels."),height:y("Height in pixels.")},["slide","element"],ye)],ft=[...qc,...Jc,...Zc,...Qc];function el(e){return ft.filter(t=>t.kinds.includes(e))}function tl(e){return ft.find(t=>t.op===e)}const Pt=/(?: {2,}|\\)$/,nl=/^\*\*([^*]+)\*\*\s+(.*)$/;function Ut(e){const t=nl.exec(e);return t?{lead:t[1],text:t[2]}:{text:e}}function rl(e){const t=(e??"").replace(/\r\n/g,`
|
|
10
10
|
`).split(`
|
|
11
11
|
`),n=[];let r=null;const o=()=>{r&&n.push({type:"list",style:r.style,items:r.items}),r=null},i=(d,m)=>{r&&r.style!==d&&o(),r?r.items.push(Ut(m)):r={style:d,items:[Ut(m)]}};let s=[],a=[];const l=()=>{if(s.length){const d=s.join("").trim();d&&n.push({type:"paragraph",text:d}),s=[]}},u=()=>{a.length&&(n.push({type:"quote",text:a.join(`
|
|
12
12
|
`)}),a=[])},p=()=>{l(),u(),o()};let c=0;for(;c<t.length;){const d=t[c]??"",m=d.match(/^```(\w*)\s*$/);if(m){p();const h=[];for(c++;c<t.length&&!/^```\s*$/.test(t[c]??"");)h.push(t[c]??""),c++;c++,n.push({type:"code",...m[1]?{lang:m[1]}:{},text:h.join(`
|
|
13
13
|
`)});continue}const S=d.match(/^(#{1,3})\s+(.*)$/);if(S){p(),n.push({type:"heading",level:S[1].length,text:S[2].trim()}),c++;continue}const g=d.match(/^!\[([^\]]*)\]\(([^)\s]+)\)\s*$/);if(g){p(),n.push({type:"image",url:g[2],...g[1]?{alt:g[1]}:{}}),c++;continue}if(/^\s*[-*]\s+/.test(d)){l(),u(),i("bulleted",d.replace(/^\s*[-*]\s+/,"")),c++;continue}if(/^\s*\d+\.\s+/.test(d)){l(),u(),i("numbered",d.replace(/^\s*\d+\.\s+/,"")),c++;continue}if(/^\s*(-{3,}|\*{3,}|_{3,})\s*$/.test(d)){p(),n.push({type:"divider"}),c++;continue}if(/^>\s?/.test(d)){l(),o(),a.push(d.replace(/^>\s?/,"")),c++;continue}if(d.trim()===""){p(),c++;continue}u(),o();const T=Pt.test(d);s.push(d.replace(Pt,"").trim()+(T?`
|
|
14
14
|
`:" ")),c++}return p(),n}function ol(e,t){return Ze(e,t).replace(/^```.*$/gm,"").replace(/^\|[\s:|-]*\|$/gm,"").replace(/[ \t]*\|[ \t]*/g," ").replace(/^[ \t]*(#{1,6}|>|[-*+]|\d+\.)[ \t]+/gm,"").replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/(\*\*|__|\*|_|`|~~)/g,"").replace(/[ \t]+$/gm,"").replace(/\n{3,}/g,`
|
|
15
15
|
|
|
16
|
-
`).trim()}const il="documents.describe",sl="documents.inspect",al="documents.apply";function cl(e){const t=e.indexOf(":");if(t!==-1)return e.slice(0,t);const n=e.indexOf(".");return n===-1?e:e.slice(0,n)}const ll="installation-id";function ul(e){const t=[];for(const n of Object.keys(e))for(const r of Object.keys(e[n]))t.push({lang:n,key:r,value:e[n][r]});return t}const dl="notification-source",pl=(e,t)=>`${e}.pref.${t}`,fl={ai:["account.read","account.write","agent.read","agent.write","assignment.read","assignment.write","budget.read","budget.write","connector.read","connector.write","context.read","context.write","conversation.read","conversation.write","lens.read","lens.write","message.read","message.write","playbook.read","playbook.write","profile.read","profile.write","run.read","run.write","settings.read","settings.write","tool.read","transcript.write","usage.read"],analytics:["report.read"],"app-store":["app.publish","app.read","app.write","setting.read","setting.write"],assist:["board.read"],automations:["sync.read","sync.write","webhook.read","webhook.write"],communication:["account.read","account.write","activity-type.read","activity.read","activity.write","attachment.read","attribute.read","attribute.write","calendar.read","calendar.write","channel.read","channel.write","custom-field.read","custom-field.write","folder.read","folder.write","inbox.read","inbox.write","interaction.read","interaction.write","reaction.read","reaction.write","reminder.read","template.read","template.write","topic.read","topic.write"],context:["kind.read","kind.write","memory.read","memory.write"],crm:["company.read","company.write","contact.read","contact.write"],"eylo-voip":["account.read","account.write","callflow.read","callflow.write","channel.read","channel.write","contact.read","contact.write","device.read","device.write","group.read","group.write","interaction.read","interaction.write","media.read","media.write","menu.read","menu.write","phone-number.read","phone-number.write","recording.read","recording.write","sip.read","temporal-rule.read","temporal-rule.write","user.read","user.write","vmbox.read","vmbox.write","webhook.read","webhook.write"],google:["account.read","account.write","contact.read"],kb:["article.read","article.write","category.read","category.write","help-center.read","help-center.write","kb.read","kb.write"],mail:["account.write"],meta:["account.read","account.write"],microsoft:["account.read","account.write","contact.read","sync.write"],organization:["billing.read","billing.write","settings.read","settings.write","team.read","team.write"],shopify:["account.read","account.write","order.read"],slack:["thread.read","thread.write"],storage:["artifact.read","artifact.write","file.read","file.write","mount.read","mount.write"],time:["entry.read","entry.write","work-type.read","work-type.write"],user:["user.read","user.write"],work:["item.read","item.write","project.read","project.write"]},mt=9e4,Jr=["out_of_office"],Zr=e=>Jr.includes(e);function ml(e,t,n){const r=n-e<mt,o=t?.status&&(!t.expiresAt||t.expiresAt>n)?t:void 0;if(!o?.status)return{online:r,status:r?"available":"offline"};const i=o.status;return!r&&!Zr(i)?{online:!1,status:"offline"}:{online:r,status:i,message:o.message}}function hl(e,t){const n=t-e.lastSeenAt<mt,r=n||Zr(e.status)?e.status:"offline";return n===e.online&&r===e.status?e:{...e,online:n,status:r}}function gl(e,t){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}}function El(e){return e.providerAvailable&&e.allowed}const yl="resources.describe",_l="resources.search",Sl="resources.resolve",Al="resources.attached";function bl(e){const t=e.indexOf(":");return t===-1?e:e.slice(0,t)}const Tl="/provider/scope/related",Il="/provider/scope/read",ht="auth";function gt(e){const t=typeof e=="string"?e.match(/apps\/([^/?#]+)/):null;return t?t[1]:null}function Ml(e){const t=gt(e);return t?t!==ht:typeof e=="string"&&e.startsWith("/wake")}function Ol(e){return typeof e!="string"||e===""||e==="/"?!0:gt(e)===ht}function wl(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qr(e){const n=e.split("/").filter(Boolean).map(r=>r.startsWith(":")?r.endsWith("?")?"(?:/[^/]+)?":"/[^/]+":`/${wl(r)}`).join("");return new RegExp(`^${n}\\/?$`)}function eo(e,t){const n=e.split("/").filter(Boolean),r=t.split("/").filter(Boolean),o={};return n.forEach((i,s)=>{if(i.startsWith(":")){const a=i.endsWith("?")?i.slice(1,-1):i.slice(1),l=r[s];l&&(o[a]=l)}}),o}function to(e){return e.publicBasePath??`/apps/${e.name}`}function Rl(e){const t=[];for(const n of e){if(!n?.name)continue;const r=to(n);for(const o of n.routes??[]){if(!o.public)continue;const i=o.path==="/"?"":o.path;t.push({appName:n.name,resource:o.resource,pattern:`${r}${i}`,props:o.props})}}return t}function no(e,t){const n=e.split("/").filter(Boolean),r=t.split("/").filter(Boolean);for(let o=0;o<Math.min(n.length,r.length);o++){const i=n[o].startsWith(":"),s=r[o].startsWith(":");if(i!==s)return s}return n.length>r.length}function ro(e,t){if(typeof e!="string")return null;let n=null;for(const r of t)Qr(r.pattern).test(e)&&(!n||no(r.pattern,n.pattern))&&(n=r);return n?{...n,params:{...n.props,...eo(n.pattern,e)}}:null}function Cl(e,t){return ro(e,t)!==null}const kl=10*1024*1024,Nl=25*1024*1024,vl="sync-target",Dl=20,xl={afrikaans:["[Muziek]","(C) TV GELDERLAND 2021","*Thomp thomp thomp*","www.youtube.com","ä n wood s","!.."],english:["[applause]","[APPLAUSE]","(claps)","(clapping)","(audience applauds)","(keyboard clicking)","(keyboard clacking)","(clicking)","[CLICK]","[BLANK_AUDIO]","(upbeat music)","(dramatic music)","[music playing]","(electronic music)","(audience cheering)","(audience cheers)","[MUSIC]","( ( ( ( ) ( ) ( ) ( )","(laughs)","(air whooshing)","<u>Transcribed</u> by https://otter.ai","All new tonight at 6... coming up. A new look at your forecast is A new look at your forecast is","www.mooji.org","KATHRYN A new forecast is coming up... A new forecast is coming up...","KATHRYN pandemic started. increasing since the The pandemic has been","A new look at your forecast this morning... A new look at your","We'll be right back.","We'll see you next week.","Thanks for watching!","❤️ Translated by Amara.org Communit"],flemish:["*clap*","TV GELDERLAND 2020","TV Gelderland 2021","(C) TV GELDERLAND 2021","[Muziek]","Kuman","Ondertitels ingediend door de Amara.org gemeenschap","Ondertiteld door de Amara.org gemeenschap","Dank u wel voor het kijken.","Ondertiteling door de Amara.org gemeenschap","GELUID VAN MAHIH U similarly"],french:["(applaudissements)","[Applaudissements]","Sous-titres réalisés par la communauté d'Amara.org","- Bonne journée. - Bonjour.","POP POP הי","Merci d'avoir regardé cette vidéo.","Merci d'avoir regardé cette vidéo!","Merci d'avoir regardé la vidéo.","J'espère que vous avez apprécié la vidéo.","Je vous remercie de vous abonner","Merci d'avoir regardé!","❤️ par SousTitreur.com","— Sous-titrage ST'501 —","Thanks for watching!","Sous-titres réalisés par l'Amara.org","Sous-titres réalisés para la communauté d'Amara.org","Sous-titres réalisés par la communauté d'Amara.org","Sous-titres fait par Sous-titres par Amara.org","Sous-titres réalisés par les SousTitres d'Amara.org","Sous-titres par Amara.org","Sous-titres par la communauté d'Amara.org","Sous-titres réalisés pour la communauté d'Amara.org","Sous-titres réalisés par la communauté de l'Amara.org","Sous-Titres faits par la communauté d'Amara.org","Sous-titres par l'Amara.org","Sous-titres fait par la communauté d'Amara.org","Sous-titrage ST' 501","Sous-titrage ST'501","Cliquez-vous sur les sous-titres et abonnez-vous à la chaîne d'Amara.org","❤️ par SousTitreur.com"],german:["[Klicken]","(Jubel)","*lacht*","[Anhaltender Beifall]","[Applaus]","(Applaus)","* Applaus *","[MUSIK]","* mustard ml Drumglöck und knack in einem Handbewerb *","Untertitelung aufgrund der Amara.org-Community","Untertitel im Auftrag des ZDF für funk, 2017","Untertitel von Stephanie Geiges","Untertitel der Amara.org-Community","Untertitel im Auftrag des ZDF, 2017","Untertitel im Auftrag des ZDF, 2020","Untertitel im Auftrag des ZDF, 2018","Untertitel im Auftrag des ZDF, 2021","Untertitelung im Auftrag des ZDF, 2021","Copyright WDR 2021","Copyright WDR 2020","Copyright WDR 2019","SWR 2021","SWR 2020"],italian:["Alla prossima!","*applauso*","[Musica]","[Musica]","[Applausi]","*Bip bip bip bip*","(musica del NS shore)","D' 1962 alle tribunte del Gulf","Sottotitoli creati dalla comunità Amara.org","Sottotitoli di Sottotitoli di Amara.org","Sottotitoli e revisione al canale di Amara.org","Sottotitoli e revisione a cura di Amara.org","Sottotitoli e revisione a cura di QTSS","Sottotitoli e revisione a cura di QTSS.","Sottotitoli a cura di QTSS","Sottotitoli a cura di Sottotitoli"],spanish:["[música]","[Música de cierre]","[Aplausos]","(Aplausos)","www.alimmenta.com","¡Gracias por ver el vídeo!","(sonidos del celular) (Inudible distorsión)","¡Suscríbete!","Subtítulos realizados por la comunidad de Amara.org","Subtitulado por la comunidad de Amara.org","Subtítulos por la comunidad de Amara.org","Subtítulos creados por la comunidad de Amara.org","Subtítulos en español de Amara.org","Subtítulos hechos por la comunidad de Amara.org","Subtitulos por la comunidad de Amara.org","Más información www.alimmenta.com","www.mooji.org","[MÚSICA]","[Music cuts in British]"]},oo=e=>{let t=e;return Object.values(xl).forEach(n=>{n.forEach(r=>{t=t.replaceAll(r,"")})}),t=t.replace(/\(.*?\)/g,""),t=t.replace(/\[.*?\]/g,""),t},io=6e4,so=8e3,ao=2,co=.4,Ll=3,Pl=new Set(["aan","als","ben","bent","bij","dan","dat","deze","die","dit","doen","door","dus","echt","een","eens","even","gaan","gaat","geen","geweest","goed","graag","had","heb","hebben","hebt","heeft","het","hier","hoe","hoor","iets","inderdaad","kan","klopt","kunnen","kunt","maar","mag","mee","meer","met","mij","mijn","misschien","moet","moeten","naar","net","niet","nog","nou","oke","ook","over","prima","toch","uhm","uit","van","veel","voor","wat","weer","weet","wel","wij","wil","wilt","worden","wordt","zeg","zeggen","zijn","zou","zult","about","and","are","been","but","can","does","for","have","just","know","like","not","okay","right","she","that","the","them","then","there","they","this","want","was","well","were","what","will","with","would","yeah","you","your"]);function lo(e){const t=new Set;for(const n of e.toLowerCase().split(/[^a-z0-9À-ɏ]+/))n.length<Ll||Pl.has(n)||t.add(n);return[...t]}function uo(e,t){if(!e.length)return 0;if(!t.length)return 1;const n=new Set(t),r=new Set(e);let o=0;for(const i of r)n.has(i)||(o+=1);return o/r.size}function po(e,t=io){const n=e.filter(s=>!s.partial&&typeof s.text=="string");if(!n.length)return{text:"",segmentCount:0};const o=n.reduce((s,a)=>Math.max(s,a.endedAt??0),0)-t;return{text:n.filter(s=>(s.endedAt??0)>=o).map(s=>oo(s.text).trim()).filter(Boolean).join(" ").replace(/\s+/g," ").trim(),segmentCount:n.length}}const fo=60;function Ul(e,t,n=fo){const r=new Set(e),o=[...e];for(const i of t)!i||r.has(i)||(r.add(i),o.push(i));return o.slice(-n)}function $l(e){const{segments:t,now:n,state:r}=e;if(r.lastTriggerAt&&n-r.lastTriggerAt<so)return{trigger:!1,reason:"too_soon"};const o=po(t,e.windowMs);if(!o.text)return{trigger:!1,reason:"no_speech"};const i=o.segmentCount-(r.lastSegmentCount??0);if(r.lastQueryTerms&&i<ao)return{trigger:!1,reason:"too_few_new"};const s=lo(o.text);return s.length?r.lastQueryTerms?.length&&uo(s,r.lastQueryTerms)<co?{trigger:!1,reason:"same_topic"}:{trigger:!0,text:o.text,terms:s,segmentCount:o.segmentCount}:{trigger:!1,reason:"no_speech"}}const Kl=["personal","workspace","connections","work","ai"],Fl="navNotice",Oe={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}},mo="NL",Bl=15,Hl=8,Wl=Array.from(new Set(Object.values(Oe).map(e=>e.callingCode))).sort((e,t)=>t.length-e.length);function $t(e){if(e)return Oe[e.trim().toUpperCase()]}function oe(e,t){return e.length>=t.nsnMin&&e.length<=t.nsnMax}function Kt(e){if(e.length>Bl)return null;for(const t of Wl){if(!e.startsWith(t))continue;const n=e.slice(t.length);for(const r of Object.values(Oe)){if(r.callingCode!==t)continue;const o=r.trunkPrefix,i=o&&n.startsWith(o)?n.slice(o.length):n;if(oe(i,r))return`+${t}${i}`}return null}return e.length<Hl?null:`+${e}`}function Gl(e){let t=e.trim();const n=t.match(/^(sips?|tel|whatsapp):/i);n&&(t=t.slice(n[0].length));const r=t.indexOf("@");return r>=0&&(t=t.slice(0,r)),t.trim()}function Vl(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 Ye(e,t){if(!e)return null;const n=Gl(e);if(!n)return null;const r=n.startsWith("+"),o=n.replace(/\D/g,"");if(!o)return null;if(r)return Kt(o);if(o.startsWith("00"))return Kt(o.slice(2));const i=$t(t)??$t(mo);if(!i)return null;const s=i.trunkPrefix;if(s&&o.startsWith(s)){const a=o.slice(s.length);return oe(a,i)?`+${i.callingCode}${a}`:null}if(o.startsWith(i.callingCode)){const a=o.slice(i.callingCode.length);if(oe(a,i))return`+${i.callingCode}${a}`}return!s&&oe(o,i)?`+${i.callingCode}${o}`:null}function jl(e,t=9){const n=(e??"").replace(/\D/g,"");return n.length<t?null:n.slice(-t)}function Et(e){if(!e)return null;const t=e.trim().toLowerCase(),n=t.lastIndexOf("@");if(n<=0||n===t.length-1)return null;const r=t.slice(0,n).split("+")[0],o=t.slice(n+1);return!r||!o.includes(".")?null:`${r}@${o}`}function Yl(e){const t=Et(e);return t?t.slice(t.lastIndexOf("@")+1):null}const Xl=new Set(["co.uk","org.uk","gov.uk","ac.uk","com.au","co.nz","com.br","co.za"]);function ho(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 Xl.has(n)&&t.length>=3?t.slice(-3).join("."):n}const go=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 zl(e){const t=ho(e);return t?go.has(t):!1}function ql(e){if(!e)return!1;const t=e.trim().toLowerCase();return t==="tel"||t==="sms"||t==="whatsapp"||t==="fax"}function Jl(e,t,n){if(!e||!t)return null;const r=e.trim().toLowerCase();if(r==="tel"||r==="sms"||r==="whatsapp"){const i=Ye(t,n);return i?`tel:${i}`:null}if(r==="fax"){const i=Ye(t,n);return i?`fax:${i}`:null}if(r==="mailto"||r==="email"){const i=Et(t);return i?`mailto:${i}`:null}const o=t.trim().toLowerCase();return o?`${r}:${o}`:null}const Zl=[/<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],Ft=/^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i,Ql=/^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;function eu(e){const t=e.split(`
|
|
16
|
+
`).trim()}const il="documents.describe",sl="documents.inspect",al="documents.apply";function cl(e){const t=e.indexOf(":");if(t!==-1)return e.slice(0,t);const n=e.indexOf(".");return n===-1?e:e.slice(0,n)}const ll="installation-id";function ul(e){const t=[];for(const n of Object.keys(e))for(const r of Object.keys(e[n]))t.push({lang:n,key:r,value:e[n][r]});return t}const dl="notification-source",pl=(e,t)=>`${e}.pref.${t}`,fl={ai:["account.read","account.write","agent.read","agent.write","assignment.read","assignment.write","budget.read","budget.write","connector.read","connector.write","context.read","context.write","conversation.read","conversation.write","lens.read","lens.write","message.read","message.write","playbook.read","playbook.write","profile.read","profile.write","run.read","run.write","settings.read","settings.write","tool.read","transcript.write","usage.read"],analytics:["report.read"],"app-store":["app.publish","app.read","app.write","setting.read","setting.write"],assist:["board.read"],automations:["sync.read","sync.write","webhook.read","webhook.write"],communication:["account.read","account.write","activity-type.read","activity.read","activity.write","attachment.read","attribute.read","attribute.write","calendar.read","calendar.write","channel.read","channel.write","custom-field.read","custom-field.write","folder.read","folder.write","inbox.read","inbox.write","interaction.read","interaction.write","reaction.read","reaction.write","reminder.read","template.read","template.write","topic.read","topic.write"],context:["kind.read","kind.write","memory.read","memory.write"],crm:["company.read","company.write","contact.read","contact.write"],"eylo-voip":["account.read","account.write","callflow.read","callflow.write","channel.read","channel.write","contact.read","contact.write","device.read","device.write","group.read","group.write","interaction.read","interaction.write","media.read","media.write","menu.read","menu.write","phone-number.read","phone-number.write","recording.read","recording.write","sip.read","temporal-rule.read","temporal-rule.write","user.read","user.write","vmbox.read","vmbox.write","webhook.read","webhook.write"],google:["account.read","account.write","contact.read"],kb:["article.read","article.write","category.read","category.write","help-center.read","help-center.write","kb.read","kb.write"],mail:["account.write"],meta:["account.read","account.write"],microsoft:["account.read","account.write","contact.read","sync.write"],organization:["billing.read","billing.write","settings.read","settings.write","team.read","team.write"],shopify:["account.read","account.write","order.read"],slack:["thread.read","thread.write"],storage:["artifact.read","artifact.write","file.read","file.write","mount.read","mount.write"],time:["entry.read","entry.write","work-type.read","work-type.write"],user:["user.read","user.write"],work:["item.read","item.write","project.read","project.write"]},mt=9e4,Jr=["out_of_office"],Zr=e=>Jr.includes(e);function ml(e,t,n){const r=n-e<mt,o=t?.status&&(!t.expiresAt||t.expiresAt>n)?t:void 0;if(!o?.status)return{online:r,status:r?"available":"offline"};const i=o.status;return!r&&!Zr(i)?{online:!1,status:"offline"}:{online:r,status:i,message:o.message}}function hl(e,t){const n=t-e.lastSeenAt<mt,r=n||Zr(e.status)?e.status:"offline";return n===e.online&&r===e.status?e:{...e,online:n,status:r}}function gl(e,t){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}}function El(e){return e.providerAvailable&&e.allowed}const yl="resources.describe",_l="resources.search",Sl="resources.resolve",Al="resources.attached";function bl(e){const t=e.indexOf(":");return t===-1?e:e.slice(0,t)}const Tl="/provider/scope/related",Il="/provider/scope/read",ht="auth";function gt(e){const t=typeof e=="string"?e.match(/apps\/([^/?#]+)/):null;return t?t[1]:null}function Ml(e){const t=gt(e);return t?t!==ht:typeof e=="string"&&e.startsWith("/wake")}function Ol(e){return typeof e!="string"||e===""||e==="/"?!0:gt(e)===ht}function wl(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qr(e){const n=e.split("/").filter(Boolean).map(r=>r.startsWith(":")?r.endsWith("?")?"(?:/[^/]+)?":"/[^/]+":`/${wl(r)}`).join("");return new RegExp(`^${n}\\/?$`)}function eo(e,t){const n=e.split("/").filter(Boolean),r=t.split("/").filter(Boolean),o={};return n.forEach((i,s)=>{if(i.startsWith(":")){const a=i.endsWith("?")?i.slice(1,-1):i.slice(1),l=r[s];l&&(o[a]=l)}}),o}function to(e){return e.publicBasePath??`/apps/${e.name}`}function Rl(e){const t=[];for(const n of e){if(!n?.name)continue;const r=to(n);for(const o of n.routes??[]){if(!o.public)continue;const i=o.path==="/"?"":o.path;t.push({appName:n.name,resource:o.resource,pattern:`${r}${i}`,props:o.props})}}return t}function no(e,t){const n=e.split("/").filter(Boolean),r=t.split("/").filter(Boolean);for(let o=0;o<Math.min(n.length,r.length);o++){const i=n[o].startsWith(":"),s=r[o].startsWith(":");if(i!==s)return s}return n.length>r.length}function ro(e,t){if(typeof e!="string")return null;let n=null;for(const r of t)Qr(r.pattern).test(e)&&(!n||no(r.pattern,n.pattern))&&(n=r);return n?{...n,params:{...n.props,...eo(n.pattern,e)}}:null}function Cl(e,t){return ro(e,t)!==null}const kl=10*1024*1024,Nl=25*1024*1024,vl="sync-target",Dl=20,xl={afrikaans:["[Muziek]","(C) TV GELDERLAND 2021","*Thomp thomp thomp*","www.youtube.com","ä n wood s","!.."],english:["[applause]","[APPLAUSE]","(claps)","(clapping)","(audience applauds)","(keyboard clicking)","(keyboard clacking)","(clicking)","[CLICK]","[BLANK_AUDIO]","(upbeat music)","(dramatic music)","[music playing]","(electronic music)","(audience cheering)","(audience cheers)","[MUSIC]","( ( ( ( ) ( ) ( ) ( )","(laughs)","(air whooshing)","<u>Transcribed</u> by https://otter.ai","All new tonight at 6... coming up. A new look at your forecast is A new look at your forecast is","www.mooji.org","KATHRYN A new forecast is coming up... A new forecast is coming up...","KATHRYN pandemic started. increasing since the The pandemic has been","A new look at your forecast this morning... A new look at your","We'll be right back.","We'll see you next week.","Thanks for watching!","❤️ Translated by Amara.org Communit"],flemish:["*clap*","TV GELDERLAND 2020","TV Gelderland 2021","(C) TV GELDERLAND 2021","[Muziek]","Kuman","Ondertitels ingediend door de Amara.org gemeenschap","Ondertiteld door de Amara.org gemeenschap","Dank u wel voor het kijken.","Ondertiteling door de Amara.org gemeenschap","GELUID VAN MAHIH U similarly"],french:["(applaudissements)","[Applaudissements]","Sous-titres réalisés par la communauté d'Amara.org","- Bonne journée. - Bonjour.","POP POP הי","Merci d'avoir regardé cette vidéo.","Merci d'avoir regardé cette vidéo!","Merci d'avoir regardé la vidéo.","J'espère que vous avez apprécié la vidéo.","Je vous remercie de vous abonner","Merci d'avoir regardé!","❤️ par SousTitreur.com","— Sous-titrage ST'501 —","Thanks for watching!","Sous-titres réalisés par l'Amara.org","Sous-titres réalisés para la communauté d'Amara.org","Sous-titres réalisés par la communauté d'Amara.org","Sous-titres fait par Sous-titres par Amara.org","Sous-titres réalisés par les SousTitres d'Amara.org","Sous-titres par Amara.org","Sous-titres par la communauté d'Amara.org","Sous-titres réalisés pour la communauté d'Amara.org","Sous-titres réalisés par la communauté de l'Amara.org","Sous-Titres faits par la communauté d'Amara.org","Sous-titres par l'Amara.org","Sous-titres fait par la communauté d'Amara.org","Sous-titrage ST' 501","Sous-titrage ST'501","Cliquez-vous sur les sous-titres et abonnez-vous à la chaîne d'Amara.org","❤️ par SousTitreur.com"],german:["[Klicken]","(Jubel)","*lacht*","[Anhaltender Beifall]","[Applaus]","(Applaus)","* Applaus *","[MUSIK]","* mustard ml Drumglöck und knack in einem Handbewerb *","Untertitelung aufgrund der Amara.org-Community","Untertitel im Auftrag des ZDF für funk, 2017","Untertitel von Stephanie Geiges","Untertitel der Amara.org-Community","Untertitel im Auftrag des ZDF, 2017","Untertitel im Auftrag des ZDF, 2020","Untertitel im Auftrag des ZDF, 2018","Untertitel im Auftrag des ZDF, 2021","Untertitelung im Auftrag des ZDF, 2021","Copyright WDR 2021","Copyright WDR 2020","Copyright WDR 2019","SWR 2021","SWR 2020"],italian:["Alla prossima!","*applauso*","[Musica]","[Musica]","[Applausi]","*Bip bip bip bip*","(musica del NS shore)","D' 1962 alle tribunte del Gulf","Sottotitoli creati dalla comunità Amara.org","Sottotitoli di Sottotitoli di Amara.org","Sottotitoli e revisione al canale di Amara.org","Sottotitoli e revisione a cura di Amara.org","Sottotitoli e revisione a cura di QTSS","Sottotitoli e revisione a cura di QTSS.","Sottotitoli a cura di QTSS","Sottotitoli a cura di Sottotitoli"],spanish:["[música]","[Música de cierre]","[Aplausos]","(Aplausos)","www.alimmenta.com","¡Gracias por ver el vídeo!","(sonidos del celular) (Inudible distorsión)","¡Suscríbete!","Subtítulos realizados por la comunidad de Amara.org","Subtitulado por la comunidad de Amara.org","Subtítulos por la comunidad de Amara.org","Subtítulos creados por la comunidad de Amara.org","Subtítulos en español de Amara.org","Subtítulos hechos por la comunidad de Amara.org","Subtitulos por la comunidad de Amara.org","Más información www.alimmenta.com","www.mooji.org","[MÚSICA]","[Music cuts in British]"]},oo=e=>{let t=e;return Object.values(xl).forEach(n=>{n.forEach(r=>{t=t.replaceAll(r,"")})}),t=t.replace(/\(.*?\)/g,""),t=t.replace(/\[.*?\]/g,""),t},io=6e4,so=8e3,ao=2,co=.4,Ll=3,Pl=new Set(["aan","als","ben","bent","bij","dan","dat","deze","die","dit","doen","door","dus","echt","een","eens","even","gaan","gaat","geen","geweest","goed","graag","had","heb","hebben","hebt","heeft","het","hier","hoe","hoor","iets","inderdaad","kan","klopt","kunnen","kunt","maar","mag","mee","meer","met","mij","mijn","misschien","moet","moeten","naar","net","niet","nog","nou","oke","ook","over","prima","toch","uhm","uit","van","veel","voor","wat","weer","weet","wel","wij","wil","wilt","worden","wordt","zeg","zeggen","zijn","zou","zult","about","and","are","been","but","can","does","for","have","just","know","like","not","okay","right","she","that","the","them","then","there","they","this","want","was","well","were","what","will","with","would","yeah","you","your"]);function lo(e){const t=new Set;for(const n of e.toLowerCase().split(/[^a-z0-9À-ɏ]+/))n.length<Ll||Pl.has(n)||t.add(n);return[...t]}function uo(e,t){if(!e.length)return 0;if(!t.length)return 1;const n=new Set(t),r=new Set(e);let o=0;for(const i of r)n.has(i)||(o+=1);return o/r.size}function po(e,t=io){const n=e.filter(s=>!s.partial&&typeof s.text=="string");if(!n.length)return{text:"",segmentCount:0};const o=n.reduce((s,a)=>Math.max(s,a.endedAt??0),0)-t;return{text:n.filter(s=>(s.endedAt??0)>=o).map(s=>oo(s.text).trim()).filter(Boolean).join(" ").replace(/\s+/g," ").trim(),segmentCount:n.length}}const fo=60;function Ul(e,t,n=fo){const r=new Set(e),o=[...e];for(const i of t)!i||r.has(i)||(r.add(i),o.push(i));return o.slice(-n)}function $l(e){const{segments:t,now:n,state:r}=e;if(r.lastTriggerAt&&n-r.lastTriggerAt<so)return{trigger:!1,reason:"too_soon"};const o=po(t,e.windowMs);if(!o.text)return{trigger:!1,reason:"no_speech"};const i=o.segmentCount-(r.lastSegmentCount??0);if(r.lastQueryTerms&&i<ao)return{trigger:!1,reason:"too_few_new"};const s=lo(o.text);return s.length?r.lastQueryTerms?.length&&uo(s,r.lastQueryTerms)<co?{trigger:!1,reason:"same_topic"}:{trigger:!0,text:o.text,terms:s,segmentCount:o.segmentCount}:{trigger:!1,reason:"no_speech"}}const Kl=["personal","workspace","connections","work","ai"],Fl="navNotice",we={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}},mo="NL",Bl=15,Hl=8,Wl=Array.from(new Set(Object.values(we).map(e=>e.callingCode))).sort((e,t)=>t.length-e.length);function $t(e){if(e)return we[e.trim().toUpperCase()]}function oe(e,t){return e.length>=t.nsnMin&&e.length<=t.nsnMax}function Kt(e){if(e.length>Bl)return null;for(const t of Wl){if(!e.startsWith(t))continue;const n=e.slice(t.length);for(const r of Object.values(we)){if(r.callingCode!==t)continue;const o=r.trunkPrefix,i=o&&n.startsWith(o)?n.slice(o.length):n;if(oe(i,r))return`+${t}${i}`}return null}return e.length<Hl?null:`+${e}`}function Gl(e){let t=e.trim();const n=t.match(/^(sips?|tel|whatsapp):/i);n&&(t=t.slice(n[0].length));const r=t.indexOf("@");return r>=0&&(t=t.slice(0,r)),t.trim()}function Vl(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 Ye(e,t){if(!e)return null;const n=Gl(e);if(!n)return null;const r=n.startsWith("+"),o=n.replace(/\D/g,"");if(!o)return null;if(r)return Kt(o);if(o.startsWith("00"))return Kt(o.slice(2));const i=$t(t)??$t(mo);if(!i)return null;const s=i.trunkPrefix;if(s&&o.startsWith(s)){const a=o.slice(s.length);return oe(a,i)?`+${i.callingCode}${a}`:null}if(o.startsWith(i.callingCode)){const a=o.slice(i.callingCode.length);if(oe(a,i))return`+${i.callingCode}${a}`}return!s&&oe(o,i)?`+${i.callingCode}${o}`:null}function jl(e,t=9){const n=(e??"").replace(/\D/g,"");return n.length<t?null:n.slice(-t)}function Et(e){if(!e)return null;const t=e.trim().toLowerCase(),n=t.lastIndexOf("@");if(n<=0||n===t.length-1)return null;const r=t.slice(0,n).split("+")[0],o=t.slice(n+1);return!r||!o.includes(".")?null:`${r}@${o}`}function Yl(e){const t=Et(e);return t?t.slice(t.lastIndexOf("@")+1):null}const Xl=new Set(["co.uk","org.uk","gov.uk","ac.uk","com.au","co.nz","com.br","co.za"]);function ho(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 Xl.has(n)&&t.length>=3?t.slice(-3).join("."):n}const go=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 zl(e){const t=ho(e);return t?go.has(t):!1}function ql(e){if(!e)return!1;const t=e.trim().toLowerCase();return t==="tel"||t==="sms"||t==="whatsapp"||t==="fax"}function Jl(e,t,n){if(!e||!t)return null;const r=e.trim().toLowerCase();if(r==="tel"||r==="sms"||r==="whatsapp"){const i=Ye(t,n);return i?`tel:${i}`:null}if(r==="fax"){const i=Ye(t,n);return i?`fax:${i}`:null}if(r==="mailto"||r==="email"){const i=Et(t);return i?`mailto:${i}`:null}const o=t.trim().toLowerCase();return o?`${r}:${o}`:null}const Zl=[/<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],Ft=/^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i,Ql=/^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;function eu(e){const t=e.split(`
|
|
17
17
|
`);for(let n=0;n<t.length;n++)if(Ql.test(t[n])||Ft.test(t[n])&&t.slice(n+1,n+4).some(r=>Ft.test(r)))return t.slice(0,n).join(`
|
|
18
|
-
`).trim();return e}const tu=/^(?:https?:|mailto:|tel:)/i,nu=/^(?:https?:|cid:|data:image\/)/i;function
|
|
18
|
+
`).trim();return e}const tu=/^(?:https?:|mailto:|tel:)/i,nu=/^(?:https?:|cid:|data:image\/)/i;function De(e,t){const n=e.match(new RegExp(`\\b${t}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s">]+))`,"i"));return(n?.[1]??n?.[2]??n?.[3]??"").trim()}const ru=/(!\[[^\]]*\]\([^)]*\))/;function Bt(e){return e.replace(/\s+/g," ").trim().split(ru).map((t,n)=>n%2===1?t:t.replace(/[[\]]/g,"\\$&")).join("")}function xe(e){return e.replace(/[()\s<>"]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0")}`)}function ou(e){return e.replace(/<img\b([^>]*?)\/?>/gi,(n,r)=>{const o=De(r,"src");return nu.test(o)?`})`:""}).replace(/<a\b([^>]*)>([\s\S]*?)<\/a\s*>/gi,(n,r,o)=>{const i=Bt(o.replace(/<[^>]*>/g,"")),s=De(r,"href");return tu.test(s)?`[${i||xe(s)}](${xe(s)})`:i})}const iu=/<table\b[^>]*>((?:(?!<table\b)[\s\S])*?)<\/table\s*>/i,su=/<tr\b[^>]*>([\s\S]*?)<\/tr\s*>/gi,au=/<(t[dh])\b([^>]*)>([\s\S]*?)<\/\1\s*>/gi;function cu(e,t){return/<table\b/i.test(e)||e.includes(`
|
|
19
19
|
|
|
20
20
|
|`)||t.includes("![")||t.length>200}const lu=40,uu={left:"---",center:":---:",right:"---:"};function du(e){const t=e.match(/align\s*[=:]\s*["']?\s*(right|center)/i);return t?t[1].toLowerCase():"left"}function pu(e){return e.replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim().replace(/\|/g,"\\|")}function fu(e){const t=[];for(const s of e.matchAll(su)){const a=[];for(const l of s[1].matchAll(au)){const u=pu(l[3]);if(cu(l[3],u))return null;a.push({text:u,align:du(l[2])})}if(a.length===0)return null;a.some(l=>l.text!=="")&&t.push(a)}const n=t[0]?.length??0;if(t.length<2||n<2||t.some(s=>s.length!==n))return null;const r=s=>`| ${s.map(a=>a.text).join(" | ")} |`,o=t[1].map(s=>uu[s.align]).join(" | "),i=t.slice(1).map(r).join(`
|
|
21
21
|
`);return`
|
|
@@ -36,4 +36,4 @@ ${mu(r[1])}
|
|
|
36
36
|
`),n=n.replace(/<\/(td|th)>/gi," "),n=n.replace(/<[^>]+>/g,""),n=n.replace(/<[^>]*$/,""),n}function Wt(e){return!Number.isInteger(e)||e<0||e>1114111?null:String.fromCodePoint(e)}const gu={euro:"€",pound:"£",yen:"¥",cent:"¢",copy:"©",reg:"®",trade:"™",deg:"°",plusmn:"±",times:"×",middot:"·",bull:"•",hellip:"…",mdash:"—",ndash:"–",lsquo:"‘",rsquo:"’",ldquo:"“",rdquo:"”",apos:"'"};function Gt(e){return e.replace(/ /gi," ").replace(/&([a-z]+);/gi,(t,n)=>gu[n.toLowerCase()]??t).replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/&#(\d+);/g,(t,n)=>Wt(Number(n))??t).replace(/&#x([0-9a-f]+);/gi,(t,n)=>Wt(parseInt(n,16))??t).replace(/&/gi,"&")}function Vt(e){return e.replace(/\r/g,"").replace(/[ \t]+/g," ").replace(/ *\n */g,`
|
|
37
37
|
`).replace(/\n{3,}/g,`
|
|
38
38
|
|
|
39
|
-
`).trim()}const Eo=/<\s*(html|body|div|p|table|br|span)\b/i;function Eu(e){return Eo.test(e)}function yu(e){return yo(e,!1)}function _u(e){return yo(e,!0)}function yo(e,t){if(typeof e!="string"||!e)return"";let n=e.length;for(const s of Zl){const a=e.search(s);a>=0&&a<n&&(n=a)}const r=e.slice(0,n);let o=Vt(Gt(Ht(r,t)));return o||(o=Vt(Gt(Ht(e,t)))),eu(o)||o}exports.ACTIVE_ASSIGNMENT_STATUSES=mi;exports.ACTIVITY_CATALOG=D;exports.AI_ATTACHMENT_LIMITS=Vr;exports.AI_ATTACHMENT_MAX_PER_TURN=Ac;exports.AI_ATTACHMENT_TURN_BUDGET=Sc;exports.AI_VENDORS=qe;exports.ALLOWED_LINK_SCHEMES=an;exports.APP_PERMISSIONS=fl;exports.ARTIFACT_MAX_BLOCKS=ae;exports.ARTIFACT_MAX_BODY_BYTES=sn;exports.ARTIFACT_MAX_CELL_LEN=U;exports.ARTIFACT_MAX_KPI_ITEMS=de;exports.ARTIFACT_MAX_LIST_ITEMS=ce;exports.ARTIFACT_MAX_TABLE_COLUMNS=ue;exports.ARTIFACT_MAX_TABLE_ROWS=le;exports.ARTIFACT_MAX_TEXT_LEN=ye;exports.ASSIGNMENT_SCOPE_KIND=fn;exports.ASSIST_BANDS=Oc;exports.ASSIST_SOURCE_PROVIDER_GROUP=Mc;exports.ATTENTION_STATUSES=On;exports.AT_RISK_GAP=wr;exports.AUTH_APP_NAME=ht;exports.AUTO_READY_MIN_PROPOSALS=fr;exports.AUTO_READY_RATE=mr;exports.ActivityTypeRegistry=Jt;exports.BUILT_IN_ONLY=Uo;exports.BULK_PENALTY=wn;exports.CADENCE_FLOOR_MS=so;exports.CADENCE_MIN_NEW_SEGMENTS=ao;exports.CADENCE_MIN_NOVELTY=co;exports.CADENCE_WINDOW_MS=io;exports.CLASSIFY_VARS=js;exports.CONNECTOR_PROVIDER_GROUP=Xc;exports.CONTEXT_COLLECT_SERVICE=zc;exports.CORE_DIMENSIONS=zo;exports.CommunicationScheme=qr;exports.DAY_MS=_n;exports.DEFAULT_CHECK_IN_DAYS=Mr;exports.DEFAULT_FORECAST_WEEKS=Zn;exports.DEFAULT_MEMORY_BUDGET=is;exports.DEFAULT_PHONE_REGION=mo;exports.DEMAND_SOURCE_PROVIDER_GROUP=gs;exports.DOCUMENT_APPLY_SERVICE=al;exports.DOCUMENT_DESCRIBE_SERVICE=il;exports.DOCUMENT_INSPECT_SERVICE=sl;exports.DOCUMENT_MAX_BLOCKS=ae;exports.DOCUMENT_MAX_BODY_BYTES=sn;exports.DOCUMENT_MAX_CELL_LEN=U;exports.DOCUMENT_MAX_KPI_ITEMS=de;exports.DOCUMENT_MAX_LETTERHEAD_FIELDS=Pe;exports.DOCUMENT_MAX_LIST_ITEMS=ce;exports.DOCUMENT_MAX_RECIPIENT_LINES=on;exports.DOCUMENT_MAX_TABLE_COLUMNS=ue;exports.DOCUMENT_MAX_TABLE_ROWS=le;exports.DOCUMENT_MAX_TEXT_LEN=ye;exports.DOCUMENT_MAX_TOTALS_ROWS=Ue;exports.DOCUMENT_OPERATIONS=ft;exports.EMPTY_WORKFLOW=Xs;exports.FEATURE_FOLDER_MANAGEMENT=Gc;exports.FEATURE_MESSAGE_REACTIONS=jc;exports.FEATURE_REMOTE_SEARCH=Vc;exports.FIXED_KINDS=Se;exports.FIXED_LEVELS=z;exports.FIXED_TYPES=Ie;exports.FOLLOW_UP_HOURS=Cn;exports.HOUR_MS=yn;exports.HTML_BODY_RE=Eo;exports.INELIGIBLE=x;exports.INSTALLATION_HEADER=ll;exports.INTERACTION_KIND=cr;exports.InteractionParticipantRole=Hc;exports.KB_FALLBACK_LOCALE=Fn;exports.KB_LOCALES=$e;exports.LOOSE_STATUSES=Me;exports.MAIL_HINT_HEADERS=In;exports.MAX_ACTIONS=ee;exports.MAX_ASSIGNMENT_TURNS=mn;exports.MAX_BLOCKS=xe;exports.MAX_COLLECTION_DEPTH=nt;exports.MAX_EDITABLE_FILE_BYTES=kl;exports.MAX_FIELDS=Z;exports.MAX_LIST_ITEMS=Q;exports.MAX_MEMORY_BROWSE=ts;exports.MAX_MEMORY_BUDGET=os;exports.MAX_MEMORY_CHARS=ns;exports.MAX_SHOWN_KEYS=fo;exports.MAX_TOPIC_CANDIDATES=vr;exports.MAX_TOPIC_EXAMPLES=Nr;exports.MAX_TOPIC_EXAMPLE_CHARS=ne;exports.MAX_VIEWABLE_FILE_BYTES=Nl;exports.MIN_MEMORY_BUDGET=rs;exports.NAV_NOTICE_SLOT=Fl;exports.NOTIFICATION_SOURCE_PROVIDER_GROUP=dl;exports.OFF_TRACK_GAP=Rr;exports.ONBOARDING_SOURCE_PROVIDER_GROUP=as;exports.PAUSE_SNOOZED=fe;exports.PAUSE_WAITING_FOR_CUSTOMER=me;exports.PHONE_REGIONS=Oe;exports.PRESENCE_ONLINE_WINDOW_MS=mt;exports.PRESENCE_SURVIVES_OFFLINE=Jr;exports.PROFILE_TOOL_DISPOSITIONS=ls;exports.PROVIDER_FEATURE_MESSAGE_TEMPLATES=Bc;exports.PROVIDER_FEATURE_MESSAGE_WINDOW=Fc;exports.PUBLIC_EMAIL_DOMAINS=go;exports.READ_STEP_TYPES=Ke;exports.RELATED_SUBJECT_KINDS=Hn;exports.RESERVED_STATUS_KEYS=pt;exports.RESERVED_TYPE_KEYS=Qa;exports.RESOURCE_ATTACHED_SERVICE=Al;exports.RESOURCE_DESCRIBE_SERVICE=yl;exports.RESOURCE_RESOLVE_SERVICE=Sl;exports.RESOURCE_SEARCH_SERVICE=_l;exports.SCHEDULE_ENTRY_SCOPE_KIND=Qn;exports.SCOPE_READ_ROUTE=Il;exports.SCOPE_RELATED_ROUTE=Tl;exports.SETTINGS_CATEGORIES=Kl;exports.SIGNATURE_INTENTS=Ai;exports.SLA_HOURS_BY_PRIORITY=Rn;exports.SLA_METRICS=ua;exports.SLA_PAUSE_REASONS=da;exports.STEP_MAX_TOKENS_MAX=dr;exports.STEP_MAX_TOKENS_MIN=ur;exports.STRATEGY_ITEM_SCOPE_KIND=Tr;exports.SUMMARY_MIN_LAST_CHARS=Tn;exports.SUMMARY_MIN_MESSAGES=bn;exports.SYNC_RUN_MAX_ERRORS=Dl;exports.SYNC_TARGET_PROVIDER_GROUP=vl;exports.TERMINAL_ASSIGNMENT_STATUSES=pn;exports.TERMINAL_RUN_STATUSES=hr;exports.TRIGGER_VARS=Vs;exports.UNKNOWN_KIND=Wn;exports.UNKNOWN_LEVEL_ORDER=Ir;exports.UNSUPPORTED=Yc;exports.USAGE_DIMENSIONS=en;exports.USAGE_DIMENSION_IDS=tn;exports.WORKSTREAM_SCOPE_KIND=er;exports.WORK_ACTIVITY_SCOPE_KIND=$r;exports.WORK_AREAS=cs;exports.WORK_COMMENT_ADDED=Xa;exports.WORK_CYCLE_SYNC_KIND=oc;exports.WORK_ITEM_ASSIGNED=za;exports.WORK_ITEM_SCOPE_KIND=Pr;exports.WORK_ITEM_STATUS_CHANGED=qa;exports.WORK_PROJECT_SCOPE_KIND=Ur;exports.W_PRIORITY=V;exports.acceptExampleCandidate=Va;exports.actingIdentityKey=rr;exports.activeWorkTypes=Wa;exports.activityIconOf=To;exports.activityJoinUrl=Do;exports.activitySnippet=zt;exports.activityTextParams=qt;exports.activityTimelineText=vo;exports.activityTimestamp=Zt;exports.activityTypeInfo=M;exports.actorKey=Ks;exports.addExampleCandidate=Ga;exports.addWorkingMs=Ae;exports.agePresenceEntry=hl;exports.aiAttachmentKind=Gr;exports.aiAttachmentRejection=bc;exports.aiBudgetLimit=Le;exports.aiBudgetPeriodKey=Yo;exports.aiBudgetPeriodStart=Qt;exports.aiBudgetState=jo;exports.aiVendorAcceptsAttachment=Vo;exports.aiVendorDefaultModel=Ho;exports.aiVendorLabel=Bo;exports.aiVendorNeedsBaseUrl=Go;exports.aiVendorsWith=Wo;exports.appNameFromPath=gt;exports.applyRounding=$a;exports.applySignature=bi;exports.approvalRate=pr;exports.artifactBodyBytes=un;exports.artifactOutline=dn;exports.artifactToMarkdown=Ze;exports.assignmentMismatch=Ws;exports.assignmentScopeKey=gi;exports.assignmentSubject=_i;exports.availabilityByPerson=hs;exports.belongsOnCalendar=us;exports.buildActivityPreview=Lo;exports.buildChannelIntents=xc;exports.buildShareKeys=di;exports.buildWindow=po;exports.calendarDaysBetween=Gn;exports.calendarOf=be;exports.canNestUnder=Xi;exports.canParent=Ia;exports.capacityTotal=fs;exports.capacityWeights=Ls;exports.carriesText=Ro;exports.categoryLabel=qi;exports.categoryOf=Br;exports.channelKindForScheme=Kc;exports.channelKindOf=Io;exports.checkInOverdueMs=La;exports.clampStepMaxTokens=Ys;exports.classifyMail=Pi;exports.cleanMessageMarkdown=_u;exports.cleanMessageText=yu;exports.compareAssistRank=Rc;exports.compareWorkTypes=kr;exports.conditionHolds=En;exports.countsAsPlanned=B;exports.coverageByPerson=ms;exports.coverageFor=bs;exports.coversWorkstream=ot;exports.cycleDayIndex=it;exports.cycleOrder=gc;exports.cycleState=Ec;exports.decideAssignmentState=Si;exports.decideCadence=$l;exports.decideIncomingCall=Nc;exports.defaultLocaleOf=Bn;exports.defaultStatusKey=pc;exports.defineIntent=Wc;exports.depthOf=$n;exports.derivePresence=ml;exports.describeClause=ti;exports.disabledIntentsFromCapabilities=vc;exports.documentBodyBytes=un;exports.documentKindOf=cl;exports.documentOutline=dn;exports.documentToMarkdown=Ze;exports.documentToText=ol;exports.dueAtOf=ya;exports.elapsedSeconds=Ua;exports.emailDomain=Yl;exports.endpointKey=Jl;exports.erlangC=jn;exports.extractParams=eo;exports.extractTerms=lo;exports.fillDocument=Ri;exports.fillText=gn;exports.filterByEndpoint=Pc;exports.filterByIntent=Lc;exports.filterByTargetScheme=zr;exports.filterableDimensions=ei;exports.findAiVendor=Y;exports.fixedLevelForName=Oa;exports.fixedTypeForName=nc;exports.fixedTypes=rc;exports.flattenLocales=ul;exports.floorToPeriod=F;exports.forecastIntervals=Ns;exports.formatActingIdentity=nr;exports.formatClock=Fa;exports.formatHm=Ka;exports.formatItemKey=sc;exports.formatPeriod=K;exports.formatSlaDuration=Aa;exports.freshSources=Ic;exports.getActivitySeenUserIds=$o;exports.getContactEndpoints=Ti;exports.getShortTitle=Wi;exports.getUrgencyScore=Hi;exports.hasReacted=oa;exports.healthCategory=wa;exports.healthsInCategory=Ra;exports.heightOf=rt;exports.helpCenterText=Vi;exports.humanizeAction=Gs;exports.interactionIdOf=lr;exports.isAgentUser=Ya;exports.isAssigned=Fi;exports.isAssignmentTerminal=hi;exports.isAssignmentTrigger=sr;exports.isAutoReady=Js;exports.isAwaitingThem=Pn;exports.isChatMessageActivity=Fo;exports.isClosed=Bi;exports.isConnectedType=ko;exports.isDeepLink=Ml;exports.isDescendant=Kn;exports.isEligible=Ci;exports.isEmailActivity=Ko;exports.isHtmlBody=Eu;exports.isInFlight=Qs;exports.isInteractionUnseen=Mn;exports.isLandingPath=Ol;exports.isLikelyBulk=An;exports.isMessageShape=Xe;exports.isMessageType=Mo;exports.isMoreSpecificPattern=no;exports.isNoteShape=ze;exports.isOpenClock=br;exports.isOutwardTool=Tc;exports.isParked=Nn;exports.isPaused=gr;exports.isPlaybookAuthoredType=Co;exports.isPublicEmailDomain=zl;exports.isPublicPath=Cl;exports.isReminderActive=vn;exports.isReplyableType=wo;exports.isSlaAtRisk=$i;exports.isTerminal=Zs;exports.isThreadLongEnough=vi;exports.isTranscriptType=No;exports.isWorkClosed=fc;exports.isWorkTypeVisible=Ha;exports.itemDossierKeys=lc;exports.kindFor=N;exports.ladderFor=Fr;exports.levelIn=Or;exports.levelOrder=ge;exports.linkLabel=Gi;exports.listeningAllowed=Xo;exports.localeInstruction=Yi;exports.localeName=ji;exports.localesOf=zi;exports.looksLikeEmail=Vl;exports.lookup=tt;exports.markdownToDocument=rl;exports.matchContactToIntents=Uc;exports.matchPublicRoute=ro;exports.mcpCredentialScope=Qi;exports.mcpToolPrefix=es;exports.measureRatio=ka;exports.mergeShownKeys=Ul;exports.messageCountsAs=Xt;exports.metricOption=ni;exports.minutesOn=st;exports.needsPhoneRegion=ql;exports.nestsUnderParent=Oo;exports.nextLevelBelow=Ma;exports.nextSlaClock=_a;exports.normalizeArtifactBlocks=ln;exports.normalizeBlocks=So;exports.normalizeDocumentBlocks=ln;exports.normalizeEmail=Et;exports.normalizeExample=L;exports.notificationPrefKey=pl;exports.novelty=uo;exports.operationDescriptor=tl;exports.operationsForKind=el;exports.overlapSeconds=te;exports.overlaps=As;exports.paceRatio=Na;exports.parkMarksById=ki;exports.parseActingIdentity=Us;exports.parseClockMinutes=ca;exports.parseItemKey=ac;exports.pathToRegex=Qr;exports.patternFor=ct;exports.patternStartTime=at;exports.pauseBitFor=la;exports.periodsInRange=Zo;exports.phoneSuffix=jl;exports.pickMailHeaders=Di;exports.pickTemplate=Mi;exports.placeLumps=Ps;exports.plainTextFromMarkdown=jt;exports.planSlaEvent=Ea;exports.plannedBillable=Ts;exports.plannedWorkTypeKey=Jn;exports.playbookActor=ir;exports.procedureOf=qs;exports.projectDossierKeys=uc;exports.publicBasePathFor=to;exports.publicRoutePatterns=Rl;exports.reactionWakesAssignment=yi;exports.readPath=ie;exports.readStepError=Fe;exports.recencyOf=kn;exports.recipientLocale=Ii;exports.refKey=ar;exports.registrableDomain=ho;exports.rejectExampleCandidate=xr;exports.relatedByDefault=ss;exports.remainingMsOf=he;exports.requiredAgents=zn;exports.requirementFor=qn;exports.resolveAccountCapabilities=Xr;exports.resolveActivityText=se;exports.resolveChannelIntents=Yr;exports.resolveSignature=hn;exports.resolveWorkMode=gl;exports.resourceKindOf=bl;exports.rollupChildren=xa;exports.runActor=$s;exports.runInteractionId=ta;exports.sanitizeInline=cn;exports.sanitizeTranscript=oo;exports.scheduleEntryScopeKey=vs;exports.scoreInteraction=Ki;exports.scoreWorkItem=Za;exports.selectLenses=Zi;exports.serviceLevel=Yn;exports.sessionsHoldCannotReach=kc;exports.sessionsToHold=Cc;exports.shareKeyForTeam=et;exports.shareKeyForUser=Qe;exports.shareKeysForViewer=pi;exports.shortfalls=Is;exports.shouldRunAudioPipeline=El;exports.slaBadgeTone=Sa;exports.slaHoursByInbox=Ui;exports.slaHoursFor=Ln;exports.sortStatuses=Hr;exports.sourceKey=jr;exports.spreadOverWeights=tr;exports.statusIn=dc;exports.stepsOf=zs;exports.strategyAncestorKeysFor=Ta;exports.strategyDossierKeys=ba;exports.strategyItemScopeKey=ut;exports.stripHtml=Yt;exports.subjectKeyOf=ea;exports.subjectOf=lt;exports.subjectRef=wc;exports.suggestProjectKey=cc;exports.suggestedHealth=va;exports.summarizeReactions=na;exports.targetById=Hs;exports.targetForActivityType=Bs;exports.targetOrder=Pa;exports.termsFor=Vn;exports.toActingIdentity=or;exports.toE164=Ye;exports.toolSourceKinds=fi;exports.topicOfferedForTeam=Lr;exports.topicsForTeam=ja;exports.trafficIntensity=Xn;exports.truncateExample=Dr;exports.typeIn=tc;exports.typesFor=ec;exports.uniqueWorkStatusKey=mc;exports.uniqueWorkTypeKey=Ba;exports.usageMetricId=nn;exports.usageMetrics=ri;exports.validateStatuses=hc;exports.valueAtPath=Fs;exports.waitHoursOf=_e;exports.wakesAssignment=Ei;exports.workActivityScopeKey=ic;exports.workItemScopeKey=Kr;exports.workProjectScopeKey=dt;exports.workRatio=Da;exports.workStatusKey=Wr;exports.workTypeKey=Cr;exports.workingMsBetween=pe;exports.workstreamScopeKey=Ds;
|
|
39
|
+
`).trim()}const Eo=/<\s*(html|body|div|p|table|br|span)\b/i;function Eu(e){return Eo.test(e)}function yu(e){return yo(e,!1)}function _u(e){return yo(e,!0)}function yo(e,t){if(typeof e!="string"||!e)return"";let n=e.length;for(const s of Zl){const a=e.search(s);a>=0&&a<n&&(n=a)}const r=e.slice(0,n);let o=Vt(Gt(Ht(r,t)));return o||(o=Vt(Gt(Ht(e,t)))),eu(o)||o}exports.ACTIVE_ASSIGNMENT_STATUSES=mi;exports.ACTIVITY_CATALOG=D;exports.AI_ATTACHMENT_LIMITS=Vr;exports.AI_ATTACHMENT_MAX_PER_TURN=Ac;exports.AI_ATTACHMENT_TURN_BUDGET=Sc;exports.AI_VENDORS=qe;exports.ALLOWED_LINK_SCHEMES=an;exports.APP_PERMISSIONS=fl;exports.ARTIFACT_MAX_BLOCKS=ae;exports.ARTIFACT_MAX_BODY_BYTES=sn;exports.ARTIFACT_MAX_CELL_LEN=U;exports.ARTIFACT_MAX_KPI_ITEMS=de;exports.ARTIFACT_MAX_LIST_ITEMS=ce;exports.ARTIFACT_MAX_TABLE_COLUMNS=ue;exports.ARTIFACT_MAX_TABLE_ROWS=le;exports.ARTIFACT_MAX_TEXT_LEN=_e;exports.ASSIGNMENT_SCOPE_KIND=fn;exports.ASSIST_BANDS=Oc;exports.ASSIST_SOURCE_PROVIDER_GROUP=Mc;exports.ATTENTION_STATUSES=On;exports.AT_RISK_GAP=wr;exports.AUTH_APP_NAME=ht;exports.AUTO_READY_MIN_PROPOSALS=fr;exports.AUTO_READY_RATE=mr;exports.ActivityTypeRegistry=Jt;exports.BUILT_IN_ONLY=Uo;exports.BULK_PENALTY=wn;exports.CADENCE_FLOOR_MS=so;exports.CADENCE_MIN_NEW_SEGMENTS=ao;exports.CADENCE_MIN_NOVELTY=co;exports.CADENCE_WINDOW_MS=io;exports.CLASSIFY_VARS=js;exports.CONNECTOR_PROVIDER_GROUP=Xc;exports.CONTEXT_COLLECT_SERVICE=zc;exports.CORE_DIMENSIONS=zo;exports.CommunicationScheme=qr;exports.DAY_MS=_n;exports.DEFAULT_CHECK_IN_DAYS=Mr;exports.DEFAULT_FORECAST_WEEKS=Zn;exports.DEFAULT_MEMORY_BUDGET=is;exports.DEFAULT_PHONE_REGION=mo;exports.DEMAND_SOURCE_PROVIDER_GROUP=gs;exports.DOCUMENT_APPLY_SERVICE=al;exports.DOCUMENT_DESCRIBE_SERVICE=il;exports.DOCUMENT_INSPECT_SERVICE=sl;exports.DOCUMENT_MAX_BLOCKS=ae;exports.DOCUMENT_MAX_BODY_BYTES=sn;exports.DOCUMENT_MAX_CELL_LEN=U;exports.DOCUMENT_MAX_KPI_ITEMS=de;exports.DOCUMENT_MAX_LETTERHEAD_FIELDS=Ue;exports.DOCUMENT_MAX_LIST_ITEMS=ce;exports.DOCUMENT_MAX_RECIPIENT_LINES=on;exports.DOCUMENT_MAX_TABLE_COLUMNS=ue;exports.DOCUMENT_MAX_TABLE_ROWS=le;exports.DOCUMENT_MAX_TEXT_LEN=_e;exports.DOCUMENT_MAX_TOTALS_ROWS=$e;exports.DOCUMENT_OPERATIONS=ft;exports.EMPTY_WORKFLOW=Xs;exports.FEATURE_FOLDER_MANAGEMENT=Gc;exports.FEATURE_MESSAGE_REACTIONS=jc;exports.FEATURE_REMOTE_SEARCH=Vc;exports.FIXED_KINDS=Ae;exports.FIXED_LEVELS=z;exports.FIXED_TYPES=Me;exports.FOLLOW_UP_HOURS=Cn;exports.HOUR_MS=yn;exports.HTML_BODY_RE=Eo;exports.INELIGIBLE=x;exports.INSTALLATION_HEADER=ll;exports.INTERACTION_KIND=cr;exports.InteractionParticipantRole=Hc;exports.KB_FALLBACK_LOCALE=Fn;exports.KB_LOCALES=pe;exports.LOCALES=pe;exports.LOOSE_STATUSES=Oe;exports.MAIL_HINT_HEADERS=In;exports.MAX_ACTIONS=ee;exports.MAX_ASSIGNMENT_TURNS=mn;exports.MAX_BLOCKS=Le;exports.MAX_COLLECTION_DEPTH=nt;exports.MAX_EDITABLE_FILE_BYTES=kl;exports.MAX_FIELDS=Z;exports.MAX_LIST_ITEMS=Q;exports.MAX_MEMORY_BROWSE=ts;exports.MAX_MEMORY_BUDGET=os;exports.MAX_MEMORY_CHARS=ns;exports.MAX_SHOWN_KEYS=fo;exports.MAX_TOPIC_CANDIDATES=vr;exports.MAX_TOPIC_EXAMPLES=Nr;exports.MAX_TOPIC_EXAMPLE_CHARS=ne;exports.MAX_VIEWABLE_FILE_BYTES=Nl;exports.MIN_MEMORY_BUDGET=rs;exports.NAV_NOTICE_SLOT=Fl;exports.NOTIFICATION_SOURCE_PROVIDER_GROUP=dl;exports.OFF_TRACK_GAP=Rr;exports.ONBOARDING_SOURCE_PROVIDER_GROUP=as;exports.PAUSE_SNOOZED=me;exports.PAUSE_WAITING_FOR_CUSTOMER=he;exports.PHONE_REGIONS=we;exports.PRESENCE_ONLINE_WINDOW_MS=mt;exports.PRESENCE_SURVIVES_OFFLINE=Jr;exports.PROFILE_TOOL_DISPOSITIONS=ls;exports.PROVIDER_FEATURE_MESSAGE_TEMPLATES=Bc;exports.PROVIDER_FEATURE_MESSAGE_WINDOW=Fc;exports.PUBLIC_EMAIL_DOMAINS=go;exports.READ_STEP_TYPES=Ke;exports.RELATED_SUBJECT_KINDS=Hn;exports.RESERVED_STATUS_KEYS=pt;exports.RESERVED_TYPE_KEYS=Qa;exports.RESOURCE_ATTACHED_SERVICE=Al;exports.RESOURCE_DESCRIBE_SERVICE=yl;exports.RESOURCE_RESOLVE_SERVICE=Sl;exports.RESOURCE_SEARCH_SERVICE=_l;exports.SCHEDULE_ENTRY_SCOPE_KIND=Qn;exports.SCOPE_READ_ROUTE=Il;exports.SCOPE_RELATED_ROUTE=Tl;exports.SETTINGS_CATEGORIES=Kl;exports.SIGNATURE_INTENTS=Ai;exports.SLA_HOURS_BY_PRIORITY=Rn;exports.SLA_METRICS=ua;exports.SLA_PAUSE_REASONS=da;exports.STEP_MAX_TOKENS_MAX=dr;exports.STEP_MAX_TOKENS_MIN=ur;exports.STRATEGY_ITEM_SCOPE_KIND=Tr;exports.SUMMARY_MIN_LAST_CHARS=Tn;exports.SUMMARY_MIN_MESSAGES=bn;exports.SYNC_RUN_MAX_ERRORS=Dl;exports.SYNC_TARGET_PROVIDER_GROUP=vl;exports.TERMINAL_ASSIGNMENT_STATUSES=pn;exports.TERMINAL_RUN_STATUSES=hr;exports.TRIGGER_VARS=Vs;exports.UNKNOWN_KIND=Wn;exports.UNKNOWN_LEVEL_ORDER=Ir;exports.UNSUPPORTED=Yc;exports.USAGE_DIMENSIONS=en;exports.USAGE_DIMENSION_IDS=tn;exports.WORKSTREAM_SCOPE_KIND=er;exports.WORK_ACTIVITY_SCOPE_KIND=$r;exports.WORK_AREAS=cs;exports.WORK_COMMENT_ADDED=Xa;exports.WORK_CYCLE_SYNC_KIND=oc;exports.WORK_ITEM_ASSIGNED=za;exports.WORK_ITEM_SCOPE_KIND=Pr;exports.WORK_ITEM_STATUS_CHANGED=qa;exports.WORK_PROJECT_SCOPE_KIND=Ur;exports.W_PRIORITY=V;exports.acceptExampleCandidate=Va;exports.actingIdentityKey=rr;exports.activeWorkTypes=Wa;exports.activityIconOf=To;exports.activityJoinUrl=Do;exports.activitySnippet=zt;exports.activityTextParams=qt;exports.activityTimelineText=vo;exports.activityTimestamp=Zt;exports.activityTypeInfo=M;exports.actorKey=Ks;exports.addExampleCandidate=Ga;exports.addWorkingMs=be;exports.agePresenceEntry=hl;exports.aiAttachmentKind=Gr;exports.aiAttachmentRejection=bc;exports.aiBudgetLimit=Pe;exports.aiBudgetPeriodKey=Yo;exports.aiBudgetPeriodStart=Qt;exports.aiBudgetState=jo;exports.aiVendorAcceptsAttachment=Vo;exports.aiVendorDefaultModel=Ho;exports.aiVendorLabel=Bo;exports.aiVendorNeedsBaseUrl=Go;exports.aiVendorsWith=Wo;exports.appNameFromPath=gt;exports.applyRounding=$a;exports.applySignature=bi;exports.approvalRate=pr;exports.artifactBodyBytes=un;exports.artifactOutline=dn;exports.artifactToMarkdown=Ze;exports.assignmentMismatch=Ws;exports.assignmentScopeKey=gi;exports.assignmentSubject=_i;exports.availabilityByPerson=hs;exports.belongsOnCalendar=us;exports.buildActivityPreview=Lo;exports.buildChannelIntents=xc;exports.buildShareKeys=di;exports.buildWindow=po;exports.calendarDaysBetween=Gn;exports.calendarOf=Te;exports.canNestUnder=Xi;exports.canParent=Ia;exports.capacityTotal=fs;exports.capacityWeights=Ls;exports.carriesText=Ro;exports.categoryLabel=qi;exports.categoryOf=Br;exports.channelKindForScheme=Kc;exports.channelKindOf=Io;exports.checkInOverdueMs=La;exports.clampStepMaxTokens=Ys;exports.classifyMail=Pi;exports.cleanMessageMarkdown=_u;exports.cleanMessageText=yu;exports.compareAssistRank=Rc;exports.compareWorkTypes=kr;exports.conditionHolds=En;exports.countsAsPlanned=B;exports.coverageByPerson=ms;exports.coverageFor=bs;exports.coversWorkstream=ot;exports.cycleDayIndex=it;exports.cycleOrder=gc;exports.cycleState=Ec;exports.decideAssignmentState=Si;exports.decideCadence=$l;exports.decideIncomingCall=Nc;exports.defaultLocaleOf=Bn;exports.defaultStatusKey=pc;exports.defineIntent=Wc;exports.depthOf=$n;exports.derivePresence=ml;exports.describeClause=ti;exports.disabledIntentsFromCapabilities=vc;exports.documentBodyBytes=un;exports.documentKindOf=cl;exports.documentOutline=dn;exports.documentToMarkdown=Ze;exports.documentToText=ol;exports.dueAtOf=ya;exports.elapsedSeconds=Ua;exports.emailDomain=Yl;exports.endpointKey=Jl;exports.erlangC=jn;exports.extractParams=eo;exports.extractTerms=lo;exports.fillDocument=Ri;exports.fillText=gn;exports.filterByEndpoint=Pc;exports.filterByIntent=Lc;exports.filterByTargetScheme=zr;exports.filterableDimensions=ei;exports.findAiVendor=Y;exports.fixedLevelForName=Oa;exports.fixedTypeForName=nc;exports.fixedTypes=rc;exports.flattenLocales=ul;exports.floorToPeriod=F;exports.forecastIntervals=Ns;exports.formatActingIdentity=nr;exports.formatClock=Fa;exports.formatHm=Ka;exports.formatItemKey=sc;exports.formatPeriod=K;exports.formatSlaDuration=Aa;exports.freshSources=Ic;exports.getActivitySeenUserIds=$o;exports.getContactEndpoints=Ti;exports.getShortTitle=Wi;exports.getUrgencyScore=Hi;exports.hasReacted=oa;exports.healthCategory=wa;exports.healthsInCategory=Ra;exports.heightOf=rt;exports.helpCenterText=Vi;exports.humanizeAction=Gs;exports.interactionIdOf=lr;exports.isAgentUser=Ya;exports.isAssigned=Fi;exports.isAssignmentTerminal=hi;exports.isAssignmentTrigger=sr;exports.isAutoReady=Js;exports.isAwaitingThem=Pn;exports.isChatMessageActivity=Fo;exports.isClosed=Bi;exports.isConnectedType=ko;exports.isDeepLink=Ml;exports.isDescendant=Kn;exports.isEligible=Ci;exports.isEmailActivity=Ko;exports.isHtmlBody=Eu;exports.isInFlight=Qs;exports.isInteractionUnseen=Mn;exports.isLandingPath=Ol;exports.isLikelyBulk=An;exports.isMessageShape=Xe;exports.isMessageType=Mo;exports.isMoreSpecificPattern=no;exports.isNoteShape=ze;exports.isOpenClock=br;exports.isOutwardTool=Tc;exports.isParked=Nn;exports.isPaused=gr;exports.isPlaybookAuthoredType=Co;exports.isPublicEmailDomain=zl;exports.isPublicPath=Cl;exports.isReminderActive=vn;exports.isReplyableType=wo;exports.isSlaAtRisk=$i;exports.isTerminal=Zs;exports.isThreadLongEnough=vi;exports.isTranscriptType=No;exports.isWorkClosed=fc;exports.isWorkTypeVisible=Ha;exports.itemDossierKeys=lc;exports.kindFor=N;exports.ladderFor=Fr;exports.levelIn=Or;exports.levelOrder=Ee;exports.linkLabel=Gi;exports.listeningAllowed=Xo;exports.localeInstruction=Yi;exports.localeName=ji;exports.localesOf=zi;exports.looksLikeEmail=Vl;exports.lookup=tt;exports.markdownToDocument=rl;exports.matchContactToIntents=Uc;exports.matchPublicRoute=ro;exports.mcpCredentialScope=Qi;exports.mcpToolPrefix=es;exports.measureRatio=ka;exports.mergeShownKeys=Ul;exports.messageCountsAs=Xt;exports.metricOption=ni;exports.minutesOn=st;exports.needsPhoneRegion=ql;exports.nestsUnderParent=Oo;exports.nextLevelBelow=Ma;exports.nextSlaClock=_a;exports.normalizeArtifactBlocks=ln;exports.normalizeBlocks=So;exports.normalizeDocumentBlocks=ln;exports.normalizeEmail=Et;exports.normalizeExample=L;exports.notificationPrefKey=pl;exports.novelty=uo;exports.operationDescriptor=tl;exports.operationsForKind=el;exports.overlapSeconds=te;exports.overlaps=As;exports.paceRatio=Na;exports.parkMarksById=ki;exports.parseActingIdentity=Us;exports.parseClockMinutes=ca;exports.parseItemKey=ac;exports.pathToRegex=Qr;exports.patternFor=ct;exports.patternStartTime=at;exports.pauseBitFor=la;exports.periodsInRange=Zo;exports.phoneSuffix=jl;exports.pickMailHeaders=Di;exports.pickTemplate=Mi;exports.placeLumps=Ps;exports.plainTextFromMarkdown=jt;exports.planSlaEvent=Ea;exports.plannedBillable=Ts;exports.plannedWorkTypeKey=Jn;exports.playbookActor=ir;exports.procedureOf=qs;exports.projectDossierKeys=uc;exports.publicBasePathFor=to;exports.publicRoutePatterns=Rl;exports.reactionWakesAssignment=yi;exports.readPath=ie;exports.readStepError=Fe;exports.recencyOf=kn;exports.recipientLocale=Ii;exports.refKey=ar;exports.registrableDomain=ho;exports.rejectExampleCandidate=xr;exports.relatedByDefault=ss;exports.remainingMsOf=ge;exports.requiredAgents=zn;exports.requirementFor=qn;exports.resolveAccountCapabilities=Xr;exports.resolveActivityText=se;exports.resolveChannelIntents=Yr;exports.resolveSignature=hn;exports.resolveWorkMode=gl;exports.resourceKindOf=bl;exports.rollupChildren=xa;exports.runActor=$s;exports.runInteractionId=ta;exports.sanitizeInline=cn;exports.sanitizeTranscript=oo;exports.scheduleEntryScopeKey=vs;exports.scoreInteraction=Ki;exports.scoreWorkItem=Za;exports.selectLenses=Zi;exports.serviceLevel=Yn;exports.sessionsHoldCannotReach=kc;exports.sessionsToHold=Cc;exports.shareKeyForTeam=et;exports.shareKeyForUser=Qe;exports.shareKeysForViewer=pi;exports.shortfalls=Is;exports.shouldRunAudioPipeline=El;exports.slaBadgeTone=Sa;exports.slaHoursByInbox=Ui;exports.slaHoursFor=Ln;exports.sortStatuses=Hr;exports.sourceKey=jr;exports.spreadOverWeights=tr;exports.statusIn=dc;exports.stepsOf=zs;exports.strategyAncestorKeysFor=Ta;exports.strategyDossierKeys=ba;exports.strategyItemScopeKey=ut;exports.stripHtml=Yt;exports.subjectKeyOf=ea;exports.subjectOf=lt;exports.subjectRef=wc;exports.suggestProjectKey=cc;exports.suggestedHealth=va;exports.summarizeReactions=na;exports.targetById=Hs;exports.targetForActivityType=Bs;exports.targetOrder=Pa;exports.termsFor=Vn;exports.toActingIdentity=or;exports.toE164=Ye;exports.toolSourceKinds=fi;exports.topicOfferedForTeam=Lr;exports.topicsForTeam=ja;exports.trafficIntensity=Xn;exports.truncateExample=Dr;exports.typeIn=tc;exports.typesFor=ec;exports.uniqueWorkStatusKey=mc;exports.uniqueWorkTypeKey=Ba;exports.usageMetricId=nn;exports.usageMetrics=ri;exports.validateStatuses=hc;exports.valueAtPath=Fs;exports.waitHoursOf=Se;exports.wakesAssignment=Ei;exports.workActivityScopeKey=ic;exports.workItemScopeKey=Kr;exports.workProjectScopeKey=dt;exports.workRatio=Da;exports.workStatusKey=Wr;exports.workTypeKey=Cr;exports.workingMsBetween=fe;exports.workstreamScopeKey=Ds;
|
package/dist/index.d.ts
CHANGED
|
@@ -66,6 +66,7 @@ export * from './platform/identity';
|
|
|
66
66
|
export * from './platform/installation';
|
|
67
67
|
export * from './platform/intents';
|
|
68
68
|
export * from './platform/kernel';
|
|
69
|
+
export * from './platform/locales';
|
|
69
70
|
export * from './platform/localization';
|
|
70
71
|
export * from './platform/manifest';
|
|
71
72
|
export * from './platform/media';
|
package/dist/index.js
CHANGED
|
@@ -1387,92 +1387,98 @@ function Pn(e, t) {
|
|
|
1387
1387
|
}
|
|
1388
1388
|
return e.equals !== void 0 ? n === e.equals : !0;
|
|
1389
1389
|
}
|
|
1390
|
-
function Ks(e, t, n) {
|
|
1391
|
-
const
|
|
1392
|
-
const
|
|
1393
|
-
for (const
|
|
1394
|
-
return
|
|
1390
|
+
function Ks(e, t, n, r) {
|
|
1391
|
+
const o = [], i = [], s = (a) => {
|
|
1392
|
+
const l = Ln(a, t);
|
|
1393
|
+
for (const u of l.unresolved) o.includes(u) || o.push(u);
|
|
1394
|
+
return l.text;
|
|
1395
1395
|
};
|
|
1396
|
-
for (const
|
|
1397
|
-
if (
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1396
|
+
for (const a of e) {
|
|
1397
|
+
if (a.block_id && !Pn(n?.[a.block_id], t)) continue;
|
|
1398
|
+
const l = a.block_id ? r?.[a.block_id] : void 0;
|
|
1399
|
+
if (l) {
|
|
1400
|
+
i.push(...l);
|
|
1401
|
+
continue;
|
|
1402
|
+
}
|
|
1403
|
+
switch (a.type) {
|
|
1404
|
+
case "heading":
|
|
1405
|
+
case "paragraph":
|
|
1406
|
+
case "quote":
|
|
1407
|
+
i.push({ ...a, text: s(a.text) });
|
|
1408
|
+
break;
|
|
1409
|
+
case "callout":
|
|
1410
|
+
i.push({
|
|
1411
|
+
...a,
|
|
1412
|
+
...a.title ? { title: s(a.title) } : {},
|
|
1413
|
+
text: s(a.text)
|
|
1414
|
+
});
|
|
1415
|
+
break;
|
|
1416
|
+
case "code":
|
|
1417
|
+
i.push(a);
|
|
1418
|
+
break;
|
|
1419
|
+
case "list":
|
|
1420
|
+
i.push({
|
|
1421
|
+
...a,
|
|
1422
|
+
items: a.items.map((u) => ({
|
|
1423
|
+
...u.lead ? { lead: s(u.lead) } : {},
|
|
1424
|
+
text: s(u.text)
|
|
1425
|
+
}))
|
|
1426
|
+
});
|
|
1427
|
+
break;
|
|
1428
|
+
case "table":
|
|
1429
|
+
i.push({
|
|
1430
|
+
...a,
|
|
1431
|
+
columns: a.columns.map((u) => ({ ...u, label: s(u.label) })),
|
|
1432
|
+
rows: a.rows.map((u) => u.map(s)),
|
|
1433
|
+
...a.caption ? { caption: s(a.caption) } : {}
|
|
1434
|
+
});
|
|
1435
|
+
break;
|
|
1436
|
+
case "kpi":
|
|
1437
|
+
i.push({
|
|
1438
|
+
...a,
|
|
1439
|
+
items: a.items.map((u) => ({
|
|
1440
|
+
...u,
|
|
1441
|
+
value: s(u.value),
|
|
1442
|
+
label: s(u.label)
|
|
1443
|
+
}))
|
|
1444
|
+
});
|
|
1445
|
+
break;
|
|
1446
|
+
case "letterhead":
|
|
1447
|
+
i.push({
|
|
1448
|
+
...a,
|
|
1449
|
+
fields: a.fields.map((u) => ({ ...u, value: s(u.value) })),
|
|
1450
|
+
...a.recipient ? { recipient: a.recipient.map(s) } : {}
|
|
1451
|
+
});
|
|
1452
|
+
break;
|
|
1453
|
+
case "totals":
|
|
1454
|
+
i.push({
|
|
1455
|
+
...a,
|
|
1456
|
+
rows: a.rows.map((u) => ({
|
|
1457
|
+
...u,
|
|
1458
|
+
label: s(u.label),
|
|
1459
|
+
amount: s(u.amount)
|
|
1460
|
+
})),
|
|
1461
|
+
...a.taxRows ? {
|
|
1462
|
+
taxRows: a.taxRows.map((u) => ({
|
|
1463
|
+
...u,
|
|
1464
|
+
label: s(u.label),
|
|
1465
|
+
amount: s(u.amount)
|
|
1438
1466
|
}))
|
|
1439
|
-
}
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
}
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
amount: i(a.amount)
|
|
1455
|
-
})),
|
|
1456
|
-
...s.taxRows ? {
|
|
1457
|
-
taxRows: s.taxRows.map((a) => ({
|
|
1458
|
-
...a,
|
|
1459
|
-
label: i(a.label),
|
|
1460
|
-
amount: i(a.amount)
|
|
1461
|
-
}))
|
|
1462
|
-
} : {}
|
|
1463
|
-
});
|
|
1464
|
-
break;
|
|
1465
|
-
case "image":
|
|
1466
|
-
o.push({
|
|
1467
|
-
...s,
|
|
1468
|
-
url: i(s.url),
|
|
1469
|
-
...s.alt ? { alt: i(s.alt) } : {}
|
|
1470
|
-
});
|
|
1471
|
-
break;
|
|
1472
|
-
default:
|
|
1473
|
-
o.push(s);
|
|
1474
|
-
}
|
|
1475
|
-
return { blocks: o, unresolved: r };
|
|
1467
|
+
} : {}
|
|
1468
|
+
});
|
|
1469
|
+
break;
|
|
1470
|
+
case "image":
|
|
1471
|
+
i.push({
|
|
1472
|
+
...a,
|
|
1473
|
+
url: s(a.url),
|
|
1474
|
+
...a.alt ? { alt: s(a.alt) } : {}
|
|
1475
|
+
});
|
|
1476
|
+
break;
|
|
1477
|
+
default:
|
|
1478
|
+
i.push(a);
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
return { blocks: i, unresolved: o };
|
|
1476
1482
|
}
|
|
1477
1483
|
const Un = 36e5, Kn = 864e5, $ = -1 / 0, Fs = (e) => e.score > $, J = {
|
|
1478
1484
|
urgent: 40,
|
|
@@ -4440,6 +4446,7 @@ export {
|
|
|
4440
4446
|
_l as InteractionParticipantRole,
|
|
4441
4447
|
ir as KB_FALLBACK_LOCALE,
|
|
4442
4448
|
Ye as KB_LOCALES,
|
|
4449
|
+
Ye as LOCALES,
|
|
4443
4450
|
Ce as LOOSE_STATUSES,
|
|
4444
4451
|
Wn as MAIL_HINT_HEADERS,
|
|
4445
4452
|
Hi as MAX_ACTIONS,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { KbLocale } from '../entities/kb/types';
|
|
2
|
+
/**
|
|
3
|
+
* Languages this platform can write in.
|
|
4
|
+
*
|
|
5
|
+
* Deliberately **not** the shell's UI locale list. That one is a hardcoded
|
|
6
|
+
* `['nl','en']` in `LocalizationManager`, and a customer publishing a German
|
|
7
|
+
* help centre has nothing to do with which language our own buttons are in.
|
|
8
|
+
*
|
|
9
|
+
* The labels are endonyms — a language names itself the same way whoever reads
|
|
10
|
+
* the picker. So this is a fixed map on purpose, and not the "never freeze
|
|
11
|
+
* labels at module load" case the design system warns about.
|
|
12
|
+
*
|
|
13
|
+
* In domain rather than in an app because several ends need the same answer: the language picker
|
|
14
|
+
* in the article editor, the writing assistant's system prompt, and — since documents grew a
|
|
15
|
+
* recipient language — the contact and company forms in `apps/crm`. Two copies would drift, and
|
|
16
|
+
* the way you would find out is a letter coming back in the wrong language.
|
|
17
|
+
*
|
|
18
|
+
* It lived in `entities/kb/` while the knowledge base was the only caller. The old names still
|
|
19
|
+
* work: `entities/kb/locales.ts` re-exports them.
|
|
20
|
+
*/
|
|
21
|
+
export interface LocaleOption {
|
|
22
|
+
code: KbLocale;
|
|
23
|
+
/** The language's own name, for a picker. */
|
|
24
|
+
label: string;
|
|
25
|
+
/** Its English name, for telling a model which language to write in. */
|
|
26
|
+
english: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const LOCALES: LocaleOption[];
|
|
29
|
+
/** The language's own name, or the bare code for one we do not list. */
|
|
30
|
+
export declare function localeName(code: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* How to name this language to a model.
|
|
33
|
+
*
|
|
34
|
+
* A bare BCP-47 tag is a weak instruction — `"nl"` inside an otherwise English
|
|
35
|
+
* prompt is not enough to stop a model answering in English. Both names plus
|
|
36
|
+
* the tag leaves nothing to infer.
|
|
37
|
+
*/
|
|
38
|
+
export declare function localeInstruction(code: string): string;
|
package/package.json
CHANGED
|
File without changes
|