@opencxh/domain 1.146.0 → 1.147.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +8 -8
- package/dist/index.js +169 -165
- package/dist/platform/routing.d.ts +14 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=10,_=10,T=10,b=5,Je=new Set(["header","section","context","divider","image","list","actions","attachments"]);function O(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 Qe(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const a of e){if(n.length>=x){t("more than "+x+" blocks; the rest was dropped");break}if(!a||typeof a!="object")continue;const i=a;if(!Je.has(i.type)){t("unknown block type "+String(i.type));continue}switch(i.type){case"header":if(!O(i.text)){t("a header without text");continue}break;case"context":if(!O(i.text)){t("a context block without text");continue}break;case"image":if(!i.url||!i.alt){t("an image without url or alt");continue}break;case"section":Array.isArray(i.fields)&&i.fields.length>_&&(t("more than "+_+" fields in a section"),i.fields=i.fields.slice(0,_));break;case"list":if(!Array.isArray(i.items)||i.items.length===0){t("a list without items");continue}i.items.length>T&&(t("more than "+T+" list items"),i.items=i.items.slice(0,T));break;case"actions":{const r=Array.isArray(i.elements)?i.elements:[],o=r.filter(s=>s&&s.action_id&&s.invoke&&O(s.text));if(o.length!==r.length&&t("an action without action_id, invoke or text"),o.length===0)continue;o.length>b&&t("more than "+b+" actions"),i.elements=o.slice(0,b);break}}n.push(i)}return n}function le(e){return e.replace(/<style[\s\S]*?<\/style>/gi," ").replace(/<script[\s\S]*?<\/script>/gi," ").replace(/<[^>]+>/g," ").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/\s+/g," ").trim()}function E(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 W(e){return e?` — ${Math.floor(e/60)}m ${e%60}s`:""}function R(e){return e?.split("@")?.[0]||e||""}function y(e){return e.map(t=>t.name).join(", ")}function X(e){return e==="meeting"?"Meeting":e==="video"?"Video call":"Audio call"}const m={VOICE_CALL_STARTED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek gestart",timeline:e=>e.direction==="inbound"?`Inbound call started — ${R(e.payload.from)}`:`Outbound call started — ${R(e.payload.to)}`},VOICE_CALL_ANSWERED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek aangenomen",timeline:(e,t)=>`Call answered — ${t}`},VOICE_CALL_HOLD:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"In de wacht",timeline:(e,t)=>`Call on hold — ${t}`},VOICE_CALL_UNHOLD:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Hervat"},VOICE_CALL_ENDED:{shape:"event",channelKind:"voice",icon:"phone",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${E(e.payload.duration)})`:""}`,timeline:e=>`Call ended${W(e.payload.duration)}`},VOICE_CALL_MISSED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gemiste oproep",timeline:e=>`Missed call — ${R(e.payload.from)}`},VOICE_CALL_FAILED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek mislukt",timeline:()=>"Call failed"},VOICE_CALL_VOICEMAIL:{shape:"artifact",channelKind:"voice",icon:"phone",snippet:e=>e.payload.transcription?.trim()?e.payload.transcription:"Voicemail ontvangen"},VIDEO_CALL_STARTED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gesprek gestart",timeline:()=>"Video call started"},VIDEO_CALL_ANSWERED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gesprek aangenomen",timeline:()=>"Video call answered"},VIDEO_CALL_HOLD:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"In de wacht"},VIDEO_CALL_UNHOLD:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Hervat"},VIDEO_CALL_ENDED:{shape:"event",channelKind:"video",icon:"video",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${E(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:Y},EMAIL_SENT:{shape:"message",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:Y},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=>`${y(e.payload.members)} toegevoegd`,timeline:e=>{const t=y(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=>`${y(e.payload.members)} verlaten`,timeline:e=>{const t=y(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=>`${X(e.payload.callType)} started${e.payload.initiator?` by ${e.payload.initiator.name}`:""}`,joinUrl:e=>e.payload.joinUrl},CHAT_CALL_ENDED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${E(e.payload.duration)})`:""}`,timeline:e=>`${X(e.payload.callType)} ended${W(e.payload.duration)}`,joinUrl:e=>e.payload.joinUrl},CHAT_EVENT:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>e.payload.text??e.payload.eventType,timeline:e=>e.payload.text||e.payload.eventType},TRANSCRIPT_ADDED:{shape:"artifact",triggerable:!0,displayNameKey:"communication:activity.TRANSCRIPT_ADDED",component:"communication:TranscriptionActivity",icon:"captions",carriesText:!0,snippet:e=>(e.payload.segments??[]).map(t=>t.text).join(" ")},COMMENT_ADDED:{shape:"note",component:"communication:CommentActivity",icon:"sticky-note",carriesText:!0,snippet:e=>e.payload.text??""},FILE_UPLOADED:{shape:"artifact",component:"communication:FileActivity",icon:"paperclip",snippet:e=>`Bestand: ${e.payload.fileName}`},AI_MESSAGE_ADDED:{shape:"event",triggerable:!0,displayNameKey:"communication:activity.AI_MESSAGE_ADDED",icon:"circle",snippet:e=>e.payload.output?.text??e.payload.input?.text??"",timeline:()=>"AI message added"},AI_ACTION_PROPOSED:{shape:"event",component:"communication:ProposedActionCard",icon:"circle",playbookAuthored:!0,snippet:e=>`Voorstel wacht op goedkeuring (${e.payload.actions?.length??0} actie(s))`},PLAYBOOK_STARTED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:e=>`Playbook gestart${e.payload.playbookName?`: ${e.payload.playbookName}`:""}`,timeline:e=>`Playbook gestart${e.payload.playbookName?` — ${e.payload.playbookName}`:""}`},PLAYBOOK_COMPLETED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:()=>"Playbook afgerond",timeline:()=>"Playbook afgerond"},PLAYBOOK_ESCALATED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:()=>"Playbook geëscaleerd naar een mens",timeline:()=>"Playbook geëscaleerd naar een mens"},MEETING_SCHEDULED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering gepland: ${e.payload.title}`,timeline:()=>"Meeting scheduled",joinUrl:e=>e.payload.joinUrl},MEETING_STARTED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering gestart: ${e.payload.title}`,timeline:()=>"Meeting started",joinUrl:e=>e.payload.joinUrl},MEETING_ENDED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering beëindigd${e.payload.duration?` (${E(e.payload.duration)})`:""}`,timeline:()=>"Meeting ended"},MEETING_PARTICIPANT_JOINED:{shape:"event",icon:"calendar",snippet:e=>`${e.payload.name} deelgenomen`,timeline:(e,t)=>`${t} joined the meeting`},MEETING_PARTICIPANT_LEFT:{shape:"event",icon:"calendar",snippet:e=>`${e.payload.name} verlaten`,timeline:(e,t)=>`${t} left the meeting`},INTERACTION_CREATED:{shape:"event",icon:"circle",snippet:()=>"Interactie aangemaakt",timeline:(e,t)=>`Interaction started by ${t}`},INTERACTION_STATUS_CHANGED:{shape:"event",triggerable:!0,displayNameKey:"communication:activity.INTERACTION_STATUS_CHANGED",icon:"circle-dot",snippet:e=>`Status: ${e.payload.fromStatus} → ${e.payload.toStatus}`,timeline:(e,t)=>`Status changed to ${e.payload.toStatus} by ${t}`},INTERACTION_ASSIGNED:{shape:"event",icon:"user",snippet:()=>"Interactie toegewezen",timeline:(e,t)=>`Assigned by ${t}`}};function Y(e){const t=e.payload,n=t.bodySnippet?.trim()||le(t.body??"");return t.subject?`${t.subject} — ${n}`:n}function p(e){return m[e]}function Ze(e){return p(e)?.icon??"circle"}function et(e){return p(e)?.channelKind}function tt(e){const t=p(e)?.shape;return t==="message"||t==="note"}function nt(e){return p(e)?.replyable===!0}function it(e){return p(e)?.carriesText===!0}function at(e){return p(e)?.countsAs}function rt(e){return p(e)?.playbookAuthored===!0}function ce(e){const t=p(e.type)?.snippet;return t?t(e):""}function ot(e,t){const n=p(e.type)?.timeline;return n?n(e,t):e.type.replace(/_/g," ").toLowerCase()}function st(e){const t=p(e.type)?.joinUrl;return t?t(e):void 0}function M(e,t){let n=e;for(const a of t.split(".")){if(n==null||typeof n!="object")return"";n=n[a]}return n==null?"":typeof n=="string"?n:typeof n=="number"||typeof n=="boolean"?String(n):""}function N(e,t,n){if(e===void 0)return null;if(typeof e=="string")return e||null;if("value"in e)return M(t,e.value)||null;const a={};for(const[r,o]of Object.entries(e.params??{}))a[r]=M(t,o);const i=n(e.key,a);return i===e.key?null:i}function ue(e,t){if(!e||typeof e=="string"||"value"in e)return null;const n={};for(const[a,i]of Object.entries(e.params??{}))n[a]=M(t,i);return{key:e.key,params:n}}const lt=e=>e;function z(e){const t=m[e];return{type:e,shape:t.shape,channelKind:t.channelKind,icon:t.icon,replyable:t.replyable===!0,countsAs:t.countsAs,carriesText:t.carriesText===!0,triggerable:t.triggerable===!0,component:t.component,builtIn:!0,displayNameKey:t.displayNameKey}}function q(e){return{type:e.type,shape:e.shape,channelKind:e.channelKind,icon:e.icon||"circle",replyable:e.replyable===!0,countsAs:e.countsAs,carriesText:e.carriesText===!0,triggerable:e.triggerable===!0,component:e.component,builtIn:!1,displayNameKey:e.displayNameKey}}class pe{constructor(t=[],n=lt){this.translate=n;for(const a of t)a?.type&&(a.type in m||this.declared.has(a.type)||this.declared.set(a.type,a))}declared=new Map;get(t){if(t in m)return z(t);const n=this.declared.get(t);return n?q(n):void 0}triggerable(){const t=Object.keys(m).filter(a=>m[a].triggerable).map(z),n=[...this.declared.values()].map(q).filter(a=>a.triggerable);return[...t,...n]}timelineText(t,n){const a=m[t.type];if(a?.timeline)return a.timeline(t,n);const i=this.declared.get(t.type);return N(i?.text,t,this.translate)??t.type.replace(/_/g," ").toLowerCase()}snippet(t){const n=m[t.type];if(n?.snippet)return n.snippet(t);const a=this.declared.get(t.type);return N(a?.text,t,this.translate)??""}descriptor(t){return this.declared.get(t)}blocks(t){const n=this.declared.get(t)?.render;return n?.length?n:void 0}get translator(){return this.translate}}const ct=new pe,J=140;function ut(e){const t=e.trim();return t.length<=J?t:t.slice(0,J-1).trimEnd()+"…"}function pt(e,t){const n=ue(t?.text,e),a=t?N(t.text,e,i=>i):null;return{activityId:e.id,type:e.type,snippet:ut(a??ce(e)),authorName:e.author?.name??"",direction:e.direction,createdAt:e.createdAt??Date.now(),...n?{snippetKey:n.key,snippetParams:n.params}:{}}}function dt(e,t,n=[]){const a=e.createdAt;if(!a)return[];const i=new Set(n);return e.author.type==="user"&&e.author.id&&i.add(e.author.id),Object.entries(t).filter(([r,o])=>o>=a&&!i.has(r)).map(([r])=>r)}function ft(e){return e.createdAt??0}const mt=[{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 gt(e){const t=[];for(const n of Object.keys(e))for(const a of Object.keys(e[n]))t.push({lang:n,key:a,value:e[n][a]});return t}function v(e){return e<10?`0${e}`:`${e}`}function de(e,t){const n=new Date(e),a=`${n.getUTCFullYear()}-${v(n.getUTCMonth()+1)}-${v(n.getUTCDate())}`;return t==="day"?a:`${a}T${v(n.getUTCHours())}`}function fe(e,t){const n=new Date(e);return n.setUTCMinutes(0,0,0),t==="day"&&n.setUTCHours(0),n.getTime()}const ht=36e5,At=864e5;function Et(e,t,n){const a=n==="hour"?ht:At,i=[];for(let r=fe(e,n);r<=t;r+=a)i.push(de(r,n));return i}const me=[{id:"resource",label:"Resource",labelSource:"raw"},{id:"origin",label:"Herkomst",labelSource:"raw"}],ge=me.map(e=>e.id);function he(e,t){return`${e}.usage.${t}`}function yt(e,t){return t.map(n=>({id:he(e,n.unit),label:n.label,category:"Verbruik",valueType:n.valueType??"count",aggregation:"sum",supportedDimensions:["provider",...ge,...n.extraDimensions??[],"time"]}))}const Ae=new Set(["info","success","warning","destructive"]),k=200,D=100,$=200,U=12,P=4,K=4e3,I=500,_t=256*1024,Tt=new Set(["heading","paragraph","list","quote","code","divider","table","kpi","callout"]),Ee=["http:","https:","mailto:","tel:"],bt=/^[a-z][a-z0-9+.-]*:/i;function ye(e){const t=e.trim().replace(/^<|>$/g,"");if(!t)return!1;const n=bt.exec(t)?.[0];return n?Ee.includes(n.toLowerCase()):!t.startsWith("//")}const It=/^[ \t]{0,3}\[([^\]]+)\]:[ \t]*(\S+).*$/gm;function St(e){let t="",n=0;for(;n<e.length;){const a=e[n]==="!"&&e[n+1]==="[";if(e[n]!=="["&&!a){t+=e[n],n+=1;continue}const i=n+(a?2:1),r=Q(e,i,"[","]");if(r<0||e[r+1]!=="("){t+=e[n],n+=1;continue}const o=Q(e,r+2,"(",")");if(o<0){t+=e[n],n+=1;continue}const s=e.slice(i,r),l=e.slice(r+2,o).trim().split(/\s+/)[0]??"";t+=a||!ye(l)?s:e.slice(n,o+1),n=o+1}return t}function Q(e,t,n,a){let i=1;for(let r=t;r<e.length;r+=1){if(e[r]==="\\"){r+=1;continue}if(e[r]===n)i+=1;else if(e[r]===a&&(i-=1,i===0))return r}return-1}function _e(e){return St(e).replace(It,(t,n,a)=>ye(a)?t:"")}function u(e,t=K){return typeof e=="string"?_e(e).slice(0,t):""}function Mt(e,t=K){return typeof e=="string"?e.slice(0,t):""}function Nt(e,t="info"){return typeof e=="string"&&Ae.has(e)?e:t}function Ct(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const a of e){if(n.length>=k){t("more than "+k+" blocks; the rest was dropped");break}if(!a||typeof a!="object")continue;const i=a;if(!Tt.has(i.type)){t("unknown block type "+String(i.type));continue}const r=typeof i.block_id=="string"?{block_id:i.block_id}:{};switch(i.type){case"heading":{const o=u(i.text);if(!o){t("a heading without text");continue}const s=i.level===2||i.level===3?i.level:1;n.push({...r,type:"heading",level:s,text:o});break}case"paragraph":{const o=u(i.text);if(!o){t("a paragraph without text");continue}n.push({...r,type:"paragraph",text:o});break}case"quote":{const o=u(i.text);if(!o){t("a quote without text");continue}n.push({...r,type:"quote",text:o});break}case"code":{const o=Mt(i.text);if(!o){t("a code block without text");continue}const s=typeof i.lang=="string"?{lang:i.lang.slice(0,32)}:{};n.push({...r,type:"code",...s,text:o});break}case"divider":n.push({...r,type:"divider"});break;case"list":{const o=Array.isArray(i.items)?i.items:[],s=[];for(const d of o){if(s.length>=D){t("more than "+D+" list items");break}const f=u(d?.text);if(!f)continue;const c=u(d?.lead,200);s.push(c?{lead:c,text:f}:{text:f})}if(s.length===0){t("a list without usable items");continue}const l=i.style==="numbered"?"numbered":"bulleted";n.push({...r,type:"list",style:l,items:s});break}case"table":{const o=Array.isArray(i.columns)?i.columns:[],s=[];for(const c of o){if(s.length>=U){t("more than "+U+" table columns");break}const A=u(c?.label,I),L=c?.align==="right"?"right":void 0;s.push(L?{label:A,align:L}:{label:A})}if(s.length===0){t("a table without columns");continue}const l=Array.isArray(i.rows)?i.rows:[],d=[];for(const c of l){if(d.length>=$){t("more than "+$+" table rows");break}const A=Array.isArray(c)?c:[];d.push(s.map((L,qe)=>u(A[qe],I)))}const f=u(i.caption,I);n.push({...r,type:"table",columns:s,rows:d,...f?{caption:f}:{}});break}case"kpi":{const o=Array.isArray(i.items)?i.items:[],s=[];for(const l of o){if(s.length>=P){t("more than "+P+" kpi items");break}const d=u(l?.value,40),f=u(l?.label,80);if(!d||!f)continue;const c=l?.tone;s.push(typeof c=="string"&&Ae.has(c)?{value:d,label:f,tone:c}:{value:d,label:f})}if(s.length===0){t("a kpi block without usable items");continue}n.push({...r,type:"kpi",items:s});break}case"callout":{const o=u(i.text);if(!o){t("a callout without text");continue}const s=u(i.title,200);n.push({...r,type:"callout",tone:Nt(i.tone),...s?{title:s}:{},text:o});break}}}return n}function Lt(e){return JSON.stringify(e).length}function Ot(e){return{blocks:e.length,types:e.map(t=>t.type),headings:e.flatMap(t=>t.type==="heading"?[t.text]:[])}}function Z(e){return e.replace(/\|/g,"\\|").replace(/\r?\n/g," ").trim()}function ee(e,t,n){const a=e.map((i,r)=>n?.[r]==="right"?"---:":"---");return[`| ${e.map(Z).join(" | ")} |`,`| ${a.join(" | ")} |`,...t.map(i=>`| ${i.map(Z).join(" | ")} |`)]}function Rt(e){switch(e.type){case"heading":return[`${"#".repeat(e.level)} ${e.text}`];case"paragraph":return[e.text];case"quote":return e.text.split(/\r?\n/).map(t=>`> ${t}`);case"code":return[`\`\`\`${e.lang??""}`,e.text,"```"];case"divider":return["---"];case"list":return e.items.map((t,n)=>{const a=e.style==="numbered"?`${n+1}.`:"-";return t.lead?`${a} **${t.lead}** ${t.text}`:`${a} ${t.text}`});case"table":{const t=ee(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 ee(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 vt(e,t){const n=[],a=e.some(i=>i.type==="heading"&&i.level===1);t&&!a&&n.push(`# ${t}`);for(const i of e){const r=Rt(i);r.length>0&&n.push(r.join(`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=10,_=10,T=10,b=5,Je=new Set(["header","section","context","divider","image","list","actions","attachments"]);function O(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 Qe(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const a of e){if(n.length>=x){t("more than "+x+" blocks; the rest was dropped");break}if(!a||typeof a!="object")continue;const i=a;if(!Je.has(i.type)){t("unknown block type "+String(i.type));continue}switch(i.type){case"header":if(!O(i.text)){t("a header without text");continue}break;case"context":if(!O(i.text)){t("a context block without text");continue}break;case"image":if(!i.url||!i.alt){t("an image without url or alt");continue}break;case"section":Array.isArray(i.fields)&&i.fields.length>_&&(t("more than "+_+" fields in a section"),i.fields=i.fields.slice(0,_));break;case"list":if(!Array.isArray(i.items)||i.items.length===0){t("a list without items");continue}i.items.length>T&&(t("more than "+T+" list items"),i.items=i.items.slice(0,T));break;case"actions":{const r=Array.isArray(i.elements)?i.elements:[],o=r.filter(s=>s&&s.action_id&&s.invoke&&O(s.text));if(o.length!==r.length&&t("an action without action_id, invoke or text"),o.length===0)continue;o.length>b&&t("more than "+b+" actions"),i.elements=o.slice(0,b);break}}n.push(i)}return n}function ue(e){return e.replace(/<style[\s\S]*?<\/style>/gi," ").replace(/<script[\s\S]*?<\/script>/gi," ").replace(/<[^>]+>/g," ").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/\s+/g," ").trim()}function E(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 Y(e){return e?` — ${Math.floor(e/60)}m ${e%60}s`:""}function R(e){return e?.split("@")?.[0]||e||""}function y(e){return e.map(t=>t.name).join(", ")}function z(e){return e==="meeting"?"Meeting":e==="video"?"Video call":"Audio call"}const m={VOICE_CALL_STARTED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek gestart",timeline:e=>e.direction==="inbound"?`Inbound call started — ${R(e.payload.from)}`:`Outbound call started — ${R(e.payload.to)}`},VOICE_CALL_ANSWERED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek aangenomen",timeline:(e,t)=>`Call answered — ${t}`},VOICE_CALL_HOLD:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"In de wacht",timeline:(e,t)=>`Call on hold — ${t}`},VOICE_CALL_UNHOLD:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Hervat"},VOICE_CALL_ENDED:{shape:"event",channelKind:"voice",icon:"phone",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${E(e.payload.duration)})`:""}`,timeline:e=>`Call ended${Y(e.payload.duration)}`},VOICE_CALL_MISSED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gemiste oproep",timeline:e=>`Missed call — ${R(e.payload.from)}`},VOICE_CALL_FAILED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek mislukt",timeline:()=>"Call failed"},VOICE_CALL_VOICEMAIL:{shape:"artifact",channelKind:"voice",icon:"phone",snippet:e=>e.payload.transcription?.trim()?e.payload.transcription:"Voicemail ontvangen"},VIDEO_CALL_STARTED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gesprek gestart",timeline:()=>"Video call started"},VIDEO_CALL_ANSWERED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gesprek aangenomen",timeline:()=>"Video call answered"},VIDEO_CALL_HOLD:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"In de wacht"},VIDEO_CALL_UNHOLD:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Hervat"},VIDEO_CALL_ENDED:{shape:"event",channelKind:"video",icon:"video",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${E(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:q},EMAIL_SENT:{shape:"message",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:q},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=>`${y(e.payload.members)} toegevoegd`,timeline:e=>{const t=y(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=>`${y(e.payload.members)} verlaten`,timeline:e=>{const t=y(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=>`${z(e.payload.callType)} started${e.payload.initiator?` by ${e.payload.initiator.name}`:""}`,joinUrl:e=>e.payload.joinUrl},CHAT_CALL_ENDED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${E(e.payload.duration)})`:""}`,timeline:e=>`${z(e.payload.callType)} ended${Y(e.payload.duration)}`,joinUrl:e=>e.payload.joinUrl},CHAT_EVENT:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>e.payload.text??e.payload.eventType,timeline:e=>e.payload.text||e.payload.eventType},TRANSCRIPT_ADDED:{shape:"artifact",triggerable:!0,displayNameKey:"communication:activity.TRANSCRIPT_ADDED",component:"communication:TranscriptionActivity",icon:"captions",carriesText:!0,snippet:e=>(e.payload.segments??[]).map(t=>t.text).join(" ")},COMMENT_ADDED:{shape:"note",component:"communication:CommentActivity",icon:"sticky-note",carriesText:!0,snippet:e=>e.payload.text??""},FILE_UPLOADED:{shape:"artifact",component:"communication:FileActivity",icon:"paperclip",snippet:e=>`Bestand: ${e.payload.fileName}`},AI_MESSAGE_ADDED:{shape:"event",triggerable:!0,displayNameKey:"communication:activity.AI_MESSAGE_ADDED",icon:"circle",snippet:e=>e.payload.output?.text??e.payload.input?.text??"",timeline:()=>"AI message added"},AI_ACTION_PROPOSED:{shape:"event",component:"communication:ProposedActionCard",icon:"circle",playbookAuthored:!0,snippet:e=>`Voorstel wacht op goedkeuring (${e.payload.actions?.length??0} actie(s))`},PLAYBOOK_STARTED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:e=>`Playbook gestart${e.payload.playbookName?`: ${e.payload.playbookName}`:""}`,timeline:e=>`Playbook gestart${e.payload.playbookName?` — ${e.payload.playbookName}`:""}`},PLAYBOOK_COMPLETED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:()=>"Playbook afgerond",timeline:()=>"Playbook afgerond"},PLAYBOOK_ESCALATED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:()=>"Playbook geëscaleerd naar een mens",timeline:()=>"Playbook geëscaleerd naar een mens"},MEETING_SCHEDULED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering gepland: ${e.payload.title}`,timeline:()=>"Meeting scheduled",joinUrl:e=>e.payload.joinUrl},MEETING_STARTED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering gestart: ${e.payload.title}`,timeline:()=>"Meeting started",joinUrl:e=>e.payload.joinUrl},MEETING_ENDED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering beëindigd${e.payload.duration?` (${E(e.payload.duration)})`:""}`,timeline:()=>"Meeting ended"},MEETING_PARTICIPANT_JOINED:{shape:"event",icon:"calendar",snippet:e=>`${e.payload.name} deelgenomen`,timeline:(e,t)=>`${t} joined the meeting`},MEETING_PARTICIPANT_LEFT:{shape:"event",icon:"calendar",snippet:e=>`${e.payload.name} verlaten`,timeline:(e,t)=>`${t} left the meeting`},INTERACTION_CREATED:{shape:"event",icon:"circle",snippet:()=>"Interactie aangemaakt",timeline:(e,t)=>`Interaction started by ${t}`},INTERACTION_STATUS_CHANGED:{shape:"event",triggerable:!0,displayNameKey:"communication:activity.INTERACTION_STATUS_CHANGED",icon:"circle-dot",snippet:e=>`Status: ${e.payload.fromStatus} → ${e.payload.toStatus}`,timeline:(e,t)=>`Status changed to ${e.payload.toStatus} by ${t}`},INTERACTION_ASSIGNED:{shape:"event",icon:"user",snippet:()=>"Interactie toegewezen",timeline:(e,t)=>`Assigned by ${t}`}};function q(e){const t=e.payload,n=t.bodySnippet?.trim()||ue(t.body??"");return t.subject?`${t.subject} — ${n}`:n}function p(e){return m[e]}function Ze(e){return p(e)?.icon??"circle"}function et(e){return p(e)?.channelKind}function tt(e){const t=p(e)?.shape;return t==="message"||t==="note"}function nt(e){return p(e)?.replyable===!0}function it(e){return p(e)?.carriesText===!0}function at(e){return p(e)?.countsAs}function rt(e){return p(e)?.playbookAuthored===!0}function pe(e){const t=p(e.type)?.snippet;return t?t(e):""}function ot(e,t){const n=p(e.type)?.timeline;return n?n(e,t):e.type.replace(/_/g," ").toLowerCase()}function st(e){const t=p(e.type)?.joinUrl;return t?t(e):void 0}function M(e,t){let n=e;for(const a of t.split(".")){if(n==null||typeof n!="object")return"";n=n[a]}return n==null?"":typeof n=="string"?n:typeof n=="number"||typeof n=="boolean"?String(n):""}function N(e,t,n){if(e===void 0)return null;if(typeof e=="string")return e||null;if("value"in e)return M(t,e.value)||null;const a={};for(const[r,o]of Object.entries(e.params??{}))a[r]=M(t,o);const i=n(e.key,a);return i===e.key?null:i}function de(e,t){if(!e||typeof e=="string"||"value"in e)return null;const n={};for(const[a,i]of Object.entries(e.params??{}))n[a]=M(t,i);return{key:e.key,params:n}}const lt=e=>e;function J(e){const t=m[e];return{type:e,shape:t.shape,channelKind:t.channelKind,icon:t.icon,replyable:t.replyable===!0,countsAs:t.countsAs,carriesText:t.carriesText===!0,triggerable:t.triggerable===!0,component:t.component,builtIn:!0,displayNameKey:t.displayNameKey}}function Q(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 fe{constructor(t=[],n=lt){this.translate=n;for(const a of t)a?.type&&(a.type in m||this.declared.has(a.type)||this.declared.set(a.type,a))}declared=new Map;get(t){if(t in m)return J(t);const n=this.declared.get(t);return n?Q(n):void 0}triggerable(){const t=Object.keys(m).filter(a=>m[a].triggerable).map(J),n=[...this.declared.values()].map(Q).filter(a=>a.triggerable);return[...t,...n]}timelineText(t,n){const a=m[t.type];if(a?.timeline)return a.timeline(t,n);const i=this.declared.get(t.type);return N(i?.text,t,this.translate)??t.type.replace(/_/g," ").toLowerCase()}snippet(t){const n=m[t.type];if(n?.snippet)return n.snippet(t);const a=this.declared.get(t.type);return N(a?.text,t,this.translate)??""}descriptor(t){return this.declared.get(t)}blocks(t){const n=this.declared.get(t)?.render;return n?.length?n:void 0}get translator(){return this.translate}}const ct=new fe,Z=140;function ut(e){const t=e.trim();return t.length<=Z?t:t.slice(0,Z-1).trimEnd()+"…"}function pt(e,t){const n=de(t?.text,e),a=t?N(t.text,e,i=>i):null;return{activityId:e.id,type:e.type,snippet:ut(a??pe(e)),authorName:e.author?.name??"",direction:e.direction,createdAt:e.createdAt??Date.now(),...n?{snippetKey:n.key,snippetParams:n.params}:{}}}function dt(e,t,n=[]){const a=e.createdAt;if(!a)return[];const i=new Set(n);return e.author.type==="user"&&e.author.id&&i.add(e.author.id),Object.entries(t).filter(([r,o])=>o>=a&&!i.has(r)).map(([r])=>r)}function ft(e){return e.createdAt??0}const mt=[{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 gt(e){const t=[];for(const n of Object.keys(e))for(const a of Object.keys(e[n]))t.push({lang:n,key:a,value:e[n][a]});return t}function v(e){return e<10?`0${e}`:`${e}`}function me(e,t){const n=new Date(e),a=`${n.getUTCFullYear()}-${v(n.getUTCMonth()+1)}-${v(n.getUTCDate())}`;return t==="day"?a:`${a}T${v(n.getUTCHours())}`}function ge(e,t){const n=new Date(e);return n.setUTCMinutes(0,0,0),t==="day"&&n.setUTCHours(0),n.getTime()}const ht=36e5,At=864e5;function Et(e,t,n){const a=n==="hour"?ht:At,i=[];for(let r=ge(e,n);r<=t;r+=a)i.push(me(r,n));return i}const he=[{id:"resource",label:"Resource",labelSource:"raw"},{id:"origin",label:"Herkomst",labelSource:"raw"}],Ae=he.map(e=>e.id);function Ee(e,t){return`${e}.usage.${t}`}function yt(e,t){return t.map(n=>({id:Ee(e,n.unit),label:n.label,category:"Verbruik",valueType:n.valueType??"count",aggregation:"sum",supportedDimensions:["provider",...Ae,...n.extraDimensions??[],"time"]}))}const ye=new Set(["info","success","warning","destructive"]),k=200,D=100,$=200,P=12,U=4,K=4e3,I=500,_t=256*1024,Tt=new Set(["heading","paragraph","list","quote","code","divider","table","kpi","callout"]),_e=["http:","https:","mailto:","tel:"],bt=/^[a-z][a-z0-9+.-]*:/i;function Te(e){const t=e.trim().replace(/^<|>$/g,"");if(!t)return!1;const n=bt.exec(t)?.[0];return n?_e.includes(n.toLowerCase()):!t.startsWith("//")}const It=/^[ \t]{0,3}\[([^\]]+)\]:[ \t]*(\S+).*$/gm;function St(e){let t="",n=0;for(;n<e.length;){const a=e[n]==="!"&&e[n+1]==="[";if(e[n]!=="["&&!a){t+=e[n],n+=1;continue}const i=n+(a?2:1),r=ee(e,i,"[","]");if(r<0||e[r+1]!=="("){t+=e[n],n+=1;continue}const o=ee(e,r+2,"(",")");if(o<0){t+=e[n],n+=1;continue}const s=e.slice(i,r),l=e.slice(r+2,o).trim().split(/\s+/)[0]??"";t+=a||!Te(l)?s:e.slice(n,o+1),n=o+1}return t}function ee(e,t,n,a){let i=1;for(let r=t;r<e.length;r+=1){if(e[r]==="\\"){r+=1;continue}if(e[r]===n)i+=1;else if(e[r]===a&&(i-=1,i===0))return r}return-1}function be(e){return St(e).replace(It,(t,n,a)=>Te(a)?t:"")}function u(e,t=K){return typeof e=="string"?be(e).slice(0,t):""}function Mt(e,t=K){return typeof e=="string"?e.slice(0,t):""}function Nt(e,t="info"){return typeof e=="string"&&ye.has(e)?e:t}function Ct(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const a of e){if(n.length>=k){t("more than "+k+" blocks; the rest was dropped");break}if(!a||typeof a!="object")continue;const i=a;if(!Tt.has(i.type)){t("unknown block type "+String(i.type));continue}const r=typeof i.block_id=="string"?{block_id:i.block_id}:{};switch(i.type){case"heading":{const o=u(i.text);if(!o){t("a heading without text");continue}const s=i.level===2||i.level===3?i.level:1;n.push({...r,type:"heading",level:s,text:o});break}case"paragraph":{const o=u(i.text);if(!o){t("a paragraph without text");continue}n.push({...r,type:"paragraph",text:o});break}case"quote":{const o=u(i.text);if(!o){t("a quote without text");continue}n.push({...r,type:"quote",text:o});break}case"code":{const o=Mt(i.text);if(!o){t("a code block without text");continue}const s=typeof i.lang=="string"?{lang:i.lang.slice(0,32)}:{};n.push({...r,type:"code",...s,text:o});break}case"divider":n.push({...r,type:"divider"});break;case"list":{const o=Array.isArray(i.items)?i.items:[],s=[];for(const d of o){if(s.length>=D){t("more than "+D+" list items");break}const f=u(d?.text);if(!f)continue;const c=u(d?.lead,200);s.push(c?{lead:c,text:f}:{text:f})}if(s.length===0){t("a list without usable items");continue}const l=i.style==="numbered"?"numbered":"bulleted";n.push({...r,type:"list",style:l,items:s});break}case"table":{const o=Array.isArray(i.columns)?i.columns:[],s=[];for(const c of o){if(s.length>=P){t("more than "+P+" table columns");break}const A=u(c?.label,I),L=c?.align==="right"?"right":void 0;s.push(L?{label:A,align:L}:{label:A})}if(s.length===0){t("a table without columns");continue}const l=Array.isArray(i.rows)?i.rows:[],d=[];for(const c of l){if(d.length>=$){t("more than "+$+" table rows");break}const A=Array.isArray(c)?c:[];d.push(s.map((L,qe)=>u(A[qe],I)))}const f=u(i.caption,I);n.push({...r,type:"table",columns:s,rows:d,...f?{caption:f}:{}});break}case"kpi":{const o=Array.isArray(i.items)?i.items:[],s=[];for(const l of o){if(s.length>=U){t("more than "+U+" kpi items");break}const d=u(l?.value,40),f=u(l?.label,80);if(!d||!f)continue;const c=l?.tone;s.push(typeof c=="string"&&ye.has(c)?{value:d,label:f,tone:c}:{value:d,label:f})}if(s.length===0){t("a kpi block without usable items");continue}n.push({...r,type:"kpi",items:s});break}case"callout":{const o=u(i.text);if(!o){t("a callout without text");continue}const s=u(i.title,200);n.push({...r,type:"callout",tone:Nt(i.tone),...s?{title:s}:{},text:o});break}}}return n}function Lt(e){return JSON.stringify(e).length}function Ot(e){return{blocks:e.length,types:e.map(t=>t.type),headings:e.flatMap(t=>t.type==="heading"?[t.text]:[])}}function te(e){return e.replace(/\|/g,"\\|").replace(/\r?\n/g," ").trim()}function ne(e,t,n){const a=e.map((i,r)=>n?.[r]==="right"?"---:":"---");return[`| ${e.map(te).join(" | ")} |`,`| ${a.join(" | ")} |`,...t.map(i=>`| ${i.map(te).join(" | ")} |`)]}function Rt(e){switch(e.type){case"heading":return[`${"#".repeat(e.level)} ${e.text}`];case"paragraph":return[e.text];case"quote":return e.text.split(/\r?\n/).map(t=>`> ${t}`);case"code":return[`\`\`\`${e.lang??""}`,e.text,"```"];case"divider":return["---"];case"list":return e.items.map((t,n)=>{const a=e.style==="numbered"?`${n+1}.`:"-";return t.lead?`${a} **${t.lead}** ${t.text}`:`${a} ${t.text}`});case"table":{const t=ne(e.columns.map(n=>n.label),e.rows,e.columns.map(n=>n.align??"left"));return e.caption?[...t,"",`*${e.caption}*`]:t}case"kpi":return ne(e.items.map(t=>t.value),[e.items.map(t=>t.label)]);case"callout":return(e.title?`**${e.title}** ${e.text}`:e.text).split(/\r?\n/).map(n=>`> ${n}`)}}function vt(e,t){const n=[],a=e.some(i=>i.type==="heading"&&i.level===1);t&&!a&&n.push(`# ${t}`);for(const i of e){const r=Rt(i);r.length>0&&n.push(r.join(`
|
|
2
2
|
`))}return`${n.join(`
|
|
3
3
|
|
|
4
4
|
`)}
|
|
5
|
-
`}const B=e=>`user:${e}`,G=e=>`team:${e}`;function xt(e){const t=new Set;for(const n of e??[])n?.id&&(n.kind==="user"&&t.add(B(n.id)),n.kind==="team"&&t.add(G(n.id)));return[...t].sort()}function kt(e,t){return[B(e),...t.map(G)]}function Dt(e){const t=new Set;for(const n of e??[])n?.kind&&t.add(n.kind);return[...t]}function $t(e){return(e.startsWith("tool:")?e.slice(5):e).replace(/__/g," · ").replace(/\./g," · ").replace(/_/g," ")}const
|
|
5
|
+
`}const B=e=>`user:${e}`,G=e=>`team:${e}`;function xt(e){const t=new Set;for(const n of e??[])n?.id&&(n.kind==="user"&&t.add(B(n.id)),n.kind==="team"&&t.add(G(n.id)));return[...t].sort()}function kt(e,t){return[B(e),...t.map(G)]}function Dt(e){const t=new Set;for(const n of e??[])n?.kind&&t.add(n.kind);return[...t]}function $t(e){return(e.startsWith("tool:")?e.slice(5):e).replace(/__/g," · ").replace(/\./g," · ").replace(/_/g," ")}const Pt=[{name:"text",type:"string"},{name:"subject",type:"string"},{name:"from",type:"string"},{name:"type",type:"string"},{name:"direction",type:"string"},{name:"channelId",type:"string"},{name:"interactionId",type:"string"},{name:"activityId",type:"string"},{name:"authorType",type:"string"},{name:"authorName",type:"string"},{name:"textRaw",type:"string"},{name:"fromStatus",type:"string"},{name:"toStatus",type:"string"},{name:"contactId",type:"string"},{name:"companyId",type:"string"}],Ut={topics:[{name:"topic",type:"string"},{name:"confidence",type:"number"}],question:[{name:"answer",type:"boolean"},{name:"confidence",type:"number"}],extract:[]};function Ie(e){switch(e.kind){case"user":return`user:${e.userId}`;case"team":return`team:${e.teamId}`;case"org":return"org"}}function wt(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 a=t.slice(0,n),i=t.slice(n+1).trim();if(i){if(a==="user")return{kind:"user",userId:i};if(a==="team")return{kind:"team",teamId:i}}}function Se(e){return Ie(e)}function Kt(e){switch(e.kind){case"personal":return{kind:"user",userId:e.userId};case"team":return{kind:"team",teamId:e.teamId};case"org":return{kind:"org"}}}function Bt(e){return Se(e)}const Me=["done","escalated","failed","timed_out","stopped"],Ne=["awaiting_approval","awaiting_reply"];function Ce(e){return Me.includes(e)}function Gt(e){return Ce(e)}function Ft(e){return Ne.includes(e)}function Ht(e,t){const n=e.labels??[];return n.find(a=>a.locale===t)?.label??n[0]?.label??e.url}function Vt(e,t,n){const a=e.translations??[];return a.find(i=>i.locale===t)??(n?a.find(i=>i.locale===n):void 0)??{locale:t}}const F=3;function Le(e,t){const n=new Set;let a=1,i=t.get(e)?.parentId;for(;i;){if(n.has(i)||(n.add(i),a++,a>F+1))return 1/0;i=t.get(i)?.parentId}return a}function jt(e,t,n){if(!e)return!0;if(e===t)return!1;const a=new Map(n.map(o=>[o.id,o]));if(!a.has(e)||t&&Oe(e,t,a))return!1;const i=Le(e,a),r=t?H(t,n):1;return i+r<=F}function Oe(e,t,n){const a=new Set;let i=n.get(e)?.parentId;for(;i;){if(i===t)return!0;if(a.has(i))return!1;a.add(i),i=n.get(i)?.parentId}return!1}function H(e,t,n=new Set){if(n.has(e))return 1;n.add(e);const a=t.filter(i=>i.parentId===e);return a.length?1+Math.max(...a.map(i=>H(i.id,t,n))):1}const Re="en";function ve(e){return e.defaultLocale||e.locale||Re}function Wt(e){const t=new Set,n=[];for(const a of[ve(e),...e.locales??[]])!a||t.has(a)||(t.add(a),n.push(a));return n}function Xt(e,t,n){const a=e.translations??[];return a.find(i=>i.locale===t)?.name??(n?a.find(i=>i.locale===n)?.name:void 0)??e.name}const V=[{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 h(e){return V.find(t=>t.id===e)}function Yt(e){return h(e)?.label??e}function zt(e,t="gpt-5-mini"){return h(e)?.defaultModel??t}function qt(e){return V.filter(t=>t.capabilities.includes(e))}function Jt(e){const t=h(e);return!!t&&!t.baseUrl}function Qt(e,t){return t==="text"?!0:h(e)?.attachmentKinds?.includes(t)===!0}const Zt=new Set(["mail","message"]);function xe(e,t){const n=e.settings?.signatures?.[t];return!n||!n.enabled||!n.body||n.body.trim()===""?null:n}function en(e,t,n,a="html"){if(!e)return n;const i=xe(e,t);return i?`${n}${a==="text"?`
|
|
6
6
|
|
|
7
|
-
`:t==="mail"?"<br><br>-- <br>":"<br><br>"}${i.body}`:n}function tn(e){return e.endpoints??[]}const nn=e=>!!e.assignedUserId||!!e.assignedInboxId,an=e=>e.status==="closed",rn=e=>({urgent:10,high:5,normal:2,low:1})[e.priority]||0,on=(e,t=30)=>e.title?.length<=t?e.title:`${e.title.substring(0,t)}...`;function sn(e,t){return e.lastActivityAt?!(e.seenBy??[]).includes(t):!1}const ln=2e3,cn=500,un=12e3,pn=4e3,
|
|
7
|
+
`:t==="mail"?"<br><br>-- <br>":"<br><br>"}${i.body}`:n}function tn(e){return e.endpoints??[]}const nn=e=>!!e.assignedUserId||!!e.assignedInboxId,an=e=>e.status==="closed",rn=e=>({urgent:10,high:5,normal:2,low:1})[e.priority]||0,on=(e,t=30)=>e.title?.length<=t?e.title:`${e.title.substring(0,t)}...`;function sn(e,t){return e.lastActivityAt?!(e.seenBy??[]).includes(t):!1}const ln=2e3,cn=500,un=12e3,pn=4e3,ke=["contact","company"];function dn(e){if(!e)return!1;const t=e.slice(0,e.indexOf(":"));return ke.includes(t)}const C={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}},De="NL",fn=15,mn=8,gn=Array.from(new Set(Object.values(C).map(e=>e.callingCode))).sort((e,t)=>t.length-e.length);function ie(e){if(e)return C[e.trim().toUpperCase()]}function S(e,t){return e.length>=t.nsnMin&&e.length<=t.nsnMax}function ae(e){if(e.length>fn)return null;for(const t of gn){if(!e.startsWith(t))continue;const n=e.slice(t.length);for(const a of Object.values(C)){if(a.callingCode!==t)continue;const i=a.trunkPrefix,r=i&&n.startsWith(i)?n.slice(i.length):n;if(S(r,a))return`+${t}${r}`}return null}return e.length<mn?null:`+${e}`}function hn(e){let t=e.trim();const n=t.match(/^(sips?|tel|whatsapp):/i);n&&(t=t.slice(n[0].length));const a=t.indexOf("@");return a>=0&&(t=t.slice(0,a)),t.trim()}function An(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 w(e,t){if(!e)return null;const n=hn(e);if(!n)return null;const a=n.startsWith("+"),i=n.replace(/\D/g,"");if(!i)return null;if(a)return ae(i);if(i.startsWith("00"))return ae(i.slice(2));const r=ie(t)??ie(De);if(!r)return null;const o=r.trunkPrefix;if(o&&i.startsWith(o)){const s=i.slice(o.length);return S(s,r)?`+${r.callingCode}${s}`:null}if(i.startsWith(r.callingCode)){const s=i.slice(r.callingCode.length);if(S(s,r))return`+${r.callingCode}${s}`}return!o&&S(i,r)?`+${r.callingCode}${i}`:null}function En(e,t=9){const n=(e??"").replace(/\D/g,"");return n.length<t?null:n.slice(-t)}function j(e){if(!e)return null;const t=e.trim().toLowerCase(),n=t.lastIndexOf("@");if(n<=0||n===t.length-1)return null;const a=t.slice(0,n).split("+")[0],i=t.slice(n+1);return!a||!i.includes(".")?null:`${a}@${i}`}function yn(e){const t=j(e);return t?t.slice(t.lastIndexOf("@")+1):null}const _n=new Set(["co.uk","org.uk","gov.uk","ac.uk","com.au","co.nz","com.br","co.za"]);function $e(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 _n.has(n)&&t.length>=3?t.slice(-3).join("."):n}const Pe=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 Tn(e){const t=$e(e);return t?Pe.has(t):!1}function bn(e){if(!e)return!1;const t=e.trim().toLowerCase();return t==="tel"||t==="sms"||t==="whatsapp"||t==="fax"}function In(e,t,n){if(!e||!t)return null;const a=e.trim().toLowerCase();if(a==="tel"||a==="sms"||a==="whatsapp"){const r=w(t,n);return r?`tel:${r}`:null}if(a==="fax"){const r=w(t,n);return r?`fax:${r}`:null}if(a==="mailto"||a==="email"){const r=j(t);return r?`mailto:${r}`:null}const i=t.trim().toLowerCase();return i?`${a}:${i}`:null}const Sn=/(\*\*|__)(?=\S)([\s\S]*?\S)\1/g,Mn=/(\*|_)(?=\S)([^*_\n]*?\S)\1/g;function Nn(e){if(typeof e!="string"||!e)return"";let t=e;return t=t.replace(/```[a-z]*\n?/gi,"").replace(/~~~[a-z]*\n?/gi,""),t=t.replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1"),t=t.replace(/\[([^\]]*)\]\([^)]*\)/g,"$1"),t=t.replace(/\[([^\]]*)\]\[[^\]]*\]/g,"$1"),t=t.replace(/<((?:https?|mailto):[^>\s]+)>/gi,"$1"),t=t.split(`
|
|
8
8
|
`).map(n=>n.replace(/^\s{0,3}#{1,6}\s+/,"").replace(/^\s{0,3}>\s?/,"").replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+[.)]\s+/,"").replace(/^\s*(?:[-*_]\s*){3,}$/,"")).join(`
|
|
9
|
-
`),t=t.replace(Sn,"$2"),t=t.replace(Mn,"$2"),t=t.replace(/~~(?=\S)([\s\S]*?\S)~~/g,"$1"),t=t.replace(/`([^`\n]+)`/g,"$1"),t.replace(/\s+/g," ").trim()}const Cn=[/<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],
|
|
10
|
-
`);for(let n=0;n<t.length;n++)if(Ln.test(t[n])||
|
|
11
|
-
`).trim();return e}function
|
|
9
|
+
`),t=t.replace(Sn,"$2"),t=t.replace(Mn,"$2"),t=t.replace(/~~(?=\S)([\s\S]*?\S)~~/g,"$1"),t=t.replace(/`([^`\n]+)`/g,"$1"),t.replace(/\s+/g," ").trim()}const Cn=[/<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],re=/^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i,Ln=/^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;function On(e){const t=e.split(`
|
|
10
|
+
`);for(let n=0;n<t.length;n++)if(Ln.test(t[n])||re.test(t[n])&&t.slice(n+1,n+4).some(a=>re.test(a)))return t.slice(0,n).join(`
|
|
11
|
+
`).trim();return e}function oe(e){let t=e;return t=t.replace(/<(script|style)[\s\S]*?<\/\1>/gi,""),t=t.replace(/<br\s*\/?>/gi,`
|
|
12
12
|
`),t=t.replace(/<\/(p|h[1-6]|ul|ol|table|blockquote)>/gi,`
|
|
13
13
|
|
|
14
14
|
`),t=t.replace(/<\/(div|li|tr)>/gi,`
|
|
15
|
-
`),t=t.replace(/<\/(td|th)>/gi," "),t=t.replace(/<[^>]+>/g,""),t=t.replace(/<[^>]*$/,""),t}function
|
|
15
|
+
`),t=t.replace(/<\/(td|th)>/gi," "),t=t.replace(/<[^>]+>/g,""),t=t.replace(/<[^>]*$/,""),t}function se(e){return!Number.isInteger(e)||e<0||e>1114111?null:String.fromCodePoint(e)}function le(e){return e.replace(/ /gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/&#(\d+);/g,(t,n)=>se(Number(n))??t).replace(/&#x([0-9a-f]+);/gi,(t,n)=>se(parseInt(n,16))??t).replace(/&/gi,"&")}function ce(e){return e.replace(/\r/g,"").replace(/[ \t]+/g," ").replace(/ *\n */g,`
|
|
16
16
|
`).replace(/\n{3,}/g,`
|
|
17
17
|
|
|
18
|
-
`).trim()}function Rn(e){if(typeof e!="string"||!e)return"";let t=e.length;for(const r of Cn){const o=e.search(r);o>=0&&o<t&&(t=o)}const n=e.slice(0,t);let a=
|
|
18
|
+
`).trim()}function Rn(e){if(typeof e!="string"||!e)return"";let t=e.length;for(const r of Cn){const o=e.search(r);o>=0&&o<t&&(t=o)}const n=e.slice(0,t);let a=ce(le(oe(n)));return a||(a=ce(le(oe(e)))),On(a)||a}const vn=/(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i,xn=/\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;function kn(e,t){return!!(e&&vn.test(e)||t&&xn.test(t))}const Ue=3,we=600;function Dn(e,t){return e>=Ue||t>=we}const $n=new Set(["image/png","image/jpeg","image/jpg","image/gif","image/webp"]),Pn=new Set(["text/plain","text/markdown","text/csv","application/json","text/html","application/xml","text/xml"]);function Ke(e){const t=(e??"").trim().toLowerCase().split(";")[0];return t?$n.has(t)?"image":t==="application/pdf"?"pdf":Pn.has(t)?"text":t.startsWith("audio/")?"audio":"unsupported":"unsupported"}const g=1024*1024,Be={image:5*g,pdf:20*g,text:1*g,audio:20*g},Un=25*g,wn=5;function Kn(e,t){const n=Ke(e);return n==="unsupported"?"unsupported":t>Be[n]?"too-large":null}function Ge(e,t){const n=new Set(e.disabledIntents??[]),a=e.intentOverrides??{},i=t.intents.filter(o=>!n.has(o.intent)).map(o=>Gn(o,a[o.intent]));if(!e.extraIntents||e.extraIntents.length===0)return i;const r=new Set(i.map(o=>o.intent));for(const o of e.extraIntents)r.has(o.intent)||(i.push(o),r.add(o.intent));return i}function Fe(e,t){const n={};for(const a of e.intents){if(!a.togglable)continue;const i=t?.[a.intent];n[a.intent]=i??a.defaultEnabled??!0}return n}function Bn(e,t){const n=Fe(e,t);return Object.entries(n).filter(([,a])=>!a).map(([a])=>a)}function Gn(e,t){return t?{intent:t.intent??e.intent,targetSchemes:t.targetSchemes??e.targetSchemes,transport:t.transport??e.transport}:e}function Fn(e,t){const n=[];for(const a of e){if(!a.enabled)continue;const i=t[a.providerId];if(i)for(const r of Ge(a,i))n.push({channel:a,description:i,capability:r})}return n}function Hn(e,t){return t.filter(n=>n.capability.intent===e)}function He(e,t){return t.filter(n=>n.capability.targetSchemes.includes(e))}function Vn(e,t){return He(e.scheme,t)}function jn(e,t,n){const a=[];for(const i of e)for(const r of n)r.capability.intent===t&&r.capability.targetSchemes.includes(i.scheme)&&a.push({channelIntent:r,endpoint:i});return a}var Ve=(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))(Ve||{});const Wn={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 Xn(e){return e?Wn[e]??"note":"note"}const Yn="message_window",zn="message_templates",qn={FROM:"from",TO:"to",CC:"cc",BCC:"bcc",ORGANIZER:"organizer",PRESENTER:"presenter",ATTENDEE:"attendee",OWNER:"owner",MEMBER:"member",GUEST:"guest",HOST:"host",PARTICIPANT:"participant"},Jn=(e,t)=>({intent:e,...t}),Qn="folder_management",Zn="remote_search",ei={ok:!1,code:"UNSUPPORTED",message:"Provider does not support this op"},W="auth";function X(e){const t=typeof e=="string"?e.match(/apps\/([^/?#]+)/):null;return t?t[1]:null}function ti(e){const t=X(e);return t?t!==W:typeof e=="string"&&e.startsWith("/wake")}function ni(e){return typeof e!="string"||e===""||e==="/"?!0:X(e)===W}function ii(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function je(e){const n=e.split("/").filter(Boolean).map(a=>a.startsWith(":")?a.endsWith("?")?"(?:/[^/]+)?":"/[^/]+":"/"+ii(a)).join("");return new RegExp(`^${n}\\/?$`)}function We(e,t){const n=e.split("/").filter(Boolean),a=t.split("/").filter(Boolean),i={};return n.forEach((r,o)=>{if(r.startsWith(":")){const s=r.endsWith("?")?r.slice(1,-1):r.slice(1),l=a[o];l&&(i[s]=l)}}),i}function Xe(e){return e.publicBasePath??`/apps/${e.name}`}function ai(e){const t=[];for(const n of e){if(!n?.name)continue;const a=Xe(n);for(const i of n.routes??[]){if(!i.public)continue;const r=i.path==="/"?"":i.path;t.push({appName:n.name,resource:i.resource,pattern:`${a}${r}`,props:i.props})}}return t}function Ye(e,t){const n=e.split("/").filter(Boolean),a=t.split("/").filter(Boolean);for(let i=0;i<Math.min(n.length,a.length);i++){const r=n[i].startsWith(":"),o=a[i].startsWith(":");if(r!==o)return o}return n.length>a.length}function ze(e,t){if(typeof e!="string")return null;let n=null;for(const a of t)je(a.pattern).test(e)&&(!n||Ye(a.pattern,n.pattern))&&(n=a);return n?{...n,params:{...n.props,...We(n.pattern,e)}}:null}function ri(e,t){return ze(e,t)!==null}const oi=9e4,si="installation-id";exports.ACTIVITY_CATALOG=m;exports.AI_ATTACHMENT_LIMITS=Be;exports.AI_ATTACHMENT_MAX_PER_TURN=wn;exports.AI_ATTACHMENT_TURN_BUDGET=Un;exports.AI_VENDORS=V;exports.ALLOWED_LINK_SCHEMES=_e;exports.ARTIFACT_MAX_BLOCKS=k;exports.ARTIFACT_MAX_BODY_BYTES=_t;exports.ARTIFACT_MAX_CELL_LEN=I;exports.ARTIFACT_MAX_KPI_ITEMS=U;exports.ARTIFACT_MAX_LIST_ITEMS=D;exports.ARTIFACT_MAX_TABLE_COLUMNS=P;exports.ARTIFACT_MAX_TABLE_ROWS=$;exports.ARTIFACT_MAX_TEXT_LEN=K;exports.AUTH_APP_NAME=W;exports.ActivityTypeRegistry=fe;exports.BUILT_IN_ONLY=ct;exports.CLASSIFY_VARS=Ut;exports.CORE_DIMENSIONS=mt;exports.CommunicationScheme=Ve;exports.DEFAULT_MEMORY_BUDGET=pn;exports.DEFAULT_PHONE_REGION=De;exports.FEATURE_FOLDER_MANAGEMENT=Qn;exports.FEATURE_REMOTE_SEARCH=Zn;exports.INSTALLATION_HEADER=si;exports.InteractionParticipantRole=qn;exports.KB_FALLBACK_LOCALE=Re;exports.MAX_ACTIONS=b;exports.MAX_BLOCKS=x;exports.MAX_COLLECTION_DEPTH=F;exports.MAX_FIELDS=_;exports.MAX_LIST_ITEMS=T;exports.MAX_MEMORY_BUDGET=un;exports.MAX_MEMORY_CHARS=ln;exports.MIN_MEMORY_BUDGET=cn;exports.PAUSED_RUN_STATUSES=Ne;exports.PHONE_REGIONS=C;exports.PRESENCE_ONLINE_WINDOW_MS=oi;exports.PROVIDER_FEATURE_MESSAGE_TEMPLATES=zn;exports.PROVIDER_FEATURE_MESSAGE_WINDOW=Yn;exports.PUBLIC_EMAIL_DOMAINS=Pe;exports.RELATED_SUBJECT_KINDS=ke;exports.SIGNATURE_INTENTS=Zt;exports.SUMMARY_MIN_LAST_CHARS=we;exports.SUMMARY_MIN_MESSAGES=Ue;exports.TERMINAL_RUN_STATUSES=Me;exports.TRIGGER_VARS=Pt;exports.UNSUPPORTED=ei;exports.USAGE_DIMENSIONS=he;exports.USAGE_DIMENSION_IDS=Ae;exports.actingIdentityKey=Se;exports.activityIconOf=Ze;exports.activityJoinUrl=st;exports.activitySnippet=pe;exports.activityTextParams=de;exports.activityTimelineText=ot;exports.activityTimestamp=ft;exports.activityTypeInfo=p;exports.actorKey=Bt;exports.aiAttachmentKind=Ke;exports.aiAttachmentRejection=Kn;exports.aiVendorAcceptsAttachment=Qt;exports.aiVendorDefaultModel=zt;exports.aiVendorLabel=Yt;exports.aiVendorNeedsBaseUrl=Jt;exports.aiVendorsWith=qt;exports.appNameFromPath=X;exports.applySignature=en;exports.artifactBodyBytes=Lt;exports.artifactOutline=Ot;exports.artifactToMarkdown=vt;exports.buildActivityPreview=pt;exports.buildChannelIntents=Fn;exports.buildShareKeys=xt;exports.canNestUnder=jt;exports.carriesText=it;exports.categoryLabel=Xt;exports.channelKindForScheme=Xn;exports.channelKindOf=et;exports.cleanMessageText=Rn;exports.defaultLocaleOf=ve;exports.defineIntent=Jn;exports.depthOf=Le;exports.disabledIntentsFromCapabilities=Bn;exports.emailDomain=yn;exports.endpointKey=In;exports.extractParams=We;exports.filterByEndpoint=Vn;exports.filterByIntent=Hn;exports.filterByTargetScheme=He;exports.findAiVendor=h;exports.flattenLocales=gt;exports.floorToPeriod=ge;exports.formatActingIdentity=Ie;exports.formatPeriod=me;exports.getActivitySeenUserIds=dt;exports.getContactEndpoints=tn;exports.getShortTitle=on;exports.getUrgencyScore=rn;exports.heightOf=H;exports.helpCenterText=Vt;exports.humanizeAction=$t;exports.isAssigned=nn;exports.isClosed=an;exports.isDeepLink=ti;exports.isDescendant=Oe;exports.isInteractionUnseen=sn;exports.isLandingPath=ni;exports.isLikelyBulk=kn;exports.isMessageType=tt;exports.isMoreSpecificPattern=Ye;exports.isPaused=Ft;exports.isPlaybookAuthoredType=rt;exports.isPublicEmailDomain=Tn;exports.isPublicPath=ri;exports.isReplyableType=nt;exports.isRetryable=Gt;exports.isTerminal=Ce;exports.isThreadLongEnough=Dn;exports.linkLabel=Ht;exports.localesOf=Wt;exports.looksLikeEmail=An;exports.matchContactToIntents=jn;exports.matchPublicRoute=ze;exports.messageCountsAs=at;exports.needsPhoneRegion=bn;exports.normalizeArtifactBlocks=Ct;exports.normalizeBlocks=Qe;exports.normalizeEmail=j;exports.parseActingIdentity=wt;exports.pathToRegex=je;exports.periodsInRange=Et;exports.phoneSuffix=En;exports.plainTextFromMarkdown=Nn;exports.playbookActor=Kt;exports.publicBasePathFor=Xe;exports.publicRoutePatterns=ai;exports.readPath=M;exports.registrableDomain=$e;exports.relatedByDefault=dn;exports.resolveAccountCapabilities=Fe;exports.resolveActivityText=N;exports.resolveChannelIntents=Ge;exports.resolveSignature=xe;exports.sanitizeInline=be;exports.shareKeyForTeam=G;exports.shareKeyForUser=B;exports.shareKeysForViewer=kt;exports.stripHtml=ue;exports.toE164=w;exports.toolSourceKinds=Dt;exports.usageMetricId=Ee;exports.usageMetrics=yt;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const Tt = 10, It = 10, St = 10, Mt = 5,
|
|
1
|
+
const Tt = 10, It = 10, St = 10, Mt = 5, ce = /* @__PURE__ */ new Set([
|
|
2
2
|
"header",
|
|
3
3
|
"section",
|
|
4
4
|
"context",
|
|
@@ -25,7 +25,7 @@ function Ct(e, t = () => {
|
|
|
25
25
|
}
|
|
26
26
|
if (!a || typeof a != "object") continue;
|
|
27
27
|
const i = a;
|
|
28
|
-
if (!
|
|
28
|
+
if (!ce.has(i.type)) {
|
|
29
29
|
t("unknown block type " + String(i.type));
|
|
30
30
|
continue;
|
|
31
31
|
}
|
|
@@ -69,7 +69,7 @@ function Ct(e, t = () => {
|
|
|
69
69
|
}
|
|
70
70
|
return n;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function ue(e) {
|
|
73
73
|
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();
|
|
74
74
|
}
|
|
75
75
|
function y(e) {
|
|
@@ -86,7 +86,7 @@ function I(e) {
|
|
|
86
86
|
function b(e) {
|
|
87
87
|
return e.map((t) => t.name).join(", ");
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function L(e) {
|
|
90
90
|
return e === "meeting" ? "Meeting" : e === "video" ? "Video call" : "Audio call";
|
|
91
91
|
}
|
|
92
92
|
const m = {
|
|
@@ -204,7 +204,7 @@ const m = {
|
|
|
204
204
|
replyable: !0,
|
|
205
205
|
carriesText: !0,
|
|
206
206
|
countsAs: "inbound_message",
|
|
207
|
-
snippet:
|
|
207
|
+
snippet: k
|
|
208
208
|
},
|
|
209
209
|
EMAIL_SENT: {
|
|
210
210
|
shape: "message",
|
|
@@ -214,7 +214,7 @@ const m = {
|
|
|
214
214
|
replyable: !0,
|
|
215
215
|
carriesText: !0,
|
|
216
216
|
countsAs: "outbound_message",
|
|
217
|
-
snippet:
|
|
217
|
+
snippet: k
|
|
218
218
|
},
|
|
219
219
|
/* ---- chat ---- */
|
|
220
220
|
CHAT_MESSAGE_SENT: {
|
|
@@ -271,7 +271,7 @@ const m = {
|
|
|
271
271
|
channelKind: "chat",
|
|
272
272
|
icon: "message-circle",
|
|
273
273
|
snippet: () => "Gesprek gestart",
|
|
274
|
-
timeline: (e) => `${
|
|
274
|
+
timeline: (e) => `${L(e.payload.callType)} started${e.payload.initiator ? ` by ${e.payload.initiator.name}` : ""}`,
|
|
275
275
|
joinUrl: (e) => e.payload.joinUrl
|
|
276
276
|
},
|
|
277
277
|
CHAT_CALL_ENDED: {
|
|
@@ -279,7 +279,7 @@ const m = {
|
|
|
279
279
|
channelKind: "chat",
|
|
280
280
|
icon: "message-circle",
|
|
281
281
|
snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${y(e.payload.duration)})` : ""}`,
|
|
282
|
-
timeline: (e) => `${
|
|
282
|
+
timeline: (e) => `${L(e.payload.callType)} ended${x(e.payload.duration)}`,
|
|
283
283
|
joinUrl: (e) => e.payload.joinUrl
|
|
284
284
|
},
|
|
285
285
|
CHAT_EVENT: {
|
|
@@ -404,8 +404,8 @@ const m = {
|
|
|
404
404
|
timeline: (e, t) => `Assigned by ${t}`
|
|
405
405
|
}
|
|
406
406
|
};
|
|
407
|
-
function
|
|
408
|
-
const t = e.payload, n = t.bodySnippet?.trim() ||
|
|
407
|
+
function k(e) {
|
|
408
|
+
const t = e.payload, n = t.bodySnippet?.trim() || ue(t.body ?? "");
|
|
409
409
|
return t.subject ? `${t.subject} — ${n}` : n;
|
|
410
410
|
}
|
|
411
411
|
function f(e) {
|
|
@@ -421,10 +421,10 @@ function xt(e) {
|
|
|
421
421
|
const t = f(e)?.shape;
|
|
422
422
|
return t === "message" || t === "note";
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function Lt(e) {
|
|
425
425
|
return f(e)?.replyable === !0;
|
|
426
426
|
}
|
|
427
|
-
function
|
|
427
|
+
function kt(e) {
|
|
428
428
|
return f(e)?.carriesText === !0;
|
|
429
429
|
}
|
|
430
430
|
function Ot(e) {
|
|
@@ -433,7 +433,7 @@ function Ot(e) {
|
|
|
433
433
|
function $t(e) {
|
|
434
434
|
return f(e)?.playbookAuthored === !0;
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function pe(e) {
|
|
437
437
|
const t = f(e.type)?.snippet;
|
|
438
438
|
return t ? t(e) : "";
|
|
439
439
|
}
|
|
@@ -464,14 +464,14 @@ function N(e, t, n) {
|
|
|
464
464
|
const i = n(e.key, a);
|
|
465
465
|
return i === e.key ? null : i;
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function de(e, t) {
|
|
468
468
|
if (!e || typeof e == "string" || "value" in e) return null;
|
|
469
469
|
const n = {};
|
|
470
470
|
for (const [a, i] of Object.entries(e.params ?? {}))
|
|
471
471
|
n[a] = C(t, i);
|
|
472
472
|
return { key: e.key, params: n };
|
|
473
473
|
}
|
|
474
|
-
const
|
|
474
|
+
const fe = (e) => e;
|
|
475
475
|
function O(e) {
|
|
476
476
|
const t = m[e];
|
|
477
477
|
return {
|
|
@@ -503,8 +503,8 @@ function $(e) {
|
|
|
503
503
|
displayNameKey: e.displayNameKey
|
|
504
504
|
};
|
|
505
505
|
}
|
|
506
|
-
class
|
|
507
|
-
constructor(t = [], n =
|
|
506
|
+
class me {
|
|
507
|
+
constructor(t = [], n = fe) {
|
|
508
508
|
this.translate = n;
|
|
509
509
|
for (const a of t)
|
|
510
510
|
a?.type && (a.type in m || this.declared.has(a.type) || this.declared.set(a.type, a));
|
|
@@ -552,17 +552,17 @@ class de {
|
|
|
552
552
|
return this.translate;
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
-
const Dt = new
|
|
556
|
-
function
|
|
555
|
+
const Dt = new me(), R = 140;
|
|
556
|
+
function ge(e) {
|
|
557
557
|
const t = e.trim();
|
|
558
558
|
return t.length <= R ? t : t.slice(0, R - 1).trimEnd() + "…";
|
|
559
559
|
}
|
|
560
560
|
function Pt(e, t) {
|
|
561
|
-
const n =
|
|
561
|
+
const n = de(t?.text, e), a = t ? N(t.text, e, (i) => i) : null;
|
|
562
562
|
return {
|
|
563
563
|
activityId: e.id,
|
|
564
564
|
type: e.type,
|
|
565
|
-
snippet:
|
|
565
|
+
snippet: ge(a ?? pe(e)),
|
|
566
566
|
authorName: e.author?.name ?? "",
|
|
567
567
|
direction: e.direction,
|
|
568
568
|
createdAt: e.createdAt ?? Date.now(),
|
|
@@ -598,44 +598,44 @@ function Bt(e) {
|
|
|
598
598
|
function S(e) {
|
|
599
599
|
return e < 10 ? `0${e}` : `${e}`;
|
|
600
600
|
}
|
|
601
|
-
function
|
|
601
|
+
function he(e, t) {
|
|
602
602
|
const n = new Date(e), a = `${n.getUTCFullYear()}-${S(n.getUTCMonth() + 1)}-${S(n.getUTCDate())}`;
|
|
603
603
|
return t === "day" ? a : `${a}T${S(n.getUTCHours())}`;
|
|
604
604
|
}
|
|
605
|
-
function
|
|
605
|
+
function ye(e, t) {
|
|
606
606
|
const n = new Date(e);
|
|
607
607
|
return n.setUTCMinutes(0, 0, 0), t === "day" && n.setUTCHours(0), n.getTime();
|
|
608
608
|
}
|
|
609
|
-
const
|
|
609
|
+
const be = 36e5, Ae = 864e5;
|
|
610
610
|
function Ht(e, t, n) {
|
|
611
|
-
const a = n === "hour" ?
|
|
612
|
-
for (let r =
|
|
613
|
-
i.push(
|
|
611
|
+
const a = n === "hour" ? be : Ae, i = [];
|
|
612
|
+
for (let r = ye(e, n); r <= t; r += a)
|
|
613
|
+
i.push(he(r, n));
|
|
614
614
|
return i;
|
|
615
615
|
}
|
|
616
|
-
const
|
|
616
|
+
const Ee = [
|
|
617
617
|
{ id: "resource", label: "Resource", labelSource: "raw" },
|
|
618
618
|
{ id: "origin", label: "Herkomst", labelSource: "raw" }
|
|
619
|
-
],
|
|
620
|
-
function
|
|
619
|
+
], _e = Ee.map((e) => e.id);
|
|
620
|
+
function Te(e, t) {
|
|
621
621
|
return `${e}.usage.${t}`;
|
|
622
622
|
}
|
|
623
623
|
function jt(e, t) {
|
|
624
624
|
return t.map((n) => ({
|
|
625
|
-
id:
|
|
625
|
+
id: Te(e, n.unit),
|
|
626
626
|
label: n.label,
|
|
627
627
|
category: "Verbruik",
|
|
628
628
|
valueType: n.valueType ?? "count",
|
|
629
629
|
aggregation: "sum",
|
|
630
630
|
supportedDimensions: [
|
|
631
631
|
"provider",
|
|
632
|
-
...
|
|
632
|
+
..._e,
|
|
633
633
|
...n.extraDimensions ?? [],
|
|
634
634
|
"time"
|
|
635
635
|
]
|
|
636
636
|
}));
|
|
637
637
|
}
|
|
638
|
-
const J = /* @__PURE__ */ new Set(["info", "success", "warning", "destructive"]), w = 200, D = 100, P = 200, U = 12, K = 4, Q = 4e3, M = 500, Vt = 256 * 1024,
|
|
638
|
+
const J = /* @__PURE__ */ new Set(["info", "success", "warning", "destructive"]), w = 200, D = 100, P = 200, U = 12, K = 4, Q = 4e3, M = 500, Vt = 256 * 1024, Ie = /* @__PURE__ */ new Set([
|
|
639
639
|
"heading",
|
|
640
640
|
"paragraph",
|
|
641
641
|
"list",
|
|
@@ -645,15 +645,15 @@ const J = /* @__PURE__ */ new Set(["info", "success", "warning", "destructive"])
|
|
|
645
645
|
"table",
|
|
646
646
|
"kpi",
|
|
647
647
|
"callout"
|
|
648
|
-
]),
|
|
648
|
+
]), Se = ["http:", "https:", "mailto:", "tel:"], Me = /^[a-z][a-z0-9+.-]*:/i;
|
|
649
649
|
function Z(e) {
|
|
650
650
|
const t = e.trim().replace(/^<|>$/g, "");
|
|
651
651
|
if (!t) return !1;
|
|
652
|
-
const n =
|
|
653
|
-
return n ?
|
|
652
|
+
const n = Me.exec(t)?.[0];
|
|
653
|
+
return n ? Se.includes(n.toLowerCase()) : !t.startsWith("//");
|
|
654
654
|
}
|
|
655
|
-
const
|
|
656
|
-
function
|
|
655
|
+
const Ce = /^[ \t]{0,3}\[([^\]]+)\]:[ \t]*(\S+).*$/gm;
|
|
656
|
+
function Ne(e) {
|
|
657
657
|
let t = "", n = 0;
|
|
658
658
|
for (; n < e.length; ) {
|
|
659
659
|
const a = e[n] === "!" && e[n + 1] === "[";
|
|
@@ -689,19 +689,19 @@ function G(e, t, n, a) {
|
|
|
689
689
|
}
|
|
690
690
|
return -1;
|
|
691
691
|
}
|
|
692
|
-
function
|
|
693
|
-
return
|
|
694
|
-
|
|
692
|
+
function ve(e) {
|
|
693
|
+
return Ne(e).replace(
|
|
694
|
+
Ce,
|
|
695
695
|
(t, n, a) => Z(a) ? t : ""
|
|
696
696
|
);
|
|
697
697
|
}
|
|
698
698
|
function u(e, t = Q) {
|
|
699
|
-
return typeof e == "string" ?
|
|
699
|
+
return typeof e == "string" ? ve(e).slice(0, t) : "";
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function xe(e, t = Q) {
|
|
702
702
|
return typeof e == "string" ? e.slice(0, t) : "";
|
|
703
703
|
}
|
|
704
|
-
function
|
|
704
|
+
function Le(e, t = "info") {
|
|
705
705
|
return typeof e == "string" && J.has(e) ? e : t;
|
|
706
706
|
}
|
|
707
707
|
function Ft(e, t = () => {
|
|
@@ -715,7 +715,7 @@ function Ft(e, t = () => {
|
|
|
715
715
|
}
|
|
716
716
|
if (!a || typeof a != "object") continue;
|
|
717
717
|
const i = a;
|
|
718
|
-
if (!
|
|
718
|
+
if (!Ie.has(i.type)) {
|
|
719
719
|
t("unknown block type " + String(i.type));
|
|
720
720
|
continue;
|
|
721
721
|
}
|
|
@@ -750,7 +750,7 @@ function Ft(e, t = () => {
|
|
|
750
750
|
break;
|
|
751
751
|
}
|
|
752
752
|
case "code": {
|
|
753
|
-
const o =
|
|
753
|
+
const o = xe(i.text);
|
|
754
754
|
if (!o) {
|
|
755
755
|
t("a code block without text");
|
|
756
756
|
continue;
|
|
@@ -804,7 +804,7 @@ function Ft(e, t = () => {
|
|
|
804
804
|
}
|
|
805
805
|
const h = Array.isArray(c) ? c : [];
|
|
806
806
|
p.push(
|
|
807
|
-
s.map((_,
|
|
807
|
+
s.map((_, le) => u(h[le], M))
|
|
808
808
|
);
|
|
809
809
|
}
|
|
810
810
|
const d = u(i.caption, M);
|
|
@@ -848,7 +848,7 @@ function Ft(e, t = () => {
|
|
|
848
848
|
n.push({
|
|
849
849
|
...r,
|
|
850
850
|
type: "callout",
|
|
851
|
-
tone:
|
|
851
|
+
tone: Le(i.tone),
|
|
852
852
|
...s ? { title: s } : {},
|
|
853
853
|
text: o
|
|
854
854
|
});
|
|
@@ -879,7 +879,7 @@ function H(e, t, n) {
|
|
|
879
879
|
...t.map((i) => `| ${i.map(B).join(" | ")} |`)
|
|
880
880
|
];
|
|
881
881
|
}
|
|
882
|
-
function
|
|
882
|
+
function ke(e) {
|
|
883
883
|
switch (e.type) {
|
|
884
884
|
case "heading":
|
|
885
885
|
return [`${"#".repeat(e.level)} ${e.text}`];
|
|
@@ -917,7 +917,7 @@ function zt(e, t) {
|
|
|
917
917
|
const n = [], a = e.some((i) => i.type === "heading" && i.level === 1);
|
|
918
918
|
t && !a && n.push(`# ${t}`);
|
|
919
919
|
for (const i of e) {
|
|
920
|
-
const r =
|
|
920
|
+
const r = ke(i);
|
|
921
921
|
r.length > 0 && n.push(r.join(`
|
|
922
922
|
`));
|
|
923
923
|
}
|
|
@@ -979,7 +979,7 @@ const Zt = [
|
|
|
979
979
|
],
|
|
980
980
|
extract: []
|
|
981
981
|
};
|
|
982
|
-
function
|
|
982
|
+
function Oe(e) {
|
|
983
983
|
switch (e.kind) {
|
|
984
984
|
case "user":
|
|
985
985
|
return `user:${e.userId}`;
|
|
@@ -1001,8 +1001,8 @@ function tn(e) {
|
|
|
1001
1001
|
if (a === "team") return { kind: "team", teamId: i };
|
|
1002
1002
|
}
|
|
1003
1003
|
}
|
|
1004
|
-
function
|
|
1005
|
-
return
|
|
1004
|
+
function $e(e) {
|
|
1005
|
+
return Oe(e);
|
|
1006
1006
|
}
|
|
1007
1007
|
function nn(e) {
|
|
1008
1008
|
switch (e.kind) {
|
|
@@ -1015,17 +1015,17 @@ function nn(e) {
|
|
|
1015
1015
|
}
|
|
1016
1016
|
}
|
|
1017
1017
|
function an(e) {
|
|
1018
|
-
return
|
|
1018
|
+
return $e(e);
|
|
1019
1019
|
}
|
|
1020
|
-
const
|
|
1021
|
-
function
|
|
1022
|
-
return
|
|
1020
|
+
const Re = ["done", "escalated", "failed", "timed_out", "stopped"], we = ["awaiting_approval", "awaiting_reply"];
|
|
1021
|
+
function De(e) {
|
|
1022
|
+
return Re.includes(e);
|
|
1023
1023
|
}
|
|
1024
1024
|
function rn(e) {
|
|
1025
|
-
return
|
|
1025
|
+
return De(e);
|
|
1026
1026
|
}
|
|
1027
1027
|
function on(e) {
|
|
1028
|
-
return
|
|
1028
|
+
return we.includes(e);
|
|
1029
1029
|
}
|
|
1030
1030
|
function sn(e, t) {
|
|
1031
1031
|
const n = e.labels ?? [];
|
|
@@ -1036,7 +1036,7 @@ function ln(e, t, n) {
|
|
|
1036
1036
|
return a.find((i) => i.locale === t) ?? (n ? a.find((i) => i.locale === n) : void 0) ?? { locale: t };
|
|
1037
1037
|
}
|
|
1038
1038
|
const ne = 3;
|
|
1039
|
-
function
|
|
1039
|
+
function Pe(e, t) {
|
|
1040
1040
|
const n = /* @__PURE__ */ new Set();
|
|
1041
1041
|
let a = 1, i = t.get(e)?.parentId;
|
|
1042
1042
|
for (; i; ) {
|
|
@@ -1049,11 +1049,11 @@ function cn(e, t, n) {
|
|
|
1049
1049
|
if (!e) return !0;
|
|
1050
1050
|
if (e === t) return !1;
|
|
1051
1051
|
const a = new Map(n.map((o) => [o.id, o]));
|
|
1052
|
-
if (!a.has(e) || t &&
|
|
1053
|
-
const i =
|
|
1052
|
+
if (!a.has(e) || t && Ue(e, t, a)) return !1;
|
|
1053
|
+
const i = Pe(e, a), r = t ? ie(t, n) : 1;
|
|
1054
1054
|
return i + r <= ne;
|
|
1055
1055
|
}
|
|
1056
|
-
function
|
|
1056
|
+
function Ue(e, t, n) {
|
|
1057
1057
|
const a = /* @__PURE__ */ new Set();
|
|
1058
1058
|
let i = n.get(e)?.parentId;
|
|
1059
1059
|
for (; i; ) {
|
|
@@ -1069,13 +1069,13 @@ function ie(e, t, n = /* @__PURE__ */ new Set()) {
|
|
|
1069
1069
|
const a = t.filter((i) => i.parentId === e);
|
|
1070
1070
|
return a.length ? 1 + Math.max(...a.map((i) => ie(i.id, t, n))) : 1;
|
|
1071
1071
|
}
|
|
1072
|
-
const
|
|
1073
|
-
function
|
|
1074
|
-
return e.defaultLocale || e.locale ||
|
|
1072
|
+
const Ke = "en";
|
|
1073
|
+
function Ge(e) {
|
|
1074
|
+
return e.defaultLocale || e.locale || Ke;
|
|
1075
1075
|
}
|
|
1076
1076
|
function un(e) {
|
|
1077
1077
|
const t = /* @__PURE__ */ new Set(), n = [];
|
|
1078
|
-
for (const a of [
|
|
1078
|
+
for (const a of [Ge(e), ...e.locales ?? []])
|
|
1079
1079
|
!a || t.has(a) || (t.add(a), n.push(a));
|
|
1080
1080
|
return n;
|
|
1081
1081
|
}
|
|
@@ -1194,13 +1194,13 @@ function hn(e, t) {
|
|
|
1194
1194
|
return t === "text" ? !0 : E(e)?.attachmentKinds?.includes(t) === !0;
|
|
1195
1195
|
}
|
|
1196
1196
|
const yn = /* @__PURE__ */ new Set(["mail", "message"]);
|
|
1197
|
-
function
|
|
1197
|
+
function Be(e, t) {
|
|
1198
1198
|
const n = e.settings?.signatures?.[t];
|
|
1199
1199
|
return !n || !n.enabled || !n.body || n.body.trim() === "" ? null : n;
|
|
1200
1200
|
}
|
|
1201
1201
|
function bn(e, t, n, a = "html") {
|
|
1202
1202
|
if (!e) return n;
|
|
1203
|
-
const i =
|
|
1203
|
+
const i = Be(e, t);
|
|
1204
1204
|
return i ? `${n}${a === "text" ? `
|
|
1205
1205
|
|
|
1206
1206
|
` : t === "mail" ? "<br><br>-- <br>" : "<br><br>"}${i.body}` : n;
|
|
@@ -1217,11 +1217,11 @@ const En = (e) => !!e.assignedUserId || !!e.assignedInboxId, _n = (e) => e.statu
|
|
|
1217
1217
|
function Sn(e, t) {
|
|
1218
1218
|
return e.lastActivityAt ? !(e.seenBy ?? []).includes(t) : !1;
|
|
1219
1219
|
}
|
|
1220
|
-
const Mn = 2e3, Cn = 500, Nn = 12e3, vn = 4e3,
|
|
1220
|
+
const Mn = 2e3, Cn = 500, Nn = 12e3, vn = 4e3, He = ["contact", "company"];
|
|
1221
1221
|
function xn(e) {
|
|
1222
1222
|
if (!e) return !1;
|
|
1223
1223
|
const t = e.slice(0, e.indexOf(":"));
|
|
1224
|
-
return
|
|
1224
|
+
return He.includes(t);
|
|
1225
1225
|
}
|
|
1226
1226
|
const v = {
|
|
1227
1227
|
// The lower bounds are deliberately generous: service ranges (0800/0900) are
|
|
@@ -1246,7 +1246,7 @@ const v = {
|
|
|
1246
1246
|
PL: { callingCode: "48", nsnMin: 9, nsnMax: 9 },
|
|
1247
1247
|
US: { callingCode: "1", nsnMin: 10, nsnMax: 10 },
|
|
1248
1248
|
CA: { callingCode: "1", nsnMin: 10, nsnMax: 10 }
|
|
1249
|
-
},
|
|
1249
|
+
}, je = "NL", Ve = 15, Fe = 8, Xe = Array.from(
|
|
1250
1250
|
new Set(Object.values(v).map((e) => e.callingCode))
|
|
1251
1251
|
).sort((e, t) => t.length - e.length);
|
|
1252
1252
|
function j(e) {
|
|
@@ -1257,8 +1257,8 @@ function A(e, t) {
|
|
|
1257
1257
|
return e.length >= t.nsnMin && e.length <= t.nsnMax;
|
|
1258
1258
|
}
|
|
1259
1259
|
function V(e) {
|
|
1260
|
-
if (e.length >
|
|
1261
|
-
for (const t of
|
|
1260
|
+
if (e.length > Ve) return null;
|
|
1261
|
+
for (const t of Xe) {
|
|
1262
1262
|
if (!e.startsWith(t)) continue;
|
|
1263
1263
|
const n = e.slice(t.length);
|
|
1264
1264
|
for (const a of Object.values(v)) {
|
|
@@ -1268,16 +1268,16 @@ function V(e) {
|
|
|
1268
1268
|
}
|
|
1269
1269
|
return null;
|
|
1270
1270
|
}
|
|
1271
|
-
return e.length <
|
|
1271
|
+
return e.length < Fe ? null : `+${e}`;
|
|
1272
1272
|
}
|
|
1273
|
-
function
|
|
1273
|
+
function We(e) {
|
|
1274
1274
|
let t = e.trim();
|
|
1275
1275
|
const n = t.match(/^(sips?|tel|whatsapp):/i);
|
|
1276
1276
|
n && (t = t.slice(n[0].length));
|
|
1277
1277
|
const a = t.indexOf("@");
|
|
1278
1278
|
return a >= 0 && (t = t.slice(0, a)), t.trim();
|
|
1279
1279
|
}
|
|
1280
|
-
function
|
|
1280
|
+
function Ln(e) {
|
|
1281
1281
|
if (!e) return !1;
|
|
1282
1282
|
const t = e.indexOf("@");
|
|
1283
1283
|
if (t <= 0) return !1;
|
|
@@ -1286,13 +1286,13 @@ function kn(e) {
|
|
|
1286
1286
|
}
|
|
1287
1287
|
function F(e, t) {
|
|
1288
1288
|
if (!e) return null;
|
|
1289
|
-
const n =
|
|
1289
|
+
const n = We(e);
|
|
1290
1290
|
if (!n) return null;
|
|
1291
1291
|
const a = n.startsWith("+"), i = n.replace(/\D/g, "");
|
|
1292
1292
|
if (!i) return null;
|
|
1293
1293
|
if (a) return V(i);
|
|
1294
1294
|
if (i.startsWith("00")) return V(i.slice(2));
|
|
1295
|
-
const r = j(t) ?? j(
|
|
1295
|
+
const r = j(t) ?? j(je);
|
|
1296
1296
|
if (!r) return null;
|
|
1297
1297
|
const o = r.trunkPrefix;
|
|
1298
1298
|
if (o && i.startsWith(o)) {
|
|
@@ -1305,7 +1305,7 @@ function F(e, t) {
|
|
|
1305
1305
|
}
|
|
1306
1306
|
return !o && A(i, r) ? `+${r.callingCode}${i}` : null;
|
|
1307
1307
|
}
|
|
1308
|
-
function
|
|
1308
|
+
function kn(e, t = 9) {
|
|
1309
1309
|
const n = (e ?? "").replace(/\D/g, "");
|
|
1310
1310
|
return n.length < t ? null : n.slice(-t);
|
|
1311
1311
|
}
|
|
@@ -1320,7 +1320,7 @@ function On(e) {
|
|
|
1320
1320
|
const t = re(e);
|
|
1321
1321
|
return t ? t.slice(t.lastIndexOf("@") + 1) : null;
|
|
1322
1322
|
}
|
|
1323
|
-
const
|
|
1323
|
+
const ze = /* @__PURE__ */ new Set([
|
|
1324
1324
|
"co.uk",
|
|
1325
1325
|
"org.uk",
|
|
1326
1326
|
"gov.uk",
|
|
@@ -1330,14 +1330,14 @@ const Xe = /* @__PURE__ */ new Set([
|
|
|
1330
1330
|
"com.br",
|
|
1331
1331
|
"co.za"
|
|
1332
1332
|
]);
|
|
1333
|
-
function
|
|
1333
|
+
function Ye(e) {
|
|
1334
1334
|
if (!e) return null;
|
|
1335
1335
|
const t = e.trim().toLowerCase().replace(/\.$/, "").split(".").filter(Boolean);
|
|
1336
1336
|
if (t.length < 2) return null;
|
|
1337
1337
|
const n = t.slice(-2).join(".");
|
|
1338
|
-
return
|
|
1338
|
+
return ze.has(n) && t.length >= 3 ? t.slice(-3).join(".") : n;
|
|
1339
1339
|
}
|
|
1340
|
-
const
|
|
1340
|
+
const qe = /* @__PURE__ */ new Set([
|
|
1341
1341
|
"gmail.com",
|
|
1342
1342
|
"googlemail.com",
|
|
1343
1343
|
"outlook.com",
|
|
@@ -1383,8 +1383,8 @@ const ze = /* @__PURE__ */ new Set([
|
|
|
1383
1383
|
"scarlet.be"
|
|
1384
1384
|
]);
|
|
1385
1385
|
function $n(e) {
|
|
1386
|
-
const t =
|
|
1387
|
-
return t ?
|
|
1386
|
+
const t = Ye(e);
|
|
1387
|
+
return t ? qe.has(t) : !1;
|
|
1388
1388
|
}
|
|
1389
1389
|
function Rn(e) {
|
|
1390
1390
|
if (!e) return !1;
|
|
@@ -1409,7 +1409,7 @@ function wn(e, t, n) {
|
|
|
1409
1409
|
const i = t.trim().toLowerCase();
|
|
1410
1410
|
return i ? `${a}:${i}` : null;
|
|
1411
1411
|
}
|
|
1412
|
-
const
|
|
1412
|
+
const Je = /(\*\*|__)(?=\S)([\s\S]*?\S)\1/g, Qe = /(\*|_)(?=\S)([^*_\n]*?\S)\1/g;
|
|
1413
1413
|
function Dn(e) {
|
|
1414
1414
|
if (typeof e != "string" || !e) return "";
|
|
1415
1415
|
let t = e;
|
|
@@ -1417,9 +1417,9 @@ function Dn(e) {
|
|
|
1417
1417
|
`).map(
|
|
1418
1418
|
(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,}$/, "")
|
|
1419
1419
|
).join(`
|
|
1420
|
-
`), t = t.replace(
|
|
1420
|
+
`), t = t.replace(Je, "$2"), t = t.replace(Qe, "$2"), t = t.replace(/~~(?=\S)([\s\S]*?\S)~~/g, "$1"), t = t.replace(/`([^`\n]+)`/g, "$1"), t.replace(/\s+/g, " ").trim();
|
|
1421
1421
|
}
|
|
1422
|
-
const
|
|
1422
|
+
const Ze = [
|
|
1423
1423
|
/<blockquote/i,
|
|
1424
1424
|
/class="?gmail_quote/i,
|
|
1425
1425
|
// Gmail quote container
|
|
@@ -1432,12 +1432,12 @@ const Je = [
|
|
|
1432
1432
|
// Outlook underscore separator before "From:"
|
|
1433
1433
|
/\bOn\b[\s\S]{0,200}?\bwrote:/i
|
|
1434
1434
|
// Gmail "On <date> <name> wrote:"
|
|
1435
|
-
], X = /^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i,
|
|
1436
|
-
function
|
|
1435
|
+
], X = /^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i, et = /^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;
|
|
1436
|
+
function tt(e) {
|
|
1437
1437
|
const t = e.split(`
|
|
1438
1438
|
`);
|
|
1439
1439
|
for (let n = 0; n < t.length; n++)
|
|
1440
|
-
if (
|
|
1440
|
+
if (et.test(t[n]) || X.test(t[n]) && t.slice(n + 1, n + 4).some((a) => X.test(a)))
|
|
1441
1441
|
return t.slice(0, n).join(`
|
|
1442
1442
|
`).trim();
|
|
1443
1443
|
return e;
|
|
@@ -1465,23 +1465,23 @@ function q(e) {
|
|
|
1465
1465
|
function Pn(e) {
|
|
1466
1466
|
if (typeof e != "string" || !e) return "";
|
|
1467
1467
|
let t = e.length;
|
|
1468
|
-
for (const r of
|
|
1468
|
+
for (const r of Ze) {
|
|
1469
1469
|
const o = e.search(r);
|
|
1470
1470
|
o >= 0 && o < t && (t = o);
|
|
1471
1471
|
}
|
|
1472
1472
|
const n = e.slice(0, t);
|
|
1473
1473
|
let a = q(Y(W(n)));
|
|
1474
|
-
return a || (a = q(Y(W(e)))),
|
|
1474
|
+
return a || (a = q(Y(W(e)))), tt(a) || a;
|
|
1475
1475
|
}
|
|
1476
|
-
const
|
|
1476
|
+
const nt = /(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i, it = /\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;
|
|
1477
1477
|
function Un(e, t) {
|
|
1478
|
-
return !!(e &&
|
|
1478
|
+
return !!(e && nt.test(e) || t && it.test(t));
|
|
1479
1479
|
}
|
|
1480
|
-
const
|
|
1480
|
+
const at = 3, rt = 600;
|
|
1481
1481
|
function Kn(e, t) {
|
|
1482
|
-
return e >=
|
|
1482
|
+
return e >= at || t >= rt;
|
|
1483
1483
|
}
|
|
1484
|
-
const
|
|
1484
|
+
const ot = /* @__PURE__ */ new Set(["image/png", "image/jpeg", "image/jpg", "image/gif", "image/webp"]), st = /* @__PURE__ */ new Set([
|
|
1485
1485
|
"text/plain",
|
|
1486
1486
|
"text/markdown",
|
|
1487
1487
|
"text/csv",
|
|
@@ -1490,29 +1490,29 @@ const at = /* @__PURE__ */ new Set(["image/png", "image/jpeg", "image/jpg", "ima
|
|
|
1490
1490
|
"application/xml",
|
|
1491
1491
|
"text/xml"
|
|
1492
1492
|
]);
|
|
1493
|
-
function
|
|
1493
|
+
function lt(e) {
|
|
1494
1494
|
const t = (e ?? "").trim().toLowerCase().split(";")[0];
|
|
1495
|
-
return t ?
|
|
1495
|
+
return t ? ot.has(t) ? "image" : t === "application/pdf" ? "pdf" : st.has(t) ? "text" : t.startsWith("audio/") ? "audio" : "unsupported" : "unsupported";
|
|
1496
1496
|
}
|
|
1497
|
-
const g = 1024 * 1024,
|
|
1497
|
+
const g = 1024 * 1024, ct = {
|
|
1498
1498
|
image: 5 * g,
|
|
1499
1499
|
pdf: 20 * g,
|
|
1500
1500
|
text: 1 * g,
|
|
1501
1501
|
audio: 20 * g
|
|
1502
1502
|
}, Gn = 25 * g, Bn = 5;
|
|
1503
1503
|
function Hn(e, t) {
|
|
1504
|
-
const n =
|
|
1505
|
-
return n === "unsupported" ? "unsupported" : t >
|
|
1504
|
+
const n = lt(e);
|
|
1505
|
+
return n === "unsupported" ? "unsupported" : t > ct[n] ? "too-large" : null;
|
|
1506
1506
|
}
|
|
1507
|
-
function
|
|
1508
|
-
const n = new Set(e.disabledIntents ?? []), a = e.intentOverrides ?? {}, i = t.intents.filter((o) => !n.has(o.intent)).map((o) =>
|
|
1507
|
+
function ut(e, t) {
|
|
1508
|
+
const n = new Set(e.disabledIntents ?? []), a = e.intentOverrides ?? {}, i = t.intents.filter((o) => !n.has(o.intent)).map((o) => dt(o, a[o.intent]));
|
|
1509
1509
|
if (!e.extraIntents || e.extraIntents.length === 0) return i;
|
|
1510
1510
|
const r = new Set(i.map((o) => o.intent));
|
|
1511
1511
|
for (const o of e.extraIntents)
|
|
1512
1512
|
r.has(o.intent) || (i.push(o), r.add(o.intent));
|
|
1513
1513
|
return i;
|
|
1514
1514
|
}
|
|
1515
|
-
function
|
|
1515
|
+
function pt(e, t) {
|
|
1516
1516
|
const n = {};
|
|
1517
1517
|
for (const a of e.intents) {
|
|
1518
1518
|
if (!a.togglable) continue;
|
|
@@ -1522,10 +1522,10 @@ function ct(e, t) {
|
|
|
1522
1522
|
return n;
|
|
1523
1523
|
}
|
|
1524
1524
|
function jn(e, t) {
|
|
1525
|
-
const n =
|
|
1525
|
+
const n = pt(e, t);
|
|
1526
1526
|
return Object.entries(n).filter(([, a]) => !a).map(([a]) => a);
|
|
1527
1527
|
}
|
|
1528
|
-
function
|
|
1528
|
+
function dt(e, t) {
|
|
1529
1529
|
return t ? {
|
|
1530
1530
|
intent: t.intent ?? e.intent,
|
|
1531
1531
|
targetSchemes: t.targetSchemes ?? e.targetSchemes,
|
|
@@ -1538,7 +1538,7 @@ function Vn(e, t) {
|
|
|
1538
1538
|
if (!a.enabled) continue;
|
|
1539
1539
|
const i = t[a.providerId];
|
|
1540
1540
|
if (i)
|
|
1541
|
-
for (const r of
|
|
1541
|
+
for (const r of ut(a, i))
|
|
1542
1542
|
n.push({ channel: a, description: i, capability: r });
|
|
1543
1543
|
}
|
|
1544
1544
|
return n;
|
|
@@ -1546,11 +1546,11 @@ function Vn(e, t) {
|
|
|
1546
1546
|
function Fn(e, t) {
|
|
1547
1547
|
return t.filter((n) => n.capability.intent === e);
|
|
1548
1548
|
}
|
|
1549
|
-
function
|
|
1549
|
+
function ft(e, t) {
|
|
1550
1550
|
return t.filter((n) => n.capability.targetSchemes.includes(e));
|
|
1551
1551
|
}
|
|
1552
1552
|
function Xn(e, t) {
|
|
1553
|
-
return
|
|
1553
|
+
return ft(e.scheme, t);
|
|
1554
1554
|
}
|
|
1555
1555
|
function Wn(e, t, n) {
|
|
1556
1556
|
const a = [];
|
|
@@ -1559,8 +1559,8 @@ function Wn(e, t, n) {
|
|
|
1559
1559
|
r.capability.intent === t && r.capability.targetSchemes.includes(i.scheme) && a.push({ channelIntent: r, endpoint: i });
|
|
1560
1560
|
return a;
|
|
1561
1561
|
}
|
|
1562
|
-
var
|
|
1563
|
-
const
|
|
1562
|
+
var mt = /* @__PURE__ */ ((e) => (e.MAILTO = "mailto", e.SIP = "sip", e.TEL = "tel", e.WEBHOOK = "webhook", e.USERNAME = "username", e.ID = "id", e.CUSTOM = "custom", e.URL = "url", e.TELEGRAM = "telegram", e.WHATSAPP = "whatsapp", e.MESSENGER = "messenger", e.INSTAGRAM = "instagram", e.VIBER = "viber", e.SMS = "sms", e.FAX = "fax", e.TEAMS = "teams", e.CALENDAR = "calendar", e))(mt || {});
|
|
1563
|
+
const gt = {
|
|
1564
1564
|
mailto: "mail",
|
|
1565
1565
|
sip: "tel",
|
|
1566
1566
|
tel: "tel",
|
|
@@ -1583,7 +1583,7 @@ const ft = {
|
|
|
1583
1583
|
custom: "note"
|
|
1584
1584
|
};
|
|
1585
1585
|
function zn(e) {
|
|
1586
|
-
return e ?
|
|
1586
|
+
return e ? gt[e] ?? "note" : "note";
|
|
1587
1587
|
}
|
|
1588
1588
|
const Yn = "message_window", qn = "message_templates", Jn = {
|
|
1589
1589
|
// E-mail
|
|
@@ -1602,14 +1602,17 @@ const Yn = "message_window", qn = "message_templates", Jn = {
|
|
|
1602
1602
|
// Voice/conference
|
|
1603
1603
|
HOST: "host",
|
|
1604
1604
|
PARTICIPANT: "participant"
|
|
1605
|
-
}, Qn = (e, t) => ({ intent: e, ...t }), Zn = "folder_management", ei = "remote_search", ti = { ok: !1, code: "UNSUPPORTED", message: "Provider does not support this op" },
|
|
1606
|
-
function
|
|
1605
|
+
}, Qn = (e, t) => ({ intent: e, ...t }), Zn = "folder_management", ei = "remote_search", ti = { ok: !1, code: "UNSUPPORTED", message: "Provider does not support this op" }, oe = "auth";
|
|
1606
|
+
function se(e) {
|
|
1607
1607
|
const t = typeof e == "string" ? e.match(/apps\/([^/?#]+)/) : null;
|
|
1608
1608
|
return t ? t[1] : null;
|
|
1609
1609
|
}
|
|
1610
1610
|
function ni(e) {
|
|
1611
|
-
const t =
|
|
1612
|
-
return t ? t !==
|
|
1611
|
+
const t = se(e);
|
|
1612
|
+
return t ? t !== oe : typeof e == "string" && e.startsWith("/wake");
|
|
1613
|
+
}
|
|
1614
|
+
function ii(e) {
|
|
1615
|
+
return typeof e != "string" || e === "" || e === "/" ? !0 : se(e) === oe;
|
|
1613
1616
|
}
|
|
1614
1617
|
function ht(e) {
|
|
1615
1618
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -1630,7 +1633,7 @@ function bt(e, t) {
|
|
|
1630
1633
|
function At(e) {
|
|
1631
1634
|
return e.publicBasePath ?? `/apps/${e.name}`;
|
|
1632
1635
|
}
|
|
1633
|
-
function
|
|
1636
|
+
function ai(e) {
|
|
1634
1637
|
const t = [];
|
|
1635
1638
|
for (const n of e) {
|
|
1636
1639
|
if (!n?.name) continue;
|
|
@@ -1663,17 +1666,17 @@ function _t(e, t) {
|
|
|
1663
1666
|
yt(a.pattern).test(e) && (!n || Et(a.pattern, n.pattern)) && (n = a);
|
|
1664
1667
|
return n ? { ...n, params: { ...n.props, ...bt(n.pattern, e) } } : null;
|
|
1665
1668
|
}
|
|
1666
|
-
function
|
|
1669
|
+
function ri(e, t) {
|
|
1667
1670
|
return _t(e, t) !== null;
|
|
1668
1671
|
}
|
|
1669
|
-
const
|
|
1672
|
+
const oi = 9e4, si = "installation-id";
|
|
1670
1673
|
export {
|
|
1671
1674
|
m as ACTIVITY_CATALOG,
|
|
1672
|
-
|
|
1675
|
+
ct as AI_ATTACHMENT_LIMITS,
|
|
1673
1676
|
Bn as AI_ATTACHMENT_MAX_PER_TURN,
|
|
1674
1677
|
Gn as AI_ATTACHMENT_TURN_BUDGET,
|
|
1675
1678
|
ae as AI_VENDORS,
|
|
1676
|
-
|
|
1679
|
+
Se as ALLOWED_LINK_SCHEMES,
|
|
1677
1680
|
w as ARTIFACT_MAX_BLOCKS,
|
|
1678
1681
|
Vt as ARTIFACT_MAX_BODY_BYTES,
|
|
1679
1682
|
M as ARTIFACT_MAX_CELL_LEN,
|
|
@@ -1682,19 +1685,19 @@ export {
|
|
|
1682
1685
|
U as ARTIFACT_MAX_TABLE_COLUMNS,
|
|
1683
1686
|
P as ARTIFACT_MAX_TABLE_ROWS,
|
|
1684
1687
|
Q as ARTIFACT_MAX_TEXT_LEN,
|
|
1685
|
-
|
|
1686
|
-
|
|
1688
|
+
oe as AUTH_APP_NAME,
|
|
1689
|
+
me as ActivityTypeRegistry,
|
|
1687
1690
|
Dt as BUILT_IN_ONLY,
|
|
1688
1691
|
en as CLASSIFY_VARS,
|
|
1689
1692
|
Gt as CORE_DIMENSIONS,
|
|
1690
|
-
|
|
1693
|
+
mt as CommunicationScheme,
|
|
1691
1694
|
vn as DEFAULT_MEMORY_BUDGET,
|
|
1692
|
-
|
|
1695
|
+
je as DEFAULT_PHONE_REGION,
|
|
1693
1696
|
Zn as FEATURE_FOLDER_MANAGEMENT,
|
|
1694
1697
|
ei as FEATURE_REMOTE_SEARCH,
|
|
1695
|
-
|
|
1698
|
+
si as INSTALLATION_HEADER,
|
|
1696
1699
|
Jn as InteractionParticipantRole,
|
|
1697
|
-
|
|
1700
|
+
Ke as KB_FALLBACK_LOCALE,
|
|
1698
1701
|
Mt as MAX_ACTIONS,
|
|
1699
1702
|
Tt as MAX_BLOCKS,
|
|
1700
1703
|
ne as MAX_COLLECTION_DEPTH,
|
|
@@ -1703,38 +1706,38 @@ export {
|
|
|
1703
1706
|
Nn as MAX_MEMORY_BUDGET,
|
|
1704
1707
|
Mn as MAX_MEMORY_CHARS,
|
|
1705
1708
|
Cn as MIN_MEMORY_BUDGET,
|
|
1706
|
-
|
|
1709
|
+
we as PAUSED_RUN_STATUSES,
|
|
1707
1710
|
v as PHONE_REGIONS,
|
|
1708
|
-
|
|
1711
|
+
oi as PRESENCE_ONLINE_WINDOW_MS,
|
|
1709
1712
|
qn as PROVIDER_FEATURE_MESSAGE_TEMPLATES,
|
|
1710
1713
|
Yn as PROVIDER_FEATURE_MESSAGE_WINDOW,
|
|
1711
|
-
|
|
1712
|
-
|
|
1714
|
+
qe as PUBLIC_EMAIL_DOMAINS,
|
|
1715
|
+
He as RELATED_SUBJECT_KINDS,
|
|
1713
1716
|
yn as SIGNATURE_INTENTS,
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
+
rt as SUMMARY_MIN_LAST_CHARS,
|
|
1718
|
+
at as SUMMARY_MIN_MESSAGES,
|
|
1719
|
+
Re as TERMINAL_RUN_STATUSES,
|
|
1717
1720
|
Zt as TRIGGER_VARS,
|
|
1718
1721
|
ti as UNSUPPORTED,
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
+
Ee as USAGE_DIMENSIONS,
|
|
1723
|
+
_e as USAGE_DIMENSION_IDS,
|
|
1724
|
+
$e as actingIdentityKey,
|
|
1722
1725
|
Nt as activityIconOf,
|
|
1723
1726
|
wt as activityJoinUrl,
|
|
1724
|
-
|
|
1725
|
-
|
|
1727
|
+
pe as activitySnippet,
|
|
1728
|
+
de as activityTextParams,
|
|
1726
1729
|
Rt as activityTimelineText,
|
|
1727
1730
|
Kt as activityTimestamp,
|
|
1728
1731
|
f as activityTypeInfo,
|
|
1729
1732
|
an as actorKey,
|
|
1730
|
-
|
|
1733
|
+
lt as aiAttachmentKind,
|
|
1731
1734
|
Hn as aiAttachmentRejection,
|
|
1732
1735
|
hn as aiVendorAcceptsAttachment,
|
|
1733
1736
|
fn as aiVendorDefaultModel,
|
|
1734
1737
|
dn as aiVendorLabel,
|
|
1735
1738
|
gn as aiVendorNeedsBaseUrl,
|
|
1736
1739
|
mn as aiVendorsWith,
|
|
1737
|
-
|
|
1740
|
+
se as appNameFromPath,
|
|
1738
1741
|
bn as applySignature,
|
|
1739
1742
|
Xt as artifactBodyBytes,
|
|
1740
1743
|
Wt as artifactOutline,
|
|
@@ -1743,26 +1746,26 @@ export {
|
|
|
1743
1746
|
Vn as buildChannelIntents,
|
|
1744
1747
|
Yt as buildShareKeys,
|
|
1745
1748
|
cn as canNestUnder,
|
|
1746
|
-
|
|
1749
|
+
kt as carriesText,
|
|
1747
1750
|
pn as categoryLabel,
|
|
1748
1751
|
zn as channelKindForScheme,
|
|
1749
1752
|
vt as channelKindOf,
|
|
1750
1753
|
Pn as cleanMessageText,
|
|
1751
|
-
|
|
1754
|
+
Ge as defaultLocaleOf,
|
|
1752
1755
|
Qn as defineIntent,
|
|
1753
|
-
|
|
1756
|
+
Pe as depthOf,
|
|
1754
1757
|
jn as disabledIntentsFromCapabilities,
|
|
1755
1758
|
On as emailDomain,
|
|
1756
1759
|
wn as endpointKey,
|
|
1757
1760
|
bt as extractParams,
|
|
1758
1761
|
Xn as filterByEndpoint,
|
|
1759
1762
|
Fn as filterByIntent,
|
|
1760
|
-
|
|
1763
|
+
ft as filterByTargetScheme,
|
|
1761
1764
|
E as findAiVendor,
|
|
1762
1765
|
Bt as flattenLocales,
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
+
ye as floorToPeriod,
|
|
1767
|
+
Oe as formatActingIdentity,
|
|
1768
|
+
he as formatPeriod,
|
|
1766
1769
|
Ut as getActivitySeenUserIds,
|
|
1767
1770
|
An as getContactEndpoints,
|
|
1768
1771
|
In as getShortTitle,
|
|
@@ -1773,22 +1776,23 @@ export {
|
|
|
1773
1776
|
En as isAssigned,
|
|
1774
1777
|
_n as isClosed,
|
|
1775
1778
|
ni as isDeepLink,
|
|
1776
|
-
|
|
1779
|
+
Ue as isDescendant,
|
|
1777
1780
|
Sn as isInteractionUnseen,
|
|
1781
|
+
ii as isLandingPath,
|
|
1778
1782
|
Un as isLikelyBulk,
|
|
1779
1783
|
xt as isMessageType,
|
|
1780
1784
|
Et as isMoreSpecificPattern,
|
|
1781
1785
|
on as isPaused,
|
|
1782
1786
|
$t as isPlaybookAuthoredType,
|
|
1783
1787
|
$n as isPublicEmailDomain,
|
|
1784
|
-
|
|
1785
|
-
|
|
1788
|
+
ri as isPublicPath,
|
|
1789
|
+
Lt as isReplyableType,
|
|
1786
1790
|
rn as isRetryable,
|
|
1787
|
-
|
|
1791
|
+
De as isTerminal,
|
|
1788
1792
|
Kn as isThreadLongEnough,
|
|
1789
1793
|
sn as linkLabel,
|
|
1790
1794
|
un as localesOf,
|
|
1791
|
-
|
|
1795
|
+
Ln as looksLikeEmail,
|
|
1792
1796
|
Wn as matchContactToIntents,
|
|
1793
1797
|
_t as matchPublicRoute,
|
|
1794
1798
|
Ot as messageCountsAs,
|
|
@@ -1799,25 +1803,25 @@ export {
|
|
|
1799
1803
|
tn as parseActingIdentity,
|
|
1800
1804
|
yt as pathToRegex,
|
|
1801
1805
|
Ht as periodsInRange,
|
|
1802
|
-
|
|
1806
|
+
kn as phoneSuffix,
|
|
1803
1807
|
Dn as plainTextFromMarkdown,
|
|
1804
1808
|
nn as playbookActor,
|
|
1805
1809
|
At as publicBasePathFor,
|
|
1806
|
-
|
|
1810
|
+
ai as publicRoutePatterns,
|
|
1807
1811
|
C as readPath,
|
|
1808
|
-
|
|
1812
|
+
Ye as registrableDomain,
|
|
1809
1813
|
xn as relatedByDefault,
|
|
1810
|
-
|
|
1814
|
+
pt as resolveAccountCapabilities,
|
|
1811
1815
|
N as resolveActivityText,
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1816
|
+
ut as resolveChannelIntents,
|
|
1817
|
+
Be as resolveSignature,
|
|
1818
|
+
ve as sanitizeInline,
|
|
1815
1819
|
te as shareKeyForTeam,
|
|
1816
1820
|
ee as shareKeyForUser,
|
|
1817
1821
|
qt as shareKeysForViewer,
|
|
1818
|
-
|
|
1822
|
+
ue as stripHtml,
|
|
1819
1823
|
F as toE164,
|
|
1820
1824
|
Jt as toolSourceKinds,
|
|
1821
|
-
|
|
1825
|
+
Te as usageMetricId,
|
|
1822
1826
|
jt as usageMetrics
|
|
1823
1827
|
};
|
|
@@ -59,6 +59,20 @@ export declare function appNameFromPath(path: string | null | undefined): string
|
|
|
59
59
|
* and `WakeRoute` routes onward itself.
|
|
60
60
|
*/
|
|
61
61
|
export declare function isDeepLink(path: string | null | undefined): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Did the visitor ask for nothing in particular?
|
|
64
|
+
*
|
|
65
|
+
* True for the bare root and for the login screen — you are sent there, you do
|
|
66
|
+
* not go there. Everything else is a request, whether or not it names an app.
|
|
67
|
+
*
|
|
68
|
+
* This is **not** the complement of {@link isDeepLink}. That one answers "does
|
|
69
|
+
* this path name an app other than auth", so a public help page — which names
|
|
70
|
+
* no app at all — comes back false. Callers that read that false as "the user
|
|
71
|
+
* wanted nothing" sent readers of `/help/…` to the organisation's default app.
|
|
72
|
+
* Between the two lies the set of paths that might be public, and the only way
|
|
73
|
+
* to know is to wait for the app manifests.
|
|
74
|
+
*/
|
|
75
|
+
export declare function isLandingPath(path: string | null | undefined): boolean;
|
|
62
76
|
/** Turn a route pattern with `:param` segments into an exact-match regex. */
|
|
63
77
|
export declare function pathToRegex(path: string): RegExp;
|
|
64
78
|
/** Read the `:param` values out of a concrete path, given the pattern it matched. */
|