diff --git "a/.output/public/assets/mermaid-BHUgx3VR.js" "b/.output/public/assets/mermaid-BHUgx3VR.js" new file mode 100644--- /dev/null +++ "b/.output/public/assets/mermaid-BHUgx3VR.js" @@ -0,0 +1,1102 @@ +var t,e,i,r,s,n,a,o,l,h,d,u,p,g,y,f,m,x,b,k,C,S,w,T,_,v,E,A,L,B,$,D,I,F,N,O,M=Object.defineProperty,R=(t,e,i)=>((t,e,i)=>e in t?M(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);import{_ as P,p as q}from"./@mermaid-js-C9iCgeAb.js";import{d as z}from"./ts-dedent-CttZBlkd.js";import"./d3-transition-0ltv4da8.js";import"./d3-zoom-Dz8HuW59.js";import{p as W}from"./dompurify-DRcrZKbd.js";import{_ as j,W as Y,y as U,C as H}from"./lodash-es-RhymR7yg.js";import{s as V,c as X,a as G}from"./stylis-Cl7w7uv3.js";import{d as K}from"./d3-selection-Oxnq6l6A.js";import{G as Q,w as Z,l as J}from"./dagre-d3-es-D8JeTxsO.js";import{d as tt}from"./@braintree-BB7t-Iuh.js";import{a as et,i as it,r as rt,d as st,l as nt,b as at,c as ot}from"./khroma-C2oHPU0S.js";import{d as lt,a as ct,b as ht,c as dt}from"./dayjs-Cbdj87rt.js";import{t as ut,l as pt,o as gt,b as yt}from"./d3-scale-CdkN4P7M.js";import{m as ft,e as mt}from"./d3-array-BhN1wQGI.js";import{g as xt}from"./d3-interpolate-Ct9kki6l.js";import{a as bt,b as kt}from"./d3-axis-pCwzqJ1S.js";import{t as Ct}from"./d3-time-format-DB2uBv1t.js";import{d as St,c as wt,n as Tt,o as _t,m as vt,p as Et,q as At,i as Lt,b as Bt,a as $t,t as Dt,s as It,r as Ft}from"./d3-time-B1kAM736.js";import{s as Nt,a as Ot,c as Mt,b as Rt,m as Pt,d as qt,e as zt,f as Wt,g as jt,h as Yt,i as Ut,j as Ht,k as Vt,l as Xt,n as Gt,o as Kt,p as Qt,q as Zt,r as Jt,t as te,u as ee,v as ie,w as re}from"./d3-shape-C6CU9yox.js";import{a as se}from"./roughjs-Bkc4UHOn.js";import{c as ne}from"./cytoscape-BsbaL92W.js";import{c as ae}from"./cytoscape-cose-bilkent-CcQu5e-H.js";import{S as oe,j as le,c as ce,r as he,l as de,d as ue}from"./d3-sankey-B6tQBass.js";import{d as pe}from"./d3-scale-chromatic-FDBKL9jm.js";import{i as ge,a as ye,r as fe,s as me,g as xe}from"./@iconify-BUO7KvjM.js";import{m as be}from"./marked-Dw59GjSU.js";import{f as ke}from"./cytoscape-fcose-B58q80h4.js";var Ce,Se=Object.defineProperty,we=(t,e)=>Se(t,"name",{value:e,configurable:!0}),Te=(t,e)=>{for(var i in e)Se(t,i,{get:e[i],enumerable:!0})},_e={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},ve={trace:we(((...t)=>{}),"trace"),debug:we(((...t)=>{}),"debug"),info:we(((...t)=>{}),"info"),warn:we(((...t)=>{}),"warn"),error:we(((...t)=>{}),"error"),fatal:we(((...t)=>{}),"fatal")},Ee=we((function(t="fatal"){let e=_e.fatal;"string"==typeof t?t.toLowerCase()in _e&&(e=_e[t]):"number"==typeof t&&(e=t),ve.trace=()=>{},ve.debug=()=>{},ve.info=()=>{},ve.warn=()=>{},ve.error=()=>{},ve.fatal=()=>{},e<=_e.fatal&&(ve.fatal=(console.error,function(){}.bind())),e<=_e.error&&(ve.error=(console.error,function(){}.bind())),e<=_e.warn&&(ve.warn=(console.warn,function(){}.bind())),e<=_e.info&&(ve.info=(console.info,function(){}.bind())),e<=_e.debug&&(ve.debug=(console.debug,function(){}.bind())),e<=_e.trace&&(ve.trace=(console.debug,function(){}.bind()))}),"setLogLevel"),Ae=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,Le=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Be=/\s*%%.*\n/gm,$e=(t=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},we(t,"UnknownDiagramError"),t),De={},Ie=we((function(t,e){t=t.replace(Ae,"").replace(Le,"").replace(Be,"\n");for(const[i,{detector:r}]of Object.entries(De)){if(r(t,e))return i}throw new $e(`No diagram type detected matching given configuration for text: ${t}`)}),"detectType"),Fe=we(((...t)=>{for(const{id:e,detector:i,loader:r}of t)Ne(e,i,r)}),"registerLazyLoadedDiagrams"),Ne=we(((t,e,i)=>{De[t]&&ve.warn(`Detector with key ${t} already exists. Overwriting.`),De[t]={detector:e,loader:i},ve.debug(`Detector with key ${t} added${i?" with loader":""}`)}),"addDetector"),Oe=we((t=>De[t].loader),"getDiagramLoader"),Me=we(((t,e,{depth:i=2,clobber:r=!1}={})=>{const s={depth:i,clobber:r};return Array.isArray(e)&&!Array.isArray(t)?(e.forEach((e=>Me(t,e,s))),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach((e=>{t.includes(e)||t.push(e)})),t):void 0===t||i<=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((s=>{"object"!=typeof e[s]||void 0!==t[s]&&"object"!=typeof t[s]?(r||"object"!=typeof t[s]&&"object"!=typeof e[s])&&(t[s]=e[s]):(void 0===t[s]&&(t[s]=Array.isArray(e[s])?[]:{}),t[s]=Me(t[s],e[s],{depth:i-1,clobber:r}))})),t)}),"assignWithDepth"),Re=Me,Pe="#ffffff",qe="#f2f2f2",ze=we(((t,e)=>et(t,e?{s:-40,l:10}:{s:-40,l:-10})),"mkBorder"),We=(we(e=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(){var t,e,i,r,s,n,a,o,l,c,h,d,u,p,g,y,f,m,x,b,k;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||et(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||et(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ze(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ze(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ze(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ze(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||it(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||it(this.tertiaryColor),this.lineColor=this.lineColor||it(this.background),this.arrowheadColor=this.arrowheadColor||it(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,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?st(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||this.actorBorder,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||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||it(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||nt(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.darkMode?(this.rowOdd=this.rowOdd||st(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||st(this.mainBkg,10)):(this.rowOdd=this.rowOdd||nt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||nt(this.mainBkg,5)),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||et(this.primaryColor,{h:30}),this.cScale4=this.cScale4||et(this.primaryColor,{h:60}),this.cScale5=this.cScale5||et(this.primaryColor,{h:90}),this.cScale6=this.cScale6||et(this.primaryColor,{h:120}),this.cScale7=this.cScale7||et(this.primaryColor,{h:150}),this.cScale8=this.cScale8||et(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||et(this.primaryColor,{h:270}),this.cScale10=this.cScale10||et(this.primaryColor,{h:300}),this.cScale11=this.cScale11||et(this.primaryColor,{h:330}),this.darkMode)for(let S=0;S{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},"Theme"),e),je=we((t=>{const e=new We;return e.calculate(t),e}),"getThemeVariables"),Ye=(we(i=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=nt(this.primaryColor,16),this.tertiaryColor=et(this.primaryColor,{h:-160}),this.primaryBorderColor=it(this.background),this.secondaryBorderColor=ze(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ze(this.tertiaryColor,this.darkMode),this.primaryTextColor=it(this.primaryColor),this.secondaryTextColor=it(this.secondaryColor),this.tertiaryTextColor=it(this.tertiaryColor),this.lineColor=it(this.background),this.textColor=it(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=nt(it("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=rt(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=st("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=st(this.sectionBkgColor,10),this.taskBorderColor=rt(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=rt(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=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||nt(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||st(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){var t,e,i,r,s,n,a,o,l,c,h,d,u,p,g,y,f,m,x,b,k;this.secondBkg=nt(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=nt(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,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=nt(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.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,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=et(this.primaryColor,{h:64}),this.fillType3=et(this.secondaryColor,{h:64}),this.fillType4=et(this.primaryColor,{h:-64}),this.fillType5=et(this.secondaryColor,{h:-64}),this.fillType6=et(this.primaryColor,{h:128}),this.fillType7=et(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||et(this.primaryColor,{h:30}),this.cScale4=this.cScale4||et(this.primaryColor,{h:60}),this.cScale5=this.cScale5||et(this.primaryColor,{h:90}),this.cScale6=this.cScale6||et(this.primaryColor,{h:120}),this.cScale7=this.cScale7||et(this.primaryColor,{h:150}),this.cScale8=this.cScale8||et(this.primaryColor,{h:210}),this.cScale9=this.cScale9||et(this.primaryColor,{h:270}),this.cScale10=this.cScale10||et(this.primaryColor,{h:300}),this.cScale11=this.cScale11||et(this.primaryColor,{h:330});for(let C=0;C{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},"Theme"),i),Ue=we((t=>{const e=new Ye;return e.calculate(t),e}),"getThemeVariables"),He=(we(r=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=et(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=et(this.primaryColor,{h:-160}),this.primaryBorderColor=ze(this.primaryColor,this.darkMode),this.secondaryBorderColor=ze(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ze(this.tertiaryColor,this.darkMode),this.primaryTextColor=it(this.primaryColor),this.secondaryTextColor=it(this.secondaryColor),this.tertiaryTextColor=it(this.tertiaryColor),this.lineColor=it(this.background),this.textColor=it(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="rgba(232,232,232, 0.8)",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="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="#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=rt(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=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.updateColors()}updateColors(){var t,e,i,r,s,n,a,o,l,c,h,d,u,p,g,y,f,m,x,b,k;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||et(this.primaryColor,{h:30}),this.cScale4=this.cScale4||et(this.primaryColor,{h:60}),this.cScale5=this.cScale5||et(this.primaryColor,{h:90}),this.cScale6=this.cScale6||et(this.primaryColor,{h:120}),this.cScale7=this.cScale7||et(this.primaryColor,{h:150}),this.cScale8=this.cScale8||et(this.primaryColor,{h:210}),this.cScale9=this.cScale9||et(this.primaryColor,{h:270}),this.cScale10=this.cScale10||et(this.primaryColor,{h:300}),this.cScale11=this.cScale11||et(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||st(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||st(this.tertiaryColor,40);for(let C=0;C{"calculated"===this[t]&&(this[t]=void 0)})),"object"!=typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach((e=>{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},"Theme"),r),Ve=we((t=>{const e=new He;return e.calculate(t),e}),"getThemeVariables"),Xe=(we(s=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=nt("#cde498",10),this.primaryBorderColor=ze(this.primaryColor,this.darkMode),this.secondaryBorderColor=ze(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ze(this.tertiaryColor,this.darkMode),this.primaryTextColor=it(this.primaryColor),this.secondaryTextColor=it(this.secondaryColor),this.tertiaryTextColor=it(this.primaryColor),this.lineColor=it(this.background),this.textColor=it(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="calculated",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=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){var t,e,i,r,s,n,a,o,l,c,h,d,u,p,g,y,f,m,x,b,k;this.actorBorder=st(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||et(this.primaryColor,{h:30}),this.cScale4=this.cScale4||et(this.primaryColor,{h:60}),this.cScale5=this.cScale5||et(this.primaryColor,{h:90}),this.cScale6=this.cScale6||et(this.primaryColor,{h:120}),this.cScale7=this.cScale7||et(this.primaryColor,{h:150}),this.cScale8=this.cScale8||et(this.primaryColor,{h:210}),this.cScale9=this.cScale9||et(this.primaryColor,{h:270}),this.cScale10=this.cScale10||et(this.primaryColor,{h:300}),this.cScale11=this.cScale11||et(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||st(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||st(this.tertiaryColor,40);for(let C=0;C{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},"Theme"),s),Ge=we((t=>{const e=new Xe;return e.calculate(t),e}),"getThemeVariables"),Ke=(we(n=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=nt(this.contrast,55),this.background="#ffffff",this.tertiaryColor=et(this.primaryColor,{h:-160}),this.primaryBorderColor=ze(this.primaryColor,this.darkMode),this.secondaryBorderColor=ze(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ze(this.tertiaryColor,this.darkMode),this.primaryTextColor=it(this.primaryColor),this.secondaryTextColor=it(this.secondaryColor),this.tertiaryTextColor=it(this.tertiaryColor),this.lineColor=it(this.background),this.textColor=it(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=this.actorBorder,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=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||nt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){var t,e,i,r,s,n,a,o,l,c,h,d,u,p,g,y,f,m,x,b,k;this.secondBkg=nt(this.contrast,55),this.border2=this.contrast,this.actorBorder=nt(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",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 C=0;C{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},"Theme"),n),Qe={base:{getThemeVariables:je},dark:{getThemeVariables:Ue},default:{getThemeVariables:Ve},forest:{getThemeVariables:Ge},neutral:{getThemeVariables:we((t=>{const e=new Ke;return e.calculate(t),e}),"getThemeVariables")}},Ze={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"]},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{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},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,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"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:""},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},Je={...Ze, +// Set, even though they're `undefined` so that `configKeys` finds these keys +// TODO: Should we replace these with `null` so that they can go in the JSON Schema? +deterministicIDSeed:void 0,elk:{ +// mergeEdges is needed here to be considered +mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF"},themeCSS:void 0, +// add non-JSON default config values +themeVariables:Qe.default.getThemeVariables(),sequence:{...Ze.sequence,messageFont:we((function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}}),"messageFont"),noteFont:we((function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}}),"noteFont"),actorFont:we((function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}}),"actorFont")},class:{hideEmptyMembersBox:!1},gantt:{...Ze.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Ze.c4,useWidth:void 0,personFont:we((function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}}),"personFont"),external_personFont:we((function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}}),"external_personFont"),systemFont:we((function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}}),"systemFont"),external_systemFont:we((function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}}),"external_systemFont"),system_dbFont:we((function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}}),"system_dbFont"),external_system_dbFont:we((function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}}),"external_system_dbFont"),system_queueFont:we((function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}}),"system_queueFont"),external_system_queueFont:we((function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}}),"external_system_queueFont"),containerFont:we((function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}}),"containerFont"),external_containerFont:we((function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}}),"external_containerFont"),container_dbFont:we((function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}}),"container_dbFont"),external_container_dbFont:we((function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}}),"external_container_dbFont"),container_queueFont:we((function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}}),"container_queueFont"),external_container_queueFont:we((function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}}),"external_container_queueFont"),componentFont:we((function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}}),"componentFont"),external_componentFont:we((function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}}),"external_componentFont"),component_dbFont:we((function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}}),"component_dbFont"),external_component_dbFont:we((function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}}),"external_component_dbFont"),component_queueFont:we((function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}}),"component_queueFont"),external_component_queueFont:we((function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}}),"external_component_queueFont"),boundaryFont:we((function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}}),"boundaryFont"),messageFont:we((function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}}),"messageFont")},pie:{...Ze.pie,useWidth:984},xyChart:{...Ze.xyChart,useWidth:void 0},requirement:{...Ze.requirement,useWidth:void 0},packet:{...Ze.packet},radar:{...Ze.radar}},ti=we(((t,e="")=>Object.keys(t).reduce(((i,r)=>Array.isArray(t[r])?i:"object"==typeof t[r]&&null!==t[r]?[...i,e+r,...ti(t[r],"")]:[...i,e+r]),[])),"keyify"),ei=new Set(ti(Je,"")),ii=Je,ri=we((t=>{if(ve.debug("sanitizeDirective called with",t),"object"==typeof t&&null!=t)if(Array.isArray(t))t.forEach((t=>ri(t)));else{for(const e of Object.keys(t)){if(ve.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!ei.has(e)||null==t[e]){ve.debug("sanitize deleting key: ",e),delete t[e];continue}if("object"==typeof t[e]){ve.debug("sanitizing object",e),ri(t[e]);continue}const i=["themeCSS","fontFamily","altFontFamily"];for(const r of i)e.includes(r)&&(ve.debug("sanitizing css option",e),t[e]=si(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const i=t.themeVariables[e];(null==i?void 0:i.match)&&!i.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}ve.debug("After sanitization",t)}}),"sanitizeDirective"),si=we((t=>{let e=0,i=0;for(const r of t){if(e{let i=Re({},t),r={};for(const s of e)fi(s),r=Re(r,s);if(i=Re(i,r),r.theme&&r.theme in Qe){const t=Re({},Ce),e=Re(t.themeVariables||{},r.themeVariables);i.theme&&i.theme in Qe&&(i.themeVariables=Qe[i.theme].getThemeVariables(e))}return Si(li=i),li}),"updateCurrentConfig"),hi=we((t=>(ai=Re({},ni),ai=Re(ai,t),t.theme&&Qe[t.theme]&&(ai.themeVariables=Qe[t.theme].getThemeVariables(t.themeVariables)),ci(ai,oi),ai)),"setSiteConfig"),di=we((t=>{Ce=Re({},t)}),"saveConfigFromInitialize"),ui=we((t=>(ai=Re(ai,t),ci(ai,oi),ai)),"updateSiteConfig"),pi=we((()=>Re({},ai)),"getSiteConfig"),gi=we((t=>(Si(t),Re(li,t),yi())),"setConfig"),yi=we((()=>Re({},li)),"getConfig"),fi=we((t=>{t&&(["secure",...ai.secure??[]].forEach((e=>{Object.hasOwn(t,e)&&(ve.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])})),Object.keys(t).forEach((e=>{e.startsWith("__")&&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]&&fi(t[e])})))}),"sanitize"),mi=we((t=>{var e;ri(t),t.fontFamily&&!(null==(e=t.themeVariables)?void 0:e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),oi.push(t),ci(ai,oi)}),"addDirective"),xi=we(((t=ai)=>{ci(t,oi=[])}),"reset"),bi={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},ki={},Ci=we((t=>{ki[t]||(ve.warn(bi[t]),ki[t]=!0)}),"issueWarning"),Si=we((t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&Ci("LAZY_LOAD_DEPRECATED")}),"checkConfig"),wi=//gi,Ti=we((t=>{if(!t)return[""];return Fi(t).replace(/\\n/g,"#br#").split("#br#")}),"getRows"),_i=(()=>{let t=!1;return()=>{t||(vi(),t=!0)}})();function vi(){const t="data-temp-href-target";W.addHook("beforeSanitizeAttributes",(e=>{e instanceof Element&&"A"===e.tagName&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")})),W.addHook("afterSanitizeAttributes",(e=>{e instanceof Element&&"A"===e.tagName&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),"_blank"===e.getAttribute("target")&&e.setAttribute("rel","noopener"))}))}we(vi,"setupDompurifyHooks");var Ei=we((t=>{_i();return W.sanitize(t)}),"removeScript"),Ai=we(((t,e)=>{var i;if(!1!==(null==(i=e.flowchart)?void 0:i.htmlLabels)){const i=e.securityLevel;"antiscript"===i||"strict"===i?t=Ei(t):"loose"!==i&&(t=(t=(t=Fi(t)).replace(//g,">")).replace(/=/g,"="),t=Ii(t))}return t}),"sanitizeMore"),Li=we(((t,e)=>t?t=e.dompurifyConfig?W.sanitize(Ai(t,e),e.dompurifyConfig).toString():W.sanitize(Ai(t,e),{FORBID_TAGS:["style"]}).toString():t),"sanitizeText"),Bi=we(((t,e)=>"string"==typeof t?Li(t,e):t.flat().map((t=>Li(t,e)))),"sanitizeTextOrArray"),$i=we((t=>wi.test(t)),"hasBreaks"),Di=we((t=>t.split(wi)),"splitBreaks"),Ii=we((t=>t.replace(/#br#/g,"
")),"placeholderToBreak"),Fi=we((t=>t.replace(wi,"#br#")),"breakToPlaceholder"),Ni=we((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}),"getUrl"),Oi=we((t=>!1!==t&&!["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),Mi=we((function(...t){const e=t.filter((t=>!isNaN(t)));return Math.max(...e)}),"getMax"),Ri=we((function(...t){const e=t.filter((t=>!isNaN(t)));return Math.min(...e)}),"getMin"),Pi=we((function(t){const e=t.split(/(,)/),i=[];for(let r=0;r0&&r+1Math.max(0,t.split(e).length-1)),"countOccurrence"),zi=we(((t,e)=>{const i=qi(t,"~"),r=qi(e,"~");return 1===i&&1===r}),"shouldCombineSets"),Wi=we((t=>{const e=qi(t,"~");let i=!1;if(e<=1)return t;e%2!=0&&t.startsWith("~")&&(t=t.substring(1),i=!0);const r=[...t];let s=r.indexOf("~"),n=r.lastIndexOf("~");for(;-1!==s&&-1!==n&&s!==n;)r[s]="<",r[n]=">",s=r.indexOf("~"),n=r.lastIndexOf("~");return i&&r.unshift("~"),r.join("")}),"processSet"),ji=we((()=>void 0!==window.MathMLElement),"isMathMLSupported"),Yi=/\$\$(.*)\$\$/g,Ui=we((t=>{var e;return((null==(e=t.match(Yi))?void 0:e.length)??0)>0}),"hasKatex"),Hi=we((async(t,e)=>{t=await Vi(t,e);const i=document.createElement("div");i.innerHTML=t,i.id="katex-temp",i.style.visibility="hidden",i.style.position="absolute",i.style.top="0";const r=document.querySelector("body");null==r||r.insertAdjacentElement("beforeend",i);const s={width:i.clientWidth,height:i.clientHeight};return i.remove(),s}),"calculateMathMLDimensions"),Vi=we((async(t,e)=>{if(!Ui(t))return t;if(!(ji()||e.legacyMathML||e.forceLegacyMathML))return t.replace(Yi,"MathML is unsupported in this environment.");const{default:i}=await P((async()=>{const{default:t}=await import("./katex-BWqyRjd8.js").then((t=>t.k));return{default:t}}),[],import.meta.url),r=e.forceLegacyMathML||!ji()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(wi).map((t=>Ui(t)?`
${t}
`:`
${t}
`)).join("").replace(Yi,((t,e)=>i.renderToString(e,{throwOnError:!0,displayMode:!0,output:r}).replace(/\n/g," ").replace(//g,"")))}),"renderKatex"),Xi={getRows:Ti,sanitizeText:Li,sanitizeTextOrArray:Bi,hasBreaks:$i,splitBreaks:Di,lineBreakRegex:wi,removeScript:Ei,getUrl:Ni,evaluate:Oi,getMax:Mi,getMin:Ri},Gi=we((function(t,e){for(let i of e)t.attr(i[0],i[1])}),"d3Attrs"),Ki=we((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}),"calculateSvgSizeAttrs"),Qi=we((function(t,e,i,r){const s=Ki(e,i,r);Gi(t,s)}),"configureSvgSize"),Zi=we((function(t,e,i,r){const s=e.node().getBBox(),n=s.width,a=s.height;ve.info(`SVG bounds: ${n}x${a}`,s);let o=0,l=0;ve.info(`Graph bounds: ${o}x${l}`,t),o=n+2*i,l=a+2*i,ve.info(`Calculated bounds: ${o}x${l}`),Qi(e,l,o,r);const c=`${s.x-i} ${s.y-i} ${s.width+2*i} ${s.height+2*i}`;e.attr("viewBox",c)}),"setupGraphViewbox"),Ji={},tr=we(((t,e,i)=>{let r="";return t in Ji&&Ji[t]?r=Ji[t](i):ve.warn(`No theme found for ${t}`),` & {\n font-family: ${i.fontFamily};\n font-size: ${i.fontSize};\n fill: ${i.textColor}\n }\n @keyframes edge-animation-frame {\n from {\n stroke-dashoffset: 0;\n }\n }\n @keyframes dash {\n to {\n stroke-dashoffset: 0;\n }\n }\n & .edge-animation-slow {\n stroke-dasharray: 9,5 !important;\n stroke-dashoffset: 900;\n animation: dash 50s linear infinite;\n stroke-linecap: round;\n }\n & .edge-animation-fast {\n stroke-dasharray: 9,5 !important;\n stroke-dashoffset: 900;\n animation: dash 20s linear infinite;\n stroke-linecap: round;\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: 1px;\n }\n & .edge-thickness-thick {\n stroke-width: 3.5px\n }\n & .edge-pattern-solid {\n stroke-dasharray: 0;\n }\n & .edge-thickness-invisible {\n stroke-width: 0;\n fill: none;\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 & p {\n margin: 0\n }\n\n ${r}\n\n ${e}\n`}),"getStyles"),er=we(((t,e)=>{void 0!==e&&(Ji[t]=e)}),"addStylesForDiagram"),ir=tr,rr={};Te(rr,{clear:()=>lr,getAccDescription:()=>ur,getAccTitle:()=>hr,getDiagramTitle:()=>gr,setAccDescription:()=>dr,setAccTitle:()=>cr,setDiagramTitle:()=>pr});var sr="",nr="",ar="",or=we((t=>Li(t,yi())),"sanitizeText"),lr=we((()=>{sr="",ar="",nr=""}),"clear"),cr=we((t=>{sr=or(t).replace(/^\s+/g,"")}),"setAccTitle"),hr=we((()=>sr),"getAccTitle"),dr=we((t=>{ar=or(t).replace(/\n\s+/g,"\n")}),"setAccDescription"),ur=we((()=>ar),"getAccDescription"),pr=we((t=>{nr=or(t)}),"setDiagramTitle"),gr=we((()=>nr),"getDiagramTitle"),yr=ve,fr=Ee,mr=yi,xr=gi,br=ni,kr=we((t=>Li(t,mr())),"sanitizeText"),Cr=Zi,Sr=we((()=>rr),"getCommonDb"),wr={},Tr=we(((t,e,i)=>{var r;wr[t]&&yr.warn(`Diagram with id ${t} already registered. Overwriting.`),wr[t]=e,i&&Ne(t,i),er(t,e.styles),null==(r=e.injectUtils)||r.call(e,yr,fr,mr,kr,Cr,Sr(),(()=>{}))}),"registerDiagram"),_r=we((t=>{if(t in wr)return wr[t];throw new vr(t)}),"getDiagram"),vr=(a=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},we(a,"DiagramNotFoundError"),a);function Er(t){return null==t}function Ar(t){return"object"==typeof t&&null!==t}function Lr(t){return Array.isArray(t)?t:Er(t)?[]:[t]}function Br(t,e){var i,r,s,n;if(e)for(i=0,r=(n=Object.keys(e)).length;io&&(e=r-o+(n=" ... ").length),i-r>o&&(i=r+o-(a=" ...").length),{str:n+t.slice(e,i).replace(/\t/g,"→")+a,pos:r-e+n.length}}function Rr(t,e){return Ir.repeat(" ",e-t.length)+t}function Pr(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,s=[0],n=[],a=-1;i=r.exec(t.buffer);)n.push(i.index),s.push(i.index+i[0].length),t.position<=i.index&&a<0&&(a=s.length-2);a<0&&(a=s.length-1);var o,l,c="",h=Math.min(t.line+e.linesAfter,n.length).toString().length,d=e.maxLength-(e.indent+h+3);for(o=1;o<=e.linesBefore&&!(a-o<0);o++)l=Mr(t.buffer,s[a-o],n[a-o],t.position-(s[a]-s[a-o]),d),c=Ir.repeat(" ",e.indent)+Rr((t.line-o+1).toString(),h)+" | "+l.str+"\n"+c;for(l=Mr(t.buffer,s[a],n[a],t.position,d),c+=Ir.repeat(" ",e.indent)+Rr((t.line+1).toString(),h)+" | "+l.str+"\n",c+=Ir.repeat("-",e.indent+h+3+l.pos)+"^\n",o=1;o<=e.linesAfter&&!(a+o>=n.length);o++)l=Mr(t.buffer,s[a+o],n[a+o],t.position-(s[a]-s[a+o]),d),c+=Ir.repeat(" ",e.indent)+Rr((t.line+o+1).toString(),h)+" | "+l.str+"\n";return c.replace(/\n$/,"")}we(Mr,"getLine"),we(Rr,"padStart"),we(Pr,"makeSnippet");var qr=Pr,zr=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Wr=["scalar","sequence","mapping"];function jr(t){var e={};return null!==t&&Object.keys(t).forEach((function(i){t[i].forEach((function(t){e[String(t)]=i}))})),e}function Yr(t,e){if(e=e||{},Object.keys(e).forEach((function(e){if(-1===zr.indexOf(e))throw new Or('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=jr(e.styleAliases||null),-1===Wr.indexOf(this.kind))throw new Or('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}we(jr,"compileStyleAliases"),we(Yr,"Type$1");var Ur=Yr;function Hr(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 Vr(){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(we(r,"collectType"),t=0,e=arguments.length;t=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)}),"binary"),octal:we((function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)}),"octal"),decimal:we((function(t){return t.toString(10)}),"decimal"), +/* eslint-disable max-len */ +hexadecimal:we((function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}),"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),ds=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))$");function us(t){return null!==t&&!(!ds.test(t)||// Quick hack to not allow integers end with `_` +// Probably should update regexp & check speed +"_"===t[t.length-1])}function ps(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)}we(us,"resolveYamlFloat"),we(ps,"constructYamlFloat");var gs=/^[-+]?[0-9]+e/;function ys(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(Ir.isNegativeZero(t))return"-0.0";return i=t.toString(10),gs.test(i)?i.replace("e",".e"):i}function fs(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||Ir.isNegativeZero(t))}we(ys,"representYamlFloat"),we(fs,"isFloat");var ms=new Ur("tag:yaml.org,2002:float",{kind:"scalar",resolve:us,construct:ps,predicate:fs,represent:ys,defaultStyle:"lowercase"}),xs=Gr.extend({implicit:[Jr,rs,hs,ms]}),bs=xs,ks=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Cs=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]))?))?$");function Ss(t){return null!==t&&(null!==ks.exec(t)||null!==Cs.exec(t))}function ws(t){var e,i,r,s,n,a,o,l,c=0,h=null;if(null===(e=ks.exec(t))&&(e=Cs.exec(t)),null===e)throw new Error("Date resolve error");if(i=+e[1],r=+e[2]-1,s=+e[3],!e[4])return new Date(Date.UTC(i,r,s));if(n=+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,s,n,a,o,c)),h&&l.setTime(l.getTime()-h),l}function Ts(t){return t.toISOString()}we(Ss,"resolveYamlTimestamp"),we(ws,"constructYamlTimestamp"),we(Ts,"representYamlTimestamp");var _s=new Ur("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Ss,construct:ws,instanceOf:Date,represent:Ts});function vs(t){return"<<"===t||null===t}we(vs,"resolveYamlMerge");var Es=new Ur("tag:yaml.org,2002:merge",{kind:"scalar",resolve:vs}),As="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";function Ls(t){if(null===t)return!1;var e,i,r=0,s=t.length,n=As;for(i=0;i64)){if(e<0)return!1;r+=6}return r%8==0}function Bs(t){var e,i,r=t.replace(/[\r\n=]/g,""),s=r.length,n=As,a=0,o=[];for(e=0;e>16&255),o.push(a>>8&255),o.push(255&a)),a=a<<6|n.indexOf(r.charAt(e));return 0===(i=s%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)}function $s(t){var e,i,r="",s=0,n=t.length,a=As;for(e=0;e>18&63],r+=a[s>>12&63],r+=a[s>>6&63],r+=a[63&s]),s=(s<<8)+t[e];return 0===(i=n%3)?(r+=a[s>>18&63],r+=a[s>>12&63],r+=a[s>>6&63],r+=a[63&s]):2===i?(r+=a[s>>10&63],r+=a[s>>4&63],r+=a[s<<2&63],r+=a[64]):1===i&&(r+=a[s>>2&63],r+=a[s<<4&63],r+=a[64],r+=a[64]),r}function Ds(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)}we(Ls,"resolveYamlBinary"),we(Bs,"constructYamlBinary"),we($s,"representYamlBinary"),we(Ds,"isBinary");var Is=new Ur("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Ls,construct:Bs,predicate:Ds,represent:$s}),Fs=Object.prototype.hasOwnProperty,Ns=Object.prototype.toString;function Os(t){if(null===t)return!0;var e,i,r,s,n,a=[],o=t;for(e=0,i=o.length;e>10),56320+(t-65536&1023))}we(tn,"_class"),we(en,"is_EOL"),we(rn,"is_WHITE_SPACE"),we(sn,"is_WS_OR_EOL"),we(nn,"is_FLOW_INDICATOR"),we(an,"fromHexCode"),we(on,"escapedHexLen"),we(ln,"fromDecimalCode"),we(cn,"simpleEscapeSequence"),we(hn,"charFromCodepoint");var dn,un=new Array(256),pn=new Array(256);for(dn=0;dn<256;dn++)un[dn]=cn(dn)?1:0,pn[dn]=cn(dn);function gn(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||Vs,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 yn(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=qr(i),new Or(e,i)}function fn(t,e){throw yn(t,e)}function mn(t,e){t.onWarning&&t.onWarning.call(null,yn(t,e))}we(gn,"State$1"),we(yn,"generateError"),we(fn,"throwError"),we(mn,"throwWarning");var xn={YAML:we((function(t,e,i){var r,s,n;null!==t.version&&fn(t,"duplication of %YAML directive"),1!==i.length&&fn(t,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(i[0]))&&fn(t,"ill-formed argument of the YAML directive"),s=parseInt(r[1],10),n=parseInt(r[2],10),1!==s&&fn(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=n<2,1!==n&&2!==n&&mn(t,"unsupported YAML version of the document")}),"handleYamlDirective"),TAG:we((function(t,e,i){var r,s;2!==i.length&&fn(t,"TAG directive accepts exactly two arguments"),r=i[0],s=i[1],Zs.test(r)||fn(t,"ill-formed tag handle (first argument) of the TAG directive"),Xs.call(t.tagMap,r)&&fn(t,'there is a previously declared suffix for "'+r+'" tag handle'),Js.test(s)||fn(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch(n){fn(t,"tag prefix is malformed: "+s)}t.tagMap[r]=s}),"handleTagDirective")};function bn(t,e,i,r){var s,n,a,o;if(e1&&(t.result+=Ir.repeat("\n",e-1))}function vn(t,e,i){var r,s,n,a,o,l,c,h,d=t.kind,u=t.result;if(sn(h=t.input.charCodeAt(t.position))||nn(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)&&(sn(r=t.input.charCodeAt(t.position+1))||i&&nn(r)))return!1;for(t.kind="scalar",t.result="",s=n=t.position,a=!1;0!==h;){if(58===h){if(sn(r=t.input.charCodeAt(t.position+1))||i&&nn(r))break}else if(35===h){if(sn(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&Tn(t)||i&&nn(h))break;if(en(h)){if(o=t.line,l=t.lineStart,c=t.lineIndent,wn(t,!1,-1),t.lineIndent>=e){a=!0,h=t.input.charCodeAt(t.position);continue}t.position=n,t.line=o,t.lineStart=l,t.lineIndent=c;break}}a&&(bn(t,s,n,!1),_n(t,t.line-o),s=n=t.position,a=!1),rn(h)||(n=t.position+1),h=t.input.charCodeAt(++t.position)}return bn(t,s,n,!1),!!t.result||(t.kind=d,t.result=u,!1)}function En(t,e){var i,r,s;if(39!==(i=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,r=s=t.position;0!==(i=t.input.charCodeAt(t.position));)if(39===i){if(bn(t,r,t.position,!0),39!==(i=t.input.charCodeAt(++t.position)))return!0;r=t.position,t.position++,s=t.position}else en(i)?(bn(t,r,s,!0),_n(t,wn(t,!1,e)),r=s=t.position):t.position===t.lineStart&&Tn(t)?fn(t,"unexpected end of the document within a single quoted scalar"):(t.position++,s=t.position);fn(t,"unexpected end of the stream within a single quoted scalar")}function An(t,e){var i,r,s,n,a,o;if(34!==(o=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,i=r=t.position;0!==(o=t.input.charCodeAt(t.position));){if(34===o)return bn(t,i,t.position,!0),t.position++,!0;if(92===o){if(bn(t,i,t.position,!0),en(o=t.input.charCodeAt(++t.position)))wn(t,!1,e);else if(o<256&&un[o])t.result+=pn[o],t.position++;else if((a=on(o))>0){for(s=a,n=0;s>0;s--)(a=an(o=t.input.charCodeAt(++t.position)))>=0?n=(n<<4)+a:fn(t,"expected hexadecimal character");t.result+=hn(n),t.position++}else fn(t,"unknown escape sequence");i=r=t.position}else en(o)?(bn(t,i,r,!0),_n(t,wn(t,!1,e)),i=r=t.position):t.position===t.lineStart&&Tn(t)?fn(t,"unexpected end of the document within a double quoted scalar"):(t.position++,r=t.position)}fn(t,"unexpected end of the stream within a double quoted scalar")}function Ln(t,e){var i,r,s,n,a,o,l,c,h,d,u,p,g=!0,y=t.tag,f=t.anchor,m=Object.create(null);if(91===(p=t.input.charCodeAt(t.position)))a=93,c=!1,n=[];else{if(123!==p)return!1;a=125,c=!0,n={}}for(null!==t.anchor&&(t.anchorMap[t.anchor]=n),p=t.input.charCodeAt(++t.position);0!==p;){if(wn(t,!0,e),(p=t.input.charCodeAt(t.position))===a)return t.position++,t.tag=y,t.anchor=f,t.kind=c?"mapping":"sequence",t.result=n,!0;g?44===p&&fn(t,"expected the node content, but found ','"):fn(t,"missed comma between flow collection entries"),u=null,o=l=!1,63===p&&sn(t.input.charCodeAt(t.position+1))&&(o=l=!0,t.position++,wn(t,!0,e)),i=t.line,r=t.lineStart,s=t.position,On(t,e,1,!1,!0),d=t.tag,h=t.result,wn(t,!0,e),p=t.input.charCodeAt(t.position),!l&&t.line!==i||58!==p||(o=!0,p=t.input.charCodeAt(++t.position),wn(t,!0,e),On(t,e,1,!1,!0),u=t.result),c?Cn(t,n,m,d,h,u,i,r,s):o?n.push(Cn(t,null,m,d,h,u,i,r,s)):n.push(h),wn(t,!0,e),44===(p=t.input.charCodeAt(t.position))?(g=!0,p=t.input.charCodeAt(++t.position)):g=!1}fn(t,"unexpected end of the stream within a flow collection")}function Bn(t,e){var i,r,s,n,a=1,o=!1,l=!1,c=e,h=0,d=!1;if(124===(n=t.input.charCodeAt(t.position)))r=!1;else{if(62!==n)return!1;r=!0}for(t.kind="scalar",t.result="";0!==n;)if(43===(n=t.input.charCodeAt(++t.position))||45===n)1===a?a=43===n?3:2:fn(t,"repeat of a chomping mode identifier");else{if(!((s=ln(n))>=0))break;0===s?fn(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?fn(t,"repeat of an indentation width identifier"):(c=e+s-1,l=!0)}if(rn(n)){do{n=t.input.charCodeAt(++t.position)}while(rn(n));if(35===n)do{n=t.input.charCodeAt(++t.position)}while(!en(n)&&0!==n)}for(;0!==n;){for(Sn(t),t.lineIndent=0,n=t.input.charCodeAt(t.position);(!l||t.lineIndentc&&(c=t.lineIndent),en(n))h++;else{if(t.lineIndente)&&0!==r)fn(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(m&&(a=t.line,o=t.lineStart,l=t.position),On(t,e,4,!0,s)&&(m?y=t.result:f=t.result),m||(Cn(t,u,p,g,y,f,a,o,l),g=y=f=null),wn(t,!0,-1),c=t.input.charCodeAt(t.position)),(t.line===n||t.lineIndent>e)&&0!==c)fn(t,"bad indentation of a mapping entry");else if(t.lineIndente?g=1:t.lineIndent===e?g=0:t.lineIndente?g=1:t.lineIndent===e?g=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),l=0,c=t.implicitTypes.length;l"),null!==t.result&&d.kind!==t.kind&&fn(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)):fn(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 Mn(t){var e,i,r,s,n=t.position,a=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);0!==(s=t.input.charCodeAt(t.position))&&(wn(t,!0,-1),s=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==s));){for(a=!0,s=t.input.charCodeAt(++t.position),e=t.position;0!==s&&!sn(s);)s=t.input.charCodeAt(++t.position);for(r=[],(i=t.input.slice(e,t.position)).length<1&&fn(t,"directive name must not be less than one character in length");0!==s;){for(;rn(s);)s=t.input.charCodeAt(++t.position);if(35===s){do{s=t.input.charCodeAt(++t.position)}while(0!==s&&!en(s));break}if(en(s))break;for(e=t.position;0!==s&&!sn(s);)s=t.input.charCodeAt(++t.position);r.push(t.input.slice(e,t.position))}0!==s&&Sn(t),Xs.call(xn,i)?xn[i](t,i,r):mn(t,'unknown document directive "'+i+'"')}wn(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,wn(t,!0,-1)):a&&fn(t,"directives end mark is expected"),On(t,t.lineIndent-1,4,!1,!0),wn(t,!0,-1),t.checkLineBreaks&&Ks.test(t.input.slice(n,t.position))&&mn(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Tn(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,wn(t,!0,-1)):t.position=55296&&r<=56319&&e+1=56320&&i<=57343?1024*(r-55296)+i-56320+65536:r}function aa(t){return/^\n* /.test(t)}we(Gn,"State"),we(Kn,"indentString"),we(Qn,"generateNextLine"),we(Zn,"testImplicitResolving"),we(Jn,"isWhitespace"),we(ta,"isPrintable"),we(ea,"isNsCharOrWhitespace"),we(ia,"isPlainSafe"),we(ra,"isPlainSafeFirst"),we(sa,"isPlainSafeLast"),we(na,"codePointAt"),we(aa,"needIndentIndicator");function oa(t,e,i,r,s,n,a,o){var l,c=0,h=null,d=!1,u=!1,p=-1!==r,g=-1,y=ra(na(t,0))&&sa(na(t,t.length-1));if(e||a)for(l=0;l=65536?l+=2:l++){if(!ta(c=na(t,l)))return 5;y=y&&ia(c,h,o),h=c}else{for(l=0;l=65536?l+=2:l++){if(10===(c=na(t,l)))d=!0,p&&(u=u||// Foldable line = too long, and not more-indented. +l-g-1>r&&" "!==t[g+1],g=l);else if(!ta(c))return 5;y=y&&ia(c,h,o),h=c}u=u||p&&l-g-1>r&&" "!==t[g+1]}return d||u?i>9&&aa(t)?5:a?2===n?5:2:u?4:3:!y||a||s(t)?2===n?5:2:1}function la(t,e,i,r,s){t.dump=function(){if(0===e.length)return 2===t.quotingType?'""':"''";if(!t.noCompatMode&&(-1!==Un.indexOf(e)||Hn.test(e)))return 2===t.quotingType?'"'+e+'"':"'"+e+"'";var n=t.indent*Math.max(1,i),a=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-n),o=r||t.flowLevel>-1&&i>=t.flowLevel;function l(e){return Zn(t,e)}switch(we(l,"testAmbiguity"),oa(e,o,t.indent,a,l,t.quotingType,t.forceQuotes&&!r,s)){case 1:return e;case 2:return"'"+e.replace(/'/g,"''")+"'";case 3:return"|"+ca(e,t.indent)+ha(Kn(e,n));case 4:return">"+ca(e,t.indent)+ha(Kn(da(e,a),n));case 5:return'"'+pa(e)+'"';default:throw new Or("impossible error: invalid scalar style")}}()}function ca(t,e){var i=aa(t)?String(e):"",r="\n"===t[t.length-1];return i+(r&&("\n"===t[t.length-2]||"\n"===t)?"+":r?"":"-")+"\n"}function ha(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function da(t,e){for(var i,r,s,n=/(\n+)([^\n]*)/g,a=(i=-1!==(i=t.indexOf("\n"))?i:t.length,n.lastIndex=i,ua(t.slice(0,i),e)),o="\n"===t[0]||" "===t[0];s=n.exec(t);){var l=s[1],c=s[2];r=" "===c[0],a+=l+(o||r||""===c?"":"\n")+ua(c,e),o=r}return a}function ua(t,e){if(""===t||" "===t[0])return t;for(var i,r,s=/ [^ ]/g,n=0,a=0,o=0,l="";i=s.exec(t);)(o=i.index)-n>e&&(r=a>n?a:o,l+="\n"+t.slice(n,r),n=r+1),a=o;return l+="\n",t.length-n>e&&a>n?l+=t.slice(n,a)+"\n"+t.slice(a+1):l+=t.slice(n),l.slice(1)}function pa(t){for(var e,i="",r=0,s=0;s=65536?s+=2:s++)r=na(t,s),!(e=Yn[r])&&ta(r)?(i+=t[s],r>=65536&&(i+=t[s+1])):i+=e||Xn(r);return i}function ga(t,e,i){var r,s,n,a="",o=t.tag;for(r=0,s=i.length;r1024&&(o+="? "),o+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),ba(t,e,a,!1,!1)&&(l+=o+=t.dump));t.tag=c,t.dump="{"+l+"}"}function ma(t,e,i,r){var s,n,a,o,l,c,h="",d=t.tag,u=Object.keys(i);if(!0===t.sortKeys)u.sort();else if("function"==typeof t.sortKeys)u.sort(t.sortKeys);else if(t.sortKeys)throw new Or("sortKeys must be a boolean or a function");for(s=0,n=u.length;s1024)&&(t.dump&&10===t.dump.charCodeAt(0)?c+="?":c+="? "),c+=t.dump,l&&(c+=Qn(t,e)),ba(t,e+1,o,!0,l)&&(t.dump&&10===t.dump.charCodeAt(0)?c+=":":c+=": ",h+=c+=t.dump));t.tag=d,t.dump=h||"{}"}function xa(t,e,i){var r,s,n,a,o,l;for(n=0,a=(s=i?t.explicitTypes:t.implicitTypes).length;n tag resolver accepts not "'+l+'" style');r=o.represent[l](e,l)}t.dump=r}return!0}return!1}function ba(t,e,i,r,s,n,a){t.tag=null,t.dump=i,xa(t,i,!1)||xa(t,i,!0);var o,l=zn.call(t.dump),c=r;r&&(r=t.flowLevel<0||t.flowLevel>e);var h,d,u="[object Object]"===l||"[object Array]"===l;if(u&&(d=-1!==(h=t.duplicates.indexOf(i))),(null!==t.tag&&"?"!==t.tag||d||2!==t.indent&&e>0)&&(s=!1),d&&t.usedDuplicates[h])t.dump="*ref_"+h;else{if(u&&d&&!t.usedDuplicates[h]&&(t.usedDuplicates[h]=!0),"[object Object]"===l)r&&0!==Object.keys(t.dump).length?(ma(t,e,t.dump,s),d&&(t.dump="&ref_"+h+t.dump)):(fa(t,e,t.dump),d&&(t.dump="&ref_"+h+" "+t.dump));else if("[object Array]"===l)r&&0!==t.dump.length?(t.noArrayIndent&&!a&&e>0?ya(t,e-1,t.dump,s):ya(t,e,t.dump,s),d&&(t.dump="&ref_"+h+t.dump)):(ga(t,e,t.dump),d&&(t.dump="&ref_"+h+" "+t.dump));else{if("[object String]"!==l){if("[object Undefined]"===l)return!1;if(t.skipInvalid)return!1;throw new Or("unacceptable kind of an object to dump "+l)}"?"!==t.tag&&la(t,t.dump,e,n,c)}null!==t.tag&&"?"!==t.tag&&(o=encodeURI("!"===t.tag[0]?t.tag.slice(1):t.tag).replace(/!/g,"%21"),o="!"===t.tag[0]?"!"+o:"tag:yaml.org,2002:"===o.slice(0,18)?"!!"+o.slice(18):"!<"+o+">",t.dump=o+" "+t.dump)}return!0}function ka(t,e){var i,r,s=[],n=[];for(Ca(t,s,n),i=0,r=n.length;iArray.isArray(t)?{x:t[0],y:t[1]}:t),"pointTransformer"),Ea=we((t=>({x:we((function(e,i,r){let s=0;const n=va(r[0]).x=0?1:-1)}else if(i===r.length-1&&Object.hasOwn(Ta,t.arrowTypeEnd)){const{angle:e,deltaX:i}=_a(r[r.length-1],r[r.length-2]);s=Ta[t.arrowTypeEnd]*Math.cos(e)*(i>=0?1:-1)}const a=Math.abs(va(e).x-va(r[r.length-1]).x),o=Math.abs(va(e).y-va(r[r.length-1]).y),l=Math.abs(va(e).x-va(r[0]).x),c=Math.abs(va(e).y-va(r[0]).y),h=Ta[t.arrowTypeStart],d=Ta[t.arrowTypeEnd];if(a0&&o0&&c=0?1:-1)}else if(i===r.length-1&&Object.hasOwn(Ta,t.arrowTypeEnd)){const{angle:e,deltaY:i}=_a(r[r.length-1],r[r.length-2]);s=Ta[t.arrowTypeEnd]*Math.abs(Math.sin(e))*(i>=0?1:-1)}const a=Math.abs(va(e).y-va(r[r.length-1]).y),o=Math.abs(va(e).x-va(r[r.length-1]).x),l=Math.abs(va(e).y-va(r[0]).y),c=Math.abs(va(e).x-va(r[0]).x),h=Ta[t.arrowTypeStart],d=Ta[t.arrowTypeEnd];if(a0&&o0&&c{var e,i;const r=(null==(e=null==t?void 0:t.subGraphTitleMargin)?void 0:e.top)??0,s=(null==(i=null==t?void 0:t.subGraphTitleMargin)?void 0:i.bottom)??0;return{subGraphTitleTopMargin:r,subGraphTitleBottomMargin:s,subGraphTitleTotalMargin:r+s}}),"getSubGraphTitleMargins"),La={body:'?',height:80,width:80},Ba=new Map,$a=new Map,Da=we((t=>{for(const e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(ve.debug("Registering icon pack:",e.name),"loader"in e)$a.set(e.name,e.loader);else{if(!("icons"in e))throw ve.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.');Ba.set(e.name,e.icons)}}}),"registerIconPacks"),Ia=we((async(t,e)=>{const i=me(t,!0,void 0!==e);if(!i)throw new Error(`Invalid icon name: ${t}`);const r=i.prefix||e;if(!r)throw new Error(`Icon name must contain a prefix: ${t}`);let s=Ba.get(r);if(!s){const t=$a.get(r);if(!t)throw new Error(`Icon set not found: ${i.prefix}`);try{s={...await t(),prefix:r},Ba.set(r,s)}catch(a){throw ve.error(a),new Error(`Failed to load icon set: ${i.prefix}`)}}const n=xe(s,i.name);if(!n)throw new Error(`Icon not found: ${t}`);return n}),"getRegisteredIconData"),Fa=we((async(t,e)=>{let i;try{i=await Ia(t,null==e?void 0:e.fallbackPrefix)}catch(s){ve.error(s),i=La}const r=ge(i,e);return ye(fe(r.body),r.attributes)}),"getIconSVG"),Na={curveBasis:te,curveBasisClosed:Jt,curveBasisOpen:Zt,curveBumpX:Qt,curveBumpY:Kt,curveBundle:Gt,curveCardinalClosed:Xt,curveCardinalOpen:Vt,curveCardinal:Ht,curveCatmullRomClosed:Ut,curveCatmullRomOpen:Yt,curveCatmullRom:jt,curveLinear:Wt,curveLinearClosed:zt,curveMonotoneX:qt,curveMonotoneY:Pt,curveNatural:Rt,curveStep:Mt,curveStepAfter:Ot,curveStepBefore:Nt},Oa=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Ma=we((function(t,e){const i=Ra(t,/(?:init\b)|(?:initialize\b)/);let r={};if(Array.isArray(i)){const t=i.map((t=>t.args));ri(t),r=Re(r,[...t])}else r=i.args;if(!r)return;let s=Ie(t,e);const n="config";return void 0!==r[n]&&("flowchart-v2"===s&&(s="flowchart"),r[s]=r[n],delete r[n]),r}),"detectInit"),Ra=we((function(t,e=null){var i,r;try{const s=new RegExp(`[%]{2}(?![{]${Oa.source})(?=[}][%]{2}).*\n`,"ig");let n;t=t.trim().replace(s,"").replace(/'/gm,'"'),ve.debug(`Detecting diagram directive${null!==e?" type:"+e:""} based on the text:${t}`);const a=[];for(;null!==(n=Le.exec(t));)if(n.index===Le.lastIndex&&Le.lastIndex++,n&&!e||e&&(null==(i=n[1])?void 0:i.match(e))||e&&(null==(r=n[2])?void 0:r.match(e))){const t=n[1]?n[1]:n[2],e=n[3]?n[3].trim():n[4]?JSON.parse(n[4].trim()):null;a.push({type:t,args:e})}return 0===a.length?{type:t,args:null}:1===a.length?a[0]:a}catch(s){return ve.error(`ERROR: ${s.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}}),"detectDirective"),Pa=we((function(t){return t.replace(Le,"")}),"removeDirectives"),qa=we((function(t,e){for(const[i,r]of e.entries())if(r.match(t))return i;return-1}),"isSubstringInArray");function za(t,e){if(!t)return e;const i=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return Na[i]??e}function Wa(t,e){const i=t.trim();if(i)return"loose"!==e.securityLevel?tt.sanitizeUrl(i):i}we(za,"interpolateToCurve"),we(Wa,"formatUrl");var ja=we(((t,...e)=>{const i=t.split("."),r=i.length-1,s=i[r];let n=window;for(let a=0;a{i+=Ya(t,e),e=t}));return Xa(t,i/2)}function Ha(t){return 1===t.length?t[0]:Ua(t)}we(Ya,"distance"),we(Ua,"traverseEdge"),we(Ha,"calcLabelPosition");var Va=we(((t,e=2)=>{const i=Math.pow(10,e);return Math.round(t*i)/i}),"roundNumber"),Xa=we(((t,e)=>{let i,r=e;for(const s of t){if(i){const t=Ya(s,i);if(0===t)return i;if(t=1)return{x:s.x,y:s.y};if(e>0&&e<1)return{x:Va((1-e)*i.x+e*s.x,5),y:Va((1-e)*i.y+e*s.y,5)}}}i=s}throw new Error("Could not find a suitable point for the given distance")}),"calculatePoint"),Ga=we(((t,e,i)=>{ve.info(`our points ${JSON.stringify(e)}`),e[0]!==i&&(e=e.reverse());const r=Xa(e,25),s=t?10:5,n=Math.atan2(e[0].y-r.y,e[0].x-r.x),a={x:0,y:0};return a.x=Math.sin(n)*s+(e[0].x+r.x)/2,a.y=-Math.cos(n)*s+(e[0].y+r.y)/2,a}),"calcCardinalityPosition");function Ka(t,e,i){const r=structuredClone(i);ve.info("our points",r),"start_left"!==e&&"start_right"!==e&&r.reverse();const s=Xa(r,25+t),n=10+.5*t,a=Math.atan2(r[0].y-s.y,r[0].x-s.x),o={x:0,y:0};return"start_left"===e?(o.x=Math.sin(a+Math.PI)*n+(r[0].x+s.x)/2,o.y=-Math.cos(a+Math.PI)*n+(r[0].y+s.y)/2):"end_right"===e?(o.x=Math.sin(a-Math.PI)*n+(r[0].x+s.x)/2-5,o.y=-Math.cos(a-Math.PI)*n+(r[0].y+s.y)/2-5):"end_left"===e?(o.x=Math.sin(a)*n+(r[0].x+s.x)/2-5,o.y=-Math.cos(a)*n+(r[0].y+s.y)/2-5):(o.x=Math.sin(a)*n+(r[0].x+s.x)/2,o.y=-Math.cos(a)*n+(r[0].y+s.y)/2),o}function Qa(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}}we(Ka,"calcTerminalLabelPosition"),we(Qa,"getStylesFromArray");var Za=0,Ja=we((()=>(Za++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Za)),"generateId");function to(t){let e="";const i="0123456789abcdef";for(let r=0;rto(t.length)),"random"),io=we((function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}}),"getTextObj"),ro=we((function(t,e){const i=e.text.replace(Xi.lineBreakRegex," "),[,r]=yo(e.fontSize),s=t.append("text");s.attr("x",e.x),s.attr("y",e.y),s.style("text-anchor",e.anchor),s.style("font-family",e.fontFamily),s.style("font-size",r),s.style("font-weight",e.fontWeight),s.attr("fill",e.fill),void 0!==e.class&&s.attr("class",e.class);const n=s.append("tspan");return n.attr("x",e.x+2*e.textMargin),n.attr("fill",e.fill),n.text(i),s}),"drawSimpleText"),so=j(((t,e,i)=>{if(!t)return t;if(i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},i),Xi.lineBreakRegex.test(t))return t;const r=t.split(" ").filter(Boolean),s=[];let n="";return r.forEach(((t,a)=>{const o=oo(`${t} `,i),l=oo(n,i);if(o>e){const{hyphenatedStrings:r,remainingWord:a}=no(t,e,"-",i);s.push(n,...r),n=a}else l+o>=e?(s.push(n),n=t):n=[n,t].filter(Boolean).join(" ");a+1===r.length&&s.push(n)})),s.filter((t=>""!==t)).join(i.joinWith)}),((t,e,i)=>`${t}${e}${i.fontSize}${i.fontWeight}${i.fontFamily}${i.joinWith}`)),no=j(((t,e,i="-",r)=>{r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},r);const s=[...t],n=[];let a="";return s.forEach(((t,o)=>{const l=`${a}${t}`;if(oo(l,r)>=e){const t=o+1,e=s.length===t,r=`${l}${i}`;n.push(e?l:r),a=""}else a=l})),{hyphenatedStrings:n,remainingWord:a}}),((t,e,i="-",r)=>`${t}${e}${i}${r.fontSize}${r.fontWeight}${r.fontFamily}`));function ao(t,e){return co(t,e).height}function oo(t,e){return co(t,e).width}we(ao,"calculateTextHeight"),we(oo,"calculateTextWidth");var lo,co=j(((t,e)=>{const{fontSize:i=12,fontFamily:r="Arial",fontWeight:s=400}=e;if(!t)return{width:0,height:0};const[,n]=yo(i),a=["sans-serif",r],o=t.split(Xi.lineBreakRegex),l=[],c=K("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=io();r.text=i||"​";const a=ro(h,r).style("font-size",n).style("font-weight",s).style("font-family",d),o=(a._groups||a)[0][0].getBBox();if(0===o.width&&0===o.height)throw new Error("svg element not in render tree");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}`)),ho=(we(o=class{constructor(t=!1,e){this.count=0,this.count=e?e.length:0,this.next=t?()=>this.count++:()=>Date.now()}},"InitIDGenerator"),o),uo=we((function(t){return lo=lo||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),lo.innerHTML=t,unescape(lo.textContent)}),"entityDecode");function po(t){return"str"in t}we(po,"isDetailedError");var go=we(((t,e,i,r)=>{var s;if(!r)return;const n=null==(s=t.node())?void 0:s.getBBox();n&&t.append("text").text(r).attr("text-anchor","middle").attr("x",n.x+n.width/2).attr("y",-i).attr("class",e)}),"insertTitle"),yo=we((t=>{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]}),"parseFontSize");function fo(t,e){return Y({},t,e)}we(fo,"cleanAndMerge");var mo={assignWithDepth:Re,wrapLabel:so,calculateTextHeight:ao,calculateTextWidth:oo,calculateTextDimensions:co,cleanAndMerge:fo,detectInit:Ma,detectDirective:Ra,isSubstringInArray:qa,interpolateToCurve:za,calcLabelPosition:Ha,calcCardinalityPosition:Ga,calcTerminalLabelPosition:Ka,formatUrl:Wa,getStylesFromArray:Qa,generateId:Ja,random:eo,runFunc:ja,entityDecode:uo,insertTitle:go,parseFontSize:yo,InitIDGenerator:ho},xo=we((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}),"encodeEntities"),bo=we((function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")}),"decodeEntities"),ko=we(((t,e,{counter:i=0,prefix:r,suffix:s},n)=>n||`${r?`${r}_`:""}${t}_${e}_${i}${s?`_${s}`:""}`),"getEdgeId");function Co(t){return t??null}function So(t,{markdownAutoWrap:e}){const i=t.replace(//g,"\n").replace(/\n{2,}/g,"\n"),r=z(i);return!1===e?r.replace(/ /g," "):r}function wo(t,e={}){const i=So(t,e),r=be.lexer(i),s=[[]];let n=0;function a(t,e="normal"){if("text"===t.type){t.text.split("\n").forEach(((t,i)=>{0!==i&&(n++,s.push([])),t.split(" ").forEach((t=>{(t=t.replace(/'/g,"'"))&&s[n].push({content:t,type:e})}))}))}else"strong"===t.type||"em"===t.type?t.tokens.forEach((e=>{a(e,t.type)})):"html"===t.type&&s[n].push({content:t.text,type:"normal"})}return we(a,"processNode"),r.forEach((t=>{var e;"paragraph"===t.type?null==(e=t.tokens)||e.forEach((t=>{a(t)})):"html"===t.type&&s[n].push({content:t.text,type:"normal"})})),s}function To(t,{markdownAutoWrap:e}={}){const i=be.lexer(t);function r(t){var i,s,n;return"text"===t.type?!1===e?t.text.replace(/\n */g,"
").replace(/ /g," "):t.text.replace(/\n */g,"
"):"strong"===t.type?`${null==(i=t.tokens)?void 0:i.map(r).join("")}`:"em"===t.type?`${null==(s=t.tokens)?void 0:s.map(r).join("")}`:"paragraph"===t.type?`

${null==(n=t.tokens)?void 0:n.map(r).join("")}

`:"space"===t.type?"":"html"===t.type?`${t.text}`:"escape"===t.type?t.text:`Unsupported markdown: ${t.type}`}return we(r,"output"),i.map(r).join("")}function _o(t){return Intl.Segmenter?[...(new Intl.Segmenter).segment(t)].map((t=>t.segment)):[...t]}function vo(t,e){return Eo(t,[],_o(e.content),e.type)}function Eo(t,e,i,r){if(0===i.length)return[{content:e.join(""),type:r},{content:"",type:r}];const[s,...n]=i,a=[...e,s];return t([{content:a.join(""),type:r}])?Eo(t,a,n,r):(0===e.length&&s&&(e.push(s),i.shift()),[{content:e.join(""),type:r},{content:i.join(""),type:r}])}function Ao(t,e){if(t.some((({content:t})=>t.includes("\n"))))throw new Error("splitLineToFitWidth does not support newlines in the line");return Lo(t,e)}function Lo(t,e,i=[],r=[]){if(0===t.length)return r.length>0&&i.push(r),i.length>0?i:[];let s="";" "===t[0].content&&(s=" ",t.shift());const n=t.shift()??{content:" ",type:"normal"},a=[...r];if(""!==s&&a.push({content:s,type:"normal"}),a.push(n),e(a))return Lo(t,e,i,a);if(r.length>0)i.push(r),t.unshift(n);else if(n.content){const[r,s]=vo(e,n);i.push([r]),s.content&&t.unshift(s)}return Lo(t,e,i)}function Bo(t,e){e&&t.attr("style",e)}async function $o(t,e,i,r,s=!1){const n=t.append("foreignObject");n.attr("width",10*i+"px"),n.attr("height",10*i+"px");const a=n.append("xhtml:div");let o=e.label;e.label&&Ui(e.label)&&(o=await Vi(e.label.replace(Xi.lineBreakRegex,"\n"),mr()));const l=e.isNode?"nodeLabel":"edgeLabel",c=a.append("span");c.html(o),Bo(c,e.labelStyle),c.attr("class",`${l} ${r}`),Bo(a,e.labelStyle),a.style("display","table-cell"),a.style("white-space","nowrap"),a.style("line-height","1.5"),a.style("max-width",i+"px"),a.style("text-align","center"),a.attr("xmlns","http://www.w3.org/1999/xhtml"),s&&a.attr("class","labelBkg");let h=a.node().getBoundingClientRect();return h.width===i&&(a.style("display","table"),a.style("white-space","break-spaces"),a.style("width",i+"px"),h=a.node().getBoundingClientRect()),n.node()}function Do(t,e,i){return t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*i-.1+"em").attr("dy",i+"em")}function Io(t,e,i){const r=t.append("text"),s=Do(r,1,e);Oo(s,i);const n=s.node().getComputedTextLength();return r.remove(),n}function Fo(t,e,i){var r;const s=t.append("text"),n=Do(s,1,e);Oo(n,[{content:i,type:"normal"}]);const a=null==(r=n.node())?void 0:r.getBoundingClientRect();return a&&s.remove(),a}function No(t,e,i,r=!1){const s=e.append("g"),n=s.insert("rect").attr("class","background").attr("style","stroke: none"),a=s.append("text").attr("y","-10.1");let o=0;for(const l of i){const e=we((e=>Io(s,1.1,e)<=t),"checkWidth"),i=e(l)?[l]:Ao(l,e);for(const t of i){Oo(Do(a,o,1.1),t),o++}}if(r){const t=a.node().getBBox(),e=2;return n.attr("x",t.x-e).attr("y",t.y-e).attr("width",t.width+2*e).attr("height",t.height+2*e),s.node()}return a.node()}function Oo(t,e){t.text(""),e.forEach(((e,i)=>{const r=t.append("tspan").attr("font-style","em"===e.type?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight","strong"===e.type?"bold":"normal");0===i?r.text(e.content):r.text(" "+e.content)}))}function Mo(t){return t.replace(/fa[bklrs]?:fa-[\w-]+/g,( +// cspell: disable-line +t=>``))}we(Co,"handleUndefinedAttr"),we(So,"preprocessMarkdown"),we(wo,"markdownToLines"),we(To,"markdownToHTML"),we(_o,"splitTextToChars"),we(vo,"splitWordToFitWidth"),we(Eo,"splitWordToFitWidthRecursion"),we(Ao,"splitLineToFitWidth"),we(Lo,"splitLineToFitWidthRecursion"),we(Bo,"applyStyle"),we($o,"addHtmlSpan"),we(Do,"createTspan"),we(Io,"computeWidthOfText"),we(Fo,"computeDimensionOfText"),we(No,"createFormattedText"),we(Oo,"updateTextContentAndStyles"),we(Mo,"replaceIconSubstring");var Ro=we((async(t,e="",{style:i="",isTitle:r=!1,classes:s="",useHtmlLabels:n=!0,isNode:a=!0,width:o=200,addSvgBackground:l=!1}={},c)=>{if(ve.debug("XYZ createText",e,i,r,s,n,a,"addSvgBackground: ",l),n){const r=To(e,c),n=Mo(bo(r)),h=e.replace(/\\\\/g,"\\"),d={isNode:a,label:Ui(e)?h:n,labelStyle:i.replace("fill:","color:")};return await $o(t,d,o,s,l)}{const r=No(o,t,wo(e.replace(//g,"
").replace("
","
"),c),!!e&&l);if(a){/stroke:/.exec(i)&&(i=i.replace("stroke:","lineColor:"));const t=i.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");K(r).attr("style",t)}else{const t=i.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");K(r).select("rect").attr("style",t.replace(/background:/g,"fill:"));const e=i.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");K(r).select("text").attr("style",e)}return r}}),"createText"),Po=we((async(t,e,i)=>{var r,s;let n;const a=e.useHtmlLabels||Oi(null==(r=mr())?void 0:r.htmlLabels);n=i||"node default";const o=t.insert("g").attr("class",n).attr("id",e.domId||e.id),l=o.insert("g").attr("class","label").attr("style",Co(e.labelStyle));let c;c=void 0===e.label?"":"string"==typeof e.label?e.label:e.label[0];const h=await Ro(l,Li(bo(c),mr()),{useHtmlLabels:a,width:e.width||(null==(s=mr().flowchart)?void 0:s.wrappingWidth), +// @ts-expect-error -- This is currently not used. Should this be `classes` instead? +cssClasses:"markdown-node-label",style:e.labelStyle,addSvgBackground:!!e.icon||!!e.img});let d=h.getBBox();const u=((null==e?void 0:e.padding)??0)/2;if(a){const t=h.children[0],e=K(h),i=t.getElementsByTagName("img");if(i){const t=""===c.replace(/]*>/g,"").trim();await Promise.all([...i].map((e=>new Promise((i=>{function r(){if(e.style.display="flex",e.style.flexDirection="column",t){const t=mr().fontSize?mr().fontSize:window.getComputedStyle(document.body).fontSize,i=5,[r=ii.fontSize]=yo(t),s=r*i+"px";e.style.minWidth=s,e.style.maxWidth=s}else e.style.width="100%";i(e)}we(r,"setupImage"),setTimeout((()=>{e.complete&&r()})),e.addEventListener("error",r),e.addEventListener("load",r)})))))}d=t.getBoundingClientRect(),e.attr("width",d.width),e.attr("height",d.height)}return a?l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):l.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:o,bbox:d,halfPadding:u,label:l}}),"labelHelper"),qo=we((async(t,e,i)=>{var r,s,n,a,o,l;const c=i.useHtmlLabels||Oi(null==(s=null==(r=mr())?void 0:r.flowchart)?void 0:s.htmlLabels),h=t.insert("g").attr("class","label").attr("style",i.labelStyle||""),d=await Ro(h,Li(bo(e),mr()),{useHtmlLabels:c,width:i.width||(null==(a=null==(n=mr())?void 0:n.flowchart)?void 0:a.wrappingWidth),style:i.labelStyle,addSvgBackground:!!i.icon||!!i.img});let u=d.getBBox();const p=i.padding/2;if(Oi(null==(l=null==(o=mr())?void 0:o.flowchart)?void 0:l.htmlLabels)){const t=d.children[0],e=K(d);u=t.getBoundingClientRect(),e.attr("width",u.width),e.attr("height",u.height)}return c?h.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"):h.attr("transform","translate(0, "+-u.height/2+")"),i.centerLabel&&h.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"),h.insert("rect",":first-child"),{shapeSvg:t,bbox:u,halfPadding:p,label:h}}),"insertLabel"),zo=we(((t,e)=>{const i=e.node().getBBox();t.width=i.width,t.height=i.height}),"updateNodeBounds"),Wo=we(((t,e)=>("handDrawn"===t.look?"rough-node":"node")+" "+t.cssClasses+" "+(e||"")),"getNodeClasses");function jo(t){const e=t.map(((t,e)=>`${0===e?"M":"L"}${t.x},${t.y}`));return e.push("Z"),e.join(" ")}function Yo(t,e,i,r,s,n){const a=[],o=i-t,l=r-e,c=o/n,h=2*Math.PI/c,d=e+l/2;for(let u=0;u<=50;u++){const e=t+u/50*o,i=d+s*Math.sin(h*(e-t));a.push({x:e,y:i})}return a}function Uo(t,e,i,r,s,n){const a=[],o=s*Math.PI/180,l=(n*Math.PI/180-o)/(r-1);for(let c=0;c{var i,r,s=t.x,n=t.y,a=e.x-s,o=e.y-n,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:s+i,y:n+r}}),"intersectRect");function Vo(t,e){e&&t.attr("style",e)}async function Xo(t){const e=K(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),i=e.append("xhtml:div");let r=t.label;t.label&&Ui(t.label)&&(r=await Vi(t.label.replace(Xi.lineBreakRegex,"\n"),mr()));const s=t.isNode?"nodeLabel":"edgeLabel";return i.html('"+r+""),Vo(i,t.labelStyle),i.style("display","inline-block"),i.style("padding-right","1px"),i.style("white-space","nowrap"),i.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}we(Vo,"applyStyle"),we(Xo,"addHtmlLabel");var Go=we((async(t,e,i,r)=>{let s=t||"";if("object"==typeof s&&(s=s[0]),Oi(mr().flowchart.htmlLabels)){s=s.replace(/\\n|\n/g,"
"),ve.info("vertexText"+s);const t={isNode:r,label:bo(s).replace(/fa[blrs]?:fa-[\w-]+/g,(t=>``)),labelStyle:e?e.replace("fill:","color:"):e};return await Xo(t)}{const t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",e.replace("color:","fill:"));let r=[];r="string"==typeof s?s.split(/\\n|\n|/gi):Array.isArray(s)?s:[];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}}),"createLabel"),Ko=we(((t,e,i,r,s)=>["M",t+s,e, +// Move to the first point +"H",t+i-s, +// Draw horizontal line to the beginning of the right corner +"A",s,s,0,0,1,t+i,e+s, +// Draw arc to the right top corner +"V",e+r-s, +// Draw vertical line down to the beginning of the right bottom corner +"A",s,s,0,0,1,t+i-s,e+r, +// Draw arc to the right bottom corner +"H",t+s, +// Draw horizontal line to the beginning of the left bottom corner +"A",s,s,0,0,1,t,e+r-s, +// Draw arc to the left bottom corner +"V",e+s, +// Draw vertical line up to the beginning of the left top corner +"A",s,s,0,0,1,t+s,e, +// Draw arc to the left top corner +"Z"].join(" ")),"createRoundedRectPathD"),Qo=we((t=>{const{handDrawnSeed:e}=mr();return{fill:t,hachureAngle:120, +// angle of hachure, +hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}}),"solidStateFill"),Zo=we((t=>{const e=Jo([...t.cssCompiledStyles||[],...t.cssStyles||[]]);return{stylesMap:e,stylesArray:[...e]}}),"compileStyles"),Jo=we((t=>{const e=new Map;return t.forEach((t=>{const[i,r]=t.split(":");e.set(i.trim(),null==r?void 0:r.trim())})),e}),"styles2Map"),tl=we((t=>"color"===t||"font-size"===t||"font-family"===t||"font-weight"===t||"font-style"===t||"text-decoration"===t||"text-align"===t||"text-transform"===t||"line-height"===t||"letter-spacing"===t||"word-spacing"===t||"text-shadow"===t||"text-overflow"===t||"white-space"===t||"word-wrap"===t||"word-break"===t||"overflow-wrap"===t||"hyphens"===t),"isLabelStyle"),el=we((t=>{const{stylesArray:e}=Zo(t),i=[],r=[],s=[],n=[];return e.forEach((t=>{const e=t[0];tl(e)?i.push(t.join(":")+" !important"):(r.push(t.join(":")+" !important"),e.includes("stroke")&&s.push(t.join(":")+" !important"),"fill"===e&&n.push(t.join(":")+" !important"))})),{labelStyles:i.join(";"),nodeStyles:r.join(";"),stylesArray:e,borderStyles:s,backgroundStyles:n}}),"styles2String"),il=we(((t,e)=>{var i;const{themeVariables:r,handDrawnSeed:s}=mr(),{nodeBorder:n,mainBkg:a}=r,{stylesMap:o}=Zo(t);return Object.assign({roughness:.7,fill:o.get("fill")||a,fillStyle:"hachure", +// solid fill +fillWeight:4,hachureGap:5.2,stroke:o.get("stroke")||n,seed:s,strokeWidth:(null==(i=o.get("stroke-width"))?void 0:i.replace("px",""))||1.3,fillLineDash:[0,0]},e)}),"userNodeOverrides"),rl=we((async(t,e)=>{ve.info("Creating subgraph rect for ",e.id,e);const i=mr(),{themeVariables:r,handDrawnSeed:s}=i,{clusterBkg:n,clusterBorder:a}=r,{labelStyles:o,nodeStyles:l,borderStyles:c,backgroundStyles:h}=el(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),u=Oi(i.flowchart.htmlLabels),p=d.insert("g").attr("class","cluster-label "),g=await Ro(p,e.label,{style:e.labelStyle,useHtmlLabels:u,isNode:!0});let y=g.getBBox();if(Oi(i.flowchart.htmlLabels)){const t=g.children[0],e=K(g);y=t.getBoundingClientRect(),e.attr("width",y.width),e.attr("height",y.height)}const f=e.width<=y.width+e.padding?y.width+e.padding:e.width;e.width<=y.width+e.padding?e.diff=(f-e.width)/2-e.padding:e.diff=-e.padding;const m=e.height,x=e.x-f/2,b=e.y-m/2;let k;if(ve.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){const t=se.svg(d),i=il(e,{roughness:.7,fill:n, +// fill: 'red', +stroke:a,fillWeight:3,seed:s}),r=t.path(Ko(x,b,f,m,0),i);k=d.insert((()=>(ve.debug("Rough node insert CXC",r),r)),":first-child"),k.select("path:nth-child(2)").attr("style",c.join(";")),k.select("path").attr("style",h.join(";").replace("fill","stroke"))}else k=d.insert("rect",":first-child"),k.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",f).attr("height",m);const{subGraphTitleTopMargin:C}=Aa(i);if(p.attr("transform", +// This puts the label on top of the box instead of inside it +`translate(${e.x-y.width/2}, ${e.y-e.height/2+C})`),o){const t=p.select("span");t&&t.attr("style",o)}const S=k.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=y.height-e.padding/2,e.intersect=function(t){return Ho(e,t)},{cluster:d,labelBBox:y}}),"rect"),sl=we(((t,e)=>{const i=t.insert("g").attr("class","note-cluster").attr("id",e.id),r=i.insert("rect",":first-child"),s=0*e.padding,n=s/2;r.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-n).attr("y",e.y-e.height/2-n).attr("width",e.width+s).attr("height",e.height+s).attr("fill","none");const a=r.node().getBBox();return e.width=a.width,e.height=a.height,e.intersect=function(t){return Ho(e,t)},{cluster:i,labelBBox:{width:0,height:0}}}),"noteGroup"),nl=we((async(t,e)=>{const i=mr(),{themeVariables:r,handDrawnSeed:s}=i,{altBackground:n,compositeBackground:a,compositeTitleBackground:o,nodeBorder:l}=r,c=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-id",e.id).attr("data-look",e.look),h=c.insert("g",":first-child"),d=c.insert("g").attr("class","cluster-label");let u=c.append("rect");const p=d.node().appendChild(await Go(e.label,e.labelStyle,void 0,!0));let g=p.getBBox();if(Oi(i.flowchart.htmlLabels)){const t=p.children[0],e=K(p);g=t.getBoundingClientRect(),e.attr("width",g.width),e.attr("height",g.height)}const y=0*e.padding,f=y/2,m=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+y;e.width<=g.width+e.padding?e.diff=(m-e.width)/2-e.padding:e.diff=-e.padding;const x=e.height+y,b=e.height+y-g.height-6,k=e.x-m/2,C=e.y-x/2;e.width=m;const S=e.y-e.height/2-f+g.height+2;let w;if("handDrawn"===e.look){const t=e.cssClasses.includes("statediagram-cluster-alt"),i=se.svg(c),r=e.rx||e.ry?i.path(Ko(k,C,m,x,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:s}):i.rectangle(k,C,m,x,{seed:s});w=c.insert((()=>r),":first-child");const h=i.rectangle(k,S,m,b,{fill:t?n:a,fillStyle:t?"hachure":"solid",stroke:l,seed:s});w=c.insert((()=>r),":first-child"),u=c.insert((()=>h))}else{w=h.insert("rect",":first-child");const t="outer";w.attr("class",t).attr("x",k).attr("y",C).attr("width",m).attr("height",x).attr("data-look",e.look),u.attr("class","inner").attr("x",k).attr("y",S).attr("width",m).attr("height",b)}d.attr("transform",`translate(${e.x-g.width/2}, ${C+1-(Oi(i.flowchart.htmlLabels)?0:3)})`);const T=w.node().getBBox();return e.height=T.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(t){return Ho(e,t)},{cluster:c,labelBBox:g}}),"roundedWithTitle"),al=we((async(t,e)=>{ve.info("Creating subgraph rect for ",e.id,e);const i=mr(),{themeVariables:r,handDrawnSeed:s}=i,{clusterBkg:n,clusterBorder:a}=r,{labelStyles:o,nodeStyles:l,borderStyles:c,backgroundStyles:h}=el(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),u=Oi(i.flowchart.htmlLabels),p=d.insert("g").attr("class","cluster-label "),g=await Ro(p,e.label,{style:e.labelStyle,useHtmlLabels:u,isNode:!0,width:e.width});let y=g.getBBox();if(Oi(i.flowchart.htmlLabels)){const t=g.children[0],e=K(g);y=t.getBoundingClientRect(),e.attr("width",y.width),e.attr("height",y.height)}const f=e.width<=y.width+e.padding?y.width+e.padding:e.width;e.width<=y.width+e.padding?e.diff=(f-e.width)/2-e.padding:e.diff=-e.padding;const m=e.height,x=e.x-f/2,b=e.y-m/2;let k;if(ve.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){const t=se.svg(d),i=il(e,{roughness:.7,fill:n, +// fill: 'red', +stroke:a,fillWeight:4,seed:s}),r=t.path(Ko(x,b,f,m,e.rx),i);k=d.insert((()=>(ve.debug("Rough node insert CXC",r),r)),":first-child"),k.select("path:nth-child(2)").attr("style",c.join(";")),k.select("path").attr("style",h.join(";").replace("fill","stroke"))}else k=d.insert("rect",":first-child"),k.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",f).attr("height",m);const{subGraphTitleTopMargin:C}=Aa(i);if(p.attr("transform", +// This puts the label on top of the box instead of inside it +`translate(${e.x-y.width/2}, ${e.y-e.height/2+C})`),o){const t=p.select("span");t&&t.attr("style",o)}const S=k.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=y.height-e.padding/2,e.intersect=function(t){return Ho(e,t)},{cluster:d,labelBBox:y}}),"kanbanSection"),ol={rect:rl,squareRect:rl,roundedWithTitle:nl,noteGroup:sl,divider:we(((t,e)=>{const i=mr(),{themeVariables:r,handDrawnSeed:s}=i,{nodeBorder:n}=r,a=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-look",e.look),o=a.insert("g",":first-child"),l=0*e.padding,c=e.width+l;e.diff=-e.padding;const h=e.height+l,d=e.x-c/2,u=e.y-h/2;let p;if(e.width=c,"handDrawn"===e.look){const t=se.svg(a).rectangle(d,u,c,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:n,seed:s});p=a.insert((()=>t),":first-child")}else{p=o.insert("rect",":first-child");const t="divider";p.attr("class",t).attr("x",d).attr("y",u).attr("width",c).attr("height",h).attr("data-look",e.look)}const g=p.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(t){return Ho(e,t)},{cluster:a,labelBBox:{}}}),"divider"),kanbanSection:al},ll=new Map,cl=we((async(t,e)=>{const i=e.shape||"rect",r=await ol[i](t,e);return ll.set(e.id,r),r}),"insertCluster"),hl=we((()=>{ll=new Map}),"clear");function dl(t,e){return t.intersect(e)}we(dl,"intersectNode");var ul=dl;function pl(t,e,i,r){var s=t.x,n=t.y,a=s-r.x,o=n-r.y,l=Math.sqrt(e*e*o*o+i*i*a*a),c=Math.abs(e*i*a/l);r.x0}we(ml,"intersectLine"),we(xl,"sameSign");var bl=ml;function kl(t,e,i){let r=t.x,s=t.y,n=[],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));let l=r-t.width/2-a,c=s-t.height/2-o;for(let h=0;h1&&n.sort((function(t,e){let r=t.x-i.x,s=t.y-i.y,n=Math.sqrt(r*r+s*s),a=e.x-i.x,o=e.y-i.y,l=Math.sqrt(a*a+o*o);return nc),":first-child");return h.attr("class","anchor").attr("style",Co(a)),zo(e,h),e.intersect=function(t){return ve.info("Circle intersect",e,1,t),Cl.circle(e,1,t)},n}function wl(t,e,i,r,s,n,a){const o=(t+i)/2,l=(e+r)/2,c=Math.atan2(r-e,i-t),h=(i-t)/2/s,d=(r-e)/2/n,u=Math.sqrt(h**2+d**2);if(u>1)throw new Error("The given radii are too small to create an arc between the points.");const p=Math.sqrt(1-u**2),g=o+p*n*Math.sin(c)*(a?-1:1),y=l-p*s*Math.cos(c)*(a?-1:1),f=Math.atan2((e-y)/n,(t-g)/s);let m=Math.atan2((r-y)/n,(i-g)/s)-f;a&&m<0&&(m+=2*Math.PI),!a&&m>0&&(m-=2*Math.PI);const x=[];for(let b=0;b<20;b++){const t=f+b/19*m,e=g+s*Math.cos(t),i=y+n*Math.sin(t);x.push({x:e,y:i})}return x}async function Tl(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n}=await Po(t,e,Wo(e)),a=n.width+e.padding+20,o=n.height+e.padding,l=o/2,c=l/(2.5+o/50),{cssStyles:h}=e,d=[{x:a/2,y:-o/2},{x:-a/2,y:-o/2},...wl(-a/2,-o/2,-a/2,o/2,c,l,!1),{x:a/2,y:o/2},...wl(a/2,o/2,a/2,-o/2,c,l,!0)],u=se.svg(s),p=il(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=jo(d),y=u.path(g,p),f=s.insert((()=>y),":first-child");return f.attr("class","basic label-container"),h&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",h),r&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",r),f.attr("transform",`translate(${c/2}, 0)`),zo(e,f),e.intersect=function(t){return Cl.polygon(e,d,t)},s}function _l(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+")")}async function vl(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n}=await Po(t,e,Wo(e)),a=n.height+e.padding,o=n.width+e.padding+12,l=-a,c=[{x:12,y:l},{x:o,y:l},{x:o,y:0},{x:0,y:0},{x:0,y:l+12},{x:12,y:l}];let h;const{cssStyles:d}=e;if("handDrawn"===e.look){const t=se.svg(s),i=il(e,{}),r=jo(c),n=t.path(r,i);h=s.insert((()=>n),":first-child").attr("transform",`translate(${-o/2}, ${a/2})`),d&&h.attr("style",d)}else h=_l(s,o,a,c);return r&&h.attr("style",r),zo(e,h),e.intersect=function(t){return Cl.polygon(e,c,t)},s}function El(t,e){const{nodeStyles:i}=el(e);e.label="";const r=t.insert("g").attr("class",Wo(e)).attr("id",e.domId??e.id),{cssStyles:s}=e,n=Math.max(28,e.width??0),a=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}],o=se.svg(r),l=il(e,{});"handDrawn"!==e.look&&(l.roughness=0,l.fillStyle="solid");const c=jo(a),h=o.path(c,l),d=r.insert((()=>h),":first-child");return s&&"handDrawn"!==e.look&&d.selectAll("path").attr("style",s),i&&"handDrawn"!==e.look&&d.selectAll("path").attr("style",i),e.width=28,e.height=28,e.intersect=function(t){return Cl.polygon(e,a,t)},r}async function Al(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n,halfPadding:a}=await Po(t,e,Wo(e)),o=n.width/2+a;let l;const{cssStyles:c}=e;if("handDrawn"===e.look){const t=se.svg(s),i=il(e,{}),r=t.circle(0,0,2*o,i);l=s.insert((()=>r),":first-child"),l.attr("class","basic label-container").attr("style",Co(c))}else l=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",r).attr("r",o).attr("cx",0).attr("cy",0);return zo(e,l),e.intersect=function(t){return ve.info("Circle intersect",e,o,t),Cl.circle(e,o,t)},s}function Ll(t){const e=Math.cos(Math.PI/4),i=Math.sin(Math.PI/4),r=2*t;return`M ${-r/2*e},${r/2*i} L ${r/2*e},${-r/2*i}\n M ${r/2*e},${r/2*i} L ${-r/2*e},${-r/2*i}`}function Bl(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i,e.label="";const s=t.insert("g").attr("class",Wo(e)).attr("id",e.domId??e.id),n=Math.max(30,(null==e?void 0:e.width)??0),{cssStyles:a}=e,o=se.svg(s),l=il(e,{});"handDrawn"!==e.look&&(l.roughness=0,l.fillStyle="solid");const c=o.circle(0,0,2*n,l),h=Ll(n),d=o.path(h,l),u=s.insert((()=>c),":first-child");return u.insert((()=>d)),a&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",a),r&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",r),zo(e,u),e.intersect=function(t){ve.info("crossedCircle intersect",e,{radius:n,point:t});return Cl.circle(e,n,t)},s}function $l(t,e,i,r=100,s=0,n=180){const a=[],o=s*Math.PI/180,l=(n*Math.PI/180-o)/(r-1);for(let c=0;cx),":first-child").attr("stroke-opacity",0),b.insert((()=>f),":first-child"),b.attr("class","text"),h&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",h),r&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",r),b.attr("transform",`translate(${c}, 0)`),a.attr("transform",`translate(${-o/2+c-(n.x-(n.left??0))},${-l/2+(e.padding??0)/2-(n.y-(n.top??0))})`),zo(e,b),e.intersect=function(t){return Cl.polygon(e,u,t)},s}function Il(t,e,i,r=100,s=0,n=180){const a=[],o=s*Math.PI/180,l=(n*Math.PI/180-o)/(r-1);for(let c=0;cx),":first-child").attr("stroke-opacity",0),b.insert((()=>f),":first-child"),b.attr("class","text"),h&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",h),r&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",r),b.attr("transform",`translate(${-c}, 0)`),a.attr("transform",`translate(${-o/2+(e.padding??0)/2-(n.x-(n.left??0))},${-l/2+(e.padding??0)/2-(n.y-(n.top??0))})`),zo(e,b),e.intersect=function(t){return Cl.polygon(e,u,t)},s}function Nl(t,e,i,r=100,s=0,n=180){const a=[],o=s*Math.PI/180,l=(n*Math.PI/180-o)/(r-1);for(let c=0;cC),":first-child").attr("stroke-opacity",0),S.insert((()=>m),":first-child"),S.insert((()=>b),":first-child"),S.attr("class","text"),h&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",h),r&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",r),S.attr("transform",`translate(${c-c/4}, 0)`),a.attr("transform",`translate(${-o/2+(e.padding??0)/2-(n.x-(n.left??0))},${-l/2+(e.padding??0)/2-(n.y-(n.top??0))})`),zo(e,S),e.intersect=function(t){return Cl.polygon(e,p,t)},s}async function Ml(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n}=await Po(t,e,Wo(e)),a=Math.max(80,1.25*(n.width+2*(e.padding??0)),(null==e?void 0:e.width)??0),o=Math.max(20,n.height+2*(e.padding??0),(null==e?void 0:e.height)??0),l=o/2,{cssStyles:c}=e,h=se.svg(s),d=il(e,{});"handDrawn"!==e.look&&(d.roughness=0,d.fillStyle="solid");const u=a-l,p=o/4,g=[{x:u,y:0},{x:p,y:0},{x:0,y:o/2},{x:p,y:o},{x:u,y:o},...Uo(-u,-o/2,l,50,270,90)],y=jo(g),f=h.path(y,d),m=s.insert((()=>f),":first-child");return m.attr("class","basic label-container"),c&&"handDrawn"!==e.look&&m.selectChildren("path").attr("style",c),r&&"handDrawn"!==e.look&&m.selectChildren("path").attr("style",r),m.attr("transform",`translate(${-a/2}, ${-o/2})`),zo(e,m),e.intersect=function(t){return Cl.polygon(e,g,t)},s}we(Sl,"anchor"),we(wl,"generateArcPoints"),we(Tl,"bowTieRect"),we(_l,"insertPolygonShape"),we(vl,"card"),we(El,"choice"),we(Al,"circle"),we(Ll,"createLine"),we(Bl,"crossedCircle"),we($l,"generateCirclePoints"),we(Dl,"curlyBraceLeft"),we(Il,"generateCirclePoints"),we(Fl,"curlyBraceRight"),we(Nl,"generateCirclePoints"),we(Ol,"curlyBraces"),we(Ml,"curvedTrapezoid");var Rl=we(((t,e,i,r,s,n)=>[`M${t},${e+n}`,`a${s},${n} 0,0,0 ${i},0`,`a${s},${n} 0,0,0 ${-i},0`,`l0,${r}`,`a${s},${n} 0,0,0 ${i},0`,"l0,"+-r].join(" ")),"createCylinderPathD"),Pl=we(((t,e,i,r,s,n)=>[`M${t},${e+n}`,`M${t+i},${e+n}`,`a${s},${n} 0,0,0 ${-i},0`,`l0,${r}`,`a${s},${n} 0,0,0 ${i},0`,"l0,"+-r].join(" ")),"createOuterCylinderPathD"),ql=we(((t,e,i,r,s,n)=>[`M${t-i/2},${-r/2}`,`a${s},${n} 0,0,0 ${i},0`].join(" ")),"createInnerCylinderPathD");async function zl(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n,label:a}=await Po(t,e,Wo(e)),o=Math.max(n.width+e.padding,e.width??0),l=o/2,c=l/(2.5+o/50),h=Math.max(n.height+c+e.padding,e.height??0);let d;const{cssStyles:u}=e;if("handDrawn"===e.look){const t=se.svg(s),i=Pl(0,0,o,h,l,c),r=ql(0,c,o,h,l,c),n=t.path(i,il(e,{})),a=t.path(r,il(e,{fill:"none"}));d=s.insert((()=>a),":first-child"),d=s.insert((()=>n),":first-child"),d.attr("class","basic label-container"),u&&d.attr("style",u)}else{const t=Rl(0,0,o,h,l,c);d=s.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",Co(u)).attr("style",r)}return d.attr("label-offset-y",c),d.attr("transform",`translate(${-o/2}, ${-(h/2+c)})`),zo(e,d),a.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-n.height/2+(e.padding??0)/1.5-(n.y-(n.top??0))})`),e.intersect=function(t){const i=Cl.rect(e,t),r=i.x-(e.x??0);if(0!=l&&(Math.abs(r)<(e.width??0)/2||Math.abs(r)==(e.width??0)/2&&Math.abs(i.y-(e.y??0))>(e.height??0)/2-c)){let s=c*c*(1-r*r/(l*l));s>0&&(s=Math.sqrt(s)),s=c-s,t.y-(e.y??0)>0&&(s=-s),i.y+=s}return i},s}async function Wl(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n,label:a}=await Po(t,e,Wo(e)),o=n.width+e.padding,l=n.height+e.padding,c=.2*l,h=-o/2,d=-l/2-c/2,{cssStyles:u}=e,p=se.svg(s),g=il(e,{});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const y=[{x:h,y:d+c},{x:-h,y:d+c},{x:-h,y:-d},{x:h,y:-d},{x:h,y:d},{x:-h,y:d},{x:-h,y:d+c}],f=p.polygon(y.map((t=>[t.x,t.y])),g),m=s.insert((()=>f),":first-child");return m.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",u),r&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",r),a.attr("transform",`translate(${h+(e.padding??0)/2-(n.x-(n.left??0))}, ${d+c+(e.padding??0)/2-(n.y-(n.top??0))})`),zo(e,m),e.intersect=function(t){return Cl.rect(e,t)},s}async function jl(t,e){var i,r;const{labelStyles:s,nodeStyles:n}=el(e);e.labelStyle=s;const{shapeSvg:a,bbox:o,halfPadding:l}=await Po(t,e,Wo(e)),c=o.width/2+l+5,h=o.width/2+l;let d;const{cssStyles:u}=e;if("handDrawn"===e.look){const t=se.svg(a),s=il(e,{roughness:.2,strokeWidth:2.5}),n=il(e,{roughness:.2,strokeWidth:1.5}),o=t.circle(0,0,2*c,s),l=t.circle(0,0,2*h,n);d=a.insert("g",":first-child"),d.attr("class",Co(e.cssClasses)).attr("style",Co(u)),null==(i=d.node())||i.appendChild(o),null==(r=d.node())||r.appendChild(l)}else{d=a.insert("g",":first-child");const t=d.insert("circle",":first-child"),e=d.insert("circle");d.attr("class","basic label-container").attr("style",n),t.attr("class","outer-circle").attr("style",n).attr("r",c).attr("cx",0).attr("cy",0),e.attr("class","inner-circle").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0)}return zo(e,d),e.intersect=function(t){return ve.info("DoubleCircle intersect",e,c,t),Cl.circle(e,c,t)},a}function Yl(t,e,{config:{themeVariables:i}}){const{labelStyles:r,nodeStyles:s}=el(e);e.label="",e.labelStyle=r;const n=t.insert("g").attr("class",Wo(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,o=se.svg(n),{nodeBorder:l}=i,c=il(e,{fillStyle:"solid"});"handDrawn"!==e.look&&(c.roughness=0);const h=o.circle(0,0,14,c),d=n.insert((()=>h),":first-child");return d.selectAll("path").attr("style",`fill: ${l} !important;`),a&&a.length>0&&"handDrawn"!==e.look&&d.selectAll("path").attr("style",a),s&&"handDrawn"!==e.look&&d.selectAll("path").attr("style",s),zo(e,d),e.intersect=function(t){ve.info("filledCircle intersect",e,{radius:7,point:t});return Cl.circle(e,7,t)},n}async function Ul(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n,label:a}=await Po(t,e,Wo(e)),o=n.width+(e.padding??0),l=o+n.height,c=o+n.height,h=[{x:0,y:-l},{x:c,y:-l},{x:c/2,y:0}],{cssStyles:d}=e,u=se.svg(s),p=il(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=jo(h),y=u.path(g,p),f=s.insert((()=>y),":first-child").attr("transform",`translate(${-l/2}, ${l/2})`);return d&&"handDrawn"!==e.look&&f.selectChildren("path").attr("style",d),r&&"handDrawn"!==e.look&&f.selectChildren("path").attr("style",r),e.width=o,e.height=l,zo(e,f),a.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-l/2+(e.padding??0)/2+(n.y-(n.top??0))})`),e.intersect=function(t){return ve.info("Triangle intersect",e,h,t),Cl.polygon(e,h,t)},s}function Hl(t,e,{dir:i,config:{state:r,themeVariables:s}}){const{nodeStyles:n}=el(e);e.label="";const a=t.insert("g").attr("class",Wo(e)).attr("id",e.domId??e.id),{cssStyles:o}=e;let l=Math.max(70,(null==e?void 0:e.width)??0),c=Math.max(10,(null==e?void 0:e.height)??0);"LR"===i&&(l=Math.max(10,(null==e?void 0:e.width)??0),c=Math.max(70,(null==e?void 0:e.height)??0));const h=-1*l/2,d=-1*c/2,u=se.svg(a),p=il(e,{stroke:s.lineColor,fill:s.lineColor});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=u.rectangle(h,d,l,c,p),y=a.insert((()=>g),":first-child");o&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",o),n&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",n),zo(e,y);const f=(null==r?void 0:r.padding)??0;return e.width&&e.height&&(e.width+=f/2||0,e.height+=f/2||0),e.intersect=function(t){return Cl.rect(e,t)},a}async function Vl(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n}=await Po(t,e,Wo(e)),a=Math.max(80,n.width+2*(e.padding??0),(null==e?void 0:e.width)??0),o=Math.max(50,n.height+2*(e.padding??0),(null==e?void 0:e.height)??0),l=o/2,{cssStyles:c}=e,h=se.svg(s),d=il(e,{});"handDrawn"!==e.look&&(d.roughness=0,d.fillStyle="solid");const u=[{x:-a/2,y:-o/2},{x:a/2-l,y:-o/2},...Uo(-a/2+l,0,l,50,90,270),{x:a/2-l,y:o/2},{x:-a/2,y:o/2}],p=jo(u),g=h.path(p,d),y=s.insert((()=>g),":first-child");return y.attr("class","basic label-container"),c&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",c),r&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",r),zo(e,y),e.intersect=function(t){ve.info("Pill intersect",e,{radius:l,point:t});return Cl.polygon(e,u,t)},s}we(zl,"cylinder"),we(Wl,"dividedRectangle"),we(jl,"doublecircle"),we(Yl,"filledCircle"),we(Ul,"flippedTriangle"),we(Hl,"forkJoin"),we(Vl,"halfRoundedRectangle");var Xl=we(((t,e,i,r,s)=>[`M${t+s},${e}`,`L${t+i-s},${e}`,`L${t+i},${e-r/2}`,`L${t+i-s},${e-r}`,`L${t+s},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" ")),"createHexagonPathD");async function Gl(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n}=await Po(t,e,Wo(e)),a=n.height+e.padding,o=a/4,l=n.width+2*o+e.padding,c=[{x:o,y:0},{x:l-o,y:0},{x:l,y:-a/2},{x:l-o,y:-a},{x:o,y:-a},{x:0,y:-a/2}];let h;const{cssStyles:d}=e;if("handDrawn"===e.look){const t=se.svg(s),i=il(e,{}),r=Xl(0,0,l,a,o),n=t.path(r,i);h=s.insert((()=>n),":first-child").attr("transform",`translate(${-l/2}, ${a/2})`),d&&h.attr("style",d)}else h=_l(s,l,a,c);return r&&h.attr("style",r),e.width=l,e.height=a,zo(e,h),e.intersect=function(t){return Cl.polygon(e,c,t)},s}async function Kl(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.label="",e.labelStyle=i;const{shapeSvg:s}=await Po(t,e,Wo(e)),n=Math.max(30,(null==e?void 0:e.width)??0),a=Math.max(30,(null==e?void 0:e.height)??0),{cssStyles:o}=e,l=se.svg(s),c=il(e,{});"handDrawn"!==e.look&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:n,y:0},{x:0,y:a},{x:n,y:a}],d=jo(h),u=l.path(d,c),p=s.insert((()=>u),":first-child");return p.attr("class","basic label-container"),o&&"handDrawn"!==e.look&&p.selectChildren("path").attr("style",o),r&&"handDrawn"!==e.look&&p.selectChildren("path").attr("style",r),p.attr("transform",`translate(${-n/2}, ${-a/2})`),zo(e,p),e.intersect=function(t){ve.info("Pill intersect",e,{points:h});return Cl.polygon(e,h,t)},s}async function Ql(t,e,{config:{themeVariables:i,flowchart:r}}){const{labelStyles:s}=el(e);e.labelStyle=s;const n=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(n,a),l=null==r?void 0:r.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,label:d}=await Po(t,e,"icon-shape default"),u="t"===e.pos,p=o,g=o,{nodeBorder:y}=i,{stylesMap:f}=Zo(e),m=-g/2,x=-p/2,b=e.label?8:0,k=se.svg(c),C=il(e,{stroke:"none",fill:"none"});"handDrawn"!==e.look&&(C.roughness=0,C.fillStyle="solid");const S=k.rectangle(m,x,g,p,C),w=Math.max(g,h.width),T=p+h.height+b,_=k.rectangle(-w/2,-T/2,w,T,{...C,fill:"transparent",stroke:"none"}),v=c.insert((()=>S),":first-child"),E=c.insert((()=>_));if(e.icon){const t=c.append("g");t.html(`${await Fa(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const i=t.node().getBBox(),r=i.width,s=i.height,n=i.x,a=i.y;t.attr("transform",`translate(${-r/2-n},${u?h.height/2+b/2-s/2-a:-h.height/2-b/2-s/2-a})`),t.attr("style",`color: ${f.get("stroke")??y};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-T/2:T/2-h.height})`),v.attr("transform",`translate(0,${u?h.height/2+b/2:-h.height/2-b/2})`),zo(e,E),e.intersect=function(t){if(ve.info("iconSquare intersect",e,t),!e.label)return Cl.rect(e,t);const i=e.x??0,r=e.y??0,s=e.height??0;let n=[];n=u?[{x:i-h.width/2,y:r-s/2},{x:i+h.width/2,y:r-s/2},{x:i+h.width/2,y:r-s/2+h.height+b},{x:i+g/2,y:r-s/2+h.height+b},{x:i+g/2,y:r+s/2},{x:i-g/2,y:r+s/2},{x:i-g/2,y:r-s/2+h.height+b},{x:i-h.width/2,y:r-s/2+h.height+b}]:[{x:i-g/2,y:r-s/2},{x:i+g/2,y:r-s/2},{x:i+g/2,y:r-s/2+p},{x:i+h.width/2,y:r-s/2+p},{x:i+h.width/2/2,y:r+s/2},{x:i-h.width/2,y:r+s/2},{x:i-h.width/2,y:r-s/2+p},{x:i-g/2,y:r-s/2+p}];return Cl.polygon(e,n,t)},c}async function Zl(t,e,{config:{themeVariables:i,flowchart:r}}){const{labelStyles:s}=el(e);e.labelStyle=s;const n=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(n,a),l=null==r?void 0:r.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,label:d}=await Po(t,e,"icon-shape default"),u=e.label?8:0,p="t"===e.pos,{nodeBorder:g,mainBkg:y}=i,{stylesMap:f}=Zo(e),m=se.svg(c),x=il(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");const b=f.get("fill");x.stroke=b??y;const k=c.append("g");e.icon&&k.html(`${await Fa(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const C=k.node().getBBox(),S=C.width,w=C.height,T=C.x,_=C.y,v=Math.max(S,w)*Math.SQRT2+40,E=m.circle(0,0,v,x),A=Math.max(v,h.width),L=v+h.height+u,B=m.rectangle(-A/2,-L/2,A,L,{...x,fill:"transparent",stroke:"none"}),$=c.insert((()=>E),":first-child"),D=c.insert((()=>B));return k.attr("transform",`translate(${-S/2-T},${p?h.height/2+u/2-w/2-_:-h.height/2-u/2-w/2-_})`),k.attr("style",`color: ${f.get("stroke")??g};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-L/2:L/2-h.height})`),$.attr("transform",`translate(0,${p?h.height/2+u/2:-h.height/2-u/2})`),zo(e,D),e.intersect=function(t){ve.info("iconSquare intersect",e,t);return Cl.rect(e,t)},c}async function Jl(t,e,{config:{themeVariables:i,flowchart:r}}){const{labelStyles:s}=el(e);e.labelStyle=s;const n=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(n,a),l=null==r?void 0:r.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:u}=await Po(t,e,"icon-shape default"),p="t"===e.pos,g=o+2*d,y=o+2*d,{nodeBorder:f,mainBkg:m}=i,{stylesMap:x}=Zo(e),b=-y/2,k=-g/2,C=e.label?8:0,S=se.svg(c),w=il(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");const T=x.get("fill");w.stroke=T??m;const _=S.path(Ko(b,k,y,g,5),w),v=Math.max(y,h.width),E=g+h.height+C,A=S.rectangle(-v/2,-E/2,v,E,{...w,fill:"transparent",stroke:"none"}),L=c.insert((()=>_),":first-child").attr("class","icon-shape2"),B=c.insert((()=>A));if(e.icon){const t=c.append("g");t.html(`${await Fa(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const i=t.node().getBBox(),r=i.width,s=i.height,n=i.x,a=i.y;t.attr("transform",`translate(${-r/2-n},${p?h.height/2+C/2-s/2-a:-h.height/2-C/2-s/2-a})`),t.attr("style",`color: ${x.get("stroke")??f};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-E/2:E/2-h.height})`),L.attr("transform",`translate(0,${p?h.height/2+C/2:-h.height/2-C/2})`),zo(e,B),e.intersect=function(t){if(ve.info("iconSquare intersect",e,t),!e.label)return Cl.rect(e,t);const i=e.x??0,r=e.y??0,s=e.height??0;let n=[];n=p?[{x:i-h.width/2,y:r-s/2},{x:i+h.width/2,y:r-s/2},{x:i+h.width/2,y:r-s/2+h.height+C},{x:i+y/2,y:r-s/2+h.height+C},{x:i+y/2,y:r+s/2},{x:i-y/2,y:r+s/2},{x:i-y/2,y:r-s/2+h.height+C},{x:i-h.width/2,y:r-s/2+h.height+C}]:[{x:i-y/2,y:r-s/2},{x:i+y/2,y:r-s/2},{x:i+y/2,y:r-s/2+g},{x:i+h.width/2,y:r-s/2+g},{x:i+h.width/2/2,y:r+s/2},{x:i-h.width/2,y:r+s/2},{x:i-h.width/2,y:r-s/2+g},{x:i-y/2,y:r-s/2+g}];return Cl.polygon(e,n,t)},c}async function tc(t,e,{config:{themeVariables:i,flowchart:r}}){const{labelStyles:s}=el(e);e.labelStyle=s;const n=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(n,a),l=null==r?void 0:r.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:u}=await Po(t,e,"icon-shape default"),p="t"===e.pos,g=o+2*d,y=o+2*d,{nodeBorder:f,mainBkg:m}=i,{stylesMap:x}=Zo(e),b=-y/2,k=-g/2,C=e.label?8:0,S=se.svg(c),w=il(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");const T=x.get("fill");w.stroke=T??m;const _=S.path(Ko(b,k,y,g,.1),w),v=Math.max(y,h.width),E=g+h.height+C,A=S.rectangle(-v/2,-E/2,v,E,{...w,fill:"transparent",stroke:"none"}),L=c.insert((()=>_),":first-child"),B=c.insert((()=>A));if(e.icon){const t=c.append("g");t.html(`${await Fa(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const i=t.node().getBBox(),r=i.width,s=i.height,n=i.x,a=i.y;t.attr("transform",`translate(${-r/2-n},${p?h.height/2+C/2-s/2-a:-h.height/2-C/2-s/2-a})`),t.attr("style",`color: ${x.get("stroke")??f};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-E/2:E/2-h.height})`),L.attr("transform",`translate(0,${p?h.height/2+C/2:-h.height/2-C/2})`),zo(e,B),e.intersect=function(t){if(ve.info("iconSquare intersect",e,t),!e.label)return Cl.rect(e,t);const i=e.x??0,r=e.y??0,s=e.height??0;let n=[];n=p?[{x:i-h.width/2,y:r-s/2},{x:i+h.width/2,y:r-s/2},{x:i+h.width/2,y:r-s/2+h.height+C},{x:i+y/2,y:r-s/2+h.height+C},{x:i+y/2,y:r+s/2},{x:i-y/2,y:r+s/2},{x:i-y/2,y:r-s/2+h.height+C},{x:i-h.width/2,y:r-s/2+h.height+C}]:[{x:i-y/2,y:r-s/2},{x:i+y/2,y:r-s/2},{x:i+y/2,y:r-s/2+g},{x:i+h.width/2,y:r-s/2+g},{x:i+h.width/2/2,y:r+s/2},{x:i-h.width/2,y:r+s/2},{x:i-h.width/2,y:r-s/2+g},{x:i-y/2,y:r-s/2+g}];return Cl.polygon(e,n,t)},c}async function ec(t,e,{config:{flowchart:i}}){const r=new Image;r.src=(null==e?void 0:e.img)??"",await r.decode();const s=Number(r.naturalWidth.toString().replace("px","")),n=Number(r.naturalHeight.toString().replace("px",""));e.imageAspectRatio=s/n;const{labelStyles:a}=el(e);e.labelStyle=a;const o=null==i?void 0:i.wrappingWidth;e.defaultWidth=null==i?void 0:i.wrappingWidth;const l=Math.max(e.label?o??0:0,(null==e?void 0:e.assetWidth)??s),c="on"===e.constraint&&(null==e?void 0:e.assetHeight)?e.assetHeight*e.imageAspectRatio:l,h="on"===e.constraint?c/e.imageAspectRatio:(null==e?void 0:e.assetHeight)??n;e.width=Math.max(c,o??0);const{shapeSvg:d,bbox:u,label:p}=await Po(t,e,"image-shape default"),g="t"===e.pos,y=-c/2,f=-h/2,m=e.label?8:0,x=se.svg(d),b=il(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");const k=x.rectangle(y,f,c,h,b),C=Math.max(c,u.width),S=h+u.height+m,w=x.rectangle(-C/2,-S/2,C,S,{...b,fill:"none",stroke:"none"}),T=d.insert((()=>k),":first-child"),_=d.insert((()=>w));if(e.img){const t=d.append("image");t.attr("href",e.img),t.attr("width",c),t.attr("height",h),t.attr("preserveAspectRatio","none"),t.attr("transform",`translate(${-c/2},${g?S/2-h:-S/2})`)}return p.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${g?-h/2-u.height/2-m/2:h/2-u.height/2+m/2})`),T.attr("transform",`translate(0,${g?u.height/2+m/2:-u.height/2-m/2})`),zo(e,_),e.intersect=function(t){if(ve.info("iconSquare intersect",e,t),!e.label)return Cl.rect(e,t);const i=e.x??0,r=e.y??0,s=e.height??0;let n=[];n=g?[{x:i-u.width/2,y:r-s/2},{x:i+u.width/2,y:r-s/2},{x:i+u.width/2,y:r-s/2+u.height+m},{x:i+c/2,y:r-s/2+u.height+m},{x:i+c/2,y:r+s/2},{x:i-c/2,y:r+s/2},{x:i-c/2,y:r-s/2+u.height+m},{x:i-u.width/2,y:r-s/2+u.height+m}]:[{x:i-c/2,y:r-s/2},{x:i+c/2,y:r-s/2},{x:i+c/2,y:r-s/2+h},{x:i+u.width/2,y:r-s/2+h},{x:i+u.width/2/2,y:r+s/2},{x:i-u.width/2,y:r+s/2},{x:i-u.width/2,y:r-s/2+h},{x:i-c/2,y:r-s/2+h}];return Cl.polygon(e,n,t)},d}async function ic(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n}=await Po(t,e,Wo(e)),a=Math.max(n.width+2*(e.padding??0),(null==e?void 0:e.width)??0),o=Math.max(n.height+2*(e.padding??0),(null==e?void 0:e.height)??0),l=[{x:0,y:0},{x:a,y:0},{x:a+3*o/6,y:-o},{x:-3*o/6,y:-o}];let c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=se.svg(s),i=il(e,{}),r=jo(l),n=t.path(r,i);c=s.insert((()=>n),":first-child").attr("transform",`translate(${-a/2}, ${o/2})`),h&&c.attr("style",h)}else c=_l(s,a,o,l);return r&&c.attr("style",r),e.width=a,e.height=o,zo(e,c),e.intersect=function(t){return Cl.polygon(e,l,t)},s}async function rc(t,e,i){const{labelStyles:r,nodeStyles:s}=el(e);e.labelStyle=r;const{shapeSvg:n,bbox:a}=await Po(t,e,Wo(e)),o=Math.max(a.width+2*i.labelPaddingX,(null==e?void 0:e.width)||0),l=Math.max(a.height+2*i.labelPaddingY,(null==e?void 0:e.height)||0),c=-o/2,h=-l/2;let d,{rx:u,ry:p}=e;const{cssStyles:g}=e;if((null==i?void 0:i.rx)&&i.ry&&(u=i.rx,p=i.ry),"handDrawn"===e.look){const t=se.svg(n),i=il(e,{}),r=u||p?t.path(Ko(c,h,o,l,u||0),i):t.rectangle(c,h,o,l,i);d=n.insert((()=>r),":first-child"),d.attr("class","basic label-container").attr("style",Co(g))}else d=n.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",s).attr("rx",Co(u)).attr("ry",Co(p)).attr("x",c).attr("y",h).attr("width",o).attr("height",l);return zo(e,d),e.intersect=function(t){return Cl.rect(e,t)},n}async function sc(t,e){const{shapeSvg:i,bbox:r,label:s}=await Po(t,e,"label"),n=i.insert("rect",":first-child");return n.attr("width",.1).attr("height",.1),i.attr("class","label edgeLabel"),s.attr("transform",`translate(${-r.width/2-(r.x-(r.left??0))}, ${-r.height/2-(r.y-(r.top??0))})`),zo(e,n),e.intersect=function(t){return Cl.rect(e,t)},i}async function nc(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n}=await Po(t,e,Wo(e)),a=Math.max(n.width+(e.padding??0),(null==e?void 0:e.width)??0),o=Math.max(n.height+(e.padding??0),(null==e?void 0:e.height)??0),l=[{x:0,y:0},{x:a+3*o/6,y:0},{x:a,y:-o},{x:-3*o/6,y:-o}];let c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=se.svg(s),i=il(e,{}),r=jo(l),n=t.path(r,i);c=s.insert((()=>n),":first-child").attr("transform",`translate(${-a/2}, ${o/2})`),h&&c.attr("style",h)}else c=_l(s,a,o,l);return r&&c.attr("style",r),e.width=a,e.height=o,zo(e,c),e.intersect=function(t){return Cl.polygon(e,l,t)},s}async function ac(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n}=await Po(t,e,Wo(e)),a=Math.max(n.width+(e.padding??0),(null==e?void 0:e.width)??0),o=Math.max(n.height+(e.padding??0),(null==e?void 0:e.height)??0),l=[{x:-3*o/6,y:0},{x:a,y:0},{x:a+3*o/6,y:-o},{x:0,y:-o}];let c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=se.svg(s),i=il(e,{}),r=jo(l),n=t.path(r,i);c=s.insert((()=>n),":first-child").attr("transform",`translate(${-a/2}, ${o/2})`),h&&c.attr("style",h)}else c=_l(s,a,o,l);return r&&c.attr("style",r),e.width=a,e.height=o,zo(e,c),e.intersect=function(t){return Cl.polygon(e,l,t)},s}function oc(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.label="",e.labelStyle=i;const s=t.insert("g").attr("class",Wo(e)).attr("id",e.domId??e.id),{cssStyles:n}=e,a=Math.max(35,(null==e?void 0:e.width)??0),o=Math.max(35,(null==e?void 0:e.height)??0),l=[{x:a,y:0},{x:0,y:o+3.5},{x:a-14,y:o+3.5},{x:0,y:2*o},{x:a,y:o-3.5},{x:14,y:o-3.5}],c=se.svg(s),h=il(e,{});"handDrawn"!==e.look&&(h.roughness=0,h.fillStyle="solid");const d=jo(l),u=c.path(d,h),p=s.insert((()=>u),":first-child");return n&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",n),r&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",r),p.attr("transform",`translate(-${a/2},${-o})`),zo(e,p),e.intersect=function(t){ve.info("lightningBolt intersect",e,t);return Cl.polygon(e,l,t)},s}we(Gl,"hexagon"),we(Kl,"hourglass"),we(Ql,"icon"),we(Zl,"iconCircle"),we(Jl,"iconRounded"),we(tc,"iconSquare"),we(ec,"imageSquare"),we(ic,"inv_trapezoid"),we(rc,"drawRect"),we(sc,"labelRect"),we(nc,"lean_left"),we(ac,"lean_right"),we(oc,"lightningBolt");var lc=we(((t,e,i,r,s,n,a)=>[`M${t},${e+n}`,`a${s},${n} 0,0,0 ${i},0`,`a${s},${n} 0,0,0 ${-i},0`,`l0,${r}`,`a${s},${n} 0,0,0 ${i},0`,"l0,"+-r,`M${t},${e+n+a}`,`a${s},${n} 0,0,0 ${i},0`].join(" ")),"createCylinderPathD"),cc=we(((t,e,i,r,s,n,a)=>[`M${t},${e+n}`,`M${t+i},${e+n}`,`a${s},${n} 0,0,0 ${-i},0`,`l0,${r}`,`a${s},${n} 0,0,0 ${i},0`,"l0,"+-r,`M${t},${e+n+a}`,`a${s},${n} 0,0,0 ${i},0`].join(" ")),"createOuterCylinderPathD"),hc=we(((t,e,i,r,s,n)=>[`M${t-i/2},${-r/2}`,`a${s},${n} 0,0,0 ${i},0`].join(" ")),"createInnerCylinderPathD");async function dc(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n,label:a}=await Po(t,e,Wo(e)),o=Math.max(n.width+(e.padding??0),e.width??0),l=o/2,c=l/(2.5+o/50),h=Math.max(n.height+c+(e.padding??0),e.height??0),d=.1*h;let u;const{cssStyles:p}=e;if("handDrawn"===e.look){const t=se.svg(s),i=cc(0,0,o,h,l,c,d),r=hc(0,c,o,h,l,c),n=il(e,{}),a=t.path(i,n),g=t.path(r,n);s.insert((()=>g),":first-child").attr("class","line"),u=s.insert((()=>a),":first-child"),u.attr("class","basic label-container"),p&&u.attr("style",p)}else{const t=lc(0,0,o,h,l,c,d);u=s.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",Co(p)).attr("style",r)}return u.attr("label-offset-y",c),u.attr("transform",`translate(${-o/2}, ${-(h/2+c)})`),zo(e,u),a.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-n.height/2+c-(n.y-(n.top??0))})`),e.intersect=function(t){const i=Cl.rect(e,t),r=i.x-(e.x??0);if(0!=l&&(Math.abs(r)<(e.width??0)/2||Math.abs(r)==(e.width??0)/2&&Math.abs(i.y-(e.y??0))>(e.height??0)/2-c)){let s=c*c*(1-r*r/(l*l));s>0&&(s=Math.sqrt(s)),s=c-s,t.y-(e.y??0)>0&&(s=-s),i.y+=s}return i},s}async function uc(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n,label:a}=await Po(t,e,Wo(e)),o=Math.max(n.width+2*(e.padding??0),(null==e?void 0:e.width)??0),l=Math.max(n.height+2*(e.padding??0),(null==e?void 0:e.height)??0),c=l/4,h=l+c,{cssStyles:d}=e,u=se.svg(s),p=il(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=[{x:-o/2-o/2*.1,y:-h/2},{x:-o/2-o/2*.1,y:h/2},...Yo(-o/2-o/2*.1,h/2,o/2+o/2*.1,h/2,c,.8),{x:o/2+o/2*.1,y:-h/2},{x:-o/2-o/2*.1,y:-h/2},{x:-o/2,y:-h/2},{x:-o/2,y:h/2*1.1},{x:-o/2,y:-h/2}],y=u.polygon(g.map((t=>[t.x,t.y])),p),f=s.insert((()=>y),":first-child");return f.attr("class","basic label-container"),d&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",d),r&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",r),f.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-o/2+(e.padding??0)+o/2*.1/2-(n.x-(n.left??0))},${-l/2+(e.padding??0)-c/2-(n.y-(n.top??0))})`),zo(e,f),e.intersect=function(t){return Cl.polygon(e,g,t)},s}async function pc(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n,label:a}=await Po(t,e,Wo(e)),o=Math.max(n.width+2*(e.padding??0),(null==e?void 0:e.width)??0),l=Math.max(n.height+2*(e.padding??0),(null==e?void 0:e.height)??0),c=-o/2,h=-l/2,{cssStyles:d}=e,u=se.svg(s),p=il(e,{}),g=[{x:c-5,y:h+5},{x:c-5,y:h+l+5},{x:c+o-5,y:h+l+5},{x:c+o-5,y:h+l},{x:c+o,y:h+l},{x:c+o,y:h+l-5},{x:c+o+5,y:h+l-5},{x:c+o+5,y:h-5},{x:c+5,y:h-5},{x:c+5,y:h},{x:c,y:h},{x:c,y:h+5}],y=[{x:c,y:h+5},{x:c+o-5,y:h+5},{x:c+o-5,y:h+l},{x:c+o,y:h+l},{x:c+o,y:h},{x:c,y:h}];"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const f=jo(g),m=u.path(f,p),x=jo(y),b=u.path(x,{...p,fill:"none"}),k=s.insert((()=>b),":first-child");return k.insert((()=>m),":first-child"),k.attr("class","basic label-container"),d&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",d),r&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",r),a.attr("transform",`translate(${-n.width/2-5-(n.x-(n.left??0))}, ${-n.height/2+5-(n.y-(n.top??0))})`),zo(e,k),e.intersect=function(t){return Cl.polygon(e,g,t)},s}async function gc(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n,label:a}=await Po(t,e,Wo(e)),o=Math.max(n.width+2*(e.padding??0),(null==e?void 0:e.width)??0),l=Math.max(n.height+2*(e.padding??0),(null==e?void 0:e.height)??0),c=l/4,h=l+c,d=-o/2,u=-h/2,{cssStyles:p}=e,g=Yo(d-5,u+h+5,d+o-5,u+h+5,c,.8),y=null==g?void 0:g[g.length-1],f=[{x:d-5,y:u+5},{x:d-5,y:u+h+5},...g,{x:d+o-5,y:y.y-5},{x:d+o,y:y.y-5},{x:d+o,y:y.y-10},{x:d+o+5,y:y.y-10},{x:d+o+5,y:u-5},{x:d+5,y:u-5},{x:d+5,y:u},{x:d,y:u},{x:d,y:u+5}],m=[{x:d,y:u+5},{x:d+o-5,y:u+5},{x:d+o-5,y:y.y-5},{x:d+o,y:y.y-5},{x:d+o,y:u},{x:d,y:u}],x=se.svg(s),b=il(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");const k=jo(f),C=x.path(k,b),S=jo(m),w=x.path(S,b),T=s.insert((()=>C),":first-child");return T.insert((()=>w)),T.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&T.selectAll("path").attr("style",p),r&&"handDrawn"!==e.look&&T.selectAll("path").attr("style",r),T.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-n.width/2-5-(n.x-(n.left??0))}, ${-n.height/2+5-c/2-(n.y-(n.top??0))})`),zo(e,T),e.intersect=function(t){return Cl.polygon(e,f,t)},s}async function yc(t,e,{config:{themeVariables:i}}){var r;const{labelStyles:s,nodeStyles:n}=el(e);e.labelStyle=s;e.useHtmlLabels||!1!==(null==(r=yi().flowchart)?void 0:r.htmlLabels)||(e.centerLabel=!0);const{shapeSvg:a,bbox:o}=await Po(t,e,Wo(e)),l=Math.max(o.width+2*(e.padding??0),(null==e?void 0:e.width)??0),c=Math.max(o.height+2*(e.padding??0),(null==e?void 0:e.height)??0),h=-l/2,d=-c/2,{cssStyles:u}=e,p=se.svg(a),g=il(e,{fill:i.noteBkgColor,stroke:i.noteBorderColor});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const y=p.rectangle(h,d,l,c,g),f=a.insert((()=>y),":first-child");return f.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",u),n&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",n),zo(e,f),e.intersect=function(t){return Cl.rect(e,t)},a}we(dc,"linedCylinder"),we(uc,"linedWaveEdgedRect"),we(pc,"multiRect"),we(gc,"multiWaveEdgedRectangle"),we(yc,"note");var fc=we(((t,e,i)=>[`M${t+i/2},${e}`,`L${t+i},${e-i/2}`,`L${t+i/2},${e-i}`,`L${t},${e-i/2}`,"Z"].join(" ")),"createDecisionBoxPathD");async function mc(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n}=await Po(t,e,Wo(e)),a=n.width+e.padding+(n.height+e.padding),o=[{x:a/2,y:0},{x:a,y:-a/2},{x:a/2,y:-a},{x:0,y:-a/2}];let l;const{cssStyles:c}=e;if("handDrawn"===e.look){const t=se.svg(s),i=il(e,{}),r=fc(0,0,a),n=t.path(r,i);l=s.insert((()=>n),":first-child").attr("transform",`translate(${-a/2}, ${a/2})`),c&&l.attr("style",c)}else l=_l(s,a,a,o);return r&&l.attr("style",r),zo(e,l),e.intersect=function(t){return ve.debug("APA12 Intersect called SPLIT\npoint:",t,"\nnode:\n",e,"\nres:",Cl.polygon(e,o,t)),Cl.polygon(e,o,t)},s}async function xc(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n,label:a}=await Po(t,e,Wo(e)),o=-Math.max(n.width+(e.padding??0),(null==e?void 0:e.width)??0)/2,l=-Math.max(n.height+(e.padding??0),(null==e?void 0:e.height)??0)/2,c=l/2,h=[{x:o+c,y:l},{x:o,y:0},{x:o+c,y:-l},{x:-o,y:-l},{x:-o,y:l}],{cssStyles:d}=e,u=se.svg(s),p=il(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=jo(h),y=u.path(g,p),f=s.insert((()=>y),":first-child");return f.attr("class","basic label-container"),d&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",d),r&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",r),f.attr("transform",`translate(${-c/2},0)`),a.attr("transform",`translate(${-c/2-n.width/2-(n.x-(n.left??0))}, ${-n.height/2-(n.y-(n.top??0))})`),zo(e,f),e.intersect=function(t){return Cl.polygon(e,h,t)},s}async function bc(t,e){var i,r;const{labelStyles:s,nodeStyles:n}=el(e);let a;e.labelStyle=s,a=e.cssClasses?"node "+e.cssClasses:"node default";const o=t.insert("g").attr("class",a).attr("id",e.domId||e.id),l=o.insert("g"),c=o.insert("g").attr("class","label").attr("style",n),h=e.description,d=e.label,u=c.node().appendChild(await Go(d,e.labelStyle,!0,!0));let p={width:0,height:0};if(Oi(null==(r=null==(i=mr())?void 0:i.flowchart)?void 0:r.htmlLabels)){const t=u.children[0],e=K(u);p=t.getBoundingClientRect(),e.attr("width",p.width),e.attr("height",p.height)}ve.info("Text 2",h);const g=h||[],y=u.getBBox(),f=c.node().appendChild(await Go(g.join?g.join("
"):g,e.labelStyle,!0,!0)),m=f.children[0],x=K(f);p=m.getBoundingClientRect(),x.attr("width",p.width),x.attr("height",p.height);const b=(e.padding||0)/2;K(f).attr("transform","translate( "+(p.width>y.width?0:(y.width-p.width)/2)+", "+(y.height+b+5)+")"),K(u).attr("transform","translate( "+(p.width(ve.debug("Rough node insert CXC",r),s)),":first-child"),T=o.insert((()=>(ve.debug("Rough node insert CXC",r),r)),":first-child")}else T=l.insert("rect",":first-child"),_=l.insert("line"),T.attr("class","outer title-state").attr("style",n).attr("x",-p.width/2-b).attr("y",-p.height/2-b).attr("width",p.width+(e.padding||0)).attr("height",p.height+(e.padding||0)),_.attr("class","divider").attr("x1",-p.width/2-b).attr("x2",p.width/2+b).attr("y1",-p.height/2-b+y.height+b).attr("y2",-p.height/2-b+y.height+b);return zo(e,T),e.intersect=function(t){return Cl.rect(e,t)},o}async function kc(t,e){return rc(t,e,{rx:5,ry:5,labelPaddingX:1*((null==e?void 0:e.padding)||0),labelPaddingY:1*((null==e?void 0:e.padding)||0)})}async function Cc(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n,label:a}=await Po(t,e,Wo(e)),o=(null==e?void 0:e.padding)??0,l=Math.max(n.width+2*(e.padding??0),(null==e?void 0:e.width)??0),c=Math.max(n.height+2*(e.padding??0),(null==e?void 0:e.height)??0),h=-n.width/2-o,d=-n.height/2-o,{cssStyles:u}=e,p=se.svg(s),g=il(e,{});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const y=[{x:h,y:d},{x:h+l+8,y:d},{x:h+l+8,y:d+c},{x:h-8,y:d+c},{x:h-8,y:d},{x:h,y:d},{x:h,y:d+c}],f=p.polygon(y.map((t=>[t.x,t.y])),g),m=s.insert((()=>f),":first-child");return m.attr("class","basic label-container").attr("style",Co(u)),r&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",r),u&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",r),a.attr("transform",`translate(${-l/2+4+(e.padding??0)-(n.x-(n.left??0))},${-c/2+(e.padding??0)-(n.y-(n.top??0))})`),zo(e,m),e.intersect=function(t){return Cl.rect(e,t)},s}async function Sc(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n,label:a}=await Po(t,e,Wo(e)),o=Math.max(n.width+2*(e.padding??0),(null==e?void 0:e.width)??0),l=Math.max(n.height+2*(e.padding??0),(null==e?void 0:e.height)??0),c=-o/2,h=-l/2,{cssStyles:d}=e,u=se.svg(s),p=il(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=[{x:c,y:h},{x:c,y:h+l},{x:c+o,y:h+l},{x:c+o,y:h-l/2}],y=jo(g),f=u.path(y,p),m=s.insert((()=>f),":first-child");return m.attr("class","basic label-container"),d&&"handDrawn"!==e.look&&m.selectChildren("path").attr("style",d),r&&"handDrawn"!==e.look&&m.selectChildren("path").attr("style",r),m.attr("transform",`translate(0, ${l/4})`),a.attr("transform",`translate(${-o/2+(e.padding??0)-(n.x-(n.left??0))}, ${-l/4+(e.padding??0)-(n.y-(n.top??0))})`),zo(e,m),e.intersect=function(t){return Cl.polygon(e,g,t)},s}async function wc(t,e){return rc(t,e,{rx:0,ry:0,labelPaddingX:2*((null==e?void 0:e.padding)||0),labelPaddingY:1*((null==e?void 0:e.padding)||0)})}async function Tc(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n}=await Po(t,e,Wo(e)),a=n.height+e.padding,o=n.width+a/4+e.padding;let l;const{cssStyles:c}=e;if("handDrawn"===e.look){const t=se.svg(s),i=il(e,{}),r=Ko(-o/2,-a/2,o,a,a/2),n=t.path(r,i);l=s.insert((()=>n),":first-child"),l.attr("class","basic label-container").attr("style",Co(c))}else l=s.insert("rect",":first-child"),l.attr("class","basic label-container").attr("style",r).attr("rx",a/2).attr("ry",a/2).attr("x",-o/2).attr("y",-a/2).attr("width",o).attr("height",a);return zo(e,l),e.intersect=function(t){return Cl.rect(e,t)},s}async function _c(t,e){return rc(t,e,{rx:5,ry:5})}function vc(t,e,{config:{themeVariables:i}}){const{labelStyles:r,nodeStyles:s}=el(e);e.labelStyle=r;const{cssStyles:n}=e,{lineColor:a,stateBorder:o,nodeBorder:l}=i,c=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),h=se.svg(c),d=il(e,{});"handDrawn"!==e.look&&(d.roughness=0,d.fillStyle="solid");const u=h.circle(0,0,14,{...d,stroke:a,strokeWidth:2}),p=o??l,g=h.circle(0,0,5,{...d,fill:p,stroke:p,strokeWidth:2,fillStyle:"solid"}),y=c.insert((()=>u),":first-child");return y.insert((()=>g)),n&&y.selectAll("path").attr("style",n),s&&y.selectAll("path").attr("style",s),zo(e,y),e.intersect=function(t){return Cl.circle(e,7,t)},c}function Ec(t,e,{config:{themeVariables:i}}){const{lineColor:r}=i,s=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let n;if("handDrawn"===e.look){const t=se.svg(s).circle(0,0,14,Qo(r));n=s.insert((()=>t)),n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else n=s.insert("circle",":first-child"),n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return zo(e,n),e.intersect=function(t){return Cl.circle(e,7,t)},s}async function Ac(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n}=await Po(t,e,Wo(e)),a=((null==e?void 0:e.padding)||0)/2,o=n.width+e.padding,l=n.height+e.padding,c=-n.width/2-a,h=-n.height/2-a,d=[{x:0,y:0},{x:o,y:0},{x:o,y:-l},{x:0,y:-l},{x:0,y:0},{x:-8,y:0},{x:o+8,y:0},{x:o+8,y:-l},{x:-8,y:-l},{x:-8,y:0}];if("handDrawn"===e.look){const t=se.svg(s),i=il(e,{}),r=t.rectangle(c-8,h,o+16,l,i),n=t.line(c,h,c,h+l,i),a=t.line(c+o,h,c+o,h+l,i);s.insert((()=>n),":first-child"),s.insert((()=>a),":first-child");const d=s.insert((()=>r),":first-child"),{cssStyles:u}=e;d.attr("class","basic label-container").attr("style",Co(u)),zo(e,d)}else{const t=_l(s,o,l,d);r&&t.attr("style",r),zo(e,t)}return e.intersect=function(t){return Cl.polygon(e,d,t)},s}async function Lc(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n}=await Po(t,e,Wo(e)),a=Math.max(n.width+2*(e.padding??0),(null==e?void 0:e.width)??0),o=Math.max(n.height+2*(e.padding??0),(null==e?void 0:e.height)??0),l=-a/2,c=-o/2,h=.2*o,d=.2*o,{cssStyles:u}=e,p=se.svg(s),g=il(e,{}),y=[{x:l-h/2,y:c},{x:l+a+h/2,y:c},{x:l+a+h/2,y:c+o},{x:l-h/2,y:c+o}],f=[{x:l+a-h/2,y:c+o},{x:l+a+h/2,y:c+o},{x:l+a+h/2,y:c+o-d}];"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const m=jo(y),x=p.path(m,g),b=jo(f),k=p.path(b,{...g,fillStyle:"solid"}),C=s.insert((()=>k),":first-child");return C.insert((()=>x),":first-child"),C.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",u),r&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",r),zo(e,C),e.intersect=function(t){return Cl.polygon(e,y,t)},s}async function Bc(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n,label:a}=await Po(t,e,Wo(e)),o=Math.max(n.width+2*(e.padding??0),(null==e?void 0:e.width)??0),l=Math.max(n.height+2*(e.padding??0),(null==e?void 0:e.height)??0),c=l/4,h=.2*o,d=.2*l,u=l+c,{cssStyles:p}=e,g=se.svg(s),y=il(e,{});"handDrawn"!==e.look&&(y.roughness=0,y.fillStyle="solid");const f=[{x:-o/2-o/2*.1,y:u/2},...Yo(-o/2-o/2*.1,u/2,o/2+o/2*.1,u/2,c,.8),{x:o/2+o/2*.1,y:-u/2},{x:-o/2-o/2*.1,y:-u/2}],m=-o/2+o/2*.1,x=-u/2-.4*d,b=[{x:m+o-h,y:1.4*(x+l)},{x:m+o,y:x+l-d},{x:m+o,y:.9*(x+l)},...Yo(m+o,1.3*(x+l),m+o-h,1.5*(x+l),.03*-l,.5)],k=jo(f),C=g.path(k,y),S=jo(b),w=g.path(S,{...y,fillStyle:"solid"}),T=s.insert((()=>w),":first-child");return T.insert((()=>C),":first-child"),T.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&T.selectAll("path").attr("style",p),r&&"handDrawn"!==e.look&&T.selectAll("path").attr("style",r),T.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-o/2+(e.padding??0)-(n.x-(n.left??0))},${-l/2+(e.padding??0)-c/2-(n.y-(n.top??0))})`),zo(e,T),e.intersect=function(t){return Cl.polygon(e,f,t)},s}async function $c(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n}=await Po(t,e,Wo(e)),a=Math.max(n.width+e.padding,(null==e?void 0:e.width)||0),o=Math.max(n.height+e.padding,(null==e?void 0:e.height)||0),l=-a/2,c=-o/2,h=s.insert("rect",":first-child");return h.attr("class","text").attr("style",r).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",a).attr("height",o),zo(e,h),e.intersect=function(t){return Cl.rect(e,t)},s}we(mc,"question"),we(xc,"rect_left_inv_arrow"),we(bc,"rectWithTitle"),we(kc,"roundedRect"),we(Cc,"shadedProcess"),we(Sc,"slopedRect"),we(wc,"squareRect"),we(Tc,"stadium"),we(_c,"state"),we(vc,"stateEnd"),we(Ec,"stateStart"),we(Ac,"subroutine"),we(Lc,"taggedRect"),we(Bc,"taggedWaveEdgedRectangle"),we($c,"text");var Dc=we(((t,e,i,r,s,n)=>`M${t},${e}\n a${s},${n} 0,0,1 0,${-r}\n l${i},0\n a${s},${n} 0,0,1 0,${r}\n M${i},${-r}\n a${s},${n} 0,0,0 0,${r}\n l${-i},0`),"createCylinderPathD"),Ic=we(((t,e,i,r,s,n)=>[`M${t},${e}`,`M${t+i},${e}`,`a${s},${n} 0,0,0 0,${-r}`,`l${-i},0`,`a${s},${n} 0,0,0 0,${r}`,`l${i},0`].join(" ")),"createOuterCylinderPathD"),Fc=we(((t,e,i,r,s,n)=>[`M${t+i/2},${-r/2}`,`a${s},${n} 0,0,0 0,${r}`].join(" ")),"createInnerCylinderPathD");async function Nc(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n,label:a,halfPadding:o}=await Po(t,e,Wo(e)),l="neo"===e.look?2*o:o,c=n.height+l,h=c/2,d=h/(2.5+c/50),u=n.width+d+l,{cssStyles:p}=e;let g;if("handDrawn"===e.look){const t=se.svg(s),i=Ic(0,0,u,c,d,h),r=Fc(0,0,u,c,d,h),n=t.path(i,il(e,{})),a=t.path(r,il(e,{fill:"none"}));g=s.insert((()=>a),":first-child"),g=s.insert((()=>n),":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const t=Dc(0,0,u,c,d,h);g=s.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",Co(p)).attr("style",r),g.attr("class","basic label-container"),p&&g.selectAll("path").attr("style",p),r&&g.selectAll("path").attr("style",r)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-u/2}, ${c/2} )`),a.attr("transform",`translate(${-n.width/2-d-(n.x-(n.left??0))}, ${-n.height/2-(n.y-(n.top??0))})`),zo(e,g),e.intersect=function(t){const i=Cl.rect(e,t),r=i.y-(e.y??0);if(0!=h&&(Math.abs(r)<(e.height??0)/2||Math.abs(r)==(e.height??0)/2&&Math.abs(i.x-(e.x??0))>(e.width??0)/2-d)){let s=d*d*(1-r*r/(h*h));0!=s&&(s=Math.sqrt(Math.abs(s))),s=d-s,t.x-(e.x??0)>0&&(s=-s),i.x+=s}return i},s}async function Oc(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n}=await Po(t,e,Wo(e)),a=n.width+e.padding,o=n.height+e.padding,l=[{x:-3*o/6,y:0},{x:a+3*o/6,y:0},{x:a,y:-o},{x:0,y:-o}];let c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=se.svg(s),i=il(e,{}),r=jo(l),n=t.path(r,i);c=s.insert((()=>n),":first-child").attr("transform",`translate(${-a/2}, ${o/2})`),h&&c.attr("style",h)}else c=_l(s,a,o,l);return r&&c.attr("style",r),e.width=a,e.height=o,zo(e,c),e.intersect=function(t){return Cl.polygon(e,l,t)},s}async function Mc(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n}=await Po(t,e,Wo(e)),a=Math.max(60,n.width+2*(e.padding??0),(null==e?void 0:e.width)??0),o=Math.max(20,n.height+2*(e.padding??0),(null==e?void 0:e.height)??0),{cssStyles:l}=e,c=se.svg(s),h=il(e,{});"handDrawn"!==e.look&&(h.roughness=0,h.fillStyle="solid");const d=[{x:-a/2*.8,y:-o/2},{x:a/2*.8,y:-o/2},{x:a/2,y:-o/2*.6},{x:a/2,y:o/2},{x:-a/2,y:o/2},{x:-a/2,y:-o/2*.6}],u=jo(d),p=c.path(u,h),g=s.insert((()=>p),":first-child");return g.attr("class","basic label-container"),l&&"handDrawn"!==e.look&&g.selectChildren("path").attr("style",l),r&&"handDrawn"!==e.look&&g.selectChildren("path").attr("style",r),zo(e,g),e.intersect=function(t){return Cl.polygon(e,d,t)},s}async function Rc(t,e){var i;const{labelStyles:r,nodeStyles:s}=el(e);e.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Po(t,e,Wo(e)),l=Oi(null==(i=mr().flowchart)?void 0:i.htmlLabels),c=a.width+(e.padding??0),h=c+a.height,d=c+a.height,u=[{x:0,y:0},{x:d,y:0},{x:d/2,y:-h}],{cssStyles:p}=e,g=se.svg(n),y=il(e,{});"handDrawn"!==e.look&&(y.roughness=0,y.fillStyle="solid");const f=jo(u),m=g.path(f,y),x=n.insert((()=>m),":first-child").attr("transform",`translate(${-h/2}, ${h/2})`);return p&&"handDrawn"!==e.look&&x.selectChildren("path").attr("style",p),s&&"handDrawn"!==e.look&&x.selectChildren("path").attr("style",s),e.width=c,e.height=h,zo(e,x),o.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${h/2-(a.height+(e.padding??0)/(l?2:1)-(a.y-(a.top??0)))})`),e.intersect=function(t){return ve.info("Triangle intersect",e,u,t),Cl.polygon(e,u,t)},n}async function Pc(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n,label:a}=await Po(t,e,Wo(e)),o=Math.max(n.width+2*(e.padding??0),(null==e?void 0:e.width)??0),l=Math.max(n.height+2*(e.padding??0),(null==e?void 0:e.height)??0),c=l/8,h=l+c,{cssStyles:d}=e,u=70-o,p=u>0?u/2:0,g=se.svg(s),y=il(e,{});"handDrawn"!==e.look&&(y.roughness=0,y.fillStyle="solid");const f=[{x:-o/2-p,y:h/2},...Yo(-o/2-p,h/2,o/2+p,h/2,c,.8),{x:o/2+p,y:-h/2},{x:-o/2-p,y:-h/2}],m=jo(f),x=g.path(m,y),b=s.insert((()=>x),":first-child");return b.attr("class","basic label-container"),d&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",d),r&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",r),b.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-o/2+(e.padding??0)-(n.x-(n.left??0))},${-l/2+(e.padding??0)-c-(n.y-(n.top??0))})`),zo(e,b),e.intersect=function(t){return Cl.polygon(e,f,t)},s}async function qc(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n}=await Po(t,e,Wo(e)),a=Math.max(n.width+2*(e.padding??0),(null==e?void 0:e.width)??0),o=Math.max(n.height+2*(e.padding??0),(null==e?void 0:e.height)??0),l=a/o;let c=a,h=o;c>h*l?h=c/l:c=h*l,c=Math.max(c,100),h=Math.max(h,50);const d=Math.min(.2*h,h/4),u=h+2*d,{cssStyles:p}=e,g=se.svg(s),y=il(e,{});"handDrawn"!==e.look&&(y.roughness=0,y.fillStyle="solid");const f=[{x:-c/2,y:u/2},...Yo(-c/2,u/2,c/2,u/2,d,1),{x:c/2,y:-u/2},...Yo(c/2,-u/2,-c/2,-u/2,d,-1)],m=jo(f),x=g.path(m,y),b=s.insert((()=>x),":first-child");return b.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",p),r&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",r),zo(e,b),e.intersect=function(t){return Cl.polygon(e,f,t)},s}async function zc(t,e){const{labelStyles:i,nodeStyles:r}=el(e);e.labelStyle=i;const{shapeSvg:s,bbox:n,label:a}=await Po(t,e,Wo(e)),o=Math.max(n.width+2*(e.padding??0),(null==e?void 0:e.width)??0),l=Math.max(n.height+2*(e.padding??0),(null==e?void 0:e.height)??0),c=-o/2,h=-l/2,{cssStyles:d}=e,u=se.svg(s),p=il(e,{}),g=[{x:c-5,y:h-5},{x:c-5,y:h+l},{x:c+o,y:h+l},{x:c+o,y:h-5}],y=`M${c-5},${h-5} L${c+o},${h-5} L${c+o},${h+l} L${c-5},${h+l} L${c-5},${h-5}\n M${c-5},${h} L${c+o},${h}\n M${c},${h-5} L${c},${h+l}`;"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const f=u.path(y,p),m=s.insert((()=>f),":first-child");return m.attr("transform","translate(2.5, 2.5)"),m.attr("class","basic label-container"),d&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",d),r&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",r),a.attr("transform",`translate(${-n.width/2+2.5-(n.x-(n.left??0))}, ${-n.height/2+2.5-(n.y-(n.top??0))})`),zo(e,m),e.intersect=function(t){return Cl.polygon(e,g,t)},s}async function Wc(t,e){var i,r,s;const n=e;if(n.alias&&(e.label=n.alias),"handDrawn"===e.look){const{themeVariables:i}=yi(),{background:r}=i,s={...e,id:e.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${r}`]};await Wc(t,s)}const a=yi();e.useHtmlLabels=a.htmlLabels;let o=(null==(i=a.er)?void 0:i.diagramPadding)??10,l=(null==(r=a.er)?void 0:r.entityPadding)??6;const{cssStyles:c}=e,{labelStyles:h}=el(e);if(0===n.attributes.length&&e.label){const i={rx:0,ry:0,labelPaddingX:o,labelPaddingY:1.5*o};oo(e.label,a)+2*i.labelPaddingX0){const t=p.width+2*o-(f+m+x+b);f+=t/S,m+=t/S,x>0&&(x+=t/S),b>0&&(b+=t/S)}const T=f+m+x+b,_=se.svg(u),v=il(e,{});"handDrawn"!==e.look&&(v.roughness=0,v.fillStyle="solid");const E=Math.max(w.width+2*o,(null==e?void 0:e.width)||0,T),A=Math.max(w.height+(y[0]||g)+l,(null==e?void 0:e.height)||0),L=-E/2,B=-A/2;u.selectAll("g:not(:first-child)").each(((t,e,i)=>{const r=K(i[e]),s=r.attr("transform");let n=0,a=0;if(s){const t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(s);t&&(n=parseFloat(t[1]),a=parseFloat(t[2]),r.attr("class").includes("attribute-name")?n+=f:r.attr("class").includes("attribute-keys")?n+=f+m:r.attr("class").includes("attribute-comment")&&(n+=f+m+x))}r.attr("transform",`translate(${L+o/2+n}, ${a+B+p.height+l/2})`)})),u.select(".name").attr("transform","translate("+-p.width/2+", "+(B+l/2)+")");const $=_.rectangle(L,B,E,A,v),D=u.insert((()=>$),":first-child").attr("style",c.join("")),{themeVariables:I}=yi(),{rowEven:F,rowOdd:N,nodeBorder:O}=I;y.push(0);for(const[R,P]of y.entries()){if(0===R&&y.length>1)continue;const t=R%2==0&&0!==P,e=_.rectangle(L,p.height+B+P,E,p.height,{...v,fill:t?F:N,stroke:O});u.insert((()=>e),"g.label").attr("style",c.join("")).attr("class","row-rect-"+(R%2==0?"even":"odd"))}let M=_.line(L,p.height+B,E+L,p.height+B,v);u.insert((()=>M)).attr("class","divider"),M=_.line(f+L,p.height+B,f+L,A+B,v),u.insert((()=>M)).attr("class","divider"),k&&(M=_.line(f+m+L,p.height+B,f+m+L,A+B,v),u.insert((()=>M)).attr("class","divider")),C&&(M=_.line(f+m+x+L,p.height+B,f+m+x+L,A+B,v),u.insert((()=>M)).attr("class","divider"));for(const R of y)M=_.line(L,p.height+B+R,E+L,p.height+B+R,v),u.insert((()=>M)).attr("class","divider");return zo(e,D),e.intersect=function(t){return Cl.rect(e,t)},u}async function jc(t,e,i,r=0,s=0,n=[],a=""){const o=t.insert("g").attr("class",`label ${n.join(" ")}`).attr("transform",`translate(${r}, ${s})`).attr("style",a);e!==Pi(e)&&(e=(e=Pi(e)).replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await Ro(o,e,{width:oo(e,i)+100,style:a,useHtmlLabels:i.htmlLabels},i));if(e.includes("<")||e.includes(">")){let t=l.children[0];for(t.textContent=t.textContent.replaceAll("<","<").replaceAll(">",">");t.childNodes[0];)t=t.childNodes[0],t.textContent=t.textContent.replaceAll("<","<").replaceAll(">",">")}let c=l.getBBox();if(Oi(i.htmlLabels)){const t=l.children[0];t.style.textAlign="start";const e=K(l);c=t.getBoundingClientRect(),e.attr("width",c.width),e.attr("height",c.height)}return c}async function Yc(t,e,i,r,s=i.class.padding??12){const n=r?0:3,a=t.insert("g").attr("class",Wo(e)).attr("id",e.domId||e.id);let o=null,l=null,c=null,h=null,d=0,u=0,p=0;if(o=a.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const t=e.annotations[0];await Uc(o,{text:`«${t}»`},0);d=o.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await Uc(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();u=g.height,c=a.insert("g").attr("class","members-group text");let y=0;for(const x of e.members){y+=await Uc(c,x,y,[x.parseClassifier()])+n}p=c.node().getBBox().height,p<=0&&(p=s/2),h=a.insert("g").attr("class","methods-group text");let f=0;for(const x of e.methods){f+=await Uc(h,x,f,[x.parseClassifier()])+n}let m=a.node().getBBox();if(null!==o){const t=o.node().getBBox();o.attr("transform",`translate(${-t.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),m=a.node().getBBox(),c.attr("transform",`translate(0, ${d+u+2*s})`),m=a.node().getBBox(),h.attr("transform",`translate(0, ${d+u+(p?p+4*s:2*s)})`),m=a.node().getBBox(),{shapeSvg:a,bbox:m}}async function Uc(t,e,i,r=[]){const s=t.insert("g").attr("class","label").attr("style",r.join("; ")),n=yi();let a="useHtmlLabels"in e?e.useHtmlLabels:Oi(n.htmlLabels)??!0,o="";o="text"in e?e.text:e.label,!a&&o.startsWith("\\")&&(o=o.substring(1)),Ui(o)&&(a=!0);const l=await Ro(s,kr(bo(o)),{width:oo(o,n)+50, +// Add room for error when splitting text into multiple lines +classes:"markdown-node-label",useHtmlLabels:a},n);let c,h=1;if(a){const t=l.children[0],e=K(l);h=t.innerHTML.split("
").length,t.innerHTML.includes("")&&(h+=t.innerHTML.split("").length-1);const i=t.getElementsByTagName("img");if(i){const t=""===o.replace(/]*>/g,"").trim();await Promise.all([...i].map((e=>new Promise((i=>{function r(){var r;if(e.style.display="flex",e.style.flexDirection="column",t){const t=(null==(r=n.fontSize)?void 0:r.toString())??window.getComputedStyle(document.body).fontSize,i=5,s=parseInt(t,10)*i+"px";e.style.minWidth=s,e.style.maxWidth=s}else e.style.width="100%";i(e)}we(r,"setupImage"),setTimeout((()=>{e.complete&&r()})),e.addEventListener("error",r),e.addEventListener("load",r)})))))}c=t.getBoundingClientRect(),e.attr("width",c.width),e.attr("height",c.height)}else{r.includes("font-weight: bolder")&&K(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const t=l.children[0];if(""===l.textContent||l.textContent.includes(">")){t.textContent=o[0]+o.substring(1).replaceAll(">",">").replaceAll("<","<").trim();" "===o[1]&&(t.textContent=t.textContent[0]+" "+t.textContent.substring(1))}"undefined"===t.textContent&&(t.textContent=""),c=l.getBBox()}return s.attr("transform","translate(0,"+(-c.height/(2*h)+i)+")"),c.height}async function Hc(t,e){var i,r;const s=mr(),n=s.class.padding??12,a=n,o=e.useHtmlLabels??Oi(s.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:c,bbox:h}=await Yc(t,e,s,o,a),{labelStyles:d,nodeStyles:u}=el(e);e.labelStyle=d,e.cssStyles=l.styles||"";const p=(null==(i=l.styles)?void 0:i.join(";"))||u||"";e.cssStyles||(e.cssStyles=p.replaceAll("!important","").split(";"));const g=0===l.members.length&&0===l.methods.length&&!(null==(r=s.class)?void 0:r.hideEmptyMembersBox),y=se.svg(c),f=il(e,{});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");const m=h.width;let x=h.height;0===l.members.length&&0===l.methods.length?x+=a:l.members.length>0&&0===l.methods.length&&(x+=2*a);const b=-m/2,k=-x/2,C=y.rectangle(b-n,k-n-(g?n:0===l.members.length&&0===l.methods.length?-n/2:0),m+2*n,x+2*n+(g?2*n:0===l.members.length&&0===l.methods.length?-n:0),f),S=c.insert((()=>C),":first-child");S.attr("class","basic label-container");const w=S.node().getBBox();c.selectAll(".text").each(((t,e,i)=>{var r;const s=K(i[e]),a=s.attr("transform");let h=0;if(a){const t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);t&&(h=parseFloat(t[2]))}let d=h+k+n-(g?n:0===l.members.length&&0===l.methods.length?-n/2:0);o||(d-=4);let u=b;(s.attr("class").includes("label-group")||s.attr("class").includes("annotation-group"))&&(u=-(null==(r=s.node())?void 0:r.getBBox().width)/2||0,c.selectAll("text").each((function(t,e,i){"middle"===window.getComputedStyle(i[e]).textAnchor&&(u=0)}))),s.attr("transform",`translate(${u}, ${d})`)}));const T=c.select(".annotation-group").node().getBBox().height-(g?n/2:0)||0,_=c.select(".label-group").node().getBBox().height-(g?n/2:0)||0,v=c.select(".members-group").node().getBBox().height-(g?n/2:0)||0;if(l.members.length>0||l.methods.length>0||g){const t=y.line(w.x,T+_+k+n,w.x+w.width,T+_+k+n,f);c.insert((()=>t)).attr("class","divider").attr("style",p)}if(g||l.members.length>0||l.methods.length>0){const t=y.line(w.x,T+_+v+k+2*a+n,w.x+w.width,T+_+v+k+n+2*a,f);c.insert((()=>t)).attr("class","divider").attr("style",p)}if("handDrawn"!==l.look&&c.selectAll("path").attr("style",p),S.select(":nth-child(2)").attr("style",p),c.selectAll(".divider").select("path").attr("style",p),e.labelStyle?c.selectAll("span").attr("style",e.labelStyle):c.selectAll("span").attr("style",p),!o){const t=RegExp(/color\s*:\s*([^;]*)/),e=t.exec(p);if(e){const t=e[0].replace("color","fill");c.selectAll("tspan").attr("style",t)}else if(d){const e=t.exec(d);if(e){const t=e[0].replace("color","fill");c.selectAll("tspan").attr("style",t)}}}return zo(e,S),e.intersect=function(t){return Cl.rect(e,t)},c}async function Vc(t,e){var i,r;const{labelStyles:s,nodeStyles:n}=el(e);e.labelStyle=s;const a=e,o=e,l="verifyMethod"in e,c=Wo(e),h=t.insert("g").attr("class",c).attr("id",e.domId??e.id);let d;d=l?await Xc(h,`<<${a.type}>>`,0,e.labelStyle):await Xc(h,"<<Element>>",0,e.labelStyle);let u=d;const p=await Xc(h,a.name,u,e.labelStyle+"; font-weight: bold;");if(u+=p+20,l){u+=await Xc(h,""+(a.requirementId?`Id: ${a.requirementId}`:""),u,e.labelStyle);u+=await Xc(h,""+(a.text?`Text: ${a.text}`:""),u,e.labelStyle);u+=await Xc(h,""+(a.risk?`Risk: ${a.risk}`:""),u,e.labelStyle),await Xc(h,""+(a.verifyMethod?`Verification: ${a.verifyMethod}`:""),u,e.labelStyle)}else{u+=await Xc(h,""+(o.type?`Type: ${o.type}`:""),u,e.labelStyle),await Xc(h,""+(o.docRef?`Doc Ref: ${o.docRef}`:""),u,e.labelStyle)}const g=((null==(i=h.node())?void 0:i.getBBox().width)??200)+20,y=((null==(r=h.node())?void 0:r.getBBox().height)??200)+20,f=-g/2,m=-y/2,x=se.svg(h),b=il(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");const k=x.rectangle(f,m,g,y,b),C=h.insert((()=>k),":first-child");if(C.attr("class","basic label-container").attr("style",n),h.selectAll(".label").each(((t,e,i)=>{const r=K(i[e]),s=r.attr("transform");let n=0,a=0;if(s){const t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(s);t&&(n=parseFloat(t[1]),a=parseFloat(t[2]))}const o=a-y/2;let l=f+10;0!==e&&1!==e||(l=n),r.attr("transform",`translate(${l}, ${o+20})`)})),u>d+p+20){const t=x.line(f,m+d+p+20,f+g,m+d+p+20,b);h.insert((()=>t)).attr("style",n)}return zo(e,C),e.intersect=function(t){return Cl.rect(e,t)},h}async function Xc(t,e,i,r=""){if(""===e)return 0;const s=t.insert("g").attr("class","label").attr("style",r),n=mr(),a=n.htmlLabels??!0,o=await Ro(s,kr(bo(e)),{width:oo(e,n)+50, +// Add room for error when splitting text into multiple lines +classes:"markdown-node-label",useHtmlLabels:a,style:r},n);let l;if(a){const t=o.children[0],e=K(o);l=t.getBoundingClientRect(),e.attr("width",l.width),e.attr("height",l.height)}else{const t=o.children[0];for(const e of t.children)e.textContent=e.textContent.replaceAll(">",">").replaceAll("<","<"),r&&e.setAttribute("style",r);l=o.getBBox(),l.height+=6}return s.attr("transform",`translate(${-l.width/2},${-l.height/2+i})`),l.height}we(Nc,"tiltedCylinder"),we(Oc,"trapezoid"),we(Mc,"trapezoidalPentagon"),we(Rc,"triangle"),we(Pc,"waveEdgedRectangle"),we(qc,"waveRectangle"),we(zc,"windowPane"),we(Wc,"erBox"),we(jc,"addText"),we(Yc,"textHelper"),we(Uc,"addText"),we(Hc,"classBox"),we(Vc,"requirementBox"),we(Xc,"addText");var Gc=we((t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null; +// no stroke +case"Low":return"blue";case"Very Low":return"lightblue"}}),"colorFromPriority");async function Kc(t,e,{config:i}){var r,s;const{labelStyles:n,nodeStyles:a}=el(e);e.labelStyle=n||"";const o=e.width;e.width=(e.width??200)-10;const{shapeSvg:l,bbox:c,label:h}=await Po(t,e,Wo(e)),d=e.padding||10;let u,p="";"ticket"in e&&e.ticket&&(null==(r=null==i?void 0:i.kanban)?void 0:r.ticketBaseUrl)&&(p=null==(s=null==i?void 0:i.kanban)?void 0:s.ticketBaseUrl.replace("#TICKET#",e.ticket),u=l.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",p).attr("target","_blank"));const g={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let y,f;({label:y,bbox:f}=u?await qo(u,"ticket"in e&&e.ticket||"",g):await qo(l,"ticket"in e&&e.ticket||"",g));const{label:m,bbox:x}=await qo(l,"assigned"in e&&e.assigned||"",g);e.width=o;const b=(null==e?void 0:e.width)||0,k=Math.max(f.height,x.height)/2,C=Math.max(c.height+20,(null==e?void 0:e.height)||0)+k,S=-b/2,w=-C/2;let T;h.attr("transform","translate("+(d-b/2)+", "+(-k-c.height/2)+")"),y.attr("transform","translate("+(d-b/2)+", "+(-k+c.height/2)+")"),m.attr("transform","translate("+(d+b/2-x.width-20)+", "+(-k+c.height/2)+")");const{rx:_,ry:v}=e,{cssStyles:E}=e;if("handDrawn"===e.look){const t=se.svg(l),i=il(e,{}),r=_||v?t.path(Ko(S,w,b,C,_||0),i):t.rectangle(S,w,b,C,i);T=l.insert((()=>r),":first-child"),T.attr("class","basic label-container").attr("style",E||null)}else{T=l.insert("rect",":first-child"),T.attr("class","basic label-container __APA__").attr("style",a).attr("rx",_??5).attr("ry",v??5).attr("x",S).attr("y",w).attr("width",b).attr("height",C);const t="priority"in e&&e.priority;if(t){const e=l.append("line"),i=S+2,r=w+Math.floor((_??0)/2),s=w+C-Math.floor((_??0)/2);e.attr("x1",i).attr("y1",r).attr("x2",i).attr("y2",s).attr("stroke-width","4").attr("stroke",Gc(t))}}return zo(e,T),e.height=C,e.intersect=function(t){return Cl.rect(e,t)},l}we(Kc,"kanbanItem");var Qc=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:wc},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:kc},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:Tc},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:Ac},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:zl},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Al},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:mc},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Gl},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:ac},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:nc},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:Oc},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:ic},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:jl},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:$c},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:vl},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:Cc},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:Ec},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:vc},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Hl},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Kl},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Dl},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Fl},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Ol},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:oc},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:Pc},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Vl},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:Nc},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:dc},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Ml},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Wl},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:Rc},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:zc},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Yl},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:Mc},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Ul},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:Sc},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:gc},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:pc},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Tl},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Bl},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:Bc},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:Lc},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:qc},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:xc},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:uc}],Zc=we((()=>{const t={ +// States +state:_c,choice:El,note:yc, +// Rectangles +rectWithTitle:bc,labelRect:sc, +// Icons +iconSquare:tc,iconCircle:Zl,icon:Ql,iconRounded:Jl,imageSquare:ec,anchor:Sl, +// Kanban diagram +kanbanItem:Kc, +// class diagram +classBox:Hc, +// er diagram +erBox:Wc, +// Requirement diagram +requirementBox:Vc},e=[...Object.entries(t),...Qc.flatMap((t=>[t.shortName,..."aliases"in t?t.aliases:[],..."internalAliases"in t?t.internalAliases:[]].map((e=>[e,t.handler]))))];return Object.fromEntries(e)}),"generateShapeMap")();function Jc(t){return t in Zc}we(Jc,"isValidShape");var th=new Map;async function eh(t,e,i){let r,s;"rect"===e.shape&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const n=e.shape?Zc[e.shape]:void 0;if(!n)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let a;"sandbox"===i.config.securityLevel?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),r=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a??null),s=await n(r,e,i)}else s=await n(t,e,i),r=s;return e.tooltip&&s.attr("title",e.tooltip),th.set(e.id,r),e.haveCallback&&r.attr("class",r.attr("class")+" clickable"),r}we(eh,"insertNode");var ih=we(((t,e)=>{th.set(e.id,t)}),"setNodeElem"),rh=we((()=>{th.clear()}),"clear"),sh=we((t=>{const e=th.get(t.id);ve.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}),"positionNode"),nh=we(((t,e,i,r,s,n)=>{e.arrowTypeStart&&oh(t,"start",e.arrowTypeStart,i,r,s,n),e.arrowTypeEnd&&oh(t,"end",e.arrowTypeEnd,i,r,s,n)}),"addEdgeMarkers"),ah={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},oh=we(((t,e,i,r,s,n,a)=>{var o;const l=ah[i];if(!l)return void ve.warn(`Unknown arrow type: ${i}`);const c=`${s}_${n}-${l.type}${"start"===e?"Start":"End"}`;if(a&&""!==a.trim()){const i=`${c}_${a.replace(/[^\dA-Za-z]/g,"_")}`;if(!document.getElementById(i)){const t=document.getElementById(c);if(t){const e=t.cloneNode(!0);e.id=i;e.querySelectorAll("path, circle, line").forEach((t=>{t.setAttribute("stroke",a),l.fill&&t.setAttribute("fill",a)})),null==(o=t.parentNode)||o.appendChild(e)}}t.attr(`marker-${e}`,`url(${r}#${i})`)}else t.attr(`marker-${e}`,`url(${r}#${c})`)}),"addEdgeMarker"),lh=new Map,ch=new Map,hh=we((()=>{lh.clear(),ch.clear()}),"clear"),dh=we((t=>t?t.reduce(((t,e)=>t+";"+e),""):""),"getLabelStyles"),uh=we((async(t,e)=>{let i=Oi(mr().flowchart.htmlLabels);const r=await Ro(t,e.label,{style:dh(e.labelStyle),useHtmlLabels:i,addSvgBackground:!0,isNode:!1});ve.info("abc82",e,e.labelType);const s=t.insert("g").attr("class","edgeLabel"),n=s.insert("g").attr("class","label");n.node().appendChild(r);let a,o=r.getBBox();if(i){const t=r.children[0],e=K(r);o=t.getBoundingClientRect(),e.attr("width",o.width),e.attr("height",o.height)}if(n.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),lh.set(e.id,s),e.width=o.width,e.height=o.height,e.startLabelLeft){const i=await Go(e.startLabelLeft,dh(e.labelStyle)),r=t.insert("g").attr("class","edgeTerminals"),s=r.insert("g").attr("class","inner");a=s.node().appendChild(i);const n=i.getBBox();s.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),ch.get(e.id)||ch.set(e.id,{}),ch.get(e.id).startLeft=r,ph(a,e.startLabelLeft)}if(e.startLabelRight){const i=await Go(e.startLabelRight,dh(e.labelStyle)),r=t.insert("g").attr("class","edgeTerminals"),s=r.insert("g").attr("class","inner");a=r.node().appendChild(i),s.node().appendChild(i);const n=i.getBBox();s.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),ch.get(e.id)||ch.set(e.id,{}),ch.get(e.id).startRight=r,ph(a,e.startLabelRight)}if(e.endLabelLeft){const i=await Go(e.endLabelLeft,dh(e.labelStyle)),r=t.insert("g").attr("class","edgeTerminals"),s=r.insert("g").attr("class","inner");a=s.node().appendChild(i);const n=i.getBBox();s.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),r.node().appendChild(i),ch.get(e.id)||ch.set(e.id,{}),ch.get(e.id).endLeft=r,ph(a,e.endLabelLeft)}if(e.endLabelRight){const i=await Go(e.endLabelRight,dh(e.labelStyle)),r=t.insert("g").attr("class","edgeTerminals"),s=r.insert("g").attr("class","inner");a=s.node().appendChild(i);const n=i.getBBox();s.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),r.node().appendChild(i),ch.get(e.id)||ch.set(e.id,{}),ch.get(e.id).endRight=r,ph(a,e.endLabelRight)}return r}),"insertEdgeLabel");function ph(t,e){mr().flowchart.htmlLabels&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}we(ph,"setTerminalWidth");var gh=we(((t,e)=>{ve.debug("Moving label abc88 ",t.id,t.label,lh.get(t.id),e);let i=e.updatedPath?e.updatedPath:e.originalPath;const r=mr(),{subGraphTitleTotalMargin:s}=Aa(r);if(t.label){const r=lh.get(t.id);let n=t.x,a=t.y;if(i){const r=mo.calcLabelPosition(i);ve.debug("Moving label "+t.label+" from (",n,",",a,") to (",r.x,",",r.y,") abc88"),e.updatedPath&&(n=r.x,a=r.y)}r.attr("transform",`translate(${n}, ${a+s/2})`)}if(t.startLabelLeft){const e=ch.get(t.id).startLeft;let r=t.x,s=t.y;if(i){const e=mo.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",i);r=e.x,s=e.y}e.attr("transform",`translate(${r}, ${s})`)}if(t.startLabelRight){const e=ch.get(t.id).startRight;let r=t.x,s=t.y;if(i){const e=mo.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",i);r=e.x,s=e.y}e.attr("transform",`translate(${r}, ${s})`)}if(t.endLabelLeft){const e=ch.get(t.id).endLeft;let r=t.x,s=t.y;if(i){const e=mo.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",i);r=e.x,s=e.y}e.attr("transform",`translate(${r}, ${s})`)}if(t.endLabelRight){const e=ch.get(t.id).endRight;let r=t.x,s=t.y;if(i){const e=mo.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",i);r=e.x,s=e.y}e.attr("transform",`translate(${r}, ${s})`)}}),"positionEdgeLabel"),yh=we(((t,e)=>{const i=t.x,r=t.y,s=Math.abs(e.x-i),n=Math.abs(e.y-r),a=t.width/2,o=t.height/2;return s>=a||n>=o}),"outsideNode"),fh=we(((t,e,i)=>{ve.debug(`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,s=t.y,n=Math.abs(r-i.x),a=t.width/2;let o=i.xMath.abs(r-e.x)*l){let t=i.y{ve.warn("abc88 cutPathAtIntersect",t,e);let i=[],r=t[0],s=!1;return t.forEach((t=>{if(ve.info("abc88 checking point",t,e),yh(e,t)||s)ve.warn("abc88 outside",t,r),r=t,s||i.push(t);else{const n=fh(e,r,t);ve.debug("abc88 inside",t,r,n),ve.debug("abc88 intersection",n,e);let a=!1;i.forEach((t=>{a=a||t.x===n.x&&t.y===n.y})),i.some((t=>t.x===n.x&&t.y===n.y))?ve.warn("abc88 no intersect",n,i):i.push(n),s=!0}})),ve.debug("returning points",i),i}),"cutPathAtIntersect");function xh(t){const e=[],i=[];for(let r=1;r5&&Math.abs(n.y-s.y)>5||s.y===n.y&&n.x===a.x&&Math.abs(n.x-s.x)>5&&Math.abs(n.y-a.y)>5)&&(e.push(n),i.push(r))}return{cornerPoints:e,cornerPointPositions:i}}we(xh,"extractCornerPoints");var bh=we((function(t,e,i){const r=e.x-t.x,s=e.y-t.y,n=i/Math.sqrt(r*r+s*s);return{x:e.x-n*r,y:e.y-n*s}}),"findAdjacentPoint"),kh=we((function(t){const{cornerPointPositions:e}=xh(t),i=[];for(let r=0;r10&&Math.abs(s.y-e.y)>=10){ve.debug("Corner point fixing",Math.abs(s.x-e.x),Math.abs(s.y-e.y));const t=5;d=n.x===a.x?{x:l<0?a.x-t+h:a.x+t-h,y:c<0?a.y-h:a.y+h}:{x:l<0?a.x-h:a.x+h,y:c<0?a.y-t+h:a.y+t-h}}else ve.debug("Corner point skipping fixing",Math.abs(s.x-e.x),Math.abs(s.y-e.y));i.push(d,o)}else i.push(t[r]);return i}),"fixCorners"),Ch=we((function(t,e,i,r,s,n,a){var o;const{handDrawnSeed:l}=mr();let c=e.points,h=!1;const d=s;var u=n;const p=[];for(const v in e.cssCompiledStyles)tl(v)||p.push(e.cssCompiledStyles[v]);u.intersect&&d.intersect&&(c=c.slice(1,e.points.length-1),c.unshift(d.intersect(c[0])),ve.debug("Last point APA12",e.start,"--\x3e",e.end,c[c.length-1],u,u.intersect(c[c.length-1])),c.push(u.intersect(c[c.length-1]))),e.toCluster&&(ve.info("to cluster abc88",i.get(e.toCluster)),c=mh(e.points,i.get(e.toCluster).node),h=!0),e.fromCluster&&(ve.debug("from cluster abc88",i.get(e.fromCluster),JSON.stringify(c,null,2)),c=mh(c.reverse(),i.get(e.fromCluster).node).reverse(),h=!0);let g=c.filter((t=>!Number.isNaN(t.y)));g=kh(g);let y=te;switch(y=Wt,e.curve){case"linear":y=Wt;break;case"basis":default:y=te;break;case"cardinal":y=Ht;break;case"bumpX":y=Qt;break;case"bumpY":y=Kt;break;case"catmullRom":y=jt;break;case"monotoneX":y=qt;break;case"monotoneY":y=Pt;break;case"natural":y=Rt;break;case"step":y=Mt;break;case"stepAfter":y=Ot;break;case"stepBefore":y=Nt}const{x:f,y:m}=Ea(e),x=ee().x(f).y(m).curve(y);let b,k;switch(e.thickness){case"normal":default:b="edge-thickness-normal";break;case"thick":b="edge-thickness-thick";break;case"invisible":b="edge-thickness-invisible"}switch(e.pattern){case"solid":default:b+=" edge-pattern-solid";break;case"dotted":b+=" edge-pattern-dotted";break;case"dashed":b+=" edge-pattern-dashed"}let C=x(g);const S=Array.isArray(e.style)?e.style:[e.style];let w=S.find((t=>null==t?void 0:t.startsWith("stroke:")));if("handDrawn"===e.look){const i=se.svg(t);Object.assign([],g);const r=i.path(C,{roughness:.3,seed:l});b+=" transition",k=K(r).select("path").attr("id",e.id).attr("class"," "+b+(e.classes?" "+e.classes:"")).attr("style",S?S.reduce(((t,e)=>t+";"+e),""):"");let s=k.attr("d");k.attr("d",s),t.node().appendChild(k.node())}else{const i=p.join(";"),r=S?S.reduce(((t,e)=>t+e+";"),""):"";let s="";e.animate&&(s=" edge-animation-fast"),e.animation&&(s=" edge-animation-"+e.animation);const n=i?i+";"+r+";":r;k=t.append("path").attr("d",C).attr("id",e.id).attr("class"," "+b+(e.classes?" "+e.classes:"")+(s??"")).attr("style",n),w=null==(o=n.match(/stroke:([^;]+)/))?void 0:o[1]}let T="";(mr().flowchart.arrowMarkerAbsolute||mr().state.arrowMarkerAbsolute)&&(T=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,T=T.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),ve.info("arrowTypeStart",e.arrowTypeStart),ve.info("arrowTypeEnd",e.arrowTypeEnd),nh(k,e,T,a,r,w);let _={};return h&&(_.updatedPath=c),_.originalPath=e.points,_}),"insertEdge"),Sh=we(((t,e,i,r)=>{e.forEach((e=>{wh[e](t,i,r)}))}),"insertMarkers"),wh={extension:we(((t,e,i)=>{ve.trace("Making markers for ",i),t.append("defs").append("marker").attr("id",i+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).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",i+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")}),"extension"),composition:we(((t,e,i)=>{t.append("defs").append("marker").attr("id",i+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).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",i+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).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")}),"composition"),aggregation:we(((t,e,i)=>{t.append("defs").append("marker").attr("id",i+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).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",i+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).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"),dependency:we(((t,e,i)=>{t.append("defs").append("marker").attr("id",i+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).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",i+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).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")}),"dependency"),lollipop:we(((t,e,i)=>{t.append("defs").append("marker").attr("id",i+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",i+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)}),"lollipop"),point:we(((t,e,i)=>{t.append("marker").attr("id",i+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).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",i+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).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")}),"point"),circle:we(((t,e,i)=>{t.append("marker").attr("id",i+"_"+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",i+"_"+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")}),"circle"),cross:we(((t,e,i)=>{t.append("marker").attr("id",i+"_"+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",i+"_"+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")}),"cross"),barb:we(((t,e,i)=>{t.append("defs").append("marker").attr("id",i+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")}),"barb"),only_one:we(((t,e,i)=>{t.append("defs").append("marker").attr("id",i+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",i+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")}),"only_one"),zero_or_one:we(((t,e,i)=>{const r=t.append("defs").append("marker").attr("id",i+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");r.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),r.append("path").attr("d","M9,0 L9,18");const s=t.append("defs").append("marker").attr("id",i+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),s.append("path").attr("d","M21,0 L21,18")}),"zero_or_one"),one_or_more:we(((t,e,i)=>{t.append("defs").append("marker").attr("id",i+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").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",i+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")}),"one_or_more"),zero_or_more:we(((t,e,i)=>{const r=t.append("defs").append("marker").attr("id",i+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");r.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),r.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const s=t.append("defs").append("marker").attr("id",i+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),s.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")}),"zero_or_more"),requirement_arrow:we(((t,e,i)=>{t.append("defs").append("marker").attr("id",i+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d","M0,0\n L20,10\n M20,10\n L0,20")}),"requirement_arrow"),requirement_contains:we(((t,e,i)=>{const r=t.append("defs").append("marker").attr("id",i+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");r.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),r.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),r.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)}),"requirement_contains")},Th=Sh,_h={common:Xi,getConfig:yi,insertCluster:cl,insertEdge:Ch,insertEdgeLabel:uh,insertMarkers:Th,insertNode:eh,interpolateToCurve:za,labelHelper:Po,log:ve,positionEdgeLabel:gh},vh={},Eh=we((t=>{for(const e of t)vh[e.name]=e}),"registerLayoutLoaders");we((()=>{Eh([{name:"dagre",loader:we((async()=>await P((()=>Promise.resolve().then((()=>qu))),void 0,import.meta.url)),"loader")}])}),"registerDefaultLayoutLoaders")();var Ah=we((async(t,e)=>{if(!(t.layoutAlgorithm in vh))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);const i=vh[t.layoutAlgorithm];return(await i.loader()).render(t,e,_h,{algorithm:i.algorithm})}),"render"),Lh=we(((t="",{fallback:e="dagre"}={})=>{if(t in vh)return t;if(e in vh)return ve.warn(`Layout algorithm ${t} is not registered. Using ${e} as fallback.`),e;throw new Error(`Both layout algorithms ${t} and ${e} are not registered.`)}),"getRegisteredLayoutAlgorithm"),Bh="11.6.0",$h=we((t=>{var e;const{securityLevel:i}=mr();let r=K("body");if("sandbox"===i){const i=(null==(e=K(`#i${t}`).node())?void 0:e.contentDocument)??document;r=K(i.body)}return r.select(`#${t}`)}),"selectSvgElement"),Dh={id:"c4",detector:we((t=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t)),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>xg));return{diagram:t}}),void 0,import.meta.url);return{id:"c4",diagram:t}}),"loader")},Ih="flowchart",Fh={id:Ih,detector:we(((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)&&/^\s*graph/.test(t)}),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>Dg));return{diagram:t}}),void 0,import.meta.url);return{id:Ih,diagram:t}}),"loader")},Nh="flowchart-v2",Oh={id:Nh,detector:we(((t,e)=>{var i,r,s;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)&&(e.layout="elk"),!(!/^\s*graph/.test(t)||"dagre-wrapper"!==(null==(s=null==e?void 0:e.flowchart)?void 0:s.defaultRenderer))||/^\s*flowchart/.test(t))}),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>Dg));return{diagram:t}}),void 0,import.meta.url);return{id:Nh,diagram:t}}),"loader")},Mh={id:"er",detector:we((t=>/^\s*erDiagram/.test(t)),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>zg));return{diagram:t}}),void 0,import.meta.url);return{id:"er",diagram:t}}),"loader")},Rh="gitGraph",Ph={id:Rh,detector:we((t=>/^\s*gitGraph/.test(t)),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>tf));return{diagram:t}}),void 0,import.meta.url);return{id:Rh,diagram:t}}),"loader")},qh="gantt",zh={id:qh,detector:we((t=>/^\s*gantt/.test(t)),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>vm));return{diagram:t}}),void 0,import.meta.url);return{id:qh,diagram:t}}),"loader")},Wh="info",jh={id:Wh,detector:we((t=>/^\s*info/.test(t)),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>Lm));return{diagram:t}}),void 0,import.meta.url);return{id:Wh,diagram:t}}),"loader")},Yh={id:"pie",detector:we((t=>/^\s*pie/.test(t)),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>zm));return{diagram:t}}),void 0,import.meta.url);return{id:"pie",diagram:t}}),"loader")},Uh="quadrantChart",Hh={id:Uh,detector:we((t=>/^\s*quadrantChart/.test(t)),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>gx));return{diagram:t}}),void 0,import.meta.url);return{id:Uh,diagram:t}}),"loader")},Vh="xychart",Xh={id:Vh,detector:we((t=>/^\s*xychart-beta/.test(t)),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>ob));return{diagram:t}}),void 0,import.meta.url);return{id:Vh,diagram:t}}),"loader")},Gh="requirement",Kh={id:Gh,detector:we((t=>/^\s*requirement(Diagram)?/.test(t)),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>yb));return{diagram:t}}),void 0,import.meta.url);return{id:Gh,diagram:t}}),"loader")},Qh="sequence",Zh={id:Qh,detector:we((t=>/^\s*sequenceDiagram/.test(t)),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>_k));return{diagram:t}}),void 0,import.meta.url);return{id:Qh,diagram:t}}),"loader")},Jh="class",td={id:Jh,detector:we(((t,e)=>{var i;return"dagre-wrapper"!==(null==(i=null==e?void 0:e.class)?void 0:i.defaultRenderer)&&/^\s*classDiagram/.test(t)}),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>Rk));return{diagram:t}}),void 0,import.meta.url);return{id:Jh,diagram:t}}),"loader")},ed="classDiagram",id={id:ed,detector:we(((t,e)=>{var i;return!(!/^\s*classDiagram/.test(t)||"dagre-wrapper"!==(null==(i=null==e?void 0:e.class)?void 0:i.defaultRenderer))||/^\s*classDiagram-v2/.test(t)}),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>qk));return{diagram:t}}),void 0,import.meta.url);return{id:ed,diagram:t}}),"loader")},rd="state",sd={id:rd,detector:we(((t,e)=>{var i;return"dagre-wrapper"!==(null==(i=null==e?void 0:e.state)?void 0:i.defaultRenderer)&&/^\s*stateDiagram/.test(t)}),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>lS));return{diagram:t}}),void 0,import.meta.url);return{id:rd,diagram:t}}),"loader")},nd="stateDiagram",ad={id:nd,detector:we(((t,e)=>{var i;return!!/^\s*stateDiagram-v2/.test(t)||!(!/^\s*stateDiagram/.test(t)||"dagre-wrapper"!==(null==(i=null==e?void 0:e.state)?void 0:i.defaultRenderer))}),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>hS));return{diagram:t}}),void 0,import.meta.url);return{id:nd,diagram:t}}),"loader")},od="journey",ld={id:od,detector:we((t=>/^\s*journey/.test(t)),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>QS));return{diagram:t}}),void 0,import.meta.url);return{id:od,diagram:t}}),"loader")},cd={draw:we(((t,e,i)=>{ve.debug("rendering svg for syntax error\n");const r=$h(e),s=r.append("g");r.attr("viewBox","0 0 2412 512"),Qi(r,100,512,!0),s.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"),s.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"),s.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"),s.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"),s.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"),s.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"),s.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),s.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${i}`)}),"draw")},hd=cd,dd={db:{},renderer:cd,parser:{parse:we((()=>{}),"parse")}},ud="flowchart-elk",pd={id:ud,detector:we(((t,e={})=>{var i; +// If diagram explicitly states flowchart-elk +return!!(/^\s*flowchart-elk/.test(t)||// If a flowchart/graph diagram has their default renderer set to elk +/^\s*flowchart|graph/.test(t)&&"elk"===(null==(i=null==e?void 0:e.flowchart)?void 0:i.defaultRenderer))&&(e.layout="elk",!0)}),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>Dg));return{diagram:t}}),void 0,import.meta.url);return{id:ud,diagram:t}}),"loader")},gd="timeline",yd={id:gd,detector:we((t=>/^\s*timeline/.test(t)),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>qw));return{diagram:t}}),void 0,import.meta.url);return{id:gd,diagram:t}}),"loader")},fd="mindmap",md={id:fd,detector:we((t=>/^\s*mindmap/.test(t)),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>fT));return{diagram:t}}),void 0,import.meta.url);return{id:fd,diagram:t}}),"loader")},xd="kanban",bd={id:xd,detector:we((t=>/^\s*kanban/.test(t)),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>IT));return{diagram:t}}),void 0,import.meta.url);return{id:xd,diagram:t}}),"loader")},kd="sankey",Cd={id:kd,detector:we((t=>/^\s*sankey-beta/.test(t)),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>e_));return{diagram:t}}),void 0,import.meta.url);return{id:kd,diagram:t}}),"loader")},Sd="packet",wd={id:Sd,detector:we((t=>/^\s*packet-beta/.test(t)),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>y_));return{diagram:t}}),void 0,import.meta.url);return{id:Sd,diagram:t}}),"loader")},Td="radar",_d={id:Td,detector:we((t=>/^\s*radar-beta/.test(t)),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>W_));return{diagram:t}}),void 0,import.meta.url);return{id:Td,diagram:t}}),"loader")},vd="block",Ed={id:vd,detector:we((t=>/^\s*block-beta/.test(t)),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>GE));return{diagram:t}}),void 0,import.meta.url);return{id:vd,diagram:t}}),"loader")},Ad="architecture",Ld={id:Ad,detector:we((t=>/^\s*architecture/.test(t)),"detector"),loader:we((async()=>{const{diagram:t}=await P((async()=>{const{diagram:t}=await Promise.resolve().then((()=>XA));return{diagram:t}}),void 0,import.meta.url);return{id:Ad,diagram:t}}),"loader")},Bd=!1,$d=we((()=>{Bd||(Bd=!0,Tr("error",dd,(t=>"error"===t.toLowerCase().trim())),Tr("---", +// --- diagram type may appear if YAML front-matter is not parsed correctly +{db:{clear:we((()=>{}),"clear")},styles:{}, +// should never be used +renderer:{draw:we((()=>{}),"draw")},parser:{parse:we((()=>{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 un-indented `---` blocks")}),"parse")},init:we((()=>null),"init")},(t=>t.toLowerCase().trimStart().startsWith("---"))),Fe(Dh,bd,id,td,Mh,zh,jh,Yh,Kh,Zh,pd,Oh,Fh,md,yd,Ph,ad,sd,ld,Hh,Cd,wd,Xh,Ed,Ld,_d))}),"addDiagrams"),Dd=we((async()=>{ve.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(De).map((async([t,{detector:e,loader:i}])=>{if(i)try{_r(t)}catch{try{const{diagram:t,id:r}=await i();Tr(r,t,e)}catch(r){throw ve.error(`Failed to load external diagram with key ${t}. Removing from detectors.`),delete De[t],r}}})))).filter((t=>"rejected"===t.status));if(t.length>0){ve.error(`Failed to load ${t.length} external diagrams`);for(const e of t)ve.error(e);throw new Error(`Failed to load ${t.length} external diagrams`)}}),"loadRegisteredDiagrams");function Id(t,e){t.attr("role","graphics-document document"),""!==e&&t.attr("aria-roledescription",e)}function Fd(t,e,i,r){if(void 0!==t.insert){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)}}}we(Id,"setA11yDiagramInfo"),we(Fd,"addSVGa11yTitleDescription");var Nd=(we(l=class{constructor(t,e,i,r,s){this.type=t,this.text=e,this.db=i,this.parser=r,this.renderer=s}static async fromText(t,e={}){var i,r;const s=yi(),n=Ie(t,s);t=xo(t)+"\n";try{_r(n)}catch{const t=Oe(n);if(!t)throw new $e(`Diagram ${n} not found.`);const{id:e,diagram:i}=await t();Tr(e,i)}const{db:a,parser:o,renderer:c,init:h}=_r(n);return o.parser&&(o.parser.yy=a),null==(i=a.clear)||i.call(a),null==h||h(s),e.title&&(null==(r=a.setDiagramTitle)||r.call(a,e.title)),await o.parse(t),new l(n,t,a,o,c)}async render(t,e){await this.renderer.draw(this.text,t,e,this)}getParser(){return this.parser}getType(){return this.type}},"Diagram"),l),Od=[],Md=we((()=>{Od.forEach((t=>{t()})),Od=[]}),"attachFunctions"),Rd=we((t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart()),"cleanupComments");function Pd(t){const e=t.match(Ae);if(!e)return{text:t,metadata:{}};let i=wa(e[1],{ +// To support config, we need JSON schema. +// https://www.yaml.org/spec/1.2/spec.html#id2803231 +schema:Sa})??{};i="object"!=typeof i||Array.isArray(i)?{}:i;const r={};return i.displayMode&&(r.displayMode=i.displayMode.toString()),i.title&&(r.title=i.title.toString()),i.config&&(r.config=i.config),{text:t.slice(e[0].length),metadata:r}}we(Pd,"extractFrontMatter");var qd=we((t=>t.replace(/\r\n?/g,"\n").replace(/<(\w+)([^>]*)>/g,((t,e,i)=>"<"+e+i.replace(/="([^"]*)"/g,"='$1'")+">"))),"cleanupText"),zd=we((t=>{const{text:e,metadata:i}=Pd(t),{displayMode:r,title:s,config:n={}}=i;return r&&(n.gantt||(n.gantt={}),n.gantt.displayMode=r),{title:s,config:n,text:e}}),"processFrontmatter"),Wd=we((t=>{const e=mo.detectInit(t)??{},i=mo.detectDirective(t,"wrap");return Array.isArray(i)?e.wrap=i.some((({type:t})=>"wrap"===t)):"wrap"===(null==i?void 0:i.type)&&(e.wrap=!0),{text:Pa(t),directive:e}}),"processDirectives");function jd(t){const e=qd(t),i=zd(e),r=Wd(i.text),s=fo(i.config,r.directive);return{code:t=Rd(r.text),title:i.title,config:s}}function Yd(t){const e=(new TextEncoder).encode(t),i=Array.from(e,(t=>String.fromCodePoint(t))).join("");return btoa(i)}we(jd,"preprocessDiagram"),we(Yd,"toBase64");var Ud=["foreignobject"],Hd=["dominant-baseline"];function Vd(t){const e=jd(t);return xi(),mi(e.config??{}),e}async function Xd(t,e){$d();try{const{code:e,config:i}=Vd(t);return{diagramType:(await nu(e)).type,config:i}}catch(i){if(null==e?void 0:e.suppressErrors)return!1;throw i}}we(Vd,"processAndSetConfigs"),we(Xd,"parse");var Gd=we(((t,e,i=[])=>`\n.${t} ${e} { ${i.join(" !important; ")} !important; }`),"cssImportantStyles"),Kd=we(((t,e=new Map)=>{var i;let r="";if(void 0!==t.themeCSS&&(r+=`\n${t.themeCSS}`),void 0!==t.fontFamily&&(r+=`\n:root { --mermaid-font-family: ${t.fontFamily}}`),void 0!==t.altFontFamily&&(r+=`\n:root { --mermaid-alt-font-family: ${t.altFontFamily}}`),e instanceof Map){const s=t.htmlLabels??(null==(i=t.flowchart)?void 0:i.htmlLabels)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach((t=>{U(t.styles)||s.forEach((e=>{r+=Gd(t.id,e,t.styles)})),U(t.textStyles)||(r+=Gd(t.id,"tspan",((null==t?void 0:t.textStyles)||[]).map((t=>t.replace("color","fill")))))}))}return r}),"createCssStyles"),Qd=we(((t,e,i,r)=>{const s=Kd(t,i),n=ir(e,s,t.themeVariables);return V(X(`${r}{${n}}`),G)}),"createUserStyles"),Zd=we(((t="",e,i)=>{let r=t;return i||e||(r=r.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),r=bo(r),r=r.replace(/
/g,"
"),r}),"cleanUpSvgCode"),Jd=we(((t="",e)=>{var i,r;return``}),"putIntoIFrame"),tu=we(((t,e,i,r,s)=>{const n=t.append("div");n.attr("id",i),r&&n.attr("style",r);const a=n.append("svg").attr("id",e).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg");return s&&a.attr("xmlns:xlink",s),a.append("g"),t}),"appendDivSvgG");function eu(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}we(eu,"sandboxedIframe");var iu=we(((t,e,i,r)=>{var s,n,a;null==(s=t.getElementById(e))||s.remove(),null==(n=t.getElementById(i))||n.remove(),null==(a=t.getElementById(r))||a.remove()}),"removeExistingElements"),ru=we((async function(t,e,i){var r,s,n,a,o,l;$d();const c=Vd(e);e=c.code;const h=yi();ve.debug(h),e.length>((null==h?void 0:h.maxTextSize)??5e4)&&(e="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa");const d="#"+t,u="i"+t,p="#"+u,g="d"+t,y="#"+g,f=we((()=>{const t=K(x?p:y).node();t&&"remove"in t&&t.remove()}),"removeTempElements");let m=K("body");const x="sandbox"===h.securityLevel,b="loose"===h.securityLevel,k=h.fontFamily;if(void 0!==i){if(i&&(i.innerHTML=""),x){const t=eu(K(i),u);m=K(t.nodes()[0].contentDocument.body),m.node().style.margin=0}else m=K(i);tu(m,t,g,`font-family: ${k}`,"http://www.w3.org/1999/xlink")}else{if(iu(document,t,g,u),x){const t=eu(K("body"),u);m=K(t.nodes()[0].contentDocument.body),m.node().style.margin=0}else m=K("body");tu(m,t,g)}let C,S;try{C=await Nd.fromText(e,{title:c.title})}catch($){if(h.suppressErrorRendering)throw f(),$;C=await Nd.fromText("error"),S=$}const w=m.select(y).node(),T=C.type,_=w.firstChild,v=_.firstChild,E=null==(s=(r=C.renderer).getClasses)?void 0:s.call(r,e,C),A=Qd(h,T,E,d),L=document.createElement("style");L.innerHTML=A,_.insertBefore(L,v);try{await C.renderer.draw(e,t,Bh,C)}catch(D){throw h.suppressErrorRendering?f():hd.draw(e,t,Bh),D}au(T,m.select(`${y} svg`),null==(a=(n=C.db).getAccTitle)?void 0:a.call(n),null==(l=(o=C.db).getAccDescription)?void 0:l.call(o)),m.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns","http://www.w3.org/1999/xhtml");let B=m.select(y).node().innerHTML;if(ve.debug("config.arrowMarkerAbsolute",h.arrowMarkerAbsolute),B=Zd(B,x,Oi(h.arrowMarkerAbsolute)),x){const t=m.select(y+" svg").node();B=Jd(B,t)}else b||(B=W.sanitize(B,{ADD_TAGS:Ud,ADD_ATTR:Hd,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(Md(),S)throw S;return f(),{diagramType:T,svg:B,bindFunctions:C.db.bindFunctions}}),"render");function su(t={}){var e;const i=Re({},t);(null==i?void 0:i.fontFamily)&&!(null==(e=i.themeVariables)?void 0:e.fontFamily)&&(i.themeVariables||(i.themeVariables={}),i.themeVariables.fontFamily=i.fontFamily),di(i),(null==i?void 0:i.theme)&&i.theme in Qe?i.themeVariables=Qe[i.theme].getThemeVariables(i.themeVariables):i&&(i.themeVariables=Qe.default.getThemeVariables(i.themeVariables));const r="object"==typeof i?hi(i):pi();Ee(r.logLevel),$d()}we(su,"initialize");var nu=we(((t,e={})=>{const{code:i}=jd(t);return Nd.fromText(i,e)}),"getDiagramFromText");function au(t,e,i,r){Id(e,t),Fd(e,i,r,e.attr("id"))}we(au,"addA11yInfo");var ou=Object.freeze({render:ru,parse:Xd,getDiagramFromText:nu,initialize:su,getConfig:yi,setConfig:gi,getSiteConfig:pi,updateSiteConfig:ui,reset:we((()=>{xi()}),"reset"),globalReset:we((()=>{xi(ni)}),"globalReset"),defaultConfig:ni});Ee(yi().logLevel),xi(yi());var lu=we(((t,e,i)=>{ve.warn(t),po(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}))}),"handleError"),cu=we((async function(t={querySelector:".mermaid"}){try{await hu(t)}catch(e){if(po(e)&&ve.error(e.str),Cu.parseError&&Cu.parseError(e),!t.suppressErrors)throw ve.error("Use the suppressErrors option to suppress these errors"),e}}),"run"),hu=we((async function({postRenderCallback:t,querySelector:e,nodes:i}={querySelector:".mermaid"}){const r=ou.getConfig();let s;if(ve.debug((t?"":"No ")+"Callback function found"),i)s=i;else{if(!e)throw new Error("Nodes and querySelector are both undefined");s=document.querySelectorAll(e)}ve.debug(`Found ${s.length} diagrams`),void 0!==(null==r?void 0:r.startOnLoad)&&(ve.debug("Start On Load: "+(null==r?void 0:r.startOnLoad)),ou.updateSiteConfig({startOnLoad:null==r?void 0:r.startOnLoad}));const n=new mo.InitIDGenerator(r.deterministicIds,r.deterministicIDSeed);let a;const o=[];for(const c of Array.from(s)){if(ve.info("Rendering diagram: "+c.id),c.getAttribute("data-processed"))continue;c.setAttribute("data-processed","true");const e=`mermaid-${n.next()}`;a=c.innerHTML,a=z(mo.entityDecode(a)).trim().replace(//gi,"
");const i=mo.detectInit(a);i&&ve.debug("Detected early reinit: ",i);try{const{svg:i,bindFunctions:r}=await ku(e,a,c);c.innerHTML=i,t&&await t(e),r&&r(c)}catch(l){lu(l,o,Cu.parseError)}}if(o.length>0)throw o[0]}),"runThrowsErrors"),du=we((function(t){ou.initialize(t)}),"initialize"),uu=we((async function(t,e,i){ve.warn("mermaid.init is deprecated. Please use run instead."),t&&du(t);const r={postRenderCallback:i,querySelector:".mermaid"};"string"==typeof e?r.querySelector=e:e&&(e instanceof HTMLElement?r.nodes=[e]:r.nodes=e),await cu(r)}),"init"),pu=we((async(t,{lazyLoad:e=!0}={})=>{$d(),Fe(...t),!1===e&&await Dd()}),"registerExternalDiagrams"),gu=we((function(){if(Cu.startOnLoad){const{startOnLoad:t}=ou.getConfig();t&&Cu.run().catch((t=>ve.error("Mermaid failed to initialize",t)))}}),"contentLoaded");"undefined"!=typeof document&&window.addEventListener("load",gu,!1);var yu=we((function(t){Cu.parseError=t}),"setParseErrorHandler"),fu=[],mu=!1,xu=we((async()=>{if(!mu){for(mu=!0;fu.length>0;){const e=fu.shift();if(e)try{await e()}catch(t){ve.error("Error executing queue",t)}}mu=!1}}),"executeQueue"),bu=we((async(t,e)=>new Promise(((i,r)=>{const s=we((()=>new Promise(((s,n)=>{ou.parse(t,e).then((t=>{s(t),i(t)}),(t=>{var e;ve.error("Error parsing",t),null==(e=Cu.parseError)||e.call(Cu,t),n(t),r(t)}))}))),"performCall");fu.push(s),xu().catch(r)}))),"parse"),ku=we(((t,e,i)=>new Promise(((r,s)=>{const n=we((()=>new Promise(((n,a)=>{ou.render(t,e,i).then((t=>{n(t),r(t)}),(t=>{var e;ve.error("Error parsing",t),null==(e=Cu.parseError)||e.call(Cu,t),a(t),s(t)}))}))),"performCall");fu.push(n),xu().catch(s)}))),"render"),Cu={startOnLoad:!0,mermaidAPI:ou,parse:bu,render:ku,init:uu,run:cu,registerExternalDiagrams:pu,registerLayoutLoaders:Eh,initialize:du,parseError:void 0,contentLoaded:gu,setParseErrorHandler:yu,detectType:Ie,registerIconPacks:Da},Su=Cu,wu=new Map,Tu=new Map,_u=new Map,vu=we((()=>{Tu.clear(),_u.clear(),wu.clear()}),"clear"),Eu=we(((t,e)=>{const i=Tu.get(e)||[];return ve.trace("In isDescendant",e," ",t," = ",i.includes(t)),i.includes(t)}),"isDescendant"),Au=we(((t,e)=>{const i=Tu.get(e)||[];return ve.info("Descendants of ",e," is ",i),ve.info("Edge is ",t),t.v!==e&&t.w!==e&&(i?i.includes(t.v)||Eu(t.v,e)||Eu(t.w,e)||i.includes(t.w):(ve.debug("Tilt, ",e,",not in descendants"),!1))}),"edgeInCluster"),Lu=we(((t,e,i,r)=>{ve.warn("Copying children of ",t,"root",r,"data",e.node(t),r);const s=e.children(t)||[];t!==r&&s.push(t),ve.warn("Copying (nodes) clusterId",t,"nodes",s),s.forEach((s=>{if(e.children(s).length>0)Lu(s,e,i,r);else{const n=e.node(s);ve.info("cp ",s," to ",r," with parent ",t),i.setNode(s,n),r!==e.parent(s)&&(ve.warn("Setting parent",s,e.parent(s)),i.setParent(s,e.parent(s))),t!==r&&s!==t?(ve.debug("Setting parent",s,t),i.setParent(s,t)):(ve.info("In copy ",t,"root",r,"data",e.node(t),r),ve.debug("Not Setting parent for node=",s,"cluster!==rootId",t!==r,"node!==clusterId",s!==t));const a=e.edges(s);ve.debug("Copying Edges",a),a.forEach((s=>{ve.info("Edge",s);const n=e.edge(s.v,s.w,s.name);ve.info("Edge data",n,r);try{Au(s,r)?(ve.info("Copying as ",s.v,s.w,n,s.name),i.setEdge(s.v,s.w,n,s.name),ve.info("newGraph edges ",i.edges(),i.edge(i.edges()[0]))):ve.info("Skipping copy of edge ",s.v,"--\x3e",s.w," rootId: ",r," clusterId:",t)}catch(a){ve.error(a)}}))}ve.debug("Removing node",s),e.removeNode(s)}))}),"copy"),Bu=we(((t,e)=>{const i=e.children(t);let r=[...i];for(const s of i)_u.set(s,t),r=[...r,...Bu(s,e)];return r}),"extractDescendants"),$u=we(((t,e,i)=>{const r=t.edges().filter((t=>t.v===e||t.w===e)),s=t.edges().filter((t=>t.v===i||t.w===i)),n=r.map((t=>({v:t.v===e?i:t.v,w:t.w===e?e:t.w}))),a=s.map((t=>({v:t.v,w:t.w})));return n.filter((t=>a.some((e=>t.v===e.v&&t.w===e.w))))}),"findCommonEdges"),Du=we(((t,e,i)=>{const r=e.children(t);if(ve.trace("Searching children of id ",t,r),r.length<1)return t;let s;for(const n of r){const t=Du(n,e,i),r=$u(e,i,t);if(t){if(!(r.length>0))return t;s=t}}return s}),"findNonClusterChild"),Iu=we((t=>wu.has(t)&&wu.get(t).externalConnections&&wu.has(t)?wu.get(t).id:t),"getAnchorId"),Fu=we(((t,e)=>{if(!t||e>10)ve.debug("Opting out, no graph ");else{ve.debug("Opting in, graph "),t.nodes().forEach((function(e){t.children(e).length>0&&(ve.warn("Cluster identified",e," Replacement id in edges: ",Du(e,t,e)),Tu.set(e,Bu(e,t)),wu.set(e,{id:Du(e,t,e),clusterData:t.node(e)}))})),t.nodes().forEach((function(e){const i=t.children(e),r=t.edges();i.length>0?(ve.debug("Cluster identified",e,Tu),r.forEach((t=>{Eu(t.v,e)^Eu(t.w,e)&&(ve.warn("Edge: ",t," leaves cluster ",e),ve.warn("Descendants of XXX ",e,": ",Tu.get(e)),wu.get(e).externalConnections=!0)}))):ve.debug("Not a cluster ",e,Tu)}));for(let e of wu.keys()){const i=wu.get(e).id,r=t.parent(i);r!==e&&wu.has(r)&&!wu.get(r).externalConnections&&(wu.get(e).id=r)}t.edges().forEach((function(e){const i=t.edge(e);ve.warn("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),ve.warn("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(t.edge(e)));let r=e.v,s=e.w;if(ve.warn("Fix XXX",wu,"ids:",e.v,e.w,"Translating: ",wu.get(e.v)," --- ",wu.get(e.w)),wu.get(e.v)||wu.get(e.w)){if(ve.warn("Fixing and trying - removing XXX",e.v,e.w,e.name),r=Iu(e.v),s=Iu(e.w),t.removeEdge(e.v,e.w,e.name),r!==e.v){const s=t.parent(r);wu.get(s).externalConnections=!0,i.fromCluster=e.v}if(s!==e.w){const r=t.parent(s);wu.get(r).externalConnections=!0,i.toCluster=e.w}ve.warn("Fix Replacing with XXX",r,s,e.name),t.setEdge(r,s,i,e.name)}})),ve.warn("Adjusted Graph",Z(t)),Nu(t,0),ve.trace(wu)}}),"adjustClustersAndEdges"),Nu=we(((t,e)=>{var i,r;if(ve.warn("extractor - ",e,Z(t),t.children("D")),e>10)return void ve.error("Bailing out");let s=t.nodes(),n=!1;for(const a of s){const e=t.children(a);n=n||e.length>0}if(n){ve.debug("Nodes = ",s,e);for(const n of s)if(ve.debug("Extracting node",n,wu,wu.has(n)&&!wu.get(n).externalConnections,!t.parent(n),t.node(n),t.children("D")," Depth ",e),wu.has(n))if(!wu.get(n).externalConnections&&t.children(n)&&t.children(n).length>0){ve.warn("Cluster without external connections, without a parent and with children",n,e);let s="TB"===t.graph().rankdir?"LR":"TB";(null==(r=null==(i=wu.get(n))?void 0:i.clusterData)?void 0:r.dir)&&(s=wu.get(n).clusterData.dir,ve.warn("Fixing dir",wu.get(n).clusterData.dir,s));const a=new Q({multigraph:!0,compound:!0}).setGraph({rankdir:s,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}}));ve.warn("Old graph before copy",Z(t)),Lu(n,t,a,n),t.setNode(n,{clusterNode:!0,id:n,clusterData:wu.get(n).clusterData,label:wu.get(n).label,graph:a}),ve.warn("New graph after copy node: (",n,")",Z(a)),ve.debug("Old graph after copy",Z(t))}else ve.warn("Cluster ** ",n," **not meeting the criteria !externalConnections:",!wu.get(n).externalConnections," no parent: ",!t.parent(n)," children ",t.children(n)&&t.children(n).length>0,t.children("D"),e),ve.debug(wu);else ve.debug("Not a cluster",n,e);s=t.nodes(),ve.warn("New list of nodes",s);for(const i of s){const r=t.node(i);ve.warn(" Now next level",i,r),(null==r?void 0:r.clusterNode)&&Nu(r.graph,e+1)}}else ve.debug("Done, no node has children",t.nodes())}),"extractor"),Ou=we(((t,e)=>{if(0===e.length)return[];let i=Object.assign([],e);return e.forEach((e=>{const r=t.children(e),s=Ou(t,r);i=[...i,...s]})),i}),"sorter"),Mu=we((t=>Ou(t,t.children())),"sortNodesByHierarchy"),Ru=we((async(t,e,i,r,s,n)=>{ve.warn("Graph in recursive render:XAX",Z(e),s);const a=e.graph().rankdir;ve.trace("Dir in recursive render - dir:",a);const o=t.insert("g").attr("class","root");e.nodes()?ve.info("Recursive render XXX",e.nodes()):ve.info("No nodes found for",e),e.edges().length>0&&ve.info("Recursive edges",e.edge(e.edges()[0]));const l=o.insert("g").attr("class","clusters"),c=o.insert("g").attr("class","edgePaths"),h=o.insert("g").attr("class","edgeLabels"),d=o.insert("g").attr("class","nodes");await Promise.all(e.nodes().map((async function(t){const o=e.node(t);if(void 0!==s){const i=JSON.parse(JSON.stringify(s.clusterData));ve.trace("Setting data for parent cluster XXX\n Node.id = ",t,"\n data=",i.height,"\nParent cluster",s.height),e.setNode(s.id,i),e.parent(t)||(ve.trace("Setting parent",t,s.id),e.setParent(t,s.id,i))}if(ve.info("(Insert) Node XXX"+t+": "+JSON.stringify(e.node(t))),null==o?void 0:o.clusterNode){ve.info("Cluster identified XBX",t,o.width,e.node(t));const{ranksep:s,nodesep:a}=e.graph();o.graph.setGraph({...o.graph.graph(),ranksep:s+25,nodesep:a});const l=await Ru(d,o.graph,i,r,e.node(t),n),c=l.elem;zo(o,c),o.diff=l.diff||0,ve.info("New compound node after recursive render XAX",t,"width", +// node, +o.width,"height",o.height),ih(c,o)}else e.children(t).length>0?(ve.trace("Cluster - the non recursive path XBX",t,o.id,o,o.width,"Graph:",e),ve.trace(Du(o.id,e)),wu.set(o.id,{id:Du(o.id,e),node:o})):(ve.trace("Node - the non recursive path XAX",t,d,e.node(t),a),await eh(d,e.node(t),{config:n,dir:a}))})));const u=we((async()=>{const t=e.edges().map((async function(t){const i=e.edge(t.v,t.w,t.name);ve.info("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),ve.info("Edge "+t.v+" -> "+t.w+": ",t," ",JSON.stringify(e.edge(t))),ve.info("Fix",wu,"ids:",t.v,t.w,"Translating: ",wu.get(t.v),wu.get(t.w)),await uh(h,i)}));await Promise.all(t)}),"processEdges");await u(),ve.info("Graph before layout:",JSON.stringify(Z(e))),ve.info("############################################# XXX"),ve.info("### Layout ### XXX"),ve.info("############################################# XXX"),J(e),ve.info("Graph after layout:",JSON.stringify(Z(e)));let p=0,{subGraphTitleTotalMargin:g}=Aa(n);return await Promise.all(Mu(e).map((async function(t){var i;const r=e.node(t);if(ve.info("Position XBX => "+t+": ("+r.x,","+r.y,") width: ",r.width," height: ",r.height),null==r?void 0:r.clusterNode)r.y+=g,ve.info("A tainted cluster node XBX1",t,r.id,r.width,r.height,r.x,r.y,e.parent(t)),wu.get(r.id).node=r,sh(r);else if(e.children(t).length>0){ve.info("A pure cluster node XBX1",t,r.id,r.x,r.y,r.width,r.height,e.parent(t)),r.height+=g,e.node(r.parentId);const s=(null==r?void 0:r.padding)/2||0,n=(null==(i=null==r?void 0:r.labelBBox)?void 0:i.height)||0,a=n-s||0;ve.debug("OffsetY",a,"labelHeight",n,"halfPadding",s),await cl(l,r),wu.get(r.id).node=r}else{const t=e.node(r.parentId);r.y+=g/2,ve.info("A regular node XBX1 - using the padding",r.id,"parent",r.parentId,r.width,r.height,r.x,r.y,"offsetY",r.offsetY,"parent",t,null==t?void 0:t.offsetY,r),sh(r)}}))),e.edges().forEach((function(t){const s=e.edge(t);ve.info("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(s),s),s.points.forEach((t=>t.y+=g/2));const n=e.node(t.v);var a=e.node(t.w);const o=Ch(c,s,wu,i,n,a,r);gh(s,o)})),e.nodes().forEach((function(t){const i=e.node(t);ve.info(t,i.type,i.diff),i.isGroup&&(p=i.diff)})),ve.warn("Returning from recursive render XAX",o,p),{elem:o,diff:p}}),"recursiveRender"),Pu=we((async(t,e)=>{var i,r,s,n,a,o;const l=new Q({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:(null==(i=t.config)?void 0:i.nodeSpacing)||(null==(s=null==(r=t.config)?void 0:r.flowchart)?void 0:s.nodeSpacing)||t.nodeSpacing,ranksep:(null==(n=t.config)?void 0:n.rankSpacing)||(null==(o=null==(a=t.config)?void 0:a.flowchart)?void 0:o.rankSpacing)||t.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}})),c=e.select("g");Th(c,t.markers,t.type,t.diagramId),rh(),hh(),hl(),vu(),t.nodes.forEach((t=>{l.setNode(t.id,{...t}),t.parentId&&l.setParent(t.id,t.parentId)})),ve.debug("Edges:",t.edges),t.edges.forEach((t=>{if(t.start===t.end){const e=t.start,i=e+"---"+e+"---1",r=e+"---"+e+"---2",s=l.node(e);l.setNode(i,{domId:i,id:i,parentId:s.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect", +// shape: 'rect', +style:"",width:10,height:10}),l.setParent(i,s.parentId),l.setNode(r,{domId:r,id:r,parentId:s.parentId,labelStyle:"",padding:0, +// shape: 'rect', +shape:"labelRect",label:"",style:"",width:10,height:10}),l.setParent(r,s.parentId);const n=structuredClone(t),a=structuredClone(t),o=structuredClone(t);n.label="",n.arrowTypeEnd="none",n.id=e+"-cyclic-special-1",a.arrowTypeStart="none",a.arrowTypeEnd="none",a.id=e+"-cyclic-special-mid",o.label="",s.isGroup&&(n.fromCluster=e,o.toCluster=e),o.id=e+"-cyclic-special-2",o.arrowTypeStart="none",l.setEdge(e,i,n,e+"-cyclic-special-0"),l.setEdge(i,r,a,e+"-cyclic-special-1"),l.setEdge(r,e,o,e+"-cyc{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),e.name&&i.attr("name",e.name),e.rx&&i.attr("rx",e.rx),e.ry&&i.attr("ry",e.ry),void 0!==e.attrs)for(const r in e.attrs)i.attr(r,e.attrs[r]);return e.class&&i.attr("class",e.class),i}),"drawRect"),Wu=we(((t,e)=>{const i={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};zu(t,i).lower()}),"drawBackgroundRect"),ju=we(((t,e)=>{const i=e.text.replace(wi," "),r=t.append("text");r.attr("x",e.x),r.attr("y",e.y),r.attr("class","legend"),r.style("text-anchor",e.anchor),e.class&&r.attr("class",e.class);const s=r.append("tspan");return s.attr("x",e.x+2*e.textMargin),s.text(i),r}),"drawText"),Yu=we(((t,e,i,r)=>{const s=t.append("image");s.attr("x",e),s.attr("y",i);const n=tt.sanitizeUrl(r);s.attr("xlink:href",n)}),"drawImage"),Uu=we(((t,e,i,r)=>{const s=t.append("use");s.attr("x",e),s.attr("y",i);const n=tt.sanitizeUrl(r);s.attr("xlink:href",`#${n}`)}),"drawEmbeddedImage"),Hu=we((()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0})),"getNoteRect"),Vu=we((()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0})),"getTextObj"),Xu=function(){var t=we((function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i}),"o"),e=[1,24],i=[1,25],r=[1,26],s=[1,27],n=[1,28],a=[1,63],o=[1,64],l=[1,65],h=[1,66],d=[1,67],u=[1,68],p=[1,69],g=[1,29],y=[1,30],f=[1,31],m=[1,32],x=[1,33],b=[1,34],k=[1,35],C=[1,36],S=[1,37],w=[1,38],T=[1,39],_=[1,40],v=[1,41],E=[1,42],A=[1,43],L=[1,44],B=[1,45],$=[1,46],D=[1,47],I=[1,48],F=[1,50],N=[1,51],O=[1,52],M=[1,53],R=[1,54],P=[1,55],q=[1,56],z=[1,57],W=[1,58],j=[1,59],Y=[1,60],U=[14,42],H=[14,34,36,37,38,39,40,41,42,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,70,71,72,73,74],V=[12,14,34,36,37,38,39,40,41,42,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,70,71,72,73,74],X=[1,82],G=[1,83],K=[1,84],Q=[1,85],Z=[12,14,42],J=[12,14,33,42],tt=[12,14,33,42,76,77,79,80],et=[12,33],it=[34,36,37,38,39,40,41,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,70,71,72,73,74],rt={trace:we((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:we((function(t,e,i,r,s,n,a){var o=n.length-1;switch(s){case 3:r.setDirection("TB");break;case 4:r.setDirection("BT");break;case 5:r.setDirection("RL");break;case 6:r.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:r.setC4Type(n[o-3]);break;case 19:r.setTitle(n[o].substring(6)),this.$=n[o].substring(6);break;case 20:r.setAccDescription(n[o].substring(15)),this.$=n[o].substring(15);break;case 21:this.$=n[o].trim(),r.setTitle(this.$);break;case 22:case 23:this.$=n[o].trim(),r.setAccDescription(this.$);break;case 28:n[o].splice(2,0,"ENTERPRISE"),r.addPersonOrSystemBoundary(...n[o]),this.$=n[o];break;case 29:n[o].splice(2,0,"SYSTEM"),r.addPersonOrSystemBoundary(...n[o]),this.$=n[o];break;case 30:r.addPersonOrSystemBoundary(...n[o]),this.$=n[o];break;case 31:n[o].splice(2,0,"CONTAINER"),r.addContainerBoundary(...n[o]),this.$=n[o];break;case 32:r.addDeploymentNode("node",...n[o]),this.$=n[o];break;case 33:r.addDeploymentNode("nodeL",...n[o]),this.$=n[o];break;case 34:r.addDeploymentNode("nodeR",...n[o]),this.$=n[o];break;case 35:r.popBoundaryParseStack();break;case 39:r.addPersonOrSystem("person",...n[o]),this.$=n[o];break;case 40:r.addPersonOrSystem("external_person",...n[o]),this.$=n[o];break;case 41:r.addPersonOrSystem("system",...n[o]),this.$=n[o];break;case 42:r.addPersonOrSystem("system_db",...n[o]),this.$=n[o];break;case 43:r.addPersonOrSystem("system_queue",...n[o]),this.$=n[o];break;case 44:r.addPersonOrSystem("external_system",...n[o]),this.$=n[o];break;case 45:r.addPersonOrSystem("external_system_db",...n[o]),this.$=n[o];break;case 46:r.addPersonOrSystem("external_system_queue",...n[o]),this.$=n[o];break;case 47:r.addContainer("container",...n[o]),this.$=n[o];break;case 48:r.addContainer("container_db",...n[o]),this.$=n[o];break;case 49:r.addContainer("container_queue",...n[o]),this.$=n[o];break;case 50:r.addContainer("external_container",...n[o]),this.$=n[o];break;case 51:r.addContainer("external_container_db",...n[o]),this.$=n[o];break;case 52:r.addContainer("external_container_queue",...n[o]),this.$=n[o];break;case 53:r.addComponent("component",...n[o]),this.$=n[o];break;case 54:r.addComponent("component_db",...n[o]),this.$=n[o];break;case 55:r.addComponent("component_queue",...n[o]),this.$=n[o];break;case 56:r.addComponent("external_component",...n[o]),this.$=n[o];break;case 57:r.addComponent("external_component_db",...n[o]),this.$=n[o];break;case 58:r.addComponent("external_component_queue",...n[o]),this.$=n[o];break;case 60:r.addRel("rel",...n[o]),this.$=n[o];break;case 61:r.addRel("birel",...n[o]),this.$=n[o];break;case 62:r.addRel("rel_u",...n[o]),this.$=n[o];break;case 63:r.addRel("rel_d",...n[o]),this.$=n[o];break;case 64:r.addRel("rel_l",...n[o]),this.$=n[o];break;case 65:r.addRel("rel_r",...n[o]),this.$=n[o];break;case 66:r.addRel("rel_b",...n[o]),this.$=n[o];break;case 67:n[o].splice(0,1),r.addRel("rel",...n[o]),this.$=n[o];break;case 68:r.updateElStyle("update_el_style",...n[o]),this.$=n[o];break;case 69:r.updateRelStyle("update_rel_style",...n[o]),this.$=n[o];break;case 70:r.updateLayoutConfig("update_layout_config",...n[o]),this.$=n[o];break;case 71:this.$=[n[o]];break;case 72:n[o].unshift(n[o-1]),this.$=n[o];break;case 73:case 75:this.$=n[o].trim();break;case 74:let t={};t[n[o-1].trim()]=n[o].trim(),this.$=t;break;case 76:this.$=""}}),"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:i,24:r,26:s,28:n,29:49,30:61,32:62,34:a,36:o,37:l,38:h,39:d,40:u,41:p,43:23,44:g,45:y,46:f,47:m,48:x,49:b,50:k,51:C,52:S,53:w,54:T,55:_,56:v,57:E,58:A,59:L,60:B,61:$,62:D,63:I,64:F,65:N,66:O,67:M,68:R,69:P,70:q,71:z,72:W,73:j,74:Y},{13:70,19:20,20:21,21:22,22:e,23:i,24:r,26:s,28:n,29:49,30:61,32:62,34:a,36:o,37:l,38:h,39:d,40:u,41:p,43:23,44:g,45:y,46:f,47:m,48:x,49:b,50:k,51:C,52:S,53:w,54:T,55:_,56:v,57:E,58:A,59:L,60:B,61:$,62:D,63:I,64:F,65:N,66:O,67:M,68:R,69:P,70:q,71:z,72:W,73:j,74:Y},{13:71,19:20,20:21,21:22,22:e,23:i,24:r,26:s,28:n,29:49,30:61,32:62,34:a,36:o,37:l,38:h,39:d,40:u,41:p,43:23,44:g,45:y,46:f,47:m,48:x,49:b,50:k,51:C,52:S,53:w,54:T,55:_,56:v,57:E,58:A,59:L,60:B,61:$,62:D,63:I,64:F,65:N,66:O,67:M,68:R,69:P,70:q,71:z,72:W,73:j,74:Y},{13:72,19:20,20:21,21:22,22:e,23:i,24:r,26:s,28:n,29:49,30:61,32:62,34:a,36:o,37:l,38:h,39:d,40:u,41:p,43:23,44:g,45:y,46:f,47:m,48:x,49:b,50:k,51:C,52:S,53:w,54:T,55:_,56:v,57:E,58:A,59:L,60:B,61:$,62:D,63:I,64:F,65:N,66:O,67:M,68:R,69:P,70:q,71:z,72:W,73:j,74:Y},{13:73,19:20,20:21,21:22,22:e,23:i,24:r,26:s,28:n,29:49,30:61,32:62,34:a,36:o,37:l,38:h,39:d,40:u,41:p,43:23,44:g,45:y,46:f,47:m,48:x,49:b,50:k,51:C,52:S,53:w,54:T,55:_,56:v,57:E,58:A,59:L,60:B,61:$,62:D,63:I,64:F,65:N,66:O,67:M,68:R,69:P,70:q,71:z,72:W,73:j,74:Y},{14:[1,74]},t(U,[2,13],{43:23,29:49,30:61,32:62,20:75,34:a,36:o,37:l,38:h,39:d,40:u,41:p,44:g,45:y,46:f,47:m,48:x,49:b,50:k,51:C,52:S,53:w,54:T,55:_,56:v,57:E,58:A,59:L,60:B,61:$,62:D,63:I,64:F,65:N,66:O,67:M,68:R,69:P,70:q,71:z,72:W,73:j,74:Y}),t(U,[2,14]),t(H,[2,16],{12:[1,76]}),t(U,[2,36],{12:[1,77]}),t(V,[2,19]),t(V,[2,20]),{25:[1,78]},{27:[1,79]},t(V,[2,23]),{35:80,75:81,76:X,77:G,79:K,80:Q},{35:86,75:81,76:X,77:G,79:K,80:Q},{35:87,75:81,76:X,77:G,79:K,80:Q},{35:88,75:81,76:X,77:G,79:K,80:Q},{35:89,75:81,76:X,77:G,79:K,80:Q},{35:90,75:81,76:X,77:G,79:K,80:Q},{35:91,75:81,76:X,77:G,79:K,80:Q},{35:92,75:81,76:X,77:G,79:K,80:Q},{35:93,75:81,76:X,77:G,79:K,80:Q},{35:94,75:81,76:X,77:G,79:K,80:Q},{35:95,75:81,76:X,77:G,79:K,80:Q},{35:96,75:81,76:X,77:G,79:K,80:Q},{35:97,75:81,76:X,77:G,79:K,80:Q},{35:98,75:81,76:X,77:G,79:K,80:Q},{35:99,75:81,76:X,77:G,79:K,80:Q},{35:100,75:81,76:X,77:G,79:K,80:Q},{35:101,75:81,76:X,77:G,79:K,80:Q},{35:102,75:81,76:X,77:G,79:K,80:Q},{35:103,75:81,76:X,77:G,79:K,80:Q},{35:104,75:81,76:X,77:G,79:K,80:Q},t(Z,[2,59]),{35:105,75:81,76:X,77:G,79:K,80:Q},{35:106,75:81,76:X,77:G,79:K,80:Q},{35:107,75:81,76:X,77:G,79:K,80:Q},{35:108,75:81,76:X,77:G,79:K,80:Q},{35:109,75:81,76:X,77:G,79:K,80:Q},{35:110,75:81,76:X,77:G,79:K,80:Q},{35:111,75:81,76:X,77:G,79:K,80:Q},{35:112,75:81,76:X,77:G,79:K,80:Q},{35:113,75:81,76:X,77:G,79:K,80:Q},{35:114,75:81,76:X,77:G,79:K,80:Q},{35:115,75:81,76:X,77:G,79:K,80:Q},{20:116,29:49,30:61,32:62,34:a,36:o,37:l,38:h,39:d,40:u,41:p,43:23,44:g,45:y,46:f,47:m,48:x,49:b,50:k,51:C,52:S,53:w,54:T,55:_,56:v,57:E,58:A,59:L,60:B,61:$,62:D,63:I,64:F,65:N,66:O,67:M,68:R,69:P,70:q,71:z,72:W,73:j,74:Y},{12:[1,118],33:[1,117]},{35:119,75:81,76:X,77:G,79:K,80:Q},{35:120,75:81,76:X,77:G,79:K,80:Q},{35:121,75:81,76:X,77:G,79:K,80:Q},{35:122,75:81,76:X,77:G,79:K,80:Q},{35:123,75:81,76:X,77:G,79:K,80:Q},{35:124,75:81,76:X,77:G,79:K,80:Q},{35:125,75:81,76:X,77:G,79:K,80:Q},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(U,[2,15]),t(H,[2,17],{21:22,19:130,22:e,23:i,24:r,26:s,28:n}),t(U,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:i,24:r,26:s,28:n,34:a,36:o,37:l,38:h,39:d,40:u,41:p,44:g,45:y,46:f,47:m,48:x,49:b,50:k,51:C,52:S,53:w,54:T,55:_,56:v,57:E,58:A,59:L,60:B,61:$,62:D,63:I,64:F,65:N,66:O,67:M,68:R,69:P,70:q,71:z,72:W,73:j,74:Y}),t(V,[2,21]),t(V,[2,22]),t(Z,[2,39]),t(J,[2,71],{75:81,35:132,76:X,77:G,79:K,80:Q}),t(tt,[2,73]),{78:[1,133]},t(tt,[2,75]),t(tt,[2,76]),t(Z,[2,40]),t(Z,[2,41]),t(Z,[2,42]),t(Z,[2,43]),t(Z,[2,44]),t(Z,[2,45]),t(Z,[2,46]),t(Z,[2,47]),t(Z,[2,48]),t(Z,[2,49]),t(Z,[2,50]),t(Z,[2,51]),t(Z,[2,52]),t(Z,[2,53]),t(Z,[2,54]),t(Z,[2,55]),t(Z,[2,56]),t(Z,[2,57]),t(Z,[2,58]),t(Z,[2,60]),t(Z,[2,61]),t(Z,[2,62]),t(Z,[2,63]),t(Z,[2,64]),t(Z,[2,65]),t(Z,[2,66]),t(Z,[2,67]),t(Z,[2,68]),t(Z,[2,69]),t(Z,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(et,[2,28]),t(et,[2,29]),t(et,[2,30]),t(et,[2,31]),t(et,[2,32]),t(et,[2,33]),t(et,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(H,[2,18]),t(U,[2,38]),t(J,[2,72]),t(tt,[2,74]),t(Z,[2,24]),t(Z,[2,35]),t(it,[2,25]),t(it,[2,26],{12:[1,138]}),t(it,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:we((function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)}),"parseError"),parse:we((function(t){var e=this,i=[0],r=[],s=[null],n=[],a=this.table,o="",l=0,c=0,h=n.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;n.push(g);var y=d.options&&d.options.ranges;function f(){var t;return"number"!=typeof(t=r.pop()||d.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,we((function(t){i.length=i.length-2*t,s.length=s.length-t,n.length=n.length-t}),"popStack"),we(f,"lex");for(var m,x,b,k,C,S,w,T,_={};;){if(x=i[i.length-1],this.defaultActions[x]?b=this.defaultActions[x]:(null==m&&(m=f()),b=a[x]&&a[x][m]),void 0===b||!b.length||!b[0]){var v="";for(C in T=[],a[x])this.terminals_[C]&&C>2&&T.push("'"+this.terminals_[C]+"'");v=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(v,{text:d.match,token:this.terminals_[m]||m,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: "+x+", token: "+m);switch(b[0]){case 1:i.push(m),s.push(d.yytext),n.push(d.yylloc),i.push(b[1]),m=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(S=this.productions_[b[1]][1],_.$=s[s.length-S],_._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},y&&(_._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(k=this.performAction.apply(_,[o,c,l,u.yy,b[1],s,n].concat(h))))return k;S&&(i=i.slice(0,-1*S*2),s=s.slice(0,-1*S),n=n.slice(0,-1*S)),i.push(this.productions_[b[1]][0]),s.push(_.$),n.push(_._$),w=a[i[i.length-2]][i[i.length-1]],i.push(w);break;case 3:return!0}}return!0}),"parse")},st=function(){return{EOF:1,parseError:we((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"), +// resets the lexer, sets new input +setInput:we((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}),"setInput"), +// consumes and returns one char from the input +input:we((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}),"input"), +// unshifts one char (or a string) into the input +unput:we((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 s=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=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"), +// When called from action, caches matched text and appends it on next action +more:we((function(){return this._more=!0,this}),"more"), +// 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:we((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})}),"reject"), +// retain first n characters of the match +less:we((function(t){this.unput(this.match.slice(t))}),"less"), +// displays already matched input, i.e. for error messages +pastInput:we((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"), +// displays upcoming input, i.e. for error messages +upcomingInput:we((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,"")}),"upcomingInput"), +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:we((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"), +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:we((function(t,e){var i,r,s;if(this.options.backtrack_lexer&&(s={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&&(s.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 n in s)this[n]=s[n];return!1}return!1}),"test_match"), +// return next match in input +next:we((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 s=this._currentRules(),n=0;ne[0].length)){if(e=i,r=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[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})}),"next"), +// return next match that has a token +lex:we((function(){var t=this.next();return t||this.lex()}),"lex"), +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:we((function(t){this.conditionStack.push(t)}),"begin"), +// pop the previously active lexer condition state off the condition stack +popState:we((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"), +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:we((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"), +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:we((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"), +// alias for begin(condition) +pushState:we((function(t){this.begin(t)}),"pushState"), +// return the number of states currently on the stack +stateStackSize:we((function(){return this.conditionStack.length}),"stateStackSize"),options:{},performAction:we((function(t,e,i,r){switch(i){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:case 73:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:case 16:case 70:break;case 14:c;break;case 15:return 12;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:case 53:return this.begin("rel_u"),66;case 54:case 55:return this.begin("rel_d"),67;case 56:case 57:return this.begin("rel_l"),68;case 58:case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:case 79:this.popState(),this.popState();break;case 69:case 71:return 80;case 72:this.begin("string");break;case 74:case 80:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}}),"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\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:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,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,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}}}();function nt(){this.yy={}}return rt.lexer=st,we(nt,"Parser"),nt.prototype=rt,rt.Parser=nt,new nt}();Xu.parser=Xu;var Gu,Ku=Xu,Qu=[],Zu=[""],Ju="global",tp="",ep=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],ip=[],rp="",sp=!1,np=4,ap=2,op=we((function(){return Gu}),"getC4Type"),lp=we((function(t){let e=Li(t,mr());Gu=e}),"setC4Type"),cp=we((function(t,e,i,r,s,n,a,o,l){if(null==t||null==e||null==i||null==r)return;let c={};const h=ip.find((t=>t.from===e&&t.to===i));if(h?c=h:ip.push(c),c.type=t,c.from=e,c.to=i,c.label={text:r},null==s)c.techn={text:""};else if("object"==typeof s){let[t,e]=Object.entries(s)[0];c[t]={text:e}}else c.techn={text:s};if(null==n)c.descr={text:""};else if("object"==typeof n){let[t,e]=Object.entries(n)[0];c[t]={text:e}}else c.descr={text:n};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=Dp()}),"addRel"),hp=we((function(t,e,i,r,s,n,a){if(null===e||null===i)return;let o={};const l=Qu.find((t=>t.alias===e));if(l&&e===l.alias?o=l:(o.alias=e,Qu.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 s){let[t,e]=Object.entries(s)[0];o[t]=e}else o.sprite=s;if("object"==typeof n){let[t,e]=Object.entries(n)[0];o[t]=e}else o.tags=n;if("object"==typeof a){let[t,e]=Object.entries(a)[0];o[t]=e}else o.link=a;o.typeC4Shape={text:t},o.parentBoundary=Ju,o.wrap=Dp()}),"addPersonOrSystem"),dp=we((function(t,e,i,r,s,n,a,o){if(null===e||null===i)return;let l={};const c=Qu.find((t=>t.alias===e));if(c&&e===c.alias?l=c:(l.alias=e,Qu.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==s)l.descr={text:""};else if("object"==typeof s){let[t,e]=Object.entries(s)[0];l[t]={text:e}}else l.descr={text:s};if("object"==typeof n){let[t,e]=Object.entries(n)[0];l[t]=e}else l.sprite=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.wrap=Dp(),l.typeC4Shape={text:t},l.parentBoundary=Ju}),"addContainer"),up=we((function(t,e,i,r,s,n,a,o){if(null===e||null===i)return;let l={};const c=Qu.find((t=>t.alias===e));if(c&&e===c.alias?l=c:(l.alias=e,Qu.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==s)l.descr={text:""};else if("object"==typeof s){let[t,e]=Object.entries(s)[0];l[t]={text:e}}else l.descr={text:s};if("object"==typeof n){let[t,e]=Object.entries(n)[0];l[t]=e}else l.sprite=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.wrap=Dp(),l.typeC4Shape={text:t},l.parentBoundary=Ju}),"addComponent"),pp=we((function(t,e,i,r,s){if(null===t||null===e)return;let n={};const a=ep.find((e=>e.alias===t));if(a&&t===a.alias?n=a:(n.alias=t,ep.push(n)),n.label=null==e?{text:""}:{text:e},null==i)n.type={text:"system"};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];n[t]={text:e}}else n.type={text:i};if("object"==typeof r){let[t,e]=Object.entries(r)[0];n[t]=e}else n.tags=r;if("object"==typeof s){let[t,e]=Object.entries(s)[0];n[t]=e}else n.link=s;n.parentBoundary=Ju,n.wrap=Dp(),tp=Ju,Ju=t,Zu.push(tp)}),"addPersonOrSystemBoundary"),gp=we((function(t,e,i,r,s){if(null===t||null===e)return;let n={};const a=ep.find((e=>e.alias===t));if(a&&t===a.alias?n=a:(n.alias=t,ep.push(n)),n.label=null==e?{text:""}:{text:e},null==i)n.type={text:"container"};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];n[t]={text:e}}else n.type={text:i};if("object"==typeof r){let[t,e]=Object.entries(r)[0];n[t]=e}else n.tags=r;if("object"==typeof s){let[t,e]=Object.entries(s)[0];n[t]=e}else n.link=s;n.parentBoundary=Ju,n.wrap=Dp(),tp=Ju,Ju=t,Zu.push(tp)}),"addContainerBoundary"),yp=we((function(t,e,i,r,s,n,a,o){if(null===e||null===i)return;let l={};const c=ep.find((t=>t.alias===e));if(c&&e===c.alias?l=c:(l.alias=e,ep.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==s)l.descr={text:""};else if("object"==typeof s){let[t,e]=Object.entries(s)[0];l[t]={text:e}}else l.descr={text: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.nodeType=t,l.parentBoundary=Ju,l.wrap=Dp(),tp=Ju,Ju=e,Zu.push(tp)}),"addDeploymentNode"),fp=we((function(){Ju=tp,Zu.pop(),tp=Zu.pop(),Zu.push(tp)}),"popBoundaryParseStack"),mp=we((function(t,e,i,r,s,n,a,o,l,c,h){let d=Qu.find((t=>t.alias===e));if(void 0!==d||(d=ep.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!=s)if("object"==typeof s){let[t,e]=Object.entries(s)[0];d[t]=e}else d.borderColor=s;if(null!=n)if("object"==typeof n){let[t,e]=Object.entries(n)[0];d[t]=e}else d.shadowing=n;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}}),"updateElStyle"),xp=we((function(t,e,i,r,s,n,a){const o=ip.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!=s)if("object"==typeof s){let[t,e]=Object.entries(s)[0];o[t]=e}else o.lineColor=s;if(null!=n)if("object"==typeof n){let[t,e]=Object.entries(n)[0];o[t]=parseInt(e)}else o.offsetX=parseInt(n);if(null!=a)if("object"==typeof a){let[t,e]=Object.entries(a)[0];o[t]=parseInt(e)}else o.offsetY=parseInt(a)}}),"updateRelStyle"),bp=we((function(t,e,i){let r=np,s=ap;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];s=parseInt(t)}else s=parseInt(i);r>=1&&(np=r),s>=1&&(ap=s)}),"updateLayoutConfig"),kp=we((function(){return np}),"getC4ShapeInRow"),Cp=we((function(){return ap}),"getC4BoundaryInRow"),Sp=we((function(){return Ju}),"getCurrentBoundaryParse"),wp=we((function(){return tp}),"getParentBoundaryParse"),Tp=we((function(t){return null==t?Qu:Qu.filter((e=>e.parentBoundary===t))}),"getC4ShapeArray"),_p=we((function(t){return Qu.find((e=>e.alias===t))}),"getC4Shape"),vp=we((function(t){return Object.keys(Tp(t))}),"getC4ShapeKeys"),Ep=we((function(t){return null==t?ep:ep.filter((e=>e.parentBoundary===t))}),"getBoundaries"),Ap=Ep,Lp=we((function(){return ip}),"getRels"),Bp=we((function(){return rp}),"getTitle"),$p=we((function(t){sp=t}),"setWrap"),Dp=we((function(){return sp}),"autoWrap"),Ip=we((function(){Qu=[],ep=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],tp="",Ju="global",Zu=[""],ip=[],Zu=[""],rp="",sp=!1,np=4,ap=2}),"clear"),Fp=we((function(t){let e=Li(t,mr());rp=e}),"setTitle"),Np={addPersonOrSystem:hp,addPersonOrSystemBoundary:pp,addContainer:dp,addContainerBoundary:gp,addComponent:up,addDeploymentNode:yp,popBoundaryParseStack:fp,addRel:cp,updateElStyle:mp,updateRelStyle:xp,updateLayoutConfig:bp,autoWrap:Dp,setWrap:$p,getC4ShapeArray:Tp,getC4Shape:_p,getC4ShapeKeys:vp,getBoundaries:Ep,getBoundarys:Ap,getCurrentBoundaryParse:Sp,getParentBoundaryParse:wp,getRels:Lp,getTitle:Bp,getC4Type:op,getC4ShapeInRow:kp,getC4BoundaryInRow:Cp,setAccTitle:cr,getAccTitle:hr,getAccDescription:ur,setAccDescription:dr,getConfig:we((()=>mr().c4),"getConfig"),clear:Ip,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:Fp,setC4Type:lp},Op=we((function(t,e){return zu(t,e)}),"drawRect"),Mp=we((function(t,e,i,r,s,n){const a=t.append("image");a.attr("width",e),a.attr("height",i),a.attr("x",r),a.attr("y",s);let o=n.startsWith("data:image/png;base64")?n:tt.sanitizeUrl(n);a.attr("xlink:href",o)}),"drawImage"),Rp=we(((t,e,i)=>{const r=t.append("g");let s=0;for(let n of e){let t=n.textColor?n.textColor:"#444444",e=n.lineColor?n.lineColor:"#444444",a=n.offsetX?parseInt(n.offsetX):0,o=n.offsetY?parseInt(n.offsetY):0,l="";if(0===s){let t=r.append("line");t.attr("x1",n.startPoint.x),t.attr("y1",n.startPoint.y),t.attr("x2",n.endPoint.x),t.attr("y2",n.endPoint.y),t.attr("stroke-width","1"),t.attr("stroke",e),t.style("fill","none"),"rel_b"!==n.type&&t.attr("marker-end","url("+l+"#arrowhead)"),"birel"!==n.type&&"rel_b"!==n.type||t.attr("marker-start","url("+l+"#arrowend)"),s=-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",n.startPoint.x).replaceAll("starty",n.startPoint.y).replaceAll("controlx",n.startPoint.x+(n.endPoint.x-n.startPoint.x)/2-(n.endPoint.x-n.startPoint.x)/4).replaceAll("controly",n.startPoint.y+(n.endPoint.y-n.startPoint.y)/2).replaceAll("stopx",n.endPoint.x).replaceAll("stopy",n.endPoint.y)),"rel_b"!==n.type&&t.attr("marker-end","url("+l+"#arrowhead)"),"birel"!==n.type&&"rel_b"!==n.type||t.attr("marker-start","url("+l+"#arrowend)")}let c=i.messageFont();Kp(i)(n.label.text,r,Math.min(n.startPoint.x,n.endPoint.x)+Math.abs(n.endPoint.x-n.startPoint.x)/2+a,Math.min(n.startPoint.y,n.endPoint.y)+Math.abs(n.endPoint.y-n.startPoint.y)/2+o,n.label.width,n.label.height,{fill:t},c),n.techn&&""!==n.techn.text&&(c=i.messageFont(),Kp(i)("["+n.techn.text+"]",r,Math.min(n.startPoint.x,n.endPoint.x)+Math.abs(n.endPoint.x-n.startPoint.x)/2+a,Math.min(n.startPoint.y,n.endPoint.y)+Math.abs(n.endPoint.y-n.startPoint.y)/2+i.messageFontSize+5+o,Math.max(n.label.width,n.techn.width),n.techn.height,{fill:t,"font-style":"italic"},c))}}),"drawRels"),Pp=we((function(t,e,i){const r=t.append("g");let s=e.bgColor?e.bgColor:"none",n=e.borderColor?e.borderColor:"#444444",a=e.fontColor?e.fontColor:"black",o={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(o={"stroke-width":1});let l={x:e.x,y:e.y,fill:s,stroke:n,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:o};Op(r,l);let c=i.boundaryFont();c.fontWeight="bold",c.fontSize=c.fontSize+2,c.fontColor=a,Kp(i)(e.label.text,r,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},c),e.type&&""!==e.type.text&&(c=i.boundaryFont(),c.fontColor=a,Kp(i)(e.type.text,r,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},c)),e.descr&&""!==e.descr.text&&(c=i.boundaryFont(),c.fontSize=c.fontSize-2,c.fontColor=a,Kp(i)(e.descr.text,r,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},c))}),"drawBoundary"),qp=we((function(t,e,i){var r;let s=e.bgColor?e.bgColor:i[e.typeC4Shape.text+"_bg_color"],n=e.borderColor?e.borderColor:i[e.typeC4Shape.text+"_border_color"],a=e.fontColor?e.fontColor:"#FFFFFF",o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(e.typeC4Shape.text){case"person":o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII="}const l=t.append("g");l.attr("class","person-man");const c=Hu();switch(e.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":c.x=e.x,c.y=e.y,c.fill=s,c.width=e.width,c.height=e.height,c.stroke=n,c.rx=2.5,c.ry=2.5,c.attrs={"stroke-width":.5},Op(l,c);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":l.append("path").attr("fill",s).attr("stroke-width","0.5").attr("stroke",n).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2).replaceAll("height",e.height)),l.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",n).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":l.append("path").attr("fill",s).attr("stroke-width","0.5").attr("stroke",n).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("width",e.width).replaceAll("half",e.height/2)),l.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",n).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",e.x+e.width).replaceAll("starty",e.y).replaceAll("half",e.height/2))}let h=Gp(i,e.typeC4Shape.text);switch(l.append("text").attr("fill",a).attr("font-family",h.fontFamily).attr("font-size",h.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",e.typeC4Shape.width).attr("x",e.x+e.width/2-e.typeC4Shape.width/2).attr("y",e.y+e.typeC4Shape.Y).text("<<"+e.typeC4Shape.text+">>"),e.typeC4Shape.text){case"person":case"external_person":Mp(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,Kp(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)?Kp(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&&Kp(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,Kp(i)(e.descr.text,l,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},d)),e.height}),"drawC4Shape"),zp=we((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")}),"insertDatabaseIcon"),Wp=we((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")}),"insertComputerIcon"),jp=we((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")}),"insertClockIcon"),Yp=we((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")}),"insertArrowHead"),Up=we((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")}),"insertArrowEnd"),Hp=we((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")}),"insertArrowFilledHead"),Vp=we((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)}),"insertDynamicNumber"),Xp=we((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")}),"insertArrowCrossHead"),Gp=we(((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]})),"getC4ShapeFont"),Kp=function(){function t(t,e,i,s,n,a,o){r(e.append("text").attr("x",i+n/2).attr("y",s+a/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,i,s,n,a,o,l){const{fontSize:c,fontFamily:h,fontWeight:d}=l,u=t.split(Xi.lineBreakRegex);for(let p=0;p=this.data.widthLimit||i>=this.data.widthLimit||this.nextData.cnt>tg)&&(e=this.nextData.startx+t.margin+ig.nextLinePaddingX,r=this.nextData.stopy+2*t.margin,this.nextData.stopx=i=e+t.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=s=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",s,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",s,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},sg(t.db.getConfig())}bumpLastMargin(t){this.data.stopx+=t,this.data.stopy+=t}},"Bounds"),h),sg=we((function(t){Re(ig,t),t.fontFamily&&(ig.personFontFamily=ig.systemFontFamily=ig.messageFontFamily=t.fontFamily),t.fontSize&&(ig.personFontSize=ig.systemFontSize=ig.messageFontSize=t.fontSize),t.fontWeight&&(ig.personFontWeight=ig.systemFontWeight=ig.messageFontWeight=t.fontWeight)}),"setConf"),ng=we(((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]})),"c4ShapeFont"),ag=we((t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight})),"boundaryFont"),og=we((t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight})),"messageFont");function lg(t,e,i,r,s){if(!e[t].width)if(i)e[t].text=so(e[t].text,s,r),e[t].textLines=e[t].text.split(Xi.lineBreakRegex).length,e[t].width=s,e[t].height=ao(e[t].text,r);else{let i=e[t].text.split(Xi.lineBreakRegex);e[t].textLines=i.length;let s=0;e[t].height=0,e[t].width=0;for(const n of i)e[t].width=Math.max(oo(n,r),e[t].width),s=ao(n,r),e[t].height=e[t].height+s}}we(lg,"calcC4ShapeTextWH");var cg=we((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=ig.c4ShapeMargin-35;let r=e.wrap&&ig.wrap,s=ag(ig);s.fontSize=s.fontSize+2,s.fontWeight="bold",lg("label",e,r,s,oo(e.label.text,s)),Qp.drawBoundary(t,e,ig)}),"drawBoundary"),hg=we((function(t,e,i,r){let s=0;for(const n of r){s=0;const r=i[n];let a=ng(ig,r.typeC4Shape.text);switch(a.fontSize=a.fontSize-2,r.typeC4Shape.width=oo("«"+r.typeC4Shape.text+"»",a),r.typeC4Shape.height=a.fontSize+2,r.typeC4Shape.Y=ig.c4ShapePadding,s=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=s,s=r.image.Y+r.image.height}r.sprite&&(r.image.width=48,r.image.height=48,r.image.Y=s,s=r.image.Y+r.image.height);let o=r.wrap&&ig.wrap,l=ig.width-2*ig.c4ShapePadding,c=ng(ig,r.typeC4Shape.text);if(c.fontSize=c.fontSize+2,c.fontWeight="bold",lg("label",r,o,c,l),r.label.Y=s+8,s=r.label.Y+r.label.height,r.type&&""!==r.type.text){r.type.text="["+r.type.text+"]",lg("type",r,o,ng(ig,r.typeC4Shape.text),l),r.type.Y=s+5,s=r.type.Y+r.type.height}else if(r.techn&&""!==r.techn.text){r.techn.text="["+r.techn.text+"]",lg("techn",r,o,ng(ig,r.techn.text),l),r.techn.Y=s+5,s=r.techn.Y+r.techn.height}let h=s,d=r.label.width;if(r.descr&&""!==r.descr.text){lg("descr",r,o,ng(ig,r.typeC4Shape.text),l),r.descr.Y=s+20,s=r.descr.Y+r.descr.height,d=Math.max(r.label.width,r.descr.width),h=s-5*r.descr.textLines}d+=ig.c4ShapePadding,r.width=Math.max(r.width||ig.width,d,ig.width),r.height=Math.max(r.height||ig.height,h,ig.height),r.margin=r.margin||ig.c4ShapeMargin,t.insert(r),Qp.drawC4Shape(e,r,ig)}t.bumpLastMargin(ig.c4ShapeMargin)}),"drawC4ShapeArray"),dg=(we(d=class{constructor(t,e){this.x=t,this.y=e}},"Point"),d),ug=we((function(t,e){let i=t.x,r=t.y,s=e.x,n=e.y,a=i+t.width/2,o=r+t.height/2,l=Math.abs(i-s),c=Math.abs(r-n),h=c/l,d=t.height/t.width,u=null;return r==n&&is?u=new dg(i,o):i==s&&rn&&(u=new dg(a,r)),i>s&&r=h?new dg(i,o+h*t.width/2):new dg(a-l/c*t.height/2,r+t.height):i=h?new dg(i+t.width,o+h*t.width/2):new dg(a+l/c*t.height/2,r+t.height):in?u=d>=h?new dg(i+t.width,o-h*t.width/2):new dg(a+t.height/2*l/c,r):i>s&&r>n&&(u=d>=h?new dg(i,o-t.width/2*h):new dg(a-t.height/2*l/c,r)),u}),"getIntersectPoint"),pg=we((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=ug(t,i);return i.x=t.x+t.width/2,i.y=t.y+t.height/2,{startPoint:r,endPoint:ug(e,i)}}),"getIntersectPoints"),gg=we((function(t,e,i,r){let s=0;for(let n of e){s+=1;let t=n.wrap&&ig.wrap,e=og(ig);"C4Dynamic"===r.db.getC4Type()&&(n.label.text=s+": "+n.label.text);let a=oo(n.label.text,e);lg("label",n,t,e,a),n.techn&&""!==n.techn.text&&(a=oo(n.techn.text,e),lg("techn",n,t,e,a)),n.descr&&""!==n.descr.text&&(a=oo(n.descr.text,e),lg("descr",n,t,e,a));let o=i(n.from),l=i(n.to),c=pg(o,l);n.startPoint=c.startPoint,n.endPoint=c.endPoint}Qp.drawRels(t,e,ig)}),"drawRels");function yg(t,e,i,r,s){let n=new rg(s);n.data.widthLimit=i.data.widthLimit/Math.min(eg,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&&ig.wrap,c=ag(ig);if(c.fontSize=c.fontSize+2,c.fontWeight="bold",lg("label",o,l,c,n.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+"]",lg("type",o,l,ag(ig),n.data.widthLimit),o.type.Y=r+5,r=o.type.Y+o.type.height}if(o.descr&&""!==o.descr.text){let t=ag(ig);t.fontSize=t.fontSize-2,lg("descr",o,l,t,n.data.widthLimit),o.descr.Y=r+20,r=o.descr.Y+o.descr.height}if(0==a||a%eg==0){let t=i.data.startx+ig.diagramMarginX,e=i.data.stopy+ig.diagramMarginY+r;n.setData(t,t,e,e)}else{let t=n.data.stopx!==n.data.startx?n.data.stopx+ig.diagramMarginX:n.data.startx,e=n.data.starty;n.setData(t,t,e,e)}n.name=o.alias;let h=s.db.getC4ShapeArray(o.alias),d=s.db.getC4ShapeKeys(o.alias);d.length>0&&hg(n,t,h,d),e=o.alias;let u=s.db.getBoundarys(e);u.length>0&&yg(t,e,n,u,s),"global"!==o.alias&&cg(t,o,n),i.data.stopy=Math.max(n.data.stopy+ig.c4ShapeMargin,i.data.stopy),i.data.stopx=Math.max(n.data.stopx+ig.c4ShapeMargin,i.data.stopx),Zp=Math.max(Zp,i.data.stopx),Jp=Math.max(Jp,i.data.stopy)}}we(yg,"drawInsideBoundary");var fg={drawPersonOrSystemArray:hg,drawBoundary:cg,setConf:sg,draw:we((function(t,e,i,r){ig=mr().c4;const s=mr().securityLevel;let n;"sandbox"===s&&(n=K("#i"+e));const a=K("sandbox"===s?n.nodes()[0].contentDocument.body:"body");let o=r.db;r.db.setWrap(ig.wrap),tg=o.getC4ShapeInRow(),eg=o.getC4BoundaryInRow(),ve.debug(`C:${JSON.stringify(ig,null,2)}`);const l="sandbox"===s?a.select(`[id="${e}"]`):K(`[id="${e}"]`);Qp.insertComputerIcon(l),Qp.insertDatabaseIcon(l),Qp.insertClockIcon(l);let c=new rg(r);c.setData(ig.diagramMarginX,ig.diagramMarginX,ig.diagramMarginY,ig.diagramMarginY),c.data.widthLimit=screen.availWidth,Zp=ig.diagramMarginX,Jp=ig.diagramMarginY;const h=r.db.getTitle();yg(l,"",c,r.db.getBoundarys(""),r),Qp.insertArrowHead(l),Qp.insertArrowEnd(l),Qp.insertArrowCrossHead(l),Qp.insertArrowFilledHead(l),gg(l,r.db.getRels(),r.db.getC4Shape,r),c.data.stopx=Zp,c.data.stopy=Jp;const d=c.data;let u=d.stopy-d.starty+2*ig.diagramMarginY;const p=d.stopx-d.startx+2*ig.diagramMarginX;h&&l.append("text").text(h).attr("x",(d.stopx-d.startx)/2-4*ig.diagramMarginX).attr("y",d.starty+ig.diagramMarginY),Qi(l,u,p,ig.useMaxWidth);const g=h?60:0;l.attr("viewBox",d.startx-ig.diagramMarginX+" -"+(ig.diagramMarginY+g)+" "+p+" "+(u+g)),ve.debug("models:",d)}),"draw")},mg={parser:Ku,db:Np,renderer:fg,styles:we((t=>`.person {\n stroke: ${t.personBorder};\n fill: ${t.personBkg};\n }\n`),"getStyles"),init:we((({c4:t,wrap:e})=>{fg.setConf(t),Np.setWrap(e)}),"init")};const xg=Object.defineProperty({__proto__:null,diagram:mg},Symbol.toStringTag,{value:"Module"});var bg=we(((t,e)=>{let i;"sandbox"===e&&(i=K("#i"+t));return K("sandbox"===e?i.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)}),"getDiagramElement"),kg=we(((t,e,i,r)=>{t.attr("class",i);const{width:s,height:n,x:a,y:o}=Cg(t,e);Qi(t,n,s,r);const l=Sg(a,o,s,n,e);t.attr("viewBox",l),ve.debug(`viewBox configured: ${l} with padding: ${e}`)}),"setupViewPortForSVG"),Cg=we(((t,e)=>{var i;const r=(null==(i=t.node())?void 0:i.getBBox())||{width:0,height:0,x:0,y:0};return{width:r.width+2*e,height:r.height+2*e,x:r.x,y:r.y}}),"calculateDimensionsWithPadding"),Sg=we(((t,e,i,r,s)=>`${t-s} ${e-s} ${i} ${r}`),"createViewBox"),wg=(we(u=class{ +// cspell:ignore funs +constructor(){this.vertexCounter=0,this.config=mr(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=cr,this.setAccDescription=dr,this.setDiagramTitle=pr,this.getAccTitle=hr,this.getAccDescription=ur,this.getDiagramTitle=gr,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(t){return Xi.sanitizeText(t,this.config)} +/** + * Function to lookup domId from id in the graph definition. + * + * @param id - id of the node + */lookUpDomId(t){for(const e of this.vertices.values())if(e.id===t)return e.domId;return t} +/** + * Function called by parser when a node definition has been found + */addVertex(t,e,i,r,s,n,a={},o){var l,c;if(!t||0===t.trim().length)return;let h;if(void 0!==o){let t;t=o.includes("\n")?o+"\n":"{\n"+o+"\n}",h=wa(t,{schema:Sa})}const d=this.edges.find((e=>e.id===t));if(d){const t=h;return void 0!==(null==t?void 0:t.animate)&&(d.animate=t.animate),void(void 0!==(null==t?void 0:t.animation)&&(d.animation=t.animation))}let u,p=this.vertices.get(t);if(void 0===p&&(p={id:t,labelType:"text",domId:"flowchart-"+t+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(t,p)),this.vertexCounter++,void 0!==e?(this.config=mr(),u=this.sanitizeText(e.text.trim()),p.labelType=e.type,u.startsWith('"')&&u.endsWith('"')&&(u=u.substring(1,u.length-1)),p.text=u):void 0===p.text&&(p.text=t),void 0!==i&&(p.type=i),null!=r&&r.forEach((t=>{p.styles.push(t)})),null!=s&&s.forEach((t=>{p.classes.push(t)})),void 0!==n&&(p.dir=n),void 0===p.props?p.props=a:void 0!==a&&Object.assign(p.props,a),void 0!==h){if(h.shape){if(h.shape!==h.shape.toLowerCase()||h.shape.includes("_"))throw new Error(`No such shape: ${h.shape}. Shape names should be lowercase.`);if(!Jc(h.shape))throw new Error(`No such shape: ${h.shape}.`);p.type=null==h?void 0:h.shape}(null==h?void 0:h.label)&&(p.text=null==h?void 0:h.label),(null==h?void 0:h.icon)&&(p.icon=null==h?void 0:h.icon,(null==(l=h.label)?void 0:l.trim())||p.text!==t||(p.text="")),(null==h?void 0:h.form)&&(p.form=null==h?void 0:h.form),(null==h?void 0:h.pos)&&(p.pos=null==h?void 0:h.pos),(null==h?void 0:h.img)&&(p.img=null==h?void 0:h.img,(null==(c=h.label)?void 0:c.trim())||p.text!==t||(p.text="")),(null==h?void 0:h.constraint)&&(p.constraint=h.constraint),h.w&&(p.assetWidth=Number(h.w)),h.h&&(p.assetHeight=Number(h.h))}} +/** + * Function called by parser when a link/edge definition has been found + * + */addSingleLink(t,e,i,r){const s={start:t,end:e,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};ve.info("abc78 Got edge...",s);const n=i.text;if(void 0!==n&&(s.text=this.sanitizeText(n.text.trim()),s.text.startsWith('"')&&s.text.endsWith('"')&&(s.text=s.text.substring(1,s.text.length-1)),s.labelType=n.type),void 0!==i&&(s.type=i.type,s.stroke=i.stroke,s.length=i.length>10?10:i.length),r&&!this.edges.some((t=>t.id===r)))s.id=r,s.isUserDefinedId=!0;else{const t=this.edges.filter((t=>t.start===s.start&&t.end===s.end));0===t.length?s.id=ko(s.start,s.end,{counter:0,prefix:"L"}):s.id=ko(s.start,s.end,{counter:t.length+1,prefix:"L"})}if(!(this.edges.length<(this.config.maxEdges??500)))throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.\n\nInitialize mermaid with maxEdges set to a higher number to allow more edges.\nYou cannot set this config via configuration inside the diagram as it is a secure config.\nYou have to call mermaid.initialize.`);ve.info("Pushing edge..."),this.edges.push(s)}isLinkData(t){return null!==t&&"object"==typeof t&&"id"in t&&"string"==typeof t.id}addLink(t,e,i){const r=this.isLinkData(i)?i.id.replace("@",""):void 0;ve.info("addLink",t,e,r);for(const s of t)for(const n of e){const a=s===t[t.length-1],o=n===e[0];a&&o?this.addSingleLink(s,n,i,r):this.addSingleLink(s,n,i,void 0)}} +/** + * Updates a link's line interpolation algorithm + */updateLinkInterpolate(t,e){t.forEach((t=>{"default"===t?this.edges.defaultInterpolate=e:this.edges[t].interpolate=e}))} +/** + * Updates a link with a style + * + */updateLink(t,e){t.forEach((t=>{var i,r,s,n,a,o;if("number"==typeof t&&t>=this.edges.length)throw new Error(`The index ${t} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);"default"===t?this.edges.defaultStyle=e:(this.edges[t].style=e,((null==(r=null==(i=this.edges[t])?void 0:i.style)?void 0:r.length)??0)>0&&!(null==(n=null==(s=this.edges[t])?void 0:s.style)?void 0:n.some((t=>null==t?void 0:t.startsWith("fill"))))&&(null==(o=null==(a=this.edges[t])?void 0:a.style)||o.push("fill:none")))}))}addClass(t,e){const i=e.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");t.split(",").forEach((t=>{let e=this.classes.get(t);void 0===e&&(e={id:t,styles:[],textStyles:[]},this.classes.set(t,e)),null!=i&&i.forEach((t=>{if(/color/.exec(t)){const i=t.replace("fill","bgFill");e.textStyles.push(i)}e.styles.push(t)}))}))} +/** + * Called by parser when a graph definition is found, stores the direction of the chart. + * + */setDirection(t){this.direction=t,/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),"TD"===this.direction&&(this.direction="TB")} +/** + * Called by parser when a special node is found, e.g. a clickable element. + * + * @param ids - Comma separated list of ids + * @param className - Class to add + */setClass(t,e){for(const i of t.split(",")){const t=this.vertices.get(i);t&&t.classes.push(e);const r=this.edges.find((t=>t.id===i));r&&r.classes.push(e);const s=this.subGraphLookup.get(i);s&&s.classes.push(e)}}setTooltip(t,e){if(void 0!==e){e=this.sanitizeText(e);for(const i of t.split(","))this.tooltips.set("gen-1"===this.version?this.lookUpDomId(i):i,e)}}setClickFun(t,e,i){const r=this.lookUpDomId(t);if("loose"!==mr().securityLevel)return;if(void 0===e)return;let s=[];if("string"==typeof i){s=i.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t{const t=document.querySelector(`[id="${r}"]`);null!==t&&t.addEventListener("click",(()=>{mo.runFunc(e,...s)}),!1)})))} +/** + * Called by parser when a link is found. Adds the URL to the vertex data. + * + * @param ids - Comma separated list of ids + * @param linkStr - URL to create a link for + * @param target - Target attribute for the link + */setLink(t,e,i){t.split(",").forEach((t=>{const r=this.vertices.get(t);void 0!==r&&(r.link=mo.formatUrl(e,this.config),r.linkTarget=i)})),this.setClass(t,"clickable")}getTooltip(t){return this.tooltips.get(t)} +/** + * Called by parser when a click definition is found. Registers an event handler. + * + * @param ids - Comma separated list of ids + * @param functionName - Function to be called on click + * @param functionArgs - Arguments to be passed to the function + */setClickEvent(t,e,i){t.split(",").forEach((t=>{this.setClickFun(t,e,i)})),this.setClass(t,"clickable")}bindFunctions(t){this.funs.forEach((e=>{e(t)}))}getDirection(){var t;return null==(t=this.direction)?void 0:t.trim()} +/** + * Retrieval function for fetching the found nodes after parsing has completed. + * + */getVertices(){return this.vertices} +/** + * Retrieval function for fetching the found links after parsing has completed. + * + */getEdges(){return this.edges} +/** + * Retrieval function for fetching the found class definitions after parsing has completed. + * + */getClasses(){return this.classes}setupToolTips(t){let e=K(".mermaidTooltip");null===(e._groups||e)[0][0]&&(e=K("body").append("div").attr("class","mermaidTooltip").style("opacity",0));K(t).select("svg").selectAll("g.node").on("mouseover",(t=>{var i;const r=K(t.currentTarget);if(null===r.attr("title"))return;const s=null==(i=t.currentTarget)?void 0:i.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.text(r.attr("title")).style("left",window.scrollX+s.left+(s.right-s.left)/2+"px").style("top",window.scrollY+s.bottom+"px"),e.html(e.html().replace(/<br\/>/g,"
")),r.classed("hover",!0)})).on("mouseout",(t=>{e.transition().duration(500).style("opacity",0);K(t.currentTarget).classed("hover",!1)}))} +/** + * Clears the internal graph db so that a new graph can be parsed. + * + */clear(t="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=t,this.config=mr(),lr()}setGen(t){this.version=t||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(t,e,i){let r=t.text.trim(),s=i.text;t===i&&/\s/.exec(i.text)&&(r=void 0);const n=we((t=>{const e={boolean:{},number:{},string:{}},i=[];let r;return{nodeList:t.filter((function(t){const s=typeof t;return t.stmt&&"dir"===t.stmt?(r=t.value,!1):""!==t.trim()&&(s in e?!e[s].hasOwnProperty(t)&&(e[s][t]=!0):!i.includes(t)&&i.push(t))})),dir:r}}),"uniq"),{nodeList:a,dir:o}=n(e.flat());if("gen-1"===this.version)for(let c=0;c2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=e,this.subGraphs[e].id===t)return{result:!0,count:0};let r=0,s=1;for(;r=0){const i=this.indexNodes2(t,e);if(i.result)return{result:!0,count:s+i.count};s+=i.count}r+=1}return{result:!1,count:s}}getDepthFirstPos(t){return this.posCrossRef[t]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return!!this.firstGraphFlag&&(this.firstGraphFlag=!1,!0)}destructStartLink(t){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}}countChar(t,e){const i=e.length;let r=0;for(let s=0;s":r="arrow_point",e.startsWith("<")&&(r="double_"+r,i=i.slice(1));break;case"o":r="arrow_circle",e.startsWith("o")&&(r="double_"+r,i=i.slice(1))}let s="normal",n=i.length-1;i.startsWith("=")&&(s="thick"),i.startsWith("~")&&(s="invisible");const a=this.countChar(".",i);return a&&(s="dotted",n=a),{type:r,stroke:s,length:n}}destructLink(t,e){const i=this.destructEndLink(t);let r;if(e){if(r=this.destructStartLink(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} +// Todo optimizer this by caching existing nodes +exists(t,e){for(const i of t)if(i.nodes.includes(e))return!0;return!1} +/** + * Deletes an id from all subgraphs + * + */makeUniq(t,e){const i=[];return t.nodes.forEach(((r,s)=>{this.exists(e,r)||i.push(t.nodes[s])})),{nodes:i}}getTypeFromVertex(t){if(t.img)return"imageSquare";if(t.icon)return"circle"===t.form?"iconCircle":"square"===t.form?"iconSquare":"rounded"===t.form?"iconRounded":"icon";switch(t.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return t.type}}findNode(t,e){return t.find((t=>t.id===e))}destructEdgeType(t){let e="none",i="arrow_point";switch(t){case"arrow_point":case"arrow_circle":case"arrow_cross":i=t;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":e=t.replace("double_",""),i=e}return{arrowTypeStart:e,arrowTypeEnd:i}}addNodeFromVertex(t,e,i,r,s,n){var a;const o=i.get(t.id),l=r.get(t.id)??!1,c=this.findNode(e,t.id);if(c)c.cssStyles=t.styles,c.cssCompiledStyles=this.getCompiledStyles(t.classes),c.cssClasses=t.classes.join(" ");else{const i={id:t.id,label:t.text,labelStyle:"",parentId:o,padding:(null==(a=s.flowchart)?void 0:a.padding)||8,cssStyles:t.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...t.classes]),cssClasses:"default "+t.classes.join(" "),dir:t.dir,domId:t.domId,look:n,link:t.link,linkTarget:t.linkTarget,tooltip:this.getTooltip(t.id),icon:t.icon,pos:t.pos,img:t.img,assetWidth:t.assetWidth,assetHeight:t.assetHeight,constraint:t.constraint};l?e.push({...i,isGroup:!0,shape:"rect"}):e.push({...i,isGroup:!1,shape:this.getTypeFromVertex(t)})}}getCompiledStyles(t){let e=[];for(const i of t){const t=this.classes.get(i);(null==t?void 0:t.styles)&&(e=[...e,...t.styles??[]].map((t=>t.trim()))),(null==t?void 0:t.textStyles)&&(e=[...e,...t.textStyles??[]].map((t=>t.trim())))}return e}getData(){const t=mr(),e=[],i=[],r=this.getSubGraphs(),s=new Map,n=new Map;for(let o=r.length-1;o>=0;o--){const t=r[o];t.nodes.length>0&&n.set(t.id,!0);for(const e of t.nodes)s.set(e,t.id)}for(let o=r.length-1;o>=0;o--){const i=r[o];e.push({id:i.id,label:i.title,labelStyle:"",parentId:s.get(i.id),padding:8,cssCompiledStyles:this.getCompiledStyles(i.classes),cssClasses:i.classes.join(" "),shape:"rect",dir:i.dir,isGroup:!0,look:t.look})}this.getVertices().forEach((i=>{this.addNodeFromVertex(i,e,s,n,t,t.look||"classic")}));const a=this.getEdges();return a.forEach(((e,r)=>{var s;const{arrowTypeStart:n,arrowTypeEnd:o}=this.destructEdgeType(e.type),l=[...a.defaultStyle??[]];e.style&&l.push(...e.style);const c={id:ko(e.start,e.end,{counter:r,prefix:"L"},e.id),isUserDefinedId:e.isUserDefinedId,start:e.start,end:e.end,type:e.type??"normal",label:e.text,labelpos:"c",thickness:e.stroke,minlen:e.length,classes:"invisible"===(null==e?void 0:e.stroke)?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:"invisible"===(null==e?void 0:e.stroke)||"arrow_open"===(null==e?void 0:e.type)?"none":n,arrowTypeEnd:"invisible"===(null==e?void 0:e.stroke)||"arrow_open"===(null==e?void 0:e.type)?"none":o,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(e.classes),labelStyle:l,style:l,pattern:e.stroke,look:t.look,animate:e.animate,animation:e.animation,curve:e.interpolate||this.edges.defaultInterpolate||(null==(s=t.flowchart)?void 0:s.curve)};i.push(c)})),{nodes:e,edges:i,other:{},config:t}}defaultConfig(){return br.flowchart}},"FlowDB"),u),Tg={getClasses:we((function(t,e){return e.db.getClasses()}),"getClasses"),draw:we((async function(t,e,i,r){var s;ve.info("REF0:"),ve.info("Drawing state diagram (v2)",e);const{securityLevel:n,flowchart:a,layout:o}=mr();let l;"sandbox"===n&&(l=K("#i"+e));const c="sandbox"===n?l.nodes()[0].contentDocument:document;ve.debug("Before getData: ");const h=r.db.getData();ve.debug("Data: ",h);const d=bg(e,n),u=r.db.getDirection();h.type=r.type,h.layoutAlgorithm=Lh(o),"dagre"===h.layoutAlgorithm&&"elk"===o&&ve.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),h.direction=u,h.nodeSpacing=(null==a?void 0:a.nodeSpacing)||50,h.rankSpacing=(null==a?void 0:a.rankSpacing)||50,h.markers=["point","circle","cross"],h.diagramId=e,ve.debug("REF1:",h),await Ah(h,d);const p=(null==(s=h.config.flowchart)?void 0:s.diagramPadding)??8;mo.insertTitle(d,"flowchartTitleText",(null==a?void 0:a.titleTopMargin)||0,r.db.getDiagramTitle()),kg(d,p,"flowchart",(null==a?void 0:a.useMaxWidth)||!1);for(const g of h.nodes){const t=K(`#${e} [id="${g.id}"]`);if(!t||!g.link)continue;const i=c.createElementNS("http://www.w3.org/2000/svg","a");i.setAttributeNS("http://www.w3.org/2000/svg","class",g.cssClasses),i.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),"sandbox"===n?i.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):g.linkTarget&&i.setAttributeNS("http://www.w3.org/2000/svg","target",g.linkTarget);const r=t.insert((function(){return i}),":first-child"),s=t.select(".label-container");s&&r.append((function(){return s.node()}));const a=t.select(".label");a&&r.append((function(){return a.node()}))}}),"draw")},_g=function(){var t=we((function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i}),"o"),e=[1,4],i=[1,3],r=[1,5],s=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],n=[2,2],a=[1,13],o=[1,14],l=[1,15],c=[1,16],h=[1,23],d=[1,25],u=[1,26],p=[1,27],g=[1,49],y=[1,48],f=[1,29],m=[1,30],x=[1,31],b=[1,32],k=[1,33],C=[1,44],S=[1,46],w=[1,42],T=[1,47],_=[1,43],v=[1,50],E=[1,45],A=[1,51],L=[1,52],B=[1,34],$=[1,35],D=[1,36],I=[1,37],F=[1,57],N=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],O=[1,61],M=[1,60],R=[1,62],P=[8,9,11,75,77,78],q=[1,78],z=[1,91],W=[1,96],j=[1,95],Y=[1,92],U=[1,88],H=[1,94],V=[1,90],X=[1,97],G=[1,93],K=[1,98],Q=[1,89],Z=[8,9,10,11,40,75,77,78],J=[8,9,10,11,40,46,75,77,78],tt=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],et=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],it=[44,60,89,102,105,106,109,111,114,115,116],rt=[1,121],st=[1,122],nt=[1,124],at=[1,123],ot=[44,60,62,74,89,102,105,106,109,111,114,115,116],lt=[1,133],ct=[1,147],ht=[1,148],dt=[1,149],ut=[1,150],pt=[1,135],gt=[1,137],yt=[1,141],ft=[1,142],mt=[1,143],xt=[1,144],bt=[1,145],kt=[1,146],Ct=[1,151],St=[1,152],wt=[1,131],Tt=[1,132],_t=[1,139],vt=[1,134],Et=[1,138],At=[1,136],Lt=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],Bt=[1,154],$t=[1,156],Dt=[8,9,11],It=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],Ft=[1,176],Nt=[1,172],Ot=[1,173],Mt=[1,177],Rt=[1,174],Pt=[1,175],qt=[77,116,119],zt=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],Wt=[10,106],jt=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],Yt=[1,247],Ut=[1,245],Ht=[1,249],Vt=[1,243],Xt=[1,244],Gt=[1,246],Kt=[1,248],Qt=[1,250],Zt=[1,268],Jt=[8,9,11,106],te=[8,9,10,11,60,84,105,106,109,110,111,112],ee={trace:we((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1]],performAction:we((function(t,e,i,r,s,n,a){var o=n.length-1;switch(s){case 2:case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 3:(!Array.isArray(n[o])||n[o].length>0)&&n[o-1].push(n[o]),this.$=n[o-1];break;case 4:case 183:case 44:case 54:case 76:case 181:this.$=n[o];break;case 11:r.setDirection("TB"),this.$="TB";break;case 12:r.setDirection(n[o-1]),this.$=n[o-1];break;case 27:this.$=n[o-1].nodes;break;case 33:this.$=r.addSubGraph(n[o-6],n[o-1],n[o-4]);break;case 34:this.$=r.addSubGraph(n[o-3],n[o-1],n[o-3]);break;case 35:this.$=r.addSubGraph(void 0,n[o-1],void 0);break;case 37:this.$=n[o].trim(),r.setAccTitle(this.$);break;case 38:case 39:this.$=n[o].trim(),r.setAccDescription(this.$);break;case 43:case 133:this.$=n[o-1]+n[o];break;case 45:r.addVertex(n[o-1][n[o-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,n[o]),r.addLink(n[o-3].stmt,n[o-1],n[o-2]),this.$={stmt:n[o-1],nodes:n[o-1].concat(n[o-3].nodes)};break;case 46:r.addLink(n[o-2].stmt,n[o],n[o-1]),this.$={stmt:n[o],nodes:n[o].concat(n[o-2].nodes)};break;case 47:r.addLink(n[o-3].stmt,n[o-1],n[o-2]),this.$={stmt:n[o-1],nodes:n[o-1].concat(n[o-3].nodes)};break;case 48:this.$={stmt:n[o-1],nodes:n[o-1]};break;case 49:r.addVertex(n[o-1][n[o-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,n[o]),this.$={stmt:n[o-1],nodes:n[o-1],shapeData:n[o]};break;case 50:this.$={stmt:n[o],nodes:n[o]};break;case 51:case 128:case 130:this.$=[n[o]];break;case 52:r.addVertex(n[o-5][n[o-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,n[o-4]),this.$=n[o-5].concat(n[o]);break;case 53:this.$=n[o-4].concat(n[o]);break;case 55:this.$=n[o-2],r.setClass(n[o-2],n[o]);break;case 56:this.$=n[o-3],r.addVertex(n[o-3],n[o-1],"square");break;case 57:this.$=n[o-3],r.addVertex(n[o-3],n[o-1],"doublecircle");break;case 58:this.$=n[o-5],r.addVertex(n[o-5],n[o-2],"circle");break;case 59:this.$=n[o-3],r.addVertex(n[o-3],n[o-1],"ellipse");break;case 60:this.$=n[o-3],r.addVertex(n[o-3],n[o-1],"stadium");break;case 61:this.$=n[o-3],r.addVertex(n[o-3],n[o-1],"subroutine");break;case 62:this.$=n[o-7],r.addVertex(n[o-7],n[o-1],"rect",void 0,void 0,void 0,Object.fromEntries([[n[o-5],n[o-3]]]));break;case 63:this.$=n[o-3],r.addVertex(n[o-3],n[o-1],"cylinder");break;case 64:this.$=n[o-3],r.addVertex(n[o-3],n[o-1],"round");break;case 65:this.$=n[o-3],r.addVertex(n[o-3],n[o-1],"diamond");break;case 66:this.$=n[o-5],r.addVertex(n[o-5],n[o-2],"hexagon");break;case 67:this.$=n[o-3],r.addVertex(n[o-3],n[o-1],"odd");break;case 68:this.$=n[o-3],r.addVertex(n[o-3],n[o-1],"trapezoid");break;case 69:this.$=n[o-3],r.addVertex(n[o-3],n[o-1],"inv_trapezoid");break;case 70:this.$=n[o-3],r.addVertex(n[o-3],n[o-1],"lean_right");break;case 71:this.$=n[o-3],r.addVertex(n[o-3],n[o-1],"lean_left");break;case 72:this.$=n[o],r.addVertex(n[o]);break;case 73:n[o-1].text=n[o],this.$=n[o-1];break;case 74:case 75:n[o-2].text=n[o-1],this.$=n[o-2];break;case 77:var l=r.destructLink(n[o],n[o-2]);this.$={type:l.type,stroke:l.stroke,length:l.length,text:n[o-1]};break;case 78:l=r.destructLink(n[o],n[o-2]);this.$={type:l.type,stroke:l.stroke,length:l.length,text:n[o-1],id:n[o-3]};break;case 79:case 86:case 101:case 103:this.$={text:n[o],type:"text"};break;case 80:case 87:case 102:this.$={text:n[o-1].text+""+n[o],type:n[o-1].type};break;case 81:case 88:this.$={text:n[o],type:"string"};break;case 82:case 89:case 104:this.$={text:n[o],type:"markdown"};break;case 83:l=r.destructLink(n[o]);this.$={type:l.type,stroke:l.stroke,length:l.length};break;case 84:l=r.destructLink(n[o]);this.$={type:l.type,stroke:l.stroke,length:l.length,id:n[o-1]};break;case 85:this.$=n[o-1];break;case 105:this.$=n[o-4],r.addClass(n[o-2],n[o]);break;case 106:this.$=n[o-4],r.setClass(n[o-2],n[o]);break;case 107:case 115:this.$=n[o-1],r.setClickEvent(n[o-1],n[o]);break;case 108:case 116:this.$=n[o-3],r.setClickEvent(n[o-3],n[o-2]),r.setTooltip(n[o-3],n[o]);break;case 109:this.$=n[o-2],r.setClickEvent(n[o-2],n[o-1],n[o]);break;case 110:this.$=n[o-4],r.setClickEvent(n[o-4],n[o-3],n[o-2]),r.setTooltip(n[o-4],n[o]);break;case 111:this.$=n[o-2],r.setLink(n[o-2],n[o]);break;case 112:this.$=n[o-4],r.setLink(n[o-4],n[o-2]),r.setTooltip(n[o-4],n[o]);break;case 113:this.$=n[o-4],r.setLink(n[o-4],n[o-2],n[o]);break;case 114:this.$=n[o-6],r.setLink(n[o-6],n[o-4],n[o]),r.setTooltip(n[o-6],n[o-2]);break;case 117:this.$=n[o-1],r.setLink(n[o-1],n[o]);break;case 118:this.$=n[o-3],r.setLink(n[o-3],n[o-2]),r.setTooltip(n[o-3],n[o]);break;case 119:this.$=n[o-3],r.setLink(n[o-3],n[o-2],n[o]);break;case 120:this.$=n[o-5],r.setLink(n[o-5],n[o-4],n[o]),r.setTooltip(n[o-5],n[o-2]);break;case 121:this.$=n[o-4],r.addVertex(n[o-2],void 0,void 0,n[o]);break;case 122:this.$=n[o-4],r.updateLink([n[o-2]],n[o]);break;case 123:this.$=n[o-4],r.updateLink(n[o-2],n[o]);break;case 124:this.$=n[o-8],r.updateLinkInterpolate([n[o-6]],n[o-2]),r.updateLink([n[o-6]],n[o]);break;case 125:this.$=n[o-8],r.updateLinkInterpolate(n[o-6],n[o-2]),r.updateLink(n[o-6],n[o]);break;case 126:this.$=n[o-6],r.updateLinkInterpolate([n[o-4]],n[o]);break;case 127:this.$=n[o-6],r.updateLinkInterpolate(n[o-4],n[o]);break;case 129:case 131:n[o-2].push(n[o]),this.$=n[o-2];break;case 182:case 184:this.$=n[o-1]+""+n[o];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"}}}),"anonymous"),table:[{3:1,4:2,9:e,10:i,12:r},{1:[3]},t(s,n,{5:6}),{4:7,9:e,10:i,12:r},{4:8,9:e,10:i,12:r},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:a,9:o,10:l,11:c,20:17,22:18,23:19,24:20,25:21,26:22,27:h,33:24,34:d,36:u,38:p,42:28,43:38,44:g,45:39,47:40,60:y,84:f,85:m,86:x,87:b,88:k,89:C,102:S,105:w,106:T,109:_,111:v,113:41,114:E,115:A,116:L,121:B,122:$,123:D,124:I},t(s,[2,9]),t(s,[2,10]),t(s,[2,11]),{8:[1,54],9:[1,55],10:F,15:53,18:56},t(N,[2,3]),t(N,[2,4]),t(N,[2,5]),t(N,[2,6]),t(N,[2,7]),t(N,[2,8]),{8:O,9:M,11:R,21:58,41:59,72:63,75:[1,64],77:[1,66],78:[1,65]},{8:O,9:M,11:R,21:67},{8:O,9:M,11:R,21:68},{8:O,9:M,11:R,21:69},{8:O,9:M,11:R,21:70},{8:O,9:M,11:R,21:71},{8:O,9:M,10:[1,72],11:R,21:73},t(N,[2,36]),{35:[1,74]},{37:[1,75]},t(N,[2,39]),t(P,[2,50],{18:76,39:77,10:F,40:q}),{10:[1,79]},{10:[1,80]},{10:[1,81]},{10:[1,82]},{14:z,44:W,60:j,80:[1,86],89:Y,95:[1,83],97:[1,84],101:85,105:U,106:H,109:V,111:X,114:G,115:K,116:Q,120:87},t(N,[2,185]),t(N,[2,186]),t(N,[2,187]),t(N,[2,188]),t(Z,[2,51]),t(Z,[2,54],{46:[1,99]}),t(J,[2,72],{113:112,29:[1,100],44:g,48:[1,101],50:[1,102],52:[1,103],54:[1,104],56:[1,105],58:[1,106],60:y,63:[1,107],65:[1,108],67:[1,109],68:[1,110],70:[1,111],89:C,102:S,105:w,106:T,109:_,111:v,114:E,115:A,116:L}),t(tt,[2,181]),t(tt,[2,142]),t(tt,[2,143]),t(tt,[2,144]),t(tt,[2,145]),t(tt,[2,146]),t(tt,[2,147]),t(tt,[2,148]),t(tt,[2,149]),t(tt,[2,150]),t(tt,[2,151]),t(tt,[2,152]),t(s,[2,12]),t(s,[2,18]),t(s,[2,19]),{9:[1,113]},t(et,[2,26],{18:114,10:F}),t(N,[2,27]),{42:115,43:38,44:g,45:39,47:40,60:y,89:C,102:S,105:w,106:T,109:_,111:v,113:41,114:E,115:A,116:L},t(N,[2,40]),t(N,[2,41]),t(N,[2,42]),t(it,[2,76],{73:116,62:[1,118],74:[1,117]}),{76:119,79:120,80:rt,81:st,116:nt,119:at},{75:[1,125],77:[1,126]},t(ot,[2,83]),t(N,[2,28]),t(N,[2,29]),t(N,[2,30]),t(N,[2,31]),t(N,[2,32]),{10:lt,12:ct,14:ht,27:dt,28:127,32:ut,44:pt,60:gt,75:yt,80:[1,129],81:[1,130],83:140,84:ft,85:mt,86:xt,87:bt,88:kt,89:Ct,90:St,91:128,105:wt,109:Tt,111:_t,114:vt,115:Et,116:At},t(Lt,n,{5:153}),t(N,[2,37]),t(N,[2,38]),t(P,[2,48],{44:Bt}),t(P,[2,49],{18:155,10:F,40:$t}),t(Z,[2,44]),{44:g,47:157,60:y,89:C,102:S,105:w,106:T,109:_,111:v,113:41,114:E,115:A,116:L},{102:[1,158],103:159,105:[1,160]},{44:g,47:161,60:y,89:C,102:S,105:w,106:T,109:_,111:v,113:41,114:E,115:A,116:L},{44:g,47:162,60:y,89:C,102:S,105:w,106:T,109:_,111:v,113:41,114:E,115:A,116:L},t(Dt,[2,107],{10:[1,163],96:[1,164]}),{80:[1,165]},t(Dt,[2,115],{120:167,10:[1,166],14:z,44:W,60:j,89:Y,105:U,106:H,109:V,111:X,114:G,115:K,116:Q}),t(Dt,[2,117],{10:[1,168]}),t(It,[2,183]),t(It,[2,170]),t(It,[2,171]),t(It,[2,172]),t(It,[2,173]),t(It,[2,174]),t(It,[2,175]),t(It,[2,176]),t(It,[2,177]),t(It,[2,178]),t(It,[2,179]),t(It,[2,180]),{44:g,47:169,60:y,89:C,102:S,105:w,106:T,109:_,111:v,113:41,114:E,115:A,116:L},{30:170,67:Ft,80:Nt,81:Ot,82:171,116:Mt,117:Rt,118:Pt},{30:178,67:Ft,80:Nt,81:Ot,82:171,116:Mt,117:Rt,118:Pt},{30:180,50:[1,179],67:Ft,80:Nt,81:Ot,82:171,116:Mt,117:Rt,118:Pt},{30:181,67:Ft,80:Nt,81:Ot,82:171,116:Mt,117:Rt,118:Pt},{30:182,67:Ft,80:Nt,81:Ot,82:171,116:Mt,117:Rt,118:Pt},{30:183,67:Ft,80:Nt,81:Ot,82:171,116:Mt,117:Rt,118:Pt},{109:[1,184]},{30:185,67:Ft,80:Nt,81:Ot,82:171,116:Mt,117:Rt,118:Pt},{30:186,65:[1,187],67:Ft,80:Nt,81:Ot,82:171,116:Mt,117:Rt,118:Pt},{30:188,67:Ft,80:Nt,81:Ot,82:171,116:Mt,117:Rt,118:Pt},{30:189,67:Ft,80:Nt,81:Ot,82:171,116:Mt,117:Rt,118:Pt},{30:190,67:Ft,80:Nt,81:Ot,82:171,116:Mt,117:Rt,118:Pt},t(tt,[2,182]),t(s,[2,20]),t(et,[2,25]),t(P,[2,46],{39:191,18:192,10:F,40:q}),t(it,[2,73],{10:[1,193]}),{10:[1,194]},{30:195,67:Ft,80:Nt,81:Ot,82:171,116:Mt,117:Rt,118:Pt},{77:[1,196],79:197,116:nt,119:at},t(qt,[2,79]),t(qt,[2,81]),t(qt,[2,82]),t(qt,[2,168]),t(qt,[2,169]),{76:198,79:120,80:rt,81:st,116:nt,119:at},t(ot,[2,84]),{8:O,9:M,10:lt,11:R,12:ct,14:ht,21:200,27:dt,29:[1,199],32:ut,44:pt,60:gt,75:yt,83:140,84:ft,85:mt,86:xt,87:bt,88:kt,89:Ct,90:St,91:201,105:wt,109:Tt,111:_t,114:vt,115:Et,116:At},t(zt,[2,101]),t(zt,[2,103]),t(zt,[2,104]),t(zt,[2,157]),t(zt,[2,158]),t(zt,[2,159]),t(zt,[2,160]),t(zt,[2,161]),t(zt,[2,162]),t(zt,[2,163]),t(zt,[2,164]),t(zt,[2,165]),t(zt,[2,166]),t(zt,[2,167]),t(zt,[2,90]),t(zt,[2,91]),t(zt,[2,92]),t(zt,[2,93]),t(zt,[2,94]),t(zt,[2,95]),t(zt,[2,96]),t(zt,[2,97]),t(zt,[2,98]),t(zt,[2,99]),t(zt,[2,100]),{6:11,7:12,8:a,9:o,10:l,11:c,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,202],33:24,34:d,36:u,38:p,42:28,43:38,44:g,45:39,47:40,60:y,84:f,85:m,86:x,87:b,88:k,89:C,102:S,105:w,106:T,109:_,111:v,113:41,114:E,115:A,116:L,121:B,122:$,123:D,124:I},{10:F,18:203},{44:[1,204]},t(Z,[2,43]),{10:[1,205],44:g,60:y,89:C,102:S,105:w,106:T,109:_,111:v,113:112,114:E,115:A,116:L},{10:[1,206]},{10:[1,207],106:[1,208]},t(Wt,[2,128]),{10:[1,209],44:g,60:y,89:C,102:S,105:w,106:T,109:_,111:v,113:112,114:E,115:A,116:L},{10:[1,210],44:g,60:y,89:C,102:S,105:w,106:T,109:_,111:v,113:112,114:E,115:A,116:L},{80:[1,211]},t(Dt,[2,109],{10:[1,212]}),t(Dt,[2,111],{10:[1,213]}),{80:[1,214]},t(It,[2,184]),{80:[1,215],98:[1,216]},t(Z,[2,55],{113:112,44:g,60:y,89:C,102:S,105:w,106:T,109:_,111:v,114:E,115:A,116:L}),{31:[1,217],67:Ft,82:218,116:Mt,117:Rt,118:Pt},t(jt,[2,86]),t(jt,[2,88]),t(jt,[2,89]),t(jt,[2,153]),t(jt,[2,154]),t(jt,[2,155]),t(jt,[2,156]),{49:[1,219],67:Ft,82:218,116:Mt,117:Rt,118:Pt},{30:220,67:Ft,80:Nt,81:Ot,82:171,116:Mt,117:Rt,118:Pt},{51:[1,221],67:Ft,82:218,116:Mt,117:Rt,118:Pt},{53:[1,222],67:Ft,82:218,116:Mt,117:Rt,118:Pt},{55:[1,223],67:Ft,82:218,116:Mt,117:Rt,118:Pt},{57:[1,224],67:Ft,82:218,116:Mt,117:Rt,118:Pt},{60:[1,225]},{64:[1,226],67:Ft,82:218,116:Mt,117:Rt,118:Pt},{66:[1,227],67:Ft,82:218,116:Mt,117:Rt,118:Pt},{30:228,67:Ft,80:Nt,81:Ot,82:171,116:Mt,117:Rt,118:Pt},{31:[1,229],67:Ft,82:218,116:Mt,117:Rt,118:Pt},{67:Ft,69:[1,230],71:[1,231],82:218,116:Mt,117:Rt,118:Pt},{67:Ft,69:[1,233],71:[1,232],82:218,116:Mt,117:Rt,118:Pt},t(P,[2,45],{18:155,10:F,40:$t}),t(P,[2,47],{44:Bt}),t(it,[2,75]),t(it,[2,74]),{62:[1,234],67:Ft,82:218,116:Mt,117:Rt,118:Pt},t(it,[2,77]),t(qt,[2,80]),{77:[1,235],79:197,116:nt,119:at},{30:236,67:Ft,80:Nt,81:Ot,82:171,116:Mt,117:Rt,118:Pt},t(Lt,n,{5:237}),t(zt,[2,102]),t(N,[2,35]),{43:238,44:g,45:39,47:40,60:y,89:C,102:S,105:w,106:T,109:_,111:v,113:41,114:E,115:A,116:L},{10:F,18:239},{10:Yt,60:Ut,84:Ht,92:240,105:Vt,107:241,108:242,109:Xt,110:Gt,111:Kt,112:Qt},{10:Yt,60:Ut,84:Ht,92:251,104:[1,252],105:Vt,107:241,108:242,109:Xt,110:Gt,111:Kt,112:Qt},{10:Yt,60:Ut,84:Ht,92:253,104:[1,254],105:Vt,107:241,108:242,109:Xt,110:Gt,111:Kt,112:Qt},{105:[1,255]},{10:Yt,60:Ut,84:Ht,92:256,105:Vt,107:241,108:242,109:Xt,110:Gt,111:Kt,112:Qt},{44:g,47:257,60:y,89:C,102:S,105:w,106:T,109:_,111:v,113:41,114:E,115:A,116:L},t(Dt,[2,108]),{80:[1,258]},{80:[1,259],98:[1,260]},t(Dt,[2,116]),t(Dt,[2,118],{10:[1,261]}),t(Dt,[2,119]),t(J,[2,56]),t(jt,[2,87]),t(J,[2,57]),{51:[1,262],67:Ft,82:218,116:Mt,117:Rt,118:Pt},t(J,[2,64]),t(J,[2,59]),t(J,[2,60]),t(J,[2,61]),{109:[1,263]},t(J,[2,63]),t(J,[2,65]),{66:[1,264],67:Ft,82:218,116:Mt,117:Rt,118:Pt},t(J,[2,67]),t(J,[2,68]),t(J,[2,70]),t(J,[2,69]),t(J,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(it,[2,78]),{31:[1,265],67:Ft,82:218,116:Mt,117:Rt,118:Pt},{6:11,7:12,8:a,9:o,10:l,11:c,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,266],33:24,34:d,36:u,38:p,42:28,43:38,44:g,45:39,47:40,60:y,84:f,85:m,86:x,87:b,88:k,89:C,102:S,105:w,106:T,109:_,111:v,113:41,114:E,115:A,116:L,121:B,122:$,123:D,124:I},t(Z,[2,53]),{43:267,44:g,45:39,47:40,60:y,89:C,102:S,105:w,106:T,109:_,111:v,113:41,114:E,115:A,116:L},t(Dt,[2,121],{106:Zt}),t(Jt,[2,130],{108:269,10:Yt,60:Ut,84:Ht,105:Vt,109:Xt,110:Gt,111:Kt,112:Qt}),t(te,[2,132]),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(te,[2,140]),t(te,[2,141]),t(Dt,[2,122],{106:Zt}),{10:[1,270]},t(Dt,[2,123],{106:Zt}),{10:[1,271]},t(Wt,[2,129]),t(Dt,[2,105],{106:Zt}),t(Dt,[2,106],{113:112,44:g,60:y,89:C,102:S,105:w,106:T,109:_,111:v,114:E,115:A,116:L}),t(Dt,[2,110]),t(Dt,[2,112],{10:[1,272]}),t(Dt,[2,113]),{98:[1,273]},{51:[1,274]},{62:[1,275]},{66:[1,276]},{8:O,9:M,11:R,21:277},t(N,[2,34]),t(Z,[2,52]),{10:Yt,60:Ut,84:Ht,105:Vt,107:278,108:242,109:Xt,110:Gt,111:Kt,112:Qt},t(te,[2,133]),{14:z,44:W,60:j,89:Y,101:279,105:U,106:H,109:V,111:X,114:G,115:K,116:Q,120:87},{14:z,44:W,60:j,89:Y,101:280,105:U,106:H,109:V,111:X,114:G,115:K,116:Q,120:87},{98:[1,281]},t(Dt,[2,120]),t(J,[2,58]),{30:282,67:Ft,80:Nt,81:Ot,82:171,116:Mt,117:Rt,118:Pt},t(J,[2,66]),t(Lt,n,{5:283}),t(Jt,[2,131],{108:269,10:Yt,60:Ut,84:Ht,105:Vt,109:Xt,110:Gt,111:Kt,112:Qt}),t(Dt,[2,126],{120:167,10:[1,284],14:z,44:W,60:j,89:Y,105:U,106:H,109:V,111:X,114:G,115:K,116:Q}),t(Dt,[2,127],{120:167,10:[1,285],14:z,44:W,60:j,89:Y,105:U,106:H,109:V,111:X,114:G,115:K,116:Q}),t(Dt,[2,114]),{31:[1,286],67:Ft,82:218,116:Mt,117:Rt,118:Pt},{6:11,7:12,8:a,9:o,10:l,11:c,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,287],33:24,34:d,36:u,38:p,42:28,43:38,44:g,45:39,47:40,60:y,84:f,85:m,86:x,87:b,88:k,89:C,102:S,105:w,106:T,109:_,111:v,113:41,114:E,115:A,116:L,121:B,122:$,123:D,124:I},{10:Yt,60:Ut,84:Ht,92:288,105:Vt,107:241,108:242,109:Xt,110:Gt,111:Kt,112:Qt},{10:Yt,60:Ut,84:Ht,92:289,105:Vt,107:241,108:242,109:Xt,110:Gt,111:Kt,112:Qt},t(J,[2,62]),t(N,[2,33]),t(Dt,[2,124],{106:Zt}),t(Dt,[2,125],{106:Zt})],defaultActions:{},parseError:we((function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)}),"parseError"),parse:we((function(t){var e=this,i=[0],r=[],s=[null],n=[],a=this.table,o="",l=0,c=0,h=n.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;n.push(g);var y=d.options&&d.options.ranges;function f(){var t;return"number"!=typeof(t=r.pop()||d.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,we((function(t){i.length=i.length-2*t,s.length=s.length-t,n.length=n.length-t}),"popStack"),we(f,"lex");for(var m,x,b,k,C,S,w,T,_={};;){if(x=i[i.length-1],this.defaultActions[x]?b=this.defaultActions[x]:(null==m&&(m=f()),b=a[x]&&a[x][m]),void 0===b||!b.length||!b[0]){var v="";for(C in T=[],a[x])this.terminals_[C]&&C>2&&T.push("'"+this.terminals_[C]+"'");v=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(v,{text:d.match,token:this.terminals_[m]||m,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: "+x+", token: "+m);switch(b[0]){case 1:i.push(m),s.push(d.yytext),n.push(d.yylloc),i.push(b[1]),m=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(S=this.productions_[b[1]][1],_.$=s[s.length-S],_._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},y&&(_._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(k=this.performAction.apply(_,[o,c,l,u.yy,b[1],s,n].concat(h))))return k;S&&(i=i.slice(0,-1*S*2),s=s.slice(0,-1*S),n=n.slice(0,-1*S)),i.push(this.productions_[b[1]][0]),s.push(_.$),n.push(_._$),w=a[i[i.length-2]][i[i.length-1]],i.push(w);break;case 3:return!0}}return!0}),"parse")},ie=function(){return{EOF:1,parseError:we((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"), +// resets the lexer, sets new input +setInput:we((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}),"setInput"), +// consumes and returns one char from the input +input:we((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}),"input"), +// unshifts one char (or a string) into the input +unput:we((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 s=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=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"), +// When called from action, caches matched text and appends it on next action +more:we((function(){return this._more=!0,this}),"more"), +// 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:we((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})}),"reject"), +// retain first n characters of the match +less:we((function(t){this.unput(this.match.slice(t))}),"less"), +// displays already matched input, i.e. for error messages +pastInput:we((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"), +// displays upcoming input, i.e. for error messages +upcomingInput:we((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,"")}),"upcomingInput"), +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:we((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"), +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:we((function(t,e){var i,r,s;if(this.options.backtrack_lexer&&(s={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&&(s.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 n in s)this[n]=s[n];return!1}return!1}),"test_match"), +// return next match in input +next:we((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 s=this._currentRules(),n=0;ne[0].length)){if(e=i,r=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[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})}),"next"), +// return next match that has a token +lex:we((function(){var t=this.next();return t||this.lex()}),"lex"), +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:we((function(t){this.conditionStack.push(t)}),"begin"), +// pop the previously active lexer condition state off the condition stack +popState:we((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"), +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:we((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"), +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:we((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"), +// alias for begin(condition) +pushState:we((function(t){this.begin(t)}),"pushState"), +// return the number of states currently on the stack +stateStackSize:we((function(){return this.conditionStack.length}),"stateStackSize"),options:{},performAction:we((function(t,e,i,r){switch(i){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:case 12:case 14:case 17:case 20:case 23:case 33:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),e.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const i=/\n\s*/g;return e.yytext=e.yytext.replace(i,"
"),40;case 11:return 40;case 13:this.begin("callbackname");break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 18:return 96;case 19:return"MD_STR";case 21:this.begin("md_string");break;case 22:return"STR";case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 34:return 88;case 35:case 36:case 37:return t.lex.firstGraph()&&this.begin("dir"),12;case 38:return 27;case 39:return 32;case 40:case 41:case 42:case 43:return 98;case 44:return this.popState(),13;case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:return this.popState(),14;case 55:return 121;case 56:return 122;case 57:return 123;case 58:return 124;case 59:return 78;case 60:return 105;case 61:case 102:return 111;case 62:return 46;case 63:return 60;case 64:case 103:return 44;case 65:return 8;case 66:return 106;case 67:case 101:return 115;case 68:case 71:case 74:return this.popState(),77;case 69:return this.pushState("edgeText"),75;case 70:case 73:case 76:return 119;case 72:return this.pushState("thickEdgeText"),75;case 75:return this.pushState("dottedEdgeText"),75;case 77:return 77;case 78:return this.popState(),53;case 79:case 115:return"TEXT";case 80:return this.pushState("ellipseText"),52;case 81:return this.popState(),55;case 82:return this.pushState("text"),54;case 83:return this.popState(),57;case 84:return this.pushState("text"),56;case 85:return 58;case 86:return this.pushState("text"),67;case 87:return this.popState(),64;case 88:return this.pushState("text"),63;case 89:return this.popState(),49;case 90:return this.pushState("text"),48;case 91:return this.popState(),69;case 92:return this.popState(),71;case 93:return 117;case 94:return this.pushState("trapText"),68;case 95:return this.pushState("trapText"),70;case 96:return 118;case 97:return 67;case 98:return 90;case 99:return"SEP";case 100:return 89;case 104:return 109;case 105:return 114;case 106:return 116;case 107:return this.popState(),62;case 108:return this.pushState("text"),62;case 109:return this.popState(),51;case 110:return this.pushState("text"),50;case 111:return this.popState(),31;case 112:return this.pushState("text"),29;case 113:return this.popState(),66;case 114:return this.pushState("text"),65;case 116:return"QUOTE";case 117:return 9;case 118:return 10;case 119:return 11}}),"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\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]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-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])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},shapeData:{rules:[8,11,12,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},callbackargs:{rules:[17,18,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},callbackname:{rules:[14,15,16,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},href:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},click:{rules:[21,24,33,34,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},dottedEdgeText:{rules:[21,24,74,76,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},thickEdgeText:{rules:[21,24,71,73,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},edgeText:{rules:[21,24,68,70,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},trapText:{rules:[21,24,77,80,82,84,88,90,91,92,93,94,95,108,110,112,114],inclusive:!1},ellipseText:{rules:[21,24,77,78,79,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},text:{rules:[21,24,77,80,81,82,83,84,87,88,89,90,94,95,107,108,109,110,111,112,113,114,115],inclusive:!1},vertex:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_descr:{rules:[3,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_title:{rules:[1,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},md_string:{rules:[19,20,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},string:{rules:[21,22,23,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,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,71,72,74,75,77,80,82,84,85,86,88,90,94,95,96,97,98,99,100,101,102,103,104,105,106,108,110,112,114,116,117,118,119],inclusive:!0}}}}();function re(){this.yy={}}return ee.lexer=ie,we(re,"Parser"),re.prototype=ee,ee.Parser=re,new re}();_g.parser=_g;var vg=_g,Eg=Object.assign({},vg);Eg.parse=t=>{const e=t.replace(/}\s*\n/g,"}\n");return vg.parse(e)};var Ag=Eg,Lg=we(((t,e)=>{const i=ot,r=i(t,"r"),s=i(t,"g"),n=i(t,"b");return rt(r,s,n,e)}),"fade"),Bg=we((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 .cluster-label span p {\n background-color: transparent;\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 .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .katex path {\n fill: #000;\n stroke: #000;\n stroke-width: 1px;\n }\n\n .rough-node .label,.node .label, .image-shape .label, .icon-shape .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n\n .root .anchor path {\n fill: ${t.lineColor} !important;\n stroke-width: 0;\n stroke: ${t.lineColor};\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 p {\n background-color: ${t.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${Lg(t.edgeLabelBackground,.5)};\n // background-color:\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\n rect.text {\n fill: none;\n stroke-width: 0;\n }\n\n .icon-shape, .image-shape {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n padding: 2px;\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n }\n`),"getStyles"),$g={parser:Ag,get db(){return new wg},renderer:Tg,styles:Bg,init:we((t=>{t.flowchart||(t.flowchart={}),t.layout&&xr({layout:t.layout}),t.flowchart.arrowMarkerAbsolute=t.arrowMarkerAbsolute,xr({flowchart:{arrowMarkerAbsolute:t.arrowMarkerAbsolute}})}),"init")};const Dg=Object.defineProperty({__proto__:null,diagram:$g},Symbol.toStringTag,{value:"Module"});var Ig=function(){var t=we((function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i}),"o"),e=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,50],i=[1,10],r=[1,11],s=[1,12],n=[1,13],a=[1,20],o=[1,21],l=[1,22],c=[1,23],h=[1,24],d=[1,19],u=[1,25],p=[1,26],g=[1,18],y=[1,33],f=[1,34],m=[1,35],x=[1,36],b=[1,37],k=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,50,63,64,65,66,67],C=[1,42],S=[1,43],w=[1,52],T=[40,50,68,69],_=[1,63],v=[1,61],E=[1,58],A=[1,62],L=[1,64],B=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,63,64,65,66,67],$=[63,64,65,66,67],D=[1,81],I=[1,80],F=[1,78],N=[1,79],O=[6,10,42,47],M=[6,10,13,41,42,47,48,49],R=[1,89],P=[1,88],q=[1,87],z=[19,56],W=[1,98],j=[1,97],Y=[19,56,58,60],U={trace:we((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,attribute:51,attributeType:52,attributeName:53,attributeKeyTypeList:54,attributeComment:55,ATTRIBUTE_WORD:56,attributeKeyType:57,",":58,ATTRIBUTE_KEY:59,COMMENT:60,cardinality:61,relType:62,ZERO_OR_ONE:63,ZERO_OR_MORE:64,ONE_OR_MORE:65,ONLY_ONE:66,MD_PARENT:67,NON_IDENTIFYING:68,IDENTIFYING:69,WORD:70,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",56:"ATTRIBUTE_WORD",58:",",59:"ATTRIBUTE_KEY",60:"COMMENT",63:"ZERO_OR_ONE",64:"ZERO_OR_MORE",65:"ONE_OR_MORE",66:"ONLY_ONE",67:"MD_PARENT",68:"NON_IDENTIFYING",69:"IDENTIFYING",70:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[18,1],[18,2],[51,2],[51,3],[51,3],[51,4],[52,1],[53,1],[54,1],[54,3],[57,1],[55,1],[12,3],[61,1],[61,1],[61,1],[61,1],[61,1],[62,1],[62,1],[14,1],[14,1],[14,1]],performAction:we((function(t,e,i,r,s,n,a){var o=n.length-1;switch(s){case 1:break;case 2:case 6:case 7:this.$=[];break;case 3:n[o-1].push(n[o]),this.$=n[o-1];break;case 4:case 5:case 55:case 78:case 62:case 63:case 66:this.$=n[o];break;case 8:r.addEntity(n[o-4]),r.addEntity(n[o-2]),r.addRelationship(n[o-4],n[o],n[o-2],n[o-3]);break;case 9:r.addEntity(n[o-8]),r.addEntity(n[o-4]),r.addRelationship(n[o-8],n[o],n[o-4],n[o-5]),r.setClass([n[o-8]],n[o-6]),r.setClass([n[o-4]],n[o-2]);break;case 10:r.addEntity(n[o-6]),r.addEntity(n[o-2]),r.addRelationship(n[o-6],n[o],n[o-2],n[o-3]),r.setClass([n[o-6]],n[o-4]);break;case 11:r.addEntity(n[o-6]),r.addEntity(n[o-4]),r.addRelationship(n[o-6],n[o],n[o-4],n[o-5]),r.setClass([n[o-4]],n[o-2]);break;case 12:r.addEntity(n[o-3]),r.addAttributes(n[o-3],n[o-1]);break;case 13:r.addEntity(n[o-5]),r.addAttributes(n[o-5],n[o-1]),r.setClass([n[o-5]],n[o-3]);break;case 14:r.addEntity(n[o-2]);break;case 15:r.addEntity(n[o-4]),r.setClass([n[o-4]],n[o-2]);break;case 16:r.addEntity(n[o]);break;case 17:r.addEntity(n[o-2]),r.setClass([n[o-2]],n[o]);break;case 18:r.addEntity(n[o-6],n[o-4]),r.addAttributes(n[o-6],n[o-1]);break;case 19:r.addEntity(n[o-8],n[o-6]),r.addAttributes(n[o-8],n[o-1]),r.setClass([n[o-8]],n[o-3]);break;case 20:r.addEntity(n[o-5],n[o-3]);break;case 21:r.addEntity(n[o-7],n[o-5]),r.setClass([n[o-7]],n[o-2]);break;case 22:r.addEntity(n[o-3],n[o-1]);break;case 23:r.addEntity(n[o-5],n[o-3]),r.setClass([n[o-5]],n[o]);break;case 24:case 25:this.$=n[o].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=n[o].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=n[o-3],r.addClass(n[o-2],n[o-1]);break;case 37:case 38:case 56:case 64:case 43:this.$=[n[o]];break;case 39:case 40:this.$=n[o-2].concat([n[o]]);break;case 41:this.$=n[o-2],r.setClass(n[o-1],n[o]);break;case 42:this.$=n[o-3],r.addCssStyles(n[o-2],n[o-1]);break;case 44:case 65:n[o-2].push(n[o]),this.$=n[o-2];break;case 46:this.$=n[o-1]+n[o];break;case 54:case 76:case 77:case 67:this.$=n[o].replace(/"/g,"");break;case 57:n[o].push(n[o-1]),this.$=n[o];break;case 58:this.$={type:n[o-1],name:n[o]};break;case 59:this.$={type:n[o-2],name:n[o-1],keys:n[o]};break;case 60:this.$={type:n[o-2],name:n[o-1],comment:n[o]};break;case 61:this.$={type:n[o-3],name:n[o-2],keys:n[o-1],comment:n[o]};break;case 68:this.$={cardA:n[o],relType:n[o-1],cardB:n[o-2]};break;case 69:this.$=r.Cardinality.ZERO_OR_ONE;break;case 70:this.$=r.Cardinality.ZERO_OR_MORE;break;case 71:this.$=r.Cardinality.ONE_OR_MORE;break;case 72:this.$=r.Cardinality.ONLY_ONE;break;case 73:this.$=r.Cardinality.MD_PARENT;break;case 74:this.$=r.Identification.NON_IDENTIFYING;break;case 75:this.$=r.Identification.IDENTIFYING}}),"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:i,24:r,26:s,28:n,29:14,30:15,31:16,32:17,33:a,34:o,35:l,36:c,37:h,40:d,43:u,44:p,50:g},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:27,11:9,22:i,24:r,26:s,28:n,29:14,30:15,31:16,32:17,33:a,34:o,35:l,36:c,37:h,40:d,43:u,44:p,50:g},t(e,[2,5]),t(e,[2,6]),t(e,[2,16],{12:28,61:32,15:[1,29],17:[1,30],20:[1,31],63:y,64:f,65:m,66:x,67:b}),{23:[1,38]},{25:[1,39]},{27:[1,40]},t(e,[2,27]),t(e,[2,28]),t(e,[2,29]),t(e,[2,30]),t(e,[2,31]),t(k,[2,54]),t(k,[2,55]),t(e,[2,32]),t(e,[2,33]),t(e,[2,34]),t(e,[2,35]),{16:41,40:C,41:S},{16:44,40:C,41:S},{16:45,40:C,41:S},t(e,[2,4]),{11:46,40:d,50:g},{16:47,40:C,41:S},{18:48,19:[1,49],51:50,52:51,56:w},{11:53,40:d,50:g},{62:54,68:[1,55],69:[1,56]},t(T,[2,69]),t(T,[2,70]),t(T,[2,71]),t(T,[2,72]),t(T,[2,73]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),{13:_,38:57,41:v,42:E,45:59,46:60,48:A,49:L},t(B,[2,37]),t(B,[2,38]),{16:65,40:C,41:S,42:E},{13:_,38:66,41:v,42:E,45:59,46:60,48:A,49:L},{13:[1,67],15:[1,68]},t(e,[2,17],{61:32,12:69,17:[1,70],42:E,63:y,64:f,65:m,66:x,67:b}),{19:[1,71]},t(e,[2,14]),{18:72,19:[2,56],51:50,52:51,56:w},{53:73,56:[1,74]},{56:[2,62]},{21:[1,75]},{61:76,63:y,64:f,65:m,66:x,67:b},t($,[2,74]),t($,[2,75]),{6:D,10:I,39:77,42:F,47:N},{40:[1,82],41:[1,83]},t(O,[2,43],{46:84,13:_,41:v,48:A,49:L}),t(M,[2,45]),t(M,[2,50]),t(M,[2,51]),t(M,[2,52]),t(M,[2,53]),t(e,[2,41],{42:E}),{6:D,10:I,39:85,42:F,47:N},{14:86,40:R,50:P,70:q},{16:90,40:C,41:S},{11:91,40:d,50:g},{18:92,19:[1,93],51:50,52:51,56:w},t(e,[2,12]),{19:[2,57]},t(z,[2,58],{54:94,55:95,57:96,59:W,60:j}),t([19,56,59,60],[2,63]),t(e,[2,22],{15:[1,100],17:[1,99]}),t([40,50],[2,68]),t(e,[2,36]),{13:_,41:v,45:101,46:60,48:A,49:L},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(B,[2,39]),t(B,[2,40]),t(M,[2,46]),t(e,[2,42]),t(e,[2,8]),t(e,[2,76]),t(e,[2,77]),t(e,[2,78]),{13:[1,102],42:E},{13:[1,104],15:[1,103]},{19:[1,105]},t(e,[2,15]),t(z,[2,59],{55:106,58:[1,107],60:j}),t(z,[2,60]),t(Y,[2,64]),t(z,[2,67]),t(Y,[2,66]),{18:108,19:[1,109],51:50,52:51,56:w},{16:110,40:C,41:S},t(O,[2,44],{46:84,13:_,41:v,48:A,49:L}),{14:111,40:R,50:P,70:q},{16:112,40:C,41:S},{14:113,40:R,50:P,70:q},t(e,[2,13]),t(z,[2,61]),{57:114,59:W},{19:[1,115]},t(e,[2,20]),t(e,[2,23],{17:[1,116],42:E}),t(e,[2,11]),{13:[1,117],42:E},t(e,[2,10]),t(Y,[2,65]),t(e,[2,18]),{18:118,19:[1,119],51:50,52:51,56:w},{14:120,40:R,50:P,70:q},{19:[1,121]},t(e,[2,21]),t(e,[2,9]),t(e,[2,19])],defaultActions:{52:[2,62],72:[2,57]},parseError:we((function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)}),"parseError"),parse:we((function(t){var e=this,i=[0],r=[],s=[null],n=[],a=this.table,o="",l=0,c=0,h=n.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;n.push(g);var y=d.options&&d.options.ranges;function f(){var t;return"number"!=typeof(t=r.pop()||d.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,we((function(t){i.length=i.length-2*t,s.length=s.length-t,n.length=n.length-t}),"popStack"),we(f,"lex");for(var m,x,b,k,C,S,w,T,_={};;){if(x=i[i.length-1],this.defaultActions[x]?b=this.defaultActions[x]:(null==m&&(m=f()),b=a[x]&&a[x][m]),void 0===b||!b.length||!b[0]){var v="";for(C in T=[],a[x])this.terminals_[C]&&C>2&&T.push("'"+this.terminals_[C]+"'");v=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(v,{text:d.match,token:this.terminals_[m]||m,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: "+x+", token: "+m);switch(b[0]){case 1:i.push(m),s.push(d.yytext),n.push(d.yylloc),i.push(b[1]),m=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(S=this.productions_[b[1]][1],_.$=s[s.length-S],_._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},y&&(_._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(k=this.performAction.apply(_,[o,c,l,u.yy,b[1],s,n].concat(h))))return k;S&&(i=i.slice(0,-1*S*2),s=s.slice(0,-1*S),n=n.slice(0,-1*S)),i.push(this.productions_[b[1]][0]),s.push(_.$),n.push(_._$),w=a[i[i.length-2]][i[i.length-1]],i.push(w);break;case 3:return!0}}return!0}),"parse")},H=function(){return{EOF:1,parseError:we((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"), +// resets the lexer, sets new input +setInput:we((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}),"setInput"), +// consumes and returns one char from the input +input:we((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}),"input"), +// unshifts one char (or a string) into the input +unput:we((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 s=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=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"), +// When called from action, caches matched text and appends it on next action +more:we((function(){return this._more=!0,this}),"more"), +// 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:we((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})}),"reject"), +// retain first n characters of the match +less:we((function(t){this.unput(this.match.slice(t))}),"less"), +// displays already matched input, i.e. for error messages +pastInput:we((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"), +// displays upcoming input, i.e. for error messages +upcomingInput:we((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,"")}),"upcomingInput"), +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:we((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"), +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:we((function(t,e){var i,r,s;if(this.options.backtrack_lexer&&(s={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&&(s.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 n in s)this[n]=s[n];return!1}return!1}),"test_match"), +// return next match in input +next:we((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 s=this._currentRules(),n=0;ne[0].length)){if(e=i,r=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[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})}),"next"), +// return next match that has a token +lex:we((function(){var t=this.next();return t||this.lex()}),"lex"), +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:we((function(t){this.conditionStack.push(t)}),"begin"), +// pop the previously active lexer condition state off the condition stack +popState:we((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"), +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:we((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"), +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:we((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"), +// alias for begin(condition) +pushState:we((function(t){this.begin(t)}),"pushState"), +// return the number of states currently on the stack +stateStackSize:we((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:we((function(t,e,i,r){switch(i){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;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 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:case 23:case 28:case 35:break;case 13:return 8;case 14:return 50;case 15:return 70;case 16:return 4;case 17:return this.begin("block"),17;case 18:case 19:case 38:return 49;case 20:case 37:return 42;case 21:return 15;case 22:case 36:return 13;case 24:return 59;case 25:case 26:return 56;case 27:return 60;case 29:return this.popState(),19;case 30:case 73:return e.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;case 34:return this.popState(),10;case 39:return this.begin("style"),37;case 40:return 43;case 41:case 45:case 46:case 59:return 63;case 42:case 43:case 44:case 52:case 54:case 61:return 65;case 47:case 48:case 49:case 50:case 51:case 53:case 60:return 64;case 55:case 56:case 57:case 58:return 66;case 62:return 67;case 63:case 66:case 67:case 68:return 68;case 64:case 65:return 69;case 69:return 41;case 70:return 47;case 71:return 40;case 72:return 48;case 74:return 6}}),"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/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,/^(?:\s*u\b)/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:[0-9])/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,69,70],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[23,24,25,26,27,28,29,30],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,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,71,72,73,74],inclusive:!0}}}}();function V(){this.yy={}}return U.lexer=H,we(V,"Parser"),V.prototype=U,U.Parser=V,new V}();Ig.parser=Ig;var Fg=Ig,Ng=(we(p=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=cr,this.getAccTitle=hr,this.setAccDescription=dr,this.getAccDescription=ur,this.setDiagramTitle=pr,this.getDiagramTitle=gr,this.getConfig=we((()=>mr().er),"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)} +/** + * Add entity + * @param name - The name of the entity + * @param alias - The alias of the entity + */addEntity(t,e=""){var i;return this.entities.has(t)?!(null==(i=this.entities.get(t))?void 0:i.alias)&&e&&(this.entities.get(t).alias=e,ve.info(`Add alias '${e}' to entity '${t}'`)):(this.entities.set(t,{id:`entity-${t}-${this.entities.size}`,label:t,attributes:[],alias:e,shape:"erBox",look:mr().look??"default",cssClasses:"default",cssStyles:[]}),ve.info("Added new entity :",t)),this.entities.get(t)}getEntity(t){return this.entities.get(t)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(t,e){const i=this.addEntity(t);let r;for(r=e.length-1;r>=0;r--)e[r].keys||(e[r].keys=[]),e[r].comment||(e[r].comment=""),i.attributes.push(e[r]),ve.debug("Added attribute ",e[r].name)} +/** + * Add a relationship + * + * @param entA - The first entity in the relationship + * @param rolA - The role played by the first entity in relation to the second + * @param entB - The second entity in the relationship + * @param rSpec - The details of the relationship between the two entities + */addRelationship(t,e,i,r){const s=this.entities.get(t),n=this.entities.get(i);if(!s||!n)return;const a={entityA:s.id,roleA:e,entityB:n.id,relSpec:r};this.relationships.push(a),ve.debug("Added new relationship :",a)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(t){this.direction=t}getCompiledStyles(t){let e=[];for(const i of t){const t=this.classes.get(i);(null==t?void 0:t.styles)&&(e=[...e,...t.styles??[]].map((t=>t.trim()))),(null==t?void 0:t.textStyles)&&(e=[...e,...t.textStyles??[]].map((t=>t.trim())))}return e}addCssStyles(t,e){for(const i of t){const t=this.entities.get(i);if(!e||!t)return;for(const i of e)t.cssStyles.push(i)}}addClass(t,e){t.forEach((t=>{let i=this.classes.get(t);void 0===i&&(i={id:t,styles:[],textStyles:[]},this.classes.set(t,i)),e&&e.forEach((function(t){if(/color/.exec(t)){const e=t.replace("fill","bgFill");i.textStyles.push(e)}i.styles.push(t)}))}))}setClass(t,e){for(const i of t){const t=this.entities.get(i);if(t)for(const i of e)t.cssClasses+=" "+i}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],lr()}getData(){const t=[],e=[],i=mr();for(const s of this.entities.keys()){const e=this.entities.get(s);e&&(e.cssCompiledStyles=this.getCompiledStyles(e.cssClasses.split(" ")),t.push(e))}let r=0;for(const s of this.relationships){const t={id:ko(s.entityA,s.entityB,{prefix:"id",counter:r++}),type:"normal",curve:"basis",start:s.entityA,end:s.entityB,label:s.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:s.relSpec.cardB.toLowerCase(),arrowTypeEnd:s.relSpec.cardA.toLowerCase(),pattern:"IDENTIFYING"==s.relSpec.relType?"solid":"dashed",look:i.look};e.push(t)}return{nodes:t,edges:e,other:{},config:i,direction:"TB"}}},"ErDB"),p),Og={};Te(Og,{draw:()=>Mg});var Mg=we((async function(t,e,i,r){ve.info("REF0:"),ve.info("Drawing er diagram (unified)",e);const{securityLevel:s,er:n,layout:a}=mr(),o=r.db.getData(),l=bg(e,s);o.type=r.type,o.layoutAlgorithm=Lh(a),o.config.flowchart.nodeSpacing=(null==n?void 0:n.nodeSpacing)||140,o.config.flowchart.rankSpacing=(null==n?void 0:n.rankSpacing)||80,o.direction=r.db.getDirection(),o.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],o.diagramId=e,await Ah(o,l),"elk"===o.layoutAlgorithm&&l.select(".edges").lower();const c=l.selectAll('[id*="-background"]');Array.from(c).length>0&&c.each((function(){const t=K(this),e=t.attr("id").replace("-background",""),i=l.select(`#${CSS.escape(e)}`);if(!i.empty()){const e=i.attr("transform");t.attr("transform",e)}}));mo.insertTitle(l,"erDiagramTitleText",(null==n?void 0:n.titleTopMargin)??25,r.db.getDiagramTitle()),kg(l,8,"erDiagram",(null==n?void 0:n.useMaxWidth)??!0)}),"draw"),Rg=we(((t,e)=>{const i=ot,r=i(t,"r"),s=i(t,"g"),n=i(t,"b");return rt(r,s,n,e)}),"fade"),Pg=we((t=>`\n .entityBox {\n fill: ${t.mainBkg};\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 .labelBkg {\n background-color: ${Rg(t.tertiaryColor,.5)};\n }\n\n .edgeLabel .label {\n fill: ${t.nodeBorder};\n font-size: 14px;\n }\n\n .label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n\n .edge-pattern-dashed {\n stroke-dasharray: 8,8;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon\n {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .relationshipLine {\n stroke: ${t.lineColor};\n stroke-width: 1;\n fill: none;\n }\n\n .marker {\n fill: none !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n }\n`),"getStyles"),qg={parser:Fg,get db(){return new Ng},renderer:Og,styles:Pg};const zg=Object.defineProperty({__proto__:null,diagram:qg},Symbol.toStringTag,{value:"Module"});function Wg(t,e){var i,r,s;t.accDescr&&(null==(i=e.setAccDescription)||i.call(e,t.accDescr)),t.accTitle&&(null==(r=e.setAccTitle)||r.call(e,t.accTitle)),t.title&&(null==(s=e.setDiagramTitle)||s.call(e,t.title))}we(Wg,"populateCommonDb");var jg=(we(g=class{ +/** + * @param init - Function that creates the default state. + */ +constructor(t){this.init=t,this.records=this.init()}reset(){this.records=this.init()}},"ImperativeState"),g),Yg={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Ug=ii.gitGraph,Hg=we((()=>fo({...Ug,...yi().gitGraph})),"getConfig"),Vg=new jg((()=>{const t=Hg(),e=t.mainBranchName,i=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:i}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}}));function Xg(){return eo({length:7})}function Gg(t,e){const i=Object.create(null);return t.reduce(((t,r)=>{const s=e(r);return i[s]||(i[s]=!0,t.push(r)),t}),[])}we(Xg,"getID"),we(Gg,"uniqBy");var Kg=we((function(t){Vg.records.direction=t}),"setDirection"),Qg=we((function(t){ve.debug("options str",t),t=(t=null==t?void 0:t.trim())||"{}";try{Vg.records.options=JSON.parse(t)}catch(e){ve.error("error while parsing gitGraph options",e.message)}}),"setOptions"),Zg=we((function(){return Vg.records.options}),"getOptions"),Jg=we((function(t){let e=t.msg,i=t.id;const r=t.type;let s=t.tags;ve.info("commit",e,i,r,s),ve.debug("Entering commit:",e,i,r,s);const n=Hg();i=Xi.sanitizeText(i,n),e=Xi.sanitizeText(e,n),s=null==s?void 0:s.map((t=>Xi.sanitizeText(t,n)));const a={id:i||Vg.records.seq+"-"+Xg(),message:e,seq:Vg.records.seq++,type:r??Yg.NORMAL,tags:s??[],parents:null==Vg.records.head?[]:[Vg.records.head.id],branch:Vg.records.currBranch};Vg.records.head=a,ve.info("main branch",n.mainBranchName),Vg.records.commits.set(a.id,a),Vg.records.branches.set(Vg.records.currBranch,a.id),ve.debug("in pushCommit "+a.id)}),"commit"),ty=we((function(t){let e=t.name;const i=t.order;if(e=Xi.sanitizeText(e,Hg()),Vg.records.branches.has(e))throw 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 ${e}")`);Vg.records.branches.set(e,null!=Vg.records.head?Vg.records.head.id:null),Vg.records.branchConfig.set(e,{name:e,order:i}),ry(e),ve.debug("in createBranch")}),"branch"),ey=we((t=>{let e=t.branch,i=t.id;const r=t.type,s=t.tags,n=Hg();e=Xi.sanitizeText(e,n),i&&(i=Xi.sanitizeText(i,n));const a=Vg.records.branches.get(Vg.records.currBranch),o=Vg.records.branches.get(e),l=a?Vg.records.commits.get(a):void 0,c=o?Vg.records.commits.get(o):void 0;if(l&&c&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(Vg.records.currBranch===e){const t=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},t}if(void 0===l||!l){const t=new Error(`Incorrect usage of "merge". Current branch (${Vg.records.currBranch})has no commits`);throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},t}if(!Vg.records.branches.has(e)){const t=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},t}if(void 0===c||!c){const t=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},t}if(l===c){const t=new Error('Incorrect usage of "merge". Both branches have same head');throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},t}if(i&&Vg.records.commits.has(i)){const t=new Error('Incorrect usage of "merge". Commit with id:'+i+" already exists, use different custom Id");throw t.hash={text:`merge ${e} ${i} ${r} ${null==s?void 0:s.join(" ")}`,token:`merge ${e} ${i} ${r} ${null==s?void 0:s.join(" ")}`,expected:[`merge ${e} ${i}_UNIQUE ${r} ${null==s?void 0:s.join(" ")}`]},t}const h=o||"",d={id:i||`${Vg.records.seq}-${Xg()}`,message:`merged branch ${e} into ${Vg.records.currBranch}`,seq:Vg.records.seq++,parents:null==Vg.records.head?[]:[Vg.records.head.id,h],branch:Vg.records.currBranch,type:Yg.MERGE,customType:r,customId:!!i,tags:s??[]};Vg.records.head=d,Vg.records.commits.set(d.id,d),Vg.records.branches.set(Vg.records.currBranch,d.id),ve.debug(Vg.records.branches),ve.debug("in mergeBranch")}),"merge"),iy=we((function(t){let e=t.id,i=t.targetId,r=t.tags,s=t.parent;ve.debug("Entering cherryPick:",e,i,r);const n=Hg();if(e=Xi.sanitizeText(e,n),i=Xi.sanitizeText(i,n),r=null==r?void 0:r.map((t=>Xi.sanitizeText(t,n))),s=Xi.sanitizeText(s,n),!e||!Vg.records.commits.has(e)){const t=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw t.hash={text:`cherryPick ${e} ${i}`,token:`cherryPick ${e} ${i}`,expected:["cherry-pick abc"]},t}const a=Vg.records.commits.get(e);if(void 0===a||!a)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(s&&(!Array.isArray(a.parents)||!a.parents.includes(s))){throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.")}const o=a.branch;if(a.type===Yg.MERGE&&!s){throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.")}if(!i||!Vg.records.commits.has(i)){if(o===Vg.records.currBranch){const t=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw t.hash={text:`cherryPick ${e} ${i}`,token:`cherryPick ${e} ${i}`,expected:["cherry-pick abc"]},t}const t=Vg.records.branches.get(Vg.records.currBranch);if(void 0===t||!t){const t=new Error(`Incorrect usage of "cherry-pick". Current branch (${Vg.records.currBranch})has no commits`);throw t.hash={text:`cherryPick ${e} ${i}`,token:`cherryPick ${e} ${i}`,expected:["cherry-pick abc"]},t}const n=Vg.records.commits.get(t);if(void 0===n||!n){const t=new Error(`Incorrect usage of "cherry-pick". Current branch (${Vg.records.currBranch})has no commits`);throw t.hash={text:`cherryPick ${e} ${i}`,token:`cherryPick ${e} ${i}`,expected:["cherry-pick abc"]},t}const l={id:Vg.records.seq+"-"+Xg(),message:`cherry-picked ${null==a?void 0:a.message} into ${Vg.records.currBranch}`,seq:Vg.records.seq++,parents:null==Vg.records.head?[]:[Vg.records.head.id,a.id],branch:Vg.records.currBranch,type:Yg.CHERRY_PICK,tags:r?r.filter(Boolean):[`cherry-pick:${a.id}${a.type===Yg.MERGE?`|parent:${s}`:""}`]};Vg.records.head=l,Vg.records.commits.set(l.id,l),Vg.records.branches.set(Vg.records.currBranch,l.id),ve.debug(Vg.records.branches),ve.debug("in cherryPick")}}),"cherryPick"),ry=we((function(t){if(t=Xi.sanitizeText(t,Hg()),!Vg.records.branches.has(t)){const 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}`,expected:[`branch ${t}`]},e}{Vg.records.currBranch=t;const e=Vg.records.branches.get(Vg.records.currBranch);Vg.records.head=void 0!==e&&e?Vg.records.commits.get(e)??null:null}}),"checkout");function sy(t,e,i){const r=t.indexOf(e);-1===r?t.push(i):t.splice(r,1,i)}function ny(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(const s in Vg.records.branches)Vg.records.branches.get(s)===e.id&&r.push(s);if(ve.debug(r.join(" ")),e.parents&&2==e.parents.length&&e.parents[0]&&e.parents[1]){const i=Vg.records.commits.get(e.parents[0]);sy(t,e,i),e.parents[1]&&t.push(Vg.records.commits.get(e.parents[1]))}else{if(0==e.parents.length)return;if(e.parents[0]){const i=Vg.records.commits.get(e.parents[0]);sy(t,e,i)}}ny(t=Gg(t,(t=>t.id)))}we(sy,"upsert"),we(ny,"prettyPrintCommitHistory");var ay=we((function(){ve.debug(Vg.records.commits);ny([dy()[0]])}),"prettyPrint"),oy=we((function(){Vg.reset(),lr()}),"clear"),ly=we((function(){return[...Vg.records.branchConfig.values()].map(((t,e)=>null!==t.order&&void 0!==t.order?t:{...t,order:parseFloat(`0.${e}`)})).sort(((t,e)=>(t.order??0)-(e.order??0))).map((({name:t})=>({name:t})))}),"getBranchesAsObjArray"),cy=we((function(){return Vg.records.branches}),"getBranches"),hy=we((function(){return Vg.records.commits}),"getCommits"),dy=we((function(){const t=[...Vg.records.commits.values()];return t.forEach((function(t){ve.debug(t.id)})),t.sort(((t,e)=>t.seq-e.seq)),t}),"getCommitsArray"),uy={commitType:Yg,getConfig:Hg,setDirection:Kg,setOptions:Qg,getOptions:Zg,commit:Jg,branch:ty,merge:ey,cherryPick:iy,checkout:ry, +//reset, +prettyPrint:ay,clear:oy,getBranchesAsObjArray:ly,getBranches:cy,getCommits:hy,getCommitsArray:dy,getCurrentBranch:we((function(){return Vg.records.currBranch}),"getCurrentBranch"),getDirection:we((function(){return Vg.records.direction}),"getDirection"),getHead:we((function(){return Vg.records.head}),"getHead"),setAccTitle:cr,getAccTitle:hr,getAccDescription:ur,setAccDescription:dr,setDiagramTitle:pr,getDiagramTitle:gr},py=we(((t,e)=>{Wg(t,e),t.dir&&e.setDirection(t.dir);for(const i of t.statements)gy(i,e)}),"populate"),gy=we(((t,e)=>{const i={Commit:we((t=>e.commit(yy(t))),"Commit"),Branch:we((t=>e.branch(fy(t))),"Branch"),Merge:we((t=>e.merge(my(t))),"Merge"),Checkout:we((t=>e.checkout(xy(t))),"Checkout"),CherryPicking:we((t=>e.cherryPick(by(t))),"CherryPicking")}[t.$type];i?i(t):ve.error(`Unknown statement type: ${t.$type}`)}),"parseStatement"),yy=we((t=>({id:t.id,msg:t.message??"",type:void 0!==t.type?Yg[t.type]:Yg.NORMAL,tags:t.tags??void 0})),"parseCommit"),fy=we((t=>({name:t.name,order:t.order??0})),"parseBranch"),my=we((t=>({branch:t.branch,id:t.id??"",type:void 0!==t.type?Yg[t.type]:void 0,tags:t.tags??void 0})),"parseMerge"),xy=we((t=>t.branch),"parseCheckout"),by=we((t=>{var e;return{id:t.id,targetId:"",tags:0===(null==(e=t.tags)?void 0:e.length)?void 0:t.tags,parent:t.parent}}),"parseCherryPicking"),ky={parse:we((async t=>{const e=await q("gitGraph",t);ve.debug(e),py(e,uy)}),"parse")},Cy=mr(),Sy=null==Cy?void 0:Cy.gitGraph,wy=10,Ty=40,_y=new Map,vy=new Map,Ey=new Map,Ay=[],Ly=0,By="LR",$y=we((()=>{_y.clear(),vy.clear(),Ey.clear(),Ly=0,Ay=[],By="LR"}),"clear"),Dy=we((t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return("string"==typeof t?t.split(/\\n|\n|/gi):t).forEach((t=>{const i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),i.setAttribute("class","row"),i.textContent=t.trim(),e.appendChild(i)})),e}),"drawText"),Iy=we((t=>{let e,i,r;return"BT"===By?(i=we(((t,e)=>t<=e),"comparisonFunc"),r=1/0):(i=we(((t,e)=>t>=e),"comparisonFunc"),r=0),t.forEach((t=>{var s,n;const a="TB"===By||"BT"==By?null==(s=vy.get(t))?void 0:s.y:null==(n=vy.get(t))?void 0:n.x;void 0!==a&&i(a,r)&&(e=t,r=a)})),e}),"findClosestParent"),Fy=we((t=>{let e="",i=1/0;return t.forEach((t=>{const r=vy.get(t).y;r<=i&&(e=t,i=r)})),e||void 0}),"findClosestParentBT"),Ny=we(((t,e,i)=>{let r=i,s=i;const n=[];t.forEach((t=>{const i=e.get(t);if(!i)throw new Error(`Commit not found for key ${t}`);i.parents.length?(r=My(i),s=Math.max(r,s)):n.push(i),Ry(i,r)})),r=s,n.forEach((t=>{Py(t,r,i)})),t.forEach((t=>{const i=e.get(t);if(null==i?void 0:i.parents.length){const t=Fy(i.parents);r=vy.get(t).y-Ty,r<=s&&(s=r);const e=_y.get(i.branch).pos,n=r-wy;vy.set(i.id,{x:e,y:n})}}))}),"setParallelBTPos"),Oy=we((t=>{var e;const i=Iy(t.parents.filter((t=>null!==t)));if(!i)throw new Error(`Closest parent not found for commit ${t.id}`);const r=null==(e=vy.get(i))?void 0:e.y;if(void 0===r)throw new Error(`Closest parent position not found for commit ${t.id}`);return r}),"findClosestParentPos"),My=we((t=>Oy(t)+Ty),"calculateCommitPosition"),Ry=we(((t,e)=>{const i=_y.get(t.branch);if(!i)throw new Error(`Branch not found for commit ${t.id}`);const r=i.pos,s=e+wy;return vy.set(t.id,{x:r,y:s}),{x:r,y:s}}),"setCommitPosition"),Py=we(((t,e,i)=>{const r=_y.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const s=e+i,n=r.pos;vy.set(t.id,{x:n,y:s})}),"setRootPosition"),qy=we(((t,e,i,r,s,n)=>{if(n===Yg.HIGHLIGHT)t.append("rect").attr("x",i.x-10).attr("y",i.y-10).attr("width",20).attr("height",20).attr("class",`commit ${e.id} commit-highlight${s%8} ${r}-outer`),t.append("rect").attr("x",i.x-6).attr("y",i.y-6).attr("width",12).attr("height",12).attr("class",`commit ${e.id} commit${s%8} ${r}-inner`);else if(n===Yg.CHERRY_PICK)t.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("class",`commit ${e.id} ${r}`),t.append("circle").attr("cx",i.x-3).attr("cy",i.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${r}`),t.append("circle").attr("cx",i.x+3).attr("cy",i.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${r}`),t.append("line").attr("x1",i.x+3).attr("y1",i.y+1).attr("x2",i.x).attr("y2",i.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${r}`),t.append("line").attr("x1",i.x-3).attr("y1",i.y+1).attr("x2",i.x).attr("y2",i.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${r}`);else{const a=t.append("circle");if(a.attr("cx",i.x),a.attr("cy",i.y),a.attr("r",e.type===Yg.MERGE?9:10),a.attr("class",`commit ${e.id} commit${s%8}`),n===Yg.MERGE){const n=t.append("circle");n.attr("cx",i.x),n.attr("cy",i.y),n.attr("r",6),n.attr("class",`commit ${r} ${e.id} commit${s%8}`)}if(n===Yg.REVERSE){t.append("path").attr("d",`M ${i.x-5},${i.y-5}L${i.x+5},${i.y+5}M${i.x-5},${i.y+5}L${i.x+5},${i.y-5}`).attr("class",`commit ${r} ${e.id} commit${s%8}`)}}}),"drawCommitBullet"),zy=we(((t,e,i,r)=>{var s;if(e.type!==Yg.CHERRY_PICK&&(e.customId&&e.type===Yg.MERGE||e.type!==Yg.MERGE)&&(null==Sy?void 0:Sy.showCommitLabel)){const n=t.append("g"),a=n.insert("rect").attr("class","commit-label-bkg"),o=n.append("text").attr("x",r).attr("y",i.y+25).attr("class","commit-label").text(e.id),l=null==(s=o.node())?void 0:s.getBBox();if(l&&(a.attr("x",i.posWithOffset-l.width/2-2).attr("y",i.y+13.5).attr("width",l.width+4).attr("height",l.height+4),"TB"===By||"BT"===By?(a.attr("x",i.x-(l.width+16+5)).attr("y",i.y-12),o.attr("x",i.x-(l.width+16)).attr("y",i.y+l.height-12)):o.attr("x",i.posWithOffset-l.width/2),Sy.rotateCommitLabel))if("TB"===By||"BT"===By)o.attr("transform","rotate(-45, "+i.x+", "+i.y+")"),a.attr("transform","rotate(-45, "+i.x+", "+i.y+")");else{const t=-7.5-(l.width+10)/25*9.5,e=10+l.width/25*8.5;n.attr("transform","translate("+t+", "+e+") rotate(-45, "+r+", "+i.y+")")}}}),"drawCommitLabel"),Wy=we(((t,e,i,r)=>{var s;if(e.tags.length>0){let n=0,a=0,o=0;const l=[];for(const r of e.tags.reverse()){const e=t.insert("polygon"),c=t.append("circle"),h=t.append("text").attr("y",i.y-16-n).attr("class","tag-label").text(r),d=null==(s=h.node())?void 0:s.getBBox();if(!d)throw new Error("Tag bbox not found");a=Math.max(a,d.width),o=Math.max(o,d.height),h.attr("x",i.posWithOffset-d.width/2),l.push({tag:h,hole:c,rect:e,yOffset:n}),n+=20}for(const{tag:t,hole:e,rect:s,yOffset:c}of l){const n=o/2,l=i.y-19.2-c;if(s.attr("class","tag-label-bkg").attr("points",`\n ${r-a/2-2},${l+2} \n ${r-a/2-2},${l-2}\n ${i.posWithOffset-a/2-4},${l-n-2}\n ${i.posWithOffset+a/2+4},${l-n-2}\n ${i.posWithOffset+a/2+4},${l+n+2}\n ${i.posWithOffset-a/2-4},${l+n+2}`),e.attr("cy",l).attr("cx",r-a/2+2).attr("r",1.5).attr("class","tag-hole"),"TB"===By||"BT"===By){const o=r+c;s.attr("class","tag-label-bkg").attr("points",`\n ${i.x},${o+2}\n ${i.x},${o-2}\n ${i.x+wy},${o-n-2}\n ${i.x+wy+a+4},${o-n-2}\n ${i.x+wy+a+4},${o+n+2}\n ${i.x+wy},${o+n+2}`).attr("transform","translate(12,12) rotate(45, "+i.x+","+r+")"),e.attr("cx",i.x+2).attr("cy",o).attr("transform","translate(12,12) rotate(45, "+i.x+","+r+")"),t.attr("x",i.x+5).attr("y",o+3).attr("transform","translate(14,14) rotate(45, "+i.x+","+r+")")}}}}),"drawCommitTags"),jy=we((t=>{switch(t.customType??t.type){case Yg.NORMAL:return"commit-normal";case Yg.REVERSE:return"commit-reverse";case Yg.HIGHLIGHT:return"commit-highlight";case Yg.MERGE:return"commit-merge";case Yg.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}}),"getCommitClassType"),Yy=we(((t,e,i,r)=>{const s={x:0,y:0};if(!(t.parents.length>0)){if("TB"===e)return 30;if("BT"===e){return(r.get(t.id)??s).y-Ty}return 0}{const i=Iy(t.parents);if(i){const n=r.get(i)??s;if("TB"===e)return n.y+Ty;if("BT"===e){return(r.get(t.id)??s).y-Ty}return n.x+Ty}}return 0}),"calculatePosition"),Uy=we(((t,e,i)=>{var r,s;const n="BT"===By&&i?e:e+wy,a="TB"===By||"BT"===By?n:null==(r=_y.get(t.branch))?void 0:r.pos,o="TB"===By||"BT"===By?null==(s=_y.get(t.branch))?void 0:s.pos:n;if(void 0===o||void 0===a)throw new Error(`Position were undefined for commit ${t.id}`);return{x:o,y:a,posWithOffset:n}}),"getCommitPosition"),Hy=we(((t,e,i)=>{if(!Sy)throw new Error("GitGraph config not found");const r=t.append("g").attr("class","commit-bullets"),s=t.append("g").attr("class","commit-labels");let n="TB"===By||"BT"===By?30:0;const a=[...e.keys()],o=(null==Sy?void 0:Sy.parallelCommits)??!1,l=we(((t,i)=>{var r,s;const n=null==(r=e.get(t))?void 0:r.seq,a=null==(s=e.get(i))?void 0:s.seq;return void 0!==n&&void 0!==a?n-a:0}),"sortKeys");let c=a.sort(l);"BT"===By&&(o&&Ny(c,e,n),c=c.reverse()),c.forEach((t=>{var a;const l=e.get(t);if(!l)throw new Error(`Commit not found for key ${t}`);o&&(n=Yy(l,By,n,vy));const c=Uy(l,n,o);if(i){const t=jy(l),e=l.customType??l.type,i=(null==(a=_y.get(l.branch))?void 0:a.index)??0;qy(r,l,c,t,i,e),zy(s,l,c,n),Wy(s,l,c,n)}"TB"===By||"BT"===By?vy.set(l.id,{x:c.x,y:c.posWithOffset}):vy.set(l.id,{x:c.posWithOffset,y:c.y}),n="BT"===By&&o?n+Ty:n+Ty+wy,n>Ly&&(Ly=n)}))}),"drawCommits"),Vy=we(((t,e,i,r,s)=>{const n=("TB"===By||"BT"===By?i.xt.branch===n),"isOnBranchToGetCurve"),o=we((i=>i.seq>t.seq&&i.seqo(t)&&a(t)))}),"shouldRerouteArrow"),Xy=we(((t,e,i=0)=>{const r=t+Math.abs(t-e)/2;if(i>5)return r;if(Ay.every((t=>Math.abs(t-r)>=10)))return Ay.push(r),r;const s=Math.abs(t-e);return Xy(t,e-s/5,i+1)}),"findLane"),Gy=we(((t,e,i,r)=>{var s,n,a,o,l;const c=vy.get(e.id),h=vy.get(i.id);if(void 0===c||void 0===h)throw new Error(`Commit positions not found for commits ${e.id} and ${i.id}`);const d=Vy(e,i,c,h,r);let u,p="",g="",y=0,f=0,m=null==(s=_y.get(i.branch))?void 0:s.index;if(i.type===Yg.MERGE&&e.id!==i.parents[0]&&(m=null==(n=_y.get(e.branch))?void 0:n.index),d){p="A 10 10, 0, 0, 0,",g="A 10 10, 0, 0, 1,",y=10,f=10;const t=c.yh.x&&(p="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",y=20,f=20,u=i.type===Yg.MERGE&&e.id!==i.parents[0]?`M ${c.x} ${c.y} L ${c.x} ${h.y-y} ${g} ${c.x-f} ${h.y} L ${h.x} ${h.y}`:`M ${c.x} ${c.y} L ${h.x+y} ${c.y} ${p} ${h.x} ${c.y+f} L ${h.x} ${h.y}`),c.x===h.x&&(u=`M ${c.x} ${c.y} L ${h.x} ${h.y}`)):"BT"===By?(c.xh.x&&(p="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",y=20,f=20,u=i.type===Yg.MERGE&&e.id!==i.parents[0]?`M ${c.x} ${c.y} L ${c.x} ${h.y+y} ${p} ${c.x-f} ${h.y} L ${h.x} ${h.y}`:`M ${c.x} ${c.y} L ${h.x-y} ${c.y} ${p} ${h.x} ${c.y-f} L ${h.x} ${h.y}`),c.x===h.x&&(u=`M ${c.x} ${c.y} L ${h.x} ${h.y}`)):(c.yh.y&&(u=i.type===Yg.MERGE&&e.id!==i.parents[0]?`M ${c.x} ${c.y} L ${h.x-y} ${c.y} ${p} ${h.x} ${c.y-f} L ${h.x} ${h.y}`:`M ${c.x} ${c.y} L ${c.x} ${h.y+y} ${g} ${c.x+f} ${h.y} L ${h.x} ${h.y}`),c.y===h.y&&(u=`M ${c.x} ${c.y} L ${h.x} ${h.y}`));if(void 0===u)throw new Error("Line definition not found");t.append("path").attr("d",u).attr("class","arrow arrow"+m%8)}),"drawArrow"),Ky=we(((t,e)=>{const i=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach((t=>{const r=e.get(t);r.parents&&r.parents.length>0&&r.parents.forEach((t=>{Gy(i,e.get(t),r,e)}))}))}),"drawArrows"),Qy=we(((t,e)=>{const i=t.append("g");e.forEach(((t,e)=>{var r;const s=e%8,n=null==(r=_y.get(t.name))?void 0:r.pos;if(void 0===n)throw new Error(`Position not found for branch ${t.name}`);const a=i.append("line");a.attr("x1",0),a.attr("y1",n),a.attr("x2",Ly),a.attr("y2",n),a.attr("class","branch branch"+s),"TB"===By?(a.attr("y1",30),a.attr("x1",n),a.attr("y2",Ly),a.attr("x2",n)):"BT"===By&&(a.attr("y1",Ly),a.attr("x1",n),a.attr("y2",30),a.attr("x2",n)),Ay.push(n);const o=t.name,l=Dy(o),c=i.insert("rect"),h=i.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+s);h.node().appendChild(l);const d=l.getBBox();c.attr("class","branchLabelBkg label"+s).attr("rx",4).attr("ry",4).attr("x",-d.width-4-(!0===(null==Sy?void 0:Sy.rotateCommitLabel)?30:0)).attr("y",-d.height/2+8).attr("width",d.width+18).attr("height",d.height+4),h.attr("transform","translate("+(-d.width-14-(!0===(null==Sy?void 0:Sy.rotateCommitLabel)?30:0))+", "+(n-d.height/2-1)+")"),"TB"===By?(c.attr("x",n-d.width/2-10).attr("y",0),h.attr("transform","translate("+(n-d.width/2-5)+", 0)")):"BT"===By?(c.attr("x",n-d.width/2-10).attr("y",Ly),h.attr("transform","translate("+(n-d.width/2-5)+", "+Ly+")")):c.attr("transform","translate(-19, "+(n-d.height/2)+")")}))}),"drawBranches"),Zy=we((function(t,e,i,r,s){return _y.set(t,{pos:e,index:i}),e+=50+(s?40:0)+("TB"===By||"BT"===By?r.width/2:0)}),"setBranchPosition"),Jy={parser:ky,db:uy,renderer:{draw:we((function(t,e,i,r){if($y(),ve.debug("in gitgraph renderer",t+"\n","id:",e,i),!Sy)throw new Error("GitGraph config not found");const s=Sy.rotateCommitLabel??!1,n=r.db;Ey=n.getCommits();const a=n.getBranchesAsObjArray();By=n.getDirection();const o=K(`[id="${e}"]`);let l=0;a.forEach(((t,e)=>{var i;const r=Dy(t.name),n=o.append("g"),a=n.insert("g").attr("class","branchLabel"),c=a.insert("g").attr("class","label branch-label");null==(i=c.node())||i.appendChild(r);const h=r.getBBox();l=Zy(t.name,l,e,h,s),c.remove(),a.remove(),n.remove()})),Hy(o,Ey,!1),Sy.showBranches&&Qy(o,a),Ky(o,Ey),Hy(o,Ey,!0),mo.insertTitle(o,"gitTitleText",Sy.titleTopMargin??0,n.getDiagramTitle()),Cr(void 0,o,Sy.diagramPadding,Sy.useMaxWidth)}),"draw")},styles:we((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`),"getStyles")};const tf=Object.defineProperty({__proto__:null,diagram:Jy},Symbol.toStringTag,{value:"Module"});var ef=function(){var t=we((function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i}),"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],i=[1,26],r=[1,27],s=[1,28],n=[1,29],a=[1,30],o=[1,31],l=[1,32],c=[1,33],h=[1,34],d=[1,9],u=[1,10],p=[1,11],g=[1,12],y=[1,13],f=[1,14],m=[1,15],x=[1,16],b=[1,19],k=[1,20],C=[1,21],S=[1,22],w=[1,23],T=[1,25],_=[1,35],v={trace:we((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:we((function(t,e,i,r,s,n,a){var o=n.length-1;switch(s){case 1:return n[o-1];case 2:case 6:case 7:this.$=[];break;case 3:n[o-1].push(n[o]),this.$=n[o-1];break;case 4:case 5:this.$=n[o];break;case 8:r.setWeekday("monday");break;case 9:r.setWeekday("tuesday");break;case 10:r.setWeekday("wednesday");break;case 11:r.setWeekday("thursday");break;case 12:r.setWeekday("friday");break;case 13:r.setWeekday("saturday");break;case 14:r.setWeekday("sunday");break;case 15:r.setWeekend("friday");break;case 16:r.setWeekend("saturday");break;case 17:r.setDateFormat(n[o].substr(11)),this.$=n[o].substr(11);break;case 18:r.enableInclusiveEndDates(),this.$=n[o].substr(18);break;case 19:r.TopAxis(),this.$=n[o].substr(8);break;case 20:r.setAxisFormat(n[o].substr(11)),this.$=n[o].substr(11);break;case 21:r.setTickInterval(n[o].substr(13)),this.$=n[o].substr(13);break;case 22:r.setExcludes(n[o].substr(9)),this.$=n[o].substr(9);break;case 23:r.setIncludes(n[o].substr(9)),this.$=n[o].substr(9);break;case 24:r.setTodayMarker(n[o].substr(12)),this.$=n[o].substr(12);break;case 27:r.setDiagramTitle(n[o].substr(6)),this.$=n[o].substr(6);break;case 28:this.$=n[o].trim(),r.setAccTitle(this.$);break;case 29:case 30:this.$=n[o].trim(),r.setAccDescription(this.$);break;case 31:r.addSection(n[o].substr(8)),this.$=n[o].substr(8);break;case 33:r.addTask(n[o-1],n[o]),this.$="task";break;case 34:this.$=n[o-1],r.setClickEvent(n[o-1],n[o],null);break;case 35:this.$=n[o-2],r.setClickEvent(n[o-2],n[o-1],n[o]);break;case 36:this.$=n[o-2],r.setClickEvent(n[o-2],n[o-1],null),r.setLink(n[o-2],n[o]);break;case 37:this.$=n[o-3],r.setClickEvent(n[o-3],n[o-2],n[o-1]),r.setLink(n[o-3],n[o]);break;case 38:this.$=n[o-2],r.setClickEvent(n[o-2],n[o],null),r.setLink(n[o-2],n[o-1]);break;case 39:this.$=n[o-3],r.setClickEvent(n[o-3],n[o-1],n[o]),r.setLink(n[o-3],n[o-2]);break;case 40:this.$=n[o-1],r.setLink(n[o-1],n[o]);break;case 41:case 47:this.$=n[o-1]+" "+n[o];break;case 42:case 43:case 45:this.$=n[o-2]+" "+n[o-1]+" "+n[o];break;case 44:case 46:this.$=n[o-3]+" "+n[o-2]+" "+n[o-1]+" "+n[o]}}),"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:i,13:r,14:s,15:n,16:a,17:o,18:l,19:18,20:c,21:h,22:d,23:u,24:p,25:g,26:y,27:f,28:m,29:x,30:b,31:k,33:C,35:S,36:w,37:24,38:T,40:_},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:i,13:r,14:s,15:n,16:a,17:o,18:l,19:18,20:c,21:h,22:d,23:u,24:p,25:g,26:y,27:f,28:m,29:x,30:b,31:k,33:C,35:S,36:w,37:24,38:T,40:_},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:we((function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)}),"parseError"),parse:we((function(t){var e=this,i=[0],r=[],s=[null],n=[],a=this.table,o="",l=0,c=0,h=n.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;n.push(g);var y=d.options&&d.options.ranges;function f(){var t;return"number"!=typeof(t=r.pop()||d.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,we((function(t){i.length=i.length-2*t,s.length=s.length-t,n.length=n.length-t}),"popStack"),we(f,"lex");for(var m,x,b,k,C,S,w,T,_={};;){if(x=i[i.length-1],this.defaultActions[x]?b=this.defaultActions[x]:(null==m&&(m=f()),b=a[x]&&a[x][m]),void 0===b||!b.length||!b[0]){var v="";for(C in T=[],a[x])this.terminals_[C]&&C>2&&T.push("'"+this.terminals_[C]+"'");v=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(v,{text:d.match,token:this.terminals_[m]||m,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: "+x+", token: "+m);switch(b[0]){case 1:i.push(m),s.push(d.yytext),n.push(d.yylloc),i.push(b[1]),m=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(S=this.productions_[b[1]][1],_.$=s[s.length-S],_._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},y&&(_._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(k=this.performAction.apply(_,[o,c,l,u.yy,b[1],s,n].concat(h))))return k;S&&(i=i.slice(0,-1*S*2),s=s.slice(0,-1*S),n=n.slice(0,-1*S)),i.push(this.productions_[b[1]][0]),s.push(_.$),n.push(_._$),w=a[i[i.length-2]][i[i.length-1]],i.push(w);break;case 3:return!0}}return!0}),"parse")},E=function(){return{EOF:1,parseError:we((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"), +// resets the lexer, sets new input +setInput:we((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}),"setInput"), +// consumes and returns one char from the input +input:we((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}),"input"), +// unshifts one char (or a string) into the input +unput:we((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 s=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=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"), +// When called from action, caches matched text and appends it on next action +more:we((function(){return this._more=!0,this}),"more"), +// 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:we((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})}),"reject"), +// retain first n characters of the match +less:we((function(t){this.unput(this.match.slice(t))}),"less"), +// displays already matched input, i.e. for error messages +pastInput:we((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"), +// displays upcoming input, i.e. for error messages +upcomingInput:we((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,"")}),"upcomingInput"), +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:we((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"), +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:we((function(t,e){var i,r,s;if(this.options.backtrack_lexer&&(s={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&&(s.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 n in s)this[n]=s[n];return!1}return!1}),"test_match"), +// return next match in input +next:we((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 s=this._currentRules(),n=0;ne[0].length)){if(e=i,r=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[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})}),"next"), +// return next match that has a token +lex:we((function(){var t=this.next();return t||this.lex()}),"lex"), +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:we((function(t){this.conditionStack.push(t)}),"begin"), +// pop the previously active lexer condition state off the condition stack +popState:we((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"), +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:we((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"), +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:we((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"), +// alias for begin(condition) +pushState:we((function(t){this.begin(t)}),"pushState"), +// return the number of states currently on the stack +stateStackSize:we((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:we((function(t,e,i,r){switch(i){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:case 15:case 18:case 21:case 24:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:case 9:case 10:case 12:case 13:break;case 11:return 10;case 14:this.begin("href");break;case 16:return 43;case 17:this.begin("callbackname");break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 22:return 42;case 23:this.begin("click");break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}}),"anonymous"),rules:[/^(?:%%\{)/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,/^(?: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,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/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:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,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],inclusive:!0}}}}();function A(){this.yy={}}return v.lexer=E,we(A,"Parser"),A.prototype=v,v.Parser=A,new A}();ef.parser=ef;var rf=ef;lt.extend(ct),lt.extend(ht),lt.extend(dt);var sf,nf,af={friday:5,saturday:6},of="",lf="",cf=void 0,hf="",df=[],uf=[],pf=new Map,gf=[],yf=[],ff="",mf="",xf=["active","done","crit","milestone"],bf=[],kf=!1,Cf=!1,Sf="sunday",wf="saturday",Tf=0,_f=we((function(){gf=[],yf=[],ff="",bf=[],rm=0,sf=void 0,nf=void 0,om=[],of="",lf="",mf="",cf=void 0,hf="",df=[],uf=[],kf=!1,Cf=!1,Tf=0,pf=new Map,lr(),Sf="sunday",wf="saturday"}),"clear"),vf=we((function(t){lf=t}),"setAxisFormat"),Ef=we((function(){return lf}),"getAxisFormat"),Af=we((function(t){cf=t}),"setTickInterval"),Lf=we((function(){return cf}),"getTickInterval"),Bf=we((function(t){hf=t}),"setTodayMarker"),$f=we((function(){return hf}),"getTodayMarker"),Df=we((function(t){of=t}),"setDateFormat"),If=we((function(){kf=!0}),"enableInclusiveEndDates"),Ff=we((function(){return kf}),"endDatesAreInclusive"),Nf=we((function(){Cf=!0}),"enableTopAxis"),Of=we((function(){return Cf}),"topAxisEnabled"),Mf=we((function(t){mf=t}),"setDisplayMode"),Rf=we((function(){return mf}),"getDisplayMode"),Pf=we((function(){return of}),"getDateFormat"),qf=we((function(t){df=t.toLowerCase().split(/[\s,]+/)}),"setIncludes"),zf=we((function(){return df}),"getIncludes"),Wf=we((function(t){uf=t.toLowerCase().split(/[\s,]+/)}),"setExcludes"),jf=we((function(){return uf}),"getExcludes"),Yf=we((function(){return pf}),"getLinks"),Uf=we((function(t){ff=t,gf.push(t)}),"addSection"),Hf=we((function(){return gf}),"getSections"),Vf=we((function(){let t=um();let e=0;for(;!t&&e<10;)t=um(),e++;return yf=om}),"getTasks"),Xf=we((function(t,e,i,r){return!r.includes(t.format(e.trim()))&&(!(!i.includes("weekends")||t.isoWeekday()!==af[wf]&&t.isoWeekday()!==af[wf]+1)||(!!i.includes(t.format("dddd").toLowerCase())||i.includes(t.format(e.trim()))))}),"isInvalidDate"),Gf=we((function(t){Sf=t}),"setWeekday"),Kf=we((function(){return Sf}),"getWeekday"),Qf=we((function(t){wf=t}),"setWeekend"),Zf=we((function(t,e,i,r){if(!i.length||t.manualEndTime)return;let s,n;s=t.startTime instanceof Date?lt(t.startTime):lt(t.startTime,e,!0),s=s.add(1,"d"),n=t.endTime instanceof Date?lt(t.endTime):lt(t.endTime,e,!0);const[a,o]=Jf(s,n,e,i,r);t.endTime=a.toDate(),t.renderEndTime=o}),"checkTaskDates"),Jf=we((function(t,e,i,r,s){let n=!1,a=null;for(;t<=e;)n||(a=e.toDate()),n=Xf(t,i,r,s),n&&(e=e.add(1,"d")),t=t.add(1,"d");return[e,a]}),"fixTaskDates"),tm=we((function(t,e,i){i=i.trim();const r=/^after\s+(?[\d\w- ]+)/.exec(i);if(null!==r){let t=null;for(const i of r.groups.ids.split(" ")){let e=hm(i);void 0!==e&&(!t||e.endTime>t.endTime)&&(t=e)}if(t)return t.endTime;const e=new Date;return e.setHours(0,0,0,0),e}let s=lt(i,e.trim(),!0);if(s.isValid())return s.toDate();{ve.debug("Invalid date:"+i),ve.debug("With date format:"+e.trim());const t=new Date(i);if(void 0===t||isNaN(t.getTime())||// WebKit browsers can mis-parse invalid dates to be ridiculously +// huge numbers, e.g. new Date('202304') gets parsed as January 1, 202304. +// This can cause virtually infinite loops while rendering, so for the +// purposes of Gantt charts we'll just treat any date beyond 10,000 AD/BC as +// invalid. +t.getFullYear()<-1e4||t.getFullYear()>1e4)throw new Error("Invalid date:"+i);return t}}),"getStartDate"),em=we((function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return null!==e?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]}),"parseDuration"),im=we((function(t,e,i,r=!1){i=i.trim();const s=/^until\s+(?[\d\w- ]+)/.exec(i);if(null!==s){let t=null;for(const i of s.groups.ids.split(" ")){let e=hm(i);void 0!==e&&(!t||e.startTime{window.open(i,"_self")})),pf.set(t,i))})),gm(t,"clickable")}),"setLink"),gm=we((function(t,e){t.split(",").forEach((function(t){let i=hm(t);void 0!==i&&i.classes.push(e)}))}),"setClass"),ym=we((function(t,e,i){if("loose"!==mr().securityLevel)return;if(void 0===e)return;let r=[];if("string"==typeof i){r=i.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t{mo.runFunc(e,...r)}))}),"setClickFun"),fm=we((function(t,e){bf.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()}))}))}),"pushFun"),mm=we((function(t,e,i){t.split(",").forEach((function(t){ym(t,e,i)})),gm(t,"clickable")}),"setClickEvent"),xm=we((function(t){bf.forEach((function(e){e(t)}))}),"bindFunctions"),bm={getConfig:we((()=>mr().gantt),"getConfig"),clear:_f,setDateFormat:Df,getDateFormat:Pf,enableInclusiveEndDates:If,endDatesAreInclusive:Ff,enableTopAxis:Nf,topAxisEnabled:Of,setAxisFormat:vf,getAxisFormat:Ef,setTickInterval:Af,getTickInterval:Lf,setTodayMarker:Bf,getTodayMarker:$f,setAccTitle:cr,getAccTitle:hr,setDiagramTitle:pr,getDiagramTitle:gr,setDisplayMode:Mf,getDisplayMode:Rf,setAccDescription:dr,getAccDescription:ur,addSection:Uf,getSections:Hf,getTasks:Vf,addTask:cm,findTaskById:hm,addTaskOrg:dm,setIncludes:qf,getIncludes:zf,setExcludes:Wf,getExcludes:jf,setClickEvent:mm,setLink:pm,getLinks:Yf,bindFunctions:xm,parseDuration:em,isInvalidDate:Xf,setWeekday:Gf,getWeekday:Kf,setWeekend:Qf};function km(t,e,i){let r=!0;for(;r;)r=!1,i.forEach((function(i){const s=new RegExp("^\\s*"+i+"\\s*$");t[0].match(s)&&(e[i]=!0,t.shift(1),r=!0)}))}we(km,"getTaskTags");var Cm,Sm=we((function(){ve.debug("Something is calling, setConf, remove the call")}),"setConf"),wm={monday:Lt,tuesday:At,wednesday:Et,thursday:vt,friday:_t,saturday:Tt,sunday:wt},Tm=we(((t,e)=>{let i=[...t].map((()=>-1/0)),r=[...t].sort(((t,e)=>t.startTime-e.startTime||t.order-e.order)),s=0;for(const n of r)for(let t=0;t=i[t]){i[t]=n.endTime,n.order=t+e,t>s&&(s=t);break}return s}),"getMaxIntersections"),_m={parser:rf,db:bm,renderer:{setConf:Sm,draw:we((function(t,e,i,r){const s=mr().gantt,n=mr().securityLevel;let a;"sandbox"===n&&(a=K("#i"+e));const o=K("sandbox"===n?a.nodes()[0].contentDocument.body:"body"),l="sandbox"===n?a.nodes()[0].contentDocument:document,c=l.getElementById(e);void 0===(Cm=c.parentElement.offsetWidth)&&(Cm=1200),void 0!==s.useWidth&&(Cm=s.useWidth);const h=r.db.getTasks();let d=[];for(const T of h)d.push(T.type);d=w(d);const u={};let p=2*s.topPadding;if("compact"===r.db.getDisplayMode()||"compact"===s.displayMode){const t={};for(const i of h)void 0===t[i.section]?t[i.section]=[i]:t[i.section].push(i);let e=0;for(const i of Object.keys(t)){const r=Tm(t[i],e)+1;e+=r,p+=r*(s.barHeight+s.barGap),u[i]=r}}else{p+=h.length*(s.barHeight+s.barGap);for(const t of d)u[t]=h.filter((e=>e.type===t)).length}c.setAttribute("viewBox","0 0 "+Cm+" "+p);const g=o.select(`[id="${e}"]`),y=ut().domain([ft(h,(function(t){return t.startTime})),mt(h,(function(t){return t.endTime}))]).rangeRound([0,Cm-s.leftPadding-s.rightPadding]);function f(t,e){const i=t.startTime,r=e.startTime;let s=0;return i>r?s=1:it.order)))].map((e=>t.find((t=>t.order===e))));g.append("g").selectAll("rect").data(h).enter().append("rect").attr("x",0).attr("y",(function(t,e){return t.order*i+n-2})).attr("width",(function(){return c-s.rightPadding/2})).attr("height",i).attr("class",(function(t){for(const[e,i]of d.entries())if(t.type===i)return"section section"+e%s.numberSectionStyles;return"section section0"}));const u=g.append("g").selectAll("rect").data(t).enter(),p=r.db.getLinks();u.append("rect").attr("id",(function(t){return t.id})).attr("rx",3).attr("ry",3).attr("x",(function(t){return t.milestone?y(t.startTime)+a+.5*(y(t.endTime)-y(t.startTime))-.5*o:y(t.startTime)+a})).attr("y",(function(t,e){return t.order*i+n})).attr("width",(function(t){return t.milestone?o:y(t.renderEndTime||t.endTime)-y(t.startTime)})).attr("height",o).attr("transform-origin",(function(t,e){return e=t.order,(y(t.startTime)+a+.5*(y(t.endTime)-y(t.startTime))).toString()+"px "+(e*i+n+.5*o).toString()+"px"})).attr("class",(function(t){let e="";t.classes.length>0&&(e=t.classes.join(" "));let i=0;for(const[n,a]of d.entries())t.type===a&&(i=n%s.numberSectionStyles);let r="";return t.active?t.crit?r+=" activeCrit":r=" active":t.done?r=t.crit?" doneCrit":" done":t.crit&&(r+=" crit"),0===r.length&&(r=" task"),t.milestone&&(r=" milestone "+r),r+=i,r+=" "+e,"task"+r})),u.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=y(t.startTime),i=y(t.renderEndTime||t.endTime);t.milestone&&(e+=.5*(y(t.endTime)-y(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,e){return t.order*i+s.barHeight/2+(s.fontSize/2-2)+n})).attr("text-height",o).attr("class",(function(t){const e=y(t.startTime);let i=y(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 d.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"===mr().securityLevel){let t;t=K("#i"+e);const i=t.nodes()[0].contentDocument;u.filter((function(t){return p.has(t.id)})).each((function(t){var e=i.querySelector("#"+t.id),r=i.querySelector("#"+t.id+"-text");const s=e.parentNode;var n=i.createElement("a");n.setAttribute("xlink:href",p.get(t.id)),n.setAttribute("target","_top"),s.appendChild(n),n.appendChild(e),n.appendChild(r)}))}}function b(t,e,i,n,a,o,l,c){if(0===l.length&&0===c.length)return;let h,d;for(const{startTime:r,endTime:s}of o)(void 0===h||rd)&&(d=s);if(!h||!d)return;if(lt(d).diff(lt(h),"year")>5)return void ve.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");const u=r.db.getDateFormat(),p=[];let f=null,m=lt(h);for(;m.valueOf()<=d;)r.db.isInvalidDate(m,u,l,c)?f?f.end=m:f={start:m,end:m}:f&&(p.push(f),f=null),m=m.add(1,"d");g.append("g").selectAll("rect").data(p).enter().append("rect").attr("id",(function(t){return"exclude-"+t.start.format("YYYY-MM-DD")})).attr("x",(function(t){return y(t.start)+i})).attr("y",s.gridLineStartPadding).attr("width",(function(t){const e=t.end.add(1,"day");return y(e)-y(t.start)})).attr("height",a-e-s.gridLineStartPadding).attr("transform-origin",(function(e,r){return(y(e.start)+i+.5*(y(e.end)-y(e.start))).toString()+"px "+(r*t+.5*a).toString()+"px"})).attr("class","exclude-range")}function k(t,e,i,n){let a=bt(y).tickSize(-n+e+s.gridLineStartPadding).tickFormat(Ct(r.db.getAxisFormat()||s.axisFormat||"%Y-%m-%d"));const o=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(r.db.getTickInterval()||s.tickInterval);if(null!==o){const t=o[1],e=o[2],i=r.db.getWeekday()||s.weekday;switch(e){case"millisecond":a.ticks(Ft.every(t));break;case"second":a.ticks(It.every(t));break;case"minute":a.ticks(Dt.every(t));break;case"hour":a.ticks($t.every(t));break;case"day":a.ticks(Bt.every(t));break;case"week":a.ticks(wm[i].every(t));break;case"month":a.ticks(St.every(t))}}if(g.append("g").attr("class","grid").attr("transform","translate("+t+", "+(n-50)+")").call(a).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),r.db.topAxisEnabled()||s.topAxis){let i=kt(y).tickSize(-n+e+s.gridLineStartPadding).tickFormat(Ct(r.db.getAxisFormat()||s.axisFormat||"%Y-%m-%d"));if(null!==o){const t=o[1],e=o[2],n=r.db.getWeekday()||s.weekday;switch(e){case"millisecond":i.ticks(Ft.every(t));break;case"second":i.ticks(It.every(t));break;case"minute":i.ticks(Dt.every(t));break;case"hour":i.ticks($t.every(t));break;case"day":i.ticks(Bt.every(t));break;case"week":i.ticks(wm[n].every(t));break;case"month":i.ticks(St.every(t))}}g.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)}}function C(t,e){let i=0;const r=Object.keys(u).map((t=>[t,u[t]]));g.append("g").selectAll("text").data(r).enter().append((function(t){const e=t[0].split(Xi.lineBreakRegex),i=-(e.length-1)/2,r=l.createElementNS("http://www.w3.org/2000/svg","text");r.setAttribute("dy",i+"em");for(const[s,n]of e.entries()){const t=l.createElementNS("http://www.w3.org/2000/svg","tspan");t.setAttribute("alignment-baseline","central"),t.setAttribute("x","10"),s>0&&t.setAttribute("dy","1em"),t.textContent=n,r.appendChild(t)}return r})).attr("x",10).attr("y",(function(s,n){if(!(n>0))return s[1]*t/2+e;for(let a=0;a`\n .mermaid-main-font {\n font-family: ${t.fontFamily};\n }\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-family: ${t.fontFamily};\n }\n\n\n /* Grid and axis */\n\n .grid .tick {\n stroke: ${t.gridColor};\n opacity: 0.8;\n shape-rendering: crispEdges;\n }\n\n .grid .tick text {\n font-family: ${t.fontFamily};\n fill: ${t.textColor};\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: ${t.fontFamily};\n }\n\n .taskTextOutsideRight {\n fill: ${t.taskTextDarkColor};\n text-anchor: start;\n font-family: ${t.fontFamily};\n }\n\n .taskTextOutsideLeft {\n fill: ${t.taskTextDarkColor};\n text-anchor: end;\n }\n\n\n /* Special case clickable */\n\n .task.clickable {\n cursor: pointer;\n }\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\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.titleColor||t.textColor};\n font-family: ${t.fontFamily};\n }\n`),"getStyles")};const vm=Object.defineProperty({__proto__:null,diagram:_m},Symbol.toStringTag,{value:"Module"});var Em={version:Bh},Am={parser:{parse:we((async t=>{const e=await q("info",t);ve.debug(e)}),"parse")},db:{getVersion:we((()=>Em.version),"getVersion")},renderer:{draw:we(((t,e,i)=>{ve.debug("rendering info diagram\n"+t);const r=$h(e);Qi(r,100,400,!0);r.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${i}`)}),"draw")}};const Lm=Object.defineProperty({__proto__:null,diagram:Am},Symbol.toStringTag,{value:"Module"});var Bm=ii.pie,$m={sections:new Map,showData:!1},Dm=$m.sections,Im=$m.showData,Fm=structuredClone(Bm),Nm={getConfig:we((()=>structuredClone(Fm)),"getConfig"),clear:we((()=>{Dm=new Map,Im=$m.showData,lr()}),"clear"),setDiagramTitle:pr,getDiagramTitle:gr,setAccTitle:cr,getAccTitle:hr,setAccDescription:dr,getAccDescription:ur,addSection:we((({label:t,value:e})=>{Dm.has(t)||(Dm.set(t,e),ve.debug(`added new section: ${t}, with value: ${e}`))}),"addSection"),getSections:we((()=>Dm),"getSections"),setShowData:we((t=>{Im=t}),"setShowData"),getShowData:we((()=>Im),"getShowData")},Om=we(((t,e)=>{Wg(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)}),"populateDb"),Mm={parse:we((async t=>{const e=await q("pie",t);ve.debug(e),Om(e,Nm)}),"parse")},Rm=we((t=>`\n .pieCircle{\n stroke: ${t.pieStrokeColor};\n stroke-width : ${t.pieStrokeWidth};\n opacity : ${t.pieOpacity};\n }\n .pieOuterCircle{\n stroke: ${t.pieOuterStrokeColor};\n stroke-width: ${t.pieOuterStrokeWidth};\n fill: none;\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`),"getStyles"),Pm=we((t=>{const e=[...t.entries()].map((t=>({label:t[0],value:t[1]}))).sort(((t,e)=>e.value-t.value));return re().value((t=>t.value))(e)}),"createPieArcs"),qm={parser:Mm,db:Nm,renderer:{draw:we(((t,e,i,r)=>{ve.debug("rendering pie chart\n"+t);const s=r.db,n=mr(),a=fo(s.getConfig(),n.pie),o=18,l=450,c=l,h=$h(e),d=h.append("g");d.attr("transform","translate(225,225)");const{themeVariables:u}=n;let[p]=yo(u.pieOuterStrokeWidth);p??(p=2);const g=a.textPosition,y=Math.min(c,l)/2-40,f=ie().innerRadius(0).outerRadius(y),m=ie().innerRadius(y*g).outerRadius(y*g);d.append("circle").attr("cx",0).attr("cy",0).attr("r",y+p/2).attr("class","pieOuterCircle");const x=s.getSections(),b=Pm(x),k=[u.pie1,u.pie2,u.pie3,u.pie4,u.pie5,u.pie6,u.pie7,u.pie8,u.pie9,u.pie10,u.pie11,u.pie12],C=gt(k);d.selectAll("mySlices").data(b).enter().append("path").attr("d",f).attr("fill",(t=>C(t.data.label))).attr("class","pieCircle");let S=0;x.forEach((t=>{S+=t})),d.selectAll("mySlices").data(b).enter().append("text").text((t=>(t.data.value/S*100).toFixed(0)+"%")).attr("transform",(t=>"translate("+m.centroid(t)+")")).style("text-anchor","middle").attr("class","slice"),d.append("text").text(s.getDiagramTitle()).attr("x",0).attr("y",-200).attr("class","pieTitleText");const w=d.selectAll(".legend").data(C.domain()).enter().append("g").attr("class","legend").attr("transform",((t,e)=>"translate(216,"+(22*e-22*C.domain().length/2)+")"));w.append("rect").attr("width",o).attr("height",o).style("fill",C).style("stroke",C),w.data(b).append("text").attr("x",22).attr("y",14).text((t=>{const{label:e,value:i}=t.data;return s.getShowData()?`${e} [${i}]`:e}));const T=512+Math.max(...w.selectAll("text").nodes().map((t=>(null==t?void 0:t.getBoundingClientRect().width)??0)));h.attr("viewBox",`0 0 ${T} 450`),Qi(h,l,T,a.useMaxWidth)}),"draw")},styles:Rm};const zm=Object.defineProperty({__proto__:null,diagram:qm},Symbol.toStringTag,{value:"Module"});var Wm=function(){var t=we((function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i}),"o"),e=[1,3],i=[1,4],r=[1,5],s=[1,6],n=[1,7],a=[1,4,5,10,12,13,14,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],o=[1,4,5,10,12,13,14,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],c=[2,36],h=[1,37],d=[1,36],u=[1,38],p=[1,35],g=[1,43],y=[1,41],f=[1,14],m=[1,23],x=[1,18],b=[1,19],k=[1,20],C=[1,21],S=[1,22],w=[1,24],T=[1,25],_=[1,26],v=[1,27],E=[1,28],A=[1,29],L=[1,32],B=[1,33],$=[1,34],D=[1,39],I=[1,40],F=[1,42],N=[1,44],O=[1,62],M=[1,61],R=[4,5,8,10,12,13,14,18,44,47,49,55,56,57,63,64,65,66,67],P=[1,65],q=[1,66],z=[1,67],W=[1,68],j=[1,69],Y=[1,70],U=[1,71],H=[1,72],V=[1,73],X=[1,74],G=[1,75],K=[1,76],Q=[4,5,6,7,8,9,10,11,12,13,14,15,18],Z=[1,90],J=[1,91],tt=[1,92],et=[1,99],it=[1,93],rt=[1,96],st=[1,94],nt=[1,95],at=[1,97],ot=[1,98],lt=[1,102],ct=[10,55,56,57],ht=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],dt={trace:we((function(){}),"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:we((function(t,e,i,r,s,n,a){var o=n.length-1;switch(s){case 23:case 68:this.$=n[o];break;case 24:case 69:this.$=n[o-1]+""+n[o];break;case 26:this.$=n[o-1]+n[o];break;case 27:this.$=[n[o].trim()];break;case 28:n[o-2].push(n[o].trim()),this.$=n[o-2];break;case 29:this.$=n[o-4],r.addClass(n[o-2],n[o]);break;case 37:this.$=[];break;case 42:this.$=n[o].trim(),r.setDiagramTitle(this.$);break;case 43:this.$=n[o].trim(),r.setAccTitle(this.$);break;case 44:case 45:this.$=n[o].trim(),r.setAccDescription(this.$);break;case 46:r.addSection(n[o].substr(8)),this.$=n[o].substr(8);break;case 47:r.addPoint(n[o-3],"",n[o-1],n[o],[]);break;case 48:r.addPoint(n[o-4],n[o-3],n[o-1],n[o],[]);break;case 49:r.addPoint(n[o-4],"",n[o-2],n[o-1],n[o]);break;case 50:r.addPoint(n[o-5],n[o-4],n[o-2],n[o-1],n[o]);break;case 51:r.setXAxisLeftText(n[o-2]),r.setXAxisRightText(n[o]);break;case 52:n[o-1].text+=" ⟶ ",r.setXAxisLeftText(n[o-1]);break;case 53:r.setXAxisLeftText(n[o]);break;case 54:r.setYAxisBottomText(n[o-2]),r.setYAxisTopText(n[o]);break;case 55:n[o-1].text+=" ⟶ ",r.setYAxisBottomText(n[o-1]);break;case 56:r.setYAxisBottomText(n[o]);break;case 57:r.setQuadrant1Text(n[o]);break;case 58:r.setQuadrant2Text(n[o]);break;case 59:r.setQuadrant3Text(n[o]);break;case 60:r.setQuadrant4Text(n[o]);break;case 64:case 66:this.$={text:n[o],type:"text"};break;case 65:this.$={text:n[o-1].text+""+n[o],type:n[o-1].type};break;case 67:this.$={text:n[o],type:"markdown"}}}),"anonymous"),table:[{18:e,26:1,27:2,28:i,55:r,56:s,57:n},{1:[3]},{18:e,26:8,27:2,28:i,55:r,56:s,57:n},{18:e,26:9,27:2,28:i,55:r,56:s,57:n},t(a,[2,33],{29:10}),t(o,[2,61]),t(o,[2,62]),t(o,[2,63]),{1:[2,30]},{1:[2,31]},t(l,c,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:h,5:d,10:u,12:p,13:g,14:y,18:f,25:m,35:x,37:b,39:k,41:C,42:S,48:w,50:T,51:_,52:v,53:E,54:A,60:L,61:B,63:$,64:D,65:I,66:F,67:N}),t(a,[2,34]),{27:45,55:r,56:s,57:n},t(l,[2,37]),t(l,c,{24:13,32:15,33:16,34:17,43:30,58:31,31:46,4:h,5:d,10:u,12:p,13:g,14:y,18:f,25:m,35:x,37:b,39:k,41:C,42:S,48:w,50:T,51:_,52:v,53:E,54:A,60:L,61:B,63:$,64:D,65:I,66:F,67:N}),t(l,[2,39]),t(l,[2,40]),t(l,[2,41]),{36:[1,47]},{38:[1,48]},{40:[1,49]},t(l,[2,45]),t(l,[2,46]),{18:[1,50]},{4:h,5:d,10:u,12:p,13:g,14:y,43:51,58:31,60:L,61:B,63:$,64:D,65:I,66:F,67:N},{4:h,5:d,10:u,12:p,13:g,14:y,43:52,58:31,60:L,61:B,63:$,64:D,65:I,66:F,67:N},{4:h,5:d,10:u,12:p,13:g,14:y,43:53,58:31,60:L,61:B,63:$,64:D,65:I,66:F,67:N},{4:h,5:d,10:u,12:p,13:g,14:y,43:54,58:31,60:L,61:B,63:$,64:D,65:I,66:F,67:N},{4:h,5:d,10:u,12:p,13:g,14:y,43:55,58:31,60:L,61:B,63:$,64:D,65:I,66:F,67:N},{4:h,5:d,10:u,12:p,13:g,14:y,43:56,58:31,60:L,61:B,63:$,64:D,65:I,66:F,67:N},{4:h,5:d,8:O,10:u,12:p,13:g,14:y,18:M,44:[1,57],47:[1,58],58:60,59:59,63:$,64:D,65:I,66:F,67:N},t(R,[2,64]),t(R,[2,66]),t(R,[2,67]),t(R,[2,70]),t(R,[2,71]),t(R,[2,72]),t(R,[2,73]),t(R,[2,74]),t(R,[2,75]),t(R,[2,76]),t(R,[2,77]),t(R,[2,78]),t(R,[2,79]),t(R,[2,80]),t(a,[2,35]),t(l,[2,38]),t(l,[2,42]),t(l,[2,43]),t(l,[2,44]),{3:64,4:P,5:q,6:z,7:W,8:j,9:Y,10:U,11:H,12:V,13:X,14:G,15:K,21:63},t(l,[2,53],{59:59,58:60,4:h,5:d,8:O,10:u,12:p,13:g,14:y,18:M,49:[1,77],63:$,64:D,65:I,66:F,67:N}),t(l,[2,56],{59:59,58:60,4:h,5:d,8:O,10:u,12:p,13:g,14:y,18:M,49:[1,78],63:$,64:D,65:I,66:F,67:N}),t(l,[2,57],{59:59,58:60,4:h,5:d,8:O,10:u,12:p,13:g,14:y,18:M,63:$,64:D,65:I,66:F,67:N}),t(l,[2,58],{59:59,58:60,4:h,5:d,8:O,10:u,12:p,13:g,14:y,18:M,63:$,64:D,65:I,66:F,67:N}),t(l,[2,59],{59:59,58:60,4:h,5:d,8:O,10:u,12:p,13:g,14:y,18:M,63:$,64:D,65:I,66:F,67:N}),t(l,[2,60],{59:59,58:60,4:h,5:d,8:O,10:u,12:p,13:g,14:y,18:M,63:$,64:D,65:I,66:F,67:N}),{45:[1,79]},{44:[1,80]},t(R,[2,65]),t(R,[2,81]),t(R,[2,82]),t(R,[2,83]),{3:82,4:P,5:q,6:z,7:W,8:j,9:Y,10:U,11:H,12:V,13:X,14:G,15:K,18:[1,81]},t(Q,[2,23]),t(Q,[2,1]),t(Q,[2,2]),t(Q,[2,3]),t(Q,[2,4]),t(Q,[2,5]),t(Q,[2,6]),t(Q,[2,7]),t(Q,[2,8]),t(Q,[2,9]),t(Q,[2,10]),t(Q,[2,11]),t(Q,[2,12]),t(l,[2,52],{58:31,43:83,4:h,5:d,10:u,12:p,13:g,14:y,60:L,61:B,63:$,64:D,65:I,66:F,67:N}),t(l,[2,55],{58:31,43:84,4:h,5:d,10:u,12:p,13:g,14:y,60:L,61:B,63:$,64:D,65:I,66:F,67:N}),{46:[1,85]},{45:[1,86]},{4:Z,5:J,6:tt,8:et,11:it,13:rt,16:89,17:st,18:nt,19:at,20:ot,22:88,23:87},t(Q,[2,24]),t(l,[2,51],{59:59,58:60,4:h,5:d,8:O,10:u,12:p,13:g,14:y,18:M,63:$,64:D,65:I,66:F,67:N}),t(l,[2,54],{59:59,58:60,4:h,5:d,8:O,10:u,12:p,13:g,14:y,18:M,63:$,64:D,65:I,66:F,67:N}),t(l,[2,47],{22:88,16:89,23:100,4:Z,5:J,6:tt,8:et,11:it,13:rt,17:st,18:nt,19:at,20:ot}),{46:[1,101]},t(l,[2,29],{10:lt}),t(ct,[2,27],{16:103,4:Z,5:J,6:tt,8:et,11:it,13:rt,17:st,18:nt,19:at,20:ot}),t(ht,[2,25]),t(ht,[2,13]),t(ht,[2,14]),t(ht,[2,15]),t(ht,[2,16]),t(ht,[2,17]),t(ht,[2,18]),t(ht,[2,19]),t(ht,[2,20]),t(ht,[2,21]),t(ht,[2,22]),t(l,[2,49],{10:lt}),t(l,[2,48],{22:88,16:89,23:104,4:Z,5:J,6:tt,8:et,11:it,13:rt,17:st,18:nt,19:at,20:ot}),{4:Z,5:J,6:tt,8:et,11:it,13:rt,16:89,17:st,18:nt,19:at,20:ot,22:105},t(ht,[2,26]),t(l,[2,50],{10:lt}),t(ct,[2,28],{16:103,4:Z,5:J,6:tt,8:et,11:it,13:rt,17:st,18:nt,19:at,20:ot})],defaultActions:{8:[2,30],9:[2,31]},parseError:we((function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)}),"parseError"),parse:we((function(t){var e=this,i=[0],r=[],s=[null],n=[],a=this.table,o="",l=0,c=0,h=n.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;n.push(g);var y=d.options&&d.options.ranges;function f(){var t;return"number"!=typeof(t=r.pop()||d.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,we((function(t){i.length=i.length-2*t,s.length=s.length-t,n.length=n.length-t}),"popStack"),we(f,"lex");for(var m,x,b,k,C,S,w,T,_={};;){if(x=i[i.length-1],this.defaultActions[x]?b=this.defaultActions[x]:(null==m&&(m=f()),b=a[x]&&a[x][m]),void 0===b||!b.length||!b[0]){var v="";for(C in T=[],a[x])this.terminals_[C]&&C>2&&T.push("'"+this.terminals_[C]+"'");v=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(v,{text:d.match,token:this.terminals_[m]||m,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: "+x+", token: "+m);switch(b[0]){case 1:i.push(m),s.push(d.yytext),n.push(d.yylloc),i.push(b[1]),m=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(S=this.productions_[b[1]][1],_.$=s[s.length-S],_._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},y&&(_._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(k=this.performAction.apply(_,[o,c,l,u.yy,b[1],s,n].concat(h))))return k;S&&(i=i.slice(0,-1*S*2),s=s.slice(0,-1*S),n=n.slice(0,-1*S)),i.push(this.productions_[b[1]][0]),s.push(_.$),n.push(_._$),w=a[i[i.length-2]][i[i.length-1]],i.push(w);break;case 3:return!0}}return!0}),"parse")},ut=function(){return{EOF:1,parseError:we((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"), +// resets the lexer, sets new input +setInput:we((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}),"setInput"), +// consumes and returns one char from the input +input:we((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}),"input"), +// unshifts one char (or a string) into the input +unput:we((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 s=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=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"), +// When called from action, caches matched text and appends it on next action +more:we((function(){return this._more=!0,this}),"more"), +// 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:we((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})}),"reject"), +// retain first n characters of the match +less:we((function(t){this.unput(this.match.slice(t))}),"less"), +// displays already matched input, i.e. for error messages +pastInput:we((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"), +// displays upcoming input, i.e. for error messages +upcomingInput:we((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,"")}),"upcomingInput"), +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:we((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"), +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:we((function(t,e){var i,r,s;if(this.options.backtrack_lexer&&(s={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&&(s.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 n in s)this[n]=s[n];return!1}return!1}),"test_match"), +// return next match in input +next:we((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 s=this._currentRules(),n=0;ne[0].length)){if(e=i,r=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[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})}),"next"), +// return next match that has a token +lex:we((function(){var t=this.next();return t||this.lex()}),"lex"), +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:we((function(t){this.conditionStack.push(t)}),"begin"), +// pop the previously active lexer condition state off the condition stack +popState:we((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"), +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:we((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"), +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:we((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"), +// alias for begin(condition) +pushState:we((function(t){this.begin(t)}),"pushState"), +// return the number of states currently on the stack +stateStackSize:we((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:we((function(t,e,i,r){switch(i){case 0:case 1:case 3:break;case 2:return 55;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:case 23:case 25:case 31:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 24:this.begin("string");break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 11;case 37:return 64;case 38:return 10;case 39:case 40:return 65;case 41:return 14;case 42:return 13;case 43:return 67;case 44:return 66;case 45:return 12;case 46:return 8;case 47:return 5;case 48:return 18;case 49:return 56;case 50:return 63;case 51:return 57}}),"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/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,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],inclusive:!0}}}}();function pt(){this.yy={}}return dt.lexer=ut,we(pt,"Parser"),pt.prototype=dt,dt.Parser=pt,new pt}();Wm.parser=Wm;var jm=Wm,Ym=Ve(),Um=(we(y=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){var t,e,i,r,s,n,a,o,l,c,h,d,u,p,g,y,f,m;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:(null==(t=ii.quadrantChart)?void 0:t.chartWidth)||500,chartWidth:(null==(e=ii.quadrantChart)?void 0:e.chartHeight)||500,titlePadding:(null==(i=ii.quadrantChart)?void 0:i.titlePadding)||10,titleFontSize:(null==(r=ii.quadrantChart)?void 0:r.titleFontSize)||20,quadrantPadding:(null==(s=ii.quadrantChart)?void 0:s.quadrantPadding)||5,xAxisLabelPadding:(null==(n=ii.quadrantChart)?void 0:n.xAxisLabelPadding)||5,yAxisLabelPadding:(null==(a=ii.quadrantChart)?void 0:a.yAxisLabelPadding)||5,xAxisLabelFontSize:(null==(o=ii.quadrantChart)?void 0:o.xAxisLabelFontSize)||16,yAxisLabelFontSize:(null==(l=ii.quadrantChart)?void 0:l.yAxisLabelFontSize)||16,quadrantLabelFontSize:(null==(c=ii.quadrantChart)?void 0:c.quadrantLabelFontSize)||16,quadrantTextTopPadding:(null==(h=ii.quadrantChart)?void 0:h.quadrantTextTopPadding)||5,pointTextPadding:(null==(d=ii.quadrantChart)?void 0:d.pointTextPadding)||5,pointLabelFontSize:(null==(u=ii.quadrantChart)?void 0:u.pointLabelFontSize)||12,pointRadius:(null==(p=ii.quadrantChart)?void 0:p.pointRadius)||5,xAxisPosition:(null==(g=ii.quadrantChart)?void 0:g.xAxisPosition)||"top",yAxisPosition:(null==(y=ii.quadrantChart)?void 0:y.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:(null==(f=ii.quadrantChart)?void 0:f.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:(null==(m=ii.quadrantChart)?void 0:m.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:Ym.quadrant1Fill,quadrant2Fill:Ym.quadrant2Fill,quadrant3Fill:Ym.quadrant3Fill,quadrant4Fill:Ym.quadrant4Fill,quadrant1TextFill:Ym.quadrant1TextFill,quadrant2TextFill:Ym.quadrant2TextFill,quadrant3TextFill:Ym.quadrant3TextFill,quadrant4TextFill:Ym.quadrant4TextFill,quadrantPointFill:Ym.quadrantPointFill,quadrantPointTextFill:Ym.quadrantPointTextFill,quadrantXAxisTextFill:Ym.quadrantXAxisTextFill,quadrantYAxisTextFill:Ym.quadrantYAxisTextFill,quadrantTitleFill:Ym.quadrantTitleFill,quadrantInternalBorderStrokeFill:Ym.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:Ym.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,ve.info("clear called")}setData(t){this.data={...this.data,...t}}addPoints(t){this.data.points=[...t,...this.data.points]}addClass(t,e){this.classes.set(t,e)}setConfig(t){ve.trace("setConfig called with: ",t),this.config={...this.config,...t}}setThemeConfig(t){ve.trace("setThemeConfig called with: ",t),this.themeConfig={...this.themeConfig,...t}}calculateSpace(t,e,i,r){const s=2*this.config.xAxisLabelPadding+this.config.xAxisLabelFontSize,n={top:"top"===t&&e?s:0,bottom:"bottom"===t&&e?s:0},a=2*this.config.yAxisLabelPadding+this.config.yAxisLabelFontSize,o={left:"left"===this.config.yAxisPosition&&i?a:0,right:"right"===this.config.yAxisPosition&&i?a:0},l=this.config.titleFontSize+2*this.config.titlePadding,c={top:r?l:0},h=this.config.quadrantPadding+o.left,d=this.config.quadrantPadding+n.top+c.top,u=this.config.chartWidth-2*this.config.quadrantPadding-o.left-o.right,p=this.config.chartHeight-2*this.config.quadrantPadding-n.top-n.bottom-c.top;return{xAxisSpace:n,yAxisSpace:o,titleSpace:c,quadrantSpace:{quadrantLeft:h,quadrantTop:d,quadrantWidth:u,quadrantHalfWidth:u/2,quadrantHeight:p,quadrantHalfHeight:p/2}}}getAxisLabels(t,e,i,r){const{quadrantSpace:s,titleSpace:n}=r,{quadrantHalfHeight:a,quadrantHeight:o,quadrantLeft:l,quadrantHalfWidth:c,quadrantTop:h,quadrantWidth:d}=s,u=Boolean(this.data.xAxisRightText),p=Boolean(this.data.yAxisTopText),g=[];return this.data.xAxisLeftText&&e&&g.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:l+(u?c/2:0),y:"top"===t?this.config.xAxisLabelPadding+n.top:this.config.xAxisLabelPadding+h+o+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:u?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&e&&g.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:l+c+(u?c/2:0),y:"top"===t?this.config.xAxisLabelPadding+n.top:this.config.xAxisLabelPadding+h+o+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:u?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&i&&g.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:"left"===this.config.yAxisPosition?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+l+d+this.config.quadrantPadding,y:h+o-(p?a/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&i&&g.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:"left"===this.config.yAxisPosition?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+l+d+this.config.quadrantPadding,y:h+a-(p?a/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:-90}),g}getQuadrants(t){const{quadrantSpace:e}=t,{quadrantHalfHeight:i,quadrantLeft:r,quadrantHalfWidth:s,quadrantTop:n}=e,a=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:r+s,y:n,width:s,height:i,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:r,y:n,width:s,height:i,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:r,y:n+i,width:s,height:i,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:r+s,y:n+i,width:s,height:i,fill:this.themeConfig.quadrant4Fill}];for(const o of a)o.text.x=o.x+o.width/2,0===this.data.points.length?(o.text.y=o.y+o.height/2,o.text.horizontalPos="middle"):(o.text.y=o.y+this.config.quadrantTextTopPadding,o.text.horizontalPos="top");return a}getQuadrantPoints(t){const{quadrantSpace:e}=t,{quadrantHeight:i,quadrantLeft:r,quadrantTop:s,quadrantWidth:n}=e,a=pt().domain([0,1]).range([r,n+r]),o=pt().domain([0,1]).range([i+s,s]);return this.data.points.map((t=>{const e=this.classes.get(t.className);e&&(t={...e,...t});return{x:a(t.x),y:o(t.y),fill:t.color??this.themeConfig.quadrantPointFill,radius:t.radius??this.config.pointRadius,text:{text:t.text,fill:this.themeConfig.quadrantPointTextFill,x:a(t.x),y:o(t.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:t.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:t.strokeWidth??"0px"}}))}getBorders(t){const e=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:i}=t,{quadrantHalfHeight:r,quadrantHeight:s,quadrantLeft:n,quadrantHalfWidth:a,quadrantTop:o,quadrantWidth:l}=i;return[ +// top border +{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:n-e,y1:o,x2:n+l+e,y2:o}, +// right border +{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:n+l,y1:o+e,x2:n+l,y2:o+s-e}, +// bottom border +{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:n-e,y1:o+s,x2:n+l+e,y2:o+s}, +// left border +{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:n,y1:o+e,x2:n,y2:o+s-e}, +// vertical inner border +{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:n+a,y1:o+e,x2:n+a,y2:o+s-e}, +// horizontal inner border +{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:n+e,y1:o+r,x2:n+l-e,y2:o+r}]}getTitle(t){if(t)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const t=this.config.showXAxis&&!(!this.data.xAxisLeftText&&!this.data.xAxisRightText),e=this.config.showYAxis&&!(!this.data.yAxisTopText&&!this.data.yAxisBottomText),i=this.config.showTitle&&!!this.data.titleText,r=this.data.points.length>0?"bottom":this.config.xAxisPosition,s=this.calculateSpace(r,t,e,i);return{points:this.getQuadrantPoints(s),quadrants:this.getQuadrants(s),axisLabels:this.getAxisLabels(r,t,e,s),borderLines:this.getBorders(s),title:this.getTitle(i)}}},"QuadrantBuilder"),y),Hm=(f=class extends Error{constructor(t,e,i){super(`value for ${t} ${e} is invalid, please use a valid ${i}`),this.name="InvalidStyleError"}},we(f,"InvalidStyleError"),f);function Vm(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}function Xm(t){return!/^\d+$/.test(t)}function Gm(t){return!/^\d+px$/.test(t)}we(Vm,"validateHexCode"),we(Xm,"validateNumber"),we(Gm,"validateSizeInPixels");var Km=mr();function Qm(t){return Li(t.trim(),Km)}we(Qm,"textSanitizer");var Zm=new Um;function Jm(t){Zm.setData({quadrant1Text:Qm(t.text)})}function tx(t){Zm.setData({quadrant2Text:Qm(t.text)})}function ex(t){Zm.setData({quadrant3Text:Qm(t.text)})}function ix(t){Zm.setData({quadrant4Text:Qm(t.text)})}function rx(t){Zm.setData({xAxisLeftText:Qm(t.text)})}function sx(t){Zm.setData({xAxisRightText:Qm(t.text)})}function nx(t){Zm.setData({yAxisTopText:Qm(t.text)})}function ax(t){Zm.setData({yAxisBottomText:Qm(t.text)})}function ox(t){const e={};for(const i of t){const[t,r]=i.trim().split(/\s*:\s*/);if("radius"===t){if(Xm(r))throw new Hm(t,r,"number");e.radius=parseInt(r)}else if("color"===t){if(Vm(r))throw new Hm(t,r,"hex code");e.color=r}else if("stroke-color"===t){if(Vm(r))throw new Hm(t,r,"hex code");e.strokeColor=r}else{if("stroke-width"!==t)throw new Error(`style named ${t} is not supported.`);if(Gm(r))throw new Hm(t,r,"number of pixels (eg. 10px)");e.strokeWidth=r}}return e}function lx(t,e,i,r,s){const n=ox(s);Zm.addPoints([{x:i,y:r,text:Qm(t.text),className:e,...n}])}function cx(t,e){Zm.addClass(t,ox(e))}function hx(t){Zm.setConfig({chartWidth:t})}function dx(t){Zm.setConfig({chartHeight:t})}function ux(){const t=mr(),{themeVariables:e,quadrantChart:i}=t;return i&&Zm.setConfig(i),Zm.setThemeConfig({quadrant1Fill:e.quadrant1Fill,quadrant2Fill:e.quadrant2Fill,quadrant3Fill:e.quadrant3Fill,quadrant4Fill:e.quadrant4Fill,quadrant1TextFill:e.quadrant1TextFill,quadrant2TextFill:e.quadrant2TextFill,quadrant3TextFill:e.quadrant3TextFill,quadrant4TextFill:e.quadrant4TextFill,quadrantPointFill:e.quadrantPointFill,quadrantPointTextFill:e.quadrantPointTextFill,quadrantXAxisTextFill:e.quadrantXAxisTextFill,quadrantYAxisTextFill:e.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:e.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:e.quadrantInternalBorderStrokeFill,quadrantTitleFill:e.quadrantTitleFill}),Zm.setData({titleText:gr()}),Zm.build()}we(Jm,"setQuadrant1Text"),we(tx,"setQuadrant2Text"),we(ex,"setQuadrant3Text"),we(ix,"setQuadrant4Text"),we(rx,"setXAxisLeftText"),we(sx,"setXAxisRightText"),we(nx,"setYAxisTopText"),we(ax,"setYAxisBottomText"),we(ox,"parseStyles"),we(lx,"addPoint"),we(cx,"addClass"),we(hx,"setWidth"),we(dx,"setHeight"),we(ux,"getQuadrantData");var px={parser:jm,db:{setWidth:hx,setHeight:dx,setQuadrant1Text:Jm,setQuadrant2Text:tx,setQuadrant3Text:ex,setQuadrant4Text:ix,setXAxisLeftText:rx,setXAxisRightText:sx,setYAxisTopText:nx,setYAxisBottomText:ax,parseStyles:ox,addPoint:lx,addClass:cx,getQuadrantData:ux,clear:we((function(){Zm.clear(),lr()}),"clear"),setAccTitle:cr,getAccTitle:hr,setDiagramTitle:pr,getDiagramTitle:gr,getAccDescription:ur,setAccDescription:dr},renderer:{draw:we(((t,e,i,r)=>{var s,n,a;function o(t){return"top"===t?"hanging":"middle"}function l(t){return"left"===t?"start":"middle"}function c(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}we(o,"getDominantBaseLine"),we(l,"getTextAnchor"),we(c,"getTransformation");const h=mr();ve.debug("Rendering quadrant chart\n"+t);const d=h.securityLevel;let u;"sandbox"===d&&(u=K("#i"+e));const p=K("sandbox"===d?u.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),g=p.append("g").attr("class","main"),y=(null==(s=h.quadrantChart)?void 0:s.chartWidth)??500,f=(null==(n=h.quadrantChart)?void 0:n.chartHeight)??500;Qi(p,f,y,(null==(a=h.quadrantChart)?void 0:a.useMaxWidth)??!0),p.attr("viewBox","0 0 "+y+" "+f),r.db.setHeight(f),r.db.setWidth(y);const m=r.db.getQuadrantData(),x=g.append("g").attr("class","quadrants"),b=g.append("g").attr("class","border"),k=g.append("g").attr("class","data-points"),C=g.append("g").attr("class","labels"),S=g.append("g").attr("class","title");m.title&&S.append("text").attr("x",0).attr("y",0).attr("fill",m.title.fill).attr("font-size",m.title.fontSize).attr("dominant-baseline",o(m.title.horizontalPos)).attr("text-anchor",l(m.title.verticalPos)).attr("transform",c(m.title)).text(m.title.text),m.borderLines&&b.selectAll("line").data(m.borderLines).enter().append("line").attr("x1",(t=>t.x1)).attr("y1",(t=>t.y1)).attr("x2",(t=>t.x2)).attr("y2",(t=>t.y2)).style("stroke",(t=>t.strokeFill)).style("stroke-width",(t=>t.strokeWidth));const w=x.selectAll("g.quadrant").data(m.quadrants).enter().append("g").attr("class","quadrant");w.append("rect").attr("x",(t=>t.x)).attr("y",(t=>t.y)).attr("width",(t=>t.width)).attr("height",(t=>t.height)).attr("fill",(t=>t.fill)),w.append("text").attr("x",0).attr("y",0).attr("fill",(t=>t.text.fill)).attr("font-size",(t=>t.text.fontSize)).attr("dominant-baseline",(t=>o(t.text.horizontalPos))).attr("text-anchor",(t=>l(t.text.verticalPos))).attr("transform",(t=>c(t.text))).text((t=>t.text.text));C.selectAll("g.label").data(m.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text((t=>t.text)).attr("fill",(t=>t.fill)).attr("font-size",(t=>t.fontSize)).attr("dominant-baseline",(t=>o(t.horizontalPos))).attr("text-anchor",(t=>l(t.verticalPos))).attr("transform",(t=>c(t)));const T=k.selectAll("g.data-point").data(m.points).enter().append("g").attr("class","data-point");T.append("circle").attr("cx",(t=>t.x)).attr("cy",(t=>t.y)).attr("r",(t=>t.radius)).attr("fill",(t=>t.fill)).attr("stroke",(t=>t.strokeColor)).attr("stroke-width",(t=>t.strokeWidth)),T.append("text").attr("x",0).attr("y",0).text((t=>t.text.text)).attr("fill",(t=>t.text.fill)).attr("font-size",(t=>t.text.fontSize)).attr("dominant-baseline",(t=>o(t.text.horizontalPos))).attr("text-anchor",(t=>l(t.text.verticalPos))).attr("transform",(t=>c(t.text)))}),"draw")},styles:we((()=>""),"styles")};const gx=Object.defineProperty({__proto__:null,diagram:px},Symbol.toStringTag,{value:"Module"});var yx=function(){var t=we((function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i}),"o"),e=[1,10,12,14,16,18,19,21,23],i=[2,6],r=[1,3],s=[1,5],n=[1,6],a=[1,7],o=[1,5,10,12,14,16,18,19,21,23,34,35,36],l=[1,25],c=[1,26],h=[1,28],d=[1,29],u=[1,30],p=[1,31],g=[1,32],y=[1,33],f=[1,34],m=[1,35],x=[1,36],b=[1,37],k=[1,43],C=[1,42],S=[1,47],w=[1,50],T=[1,10,12,14,16,18,19,21,23,34,35,36],_=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],v=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],E=[1,64],A={trace:we((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:we((function(t,e,i,r,s,n,a){var o=n.length-1;switch(s){case 5:r.setOrientation(n[o]);break;case 9:r.setDiagramTitle(n[o].text.trim());break;case 12:r.setLineData({text:"",type:"text"},n[o]);break;case 13:r.setLineData(n[o-1],n[o]);break;case 14:r.setBarData({text:"",type:"text"},n[o]);break;case 15:r.setBarData(n[o-1],n[o]);break;case 16:this.$=n[o].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=n[o].trim(),r.setAccDescription(this.$);break;case 19:case 27:this.$=n[o-1];break;case 20:this.$=[Number(n[o-2]),...n[o]];break;case 21:this.$=[Number(n[o])];break;case 22:r.setXAxisTitle(n[o]);break;case 23:r.setXAxisTitle(n[o-1]);break;case 24:r.setXAxisTitle({type:"text",text:""});break;case 25:r.setXAxisBand(n[o]);break;case 26:r.setXAxisRangeData(Number(n[o-2]),Number(n[o]));break;case 28:this.$=[n[o-2],...n[o]];break;case 29:this.$=[n[o]];break;case 30:r.setYAxisTitle(n[o]);break;case 31:r.setYAxisTitle(n[o-1]);break;case 32:r.setYAxisTitle({type:"text",text:""});break;case 33:r.setYAxisRangeData(Number(n[o-2]),Number(n[o]));break;case 37:case 38:this.$={text:n[o],type:"text"};break;case 39:this.$={text:n[o],type:"markdown"};break;case 40:this.$=n[o];break;case 41:this.$=n[o-1]+""+n[o]}}),"anonymous"),table:[t(e,i,{3:1,4:2,7:4,5:r,34:s,35:n,36:a}),{1:[3]},t(e,i,{4:2,7:4,3:8,5:r,34:s,35:n,36:a}),t(e,i,{4:2,7:4,6:9,3:10,5:r,8:[1,11],34:s,35:n,36:a}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(o,[2,34]),t(o,[2,35]),t(o,[2,36]),{1:[2,1]},t(e,i,{4:2,7:4,3:21,5:r,34:s,35:n,36:a}),{1:[2,3]},t(o,[2,5]),t(e,[2,7],{4:22,34:s,35:n,36:a}),{11:23,37:24,38:l,39:c,40:27,41:h,42:d,43:u,44:p,45:g,46:y,47:f,48:m,49:x,50:b},{11:39,13:38,24:k,27:C,29:40,30:41,37:24,38:l,39:c,40:27,41:h,42:d,43:u,44:p,45:g,46:y,47:f,48:m,49:x,50:b},{11:45,15:44,27:S,33:46,37:24,38:l,39:c,40:27,41:h,42:d,43:u,44:p,45:g,46:y,47:f,48:m,49:x,50:b},{11:49,17:48,24:w,37:24,38:l,39:c,40:27,41:h,42:d,43:u,44:p,45:g,46:y,47:f,48:m,49:x,50:b},{11:52,17:51,24:w,37:24,38:l,39:c,40:27,41:h,42:d,43:u,44:p,45:g,46:y,47:f,48:m,49:x,50:b},{20:[1,53]},{22:[1,54]},t(T,[2,18]),{1:[2,2]},t(T,[2,8]),t(T,[2,9]),t(_,[2,37],{40:55,41:h,42:d,43:u,44:p,45:g,46:y,47:f,48:m,49:x,50:b}),t(_,[2,38]),t(_,[2,39]),t(v,[2,40]),t(v,[2,42]),t(v,[2,43]),t(v,[2,44]),t(v,[2,45]),t(v,[2,46]),t(v,[2,47]),t(v,[2,48]),t(v,[2,49]),t(v,[2,50]),t(v,[2,51]),t(T,[2,10]),t(T,[2,22],{30:41,29:56,24:k,27:C}),t(T,[2,24]),t(T,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:l,39:c,40:27,41:h,42:d,43:u,44:p,45:g,46:y,47:f,48:m,49:x,50:b},t(T,[2,11]),t(T,[2,30],{33:60,27:S}),t(T,[2,32]),{31:[1,61]},t(T,[2,12]),{17:62,24:w},{25:63,27:E},t(T,[2,14]),{17:65,24:w},t(T,[2,16]),t(T,[2,17]),t(v,[2,41]),t(T,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(T,[2,31]),{27:[1,69]},t(T,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(T,[2,15]),t(T,[2,26]),t(T,[2,27]),{11:59,32:72,37:24,38:l,39:c,40:27,41:h,42:d,43:u,44:p,45:g,46:y,47:f,48:m,49:x,50:b},t(T,[2,33]),t(T,[2,19]),{25:73,27:E},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:we((function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)}),"parseError"),parse:we((function(t){var e=this,i=[0],r=[],s=[null],n=[],a=this.table,o="",l=0,c=0,h=n.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;n.push(g);var y=d.options&&d.options.ranges;function f(){var t;return"number"!=typeof(t=r.pop()||d.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,we((function(t){i.length=i.length-2*t,s.length=s.length-t,n.length=n.length-t}),"popStack"),we(f,"lex");for(var m,x,b,k,C,S,w,T,_={};;){if(x=i[i.length-1],this.defaultActions[x]?b=this.defaultActions[x]:(null==m&&(m=f()),b=a[x]&&a[x][m]),void 0===b||!b.length||!b[0]){var v="";for(C in T=[],a[x])this.terminals_[C]&&C>2&&T.push("'"+this.terminals_[C]+"'");v=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(v,{text:d.match,token:this.terminals_[m]||m,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: "+x+", token: "+m);switch(b[0]){case 1:i.push(m),s.push(d.yytext),n.push(d.yylloc),i.push(b[1]),m=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(S=this.productions_[b[1]][1],_.$=s[s.length-S],_._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},y&&(_._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(k=this.performAction.apply(_,[o,c,l,u.yy,b[1],s,n].concat(h))))return k;S&&(i=i.slice(0,-1*S*2),s=s.slice(0,-1*S),n=n.slice(0,-1*S)),i.push(this.productions_[b[1]][0]),s.push(_.$),n.push(_._$),w=a[i[i.length-2]][i[i.length-1]],i.push(w);break;case 3:return!0}}return!0}),"parse")},L=function(){return{EOF:1,parseError:we((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"), +// resets the lexer, sets new input +setInput:we((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}),"setInput"), +// consumes and returns one char from the input +input:we((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}),"input"), +// unshifts one char (or a string) into the input +unput:we((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 s=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=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"), +// When called from action, caches matched text and appends it on next action +more:we((function(){return this._more=!0,this}),"more"), +// 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:we((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})}),"reject"), +// retain first n characters of the match +less:we((function(t){this.unput(this.match.slice(t))}),"less"), +// displays already matched input, i.e. for error messages +pastInput:we((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"), +// displays upcoming input, i.e. for error messages +upcomingInput:we((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,"")}),"upcomingInput"), +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:we((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"), +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:we((function(t,e){var i,r,s;if(this.options.backtrack_lexer&&(s={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&&(s.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 n in s)this[n]=s[n];return!1}return!1}),"test_match"), +// return next match in input +next:we((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 s=this._currentRules(),n=0;ne[0].length)){if(e=i,r=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[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})}),"next"), +// return next match that has a token +lex:we((function(){var t=this.next();return t||this.lex()}),"lex"), +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:we((function(t){this.conditionStack.push(t)}),"begin"), +// pop the previously active lexer condition state off the condition stack +popState:we((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"), +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:we((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"), +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:we((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"), +// alias for begin(condition) +pushState:we((function(t){this.begin(t)}),"pushState"), +// return the number of states currently on the stack +stateStackSize:we((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:we((function(t,e,i,r){switch(i){case 0:case 1:case 5:case 43:break;case 2:case 3:return this.popState(),34;case 4:return 34;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:case 25:case 27:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 8;case 16:return this.pushState("axis_data"),"X_AXIS";case 17:return this.pushState("axis_data"),"Y_AXIS";case 18:return this.pushState("axis_band_data"),24;case 19:return 31;case 20:return this.pushState("data"),16;case 21:return this.pushState("data"),18;case 22:return this.pushState("data_inner"),24;case 23:return 27;case 24:return this.popState(),26;case 26:this.pushState("string");break;case 28:return"STR";case 29:return 24;case 30:return 26;case 31:return 43;case 32:return"COLON";case 33:return 44;case 34:return 28;case 35:return 45;case 36:return 46;case 37:return 48;case 38:return 50;case 39:return 47;case 40:return 41;case 41:return 49;case 42:return 42;case 44:return 35;case 45:return 36}}),"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\{)/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,23,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,20,21,22,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,23,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[27,28],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0}}}}();function B(){this.yy={}}return A.lexer=L,we(B,"Parser"),B.prototype=A,A.Parser=B,new B}();yx.parser=yx;var fx=yx;function mx(t){return"bar"===t.type}function xx(t){return"band"===t.type}function bx(t){return"linear"===t.type}we(mx,"isBarPlot"),we(xx,"isBandAxisData"),we(bx,"isLinearAxisData");var kx=(we(m=class{constructor(t){this.parentGroup=t}getMaxDimension(t,e){if(!this.parentGroup)return{width:t.reduce(((t,e)=>Math.max(e.length,t)),0)*e,height:e};const i={width:0,height:0},r=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",e);for(const s of t){const t=Fo(r,1,s),n=t?t.width:s.length*e,a=t?t.height:e;i.width=Math.max(i.width,n),i.height=Math.max(i.height,a)}return r.remove(),i}},"TextDimensionCalculatorWithFont"),m),Cx=(we(x=class{constructor(t,e,i,r){this.axisConfig=t,this.title=e,this.textDimensionCalculator=i,this.axisThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}setRange(t){this.range=t,"left"===this.axisPosition||"right"===this.axisPosition?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map((t=>t.toString())),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){.7*this.getTickDistance()>2*this.outerPadding&&(this.outerPadding=Math.floor(.7*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let e=t.height;if(this.axisConfig.showAxisLine&&e>this.axisConfig.axisLineWidth&&(e-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const i=this.getLabelDimension(),r=.2*t.width;this.outerPadding=Math.min(i.width/2,r);const s=i.height+2*this.axisConfig.labelPadding;this.labelTextHeight=i.height,s<=e&&(e-=s,this.showLabel=!0)}if(this.axisConfig.showTick&&e>=this.axisConfig.tickLength&&(this.showTick=!0,e-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,i<=e&&(e-=i,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-e}calculateSpaceIfDrawnVertical(t){let e=t.width;if(this.axisConfig.showAxisLine&&e>this.axisConfig.axisLineWidth&&(e-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const i=this.getLabelDimension(),r=.2*t.height;this.outerPadding=Math.min(i.height/2,r);const s=i.width+2*this.axisConfig.labelPadding;s<=e&&(e-=s,this.showLabel=!0)}if(this.axisConfig.showTick&&e>=this.axisConfig.tickLength&&(this.showTick=!0,e-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,i<=e&&(e-=i,this.showTitle=!0)}this.boundingRect.width=t.width-e,this.boundingRect.height=t.height}calculateSpace(t){return"left"===this.axisPosition||"right"===this.axisPosition?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const e=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${e},${this.boundingRect.y} L ${e},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map((t=>({text:t.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(t),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"})))}),this.showTick){const e=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map((t=>({path:`M ${e},${this.getScaleValue(t)} L ${e-this.axisConfig.tickLength},${this.getScaleValue(t)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth})))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const e=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${e} L ${this.boundingRect.x+this.boundingRect.width},${e}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map((t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"})))}),this.showTick){const e=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map((t=>({path:`M ${this.getScaleValue(t)},${e} L ${this.getScaleValue(t)},${e+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth})))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const e=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${e} L ${this.boundingRect.x+this.boundingRect.width},${e}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map((t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+2*this.axisConfig.titlePadding:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"})))}),this.showTick){const e=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map((t=>({path:`M ${this.getScaleValue(t)},${e+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(t)},${e+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth})))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if("left"===this.axisPosition)return this.getDrawableElementsForLeftAxis();if("right"===this.axisPosition)throw Error("Drawing of right axis is not implemented");return"bottom"===this.axisPosition?this.getDrawableElementsForBottomAxis():"top"===this.axisPosition?this.getDrawableElementsForTopAxis():[]}},"BaseAxis"),x),Sx=(we(b=class extends Cx{constructor(t,e,i,r,s){super(t,r,s,e),this.categories=i,this.scale=yt().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=yt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),ve.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},"BandAxis"),b),wx=(we(k=class extends Cx{constructor(t,e,i,r,s){super(t,r,s,e),this.domain=i,this.scale=pt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];"left"===this.axisPosition&&t.reverse(),this.scale=pt().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},"LinearAxis"),k);function Tx(t,e,i,r){const s=new kx(r);return xx(t)?new Sx(e,i,t.categories,t.title,s):new wx(e,i,[t.min,t.max],t.title,s)}we(Tx,"getAxis");var _x=(we(C=class{constructor(t,e,i,r){this.textDimensionCalculator=t,this.chartConfig=e,this.chartData=i,this.chartThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const e=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),i=Math.max(e.width,t.width),r=e.height+2*this.chartConfig.titlePadding;return e.width<=i&&e.height<=r&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=i,this.boundingRect.height=r,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}},"ChartTitle"),C);function vx(t,e,i,r){const s=new kx(r);return new _x(s,t,e,i)}we(vx,"getChartTitleComponent");var Ex=(we(S=class{constructor(t,e,i,r,s){this.plotData=t,this.xAxis=e,this.yAxis=i,this.orientation=r,this.plotIndex=s}getDrawableElement(){const t=this.plotData.data.map((t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]));let e;return e="horizontal"===this.orientation?ee().y((t=>t[0])).x((t=>t[1]))(t):ee().x((t=>t[0])).y((t=>t[1]))(t),e?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:e,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},"LinePlot"),S),Ax=(we(w=class{constructor(t,e,i,r,s,n){this.barData=t,this.boundingRect=e,this.xAxis=i,this.yAxis=r,this.orientation=s,this.plotIndex=n}getDrawableElement(){const t=this.barData.data.map((t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])])),e=.95*Math.min(2*this.xAxis.getAxisOuterPadding(),this.xAxis.getTickDistance()),i=e/2;return"horizontal"===this.orientation?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map((t=>({x:this.boundingRect.x,y:t[0]-i,height:e,width:t[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill})))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map((t=>({x:t[0]-i,y:t[1],width:e,height:this.boundingRect.y+this.boundingRect.height-t[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill})))}]}},"BarPlot"),w),Lx=(we(T=class{constructor(t,e,i){this.chartConfig=t,this.chartData=e,this.chartThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(t,e){this.xAxis=t,this.yAxis=e}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!this.xAxis||!this.yAxis)throw Error("Axes must be passed to render Plots");const t=[];for(const[e,i]of this.chartData.plots.entries())switch(i.type){case"line":{const r=new Ex(i,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,e);t.push(...r.getDrawableElement())}break;case"bar":{const r=new Ax(i,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,e);t.push(...r.getDrawableElement())}}return t}},"BasePlot"),T);function Bx(t,e,i){return new Lx(t,e,i)}we(Bx,"getPlotComponent");var $x,Dx=(we(_=class{constructor(t,e,i,r){this.chartConfig=t,this.chartData=e,this.componentStore={title:vx(t,e,i,r),plot:Bx(t,e,i),xAxis:Tx(e.xAxis,t.xAxis,{titleColor:i.xAxisTitleColor,labelColor:i.xAxisLabelColor,tickColor:i.xAxisTickColor,axisLineColor:i.xAxisLineColor},r),yAxis:Tx(e.yAxis,t.yAxis,{titleColor:i.yAxisTitleColor,labelColor:i.yAxisLabelColor,tickColor:i.yAxisTickColor,axisLineColor:i.yAxisLineColor},r)}}calculateVerticalSpace(){let t=this.chartConfig.width,e=this.chartConfig.height,i=0,r=0,s=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),n=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),a=this.componentStore.plot.calculateSpace({width:s,height:n});t-=a.width,e-=a.height,a=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:e}),r=a.height,e-=a.height,this.componentStore.xAxis.setAxisPosition("bottom"),a=this.componentStore.xAxis.calculateSpace({width:t,height:e}),e-=a.height,this.componentStore.yAxis.setAxisPosition("left"),a=this.componentStore.yAxis.calculateSpace({width:t,height:e}),i=a.width,t-=a.width,t>0&&(s+=t,t=0),e>0&&(n+=e,e=0),this.componentStore.plot.calculateSpace({width:s,height:n}),this.componentStore.plot.setBoundingBoxXY({x:i,y:r}),this.componentStore.xAxis.setRange([i,i+s]),this.componentStore.xAxis.setBoundingBoxXY({x:i,y:r+n}),this.componentStore.yAxis.setRange([r,r+n]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:r}),this.chartData.plots.some((t=>mx(t)))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,e=this.chartConfig.height,i=0,r=0,s=0,n=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:n,height:a});t-=o.width,e-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:e}),i=o.height,e-=o.height,this.componentStore.xAxis.setAxisPosition("left"),o=this.componentStore.xAxis.calculateSpace({width:t,height:e}),t-=o.width,r=o.width,this.componentStore.yAxis.setAxisPosition("top"),o=this.componentStore.yAxis.calculateSpace({width:t,height:e}),e-=o.height,s=i+o.height,t>0&&(n+=t,t=0),e>0&&(a+=e,e=0),this.componentStore.plot.calculateSpace({width:n,height:a}),this.componentStore.plot.setBoundingBoxXY({x:r,y:s}),this.componentStore.yAxis.setRange([r,r+n]),this.componentStore.yAxis.setBoundingBoxXY({x:r,y:i}),this.componentStore.xAxis.setRange([s,s+a]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:s}),this.chartData.plots.some((t=>mx(t)))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){"horizontal"===this.chartConfig.chartOrientation?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const e of Object.values(this.componentStore))t.push(...e.getDrawableElements());return t}},"Orchestrator"),_),Ix=(we(v=class{static build(t,e,i,r){return new Dx(t,e,i,r).getDrawableElement()}},"XYChartBuilder"),v),Fx=0,Nx=Wx(),Ox=zx(),Mx=jx(),Rx=Ox.plotColorPalette.split(",").map((t=>t.trim())),Px=!1,qx=!1;function zx(){const t=Ve(),e=yi();return fo(t.xyChart,e.themeVariables.xyChart)}function Wx(){const t=yi();return fo(ii.xyChart,t.xyChart)}function jx(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function Yx(t){const e=yi();return Li(t.trim(),e)}function Ux(t){$x=t}function Hx(t){Nx.chartOrientation="horizontal"===t?"horizontal":"vertical"}function Vx(t){Mx.xAxis.title=Yx(t.text)}function Xx(t,e){Mx.xAxis={type:"linear",title:Mx.xAxis.title,min:t,max:e},Px=!0}function Gx(t){Mx.xAxis={type:"band",title:Mx.xAxis.title,categories:t.map((t=>Yx(t.text)))},Px=!0}function Kx(t){Mx.yAxis.title=Yx(t.text)}function Qx(t,e){Mx.yAxis={type:"linear",title:Mx.yAxis.title,min:t,max:e},qx=!0}function Zx(t){const e=Math.min(...t),i=Math.max(...t),r=bx(Mx.yAxis)?Mx.yAxis.min:1/0,s=bx(Mx.yAxis)?Mx.yAxis.max:-1/0;Mx.yAxis={type:"linear",title:Mx.yAxis.title,min:Math.min(r,e),max:Math.max(s,i)}}function Jx(t){let e=[];if(0===t.length)return e;if(!Px){const e=bx(Mx.xAxis)?Mx.xAxis.min:1/0,i=bx(Mx.xAxis)?Mx.xAxis.max:-1/0;Xx(Math.min(e,1),Math.max(i,t.length))}if(qx||Zx(t),xx(Mx.xAxis)&&(e=Mx.xAxis.categories.map(((e,i)=>[e,t[i]]))),bx(Mx.xAxis)){const i=Mx.xAxis.min,r=Mx.xAxis.max,s=(r-i)/(t.length-1),n=[];for(let t=i;t<=r;t+=s)n.push(`${t}`);e=n.map(((e,i)=>[e,t[i]]))}return e}function tb(t){return Rx[0===t?0:t%Rx.length]}function eb(t,e){const i=Jx(e);Mx.plots.push({type:"line",strokeFill:tb(Fx),strokeWidth:2,data:i}),Fx++}function ib(t,e){const i=Jx(e);Mx.plots.push({type:"bar",fill:tb(Fx),data:i}),Fx++}function rb(){if(0===Mx.plots.length)throw Error("No Plot to render, please provide a plot with some data");return Mx.title=gr(),Ix.build(Nx,Mx,Ox,$x)}function sb(){return Ox}function nb(){return Nx}we(zx,"getChartDefaultThemeConfig"),we(Wx,"getChartDefaultConfig"),we(jx,"getChartDefaultData"),we(Yx,"textSanitizer"),we(Ux,"setTmpSVGG"),we(Hx,"setOrientation"),we(Vx,"setXAxisTitle"),we(Xx,"setXAxisRangeData"),we(Gx,"setXAxisBand"),we(Kx,"setYAxisTitle"),we(Qx,"setYAxisRangeData"),we(Zx,"setYAxisRangeFromPlotData"),we(Jx,"transformDataWithoutCategory"),we(tb,"getPlotColorFromPalette"),we(eb,"setLineData"),we(ib,"setBarData"),we(rb,"getDrawableElem"),we(sb,"getChartThemeConfig"),we(nb,"getChartConfig");var ab={parser:fx,db:{getDrawableElem:rb,clear:we((function(){lr(),Fx=0,Nx=Wx(),Mx={yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]},Ox=zx(),Rx=Ox.plotColorPalette.split(",").map((t=>t.trim())),Px=!1,qx=!1}),"clear"),setAccTitle:cr,getAccTitle:hr,setDiagramTitle:pr,getDiagramTitle:gr,getAccDescription:ur,setAccDescription:dr,setOrientation:Hx,setXAxisTitle:Vx,setXAxisRangeData:Xx,setXAxisBand:Gx,setYAxisTitle:Kx,setYAxisRangeData:Qx,setLineData:eb,setBarData:ib,setTmpSVGG:Ux,getChartThemeConfig:sb,getChartConfig:nb},renderer:{draw:we(((t,e,i,r)=>{const s=r.db,n=s.getChartThemeConfig(),a=s.getChartConfig();function o(t){return"top"===t?"text-before-edge":"middle"}function l(t){return"left"===t?"start":"right"===t?"end":"middle"}function c(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}we(o,"getDominantBaseLine"),we(l,"getTextAnchor"),we(c,"getTextTransformation"),ve.debug("Rendering xychart chart\n"+t);const h=$h(e),d=h.append("g").attr("class","main"),u=d.append("rect").attr("width",a.width).attr("height",a.height).attr("class","background");Qi(h,a.height,a.width,!0),h.attr("viewBox",`0 0 ${a.width} ${a.height}`),u.attr("fill",n.backgroundColor),s.setTmpSVGG(h.append("g").attr("class","mermaid-tmp-group"));const p=s.getDrawableElem(),g={};function y(t){let e=d,i="";for(const[r]of t.entries()){let s=d;r>0&&g[i]&&(s=g[i]),i+=t[r],e=g[i],e||(e=g[i]=s.append("g").attr("class",t[r]))}return e}we(y,"getGroup");for(const f of p){if(0===f.data.length)continue;const t=y(f.groupTexts);switch(f.type){case"rect":t.selectAll("rect").data(f.data).enter().append("rect").attr("x",(t=>t.x)).attr("y",(t=>t.y)).attr("width",(t=>t.width)).attr("height",(t=>t.height)).attr("fill",(t=>t.fill)).attr("stroke",(t=>t.strokeFill)).attr("stroke-width",(t=>t.strokeWidth));break;case"text":t.selectAll("text").data(f.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",(t=>t.fill)).attr("font-size",(t=>t.fontSize)).attr("dominant-baseline",(t=>o(t.verticalPos))).attr("text-anchor",(t=>l(t.horizontalPos))).attr("transform",(t=>c(t))).text((t=>t.text));break;case"path":t.selectAll("path").data(f.data).enter().append("path").attr("d",(t=>t.path)).attr("fill",(t=>t.fill?t.fill:"none")).attr("stroke",(t=>t.strokeFill)).attr("stroke-width",(t=>t.strokeWidth))}}}),"draw")}};const ob=Object.defineProperty({__proto__:null,diagram:ab},Symbol.toStringTag,{value:"Module"});var lb=function(){var t=we((function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i}),"o"),e=[1,3],i=[1,4],r=[1,5],s=[1,6],n=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],a=[1,22],o=[2,7],l=[1,26],c=[1,27],h=[1,28],d=[1,29],u=[1,33],p=[1,34],g=[1,35],y=[1,36],f=[1,37],m=[1,38],x=[1,24],b=[1,31],k=[1,32],C=[1,30],S=[1,39],w=[1,40],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],_=[1,61],v=[89,90],E=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],A=[27,29],L=[1,70],B=[1,71],$=[1,72],D=[1,73],I=[1,74],F=[1,75],N=[1,76],O=[1,83],M=[1,80],R=[1,84],P=[1,85],q=[1,86],z=[1,87],W=[1,88],j=[1,89],Y=[1,90],U=[1,91],H=[1,92],V=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],X=[63,64],G=[1,101],K=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],Q=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Z=[1,110],J=[1,106],tt=[1,107],et=[1,108],it=[1,109],rt=[1,111],st=[1,116],nt=[1,117],at=[1,114],ot=[1,115],lt={trace:we((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType: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:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:we((function(t,e,i,r,s,n,a){var o=n.length-1;switch(s){case 4:this.$=n[o].trim(),r.setAccTitle(this.$);break;case 5:case 6:this.$=n[o].trim(),r.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:r.setDirection("TB");break;case 18:r.setDirection("BT");break;case 19:r.setDirection("RL");break;case 20:r.setDirection("LR");break;case 21:r.addRequirement(n[o-3],n[o-4]);break;case 22:r.addRequirement(n[o-5],n[o-6]),r.setClass([n[o-5]],n[o-3]);break;case 23:r.setNewReqId(n[o-2]);break;case 24:r.setNewReqText(n[o-2]);break;case 25:r.setNewReqRisk(n[o-2]);break;case 26:r.setNewReqVerifyMethod(n[o-2]);break;case 29:this.$=r.RequirementType.REQUIREMENT;break;case 30:this.$=r.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=r.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=r.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=r.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=r.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=r.RiskLevel.LOW_RISK;break;case 36:this.$=r.RiskLevel.MED_RISK;break;case 37:this.$=r.RiskLevel.HIGH_RISK;break;case 38:this.$=r.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=r.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=r.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=r.VerifyType.VERIFY_TEST;break;case 42:r.addElement(n[o-3]);break;case 43:r.addElement(n[o-5]),r.setClass([n[o-5]],n[o-3]);break;case 44:r.setNewElementType(n[o-2]);break;case 45:r.setNewElementDocRef(n[o-2]);break;case 48:r.addRelationship(n[o-2],n[o],n[o-4]);break;case 49:r.addRelationship(n[o-2],n[o-4],n[o]);break;case 50:this.$=r.Relationships.CONTAINS;break;case 51:this.$=r.Relationships.COPIES;break;case 52:this.$=r.Relationships.DERIVES;break;case 53:this.$=r.Relationships.SATISFIES;break;case 54:this.$=r.Relationships.VERIFIES;break;case 55:this.$=r.Relationships.REFINES;break;case 56:this.$=r.Relationships.TRACES;break;case 57:this.$=n[o-2],r.defineClass(n[o-1],n[o]);break;case 58:r.setClass(n[o-1],n[o]);break;case 59:r.setClass([n[o-2]],n[o]);break;case 60:case 62:case 65:this.$=[n[o]];break;case 61:case 63:this.$=n[o-2].concat([n[o]]);break;case 64:this.$=n[o-2],r.setCssStyle(n[o-1],n[o]);break;case 66:n[o-2].push(n[o]),this.$=n[o-2];break;case 68:this.$=n[o-1]+n[o]}}),"anonymous"),table:[{3:1,4:2,6:e,9:i,11:r,13:s},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:i,11:r,13:s},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(n,[2,6]),{3:12,4:2,6:e,9:i,11:r,13:s},{1:[2,2]},{4:17,5:a,7:13,8:o,9:i,11:r,13:s,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:h,24:d,25:23,33:25,41:u,42:p,43:g,44:y,45:f,46:m,54:x,72:b,74:k,77:C,89:S,90:w},t(n,[2,4]),t(n,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:a,7:42,8:o,9:i,11:r,13:s,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:h,24:d,25:23,33:25,41:u,42:p,43:g,44:y,45:f,46:m,54:x,72:b,74:k,77:C,89:S,90:w},{4:17,5:a,7:43,8:o,9:i,11:r,13:s,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:h,24:d,25:23,33:25,41:u,42:p,43:g,44:y,45:f,46:m,54:x,72:b,74:k,77:C,89:S,90:w},{4:17,5:a,7:44,8:o,9:i,11:r,13:s,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:h,24:d,25:23,33:25,41:u,42:p,43:g,44:y,45:f,46:m,54:x,72:b,74:k,77:C,89:S,90:w},{4:17,5:a,7:45,8:o,9:i,11:r,13:s,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:h,24:d,25:23,33:25,41:u,42:p,43:g,44:y,45:f,46:m,54:x,72:b,74:k,77:C,89:S,90:w},{4:17,5:a,7:46,8:o,9:i,11:r,13:s,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:h,24:d,25:23,33:25,41:u,42:p,43:g,44:y,45:f,46:m,54:x,72:b,74:k,77:C,89:S,90:w},{4:17,5:a,7:47,8:o,9:i,11:r,13:s,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:h,24:d,25:23,33:25,41:u,42:p,43:g,44:y,45:f,46:m,54:x,72:b,74:k,77:C,89:S,90:w},{4:17,5:a,7:48,8:o,9:i,11:r,13:s,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:h,24:d,25:23,33:25,41:u,42:p,43:g,44:y,45:f,46:m,54:x,72:b,74:k,77:C,89:S,90:w},{4:17,5:a,7:49,8:o,9:i,11:r,13:s,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:h,24:d,25:23,33:25,41:u,42:p,43:g,44:y,45:f,46:m,54:x,72:b,74:k,77:C,89:S,90:w},{4:17,5:a,7:50,8:o,9:i,11:r,13:s,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:h,24:d,25:23,33:25,41:u,42:p,43:g,44:y,45:f,46:m,54:x,72:b,74:k,77:C,89:S,90:w},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(T,[2,17]),t(T,[2,18]),t(T,[2,19]),t(T,[2,20]),{30:60,33:62,75:_,89:S,90:w},{30:63,33:62,75:_,89:S,90:w},{30:64,33:62,75:_,89:S,90:w},t(v,[2,29]),t(v,[2,30]),t(v,[2,31]),t(v,[2,32]),t(v,[2,33]),t(v,[2,34]),t(E,[2,81]),t(E,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(A,[2,79]),t(A,[2,80]),{27:[1,67],29:[1,68]},t(A,[2,85]),t(A,[2,86]),{62:69,65:L,66:B,67:$,68:D,69:I,70:F,71:N},{62:77,65:L,66:B,67:$,68:D,69:I,70:F,71:N},{30:78,33:62,75:_,89:S,90:w},{73:79,75:O,76:M,78:81,79:82,80:R,81:P,82:q,83:z,84:W,85:j,86:Y,87:U,88:H},t(V,[2,60]),t(V,[2,62]),{73:93,75:O,76:M,78:81,79:82,80:R,81:P,82:q,83:z,84:W,85:j,86:Y,87:U,88:H},{30:94,33:62,75:_,76:M,89:S,90:w},{5:[1,95]},{30:96,33:62,75:_,89:S,90:w},{5:[1,97]},{30:98,33:62,75:_,89:S,90:w},{63:[1,99]},t(X,[2,50]),t(X,[2,51]),t(X,[2,52]),t(X,[2,53]),t(X,[2,54]),t(X,[2,55]),t(X,[2,56]),{64:[1,100]},t(T,[2,59],{76:M}),t(T,[2,64],{76:G}),{33:103,75:[1,102],89:S,90:w},t(K,[2,65],{79:104,75:O,80:R,81:P,82:q,83:z,84:W,85:j,86:Y,87:U,88:H}),t(Q,[2,67]),t(Q,[2,69]),t(Q,[2,70]),t(Q,[2,71]),t(Q,[2,72]),t(Q,[2,73]),t(Q,[2,74]),t(Q,[2,75]),t(Q,[2,76]),t(Q,[2,77]),t(Q,[2,78]),t(T,[2,57],{76:G}),t(T,[2,58],{76:M}),{5:Z,28:105,31:J,34:tt,36:et,38:it,40:rt},{27:[1,112],76:M},{5:st,40:nt,56:113,57:at,59:ot},{27:[1,118],76:M},{33:119,89:S,90:w},{33:120,89:S,90:w},{75:O,78:121,79:82,80:R,81:P,82:q,83:z,84:W,85:j,86:Y,87:U,88:H},t(V,[2,61]),t(V,[2,63]),t(Q,[2,68]),t(T,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:Z,28:126,31:J,34:tt,36:et,38:it,40:rt},t(T,[2,28]),{5:[1,127]},t(T,[2,42]),{32:[1,128]},{32:[1,129]},{5:st,40:nt,56:130,57:at,59:ot},t(T,[2,47]),{5:[1,131]},t(T,[2,48]),t(T,[2,49]),t(K,[2,66],{79:104,75:O,80:R,81:P,82:q,83:z,84:W,85:j,86:Y,87:U,88:H}),{33:132,89:S,90:w},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(T,[2,27]),{5:Z,28:145,31:J,34:tt,36:et,38:it,40:rt},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(T,[2,46]),{5:st,40:nt,56:152,57:at,59:ot},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(T,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(T,[2,43]),{5:Z,28:159,31:J,34:tt,36:et,38:it,40:rt},{5:Z,28:160,31:J,34:tt,36:et,38:it,40:rt},{5:Z,28:161,31:J,34:tt,36:et,38:it,40:rt},{5:Z,28:162,31:J,34:tt,36:et,38:it,40:rt},{5:st,40:nt,56:163,57:at,59:ot},{5:st,40:nt,56:164,57:at,59:ot},t(T,[2,23]),t(T,[2,24]),t(T,[2,25]),t(T,[2,26]),t(T,[2,44]),t(T,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:we((function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)}),"parseError"),parse:we((function(t){var e=this,i=[0],r=[],s=[null],n=[],a=this.table,o="",l=0,c=0,h=n.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;n.push(g);var y=d.options&&d.options.ranges;function f(){var t;return"number"!=typeof(t=r.pop()||d.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,we((function(t){i.length=i.length-2*t,s.length=s.length-t,n.length=n.length-t}),"popStack"),we(f,"lex");for(var m,x,b,k,C,S,w,T,_={};;){if(x=i[i.length-1],this.defaultActions[x]?b=this.defaultActions[x]:(null==m&&(m=f()),b=a[x]&&a[x][m]),void 0===b||!b.length||!b[0]){var v="";for(C in T=[],a[x])this.terminals_[C]&&C>2&&T.push("'"+this.terminals_[C]+"'");v=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(v,{text:d.match,token:this.terminals_[m]||m,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: "+x+", token: "+m);switch(b[0]){case 1:i.push(m),s.push(d.yytext),n.push(d.yylloc),i.push(b[1]),m=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(S=this.productions_[b[1]][1],_.$=s[s.length-S],_._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},y&&(_._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(k=this.performAction.apply(_,[o,c,l,u.yy,b[1],s,n].concat(h))))return k;S&&(i=i.slice(0,-1*S*2),s=s.slice(0,-1*S),n=n.slice(0,-1*S)),i.push(this.productions_[b[1]][0]),s.push(_.$),n.push(_._$),w=a[i[i.length-2]][i[i.length-1]],i.push(w);break;case 3:return!0}}return!0}),"parse")},ct=function(){return{EOF:1,parseError:we((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"), +// resets the lexer, sets new input +setInput:we((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}),"setInput"), +// consumes and returns one char from the input +input:we((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}),"input"), +// unshifts one char (or a string) into the input +unput:we((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 s=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=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"), +// When called from action, caches matched text and appends it on next action +more:we((function(){return this._more=!0,this}),"more"), +// 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:we((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})}),"reject"), +// retain first n characters of the match +less:we((function(t){this.unput(this.match.slice(t))}),"less"), +// displays already matched input, i.e. for error messages +pastInput:we((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"), +// displays upcoming input, i.e. for error messages +upcomingInput:we((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,"")}),"upcomingInput"), +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:we((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"), +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:we((function(t,e){var i,r,s;if(this.options.backtrack_lexer&&(s={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&&(s.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 n in s)this[n]=s[n];return!1}return!1}),"test_match"), +// return next match in input +next:we((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 s=this._currentRules(),n=0;ne[0].length)){if(e=i,r=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[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})}),"next"), +// return next match that has a token +lex:we((function(){var t=this.next();return t||this.lex()}),"lex"), +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:we((function(t){this.conditionStack.push(t)}),"begin"), +// pop the previously active lexer condition state off the condition stack +popState:we((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"), +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:we((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"), +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:we((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"), +// alias for begin(condition) +pushState:we((function(t){this.begin(t)}),"pushState"), +// return the number of states currently on the stack +stateStackSize:we((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:we((function(t,e,i,r){switch(i){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:case 58:case 65:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:case 14:case 15:case 56:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:case 68:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 57:case 64:this.begin("string");break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 66:return"qString";case 67:return e.yytext=e.yytext.trim(),89;case 69:return 80;case 70:return 76}}),"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/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,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,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,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}}}();function ht(){this.yy={}}return lt.lexer=ct,we(ht,"Parser"),ht.prototype=lt,lt.Parser=ht,new ht}();lb.parser=lb;var cb=lb,hb=(we(E=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=cr,this.getAccTitle=hr,this.setAccDescription=dr,this.getAccDescription=ur,this.setDiagramTitle=pr,this.getDiagramTitle=gr,this.getConfig=we((()=>mr().requirement),"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}getDirection(){return this.direction}setDirection(t){this.direction=t}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(t,e){return this.requirements.has(t)||this.requirements.set(t,{name:t,type:e,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(t)}getRequirements(){return this.requirements}setNewReqId(t){void 0!==this.latestRequirement&&(this.latestRequirement.requirementId=t)}setNewReqText(t){void 0!==this.latestRequirement&&(this.latestRequirement.text=t)}setNewReqRisk(t){void 0!==this.latestRequirement&&(this.latestRequirement.risk=t)}setNewReqVerifyMethod(t){void 0!==this.latestRequirement&&(this.latestRequirement.verifyMethod=t)}addElement(t){return this.elements.has(t)||(this.elements.set(t,{name:t,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),ve.info("Added new element: ",t)),this.resetLatestElement(),this.elements.get(t)}getElements(){return this.elements}setNewElementType(t){void 0!==this.latestElement&&(this.latestElement.type=t)}setNewElementDocRef(t){void 0!==this.latestElement&&(this.latestElement.docRef=t)}addRelationship(t,e,i){this.relations.push({type:t,src:e,dst:i})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,lr()}setCssStyle(t,e){for(const i of t){const t=this.requirements.get(i)??this.elements.get(i);if(!e||!t)return;for(const i of e)i.includes(",")?t.cssStyles.push(...i.split(",")):t.cssStyles.push(i)}}setClass(t,e){var i;for(const r of t){const t=this.requirements.get(r)??this.elements.get(r);if(t)for(const r of e){t.classes.push(r);const e=null==(i=this.classes.get(r))?void 0:i.styles;e&&t.cssStyles.push(...e)}}}defineClass(t,e){for(const i of t){let t=this.classes.get(i);void 0===t&&(t={id:i,styles:[],textStyles:[]},this.classes.set(i,t)),e&&e.forEach((function(e){if(/color/.exec(e)){const i=e.replace("fill","bgFill");t.textStyles.push(i)}t.styles.push(e)})),this.requirements.forEach((t=>{t.classes.includes(i)&&t.cssStyles.push(...e.flatMap((t=>t.split(","))))})),this.elements.forEach((t=>{t.classes.includes(i)&&t.cssStyles.push(...e.flatMap((t=>t.split(","))))}))}}getClasses(){return this.classes}getData(){var t,e,i,r;const s=mr(),n=[],a=[];for(const o of this.requirements.values()){const t=o;t.id=o.name,t.cssStyles=o.cssStyles,t.cssClasses=o.classes.join(" "),t.shape="requirementBox",t.look=s.look,n.push(t)}for(const o of this.elements.values()){const t=o;t.shape="requirementBox",t.look=s.look,t.id=o.name,t.cssStyles=o.cssStyles,t.cssClasses=o.classes.join(" "),n.push(t)}for(const o of this.relations){let n=0;const l=o.type===this.Relationships.CONTAINS,c={id:`${o.src}-${o.dst}-${n}`,start:(null==(t=this.requirements.get(o.src))?void 0:t.name)??(null==(e=this.elements.get(o.src))?void 0:e.name),end:(null==(i=this.requirements.get(o.dst))?void 0:i.name)??(null==(r=this.elements.get(o.dst))?void 0:r.name),label:`<<${o.type}>>`,classes:"relationshipLine",style:["fill:none",l?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:l?"normal":"dashed",arrowTypeStart:l?"requirement_contains":"",arrowTypeEnd:l?"":"requirement_arrow",look:s.look};a.push(c),n++}return{nodes:n,edges:a,other:{},config:s,direction:this.getDirection()}}},"RequirementDB"),E),db=we((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: 1.0;\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: 1.0;\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 .divider {\n stroke: ${t.nodeBorder};\n stroke-width: 1;\n }\n .label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n .label text,span {\n fill: ${t.nodeTextColor||t.textColor};\n color: ${t.nodeTextColor||t.textColor};\n }\n .labelBkg {\n background-color: ${t.edgeLabelBackground};\n }\n\n`),"getStyles"),ub={};Te(ub,{draw:()=>pb});var pb=we((async function(t,e,i,r){ve.info("REF0:"),ve.info("Drawing requirement diagram (unified)",e);const{securityLevel:s,state:n,layout:a}=mr(),o=r.db.getData(),l=bg(e,s);o.type=r.type,o.layoutAlgorithm=Lh(a),o.nodeSpacing=(null==n?void 0:n.nodeSpacing)??50,o.rankSpacing=(null==n?void 0:n.rankSpacing)??50,o.markers=["requirement_contains","requirement_arrow"],o.diagramId=e,await Ah(o,l);mo.insertTitle(l,"requirementDiagramTitleText",(null==n?void 0:n.titleTopMargin)??25,r.db.getDiagramTitle()),kg(l,8,"requirementDiagram",(null==n?void 0:n.useMaxWidth)??!0)}),"draw"),gb={parser:cb,get db(){return new hb},renderer:ub,styles:db};const yb=Object.defineProperty({__proto__:null,diagram:gb},Symbol.toStringTag,{value:"Module"});var fb=function(){var t=we((function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i}),"o"),e=[1,2],i=[1,3],r=[1,4],s=[2,4],n=[1,9],a=[1,11],o=[1,13],l=[1,14],c=[1,16],h=[1,17],d=[1,18],u=[1,24],p=[1,25],g=[1,26],y=[1,27],f=[1,28],m=[1,29],x=[1,30],b=[1,31],k=[1,32],C=[1,33],S=[1,34],w=[1,35],T=[1,36],_=[1,37],v=[1,38],E=[1,39],A=[1,41],L=[1,42],B=[1,43],$=[1,44],D=[1,45],I=[1,46],F=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,54,59,60,61,62,70],N=[4,5,16,50,52,53],O=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],M=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,54,59,60,61,62,70],R=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,54,59,60,61,62,70],P=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,54,59,60,61,62,70],q=[68,69,70],z=[1,122],W={trace:we((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,note:54,placement:55,text2:56,over:57,actor_pair:58,links:59,link:60,properties:61,details:62,spaceList:63,",":64,left_of:65,right_of:66,signaltype:67,"+":68,"-":69,ACTOR:70,SOLID_OPEN_ARROW:71,DOTTED_OPEN_ARROW:72,SOLID_ARROW:73,BIDIRECTIONAL_SOLID_ARROW:74,DOTTED_ARROW:75,BIDIRECTIONAL_DOTTED_ARROW:76,SOLID_CROSS:77,DOTTED_CROSS:78,SOLID_POINT:79,DOTTED_POINT:80,TXT:81,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",29:"title",30:"legacy_title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"loop",37:"rect",38:"opt",39:"alt",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",54:"note",57:"over",59:"links",60:"link",61:"properties",62:"details",64:",",65:"left_of",66:"right_of",68:"+",69:"-",70:"ACTOR",71:"SOLID_OPEN_ARROW",72:"DOTTED_OPEN_ARROW",73:"SOLID_ARROW",74:"BIDIRECTIONAL_SOLID_ARROW",75:"DOTTED_ARROW",76:"BIDIRECTIONAL_DOTTED_ARROW",77:"SOLID_CROSS",78:"DOTTED_CROSS",79:"SOLID_POINT",80:"DOTTED_POINT",81:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[63,2],[63,1],[58,3],[58,1],[55,1],[55,1],[17,5],[17,5],[17,4],[22,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[56,1]],performAction:we((function(t,e,i,r,s,n,a){var o=n.length-1;switch(s){case 3:return r.apply(n[o]),n[o];case 4:case 9:case 8:case 13:this.$=[];break;case 5:case 10:n[o-1].push(n[o]),this.$=n[o-1];break;case 6:case 7:case 11:case 12:case 62:this.$=n[o];break;case 15:n[o].type="createParticipant",this.$=n[o];break;case 16:n[o-1].unshift({type:"boxStart",boxData:r.parseBoxData(n[o-2])}),n[o-1].push({type:"boxEnd",boxText:n[o-2]}),this.$=n[o-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(n[o-2]),sequenceIndexStep:Number(n[o-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(n[o-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:n[o-1].actor};break;case 23:this.$={type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:n[o-1].actor};break;case 29:r.setDiagramTitle(n[o].substring(6)),this.$=n[o].substring(6);break;case 30:r.setDiagramTitle(n[o].substring(7)),this.$=n[o].substring(7);break;case 31:this.$=n[o].trim(),r.setAccTitle(this.$);break;case 32:case 33:this.$=n[o].trim(),r.setAccDescription(this.$);break;case 34:n[o-1].unshift({type:"loopStart",loopText:r.parseMessage(n[o-2]),signalType:r.LINETYPE.LOOP_START}),n[o-1].push({type:"loopEnd",loopText:n[o-2],signalType:r.LINETYPE.LOOP_END}),this.$=n[o-1];break;case 35:n[o-1].unshift({type:"rectStart",color:r.parseMessage(n[o-2]),signalType:r.LINETYPE.RECT_START}),n[o-1].push({type:"rectEnd",color:r.parseMessage(n[o-2]),signalType:r.LINETYPE.RECT_END}),this.$=n[o-1];break;case 36:n[o-1].unshift({type:"optStart",optText:r.parseMessage(n[o-2]),signalType:r.LINETYPE.OPT_START}),n[o-1].push({type:"optEnd",optText:r.parseMessage(n[o-2]),signalType:r.LINETYPE.OPT_END}),this.$=n[o-1];break;case 37:n[o-1].unshift({type:"altStart",altText:r.parseMessage(n[o-2]),signalType:r.LINETYPE.ALT_START}),n[o-1].push({type:"altEnd",signalType:r.LINETYPE.ALT_END}),this.$=n[o-1];break;case 38:n[o-1].unshift({type:"parStart",parText:r.parseMessage(n[o-2]),signalType:r.LINETYPE.PAR_START}),n[o-1].push({type:"parEnd",signalType:r.LINETYPE.PAR_END}),this.$=n[o-1];break;case 39:n[o-1].unshift({type:"parStart",parText:r.parseMessage(n[o-2]),signalType:r.LINETYPE.PAR_OVER_START}),n[o-1].push({type:"parEnd",signalType:r.LINETYPE.PAR_END}),this.$=n[o-1];break;case 40:n[o-1].unshift({type:"criticalStart",criticalText:r.parseMessage(n[o-2]),signalType:r.LINETYPE.CRITICAL_START}),n[o-1].push({type:"criticalEnd",signalType:r.LINETYPE.CRITICAL_END}),this.$=n[o-1];break;case 41:n[o-1].unshift({type:"breakStart",breakText:r.parseMessage(n[o-2]),signalType:r.LINETYPE.BREAK_START}),n[o-1].push({type:"breakEnd",optText:r.parseMessage(n[o-2]),signalType:r.LINETYPE.BREAK_END}),this.$=n[o-1];break;case 43:this.$=n[o-3].concat([{type:"option",optionText:r.parseMessage(n[o-1]),signalType:r.LINETYPE.CRITICAL_OPTION},n[o]]);break;case 45:this.$=n[o-3].concat([{type:"and",parText:r.parseMessage(n[o-1]),signalType:r.LINETYPE.PAR_AND},n[o]]);break;case 47:this.$=n[o-3].concat([{type:"else",altText:r.parseMessage(n[o-1]),signalType:r.LINETYPE.ALT_ELSE},n[o]]);break;case 48:n[o-3].draw="participant",n[o-3].type="addParticipant",n[o-3].description=r.parseMessage(n[o-1]),this.$=n[o-3];break;case 49:n[o-1].draw="participant",n[o-1].type="addParticipant",this.$=n[o-1];break;case 50:n[o-3].draw="actor",n[o-3].type="addParticipant",n[o-3].description=r.parseMessage(n[o-1]),this.$=n[o-3];break;case 51:n[o-1].draw="actor",n[o-1].type="addParticipant",this.$=n[o-1];break;case 52:n[o-1].type="destroyParticipant",this.$=n[o-1];break;case 53:this.$=[n[o-1],{type:"addNote",placement:n[o-2],actor:n[o-1].actor,text:n[o]}];break;case 54:n[o-2]=[].concat(n[o-1],n[o-1]).slice(0,2),n[o-2][0]=n[o-2][0].actor,n[o-2][1]=n[o-2][1].actor,this.$=[n[o-1],{type:"addNote",placement:r.PLACEMENT.OVER,actor:n[o-2].slice(0,2),text:n[o]}];break;case 55:this.$=[n[o-1],{type:"addLinks",actor:n[o-1].actor,text:n[o]}];break;case 56:this.$=[n[o-1],{type:"addALink",actor:n[o-1].actor,text:n[o]}];break;case 57:this.$=[n[o-1],{type:"addProperties",actor:n[o-1].actor,text:n[o]}];break;case 58:this.$=[n[o-1],{type:"addDetails",actor:n[o-1].actor,text:n[o]}];break;case 61:this.$=[n[o-2],n[o]];break;case 63:this.$=r.PLACEMENT.LEFTOF;break;case 64:this.$=r.PLACEMENT.RIGHTOF;break;case 65:this.$=[n[o-4],n[o-1],{type:"addMessage",from:n[o-4].actor,to:n[o-1].actor,signalType:n[o-3],msg:n[o],activate:!0},{type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:n[o-1].actor}];break;case 66:this.$=[n[o-4],n[o-1],{type:"addMessage",from:n[o-4].actor,to:n[o-1].actor,signalType:n[o-3],msg:n[o]},{type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:n[o-4].actor}];break;case 67:this.$=[n[o-3],n[o-1],{type:"addMessage",from:n[o-3].actor,to:n[o-1].actor,signalType:n[o-2],msg:n[o]}];break;case 68:this.$={type:"addParticipant",actor:n[o]};break;case 69:this.$=r.LINETYPE.SOLID_OPEN;break;case 70:this.$=r.LINETYPE.DOTTED_OPEN;break;case 71:this.$=r.LINETYPE.SOLID;break;case 72:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 73:this.$=r.LINETYPE.DOTTED;break;case 74:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 75:this.$=r.LINETYPE.SOLID_CROSS;break;case 76:this.$=r.LINETYPE.DOTTED_CROSS;break;case 77:this.$=r.LINETYPE.SOLID_POINT;break;case 78:this.$=r.LINETYPE.DOTTED_POINT;break;case 79:this.$=r.parseMessage(n[o].trim().substring(1))}}),"anonymous"),table:[{3:1,4:e,5:i,6:r},{1:[3]},{3:5,4:e,5:i,6:r},{3:6,4:e,5:i,6:r},t([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],s,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:a,8:8,9:10,12:12,13:o,14:l,17:15,18:c,21:h,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:u,30:p,31:g,33:y,35:f,36:m,37:x,38:b,39:k,41:C,43:S,44:w,46:T,50:_,52:v,53:E,54:A,59:L,60:B,61:$,62:D,70:I},t(F,[2,5]),{9:47,12:12,13:o,14:l,17:15,18:c,21:h,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:u,30:p,31:g,33:y,35:f,36:m,37:x,38:b,39:k,41:C,43:S,44:w,46:T,50:_,52:v,53:E,54:A,59:L,60:B,61:$,62:D,70:I},t(F,[2,7]),t(F,[2,8]),t(F,[2,14]),{12:48,50:_,52:v,53:E},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,70:I},{22:55,70:I},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},t(F,[2,29]),t(F,[2,30]),{32:[1,61]},{34:[1,62]},t(F,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,70:I},{22:72,70:I},{22:73,70:I},{67:74,71:[1,75],72:[1,76],73:[1,77],74:[1,78],75:[1,79],76:[1,80],77:[1,81],78:[1,82],79:[1,83],80:[1,84]},{55:85,57:[1,86],65:[1,87],66:[1,88]},{22:89,70:I},{22:90,70:I},{22:91,70:I},{22:92,70:I},t([5,51,64,71,72,73,74,75,76,77,78,79,80,81],[2,68]),t(F,[2,6]),t(F,[2,15]),t(N,[2,9],{10:93}),t(F,[2,17]),{5:[1,95],19:[1,94]},{5:[1,96]},t(F,[2,21]),{5:[1,97]},{5:[1,98]},t(F,[2,24]),t(F,[2,25]),t(F,[2,26]),t(F,[2,27]),t(F,[2,28]),t(F,[2,31]),t(F,[2,32]),t(O,s,{7:99}),t(O,s,{7:100}),t(O,s,{7:101}),t(M,s,{40:102,7:103}),t(R,s,{42:104,7:105}),t(R,s,{7:105,42:106}),t(P,s,{45:107,7:108}),t(O,s,{7:109}),{5:[1,111],51:[1,110]},{5:[1,113],51:[1,112]},{5:[1,114]},{22:117,68:[1,115],69:[1,116],70:I},t(q,[2,69]),t(q,[2,70]),t(q,[2,71]),t(q,[2,72]),t(q,[2,73]),t(q,[2,74]),t(q,[2,75]),t(q,[2,76]),t(q,[2,77]),t(q,[2,78]),{22:118,70:I},{22:120,58:119,70:I},{70:[2,63]},{70:[2,64]},{56:121,81:z},{56:123,81:z},{56:124,81:z},{56:125,81:z},{4:[1,128],5:[1,130],11:127,12:129,16:[1,126],50:_,52:v,53:E},{5:[1,131]},t(F,[2,19]),t(F,[2,20]),t(F,[2,22]),t(F,[2,23]),{4:n,5:a,8:8,9:10,12:12,13:o,14:l,16:[1,132],17:15,18:c,21:h,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:u,30:p,31:g,33:y,35:f,36:m,37:x,38:b,39:k,41:C,43:S,44:w,46:T,50:_,52:v,53:E,54:A,59:L,60:B,61:$,62:D,70:I},{4:n,5:a,8:8,9:10,12:12,13:o,14:l,16:[1,133],17:15,18:c,21:h,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:u,30:p,31:g,33:y,35:f,36:m,37:x,38:b,39:k,41:C,43:S,44:w,46:T,50:_,52:v,53:E,54:A,59:L,60:B,61:$,62:D,70:I},{4:n,5:a,8:8,9:10,12:12,13:o,14:l,16:[1,134],17:15,18:c,21:h,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:u,30:p,31:g,33:y,35:f,36:m,37:x,38:b,39:k,41:C,43:S,44:w,46:T,50:_,52:v,53:E,54:A,59:L,60:B,61:$,62:D,70:I},{16:[1,135]},{4:n,5:a,8:8,9:10,12:12,13:o,14:l,16:[2,46],17:15,18:c,21:h,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:u,30:p,31:g,33:y,35:f,36:m,37:x,38:b,39:k,41:C,43:S,44:w,46:T,49:[1,136],50:_,52:v,53:E,54:A,59:L,60:B,61:$,62:D,70:I},{16:[1,137]},{4:n,5:a,8:8,9:10,12:12,13:o,14:l,16:[2,44],17:15,18:c,21:h,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:u,30:p,31:g,33:y,35:f,36:m,37:x,38:b,39:k,41:C,43:S,44:w,46:T,48:[1,138],50:_,52:v,53:E,54:A,59:L,60:B,61:$,62:D,70:I},{16:[1,139]},{16:[1,140]},{4:n,5:a,8:8,9:10,12:12,13:o,14:l,16:[2,42],17:15,18:c,21:h,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:u,30:p,31:g,33:y,35:f,36:m,37:x,38:b,39:k,41:C,43:S,44:w,46:T,47:[1,141],50:_,52:v,53:E,54:A,59:L,60:B,61:$,62:D,70:I},{4:n,5:a,8:8,9:10,12:12,13:o,14:l,16:[1,142],17:15,18:c,21:h,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:u,30:p,31:g,33:y,35:f,36:m,37:x,38:b,39:k,41:C,43:S,44:w,46:T,50:_,52:v,53:E,54:A,59:L,60:B,61:$,62:D,70:I},{15:[1,143]},t(F,[2,49]),{15:[1,144]},t(F,[2,51]),t(F,[2,52]),{22:145,70:I},{22:146,70:I},{56:147,81:z},{56:148,81:z},{56:149,81:z},{64:[1,150],81:[2,62]},{5:[2,55]},{5:[2,79]},{5:[2,56]},{5:[2,57]},{5:[2,58]},t(F,[2,16]),t(N,[2,10]),{12:151,50:_,52:v,53:E},t(N,[2,12]),t(N,[2,13]),t(F,[2,18]),t(F,[2,34]),t(F,[2,35]),t(F,[2,36]),t(F,[2,37]),{15:[1,152]},t(F,[2,38]),{15:[1,153]},t(F,[2,39]),t(F,[2,40]),{15:[1,154]},t(F,[2,41]),{5:[1,155]},{5:[1,156]},{56:157,81:z},{56:158,81:z},{5:[2,67]},{5:[2,53]},{5:[2,54]},{22:159,70:I},t(N,[2,11]),t(M,s,{7:103,40:160}),t(R,s,{7:105,42:161}),t(P,s,{7:108,45:162}),t(F,[2,48]),t(F,[2,50]),{5:[2,65]},{5:[2,66]},{81:[2,61]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],87:[2,63],88:[2,64],121:[2,55],122:[2,79],123:[2,56],124:[2,57],125:[2,58],147:[2,67],148:[2,53],149:[2,54],157:[2,65],158:[2,66],159:[2,61],160:[2,47],161:[2,45],162:[2,43]},parseError:we((function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)}),"parseError"),parse:we((function(t){var e=this,i=[0],r=[],s=[null],n=[],a=this.table,o="",l=0,c=0,h=n.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;n.push(g);var y=d.options&&d.options.ranges;function f(){var t;return"number"!=typeof(t=r.pop()||d.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,we((function(t){i.length=i.length-2*t,s.length=s.length-t,n.length=n.length-t}),"popStack"),we(f,"lex");for(var m,x,b,k,C,S,w,T,_={};;){if(x=i[i.length-1],this.defaultActions[x]?b=this.defaultActions[x]:(null==m&&(m=f()),b=a[x]&&a[x][m]),void 0===b||!b.length||!b[0]){var v="";for(C in T=[],a[x])this.terminals_[C]&&C>2&&T.push("'"+this.terminals_[C]+"'");v=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(v,{text:d.match,token:this.terminals_[m]||m,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: "+x+", token: "+m);switch(b[0]){case 1:i.push(m),s.push(d.yytext),n.push(d.yylloc),i.push(b[1]),m=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(S=this.productions_[b[1]][1],_.$=s[s.length-S],_._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},y&&(_._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(k=this.performAction.apply(_,[o,c,l,u.yy,b[1],s,n].concat(h))))return k;S&&(i=i.slice(0,-1*S*2),s=s.slice(0,-1*S),n=n.slice(0,-1*S)),i.push(this.productions_[b[1]][0]),s.push(_.$),n.push(_._$),w=a[i[i.length-2]][i[i.length-1]],i.push(w);break;case 3:return!0}}return!0}),"parse")},j=function(){return{EOF:1,parseError:we((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"), +// resets the lexer, sets new input +setInput:we((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}),"setInput"), +// consumes and returns one char from the input +input:we((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}),"input"), +// unshifts one char (or a string) into the input +unput:we((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 s=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=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"), +// When called from action, caches matched text and appends it on next action +more:we((function(){return this._more=!0,this}),"more"), +// 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:we((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})}),"reject"), +// retain first n characters of the match +less:we((function(t){this.unput(this.match.slice(t))}),"less"), +// displays already matched input, i.e. for error messages +pastInput:we((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"), +// displays upcoming input, i.e. for error messages +upcomingInput:we((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,"")}),"upcomingInput"), +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:we((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"), +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:we((function(t,e){var i,r,s;if(this.options.backtrack_lexer&&(s={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&&(s.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 n in s)this[n]=s[n];return!1}return!1}),"test_match"), +// return next match in input +next:we((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 s=this._currentRules(),n=0;ne[0].length)){if(e=i,r=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[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})}),"next"), +// return next match that has a token +lex:we((function(){var t=this.next();return t||this.lex()}),"lex"), +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:we((function(t){this.conditionStack.push(t)}),"begin"), +// pop the previously active lexer condition state off the condition stack +popState:we((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"), +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:we((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"), +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:we((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"), +// alias for begin(condition) +pushState:we((function(t){this.begin(t)}),"pushState"), +// return the number of states currently on the stack +stateStackSize:we((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:we((function(t,e,i,r){switch(i){case 0:case 51:case 66:return 5;case 1:case 2:case 3:case 4:case 5:break;case 6:return 19;case 7:return this.begin("LINE"),14;case 8:return this.begin("ID"),50;case 9:return this.begin("ID"),52;case 10:return 13;case 11:return this.begin("ID"),53;case 12:return e.yytext=e.yytext.trim(),this.begin("ALIAS"),70;case 13:return this.popState(),this.popState(),this.begin("LINE"),51;case 14:return this.popState(),this.popState(),5;case 15:return this.begin("LINE"),36;case 16:return this.begin("LINE"),37;case 17:return this.begin("LINE"),38;case 18:return this.begin("LINE"),39;case 19:return this.begin("LINE"),49;case 20:return this.begin("LINE"),41;case 21:return this.begin("LINE"),43;case 22:return this.begin("LINE"),48;case 23:return this.begin("LINE"),44;case 24:return this.begin("LINE"),47;case 25:return this.begin("LINE"),46;case 26:return this.popState(),15;case 27:return 16;case 28:return 65;case 29:return 66;case 30:return 59;case 31:return 60;case 32:return 61;case 33:return 62;case 34:return 57;case 35:return 54;case 36:return this.begin("ID"),21;case 37:return this.begin("ID"),23;case 38:return 29;case 39:return 30;case 40:return this.begin("acc_title"),31;case 41:return this.popState(),"acc_title_value";case 42:return this.begin("acc_descr"),33;case 43:return this.popState(),"acc_descr_value";case 44:this.begin("acc_descr_multiline");break;case 45:this.popState();break;case 46:return"acc_descr_multiline_value";case 47:return 6;case 48:return 18;case 49:return 20;case 50:return 64;case 52:return e.yytext=e.yytext.trim(),70;case 53:return 73;case 54:return 74;case 55:return 75;case 56:return 76;case 57:return 71;case 58:return 72;case 59:return 77;case 60:return 78;case 61:return 79;case 62:return 80;case 63:return 81;case 64:return 68;case 65:return 69;case 67:return"INVALID"}}),"anonymous"),rules:[/^(?:[\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,/^(?:create\b)/i,/^(?:destroy\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,/^(?:par_over\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,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[45,46],inclusive:!1},acc_descr:{rules:[43],inclusive:!1},acc_title:{rules:[41],inclusive:!1},ID:{rules:[2,3,12],inclusive:!1},ALIAS:{rules:[2,3,13,14],inclusive:!1},LINE:{rules:[2,3,26],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67],inclusive:!0}}}}();function Y(){this.yy={}}return W.lexer=j,we(Y,"Parser"),Y.prototype=W,W.Parser=Y,new Y}();fb.parser=fb;var mb=fb,xb={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,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34},bb={FILLED:0,OPEN:1},kb={LEFTOF:0,RIGHTOF:1,OVER:2},Cb=(we(A=class{constructor(){this.state=new jg((()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0}))),this.setAccTitle=cr,this.setAccDescription=dr,this.setDiagramTitle=pr,this.getAccTitle=hr,this.getAccDescription=ur,this.getDiagramTitle=gr,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(mr().wrap),this.LINETYPE=xb,this.ARROWTYPE=bb,this.PLACEMENT=kb}addBox(t){this.state.records.boxes.push({name:t.text,wrap:t.wrap??this.autoWrap(),fill:t.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(t,e,i,r){let s=this.state.records.currentBox;const n=this.state.records.actors.get(t);if(n){if(this.state.records.currentBox&&n.box&&this.state.records.currentBox!==n.box)throw new Error(`A same participant should only be defined in one Box: ${n.name} can't be in '${n.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(s=n.box?n.box:this.state.records.currentBox,n.box=s,n&&e===n.name&&null==i)return}if(null==(null==i?void 0:i.text)&&(i={text:e,type:r}),null!=r&&null!=i.text||(i={text:e,type:r}),this.state.records.actors.set(t,{box:s,name:e,description:i.text,wrap:i.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??"participant"}),this.state.records.prevActor){const e=this.state.records.actors.get(this.state.records.prevActor);e&&(e.nextActor=t)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(t),this.state.records.prevActor=t}activationCount(t){let e,i=0;if(!t)return 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 this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:(null==i?void 0:i.text)??"",wrap:(null==i?void 0:i.wrap)??this.autoWrap(),type:r,activate:s}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some((t=>t.name))}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(t){return this.state.records.actors.get(t)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(t){this.state.records.wrapEnabled=t}extractWrap(t){if(void 0===t)return{};t=t.trim();const e=null!==/^:?wrap:/.exec(t)||null===/^:?nowrap:/.exec(t)&&void 0;return{cleanedText:(void 0===e?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:e}}autoWrap(){var t;return void 0!==this.state.records.wrapEnabled?this.state.records.wrapEnabled:(null==(t=mr().sequence)?void 0:t.wrap)??!1}clear(){this.state.reset(),lr()}parseMessage(t){const e=t.trim(),{wrap:i,cleanedText:r}=this.extractWrap(e),s={text:r,wrap:i};return ve.debug(`parseMessage: ${JSON.stringify(s)}`),s} +// We expect the box statement to be color first then description +// The color can be rgb,rgba,hsl,hsla, or css code names #hex codes are not supported for now because of the way the char # is handled +// We extract first segment as color, the rest of the line is considered as text +parseBoxData(t){const e=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);let i=(null==e?void 0:e[1])?e[1].trim():"transparent",r=(null==e?void 0:e[2])?e[2].trim():void 0;if(null==window?void 0: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())}const{wrap:s,cleanedText:n}=this.extractWrap(r);return{text:n?Li(n,mr()):void 0,color:i,wrap:s}}addNote(t,e,i){const r={actor:t,placement:e,message:i.text,wrap:i.wrap??this.autoWrap()},s=[].concat(t,t);this.state.records.notes.push(r),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:s[0],to:s[1],message:i.text,wrap:i.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:e})}addLinks(t,e){const i=this.getActor(t);try{let t=Li(e.text,mr());t=t.replace(/=/g,"="),t=t.replace(/&/g,"&");const r=JSON.parse(t);this.insertLinks(i,r)}catch(r){ve.error("error while parsing actor link text",r)}}addALink(t,e){const i=this.getActor(t);try{const t={};let r=Li(e.text,mr());const s=r.indexOf("@");r=r.replace(/=/g,"="),r=r.replace(/&/g,"&");const n=r.slice(0,s-1).trim(),a=r.slice(s+1).trim();t[n]=a,this.insertLinks(i,t)}catch(r){ve.error("error while parsing actor link text",r)}}insertLinks(t,e){if(null==t.links)t.links=e;else for(const i in e)t.links[i]=e[i]}addProperties(t,e){const i=this.getActor(t);try{const t=Li(e.text,mr()),r=JSON.parse(t);this.insertProperties(i,r)}catch(r){ve.error("error while parsing actor properties text",r)}}insertProperties(t,e){if(null==t.properties)t.properties=e;else for(const i in e)t.properties[i]=e[i]}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,e){const i=this.getActor(t),r=document.getElementById(e.text);try{const t=r.innerHTML,e=JSON.parse(t);e.properties&&this.insertProperties(i,e.properties),e.links&&this.insertLinks(i,e.links)}catch(s){ve.error("error while parsing actor details text",s)}}getActorProperty(t,e){if(void 0!==(null==t?void 0:t.properties))return t.properties[e]} +// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-redundant-type-constituents +apply(t){if(Array.isArray(t))t.forEach((t=>{this.apply(t)}));else switch(t.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":this.addActor(t.actor,t.actor,t.description,t.draw);break;case"createParticipant":if(this.state.records.actors.has(t.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=t.actor,this.addActor(t.actor,t.actor,t.description,t.draw),this.state.records.createdActors.set(t.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=t.actor,this.state.records.destroyedActors.set(t.actor,this.state.records.messages.length);break;case"activeStart":case"activeEnd":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"addNote":this.addNote(t.actor,t.placement,t.text);break;case"addLinks":this.addLinks(t.actor,t.text);break;case"addALink":this.addALink(t.actor,t.text);break;case"addProperties":this.addProperties(t.actor,t.text);break;case"addDetails":this.addDetails(t.actor,t.text);break;case"addMessage":if(this.state.records.lastCreated){if(t.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(t.to!==this.state.records.lastDestroyed&&t.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(t.from,t.to,t.msg,t.signalType,t.activate);break;case"boxStart":this.addBox(t.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":case"rectEnd":case"optEnd":case"altEnd":case"parEnd":case"criticalEnd":case"breakEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"rectStart":this.addSignal(void 0,void 0,t.color,t.signalType);break;case"optStart":this.addSignal(void 0,void 0,t.optText,t.signalType);break;case"altStart":case"else":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"setAccTitle":cr(t.text);break;case"parStart":case"and":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,t.criticalText,t.signalType);break;case"option":this.addSignal(void 0,void 0,t.optionText,t.signalType);break;case"breakStart":this.addSignal(void 0,void 0,t.breakText,t.signalType)}}getConfig(){return mr().sequence}},"SequenceDB"),A),Sb=we((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`),"getStyles"),wb="actor-top",Tb="actor-bottom",_b="actor-man",vb=we((function(t,e){return zu(t,e)}),"drawRect"),Eb=we((function(t,e,i,r,s){if(void 0===e.links||null===e.links||0===Object.keys(e.links).length)return{height:0,width:0};const n=e.links,a=e.actorCnt,o=e.rectData;var l="none";s&&(l="block !important");const c=t.append("g");c.attr("id","actor"+a+"_popup"),c.attr("class","actorPopupMenu"),c.attr("display",l);var h="";void 0!==o.class&&(h=" "+o.class);let d=o.width>i?o.width:i;const u=c.append("rect");if(u.attr("class","actorPopupMenuPanel"+h),u.attr("x",o.x),u.attr("y",o.height),u.attr("fill",o.fill),u.attr("stroke",o.stroke),u.attr("width",d),u.attr("height",o.height),u.attr("rx",o.rx),u.attr("ry",o.ry),null!=n){var p=20;for(let t in n){var g=c.append("a"),y=tt.sanitizeUrl(n[t]);g.attr("xlink:href",y),g.attr("target","_blank"),Zb(r)(t,g,o.x+10,o.height+p,d,20,{class:"actor"},r),p+=30}}return u.attr("height",p),{height:o.height+p,width:d}}),"drawPopup"),Ab=we((function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"}),"popupMenuToggle"),Lb=we((async function(t,e,i=null){let r=t.append("foreignObject");const s=await Vi(e.text,yi()),n=r.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(s).node().getBoundingClientRect();if(r.attr("height",Math.round(n.height)).attr("width",Math.round(n.width)),"noteText"===e.class){const i=t.node().firstChild;i.setAttribute("height",n.height+2*e.textMargin);const s=i.getBBox();r.attr("x",Math.round(s.x+s.width/2-n.width/2)).attr("y",Math.round(s.y+s.height/2-n.height/2))}else if(i){let{startx:t,stopx:s,starty:a}=i;if(t>s){const e=t;t=s,s=e}r.attr("x",Math.round(t+Math.abs(t-s)/2-n.width/2)),"loopText"===e.class?r.attr("y",Math.round(a)):r.attr("y",Math.round(a-n.height))}return[r]}),"drawKatex"),Bb=we((function(t,e){let i=0,r=0;const s=e.text.split(Xi.lineBreakRegex),[n,a]=yo(e.fontSize);let o=[],l=0,c=we((()=>e.y),"yfunc");if(void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0)switch(e.valign){case"top":case"start":c=we((()=>Math.round(e.y+e.textMargin)),"yfunc");break;case"middle":case"center":c=we((()=>Math.round(e.y+(i+r+e.textMargin)/2)),"yfunc");break;case"bottom":case"end":c=we((()=>Math.round(e.y+(i+r+2*e.textMargin)-e.textMargin)),"yfunc")}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 s.entries()){void 0!==e.textMargin&&0===e.textMargin&&void 0!==n&&(l=h*n);const s=t.append("text");s.attr("x",e.x),s.attr("y",c()),void 0!==e.anchor&&s.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),void 0!==e.fontFamily&&s.style("font-family",e.fontFamily),void 0!==a&&s.style("font-size",a),void 0!==e.fontWeight&&s.style("font-weight",e.fontWeight),void 0!==e.fill&&s.attr("fill",e.fill),void 0!==e.class&&s.attr("class",e.class),void 0!==e.dy?s.attr("dy",e.dy):0!==l&&s.attr("dy",l);const u=d||"​";if(e.tspan){const t=s.append("tspan");t.attr("x",e.x),void 0!==e.fill&&t.attr("fill",e.fill),t.text(u)}else s.text(u);void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0&&(r+=(s._groups||s)[0][0].getBBox().height,i=r),o.push(s)}return o}),"drawText"),$b=we((function(t,e){function i(t,e,i,r,s){return t+","+e+" "+(t+i)+","+e+" "+(t+i)+","+(e+r-s)+" "+(t+i-1.2*s)+","+(e+r)+" "+t+","+(e+r)}we(i,"genPoints");const r=t.append("polygon");return r.attr("points",i(e.x,e.y,e.width,e.height,7)),r.attr("class","labelBox"),e.y=e.y+e.height/2,Bb(t,e),r}),"drawLabel"),Db=-1,Ib=we(((t,e,i,r)=>{t.select&&i.forEach((i=>{const s=e.get(i),n=t.select("#actor"+s.actorCnt);!r.mirrorActors&&s.stopy?n.attr("y2",s.stopy+s.height/2):r.mirrorActors&&n.attr("y2",s.stopy)}))}),"fixLifeLineHeights"),Fb=we((function(t,e,i,r){var s,n;const a=r?e.stopy:e.starty,o=e.x+e.width/2,l=a+e.height,c=t.append("g").lower();var h=c;r||(Db++,Object.keys(e.links||{}).length&&!i.forceMenus&&h.attr("onclick",Ab(`actor${Db}_popup`)).attr("cursor","pointer"),h.append("line").attr("id","actor"+Db).attr("x1",o).attr("y1",l).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),h=c.append("g"),e.actorCnt=Db,null!=e.links&&h.attr("id","root-"+Db));const d=Hu();var u="actor";(null==(s=e.properties)?void 0:s.class)?u=e.properties.class:d.fill="#eaeaea",u+=r?` ${Tb}`:` ${wb}`,d.x=e.x,d.y=a,d.width=e.width,d.height=e.height,d.class=u,d.rx=3,d.ry=3,d.name=e.name;const p=vb(h,d);if(e.rectData=d,null==(n=e.properties)?void 0:n.icon){const t=e.properties.icon.trim();"@"===t.charAt(0)?Uu(h,d.x+d.width-20,d.y+10,t.substr(1)):Yu(h,d.x+d.width-20,d.y+10,t)}Qb(i,Ui(e.description))(e.description,h,d.x,d.y,d.width,d.height,{class:"actor actor-box"},i);let g=e.height;if(p.node){const t=p.node().getBBox();e.height=t.height,g=t.height}return g}),"drawActorTypeParticipant"),Nb=we((function(t,e,i,r){const s=r?e.stopy:e.starty,n=e.x+e.width/2,a=s+80,o=t.append("g").lower();r||(Db++,o.append("line").attr("id","actor"+Db).attr("x1",n).attr("y1",a).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=Db);const l=t.append("g");let c=_b;c+=r?` ${Tb}`:` ${wb}`,l.attr("class",c),l.attr("name",e.name);const h=Hu();h.x=e.x,h.y=s,h.fill="#eaeaea",h.width=e.width,h.height=e.height,h.class="actor",h.rx=3,h.ry=3,l.append("line").attr("id","actor-man-torso"+Db).attr("x1",n).attr("y1",s+25).attr("x2",n).attr("y2",s+45),l.append("line").attr("id","actor-man-arms"+Db).attr("x1",n-18).attr("y1",s+33).attr("x2",n+18).attr("y2",s+33),l.append("line").attr("x1",n-18).attr("y1",s+60).attr("x2",n).attr("y2",s+45),l.append("line").attr("x1",n).attr("y1",s+45).attr("x2",n+18-2).attr("y2",s+60);const d=l.append("circle");d.attr("cx",e.x+e.width/2),d.attr("cy",s+10),d.attr("r",15),d.attr("width",e.width),d.attr("height",e.height);const u=l.node().getBBox();return e.height=u.height,Qb(i,Ui(e.description))(e.description,l,h.x,h.y+35,h.width,h.height,{class:`actor ${_b}`},i),e.height}),"drawActorTypeActor"),Ob=we((async function(t,e,i,r){switch(e.type){case"actor":return await Nb(t,e,i,r);case"participant":return await Fb(t,e,i,r)}}),"drawActor"),Mb=we((function(t,e,i){const r=t.append("g");zb(r,e),e.name&&Qb(i)(e.name,r,e.x,e.y+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},i),r.lower()}),"drawBox"),Rb=we((function(t){return t.append("g")}),"anchorElement"),Pb=we((function(t,e,i,r,s){const n=Hu(),a=e.anchored;n.x=e.startx,n.y=e.starty,n.class="activation"+s%3,n.width=e.stopx-e.startx,n.height=i-e.starty,vb(a,n)}),"drawActivation"),qb=we((async function(t,e,i,r){const{boxMargin:s,boxTextMargin:n,labelBoxHeight:a,labelBoxWidth:o,messageFontFamily:l,messageFontSize:c,messageFontWeight:h}=r,d=t.append("g"),u=we((function(t,e,i,r){return d.append("line").attr("x1",t).attr("y1",e).attr("x2",i).attr("y2",r).attr("class","loopLine")}),"drawLoopLine");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=Vu();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=n,p.class="labelText",$b(d,p),p=Gb(),p.text=e.title,p.x=e.startx+o/2+(e.stopx-e.startx)/2,p.y=e.starty+s+n,p.anchor="middle",p.valign="middle",p.textMargin=n,p.class="loopText",p.fontFamily=l,p.fontSize=c,p.fontWeight=h,p.wrap=!0;let g=Ui(p.text)?await Lb(d,p,e):Bb(d,p);if(void 0!==e.sectionTitles)for(const[y,f]of Object.entries(e.sectionTitles))if(f.message){p.text=f.message,p.x=e.startx+(e.stopx-e.startx)/2,p.y=e.sections[y].y+s+n,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,Ui(p.text)?(e.starty=e.sections[y].y,await Lb(d,p,e)):Bb(d,p);let t=Math.round(g.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));e.sections[y].height+=t-(s+n)}return e.height=Math.round(e.stopy-e.starty),d}),"drawLoop"),zb=we((function(t,e){Wu(t,e)}),"drawBackgroundRect"),Wb=we((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")}),"insertDatabaseIcon"),jb=we((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")}),"insertComputerIcon"),Yb=we((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")}),"insertClockIcon"),Ub=we((function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")}),"insertArrowHead"),Hb=we((function(t){t.append("defs").append("marker").attr("id","filled-head").attr("refX",15.5).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")}),"insertArrowFilledHead"),Vb=we((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)}),"insertSequenceNumber"),Xb=we((function(t){t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.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")}),"insertArrowCrossHead"),Gb=we((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}}),"getTextObj"),Kb=we((function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}}),"getNoteRect"),Qb=function(){function t(t,e,i,r,n,a,o){s(e.append("text").attr("x",i+n/2).attr("y",r+a/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,i,r,n,a,o,l){const{actorFontSize:c,actorFontFamily:h,actorFontWeight:d}=l,[u,p]=yo(c),g=t.split(Xi.lineBreakRegex);for(let y=0;yt.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)))}),"getHeight"),clear:we((function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]}),"clear"),addBox:we((function(t){this.boxes.push(t)}),"addBox"),addActor:we((function(t){this.actors.push(t)}),"addActor"),addLoop:we((function(t){this.loops.push(t)}),"addLoop"),addMessage:we((function(t){this.messages.push(t)}),"addMessage"),addNote:we((function(t){this.notes.push(t)}),"addNote"),lastActor:we((function(){return this.actors[this.actors.length-1]}),"lastActor"),lastLoop:we((function(){return this.loops[this.loops.length-1]}),"lastLoop"),lastMessage:we((function(){return this.messages[this.messages.length-1]}),"lastMessage"),lastNote:we((function(){return this.notes[this.notes.length-1]}),"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:we((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,dk(mr())}),"init"),updateVal:we((function(t,e,i,r){void 0===t[e]?t[e]=i:t[e]=r(i,t[e])}),"updateVal"),updateBounds:we((function(t,e,i,r){const s=this;let n=0;function a(a){ +return we((function(o){n++;const l=s.sequenceItems.length-n+1;s.updateVal(o,"starty",e-l*tk.boxMargin,Math.min),s.updateVal(o,"stopy",r+l*tk.boxMargin,Math.max),s.updateVal(ek.data,"startx",t-l*tk.boxMargin,Math.min),s.updateVal(ek.data,"stopx",i+l*tk.boxMargin,Math.max),"activation"!==a&&(s.updateVal(o,"startx",t-l*tk.boxMargin,Math.min),s.updateVal(o,"stopx",i+l*tk.boxMargin,Math.max),s.updateVal(ek.data,"starty",e-l*tk.boxMargin,Math.min),s.updateVal(ek.data,"stopy",r+l*tk.boxMargin,Math.max))}),"updateItemBounds")}we(a,"updateFn"),this.sequenceItems.forEach(a()),this.activations.forEach(a("activation"))}),"updateBounds"),insert:we((function(t,e,i,r){const s=Xi.getMin(t,i),n=Xi.getMax(t,i),a=Xi.getMin(e,r),o=Xi.getMax(e,r);this.updateVal(ek.data,"startx",s,Math.min),this.updateVal(ek.data,"starty",a,Math.min),this.updateVal(ek.data,"stopx",n,Math.max),this.updateVal(ek.data,"stopy",o,Math.max),this.updateBounds(s,a,n,o)}),"insert"),newActivation:we((function(t,e,i){const r=i.get(t.from),s=uk(t.from).length||0,n=r.x+r.width/2+(s-1)*tk.activationWidth/2;this.activations.push({startx:n,starty:this.verticalPos+2,stopx:n+tk.activationWidth,stopy:void 0,actor:t.from,anchored:Jb.anchorElement(e)})}),"newActivation"),endActivation:we((function(t){const e=this.activations.map((function(t){return t.actor})).lastIndexOf(t.from);return this.activations.splice(e,1)[0]}),"endActivation"),createLoop:we((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}}),"createLoop"),newLoop:we((function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))}),"newLoop"),endLoop:we((function(){return this.sequenceItems.pop()}),"endLoop"),isLoopOverlap:we((function(){return!!this.sequenceItems.length&&this.sequenceItems[this.sequenceItems.length-1].overlap}),"isLoopOverlap"),addSectionToLoop:we((function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:ek.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)}),"addSectionToLoop"),saveVerticalPos:we((function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)}),"saveVerticalPos"),resetVerticalPos:we((function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)}),"resetVerticalPos"),bumpVerticalPos:we((function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=Xi.getMax(this.data.stopy,this.verticalPos)}),"bumpVerticalPos"),getVerticalPos:we((function(){return this.verticalPos}),"getVerticalPos"),getBounds:we((function(){return{bounds:this.data,models:this.models}}),"getBounds")},ik=we((async function(t,e){ek.bumpVerticalPos(tk.boxMargin),e.height=tk.boxMargin,e.starty=ek.getVerticalPos();const i=Hu();i.x=e.startx,i.y=e.starty,i.width=e.width||tk.width,i.class="note";const r=t.append("g"),s=Jb.drawRect(r,i),n=Vu();n.x=e.startx,n.y=e.starty,n.width=i.width,n.dy="1em",n.text=e.message,n.class="noteText",n.fontFamily=tk.noteFontFamily,n.fontSize=tk.noteFontSize,n.fontWeight=tk.noteFontWeight,n.anchor=tk.noteAlign,n.textMargin=tk.noteMargin,n.valign="center";const a=Ui(n.text)?await Lb(r,n):Bb(r,n),o=Math.round(a.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));s.attr("height",o+2*tk.noteMargin),e.height+=o+2*tk.noteMargin,ek.bumpVerticalPos(o+2*tk.noteMargin),e.stopy=e.starty+o+2*tk.noteMargin,e.stopx=e.startx+i.width,ek.insert(e.startx,e.starty,e.stopx,e.stopy),ek.models.addNote(e)}),"drawNote"),rk=we((t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight})),"messageFont"),sk=we((t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight})),"noteFont"),nk=we((t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight})),"actorFont");async function ak(t,e){ek.bumpVerticalPos(10);const{startx:i,stopx:r,message:s}=e,n=Xi.splitBreaks(s).length,a=Ui(s),o=a?await Hi(s,mr()):mo.calculateTextDimensions(s,rk(tk));if(!a){const t=o.height/n;e.height+=t,ek.bumpVerticalPos(t)}let l,c=o.height-10;const h=o.width;if(i===r){l=ek.getVerticalPos()+c,tk.rightAngles||(c+=tk.boxMargin,l=ek.getVerticalPos()+c),c+=30;const t=Xi.getMax(h/2,tk.width/2);ek.insert(i-t,ek.getVerticalPos()-10+c,r+t,ek.getVerticalPos()+30+c)}else c+=tk.boxMargin,l=ek.getVerticalPos()+c,ek.insert(i,l-10,r,l);return ek.bumpVerticalPos(c),e.height+=c,e.stopy=e.starty+e.height,ek.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}we(ak,"boundMessage");var ok=we((async function(t,e,i,r){const{startx:s,stopx:n,starty:a,message:o,type:l,sequenceIndex:c,sequenceVisible:h}=e,d=mo.calculateTextDimensions(o,rk(tk)),u=Vu();u.x=s,u.y=a+10,u.width=n-s,u.class="messageText",u.dy="1em",u.text=o,u.fontFamily=tk.messageFontFamily,u.fontSize=tk.messageFontSize,u.fontWeight=tk.messageFontWeight,u.anchor=tk.messageAlign,u.valign="center",u.textMargin=tk.wrapPadding,u.tspan=!1,Ui(u.text)?await Lb(t,u,{startx:s,stopx:n,starty:i}):Bb(t,u);const p=d.width;let g;s===n?g=tk.rightAngles?t.append("path").attr("d",`M ${s},${i} H ${s+Xi.getMax(tk.width/2,p/2)} V ${i+25} H ${s}`):t.append("path").attr("d","M "+s+","+i+" C "+(s+60)+","+(i-10)+" "+(s+60)+","+(i+30)+" "+s+","+(i+20)):(g=t.append("line"),g.attr("x1",s),g.attr("y1",i),g.attr("x2",n),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||l===r.db.LINETYPE.BIDIRECTIONAL_DOTTED?(g.style("stroke-dasharray","3, 3"),g.attr("class","messageLine1")):g.attr("class","messageLine0");let y="";tk.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.BIDIRECTIONAL_SOLID&&l!==r.db.LINETYPE.BIDIRECTIONAL_DOTTED||(g.attr("marker-start","url("+y+"#arrowhead)"),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||tk.showSequenceNumbers)&&(g.attr("marker-start","url("+y+"#sequencenumber)"),t.append("text").attr("x",s).attr("y",i+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(c))}),"drawMessage"),lk=we((function(t,e,i,r,s,n,a){let o,l=0,c=0,h=0;for(const d of r){const t=e.get(d),r=t.box;o&&o!=r&&(a||ek.models.addBox(o),c+=tk.boxMargin+o.margin),r&&r!=o&&(a||(r.x=l+c,r.y=s),c+=r.margin),t.width=t.width||tk.width,t.height=Xi.getMax(t.height||tk.height,tk.height),t.margin=t.margin||tk.actorMargin,h=Xi.getMax(h,t.height),i.get(t.name)&&(c+=t.width/2),t.x=l+c,t.starty=ek.getVerticalPos(),ek.insert(t.x,s,t.x+t.width,t.height),l+=t.width+c,t.box&&(t.box.width=l+r.margin-t.box.x),c=t.margin,o=t.box,ek.models.addActor(t)}o&&!a&&ek.models.addBox(o),ek.bumpVerticalPos(h)}),"addActorRenderingData"),ck=we((async function(t,e,i,r){if(r){let r=0;ek.bumpVerticalPos(2*tk.boxMargin);for(const s of i){const i=e.get(s);i.stopy||(i.stopy=ek.getVerticalPos());const n=await Jb.drawActor(t,i,tk,!0);r=Xi.getMax(r,n)}ek.bumpVerticalPos(r+tk.boxMargin)}else for(const s of i){const i=e.get(s);await Jb.drawActor(t,i,tk,!1)}}),"drawActors"),hk=we((function(t,e,i,r){let s=0,n=0;for(const a of i){const i=e.get(a),o=xk(i),l=Jb.drawPopup(t,i,o,tk,tk.forceMenus,r);l.height>s&&(s=l.height),l.width+i.x>n&&(n=l.width+i.x)}return{maxHeight:s,maxWidth:n}}),"drawActorsPopup"),dk=we((function(t){Re(tk,t),t.fontFamily&&(tk.actorFontFamily=tk.noteFontFamily=tk.messageFontFamily=t.fontFamily),t.fontSize&&(tk.actorFontSize=tk.noteFontSize=tk.messageFontSize=t.fontSize),t.fontWeight&&(tk.actorFontWeight=tk.noteFontWeight=tk.messageFontWeight=t.fontWeight)}),"setConf"),uk=we((function(t){return ek.activations.filter((function(e){return e.actor===t}))}),"actorActivations"),pk=we((function(t,e){const i=e.get(t),r=uk(t);return[r.reduce((function(t,e){return Xi.getMin(t,e.startx)}),i.x+i.width/2-1),r.reduce((function(t,e){return Xi.getMax(t,e.stopx)}),i.x+i.width/2+1)]}),"activationBounds");function gk(t,e,i,r,s){ek.bumpVerticalPos(i);let n=r;if(e.id&&e.message&&t[e.id]){const i=t[e.id].width,s=rk(tk);e.message=mo.wrapLabel(`[${e.message}]`,i-2*tk.wrapPadding,s),e.width=i,e.wrap=!0;const a=mo.calculateTextDimensions(e.message,s),o=Xi.getMax(a.height,tk.labelBoxHeight);n=r+o,ve.debug(`${o} - ${e.message}`)}s(e),ek.bumpVerticalPos(n)}function yk(t,e,i,r,s,n,a){function o(i,r){i.x{t.add(e.from),t.add(e.to)})),g=g.filter((e=>t.has(e)))}lk(c,h,d,g,0,y,!1);const k=await Sk(y,h,b,r);function C(t,e){const i=ek.endActivation(t);i.starty+18>e&&(i.starty=e-6,e+=12),Jb.drawActivation(c,i,e,tk,uk(t.from).length),ek.insert(i.startx,e-10,i.stopx,e)}Jb.insertArrowHead(c),Jb.insertArrowCrossHead(c),Jb.insertArrowFilledHead(c),Jb.insertSequenceNumber(c),we(C,"activeEnd");let S=1,w=1;const T=[],_=[];let v=0;for(const N of y){let t,e,i;switch(N.type){case r.db.LINETYPE.NOTE:ek.resetVerticalPos(),e=N.noteModel,await ik(c,e);break;case r.db.LINETYPE.ACTIVE_START:ek.newActivation(N,c,h);break;case r.db.LINETYPE.ACTIVE_END:C(N,ek.getVerticalPos());break;case r.db.LINETYPE.LOOP_START:gk(k,N,tk.boxMargin,tk.boxMargin+tk.boxTextMargin,(t=>ek.newLoop(t)));break;case r.db.LINETYPE.LOOP_END:t=ek.endLoop(),await Jb.drawLoop(c,t,"loop",tk),ek.bumpVerticalPos(t.stopy-ek.getVerticalPos()),ek.models.addLoop(t);break;case r.db.LINETYPE.RECT_START:gk(k,N,tk.boxMargin,tk.boxMargin,(t=>ek.newLoop(void 0,t.message)));break;case r.db.LINETYPE.RECT_END:t=ek.endLoop(),_.push(t),ek.models.addLoop(t),ek.bumpVerticalPos(t.stopy-ek.getVerticalPos());break;case r.db.LINETYPE.OPT_START:gk(k,N,tk.boxMargin,tk.boxMargin+tk.boxTextMargin,(t=>ek.newLoop(t)));break;case r.db.LINETYPE.OPT_END:t=ek.endLoop(),await Jb.drawLoop(c,t,"opt",tk),ek.bumpVerticalPos(t.stopy-ek.getVerticalPos()),ek.models.addLoop(t);break;case r.db.LINETYPE.ALT_START:gk(k,N,tk.boxMargin,tk.boxMargin+tk.boxTextMargin,(t=>ek.newLoop(t)));break;case r.db.LINETYPE.ALT_ELSE:gk(k,N,tk.boxMargin+tk.boxTextMargin,tk.boxMargin,(t=>ek.addSectionToLoop(t)));break;case r.db.LINETYPE.ALT_END:t=ek.endLoop(),await Jb.drawLoop(c,t,"alt",tk),ek.bumpVerticalPos(t.stopy-ek.getVerticalPos()),ek.models.addLoop(t);break;case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:gk(k,N,tk.boxMargin,tk.boxMargin+tk.boxTextMargin,(t=>ek.newLoop(t))),ek.saveVerticalPos();break;case r.db.LINETYPE.PAR_AND:gk(k,N,tk.boxMargin+tk.boxTextMargin,tk.boxMargin,(t=>ek.addSectionToLoop(t)));break;case r.db.LINETYPE.PAR_END:t=ek.endLoop(),await Jb.drawLoop(c,t,"par",tk),ek.bumpVerticalPos(t.stopy-ek.getVerticalPos()),ek.models.addLoop(t);break;case r.db.LINETYPE.AUTONUMBER:S=N.message.start||S,w=N.message.step||w,N.message.visible?r.db.enableSequenceNumbers():r.db.disableSequenceNumbers();break;case r.db.LINETYPE.CRITICAL_START:gk(k,N,tk.boxMargin,tk.boxMargin+tk.boxTextMargin,(t=>ek.newLoop(t)));break;case r.db.LINETYPE.CRITICAL_OPTION:gk(k,N,tk.boxMargin+tk.boxTextMargin,tk.boxMargin,(t=>ek.addSectionToLoop(t)));break;case r.db.LINETYPE.CRITICAL_END:t=ek.endLoop(),await Jb.drawLoop(c,t,"critical",tk),ek.bumpVerticalPos(t.stopy-ek.getVerticalPos()),ek.models.addLoop(t);break;case r.db.LINETYPE.BREAK_START:gk(k,N,tk.boxMargin,tk.boxMargin+tk.boxTextMargin,(t=>ek.newLoop(t)));break;case r.db.LINETYPE.BREAK_END:t=ek.endLoop(),await Jb.drawLoop(c,t,"break",tk),ek.bumpVerticalPos(t.stopy-ek.getVerticalPos()),ek.models.addLoop(t);break;default:try{i=N.msgModel,i.starty=ek.getVerticalPos(),i.sequenceIndex=S,i.sequenceVisible=r.db.showSequenceNumbers();const t=await ak(0,i);yk(N,i,t,v,h,d,u),T.push({messageModel:i,lineStartY:t}),ek.models.addMessage(i)}catch(F){ve.error("error while drawing message",F)}}[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,r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(N.type)&&(S+=w),v++}ve.debug("createdActors",d),ve.debug("destroyedActors",u),await ck(c,h,g,!1);for(const N of T)await ok(c,N.messageModel,N.lineStartY,r);tk.mirrorActors&&await ck(c,h,g,!0),_.forEach((t=>Jb.drawBackgroundRect(c,t))),Ib(c,h,g,tk);for(const N of ek.models.boxes)N.height=ek.getVerticalPos()-N.y,ek.insert(N.x,N.y,N.x+N.width,N.height),N.startx=N.x,N.starty=N.y,N.stopx=N.startx+N.width,N.stopy=N.starty+N.height,N.stroke="rgb(0,0,0, 0.5)",Jb.drawBox(c,N,tk);m&&ek.bumpVerticalPos(tk.boxMargin);const E=hk(c,h,g,l),{bounds:A}=ek.getBounds();void 0===A.startx&&(A.startx=0),void 0===A.starty&&(A.starty=0),void 0===A.stopx&&(A.stopx=0),void 0===A.stopy&&(A.stopy=0);let L=A.stopy-A.starty;L{const i=rk(tk);let r=e.actorKeys.reduce(((e,i)=>e+(t.get(i).width+(t.get(i).margin||0))),0);r-=2*tk.boxTextMargin,e.wrap&&(e.name=mo.wrapLabel(e.name,r-2*tk.wrapPadding,i));const n=mo.calculateTextDimensions(e.name,i);s=Xi.getMax(n.height,s);const a=Xi.getMax(r,n.width+2*tk.wrapPadding);if(e.margin=tk.boxTextMargin,rt.textMaxHeight=s)),Xi.getMax(r,tk.height)}we(bk,"calculateActorMargins");var kk=we((async function(t,e,i){const r=e.get(t.from),s=e.get(t.to),n=r.x,a=s.x,o=t.wrap&&t.message;let l=Ui(t.message)?await Hi(t.message,mr()):mo.calculateTextDimensions(o?mo.wrapLabel(t.message,tk.width,sk(tk)):t.message,sk(tk));const c={width:o?tk.width:Xi.getMax(tk.width,l.width+2*tk.noteMargin),height:0,startx:r.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===i.db.PLACEMENT.RIGHTOF?(c.width=o?Xi.getMax(tk.width,l.width):Xi.getMax(r.width/2+s.width/2,l.width+2*tk.noteMargin),c.startx=n+(r.width+tk.actorMargin)/2):t.placement===i.db.PLACEMENT.LEFTOF?(c.width=o?Xi.getMax(tk.width,l.width+2*tk.noteMargin):Xi.getMax(r.width/2+s.width/2,l.width+2*tk.noteMargin),c.startx=n-c.width+(r.width-tk.actorMargin)/2):t.to===t.from?(l=mo.calculateTextDimensions(o?mo.wrapLabel(t.message,Xi.getMax(tk.width,r.width),sk(tk)):t.message,sk(tk)),c.width=o?Xi.getMax(tk.width,r.width):Xi.getMax(r.width,tk.width,l.width+2*tk.noteMargin),c.startx=n+(r.width-c.width)/2):(c.width=Math.abs(n+r.width/2-(a+s.width/2))+tk.actorMargin,c.startx=n2,d=we((t=>o?-t:t),"adjustValue");t.from===t.to?c=l:(t.activate&&!h&&(c+=d(tk.activationWidth/2-1)),[i.db.LINETYPE.SOLID_OPEN,i.db.LINETYPE.DOTTED_OPEN].includes(t.type)||(c+=d(3)),[i.db.LINETYPE.BIDIRECTIONAL_SOLID,i.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)&&(l-=d(3)));const u=[r,s,n,a],p=Math.abs(l-c);t.wrap&&t.message&&(t.message=mo.wrapLabel(t.message,Xi.getMax(p+2*tk.wrapPadding,tk.width),rk(tk)));const g=mo.calculateTextDimensions(t.message,rk(tk));return{width:Xi.getMax(t.wrap?0:g.width+2*tk.wrapPadding,p+2*tk.wrapPadding,tk.width),height:0,startx:l,stopx:c,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,u),toBounds:Math.max.apply(null,u)}}),"buildMessageModel"),Sk=we((async function(t,e,i,r){const s={},n=[];let a,o,l;for(const c of t){switch(c.type){case r.db.LINETYPE.LOOP_START:case r.db.LINETYPE.ALT_START:case r.db.LINETYPE.OPT_START:case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:case r.db.LINETYPE.CRITICAL_START:case r.db.LINETYPE.BREAK_START:n.push({id:c.id,msg:c.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case r.db.LINETYPE.ALT_ELSE:case r.db.LINETYPE.PAR_AND:case r.db.LINETYPE.CRITICAL_OPTION:c.message&&(a=n.pop(),s[a.id]=a,s[c.id]=a,n.push(a));break;case r.db.LINETYPE.LOOP_END:case r.db.LINETYPE.ALT_END:case r.db.LINETYPE.OPT_END:case r.db.LINETYPE.PAR_END:case r.db.LINETYPE.CRITICAL_END:case r.db.LINETYPE.BREAK_END:a=n.pop(),s[a.id]=a;break;case r.db.LINETYPE.ACTIVE_START:{const t=e.get(c.from?c.from:c.to.actor),i=uk(c.from?c.from:c.to.actor).length,r=t.x+t.width/2+(i-1)*tk.activationWidth/2,s={startx:r,stopx:r+tk.activationWidth,actor:c.from,enabled:!0};ek.activations.push(s)}break;case r.db.LINETYPE.ACTIVE_END:{const t=ek.activations.map((t=>t.actor)).lastIndexOf(c.from);ek.activations.splice(t,1).splice(0,1)}}void 0!==c.placement?(o=await kk(c,e,r),c.noteModel=o,n.forEach((t=>{a=t,a.from=Xi.getMin(a.from,o.startx),a.to=Xi.getMax(a.to,o.startx+o.width),a.width=Xi.getMax(a.width,Math.abs(a.from-a.to))-tk.labelBoxWidth}))):(l=Ck(c,e,r),c.msgModel=l,l.startx&&l.stopx&&n.length>0&&n.forEach((t=>{if(a=t,l.startx===l.stopx){const t=e.get(c.from),i=e.get(c.to);a.from=Xi.getMin(t.x-l.width/2,t.x-t.width/2,a.from),a.to=Xi.getMax(i.x+l.width/2,i.x+t.width/2,a.to),a.width=Xi.getMax(a.width,Math.abs(a.to-a.from))-tk.labelBoxWidth}else a.from=Xi.getMin(l.startx,a.from),a.to=Xi.getMax(l.stopx,a.to),a.width=Xi.getMax(a.width,l.width)-tk.labelBoxWidth})))}return ek.activations=[],ve.debug("Loop type widths:",s),s}),"calculateLoopBounds"),wk={bounds:ek,drawActors:ck,drawActorsPopup:hk,setConf:dk,draw:fk},Tk={parser:mb,get db(){return new Cb},renderer:wk,styles:Sb,init:we((t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,xr({sequence:{wrap:t.wrap}}))}),"init")};const _k=Object.defineProperty({__proto__:null,diagram:Tk},Symbol.toStringTag,{value:"Module"});var vk=function(){var t=we((function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i}),"o"),e=[1,18],i=[1,19],r=[1,20],s=[1,41],n=[1,42],a=[1,26],o=[1,24],l=[1,25],c=[1,32],h=[1,33],d=[1,34],u=[1,45],p=[1,35],g=[1,36],y=[1,37],f=[1,38],m=[1,27],x=[1,28],b=[1,29],k=[1,30],C=[1,31],S=[1,44],w=[1,46],T=[1,43],_=[1,47],v=[1,9],E=[1,8,9],A=[1,58],L=[1,59],B=[1,60],$=[1,61],D=[1,62],I=[1,63],F=[1,64],N=[1,8,9,41],O=[1,76],M=[1,8,9,12,13,22,39,41,44,66,67,68,69,70,71,72,77,79],R=[1,8,9,12,13,17,20,22,39,41,44,48,58,66,67,68,69,70,71,72,77,79,84,99,101,102],P=[13,58,84,99,101,102],q=[13,58,71,72,84,99,101,102],z=[13,58,66,67,68,69,70,84,99,101,102],W=[1,98],j=[1,115],Y=[1,107],U=[1,113],H=[1,108],V=[1,109],X=[1,110],G=[1,111],K=[1,112],Q=[1,114],Z=[22,58,59,80,84,85,86,87,88,89],J=[1,8,9,39,41,44],tt=[1,8,9,22],et=[1,143],it=[1,8,9,59],rt=[1,8,9,22,58,59,80,84,85,86,87,88,89],st={trace:we((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,DOT:17,className:18,classLiteralName:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,CLASS:46,ANNOTATION_START:47,ANNOTATION_END:48,MEMBER:49,SEPARATOR:50,relation:51,NOTE_FOR:52,noteText:53,NOTE:54,CLASSDEF:55,classList:56,stylesOpt:57,ALPHA:58,COMMA:59,direction_tb:60,direction_bt:61,direction_rl:62,direction_lr:63,relationType:64,lineType:65,AGGREGATION:66,EXTENSION:67,COMPOSITION:68,DEPENDENCY:69,LOLLIPOP:70,LINE:71,DOTTED_LINE:72,CALLBACK:73,LINK:74,LINK_TARGET:75,CLICK:76,CALLBACK_NAME:77,CALLBACK_ARGS:78,HREF:79,STYLE:80,CSSCLASS:81,style:82,styleComponent:83,NUM:84,COLON:85,UNIT:86,SPACE:87,BRKT:88,PCT:89,commentToken:90,textToken:91,graphCodeTokens:92,textNoTagsToken:93,TAGSTART:94,TAGEND:95,"==":96,"--":97,DEFAULT:98,MINUS:99,keywords:100,UNICODE_TEXT:101,BQUOTE_STR:102,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",17:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"CLASS",47:"ANNOTATION_START",48:"ANNOTATION_END",49:"MEMBER",50:"SEPARATOR",52:"NOTE_FOR",54:"NOTE",55:"CLASSDEF",58:"ALPHA",59:"COMMA",60:"direction_tb",61:"direction_bt",62:"direction_rl",63:"direction_lr",66:"AGGREGATION",67:"EXTENSION",68:"COMPOSITION",69:"DEPENDENCY",70:"LOLLIPOP",71:"LINE",72:"DOTTED_LINE",73:"CALLBACK",74:"LINK",75:"LINK_TARGET",76:"CLICK",77:"CALLBACK_NAME",78:"CALLBACK_ARGS",79:"HREF",80:"STYLE",81:"CSSCLASS",84:"NUM",85:"COLON",86:"UNIT",87:"SPACE",88:"BRKT",89:"PCT",92:"graphCodeTokens",94:"TAGSTART",95:"TAGEND",96:"==",97:"--",98:"DEFAULT",99:"MINUS",100:"keywords",101:"UNICODE_TEXT",102:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,3],[15,2],[18,1],[18,3],[18,1],[18,2],[18,2],[18,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,6],[43,2],[43,3],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[56,1],[56,3],[32,1],[32,1],[32,1],[32,1],[51,3],[51,2],[51,2],[51,1],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[57,1],[57,3],[82,1],[82,2],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[90,1],[90,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[93,1],[93,1],[93,1],[93,1],[16,1],[16,1],[16,1],[16,1],[19,1],[53,1]],performAction:we((function(t,e,i,r,s,n,a){var o=n.length-1;switch(s){case 8:this.$=n[o-1];break;case 9:case 12:case 14:this.$=n[o];break;case 10:case 13:this.$=n[o-2]+"."+n[o];break;case 11:case 15:case 95:this.$=n[o-1]+n[o];break;case 16:case 17:this.$=n[o-1]+"~"+n[o]+"~";break;case 18:r.addRelation(n[o]);break;case 19:n[o-1].title=r.cleanupLabel(n[o]),r.addRelation(n[o-1]);break;case 30:this.$=n[o].trim(),r.setAccTitle(this.$);break;case 31:case 32:this.$=n[o].trim(),r.setAccDescription(this.$);break;case 33:r.addClassesToNamespace(n[o-3],n[o-1]);break;case 34:r.addClassesToNamespace(n[o-4],n[o-1]);break;case 35:this.$=n[o],r.addNamespace(n[o]);break;case 36:case 46:case 59:case 92:this.$=[n[o]];break;case 37:this.$=[n[o-1]];break;case 38:n[o].unshift(n[o-2]),this.$=n[o];break;case 40:r.setCssClass(n[o-2],n[o]);break;case 41:r.addMembers(n[o-3],n[o-1]);break;case 42:r.setCssClass(n[o-5],n[o-3]),r.addMembers(n[o-5],n[o-1]);break;case 43:this.$=n[o],r.addClass(n[o]);break;case 44:this.$=n[o-1],r.addClass(n[o-1]),r.setClassLabel(n[o-1],n[o]);break;case 45:r.addAnnotation(n[o],n[o-2]);break;case 47:n[o].push(n[o-1]),this.$=n[o];break;case 48:case 50:case 51:break;case 49:r.addMember(n[o-1],r.cleanupLabel(n[o]));break;case 52:this.$={id1:n[o-2],id2:n[o],relation:n[o-1],relationTitle1:"none",relationTitle2:"none"};break;case 53:this.$={id1:n[o-3],id2:n[o],relation:n[o-1],relationTitle1:n[o-2],relationTitle2:"none"};break;case 54:this.$={id1:n[o-3],id2:n[o],relation:n[o-2],relationTitle1:"none",relationTitle2:n[o-1]};break;case 55:this.$={id1:n[o-4],id2:n[o],relation:n[o-2],relationTitle1:n[o-3],relationTitle2:n[o-1]};break;case 56:r.addNote(n[o],n[o-1]);break;case 57:r.addNote(n[o]);break;case 58:this.$=n[o-2],r.defineClass(n[o-1],n[o]);break;case 60:this.$=n[o-2].concat([n[o]]);break;case 61:r.setDirection("TB");break;case 62:r.setDirection("BT");break;case 63:r.setDirection("RL");break;case 64:r.setDirection("LR");break;case 65:this.$={type1:n[o-2],type2:n[o],lineType:n[o-1]};break;case 66:this.$={type1:"none",type2:n[o],lineType:n[o-1]};break;case 67:this.$={type1:n[o-1],type2:"none",lineType:n[o]};break;case 68:this.$={type1:"none",type2:"none",lineType:n[o]};break;case 69:this.$=r.relationType.AGGREGATION;break;case 70:this.$=r.relationType.EXTENSION;break;case 71:this.$=r.relationType.COMPOSITION;break;case 72:this.$=r.relationType.DEPENDENCY;break;case 73:this.$=r.relationType.LOLLIPOP;break;case 74:this.$=r.lineType.LINE;break;case 75:this.$=r.lineType.DOTTED_LINE;break;case 76:case 82:this.$=n[o-2],r.setClickEvent(n[o-1],n[o]);break;case 77:case 83:this.$=n[o-3],r.setClickEvent(n[o-2],n[o-1]),r.setTooltip(n[o-2],n[o]);break;case 78:this.$=n[o-2],r.setLink(n[o-1],n[o]);break;case 79:this.$=n[o-3],r.setLink(n[o-2],n[o-1],n[o]);break;case 80:this.$=n[o-3],r.setLink(n[o-2],n[o-1]),r.setTooltip(n[o-2],n[o]);break;case 81:this.$=n[o-4],r.setLink(n[o-3],n[o-2],n[o]),r.setTooltip(n[o-3],n[o-1]);break;case 84:this.$=n[o-3],r.setClickEvent(n[o-2],n[o-1],n[o]);break;case 85:this.$=n[o-4],r.setClickEvent(n[o-3],n[o-2],n[o-1]),r.setTooltip(n[o-3],n[o]);break;case 86:this.$=n[o-3],r.setLink(n[o-2],n[o]);break;case 87:this.$=n[o-4],r.setLink(n[o-3],n[o-1],n[o]);break;case 88:this.$=n[o-4],r.setLink(n[o-3],n[o-1]),r.setTooltip(n[o-3],n[o]);break;case 89:this.$=n[o-5],r.setLink(n[o-4],n[o-2],n[o]),r.setTooltip(n[o-4],n[o-1]);break;case 90:this.$=n[o-2],r.setCssStyle(n[o-1],n[o]);break;case 91:r.setCssClass(n[o-1],n[o]);break;case 93:n[o-2].push(n[o]),this.$=n[o-2]}}),"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,18:21,19:40,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:i,37:r,38:22,42:s,43:23,46:n,47:a,49:o,50:l,52:c,54:h,55:d,58:u,60:p,61:g,62:y,63:f,73:m,74:x,76:b,80:k,81:C,84:S,99:w,101:T,102:_},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(v,[2,5],{8:[1,48]}),{8:[1,49]},t(E,[2,18],{22:[1,50]}),t(E,[2,20]),t(E,[2,21]),t(E,[2,22]),t(E,[2,23]),t(E,[2,24]),t(E,[2,25]),t(E,[2,26]),t(E,[2,27]),t(E,[2,28]),t(E,[2,29]),{34:[1,51]},{36:[1,52]},t(E,[2,32]),t(E,[2,48],{51:53,64:56,65:57,13:[1,54],22:[1,55],66:A,67:L,68:B,69:$,70:D,71:I,72:F}),{39:[1,65]},t(N,[2,39],{39:[1,67],44:[1,66]}),t(E,[2,50]),t(E,[2,51]),{16:68,58:u,84:S,99:w,101:T},{16:39,18:69,19:40,58:u,84:S,99:w,101:T,102:_},{16:39,18:70,19:40,58:u,84:S,99:w,101:T,102:_},{16:39,18:71,19:40,58:u,84:S,99:w,101:T,102:_},{58:[1,72]},{13:[1,73]},{16:39,18:74,19:40,58:u,84:S,99:w,101:T,102:_},{13:O,53:75},{56:77,58:[1,78]},t(E,[2,61]),t(E,[2,62]),t(E,[2,63]),t(E,[2,64]),t(M,[2,12],{16:39,19:40,18:80,17:[1,79],20:[1,81],58:u,84:S,99:w,101:T,102:_}),t(M,[2,14],{20:[1,82]}),{15:83,16:84,58:u,84:S,99:w,101:T},{16:39,18:85,19:40,58:u,84:S,99:w,101:T,102:_},t(R,[2,118]),t(R,[2,119]),t(R,[2,120]),t(R,[2,121]),t([1,8,9,12,13,20,22,39,41,44,66,67,68,69,70,71,72,77,79],[2,122]),t(v,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,18:21,38:22,43:23,16:39,19:40,5:86,33:e,35:i,37:r,42:s,46:n,47:a,49:o,50:l,52:c,54:h,55:d,58:u,60:p,61:g,62:y,63:f,73:m,74:x,76:b,80:k,81:C,84:S,99:w,101:T,102:_}),{5:87,10:5,16:39,18:21,19:40,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:i,37:r,38:22,42:s,43:23,46:n,47:a,49:o,50:l,52:c,54:h,55:d,58:u,60:p,61:g,62:y,63:f,73:m,74:x,76:b,80:k,81:C,84:S,99:w,101:T,102:_},t(E,[2,19]),t(E,[2,30]),t(E,[2,31]),{13:[1,89],16:39,18:88,19:40,58:u,84:S,99:w,101:T,102:_},{51:90,64:56,65:57,66:A,67:L,68:B,69:$,70:D,71:I,72:F},t(E,[2,49]),{65:91,71:I,72:F},t(P,[2,68],{64:92,66:A,67:L,68:B,69:$,70:D}),t(q,[2,69]),t(q,[2,70]),t(q,[2,71]),t(q,[2,72]),t(q,[2,73]),t(z,[2,74]),t(z,[2,75]),{8:[1,94],24:95,40:93,43:23,46:n},{16:96,58:u,84:S,99:w,101:T},{45:97,49:W},{48:[1,99]},{13:[1,100]},{13:[1,101]},{77:[1,102],79:[1,103]},{22:j,57:104,58:Y,80:U,82:105,83:106,84:H,85:V,86:X,87:G,88:K,89:Q},{58:[1,116]},{13:O,53:117},t(E,[2,57]),t(E,[2,123]),{22:j,57:118,58:Y,59:[1,119],80:U,82:105,83:106,84:H,85:V,86:X,87:G,88:K,89:Q},t(Z,[2,59]),{16:39,18:120,19:40,58:u,84:S,99:w,101:T,102:_},t(M,[2,15]),t(M,[2,16]),t(M,[2,17]),{39:[2,35]},{15:122,16:84,17:[1,121],39:[2,9],58:u,84:S,99:w,101:T},t(J,[2,43],{11:123,12:[1,124]}),t(v,[2,7]),{9:[1,125]},t(tt,[2,52]),{16:39,18:126,19:40,58:u,84:S,99:w,101:T,102:_},{13:[1,128],16:39,18:127,19:40,58:u,84:S,99:w,101:T,102:_},t(P,[2,67],{64:129,66:A,67:L,68:B,69:$,70:D}),t(P,[2,66]),{41:[1,130]},{24:95,40:131,43:23,46:n},{8:[1,132],41:[2,36]},t(N,[2,40],{39:[1,133]}),{41:[1,134]},{41:[2,46],45:135,49:W},{16:39,18:136,19:40,58:u,84:S,99:w,101:T,102:_},t(E,[2,76],{13:[1,137]}),t(E,[2,78],{13:[1,139],75:[1,138]}),t(E,[2,82],{13:[1,140],78:[1,141]}),{13:[1,142]},t(E,[2,90],{59:et}),t(it,[2,92],{83:144,22:j,58:Y,80:U,84:H,85:V,86:X,87:G,88:K,89:Q}),t(rt,[2,94]),t(rt,[2,96]),t(rt,[2,97]),t(rt,[2,98]),t(rt,[2,99]),t(rt,[2,100]),t(rt,[2,101]),t(rt,[2,102]),t(rt,[2,103]),t(rt,[2,104]),t(E,[2,91]),t(E,[2,56]),t(E,[2,58],{59:et}),{58:[1,145]},t(M,[2,13]),{15:146,16:84,58:u,84:S,99:w,101:T},{39:[2,11]},t(J,[2,44]),{13:[1,147]},{1:[2,4]},t(tt,[2,54]),t(tt,[2,53]),{16:39,18:148,19:40,58:u,84:S,99:w,101:T,102:_},t(P,[2,65]),t(E,[2,33]),{41:[1,149]},{24:95,40:150,41:[2,37],43:23,46:n},{45:151,49:W},t(N,[2,41]),{41:[2,47]},t(E,[2,45]),t(E,[2,77]),t(E,[2,79]),t(E,[2,80],{75:[1,152]}),t(E,[2,83]),t(E,[2,84],{13:[1,153]}),t(E,[2,86],{13:[1,155],75:[1,154]}),{22:j,58:Y,80:U,82:156,83:106,84:H,85:V,86:X,87:G,88:K,89:Q},t(rt,[2,95]),t(Z,[2,60]),{39:[2,10]},{14:[1,157]},t(tt,[2,55]),t(E,[2,34]),{41:[2,38]},{41:[1,158]},t(E,[2,81]),t(E,[2,85]),t(E,[2,87]),t(E,[2,88],{75:[1,159]}),t(it,[2,93],{83:144,22:j,58:Y,80:U,84:H,85:V,86:X,87:G,88:K,89:Q}),t(J,[2,8]),t(N,[2,42]),t(E,[2,89])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],83:[2,35],122:[2,11],125:[2,4],135:[2,47],146:[2,10],150:[2,38]},parseError:we((function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)}),"parseError"),parse:we((function(t){var e=this,i=[0],r=[],s=[null],n=[],a=this.table,o="",l=0,c=0,h=n.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;n.push(g);var y=d.options&&d.options.ranges;function f(){var t;return"number"!=typeof(t=r.pop()||d.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,we((function(t){i.length=i.length-2*t,s.length=s.length-t,n.length=n.length-t}),"popStack"),we(f,"lex");for(var m,x,b,k,C,S,w,T,_={};;){if(x=i[i.length-1],this.defaultActions[x]?b=this.defaultActions[x]:(null==m&&(m=f()),b=a[x]&&a[x][m]),void 0===b||!b.length||!b[0]){var v="";for(C in T=[],a[x])this.terminals_[C]&&C>2&&T.push("'"+this.terminals_[C]+"'");v=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(v,{text:d.match,token:this.terminals_[m]||m,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: "+x+", token: "+m);switch(b[0]){case 1:i.push(m),s.push(d.yytext),n.push(d.yylloc),i.push(b[1]),m=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(S=this.productions_[b[1]][1],_.$=s[s.length-S],_._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},y&&(_._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(k=this.performAction.apply(_,[o,c,l,u.yy,b[1],s,n].concat(h))))return k;S&&(i=i.slice(0,-1*S*2),s=s.slice(0,-1*S),n=n.slice(0,-1*S)),i.push(this.productions_[b[1]][0]),s.push(_.$),n.push(_._$),w=a[i[i.length-2]][i[i.length-1]],i.push(w);break;case 3:return!0}}return!0}),"parse")},nt=function(){return{EOF:1,parseError:we((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"), +// resets the lexer, sets new input +setInput:we((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}),"setInput"), +// consumes and returns one char from the input +input:we((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}),"input"), +// unshifts one char (or a string) into the input +unput:we((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 s=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=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"), +// When called from action, caches matched text and appends it on next action +more:we((function(){return this._more=!0,this}),"more"), +// 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:we((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})}),"reject"), +// retain first n characters of the match +less:we((function(t){this.unput(this.match.slice(t))}),"less"), +// displays already matched input, i.e. for error messages +pastInput:we((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"), +// displays upcoming input, i.e. for error messages +upcomingInput:we((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,"")}),"upcomingInput"), +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:we((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"), +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:we((function(t,e){var i,r,s;if(this.options.backtrack_lexer&&(s={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&&(s.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 n in s)this[n]=s[n];return!1}return!1}),"test_match"), +// return next match in input +next:we((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 s=this._currentRules(),n=0;ne[0].length)){if(e=i,r=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[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})}),"next"), +// return next match that has a token +lex:we((function(){var t=this.next();return t||this.lex()}),"lex"), +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:we((function(t){this.conditionStack.push(t)}),"begin"), +// pop the previously active lexer condition state off the condition stack +popState:we((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"), +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:we((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"), +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:we((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"), +// alias for begin(condition) +pushState:we((function(t){this.begin(t)}),"pushState"), +// return the number of states currently on the stack +stateStackSize:we((function(){return this.conditionStack.length}),"stateStackSize"),options:{},performAction:we((function(t,e,i,r){switch(i){case 0:return 60;case 1:return 61;case 2:return 62;case 3:return 63;case 4:case 5:case 14:case 31:case 36:case 40:case 47:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:case 19:case 22:case 24:case 58:case 61:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:case 35:return 8;case 15:case 16:return 7;case 17:case 37:case 45:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 77;case 23:return 78;case 25:return"STR";case 26:this.begin("string");break;case 27:return 80;case 28:return 55;case 29:return this.begin("namespace"),42;case 30:case 39:return this.popState(),8;case 32:return this.begin("namespace-body"),39;case 33:case 43:return this.popState(),41;case 34:case 44:return"EOF_IN_STRUCT";case 38:return this.begin("class"),46;case 41:return this.popState(),this.popState(),41;case 42:return this.begin("class-body"),39;case 46:return"OPEN_IN_STRUCT";case 48:return"MEMBER";case 49:return 81;case 50:return 73;case 51:return 74;case 52:return 76;case 53:return 52;case 54:return 54;case 55:return 47;case 56:return 48;case 57:return 79;case 59:return"GENERICTYPE";case 60:this.begin("generic");break;case 62:return"BQUOTE_STR";case 63:this.begin("bqstring");break;case 64:case 65:case 66:case 67:return 75;case 68:case 69:return 67;case 70:case 71:return 69;case 72:return 68;case 73:return 66;case 74:return 70;case 75:return 71;case 76:return 72;case 77:return 22;case 78:return 44;case 79:return 99;case 80:return 17;case 81:return"PLUS";case 82:return 85;case 83:return 59;case 84:case 85:return 88;case 86:return 89;case 87:case 88:return"EQUALS";case 89:return 58;case 90:return 12;case 91:return 14;case 92:return"PUNCTUATION";case 93:return 84;case 94:return 101;case 95:case 96:return 87;case 97:return 9}}),"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\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)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_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)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,33,34,35,36,37,38,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},namespace:{rules:[26,29,30,31,32,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},"class-body":{rules:[26,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},class:{rules:[26,39,40,41,42,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_descr:{rules:[9,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_title:{rules:[7,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},callback_args:{rules:[22,23,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},callback_name:{rules:[19,20,21,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},href:{rules:[26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},struct:{rules:[26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},generic:{rules:[26,49,50,51,52,53,54,55,56,57,58,59,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},bqstring:{rules:[26,49,50,51,52,53,54,55,56,57,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},string:{rules:[24,25,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,38,49,50,51,52,53,54,55,56,57,60,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],inclusive:!0}}}}();function at(){this.yy={}}return st.lexer=nt,we(at,"Parser"),at.prototype=st,st.Parser=at,new at}();vk.parser=vk;var Ek=vk,Ak=["#","+","~","-",""],Lk=(we(L=class{constructor(t,e){this.memberType=e,this.visibility="",this.classifier="",this.text="";const i=Li(t,mr());this.parseMember(i)}getDisplayDetails(){let t=this.visibility+Pi(this.id);"method"===this.memberType&&(t+=`(${Pi(this.parameters.trim())})`,this.returnType&&(t+=" : "+Pi(this.returnType))),t=t.trim();return{displayText:t,cssStyle:this.parseClassifier()}}parseMember(t){let e="";if("method"===this.memberType){const i=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(t);if(i){const t=i[1]?i[1].trim():"";if(Ak.includes(t)&&(this.visibility=t),this.id=i[2],this.parameters=i[3]?i[3].trim():"",e=i[4]?i[4].trim():"",this.returnType=i[5]?i[5].trim():"",""===e){const t=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(t)&&(e=t,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const i=t.length,r=t.substring(0,1),s=t.substring(i-1);Ak.includes(r)&&(this.visibility=r),/[$*]/.exec(s)&&(e=s),this.id=t.substring(""===this.visibility?0:1,""===e?i:i-1)}this.classifier=e,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const i=`${this.visibility?"\\"+this.visibility:""}${Pi(this.id)}${"method"===this.memberType?`(${Pi(this.parameters)})${this.returnType?" : "+Pi(this.returnType):""}`:""}`;this.text=i.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},"ClassMember"),L),Bk="classId-",$k=0,Dk=we((t=>Xi.sanitizeText(t,mr())),"sanitizeText"),Ik=(we(B=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=[],this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=we((t=>{let e=K(".mermaidTooltip");null===(e._groups||e)[0][0]&&(e=K("body").append("div").attr("class","mermaidTooltip").style("opacity",0));K(t).select("svg").selectAll("g.node").on("mouseover",(t=>{const i=K(t.currentTarget);if(null===i.attr("title"))return;const r=this.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.text(i.attr("title")).style("left",window.scrollX+r.left+(r.right-r.left)/2+"px").style("top",window.scrollY+r.top-14+document.body.scrollTop+"px"),e.html(e.html().replace(/<br\/>/g,"
")),i.classed("hover",!0)})).on("mouseout",(t=>{e.transition().duration(500).style("opacity",0);K(t.currentTarget).classed("hover",!1)}))}),"setupToolTips"),this.direction="TB",this.setAccTitle=cr,this.getAccTitle=hr,this.setAccDescription=dr,this.getAccDescription=ur,this.setDiagramTitle=pr,this.getDiagramTitle=gr,this.getConfig=we((()=>mr().class),"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}splitClassNameAndType(t){const e=Xi.sanitizeText(t,mr());let i="",r=e;if(e.indexOf("~")>0){const t=e.split("~");r=Dk(t[0]),i=Dk(t[1])}return{className:r,type:i}}setClassLabel(t,e){const i=Xi.sanitizeText(t,mr());e&&(e=Dk(e));const{className:r}=this.splitClassNameAndType(i);this.classes.get(r).label=e,this.classes.get(r).text=`${e}${this.classes.get(r).type?`<${this.classes.get(r).type}>`:""}`} +/** + * Function called by parser when a node definition has been found. + * + * @param id - Id of the class to add + * @public + */addClass(t){const e=Xi.sanitizeText(t,mr()),{className:i,type:r}=this.splitClassNameAndType(e);if(this.classes.has(i))return;const s=Xi.sanitizeText(i,mr());this.classes.set(s,{id:s,type:r,label:s,text:`${s}${r?`<${r}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:Bk+s+"-"+$k}),$k++}addInterface(t,e){const i={id:`interface${this.interfaces.length}`,label:t,classId:e};this.interfaces.push(i)} +/** + * Function to lookup domId from id in the graph definition. + * + * @param id - class ID to lookup + * @public + */lookUpDomId(t){const e=Xi.sanitizeText(t,mr());if(this.classes.has(e))return this.classes.get(e).domId;throw new Error("Class not found: "+e)}clear(){this.relations=[],this.classes=new Map,this.notes=[],this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.direction="TB",lr()}getClass(t){return this.classes.get(t)}getClasses(){return this.classes}getRelations(){return this.relations}getNotes(){return this.notes}addRelation(t){ve.debug("Adding relation: "+JSON.stringify(t));const e=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];t.relation.type1!==this.relationType.LOLLIPOP||e.includes(t.relation.type2)?t.relation.type2!==this.relationType.LOLLIPOP||e.includes(t.relation.type1)?(this.addClass(t.id1),this.addClass(t.id2)):(this.addClass(t.id1),this.addInterface(t.id2,t.id1),t.id2="interface"+(this.interfaces.length-1)):(this.addClass(t.id2),this.addInterface(t.id1,t.id2),t.id1="interface"+(this.interfaces.length-1)),t.id1=this.splitClassNameAndType(t.id1).className,t.id2=this.splitClassNameAndType(t.id2).className,t.relationTitle1=Xi.sanitizeText(t.relationTitle1.trim(),mr()),t.relationTitle2=Xi.sanitizeText(t.relationTitle2.trim(),mr()),this.relations.push(t)} +/** + * Adds an annotation to the specified class Annotations mark special properties of the given type + * (like 'interface' or 'service') + * + * @param className - The class name + * @param annotation - The name of the annotation without any brackets + * @public + */addAnnotation(t,e){const i=this.splitClassNameAndType(t).className;this.classes.get(i).annotations.push(e)} +/** + * Adds a member to the specified class + * + * @param className - The class name + * @param member - The full name of the member. If the member is enclosed in `<>` it is + * treated as an annotation If the member is ending with a closing bracket ) it is treated as a + * method Otherwise the member will be treated as a normal property + * @public + */addMember(t,e){this.addClass(t);const i=this.splitClassNameAndType(t).className,r=this.classes.get(i);if("string"==typeof e){const t=e.trim();t.startsWith("<<")&&t.endsWith(">>")?r.annotations.push(Dk(t.substring(2,t.length-2))):t.indexOf(")")>0?r.methods.push(new Lk(t,"method")):t&&r.members.push(new Lk(t,"attribute"))}}addMembers(t,e){Array.isArray(e)&&(e.reverse(),e.forEach((e=>this.addMember(t,e))))}addNote(t,e){const i={id:`note${this.notes.length}`,class:e,text:t};this.notes.push(i)}cleanupLabel(t){return t.startsWith(":")&&(t=t.substring(1)),Dk(t.trim())} +/** + * Called by parser when assigning cssClass to a class + * + * @param ids - Comma separated list of ids + * @param className - Class to add + */setCssClass(t,e){t.split(",").forEach((t=>{let i=t;/\d/.exec(t[0])&&(i=Bk+i);const r=this.classes.get(i);r&&(r.cssClasses+=" "+e)}))}defineClass(t,e){for(const i of t){let t=this.styleClasses.get(i);void 0===t&&(t={id:i,styles:[],textStyles:[]},this.styleClasses.set(i,t)),e&&e.forEach((e=>{if(/color/.exec(e)){const i=e.replace("fill","bgFill");t.textStyles.push(i)}t.styles.push(e)})),this.classes.forEach((t=>{t.cssClasses.includes(i)&&t.styles.push(...e.flatMap((t=>t.split(","))))}))}} +/** + * Called by parser when a tooltip is found, e.g. a clickable element. + * + * @param ids - Comma separated list of ids + * @param tooltip - Tooltip to add + */setTooltip(t,e){t.split(",").forEach((t=>{void 0!==e&&(this.classes.get(t).tooltip=Dk(e))}))}getTooltip(t,e){return e&&this.namespaces.has(e)?this.namespaces.get(e).classes.get(t).tooltip:this.classes.get(t).tooltip} +/** + * Called by parser when a link is found. Adds the URL to the vertex data. + * + * @param ids - Comma separated list of ids + * @param linkStr - URL to create a link for + * @param target - Target of the link, _blank by default as originally defined in the svgDraw.js file + */setLink(t,e,i){const r=mr();t.split(",").forEach((t=>{let s=t;/\d/.exec(t[0])&&(s=Bk+s);const n=this.classes.get(s);n&&(n.link=mo.formatUrl(e,r),"sandbox"===r.securityLevel?n.linkTarget="_top":n.linkTarget="string"==typeof i?Dk(i):"_blank")})),this.setCssClass(t,"clickable")} +/** + * Called by parser when a click definition is found. Registers an event handler. + * + * @param ids - Comma separated list of ids + * @param functionName - Function to be called on click + * @param functionArgs - Function args the function should be called with + */setClickEvent(t,e,i){t.split(",").forEach((t=>{this.setClickFunc(t,e,i),this.classes.get(t).haveCallback=!0})),this.setCssClass(t,"clickable")}setClickFunc(t,e,i){const r=Xi.sanitizeText(t,mr());if("loose"!==mr().securityLevel)return;if(void 0===e)return;const s=r;if(this.classes.has(s)){const t=this.lookUpDomId(s);let r=[];if("string"==typeof i){r=i.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t{const i=document.querySelector(`[id="${t}"]`);null!==i&&i.addEventListener("click",(()=>{mo.runFunc(e,...r)}),!1)}))}}bindFunctions(t){this.functions.forEach((e=>{e(t)}))}getDirection(){return this.direction}setDirection(t){this.direction=t} +/** + * Function called by parser when a namespace definition has been found. + * + * @param id - Id of the namespace to add + * @public + */addNamespace(t){this.namespaces.has(t)||(this.namespaces.set(t,{id:t,classes:new Map,children:{},domId:Bk+t+"-"+this.namespaceCounter}),this.namespaceCounter++)}getNamespace(t){return this.namespaces.get(t)}getNamespaces(){return this.namespaces} +/** + * Function called by parser when a namespace definition has been found. + * + * @param id - Id of the namespace to add + * @param classNames - Ids of the class to add + * @public + */addClassesToNamespace(t,e){if(this.namespaces.has(t))for(const i of e){const{className:e}=this.splitClassNameAndType(i);this.classes.get(e).parent=t,this.namespaces.get(t).classes.set(e,this.classes.get(e))}}setCssStyle(t,e){const i=this.classes.get(t);if(e&&i)for(const r of e)r.includes(",")?i.styles.push(...r.split(",")):i.styles.push(r)} +/** + * Gets the arrow marker for a type index + * + * @param type - The type to look for + * @returns The arrow marker + */getArrowMarker(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}getData(){var t;const e=[],i=[],r=mr();for(const n of this.namespaces.keys()){const t=this.namespaces.get(n);if(t){const i={id:t.id,label:t.id,isGroup:!0,padding:r.class.padding??16, +// parent node must be one of [rect, roundedWithTitle, noteGroup, divider] +shape:"rect",cssStyles:["fill: none","stroke: black"],look:r.look};e.push(i)}}for(const n of this.classes.keys()){const t=this.classes.get(n);if(t){const i=t;i.parentId=t.parent,i.look=r.look,e.push(i)}}let s=0;for(const n of this.notes){s++;const a={id:n.id,label:n.text,isGroup:!1,shape:"note",padding:r.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${r.themeVariables.noteBkgColor}`,`stroke: ${r.themeVariables.noteBorderColor}`],look:r.look};e.push(a);const o=(null==(t=this.classes.get(n.class))?void 0:t.id)??"";if(o){const t={id:`edgeNote${s}`,start:n.id,end:o,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:r.look};i.push(t)}}for(const n of this.interfaces){const t={id:n.id,label:n.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:r.look};e.push(t)}s=0;for(const n of this.relations){s++;const t={id:ko(n.id1,n.id2,{prefix:"id",counter:s}),start:n.id1,end:n.id2,type:"normal",label:n.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(n.relation.type1),arrowTypeEnd:this.getArrowMarker(n.relation.type2),startLabelRight:"none"===n.relationTitle1?"":n.relationTitle1,endLabelLeft:"none"===n.relationTitle2?"":n.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:n.style||"",pattern:1==n.relation.lineType?"dashed":"solid",look:r.look};i.push(t)}return{nodes:e,edges:i,other:{},config:r,direction:this.getDirection()}}},"ClassDB"),B),Fk=we((t=>`g.classGroup text {\n fill: ${t.nodeBorder||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\n.labelBkg {\n background: ${t.mainBkg};\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-width: 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: transparent !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#extensionEnd, .extension {\n fill: transparent !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#aggregationStart, .aggregation {\n fill: transparent !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#aggregationEnd, .aggregation {\n fill: transparent !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 line-height: initial;\n}\n\n.classTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n`),"getStyles"),Nk=we(((t,e="TB")=>{if(!t.doc)return e;let i=e;for(const r of t.doc)"dir"===r.stmt&&(i=r.value);return i}),"getDir"),Ok={getClasses:we((function(t,e){return e.db.getClasses()}),"getClasses"),draw:we((async function(t,e,i,r){ve.info("REF0:"),ve.info("Drawing class diagram (v3)",e);const{securityLevel:s,state:n,layout:a}=mr(),o=r.db.getData(),l=bg(e,s);o.type=r.type,o.layoutAlgorithm=Lh(a),o.nodeSpacing=(null==n?void 0:n.nodeSpacing)||50,o.rankSpacing=(null==n?void 0:n.rankSpacing)||50,o.markers=["aggregation","extension","composition","dependency","lollipop"],o.diagramId=e,await Ah(o,l);mo.insertTitle(l,"classDiagramTitleText",(null==n?void 0:n.titleTopMargin)??25,r.db.getDiagramTitle()),kg(l,8,"classDiagram",(null==n?void 0:n.useMaxWidth)??!0)}),"draw"),getDir:Nk},Mk={parser:Ek,get db(){return new Ik},renderer:Ok,styles:Fk,init:we((t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute}),"init")};const Rk=Object.defineProperty({__proto__:null,diagram:Mk},Symbol.toStringTag,{value:"Module"});var Pk={parser:Ek,get db(){return new Ik},renderer:Ok,styles:Fk,init:we((t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute}),"init")};const qk=Object.defineProperty({__proto__:null,diagram:Pk},Symbol.toStringTag,{value:"Module"});var zk=function(){var t=we((function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i}),"o"),e=[1,2],i=[1,3],r=[1,4],s=[2,4],n=[1,9],a=[1,11],o=[1,16],l=[1,17],c=[1,18],h=[1,19],d=[1,32],u=[1,20],p=[1,21],g=[1,22],y=[1,23],f=[1,24],m=[1,26],x=[1,27],b=[1,28],k=[1,29],C=[1,30],S=[1,31],w=[1,34],T=[1,35],_=[1,36],v=[1,37],E=[1,33],A=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],L=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],B=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],$={trace:we((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"--\x3e":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,classDef:38,CLASSDEF_ID:39,CLASSDEF_STYLEOPTS:40,DEFAULT:41,style:42,STYLE_IDS:43,STYLEDEF_STYLEOPTS:44,class:45,CLASSENTITY_IDS:46,STYLECLASS:47,direction_tb:48,direction_bt:49,direction_rl:50,direction_lr:51,eol:52,";":53,EDGE_STATE:54,STYLE_SEPARATOR:55,left_of:56,right_of:57,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"--\x3e",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"classDef",39:"CLASSDEF_ID",40:"CLASSDEF_STYLEOPTS",41:"DEFAULT",42:"style",43:"STYLE_IDS",44:"STYLEDEF_STYLEOPTS",45:"class",46:"CLASSENTITY_IDS",47:"STYLECLASS",48:"direction_tb",49:"direction_bt",50:"direction_rl",51:"direction_lr",53:";",54:"EDGE_STATE",55:"STYLE_SEPARATOR",56:"left_of",57:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[52,1],[52,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:we((function(t,e,i,r,s,n,a){var o=n.length-1;switch(s){case 3:return r.setRootDoc(n[o]),n[o];case 4:this.$=[];break;case 5:"nl"!=n[o]&&(n[o-1].push(n[o]),this.$=n[o-1]);break;case 6:case 7:case 12:this.$=n[o];break;case 8:this.$="nl";break;case 13:const t=n[o-1];t.description=r.trimColon(n[o]),this.$=t;break;case 14:this.$={stmt:"relation",state1:n[o-2],state2:n[o]};break;case 15:const e=r.trimColon(n[o]);this.$={stmt:"relation",state1:n[o-3],state2:n[o-1],description:e};break;case 19:this.$={stmt:"state",id:n[o-3],type:"default",description:"",doc:n[o-1]};break;case 20:var l=n[o],c=n[o-2].trim();if(n[o].match(":")){var h=n[o].split(":");l=h[0],c=[c,h[1]]}this.$={stmt:"state",id:l,type:"default",description:c};break;case 21:this.$={stmt:"state",id:n[o-3],type:"default",description:n[o-5],doc:n[o-1]};break;case 22:this.$={stmt:"state",id:n[o],type:"fork"};break;case 23:this.$={stmt:"state",id:n[o],type:"join"};break;case 24:this.$={stmt:"state",id:n[o],type:"choice"};break;case 25:this.$={stmt:"state",id:r.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:n[o-1].trim(),note:{position:n[o-2].trim(),text:n[o].trim()}};break;case 29:this.$=n[o].trim(),r.setAccTitle(this.$);break;case 30:case 31:this.$=n[o].trim(),r.setAccDescription(this.$);break;case 32:case 33:this.$={stmt:"classDef",id:n[o-1].trim(),classes:n[o].trim()};break;case 34:this.$={stmt:"style",id:n[o-1].trim(),styleClass:n[o].trim()};break;case 35:this.$={stmt:"applyClass",id:n[o-1].trim(),styleClass:n[o].trim()};break;case 36:r.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 37:r.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 38:r.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 39:r.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 42:case 43:this.$={stmt:"state",id:n[o].trim(),type:"default",description:""};break;case 44:case 45:this.$={stmt:"state",id:n[o-2].trim(),classes:[n[o].trim()],type:"default",description:""}}}),"anonymous"),table:[{3:1,4:e,5:i,6:r},{1:[3]},{3:5,4:e,5:i,6:r},{3:6,4:e,5:i,6:r},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],s,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:c,22:h,24:d,25:u,26:p,27:g,28:y,29:f,32:25,33:m,35:x,37:b,38:k,42:C,45:S,48:w,49:T,50:_,51:v,54:E},t(A,[2,5]),{9:38,10:12,11:13,12:14,13:15,16:o,17:l,19:c,22:h,24:d,25:u,26:p,27:g,28:y,29:f,32:25,33:m,35:x,37:b,38:k,42:C,45:S,48:w,49:T,50:_,51:v,54:E},t(A,[2,7]),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(A,[2,11]),t(A,[2,12],{14:[1,39],15:[1,40]}),t(A,[2,16]),{18:[1,41]},t(A,[2,18],{20:[1,42]}),{23:[1,43]},t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),{30:44,31:[1,45],56:[1,46],57:[1,47]},t(A,[2,28]),{34:[1,48]},{36:[1,49]},t(A,[2,31]),{39:[1,50],41:[1,51]},{43:[1,52]},{46:[1,53]},t(L,[2,42],{55:[1,54]}),t(L,[2,43],{55:[1,55]}),t(A,[2,36]),t(A,[2,37]),t(A,[2,38]),t(A,[2,39]),t(A,[2,6]),t(A,[2,13]),{13:56,24:d,54:E},t(A,[2,17]),t(B,s,{7:57}),{24:[1,58]},{24:[1,59]},{23:[1,60]},{24:[2,46]},{24:[2,47]},t(A,[2,29]),t(A,[2,30]),{40:[1,61]},{40:[1,62]},{44:[1,63]},{47:[1,64]},{24:[1,65]},{24:[1,66]},t(A,[2,14],{14:[1,67]}),{4:n,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:c,21:[1,68],22:h,24:d,25:u,26:p,27:g,28:y,29:f,32:25,33:m,35:x,37:b,38:k,42:C,45:S,48:w,49:T,50:_,51:v,54:E},t(A,[2,20],{20:[1,69]}),{31:[1,70]},{24:[1,71]},t(A,[2,32]),t(A,[2,33]),t(A,[2,34]),t(A,[2,35]),t(L,[2,44]),t(L,[2,45]),t(A,[2,15]),t(A,[2,19]),t(B,s,{7:72}),t(A,[2,26]),t(A,[2,27]),{4:n,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:c,21:[1,73],22:h,24:d,25:u,26:p,27:g,28:y,29:f,32:25,33:m,35:x,37:b,38:k,42:C,45:S,48:w,49:T,50:_,51:v,54:E},t(A,[2,21])],defaultActions:{5:[2,1],6:[2,2],46:[2,46],47:[2,47]},parseError:we((function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)}),"parseError"),parse:we((function(t){var e=this,i=[0],r=[],s=[null],n=[],a=this.table,o="",l=0,c=0,h=n.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;n.push(g);var y=d.options&&d.options.ranges;function f(){var t;return"number"!=typeof(t=r.pop()||d.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,we((function(t){i.length=i.length-2*t,s.length=s.length-t,n.length=n.length-t}),"popStack"),we(f,"lex");for(var m,x,b,k,C,S,w,T,_={};;){if(x=i[i.length-1],this.defaultActions[x]?b=this.defaultActions[x]:(null==m&&(m=f()),b=a[x]&&a[x][m]),void 0===b||!b.length||!b[0]){var v="";for(C in T=[],a[x])this.terminals_[C]&&C>2&&T.push("'"+this.terminals_[C]+"'");v=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(v,{text:d.match,token:this.terminals_[m]||m,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: "+x+", token: "+m);switch(b[0]){case 1:i.push(m),s.push(d.yytext),n.push(d.yylloc),i.push(b[1]),m=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(S=this.productions_[b[1]][1],_.$=s[s.length-S],_._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},y&&(_._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(k=this.performAction.apply(_,[o,c,l,u.yy,b[1],s,n].concat(h))))return k;S&&(i=i.slice(0,-1*S*2),s=s.slice(0,-1*S),n=n.slice(0,-1*S)),i.push(this.productions_[b[1]][0]),s.push(_.$),n.push(_._$),w=a[i[i.length-2]][i[i.length-1]],i.push(w);break;case 3:return!0}}return!0}),"parse")},D=function(){return{EOF:1,parseError:we((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"), +// resets the lexer, sets new input +setInput:we((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}),"setInput"), +// consumes and returns one char from the input +input:we((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}),"input"), +// unshifts one char (or a string) into the input +unput:we((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 s=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=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"), +// When called from action, caches matched text and appends it on next action +more:we((function(){return this._more=!0,this}),"more"), +// 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:we((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})}),"reject"), +// retain first n characters of the match +less:we((function(t){this.unput(this.match.slice(t))}),"less"), +// displays already matched input, i.e. for error messages +pastInput:we((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"), +// displays upcoming input, i.e. for error messages +upcomingInput:we((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,"")}),"upcomingInput"), +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:we((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"), +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:we((function(t,e){var i,r,s;if(this.options.backtrack_lexer&&(s={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&&(s.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 n in s)this[n]=s[n];return!1}return!1}),"test_match"), +// return next match in input +next:we((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 s=this._currentRules(),n=0;ne[0].length)){if(e=i,r=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[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})}),"next"), +// return next match that has a token +lex:we((function(){var t=this.next();return t||this.lex()}),"lex"), +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:we((function(t){this.conditionStack.push(t)}),"begin"), +// pop the previously active lexer condition state off the condition stack +popState:we((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"), +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:we((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"), +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:we((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"), +// alias for begin(condition) +pushState:we((function(t){this.begin(t)}),"pushState"), +// return the number of states currently on the stack +stateStackSize:we((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:we((function(t,e,i,r){switch(i){case 0:return 41;case 1:case 42:return 48;case 2:case 43:return 49;case 3:case 44:return 50;case 4:case 45:return 51;case 5:case 6:case 8:case 9:case 10:case 11:case 54:case 56:case 62:break;case 7:case 77:return 5;case 12:case 32:return this.pushState("SCALE"),17;case 13:case 33:return 18;case 14:case 20:case 34:case 49:case 52:this.popState();break;case 15:return this.begin("acc_title"),33;case 16:return this.popState(),"acc_title_value";case 17:return this.begin("acc_descr"),35;case 18:return this.popState(),"acc_descr_value";case 19:this.begin("acc_descr_multiline");break;case 21:return"acc_descr_multiline_value";case 22:return this.pushState("CLASSDEF"),38;case 23:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 24:return this.popState(),this.pushState("CLASSDEFID"),39;case 25:return this.popState(),40;case 26:return this.pushState("CLASS"),45;case 27:return this.popState(),this.pushState("CLASS_STYLE"),46;case 28:return this.popState(),47;case 29:return this.pushState("STYLE"),42;case 30:return this.popState(),this.pushState("STYLEDEF_STYLES"),43;case 31:return this.popState(),44;case 35:this.pushState("STATE");break;case 36:case 39:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),25;case 37:case 40:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),26;case 38:case 41:return this.popState(),e.yytext=e.yytext.slice(0,-10).trim(),27;case 46:this.pushState("STATE_STRING");break;case 47:return this.pushState("STATE_ID"),"AS";case 48:case 64:return this.popState(),"ID";case 50:return"STATE_DESCR";case 51:return 19;case 53:return this.popState(),this.pushState("struct"),20;case 55:return this.popState(),21;case 57:return this.begin("NOTE"),29;case 58:return this.popState(),this.pushState("NOTE_ID"),56;case 59:return this.popState(),this.pushState("NOTE_ID"),57;case 60:this.popState(),this.pushState("FLOATING_NOTE");break;case 61:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 63:return"NOTE_TEXT";case 65:return this.popState(),this.pushState("NOTE_TEXT"),24;case 66:return this.popState(),e.yytext=e.yytext.substr(2).trim(),31;case 67:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),31;case 68:case 69:return 6;case 70:return 16;case 71:return 54;case 72:return 24;case 73:return e.yytext=e.yytext.trim(),14;case 74:return 15;case 75:return 28;case 76:return 55;case 78:return"INVALID"}}),"anonymous"),rules:[/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\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,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/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:[9,10],inclusive:!1},struct:{rules:[9,10,22,26,29,35,42,43,44,45,54,55,56,57,71,72,73,74,75],inclusive:!1},FLOATING_NOTE_ID:{rules:[64],inclusive:!1},FLOATING_NOTE:{rules:[61,62,63],inclusive:!1},NOTE_TEXT:{rules:[66,67],inclusive:!1},NOTE_ID:{rules:[65],inclusive:!1},NOTE:{rules:[58,59,60],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[31],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[30],inclusive:!1},CLASS_STYLE:{rules:[28],inclusive:!1},CLASS:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[25],inclusive:!1},CLASSDEF:{rules:[23,24],inclusive:!1},acc_descr_multiline:{rules:[20,21],inclusive:!1},acc_descr:{rules:[18],inclusive:!1},acc_title:{rules:[16],inclusive:!1},SCALE:{rules:[13,14,33,34],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[48],inclusive:!1},STATE_STRING:{rules:[49,50],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[9,10,36,37,38,39,40,41,46,47,51,52,53],inclusive:!1},ID:{rules:[9,10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,10,11,12,15,17,19,22,26,29,32,35,53,57,68,69,70,71,72,73,74,76,77,78],inclusive:!0}}}}();function I(){this.yy={}}return $.lexer=D,we(I,"Parser"),I.prototype=$,$.Parser=I,new I}();zk.parser=zk;var Wk=zk,jk="state",Yk="relation",Uk="default",Hk="divider",Vk="fill:none",Xk="fill: #333",Gk="text",Kk="normal",Qk="rect",Zk="rectWithTitle",Jk="divider",tC="roundedWithTitle",eC="statediagram",iC=`${eC}-state`,rC="transition",sC=`${rC} note-edge`,nC=`${eC}-note`,aC=`${eC}-cluster`,oC=`${eC}-cluster-alt`,lC="parent",cC="note",hC="----",dC=`${hC}${cC}`,uC=`${hC}${lC}`,pC=we(((t,e="TB")=>{if(!t.doc)return e;let i=e;for(const r of t.doc)"dir"===r.stmt&&(i=r.value);return i}),"getDir"),gC={getClasses:we((function(t,e){return e.db.getClasses()}),"getClasses"),draw:we((async function(t,e,i,r){ve.info("REF0:"),ve.info("Drawing state diagram (v2)",e);const{securityLevel:s,state:n,layout:a}=mr();r.db.extract(r.db.getRootDocV2());const o=r.db.getData(),l=bg(e,s);o.type=r.type,o.layoutAlgorithm=a,o.nodeSpacing=(null==n?void 0:n.nodeSpacing)||50,o.rankSpacing=(null==n?void 0:n.rankSpacing)||50,o.markers=["barb"],o.diagramId=e,await Ah(o,l);mo.insertTitle(l,"statediagramTitleText",(null==n?void 0:n.titleTopMargin)??25,r.db.getDiagramTitle()),kg(l,8,eC,(null==n?void 0:n.useMaxWidth)??!0)}),"draw"),getDir:pC},yC=new Map,fC=0;function mC(t="",e=0,i="",r=hC){return`state-${t}${null!==i&&i.length>0?`${r}${i}`:""}-${e}`}we(mC,"stateDomId");var xC=we(((t,e,i,r,s,n,a,o)=>{ve.trace("items",e),e.forEach((e=>{switch(e.stmt){case jk:case Uk:wC(t,e,i,r,s,n,a,o);break;case Yk:{wC(t,e.state1,i,r,s,n,a,o),wC(t,e.state2,i,r,s,n,a,o);const l={id:"edge"+fC,start:e.state1.id,end:e.state2.id,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:Vk,labelStyle:"",label:Xi.sanitizeText(e.description,mr()),arrowheadStyle:Xk,labelpos:"c",labelType:Gk,thickness:Kk,classes:rC,look:a};s.push(l),fC++}}}))}),"setupDoc"),bC=we(((t,e="TB")=>{let i=e;if(t.doc)for(const r of t.doc)"dir"===r.stmt&&(i=r.value);return i}),"getDir");function kC(t,e,i){if(!e.id||""===e.id||""===e.id)return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach((t=>{if(i.get(t)){const r=i.get(t);e.cssCompiledStyles=[...e.cssCompiledStyles,...r.styles]}})));const r=t.find((t=>t.id===e.id));r?Object.assign(r,e):t.push(e)}function CC(t){var e;return(null==(e=null==t?void 0:t.classes)?void 0:e.join(" "))??""}function SC(t){return(null==t?void 0:t.styles)??[]}we(kC,"insertOrUpdateNode"),we(CC,"getClassesFromDbInfo"),we(SC,"getStylesFromDbInfo");var wC=we(((t,e,i,r,s,n,a,o)=>{var l,c;const h=e.id,d=i.get(h),u=CC(d),p=SC(d);if(ve.info("dataFetcher parsedItem",e,d,p),"root"!==h){let i=Qk;!0===e.start?i="stateStart":!1===e.start&&(i="stateEnd"),e.type!==Uk&&(i=e.type),yC.get(h)||yC.set(h,{id:h,shape:i,description:Xi.sanitizeText(h,mr()),cssClasses:`${u} ${iC}`,cssStyles:p});const d=yC.get(h);e.description&&(Array.isArray(d.description)?(d.shape=Zk,d.description.push(e.description)):(null==(l=d.description)?void 0:l.length)>0?(d.shape=Zk,d.description===h?d.description=[e.description]:d.description=[d.description,e.description]):(d.shape=Qk,d.description=e.description),d.description=Xi.sanitizeTextOrArray(d.description,mr())),1===(null==(c=d.description)?void 0:c.length)&&d.shape===Zk&&("group"===d.type?d.shape=tC:d.shape=Qk),!d.type&&e.doc&&(ve.info("Setting cluster for XCX",h,bC(e)),d.type="group",d.isGroup=!0,d.dir=bC(e),d.shape=e.type===Hk?Jk:tC,d.cssClasses=`${d.cssClasses} ${aC} ${n?oC:""}`);const g={labelStyle:"",shape:d.shape,label:d.description,cssClasses:d.cssClasses,cssCompiledStyles:[],cssStyles:d.cssStyles,id:h,dir:d.dir,domId:mC(h,fC),type:d.type,isGroup:"group"===d.type,padding:8,rx:10,ry:10,look:a};if(g.shape===Jk&&(g.label=""),t&&"root"!==t.id&&(ve.trace("Setting node ",h," to be child of its parent ",t.id),g.parentId=t.id),g.centerLabel=!0,e.note){const t={labelStyle:"",shape:"note",label:e.note.text,cssClasses:nC, +// useHtmlLabels: false, +cssStyles:[],cssCompilesStyles:[],id:h+dC+"-"+fC,domId:mC(h,fC,cC),type:d.type,isGroup:"group"===d.type,padding:mr().flowchart.padding,look:a,position:e.note.position},i=h+uC,n={labelStyle:"",shape:"noteGroup",label:e.note.text,cssClasses:d.cssClasses,cssStyles:[],id:h+uC,domId:mC(h,fC,lC),type:"group",isGroup:!0,padding:16, +//getConfig().flowchart.padding +look:a,position:e.note.position};fC++,n.id=i,t.parentId=i,kC(r,n,o),kC(r,t,o),kC(r,g,o);let l=h,c=t.id;"left of"===e.note.position&&(l=t.id,c=h),s.push({id:l+"-"+c,start:l,end:c,arrowhead:"none",arrowTypeEnd:"",style:Vk,labelStyle:"",classes:sC,arrowheadStyle:Xk,labelpos:"c",labelType:Gk,thickness:Kk,look:a})}else kC(r,g,o)}e.doc&&(ve.trace("Adding nodes children "),xC(e,e.doc,i,r,s,!n,a,o))}),"dataFetcher"),TC=we((()=>{yC.clear(),fC=0}),"reset"),_C="[*]",vC="start",EC=_C,AC="color",LC="fill";function BC(){ +return new Map}we(BC,"newClassesList");var $C,DC=we((()=>({ +/** @type {{ id1: string, id2: string, relationTitle: string }[]} */ +relations:[],states:new Map,documents:{}})),"newDoc"),IC=we((t=>JSON.parse(JSON.stringify(t))),"clone"),FC=(we($=class{ +/** + * @param {1 | 2} version - v1 renderer or v2 renderer. + */ +constructor(t){ +/** + * @private + * @type {1 | 2} + */ +R(this,"version"), +/** + * @private + * @type {Array} + */ +R(this,"nodes",[]), +/** + * @private + * @type {Array} + */ +R(this,"edges",[]), +/** + * @private + * @type {Array} + */ +R(this,"rootDoc",[]), +/** + * @private + * @type {Map} + */ +R(this,"classes",BC()), +// style classes defined by a classDef +/** + * @private + * @type {Object} + */ +R(this,"documents",{root:DC()}), +/** + * @private + * @type {Object} + */ +R(this,"currentDocument",this.documents.root), +/** + * @private + * @type {number} + */ +R(this,"startEndCount",0), +/** + * @private + * @type {number} + */ +R(this,"dividerCnt",0),R(this,"getAccTitle",hr),R(this,"setAccTitle",cr),R(this,"getAccDescription",ur),R(this,"setAccDescription",dr),R(this,"setDiagramTitle",pr),R(this,"getDiagramTitle",gr),this.clear(),this.version=t,this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}setRootDoc(t){ve.info("Setting root doc",t),this.rootDoc=t,1===this.version?this.extract(t):this.extract(this.getRootDocV2())}getRootDoc(){return this.rootDoc} +/** + * @private + * @param {Object} parent + * @param {Object} node + * @param {boolean} first + */docTranslator(t,e,i){if(e.stmt===Yk)this.docTranslator(t,e.state1,!0),this.docTranslator(t,e.state2,!1);else if(e.stmt===jk&&("[*]"===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:jk,id:Ja(),type:"divider",doc:IC(r)};t.push(IC(i)),e.doc=t}e.doc.forEach((t=>this.docTranslator(e,t,!0)))}} +/** + * @private + */getRootDocV2(){return this.docTranslator({id:"root"},{id:"root",doc:this.rootDoc},!0),{id:"root",doc:this.rootDoc}} +/** + * Convert all of the statements (stmts) that were parsed into states and relationships. + * This is done because a state diagram may have nested sections, + * where each section is a 'document' and has its own set of statements. + * Ex: the section within a fork has its own statements, and incoming and outgoing statements + * refer to the fork as a whole (document). + * See the parser grammar: the definition of a document is a document then a 'line', where a line can be a statement. + * This will push the statement into the list of statements for the current document. + * @private + * @param _doc + */extract(t){let e;e=t.doc?t.doc:t,ve.info(e),this.clear(!0),ve.info("Extract initial document:",e),e.forEach((t=>{switch(ve.warn("Statement",t.stmt),t.stmt){case jk:this.addState(t.id.trim(),t.type,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles);break;case Yk:this.addRelation(t.state1,t.state2,t.description);break;case"classDef":this.addStyleClass(t.id.trim(),t.classes);break;case"style":{const e=t.id.trim().split(","),i=t.styleClass.split(",");e.forEach((t=>{let e=this.getState(t);if(void 0===e){const i=t.trim();this.addState(i),e=this.getState(i)}e.styles=i.map((t=>{var e;return null==(e=t.replace(/;/g,""))?void 0:e.trim()}))}))}break;case"applyClass":this.setCssClass(t.id.trim(),t.styleClass)}}));const i=this.getStates(),r=mr().look;TC(),wC(void 0,this.getRootDocV2(),i,this.nodes,this.edges,!0,r,this.classes),this.nodes.forEach((t=>{if(Array.isArray(t.label)){if(t.description=t.label.slice(1),t.isGroup&&t.description.length>0)throw new Error("Group nodes can only have label. Remove the additional description for node ["+t.id+"]");t.label=t.label[0]}}))} +/** + * Function called by parser when a node definition has been found. + * + * @param {null | string} id + * @param {null | string} type + * @param {null | string} doc + * @param {null | string | string[]} descr - description for the state. Can be a string or a list or strings + * @param {null | string} note + * @param {null | string | string[]} classes - class styles to apply to this state. Can be a string (1 style) or an array of styles. If it's just 1 class, convert it to an array of that 1 class. + * @param {null | string | string[]} styles - styles to apply to this state. Can be a string (1 style) or an array of styles. If it's just 1 style, convert it to an array of that 1 style. + * @param {null | string | string[]} textStyles - text styles to apply to this state. Can be a string (1 text test) or an array of text styles. If it's just 1 text style, convert it to an array of that 1 text style. + */addState(t,e=Uk,i=null,r=null,s=null,n=null,a=null,o=null){const l=null==t?void 0:t.trim();if(this.currentDocument.states.has(l)?(this.currentDocument.states.get(l).doc||(this.currentDocument.states.get(l).doc=i),this.currentDocument.states.get(l).type||(this.currentDocument.states.get(l).type=e)):(ve.info("Adding state ",l,r),this.currentDocument.states.set(l,{id:l,descriptions:[],type:e,doc:i,note:s,classes:[],styles:[],textStyles:[]})),r&&(ve.info("Setting state description",l,r),"string"==typeof r&&this.addDescription(l,r.trim()),"object"==typeof r&&r.forEach((t=>this.addDescription(l,t.trim())))),s){const t=this.currentDocument.states.get(l);t.note=s,t.note.text=Xi.sanitizeText(t.note.text,mr())}if(n){ve.info("Setting state classes",l,n);("string"==typeof n?[n]:n).forEach((t=>this.setCssClass(l,t.trim())))}if(a){ve.info("Setting state styles",l,a);("string"==typeof a?[a]:a).forEach((t=>this.setStyle(l,t.trim())))}if(o){ve.info("Setting state styles",l,a);("string"==typeof o?[o]:o).forEach((t=>this.setTextStyle(l,t.trim())))}}clear(t){this.nodes=[],this.edges=[],this.documents={root:DC()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=BC(),t||lr()}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){ve.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations} +/** + * If the id is a start node ( [*] ), then return a new id constructed from + * the start node name and the current start node count. + * else return the given id + * + * @param {string} id + * @returns {string} - the id (original or constructed) + * @private + */startIdIfNeeded(t=""){let e=t;return t===_C&&(this.startEndCount++,e=`${vC}${this.startEndCount}`),e} +/** + * If the id is a start node ( [*] ), then return the start type ('start') + * else return the given type + * + * @param {string} id + * @param {string} type + * @returns {string} - the type that should be used + * @private + */startTypeIfNeeded(t="",e=Uk){return t===_C?vC:e} +/** + * If the id is an end node ( [*] ), then return a new id constructed from + * the end node name and the current start_end node count. + * else return the given id + * + * @param {string} id + * @returns {string} - the id (original or constructed) + * @private + */endIdIfNeeded(t=""){let e=t;return t===EC&&(this.startEndCount++,e=`end${this.startEndCount}`),e} +/** + * If the id is an end node ( [*] ), then return the end type + * else return the given type + * + * @param {string} id + * @param {string} type + * @returns {string} - the type that should be used + * @private + */endTypeIfNeeded(t="",e=Uk){return t===EC?"end":e} +/** + * + * @param item1 + * @param item2 + * @param relationTitle + */addRelationObjs(t,e,i){let r=this.startIdIfNeeded(t.id.trim()),s=this.startTypeIfNeeded(t.id.trim(),t.type),n=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(r,s,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(n,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:r,id2:n,relationTitle:Xi.sanitizeText(i,mr())})} +/** + * Add a relation between two items. The items may be full objects or just the string id of a state. + * + * @param {string | object} item1 + * @param {string | object} item2 + * @param {string} title + */addRelation(t,e,i){if("object"==typeof t)this.addRelationObjs(t,e,i);else{const r=this.startIdIfNeeded(t.trim()),s=this.startTypeIfNeeded(t),n=this.endIdIfNeeded(e.trim()),a=this.endTypeIfNeeded(e);this.addState(r,s),this.addState(n,a),this.currentDocument.relations.push({id1:r,id2:n,title:Xi.sanitizeText(i,mr())})}}addDescription(t,e){const i=this.currentDocument.states.get(t),r=e.startsWith(":")?e.replace(":","").trim():e;i.descriptions.push(Xi.sanitizeText(r,mr()))}cleanupLabel(t){return":"===t.substring(0,1)?t.substr(2).trim():t.trim()}getDividerId(){return this.dividerCnt++,"divider-id-"+this.dividerCnt} +/** + * Called when the parser comes across a (style) class definition + * @example classDef my-style fill:#f96; + * + * @param {string} id - the id of this (style) class + * @param {string | null} styleAttributes - the string with 1 or more style attributes (each separated by a comma) + */addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});const i=this.classes.get(t);null!=e&&e.split(",").forEach((t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(AC).exec(t)){const t=e.replace(LC,"bgFill").replace(AC,LC);i.textStyles.push(t)}i.styles.push(e)}))} +/** + * Return all of the style classes + * @returns {{} | any | classes} + */getClasses(){return this.classes} +/** + * Add a (style) class or css class to a state with the given id. + * If the state isn't already in the list of known states, add it. + * Might be called by parser when a style class or CSS class should be applied to a state + * + * @param {string | string[]} itemIds The id or a list of ids of the item(s) to apply the css class to + * @param {string} cssClassName CSS class name + */setCssClass(t,e){t.split(",").forEach((t=>{let i=this.getState(t);if(void 0===i){const e=t.trim();this.addState(e),i=this.getState(e)}i.classes.push(e)}))} +/** + * Add a style to a state with the given id. + * @example style stateId fill:#f9f,stroke:#333,stroke-width:4px + * where 'style' is the keyword + * stateId is the id of a state + * the rest of the string is the styleText (all of the attributes to be applied to the state) + * + * @param itemId The id of item to apply the style to + * @param styleText - the text of the attributes for the style + */setStyle(t,e){const i=this.getState(t);void 0!==i&&i.styles.push(e)} +/** + * Add a text style to a state with the given id + * + * @param itemId The id of item to apply the css class to + * @param cssClassName CSS class name + */setTextStyle(t,e){const i=this.getState(t);void 0!==i&&i.textStyles.push(e)} +/** + * Finds the direction statement in the root document. + * @private + * @returns {{ value: string } | undefined} - the direction statement if present + */getDirectionStatement(){return this.rootDoc.find((t=>"dir"===t.stmt))}getDirection(){var t;return(null==(t=this.getDirectionStatement())?void 0:t.value)??"TB"}setDirection(t){const e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:"dir",value:t})}trimColon(t){return t&&":"===t[0]?t.substr(1).trim():t.trim()}getData(){const t=mr();return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:pC(this.getRootDocV2())}}getConfig(){return mr().state}},"StateDB"),R($,"relationType",{AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}),$),NC=we((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 {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\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 // line-height: 1;\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`),"getStyles"),OC={},MC=we(((t,e)=>{OC[t]=e}),"set"),RC=we((t=>OC[t]),"get"),PC=we((()=>Object.keys(OC)),"keys"),qC=we((()=>PC().length),"size"),zC={get:RC,set:MC,keys:PC,size:qC},WC=we((t=>t.append("circle").attr("class","start-state").attr("r",mr().state.sizeUnit).attr("cx",mr().state.padding+mr().state.sizeUnit).attr("cy",mr().state.padding+mr().state.sizeUnit)),"drawStartState"),jC=we((t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",mr().state.textHeight).attr("class","divider").attr("x2",2*mr().state.textHeight).attr("y1",0).attr("y2",0)),"drawDivider"),YC=we(((t,e)=>{const i=t.append("text").attr("x",2*mr().state.padding).attr("y",mr().state.textHeight+2*mr().state.padding).attr("font-size",mr().state.fontSize).attr("class","state-title").text(e.id),r=i.node().getBBox();return t.insert("rect",":first-child").attr("x",mr().state.padding).attr("y",mr().state.padding).attr("width",r.width+2*mr().state.padding).attr("height",r.height+2*mr().state.padding).attr("rx",mr().state.radius),i}),"drawSimpleState"),UC=we(((t,e)=>{const i=we((function(t,e,i){const r=t.append("tspan").attr("x",2*mr().state.padding).text(e);i||r.attr("dy",mr().state.textHeight)}),"addTspan"),r=t.append("text").attr("x",2*mr().state.padding).attr("y",mr().state.textHeight+1.3*mr().state.padding).attr("font-size",mr().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),s=r.height,n=t.append("text").attr("x",mr().state.padding).attr("y",s+.4*mr().state.padding+mr().state.dividerMargin+mr().state.textHeight).attr("class","state-description");let a=!0,o=!0;e.descriptions.forEach((function(t){a||(i(n,t,o),o=!1),a=!1}));const l=t.append("line").attr("x1",mr().state.padding).attr("y1",mr().state.padding+s+mr().state.dividerMargin/2).attr("y2",mr().state.padding+s+mr().state.dividerMargin/2).attr("class","descr-divider"),c=n.node().getBBox(),h=Math.max(c.width,r.width);return l.attr("x2",h+3*mr().state.padding),t.insert("rect",":first-child").attr("x",mr().state.padding).attr("y",mr().state.padding).attr("width",h+2*mr().state.padding).attr("height",c.height+s+2*mr().state.padding).attr("rx",mr().state.radius),t}),"drawDescrState"),HC=we(((t,e,i)=>{const r=mr().state.padding,s=2*mr().state.padding,n=t.node().getBBox(),a=n.width,o=n.x,l=t.append("text").attr("x",0).attr("y",mr().state.titleShift).attr("font-size",mr().state.fontSize).attr("class","state-title").text(e.id),c=l.node().getBBox().width+s;let h,d=Math.max(c,a);d===a&&(d+=s);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-mr().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+mr().state.textHeight+mr().state.titleShift+1).attr("rx","0"),l.attr("x",h+r),c<=a&&l.attr("x",o+(d-s)/2-c/2+r),t.insert("rect",":first-child").attr("x",h).attr("y",mr().state.titleShift-mr().state.textHeight-mr().state.padding).attr("width",d).attr("height",3*mr().state.textHeight).attr("rx",mr().state.radius),t.insert("rect",":first-child").attr("x",h).attr("y",mr().state.titleShift-mr().state.textHeight-mr().state.padding).attr("width",d).attr("height",u.height+3+2*mr().state.textHeight).attr("rx",mr().state.radius),t}),"addTitleAndBox"),VC=we((t=>(t.append("circle").attr("class","end-state-outer").attr("r",mr().state.sizeUnit+mr().state.miniPadding).attr("cx",mr().state.padding+mr().state.sizeUnit+mr().state.miniPadding).attr("cy",mr().state.padding+mr().state.sizeUnit+mr().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",mr().state.sizeUnit).attr("cx",mr().state.padding+mr().state.sizeUnit+2).attr("cy",mr().state.padding+mr().state.sizeUnit+2))),"drawEndState"),XC=we(((t,e)=>{let i=mr().state.forkWidth,r=mr().state.forkHeight;if(e.parentId){let t=i;i=r,r=t}return t.append("rect").style("stroke","black").style("fill","black").attr("width",i).attr("height",r).attr("x",mr().state.padding).attr("y",mr().state.padding)}),"drawForkJoinState"),GC=we(((t,e,i,r)=>{let s=0;const n=r.append("text");n.style("text-anchor","start"),n.attr("class","noteText");let a=t.replace(/\r\n/g,"
");a=a.replace(/\n/g,"
");const o=a.split(Xi.lineBreakRegex);let l=1.25*mr().state.noteMargin;for(const c of o){const t=c.trim();if(t.length>0){const r=n.append("tspan");if(r.text(t),0===l){l+=r.node().getBBox().height}s+=l,r.attr("x",e+mr().state.noteMargin),r.attr("y",i+s+1.25*mr().state.noteMargin)}}return{textWidth:n.node().getBBox().width,textHeight:s}}),"_drawLongText"),KC=we(((t,e)=>{e.attr("class","state-note");const i=e.append("rect").attr("x",0).attr("y",mr().state.padding),r=e.append("g"),{textWidth:s,textHeight:n}=GC(t,0,0,r);return i.attr("height",n+2*mr().state.noteMargin),i.attr("width",s+2*mr().state.noteMargin),i}),"drawNote"),QC=we((function(t,e){const i=e.id,r={id:i,label:e.id,width:0,height:0},s=t.append("g").attr("id",i).attr("class","stateGroup");"start"===e.type&&WC(s),"end"===e.type&&VC(s),"fork"!==e.type&&"join"!==e.type||XC(s,e),"note"===e.type&&KC(e.note.text,s),"divider"===e.type&&jC(s),"default"===e.type&&0===e.descriptions.length&&YC(s,e),"default"===e.type&&e.descriptions.length>0&&UC(s,e);const n=s.node().getBBox();return r.width=n.width+2*mr().state.padding,r.height=n.height+2*mr().state.padding,zC.set(i,r),r}),"drawState"),ZC=0,JC=we((function(t,e,i){const r=we((function(t){switch(t){case FC.relationType.AGGREGATION:return"aggregation";case FC.relationType.EXTENSION:return"extension";case FC.relationType.COMPOSITION:return"composition";case FC.relationType.DEPENDENCY:return"dependency"}}),"getRelationType");e.points=e.points.filter((t=>!Number.isNaN(t.y)));const s=e.points,n=ee().x((function(t){return t.x})).y((function(t){return t.y})).curve(te),a=t.append("path").attr("d",n(s)).attr("id","edge"+ZC).attr("class","transition");let o="";if(mr().state.arrowMarkerAbsolute&&(o=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,o=o.replace(/\(/g,"\\("),o=o.replace(/\)/g,"\\)")),a.attr("marker-end","url("+o+"#"+r(FC.relationType.DEPENDENCY)+"End)"),void 0!==i.title){const r=t.append("g").attr("class","stateLabel"),{x:s,y:n}=mo.calcLabelPosition(e.points),a=Xi.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",s).attr("y",n+o),i=e.node().getBBox();if(c=Math.max(c,i.width),h=Math.min(h,i.x),ve.info(i.x,s,n+o),0===o){const t=e.node().getBBox();o=t.height,ve.info("Title height",o,n)}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",n+i*o-t))),d=o*a.length}const u=r.node().getBBox();r.insert("rect",":first-child").attr("class","box").attr("x",s-c/2-mr().state.padding/2).attr("y",n-d/2-mr().state.padding/2-3.5).attr("width",c+mr().state.padding).attr("height",d+mr().state.padding),ve.info(u)}ZC++}),"drawEdge"),tS={},eS=we((function(){}),"setConf"),iS=we((function(t){t.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")}),"insertMarkers"),rS=we((function(t,e,i,r){$C=mr().state;const s=mr().securityLevel;let n;"sandbox"===s&&(n=K("#i"+e));const a=K("sandbox"===s?n.nodes()[0].contentDocument.body:"body"),o="sandbox"===s?n.nodes()[0].contentDocument:document;ve.debug("Rendering diagram "+t);const l=a.select(`[id='${e}']`);iS(l);const c=r.db.getRootDoc();nS(c,l,void 0,!1,a,o,r);const h=$C.padding,d=l.node().getBBox(),u=d.width+2*h,p=d.height+2*h;Qi(l,p,1.75*u,$C.useMaxWidth),l.attr("viewBox",`${d.x-$C.padding} ${d.y-$C.padding} `+u+" "+p)}),"draw"),sS=we((t=>t?t.length*$C.fontSizeFactor:1),"getLabelWidth"),nS=we(((t,e,i,r,s,n,a)=>{const o=new Q({compound:!0,multigraph:!0});let l,c=!0;for(l=0;l{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 ve.debug("No Node "+t+": "+JSON.stringify(o.node(t)))}));let y=g.getBBox();o.edges().forEach((function(t){void 0!==t&&void 0!==o.edge(t)&&(ve.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(o.edge(t))),JC(e,o.edge(t),o.edge(t).relation))})),y=g.getBBox();const f={id:i||"root",label:i||"root",width:0,height:0};return f.width=y.width+2*$C.padding,f.height=y.height+2*$C.padding,ve.debug("Doc rendered",f,o),f}),"renderDoc"),aS={setConf:eS,draw:rS},oS={parser:Wk,get db(){return new FC(1)},renderer:aS,styles:NC,init:we((t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute}),"init")};const lS=Object.defineProperty({__proto__:null,diagram:oS},Symbol.toStringTag,{value:"Module"});var cS={parser:Wk,get db(){return new FC(2)},renderer:gC,styles:NC,init:we((t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute}),"init")};const hS=Object.defineProperty({__proto__:null,diagram:cS},Symbol.toStringTag,{value:"Module"});var dS=function(){var t=we((function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i}),"o"),e=[6,8,10,11,12,14,16,17,18],i=[1,9],r=[1,10],s=[1,11],n=[1,12],a=[1,13],o=[1,14],l={trace:we((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:we((function(t,e,i,r,s,n,a){var o=n.length-1;switch(s){case 1:return n[o-1];case 2:case 6:case 7:this.$=[];break;case 3:n[o-1].push(n[o]),this.$=n[o-1];break;case 4:case 5:this.$=n[o];break;case 8:r.setDiagramTitle(n[o].substr(6)),this.$=n[o].substr(6);break;case 9:this.$=n[o].trim(),r.setAccTitle(this.$);break;case 10:case 11:this.$=n[o].trim(),r.setAccDescription(this.$);break;case 12:r.addSection(n[o].substr(8)),this.$=n[o].substr(8);break;case 13:r.addTask(n[o-1],n[o]),this.$="task"}}),"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:i,12:r,14:s,16:n,17:a,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:i,12:r,14:s,16:n,17:a,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:we((function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)}),"parseError"),parse:we((function(t){var e=this,i=[0],r=[],s=[null],n=[],a=this.table,o="",l=0,c=0,h=n.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;n.push(g);var y=d.options&&d.options.ranges;function f(){var t;return"number"!=typeof(t=r.pop()||d.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,we((function(t){i.length=i.length-2*t,s.length=s.length-t,n.length=n.length-t}),"popStack"),we(f,"lex");for(var m,x,b,k,C,S,w,T,_={};;){if(x=i[i.length-1],this.defaultActions[x]?b=this.defaultActions[x]:(null==m&&(m=f()),b=a[x]&&a[x][m]),void 0===b||!b.length||!b[0]){var v="";for(C in T=[],a[x])this.terminals_[C]&&C>2&&T.push("'"+this.terminals_[C]+"'");v=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(v,{text:d.match,token:this.terminals_[m]||m,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: "+x+", token: "+m);switch(b[0]){case 1:i.push(m),s.push(d.yytext),n.push(d.yylloc),i.push(b[1]),m=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(S=this.productions_[b[1]][1],_.$=s[s.length-S],_._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},y&&(_._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(k=this.performAction.apply(_,[o,c,l,u.yy,b[1],s,n].concat(h))))return k;S&&(i=i.slice(0,-1*S*2),s=s.slice(0,-1*S),n=n.slice(0,-1*S)),i.push(this.productions_[b[1]][0]),s.push(_.$),n.push(_._$),w=a[i[i.length-2]][i[i.length-1]],i.push(w);break;case 3:return!0}}return!0}),"parse")},c=function(){return{EOF:1,parseError:we((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"), +// resets the lexer, sets new input +setInput:we((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}),"setInput"), +// consumes and returns one char from the input +input:we((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}),"input"), +// unshifts one char (or a string) into the input +unput:we((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 s=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=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"), +// When called from action, caches matched text and appends it on next action +more:we((function(){return this._more=!0,this}),"more"), +// 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:we((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})}),"reject"), +// retain first n characters of the match +less:we((function(t){this.unput(this.match.slice(t))}),"less"), +// displays already matched input, i.e. for error messages +pastInput:we((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"), +// displays upcoming input, i.e. for error messages +upcomingInput:we((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,"")}),"upcomingInput"), +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:we((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"), +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:we((function(t,e){var i,r,s;if(this.options.backtrack_lexer&&(s={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&&(s.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 n in s)this[n]=s[n];return!1}return!1}),"test_match"), +// return next match in input +next:we((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 s=this._currentRules(),n=0;ne[0].length)){if(e=i,r=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[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})}),"next"), +// return next match that has a token +lex:we((function(){var t=this.next();return t||this.lex()}),"lex"), +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:we((function(t){this.conditionStack.push(t)}),"begin"), +// pop the previously active lexer condition state off the condition stack +popState:we((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"), +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:we((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"), +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:we((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"), +// alias for begin(condition) +pushState:we((function(t){this.begin(t)}),"pushState"), +// return the number of states currently on the stack +stateStackSize:we((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:we((function(t,e,i,r){switch(i){case 0:case 1:case 3:case 4:break;case 2:return 10;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}}),"anonymous"),rules:[/^(?:%(?!\{)[^\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:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}}}();function h(){this.yy={}}return l.lexer=c,we(h,"Parser"),h.prototype=l,l.Parser=h,new h}();dS.parser=dS;var uS=dS,pS="",gS=[],yS=[],fS=[],mS=we((function(){gS.length=0,yS.length=0,pS="",fS.length=0,lr()}),"clear"),xS=we((function(t){pS=t,gS.push(t)}),"addSection"),bS=we((function(){return gS}),"getSections"),kS=we((function(){let t=TS();let e=0;for(;!t&&e<100;)t=TS(),e++;return yS.push(...fS),yS}),"getTasks"),CS=we((function(){const t=[];yS.forEach((e=>{e.people&&t.push(...e.people)}));return[...new Set(t)].sort()}),"updateActors"),SS=we((function(t,e){const i=e.substr(1).split(":");let r=0,s=[];1===i.length?(r=Number(i[0]),s=[]):(r=Number(i[0]),s=i[1].split(","));const n=s.map((t=>t.trim())),a={section:pS,type:pS,people:n,task:t,score:r};fS.push(a)}),"addTask"),wS=we((function(t){const e={section:pS,type:pS,description:t,task:t,classes:[]};yS.push(e)}),"addTaskOrg"),TS=we((function(){const t=we((function(t){return fS[t].processed}),"compileTask");let e=!0;for(const[i,r]of fS.entries())t(i),e=e&&r.processed;return e}),"compileTasks"),_S=we((function(){return CS()}),"getActors"),vS={getConfig:we((()=>mr().journey),"getConfig"),clear:mS,setDiagramTitle:pr,getDiagramTitle:gr,setAccTitle:cr,getAccTitle:hr,setAccDescription:dr,getAccDescription:ur,addSection:xS,getSections:bS,getTasks:kS,addTask:SS,addTaskOrg:wS,getActors:_S},ES=we((t=>`.label {\n font-family: ${t.fontFamily};\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 font-family: ${t.fontFamily};\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: ${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 .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`),"getStyles"),AS=we((function(t,e){return zu(t,e)}),"drawRect"),LS=we((function(t,e){const i=15,r=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",i).attr("stroke-width",2).attr("overflow","visible"),s=t.append("g");function n(t){const r=ie().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)+")")}function a(t){const r=ie().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)+")")}function o(t){t.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")}return s.append("circle").attr("cx",e.cx-5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),s.append("circle").attr("cx",e.cx+5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),we(n,"smile"),we(a,"sad"),we(o,"ambivalent"),e.score>3?n(s):e.score<3?a(s):o(s),r}),"drawFace"),BS=we((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}),"drawCircle"),$S=we((function(t,e){return ju(t,e)}),"drawText"),DS=we((function(t,e){function i(t,e,i,r,s){return t+","+e+" "+(t+i)+","+e+" "+(t+i)+","+(e+r-s)+" "+(t+i-1.2*s)+","+(e+r)+" "+t+","+(e+r)}we(i,"genPoints");const r=t.append("polygon");r.attr("points",i(e.x,e.y,50,20,7)),r.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,$S(t,e)}),"drawLabel"),IS=we((function(t,e,i){const r=t.append("g"),s=Hu();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=i.width*e.taskCount+// width of the tasks +i.diagramMarginX*(e.taskCount-1),s.height=i.height,s.class="journey-section section-type-"+e.num,s.rx=3,s.ry=3,AS(r,s),MS(i)(e.text,r,s.x,s.y,s.width,s.height,{class:"journey-section section-type-"+e.num},i,e.colour)}),"drawSection"),FS=-1,NS=we((function(t,e,i){const r=e.x+i.width/2,s=t.append("g");FS++;s.append("line").attr("id","task"+FS).attr("x1",r).attr("y1",e.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),LS(s,{cx:r,cy:300+30*(5-e.score),score:e.score});const n=Hu();n.x=e.x,n.y=e.y,n.fill=e.fill,n.width=i.width,n.height=i.height,n.class="task task-type-"+e.num,n.rx=3,n.ry=3,AS(s,n);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};BS(s,r),a+=10})),MS(i)(e.task,s,n.x,n.y,n.width,n.height,{class:"task"},i,e.colour)}),"drawTask"),OS=we((function(t,e){Wu(t,e)}),"drawBackgroundRect"),MS=function(){function t(t,e,i,s,n,a,o,l){r(e.append("text").attr("x",i+n/2).attr("y",s+a/2+5).style("font-color",l).style("text-anchor","middle").text(t),o)}function e(t,e,i,s,n,a,o,l,c){const{taskFontSize:h,taskFontFamily:d}=l,u=t.split(//gi);for(let p=0;p{const s=qS[r].color,n={cx:20,cy:i,r:7,fill:s,stroke:"#000",pos:qS[r].position};RS.drawCircle(t,n);const a={x:40,y:i+7,fill:"#666",text:r,textMargin:5|e.boxTextMargin};RS.drawText(t,a),i+=20}))}we(zS,"drawActorLegend");var WS=mr().journey,jS=WS.leftMargin,YS=we((function(t,e,i,r){const s=mr().journey,n=mr().securityLevel;let a;"sandbox"===n&&(a=K("#i"+e));const o=K("sandbox"===n?a.nodes()[0].contentDocument.body:"body");US.init();const l=o.select("#"+e);RS.initGraphics(l);const c=r.db.getTasks(),h=r.db.getDiagramTitle(),d=r.db.getActors();for(const m in qS)delete qS[m];let u=0;d.forEach((t=>{qS[t]={color:s.actorColours[u%s.actorColours.length],position:u},u++})),zS(l),US.insert(0,0,jS,50*Object.keys(qS).length),XS(l,c,0);const p=US.getBounds();h&&l.append("text").text(h).attr("x",jS).attr("font-size","4ex").attr("font-weight","bold").attr("y",25);const g=p.stopy-p.starty+2*s.diagramMarginY,y=jS+p.stopx+2*s.diagramMarginX;Qi(l,g,y,s.useMaxWidth),l.append("line").attr("x1",jS).attr("y1",4*s.height).attr("x2",y-jS-4).attr("y2",4*s.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const f=h?70:0;l.attr("viewBox",`${p.startx} -25 ${y} ${g+f}`),l.attr("preserveAspectRatio","xMinYMin meet"),l.attr("height",g+f+25)}),"draw"),US={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:we((function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0}),"init"),updateVal:we((function(t,e,i,r){void 0===t[e]?t[e]=i:t[e]=r(i,t[e])}),"updateVal"),updateBounds:we((function(t,e,i,r){const s=mr().journey,n=this;let a=0;function o(o){ +return we((function(l){a++;const c=n.sequenceItems.length-a+1;n.updateVal(l,"starty",e-c*s.boxMargin,Math.min),n.updateVal(l,"stopy",r+c*s.boxMargin,Math.max),n.updateVal(US.data,"startx",t-c*s.boxMargin,Math.min),n.updateVal(US.data,"stopx",i+c*s.boxMargin,Math.max),"activation"!==o&&(n.updateVal(l,"startx",t-c*s.boxMargin,Math.min),n.updateVal(l,"stopx",i+c*s.boxMargin,Math.max),n.updateVal(US.data,"starty",e-c*s.boxMargin,Math.min),n.updateVal(US.data,"stopy",r+c*s.boxMargin,Math.max))}),"updateItemBounds")}we(o,"updateFn"),this.sequenceItems.forEach(o())}),"updateBounds"),insert:we((function(t,e,i,r){const s=Math.min(t,i),n=Math.max(t,i),a=Math.min(e,r),o=Math.max(e,r);this.updateVal(US.data,"startx",s,Math.min),this.updateVal(US.data,"starty",a,Math.min),this.updateVal(US.data,"stopx",n,Math.max),this.updateVal(US.data,"stopy",o,Math.max),this.updateBounds(s,a,n,o)}),"insert"),bumpVerticalPos:we((function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos}),"bumpVerticalPos"),getVerticalPos:we((function(){return this.verticalPos}),"getVerticalPos"),getBounds:we((function(){return this.data}),"getBounds")},HS=WS.sectionFills,VS=WS.sectionColours,XS=we((function(t,e,i){const r=mr().journey;let s="";const n=i+(2*r.height+r.diagramMarginY);let a=0,o="#CCC",l="black",c=0;for(const[h,d]of e.entries()){if(s!==d.section){o=HS[a%HS.length],c=a%HS.length,l=VS[a%VS.length];let i=0;const n=d.section;for(let t=h;t(qS[e]&&(t[e]=qS[e]),t)),{});d.x=h*r.taskMargin+h*r.width+jS,d.y=n,d.width=r.diagramMarginX,d.height=r.diagramMarginY,d.colour=l,d.fill=o,d.num=c,d.actors=i,RS.drawTask(t,d,r),US.insert(d.x,d.y,d.x+d.width+r.taskMargin,450)}}),"drawTasks"),GS={setConf:PS,draw:YS},KS={parser:uS,db:vS,renderer:GS,styles:ES,init:we((t=>{GS.setConf(t.journey),vS.clear()}),"init")};const QS=Object.defineProperty({__proto__:null,diagram:KS},Symbol.toStringTag,{value:"Module"});var ZS=function(){var t=we((function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i}),"o"),e=[6,8,10,11,12,14,16,17,20,21],i=[1,9],r=[1,10],s=[1,11],n=[1,12],a=[1,13],o=[1,16],l=[1,17],c={trace:we((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,timeline:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,period_statement:18,event_statement:19,period:20,event:21,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",20:"period",21:"event"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[18,1],[19,1]],performAction:we((function(t,e,i,r,s,n,a){var o=n.length-1;switch(s){case 1:return n[o-1];case 2:case 6:case 7:this.$=[];break;case 3:n[o-1].push(n[o]),this.$=n[o-1];break;case 4:case 5:this.$=n[o];break;case 8:r.getCommonDb().setDiagramTitle(n[o].substr(6)),this.$=n[o].substr(6);break;case 9:this.$=n[o].trim(),r.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=n[o].trim(),r.getCommonDb().setAccDescription(this.$);break;case 12:r.addSection(n[o].substr(8)),this.$=n[o].substr(8);break;case 15:r.addTask(n[o],0,""),this.$=n[o];break;case 16:r.addEvent(n[o].substr(2)),this.$=n[o]}}),"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:i,12:r,14:s,16:n,17:a,18:14,19:15,20:o,21:l},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:18,11:i,12:r,14:s,16:n,17:a,18:14,19:15,20:o,21:l},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,19]},{15:[1,20]},t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),t(e,[2,4]),t(e,[2,9]),t(e,[2,10])],defaultActions:{},parseError:we((function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)}),"parseError"),parse:we((function(t){var e=this,i=[0],r=[],s=[null],n=[],a=this.table,o="",l=0,c=0,h=n.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;n.push(g);var y=d.options&&d.options.ranges;function f(){var t;return"number"!=typeof(t=r.pop()||d.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,we((function(t){i.length=i.length-2*t,s.length=s.length-t,n.length=n.length-t}),"popStack"),we(f,"lex");for(var m,x,b,k,C,S,w,T,_={};;){if(x=i[i.length-1],this.defaultActions[x]?b=this.defaultActions[x]:(null==m&&(m=f()),b=a[x]&&a[x][m]),void 0===b||!b.length||!b[0]){var v="";for(C in T=[],a[x])this.terminals_[C]&&C>2&&T.push("'"+this.terminals_[C]+"'");v=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(v,{text:d.match,token:this.terminals_[m]||m,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: "+x+", token: "+m);switch(b[0]){case 1:i.push(m),s.push(d.yytext),n.push(d.yylloc),i.push(b[1]),m=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(S=this.productions_[b[1]][1],_.$=s[s.length-S],_._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},y&&(_._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(k=this.performAction.apply(_,[o,c,l,u.yy,b[1],s,n].concat(h))))return k;S&&(i=i.slice(0,-1*S*2),s=s.slice(0,-1*S),n=n.slice(0,-1*S)),i.push(this.productions_[b[1]][0]),s.push(_.$),n.push(_._$),w=a[i[i.length-2]][i[i.length-1]],i.push(w);break;case 3:return!0}}return!0}),"parse")},h=function(){return{EOF:1,parseError:we((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"), +// resets the lexer, sets new input +setInput:we((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}),"setInput"), +// consumes and returns one char from the input +input:we((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}),"input"), +// unshifts one char (or a string) into the input +unput:we((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 s=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=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"), +// When called from action, caches matched text and appends it on next action +more:we((function(){return this._more=!0,this}),"more"), +// 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:we((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})}),"reject"), +// retain first n characters of the match +less:we((function(t){this.unput(this.match.slice(t))}),"less"), +// displays already matched input, i.e. for error messages +pastInput:we((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"), +// displays upcoming input, i.e. for error messages +upcomingInput:we((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,"")}),"upcomingInput"), +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:we((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"), +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:we((function(t,e){var i,r,s;if(this.options.backtrack_lexer&&(s={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&&(s.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 n in s)this[n]=s[n];return!1}return!1}),"test_match"), +// return next match in input +next:we((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 s=this._currentRules(),n=0;ne[0].length)){if(e=i,r=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[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})}),"next"), +// return next match that has a token +lex:we((function(){var t=this.next();return t||this.lex()}),"lex"), +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:we((function(t){this.conditionStack.push(t)}),"begin"), +// pop the previously active lexer condition state off the condition stack +popState:we((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"), +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:we((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"), +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:we((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"), +// alias for begin(condition) +pushState:we((function(t){this.begin(t)}),"pushState"), +// return the number of states currently on the stack +stateStackSize:we((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:we((function(t,e,i,r){switch(i){case 0:case 1:case 3:case 4:break;case 2:return 10;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 21;case 16:return 20;case 17:return 6;case 18:return"INVALID"}}),"anonymous"),rules:[/^(?:%(?!\{)[^\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:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18],inclusive:!0}}}}();function d(){this.yy={}}return c.lexer=h,we(d,"Parser"),d.prototype=c,c.Parser=d,new d}();ZS.parser=ZS;var JS=ZS,tw={};Te(tw,{addEvent:()=>uw,addSection:()=>lw,addTask:()=>dw,addTaskOrg:()=>pw,clear:()=>ow,default:()=>yw,getCommonDb:()=>aw,getSections:()=>cw,getTasks:()=>hw});var ew="",iw=0,rw=[],sw=[],nw=[],aw=we((()=>rr),"getCommonDb"),ow=we((function(){rw.length=0,sw.length=0,ew="",nw.length=0,lr()}),"clear"),lw=we((function(t){ew=t,rw.push(t)}),"addSection"),cw=we((function(){return rw}),"getSections"),hw=we((function(){let t=gw();let e=0;for(;!t&&e<100;)t=gw(),e++;return sw.push(...nw),sw}),"getTasks"),dw=we((function(t,e,i){const r={id:iw++,section:ew,type:ew,task:t,score:e||0, +//if event is defined, then add it the events array +events:i?[i]:[]};nw.push(r)}),"addTask"),uw=we((function(t){nw.find((t=>t.id===iw-1)).events.push(t)}),"addEvent"),pw=we((function(t){const e={section:ew,type:ew,description:t,task:t,classes:[]};sw.push(e)}),"addTaskOrg"),gw=we((function(){const t=we((function(t){return nw[t].processed}),"compileTask");let e=!0;for(const[i,r]of nw.entries())t(i),e=e&&r.processed;return e}),"compileTasks"),yw={clear:ow,getCommonDb:aw,addSection:lw,getSections:cw,getTasks:hw,addTask:dw,addTaskOrg:pw,addEvent:uw},fw=we((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}),"drawRect"),mw=we((function(t,e){const i=15,r=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",i).attr("stroke-width",2).attr("overflow","visible"),s=t.append("g");function n(t){const r=ie().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)+")")}function a(t){const r=ie().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)+")")}function o(t){t.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")}return s.append("circle").attr("cx",e.cx-5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),s.append("circle").attr("cx",e.cx+5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),we(n,"smile"),we(a,"sad"),we(o,"ambivalent"),e.score>3?n(s):e.score<3?a(s):o(s),r}),"drawFace"),xw=we((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}),"drawCircle"),bw=we((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 s=r.append("tspan");return s.attr("x",e.x+2*e.textMargin),s.text(i),r}),"drawText"),kw=we((function(t,e){function i(t,e,i,r,s){return t+","+e+" "+(t+i)+","+e+" "+(t+i)+","+(e+r-s)+" "+(t+i-1.2*s)+","+(e+r)+" "+t+","+(e+r)}we(i,"genPoints");const r=t.append("polygon");r.attr("points",i(e.x,e.y,50,20,7)),r.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,bw(t,e)}),"drawLabel"),Cw=we((function(t,e,i){const r=t.append("g"),s=vw();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=i.width,s.height=i.height,s.class="journey-section section-type-"+e.num,s.rx=3,s.ry=3,fw(r,s),Ew(i)(e.text,r,s.x,s.y,s.width,s.height,{class:"journey-section section-type-"+e.num},i,e.colour)}),"drawSection"),Sw=-1,ww=we((function(t,e,i){const r=e.x+i.width/2,s=t.append("g");Sw++;s.append("line").attr("id","task"+Sw).attr("x1",r).attr("y1",e.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),mw(s,{cx:r,cy:300+30*(5-e.score),score:e.score});const n=vw();n.x=e.x,n.y=e.y,n.fill=e.fill,n.width=i.width,n.height=i.height,n.class="task task-type-"+e.num,n.rx=3,n.ry=3,fw(s,n),Ew(i)(e.task,s,n.x,n.y,n.width,n.height,{class:"task"},i,e.colour)}),"drawTask"),Tw=we((function(t,e){fw(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()}),"drawBackgroundRect"),_w=we((function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}}),"getTextObj"),vw=we((function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}}),"getNoteRect"),Ew=function(){function t(t,e,i,s,n,a,o,l){r(e.append("text").attr("x",i+n/2).attr("y",s+a/2+5).style("font-color",l).style("text-anchor","middle").text(t),o)}function e(t,e,i,s,n,a,o,l,c){const{taskFontSize:h,taskFontFamily:d}=l,u=t.split(//gi);for(let p=0;p)/).reverse(),s=[],n=i.attr("y"),a=parseFloat(i.attr("dy")),o=i.text(null).append("tspan").attr("x",0).attr("y",n).attr("dy",a+"em");for(let l=0;le||"
"===t)&&(s.pop(),o.text(s.join(" ").trim()),s="
"===t?[""]:[t],o=i.append("tspan").attr("x",0).attr("y",n).attr("dy","1.1em").text(t))}))}we(Lw,"wrap");var Bw=we((function(t,e,i,r){var s;const n=i%12-1,a=t.append("g");e.section=n,a.attr("class",(e.class?e.class+" ":"")+"timeline-node section-"+n);const o=a.append("g"),l=a.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(Lw,e.width).node().getBBox(),h=(null==(s=r.fontSize)?void 0:s.replace)?r.fontSize.replace("px",""):r.fontSize;return e.height=c.height+1.1*h*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,l.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),Dw(o,e,n,r),e}),"drawNode"),$w=we((function(t,e,i){var r;const s=t.append("g"),n=s.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(Lw,e.width).node().getBBox(),a=(null==(r=i.fontSize)?void 0:r.replace)?i.fontSize.replace("px",""):i.fontSize;return s.remove(),n.height+1.1*a*.5+e.padding}),"getVirtualNodeHeight"),Dw=we((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)}),"defaultBkg"),Iw={drawRect:fw,drawCircle:xw,drawSection:Cw,drawText:bw,drawLabel:kw,drawTask:ww,drawBackgroundRect:Tw,getTextObj:_w,getNoteRect:vw,initGraphics:Aw,drawNode:Bw,getVirtualNodeHeight:$w},Fw=we((function(t,e,i,r){var s,n;const a=mr(),o=a.leftMargin??50;ve.debug("timeline",r.db);const l=a.securityLevel;let c;"sandbox"===l&&(c=K("#i"+e));const h=K("sandbox"===l?c.nodes()[0].contentDocument.body:"body").select("#"+e);h.append("g");const d=r.db.getTasks(),u=r.db.getCommonDb().getDiagramTitle();ve.debug("task",d),Iw.initGraphics(h);const p=r.db.getSections();ve.debug("sections",p);let g=0,y=0,f=0,m=0,x=50+o,b=50;m=50;let k=0,C=!0;p.forEach((function(t){const e={number:k,descr:t,section:k,width:150,padding:20,maxHeight:g},i=Iw.getVirtualNodeHeight(h,e,a);ve.debug("sectionHeight before draw",i),g=Math.max(g,i+20)}));let S=0,w=0;ve.debug("tasks.length",d.length);for(const[_,v]of d.entries()){const t={number:_,descr:v,section:v.section,width:150,padding:20,maxHeight:y},e=Iw.getVirtualNodeHeight(h,t,a);ve.debug("taskHeight before draw",e),y=Math.max(y,e+20),S=Math.max(S,v.events.length);let i=0;for(const r of v.events){const t={descr:r,section:v.section,number:v.section,width:150,padding:20,maxHeight:50};i+=Iw.getVirtualNodeHeight(h,t,a)}w=Math.max(w,i)}ve.debug("maxSectionHeight before draw",g),ve.debug("maxTaskHeight before draw",y),p&&p.length>0?p.forEach((t=>{const e=d.filter((e=>e.section===t)),i={number:k,descr:t,section:k,width:200*Math.max(e.length,1)-50,padding:20,maxHeight:g};ve.debug("sectionNode",i);const r=h.append("g"),s=Iw.drawNode(r,i,k,a);ve.debug("sectionNode output",s),r.attr("transform",`translate(${x}, 50)`),b+=g+50,e.length>0&&Nw(h,e,k,x,b,y,a,S,w,g,!1),x+=200*Math.max(e.length,1),b=50,k++})):(C=!1,Nw(h,d,k,x,b,y,a,S,w,g,!0));const T=h.node().getBBox();ve.debug("bounds",T),u&&h.append("text").text(u).attr("x",T.width/2-o).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),f=C?g+y+150:y+100;h.append("g").attr("class","lineWrapper").append("line").attr("x1",o).attr("y1",f).attr("x2",T.width+3*o).attr("y2",f).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),Zi(void 0,h,(null==(s=a.timeline)?void 0:s.padding)??50,(null==(n=a.timeline)?void 0:n.useMaxWidth)??!1)}),"draw"),Nw=we((function(t,e,i,r,s,n,a,o,l,c,h){var d;for(const u of e){const e={descr:u.task,section:i,number:i,width:150,padding:20,maxHeight:n};ve.debug("taskNode",e);const o=t.append("g").attr("class","taskWrapper"),p=Iw.drawNode(o,e,i,a).height;if(ve.debug("taskHeight after draw",p),o.attr("transform",`translate(${r}, ${s})`),n=Math.max(n,p),u.events){const e=t.append("g").attr("class","lineWrapper");let o=n;s+=100,o+=Ow(t,u.events,i,r,s,a),s-=100,e.append("line").attr("x1",r+95).attr("y1",s+n).attr("x2",r+95).attr("y2",s+n+(h?n:c)+l+120).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}r+=200,h&&!(null==(d=a.timeline)?void 0:d.disableMulticolor)&&i++}s-=10}),"drawTasks"),Ow=we((function(t,e,i,r,s,n){let a=0;const o=s;s+=100;for(const l of e){const e={descr:l,section:i,number:i,width:150,padding:20,maxHeight:50};ve.debug("eventNode",e);const o=t.append("g").attr("class","eventWrapper"),c=Iw.drawNode(o,e,i,n).height;a+=c,o.attr("transform",`translate(${r}, ${s})`),s=s+10+c}return s=o,a}),"drawEvents"),Mw={setConf:we((()=>{}),"setConf"),draw:Fw},Rw=we((t=>{let e="";for(let i=0;i`\n .edge {\n stroke-width: 3;\n }\n ${Rw(t)}\n .section-root rect, .section-root path, .section-root circle {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .eventWrapper {\n filter: brightness(120%);\n }\n`),"getStyles")};const qw=Object.defineProperty({__proto__:null,diagram:Pw},Symbol.toStringTag,{value:"Module"});var zw=function(){var t=we((function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i}),"o"),e=[1,4],i=[1,13],r=[1,12],s=[1,15],n=[1,16],a=[1,20],o=[1,19],l=[6,7,8],c=[1,26],h=[1,24],d=[1,25],u=[6,7,11],p=[1,6,13,15,16,19,22],g=[1,33],y=[1,34],f=[1,6,7,11,13,15,16,19,22],m={trace:we((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:we((function(t,e,i,r,s,n,a){var o=n.length-1;switch(s){case 6:case 7:return r;case 8:r.getLogger().trace("Stop NL ");break;case 9:r.getLogger().trace("Stop EOF ");break;case 11:r.getLogger().trace("Stop NL2 ");break;case 12:r.getLogger().trace("Stop EOF2 ");break;case 15:r.getLogger().info("Node: ",n[o].id),r.addNode(n[o-1].length,n[o].id,n[o].descr,n[o].type);break;case 16:r.getLogger().trace("Icon: ",n[o]),r.decorateNode({icon:n[o]});break;case 17:case 21:r.decorateNode({class:n[o]});break;case 18:r.getLogger().trace("SPACELIST");break;case 19:r.getLogger().trace("Node: ",n[o].id),r.addNode(0,n[o].id,n[o].descr,n[o].type);break;case 20:r.decorateNode({icon:n[o]});break;case 25:r.getLogger().trace("node found ..",n[o-2]),this.$={id:n[o-1],descr:n[o-1],type:r.getType(n[o-2],n[o])};break;case 26:this.$={id:n[o],descr:n[o],type:r.nodeType.DEFAULT};break;case 27:r.getLogger().trace("node found ..",n[o-3]),this.$={id:n[o-3],descr:n[o-1],type:r.getType(n[o-2],n[o])}}}),"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:i,7:[1,10],9:9,12:11,13:r,14:14,15:s,16:n,17:17,18:18,19:a,22:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:i,12:21,13:r,14:14,15:s,16:n,17:17,18:18,19:a,22:o},{6:i,9:22,12:11,13:r,14:14,15:s,16:n,17:17,18:18,19:a,22:o},{6:c,7:h,10:23,11:d},t(u,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:a,22:o}),t(u,[2,18]),t(u,[2,19]),t(u,[2,20]),t(u,[2,21]),t(u,[2,23]),t(u,[2,24]),t(u,[2,26],{19:[1,30]}),{20:[1,31]},{6:c,7:h,10:32,11:d},{1:[2,7],6:i,12:21,13:r,14:14,15:s,16:n,17:17,18:18,19:a,22:o},t(p,[2,14],{7:g,11:y}),t(f,[2,8]),t(f,[2,9]),t(f,[2,10]),t(u,[2,15]),t(u,[2,16]),t(u,[2,17]),{20:[1,35]},{21:[1,36]},t(p,[2,13],{7:g,11:y}),t(f,[2,11]),t(f,[2,12]),{21:[1,37]},t(u,[2,25]),t(u,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:we((function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)}),"parseError"),parse:we((function(t){var e=this,i=[0],r=[],s=[null],n=[],a=this.table,o="",l=0,c=0,h=n.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;n.push(g);var y=d.options&&d.options.ranges;function f(){var t;return"number"!=typeof(t=r.pop()||d.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,we((function(t){i.length=i.length-2*t,s.length=s.length-t,n.length=n.length-t}),"popStack"),we(f,"lex");for(var m,x,b,k,C,S,w,T,_={};;){if(x=i[i.length-1],this.defaultActions[x]?b=this.defaultActions[x]:(null==m&&(m=f()),b=a[x]&&a[x][m]),void 0===b||!b.length||!b[0]){var v="";for(C in T=[],a[x])this.terminals_[C]&&C>2&&T.push("'"+this.terminals_[C]+"'");v=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(v,{text:d.match,token:this.terminals_[m]||m,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: "+x+", token: "+m);switch(b[0]){case 1:i.push(m),s.push(d.yytext),n.push(d.yylloc),i.push(b[1]),m=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(S=this.productions_[b[1]][1],_.$=s[s.length-S],_._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},y&&(_._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(k=this.performAction.apply(_,[o,c,l,u.yy,b[1],s,n].concat(h))))return k;S&&(i=i.slice(0,-1*S*2),s=s.slice(0,-1*S),n=n.slice(0,-1*S)),i.push(this.productions_[b[1]][0]),s.push(_.$),n.push(_._$),w=a[i[i.length-2]][i[i.length-1]],i.push(w);break;case 3:return!0}}return!0}),"parse")},x=function(){return{EOF:1,parseError:we((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"), +// resets the lexer, sets new input +setInput:we((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}),"setInput"), +// consumes and returns one char from the input +input:we((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}),"input"), +// unshifts one char (or a string) into the input +unput:we((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 s=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=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"), +// When called from action, caches matched text and appends it on next action +more:we((function(){return this._more=!0,this}),"more"), +// 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:we((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})}),"reject"), +// retain first n characters of the match +less:we((function(t){this.unput(this.match.slice(t))}),"less"), +// displays already matched input, i.e. for error messages +pastInput:we((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"), +// displays upcoming input, i.e. for error messages +upcomingInput:we((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,"")}),"upcomingInput"), +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:we((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"), +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:we((function(t,e){var i,r,s;if(this.options.backtrack_lexer&&(s={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&&(s.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 n in s)this[n]=s[n];return!1}return!1}),"test_match"), +// return next match in input +next:we((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 s=this._currentRules(),n=0;ne[0].length)){if(e=i,r=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[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})}),"next"), +// return next match that has a token +lex:we((function(){var t=this.next();return t||this.lex()}),"lex"), +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:we((function(t){this.conditionStack.push(t)}),"begin"), +// pop the previously active lexer condition state off the condition stack +popState:we((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"), +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:we((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"), +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:we((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"), +// alias for begin(condition) +pushState:we((function(t){this.begin(t)}),"pushState"), +// return the number of states currently on the stack +stateStackSize:we((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:we((function(t,e,i,r){switch(i){case 0:return t.getLogger().trace("Found comment",e.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:case 23:case 26: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:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 24:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return t.getLogger().trace("description:",e.yytext),"NODE_DESCR";case 27:return this.popState(),t.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),t.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),t.getLogger().trace("node end ...",e.yytext),"NODE_DEND";case 30:case 33:case 34:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 31:case 32:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 35:case 36:return t.getLogger().trace("Long description:",e.yytext),20}}),"anonymous"),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,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}}}();function b(){this.yy={}}return m.lexer=x,we(b,"Parser"),b.prototype=m,m.Parser=b,new b}();zw.parser=zw;var Ww=zw,jw=[],Yw=0,Uw={},Hw=we((()=>{jw=[],Yw=0,Uw={}}),"clear"),Vw=we((function(t){for(let e=jw.length-1;e>=0;e--)if(jw[e].leveljw.length>0?jw[0]:null),"getMindmap"),Gw=we(((t,e,i,r)=>{var s,n;ve.info("addNode",t,e,i,r);const a=mr();let o=(null==(s=a.mindmap)?void 0:s.padding)??ii.mindmap.padding;switch(r){case Kw.ROUNDED_RECT:case Kw.RECT:case Kw.HEXAGON:o*=2}const l={id:Yw++,nodeId:Li(e,a),level:t,descr:Li(i,a),type:r,children:[],width:(null==(n=a.mindmap)?void 0:n.maxNodeWidth)??ii.mindmap.maxNodeWidth,padding:o},c=Vw(t);if(c)c.children.push(l),jw.push(l);else{if(0!==jw.length)throw new Error('There can be only one root. No parent could be found for ("'+l.descr+'")');jw.push(l)}}),"addNode"),Kw={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Qw={clear:Hw,addNode:Gw,getMindmap:Xw,nodeType:Kw,getType:we(((t,e)=>{switch(ve.debug("In get type",t,e),t){case"[":return Kw.RECT;case"(":return")"===e?Kw.ROUNDED_RECT:Kw.CLOUD;case"((":return Kw.CIRCLE;case")":return Kw.CLOUD;case"))":return Kw.BANG;case"{{":return Kw.HEXAGON;default:return Kw.DEFAULT}}),"getType"),setElementForId:we(((t,e)=>{Uw[t]=e}),"setElementForId"),decorateNode:we((t=>{if(!t)return;const e=mr(),i=jw[jw.length-1];t.icon&&(i.icon=Li(t.icon,e)),t.class&&(i.class=Li(t.class,e))}),"decorateNode"),type2Str:we((t=>{switch(t){case Kw.DEFAULT:return"no-border";case Kw.RECT:return"rect";case Kw.ROUNDED_RECT:return"rounded-rect";case Kw.CIRCLE:return"circle";case Kw.CLOUD:return"cloud";case Kw.BANG:return"bang";case Kw.HEXAGON:return"hexgon"; +// cspell: disable-line +default:return"no-border"}}),"type2Str"),getLogger:we((()=>ve),"getLogger"),getElementById:we((t=>Uw[t]),"getElementById")},Zw=we((function(t,e,i,r){e.append("path").attr("id","node-"+i.id).attr("class","node-bkg node-"+t.type2Str(i.type)).attr("d",`M0 ${i.height-5} v${10-i.height} q0,-5 5,-5 h${i.width-10} q5,0 5,5 v${i.height-5} H0 Z`),e.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",i.height).attr("x2",i.width).attr("y2",i.height)}),"defaultBkg"),Jw=we((function(t,e,i){e.append("rect").attr("id","node-"+i.id).attr("class","node-bkg node-"+t.type2Str(i.type)).attr("height",i.height).attr("width",i.width)}),"rectBkg"),tT=we((function(t,e,i){const r=i.width,s=i.height,n=.15*r,a=.25*r,o=.35*r,l=.2*r;e.append("path").attr("id","node-"+i.id).attr("class","node-bkg node-"+t.type2Str(i.type)).attr("d",`M0 0 a${n},${n} 0 0,1 ${.25*r},${-1*r*.1}\n a${o},${o} 1 0,1 ${.4*r},${-1*r*.1}\n a${a},${a} 1 0,1 ${.35*r},${1*r*.2}\n\n a${n},${n} 1 0,1 ${.15*r},${1*s*.35}\n a${l},${l} 1 0,1 ${-1*r*.15},${1*s*.65}\n\n a${a},${n} 1 0,1 ${-1*r*.25},${.15*r}\n a${o},${o} 1 0,1 ${-1*r*.5},0\n a${n},${n} 1 0,1 ${-1*r*.25},${-1*r*.15}\n\n a${n},${n} 1 0,1 ${-1*r*.1},${-1*s*.35}\n a${l},${l} 1 0,1 ${.1*r},${-1*s*.65}\n\n H0 V0 Z`)}),"cloudBkg"),eT=we((function(t,e,i){const r=i.width,s=i.height,n=.15*r;e.append("path").attr("id","node-"+i.id).attr("class","node-bkg node-"+t.type2Str(i.type)).attr("d",`M0 0 a${n},${n} 1 0,0 ${.25*r},${-1*s*.1}\n a${n},${n} 1 0,0 ${.25*r},0\n a${n},${n} 1 0,0 ${.25*r},0\n a${n},${n} 1 0,0 ${.25*r},${1*s*.1}\n\n a${n},${n} 1 0,0 ${.15*r},${1*s*.33}\n a${.8*n},${.8*n} 1 0,0 0,${1*s*.34}\n a${n},${n} 1 0,0 ${-1*r*.15},${1*s*.33}\n\n a${n},${n} 1 0,0 ${-1*r*.25},${.15*s}\n a${n},${n} 1 0,0 ${-1*r*.25},0\n a${n},${n} 1 0,0 ${-1*r*.25},0\n a${n},${n} 1 0,0 ${-1*r*.25},${-1*s*.15}\n\n a${n},${n} 1 0,0 ${-1*r*.1},${-1*s*.33}\n a${.8*n},${.8*n} 1 0,0 0,${-1*s*.34}\n a${n},${n} 1 0,0 ${.1*r},${-1*s*.33}\n\n H0 V0 Z`)}),"bangBkg"),iT=we((function(t,e,i){e.append("circle").attr("id","node-"+i.id).attr("class","node-bkg node-"+t.type2Str(i.type)).attr("r",i.width/2)}),"circleBkg");function rT(t,e,i,r,s){return t.insert("polygon",":first-child").attr("points",r.map((function(t){return t.x+","+t.y})).join(" ")).attr("transform","translate("+(s.width-e)/2+", "+i+")")}we(rT,"insertPolygonShape");var sT=we((function(t,e,i){const r=i.height,s=r/4,n=i.width-i.padding+2*s;rT(e,n,r,[{x:s,y:0},{x:n-s,y:0},{x:n,y:-r/2},{x:n-s,y:-r},{x:s,y:-r},{x:0,y:-r/2}],i)}),"hexagonBkg"),nT=we((function(t,e,i){e.append("rect").attr("id","node-"+i.id).attr("class","node-bkg node-"+t.type2Str(i.type)).attr("height",i.height).attr("rx",i.padding).attr("ry",i.padding).attr("width",i.width)}),"roundedRectBkg"),aT=we((async function(t,e,i,r,s){const n=s.htmlLabels,a=r%11,o=e.append("g");i.section=a;let l="section-"+a;a<0&&(l+=" section-root"),o.attr("class",(i.class?i.class+" ":"")+"mindmap-node "+l);const c=o.append("g"),h=o.append("g"),d=i.descr.replace(/()/g,"\n");await Ro(h,d,{useHtmlLabels:n,width:i.width,classes:"mindmap-node-label"},s),n||h.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");const u=h.node().getBBox(),[p]=yo(s.fontSize);if(i.height=u.height+1.1*p*.5+i.padding,i.width=u.width+2*i.padding,i.icon)if(i.type===t.nodeType.CIRCLE){i.height+=50,i.width+=50;o.append("foreignObject").attr("height","50px").attr("width",i.width).attr("style","text-align: center;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+a+" "+i.icon),h.attr("transform","translate("+i.width/2+", "+(i.height/2-1.5*i.padding)+")")}else{i.width+=50;const t=i.height;i.height=Math.max(t,60);const e=Math.abs(i.height-t);o.append("foreignObject").attr("width","60px").attr("height",i.height).attr("style","text-align: center;margin-top:"+e/2+"px;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+a+" "+i.icon),h.attr("transform","translate("+(25+i.width/2)+", "+(e/2+i.padding/2)+")")}else if(n){const t=(i.width-u.width)/2,e=(i.height-u.height)/2;h.attr("transform","translate("+t+", "+e+")")}else{const t=i.width/2,e=i.padding/2;h.attr("transform","translate("+t+", "+e+")")}switch(i.type){case t.nodeType.DEFAULT:Zw(t,c,i,a);break;case t.nodeType.ROUNDED_RECT:nT(t,c,i,a);break;case t.nodeType.RECT:Jw(t,c,i,a);break;case t.nodeType.CIRCLE:c.attr("transform","translate("+i.width/2+", "+ +i.height/2+")"),iT(t,c,i,a);break;case t.nodeType.CLOUD:tT(t,c,i,a);break;case t.nodeType.BANG:eT(t,c,i,a);break;case t.nodeType.HEXAGON:sT(t,c,i,a)}return t.setElementForId(i.id,o),i.height}),"drawNode"),oT=we((function(t,e){const i=t.getElementById(e.id),r=e.x||0,s=e.y||0;i.attr("transform","translate("+r+","+s+")")}),"positionNode");async function lT(t,e,i,r,s){await aT(t,e,i,r,s),i.children&&await Promise.all(i.children.map(((i,n)=>lT(t,e,i,r<0?n:r,s))))}function cT(t,e){e.edges().map(((e,i)=>{const r=e.data();if(e[0]._private.bodyBounds){const s=e[0]._private.rscratch;ve.trace("Edge: ",i,r),t.insert("path").attr("d",`M ${s.startX},${s.startY} L ${s.midX},${s.midY} L${s.endX},${s.endY} `).attr("class","edge section-edge-"+r.section+" edge-depth-"+r.depth)}}))}function hT(t,e,i,r){e.add({group:"nodes",data:{id:t.id.toString(),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((s=>{hT(s,e,i,r+1),e.add({group:"edges",data:{id:`${t.id}_${s.id}`,source:t.id,target:s.id,depth:r,section:s.section}})}))}function dT(t,e){return new Promise((i=>{const r=K("body").append("div").attr("id","cy").attr("style","display:none"),s=ne({container:document.getElementById("cy"), +// container to render in +style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),hT(t,s,e,0),s.nodes().forEach((function(t){t.layoutDimensions=()=>{const e=t.data();return{w:e.width,h:e.height}}})),s.layout({name:"cose-bilkent", +// @ts-ignore Types for cose-bilkent are not correct? +quality:"proof",styleEnabled:!1,animate:!1}).run(),s.ready((t=>{ve.info("Ready",t),i(s)}))}))}function uT(t,e){e.nodes().map(((e,i)=>{const r=e.data();r.x=e.position().x,r.y=e.position().y,oT(t,r);const s=t.getElementById(r.nodeId);ve.info("Id:",i,"Position: (",e.position().x,", ",e.position().y,")",r),s.attr("transform",`translate(${e.position().x-r.width/2}, ${e.position().y-r.height/2})`),s.attr("attr",`apa-${i})`)}))}ne.use(ae),we(lT,"drawNodes"),we(cT,"drawEdges"),we(hT,"addNodes"),we(dT,"layoutMindmap"),we(uT,"positionNodes");var pT={draw:we((async(t,e,i,r)=>{var s,n;ve.debug("Rendering mindmap diagram\n"+t);const a=r.db,o=a.getMindmap();if(!o)return;const l=mr();l.htmlLabels=!1;const c=$h(e),h=c.append("g");h.attr("class","mindmap-edges");const d=c.append("g");d.attr("class","mindmap-nodes"),await lT(a,d,o,-1,l);const u=await dT(o,l);cT(h,u),uT(a,u),Zi(void 0,c,(null==(s=l.mindmap)?void 0:s.padding)??ii.mindmap.padding,(null==(n=l.mindmap)?void 0:n.useMaxWidth)??ii.mindmap.useMaxWidth)}),"draw")},gT=we((t=>{let e="";for(let i=0;i`\n .edge {\n stroke-width: 3;\n }\n ${gT(t)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .mindmap-node-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n`),"getStyles")};const fT=Object.defineProperty({__proto__:null,diagram:yT},Symbol.toStringTag,{value:"Module"});var mT=function(){var t=we((function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i}),"o"),e=[1,4],i=[1,13],r=[1,12],s=[1,15],n=[1,16],a=[1,20],o=[1,19],l=[6,7,8],c=[1,26],h=[1,24],d=[1,25],u=[6,7,11],p=[1,31],g=[6,7,11,24],y=[1,6,13,16,17,20,23],f=[1,35],m=[1,36],x=[1,6,7,11,13,16,17,20,23],b=[1,38],k={trace:we((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:we((function(t,e,i,r,s,n,a){var o=n.length-1;switch(s){case 6:case 7:return r;case 8:r.getLogger().trace("Stop NL ");break;case 9:r.getLogger().trace("Stop EOF ");break;case 11:r.getLogger().trace("Stop NL2 ");break;case 12:r.getLogger().trace("Stop EOF2 ");break;case 15:r.getLogger().info("Node: ",n[o-1].id),r.addNode(n[o-2].length,n[o-1].id,n[o-1].descr,n[o-1].type,n[o]);break;case 16:r.getLogger().info("Node: ",n[o].id),r.addNode(n[o-1].length,n[o].id,n[o].descr,n[o].type);break;case 17:r.getLogger().trace("Icon: ",n[o]),r.decorateNode({icon:n[o]});break;case 18:case 23:r.decorateNode({class:n[o]});break;case 19:r.getLogger().trace("SPACELIST");break;case 20:r.getLogger().trace("Node: ",n[o-1].id),r.addNode(0,n[o-1].id,n[o-1].descr,n[o-1].type,n[o]);break;case 21:r.getLogger().trace("Node: ",n[o].id),r.addNode(0,n[o].id,n[o].descr,n[o].type);break;case 22:r.decorateNode({icon:n[o]});break;case 27:r.getLogger().trace("node found ..",n[o-2]),this.$={id:n[o-1],descr:n[o-1],type:r.getType(n[o-2],n[o])};break;case 28:this.$={id:n[o],descr:n[o],type:0};break;case 29:r.getLogger().trace("node found ..",n[o-3]),this.$={id:n[o-3],descr:n[o-1],type:r.getType(n[o-2],n[o])};break;case 30:this.$=n[o-1]+n[o];break;case 31:this.$=n[o]}}),"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:i,7:[1,10],9:9,12:11,13:r,14:14,16:s,17:n,18:17,19:18,20:a,23:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:i,12:21,13:r,14:14,16:s,17:n,18:17,19:18,20:a,23:o},{6:i,9:22,12:11,13:r,14:14,16:s,17:n,18:17,19:18,20:a,23:o},{6:c,7:h,10:23,11:d},t(u,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:a,23:o}),t(u,[2,19]),t(u,[2,21],{15:30,24:p}),t(u,[2,22]),t(u,[2,23]),t(g,[2,25]),t(g,[2,26]),t(g,[2,28],{20:[1,32]}),{21:[1,33]},{6:c,7:h,10:34,11:d},{1:[2,7],6:i,12:21,13:r,14:14,16:s,17:n,18:17,19:18,20:a,23:o},t(y,[2,14],{7:f,11:m}),t(x,[2,8]),t(x,[2,9]),t(x,[2,10]),t(u,[2,16],{15:37,24:p}),t(u,[2,17]),t(u,[2,18]),t(u,[2,20],{24:b}),t(g,[2,31]),{21:[1,39]},{22:[1,40]},t(y,[2,13],{7:f,11:m}),t(x,[2,11]),t(x,[2,12]),t(u,[2,15],{24:b}),t(g,[2,30]),{22:[1,41]},t(g,[2,27]),t(g,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:we((function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)}),"parseError"),parse:we((function(t){var e=this,i=[0],r=[],s=[null],n=[],a=this.table,o="",l=0,c=0,h=n.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;n.push(g);var y=d.options&&d.options.ranges;function f(){var t;return"number"!=typeof(t=r.pop()||d.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,we((function(t){i.length=i.length-2*t,s.length=s.length-t,n.length=n.length-t}),"popStack"),we(f,"lex");for(var m,x,b,k,C,S,w,T,_={};;){if(x=i[i.length-1],this.defaultActions[x]?b=this.defaultActions[x]:(null==m&&(m=f()),b=a[x]&&a[x][m]),void 0===b||!b.length||!b[0]){var v="";for(C in T=[],a[x])this.terminals_[C]&&C>2&&T.push("'"+this.terminals_[C]+"'");v=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(v,{text:d.match,token:this.terminals_[m]||m,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: "+x+", token: "+m);switch(b[0]){case 1:i.push(m),s.push(d.yytext),n.push(d.yylloc),i.push(b[1]),m=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(S=this.productions_[b[1]][1],_.$=s[s.length-S],_._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},y&&(_._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(k=this.performAction.apply(_,[o,c,l,u.yy,b[1],s,n].concat(h))))return k;S&&(i=i.slice(0,-1*S*2),s=s.slice(0,-1*S),n=n.slice(0,-1*S)),i.push(this.productions_[b[1]][0]),s.push(_.$),n.push(_._$),w=a[i[i.length-2]][i[i.length-1]],i.push(w);break;case 3:return!0}}return!0}),"parse")},C=function(){return{EOF:1,parseError:we((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"), +// resets the lexer, sets new input +setInput:we((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}),"setInput"), +// consumes and returns one char from the input +input:we((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}),"input"), +// unshifts one char (or a string) into the input +unput:we((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 s=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=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"), +// When called from action, caches matched text and appends it on next action +more:we((function(){return this._more=!0,this}),"more"), +// 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:we((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})}),"reject"), +// retain first n characters of the match +less:we((function(t){this.unput(this.match.slice(t))}),"less"), +// displays already matched input, i.e. for error messages +pastInput:we((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"), +// displays upcoming input, i.e. for error messages +upcomingInput:we((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,"")}),"upcomingInput"), +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:we((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"), +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:we((function(t,e){var i,r,s;if(this.options.backtrack_lexer&&(s={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&&(s.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 n in s)this[n]=s[n];return!1}return!1}),"test_match"), +// return next match in input +next:we((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 s=this._currentRules(),n=0;ne[0].length)){if(e=i,r=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[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})}),"next"), +// return next match that has a token +lex:we((function(){var t=this.next();return t||this.lex()}),"lex"), +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:we((function(t){this.conditionStack.push(t)}),"begin"), +// pop the previously active lexer condition state off the condition stack +popState:we((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"), +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:we((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"), +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:we((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"), +// alias for begin(condition) +pushState:we((function(t){this.begin(t)}),"pushState"), +// return the number of states currently on the stack +stateStackSize:we((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:we((function(t,e,i,r){switch(i){case 0:return this.pushState("shapeData"),e.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const i=/\n\s*/g;return e.yytext=e.yytext.replace(i,"
"),24;case 4:return 24;case 5:case 10:case 29:case 32:this.popState();break;case 6:return t.getLogger().trace("Found comment",e.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 11:t.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return t.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:t.getLogger().trace("end icon"),this.popState();break;case 16:return t.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return t.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return t.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return t.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:case 21:case 22:case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 30:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return t.getLogger().trace("description:",e.yytext),"NODE_DESCR";case 33:return this.popState(),t.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),t.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),t.getLogger().trace("node end ...",e.yytext),"NODE_DEND";case 36:case 39:case 40:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 37:case 38:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 41:case 42:return t.getLogger().trace("Long description:",e.yytext),21}}),"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\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,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}}}();function S(){this.yy={}}return k.lexer=C,we(S,"Parser"),S.prototype=k,k.Parser=S,new S}();mT.parser=mT;var xT=mT,bT=[],kT=[],CT=0,ST={},wT=we((()=>{bT=[],kT=[],CT=0,ST={}}),"clear"),TT=we((t=>{if(0===bT.length)return null;const e=bT[0].level;let i=null;for(let r=bT.length-1;r>=0;r--)if(bT[r].level!==e||i||(i=bT[r]),bT[r].levelt.parentId===r.id));for(const n of s){const e={id:n.id,parentId:r.id,label:Li(n.label??"",i),isGroup:!1,ticket:null==n?void 0:n.ticket,priority:null==n?void 0:n.priority,assigned:null==n?void 0:n.assigned,icon:null==n?void 0:n.icon,shape:"kanbanItem",level:n.level,rx:5,ry:5,cssStyles:["text-align: left"]};t.push(e)}}return{nodes:t,edges:[],other:{},config:mr()}}),"getData"),ET=we(((t,e,i,r,s)=>{var n,a;const o=mr();let l=(null==(n=o.mindmap)?void 0:n.padding)??ii.mindmap.padding;switch(r){case AT.ROUNDED_RECT:case AT.RECT:case AT.HEXAGON:l*=2}const c={id:Li(e,o)||"kbn"+CT++,level:t,label:Li(i,o),width:(null==(a=o.mindmap)?void 0:a.maxNodeWidth)??ii.mindmap.maxNodeWidth,padding:l,isGroup:!1};if(void 0!==s){let t;t=s.includes("\n")?s+"\n":"{\n"+s+"\n}";const e=wa(t,{schema:Sa});if(e.shape&&(e.shape!==e.shape.toLowerCase()||e.shape.includes("_")))throw new Error(`No such shape: ${e.shape}. Shape names should be lowercase.`);(null==e?void 0:e.shape)&&"kanbanItem"===e.shape&&(c.shape=null==e?void 0:e.shape),(null==e?void 0:e.label)&&(c.label=null==e?void 0:e.label),(null==e?void 0:e.icon)&&(c.icon=null==e?void 0:e.icon.toString()),(null==e?void 0:e.assigned)&&(c.assigned=null==e?void 0:e.assigned.toString()),(null==e?void 0:e.ticket)&&(c.ticket=null==e?void 0:e.ticket.toString()),(null==e?void 0:e.priority)&&(c.priority=null==e?void 0:e.priority)}const h=TT(t);h?c.parentId=h.id||"kbn"+CT++:kT.push(c),bT.push(c)}),"addNode"),AT={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},LT={clear:wT,addNode:ET,getSections:_T,getData:vT,nodeType:AT,getType:we(((t,e)=>{switch(ve.debug("In get type",t,e),t){case"[":return AT.RECT;case"(":return")"===e?AT.ROUNDED_RECT:AT.CLOUD;case"((":return AT.CIRCLE;case")":return AT.CLOUD;case"))":return AT.BANG;case"{{":return AT.HEXAGON;default:return AT.DEFAULT}}),"getType"),setElementForId:we(((t,e)=>{ST[t]=e}),"setElementForId"),decorateNode:we((t=>{if(!t)return;const e=mr(),i=bT[bT.length-1];t.icon&&(i.icon=Li(t.icon,e)),t.class&&(i.cssClasses=Li(t.class,e))}),"decorateNode"),type2Str:we((t=>{switch(t){case AT.DEFAULT:return"no-border";case AT.RECT:return"rect";case AT.ROUNDED_RECT:return"rounded-rect";case AT.CIRCLE:return"circle";case AT.CLOUD:return"cloud";case AT.BANG:return"bang";case AT.HEXAGON:return"hexgon"; +// cspell: disable-line +default:return"no-border"}}),"type2Str"),getLogger:we((()=>ve),"getLogger"),getElementById:we((t=>ST[t]),"getElementById")},BT={draw:we((async(t,e,i,r)=>{var s,n,a,o,l;ve.debug("Rendering kanban diagram\n"+t);const c=r.db.getData(),h=mr();h.htmlLabels=!1;const d=$h(e),u=d.append("g");u.attr("class","sections");const p=d.append("g");p.attr("class","items");const g=c.nodes.filter(( +// TODO: TypeScript 5.5 will infer this predicate automatically +t=>t.isGroup));let y=0;const f=[];let m=25;for(const b of g){const t=(null==(s=null==h?void 0:h.kanban)?void 0:s.sectionWidth)||200;y+=1,b.x=t*y+10*(y-1)/2,b.width=t,b.y=0,b.height=3*t,b.rx=5,b.ry=5,b.cssClasses=b.cssClasses+" section-"+y;const e=await cl(u,b);m=Math.max(m,null==(n=null==e?void 0:e.labelBBox)?void 0:n.height),f.push(e)}let x=0;for(const b of g){const t=f[x];x+=1;const e=(null==(a=null==h?void 0:h.kanban)?void 0:a.sectionWidth)||200,i=3*-e/2+m;let r=i;const s=c.nodes.filter((t=>t.parentId===b.id));for(const a of s){if(a.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");a.x=b.x,a.width=e-15;const t=(await eh(p,a,{config:h})).node().getBBox();a.y=r+t.height/2,await sh(a),r=a.y+t.height/2+5}const n=t.cluster.select("rect"),o=Math.max(r-i+30,50)+(m-25);n.attr("height",o)}Zi(void 0,d,(null==(o=h.mindmap)?void 0:o.padding)??ii.kanban.padding,(null==(l=h.mindmap)?void 0:l.useMaxWidth)??ii.kanban.useMaxWidth)}),"draw")},$T=we((t=>{let e="";for(let r=0;rt.darkMode?st(e,i):nt(e,i)),"adjuster");for(let r=0;r`\n .edge {\n stroke-width: 3;\n }\n ${$T(t)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .cluster-label, .label {\n color: ${t.textColor};\n fill: ${t.textColor};\n }\n .kanban-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n`),"getStyles")};const IT=Object.defineProperty({__proto__:null,diagram:DT},Symbol.toStringTag,{value:"Module"});var FT=function(){var t=we((function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i}),"o"),e=[1,9],i=[1,10],r=[1,5,10,12],s={trace:we((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:we((function(t,e,i,r,s,n,a){var o=n.length-1;switch(s){case 7:const t=r.findOrCreateNode(n[o-4].trim().replaceAll('""','"')),e=r.findOrCreateNode(n[o-2].trim().replaceAll('""','"')),i=parseFloat(n[o].trim());r.addLink(t,e,i);break;case 8:case 9:case 11:this.$=n[o];break;case 10:this.$=n[o-1]}}),"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:i},{1:[2,6],7:11,10:[1,12]},t(i,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(r,[2,8]),t(r,[2,9]),{19:[1,16]},t(r,[2,11]),{1:[2,1]},{1:[2,5]},t(i,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:i},{15:18,16:7,17:8,18:e,20:i},{18:[1,19]},t(i,[2,3]),{12:[1,20]},t(r,[2,10]),{15:21,16:7,17:8,18:e,20:i},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:we((function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)}),"parseError"),parse:we((function(t){var e=this,i=[0],r=[],s=[null],n=[],a=this.table,o="",l=0,c=0,h=n.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;n.push(g);var y=d.options&&d.options.ranges;function f(){var t;return"number"!=typeof(t=r.pop()||d.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,we((function(t){i.length=i.length-2*t,s.length=s.length-t,n.length=n.length-t}),"popStack"),we(f,"lex");for(var m,x,b,k,C,S,w,T,_={};;){if(x=i[i.length-1],this.defaultActions[x]?b=this.defaultActions[x]:(null==m&&(m=f()),b=a[x]&&a[x][m]),void 0===b||!b.length||!b[0]){var v="";for(C in T=[],a[x])this.terminals_[C]&&C>2&&T.push("'"+this.terminals_[C]+"'");v=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(v,{text:d.match,token:this.terminals_[m]||m,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: "+x+", token: "+m);switch(b[0]){case 1:i.push(m),s.push(d.yytext),n.push(d.yylloc),i.push(b[1]),m=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(S=this.productions_[b[1]][1],_.$=s[s.length-S],_._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},y&&(_._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(k=this.performAction.apply(_,[o,c,l,u.yy,b[1],s,n].concat(h))))return k;S&&(i=i.slice(0,-1*S*2),s=s.slice(0,-1*S),n=n.slice(0,-1*S)),i.push(this.productions_[b[1]][0]),s.push(_.$),n.push(_._$),w=a[i[i.length-2]][i[i.length-1]],i.push(w);break;case 3:return!0}}return!0}),"parse")},n=function(){return{EOF:1,parseError:we((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"), +// resets the lexer, sets new input +setInput:we((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}),"setInput"), +// consumes and returns one char from the input +input:we((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}),"input"), +// unshifts one char (or a string) into the input +unput:we((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 s=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=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"), +// When called from action, caches matched text and appends it on next action +more:we((function(){return this._more=!0,this}),"more"), +// 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:we((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})}),"reject"), +// retain first n characters of the match +less:we((function(t){this.unput(this.match.slice(t))}),"less"), +// displays already matched input, i.e. for error messages +pastInput:we((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"), +// displays upcoming input, i.e. for error messages +upcomingInput:we((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,"")}),"upcomingInput"), +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:we((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"), +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:we((function(t,e){var i,r,s;if(this.options.backtrack_lexer&&(s={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&&(s.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 n in s)this[n]=s[n];return!1}return!1}),"test_match"), +// return next match in input +next:we((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 s=this._currentRules(),n=0;ne[0].length)){if(e=i,r=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[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})}),"next"), +// return next match that has a token +lex:we((function(){var t=this.next();return t||this.lex()}),"lex"), +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:we((function(t){this.conditionStack.push(t)}),"begin"), +// pop the previously active lexer condition state off the condition stack +popState:we((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"), +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:we((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"), +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:we((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"), +// alias for begin(condition) +pushState:we((function(t){this.begin(t)}),"pushState"), +// return the number of states currently on the stack +stateStackSize:we((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:we((function(t,e,i,r){switch(i){case 0:return this.pushState("csv"),4;case 1:return 10;case 2:return 5;case 3:return 12;case 4:return this.pushState("escaped_text"),18;case 5:return 20;case 6:return this.popState("escaped_text"),18;case 7:return 19}}),"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[1,2,3,4,5,6,7],inclusive:!1},escaped_text:{rules:[6,7],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}}}();function a(){this.yy={}}return s.lexer=n,we(a,"Parser"),a.prototype=s,s.Parser=a,new a}();FT.parser=FT;var NT=FT,OT=[],MT=[],RT=new Map,PT=we((()=>{OT=[],MT=[],RT=new Map,lr()}),"clear"),qT=(we(D=class{constructor(t,e,i=0){this.source=t,this.target=e,this.value=i}},"SankeyLink"),D),zT=we(((t,e,i)=>{OT.push(new qT(t,e,i))}),"addLink"),WT=(we(I=class{constructor(t){this.ID=t}},"SankeyNode"),I),jT=we((t=>{t=Xi.sanitizeText(t,mr());let e=RT.get(t);return void 0===e&&(e=new WT(t),RT.set(t,e),MT.push(e)),e}),"findOrCreateNode"),YT=we((()=>MT),"getNodes"),UT=we((()=>OT),"getLinks"),HT=we((()=>({nodes:MT.map((t=>({id:t.ID}))),links:OT.map((t=>({source:t.source.ID,target:t.target.ID,value:t.value})))})),"getGraph"),VT={nodesMap:RT,getConfig:we((()=>mr().sankey),"getConfig"),getNodes:YT,getLinks:UT,getGraph:HT,addLink:zT,findOrCreateNode:jT,getAccTitle:hr,setAccTitle:cr,getAccDescription:ur,setAccDescription:dr,getDiagramTitle:gr,setDiagramTitle:pr,clear:PT},XT=(we(F=class{static next(t){return new F(t+ ++F.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}},"Uid"),F.count=0,F),GT={left:de,right:he,center:ce,justify:le},KT={draw:we((function(t,e,i,r){const{securityLevel:s,sankey:n}=mr(),a=br.sankey;let o;"sandbox"===s&&(o=K("#i"+e));const l=K("sandbox"===s?o.nodes()[0].contentDocument.body:"body"),c="sandbox"===s?l.select(`[id="${e}"]`):K(`[id="${e}"]`),h=(null==n?void 0:n.width)??a.width,d=(null==n?void 0:n.height)??a.width,u=(null==n?void 0:n.useMaxWidth)??a.useMaxWidth,p=(null==n?void 0:n.nodeAlignment)??a.nodeAlignment,g=(null==n?void 0:n.prefix)??a.prefix,y=(null==n?void 0:n.suffix)??a.suffix,f=(null==n?void 0:n.showValues)??a.showValues,m=r.db.getGraph(),x=GT[p];oe().nodeId((t=>t.id)).nodeWidth(10).nodePadding(10+(f?15:0)).nodeAlign(x).extent([[0,0],[h,d]])(m);const b=gt(pe);c.append("g").attr("class","nodes").selectAll(".node").data(m.nodes).join("g").attr("class","node").attr("id",(t=>(t.uid=XT.next("node-")).id)).attr("transform",(function(t){return"translate("+t.x0+","+t.y0+")"})).attr("x",(t=>t.x0)).attr("y",(t=>t.y0)).append("rect").attr("height",(t=>t.y1-t.y0)).attr("width",(t=>t.x1-t.x0)).attr("fill",(t=>b(t.id)));const k=we((({id:t,value:e})=>f?`${t}\n${g}${Math.round(100*e)/100}${y}`:t),"getText");c.append("g").attr("class","node-labels").attr("font-size",14).selectAll("text").data(m.nodes).join("text").attr("x",(t=>t.x0(t.y1+t.y0)/2)).attr("dy",(f?"0":"0.35")+"em").attr("text-anchor",(t=>t.x0(t.uid=XT.next("linearGradient-")).id)).attr("gradientUnits","userSpaceOnUse").attr("x1",(t=>t.source.x1)).attr("x2",(t=>t.target.x0));t.append("stop").attr("offset","0%").attr("stop-color",(t=>b(t.source.id))),t.append("stop").attr("offset","100%").attr("stop-color",(t=>b(t.target.id)))}let w;switch(S){case"gradient":w=we((t=>t.uid),"coloring");break;case"source":w=we((t=>b(t.source.id)),"coloring");break;case"target":w=we((t=>b(t.target.id)),"coloring");break;default:w=S}C.append("path").attr("d",ue()).attr("stroke",w).attr("stroke-width",(t=>Math.max(1,t.width))),Zi(void 0,c,0,u)}),"draw")},QT=we((t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim()),"prepareTextForParsing"),ZT=we((t=>`.label {\n font-family: ${t.fontFamily};\n }`),"getStyles"),JT=NT.parse.bind(NT);NT.parse=t=>JT(QT(t));var t_={styles:ZT,parser:NT,db:VT,renderer:KT};const e_=Object.defineProperty({__proto__:null,diagram:t_},Symbol.toStringTag,{value:"Module"});var i_={packet:[]},r_=structuredClone(i_),s_=ii.packet,n_=we((()=>{const t=fo({...s_,...yi().packet});return t.showBits&&(t.paddingY+=10),t}),"getConfig"),a_=we((()=>r_.packet),"getPacket"),o_={pushWord:we((t=>{t.length>0&&r_.packet.push(t)}),"pushWord"),getPacket:a_,getConfig:n_,clear:we((()=>{lr(),r_=structuredClone(i_)}),"clear"),setAccTitle:cr,getAccTitle:hr,setDiagramTitle:pr,getDiagramTitle:gr,getAccDescription:ur,setAccDescription:dr},l_=we((t=>{Wg(t,o_);let e=-1,i=[],r=1;const{bitsPerRow:s}=o_.getConfig();for(let{start:n,end:a,label:o}of t.blocks){if(a&&a{if(void 0===t.end&&(t.end=t.start),t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);return t.end+1<=e*i?[t,void 0]:[{start:t.start,end:e*i-1,label:t.label},{start:e*i,end:t.end,label:t.label}]}),"getNextFittingBlock"),h_={parse:we((async t=>{const e=await q("packet",t);ve.debug(e),l_(e)}),"parse")},d_=we(((t,e,i,r)=>{const s=r.db,n=s.getConfig(),{rowHeight:a,paddingY:o,bitWidth:l,bitsPerRow:c}=n,h=s.getPacket(),d=s.getDiagramTitle(),u=a+o,p=u*(h.length+1)-(d?0:a),g=l*c+2,y=$h(e);y.attr("viewbox",`0 0 ${g} ${p}`),Qi(y,p,g,n.useMaxWidth);for(const[f,m]of h.entries())u_(y,m,f,n);y.append("text").text(d).attr("x",g/2).attr("y",p-u/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")}),"draw"),u_=we(((t,e,i,{rowHeight:r,paddingX:s,paddingY:n,bitWidth:a,bitsPerRow:o,showBits:l})=>{const c=t.append("g"),h=i*(r+n)+n;for(const d of e){const t=d.start%o*a+1,e=(d.end-d.start+1)*a-s;if(c.append("rect").attr("x",t).attr("y",h).attr("width",e).attr("height",r).attr("class","packetBlock"),c.append("text").attr("x",t+e/2).attr("y",h+r/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(d.label),!l)continue;const i=d.end===d.start,n=h-2;c.append("text").attr("x",t+(i?e/2:0)).attr("y",n).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",i?"middle":"start").text(d.start),i||c.append("text").attr("x",t+e).attr("y",n).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(d.end)}}),"drawWord"),p_={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},g_={parser:h_,db:o_,renderer:{draw:d_},styles:we((({packet:t}={})=>{const e=fo(p_,t);return`\n\t.packetByte {\n\t\tfont-size: ${e.byteFontSize};\n\t}\n\t.packetByte.start {\n\t\tfill: ${e.startByteColor};\n\t}\n\t.packetByte.end {\n\t\tfill: ${e.endByteColor};\n\t}\n\t.packetLabel {\n\t\tfill: ${e.labelColor};\n\t\tfont-size: ${e.labelFontSize};\n\t}\n\t.packetTitle {\n\t\tfill: ${e.titleColor};\n\t\tfont-size: ${e.titleFontSize};\n\t}\n\t.packetBlock {\n\t\tstroke: ${e.blockStrokeColor};\n\t\tstroke-width: ${e.blockStrokeWidth};\n\t\tfill: ${e.blockFillColor};\n\t}\n\t`}),"styles")};const y_=Object.defineProperty({__proto__:null,diagram:g_},Symbol.toStringTag,{value:"Module"});var f_={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},m_={axes:[],curves:[],options:f_},x_=structuredClone(m_),b_=ii.radar,k_=we((()=>fo({...b_,...yi().radar})),"getConfig"),C_=we((()=>x_.axes),"getAxes"),S_=we((()=>x_.curves),"getCurves"),w_=we((()=>x_.options),"getOptions"),T_=we((t=>{x_.axes=t.map((t=>({name:t.name,label:t.label??t.name})))}),"setAxes"),__=we((t=>{x_.curves=t.map((t=>({name:t.name,label:t.label??t.name,entries:v_(t.entries)})))}),"setCurves"),v_=we((t=>{if(null==t[0].axis)return t.map((t=>t.value));const e=C_();if(0===e.length)throw new Error("Axes must be populated before curves for reference entries");return e.map((e=>{const i=t.find((t=>{var i;return(null==(i=t.axis)?void 0:i.$refText)===e.name}));if(void 0===i)throw new Error("Missing entry for axis "+e.label);return i.value}))}),"computeCurveEntries"),E_={getAxes:C_,getCurves:S_,getOptions:w_,setAxes:T_,setCurves:__,setOptions:we((t=>{var e,i,r,s,n;const a=t.reduce(((t,e)=>(t[e.name]=e,t)),{});x_.options={showLegend:(null==(e=a.showLegend)?void 0:e.value)??f_.showLegend,ticks:(null==(i=a.ticks)?void 0:i.value)??f_.ticks,max:(null==(r=a.max)?void 0:r.value)??f_.max,min:(null==(s=a.min)?void 0:s.value)??f_.min,graticule:(null==(n=a.graticule)?void 0:n.value)??f_.graticule}}),"setOptions"),getConfig:k_,clear:we((()=>{lr(),x_=structuredClone(m_)}),"clear"),setAccTitle:cr,getAccTitle:hr,setDiagramTitle:pr,getDiagramTitle:gr,getAccDescription:ur,setAccDescription:dr},A_=we((t=>{Wg(t,E_);const{axes:e,curves:i,options:r}=t;E_.setAxes(e),E_.setCurves(i),E_.setOptions(r)}),"populate"),L_={parse:we((async t=>{const e=await q("radar",t);ve.debug(e),A_(e)}),"parse")},B_=we(((t,e,i,r)=>{const s=r.db,n=s.getAxes(),a=s.getCurves(),o=s.getOptions(),l=s.getConfig(),c=s.getDiagramTitle(),h=$h(e),d=$_(h,l),u=o.max??Math.max(...a.map((t=>Math.max(...t.entries)))),p=o.min,g=Math.min(l.width,l.height)/2;D_(d,n,g,o.ticks,o.graticule),I_(d,n,g,l),F_(d,n,a,p,u,o.graticule,l),M_(d,a,o.showLegend,l),d.append("text").attr("class","radarTitle").text(c).attr("x",0).attr("y",-l.height/2-l.marginTop)}),"draw"),$_=we(((t,e)=>{const i=e.width+e.marginLeft+e.marginRight,r=e.height+e.marginTop+e.marginBottom,s=e.marginLeft+e.width/2,n=e.marginTop+e.height/2;return t.attr("viewbox",`0 0 ${i} ${r}`).attr("width",i).attr("height",r),t.append("g").attr("transform",`translate(${s}, ${n})`)}),"drawFrame"),D_=we(((t,e,i,r,s)=>{if("circle"===s)for(let n=0;n{const i=2*e*Math.PI/s-Math.PI/2;return`${a*Math.cos(i)},${a*Math.sin(i)}`})).join(" ");t.append("polygon").attr("points",o).attr("class","radarGraticule")}}}),"drawGraticule"),I_=we(((t,e,i,r)=>{const s=e.length;for(let n=0;n{if(e.entries.length!==o)return;const c=e.entries.map(((t,e)=>{const i=2*Math.PI*e/o-Math.PI/2,n=N_(t,r,s,l);return{x:n*Math.cos(i),y:n*Math.sin(i)}}));"circle"===n?t.append("path").attr("d",O_(c,a.curveTension)).attr("class",`radarCurve-${i}`):"polygon"===n&&t.append("polygon").attr("points",c.map((t=>`${t.x},${t.y}`)).join(" ")).attr("class",`radarCurve-${i}`)}))}function N_(t,e,i,r){return r*(Math.min(Math.max(t,e),i)-e)/(i-e)}function O_(t,e){const i=t.length;let r=`M${t[0].x},${t[0].y}`;for(let s=0;s{const r=t.append("g").attr("transform",`translate(${s}, ${n+20*i})`);r.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${i}`),r.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(e.label)}))}we(F_,"drawCurves"),we(N_,"relativeRadius"),we(O_,"closedRoundCurve"),we(M_,"drawLegend");var R_={draw:B_},P_=we(((t,e)=>{let i="";for(let r=0;r{const e=fo(Ve(),yi().themeVariables);return{themeVariables:e,radarOptions:fo(e.radar,t)}}),"buildRadarStyleOptions"),z_={parser:L_,db:E_,renderer:R_,styles:we((({radar:t}={})=>{const{themeVariables:e,radarOptions:i}=q_(t);return`\n\t.radarTitle {\n\t\tfont-size: ${e.fontSize};\n\t\tcolor: ${e.titleColor};\n\t\tdominant-baseline: hanging;\n\t\ttext-anchor: middle;\n\t}\n\t.radarAxisLine {\n\t\tstroke: ${i.axisColor};\n\t\tstroke-width: ${i.axisStrokeWidth};\n\t}\n\t.radarAxisLabel {\n\t\tdominant-baseline: middle;\n\t\ttext-anchor: middle;\n\t\tfont-size: ${i.axisLabelFontSize}px;\n\t\tcolor: ${i.axisColor};\n\t}\n\t.radarGraticule {\n\t\tfill: ${i.graticuleColor};\n\t\tfill-opacity: ${i.graticuleOpacity};\n\t\tstroke: ${i.graticuleColor};\n\t\tstroke-width: ${i.graticuleStrokeWidth};\n\t}\n\t.radarLegendText {\n\t\ttext-anchor: start;\n\t\tfont-size: ${i.legendFontSize}px;\n\t\tdominant-baseline: hanging;\n\t}\n\t${P_(e,i)}\n\t`}),"styles")};const W_=Object.defineProperty({__proto__:null,diagram:z_},Symbol.toStringTag,{value:"Module"});var j_=function(){var t=we((function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i}),"o"),e=[1,7],i=[1,13],r=[1,14],s=[1,15],n=[1,19],a=[1,16],o=[1,17],l=[1,18],c=[8,30],h=[8,21,28,29,30,31,32,40,44,47],d=[1,23],u=[1,24],p=[8,15,16,21,28,29,30,31,32,40,44,47],g=[8,15,16,21,27,28,29,30,31,32,40,44,47],y=[1,49],f={trace:we((function(){}),"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,block:31,NODE_ID:32,nodeShapeNLabel:33,dirList:34,DIR:35,NODE_DSTART:36,NODE_DEND:37,BLOCK_ARROW_START:38,BLOCK_ARROW_END:39,classDef:40,CLASSDEF_ID:41,CLASSDEF_STYLEOPTS:42,DEFAULT:43,class:44,CLASSENTITY_IDS:45,STYLECLASS:46,style:47,STYLE_ENTITY_IDS:48,STYLE_DEFINITION_DATA:49,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"block",32:"NODE_ID",35:"DIR",36:"NODE_DSTART",37:"NODE_DEND",38:"BLOCK_ARROW_START",39:"BLOCK_ARROW_END",40:"classDef",41:"CLASSDEF_ID",42:"CLASSDEF_STYLEOPTS",43:"DEFAULT",44:"class",45:"CLASSENTITY_IDS",46:"STYLECLASS",47:"style",48:"STYLE_ENTITY_IDS",49:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[34,1],[34,2],[33,3],[33,4],[23,3],[23,3],[24,3],[25,3]],performAction:we((function(t,e,i,r,s,n,a){var o=n.length-1;switch(s){case 4:r.getLogger().debug("Rule: separator (NL) ");break;case 5:r.getLogger().debug("Rule: separator (Space) ");break;case 6:r.getLogger().debug("Rule: separator (EOF) ");break;case 7:r.getLogger().debug("Rule: hierarchy: ",n[o-1]),r.setHierarchy(n[o-1]);break;case 8:r.getLogger().debug("Stop NL ");break;case 9:r.getLogger().debug("Stop EOF ");break;case 10:r.getLogger().debug("Stop NL2 ");break;case 11:r.getLogger().debug("Stop EOF2 ");break;case 12:r.getLogger().debug("Rule: statement: ",n[o]),"number"==typeof n[o].length?this.$=n[o]:this.$=[n[o]];break;case 13:r.getLogger().debug("Rule: statement #2: ",n[o-1]),this.$=[n[o-1]].concat(n[o]);break;case 14:r.getLogger().debug("Rule: link: ",n[o],t),this.$={edgeTypeStr:n[o],label:""};break;case 15:r.getLogger().debug("Rule: LABEL link: ",n[o-3],n[o-1],n[o]),this.$={edgeTypeStr:n[o],label:n[o-1]};break;case 18:const e=parseInt(n[o]),i=r.generateId();this.$={id:i,type:"space",label:"",width:e,children:[]};break;case 23:r.getLogger().debug("Rule: (nodeStatement link node) ",n[o-2],n[o-1],n[o]," typestr: ",n[o-1].edgeTypeStr);const s=r.edgeStrToEdgeData(n[o-1].edgeTypeStr);this.$=[{id:n[o-2].id,label:n[o-2].label,type:n[o-2].type,directions:n[o-2].directions},{id:n[o-2].id+"-"+n[o].id,start:n[o-2].id,end:n[o].id,label:n[o-1].label,type:"edge",directions:n[o].directions,arrowTypeEnd:s,arrowTypeStart:"arrow_open"},{id:n[o].id,label:n[o].label,type:r.typeStr2Type(n[o].typeStr),directions:n[o].directions}];break;case 24:r.getLogger().debug("Rule: nodeStatement (abc88 node size) ",n[o-1],n[o]),this.$={id:n[o-1].id,label:n[o-1].label,type:r.typeStr2Type(n[o-1].typeStr),directions:n[o-1].directions,widthInColumns:parseInt(n[o],10)};break;case 25:r.getLogger().debug("Rule: nodeStatement (node) ",n[o]),this.$={id:n[o].id,label:n[o].label,type:r.typeStr2Type(n[o].typeStr),directions:n[o].directions,widthInColumns:1};break;case 26:r.getLogger().debug("APA123",this?this:"na"),r.getLogger().debug("COLUMNS: ",n[o]),this.$={type:"column-setting",columns:"auto"===n[o]?-1:parseInt(n[o])};break;case 27:r.getLogger().debug("Rule: id-block statement : ",n[o-2],n[o-1]),r.generateId(),this.$={...n[o-2],type:"composite",children:n[o-1]};break;case 28:r.getLogger().debug("Rule: blockStatement : ",n[o-2],n[o-1],n[o]);const a=r.generateId();this.$={id:a,type:"composite",label:"",children:n[o-1]};break;case 29:r.getLogger().debug("Rule: node (NODE_ID separator): ",n[o]),this.$={id:n[o]};break;case 30:r.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",n[o-1],n[o]),this.$={id:n[o-1],label:n[o].label,typeStr:n[o].typeStr,directions:n[o].directions};break;case 31:r.getLogger().debug("Rule: dirList: ",n[o]),this.$=[n[o]];break;case 32:r.getLogger().debug("Rule: dirList: ",n[o-1],n[o]),this.$=[n[o-1]].concat(n[o]);break;case 33:r.getLogger().debug("Rule: nodeShapeNLabel: ",n[o-2],n[o-1],n[o]),this.$={typeStr:n[o-2]+n[o],label:n[o-1]};break;case 34:r.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",n[o-3],n[o-2]," #3:",n[o-1],n[o]),this.$={typeStr:n[o-3]+n[o],label:n[o-2],directions:n[o-1]};break;case 35:case 36:this.$={type:"classDef",id:n[o-1].trim(),css:n[o].trim()};break;case 37:this.$={type:"applyClass",id:n[o-1].trim(),styleClass:n[o].trim()};break;case 38:this.$={type:"applyStyles",id:n[o-1].trim(),stylesStr:n[o].trim()}}}),"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{11:3,13:4,19:5,20:6,21:e,22:8,23:9,24:10,25:11,26:12,28:i,29:r,31:s,32:n,40:a,44:o,47:l},{8:[1,20]},t(c,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,21:e,28:i,29:r,31:s,32:n,40:a,44:o,47:l}),t(h,[2,16],{14:22,15:d,16:u}),t(h,[2,17]),t(h,[2,18]),t(h,[2,19]),t(h,[2,20]),t(h,[2,21]),t(h,[2,22]),t(p,[2,25],{27:[1,25]}),t(h,[2,26]),{19:26,26:12,32:n},{11:27,13:4,19:5,20:6,21:e,22:8,23:9,24:10,25:11,26:12,28:i,29:r,31:s,32:n,40:a,44:o,47:l},{41:[1,28],43:[1,29]},{45:[1,30]},{48:[1,31]},t(g,[2,29],{33:32,36:[1,33],38:[1,34]}),{1:[2,7]},t(c,[2,13]),{26:35,32:n},{32:[2,14]},{17:[1,36]},t(p,[2,24]),{11:37,13:4,14:22,15:d,16:u,19:5,20:6,21:e,22:8,23:9,24:10,25:11,26:12,28:i,29:r,31:s,32:n,40:a,44:o,47:l},{30:[1,38]},{42:[1,39]},{42:[1,40]},{46:[1,41]},{49:[1,42]},t(g,[2,30]),{18:[1,43]},{18:[1,44]},t(p,[2,23]),{18:[1,45]},{30:[1,46]},t(h,[2,28]),t(h,[2,35]),t(h,[2,36]),t(h,[2,37]),t(h,[2,38]),{37:[1,47]},{34:48,35:y},{15:[1,50]},t(h,[2,27]),t(g,[2,33]),{39:[1,51]},{34:52,35:y,39:[2,31]},{32:[2,15]},t(g,[2,34]),{39:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:we((function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)}),"parseError"),parse:we((function(t){var e=this,i=[0],r=[],s=[null],n=[],a=this.table,o="",l=0,c=0,h=n.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;n.push(g);var y=d.options&&d.options.ranges;function f(){var t;return"number"!=typeof(t=r.pop()||d.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,we((function(t){i.length=i.length-2*t,s.length=s.length-t,n.length=n.length-t}),"popStack"),we(f,"lex");for(var m,x,b,k,C,S,w,T,_={};;){if(x=i[i.length-1],this.defaultActions[x]?b=this.defaultActions[x]:(null==m&&(m=f()),b=a[x]&&a[x][m]),void 0===b||!b.length||!b[0]){var v="";for(C in T=[],a[x])this.terminals_[C]&&C>2&&T.push("'"+this.terminals_[C]+"'");v=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(v,{text:d.match,token:this.terminals_[m]||m,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: "+x+", token: "+m);switch(b[0]){case 1:i.push(m),s.push(d.yytext),n.push(d.yylloc),i.push(b[1]),m=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(S=this.productions_[b[1]][1],_.$=s[s.length-S],_._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},y&&(_._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(k=this.performAction.apply(_,[o,c,l,u.yy,b[1],s,n].concat(h))))return k;S&&(i=i.slice(0,-1*S*2),s=s.slice(0,-1*S),n=n.slice(0,-1*S)),i.push(this.productions_[b[1]][0]),s.push(_.$),n.push(_._$),w=a[i[i.length-2]][i[i.length-1]],i.push(w);break;case 3:return!0}}return!0}),"parse")},m=function(){return{EOF:1,parseError:we((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"), +// resets the lexer, sets new input +setInput:we((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}),"setInput"), +// consumes and returns one char from the input +input:we((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}),"input"), +// unshifts one char (or a string) into the input +unput:we((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 s=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=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"), +// When called from action, caches matched text and appends it on next action +more:we((function(){return this._more=!0,this}),"more"), +// 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:we((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})}),"reject"), +// retain first n characters of the match +less:we((function(t){this.unput(this.match.slice(t))}),"less"), +// displays already matched input, i.e. for error messages +pastInput:we((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"), +// displays upcoming input, i.e. for error messages +upcomingInput:we((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,"")}),"upcomingInput"), +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:we((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"), +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:we((function(t,e){var i,r,s;if(this.options.backtrack_lexer&&(s={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&&(s.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 n in s)this[n]=s[n];return!1}return!1}),"test_match"), +// return next match in input +next:we((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 s=this._currentRules(),n=0;ne[0].length)){if(e=i,r=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[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})}),"next"), +// return next match that has a token +lex:we((function(){var t=this.next();return t||this.lex()}),"lex"), +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:we((function(t){this.conditionStack.push(t)}),"begin"), +// pop the previously active lexer condition state off the condition stack +popState:we((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"), +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:we((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"), +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:we((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"), +// alias for begin(condition) +pushState:we((function(t){this.begin(t)}),"pushState"), +// return the number of states currently on the stack +stateStackSize:we((function(){return this.conditionStack.length}),"stateStackSize"),options:{},performAction:we((function(t,e,i,r){switch(i){case 0:return 10;case 1:return t.getLogger().debug("Found space-block"),31;case 2:return t.getLogger().debug("Found nl-block"),31;case 3:return t.getLogger().debug("Found space-block"),29;case 4:t.getLogger().debug(".",e.yytext);break;case 5:t.getLogger().debug("_",e.yytext);break;case 6:return 5;case 7:return e.yytext=-1,28;case 8:return e.yytext=e.yytext.replace(/columns\s+/,""),t.getLogger().debug("COLUMNS (LEX)",e.yytext),28;case 9:case 77:case 78:case 100:this.pushState("md_string");break;case 10:return"MD_STR";case 11:case 35:case 80:this.popState();break;case 12:this.pushState("string");break;case 13:t.getLogger().debug("LEX: POPPING STR:",e.yytext),this.popState();break;case 14:return t.getLogger().debug("LEX: STR end:",e.yytext),"STR";case 15:return e.yytext=e.yytext.replace(/space\:/,""),t.getLogger().debug("SPACE NUM (LEX)",e.yytext),21;case 16:return e.yytext="1",t.getLogger().debug("COLUMNS (LEX)",e.yytext),21;case 17:return 43;case 18:return"LINKSTYLE";case 19:return"INTERPOLATE";case 20:return this.pushState("CLASSDEF"),40;case 21:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 22:return this.popState(),this.pushState("CLASSDEFID"),41;case 23:return this.popState(),42;case 24:return this.pushState("CLASS"),44;case 25:return this.popState(),this.pushState("CLASS_STYLE"),45;case 26:return this.popState(),46;case 27:return this.pushState("STYLE_STMNT"),47;case 28:return this.popState(),this.pushState("STYLE_DEFINITION"),48;case 29:return this.popState(),49;case 30:return this.pushState("acc_title"),"acc_title";case 31:return this.popState(),"acc_title_value";case 32:return this.pushState("acc_descr"),"acc_descr";case 33:return this.popState(),"acc_descr_value";case 34:this.pushState("acc_descr_multiline");break;case 36:return"acc_descr_multiline_value";case 37:return 30;case 38:case 39:case 41:case 42:case 45:return this.popState(),t.getLogger().debug("Lex: (("),"NODE_DEND";case 40:return this.popState(),t.getLogger().debug("Lex: ))"),"NODE_DEND";case 43:return this.popState(),t.getLogger().debug("Lex: (-"),"NODE_DEND";case 44:return this.popState(),t.getLogger().debug("Lex: -)"),"NODE_DEND";case 46:return this.popState(),t.getLogger().debug("Lex: ]]"),"NODE_DEND";case 47:return this.popState(),t.getLogger().debug("Lex: ("),"NODE_DEND";case 48:return this.popState(),t.getLogger().debug("Lex: ])"),"NODE_DEND";case 49:case 50:return this.popState(),t.getLogger().debug("Lex: /]"),"NODE_DEND";case 51:return this.popState(),t.getLogger().debug("Lex: )]"),"NODE_DEND";case 52:return this.popState(),t.getLogger().debug("Lex: )"),"NODE_DEND";case 53:return this.popState(),t.getLogger().debug("Lex: ]>"),"NODE_DEND";case 54:return this.popState(),t.getLogger().debug("Lex: ]"),"NODE_DEND";case 55:return t.getLogger().debug("Lexa: -)"),this.pushState("NODE"),36;case 56:return t.getLogger().debug("Lexa: (-"),this.pushState("NODE"),36;case 57:return t.getLogger().debug("Lexa: ))"),this.pushState("NODE"),36;case 58:case 60:case 61:case 62:case 65:return t.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 59:return t.getLogger().debug("Lex: ((("),this.pushState("NODE"),36;case 63:return t.getLogger().debug("Lexc: >"),this.pushState("NODE"),36;case 64:return t.getLogger().debug("Lexa: (["),this.pushState("NODE"),36;case 66:case 67:case 68:case 69:case 70:case 71:case 72:return this.pushState("NODE"),36;case 73:return t.getLogger().debug("Lexa: ["),this.pushState("NODE"),36;case 74:return this.pushState("BLOCK_ARROW"),t.getLogger().debug("LEX ARR START"),38;case 75:return t.getLogger().debug("Lex: NODE_ID",e.yytext),32;case 76:return t.getLogger().debug("Lex: EOF",e.yytext),8;case 79:return"NODE_DESCR";case 81:t.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 82:t.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 83:return t.getLogger().debug("LEX: NODE_DESCR:",e.yytext),"NODE_DESCR";case 84:t.getLogger().debug("LEX POPPING"),this.popState();break;case 85:t.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 86:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (right): dir:",e.yytext),"DIR";case 87:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (left):",e.yytext),"DIR";case 88:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (x):",e.yytext),"DIR";case 89:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (y):",e.yytext),"DIR";case 90:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (up):",e.yytext),"DIR";case 91:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (down):",e.yytext),"DIR";case 92:return e.yytext="]>",t.getLogger().debug("Lex (ARROW_DIR end):",e.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 93:return t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 94:case 95:case 96:return t.getLogger().debug("Lex: LINK",e.yytext),15;case 97:case 98:case 99:return t.getLogger().debug("Lex: START_LINK",e.yytext),this.pushState("LLABEL"),16;case 101:return t.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 102:return this.popState(),t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 103:case 104:return this.popState(),t.getLogger().debug("Lex: LINK",e.yytext),15;case 105:return t.getLogger().debug("Lex: COLON",e.yytext),e.yytext=e.yytext.slice(1),27}}),"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block\s+)/,/^(?:block\n+)/,/^(?:block:)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[29],inclusive:!1},STYLE_STMNT:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[23],inclusive:!1},CLASSDEF:{rules:[21,22],inclusive:!1},CLASS_STYLE:{rules:[26],inclusive:!1},CLASS:{rules:[25],inclusive:!1},LLABEL:{rules:[100,101,102,103,104],inclusive:!1},ARROW_DIR:{rules:[86,87,88,89,90,91,92],inclusive:!1},BLOCK_ARROW:{rules:[77,82,85],inclusive:!1},NODE:{rules:[38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,78,81],inclusive:!1},md_string:{rules:[10,11,79,80],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[13,14,83,84],inclusive:!1},acc_descr_multiline:{rules:[35,36],inclusive:!1},acc_descr:{rules:[33],inclusive:!1},acc_title:{rules:[31],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,12,15,16,17,18,19,20,24,27,30,32,34,37,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,93,94,95,96,97,98,99,105],inclusive:!0}}}}();function x(){this.yy={}}return f.lexer=m,we(x,"Parser"),x.prototype=f,f.Parser=x,new x}();j_.parser=j_;var Y_=j_,U_=new Map,H_=[],V_=new Map,X_="color",G_="fill",K_=mr(),Q_=new Map,Z_=we((t=>Xi.sanitizeText(t,K_)),"sanitizeText"),J_=we((function(t,e=""){let i=Q_.get(t);i||(i={id:t,styles:[],textStyles:[]},Q_.set(t,i)),null!=e&&e.split(",").forEach((t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(X_).exec(t)){const t=e.replace(G_,"bgFill").replace(X_,G_);i.textStyles.push(t)}i.styles.push(e)}))}),"addStyleClass"),tv=we((function(t,e=""){const i=U_.get(t);null!=e&&(i.styles=e.split(","))}),"addStyle2Node"),ev=we((function(t,e){t.split(",").forEach((function(t){let i=U_.get(t);if(void 0===i){const e=t.trim();i={id:e,type:"na",children:[]},U_.set(e,i)}i.classes||(i.classes=[]),i.classes.push(e)}))}),"setCssClass"),iv=we(((t,e)=>{const i=t.flat(),r=[];for(const s of i)if(s.label&&(s.label=Z_(s.label)),"classDef"!==s.type)if("applyClass"!==s.type)if("applyStyles"!==s.type)if("column-setting"===s.type)e.columns=s.columns??-1;else if("edge"===s.type){const t=(V_.get(s.id)??0)+1;V_.set(s.id,t),s.id=t+"-"+s.id,H_.push(s)}else{s.label||("composite"===s.type?s.label="":s.label=s.id);const t=U_.get(s.id);if(void 0===t?U_.set(s.id,s):("na"!==s.type&&(t.type=s.type),s.label!==s.id&&(t.label=s.label)),s.children&&iv(s.children,s),"space"===s.type){const t=s.width??1;for(let e=0;e{ve.debug("Clear called"),lr(),sv={id:"root",type:"composite",children:[],columns:-1},U_=new Map([["root",sv]]),rv=[],Q_=new Map,H_=[],V_=new Map}),"clear");function av(t){switch(ve.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return ve.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}function ov(t){return ve.debug("typeStr2Type",t),"=="===t?"thick":"normal"}function lv(t){switch(t.trim()){case"--x":return"arrow_cross";case"--o":return"arrow_circle";default:return"arrow_point"}}we(av,"typeStr2Type"),we(ov,"edgeTypeStr2Type"),we(lv,"edgeStrToEdgeData");var cv=0,hv=we((()=>(cv++,"id-"+Math.random().toString(36).substr(2,12)+"-"+cv)),"generateId"),dv=we((t=>{sv.children=t,iv(t,sv),rv=sv.children}),"setHierarchy"),uv=we((t=>{const e=U_.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1}),"getColumns"),pv=we((()=>[...U_.values()]),"getBlocksFlat"),gv=we((()=>rv||[]),"getBlocks"),yv=we((()=>H_),"getEdges"),fv=we((t=>U_.get(t)),"getBlock"),mv=we((t=>{U_.set(t.id,t)}),"setBlock"),xv=we((()=>console),"getLogger"),bv=we((function(){return Q_}),"getClasses"),kv={getConfig:we((()=>yi().block),"getConfig"),typeStr2Type:av,edgeTypeStr2Type:ov,edgeStrToEdgeData:lv,getLogger:xv,getBlocksFlat:pv,getBlocks:gv,getEdges:yv,setHierarchy:dv,getBlock:fv,setBlock:mv,getColumns:uv,getClasses:bv,clear:nv,generateId:hv},Cv=we(((t,e)=>{const i=ot,r=i(t,"r"),s=i(t,"g"),n=i(t,"b");return rt(r,s,n,e)}),"fade"),Sv=we((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,p {\n color: ${t.titleColor};\n }\n\n\n\n .label text,span,p {\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 .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\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 /* For html labels only */\n .labelBkg {\n background-color: ${Cv(t.edgeLabelBackground,.5)};\n // background-color:\n }\n\n .node .cluster {\n // fill: ${Cv(t.mainBkg,.5)};\n fill: ${Cv(t.clusterBkg,.5)};\n stroke: ${Cv(t.clusterBorder,.2)};\n box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n .cluster span,p {\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`),"getStyles"),wv=we(((t,e,i,r)=>{e.forEach((e=>{Tv[e](t,i,r)}))}),"insertMarkers"),Tv={extension:we(((t,e,i)=>{ve.trace("Making markers for ",i),t.append("defs").append("marker").attr("id",i+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).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",i+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")}),"extension"),composition:we(((t,e,i)=>{t.append("defs").append("marker").attr("id",i+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).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",i+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).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")}),"composition"),aggregation:we(((t,e,i)=>{t.append("defs").append("marker").attr("id",i+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).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",i+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).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"),dependency:we(((t,e,i)=>{t.append("defs").append("marker").attr("id",i+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).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",i+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).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")}),"dependency"),lollipop:we(((t,e,i)=>{t.append("defs").append("marker").attr("id",i+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",i+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)}),"lollipop"),point:we(((t,e,i)=>{t.append("marker").attr("id",i+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).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",i+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).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")}),"point"),circle:we(((t,e,i)=>{t.append("marker").attr("id",i+"_"+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",i+"_"+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")}),"circle"),cross:we(((t,e,i)=>{t.append("marker").attr("id",i+"_"+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",i+"_"+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")}),"cross"),barb:we(((t,e,i)=>{t.append("defs").append("marker").attr("id",i+"_"+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")}),"barb")},_v=wv,vv=(null==(O=null==(N=mr())?void 0:N.block)?void 0:O.padding)??8;function Ev(t,e){if(0===t||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(1===t)return{px:0,py:e};return{px:e%t,py:Math.floor(e/t)}}we(Ev,"calculateBlockPosition");var Av=we((t=>{let e=0,i=0;for(const r of t.children){const{width:s,height:n,x:a,y:o}=r.size??{width:0,height:0,x:0,y:0};ve.debug("getMaxChildSize abc95 child:",r.id,"width:",s,"height:",n,"x:",a,"y:",o,r.type),"space"!==r.type&&(s>e&&(e=s/(t.widthInColumns??1)),n>i&&(i=n))}return{width:e,height:i}}),"getMaxChildSize");function Lv(t,e,i=0,r=0){var s,n,a,o,l,c,h,d,u,p,g;ve.debug("setBlockSizes abc95 (start)",t.id,null==(s=null==t?void 0:t.size)?void 0:s.x,"block width =",null==t?void 0:t.size,"sieblingWidth",i),(null==(n=null==t?void 0:t.size)?void 0:n.width)||(t.size={width:i,height:r,x:0,y:0});let y=0,f=0;if((null==(a=t.children)?void 0:a.length)>0){for(const i of t.children)Lv(i,e);const s=Av(t);y=s.width,f=s.height,ve.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",y,f);for(const e of t.children)e.size&&(ve.debug(`abc95 Setting size of children of ${t.id} id=${e.id} ${y} ${f} ${JSON.stringify(e.size)}`),e.size.width=y*(e.widthInColumns??1)+vv*((e.widthInColumns??1)-1),e.size.height=f,e.size.x=0,e.size.y=0,ve.debug(`abc95 updating size of ${t.id} children child:${e.id} maxWidth:${y} maxHeight:${f}`));for(const i of t.children)Lv(i,e,y,f);const n=t.columns??-1;let a=0;for(const e of t.children)a+=e.widthInColumns??1;let d=t.children.length;n>0&&n0?Math.min(t.children.length,n):t.children.length;if(e>0){const i=(p-e*vv-vv)/e;ve.debug("abc95 (growing to fit) width",t.id,p,null==(h=t.size)?void 0:h.width,i);for(const e of t.children)e.size&&(e.size.width=i)}}t.size={width:p,height:g,x:0,y:0}}ve.debug("setBlockSizes abc94 (done)",t.id,null==(d=null==t?void 0:t.size)?void 0:d.x,null==(u=null==t?void 0:t.size)?void 0:u.width,null==(p=null==t?void 0:t.size)?void 0:p.y,null==(g=null==t?void 0:t.size)?void 0:g.height)}function Bv(t,e){var i,r,s,n,a,o,l,c,h,d,u,p,g,y,f,m,x;ve.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${null==(i=null==t?void 0:t.size)?void 0:i.x} y: ${null==(r=null==t?void 0:t.size)?void 0:r.y} width: ${null==(s=null==t?void 0:t.size)?void 0:s.width}`);const b=t.columns??-1;if(ve.debug("layoutBlocks columns abc95",t.id,"=>",b,t),t.children&&// find max width of children +t.children.length>0){const e=(null==(a=null==(n=null==t?void 0:t.children[0])?void 0:n.size)?void 0:a.width)??0,i=t.children.length*e+(t.children.length-1)*vv;ve.debug("widthOfChildren 88",i,"posX");let r=0;ve.debug("abc91 block?.size?.x",t.id,null==(o=null==t?void 0:t.size)?void 0:o.x);let s=(null==(l=null==t?void 0:t.size)?void 0:l.x)?(null==(c=null==t?void 0:t.size)?void 0:c.x)+(-(null==(h=null==t?void 0:t.size)?void 0:h.width)/2||0):-vv,f=0;for(const n of t.children){const e=t;if(!n.size)continue;const{width:i,height:a}=n.size,{px:o,py:l}=Ev(b,r);if(l!=f&&(f=l,s=(null==(d=null==t?void 0:t.size)?void 0:d.x)?(null==(u=null==t?void 0:t.size)?void 0:u.x)+(-(null==(p=null==t?void 0:t.size)?void 0:p.width)/2||0):-vv,ve.debug("New row in layout for block",t.id," and child ",n.id,f)),ve.debug(`abc89 layout blocks (child) id: ${n.id} Pos: ${r} (px, py) ${o},${l} (${null==(g=null==e?void 0:e.size)?void 0:g.x},${null==(y=null==e?void 0:e.size)?void 0:y.y}) parent: ${e.id} width: ${i}${vv}`),e.size){const t=i/2;n.size.x=s+vv+t,ve.debug(`abc91 layout blocks (calc) px, pyid:${n.id} startingPos=X${s} new startingPosX${n.size.x} ${t} padding=${vv} width=${i} halfWidth=${t} => x:${n.size.x} y:${n.size.y} ${n.widthInColumns} (width * (child?.w || 1)) / 2 ${i*((null==n?void 0:n.widthInColumns)??1)/2}`),s=n.size.x+t,n.size.y=e.size.y-e.size.height/2+l*(a+vv)+a/2+vv,ve.debug(`abc88 layout blocks (calc) px, pyid:${n.id}startingPosX${s}${vv}${t}=>x:${n.size.x}y:${n.size.y}${n.widthInColumns}(width * (child?.w || 1)) / 2${i*((null==n?void 0:n.widthInColumns)??1)/2}`)}n.children&&Bv(n),r+=(null==n?void 0:n.widthInColumns)??1,ve.debug("abc88 columnsPos",n,r)}}ve.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${null==(f=null==t?void 0:t.size)?void 0:f.x} y: ${null==(m=null==t?void 0:t.size)?void 0:m.y} width: ${null==(x=null==t?void 0:t.size)?void 0:x.width}`)}function $v(t,{minX:e,minY:i,maxX:r,maxY:s}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&"root"!==t.id){const{x:n,y:a,width:o,height:l}=t.size;n-o/2r&&(r=n+o/2),a+l/2>s&&(s=a+l/2)}if(t.children)for(const n of t.children)({minX:e,minY:i,maxX:r,maxY:s}=$v(n,{minX:e,minY:i,maxX:r,maxY:s}));return{minX:e,minY:i,maxX:r,maxY:s}}function Dv(t){const e=t.getBlock("root");if(!e)return;Lv(e,t,0,0),Bv(e),ve.debug("getBlocks",JSON.stringify(e,null,2));const{minX:i,minY:r,maxX:s,maxY:n}=$v(e);return{x:i,y:r,width:s-i,height:n-r}}function Iv(t,e){e&&t.attr("style",e)}function Fv(t){const e=K(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),i=e.append("xhtml:div"),r=t.label,s=t.isNode?"nodeLabel":"edgeLabel",n=i.append("span");return n.html(r),Iv(n,t.labelStyle),n.attr("class",s),Iv(i,t.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap"),i.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}we(Lv,"setBlockSizes"),we(Bv,"layoutBlocks"),we($v,"findBounds"),we(Dv,"layout"),we(Iv,"applyStyle"),we(Fv,"addHtmlLabel");var Nv=we(((t,e,i,r)=>{let s=t||"";if("object"==typeof s&&(s=s[0]),Oi(mr().flowchart.htmlLabels)){s=s.replace(/\\n|\n/g,"
"),ve.debug("vertexText"+s);return Fv({isNode:r,label:Mo(bo(s)),labelStyle:e.replace("fill:","color:")})}{const t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",e.replace("color:","fill:"));let r=[];r="string"==typeof s?s.split(/\\n|\n|/gi):Array.isArray(s)?s:[];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}}),"createLabel"),Ov=we(((t,e,i,r,s)=>{e.arrowTypeStart&&Rv(t,"start",e.arrowTypeStart,i,r,s),e.arrowTypeEnd&&Rv(t,"end",e.arrowTypeEnd,i,r,s)}),"addEdgeMarkers"),Mv={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Rv=we(((t,e,i,r,s,n)=>{const a=Mv[i];if(!a)return void ve.warn(`Unknown arrow type: ${i}`);const o="start"===e?"Start":"End";t.attr(`marker-${e}`,`url(${r}#${s}_${n}-${a}${o})`)}),"addEdgeMarker"),Pv={},qv={},zv=we(((t,e)=>{const i=mr(),r=Oi(i.flowchart.htmlLabels),s="markdown"===e.labelType?Ro(t,e.label,{style:e.labelStyle,useHtmlLabels:r,addSvgBackground:!0},i):Nv(e.label,e.labelStyle),n=t.insert("g").attr("class","edgeLabel"),a=n.insert("g").attr("class","label");a.node().appendChild(s);let o,l=s.getBBox();if(r){const t=s.children[0],e=K(s);l=t.getBoundingClientRect(),e.attr("width",l.width),e.attr("height",l.height)}if(a.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"),Pv[e.id]=n,e.width=l.width,e.height=l.height,e.startLabelLeft){const i=Nv(e.startLabelLeft,e.labelStyle),r=t.insert("g").attr("class","edgeTerminals"),s=r.insert("g").attr("class","inner");o=s.node().appendChild(i);const n=i.getBBox();s.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),qv[e.id]||(qv[e.id]={}),qv[e.id].startLeft=r,Wv(o,e.startLabelLeft)}if(e.startLabelRight){const i=Nv(e.startLabelRight,e.labelStyle),r=t.insert("g").attr("class","edgeTerminals"),s=r.insert("g").attr("class","inner");o=r.node().appendChild(i),s.node().appendChild(i);const n=i.getBBox();s.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),qv[e.id]||(qv[e.id]={}),qv[e.id].startRight=r,Wv(o,e.startLabelRight)}if(e.endLabelLeft){const i=Nv(e.endLabelLeft,e.labelStyle),r=t.insert("g").attr("class","edgeTerminals"),s=r.insert("g").attr("class","inner");o=s.node().appendChild(i);const n=i.getBBox();s.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),r.node().appendChild(i),qv[e.id]||(qv[e.id]={}),qv[e.id].endLeft=r,Wv(o,e.endLabelLeft)}if(e.endLabelRight){const i=Nv(e.endLabelRight,e.labelStyle),r=t.insert("g").attr("class","edgeTerminals"),s=r.insert("g").attr("class","inner");o=s.node().appendChild(i);const n=i.getBBox();s.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),r.node().appendChild(i),qv[e.id]||(qv[e.id]={}),qv[e.id].endRight=r,Wv(o,e.endLabelRight)}return s}),"insertEdgeLabel");function Wv(t,e){mr().flowchart.htmlLabels&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}we(Wv,"setTerminalWidth");var jv=we(((t,e)=>{ve.debug("Moving label abc88 ",t.id,t.label,Pv[t.id],e);let i=e.updatedPath?e.updatedPath:e.originalPath;const r=mr(),{subGraphTitleTotalMargin:s}=Aa(r);if(t.label){const r=Pv[t.id];let n=t.x,a=t.y;if(i){const r=mo.calcLabelPosition(i);ve.debug("Moving label "+t.label+" from (",n,",",a,") to (",r.x,",",r.y,") abc88"),e.updatedPath&&(n=r.x,a=r.y)}r.attr("transform",`translate(${n}, ${a+s/2})`)}if(t.startLabelLeft){const e=qv[t.id].startLeft;let r=t.x,s=t.y;if(i){const e=mo.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",i);r=e.x,s=e.y}e.attr("transform",`translate(${r}, ${s})`)}if(t.startLabelRight){const e=qv[t.id].startRight;let r=t.x,s=t.y;if(i){const e=mo.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",i);r=e.x,s=e.y}e.attr("transform",`translate(${r}, ${s})`)}if(t.endLabelLeft){const e=qv[t.id].endLeft;let r=t.x,s=t.y;if(i){const e=mo.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",i);r=e.x,s=e.y}e.attr("transform",`translate(${r}, ${s})`)}if(t.endLabelRight){const e=qv[t.id].endRight;let r=t.x,s=t.y;if(i){const e=mo.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",i);r=e.x,s=e.y}e.attr("transform",`translate(${r}, ${s})`)}}),"positionEdgeLabel"),Yv=we(((t,e)=>{const i=t.x,r=t.y,s=Math.abs(e.x-i),n=Math.abs(e.y-r),a=t.width/2,o=t.height/2;return s>=a||n>=o}),"outsideNode"),Uv=we(((t,e,i)=>{ve.debug(`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,s=t.y,n=Math.abs(r-i.x),a=t.width/2;let o=i.xMath.abs(r-e.x)*l){let t=i.y{ve.debug("abc88 cutPathAtIntersect",t,e);let i=[],r=t[0],s=!1;return t.forEach((t=>{if(Yv(e,t)||s)r=t,s||i.push(t);else{const n=Uv(e,r,t);let a=!1;i.forEach((t=>{a=a||t.x===n.x&&t.y===n.y})),i.some((t=>t.x===n.x&&t.y===n.y))||i.push(n),s=!0}})),i}),"cutPathAtIntersect"),Vv=we((function(t,e,i,r,s,n,a){let o=i.points;ve.debug("abc88 InsertEdge: edge=",i,"e=",e);let l=!1;const c=n.node(e.v);var h=n.node(e.w);(null==h?void 0:h.intersect)&&(null==c?void 0:c.intersect)&&(o=o.slice(1,i.points.length-1),o.unshift(c.intersect(o[0])),o.push(h.intersect(o[o.length-1]))),i.toCluster&&(ve.debug("to cluster abc88",r[i.toCluster]),o=Hv(i.points,r[i.toCluster].node),l=!0),i.fromCluster&&(ve.debug("from cluster abc88",r[i.fromCluster]),o=Hv(o.reverse(),r[i.fromCluster].node).reverse(),l=!0);const d=o.filter((t=>!Number.isNaN(t.y)));let u=te;!i.curve||"graph"!==s&&"flowchart"!==s||(u=i.curve);const{x:p,y:g}=Ea(i),y=ee().x(p).y(g).curve(u);let f;switch(i.thickness){case"normal":f="edge-thickness-normal";break;case"thick":case"invisible":f="edge-thickness-thick";break;default:f=""}switch(i.pattern){case"solid":f+=" edge-pattern-solid";break;case"dotted":f+=" edge-pattern-dotted";break;case"dashed":f+=" edge-pattern-dashed"}const m=t.append("path").attr("d",y(d)).attr("id",i.id).attr("class"," "+f+(i.classes?" "+i.classes:"")).attr("style",i.style);let x="";(mr().flowchart.arrowMarkerAbsolute||mr().state.arrowMarkerAbsolute)&&(x=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,x=x.replace(/\(/g,"\\("),x=x.replace(/\)/g,"\\)")),Ov(m,i,x,a,s);let b={};return l&&(b.updatedPath=o),b.originalPath=i.points,b}),"insertEdge"),Xv=we((t=>{const e=new Set;for(const i of t)switch(i){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(i)}return e}),"expandAndDeduplicateDirections"),Gv=we(((t,e,i)=>{const r=Xv(t),s=e.height+2*i.padding,n=s/2,a=e.width+2*n+i.padding,o=i.padding/2;return r.has("right")&&r.has("left")&&r.has("up")&&r.has("down")?[ +// Bottom +{x:0,y:0},{x:n,y:0},{x:a/2,y:2*o},{x:a-n,y:0},{x:a,y:0}, +// Right +{x:a,y:-s/3},{x:a+2*o,y:-s/2},{x:a,y:-2*s/3},{x:a,y:-s}, +// Top +{x:a-n,y:-s},{x:a/2,y:-s-2*o},{x:n,y:-s}, +// Left +{x:0,y:-s},{x:0,y:-2*s/3},{x:-2*o,y:-s/2},{x:0,y:-s/3}]:r.has("right")&&r.has("left")&&r.has("up")?[{x:n,y:0},{x:a-n,y:0},{x:a,y:-s/2},{x:a-n,y:-s},{x:n,y:-s},{x:0,y:-s/2}]:r.has("right")&&r.has("left")&&r.has("down")?[{x:0,y:0},{x:n,y:-s},{x:a-n,y:-s},{x:a,y:0}]:r.has("right")&&r.has("up")&&r.has("down")?[{x:0,y:0},{x:a,y:-n},{x:a,y:-s+n},{x:0,y:-s}]:r.has("left")&&r.has("up")&&r.has("down")?[{x:a,y:0},{x:0,y:-n},{x:0,y:-s+n},{x:a,y:-s}]:r.has("right")&&r.has("left")?[{x:n,y:0},{x:n,y:-o},{x:a-n,y:-o},{x:a-n,y:0},{x:a,y:-s/2},{x:a-n,y:-s},{x:a-n,y:-s+o},{x:n,y:-s+o},{x:n,y:-s},{x:0,y:-s/2}]:r.has("up")&&r.has("down")?[ +// Bottom center +{x:a/2,y:0}, +// Left pont of bottom arrow +{x:0,y:-o},{x:n,y:-o}, +// Left top over vertical section +{x:n,y:-s+o},{x:0,y:-s+o}, +// Top of arrow +{x:a/2,y:-s},{x:a,y:-s+o}, +// Top of right vertical bar +{x:a-n,y:-s+o},{x:a-n,y:-o},{x:a,y:-o}]:r.has("right")&&r.has("up")?[{x:0,y:0},{x:a,y:-n},{x:0,y:-s}]:r.has("right")&&r.has("down")?[{x:0,y:0},{x:a,y:0},{x:0,y:-s}]:r.has("left")&&r.has("up")?[{x:a,y:0},{x:0,y:-n},{x:a,y:-s}]:r.has("left")&&r.has("down")?[{x:a,y:0},{x:0,y:0},{x:a,y:-s}]:r.has("right")?[{x:n,y:-o},{x:n,y:-o},{x:a-n,y:-o},{x:a-n,y:0},{x:a,y:-s/2},{x:a-n,y:-s},{x:a-n,y:-s+o}, +// top left corner of arrow +{x:n,y:-s+o},{x:n,y:-s+o}]:r.has("left")?[{x:n,y:0},{x:n,y:-o}, +// Two points, the right corners +{x:a-n,y:-o},{x:a-n,y:-s+o},{x:n,y:-s+o},{x:n,y:-s},{x:0,y:-s/2}]:r.has("up")?[ +// Bottom center +{x:n,y:-o}, +// Left top over vertical section +{x:n,y:-s+o},{x:0,y:-s+o}, +// Top of arrow +{x:a/2,y:-s},{x:a,y:-s+o}, +// Top of right vertical bar +{x:a-n,y:-s+o},{x:a-n,y:-o}]:r.has("down")?[ +// Bottom center +{x:a/2,y:0}, +// Left pont of bottom arrow +{x:0,y:-o},{x:n,y:-o}, +// Left top over vertical section +{x:n,y:-s+o},{x:a-n,y:-s+o},{x:a-n,y:-o},{x:a,y:-o}]:[{x:0,y:0}]}),"getArrowPoints");function Kv(t,e){return t.intersect(e)}we(Kv,"intersectNode");var Qv=Kv;function Zv(t,e,i,r){var s=t.x,n=t.y,a=s-r.x,o=n-r.y,l=Math.sqrt(e*e*o*o+i*i*a*a),c=Math.abs(e*i*a/l);r.x0}we(iE,"intersectLine"),we(rE,"sameSign");var sE=iE,nE=aE;function aE(t,e,i){var r=t.x,s=t.y,n=[],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=s-t.height/2-o,h=0;h1&&n.sort((function(t,e){var r=t.x-i.x,s=t.y-i.y,n=Math.sqrt(r*r+s*s),a=e.x-i.x,o=e.y-i.y,l=Math.sqrt(a*a+o*o);return n{var i,r,s=t.x,n=t.y,a=e.x-s,o=e.y-n,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:s+i,y:n+r}}),"intersectRect")},lE=we((async(t,e,i,r)=>{const s=mr();let n;const a=e.useHtmlLabels||Oi(s.flowchart.htmlLabels);n=i||"node default";const o=t.insert("g").attr("class",n).attr("id",e.domId||e.id),l=o.insert("g").attr("class","label").attr("style",e.labelStyle);let c;c=void 0===e.labelText?"":"string"==typeof e.labelText?e.labelText:e.labelText[0];const h=l.node();let d;d="markdown"===e.labelType?Ro(l,Li(bo(c),s),{useHtmlLabels:a,width:e.width||s.flowchart.wrappingWidth,classes:"markdown-node-label"},s):h.appendChild(Nv(Li(bo(c),s),e.labelStyle,!1,r));let u=d.getBBox();const p=e.padding/2;if(Oi(s.flowchart.htmlLabels)){const t=d.children[0],e=K(d),i=t.getElementsByTagName("img");if(i){const t=""===c.replace(/]*>/g,"").trim();await Promise.all([...i].map((e=>new Promise((i=>{function r(){if(e.style.display="flex",e.style.flexDirection="column",t){const t=s.fontSize?s.fontSize:window.getComputedStyle(document.body).fontSize,i=5,r=parseInt(t,10)*i+"px";e.style.minWidth=r,e.style.maxWidth=r}else e.style.width="100%";i(e)}we(r,"setupImage"),setTimeout((()=>{e.complete&&r()})),e.addEventListener("error",r),e.addEventListener("load",r)})))))}u=t.getBoundingClientRect(),e.attr("width",u.width),e.attr("height",u.height)}return a?l.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"):l.attr("transform","translate(0, "+-u.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:o,bbox:u,halfPadding:p,label:l}}),"labelHelper"),cE=we(((t,e)=>{const i=e.node().getBBox();t.width=i.width,t.height=i.height}),"updateNodeBounds");function hE(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+")")}we(hE,"insertPolygonShape");var dE=we((async(t,e)=>{e.useHtmlLabels||mr().flowchart.htmlLabels||(e.centerLabel=!0);const{shapeSvg:i,bbox:r,halfPadding:s}=await lE(t,e,"node "+e.classes,!0);ve.info("Classes = ",e.classes);const n=i.insert("rect",":first-child");return n.attr("rx",e.rx).attr("ry",e.ry).attr("x",-r.width/2-s).attr("y",-r.height/2-s).attr("width",r.width+e.padding).attr("height",r.height+e.padding),cE(e,n),e.intersect=function(t){return oE.rect(e,t)},i}),"note"),uE=we((t=>t?" "+t:""),"formatClass"),pE=we(((t,e)=>`${e||"node default"}${uE(t.classes)} ${uE(t.class)}`),"getClassesFromNode"),gE=we((async(t,e)=>{const{shapeSvg:i,bbox:r}=await lE(t,e,pE(e,void 0),!0),s=r.width+e.padding+(r.height+e.padding),n=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];ve.info("Question main (Circle)");const a=hE(i,s,s,n);return a.attr("style",e.style),cE(e,a),e.intersect=function(t){return ve.warn("Intersect called"),oE.polygon(e,n,t)},i}),"question"),yE=we(((t,e)=>{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 oE.circle(e,14,t)},i}),"choice"),fE=we((async(t,e)=>{const{shapeSvg:i,bbox:r}=await lE(t,e,pE(e,void 0),!0),s=r.height+e.padding,n=s/4,a=r.width+2*n+e.padding,o=[{x:n,y:0},{x:a-n,y:0},{x:a,y:-s/2},{x:a-n,y:-s},{x:n,y:-s},{x:0,y:-s/2}],l=hE(i,a,s,o);return l.attr("style",e.style),cE(e,l),e.intersect=function(t){return oE.polygon(e,o,t)},i}),"hexagon"),mE=we((async(t,e)=>{const{shapeSvg:i,bbox:r}=await lE(t,e,void 0,!0),s=r.height+2*e.padding,n=s/2,a=r.width+2*n+e.padding,o=Gv(e.directions,r,e),l=hE(i,a,s,o);return l.attr("style",e.style),cE(e,l),e.intersect=function(t){return oE.polygon(e,o,t)},i}),"block_arrow"),xE=we((async(t,e)=>{const{shapeSvg:i,bbox:r}=await lE(t,e,pE(e,void 0),!0),s=r.width+e.padding,n=r.height+e.padding,a=[{x:-n/2,y:0},{x:s,y:0},{x:s,y:-n},{x:-n/2,y:-n},{x:0,y:-n/2}];return hE(i,s,n,a).attr("style",e.style),e.width=s+n,e.height=n,e.intersect=function(t){return oE.polygon(e,a,t)},i}),"rect_left_inv_arrow"),bE=we((async(t,e)=>{const{shapeSvg:i,bbox:r}=await lE(t,e,pE(e),!0),s=r.width+e.padding,n=r.height+e.padding,a=[{x:-2*n/6,y:0},{x:s-n/6,y:0},{x:s+2*n/6,y:-n},{x:n/6,y:-n}],o=hE(i,s,n,a);return o.attr("style",e.style),cE(e,o),e.intersect=function(t){return oE.polygon(e,a,t)},i}),"lean_right"),kE=we((async(t,e)=>{const{shapeSvg:i,bbox:r}=await lE(t,e,pE(e,void 0),!0),s=r.width+e.padding,n=r.height+e.padding,a=[{x:2*n/6,y:0},{x:s+n/6,y:0},{x:s-2*n/6,y:-n},{x:-n/6,y:-n}],o=hE(i,s,n,a);return o.attr("style",e.style),cE(e,o),e.intersect=function(t){return oE.polygon(e,a,t)},i}),"lean_left"),CE=we((async(t,e)=>{const{shapeSvg:i,bbox:r}=await lE(t,e,pE(e,void 0),!0),s=r.width+e.padding,n=r.height+e.padding,a=[{x:-2*n/6,y:0},{x:s+2*n/6,y:0},{x:s-n/6,y:-n},{x:n/6,y:-n}],o=hE(i,s,n,a);return o.attr("style",e.style),cE(e,o),e.intersect=function(t){return oE.polygon(e,a,t)},i}),"trapezoid"),SE=we((async(t,e)=>{const{shapeSvg:i,bbox:r}=await lE(t,e,pE(e,void 0),!0),s=r.width+e.padding,n=r.height+e.padding,a=[{x:n/6,y:0},{x:s-n/6,y:0},{x:s+2*n/6,y:-n},{x:-2*n/6,y:-n}],o=hE(i,s,n,a);return o.attr("style",e.style),cE(e,o),e.intersect=function(t){return oE.polygon(e,a,t)},i}),"inv_trapezoid"),wE=we((async(t,e)=>{const{shapeSvg:i,bbox:r}=await lE(t,e,pE(e,void 0),!0),s=r.width+e.padding,n=r.height+e.padding,a=[{x:0,y:0},{x:s+n/2,y:0},{x:s,y:-n/2},{x:s+n/2,y:-n},{x:0,y:-n}],o=hE(i,s,n,a);return o.attr("style",e.style),cE(e,o),e.intersect=function(t){return oE.polygon(e,a,t)},i}),"rect_right_inv_arrow"),TE=we((async(t,e)=>{const{shapeSvg:i,bbox:r}=await lE(t,e,pE(e,void 0),!0),s=r.width+e.padding,n=s/2,a=n/(2.5+s/50),o=r.height+a+e.padding,l="M 0,"+a+" a "+n+","+a+" 0,0,0 "+s+" 0 a "+n+","+a+" 0,0,0 "+-s+" 0 l 0,"+o+" a "+n+","+a+" 0,0,0 "+s+" 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("+-s/2+","+-(o/2+a)+")");return cE(e,c),e.intersect=function(t){const i=oE.rect(e,t),r=i.x-e.x;if(0!=n&&(Math.abs(r)e.height/2-a)){let s=a*a*(1-r*r/(n*n));0!=s&&(s=Math.sqrt(s)),s=a-s,t.y-e.y>0&&(s=-s),i.y+=s}return i},i}),"cylinder"),_E=we((async(t,e)=>{const{shapeSvg:i,bbox:r,halfPadding:s}=await lE(t,e,"node "+e.classes+" "+e.class,!0),n=i.insert("rect",":first-child"),a=e.positioned?e.width:r.width+e.padding,o=e.positioned?e.height:r.height+e.padding,l=e.positioned?-a/2:-r.width/2-s,c=e.positioned?-o/2:-r.height/2-s;if(n.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",c).attr("width",a).attr("height",o),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(AE(n,e.props.borders,a,o),t.delete("borders")),t.forEach((t=>{ve.warn(`Unknown node property ${t}`)}))}return cE(e,n),e.intersect=function(t){return oE.rect(e,t)},i}),"rect"),vE=we((async(t,e)=>{const{shapeSvg:i,bbox:r,halfPadding:s}=await lE(t,e,"node "+e.classes,!0),n=i.insert("rect",":first-child"),a=e.positioned?e.width:r.width+e.padding,o=e.positioned?e.height:r.height+e.padding,l=e.positioned?-a/2:-r.width/2-s,c=e.positioned?-o/2:-r.height/2-s;if(n.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",c).attr("width",a).attr("height",o),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(AE(n,e.props.borders,a,o),t.delete("borders")),t.forEach((t=>{ve.warn(`Unknown node property ${t}`)}))}return cE(e,n),e.intersect=function(t){return oE.rect(e,t)},i}),"composite"),EE=we((async(t,e)=>{const{shapeSvg:i}=await lE(t,e,"label",!0);ve.trace("Classes = ",e.class);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&&(AE(r,e.props.borders,0,0),t.delete("borders")),t.forEach((t=>{ve.warn(`Unknown node property ${t}`)}))}return cE(e,r),e.intersect=function(t){return oE.rect(e,t)},i}),"labelRect");function AE(t,e,i,r){const s=[],n=we((t=>{s.push(t,0)}),"addBorder"),a=we((t=>{s.push(0,t)}),"skipBorder");e.includes("t")?(ve.debug("add top border"),n(i)):a(i),e.includes("r")?(ve.debug("add right border"),n(r)):a(r),e.includes("b")?(ve.debug("add bottom border"),n(i)):a(i),e.includes("l")?(ve.debug("add left border"),n(r)):a(r),t.attr("stroke-dasharray",s.join(" "))}we(AE,"applyNodePropertyBorders");var LE=we(((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),s=r.insert("rect",":first-child"),n=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,ve.info("Label text abc79",l,o,"object"==typeof o);const c=a.node().appendChild(Nv(l,e.labelStyle,!0,!0));let h={width:0,height:0};if(Oi(mr().flowchart.htmlLabels)){const t=c.children[0],e=K(c);h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}ve.info("Text 2",o);const d=o.slice(1,o.length);let u=c.getBBox();const p=a.node().appendChild(Nv(d.join?d.join("
"):d,e.labelStyle,!0,!0));if(Oi(mr().flowchart.htmlLabels)){const t=p.children[0],e=K(p);h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}const g=e.padding/2;return K(p).attr("transform","translate( "+(// (titleBox.width - bbox.width) / 2 + +h.width>u.width?0:(u.width-h.width)/2)+", "+(u.height+g+5)+")"),K(c).attr("transform","translate( "+(// (titleBox.width - bbox.width) / 2 + +h.width{const{shapeSvg:i,bbox:r}=await lE(t,e,pE(e,void 0),!0),s=r.height+e.padding,n=r.width+s/4+e.padding,a=i.insert("rect",":first-child").attr("style",e.style).attr("rx",s/2).attr("ry",s/2).attr("x",-n/2).attr("y",-s/2).attr("width",n).attr("height",s);return cE(e,a),e.intersect=function(t){return oE.rect(e,t)},i}),"stadium"),$E=we((async(t,e)=>{const{shapeSvg:i,bbox:r,halfPadding:s}=await lE(t,e,pE(e,void 0),!0),n=i.insert("circle",":first-child");return n.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",r.width/2+s).attr("width",r.width+e.padding).attr("height",r.height+e.padding),ve.info("Circle main"),cE(e,n),e.intersect=function(t){return ve.info("Circle intersect",e,r.width/2+s,t),oE.circle(e,r.width/2+s,t)},i}),"circle"),DE=we((async(t,e)=>{const{shapeSvg:i,bbox:r,halfPadding:s}=await lE(t,e,pE(e,void 0),!0),n=i.insert("g",":first-child"),a=n.insert("circle"),o=n.insert("circle");return n.attr("class",e.class),a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",r.width/2+s+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+s).attr("width",r.width+e.padding).attr("height",r.height+e.padding),ve.info("DoubleCircle main"),cE(e,a),e.intersect=function(t){return ve.info("DoubleCircle intersect",e,r.width/2+s+5,t),oE.circle(e,r.width/2+s+5,t)},i}),"doublecircle"),IE=we((async(t,e)=>{const{shapeSvg:i,bbox:r}=await lE(t,e,pE(e,void 0),!0),s=r.width+e.padding,n=r.height+e.padding,a=[{x:0,y:0},{x:s,y:0},{x:s,y:-n},{x:0,y:-n},{x:0,y:0},{x:-8,y:0},{x:s+8,y:0},{x:s+8,y:-n},{x:-8,y:-n},{x:-8,y:0}],o=hE(i,s,n,a);return o.attr("style",e.style),cE(e,o),e.intersect=function(t){return oE.polygon(e,a,t)},i}),"subroutine"),FE=we(((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),cE(e,r),e.intersect=function(t){return oE.circle(e,7,t)},i}),"start"),NE=we(((t,e,i)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let s=70,n=10;"LR"===i&&(s=10,n=70);const a=r.append("rect").attr("x",-1*s/2).attr("y",-1*n/2).attr("width",s).attr("height",n).attr("class","fork-join");return cE(e,a),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(t){return oE.rect(e,t)},r}),"forkJoin"),OE={rhombus:gE,composite:vE,question:gE,rect:_E,labelRect:EE,rectWithTitle:LE,choice:yE,circle:$E,doublecircle:DE,stadium:BE,hexagon:fE,block_arrow:mE,rect_left_inv_arrow:xE,lean_right:bE,lean_left:kE,trapezoid:CE,inv_trapezoid:SE,rect_right_inv_arrow:wE,cylinder:TE,start:FE,end:we(((t,e)=>{const i=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),r=i.insert("circle",":first-child"),s=i.insert("circle",":first-child");return s.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),cE(e,s),e.intersect=function(t){return oE.circle(e,7,t)},i}),"end"),note:dE,subroutine:IE,fork:NE,join:NE,class_box:we(((t,e)=>{var i;const r=e.padding/2;let s;s=e.classes?"node "+e.classes:"node default";const n=t.insert("g").attr("class",s).attr("id",e.domId||e.id),a=n.insert("rect",":first-child"),o=n.insert("line"),l=n.insert("line");let c=0,h=4;const d=n.insert("g").attr("class","label");let u=0;const p=null==(i=e.classData.annotations)?void 0:i[0],g=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",y=d.node().appendChild(Nv(g,e.labelStyle,!0,!0));let f=y.getBBox();if(Oi(mr().flowchart.htmlLabels)){const t=y.children[0],e=K(y);f=t.getBoundingClientRect(),e.attr("width",f.width),e.attr("height",f.height)}e.classData.annotations[0]&&(h+=f.height+4,c+=f.width);let m=e.classData.label;void 0!==e.classData.type&&""!==e.classData.type&&(mr().flowchart.htmlLabels?m+="<"+e.classData.type+">":m+="<"+e.classData.type+">");const x=d.node().appendChild(Nv(m,e.labelStyle,!0,!0));K(x).attr("class","classTitle");let b=x.getBBox();if(Oi(mr().flowchart.htmlLabels)){const t=x.children[0],e=K(x);b=t.getBoundingClientRect(),e.attr("width",b.width),e.attr("height",b.height)}h+=b.height+4,b.width>c&&(c=b.width);const k=[];e.classData.members.forEach((t=>{const i=t.getDisplayDetails();let r=i.displayText;mr().flowchart.htmlLabels&&(r=r.replace(//g,">"));const s=d.node().appendChild(Nv(r,i.cssStyle?i.cssStyle:e.labelStyle,!0,!0));let n=s.getBBox();if(Oi(mr().flowchart.htmlLabels)){const t=s.children[0],e=K(s);n=t.getBoundingClientRect(),e.attr("width",n.width),e.attr("height",n.height)}n.width>c&&(c=n.width),h+=n.height+4,k.push(s)})),h+=8;const C=[];if(e.classData.methods.forEach((t=>{const i=t.getDisplayDetails();let r=i.displayText;mr().flowchart.htmlLabels&&(r=r.replace(//g,">"));const s=d.node().appendChild(Nv(r,i.cssStyle?i.cssStyle:e.labelStyle,!0,!0));let n=s.getBBox();if(Oi(mr().flowchart.htmlLabels)){const t=s.children[0],e=K(s);n=t.getBoundingClientRect(),e.attr("width",n.width),e.attr("height",n.height)}n.width>c&&(c=n.width),h+=n.height+4,C.push(s)})),h+=8,p){let t=(c-f.width)/2;K(y).attr("transform","translate( "+(-1*c/2+t)+", "+-1*h/2+")"),u=f.height+4}let S=(c-b.width)/2;return K(x).attr("transform","translate( "+(-1*c/2+S)+", "+(-1*h/2+u)+")"),u+=b.height+4,o.attr("class","divider").attr("x1",-c/2-r).attr("x2",c/2+r).attr("y1",-h/2-r+8+u).attr("y2",-h/2-r+8+u),u+=8,k.forEach((t=>{K(t).attr("transform","translate( "+-c/2+", "+(-1*h/2+u+4)+")");const e=null==t?void 0:t.getBBox();u+=((null==e?void 0:e.height)??0)+4})),u+=8,l.attr("class","divider").attr("x1",-c/2-r).attr("x2",c/2+r).attr("y1",-h/2-r+8+u).attr("y2",-h/2-r+8+u),u+=8,C.forEach((t=>{K(t).attr("transform","translate( "+-c/2+", "+(-1*h/2+u)+")");const e=null==t?void 0:t.getBBox();u+=((null==e?void 0:e.height)??0)+4})),a.attr("style",e.style).attr("class","outer title-state").attr("x",-c/2-r).attr("y",-h/2-r).attr("width",c+e.padding).attr("height",h+e.padding),cE(e,a),e.intersect=function(t){return oE.rect(e,t)},n}),"class_box")},ME={},RE=we((async(t,e,i)=>{let r,s;if(e.link){let n;"sandbox"===mr().securityLevel?n="_top":e.linkTarget&&(n=e.linkTarget||"_blank"),r=t.insert("svg:a").attr("xlink:href",e.link).attr("target",n),s=await OE[e.shape](r,e,i)}else s=await OE[e.shape](t,e,i),r=s;return e.tooltip&&s.attr("title",e.tooltip),e.class&&s.attr("class","node default "+e.class),ME[e.id]=r,e.haveCallback&&ME[e.id].attr("class",ME[e.id].attr("class")+" clickable"),r}),"insertNode"),PE=we((t=>{const e=ME[t.id];ve.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}),"positionNode");function qE(t,e,i=!1){var r,s,n;const a=t;let o="default";((null==(r=null==a?void 0:a.classes)?void 0:r.length)||0)>0&&(o=((null==a?void 0:a.classes)??[]).join(" ")),o+=" flowchart-label";let l,c=0,h="";switch(a.type){case"round":c=5,h="rect";break;case"composite":c=0,h="composite",l=0;break;case"square":case"group":default:h="rect";break;case"diamond":h="question";break;case"hexagon":h="hexagon";break;case"block_arrow":h="block_arrow";break;case"odd":case"rect_left_inv_arrow":h="rect_left_inv_arrow";break;case"lean_right":h="lean_right";break;case"lean_left":h="lean_left";break;case"trapezoid":h="trapezoid";break;case"inv_trapezoid":h="inv_trapezoid";break;case"circle":h="circle";break;case"ellipse":h="ellipse";break;case"stadium":h="stadium";break;case"subroutine":h="subroutine";break;case"cylinder":h="cylinder";break;case"doublecircle":h="doublecircle"}const d=Qa((null==a?void 0:a.styles)??[]),u=a.label,p=a.size??{width:0,height:0,x:0,y:0};return{labelStyle:d.labelStyle,shape:h,labelText:u,rx:c,ry:c,class:o,style:d.style,id:a.id,directions:a.directions,width:p.width,height:p.height,x:p.x,y:p.y,positioned:i,intersect:void 0,type:a.type,padding:l??(null==(n=null==(s=yi())?void 0:s.block)?void 0:n.padding)??0}}async function zE(t,e,i){const r=qE(e,0,!1);if("group"===r.type)return;const s=yi(),n=await RE(t,r,{config:s}),a=n.node().getBBox(),o=i.getBlock(r.id);o.size={width:a.width,height:a.height,x:0,y:0,node:n},i.setBlock(o),n.remove()}async function WE(t,e,i){const r=qE(e,0,!0);if("space"!==i.getBlock(r.id).type){const i=yi();await RE(t,r,{config:i}),e.intersect=null==r?void 0:r.intersect,PE(r)}}async function jE(t,e,i,r){for(const s of e)await r(t,s,i),s.children&&await jE(t,s.children,i,r)}async function YE(t,e,i){await jE(t,e,i,zE)}async function UE(t,e,i){await jE(t,e,i,WE)}async function HE(t,e,i,r,s){const n=new Q({multigraph:!0,compound:!0});n.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const a of i)a.size&&n.setNode(a.id,{width:a.size.width,height:a.size.height,intersect:a.intersect});for(const a of e)if(a.start&&a.end){const e=r.getBlock(a.start),i=r.getBlock(a.end);if((null==e?void 0:e.size)&&(null==i?void 0:i.size)){const r=e.size,o=i.size,l=[{x:r.x,y:r.y},{x:r.x+(o.x-r.x)/2,y:r.y+(o.y-r.y)/2},{x:o.x,y:o.y}];Vv(t,{v:a.start,w:a.end,name:a.id},{...a,arrowTypeEnd:a.arrowTypeEnd,arrowTypeStart:a.arrowTypeStart,points:l,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",n,s),a.label&&(await zv(t,{...a,label:a.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:a.arrowTypeEnd,arrowTypeStart:a.arrowTypeStart,points:l,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),jv({...a,x:l[1].x,y:l[1].y},{originalPath:l}))}}}we(qE,"getNodeFromBlock"),we(zE,"calculateBlockSize"),we(WE,"insertBlockPositioned"),we(jE,"performOperations"),we(YE,"calculateBlockSizes"),we(UE,"insertBlocks"),we(HE,"insertEdges");var VE=we((function(t,e){return e.db.getClasses()}),"getClasses"),XE={parser:Y_,db:kv,renderer:{draw:we((async function(t,e,i,r){const{securityLevel:s,block:n}=yi(),a=r.db;let o;"sandbox"===s&&(o=K("#i"+e));const l=K("sandbox"===s?o.nodes()[0].contentDocument.body:"body"),c="sandbox"===s?l.select(`[id="${e}"]`):K(`[id="${e}"]`);_v(c,["point","circle","cross"],r.type,e);const h=a.getBlocks(),d=a.getBlocksFlat(),u=a.getEdges(),p=c.insert("g").attr("class","block");await YE(p,h,a);const g=Dv(a);if(await UE(p,h,a),await HE(p,u,d,a,e),g){const t=g,e=Math.max(1,Math.round(t.width/t.height*.125)),i=t.height+e+10,r=t.width+10,{useMaxWidth:s}=n;Qi(c,i,r,!!s),ve.debug("Here Bounds",g,t),c.attr("viewBox",`${t.x-5} ${t.y-5} ${t.width+10} ${t.height+10}`)}}),"draw"),getClasses:VE},styles:Sv};const GE=Object.defineProperty({__proto__:null,diagram:XE},Symbol.toStringTag,{value:"Module"});var KE={L:"left",R:"right",T:"top",B:"bottom"},QE={L:we((t=>`${t},${t/2} 0,${t} 0,0`),"L"),R:we((t=>`0,${t/2} ${t},0 ${t},${t}`),"R"),T:we((t=>`0,0 ${t},0 ${t/2},${t}`),"T"),B:we((t=>`${t/2},0 ${t},${t} 0,${t}`),"B")},ZE={L:we(((t,e)=>t-e+2),"L"),R:we(((t,e)=>t-2),"R"),T:we(((t,e)=>t-e+2),"T"),B:we(((t,e)=>t-2),"B")},JE=we((function(t){return eA(t)?"L"===t?"R":"L":"T"===t?"B":"T"}),"getOppositeArchitectureDirection"),tA=we((function(t){return"L"===t||"R"===t||"T"===t||"B"===t}),"isArchitectureDirection"),eA=we((function(t){return"L"===t||"R"===t}),"isArchitectureDirectionX"),iA=we((function(t){return"T"===t||"B"===t}),"isArchitectureDirectionY"),rA=we((function(t,e){const i=eA(t)&&iA(e),r=iA(t)&&eA(e);return i||r}),"isArchitectureDirectionXY"),sA=we((function(t){const e=t[0],i=t[1],r=eA(e)&&iA(i),s=iA(e)&&eA(i);return r||s}),"isArchitecturePairXY"),nA=we((function(t){return"LL"!==t&&"RR"!==t&&"TT"!==t&&"BB"!==t}),"isValidArchitectureDirectionPair"),aA=we((function(t,e){const i=`${t}${e}`;return nA(i)?i:void 0}),"getArchitectureDirectionPair"),oA=we((function([t,e],i){const r=i[0],s=i[1];return eA(r)?iA(s)?[t+("L"===r?-1:1),e+("T"===s?1:-1)]:[t+("L"===r?-1:1),e]:eA(s)?[t+("L"===s?1:-1),e+("T"===r?1:-1)]:[t,e+("T"===r?1:-1)]}),"shiftPositionByArchitectureDirectionPair"),lA=we((function(t){return"LT"===t||"TL"===t?[1,1]:"BL"===t||"LB"===t?[1,-1]:"BR"===t||"RB"===t?[-1,-1]:[-1,1]}),"getArchitectureDirectionXYFactors"),cA=we((function(t,e){return rA(t,e)?"bend":eA(t)?"horizontal":"vertical"}),"getArchitectureDirectionAlignment"),hA=we((function(t){return"service"===t.type}),"isArchitectureService"),dA=we((function(t){return"junction"===t.type}),"isArchitectureJunction"),uA=we((t=>t.data()),"edgeData"),pA=we((t=>t.data()),"nodeData"),gA=ii.architecture,yA=new jg((()=>({nodes:{},groups:{},edges:[],registeredIds:{},config:gA,dataStructures:void 0,elements:{}}))),fA=we((()=>{yA.reset(),lr()}),"clear"),mA=we((function({id:t,icon:e,in:i,title:r,iconText:s}){if(void 0!==yA.records.registeredIds[t])throw new Error(`The service id [${t}] is already in use by another ${yA.records.registeredIds[t]}`);if(void 0!==i){if(t===i)throw new Error(`The service [${t}] cannot be placed within itself`);if(void 0===yA.records.registeredIds[i])throw new Error(`The service [${t}]'s parent does not exist. Please make sure the parent is created before this service`);if("node"===yA.records.registeredIds[i])throw new Error(`The service [${t}]'s parent is not a group`)}yA.records.registeredIds[t]="node",yA.records.nodes[t]={id:t,type:"service",icon:e,iconText:s,title:r,edges:[],in:i}}),"addService"),xA=we((()=>Object.values(yA.records.nodes).filter(hA)),"getServices"),bA=we((function({id:t,in:e}){yA.records.registeredIds[t]="node",yA.records.nodes[t]={id:t,type:"junction",edges:[],in:e}}),"addJunction"),kA=we((()=>Object.values(yA.records.nodes).filter(dA)),"getJunctions"),CA=we((()=>Object.values(yA.records.nodes)),"getNodes"),SA=we((t=>yA.records.nodes[t]),"getNode"),wA=we((function({id:t,icon:e,in:i,title:r}){if(void 0!==yA.records.registeredIds[t])throw new Error(`The group id [${t}] is already in use by another ${yA.records.registeredIds[t]}`);if(void 0!==i){if(t===i)throw new Error(`The group [${t}] cannot be placed within itself`);if(void 0===yA.records.registeredIds[i])throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`);if("node"===yA.records.registeredIds[i])throw new Error(`The group [${t}]'s parent is not a group`)}yA.records.registeredIds[t]="group",yA.records.groups[t]={id:t,icon:e,title:r,in:i}}),"addGroup"),TA=we((()=>Object.values(yA.records.groups)),"getGroups"),_A=we((function({lhsId:t,rhsId:e,lhsDir:i,rhsDir:r,lhsInto:s,rhsInto:n,lhsGroup:a,rhsGroup:o,title:l}){if(!tA(i))throw new Error(`Invalid direction given for left hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${i}`);if(!tA(r))throw new Error(`Invalid direction given for right hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${r}`);if(void 0===yA.records.nodes[t]&&void 0===yA.records.groups[t])throw new Error(`The left-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(void 0===yA.records.nodes[e]&&void 0===yA.records.groups[t])throw new Error(`The right-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);const c=yA.records.nodes[t].in,h=yA.records.nodes[e].in;if(a&&c&&h&&c==h)throw new Error(`The left-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(o&&c&&h&&c==h)throw new Error(`The right-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const d={lhsId:t,lhsDir:i,lhsInto:s,lhsGroup:a,rhsId:e,rhsDir:r,rhsInto:n,rhsGroup:o,title:l};yA.records.edges.push(d),yA.records.nodes[t]&&yA.records.nodes[e]&&(yA.records.nodes[t].edges.push(yA.records.edges[yA.records.edges.length-1]),yA.records.nodes[e].edges.push(yA.records.edges[yA.records.edges.length-1]))}),"addEdge"),vA=we((()=>yA.records.edges),"getEdges"),EA=we((()=>{if(void 0===yA.records.dataStructures){const t={},e=Object.entries(yA.records.nodes).reduce(((e,[i,r])=>(e[i]=r.edges.reduce(((e,r)=>{var s,n;const a=null==(s=SA(r.lhsId))?void 0:s.in,o=null==(n=SA(r.rhsId))?void 0:n.in;if(a&&o&&a!==o){const e=cA(r.lhsDir,r.rhsDir);"bend"!==e&&(t[a]??(t[a]={}),t[a][o]=e,t[o]??(t[o]={}),t[o][a]=e)}if(r.lhsId===i){const t=aA(r.lhsDir,r.rhsDir);t&&(e[t]=r.rhsId)}else{const t=aA(r.rhsDir,r.lhsDir);t&&(e[t]=r.lhsId)}return e}),{}),e)),{}),i=Object.keys(e)[0],r={[i]:1},s=Object.keys(e).reduce(((t,e)=>e===i?t:{...t,[e]:1}),{}),n=we((t=>{const i={[t]:[0,0]},n=[t];for(;n.length>0;){const t=n.shift();if(t){r[t]=1,delete s[t];const a=e[t],[o,l]=i[t];Object.entries(a).forEach((([t,e])=>{r[e]||(i[e]=oA([o,l],t),n.push(e))}))}}return i}),"BFS"),a=[n(i)];for(;Object.keys(s).length>0;)a.push(n(Object.keys(s)[0]));yA.records.dataStructures={adjList:e,spatialMaps:a,groupAlignments:t}}return yA.records.dataStructures}),"getDataStructures"),AA={clear:fA,setDiagramTitle:pr,getDiagramTitle:gr,setAccTitle:cr,getAccTitle:hr,setAccDescription:dr,getAccDescription:ur,addService:mA,getServices:xA,addJunction:bA,getJunctions:kA,getNodes:CA,getNode:SA,addGroup:wA,getGroups:TA,addEdge:_A,getEdges:vA,setElementForId:we(((t,e)=>{yA.records.elements[t]=e}),"setElementForId"),getElementById:we((t=>yA.records.elements[t]),"getElementById"),getDataStructures:EA};function LA(t){const e=mr().architecture;return(null==e?void 0:e[t])?e[t]:gA[t]}we(LA,"getConfigField");var BA=we(((t,e)=>{Wg(t,e),t.groups.map(e.addGroup),t.services.map((t=>e.addService({...t,type:"service"}))),t.junctions.map((t=>e.addJunction({...t,type:"junction"}))),t.edges.map(e.addEdge)}),"populateDb"),$A={parse:we((async t=>{const e=await q("architecture",t);ve.debug(e),BA(e,AA)}),"parse")},DA=we((t=>`\n .edge {\n stroke-width: ${t.archEdgeWidth};\n stroke: ${t.archEdgeColor};\n fill: none;\n }\n\n .arrow {\n fill: ${t.archEdgeArrowColor};\n }\n\n .node-bkg {\n fill: none;\n stroke: ${t.archGroupBorderColor};\n stroke-width: ${t.archGroupBorderWidth};\n stroke-dasharray: 8;\n }\n .node-icon-text {\n display: flex; \n align-items: center;\n }\n \n .node-icon-text > div {\n color: #fff;\n margin: 1px;\n height: fit-content;\n text-align: center;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n }\n`),"getStyles"),IA=we((t=>`${t}`),"wrapIcon"),FA={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:IA('')},server:{body:IA('')},disk:{body:IA('')},internet:{body:IA('')},cloud:{body:IA('')},unknown:La,blank:{body:IA("")}}},NA=we((async function(t,e){const i=LA("padding"),r=LA("iconSize"),s=r/2,n=r/6,a=n/2;await Promise.all(e.edges().map((async e=>{var r,o;const{source:l,sourceDir:c,sourceArrow:h,sourceGroup:d,target:u,targetDir:p,targetArrow:g,targetGroup:y,label:f}=uA(e);let{x:m,y:x}=e[0].sourceEndpoint();const{x:b,y:k}=e[0].midpoint();let{x:C,y:S}=e[0].targetEndpoint();const w=i+4;if(d&&(eA(c)?m+="L"===c?-w:w:x+="T"===c?-w:w+18),y&&(eA(p)?C+="L"===p?-w:w:S+="T"===p?-w:w+18),d||"junction"!==(null==(r=AA.getNode(l))?void 0:r.type)||(eA(c)?m+="L"===c?s:-s:x+="T"===c?s:-s),y||"junction"!==(null==(o=AA.getNode(u))?void 0:o.type)||(eA(p)?C+="L"===p?s:-s:S+="T"===p?s:-s),e[0]._private.rscratch){const e=t.insert("g");if(e.insert("path").attr("d",`M ${m},${x} L ${b},${k} L${C},${S} `).attr("class","edge"),h){const t=eA(c)?ZE[c](m,n):m-a,i=iA(c)?ZE[c](x,n):x-a;e.insert("polygon").attr("points",QE[c](n)).attr("transform",`translate(${t},${i})`).attr("class","arrow")}if(g){const t=eA(p)?ZE[p](C,n):C-a,i=iA(p)?ZE[p](S,n):S-a;e.insert("polygon").attr("points",QE[p](n)).attr("transform",`translate(${t},${i})`).attr("class","arrow")}if(f){const t=rA(c,p)?"XY":eA(c)?"X":"Y";let i=0;i="X"===t?Math.abs(m-C):"Y"===t?Math.abs(x-S)/1.5:Math.abs(m-C)/2;const r=e.append("g");if(await Ro(r,f,{useHtmlLabels:!1,width:i,classes:"architecture-service-label"},mr()),r.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),"X"===t)r.attr("transform","translate("+b+", "+k+")");else if("Y"===t)r.attr("transform","translate("+b+", "+k+") rotate(-90)");else if("XY"===t){const t=aA(c,p);if(t&&sA(t)){const e=r.node().getBoundingClientRect(),[i,s]=lA(t);r.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*i*s*45})`);const n=r.node().getBoundingClientRect();r.attr("transform",`\n translate(${b}, ${k-e.height/2})\n translate(${i*n.width/2}, ${s*n.height/2})\n rotate(${-1*i*s*45}, 0, ${e.height/2})\n `)}}}}})))}),"drawEdges"),OA=we((async function(t,e){const i=.75*LA("padding"),r=LA("fontSize"),s=LA("iconSize")/2;await Promise.all(e.nodes().map((async e=>{const n=pA(e);if("group"===n.type){const{h:a,w:o,x1:l,y1:c}=e.boundingBox();t.append("rect").attr("x",l+s).attr("y",c+s).attr("width",o).attr("height",a).attr("class","node-bkg");const h=t.append("g");let d=l,u=c;if(n.icon){const t=h.append("g");t.html(`${await Fa(n.icon,{height:i,width:i,fallbackPrefix:FA.prefix})}`),t.attr("transform","translate("+(d+s+1)+", "+(u+s+1)+")"),d+=i,u+=r/2-1-2}if(n.label){const t=h.append("g");await Ro(t,n.label,{useHtmlLabels:!1,width:o,classes:"architecture-service-label"},mr()),t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),t.attr("transform","translate("+(d+s+4)+", "+(u+s+2)+")")}}})))}),"drawGroups"),MA=we((async function(t,e,i){for(const r of i){const i=e.append("g"),s=LA("iconSize");if(r.title){const t=i.append("g");await Ro(t,r.title,{useHtmlLabels:!1,width:1.5*s,classes:"architecture-service-label"},mr()),t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),t.attr("transform","translate("+s/2+", "+s+")")}const n=i.append("g");if(r.icon)n.html(`${await Fa(r.icon,{height:s,width:s,fallbackPrefix:FA.prefix})}`);else if(r.iconText){n.html(`${await Fa("blank",{height:s,width:s,fallbackPrefix:FA.prefix})}`);const t=n.append("g").append("foreignObject").attr("width",s).attr("height",s).append("div").attr("class","node-icon-text").attr("style",`height: ${s}px;`).append("div").html(r.iconText),e=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((s-2)/e)};`)}else n.append("path").attr("class","node-bkg").attr("id","node-"+r.id).attr("d",`M0 ${s} v${-s} q0,-5 5,-5 h${s} q5,0 5,5 v${s} H0 Z`);i.attr("class","architecture-service");const{width:a,height:o}=i._groups[0][0].getBBox();r.width=a,r.height=o,t.setElementForId(r.id,i)}return 0}),"drawServices"),RA=we((function(t,e,i){i.forEach((i=>{const r=e.append("g"),s=LA("iconSize");r.append("g").append("rect").attr("id","node-"+i.id).attr("fill-opacity","0").attr("width",s).attr("height",s),r.attr("class","architecture-junction");const{width:n,height:a}=r._groups[0][0].getBBox();r.width=n,r.height=a,t.setElementForId(i.id,r)}))}),"drawJunctions");function PA(t,e){t.forEach((t=>{e.add({group:"nodes",data:{type:"service",id:t.id,icon:t.icon,label:t.title,parent:t.in,width:LA("iconSize"),height:LA("iconSize")},classes:"node-service"})}))}function qA(t,e){t.forEach((t=>{e.add({group:"nodes",data:{type:"junction",id:t.id,parent:t.in,width:LA("iconSize"),height:LA("iconSize")},classes:"node-junction"})}))}function zA(t,e){e.nodes().map((e=>{const i=pA(e);if("group"===i.type)return;i.x=e.position().x,i.y=e.position().y;t.getElementById(i.id).attr("transform","translate("+(i.x||0)+","+(i.y||0)+")")}))}function WA(t,e){t.forEach((t=>{e.add({group:"nodes",data:{type:"group",id:t.id,icon:t.icon,label:t.title,parent:t.in},classes:"node-group"})}))}function jA(t,e){t.forEach((t=>{const{lhsId:i,rhsId:r,lhsInto:s,lhsGroup:n,rhsInto:a,lhsDir:o,rhsDir:l,rhsGroup:c,title:h}=t,d=rA(t.lhsDir,t.rhsDir)?"segments":"straight",u={id:`${i}-${r}`,label:h,source:i,sourceDir:o,sourceArrow:s,sourceGroup:n,sourceEndpoint:"L"===o?"0 50%":"R"===o?"100% 50%":"T"===o?"50% 0":"50% 100%",target:r,targetDir:l,targetArrow:a,targetGroup:c,targetEndpoint:"L"===l?"0 50%":"R"===l?"100% 50%":"T"===l?"50% 0":"50% 100%"};e.add({group:"edges",data:u,classes:d})}))}function YA(t,e,i){const r=we(((t,e)=>Object.entries(t).reduce(((t,[r,s])=>{var n;let a=0;const o=Object.entries(s);if(1===o.length)return t[r]=o[0][1],t;for(let l=0;l{const i={},s={};return Object.entries(e).forEach((([e,[r,n]])=>{var a,o,l;const c=(null==(a=t.getNode(e))?void 0:a.in)??"default";i[n]??(i[n]={}),(o=i[n])[c]??(o[c]=[]),i[n][c].push(e),s[r]??(s[r]={}),(l=s[r])[c]??(l[c]=[]),s[r][c].push(e)})),{horiz:Object.values(r(i,"horizontal")).filter((t=>t.length>1)),vert:Object.values(r(s,"vertical")).filter((t=>t.length>1))}})),[n,a]=s.reduce((([t,e],{horiz:i,vert:r})=>[[...t,...i],[...e,...r]]),[[],[]]);return{horizontal:n,vertical:a}}function UA(t){const e=[],i=we((t=>`${t[0]},${t[1]}`),"posToStr"),r=we((t=>t.split(",").map((t=>parseInt(t)))),"strToPos");return t.forEach((t=>{const s=Object.fromEntries(Object.entries(t).map((([t,e])=>[i(e),t]))),n=[i([0,0])],a={},o={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;n.length>0;){const t=n.shift();if(t){a[t]=1;const l=s[t];if(l){const c=r(t);Object.entries(o).forEach((([t,r])=>{const o=i([c[0]+r[0],c[1]+r[1]]),h=s[o];h&&!a[o]&&(n.push(o),e.push({[KE[t]]:h,[KE[JE(t)]]:l,gap:1.5*LA("iconSize")}))}))}}}})),e}function HA(t,e,i,r,s,{spatialMaps:n,groupAlignments:a}){return new Promise((o=>{const l=K("body").append("div").attr("id","cy").attr("style","display:none"),c=ne({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5], +// @ts-ignore Incorrect library types +"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{ +// @ts-ignore Incorrect library types +"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${LA("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{ +// @ts-ignore Incorrect library types +padding:`${LA("padding")}px`}}]});l.remove(),WA(i,c),PA(t,c),qA(e,c),jA(r,c);const h=YA(s,n,a),d=UA(n),u=c.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1, +// Adjust the edge parameters if it passes through the border of a group +// Hacky fix for: https://github.com/iVis-at-Bilkent/cytoscape.js-fcose/issues/67 +idealEdgeLength(t){const[e,i]=t.connectedNodes(),{parent:r}=pA(e),{parent:s}=pA(i);return r===s?1.5*LA("iconSize"):.5*LA("iconSize")},edgeElasticity(t){const[e,i]=t.connectedNodes(),{parent:r}=pA(e),{parent:s}=pA(i);return r===s?.45:.001},alignmentConstraint:h,relativePlacementConstraint:d});u.one("layoutstop",(()=>{var t;function e(t,e,i,r){let s,n;const{x:a,y:o}=t,{x:l,y:c}=e;n=(r-o+(a-i)*(o-c)/(a-l))/Math.sqrt(1+Math.pow((o-c)/(a-l),2)),s=Math.sqrt(Math.pow(r-o,2)+Math.pow(i-a,2)-Math.pow(n,2));s/=Math.sqrt(Math.pow(l-a,2)+Math.pow(c-o,2));let h=(l-a)*(r-o)-(c-o)*(i-a);switch(!0){case h>=0:h=1;break;case h<0:h=-1}let d=(l-a)*(i-a)+(c-o)*(r-o);switch(!0){case d>=0:d=1;break;case d<0:d=-1}return n=Math.abs(n)*h,s*=d,{distances:n,weights:s}}we(e,"getSegmentWeights"),c.startBatch();for(const i of Object.values(c.edges()))if(null==(t=i.data)?void 0:t.call(i)){const{x:t,y:r}=i.source().position(),{x:s,y:n}=i.target().position();if(t!==s&&r!==n){const t=i.sourceEndpoint(),r=i.targetEndpoint(),{sourceDir:s}=uA(i),[n,a]=iA(s)?[t.x,r.y]:[r.x,t.y],{weights:o,distances:l}=e(t,r,n,a);i.style("segment-distances",l),i.style("segment-weights",o)}}c.endBatch(),u.run()})),u.run(),c.ready((t=>{ve.info("Ready",t),o(c)}))}))}Da([{name:FA.prefix,icons:FA}]),ne.use(ke),we(PA,"addServices"),we(qA,"addJunctions"),we(zA,"positionNodes"),we(WA,"addGroups"),we(jA,"addEdges"),we(YA,"getAlignments"),we(UA,"getRelativeConstraints"),we(HA,"layoutArchitecture");var VA={parser:$A,db:AA,renderer:{draw:we((async(t,e,i,r)=>{const s=r.db,n=s.getServices(),a=s.getJunctions(),o=s.getGroups(),l=s.getEdges(),c=s.getDataStructures(),h=$h(e),d=h.append("g");d.attr("class","architecture-edges");const u=h.append("g");u.attr("class","architecture-services");const p=h.append("g");p.attr("class","architecture-groups"),await MA(s,u,n),RA(s,u,a);const g=await HA(n,a,o,l,s,c);await NA(d,g),await OA(p,g),zA(s,g),Zi(void 0,h,LA("padding"),LA("useMaxWidth"))}),"draw")},styles:DA};const XA=Object.defineProperty({__proto__:null,diagram:VA},Symbol.toStringTag,{value:"Module"});export{Su as m};