%PDF- %PDF-
Direktori : /www/varak.net/nextcloud.varak.net/apps_old/apps/text/js/ |
Current File : //www/varak.net/nextcloud.varak.net/apps_old/apps/text/js/blockDiagram-9f4a6865-BzOrTt0o.chunk.mjs |
/*! third party licenses: js/vendor.LICENSE.txt */ import{c as ue,aZ as se,h as q,i as me,l as L,A as _e,af as ke,j as Ee,p as De}from"./mermaid.core-CHhv7cmw.chunk.mjs";import{c as we}from"./clone-CfxKHCfg.chunk.mjs";import{i as Ne,c as $e,b as Te,d as ve,a as de,p as Oe}from"./edges-066a5561-GQrjvVdy.chunk.mjs";import{G as Ie}from"./graph-AfIIf9fP.chunk.mjs";import"./NcNoteCard-CImn6F9p-7OG_jBLc.chunk.mjs";import{o as Ae}from"./ordinal-Bt1svyuw.chunk.mjs";import{c as Ce}from"./channel-JpSG4_AT.chunk.mjs";import{s as Re}from"./Tableau10-CtWOpFMd.chunk.mjs";import"./modulepreload-polyfill-DMTabKmO.chunk.mjs";import"./emoji-picker-SoWZqoso.chunk.mjs";import"./vue.runtime.esm-fZsuJKoo.chunk.mjs";import"./createText-ca0c5216-zBmLklPS.chunk.mjs";import"./line-CKWJWi_3.chunk.mjs";import"./array-CNYCUCI1.chunk.mjs";import"./path-D16fQfbf.chunk.mjs";import"./init-q33yAy1W.chunk.mjs";var ae,le,ee=function(){var e=function(m,s,n,o){for(n=n||{},o=m.length;o--;n[m[o]]=s);return n},a=[1,7],h=[1,13],c=[1,14],r=[1,15],u=[1,19],l=[1,16],p=[1,17],b=[1,18],d=[8,30],x=[8,21,28,29,30,31,32,40,44,47],_=[1,23],v=[1,24],k=[8,15,16,21,28,29,30,31,32,40,44,47],N=[8,15,16,21,27,28,29,30,31,32,40,44,47],S=[1,49],D={trace:function(){},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:function(m,s,n,o,y,t,g){var i=t.length-1;switch(y){case 4:o.getLogger().debug("Rule: separator (NL) ");break;case 5:o.getLogger().debug("Rule: separator (Space) ");break;case 6:o.getLogger().debug("Rule: separator (EOF) ");break;case 7:o.getLogger().debug("Rule: hierarchy: ",t[i-1]),o.setHierarchy(t[i-1]);break;case 8:o.getLogger().debug("Stop NL ");break;case 9:o.getLogger().debug("Stop EOF ");break;case 10:o.getLogger().debug("Stop NL2 ");break;case 11:o.getLogger().debug("Stop EOF2 ");break;case 12:o.getLogger().debug("Rule: statement: ",t[i]),typeof t[i].length=="number"?this.$=t[i]:this.$=[t[i]];break;case 13:o.getLogger().debug("Rule: statement #2: ",t[i-1]),this.$=[t[i-1]].concat(t[i]);break;case 14:o.getLogger().debug("Rule: link: ",t[i],m),this.$={edgeTypeStr:t[i],label:""};break;case 15:o.getLogger().debug("Rule: LABEL link: ",t[i-3],t[i-1],t[i]),this.$={edgeTypeStr:t[i],label:t[i-1]};break;case 18:const O=parseInt(t[i]),B=o.generateId();this.$={id:B,type:"space",label:"",width:O,children:[]};break;case 23:o.getLogger().debug("Rule: (nodeStatement link node) ",t[i-2],t[i-1],t[i]," typestr: ",t[i-1].edgeTypeStr);const X=o.edgeStrToEdgeData(t[i-1].edgeTypeStr);this.$=[{id:t[i-2].id,label:t[i-2].label,type:t[i-2].type,directions:t[i-2].directions},{id:t[i-2].id+"-"+t[i].id,start:t[i-2].id,end:t[i].id,label:t[i-1].label,type:"edge",directions:t[i].directions,arrowTypeEnd:X,arrowTypeStart:"arrow_open"},{id:t[i].id,label:t[i].label,type:o.typeStr2Type(t[i].typeStr),directions:t[i].directions}];break;case 24:o.getLogger().debug("Rule: nodeStatement (abc88 node size) ",t[i-1],t[i]),this.$={id:t[i-1].id,label:t[i-1].label,type:o.typeStr2Type(t[i-1].typeStr),directions:t[i-1].directions,widthInColumns:parseInt(t[i],10)};break;case 25:o.getLogger().debug("Rule: nodeStatement (node) ",t[i]),this.$={id:t[i].id,label:t[i].label,type:o.typeStr2Type(t[i].typeStr),directions:t[i].directions,widthInColumns:1};break;case 26:o.getLogger().debug("APA123",this?this:"na"),o.getLogger().debug("COLUMNS: ",t[i]),this.$={type:"column-setting",columns:t[i]==="auto"?-1:parseInt(t[i])};break;case 27:o.getLogger().debug("Rule: id-block statement : ",t[i-2],t[i-1]),o.generateId(),this.$={...t[i-2],type:"composite",children:t[i-1]};break;case 28:o.getLogger().debug("Rule: blockStatement : ",t[i-2],t[i-1],t[i]);const C=o.generateId();this.$={id:C,type:"composite",label:"",children:t[i-1]};break;case 29:o.getLogger().debug("Rule: node (NODE_ID separator): ",t[i]),this.$={id:t[i]};break;case 30:o.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",t[i-1],t[i]),this.$={id:t[i-1],label:t[i].label,typeStr:t[i].typeStr,directions:t[i].directions};break;case 31:o.getLogger().debug("Rule: dirList: ",t[i]),this.$=[t[i]];break;case 32:o.getLogger().debug("Rule: dirList: ",t[i-1],t[i]),this.$=[t[i-1]].concat(t[i]);break;case 33:o.getLogger().debug("Rule: nodeShapeNLabel: ",t[i-2],t[i-1],t[i]),this.$={typeStr:t[i-2]+t[i],label:t[i-1]};break;case 34:o.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",t[i-3],t[i-2]," #3:",t[i-1],t[i]),this.$={typeStr:t[i-3]+t[i],label:t[i-2],directions:t[i-1]};break;case 35:case 36:this.$={type:"classDef",id:t[i-1].trim(),css:t[i].trim()};break;case 37:this.$={type:"applyClass",id:t[i-1].trim(),styleClass:t[i].trim()};break;case 38:this.$={type:"applyStyles",id:t[i-1].trim(),stylesStr:t[i].trim()};break}},table:[{9:1,10:[1,2]},{1:[3]},{11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:h,29:c,31:r,32:u,40:l,44:p,47:b},{8:[1,20]},e(d,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,21:a,28:h,29:c,31:r,32:u,40:l,44:p,47:b}),e(x,[2,16],{14:22,15:_,16:v}),e(x,[2,17]),e(x,[2,18]),e(x,[2,19]),e(x,[2,20]),e(x,[2,21]),e(x,[2,22]),e(k,[2,25],{27:[1,25]}),e(x,[2,26]),{19:26,26:12,32:u},{11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:h,29:c,31:r,32:u,40:l,44:p,47:b},{41:[1,28],43:[1,29]},{45:[1,30]},{48:[1,31]},e(N,[2,29],{33:32,36:[1,33],38:[1,34]}),{1:[2,7]},e(d,[2,13]),{26:35,32:u},{32:[2,14]},{17:[1,36]},e(k,[2,24]),{11:37,13:4,14:22,15:_,16:v,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:h,29:c,31:r,32:u,40:l,44:p,47:b},{30:[1,38]},{42:[1,39]},{42:[1,40]},{46:[1,41]},{49:[1,42]},e(N,[2,30]),{18:[1,43]},{18:[1,44]},e(k,[2,23]),{18:[1,45]},{30:[1,46]},e(x,[2,28]),e(x,[2,35]),e(x,[2,36]),e(x,[2,37]),e(x,[2,38]),{37:[1,47]},{34:48,35:S},{15:[1,50]},e(x,[2,27]),e(N,[2,33]),{39:[1,51]},{34:52,35:S,39:[2,31]},{32:[2,15]},e(N,[2,34]),{39:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:function(m,s){if(s.recoverable)this.trace(m);else{var n=new Error(m);throw n.hash=s,n}},parse:function(m){var s=this,n=[0],o=[],y=[null],t=[],g=this.table,i="",O=0,B=0,X=2,C=1,F=t.slice.call(arguments,1),E=Object.create(this.lexer),P={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(P.yy[J]=this.yy[J]);E.setInput(m,P.yy),P.yy.lexer=E,P.yy.parser=this,typeof E.yylloc>"u"&&(E.yylloc={});var V=E.yylloc;t.push(V);var Se=E.options&&E.options.ranges;typeof P.yy.parseError=="function"?this.parseError=P.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function fe(){var z;return z=o.pop()||E.lex()||C,typeof z!="number"&&(z instanceof Array&&(o=z,z=o.pop()),z=s.symbols_[z]||z),z}for(var $,Y,I,Z,K={},j,R,oe,H;;){if(Y=n[n.length-1],this.defaultActions[Y]?I=this.defaultActions[Y]:(($===null||typeof $>"u")&&($=fe()),I=g[Y]&&g[Y][$]),typeof I>"u"||!I.length||!I[0]){var Q="";H=[];for(j in g[Y])this.terminals_[j]&&j>X&&H.push("'"+this.terminals_[j]+"'");E.showPosition?Q="Parse error on line "+(O+1)+":\n"+E.showPosition()+"\nExpecting "+H.join(", ")+", got '"+(this.terminals_[$]||$)+"'":Q="Parse error on line "+(O+1)+": Unexpected "+($==C?"end of input":"'"+(this.terminals_[$]||$)+"'"),this.parseError(Q,{text:E.match,token:this.terminals_[$]||$,line:E.yylineno,loc:V,expected:H})}if(I[0]instanceof Array&&I.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Y+", token: "+$);switch(I[0]){case 1:n.push($),y.push(E.yytext),t.push(E.yylloc),n.push(I[1]),$=null,B=E.yyleng,i=E.yytext,O=E.yylineno,V=E.yylloc;break;case 2:if(R=this.productions_[I[1]][1],K.$=y[y.length-R],K._$={first_line:t[t.length-(R||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(R||1)].first_column,last_column:t[t.length-1].last_column},Se&&(K._$.range=[t[t.length-(R||1)].range[0],t[t.length-1].range[1]]),Z=this.performAction.apply(K,[i,B,O,P.yy,I[1],y,t].concat(F)),typeof Z<"u")return Z;R&&(n=n.slice(0,-1*R*2),y=y.slice(0,-1*R),t=t.slice(0,-1*R)),n.push(this.productions_[I[1]][0]),y.push(K.$),t.push(K._$),oe=g[n[n.length-2]][n[n.length-1]],n.push(oe);break;case 3:return!0}}return!0}},A=function(){var m={EOF:1,parseError:function(s,n){if(this.yy.parser)this.yy.parser.parseError(s,n);else throw new Error(s)},setInput:function(s,n){return this.yy=n||this.yy||{},this._input=s,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},input:function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},unput:function(s){var n=s.length,o=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var y=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),o.length-1&&(this.yylineno-=o.length-1);var t=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:o?(o.length===y.length?this.yylloc.first_column:0)+y[y.length-o.length].length-o[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[t[0],t[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return 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});return this},less:function(s){this.unput(this.match.slice(s))},pastInput:function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+"\n"+n+"^"},test_match:function(s,n){var o,y,t;if(this.options.backtrack_lexer&&(t={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&&(t.yylloc.range=this.yylloc.range.slice(0))),y=s[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,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(s[0].length),this.matched+=s[0],o=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var g in t)this[g]=t[g];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,n,o,y;this._more||(this.yytext="",this.match="");for(var t=this._currentRules(),g=0;g<t.length;g++)if(o=this._input.match(this.rules[t[g]]),o&&(!n||o[0].length>n[0].length)){if(n=o,y=g,this.options.backtrack_lexer){if(s=this.test_match(o,t[g]),s!==!1)return s;if(this._backtrack){n=!1;continue}else return!1}else if(!this.options.flex)break}return n?(s=this.test_match(n,t[y]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var s=this.next();return s||this.lex()},begin:function(s){this.conditionStack.push(s)},popState:function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},pushState:function(s){this.begin(s)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(s,n,o,y){switch(o){case 0:return 10;case 1:return s.getLogger().debug("Found space-block"),31;case 2:return s.getLogger().debug("Found nl-block"),31;case 3:return s.getLogger().debug("Found space-block"),29;case 4:s.getLogger().debug(".",n.yytext);break;case 5:s.getLogger().debug("_",n.yytext);break;case 6:return 5;case 7:return n.yytext=-1,28;case 8:return n.yytext=n.yytext.replace(/columns\s+/,""),s.getLogger().debug("COLUMNS (LEX)",n.yytext),28;case 9:this.pushState("md_string");break;case 10:return"MD_STR";case 11:this.popState();break;case 12:this.pushState("string");break;case 13:s.getLogger().debug("LEX: POPPING STR:",n.yytext),this.popState();break;case 14:return s.getLogger().debug("LEX: STR end:",n.yytext),"STR";case 15:return n.yytext=n.yytext.replace(/space\:/,""),s.getLogger().debug("SPACE NUM (LEX)",n.yytext),21;case 16:return n.yytext="1",s.getLogger().debug("COLUMNS (LEX)",n.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 35:this.popState();break;case 36:return"acc_descr_multiline_value";case 37:return 30;case 38:return this.popState(),s.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),s.getLogger().debug("Lex: (("),"NODE_DEND";case 40:return this.popState(),s.getLogger().debug("Lex: ))"),"NODE_DEND";case 41:return this.popState(),s.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),s.getLogger().debug("Lex: (("),"NODE_DEND";case 43:return this.popState(),s.getLogger().debug("Lex: (-"),"NODE_DEND";case 44:return this.popState(),s.getLogger().debug("Lex: -)"),"NODE_DEND";case 45:return this.popState(),s.getLogger().debug("Lex: (("),"NODE_DEND";case 46:return this.popState(),s.getLogger().debug("Lex: ]]"),"NODE_DEND";case 47:return this.popState(),s.getLogger().debug("Lex: ("),"NODE_DEND";case 48:return this.popState(),s.getLogger().debug("Lex: ])"),"NODE_DEND";case 49:return this.popState(),s.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),s.getLogger().debug("Lex: /]"),"NODE_DEND";case 51:return this.popState(),s.getLogger().debug("Lex: )]"),"NODE_DEND";case 52:return this.popState(),s.getLogger().debug("Lex: )"),"NODE_DEND";case 53:return this.popState(),s.getLogger().debug("Lex: ]>"),"NODE_DEND";case 54:return this.popState(),s.getLogger().debug("Lex: ]"),"NODE_DEND";case 55:return s.getLogger().debug("Lexa: -)"),this.pushState("NODE"),36;case 56:return s.getLogger().debug("Lexa: (-"),this.pushState("NODE"),36;case 57:return s.getLogger().debug("Lexa: ))"),this.pushState("NODE"),36;case 58:return s.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 59:return s.getLogger().debug("Lex: ((("),this.pushState("NODE"),36;case 60:return s.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 61:return s.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 62:return s.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 63:return s.getLogger().debug("Lexc: >"),this.pushState("NODE"),36;case 64:return s.getLogger().debug("Lexa: (["),this.pushState("NODE"),36;case 65:return s.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 66:return this.pushState("NODE"),36;case 67:return this.pushState("NODE"),36;case 68:return this.pushState("NODE"),36;case 69:return this.pushState("NODE"),36;case 70:return this.pushState("NODE"),36;case 71:return this.pushState("NODE"),36;case 72:return this.pushState("NODE"),36;case 73:return s.getLogger().debug("Lexa: ["),this.pushState("NODE"),36;case 74:return this.pushState("BLOCK_ARROW"),s.getLogger().debug("LEX ARR START"),38;case 75:return s.getLogger().debug("Lex: NODE_ID",n.yytext),32;case 76:return s.getLogger().debug("Lex: EOF",n.yytext),8;case 77:this.pushState("md_string");break;case 78:this.pushState("md_string");break;case 79:return"NODE_DESCR";case 80:this.popState();break;case 81:s.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 82:s.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 83:return s.getLogger().debug("LEX: NODE_DESCR:",n.yytext),"NODE_DESCR";case 84:s.getLogger().debug("LEX POPPING"),this.popState();break;case 85:s.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 86:return n.yytext=n.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (right): dir:",n.yytext),"DIR";case 87:return n.yytext=n.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (left):",n.yytext),"DIR";case 88:return n.yytext=n.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (x):",n.yytext),"DIR";case 89:return n.yytext=n.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (y):",n.yytext),"DIR";case 90:return n.yytext=n.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (up):",n.yytext),"DIR";case 91:return n.yytext=n.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (down):",n.yytext),"DIR";case 92:return n.yytext="]>",s.getLogger().debug("Lex (ARROW_DIR end):",n.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 93:return s.getLogger().debug("Lex: LINK","#"+n.yytext+"#"),15;case 94:return s.getLogger().debug("Lex: LINK",n.yytext),15;case 95:return s.getLogger().debug("Lex: LINK",n.yytext),15;case 96:return s.getLogger().debug("Lex: LINK",n.yytext),15;case 97:return s.getLogger().debug("Lex: START_LINK",n.yytext),this.pushState("LLABEL"),16;case 98:return s.getLogger().debug("Lex: START_LINK",n.yytext),this.pushState("LLABEL"),16;case 99:return s.getLogger().debug("Lex: START_LINK",n.yytext),this.pushState("LLABEL"),16;case 100:this.pushState("md_string");break;case 101:return s.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 102:return this.popState(),s.getLogger().debug("Lex: LINK","#"+n.yytext+"#"),15;case 103:return this.popState(),s.getLogger().debug("Lex: LINK",n.yytext),15;case 104:return this.popState(),s.getLogger().debug("Lex: LINK",n.yytext),15;case 105:return s.getLogger().debug("Lex: COLON",n.yytext),n.yytext=n.yytext.slice(1),27}},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}}};return m}();D.lexer=A;function w(){this.yy={}}return w.prototype=D,D.Parser=w,new w}();ee.parser=ee;const ze=ee;let T={},ie=[],M={};const ce="color",he="fill",Be="bgFill",pe=",",Fe=ue();let W={};const Pe=e=>Ee.sanitizeText(e,Fe),Ye=function(e,a=""){W[e]===void 0&&(W[e]={id:e,styles:[],textStyles:[]});const h=W[e];a==null||a.split(pe).forEach(c=>{const r=c.replace(/([^;]*);/,"$1").trim();if(c.match(ce)){const u=r.replace(he,Be).replace(ce,he);h.textStyles.push(u)}h.styles.push(r)})},Ke=function(e,a=""){const h=T[e];a!=null&&(h.styles=a.split(pe))},Xe=function(e,a){e.split(",").forEach(function(h){let c=T[h];if(c===void 0){const r=h.trim();T[r]={id:r,type:"na",children:[]},c=T[r]}c.classes||(c.classes=[]),c.classes.push(a)})},ye=(e,a)=>{const h=e.flat(),c=[];for(const r of h){if(r.label&&(r.label=Pe(r.label)),r.type==="classDef"){Ye(r.id,r.css);continue}if(r.type==="applyClass"){Xe(r.id,(r==null?void 0:r.styleClass)||"");continue}if(r.type==="applyStyles"){r!=null&&r.stylesStr&&Ke(r.id,r==null?void 0:r.stylesStr);continue}if(r.type==="column-setting")a.columns=r.columns||-1;else if(r.type==="edge")M[r.id]?M[r.id]++:M[r.id]=1,r.id=M[r.id]+"-"+r.id,ie.push(r);else{r.label||(r.type==="composite"?r.label="":r.label=r.id);const u=!T[r.id];if(u?T[r.id]=r:(r.type!=="na"&&(T[r.id].type=r.type),r.label!==r.id&&(T[r.id].label=r.label)),r.children&&ye(r.children,r),r.type==="space"){const l=r.width||1;for(let p=0;p<l;p++){const b=we(r);b.id=b.id+"-"+p,T[b.id]=b,c.push(b)}}else u&&c.push(r)}}a.children=c};let re=[],U={id:"root",type:"composite",children:[],columns:-1};const Me=()=>{L.debug("Clear called"),_e(),U={id:"root",type:"composite",children:[],columns:-1},T={root:U},re=[],W={},ie=[],M={}};function We(e){switch(L.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return L.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 Ue(e){switch(L.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}function je(e){switch(e.trim()){case"--x":return"arrow_cross";case"--o":return"arrow_circle";default:return"arrow_point"}}let ge=0;const He=()=>(ge++,"id-"+Math.random().toString(36).substr(2,12)+"-"+ge),qe=e=>{U.children=e,ye(e,U),re=U.children},Ge=e=>{const a=T[e];return a?a.columns?a.columns:a.children?a.children.length:-1:-1},Je=()=>[...Object.values(T)],Ve=()=>re||[],Ze=()=>ie,Qe=e=>T[e],et=e=>{T[e.id]=e},tt=()=>console,st=function(){return W},it={getConfig:()=>se().block,typeStr2Type:We,edgeTypeStr2Type:Ue,edgeStrToEdgeData:je,getLogger:tt,getBlocksFlat:Je,getBlocks:Ve,getEdges:Ze,setHierarchy:qe,getBlock:Qe,setBlock:et,getColumns:Ge,getClasses:st,clear:Me,generateId:He},rt=it,G=(e,a)=>{const h=Ce,c=h(e,"r"),r=h(e,"g"),u=h(e,"b");return ke(c,r,u,a)},nt=e=>".label {\n font-family: ".concat(e.fontFamily,";\n color: ").concat(e.nodeTextColor||e.textColor,";\n }\n .cluster-label text {\n fill: ").concat(e.titleColor,";\n }\n .cluster-label span,p {\n color: ").concat(e.titleColor,";\n }\n\n\n\n .label text,span,p {\n fill: ").concat(e.nodeTextColor||e.textColor,";\n color: ").concat(e.nodeTextColor||e.textColor,";\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ").concat(e.mainBkg,";\n stroke: ").concat(e.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: ").concat(e.arrowheadColor,";\n }\n\n .edgePath .path {\n stroke: ").concat(e.lineColor,";\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ").concat(e.lineColor,";\n fill: none;\n }\n\n .edgeLabel {\n background-color: ").concat(e.edgeLabelBackground,";\n rect {\n opacity: 0.5;\n background-color: ").concat(e.edgeLabelBackground,";\n fill: ").concat(e.edgeLabelBackground,";\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ").concat(G(e.edgeLabelBackground,.5),";\n // background-color:\n }\n\n .node .cluster {\n // fill: ").concat(G(e.mainBkg,.5),";\n fill: ").concat(G(e.clusterBkg,.5),";\n stroke: ").concat(G(e.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: ").concat(e.titleColor,";\n }\n\n .cluster span,p {\n color: ").concat(e.titleColor,";\n }\n /* .cluster div {\n color: ").concat(e.titleColor,";\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ").concat(e.fontFamily,";\n font-size: 12px;\n background: ").concat(e.tertiaryColor,";\n border: 1px solid ").concat(e.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: ").concat(e.textColor,";\n }\n"),ot=nt;function be(e,a,h=!1){var c,r,u;const l=e;let p="default";(((c=l==null?void 0:l.classes)==null?void 0:c.length)||0)>0&&(p=((l==null?void 0:l.classes)||[]).join(" ")),p=p+" flowchart-label";let b=0,d="",x;switch(l.type){case"round":b=5,d="rect";break;case"composite":b=0,d="composite",x=0;break;case"square":d="rect";break;case"diamond":d="question";break;case"hexagon":d="hexagon";break;case"block_arrow":d="block_arrow";break;case"odd":d="rect_left_inv_arrow";break;case"lean_right":d="lean_right";break;case"lean_left":d="lean_left";break;case"trapezoid":d="trapezoid";break;case"inv_trapezoid":d="inv_trapezoid";break;case"rect_left_inv_arrow":d="rect_left_inv_arrow";break;case"circle":d="circle";break;case"ellipse":d="ellipse";break;case"stadium":d="stadium";break;case"subroutine":d="subroutine";break;case"cylinder":d="cylinder";break;case"group":d="rect";break;case"doublecircle":d="doublecircle";break;default:d="rect"}const _=De((l==null?void 0:l.styles)||[]),v=l.label,k=l.size||{width:0,height:0,x:0,y:0};return{labelStyle:_.labelStyle,shape:d,labelText:v,rx:b,ry:b,class:p,style:_.style,id:l.id,directions:l.directions,width:k.width,height:k.height,x:k.x,y:k.y,positioned:h,intersect:void 0,type:l.type,padding:x!=null?x:((u=(r=se())==null?void 0:r.block)==null?void 0:u.padding)||0}}async function at(e,a,h){const c=be(a,h,!1);if(c.type==="group")return;const r=await de(e,c),u=r.node().getBBox(),l=h.getBlock(c.id);l.size={width:u.width,height:u.height,x:0,y:0,node:r},h.setBlock(l),r.remove()}async function lt(e,a,h){const c=be(a,h,!0);h.getBlock(c.id).type!=="space"&&(await de(e,c),a.intersect=c==null?void 0:c.intersect,Oe(c))}async function ne(e,a,h,c){for(const r of a)await c(e,r,h),r.children&&await ne(e,r.children,h,c)}async function ct(e,a,h){await ne(e,a,h,at)}async function ht(e,a,h){await ne(e,a,h,lt)}async function gt(e,a,h,c,r){const u=new Ie({multigraph:!0,compound:!0});u.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const l of h)l.size&&u.setNode(l.id,{width:l.size.width,height:l.size.height,intersect:l.intersect});for(const l of a)if(l.start&&l.end){const p=c.getBlock(l.start),b=c.getBlock(l.end);if(p!=null&&p.size&&(b!=null&&b.size)){const d=p.size,x=b.size,_=[{x:d.x,y:d.y},{x:d.x+(x.x-d.x)/2,y:d.y+(x.y-d.y)/2},{x:x.x,y:x.y}];await $e(e,{v:l.start,w:l.end,name:l.id},{...l,arrowTypeEnd:l.arrowTypeEnd,arrowTypeStart:l.arrowTypeStart,points:_,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",u,r),l.label&&(await Te(e,{...l,label:l.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:l.arrowTypeEnd,arrowTypeStart:l.arrowTypeStart,points:_,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),await ve({...l,x:_[1].x,y:_[1].y},{originalPath:_}))}}}const f=((le=(ae=ue())==null?void 0:ae.block)==null?void 0:le.padding)||8;function ut(e,a){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(a<0||!Number.isInteger(a))throw new Error("Position must be a non-negative integer."+a);if(e<0)return{px:a,py:0};if(e===1)return{px:0,py:a};const h=a%e,c=Math.floor(a/e);return{px:h,py:c}}const dt=e=>{let a=0,h=0;for(const c of e.children){const{width:r,height:u,x:l,y:p}=c.size||{width:0,height:0,x:0,y:0};L.debug("getMaxChildSize abc95 child:",c.id,"width:",r,"height:",u,"x:",l,"y:",p,c.type),c.type!=="space"&&(r>a&&(a=r/(e.widthInColumns||1)),u>h&&(h=u))}return{width:a,height:h}};function te(e,a,h=0,c=0){var r,u,l,p,b,d,x,_,v,k,N;L.debug("setBlockSizes abc95 (start)",e.id,(r=e==null?void 0:e.size)==null?void 0:r.x,"block width =",e==null?void 0:e.size,"sieblingWidth",h),(u=e==null?void 0:e.size)!=null&&u.width||(e.size={width:h,height:c,x:0,y:0});let S=0,D=0;if(((l=e.children)==null?void 0:l.length)>0){for(const t of e.children)te(t,a);const A=dt(e);S=A.width,D=A.height,L.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",S,D);for(const t of e.children)t.size&&(L.debug("abc95 Setting size of children of ".concat(e.id," id=").concat(t.id," ").concat(S," ").concat(D," ").concat(t.size)),t.size.width=S*(t.widthInColumns||1)+f*((t.widthInColumns||1)-1),t.size.height=D,t.size.x=0,t.size.y=0,L.debug("abc95 updating size of ".concat(e.id," children child:").concat(t.id," maxWidth:").concat(S," maxHeight:").concat(D)));for(const t of e.children)te(t,a,S,D);const w=e.columns||-1;let m=0;for(const t of e.children)m+=t.widthInColumns||1;let s=e.children.length;w>0&&w<m&&(s=w),e.widthInColumns;const n=Math.ceil(m/s);let o=s*(S+f)+f,y=n*(D+f)+f;if(o<h){L.debug("Detected to small siebling: abc95 ".concat(e.id," sieblingWidth ").concat(h," sieblingHeight ").concat(c," width ").concat(o)),o=h,y=c;const t=(h-s*f-f)/s,g=(c-n*f-f)/n;L.debug("Size indata abc88",e.id,"childWidth",t,"maxWidth",S),L.debug("Size indata abc88",e.id,"childHeight",g,"maxHeight",D),L.debug("Size indata abc88 xSize",s,"padding",f);for(const i of e.children)i.size&&(i.size.width=t,i.size.height=g,i.size.x=0,i.size.y=0)}if(L.debug("abc95 (finale calc) ".concat(e.id," xSize ").concat(s," ySize ").concat(n," columns ").concat(w).concat(e.children.length," width=").concat(Math.max(o,((p=e.size)==null?void 0:p.width)||0))),o<(((b=e==null?void 0:e.size)==null?void 0:b.width)||0)){o=((d=e==null?void 0:e.size)==null?void 0:d.width)||0;const t=w>0?Math.min(e.children.length,w):e.children.length;if(t>0){const g=(o-t*f-f)/t;L.debug("abc95 (growing to fit) width",e.id,o,(x=e.size)==null?void 0:x.width,g);for(const i of e.children)i.size&&(i.size.width=g)}}e.size={width:o,height:y,x:0,y:0}}L.debug("setBlockSizes abc94 (done)",e.id,(_=e==null?void 0:e.size)==null?void 0:_.x,(v=e==null?void 0:e.size)==null?void 0:v.width,(k=e==null?void 0:e.size)==null?void 0:k.y,(N=e==null?void 0:e.size)==null?void 0:N.height)}function xe(e,a){var h,c,r,u,l,p,b,d,x,_,v,k,N,S,D,A,w;L.debug("abc85 layout blocks (=>layoutBlocks) ".concat(e.id," x: ").concat((h=e==null?void 0:e.size)==null?void 0:h.x," y: ").concat((c=e==null?void 0:e.size)==null?void 0:c.y," width: ").concat((r=e==null?void 0:e.size)==null?void 0:r.width));const m=e.columns||-1;if(L.debug("layoutBlocks columns abc95",e.id,"=>",m,e),e.children&&e.children.length>0){const s=((l=(u=e==null?void 0:e.children[0])==null?void 0:u.size)==null?void 0:l.width)||0,n=e.children.length*s+(e.children.length-1)*f;L.debug("widthOfChildren 88",n,"posX");let o=0;L.debug("abc91 block?.size?.x",e.id,(p=e==null?void 0:e.size)==null?void 0:p.x);let y=(b=e==null?void 0:e.size)!=null&&b.x?((d=e==null?void 0:e.size)==null?void 0:d.x)+(-((x=e==null?void 0:e.size)==null?void 0:x.width)/2||0):-f,t=0;for(const g of e.children){const i=e;if(!g.size)continue;const{width:O,height:B}=g.size,{px:X,py:C}=ut(m,o);if(C!=t&&(t=C,y=(_=e==null?void 0:e.size)!=null&&_.x?((v=e==null?void 0:e.size)==null?void 0:v.x)+(-((k=e==null?void 0:e.size)==null?void 0:k.width)/2||0):-f,L.debug("New row in layout for block",e.id," and child ",g.id,t)),L.debug("abc89 layout blocks (child) id: ".concat(g.id," Pos: ").concat(o," (px, py) ").concat(X,",").concat(C," (").concat((N=i==null?void 0:i.size)==null?void 0:N.x,",").concat((S=i==null?void 0:i.size)==null?void 0:S.y,") parent: ").concat(i.id," width: ").concat(O).concat(f)),i.size){const F=O/2;g.size.x=y+f+F,L.debug("abc91 layout blocks (calc) px, pyid:".concat(g.id," startingPos=X").concat(y," new startingPosX").concat(g.size.x," ").concat(F," padding=").concat(f," width=").concat(O," halfWidth=").concat(F," => x:").concat(g.size.x," y:").concat(g.size.y," ").concat(g.widthInColumns," (width * (child?.w || 1)) / 2 ").concat(O*((g==null?void 0:g.widthInColumns)||1)/2)),y=g.size.x+F,g.size.y=i.size.y-i.size.height/2+C*(B+f)+B/2+f,L.debug("abc88 layout blocks (calc) px, pyid:".concat(g.id,"startingPosX").concat(y).concat(f).concat(F,"=>x:").concat(g.size.x,"y:").concat(g.size.y).concat(g.widthInColumns,"(width * (child?.w || 1)) / 2").concat(O*((g==null?void 0:g.widthInColumns)||1)/2))}g.children&&xe(g),o+=(g==null?void 0:g.widthInColumns)||1,L.debug("abc88 columnsPos",g,o)}}L.debug("layout blocks (<==layoutBlocks) ".concat(e.id," x: ").concat((D=e==null?void 0:e.size)==null?void 0:D.x," y: ").concat((A=e==null?void 0:e.size)==null?void 0:A.y," width: ").concat((w=e==null?void 0:e.size)==null?void 0:w.width))}function Le(e,{minX:a,minY:h,maxX:c,maxY:r}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:u,y:l,width:p,height:b}=e.size;u-p/2<a&&(a=u-p/2),l-b/2<h&&(h=l-b/2),u+p/2>c&&(c=u+p/2),l+b/2>r&&(r=l+b/2)}if(e.children)for(const u of e.children)({minX:a,minY:h,maxX:c,maxY:r}=Le(u,{minX:a,minY:h,maxX:c,maxY:r}));return{minX:a,minY:h,maxX:c,maxY:r}}function pt(e){const a=e.getBlock("root");if(!a)return;te(a,e,0,0),xe(a),L.debug("getBlocks",JSON.stringify(a,null,2));const{minX:h,minY:c,maxX:r,maxY:u}=Le(a),l=u-c,p=r-h;return{x:h,y:c,width:p,height:l}}const yt=function(e,a){return a.db.getClasses()},bt=async function(e,a,h,c){const{securityLevel:r,block:u}=se(),l=c.db;let p;r==="sandbox"&&(p=q("#i"+a));const b=r==="sandbox"?q(p.nodes()[0].contentDocument.body):q("body"),d=r==="sandbox"?b.select('[id="'.concat(a,'"]')):q('[id="'.concat(a,'"]'));Ne(d,["point","circle","cross"],c.type,a);const x=l.getBlocks(),_=l.getBlocksFlat(),v=l.getEdges(),k=d.insert("g").attr("class","block");await ct(k,x,l);const N=pt(l);if(await ht(k,x,l),await gt(k,v,_,l,a),N){const S=N,D=Math.max(1,Math.round(.125*(S.width/S.height))),A=S.height+D+10,w=S.width+10,{useMaxWidth:m}=u;me(d,A,w,!!m),L.debug("Here Bounds",N,S),d.attr("viewBox","".concat(S.x-5," ").concat(S.y-5," ").concat(S.width+10," ").concat(S.height+10))}Ae(Re)},xt={draw:bt,getClasses:yt},Ct={parser:ze,db:rt,renderer:xt,styles:ot};export{Ct as diagram};