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