UNPKG

ranui

Version:

A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.

132 lines (117 loc) 76.2 kB
const u=require("./chunk-Y2CYZVJY-DPaYLFFP.cjs"),_=require("./src-C9EhKhbk.cjs"),v=require("./chunk-WYO6CB5R-u4mJNOcO.cjs"),oe=require("./channel-C9WSNwcS.cjs"),D=require("./chunk-ICXQ74PX-BbT9JaEW.cjs"),he=require("./line-CAB5QHC6.cjs");require("./chunk-HOUHSVGY-BGB3dOvI.cjs");const Lt=require("./chunk-Q4XR5HBZ-aBnPq509.cjs"),ge=require("./chunk-5VM5RSS4-DudUFQ_Z.cjs"),G=require("./chunk-7BUUIJ7U-DMv_UkjI.cjs"),Ft=require("./chunk-OGEWGWER-DX8sW1dT.cjs"),ue=require("./graphlib-Du-578Js.cjs");function de(e){return Array.isArray(e)}function fe(e){if(D.isPrimitive(e))return e;const t=D.getTag(e);if(!pe(e))return{};if(de(e)){const n=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(n.index=e.index,n.input=e.input),n}if(D.isTypedArray(e)){const n=e,s=n.constructor;return new s(n.buffer,n.byteOffset,n.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const n=e,s=n.buffer,i=n.byteOffset,a=n.byteLength,l=new ArrayBuffer(a),c=new Uint8Array(s,i,a);return new Uint8Array(l).set(c),new DataView(l)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const n=e.constructor,s=new n(e.valueOf());return t==="[object String]"?ye(s,e):ft(s,e),s}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const n=e,s=new RegExp(n.source,n.flags);return s.lastIndex=n.lastIndex,s}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const n=e,s=new Map;return n.forEach((i,a)=>{s.set(a,i)}),s}if(t==="[object Set]"){const n=e,s=new Set;return n.forEach(i=>{s.add(i)}),s}if(t==="[object Arguments]"){const n=e,s={};return ft(s,n),s.length=n.length,s[Symbol.iterator]=n[Symbol.iterator],s}const r={};return be(r,e),ft(r,e),xe(r,e),r}function pe(e){switch(D.getTag(e)){case D.argumentsTag:case D.arrayTag:case D.arrayBufferTag:case D.dataViewTag:case D.booleanTag:case D.dateTag:case D.float32ArrayTag:case D.float64ArrayTag:case D.int8ArrayTag:case D.int16ArrayTag:case D.int32ArrayTag:case D.mapTag:case D.numberTag:case D.objectTag:case D.regexpTag:case D.setTag:case D.stringTag:case D.symbolTag:case D.uint8ArrayTag:case D.uint8ClampedArrayTag:case D.uint16ArrayTag:case D.uint32ArrayTag:return!0;default:return!1}}function ft(e,t){for(const r in t)Object.hasOwn(t,r)&&(e[r]=t[r])}function xe(e,t){const r=Object.getOwnPropertySymbols(t);for(let n=0;n<r.length;n++){const s=r[n];Object.prototype.propertyIsEnumerable.call(t,s)&&(e[s]=t[s])}}function ye(e,t){const r=t.valueOf().length;for(const n in t)Object.hasOwn(t,n)&&(Number.isNaN(Number(n))||Number(n)>=r)&&(e[n]=t[n])}function be(e,t){const r=Object.getPrototypeOf(t);r!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,r)}var xt=(function(){var e=u.__name(function(w,f,b,E){for(b=b||{},E=w.length;E--;b[w[E]]=f);return b},"o"),t=[1,15],r=[1,7],n=[1,13],s=[1,14],i=[1,19],a=[1,16],l=[1,17],c=[1,18],g=[8,30],o=[8,10,21,28,29,30,31,39,43,46],d=[1,23],x=[1,24],m=[8,10,15,16,21,28,29,30,31,39,43,46],y=[8,10,15,16,21,27,28,29,30,31,39,43,46],k=[1,49],S={trace:u.__name(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:u.__name(function(f,b,E,L,T,h,M){var p=h.length-1;switch(T){case 4:L.getLogger().debug("Rule: separator (NL) ");break;case 5:L.getLogger().debug("Rule: separator (Space) ");break;case 6:L.getLogger().debug("Rule: separator (EOF) ");break;case 7:L.getLogger().debug("Rule: hierarchy: ",h[p-1]),L.setHierarchy(h[p-1]);break;case 8:L.getLogger().debug("Stop NL ");break;case 9:L.getLogger().debug("Stop EOF ");break;case 10:L.getLogger().debug("Stop NL2 ");break;case 11:L.getLogger().debug("Stop EOF2 ");break;case 12:L.getLogger().debug("Rule: statement: ",h[p]),typeof h[p].length=="number"?this.$=h[p]:this.$=[h[p]];break;case 13:L.getLogger().debug("Rule: statement #2: ",h[p-1]),this.$=[h[p-1]].concat(h[p]);break;case 14:L.getLogger().debug("Rule: link: ",h[p],f),this.$={edgeTypeStr:h[p],label:""};break;case 15:L.getLogger().debug("Rule: LABEL link: ",h[p-3],h[p-1],h[p]),this.$={edgeTypeStr:h[p],label:h[p-1]};break;case 18:const B=parseInt(h[p]),q=L.generateId();this.$={id:q,type:"space",label:"",width:B,children:[]};break;case 23:L.getLogger().debug("Rule: (nodeStatement link node) ",h[p-2],h[p-1],h[p]," typestr: ",h[p-1].edgeTypeStr);const U=L.edgeStrToEdgeData(h[p-1].edgeTypeStr),lt=L.edgeStrToEdgeStartData(h[p-1].edgeTypeStr),$=L.edgeStrToThickness(h[p-1].edgeTypeStr),ct=L.edgeStrToPattern(h[p-1].edgeTypeStr);this.$=[{id:h[p-2].id,label:h[p-2].label,type:h[p-2].type,directions:h[p-2].directions},{id:h[p-2].id+"-"+h[p].id,start:h[p-2].id,end:h[p].id,label:h[p-1].label,type:"edge",thickness:$,pattern:ct,directions:h[p].directions,arrowTypeEnd:U,arrowTypeStart:lt},{id:h[p].id,label:h[p].label,type:L.typeStr2Type(h[p].typeStr),directions:h[p].directions}];break;case 24:L.getLogger().debug("Rule: nodeStatement (abc88 node size) ",h[p-1],h[p]),this.$={id:h[p-1].id,label:h[p-1].label,type:L.typeStr2Type(h[p-1].typeStr),directions:h[p-1].directions,widthInColumns:parseInt(h[p],10)};break;case 25:L.getLogger().debug("Rule: nodeStatement (node) ",h[p]),this.$={id:h[p].id,label:h[p].label,type:L.typeStr2Type(h[p].typeStr),directions:h[p].directions,widthInColumns:1};break;case 26:L.getLogger().debug("APA123",this?this:"na"),L.getLogger().debug("COLUMNS: ",h[p]),this.$={type:"column-setting",columns:h[p]==="auto"?-1:parseInt(h[p])};break;case 27:L.getLogger().debug("Rule: id-block statement : ",h[p-2],h[p-1]),L.generateId(),this.$={...h[p-2],type:"composite",children:h[p-1]};break;case 28:L.getLogger().debug("Rule: blockStatement : ",h[p-2],h[p-1],h[p]);const O=L.generateId();this.$={id:O,type:"composite",label:"",children:h[p-1]};break;case 29:L.getLogger().debug("Rule: node (NODE_ID separator): ",h[p]),this.$={id:h[p]};break;case 30:L.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",h[p-1],h[p]),this.$={id:h[p-1],label:h[p].label,typeStr:h[p].typeStr,directions:h[p].directions};break;case 31:L.getLogger().debug("Rule: dirList: ",h[p]),this.$=[h[p]];break;case 32:L.getLogger().debug("Rule: dirList: ",h[p-1],h[p]),this.$=[h[p-1]].concat(h[p]);break;case 33:L.getLogger().debug("Rule: nodeShapeNLabel: ",h[p-2],h[p-1],h[p]),this.$={typeStr:h[p-2]+h[p],label:h[p-1]};break;case 34:L.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",h[p-3],h[p-2]," #3:",h[p-1],h[p]),this.$={typeStr:h[p-3]+h[p],label:h[p-2],directions:h[p-1]};break;case 35:case 36:this.$={type:"classDef",id:h[p-1].trim(),css:h[p].trim()};break;case 37:this.$={type:"applyClass",id:h[p-1].trim(),styleClass:h[p].trim()};break;case 38:this.$={type:"applyStyles",id:h[p-1].trim(),stylesStr:h[p].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:s,31:i,39:a,43:l,46:c},{8:[1,20]},e(g,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:r,28:n,29:s,31:i,39:a,43:l,46:c}),e(o,[2,16],{14:22,15:d,16:x}),e(o,[2,17]),e(o,[2,18]),e(o,[2,19]),e(o,[2,20]),e(o,[2,21]),e(o,[2,22]),e(m,[2,25],{27:[1,25]}),e(o,[2,26]),{19:26,26:12,31:i},{10:t,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:s,31:i,39:a,43:l,46:c},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(y,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(g,[2,13]),{26:35,31:i},{31:[2,14]},{17:[1,36]},e(m,[2,24]),{10:t,11:37,13:4,14:22,15:d,16:x,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:s,31:i,39:a,43:l,46:c},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(y,[2,30]),{18:[1,43]},{18:[1,44]},e(m,[2,23]),{18:[1,45]},{30:[1,46]},e(o,[2,28]),e(o,[2,35]),e(o,[2,36]),e(o,[2,37]),e(o,[2,38]),{36:[1,47]},{33:48,34:k},{15:[1,50]},e(o,[2,27]),e(y,[2,33]),{38:[1,51]},{33:52,34:k,38:[2,31]},{31:[2,15]},e(y,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:u.__name(function(f,b){if(b.recoverable)this.trace(f);else{var E=new Error(f);throw E.hash=b,E}},"parseError"),parse:u.__name(function(f){var b=this,E=[0],L=[],T=[null],h=[],M=this.table,p="",B=0,q=0,U=0,lt=2,$=1,ct=h.slice.call(arguments,1),O=Object.create(this.lexer),V={yy:{}};for(var ot in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ot)&&(V.yy[ot]=this.yy[ot]);O.setInput(f,V.yy),V.yy.lexer=O,V.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var ht=O.yylloc;h.push(ht);var le=O.options&&O.options.ranges;typeof V.yy.parseError=="function"?this.parseError=V.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ce(H){E.length=E.length-2*H,T.length=T.length-H,h.length=h.length-H}u.__name(ce,"popStack");function Dt(){var H=L.pop()||O.lex()||$;return typeof H!="number"&&(H instanceof Array&&(L=H,H=L.pop()),H=b.symbols_[H]||H),H}u.__name(Dt,"lex");for(var z,gt,j,F,ut,Z={},tt,X,Ct,et;;){if(j=E[E.length-1],this.defaultActions[j]?F=this.defaultActions[j]:((z===null||typeof z>"u")&&(z=Dt()),F=M[j]&&M[j][z]),typeof F>"u"||!F.length||!F[0]){var dt="";et=[];for(tt in M[j])this.terminals_[tt]&&tt>lt&&et.push("'"+this.terminals_[tt]+"'");O.showPosition?dt="Parse error on line "+(B+1)+`: `+O.showPosition()+` Expecting `+et.join(", ")+", got '"+(this.terminals_[z]||z)+"'":dt="Parse error on line "+(B+1)+": Unexpected "+(z==$?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(dt,{text:O.match,token:this.terminals_[z]||z,line:O.yylineno,loc:ht,expected:et})}if(F[0]instanceof Array&&F.length>1)throw new Error("Parse Error: multiple actions possible at state: "+j+", token: "+z);switch(F[0]){case 1:E.push(z),T.push(O.yytext),h.push(O.yylloc),E.push(F[1]),z=null,gt?(z=gt,gt=null):(q=O.yyleng,p=O.yytext,B=O.yylineno,ht=O.yylloc,U>0&&U--);break;case 2:if(X=this.productions_[F[1]][1],Z.$=T[T.length-X],Z._$={first_line:h[h.length-(X||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(X||1)].first_column,last_column:h[h.length-1].last_column},le&&(Z._$.range=[h[h.length-(X||1)].range[0],h[h.length-1].range[1]]),ut=this.performAction.apply(Z,[p,q,B,V.yy,F[1],T,h].concat(ct)),typeof ut<"u")return ut;X&&(E=E.slice(0,-1*X*2),T=T.slice(0,-1*X),h=h.slice(0,-1*X)),E.push(this.productions_[F[1]][0]),T.push(Z.$),h.push(Z._$),Ct=M[E[E.length-2]][E[E.length-1]],E.push(Ct);break;case 3:return!0}}return!0},"parse")};S.lexer=(function(){return{EOF:1,parseError:u.__name(function(f,b){if(this.yy.parser)this.yy.parser.parseError(f,b);else throw new Error(f)},"parseError"),setInput:u.__name(function(w,f){return this.yy=f||this.yy||{},this._input=w,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:u.__name(function(){var w=this._input[0];return this.yytext+=w,this.yyleng++,this.offset++,this.match+=w,this.matched+=w,w.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),w},"input"),unput:u.__name(function(w){var f=w.length,b=w.split(/(?:\r\n?|\n)/g);this._input=w+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-f),this.offset-=f;var E=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),b.length-1&&(this.yylineno-=b.length-1);var L=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:b?(b.length===E.length?this.yylloc.first_column:0)+E[E.length-b.length].length-b[0].length:this.yylloc.first_column-f},this.options.ranges&&(this.yylloc.range=[L[0],L[0]+this.yyleng-f]),this.yyleng=this.yytext.length,this},"unput"),more:u.__name(function(){return this._more=!0,this},"more"),reject:u.__name(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). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:u.__name(function(w){this.unput(this.match.slice(w))},"less"),pastInput:u.__name(function(){var w=this.matched.substr(0,this.matched.length-this.match.length);return(w.length>20?"...":"")+w.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:u.__name(function(){var w=this.match;return w.length<20&&(w+=this._input.substr(0,20-w.length)),(w.substr(0,20)+(w.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:u.__name(function(){var w=this.pastInput(),f=new Array(w.length+1).join("-");return w+this.upcomingInput()+` `+f+"^"},"showPosition"),test_match:u.__name(function(w,f){var b,E,L;if(this.options.backtrack_lexer&&(L={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&&(L.yylloc.range=this.yylloc.range.slice(0))),E=w[0].match(/(?:\r\n?|\n).*/g),E&&(this.yylineno+=E.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:E?E[E.length-1].length-E[E.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+w[0].length},this.yytext+=w[0],this.match+=w[0],this.matches=w,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(w[0].length),this.matched+=w[0],b=this.performAction.call(this,this.yy,this,f,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),b)return b;if(this._backtrack){for(var T in L)this[T]=L[T];return!1}return!1},"test_match"),next:u.__name(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var w,f,b,E;this._more||(this.yytext="",this.match="");for(var L=this._currentRules(),T=0;T<L.length;T++)if(b=this._input.match(this.rules[L[T]]),b&&(!f||b[0].length>f[0].length)){if(f=b,E=T,this.options.backtrack_lexer){if(w=this.test_match(b,L[T]),w!==!1)return w;if(this._backtrack){f=!1;continue}else return!1}else if(!this.options.flex)break}return f?(w=this.test_match(f,L[E]),w!==!1?w:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:u.__name(function(){var f=this.next();return f||this.lex()},"lex"),begin:u.__name(function(f){this.conditionStack.push(f)},"begin"),popState:u.__name(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:u.__name(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:u.__name(function(f){return f=this.conditionStack.length-1-Math.abs(f||0),f>=0?this.conditionStack[f]:"INITIAL"},"topState"),pushState:u.__name(function(f){this.begin(f)},"pushState"),stateStackSize:u.__name(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:u.__name(function(f,b,E,L){switch(E){case 0:return f.getLogger().debug("Found block-beta"),10;case 1:return f.getLogger().debug("Found id-block"),29;case 2:return f.getLogger().debug("Found block"),10;case 3:f.getLogger().debug(".",b.yytext);break;case 4:f.getLogger().debug("_",b.yytext);break;case 5:return 5;case 6:return b.yytext=-1,28;case 7:return b.yytext=b.yytext.replace(/columns\s+/,""),f.getLogger().debug("COLUMNS (LEX)",b.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:f.getLogger().debug("LEX: POPPING STR:",b.yytext),this.popState();break;case 13:return f.getLogger().debug("LEX: STR end:",b.yytext),"STR";case 14:return b.yytext=b.yytext.replace(/space\:/,""),f.getLogger().debug("SPACE NUM (LEX)",b.yytext),21;case 15:return b.yytext="1",f.getLogger().debug("COLUMNS (LEX)",b.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 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),f.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),f.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),f.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),f.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),f.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),f.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),f.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),f.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),f.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),f.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),f.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),f.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),f.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),f.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),f.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),f.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),f.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return f.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return f.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return f.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return f.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return f.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return f.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return f.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return f.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return f.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return f.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return f.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return f.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),f.getLogger().debug("LEX ARR START"),37;case 74:return f.getLogger().debug("Lex: NODE_ID",b.yytext),31;case 75:return f.getLogger().debug("Lex: EOF",b.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:f.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:f.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return f.getLogger().debug("LEX: NODE_DESCR:",b.yytext),"NODE_DESCR";case 83:f.getLogger().debug("LEX POPPING"),this.popState();break;case 84:f.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return b.yytext=b.yytext.replace(/^,\s*/,""),f.getLogger().debug("Lex (right): dir:",b.yytext),"DIR";case 86:return b.yytext=b.yytext.replace(/^,\s*/,""),f.getLogger().debug("Lex (left):",b.yytext),"DIR";case 87:return b.yytext=b.yytext.replace(/^,\s*/,""),f.getLogger().debug("Lex (x):",b.yytext),"DIR";case 88:return b.yytext=b.yytext.replace(/^,\s*/,""),f.getLogger().debug("Lex (y):",b.yytext),"DIR";case 89:return b.yytext=b.yytext.replace(/^,\s*/,""),f.getLogger().debug("Lex (up):",b.yytext),"DIR";case 90:return b.yytext=b.yytext.replace(/^,\s*/,""),f.getLogger().debug("Lex (down):",b.yytext),"DIR";case 91:return b.yytext="]>",f.getLogger().debug("Lex (ARROW_DIR end):",b.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return f.getLogger().debug("Lex: LINK","#"+b.yytext+"#"),15;case 93:return f.getLogger().debug("Lex: LINK",b.yytext),15;case 94:return f.getLogger().debug("Lex: LINK",b.yytext),15;case 95:return f.getLogger().debug("Lex: LINK",b.yytext),15;case 96:return f.getLogger().debug("Lex: START_LINK",b.yytext),this.pushState("LLABEL"),16;case 97:return f.getLogger().debug("Lex: START_LINK",b.yytext),this.pushState("LLABEL"),16;case 98:return f.getLogger().debug("Lex: START_LINK",b.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return f.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),f.getLogger().debug("Lex: LINK","#"+b.yytext+"#"),15;case 102:return this.popState(),f.getLogger().debug("Lex: LINK",b.yytext),15;case 103:return this.popState(),f.getLogger().debug("Lex: LINK",b.yytext),15;case 104:return f.getLogger().debug("Lex: COLON",b.yytext),b.yytext=b.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}}}})();function I(){this.yy={}}return u.__name(I,"Parser"),I.prototype=S,S.Parser=I,new I})();xt.parser=xt;var me=xt,W=new Map,kt=[],yt=new Map,It="color",Nt="fill",_e="bgFill",Ht=",",at=new Map,bt="",we=u.__name(e=>v.common_default.sanitizeText(e,v.getConfig2()),"sanitizeText"),Se=u.__name(function(e,t=""){let r=at.get(e);r||(r={id:e,styles:[],textStyles:[]},at.set(e,r)),t?.split(Ht).forEach(n=>{const s=n.replace(/([^;]*);/,"$1").trim();if(RegExp(It).exec(n)){const i=s.replace(Nt,_e).replace(It,Nt);r.textStyles.push(i)}r.styles.push(s)})},"addStyleClass"),Le=u.__name(function(e,t=""){const r=W.get(e);t!=null&&(r.styles=t.split(Ht))},"addStyle2Node"),ke=u.__name(function(e,t){e.split(",").forEach(function(r){let n=W.get(r);if(n===void 0){const s=r.trim();n={id:s,type:"na",children:[]},W.set(s,n)}n.classes||(n.classes=[]),n.classes.push(t)})},"setCssClass"),Wt=u.__name((e,t)=>{const r=e.flat(),n=[],s=r.find(i=>i?.type==="column-setting")?.columns??-1;for(const i of r){if(typeof s=="number"&&s>0&&i.type!=="column-setting"&&typeof i.widthInColumns=="number"&&i.widthInColumns>s&&_.log.warn(`Block ${i.id} width ${i.widthInColumns} exceeds configured column width ${s}`),i.label&&(i.label=we(i.label)),i.type==="classDef"){Se(i.id,i.css);continue}if(i.type==="applyClass"){ke(i.id,i?.styleClass??"");continue}if(i.type==="applyStyles"){i?.stylesStr&&Le(i.id,i?.stylesStr);continue}if(i.type==="column-setting")t.columns=i.columns??-1;else if(i.type==="edge"){const a=(yt.get(i.id)??0)+1;yt.set(i.id,a),i.id=a+"-"+i.id,kt.push(i)}else{i.label||(i.type==="composite"?i.label="":i.label=i.id);const a=W.get(i.id);if(a===void 0?W.set(i.id,i):(i.type!=="na"&&(a.type=i.type),i.label!==i.id&&(a.label=i.label)),i.children&&Wt(i.children,i),i.type==="space"){const l=i.width??1;for(let c=0;c<l;c++){const g=fe(i);g.id=g.id+"-"+c,W.set(g.id,g),n.push(g)}}else a===void 0&&n.push(i)}}t.children=n},"populateBlockDatabase"),mt=[],Q={id:"root",type:"composite",children:[],columns:-1},ve=u.__name(()=>{_.log.debug("Clear called"),v.clear(),Q={id:"root",type:"composite",children:[],columns:-1},W=new Map([["root",Q]]),mt=[],at=new Map,kt=[],yt=new Map,bt=""},"clear");function Yt(e){switch(_.log.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return _.log.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"}}u.__name(Yt,"typeStr2Type");function Kt(e){return _.log.debug("typeStr2Type",e),e==="=="?"thick":"normal"}u.__name(Kt,"edgeTypeStr2Type");function Ut(e){switch(e.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}u.__name(Ut,"edgeStrToEdgeData");function Xt(e){switch(e.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}u.__name(Xt,"edgeStrToEdgeStartData");function qt(e){return e.includes("==")?"thick":"normal"}u.__name(qt,"edgeStrToThickness");function Vt(e){return e.includes(".-")?"dotted":"solid"}u.__name(Vt,"edgeStrToPattern");var Bt=0,Ee={getConfig:u.__name(()=>v.getConfig().block,"getConfig"),typeStr2Type:Yt,edgeTypeStr2Type:Kt,edgeStrToEdgeData:Ut,edgeStrToEdgeStartData:Xt,edgeStrToThickness:qt,edgeStrToPattern:Vt,getLogger:u.__name(()=>_.log,"getLogger"),getBlocksFlat:u.__name(()=>[...W.values()],"getBlocksFlat"),getBlocks:u.__name(()=>mt||[],"getBlocks"),getEdges:u.__name(()=>kt,"getEdges"),setHierarchy:u.__name(e=>{Q.children=e,Wt(e,Q),mt=Q.children},"setHierarchy"),getBlock:u.__name(e=>W.get(e),"getBlock"),setBlock:u.__name(e=>{W.set(e.id,e)},"setBlock"),getColumns:u.__name(e=>{const t=W.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),getClasses:u.__name(function(){return at},"getClasses"),clear:ve,generateId:u.__name(()=>(Bt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Bt),"generateId"),setDiagramId:u.__name(e=>{bt=e},"setDiagramId"),getDiagramId:u.__name(()=>bt,"getDiagramId")},pt=u.__name((e,t)=>{const r=oe.channel,n=r(e,"r"),s=r(e,"g"),i=r(e,"b");return v.rgba(n,s,i,t)},"fade"),Te=u.__name(e=>`.label { font-family: ${e.fontFamily}; color: ${e.nodeTextColor||e.textColor}; } .cluster-label text { fill: ${e.titleColor}; } .cluster-label span,p { color: ${e.titleColor}; } .label text,span,p { fill: ${e.nodeTextColor||e.textColor}; color: ${e.nodeTextColor||e.textColor}; } .node rect, .node circle, .node ellipse, .node polygon, .node path { fill: ${e.mainBkg}; stroke: ${e.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: ${e.arrowheadColor}; } .edgePath .path { stroke: ${e.lineColor}; stroke-width: 2.0px; } .flowchart-link { stroke: ${e.lineColor}; fill: none; } .edgeLabel { background-color: ${e.edgeLabelBackground}; /* * This is for backward compatibility with existing code that didn't * add a \`<p>\` 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: ${e.edgeLabelBackground}; fill: ${e.edgeLabelBackground}; } text-align: center; } /* For html labels only */ .labelBkg { background-color: ${e.edgeLabelBackground}; } .node .cluster { // fill: ${pt(e.mainBkg,.5)}; fill: ${pt(e.clusterBkg,.5)}; stroke: ${pt(e.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: ${e.titleColor}; } .cluster span,p { color: ${e.titleColor}; } /* .cluster div { color: ${e.titleColor}; } */ div.mermaidTooltip { position: absolute; text-align: center; max-width: 200px; padding: 2px; font-family: ${e.fontFamily}; font-size: 12px; background: ${e.tertiaryColor}; border: 1px solid ${e.border2}; border-radius: 2px; pointer-events: none; z-index: 100; } .flowchartTitleText { text-anchor: middle; font-size: 18px; fill: ${e.textColor}; } ${ge.getIconStyles()} `,"getStyles"),De=u.__name((e,t,r,n)=>{t.forEach(s=>{Ce[s](e,r,n)})},"insertMarkers"),Ce={extension:u.__name((e,t,r)=>{_.log.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).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"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),composition:u.__name((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).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"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),aggregation:u.__name((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).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"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),dependency:u.__name((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).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"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),lollipop:u.__name((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).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),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),point:u.__name((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).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"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),circle:u.__name((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).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"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),cross:u.__name((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).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"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).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:u.__name((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-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")},Ie=De;function _t(e,t){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(t<0||!Number.isInteger(t))throw new Error("Position must be a non-negative integer."+t);return e<0?{px:t,py:0}:e===1?{px:0,py:t}:{px:t%e,py:Math.floor(t/e)}}u.__name(_t,"calculateBlockPosition");var Ne=u.__name(e=>{let t=0,r=0;for(const n of e.children){const{width:s,height:i,x:a,y:l}=n.size??{width:0,height:0,x:0,y:0};if(_.log.debug("getMaxChildSize abc95 child:",n.id,"width:",s,"height:",i,"x:",a,"y:",l,n.type),n.type==="space")continue;const c=s/(n.widthInColumns??1);c>t&&(t=c),i>r&&(r=i)}return{width:t,height:r}},"getMaxChildSize");function st(e,t,r=0,n=0,s=8){_.log.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",r),e?.size?.width||(e.size={width:r,height:n,x:0,y:0});let i=0,a=0;if(e.children?.length>0){for(const y of e.children)st(y,t,0,0,s);const l=Ne(e);i=l.width,a=l.height,_.log.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",i,a);for(const y of e.children)y.size&&(_.log.debug(`abc95 Setting size of children of ${e.id} id=${y.id} ${i} ${a} ${JSON.stringify(y.size)}`),y.size.width=i*(y.widthInColumns??1)+s*((y.widthInColumns??1)-1),y.size.height=a,y.size.x=0,y.size.y=0,_.log.debug(`abc95 updating size of ${e.id} children child:${y.id} maxWidth:${i} maxHeight:${a}`));for(const y of e.children)st(y,t,i,a,s);const c=e.columns??-1;let g=0;for(const y of e.children)g+=y.widthInColumns??1;let o=e.children.length;c>0&&c<g&&(o=c);const d=Math.ceil(g/o);let x=o*(i+s)+s,m=d*(a+s)+s;if(x<r){_.log.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${r} siblingHeight ${n} width ${x}`),x=r,m=n;const y=(r-o*s-s)/o,k=(n-d*s-s)/d;_.log.debug("Size indata abc88",e.id,"childWidth",y,"maxWidth",i),_.log.debug("Size indata abc88",e.id,"childHeight",k,"maxHeight",a),_.log.debug("Size indata abc88 xSize",o,"padding",s);for(const S of e.children)S.size&&(S.size.width=y,S.size.height=k,S.size.x=0,S.size.y=0)}if(_.log.debug(`abc95 (finale calc) ${e.id} xSize ${o} ySize ${d} columns ${c}${e.children.length} width=${Math.max(x,e.size?.width||0)}`),x<(e?.size?.width||0)){x=e?.size?.width||0;const y=c>0?Math.min(e.children.length,c):e.children.length;if(y>0){const k=(x-y*s-s)/y;_.log.debug("abc95 (growing to fit) width",e.id,x,e.size?.width,k);for(const S of e.children)S.size&&(S.size.width=k)}}e.size={width:x,height:m,x:0,y:0}}_.log.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}u.__name(st,"setBlockSizes");function vt(e,t,r=8){_.log.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);const n=e.columns??-1;if(_.log.debug("layoutBlocks columns abc95",e.id,"=>",n,e),e.children&&e.children.length>0){const s=e?.children[0]?.size?.width??0,i=e.children.length*s+(e.children.length-1)*r;_.log.debug("widthOfChildren 88",i,"posX");const a=new Map;{let d=0;for(const x of e.children){if(!x.size)continue;const{py:m}=_t(n,d),y=a.get(m)??0;x.size.height>y&&a.set(m,x.size.height);let k=x?.widthInColumns??1;n>0&&(k=Math.min(k,n-d%n)),d+=k}}const l=new Map;{let d=0;const x=[...a.keys()].sort((m,y)=>m-y);for(const m of x)l.set(m,d),d+=(a.get(m)??0)+r}let c=0;_.log.debug("abc91 block?.size?.x",e.id,e?.size?.x);let g=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-r,o=0;for(const d of e.children){const x=e;if(!d.size)continue;const{width:m,height:y}=d.size,{px:k,py:S}=_t(n,c);if(S!=o&&(o=S,g=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-r,_.log.debug("New row in layout for block",e.id," and child ",d.id,o)),_.log.debug(`abc89 layout blocks (child) id: ${d.id} Pos: ${c} (px, py) ${k},${S} (${x?.size?.x},${x?.size?.y}) parent: ${x.id} width: ${m}${r}`),x.size){const w=m/2;d.size.x=g+r+w,_.log.debug(`abc91 layout blocks (calc) px, pyid:${d.id} startingPos=X${g} new startingPosX${d.size.x} ${w} padding=${r} width=${m} halfWidth=${w} => x:${d.size.x} y:${d.size.y} ${d.widthInColumns} (width * (child?.w || 1)) / 2 ${m*(d?.widthInColumns??1)/2}`),g=d.size.x+w;const f=l.get(S)??0,b=a.get(S)??y;d.size.y=x.size.y-x.size.height/2+f+b/2+r,_.log.debug(`abc88 layout blocks (calc) px, pyid:${d.id}startingPosX${g}${r}${w}=>x:${d.size.x}y:${d.size.y}${d.widthInColumns}(width * (child?.w || 1)) / 2${m*(d?.widthInColumns??1)/2}`)}d.children&&vt(d,t,r);let I=d?.widthInColumns??1;n>0&&(I=Math.min(I,n-c%n)),c+=I,_.log.debug("abc88 columnsPos",d,c)}}_.log.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}u.__name(vt,"layoutBlocks");function Et(e,{minX:t,minY:r,maxX:n,maxY:s}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:i,y:a,width:l,height:c}=e.size;i-l/2<t&&(t=i-l/2),a-c/2<r&&(r=a-c/2),i+l/2>n&&(n=i+l/2),a+c/2>s&&(s=a+c/2)}if(e.children)for(const i of e.children)({minX:t,minY:r,maxX:n,maxY:s}=Et(i,{minX:t,minY:r,maxX:n,maxY:s}));return{minX:t,minY:r,maxX:n,maxY:s}}u.__name(Et,"findBounds");function jt(e){const t=e.getBlock("root");if(!t)return;const r=v.getConfig2()?.block?.padding??8;st(t,e,0,0,r),vt(t,e,r),_.log.debug("getBlocks",JSON.stringify(t,null,2));const{minX:n,minY:s,maxX:i,maxY:a}=Et(t),l=a-s;return{x:n,y:s,width:i-n,height:l}}u.__name(jt,"layout");var Y=u.__name(async(e,t,r,n=!1,s=!1)=>{let i=t||"";typeof i=="object"&&(i=i[0]);const a=v.getConfig2(),l=v.getEffectiveHtmlLabels(a);return await Lt.createText(e,i,{style:r,isTitle:n,useHtmlLabels:l,markdown:!1,isNode:s,width:Number.POSITIVE_INFINITY},a)},"createLabel"),Be=u.__name((e,t,r,n,s)=>{t.arrowTypeStart&&Ot(e,"start",t.arrowTypeStart,r,n,s),t.arrowTypeEnd&&Ot(e,"end",t.arrowTypeEnd,r,n,s)},"addEdgeMarkers"),Oe={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Ot=u.__name((e,t,r,n,s,i)=>{const a=Oe[r];if(!a){_.log.warn(`Unknown arrow type: ${r}`);return}const l=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${n}#${s}_${i}-${a}${l})`)},"addEdgeMarker"),wt={},A={},Re=u.__name(async(e,t)=>{const r=v.getConfig2(),n=v.getEffectiveHtmlLabels(r),s=e.insert("g").attr("class","edgeLabel"),i=s.insert("g").attr("class","label"),a=t.labelType==="markdown",l=await Lt.createText(e,t.label,{style:t.labelStyle,useHtmlLabels:n,addSvgBackground:a,isNode:!1,markdown:a,width:a?void 0:Number.POSITIVE_INFINITY},r);i.node().appendChild(l);let c=l.getBBox(),g=c;if(n){const d=l.children[0],x=_.select_default(l);c=d.getBoundingClientRect(),g=c,x.attr("width",c.width),x.attr("height",c.height)}else{const d=_.select_default(l).select("text").node();d&&typeof d.getBBox=="function"&&(g=d.getBBox())}i.attr("transform",G.computeLabelTransform(g,n)),wt[t.id]=s,t.width=c.width,t.height=c.height;let o;if(t.startLabelLeft){const d=e.insert("g").attr("class","edgeTerminals"),x=d.insert("g").attr("class","inner"),m=await Y(x,t.startLabelLeft,t.labelStyle);o=m;let y=m.getBBox();if(n){const k=m.children[0],S=_.select_default(m);y=k.getBoundingClientRect(),S.attr("width",y.width),S.attr("height",y.height)}x.attr("transform",G.computeLabelTransform(y,n)),A[t.id]||(A[t.id]={}),A[t.id].startLeft=d,J(o,t.startLabelLeft)}if(t.startLabelRight){const d=e.insert("g").attr("class","edgeTerminals"),x=d.insert("g").attr("class","inner"),m=await Y(x,t.startLabelRight,t.labelStyle);o=m;let y=m.getBBox();if(n){const k=m.children[0],S=_.select_default(m);y=k.getBoundingClientRect(),S.attr("width",y.width),S.attr("height",y.height)}x.attr("transform",G.computeLabelTransform(y,n)),A[t.id]||(A[t.id]={}),A[t.id].startRight=d,J(o,t.startLabelRight)}if(t.endLabelLeft){const d=e.insert("g").attr("class","edgeTerminals"),x=d.insert("g").attr("class","inner"),m=await Y(d,t.endLabelLeft,t.labelStyle);o=m;let y=m.getBBox();if(n){const k=m.children[0],S=_.select_default(m);y=k.getBoundingClientRect(),S.attr("width",y.width),S.attr("height",y.height)}x.attr("transform",G.computeLabelTransform(y,n)),A[t.id]||(A[t.id]={}),A[t.id].endLeft=d,J(o,t.endLabelLeft)}if(t.endLabelRight){const d=e.insert("g").attr("class","edgeTerminals"),x=d.insert("g").attr("class","inner"),m=await Y(d,t.endLabelRight,t.labelStyle);o=m;let y=m.getBBox();if(n){const k=m.children[0],S=_.select_default(m);y=k.getBoundingClientRect(),S.attr("width",y.width),S.attr("height",y.height)}x.attr("transform",G.computeLabelTransform(y,n)),A[t.id]||(A[t.id]={}),A[t.id].endRight=d,J(o,t.endLabelRight)}return l},"insertEdgeLabel");function J(e,t){v.getEffectiveHtmlLabels(v.getConfig2())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}u.__name(J,"setTerminalWidth");var Ae=u.__name((e,t)=>{_.log.debug("Moving label abc88 ",e.id,e.label,wt[e.id],t);let r=t.updatedPath?t.updatedPath:t.originalPath;const{subGraphTitleTotalMargin:n}=Ft.getSubGraphTitleMargins(v.getConfig2());if(e.label){const s=wt[e.id];let i=e.x,a=e.y;if(r){const l=D.utils_default.calcLabelPosition(r);_.log.debug("Moving label "+e.label+" from (",i,",",a,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(i=l.x,a=l.y)}s.attr("transform",`translate(${i}, ${a+n/2})`)}if(e.startLabelLeft){const s=A[e.id].startLeft;let i=e.x,a=e.y;if(r){const l=D.utils_default.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);i=l.x,a=l.y}s.attr("transform",`translate(${i}, ${a})`)}if(e.startLabelRight){const s=A[e.id].startRight;let i=e.x,a=e.y;if(r){const l=D.utils_default.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);i=l.x,a=l.y}s.attr("transform",`translate(${i}, ${a})`)}if(e.endLabelLeft){const s=A[e.id].endLeft;let i=e.x,a=e.y;if(r){const l=D.utils_default.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);i=l.x,a=l.y}s.attr("transform",`translate(${i}, ${a})`)}if(e.endLabelRight){const s=A[e.id].endRight;let i=e.x,a=e.y;if(r){const l=D.utils_default.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);i=l.x,a=l.y}s.attr("transform",`translate(${i}, ${a})`)}},"positionEdgeLabel"),ze=u.__name((e,t)=>{const r=e.x,n=e.y,s=Math.abs(t.x-r),i=Math.abs(t.y-n),a=e.width/2,l=e.height/2;return s>=a||i>=l},"outsideNode"),Me=u.__name((e,t,r)=>{_.log.debug(`intersection calc abc89: outsidePoint: ${JSON.stringify(t)} insidePoint : ${JSON.stringify(r)} node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const n=e.x,s=e.y,i=Math.abs(n-r.x),a=e.width/2;let l=r.x<t.x?a-i:a+i;const c=e.height/2,g=Math.abs(t.y-r.y),o=Math.abs(t.x-r.x);if(Math.abs(s-t.y)*a>Math.abs(n-t.x)*c){let d=r.y<t.y?t.y-c-s:s-c-t.y;l=o*d/g;const x={x:r.x<t.x?r.x+l:r.x-o+l,y:r.y<t.y?r.y+g-d:r.y-g+d};return l===0&&(x.x=t.x,x.y=t.y),o===0&&(x.x=t.x),g===0&&(x.y=t.y),_.log.debug(`abc89 topp/bott calc, Q ${g}, q ${d}, R ${o}, r ${l}`,x),x}else{r.x<t.x?l=t.x-a-n:l=n-a-t.x;let d=g*l/o,x=r.x<t.x?r.x+o-l:r.x-o+l,m=r.y<t.y?r.y+d:r.y-d;return _.log.debug(`sides calc abc89, Q ${g}, q ${d}, R ${o}, r ${l}`,{_x:x,_y:m}),l===0&&(x=t.x,m=t.y),o===0&&(x=t.x),g===0&&(m=t.y),{x,y:m}}},"intersection"),Rt=u.__name((e,t)=>{_.log.debug("abc88 cutPathAtIntersect",e,t);let r=[],n=e[0],s=!1;return e.forEach(i=>{if(!ze(t,i)&&!s){const a=Me(t,n