diff --git "a/.output/public/assets/mermaid-BDMIxShI.js" "b/.output/public/assets/mermaid-BDMIxShI.js" new file mode 100644--- /dev/null +++ "b/.output/public/assets/mermaid-BDMIxShI.js" @@ -0,0 +1,2171 @@ +import{d as t,a as e,b as i,c as r}from"./dayjs-Cbdj87rt.js";import{d as n}from"./@braintree-DgpeZQRe.js";import"./d3-transition-swcnLnsT.js";import"./d3-zoom-D4Vc87xO.js";import{p as s}from"./dompurify-B5jhUdWW.js";import{G as a,l as o,a as l,r as h,b as d,w as u,i as p,c as g}from"./dagre-d3-es-FtH4B9px.js";import{E as y}from"./elkjs-BAetzGHm.js";import{d as f,e as m}from"./d3-selection-G65jBFUY.js";import{s as b,a as x,b as k,d as _,m as C,e as T,f as E,c as v,g as S,h as w,i as A,j as B,k as L,n as D,o as I,p as O,q as $,r as N,t as F,u as R,v as M,w as P,l as z}from"./d3-shape-C1TbtrGg.js";import{a as j,i as Y,r as W,d as U,l as q,b as V}from"./khroma-Ca6ZlOUT.js";import{_ as H}from"./@wdns-DMlS5Imi.js";import{d as G}from"./ts-dedent-CttZBlkd.js";import{F as X,d as K}from"./lodash-es-BkU_-LF8.js";import{s as Q,c as Z,a as J}from"./stylis-Cl7w7uv3.js";import{t as tt,l as et,o as it}from"./d3-scale-CjTvl_Qo.js";import{m as rt,e as nt}from"./d3-array-B0evfIyH.js";import{g as st}from"./d3-interpolate-Ct9kki6l.js";import{a as at,b as ot}from"./d3-axis-pCwzqJ1S.js";import{t as lt}from"./d3-time-format-D74OpZq4.js";import{d as ct,c as ht,b as dt,a as ut,t as pt}from"./d3-time-CebKitJR.js";import{c as gt}from"./cytoscape-B1WqMhz1.js";import{c as yt}from"./cytoscape-cose-bilkent-CcQu5e-H.js";const ft=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const mt=[];for(let c=0;c<256;++c)mt.push((c+256).toString(16).slice(1));function bt(t){if(!function(t){return"string"==typeof t&&ft.test(t)}(t))throw TypeError("Invalid UUID");let e;const i=new Uint8Array(16);return i[0]=(e=parseInt(t.slice(0,8),16))>>>24,i[1]=e>>>16&255,i[2]=e>>>8&255,i[3]=255&e,i[4]=(e=parseInt(t.slice(9,13),16))>>>8,i[5]=255&e,i[6]=(e=parseInt(t.slice(14,18),16))>>>8,i[7]=255&e,i[8]=(e=parseInt(t.slice(19,23),16))>>>8,i[9]=255&e,i[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,i[11]=e/4294967296&255,i[12]=e>>>24&255,i[13]=e>>>16&255,i[14]=e>>>8&255,i[15]=255&e,i}function xt(t,e,i,r){switch(t){case 0:return e&i^~e&r;case 1:case 3:return e^i^r;case 2:return e&i^e&r^i&r}}function kt(t,e){return t<>>32-e}const _t=function(t,e,i){function r(t,r,n,s){var a;if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));const e=[];for(let i=0;i>>0;c=l,l=o,o=kt(n,30)>>>0,n=r,r=a}i[0]=i[0]+r>>>0,i[1]=i[1]+n>>>0,i[2]=i[2]+o>>>0,i[3]=i[3]+l>>>0,i[4]=i[4]+c>>>0}return[i[0]>>24&255,i[0]>>16&255,i[0]>>8&255,255&i[0],i[1]>>24&255,i[1]>>16&255,i[1]>>8&255,255&i[1],i[2]>>24&255,i[2]>>16&255,i[2]>>8&255,255&i[2],i[3]>>24&255,i[3]>>16&255,i[3]>>8&255,255&i[3],i[4]>>24&255,i[4]>>16&255,i[4]>>8&255,255&i[4]]})),Ct={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},Tt={trace:(...t)=>{},debug:(...t)=>{},info:(...t)=>{},warn:(...t)=>{},error:(...t)=>{},fatal:(...t)=>{}},Et=function(t="fatal"){let e=Ct.fatal;"string"==typeof t?(t=t.toLowerCase())in Ct&&(e=Ct[t]):"number"==typeof t&&(e=t),Tt.trace=()=>{},Tt.debug=()=>{},Tt.info=()=>{},Tt.warn=()=>{},Tt.error=()=>{},Tt.fatal=()=>{},e<=Ct.fatal&&(Tt.fatal=(console.error,function(){}.bind())),e<=Ct.error&&(Tt.error=(console.error,function(){}.bind())),e<=Ct.warn&&(Tt.warn=(console.warn,function(){}.bind())),e<=Ct.info&&(Tt.info=(console.info,function(){}.bind())),e<=Ct.debug&&(Tt.debug=(console.debug,function(){}.bind())),e<=Ct.trace&&(Tt.trace=(console.debug,function(){}.bind()))},vt=t=>s.sanitize(t),St=(t,e)=>{var i;if(!1!==(null==(i=e.flowchart)?void 0:i.htmlLabels)){const i=e.securityLevel;"antiscript"===i||"strict"===i?t=vt(t):"loose"!==i&&(t=(t=(t=Lt(t)).replace(//g,">")).replace(/=/g,"="),t=Bt(t))}return t},wt=(t,e)=>t?t=e.dompurifyConfig?s.sanitize(St(t,e),e.dompurifyConfig).toString():s.sanitize(St(t,e),{FORBID_TAGS:["style"]}).toString():t,At=//gi,Bt=t=>t.replace(/#br#/g,"
"),Lt=t=>t.replace(At,"#br#"),Dt=t=>!1!==t&&!["false","null","0"].includes(String(t).trim().toLowerCase()),It=function(t){let e=t;if(t.split("~").length-1>=2){let t=e;do{e=t,t=e.replace(/~([^\s,:;]+)~/,"<$1>")}while(t!=e);return It(t)}return e},Ot={getRows:t=>{if(!t)return[""];return Lt(t).replace(/\\n/g,"#br#").split("#br#")},sanitizeText:wt,sanitizeTextOrArray:(t,e)=>"string"==typeof t?wt(t,e):t.flat().map((t=>wt(t,e))),hasBreaks:t=>At.test(t),splitBreaks:t=>t.split(At),lineBreakRegex:At,removeScript:vt,getUrl:t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=e.replaceAll(/\(/g,"\\("),e=e.replaceAll(/\)/g,"\\)")),e},evaluate:Dt},$t=(t,e)=>j(t,e?{s:-40,l:10}:{s:-40,l:-10}),Nt="#ffffff",Ft="#f2f2f2";let Rt=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||j(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||j(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||$t(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||$t(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||$t(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||$t(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Y(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Y(this.tertiaryColor),this.lineColor=this.lineColor||Y(this.background),this.textColor=this.textColor||this.primaryTextColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?U(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||"grey",this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||U(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Y(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||q(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||j(this.primaryColor,{h:30}),this.cScale4=this.cScale4||j(this.primaryColor,{h:60}),this.cScale5=this.cScale5||j(this.primaryColor,{h:90}),this.cScale6=this.cScale6||j(this.primaryColor,{h:120}),this.cScale7=this.cScale7||j(this.primaryColor,{h:150}),this.cScale8=this.cScale8||j(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||j(this.primaryColor,{h:270}),this.cScale10=this.cScale10||j(this.primaryColor,{h:300}),this.cScale11=this.cScale11||j(this.primaryColor,{h:330}),this.darkMode)for(let e=0;e{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}};let Mt=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=q(this.primaryColor,16),this.tertiaryColor=j(this.primaryColor,{h:-160}),this.primaryBorderColor=Y(this.background),this.secondaryBorderColor=$t(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=$t(this.tertiaryColor,this.darkMode),this.primaryTextColor=Y(this.primaryColor),this.secondaryTextColor=Y(this.secondaryColor),this.tertiaryTextColor=Y(this.tertiaryColor),this.lineColor=Y(this.background),this.textColor=Y(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=q(Y("#323D47"),10),this.lineColor="calculated",this.border1="#81B1DB",this.border2=W(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.sectionBkgColor=U("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.taskBorderColor=W(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=W(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.personBorder="calculated",this.personBkg="calculated",this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){this.secondBkg=q(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=q(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.mainContrastColor,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=q(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=this.darkTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=j(this.primaryColor,{h:64}),this.fillType3=j(this.secondaryColor,{h:64}),this.fillType4=j(this.primaryColor,{h:-64}),this.fillType5=j(this.secondaryColor,{h:-64}),this.fillType6=j(this.primaryColor,{h:128}),this.fillType7=j(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||j(this.primaryColor,{h:30}),this.cScale4=this.cScale4||j(this.primaryColor,{h:60}),this.cScale5=this.cScale5||j(this.primaryColor,{h:90}),this.cScale6=this.cScale6||j(this.primaryColor,{h:120}),this.cScale7=this.cScale7||j(this.primaryColor,{h:150}),this.cScale8=this.cScale8||j(this.primaryColor,{h:210}),this.cScale9=this.cScale9||j(this.primaryColor,{h:270}),this.cScale10=this.cScale10||j(this.primaryColor,{h:300}),this.cScale11=this.cScale11||j(this.primaryColor,{h:330});for(let t=0;t{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}};let Pt=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=j(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=j(this.primaryColor,{h:-160}),this.primaryBorderColor=$t(this.primaryColor,this.darkMode),this.secondaryBorderColor=$t(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=$t(this.tertiaryColor,this.darkMode),this.primaryTextColor=Y(this.primaryColor),this.secondaryTextColor=Y(this.secondaryColor),this.tertiaryTextColor=Y(this.tertiaryColor),this.lineColor=Y(this.background),this.textColor=Y(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#e8e8e8",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="grey",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.sectionBkgColor=W(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.personBorder="calculated",this.personBkg="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||j(this.primaryColor,{h:30}),this.cScale4=this.cScale4||j(this.primaryColor,{h:60}),this.cScale5=this.cScale5||j(this.primaryColor,{h:90}),this.cScale6=this.cScale6||j(this.primaryColor,{h:120}),this.cScale7=this.cScale7||j(this.primaryColor,{h:150}),this.cScale8=this.cScale8||j(this.primaryColor,{h:210}),this.cScale9=this.cScale9||j(this.primaryColor,{h:270}),this.cScale10=this.cScale10||j(this.primaryColor,{h:300}),this.cScale11=this.cScale11||j(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||U(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||U(this.tertiaryColor,40);for(let t=0;t{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}};let zt=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=q("#cde498",10),this.primaryBorderColor=$t(this.primaryColor,this.darkMode),this.secondaryBorderColor=$t(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=$t(this.tertiaryColor,this.darkMode),this.primaryTextColor=Y(this.primaryColor),this.secondaryTextColor=Y(this.secondaryColor),this.tertiaryTextColor=Y(this.primaryColor),this.lineColor=Y(this.background),this.textColor=Y(this.background),this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="grey",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.personBorder="calculated",this.personBkg="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||j(this.primaryColor,{h:30}),this.cScale4=this.cScale4||j(this.primaryColor,{h:60}),this.cScale5=this.cScale5||j(this.primaryColor,{h:90}),this.cScale6=this.cScale6||j(this.primaryColor,{h:120}),this.cScale7=this.cScale7||j(this.primaryColor,{h:150}),this.cScale8=this.cScale8||j(this.primaryColor,{h:210}),this.cScale9=this.cScale9||j(this.primaryColor,{h:270}),this.cScale10=this.cScale10||j(this.primaryColor,{h:300}),this.cScale11=this.cScale11||j(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||U(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||U(this.tertiaryColor,40);for(let t=0;t{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}};class jt{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=q(this.contrast,55),this.background="#ffffff",this.tertiaryColor=j(this.primaryColor,{h:-160}),this.primaryBorderColor=$t(this.primaryColor,this.darkMode),this.secondaryBorderColor=$t(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=$t(this.tertiaryColor,this.darkMode),this.primaryTextColor=Y(this.primaryColor),this.secondaryTextColor=Y(this.secondaryColor),this.tertiaryTextColor=Y(this.tertiaryColor),this.lineColor=Y(this.background),this.textColor=Y(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.personBorder="calculated",this.personBkg="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.secondBkg=q(this.contrast,55),this.border2=this.contrast,this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let t=0;t{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}}const Yt={base:{getThemeVariables:t=>{const e=new Rt;return e.calculate(t),e}},dark:{getThemeVariables:t=>{const e=new Mt;return e.calculate(t),e}},default:{getThemeVariables:t=>{const e=new Pt;return e.calculate(t),e}},forest:{getThemeVariables:t=>{const e=new zt;return e.calculate(t),e}},neutral:{getThemeVariables:t=>{const e=new jt;return e.calculate(t),e}}},Wt={ +/** + * Theme , the CSS style sheet + * + * | Parameter | Description | Type | Required | Values | + * | --------- | --------------- | ------ | -------- | ---------------------------------------------- | + * | theme | Built in Themes | string | Optional | 'default', 'forest', 'dark', 'neutral', 'null' | + * + * **Notes:** To disable any pre-defined mermaid theme, use "null". + * + * @example + * + * ```js + * { + * "theme": "forest", + * "themeCSS": ".node rect { fill: red; }" + * } + * ``` + */ +theme:"default",themeVariables:Yt.default.getThemeVariables(),themeCSS:void 0, +/* **maxTextSize** - The maximum allowed size of the users text diagram */ +maxTextSize:5e4,darkMode:!1, +/** + * | Parameter | Description | Type | Required | Values | + * | ---------- | ------------------------------------------------------ | ------ | -------- | --------------------------- | + * | fontFamily | specifies the font to be used in the rendered diagrams | string | Required | Any Possible CSS FontFamily | + * + * **Notes:** Default value: '"trebuchet ms", verdana, arial, sans-serif;'. + */ +fontFamily:'"trebuchet ms", verdana, arial, sans-serif;', +/** + * | Parameter | Description | Type | Required | Values | + * | --------- | ----------------------------------------------------- | ---------------- | -------- | --------------------------------------------- | + * | logLevel | This option decides the amount of logging to be used. | string \| number | Required | 'trace','debug','info','warn','error','fatal' | + * + * **Notes:** + * + * - Trace: 0 + * - Debug: 1 + * - Info: 2 + * - Warn: 3 + * - Error: 4 + * - Fatal: 5 (default) + */ +logLevel:5, +/** + * | Parameter | Description | Type | Required | Values | + * | ------------- | --------------------------------- | ------ | -------- | ------------------------------------------ | + * | securityLevel | Level of trust for parsed diagram | string | Required | 'sandbox', 'strict', 'loose', 'antiscript' | + * + * **Notes**: + * + * - **strict**: (**default**) tags in text are encoded, click functionality is disabled + * - **loose**: tags in text are allowed, click functionality is enabled + * - **antiscript**: html tags in text are allowed, (only script element is removed), click + * functionality is enabled + * - **sandbox**: With this security level all rendering takes place in a sandboxed iframe. This + * prevent any JavaScript from running in the context. This may hinder interactive functionality + * of the diagram like scripts, popups in sequence diagram or links to other tabs/targets etc. + */ +securityLevel:"strict", +/** + * | Parameter | Description | Type | Required | Values | + * | ----------- | -------------------------------------------- | ------- | -------- | ----------- | + * | startOnLoad | Dictates whether mermaid starts on Page load | boolean | Required | true, false | + * + * **Notes:** Default value: true + */ +startOnLoad:!0, +/** + * | Parameter | Description | Type | Required | Values | + * | ------------------- | ---------------------------------------------------------------------------- | ------- | -------- | ----------- | + * | arrowMarkerAbsolute | Controls whether or arrow markers in html code are absolute paths or anchors | boolean | Required | true, false | + * + * **Notes**: + * + * This matters if you are using base tag settings. + * + * Default value: false + */ +arrowMarkerAbsolute:!1, +/** + * This option controls which currentConfig keys are considered _secure_ and can only be changed + * via call to mermaidAPI.initialize. Calls to mermaidAPI.reinitialize cannot make changes to the + * `secure` keys in the current currentConfig. This prevents malicious graph directives from + * overriding a site's default security. + * + * **Notes**: + * + * Default value: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'] + */ +secure:["secure","securityLevel","startOnLoad","maxTextSize"], +/** + * This option controls if the generated ids of nodes in the SVG are generated randomly or based + * on a seed. If set to false, the IDs are generated based on the current date and thus are not + * deterministic. This is the default behavior. + * + * **Notes**: + * + * This matters if your files are checked into source control e.g. git and should not change unless + * content is changed. + * + * Default value: false + */ +deterministicIds:!1, +/** + * This option is the optional seed for deterministic ids. if set to undefined but + * deterministicIds is true, a simple number iterator is used. You can set this attribute to base + * the seed on a static string. + */ +deterministicIDSeed:void 0, +/** The object containing configurations specific for flowcharts */ +flowchart:{ +/** + * ### titleTopMargin + * + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------------------------------- | ------- | -------- | ------------------ | + * | titleTopMargin | Margin top for the text over the flowchart | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 25 + */ +titleTopMargin:25, +/** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ----------------------------------------------- | ------- | -------- | ------------------ | + * | diagramPadding | Amount of padding around the diagram as a whole | Integer | Required | Any Positive Value | + * + * **Notes:** + * + * The amount of padding around the diagram as a whole so that embedded diagrams have margins, + * expressed in pixels + * + * Default value: 8 + */ +diagramPadding:8, +/** + * | Parameter | Description | Type | Required | Values | + * | ---------- | -------------------------------------------------------------------------------------------- | ------- | -------- | ----------- | + * | htmlLabels | Flag for setting whether or not a html tag should be used for rendering labels on the edges. | boolean | Required | true, false | + * + * **Notes:** Default value: true. + */ +htmlLabels:!0, +/** + * | Parameter | Description | Type | Required | Values | + * | ----------- | --------------------------------------------------- | ------- | -------- | ------------------- | + * | nodeSpacing | Defines the spacing between nodes on the same level | Integer | Required | Any positive Number | + * + * **Notes:** + * + * Pertains to horizontal spacing for TB (top to bottom) or BT (bottom to top) graphs, and the + * vertical spacing for LR as well as RL graphs.** + * + * Default value: 50 + */ +nodeSpacing:50, +/** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------------------------------------------------- | ------- | -------- | ------------------- | + * | rankSpacing | Defines the spacing between nodes on different levels | Integer | Required | Any Positive Number | + * + * **Notes**: + * + * Pertains to vertical spacing for TB (top to bottom) or BT (bottom to top), and the horizontal + * spacing for LR as well as RL graphs. + * + * Default value 50 + */ +rankSpacing:50, +/** + * | Parameter | Description | Type | Required | Values | + * | --------- | -------------------------------------------------- | ------ | -------- | ----------------------------- | + * | curve | Defines how mermaid renders curves for flowcharts. | string | Required | 'basis', 'linear', 'cardinal' | + * + * **Notes:** + * + * Default Value: 'basis' + */ +curve:"basis", +// Only used in new experimental rendering +// represents the padding between the labels and the shape +padding:15, +/** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See notes | boolean | 4 | true, false | + * + * **Notes:** + * + * When this flag is set the height and width is set to 100% and is then scaling with the + * available space if not the absolute space required is used. + * + * Default value: true + */ +useMaxWidth:!0, +/** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ----------- | ------- | -------- | ----------------------- | + * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper, elk | + * + * **Notes:** + * + * Decides which rendering engine that is to be used for the rendering. Legal values are: + * dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid, elk for layout using + * elkjs + * + * Default value: 'dagre-wrapper' + */ +defaultRenderer:"dagre-wrapper"}, +/** The object containing configurations specific for sequence diagrams */ +sequence:{hideUnusedParticipants:!1, +/** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ---------------------------- | ------- | -------- | ------------------ | + * | activationWidth | Width of the activation rect | Integer | Required | Any Positive Value | + * + * **Notes:** Default value :10 + */ +activationWidth:10, +/** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------------------------------------- | ------- | -------- | ------------------ | + * | diagramMarginX | Margin to the right and left of the sequence diagram | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 50 + */ +diagramMarginX:50, +/** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ------------------------------------------------- | ------- | -------- | ------------------ | + * | diagramMarginY | Margin to the over and under the sequence diagram | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ +diagramMarginY:10, +/** + * | Parameter | Description | Type | Required | Values | + * | ----------- | --------------------- | ------- | -------- | ------------------ | + * | actorMargin | Margin between actors | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 50 + */ +actorMargin:50, +/** + * | Parameter | Description | Type | Required | Values | + * | --------- | -------------------- | ------- | -------- | ------------------ | + * | width | Width of actor boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 150 + */ +width:150, +/** + * | Parameter | Description | Type | Required | Values | + * | --------- | --------------------- | ------- | -------- | ------------------ | + * | height | Height of actor boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 65 + */ +height:65, +/** + * | Parameter | Description | Type | Required | Values | + * | --------- | ------------------------ | ------- | -------- | ------------------ | + * | boxMargin | Margin around loop boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ +boxMargin:10, +/** + * | Parameter | Description | Type | Required | Values | + * | ------------- | -------------------------------------------- | ------- | -------- | ------------------ | + * | boxTextMargin | Margin around the text in loop/alt/opt boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 5 + */ +boxTextMargin:5, +/** + * | Parameter | Description | Type | Required | Values | + * | ---------- | ------------------- | ------- | -------- | ------------------ | + * | noteMargin | margin around notes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ +noteMargin:10, +/** + * | Parameter | Description | Type | Required | Values | + * | ------------- | ---------------------- | ------- | -------- | ------------------ | + * | messageMargin | Space between messages | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 35 + */ +messageMargin:35, +/** + * | Parameter | Description | Type | Required | Values | + * | ------------ | --------------------------- | ------ | -------- | ------------------------- | + * | messageAlign | Multiline message alignment | string | Required | 'left', 'center', 'right' | + * + * **Notes:** Default value: 'center' + */ +messageAlign:"center", +/** + * | Parameter | Description | Type | Required | Values | + * | ------------ | --------------------------- | ------- | -------- | ----------- | + * | mirrorActors | Mirror actors under diagram | boolean | Required | true, false | + * + * **Notes:** Default value: true + */ +mirrorActors:!0, +/** + * | Parameter | Description | Type | Required | Values | + * | ---------- | ----------------------------------------------------------------------- | ------- | -------- | ----------- | + * | forceMenus | forces actor popup menus to always be visible (to support E2E testing). | Boolean | Required | True, False | + * + * **Notes:** + * + * Default value: false. + */ +forceMenus:!1, +/** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ------------------------------------------ | ------- | -------- | ------------------ | + * | bottomMarginAdj | Prolongs the edge of the diagram downwards | Integer | Required | Any Positive Value | + * + * **Notes:** + * + * Depending on css styling this might need adjustment. + * + * Default value: 1 + */ +bottomMarginAdj:1, +/** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See Notes | boolean | Required | true, false | + * + * **Notes:** When this flag is set to true, the height and width is set to 100% and is then + * scaling with the available space. If set to false, the absolute space required is used. + * + * Default value: true + */ +useMaxWidth:!0, +/** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ------------------------------------ | ------- | -------- | ----------- | + * | rightAngles | display curve arrows as right angles | boolean | Required | true, false | + * + * **Notes:** + * + * This will display arrows that start and begin at the same node as right angles, rather than a + * curve + * + * Default value: false + */ +rightAngles:!1, +/** + * | Parameter | Description | Type | Required | Values | + * | ------------------- | ------------------------------- | ------- | -------- | ----------- | + * | showSequenceNumbers | This will show the node numbers | boolean | Required | true, false | + * + * **Notes:** Default value: false + */ +showSequenceNumbers:!1, +/** + * | Parameter | Description | Type | Required | Values | + * | ------------- | -------------------------------------------------- | ------- | -------- | ------------------ | + * | actorFontSize | This sets the font size of the actor's description | Integer | Require | Any Positive Value | + * + * **Notes:** **Default value 14**.. + */ +actorFontSize:14, +/** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ---------------------------------------------------- | ------ | -------- | --------------------------- | + * | actorFontFamily | This sets the font family of the actor's description | string | Required | Any Possible CSS FontFamily | + * + * **Notes:** Default value: "'Open Sans", sans-serif' + */ +actorFontFamily:'"Open Sans", sans-serif', +/** + * This sets the font weight of the actor's description + * + * **Notes:** Default value: 400. + */ +actorFontWeight:400, +/** + * | Parameter | Description | Type | Required | Values | + * | ------------ | ----------------------------------------------- | ------- | -------- | ------------------ | + * | noteFontSize | This sets the font size of actor-attached notes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 14 + */ +noteFontSize:14, +/** + * | Parameter | Description | Type | Required | Values | + * | -------------- | -------------------------------------------------- | ------ | -------- | --------------------------- | + * | noteFontFamily | This sets the font family of actor-attached notes. | string | Required | Any Possible CSS FontFamily | + * + * **Notes:** Default value: ''"trebuchet ms", verdana, arial, sans-serif' + */ +noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif', +/** + * This sets the font weight of the note's description + * + * **Notes:** Default value: 400 + */ +noteFontWeight:400, +/** + * | Parameter | Description | Type | Required | Values | + * | --------- | ---------------------------------------------------- | ------ | -------- | ------------------------- | + * | noteAlign | This sets the text alignment of actor-attached notes | string | required | 'left', 'center', 'right' | + * + * **Notes:** Default value: 'center' + */ +noteAlign:"center", +/** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ----------------------------------------- | ------- | -------- | ------------------- | + * | messageFontSize | This sets the font size of actor messages | Integer | Required | Any Positive Number | + * + * **Notes:** Default value: 16 + */ +messageFontSize:16, +/** + * | Parameter | Description | Type | Required | Values | + * | ----------------- | ------------------------------------------- | ------ | -------- | --------------------------- | + * | messageFontFamily | This sets the font family of actor messages | string | Required | Any Possible CSS FontFamily | + * + * **Notes:** Default value: '"trebuchet ms", verdana, arial, sans-serif' + */ +messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif', +/** + * This sets the font weight of the message's description + * + * **Notes:** Default value: 400. + */ +messageFontWeight:400, +/** + * This sets the auto-wrap state for the diagram + * + * **Notes:** Default value: false. + */ +wrap:!1, +/** + * This sets the auto-wrap padding for the diagram (sides only) + * + * **Notes:** Default value: 0. + */ +wrapPadding:10, +/** + * This sets the width of the loop-box (loop, alt, opt, par) + * + * **Notes:** Default value: 50. + */ +labelBoxWidth:50, +/** + * This sets the height of the loop-box (loop, alt, opt, par) + * + * **Notes:** Default value: 20. + */ +labelBoxHeight:20,messageFont:function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},noteFont:function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},actorFont:function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}}}, +/** The object containing configurations specific for gantt diagrams */ +gantt:{ +/** + * ### titleTopMargin + * + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------------------------------- | ------- | -------- | ------------------ | + * | titleTopMargin | Margin top for the text over the gantt diagram | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 25 + */ +titleTopMargin:25, +/** + * | Parameter | Description | Type | Required | Values | + * | --------- | ----------------------------------- | ------- | -------- | ------------------ | + * | barHeight | The height of the bars in the graph | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 20 + */ +barHeight:20, +/** + * | Parameter | Description | Type | Required | Values | + * | --------- | ---------------------------------------------------------------- | ------- | -------- | ------------------ | + * | barGap | The margin between the different activities in the gantt diagram | Integer | Optional | Any Positive Value | + * + * **Notes:** Default value: 4 + */ +barGap:4, +/** + * | Parameter | Description | Type | Required | Values | + * | ---------- | -------------------------------------------------------------------------- | ------- | -------- | ------------------ | + * | topPadding | Margin between title and gantt diagram and between axis and gantt diagram. | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 50 + */ +topPadding:50, +/** + * | Parameter | Description | Type | Required | Values | + * | ------------ | ----------------------------------------------------------------------- | ------- | -------- | ------------------ | + * | rightPadding | The space allocated for the section name to the right of the activities | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 75 + */ +rightPadding:75, +/** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ---------------------------------------------------------------------- | ------- | -------- | ------------------ | + * | leftPadding | The space allocated for the section name to the left of the activities | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 75 + */ +leftPadding:75, +/** + * | Parameter | Description | Type | Required | Values | + * | -------------------- | -------------------------------------------- | ------- | -------- | ------------------ | + * | gridLineStartPadding | Vertical starting position of the grid lines | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 35 + */ +gridLineStartPadding:35, +/** + * | Parameter | Description | Type | Required | Values | + * | --------- | ----------- | ------- | -------- | ------------------ | + * | fontSize | Font size | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 11 + */ +fontSize:11, +/** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ---------------------- | ------- | -------- | ------------------ | + * | sectionFontSize | Font size for sections | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 11 + */ +sectionFontSize:11, +/** + * | Parameter | Description | Type | Required | Values | + * | ------------------- | ---------------------------------------- | ------- | -------- | ------------------ | + * | numberSectionStyles | The number of alternating section styles | Integer | 4 | Any Positive Value | + * + * **Notes:** Default value: 4 + */ +numberSectionStyles:4, +/** + * | Parameter | Description | Type | Required | Values | + * | ---------- | ---------------------------- | ---- | -------- | ---------------- | + * | axisFormat | Date/time format of the axis | 3 | Required | Date in yy-mm-dd | + * + * **Notes:** + * + * This might need adjustment to match your locale and preferences + * + * Default value: '%Y-%m-%d'. + */ +axisFormat:"%Y-%m-%d", +/** + * | Parameter | Description | Type | Required | Values | + * | ------------ | ------------| ------ | -------- | ------- | + * | tickInterval | axis ticks | string | Optional | string | + * + * **Notes:** + * + * Pattern is /^([1-9][0-9]*)(minute|hour|day|week|month)$/ + * + * Default value: undefined + */ +tickInterval:void 0, +/** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See notes | boolean | 4 | true, false | + * + * **Notes:** + * + * When this flag is set the height and width is set to 100% and is then scaling with the + * available space if not the absolute space required is used. + * + * Default value: true + */ +useMaxWidth:!0, +/** + * | Parameter | Description | Type | Required | Values | + * | --------- | ----------- | ------- | -------- | ----------- | + * | topAxis | See notes | Boolean | 4 | True, False | + * + * **Notes:** when this flag is set date labels will be added to the top of the chart + * + * **Default value false**. + */ +topAxis:!1,useWidth:void 0}, +/** The object containing configurations specific for journey diagrams */ +journey:{ +/** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------------------------------------- | ------- | -------- | ------------------ | + * | diagramMarginX | Margin to the right and left of the sequence diagram | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 50 + */ +diagramMarginX:50, +/** + * | Parameter | Description | Type | Required | Values | + * | -------------- | -------------------------------------------------- | ------- | -------- | ------------------ | + * | diagramMarginY | Margin to the over and under the sequence diagram. | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ +diagramMarginY:10, +/** + * | Parameter | Description | Type | Required | Values | + * | ----------- | --------------------- | ------- | -------- | ------------------ | + * | actorMargin | Margin between actors | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 50 + */ +leftMargin:150, +/** + * | Parameter | Description | Type | Required | Values | + * | --------- | -------------------- | ------- | -------- | ------------------ | + * | width | Width of actor boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 150 + */ +width:150, +/** + * | Parameter | Description | Type | Required | Values | + * | --------- | --------------------- | ------- | -------- | ------------------ | + * | height | Height of actor boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 65 + */ +height:50, +/** + * | Parameter | Description | Type | Required | Values | + * | --------- | ------------------------ | ------- | -------- | ------------------ | + * | boxMargin | Margin around loop boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ +boxMargin:10, +/** + * | Parameter | Description | Type | Required | Values | + * | ------------- | -------------------------------------------- | ------- | -------- | ------------------ | + * | boxTextMargin | Margin around the text in loop/alt/opt boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 5 + */ +boxTextMargin:5, +/** + * | Parameter | Description | Type | Required | Values | + * | ---------- | ------------------- | ------- | -------- | ------------------ | + * | noteMargin | Margin around notes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ +noteMargin:10, +/** + * | Parameter | Description | Type | Required | Values | + * | ------------- | ----------------------- | ------- | -------- | ------------------ | + * | messageMargin | Space between messages. | Integer | Required | Any Positive Value | + * + * **Notes:** + * + * Space between messages. + * + * Default value: 35 + */ +messageMargin:35, +/** + * | Parameter | Description | Type | Required | Values | + * | ------------ | --------------------------- | ---- | -------- | ------------------------- | + * | messageAlign | Multiline message alignment | 3 | 4 | 'left', 'center', 'right' | + * + * **Notes:** Default value: 'center' + */ +messageAlign:"center", +/** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ------------------------------------------ | ------- | -------- | ------------------ | + * | bottomMarginAdj | Prolongs the edge of the diagram downwards | Integer | 4 | Any Positive Value | + * + * **Notes:** + * + * Depending on css styling this might need adjustment. + * + * Default value: 1 + */ +bottomMarginAdj:1, +/** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See notes | boolean | 4 | true, false | + * + * **Notes:** + * + * When this flag is set the height and width is set to 100% and is then scaling with the + * available space if not the absolute space required is used. + * + * Default value: true + */ +useMaxWidth:!0, +/** + * | Parameter | Description | Type | Required | Values | + * | ----------- | --------------------------------- | ---- | -------- | ----------- | + * | rightAngles | Curved Arrows become Right Angles | 3 | 4 | true, false | + * + * **Notes:** + * + * This will display arrows that start and begin at the same node as right angles, rather than a + * curves + * + * Default value: false + */ +rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50, +// width of activation box +activationWidth:10, +// text placement as: tspan | fo | old only text as before +textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"]}, +/** The object containing configurations specific for timeline diagrams */ +timeline:{ +/** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------------------------------------- | ------- | -------- | ------------------ | + * | diagramMarginX | Margin to the right and left of the sequence diagram | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 50 + */ +diagramMarginX:50, +/** + * | Parameter | Description | Type | Required | Values | + * | -------------- | -------------------------------------------------- | ------- | -------- | ------------------ | + * | diagramMarginY | Margin to the over and under the sequence diagram. | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ +diagramMarginY:10, +/** + * | Parameter | Description | Type | Required | Values | + * | ----------- | --------------------- | ------- | -------- | ------------------ | + * | actorMargin | Margin between actors | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 50 + */ +leftMargin:150, +/** + * | Parameter | Description | Type | Required | Values | + * | --------- | -------------------- | ------- | -------- | ------------------ | + * | width | Width of actor boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 150 + */ +width:150, +/** + * | Parameter | Description | Type | Required | Values | + * | --------- | --------------------- | ------- | -------- | ------------------ | + * | height | Height of actor boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 65 + */ +height:50, +/** + * | Parameter | Description | Type | Required | Values | + * | --------- | ------------------------ | ------- | -------- | ------------------ | + * | boxMargin | Margin around loop boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ +boxMargin:10, +/** + * | Parameter | Description | Type | Required | Values | + * | ------------- | -------------------------------------------- | ------- | -------- | ------------------ | + * | boxTextMargin | Margin around the text in loop/alt/opt boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 5 + */ +boxTextMargin:5, +/** + * | Parameter | Description | Type | Required | Values | + * | ---------- | ------------------- | ------- | -------- | ------------------ | + * | noteMargin | Margin around notes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ +noteMargin:10, +/** + * | Parameter | Description | Type | Required | Values | + * | ------------- | ----------------------- | ------- | -------- | ------------------ | + * | messageMargin | Space between messages. | Integer | Required | Any Positive Value | + * + * **Notes:** + * + * Space between messages. + * + * Default value: 35 + */ +messageMargin:35, +/** + * | Parameter | Description | Type | Required | Values | + * | ------------ | --------------------------- | ---- | -------- | ------------------------- | + * | messageAlign | Multiline message alignment | 3 | 4 | 'left', 'center', 'right' | + * + * **Notes:** Default value: 'center' + */ +messageAlign:"center", +/** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ------------------------------------------ | ------- | -------- | ------------------ | + * | bottomMarginAdj | Prolongs the edge of the diagram downwards | Integer | 4 | Any Positive Value | + * + * **Notes:** + * + * Depending on css styling this might need adjustment. + * + * Default value: 1 + */ +bottomMarginAdj:1, +/** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See notes | boolean | 4 | true, false | + * + * **Notes:** + * + * When this flag is set the height and width is set to 100% and is then scaling with the + * available space if not the absolute space required is used. + * + * Default value: true + */ +useMaxWidth:!0, +/** + * | Parameter | Description | Type | Required | Values | + * | ----------- | --------------------------------- | ---- | -------- | ----------- | + * | rightAngles | Curved Arrows become Right Angles | 3 | 4 | true, false | + * + * **Notes:** + * + * This will display arrows that start and begin at the same node as right angles, rather than a + * curves + * + * Default value: false + */ +rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50, +// width of activation box +activationWidth:10, +// text placement as: tspan | fo | old only text as before +textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},class:{ +/** + * ### titleTopMargin + * + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------------------------------- | ------- | -------- | ------------------ | + * | titleTopMargin | Margin top for the text over the class diagram | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 25 + */ +titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10, +/** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See notes | boolean | 4 | true, false | + * + * **Notes:** + * + * When this flag is set the height and width is set to 100% and is then scaling with the + * available space if not the absolute space required is used. + * + * Default value: true + */ +useMaxWidth:!0, +/** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ----------- | ------- | -------- | ----------------------- | + * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper | + * + * **Notes**: + * + * Decides which rendering engine that is to be used for the rendering. Legal values are: + * dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid + * + * Default value: 'dagre-d3' + */ +defaultRenderer:"dagre-wrapper"},state:{ +/** + * ### titleTopMargin + * + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------------------------------- | ------- | -------- | ------------------ | + * | titleTopMargin | Margin top for the text over the state diagram | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 25 + */ +titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7, +// Used +miniPadding:2, +// Font size factor, this is used to guess the width of the edges labels before rendering by dagre +// layout. This might need updating if/when switching font +fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5, +/** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See notes | boolean | 4 | true, false | + * + * **Notes:** + * + * When this flag is set the height and width is set to 100% and is then scaling with the + * available space if not the absolute space required is used. + * + * Default value: true + */ +useMaxWidth:!0, +/** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ----------- | ------- | -------- | ----------------------- | + * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper | + * + * **Notes:** + * + * Decides which rendering engine that is to be used for the rendering. Legal values are: + * dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid + * + * Default value: 'dagre-d3' + */ +defaultRenderer:"dagre-wrapper"}, +/** The object containing configurations specific for entity relationship diagrams */ +er:{ +/** + * ### titleTopMargin + * + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------------------------------- | ------- | -------- | ------------------ | + * | titleTopMargin | Margin top for the text over the diagram | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 25 + */ +titleTopMargin:25, +/** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ----------------------------------------------- | ------- | -------- | ------------------ | + * | diagramPadding | Amount of padding around the diagram as a whole | Integer | Required | Any Positive Value | + * + * **Notes:** + * + * The amount of padding around the diagram as a whole so that embedded diagrams have margins, + * expressed in pixels + * + * Default value: 20 + */ +diagramPadding:20, +/** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ---------------------------------------- | ------ | -------- | ---------------------- | + * | layoutDirection | Directional bias for layout of entities. | string | Required | "TB", "BT", "LR", "RL" | + * + * **Notes:** + * + * 'TB' for Top-Bottom, 'BT'for Bottom-Top, 'LR' for Left-Right, or 'RL' for Right to Left. + * + * T = top, B = bottom, L = left, and R = right. + * + * Default value: 'TB' + */ +layoutDirection:"TB", +/** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------------------- | ------- | -------- | ------------------ | + * | minEntityWidth | The minimum width of an entity box | Integer | Required | Any Positive Value | + * + * **Notes:** Expressed in pixels. Default value: 100 + */ +minEntityWidth:100, +/** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ----------------------------------- | ------- | -------- | ------------------ | + * | minEntityHeight | The minimum height of an entity box | Integer | 4 | Any Positive Value | + * + * **Notes:** Expressed in pixels Default value: 75 + */ +minEntityHeight:75, +/** + * | Parameter | Description | Type | Required | Values | + * | ------------- | ------------------------------------------------------------ | ------- | -------- | ------------------ | + * | entityPadding | Minimum internal padding between text in box and box borders | Integer | 4 | Any Positive Value | + * + * **Notes:** + * + * The minimum internal padding between text in an entity box and the enclosing box borders, + * expressed in pixels. + * + * Default value: 15 + */ +entityPadding:15, +/** + * | Parameter | Description | Type | Required | Values | + * | --------- | ----------------------------------- | ------ | -------- | -------------------- | + * | stroke | Stroke color of box edges and lines | string | 4 | Any recognized color | + * + * **Notes:** Default value: 'gray' + */ +stroke:"gray", +/** + * | Parameter | Description | Type | Required | Values | + * | --------- | -------------------------- | ------ | -------- | -------------------- | + * | fill | Fill color of entity boxes | string | 4 | Any recognized color | + * + * **Notes:** Default value: 'honeydew' + */ +fill:"honeydew", +/** + * | Parameter | Description | Type | Required | Values | + * | --------- | ------------------- | ------- | -------- | ------------------ | + * | fontSize | Font Size in pixels | Integer | | Any Positive Value | + * + * **Notes:** + * + * Font size (expressed as an integer representing a number of pixels) Default value: 12 + */ +fontSize:12, +/** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See Notes | boolean | Required | true, false | + * + * **Notes:** + * + * When this flag is set to true, the diagram width is locked to 100% and scaled based on + * available space. If set to false, the diagram reserves its absolute width. + * + * Default value: true + */ +useMaxWidth:!0}, +/** The object containing configurations specific for pie diagrams */ +pie:{useWidth:void 0, +/** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See Notes | boolean | Required | true, false | + * + * **Notes:** + * + * When this flag is set to true, the diagram width is locked to 100% and scaled based on + * available space. If set to false, the diagram reserves its absolute width. + * + * Default value: true + */ +useMaxWidth:!0}, +/** The object containing configurations specific for req diagrams */ +requirement:{useWidth:void 0, +/** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See Notes | boolean | Required | true, false | + * + * **Notes:** + * + * When this flag is set to true, the diagram width is locked to 100% and scaled based on + * available space. If set to false, the diagram reserves its absolute width. + * + * Default value: true + */ +useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},gitGraph:{ +/** + * ### titleTopMargin + * + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------------------------------- | ------- | -------- | ------------------ | + * | titleTopMargin | Margin top for the text over the Git diagram | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 25 + */ +titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0}, +/** The object containing configurations specific for c4 diagrams */ +c4:{useWidth:void 0, +/** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------------------------------- | ------- | -------- | ------------------ | + * | diagramMarginX | Margin to the right and left of the c4 diagram | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 50 + */ +diagramMarginX:50, +/** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ------------------------------------------- | ------- | -------- | ------------------ | + * | diagramMarginY | Margin to the over and under the c4 diagram | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ +diagramMarginY:10, +/** + * | Parameter | Description | Type | Required | Values | + * | ------------- | --------------------- | ------- | -------- | ------------------ | + * | c4ShapeMargin | Margin between shapes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 50 + */ +c4ShapeMargin:50, +/** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------- | ------- | -------- | ------------------ | + * | c4ShapePadding | Padding between shapes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 20 + */ +c4ShapePadding:20, +/** + * | Parameter | Description | Type | Required | Values | + * | --------- | --------------------- | ------- | -------- | ------------------ | + * | width | Width of person boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 216 + */ +width:216, +/** + * | Parameter | Description | Type | Required | Values | + * | --------- | ---------------------- | ------- | -------- | ------------------ | + * | height | Height of person boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 60 + */ +height:60, +/** + * | Parameter | Description | Type | Required | Values | + * | --------- | ------------------- | ------- | -------- | ------------------ | + * | boxMargin | Margin around boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ +boxMargin:10, +/** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See Notes | boolean | Required | true, false | + * + * **Notes:** When this flag is set to true, the height and width is set to 100% and is then + * scaling with the available space. If set to false, the absolute space required is used. + * + * Default value: true + */ +useMaxWidth:!0, +/** + * | Parameter | Description | Type | Required | Values | + * | ------------ | ----------- | ------- | -------- | ------------------ | + * | c4ShapeInRow | See Notes | Integer | Required | Any Positive Value | + * + * **Notes:** How many shapes to place in each row. + * + * Default value: 4 + */ +c4ShapeInRow:4,nextLinePaddingX:0, +/** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ----------- | ------- | -------- | ------------------ | + * | c4BoundaryInRow | See Notes | Integer | Required | Any Positive Value | + * + * **Notes:** How many boundaries to place in each row. + * + * Default value: 2 + */ +c4BoundaryInRow:2, +/** + * This sets the font size of Person shape for the diagram + * + * **Notes:** Default value: 14. + */ +personFontSize:14, +/** + * This sets the font family of Person shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ +personFontFamily:'"Open Sans", sans-serif', +/** + * This sets the font weight of Person shape for the diagram + * + * **Notes:** Default value: normal. + */ +personFontWeight:"normal", +/** + * This sets the font size of External Person shape for the diagram + * + * **Notes:** Default value: 14. + */ +external_personFontSize:14, +/** + * This sets the font family of External Person shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ +external_personFontFamily:'"Open Sans", sans-serif', +/** + * This sets the font weight of External Person shape for the diagram + * + * **Notes:** Default value: normal. + */ +external_personFontWeight:"normal", +/** + * This sets the font size of System shape for the diagram + * + * **Notes:** Default value: 14. + */ +systemFontSize:14, +/** + * This sets the font family of System shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ +systemFontFamily:'"Open Sans", sans-serif', +/** + * This sets the font weight of System shape for the diagram + * + * **Notes:** Default value: normal. + */ +systemFontWeight:"normal", +/** + * This sets the font size of External System shape for the diagram + * + * **Notes:** Default value: 14. + */ +external_systemFontSize:14, +/** + * This sets the font family of External System shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ +external_systemFontFamily:'"Open Sans", sans-serif', +/** + * This sets the font weight of External System shape for the diagram + * + * **Notes:** Default value: normal. + */ +external_systemFontWeight:"normal", +/** + * This sets the font size of System DB shape for the diagram + * + * **Notes:** Default value: 14. + */ +system_dbFontSize:14, +/** + * This sets the font family of System DB shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ +system_dbFontFamily:'"Open Sans", sans-serif', +/** + * This sets the font weight of System DB shape for the diagram + * + * **Notes:** Default value: normal. + */ +system_dbFontWeight:"normal", +/** + * This sets the font size of External System DB shape for the diagram + * + * **Notes:** Default value: 14. + */ +external_system_dbFontSize:14, +/** + * This sets the font family of External System DB shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ +external_system_dbFontFamily:'"Open Sans", sans-serif', +/** + * This sets the font weight of External System DB shape for the diagram + * + * **Notes:** Default value: normal. + */ +external_system_dbFontWeight:"normal", +/** + * This sets the font size of System Queue shape for the diagram + * + * **Notes:** Default value: 14. + */ +system_queueFontSize:14, +/** + * This sets the font family of System Queue shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ +system_queueFontFamily:'"Open Sans", sans-serif', +/** + * This sets the font weight of System Queue shape for the diagram + * + * **Notes:** Default value: normal. + */ +system_queueFontWeight:"normal", +/** + * This sets the font size of External System Queue shape for the diagram + * + * **Notes:** Default value: 14. + */ +external_system_queueFontSize:14, +/** + * This sets the font family of External System Queue shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ +external_system_queueFontFamily:'"Open Sans", sans-serif', +/** + * This sets the font weight of External System Queue shape for the diagram + * + * **Notes:** Default value: normal. + */ +external_system_queueFontWeight:"normal", +/** + * This sets the font size of Boundary shape for the diagram + * + * **Notes:** Default value: 14. + */ +boundaryFontSize:14, +/** + * This sets the font family of Boundary shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ +boundaryFontFamily:'"Open Sans", sans-serif', +/** + * This sets the font weight of Boundary shape for the diagram + * + * **Notes:** Default value: normal. + */ +boundaryFontWeight:"normal", +/** + * This sets the font size of Message shape for the diagram + * + * **Notes:** Default value: 12. + */ +messageFontSize:12, +/** + * This sets the font family of Message shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ +messageFontFamily:'"Open Sans", sans-serif', +/** + * This sets the font weight of Message shape for the diagram + * + * **Notes:** Default value: normal. + */ +messageFontWeight:"normal", +/** + * This sets the font size of Container shape for the diagram + * + * **Notes:** Default value: 14. + */ +containerFontSize:14, +/** + * This sets the font family of Container shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ +containerFontFamily:'"Open Sans", sans-serif', +/** + * This sets the font weight of Container shape for the diagram + * + * **Notes:** Default value: normal. + */ +containerFontWeight:"normal", +/** + * This sets the font size of External Container shape for the diagram + * + * **Notes:** Default value: 14. + */ +external_containerFontSize:14, +/** + * This sets the font family of External Container shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ +external_containerFontFamily:'"Open Sans", sans-serif', +/** + * This sets the font weight of External Container shape for the diagram + * + * **Notes:** Default value: normal. + */ +external_containerFontWeight:"normal", +/** + * This sets the font size of Container DB shape for the diagram + * + * **Notes:** Default value: 14. + */ +container_dbFontSize:14, +/** + * This sets the font family of Container DB shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ +container_dbFontFamily:'"Open Sans", sans-serif', +/** + * This sets the font weight of Container DB shape for the diagram + * + * **Notes:** Default value: normal. + */ +container_dbFontWeight:"normal", +/** + * This sets the font size of External Container DB shape for the diagram + * + * **Notes:** Default value: 14. + */ +external_container_dbFontSize:14, +/** + * This sets the font family of External Container DB shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ +external_container_dbFontFamily:'"Open Sans", sans-serif', +/** + * This sets the font weight of External Container DB shape for the diagram + * + * **Notes:** Default value: normal. + */ +external_container_dbFontWeight:"normal", +/** + * This sets the font size of Container Queue shape for the diagram + * + * **Notes:** Default value: 14. + */ +container_queueFontSize:14, +/** + * This sets the font family of Container Queue shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ +container_queueFontFamily:'"Open Sans", sans-serif', +/** + * This sets the font weight of Container Queue shape for the diagram + * + * **Notes:** Default value: normal. + */ +container_queueFontWeight:"normal", +/** + * This sets the font size of External Container Queue shape for the diagram + * + * **Notes:** Default value: 14. + */ +external_container_queueFontSize:14, +/** + * This sets the font family of External Container Queue shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ +external_container_queueFontFamily:'"Open Sans", sans-serif', +/** + * This sets the font weight of External Container Queue shape for the diagram + * + * **Notes:** Default value: normal. + */ +external_container_queueFontWeight:"normal", +/** + * This sets the font size of Component shape for the diagram + * + * **Notes:** Default value: 14. + */ +componentFontSize:14, +/** + * This sets the font family of Component shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ +componentFontFamily:'"Open Sans", sans-serif', +/** + * This sets the font weight of Component shape for the diagram + * + * **Notes:** Default value: normal. + */ +componentFontWeight:"normal", +/** + * This sets the font size of External Component shape for the diagram + * + * **Notes:** Default value: 14. + */ +external_componentFontSize:14, +/** + * This sets the font family of External Component shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ +external_componentFontFamily:'"Open Sans", sans-serif', +/** + * This sets the font weight of External Component shape for the diagram + * + * **Notes:** Default value: normal. + */ +external_componentFontWeight:"normal", +/** + * This sets the font size of Component DB shape for the diagram + * + * **Notes:** Default value: 14. + */ +component_dbFontSize:14, +/** + * This sets the font family of Component DB shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ +component_dbFontFamily:'"Open Sans", sans-serif', +/** + * This sets the font weight of Component DB shape for the diagram + * + * **Notes:** Default value: normal. + */ +component_dbFontWeight:"normal", +/** + * This sets the font size of External Component DB shape for the diagram + * + * **Notes:** Default value: 14. + */ +external_component_dbFontSize:14, +/** + * This sets the font family of External Component DB shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ +external_component_dbFontFamily:'"Open Sans", sans-serif', +/** + * This sets the font weight of External Component DB shape for the diagram + * + * **Notes:** Default value: normal. + */ +external_component_dbFontWeight:"normal", +/** + * This sets the font size of Component Queue shape for the diagram + * + * **Notes:** Default value: 14. + */ +component_queueFontSize:14, +/** + * This sets the font family of Component Queue shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ +component_queueFontFamily:'"Open Sans", sans-serif', +/** + * This sets the font weight of Component Queue shape for the diagram + * + * **Notes:** Default value: normal. + */ +component_queueFontWeight:"normal", +/** + * This sets the font size of External Component Queue shape for the diagram + * + * **Notes:** Default value: 14. + */ +external_component_queueFontSize:14, +/** + * This sets the font family of External Component Queue shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ +external_component_queueFontFamily:'"Open Sans", sans-serif', +/** + * This sets the font weight of External Component Queue shape for the diagram + * + * **Notes:** Default value: normal. + */ +external_component_queueFontWeight:"normal", +/** + * This sets the auto-wrap state for the diagram + * + * **Notes:** Default value: true. + */ +wrap:!0, +/** + * This sets the auto-wrap padding for the diagram (sides only) + * + * **Notes:** Default value: 0. + */ +wrapPadding:10,personFont:function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},external_personFont:function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},systemFont:function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},external_systemFont:function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},system_dbFont:function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},external_system_dbFont:function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},system_queueFont:function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},external_system_queueFont:function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},containerFont:function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},external_containerFont:function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},container_dbFont:function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},external_container_dbFont:function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},container_queueFont:function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},external_container_queueFont:function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},componentFont:function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},external_componentFont:function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},component_dbFont:function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},external_component_dbFont:function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},component_queueFont:function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},external_component_queueFont:function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},boundaryFont:function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},messageFont:function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}}, +// ' Colors +// ' ################################## +person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200},fontSize:16};Wt.class&&(Wt.class.arrowMarkerAbsolute=Wt.arrowMarkerAbsolute),Wt.gitGraph&&(Wt.gitGraph.arrowMarkerAbsolute=Wt.arrowMarkerAbsolute);const Ut=(t,e="")=>Object.keys(t).reduce(((i,r)=>Array.isArray(t[r])?i:"object"==typeof t[r]&&null!==t[r]?[...i,e+r,...Ut(t[r],"")]:[...i,e+r]),[]),qt=Ut(Wt,""),Vt=Wt; +/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ +function Ht(t){return null==t}var Gt={isNothing:Ht,isObject:function(t){return"object"==typeof t&&null!==t},toArray:function(t){return Array.isArray(t)?t:Ht(t)?[]:[t]},repeat:function(t,e){var i,r="";for(i=0;io&&(e=r-o+(s=" ... ").length),i-r>o&&(i=r+o-(a=" ...").length),{str:s+t.slice(e,i).replace(/\t/g,"→")+a,pos:r-e+s.length}}function Jt(t,e){return Gt.repeat(" ",e-t.length)+t}var te=function(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),"number"!=typeof e.indent&&(e.indent=1),"number"!=typeof e.linesBefore&&(e.linesBefore=3),"number"!=typeof e.linesAfter&&(e.linesAfter=2);for(var i,r=/\r?\n|\r|\0/g,n=[0],s=[],a=-1;i=r.exec(t.buffer);)s.push(i.index),n.push(i.index+i[0].length),t.position<=i.index&&a<0&&(a=n.length-2);a<0&&(a=n.length-1);var o,l,c="",h=Math.min(t.line+e.linesAfter,s.length).toString().length,d=e.maxLength-(e.indent+h+3);for(o=1;o<=e.linesBefore&&!(a-o<0);o++)l=Zt(t.buffer,n[a-o],s[a-o],t.position-(n[a]-n[a-o]),d),c=Gt.repeat(" ",e.indent)+Jt((t.line-o+1).toString(),h)+" | "+l.str+"\n"+c;for(l=Zt(t.buffer,n[a],s[a],t.position,d),c+=Gt.repeat(" ",e.indent)+Jt((t.line+1).toString(),h)+" | "+l.str+"\n",c+=Gt.repeat("-",e.indent+h+3+l.pos)+"^\n",o=1;o<=e.linesAfter&&!(a+o>=s.length);o++)l=Zt(t.buffer,n[a+o],s[a+o],t.position-(n[a]-n[a+o]),d),c+=Gt.repeat(" ",e.indent)+Jt((t.line+o+1).toString(),h)+" | "+l.str+"\n";return c.replace(/\n$/,"")},ee=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],ie=["scalar","sequence","mapping"];var re=function(t,e){var i,r;if(e=e||{},Object.keys(e).forEach((function(e){if(-1===ee.indexOf(e))throw new Qt('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')})),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=(i=e.styleAliases||null,r={},null!==i&&Object.keys(i).forEach((function(t){i[t].forEach((function(e){r[String(e)]=t}))})),r),-1===ie.indexOf(this.kind))throw new Qt('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')};function ne(t,e){var i=[];return t[e].forEach((function(t){var e=i.length;i.forEach((function(i,r){i.tag===t.tag&&i.kind===t.kind&&i.multi===t.multi&&(e=r)})),i[e]=t})),i}function se(t){return this.extend(t)}se.prototype.extend=function(t){var e=[],i=[];if(t instanceof re)i.push(t);else if(Array.isArray(t))i=i.concat(t);else{if(!t||!Array.isArray(t.implicit)&&!Array.isArray(t.explicit))throw new Qt("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.implicit&&(e=e.concat(t.implicit)),t.explicit&&(i=i.concat(t.explicit))}e.forEach((function(t){if(!(t instanceof re))throw new Qt("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(t.loadKind&&"scalar"!==t.loadKind)throw new Qt("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(t.multi)throw new Qt("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),i.forEach((function(t){if(!(t instanceof re))throw new Qt("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var r=Object.create(se.prototype);return r.implicit=(this.implicit||[]).concat(e),r.explicit=(this.explicit||[]).concat(i),r.compiledImplicit=ne(r,"implicit"),r.compiledExplicit=ne(r,"explicit"),r.compiledTypeMap=function(){var t,e,i={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function r(t){t.multi?(i.multi[t.kind].push(t),i.multi.fallback.push(t)):i[t.kind][t.tag]=i.fallback[t.tag]=t}for(t=0,e=arguments.length;t=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)}, +/* eslint-disable max-len */ +hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),ue=new RegExp( +// 2.5e4, 2.5 and integers +"^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var pe=/^[-+]?[0-9]+e/;var ge=new re("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(t){return null!==t&&!(!ue.test(t)||// Quick hack to not allow integers end with `_` +// Probably should update regexp & check speed +"_"===t[t.length-1])},construct:function(t){var e,i;return i="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===i?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:i*parseFloat(e,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||Gt.isNegativeZero(t))},represent:function(t,e){var i;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Gt.isNegativeZero(t))return"-0.0";return i=t.toString(10),pe.test(i)?i.replace("e",".e"):i},defaultStyle:"lowercase"}),ye=ae.extend({implicit:[oe,le,de,ge]}),fe=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),me=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");var be=new re("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(t){return null!==t&&(null!==fe.exec(t)||null!==me.exec(t))},construct:function(t){var e,i,r,n,s,a,o,l,c=0,h=null;if(null===(e=fe.exec(t))&&(e=me.exec(t)),null===e)throw new Error("Date resolve error");if(i=+e[1],r=+e[2]-1,n=+e[3],!e[4])return new Date(Date.UTC(i,r,n));if(s=+e[4],a=+e[5],o=+e[6],e[7]){for(c=e[7].slice(0,3);c.length<3;)c+="0";c=+c}return e[9]&&(h=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(h=-h)),l=new Date(Date.UTC(i,r,n,s,a,o,c)),h&&l.setTime(l.getTime()-h),l},instanceOf:Date,represent:function(t){return t.toISOString()}});var xe=new re("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(t){return"<<"===t||null===t}}),ke="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var _e=new re("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,i,r=0,n=t.length,s=ke;for(i=0;i64)){if(e<0)return!1;r+=6}return r%8==0},construct:function(t){var e,i,r=t.replace(/[\r\n=]/g,""),n=r.length,s=ke,a=0,o=[];for(e=0;e>16&255),o.push(a>>8&255),o.push(255&a)),a=a<<6|s.indexOf(r.charAt(e));return 0===(i=n%4*6)?(o.push(a>>16&255),o.push(a>>8&255),o.push(255&a)):18===i?(o.push(a>>10&255),o.push(a>>2&255)):12===i&&o.push(a>>4&255),new Uint8Array(o)},predicate:function(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)},represent:function(t){var e,i,r="",n=0,s=t.length,a=ke;for(e=0;e>18&63],r+=a[n>>12&63],r+=a[n>>6&63],r+=a[63&n]),n=(n<<8)+t[e];return 0===(i=s%3)?(r+=a[n>>18&63],r+=a[n>>12&63],r+=a[n>>6&63],r+=a[63&n]):2===i?(r+=a[n>>10&63],r+=a[n>>4&63],r+=a[n<<2&63],r+=a[64]):1===i&&(r+=a[n>>2&63],r+=a[n<<4&63],r+=a[64],r+=a[64]),r}}),Ce=Object.prototype.hasOwnProperty,Te=Object.prototype.toString;var Ee=new re("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(t){if(null===t)return!0;var e,i,r,n,s,a=[],o=t;for(e=0,i=o.length;e>10),56320+(t-65536&1023))}for(var Ue=new Array(256),qe=new Array(256),Ve=0;Ve<256;Ve++)Ue[Ve]=Ye(Ve)?1:0,qe[Ve]=Ye(Ve);function He(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||Be,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Ge(t,e){var i={name:t.filename,buffer:t.input.slice(0,-1), +// omit trailing \0 +position:t.position,line:t.line,column:t.position-t.lineStart};return i.snippet=te(i),new Qt(e,i)}function Xe(t,e){throw Ge(t,e)}function Ke(t,e){t.onWarning&&t.onWarning.call(null,Ge(t,e))}var Qe={YAML:function(t,e,i){var r,n,s;null!==t.version&&Xe(t,"duplication of %YAML directive"),1!==i.length&&Xe(t,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(i[0]))&&Xe(t,"ill-formed argument of the YAML directive"),n=parseInt(r[1],10),s=parseInt(r[2],10),1!==n&&Xe(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=s<2,1!==s&&2!==s&&Ke(t,"unsupported YAML version of the document")},TAG:function(t,e,i){var r,n;2!==i.length&&Xe(t,"TAG directive accepts exactly two arguments"),r=i[0],n=i[1],$e.test(r)||Xe(t,"ill-formed tag handle (first argument) of the TAG directive"),Le.call(t.tagMap,r)&&Xe(t,'there is a previously declared suffix for "'+r+'" tag handle'),Ne.test(n)||Xe(t,"ill-formed tag prefix (second argument) of the TAG directive");try{n=decodeURIComponent(n)}catch(s){Xe(t,"tag prefix is malformed: "+n)}t.tagMap[r]=n}};function Ze(t,e,i,r){var n,s,a,o;if(e1&&(t.result+=Gt.repeat("\n",e-1))}function si(t,e){var i,r,n=t.tag,s=t.anchor,a=[],o=!1;if(-1!==t.firstTabInLine)return!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=a),r=t.input.charCodeAt(t.position);0!==r&&(-1!==t.firstTabInLine&&(t.position=t.firstTabInLine,Xe(t,"tab characters must not be used in indentation")),45===r)&&Pe(t.input.charCodeAt(t.position+1));)if(o=!0,t.position++,ii(t,!0,-1)&&t.lineIndent<=e)a.push(null),r=t.input.charCodeAt(t.position);else if(i=t.line,li(t,e,3,!1,!0),a.push(t.result),ii(t,!0,-1),r=t.input.charCodeAt(t.position),(t.line===i||t.lineIndent>e)&&0!==r)Xe(t,"bad indentation of a sequence entry");else if(t.lineIndente?g=1:t.lineIndent===e?g=0:t.lineIndente?g=1:t.lineIndent===e?g=0:t.lineIndente)&&(m&&(a=t.line,o=t.lineStart,l=t.position),li(t,e,4,!0,n)&&(m?y=t.result:f=t.result),m||(ti(t,u,p,g,y,f,a,o,l),g=y=f=null),ii(t,!0,-1),c=t.input.charCodeAt(t.position)),(t.line===s||t.lineIndent>e)&&0!==c)Xe(t,"bad indentation of a mapping entry");else if(t.lineIndent=0))break;0===n?Xe(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?Xe(t,"repeat of an indentation width identifier"):(h=e+n-1,c=!0)}if(Me(s)){do{s=t.input.charCodeAt(++t.position)}while(Me(s));if(35===s)do{s=t.input.charCodeAt(++t.position)}while(!Re(s)&&0!==s)}for(;0!==s;){for(ei(t),t.lineIndent=0,s=t.input.charCodeAt(t.position);(!c||t.lineIndenth&&(h=t.lineIndent),Re(s))d++;else{if(t.lineIndent0){for(n=a,s=0;n>0;n--)(a=je(o=t.input.charCodeAt(++t.position)))>=0?s=(s<<4)+a:Xe(t,"expected hexadecimal character");t.result+=We(s),t.position++}else Xe(t,"unknown escape sequence");i=r=t.position}else Re(o)?(Ze(t,i,r,!0),ni(t,ii(t,!1,e)),i=r=t.position):t.position===t.lineStart&&ri(t)?Xe(t,"unexpected end of the document within a double quoted scalar"):(t.position++,r=t.position)}Xe(t,"unexpected end of the stream within a double quoted scalar")}(t,u)?f=!0:!function(t){var e,i,r;if(42!==(r=t.input.charCodeAt(t.position)))return!1;for(r=t.input.charCodeAt(++t.position),e=t.position;0!==r&&!Pe(r)&&!ze(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&Xe(t,"name of an alias node must contain at least one character"),i=t.input.slice(e,t.position),Le.call(t.anchorMap,i)||Xe(t,'unidentified alias "'+i+'"'),t.result=t.anchorMap[i],ii(t,!0,-1),!0}(t)?function(t,e,i){var r,n,s,a,o,l,c,h,d=t.kind,u=t.result;if(Pe(h=t.input.charCodeAt(t.position))||ze(h)||35===h||38===h||42===h||33===h||124===h||62===h||39===h||34===h||37===h||64===h||96===h)return!1;if((63===h||45===h)&&(Pe(r=t.input.charCodeAt(t.position+1))||i&&ze(r)))return!1;for(t.kind="scalar",t.result="",n=s=t.position,a=!1;0!==h;){if(58===h){if(Pe(r=t.input.charCodeAt(t.position+1))||i&&ze(r))break}else if(35===h){if(Pe(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&ri(t)||i&&ze(h))break;if(Re(h)){if(o=t.line,l=t.lineStart,c=t.lineIndent,ii(t,!1,-1),t.lineIndent>=e){a=!0,h=t.input.charCodeAt(t.position);continue}t.position=s,t.line=o,t.lineStart=l,t.lineIndent=c;break}}a&&(Ze(t,n,s,!1),ni(t,t.line-o),n=s=t.position,a=!1),Me(h)||(s=t.position+1),h=t.input.charCodeAt(++t.position)}return Ze(t,n,s,!1),!!t.result||(t.kind=d,t.result=u,!1)}(t,u,1===i)&&(f=!0,null===t.tag&&(t.tag="?")):(f=!0,null===t.tag&&null===t.anchor||Xe(t,"alias node should not have any properties")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===g&&(f=o&&si(t,p))),null===t.tag)null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);else if("?"===t.tag){for(null!==t.result&&"scalar"!==t.kind&&Xe(t,'unacceptable node kind for ! tag; it should be "scalar", not "'+t.kind+'"'),l=0,c=t.implicitTypes.length;l"),null!==t.result&&d.kind!==t.kind&&Xe(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+d.kind+'", not "'+t.kind+'"'),d.resolve(t.result,t.tag)?(t.result=d.construct(t.result,t.tag),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):Xe(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||f}function ci(t){var e,i,r,n,s=t.position,a=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);0!==(n=t.input.charCodeAt(t.position))&&(ii(t,!0,-1),n=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==n));){for(a=!0,n=t.input.charCodeAt(++t.position),e=t.position;0!==n&&!Pe(n);)n=t.input.charCodeAt(++t.position);for(r=[],(i=t.input.slice(e,t.position)).length<1&&Xe(t,"directive name must not be less than one character in length");0!==n;){for(;Me(n);)n=t.input.charCodeAt(++t.position);if(35===n){do{n=t.input.charCodeAt(++t.position)}while(0!==n&&!Re(n));break}if(Re(n))break;for(e=t.position;0!==n&&!Pe(n);)n=t.input.charCodeAt(++t.position);r.push(t.input.slice(e,t.position))}0!==n&&ei(t),Le.call(Qe,i)?Qe[i](t,i,r):Ke(t,'unknown document directive "'+i+'"')}ii(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,ii(t,!0,-1)):a&&Xe(t,"directives end mark is expected"),li(t,t.lineIndent-1,4,!1,!0),ii(t,!0,-1),t.checkLineBreaks&&Ie.test(t.input.slice(s,t.position))&&Ke(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&ri(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,ii(t,!0,-1)):t.position{for(const{id:e,detector:i,loader:r}of t)bi(e,i,r)},bi=(t,e,i)=>{yi[t]?Tt.error(`Detector with key ${t} already exists`):yi[t]={detector:e,loader:i},Tt.debug(`Detector with key ${t} added${i?" with loader":""}`)},xi=function(t,e,i){const{depth:r,clobber:n}=Object.assign({depth:2,clobber:!1},i);return Array.isArray(e)&&!Array.isArray(t)?(e.forEach((e=>xi(t,e,i))),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach((e=>{t.includes(e)||t.push(e)})),t):void 0===t||r<=0?null!=t&&"object"==typeof t&&"object"==typeof e?Object.assign(t,e):e:(void 0!==e&&"object"==typeof t&&"object"==typeof e&&Object.keys(e).forEach((i=>{"object"!=typeof e[i]||void 0!==t[i]&&"object"!=typeof t[i]?(n||"object"!=typeof t[i]&&"object"!=typeof e[i])&&(t[i]=e[i]):(void 0===t[i]&&(t[i]=Array.isArray(e[i])?[]:{}),t[i]=xi(t[i],e[i],{depth:r-1,clobber:n}))})),t)},ki=xi,_i={curveBasis:R,curveBasisClosed:F,curveBasisOpen:N,curveBumpX:$,curveBumpY:O,curveBundle:I,curveCardinalClosed:D,curveCardinalOpen:L,curveCardinal:B,curveCatmullRomClosed:A,curveCatmullRomOpen:w,curveCatmullRom:S,curveLinear:v,curveLinearClosed:E,curveMonotoneX:T,curveMonotoneY:C,curveNatural:_,curveStep:k,curveStepAfter:x,curveStepBefore:b},Ci=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Ti=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Ei=function(t,e=null){try{const i=new RegExp(`[%]{2}(?![{]${Ti.source})(?=[}][%]{2}).*\n`,"ig");let r;t=t.trim().replace(i,"").replace(/'/gm,'"'),Tt.debug(`Detecting diagram directive${null!==e?" type:"+e:""} based on the text:${t}`);const n=[];for(;null!==(r=Ci.exec(t));)if(r.index===Ci.lastIndex&&Ci.lastIndex++,r&&!e||e&&r[1]&&r[1].match(e)||e&&r[2]&&r[2].match(e)){const t=r[1]?r[1]:r[2],e=r[3]?r[3].trim():r[4]?JSON.parse(r[4].trim()):null;n.push({type:t,args:e})}return 0===n.length&&n.push({type:t,args:null}),1===n.length?n[0]:n}catch(i){return Tt.error(`ERROR: ${i.message} - Unable to parse directive\n ${null!==e?" type:"+e:""} based on the text:${t}`),{type:null,args:null}}};function vi(t,e){if(!t)return e;const i=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return _i[i]||e}function Si(t,e){return t&&e?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):0}function wi(t){let e="",i="";for(const r of t)void 0!==r&&(r.startsWith("color:")||r.startsWith("text-align:")?i=i+r+";":e=e+r+";");return{style:e,labelStyle:i}}let Ai=0;const Bi=()=>(Ai++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Ai);const Li=t=>function(t){let e="";const i="0123456789abcdef";for(let r=0;r{if(!t)return t;if(i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},i),Ot.lineBreakRegex.test(t))return t;const r=t.split(" "),n=[];let s="";return r.forEach(((t,a)=>{const o=Ni(`${t} `,i),l=Ni(s,i);if(o>e){const{hyphenatedStrings:r,remainingWord:a}=Oi(t,e,"-",i);n.push(s,...r),s=a}else l+o>=e?(n.push(s),s=t):s=[s,t].filter(Boolean).join(" ");a+1===r.length&&n.push(s)})),n.filter((t=>""!==t)).join(i.joinWith)}),((t,e,i)=>`${t}${e}${i.fontSize}${i.fontWeight}${i.fontFamily}${i.joinWith}`)),Oi=X(((t,e,i="-",r)=>{r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},r);const n=[...t],s=[];let a="";return n.forEach(((t,o)=>{const l=`${a}${t}`;if(Ni(l,r)>=e){const t=o+1,e=n.length===t,r=`${l}${i}`;s.push(e?l:r),a=""}else a=l})),{hyphenatedStrings:s,remainingWord:a}}),((t,e,i="-",r)=>`${t}${e}${i}${r.fontSize}${r.fontWeight}${r.fontFamily}`));function $i(t,e){return e=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:15},e),Fi(t,e).height}function Ni(t,e){return e=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial"},e),Fi(t,e).width}const Fi=X(((t,e)=>{e=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial"},e);const{fontSize:i,fontFamily:r,fontWeight:n}=e;if(!t)return{width:0,height:0};const[,s]=ji(i),a=["sans-serif",r],o=t.split(Ot.lineBreakRegex),l=[],c=f("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const d of a){let t=0;const e={width:0,height:0,lineHeight:0};for(const i of o){const r={x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0};r.text=i;const a=Di(h,r).style("font-size",s).style("font-weight",n).style("font-family",d),o=(a._groups||a)[0][0].getBBox();e.width=Math.round(Math.max(e.width,o.width)),t=Math.round(o.height),e.height+=t,e.lineHeight=Math.round(Math.max(e.lineHeight,t))}l.push(e)}h.remove();return l[isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1]}),((t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`));let Ri;const Mi=t=>{if(Tt.debug("directiveSanitizer called with",t),"object"==typeof t&&(t.length?t.forEach((t=>Mi(t))):Object.keys(t).forEach((e=>{Tt.debug("Checking key",e),e.startsWith("__")&&(Tt.debug("sanitize deleting __ option",e),delete t[e]),e.includes("proto")&&(Tt.debug("sanitize deleting proto option",e),delete t[e]),e.includes("constr")&&(Tt.debug("sanitize deleting constr option",e),delete t[e]),e.includes("themeCSS")&&(Tt.debug("sanitizing themeCss option"),t[e]=Pi(t[e])),e.includes("fontFamily")&&(Tt.debug("sanitizing fontFamily option"),t[e]=Pi(t[e])),e.includes("altFontFamily")&&(Tt.debug("sanitizing altFontFamily option"),t[e]=Pi(t[e])),qt.includes(e)?"object"==typeof t[e]&&(Tt.debug("sanitize deleting object",e),Mi(t[e])):(Tt.debug("sanitize deleting option",e),delete t[e])}))),t.themeVariables){const e=Object.keys(t.themeVariables);for(const i of e){const e=t.themeVariables[i];e&&e.match&&!e.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[i]="")}}Tt.debug("After sanitization",t)},Pi=t=>{let e=0,i=0;for(const r of t){if(e{if("number"==typeof t)return[t,t+"px"];const e=parseInt(t,10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},Yi={assignWithDepth:ki,wrapLabel:Ii,calculateTextHeight:$i,calculateTextWidth:Ni,calculateTextDimensions:Fi,detectInit:function(t,e){const i=Ei(t,/(?:init\b)|(?:initialize\b)/);let r={};if(Array.isArray(i)){const t=i.map((t=>t.args));Mi(t),r=ki(r,[...t])}else r=i.args;if(r){let i=fi(t,e);["config"].forEach((t=>{void 0!==r[t]&&("flowchart-v2"===i&&(i="flowchart"),r[i]=r[t],delete r[t])}))}return r},detectDirective:Ei,isSubstringInArray:function(t,e){for(const[i,r]of e.entries())if(r.match(t))return i;return-1},interpolateToCurve:vi,calcLabelPosition:function(t){return 1===t.length?t[0]:function(t){let e,i=0;t.forEach((t=>{i+=Si(t,e),e=t}));let r,n=i/2;return e=void 0,t.forEach((t=>{if(e&&!r){const i=Si(t,e);if(i=1&&(r={x:t.x,y:t.y}),s>0&&s<1&&(r={x:(1-s)*e.x+s*t.x,y:(1-s)*e.y+s*t.y})}}e=t})),r}(t)},calcCardinalityPosition:(t,e,i)=>{let r;Tt.info(`our points ${JSON.stringify(e)}`),e[0]!==i&&(e=e.reverse());let n,s=25;r=void 0,e.forEach((t=>{if(r&&!n){const e=Si(t,r);if(e=1&&(n={x:t.x,y:t.y}),i>0&&i<1&&(n={x:(1-i)*r.x+i*t.x,y:(1-i)*r.y+i*t.y})}}r=t}));const a=t?10:5,o=Math.atan2(e[0].y-n.y,e[0].x-n.x),l={x:0,y:0};return l.x=Math.sin(o)*a+(e[0].x+n.x)/2,l.y=-Math.cos(o)*a+(e[0].y+n.y)/2,l},calcTerminalLabelPosition:function(t,e,i){let r,n=JSON.parse(JSON.stringify(i));Tt.info("our points",n),"start_left"!==e&&"start_right"!==e&&(n=n.reverse()),n.forEach((t=>{r=t}));let s,a=25+t;r=void 0,n.forEach((t=>{if(r&&!s){const e=Si(t,r);if(e=1&&(s={x:t.x,y:t.y}),i>0&&i<1&&(s={x:(1-i)*r.x+i*t.x,y:(1-i)*r.y+i*t.y})}}r=t}));const o=10+.5*t,l=Math.atan2(n[0].y-s.y,n[0].x-s.x),c={x:0,y:0};return c.x=Math.sin(l)*o+(n[0].x+s.x)/2,c.y=-Math.cos(l)*o+(n[0].y+s.y)/2,"start_left"===e&&(c.x=Math.sin(l+Math.PI)*o+(n[0].x+s.x)/2,c.y=-Math.cos(l+Math.PI)*o+(n[0].y+s.y)/2),"end_right"===e&&(c.x=Math.sin(l-Math.PI)*o+(n[0].x+s.x)/2-5,c.y=-Math.cos(l-Math.PI)*o+(n[0].y+s.y)/2-5),"end_left"===e&&(c.x=Math.sin(l)*o+(n[0].x+s.x)/2-5,c.y=-Math.cos(l)*o+(n[0].y+s.y)/2-5),c},formatUrl:function(t,e){const i=t.trim();if(i)return"loose"!==e.securityLevel?n.sanitizeUrl(i):i},getStylesFromArray:wi,generateId:Bi,random:Li,runFunc:(t,...e)=>{const i=t.split("."),r=i.length-1,n=i[r];let s=window;for(let a=0;a{if(!r)return;const n=t.node().getBBox();t.append("text").text(r).attr("x",n.x+n.width/2).attr("y",-i).attr("class",e)},parseFontSize:ji},Wi="9.4.3",Ui=Object.freeze(Vt);let qi,Vi=ki({},Ui),Hi=[],Gi=ki({},Ui);const Xi=(t,e)=>{let i=ki({},t),r={};for(const n of e)Ji(n),r=ki(r,n);if(i=ki(i,r),r.theme&&r.theme in Yt){const t=ki({},qi),e=ki(t.themeVariables||{},r.themeVariables);i.theme&&i.theme in Yt&&(i.themeVariables=Yt[i.theme].getThemeVariables(e))}return Gi=i,nr(Gi),Gi},Ki=()=>ki({},Vi),Qi=t=>(nr(t),ki(Gi,t),Zi()),Zi=()=>ki({},Gi),Ji=t=>{["secure",...Vi.secure??[]].forEach((e=>{void 0!==t[e]&&(Tt.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])})),Object.keys(t).forEach((e=>{0===e.indexOf("__")&&delete t[e]})),Object.keys(t).forEach((e=>{"string"==typeof t[e]&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],"object"==typeof t[e]&&Ji(t[e])}))},tr=t=>{t.fontFamily&&(t.themeVariables&&t.themeVariables.fontFamily||(t.themeVariables={fontFamily:t.fontFamily})),Hi.push(t),Xi(Vi,Hi)},er=(t=Vi)=>{Hi=[],Xi(t,Hi)};var ir=(t=>(t.LAZY_LOAD_DEPRECATED="The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",t))(ir||{});const rr={},nr=t=>{var e;t&&((t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&(rr[e="LAZY_LOAD_DEPRECATED"]||(Tt.warn(ir[e]),rr[e]=!0)))},sr=function(t,e,i,r){const n=function(t,e,i){let r=new Map;return i?(r.set("width","100%"),r.set("style",`max-width: ${e}px;`)):(r.set("height",t),r.set("width",e)),r}(e,i,r);!function(t,e){for(let i of e)t.attr(i[0],i[1])}(t,n)},ar=function(t,e,i,r){const n=e.node().getBBox(),s=n.width,a=n.height;Tt.info(`SVG bounds: ${s}x${a}`,n);let o=0,l=0;Tt.info(`Graph bounds: ${o}x${l}`,t),o=s+2*i,l=a+2*i,Tt.info(`Calculated bounds: ${o}x${l}`),sr(e,l,o,r);const c=`${n.x-i} ${n.y-i} ${n.width+2*i} ${n.height+2*i}`;e.attr("viewBox",c)},or=t=>`g.classGroup text {\n fill: ${t.nodeBorder};\n fill: ${t.classText};\n stroke: none;\n font-family: ${t.fontFamily};\n font-size: 10px;\n\n .title {\n font-weight: bolder;\n }\n\n}\n\n.nodeLabel, .edgeLabel {\n color: ${t.classText};\n}\n.edgeLabel .label rect {\n fill: ${t.mainBkg};\n}\n.label text {\n fill: ${t.classText};\n}\n.edgeLabel .label span {\n background: ${t.mainBkg};\n}\n\n.classTitle {\n font-weight: bolder;\n}\n.node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n\n.divider {\n stroke: ${t.nodeBorder};\n stroke: 1;\n}\n\ng.clickable {\n cursor: pointer;\n}\n\ng.classGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.classGroup line {\n stroke: ${t.nodeBorder};\n stroke-width: 1;\n}\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.classLabel .label {\n fill: ${t.nodeBorder};\n font-size: 10px;\n}\n\n.relation {\n stroke: ${t.lineColor};\n stroke-width: 1;\n fill: none;\n}\n\n.dashed-line{\n stroke-dasharray: 3;\n}\n\n.dotted-line{\n stroke-dasharray: 1 2;\n}\n\n#compositionStart, .composition {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#compositionEnd, .composition {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#extensionStart, .extension {\n fill: ${t.mainBkg} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#extensionEnd, .extension {\n fill: ${t.mainBkg} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#aggregationStart, .aggregation {\n fill: ${t.mainBkg} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#aggregationEnd, .aggregation {\n fill: ${t.mainBkg} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#lollipopStart, .lollipop {\n fill: ${t.mainBkg} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#lollipopEnd, .lollipop {\n fill: ${t.mainBkg} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n.edgeTerminals {\n font-size: 11px;\n}\n\n.classTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n`,lr=t=>`\n .entityBox {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n }\n\n .attributeBoxOdd {\n fill: ${t.attributeBackgroundColorOdd};\n stroke: ${t.nodeBorder};\n }\n\n .attributeBoxEven {\n fill: ${t.attributeBackgroundColorEven};\n stroke: ${t.nodeBorder};\n }\n\n .relationshipLabelBox {\n fill: ${t.tertiaryColor};\n opacity: 0.7;\n background-color: ${t.tertiaryColor};\n rect {\n opacity: 0.5;\n }\n }\n\n .relationshipLine {\n stroke: ${t.lineColor};\n }\n\n .entityTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n } \n`,cr=()=>"",hr=t=>`.label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n .cluster-label text {\n fill: ${t.titleColor};\n }\n .cluster-label span {\n color: ${t.titleColor};\n }\n\n .label text,span {\n fill: ${t.nodeTextColor||t.textColor};\n color: ${t.nodeTextColor||t.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n }\n\n .cluster rect {\n fill: ${t.clusterBkg};\n stroke: ${t.clusterBorder};\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n .cluster span {\n color: ${t.titleColor};\n }\n /* .cluster div {\n color: ${t.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${t.fontFamily};\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n`,dr=t=>`\n .mermaid-main-font {\n font-family: "trebuchet ms", verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n .exclude-range {\n fill: ${t.excludeBkgColor};\n }\n\n .section {\n stroke: none;\n opacity: 0.2;\n }\n\n .section0 {\n fill: ${t.sectionBkgColor};\n }\n\n .section2 {\n fill: ${t.sectionBkgColor2};\n }\n\n .section1,\n .section3 {\n fill: ${t.altSectionBkgColor};\n opacity: 0.2;\n }\n\n .sectionTitle0 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle1 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle2 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle3 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle {\n text-anchor: start;\n // font-size: ${t.ganttFontSize};\n // text-height: 14px;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n\n }\n\n\n /* Grid and axis */\n\n .grid .tick {\n stroke: ${t.gridColor};\n opacity: 0.8;\n shape-rendering: crispEdges;\n text {\n font-family: ${t.fontFamily};\n fill: ${t.textColor};\n }\n }\n\n .grid path {\n stroke-width: 0;\n }\n\n\n /* Today line */\n\n .today {\n fill: none;\n stroke: ${t.todayLineColor};\n stroke-width: 2px;\n }\n\n\n /* Task styling */\n\n /* Default task */\n\n .task {\n stroke-width: 2;\n }\n\n .taskText {\n text-anchor: middle;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n\n // .taskText:not([font-size]) {\n // font-size: ${t.ganttFontSize};\n // }\n\n .taskTextOutsideRight {\n fill: ${t.taskTextDarkColor};\n text-anchor: start;\n // font-size: ${t.ganttFontSize};\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n\n }\n\n .taskTextOutsideLeft {\n fill: ${t.taskTextDarkColor};\n text-anchor: end;\n // font-size: ${t.ganttFontSize};\n }\n\n /* Special case clickable */\n .task.clickable {\n cursor: pointer;\n }\n .taskText.clickable {\n cursor: pointer;\n fill: ${t.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n .taskTextOutsideLeft.clickable {\n cursor: pointer;\n fill: ${t.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n .taskTextOutsideRight.clickable {\n cursor: pointer;\n fill: ${t.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n /* Specific task settings for the sections*/\n\n .taskText0,\n .taskText1,\n .taskText2,\n .taskText3 {\n fill: ${t.taskTextColor};\n }\n\n .task0,\n .task1,\n .task2,\n .task3 {\n fill: ${t.taskBkgColor};\n stroke: ${t.taskBorderColor};\n }\n\n .taskTextOutside0,\n .taskTextOutside2\n {\n fill: ${t.taskTextOutsideColor};\n }\n\n .taskTextOutside1,\n .taskTextOutside3 {\n fill: ${t.taskTextOutsideColor};\n }\n\n\n /* Active task */\n\n .active0,\n .active1,\n .active2,\n .active3 {\n fill: ${t.activeTaskBkgColor};\n stroke: ${t.activeTaskBorderColor};\n }\n\n .activeText0,\n .activeText1,\n .activeText2,\n .activeText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n\n /* Completed task */\n\n .done0,\n .done1,\n .done2,\n .done3 {\n stroke: ${t.doneTaskBorderColor};\n fill: ${t.doneTaskBkgColor};\n stroke-width: 2;\n }\n\n .doneText0,\n .doneText1,\n .doneText2,\n .doneText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n\n /* Tasks on the critical line */\n\n .crit0,\n .crit1,\n .crit2,\n .crit3 {\n stroke: ${t.critBorderColor};\n fill: ${t.critBkgColor};\n stroke-width: 2;\n }\n\n .activeCrit0,\n .activeCrit1,\n .activeCrit2,\n .activeCrit3 {\n stroke: ${t.critBorderColor};\n fill: ${t.activeTaskBkgColor};\n stroke-width: 2;\n }\n\n .doneCrit0,\n .doneCrit1,\n .doneCrit2,\n .doneCrit3 {\n stroke: ${t.critBorderColor};\n fill: ${t.doneTaskBkgColor};\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges;\n }\n\n .milestone {\n transform: rotate(45deg) scale(0.8,0.8);\n }\n\n .milestoneText {\n font-style: italic;\n }\n .doneCritText0,\n .doneCritText1,\n .doneCritText2,\n .doneCritText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n .activeCritText0,\n .activeCritText1,\n .activeCritText2,\n .activeCritText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n .titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor} ;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n`,ur=()=>"",pr=t=>`\n .pieCircle{\n stroke: ${t.pieStrokeColor};\n stroke-width : ${t.pieStrokeWidth};\n opacity : ${t.pieOpacity};\n }\n .pieTitleText {\n text-anchor: middle;\n font-size: ${t.pieTitleTextSize};\n fill: ${t.pieTitleTextColor};\n font-family: ${t.fontFamily};\n }\n .slice {\n font-family: ${t.fontFamily};\n fill: ${t.pieSectionTextColor};\n font-size:${t.pieSectionTextSize};\n // fill: white;\n }\n .legend text {\n fill: ${t.pieLegendTextColor};\n font-family: ${t.fontFamily};\n font-size: ${t.pieLegendTextSize};\n }\n`,gr=t=>`\n\n marker {\n fill: ${t.relationColor};\n stroke: ${t.relationColor};\n }\n\n marker.cross {\n stroke: ${t.lineColor};\n }\n\n svg {\n font-family: ${t.fontFamily};\n font-size: ${t.fontSize};\n }\n\n .reqBox {\n fill: ${t.requirementBackground};\n fill-opacity: 100%;\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n \n .reqTitle, .reqLabel{\n fill: ${t.requirementTextColor};\n }\n .reqLabelBox {\n fill: ${t.relationLabelBackground};\n fill-opacity: 100%;\n }\n\n .req-title-line {\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n .relationshipLine {\n stroke: ${t.relationColor};\n stroke-width: 1;\n }\n .relationshipLabel {\n fill: ${t.relationLabelColor};\n }\n\n`,yr=t=>`.actor {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n\n text.actor > tspan {\n fill: ${t.actorTextColor};\n stroke: none;\n }\n\n .actor-line {\n stroke: ${t.actorLineColor};\n }\n\n .messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: none;\n stroke: ${t.signalColor};\n }\n\n .messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: 2, 2;\n stroke: ${t.signalColor};\n }\n\n #arrowhead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .sequenceNumber {\n fill: ${t.sequenceNumberColor};\n }\n\n #sequencenumber {\n fill: ${t.signalColor};\n }\n\n #crosshead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .messageText {\n fill: ${t.signalTextColor};\n stroke: none;\n }\n\n .labelBox {\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBkgColor};\n }\n\n .labelText, .labelText > tspan {\n fill: ${t.labelTextColor};\n stroke: none;\n }\n\n .loopText, .loopText > tspan {\n fill: ${t.loopTextColor};\n stroke: none;\n }\n\n .loopLine {\n stroke-width: 2px;\n stroke-dasharray: 2, 2;\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBorderColor};\n }\n\n .note {\n //stroke: #decc93;\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n }\n\n .noteText, .noteText > tspan {\n fill: ${t.noteTextColor};\n stroke: none;\n }\n\n .activation0 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation1 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation2 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .actorPopupMenu {\n position: absolute;\n }\n\n .actorPopupMenuPanel {\n position: absolute;\n fill: ${t.actorBkg};\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));\n}\n .actor-man line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n .actor-man circle, line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n stroke-width: 2px;\n }\n`,fr=t=>`\ndefs #statediagram-barbEnd {\n fill: ${t.transitionColor};\n stroke: ${t.transitionColor};\n }\ng.stateGroup text {\n fill: ${t.nodeBorder};\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ${t.textColor};\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ${t.stateLabelColor};\n}\n\ng.stateGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.stateGroup line {\n stroke: ${t.lineColor};\n stroke-width: 1;\n}\n\n.transition {\n stroke: ${t.transitionColor};\n stroke-width: 1;\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ${t.background};\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n\n text {\n fill: ${t.noteTextColor};\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ${t.labelBackgroundColor};\n opacity: 0.5;\n}\n.edgeLabel .label text {\n fill: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n.label div .edgeLabel {\n color: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n\n.stateLabel text {\n fill: ${t.stateLabelColor};\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node .fork-join {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node circle.state-end {\n fill: ${t.innerEndBackground};\n stroke: ${t.background};\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ${t.compositeBackground||t.background};\n // stroke: ${t.background};\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ${t.stateBkg||t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: 1px;\n}\n.node polygon {\n fill: ${t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};;\n stroke-width: 1px;\n}\n#statediagram-barbEnd {\n fill: ${t.lineColor};\n}\n\n.statediagram-cluster rect {\n fill: ${t.compositeTitleBackground};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: 1px;\n}\n\n.cluster-label, .nodeLabel {\n color: ${t.stateLabelColor};\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ${t.stateBorder||t.nodeBorder};\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ${t.compositeBackground||t.background};\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ${t.noteTextColor};\n}\n\n.statediagram-note .nodeLabel {\n color: ${t.noteTextColor};\n}\n.statediagram .edgeLabel {\n color: red; // ${t.noteTextColor};\n}\n\n#dependencyStart, #dependencyEnd {\n fill: ${t.lineColor};\n stroke: ${t.lineColor};\n stroke-width: 1;\n}\n\n.statediagramTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n`,mr=t=>`.label {\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n color: ${t.textColor};\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ${t.textColor}\n }\n\n .legend {\n fill: ${t.textColor};\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ${t.textColor}\n }\n\n .face {\n ${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ${t.fillType0?`fill: ${t.fillType0}`:""};\n }\n .task-type-1, .section-type-1 {\n ${t.fillType0?`fill: ${t.fillType1}`:""};\n }\n .task-type-2, .section-type-2 {\n ${t.fillType0?`fill: ${t.fillType2}`:""};\n }\n .task-type-3, .section-type-3 {\n ${t.fillType0?`fill: ${t.fillType3}`:""};\n }\n .task-type-4, .section-type-4 {\n ${t.fillType0?`fill: ${t.fillType4}`:""};\n }\n .task-type-5, .section-type-5 {\n ${t.fillType0?`fill: ${t.fillType5}`:""};\n }\n .task-type-6, .section-type-6 {\n ${t.fillType0?`fill: ${t.fillType6}`:""};\n }\n .task-type-7, .section-type-7 {\n ${t.fillType0?`fill: ${t.fillType7}`:""};\n }\n\n .actor-0 {\n ${t.actor0?`fill: ${t.actor0}`:""};\n }\n .actor-1 {\n ${t.actor1?`fill: ${t.actor1}`:""};\n }\n .actor-2 {\n ${t.actor2?`fill: ${t.actor2}`:""};\n }\n .actor-3 {\n ${t.actor3?`fill: ${t.actor3}`:""};\n }\n .actor-4 {\n ${t.actor4?`fill: ${t.actor4}`:""};\n }\n .actor-5 {\n ${t.actor5?`fill: ${t.actor5}`:""};\n }\n`,br=t=>`.person {\n stroke: ${t.personBorder};\n fill: ${t.personBkg};\n }\n`,xr={flowchart:hr,"flowchart-v2":hr,sequence:yr,gantt:dr,classDiagram:or,"classDiagram-v2":or,class:or,stateDiagram:fr,state:fr, +// gitGraph, +info:ur,pie:pr,er:lr,error:cr,journey:mr,requirement:gr,c4:br},kr=(t,e,i)=>{let r="";return t in xr&&xr[t]?r=xr[t](i):Tt.warn(`No theme found for ${t}`),` & {\n font-family: ${i.fontFamily};\n font-size: ${i.fontSize};\n fill: ${i.textColor}\n }\n\n /* Classes common for multiple diagrams */\n\n & .error-icon {\n fill: ${i.errorBkgColor};\n }\n & .error-text {\n fill: ${i.errorTextColor};\n stroke: ${i.errorTextColor};\n }\n\n & .edge-thickness-normal {\n stroke-width: 2px;\n }\n & .edge-thickness-thick {\n stroke-width: 3.5px\n }\n & .edge-pattern-solid {\n stroke-dasharray: 0;\n }\n\n & .edge-pattern-dashed{\n stroke-dasharray: 3;\n }\n .edge-pattern-dotted {\n stroke-dasharray: 2;\n }\n\n & .marker {\n fill: ${i.lineColor};\n stroke: ${i.lineColor};\n }\n & .marker.cross {\n stroke: ${i.lineColor};\n }\n\n & svg {\n font-family: ${i.fontFamily};\n font-size: ${i.fontSize};\n }\n\n ${r}\n\n ${e}\n`};let _r="",Cr="",Tr="";const Er=t=>wt(t,Zi()),vr=function(){_r="",Tr="",Cr=""},Sr=function(t){_r=Er(t).replace(/^\s+/g,"")},wr=function(){return _r||Cr},Ar=function(t){Tr=Er(t).replace(/\n\s+/g,"\n")},Br=function(){return Tr},Lr=function(t){Cr=Er(t)},Dr=function(){return Cr},Ir={setAccTitle:Sr,getAccTitle:wr,setDiagramTitle:Lr,getDiagramTitle:Dr,getAccDescription:Br,setAccDescription:Ar,clear:vr},Or=Object.freeze(Object.defineProperty({__proto__:null,clear:vr,default:Ir,getAccDescription:Br,getAccTitle:wr,getDiagramTitle:Dr,setAccDescription:Ar,setAccTitle:Sr,setDiagramTitle:Lr},Symbol.toStringTag,{value:"Module"}));let $r={};const Nr=function(t,e,i,r){Tt.debug("parseDirective is being called",e,i,r);try{if(void 0!==e)switch(e=e.trim(),i){case"open_directive":$r={};break;case"type_directive":if(!$r)throw new Error("currentDirective is undefined");$r.type=e.toLowerCase();break;case"arg_directive":if(!$r)throw new Error("currentDirective is undefined");$r.args=JSON.parse(e);break;case"close_directive":Fr(t,$r,r),$r=void 0}}catch(n){Tt.error(`Error while rendering sequenceDiagram directive: ${e} jison context: ${i}`),Tt.error(n.message)}},Fr=function(t,e,i){switch(Tt.info(`Directive type=${e.type} with args:`,e.args),e.type){case"init":case"initialize":["config"].forEach((t=>{void 0!==e.args[t]&&("flowchart-v2"===i&&(i="flowchart"),e.args[i]=e.args[t],delete e.args[t])})),Tt.info("sanitize in handleDirective",e.args),Mi(e.args),Tt.info("sanitize in handleDirective (done)",e.args),tr(e.args);break;case"wrap":case"nowrap":t&&t.setWrap&&t.setWrap("wrap"===e.type);break;case"themeCss":Tt.warn("themeCss encountered");break;default:Tt.warn(`Unhandled directive: source: '%%{${e.type}: ${JSON.stringify(e.args?e.args:{})}}%%`,e)}},Rr=Tt,Mr=Et,Pr=Zi,zr=t=>wt(t,Pr()),jr=ar,Yr=(t,e,i,r)=>Nr(t,e,i,r),Wr={},Ur=(t,e,i)=>{if(Wr[t])throw new Error(`Diagram ${t} already registered.`);var r,n;Wr[t]=e,i&&bi(t,i),r=t,n=e.styles,xr[r]=n,e.injectUtils&&e.injectUtils(Rr,Mr,Pr,zr,jr,Or,Yr)},qr=t=>{if(t in Wr)return Wr[t];throw new Error(`Diagram ${t} not found.`)};var Vr=function(){var t=function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i},e=[1,4],i=[1,7],r=[1,5],n=[1,9],s=[1,6],a=[2,6],o=[1,16],l=[6,8,14,20,22,24,25,27,29,32,37,40,50,55],c=[8,14,20,22,24,25,27,29,32,37,40],h=[8,13,14,20,22,24,25,27,29,32,37,40],d=[1,26],u=[6,8,14,50,55],p=[8,14,55],g=[1,53],y=[1,52],f=[8,14,30,33,35,38,55],m=[1,67],b=[1,68],x=[1,69],k=[8,14,33,35,42,55],_={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,directive:5,GG:6,document:7,EOF:8,":":9,DIR:10,options:11,body:12,OPT:13,NL:14,line:15,statement:16,commitStatement:17,mergeStatement:18,cherryPickStatement:19,acc_title:20,acc_title_value:21,acc_descr:22,acc_descr_value:23,acc_descr_multiline_value:24,section:25,branchStatement:26,CHECKOUT:27,ref:28,BRANCH:29,ORDER:30,NUM:31,CHERRY_PICK:32,COMMIT_ID:33,STR:34,COMMIT_TAG:35,EMPTYSTR:36,MERGE:37,COMMIT_TYPE:38,commitType:39,COMMIT:40,commit_arg:41,COMMIT_MSG:42,NORMAL:43,REVERSE:44,HIGHLIGHT:45,openDirective:46,typeDirective:47,closeDirective:48,argDirective:49,open_directive:50,type_directive:51,arg_directive:52,close_directive:53,ID:54,";":55,$accept:0,$end:1},terminals_:{2:"error",6:"GG",8:"EOF",9:":",10:"DIR",13:"OPT",14:"NL",20:"acc_title",21:"acc_title_value",22:"acc_descr",23:"acc_descr_value",24:"acc_descr_multiline_value",25:"section",27:"CHECKOUT",29:"BRANCH",30:"ORDER",31:"NUM",32:"CHERRY_PICK",33:"COMMIT_ID",34:"STR",35:"COMMIT_TAG",36:"EMPTYSTR",37:"MERGE",38:"COMMIT_TYPE",40:"COMMIT",42:"COMMIT_MSG",43:"NORMAL",44:"REVERSE",45:"HIGHLIGHT",50:"open_directive",51:"type_directive",52:"arg_directive",53:"close_directive",54:"ID",55:";"},productions_:[0,[3,2],[3,2],[3,3],[3,4],[3,5],[7,0],[7,2],[11,2],[11,1],[12,0],[12,2],[15,2],[15,1],[16,1],[16,1],[16,1],[16,2],[16,2],[16,1],[16,1],[16,1],[16,2],[26,2],[26,4],[19,3],[19,5],[19,5],[19,5],[19,5],[18,2],[18,4],[18,4],[18,4],[18,6],[18,6],[18,6],[18,6],[18,6],[18,6],[18,8],[18,8],[18,8],[18,8],[18,8],[18,8],[17,2],[17,3],[17,3],[17,5],[17,5],[17,3],[17,5],[17,5],[17,5],[17,5],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,3],[17,5],[17,5],[17,5],[17,5],[17,5],[17,5],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[41,0],[41,1],[39,1],[39,1],[39,1],[5,3],[5,5],[46,1],[47,1],[49,1],[48,1],[28,1],[28,1],[4,1],[4,1],[4,1]],performAction:function(t,e,i,r,n,s,a){var o=s.length-1;switch(n){case 3:return s[o];case 4:return s[o-1];case 5:return r.setDirection(s[o-3]),s[o-1];case 7:r.setOptions(s[o-1]),this.$=s[o];break;case 8:s[o-1]+=s[o],this.$=s[o-1];break;case 10:this.$=[];break;case 11:s[o-1].push(s[o]),this.$=s[o-1];break;case 12:this.$=s[o-1];break;case 17:this.$=s[o].trim(),r.setAccTitle(this.$);break;case 18:case 19:this.$=s[o].trim(),r.setAccDescription(this.$);break;case 20:r.addSection(s[o].substr(8)),this.$=s[o].substr(8);break;case 22:r.checkout(s[o]);break;case 23:r.branch(s[o]);break;case 24:r.branch(s[o-2],s[o]);break;case 25:r.cherryPick(s[o],"",void 0);break;case 26:r.cherryPick(s[o-2],"",s[o]);break;case 27:case 29:r.cherryPick(s[o-2],"","");break;case 28:r.cherryPick(s[o],"",s[o-2]);break;case 30:r.merge(s[o],"","","");break;case 31:r.merge(s[o-2],s[o],"","");break;case 32:r.merge(s[o-2],"",s[o],"");break;case 33:r.merge(s[o-2],"","",s[o]);break;case 34:r.merge(s[o-4],s[o],"",s[o-2]);break;case 35:r.merge(s[o-4],"",s[o],s[o-2]);break;case 36:r.merge(s[o-4],"",s[o-2],s[o]);break;case 37:r.merge(s[o-4],s[o-2],s[o],"");break;case 38:r.merge(s[o-4],s[o-2],"",s[o]);break;case 39:r.merge(s[o-4],s[o],s[o-2],"");break;case 40:r.merge(s[o-6],s[o-4],s[o-2],s[o]);break;case 41:r.merge(s[o-6],s[o],s[o-4],s[o-2]);break;case 42:r.merge(s[o-6],s[o-4],s[o],s[o-2]);break;case 43:r.merge(s[o-6],s[o-2],s[o-4],s[o]);break;case 44:r.merge(s[o-6],s[o],s[o-2],s[o-4]);break;case 45:r.merge(s[o-6],s[o-2],s[o],s[o-4]);break;case 46:r.commit(s[o]);break;case 47:r.commit("","",r.commitType.NORMAL,s[o]);break;case 48:r.commit("","",s[o],"");break;case 49:r.commit("","",s[o],s[o-2]);break;case 50:r.commit("","",s[o-2],s[o]);break;case 51:r.commit("",s[o],r.commitType.NORMAL,"");break;case 52:r.commit("",s[o-2],r.commitType.NORMAL,s[o]);break;case 53:r.commit("",s[o],r.commitType.NORMAL,s[o-2]);break;case 54:r.commit("",s[o-2],s[o],"");break;case 55:r.commit("",s[o],s[o-2],"");break;case 56:r.commit("",s[o-4],s[o-2],s[o]);break;case 57:r.commit("",s[o-4],s[o],s[o-2]);break;case 58:r.commit("",s[o-2],s[o-4],s[o]);break;case 59:r.commit("",s[o],s[o-4],s[o-2]);break;case 60:r.commit("",s[o],s[o-2],s[o-4]);break;case 61:r.commit("",s[o-2],s[o],s[o-4]);break;case 62:r.commit(s[o],"",r.commitType.NORMAL,"");break;case 63:r.commit(s[o],"",r.commitType.NORMAL,s[o-2]);break;case 64:r.commit(s[o-2],"",r.commitType.NORMAL,s[o]);break;case 65:r.commit(s[o-2],"",s[o],"");break;case 66:r.commit(s[o],"",s[o-2],"");break;case 67:r.commit(s[o],s[o-2],r.commitType.NORMAL,"");break;case 68:r.commit(s[o-2],s[o],r.commitType.NORMAL,"");break;case 69:r.commit(s[o-4],"",s[o-2],s[o]);break;case 70:r.commit(s[o-4],"",s[o],s[o-2]);break;case 71:r.commit(s[o-2],"",s[o-4],s[o]);break;case 72:r.commit(s[o],"",s[o-4],s[o-2]);break;case 73:r.commit(s[o],"",s[o-2],s[o-4]);break;case 74:r.commit(s[o-2],"",s[o],s[o-4]);break;case 75:r.commit(s[o-4],s[o],s[o-2],"");break;case 76:r.commit(s[o-4],s[o-2],s[o],"");break;case 77:r.commit(s[o-2],s[o],s[o-4],"");break;case 78:r.commit(s[o],s[o-2],s[o-4],"");break;case 79:r.commit(s[o],s[o-4],s[o-2],"");break;case 80:r.commit(s[o-2],s[o-4],s[o],"");break;case 81:r.commit(s[o-4],s[o],r.commitType.NORMAL,s[o-2]);break;case 82:r.commit(s[o-4],s[o-2],r.commitType.NORMAL,s[o]);break;case 83:r.commit(s[o-2],s[o],r.commitType.NORMAL,s[o-4]);break;case 84:r.commit(s[o],s[o-2],r.commitType.NORMAL,s[o-4]);break;case 85:r.commit(s[o],s[o-4],r.commitType.NORMAL,s[o-2]);break;case 86:r.commit(s[o-2],s[o-4],r.commitType.NORMAL,s[o]);break;case 87:r.commit(s[o-6],s[o-4],s[o-2],s[o]);break;case 88:r.commit(s[o-6],s[o-4],s[o],s[o-2]);break;case 89:r.commit(s[o-6],s[o-2],s[o-4],s[o]);break;case 90:r.commit(s[o-6],s[o],s[o-4],s[o-2]);break;case 91:r.commit(s[o-6],s[o-2],s[o],s[o-4]);break;case 92:r.commit(s[o-6],s[o],s[o-2],s[o-4]);break;case 93:r.commit(s[o-4],s[o-6],s[o-2],s[o]);break;case 94:r.commit(s[o-4],s[o-6],s[o],s[o-2]);break;case 95:r.commit(s[o-2],s[o-6],s[o-4],s[o]);break;case 96:r.commit(s[o],s[o-6],s[o-4],s[o-2]);break;case 97:r.commit(s[o-2],s[o-6],s[o],s[o-4]);break;case 98:r.commit(s[o],s[o-6],s[o-2],s[o-4]);break;case 99:r.commit(s[o],s[o-4],s[o-2],s[o-6]);break;case 100:r.commit(s[o-2],s[o-4],s[o],s[o-6]);break;case 101:r.commit(s[o],s[o-2],s[o-4],s[o-6]);break;case 102:r.commit(s[o-2],s[o],s[o-4],s[o-6]);break;case 103:r.commit(s[o-4],s[o-2],s[o],s[o-6]);break;case 104:r.commit(s[o-4],s[o],s[o-2],s[o-6]);break;case 105:r.commit(s[o-2],s[o-4],s[o-6],s[o]);break;case 106:r.commit(s[o],s[o-4],s[o-6],s[o-2]);break;case 107:r.commit(s[o-2],s[o],s[o-6],s[o-4]);break;case 108:r.commit(s[o],s[o-2],s[o-6],s[o-4]);break;case 109:r.commit(s[o-4],s[o-2],s[o-6],s[o]);break;case 110:r.commit(s[o-4],s[o],s[o-6],s[o-2]);break;case 111:this.$="";break;case 112:this.$=s[o];break;case 113:this.$=r.commitType.NORMAL;break;case 114:this.$=r.commitType.REVERSE;break;case 115:this.$=r.commitType.HIGHLIGHT;break;case 118:r.parseDirective("%%{","open_directive");break;case 119:r.parseDirective(s[o],"type_directive");break;case 120:s[o]=s[o].trim().replace(/'/g,'"'),r.parseDirective(s[o],"arg_directive");break;case 121:r.parseDirective("}%%","close_directive","gitGraph")}},table:[{3:1,4:2,5:3,6:e,8:i,14:r,46:8,50:n,55:s},{1:[3]},{3:10,4:2,5:3,6:e,8:i,14:r,46:8,50:n,55:s},{3:11,4:2,5:3,6:e,8:i,14:r,46:8,50:n,55:s},{7:12,8:a,9:[1,13],10:[1,14],11:15,14:o},t(l,[2,124]),t(l,[2,125]),t(l,[2,126]),{47:17,51:[1,18]},{51:[2,118]},{1:[2,1]},{1:[2,2]},{8:[1,19]},{7:20,8:a,11:15,14:o},{9:[1,21]},t(c,[2,10],{12:22,13:[1,23]}),t(h,[2,9]),{9:[1,25],48:24,53:d},t([9,53],[2,119]),{1:[2,3]},{8:[1,27]},{7:28,8:a,11:15,14:o},{8:[2,7],14:[1,31],15:29,16:30,17:32,18:33,19:34,20:[1,35],22:[1,36],24:[1,37],25:[1,38],26:39,27:[1,40],29:[1,44],32:[1,43],37:[1,42],40:[1,41]},t(h,[2,8]),t(u,[2,116]),{49:45,52:[1,46]},t(u,[2,121]),{1:[2,4]},{8:[1,47]},t(c,[2,11]),{4:48,8:i,14:r,55:s},t(c,[2,13]),t(p,[2,14]),t(p,[2,15]),t(p,[2,16]),{21:[1,49]},{23:[1,50]},t(p,[2,19]),t(p,[2,20]),t(p,[2,21]),{28:51,34:g,54:y},t(p,[2,111],{41:54,33:[1,57],34:[1,59],35:[1,55],38:[1,56],42:[1,58]}),{28:60,34:g,54:y},{33:[1,61],35:[1,62]},{28:63,34:g,54:y},{48:64,53:d},{53:[2,120]},{1:[2,5]},t(c,[2,12]),t(p,[2,17]),t(p,[2,18]),t(p,[2,22]),t(f,[2,122]),t(f,[2,123]),t(p,[2,46]),{34:[1,65]},{39:66,43:m,44:b,45:x},{34:[1,70]},{34:[1,71]},t(p,[2,112]),t(p,[2,30],{33:[1,72],35:[1,74],38:[1,73]}),{34:[1,75]},{34:[1,76],36:[1,77]},t(p,[2,23],{30:[1,78]}),t(u,[2,117]),t(p,[2,47],{33:[1,80],38:[1,79],42:[1,81]}),t(p,[2,48],{33:[1,83],35:[1,82],42:[1,84]}),t(k,[2,113]),t(k,[2,114]),t(k,[2,115]),t(p,[2,51],{35:[1,85],38:[1,86],42:[1,87]}),t(p,[2,62],{33:[1,90],35:[1,88],38:[1,89]}),{34:[1,91]},{39:92,43:m,44:b,45:x},{34:[1,93]},t(p,[2,25],{35:[1,94]}),{33:[1,95]},{33:[1,96]},{31:[1,97]},{39:98,43:m,44:b,45:x},{34:[1,99]},{34:[1,100]},{34:[1,101]},{34:[1,102]},{34:[1,103]},{34:[1,104]},{39:105,43:m,44:b,45:x},{34:[1,106]},{34:[1,107]},{39:108,43:m,44:b,45:x},{34:[1,109]},t(p,[2,31],{35:[1,111],38:[1,110]}),t(p,[2,32],{33:[1,113],35:[1,112]}),t(p,[2,33],{33:[1,114],38:[1,115]}),{34:[1,116],36:[1,117]},{34:[1,118]},{34:[1,119]},t(p,[2,24]),t(p,[2,49],{33:[1,120],42:[1,121]}),t(p,[2,53],{38:[1,122],42:[1,123]}),t(p,[2,63],{33:[1,125],38:[1,124]}),t(p,[2,50],{33:[1,126],42:[1,127]}),t(p,[2,55],{35:[1,128],42:[1,129]}),t(p,[2,66],{33:[1,131],35:[1,130]}),t(p,[2,52],{38:[1,132],42:[1,133]}),t(p,[2,54],{35:[1,134],42:[1,135]}),t(p,[2,67],{35:[1,137],38:[1,136]}),t(p,[2,64],{33:[1,139],38:[1,138]}),t(p,[2,65],{33:[1,141],35:[1,140]}),t(p,[2,68],{35:[1,143],38:[1,142]}),{39:144,43:m,44:b,45:x},{34:[1,145]},{34:[1,146]},{34:[1,147]},{34:[1,148]},{39:149,43:m,44:b,45:x},t(p,[2,26]),t(p,[2,27]),t(p,[2,28]),t(p,[2,29]),{34:[1,150]},{34:[1,151]},{39:152,43:m,44:b,45:x},{34:[1,153]},{39:154,43:m,44:b,45:x},{34:[1,155]},{34:[1,156]},{34:[1,157]},{34:[1,158]},{34:[1,159]},{34:[1,160]},{34:[1,161]},{39:162,43:m,44:b,45:x},{34:[1,163]},{34:[1,164]},{34:[1,165]},{39:166,43:m,44:b,45:x},{34:[1,167]},{39:168,43:m,44:b,45:x},{34:[1,169]},{34:[1,170]},{34:[1,171]},{39:172,43:m,44:b,45:x},{34:[1,173]},t(p,[2,37],{35:[1,174]}),t(p,[2,38],{38:[1,175]}),t(p,[2,36],{33:[1,176]}),t(p,[2,39],{35:[1,177]}),t(p,[2,34],{38:[1,178]}),t(p,[2,35],{33:[1,179]}),t(p,[2,60],{42:[1,180]}),t(p,[2,73],{33:[1,181]}),t(p,[2,61],{42:[1,182]}),t(p,[2,84],{38:[1,183]}),t(p,[2,74],{33:[1,184]}),t(p,[2,83],{38:[1,185]}),t(p,[2,59],{42:[1,186]}),t(p,[2,72],{33:[1,187]}),t(p,[2,58],{42:[1,188]}),t(p,[2,78],{35:[1,189]}),t(p,[2,71],{33:[1,190]}),t(p,[2,77],{35:[1,191]}),t(p,[2,57],{42:[1,192]}),t(p,[2,85],{38:[1,193]}),t(p,[2,56],{42:[1,194]}),t(p,[2,79],{35:[1,195]}),t(p,[2,80],{35:[1,196]}),t(p,[2,86],{38:[1,197]}),t(p,[2,70],{33:[1,198]}),t(p,[2,81],{38:[1,199]}),t(p,[2,69],{33:[1,200]}),t(p,[2,75],{35:[1,201]}),t(p,[2,76],{35:[1,202]}),t(p,[2,82],{38:[1,203]}),{34:[1,204]},{39:205,43:m,44:b,45:x},{34:[1,206]},{34:[1,207]},{39:208,43:m,44:b,45:x},{34:[1,209]},{34:[1,210]},{34:[1,211]},{34:[1,212]},{39:213,43:m,44:b,45:x},{34:[1,214]},{39:215,43:m,44:b,45:x},{34:[1,216]},{34:[1,217]},{34:[1,218]},{34:[1,219]},{34:[1,220]},{34:[1,221]},{34:[1,222]},{39:223,43:m,44:b,45:x},{34:[1,224]},{34:[1,225]},{34:[1,226]},{39:227,43:m,44:b,45:x},{34:[1,228]},{39:229,43:m,44:b,45:x},{34:[1,230]},{34:[1,231]},{34:[1,232]},{39:233,43:m,44:b,45:x},t(p,[2,40]),t(p,[2,42]),t(p,[2,41]),t(p,[2,43]),t(p,[2,45]),t(p,[2,44]),t(p,[2,101]),t(p,[2,102]),t(p,[2,99]),t(p,[2,100]),t(p,[2,104]),t(p,[2,103]),t(p,[2,108]),t(p,[2,107]),t(p,[2,106]),t(p,[2,105]),t(p,[2,110]),t(p,[2,109]),t(p,[2,98]),t(p,[2,97]),t(p,[2,96]),t(p,[2,95]),t(p,[2,93]),t(p,[2,94]),t(p,[2,92]),t(p,[2,91]),t(p,[2,90]),t(p,[2,89]),t(p,[2,87]),t(p,[2,88])],defaultActions:{9:[2,118],10:[2,1],11:[2,2],19:[2,3],27:[2,4],46:[2,120],47:[2,5]},parseError:function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},parse:function(t){var e=this,i=[0],r=[],n=[null],s=[],a=this.table,o="",l=0,c=0,h=s.slice.call(arguments,1),d=Object.create(this.lexer),u={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(u.yy[p]=this.yy[p]);d.setInput(t,u.yy),u.yy.lexer=d,u.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;s.push(g);var y=d.options&&d.options.ranges;"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var f,m,b,x,k,_,C,T,E,v={};;){if(m=i[i.length-1],this.defaultActions[m]?b=this.defaultActions[m]:(null==f&&(E=void 0,"number"!=typeof(E=r.pop()||d.lex()||1)&&(E instanceof Array&&(E=(r=E).pop()),E=e.symbols_[E]||E),f=E),b=a[m]&&a[m][f]),void 0===b||!b.length||!b[0]){var S="";for(k in T=[],a[m])this.terminals_[k]&&k>2&&T.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[f]||f,line:d.yylineno,loc:g,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+f);switch(b[0]){case 1:i.push(f),n.push(d.yytext),s.push(d.yylloc),i.push(b[1]),f=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(_=this.productions_[b[1]][1],v.$=n[n.length-_],v._$={first_line:s[s.length-(_||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(_||1)].first_column,last_column:s[s.length-1].last_column},y&&(v._$.range=[s[s.length-(_||1)].range[0],s[s.length-1].range[1]]),void 0!==(x=this.performAction.apply(v,[o,c,l,u.yy,b[1],n,s].concat(h))))return x;_&&(i=i.slice(0,-1*_*2),n=n.slice(0,-1*_),s=s.slice(0,-1*_)),i.push(this.productions_[b[1]][0]),n.push(v.$),s.push(v._$),C=a[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},C=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}, +// resets the lexer, sets new input +setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}, +// consumes and returns one char from the input +input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}, +// unshifts one char (or a string) into the input +unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===r.length?this.yylloc.first_column:0)+r[r.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}, +// When called from action, caches matched text and appends it on next action +more:function(){return this._more=!0,this}, +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// retain first n characters of the match +less:function(t){this.unput(this.match.slice(t))}, +// displays already matched input, i.e. for error messages +pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}, +// displays upcoming input, i.e. for error messages +upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}, +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}, +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(t,e){var i,r,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var s in n)this[s]=n[s];return!1}return!1}, +// return next match in input +next:function(){if(this.done)return this.EOF;var t,e,i,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),s=0;se[0].length)){if(e=i,r=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// return next match that has a token +lex:function(){var t=this.next();return t||this.lex()}, +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function(t){this.conditionStack.push(t)}, +// pop the previously active lexer condition state off the condition stack +popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}, +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}, +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}, +// alias for begin(condition) +pushState:function(t){this.begin(t)}, +// return the number of states currently on the stack +stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,i,r){switch(i){case 0:return this.begin("open_directive"),50;case 1:return this.begin("type_directive"),51;case 2:return this.popState(),this.begin("arg_directive"),9;case 3:return this.popState(),this.popState(),53;case 4:return 52;case 5:return this.begin("acc_title"),20;case 6:return this.popState(),"acc_title_value";case 7:return this.begin("acc_descr"),22;case 8:return this.popState(),"acc_descr_value";case 9:this.begin("acc_descr_multiline");break;case 10:case 34:case 38:this.popState();break;case 11:return"acc_descr_multiline_value";case 12:return 14;case 13:case 14:break;case 15:return 6;case 16:return 40;case 17:return 33;case 18:return 38;case 19:return 42;case 20:return 43;case 21:return 44;case 22:return 45;case 23:return 35;case 24:return 29;case 25:return 30;case 26:return 37;case 27:return 32;case 28:return 27;case 29:case 30:return 10;case 31:return 9;case 32:return"CARET";case 33:this.begin("options");break;case 35:return 13;case 36:return 36;case 37:this.begin("string");break;case 39:return 34;case 40:return 31;case 41:return 54;case 42:return 8}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:(\r?\n)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:gitGraph\b)/i,/^(?:commit(?=\s|$))/i,/^(?:id:)/i,/^(?:type:)/i,/^(?:msg:)/i,/^(?:NORMAL\b)/i,/^(?:REVERSE\b)/i,/^(?:HIGHLIGHT\b)/i,/^(?:tag:)/i,/^(?:branch(?=\s|$))/i,/^(?:order:)/i,/^(?:merge(?=\s|$))/i,/^(?:cherry-pick(?=\s|$))/i,/^(?:checkout(?=\s|$))/i,/^(?:LR\b)/i,/^(?:BT\b)/i,/^(?::)/i,/^(?:\^)/i,/^(?:options\r?\n)/i,/^(?:[ \r\n\t]+end\b)/i,/^(?:[\s\S]+(?=[ \r\n\t]+end))/i,/^(?:["]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[0-9]+(?=\s|$))/i,/^(?:\w([-\./\w]*[-\w])?)/i,/^(?:$)/i,/^(?:\s+)/i],conditions:{acc_descr_multiline:{rules:[10,11],inclusive:!1},acc_descr:{rules:[8],inclusive:!1},acc_title:{rules:[6],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},options:{rules:[34,35],inclusive:!1},string:{rules:[38,39],inclusive:!1},INITIAL:{rules:[0,5,7,9,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,36,37,40,41,42,43],inclusive:!0}}};return t}();function T(){this.yy={}}return _.lexer=C,T.prototype=_,_.Parser=T,new T}();Vr.parser=Vr;const Hr=Vr,Gr=t=>null!==t.match(/^\s*gitGraph/);let Xr=Zi().gitGraph.mainBranchName,Kr=Zi().gitGraph.mainBranchOrder,Qr={},Zr=null,Jr={};Jr[Xr]={name:Xr,order:Kr};let tn={};tn[Xr]=Zr;let en=Xr,rn="LR",nn=0;function sn(){return Li({length:7})}let an={};const on=function(t){if(t=Ot.sanitizeText(t,Zi()),void 0===tn[t]){let e=new Error('Trying to checkout branch which is not yet created. (Help try using "branch '+t+'")');throw e.hash={text:"checkout "+t,token:"checkout "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:['"branch '+t+'"']},e}{en=t;const e=tn[en];Zr=Qr[e]}};function ln(t,e,i){const r=t.indexOf(e);-1===r?t.push(i):t.splice(r,1,i)}function cn(t){const e=t.reduce(((t,e)=>t.seq>e.seq?t:e),t[0]);let i="";t.forEach((function(t){i+=t===e?"\t*":"\t|"}));const r=[i,e.id,e.seq];for(let n in tn)tn[n]===e.id&&r.push(n);if(Tt.debug(r.join(" ")),e.parents&&2==e.parents.length){const i=Qr[e.parents[0]];ln(t,e,i),t.push(Qr[e.parents[1]])}else{if(0==e.parents.length)return;{const i=Qr[e.parents];ln(t,e,i)}}cn(t=function(t,e){const i=Object.create(null);return t.reduce(((t,r)=>{const n=e(r);return i[n]||(i[n]=!0,t.push(r)),t}),[])}(t,(t=>t.id)))}const hn=function(){const t=Object.keys(Qr).map((function(t){return Qr[t]}));return t.forEach((function(t){Tt.debug(t.id)})),t.sort(((t,e)=>t.seq-e.seq)),t},dn={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},un={parseDirective:function(t,e,i){np.parseDirective(this,t,e,i)},getConfig:()=>Zi().gitGraph,setDirection:function(t){rn=t},setOptions:function(t){Tt.debug("options str",t),t=(t=t&&t.trim())||"{}";try{an=JSON.parse(t)}catch(e){Tt.error("error while parsing gitGraph options",e.message)}},getOptions:function(){return an},commit:function(t,e,i,r){Tt.debug("Entering commit:",t,e,i,r),e=Ot.sanitizeText(e,Zi()),t=Ot.sanitizeText(t,Zi()),r=Ot.sanitizeText(r,Zi());const n={id:e||nn+"-"+sn(),message:t,seq:nn++,type:i||dn.NORMAL,tag:r||"",parents:null==Zr?[]:[Zr.id],branch:en};Zr=n,Qr[n.id]=n,tn[en]=n.id,Tt.debug("in pushCommit "+n.id)},branch:function(t,e){if(t=Ot.sanitizeText(t,Zi()),void 0!==tn[t]){let e=new Error('Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout '+t+'")');throw e.hash={text:"branch "+t,token:"branch "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:['"checkout '+t+'"']},e}tn[t]=null!=Zr?Zr.id:null,Jr[t]={name:t,order:e?parseInt(e,10):null},on(t),Tt.debug("in createBranch")},merge:function(t,e,i,r){t=Ot.sanitizeText(t,Zi()),e=Ot.sanitizeText(e,Zi());const n=Qr[tn[en]],s=Qr[tn[t]];if(en===t){let e=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw e.hash={text:"merge "+t,token:"merge "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["branch abc"]},e}if(void 0===n||!n){let e=new Error('Incorrect usage of "merge". Current branch ('+en+")has no commits");throw e.hash={text:"merge "+t,token:"merge "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["commit"]},e}if(void 0===tn[t]){let e=new Error('Incorrect usage of "merge". Branch to be merged ('+t+") does not exist");throw e.hash={text:"merge "+t,token:"merge "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["branch "+t]},e}if(void 0===s||!s){let e=new Error('Incorrect usage of "merge". Branch to be merged ('+t+") has no commits");throw e.hash={text:"merge "+t,token:"merge "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:['"commit"']},e}if(n===s){let e=new Error('Incorrect usage of "merge". Both branches have same head');throw e.hash={text:"merge "+t,token:"merge "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["branch abc"]},e}if(e&&void 0!==Qr[e]){let n=new Error('Incorrect usage of "merge". Commit with id:'+e+" already exists, use different custom Id");throw n.hash={text:"merge "+t+e+i+r,token:"merge "+t+e+i+r,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["merge "+t+" "+e+"_UNIQUE "+i+" "+r]},n}const a={id:e||nn+"-"+sn(),message:"merged branch "+t+" into "+en,seq:nn++,parents:[null==Zr?null:Zr.id,tn[t]],branch:en,type:dn.MERGE,customType:i,customId:!!e,tag:r||""};Zr=a,Qr[a.id]=a,tn[en]=a.id,Tt.debug(tn),Tt.debug("in mergeBranch")},cherryPick:function(t,e,i){if(Tt.debug("Entering cherryPick:",t,e,i),t=Ot.sanitizeText(t,Zi()),e=Ot.sanitizeText(e,Zi()),i=Ot.sanitizeText(i,Zi()),!t||void 0===Qr[t]){let i=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw i.hash={text:"cherryPick "+t+" "+e,token:"cherryPick "+t+" "+e,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["cherry-pick abc"]},i}let r=Qr[t],n=r.branch;if(r.type===dn.MERGE){let i=new Error('Incorrect usage of "cherryPick". Source commit should not be a merge commit');throw i.hash={text:"cherryPick "+t+" "+e,token:"cherryPick "+t+" "+e,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["cherry-pick abc"]},i}if(!e||void 0===Qr[e]){if(n===en){let i=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw i.hash={text:"cherryPick "+t+" "+e,token:"cherryPick "+t+" "+e,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["cherry-pick abc"]},i}const s=Qr[tn[en]];if(void 0===s||!s){let i=new Error('Incorrect usage of "cherry-pick". Current branch ('+en+")has no commits");throw i.hash={text:"cherryPick "+t+" "+e,token:"cherryPick "+t+" "+e,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["cherry-pick abc"]},i}const a={id:nn+"-"+sn(),message:"cherry-picked "+r+" into "+en,seq:nn++,parents:[null==Zr?null:Zr.id,r.id],branch:en,type:dn.CHERRY_PICK,tag:i??"cherry-pick:"+r.id};Zr=a,Qr[a.id]=a,tn[en]=a.id,Tt.debug(tn),Tt.debug("in cherryPick")}},checkout:on, +//reset, +prettyPrint:function(){Tt.debug(Qr);cn([hn()[0]])},clear:function(){Qr={},Zr=null;let t=Zi().gitGraph.mainBranchName,e=Zi().gitGraph.mainBranchOrder;tn={},tn[t]=null,Jr={},Jr[t]={name:t,order:e},en=t,nn=0,vr()},getBranchesAsObjArray:function(){const t=Object.values(Jr).map(((t,e)=>null!==t.order?t:{...t,order:parseFloat(`0.${e}`,10)})).sort(((t,e)=>t.order-e.order)).map((({name:t})=>({name:t})));return t},getBranches:function(){return tn},getCommits:function(){return Qr},getCommitsArray:hn,getCurrentBranch:function(){return en},getDirection:function(){return rn},getHead:function(){return Zr},setAccTitle:Sr,getAccTitle:wr,getAccDescription:Br,setAccDescription:Ar,setDiagramTitle:Lr,getDiagramTitle:Dr,commitType:dn};let pn={};const gn=0,yn=1,fn=2,mn=3,bn=4;let xn={},kn={},_n=[],Cn=0;const Tn=(t,e,i)=>{const r=Pr().gitGraph,n=t.append("g").attr("class","commit-bullets"),s=t.append("g").attr("class","commit-labels");let a=0;Object.keys(e).sort(((t,i)=>e[t].seq-e[i].seq)).forEach((t=>{const o=e[t],l=xn[o.branch].pos,c=a+10;if(i){let t,e=void 0!==o.customType&&""!==o.customType?o.customType:o.type;switch(e){case gn:t="commit-normal";break;case yn:t="commit-reverse";break;case fn:t="commit-highlight";break;case mn:t="commit-merge";break;case bn:t="commit-cherry-pick";break;default:t="commit-normal"}if(e===fn){const e=n.append("rect");e.attr("x",c-10),e.attr("y",l-10),e.attr("height",20),e.attr("width",20),e.attr("class",`commit ${o.id} commit-highlight${xn[o.branch].index%8} ${t}-outer`),n.append("rect").attr("x",c-6).attr("y",l-6).attr("height",12).attr("width",12).attr("class",`commit ${o.id} commit${xn[o.branch].index%8} ${t}-inner`)}else if(e===bn)n.append("circle").attr("cx",c).attr("cy",l).attr("r",10).attr("class",`commit ${o.id} ${t}`),n.append("circle").attr("cx",c-3).attr("cy",l+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${o.id} ${t}`),n.append("circle").attr("cx",c+3).attr("cy",l+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${o.id} ${t}`),n.append("line").attr("x1",c+3).attr("y1",l+1).attr("x2",c).attr("y2",l-5).attr("stroke","#fff").attr("class",`commit ${o.id} ${t}`),n.append("line").attr("x1",c-3).attr("y1",l+1).attr("x2",c).attr("y2",l-5).attr("stroke","#fff").attr("class",`commit ${o.id} ${t}`);else{const i=n.append("circle");if(i.attr("cx",c),i.attr("cy",l),i.attr("r",o.type===mn?9:10),i.attr("class",`commit ${o.id} commit${xn[o.branch].index%8}`),e===mn){const e=n.append("circle");e.attr("cx",c),e.attr("cy",l),e.attr("r",6),e.attr("class",`commit ${t} ${o.id} commit${xn[o.branch].index%8}`)}if(e===yn){n.append("path").attr("d",`M ${c-5},${l-5}L${c+5},${l+5}M${c-5},${l+5}L${c+5},${l-5}`).attr("class",`commit ${t} ${o.id} commit${xn[o.branch].index%8}`)}}}if(kn[o.id]={x:a+10,y:l},i){const t=4,e=2;if(o.type!==bn&&(o.customId&&o.type===mn||o.type!==mn)&&r.showCommitLabel){const t=s.append("g"),i=t.insert("rect").attr("class","commit-label-bkg"),n=t.append("text").attr("x",a).attr("y",l+25).attr("class","commit-label").text(o.id);let c=n.node().getBBox();if(i.attr("x",a+10-c.width/2-e).attr("y",l+13.5).attr("width",c.width+2*e).attr("height",c.height+2*e),n.attr("x",a+10-c.width/2),r.rotateCommitLabel){let e=-7.5-(c.width+10)/25*9.5,i=10+c.width/25*8.5;t.attr("transform","translate("+e+", "+i+") rotate(-45, "+a+", "+l+")")}}if(o.tag){const i=s.insert("polygon"),r=s.append("circle"),n=s.append("text").attr("y",l-16).attr("class","tag-label").text(o.tag);let c=n.node().getBBox();n.attr("x",a+10-c.width/2);const h=c.height/2,d=l-19.2;i.attr("class","tag-label-bkg").attr("points",`\n ${a-c.width/2-t/2},${d+e}\n ${a-c.width/2-t/2},${d-e}\n ${a+10-c.width/2-t},${d-h-e}\n ${a+10+c.width/2+t},${d-h-e}\n ${a+10+c.width/2+t},${d+h+e}\n ${a+10-c.width/2-t},${d+h+e}`),r.attr("cx",a-c.width/2+t/2).attr("cy",d).attr("r",1.5).attr("class","tag-hole")}}a+=50,a>Cn&&(Cn=a)}))},En=(t,e,i=0)=>{const r=t+Math.abs(t-e)/2;if(i>5)return r;if(_n.every((t=>Math.abs(t-r)>=10)))return _n.push(r),r;const n=Math.abs(t-e);return En(t,e-n/5,i+1)},vn=(t,e,i,r)=>{const n=kn[e.id],s=kn[i.id],a=((t,e,i)=>Object.keys(i).filter((r=>i[r].branch===e.branch&&i[r].seq>t.seq&&i[r].seq0)(e,i,r);let o,l="",c="",h=0,d=0,u=xn[i.branch].index;if(a){l="A 10 10, 0, 0, 0,",c="A 10 10, 0, 0, 1,",h=10,d=10,u=xn[i.branch].index;const t=n.ys.y&&(l="A 20 20, 0, 0, 0,",h=20,d=20,u=xn[e.branch].index,o=`M ${n.x} ${n.y} L ${s.x-h} ${n.y} ${l} ${s.x} ${n.y-d} L ${s.x} ${s.y}`),n.y===s.y&&(u=xn[e.branch].index,o=`M ${n.x} ${n.y} L ${n.x} ${s.y-h} ${l} ${n.x+d} ${s.y} L ${s.x} ${s.y}`);t.append("path").attr("d",o).attr("class","arrow arrow"+u%8)},Sn=(t,e)=>{const i=Pr().gitGraph,r=t.append("g");e.forEach(((t,e)=>{const n=e%8,s=xn[t.name].pos,a=r.append("line");a.attr("x1",0),a.attr("y1",s),a.attr("x2",Cn),a.attr("y2",s),a.attr("class","branch branch"+n),_n.push(s);const o=(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");let i=[];i="string"==typeof t?t.split(/\\n|\n|/gi):Array.isArray(t)?t:[];for(const r of i){const t=document.createElementNS("http://www.w3.org/2000/svg","tspan");t.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),t.setAttribute("dy","1em"),t.setAttribute("x","0"),t.setAttribute("class","row"),t.textContent=r.trim(),e.appendChild(t)}return e})(t.name),l=r.insert("rect"),c=r.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+n);c.node().appendChild(o);let h=o.getBBox();l.attr("class","branchLabelBkg label"+n).attr("rx",4).attr("ry",4).attr("x",-h.width-4-(!0===i.rotateCommitLabel?30:0)).attr("y",-h.height/2+8).attr("width",h.width+18).attr("height",h.height+4),c.attr("transform","translate("+(-h.width-14-(!0===i.rotateCommitLabel?30:0))+", "+(s-h.height/2-1)+")"),l.attr("transform","translate(-19, "+(s-h.height/2)+")")}))},wn={draw:function(t,e,i,r){xn={},kn={},pn={},Cn=0,_n=[];const n=Pr(),s=n.gitGraph;Tt.debug("in gitgraph renderer",t+"\n","id:",e,i),pn=r.db.getCommits();const a=r.db.getBranchesAsObjArray();let o=0;a.forEach(((t,e)=>{xn[t.name]={pos:o,index:e},o+=50+(s.rotateCommitLabel?40:0)}));const l=f(`[id="${e}"]`);Tn(l,pn,!1),s.showBranches&&Sn(l,a),((t,e)=>{const i=t.append("g").attr("class","commit-arrows");Object.keys(e).forEach((t=>{const r=e[t];r.parents&&r.parents.length>0&&r.parents.forEach((t=>{vn(i,e[t],r,e)}))}))})(l,pn),Tn(l,pn,!0),Yi.insertTitle(l,"gitTitleText",s.titleTopMargin,r.db.getDiagramTitle()),jr(void 0,l,s.diagramPadding,s.useMaxWidth??n.useMaxWidth)}},An=t=>`\n .commit-id,\n .commit-msg,\n .branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n ${[0,1,2,3,4,5,6,7].map((e=>`\n .branch-label${e} { fill: ${t["gitBranchLabel"+e]}; }\n .commit${e} { stroke: ${t["git"+e]}; fill: ${t["git"+e]}; }\n .commit-highlight${e} { stroke: ${t["gitInv"+e]}; fill: ${t["gitInv"+e]}; }\n .label${e} { fill: ${t["git"+e]}; }\n .arrow${e} { stroke: ${t["git"+e]}; }\n `)).join("\n")}\n\n .branch {\n stroke-width: 1;\n stroke: ${t.lineColor};\n stroke-dasharray: 2;\n }\n .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};}\n .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; }\n .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}\n .tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; }\n .tag-hole { fill: ${t.textColor}; }\n\n .commit-merge {\n stroke: ${t.primaryColor};\n fill: ${t.primaryColor};\n }\n .commit-reverse {\n stroke: ${t.primaryColor};\n fill: ${t.primaryColor};\n stroke-width: 3;\n }\n .commit-highlight-outer {\n }\n .commit-highlight-inner {\n stroke: ${t.primaryColor};\n fill: ${t.primaryColor};\n }\n\n .arrow { stroke-width: 8; stroke-linecap: round; fill: none}\n .gitTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n }\n`;var Bn=function(){var t=function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i},e=[1,6],i=[1,7],r=[1,8],n=[1,9],s=[1,16],a=[1,11],o=[1,12],l=[1,13],h=[1,14],d=[1,15],u=[1,27],p=[1,33],g=[1,34],y=[1,35],f=[1,36],m=[1,37],b=[1,72],x=[1,73],k=[1,74],_=[1,75],C=[1,76],T=[1,77],E=[1,78],v=[1,38],S=[1,39],w=[1,40],A=[1,41],B=[1,42],L=[1,43],D=[1,44],I=[1,45],O=[1,46],$=[1,47],N=[1,48],F=[1,49],R=[1,50],M=[1,51],P=[1,52],z=[1,53],j=[1,54],Y=[1,55],W=[1,56],U=[1,57],q=[1,59],V=[1,60],H=[1,61],G=[1,62],X=[1,63],K=[1,64],Q=[1,65],Z=[1,66],J=[1,67],tt=[1,68],et=[1,69],it=[24,52],rt=[24,44,46,47,48,49,50,51,52,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84],nt=[15,24,44,46,47,48,49,50,51,52,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84],st=[1,94],at=[1,95],ot=[1,96],lt=[1,97],ct=[15,24,52],ht=[7,8,9,10,18,22,25,26,27,28],dt=[15,24,43,52],ut=[15,24,43,52,86,87,89,90],pt=[15,43],gt=[44,46,47,48,49,50,51,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84],yt={trace:function(){},yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,directive:6,direction_tb:7,direction_bt:8,direction_rl:9,direction_lr:10,graphConfig:11,openDirective:12,typeDirective:13,closeDirective:14,NEWLINE:15,":":16,argDirective:17,open_directive:18,type_directive:19,arg_directive:20,close_directive:21,C4_CONTEXT:22,statements:23,EOF:24,C4_CONTAINER:25,C4_COMPONENT:26,C4_DYNAMIC:27,C4_DEPLOYMENT:28,otherStatements:29,diagramStatements:30,otherStatement:31,title:32,accDescription:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,boundaryStatement:39,boundaryStartStatement:40,boundaryStopStatement:41,boundaryStart:42,LBRACE:43,ENTERPRISE_BOUNDARY:44,attributes:45,SYSTEM_BOUNDARY:46,BOUNDARY:47,CONTAINER_BOUNDARY:48,NODE:49,NODE_L:50,NODE_R:51,RBRACE:52,diagramStatement:53,PERSON:54,PERSON_EXT:55,SYSTEM:56,SYSTEM_DB:57,SYSTEM_QUEUE:58,SYSTEM_EXT:59,SYSTEM_EXT_DB:60,SYSTEM_EXT_QUEUE:61,CONTAINER:62,CONTAINER_DB:63,CONTAINER_QUEUE:64,CONTAINER_EXT:65,CONTAINER_EXT_DB:66,CONTAINER_EXT_QUEUE:67,COMPONENT:68,COMPONENT_DB:69,COMPONENT_QUEUE:70,COMPONENT_EXT:71,COMPONENT_EXT_DB:72,COMPONENT_EXT_QUEUE:73,REL:74,BIREL:75,REL_U:76,REL_D:77,REL_L:78,REL_R:79,REL_B:80,REL_INDEX:81,UPDATE_EL_STYLE:82,UPDATE_REL_STYLE:83,UPDATE_LAYOUT_CONFIG:84,attribute:85,STR:86,STR_KEY:87,STR_VALUE:88,ATTRIBUTE:89,ATTRIBUTE_EMPTY:90,$accept:0,$end:1},terminals_:{2:"error",7:"direction_tb",8:"direction_bt",9:"direction_rl",10:"direction_lr",15:"NEWLINE",16:":",18:"open_directive",19:"type_directive",20:"arg_directive",21:"close_directive",22:"C4_CONTEXT",24:"EOF",25:"C4_CONTAINER",26:"C4_COMPONENT",27:"C4_DYNAMIC",28:"C4_DEPLOYMENT",32:"title",33:"accDescription",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",43:"LBRACE",44:"ENTERPRISE_BOUNDARY",46:"SYSTEM_BOUNDARY",47:"BOUNDARY",48:"CONTAINER_BOUNDARY",49:"NODE",50:"NODE_L",51:"NODE_R",52:"RBRACE",54:"PERSON",55:"PERSON_EXT",56:"SYSTEM",57:"SYSTEM_DB",58:"SYSTEM_QUEUE",59:"SYSTEM_EXT",60:"SYSTEM_EXT_DB",61:"SYSTEM_EXT_QUEUE",62:"CONTAINER",63:"CONTAINER_DB",64:"CONTAINER_QUEUE",65:"CONTAINER_EXT",66:"CONTAINER_EXT_DB",67:"CONTAINER_EXT_QUEUE",68:"COMPONENT",69:"COMPONENT_DB",70:"COMPONENT_QUEUE",71:"COMPONENT_EXT",72:"COMPONENT_EXT_DB",73:"COMPONENT_EXT_QUEUE",74:"REL",75:"BIREL",76:"REL_U",77:"REL_D",78:"REL_L",79:"REL_R",80:"REL_B",81:"REL_INDEX",82:"UPDATE_EL_STYLE",83:"UPDATE_REL_STYLE",84:"UPDATE_LAYOUT_CONFIG",86:"STR",87:"STR_KEY",88:"STR_VALUE",89:"ATTRIBUTE",90:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[3,2],[5,1],[5,1],[5,1],[5,1],[4,1],[6,4],[6,6],[12,1],[13,1],[17,1],[14,1],[11,4],[11,4],[11,4],[11,4],[11,4],[23,1],[23,1],[23,2],[29,1],[29,2],[29,3],[31,1],[31,1],[31,2],[31,2],[31,1],[39,3],[40,3],[40,3],[40,4],[42,2],[42,2],[42,2],[42,2],[42,2],[42,2],[42,2],[41,1],[30,1],[30,2],[30,3],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,1],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[45,1],[45,2],[85,1],[85,2],[85,1],[85,1]],performAction:function(t,e,i,r,n,s,a){var o=s.length-1;switch(n){case 4:r.setDirection("TB");break;case 5:r.setDirection("BT");break;case 6:r.setDirection("RL");break;case 7:r.setDirection("LR");break;case 11:r.parseDirective("%%{","open_directive");break;case 12:break;case 13:s[o]=s[o].trim().replace(/'/g,'"'),r.parseDirective(s[o],"arg_directive");break;case 14:r.parseDirective("}%%","close_directive","c4Context");break;case 15:case 16:case 17:case 18:case 19:r.setC4Type(s[o-3]);break;case 26:r.setTitle(s[o].substring(6)),this.$=s[o].substring(6);break;case 27:r.setAccDescription(s[o].substring(15)),this.$=s[o].substring(15);break;case 28:this.$=s[o].trim(),r.setTitle(this.$);break;case 29:case 30:this.$=s[o].trim(),r.setAccDescription(this.$);break;case 35:case 36:s[o].splice(2,0,"ENTERPRISE"),r.addPersonOrSystemBoundary(...s[o]),this.$=s[o];break;case 37:r.addPersonOrSystemBoundary(...s[o]),this.$=s[o];break;case 38:s[o].splice(2,0,"CONTAINER"),r.addContainerBoundary(...s[o]),this.$=s[o];break;case 39:r.addDeploymentNode("node",...s[o]),this.$=s[o];break;case 40:r.addDeploymentNode("nodeL",...s[o]),this.$=s[o];break;case 41:r.addDeploymentNode("nodeR",...s[o]),this.$=s[o];break;case 42:r.popBoundaryParseStack();break;case 46:r.addPersonOrSystem("person",...s[o]),this.$=s[o];break;case 47:r.addPersonOrSystem("external_person",...s[o]),this.$=s[o];break;case 48:r.addPersonOrSystem("system",...s[o]),this.$=s[o];break;case 49:r.addPersonOrSystem("system_db",...s[o]),this.$=s[o];break;case 50:r.addPersonOrSystem("system_queue",...s[o]),this.$=s[o];break;case 51:r.addPersonOrSystem("external_system",...s[o]),this.$=s[o];break;case 52:r.addPersonOrSystem("external_system_db",...s[o]),this.$=s[o];break;case 53:r.addPersonOrSystem("external_system_queue",...s[o]),this.$=s[o];break;case 54:r.addContainer("container",...s[o]),this.$=s[o];break;case 55:r.addContainer("container_db",...s[o]),this.$=s[o];break;case 56:r.addContainer("container_queue",...s[o]),this.$=s[o];break;case 57:r.addContainer("external_container",...s[o]),this.$=s[o];break;case 58:r.addContainer("external_container_db",...s[o]),this.$=s[o];break;case 59:r.addContainer("external_container_queue",...s[o]),this.$=s[o];break;case 60:r.addComponent("component",...s[o]),this.$=s[o];break;case 61:r.addComponent("component_db",...s[o]),this.$=s[o];break;case 62:r.addComponent("component_queue",...s[o]),this.$=s[o];break;case 63:r.addComponent("external_component",...s[o]),this.$=s[o];break;case 64:r.addComponent("external_component_db",...s[o]),this.$=s[o];break;case 65:r.addComponent("external_component_queue",...s[o]),this.$=s[o];break;case 67:r.addRel("rel",...s[o]),this.$=s[o];break;case 68:r.addRel("birel",...s[o]),this.$=s[o];break;case 69:r.addRel("rel_u",...s[o]),this.$=s[o];break;case 70:r.addRel("rel_d",...s[o]),this.$=s[o];break;case 71:r.addRel("rel_l",...s[o]),this.$=s[o];break;case 72:r.addRel("rel_r",...s[o]),this.$=s[o];break;case 73:r.addRel("rel_b",...s[o]),this.$=s[o];break;case 74:s[o].splice(0,1),r.addRel("rel",...s[o]),this.$=s[o];break;case 75:r.updateElStyle("update_el_style",...s[o]),this.$=s[o];break;case 76:r.updateRelStyle("update_rel_style",...s[o]),this.$=s[o];break;case 77:r.updateLayoutConfig("update_layout_config",...s[o]),this.$=s[o];break;case 78:this.$=[s[o]];break;case 79:s[o].unshift(s[o-1]),this.$=s[o];break;case 80:case 82:this.$=s[o].trim();break;case 81:let t={};t[s[o-1].trim()]=s[o].trim(),this.$=t;break;case 83:this.$=""}},table:[{3:1,4:2,5:3,6:4,7:e,8:i,9:r,10:n,11:5,12:10,18:s,22:a,25:o,26:l,27:h,28:d},{1:[3]},{1:[2,1]},{1:[2,2]},{3:17,4:2,5:3,6:4,7:e,8:i,9:r,10:n,11:5,12:10,18:s,22:a,25:o,26:l,27:h,28:d},{1:[2,8]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{1:[2,7]},{13:18,19:[1,19]},{15:[1,20]},{15:[1,21]},{15:[1,22]},{15:[1,23]},{15:[1,24]},{19:[2,11]},{1:[2,3]},{14:25,16:[1,26],21:u},t([16,21],[2,12]),{23:28,29:29,30:30,31:31,32:p,33:g,34:y,36:f,38:m,39:58,40:70,42:71,44:b,46:x,47:k,48:_,49:C,50:T,51:E,53:32,54:v,55:S,56:w,57:A,58:B,59:L,60:D,61:I,62:O,63:$,64:N,65:F,66:R,67:M,68:P,69:z,70:j,71:Y,72:W,73:U,74:q,75:V,76:H,77:G,78:X,79:K,80:Q,81:Z,82:J,83:tt,84:et},{23:79,29:29,30:30,31:31,32:p,33:g,34:y,36:f,38:m,39:58,40:70,42:71,44:b,46:x,47:k,48:_,49:C,50:T,51:E,53:32,54:v,55:S,56:w,57:A,58:B,59:L,60:D,61:I,62:O,63:$,64:N,65:F,66:R,67:M,68:P,69:z,70:j,71:Y,72:W,73:U,74:q,75:V,76:H,77:G,78:X,79:K,80:Q,81:Z,82:J,83:tt,84:et},{23:80,29:29,30:30,31:31,32:p,33:g,34:y,36:f,38:m,39:58,40:70,42:71,44:b,46:x,47:k,48:_,49:C,50:T,51:E,53:32,54:v,55:S,56:w,57:A,58:B,59:L,60:D,61:I,62:O,63:$,64:N,65:F,66:R,67:M,68:P,69:z,70:j,71:Y,72:W,73:U,74:q,75:V,76:H,77:G,78:X,79:K,80:Q,81:Z,82:J,83:tt,84:et},{23:81,29:29,30:30,31:31,32:p,33:g,34:y,36:f,38:m,39:58,40:70,42:71,44:b,46:x,47:k,48:_,49:C,50:T,51:E,53:32,54:v,55:S,56:w,57:A,58:B,59:L,60:D,61:I,62:O,63:$,64:N,65:F,66:R,67:M,68:P,69:z,70:j,71:Y,72:W,73:U,74:q,75:V,76:H,77:G,78:X,79:K,80:Q,81:Z,82:J,83:tt,84:et},{23:82,29:29,30:30,31:31,32:p,33:g,34:y,36:f,38:m,39:58,40:70,42:71,44:b,46:x,47:k,48:_,49:C,50:T,51:E,53:32,54:v,55:S,56:w,57:A,58:B,59:L,60:D,61:I,62:O,63:$,64:N,65:F,66:R,67:M,68:P,69:z,70:j,71:Y,72:W,73:U,74:q,75:V,76:H,77:G,78:X,79:K,80:Q,81:Z,82:J,83:tt,84:et},{15:[1,83]},{17:84,20:[1,85]},{15:[2,14]},{24:[1,86]},t(it,[2,20],{53:32,39:58,40:70,42:71,30:87,44:b,46:x,47:k,48:_,49:C,50:T,51:E,54:v,55:S,56:w,57:A,58:B,59:L,60:D,61:I,62:O,63:$,64:N,65:F,66:R,67:M,68:P,69:z,70:j,71:Y,72:W,73:U,74:q,75:V,76:H,77:G,78:X,79:K,80:Q,81:Z,82:J,83:tt,84:et}),t(it,[2,21]),t(rt,[2,23],{15:[1,88]}),t(it,[2,43],{15:[1,89]}),t(nt,[2,26]),t(nt,[2,27]),{35:[1,90]},{37:[1,91]},t(nt,[2,30]),{45:92,85:93,86:st,87:at,89:ot,90:lt},{45:98,85:93,86:st,87:at,89:ot,90:lt},{45:99,85:93,86:st,87:at,89:ot,90:lt},{45:100,85:93,86:st,87:at,89:ot,90:lt},{45:101,85:93,86:st,87:at,89:ot,90:lt},{45:102,85:93,86:st,87:at,89:ot,90:lt},{45:103,85:93,86:st,87:at,89:ot,90:lt},{45:104,85:93,86:st,87:at,89:ot,90:lt},{45:105,85:93,86:st,87:at,89:ot,90:lt},{45:106,85:93,86:st,87:at,89:ot,90:lt},{45:107,85:93,86:st,87:at,89:ot,90:lt},{45:108,85:93,86:st,87:at,89:ot,90:lt},{45:109,85:93,86:st,87:at,89:ot,90:lt},{45:110,85:93,86:st,87:at,89:ot,90:lt},{45:111,85:93,86:st,87:at,89:ot,90:lt},{45:112,85:93,86:st,87:at,89:ot,90:lt},{45:113,85:93,86:st,87:at,89:ot,90:lt},{45:114,85:93,86:st,87:at,89:ot,90:lt},{45:115,85:93,86:st,87:at,89:ot,90:lt},{45:116,85:93,86:st,87:at,89:ot,90:lt},t(ct,[2,66]),{45:117,85:93,86:st,87:at,89:ot,90:lt},{45:118,85:93,86:st,87:at,89:ot,90:lt},{45:119,85:93,86:st,87:at,89:ot,90:lt},{45:120,85:93,86:st,87:at,89:ot,90:lt},{45:121,85:93,86:st,87:at,89:ot,90:lt},{45:122,85:93,86:st,87:at,89:ot,90:lt},{45:123,85:93,86:st,87:at,89:ot,90:lt},{45:124,85:93,86:st,87:at,89:ot,90:lt},{45:125,85:93,86:st,87:at,89:ot,90:lt},{45:126,85:93,86:st,87:at,89:ot,90:lt},{45:127,85:93,86:st,87:at,89:ot,90:lt},{30:128,39:58,40:70,42:71,44:b,46:x,47:k,48:_,49:C,50:T,51:E,53:32,54:v,55:S,56:w,57:A,58:B,59:L,60:D,61:I,62:O,63:$,64:N,65:F,66:R,67:M,68:P,69:z,70:j,71:Y,72:W,73:U,74:q,75:V,76:H,77:G,78:X,79:K,80:Q,81:Z,82:J,83:tt,84:et},{15:[1,130],43:[1,129]},{45:131,85:93,86:st,87:at,89:ot,90:lt},{45:132,85:93,86:st,87:at,89:ot,90:lt},{45:133,85:93,86:st,87:at,89:ot,90:lt},{45:134,85:93,86:st,87:at,89:ot,90:lt},{45:135,85:93,86:st,87:at,89:ot,90:lt},{45:136,85:93,86:st,87:at,89:ot,90:lt},{45:137,85:93,86:st,87:at,89:ot,90:lt},{24:[1,138]},{24:[1,139]},{24:[1,140]},{24:[1,141]},t(ht,[2,9]),{14:142,21:u},{21:[2,13]},{1:[2,15]},t(it,[2,22]),t(rt,[2,24],{31:31,29:143,32:p,33:g,34:y,36:f,38:m}),t(it,[2,44],{29:29,30:30,31:31,53:32,39:58,40:70,42:71,23:144,32:p,33:g,34:y,36:f,38:m,44:b,46:x,47:k,48:_,49:C,50:T,51:E,54:v,55:S,56:w,57:A,58:B,59:L,60:D,61:I,62:O,63:$,64:N,65:F,66:R,67:M,68:P,69:z,70:j,71:Y,72:W,73:U,74:q,75:V,76:H,77:G,78:X,79:K,80:Q,81:Z,82:J,83:tt,84:et}),t(nt,[2,28]),t(nt,[2,29]),t(ct,[2,46]),t(dt,[2,78],{85:93,45:145,86:st,87:at,89:ot,90:lt}),t(ut,[2,80]),{88:[1,146]},t(ut,[2,82]),t(ut,[2,83]),t(ct,[2,47]),t(ct,[2,48]),t(ct,[2,49]),t(ct,[2,50]),t(ct,[2,51]),t(ct,[2,52]),t(ct,[2,53]),t(ct,[2,54]),t(ct,[2,55]),t(ct,[2,56]),t(ct,[2,57]),t(ct,[2,58]),t(ct,[2,59]),t(ct,[2,60]),t(ct,[2,61]),t(ct,[2,62]),t(ct,[2,63]),t(ct,[2,64]),t(ct,[2,65]),t(ct,[2,67]),t(ct,[2,68]),t(ct,[2,69]),t(ct,[2,70]),t(ct,[2,71]),t(ct,[2,72]),t(ct,[2,73]),t(ct,[2,74]),t(ct,[2,75]),t(ct,[2,76]),t(ct,[2,77]),{41:147,52:[1,148]},{15:[1,149]},{43:[1,150]},t(pt,[2,35]),t(pt,[2,36]),t(pt,[2,37]),t(pt,[2,38]),t(pt,[2,39]),t(pt,[2,40]),t(pt,[2,41]),{1:[2,16]},{1:[2,17]},{1:[2,18]},{1:[2,19]},{15:[1,151]},t(rt,[2,25]),t(it,[2,45]),t(dt,[2,79]),t(ut,[2,81]),t(ct,[2,31]),t(ct,[2,42]),t(gt,[2,32]),t(gt,[2,33],{15:[1,152]}),t(ht,[2,10]),t(gt,[2,34])],defaultActions:{2:[2,1],3:[2,2],5:[2,8],6:[2,4],7:[2,5],8:[2,6],9:[2,7],16:[2,11],17:[2,3],27:[2,14],85:[2,13],86:[2,15],138:[2,16],139:[2,17],140:[2,18],141:[2,19]},parseError:function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},parse:function(t){var e=this,i=[0],r=[],n=[null],s=[],a=this.table,o="",l=0,c=0,h=s.slice.call(arguments,1),d=Object.create(this.lexer),u={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(u.yy[p]=this.yy[p]);d.setInput(t,u.yy),u.yy.lexer=d,u.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;s.push(g);var y=d.options&&d.options.ranges;"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var f,m,b,x,k,_,C,T,E,v={};;){if(m=i[i.length-1],this.defaultActions[m]?b=this.defaultActions[m]:(null==f&&(E=void 0,"number"!=typeof(E=r.pop()||d.lex()||1)&&(E instanceof Array&&(E=(r=E).pop()),E=e.symbols_[E]||E),f=E),b=a[m]&&a[m][f]),void 0===b||!b.length||!b[0]){var S="";for(k in T=[],a[m])this.terminals_[k]&&k>2&&T.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[f]||f,line:d.yylineno,loc:g,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+f);switch(b[0]){case 1:i.push(f),n.push(d.yytext),s.push(d.yylloc),i.push(b[1]),f=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(_=this.productions_[b[1]][1],v.$=n[n.length-_],v._$={first_line:s[s.length-(_||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(_||1)].first_column,last_column:s[s.length-1].last_column},y&&(v._$.range=[s[s.length-(_||1)].range[0],s[s.length-1].range[1]]),void 0!==(x=this.performAction.apply(v,[o,c,l,u.yy,b[1],n,s].concat(h))))return x;_&&(i=i.slice(0,-1*_*2),n=n.slice(0,-1*_),s=s.slice(0,-1*_)),i.push(this.productions_[b[1]][0]),n.push(v.$),s.push(v._$),C=a[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},ft=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}, +// resets the lexer, sets new input +setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}, +// consumes and returns one char from the input +input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}, +// unshifts one char (or a string) into the input +unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===r.length?this.yylloc.first_column:0)+r[r.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}, +// When called from action, caches matched text and appends it on next action +more:function(){return this._more=!0,this}, +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// retain first n characters of the match +less:function(t){this.unput(this.match.slice(t))}, +// displays already matched input, i.e. for error messages +pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}, +// displays upcoming input, i.e. for error messages +upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}, +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}, +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(t,e){var i,r,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var s in n)this[s]=n[s];return!1}return!1}, +// return next match in input +next:function(){if(this.done)return this.EOF;var t,e,i,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),s=0;se[0].length)){if(e=i,r=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// return next match that has a token +lex:function(){var t=this.next();return t||this.lex()}, +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function(t){this.conditionStack.push(t)}, +// pop the previously active lexer condition state off the condition stack +popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}, +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}, +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}, +// alias for begin(condition) +pushState:function(t){this.begin(t)}, +// return the number of states currently on the stack +stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,i,r){switch(i){case 0:return this.begin("open_directive"),18;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 10;case 5:return this.begin("type_directive"),19;case 6:return this.popState(),this.begin("arg_directive"),16;case 7:return this.popState(),this.popState(),21;case 8:return 20;case 9:return 32;case 10:return 33;case 11:return this.begin("acc_title"),34;case 12:return this.popState(),"acc_title_value";case 13:return this.begin("acc_descr"),36;case 14:return this.popState(),"acc_descr_value";case 15:this.begin("acc_descr_multiline");break;case 16:case 78:this.popState();break;case 17:return"acc_descr_multiline_value";case 18:case 21:case 75:break;case 19:c;break;case 20:return 15;case 22:return 22;case 23:return 25;case 24:return 26;case 25:return 27;case 26:return 28;case 27:return this.begin("person_ext"),55;case 28:return this.begin("person"),54;case 29:return this.begin("system_ext_queue"),61;case 30:return this.begin("system_ext_db"),60;case 31:return this.begin("system_ext"),59;case 32:return this.begin("system_queue"),58;case 33:return this.begin("system_db"),57;case 34:return this.begin("system"),56;case 35:return this.begin("boundary"),47;case 36:return this.begin("enterprise_boundary"),44;case 37:return this.begin("system_boundary"),46;case 38:return this.begin("container_ext_queue"),67;case 39:return this.begin("container_ext_db"),66;case 40:return this.begin("container_ext"),65;case 41:return this.begin("container_queue"),64;case 42:return this.begin("container_db"),63;case 43:return this.begin("container"),62;case 44:return this.begin("container_boundary"),48;case 45:return this.begin("component_ext_queue"),73;case 46:return this.begin("component_ext_db"),72;case 47:return this.begin("component_ext"),71;case 48:return this.begin("component_queue"),70;case 49:return this.begin("component_db"),69;case 50:return this.begin("component"),68;case 51:case 52:return this.begin("node"),49;case 53:return this.begin("node_l"),50;case 54:return this.begin("node_r"),51;case 55:return this.begin("rel"),74;case 56:return this.begin("birel"),75;case 57:case 58:return this.begin("rel_u"),76;case 59:case 60:return this.begin("rel_d"),77;case 61:case 62:return this.begin("rel_l"),78;case 63:case 64:return this.begin("rel_r"),79;case 65:return this.begin("rel_b"),80;case 66:return this.begin("rel_index"),81;case 67:return this.begin("update_el_style"),82;case 68:return this.begin("update_rel_style"),83;case 69:return this.begin("update_layout_config"),84;case 70:return"EOF_IN_STRUCT";case 71:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 72:this.begin("attribute");break;case 73:case 84:this.popState(),this.popState();break;case 74:case 76:return 90;case 77:this.begin("string");break;case 79:case 85:return"STR";case 80:this.begin("string_kv");break;case 81:return this.begin("string_kv_key"),"STR_KEY";case 82:this.popState(),this.begin("string_kv_value");break;case 83:return"STR_VALUE";case 86:return"LBRACE";case 87:return"RBRACE";case 88:return"SPACE";case 89:return"EOL";case 90:return 24}},rules:[/^(?:%%\{)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[16,17],inclusive:!1},acc_descr:{rules:[14],inclusive:!1},acc_title:{rules:[12],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[7,8],inclusive:!1},type_directive:{rules:[6,7],inclusive:!1},open_directive:{rules:[5],inclusive:!1},string_kv_value:{rules:[83,84],inclusive:!1},string_kv_key:{rules:[82],inclusive:!1},string_kv:{rules:[81],inclusive:!1},string:{rules:[78,79],inclusive:!1},attribute:{rules:[73,74,75,76,77,80,85],inclusive:!1},update_layout_config:{rules:[70,71,72,73],inclusive:!1},update_rel_style:{rules:[70,71,72,73],inclusive:!1},update_el_style:{rules:[70,71,72,73],inclusive:!1},rel_b:{rules:[70,71,72,73],inclusive:!1},rel_r:{rules:[70,71,72,73],inclusive:!1},rel_l:{rules:[70,71,72,73],inclusive:!1},rel_d:{rules:[70,71,72,73],inclusive:!1},rel_u:{rules:[70,71,72,73],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[70,71,72,73],inclusive:!1},node_r:{rules:[70,71,72,73],inclusive:!1},node_l:{rules:[70,71,72,73],inclusive:!1},node:{rules:[70,71,72,73],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[70,71,72,73],inclusive:!1},component_ext_queue:{rules:[],inclusive:!1},component_ext_db:{rules:[70,71,72,73],inclusive:!1},component_ext:{rules:[70,71,72,73],inclusive:!1},component_queue:{rules:[70,71,72,73],inclusive:!1},component_db:{rules:[70,71,72,73],inclusive:!1},component:{rules:[70,71,72,73],inclusive:!1},container_boundary:{rules:[70,71,72,73],inclusive:!1},container_ext_queue:{rules:[],inclusive:!1},container_ext_db:{rules:[70,71,72,73],inclusive:!1},container_ext:{rules:[70,71,72,73],inclusive:!1},container_queue:{rules:[70,71,72,73],inclusive:!1},container_db:{rules:[70,71,72,73],inclusive:!1},container:{rules:[70,71,72,73],inclusive:!1},birel:{rules:[70,71,72,73],inclusive:!1},system_boundary:{rules:[70,71,72,73],inclusive:!1},enterprise_boundary:{rules:[70,71,72,73],inclusive:!1},boundary:{rules:[70,71,72,73],inclusive:!1},system_ext_queue:{rules:[70,71,72,73],inclusive:!1},system_ext_db:{rules:[70,71,72,73],inclusive:!1},system_ext:{rules:[70,71,72,73],inclusive:!1},system_queue:{rules:[70,71,72,73],inclusive:!1},system_db:{rules:[70,71,72,73],inclusive:!1},system:{rules:[70,71,72,73],inclusive:!1},person_ext:{rules:[70,71,72,73],inclusive:!1},person:{rules:[70,71,72,73],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,9,10,11,13,15,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,86,87,88,89,90],inclusive:!0}}};return t}();function mt(){this.yy={}}return yt.lexer=ft,mt.prototype=yt,yt.Parser=mt,new mt}();Bn.parser=Bn;const Ln=Bn,Dn=t=>null!==t.match(/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/);let In=[],On=[""],$n="global",Nn="",Fn=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Rn=[],Mn="",Pn=!1,zn=4,jn=2;var Yn;const Wn=function(t){return null==t?In:In.filter((e=>e.parentBoundary===t))},Un=function(){return Pn},qn={addPersonOrSystem:function(t,e,i,r,n,s,a){if(null===e||null===i)return;let o={};const l=In.find((t=>t.alias===e));if(l&&e===l.alias?o=l:(o.alias=e,In.push(o)),o.label=null==i?{text:""}:{text:i},null==r)o.descr={text:""};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];o[t]={text:e}}else o.descr={text:r};if("object"==typeof n){let[t,e]=Object.entries(n)[0];o[t]=e}else o.sprite=n;if("object"==typeof s){let[t,e]=Object.entries(s)[0];o[t]=e}else o.tags=s;if("object"==typeof a){let[t,e]=Object.entries(a)[0];o[t]=e}else o.link=a;o.typeC4Shape={text:t},o.parentBoundary=$n,o.wrap=Un()},addPersonOrSystemBoundary:function(t,e,i,r,n){if(null===t||null===e)return;let s={};const a=Fn.find((e=>e.alias===t));if(a&&t===a.alias?s=a:(s.alias=t,Fn.push(s)),s.label=null==e?{text:""}:{text:e},null==i)s.type={text:"system"};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];s[t]={text:e}}else s.type={text:i};if("object"==typeof r){let[t,e]=Object.entries(r)[0];s[t]=e}else s.tags=r;if("object"==typeof n){let[t,e]=Object.entries(n)[0];s[t]=e}else s.link=n;s.parentBoundary=$n,s.wrap=Un(),Nn=$n,$n=t,On.push(Nn)},addContainer:function(t,e,i,r,n,s,a,o){if(null===e||null===i)return;let l={};const c=In.find((t=>t.alias===e));if(c&&e===c.alias?l=c:(l.alias=e,In.push(l)),l.label=null==i?{text:""}:{text:i},null==r)l.techn={text:""};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];l[t]={text:e}}else l.techn={text:r};if(null==n)l.descr={text:""};else if("object"==typeof n){let[t,e]=Object.entries(n)[0];l[t]={text:e}}else l.descr={text:n};if("object"==typeof s){let[t,e]=Object.entries(s)[0];l[t]=e}else l.sprite=s;if("object"==typeof a){let[t,e]=Object.entries(a)[0];l[t]=e}else l.tags=a;if("object"==typeof o){let[t,e]=Object.entries(o)[0];l[t]=e}else l.link=o;l.wrap=Un(),l.typeC4Shape={text:t},l.parentBoundary=$n},addContainerBoundary:function(t,e,i,r,n){if(null===t||null===e)return;let s={};const a=Fn.find((e=>e.alias===t));if(a&&t===a.alias?s=a:(s.alias=t,Fn.push(s)),s.label=null==e?{text:""}:{text:e},null==i)s.type={text:"container"};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];s[t]={text:e}}else s.type={text:i};if("object"==typeof r){let[t,e]=Object.entries(r)[0];s[t]=e}else s.tags=r;if("object"==typeof n){let[t,e]=Object.entries(n)[0];s[t]=e}else s.link=n;s.parentBoundary=$n,s.wrap=Un(),Nn=$n,$n=t,On.push(Nn)},addComponent:function(t,e,i,r,n,s,a,o){if(null===e||null===i)return;let l={};const c=In.find((t=>t.alias===e));if(c&&e===c.alias?l=c:(l.alias=e,In.push(l)),l.label=null==i?{text:""}:{text:i},null==r)l.techn={text:""};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];l[t]={text:e}}else l.techn={text:r};if(null==n)l.descr={text:""};else if("object"==typeof n){let[t,e]=Object.entries(n)[0];l[t]={text:e}}else l.descr={text:n};if("object"==typeof s){let[t,e]=Object.entries(s)[0];l[t]=e}else l.sprite=s;if("object"==typeof a){let[t,e]=Object.entries(a)[0];l[t]=e}else l.tags=a;if("object"==typeof o){let[t,e]=Object.entries(o)[0];l[t]=e}else l.link=o;l.wrap=Un(),l.typeC4Shape={text:t},l.parentBoundary=$n},addDeploymentNode:function(t,e,i,r,n,s,a,o){if(null===e||null===i)return;let l={};const c=Fn.find((t=>t.alias===e));if(c&&e===c.alias?l=c:(l.alias=e,Fn.push(l)),l.label=null==i?{text:""}:{text:i},null==r)l.type={text:"node"};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];l[t]={text:e}}else l.type={text:r};if(null==n)l.descr={text:""};else if("object"==typeof n){let[t,e]=Object.entries(n)[0];l[t]={text:e}}else l.descr={text:n};if("object"==typeof a){let[t,e]=Object.entries(a)[0];l[t]=e}else l.tags=a;if("object"==typeof o){let[t,e]=Object.entries(o)[0];l[t]=e}else l.link=o;l.nodeType=t,l.parentBoundary=$n,l.wrap=Un(),Nn=$n,$n=e,On.push(Nn)},popBoundaryParseStack:function(){$n=Nn,On.pop(),Nn=On.pop(),On.push(Nn)},addRel:function(t,e,i,r,n,s,a,o,l){if(null==t||null==e||null==i||null==r)return;let c={};const h=Rn.find((t=>t.from===e&&t.to===i));if(h?c=h:Rn.push(c),c.type=t,c.from=e,c.to=i,c.label={text:r},null==n)c.techn={text:""};else if("object"==typeof n){let[t,e]=Object.entries(n)[0];c[t]={text:e}}else c.techn={text:n};if(null==s)c.descr={text:""};else if("object"==typeof s){let[t,e]=Object.entries(s)[0];c[t]={text:e}}else c.descr={text:s};if("object"==typeof a){let[t,e]=Object.entries(a)[0];c[t]=e}else c.sprite=a;if("object"==typeof o){let[t,e]=Object.entries(o)[0];c[t]=e}else c.tags=o;if("object"==typeof l){let[t,e]=Object.entries(l)[0];c[t]=e}else c.link=l;c.wrap=Un()},updateElStyle:function(t,e,i,r,n,s,a,o,l,c,h){let d=In.find((t=>t.alias===e));if(void 0!==d||(d=Fn.find((t=>t.alias===e)),void 0!==d)){if(null!=i)if("object"==typeof i){let[t,e]=Object.entries(i)[0];d[t]=e}else d.bgColor=i;if(null!=r)if("object"==typeof r){let[t,e]=Object.entries(r)[0];d[t]=e}else d.fontColor=r;if(null!=n)if("object"==typeof n){let[t,e]=Object.entries(n)[0];d[t]=e}else d.borderColor=n;if(null!=s)if("object"==typeof s){let[t,e]=Object.entries(s)[0];d[t]=e}else d.shadowing=s;if(null!=a)if("object"==typeof a){let[t,e]=Object.entries(a)[0];d[t]=e}else d.shape=a;if(null!=o)if("object"==typeof o){let[t,e]=Object.entries(o)[0];d[t]=e}else d.sprite=o;if(null!=l)if("object"==typeof l){let[t,e]=Object.entries(l)[0];d[t]=e}else d.techn=l;if(null!=c)if("object"==typeof c){let[t,e]=Object.entries(c)[0];d[t]=e}else d.legendText=c;if(null!=h)if("object"==typeof h){let[t,e]=Object.entries(h)[0];d[t]=e}else d.legendSprite=h}},updateRelStyle:function(t,e,i,r,n,s,a){const o=Rn.find((t=>t.from===e&&t.to===i));if(void 0!==o){if(null!=r)if("object"==typeof r){let[t,e]=Object.entries(r)[0];o[t]=e}else o.textColor=r;if(null!=n)if("object"==typeof n){let[t,e]=Object.entries(n)[0];o[t]=e}else o.lineColor=n;if(null!=s)if("object"==typeof s){let[t,e]=Object.entries(s)[0];o[t]=parseInt(e)}else o.offsetX=parseInt(s);if(null!=a)if("object"==typeof a){let[t,e]=Object.entries(a)[0];o[t]=parseInt(e)}else o.offsetY=parseInt(a)}},updateLayoutConfig:function(t,e,i){let r=zn,n=jn;if("object"==typeof e){const t=Object.values(e)[0];r=parseInt(t)}else r=parseInt(e);if("object"==typeof i){const t=Object.values(i)[0];n=parseInt(t)}else n=parseInt(i);r>=1&&(zn=r),n>=1&&(jn=n)},autoWrap:Un,setWrap:function(t){Pn=t},getC4ShapeArray:Wn,getC4Shape:function(t){return In.find((e=>e.alias===t))},getC4ShapeKeys:function(t){return Object.keys(Wn(t))},getBoundarys:function(t){return null==t?Fn:Fn.filter((e=>e.parentBoundary===t))},getCurrentBoundaryParse:function(){return $n},getParentBoundaryParse:function(){return Nn},getRels:function(){return Rn},getTitle:function(){return Mn},getC4Type:function(){return Yn},getC4ShapeInRow:function(){return zn},getC4BoundaryInRow:function(){return jn},setAccTitle:Sr,getAccTitle:wr,getAccDescription:Br,setAccDescription:Ar,parseDirective:function(t,e,i){np.parseDirective(this,t,e,i)},getConfig:()=>Zi().c4,clear:function(){In=[],Fn=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Nn="",$n="global",On=[""],Rn=[],On=[""],Mn="",Pn=!1,zn=4,jn=2},LINETYPE:{SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},ARROWTYPE:{FILLED:0,OPEN:1},PLACEMENT:{LEFTOF:0,RIGHTOF:1,OVER:2},setTitle:function(t){let e=wt(t,Zi());Mn=e},setC4Type:function(t){let e=wt(t,Zi());Yn=e}},Vn=function(t,e){const i=t.append("rect");if(i.attr("x",e.x),i.attr("y",e.y),i.attr("fill",e.fill),i.attr("stroke",e.stroke),i.attr("width",e.width),i.attr("height",e.height),i.attr("rx",e.rx),i.attr("ry",e.ry),"undefined"!==e.attrs&&null!==e.attrs)for(let r in e.attrs)i.attr(r,e.attrs[r]);return"undefined"!==e.class&&i.attr("class",e.class),i},Hn=function(t,e,i,r,s,a){const o=t.append("image");o.attr("width",e),o.attr("height",i),o.attr("x",r),o.attr("y",s);let l=a.startsWith("data:image/png;base64")?a:n.sanitizeUrl(a);o.attr("xlink:href",l)},Gn=function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},Xn=(t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),Kn=function(){function t(t,e,i,n,s,a,o){r(e.append("text").attr("x",i+s/2).attr("y",n+a/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,i,n,s,a,o,l){const{fontSize:c,fontFamily:h,fontWeight:d}=l,u=t.split(Ot.lineBreakRegex);for(let p=0;p>"),e.typeC4Shape.text){case"person":case"external_person":Hn(l,48,48,e.x+e.width/2-24,e.y+e.image.Y,o)}let d=i[e.typeC4Shape.text+"Font"]();return d.fontWeight="bold",d.fontSize=d.fontSize+2,d.fontColor=a,Kn(i)(e.label.text,l,e.x,e.y+e.label.Y,e.width,e.height,{fill:a},d),d=i[e.typeC4Shape.text+"Font"](),d.fontColor=a,e.techn&&""!==(null==(r=e.techn)?void 0:r.text)?Kn(i)(e.techn.text,l,e.x,e.y+e.techn.Y,e.width,e.height,{fill:a,"font-style":"italic"},d):e.type&&""!==e.type.text&&Kn(i)(e.type.text,l,e.x,e.y+e.type.Y,e.width,e.height,{fill:a,"font-style":"italic"},d),e.descr&&""!==e.descr.text&&(d=i.personFont(),d.fontColor=a,Kn(i)(e.descr.text,l,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},d)),e.height},Jn=(t,e,i)=>{const r=t.append("g");let n=0;for(let s of e){let t=s.textColor?s.textColor:"#444444",e=s.lineColor?s.lineColor:"#444444",a=s.offsetX?parseInt(s.offsetX):0,o=s.offsetY?parseInt(s.offsetY):0,l="";if(0===n){let t=r.append("line");t.attr("x1",s.startPoint.x),t.attr("y1",s.startPoint.y),t.attr("x2",s.endPoint.x),t.attr("y2",s.endPoint.y),t.attr("stroke-width","1"),t.attr("stroke",e),t.style("fill","none"),"rel_b"!==s.type&&t.attr("marker-end","url("+l+"#arrowhead)"),"birel"!==s.type&&"rel_b"!==s.type||t.attr("marker-start","url("+l+"#arrowend)"),n=-1}else{let t=r.append("path");t.attr("fill","none").attr("stroke-width","1").attr("stroke",e).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",s.startPoint.x).replaceAll("starty",s.startPoint.y).replaceAll("controlx",s.startPoint.x+(s.endPoint.x-s.startPoint.x)/2-(s.endPoint.x-s.startPoint.x)/4).replaceAll("controly",s.startPoint.y+(s.endPoint.y-s.startPoint.y)/2).replaceAll("stopx",s.endPoint.x).replaceAll("stopy",s.endPoint.y)),"rel_b"!==s.type&&t.attr("marker-end","url("+l+"#arrowhead)"),"birel"!==s.type&&"rel_b"!==s.type||t.attr("marker-start","url("+l+"#arrowend)")}let c=i.messageFont();Kn(i)(s.label.text,r,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+a,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+o,s.label.width,s.label.height,{fill:t},c),s.techn&&""!==s.techn.text&&(c=i.messageFont(),Kn(i)("["+s.techn.text+"]",r,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+a,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+i.messageFontSize+5+o,Math.max(s.label.width,s.techn.width),s.techn.height,{fill:t,"font-style":"italic"},c))}},ts=function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},es=function(t){t.append("defs").append("marker").attr("id","arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},is=function(t){t.append("defs").append("marker").attr("id","filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},rs=function(t){const e=t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);e.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),e.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},ns=function(t){t.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},ss=function(t){t.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},as=function(t){t.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")};n.sanitizeUrl;let os=0,ls=0,cs=4,hs=2;Bn.yy=qn;let ds={};class us{constructor(t){this.name="",this.data={},this.data.startx=void 0,this.data.stopx=void 0,this.data.starty=void 0,this.data.stopy=void 0,this.data.widthLimit=void 0,this.nextData={},this.nextData.startx=void 0,this.nextData.stopx=void 0,this.nextData.starty=void 0,this.nextData.stopy=void 0,this.nextData.cnt=0,ps(t.db.getConfig())}setData(t,e,i,r){this.nextData.startx=this.data.startx=t,this.nextData.stopx=this.data.stopx=e,this.nextData.starty=this.data.starty=i,this.nextData.stopy=this.data.stopy=r}updateVal(t,e,i,r){void 0===t[e]?t[e]=i:t[e]=r(i,t[e])}insert(t){this.nextData.cnt=this.nextData.cnt+1;let e=this.nextData.startx===this.nextData.stopx?this.nextData.stopx+t.margin:this.nextData.stopx+2*t.margin,i=e+t.width,r=this.nextData.starty+2*t.margin,n=r+t.height;(e>=this.data.widthLimit||i>=this.data.widthLimit||this.nextData.cnt>cs)&&(e=this.nextData.startx+t.margin+ds.nextLinePaddingX,r=this.nextData.stopy+2*t.margin,this.nextData.stopx=i=e+t.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=n=r+t.height,this.nextData.cnt=1),t.x=e,t.y=r,this.updateVal(this.data,"startx",e,Math.min),this.updateVal(this.data,"starty",r,Math.min),this.updateVal(this.data,"stopx",i,Math.max),this.updateVal(this.data,"stopy",n,Math.max),this.updateVal(this.nextData,"startx",e,Math.min),this.updateVal(this.nextData,"starty",r,Math.min),this.updateVal(this.nextData,"stopx",i,Math.max),this.updateVal(this.nextData,"stopy",n,Math.max)}init(t){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},ps(t.db.getConfig())}bumpLastMargin(t){this.data.stopx+=t,this.data.stopy+=t}}const ps=function(t){ki(ds,t),t.fontFamily&&(ds.personFontFamily=ds.systemFontFamily=ds.messageFontFamily=t.fontFamily),t.fontSize&&(ds.personFontSize=ds.systemFontSize=ds.messageFontSize=t.fontSize),t.fontWeight&&(ds.personFontWeight=ds.systemFontWeight=ds.messageFontWeight=t.fontWeight)},gs=(t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),ys=t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight});function fs(t,e,i,r,n){if(!e[t].width)if(i)e[t].text=Ii(e[t].text,n,r),e[t].textLines=e[t].text.split(Ot.lineBreakRegex).length,e[t].width=n,e[t].height=$i(e[t].text,r);else{let i=e[t].text.split(Ot.lineBreakRegex);e[t].textLines=i.length;let n=0;e[t].height=0,e[t].width=0;for(const s of i)e[t].width=Math.max(Ni(s,r),e[t].width),n=$i(s,r),e[t].height=e[t].height+n}}const ms=function(t,e,i){e.x=i.data.startx,e.y=i.data.starty,e.width=i.data.stopx-i.data.startx,e.height=i.data.stopy-i.data.starty,e.label.y=ds.c4ShapeMargin-35;let r=e.wrap&&ds.wrap,n=ys(ds);n.fontSize=n.fontSize+2,n.fontWeight="bold",fs("label",e,r,n,Ni(e.label.text,n)),Qn(t,e,ds)},bs=function(t,e,i,r){let n=0;for(const s of r){n=0;const r=i[s];let a=gs(ds,r.typeC4Shape.text);switch(a.fontSize=a.fontSize-2,r.typeC4Shape.width=Ni("<<"+r.typeC4Shape.text+">>",a),r.typeC4Shape.height=a.fontSize+2,r.typeC4Shape.Y=ds.c4ShapePadding,n=r.typeC4Shape.Y+r.typeC4Shape.height-4,r.image={width:0,height:0,Y:0},r.typeC4Shape.text){case"person":case"external_person":r.image.width=48,r.image.height=48,r.image.Y=n,n=r.image.Y+r.image.height}r.sprite&&(r.image.width=48,r.image.height=48,r.image.Y=n,n=r.image.Y+r.image.height);let o=r.wrap&&ds.wrap,l=ds.width-2*ds.c4ShapePadding,c=gs(ds,r.typeC4Shape.text);if(c.fontSize=c.fontSize+2,c.fontWeight="bold",fs("label",r,o,c,l),r.label.Y=n+8,n=r.label.Y+r.label.height,r.type&&""!==r.type.text){r.type.text="["+r.type.text+"]",fs("type",r,o,gs(ds,r.typeC4Shape.text),l),r.type.Y=n+5,n=r.type.Y+r.type.height}else if(r.techn&&""!==r.techn.text){r.techn.text="["+r.techn.text+"]",fs("techn",r,o,gs(ds,r.techn.text),l),r.techn.Y=n+5,n=r.techn.Y+r.techn.height}let h=n,d=r.label.width;if(r.descr&&""!==r.descr.text){fs("descr",r,o,gs(ds,r.typeC4Shape.text),l),r.descr.Y=n+20,n=r.descr.Y+r.descr.height,d=Math.max(r.label.width,r.descr.width),h=n-5*r.descr.textLines}d+=ds.c4ShapePadding,r.width=Math.max(r.width||ds.width,d,ds.width),r.height=Math.max(r.height||ds.height,h,ds.height),r.margin=r.margin||ds.c4ShapeMargin,t.insert(r),Zn(e,r,ds)}t.bumpLastMargin(ds.c4ShapeMargin)};class xs{constructor(t,e){this.x=t,this.y=e}}let ks=function(t,e){let i=t.x,r=t.y,n=e.x,s=e.y,a=i+t.width/2,o=r+t.height/2,l=Math.abs(i-n),c=Math.abs(r-s),h=c/l,d=t.height/t.width,u=null;return r==s&&in?u=new xs(i,o):i==n&&rs&&(u=new xs(a,r)),i>n&&r=h?new xs(i,o+h*t.width/2):new xs(a-l/c*t.height/2,r+t.height):i=h?new xs(i+t.width,o+h*t.width/2):new xs(a+l/c*t.height/2,r+t.height):is?u=d>=h?new xs(i+t.width,o-h*t.width/2):new xs(a+t.height/2*l/c,r):i>n&&r>s&&(u=d>=h?new xs(i,o-t.width/2*h):new xs(a-t.height/2*l/c,r)),u},_s=function(t,e){let i={x:0,y:0};i.x=e.x+e.width/2,i.y=e.y+e.height/2;let r=ks(t,i);return i.x=t.x+t.width/2,i.y=t.y+t.height/2,{startPoint:r,endPoint:ks(e,i)}};function Cs(t,e,i,r,n){let s=new us(n);s.data.widthLimit=i.data.widthLimit/Math.min(hs,r.length);for(let[a,o]of r.entries()){let r=0;o.image={width:0,height:0,Y:0},o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=r,r=o.image.Y+o.image.height);let l=o.wrap&&ds.wrap,c=ys(ds);if(c.fontSize=c.fontSize+2,c.fontWeight="bold",fs("label",o,l,c,s.data.widthLimit),o.label.Y=r+8,r=o.label.Y+o.label.height,o.type&&""!==o.type.text){o.type.text="["+o.type.text+"]",fs("type",o,l,ys(ds),s.data.widthLimit),o.type.Y=r+5,r=o.type.Y+o.type.height}if(o.descr&&""!==o.descr.text){let t=ys(ds);t.fontSize=t.fontSize-2,fs("descr",o,l,t,s.data.widthLimit),o.descr.Y=r+20,r=o.descr.Y+o.descr.height}if(0==a||a%hs==0){let t=i.data.startx+ds.diagramMarginX,e=i.data.stopy+ds.diagramMarginY+r;s.setData(t,t,e,e)}else{let t=s.data.stopx!==s.data.startx?s.data.stopx+ds.diagramMarginX:s.data.startx,e=s.data.starty;s.setData(t,t,e,e)}s.name=o.alias;let h=n.db.getC4ShapeArray(o.alias),d=n.db.getC4ShapeKeys(o.alias);d.length>0&&bs(s,t,h,d),e=o.alias;let u=n.db.getBoundarys(e);u.length>0&&Cs(t,e,s,u,n),"global"!==o.alias&&ms(t,o,s),i.data.stopy=Math.max(s.data.stopy+ds.c4ShapeMargin,i.data.stopy),i.data.stopx=Math.max(s.data.stopx+ds.c4ShapeMargin,i.data.stopx),os=Math.max(os,i.data.stopx),ls=Math.max(ls,i.data.stopy)}}const Ts={drawPersonOrSystemArray:bs,drawBoundary:ms,setConf:ps,draw:function(t,e,i,r){ds=Zi().c4;const n=Zi().securityLevel;let s;"sandbox"===n&&(s=f("#i"+e));const a=f("sandbox"===n?s.nodes()[0].contentDocument.body:"body");let o=r.db;r.db.setWrap(ds.wrap),cs=o.getC4ShapeInRow(),hs=o.getC4BoundaryInRow(),Tt.debug(`C:${JSON.stringify(ds,null,2)}`);const l="sandbox"===n?a.select(`[id="${e}"]`):f(`[id="${e}"]`);ss(l),ns(l),as(l);let c=new us(r);c.setData(ds.diagramMarginX,ds.diagramMarginX,ds.diagramMarginY,ds.diagramMarginY),c.data.widthLimit=screen.availWidth,os=ds.diagramMarginX,ls=ds.diagramMarginY;const h=r.db.getTitle();Cs(l,"",c,r.db.getBoundarys(""),r),ts(l),es(l),rs(l),is(l),function(t,e,i,r){let n=0;for(let a of e){n+=1;let t=a.wrap&&ds.wrap,e={fontFamily:(s=ds).messageFontFamily,fontSize:s.messageFontSize,fontWeight:s.messageFontWeight};"C4Dynamic"===r.db.getC4Type()&&(a.label.text=n+": "+a.label.text);let o=Ni(a.label.text,e);fs("label",a,t,e,o),a.techn&&""!==a.techn.text&&(o=Ni(a.techn.text,e),fs("techn",a,t,e,o)),a.descr&&""!==a.descr.text&&(o=Ni(a.descr.text,e),fs("descr",a,t,e,o));let l=i(a.from),c=i(a.to),h=_s(l,c);a.startPoint=h.startPoint,a.endPoint=h.endPoint}var s;Jn(t,e,ds)}(l,r.db.getRels(),r.db.getC4Shape,r),c.data.stopx=os,c.data.stopy=ls;const d=c.data;let u=d.stopy-d.starty+2*ds.diagramMarginY;const p=d.stopx-d.startx+2*ds.diagramMarginX;h&&l.append("text").text(h).attr("x",(d.stopx-d.startx)/2-4*ds.diagramMarginX).attr("y",d.starty+ds.diagramMarginY),sr(l,u,p,ds.useMaxWidth);const g=h?60:0;l.attr("viewBox",d.startx-ds.diagramMarginX+" -"+(ds.diagramMarginY+g)+" "+p+" "+(u+g)),Tt.debug("models:",d)}};var Es=function(){var t=function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i},e=[1,3],i=[1,7],r=[1,8],n=[1,9],s=[1,10],a=[1,13],o=[1,12],l=[1,16,25],c=[1,20],h=[1,32],d=[1,33],u=[1,34],p=[1,36],g=[1,39],y=[1,37],f=[1,38],m=[1,44],b=[1,45],x=[1,40],k=[1,41],_=[1,42],C=[1,43],T=[1,48],E=[1,49],v=[1,50],S=[1,51],w=[16,25],A=[1,65],B=[1,66],L=[1,67],D=[1,68],I=[1,69],O=[1,70],$=[1,71],N=[1,80],F=[16,25,32,45,46,54,60,61,62,63,64,65,66,71,73],R=[16,25,30,32,45,46,50,54,60,61,62,63,64,65,66,71,73,88,89,90,91],M=[5,8,9,10,11,16,19,23,25],P=[54,88,89,90,91],z=[54,65,66,88,89,90,91],j=[54,60,61,62,63,64,88,89,90,91],Y=[16,25,32],W=[1,107],U={trace:function(){},yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statments:5,direction:6,directive:7,direction_tb:8,direction_bt:9,direction_rl:10,direction_lr:11,graphConfig:12,openDirective:13,typeDirective:14,closeDirective:15,NEWLINE:16,":":17,argDirective:18,open_directive:19,type_directive:20,arg_directive:21,close_directive:22,CLASS_DIAGRAM:23,statements:24,EOF:25,statement:26,className:27,alphaNumToken:28,classLiteralName:29,GENERICTYPE:30,relationStatement:31,LABEL:32,classStatement:33,methodStatement:34,annotationStatement:35,clickStatement:36,cssClassStatement:37,noteStatement:38,acc_title:39,acc_title_value:40,acc_descr:41,acc_descr_value:42,acc_descr_multiline_value:43,CLASS:44,STYLE_SEPARATOR:45,STRUCT_START:46,members:47,STRUCT_STOP:48,ANNOTATION_START:49,ANNOTATION_END:50,MEMBER:51,SEPARATOR:52,relation:53,STR:54,NOTE_FOR:55,noteText:56,NOTE:57,relationType:58,lineType:59,AGGREGATION:60,EXTENSION:61,COMPOSITION:62,DEPENDENCY:63,LOLLIPOP:64,LINE:65,DOTTED_LINE:66,CALLBACK:67,LINK:68,LINK_TARGET:69,CLICK:70,CALLBACK_NAME:71,CALLBACK_ARGS:72,HREF:73,CSSCLASS:74,commentToken:75,textToken:76,graphCodeTokens:77,textNoTagsToken:78,TAGSTART:79,TAGEND:80,"==":81,"--":82,PCT:83,DEFAULT:84,SPACE:85,MINUS:86,keywords:87,UNICODE_TEXT:88,NUM:89,ALPHA:90,BQUOTE_STR:91,$accept:0,$end:1},terminals_:{2:"error",5:"statments",8:"direction_tb",9:"direction_bt",10:"direction_rl",11:"direction_lr",16:"NEWLINE",17:":",19:"open_directive",20:"type_directive",21:"arg_directive",22:"close_directive",23:"CLASS_DIAGRAM",25:"EOF",30:"GENERICTYPE",32:"LABEL",39:"acc_title",40:"acc_title_value",41:"acc_descr",42:"acc_descr_value",43:"acc_descr_multiline_value",44:"CLASS",45:"STYLE_SEPARATOR",46:"STRUCT_START",48:"STRUCT_STOP",49:"ANNOTATION_START",50:"ANNOTATION_END",51:"MEMBER",52:"SEPARATOR",54:"STR",55:"NOTE_FOR",57:"NOTE",60:"AGGREGATION",61:"EXTENSION",62:"COMPOSITION",63:"DEPENDENCY",64:"LOLLIPOP",65:"LINE",66:"DOTTED_LINE",67:"CALLBACK",68:"LINK",69:"LINK_TARGET",70:"CLICK",71:"CALLBACK_NAME",72:"CALLBACK_ARGS",73:"HREF",74:"CSSCLASS",77:"graphCodeTokens",79:"TAGSTART",80:"TAGEND",81:"==",82:"--",83:"PCT",84:"DEFAULT",85:"SPACE",86:"MINUS",87:"keywords",88:"UNICODE_TEXT",89:"NUM",90:"ALPHA",91:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[3,1],[3,2],[6,1],[6,1],[6,1],[6,1],[4,1],[7,4],[7,6],[13,1],[14,1],[18,1],[15,1],[12,4],[24,1],[24,2],[24,3],[27,1],[27,1],[27,2],[27,2],[27,2],[26,1],[26,2],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,2],[26,2],[26,1],[33,2],[33,4],[33,5],[33,7],[35,4],[47,1],[47,2],[34,1],[34,2],[34,1],[34,1],[31,3],[31,4],[31,4],[31,5],[38,3],[38,2],[53,3],[53,2],[53,2],[53,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[36,3],[36,4],[36,3],[36,4],[36,4],[36,5],[36,3],[36,4],[36,4],[36,5],[36,3],[36,4],[36,4],[36,5],[37,3],[75,1],[75,1],[76,1],[76,1],[76,1],[76,1],[76,1],[76,1],[76,1],[78,1],[78,1],[78,1],[78,1],[28,1],[28,1],[28,1],[29,1],[56,1]],performAction:function(t,e,i,r,n,s,a){var o=s.length-1;switch(n){case 5:r.setDirection("TB");break;case 6:r.setDirection("BT");break;case 7:r.setDirection("RL");break;case 8:r.setDirection("LR");break;case 12:r.parseDirective("%%{","open_directive");break;case 13:r.parseDirective(s[o],"type_directive");break;case 14:s[o]=s[o].trim().replace(/'/g,'"'),r.parseDirective(s[o],"arg_directive");break;case 15:r.parseDirective("}%%","close_directive","class");break;case 20:case 21:this.$=s[o];break;case 22:this.$=s[o-1]+s[o];break;case 23:case 24:this.$=s[o-1]+"~"+s[o];break;case 25:r.addRelation(s[o]);break;case 26:s[o-1].title=r.cleanupLabel(s[o]),r.addRelation(s[o-1]);break;case 35:this.$=s[o].trim(),r.setAccTitle(this.$);break;case 36:case 37:this.$=s[o].trim(),r.setAccDescription(this.$);break;case 38:r.addClass(s[o]);break;case 39:r.addClass(s[o-2]),r.setCssClass(s[o-2],s[o]);break;case 40:r.addClass(s[o-3]),r.addMembers(s[o-3],s[o-1]);break;case 41:r.addClass(s[o-5]),r.setCssClass(s[o-5],s[o-3]),r.addMembers(s[o-5],s[o-1]);break;case 42:r.addAnnotation(s[o],s[o-2]);break;case 43:this.$=[s[o]];break;case 44:s[o].push(s[o-1]),this.$=s[o];break;case 45:case 47:case 48:break;case 46:r.addMember(s[o-1],r.cleanupLabel(s[o]));break;case 49:this.$={id1:s[o-2],id2:s[o],relation:s[o-1],relationTitle1:"none",relationTitle2:"none"};break;case 50:this.$={id1:s[o-3],id2:s[o],relation:s[o-1],relationTitle1:s[o-2],relationTitle2:"none"};break;case 51:this.$={id1:s[o-3],id2:s[o],relation:s[o-2],relationTitle1:"none",relationTitle2:s[o-1]};break;case 52:this.$={id1:s[o-4],id2:s[o],relation:s[o-2],relationTitle1:s[o-3],relationTitle2:s[o-1]};break;case 53:r.addNote(s[o],s[o-1]);break;case 54:r.addNote(s[o]);break;case 55:this.$={type1:s[o-2],type2:s[o],lineType:s[o-1]};break;case 56:this.$={type1:"none",type2:s[o],lineType:s[o-1]};break;case 57:this.$={type1:s[o-1],type2:"none",lineType:s[o]};break;case 58:this.$={type1:"none",type2:"none",lineType:s[o]};break;case 59:this.$=r.relationType.AGGREGATION;break;case 60:this.$=r.relationType.EXTENSION;break;case 61:this.$=r.relationType.COMPOSITION;break;case 62:this.$=r.relationType.DEPENDENCY;break;case 63:this.$=r.relationType.LOLLIPOP;break;case 64:this.$=r.lineType.LINE;break;case 65:this.$=r.lineType.DOTTED_LINE;break;case 66:case 72:this.$=s[o-2],r.setClickEvent(s[o-1],s[o]);break;case 67:case 73:this.$=s[o-3],r.setClickEvent(s[o-2],s[o-1]),r.setTooltip(s[o-2],s[o]);break;case 68:case 76:this.$=s[o-2],r.setLink(s[o-1],s[o]);break;case 69:case 77:this.$=s[o-3],r.setLink(s[o-2],s[o-1],s[o]);break;case 70:case 78:this.$=s[o-3],r.setLink(s[o-2],s[o-1]),r.setTooltip(s[o-2],s[o]);break;case 71:case 79:this.$=s[o-4],r.setLink(s[o-3],s[o-2],s[o]),r.setTooltip(s[o-3],s[o-1]);break;case 74:this.$=s[o-3],r.setClickEvent(s[o-2],s[o-1],s[o]);break;case 75:this.$=s[o-4],r.setClickEvent(s[o-3],s[o-2],s[o-1]),r.setTooltip(s[o-3],s[o]);break;case 80:r.setCssClass(s[o-1],s[o])}},table:[{3:1,4:2,5:e,6:4,7:5,8:i,9:r,10:n,11:s,12:6,13:11,19:a,23:o},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{3:14,4:2,5:e,6:4,7:5,8:i,9:r,10:n,11:s,12:6,13:11,19:a,23:o},{1:[2,9]},t(l,[2,5]),t(l,[2,6]),t(l,[2,7]),t(l,[2,8]),{14:15,20:[1,16]},{16:[1,17]},{20:[2,12]},{1:[2,4]},{15:18,17:[1,19],22:c},t([17,22],[2,13]),{6:31,7:30,8:i,9:r,10:n,11:s,13:11,19:a,24:21,26:22,27:35,28:46,29:47,31:23,33:24,34:25,35:26,36:27,37:28,38:29,39:h,41:d,43:u,44:p,49:g,51:y,52:f,55:m,57:b,67:x,68:k,70:_,74:C,88:T,89:E,90:v,91:S},{16:[1,52]},{18:53,21:[1,54]},{16:[2,15]},{25:[1,55]},{16:[1,56],25:[2,17]},t(w,[2,25],{32:[1,57]}),t(w,[2,27]),t(w,[2,28]),t(w,[2,29]),t(w,[2,30]),t(w,[2,31]),t(w,[2,32]),t(w,[2,33]),t(w,[2,34]),{40:[1,58]},{42:[1,59]},t(w,[2,37]),t(w,[2,45],{53:60,58:63,59:64,32:[1,62],54:[1,61],60:A,61:B,62:L,63:D,64:I,65:O,66:$}),{27:72,28:46,29:47,88:T,89:E,90:v,91:S},t(w,[2,47]),t(w,[2,48]),{28:73,88:T,89:E,90:v},{27:74,28:46,29:47,88:T,89:E,90:v,91:S},{27:75,28:46,29:47,88:T,89:E,90:v,91:S},{27:76,28:46,29:47,88:T,89:E,90:v,91:S},{54:[1,77]},{27:78,28:46,29:47,88:T,89:E,90:v,91:S},{54:N,56:79},t(F,[2,20],{28:46,29:47,27:81,30:[1,82],88:T,89:E,90:v,91:S}),t(F,[2,21],{30:[1,83]}),t(R,[2,94]),t(R,[2,95]),t(R,[2,96]),t([16,25,30,32,45,46,54,60,61,62,63,64,65,66,71,73],[2,97]),t(M,[2,10]),{15:84,22:c},{22:[2,14]},{1:[2,16]},{6:31,7:30,8:i,9:r,10:n,11:s,13:11,19:a,24:85,25:[2,18],26:22,27:35,28:46,29:47,31:23,33:24,34:25,35:26,36:27,37:28,38:29,39:h,41:d,43:u,44:p,49:g,51:y,52:f,55:m,57:b,67:x,68:k,70:_,74:C,88:T,89:E,90:v,91:S},t(w,[2,26]),t(w,[2,35]),t(w,[2,36]),{27:86,28:46,29:47,54:[1,87],88:T,89:E,90:v,91:S},{53:88,58:63,59:64,60:A,61:B,62:L,63:D,64:I,65:O,66:$},t(w,[2,46]),{59:89,65:O,66:$},t(P,[2,58],{58:90,60:A,61:B,62:L,63:D,64:I}),t(z,[2,59]),t(z,[2,60]),t(z,[2,61]),t(z,[2,62]),t(z,[2,63]),t(j,[2,64]),t(j,[2,65]),t(w,[2,38],{45:[1,91],46:[1,92]}),{50:[1,93]},{54:[1,94]},{54:[1,95]},{71:[1,96],73:[1,97]},{28:98,88:T,89:E,90:v},{54:N,56:99},t(w,[2,54]),t(w,[2,98]),t(F,[2,22]),t(F,[2,23]),t(F,[2,24]),{16:[1,100]},{25:[2,19]},t(Y,[2,49]),{27:101,28:46,29:47,88:T,89:E,90:v,91:S},{27:102,28:46,29:47,54:[1,103],88:T,89:E,90:v,91:S},t(P,[2,57],{58:104,60:A,61:B,62:L,63:D,64:I}),t(P,[2,56]),{28:105,88:T,89:E,90:v},{47:106,51:W},{27:108,28:46,29:47,88:T,89:E,90:v,91:S},t(w,[2,66],{54:[1,109]}),t(w,[2,68],{54:[1,111],69:[1,110]}),t(w,[2,72],{54:[1,112],72:[1,113]}),t(w,[2,76],{54:[1,115],69:[1,114]}),t(w,[2,80]),t(w,[2,53]),t(M,[2,11]),t(Y,[2,51]),t(Y,[2,50]),{27:116,28:46,29:47,88:T,89:E,90:v,91:S},t(P,[2,55]),t(w,[2,39],{46:[1,117]}),{48:[1,118]},{47:119,48:[2,43],51:W},t(w,[2,42]),t(w,[2,67]),t(w,[2,69]),t(w,[2,70],{69:[1,120]}),t(w,[2,73]),t(w,[2,74],{54:[1,121]}),t(w,[2,77]),t(w,[2,78],{69:[1,122]}),t(Y,[2,52]),{47:123,51:W},t(w,[2,40]),{48:[2,44]},t(w,[2,71]),t(w,[2,75]),t(w,[2,79]),{48:[1,124]},t(w,[2,41])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],6:[2,9],13:[2,12],14:[2,4],20:[2,15],54:[2,14],55:[2,16],85:[2,19],119:[2,44]},parseError:function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},parse:function(t){var e=this,i=[0],r=[],n=[null],s=[],a=this.table,o="",l=0,c=0,h=s.slice.call(arguments,1),d=Object.create(this.lexer),u={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(u.yy[p]=this.yy[p]);d.setInput(t,u.yy),u.yy.lexer=d,u.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;s.push(g);var y=d.options&&d.options.ranges;"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var f,m,b,x,k,_,C,T,E,v={};;){if(m=i[i.length-1],this.defaultActions[m]?b=this.defaultActions[m]:(null==f&&(E=void 0,"number"!=typeof(E=r.pop()||d.lex()||1)&&(E instanceof Array&&(E=(r=E).pop()),E=e.symbols_[E]||E),f=E),b=a[m]&&a[m][f]),void 0===b||!b.length||!b[0]){var S="";for(k in T=[],a[m])this.terminals_[k]&&k>2&&T.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[f]||f,line:d.yylineno,loc:g,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+f);switch(b[0]){case 1:i.push(f),n.push(d.yytext),s.push(d.yylloc),i.push(b[1]),f=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(_=this.productions_[b[1]][1],v.$=n[n.length-_],v._$={first_line:s[s.length-(_||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(_||1)].first_column,last_column:s[s.length-1].last_column},y&&(v._$.range=[s[s.length-(_||1)].range[0],s[s.length-1].range[1]]),void 0!==(x=this.performAction.apply(v,[o,c,l,u.yy,b[1],n,s].concat(h))))return x;_&&(i=i.slice(0,-1*_*2),n=n.slice(0,-1*_),s=s.slice(0,-1*_)),i.push(this.productions_[b[1]][0]),n.push(v.$),s.push(v._$),C=a[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},q=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}, +// resets the lexer, sets new input +setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}, +// consumes and returns one char from the input +input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}, +// unshifts one char (or a string) into the input +unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===r.length?this.yylloc.first_column:0)+r[r.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}, +// When called from action, caches matched text and appends it on next action +more:function(){return this._more=!0,this}, +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// retain first n characters of the match +less:function(t){this.unput(this.match.slice(t))}, +// displays already matched input, i.e. for error messages +pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}, +// displays upcoming input, i.e. for error messages +upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}, +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}, +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(t,e){var i,r,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var s in n)this[s]=n[s];return!1}return!1}, +// return next match in input +next:function(){if(this.done)return this.EOF;var t,e,i,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),s=0;se[0].length)){if(e=i,r=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// return next match that has a token +lex:function(){var t=this.next();return t||this.lex()}, +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function(t){this.conditionStack.push(t)}, +// pop the previously active lexer condition state off the condition stack +popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}, +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}, +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}, +// alias for begin(condition) +pushState:function(t){this.begin(t)}, +// return the number of states currently on the stack +stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,i,r){switch(i){case 0:return this.begin("open_directive"),19;case 1:return 8;case 2:return 9;case 3:return 10;case 4:return 11;case 5:return this.begin("type_directive"),20;case 6:return this.popState(),this.begin("arg_directive"),17;case 7:return this.popState(),this.popState(),22;case 8:return 21;case 9:case 10:case 19:case 27:break;case 11:return this.begin("acc_title"),39;case 12:return this.popState(),"acc_title_value";case 13:return this.begin("acc_descr"),41;case 14:return this.popState(),"acc_descr_value";case 15:this.begin("acc_descr_multiline");break;case 16:case 39:case 42:case 45:case 48:case 51:case 54:this.popState();break;case 17:return"acc_descr_multiline_value";case 18:return 16;case 20:case 21:return 23;case 22:return this.begin("struct"),46;case 23:return"EDGE_STATE";case 24:return"EOF_IN_STRUCT";case 25:return"OPEN_IN_STRUCT";case 26:return this.popState(),48;case 28:return"MEMBER";case 29:return 44;case 30:return 74;case 31:return 67;case 32:return 68;case 33:return 70;case 34:return 55;case 35:return 57;case 36:return 49;case 37:return 50;case 38:this.begin("generic");break;case 40:return"GENERICTYPE";case 41:this.begin("string");break;case 43:return"STR";case 44:this.begin("bqstring");break;case 46:return"BQUOTE_STR";case 47:this.begin("href");break;case 49:return 73;case 50:this.begin("callback_name");break;case 52:this.popState(),this.begin("callback_args");break;case 53:return 71;case 55:return 72;case 56:case 57:case 58:case 59:return 69;case 60:case 61:return 61;case 62:case 63:return 63;case 64:return 62;case 65:return 60;case 66:return 64;case 67:return 65;case 68:return 66;case 69:return 32;case 70:return 45;case 71:return 86;case 72:return"DOT";case 73:return"PLUS";case 74:return 83;case 75:case 76:return"EQUALS";case 77:return 90;case 78:return"PUNCTUATION";case 79:return 89;case 80:return 88;case 81:return 85;case 82:return 25}},rules:[/^(?:%%\{)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:[{])/,/^(?:\[\*\])/,/^(?:$)/,/^(?:[{])/,/^(?:[}])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:class\b)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:[~])/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[`])/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:href[\s]+["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[16,17],inclusive:!1},acc_descr:{rules:[14],inclusive:!1},acc_title:{rules:[12],inclusive:!1},arg_directive:{rules:[7,8],inclusive:!1},type_directive:{rules:[6,7],inclusive:!1},open_directive:{rules:[5],inclusive:!1},callback_args:{rules:[54,55],inclusive:!1},callback_name:{rules:[51,52,53],inclusive:!1},href:{rules:[48,49],inclusive:!1},struct:{rules:[23,24,25,26,27,28],inclusive:!1},generic:{rules:[39,40],inclusive:!1},bqstring:{rules:[45,46],inclusive:!1},string:{rules:[42,43],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,9,10,11,13,15,18,19,20,21,22,23,29,30,31,32,33,34,35,36,37,38,41,44,47,50,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82],inclusive:!0}}};return t}();function V(){this.yy={}}return U.lexer=q,V.prototype=U,U.Parser=V,new V}();Es.parser=Es;const vs=Es,Ss=(t,e)=>{var i;return"dagre-wrapper"!==(null==(i=null==e?void 0:e.class)?void 0:i.defaultRenderer)&&null!==t.match(/^\s*classDiagram/)},ws=(t,e)=>{var i;return null!==t.match(/^\s*classDiagram/)&&"dagre-wrapper"===(null==(i=null==e?void 0:e.class)?void 0:i.defaultRenderer)||null!==t.match(/^\s*classDiagram-v2/)},As="classid-";let Bs=[],Ls={},Ds=[],Is=0,Os=[];const $s=t=>Ot.sanitizeText(t,Zi()),Ns=function(t){let e="",i=t;if(t.indexOf("~")>0){let r=t.split("~");i=r[0],e=Ot.sanitizeText(r[1],Zi())}return{className:i,type:e}},Fs=function(t){let e=Ns(t);void 0===Ls[e.className]&&(Ls[e.className]={id:e.className,type:e.type,cssClasses:[],methods:[],members:[],annotations:[],domId:As+e.className+"-"+Is},Is++)},Rs=function(t){const e=Object.keys(Ls);for(const i of e)if(Ls[i].id===t)return Ls[i].domId},Ms=function(t,e){const i=Ns(t).className,r=Ls[i];if("string"==typeof e){const t=e.trim();t.startsWith("<<")&&t.endsWith(">>")?r.annotations.push($s(t.substring(2,t.length-2))):t.indexOf(")")>0?r.methods.push($s(t)):t&&r.members.push($s(t))}},Ps=function(t,e){t.split(",").forEach((function(t){let i=t;t[0].match(/\d/)&&(i=As+i),void 0!==Ls[i]&&Ls[i].cssClasses.push(e)}))},zs=function(t,e,i){const r=Zi();let n=t,s=Rs(n);if("loose"===r.securityLevel&&void 0!==e&&void 0!==Ls[n]){let t=[];if("string"==typeof i){t=i.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e")),t.classed("hover",!0)})).on("mouseout",(function(){e.transition().duration(500).style("opacity",0);f(this).classed("hover",!1)}))};Os.push(js);let Ys="TB";const Ws={parseDirective:function(t,e,i){np.parseDirective(this,t,e,i)},setAccTitle:Sr,getAccTitle:wr,getAccDescription:Br,setAccDescription:Ar,getConfig:()=>Zi().class,addClass:Fs,bindFunctions:function(t){Os.forEach((function(e){e(t)}))},clear:function(){Bs=[],Ls={},Ds=[],Os=[],Os.push(js),vr()},getClass:function(t){return Ls[t]},getClasses:function(){return Ls},getNotes:function(){return Ds},addAnnotation:function(t,e){const i=Ns(t).className;Ls[i].annotations.push(e)},addNote:function(t,e){const i={id:`note${Ds.length}`,class:e,text:t};Ds.push(i)},getRelations:function(){return Bs},addRelation:function(t){Tt.debug("Adding relation: "+JSON.stringify(t)),Fs(t.id1),Fs(t.id2),t.id1=Ns(t.id1).className,t.id2=Ns(t.id2).className,t.relationTitle1=Ot.sanitizeText(t.relationTitle1.trim(),Zi()),t.relationTitle2=Ot.sanitizeText(t.relationTitle2.trim(),Zi()),Bs.push(t)},getDirection:()=>Ys,setDirection:t=>{Ys=t},addMember:Ms,addMembers:function(t,e){Array.isArray(e)&&(e.reverse(),e.forEach((e=>Ms(t,e))))},cleanupLabel:function(t){return":"===t.substring(0,1)?Ot.sanitizeText(t.substr(1).trim(),Zi()):$s(t.trim())},lineType:{LINE:0,DOTTED_LINE:1},relationType:{AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},setClickEvent:function(t,e,i){t.split(",").forEach((function(t){zs(t,e,i),Ls[t].haveCallback=!0})),Ps(t,"clickable")},setCssClass:Ps,setLink:function(t,e,i){const r=Zi();t.split(",").forEach((function(t){let n=t;t[0].match(/\d/)&&(n=As+n),void 0!==Ls[n]&&(Ls[n].link=Yi.formatUrl(e,r),"sandbox"===r.securityLevel?Ls[n].linkTarget="_top":Ls[n].linkTarget="string"==typeof i?$s(i):"_blank")})),Ps(t,"clickable")},getTooltip:function(t){return Ls[t].tooltip},setTooltip:function(t,e){const i=Zi();t.split(",").forEach((function(t){void 0!==e&&(Ls[t].tooltip=Ot.sanitizeText(e,i))}))},lookUpDomId:Rs,setDiagramTitle:Lr,getDiagramTitle:Dr};let Us=0;const qs=function(t){let e=t.match(/^([#+~-])?(\w+)(~\w+~|\[])?\s+(\w+) *([$*])?$/),i=t.match(/^([#+|~-])?(\w+) *\( *(.*)\) *([$*])? *(\w*[[\]|~]*\s*\w*~?)$/);return e&&!i?Vs(e):i?Hs(i):Gs(t)},Vs=function(t){let e="",i="";try{let r=t[1]?t[1].trim():"",n=t[2]?t[2].trim():"",s=t[3]?It(t[3].trim()):"",a=t[4]?t[4].trim():"",o=t[5]?t[5].trim():"";i=r+n+s+" "+a,e=Ks(o)}catch(r){i=t}return{displayText:i,cssStyle:e}},Hs=function(t){let e="",i="";try{let r=t[1]?t[1].trim():"",n=t[2]?t[2].trim():"",s=t[3]?It(t[3].trim()):"",a=t[4]?t[4].trim():"";i=r+n+"("+s+")"+(t[5]?" : "+It(t[5]).trim():""),e=Ks(a)}catch(r){i=t}return{displayText:i,cssStyle:e}},Gs=function(t){let e="",i="",r="",n=t.indexOf("("),s=t.indexOf(")");if(n>1&&s>n&&s<=t.length){let a="",o="",l=t.substring(0,1);l.match(/\w/)?o=t.substring(0,n).trim():(l.match(/[#+~-]/)&&(a=l),o=t.substring(1,n).trim());const c=t.substring(n+1,s);t.substring(s+1,1),i=Ks(t.substring(s+1,s+2)),e=a+o+"("+It(c.trim())+")",s");const h=o.append("tspan").text(c).attr("class","title");l||h.attr("dy",i.textHeight);const d=o.node().getBBox().height,u=a.append("line").attr("x1",0).attr("y1",i.padding+d+i.dividerMargin/2).attr("y2",i.padding+d+i.dividerMargin/2),p=a.append("text").attr("x",i.padding).attr("y",d+i.dividerMargin+i.textHeight).attr("fill","white").attr("class","classText");l=!0,e.members.forEach((function(t){Xs(p,t,l,i),l=!1}));const g=p.node().getBBox(),y=a.append("line").attr("x1",0).attr("y1",i.padding+d+i.dividerMargin+g.height).attr("y2",i.padding+d+i.dividerMargin+g.height),f=a.append("text").attr("x",i.padding).attr("y",d+2*i.dividerMargin+g.height+i.textHeight).attr("fill","white").attr("class","classText");l=!0,e.methods.forEach((function(t){Xs(f,t,l,i),l=!1}));const m=a.node().getBBox();var b=" ";e.cssClasses.length>0&&(b+=e.cssClasses.join(" "));const x=a.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",m.width+2*i.padding).attr("height",m.height+i.padding+.5*i.dividerMargin).attr("class",b).node().getBBox().width;return o.node().childNodes.forEach((function(t){t.setAttribute("x",(x-t.getBBox().width)/2)})),e.tooltip&&o.insert("title").text(e.tooltip),u.attr("x2",x),y.attr("x2",x),s.width=x,s.height=m.height+i.padding+.5*i.dividerMargin,s},Zs=function(t,e,i,r,n){const s=function(t){switch(t){case n.db.relationType.AGGREGATION:return"aggregation";case n.db.relationType.EXTENSION:return"extension";case n.db.relationType.COMPOSITION:return"composition";case n.db.relationType.DEPENDENCY:return"dependency";case n.db.relationType.LOLLIPOP:return"lollipop"}};e.points=e.points.filter((t=>!Number.isNaN(t.y)));const a=e.points,o=z().x((function(t){return t.x})).y((function(t){return t.y})).curve(R),l=t.append("path").attr("d",o(a)).attr("id","edge"+Us).attr("class","relation");let c,h,d="";r.arrowMarkerAbsolute&&(d=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,d=d.replace(/\(/g,"\\("),d=d.replace(/\)/g,"\\)")),1==i.relation.lineType&&l.attr("class","relation dashed-line"),10==i.relation.lineType&&l.attr("class","relation dotted-line"),"none"!==i.relation.type1&&l.attr("marker-start","url("+d+"#"+s(i.relation.type1)+"Start)"),"none"!==i.relation.type2&&l.attr("marker-end","url("+d+"#"+s(i.relation.type2)+"End)");const u=e.points.length;let p,g,y,f,m=Yi.calcLabelPosition(e.points);if(c=m.x,h=m.y,u%2!=0&&u>1){let t=Yi.calcCardinalityPosition("none"!==i.relation.type1,e.points,e.points[0]),r=Yi.calcCardinalityPosition("none"!==i.relation.type2,e.points,e.points[u-1]);Tt.debug("cardinality_1_point "+JSON.stringify(t)),Tt.debug("cardinality_2_point "+JSON.stringify(r)),p=t.x,g=t.y,y=r.x,f=r.y}if(void 0!==i.title){const e=t.append("g").attr("class","classLabel"),n=e.append("text").attr("class","label").attr("x",c).attr("y",h).attr("fill","red").attr("text-anchor","middle").text(i.title);window.label=n;const s=n.node().getBBox();e.insert("rect",":first-child").attr("class","box").attr("x",s.x-r.padding/2).attr("y",s.y-r.padding/2).attr("width",s.width+r.padding).attr("height",s.height+r.padding)}if(Tt.info("Rendering relation "+JSON.stringify(i)),void 0!==i.relationTitle1&&"none"!==i.relationTitle1){t.append("g").attr("class","cardinality").append("text").attr("class","type1").attr("x",p).attr("y",g).attr("fill","black").attr("font-size","6").text(i.relationTitle1)}if(void 0!==i.relationTitle2&&"none"!==i.relationTitle2){t.append("g").attr("class","cardinality").append("text").attr("class","type2").attr("x",y).attr("y",f).attr("fill","black").attr("font-size","6").text(i.relationTitle2)}Us++},Js=function(t,e,i,r){Tt.debug("Rendering note ",e,i);const n=e.id,s={id:n,text:e.text,width:0,height:0},a=t.append("g").attr("id",n).attr("class","classGroup");let o=a.append("text").attr("y",i.textHeight+i.padding).attr("x",0);const l=JSON.parse(`"${e.text}"`).split("\n");l.forEach((function(t){Tt.debug(`Adding line: ${t}`),o.append("tspan").text(t).attr("class","title").attr("dy",i.textHeight)}));const c=a.node().getBBox(),h=a.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",c.width+2*i.padding).attr("height",c.height+l.length*i.textHeight+i.padding+.5*i.dividerMargin).node().getBBox().width;return o.node().childNodes.forEach((function(t){t.setAttribute("x",(h-t.getBBox().width)/2)})),s.width=h,s.height=c.height+l.length*i.textHeight+i.padding+.5*i.dividerMargin,s};let ta={};const ea=function(t){const e=Object.entries(ta).find((e=>e[1].label===t));if(e)return e[0]},ia={draw:function(t,e,i,r){const n=Zi().class;ta={},Tt.info("Rendering diagram "+t);const s=Zi().securityLevel;let l;"sandbox"===s&&(l=f("#i"+e));const c=f("sandbox"===s?l.nodes()[0].contentDocument.body:"body"),h=c.select(`[id='${e}']`);var d;(d=h).append("defs").append("marker").attr("id","extensionStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),d.append("defs").append("marker").attr("id","extensionEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),d.append("defs").append("marker").attr("id","compositionStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),d.append("defs").append("marker").attr("id","compositionEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),d.append("defs").append("marker").attr("id","aggregationStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),d.append("defs").append("marker").attr("id","aggregationEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),d.append("defs").append("marker").attr("id","dependencyStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),d.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z");const u=new a({multigraph:!0});u.setGraph({isMultiGraph:!0}),u.setDefaultEdgeLabel((function(){return{}}));const p=r.db.getClasses(),g=Object.keys(p);for(const a of g){const t=p[a],e=Qs(h,t,n,r);ta[e.id]=e,u.setNode(e.id,e),Tt.info("Org height: "+e.height)}r.db.getRelations().forEach((function(t){Tt.info("tjoho"+ea(t.id1)+ea(t.id2)+JSON.stringify(t)),u.setEdge(ea(t.id1),ea(t.id2),{relation:t},t.title||"DEFAULT")}));r.db.getNotes().forEach((function(t){Tt.debug(`Adding note: ${JSON.stringify(t)}`);const e=Js(h,t,n,r);ta[e.id]=e,u.setNode(e.id,e),t.class&&t.class in p&&u.setEdge(t.id,ea(t.class),{relation:{id1:t.id,id2:t.class,relation:{type1:"none",type2:"none",lineType:10}}},"DEFAULT")})),o(u),u.nodes().forEach((function(t){void 0!==t&&void 0!==u.node(t)&&(Tt.debug("Node "+t+": "+JSON.stringify(u.node(t))),c.select("#"+(r.db.lookUpDomId(t)||t)).attr("transform","translate("+(u.node(t).x-u.node(t).width/2)+","+(u.node(t).y-u.node(t).height/2)+" )"))})),u.edges().forEach((function(t){void 0!==t&&void 0!==u.edge(t)&&(Tt.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(u.edge(t))),Zs(h,u.edge(t),u.edge(t).relation,n,r))}));const y=h.node().getBBox(),m=y.width+40,b=y.height+40;sr(h,b,m,n.useMaxWidth);const x=`${y.x-20} ${y.y-20} ${m} ${b}`;Tt.debug(`viewBox ${x}`),h.attr("viewBox",x)}},ra={extension:(t,e,i)=>{Tt.trace("Making markers for ",i),t.append("defs").append("marker").attr("id",e+"-extensionStart").attr("class","marker extension "+e).attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},composition:(t,e)=>{t.append("defs").append("marker").attr("id",e+"-compositionStart").attr("class","marker composition "+e).attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},aggregation:(t,e)=>{t.append("defs").append("marker").attr("id",e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},dependency:(t,e)=>{t.append("defs").append("marker").attr("id",e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},lollipop:(t,e)=>{t.append("defs").append("marker").attr("id",e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","white").attr("cx",6).attr("cy",7).attr("r",6)},point:(t,e)=>{t.append("marker").attr("id",e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 12 20").attr("refX",10).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},circle:(t,e)=>{t.append("marker").attr("id",e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},cross:(t,e)=>{t.append("marker").attr("id",e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},barb:(t,e)=>{t.append("defs").append("marker").attr("id",e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")}},na=(t,e,i,r)=>{e.forEach((e=>{ra[e](t,i,r)}))};const sa=(t,e,i,r)=>{let n=t||"";if("object"==typeof n&&(n=n[0]),Dt(Zi().flowchart.htmlLabels)){n=n.replace(/\\n|\n/g,"
"),Tt.info("vertexText"+n);let t=function(t){const e=f(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),i=e.append("xhtml:div"),r=t.label,n=t.isNode?"nodeLabel":"edgeLabel";var s,a;return i.html('"+r+""),s=i,(a=t.labelStyle)&&s.attr("style",a),i.style("display","inline-block"),i.style("white-space","nowrap"),i.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}({isNode:r,label:Xu(n).replace(/fa[blrs]?:fa-[\w-]+/g,(t=>``)),labelStyle:e.replace("fill:","color:")});return t}{const t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",e.replace("color:","fill:"));let r=[];r="string"==typeof n?n.split(/\\n|\n|/gi):Array.isArray(n)?n:[];for(const e of r){const r=document.createElementNS("http://www.w3.org/2000/svg","tspan");r.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),r.setAttribute("dy","1em"),r.setAttribute("x","0"),i?r.setAttribute("class","title-row"):r.setAttribute("class","row"),r.textContent=e.trim(),t.appendChild(r)}return t}},aa=(t,e,i,r)=>{let n;n=i||"node default";const s=t.insert("g").attr("class",n).attr("id",e.domId||e.id),a=s.insert("g").attr("class","label").attr("style",e.labelStyle);let o;o=void 0===e.labelText?"":"string"==typeof e.labelText?e.labelText:e.labelText[0];const l=a.node().appendChild(sa(wt(Xu(o),Zi()),e.labelStyle,!1,r));let c=l.getBBox();if(Dt(Zi().flowchart.htmlLabels)){const t=l.children[0],e=f(l);c=t.getBoundingClientRect(),e.attr("width",c.width),e.attr("height",c.height)}const h=e.padding/2;return a.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),{shapeSvg:s,bbox:c,halfPadding:h,label:a}},oa=(t,e)=>{const i=e.node().getBBox();t.width=i.width,t.height=i.height};function la(t,e,i,r){return t.insert("polygon",":first-child").attr("points",r.map((function(t){return t.x+","+t.y})).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+i/2+")")}let ca={},ha={},da={};const ua=(t,e)=>(Tt.trace("In isDecendant",e," ",t," = ",ha[e].includes(t)),!!ha[e].includes(t)),pa=(t,e,i,r)=>{Tt.warn("Copying children of ",t,"root",r,"data",e.node(t),r);const n=e.children(t)||[];t!==r&&n.push(t),Tt.warn("Copying (nodes) clusterId",t,"nodes",n),n.forEach((n=>{if(e.children(n).length>0)pa(n,e,i,r);else{const s=e.node(n);Tt.info("cp ",n," to ",r," with parent ",t),i.setNode(n,s),r!==e.parent(n)&&(Tt.warn("Setting parent",n,e.parent(n)),i.setParent(n,e.parent(n))),t!==r&&n!==t?(Tt.debug("Setting parent",n,t),i.setParent(n,t)):(Tt.info("In copy ",t,"root",r,"data",e.node(t),r),Tt.debug("Not Setting parent for node=",n,"cluster!==rootId",t!==r,"node!==clusterId",n!==t));const a=e.edges(n);Tt.debug("Copying Edges",a),a.forEach((n=>{Tt.info("Edge",n);const s=e.edge(n.v,n.w,n.name);Tt.info("Edge data",s,r);try{((t,e)=>(Tt.info("Decendants of ",e," is ",ha[e]),Tt.info("Edge is ",t),t.v!==e&&t.w!==e&&(ha[e]?ha[e].includes(t.v)||ua(t.v,e)||ua(t.w,e)||ha[e].includes(t.w):(Tt.debug("Tilt, ",e,",not in decendants"),!1))))(n,r)?(Tt.info("Copying as ",n.v,n.w,s,n.name),i.setEdge(n.v,n.w,s,n.name),Tt.info("newGraph edges ",i.edges(),i.edge(i.edges()[0]))):Tt.info("Skipping copy of edge ",n.v,"--\x3e",n.w," rootId: ",r," clusterId:",t)}catch(a){Tt.error(a)}}))}Tt.debug("Removing node",n),e.removeNode(n)}))},ga=(t,e)=>{const i=e.children(t);let r=[...i];for(const n of i)da[n]=t,r=[...r,...ga(n,e)];return r},ya=(t,e)=>{Tt.trace("Searching",t);const i=e.children(t);if(Tt.trace("Searching children of id ",t,i),i.length<1)return Tt.trace("This is a valid node",t),t;for(const r of i){const i=ya(r,e);if(i)return Tt.trace("Found replacement for",t," => ",i),i}},fa=t=>ca[t]&&ca[t].externalConnections&&ca[t]?ca[t].id:t,ma=(t,e)=>{if(Tt.warn("extractor - ",e,u(t),t.children("D")),e>10)return void Tt.error("Bailing out");let i=t.nodes(),r=!1;for(const n of i){const e=t.children(n);r=r||e.length>0}if(r){Tt.debug("Nodes = ",i,e);for(const r of i)if(Tt.debug("Extracting node",r,ca,ca[r]&&!ca[r].externalConnections,!t.parent(r),t.node(r),t.children("D")," Depth ",e),ca[r])if(!ca[r].externalConnections&&// !graph.parent(node) && +t.children(r)&&t.children(r).length>0){Tt.warn("Cluster without external connections, without a parent and with children",r,e);let i="TB"===t.graph().rankdir?"LR":"TB";ca[r]&&ca[r].clusterData&&ca[r].clusterData.dir&&(i=ca[r].clusterData.dir,Tt.warn("Fixing dir",ca[r].clusterData.dir,i));const n=new a({multigraph:!0,compound:!0}).setGraph({rankdir:i, +// Todo: set proper spacing +nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}}));Tt.warn("Old graph before copy",u(t)),pa(r,t,n,r),t.setNode(r,{clusterNode:!0,id:r,clusterData:ca[r].clusterData,labelText:ca[r].labelText,graph:n}),Tt.warn("New graph after copy node: (",r,")",u(n)),Tt.debug("Old graph after copy",u(t))}else Tt.warn("Cluster ** ",r," **not meeting the criteria !externalConnections:",!ca[r].externalConnections," no parent: ",!t.parent(r)," children ",t.children(r)&&t.children(r).length>0,t.children("D"),e),Tt.debug(ca);else Tt.debug("Not a cluster",r,e);i=t.nodes(),Tt.warn("New list of nodes",i);for(const r of i){const i=t.node(r);Tt.warn(" Now next level",r,i),i.clusterNode&&ma(i.graph,e+1)}}else Tt.debug("Done, no node has children",t.nodes())},ba=(t,e)=>{if(0===e.length)return[];let i=Object.assign(e);return e.forEach((e=>{const r=t.children(e),n=ba(t,r);i=[...i,...n]})),i};function xa(t,e,i,r){var n=t.x,s=t.y,a=n-r.x,o=s-r.y,l=Math.sqrt(e*e*o*o+i*i*a*a),c=Math.abs(e*i*a/l);r.x0}const Ca=(t,e)=>{var i,r,n=t.x,s=t.y,a=e.x-n,o=e.y-s,l=t.width/2,c=t.height/2;return Math.abs(o)*l>Math.abs(a)*c?(o<0&&(c=-c),i=0===o?0:c*a/o,r=c):(a<0&&(l=-l),i=l,r=0===a?0:l*o/a),{x:n+i,y:s+r}},Ta={node:function(t,e){return t.intersect(e)},circle:function(t,e,i){return xa(t,e,e,i)},ellipse:xa,polygon:function(t,e,i){var r=t.x,n=t.y,s=[],a=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach((function(t){a=Math.min(a,t.x),o=Math.min(o,t.y)})):(a=Math.min(a,e.x),o=Math.min(o,e.y));for(var l=r-t.width/2-a,c=n-t.height/2-o,h=0;h1&&s.sort((function(t,e){var r=t.x-i.x,n=t.y-i.y,s=Math.sqrt(r*r+n*n),a=e.x-i.x,o=e.y-i.y,l=Math.sqrt(a*a+o*o);return s{const{shapeSvg:i,bbox:r}=aa(t,e,void 0,!0),n=r.width+e.padding+(r.height+e.padding),s=[{x:n/2,y:0},{x:n,y:-n/2},{x:n/2,y:-n},{x:0,y:-n/2}];Tt.info("Question main (Circle)");const a=la(i,n,n,s);return a.attr("style",e.style),oa(e,a),e.intersect=function(t){return Tt.warn("Intersect called"),Ta.polygon(e,s,t)},i};function va(t,e,i,r){const n=[],s=t=>{n.push(t,0)},a=t=>{n.push(0,t)};e.includes("t")?(Tt.debug("add top border"),s(i)):a(i),e.includes("r")?(Tt.debug("add right border"),s(r)):a(r),e.includes("b")?(Tt.debug("add bottom border"),s(i)):a(i),e.includes("l")?(Tt.debug("add left border"),s(r)):a(r),t.attr("stroke-dasharray",n.join(" "))}const Sa=(t,e,i)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let n=70,s=10;"LR"===i&&(n=10,s=70);const a=r.append("rect").attr("x",-1*n/2).attr("y",-1*s/2).attr("width",n).attr("height",s).attr("class","fork-join");return oa(e,a),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(t){return Ta.rect(e,t)},r},wa={rhombus:Ea,question:Ea,rect:(t,e)=>{const{shapeSvg:i,bbox:r,halfPadding:n}=aa(t,e,"node "+e.classes,!0);Tt.trace("Classes = ",e.classes);const s=i.insert("rect",":first-child"),a=r.width+e.padding,o=r.height+e.padding;if(s.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",-r.width/2-n).attr("y",-r.height/2-n).attr("width",a).attr("height",o),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(va(s,e.props.borders,a,o),t.delete("borders")),t.forEach((t=>{Tt.warn(`Unknown node property ${t}`)}))}return oa(e,s),e.intersect=function(t){return Ta.rect(e,t)},i},labelRect:(t,e)=>{const{shapeSvg:i}=aa(t,e,"label",!0);Tt.trace("Classes = ",e.classes);const r=i.insert("rect",":first-child");if(r.attr("width",0).attr("height",0),i.attr("class","label edgeLabel"),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(va(r,e.props.borders,0,0),t.delete("borders")),t.forEach((t=>{Tt.warn(`Unknown node property ${t}`)}))}return oa(e,r),e.intersect=function(t){return Ta.rect(e,t)},i},rectWithTitle:(t,e)=>{let i;i=e.classes?"node "+e.classes:"node default";const r=t.insert("g").attr("class",i).attr("id",e.domId||e.id),n=r.insert("rect",":first-child"),s=r.insert("line"),a=r.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";l="object"==typeof o?o[0]:o,Tt.info("Label text abc79",l,o,"object"==typeof o);const c=a.node().appendChild(sa(l,e.labelStyle,!0,!0));let h={width:0,height:0};if(Dt(Zi().flowchart.htmlLabels)){const t=c.children[0],e=f(c);h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}Tt.info("Text 2",o);const d=o.slice(1,o.length);let u=c.getBBox();const p=a.node().appendChild(sa(d.join?d.join("
"):d,e.labelStyle,!0,!0));if(Dt(Zi().flowchart.htmlLabels)){const t=p.children[0],e=f(p);h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}const g=e.padding/2;return f(p).attr("transform","translate( "+(// (titleBox.width - bbox.width) / 2 + +h.width>u.width?0:(u.width-h.width)/2)+", "+(u.height+g+5)+")"),f(c).attr("transform","translate( "+(// (titleBox.width - bbox.width) / 2 + +h.width{const i=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),r=[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}];return i.insert("polygon",":first-child").attr("points",r.map((function(t){return t.x+","+t.y})).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(t){return Ta.circle(e,14,t)},i},circle:(t,e)=>{const{shapeSvg:i,bbox:r,halfPadding:n}=aa(t,e,void 0,!0),s=i.insert("circle",":first-child");return s.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",r.width/2+n).attr("width",r.width+e.padding).attr("height",r.height+e.padding),Tt.info("Circle main"),oa(e,s),e.intersect=function(t){return Tt.info("Circle intersect",e,r.width/2+n,t),Ta.circle(e,r.width/2+n,t)},i},doublecircle:(t,e)=>{const{shapeSvg:i,bbox:r,halfPadding:n}=aa(t,e,void 0,!0),s=i.insert("g",":first-child"),a=s.insert("circle"),o=s.insert("circle");return a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",r.width/2+n+5).attr("width",r.width+e.padding+10).attr("height",r.height+e.padding+10),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",r.width/2+n).attr("width",r.width+e.padding).attr("height",r.height+e.padding),Tt.info("DoubleCircle main"),oa(e,a),e.intersect=function(t){return Tt.info("DoubleCircle intersect",e,r.width/2+n+5,t),Ta.circle(e,r.width/2+n+5,t)},i},stadium:(t,e)=>{const{shapeSvg:i,bbox:r}=aa(t,e,void 0,!0),n=r.height+e.padding,s=r.width+n/4+e.padding,a=i.insert("rect",":first-child").attr("style",e.style).attr("rx",n/2).attr("ry",n/2).attr("x",-s/2).attr("y",-n/2).attr("width",s).attr("height",n);return oa(e,a),e.intersect=function(t){return Ta.rect(e,t)},i},hexagon:(t,e)=>{const{shapeSvg:i,bbox:r}=aa(t,e,void 0,!0),n=r.height+e.padding,s=n/4,a=r.width+2*s+e.padding,o=[{x:s,y:0},{x:a-s,y:0},{x:a,y:-n/2},{x:a-s,y:-n},{x:s,y:-n},{x:0,y:-n/2}],l=la(i,a,n,o);return l.attr("style",e.style),oa(e,l),e.intersect=function(t){return Ta.polygon(e,o,t)},i},rect_left_inv_arrow:(t,e)=>{const{shapeSvg:i,bbox:r}=aa(t,e,void 0,!0),n=r.width+e.padding,s=r.height+e.padding,a=[{x:-s/2,y:0},{x:n,y:0},{x:n,y:-s},{x:-s/2,y:-s},{x:0,y:-s/2}];return la(i,n,s,a).attr("style",e.style),e.width=n+s,e.height=s,e.intersect=function(t){return Ta.polygon(e,a,t)},i},lean_right:(t,e)=>{const{shapeSvg:i,bbox:r}=aa(t,e,void 0,!0),n=r.width+e.padding,s=r.height+e.padding,a=[{x:-2*s/6,y:0},{x:n-s/6,y:0},{x:n+2*s/6,y:-s},{x:s/6,y:-s}],o=la(i,n,s,a);return o.attr("style",e.style),oa(e,o),e.intersect=function(t){return Ta.polygon(e,a,t)},i},lean_left:(t,e)=>{const{shapeSvg:i,bbox:r}=aa(t,e,void 0,!0),n=r.width+e.padding,s=r.height+e.padding,a=[{x:2*s/6,y:0},{x:n+s/6,y:0},{x:n-2*s/6,y:-s},{x:-s/6,y:-s}],o=la(i,n,s,a);return o.attr("style",e.style),oa(e,o),e.intersect=function(t){return Ta.polygon(e,a,t)},i},trapezoid:(t,e)=>{const{shapeSvg:i,bbox:r}=aa(t,e,void 0,!0),n=r.width+e.padding,s=r.height+e.padding,a=[{x:-2*s/6,y:0},{x:n+2*s/6,y:0},{x:n-s/6,y:-s},{x:s/6,y:-s}],o=la(i,n,s,a);return o.attr("style",e.style),oa(e,o),e.intersect=function(t){return Ta.polygon(e,a,t)},i},inv_trapezoid:(t,e)=>{const{shapeSvg:i,bbox:r}=aa(t,e,void 0,!0),n=r.width+e.padding,s=r.height+e.padding,a=[{x:s/6,y:0},{x:n-s/6,y:0},{x:n+2*s/6,y:-s},{x:-2*s/6,y:-s}],o=la(i,n,s,a);return o.attr("style",e.style),oa(e,o),e.intersect=function(t){return Ta.polygon(e,a,t)},i},rect_right_inv_arrow:(t,e)=>{const{shapeSvg:i,bbox:r}=aa(t,e,void 0,!0),n=r.width+e.padding,s=r.height+e.padding,a=[{x:0,y:0},{x:n+s/2,y:0},{x:n,y:-s/2},{x:n+s/2,y:-s},{x:0,y:-s}],o=la(i,n,s,a);return o.attr("style",e.style),oa(e,o),e.intersect=function(t){return Ta.polygon(e,a,t)},i},cylinder:(t,e)=>{const{shapeSvg:i,bbox:r}=aa(t,e,void 0,!0),n=r.width+e.padding,s=n/2,a=s/(2.5+n/50),o=r.height+a+e.padding,l="M 0,"+a+" a "+s+","+a+" 0,0,0 "+n+" 0 a "+s+","+a+" 0,0,0 "+-n+" 0 l 0,"+o+" a "+s+","+a+" 0,0,0 "+n+" 0 l 0,"+-o,c=i.attr("label-offset-y",a).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-n/2+","+-(o/2+a)+")");return oa(e,c),e.intersect=function(t){const i=Ta.rect(e,t),r=i.x-e.x;if(0!=s&&(Math.abs(r)e.height/2-a)){let n=a*a*(1-r*r/(s*s));0!=n&&(n=Math.sqrt(n)),n=a-n,t.y-e.y>0&&(n=-n),i.y+=n}return i},i},start:(t,e)=>{const i=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),r=i.insert("circle",":first-child");return r.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),oa(e,r),e.intersect=function(t){return Ta.circle(e,7,t)},i},end:(t,e)=>{const i=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),r=i.insert("circle",":first-child"),n=i.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),r.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),oa(e,n),e.intersect=function(t){return Ta.circle(e,7,t)},i},note:(t,e)=>{const{shapeSvg:i,bbox:r,halfPadding:n}=aa(t,e,"node "+e.classes,!0);Tt.info("Classes = ",e.classes);const s=i.insert("rect",":first-child");return s.attr("rx",e.rx).attr("ry",e.ry).attr("x",-r.width/2-n).attr("y",-r.height/2-n).attr("width",r.width+e.padding).attr("height",r.height+e.padding),oa(e,s),e.intersect=function(t){return Ta.rect(e,t)},i},subroutine:(t,e)=>{const{shapeSvg:i,bbox:r}=aa(t,e,void 0,!0),n=r.width+e.padding,s=r.height+e.padding,a=[{x:0,y:0},{x:n,y:0},{x:n,y:-s},{x:0,y:-s},{x:0,y:0},{x:-8,y:0},{x:n+8,y:0},{x:n+8,y:-s},{x:-8,y:-s},{x:-8,y:0}],o=la(i,n,s,a);return o.attr("style",e.style),oa(e,o),e.intersect=function(t){return Ta.polygon(e,a,t)},i},fork:Sa,join:Sa,class_box:(t,e)=>{const i=e.padding/2;let r;r=e.classes?"node "+e.classes:"node default";const n=t.insert("g").attr("class",r).attr("id",e.domId||e.id),s=n.insert("rect",":first-child"),a=n.insert("line"),o=n.insert("line");let l=0,c=4;const h=n.insert("g").attr("class","label");let d=0;const u=e.classData.annotations&&e.classData.annotations[0],p=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",g=h.node().appendChild(sa(p,e.labelStyle,!0,!0));let y=g.getBBox();if(Dt(Zi().flowchart.htmlLabels)){const t=g.children[0],e=f(g);y=t.getBoundingClientRect(),e.attr("width",y.width),e.attr("height",y.height)}e.classData.annotations[0]&&(c+=y.height+4,l+=y.width);let m=e.classData.id;void 0!==e.classData.type&&""!==e.classData.type&&(Zi().flowchart.htmlLabels?m+="<"+e.classData.type+">":m+="<"+e.classData.type+">");const b=h.node().appendChild(sa(m,e.labelStyle,!0,!0));f(b).attr("class","classTitle");let x=b.getBBox();if(Dt(Zi().flowchart.htmlLabels)){const t=b.children[0],e=f(b);x=t.getBoundingClientRect(),e.attr("width",x.width),e.attr("height",x.height)}c+=x.height+4,x.width>l&&(l=x.width);const k=[];e.classData.members.forEach((t=>{const i=qs(t);let r=i.displayText;Zi().flowchart.htmlLabels&&(r=r.replace(//g,">"));const n=h.node().appendChild(sa(r,i.cssStyle?i.cssStyle:e.labelStyle,!0,!0));let s=n.getBBox();if(Dt(Zi().flowchart.htmlLabels)){const t=n.children[0],e=f(n);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}s.width>l&&(l=s.width),c+=s.height+4,k.push(n)})),c+=8;const _=[];if(e.classData.methods.forEach((t=>{const i=qs(t);let r=i.displayText;Zi().flowchart.htmlLabels&&(r=r.replace(//g,">"));const n=h.node().appendChild(sa(r,i.cssStyle?i.cssStyle:e.labelStyle,!0,!0));let s=n.getBBox();if(Dt(Zi().flowchart.htmlLabels)){const t=n.children[0],e=f(n);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}s.width>l&&(l=s.width),c+=s.height+4,_.push(n)})),c+=8,u){let t=(l-y.width)/2;f(g).attr("transform","translate( "+(-1*l/2+t)+", "+-1*c/2+")"),d=y.height+4}let C=(l-x.width)/2;return f(b).attr("transform","translate( "+(-1*l/2+C)+", "+(-1*c/2+d)+")"),d+=x.height+4,a.attr("class","divider").attr("x1",-l/2-i).attr("x2",l/2+i).attr("y1",-c/2-i+8+d).attr("y2",-c/2-i+8+d),d+=8,k.forEach((t=>{f(t).attr("transform","translate( "+-l/2+", "+(-1*c/2+d+4)+")"),d+=x.height+4})),d+=8,o.attr("class","divider").attr("x1",-l/2-i).attr("x2",l/2+i).attr("y1",-c/2-i+8+d).attr("y2",-c/2-i+8+d),d+=8,_.forEach((t=>{f(t).attr("transform","translate( "+-l/2+", "+(-1*c/2+d)+")"),d+=x.height+4})),s.attr("class","outer title-state").attr("x",-l/2-i).attr("y",-c/2-i).attr("width",l+e.padding).attr("height",c+e.padding),oa(e,s),e.intersect=function(t){return Ta.rect(e,t)},n}};let Aa={};const Ba=(t,e,i)=>{let r,n;if(e.link){let s;"sandbox"===Zi().securityLevel?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),r=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s),n=wa[e.shape](r,e,i)}else n=wa[e.shape](t,e,i),r=n;return e.tooltip&&n.attr("title",e.tooltip),e.class&&n.attr("class","node default "+e.class),Aa[e.id]=r,e.haveCallback&&Aa[e.id].attr("class",Aa[e.id].attr("class")+" clickable"),r},La=t=>{const e=Aa[t.id];Tt.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const i=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+i-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),i},Da={rect:(t,e)=>{Tt.trace("Creating subgraph rect for ",e.id,e);const i=t.insert("g").attr("class","cluster"+(e.class?" "+e.class:"")).attr("id",e.id),r=i.insert("rect",":first-child"),n=i.insert("g").attr("class","cluster-label"),s=n.node().appendChild(sa(e.labelText,e.labelStyle,void 0,!0));let a=s.getBBox();if(Dt(Zi().flowchart.htmlLabels)){const t=s.children[0],e=f(s);a=t.getBoundingClientRect(),e.attr("width",a.width),e.attr("height",a.height)}const o=0*e.padding,l=o/2,c=e.width<=a.width+o?a.width+o:e.width;e.width<=a.width+o?e.diff=(a.width-e.width)/2-e.padding/2:e.diff=-e.padding/2,Tt.trace("Data ",e,JSON.stringify(e)),r.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-c/2).attr("y",e.y-e.height/2-l).attr("width",c).attr("height",e.height+o),n.attr("transform", +// This puts the labal on top of the box instead of inside it +// 'translate(' + (node.x - bbox.width / 2) + ', ' + (node.y - node.height / 2 - bbox.height) + ')' +"translate("+(e.x-a.width/2)+", "+(e.y-e.height/2)+")");const h=r.node().getBBox();return e.width=h.width,e.height=h.height,e.intersect=function(t){return Ca(e,t)},i},roundedWithTitle:(t,e)=>{const i=t.insert("g").attr("class",e.classes).attr("id",e.id),r=i.insert("rect",":first-child"),n=i.insert("g").attr("class","cluster-label"),s=i.append("rect"),a=n.node().appendChild(sa(e.labelText,e.labelStyle,void 0,!0));let o=a.getBBox();if(Dt(Zi().flowchart.htmlLabels)){const t=a.children[0],e=f(a);o=t.getBoundingClientRect(),e.attr("width",o.width),e.attr("height",o.height)}o=a.getBBox();const l=0*e.padding,c=l/2,h=e.width<=o.width+e.padding?o.width+e.padding:e.width;e.width<=o.width+e.padding?e.diff=(o.width+0*e.padding-e.width)/2:e.diff=-e.padding/2,r.attr("class","outer").attr("x",e.x-h/2-c).attr("y",e.y-e.height/2-c).attr("width",h+l).attr("height",e.height+l),s.attr("class","inner").attr("x",e.x-h/2-c).attr("y",e.y-e.height/2-c+o.height-1).attr("width",h+l).attr("height",e.height+l-o.height-3),n.attr("transform","translate("+(e.x-o.width/2)+", "+(e.y-e.height/2-e.padding/3+(Dt(Zi().flowchart.htmlLabels)?5:3))+")");const d=r.node().getBBox();return e.height=d.height,e.intersect=function(t){return Ca(e,t)},i},noteGroup:(t,e)=>{const i=t.insert("g").attr("class","note-cluster").attr("id",e.id),r=i.insert("rect",":first-child"),n=0*e.padding,s=n/2;r.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-s).attr("y",e.y-e.height/2-s).attr("width",e.width+n).attr("height",e.height+n).attr("fill","none");const a=r.node().getBBox();return e.width=a.width,e.height=a.height,e.intersect=function(t){return Ca(e,t)},i},divider:(t,e)=>{const i=t.insert("g").attr("class",e.classes).attr("id",e.id),r=i.insert("rect",":first-child"),n=0*e.padding,s=n/2;r.attr("class","divider").attr("x",e.x-e.width/2-s).attr("y",e.y-e.height/2).attr("width",e.width+n).attr("height",e.height+n);const a=r.node().getBBox();return e.width=a.width,e.height=a.height,e.diff=-e.padding/2,e.intersect=function(t){return Ca(e,t)},i}};let Ia={};let Oa={},$a={};const Na=(t,e)=>{const i=sa(e.label,e.labelStyle),r=t.insert("g").attr("class","edgeLabel"),n=r.insert("g").attr("class","label");n.node().appendChild(i);let s,a=i.getBBox();if(Dt(Zi().flowchart.htmlLabels)){const t=i.children[0],e=f(i);a=t.getBoundingClientRect(),e.attr("width",a.width),e.attr("height",a.height)}if(n.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),Oa[e.id]=r,e.width=a.width,e.height=a.height,e.startLabelLeft){const i=sa(e.startLabelLeft,e.labelStyle),r=t.insert("g").attr("class","edgeTerminals"),n=r.insert("g").attr("class","inner");s=n.node().appendChild(i);const a=i.getBBox();n.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),$a[e.id]||($a[e.id]={}),$a[e.id].startLeft=r,Fa(s,e.startLabelLeft)}if(e.startLabelRight){const i=sa(e.startLabelRight,e.labelStyle),r=t.insert("g").attr("class","edgeTerminals"),n=r.insert("g").attr("class","inner");s=r.node().appendChild(i),n.node().appendChild(i);const a=i.getBBox();n.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),$a[e.id]||($a[e.id]={}),$a[e.id].startRight=r,Fa(s,e.startLabelRight)}if(e.endLabelLeft){const i=sa(e.endLabelLeft,e.labelStyle),r=t.insert("g").attr("class","edgeTerminals"),n=r.insert("g").attr("class","inner");s=n.node().appendChild(i);const a=i.getBBox();n.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),r.node().appendChild(i),$a[e.id]||($a[e.id]={}),$a[e.id].endLeft=r,Fa(s,e.endLabelLeft)}if(e.endLabelRight){const i=sa(e.endLabelRight,e.labelStyle),r=t.insert("g").attr("class","edgeTerminals"),n=r.insert("g").attr("class","inner");s=n.node().appendChild(i);const a=i.getBBox();n.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),r.node().appendChild(i),$a[e.id]||($a[e.id]={}),$a[e.id].endRight=r,Fa(s,e.endLabelRight)}return i};function Fa(t,e){Zi().flowchart.htmlLabels&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}const Ra=(t,e)=>{Tt.warn("abc88 cutPathAtIntersect",t,e);let i=[],r=t[0],n=!1;return t.forEach((t=>{if(Tt.info("abc88 checking point",t,e),((t,e)=>{const i=t.x,r=t.y,n=Math.abs(e.x-i),s=Math.abs(e.y-r),a=t.width/2,o=t.height/2;return n>=a||s>=o})(e,t)||n)Tt.warn("abc88 outside",t,r),r=t,n||i.push(t);else{const s=((t,e,i)=>{Tt.warn(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(e)}\n insidePoint : ${JSON.stringify(i)}\n node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const r=t.x,n=t.y,s=Math.abs(r-i.x),a=t.width/2;let o=i.xMath.abs(r-e.x)*l){let t=i.y{a=a||t.x===s.x&&t.y===s.y})),i.some((t=>t.x===s.x&&t.y===s.y))?Tt.warn("abc88 no intersect",s,i):i.push(s),n=!0}})),Tt.warn("abc88 returning points",i),i},Ma=(t,e,i,r)=>{Tt.info("Graph in recursive render: XXX",u(e),r);const n=e.graph().rankdir;Tt.trace("Dir in recursive render - dir:",n);const s=t.insert("g").attr("class","root");e.nodes()?Tt.info("Recursive render XXX",e.nodes()):Tt.info("No nodes found for",e),e.edges().length>0&&Tt.trace("Recursive edges",e.edge(e.edges()[0]));const a=s.insert("g").attr("class","clusters"),l=s.insert("g").attr("class","edgePaths"),c=s.insert("g").attr("class","edgeLabels"),h=s.insert("g").attr("class","nodes");e.nodes().forEach((function(t){const s=e.node(t);if(void 0!==r){const i=JSON.parse(JSON.stringify(r.clusterData));Tt.info("Setting data for cluster XXX (",t,") ",i,r),e.setNode(r.id,i),e.parent(t)||(Tt.trace("Setting parent",t,r.id),e.setParent(t,r.id,i))}if(Tt.info("(Insert) Node XXX"+t+": "+JSON.stringify(e.node(t))),s&&s.clusterNode){Tt.info("Cluster identified",t,s.width,e.node(t));const r=Ma(h,s.graph,i,e.node(t)),n=r.elem;oa(s,n),s.diff=r.diff||0,Tt.info("Node bounds (abc123)",t,s,s.width,s.x,s.y),((t,e)=>{Aa[e.id]=t})(n,s),Tt.warn("Recursive render complete ",n,s)}else e.children(t).length>0?(Tt.info("Cluster - the non recursive path XXX",t,s.id,s,e),Tt.info(ya(s.id,e)),ca[s.id]={id:ya(s.id,e),node:s}):(Tt.info("Node - the non recursive path",t,s.id,s),Ba(h,e.node(t),n))})),e.edges().forEach((function(t){const i=e.edge(t.v,t.w,t.name);Tt.info("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),Tt.info("Edge "+t.v+" -> "+t.w+": ",t," ",JSON.stringify(e.edge(t))),Tt.info("Fix",ca,"ids:",t.v,t.w,"Translateing: ",ca[t.v],ca[t.w]),Na(c,i)})),e.edges().forEach((function(t){Tt.info("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t))})),Tt.info("#############################################"),Tt.info("### Layout ###"),Tt.info("#############################################"),Tt.info(e),o(e),Tt.info("Graph after layout:",u(e));let d=0;return(t=>ba(t,t.children()))(e).forEach((function(t){const i=e.node(t);Tt.info("Position "+t+": "+JSON.stringify(e.node(t))),Tt.info("Position "+t+": ("+i.x,","+i.y,") width: ",i.width," height: ",i.height),i&&i.clusterNode?La(i):e.children(t).length>0?(((t,e)=>{Tt.trace("Inserting cluster");const i=e.shape||"rect";Ia[e.id]=Da[i](t,e)})(a,i),ca[i.id].node=i):La(i)})),e.edges().forEach((function(t){const r=e.edge(t);Tt.info("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(r),r);const n=function(t,e,i,r,n,s){let a=i.points,o=!1;const l=s.node(e.v);var c=s.node(e.w);Tt.info("abc88 InsertEdge: ",i),c.intersect&&l.intersect&&(a=a.slice(1,i.points.length-1),a.unshift(l.intersect(a[0])),Tt.info("Last point",a[a.length-1],c,c.intersect(a[a.length-1])),a.push(c.intersect(a[a.length-1]))),i.toCluster&&(Tt.info("to cluster abc88",r[i.toCluster]),a=Ra(i.points,r[i.toCluster].node),o=!0),i.fromCluster&&(Tt.info("from cluster abc88",r[i.fromCluster]),a=Ra(a.reverse(),r[i.fromCluster].node).reverse(),o=!0);const h=a.filter((t=>!Number.isNaN(t.y)));let d;d=("graph"===n||"flowchart"===n)&&i.curve||R;const u=z().x((function(t){return t.x})).y((function(t){return t.y})).curve(d);let p;switch(i.thickness){case"normal":p="edge-thickness-normal";break;case"thick":p="edge-thickness-thick";break;default:p=""}switch(i.pattern){case"solid":p+=" edge-pattern-solid";break;case"dotted":p+=" edge-pattern-dotted";break;case"dashed":p+=" edge-pattern-dashed"}const g=t.append("path").attr("d",u(h)).attr("id",i.id).attr("class"," "+p+(i.classes?" "+i.classes:"")).attr("style",i.style);let y="";switch((Zi().flowchart.arrowMarkerAbsolute||Zi().state.arrowMarkerAbsolute)&&(y=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,y=y.replace(/\(/g,"\\("),y=y.replace(/\)/g,"\\)")),Tt.info("arrowTypeStart",i.arrowTypeStart),Tt.info("arrowTypeEnd",i.arrowTypeEnd),i.arrowTypeStart){case"arrow_cross":g.attr("marker-start","url("+y+"#"+n+"-crossStart)");break;case"arrow_point":g.attr("marker-start","url("+y+"#"+n+"-pointStart)");break;case"arrow_barb":g.attr("marker-start","url("+y+"#"+n+"-barbStart)");break;case"arrow_circle":g.attr("marker-start","url("+y+"#"+n+"-circleStart)");break;case"aggregation":g.attr("marker-start","url("+y+"#"+n+"-aggregationStart)");break;case"extension":g.attr("marker-start","url("+y+"#"+n+"-extensionStart)");break;case"composition":g.attr("marker-start","url("+y+"#"+n+"-compositionStart)");break;case"dependency":g.attr("marker-start","url("+y+"#"+n+"-dependencyStart)");break;case"lollipop":g.attr("marker-start","url("+y+"#"+n+"-lollipopStart)")}switch(i.arrowTypeEnd){case"arrow_cross":g.attr("marker-end","url("+y+"#"+n+"-crossEnd)");break;case"arrow_point":g.attr("marker-end","url("+y+"#"+n+"-pointEnd)");break;case"arrow_barb":g.attr("marker-end","url("+y+"#"+n+"-barbEnd)");break;case"arrow_circle":g.attr("marker-end","url("+y+"#"+n+"-circleEnd)");break;case"aggregation":g.attr("marker-end","url("+y+"#"+n+"-aggregationEnd)");break;case"extension":g.attr("marker-end","url("+y+"#"+n+"-extensionEnd)");break;case"composition":g.attr("marker-end","url("+y+"#"+n+"-compositionEnd)");break;case"dependency":g.attr("marker-end","url("+y+"#"+n+"-dependencyEnd)");break;case"lollipop":g.attr("marker-end","url("+y+"#"+n+"-lollipopEnd)")}let f={};return o&&(f.updatedPath=a),f.originalPath=i.points,f}(l,t,r,ca,i,e);((t,e)=>{Tt.info("Moving label abc78 ",t.id,t.label,Oa[t.id]);let i=e.updatedPath?e.updatedPath:e.originalPath;if(t.label){const r=Oa[t.id];let n=t.x,s=t.y;if(i){const r=Yi.calcLabelPosition(i);Tt.info("Moving label "+t.label+" from (",n,",",s,") to (",r.x,",",r.y,") abc78"),e.updatedPath&&(n=r.x,s=r.y)}r.attr("transform","translate("+n+", "+s+")")}if(t.startLabelLeft){const e=$a[t.id].startLeft;let r=t.x,n=t.y;if(i){const e=Yi.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",i);r=e.x,n=e.y}e.attr("transform","translate("+r+", "+n+")")}if(t.startLabelRight){const e=$a[t.id].startRight;let r=t.x,n=t.y;if(i){const e=Yi.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",i);r=e.x,n=e.y}e.attr("transform","translate("+r+", "+n+")")}if(t.endLabelLeft){const e=$a[t.id].endLeft;let r=t.x,n=t.y;if(i){const e=Yi.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",i);r=e.x,n=e.y}e.attr("transform","translate("+r+", "+n+")")}if(t.endLabelRight){const e=$a[t.id].endRight;let r=t.x,n=t.y;if(i){const e=Yi.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",i);r=e.x,n=e.y}e.attr("transform","translate("+r+", "+n+")")}})(r,n)})),e.nodes().forEach((function(t){const i=e.node(t);Tt.info(t,i.type,i.diff),"group"===i.type&&(d=i.diff)})),{elem:s,diff:d}},Pa=(t,e,i,r,n)=>{na(t,i,r,n),Aa={},Oa={},$a={},Ia={},ha={},da={},ca={},Tt.warn("Graph at first:",u(e)),((t,e)=>{!t||e>10?Tt.debug("Opting out, no graph "):(Tt.debug("Opting in, graph "),t.nodes().forEach((function(e){t.children(e).length>0&&(Tt.warn("Cluster identified",e," Replacement id in edges: ",ya(e,t)),ha[e]=ga(e,t),ca[e]={id:ya(e,t),clusterData:t.node(e)})})),t.nodes().forEach((function(e){const i=t.children(e),r=t.edges();i.length>0?(Tt.debug("Cluster identified",e,ha),r.forEach((t=>{t.v!==e&&t.w!==e&&ua(t.v,e)^ua(t.w,e)&&(Tt.warn("Edge: ",t," leaves cluster ",e),Tt.warn("Decendants of XXX ",e,": ",ha[e]),ca[e].externalConnections=!0)}))):Tt.debug("Not a cluster ",e,ha)})),t.edges().forEach((function(e){const i=t.edge(e);Tt.warn("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),Tt.warn("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(t.edge(e)));let r=e.v,n=e.w;if(Tt.warn("Fix XXX",ca,"ids:",e.v,e.w,"Translating: ",ca[e.v]," --- ",ca[e.w]),ca[e.v]&&ca[e.w]&&ca[e.v]===ca[e.w]){Tt.warn("Fixing and trixing link to self - removing XXX",e.v,e.w,e.name),Tt.warn("Fixing and trixing - removing XXX",e.v,e.w,e.name),r=fa(e.v),n=fa(e.w),t.removeEdge(e.v,e.w,e.name);const s=e.w+"---"+e.v;t.setNode(s,{domId:s,id:s,labelStyle:"",labelText:i.label,padding:0,shape:"labelRect",style:""});const a=JSON.parse(JSON.stringify(i)),o=JSON.parse(JSON.stringify(i));a.label="",a.arrowTypeEnd="none",o.label="",a.fromCluster=e.v,o.toCluster=e.v,t.setEdge(r,s,a,e.name+"-cyclic-special"),t.setEdge(s,n,o,e.name+"-cyclic-special")}else(ca[e.v]||ca[e.w])&&(Tt.warn("Fixing and trixing - removing XXX",e.v,e.w,e.name),r=fa(e.v),n=fa(e.w),t.removeEdge(e.v,e.w,e.name),r!==e.v&&(i.fromCluster=e.v),n!==e.w&&(i.toCluster=e.w),Tt.warn("Fix Replacing with XXX",r,n,e.name),t.setEdge(r,n,i,e.name))})),Tt.warn("Adjusted Graph",u(t)),ma(t,0),Tt.trace(ca))})(e),Tt.warn("Graph after:",u(e)),Ma(t,e,r)},za=t=>Ot.sanitizeText(t,Zi());let ja={dividerMargin:10,padding:5,textHeight:10};function Ya(t){let e;switch(t){case 0:e="aggregation";break;case 1:e="extension";break;case 2:e="composition";break;case 3:e="dependency";break;case 4:e="lollipop";break;default:e="none"}return e}const Wa={setConf:function(t){Object.keys(t).forEach((function(e){ja[e]=t[e]}))},draw:function(t,e,i,r){Tt.info("Drawing class - ",e);const n=Zi().flowchart,s=Zi().securityLevel;Tt.info("config:",n);const o=n.nodeSpacing||50,l=n.rankSpacing||50,c=new a({multigraph:!0,compound:!0}).setGraph({rankdir:r.db.getDirection(),nodesep:o,ranksep:l,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}})),h=r.db.getClasses(),d=r.db.getRelations(),u=r.db.getNotes();let p;Tt.info(d),function(t,e,i,r){const n=Object.keys(t);Tt.info("keys:",n),Tt.info(t),n.forEach((function(i){const n=t[i];let s="";n.cssClasses.length>0&&(s=s+" "+n.cssClasses.join(" "));const a={labelStyle:""};let o=void 0!==n.text?n.text:n.id,l="";n.type,l="class_box",e.setNode(n.id,{labelStyle:a.labelStyle,shape:l,labelText:za(o),classData:n,rx:0,ry:0,class:s,style:a.style,id:n.id,domId:n.domId,tooltip:r.db.getTooltip(n.id)||"",haveCallback:n.haveCallback,link:n.link,width:"group"===n.type?500:void 0,type:n.type,padding:Zi().flowchart.padding}),Tt.info("setNode",{labelStyle:a.labelStyle,shape:l,labelText:o,rx:0,ry:0,class:s,style:a.style,id:n.id,width:"group"===n.type?500:void 0,type:n.type,padding:Zi().flowchart.padding})}))}(h,c,0,r),function(t,e){const i=Zi().flowchart;let r=0;t.forEach((function(n){r++;const s={classes:"relation"};s.pattern=1==n.relation.lineType?"dashed":"solid",s.id="id"+r,"arrow_open"===n.type?s.arrowhead="none":s.arrowhead="normal",Tt.info(s,n),s.startLabelRight="none"===n.relationTitle1?"":n.relationTitle1,s.endLabelLeft="none"===n.relationTitle2?"":n.relationTitle2,s.arrowTypeStart=Ya(n.relation.type1),s.arrowTypeEnd=Ya(n.relation.type2);let a="",o="";if(void 0!==n.style){const t=wi(n.style);a=t.style,o=t.labelStyle}else a="fill:none";s.style=a,s.labelStyle=o,void 0!==n.interpolate?s.curve=vi(n.interpolate,v):void 0!==t.defaultInterpolate?s.curve=vi(t.defaultInterpolate,v):s.curve=vi(i.curve,v),n.text=n.title,void 0===n.text?void 0!==n.style&&(s.arrowheadStyle="fill: #333"):(s.arrowheadStyle="fill: #333",s.labelpos="c",Zi().flowchart.htmlLabels?(s.labelType="html",s.label=''+n.text+""):(s.labelType="text",s.label=n.text.replace(Ot.lineBreakRegex,"\n"),void 0===n.style&&(s.style=s.style||"stroke: #333; stroke-width: 1.5px;fill:none"),s.labelStyle=s.labelStyle.replace("color:","fill:"))),e.setEdge(n.id1,n.id2,s,r)}))}(d,c),function(t,e,i,r){Tt.info(t),t.forEach((function(t,n){const s=t,a="",o="";let l=s.text,c="note";if(e.setNode(s.id,{labelStyle:a,shape:c,labelText:za(l),noteData:s,rx:0,ry:0,class:"",style:o,id:s.id,domId:s.id,tooltip:"",type:"note",padding:Zi().flowchart.padding}),Tt.info("setNode",{labelStyle:a,shape:c,labelText:l,rx:0,ry:0,style:o,id:s.id,type:"note",padding:Zi().flowchart.padding}),!s.class||!(s.class in r))return;const h=i+n,d={classes:"relation",pattern:"dotted"};d.id=`edgeNote${h}`,d.arrowhead="none",Tt.info(`Note edge: ${JSON.stringify(d)}, ${JSON.stringify(s)}`),d.startLabelRight="",d.endLabelLeft="",d.arrowTypeStart="none",d.arrowTypeEnd="none",d.style="fill:none",d.labelStyle="",d.curve=vi(ja.curve,v),e.setEdge(s.id,s.class,d,h)}))}(u,c,d.length+1,h),"sandbox"===s&&(p=f("#i"+e));const g=f("sandbox"===s?p.nodes()[0].contentDocument.body:"body"),y=g.select(`[id="${e}"]`),m=g.select("#"+e+" g");if(Pa(m,c,["aggregation","extension","composition","dependency","lollipop"],"classDiagram",e),Yi.insertTitle(y,"classTitleText",n.titleTopMargin,r.db.getDiagramTitle()),ar(c,y,n.diagramPadding,n.useMaxWidth),!n.htmlLabels){const t="sandbox"===s?p.nodes()[0].contentDocument:document,i=t.querySelectorAll('[id="'+e+'"] .edgeLabel .label');for(const e of i){const i=e.getBBox(),r=t.createElementNS("http://www.w3.org/2000/svg","rect");r.setAttribute("rx",0),r.setAttribute("ry",0),r.setAttribute("width",i.width),r.setAttribute("height",i.height),e.insertBefore(r,e.firstChild)}}}};var Ua=function(){var t=function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i},e=[1,2],i=[1,5],r=[6,9,11,23,25,27,29,30,31,51],n=[1,17],s=[1,18],a=[1,19],o=[1,20],l=[1,21],c=[1,22],h=[1,25],d=[1,30],u=[1,31],p=[1,32],g=[1,33],y=[6,9,11,15,20,23,25,27,29,30,31,44,45,46,47,51],f=[1,45],m=[30,31,48,49],b=[4,6,9,11,23,25,27,29,30,31,51],x=[44,45,46,47],k=[22,37],_=[1,65],C=[1,64],T=[22,37,39,41],E={trace:function(){},yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,directive:7,line:8,SPACE:9,statement:10,NEWLINE:11,openDirective:12,typeDirective:13,closeDirective:14,":":15,argDirective:16,entityName:17,relSpec:18,role:19,BLOCK_START:20,attributes:21,BLOCK_STOP:22,title:23,title_value:24,acc_title:25,acc_title_value:26,acc_descr:27,acc_descr_value:28,acc_descr_multiline_value:29,ALPHANUM:30,ENTITY_NAME:31,attribute:32,attributeType:33,attributeName:34,attributeKeyTypeList:35,attributeComment:36,ATTRIBUTE_WORD:37,attributeKeyType:38,COMMA:39,ATTRIBUTE_KEY:40,COMMENT:41,cardinality:42,relType:43,ZERO_OR_ONE:44,ZERO_OR_MORE:45,ONE_OR_MORE:46,ONLY_ONE:47,NON_IDENTIFYING:48,IDENTIFYING:49,WORD:50,open_directive:51,type_directive:52,arg_directive:53,close_directive:54,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"SPACE",11:"NEWLINE",15:":",20:"BLOCK_START",22:"BLOCK_STOP",23:"title",24:"title_value",25:"acc_title",26:"acc_title_value",27:"acc_descr",28:"acc_descr_value",29:"acc_descr_multiline_value",30:"ALPHANUM",31:"ENTITY_NAME",37:"ATTRIBUTE_WORD",39:"COMMA",40:"ATTRIBUTE_KEY",41:"COMMENT",44:"ZERO_OR_ONE",45:"ZERO_OR_MORE",46:"ONE_OR_MORE",47:"ONLY_ONE",48:"NON_IDENTIFYING",49:"IDENTIFYING",50:"WORD",51:"open_directive",52:"type_directive",53:"arg_directive",54:"close_directive"},productions_:[0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,5],[10,4],[10,3],[10,1],[10,2],[10,2],[10,2],[10,1],[17,1],[17,1],[21,1],[21,2],[32,2],[32,3],[32,3],[32,4],[33,1],[34,1],[35,1],[35,3],[38,1],[36,1],[18,3],[42,1],[42,1],[42,1],[42,1],[43,1],[43,1],[19,1],[19,1],[19,1],[12,1],[13,1],[16,1],[14,1]],performAction:function(t,e,i,r,n,s,a){var o=s.length-1;switch(n){case 1:break;case 3:case 7:case 8:this.$=[];break;case 4:s[o-1].push(s[o]),this.$=s[o-1];break;case 5:case 6:case 20:case 43:case 28:case 29:case 32:this.$=s[o];break;case 12:r.addEntity(s[o-4]),r.addEntity(s[o-2]),r.addRelationship(s[o-4],s[o],s[o-2],s[o-3]);break;case 13:r.addEntity(s[o-3]),r.addAttributes(s[o-3],s[o-1]);break;case 14:r.addEntity(s[o-2]);break;case 15:r.addEntity(s[o]);break;case 16:case 17:this.$=s[o].trim(),r.setAccTitle(this.$);break;case 18:case 19:this.$=s[o].trim(),r.setAccDescription(this.$);break;case 21:case 41:case 42:case 33:this.$=s[o].replace(/"/g,"");break;case 22:case 30:this.$=[s[o]];break;case 23:s[o].push(s[o-1]),this.$=s[o];break;case 24:this.$={attributeType:s[o-1],attributeName:s[o]};break;case 25:this.$={attributeType:s[o-2],attributeName:s[o-1],attributeKeyTypeList:s[o]};break;case 26:this.$={attributeType:s[o-2],attributeName:s[o-1],attributeComment:s[o]};break;case 27:this.$={attributeType:s[o-3],attributeName:s[o-2],attributeKeyTypeList:s[o-1],attributeComment:s[o]};break;case 31:s[o-2].push(s[o]),this.$=s[o-2];break;case 34:this.$={cardA:s[o],relType:s[o-1],cardB:s[o-2]};break;case 35:this.$=r.Cardinality.ZERO_OR_ONE;break;case 36:this.$=r.Cardinality.ZERO_OR_MORE;break;case 37:this.$=r.Cardinality.ONE_OR_MORE;break;case 38:this.$=r.Cardinality.ONLY_ONE;break;case 39:this.$=r.Identification.NON_IDENTIFYING;break;case 40:this.$=r.Identification.IDENTIFYING;break;case 44:r.parseDirective("%%{","open_directive");break;case 45:r.parseDirective(s[o],"type_directive");break;case 46:s[o]=s[o].trim().replace(/'/g,'"'),r.parseDirective(s[o],"arg_directive");break;case 47:r.parseDirective("}%%","close_directive","er")}},table:[{3:1,4:e,7:3,12:4,51:i},{1:[3]},t(r,[2,3],{5:6}),{3:7,4:e,7:3,12:4,51:i},{13:8,52:[1,9]},{52:[2,44]},{6:[1,10],7:15,8:11,9:[1,12],10:13,11:[1,14],12:4,17:16,23:n,25:s,27:a,29:o,30:l,31:c,51:i},{1:[2,2]},{14:23,15:[1,24],54:h},t([15,54],[2,45]),t(r,[2,8],{1:[2,1]}),t(r,[2,4]),{7:15,10:26,12:4,17:16,23:n,25:s,27:a,29:o,30:l,31:c,51:i},t(r,[2,6]),t(r,[2,7]),t(r,[2,11]),t(r,[2,15],{18:27,42:29,20:[1,28],44:d,45:u,46:p,47:g}),{24:[1,34]},{26:[1,35]},{28:[1,36]},t(r,[2,19]),t(y,[2,20]),t(y,[2,21]),{11:[1,37]},{16:38,53:[1,39]},{11:[2,47]},t(r,[2,5]),{17:40,30:l,31:c},{21:41,22:[1,42],32:43,33:44,37:f},{43:46,48:[1,47],49:[1,48]},t(m,[2,35]),t(m,[2,36]),t(m,[2,37]),t(m,[2,38]),t(r,[2,16]),t(r,[2,17]),t(r,[2,18]),t(b,[2,9]),{14:49,54:h},{54:[2,46]},{15:[1,50]},{22:[1,51]},t(r,[2,14]),{21:52,22:[2,22],32:43,33:44,37:f},{34:53,37:[1,54]},{37:[2,28]},{42:55,44:d,45:u,46:p,47:g},t(x,[2,39]),t(x,[2,40]),{11:[1,56]},{19:57,30:[1,60],31:[1,59],50:[1,58]},t(r,[2,13]),{22:[2,23]},t(k,[2,24],{35:61,36:62,38:63,40:_,41:C}),t([22,37,40,41],[2,29]),t([30,31],[2,34]),t(b,[2,10]),t(r,[2,12]),t(r,[2,41]),t(r,[2,42]),t(r,[2,43]),t(k,[2,25],{36:66,39:[1,67],41:C}),t(k,[2,26]),t(T,[2,30]),t(k,[2,33]),t(T,[2,32]),t(k,[2,27]),{38:68,40:_},t(T,[2,31])],defaultActions:{5:[2,44],7:[2,2],25:[2,47],39:[2,46],45:[2,28],52:[2,23]},parseError:function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},parse:function(t){var e=this,i=[0],r=[],n=[null],s=[],a=this.table,o="",l=0,c=0,h=s.slice.call(arguments,1),d=Object.create(this.lexer),u={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(u.yy[p]=this.yy[p]);d.setInput(t,u.yy),u.yy.lexer=d,u.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;s.push(g);var y=d.options&&d.options.ranges;"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var f,m,b,x,k,_,C,T,E,v={};;){if(m=i[i.length-1],this.defaultActions[m]?b=this.defaultActions[m]:(null==f&&(E=void 0,"number"!=typeof(E=r.pop()||d.lex()||1)&&(E instanceof Array&&(E=(r=E).pop()),E=e.symbols_[E]||E),f=E),b=a[m]&&a[m][f]),void 0===b||!b.length||!b[0]){var S="";for(k in T=[],a[m])this.terminals_[k]&&k>2&&T.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[f]||f,line:d.yylineno,loc:g,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+f);switch(b[0]){case 1:i.push(f),n.push(d.yytext),s.push(d.yylloc),i.push(b[1]),f=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(_=this.productions_[b[1]][1],v.$=n[n.length-_],v._$={first_line:s[s.length-(_||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(_||1)].first_column,last_column:s[s.length-1].last_column},y&&(v._$.range=[s[s.length-(_||1)].range[0],s[s.length-1].range[1]]),void 0!==(x=this.performAction.apply(v,[o,c,l,u.yy,b[1],n,s].concat(h))))return x;_&&(i=i.slice(0,-1*_*2),n=n.slice(0,-1*_),s=s.slice(0,-1*_)),i.push(this.productions_[b[1]][0]),n.push(v.$),s.push(v._$),C=a[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},v=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}, +// resets the lexer, sets new input +setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}, +// consumes and returns one char from the input +input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}, +// unshifts one char (or a string) into the input +unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===r.length?this.yylloc.first_column:0)+r[r.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}, +// When called from action, caches matched text and appends it on next action +more:function(){return this._more=!0,this}, +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// retain first n characters of the match +less:function(t){this.unput(this.match.slice(t))}, +// displays already matched input, i.e. for error messages +pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}, +// displays upcoming input, i.e. for error messages +upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}, +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}, +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(t,e){var i,r,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var s in n)this[s]=n[s];return!1}return!1}, +// return next match in input +next:function(){if(this.done)return this.EOF;var t,e,i,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),s=0;se[0].length)){if(e=i,r=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// return next match that has a token +lex:function(){var t=this.next();return t||this.lex()}, +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function(t){this.conditionStack.push(t)}, +// pop the previously active lexer condition state off the condition stack +popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}, +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}, +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}, +// alias for begin(condition) +pushState:function(t){this.begin(t)}, +// return the number of states currently on the stack +stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,i,r){switch(i){case 0:return this.begin("acc_title"),25;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),27;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.begin("open_directive"),51;case 8:return this.begin("type_directive"),52;case 9:return this.popState(),this.begin("arg_directive"),15;case 10:return this.popState(),this.popState(),54;case 11:return 53;case 12:case 13:case 15:case 22:case 27:break;case 14:return 11;case 16:return 9;case 17:return 31;case 18:return 50;case 19:return 4;case 20:return this.begin("block"),20;case 21:return 39;case 23:return 40;case 24:case 25:return 37;case 26:return 41;case 28:return this.popState(),22;case 29:case 58:return e.yytext[0];case 30:case 34:case 35:case 48:return 44;case 31:case 32:case 33:case 41:case 43:case 50:return 46;case 36:case 37:case 38:case 39:case 40:case 42:case 49:return 45;case 44:case 45:case 46:case 47:return 47;case 51:case 54:case 55:case 56:return 48;case 52:case 53:return 49;case 57:return 30;case 59:return 6}},rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:,)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:(.*?)[~](.*?)*[~])/i,/^(?:[A-Za-z_][A-Za-z0-9\-_\[\]\(\)]*)/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:1\b)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:[A-Za-z][A-Za-z0-9\-_]*)/i,/^(?:.)/i,/^(?:$)/i],conditions:{acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},open_directive:{rules:[8],inclusive:!1},type_directive:{rules:[9,10],inclusive:!1},arg_directive:{rules:[10,11],inclusive:!1},block:{rules:[21,22,23,24,25,26,27,28,29],inclusive:!1},INITIAL:{rules:[0,2,4,7,12,13,14,15,16,17,18,19,20,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59],inclusive:!0}}};return t}();function S(){this.yy={}}return E.lexer=v,S.prototype=E,E.Parser=S,new S}();Ua.parser=Ua;const qa=Ua,Va=t=>null!==t.match(/^\s*erDiagram/);let Ha={},Ga=[];const Xa=function(t){return void 0===Ha[t]&&(Ha[t]={attributes:[]},Tt.info("Added new entity :",t)),Ha[t]},Ka={Cardinality:{ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE"},Identification:{NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},parseDirective:function(t,e,i){np.parseDirective(this,t,e,i)},getConfig:()=>Zi().er,addEntity:Xa,addAttributes:function(t,e){let i,r=Xa(t);for(i=e.length-1;i>=0;i--)r.attributes.push(e[i]),Tt.debug("Added attribute ",e[i].attributeName)},getEntities:()=>Ha,addRelationship:function(t,e,i,r){let n={entityA:t,roleA:e,entityB:i,relSpec:r};Ga.push(n),Tt.debug("Added new relationship :",n)},getRelationships:()=>Ga,clear:function(){Ha={},Ga=[],vr()},setAccTitle:Sr,getAccTitle:wr,setAccDescription:Ar,getAccDescription:Br,setDiagramTitle:Lr,getDiagramTitle:Dr},Qa={ONLY_ONE_START:"ONLY_ONE_START",ONLY_ONE_END:"ONLY_ONE_END",ZERO_OR_ONE_START:"ZERO_OR_ONE_START",ZERO_OR_ONE_END:"ZERO_OR_ONE_END",ONE_OR_MORE_START:"ONE_OR_MORE_START",ONE_OR_MORE_END:"ONE_OR_MORE_END",ZERO_OR_MORE_START:"ZERO_OR_MORE_START",ZERO_OR_MORE_END:"ZERO_OR_MORE_END"},Za=Qa,Ja=function(t,e){let i;t.append("defs").append("marker").attr("id",Qa.ONLY_ONE_START).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",Qa.ONLY_ONE_END).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M3,0 L3,18 M9,0 L9,18"),i=t.append("defs").append("marker").attr("id",Qa.ZERO_OR_ONE_START).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto"),i.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M9,0 L9,18"),i=t.append("defs").append("marker").attr("id",Qa.ZERO_OR_ONE_END).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto"),i.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M21,0 L21,18"),t.append("defs").append("marker").attr("id",Qa.ONE_OR_MORE_START).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",Qa.ONE_OR_MORE_END).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18"),i=t.append("defs").append("marker").attr("id",Qa.ZERO_OR_MORE_START).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto"),i.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18"),i=t.append("defs").append("marker").attr("id",Qa.ZERO_OR_MORE_END).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto"),i.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},to=/[^\dA-Za-z](\W)*/g;let eo={},io=new Map;const ro=function(t,e,i){let r;return Object.keys(e).forEach((function(n){const s=function(t="",e=""){const i=t.replace(to,"");return`${oo(e)}${oo(i)}${_t(t,ao)}`}(n,"entity");io.set(n,s);const a=t.append("g").attr("id",s);r=void 0===r?s:r;const o="text-"+s,l=a.append("text").classed("er entityLabel",!0).attr("id",o).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","middle").style("font-family",Zi().fontFamily).style("font-size",eo.fontSize+"px").text(n),{width:c,height:h}=((t,e,i)=>{const r=eo.entityPadding/3,n=eo.entityPadding/3,s=.85*eo.fontSize,a=e.node().getBBox(),o=[];let l=!1,c=!1,h=0,d=0,u=0,p=0,g=a.height+2*r,y=1;i.forEach((t=>{void 0!==t.attributeKeyTypeList&&t.attributeKeyTypeList.length>0&&(l=!0),void 0!==t.attributeComment&&(c=!0)})),i.forEach((i=>{const n=`${e.node().id}-attr-${y}`;let a=0;const f=It(i.attributeType),m=t.append("text").classed("er entityLabel",!0).attr("id",`${n}-type`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",Zi().fontFamily).style("font-size",s+"px").text(f),b=t.append("text").classed("er entityLabel",!0).attr("id",`${n}-name`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",Zi().fontFamily).style("font-size",s+"px").text(i.attributeName),x={};x.tn=m,x.nn=b;const k=m.node().getBBox(),_=b.node().getBBox();if(h=Math.max(h,k.width),d=Math.max(d,_.width),a=Math.max(k.height,_.height),l){const e=void 0!==i.attributeKeyTypeList?i.attributeKeyTypeList.join(","):"",r=t.append("text").classed("er entityLabel",!0).attr("id",`${n}-key`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",Zi().fontFamily).style("font-size",s+"px").text(e);x.kn=r;const o=r.node().getBBox();u=Math.max(u,o.width),a=Math.max(a,o.height)}if(c){const e=t.append("text").classed("er entityLabel",!0).attr("id",`${n}-comment`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",Zi().fontFamily).style("font-size",s+"px").text(i.attributeComment||"");x.cn=e;const r=e.node().getBBox();p=Math.max(p,r.width),a=Math.max(a,r.height)}x.height=a,o.push(x),g+=a+2*r,y+=1}));let f=4;l&&(f+=2),c&&(f+=2);const m=h+d+u+p,b={width:Math.max(eo.minEntityWidth,Math.max(a.width+2*eo.entityPadding,m+n*f)),height:i.length>0?g:Math.max(eo.minEntityHeight,a.height+2*eo.entityPadding)};if(i.length>0){const i=Math.max(0,(b.width-m-n*f)/(f/2));e.attr("transform","translate("+b.width/2+","+(r+a.height/2)+")");let s=a.height+2*r,g="attributeBoxOdd";o.forEach((e=>{const a=s+r+e.height/2;e.tn.attr("transform","translate("+n+","+a+")");const o=t.insert("rect","#"+e.tn.node().id).classed(`er ${g}`,!0).attr("x",0).attr("y",s).attr("width",h+2*n+i).attr("height",e.height+2*r),y=parseFloat(o.attr("x"))+parseFloat(o.attr("width"));e.nn.attr("transform","translate("+(y+n)+","+a+")");const f=t.insert("rect","#"+e.nn.node().id).classed(`er ${g}`,!0).attr("x",y).attr("y",s).attr("width",d+2*n+i).attr("height",e.height+2*r);let m=parseFloat(f.attr("x"))+parseFloat(f.attr("width"));if(l){e.kn.attr("transform","translate("+(m+n)+","+a+")");const o=t.insert("rect","#"+e.kn.node().id).classed(`er ${g}`,!0).attr("x",m).attr("y",s).attr("width",u+2*n+i).attr("height",e.height+2*r);m=parseFloat(o.attr("x"))+parseFloat(o.attr("width"))}c&&(e.cn.attr("transform","translate("+(m+n)+","+a+")"),t.insert("rect","#"+e.cn.node().id).classed(`er ${g}`,"true").attr("x",m).attr("y",s).attr("width",p+2*n+i).attr("height",e.height+2*r)),s+=e.height+2*r,g="attributeBoxOdd"===g?"attributeBoxEven":"attributeBoxOdd"}))}else b.height=Math.max(eo.minEntityHeight,g),e.attr("transform","translate("+b.width/2+","+b.height/2+")");return b})(a,l,e[n].attributes),d=a.insert("rect","#"+o).classed("er entityBox",!0).attr("x",0).attr("y",0).attr("width",c).attr("height",h).node().getBBox();i.setNode(s,{width:d.width,height:d.height,shape:"rect",id:s})})),r},no=function(t){return(t.entityA+t.roleA+t.entityB).replace(/\s/g,"")};let so=0;const ao="28e9f9db-3c8d-5aa5-9faf-44286ae5937c";function oo(t=""){return t.length>0?`${t}-`:""}const lo={setConf:function(t){const e=Object.keys(t);for(const i of e)eo[i]=t[i]},draw:function(t,e,i,r){eo=Zi().er,Tt.info("Drawing ER diagram");const n=Zi().securityLevel;let s;"sandbox"===n&&(s=f("#i"+e));const l=f("sandbox"===n?s.nodes()[0].contentDocument.body:"body").select(`[id='${e}']`);let c;Ja(l,eo),c=new a({multigraph:!0,directed:!0,compound:!1}).setGraph({rankdir:eo.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel((function(){return{}}));const h=ro(l,r.db.getEntities(),c),d=function(t,e){return t.forEach((function(t){e.setEdge(io.get(t.entityA),io.get(t.entityB),{relationship:t},no(t))})),t}(r.db.getRelationships(),c);var u,p;o(c),u=l,(p=c).nodes().forEach((function(t){void 0!==t&&void 0!==p.node(t)&&u.select("#"+t).attr("transform","translate("+(p.node(t).x-p.node(t).width/2)+","+(p.node(t).y-p.node(t).height/2)+" )")})),d.forEach((function(t){!function(t,e,i,r,n){so++;const s=i.edge(io.get(e.entityA),io.get(e.entityB),no(e)),a=z().x((function(t){return t.x})).y((function(t){return t.y})).curve(R),o=t.insert("path","#"+r).classed("er relationshipLine",!0).attr("d",a(s.points)).style("stroke",eo.stroke).style("fill","none");e.relSpec.relType===n.db.Identification.NON_IDENTIFYING&&o.attr("stroke-dasharray","8,8");let l="";switch(eo.arrowMarkerAbsolute&&(l=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,l=l.replace(/\(/g,"\\("),l=l.replace(/\)/g,"\\)")),e.relSpec.cardA){case n.db.Cardinality.ZERO_OR_ONE:o.attr("marker-end","url("+l+"#"+Za.ZERO_OR_ONE_END+")");break;case n.db.Cardinality.ZERO_OR_MORE:o.attr("marker-end","url("+l+"#"+Za.ZERO_OR_MORE_END+")");break;case n.db.Cardinality.ONE_OR_MORE:o.attr("marker-end","url("+l+"#"+Za.ONE_OR_MORE_END+")");break;case n.db.Cardinality.ONLY_ONE:o.attr("marker-end","url("+l+"#"+Za.ONLY_ONE_END+")")}switch(e.relSpec.cardB){case n.db.Cardinality.ZERO_OR_ONE:o.attr("marker-start","url("+l+"#"+Za.ZERO_OR_ONE_START+")");break;case n.db.Cardinality.ZERO_OR_MORE:o.attr("marker-start","url("+l+"#"+Za.ZERO_OR_MORE_START+")");break;case n.db.Cardinality.ONE_OR_MORE:o.attr("marker-start","url("+l+"#"+Za.ONE_OR_MORE_START+")");break;case n.db.Cardinality.ONLY_ONE:o.attr("marker-start","url("+l+"#"+Za.ONLY_ONE_START+")")}const c=o.node().getTotalLength(),h=o.node().getPointAtLength(.5*c),d="rel"+so,u=t.append("text").classed("er relationshipLabel",!0).attr("id",d).attr("x",h.x).attr("y",h.y).style("text-anchor","middle").style("dominant-baseline","middle").style("font-family",Zi().fontFamily).style("font-size",eo.fontSize+"px").text(e.roleA).node().getBBox();t.insert("rect","#"+d).classed("er relationshipLabelBox",!0).attr("x",h.x-u.width/2).attr("y",h.y-u.height/2).attr("width",u.width).attr("height",u.height)}(l,t,c,h,r)}));const g=eo.diagramPadding;Yi.insertTitle(l,"entityTitleText",eo.titleTopMargin,r.db.getDiagramTitle());const y=l.node().getBBox(),m=y.width+2*g,b=y.height+2*g;sr(l,b,m,eo.useMaxWidth),l.attr("viewBox",`${y.x-g} ${y.y-g} ${m} ${b}`)}};var co=function(){var t=function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i},e=[1,9],i=[1,7],r=[1,6],n=[1,8],s=[1,20,21,22,23,38,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],a=[2,10],o=[1,20],l=[1,21],c=[1,22],h=[1,23],d=[1,30],u=[1,32],p=[1,33],g=[1,34],y=[1,62],f=[1,48],m=[1,52],b=[1,36],x=[1,37],k=[1,38],_=[1,39],C=[1,40],T=[1,56],E=[1,63],v=[1,51],S=[1,53],w=[1,55],A=[1,59],B=[1,60],L=[1,41],D=[1,42],I=[1,43],O=[1,44],$=[1,61],N=[1,50],F=[1,54],R=[1,57],M=[1,58],P=[1,49],z=[1,66],j=[1,71],Y=[1,20,21,22,23,38,42,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],W=[1,75],U=[1,74],q=[1,76],V=[20,21,23,81,82],H=[1,99],G=[1,104],X=[1,107],K=[1,108],Q=[1,101],Z=[1,106],J=[1,109],tt=[1,102],et=[1,114],it=[1,113],rt=[1,103],nt=[1,105],st=[1,110],at=[1,111],ot=[1,112],lt=[1,115],ct=[20,21,22,23,81,82],ht=[20,21,22,23,53,81,82],dt=[20,21,22,23,40,52,53,55,57,59,61,63,65,66,67,69,71,73,74,76,81,82,91,95,105,106,109,111,112,122,123,124,125,126,127],ut=[20,21,23],pt=[20,21,23,52,66,67,81,82,91,95,105,106,109,111,112,122,123,124,125,126,127],gt=[1,12,20,21,22,23,24,38,42,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],yt=[52,66,67,91,95,105,106,109,111,112,122,123,124,125,126,127],ft=[1,149],mt=[1,157],bt=[1,158],xt=[1,159],kt=[1,160],_t=[1,144],Ct=[1,145],Tt=[1,141],Et=[1,152],vt=[1,153],St=[1,154],wt=[1,155],At=[1,156],Bt=[1,161],Lt=[1,162],Dt=[1,147],It=[1,150],Ot=[1,146],$t=[1,143],Nt=[20,21,22,23,38,42,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],Ft=[1,165],Rt=[20,21,22,23,26,52,66,67,91,105,106,109,111,112,122,123,124,125,126,127],Mt=[20,21,22,23,24,26,38,40,41,42,52,56,58,60,62,64,66,67,68,70,72,73,75,77,81,82,86,87,88,89,90,91,92,95,105,106,109,111,112,113,114,122,123,124,125,126,127],Pt=[12,21,22,24],zt=[22,106],jt=[1,250],Yt=[1,245],Wt=[1,246],Ut=[1,254],qt=[1,251],Vt=[1,248],Ht=[1,247],Gt=[1,249],Xt=[1,252],Kt=[1,253],Qt=[1,255],Zt=[1,273],Jt=[20,21,23,106],te=[20,21,22,23,66,67,86,102,105,106,109,110,111,112,113],ee={trace:function(){},yy:{},symbols_:{error:2,start:3,mermaidDoc:4,directive:5,openDirective:6,typeDirective:7,closeDirective:8,separator:9,":":10,argDirective:11,open_directive:12,type_directive:13,arg_directive:14,close_directive:15,graphConfig:16,document:17,line:18,statement:19,SEMI:20,NEWLINE:21,SPACE:22,EOF:23,GRAPH:24,NODIR:25,DIR:26,FirstStmtSeperator:27,ending:28,endToken:29,spaceList:30,spaceListNewline:31,verticeStatement:32,styleStatement:33,linkStyleStatement:34,classDefStatement:35,classStatement:36,clickStatement:37,subgraph:38,text:39,SQS:40,SQE:41,end:42,direction:43,acc_title:44,acc_title_value:45,acc_descr:46,acc_descr_value:47,acc_descr_multiline_value:48,link:49,node:50,vertex:51,AMP:52,STYLE_SEPARATOR:53,idString:54,DOUBLECIRCLESTART:55,DOUBLECIRCLEEND:56,PS:57,PE:58,"(-":59,"-)":60,STADIUMSTART:61,STADIUMEND:62,SUBROUTINESTART:63,SUBROUTINEEND:64,VERTEX_WITH_PROPS_START:65,ALPHA:66,COLON:67,PIPE:68,CYLINDERSTART:69,CYLINDEREND:70,DIAMOND_START:71,DIAMOND_STOP:72,TAGEND:73,TRAPSTART:74,TRAPEND:75,INVTRAPSTART:76,INVTRAPEND:77,linkStatement:78,arrowText:79,TESTSTR:80,START_LINK:81,LINK:82,textToken:83,STR:84,keywords:85,STYLE:86,LINKSTYLE:87,CLASSDEF:88,CLASS:89,CLICK:90,DOWN:91,UP:92,textNoTags:93,textNoTagsToken:94,DEFAULT:95,stylesOpt:96,alphaNum:97,CALLBACKNAME:98,CALLBACKARGS:99,HREF:100,LINK_TARGET:101,HEX:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,MINUS:109,UNIT:110,BRKT:111,DOT:112,PCT:113,TAGSTART:114,alphaNumToken:115,idStringToken:116,alphaNumStatement:117,direction_tb:118,direction_bt:119,direction_rl:120,direction_lr:121,PUNCTUATION:122,UNICODE_TEXT:123,PLUS:124,EQUALS:125,MULT:126,UNDERSCORE:127,graphCodeTokens:128,ARROW_CROSS:129,ARROW_POINT:130,ARROW_CIRCLE:131,ARROW_OPEN:132,QUOTE:133,$accept:0,$end:1},terminals_:{2:"error",10:":",12:"open_directive",13:"type_directive",14:"arg_directive",15:"close_directive",20:"SEMI",21:"NEWLINE",22:"SPACE",23:"EOF",24:"GRAPH",25:"NODIR",26:"DIR",38:"subgraph",40:"SQS",41:"SQE",42:"end",44:"acc_title",45:"acc_title_value",46:"acc_descr",47:"acc_descr_value",48:"acc_descr_multiline_value",52:"AMP",53:"STYLE_SEPARATOR",55:"DOUBLECIRCLESTART",56:"DOUBLECIRCLEEND",57:"PS",58:"PE",59:"(-",60:"-)",61:"STADIUMSTART",62:"STADIUMEND",63:"SUBROUTINESTART",64:"SUBROUTINEEND",65:"VERTEX_WITH_PROPS_START",66:"ALPHA",67:"COLON",68:"PIPE",69:"CYLINDERSTART",70:"CYLINDEREND",71:"DIAMOND_START",72:"DIAMOND_STOP",73:"TAGEND",74:"TRAPSTART",75:"TRAPEND",76:"INVTRAPSTART",77:"INVTRAPEND",80:"TESTSTR",81:"START_LINK",82:"LINK",84:"STR",86:"STYLE",87:"LINKSTYLE",88:"CLASSDEF",89:"CLASS",90:"CLICK",91:"DOWN",92:"UP",95:"DEFAULT",98:"CALLBACKNAME",99:"CALLBACKARGS",100:"HREF",101:"LINK_TARGET",102:"HEX",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"MINUS",110:"UNIT",111:"BRKT",112:"DOT",113:"PCT",114:"TAGSTART",118:"direction_tb",119:"direction_bt",120:"direction_rl",121:"direction_lr",122:"PUNCTUATION",123:"UNICODE_TEXT",124:"PLUS",125:"EQUALS",126:"MULT",127:"UNDERSCORE",129:"ARROW_CROSS",130:"ARROW_POINT",131:"ARROW_CIRCLE",132:"ARROW_OPEN",133:"QUOTE"},productions_:[0,[3,1],[3,2],[5,4],[5,6],[6,1],[7,1],[11,1],[8,1],[4,2],[17,0],[17,2],[18,1],[18,1],[18,1],[18,1],[18,1],[16,2],[16,2],[16,2],[16,3],[28,2],[28,1],[29,1],[29,1],[29,1],[27,1],[27,1],[27,2],[31,2],[31,2],[31,1],[31,1],[30,2],[30,1],[19,2],[19,2],[19,2],[19,2],[19,2],[19,2],[19,9],[19,6],[19,4],[19,1],[19,2],[19,2],[19,1],[9,1],[9,1],[9,1],[32,3],[32,4],[32,2],[32,1],[50,1],[50,5],[50,3],[51,4],[51,4],[51,6],[51,4],[51,4],[51,4],[51,8],[51,4],[51,4],[51,4],[51,6],[51,4],[51,4],[51,4],[51,4],[51,4],[51,1],[49,2],[49,3],[49,3],[49,1],[49,3],[78,1],[79,3],[39,1],[39,2],[39,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[93,1],[93,2],[35,5],[35,5],[36,5],[37,2],[37,4],[37,3],[37,5],[37,2],[37,4],[37,4],[37,6],[37,2],[37,4],[37,2],[37,4],[37,4],[37,6],[33,5],[33,5],[34,5],[34,5],[34,9],[34,9],[34,7],[34,7],[103,1],[103,3],[96,1],[96,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[94,1],[94,1],[94,1],[94,1],[54,1],[54,2],[97,1],[97,2],[117,1],[117,1],[117,1],[117,1],[43,1],[43,1],[43,1],[43,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1]],performAction:function(t,e,i,r,n,s,a){var o=s.length-1;switch(n){case 5:r.parseDirective("%%{","open_directive");break;case 6:r.parseDirective(s[o],"type_directive");break;case 7:s[o]=s[o].trim().replace(/'/g,'"'),r.parseDirective(s[o],"arg_directive");break;case 8:r.parseDirective("}%%","close_directive","flowchart");break;case 10:case 36:case 37:case 38:case 39:case 40:this.$=[];break;case 11:(!Array.isArray(s[o])||s[o].length>0)&&s[o-1].push(s[o]),this.$=s[o-1];break;case 12:case 82:case 84:case 96:case 152:case 154:case 155:case 78:case 150:this.$=s[o];break;case 19:r.setDirection("TB"),this.$="TB";break;case 20:r.setDirection(s[o-1]),this.$=s[o-1];break;case 35:this.$=s[o-1].nodes;break;case 41:this.$=r.addSubGraph(s[o-6],s[o-1],s[o-4]);break;case 42:this.$=r.addSubGraph(s[o-3],s[o-1],s[o-3]);break;case 43:this.$=r.addSubGraph(void 0,s[o-1],void 0);break;case 45:this.$=s[o].trim(),r.setAccTitle(this.$);break;case 46:case 47:this.$=s[o].trim(),r.setAccDescription(this.$);break;case 51:r.addLink(s[o-2].stmt,s[o],s[o-1]),this.$={stmt:s[o],nodes:s[o].concat(s[o-2].nodes)};break;case 52:r.addLink(s[o-3].stmt,s[o-1],s[o-2]),this.$={stmt:s[o-1],nodes:s[o-1].concat(s[o-3].nodes)};break;case 53:this.$={stmt:s[o-1],nodes:s[o-1]};break;case 54:this.$={stmt:s[o],nodes:s[o]};break;case 55:case 123:case 125:this.$=[s[o]];break;case 56:this.$=s[o-4].concat(s[o]);break;case 57:this.$=[s[o-2]],r.setClass(s[o-2],s[o]);break;case 58:this.$=s[o-3],r.addVertex(s[o-3],s[o-1],"square");break;case 59:this.$=s[o-3],r.addVertex(s[o-3],s[o-1],"doublecircle");break;case 60:this.$=s[o-5],r.addVertex(s[o-5],s[o-2],"circle");break;case 61:this.$=s[o-3],r.addVertex(s[o-3],s[o-1],"ellipse");break;case 62:this.$=s[o-3],r.addVertex(s[o-3],s[o-1],"stadium");break;case 63:this.$=s[o-3],r.addVertex(s[o-3],s[o-1],"subroutine");break;case 64:this.$=s[o-7],r.addVertex(s[o-7],s[o-1],"rect",void 0,void 0,void 0,Object.fromEntries([[s[o-5],s[o-3]]]));break;case 65:this.$=s[o-3],r.addVertex(s[o-3],s[o-1],"cylinder");break;case 66:this.$=s[o-3],r.addVertex(s[o-3],s[o-1],"round");break;case 67:this.$=s[o-3],r.addVertex(s[o-3],s[o-1],"diamond");break;case 68:this.$=s[o-5],r.addVertex(s[o-5],s[o-2],"hexagon");break;case 69:this.$=s[o-3],r.addVertex(s[o-3],s[o-1],"odd");break;case 70:this.$=s[o-3],r.addVertex(s[o-3],s[o-1],"trapezoid");break;case 71:this.$=s[o-3],r.addVertex(s[o-3],s[o-1],"inv_trapezoid");break;case 72:this.$=s[o-3],r.addVertex(s[o-3],s[o-1],"lean_right");break;case 73:this.$=s[o-3],r.addVertex(s[o-3],s[o-1],"lean_left");break;case 74:this.$=s[o],r.addVertex(s[o]);break;case 75:s[o-1].text=s[o],this.$=s[o-1];break;case 76:case 77:s[o-2].text=s[o-1],this.$=s[o-2];break;case 79:var l=r.destructLink(s[o],s[o-2]);this.$={type:l.type,stroke:l.stroke,length:l.length,text:s[o-1]};break;case 80:l=r.destructLink(s[o]);this.$={type:l.type,stroke:l.stroke,length:l.length};break;case 81:this.$=s[o-1];break;case 83:case 97:case 153:case 151:this.$=s[o-1]+""+s[o];break;case 98:case 99:this.$=s[o-4],r.addClass(s[o-2],s[o]);break;case 100:this.$=s[o-4],r.setClass(s[o-2],s[o]);break;case 101:case 109:this.$=s[o-1],r.setClickEvent(s[o-1],s[o]);break;case 102:case 110:this.$=s[o-3],r.setClickEvent(s[o-3],s[o-2]),r.setTooltip(s[o-3],s[o]);break;case 103:this.$=s[o-2],r.setClickEvent(s[o-2],s[o-1],s[o]);break;case 104:this.$=s[o-4],r.setClickEvent(s[o-4],s[o-3],s[o-2]),r.setTooltip(s[o-4],s[o]);break;case 105:case 111:this.$=s[o-1],r.setLink(s[o-1],s[o]);break;case 106:case 112:this.$=s[o-3],r.setLink(s[o-3],s[o-2]),r.setTooltip(s[o-3],s[o]);break;case 107:case 113:this.$=s[o-3],r.setLink(s[o-3],s[o-2],s[o]);break;case 108:case 114:this.$=s[o-5],r.setLink(s[o-5],s[o-4],s[o]),r.setTooltip(s[o-5],s[o-2]);break;case 115:this.$=s[o-4],r.addVertex(s[o-2],void 0,void 0,s[o]);break;case 116:case 118:this.$=s[o-4],r.updateLink(s[o-2],s[o]);break;case 117:this.$=s[o-4],r.updateLink([s[o-2]],s[o]);break;case 119:this.$=s[o-8],r.updateLinkInterpolate([s[o-6]],s[o-2]),r.updateLink([s[o-6]],s[o]);break;case 120:this.$=s[o-8],r.updateLinkInterpolate(s[o-6],s[o-2]),r.updateLink(s[o-6],s[o]);break;case 121:this.$=s[o-6],r.updateLinkInterpolate([s[o-4]],s[o]);break;case 122:this.$=s[o-6],r.updateLinkInterpolate(s[o-4],s[o]);break;case 124:case 126:s[o-2].push(s[o]),this.$=s[o-2];break;case 128:this.$=s[o-1]+s[o];break;case 156:this.$="v";break;case 157:this.$="-";break;case 158:this.$={stmt:"dir",value:"TB"};break;case 159:this.$={stmt:"dir",value:"BT"};break;case 160:this.$={stmt:"dir",value:"RL"};break;case 161:this.$={stmt:"dir",value:"LR"}}},table:[{3:1,4:2,5:3,6:5,12:e,16:4,21:i,22:r,24:n},{1:[3]},{1:[2,1]},{3:10,4:2,5:3,6:5,12:e,16:4,21:i,22:r,24:n},t(s,a,{17:11}),{7:12,13:[1,13]},{16:14,21:i,22:r,24:n},{16:15,21:i,22:r,24:n},{25:[1,16],26:[1,17]},{13:[2,5]},{1:[2,2]},{1:[2,9],18:18,19:19,20:o,21:l,22:c,23:h,32:24,33:25,34:26,35:27,36:28,37:29,38:d,43:31,44:u,46:p,48:g,50:35,51:45,52:y,54:46,66:f,67:m,86:b,87:x,88:k,89:_,90:C,91:T,95:E,105:v,106:S,109:w,111:A,112:B,116:47,118:L,119:D,120:I,121:O,122:$,123:N,124:F,125:R,126:M,127:P},{8:64,10:[1,65],15:z},t([10,15],[2,6]),t(s,[2,17]),t(s,[2,18]),t(s,[2,19]),{20:[1,68],21:[1,69],22:j,27:67,30:70},t(Y,[2,11]),t(Y,[2,12]),t(Y,[2,13]),t(Y,[2,14]),t(Y,[2,15]),t(Y,[2,16]),{9:72,20:W,21:U,23:q,49:73,78:77,81:[1,78],82:[1,79]},{9:80,20:W,21:U,23:q},{9:81,20:W,21:U,23:q},{9:82,20:W,21:U,23:q},{9:83,20:W,21:U,23:q},{9:84,20:W,21:U,23:q},{9:86,20:W,21:U,22:[1,85],23:q},t(Y,[2,44]),{45:[1,87]},{47:[1,88]},t(Y,[2,47]),t(V,[2,54],{30:89,22:j}),{22:[1,90]},{22:[1,91]},{22:[1,92]},{22:[1,93]},{26:H,52:G,66:X,67:K,84:[1,97],91:Q,97:96,98:[1,94],100:[1,95],105:Z,106:J,109:tt,111:et,112:it,115:100,117:98,122:rt,123:nt,124:st,125:at,126:ot,127:lt},t(Y,[2,158]),t(Y,[2,159]),t(Y,[2,160]),t(Y,[2,161]),t(ct,[2,55],{53:[1,116]}),t(ht,[2,74],{116:129,40:[1,117],52:y,55:[1,118],57:[1,119],59:[1,120],61:[1,121],63:[1,122],65:[1,123],66:f,67:m,69:[1,124],71:[1,125],73:[1,126],74:[1,127],76:[1,128],91:T,95:E,105:v,106:S,109:w,111:A,112:B,122:$,123:N,124:F,125:R,126:M,127:P}),t(dt,[2,150]),t(dt,[2,175]),t(dt,[2,176]),t(dt,[2,177]),t(dt,[2,178]),t(dt,[2,179]),t(dt,[2,180]),t(dt,[2,181]),t(dt,[2,182]),t(dt,[2,183]),t(dt,[2,184]),t(dt,[2,185]),t(dt,[2,186]),t(dt,[2,187]),t(dt,[2,188]),t(dt,[2,189]),t(dt,[2,190]),{9:130,20:W,21:U,23:q},{11:131,14:[1,132]},t(ut,[2,8]),t(s,[2,20]),t(s,[2,26]),t(s,[2,27]),{21:[1,133]},t(pt,[2,34],{30:134,22:j}),t(Y,[2,35]),{50:135,51:45,52:y,54:46,66:f,67:m,91:T,95:E,105:v,106:S,109:w,111:A,112:B,116:47,122:$,123:N,124:F,125:R,126:M,127:P},t(gt,[2,48]),t(gt,[2,49]),t(gt,[2,50]),t(yt,[2,78],{79:136,68:[1,138],80:[1,137]}),{22:ft,24:mt,26:bt,38:xt,39:139,42:kt,52:G,66:X,67:K,73:_t,81:Ct,83:140,84:Tt,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},t([52,66,67,68,80,91,95,105,106,109,111,112,122,123,124,125,126,127],[2,80]),t(Y,[2,36]),t(Y,[2,37]),t(Y,[2,38]),t(Y,[2,39]),t(Y,[2,40]),{22:ft,24:mt,26:bt,38:xt,39:163,42:kt,52:G,66:X,67:K,73:_t,81:Ct,83:140,84:Tt,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},t(Nt,a,{17:164}),t(Y,[2,45]),t(Y,[2,46]),t(V,[2,53],{52:Ft}),{26:H,52:G,66:X,67:K,91:Q,97:166,102:[1,167],105:Z,106:J,109:tt,111:et,112:it,115:100,117:98,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{95:[1,168],103:169,105:[1,170]},{26:H,52:G,66:X,67:K,91:Q,95:[1,171],97:172,105:Z,106:J,109:tt,111:et,112:it,115:100,117:98,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{26:H,52:G,66:X,67:K,91:Q,97:173,105:Z,106:J,109:tt,111:et,112:it,115:100,117:98,122:rt,123:nt,124:st,125:at,126:ot,127:lt},t(ut,[2,101],{22:[1,174],99:[1,175]}),t(ut,[2,105],{22:[1,176]}),t(ut,[2,109],{115:100,117:178,22:[1,177],26:H,52:G,66:X,67:K,91:Q,105:Z,106:J,109:tt,111:et,112:it,122:rt,123:nt,124:st,125:at,126:ot,127:lt}),t(ut,[2,111],{22:[1,179]}),t(Rt,[2,152]),t(Rt,[2,154]),t(Rt,[2,155]),t(Rt,[2,156]),t(Rt,[2,157]),t(Mt,[2,162]),t(Mt,[2,163]),t(Mt,[2,164]),t(Mt,[2,165]),t(Mt,[2,166]),t(Mt,[2,167]),t(Mt,[2,168]),t(Mt,[2,169]),t(Mt,[2,170]),t(Mt,[2,171]),t(Mt,[2,172]),t(Mt,[2,173]),t(Mt,[2,174]),{52:y,54:180,66:f,67:m,91:T,95:E,105:v,106:S,109:w,111:A,112:B,116:47,122:$,123:N,124:F,125:R,126:M,127:P},{22:ft,24:mt,26:bt,38:xt,39:181,42:kt,52:G,66:X,67:K,73:_t,81:Ct,83:140,84:Tt,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{22:ft,24:mt,26:bt,38:xt,39:182,42:kt,52:G,66:X,67:K,73:_t,81:Ct,83:140,84:Tt,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{22:ft,24:mt,26:bt,38:xt,39:184,42:kt,52:G,57:[1,183],66:X,67:K,73:_t,81:Ct,83:140,84:Tt,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{22:ft,24:mt,26:bt,38:xt,39:185,42:kt,52:G,66:X,67:K,73:_t,81:Ct,83:140,84:Tt,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{22:ft,24:mt,26:bt,38:xt,39:186,42:kt,52:G,66:X,67:K,73:_t,81:Ct,83:140,84:Tt,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{22:ft,24:mt,26:bt,38:xt,39:187,42:kt,52:G,66:X,67:K,73:_t,81:Ct,83:140,84:Tt,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{66:[1,188]},{22:ft,24:mt,26:bt,38:xt,39:189,42:kt,52:G,66:X,67:K,73:_t,81:Ct,83:140,84:Tt,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{22:ft,24:mt,26:bt,38:xt,39:190,42:kt,52:G,66:X,67:K,71:[1,191],73:_t,81:Ct,83:140,84:Tt,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{22:ft,24:mt,26:bt,38:xt,39:192,42:kt,52:G,66:X,67:K,73:_t,81:Ct,83:140,84:Tt,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{22:ft,24:mt,26:bt,38:xt,39:193,42:kt,52:G,66:X,67:K,73:_t,81:Ct,83:140,84:Tt,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{22:ft,24:mt,26:bt,38:xt,39:194,42:kt,52:G,66:X,67:K,73:_t,81:Ct,83:140,84:Tt,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},t(dt,[2,151]),t(Pt,[2,3]),{8:195,15:z},{15:[2,7]},t(s,[2,28]),t(pt,[2,33]),t(V,[2,51],{30:196,22:j}),t(yt,[2,75],{22:[1,197]}),{22:[1,198]},{22:ft,24:mt,26:bt,38:xt,39:199,42:kt,52:G,66:X,67:K,73:_t,81:Ct,83:140,84:Tt,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{22:ft,24:mt,26:bt,38:xt,42:kt,52:G,66:X,67:K,73:_t,81:Ct,82:[1,200],83:201,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},t(Mt,[2,82]),t(Mt,[2,84]),t(Mt,[2,140]),t(Mt,[2,141]),t(Mt,[2,142]),t(Mt,[2,143]),t(Mt,[2,144]),t(Mt,[2,145]),t(Mt,[2,146]),t(Mt,[2,147]),t(Mt,[2,148]),t(Mt,[2,149]),t(Mt,[2,85]),t(Mt,[2,86]),t(Mt,[2,87]),t(Mt,[2,88]),t(Mt,[2,89]),t(Mt,[2,90]),t(Mt,[2,91]),t(Mt,[2,92]),t(Mt,[2,93]),t(Mt,[2,94]),t(Mt,[2,95]),{9:203,20:W,21:U,22:ft,23:q,24:mt,26:bt,38:xt,40:[1,202],42:kt,52:G,66:X,67:K,73:_t,81:Ct,83:201,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{18:18,19:19,20:o,21:l,22:c,23:h,32:24,33:25,34:26,35:27,36:28,37:29,38:d,42:[1,204],43:31,44:u,46:p,48:g,50:35,51:45,52:y,54:46,66:f,67:m,86:b,87:x,88:k,89:_,90:C,91:T,95:E,105:v,106:S,109:w,111:A,112:B,116:47,118:L,119:D,120:I,121:O,122:$,123:N,124:F,125:R,126:M,127:P},{22:j,30:205},{22:[1,206],26:H,52:G,66:X,67:K,91:Q,105:Z,106:J,109:tt,111:et,112:it,115:100,117:178,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{22:[1,207]},{22:[1,208]},{22:[1,209],106:[1,210]},t(zt,[2,123]),{22:[1,211]},{22:[1,212],26:H,52:G,66:X,67:K,91:Q,105:Z,106:J,109:tt,111:et,112:it,115:100,117:178,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{22:[1,213],26:H,52:G,66:X,67:K,91:Q,105:Z,106:J,109:tt,111:et,112:it,115:100,117:178,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{84:[1,214]},t(ut,[2,103],{22:[1,215]}),{84:[1,216],101:[1,217]},{84:[1,218]},t(Rt,[2,153]),{84:[1,219],101:[1,220]},t(ct,[2,57],{116:129,52:y,66:f,67:m,91:T,95:E,105:v,106:S,109:w,111:A,112:B,122:$,123:N,124:F,125:R,126:M,127:P}),{22:ft,24:mt,26:bt,38:xt,41:[1,221],42:kt,52:G,66:X,67:K,73:_t,81:Ct,83:201,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{22:ft,24:mt,26:bt,38:xt,42:kt,52:G,56:[1,222],66:X,67:K,73:_t,81:Ct,83:201,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{22:ft,24:mt,26:bt,38:xt,39:223,42:kt,52:G,66:X,67:K,73:_t,81:Ct,83:140,84:Tt,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{22:ft,24:mt,26:bt,38:xt,42:kt,52:G,58:[1,224],66:X,67:K,73:_t,81:Ct,83:201,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{22:ft,24:mt,26:bt,38:xt,42:kt,52:G,60:[1,225],66:X,67:K,73:_t,81:Ct,83:201,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{22:ft,24:mt,26:bt,38:xt,42:kt,52:G,62:[1,226],66:X,67:K,73:_t,81:Ct,83:201,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{22:ft,24:mt,26:bt,38:xt,42:kt,52:G,64:[1,227],66:X,67:K,73:_t,81:Ct,83:201,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{67:[1,228]},{22:ft,24:mt,26:bt,38:xt,42:kt,52:G,66:X,67:K,70:[1,229],73:_t,81:Ct,83:201,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{22:ft,24:mt,26:bt,38:xt,42:kt,52:G,66:X,67:K,72:[1,230],73:_t,81:Ct,83:201,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{22:ft,24:mt,26:bt,38:xt,39:231,42:kt,52:G,66:X,67:K,73:_t,81:Ct,83:140,84:Tt,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{22:ft,24:mt,26:bt,38:xt,41:[1,232],42:kt,52:G,66:X,67:K,73:_t,81:Ct,83:201,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{22:ft,24:mt,26:bt,38:xt,42:kt,52:G,66:X,67:K,73:_t,75:[1,233],77:[1,234],81:Ct,83:201,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{22:ft,24:mt,26:bt,38:xt,42:kt,52:G,66:X,67:K,73:_t,75:[1,236],77:[1,235],81:Ct,83:201,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{9:237,20:W,21:U,23:q},t(V,[2,52],{52:Ft}),t(yt,[2,77]),t(yt,[2,76]),{22:ft,24:mt,26:bt,38:xt,42:kt,52:G,66:X,67:K,68:[1,238],73:_t,81:Ct,83:201,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},t(yt,[2,79]),t(Mt,[2,83]),{22:ft,24:mt,26:bt,38:xt,39:239,42:kt,52:G,66:X,67:K,73:_t,81:Ct,83:140,84:Tt,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},t(Nt,a,{17:240}),t(Y,[2,43]),{51:241,52:y,54:46,66:f,67:m,91:T,95:E,105:v,106:S,109:w,111:A,112:B,116:47,122:$,123:N,124:F,125:R,126:M,127:P},{22:jt,66:Yt,67:Wt,86:Ut,96:242,102:qt,105:Vt,107:243,108:244,109:Ht,110:Gt,111:Xt,112:Kt,113:Qt},{22:jt,66:Yt,67:Wt,86:Ut,96:256,102:qt,105:Vt,107:243,108:244,109:Ht,110:Gt,111:Xt,112:Kt,113:Qt},{22:jt,66:Yt,67:Wt,86:Ut,96:257,102:qt,104:[1,258],105:Vt,107:243,108:244,109:Ht,110:Gt,111:Xt,112:Kt,113:Qt},{22:jt,66:Yt,67:Wt,86:Ut,96:259,102:qt,104:[1,260],105:Vt,107:243,108:244,109:Ht,110:Gt,111:Xt,112:Kt,113:Qt},{105:[1,261]},{22:jt,66:Yt,67:Wt,86:Ut,96:262,102:qt,105:Vt,107:243,108:244,109:Ht,110:Gt,111:Xt,112:Kt,113:Qt},{22:jt,66:Yt,67:Wt,86:Ut,96:263,102:qt,105:Vt,107:243,108:244,109:Ht,110:Gt,111:Xt,112:Kt,113:Qt},{26:H,52:G,66:X,67:K,91:Q,97:264,105:Z,106:J,109:tt,111:et,112:it,115:100,117:98,122:rt,123:nt,124:st,125:at,126:ot,127:lt},t(ut,[2,102]),{84:[1,265]},t(ut,[2,106],{22:[1,266]}),t(ut,[2,107]),t(ut,[2,110]),t(ut,[2,112],{22:[1,267]}),t(ut,[2,113]),t(ht,[2,58]),t(ht,[2,59]),{22:ft,24:mt,26:bt,38:xt,42:kt,52:G,58:[1,268],66:X,67:K,73:_t,81:Ct,83:201,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},t(ht,[2,66]),t(ht,[2,61]),t(ht,[2,62]),t(ht,[2,63]),{66:[1,269]},t(ht,[2,65]),t(ht,[2,67]),{22:ft,24:mt,26:bt,38:xt,42:kt,52:G,66:X,67:K,72:[1,270],73:_t,81:Ct,83:201,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},t(ht,[2,69]),t(ht,[2,70]),t(ht,[2,72]),t(ht,[2,71]),t(ht,[2,73]),t(Pt,[2,4]),t([22,52,66,67,91,95,105,106,109,111,112,122,123,124,125,126,127],[2,81]),{22:ft,24:mt,26:bt,38:xt,41:[1,271],42:kt,52:G,66:X,67:K,73:_t,81:Ct,83:201,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{18:18,19:19,20:o,21:l,22:c,23:h,32:24,33:25,34:26,35:27,36:28,37:29,38:d,42:[1,272],43:31,44:u,46:p,48:g,50:35,51:45,52:y,54:46,66:f,67:m,86:b,87:x,88:k,89:_,90:C,91:T,95:E,105:v,106:S,109:w,111:A,112:B,116:47,118:L,119:D,120:I,121:O,122:$,123:N,124:F,125:R,126:M,127:P},t(ct,[2,56]),t(ut,[2,115],{106:Zt}),t(Jt,[2,125],{108:274,22:jt,66:Yt,67:Wt,86:Ut,102:qt,105:Vt,109:Ht,110:Gt,111:Xt,112:Kt,113:Qt}),t(te,[2,127]),t(te,[2,129]),t(te,[2,130]),t(te,[2,131]),t(te,[2,132]),t(te,[2,133]),t(te,[2,134]),t(te,[2,135]),t(te,[2,136]),t(te,[2,137]),t(te,[2,138]),t(te,[2,139]),t(ut,[2,116],{106:Zt}),t(ut,[2,117],{106:Zt}),{22:[1,275]},t(ut,[2,118],{106:Zt}),{22:[1,276]},t(zt,[2,124]),t(ut,[2,98],{106:Zt}),t(ut,[2,99],{106:Zt}),t(ut,[2,100],{115:100,117:178,26:H,52:G,66:X,67:K,91:Q,105:Z,106:J,109:tt,111:et,112:it,122:rt,123:nt,124:st,125:at,126:ot,127:lt}),t(ut,[2,104]),{101:[1,277]},{101:[1,278]},{58:[1,279]},{68:[1,280]},{72:[1,281]},{9:282,20:W,21:U,23:q},t(Y,[2,42]),{22:jt,66:Yt,67:Wt,86:Ut,102:qt,105:Vt,107:283,108:244,109:Ht,110:Gt,111:Xt,112:Kt,113:Qt},t(te,[2,128]),{26:H,52:G,66:X,67:K,91:Q,97:284,105:Z,106:J,109:tt,111:et,112:it,115:100,117:98,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{26:H,52:G,66:X,67:K,91:Q,97:285,105:Z,106:J,109:tt,111:et,112:it,115:100,117:98,122:rt,123:nt,124:st,125:at,126:ot,127:lt},t(ut,[2,108]),t(ut,[2,114]),t(ht,[2,60]),{22:ft,24:mt,26:bt,38:xt,39:286,42:kt,52:G,66:X,67:K,73:_t,81:Ct,83:140,84:Tt,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},t(ht,[2,68]),t(Nt,a,{17:287}),t(Jt,[2,126],{108:274,22:jt,66:Yt,67:Wt,86:Ut,102:qt,105:Vt,109:Ht,110:Gt,111:Xt,112:Kt,113:Qt}),t(ut,[2,121],{115:100,117:178,22:[1,288],26:H,52:G,66:X,67:K,91:Q,105:Z,106:J,109:tt,111:et,112:it,122:rt,123:nt,124:st,125:at,126:ot,127:lt}),t(ut,[2,122],{115:100,117:178,22:[1,289],26:H,52:G,66:X,67:K,91:Q,105:Z,106:J,109:tt,111:et,112:it,122:rt,123:nt,124:st,125:at,126:ot,127:lt}),{22:ft,24:mt,26:bt,38:xt,41:[1,290],42:kt,52:G,66:X,67:K,73:_t,81:Ct,83:201,85:151,86:Et,87:vt,88:St,89:wt,90:At,91:Bt,92:Lt,94:142,95:Dt,105:Z,106:J,109:It,111:et,112:it,113:Ot,114:$t,115:148,122:rt,123:nt,124:st,125:at,126:ot,127:lt},{18:18,19:19,20:o,21:l,22:c,23:h,32:24,33:25,34:26,35:27,36:28,37:29,38:d,42:[1,291],43:31,44:u,46:p,48:g,50:35,51:45,52:y,54:46,66:f,67:m,86:b,87:x,88:k,89:_,90:C,91:T,95:E,105:v,106:S,109:w,111:A,112:B,116:47,118:L,119:D,120:I,121:O,122:$,123:N,124:F,125:R,126:M,127:P},{22:jt,66:Yt,67:Wt,86:Ut,96:292,102:qt,105:Vt,107:243,108:244,109:Ht,110:Gt,111:Xt,112:Kt,113:Qt},{22:jt,66:Yt,67:Wt,86:Ut,96:293,102:qt,105:Vt,107:243,108:244,109:Ht,110:Gt,111:Xt,112:Kt,113:Qt},t(ht,[2,64]),t(Y,[2,41]),t(ut,[2,119],{106:Zt}),t(ut,[2,120],{106:Zt})],defaultActions:{2:[2,1],9:[2,5],10:[2,2],132:[2,7]},parseError:function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},parse:function(t){var e=this,i=[0],r=[],n=[null],s=[],a=this.table,o="",l=0,c=0,h=s.slice.call(arguments,1),d=Object.create(this.lexer),u={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(u.yy[p]=this.yy[p]);d.setInput(t,u.yy),u.yy.lexer=d,u.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;s.push(g);var y=d.options&&d.options.ranges;"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var f,m,b,x,k,_,C,T,E,v={};;){if(m=i[i.length-1],this.defaultActions[m]?b=this.defaultActions[m]:(null==f&&(E=void 0,"number"!=typeof(E=r.pop()||d.lex()||1)&&(E instanceof Array&&(E=(r=E).pop()),E=e.symbols_[E]||E),f=E),b=a[m]&&a[m][f]),void 0===b||!b.length||!b[0]){var S="";for(k in T=[],a[m])this.terminals_[k]&&k>2&&T.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[f]||f,line:d.yylineno,loc:g,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+f);switch(b[0]){case 1:i.push(f),n.push(d.yytext),s.push(d.yylloc),i.push(b[1]),f=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(_=this.productions_[b[1]][1],v.$=n[n.length-_],v._$={first_line:s[s.length-(_||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(_||1)].first_column,last_column:s[s.length-1].last_column},y&&(v._$.range=[s[s.length-(_||1)].range[0],s[s.length-1].range[1]]),void 0!==(x=this.performAction.apply(v,[o,c,l,u.yy,b[1],n,s].concat(h))))return x;_&&(i=i.slice(0,-1*_*2),n=n.slice(0,-1*_),s=s.slice(0,-1*_)),i.push(this.productions_[b[1]][0]),n.push(v.$),s.push(v._$),C=a[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},ie=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}, +// resets the lexer, sets new input +setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}, +// consumes and returns one char from the input +input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}, +// unshifts one char (or a string) into the input +unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===r.length?this.yylloc.first_column:0)+r[r.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}, +// When called from action, caches matched text and appends it on next action +more:function(){return this._more=!0,this}, +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// retain first n characters of the match +less:function(t){this.unput(this.match.slice(t))}, +// displays already matched input, i.e. for error messages +pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}, +// displays upcoming input, i.e. for error messages +upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}, +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}, +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(t,e){var i,r,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var s in n)this[s]=n[s];return!1}return!1}, +// return next match in input +next:function(){if(this.done)return this.EOF;var t,e,i,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),s=0;se[0].length)){if(e=i,r=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// return next match that has a token +lex:function(){var t=this.next();return t||this.lex()}, +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function(t){this.conditionStack.push(t)}, +// pop the previously active lexer condition state off the condition stack +popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}, +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}, +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}, +// alias for begin(condition) +pushState:function(t){this.begin(t)}, +// return the number of states currently on the stack +stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,i,r){switch(i){case 0:return this.begin("open_directive"),12;case 1:return this.begin("type_directive"),13;case 2:return this.popState(),this.begin("arg_directive"),10;case 3:return this.popState(),this.popState(),15;case 4:return 14;case 5:case 6:break;case 7:return this.begin("acc_title"),44;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),46;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:case 15:case 24:case 27:case 30:case 33:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:this.begin("string");break;case 16:return"STR";case 17:return 86;case 18:return 95;case 19:return 87;case 20:return 104;case 21:return 88;case 22:return 89;case 23:this.begin("href");break;case 25:return 100;case 26:this.begin("callbackname");break;case 28:this.popState(),this.begin("callbackargs");break;case 29:return 98;case 31:return 99;case 32:this.begin("click");break;case 34:return 90;case 35:case 36:case 37:return t.lex.firstGraph()&&this.begin("dir"),24;case 38:return 38;case 39:return 42;case 40:case 41:case 42:case 43:return 101;case 44:return this.popState(),25;case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:return this.popState(),26;case 55:return 118;case 56:return 119;case 57:return 120;case 58:return 121;case 59:return 105;case 60:return 111;case 61:return 53;case 62:return 67;case 63:return 52;case 64:return 20;case 65:return 106;case 66:return 126;case 67:case 68:case 69:return 82;case 70:case 71:case 72:return 81;case 73:return 59;case 74:return 60;case 75:return 61;case 76:return 62;case 77:return 63;case 78:return 64;case 79:return 65;case 80:return 69;case 81:return 70;case 82:return 55;case 83:return 56;case 84:return 109;case 85:return 112;case 86:return 127;case 87:return 124;case 88:return 113;case 89:case 90:return 125;case 91:return 114;case 92:return 73;case 93:return 92;case 94:return"SEP";case 95:return 91;case 96:return 66;case 97:return 75;case 98:return 74;case 99:return 77;case 100:return 76;case 101:return 122;case 102:return 123;case 103:return 68;case 104:return 57;case 105:return 58;case 106:return 40;case 107:return 41;case 108:return 71;case 109:return 72;case 110:return 133;case 111:return 21;case 112:return 22;case 113:return 23}},rules:[/^(?:%%\{)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[^\}]%%[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s]+["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\[)/,/^(?:\]\))/,/^(?:\[\[)/,/^(?:\]\])/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\])/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:-)/,/^(?:\.)/,/^(?:[\_])/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:[A-Za-z]+)/,/^(?:\\\])/,/^(?:\[\/)/,/^(?:\/\])/,/^(?:\[\\)/,/^(?:[!"#$%&'*+,-.`?\\_/])/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},callbackargs:{rules:[30,31],inclusive:!1},callbackname:{rules:[27,28,29],inclusive:!1},href:{rules:[24,25],inclusive:!1},click:{rules:[33,34],inclusive:!1},vertex:{rules:[],inclusive:!1},dir:{rules:[44,45,46,47,48,49,50,51,52,53,54],inclusive:!1},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},string:{rules:[15,16],inclusive:!1},INITIAL:{rules:[0,5,6,7,9,11,14,17,18,19,20,21,22,23,26,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113],inclusive:!0}}};return t}();function re(){this.yy={}}return ee.lexer=ie,re.prototype=ee,ee.Parser=re,new re}();co.parser=co;const ho=co,uo=(t,e)=>{var i,r;return"dagre-wrapper"!==(null==(i=null==e?void 0:e.flowchart)?void 0:i.defaultRenderer)&&("elk"!==(null==(r=null==e?void 0:e.flowchart)?void 0:r.defaultRenderer)&&null!==t.match(/^\s*graph/))},po=(t,e)=>{var i,r;return"dagre-d3"!==(null==(i=null==e?void 0:e.flowchart)?void 0:i.defaultRenderer)&&("elk"!==(null==(r=null==e?void 0:e.flowchart)?void 0:r.defaultRenderer)&&(null!==t.match(/^\s*graph/)||null!==t.match(/^\s*flowchart/)))};let go,yo,fo=0,mo=Zi(),bo={},xo=[],ko={},_o=[],Co={},To={},Eo=0,vo=!0,So=[];const wo=t=>Ot.sanitizeText(t,mo),Ao=function(t,e,i){np.parseDirective(this,t,e,i)},Bo=function(t){const e=Object.keys(bo);for(const i of e)if(bo[i].id===t)return bo[i].domId;return t},Lo=function(t,e,i,r,n,s,a={}){let o,l=t;void 0!==l&&0!==l.trim().length&&(void 0===bo[l]&&(bo[l]={id:l,domId:"flowchart-"+l+"-"+fo,styles:[],classes:[]}),fo++,void 0!==e?(mo=Zi(),o=wo(e.trim()),'"'===o[0]&&'"'===o[o.length-1]&&(o=o.substring(1,o.length-1)),bo[l].text=o):void 0===bo[l].text&&(bo[l].text=t),void 0!==i&&(bo[l].type=i),null!=r&&r.forEach((function(t){bo[l].styles.push(t)})),null!=n&&n.forEach((function(t){bo[l].classes.push(t)})),void 0!==s&&(bo[l].dir=s),void 0===bo[l].props?bo[l].props=a:void 0!==a&&Object.assign(bo[l].props,a))},Do=function(t,e,i,r){const n={start:t,end:e,type:void 0,text:""};void 0!==(r=i.text)&&(n.text=wo(r.trim()),'"'===n.text[0]&&'"'===n.text[n.text.length-1]&&(n.text=n.text.substring(1,n.text.length-1))),void 0!==i&&(n.type=i.type,n.stroke=i.stroke,n.length=i.length),xo.push(n)},Io=function(t,e,i,r){let n,s;for(n=0;n/)&&(go="LR"),go.match(/.*v/)&&(go="TB"),"TD"===go&&(go="TB")},Ro=function(t,e){t.split(",").forEach((function(t){let i=t;void 0!==bo[i]&&bo[i].classes.push(e),void 0!==Co[i]&&Co[i].classes.push(e)}))},Mo=function(t,e,i){t.split(",").forEach((function(t){void 0!==bo[t]&&(bo[t].link=Yi.formatUrl(e,mo),bo[t].linkTarget=i)})),Ro(t,"clickable")},Po=function(t){return To[t]},zo=function(t,e,i){t.split(",").forEach((function(t){!function(t,e,i){let r=Bo(t);if("loose"!==Zi().securityLevel)return;if(void 0===e)return;let n=[];if("string"==typeof i){n=i.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t")),t.classed("hover",!0)})).on("mouseout",(function(){e.transition().duration(500).style("opacity",0);f(this).classed("hover",!1)}))};So.push(Vo);const Ho=function(t="gen-1"){bo={},ko={},xo=[],So=[Vo],_o=[],Co={},Eo=0,To=[],vo=!0,yo=t,vr()},Go=t=>{yo=t||"gen-2"},Xo=function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"},Ko=function(t,e,i){let r=t.trim(),n=i;t===i&&i.match(/\s/)&&(r=void 0);let s=[];const{nodeList:a,dir:o}=function(t){const e={boolean:{},number:{},string:{}},i=[];let r;return{nodeList:t.filter((function(t){const n=typeof t;return t.stmt&&"dir"===t.stmt?(r=t.value,!1):""!==t.trim()&&(n in e?!e[n].hasOwnProperty(t)&&(e[n][t]=!0):!i.includes(t)&&i.push(t))})),dir:r}}(s.concat.apply(s,e));if(s=a,"gen-1"===yo)for(let c=0;c2e3)return;if(Jo[Zo]=e,_o[e].id===t)return{result:!0,count:0};let r=0,n=1;for(;r=0){const i=tl(t,e);if(i.result)return{result:!0,count:n+i.count};n+=i.count}r+=1}return{result:!1,count:n}},el=function(t){return Jo[t]},il=function(){Zo=-1,_o.length>0&&tl("none",_o.length-1)},rl=function(){return _o},nl=()=>!!vo&&(vo=!1,!0),sl=(t,e)=>{const i=(t=>{const e=t.trim();let i=e.slice(0,-1),r="arrow_open";switch(e.slice(-1)){case"x":r="arrow_cross","x"===e[0]&&(r="double_"+r,i=i.slice(1));break;case">":r="arrow_point","<"===e[0]&&(r="double_"+r,i=i.slice(1));break;case"o":r="arrow_circle","o"===e[0]&&(r="double_"+r,i=i.slice(1))}let n="normal",s=i.length-1;"="===i[0]&&(n="thick");let a=((t,e)=>{const i=e.length;let r=0;for(let n=0;n{let e=t.trim(),i="arrow_open";switch(e[0]){case"<":i="arrow_point",e=e.slice(1);break;case"x":i="arrow_cross",e=e.slice(1);break;case"o":i="arrow_circle",e=e.slice(1)}let r="normal";return e.includes("=")&&(r="thick"),e.includes(".")&&(r="dotted"),{type:i,stroke:r}})(e),r.stroke!==i.stroke)return{type:"INVALID",stroke:"INVALID"};if("arrow_open"===r.type)r.type=i.type;else{if(r.type!==i.type)return{type:"INVALID",stroke:"INVALID"};r.type="double_"+r.type}return"double_arrow"===r.type&&(r.type="double_arrow_point"),r.length=i.length,r}return i},al=(t,e)=>{let i=!1;return t.forEach((t=>{t.nodes.indexOf(e)>=0&&(i=!0)})),i},ol=(t,e)=>{const i=[];return t.nodes.forEach(((r,n)=>{al(e,r)||i.push(t.nodes[n])})),{nodes:i}},ll={firstGraph:nl},cl={parseDirective:Ao,defaultConfig:()=>Ui.flowchart,setAccTitle:Sr,getAccTitle:wr,getAccDescription:Br,setAccDescription:Ar,addVertex:Lo,lookUpDomId:Bo,addLink:Io,updateLinkInterpolate:Oo,updateLink:$o,addClass:No,setDirection:Fo,setClass:Ro,setTooltip:function(t,e){t.split(",").forEach((function(t){void 0!==e&&(To["gen-1"===yo?Bo(t):t]=wo(e))}))},getTooltip:Po,setClickEvent:zo,setLink:Mo,bindFunctions:jo,getDirection:Yo,getVertices:Wo,getEdges:Uo,getClasses:qo,clear:Ho,setGen:Go,defaultStyle:Xo,addSubGraph:Ko,getDepthFirstPos:el,indexNodes:il,getSubGraphs:rl,destructLink:sl,lex:ll,exists:al,makeUniq:ol,setDiagramTitle:Lr,getDiagramTitle:Dr},hl=Object.freeze(Object.defineProperty({__proto__:null,addClass:No,addLink:Io,addSingleLink:Do,addSubGraph:Ko,addVertex:Lo,bindFunctions:jo,clear:Ho,default:cl,defaultStyle:Xo,destructLink:sl,firstGraph:nl,getClasses:qo,getDepthFirstPos:el,getDirection:Yo,getEdges:Uo,getSubGraphs:rl,getTooltip:Po,getVertices:Wo,indexNodes:il,lex:ll,lookUpDomId:Bo,parseDirective:Ao,setClass:Ro,setClickEvent:zo,setDirection:Fo,setGen:Go,setLink:Mo,updateLink:$o,updateLinkInterpolate:Oo},Symbol.toStringTag,{value:"Module"}));const dl={},ul=function(t){const e=Object.keys(t);for(const i of e)dl[i]=t[i]},pl={},gl=function(t,e,i,r,n,s){const a=r.select(`[id="${i}"]`);Object.keys(t).forEach((function(i){const r=t[i];let o="default";r.classes.length>0&&(o=r.classes.join(" "));const c=wi(r.styles);let h,d=void 0!==r.text?r.text:r.id;if(Dt(Zi().flowchart.htmlLabels)){const t={label:d.replace(/fa[blrs]?:fa-[\w-]+/g,(t=>``))};h=l(a,t).node(),h.parentNode.removeChild(h)}else{const t=n.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",c.labelStyle.replace("color:","fill:"));const e=d.split(Ot.lineBreakRegex);for(const i of e){const e=n.createElementNS("http://www.w3.org/2000/svg","tspan");e.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),e.setAttribute("dy","1em"),e.setAttribute("x","1"),e.textContent=i,t.appendChild(e)}h=t}let u=0,p="";switch(r.type){case"round":u=5,p="rect";break;case"square":case"group":default:p="rect";break;case"diamond":p="question";break;case"hexagon":p="hexagon";break;case"odd":case"odd_right":p="rect_left_inv_arrow";break;case"lean_right":p="lean_right";break;case"lean_left":p="lean_left";break;case"trapezoid":p="trapezoid";break;case"inv_trapezoid":p="inv_trapezoid";break;case"circle":p="circle";break;case"ellipse":p="ellipse";break;case"stadium":p="stadium";break;case"subroutine":p="subroutine";break;case"cylinder":p="cylinder";break;case"doublecircle":p="doublecircle"}e.setNode(r.id,{labelStyle:c.labelStyle,shape:p,labelText:d,rx:u,ry:u,class:o,style:c.style,id:r.id,link:r.link,linkTarget:r.linkTarget,tooltip:s.db.getTooltip(r.id)||"",domId:s.db.lookUpDomId(r.id),haveCallback:r.haveCallback,width:"group"===r.type?500:void 0,dir:r.dir,type:r.type,props:r.props,padding:Zi().flowchart.padding}),Tt.info("setNode",{labelStyle:c.labelStyle,shape:p,labelText:d,rx:u,ry:u,class:o,style:c.style,id:r.id,domId:s.db.lookUpDomId(r.id),width:"group"===r.type?500:void 0,type:r.type,dir:r.dir,props:r.props,padding:Zi().flowchart.padding})}))},yl=function(t,e,i){Tt.info("abc78 edges = ",t);let r,n,s=0,a={};if(void 0!==t.defaultStyle){const e=wi(t.defaultStyle);r=e.style,n=e.labelStyle}t.forEach((function(i){s++;var o="L-"+i.start+"-"+i.end;void 0===a[o]?(a[o]=0,Tt.info("abc78 new entry",o,a[o])):(a[o]++,Tt.info("abc78 new entry",o,a[o]));let l=o+"-"+a[o];Tt.info("abc78 new link id to be used is",o,l,a[o]);var c="LS-"+i.start,h="LE-"+i.end;const d={style:"",labelStyle:""};switch(d.minlen=i.length||1,"arrow_open"===i.type?d.arrowhead="none":d.arrowhead="normal",d.arrowTypeStart="arrow_open",d.arrowTypeEnd="arrow_open",i.type){case"double_arrow_cross":d.arrowTypeStart="arrow_cross";case"arrow_cross":d.arrowTypeEnd="arrow_cross";break;case"double_arrow_point":d.arrowTypeStart="arrow_point";case"arrow_point":d.arrowTypeEnd="arrow_point";break;case"double_arrow_circle":d.arrowTypeStart="arrow_circle";case"arrow_circle":d.arrowTypeEnd="arrow_circle"}let u="",p="";switch(i.stroke){case"normal":u="fill:none;",void 0!==r&&(u=r),void 0!==n&&(p=n),d.thickness="normal",d.pattern="solid";break;case"dotted":d.thickness="normal",d.pattern="dotted",d.style="fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":d.thickness="thick",d.pattern="solid",d.style="stroke-width: 3.5px;fill:none;"}if(void 0!==i.style){const t=wi(i.style);u=t.style,p=t.labelStyle}d.style=d.style+=u,d.labelStyle=d.labelStyle+=p,void 0!==i.interpolate?d.curve=vi(i.interpolate,v):void 0!==t.defaultInterpolate?d.curve=vi(t.defaultInterpolate,v):d.curve=vi(pl.curve,v),void 0===i.text?void 0!==i.style&&(d.arrowheadStyle="fill: #333"):(d.arrowheadStyle="fill: #333",d.labelpos="c"),d.labelType="text",d.label=i.text.replace(Ot.lineBreakRegex,"\n"),void 0===i.style&&(d.style=d.style||"stroke: #333; stroke-width: 1.5px;fill:none;"),d.labelStyle=d.labelStyle.replace("color:","fill:"),d.id=l,d.classes="flowchart-link "+c+" "+h,e.setEdge(i.start,i.end,d,s)}))},fl={setConf:function(t){const e=Object.keys(t);for(const i of e)pl[i]=t[i]},addVertices:gl,addEdges:yl,getClasses:function(t,e){Tt.info("Extracting classes"),e.db.clear();try{return e.parse(t),e.db.getClasses()}catch(i){return}},draw:function(t,e,i,r){Tt.info("Drawing flowchart"),r.db.clear(),cl.setGen("gen-2"),r.parser.parse(t);let n=r.db.getDirection();void 0===n&&(n="TD");const{securityLevel:s,flowchart:o}=Zi(),l=o.nodeSpacing||50,c=o.rankSpacing||50;let h;"sandbox"===s&&(h=f("#i"+e));const d=f("sandbox"===s?h.nodes()[0].contentDocument.body:"body"),u="sandbox"===s?h.nodes()[0].contentDocument:document,p=new a({multigraph:!0,compound:!0}).setGraph({rankdir:n,nodesep:l,ranksep:c,marginx:0,marginy:0}).setDefaultEdgeLabel((function(){return{}}));let g;const y=r.db.getSubGraphs();Tt.info("Subgraphs - ",y);for(let a=y.length-1;a>=0;a--)g=y[a],Tt.info("Subgraph - ",g),r.db.addVertex(g.id,g.title,"group",void 0,g.classes,g.dir);const b=r.db.getVertices(),x=r.db.getEdges();Tt.info("Edges",x);let k=0;for(k=y.length-1;k>=0;k--){g=y[k],m("cluster").append("text");for(let t=0;t2&&T.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[f]||f,line:d.yylineno,loc:g,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+f);switch(b[0]){case 1:i.push(f),n.push(d.yytext),s.push(d.yylloc),i.push(b[1]),f=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(_=this.productions_[b[1]][1],v.$=n[n.length-_],v._$={first_line:s[s.length-(_||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(_||1)].first_column,last_column:s[s.length-1].last_column},y&&(v._$.range=[s[s.length-(_||1)].range[0],s[s.length-1].range[1]]),void 0!==(x=this.performAction.apply(v,[o,c,l,u.yy,b[1],n,s].concat(h))))return x;_&&(i=i.slice(0,-1*_*2),n=n.slice(0,-1*_),s=s.slice(0,-1*_)),i.push(this.productions_[b[1]][0]),n.push(v.$),s.push(v._$),C=a[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},C=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}, +// resets the lexer, sets new input +setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}, +// consumes and returns one char from the input +input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}, +// unshifts one char (or a string) into the input +unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===r.length?this.yylloc.first_column:0)+r[r.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}, +// When called from action, caches matched text and appends it on next action +more:function(){return this._more=!0,this}, +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// retain first n characters of the match +less:function(t){this.unput(this.match.slice(t))}, +// displays already matched input, i.e. for error messages +pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}, +// displays upcoming input, i.e. for error messages +upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}, +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}, +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(t,e){var i,r,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var s in n)this[s]=n[s];return!1}return!1}, +// return next match in input +next:function(){if(this.done)return this.EOF;var t,e,i,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),s=0;se[0].length)){if(e=i,r=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// return next match that has a token +lex:function(){var t=this.next();return t||this.lex()}, +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function(t){this.conditionStack.push(t)}, +// pop the previously active lexer condition state off the condition stack +popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}, +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}, +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}, +// alias for begin(condition) +pushState:function(t){this.begin(t)}, +// return the number of states currently on the stack +stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,i,r){switch(i){case 0:return this.begin("open_directive"),40;case 1:return this.begin("type_directive"),41;case 2:return this.popState(),this.begin("arg_directive"),33;case 3:return this.popState(),this.popState(),43;case 4:return 42;case 5:return this.begin("acc_title"),21;case 6:return this.popState(),"acc_title_value";case 7:return this.begin("acc_descr"),23;case 8:return this.popState(),"acc_descr_value";case 9:this.begin("acc_descr_multiline");break;case 10:case 20:case 23:case 26:case 29:this.popState();break;case 11:return"acc_descr_multiline_value";case 12:case 13:case 14:case 16:case 17:case 18:break;case 15:return 11;case 19:this.begin("href");break;case 21:return 38;case 22:this.begin("callbackname");break;case 24:this.popState(),this.begin("callbackargs");break;case 25:return 36;case 27:return 37;case 28:this.begin("click");break;case 30:return 35;case 31:return 5;case 32:return 12;case 33:return 13;case 34:return 14;case 35:return 15;case 36:return 16;case 37:return 18;case 38:return 17;case 39:return 19;case 40:return"date";case 41:return 20;case 42:return"accDescription";case 43:return 26;case 44:return 28;case 45:return 29;case 46:return 33;case 47:return 7;case 48:return"INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[10,11],inclusive:!1},acc_descr:{rules:[8],inclusive:!1},acc_title:{rules:[6],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},callbackargs:{rules:[26,27],inclusive:!1},callbackname:{rules:[23,24,25],inclusive:!1},href:{rules:[20,21],inclusive:!1},click:{rules:[29,30],inclusive:!1},INITIAL:{rules:[0,5,7,9,12,13,14,15,16,17,18,19,22,28,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],inclusive:!0}}};return t}();function T(){this.yy={}}return _.lexer=C,T.prototype=_,_.Parser=T,new T}();ml.parser=ml;const bl=ml,xl=t=>null!==t.match(/^\s*gantt/);t.extend(e),t.extend(i),t.extend(r);let kl,_l="",Cl="",Tl="",El=[],vl=[],Sl={},wl=[],Al=[],Bl="";const Ll=["active","done","crit","milestone"];let Dl=[],Il=!1,Ol=!1,$l=0;const Nl=function(t,e,i,r){return!r.includes(t.format(e.trim()))&&(!!(t.isoWeekday()>=6&&i.includes("weekends"))||(!!i.includes(t.format("dddd").toLowerCase())||i.includes(t.format(e.trim()))))},Fl=function(e,i,r,n){if(!r.length||e.manualEndTime)return;let s,a;s=e.startTime instanceof Date?t(e.startTime):t(e.startTime,i,!0),s=s.add(1,"d"),a=e.endTime instanceof Date?t(e.endTime):t(e.endTime,i,!0);const[o,l]=Rl(s,a,i,r,n);e.endTime=o.toDate(),e.renderEndTime=l},Rl=function(t,e,i,r,n){let s=!1,a=null;for(;t<=e;)s||(a=e.toDate()),s=Nl(t,i,r,n),s&&(e=e.add(1,"d")),t=t.add(1,"d");return[e,a]},Ml=function(e,i,r){r=r.trim();const n=/^after\s+([\d\w- ]+)/.exec(r.trim());if(null!==n){let t=null;if(n[1].split(" ").forEach((function(e){let i=Hl(e);void 0!==i&&(t?i.endTime>t.endTime&&(t=i):t=i)})),t)return t.endTime;{const t=new Date;return t.setHours(0,0,0,0),t}}let s=t(r,i.trim(),!0);if(s.isValid())return s.toDate();{Tt.debug("Invalid date:"+r),Tt.debug("With date format:"+i.trim());const t=new Date(r);if(void 0===t||isNaN(t.getTime()))throw new Error("Invalid date:"+r);return t}},Pl=function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return null!==e?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},zl=function(e,i,r,n=!1){r=r.trim();let s=t(r,i.trim(),!0);if(s.isValid())return n&&(s=s.add(1,"d")),s.toDate();let a=t(e);const[o,l]=Pl(r);if(!Number.isNaN(o)){const t=a.add(o,l);t.isValid()&&(a=t)}return a.toDate()};let jl=0;const Yl=function(t){return void 0===t?(jl+=1,"task"+jl):t};let Wl,Ul,ql=[];const Vl={},Hl=function(t){const e=Vl[t];return ql[e]},Gl=function(){const e=function(e){const i=ql[e];let r="";switch(ql[e].raw.startTime.type){case"prevTaskEnd":{const t=Hl(i.prevTaskId);i.startTime=t.endTime;break}case"getStartDate":r=Ml(0,_l,ql[e].raw.startTime.startData),r&&(ql[e].startTime=r)}return ql[e].startTime&&(ql[e].endTime=zl(ql[e].startTime,_l,ql[e].raw.endTime.data,Il),ql[e].endTime&&(ql[e].processed=!0,ql[e].manualEndTime=t(ql[e].raw.endTime.data,"YYYY-MM-DD",!0).isValid(),Fl(ql[e],_l,vl,El))),ql[e].processed};let i=!0;for(const[t,r]of ql.entries())e(t),i=i&&r.processed;return i},Xl=function(t,e){t.split(",").forEach((function(t){let i=Hl(t);void 0!==i&&i.classes.push(e)}))},Kl=function(t,e){Dl.push((function(){const i=document.querySelector(`[id="${t}"]`);null!==i&&i.addEventListener("click",(function(){e()}))}),(function(){const i=document.querySelector(`[id="${t}-text"]`);null!==i&&i.addEventListener("click",(function(){e()}))}))},Ql={parseDirective:function(t,e,i){np.parseDirective(this,t,e,i)},getConfig:()=>Zi().gantt,clear:function(){wl=[],Al=[],Bl="",Dl=[],jl=0,Wl=void 0,Ul=void 0,ql=[],_l="",Cl="",kl=void 0,Tl="",El=[],vl=[],Il=!1,Ol=!1,$l=0,Sl={},vr()},setDateFormat:function(t){_l=t},getDateFormat:function(){return _l},enableInclusiveEndDates:function(){Il=!0},endDatesAreInclusive:function(){return Il},enableTopAxis:function(){Ol=!0},topAxisEnabled:function(){return Ol},setAxisFormat:function(t){Cl=t},getAxisFormat:function(){return Cl},setTickInterval:function(t){kl=t},getTickInterval:function(){return kl},setTodayMarker:function(t){Tl=t},getTodayMarker:function(){return Tl},setAccTitle:Sr,getAccTitle:wr,setDiagramTitle:Lr,getDiagramTitle:Dr,setAccDescription:Ar,getAccDescription:Br,addSection:function(t){Bl=t,wl.push(t)},getSections:function(){return wl},getTasks:function(){let t=Gl();let e=0;for(;!t&&e<10;)t=Gl(),e++;return Al=ql,Al},addTask:function(t,e){const i={section:Bl,type:Bl,processed:!1,manualEndTime:!1,renderEndTime:null,raw:{data:e},task:t,classes:[]},r=function(t,e){let i;i=":"===e.substr(0,1)?e.substr(1,e.length):e;const r=i.split(","),n={};Zl(r,n,Ll);for(let s=0;s{Yi.runFunc(e,...r)}))}(t,e,i)})),Xl(t,"clickable")},setLink:function(t,e){let i=e;"loose"!==Zi().securityLevel&&(i=n.sanitizeUrl(e)),t.split(",").forEach((function(t){void 0!==Hl(t)&&(Kl(t,(()=>{window.open(i,"_self")})),Sl[t]=i)})),Xl(t,"clickable")},getLinks:function(){return Sl},bindFunctions:function(t){Dl.forEach((function(e){e(t)}))},parseDuration:Pl,isInvalidDate:Nl};function Zl(t,e,i){let r=!0;for(;r;)r=!1,i.forEach((function(i){const n=new RegExp("^\\s*"+i+"\\s*$");t[0].match(n)&&(e[i]=!0,t.shift(1),r=!0)}))}let Jl;const tc={setConf:function(){Tt.debug("Something is calling, setConf, remove the call")},draw:function(e,i,r,n){const s=Zi().gantt,a=Zi().securityLevel;let o;"sandbox"===a&&(o=f("#i"+i));const l=f("sandbox"===a?o.nodes()[0].contentDocument.body:"body"),c="sandbox"===a?o.nodes()[0].contentDocument:document,h=c.getElementById(i);Jl=h.parentElement.offsetWidth,void 0===Jl&&(Jl=1200),void 0!==s.useWidth&&(Jl=s.useWidth);const d=n.db.getTasks(),u=d.length*(s.barHeight+s.barGap)+2*s.topPadding;h.setAttribute("viewBox","0 0 "+Jl+" "+u);const p=l.select(`[id="${i}"]`),g=tt().domain([rt(d,(function(t){return t.startTime})),nt(d,(function(t){return t.endTime}))]).rangeRound([0,Jl-s.leftPadding-s.rightPadding]);let y=[];for(const t of d)y.push(t.type);const m=y;function b(t,e){return function(t){let e=t.length;const i={};for(;e;)i[t[--e]]=(i[t[e]]||0)+1;return i}(e)[t]||0}y=function(t){const e={},i=[];for(let r=0,n=t.length;rr?n=1:it?Math.min(t,e):e),0),u=l.reduce(((t,{endTime:e})=>t?Math.max(t,e):e),0),y=n.db.getDateFormat();if(!d||!u)return;const f=[];let m=null,b=t(d);for(;b.valueOf()<=u;)n.db.isInvalidDate(b,y,c,h)?m?m.end=b:m={start:b,end:b}:m&&(f.push(m),m=null),b=b.add(1,"d");p.append("g").selectAll("rect").data(f).enter().append("rect").attr("id",(function(t){return"exclude-"+t.start.format("YYYY-MM-DD")})).attr("x",(function(t){return g(t.start)+r})).attr("y",s.gridLineStartPadding).attr("width",(function(t){const e=t.end.add(1,"day");return g(e)-g(t.start)})).attr("height",o-i-s.gridLineStartPadding).attr("transform-origin",(function(t,i){return(g(t.start)+r+.5*(g(t.end)-g(t.start))).toString()+"px "+(i*e+.5*o).toString()+"px"})).attr("class","exclude-range")})(l,h,d,0,a,e,n.db.getExcludes(),n.db.getIncludes()),function(t,e,i,r){let a=at(g).tickSize(-r+e+s.gridLineStartPadding).tickFormat(lt(n.db.getAxisFormat()||s.axisFormat||"%Y-%m-%d"));const o=/^([1-9]\d*)(minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||s.tickInterval);if(null!==o){const t=o[1];switch(o[2]){case"minute":a.ticks(pt.every(t));break;case"hour":a.ticks(ut.every(t));break;case"day":a.ticks(dt.every(t));break;case"week":a.ticks(ht.every(t));break;case"month":a.ticks(ct.every(t))}}if(p.append("g").attr("class","grid").attr("transform","translate("+t+", "+(r-50)+")").call(a).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),n.db.topAxisEnabled()||s.topAxis){let i=ot(g).tickSize(-r+e+s.gridLineStartPadding).tickFormat(lt(n.db.getAxisFormat()||s.axisFormat||"%Y-%m-%d"));if(null!==o){const t=o[1];switch(o[2]){case"minute":i.ticks(pt.every(t));break;case"hour":i.ticks(ut.every(t));break;case"day":i.ticks(dt.every(t));break;case"week":i.ticks(ht.every(t));break;case"month":i.ticks(ct.every(t))}}p.append("g").attr("class","grid").attr("transform","translate("+t+", "+e+")").call(i).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}(d,h,0,a),function(t,e,r,a,o,l,c){p.append("g").selectAll("rect").data(t).enter().append("rect").attr("x",0).attr("y",(function(t,i){return t.order*e+r-2})).attr("width",(function(){return c-s.rightPadding/2})).attr("height",e).attr("class",(function(t){for(const[e,i]of y.entries())if(t.type===i)return"section section"+e%s.numberSectionStyles;return"section section0"}));const h=p.append("g").selectAll("rect").data(t).enter(),d=n.db.getLinks();h.append("rect").attr("id",(function(t){return t.id})).attr("rx",3).attr("ry",3).attr("x",(function(t){return t.milestone?g(t.startTime)+a+.5*(g(t.endTime)-g(t.startTime))-.5*o:g(t.startTime)+a})).attr("y",(function(t,i){return t.order*e+r})).attr("width",(function(t){return t.milestone?o:g(t.renderEndTime||t.endTime)-g(t.startTime)})).attr("height",o).attr("transform-origin",(function(t,i){return i=t.order,(g(t.startTime)+a+.5*(g(t.endTime)-g(t.startTime))).toString()+"px "+(i*e+r+.5*o).toString()+"px"})).attr("class",(function(t){const e="task";let i="";t.classes.length>0&&(i=t.classes.join(" "));let r=0;for(const[a,o]of y.entries())t.type===o&&(r=a%s.numberSectionStyles);let n="";return t.active?t.crit?n+=" activeCrit":n=" active":t.done?n=t.crit?" doneCrit":" done":t.crit&&(n+=" crit"),0===n.length&&(n=" task"),t.milestone&&(n=" milestone "+n),n+=r,n+=" "+i,e+n})),h.append("text").attr("id",(function(t){return t.id+"-text"})).text((function(t){return t.task})).attr("font-size",s.fontSize).attr("x",(function(t){let e=g(t.startTime),i=g(t.renderEndTime||t.endTime);t.milestone&&(e+=.5*(g(t.endTime)-g(t.startTime))-.5*o),t.milestone&&(i=e+o);const r=this.getBBox().width;return r>i-e?i+r+1.5*s.leftPadding>c?e+a-5:i+a+5:(i-e)/2+e+a})).attr("y",(function(t,i){return t.order*e+s.barHeight/2+(s.fontSize/2-2)+r})).attr("text-height",o).attr("class",(function(t){const e=g(t.startTime);let i=g(t.endTime);t.milestone&&(i=e+o);const r=this.getBBox().width;let n="";t.classes.length>0&&(n=t.classes.join(" "));let a=0;for(const[o,c]of y.entries())t.type===c&&(a=o%s.numberSectionStyles);let l="";return t.active&&(l=t.crit?"activeCritText"+a:"activeText"+a),t.done?l=t.crit?l+" doneCritText"+a:l+" doneText"+a:t.crit&&(l=l+" critText"+a),t.milestone&&(l+=" milestoneText"),r>i-e?i+r+1.5*s.leftPadding>c?n+" taskTextOutsideLeft taskTextOutside"+a+" "+l:n+" taskTextOutsideRight taskTextOutside"+a+" "+l+" width-"+r:n+" taskText taskText"+a+" "+l+" width-"+r}));if("sandbox"===Zi().securityLevel){let t;t=f("#i"+i);const e=t.nodes()[0].contentDocument;h.filter((function(t){return void 0!==d[t.id]})).each((function(t){var i=e.querySelector("#"+t.id),r=e.querySelector("#"+t.id+"-text");const n=i.parentNode;var s=e.createElement("a");s.setAttribute("xlink:href",d[t.id]),s.setAttribute("target","_top"),n.appendChild(s),s.appendChild(i),s.appendChild(r)}))}}(e,l,h,d,o,0,r),function(t,e){const i=[];let r=0;for(const[n,s]of y.entries())i[n]=[s,b(s,m)];p.append("g").selectAll("text").data(i).enter().append((function(t){const e=t[0].split(Ot.lineBreakRegex),i=-(e.length-1)/2,r=c.createElementNS("http://www.w3.org/2000/svg","text");r.setAttribute("dy",i+"em");for(const[n,s]of e.entries()){const t=c.createElementNS("http://www.w3.org/2000/svg","tspan");t.setAttribute("alignment-baseline","central"),t.setAttribute("x","10"),n>0&&t.setAttribute("dy","1em"),t.textContent=s,r.appendChild(t)}return r})).attr("x",10).attr("y",(function(n,s){if(!(s>0))return n[1]*t/2+e;for(let a=0;a2&&T.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[f]||f,line:d.yylineno,loc:g,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+f);switch(b[0]){case 1:i.push(f),n.push(d.yytext),s.push(d.yylloc),i.push(b[1]),f=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(_=this.productions_[b[1]][1],v.$=n[n.length-_],v._$={first_line:s[s.length-(_||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(_||1)].first_column,last_column:s[s.length-1].last_column},y&&(v._$.range=[s[s.length-(_||1)].range[0],s[s.length-1].range[1]]),void 0!==(x=this.performAction.apply(v,[o,c,l,u.yy,b[1],n,s].concat(h))))return x;_&&(i=i.slice(0,-1*_*2),n=n.slice(0,-1*_),s=s.slice(0,-1*_)),i.push(this.productions_[b[1]][0]),n.push(v.$),s.push(v._$),C=a[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},r=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}, +// resets the lexer, sets new input +setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}, +// consumes and returns one char from the input +input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}, +// unshifts one char (or a string) into the input +unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===r.length?this.yylloc.first_column:0)+r[r.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}, +// When called from action, caches matched text and appends it on next action +more:function(){return this._more=!0,this}, +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// retain first n characters of the match +less:function(t){this.unput(this.match.slice(t))}, +// displays already matched input, i.e. for error messages +pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}, +// displays upcoming input, i.e. for error messages +upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}, +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}, +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(t,e){var i,r,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var s in n)this[s]=n[s];return!1}return!1}, +// return next match in input +next:function(){if(this.done)return this.EOF;var t,e,i,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),s=0;se[0].length)){if(e=i,r=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// return next match that has a token +lex:function(){var t=this.next();return t||this.lex()}, +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function(t){this.conditionStack.push(t)}, +// pop the previously active lexer condition state off the condition stack +popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}, +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}, +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}, +// alias for begin(condition) +pushState:function(t){this.begin(t)}, +// return the number of states currently on the stack +stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,i,r){switch(i){case 0:return 4;case 1:return 9;case 2:return"space";case 3:return 10;case 4:return 6;case 5:return"TXT"}},rules:[/^(?:info\b)/i,/^(?:[\s\n\r]+)/i,/^(?:[\s]+)/i,/^(?:showInfo\b)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5],inclusive:!0}}};return t}();function n(){this.yy={}}return i.lexer=r,n.prototype=i,i.Parser=n,new n}();ec.parser=ec;const ic=ec;var rc="",nc=!1;const sc={setMessage:t=>{Tt.debug("Setting message to: "+t),rc=t},getMessage:()=>rc,setInfo:t=>{nc=t},getInfo:()=>nc,clear:vr},ac={draw:(t,e,i)=>{try{Tt.debug("Rendering info diagram\n"+t);const r=Zi().securityLevel;let n;"sandbox"===r&&(n=f("#i"+e));const s=f("sandbox"===r?n.nodes()[0].contentDocument.body:"body").select("#"+e);s.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size","32px").style("text-anchor","middle").text("v "+i),s.attr("height",100),s.attr("width",400)}catch(r){Tt.error("Error while rendering info diagram"),Tt.error(r.message)}}},oc=t=>null!==t.match(/^\s*info/);var lc=function(){var t=function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i},e=[1,4],i=[1,5],r=[1,6],n=[1,7],s=[1,9],a=[1,11,13,15,17,19,20,26,27,28,29],o=[2,5],l=[1,6,11,13,15,17,19,20,26,27,28,29],c=[26,27,28],h=[2,8],d=[1,18],u=[1,19],p=[1,20],g=[1,21],y=[1,22],f=[1,23],m=[1,28],b=[6,26,27,28,29],x={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,directive:5,PIE:6,document:7,showData:8,line:9,statement:10,txt:11,value:12,title:13,title_value:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,openDirective:21,typeDirective:22,closeDirective:23,":":24,argDirective:25,NEWLINE:26,";":27,EOF:28,open_directive:29,type_directive:30,arg_directive:31,close_directive:32,$accept:0,$end:1},terminals_:{2:"error",6:"PIE",8:"showData",11:"txt",12:"value",13:"title",14:"title_value",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",24:":",26:"NEWLINE",27:";",28:"EOF",29:"open_directive",30:"type_directive",31:"arg_directive",32:"close_directive"},productions_:[0,[3,2],[3,2],[3,2],[3,3],[7,0],[7,2],[9,2],[10,0],[10,2],[10,2],[10,2],[10,2],[10,1],[10,1],[10,1],[5,3],[5,5],[4,1],[4,1],[4,1],[21,1],[22,1],[25,1],[23,1]],performAction:function(t,e,i,r,n,s,a){var o=s.length-1;switch(n){case 4:r.setShowData(!0);break;case 7:this.$=s[o-1];break;case 9:r.addSection(s[o-1],r.cleanupValue(s[o]));break;case 10:this.$=s[o].trim(),r.setDiagramTitle(this.$);break;case 11:this.$=s[o].trim(),r.setAccTitle(this.$);break;case 12:case 13:this.$=s[o].trim(),r.setAccDescription(this.$);break;case 14:r.addSection(s[o].substr(8)),this.$=s[o].substr(8);break;case 21:r.parseDirective("%%{","open_directive");break;case 22:r.parseDirective(s[o],"type_directive");break;case 23:s[o]=s[o].trim().replace(/'/g,'"'),r.parseDirective(s[o],"arg_directive");break;case 24:r.parseDirective("}%%","close_directive","pie")}},table:[{3:1,4:2,5:3,6:e,21:8,26:i,27:r,28:n,29:s},{1:[3]},{3:10,4:2,5:3,6:e,21:8,26:i,27:r,28:n,29:s},{3:11,4:2,5:3,6:e,21:8,26:i,27:r,28:n,29:s},t(a,o,{7:12,8:[1,13]}),t(l,[2,18]),t(l,[2,19]),t(l,[2,20]),{22:14,30:[1,15]},{30:[2,21]},{1:[2,1]},{1:[2,2]},t(c,h,{21:8,9:16,10:17,5:24,1:[2,3],11:d,13:u,15:p,17:g,19:y,20:f,29:s}),t(a,o,{7:25}),{23:26,24:[1,27],32:m},t([24,32],[2,22]),t(a,[2,6]),{4:29,26:i,27:r,28:n},{12:[1,30]},{14:[1,31]},{16:[1,32]},{18:[1,33]},t(c,[2,13]),t(c,[2,14]),t(c,[2,15]),t(c,h,{21:8,9:16,10:17,5:24,1:[2,4],11:d,13:u,15:p,17:g,19:y,20:f,29:s}),t(b,[2,16]),{25:34,31:[1,35]},t(b,[2,24]),t(a,[2,7]),t(c,[2,9]),t(c,[2,10]),t(c,[2,11]),t(c,[2,12]),{23:36,32:m},{32:[2,23]},t(b,[2,17])],defaultActions:{9:[2,21],10:[2,1],11:[2,2],35:[2,23]},parseError:function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},parse:function(t){var e=this,i=[0],r=[],n=[null],s=[],a=this.table,o="",l=0,c=0,h=s.slice.call(arguments,1),d=Object.create(this.lexer),u={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(u.yy[p]=this.yy[p]);d.setInput(t,u.yy),u.yy.lexer=d,u.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;s.push(g);var y=d.options&&d.options.ranges;"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var f,m,b,x,k,_,C,T,E,v={};;){if(m=i[i.length-1],this.defaultActions[m]?b=this.defaultActions[m]:(null==f&&(E=void 0,"number"!=typeof(E=r.pop()||d.lex()||1)&&(E instanceof Array&&(E=(r=E).pop()),E=e.symbols_[E]||E),f=E),b=a[m]&&a[m][f]),void 0===b||!b.length||!b[0]){var S="";for(k in T=[],a[m])this.terminals_[k]&&k>2&&T.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[f]||f,line:d.yylineno,loc:g,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+f);switch(b[0]){case 1:i.push(f),n.push(d.yytext),s.push(d.yylloc),i.push(b[1]),f=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(_=this.productions_[b[1]][1],v.$=n[n.length-_],v._$={first_line:s[s.length-(_||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(_||1)].first_column,last_column:s[s.length-1].last_column},y&&(v._$.range=[s[s.length-(_||1)].range[0],s[s.length-1].range[1]]),void 0!==(x=this.performAction.apply(v,[o,c,l,u.yy,b[1],n,s].concat(h))))return x;_&&(i=i.slice(0,-1*_*2),n=n.slice(0,-1*_),s=s.slice(0,-1*_)),i.push(this.productions_[b[1]][0]),n.push(v.$),s.push(v._$),C=a[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},k=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}, +// resets the lexer, sets new input +setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}, +// consumes and returns one char from the input +input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}, +// unshifts one char (or a string) into the input +unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===r.length?this.yylloc.first_column:0)+r[r.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}, +// When called from action, caches matched text and appends it on next action +more:function(){return this._more=!0,this}, +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// retain first n characters of the match +less:function(t){this.unput(this.match.slice(t))}, +// displays already matched input, i.e. for error messages +pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}, +// displays upcoming input, i.e. for error messages +upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}, +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}, +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(t,e){var i,r,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var s in n)this[s]=n[s];return!1}return!1}, +// return next match in input +next:function(){if(this.done)return this.EOF;var t,e,i,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),s=0;se[0].length)){if(e=i,r=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// return next match that has a token +lex:function(){var t=this.next();return t||this.lex()}, +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function(t){this.conditionStack.push(t)}, +// pop the previously active lexer condition state off the condition stack +popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}, +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}, +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}, +// alias for begin(condition) +pushState:function(t){this.begin(t)}, +// return the number of states currently on the stack +stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,i,r){switch(i){case 0:return this.begin("open_directive"),29;case 1:return this.begin("type_directive"),30;case 2:return this.popState(),this.begin("arg_directive"),24;case 3:return this.popState(),this.popState(),32;case 4:return 31;case 5:case 6:case 8:case 9:break;case 7:return 26;case 10:return this.begin("title"),13;case 11:return this.popState(),"title_value";case 12:return this.begin("acc_title"),15;case 13:return this.popState(),"acc_title_value";case 14:return this.begin("acc_descr"),17;case 15:return this.popState(),"acc_descr_value";case 16:this.begin("acc_descr_multiline");break;case 17:case 20:this.popState();break;case 18:return"acc_descr_multiline_value";case 19:this.begin("string");break;case 21:return"txt";case 22:return 6;case 23:return 8;case 24:return"value";case 25:return 28}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[\s]+)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:pie\b)/i,/^(?:showData\b)/i,/^(?::[\s]*[\d]+(?:\.[\d]+)?)/i,/^(?:$)/i],conditions:{acc_descr_multiline:{rules:[17,18],inclusive:!1},acc_descr:{rules:[15],inclusive:!1},acc_title:{rules:[13],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},title:{rules:[11],inclusive:!1},string:{rules:[20,21],inclusive:!1},INITIAL:{rules:[0,5,6,7,8,9,10,12,14,16,19,22,23,24,25],inclusive:!0}}};return t}();function _(){this.yy={}}return x.lexer=k,_.prototype=x,x.Parser=_,new _}();lc.parser=lc;const cc=lc,hc=t=>null!==t.match(/^\s*pie/)||null!==t.match(/^\s*bar/);let dc={},uc=!1;const pc={parseDirective:function(t,e,i){np.parseDirective(this,t,e,i)},getConfig:()=>Zi().pie,addSection:function(t,e){t=Ot.sanitizeText(t,Zi()),void 0===dc[t]&&(dc[t]=e,Tt.debug("Added new section :",t))},getSections:()=>dc,cleanupValue:function(t){return":"===t.substring(0,1)?(t=t.substring(1).trim(),Number(t.trim())):Number(t.trim())},clear:function(){dc={},uc=!1,vr()},setAccTitle:Sr,getAccTitle:wr,setDiagramTitle:Lr,getDiagramTitle:Dr,setShowData:function(t){uc=t},getShowData:function(){return uc},getAccDescription:Br,setAccDescription:Ar};let gc,yc=Zi();const fc=450,mc={draw:(t,e,i,r)=>{try{yc=Zi(),Tt.debug("Rendering info diagram\n"+t);const i=Zi().securityLevel;let y;"sandbox"===i&&(y=f("#i"+e));const m=f("sandbox"===i?y.nodes()[0].contentDocument.body:"body"),b="sandbox"===i?y.nodes()[0].contentDocument:document;r.db.clear(),r.parser.parse(t),Tt.debug("Parsed info diagram");const x=b.getElementById(e);gc=x.parentElement.offsetWidth,void 0===gc&&(gc=1200),void 0!==yc.useWidth&&(gc=yc.useWidth),void 0!==yc.pie.useWidth&&(gc=yc.pie.useWidth);const k=m.select("#"+e);sr(k,fc,gc,yc.pie.useMaxWidth),x.setAttribute("viewBox","0 0 "+gc+" "+fc);var n=18,s=Math.min(gc,fc)/2-40,a=k.append("g").attr("transform","translate("+gc/2+",225)"),o=r.db.getSections(),l=0;Object.keys(o).forEach((function(t){l+=o[t]}));const _=yc.themeVariables;var c=[_.pie1,_.pie2,_.pie3,_.pie4,_.pie5,_.pie6,_.pie7,_.pie8,_.pie9,_.pie10,_.pie11,_.pie12],h=it().range(c),d=Object.entries(o).map((function(t,e){return{order:e,name:t[0],value:t[1]}})),u=M().value((function(t){return t.value})).sort((function(t,e){return t.order-e.order}))(d),p=P().innerRadius(0).outerRadius(s);a.selectAll("mySlices").data(u).enter().append("path").attr("d",p).attr("fill",(function(t){return h(t.data.name)})).attr("class","pieCircle"),a.selectAll("mySlices").data(u).enter().append("text").text((function(t){return(t.data.value/l*100).toFixed(0)+"%"})).attr("transform",(function(t){return"translate("+p.centroid(t)+")"})).style("text-anchor","middle").attr("class","slice"),a.append("text").text(r.db.getDiagramTitle()).attr("x",0).attr("y",-200).attr("class","pieTitleText");var g=a.selectAll(".legend").data(h.domain()).enter().append("g").attr("class","legend").attr("transform",(function(t,e){return"translate(216,"+(22*e-22*h.domain().length/2)+")"}));g.append("rect").attr("width",n).attr("height",n).style("fill",h).style("stroke",h),g.data(u).append("text").attr("x",22).attr("y",14).text((function(t){return r.db.getShowData()||yc.showData||yc.pie.showData?t.data.name+" ["+t.data.value+"]":t.data.name}))}catch(y){Tt.error("Error while rendering info diagram"),Tt.error(y)}}};var bc=function(){var t=function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i},e=[1,3],i=[1,5],r=[1,6],n=[1,7],s=[1,8],a=[5,6,8,14,16,18,19,40,41,42,43,44,45,53,71,72],o=[1,22],l=[2,13],c=[1,26],h=[1,27],d=[1,28],u=[1,29],p=[1,30],g=[1,31],y=[1,24],f=[1,32],m=[1,33],b=[1,36],x=[71,72],k=[5,8,14,16,18,19,40,41,42,43,44,45,53,60,62,71,72],_=[1,56],C=[1,57],T=[1,58],E=[1,59],v=[1,60],S=[1,61],w=[1,62],A=[62,63],B=[1,74],L=[1,70],D=[1,71],I=[1,72],O=[1,73],$=[1,75],N=[1,79],F=[1,80],R=[1,77],M=[1,78],P=[5,8,14,16,18,19,40,41,42,43,44,45,53,71,72],z={trace:function(){},yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,openDirective:9,typeDirective:10,closeDirective:11,":":12,argDirective:13,acc_title:14,acc_title_value:15,acc_descr:16,acc_descr_value:17,acc_descr_multiline_value:18,open_directive:19,type_directive:20,arg_directive:21,close_directive:22,requirementDef:23,elementDef:24,relationshipDef:25,requirementType:26,requirementName:27,STRUCT_START:28,requirementBody:29,ID:30,COLONSEP:31,id:32,TEXT:33,text:34,RISK:35,riskLevel:36,VERIFYMTHD:37,verifyType:38,STRUCT_STOP:39,REQUIREMENT:40,FUNCTIONAL_REQUIREMENT:41,INTERFACE_REQUIREMENT:42,PERFORMANCE_REQUIREMENT:43,PHYSICAL_REQUIREMENT:44,DESIGN_CONSTRAINT:45,LOW_RISK:46,MED_RISK:47,HIGH_RISK:48,VERIFY_ANALYSIS:49,VERIFY_DEMONSTRATION:50,VERIFY_INSPECTION:51,VERIFY_TEST:52,ELEMENT:53,elementName:54,elementBody:55,TYPE:56,type:57,DOCREF:58,ref:59,END_ARROW_L:60,relationship:61,LINE:62,END_ARROW_R:63,CONTAINS:64,COPIES:65,DERIVES:66,SATISFIES:67,VERIFIES:68,REFINES:69,TRACES:70,unqString:71,qString:72,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",12:":",14:"acc_title",15:"acc_title_value",16:"acc_descr",17:"acc_descr_value",18:"acc_descr_multiline_value",19:"open_directive",20:"type_directive",21:"arg_directive",22:"close_directive",28:"STRUCT_START",30:"ID",31:"COLONSEP",33:"TEXT",35:"RISK",37:"VERIFYMTHD",39:"STRUCT_STOP",40:"REQUIREMENT",41:"FUNCTIONAL_REQUIREMENT",42:"INTERFACE_REQUIREMENT",43:"PERFORMANCE_REQUIREMENT",44:"PHYSICAL_REQUIREMENT",45:"DESIGN_CONSTRAINT",46:"LOW_RISK",47:"MED_RISK",48:"HIGH_RISK",49:"VERIFY_ANALYSIS",50:"VERIFY_DEMONSTRATION",51:"VERIFY_INSPECTION",52:"VERIFY_TEST",53:"ELEMENT",56:"TYPE",58:"DOCREF",60:"END_ARROW_L",62:"LINE",63:"END_ARROW_R",64:"CONTAINS",65:"COPIES",66:"DERIVES",67:"SATISFIES",68:"VERIFIES",69:"REFINES",70:"TRACES",71:"unqString",72:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,3],[4,5],[4,2],[4,2],[4,1],[9,1],[10,1],[13,1],[11,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[23,5],[29,5],[29,5],[29,5],[29,5],[29,2],[29,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[36,1],[36,1],[36,1],[38,1],[38,1],[38,1],[38,1],[24,5],[55,5],[55,5],[55,2],[55,1],[25,5],[25,5],[61,1],[61,1],[61,1],[61,1],[61,1],[61,1],[61,1],[27,1],[27,1],[32,1],[32,1],[34,1],[34,1],[54,1],[54,1],[57,1],[57,1],[59,1],[59,1]],performAction:function(t,e,i,r,n,s,a){var o=s.length-1;switch(n){case 6:this.$=s[o].trim(),r.setAccTitle(this.$);break;case 7:case 8:this.$=s[o].trim(),r.setAccDescription(this.$);break;case 9:r.parseDirective("%%{","open_directive");break;case 10:r.parseDirective(s[o],"type_directive");break;case 11:s[o]=s[o].trim().replace(/'/g,'"'),r.parseDirective(s[o],"arg_directive");break;case 12:r.parseDirective("}%%","close_directive","pie");break;case 13:this.$=[];break;case 19:r.addRequirement(s[o-3],s[o-4]);break;case 20:r.setNewReqId(s[o-2]);break;case 21:r.setNewReqText(s[o-2]);break;case 22:r.setNewReqRisk(s[o-2]);break;case 23:r.setNewReqVerifyMethod(s[o-2]);break;case 26:this.$=r.RequirementType.REQUIREMENT;break;case 27:this.$=r.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 28:this.$=r.RequirementType.INTERFACE_REQUIREMENT;break;case 29:this.$=r.RequirementType.PERFORMANCE_REQUIREMENT;break;case 30:this.$=r.RequirementType.PHYSICAL_REQUIREMENT;break;case 31:this.$=r.RequirementType.DESIGN_CONSTRAINT;break;case 32:this.$=r.RiskLevel.LOW_RISK;break;case 33:this.$=r.RiskLevel.MED_RISK;break;case 34:this.$=r.RiskLevel.HIGH_RISK;break;case 35:this.$=r.VerifyType.VERIFY_ANALYSIS;break;case 36:this.$=r.VerifyType.VERIFY_DEMONSTRATION;break;case 37:this.$=r.VerifyType.VERIFY_INSPECTION;break;case 38:this.$=r.VerifyType.VERIFY_TEST;break;case 39:r.addElement(s[o-3]);break;case 40:r.setNewElementType(s[o-2]);break;case 41:r.setNewElementDocRef(s[o-2]);break;case 44:r.addRelationship(s[o-2],s[o],s[o-4]);break;case 45:r.addRelationship(s[o-2],s[o-4],s[o]);break;case 46:this.$=r.Relationships.CONTAINS;break;case 47:this.$=r.Relationships.COPIES;break;case 48:this.$=r.Relationships.DERIVES;break;case 49:this.$=r.Relationships.SATISFIES;break;case 50:this.$=r.Relationships.VERIFIES;break;case 51:this.$=r.Relationships.REFINES;break;case 52:this.$=r.Relationships.TRACES}},table:[{3:1,4:2,6:e,9:4,14:i,16:r,18:n,19:s},{1:[3]},{3:10,4:2,5:[1,9],6:e,9:4,14:i,16:r,18:n,19:s},{5:[1,11]},{10:12,20:[1,13]},{15:[1,14]},{17:[1,15]},t(a,[2,8]),{20:[2,9]},{3:16,4:2,6:e,9:4,14:i,16:r,18:n,19:s},{1:[2,2]},{4:21,5:o,7:17,8:l,9:4,14:i,16:r,18:n,19:s,23:18,24:19,25:20,26:23,32:25,40:c,41:h,42:d,43:u,44:p,45:g,53:y,71:f,72:m},{11:34,12:[1,35],22:b},t([12,22],[2,10]),t(a,[2,6]),t(a,[2,7]),{1:[2,1]},{8:[1,37]},{4:21,5:o,7:38,8:l,9:4,14:i,16:r,18:n,19:s,23:18,24:19,25:20,26:23,32:25,40:c,41:h,42:d,43:u,44:p,45:g,53:y,71:f,72:m},{4:21,5:o,7:39,8:l,9:4,14:i,16:r,18:n,19:s,23:18,24:19,25:20,26:23,32:25,40:c,41:h,42:d,43:u,44:p,45:g,53:y,71:f,72:m},{4:21,5:o,7:40,8:l,9:4,14:i,16:r,18:n,19:s,23:18,24:19,25:20,26:23,32:25,40:c,41:h,42:d,43:u,44:p,45:g,53:y,71:f,72:m},{4:21,5:o,7:41,8:l,9:4,14:i,16:r,18:n,19:s,23:18,24:19,25:20,26:23,32:25,40:c,41:h,42:d,43:u,44:p,45:g,53:y,71:f,72:m},{4:21,5:o,7:42,8:l,9:4,14:i,16:r,18:n,19:s,23:18,24:19,25:20,26:23,32:25,40:c,41:h,42:d,43:u,44:p,45:g,53:y,71:f,72:m},{27:43,71:[1,44],72:[1,45]},{54:46,71:[1,47],72:[1,48]},{60:[1,49],62:[1,50]},t(x,[2,26]),t(x,[2,27]),t(x,[2,28]),t(x,[2,29]),t(x,[2,30]),t(x,[2,31]),t(k,[2,55]),t(k,[2,56]),t(a,[2,4]),{13:51,21:[1,52]},t(a,[2,12]),{1:[2,3]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{8:[2,17]},{8:[2,18]},{28:[1,53]},{28:[2,53]},{28:[2,54]},{28:[1,54]},{28:[2,59]},{28:[2,60]},{61:55,64:_,65:C,66:T,67:E,68:v,69:S,70:w},{61:63,64:_,65:C,66:T,67:E,68:v,69:S,70:w},{11:64,22:b},{22:[2,11]},{5:[1,65]},{5:[1,66]},{62:[1,67]},t(A,[2,46]),t(A,[2,47]),t(A,[2,48]),t(A,[2,49]),t(A,[2,50]),t(A,[2,51]),t(A,[2,52]),{63:[1,68]},t(a,[2,5]),{5:B,29:69,30:L,33:D,35:I,37:O,39:$},{5:N,39:F,55:76,56:R,58:M},{32:81,71:f,72:m},{32:82,71:f,72:m},t(P,[2,19]),{31:[1,83]},{31:[1,84]},{31:[1,85]},{31:[1,86]},{5:B,29:87,30:L,33:D,35:I,37:O,39:$},t(P,[2,25]),t(P,[2,39]),{31:[1,88]},{31:[1,89]},{5:N,39:F,55:90,56:R,58:M},t(P,[2,43]),t(P,[2,44]),t(P,[2,45]),{32:91,71:f,72:m},{34:92,71:[1,93],72:[1,94]},{36:95,46:[1,96],47:[1,97],48:[1,98]},{38:99,49:[1,100],50:[1,101],51:[1,102],52:[1,103]},t(P,[2,24]),{57:104,71:[1,105],72:[1,106]},{59:107,71:[1,108],72:[1,109]},t(P,[2,42]),{5:[1,110]},{5:[1,111]},{5:[2,57]},{5:[2,58]},{5:[1,112]},{5:[2,32]},{5:[2,33]},{5:[2,34]},{5:[1,113]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[2,38]},{5:[1,114]},{5:[2,61]},{5:[2,62]},{5:[1,115]},{5:[2,63]},{5:[2,64]},{5:B,29:116,30:L,33:D,35:I,37:O,39:$},{5:B,29:117,30:L,33:D,35:I,37:O,39:$},{5:B,29:118,30:L,33:D,35:I,37:O,39:$},{5:B,29:119,30:L,33:D,35:I,37:O,39:$},{5:N,39:F,55:120,56:R,58:M},{5:N,39:F,55:121,56:R,58:M},t(P,[2,20]),t(P,[2,21]),t(P,[2,22]),t(P,[2,23]),t(P,[2,40]),t(P,[2,41])],defaultActions:{8:[2,9],10:[2,2],16:[2,1],37:[2,3],38:[2,14],39:[2,15],40:[2,16],41:[2,17],42:[2,18],44:[2,53],45:[2,54],47:[2,59],48:[2,60],52:[2,11],93:[2,57],94:[2,58],96:[2,32],97:[2,33],98:[2,34],100:[2,35],101:[2,36],102:[2,37],103:[2,38],105:[2,61],106:[2,62],108:[2,63],109:[2,64]},parseError:function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},parse:function(t){var e=this,i=[0],r=[],n=[null],s=[],a=this.table,o="",l=0,c=0,h=s.slice.call(arguments,1),d=Object.create(this.lexer),u={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(u.yy[p]=this.yy[p]);d.setInput(t,u.yy),u.yy.lexer=d,u.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;s.push(g);var y=d.options&&d.options.ranges;"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var f,m,b,x,k,_,C,T,E,v={};;){if(m=i[i.length-1],this.defaultActions[m]?b=this.defaultActions[m]:(null==f&&(E=void 0,"number"!=typeof(E=r.pop()||d.lex()||1)&&(E instanceof Array&&(E=(r=E).pop()),E=e.symbols_[E]||E),f=E),b=a[m]&&a[m][f]),void 0===b||!b.length||!b[0]){var S="";for(k in T=[],a[m])this.terminals_[k]&&k>2&&T.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[f]||f,line:d.yylineno,loc:g,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+f);switch(b[0]){case 1:i.push(f),n.push(d.yytext),s.push(d.yylloc),i.push(b[1]),f=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(_=this.productions_[b[1]][1],v.$=n[n.length-_],v._$={first_line:s[s.length-(_||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(_||1)].first_column,last_column:s[s.length-1].last_column},y&&(v._$.range=[s[s.length-(_||1)].range[0],s[s.length-1].range[1]]),void 0!==(x=this.performAction.apply(v,[o,c,l,u.yy,b[1],n,s].concat(h))))return x;_&&(i=i.slice(0,-1*_*2),n=n.slice(0,-1*_),s=s.slice(0,-1*_)),i.push(this.productions_[b[1]][0]),n.push(v.$),s.push(v._$),C=a[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},j=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}, +// resets the lexer, sets new input +setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}, +// consumes and returns one char from the input +input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}, +// unshifts one char (or a string) into the input +unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===r.length?this.yylloc.first_column:0)+r[r.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}, +// When called from action, caches matched text and appends it on next action +more:function(){return this._more=!0,this}, +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// retain first n characters of the match +less:function(t){this.unput(this.match.slice(t))}, +// displays already matched input, i.e. for error messages +pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}, +// displays upcoming input, i.e. for error messages +upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}, +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}, +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(t,e){var i,r,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var s in n)this[s]=n[s];return!1}return!1}, +// return next match in input +next:function(){if(this.done)return this.EOF;var t,e,i,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),s=0;se[0].length)){if(e=i,r=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// return next match that has a token +lex:function(){var t=this.next();return t||this.lex()}, +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function(t){this.conditionStack.push(t)}, +// pop the previously active lexer condition state off the condition stack +popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}, +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}, +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}, +// alias for begin(condition) +pushState:function(t){this.begin(t)}, +// return the number of states currently on the stack +stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,i,r){switch(i){case 0:return this.begin("open_directive"),19;case 1:return this.begin("type_directive"),20;case 2:return this.popState(),this.begin("arg_directive"),12;case 3:return this.popState(),this.popState(),22;case 4:return 21;case 5:return"title";case 6:return this.begin("acc_title"),14;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),16;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:case 53:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 5;case 14:case 15:case 16:break;case 17:return 8;case 18:return 6;case 19:return 28;case 20:return 39;case 21:return 31;case 22:return 30;case 23:return 33;case 24:return 35;case 25:return 37;case 26:return 40;case 27:return 41;case 28:return 42;case 29:return 43;case 30:return 44;case 31:return 45;case 32:return 46;case 33:return 47;case 34:return 48;case 35:return 49;case 36:return 50;case 37:return 51;case 38:return 52;case 39:return 53;case 40:return 64;case 41:return 65;case 42:return 66;case 43:return 67;case 44:return 68;case 45:return 69;case 46:return 70;case 47:return 56;case 48:return 58;case 49:return 60;case 50:return 63;case 51:return 62;case 52:this.begin("string");break;case 54:return"qString";case 55:return e.yytext=e.yytext.trim(),71}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^\r\n\{\<\>\-\=]*)/i],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},unqString:{rules:[],inclusive:!1},token:{rules:[],inclusive:!1},string:{rules:[53,54],inclusive:!1},INITIAL:{rules:[0,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55],inclusive:!0}}};return t}();function Y(){this.yy={}}return z.lexer=j,Y.prototype=z,z.Parser=Y,new Y}();bc.parser=bc;const xc=bc,kc=t=>null!==t.match(/^\s*requirement(Diagram)?/);let _c=[],Cc={},Tc={},Ec={},vc={};const Sc={RequirementType:{REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},RiskLevel:{LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},VerifyType:{VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},Relationships:{CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},parseDirective:function(t,e,i){np.parseDirective(this,t,e,i)},getConfig:()=>Zi().req,addRequirement:(t,e)=>(void 0===Tc[t]&&(Tc[t]={name:t,type:e,id:Cc.id,text:Cc.text,risk:Cc.risk,verifyMethod:Cc.verifyMethod}),Cc={},Tc[t]),getRequirements:()=>Tc,setNewReqId:t=>{void 0!==Cc&&(Cc.id=t)},setNewReqText:t=>{void 0!==Cc&&(Cc.text=t)},setNewReqRisk:t=>{void 0!==Cc&&(Cc.risk=t)},setNewReqVerifyMethod:t=>{void 0!==Cc&&(Cc.verifyMethod=t)},setAccTitle:Sr,getAccTitle:wr,setAccDescription:Ar,getAccDescription:Br,addElement:t=>(void 0===vc[t]&&(vc[t]={name:t,type:Ec.type,docRef:Ec.docRef},Tt.info("Added new requirement: ",t)),Ec={},vc[t]),getElements:()=>vc,setNewElementType:t=>{void 0!==Ec&&(Ec.type=t)},setNewElementDocRef:t=>{void 0!==Ec&&(Ec.docRef=t)},addRelationship:(t,e,i)=>{_c.push({type:t,src:e,dst:i})},getRelationships:()=>_c,clear:()=>{_c=[],Cc={},Tc={},Ec={},vc={},vr()}},wc={CONTAINS:"contains",ARROW:"arrow"},Ac=wc,Bc=(t,e)=>{let i=t.append("defs").append("marker").attr("id",wc.CONTAINS+"_line_ending").attr("refX",0).attr("refY",e.line_height/2).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("g");i.append("circle").attr("cx",e.line_height/2).attr("cy",e.line_height/2).attr("r",e.line_height/2).attr("fill","none"),i.append("line").attr("x1",0).attr("x2",e.line_height).attr("y1",e.line_height/2).attr("y2",e.line_height/2).attr("stroke-width",1),i.append("line").attr("y1",0).attr("y2",e.line_height).attr("x1",e.line_height/2).attr("x2",e.line_height/2).attr("stroke-width",1),t.append("defs").append("marker").attr("id",wc.ARROW+"_line_ending").attr("refX",e.line_height).attr("refY",.5*e.line_height).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("path").attr("d",`M0,0\n L${e.line_height},${e.line_height/2}\n M${e.line_height},${e.line_height/2}\n L0,${e.line_height}`).attr("stroke-width",1)};let Lc={},Dc=0;const Ic=(t,e)=>t.insert("rect","#"+e).attr("class","req reqBox").attr("x",0).attr("y",0).attr("width",Lc.rect_min_width+"px").attr("height",Lc.rect_min_height+"px"),Oc=(t,e,i)=>{let r=Lc.rect_min_width/2,n=t.append("text").attr("class","req reqLabel reqTitle").attr("id",e).attr("x",r).attr("y",Lc.rect_padding).attr("dominant-baseline","hanging"),s=0;i.forEach((t=>{0==s?n.append("tspan").attr("text-anchor","middle").attr("x",Lc.rect_min_width/2).attr("dy",0).text(t):n.append("tspan").attr("text-anchor","middle").attr("x",Lc.rect_min_width/2).attr("dy",.75*Lc.line_height).text(t),s++}));let a=1.5*Lc.rect_padding+s*Lc.line_height*.75;return t.append("line").attr("class","req-title-line").attr("x1","0").attr("x2",Lc.rect_min_width).attr("y1",a).attr("y2",a),{titleNode:n,y:a}},$c=(t,e,i,r)=>{let n=t.append("text").attr("class","req reqLabel").attr("id",e).attr("x",Lc.rect_padding).attr("y",r).attr("dominant-baseline","hanging"),s=0;let a=[];return i.forEach((t=>{let e=t.length;for(;e>30&&s<3;){let i=t.substring(0,30);e=(t=t.substring(30,t.length)).length,a[a.length]=i,s++}if(3==s){let t=a[a.length-1];a[a.length-1]=t.substring(0,t.length-4)+"..."}else a[a.length]=t;s=0})),a.forEach((t=>{n.append("tspan").attr("x",Lc.rect_padding).attr("dy",Lc.line_height).text(t)})),n},Nc=function(t,e,i,r,n){const s=i.edge(Fc(e.src),Fc(e.dst)),a=z().x((function(t){return t.x})).y((function(t){return t.y})),o=t.insert("path","#"+r).attr("class","er relationshipLine").attr("d",a(s.points)).attr("fill","none");e.type==n.db.Relationships.CONTAINS?o.attr("marker-start","url("+Ot.getUrl(Lc.arrowMarkerAbsolute)+"#"+e.type+"_line_ending)"):(o.attr("stroke-dasharray","10,7"),o.attr("marker-end","url("+Ot.getUrl(Lc.arrowMarkerAbsolute)+"#"+Ac.ARROW+"_line_ending)")),((t,e,i,r)=>{const n=e.node().getTotalLength(),s=e.node().getPointAtLength(.5*n),a="rel"+Dc;Dc++;const o=t.append("text").attr("class","req relationshipLabel").attr("id",a).attr("x",s.x).attr("y",s.y).attr("text-anchor","middle").attr("dominant-baseline","middle").text(r).node().getBBox();t.insert("rect","#"+a).attr("class","req reqLabelBox").attr("x",s.x-o.width/2).attr("y",s.y-o.height/2).attr("width",o.width).attr("height",o.height).attr("fill","white").attr("fill-opacity","85%")})(t,o,0,`<<${e.type}>>`)},Fc=t=>t.replace(/\s/g,"").replace(/\./g,"_"),Rc={draw:(t,e,i,r)=>{Lc=Zi().requirement,r.db.clear(),r.parser.parse(t);const n=Lc.securityLevel;let s;"sandbox"===n&&(s=f("#i"+e));const l=f("sandbox"===n?s.nodes()[0].contentDocument.body:"body").select(`[id='${e}']`);Bc(l,Lc);const c=new a({multigraph:!1,compound:!1,directed:!0}).setGraph({rankdir:Lc.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel((function(){return{}}));let h=r.db.getRequirements(),d=r.db.getElements(),u=r.db.getRelationships();var p,g,y;p=h,g=c,y=l,Object.keys(p).forEach((t=>{let e=p[t];t=Fc(t),Tt.info("Added new requirement: ",t);const i=y.append("g").attr("id",t),r=Ic(i,"req-"+t);let n=Oc(i,t+"_title",[`<<${e.type}>>`,`${e.name}`]);$c(i,t+"_body",[`Id: ${e.id}`,`Text: ${e.text}`,`Risk: ${e.risk}`,`Verification: ${e.verifyMethod}`],n.y);const s=r.node().getBBox();g.setNode(t,{width:s.width,height:s.height,shape:"rect",id:t})})),((t,e,i)=>{Object.keys(t).forEach((r=>{let n=t[r];const s=Fc(r),a=i.append("g").attr("id",s),o="element-"+s,l=Ic(a,o);let c=Oc(a,o+"_title",["<>",`${r}`]);$c(a,o+"_body",[`Type: ${n.type||"Not Specified"}`,`Doc Ref: ${n.docRef||"None"}`],c.y);const h=l.node().getBBox();e.setNode(s,{width:h.width,height:h.height,shape:"rect",id:s})}))})(d,c,l),((t,e)=>{t.forEach((function(t){let i=Fc(t.src),r=Fc(t.dst);e.setEdge(i,r,{relationship:t})}))})(u,c),o(c),function(t,e){e.nodes().forEach((function(i){void 0!==i&&void 0!==e.node(i)&&(t.select("#"+i),t.select("#"+i).attr("transform","translate("+(e.node(i).x-e.node(i).width/2)+","+(e.node(i).y-e.node(i).height/2)+" )"))}))}(l,c),u.forEach((function(t){Nc(l,t,c,e,r)}));const m=Lc.rect_padding,b=l.node().getBBox(),x=b.width+2*m,k=b.height+2*m;sr(l,k,x,Lc.useMaxWidth),l.attr("viewBox",`${b.x-m} ${b.y-m} ${x} ${k}`)}};var Mc=function(){var t=function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i},e=[1,2],i=[1,3],r=[1,5],n=[1,7],s=[2,5],a=[1,15],o=[1,17],l=[1,19],c=[1,21],h=[1,22],d=[1,23],u=[1,29],p=[1,30],g=[1,31],y=[1,32],f=[1,33],m=[1,34],b=[1,35],x=[1,36],k=[1,37],_=[1,38],C=[1,39],T=[1,40],E=[1,42],v=[1,43],S=[1,45],w=[1,46],A=[1,47],B=[1,48],L=[1,49],D=[1,50],I=[1,53],O=[1,4,5,19,21,23,26,28,34,35,36,38,40,41,42,43,44,46,48,50,51,52,53,54,56,57,62,63,64,65,73,83],$=[4,5,21,54,56],N=[4,5,19,21,23,26,28,34,35,36,38,40,41,42,43,44,46,48,50,54,56,57,62,63,64,65,73,83],F=[4,5,19,21,23,26,28,34,35,36,38,40,41,42,43,44,46,48,50,53,54,56,57,62,63,64,65,73,83],R=[4,5,19,21,23,26,28,34,35,36,38,40,41,42,43,44,46,48,50,52,54,56,57,62,63,64,65,73,83],M=[4,5,19,21,23,26,28,34,35,36,38,40,41,42,43,44,46,48,50,51,54,56,57,62,63,64,65,73,83],P=[71,72,73],z=[1,125],j=[1,4,5,7,19,21,23,26,28,34,35,36,38,40,41,42,43,44,46,48,50,51,52,53,54,56,57,62,63,64,65,73,83],Y={trace:function(){},yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,directive:6,SD:7,document:8,line:9,statement:10,box_section:11,box_line:12,participant_statement:13,openDirective:14,typeDirective:15,closeDirective:16,":":17,argDirective:18,box:19,restOfLine:20,end:21,signal:22,autonumber:23,NUM:24,off:25,activate:26,actor:27,deactivate:28,note_statement:29,links_statement:30,link_statement:31,properties_statement:32,details_statement:33,title:34,legacy_title:35,acc_title:36,acc_title_value:37,acc_descr:38,acc_descr_value:39,acc_descr_multiline_value:40,loop:41,rect:42,opt:43,alt:44,else_sections:45,par:46,par_sections:47,critical:48,option_sections:49,break:50,option:51,and:52,else:53,participant:54,AS:55,participant_actor:56,note:57,placement:58,text2:59,over:60,actor_pair:61,links:62,link:63,properties:64,details:65,spaceList:66,",":67,left_of:68,right_of:69,signaltype:70,"+":71,"-":72,ACTOR:73,SOLID_OPEN_ARROW:74,DOTTED_OPEN_ARROW:75,SOLID_ARROW:76,DOTTED_ARROW:77,SOLID_CROSS:78,DOTTED_CROSS:79,SOLID_POINT:80,DOTTED_POINT:81,TXT:82,open_directive:83,type_directive:84,arg_directive:85,close_directive:86,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",7:"SD",17:":",19:"box",20:"restOfLine",21:"end",23:"autonumber",24:"NUM",25:"off",26:"activate",28:"deactivate",34:"title",35:"legacy_title",36:"acc_title",37:"acc_title_value",38:"acc_descr",39:"acc_descr_value",40:"acc_descr_multiline_value",41:"loop",42:"rect",43:"opt",44:"alt",46:"par",48:"critical",50:"break",51:"option",52:"and",53:"else",54:"participant",55:"AS",56:"participant_actor",57:"note",60:"over",62:"links",63:"link",64:"properties",65:"details",67:",",68:"left_of",69:"right_of",71:"+",72:"-",73:"ACTOR",74:"SOLID_OPEN_ARROW",75:"DOTTED_OPEN_ARROW",76:"SOLID_ARROW",77:"DOTTED_ARROW",78:"SOLID_CROSS",79:"DOTTED_CROSS",80:"SOLID_POINT",81:"DOTTED_POINT",82:"TXT",83:"open_directive",84:"type_directive",85:"arg_directive",86:"close_directive"},productions_:[0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[11,0],[11,2],[12,2],[12,1],[12,1],[6,4],[6,6],[10,1],[10,4],[10,2],[10,4],[10,3],[10,3],[10,2],[10,3],[10,3],[10,2],[10,2],[10,2],[10,2],[10,2],[10,1],[10,1],[10,2],[10,2],[10,1],[10,4],[10,4],[10,4],[10,4],[10,4],[10,4],[10,4],[10,1],[49,1],[49,4],[47,1],[47,4],[45,1],[45,4],[13,5],[13,3],[13,5],[13,3],[29,4],[29,4],[30,3],[31,3],[32,3],[33,3],[66,2],[66,1],[61,3],[61,1],[58,1],[58,1],[22,5],[22,5],[22,4],[27,1],[70,1],[70,1],[70,1],[70,1],[70,1],[70,1],[70,1],[70,1],[59,1],[14,1],[15,1],[18,1],[16,1]],performAction:function(t,e,i,r,n,s,a){var o=s.length-1;switch(n){case 4:return r.apply(s[o]),s[o];case 5:case 10:case 9:case 14:this.$=[];break;case 6:case 11:s[o-1].push(s[o]),this.$=s[o-1];break;case 7:case 8:case 12:case 13:case 63:this.$=s[o];break;case 18:s[o-1].unshift({type:"boxStart",boxData:r.parseBoxData(s[o-2])}),s[o-1].push({type:"boxEnd",boxText:s[o-2]}),this.$=s[o-1];break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(s[o-2]),sequenceIndexStep:Number(s[o-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceIndex:Number(s[o-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 24:this.$={type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:s[o-1]};break;case 25:this.$={type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:s[o-1]};break;case 31:r.setDiagramTitle(s[o].substring(6)),this.$=s[o].substring(6);break;case 32:r.setDiagramTitle(s[o].substring(7)),this.$=s[o].substring(7);break;case 33:this.$=s[o].trim(),r.setAccTitle(this.$);break;case 34:case 35:this.$=s[o].trim(),r.setAccDescription(this.$);break;case 36:s[o-1].unshift({type:"loopStart",loopText:r.parseMessage(s[o-2]),signalType:r.LINETYPE.LOOP_START}),s[o-1].push({type:"loopEnd",loopText:s[o-2],signalType:r.LINETYPE.LOOP_END}),this.$=s[o-1];break;case 37:s[o-1].unshift({type:"rectStart",color:r.parseMessage(s[o-2]),signalType:r.LINETYPE.RECT_START}),s[o-1].push({type:"rectEnd",color:r.parseMessage(s[o-2]),signalType:r.LINETYPE.RECT_END}),this.$=s[o-1];break;case 38:s[o-1].unshift({type:"optStart",optText:r.parseMessage(s[o-2]),signalType:r.LINETYPE.OPT_START}),s[o-1].push({type:"optEnd",optText:r.parseMessage(s[o-2]),signalType:r.LINETYPE.OPT_END}),this.$=s[o-1];break;case 39:s[o-1].unshift({type:"altStart",altText:r.parseMessage(s[o-2]),signalType:r.LINETYPE.ALT_START}),s[o-1].push({type:"altEnd",signalType:r.LINETYPE.ALT_END}),this.$=s[o-1];break;case 40:s[o-1].unshift({type:"parStart",parText:r.parseMessage(s[o-2]),signalType:r.LINETYPE.PAR_START}),s[o-1].push({type:"parEnd",signalType:r.LINETYPE.PAR_END}),this.$=s[o-1];break;case 41:s[o-1].unshift({type:"criticalStart",criticalText:r.parseMessage(s[o-2]),signalType:r.LINETYPE.CRITICAL_START}),s[o-1].push({type:"criticalEnd",signalType:r.LINETYPE.CRITICAL_END}),this.$=s[o-1];break;case 42:s[o-1].unshift({type:"breakStart",breakText:r.parseMessage(s[o-2]),signalType:r.LINETYPE.BREAK_START}),s[o-1].push({type:"breakEnd",optText:r.parseMessage(s[o-2]),signalType:r.LINETYPE.BREAK_END}),this.$=s[o-1];break;case 45:this.$=s[o-3].concat([{type:"option",optionText:r.parseMessage(s[o-1]),signalType:r.LINETYPE.CRITICAL_OPTION},s[o]]);break;case 47:this.$=s[o-3].concat([{type:"and",parText:r.parseMessage(s[o-1]),signalType:r.LINETYPE.PAR_AND},s[o]]);break;case 49:this.$=s[o-3].concat([{type:"else",altText:r.parseMessage(s[o-1]),signalType:r.LINETYPE.ALT_ELSE},s[o]]);break;case 50:s[o-3].type="addParticipant",s[o-3].description=r.parseMessage(s[o-1]),this.$=s[o-3];break;case 51:s[o-1].type="addParticipant",this.$=s[o-1];break;case 52:s[o-3].type="addActor",s[o-3].description=r.parseMessage(s[o-1]),this.$=s[o-3];break;case 53:s[o-1].type="addActor",this.$=s[o-1];break;case 54:this.$=[s[o-1],{type:"addNote",placement:s[o-2],actor:s[o-1].actor,text:s[o]}];break;case 55:s[o-2]=[].concat(s[o-1],s[o-1]).slice(0,2),s[o-2][0]=s[o-2][0].actor,s[o-2][1]=s[o-2][1].actor,this.$=[s[o-1],{type:"addNote",placement:r.PLACEMENT.OVER,actor:s[o-2].slice(0,2),text:s[o]}];break;case 56:this.$=[s[o-1],{type:"addLinks",actor:s[o-1].actor,text:s[o]}];break;case 57:this.$=[s[o-1],{type:"addALink",actor:s[o-1].actor,text:s[o]}];break;case 58:this.$=[s[o-1],{type:"addProperties",actor:s[o-1].actor,text:s[o]}];break;case 59:this.$=[s[o-1],{type:"addDetails",actor:s[o-1].actor,text:s[o]}];break;case 62:this.$=[s[o-2],s[o]];break;case 64:this.$=r.PLACEMENT.LEFTOF;break;case 65:this.$=r.PLACEMENT.RIGHTOF;break;case 66:this.$=[s[o-4],s[o-1],{type:"addMessage",from:s[o-4].actor,to:s[o-1].actor,signalType:s[o-3],msg:s[o]},{type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:s[o-1]}];break;case 67:this.$=[s[o-4],s[o-1],{type:"addMessage",from:s[o-4].actor,to:s[o-1].actor,signalType:s[o-3],msg:s[o]},{type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:s[o-4]}];break;case 68:this.$=[s[o-3],s[o-1],{type:"addMessage",from:s[o-3].actor,to:s[o-1].actor,signalType:s[o-2],msg:s[o]}];break;case 69:this.$={type:"addParticipant",actor:s[o]};break;case 70:this.$=r.LINETYPE.SOLID_OPEN;break;case 71:this.$=r.LINETYPE.DOTTED_OPEN;break;case 72:this.$=r.LINETYPE.SOLID;break;case 73:this.$=r.LINETYPE.DOTTED;break;case 74:this.$=r.LINETYPE.SOLID_CROSS;break;case 75:this.$=r.LINETYPE.DOTTED_CROSS;break;case 76:this.$=r.LINETYPE.SOLID_POINT;break;case 77:this.$=r.LINETYPE.DOTTED_POINT;break;case 78:this.$=r.parseMessage(s[o].trim().substring(1));break;case 79:r.parseDirective("%%{","open_directive");break;case 80:r.parseDirective(s[o],"type_directive");break;case 81:s[o]=s[o].trim().replace(/'/g,'"'),r.parseDirective(s[o],"arg_directive");break;case 82:r.parseDirective("}%%","close_directive","sequence")}},table:[{3:1,4:e,5:i,6:4,7:r,14:6,83:n},{1:[3]},{3:8,4:e,5:i,6:4,7:r,14:6,83:n},{3:9,4:e,5:i,6:4,7:r,14:6,83:n},{3:10,4:e,5:i,6:4,7:r,14:6,83:n},t([1,4,5,19,23,26,28,34,35,36,38,40,41,42,43,44,46,48,50,54,56,57,62,63,64,65,73,83],s,{8:11}),{15:12,84:[1,13]},{84:[2,79]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:a,5:o,6:41,9:14,10:16,13:18,14:6,19:l,22:20,23:c,26:h,27:44,28:d,29:24,30:25,31:26,32:27,33:28,34:u,35:p,36:g,38:y,40:f,41:m,42:b,43:x,44:k,46:_,48:C,50:T,54:E,56:v,57:S,62:w,63:A,64:B,65:L,73:D,83:n},{16:51,17:[1,52],86:I},t([17,86],[2,80]),t(O,[2,6]),{6:41,10:54,13:18,14:6,19:l,22:20,23:c,26:h,27:44,28:d,29:24,30:25,31:26,32:27,33:28,34:u,35:p,36:g,38:y,40:f,41:m,42:b,43:x,44:k,46:_,48:C,50:T,54:E,56:v,57:S,62:w,63:A,64:B,65:L,73:D,83:n},t(O,[2,8]),t(O,[2,9]),t(O,[2,17]),{20:[1,55]},{5:[1,56]},{5:[1,59],24:[1,57],25:[1,58]},{27:60,73:D},{27:61,73:D},{5:[1,62]},{5:[1,63]},{5:[1,64]},{5:[1,65]},{5:[1,66]},t(O,[2,31]),t(O,[2,32]),{37:[1,67]},{39:[1,68]},t(O,[2,35]),{20:[1,69]},{20:[1,70]},{20:[1,71]},{20:[1,72]},{20:[1,73]},{20:[1,74]},{20:[1,75]},t(O,[2,43]),{27:76,73:D},{27:77,73:D},{70:78,74:[1,79],75:[1,80],76:[1,81],77:[1,82],78:[1,83],79:[1,84],80:[1,85],81:[1,86]},{58:87,60:[1,88],68:[1,89],69:[1,90]},{27:91,73:D},{27:92,73:D},{27:93,73:D},{27:94,73:D},t([5,55,67,74,75,76,77,78,79,80,81,82],[2,69]),{5:[1,95]},{18:96,85:[1,97]},{5:[2,82]},t(O,[2,7]),t($,[2,10],{11:98}),t(O,[2,19]),{5:[1,100],24:[1,99]},{5:[1,101]},t(O,[2,23]),{5:[1,102]},{5:[1,103]},t(O,[2,26]),t(O,[2,27]),t(O,[2,28]),t(O,[2,29]),t(O,[2,30]),t(O,[2,33]),t(O,[2,34]),t(N,s,{8:104}),t(N,s,{8:105}),t(N,s,{8:106}),t(F,s,{45:107,8:108}),t(R,s,{47:109,8:110}),t(M,s,{49:111,8:112}),t(N,s,{8:113}),{5:[1,115],55:[1,114]},{5:[1,117],55:[1,116]},{27:120,71:[1,118],72:[1,119],73:D},t(P,[2,70]),t(P,[2,71]),t(P,[2,72]),t(P,[2,73]),t(P,[2,74]),t(P,[2,75]),t(P,[2,76]),t(P,[2,77]),{27:121,73:D},{27:123,61:122,73:D},{73:[2,64]},{73:[2,65]},{59:124,82:z},{59:126,82:z},{59:127,82:z},{59:128,82:z},t(j,[2,15]),{16:129,86:I},{86:[2,81]},{4:[1,132],5:[1,134],12:131,13:133,21:[1,130],54:E,56:v},{5:[1,135]},t(O,[2,21]),t(O,[2,22]),t(O,[2,24]),t(O,[2,25]),{4:a,5:o,6:41,9:14,10:16,13:18,14:6,19:l,21:[1,136],22:20,23:c,26:h,27:44,28:d,29:24,30:25,31:26,32:27,33:28,34:u,35:p,36:g,38:y,40:f,41:m,42:b,43:x,44:k,46:_,48:C,50:T,54:E,56:v,57:S,62:w,63:A,64:B,65:L,73:D,83:n},{4:a,5:o,6:41,9:14,10:16,13:18,14:6,19:l,21:[1,137],22:20,23:c,26:h,27:44,28:d,29:24,30:25,31:26,32:27,33:28,34:u,35:p,36:g,38:y,40:f,41:m,42:b,43:x,44:k,46:_,48:C,50:T,54:E,56:v,57:S,62:w,63:A,64:B,65:L,73:D,83:n},{4:a,5:o,6:41,9:14,10:16,13:18,14:6,19:l,21:[1,138],22:20,23:c,26:h,27:44,28:d,29:24,30:25,31:26,32:27,33:28,34:u,35:p,36:g,38:y,40:f,41:m,42:b,43:x,44:k,46:_,48:C,50:T,54:E,56:v,57:S,62:w,63:A,64:B,65:L,73:D,83:n},{21:[1,139]},{4:a,5:o,6:41,9:14,10:16,13:18,14:6,19:l,21:[2,48],22:20,23:c,26:h,27:44,28:d,29:24,30:25,31:26,32:27,33:28,34:u,35:p,36:g,38:y,40:f,41:m,42:b,43:x,44:k,46:_,48:C,50:T,53:[1,140],54:E,56:v,57:S,62:w,63:A,64:B,65:L,73:D,83:n},{21:[1,141]},{4:a,5:o,6:41,9:14,10:16,13:18,14:6,19:l,21:[2,46],22:20,23:c,26:h,27:44,28:d,29:24,30:25,31:26,32:27,33:28,34:u,35:p,36:g,38:y,40:f,41:m,42:b,43:x,44:k,46:_,48:C,50:T,52:[1,142],54:E,56:v,57:S,62:w,63:A,64:B,65:L,73:D,83:n},{21:[1,143]},{4:a,5:o,6:41,9:14,10:16,13:18,14:6,19:l,21:[2,44],22:20,23:c,26:h,27:44,28:d,29:24,30:25,31:26,32:27,33:28,34:u,35:p,36:g,38:y,40:f,41:m,42:b,43:x,44:k,46:_,48:C,50:T,51:[1,144],54:E,56:v,57:S,62:w,63:A,64:B,65:L,73:D,83:n},{4:a,5:o,6:41,9:14,10:16,13:18,14:6,19:l,21:[1,145],22:20,23:c,26:h,27:44,28:d,29:24,30:25,31:26,32:27,33:28,34:u,35:p,36:g,38:y,40:f,41:m,42:b,43:x,44:k,46:_,48:C,50:T,54:E,56:v,57:S,62:w,63:A,64:B,65:L,73:D,83:n},{20:[1,146]},t(O,[2,51]),{20:[1,147]},t(O,[2,53]),{27:148,73:D},{27:149,73:D},{59:150,82:z},{59:151,82:z},{59:152,82:z},{67:[1,153],82:[2,63]},{5:[2,56]},{5:[2,78]},{5:[2,57]},{5:[2,58]},{5:[2,59]},{5:[1,154]},t(O,[2,18]),t($,[2,11]),{13:155,54:E,56:v},t($,[2,13]),t($,[2,14]),t(O,[2,20]),t(O,[2,36]),t(O,[2,37]),t(O,[2,38]),t(O,[2,39]),{20:[1,156]},t(O,[2,40]),{20:[1,157]},t(O,[2,41]),{20:[1,158]},t(O,[2,42]),{5:[1,159]},{5:[1,160]},{59:161,82:z},{59:162,82:z},{5:[2,68]},{5:[2,54]},{5:[2,55]},{27:163,73:D},t(j,[2,16]),t($,[2,12]),t(F,s,{8:108,45:164}),t(R,s,{8:110,47:165}),t(M,s,{8:112,49:166}),t(O,[2,50]),t(O,[2,52]),{5:[2,66]},{5:[2,67]},{82:[2,62]},{21:[2,49]},{21:[2,47]},{21:[2,45]}],defaultActions:{7:[2,79],8:[2,1],9:[2,2],10:[2,3],53:[2,82],89:[2,64],90:[2,65],97:[2,81],124:[2,56],125:[2,78],126:[2,57],127:[2,58],128:[2,59],150:[2,68],151:[2,54],152:[2,55],161:[2,66],162:[2,67],163:[2,62],164:[2,49],165:[2,47],166:[2,45]},parseError:function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},parse:function(t){var e=this,i=[0],r=[],n=[null],s=[],a=this.table,o="",l=0,c=0,h=s.slice.call(arguments,1),d=Object.create(this.lexer),u={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(u.yy[p]=this.yy[p]);d.setInput(t,u.yy),u.yy.lexer=d,u.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;s.push(g);var y=d.options&&d.options.ranges;"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var f,m,b,x,k,_,C,T,E,v={};;){if(m=i[i.length-1],this.defaultActions[m]?b=this.defaultActions[m]:(null==f&&(E=void 0,"number"!=typeof(E=r.pop()||d.lex()||1)&&(E instanceof Array&&(E=(r=E).pop()),E=e.symbols_[E]||E),f=E),b=a[m]&&a[m][f]),void 0===b||!b.length||!b[0]){var S="";for(k in T=[],a[m])this.terminals_[k]&&k>2&&T.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[f]||f,line:d.yylineno,loc:g,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+f);switch(b[0]){case 1:i.push(f),n.push(d.yytext),s.push(d.yylloc),i.push(b[1]),f=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(_=this.productions_[b[1]][1],v.$=n[n.length-_],v._$={first_line:s[s.length-(_||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(_||1)].first_column,last_column:s[s.length-1].last_column},y&&(v._$.range=[s[s.length-(_||1)].range[0],s[s.length-1].range[1]]),void 0!==(x=this.performAction.apply(v,[o,c,l,u.yy,b[1],n,s].concat(h))))return x;_&&(i=i.slice(0,-1*_*2),n=n.slice(0,-1*_),s=s.slice(0,-1*_)),i.push(this.productions_[b[1]][0]),n.push(v.$),s.push(v._$),C=a[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},W=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}, +// resets the lexer, sets new input +setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}, +// consumes and returns one char from the input +input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}, +// unshifts one char (or a string) into the input +unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===r.length?this.yylloc.first_column:0)+r[r.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}, +// When called from action, caches matched text and appends it on next action +more:function(){return this._more=!0,this}, +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// retain first n characters of the match +less:function(t){this.unput(this.match.slice(t))}, +// displays already matched input, i.e. for error messages +pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}, +// displays upcoming input, i.e. for error messages +upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}, +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}, +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(t,e){var i,r,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var s in n)this[s]=n[s];return!1}return!1}, +// return next match in input +next:function(){if(this.done)return this.EOF;var t,e,i,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),s=0;se[0].length)){if(e=i,r=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// return next match that has a token +lex:function(){var t=this.next();return t||this.lex()}, +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function(t){this.conditionStack.push(t)}, +// pop the previously active lexer condition state off the condition stack +popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}, +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}, +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}, +// alias for begin(condition) +pushState:function(t){this.begin(t)}, +// return the number of states currently on the stack +stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,i,r){switch(i){case 0:return this.begin("open_directive"),83;case 1:return this.begin("type_directive"),84;case 2:return this.popState(),this.begin("arg_directive"),17;case 3:return this.popState(),this.popState(),86;case 4:return 85;case 5:case 53:case 66:return 5;case 6:case 7:case 8:case 9:case 10:break;case 11:return 24;case 12:return this.begin("LINE"),19;case 13:return this.begin("ID"),54;case 14:return this.begin("ID"),56;case 15:return e.yytext=e.yytext.trim(),this.begin("ALIAS"),73;case 16:return this.popState(),this.popState(),this.begin("LINE"),55;case 17:return this.popState(),this.popState(),5;case 18:return this.begin("LINE"),41;case 19:return this.begin("LINE"),42;case 20:return this.begin("LINE"),43;case 21:return this.begin("LINE"),44;case 22:return this.begin("LINE"),53;case 23:return this.begin("LINE"),46;case 24:return this.begin("LINE"),52;case 25:return this.begin("LINE"),48;case 26:return this.begin("LINE"),51;case 27:return this.begin("LINE"),50;case 28:return this.popState(),20;case 29:return 21;case 30:return 68;case 31:return 69;case 32:return 62;case 33:return 63;case 34:return 64;case 35:return 65;case 36:return 60;case 37:return 57;case 38:return this.begin("ID"),26;case 39:return this.begin("ID"),28;case 40:return 34;case 41:return 35;case 42:return this.begin("acc_title"),36;case 43:return this.popState(),"acc_title_value";case 44:return this.begin("acc_descr"),38;case 45:return this.popState(),"acc_descr_value";case 46:this.begin("acc_descr_multiline");break;case 47:this.popState();break;case 48:return"acc_descr_multiline_value";case 49:return 7;case 50:return 23;case 51:return 25;case 52:return 67;case 54:return e.yytext=e.yytext.trim(),73;case 55:return 76;case 56:return 77;case 57:return 74;case 58:return 75;case 59:return 78;case 60:return 79;case 61:return 80;case 62:return 81;case 63:return 82;case 64:return 71;case 65:return 72;case 67:return"INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:[^\->:\n,;]+?([\-]*[^\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[47,48],inclusive:!1},acc_descr:{rules:[45],inclusive:!1},acc_title:{rules:[43],inclusive:!1},open_directive:{rules:[1,8],inclusive:!1},type_directive:{rules:[2,3,8],inclusive:!1},arg_directive:{rules:[3,4,8],inclusive:!1},ID:{rules:[7,8,15],inclusive:!1},ALIAS:{rules:[7,8,16,17],inclusive:!1},LINE:{rules:[7,8,28],inclusive:!1},INITIAL:{rules:[0,5,6,8,9,10,11,12,13,14,18,19,20,21,22,23,24,25,26,27,29,30,31,32,33,34,35,36,37,38,39,40,41,42,44,46,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67],inclusive:!0}}};return t}();function U(){this.yy={}}return Y.lexer=W,U.prototype=Y,Y.Parser=U,new U}();Mc.parser=Mc;const Pc=Mc,zc=t=>null!==t.match(/^\s*sequenceDiagram/);let jc,Yc,Wc,Uc={},qc=[],Vc=[],Hc=!1;const Gc=function(t,e,i,r){let n=Wc;const s=Uc[t];if(s){if(Wc&&s.box&&Wc!==s.box)throw new Error("A same participant should only be defined in one Box: "+s.name+" can't be in '"+s.box.name+"' and in '"+Wc.name+"' at the same time.");if(n=s.box?s.box:Wc,s.box=n,s&&e===s.name&&null==i)return}null!=i&&null!=i.text||(i={text:e,wrap:null,type:r}),null!=r&&null!=i.text||(i={text:e,wrap:null,type:r}),Uc[t]={box:n,name:e,description:i.text,wrap:void 0===i.wrap&&Qc()||!!i.wrap,prevActor:jc,links:{},properties:{},actorCnt:null,rectData:null,type:r||"participant"},jc&&Uc[jc]&&(Uc[jc].nextActor=t),Wc&&Wc.actorKeys.push(t),jc=t},Xc=function(t,e,i={text:void 0,wrap:void 0},r){if(r===Zc.ACTIVE_END){const e=(t=>{let e,i=0;for(e=0;e>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},e}}return Vc.push({from:t,to:e,message:i.text,wrap:void 0===i.wrap&&Qc()||!!i.wrap,type:r}),!0},Kc=function(t){return Uc[t]},Qc=()=>void 0!==Yc?Yc:Zi().sequence.wrap,Zc={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31},Jc=function(t,e,i){i.text,void 0===i.wrap&&Qc()||i.wrap;const r=[].concat(t,t);Vc.push({from:r[0],to:r[1],message:i.text,wrap:void 0===i.wrap&&Qc()||!!i.wrap,type:Zc.NOTE,placement:e})},th=function(t,e){const i=Kc(t);try{let t=wt(e.text,Zi());t=t.replace(/&/g,"&"),t=t.replace(/=/g,"=");eh(i,JSON.parse(t))}catch(r){Tt.error("error while parsing actor link text",r)}};function eh(t,e){if(null==t.links)t.links=e;else for(let i in e)t.links[i]=e[i]}const ih=function(t,e){const i=Kc(t);try{let t=wt(e.text,Zi());rh(i,JSON.parse(t))}catch(r){Tt.error("error while parsing actor properties text",r)}};function rh(t,e){if(null==t.properties)t.properties=e;else for(let i in e)t.properties[i]=e[i]}const nh=function(t,e){const i=Kc(t),r=document.getElementById(e.text);try{const t=r.innerHTML,e=JSON.parse(t);e.properties&&rh(i,e.properties),e.links&&eh(i,e.links)}catch(n){Tt.error("error while parsing actor details text",n)}},sh=function(t){if(Array.isArray(t))t.forEach((function(t){sh(t)}));else switch(t.type){case"sequenceIndex":Vc.push({from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":Gc(t.actor,t.actor,t.description,"participant");break;case"addActor":Gc(t.actor,t.actor,t.description,"actor");break;case"activeStart":case"activeEnd":Xc(t.actor,void 0,void 0,t.signalType);break;case"addNote":Jc(t.actor,t.placement,t.text);break;case"addLinks":th(t.actor,t.text);break;case"addALink":!function(t,e){const i=Kc(t);try{const t={};let a=wt(e.text,Zi());var r=a.indexOf("@");a=a.replace(/&/g,"&"),a=a.replace(/=/g,"=");var n=a.slice(0,r-1).trim(),s=a.slice(r+1).trim();t[n]=s,eh(i,t)}catch(a){Tt.error("error while parsing actor link text",a)}}(t.actor,t.text);break;case"addProperties":ih(t.actor,t.text);break;case"addDetails":nh(t.actor,t.text);break;case"addMessage":Xc(t.from,t.to,t.msg,t.signalType);break;case"boxStart":e=t.boxData,qc.push({name:e.text,wrap:void 0===e.wrap&&Qc()||!!e.wrap,fill:e.color,actorKeys:[]}),Wc=qc.slice(-1)[0];break;case"boxEnd":Wc=void 0;break;case"loopStart":Xc(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":case"rectEnd":case"optEnd":case"altEnd":case"parEnd":case"criticalEnd":case"breakEnd":Xc(void 0,void 0,void 0,t.signalType);break;case"rectStart":Xc(void 0,void 0,t.color,t.signalType);break;case"optStart":Xc(void 0,void 0,t.optText,t.signalType);break;case"altStart":case"else":Xc(void 0,void 0,t.altText,t.signalType);break;case"setAccTitle":Sr(t.text);break;case"parStart":case"and":Xc(void 0,void 0,t.parText,t.signalType);break;case"criticalStart":Xc(void 0,void 0,t.criticalText,t.signalType);break;case"option":Xc(void 0,void 0,t.optionText,t.signalType);break;case"breakStart":Xc(void 0,void 0,t.breakText,t.signalType)}var e},ah={addActor:Gc,addMessage:function(t,e,i,r){Vc.push({from:t,to:e,message:i.text,wrap:void 0===i.wrap&&Qc()||!!i.wrap,answer:r})},addSignal:Xc,addLinks:th,addDetails:nh,addProperties:ih,autoWrap:Qc,setWrap:function(t){Yc=t},enableSequenceNumbers:function(){Hc=!0},disableSequenceNumbers:function(){Hc=!1},showSequenceNumbers:()=>Hc,getMessages:function(){return Vc},getActors:function(){return Uc},getActor:Kc,getActorKeys:function(){return Object.keys(Uc)},getActorProperty:function(t,e){if(void 0!==t&&void 0!==t.properties)return t.properties[e]},getAccTitle:wr,getBoxes:function(){return qc},getDiagramTitle:Dr,setDiagramTitle:Lr,parseDirective:function(t,e,i){np.parseDirective(this,t,e,i)},getConfig:()=>Zi().sequence,clear:function(){Uc={},qc=[],Vc=[],Hc=!1,vr()},parseMessage:function(t){const e=t.trim(),i={text:e.replace(/^:?(?:no)?wrap:/,"").trim(),wrap:null!==e.match(/^:?wrap:/)||null===e.match(/^:?nowrap:/)&&void 0};return Tt.debug("parseMessage:",i),i},parseBoxData:function(t){const e=t.match(/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/);let i=null!=e&&e[1]?e[1].trim():"transparent",r=null!=e&&e[2]?e[2].trim():void 0;if(window&&window.CSS)window.CSS.supports("color",i)||(i="transparent",r=t.trim());else{const e=(new Option).style;e.color=i,e.color!==i&&(i="transparent",r=t.trim())}return{color:i,text:void 0!==r?wt(r.replace(/^:?(?:no)?wrap:/,""),Zi()):void 0,wrap:void 0!==r?null!==r.match(/^:?wrap:/)||null===r.match(/^:?nowrap:/)&&void 0:void 0}},LINETYPE:Zc,ARROWTYPE:{FILLED:0,OPEN:1},PLACEMENT:{LEFTOF:0,RIGHTOF:1,OVER:2},addNote:Jc,setAccTitle:Sr,apply:sh,setAccDescription:Ar,getAccDescription:Br,hasAtLeastOneBox:function(){return qc.length>0},hasAtLeastOneBoxWithTitle:function(){return qc.some((t=>t.name))}};let oh=[];const lh=()=>{oh.forEach((t=>{t()})),oh=[]},ch=function(t,e){const i=t.append("rect");return i.attr("x",e.x),i.attr("y",e.y),i.attr("fill",e.fill),i.attr("stroke",e.stroke),i.attr("width",e.width),i.attr("height",e.height),i.attr("rx",e.rx),i.attr("ry",e.ry),void 0!==e.class&&i.attr("class",e.class),i},hh=(t,e)=>{var i;i=()=>{const i=document.querySelectorAll(t);0!==i.length&&(i[0].addEventListener("mouseover",(function(){ph("actor"+e+"_popup")})),i[0].addEventListener("mouseout",(function(){gh("actor"+e+"_popup")})))},oh.push(i)},dh=function(t,e,i,r){const s=t.append("image");s.attr("x",e),s.attr("y",i);var a=n.sanitizeUrl(r);s.attr("xlink:href",a)},uh=function(t,e,i,r){const s=t.append("use");s.attr("x",e),s.attr("y",i);var a=n.sanitizeUrl(r);s.attr("xlink:href","#"+a)},ph=function(t){var e=document.getElementById(t);null!=e&&(e.style.display="block")},gh=function(t){var e=document.getElementById(t);null!=e&&(e.style.display="none")},yh=function(t,e){let i=0,r=0;const n=e.text.split(Ot.lineBreakRegex),[s,a]=ji(e.fontSize);let o=[],l=0,c=()=>e.y;if(void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0)switch(e.valign){case"top":case"start":c=()=>Math.round(e.y+e.textMargin);break;case"middle":case"center":c=()=>Math.round(e.y+(i+r+e.textMargin)/2);break;case"bottom":case"end":c=()=>Math.round(e.y+(i+r+2*e.textMargin)-e.textMargin)}if(void 0!==e.anchor&&void 0!==e.textMargin&&void 0!==e.width)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle"}for(let[h,d]of n.entries()){void 0!==e.textMargin&&0===e.textMargin&&void 0!==s&&(l=h*s);const n=t.append("text");if(n.attr("x",e.x),n.attr("y",c()),void 0!==e.anchor&&n.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),void 0!==e.fontFamily&&n.style("font-family",e.fontFamily),void 0!==a&&n.style("font-size",a),void 0!==e.fontWeight&&n.style("font-weight",e.fontWeight),void 0!==e.fill&&n.attr("fill",e.fill),void 0!==e.class&&n.attr("class",e.class),void 0!==e.dy?n.attr("dy",e.dy):0!==l&&n.attr("dy",l),e.tspan){const t=n.append("tspan");t.attr("x",e.x),void 0!==e.fill&&t.attr("fill",e.fill),t.text(d)}else n.text(d);void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0&&(r+=(n._groups||n)[0][0].getBBox().height,i=r),o.push(n)}return o},fh=function(t,e){const i=t.append("polygon");var r,n,s,a,o;return i.attr("points",(r=e.x,n=e.y,s=e.width,a=e.height,r+","+n+" "+(r+s)+","+n+" "+(r+s)+","+(n+a-(o=7))+" "+(r+s-1.2*o)+","+(n+a)+" "+r+","+(n+a))),i.attr("class","labelBox"),e.y=e.y+e.height/2,yh(t,e),i};let mh=-1;const bh=(t,e)=>{t.selectAll&&t.selectAll(".actor-line").attr("class","200").attr("y2",e-55)},xh=function(t,e){ch(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"}).lower()},kh=function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},_h=function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},Ch=function(){function t(t,e,i,n,s,a,o){r(e.append("text").attr("x",i+s/2).attr("y",n+a/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,i,n,s,a,o,l){const{actorFontSize:c,actorFontFamily:h,actorFontWeight:d}=l,[u,p]=ji(c),g=t.split(Ot.lineBreakRegex);for(let y=0;yi?l.width:i;const p=h.append("rect");if(p.attr("class","actorPopupMenuPanel"+d),p.attr("x",l.x),p.attr("y",l.height),p.attr("fill",l.fill),p.attr("stroke",l.stroke),p.attr("width",u),p.attr("height",l.height),p.attr("rx",l.rx),p.attr("ry",l.ry),null!=a){var g=20;for(let t in a){var y=h.append("a"),f=n.sanitizeUrl(a[t]);y.attr("xlink:href",f),y.attr("target","_blank"),Th(r)(t,y,l.x+10,l.height+g,u,20,{class:"actor"},r),g+=30}}return p.attr("height",g),{height:l.height+g,width:u}},drawImage:dh,drawEmbeddedImage:uh,anchorElement:function(t){return t.append("g")},drawActivation:function(t,e,i,r,n){const s=_h(),a=e.anchored;s.x=e.startx,s.y=e.starty,s.class="activation"+n%3,s.width=e.stopx-e.startx,s.height=i-e.starty,ch(a,s)},drawLoop:function(t,e,i,r){const{boxMargin:n,boxTextMargin:s,labelBoxHeight:a,labelBoxWidth:o,messageFontFamily:l,messageFontSize:c,messageFontWeight:h}=r,d=t.append("g"),u=function(t,e,i,r){return d.append("line").attr("x1",t).attr("y1",e).attr("x2",i).attr("y2",r).attr("class","loopLine")};u(e.startx,e.starty,e.stopx,e.starty),u(e.stopx,e.starty,e.stopx,e.stopy),u(e.startx,e.stopy,e.stopx,e.stopy),u(e.startx,e.starty,e.startx,e.stopy),void 0!==e.sections&&e.sections.forEach((function(t){u(e.startx,t.y,e.stopx,t.y).style("stroke-dasharray","3, 3")}));let p=kh();p.text=i,p.x=e.startx,p.y=e.starty,p.fontFamily=l,p.fontSize=c,p.fontWeight=h,p.anchor="middle",p.valign="middle",p.tspan=!1,p.width=o||50,p.height=a||20,p.textMargin=s,p.class="labelText",fh(d,p),p=kh(),p.text=e.title,p.x=e.startx+o/2+(e.stopx-e.startx)/2,p.y=e.starty+n+s,p.anchor="middle",p.valign="middle",p.textMargin=s,p.class="loopText",p.fontFamily=l,p.fontSize=c,p.fontWeight=h,p.wrap=!0;let g=yh(d,p);return void 0!==e.sectionTitles&&e.sectionTitles.forEach((function(t,i){if(t.message){p.text=t.message,p.x=e.startx+(e.stopx-e.startx)/2,p.y=e.sections[i].y+n+s,p.class="loopText",p.anchor="middle",p.valign="middle",p.tspan=!1,p.fontFamily=l,p.fontSize=c,p.fontWeight=h,p.wrap=e.wrap,g=yh(d,p);let r=Math.round(g.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));e.sections[i].height+=r-(n+s)}})),e.height=Math.round(e.stopy-e.starty),d},drawBackgroundRect:xh,insertArrowHead:function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},insertArrowFilledHead:function(t){t.append("defs").append("marker").attr("id","filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},insertSequenceNumber:function(t){t.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},insertArrowCrossHead:function(t){t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},insertDatabaseIcon:function(t){t.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},insertComputerIcon:function(t){t.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},insertClockIcon:function(t){t.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},getTextObj:kh,getNoteRect:_h,popupMenu:function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = 'block'; }"},popdownMenu:function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = 'none'; }"},fixLifeLineHeights:bh,sanitizeUrl:n.sanitizeUrl};let vh={};const Sh={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:function(){return Math.max.apply(null,0===this.actors.length?[0]:this.actors.map((t=>t.height||0)))+(0===this.loops.length?0:this.loops.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(0===this.messages.length?0:this.messages.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(0===this.notes.length?0:this.notes.map((t=>t.height||0)).reduce(((t,e)=>t+e)))},clear:function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},addBox:function(t){this.boxes.push(t)},addActor:function(t){this.actors.push(t)},addLoop:function(t){this.loops.push(t)},addMessage:function(t){this.messages.push(t)},addNote:function(t){this.notes.push(t)},lastActor:function(){return this.actors[this.actors.length-1]},lastLoop:function(){return this.loops[this.loops.length-1]},lastMessage:function(){return this.messages[this.messages.length-1]},lastNote:function(){return this.notes[this.notes.length-1]},actors:[],boxes:[],loops:[],messages:[],notes:[]},init:function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,Ih(Zi())},updateVal:function(t,e,i,r){void 0===t[e]?t[e]=i:t[e]=r(i,t[e])},updateBounds:function(t,e,i,r){const n=this;let s=0;function a(a){return function(o){s++;const l=n.sequenceItems.length-s+1;n.updateVal(o,"starty",e-l*vh.boxMargin,Math.min),n.updateVal(o,"stopy",r+l*vh.boxMargin,Math.max),n.updateVal(Sh.data,"startx",t-l*vh.boxMargin,Math.min),n.updateVal(Sh.data,"stopx",i+l*vh.boxMargin,Math.max),"activation"!==a&&(n.updateVal(o,"startx",t-l*vh.boxMargin,Math.min),n.updateVal(o,"stopx",i+l*vh.boxMargin,Math.max),n.updateVal(Sh.data,"starty",e-l*vh.boxMargin,Math.min),n.updateVal(Sh.data,"stopy",r+l*vh.boxMargin,Math.max))}}this.sequenceItems.forEach(a()),this.activations.forEach(a("activation"))},insert:function(t,e,i,r){const n=Math.min(t,i),s=Math.max(t,i),a=Math.min(e,r),o=Math.max(e,r);this.updateVal(Sh.data,"startx",n,Math.min),this.updateVal(Sh.data,"starty",a,Math.min),this.updateVal(Sh.data,"stopx",s,Math.max),this.updateVal(Sh.data,"stopy",o,Math.max),this.updateBounds(n,a,s,o)},newActivation:function(t,e,i){const r=i[t.from.actor],n=Oh(t.from.actor).length||0,s=r.x+r.width/2+(n-1)*vh.activationWidth/2;this.activations.push({startx:s,starty:this.verticalPos+2,stopx:s+vh.activationWidth,stopy:void 0,actor:t.from.actor,anchored:Eh.anchorElement(e)})},endActivation:function(t){const e=this.activations.map((function(t){return t.actor})).lastIndexOf(t.from.actor);return this.activations.splice(e,1)[0]},createLoop:function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},newLoop:function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},endLoop:function(){return this.sequenceItems.pop()},addSectionToLoop:function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:Sh.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return{bounds:this.data,models:this.models}}},wh=t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),Ah=t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),Bh=t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight});const Lh=function(t,e,i,r,n,s,a){if(!0===n.hideUnusedParticipants){const t=new Set;s.forEach((e=>{t.add(e.from),t.add(e.to)})),i=i.filter((e=>t.has(e)))}let o,l=0,c=0,h=0;for(const d of i){const i=e[d],n=i.box;o&&o!=n&&(a||Sh.models.addBox(o),c+=vh.boxMargin+o.margin),n&&n!=o&&(a||(n.x=l+c,n.y=r),c+=n.margin),i.width=i.width||vh.width,i.height=Math.max(i.height||vh.height,vh.height),i.margin=i.margin||vh.actorMargin,i.x=l+c,i.y=Sh.getVerticalPos();const s=Eh.drawActor(t,i,vh,a);h=Math.max(h,s),Sh.insert(i.x,r,i.x+i.width,i.height),l+=i.width+c,i.box&&(i.box.width=l+n.margin-i.box.x),c=i.margin,o=i.box,Sh.models.addActor(i)}o&&!a&&Sh.models.addBox(o),Sh.bumpVerticalPos(h)},Dh=function(t,e,i,r){let n=0,s=0;for(const a of i){const i=e[a],o=Fh(i),l=Eh.drawPopup(t,i,o,vh,vh.forceMenus,r);l.height>n&&(n=l.height),l.width+i.x>s&&(s=l.width+i.x)}return{maxHeight:n,maxWidth:s}},Ih=function(t){ki(vh,t),t.fontFamily&&(vh.actorFontFamily=vh.noteFontFamily=vh.messageFontFamily=t.fontFamily),t.fontSize&&(vh.actorFontSize=vh.noteFontSize=vh.messageFontSize=t.fontSize),t.fontWeight&&(vh.actorFontWeight=vh.noteFontWeight=vh.messageFontWeight=t.fontWeight)},Oh=function(t){return Sh.activations.filter((function(e){return e.actor===t}))},$h=function(t,e){const i=e[t],r=Oh(t);return[r.reduce((function(t,e){return Math.min(t,e.startx)}),i.x+i.width/2),r.reduce((function(t,e){return Math.max(t,e.stopx)}),i.x+i.width/2)]};function Nh(t,e,i,r,n){Sh.bumpVerticalPos(i);let s=r;if(e.id&&e.message&&t[e.id]){const i=t[e.id].width,n=wh(vh);e.message=Yi.wrapLabel(`[${e.message}]`,i-2*vh.wrapPadding,n),e.width=i,e.wrap=!0;const a=Yi.calculateTextDimensions(e.message,n),o=Math.max(a.height,vh.labelBoxHeight);s=r+o,Tt.debug(`${o} - ${e.message}`)}n(e),Sh.bumpVerticalPos(s)}const Fh=function(t){let e=0;const i=Bh(vh);for(const r in t.links){const t=Yi.calculateTextDimensions(r,i).width+2*vh.wrapPadding+2*vh.boxMargin;et.actor)).lastIndexOf(t.from.actor);delete Sh.activations.splice(e,1)[0]}}void 0!==t.placement?(o=function(t,e,i){const r=e[t.from].x,n=e[t.to].x,s=t.wrap&&t.message;let a=Yi.calculateTextDimensions(s?Yi.wrapLabel(t.message,vh.width,Ah(vh)):t.message,Ah(vh));const o={width:s?vh.width:Math.max(vh.width,a.width+2*vh.noteMargin),height:0,startx:e[t.from].x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===i.db.PLACEMENT.RIGHTOF?(o.width=s?Math.max(vh.width,a.width):Math.max(e[t.from].width/2+e[t.to].width/2,a.width+2*vh.noteMargin),o.startx=r+(e[t.from].width+vh.actorMargin)/2):t.placement===i.db.PLACEMENT.LEFTOF?(o.width=s?Math.max(vh.width,a.width+2*vh.noteMargin):Math.max(e[t.from].width/2+e[t.to].width/2,a.width+2*vh.noteMargin),o.startx=r-o.width+(e[t.from].width-vh.actorMargin)/2):t.to===t.from?(a=Yi.calculateTextDimensions(s?Yi.wrapLabel(t.message,Math.max(vh.width,e[t.from].width),Ah(vh)):t.message,Ah(vh)),o.width=s?Math.max(vh.width,e[t.from].width):Math.max(e[t.from].width,vh.width,a.width+2*vh.noteMargin),o.startx=r+(e[t.from].width-o.width)/2):(o.width=Math.abs(r+e[t.from].width/2-(n+e[t.to].width/2))+vh.actorMargin,o.startx=r{a=t,a.from=Math.min(a.from,o.startx),a.to=Math.max(a.to,o.startx+o.width),a.width=Math.max(a.width,Math.abs(a.from-a.to))-vh.labelBoxWidth}))):(l=function(t,e,i){let r=!1;if([i.db.LINETYPE.SOLID_OPEN,i.db.LINETYPE.DOTTED_OPEN,i.db.LINETYPE.SOLID,i.db.LINETYPE.DOTTED,i.db.LINETYPE.SOLID_CROSS,i.db.LINETYPE.DOTTED_CROSS,i.db.LINETYPE.SOLID_POINT,i.db.LINETYPE.DOTTED_POINT].includes(t.type)&&(r=!0),!r)return{};const n=$h(t.from,e),s=$h(t.to,e),a=n[0]<=s[0]?1:0,o=n[0]0&&s.forEach((i=>{if(a=i,l.startx===l.stopx){const i=e[t.from],r=e[t.to];a.from=Math.min(i.x-l.width/2,i.x-i.width/2,a.from),a.to=Math.max(r.x+l.width/2,r.x+i.width/2,a.to),a.width=Math.max(a.width,Math.abs(a.to-a.from))-vh.labelBoxWidth}else a.from=Math.min(l.startx,a.from),a.to=Math.max(l.stopx,a.to),a.width=Math.max(a.width,l.width)-vh.labelBoxWidth})))})),Sh.activations=[],Tt.debug("Loop type widths:",n),n},Mh={bounds:Sh,drawActors:Lh,drawActorsPopup:Dh,setConf:Ih,draw:function(t,e,i,r){const{securityLevel:n,sequence:s}=Zi();let a;vh=s,r.db.clear(),r.parser.parse(t),"sandbox"===n&&(a=f("#i"+e));const o=f("sandbox"===n?a.nodes()[0].contentDocument.body:"body"),l="sandbox"===n?a.nodes()[0].contentDocument:document;Sh.init(),Tt.debug(r.db);const c="sandbox"===n?o.select(`[id="${e}"]`):f(`[id="${e}"]`),h=r.db.getActors(),d=r.db.getBoxes(),u=r.db.getActorKeys(),p=r.db.getMessages(),g=r.db.getDiagramTitle(),y=r.db.hasAtLeastOneBox(),b=r.db.hasAtLeastOneBoxWithTitle(),x=function(t,e,i){const r={};return e.forEach((function(e){if(t[e.to]&&t[e.from]){const n=t[e.to];if(e.placement===i.db.PLACEMENT.LEFTOF&&!n.prevActor)return;if(e.placement===i.db.PLACEMENT.RIGHTOF&&!n.nextActor)return;const s=void 0!==e.placement,a=!s,o=s?Ah(vh):wh(vh),l=e.wrap?Yi.wrapLabel(e.message,vh.width-2*vh.wrapPadding,o):e.message,c=Yi.calculateTextDimensions(l,o).width+2*vh.wrapPadding;a&&e.from===n.nextActor?r[e.to]=Math.max(r[e.to]||0,c):a&&e.from===n.prevActor?r[e.from]=Math.max(r[e.from]||0,c):a&&e.from===e.to?(r[e.from]=Math.max(r[e.from]||0,c/2),r[e.to]=Math.max(r[e.to]||0,c/2)):e.placement===i.db.PLACEMENT.RIGHTOF?r[e.from]=Math.max(r[e.from]||0,c):e.placement===i.db.PLACEMENT.LEFTOF?r[n.prevActor]=Math.max(r[n.prevActor]||0,c):e.placement===i.db.PLACEMENT.OVER&&(n.prevActor&&(r[n.prevActor]=Math.max(r[n.prevActor]||0,c/2)),n.nextActor&&(r[e.from]=Math.max(r[e.from]||0,c/2)))}})),Tt.debug("maxMessageWidthPerActor:",r),r}(h,p,r);vh.height=function(t,e,i){let r=0;Object.keys(t).forEach((e=>{const i=t[e];i.wrap&&(i.description=Yi.wrapLabel(i.description,vh.width-2*vh.wrapPadding,Bh(vh)));const n=Yi.calculateTextDimensions(i.description,Bh(vh));i.width=i.wrap?vh.width:Math.max(vh.width,n.width+2*vh.wrapPadding),i.height=i.wrap?Math.max(n.height,vh.height):vh.height,r=Math.max(r,i.height)}));for(const s in e){const i=t[s];if(!i)continue;const r=t[i.nextActor];if(!r){const t=e[s]+vh.actorMargin-i.width/2;i.margin=Math.max(t,vh.actorMargin);continue}const n=e[s]+vh.actorMargin-i.width/2-r.width/2;i.margin=Math.max(n,vh.actorMargin)}let n=0;return i.forEach((e=>{const i=wh(vh);let r=e.actorKeys.reduce(((e,i)=>e+(t[i].width+(t[i].margin||0))),0);r-=2*vh.boxTextMargin,e.wrap&&(e.name=Yi.wrapLabel(e.name,r-2*vh.wrapPadding,i));const s=Yi.calculateTextDimensions(e.name,i);n=Math.max(s.height,n);const a=Math.max(r,s.width+2*vh.wrapPadding);if(e.margin=vh.boxTextMargin,rt.textMaxHeight=n)),Math.max(r,vh.height)}(h,x,d),Eh.insertComputerIcon(c),Eh.insertDatabaseIcon(c),Eh.insertClockIcon(c),y&&(Sh.bumpVerticalPos(vh.boxMargin),b&&Sh.bumpVerticalPos(d[0].textMaxHeight)),Lh(c,h,u,0,vh,p,!1);const k=Rh(p,h,x,r);Eh.insertArrowHead(c),Eh.insertArrowCrossHead(c),Eh.insertArrowFilledHead(c),Eh.insertSequenceNumber(c);let _=1,C=1;const T=[];p.forEach((function(t){let e,i,n;switch(t.type){case r.db.LINETYPE.NOTE:i=t.noteModel,function(t,e){Sh.bumpVerticalPos(vh.boxMargin),e.height=vh.boxMargin,e.starty=Sh.getVerticalPos();const i=Eh.getNoteRect();i.x=e.startx,i.y=e.starty,i.width=e.width||vh.width,i.class="note";const r=t.append("g"),n=Eh.drawRect(r,i),s=Eh.getTextObj();s.x=e.startx,s.y=e.starty,s.width=i.width,s.dy="1em",s.text=e.message,s.class="noteText",s.fontFamily=vh.noteFontFamily,s.fontSize=vh.noteFontSize,s.fontWeight=vh.noteFontWeight,s.anchor=vh.noteAlign,s.textMargin=vh.noteMargin,s.valign="center";const a=yh(r,s),o=Math.round(a.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));n.attr("height",o+2*vh.noteMargin),e.height+=o+2*vh.noteMargin,Sh.bumpVerticalPos(o+2*vh.noteMargin),e.stopy=e.starty+o+2*vh.noteMargin,e.stopx=e.startx+i.width,Sh.insert(e.startx,e.starty,e.stopx,e.stopy),Sh.models.addNote(e)}(c,i);break;case r.db.LINETYPE.ACTIVE_START:Sh.newActivation(t,c,h);break;case r.db.LINETYPE.ACTIVE_END:!function(t,e){const i=Sh.endActivation(t);i.starty+18>e&&(i.starty=e-6,e+=12),Eh.drawActivation(c,i,e,vh,Oh(t.from.actor).length),Sh.insert(i.startx,e-10,i.stopx,e)}(t,Sh.getVerticalPos());break;case r.db.LINETYPE.LOOP_START:Nh(k,t,vh.boxMargin,vh.boxMargin+vh.boxTextMargin,(t=>Sh.newLoop(t)));break;case r.db.LINETYPE.LOOP_END:e=Sh.endLoop(),Eh.drawLoop(c,e,"loop",vh),Sh.bumpVerticalPos(e.stopy-Sh.getVerticalPos()),Sh.models.addLoop(e);break;case r.db.LINETYPE.RECT_START:Nh(k,t,vh.boxMargin,vh.boxMargin,(t=>Sh.newLoop(void 0,t.message)));break;case r.db.LINETYPE.RECT_END:e=Sh.endLoop(),Eh.drawBackgroundRect(c,e),Sh.models.addLoop(e),Sh.bumpVerticalPos(e.stopy-Sh.getVerticalPos());break;case r.db.LINETYPE.OPT_START:Nh(k,t,vh.boxMargin,vh.boxMargin+vh.boxTextMargin,(t=>Sh.newLoop(t)));break;case r.db.LINETYPE.OPT_END:e=Sh.endLoop(),Eh.drawLoop(c,e,"opt",vh),Sh.bumpVerticalPos(e.stopy-Sh.getVerticalPos()),Sh.models.addLoop(e);break;case r.db.LINETYPE.ALT_START:Nh(k,t,vh.boxMargin,vh.boxMargin+vh.boxTextMargin,(t=>Sh.newLoop(t)));break;case r.db.LINETYPE.ALT_ELSE:Nh(k,t,vh.boxMargin+vh.boxTextMargin,vh.boxMargin,(t=>Sh.addSectionToLoop(t)));break;case r.db.LINETYPE.ALT_END:e=Sh.endLoop(),Eh.drawLoop(c,e,"alt",vh),Sh.bumpVerticalPos(e.stopy-Sh.getVerticalPos()),Sh.models.addLoop(e);break;case r.db.LINETYPE.PAR_START:Nh(k,t,vh.boxMargin,vh.boxMargin+vh.boxTextMargin,(t=>Sh.newLoop(t)));break;case r.db.LINETYPE.PAR_AND:Nh(k,t,vh.boxMargin+vh.boxTextMargin,vh.boxMargin,(t=>Sh.addSectionToLoop(t)));break;case r.db.LINETYPE.PAR_END:e=Sh.endLoop(),Eh.drawLoop(c,e,"par",vh),Sh.bumpVerticalPos(e.stopy-Sh.getVerticalPos()),Sh.models.addLoop(e);break;case r.db.LINETYPE.AUTONUMBER:_=t.message.start||_,C=t.message.step||C,t.message.visible?r.db.enableSequenceNumbers():r.db.disableSequenceNumbers();break;case r.db.LINETYPE.CRITICAL_START:Nh(k,t,vh.boxMargin,vh.boxMargin+vh.boxTextMargin,(t=>Sh.newLoop(t)));break;case r.db.LINETYPE.CRITICAL_OPTION:Nh(k,t,vh.boxMargin+vh.boxTextMargin,vh.boxMargin,(t=>Sh.addSectionToLoop(t)));break;case r.db.LINETYPE.CRITICAL_END:e=Sh.endLoop(),Eh.drawLoop(c,e,"critical",vh),Sh.bumpVerticalPos(e.stopy-Sh.getVerticalPos()),Sh.models.addLoop(e);break;case r.db.LINETYPE.BREAK_START:Nh(k,t,vh.boxMargin,vh.boxMargin+vh.boxTextMargin,(t=>Sh.newLoop(t)));break;case r.db.LINETYPE.BREAK_END:e=Sh.endLoop(),Eh.drawLoop(c,e,"break",vh),Sh.bumpVerticalPos(e.stopy-Sh.getVerticalPos()),Sh.models.addLoop(e);break;default:try{n=t.msgModel,n.starty=Sh.getVerticalPos(),n.sequenceIndex=_,n.sequenceVisible=r.db.showSequenceNumbers();const e=function(t,e){Sh.bumpVerticalPos(10);const{startx:i,stopx:r,message:n}=e,s=Ot.splitBreaks(n).length,a=Yi.calculateTextDimensions(n,wh(vh)),o=a.height/s;let l;e.height+=o,Sh.bumpVerticalPos(o);let c=a.height-10;const h=a.width;if(i===r){l=Sh.getVerticalPos()+c,vh.rightAngles||(c+=vh.boxMargin,l=Sh.getVerticalPos()+c),c+=30;const t=Math.max(h/2,vh.width/2);Sh.insert(i-t,Sh.getVerticalPos()-10+c,r+t,Sh.getVerticalPos()+30+c)}else c+=vh.boxMargin,l=Sh.getVerticalPos()+c,Sh.insert(i,l-10,r,l);return Sh.bumpVerticalPos(c),e.height+=c,e.stopy=e.starty+e.height,Sh.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}(0,n);T.push({messageModel:n,lineStartY:e}),Sh.models.addMessage(n)}catch(s){Tt.error("error while drawing message",s)}}[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT].includes(t.type)&&(_+=C)})),T.forEach((t=>function(t,e,i,r){const{startx:n,stopx:s,starty:a,message:o,type:l,sequenceIndex:c,sequenceVisible:h}=e,d=Yi.calculateTextDimensions(o,wh(vh)),u=Eh.getTextObj();u.x=n,u.y=a+10,u.width=s-n,u.class="messageText",u.dy="1em",u.text=o,u.fontFamily=vh.messageFontFamily,u.fontSize=vh.messageFontSize,u.fontWeight=vh.messageFontWeight,u.anchor=vh.messageAlign,u.valign="center",u.textMargin=vh.wrapPadding,u.tspan=!1,yh(t,u);const p=d.width;let g;n===s?g=vh.rightAngles?t.append("path").attr("d",`M ${n},${i} H ${n+Math.max(vh.width/2,p/2)} V ${i+25} H ${n}`):t.append("path").attr("d","M "+n+","+i+" C "+(n+60)+","+(i-10)+" "+(n+60)+","+(i+30)+" "+n+","+(i+20)):(g=t.append("line"),g.attr("x1",n),g.attr("y1",i),g.attr("x2",s),g.attr("y2",i)),l===r.db.LINETYPE.DOTTED||l===r.db.LINETYPE.DOTTED_CROSS||l===r.db.LINETYPE.DOTTED_POINT||l===r.db.LINETYPE.DOTTED_OPEN?(g.style("stroke-dasharray","3, 3"),g.attr("class","messageLine1")):g.attr("class","messageLine0");let y="";vh.arrowMarkerAbsolute&&(y=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,y=y.replace(/\(/g,"\\("),y=y.replace(/\)/g,"\\)")),g.attr("stroke-width",2),g.attr("stroke","none"),g.style("fill","none"),l!==r.db.LINETYPE.SOLID&&l!==r.db.LINETYPE.DOTTED||g.attr("marker-end","url("+y+"#arrowhead)"),l!==r.db.LINETYPE.SOLID_POINT&&l!==r.db.LINETYPE.DOTTED_POINT||g.attr("marker-end","url("+y+"#filled-head)"),l!==r.db.LINETYPE.SOLID_CROSS&&l!==r.db.LINETYPE.DOTTED_CROSS||g.attr("marker-end","url("+y+"#crosshead)"),(h||vh.showSequenceNumbers)&&(g.attr("marker-start","url("+y+"#sequencenumber)"),t.append("text").attr("x",n).attr("y",i+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(c))}(c,t.messageModel,t.lineStartY,r))),vh.mirrorActors&&(Sh.bumpVerticalPos(2*vh.boxMargin),Lh(c,h,u,Sh.getVerticalPos(),vh,p,!0),Sh.bumpVerticalPos(vh.boxMargin),bh(c,Sh.getVerticalPos())),Sh.models.boxes.forEach((function(t){t.height=Sh.getVerticalPos()-t.y,Sh.insert(t.x,t.y,t.x+t.width,t.height),t.startx=t.x,t.starty=t.y,t.stopx=t.startx+t.width,t.stopy=t.starty+t.height,t.stroke="rgb(0,0,0, 0.5)",Eh.drawBox(c,t,vh)})),y&&Sh.bumpVerticalPos(vh.boxMargin);const E=Dh(c,h,u,l),{bounds:v}=Sh.getBounds();Tt.debug("For line height fix Querying: #"+e+" .actor-line");m("#"+e+" .actor-line").attr("y2",v.stopy);let S=v.stopy-v.starty;S2&&T.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[f]||f,line:d.yylineno,loc:g,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+f);switch(b[0]){case 1:i.push(f),n.push(d.yytext),s.push(d.yylloc),i.push(b[1]),f=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(_=this.productions_[b[1]][1],v.$=n[n.length-_],v._$={first_line:s[s.length-(_||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(_||1)].first_column,last_column:s[s.length-1].last_column},y&&(v._$.range=[s[s.length-(_||1)].range[0],s[s.length-1].range[1]]),void 0!==(x=this.performAction.apply(v,[o,c,l,u.yy,b[1],n,s].concat(h))))return x;_&&(i=i.slice(0,-1*_*2),n=n.slice(0,-1*_),s=s.slice(0,-1*_)),i.push(this.productions_[b[1]][0]),n.push(v.$),s.push(v._$),C=a[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},$=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}, +// resets the lexer, sets new input +setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}, +// consumes and returns one char from the input +input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}, +// unshifts one char (or a string) into the input +unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===r.length?this.yylloc.first_column:0)+r[r.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}, +// When called from action, caches matched text and appends it on next action +more:function(){return this._more=!0,this}, +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// retain first n characters of the match +less:function(t){this.unput(this.match.slice(t))}, +// displays already matched input, i.e. for error messages +pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}, +// displays upcoming input, i.e. for error messages +upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}, +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}, +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(t,e){var i,r,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var s in n)this[s]=n[s];return!1}return!1}, +// return next match in input +next:function(){if(this.done)return this.EOF;var t,e,i,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),s=0;se[0].length)){if(e=i,r=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// return next match that has a token +lex:function(){var t=this.next();return t||this.lex()}, +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function(t){this.conditionStack.push(t)}, +// pop the previously active lexer condition state off the condition stack +popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}, +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}, +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}, +// alias for begin(condition) +pushState:function(t){this.begin(t)}, +// return the number of states currently on the stack +stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,i,r){switch(i){case 0:return 41;case 1:case 44:return 50;case 2:case 45:return 51;case 3:case 46:return 52;case 4:case 47:return 53;case 5:return this.begin("open_directive"),60;case 6:return this.begin("type_directive"),61;case 7:return this.popState(),this.begin("arg_directive"),48;case 8:return this.popState(),this.popState(),63;case 9:return 62;case 10:case 11:case 13:case 14:case 15:case 16:case 56:case 58:case 64:break;case 12:case 79:return 5;case 17:case 34:return this.pushState("SCALE"),17;case 18:case 35:return 18;case 19:case 25:case 36:case 51:case 54:this.popState();break;case 20:return this.begin("acc_title"),33;case 21:return this.popState(),"acc_title_value";case 22:return this.begin("acc_descr"),35;case 23:return this.popState(),"acc_descr_value";case 24:this.begin("acc_descr_multiline");break;case 26:return"acc_descr_multiline_value";case 27:return this.pushState("CLASSDEF"),38;case 28:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 29:return this.popState(),this.pushState("CLASSDEFID"),39;case 30:return this.popState(),40;case 31:return this.pushState("CLASS"),42;case 32:return this.popState(),this.pushState("CLASS_STYLE"),43;case 33:return this.popState(),44;case 37:this.pushState("STATE");break;case 38:case 41:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),25;case 39:case 42:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),26;case 40:case 43:return this.popState(),e.yytext=e.yytext.slice(0,-10).trim(),27;case 48:this.pushState("STATE_STRING");break;case 49:return this.pushState("STATE_ID"),"AS";case 50:case 66:return this.popState(),"ID";case 52:return"STATE_DESCR";case 53:return 19;case 55:return this.popState(),this.pushState("struct"),20;case 57:return this.popState(),21;case 59:return this.begin("NOTE"),29;case 60:return this.popState(),this.pushState("NOTE_ID"),58;case 61:return this.popState(),this.pushState("NOTE_ID"),59;case 62:this.popState(),this.pushState("FLOATING_NOTE");break;case 63:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 65:return"NOTE_TEXT";case 67:return this.popState(),this.pushState("NOTE_TEXT"),24;case 68:return this.popState(),e.yytext=e.yytext.substr(2).trim(),31;case 69:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),31;case 70:case 71:return 7;case 72:return 16;case 73:return 56;case 74:return 24;case 75:return e.yytext=e.yytext.trim(),14;case 76:return 15;case 77:return 28;case 78:return 57;case 80:return"INVALID"}},rules:[/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[14,15],inclusive:!1},close_directive:{rules:[14,15],inclusive:!1},arg_directive:{rules:[8,9,14,15],inclusive:!1},type_directive:{rules:[7,8,14,15],inclusive:!1},open_directive:{rules:[6,14,15],inclusive:!1},struct:{rules:[14,15,27,31,37,44,45,46,47,56,57,58,59,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[66],inclusive:!1},FLOATING_NOTE:{rules:[63,64,65],inclusive:!1},NOTE_TEXT:{rules:[68,69],inclusive:!1},NOTE_ID:{rules:[67],inclusive:!1},NOTE:{rules:[60,61,62],inclusive:!1},CLASS_STYLE:{rules:[33],inclusive:!1},CLASS:{rules:[32],inclusive:!1},CLASSDEFID:{rules:[30],inclusive:!1},CLASSDEF:{rules:[28,29],inclusive:!1},acc_descr_multiline:{rules:[25,26],inclusive:!1},acc_descr:{rules:[23],inclusive:!1},acc_title:{rules:[21],inclusive:!1},SCALE:{rules:[18,19,35,36],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[50],inclusive:!1},STATE_STRING:{rules:[51,52],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[14,15,38,39,40,41,42,43,48,49,53,54,55],inclusive:!1},ID:{rules:[14,15],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,10,11,12,13,15,16,17,20,22,24,27,31,34,37,55,59,70,71,72,73,74,75,76,78,79,80],inclusive:!0}}};return t}();function N(){this.yy={}}return O.lexer=$,N.prototype=O,O.Parser=N,new N}();Ph.parser=Ph;const zh=Ph,jh=(t,e)=>{var i;return"dagre-wrapper"!==(null==(i=null==e?void 0:e.state)?void 0:i.defaultRenderer)&&null!==t.match(/^\s*stateDiagram/)},Yh=(t,e)=>{var i;return null!==t.match(/^\s*stateDiagram-v2/)||!(!t.match(/^\s*stateDiagram/)||"dagre-wrapper"!==(null==(i=null==e?void 0:e.state)?void 0:i.defaultRenderer))},Wh="state",Uh="relation",qh="default",Vh="divider",Hh="[*]",Gh="start",Xh=Hh,Kh="color",Qh="fill";let Zh="LR",Jh=[],td={};let ed={root:{relations:[],states:{},documents:{}}},id=ed.root,rd=0,nd=0;const sd=t=>JSON.parse(JSON.stringify(t)),ad=(t,e,i)=>{if(e.stmt===Uh)ad(t,e.state1,!0),ad(t,e.state2,!1);else if(e.stmt===Wh&&("[*]"===e.id?(e.id=i?t.id+"_start":t.id+"_end",e.start=i):e.id=e.id.trim()),e.doc){const t=[];let i,r=[];for(i=0;i0&&r.length>0){const i={stmt:Wh,id:Bi(),type:"divider",doc:sd(r)};t.push(sd(i)),e.doc=t}e.doc.forEach((t=>ad(e,t,!0)))}},od=function(t,e=qh,i=null,r=null,n=null,s=null,a=null,o=null){const l=null==t?void 0:t.trim();if(void 0===id.states[l]?(Tt.info("Adding state ",l,r),id.states[l]={id:l,descriptions:[],type:e,doc:i,note:n,classes:[],styles:[],textStyles:[]}):(id.states[l].doc||(id.states[l].doc=i),id.states[l].type||(id.states[l].type=e)),r&&(Tt.info("Setting state description",l,r),"string"==typeof r&&pd(l,r.trim()),"object"==typeof r&&r.forEach((t=>pd(l,t.trim())))),n&&(id.states[l].note=n,id.states[l].note.text=Ot.sanitizeText(id.states[l].note.text,Zi())),s){Tt.info("Setting state classes",l,s);("string"==typeof s?[s]:s).forEach((t=>yd(l,t.trim())))}if(a){Tt.info("Setting state styles",l,a);("string"==typeof a?[a]:a).forEach((t=>fd(l,t.trim())))}if(o){Tt.info("Setting state styles",l,a);("string"==typeof o?[o]:o).forEach((t=>md(l,t.trim())))}},ld=function(t){ed={root:{relations:[],states:{},documents:{}}},id=ed.root,rd=0,td={},t||vr()},cd=function(t){return id.states[t]};function hd(t=""){let e=t;return t===Hh&&(rd++,e=`${Gh}${rd}`),e}function dd(t="",e=qh){return t===Hh?Gh:e}const ud=function(t,e,i){if("object"==typeof t)!function(t,e,i){let r=hd(t.id.trim()),n=dd(t.id.trim(),t.type),s=hd(e.id.trim()),a=dd(e.id.trim(),e.type);od(r,n,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),od(s,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),id.relations.push({id1:r,id2:s,relationTitle:Ot.sanitizeText(i,Zi())})}(t,e,i);else{const r=hd(t.trim()),n=dd(t),s=function(t=""){let e=t;return t===Xh&&(rd++,e=`end${rd}`),e}(e.trim()),a=function(t="",e=qh){return t===Xh?"end":e}(e);od(r,n),od(s,a),id.relations.push({id1:r,id2:s,title:Ot.sanitizeText(i,Zi())})}},pd=function(t,e){const i=id.states[t],r=e.startsWith(":")?e.replace(":","").trim():e;i.descriptions.push(Ot.sanitizeText(r,Zi()))},gd=function(t,e=""){void 0===td[t]&&(td[t]={id:t,styles:[],textStyles:[]});const i=td[t];null!=e&&e.split(",").forEach((t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(t.match(Kh)){const t=e.replace(Qh,"bgFill").replace(Kh,Qh);i.textStyles.push(t)}i.styles.push(e)}))},yd=function(t,e){t.split(",").forEach((function(t){let i=cd(t);if(void 0===i){const e=t.trim();od(e),i=cd(e)}i.classes.push(e)}))},fd=function(t,e){const i=cd(t);void 0!==i&&i.textStyles.push(e)},md=function(t,e){const i=cd(t);void 0!==i&&i.textStyles.push(e)},bd={parseDirective:function(t,e,i){np.parseDirective(this,t,e,i)},getConfig:()=>Zi().state,addState:od,clear:ld,getState:cd,getStates:function(){return id.states},getRelations:function(){return id.relations},getClasses:function(){return td},getDirection:()=>Zh,addRelation:ud,getDividerId:()=>(nd++,"divider-id-"+nd),setDirection:t=>{Zh=t},cleanupLabel:function(t){return":"===t.substring(0,1)?t.substr(2).trim():t.trim()},lineType:{LINE:0,DOTTED_LINE:1},relationType:{AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},logDocuments:function(){Tt.info("Documents = ",ed)},getRootDoc:()=>Jh,setRootDoc:t=>{Tt.info("Setting root doc",t),Jh=t},getRootDocV2:()=>(ad({id:"root"},{id:"root",doc:Jh},!0),{id:"root",doc:Jh}),extract:t=>{let e;e=t.doc?t.doc:t,Tt.info(e),ld(!0),Tt.info("Extract",e),e.forEach((t=>{switch(t.stmt){case Wh:od(t.id.trim(),t.type,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles);break;case Uh:ud(t.state1,t.state2,t.description);break;case"classDef":gd(t.id.trim(),t.classes);break;case"applyClass":yd(t.id.trim(),t.styleClass)}}))},trimColon:t=>t&&":"===t[0]?t.substr(1).trim():t.trim(),getAccTitle:wr,setAccTitle:Sr,getAccDescription:Br,setAccDescription:Ar,addStyleClass:gd,setCssClass:yd,addDescription:pd,setDiagramTitle:Lr,getDiagramTitle:Dr},xd=(t,e)=>{const i=t.append("text").attr("x",2*Zi().state.padding).attr("y",Zi().state.textHeight+1.3*Zi().state.padding).attr("font-size",Zi().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),r=i.height,n=t.append("text").attr("x",Zi().state.padding).attr("y",r+.4*Zi().state.padding+Zi().state.dividerMargin+Zi().state.textHeight).attr("class","state-description");let s=!0,a=!0;e.descriptions.forEach((function(t){s||(!function(t,e,i){const r=t.append("tspan").attr("x",2*Zi().state.padding).text(e);i||r.attr("dy",Zi().state.textHeight)}(n,t,a),a=!1),s=!1}));const o=t.append("line").attr("x1",Zi().state.padding).attr("y1",Zi().state.padding+r+Zi().state.dividerMargin/2).attr("y2",Zi().state.padding+r+Zi().state.dividerMargin/2).attr("class","descr-divider"),l=n.node().getBBox(),c=Math.max(l.width,i.width);return o.attr("x2",c+3*Zi().state.padding),t.insert("rect",":first-child").attr("x",Zi().state.padding).attr("y",Zi().state.padding).attr("width",c+2*Zi().state.padding).attr("height",l.height+r+2*Zi().state.padding).attr("rx",Zi().state.radius),t},kd=(t,e,i)=>{const r=Zi().state.padding,n=2*Zi().state.padding,s=t.node().getBBox(),a=s.width,o=s.x,l=t.append("text").attr("x",0).attr("y",Zi().state.titleShift).attr("font-size",Zi().state.fontSize).attr("class","state-title").text(e.id),c=l.node().getBBox().width+n;let h,d=Math.max(c,a);d===a&&(d+=n);const u=t.node().getBBox();e.doc,h=o-r,c>a&&(h=(a-d)/2+r),Math.abs(o-u.x)a&&(h=o-(c-a)/2);const p=1-Zi().state.textHeight;return t.insert("rect",":first-child").attr("x",h).attr("y",p).attr("class",i?"alt-composit":"composit").attr("width",d).attr("height",u.height+Zi().state.textHeight+Zi().state.titleShift+1).attr("rx","0"),l.attr("x",h+r),c<=a&&l.attr("x",o+(d-n)/2-c/2+r),t.insert("rect",":first-child").attr("x",h).attr("y",Zi().state.titleShift-Zi().state.textHeight-Zi().state.padding).attr("width",d).attr("height",3*Zi().state.textHeight).attr("rx",Zi().state.radius),t.insert("rect",":first-child").attr("x",h).attr("y",Zi().state.titleShift-Zi().state.textHeight-Zi().state.padding).attr("width",d).attr("height",u.height+3+2*Zi().state.textHeight).attr("rx",Zi().state.radius),t},_d=(t,e)=>{e.attr("class","state-note");const i=e.append("rect").attr("x",0).attr("y",Zi().state.padding),r=e.append("g"),{textWidth:n,textHeight:s}=((t,e,i,r)=>{let n=0;const s=r.append("text");s.style("text-anchor","start"),s.attr("class","noteText");let a=t.replace(/\r\n/g,"
");a=a.replace(/\n/g,"
");const o=a.split(Ot.lineBreakRegex);let l=1.25*Zi().state.noteMargin;for(const c of o){const t=c.trim();if(t.length>0){const r=s.append("tspan");r.text(t),0===l&&(l+=r.node().getBBox().height),n+=l,r.attr("x",e+Zi().state.noteMargin),r.attr("y",i+n+1.25*Zi().state.noteMargin)}}return{textWidth:s.node().getBBox().width,textHeight:n}})(t,0,0,r);return i.attr("height",s+2*Zi().state.noteMargin),i.attr("width",n+2*Zi().state.noteMargin),i},Cd=function(t,e){const i=e.id,r={id:i,label:e.id,width:0,height:0},n=t.append("g").attr("id",i).attr("class","stateGroup");"start"===e.type&&(t=>{t.append("circle").attr("class","start-state").attr("r",Zi().state.sizeUnit).attr("cx",Zi().state.padding+Zi().state.sizeUnit).attr("cy",Zi().state.padding+Zi().state.sizeUnit)})(n),"end"===e.type&&(t=>{t.append("circle").attr("class","end-state-outer").attr("r",Zi().state.sizeUnit+Zi().state.miniPadding).attr("cx",Zi().state.padding+Zi().state.sizeUnit+Zi().state.miniPadding).attr("cy",Zi().state.padding+Zi().state.sizeUnit+Zi().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",Zi().state.sizeUnit).attr("cx",Zi().state.padding+Zi().state.sizeUnit+2).attr("cy",Zi().state.padding+Zi().state.sizeUnit+2)})(n),"fork"!==e.type&&"join"!==e.type||((t,e)=>{let i=Zi().state.forkWidth,r=Zi().state.forkHeight;if(e.parentId){let t=i;i=r,r=t}t.append("rect").style("stroke","black").style("fill","black").attr("width",i).attr("height",r).attr("x",Zi().state.padding).attr("y",Zi().state.padding)})(n,e),"note"===e.type&&_d(e.note.text,n),"divider"===e.type&&(t=>{t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",Zi().state.textHeight).attr("class","divider").attr("x2",2*Zi().state.textHeight).attr("y1",0).attr("y2",0)})(n),"default"===e.type&&0===e.descriptions.length&&((t,e)=>{const i=t.append("text").attr("x",2*Zi().state.padding).attr("y",Zi().state.textHeight+2*Zi().state.padding).attr("font-size",Zi().state.fontSize).attr("class","state-title").text(e.id),r=i.node().getBBox();t.insert("rect",":first-child").attr("x",Zi().state.padding).attr("y",Zi().state.padding).attr("width",r.width+2*Zi().state.padding).attr("height",r.height+2*Zi().state.padding).attr("rx",Zi().state.radius)})(n,e),"default"===e.type&&e.descriptions.length>0&&xd(n,e);const s=n.node().getBBox();return r.width=s.width+2*Zi().state.padding,r.height=s.height+2*Zi().state.padding,r};let Td=0;let Ed;const vd={},Sd=(t,e,i,r,n,s,l)=>{const c=new a({compound:!0,multigraph:!0});let h,d=!0;for(h=0;h{const e=t.parentElement;let i=0,r=0;e&&(e.parentElement&&(i=e.parentElement.getBBox().width),r=parseInt(e.getAttribute("data-x-shift"),10),Number.isNaN(r)&&(r=0)),t.setAttribute("x1",0-r+8),t.setAttribute("x2",i-r-8)}))}else Tt.debug("No Node "+t+": "+JSON.stringify(c.node(t)))}));let m=f.getBBox();c.edges().forEach((function(t){void 0!==t&&void 0!==c.edge(t)&&(Tt.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(c.edge(t))),function(t,e,i){e.points=e.points.filter((t=>!Number.isNaN(t.y)));const r=e.points,n=z().x((function(t){return t.x})).y((function(t){return t.y})).curve(R),s=t.append("path").attr("d",n(r)).attr("id","edge"+Td).attr("class","transition");let a="";if(Zi().state.arrowMarkerAbsolute&&(a=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,a=a.replace(/\(/g,"\\("),a=a.replace(/\)/g,"\\)")),s.attr("marker-end","url("+a+"#"+function(){switch(bd.relationType.DEPENDENCY){case bd.relationType.AGGREGATION:return"aggregation";case bd.relationType.EXTENSION:return"extension";case bd.relationType.COMPOSITION:return"composition";case bd.relationType.DEPENDENCY:return"dependency"}}()+"End)"),void 0!==i.title){const r=t.append("g").attr("class","stateLabel"),{x:n,y:s}=Yi.calcLabelPosition(e.points),a=Ot.getRows(i.title);let o=0;const l=[];let c=0,h=0;for(let t=0;t<=a.length;t++){const e=r.append("text").attr("text-anchor","middle").text(a[t]).attr("x",n).attr("y",s+o),i=e.node().getBBox();if(c=Math.max(c,i.width),h=Math.min(h,i.x),Tt.info(i.x,n,s+o),0===o){const t=e.node().getBBox();o=t.height,Tt.info("Title height",o,s)}l.push(e)}let d=o*a.length;if(a.length>1){const t=(a.length-1)*o*.5;l.forEach(((e,i)=>e.attr("y",s+i*o-t))),d=o*a.length}const u=r.node().getBBox();r.insert("rect",":first-child").attr("class","box").attr("x",n-c/2-Zi().state.padding/2).attr("y",s-d/2-Zi().state.padding/2-3.5).attr("width",c+Zi().state.padding).attr("height",d+Zi().state.padding),Tt.info(u)}Td++}(e,c.edge(t),c.edge(t).relation))})),m=f.getBBox();const b={id:i||"root",label:i||"root",width:0,height:0};return b.width=m.width+2*Ed.padding,b.height=m.height+2*Ed.padding,Tt.debug("Doc rendered",b,c),b},wd={setConf:function(){},draw:function(t,e,i,r){Ed=Zi().state;const n=Zi().securityLevel;let s;"sandbox"===n&&(s=f("#i"+e));const o=f("sandbox"===n?s.nodes()[0].contentDocument.body:"body"),l="sandbox"===n?s.nodes()[0].contentDocument:document;Tt.debug("Rendering diagram "+t);const c=o.select(`[id='${e}']`);c.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z");new a({multigraph:!0,compound:!0, +// acyclicer: 'greedy', +rankdir:"RL"}).setDefaultEdgeLabel((function(){return{}}));const h=r.db.getRootDoc();Sd(h,c,void 0,!1,o,l,r);const d=Ed.padding,u=c.node().getBBox(),p=u.width+2*d,g=u.height+2*d;sr(c,g,1.75*p,Ed.useMaxWidth),c.attr("viewBox",`${u.x-Ed.padding} ${u.y-Ed.padding} `+p+" "+g)}},Ad="rect",Bd="rectWithTitle",Ld="statediagram",Dd=`${Ld}-state`,Id="transition",Od=`${Id} note-edge`,$d=`${Ld}-note`,Nd=`${Ld}-cluster`,Fd=`${Ld}-cluster-alt`,Rd="parent",Md="note",Pd="----",zd=`${Pd}${Md}`,jd=`${Pd}${Rd}`,Yd="fill:none",Wd="fill: #333",Ud="text",qd="normal";let Vd={},Hd=0;function Gd(t="",e=0,i="",r=Pd){return`state-${t}${null!==i&&i.length>0?`${r}${i}`:""}-${e}`}const Xd=(t,e,i,r,n,s)=>{const a=i.id,o=null==(l=r[a])?"":l.classes?l.classes.join(" "):"";var l;if("root"!==a){let e=Ad;!0===i.start&&(e="start"),!1===i.start&&(e="end"),i.type!==qh&&(e=i.type),Vd[a]||(Vd[a]={id:a,shape:e,description:Ot.sanitizeText(a,Zi()),classes:`${o} ${Dd}`});const r=Vd[a];i.description&&(Array.isArray(r.description)?(r.shape=Bd,r.description.push(i.description)):r.description.length>0?(r.shape=Bd,r.description===a?r.description=[i.description]:r.description=[r.description,i.description]):(r.shape=Ad,r.description=i.description),r.description=Ot.sanitizeTextOrArray(r.description,Zi())),1===r.description.length&&r.shape===Bd&&(r.shape=Ad),!r.type&&i.doc&&(Tt.info("Setting cluster for ",a,Qd(i)),r.type="group",r.dir=Qd(i),r.shape=i.type===Vh?"divider":"roundedWithTitle",r.classes=r.classes+" "+Nd+" "+(s?Fd:""));const n={labelStyle:"",shape:r.shape,labelText:r.description, +// typeof newNode.description === 'object' +// ? newNode.description[0] +// : newNode.description, +classes:r.classes,style:"", +//styles.style, +id:a,dir:r.dir,domId:Gd(a,Hd),type:r.type,padding:15};if(i.note){const e={labelStyle:"",shape:"note",labelText:i.note.text,classes:$d,style:"", +// styles.style, +id:a+zd+"-"+Hd,domId:Gd(a,Hd,Md),type:r.type,padding:15},s={labelStyle:"",shape:"noteGroup",labelText:i.note.text,classes:r.classes,style:"", +// styles.style, +id:a+jd,domId:Gd(a,Hd,Rd),type:"group",padding:0};Hd++;const o=a+jd;t.setNode(o,s),t.setNode(e.id,e),t.setNode(a,n),t.setParent(a,o),t.setParent(e.id,o);let l=a,c=e.id;"left of"===i.note.position&&(l=e.id,c=a),t.setEdge(l,c,{arrowhead:"none",arrowType:"",style:Yd,labelStyle:"",classes:Od,arrowheadStyle:Wd,labelpos:"c",labelType:Ud,thickness:qd})}else t.setNode(a,n)}e&&"root"!==e.id&&(Tt.trace("Setting node ",a," to be child of its parent ",e.id),t.setParent(a,e.id)),i.doc&&(Tt.trace("Adding nodes children "),Kd(t,i,i.doc,r,n,!s))},Kd=(t,e,i,r,n,s)=>{Tt.trace("items",i),i.forEach((i=>{switch(i.stmt){case Wh:case qh:Xd(t,e,i,r,n,s);break;case Uh:{Xd(t,e,i.state1,r,n,s),Xd(t,e,i.state2,r,n,s);const a={id:"edge"+Hd,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:Yd,labelStyle:"",label:Ot.sanitizeText(i.description,Zi()),arrowheadStyle:Wd,labelpos:"c",labelType:Ud,thickness:qd,classes:Id};t.setEdge(i.state1.id,i.state2.id,a,Hd),Hd++}}}))},Qd=(t,e="TB")=>{let i=e;if(t.doc)for(let r=0;r2&&T.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[f]||f,line:d.yylineno,loc:g,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+f);switch(b[0]){case 1:i.push(f),n.push(d.yytext),s.push(d.yylloc),i.push(b[1]),f=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(_=this.productions_[b[1]][1],v.$=n[n.length-_],v._$={first_line:s[s.length-(_||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(_||1)].first_column,last_column:s[s.length-1].last_column},y&&(v._$.range=[s[s.length-(_||1)].range[0],s[s.length-1].range[1]]),void 0!==(x=this.performAction.apply(v,[o,c,l,u.yy,b[1],n,s].concat(h))))return x;_&&(i=i.slice(0,-1*_*2),n=n.slice(0,-1*_),s=s.slice(0,-1*_)),i.push(this.productions_[b[1]][0]),n.push(v.$),s.push(v._$),C=a[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},p=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}, +// resets the lexer, sets new input +setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}, +// consumes and returns one char from the input +input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}, +// unshifts one char (or a string) into the input +unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===r.length?this.yylloc.first_column:0)+r[r.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}, +// When called from action, caches matched text and appends it on next action +more:function(){return this._more=!0,this}, +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// retain first n characters of the match +less:function(t){this.unput(this.match.slice(t))}, +// displays already matched input, i.e. for error messages +pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}, +// displays upcoming input, i.e. for error messages +upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}, +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}, +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(t,e){var i,r,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var s in n)this[s]=n[s];return!1}return!1}, +// return next match in input +next:function(){if(this.done)return this.EOF;var t,e,i,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),s=0;se[0].length)){if(e=i,r=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// return next match that has a token +lex:function(){var t=this.next();return t||this.lex()}, +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function(t){this.conditionStack.push(t)}, +// pop the previously active lexer condition state off the condition stack +popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}, +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}, +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}, +// alias for begin(condition) +pushState:function(t){this.begin(t)}, +// return the number of states currently on the stack +stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,i,r){switch(i){case 0:return this.begin("open_directive"),26;case 1:return this.begin("type_directive"),27;case 2:return this.popState(),this.begin("arg_directive"),15;case 3:return this.popState(),this.popState(),29;case 4:return 28;case 5:case 6:case 8:case 9:break;case 7:return 11;case 10:return 4;case 11:return 17;case 12:return this.begin("acc_title"),18;case 13:return this.popState(),"acc_title_value";case 14:return this.begin("acc_descr"),20;case 15:return this.popState(),"acc_descr_value";case 16:this.begin("acc_descr_multiline");break;case 17:this.popState();break;case 18:return"acc_descr_multiline_value";case 19:return 23;case 20:return 24;case 21:return 25;case 22:return 15;case 23:return 6;case 24:return"INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{open_directive:{rules:[1],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},acc_descr_multiline:{rules:[17,18],inclusive:!1},acc_descr:{rules:[15],inclusive:!1},acc_title:{rules:[13],inclusive:!1},INITIAL:{rules:[0,5,6,7,8,9,10,11,12,14,16,19,20,21,22,23,24],inclusive:!0}}};return t}();function g(){this.yy={}}return u.lexer=p,g.prototype=u,u.Parser=g,new g}();Jd.parser=Jd;const tu=Jd,eu=t=>null!==t.match(/^\s*journey/);let iu="";const ru=[],nu=[],su=[],au=function(){let t=!0;for(const[e,i]of su.entries())su[e].processed,t=t&&i.processed;return t},ou={parseDirective:function(t,e,i){np.parseDirective(this,t,e,i)},getConfig:()=>Zi().journey,clear:function(){ru.length=0,nu.length=0,iu="",su.length=0,vr()},setDiagramTitle:Lr,getDiagramTitle:Dr,setAccTitle:Sr,getAccTitle:wr,setAccDescription:Ar,getAccDescription:Br,addSection:function(t){iu=t,ru.push(t)},getSections:function(){return ru},getTasks:function(){let t=au();let e=0;for(;!t&&e<100;)t=au(),e++;return nu.push(...su),nu},addTask:function(t,e){const i=e.substr(1).split(":");let r=0,n=[];1===i.length?(r=Number(i[0]),n=[]):(r=Number(i[0]),n=i[1].split(","));const s=n.map((t=>t.trim())),a={section:iu,type:iu,people:s,task:t,score:r};su.push(a)},addTaskOrg:function(t){const e={section:iu,type:iu,description:t,task:t,classes:[]};nu.push(e)},getActors:function(){return function(){const t=[];return nu.forEach((e=>{e.people&&t.push(...e.people)})),[...new Set(t)].sort()}()}},lu=function(t,e){const i=t.append("rect");return i.attr("x",e.x),i.attr("y",e.y),i.attr("fill",e.fill),i.attr("stroke",e.stroke),i.attr("width",e.width),i.attr("height",e.height),i.attr("rx",e.rx),i.attr("ry",e.ry),void 0!==e.class&&i.attr("class",e.class),i},cu=function(t,e){const i=t.append("circle");return i.attr("cx",e.cx),i.attr("cy",e.cy),i.attr("class","actor-"+e.pos),i.attr("fill",e.fill),i.attr("stroke",e.stroke),i.attr("r",e.r),void 0!==i.class&&i.attr("class",i.class),void 0!==e.title&&i.append("title").text(e.title),i},hu=function(t,e){const i=e.text.replace(//gi," "),r=t.append("text");r.attr("x",e.x),r.attr("y",e.y),r.attr("class","legend"),r.style("text-anchor",e.anchor),void 0!==e.class&&r.attr("class",e.class);const n=r.append("tspan");return n.attr("x",e.x+2*e.textMargin),n.text(i),r};let du=-1;const uu=function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},pu=function(){function t(t,e,i,n,s,a,o,l){r(e.append("text").attr("x",i+s/2).attr("y",n+a/2+5).style("font-color",l).style("text-anchor","middle").text(t),o)}function e(t,e,i,n,s,a,o,l,c){const{taskFontSize:h,taskFontFamily:d}=l,u=t.split(//gi);for(let p=0;p3?function(t){const r=P().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(i/2.2);t.append("path").attr("class","mouth").attr("d",r).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}(n):e.score<3?function(t){const r=P().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(i/2.2);t.append("path").attr("class","mouth").attr("d",r).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}(n):n.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}(n,{cx:r,cy:300+30*(5-e.score),score:e.score});const s=uu();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=i.width,s.height=i.height,s.class="task task-type-"+e.num,s.rx=3,s.ry=3,lu(n,s);let a=e.x+14;e.people.forEach((t=>{const i=e.actors[t].color,r={cx:a,cy:e.y,r:7,fill:i,stroke:"#000",title:t,pos:e.actors[t].position};cu(n,r),a+=10})),pu(i)(e.task,n,s.x,s.y,s.width,s.height,{class:"task"},i,e.colour)},bu=function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},xu={};const ku=Zi().journey,_u=ku.leftMargin,Cu={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},updateVal:function(t,e,i,r){void 0===t[e]?t[e]=i:t[e]=r(i,t[e])},updateBounds:function(t,e,i,r){const n=Zi().journey,s=this;let a=0;this.sequenceItems.forEach((function(o){a++;const l=s.sequenceItems.length-a+1;s.updateVal(o,"starty",e-l*n.boxMargin,Math.min),s.updateVal(o,"stopy",r+l*n.boxMargin,Math.max),s.updateVal(Cu.data,"startx",t-l*n.boxMargin,Math.min),s.updateVal(Cu.data,"stopx",i+l*n.boxMargin,Math.max),s.updateVal(o,"startx",t-l*n.boxMargin,Math.min),s.updateVal(o,"stopx",i+l*n.boxMargin,Math.max),s.updateVal(Cu.data,"starty",e-l*n.boxMargin,Math.min),s.updateVal(Cu.data,"stopy",r+l*n.boxMargin,Math.max)}))},insert:function(t,e,i,r){const n=Math.min(t,i),s=Math.max(t,i),a=Math.min(e,r),o=Math.max(e,r);this.updateVal(Cu.data,"startx",n,Math.min),this.updateVal(Cu.data,"starty",a,Math.min),this.updateVal(Cu.data,"stopx",s,Math.max),this.updateVal(Cu.data,"stopy",o,Math.max),this.updateBounds(n,a,s,o)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return this.data}},Tu=ku.sectionFills,Eu=ku.sectionColours,vu=function(t,e,i){const r=Zi().journey;let n="";const s=i+(2*r.height+r.diagramMarginY);let a=0,o="#CCC",l="black",c=0;for(const[h,d]of e.entries()){if(n!==d.section){o=Tu[a%Tu.length],c=a%Tu.length,l=Eu[a%Eu.length];const e={x:h*r.taskMargin+h*r.width+_u,y:50,text:d.section,fill:o,num:c,colour:l};yu(t,e,r),n=d.section,a++}const e=d.people.reduce(((t,e)=>(xu[e]&&(t[e]=xu[e]),t)),{});d.x=h*r.taskMargin+h*r.width+_u,d.y=s,d.width=r.diagramMarginX,d.height=r.diagramMarginY,d.colour=l,d.fill=o,d.num=c,d.actors=e,mu(t,d,r),Cu.insert(d.x,d.y,d.x+d.width+r.taskMargin,450)}},Su={setConf:function(t){Object.keys(t).forEach((function(e){ku[e]=t[e]}))},draw:function(t,e,i,r){const n=Zi().journey;r.db.clear(),r.parser.parse(t+"\n");const s=Zi().securityLevel;let a;"sandbox"===s&&(a=f("#i"+e));const o=f("sandbox"===s?a.nodes()[0].contentDocument.body:"body");Cu.init();const l=o.select("#"+e);bu(l);const c=r.db.getTasks(),h=r.db.getDiagramTitle(),d=r.db.getActors();for(const f in xu)delete xu[f];let u=0;d.forEach((t=>{xu[t]={color:n.actorColours[u%n.actorColours.length],position:u},u++})),function(t){const e=Zi().journey;let i=60;Object.keys(xu).forEach((r=>{const n=xu[r].color,s={cx:20,cy:i,r:7,fill:n,stroke:"#000",pos:xu[r].position};gu(t,s);const a={x:40,y:i+7,fill:"#666",text:r,textMargin:5|e.boxTextMargin};fu(t,a),i+=20}))}(l),Cu.insert(0,0,_u,50*Object.keys(xu).length),vu(l,c,0);const p=Cu.getBounds();h&&l.append("text").text(h).attr("x",_u).attr("font-size","4ex").attr("font-weight","bold").attr("y",25);const g=p.stopy-p.starty+2*n.diagramMarginY,y=_u+p.stopx+2*n.diagramMarginX;sr(l,g,y,n.useMaxWidth),l.append("line").attr("x1",_u).attr("y1",4*n.height).attr("x2",y-_u-4).attr("y2",4*n.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const m=h?70:0;l.attr("viewBox",`${p.startx} -25 ${y} ${g+m}`),l.attr("preserveAspectRatio","xMinYMin meet"),l.attr("height",g+m+25)}};let wu={};const Au={setConf:function(t){wu={...wu,...t}},draw:(t,e,i)=>{try{Tt.debug("Renering svg for syntax error\n");const t=f("#"+e),r=t.append("g");r.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),r.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),r.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),r.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),r.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),r.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),r.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in graph"),r.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text("mermaid version "+i),t.attr("height",100),t.attr("width",500),t.attr("viewBox","768 0 912 512")}catch(n){Tt.error("Error while rendering info diagram"),Tt.error((r=n)instanceof Error?r.message:String(r))}var r}},Bu="flowchart-elk",Lu={id:Bu,detector:(t,e)=>{var i; +// If diagram explicitly states flowchart-elk +return!!(t.match(/^\s*flowchart-elk/)||// If a flowchart/graph diagram has their default renderer set to elk +t.match(/^\s*flowchart|graph/)&&"elk"===(null==(i=null==e?void 0:e.flowchart)?void 0:i.defaultRenderer))},loader:async()=>{const{diagram:t}=await H((async()=>{const{diagram:t}=await Promise.resolve().then((()=>Sp));return{diagram:t}}),void 0,import.meta.url);return{id:Bu,diagram:t}}},Du="timeline",Iu={id:Du,detector:t=>null!==t.match(/^\s*timeline/),loader:async()=>{const{diagram:t}=await H((async()=>{const{diagram:t}=await Promise.resolve().then((()=>ig));return{diagram:t}}),void 0,import.meta.url);return{id:Du,diagram:t}}},Ou="mindmap",$u={id:Ou,detector:t=>null!==t.match(/^\s*mindmap/),loader:async()=>{const{diagram:t}=await H((async()=>{const{diagram:t}=await Promise.resolve().then((()=>Tg));return{diagram:t}}),void 0,import.meta.url);return{id:Ou,diagram:t}}};let Nu=!1;const Fu=()=>{Nu||(Nu=!0,mi(Lu,Iu,$u),Ur("error", +// Special diagram with error messages but setup as a regular diagram +{db:{clear:()=>{}},styles:cr,renderer:Au,parser:{parser:{yy:{}},parse:()=>{}},init:()=>{}},(t=>"error"===t.toLowerCase().trim())),Ur("---", +// --- diagram type may appear if YAML front-matter is not parsed correctly +{db:{clear:()=>{}},styles:cr, +// should never be used +renderer:Au, +// should never be used +parser:{parser:{yy:{}},parse:()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with unindented `---` blocks")}},init:()=>null},(t=>t.toLowerCase().trimStart().startsWith("---"))),Ur("c4",{parser:Ln,db:qn,renderer:Ts,styles:br,init:t=>{Ts.setConf(t.c4)}},Dn),Ur("class",{parser:vs,db:Ws,renderer:ia,styles:or,init:t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute,Ws.clear()}},Ss),Ur("classDiagram",{parser:vs,db:Ws,renderer:Wa,styles:or,init:t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute,Ws.clear()}},ws),Ur("er",{parser:qa,db:Ka,renderer:lo,styles:lr},Va),Ur("gantt",{parser:bl,db:Ql,renderer:tc,styles:dr},xl),Ur("info",{parser:ic,db:sc,renderer:ac,styles:ur},oc),Ur("pie",{parser:cc,db:pc,renderer:mc,styles:pr},hc),Ur("requirement",{parser:xc,db:Sc,renderer:Rc,styles:gr},kc),Ur("sequence",{parser:Pc,db:ah,renderer:Mh,styles:yr,init:t=>{if(t.sequence||(t.sequence={}),t.sequence.arrowMarkerAbsolute=t.arrowMarkerAbsolute,"sequenceDiagram"in t)throw new Error("`mermaid config.sequenceDiagram` has been renamed to `config.sequence`. Please update your mermaid config.");ah.setWrap(t.wrap),Mh.setConf(t.sequence)}},zc),Ur("state",{parser:zh,db:bd,renderer:wd,styles:fr,init:t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute,bd.clear()}},jh),Ur("stateDiagram",{parser:zh,db:bd,renderer:Zd,styles:fr,init:t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute,bd.clear()}},Yh),Ur("journey",{parser:tu,db:ou,renderer:Su,styles:mr,init:t=>{Su.setConf(t.journey),ou.clear()}},eu),Ur("flowchart",{parser:ho,db:cl,renderer:fl,styles:hr,init:t=>{t.flowchart||(t.flowchart={}),t.flowchart.arrowMarkerAbsolute=t.arrowMarkerAbsolute,ul(t.flowchart),cl.clear(),cl.setGen("gen-1")}},uo),Ur("flowchart-v2",{parser:ho,db:cl,renderer:fl,styles:hr,init:t=>{t.flowchart||(t.flowchart={}),t.flowchart.arrowMarkerAbsolute=t.arrowMarkerAbsolute,Qi({flowchart:{arrowMarkerAbsolute:t.arrowMarkerAbsolute}}),fl.setConf(t.flowchart),cl.clear(),cl.setGen("gen-2")}},po),Ur("gitGraph",{parser:Hr,db:un,renderer:wn,styles:An},Gr))};class Ru{constructor(t,e){var i,r;this.txt=t,this.type="graph",this.detectTypeFailed=!1;const n=Zi();this.txt=t;try{this.type=fi(t,n)}catch(o){this.handleError(o,e),this.type="error",this.detectTypeFailed=!0}const s=qr(this.type);Tt.debug("Type "+this.type),this.db=s.db,null==(r=(i=this.db).clear)||r.call(i),this.renderer=s.renderer,this.parser=s.parser;const a=this.parser.parse.bind(this.parser);this.parser.parse=t=>a(function(t,e){var i;const r=t.match(ui);if(r){const n=di(r[1],{ +// To keep things simple, only allow strings, arrays, and plain objects. +// https://www.yaml.org/spec/1.2/spec.html#id2802346 +schema:hi});return(null==n?void 0:n.title)&&(null==(i=e.setDiagramTitle)||i.call(e,n.title)),t.slice(r[0].length)}return t}(t,this.db)),this.parser.parser.yy=this.db,s.init&&(s.init(n),Tt.info("Initialized diagram "+this.type,n)),this.txt+="\n",this.parse(this.txt,e)}parse(t,e){var i,r;if(this.detectTypeFailed)return!1;try{return t+="\n",null==(r=(i=this.db).clear)||r.call(i),this.parser.parse(t),!0}catch(n){this.handleError(n,e)}return!1}handleError(t,e){if(void 0===e)throw t;zi(t)?e(t.str,t.hash):e(t)}getParser(){return this.parser}getType(){return this.type}}const Mu=(t,e)=>{const i=fi(t,Zi());try{qr(i)}catch(r){const n=yi[i].loader;if(!n)throw new Error(`Diagram ${i} not found.`);return n().then((({diagram:r})=>(Ur(i,r,void 0),new Ru(t,e))))}return new Ru(t,e)},Pu=Ru;const zu=["graph","flowchart","flowchart-v2","stateDiagram","stateDiagram-v2"],ju="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",Yu="sandbox",Wu="loose",Uu="http://www.w3.org/1999/xlink",qu="http://www.w3.org/1999/xhtml",Vu=["foreignobject"],Hu=["dominant-baseline"];const Gu=function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,(function(t){return t.substring(0,t.length-1)})),e=e.replace(/classDef.*:\S*#.*;/g,(function(t){return t.substring(0,t.length-1)})),e=e.replace(/#\w+;/g,(function(t){const e=t.substring(1,t.length-1);return/^\+?\d+$/.test(e)?"fl°°"+e+"¶ß":"fl°"+e+"¶ß"})),e},Xu=function(t){let e=t;return e=e.replace(/fl°°/g,"&#"),e=e.replace(/fl°/g,"&"),e=e.replace(/¶ß/g,";"),e},Ku=(t,e,i=[])=>`\n.${t} ${e} { ${i.join(" !important; ")} !important; }`,Qu=(t,e,i,r)=>{const n=((t,e,i={})=>{var r;let n="";if(void 0!==t.themeCSS&&(n+=`\n${t.themeCSS}`),void 0!==t.fontFamily&&(n+=`\n:root { --mermaid-font-family: ${t.fontFamily}}`),void 0!==t.altFontFamily&&(n+=`\n:root { --mermaid-alt-font-family: ${t.altFontFamily}}`),!K(i)&&zu.includes(e)){const e=t.htmlLabels||(null==(r=t.flowchart)?void 0:r.htmlLabels)?["> *","span"]:["rect","polygon","ellipse","circle","path"];for(const t in i){const r=i[t];K(r.styles)||e.forEach((t=>{n+=Ku(r.id,t,r.styles)})),K(r.textStyles)||(n+=Ku(r.id,"tspan",r.textStyles))}}return n})(t,e,i),s=kr(e,n,t.themeVariables);return Q(Z(`${r}{${s}}`),J)},Zu=(t="",e,i)=>{let r=t;return i||e||(r=r.replace(/marker-end="url\(.*?#/g,'marker-end="url(#')),r=Xu(r),r=r.replace(/
/g,"
"),r},Ju=(t="",e)=>``,tp=(t,e,i,r,n)=>{const s=t.append("div");s.attr("id",i),r&&s.attr("style",r);const a=s.append("svg").attr("id",e).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg");return n&&a.attr("xmlns:xlink",n),a.append("g"),t};function ep(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}const ip=(t,e,i,r)=>{var n,s,a;null==(n=t.getElementById(e))||n.remove(),null==(s=t.getElementById(i))||s.remove(),null==(a=t.getElementById(r))||a.remove()};function rp(t,e,i,r){var n,s;s=t,(n=e).attr("role","graphics-document document"),K(s)||n.attr("aria-roledescription",s),function(t,e,i,r){if(void 0!==t.insert&&(e||i)){if(i){const e="chart-desc-"+r;t.attr("aria-describedby",e),t.insert("desc",":first-child").attr("id",e).text(i)}if(e){const i="chart-title-"+r;t.attr("aria-labelledby",i),t.insert("title",":first-child").attr("id",i).text(e)}}}(e,i,r,e.attr("id"))}const np=Object.freeze({render:function(t,e,i,r){var n,a,o,l;Fu(),er();const c=Yi.detectInit(e);c&&(Mi(c),tr(c));const h=Zi();Tt.debug(h),e.length>((null==h?void 0:h.maxTextSize)??5e4)&&(e=ju),e=e.replace(/\r\n?/g,"\n");const d="#"+t,u="i"+t,p="#"+u,g="d"+t,y="#"+g;let m=f("body");const b=h.securityLevel===Yu,x=h.securityLevel===Wu,k=h.fontFamily;if(void 0!==r){if(r&&(r.innerHTML=""),b){const t=ep(f(r),u);m=f(t.nodes()[0].contentDocument.body),m.node().style.margin=0}else m=f(r);tp(m,t,g,`font-family: ${k}`,Uu)}else{if(ip(document,t,g,u),b){const t=ep(f("body"),u);m=f(t.nodes()[0].contentDocument.body),m.node().style.margin=0}else m=f("body");tp(m,t,g)}let _,C;e=Gu(e);try{if(_=Mu(e),"then"in _)throw new Error("Diagram is a promise. Use renderAsync.")}catch(I){_=new Pu("error"),C=I}const T=m.select(y).node(),E=_.type,v=T.firstChild,S=v.firstChild,w=zu.includes(E)?_.renderer.getClasses(e,_):{},A=Qu(h,E, +// @ts-ignore convert renderer to TS. +w,d),B=document.createElement("style");B.innerHTML=A,v.insertBefore(B,S);try{_.renderer.draw(e,t,Wi,_)}catch(O){throw Au.draw(e,t,Wi),O}rp(E,m.select(`${y} svg`),null==(a=(n=_.db).getAccTitle)?void 0:a.call(n),null==(l=(o=_.db).getAccDescription)?void 0:l.call(o)),m.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",qu);let L=m.select(y).node().innerHTML;if(Tt.debug("config.arrowMarkerAbsolute",h.arrowMarkerAbsolute),L=Zu(L,b,Dt(h.arrowMarkerAbsolute)),b){const t=m.select(y+" svg").node();L=Ju(L,t)}else x||(L=s.sanitize(L,{ADD_TAGS:Vu,ADD_ATTR:Hu}));if(void 0!==i)switch(E){case"flowchart":case"flowchart-v2":i(L,cl.bindFunctions);break;case"gantt":i(L,Ql.bindFunctions);break;case"class":case"classDiagram":i(L,Ws.bindFunctions);break;default:i(L)}else Tt.debug("CB = undefined!");lh();const D=f(b?p:y).node();if(D&&"remove"in D&&D.remove(),C)throw C;return L},renderAsync:async function(t,e,i,r){var n,a,o,l;Fu(),er();const c=Yi.detectInit(e);c&&(Mi(c),tr(c));const h=Zi();Tt.debug(h),e.length>((null==h?void 0:h.maxTextSize)??5e4)&&(e=ju),e=e.replace(/\r\n?/g,"\n");const d="#"+t,u="i"+t,p="#"+u,g="d"+t,y="#"+g;let m=f("body");const b=h.securityLevel===Yu,x=h.securityLevel===Wu,k=h.fontFamily;if(void 0!==r){if(r&&(r.innerHTML=""),b){const t=ep(f(r),u);m=f(t.nodes()[0].contentDocument.body),m.node().style.margin=0}else m=f(r);tp(m,t,g,`font-family: ${k}`,Uu)}else{if(ip(document,t,g,u),b){const t=ep(f("body"),u);m=f(t.nodes()[0].contentDocument.body),m.node().style.margin=0}else m=f("body");tp(m,t,g)}let _,C;e=Gu(e);try{_=await Mu(e)}catch(I){_=new Pu("error"),C=I}const T=m.select(y).node(),E=_.type,v=T.firstChild,S=v.firstChild,w=zu.includes(E)?_.renderer.getClasses(e,_):{},A=Qu(h,E, +// @ts-ignore convert renderer to TS. +w,d),B=document.createElement("style");B.innerHTML=A,v.insertBefore(B,S);try{await _.renderer.draw(e,t,Wi,_)}catch(O){throw Au.draw(e,t,Wi),O}rp(E,m.select(`${y} svg`),null==(a=(n=_.db).getAccTitle)?void 0:a.call(n),null==(l=(o=_.db).getAccDescription)?void 0:l.call(o)),m.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",qu);let L=m.select(y).node().innerHTML;if(Tt.debug("config.arrowMarkerAbsolute",h.arrowMarkerAbsolute),L=Zu(L,b,Dt(h.arrowMarkerAbsolute)),b){const t=m.select(y+" svg").node();L=Ju(L,t)}else x||(L=s.sanitize(L,{ADD_TAGS:Vu,ADD_ATTR:Hu}));if(void 0!==i)switch(E){case"flowchart":case"flowchart-v2":i(L,cl.bindFunctions);break;case"gantt":i(L,Ql.bindFunctions);break;case"class":case"classDiagram":i(L,Ws.bindFunctions);break;default:i(L)}else Tt.debug("CB = undefined!");lh();const D=f(b?p:y).node();if(D&&"remove"in D&&D.remove(),C)throw C;return L},parse:function(t,e){return Fu(),new Pu(t,e).parse(t,e)},parseAsync:async function(t,e){return Fu(),(await Mu(t,e)).parse(t,e)},parseDirective:Nr,initialize:function(t={}){var e;(null==t?void 0:t.fontFamily)&&!(null==(e=t.themeVariables)?void 0:e.fontFamily)&&(t.themeVariables={fontFamily:t.fontFamily}),qi=ki({},t),(null==t?void 0:t.theme)&&t.theme in Yt?t.themeVariables=Yt[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=Yt.default.getThemeVariables(t.themeVariables));const i="object"==typeof t?(t=>(Vi=ki({},Ui),Vi=ki(Vi,t),t.theme&&Yt[t.theme]&&(Vi.themeVariables=Yt[t.theme].getThemeVariables(t.themeVariables)),Xi(Vi,Hi),Vi))(t):Ki();Et(i.logLevel),Fu()},getConfig:Zi,setConfig:Qi,getSiteConfig:Ki,updateSiteConfig:t=>(Vi=ki(Vi,t),Xi(Vi,Hi),Vi),reset:()=>{er()},globalReset:()=>{er(Ui)},defaultConfig:Ui});Et(Zi().logLevel),er(Zi());const sp=(t,e,i)=>{Tt.warn(t),zi(t)?(i&&i(t.str,t.hash),e.push({...t,message:t.str,error:t})):(i&&i(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},ap=async function(t,e,i){const r=np.getConfig();let n;if(t&&(dp.sequenceConfig=t),Tt.debug((i?"":"No ")+"Callback function found"),void 0===e)n=document.querySelectorAll(".mermaid");else if("string"==typeof e)n=document.querySelectorAll(e);else if(e instanceof HTMLElement)n=[e];else{if(!(e instanceof NodeList))throw new Error("Invalid argument nodes for mermaid.init");n=e}Tt.debug(`Found ${n.length} diagrams`),void 0!==(null==t?void 0:t.startOnLoad)&&(Tt.debug("Start On Load: "+(null==t?void 0:t.startOnLoad)),np.updateSiteConfig({startOnLoad:null==t?void 0:t.startOnLoad}));const s=new Yi.initIdGenerator(r.deterministicIds,r.deterministicIDSeed);let a;const o=[];for(const c of Array.from(n)){ +/*! Check if previously processed */ +if(Tt.info("Rendering diagram: "+c.id),c.getAttribute("data-processed"))continue;c.setAttribute("data-processed","true");const t=`mermaid-${s.next()}`;a=c.innerHTML,a=G(Yi.entityDecode(a)).trim().replace(//gi,"
");const e=Yi.detectInit(a);e&&Tt.debug("Detected early reinit: ",e);try{await np.renderAsync(t,a,((e,r)=>{c.innerHTML=e,void 0!==i&&i(t),r&&r(c)}),c)}catch(l){sp(l,o,dp.parseError)}}if(o.length>0)throw o[0]},op=function(){if(dp.startOnLoad){const{startOnLoad:t}=np.getConfig();t&&dp.init().catch((t=>Tt.error("Mermaid failed to initialize",t)))}};"undefined"!=typeof document&& +/*! + * Wait for document loaded before starting the execution + */ +window.addEventListener("load",op,!1);const lp=[];let cp=!1;const hp=async()=>{if(!cp){for(cp=!0;lp.length>0;){const e=lp.shift();if(e)try{await e()}catch(t){Tt.error("Error executing queue",t)}}cp=!1}},dp={startOnLoad:!0,diagrams:{},mermaidAPI:np,parse:t=>np.parse(t,dp.parseError),parseAsync:t=>new Promise(((e,i)=>{lp.push((()=>new Promise(((r,n)=>{np.parseAsync(t,dp.parseError).then((t=>{r(t),e(t)}),(t=>{Tt.error("Error parsing",t),n(t),i(t)}))})))),hp().catch(i)})),render:np.render,renderAsync:(t,e,i,r)=>new Promise(((n,s)=>{lp.push((()=>new Promise(((a,o)=>{np.renderAsync(t,e,i,r).then((t=>{a(t),n(t)}),(t=>{Tt.error("Error parsing",t),o(t),s(t)}))})))),hp().catch(s)})),init:async function(t,e,i){try{await ap(t,e,i)}catch(r){Tt.warn("Syntax Error rendering"),zi(r)&&Tt.warn(r.str),dp.parseError&&dp.parseError(r)}},initThrowsErrors:function(t,e,i){const r=np.getConfig();let n;if(t&&(dp.sequenceConfig=t),Tt.debug((i?"":"No ")+"Callback function found"),void 0===e)n=document.querySelectorAll(".mermaid");else if("string"==typeof e)n=document.querySelectorAll(e);else if(e instanceof HTMLElement)n=[e];else{if(!(e instanceof NodeList))throw new Error("Invalid argument nodes for mermaid.init");n=e}Tt.debug(`Found ${n.length} diagrams`),void 0!==(null==t?void 0:t.startOnLoad)&&(Tt.debug("Start On Load: "+(null==t?void 0:t.startOnLoad)),np.updateSiteConfig({startOnLoad:null==t?void 0:t.startOnLoad}));const s=new Yi.initIdGenerator(r.deterministicIds,r.deterministicIDSeed);let a;const o=[];for(const c of Array.from(n)){ +/*! Check if previously processed */ +if(Tt.info("Rendering diagram: "+c.id),c.getAttribute("data-processed"))continue;c.setAttribute("data-processed","true");const t=`mermaid-${s.next()}`;a=c.innerHTML,a=G(Yi.entityDecode(a)).trim().replace(//gi,"
");const e=Yi.detectInit(a);e&&Tt.debug("Detected early reinit: ",e);try{np.render(t,a,((e,r)=>{c.innerHTML=e,void 0!==i&&i(t),r&&r(c)}),c)}catch(l){sp(l,o,dp.parseError)}}if(o.length>0)throw o[0]},initThrowsErrorsAsync:ap,registerExternalDiagrams:async(t,{lazyLoad:e=!0}={})=>{e?mi(...t):await(async(...t)=>{Tt.debug(`Loading ${t.length} external diagrams`);const e=(await Promise.allSettled(t.map((async({id:t,detector:e,loader:i})=>{const{diagram:r}=await i();Ur(t,r,e)})))).filter((t=>"rejected"===t.status));if(e.length>0){Tt.error(`Failed to load ${e.length} external diagrams`);for(const t of e)Tt.error(t);throw new Error(`Failed to load ${e.length} external diagrams`)}})(...t)},initialize:function(t){np.initialize(t)},parseError:void 0,contentLoaded:op,setParseErrorHandler:function(t){dp.parseError=t}},up=new y,pp={},gp={};let yp={};const fp=(t,e,i)=>{const r={TB:{in:{north:"north"},out:{south:"west",west:"east",east:"south"}},LR:{in:{west:"west"},out:{east:"south",south:"north",north:"east"}},RL:{in:{east:"east"},out:{west:"north",north:"south",south:"west"}},BT:{in:{south:"south"},out:{north:"east",east:"west",west:"north"}}};return r.TD=r.TB,Tt.info("abc88",i,e,t),r[i][e][t]},mp=(t,e,i)=>{if(Tt.info("getNextPort abc88",{node:t,edgeDirection:e,graphDirection:i}),!pp[t])switch(i){case"TB":case"TD":pp[t]={inPosition:"north",outPosition:"south"};break;case"BT":pp[t]={inPosition:"south",outPosition:"north"};break;case"RL":pp[t]={inPosition:"east",outPosition:"west"};break;case"LR":pp[t]={inPosition:"west",outPosition:"east"}}const r="in"===e?pp[t].inPosition:pp[t].outPosition;return"in"===e?pp[t].inPosition=fp(pp[t].inPosition,e,i):pp[t].outPosition=fp(pp[t].outPosition,e,i),r},bp=function(t,e,i,r){Tt.info("abc78 edges = ",t);const n=r.insert("g").attr("class","edgeLabels");let s,a,o={},l=e.db.getDirection();if(void 0!==t.defaultStyle){const e=wi(t.defaultStyle);s=e.style,a=e.labelStyle}return t.forEach((function(e){var r="L-"+e.start+"-"+e.end;void 0===o[r]?(o[r]=0,Tt.info("abc78 new entry",r,o[r])):(o[r]++,Tt.info("abc78 new entry",r,o[r]));let c=r+"-"+o[r];Tt.info("abc78 new link id to be used is",r,c,o[r]);var h="LS-"+e.start,d="LE-"+e.end;const u={style:"",labelStyle:""};switch(u.minlen=e.length||1,"arrow_open"===e.type?u.arrowhead="none":u.arrowhead="normal",u.arrowTypeStart="arrow_open",u.arrowTypeEnd="arrow_open",e.type){case"double_arrow_cross":u.arrowTypeStart="arrow_cross";case"arrow_cross":u.arrowTypeEnd="arrow_cross";break;case"double_arrow_point":u.arrowTypeStart="arrow_point";case"arrow_point":u.arrowTypeEnd="arrow_point";break;case"double_arrow_circle":u.arrowTypeStart="arrow_circle";case"arrow_circle":u.arrowTypeEnd="arrow_circle"}let p="",g="";switch(e.stroke){case"normal":p="fill:none;",void 0!==s&&(p=s),void 0!==a&&(g=a),u.thickness="normal",u.pattern="solid";break;case"dotted":u.thickness="normal",u.pattern="dotted",u.style="fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":u.thickness="thick",u.pattern="solid",u.style="stroke-width: 3.5px;fill:none;"}if(void 0!==e.style){const t=wi(e.style);p=t.style,g=t.labelStyle}u.style=u.style+=p,u.labelStyle=u.labelStyle+=g,void 0!==e.interpolate?u.curve=vi(e.interpolate,v):void 0!==t.defaultInterpolate?u.curve=vi(t.defaultInterpolate,v):u.curve=vi(gp.curve,v),void 0===e.text?void 0!==e.style&&(u.arrowheadStyle="fill: #333"):(u.arrowheadStyle="fill: #333",u.labelpos="c"),u.labelType="text",u.label=e.text.replace(Ot.lineBreakRegex,"\n"),void 0===e.style&&(u.style=u.style||"stroke: #333; stroke-width: 1.5px;fill:none;"),u.labelStyle=u.labelStyle.replace("color:","fill:"),u.id=c,u.classes="flowchart-link "+h+" "+d;const y=Na(n,u),{source:f,target:m}=((t,e)=>{let i=t.start,r=t.end;const n=yp[i],s=yp[r];return n&&s?("diamond"===n.type&&(i=`${i}-${mp(i,"out",e)}`),"diamond"===s.type&&(r=`${r}-${mp(r,"in",e)}`),{source:i,target:r}):{source:i,target:r}})(e,l);Tt.debug("abc78 source and target",f,m),i.edges.push({id:"e"+e.start+e.end,sources:[f],targets:[m],labelEl:y,labels:[{width:u.width,height:u.height,orgWidth:u.width,orgHeight:u.height,text:u.label,layoutOptions:{"edgeLabels.inline":"true","edgeLabels.placement":"CENTER"}}],edgeData:u})})),i},xp=function(t,e,i){const r=((t,e,i)=>{const{parentById:r}=i,n=new Set;let s=t;for(;s;){if(n.add(s),s===e)return s;s=r[s]}for(s=e;s;){if(n.has(s))return s;s=r[s]}return"root"})(t,e,i);if(void 0===r||"root"===r)return{x:0,y:0};const n=yp[r].offset;return{x:n.posX,y:n.posY}},kp=function(t,e,i,r,n){const s=xp(e.sources[0],e.targets[0],n),a=e.sections[0].startPoint,o=e.sections[0].endPoint,l=(e.sections[0].bendPoints?e.sections[0].bendPoints:[]).map((t=>[t.x+s.x,t.y+s.y])),c=[[a.x+s.x,a.y+s.y],...l,[o.x+s.x,o.y+s.y]],h=z().curve(v),d=t.insert("path").attr("d",h(c)).attr("class","path").attr("fill","none"),u=t.insert("g").attr("class","edgeLabel"),p=f(u.node().appendChild(e.labelEl)),g=p.node().firstChild.getBoundingClientRect();p.attr("width",g.width),p.attr("height",g.height),u.attr("transform",`translate(${e.labels[0].x+s.x}, ${e.labels[0].y+s.y})`),function(t,e,i,r){let n="";switch(r&&(n=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,n=n.replace(/\(/g,"\\("),n=n.replace(/\)/g,"\\)")),e.arrowTypeStart){case"arrow_cross":t.attr("marker-start","url("+n+"#"+i+"-crossStart)");break;case"arrow_point":t.attr("marker-start","url("+n+"#"+i+"-pointStart)");break;case"arrow_barb":t.attr("marker-start","url("+n+"#"+i+"-barbStart)");break;case"arrow_circle":t.attr("marker-start","url("+n+"#"+i+"-circleStart)");break;case"aggregation":t.attr("marker-start","url("+n+"#"+i+"-aggregationStart)");break;case"extension":t.attr("marker-start","url("+n+"#"+i+"-extensionStart)");break;case"composition":t.attr("marker-start","url("+n+"#"+i+"-compositionStart)");break;case"dependency":t.attr("marker-start","url("+n+"#"+i+"-dependencyStart)");break;case"lollipop":t.attr("marker-start","url("+n+"#"+i+"-lollipopStart)")}switch(e.arrowTypeEnd){case"arrow_cross":t.attr("marker-end","url("+n+"#"+i+"-crossEnd)");break;case"arrow_point":t.attr("marker-end","url("+n+"#"+i+"-pointEnd)");break;case"arrow_barb":t.attr("marker-end","url("+n+"#"+i+"-barbEnd)");break;case"arrow_circle":t.attr("marker-end","url("+n+"#"+i+"-circleEnd)");break;case"aggregation":t.attr("marker-end","url("+n+"#"+i+"-aggregationEnd)");break;case"extension":t.attr("marker-end","url("+n+"#"+i+"-extensionEnd)");break;case"composition":t.attr("marker-end","url("+n+"#"+i+"-compositionEnd)");break;case"dependency":t.attr("marker-end","url("+n+"#"+i+"-dependencyEnd)");break;case"lollipop":t.attr("marker-end","url("+n+"#"+i+"-lollipopEnd)")}}(d,i,r.type,r.arrowMarkerAbsolute)},_p=(t,e)=>{t.forEach((t=>{t.children||(t.children=[]);const i=e.childrenById[t.id];i&&i.forEach((e=>{t.children.push(yp[e])})),_p(t.children,e)}))},Cp=(t,e,i,r,n,s,a)=>{i.forEach((function(i){if(i)if(yp[i.id].offset={posX:i.x+t,posY:i.y+e,x:t,y:e,depth:a,width:i.width,height:i.height},"group"===i.type){const r=n.insert("g").attr("class","subgraph");r.insert("rect").attr("class","subgraph subgraph-lvl-"+a%5+" node").attr("x",i.x+t).attr("y",i.y+e).attr("width",i.width).attr("height",i.height);const s=r.insert("g").attr("class","label");s.attr("transform",`translate(${i.labels[0].x+t+i.x}, ${i.labels[0].y+e+i.y})`),s.node().appendChild(i.labelData.labelNode),Tt.info("Id (UGH)= ",i.type,i.labels)}else Tt.info("Id (UGH)= ",i.id),i.el.attr("transform",`translate(${i.x+t+i.width/2}, ${i.y+e+i.height/2})`)})),i.forEach((function(i){i&&"group"===i.type&&Cp(t+i.x,e+i.y,i.children,r,n,s,a+1)}))},Tp={getClasses:function(t,e){Tt.info("Extracting classes"),e.db.clear("ver-2");try{return e.parse(t),e.db.getClasses()}catch(i){return{}}},draw:async function(t,e,i,r){var n;r.db.clear(),yp={},r.db.setGen("gen-2"),r.parser.parse(t);const s=f("body").append("div").attr("style","height:400px").attr("id","cy");let a={id:"root",layoutOptions:{"elk.hierarchyHandling":"INCLUDE_CHILDREN","org.eclipse.elk.padding":"[top=100, left=100, bottom=110, right=110]","elk.layered.spacing.edgeNodeBetweenLayers":"30", +// 'elk.layered.mergeEdges': 'true', +"elk.direction":"DOWN"},children:[],edges:[]};switch(Tt.info("Drawing flowchart using v3 renderer",up),r.db.getDirection()){case"BT":a.layoutOptions["elk.direction"]="UP";break;case"TB":a.layoutOptions["elk.direction"]="DOWN";break;case"LR":a.layoutOptions["elk.direction"]="RIGHT";break;case"RL":a.layoutOptions["elk.direction"]="LEFT"}const{securityLevel:o,flowchart:c}=Zi();let h;"sandbox"===o&&(h=f("#i"+e));const d=f("sandbox"===o?h.nodes()[0].contentDocument.body:"body"),u="sandbox"===o?h.nodes()[0].contentDocument:document,p=d.select(`[id="${e}"]`);na(p,["point","circle","cross"],r.type,r.arrowMarkerAbsolute);const g=r.db.getVertices();let y;const m=r.db.getSubGraphs();Tt.info("Subgraphs - ",m);for(let l=m.length-1;l>=0;l--)y=m[l],r.db.addVertex(y.id,y.title,"group",void 0,y.classes,y.dir);const b=p.insert("g").attr("class","subgraphs"),x=function(t){const e={parentById:{},childrenById:{}},i=t.getSubGraphs();return Tt.info("Subgraphs - ",i),i.forEach((function(t){t.nodes.forEach((function(i){e.parentById[i]=t.id,void 0===e.childrenById[t.id]&&(e.childrenById[t.id]=[]),e.childrenById[t.id].push(i)}))})),i.forEach((function(t){t.id,void 0!==e.parentById[t.id]&&e.parentById[t.id]})),e}(r.db);a=function(t,e,i,r,n,s,a){const o=i.select(`[id="${e}"]`),c=o.insert("g").attr("class","nodes");return Object.keys(t).forEach((function(e){const i=t[e];let a="default";i.classes.length>0&&(a=i.classes.join(" "));const h=wi(i.styles);let d,u=void 0!==i.text?i.text:i.id;const p={width:0,height:0};if(Dt(Zi().flowchart.htmlLabels)){const t={label:u.replace(/fa[blrs]?:fa-[\w-]+/g,(t=>``))};d=l(o,t).node();const e=d.getBBox();p.width=e.width,p.height=e.height,p.labelNode=d,d.parentNode.removeChild(d)}else{const t=r.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",h.labelStyle.replace("color:","fill:"));const e=u.split(Ot.lineBreakRegex);for(const n of e){const e=r.createElementNS("http://www.w3.org/2000/svg","tspan");e.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),e.setAttribute("dy","1em"),e.setAttribute("x","1"),e.textContent=n,t.appendChild(e)}d=t;const i=d.getBBox();p.width=i.width,p.height=i.height,p.labelNode=d}const g=[{id:i.id+"-west",layoutOptions:{"port.side":"WEST"}},{id:i.id+"-east",layoutOptions:{"port.side":"EAST"}},{id:i.id+"-south",layoutOptions:{"port.side":"SOUTH"}},{id:i.id+"-north",layoutOptions:{"port.side":"NORTH"}}];let y=0,f="",m={};switch(i.type){case"round":y=5,f="rect";break;case"square":case"group":default:f="rect";break;case"diamond":f="question",m={portConstraints:"FIXED_SIDE"};break;case"hexagon":f="hexagon";break;case"odd":case"odd_right":f="rect_left_inv_arrow";break;case"lean_right":f="lean_right";break;case"lean_left":f="lean_left";break;case"trapezoid":f="trapezoid";break;case"inv_trapezoid":f="inv_trapezoid";break;case"circle":f="circle";break;case"ellipse":f="ellipse";break;case"stadium":f="stadium";break;case"subroutine":f="subroutine";break;case"cylinder":f="cylinder";break;case"doublecircle":f="doublecircle"}const b={labelStyle:h.labelStyle,shape:f,labelText:u,rx:y,ry:y,class:a,style:h.style,id:i.id,link:i.link,linkTarget:i.linkTarget,tooltip:n.db.getTooltip(i.id)||"",domId:n.db.lookUpDomId(i.id),haveCallback:i.haveCallback,width:"group"===i.type?500:void 0,dir:i.dir,type:i.type,props:i.props,padding:Zi().flowchart.padding};let x,k;"group"!==b.type&&(k=Ba(c,b,i.dir),x=k.node().getBBox());const _={id:i.id,ports:"diamond"===i.type?g:[], +// labelStyle: styles.labelStyle, +// shape: _shape, +layoutOptions:m,labelText:u,labelData:p, +// labels: [{ text: vertexText }], +// rx: radius, +// ry: radius, +// class: classStr, +// style: styles.style, +// link: vertex.link, +// linkTarget: vertex.linkTarget, +// tooltip: diagObj.db.getTooltip(vertex.id) || '', +domId:n.db.lookUpDomId(i.id), +// haveCallback: vertex.haveCallback, +width:null==x?void 0:x.width,height:null==x?void 0:x.height, +// dir: vertex.dir, +type:i.type, +// props: vertex.props, +// padding: getConfig().flowchart.padding, +// boundingBox, +el:k,parent:s.parentById[i.id]};yp[b.id]=_})),a}(g,e,d,u,r,x,a);const k=p.insert("g").attr("class","edges edgePath"),_=r.db.getEdges();a=bp(_,r,a,p);Object.keys(yp).forEach((t=>{const e=yp[t];e.parent||a.children.push(e),void 0!==x.childrenById[t]&&(e.labels=[{text:e.labelText,layoutOptions:{"nodeLabels.placement":"[H_CENTER, V_TOP, INSIDE]"},width:e.labelData.width,height:e.labelData.height}],delete e.x,delete e.y,delete e.width,delete e.height)})),_p(a.children,x),Tt.info("after layout",JSON.stringify(a,null,2));const C=await up.layout(a);Cp(0,0,C.children,p,b,r,0),Tt.info("after layout",C),null==(n=C.edges)||n.map((t=>{kp(k,t,t.edgeData,r,x)})),ar({},p,c.diagramPadding,c.useMaxWidth),s.remove()}},Ep=t=>`.label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n .cluster-label text {\n fill: ${t.titleColor};\n }\n .cluster-label span {\n color: ${t.titleColor};\n }\n\n .label text,span {\n fill: ${t.nodeTextColor||t.textColor};\n color: ${t.nodeTextColor||t.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n }\n\n .cluster rect {\n fill: ${t.clusterBkg};\n stroke: ${t.clusterBorder};\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n .cluster span {\n color: ${t.titleColor};\n }\n /* .cluster div {\n color: ${t.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${t.fontFamily};\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n .subgraph {\n stroke-width:2;\n rx:3;\n }\n // .subgraph-lvl-1 {\n // fill:#ccc;\n // // stroke:black;\n // }\n ${(t=>{let e="";for(let i=0;i<5;i++)e+=`\n .subgraph-lvl-${i} {\n fill: ${t[`surface${i}`]};\n stroke: ${t[`surfacePeer${i}`]};\n }\n `;return e})(t)}\n`,vp={db:hl,renderer:Tp,parser:ho,styles:Ep},Sp=Object.defineProperty({__proto__:null,diagram:vp},Symbol.toStringTag,{value:"Module"});var wp=function(){var t=function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i},e=[1,2],i=[1,5],r=[6,9,11,17,18,20,22,23,26,27,28],n=[1,15],s=[1,16],a=[1,17],o=[1,18],l=[1,19],c=[1,23],h=[1,24],d=[1,27],u=[4,6,9,11,17,18,20,22,23,26,27,28],p={trace:function(){},yy:{},symbols_:{error:2,start:3,timeline:4,document:5,EOF:6,directive:7,line:8,SPACE:9,statement:10,NEWLINE:11,openDirective:12,typeDirective:13,closeDirective:14,":":15,argDirective:16,title:17,acc_title:18,acc_title_value:19,acc_descr:20,acc_descr_value:21,acc_descr_multiline_value:22,section:23,period_statement:24,event_statement:25,period:26,event:27,open_directive:28,type_directive:29,arg_directive:30,close_directive:31,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",6:"EOF",9:"SPACE",11:"NEWLINE",15:":",17:"title",18:"acc_title",19:"acc_title_value",20:"acc_descr",21:"acc_descr_value",22:"acc_descr_multiline_value",23:"section",26:"period",27:"event",28:"open_directive",29:"type_directive",30:"arg_directive",31:"close_directive"},productions_:[0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,2],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[24,1],[25,1],[12,1],[13,1],[16,1],[14,1]],performAction:function(t,e,i,r,n,s,a){var o=s.length-1;switch(n){case 1:return s[o-1];case 3:case 7:case 8:this.$=[];break;case 4:s[o-1].push(s[o]),this.$=s[o-1];break;case 5:case 6:this.$=s[o];break;case 11:r.getCommonDb().setDiagramTitle(s[o].substr(6)),this.$=s[o].substr(6);break;case 12:this.$=s[o].trim(),r.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=s[o].trim(),r.getCommonDb().setAccDescription(this.$);break;case 15:r.addSection(s[o].substr(8)),this.$=s[o].substr(8);break;case 19:r.addTask(s[o],0,""),this.$=s[o];break;case 20:r.addEvent(s[o].substr(2)),this.$=s[o];break;case 21:r.parseDirective("%%{","open_directive");break;case 22:r.parseDirective(s[o],"type_directive");break;case 23:s[o]=s[o].trim().replace(/'/g,'"'),r.parseDirective(s[o],"arg_directive");break;case 24:r.parseDirective("}%%","close_directive","timeline")}},table:[{3:1,4:e,7:3,12:4,28:i},{1:[3]},t(r,[2,3],{5:6}),{3:7,4:e,7:3,12:4,28:i},{13:8,29:[1,9]},{29:[2,21]},{6:[1,10],7:22,8:11,9:[1,12],10:13,11:[1,14],12:4,17:n,18:s,20:a,22:o,23:l,24:20,25:21,26:c,27:h,28:i},{1:[2,2]},{14:25,15:[1,26],31:d},t([15,31],[2,22]),t(r,[2,8],{1:[2,1]}),t(r,[2,4]),{7:22,10:28,12:4,17:n,18:s,20:a,22:o,23:l,24:20,25:21,26:c,27:h,28:i},t(r,[2,6]),t(r,[2,7]),t(r,[2,11]),{19:[1,29]},{21:[1,30]},t(r,[2,14]),t(r,[2,15]),t(r,[2,16]),t(r,[2,17]),t(r,[2,18]),t(r,[2,19]),t(r,[2,20]),{11:[1,31]},{16:32,30:[1,33]},{11:[2,24]},t(r,[2,5]),t(r,[2,12]),t(r,[2,13]),t(u,[2,9]),{14:34,31:d},{31:[2,23]},{11:[1,35]},t(u,[2,10])],defaultActions:{5:[2,21],7:[2,2],27:[2,24],33:[2,23]},parseError:function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},parse:function(t){var e=this,i=[0],r=[],n=[null],s=[],a=this.table,o="",l=0,c=0,h=s.slice.call(arguments,1),d=Object.create(this.lexer),u={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(u.yy[p]=this.yy[p]);d.setInput(t,u.yy),u.yy.lexer=d,u.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;s.push(g);var y=d.options&&d.options.ranges;"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var f,m,b,x,k,_,C,T,E,v={};;){if(m=i[i.length-1],this.defaultActions[m]?b=this.defaultActions[m]:(null==f&&(E=void 0,"number"!=typeof(E=r.pop()||d.lex()||1)&&(E instanceof Array&&(E=(r=E).pop()),E=e.symbols_[E]||E),f=E),b=a[m]&&a[m][f]),void 0===b||!b.length||!b[0]){var S="";for(k in T=[],a[m])this.terminals_[k]&&k>2&&T.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[f]||f,line:d.yylineno,loc:g,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+f);switch(b[0]){case 1:i.push(f),n.push(d.yytext),s.push(d.yylloc),i.push(b[1]),f=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(_=this.productions_[b[1]][1],v.$=n[n.length-_],v._$={first_line:s[s.length-(_||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(_||1)].first_column,last_column:s[s.length-1].last_column},y&&(v._$.range=[s[s.length-(_||1)].range[0],s[s.length-1].range[1]]),void 0!==(x=this.performAction.apply(v,[o,c,l,u.yy,b[1],n,s].concat(h))))return x;_&&(i=i.slice(0,-1*_*2),n=n.slice(0,-1*_),s=s.slice(0,-1*_)),i.push(this.productions_[b[1]][0]),n.push(v.$),s.push(v._$),C=a[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},g=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}, +// resets the lexer, sets new input +setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}, +// consumes and returns one char from the input +input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}, +// unshifts one char (or a string) into the input +unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===r.length?this.yylloc.first_column:0)+r[r.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}, +// When called from action, caches matched text and appends it on next action +more:function(){return this._more=!0,this}, +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// retain first n characters of the match +less:function(t){this.unput(this.match.slice(t))}, +// displays already matched input, i.e. for error messages +pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}, +// displays upcoming input, i.e. for error messages +upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}, +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}, +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(t,e){var i,r,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var s in n)this[s]=n[s];return!1}return!1}, +// return next match in input +next:function(){if(this.done)return this.EOF;var t,e,i,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),s=0;se[0].length)){if(e=i,r=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// return next match that has a token +lex:function(){var t=this.next();return t||this.lex()}, +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function(t){this.conditionStack.push(t)}, +// pop the previously active lexer condition state off the condition stack +popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}, +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}, +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}, +// alias for begin(condition) +pushState:function(t){this.begin(t)}, +// return the number of states currently on the stack +stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,i,r){switch(i){case 0:return this.begin("open_directive"),28;case 1:return this.begin("type_directive"),29;case 2:return this.popState(),this.begin("arg_directive"),15;case 3:return this.popState(),this.popState(),31;case 4:return 30;case 5:case 6:case 8:case 9:break;case 7:return 11;case 10:return 4;case 11:return 17;case 12:return this.begin("acc_title"),18;case 13:return this.popState(),"acc_title_value";case 14:return this.begin("acc_descr"),20;case 15:return this.popState(),"acc_descr_value";case 16:this.begin("acc_descr_multiline");break;case 17:this.popState();break;case 18:return"acc_descr_multiline_value";case 19:return 23;case 20:return 27;case 21:return 26;case 22:return 6;case 23:return"INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?::\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{open_directive:{rules:[1],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},acc_descr_multiline:{rules:[17,18],inclusive:!1},acc_descr:{rules:[15],inclusive:!1},acc_title:{rules:[13],inclusive:!1},INITIAL:{rules:[0,5,6,7,8,9,10,11,12,14,16,19,20,21,22,23],inclusive:!0}}};return t}();function y(){this.yy={}}return p.lexer=g,y.prototype=p,p.Parser=y,new y}();wp.parser=wp;const Ap=wp;let Bp="",Lp=0;const Dp=[],Ip=[],Op=[],$p=()=>Or,Np=(t,e,i)=>{Nr(globalThis,t,e,i)},Fp=function(){Dp.length=0,Ip.length=0,Bp="",Op.length=0,vr()},Rp=function(t){Bp=t,Dp.push(t)},Mp=function(){return Dp},Pp=function(){let t=Wp();let e=0;for(;!t&&e<100;)t=Wp(),e++;return Ip.push(...Op),Ip},zp=function(t,e,i){const r={id:Lp++,section:Bp,type:Bp,task:t,score:e||0, +//if event is defined, then add it the events array +events:i?[i]:[]};Op.push(r)},jp=function(t){Op.find((t=>t.id===Lp-1)).events.push(t)},Yp=function(t){const e={section:Bp,type:Bp,description:t,task:t,classes:[]};Ip.push(e)},Wp=function(){let t=!0;for(const[e,i]of Op.entries())Op[e].processed,t=t&&i.processed;return t},Up={clear:Fp,getCommonDb:$p,addSection:Rp,getSections:Mp,getTasks:Pp,addTask:zp,addTaskOrg:Yp,addEvent:jp,parseDirective:Np},qp=Object.freeze(Object.defineProperty({__proto__:null,addEvent:jp,addSection:Rp,addTask:zp,addTaskOrg:Yp,clear:Fp,default:Up,getCommonDb:$p,getSections:Mp,getTasks:Pp,parseDirective:Np},Symbol.toStringTag,{value:"Module"}));function Vp(t,e){t.each((function(){var t,i=f(this),r=i.text().split(/(\s+|
)/).reverse(),n=[],s=i.attr("y"),a=parseFloat(i.attr("dy")),o=i.text(null).append("tspan").attr("x",0).attr("y",s).attr("dy",a+"em");for(let l=0;le||"
"===t)&&(n.pop(),o.text(n.join(" ").trim()),n="
"===t?[""]:[t],o=i.append("tspan").attr("x",0).attr("y",s).attr("dy","1.1em").text(t))}))}const Hp=function(t,e,i){t.append("path").attr("id","node-"+e.id).attr("class","node-bkg node-"+e.type).attr("d",`M0 ${e.height-5} v${10-e.height} q0,-5 5,-5 h${e.width-10} q5,0 5,5 v${e.height-5} H0 Z`),t.append("line").attr("class","node-line-"+i).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},Gp=function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},Xp=function(t,e,i,r){const n=i%12-1,s=t.append("g");e.section=n,s.attr("class",(e.class?e.class+" ":"")+"timeline-node section-"+n);const a=s.append("g"),o=s.append("g"),l=o.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(Vp,e.width).node().getBBox(),c=r.fontSize&&r.fontSize.replace?r.fontSize.replace("px",""):r.fontSize;return e.height=l.height+1.1*c*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,o.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),Hp(a,e,n),e},Kp=function(t,e,i){const r=t.append("g"),n=r.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(Vp,e.width).node().getBBox(),s=i.fontSize&&i.fontSize.replace?i.fontSize.replace("px",""):i.fontSize;return r.remove(),n.height+1.1*s*.5+e.padding},Qp=function(t,e,i,r,n,s,a,o,l,c,h){for(const d of e){const e={descr:d.task,section:i,number:i,width:150,padding:20,maxHeight:s};Tt.debug("taskNode",e);const o=t.append("g").attr("class","taskWrapper"),u=Xp(o,e,i,a).height;if(Tt.debug("taskHeight after draw",u),o.attr("transform",`translate(${r}, ${n})`),s=Math.max(s,u),d.events){const e=t.append("g").attr("class","lineWrapper");let o=s;n+=100,o+=Zp(t,d.events,i,r,n,a),n-=100,e.append("line").attr("x1",r+95).attr("y1",n+s).attr("x2",r+95).attr("y2",n+s+(h?s:c)+l+120).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}r+=200,h&&!Zi().timeline.disableMulticolor&&i++}n-=10},Zp=function(t,e,i,r,n,s){let a=0;const o=n;n+=100;for(const l of e){const e={descr:l,section:i,number:i,width:150,padding:20,maxHeight:50};Tt.debug("eventNode",e);const o=t.append("g").attr("class","eventWrapper"),c=Xp(o,e,i,s).height;a+=c,o.attr("transform",`translate(${r}, ${n})`),n=n+10+c}return n=o,a},Jp={setConf:function(t){Object.keys(t).forEach((function(e){conf[e]=t[e]}))},draw:function(t,e,i,r){const n=Zi(),s=n.leftMargin?n.leftMargin:50;r.db.clear(),r.parser.parse(t+"\n"),Tt.debug("timeline",r.db);const a=n.securityLevel;let o;"sandbox"===a&&(o=f("#i"+e));const l=f("sandbox"===a?o.nodes()[0].contentDocument.body:"body").select("#"+e);l.append("g");const c=r.db.getTasks(),h=r.db.getCommonDb().getDiagramTitle();Tt.debug("task",c),Gp(l);const d=r.db.getSections();Tt.debug("sections",d);let u=0,p=0,g=0,y=0,m=50+s,b=50;y=50;let x=0,k=!0;d.forEach((function(t){const e=Kp(l,{number:x,descr:t,section:x,width:150,padding:20,maxHeight:u},n);Tt.debug("sectionHeight before draw",e),u=Math.max(u,e+20)}));let _=0,C=0;Tt.debug("tasks.length",c.length);for(const[f,E]of c.entries()){const t={number:f,descr:E,section:E.section,width:150,padding:20,maxHeight:p},e=Kp(l,t,n);Tt.debug("taskHeight before draw",e),p=Math.max(p,e+20),_=Math.max(_,E.events.length);let i=0;for(let r=0;r0?d.forEach((t=>{const e={number:x,descr:t,section:x,width:150,padding:20,maxHeight:u};Tt.debug("sectionNode",e);const i=l.append("g"),r=Xp(i,e,x,n);Tt.debug("sectionNode output",r),i.attr("transform",`translate(${m}, 50)`),b+=u+50;const s=c.filter((e=>e.section===t));s.length>0&&Qp(l,s,x,m,b,p,n,_,C,u,!1),m+=200*Math.max(s.length,1),b=50,x++})):(k=!1,Qp(l,c,x,m,b,p,n,_,C,u,!0));const T=l.node().getBBox();Tt.debug("bounds",T),h&&l.append("text").text(h).attr("x",T.width/2-s).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),g=k?u+p+150:p+100;l.append("g").attr("class","lineWrapper").append("line").attr("x1",s).attr("y1",g).attr("x2",T.width+3*s).attr("y2",g).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),ar(void 0,l,n.timeline.padding?n.timeline.padding:50,!!n.timeline.useMaxWidth&&n.timeline.useMaxWidth)}},tg=t=>`\n .edge {\n stroke-width: 3;\n }\n ${(t=>{let e="";for(let i=0;i2&&T.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[f]||f,line:d.yylineno,loc:g,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+f);switch(b[0]){case 1:i.push(f),n.push(d.yytext),s.push(d.yylloc),i.push(b[1]),f=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(_=this.productions_[b[1]][1],v.$=n[n.length-_],v._$={first_line:s[s.length-(_||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(_||1)].first_column,last_column:s[s.length-1].last_column},y&&(v._$.range=[s[s.length-(_||1)].range[0],s[s.length-1].range[1]]),void 0!==(x=this.performAction.apply(v,[o,c,l,u.yy,b[1],n,s].concat(h))))return x;_&&(i=i.slice(0,-1*_*2),n=n.slice(0,-1*_),s=s.slice(0,-1*_)),i.push(this.productions_[b[1]][0]),n.push(v.$),s.push(v._$),C=a[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},b=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}, +// resets the lexer, sets new input +setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}, +// consumes and returns one char from the input +input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}, +// unshifts one char (or a string) into the input +unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===r.length?this.yylloc.first_column:0)+r[r.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}, +// When called from action, caches matched text and appends it on next action +more:function(){return this._more=!0,this}, +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// retain first n characters of the match +less:function(t){this.unput(this.match.slice(t))}, +// displays already matched input, i.e. for error messages +pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}, +// displays upcoming input, i.e. for error messages +upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}, +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}, +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(t,e){var i,r,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var s in n)this[s]=n[s];return!1}return!1}, +// return next match in input +next:function(){if(this.done)return this.EOF;var t,e,i,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),s=0;se[0].length)){if(e=i,r=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}, +// return next match that has a token +lex:function(){var t=this.next();return t||this.lex()}, +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function(t){this.conditionStack.push(t)}, +// pop the previously active lexer condition state off the condition stack +popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}, +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}, +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}, +// alias for begin(condition) +pushState:function(t){this.begin(t)}, +// return the number of states currently on the stack +stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,i,r){switch(i){case 0:t.getLogger().trace("Found comment",e.yytext);break;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:case 23:this.popState();break;case 5:t.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return t.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:t.getLogger().trace("end icon"),this.popState();break;case 10:return t.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return t.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return t.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return t.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:case 15:case 16:case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 22:return t.getLogger().trace("description:",e.yytext),"NODE_DESCR";case 24:return this.popState(),t.getLogger().trace("node end ))"),"NODE_DEND";case 25:return this.popState(),t.getLogger().trace("node end )"),"NODE_DEND";case 26:return this.popState(),t.getLogger().trace("node end ...",e.yytext),"NODE_DEND";case 27:case 30:case 31:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 28:case 29:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 32:case 33:return t.getLogger().trace("Long description:",e.yytext),20}},rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\-\)\{\}]+)/i,/^(?:$)/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR:{rules:[22,23],inclusive:!1},NODE:{rules:[21,24,25,26,27,28,29,30,31,32,33],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return t}();function x(){this.yy={}}return m.lexer=b,x.prototype=m,m.Parser=x,new x}();rg.parser=rg;const ng=rg,sg=t=>wt(t,Zi());let ag=[],og=0,lg={};const cg={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},hg=(t,e)=>{lg[t]=e},dg=t=>{switch(t){case cg.DEFAULT:return"no-border";case cg.RECT:return"rect";case cg.ROUNDED_RECT:return"rounded-rect";case cg.CIRCLE:return"circle";case cg.CLOUD:return"cloud";case cg.BANG:return"bang";case cg.HEXAGON:return"hexgon";default:return"no-border"}};let ug;const pg=t=>lg[t],gg=Object.freeze(Object.defineProperty({__proto__:null,addNode:(t,e,i,r)=>{Tt.info("addNode",t,e,i,r);const n=Zi(),s={id:og++,nodeId:sg(e),level:t,descr:sg(i),type:r,children:[],width:Zi().mindmap.maxNodeWidth};switch(s.type){case cg.ROUNDED_RECT:case cg.RECT:case cg.HEXAGON:s.padding=2*n.mindmap.padding;break;default:s.padding=n.mindmap.padding}const a=function(t){for(let e=ag.length-1;e>=0;e--)if(ag[e].level{ag=[],og=0,lg={}},decorateNode:t=>{const e=ag[ag.length-1];t&&t.icon&&(e.icon=sg(t.icon)),t&&t.class&&(e.class=sg(t.class))},getElementById:pg,getLogger:()=>Tt,getMindmap:()=>ag.length>0?ag[0]:null,getNodeById:t=>ag[t],getType:(t,e)=>{switch(Tt.debug("In get type",t,e),t){case"[":return cg.RECT;case"(":return")"===e?cg.ROUNDED_RECT:cg.CLOUD;case"((":return cg.CIRCLE;case")":return cg.CLOUD;case"))":return cg.BANG;case"{{":return cg.HEXAGON;default:return cg.DEFAULT}},nodeType:cg,get parseError(){return ug},sanitizeText:sg,setElementForId:hg,setErrorHandler:t=>{ug=t},type2Str:dg},Symbol.toStringTag,{value:"Module"}));function yg(t,e){t.each((function(){var t,i=f(this),r=i.text().split(/(\s+|
)/).reverse(),n=[],s=i.attr("y"),a=parseFloat(i.attr("dy")),o=i.text(null).append("tspan").attr("x",0).attr("y",s).attr("dy",a+"em");for(let l=0;le||"
"===t)&&(n.pop(),o.text(n.join(" ").trim()),n="
"===t?[""]:[t],o=i.append("tspan").attr("x",0).attr("y",s).attr("dy","1.1em").text(t))}))}const fg=function(t,e,i,r){const n=i%11,s=t.append("g");e.section=n;let a="section-"+n;n<0&&(a+=" section-root"),s.attr("class",(e.class?e.class+" ":"")+"mindmap-node "+a);const o=s.append("g"),l=s.append("g"),c=l.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(yg,e.width).node().getBBox(),h=r.fontSize.replace?r.fontSize.replace("px",""):r.fontSize;if(e.height=c.height+1.1*h*.5+e.padding,e.width=c.width+2*e.padding,e.icon)if(e.type===cg.CIRCLE){e.height+=50,e.width+=50;s.append("foreignObject").attr("height","50px").attr("width",e.width).attr("style","text-align: center;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+n+" "+e.icon),l.attr("transform","translate("+e.width/2+", "+(e.height/2-1.5*e.padding)+")")}else{e.width+=50;const t=e.height;e.height=Math.max(t,60);const i=Math.abs(e.height-t);s.append("foreignObject").attr("width","60px").attr("height",e.height).attr("style","text-align: center;margin-top:"+i/2+"px;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+n+" "+e.icon),l.attr("transform","translate("+(25+e.width/2)+", "+(i/2+e.padding/2)+")")}else l.attr("transform","translate("+e.width/2+", "+e.padding/2+")");switch(e.type){case cg.DEFAULT:!function(t,e,i){t.append("path").attr("id","node-"+e.id).attr("class","node-bkg node-"+dg(e.type)).attr("d",`M0 ${e.height-5} v${10-e.height} q0,-5 5,-5 h${e.width-10} q5,0 5,5 v${e.height-5} H0 Z`),t.append("line").attr("class","node-line-"+i).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)}(o,e,n);break;case cg.ROUNDED_RECT:!function(t,e){t.append("rect").attr("id","node-"+e.id).attr("class","node-bkg node-"+dg(e.type)).attr("height",e.height).attr("rx",e.padding).attr("ry",e.padding).attr("width",e.width)}(o,e);break;case cg.RECT:!function(t,e){t.append("rect").attr("id","node-"+e.id).attr("class","node-bkg node-"+dg(e.type)).attr("height",e.height).attr("width",e.width)}(o,e);break;case cg.CIRCLE:o.attr("transform","translate("+e.width/2+", "+ +e.height/2+")"),function(t,e){t.append("circle").attr("id","node-"+e.id).attr("class","node-bkg node-"+dg(e.type)).attr("r",e.width/2)}(o,e);break;case cg.CLOUD:!function(t,e){const i=e.width,r=e.height,n=.15*i,s=.25*i,a=.35*i,o=.2*i;t.append("path").attr("id","node-"+e.id).attr("class","node-bkg node-"+dg(e.type)).attr("d",`M0 0 a${n},${n} 0 0,1 ${.25*i},${-1*i*.1}\n a${a},${a} 1 0,1 ${.4*i},${-1*i*.1}\n a${s},${s} 1 0,1 ${.35*i},${1*i*.2}\n\n a${n},${n} 1 0,1 ${.15*i},${1*r*.35}\n a${o},${o} 1 0,1 ${-1*i*.15},${1*r*.65}\n\n a${s},${n} 1 0,1 ${-1*i*.25},${.15*i}\n a${a},${a} 1 0,1 ${-1*i*.5},0\n a${n},${n} 1 0,1 ${-1*i*.25},${-1*i*.15}\n\n a${n},${n} 1 0,1 ${-1*i*.1},${-1*r*.35}\n a${o},${o} 1 0,1 ${.1*i},${-1*r*.65}\n\n H0 V0 Z`)}(o,e);break;case cg.BANG:!function(t,e){const i=e.width,r=e.height,n=.15*i;t.append("path").attr("id","node-"+e.id).attr("class","node-bkg node-"+dg(e.type)).attr("d",`M0 0 a${n},${n} 1 0,0 ${.25*i},${-1*r*.1}\n a${n},${n} 1 0,0 ${.25*i},0\n a${n},${n} 1 0,0 ${.25*i},0\n a${n},${n} 1 0,0 ${.25*i},${1*r*.1}\n\n a${n},${n} 1 0,0 ${.15*i},${1*r*.33}\n a${.8*n},${.8*n} 1 0,0 0,${1*r*.34}\n a${n},${n} 1 0,0 ${-1*i*.15},${1*r*.33}\n\n a${n},${n} 1 0,0 ${-1*i*.25},${.15*r}\n a${n},${n} 1 0,0 ${-1*i*.25},0\n a${n},${n} 1 0,0 ${-1*i*.25},0\n a${n},${n} 1 0,0 ${-1*i*.25},${-1*r*.15}\n\n a${n},${n} 1 0,0 ${-1*i*.1},${-1*r*.33}\n a${.8*n},${.8*n} 1 0,0 0,${-1*r*.34}\n a${n},${n} 1 0,0 ${.1*i},${-1*r*.33}\n\n H0 V0 Z`)}(o,e);break;case cg.HEXAGON:!function(t,e){const i=e.height,r=i/4,n=e.width-e.padding+2*r;!function(t,e,i,r,n){t.insert("polygon",":first-child").attr("points",r.map((function(t){return t.x+","+t.y})).join(" ")).attr("transform","translate("+(n.width-e)/2+", "+i+")")}(t,n,i,[{x:r,y:0},{x:n-r,y:0},{x:n,y:-i/2},{x:n-r,y:-i},{x:r,y:-i},{x:0,y:-i/2}],e)}(o,e)}return hg(e.id,s),e.height},mg=function(t){const e=pg(t.id),i=t.x||0,r=t.y||0;e.attr("transform","translate("+i+","+r+")")};function bg(t,e,i,r){fg(t,e,i,r),e.children&&e.children.forEach(((e,n)=>{bg(t,e,i<0?n:i,r)}))}function xg(t,e,i,r){e.add({group:"nodes",data:{id:t.id,labelText:t.descr,height:t.height,width:t.width,level:r,nodeId:t.id,padding:t.padding,type:t.type},position:{x:t.x,y:t.y}}),t.children&&t.children.forEach((n=>{xg(n,e,i,r+1),e.add({group:"edges",data:{id:`${t.id}_${n.id}`,source:t.id,target:n.id,depth:r,section:n.section}})}))}function kg(t,e){return new Promise((i=>{const r=f("body").append("div").attr("id","cy").attr("style","display:none"),n=gt({container:document.getElementById("cy"), +// container to render in +style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),xg(t,n,e,0),n.nodes().forEach((function(t){t.layoutDimensions=()=>{const e=t.data();return{w:e.width,h:e.height}}})),n.layout({name:"cose-bilkent",quality:"proof", +// headless: true, +styleEnabled:!1,animate:!1}).run(),n.ready((t=>{Tt.info("Ready",t),i(n)}))}))}gt.use(yt);const _g=t=>`\n .edge {\n stroke-width: 3;\n }\n ${(t=>{let e="";for(let i=0;i{const n=Zi();r.db.clear(),r.parser.parse(t),Tt.debug("Renering info diagram\n"+t);const s=Zi().securityLevel;let a;"sandbox"===s&&(a=f("#i"+e));const o=f("sandbox"===s?a.nodes()[0].contentDocument.body:"body").select("#"+e);o.append("g");const l=r.db.getMindmap(),c=o.append("g");c.attr("class","mindmap-edges");const h=o.append("g");h.attr("class","mindmap-nodes"),bg(h,l,-1,n);const d=await kg(l,n);!function(t,e){e.edges().map(((e,i)=>{const r=e.data();if(e[0]._private.bodyBounds){const n=e[0]._private.rscratch;Tt.trace("Edge: ",i,r),t.insert("path").attr("d",`M ${n.startX},${n.startY} L ${n.midX},${n.midY} L${n.endX},${n.endY} `).attr("class","edge section-edge-"+r.section+" edge-depth-"+r.depth)}}))}(c,d),function(t){t.nodes().map(((t,e)=>{const i=t.data();i.x=t.position().x,i.y=t.position().y,mg(i);const r=pg(i.nodeId);Tt.info("Id:",e,"Position: (",t.position().x,", ",t.position().y,")",i),r.attr("transform",`translate(${t.position().x-i.width/2}, ${t.position().y-i.height/2})`),r.attr("attr",`apa-${e})`)}))}(d),ar(void 0,o,n.mindmap.padding,n.mindmap.useMaxWidth)}},parser:ng,styles:_g},Tg=Object.defineProperty({__proto__:null,diagram:Cg},Symbol.toStringTag,{value:"Module"});export{dp as m};