"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3549],{3549:(t,e,r)=>{r.d(e,{diagram:()=>eb});var a=r(77808),i=r(58211),s=r(93196),n=r(56194),l=r(50001),o=r(93913),c=r(85448),d=r(63121),h=r(41614),g=r(97525),u=r(37764);function y(t,e){for(let r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}var p=r(4674),x=r(48861),b=r(51874),f=r(24039),m=function(){var t=(0,c.K2)(function(t,e,r,a){for(r=r||{},a=t.length;a--;r[t[a]]=e);return r},"o"),e=[1,15],r=[1,7],a=[1,13],i=[1,14],s=[1,19],n=[1,16],l=[1,17],o=[1,18],d=[8,30],h=[8,10,21,28,29,30,31,39,43,46],g=[1,23],u=[1,24],y=[8,10,15,16,21,28,29,30,31,39,43,46],p=[8,10,15,16,21,27,28,29,30,31,39,43,46],x=[1,49],b={trace:(0,c.K2)(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,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$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:"NODE_ID",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"},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],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:(0,c.K2)(function(t,e,r,a,i,s,n){var l=s.length-1;switch(i){case 4:a.getLogger().debug("Rule: separator (NL) ");break;case 5:a.getLogger().debug("Rule: separator (Space) ");break;case 6:a.getLogger().debug("Rule: separator (EOF) ");break;case 7:a.getLogger().debug("Rule: hierarchy: ",s[l-1]),a.setHierarchy(s[l-1]);break;case 8:a.getLogger().debug("Stop NL ");break;case 9:a.getLogger().debug("Stop EOF ");break;case 10:a.getLogger().debug("Stop NL2 ");break;case 11:a.getLogger().debug("Stop EOF2 ");break;case 12:a.getLogger().debug("Rule: statement: ",s[l]),"number"==typeof s[l].length?this.$=s[l]:this.$=[s[l]];break;case 13:a.getLogger().debug("Rule: statement #2: ",s[l-1]),this.$=[s[l-1]].concat(s[l]);break;case 14:a.getLogger().debug("Rule: link: ",s[l],t),this.$={edgeTypeStr:s[l],label:""};break;case 15:a.getLogger().debug("Rule: LABEL link: ",s[l-3],s[l-1],s[l]),this.$={edgeTypeStr:s[l],label:s[l-1]};break;case 18:let o=parseInt(s[l]),c=a.generateId();this.$={id:c,type:"space",label:"",width:o,children:[]};break;case 23:a.getLogger().debug("Rule: (nodeStatement link node) ",s[l-2],s[l-1],s[l]," typestr: ",s[l-1].edgeTypeStr);let d=a.edgeStrToEdgeData(s[l-1].edgeTypeStr),h=a.edgeStrToEdgeStartData(s[l-1].edgeTypeStr),g=a.edgeStrToThickness(s[l-1].edgeTypeStr),u=a.edgeStrToPattern(s[l-1].edgeTypeStr);this.$=[{id:s[l-2].id,label:s[l-2].label,type:s[l-2].type,directions:s[l-2].directions},{id:s[l-2].id+"-"+s[l].id,start:s[l-2].id,end:s[l].id,label:s[l-1].label,type:"edge",thickness:g,pattern:u,directions:s[l].directions,arrowTypeEnd:d,arrowTypeStart:h},{id:s[l].id,label:s[l].label,type:a.typeStr2Type(s[l].typeStr),directions:s[l].directions}];break;case 24:a.getLogger().debug("Rule: nodeStatement (abc88 node size) ",s[l-1],s[l]),this.$={id:s[l-1].id,label:s[l-1].label,type:a.typeStr2Type(s[l-1].typeStr),directions:s[l-1].directions,widthInColumns:parseInt(s[l],10)};break;case 25:a.getLogger().debug("Rule: nodeStatement (node) ",s[l]),this.$={id:s[l].id,label:s[l].label,type:a.typeStr2Type(s[l].typeStr),directions:s[l].directions,widthInColumns:1};break;case 26:a.getLogger().debug("APA123",this?this:"na"),a.getLogger().debug("COLUMNS: ",s[l]),this.$={type:"column-setting",columns:"auto"===s[l]?-1:parseInt(s[l])};break;case 27:a.getLogger().debug("Rule: id-block statement : ",s[l-2],s[l-1]),a.generateId(),this.$={...s[l-2],type:"composite",children:s[l-1]};break;case 28:a.getLogger().debug("Rule: blockStatement : ",s[l-2],s[l-1],s[l]);let y=a.generateId();this.$={id:y,type:"composite",label:"",children:s[l-1]};break;case 29:a.getLogger().debug("Rule: node (NODE_ID separator): ",s[l]),this.$={id:s[l]};break;case 30:a.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",s[l-1],s[l]),this.$={id:s[l-1],label:s[l].label,typeStr:s[l].typeStr,directions:s[l].directions};break;case 31:a.getLogger().debug("Rule: dirList: ",s[l]),this.$=[s[l]];break;case 32:a.getLogger().debug("Rule: dirList: ",s[l-1],s[l]),this.$=[s[l-1]].concat(s[l]);break;case 33:a.getLogger().debug("Rule: nodeShapeNLabel: ",s[l-2],s[l-1],s[l]),this.$={typeStr:s[l-2]+s[l],label:s[l-1]};break;case 34:a.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",s[l-3],s[l-2]," #3:",s[l-1],s[l]),this.$={typeStr:s[l-3]+s[l],label:s[l-2],directions:s[l-1]};break;case 35:case 36:this.$={type:"classDef",id:s[l-1].trim(),css:s[l].trim()};break;case 37:this.$={type:"applyClass",id:s[l-1].trim(),styleClass:s[l].trim()};break;case 38:this.$={type:"applyStyles",id:s[l-1].trim(),stylesStr:s[l].trim()}}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:a,29:i,31:s,39:n,43:l,46:o},{8:[1,20]},t(d,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:a,29:i,31:s,39:n,43:l,46:o}),t(h,[2,16],{14:22,15:g,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(y,[2,25],{27:[1,25]}),t(h,[2,26]),{19:26,26:12,31:s},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:a,29:i,31:s,39:n,43:l,46:o},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(p,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(d,[2,13]),{26:35,31:s},{31:[2,14]},{17:[1,36]},t(y,[2,24]),{10:e,11:37,13:4,14:22,15:g,16:u,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:a,29:i,31:s,39:n,43:l,46:o},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(p,[2,30]),{18:[1,43]},{18:[1,44]},t(y,[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]),{36:[1,47]},{33:48,34:x},{15:[1,50]},t(h,[2,27]),t(p,[2,33]),{38:[1,51]},{33:52,34:x,38:[2,31]},{31:[2,15]},t(p,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:(0,c.K2)(function(t,e){if(e.recoverable)this.trace(t);else{var r=Error(t);throw r.hash=e,r}},"parseError"),parse:(0,c.K2)(function(t){var e=this,r=[0],a=[],i=[null],s=[],n=this.table,l="",o=0,d=0,h=0,g=s.slice.call(arguments,1),u=Object.create(this.lexer),y={};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(y[p]=this.yy[p]);u.setInput(t,y),y.lexer=u,y.parser=this,void 0===u.yylloc&&(u.yylloc={});var x=u.yylloc;s.push(x);var b=u.options&&u.options.ranges;function f(){var t;return"number"!=typeof(t=a.pop()||u.lex()||1)&&(t instanceof Array&&(t=(a=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.parseError?this.parseError=y.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,c.K2)(function(t){r.length=r.length-2*t,i.length=i.length-t,s.length=s.length-t},"popStack"),(0,c.K2)(f,"lex");for(var m,w,k,L,S,_,E,D,R,K={};;){if(k=r[r.length-1],this.defaultActions[k]?L=this.defaultActions[k]:(null==m&&(m=f()),L=n[k]&&n[k][m]),void 0===L||!L.length||!L[0]){var $="";for(_ in R=[],n[k])this.terminals_[_]&&_>2&&R.push("'"+this.terminals_[_]+"'");$=u.showPosition?"Parse error on line "+(o+1)+":\n"+u.showPosition()+"\nExpecting "+R.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError($,{text:u.match,token:this.terminals_[m]||m,line:u.yylineno,loc:x,expected:R})}if(L[0]instanceof Array&&L.length>1)throw Error("Parse Error: multiple actions possible at state: "+k+", token: "+m);switch(L[0]){case 1:r.push(m),i.push(u.yytext),s.push(u.yylloc),r.push(L[1]),m=null,w?(m=w,w=null):(d=u.yyleng,l=u.yytext,o=u.yylineno,x=u.yylloc,h>0&&h--);break;case 2:if(E=this.productions_[L[1]][1],K.$=i[i.length-E],K._$={first_line:s[s.length-(E||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(E||1)].first_column,last_column:s[s.length-1].last_column},b&&(K._$.range=[s[s.length-(E||1)].range[0],s[s.length-1].range[1]]),void 0!==(S=this.performAction.apply(K,[l,d,o,y,L[1],i,s].concat(g))))return S;E&&(r=r.slice(0,-1*E*2),i=i.slice(0,-1*E),s=s.slice(0,-1*E)),r.push(this.productions_[L[1]][0]),i.push(K.$),s.push(K._$),D=n[r[r.length-2]][r[r.length-1]],r.push(D);break;case 3:return!0}}return!0},"parse")};function f(){this.yy={}}return b.lexer={EOF:1,parseError:(0,c.K2)(function(t,e){if(this.yy.parser)this.yy.parser.parseError(t,e);else throw Error(t)},"parseError"),setInput:(0,c.K2)(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"),input:(0,c.K2)(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"),unput:(0,c.K2)(function(t){var e=t.length,r=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 a=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),r.length-1&&(this.yylineno-=r.length-1);var i=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:r?(r.length===a.length?this.yylloc.first_column:0)+a[a.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:(0,c.K2)(function(){return this._more=!0,this},"more"),reject:(0,c.K2)(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"),less:(0,c.K2)(function(t){this.unput(this.match.slice(t))},"less"),pastInput:(0,c.K2)(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,c.K2)(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"),showPosition:(0,c.K2)(function(){var t=this.pastInput(),e=Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:(0,c.K2)(function(t,e){var r,a,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(a=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.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],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack)for(var s in i)this[s]=i[s];return!1},"test_match"),next:(0,c.K2)(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var t,e,r,a,i=this._currentRules(),s=0;se[0].length)){if(e=r,a=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[s])))return t;if(!this._backtrack)return!1;e=!1;continue}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[a]))&&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"),lex:(0,c.K2)(function(){var t=this.next();return t||this.lex()},"lex"),begin:(0,c.K2)(function(t){this.conditionStack.push(t)},"begin"),popState:(0,c.K2)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,c.K2)(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"),topState:(0,c.K2)(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:(0,c.K2)(function(t){this.begin(t)},"pushState"),stateStackSize:(0,c.K2)(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:(0,c.K2)(function(t,e,r,a){switch(r){case 0:return t.getLogger().debug("Found block-beta"),10;case 1:return t.getLogger().debug("Found id-block"),29;case 2:return t.getLogger().debug("Found block"),10;case 3:t.getLogger().debug(".",e.yytext);break;case 4:t.getLogger().debug("_",e.yytext);break;case 5:return 5;case 6:return e.yytext=-1,28;case 7:return e.yytext=e.yytext.replace(/columns\s+/,""),t.getLogger().debug("COLUMNS (LEX)",e.yytext),28;case 8:case 76:case 77:case 99:this.pushState("md_string");break;case 9:return"MD_STR";case 10:case 34:case 79:this.popState();break;case 11:this.pushState("string");break;case 12:t.getLogger().debug("LEX: POPPING STR:",e.yytext),this.popState();break;case 13:return t.getLogger().debug("LEX: STR end:",e.yytext),"STR";case 14:return e.yytext=e.yytext.replace(/space\:/,""),t.getLogger().debug("SPACE NUM (LEX)",e.yytext),21;case 15:return e.yytext="1",t.getLogger().debug("COLUMNS (LEX)",e.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:case 38:case 40:case 41:case 44:return this.popState(),t.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),t.getLogger().debug("Lex: ))"),"NODE_DEND";case 42:return this.popState(),t.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),t.getLogger().debug("Lex: -)"),"NODE_DEND";case 45: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:case 49:return this.popState(),t.getLogger().debug("Lex: /]"),"NODE_DEND";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 t.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return t.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return t.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:case 59:case 60:case 61:case 64:return t.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return t.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 62:return t.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return t.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 65:case 66:case 67:case 68:case 69:case 70:case 71:return this.pushState("NODE"),35;case 72:return t.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),t.getLogger().debug("LEX ARR START"),37;case 74:return t.getLogger().debug("Lex: NODE_ID",e.yytext),31;case 75:return t.getLogger().debug("Lex: EOF",e.yytext),8;case 78:return"NODE_DESCR";case 80:t.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:t.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return t.getLogger().debug("LEX: NODE_DESCR:",e.yytext),"NODE_DESCR";case 83:t.getLogger().debug("LEX POPPING"),this.popState();break;case 84:t.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (right): dir:",e.yytext),"DIR";case 86:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (left):",e.yytext),"DIR";case 87:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (x):",e.yytext),"DIR";case 88:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (y):",e.yytext),"DIR";case 89:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (up):",e.yytext),"DIR";case 90:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (down):",e.yytext),"DIR";case 91:return e.yytext="]>",t.getLogger().debug("Lex (ARROW_DIR end):",e.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 93:case 94:case 95:return t.getLogger().debug("Lex: LINK",e.yytext),15;case 96:case 97:case 98:return t.getLogger().debug("Lex: START_LINK",e.yytext),this.pushState("LLABEL"),16;case 100:return t.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 102:case 103:return this.popState(),t.getLogger().debug("Lex: LINK",e.yytext),15;case 104:return t.getLogger().debug("Lex: COLON",e.yytext),e.yytext=e.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\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:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}},(0,c.K2)(f,"Parser"),f.prototype=b,b.Parser=f,new f}();m.parser=m;var w=new Map,k=[],L=new Map,S="color",_="fill",E=(0,o.D7)(),D=new Map,R="",K=(0,c.K2)(t=>o.Y2.sanitizeText(t,E),"sanitizeText"),$=(0,c.K2)(function(t,e=""){let r=D.get(t);r||(r={id:t,styles:[],textStyles:[]},D.set(t,r)),null!=e&&e.split(",").forEach(t=>{let e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(S).exec(t)){let t=e.replace(_,"bgFill").replace(S,_);r.textStyles.push(t)}r.styles.push(e)})},"addStyleClass"),v=(0,c.K2)(function(t,e=""){let r=w.get(t);null!=e&&(r.styles=e.split(","))},"addStyle2Node"),T=(0,c.K2)(function(t,e){t.split(",").forEach(function(t){let r=w.get(t);if(void 0===r){let e=t.trim();r={id:e,type:"na",children:[]},w.set(e,r)}r.classes||(r.classes=[]),r.classes.push(e)})},"setCssClass"),I=(0,c.K2)((t,e)=>{let r=t.flat(),a=[],i=r.find(t=>t?.type==="column-setting"),s=i?.columns??-1;for(let t of r){if("number"==typeof s&&s>0&&"column-setting"!==t.type&&"number"==typeof t.widthInColumns&&t.widthInColumns>s&&c.Rm.warn(`Block ${t.id} width ${t.widthInColumns} exceeds configured column width ${s}`),t.label&&(t.label=K(t.label)),"classDef"===t.type){$(t.id,t.css);continue}if("applyClass"===t.type){T(t.id,t?.styleClass??"");continue}if("applyStyles"===t.type){t?.stylesStr&&v(t.id,t?.stylesStr);continue}if("column-setting"===t.type)e.columns=t.columns??-1;else if("edge"===t.type){let e=(L.get(t.id)??0)+1;L.set(t.id,e),t.id=e+"-"+t.id,k.push(t)}else{t.label||("composite"===t.type?t.label="":t.label=t.id);let e=w.get(t.id);if(void 0===e?w.set(t.id,t):("na"!==t.type&&(e.type=t.type),t.label!==t.id&&(e.label=t.label)),t.children&&I(t.children,t),"space"===t.type){let e=t.width??1;for(let r=0;r0&&"string"==typeof t[0]&&Object.hasOwn(t,"index")&&(e.index=t.index,e.input=t.input),e}if((0,u.i)(t))return new t.constructor(t.buffer,t.byteOffset,t.length);if("[object ArrayBuffer]"===e)return new ArrayBuffer(t.byteLength);if("[object DataView]"===e){let e=t.buffer,r=t.byteOffset,a=t.byteLength,i=new ArrayBuffer(a),s=new Uint8Array(e,r,a);return new Uint8Array(i).set(s),new DataView(i)}if("[object Boolean]"===e||"[object Number]"===e||"[object String]"===e){let r=new t.constructor(t.valueOf());return"[object String]"===e?function(t,e){let r=e.valueOf().length;for(let a in e)Object.hasOwn(e,a)&&(Number.isNaN(Number(a))||Number(a)>=r)&&(t[a]=e[a])}(r,t):y(r,t),r}if("[object Date]"===e)return new Date(Number(t));if("[object RegExp]"===e){let e=new RegExp(t.source,t.flags);return e.lastIndex=t.lastIndex,e}if("[object Symbol]"===e)return Object(Symbol.prototype.valueOf.call(t));if("[object Map]"===e){let e=new Map;return t.forEach((t,r)=>{e.set(r,t)}),e}if("[object Set]"===e){let e=new Set;return t.forEach(t=>{e.add(t)}),e}if("[object Arguments]"===e){let e={};return y(e,t),e.length=t.length,e[Symbol.iterator]=t[Symbol.iterator],e}let r={};return function(t,e){let r=Object.getPrototypeOf(e);null!==r&&"function"==typeof e.constructor&&Object.setPrototypeOf(t,r)}(r,t),y(r,t),function(t,e){let r=Object.getOwnPropertySymbols(e);for(let a=0;a{c.Rm.debug("Clear called"),(0,o.IU)(),w=new Map([["root",C={id:"root",type:"composite",children:[],columns:-1}]]),N=[],D=new Map,k=[],L=new Map,R=""},"clear");function O(t){switch(c.Rm.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return c.Rm.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 z(t){return(c.Rm.debug("typeStr2Type",t),"=="===t)?"thick":"normal"}function A(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}function M(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}function P(t){return t.includes("==")?"thick":"normal"}function j(t){return t.includes(".-")?"dotted":"solid"}(0,c.K2)(O,"typeStr2Type"),(0,c.K2)(z,"edgeTypeStr2Type"),(0,c.K2)(A,"edgeStrToEdgeData"),(0,c.K2)(M,"edgeStrToEdgeStartData"),(0,c.K2)(P,"edgeStrToThickness"),(0,c.K2)(j,"edgeStrToPattern");var W=0,Y=(0,c.K2)(()=>(W++,"id-"+Math.random().toString(36).substr(2,12)+"-"+W),"generateId"),F=(0,c.K2)(t=>{C.children=t,I(t,C),N=C.children},"setHierarchy"),X=(0,c.K2)(t=>{let e=w.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),U=(0,c.K2)(()=>[...w.values()],"getBlocksFlat"),H=(0,c.K2)(()=>N||[],"getBlocks"),Z=(0,c.K2)(()=>k,"getEdges"),q=(0,c.K2)(t=>w.get(t),"getBlock"),G=(0,c.K2)(t=>{w.set(t.id,t)},"setBlock"),V=(0,c.K2)(t=>{R=t},"setDiagramId"),J=(0,c.K2)(()=>R,"getDiagramId"),Q=(0,c.K2)(()=>c.Rm,"getLogger"),tt=(0,c.K2)(function(){return D},"getClasses"),te={getConfig:(0,c.K2)(()=>(0,o.zj)().block,"getConfig"),typeStr2Type:O,edgeTypeStr2Type:z,edgeStrToEdgeData:A,edgeStrToEdgeStartData:M,edgeStrToThickness:P,edgeStrToPattern:j,getLogger:Q,getBlocksFlat:U,getBlocks:H,getEdges:Z,setHierarchy:F,getBlock:q,setBlock:G,getColumns:X,getClasses:tt,clear:B,generateId:Y,setDiagramId:V,getDiagramId:J},tr=(0,c.K2)((t,e)=>{let r=p.A,a=r(t,"r"),i=r(t,"g"),s=r(t,"b");return x.A(a,i,s,e)},"fade"),ta=(0,c.K2)(t=>`.label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } .cluster-label text { fill: ${t.titleColor}; } .cluster-label span,p { color: ${t.titleColor}; } .label text,span,p { fill: ${t.nodeTextColor||t.textColor}; color: ${t.nodeTextColor||t.textColor}; } .node rect, .node circle, .node ellipse, .node polygon, .node path { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: 1px; } .flowchart-label text { text-anchor: middle; } // .flowchart-label .text-outer-tspan { // text-anchor: middle; // } // .flowchart-label .text-inner-tspan { // text-anchor: start; // } .node .label { text-align: center; } .node.clickable { cursor: pointer; } .arrowheadPath { fill: ${t.arrowheadColor}; } .edgePath .path { stroke: ${t.lineColor}; stroke-width: 2.0px; } .flowchart-link { stroke: ${t.lineColor}; fill: none; } .edgeLabel { background-color: ${t.edgeLabelBackground}; /* * This is for backward compatibility with existing code that didn't * add a \`

\` around edge labels. * * TODO: We should probably remove this in a future release. */ p { margin: 0; padding: 0; display: inline; } rect { opacity: 0.5; background-color: ${t.edgeLabelBackground}; fill: ${t.edgeLabelBackground}; } text-align: center; } /* For html labels only */ .labelBkg { background-color: ${t.edgeLabelBackground}; } .node .cluster { // fill: ${tr(t.mainBkg,.5)}; fill: ${tr(t.clusterBkg,.5)}; stroke: ${tr(t.clusterBorder,.2)}; box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; stroke-width: 1px; } .cluster text { fill: ${t.titleColor}; } .cluster span,p { color: ${t.titleColor}; } /* .cluster div { color: ${t.titleColor}; } */ div.mermaidTooltip { position: absolute; text-align: center; max-width: 200px; padding: 2px; font-family: ${t.fontFamily}; font-size: 12px; background: ${t.tertiaryColor}; border: 1px solid ${t.border2}; border-radius: 2px; pointer-events: none; z-index: 100; } .flowchartTitleText { text-anchor: middle; font-size: 18px; fill: ${t.textColor}; } ${(0,a.o)()} `,"getStyles"),ti=(0,c.K2)((t,e,r,a)=>{e.forEach(e=>{tg[e](t,r,a)})},"insertMarkers"),ts=(0,c.K2)((t,e,r)=>{c.Rm.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+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",r+"_"+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"),tn=(0,c.K2)((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+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",r+"_"+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"),tl=(0,c.K2)((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+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",r+"_"+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"),to=(0,c.K2)((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+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",r+"_"+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"),tc=(0,c.K2)((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+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",r+"_"+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"),td=(0,c.K2)((t,e,r)=>{t.append("marker").attr("id",r+"_"+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",r+"_"+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"),th=(0,c.K2)((t,e,r)=>{t.append("marker").attr("id",r+"_"+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",r+"_"+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"),tg={extension:ts,composition:tn,aggregation:tl,dependency:to,lollipop:tc,point:td,circle:th,cross:(0,c.K2)((t,e,r)=>{t.append("marker").attr("id",r+"_"+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",r+"_"+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:(0,c.K2)((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+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")},tu=(0,o.D7)()?.block?.padding??8;function ty(t,e){if(0===t||!Number.isInteger(t))throw Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw Error("Position must be a non-negative integer."+e);return t<0?{px:e,py:0}:1===t?{px:0,py:e}:{px:e%t,py:Math.floor(e/t)}}(0,c.K2)(ty,"calculateBlockPosition");var tp=(0,c.K2)(t=>{let e=0,r=0;for(let a of t.children){let{width:t,height:i,x:s,y:n}=a.size??{width:0,height:0,x:0,y:0};if(c.Rm.debug("getMaxChildSize abc95 child:",a.id,"width:",t,"height:",i,"x:",s,"y:",n,a.type),"space"===a.type)continue;let l=t/(a.widthInColumns??1);l>e&&(e=l),i>r&&(r=i)}return{width:e,height:r}},"getMaxChildSize");function tx(t,e,r=0,a=0){c.Rm.debug("setBlockSizes abc95 (start)",t.id,t?.size?.x,"block width =",t?.size,"siblingWidth",r),t?.size?.width||(t.size={width:r,height:a,x:0,y:0});let i=0,s=0;if(t.children?.length>0){for(let r of t.children)tx(r,e);let n=tp(t);for(let e of(i=n.width,s=n.height,c.Rm.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",i,s),t.children))e.size&&(c.Rm.debug(`abc95 Setting size of children of ${t.id} id=${e.id} ${i} ${s} ${JSON.stringify(e.size)}`),e.size.width=i*(e.widthInColumns??1)+tu*((e.widthInColumns??1)-1),e.size.height=s,e.size.x=0,e.size.y=0,c.Rm.debug(`abc95 updating size of ${t.id} children child:${e.id} maxWidth:${i} maxHeight:${s}`));for(let r of t.children)tx(r,e,i,s);let l=t.columns??-1,o=0;for(let e of t.children)o+=e.widthInColumns??1;let d=t.children.length;l>0&&l0?Math.min(t.children.length,l):t.children.length;if(e>0){let r=(g-e*tu-tu)/e;for(let e of(c.Rm.debug("abc95 (growing to fit) width",t.id,g,t.size?.width,r),t.children))e.size&&(e.size.width=r)}}t.size={width:g,height:u,x:0,y:0}}c.Rm.debug("setBlockSizes abc94 (done)",t.id,t?.size?.x,t?.size?.width,t?.size?.y,t?.size?.height)}function tb(t,e){c.Rm.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`);let r=t.columns??-1;if(c.Rm.debug("layoutBlocks columns abc95",t.id,"=>",r,t),t.children&&t.children.length>0){let a=t?.children[0]?.size?.width??0,i=t.children.length*a+(t.children.length-1)*tu;c.Rm.debug("widthOfChildren 88",i,"posX");let s=new Map;{let e=0;for(let a of t.children){if(!a.size)continue;let{py:t}=ty(r,e),i=s.get(t)??0;a.size.height>i&&s.set(t,a.size.height);let n=a?.widthInColumns??1;r>0&&(n=Math.min(n,r-e%r)),e+=n}}let n=new Map;{let t=0;for(let e of[...s.keys()].sort((t,e)=>t-e))n.set(e,t),t+=(s.get(e)??0)+tu}let l=0;c.Rm.debug("abc91 block?.size?.x",t.id,t?.size?.x);let o=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-tu,d=0;for(let a of t.children){if(!a.size)continue;let{width:i,height:h}=a.size,{px:g,py:u}=ty(r,l);if(u!=d&&(d=u,o=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-tu,c.Rm.debug("New row in layout for block",t.id," and child ",a.id,d)),c.Rm.debug(`abc89 layout blocks (child) id: ${a.id} Pos: ${l} (px, py) ${g},${u} (${t?.size?.x},${t?.size?.y}) parent: ${t.id} width: ${i}${tu}`),t.size){let e=i/2;a.size.x=o+tu+e,c.Rm.debug(`abc91 layout blocks (calc) px, pyid:${a.id} startingPos=X${o} new startingPosX${a.size.x} ${e} padding=${tu} width=${i} halfWidth=${e} => x:${a.size.x} y:${a.size.y} ${a.widthInColumns} (width * (child?.w || 1)) / 2 ${i*(a?.widthInColumns??1)/2}`),o=a.size.x+e;let r=n.get(u)??0,l=s.get(u)??h;a.size.y=t.size.y-t.size.height/2+r+l/2+tu,c.Rm.debug(`abc88 layout blocks (calc) px, pyid:${a.id}startingPosX${o}${tu}${e}=>x:${a.size.x}y:${a.size.y}${a.widthInColumns}(width * (child?.w || 1)) / 2${i*(a?.widthInColumns??1)/2}`)}a.children&&tb(a,e);let y=a?.widthInColumns??1;r>0&&(y=Math.min(y,r-l%r)),l+=y,c.Rm.debug("abc88 columnsPos",a,l)}}c.Rm.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`)}function tf(t,{minX:e,minY:r,maxX:a,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&"root"!==t.id){let{x:s,y:n,width:l,height:o}=t.size;s-l/2a&&(a=s+l/2),n+o/2>i&&(i=n+o/2)}if(t.children)for(let s of t.children)({minX:e,minY:r,maxX:a,maxY:i}=tf(s,{minX:e,minY:r,maxX:a,maxY:i}));return{minX:e,minY:r,maxX:a,maxY:i}}function tm(t){let e=t.getBlock("root");if(!e)return;tx(e,t,0,0),tb(e,t),c.Rm.debug("getBlocks",JSON.stringify(e,null,2));let{minX:r,minY:a,maxX:i,maxY:s}=tf(e);return{x:r,y:a,width:i-r,height:s-a}}(0,c.K2)(tx,"setBlockSizes"),(0,c.K2)(tb,"layoutBlocks"),(0,c.K2)(tf,"findBounds"),(0,c.K2)(tm,"layout");var tw=(0,c.K2)(async(t,e,r,a=!1,i=!1)=>{let s=e||"";"object"==typeof s&&(s=s[0]);let l=(0,o.D7)(),c=(0,o.E)(l);return await (0,n.GZ)(t,s,{style:r,isTitle:a,useHtmlLabels:c,markdown:!1,isNode:i,width:1/0},l)},"createLabel"),tk=(0,c.K2)((t,e,r,a,i)=>{e.arrowTypeStart&&tS(t,"start",e.arrowTypeStart,r,a,i),e.arrowTypeEnd&&tS(t,"end",e.arrowTypeEnd,r,a,i)},"addEdgeMarkers"),tL={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},tS=(0,c.K2)((t,e,r,a,i,s)=>{let n=tL[r];n?t.attr(`marker-${e}`,`url(${a}#${i}_${s}-${n}${"start"===e?"Start":"End"})`):c.Rm.warn(`Unknown arrow type: ${r}`)},"addEdgeMarker"),t_={},tE={},tD=(0,c.K2)(async(t,e)=>{let r,a=(0,o.D7)(),s=(0,o.E)(a),l=t.insert("g").attr("class","edgeLabel"),c=l.insert("g").attr("class","label"),d="markdown"===e.labelType,h=await (0,n.GZ)(t,e.label,{style:e.labelStyle,useHtmlLabels:s,addSvgBackground:d,isNode:!1,markdown:d,width:d?void 0:1/0},a);c.node().appendChild(h);let g=h.getBBox(),u=g;if(s){let t=h.children[0],e=(0,b.Ltv)(h);u=g=t.getBoundingClientRect(),e.attr("width",g.width),e.attr("height",g.height)}else{let t=(0,b.Ltv)(h).select("text").node();t&&"function"==typeof t.getBBox&&(u=t.getBBox())}if(c.attr("transform",(0,i.Wg)(u,s)),t_[e.id]=l,e.width=g.width,e.height=g.height,e.startLabelLeft){let a=t.insert("g").attr("class","edgeTerminals"),n=a.insert("g").attr("class","inner"),l=await tw(n,e.startLabelLeft,e.labelStyle);r=l;let o=l.getBBox();if(s){let t=l.children[0],e=(0,b.Ltv)(l);o=t.getBoundingClientRect(),e.attr("width",o.width),e.attr("height",o.height)}n.attr("transform",(0,i.Wg)(o,s)),tE[e.id]||(tE[e.id]={}),tE[e.id].startLeft=a,tR(r,e.startLabelLeft)}if(e.startLabelRight){let a=t.insert("g").attr("class","edgeTerminals"),n=a.insert("g").attr("class","inner"),l=await tw(n,e.startLabelRight,e.labelStyle);r=l;let o=l.getBBox();if(s){let t=l.children[0],e=(0,b.Ltv)(l);o=t.getBoundingClientRect(),e.attr("width",o.width),e.attr("height",o.height)}n.attr("transform",(0,i.Wg)(o,s)),tE[e.id]||(tE[e.id]={}),tE[e.id].startRight=a,tR(r,e.startLabelRight)}if(e.endLabelLeft){let a=t.insert("g").attr("class","edgeTerminals"),n=a.insert("g").attr("class","inner"),l=await tw(a,e.endLabelLeft,e.labelStyle);r=l;let o=l.getBBox();if(s){let t=l.children[0],e=(0,b.Ltv)(l);o=t.getBoundingClientRect(),e.attr("width",o.width),e.attr("height",o.height)}n.attr("transform",(0,i.Wg)(o,s)),tE[e.id]||(tE[e.id]={}),tE[e.id].endLeft=a,tR(r,e.endLabelLeft)}if(e.endLabelRight){let a=t.insert("g").attr("class","edgeTerminals"),n=a.insert("g").attr("class","inner"),l=await tw(a,e.endLabelRight,e.labelStyle);r=l;let o=l.getBBox();if(s){let t=l.children[0],e=(0,b.Ltv)(l);o=t.getBoundingClientRect(),e.attr("width",o.width),e.attr("height",o.height)}n.attr("transform",(0,i.Wg)(o,s)),tE[e.id]||(tE[e.id]={}),tE[e.id].endRight=a,tR(r,e.endLabelRight)}return h},"insertEdgeLabel");function tR(t,e){(0,o.E)((0,o.D7)())&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}(0,c.K2)(tR,"setTerminalWidth");var tK=(0,c.K2)((t,e)=>{c.Rm.debug("Moving label abc88 ",t.id,t.label,t_[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath,a=(0,o.D7)(),{subGraphTitleTotalMargin:i}=(0,s.O)(a);if(t.label){let a=t_[t.id],s=t.x,n=t.y;if(r){let a=l._K.calcLabelPosition(r);c.Rm.debug("Moving label "+t.label+" from (",s,",",n,") to (",a.x,",",a.y,") abc88"),e.updatedPath&&(s=a.x,n=a.y)}a.attr("transform",`translate(${s}, ${n+i/2})`)}if(t.startLabelLeft){let e=tE[t.id].startLeft,a=t.x,i=t.y;if(r){let e=l._K.calcTerminalLabelPosition(10*!!t.arrowTypeStart,"start_left",r);a=e.x,i=e.y}e.attr("transform",`translate(${a}, ${i})`)}if(t.startLabelRight){let e=tE[t.id].startRight,a=t.x,i=t.y;if(r){let e=l._K.calcTerminalLabelPosition(10*!!t.arrowTypeStart,"start_right",r);a=e.x,i=e.y}e.attr("transform",`translate(${a}, ${i})`)}if(t.endLabelLeft){let e=tE[t.id].endLeft,a=t.x,i=t.y;if(r){let e=l._K.calcTerminalLabelPosition(10*!!t.arrowTypeEnd,"end_left",r);a=e.x,i=e.y}e.attr("transform",`translate(${a}, ${i})`)}if(t.endLabelRight){let e=tE[t.id].endRight,a=t.x,i=t.y;if(r){let e=l._K.calcTerminalLabelPosition(10*!!t.arrowTypeEnd,"end_right",r);a=e.x,i=e.y}e.attr("transform",`translate(${a}, ${i})`)}},"positionEdgeLabel"),t$=(0,c.K2)((t,e)=>{let r=t.x,a=t.y,i=Math.abs(e.x-r),s=Math.abs(e.y-a),n=t.width/2,l=t.height/2;return!!(i>=n)||!!(s>=l)},"outsideNode"),tv=(0,c.K2)((t,e,r)=>{c.Rm.debug(`intersection calc abc89: outsidePoint: ${JSON.stringify(e)} insidePoint : ${JSON.stringify(r)} node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);let a=t.x,i=t.y,s=Math.abs(a-r.x),n=t.width/2,l=r.xMath.abs(a-e.x)*o){let t=r.y{c.Rm.debug("abc88 cutPathAtIntersect",t,e);let r=[],a=t[0],i=!1;return t.forEach(t=>{if(t$(e,t)||i)a=t,i||r.push(t);else{let s=tv(e,a,t),n=!1;r.forEach(t=>{n=n||t.x===s.x&&t.y===s.y}),r.some(t=>t.x===s.x&&t.y===s.y)||r.push(s),i=!0}}),r},"cutPathAtIntersect"),tI=(0,c.K2)(function(t,e,r,a,s,n,l){let d,h=r.points;c.Rm.debug("abc88 InsertEdge: edge=",r,"e=",e);let g=!1,u=n.node(e.v);var y=n.node(e.w);y?.intersect&&u?.intersect&&((h=h.slice(1,r.points.length-1)).unshift(u.intersect(h[0])),h.push(y.intersect(h[h.length-1]))),r.toCluster&&(c.Rm.debug("to cluster abc88",a[r.toCluster]),h=tT(r.points,a[r.toCluster].node),g=!0),r.fromCluster&&(c.Rm.debug("from cluster abc88",a[r.fromCluster]),h=tT(h.reverse(),a[r.fromCluster].node).reverse(),g=!0);let p=h.filter(t=>!Number.isNaN(t.y)),x=b.qrM;r.curve&&("graph"===s||"flowchart"===s)&&(x=r.curve);let{x:f,y:m}=(0,i.RI)(r),w=(0,b.n8j)().x(f).y(m).curve(x);switch(r.thickness){case"normal":d="edge-thickness-normal";break;case"thick":case"invisible":d="edge-thickness-thick";break;default:d=""}switch(r.pattern){case"solid":d+=" edge-pattern-solid";break;case"dotted":d+=" edge-pattern-dotted";break;case"dashed":d+=" edge-pattern-dashed"}let k=t.append("path").attr("d",w(p)).attr("id",r.id).attr("class"," "+d+(r.classes?" "+r.classes:"")).attr("style",r.style),L="";((0,o.D7)().flowchart.arrowMarkerAbsolute||(0,o.D7)().state.arrowMarkerAbsolute)&&(L=(0,o.ID)(!0)),tk(k,r,L,l,s);let S={};return g&&(S.updatedPath=h),S.originalPath=r.points,S},"insertEdge"),tN=(0,c.K2)(t=>{let e=new Set;for(let r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r)}return e},"expandAndDeduplicateDirections"),tC=(0,c.K2)((t,e,r,a)=>{let i=tN(t),s=e.height+2*r.padding,n=s/2,l=a??e.width+2*n+r.padding,o=r.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:n,y:0},{x:l/2,y:2*o},{x:l-n,y:0},{x:l,y:0},{x:l,y:-s/3},{x:l+2*o,y:-s/2},{x:l,y:-2*s/3},{x:l,y:-s},{x:l-n,y:-s},{x:l/2,y:-s-2*o},{x:n,y:-s},{x:0,y:-s},{x:0,y:-2*s/3},{x:-2*o,y:-s/2},{x:0,y:-s/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:n,y:0},{x:l-n,y:0},{x:l,y:-s/2},{x:l-n,y:-s},{x:n,y:-s},{x:0,y:-s/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:n,y:-s},{x:l-n,y:-s},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-n},{x:l,y:-s+n},{x:0,y:-s}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-n},{x:0,y:-s+n},{x:l,y:-s}]:i.has("right")&&i.has("left")?[{x:n,y:0},{x:n,y:-o},{x:l-n,y:-o},{x:l-n,y:0},{x:l,y:-s/2},{x:l-n,y:-s},{x:l-n,y:-s+o},{x:n,y:-s+o},{x:n,y:-s},{x:0,y:-s/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-o},{x:n,y:-o},{x:n,y:-s+o},{x:0,y:-s+o},{x:l/2,y:-s},{x:l,y:-s+o},{x:l-n,y:-s+o},{x:l-n,y:-o},{x:l,y:-o}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:l,y:-n},{x:0,y:-s}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-s}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-n},{x:l,y:-s}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-s}]:i.has("right")?[{x:n,y:-o},{x:n,y:-o},{x:l-n,y:-o},{x:l-n,y:0},{x:l,y:-s/2},{x:l-n,y:-s},{x:l-n,y:-s+o},{x:n,y:-s+o},{x:n,y:-s+o}]:i.has("left")?[{x:n,y:0},{x:n,y:-o},{x:l-n,y:-o},{x:l-n,y:-s+o},{x:n,y:-s+o},{x:n,y:-s},{x:0,y:-s/2}]:i.has("up")?[{x:n,y:-o},{x:n,y:-s+o},{x:0,y:-s+o},{x:l/2,y:-s},{x:l,y:-s+o},{x:l-n,y:-s+o},{x:l-n,y:-o}]:i.has("down")?[{x:l/2,y:0},{x:0,y:-o},{x:n,y:-o},{x:n,y:-s+o},{x:l-n,y:-s+o},{x:l-n,y:-o},{x:l,y:-o}]:[{x:0,y:0}]},"getArrowPoints");function tB(t,e,r,a){var i=t.x,s=t.y,n=i-a.x,l=s-a.y,o=Math.sqrt(e*e*l*l+r*r*n*n),c=Math.abs(e*r*n/o);a.x0}function tM(t,e,r){var a=t.x,i=t.y,s=[],n=1/0,l=1/0;"function"==typeof e.forEach?e.forEach(function(t){n=Math.min(n,t.x),l=Math.min(l,t.y)}):(n=Math.min(n,e.x),l=Math.min(l,e.y));for(var o=a-t.width/2-n,c=i-t.height/2-l,d=0;d1&&s.sort(function(t,e){var a=t.x-r.x,i=t.y-r.y,s=Math.sqrt(a*a+i*i),n=e.x-r.x,l=e.y-r.y,o=Math.sqrt(n*n+l*l);return s{var r,a,i=t.x,s=t.y,n=e.x-i,l=e.y-s,o=t.width/2,c=t.height/2;return Math.abs(l)*o>Math.abs(n)*c?(l<0&&(c=-c),r=0===l?0:c*n/l,a=c):(n<0&&(o=-o),r=o,a=0===n?0:o*l/n),{x:i+r,y:s+a}},"intersectRect"),tj=(0,c.K2)(async(t,e,r,a)=>{let i,c,d=(0,o.D7)(),h=e.useHtmlLabels||(0,o.E)(d),g=t.insert("g").attr("class",r||"node default").attr("id",e.domId||e.id),u=g.insert("g").attr("class","label").attr("style",e.labelStyle);i=void 0===e.labelText?"":"string"==typeof e.labelText?e.labelText:e.labelText[0];let y=(c="markdown"===e.labelType?(0,n.GZ)(u,(0,o.jZ)((0,l.Sm)(i),d),{useHtmlLabels:h,width:e.width||d.flowchart.wrappingWidth,classes:"markdown-node-label"},d):await tw(u,(0,o.jZ)((0,l.Sm)(i),d),e.labelStyle,!1,a)).getBBox(),p=e.padding/2;if((0,o.E)(d)){let t=c.children[0],e=(0,b.Ltv)(c);await (0,s.X)(t,i),y=t.getBoundingClientRect(),e.attr("width",y.width),e.attr("height",y.height)}return h?u.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"):u.attr("transform","translate(0, "+-y.height/2+")"),e.centerLabel&&u.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),u.insert("rect",":first-child"),{shapeSvg:g,bbox:y,halfPadding:p,label:u}},"labelHelper"),tW=(0,c.K2)((t,e)=>{let r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function tY(t,e,r,a){return t.insert("polygon",":first-child").attr("points",a.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}(0,c.K2)(tY,"insertPolygonShape");var tF=(0,c.K2)(async(t,e)=>{e.useHtmlLabels||(0,o.E)((0,o.D7)())||(e.centerLabel=!0);let{shapeSvg:r,bbox:a,halfPadding:i}=await tj(t,e,"node "+e.classes,!0);c.Rm.info("Classes = ",e.classes);let s=r.insert("rect",":first-child");return s.attr("rx",e.rx).attr("ry",e.ry).attr("x",-a.width/2-i).attr("y",-a.height/2-i).attr("width",a.width+e.padding).attr("height",a.height+e.padding),tW(e,s),e.intersect=function(t){return tP(e,t)},r},"note"),tX=(0,c.K2)(t=>t?" "+t:"","formatClass"),tU=(0,c.K2)((t,e)=>`${e||"node default"}${tX(t.classes)} ${tX(t.class)}`,"getClassesFromNode"),tH=(0,c.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a}=await tj(t,e,tU(e,void 0),!0),i=a.width+e.padding+(a.height+e.padding),s=[{x:i/2,y:0},{x:i,y:-i/2},{x:i/2,y:-i},{x:0,y:-i/2}];c.Rm.info("Question main (Circle)");let n=tY(r,i,i,s);return n.attr("style",e.style),tW(e,n),e.intersect=function(t){return c.Rm.warn("Intersect called"),tM(e,s,t)},r},"question"),tZ=(0,c.K2)((t,e)=>{let r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);return r.insert("polygon",":first-child").attr("points",[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}].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 tO(e,14,t)},r},"choice"),tq=(0,c.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a}=await tj(t,e,tU(e,void 0),!0),i=e.positioned?e.height:a.height+e.padding,s=i/4,n=e.positioned?e.width:a.width+2*s+e.padding,l=[{x:s,y:0},{x:n-s,y:0},{x:n,y:-i/2},{x:n-s,y:-i},{x:s,y:-i},{x:0,y:-i/2}],o=tY(r,n,i,l);return o.attr("style",e.style),tW(e,o),e.intersect=function(t){return tM(e,l,t)},r},"hexagon"),tG=(0,c.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a}=await tj(t,e,void 0,!0),i=a.height+2*e.padding,s=i/2,n=a.width+2*s+e.padding,l=e.positioned&&(e.widthInColumns??1)>1&&e.width>n?e.width:n,o=tC(e.directions,a,e,l),c=tY(r,l,i,o);return c.attr("style",e.style),tW(e,c),e.intersect=function(t){return tM(e,o,t)},r},"block_arrow"),tV=(0,c.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a}=await tj(t,e,tU(e,void 0),!0),i=a.width+e.padding,s=a.height+e.padding,n=[{x:-s/2,y:0},{x:i,y:0},{x:i,y:-s},{x:-s/2,y:-s},{x:0,y:-s/2}];return tY(r,i,s,n).attr("style",e.style),e.width=i+s,e.height=s,e.intersect=function(t){return tM(e,n,t)},r},"rect_left_inv_arrow"),tJ=(0,c.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a}=await tj(t,e,tU(e),!0),i=a.width+e.padding,s=a.height+e.padding,n=[{x:-2*s/6,y:0},{x:i-s/6,y:0},{x:i+2*s/6,y:-s},{x:s/6,y:-s}],l=tY(r,i,s,n);return l.attr("style",e.style),tW(e,l),e.intersect=function(t){return tM(e,n,t)},r},"lean_right"),tQ=(0,c.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a}=await tj(t,e,tU(e,void 0),!0),i=a.width+e.padding,s=a.height+e.padding,n=[{x:2*s/6,y:0},{x:i+s/6,y:0},{x:i-2*s/6,y:-s},{x:-s/6,y:-s}],l=tY(r,i,s,n);return l.attr("style",e.style),tW(e,l),e.intersect=function(t){return tM(e,n,t)},r},"lean_left"),t0=(0,c.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a}=await tj(t,e,tU(e,void 0),!0),i=a.width+e.padding,s=a.height+e.padding,n=[{x:-2*s/6,y:0},{x:i+2*s/6,y:0},{x:i-s/6,y:-s},{x:s/6,y:-s}],l=tY(r,i,s,n);return l.attr("style",e.style),tW(e,l),e.intersect=function(t){return tM(e,n,t)},r},"trapezoid"),t1=(0,c.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a}=await tj(t,e,tU(e,void 0),!0),i=a.width+e.padding,s=a.height+e.padding,n=[{x:s/6,y:0},{x:i-s/6,y:0},{x:i+2*s/6,y:-s},{x:-2*s/6,y:-s}],l=tY(r,i,s,n);return l.attr("style",e.style),tW(e,l),e.intersect=function(t){return tM(e,n,t)},r},"inv_trapezoid"),t2=(0,c.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a}=await tj(t,e,tU(e,void 0),!0),i=a.width+e.padding,s=a.height+e.padding,n=[{x:0,y:0},{x:i+s/2,y:0},{x:i,y:-s/2},{x:i+s/2,y:-s},{x:0,y:-s}],l=tY(r,i,s,n);return l.attr("style",e.style),tW(e,l),e.intersect=function(t){return tM(e,n,t)},r},"rect_right_inv_arrow"),t3=(0,c.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a}=await tj(t,e,tU(e,void 0),!0),i=a.width+e.padding,s=i/2,n=s/(2.5+i/50),l=a.height+n+e.padding,o="M 0,"+n+" a "+s+","+n+" 0,0,0 "+i+" 0 a "+s+","+n+" 0,0,0 "+-i+" 0 l 0,"+l+" a "+s+","+n+" 0,0,0 "+i+" 0 l 0,"+-l,c=r.attr("label-offset-y",n).insert("path",":first-child").attr("style",e.style).attr("d",o).attr("transform","translate("+-i/2+","+-(l/2+n)+")");return tW(e,c),e.intersect=function(t){let r=tP(e,t),a=r.x-e.x;if(0!=s&&(Math.abs(a)e.height/2-n)){let i=n*n*(1-a*a/(s*s));0!=i&&(i=Math.sqrt(i)),i=n-i,t.y-e.y>0&&(i=-i),r.y+=i}return r},r},"cylinder"),t4=(0,c.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a,halfPadding:i}=await tj(t,e,"node "+e.classes+" "+e.class,!0),s=r.insert("rect",":first-child"),n=e.positioned?e.width:a.width+e.padding,l=e.positioned?e.height:a.height+e.padding,o=e.positioned?-n/2:-a.width/2-i,d=e.positioned?-l/2:-a.height/2-i;if(s.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",o).attr("y",d).attr("width",n).attr("height",l),e.props){let t=new Set(Object.keys(e.props));e.props.borders&&(t9(s,e.props.borders,n,l),t.delete("borders")),t.forEach(t=>{c.Rm.warn(`Unknown node property ${t}`)})}return tW(e,s),e.intersect=function(t){return tP(e,t)},r},"rect"),t8=(0,c.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a,halfPadding:i}=await tj(t,e,"node "+e.classes,!0),s=r.insert("rect",":first-child"),n=e.positioned?e.width:a.width+e.padding,l=e.positioned?e.height:a.height+e.padding,o=e.positioned?-n/2:-a.width/2-i,d=e.positioned?-l/2:-a.height/2-i;if(s.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",o).attr("y",d).attr("width",n).attr("height",l),e.props){let t=new Set(Object.keys(e.props));e.props.borders&&(t9(s,e.props.borders,n,l),t.delete("borders")),t.forEach(t=>{c.Rm.warn(`Unknown node property ${t}`)})}return tW(e,s),e.intersect=function(t){return tP(e,t)},r},"composite"),t5=(0,c.K2)(async(t,e)=>{let{shapeSvg:r}=await tj(t,e,"label",!0);c.Rm.trace("Classes = ",e.class);let a=r.insert("rect",":first-child");if(a.attr("width",0).attr("height",0),r.attr("class","label edgeLabel"),e.props){let t=new Set(Object.keys(e.props));e.props.borders&&(t9(a,e.props.borders,0,0),t.delete("borders")),t.forEach(t=>{c.Rm.warn(`Unknown node property ${t}`)})}return tW(e,a),e.intersect=function(t){return tP(e,t)},r},"labelRect");function t9(t,e,r,a){let i=[],s=(0,c.K2)(t=>{i.push(t,0)},"addBorder"),n=(0,c.K2)(t=>{i.push(0,t)},"skipBorder");e.includes("t")?(c.Rm.debug("add top border"),s(r)):n(r),e.includes("r")?(c.Rm.debug("add right border"),s(a)):n(a),e.includes("b")?(c.Rm.debug("add bottom border"),s(r)):n(r),e.includes("l")?(c.Rm.debug("add left border"),s(a)):n(a),t.attr("stroke-dasharray",i.join(" "))}(0,c.K2)(t9,"applyNodePropertyBorders");var t7=(0,c.K2)(async(t,e)=>{let r;r=e.classes?"node "+e.classes:"node default";let a=t.insert("g").attr("class",r).attr("id",e.domId||e.id),i=a.insert("rect",":first-child"),s=a.insert("line"),n=a.insert("g").attr("class","label"),l=e.labelText.flat?e.labelText.flat():e.labelText,d="";d="object"==typeof l?l[0]:l,c.Rm.info("Label text abc79",d,l,"object"==typeof l);let h=await tw(n,d,e.labelStyle,!0,!0),g={width:0,height:0};if((0,o.E)((0,o.D7)())){let t=h.children[0],e=(0,b.Ltv)(h);g=t.getBoundingClientRect(),e.attr("width",g.width),e.attr("height",g.height)}c.Rm.info("Text 2",l);let u=l.slice(1,l.length),y=h.getBBox(),p=await tw(n,u.join?u.join("
"):u,e.labelStyle,!0,!0);if((0,o.E)((0,o.D7)())){let t=p.children[0],e=(0,b.Ltv)(p);g=t.getBoundingClientRect(),e.attr("width",g.width),e.attr("height",g.height)}let x=e.padding/2;return(0,b.Ltv)(p).attr("transform","translate( "+(g.width>y.width?0:(y.width-g.width)/2)+", "+(y.height+x+5)+")"),(0,b.Ltv)(h).attr("transform","translate( "+(g.width{let{shapeSvg:r,bbox:a}=await tj(t,e,tU(e,void 0),!0),i=a.height+e.padding,s=a.width+i/4+e.padding,n=r.insert("rect",":first-child").attr("style",e.style).attr("rx",i/2).attr("ry",i/2).attr("x",-s/2).attr("y",-i/2).attr("width",s).attr("height",i);return tW(e,n),e.intersect=function(t){return tP(e,t)},r},"stadium"),et=(0,c.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a,halfPadding:i}=await tj(t,e,tU(e,void 0),!0),s=r.insert("circle",":first-child");return s.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+i).attr("width",a.width+e.padding).attr("height",a.height+e.padding),c.Rm.info("Circle main"),tW(e,s),e.intersect=function(t){return c.Rm.info("Circle intersect",e,a.width/2+i,t),tO(e,a.width/2+i,t)},r},"circle"),ee=(0,c.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a,halfPadding:i}=await tj(t,e,tU(e,void 0),!0),s=r.insert("g",":first-child"),n=s.insert("circle"),l=s.insert("circle");return s.attr("class",e.class),n.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+i+5).attr("width",a.width+e.padding+10).attr("height",a.height+e.padding+10),l.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+i).attr("width",a.width+e.padding).attr("height",a.height+e.padding),c.Rm.info("DoubleCircle main"),tW(e,n),e.intersect=function(t){return c.Rm.info("DoubleCircle intersect",e,a.width/2+i+5,t),tO(e,a.width/2+i+5,t)},r},"doublecircle"),er=(0,c.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a}=await tj(t,e,tU(e,void 0),!0),i=a.width+e.padding,s=a.height+e.padding,n=[{x:0,y:0},{x:i,y:0},{x:i,y:-s},{x:0,y:-s},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-s},{x:-8,y:-s},{x:-8,y:0}],l=tY(r,i,s,n);return l.attr("style",e.style),tW(e,l),e.intersect=function(t){return tM(e,n,t)},r},"subroutine"),ea=(0,c.K2)((t,e)=>{let r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),a=r.insert("circle",":first-child");return a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),tW(e,a),e.intersect=function(t){return tO(e,7,t)},r},"start"),ei=(0,c.K2)((t,e,r)=>{let a=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),i=70,s=10;return"LR"===r&&(i=10,s=70),tW(e,a.append("rect").attr("x",-1*i/2).attr("y",-1*s/2).attr("width",i).attr("height",s).attr("class","fork-join")),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(t){return tP(e,t)},a},"forkJoin"),es={rhombus:tH,composite:t8,question:tH,rect:t4,labelRect:t5,rectWithTitle:t7,choice:tZ,circle:et,doublecircle:ee,stadium:t6,hexagon:tq,block_arrow:tG,rect_left_inv_arrow:tV,lean_right:tJ,lean_left:tQ,trapezoid:t0,inv_trapezoid:t1,rect_right_inv_arrow:t2,cylinder:t3,start:ea,end:(0,c.K2)((t,e)=>{let r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),a=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),a.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),tW(e,i),e.intersect=function(t){return tO(e,7,t)},r},"end"),note:tF,subroutine:er,fork:ei,join:ei,class_box:(0,c.K2)(async(t,e)=>{let r,a=e.padding/2;r=e.classes?"node "+e.classes:"node default";let i=t.insert("g").attr("class",r).attr("id",e.domId||e.id),s=i.insert("rect",":first-child"),n=i.insert("line"),l=i.insert("line"),c=0,d=4,h=i.insert("g").attr("class","label"),g=0,u=e.classData.annotations?.[0],y=e.classData.annotations[0]?"\xab"+e.classData.annotations[0]+"\xbb":"",p=await tw(h,y,e.labelStyle,!0,!0),x=p.getBBox();if((0,o.E)((0,o.D7)())){let t=p.children[0],e=(0,b.Ltv)(p);x=t.getBoundingClientRect(),e.attr("width",x.width),e.attr("height",x.height)}e.classData.annotations[0]&&(d+=x.height+4,c+=x.width);let f=e.classData.label;void 0!==e.classData.type&&""!==e.classData.type&&((0,o.E)((0,o.D7)())?f+="<"+e.classData.type+">":f+="<"+e.classData.type+">");let m=await tw(h,f,e.labelStyle,!0,!0);(0,b.Ltv)(m).attr("class","classTitle");let w=m.getBBox();if((0,o.E)((0,o.D7)())){let t=m.children[0],e=(0,b.Ltv)(m);w=t.getBoundingClientRect(),e.attr("width",w.width),e.attr("height",w.height)}d+=w.height+4,w.width>c&&(c=w.width);let k=[];e.classData.members.forEach(async t=>{let r=t.getDisplayDetails(),a=r.displayText;(0,o.E)((0,o.D7)())&&(a=a.replace(//g,">"));let i=await tw(h,a,r.cssStyle?r.cssStyle:e.labelStyle,!0,!0),s=i.getBBox();if((0,o.E)((0,o.D7)())){let t=i.children[0],e=(0,b.Ltv)(i);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}s.width>c&&(c=s.width),d+=s.height+4,k.push(i)}),d+=8;let L=[];if(e.classData.methods.forEach(async t=>{let r=t.getDisplayDetails(),a=r.displayText;(0,o.E)((0,o.D7)())&&(a=a.replace(//g,">"));let i=await tw(h,a,r.cssStyle?r.cssStyle:e.labelStyle,!0,!0),s=i.getBBox();if((0,o.E)((0,o.D7)())){let t=i.children[0],e=(0,b.Ltv)(i);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}s.width>c&&(c=s.width),d+=s.height+4,L.push(i)}),d+=8,u){let t=(c-x.width)/2;(0,b.Ltv)(p).attr("transform","translate( "+(-1*c/2+t)+", "+-1*d/2+")"),g=x.height+4}let S=(c-w.width)/2;return(0,b.Ltv)(m).attr("transform","translate( "+(-1*c/2+S)+", "+(-1*d/2+g)+")"),g+=w.height+4,n.attr("class","divider").attr("x1",-c/2-a).attr("x2",c/2+a).attr("y1",-d/2-a+8+g).attr("y2",-d/2-a+8+g),g+=8,k.forEach(t=>{(0,b.Ltv)(t).attr("transform","translate( "+-c/2+", "+(-1*d/2+g+4)+")");let e=t?.getBBox();g+=(e?.height??0)+4}),g+=8,l.attr("class","divider").attr("x1",-c/2-a).attr("x2",c/2+a).attr("y1",-d/2-a+8+g).attr("y2",-d/2-a+8+g),g+=8,L.forEach(t=>{(0,b.Ltv)(t).attr("transform","translate( "+-c/2+", "+(-1*d/2+g)+")");let e=t?.getBBox();g+=(e?.height??0)+4}),s.attr("style",e.style).attr("class","outer title-state").attr("x",-c/2-a).attr("y",-(d/2)-a).attr("width",c+e.padding).attr("height",d+e.padding),tW(e,s),e.intersect=function(t){return tP(e,t)},i},"class_box")},en={},el=(0,c.K2)(async(t,e,r)=>{let a,i;if(e.link){let s;"sandbox"===(0,o.D7)().securityLevel?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),a=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s),i=await es[e.shape](a,e,r)}else a=i=await es[e.shape](t,e,r);return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),en[e.id]=a,e.haveCallback&&en[e.id].attr("class",en[e.id].attr("class")+" clickable"),a},"insertNode"),eo=(0,c.K2)(t=>{let e=en[t.id];c.Rm.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");let r=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+r-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),r},"positionNode");function ec(t,e,r=!1){let a,i="default";(t?.classes?.length||0)>0&&(i=(t?.classes??[]).join(" ")),i+=" flowchart-label";let s=0,n="";switch(t.type){case"round":s=5,n="rect";break;case"composite":s=0,n="composite",a=0;break;case"square":case"group":default:n="rect";break;case"diamond":n="question";break;case"hexagon":n="hexagon";break;case"block_arrow":n="block_arrow";break;case"odd":case"rect_left_inv_arrow":n="rect_left_inv_arrow";break;case"lean_right":n="lean_right";break;case"lean_left":n="lean_left";break;case"trapezoid":n="trapezoid";break;case"inv_trapezoid":n="inv_trapezoid";break;case"circle":n="circle";break;case"ellipse":n="ellipse";break;case"stadium":n="stadium";break;case"subroutine":n="subroutine";break;case"cylinder":n="cylinder";break;case"doublecircle":n="doublecircle"}let c=(0,l.sM)(t?.styles??[]),d=t.label,h=t.size??{width:0,height:0,x:0,y:0},g=e.getDiagramId();return{labelStyle:c.labelStyle,shape:n,labelText:d,rx:s,ry:s,class:i,style:c.style,id:t.id,domId:g?`${g}-${t.id}`:t.id,directions:t.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:r,intersect:void 0,type:t.type,padding:a??(0,o.zj)()?.block?.padding??0,widthInColumns:t.widthInColumns??1}}async function ed(t,e,r){let a=ec(e,r,!1);if("group"===a.type)return;let i=(0,o.zj)(),s=await el(t,a,{config:i}),n=s.node().getBBox(),l=r.getBlock(a.id);l.size={width:n.width,height:n.height,x:0,y:0,node:s},r.setBlock(l),s.remove()}async function eh(t,e,r){let a=ec(e,r,!0);if("space"!==r.getBlock(a.id).type){let r=(0,o.zj)();await el(t,a,{config:r}),e.intersect=a?.intersect,eo(a)}}async function eg(t,e,r,a){for(let i of e)await a(t,i,r),i.children&&await eg(t,i.children,r,a)}async function eu(t,e,r){await eg(t,e,r,ed)}async function ey(t,e,r){await eg(t,e,r,eh)}async function ep(t,e,r,a,i){let s=new f.T({multigraph:!0,compound:!0});for(let t of(s.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8}),r))t.size&&s.setNode(t.id,{width:t.size.width,height:t.size.height,intersect:t.intersect});for(let r of e)if(r.start&&r.end){let e=a.getBlock(r.start),n=a.getBlock(r.end);if(e?.size&&n?.size){let a=e.size,l=n.size,o=[{x:a.x,y:a.y},{x:a.x+(l.x-a.x)/2,y:a.y+(l.y-a.y)/2},{x:l.x,y:l.y}],c=i?`${i}-${r.id}`:r.id,d="thick"===r.thickness?"edge-thickness-thick":"edge-thickness-normal",h="dotted"===r.pattern?"edge-pattern-dotted":"edge-pattern-solid",g=`${d} ${h} flowchart-link LS-a1 LE-b1`;tI(t,{v:r.start,w:r.end,name:c},{...r,id:c,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:o,classes:g},void 0,"block",s,i),r.label&&(await tD(t,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:o,classes:g}),tK({...r,x:o[1].x,y:o[1].y},{originalPath:o}))}}}(0,c.K2)(ec,"getNodeFromBlock"),(0,c.K2)(ed,"calculateBlockSize"),(0,c.K2)(eh,"insertBlockPositioned"),(0,c.K2)(eg,"performOperations"),(0,c.K2)(eu,"calculateBlockSizes"),(0,c.K2)(ey,"insertBlocks"),(0,c.K2)(ep,"insertEdges");var ex=(0,c.K2)(function(t,e){return e.db.getClasses()},"getClasses"),eb={parser:m,db:te,renderer:{draw:(0,c.K2)(async function(t,e,r,a){let i,{securityLevel:s,block:n}=(0,o.zj)(),l=a.db;l.setDiagramId(e),"sandbox"===s&&(i=(0,b.Ltv)("#i"+e));let d="sandbox"===s?(0,b.Ltv)(i.nodes()[0].contentDocument.body):(0,b.Ltv)("body"),h="sandbox"===s?d.select(`[id="${e}"]`):(0,b.Ltv)(`[id="${e}"]`);ti(h,["point","circle","cross"],a.type,e);let g=l.getBlocks(),u=l.getBlocksFlat(),y=l.getEdges(),p=h.insert("g").attr("class","block");await eu(p,g,l);let x=tm(l);if(await ey(p,g,l),await ep(p,y,u,l,e),x){let t=Math.max(1,Math.round(.125*(x.width/x.height))),e=x.height+t+10,r=x.width+10,{useMaxWidth:a}=n;(0,o.a$)(h,e,r,!!a),c.Rm.debug("Here Bounds",x,x),h.attr("viewBox",`${x.x-5} ${x.y-5} ${x.width+10} ${x.height+10}`)}},"draw"),getClasses:ex},styles:ta}},4674:(t,e,r)=>{r.d(e,{A:()=>s});var a=r(75011),i=r(50409);let s=(t,e)=>a.A.lang.round(i.A.parse(t)[e])},77808:(t,e,r)=>{r.d(e,{o:()=>a});var a=(0,r(85448).K2)(()=>` /* Font Awesome icon styling - consolidated */ .label-icon { display: inline-block; height: 1em; overflow: visible; vertical-align: -0.125em; } .node .label-icon path { fill: currentColor; stroke: revert; stroke-width: revert; } `,"getIconStyles")}}]);