UNPKG

@asyncapi/studio

Version:

One place that allows you to develop an AsyncAPI document, validate it, convert it to the latest version, preview the documentation and visualize the events flow.

62 lines (61 loc) 21.3 kB
"use strict";exports.id=8725,exports.ids=[8725],exports.modules={86720:(e,t,i)=>{i.d(t,{q:()=>r});var n=i(17605),s=i(25329),r=(0,n.eW)((e,t)=>{let i;return"sandbox"===t&&(i=(0,s.Ys)("#i"+e)),("sandbox"===t?(0,s.Ys)(i.nodes()[0].contentDocument.body):(0,s.Ys)("body")).select(`[id="${e}"]`)},"getDiagramElement")},76786:(e,t,i)=>{i.d(t,{j:()=>r});var n=i(51635),s=i(17605),r=(0,s.eW)((e,t,i,r)=>{e.attr("class",i);let{width:c,height:h,x:l,y:d}=o(e,t);(0,n.v2)(e,h,c,r);let g=a(l,d,c,h,t);e.attr("viewBox",g),s.cM.debug(`viewBox configured: ${g} with padding: ${t}`)},"setupViewPortForSVG"),o=(0,s.eW)((e,t)=>{let i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+2*t,height:i.height+2*t,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),a=(0,s.eW)((e,t,i,n,s)=>`${e-s} ${t-s} ${i} ${n}`,"createViewBox")},48725:(e,t,i)=>{i.d(t,{diagram:()=>N});var n=i(86720),s=i(76786),r=i(73043);i(19669),i(88441),i(70116),i(73943),i(65732),i(64890),i(63951);var o=i(51635),a=i(17605),c=i(84770);let h={randomUUID:c.randomUUID},l=new Uint8Array(256),d=l.length,g=[];for(let e=0;e<256;++e)g.push((e+256).toString(16).slice(1));let u=function(e,t,i){if(h.randomUUID&&!t&&!e)return h.randomUUID();let n=(e=e||{}).random??e.rng?.()??(d>l.length-16&&((0,c.randomFillSync)(l),d=0),l.slice(d,d+=16));if(n.length<16)throw Error("Random bytes length must be >= 16");if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){if((i=i||0)<0||i+16>t.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[i+e]=n[e];return t}return function(e,t=0){return(g[e[t+0]]+g[e[t+1]]+g[e[t+2]]+g[e[t+3]]+"-"+g[e[t+4]]+g[e[t+5]]+"-"+g[e[t+6]]+g[e[t+7]]+"-"+g[e[t+8]]+g[e[t+9]]+"-"+g[e[t+10]]+g[e[t+11]]+g[e[t+12]]+g[e[t+13]]+g[e[t+14]]+g[e[t+15]]).toLowerCase()}(n)};var p=i(13177),y=i(12470),m=i(34436),f=function(){var e=(0,a.eW)(function(e,t,i,n){for(i=i||{},n=e.length;n--;i[e[n]]=t);return i},"o"),t=[1,4],i=[1,13],n=[1,12],s=[1,15],r=[1,16],o=[1,20],c=[1,19],h=[6,7,8],l=[1,26],d=[1,24],g=[1,25],u=[6,7,11],p=[1,6,13,15,16,19,22],y=[1,33],m=[1,34],f=[1,6,7,11,13,15,16,19,22],_={trace:(0,a.eW)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:(0,a.eW)(function(e,t,i,n,s,r,o){var a=r.length-1;switch(s){case 6:case 7:return n;case 8:n.getLogger().trace("Stop NL ");break;case 9:n.getLogger().trace("Stop EOF ");break;case 11:n.getLogger().trace("Stop NL2 ");break;case 12:n.getLogger().trace("Stop EOF2 ");break;case 15:n.getLogger().info("Node: ",r[a].id),n.addNode(r[a-1].length,r[a].id,r[a].descr,r[a].type);break;case 16:n.getLogger().trace("Icon: ",r[a]),n.decorateNode({icon:r[a]});break;case 17:case 21:n.decorateNode({class:r[a]});break;case 18:n.getLogger().trace("SPACELIST");break;case 19:n.getLogger().trace("Node: ",r[a].id),n.addNode(0,r[a].id,r[a].descr,r[a].type);break;case 20:n.decorateNode({icon:r[a]});break;case 25:n.getLogger().trace("node found ..",r[a-2]),this.$={id:r[a-1],descr:r[a-1],type:n.getType(r[a-2],r[a])};break;case 26:this.$={id:r[a],descr:r[a],type:n.nodeType.DEFAULT};break;case 27:n.getLogger().trace("node found ..",r[a-3]),this.$={id:r[a-3],descr:r[a-1],type:n.getType(r[a-2],r[a])}}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:t},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:t},{6:i,7:[1,10],9:9,12:11,13:n,14:14,15:s,16:r,17:17,18:18,19:o,22:c},e(h,[2,3]),{1:[2,2]},e(h,[2,4]),e(h,[2,5]),{1:[2,6],6:i,12:21,13:n,14:14,15:s,16:r,17:17,18:18,19:o,22:c},{6:i,9:22,12:11,13:n,14:14,15:s,16:r,17:17,18:18,19:o,22:c},{6:l,7:d,10:23,11:g},e(u,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:o,22:c}),e(u,[2,18]),e(u,[2,19]),e(u,[2,20]),e(u,[2,21]),e(u,[2,23]),e(u,[2,24]),e(u,[2,26],{19:[1,30]}),{20:[1,31]},{6:l,7:d,10:32,11:g},{1:[2,7],6:i,12:21,13:n,14:14,15:s,16:r,17:17,18:18,19:o,22:c},e(p,[2,14],{7:y,11:m}),e(f,[2,8]),e(f,[2,9]),e(f,[2,10]),e(u,[2,15]),e(u,[2,16]),e(u,[2,17]),{20:[1,35]},{21:[1,36]},e(p,[2,13],{7:y,11:m}),e(f,[2,11]),e(f,[2,12]),{21:[1,37]},e(u,[2,25]),e(u,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:(0,a.eW)(function(e,t){if(t.recoverable)this.trace(e);else{var i=Error(e);throw i.hash=t,i}},"parseError"),parse:(0,a.eW)(function(e){var t=this,i=[0],n=[],s=[null],r=[],o=this.table,c="",h=0,l=0,d=0,g=r.slice.call(arguments,1),u=Object.create(this.lexer),p={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(p.yy[y]=this.yy[y]);u.setInput(e,p.yy),p.yy.lexer=u,p.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var m=u.yylloc;r.push(m);var f=u.options&&u.options.ranges;function _(){var e;return"number"!=typeof(e=n.pop()||u.lex()||1)&&(e instanceof Array&&(e=(n=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,a.eW)(function(e){i.length=i.length-2*e,s.length=s.length-e,r.length=r.length-e},"popStack"),(0,a.eW)(_,"lex");for(var E,b,S,N,k,D,L,x,v,O={};;){if(S=i[i.length-1],this.defaultActions[S]?N=this.defaultActions[S]:(null==E&&(E=_()),N=o[S]&&o[S][E]),void 0===N||!N.length||!N[0]){var I="";for(D in v=[],o[S])this.terminals_[D]&&D>2&&v.push("'"+this.terminals_[D]+"'");I=u.showPosition?"Parse error on line "+(h+1)+":\n"+u.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[E]||E)+"'":"Parse error on line "+(h+1)+": Unexpected "+(1==E?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(I,{text:u.match,token:this.terminals_[E]||E,line:u.yylineno,loc:m,expected:v})}if(N[0]instanceof Array&&N.length>1)throw Error("Parse Error: multiple actions possible at state: "+S+", token: "+E);switch(N[0]){case 1:i.push(E),s.push(u.yytext),r.push(u.yylloc),i.push(N[1]),E=null,b?(E=b,b=null):(l=u.yyleng,c=u.yytext,h=u.yylineno,m=u.yylloc,d>0&&d--);break;case 2:if(L=this.productions_[N[1]][1],O.$=s[s.length-L],O._$={first_line:r[r.length-(L||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(L||1)].first_column,last_column:r[r.length-1].last_column},f&&(O._$.range=[r[r.length-(L||1)].range[0],r[r.length-1].range[1]]),void 0!==(k=this.performAction.apply(O,[c,l,h,p.yy,N[1],s,r].concat(g))))return k;L&&(i=i.slice(0,-1*L*2),s=s.slice(0,-1*L),r=r.slice(0,-1*L)),i.push(this.productions_[N[1]][0]),s.push(O.$),r.push(O._$),x=o[i[i.length-2]][i[i.length-1]],i.push(x);break;case 3:return!0}}return!0},"parse")},E={EOF:1,parseError:(0,a.eW)(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},"parseError"),setInput:(0,a.eW)(function(e,t){return this.yy=t||this.yy||{},this._input=e,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,a.eW)(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.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),e},"input"),unput:(0,a.eW)(function(e){var t=e.length,i=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:(0,a.eW)(function(){return this._more=!0,this},"more"),reject:(0,a.eW)(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,a.eW)(function(e){this.unput(this.match.slice(e))},"less"),pastInput:(0,a.eW)(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,a.eW)(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,a.eW)(function(){var e=this.pastInput(),t=Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:(0,a.eW)(function(e,t){var i,n,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(n=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],i=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack)for(var r in s)this[r]=s[r];return!1},"test_match"),next:(0,a.eW)(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var e,t,i,n,s=this._currentRules(),r=0;r<s.length;r++)if((i=this._input.match(this.rules[s[r]]))&&(!t||i[0].length>t[0].length)){if(t=i,n=r,this.options.backtrack_lexer){if(!1!==(e=this.test_match(i,s[r])))return e;if(!this._backtrack)return!1;t=!1;continue}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,s[n]))&&e:""===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,a.eW)(function(){return this.next()||this.lex()},"lex"),begin:(0,a.eW)(function(e){this.conditionStack.push(e)},"begin"),popState:(0,a.eW)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,a.eW)(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,a.eW)(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:(0,a.eW)(function(e){this.begin(e)},"pushState"),stateStackSize:(0,a.eW)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,a.eW)(function(e,t,i,n){switch(i){case 0:return e.getLogger().trace("Found comment",t.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:case 23:case 26:this.popState();break;case 5:e.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return e.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:e.getLogger().trace("end icon"),this.popState();break;case 10:return e.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return e.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return e.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return e.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:case 15:case 16:case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 24:e.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return e.getLogger().trace("description:",t.yytext),"NODE_DESCR";case 27:return this.popState(),e.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),e.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),e.getLogger().trace("node end ...",t.yytext),"NODE_DEND";case 30:case 33:case 34:return this.popState(),e.getLogger().trace("node end (("),"NODE_DEND";case 31:case 32:return this.popState(),e.getLogger().trace("node end (-"),"NODE_DEND";case 35:case 36:return e.getLogger().trace("Long description:",t.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};function b(){this.yy={}}return _.lexer=E,(0,a.eW)(b,"Parser"),b.prototype=_,_.Parser=b,new b}();f.parser=f;var _={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},E=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=_,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}static{(0,a.eW)(this,"MindmapDB")}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let t=this.nodes.length-1;t>=0;t--)if(this.nodes[t].level<e)return this.nodes[t];return null}getMindmap(){return this.nodes.length>0?this.nodes[0]:null}addNode(e,t,i,n){a.cM.info("addNode",e,t,i,n);let s=!1;0===this.nodes.length?(this.baseLevel=e,e=0,s=!0):void 0!==this.baseLevel&&(e-=this.baseLevel,s=!1);let r=(0,o.nV)(),c=r.mindmap?.padding??o.vZ.mindmap.padding;switch(n){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:c*=2}let h={id:this.count++,nodeId:(0,o.oO)(t,r),level:e,descr:(0,o.oO)(i,r),type:n,children:[],width:r.mindmap?.maxNodeWidth??o.vZ.mindmap.maxNodeWidth,padding:c,isRoot:s},l=this.getParent(e);if(l)l.children.push(h),this.nodes.push(h);else if(s)this.nodes.push(h);else throw Error(`There can be only one root. No parent could be found for ("${h.descr}")`)}getType(e,t){switch(a.cM.debug("In get type",e,t),e){case"[":return this.nodeType.RECT;case"(":return")"===t?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,t){this.elements[e]=t}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;let t=(0,o.nV)(),i=this.nodes[this.nodes.length-1];e.icon&&(i.icon=(0,o.oO)(e.icon,t)),e.class&&(i.class=(0,o.oO)(e.class,t))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,t){if(0===e.level?e.section=void 0:e.section=t,e.children)for(let[i,n]of e.children.entries()){let s=0===e.level?i%11:t;this.assignSections(n,s)}}flattenNodes(e,t){let i=["mindmap-node"];!0===e.isRoot?i.push("section-root","section--1"):void 0!==e.section&&i.push(`section-${e.section}`),e.class&&i.push(e.class);let n=i.join(" "),s=(0,a.eW)(e=>{switch(e){case _.CIRCLE:return"mindmapCircle";case _.RECT:return"rect";case _.ROUNDED_RECT:return"rounded";case _.CLOUD:return"cloud";case _.BANG:return"bang";case _.HEXAGON:return"hexagon";case _.DEFAULT:return"defaultMindmapNode";case _.NO_BORDER:default:return"rect"}},"getShapeFromType"),r={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:s(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:n,cssStyles:[],look:"default",icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(t.push(r),e.children)for(let i of e.children)this.flattenNodes(i,t)}generateEdges(e,t){if(e.children)for(let i of e.children){let n="edge";void 0!==i.section&&(n+=` section-edge-${i.section}`);let s=e.level+1;n+=` edge-depth-${s}`;let r={id:`edge_${e.id}_${i.id}`,start:e.id.toString(),end:i.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:"default",classes:n,depth:e.level,section:i.section};t.push(r),this.generateEdges(i,t)}}getData(){let e=this.getMindmap(),t=(0,o.nV)();if(void 0!==(0,o.qO)().layout||(t.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:t};a.cM.debug("getData: mindmapRoot",e,t),this.assignSections(e);let i=[],n=[];this.flattenNodes(e,i),this.generateEdges(e,n),a.cM.debug(`getData: processed ${i.length} nodes and ${n.length} edges`);let s=new Map;for(let e of i)s.set(e.id,{shape:e.shape,width:e.width,height:e.height,padding:e.padding});return{nodes:i,edges:n,config:t,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(s),type:"mindmap",diagramId:"mindmap-"+u()}}getLogger(){return a.cM}},b=(0,a.eW)(async(e,t,i,c)=>{a.cM.debug("Rendering mindmap diagram\n"+e);let h=c.db,l=h.getData(),d=(0,n.q)(t,l.config.securityLevel);l.type=c.type,l.layoutAlgorithm=(0,r._b)(l.config.layout,{fallback:"cose-bilkent"}),l.diagramId=t,h.getMindmap()&&(l.nodes.forEach(e=>{"rounded"===e.shape?(e.radius=15,e.taper=15,e.stroke="none",e.width=0,e.padding=15):"circle"===e.shape?e.padding=10:"rect"===e.shape&&(e.width=0,e.padding=10)}),await (0,r.sY)(l,d),(0,s.j)(d,l.config.mindmap?.padding??o.vZ.mindmap.padding,"mindmapDiagram",l.config.mindmap?.useMaxWidth??o.vZ.mindmap.useMaxWidth))},"draw"),S=(0,a.eW)(e=>{let t="";for(let t=0;t<e.THEME_COLOR_LIMIT;t++)e["lineColor"+t]=e["lineColor"+t]||e["cScaleInv"+t],(0,p.Z)(e["lineColor"+t])?e["lineColor"+t]=(0,y.Z)(e["lineColor"+t],20):e["lineColor"+t]=(0,m.Z)(e["lineColor"+t],20);for(let i=0;i<e.THEME_COLOR_LIMIT;i++){let n=""+(17-3*i);t+=` .section-${i-1} rect, .section-${i-1} path, .section-${i-1} circle, .section-${i-1} polygon, .section-${i-1} path { fill: ${e["cScale"+i]}; } .section-${i-1} text { fill: ${e["cScaleLabel"+i]}; } .node-icon-${i-1} { font-size: 40px; color: ${e["cScaleLabel"+i]}; } .section-edge-${i-1}{ stroke: ${e["cScale"+i]}; } .edge-depth-${i-1}{ stroke-width: ${n}; } .section-${i-1} line { stroke: ${e["cScaleInv"+i]} ; stroke-width: 3; } .disabled, .disabled circle, .disabled text { fill: lightgray; } .disabled text { fill: #efefef; } `}return t},"genSections"),N={get db(){return new E},renderer:{draw:b},parser:f,styles:(0,a.eW)(e=>` .edge { stroke-width: 3; } ${S(e)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${e.git0}; } .section-root text { fill: ${e.gitBranchLabel0}; } .section-root span { color: ${e.gitBranchLabel0}; } .section-2 span { color: ${e.gitBranchLabel0}; } .icon-container { height:100%; display: flex; justify-content: center; align-items: center; } .edge { fill: none; } .mindmap-node-label { dy: 1em; alignment-baseline: middle; text-anchor: middle; dominant-baseline: middle; text-align: center; } `,"getStyles")}}};