@opencxh/domain 1.209.0 → 1.211.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +21 -7
- package/dist/index.js +516 -438
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,18 +1,32 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=10,I=10,b=10,M=5,Mn=new Set(["header","section","context","divider","image","list","actions","attachments"]);function P(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 On(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const r of e){if(n.length>=B){t(`more than ${B} blocks; the rest was dropped`);break}if(!r||typeof r!="object")continue;const i=r;if(!Mn.has(i.type)){t(`unknown block type ${String(i.type)}`);continue}switch(i.type){case"header":if(!P(i.text)){t("a header without text");continue}break;case"context":if(!P(i.text)){t("a context block without text");continue}break;case"image":if(!i.url||!i.alt){t("an image without url or alt");continue}break;case"section":Array.isArray(i.fields)&&i.fields.length>I&&(t(`more than ${I} fields in a section`),i.fields=i.fields.slice(0,I));break;case"list":if(!Array.isArray(i.items)||i.items.length===0){t("a list without items");continue}i.items.length>b&&(t(`more than ${b} list items`),i.items=i.items.slice(0,b));break;case"actions":{const a=Array.isArray(i.elements)?i.elements:[],o=a.filter(s=>s?.action_id&&s.invoke&&P(s.text));if(o.length!==a.length&&t("an action without action_id, invoke or text"),o.length===0)continue;o.length>M&&t(`more than ${M} actions`),i.elements=o.slice(0,M);break}}n.push(i)}return n}const Rn=/(\*\*|__)(?=\S)([\s\S]*?\S)\1/g,Cn=/(\*|_)(?=\S)([^*_\n]*?\S)\1/g;function Ne(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(Rn,"$2"),t=t.replace(Cn,"$2"),t=t.replace(/~~(?=\S)([\s\S]*?\S)~~/g,"$1"),t=t.replace(/`([^`\n]+)`/g,"$1"),t.replace(/\s+/g," ").trim()}function ke(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 _(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 de(e){return e?` — ${Math.floor(e/60)}m ${e%60}s`:""}function x(e){return e?.split("@")?.[0]||e||""}function T(e){return e.map(t=>t.name).join(", ")}function pe(e){return e==="meeting"?"Meeting":e==="video"?"Video call":"Audio call"}const m={VOICE_CALL_STARTED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek gestart",timeline:e=>e.direction==="inbound"?`Inbound call started — ${x(e.payload.from)}`:`Outbound call started — ${x(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?` (${_(e.payload.duration)})`:""}`,timeline:e=>`Call ended${de(e.payload.duration)}`},VOICE_CALL_MISSED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gemiste oproep",timeline:e=>`Missed call — ${x(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?` (${_(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:fe},EMAIL_SENT:{shape:"message",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:fe},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=>`${T(e.payload.members)} toegevoegd`,timeline:e=>{const t=T(e.payload.members)||"Someone",n=e.payload.initiator?.name?` · added by ${e.payload.initiator.name}`:"";return`${t} joined the chat${n}`}},CHAT_MEMBER_LEFT:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`${T(e.payload.members)} verlaten`,timeline:e=>{const t=T(e.payload.members)||"Someone",n=e.payload.initiator?.name?` · removed by ${e.payload.initiator.name}`:"";return`${t} left the chat${n}`}},CHAT_RENAMED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`Hernoemd naar "${e.payload.newName}"`,timeline:e=>`Chat renamed to "${e.payload.newName}"${e.payload.initiator?` by ${e.payload.initiator.name}`:""}`},CHAT_CALL_STARTED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:()=>"Gesprek gestart",timeline:e=>`${pe(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?` (${_(e.payload.duration)})`:""}`,timeline:e=>`${pe(e.payload.callType)} ended${de(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?` (${_(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}`},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 fe(e){const t=e.payload,n=Ne(t.bodyText).trim()||t.bodySnippet?.trim()||ke(t.body??"");return t.subject?`${t.subject} — ${n}`:n}function c(e){return m[e]}function wn(e){return c(e)?.icon??"circle"}function Nn(e){return c(e)?.channelKind}function J(e){return e==="message"||e==="note"}function kn(e){return J(c(e)?.shape)}function vn(e){return c(e)?.replyable===!0}function Ln(e){return c(e)?.carriesText===!0}function ve(e){return c(e)?.countsAs}function Dn(e){return c(e)?.playbookAuthored===!0}function Pn(e){return c(e)?.connected===!0}function xn(e){const t=c(e);return t?.shape==="artifact"&&t?.carriesText===!0}function Le(e){const t=c(e.type)?.snippet;return t?t(e):""}function $n(e,t){const n=c(e.type)?.timeline;return n?n(e,t):e.type.replace(/_/g," ").toLowerCase()}function Un(e){const t=c(e.type)?.joinUrl;return t?t(e):void 0}function w(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 N(e,t,n){if(e===void 0)return null;if(typeof e=="string")return e||null;if("value"in e)return w(t,e.value)||null;const r={};for(const[a,o]of Object.entries(e.params??{}))r[a]=w(t,o);const i=n(e.key,r);return i===e.key?null:i}function De(e,t){if(!e||typeof e=="string"||"value"in e)return null;const n={};for(const[r,i]of Object.entries(e.params??{}))n[r]=w(t,i);return{key:e.key,params:n}}const me=140;function Kn(e){const t=e.trim();return t.length<=me?t:`${t.slice(0,me-1).trimEnd()}…`}function Bn(e,t){const n=De(t?.text,e),r=t?N(t.text,e,i=>i):null;return{activityId:e.id,type:e.type,snippet:Kn(r??Le(e)),authorName:e.author?.name??"",direction:e.direction,createdAt:e.createdAt??Date.now(),...n?{snippetKey:n.key,snippetParams:n.params}:{}}}const Gn=e=>e;function ge(e){const t=m[e];return{type:e,shape:t.shape,channelKind:t.channelKind,icon:t.icon,replyable:t.replyable===!0,countsAs:t.countsAs,carriesText:t.carriesText===!0,triggerable:t.triggerable===!0,component:t.component,builtIn:!0,displayNameKey:t.displayNameKey}}function he(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 Pe{constructor(t=[],n=Gn){this.translate=n;for(const r of t)r?.type&&(r.type in m||this.declared.has(r.type)||this.declared.set(r.type,r))}declared=new Map;get(t){if(t in m)return ge(t);const n=this.declared.get(t);return n?he(n):void 0}triggerable(){const t=Object.keys(m).filter(r=>m[r].triggerable).map(ge),n=[...this.declared.values()].map(he).filter(r=>r.triggerable);return[...t,...n]}timelineText(t,n){const r=m[t.type];if(r?.timeline)return r.timeline(t,n);const i=this.declared.get(t.type);return N(i?.text,t,this.translate)??t.type.replace(/_/g," ").toLowerCase()}snippet(t){const n=m[t.type];if(n?.snippet)return n.snippet(t);const r=this.declared.get(t.type);return N(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 J(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 Fn=new Pe;function Hn(e,t,n=[]){const r=e.createdAt;if(!r)return[];const i=new Set(n);return e.author.type==="user"&&e.author.id&&i.add(e.author.id),Object.entries(t).filter(([a,o])=>o>=r&&!i.has(a)).map(([a])=>a)}function xe(e){return e.createdAt??0}function Wn(e){return e.type==="EMAIL_RECEIVED"||e.type==="EMAIL_SENT"}function Vn(e){return e.type==="CHAT_MESSAGE_SENT"||e.type==="CHAT_MESSAGE_RECEIVED"}const Z=[{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 S(e){return Z.find(t=>t.id===e)}function jn(e){return S(e)?.label??e}function Yn(e,t="gpt-5-mini"){return S(e)?.defaultModel??t}function Xn(e){return Z.filter(t=>t.capabilities.includes(e))}function zn(e){const t=S(e);return!!t&&!t.baseUrl}function qn(e,t){return t==="text"?!0:S(e)?.attachmentKinds?.includes(t)===!0}function Jn(e,t){if(!e.enabled)return"ok";const n=G(e.hardLimitNanos),r=G(e.softLimitNanos);return n!==void 0&&t>=n?"hard":r!==void 0&&t>=r?"soft":"ok"}function G(e){return typeof e=="number"?e:void 0}function $e(e,t="month"){const n=new Date(e);return Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),1)}function Zn(e,t="month"){const n=new Date($e(e,t));return`${n.getUTCFullYear()}-${String(n.getUTCMonth()+1).padStart(2,"0")}`}function Qn(e){return e?.listeningEnabled!==!1}const er=[{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 $(e){return e<10?`0${e}`:`${e}`}function Ue(e,t){const n=new Date(e),r=`${n.getUTCFullYear()}-${$(n.getUTCMonth()+1)}-${$(n.getUTCDate())}`;return t==="day"?r:`${r}T${$(n.getUTCHours())}`}function Ke(e,t){const n=new Date(e);return n.setUTCMinutes(0,0,0),t==="day"&&n.setUTCHours(0),n.getTime()}const tr=36e5,nr=864e5;function rr(e,t,n){const r=n==="hour"?tr:nr,i=[];for(let a=Ke(e,n);a<=t;a+=r)i.push(Ue(a,n));return i}const Be=[{id:"resource",label:"Resource",labelSource:"raw"},{id:"origin",label:"Herkomst",labelSource:"raw"}],Ge=Be.map(e=>e.id);function Fe(e,t){return`${e}.usage.${t}`}function ir(e,t){return t.map(n=>({id:Fe(e,n.unit),label:n.label,category:"Verbruik",valueType:n.valueType??"count",aggregation:"sum",supportedDimensions:["provider",...Ge,...n.extraDimensions??[],"time"]}))}const He=new Set(["info","success","warning","destructive"]),F=200,H=100,W=200,V=12,j=4,Q=4e3,O=500,ar=256*1024,or=new Set(["heading","paragraph","list","quote","code","divider","table","kpi","callout"]),We=["http:","https:","mailto:","tel:"],sr=/^[a-z][a-z0-9+.-]*:/i;function Ve(e){const t=e.trim().replace(/^<|>$/g,"");if(!t)return!1;const n=sr.exec(t)?.[0];return n?We.includes(n.toLowerCase()):!t.startsWith("//")}const cr=/^[ \t]{0,3}\[([^\]]+)\]:[ \t]*(\S+).*$/gm;function lr(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 i=n+(r?2:1),a=Ae(e,i,"[","]");if(a<0||e[a+1]!=="("){t+=e[n],n+=1;continue}const o=Ae(e,a+2,"(",")");if(o<0){t+=e[n],n+=1;continue}const s=e.slice(i,a),l=e.slice(a+2,o).trim().split(/\s+/)[0]??"";t+=r||!Ve(l)?s:e.slice(n,o+1),n=o+1}return t}function Ae(e,t,n,r){let i=1;for(let a=t;a<e.length;a+=1){if(e[a]==="\\"){a+=1;continue}if(e[a]===n)i+=1;else if(e[a]===r&&(i-=1,i===0))return a}return-1}function je(e){return lr(e).replace(cr,(t,n,r)=>Ve(r)?t:"")}function d(e,t=Q){return typeof e=="string"?je(e).slice(0,t):""}function ur(e,t=Q){return typeof e=="string"?e.slice(0,t):""}function dr(e,t="info"){return typeof e=="string"&&He.has(e)?e:t}function pr(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const r of e){if(n.length>=F){t(`more than ${F} blocks; the rest was dropped`);break}if(!r||typeof r!="object")continue;const i=r;if(!or.has(i.type)){t(`unknown block type ${String(i.type)}`);continue}const a=typeof i.block_id=="string"?{block_id:i.block_id}:{};switch(i.type){case"heading":{const o=d(i.text);if(!o){t("a heading without text");continue}const s=i.level===2||i.level===3?i.level:1;n.push({...a,type:"heading",level:s,text:o});break}case"paragraph":{const o=d(i.text);if(!o){t("a paragraph without text");continue}n.push({...a,type:"paragraph",text:o});break}case"quote":{const o=d(i.text);if(!o){t("a quote without text");continue}n.push({...a,type:"quote",text:o});break}case"code":{const o=ur(i.text);if(!o){t("a code block without text");continue}const s=typeof i.lang=="string"?{lang:i.lang.slice(0,32)}:{};n.push({...a,type:"code",...s,text:o});break}case"divider":n.push({...a,type:"divider"});break;case"list":{const o=Array.isArray(i.items)?i.items:[],s=[];for(const p of o){if(s.length>=H){t(`more than ${H} list items`);break}const f=d(p?.text);if(!f)continue;const u=d(p?.lead,200);s.push(u?{lead:u,text:f}:{text:f})}if(s.length===0){t("a list without usable items");continue}const l=i.style==="numbered"?"numbered":"bulleted";n.push({...a,type:"list",style:l,items:s});break}case"table":{const o=Array.isArray(i.columns)?i.columns:[],s=[];for(const u of o){if(s.length>=V){t(`more than ${V} table columns`);break}const y=d(u?.label,O),D=u?.align==="right"?"right":void 0;s.push(D?{label:y,align:D}:{label:y})}if(s.length===0){t("a table without columns");continue}const l=Array.isArray(i.rows)?i.rows:[],p=[];for(const u of l){if(p.length>=W){t(`more than ${W} table rows`);break}const y=Array.isArray(u)?u:[];p.push(s.map((D,bn)=>d(y[bn],O)))}const f=d(i.caption,O);n.push({...a,type:"table",columns:s,rows:p,...f?{caption:f}:{}});break}case"kpi":{const o=Array.isArray(i.items)?i.items:[],s=[];for(const l of o){if(s.length>=j){t(`more than ${j} kpi items`);break}const p=d(l?.value,40),f=d(l?.label,80);if(!p||!f)continue;const u=l?.tone;s.push(typeof u=="string"&&He.has(u)?{value:p,label:f,tone:u}:{value:p,label:f})}if(s.length===0){t("a kpi block without usable items");continue}n.push({...a,type:"kpi",items:s});break}case"callout":{const o=d(i.text);if(!o){t("a callout without text");continue}const s=d(i.title,200);n.push({...a,type:"callout",tone:dr(i.tone),...s?{title:s}:{},text:o});break}}}return n}function fr(e){return JSON.stringify(e).length}function mr(e){return{blocks:e.length,types:e.map(t=>t.type),headings:e.flatMap(t=>t.type==="heading"?[t.text]:[])}}function Ee(e){return e.replace(/\|/g,"\\|").replace(/\r?\n/g," ").trim()}function Se(e,t,n){const r=e.map((i,a)=>n?.[a]==="right"?"---:":"---");return[`| ${e.map(Ee).join(" | ")} |`,`| ${r.join(" | ")} |`,...t.map(i=>`| ${i.map(Ee).join(" | ")} |`)]}function gr(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=Se(e.columns.map(n=>n.label),e.rows,e.columns.map(n=>n.align??"left"));return e.caption?[...t,"",`*${e.caption}*`]:t}case"kpi":return Se(e.items.map(t=>t.value),[e.items.map(t=>t.label)]);case"callout":return(e.title?`**${e.title}** ${e.text}`:e.text).split(/\r?\n/).map(n=>`> ${n}`)}}function hr(e,t){const n=[],r=e.some(i=>i.type==="heading"&&i.level===1);t&&!r&&n.push(`# ${t}`);for(const i of e){const a=gr(i);a.length>0&&n.push(a.join(`
|
|
3
|
+
`),t=t.replace(Rn,"$2"),t=t.replace(Cn,"$2"),t=t.replace(/~~(?=\S)([\s\S]*?\S)~~/g,"$1"),t=t.replace(/`([^`\n]+)`/g,"$1"),t.replace(/\s+/g," ").trim()}function ke(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 _(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 de(e){return e?` — ${Math.floor(e/60)}m ${e%60}s`:""}function x(e){return e?.split("@")?.[0]||e||""}function T(e){return e.map(t=>t.name).join(", ")}function pe(e){return e==="meeting"?"Meeting":e==="video"?"Video call":"Audio call"}const m={VOICE_CALL_STARTED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek gestart",timeline:e=>e.direction==="inbound"?`Inbound call started — ${x(e.payload.from)}`:`Outbound call started — ${x(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?` (${_(e.payload.duration)})`:""}`,timeline:e=>`Call ended${de(e.payload.duration)}`},VOICE_CALL_MISSED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gemiste oproep",timeline:e=>`Missed call — ${x(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?` (${_(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:fe},EMAIL_SENT:{shape:"message",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:fe},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=>`${T(e.payload.members)} toegevoegd`,timeline:e=>{const t=T(e.payload.members)||"Someone",n=e.payload.initiator?.name?` · added by ${e.payload.initiator.name}`:"";return`${t} joined the chat${n}`}},CHAT_MEMBER_LEFT:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`${T(e.payload.members)} verlaten`,timeline:e=>{const t=T(e.payload.members)||"Someone",n=e.payload.initiator?.name?` · removed by ${e.payload.initiator.name}`:"";return`${t} left the chat${n}`}},CHAT_RENAMED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`Hernoemd naar "${e.payload.newName}"`,timeline:e=>`Chat renamed to "${e.payload.newName}"${e.payload.initiator?` by ${e.payload.initiator.name}`:""}`},CHAT_CALL_STARTED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:()=>"Gesprek gestart",timeline:e=>`${pe(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?` (${_(e.payload.duration)})`:""}`,timeline:e=>`${pe(e.payload.callType)} ended${de(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?` (${_(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}`},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 fe(e){const t=e.payload,n=Ne(t.bodyText).trim()||t.bodySnippet?.trim()||ke(t.body??"");return t.subject?`${t.subject} — ${n}`:n}function u(e){return m[e]}function wn(e){return u(e)?.icon??"circle"}function Nn(e){return u(e)?.channelKind}function J(e){return e==="message"||e==="note"}function kn(e){return J(u(e)?.shape)}function vn(e){return u(e)?.replyable===!0}function Ln(e){return u(e)?.carriesText===!0}function ve(e){return u(e)?.countsAs}function Dn(e){return u(e)?.playbookAuthored===!0}function Pn(e){return u(e)?.connected===!0}function xn(e){const t=u(e);return t?.shape==="artifact"&&t?.carriesText===!0}function Le(e){const t=u(e.type)?.snippet;return t?t(e):""}function $n(e,t){const n=u(e.type)?.timeline;return n?n(e,t):e.type.replace(/_/g," ").toLowerCase()}function Un(e){const t=u(e.type)?.joinUrl;return t?t(e):void 0}function w(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 N(e,t,n){if(e===void 0)return null;if(typeof e=="string")return e||null;if("value"in e)return w(t,e.value)||null;const r={};for(const[a,o]of Object.entries(e.params??{}))r[a]=w(t,o);const i=n(e.key,r);return i===e.key?null:i}function De(e,t){if(!e||typeof e=="string"||"value"in e)return null;const n={};for(const[r,i]of Object.entries(e.params??{}))n[r]=w(t,i);return{key:e.key,params:n}}const me=140;function Kn(e){const t=e.trim();return t.length<=me?t:`${t.slice(0,me-1).trimEnd()}…`}function Bn(e,t){const n=De(t?.text,e),r=t?N(t.text,e,i=>i):null;return{activityId:e.id,type:e.type,snippet:Kn(r??Le(e)),authorName:e.author?.name??"",direction:e.direction,createdAt:e.createdAt??Date.now(),...n?{snippetKey:n.key,snippetParams:n.params}:{}}}const Gn=e=>e;function ge(e){const t=m[e];return{type:e,shape:t.shape,channelKind:t.channelKind,icon:t.icon,replyable:t.replyable===!0,countsAs:t.countsAs,carriesText:t.carriesText===!0,triggerable:t.triggerable===!0,component:t.component,builtIn:!0,displayNameKey:t.displayNameKey}}function he(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 Pe{constructor(t=[],n=Gn){this.translate=n;for(const r of t)r?.type&&(r.type in m||this.declared.has(r.type)||this.declared.set(r.type,r))}declared=new Map;get(t){if(t in m)return ge(t);const n=this.declared.get(t);return n?he(n):void 0}triggerable(){const t=Object.keys(m).filter(r=>m[r].triggerable).map(ge),n=[...this.declared.values()].map(he).filter(r=>r.triggerable);return[...t,...n]}timelineText(t,n){const r=m[t.type];if(r?.timeline)return r.timeline(t,n);const i=this.declared.get(t.type);return N(i?.text,t,this.translate)??t.type.replace(/_/g," ").toLowerCase()}snippet(t){const n=m[t.type];if(n?.snippet)return n.snippet(t);const r=this.declared.get(t.type);return N(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 J(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 Fn=new Pe;function Hn(e,t,n=[]){const r=e.createdAt;if(!r)return[];const i=new Set(n);return e.author.type==="user"&&e.author.id&&i.add(e.author.id),Object.entries(t).filter(([a,o])=>o>=r&&!i.has(a)).map(([a])=>a)}function xe(e){return e.createdAt??0}function Wn(e){return e.type==="EMAIL_RECEIVED"||e.type==="EMAIL_SENT"}function jn(e){return e.type==="CHAT_MESSAGE_SENT"||e.type==="CHAT_MESSAGE_RECEIVED"}const Z=[{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 S(e){return Z.find(t=>t.id===e)}function Vn(e){return S(e)?.label??e}function Xn(e,t="gpt-5-mini"){return S(e)?.defaultModel??t}function Yn(e){return Z.filter(t=>t.capabilities.includes(e))}function zn(e){const t=S(e);return!!t&&!t.baseUrl}function qn(e,t){return t==="text"?!0:S(e)?.attachmentKinds?.includes(t)===!0}function Jn(e,t){if(!e.enabled)return"ok";const n=G(e.hardLimitNanos),r=G(e.softLimitNanos);return n!==void 0&&t>=n?"hard":r!==void 0&&t>=r?"soft":"ok"}function G(e){return typeof e=="number"?e:void 0}function $e(e,t="month"){const n=new Date(e);return Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),1)}function Zn(e,t="month"){const n=new Date($e(e,t));return`${n.getUTCFullYear()}-${String(n.getUTCMonth()+1).padStart(2,"0")}`}function Qn(e){return e?.listeningEnabled!==!1}const er=[{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 $(e){return e<10?`0${e}`:`${e}`}function Ue(e,t){const n=new Date(e),r=`${n.getUTCFullYear()}-${$(n.getUTCMonth()+1)}-${$(n.getUTCDate())}`;return t==="day"?r:`${r}T${$(n.getUTCHours())}`}function Ke(e,t){const n=new Date(e);return n.setUTCMinutes(0,0,0),t==="day"&&n.setUTCHours(0),n.getTime()}const tr=36e5,nr=864e5;function rr(e,t,n){const r=n==="hour"?tr:nr,i=[];for(let a=Ke(e,n);a<=t;a+=r)i.push(Ue(a,n));return i}const Be=[{id:"resource",label:"Resource",labelSource:"raw"},{id:"origin",label:"Herkomst",labelSource:"raw"}],Ge=Be.map(e=>e.id);function Fe(e,t){return`${e}.usage.${t}`}function ir(e,t){return t.map(n=>({id:Fe(e,n.unit),label:n.label,category:"Verbruik",valueType:n.valueType??"count",aggregation:"sum",supportedDimensions:["provider",...Ge,...n.extraDimensions??[],"time"]}))}const He=new Set(["info","success","warning","destructive"]),F=200,H=100,W=200,j=12,V=4,Q=4e3,O=500,ar=256*1024,or=new Set(["heading","paragraph","list","quote","code","divider","table","kpi","callout"]),We=["http:","https:","mailto:","tel:"],sr=/^[a-z][a-z0-9+.-]*:/i;function je(e){const t=e.trim().replace(/^<|>$/g,"");if(!t)return!1;const n=sr.exec(t)?.[0];return n?We.includes(n.toLowerCase()):!t.startsWith("//")}const cr=/^[ \t]{0,3}\[([^\]]+)\]:[ \t]*(\S+).*$/gm;function lr(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 i=n+(r?2:1),a=Ae(e,i,"[","]");if(a<0||e[a+1]!=="("){t+=e[n],n+=1;continue}const o=Ae(e,a+2,"(",")");if(o<0){t+=e[n],n+=1;continue}const s=e.slice(i,a),c=e.slice(a+2,o).trim().split(/\s+/)[0]??"";t+=r||!je(c)?s:e.slice(n,o+1),n=o+1}return t}function Ae(e,t,n,r){let i=1;for(let a=t;a<e.length;a+=1){if(e[a]==="\\"){a+=1;continue}if(e[a]===n)i+=1;else if(e[a]===r&&(i-=1,i===0))return a}return-1}function Ve(e){return lr(e).replace(cr,(t,n,r)=>je(r)?t:"")}function p(e,t=Q){return typeof e=="string"?Ve(e).slice(0,t):""}function ur(e,t=Q){return typeof e=="string"?e.slice(0,t):""}function dr(e,t="info"){return typeof e=="string"&&He.has(e)?e:t}function pr(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const r of e){if(n.length>=F){t(`more than ${F} blocks; the rest was dropped`);break}if(!r||typeof r!="object")continue;const i=r;if(!or.has(i.type)){t(`unknown block type ${String(i.type)}`);continue}const a=typeof i.block_id=="string"?{block_id:i.block_id}:{};switch(i.type){case"heading":{const o=p(i.text);if(!o){t("a heading without text");continue}const s=i.level===2||i.level===3?i.level:1;n.push({...a,type:"heading",level:s,text:o});break}case"paragraph":{const o=p(i.text);if(!o){t("a paragraph without text");continue}n.push({...a,type:"paragraph",text:o});break}case"quote":{const o=p(i.text);if(!o){t("a quote without text");continue}n.push({...a,type:"quote",text:o});break}case"code":{const o=ur(i.text);if(!o){t("a code block without text");continue}const s=typeof i.lang=="string"?{lang:i.lang.slice(0,32)}:{};n.push({...a,type:"code",...s,text:o});break}case"divider":n.push({...a,type:"divider"});break;case"list":{const o=Array.isArray(i.items)?i.items:[],s=[];for(const l of o){if(s.length>=H){t(`more than ${H} list items`);break}const f=p(l?.text);if(!f)continue;const d=p(l?.lead,200);s.push(d?{lead:d,text:f}:{text:f})}if(s.length===0){t("a list without usable items");continue}const c=i.style==="numbered"?"numbered":"bulleted";n.push({...a,type:"list",style:c,items:s});break}case"table":{const o=Array.isArray(i.columns)?i.columns:[],s=[];for(const d of o){if(s.length>=j){t(`more than ${j} table columns`);break}const y=p(d?.label,O),D=d?.align==="right"?"right":void 0;s.push(D?{label:y,align:D}:{label:y})}if(s.length===0){t("a table without columns");continue}const c=Array.isArray(i.rows)?i.rows:[],l=[];for(const d of c){if(l.length>=W){t(`more than ${W} table rows`);break}const y=Array.isArray(d)?d:[];l.push(s.map((D,bn)=>p(y[bn],O)))}const f=p(i.caption,O);n.push({...a,type:"table",columns:s,rows:l,...f?{caption:f}:{}});break}case"kpi":{const o=Array.isArray(i.items)?i.items:[],s=[];for(const c of o){if(s.length>=V){t(`more than ${V} kpi items`);break}const l=p(c?.value,40),f=p(c?.label,80);if(!l||!f)continue;const d=c?.tone;s.push(typeof d=="string"&&He.has(d)?{value:l,label:f,tone:d}:{value:l,label:f})}if(s.length===0){t("a kpi block without usable items");continue}n.push({...a,type:"kpi",items:s});break}case"callout":{const o=p(i.text);if(!o){t("a callout without text");continue}const s=p(i.title,200);n.push({...a,type:"callout",tone:dr(i.tone),...s?{title:s}:{},text:o});break}}}return n}function fr(e){return JSON.stringify(e).length}function mr(e){return{blocks:e.length,types:e.map(t=>t.type),headings:e.flatMap(t=>t.type==="heading"?[t.text]:[])}}function Ee(e){return e.replace(/\|/g,"\\|").replace(/\r?\n/g," ").trim()}function Se(e,t,n){const r=e.map((i,a)=>n?.[a]==="right"?"---:":"---");return[`| ${e.map(Ee).join(" | ")} |`,`| ${r.join(" | ")} |`,...t.map(i=>`| ${i.map(Ee).join(" | ")} |`)]}function gr(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=Se(e.columns.map(n=>n.label),e.rows,e.columns.map(n=>n.align??"left"));return e.caption?[...t,"",`*${e.caption}*`]:t}case"kpi":return Se(e.items.map(t=>t.value),[e.items.map(t=>t.label)]);case"callout":return(e.title?`**${e.title}** ${e.text}`:e.text).split(/\r?\n/).map(n=>`> ${n}`)}}function hr(e,t){const n=[],r=e.some(i=>i.type==="heading"&&i.level===1);t&&!r&&n.push(`# ${t}`);for(const i of e){const a=gr(i);a.length>0&&n.push(a.join(`
|
|
4
4
|
`))}return`${n.join(`
|
|
5
5
|
|
|
6
6
|
`)}
|
|
7
|
-
`}const ee=e=>`user:${e}`,te=e=>`team:${e}`;function Ar(e){const t=new Set;for(const n of e??[])n?.id&&(n.kind==="user"&&t.add(ee(n.id)),n.kind==="team"&&t.add(te(n.id)));return[...t].sort()}function Er(e,t){return[ee(e),...t.map(te)]}function Sr(e){const t=new Set;for(const n of e??[])n?.kind&&t.add(n.kind);return[...t]}const
|
|
7
|
+
`}const ee=e=>`user:${e}`,te=e=>`team:${e}`;function Ar(e){const t=new Set;for(const n of e??[])n?.id&&(n.kind==="user"&&t.add(ee(n.id)),n.kind==="team"&&t.add(te(n.id)));return[...t].sort()}function Er(e,t){return[ee(e),...t.map(te)]}function Sr(e){const t=new Set;for(const n of e??[])n?.kind&&t.add(n.kind);return[...t]}const Xe=["done","escalated"];function yr(e){return Xe.includes(e)}const Ye="assignment";function _r(e){return`${Ye}:${e}`}function Tr(e,t,n){if(e.direction==="inbound")return!0;if(e.author?.type==="user"&&e.author.id===t)return!1;const r=e.payload?.mentions;return Array.isArray(r)&&r.includes(t)?!0:n==="reply"}function Ir(e){return e.subjectKind&&e.subjectId?{type:e.subjectKind,id:e.subjectId}:void 0}const ze=12;function br(e,t,n=ze){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 Mr=new Set(["mail","message"]);function qe(e,t){const n=e.settings?.signatures?.[t];return!n?.enabled||!n.body||n.body.trim()===""?null:n}function Or(e,t,n,r="html"){if(!e)return n;const i=qe(e,t);return i?`${n}${r==="text"?`
|
|
8
8
|
|
|
9
|
-
`:t==="mail"?"<br><br>-- <br>":"<br><br>"}${i.body}`:n}function Rr(e){return e.endpoints??[]}const Je=36e5,Ze=864e5,g=-1/0,Cr=e=>e.score>g,E={urgent:40,high:25,normal:10,low:0};function wr(e){return Object.fromEntries(e.map(t=>[t.resourceId,t]))}const Nr=/(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i,kr=/\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;function Qe(e,t){return!!(e&&Nr.test(e)||t&&kr.test(t))}const et=3,tt=600;function vr(e,t){return e>=et||t>=tt}function nt(e,t){return e.lastActivityAt?!(e.seenBy??[]).includes(t):!1}const rt=["open"],it=1e3,at={urgent:1,high:4,normal:8,low:24},ot=72;function st(e){return e.lastActivityAt??(e.createdAt?new Date(xe(e)).getTime():0)}function ct(e,t){return lt(t.remindersById?.[e.id],e,t.now)}function lt(e,t,n){return!e||e.remindAt<=n?!1:!((t.lastActivityAt??0)>e.parkedAt&&t.lastActivityPreview?.direction==="inbound")}const ut=e=>ve(e)==="outbound_message",dt=e=>rt.includes(e);function k(e,t){return Math.max(0,(t-st(e))/Je)}function pt(e,t){const n=e.assignedInboxId?t?.[e.assignedInboxId]:void 0;return typeof n=="number"&&n>0?n:at[e.priority??"normal"]}function Lr(e){const t={};for(const n of e)typeof n.slaHours=="number"&&n.slaHours>0&&(t[n.id]=n.slaHours);return t}function Dr(e,t,n){return!dt(e.status)||e.firstResponseAt?!1:k(e,t)>pt(e,n)}function ft(e,t){const n=e.lastActivityPreview;return n?.direction!=="outbound"||!ut(n.type)?!1:k(e,t)<ot}function Pr(e,t){if(!dt(e.status))return{score:g,reasons:[]};if(e.snoozedTill&&e.snoozedTill>t.now)return{score:g,reasons:[]};if(ft(e,t.now))return{score:g,reasons:[]};if(ct(e,t))return{score:g,reasons:[]};let n=0;const r=[],i=e.priority??"normal";E[i]>0&&(n+=E[i],r.push(`priority:${i}`)),nt(e,t.userId)&&(n+=20,r.push("unseen")),e.assignedUserId&&e.assignedUserId===t.userId&&(n+=15,r.push("assigned-to-you"));const a=k(e,t.now);if(a>0){const s=Math.min(a*2,30);n+=s,a>=1&&r.push(`waiting:${Math.round(a)}h`)}const o=e.lastActivityPreview;return o?.type==="AI_ACTION_PROPOSED"&&(n+=30,r.push("awaiting-approval")),o?.direction==="outbound"&&ut(o.type)&&(n+=10,r.push("no-reply")),!e.firstResponseAt&&e.lastActivityPreview?.direction==="inbound"&&(n+=10,r.push("awaiting-reply")),Qe(e.remoteParty?.resource,e.lastActivityPreview?.snippet)&&(n-=it,r.push("bulk")),{score:n,reasons:r}}const xr=e=>!!e.assignedUserId||!!e.assignedInboxId,$r=e=>e.status==="closed",Ur=e=>({urgent:10,high:5,normal:2,low:1})[e.priority]||0,Kr=(e,t=30)=>e.title?.length<=t?e.title:`${e.title.substring(0,t)}...`;function Br(e,t){const n=e.labels??[];return n.find(r=>r.locale===t)?.label??n[0]?.label??e.url}function Gr(e,t,n){const r=e.translations??[];return r.find(i=>i.locale===t)??(n?r.find(i=>i.locale===n):void 0)??{locale:t}}const Y=[{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 mt(e){const t=(e??"").toLowerCase();return Y.find(n=>n.code===t)??Y.find(n=>n.code===t.split("-")[0])}function Fr(e){return mt(e)?.label??e}function Hr(e){const t=mt(e);return t?t.english===t.label?`${t.english} (${t.code})`:`${t.english} — ${t.label} (${t.code})`:e}const ne=3;function gt(e,t){const n=new Set;let r=1,i=t.get(e)?.parentId;for(;i;){if(n.has(i)||(n.add(i),r++,r>ne+1))return 1/0;i=t.get(i)?.parentId}return r}function Wr(e,t,n){if(!e)return!0;if(e===t)return!1;const r=new Map(n.map(o=>[o.id,o]));if(!r.has(e)||t&&ht(e,t,r))return!1;const i=gt(e,r),a=t?re(t,n):1;return i+a<=ne}function ht(e,t,n){const r=new Set;let i=n.get(e)?.parentId;for(;i;){if(i===t)return!0;if(r.has(i))return!1;r.add(i),i=n.get(i)?.parentId}return!1}function re(e,t,n=new Set){if(n.has(e))return 1;n.add(e);const r=t.filter(i=>i.parentId===e);return r.length?1+Math.max(...r.map(i=>re(i.id,t,n))):1}const At="en";function Et(e){return e.defaultLocale||e.locale||At}function Vr(e){const t=new Set,n=[];for(const r of[Et(e),...e.locales??[]])!r||t.has(r)||(t.add(r),n.push(r));return n}function jr(e,t,n){const r=e.translations??[];return r.find(i=>i.locale===t)?.name??(n?r.find(i=>i.locale===n)?.name:void 0)??e.name}const X=["lookup","condition","parallel","for-each"];function z(e){for(const t of e){if(!X.includes(t.type))return`staptype "${t.type}" mag niet meelezen (alleen ${X.join(", ")})`;if(t.type==="parallel")for(const n of t.branches??[]){const r=z(n);if(r)return r}if(t.type==="for-each"){const n=z(t.body??[]);if(n)return n}}return null}function Yr(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 Xr(e,t){return e.filter(n=>n.enabled&&Yr(n.ownerScope,t))}function zr(e){return e.credentialScope?e.credentialScope:(e.authMode??"header")==="header"||e.oauth?.scope==="org"?"shared":"per-user"}function qr(e){return`mcp__${e}__`}const Jr=1e3,Zr=2e3,Qr=500,ei=12e3,ti=4e3,St=["contact","company","work_item"];function ni(e){if(!e)return!1;const t=e.slice(0,e.indexOf(":"));return St.includes(t)}const ri="onboarding-source",ii=["support","billing","availability","sales","onboarding"],ai=["keep","replace"];function yt(e){switch(e.kind){case"user":return`user:${e.userId}`;case"team":return`team:${e.teamId}`;case"org":return"org"}}function oi(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),i=t.slice(n+1).trim();if(i){if(r==="user")return{kind:"user",userId:i};if(r==="team")return{kind:"team",teamId:i}}}function _t(e){return yt(e)}function Tt(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 It=Tt;function si(e){return e.agentId?{kind:"user",userId:e.agentId}:It(e.ownerScope)}function ci(e){return _t(e)}function li(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 ui(e,t){return e.targets.find(n=>n.activityTypes.includes(t))}function di(e,t){if(t)return e.targets.find(n=>n.id===t)}function bt(e){return e?.kind==="assignment"}function pi(e){const{trigger:t,agentId:n,target:r,activityType:i,assigneeUserId:a,authorUserId:o}=e;return bt(t)?n?r?r.activityTypes.includes(i)?a?a!==n?"assigned to someone else":o&&o===n?"the agent assigned this to itself, which would restart its own run":null:`no assignee found at ${r.assigneePath}`:`activity type ${i} 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 fi(e){return(e.startsWith("tool:")?e.slice(5):e).replace(/__/g," · ").replace(/\./g," · ").replace(/_/g," ")}const mi=[{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:"assigneeUserId",type:"string"}],gi={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 Mt(e){return`${e.type}:${e.id}`}const Ot="interaction";function Rt(e){return e?.type===Ot?e.id:void 0}const Ct=64,wt=8e3;function hi(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),Ct),wt)}const Ai={kind:"workflow",steps:[]};function Ei(e){return e?.kind==="workflow"?e.steps:[]}function Si(e){return e?.kind==="procedure"?e.procedure:void 0}function Nt(e){const t=e?.approved??0,n=t+(e?.rejected??0);return{total:n,rate:n?t/n:0}}const kt=10,vt=.9;function yi(e){const{total:t,rate:n}=Nt(e);return t>=kt&&n>=vt}const Lt=["done","escalated","failed","stopped"];function _i(e){return Lt.includes(e)}function Dt(e){return e==="waiting"}function Ti(e){return e==="running"||Dt(e)}function ie(e){return e.subjectKind&&e.subjectId?{type:e.subjectKind,id:e.subjectId}:void 0}function Ii(e){const t=ie(e);return t?Mt(t):void 0}function bi(e){return Rt(ie(e))}function Mi(e,t){const n=e.accumulatedSeconds||0;return e.runningSince?n+Math.max(0,Math.floor((t-e.runningSince)/1e3)):n}function Oi(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 Ri(e){const t=Math.max(0,Math.round(e/60));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function Ci(e){const t=Math.max(0,Math.floor(e)),n=a=>String(a).padStart(2,"0"),r=Math.floor(t/60)%60,i=Math.floor(t/3600);return i>0?`${i}:${n(r)}:${n(t%60)}`:`${n(r)}:${n(t%60)}`}function Pt(e){return(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").slice(0,48).replace(/^-+|-+$/g,"")}function wi(e,t){const n=Pt(e)||"werksoort",r=new Set(t);if(!r.has(n))return n;for(let i=2;i<500;i++){const a=`${n}-${i}`;if(!r.has(a))return a}return`${n}-${r.size+1}`}function Ni(e,t){const n=e.ownerScope;return!n||n.kind==="org"?!0:t.includes(n.teamId)}function ki(e){return e.filter(t=>!t.archived).sort(xt)}function xt(e,t){const n=(e.order??0)-(t.order??0);return n!==0?n:(e.label||"").localeCompare(t.label||"")}const $t=20,Ut=20,R=300;function h(e){return e.toLowerCase().replace(/[^\p{L}\p{N}\s]/gu," ").replace(/\s+/g," ").trim()}function Kt(e){const t=e.replace(/\s+/g," ").trim();if(t.length<=R)return t;const n=t.slice(0,R),r=Math.max(n.lastIndexOf(". "),n.lastIndexOf("! "),n.lastIndexOf("? "));return r>R*.6?n.slice(0,r+1):`${n.trimEnd()}…`}function vi(e,t){const n=Kt(t.text),r=h(n);if(!r||(e.examples??[]).some(o=>h(o)===r))return null;const i=e.exampleCandidates??[],a=i.findIndex(o=>h(o.text)===r);if(a>=0){if(i[a].corrected||!t.corrected)return null;const o=[...i];return o[a]={...o[a],corrected:!0,addedAt:t.addedAt},ye(o)}return ye([{...t,text:n},...i]).slice(0,Ut)}function ye(e){return[...e].sort((t,n)=>Number(n.corrected)-Number(t.corrected)||n.addedAt-t.addedAt)}function Li(e,t){const n=h(t),r=(e.examples??[]).filter(a=>a.trim());return{examples:r.some(a=>h(a)===n)?r:[...r,t].slice(-$t),exampleCandidates:Bt(e,t)}}function Bt(e,t){const n=h(t);return(e.exampleCandidates??[]).filter(r=>h(r.text)!==n)}function Gt(e,t){const n=e.ownerScope;return n?n.kind==="org"?!0:n.kind==="team"?!!t&&n.teamId===t:!1:!1}function Di(e,t){return e.filter(n=>Gt(n,t))}function Pi(e){return e.type==="agent"}const xi="WORK_COMMENT_ADDED",$i="WORK_ITEM_ASSIGNED",Ui="WORK_ITEM_STATUS_CHANGED";function Ki(e,t){const n=r=>{const i=new Date(r);return i.setHours(0,0,0,0),i.getTime()};return Math.round((n(e)-n(t))/Ze)}function Bi(e,t){if(e.closedAt!=null)return{score:g,reasons:[]};const n=t.remindersById?.[e.id];if(n&&n.remindAt>t.now)return{score:g,reasons:[]};let r=0;const i=[],a=e.priority??"normal";if(E[a]>0&&(r+=E[a],i.push(`priority:${a}`)),typeof e.dueDate=="number"){const o=Ki(e.dueDate,t.now);o<0?(r+=35,i.push("overdue")):o===0&&(r+=20,i.push("due-today"))}return e.source?.initiator==="system"&&e.source.systemReason&&(r+=15,i.push(`auto:${e.source.systemReason}`)),{score:r,reasons:i}}const Ft="work_item",Ht="work_project";function Wt(e){return`${Ft}:${e}`}function ae(e){return`${Ht}:${e}`}function Gi(e,t,n){const r=`${e}-${t}`;return n?`${r}-${n}`:r}function Fi(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 Hi(e){return(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,3)||"PRJ"}function Wi(e,t=25){const n=new Set([Wt(e.id)]);e.projectId&&n.add(ae(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 Vi(e){return[ae(e.id)]}const v=[{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}],oe=v.map(e=>e.key);function Vt(e){return e?.statuses?.length?e.statuses:v}function jt(e,t){return t.find(n=>n.key===e)?.category??"todo"}function ji(e,t){return t.find(n=>n.key===e)}function Yi(e){const t=Vt(e),n=e?.defaultStatusKey;return n&&t.some(r=>r.key===n)?n:Yt(t)[0]?.key??v[0].key}function Yt(e){return[...e].sort((t,n)=>{const r=(t.order??0)-(n.order??0);return r!==0?r:(t.label||"").localeCompare(n.label||"")})}function Xi(e,t){return jt(e,t)==="done"}function Xt(e){return(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").slice(0,48).replace(/^-+|-+$/g,"")}function zi(e,t){const n=Xt(e)||"status",r=new Set([...t,...oe]);if(!r.has(n))return n;for(let i=2;i<500;i++){const a=`${n}-${i}`;if(!r.has(a))return a}return`${n}-${r.size+1}`}function qi(e){const t=[];if(!e.length)return[{index:-1,reason:"empty"}];const n=new Set;return e.forEach((r,i)=>{if(!r.key){t.push({index:i,reason:"missing_key"});return}oe.includes(r.key)&&t.push({index:i,reason:"reserved_key",key:r.key}),n.has(r.key)&&t.push({index:i,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}const Ji=new Set(["image/png","image/jpeg","image/jpg","image/gif","image/webp"]),Zi=new Set(["text/plain","text/markdown","text/csv","application/json","text/html","application/xml","text/xml"]);function zt(e){const t=(e??"").trim().toLowerCase().split(";")[0];return t?Ji.has(t)?"image":t==="application/pdf"?"pdf":Zi.has(t)?"text":t.startsWith("audio/")?"audio":"unsupported":"unsupported"}const A=1024*1024,qt={image:5*A,pdf:20*A,text:1*A,audio:20*A},Qi=25*A,ea=5;function ta(e,t){const n=zt(e);return n==="unsupported"?"unsupported":t>qt[n]?"too-large":null}function na(e){return e.access!=="read"&&e.effect!=="internal"}function Jt(e){return`${e.kind}:${e.id||e.url||e.title}`}function ra(e,t=[]){const n=new Set(t),r=[],i=[];for(const a of e){const o=Jt(a);n.has(o)||(n.add(o),r.push(a),i.push(o))}return{sources:r,keys:i}}const ia="assist-source",aa=["blocking","due","open"];function oa(e,t){const[n,r]=(e.subjectKey??"").split(":");return n===t&&r?r:void 0}const _e={blocking:0,due:1,open:2};function sa(e,t){return _e[e.band??"open"]-_e[t.band??"open"]||(t.priority??0)-(e.priority??0)||e.id.localeCompare(t.id)}function ca(e){return e.sessions.filter(t=>t.id!==e.exceptSessionId&&t.state==="connected"&&e.canHold(t.providerId))}function la(e){return e.sessions.filter(t=>t.id!==e.exceptSessionId&&t.state==="connected"&&!e.canHold(t.providerId))}function ua(e){return e.sessions.some(n=>n.id!==e.exceptSessionId&&(n.state==="connected"||n.state==="on_hold"))?{admit:!1,reason:"busy"}:{admit:!0}}function Zt(e,t){const n=new Set(e.disabledIntents??[]),r=e.intentOverrides??{},i=t.intents.filter(o=>!n.has(o.intent)).map(o=>pa(o,r[o.intent]));if(!e.extraIntents||e.extraIntents.length===0)return i;const a=new Set(i.map(o=>o.intent));for(const o of e.extraIntents)a.has(o.intent)||(i.push(o),a.add(o.intent));return i}function Qt(e,t){const n={};for(const r of e.intents){if(!r.togglable)continue;const i=t?.[r.intent];n[r.intent]=i??r.defaultEnabled??!0}return n}function da(e,t){const n=Qt(e,t);return Object.entries(n).filter(([,r])=>!r).map(([r])=>r)}function pa(e,t){return t?{intent:t.intent??e.intent,targetSchemes:t.targetSchemes??e.targetSchemes,transport:t.transport??e.transport}:e}function fa(e,t){const n=[];for(const r of e){if(!r.enabled)continue;const i=t[r.providerId];if(i)for(const a of Zt(r,i))n.push({channel:r,description:i,capability:a})}return n}function ma(e,t){return t.filter(n=>n.capability.intent===e)}function en(e,t){return t.filter(n=>n.capability.targetSchemes.includes(e))}function ga(e,t){return en(e.scheme,t)}function ha(e,t,n){const r=[];for(const i of e)for(const a of n)a.capability.intent===t&&a.capability.targetSchemes.includes(i.scheme)&&r.push({channelIntent:a,endpoint:i});return r}var tn=(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))(tn||{});const Aa={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 Ea(e){return e?Aa[e]??"note":"note"}const Sa="message_window",ya="message_templates",_a={FROM:"from",TO:"to",CC:"cc",BCC:"bcc",ORGANIZER:"organizer",PRESENTER:"presenter",ATTENDEE:"attendee",OWNER:"owner",MEMBER:"member",GUEST:"guest",HOST:"host",PARTICIPANT:"participant"},Ta=(e,t)=>({intent:e,...t}),Ia="folder_management",ba="remote_search",Ma={ok:!1,code:"UNSUPPORTED",message:"Provider does not support this op"},Oa="context.collect",Ra="installation-id";function Ca(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 wa="notification-source",Na=(e,t)=>`${e}.pref.${t}`,ka={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","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"]},se=9e4,nn=["out_of_office"],rn=e=>nn.includes(e);function va(e,t,n){const r=n-e<se,i=t?.status&&(!t.expiresAt||t.expiresAt>n)?t:void 0;if(!i?.status)return{online:r,status:r?"available":"offline"};const a=i.status;return!r&&!rn(a)?{online:!1,status:"offline"}:{online:r,status:a,message:i.message}}function La(e,t){const n=t-e.lastSeenAt<se,r=n||rn(e.status)?e.status:"offline";return n===e.online&&r===e.status?e:{...e,online:n,status:r}}function Da(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 Pa(e){return e.providerAvailable&&e.allowed}const xa="resources.describe",$a="resources.search",Ua="resources.resolve",Ka="resources.attached";function Ba(e){const t=e.indexOf(":");return t===-1?e:e.slice(0,t)}const ce="auth";function le(e){const t=typeof e=="string"?e.match(/apps\/([^/?#]+)/):null;return t?t[1]:null}function Ga(e){const t=le(e);return t?t!==ce:typeof e=="string"&&e.startsWith("/wake")}function Fa(e){return typeof e!="string"||e===""||e==="/"?!0:le(e)===ce}function Ha(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function an(e){const n=e.split("/").filter(Boolean).map(r=>r.startsWith(":")?r.endsWith("?")?"(?:/[^/]+)?":"/[^/]+":`/${Ha(r)}`).join("");return new RegExp(`^${n}\\/?$`)}function on(e,t){const n=e.split("/").filter(Boolean),r=t.split("/").filter(Boolean),i={};return n.forEach((a,o)=>{if(a.startsWith(":")){const s=a.endsWith("?")?a.slice(1,-1):a.slice(1),l=r[o];l&&(i[s]=l)}}),i}function sn(e){return e.publicBasePath??`/apps/${e.name}`}function Wa(e){const t=[];for(const n of e){if(!n?.name)continue;const r=sn(n);for(const i of n.routes??[]){if(!i.public)continue;const a=i.path==="/"?"":i.path;t.push({appName:n.name,resource:i.resource,pattern:`${r}${a}`,props:i.props})}}return t}function cn(e,t){const n=e.split("/").filter(Boolean),r=t.split("/").filter(Boolean);for(let i=0;i<Math.min(n.length,r.length);i++){const a=n[i].startsWith(":"),o=r[i].startsWith(":");if(a!==o)return o}return n.length>r.length}function ln(e,t){if(typeof e!="string")return null;let n=null;for(const r of t)an(r.pattern).test(e)&&(!n||cn(r.pattern,n.pattern))&&(n=r);return n?{...n,params:{...n.props,...on(n.pattern,e)}}:null}function Va(e,t){return ln(e,t)!==null}const ja="sync-source",Ya="sync-target",Xa=20,za={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]"]},un=e=>{let t=e;return Object.values(za).forEach(n=>{n.forEach(r=>{t=t.replaceAll(r,"")})}),t=t.replace(/\(.*?\)/g,""),t=t.replace(/\[.*?\]/g,""),t},dn=6e4,pn=8e3,fn=2,mn=.4,qa=3,Ja=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 gn(e){const t=new Set;for(const n of e.toLowerCase().split(/[^a-z0-9À-ɏ]+/))n.length<qa||Ja.has(n)||t.add(n);return[...t]}function hn(e,t){if(!e.length)return 0;if(!t.length)return 1;const n=new Set(t),r=new Set(e);let i=0;for(const a of r)n.has(a)||(i+=1);return i/r.size}function An(e,t=dn){const n=e.filter(o=>!o.partial&&typeof o.text=="string");if(!n.length)return{text:"",segmentCount:0};const i=n.reduce((o,s)=>Math.max(o,s.endedAt??0),0)-t;return{text:n.filter(o=>(o.endedAt??0)>=i).map(o=>un(o.text).trim()).filter(Boolean).join(" ").replace(/\s+/g," ").trim(),segmentCount:n.length}}const En=60;function Za(e,t,n=En){const r=new Set(e),i=[...e];for(const a of t)!a||r.has(a)||(r.add(a),i.push(a));return i.slice(-n)}function Qa(e){const{segments:t,now:n,state:r}=e;if(r.lastTriggerAt&&n-r.lastTriggerAt<pn)return{trigger:!1,reason:"too_soon"};const i=An(t,e.windowMs);if(!i.text)return{trigger:!1,reason:"no_speech"};const a=i.segmentCount-(r.lastSegmentCount??0);if(r.lastQueryTerms&&a<fn)return{trigger:!1,reason:"too_few_new"};const o=gn(i.text);return o.length?r.lastQueryTerms?.length&&hn(o,r.lastQueryTerms)<mn?{trigger:!1,reason:"same_topic"}:{trigger:!0,text:i.text,terms:o,segmentCount:i.segmentCount}:{trigger:!1,reason:"no_speech"}}const eo=["personal","workspace","connections","work","ai"],to="navNotice",L={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}},Sn="NL",no=15,ro=8,io=Array.from(new Set(Object.values(L).map(e=>e.callingCode))).sort((e,t)=>t.length-e.length);function Te(e){if(e)return L[e.trim().toUpperCase()]}function C(e,t){return e.length>=t.nsnMin&&e.length<=t.nsnMax}function Ie(e){if(e.length>no)return null;for(const t of io){if(!e.startsWith(t))continue;const n=e.slice(t.length);for(const r of Object.values(L)){if(r.callingCode!==t)continue;const i=r.trunkPrefix,a=i&&n.startsWith(i)?n.slice(i.length):n;if(C(a,r))return`+${t}${a}`}return null}return e.length<ro?null:`+${e}`}function ao(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 oo(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 q(e,t){if(!e)return null;const n=ao(e);if(!n)return null;const r=n.startsWith("+"),i=n.replace(/\D/g,"");if(!i)return null;if(r)return Ie(i);if(i.startsWith("00"))return Ie(i.slice(2));const a=Te(t)??Te(Sn);if(!a)return null;const o=a.trunkPrefix;if(o&&i.startsWith(o)){const s=i.slice(o.length);return C(s,a)?`+${a.callingCode}${s}`:null}if(i.startsWith(a.callingCode)){const s=i.slice(a.callingCode.length);if(C(s,a))return`+${a.callingCode}${s}`}return!o&&C(i,a)?`+${a.callingCode}${i}`:null}function so(e,t=9){const n=(e??"").replace(/\D/g,"");return n.length<t?null:n.slice(-t)}function ue(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],i=t.slice(n+1);return!r||!i.includes(".")?null:`${r}@${i}`}function co(e){const t=ue(e);return t?t.slice(t.lastIndexOf("@")+1):null}const lo=new Set(["co.uk","org.uk","gov.uk","ac.uk","com.au","co.nz","com.br","co.za"]);function yn(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 lo.has(n)&&t.length>=3?t.slice(-3).join("."):n}const _n=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 uo(e){const t=yn(e);return t?_n.has(t):!1}function po(e){if(!e)return!1;const t=e.trim().toLowerCase();return t==="tel"||t==="sms"||t==="whatsapp"||t==="fax"}function fo(e,t,n){if(!e||!t)return null;const r=e.trim().toLowerCase();if(r==="tel"||r==="sms"||r==="whatsapp"){const a=q(t,n);return a?`tel:${a}`:null}if(r==="fax"){const a=q(t,n);return a?`fax:${a}`:null}if(r==="mailto"||r==="email"){const a=ue(t);return a?`mailto:${a}`:null}const i=t.trim().toLowerCase();return i?`${r}:${i}`:null}const mo=[/<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],be=/^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i,go=/^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;function ho(e){const t=e.split(`
|
|
9
|
+
`:t==="mail"?"<br><br>-- <br>":"<br><br>"}${i.body}`:n}function Rr(e){return e.endpoints??[]}const Je=36e5,Ze=864e5,g=-1/0,Cr=e=>e.score>g,E={urgent:40,high:25,normal:10,low:0};function wr(e){return Object.fromEntries(e.map(t=>[t.resourceId,t]))}const Nr=/(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i,kr=/\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;function Qe(e,t){return!!(e&&Nr.test(e)||t&&kr.test(t))}const et=3,tt=600;function vr(e,t){return e>=et||t>=tt}function nt(e,t){return e.lastActivityAt?!(e.seenBy??[]).includes(t):!1}const rt=["open"],it=1e3,at={urgent:1,high:4,normal:8,low:24},ot=72;function st(e){return e.lastActivityAt??(e.createdAt?new Date(xe(e)).getTime():0)}function ct(e,t){return lt(t.remindersById?.[e.id],e,t.now)}function lt(e,t,n){return!e||e.remindAt<=n?!1:!((t.lastActivityAt??0)>e.parkedAt&&t.lastActivityPreview?.direction==="inbound")}const ut=e=>ve(e)==="outbound_message",dt=e=>rt.includes(e);function k(e,t){return Math.max(0,(t-st(e))/Je)}function pt(e,t){const n=e.assignedInboxId?t?.[e.assignedInboxId]:void 0;return typeof n=="number"&&n>0?n:at[e.priority??"normal"]}function Lr(e){const t={};for(const n of e)typeof n.slaHours=="number"&&n.slaHours>0&&(t[n.id]=n.slaHours);return t}function Dr(e,t,n){return!dt(e.status)||e.firstResponseAt?!1:k(e,t)>pt(e,n)}function ft(e,t){const n=e.lastActivityPreview;return n?.direction!=="outbound"||!ut(n.type)?!1:k(e,t)<ot}function Pr(e,t){if(!dt(e.status))return{score:g,reasons:[]};if(e.snoozedTill&&e.snoozedTill>t.now)return{score:g,reasons:[]};if(ft(e,t.now))return{score:g,reasons:[]};if(ct(e,t))return{score:g,reasons:[]};let n=0;const r=[],i=e.priority??"normal";E[i]>0&&(n+=E[i],r.push(`priority:${i}`)),nt(e,t.userId)&&(n+=20,r.push("unseen")),e.assignedUserId&&e.assignedUserId===t.userId&&(n+=15,r.push("assigned-to-you"));const a=k(e,t.now);if(a>0){const s=Math.min(a*2,30);n+=s,a>=1&&r.push(`waiting:${Math.round(a)}h`)}const o=e.lastActivityPreview;return o?.type==="AI_ACTION_PROPOSED"&&(n+=30,r.push("awaiting-approval")),o?.direction==="outbound"&&ut(o.type)&&(n+=10,r.push("no-reply")),!e.firstResponseAt&&e.lastActivityPreview?.direction==="inbound"&&(n+=10,r.push("awaiting-reply")),Qe(e.remoteParty?.resource,e.lastActivityPreview?.snippet)&&(n-=it,r.push("bulk")),{score:n,reasons:r}}const xr=e=>!!e.assignedUserId||!!e.assignedInboxId,$r=e=>e.status==="closed",Ur=e=>({urgent:10,high:5,normal:2,low:1})[e.priority]||0,Kr=(e,t=30)=>e.title?.length<=t?e.title:`${e.title.substring(0,t)}...`;function Br(e,t){const n=e.labels??[];return n.find(r=>r.locale===t)?.label??n[0]?.label??e.url}function Gr(e,t,n){const r=e.translations??[];return r.find(i=>i.locale===t)??(n?r.find(i=>i.locale===n):void 0)??{locale:t}}const X=[{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 mt(e){const t=(e??"").toLowerCase();return X.find(n=>n.code===t)??X.find(n=>n.code===t.split("-")[0])}function Fr(e){return mt(e)?.label??e}function Hr(e){const t=mt(e);return t?t.english===t.label?`${t.english} (${t.code})`:`${t.english} — ${t.label} (${t.code})`:e}const ne=3;function gt(e,t){const n=new Set;let r=1,i=t.get(e)?.parentId;for(;i;){if(n.has(i)||(n.add(i),r++,r>ne+1))return 1/0;i=t.get(i)?.parentId}return r}function Wr(e,t,n){if(!e)return!0;if(e===t)return!1;const r=new Map(n.map(o=>[o.id,o]));if(!r.has(e)||t&&ht(e,t,r))return!1;const i=gt(e,r),a=t?re(t,n):1;return i+a<=ne}function ht(e,t,n){const r=new Set;let i=n.get(e)?.parentId;for(;i;){if(i===t)return!0;if(r.has(i))return!1;r.add(i),i=n.get(i)?.parentId}return!1}function re(e,t,n=new Set){if(n.has(e))return 1;n.add(e);const r=t.filter(i=>i.parentId===e);return r.length?1+Math.max(...r.map(i=>re(i.id,t,n))):1}const At="en";function Et(e){return e.defaultLocale||e.locale||At}function jr(e){const t=new Set,n=[];for(const r of[Et(e),...e.locales??[]])!r||t.has(r)||(t.add(r),n.push(r));return n}function Vr(e,t,n){const r=e.translations??[];return r.find(i=>i.locale===t)?.name??(n?r.find(i=>i.locale===n)?.name:void 0)??e.name}const Y=["lookup","condition","parallel","for-each"];function z(e){for(const t of e){if(!Y.includes(t.type))return`staptype "${t.type}" mag niet meelezen (alleen ${Y.join(", ")})`;if(t.type==="parallel")for(const n of t.branches??[]){const r=z(n);if(r)return r}if(t.type==="for-each"){const n=z(t.body??[]);if(n)return n}}return null}function Xr(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 Yr(e,t){return e.filter(n=>n.enabled&&Xr(n.ownerScope,t))}function zr(e){return e.credentialScope?e.credentialScope:(e.authMode??"header")==="header"||e.oauth?.scope==="org"?"shared":"per-user"}function qr(e){return`mcp__${e}__`}const Jr=1e3,Zr=2e3,Qr=500,ei=12e3,ti=4e3,St=["contact","company","work_item"];function ni(e){if(!e)return!1;const t=e.slice(0,e.indexOf(":"));return St.includes(t)}const ri="onboarding-source",ii=["support","billing","availability","sales","onboarding"],ai=["keep","replace"];function yt(e){switch(e.kind){case"user":return`user:${e.userId}`;case"team":return`team:${e.teamId}`;case"org":return"org"}}function oi(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),i=t.slice(n+1).trim();if(i){if(r==="user")return{kind:"user",userId:i};if(r==="team")return{kind:"team",teamId:i}}}function _t(e){return yt(e)}function Tt(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 It=Tt;function si(e){return e.agentId?{kind:"user",userId:e.agentId}:It(e.ownerScope)}function ci(e){return _t(e)}function li(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 ui(e,t){return e.targets.find(n=>n.activityTypes.includes(t))}function di(e,t){if(t)return e.targets.find(n=>n.id===t)}function bt(e){return e?.kind==="assignment"}function pi(e){const{trigger:t,agentId:n,target:r,activityType:i,assigneeUserId:a,authorUserId:o}=e;return bt(t)?n?r?r.activityTypes.includes(i)?a?a!==n?"assigned to someone else":o&&o===n?"the agent assigned this to itself, which would restart its own run":null:`no assignee found at ${r.assigneePath}`:`activity type ${i} 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 fi(e){return(e.startsWith("tool:")?e.slice(5):e).replace(/__/g," · ").replace(/\./g," · ").replace(/_/g," ")}const mi=[{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:"assigneeUserId",type:"string"}],gi={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 Mt(e){return`${e.type}:${e.id}`}const Ot="interaction";function Rt(e){return e?.type===Ot?e.id:void 0}const Ct=64,wt=8e3;function hi(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),Ct),wt)}const Ai={kind:"workflow",steps:[]};function Ei(e){return e?.kind==="workflow"?e.steps:[]}function Si(e){return e?.kind==="procedure"?e.procedure:void 0}function Nt(e){const t=e?.approved??0,n=t+(e?.rejected??0);return{total:n,rate:n?t/n:0}}const kt=10,vt=.9;function yi(e){const{total:t,rate:n}=Nt(e);return t>=kt&&n>=vt}const Lt=["done","escalated","failed","stopped"];function _i(e){return Lt.includes(e)}function Dt(e){return e==="waiting"}function Ti(e){return e==="running"||Dt(e)}function ie(e){return e.subjectKind&&e.subjectId?{type:e.subjectKind,id:e.subjectId}:void 0}function Ii(e){const t=ie(e);return t?Mt(t):void 0}function bi(e){return Rt(ie(e))}function Mi(e,t){const n=e.accumulatedSeconds||0;return e.runningSince?n+Math.max(0,Math.floor((t-e.runningSince)/1e3)):n}function Oi(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 Ri(e){const t=Math.max(0,Math.round(e/60));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function Ci(e){const t=Math.max(0,Math.floor(e)),n=a=>String(a).padStart(2,"0"),r=Math.floor(t/60)%60,i=Math.floor(t/3600);return i>0?`${i}:${n(r)}:${n(t%60)}`:`${n(r)}:${n(t%60)}`}function Pt(e){return(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").slice(0,48).replace(/^-+|-+$/g,"")}function wi(e,t){const n=Pt(e)||"werksoort",r=new Set(t);if(!r.has(n))return n;for(let i=2;i<500;i++){const a=`${n}-${i}`;if(!r.has(a))return a}return`${n}-${r.size+1}`}function Ni(e,t){const n=e.ownerScope;return!n||n.kind==="org"?!0:t.includes(n.teamId)}function ki(e){return e.filter(t=>!t.archived).sort(xt)}function xt(e,t){const n=(e.order??0)-(t.order??0);return n!==0?n:(e.label||"").localeCompare(t.label||"")}const $t=20,Ut=20,R=300;function h(e){return e.toLowerCase().replace(/[^\p{L}\p{N}\s]/gu," ").replace(/\s+/g," ").trim()}function Kt(e){const t=e.replace(/\s+/g," ").trim();if(t.length<=R)return t;const n=t.slice(0,R),r=Math.max(n.lastIndexOf(". "),n.lastIndexOf("! "),n.lastIndexOf("? "));return r>R*.6?n.slice(0,r+1):`${n.trimEnd()}…`}function vi(e,t){const n=Kt(t.text),r=h(n);if(!r||(e.examples??[]).some(o=>h(o)===r))return null;const i=e.exampleCandidates??[],a=i.findIndex(o=>h(o.text)===r);if(a>=0){if(i[a].corrected||!t.corrected)return null;const o=[...i];return o[a]={...o[a],corrected:!0,addedAt:t.addedAt},ye(o)}return ye([{...t,text:n},...i]).slice(0,Ut)}function ye(e){return[...e].sort((t,n)=>Number(n.corrected)-Number(t.corrected)||n.addedAt-t.addedAt)}function Li(e,t){const n=h(t),r=(e.examples??[]).filter(a=>a.trim());return{examples:r.some(a=>h(a)===n)?r:[...r,t].slice(-$t),exampleCandidates:Bt(e,t)}}function Bt(e,t){const n=h(t);return(e.exampleCandidates??[]).filter(r=>h(r.text)!==n)}function Gt(e,t){const n=e.ownerScope;return n?n.kind==="org"?!0:n.kind==="team"?!!t&&n.teamId===t:!1:!1}function Di(e,t){return e.filter(n=>Gt(n,t))}function Pi(e){return e.type==="agent"}const xi="WORK_COMMENT_ADDED",$i="WORK_ITEM_ASSIGNED",Ui="WORK_ITEM_STATUS_CHANGED";function Ki(e,t){const n=r=>{const i=new Date(r);return i.setHours(0,0,0,0),i.getTime()};return Math.round((n(e)-n(t))/Ze)}function Bi(e,t){if(e.closedAt!=null)return{score:g,reasons:[]};const n=t.remindersById?.[e.id];if(n&&n.remindAt>t.now)return{score:g,reasons:[]};let r=0;const i=[],a=e.priority??"normal";if(E[a]>0&&(r+=E[a],i.push(`priority:${a}`)),typeof e.dueDate=="number"){const o=Ki(e.dueDate,t.now);o<0?(r+=35,i.push("overdue")):o===0&&(r+=20,i.push("due-today"))}return e.source?.initiator==="system"&&e.source.systemReason&&(r+=15,i.push(`auto:${e.source.systemReason}`)),{score:r,reasons:i}}const Ft="work_item",Ht="work_project";function Wt(e){return`${Ft}:${e}`}function ae(e){return`${Ht}:${e}`}function Gi(e,t,n){const r=`${e}-${t}`;return n?`${r}-${n}`:r}function Fi(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 Hi(e){return(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,3)||"PRJ"}function Wi(e,t=25){const n=new Set([Wt(e.id)]);e.projectId&&n.add(ae(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 ji(e){return[ae(e.id)]}const v=[{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}],oe=v.map(e=>e.key);function jt(e){return e?.statuses?.length?e.statuses:v}function Vt(e,t){return t.find(n=>n.key===e)?.category??"todo"}function Vi(e,t){return t.find(n=>n.key===e)}function Xi(e){const t=jt(e),n=e?.defaultStatusKey;return n&&t.some(r=>r.key===n)?n:Xt(t)[0]?.key??v[0].key}function Xt(e){return[...e].sort((t,n)=>{const r=(t.order??0)-(n.order??0);return r!==0?r:(t.label||"").localeCompare(n.label||"")})}function Yi(e,t){return Vt(e,t)==="done"}function Yt(e){return(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").slice(0,48).replace(/^-+|-+$/g,"")}function zi(e,t){const n=Yt(e)||"status",r=new Set([...t,...oe]);if(!r.has(n))return n;for(let i=2;i<500;i++){const a=`${n}-${i}`;if(!r.has(a))return a}return`${n}-${r.size+1}`}function qi(e){const t=[];if(!e.length)return[{index:-1,reason:"empty"}];const n=new Set;return e.forEach((r,i)=>{if(!r.key){t.push({index:i,reason:"missing_key"});return}oe.includes(r.key)&&t.push({index:i,reason:"reserved_key",key:r.key}),n.has(r.key)&&t.push({index:i,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}const Ji=new Set(["image/png","image/jpeg","image/jpg","image/gif","image/webp"]),Zi=new Set(["text/plain","text/markdown","text/csv","application/json","text/html","application/xml","text/xml"]);function zt(e){const t=(e??"").trim().toLowerCase().split(";")[0];return t?Ji.has(t)?"image":t==="application/pdf"?"pdf":Zi.has(t)?"text":t.startsWith("audio/")?"audio":"unsupported":"unsupported"}const A=1024*1024,qt={image:5*A,pdf:20*A,text:1*A,audio:20*A},Qi=25*A,ea=5;function ta(e,t){const n=zt(e);return n==="unsupported"?"unsupported":t>qt[n]?"too-large":null}function na(e){return e.access!=="read"&&e.effect!=="internal"}function Jt(e){return`${e.kind}:${e.id||e.url||e.title}`}function ra(e,t=[]){const n=new Set(t),r=[],i=[];for(const a of e){const o=Jt(a);n.has(o)||(n.add(o),r.push(a),i.push(o))}return{sources:r,keys:i}}const ia="assist-source",aa=["blocking","due","open"];function oa(e,t){const[n,r]=(e.subjectKey??"").split(":");return n===t&&r?r:void 0}const _e={blocking:0,due:1,open:2};function sa(e,t){return _e[e.band??"open"]-_e[t.band??"open"]||(t.priority??0)-(e.priority??0)||e.id.localeCompare(t.id)}function ca(e){return e.sessions.filter(t=>t.id!==e.exceptSessionId&&t.state==="connected"&&e.canHold(t.providerId))}function la(e){return e.sessions.filter(t=>t.id!==e.exceptSessionId&&t.state==="connected"&&!e.canHold(t.providerId))}function ua(e){return e.sessions.some(n=>n.id!==e.exceptSessionId&&(n.state==="connected"||n.state==="on_hold"))?{admit:!1,reason:"busy"}:{admit:!0}}function Zt(e,t){const n=new Set(e.disabledIntents??[]),r=e.intentOverrides??{},i=t.intents.filter(o=>!n.has(o.intent)).map(o=>pa(o,r[o.intent]));if(!e.extraIntents||e.extraIntents.length===0)return i;const a=new Set(i.map(o=>o.intent));for(const o of e.extraIntents)a.has(o.intent)||(i.push(o),a.add(o.intent));return i}function Qt(e,t){const n={};for(const r of e.intents){if(!r.togglable)continue;const i=t?.[r.intent];n[r.intent]=i??r.defaultEnabled??!0}return n}function da(e,t){const n=Qt(e,t);return Object.entries(n).filter(([,r])=>!r).map(([r])=>r)}function pa(e,t){return t?{intent:t.intent??e.intent,targetSchemes:t.targetSchemes??e.targetSchemes,transport:t.transport??e.transport}:e}function fa(e,t){const n=[];for(const r of e){if(!r.enabled)continue;const i=t[r.providerId];if(i)for(const a of Zt(r,i))n.push({channel:r,description:i,capability:a})}return n}function ma(e,t){return t.filter(n=>n.capability.intent===e)}function en(e,t){return t.filter(n=>n.capability.targetSchemes.includes(e))}function ga(e,t){return en(e.scheme,t)}function ha(e,t,n){const r=[];for(const i of e)for(const a of n)a.capability.intent===t&&a.capability.targetSchemes.includes(i.scheme)&&r.push({channelIntent:a,endpoint:i});return r}var tn=(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))(tn||{});const Aa={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 Ea(e){return e?Aa[e]??"note":"note"}const Sa="message_window",ya="message_templates",_a={FROM:"from",TO:"to",CC:"cc",BCC:"bcc",ORGANIZER:"organizer",PRESENTER:"presenter",ATTENDEE:"attendee",OWNER:"owner",MEMBER:"member",GUEST:"guest",HOST:"host",PARTICIPANT:"participant"},Ta=(e,t)=>({intent:e,...t}),Ia="folder_management",ba="remote_search",Ma={ok:!1,code:"UNSUPPORTED",message:"Provider does not support this op"},Oa="context.collect",Ra="installation-id";function Ca(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 wa="notification-source",Na=(e,t)=>`${e}.pref.${t}`,ka={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","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"]},se=9e4,nn=["out_of_office"],rn=e=>nn.includes(e);function va(e,t,n){const r=n-e<se,i=t?.status&&(!t.expiresAt||t.expiresAt>n)?t:void 0;if(!i?.status)return{online:r,status:r?"available":"offline"};const a=i.status;return!r&&!rn(a)?{online:!1,status:"offline"}:{online:r,status:a,message:i.message}}function La(e,t){const n=t-e.lastSeenAt<se,r=n||rn(e.status)?e.status:"offline";return n===e.online&&r===e.status?e:{...e,online:n,status:r}}function Da(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 Pa(e){return e.providerAvailable&&e.allowed}const xa="resources.describe",$a="resources.search",Ua="resources.resolve",Ka="resources.attached";function Ba(e){const t=e.indexOf(":");return t===-1?e:e.slice(0,t)}const ce="auth";function le(e){const t=typeof e=="string"?e.match(/apps\/([^/?#]+)/):null;return t?t[1]:null}function Ga(e){const t=le(e);return t?t!==ce:typeof e=="string"&&e.startsWith("/wake")}function Fa(e){return typeof e!="string"||e===""||e==="/"?!0:le(e)===ce}function Ha(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function an(e){const n=e.split("/").filter(Boolean).map(r=>r.startsWith(":")?r.endsWith("?")?"(?:/[^/]+)?":"/[^/]+":`/${Ha(r)}`).join("");return new RegExp(`^${n}\\/?$`)}function on(e,t){const n=e.split("/").filter(Boolean),r=t.split("/").filter(Boolean),i={};return n.forEach((a,o)=>{if(a.startsWith(":")){const s=a.endsWith("?")?a.slice(1,-1):a.slice(1),c=r[o];c&&(i[s]=c)}}),i}function sn(e){return e.publicBasePath??`/apps/${e.name}`}function Wa(e){const t=[];for(const n of e){if(!n?.name)continue;const r=sn(n);for(const i of n.routes??[]){if(!i.public)continue;const a=i.path==="/"?"":i.path;t.push({appName:n.name,resource:i.resource,pattern:`${r}${a}`,props:i.props})}}return t}function cn(e,t){const n=e.split("/").filter(Boolean),r=t.split("/").filter(Boolean);for(let i=0;i<Math.min(n.length,r.length);i++){const a=n[i].startsWith(":"),o=r[i].startsWith(":");if(a!==o)return o}return n.length>r.length}function ln(e,t){if(typeof e!="string")return null;let n=null;for(const r of t)an(r.pattern).test(e)&&(!n||cn(r.pattern,n.pattern))&&(n=r);return n?{...n,params:{...n.props,...on(n.pattern,e)}}:null}function ja(e,t){return ln(e,t)!==null}const Va="sync-source",Xa="sync-target",Ya=20,za={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]"]},un=e=>{let t=e;return Object.values(za).forEach(n=>{n.forEach(r=>{t=t.replaceAll(r,"")})}),t=t.replace(/\(.*?\)/g,""),t=t.replace(/\[.*?\]/g,""),t},dn=6e4,pn=8e3,fn=2,mn=.4,qa=3,Ja=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 gn(e){const t=new Set;for(const n of e.toLowerCase().split(/[^a-z0-9À-ɏ]+/))n.length<qa||Ja.has(n)||t.add(n);return[...t]}function hn(e,t){if(!e.length)return 0;if(!t.length)return 1;const n=new Set(t),r=new Set(e);let i=0;for(const a of r)n.has(a)||(i+=1);return i/r.size}function An(e,t=dn){const n=e.filter(o=>!o.partial&&typeof o.text=="string");if(!n.length)return{text:"",segmentCount:0};const i=n.reduce((o,s)=>Math.max(o,s.endedAt??0),0)-t;return{text:n.filter(o=>(o.endedAt??0)>=i).map(o=>un(o.text).trim()).filter(Boolean).join(" ").replace(/\s+/g," ").trim(),segmentCount:n.length}}const En=60;function Za(e,t,n=En){const r=new Set(e),i=[...e];for(const a of t)!a||r.has(a)||(r.add(a),i.push(a));return i.slice(-n)}function Qa(e){const{segments:t,now:n,state:r}=e;if(r.lastTriggerAt&&n-r.lastTriggerAt<pn)return{trigger:!1,reason:"too_soon"};const i=An(t,e.windowMs);if(!i.text)return{trigger:!1,reason:"no_speech"};const a=i.segmentCount-(r.lastSegmentCount??0);if(r.lastQueryTerms&&a<fn)return{trigger:!1,reason:"too_few_new"};const o=gn(i.text);return o.length?r.lastQueryTerms?.length&&hn(o,r.lastQueryTerms)<mn?{trigger:!1,reason:"same_topic"}:{trigger:!0,text:i.text,terms:o,segmentCount:i.segmentCount}:{trigger:!1,reason:"no_speech"}}const eo=["personal","workspace","connections","work","ai"],to="navNotice",L={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}},Sn="NL",no=15,ro=8,io=Array.from(new Set(Object.values(L).map(e=>e.callingCode))).sort((e,t)=>t.length-e.length);function Te(e){if(e)return L[e.trim().toUpperCase()]}function C(e,t){return e.length>=t.nsnMin&&e.length<=t.nsnMax}function Ie(e){if(e.length>no)return null;for(const t of io){if(!e.startsWith(t))continue;const n=e.slice(t.length);for(const r of Object.values(L)){if(r.callingCode!==t)continue;const i=r.trunkPrefix,a=i&&n.startsWith(i)?n.slice(i.length):n;if(C(a,r))return`+${t}${a}`}return null}return e.length<ro?null:`+${e}`}function ao(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 oo(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 q(e,t){if(!e)return null;const n=ao(e);if(!n)return null;const r=n.startsWith("+"),i=n.replace(/\D/g,"");if(!i)return null;if(r)return Ie(i);if(i.startsWith("00"))return Ie(i.slice(2));const a=Te(t)??Te(Sn);if(!a)return null;const o=a.trunkPrefix;if(o&&i.startsWith(o)){const s=i.slice(o.length);return C(s,a)?`+${a.callingCode}${s}`:null}if(i.startsWith(a.callingCode)){const s=i.slice(a.callingCode.length);if(C(s,a))return`+${a.callingCode}${s}`}return!o&&C(i,a)?`+${a.callingCode}${i}`:null}function so(e,t=9){const n=(e??"").replace(/\D/g,"");return n.length<t?null:n.slice(-t)}function ue(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],i=t.slice(n+1);return!r||!i.includes(".")?null:`${r}@${i}`}function co(e){const t=ue(e);return t?t.slice(t.lastIndexOf("@")+1):null}const lo=new Set(["co.uk","org.uk","gov.uk","ac.uk","com.au","co.nz","com.br","co.za"]);function yn(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 lo.has(n)&&t.length>=3?t.slice(-3).join("."):n}const _n=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 uo(e){const t=yn(e);return t?_n.has(t):!1}function po(e){if(!e)return!1;const t=e.trim().toLowerCase();return t==="tel"||t==="sms"||t==="whatsapp"||t==="fax"}function fo(e,t,n){if(!e||!t)return null;const r=e.trim().toLowerCase();if(r==="tel"||r==="sms"||r==="whatsapp"){const a=q(t,n);return a?`tel:${a}`:null}if(r==="fax"){const a=q(t,n);return a?`fax:${a}`:null}if(r==="mailto"||r==="email"){const a=ue(t);return a?`mailto:${a}`:null}const i=t.trim().toLowerCase();return i?`${r}:${i}`:null}const mo=[/<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],be=/^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i,go=/^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;function ho(e){const t=e.split(`
|
|
10
10
|
`);for(let n=0;n<t.length;n++)if(go.test(t[n])||be.test(t[n])&&t.slice(n+1,n+4).some(r=>be.test(r)))return t.slice(0,n).join(`
|
|
11
|
-
`).trim();return e}const Ao=/^(?:https?:|mailto:|tel:)/i,Eo=/^(?:https?:|cid:|data:image\/)/i;function U(e,t){const n=e.match(new RegExp(`\\b${t}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s">]+))`,"i"));return(n?.[1]??n?.[2]??n?.[3]??"").trim()}const So=/(!\[[^\]]*\]\([^)]*\))/;function Me(e){return e.replace(/\s+/g," ").trim().split(So).map((t,n)=>n%2===1?t:t.replace(/[[\]]/g,"\\$&")).join("")}function K(e){return e.replace(/[()\s<>"]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0")}`)}function yo(e){return e.replace(/<img\b([^>]*?)\/?>/gi,(n,r)=>{const i=U(r,"src");return Eo.test(i)?`})`:""}).replace(/<a\b([^>]*)>([\s\S]*?)<\/a\s*>/gi,(n,r,i)=>{const a=Me(i.replace(/<[^>]*>/g,"")),o=U(r,"href");return Ao.test(o)?`[${a||K(o)}](${K(o)})`:a})}
|
|
12
|
-
|
|
11
|
+
`).trim();return e}const Ao=/^(?:https?:|mailto:|tel:)/i,Eo=/^(?:https?:|cid:|data:image\/)/i;function U(e,t){const n=e.match(new RegExp(`\\b${t}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s">]+))`,"i"));return(n?.[1]??n?.[2]??n?.[3]??"").trim()}const So=/(!\[[^\]]*\]\([^)]*\))/;function Me(e){return e.replace(/\s+/g," ").trim().split(So).map((t,n)=>n%2===1?t:t.replace(/[[\]]/g,"\\$&")).join("")}function K(e){return e.replace(/[()\s<>"]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0")}`)}function yo(e){return e.replace(/<img\b([^>]*?)\/?>/gi,(n,r)=>{const i=U(r,"src");return Eo.test(i)?`})`:""}).replace(/<a\b([^>]*)>([\s\S]*?)<\/a\s*>/gi,(n,r,i)=>{const a=Me(i.replace(/<[^>]*>/g,"")),o=U(r,"href");return Ao.test(o)?`[${a||K(o)}](${K(o)})`:a})}const _o=/<table\b[^>]*>((?:(?!<table\b)[\s\S])*?)<\/table\s*>/i,To=/<tr\b[^>]*>([\s\S]*?)<\/tr\s*>/gi,Io=/<(t[dh])\b([^>]*)>([\s\S]*?)<\/\1\s*>/gi;function bo(e,t){return/<table\b/i.test(e)||e.includes(`
|
|
12
|
+
|
|
13
|
+
|`)||t.includes("![")||t.length>200}const Mo=40,Oo={left:"---",center:":---:",right:"---:"};function Ro(e){const t=e.match(/align\s*[=:]\s*["']?\s*(right|center)/i);return t?t[1].toLowerCase():"left"}function Co(e){return e.replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim().replace(/\|/g,"\\|")}function wo(e){const t=[];for(const o of e.matchAll(To)){const s=[];for(const c of o[1].matchAll(Io)){const l=Co(c[3]);if(bo(c[3],l))return null;s.push({text:l,align:Ro(c[2])})}if(s.length===0)return null;s.some(c=>c.text!=="")&&t.push(s)}const n=t[0]?.length??0;if(t.length<2||n<2||t.some(o=>o.length!==n))return null;const r=o=>`| ${o.map(s=>s.text).join(" | ")} |`,i=t[1].map(o=>Oo[o.align]).join(" | "),a=t.slice(1).map(r).join(`
|
|
14
|
+
`);return`
|
|
15
|
+
|
|
16
|
+
${r(t[0])}
|
|
17
|
+
| ${i} |
|
|
18
|
+
${a}
|
|
19
|
+
|
|
20
|
+
`}function No(e){return e.replace(/<\/(t[dh])\s*>/gi," ").replace(/<\/tr\s*>/gi,`
|
|
21
|
+
`).replace(/<(?:tbody|thead|tfoot|caption|colgroup|col|tr|t[dh])\b[^>]*>/gi,"").replace(/<\/(?:tbody|thead|tfoot|caption|colgroup)\s*>/gi,"")}function ko(e){let t=e;for(let n=0;n<Mo;n++){const r=_o.exec(t);if(!r||r.index===void 0)break;const a=wo(r[1])??`
|
|
22
|
+
|
|
23
|
+
${No(r[1])}
|
|
24
|
+
|
|
25
|
+
`;t=t.slice(0,r.index)+a+t.slice(r.index+r[0].length)}return t}function Oe(e,t){let n=e;return n=n.replace(/<(script|style)[\s\S]*?<\/\1>/gi,""),n=n.replace(/<!--[\s\S]*?-->/g,""),n=n.replace(/<br\s*\/?>/gi,`
|
|
26
|
+
`),t&&(n=ko(yo(n))),n=n.replace(/<\/(p|h[1-6]|ul|ol|table|blockquote)>/gi,`
|
|
13
27
|
|
|
14
28
|
`),n=n.replace(/<\/(div|li|tr)>/gi,`
|
|
15
|
-
`),n=n.replace(/<\/(td|th)>/gi," "),n=n.replace(/<[^>]+>/g,""),n=n.replace(/<[^>]*$/,""),n}function Re(e){return!Number.isInteger(e)||e<0||e>1114111?null:String.fromCodePoint(e)}function Ce(e){return e.replace(/ /gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/&#(\d+);/g,(t,n)=>Re(Number(n))??t).replace(/&#x([0-9a-f]+);/gi,(t,n)=>Re(parseInt(n,16))??t).replace(/&/gi,"&")}function we(e){return e.replace(/\r/g,"").replace(/[ \t]+/g," ").replace(/ *\n */g,`
|
|
29
|
+
`),n=n.replace(/<\/(td|th)>/gi," "),n=n.replace(/<[^>]+>/g,""),n=n.replace(/<[^>]*$/,""),n}function Re(e){return!Number.isInteger(e)||e<0||e>1114111?null:String.fromCodePoint(e)}const vo={euro:"€",pound:"£",yen:"¥",cent:"¢",copy:"©",reg:"®",trade:"™",deg:"°",plusmn:"±",times:"×",middot:"·",bull:"•",hellip:"…",mdash:"—",ndash:"–",lsquo:"‘",rsquo:"’",ldquo:"“",rdquo:"”",apos:"'"};function Ce(e){return e.replace(/ /gi," ").replace(/&([a-z]+);/gi,(t,n)=>vo[n.toLowerCase()]??t).replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/&#(\d+);/g,(t,n)=>Re(Number(n))??t).replace(/&#x([0-9a-f]+);/gi,(t,n)=>Re(parseInt(n,16))??t).replace(/&/gi,"&")}function we(e){return e.replace(/\r/g,"").replace(/[ \t]+/g," ").replace(/ *\n */g,`
|
|
16
30
|
`).replace(/\n{3,}/g,`
|
|
17
31
|
|
|
18
|
-
`).trim()}const Tn=/<\s*(html|body|div|p|table|br|span)\b/i;function
|
|
32
|
+
`).trim()}const Tn=/<\s*(html|body|div|p|table|br|span)\b/i;function Lo(e){return Tn.test(e)}function Do(e){return In(e,!1)}function Po(e){return In(e,!0)}function In(e,t){if(typeof e!="string"||!e)return"";let n=e.length;for(const o of mo){const s=e.search(o);s>=0&&s<n&&(n=s)}const r=e.slice(0,n);let i=we(Ce(Oe(r,t)));return i||(i=we(Ce(Oe(e,t)))),ho(i)||i}exports.ACTIVITY_CATALOG=m;exports.AI_ATTACHMENT_LIMITS=qt;exports.AI_ATTACHMENT_MAX_PER_TURN=ea;exports.AI_ATTACHMENT_TURN_BUDGET=Qi;exports.AI_VENDORS=Z;exports.ALLOWED_LINK_SCHEMES=We;exports.APP_PERMISSIONS=ka;exports.ARTIFACT_MAX_BLOCKS=F;exports.ARTIFACT_MAX_BODY_BYTES=ar;exports.ARTIFACT_MAX_CELL_LEN=O;exports.ARTIFACT_MAX_KPI_ITEMS=V;exports.ARTIFACT_MAX_LIST_ITEMS=H;exports.ARTIFACT_MAX_TABLE_COLUMNS=j;exports.ARTIFACT_MAX_TABLE_ROWS=W;exports.ARTIFACT_MAX_TEXT_LEN=Q;exports.ASSIGNMENT_SCOPE_KIND=Ye;exports.ASSIST_BANDS=aa;exports.ASSIST_SOURCE_PROVIDER_GROUP=ia;exports.ATTENTION_STATUSES=rt;exports.AUTH_APP_NAME=ce;exports.AUTO_READY_MIN_PROPOSALS=kt;exports.AUTO_READY_RATE=vt;exports.ActivityTypeRegistry=Pe;exports.BUILT_IN_ONLY=Fn;exports.BULK_PENALTY=it;exports.CADENCE_FLOOR_MS=pn;exports.CADENCE_MIN_NEW_SEGMENTS=fn;exports.CADENCE_MIN_NOVELTY=mn;exports.CADENCE_WINDOW_MS=dn;exports.CLASSIFY_VARS=gi;exports.CONTEXT_COLLECT_SERVICE=Oa;exports.CORE_DIMENSIONS=er;exports.CommunicationScheme=tn;exports.DAY_MS=Ze;exports.DEFAULT_MEMORY_BUDGET=ti;exports.DEFAULT_PHONE_REGION=Sn;exports.EMPTY_WORKFLOW=Ai;exports.FEATURE_FOLDER_MANAGEMENT=Ia;exports.FEATURE_REMOTE_SEARCH=ba;exports.FOLLOW_UP_HOURS=ot;exports.HOUR_MS=Je;exports.HTML_BODY_RE=Tn;exports.INELIGIBLE=g;exports.INSTALLATION_HEADER=Ra;exports.INTERACTION_KIND=Ot;exports.InteractionParticipantRole=_a;exports.KB_FALLBACK_LOCALE=At;exports.KB_LOCALES=X;exports.LOOSE_STATUSES=v;exports.MAX_ACTIONS=M;exports.MAX_ASSIGNMENT_TURNS=ze;exports.MAX_BLOCKS=B;exports.MAX_COLLECTION_DEPTH=ne;exports.MAX_FIELDS=I;exports.MAX_LIST_ITEMS=b;exports.MAX_MEMORY_BROWSE=Jr;exports.MAX_MEMORY_BUDGET=ei;exports.MAX_MEMORY_CHARS=Zr;exports.MAX_SHOWN_KEYS=En;exports.MAX_TOPIC_CANDIDATES=Ut;exports.MAX_TOPIC_EXAMPLES=$t;exports.MAX_TOPIC_EXAMPLE_CHARS=R;exports.MIN_MEMORY_BUDGET=Qr;exports.NAV_NOTICE_SLOT=to;exports.NOTIFICATION_SOURCE_PROVIDER_GROUP=wa;exports.ONBOARDING_SOURCE_PROVIDER_GROUP=ri;exports.PHONE_REGIONS=L;exports.PRESENCE_ONLINE_WINDOW_MS=se;exports.PRESENCE_SURVIVES_OFFLINE=nn;exports.PROFILE_TOOL_DISPOSITIONS=ai;exports.PROVIDER_FEATURE_MESSAGE_TEMPLATES=ya;exports.PROVIDER_FEATURE_MESSAGE_WINDOW=Sa;exports.PUBLIC_EMAIL_DOMAINS=_n;exports.READ_STEP_TYPES=Y;exports.RELATED_SUBJECT_KINDS=St;exports.RESERVED_STATUS_KEYS=oe;exports.RESOURCE_ATTACHED_SERVICE=Ka;exports.RESOURCE_DESCRIBE_SERVICE=xa;exports.RESOURCE_RESOLVE_SERVICE=Ua;exports.RESOURCE_SEARCH_SERVICE=$a;exports.SETTINGS_CATEGORIES=eo;exports.SIGNATURE_INTENTS=Mr;exports.SLA_HOURS_BY_PRIORITY=at;exports.STEP_MAX_TOKENS_MAX=wt;exports.STEP_MAX_TOKENS_MIN=Ct;exports.SUMMARY_MIN_LAST_CHARS=tt;exports.SUMMARY_MIN_MESSAGES=et;exports.SYNC_RUN_MAX_ERRORS=Ya;exports.SYNC_SOURCE_PROVIDER_GROUP=Va;exports.SYNC_TARGET_PROVIDER_GROUP=Xa;exports.TERMINAL_ASSIGNMENT_STATUSES=Xe;exports.TERMINAL_RUN_STATUSES=Lt;exports.TRIGGER_VARS=mi;exports.UNSUPPORTED=Ma;exports.USAGE_DIMENSIONS=Be;exports.USAGE_DIMENSION_IDS=Ge;exports.WORK_AREAS=ii;exports.WORK_COMMENT_ADDED=xi;exports.WORK_ITEM_ASSIGNED=$i;exports.WORK_ITEM_SCOPE_KIND=Ft;exports.WORK_ITEM_STATUS_CHANGED=Ui;exports.WORK_PROJECT_SCOPE_KIND=Ht;exports.W_PRIORITY=E;exports.acceptExampleCandidate=Li;exports.actingIdentityKey=_t;exports.activeWorkTypes=ki;exports.activityIconOf=wn;exports.activityJoinUrl=Un;exports.activitySnippet=Le;exports.activityTextParams=De;exports.activityTimelineText=$n;exports.activityTimestamp=xe;exports.activityTypeInfo=u;exports.actorKey=ci;exports.addExampleCandidate=vi;exports.agePresenceEntry=La;exports.aiAttachmentKind=zt;exports.aiAttachmentRejection=ta;exports.aiBudgetLimit=G;exports.aiBudgetPeriodKey=Zn;exports.aiBudgetPeriodStart=$e;exports.aiBudgetState=Jn;exports.aiVendorAcceptsAttachment=qn;exports.aiVendorDefaultModel=Xn;exports.aiVendorLabel=Vn;exports.aiVendorNeedsBaseUrl=zn;exports.aiVendorsWith=Yn;exports.appNameFromPath=le;exports.applyRounding=Oi;exports.applySignature=Or;exports.approvalRate=Nt;exports.artifactBodyBytes=fr;exports.artifactOutline=mr;exports.artifactToMarkdown=hr;exports.assignmentMismatch=pi;exports.assignmentScopeKey=_r;exports.assignmentSubject=Ir;exports.buildActivityPreview=Bn;exports.buildChannelIntents=fa;exports.buildShareKeys=Ar;exports.buildWindow=An;exports.canNestUnder=Wr;exports.carriesText=Ln;exports.categoryLabel=Vr;exports.categoryOf=Vt;exports.channelKindForScheme=Ea;exports.channelKindOf=Nn;exports.clampStepMaxTokens=hi;exports.cleanMessageMarkdown=Po;exports.cleanMessageText=Do;exports.compareAssistRank=sa;exports.compareWorkTypes=xt;exports.decideAssignmentState=br;exports.decideCadence=Qa;exports.decideIncomingCall=ua;exports.defaultLocaleOf=Et;exports.defaultStatusKey=Xi;exports.defineIntent=Ta;exports.depthOf=gt;exports.derivePresence=va;exports.disabledIntentsFromCapabilities=da;exports.elapsedSeconds=Mi;exports.emailDomain=co;exports.endpointKey=fo;exports.extractParams=on;exports.extractTerms=gn;exports.filterByEndpoint=ga;exports.filterByIntent=ma;exports.filterByTargetScheme=en;exports.findAiVendor=S;exports.flattenLocales=Ca;exports.floorToPeriod=Ke;exports.formatActingIdentity=yt;exports.formatClock=Ci;exports.formatHm=Ri;exports.formatItemKey=Gi;exports.formatPeriod=Ue;exports.freshSources=ra;exports.getActivitySeenUserIds=Hn;exports.getContactEndpoints=Rr;exports.getShortTitle=Kr;exports.getUrgencyScore=Ur;exports.heightOf=re;exports.helpCenterText=Gr;exports.humanizeAction=fi;exports.interactionIdOf=Rt;exports.isAgentUser=Pi;exports.isAssigned=xr;exports.isAssignmentTerminal=yr;exports.isAssignmentTrigger=bt;exports.isAutoReady=yi;exports.isAwaitingThem=ft;exports.isChatMessageActivity=jn;exports.isClosed=$r;exports.isConnectedType=Pn;exports.isDeepLink=Ga;exports.isDescendant=ht;exports.isEligible=Cr;exports.isEmailActivity=Wn;exports.isHtmlBody=Lo;exports.isInFlight=Ti;exports.isInteractionUnseen=nt;exports.isLandingPath=Fa;exports.isLikelyBulk=Qe;exports.isMessageShape=J;exports.isMessageType=kn;exports.isMoreSpecificPattern=cn;exports.isOutwardTool=na;exports.isParked=ct;exports.isPaused=Dt;exports.isPlaybookAuthoredType=Dn;exports.isPublicEmailDomain=uo;exports.isPublicPath=ja;exports.isReminderActive=lt;exports.isReplyableType=vn;exports.isSlaAtRisk=Dr;exports.isTerminal=_i;exports.isThreadLongEnough=vr;exports.isTranscriptType=xn;exports.isWorkClosed=Yi;exports.isWorkTypeVisible=Ni;exports.itemDossierKeys=Wi;exports.ladderFor=jt;exports.linkLabel=Br;exports.listeningAllowed=Qn;exports.localeInstruction=Hr;exports.localeName=Fr;exports.localesOf=jr;exports.looksLikeEmail=oo;exports.matchContactToIntents=ha;exports.matchPublicRoute=ln;exports.mcpCredentialScope=zr;exports.mcpToolPrefix=qr;exports.mergeShownKeys=Za;exports.messageCountsAs=ve;exports.needsPhoneRegion=po;exports.normalizeArtifactBlocks=pr;exports.normalizeBlocks=On;exports.normalizeEmail=ue;exports.normalizeExample=h;exports.notificationPrefKey=Na;exports.novelty=hn;exports.parkMarksById=wr;exports.parseActingIdentity=oi;exports.parseItemKey=Fi;exports.pathToRegex=an;exports.periodsInRange=rr;exports.phoneSuffix=so;exports.plainTextFromMarkdown=Ne;exports.playbookActor=It;exports.procedureOf=Si;exports.projectDossierKeys=ji;exports.publicBasePathFor=sn;exports.publicRoutePatterns=Wa;exports.readPath=w;exports.readStepError=z;exports.recencyOf=st;exports.refKey=Mt;exports.registrableDomain=yn;exports.rejectExampleCandidate=Bt;exports.relatedByDefault=ni;exports.resolveAccountCapabilities=Qt;exports.resolveActivityText=N;exports.resolveChannelIntents=Zt;exports.resolveSignature=qe;exports.resolveWorkMode=Da;exports.resourceKindOf=Ba;exports.runActor=si;exports.runInteractionId=bi;exports.sanitizeInline=Ve;exports.sanitizeTranscript=un;exports.scoreInteraction=Pr;exports.scoreWorkItem=Bi;exports.selectLenses=Yr;exports.sessionsHoldCannotReach=la;exports.sessionsToHold=ca;exports.shareKeyForTeam=te;exports.shareKeyForUser=ee;exports.shareKeysForViewer=Er;exports.shouldRunAudioPipeline=Pa;exports.slaHoursByInbox=Lr;exports.slaHoursFor=pt;exports.sortStatuses=Xt;exports.sourceKey=Jt;exports.statusIn=Vi;exports.stepsOf=Ei;exports.stripHtml=ke;exports.subjectKeyOf=Ii;exports.subjectOf=ie;exports.subjectRef=oa;exports.suggestProjectKey=Hi;exports.targetById=di;exports.targetForActivityType=ui;exports.toActingIdentity=Tt;exports.toE164=q;exports.toolSourceKinds=Sr;exports.topicOfferedForTeam=Gt;exports.topicsForTeam=Di;exports.truncateExample=Kt;exports.uniqueWorkStatusKey=zi;exports.uniqueWorkTypeKey=wi;exports.usageMetricId=Fe;exports.usageMetrics=ir;exports.validateStatuses=qi;exports.valueAtPath=li;exports.waitHoursOf=k;exports.wakesAssignment=Tr;exports.workItemScopeKey=Wt;exports.workProjectScopeKey=ae;exports.workStatusKey=Yt;exports.workTypeKey=Pt;
|