md/static/js/md-flowDiagram-7ASYPVHJ-D2L0sNan.js

161 lines
56 KiB
JavaScript
Raw Normal View History

import{g as gt,s as At}from"./md-chunk-5HRBRIJM-DIfJDOBU.js";import{d as U1,_ as l,n as Ze,o as bt,s as kt,g as mt,b as Et,c as St,p as Dt,q as xt,r as Ct,J as Tt,t as yt,l as e1,u as ge,v as Ft,x as vt,j as C1,y as _t,z as Bt,e as Vt,A as Lt}from"./md-index-TGP-egEp.js";import{c as wt}from"./md-channel-Dlq_AjKA.js";var It="flowchart-",$e=0,M1=U1(),b1=new Map,K=[],K1=new Map,p1=[],Ae=new Map,be=new Map,ee=0,pe=!0,J,se,re=[],ie=l(e=>Vt.sanitizeText(e,M1),"sanitizeText"),ae=l(function(e){for(const r of b1.values())if(r.id===e)return r.domId;return e},"lookUpDomId"),Rt=l(function(e,r,i,a,u,d,g={},D){var v,z;if(!e||e.trim().length===0)return;let c,o=b1.get(e);if(o===void 0&&(o={id:e,labelType:"text",domId:It+e+"-"+$e,styles:[],classes:[]},b1.set(e,o)),$e++,r!==void 0?(M1=U1(),c=ie(r.text.trim()),o.labelType=r.type,c.startsWith('"')&&c.endsWith('"')&&(c=c.substring(1,c.length-1)),o.text=c):o.text===void 0&&(o.text=e),i!==void 0&&(o.type=i),a!=null&&a.forEach(function(_){o.styles.push(_)}),u!=null&&u.forEach(function(_){o.classes.push(_)}),d!==void 0&&(o.dir=d),o.props===void 0?o.props=g:g!==void 0&&Object.assign(o.props,g),D!==void 0){let _;D.includes(`
`)?_=D+`
`:_=`{
`+D+`
}`;const h=Ct(_,{schema:Tt});if(h.shape){if(h.shape!==h.shape.toLowerCase()||h.shape.includes("_"))throw new Error(`No such shape: ${h.shape}. Shape names should be lowercase.`);if(!yt(h.shape))throw new Error(`No such shape: ${h.shape}.`);o.type=h==null?void 0:h.shape}h!=null&&h.label&&(o.text=h==null?void 0:h.label),h!=null&&h.icon&&(o.icon=h==null?void 0:h.icon,!((v=h.label)!=null&&v.trim())&&o.text===e&&(o.text="")),h!=null&&h.form&&(o.form=h==null?void 0:h.form),h!=null&&h.pos&&(o.pos=h==null?void 0:h.pos),h!=null&&h.img&&(o.img=h==null?void 0:h.img,!((z=h.label)!=null&&z.trim())&&o.text===e&&(o.text="")),h!=null&&h.constraint&&(o.constraint=h.constraint),h.w&&(o.assetWidth=Number(h.w)),h.h&&(o.assetHeight=Number(h.h))}},"addVertex"),Nt=l(function(e,r,i){const d={start:e,end:r,type:void 0,text:"",labelType:"text"};e1.info("abc78 Got edge...",d);const g=i.text;if(g!==void 0&&(d.text=ie(g.text.trim()),d.text.startsWith('"')&&d.text.endsWith('"')&&(d.text=d.text.substring(1,d.text.length-1)),d.labelType=g.type),i!==void 0&&(d.type=i.type,d.stroke=i.stroke,d.length=i.length>10?10:i.length),K.length<(M1.maxEdges??500))e1.info("Pushing edge..."),K.push(d);else throw new Error(`Edge limit exceeded. ${K.length} edges found, but the limit is ${M1.maxEdges}.
Initialize mermaid with maxEdges set to a higher number to allow more edges.
You cannot set this config via configuration inside the diagram as it is a secure config.
You have to call mermaid.initialize.`)},"addSingleLink"),Pt=l(function(e,r,i){e1.info("addLink",e,r,i);for(const a of e)for(const u of r)Nt(a,u,i)},"addLink"),Ot=l(function(e,r){e.forEach(function(i){i==="default"?K.defaultInterpolate=r:K[i].interpolate=r})},"updateLinkInterpolate"),Gt=l(function(e,r){e.forEach(function(i){var a,u,d,g,D,c;if(typeof i=="number"&&i>=K.length)throw new Error(`The index ${i} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${K.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);i==="default"?K.defaultStyle=r:(K[i].style=r,(((u=(a=K[i])==null?void 0:a.style)==null?void 0:u.length)??0)>0&&!((g=(d=K[i])==null?void 0:d.style)!=null&&g.some(o=>o==null?void 0:o.startsWith("fill")))&&((c=(D=K[i])==null?void 0:D.style)==null||c.push("fill:none")))})},"updateLink"),Mt=l(function(e,r){e.split(",").forEach(function(i){let a=K1.get(i);a===void 0&&(a={id:i,styles:[],textStyles:[]},K1.set(i,a)),r!=null&&r.forEach(function(u){if(/color/.exec(u)){const d=u.replace("fill","bgFill");a.textStyles.push(d)}a.styles.push(u)})})},"addClass"),Ut=l(function(e){J=e,/.*</.exec(J)&&(J="RL"),/.*\^/.exec(J)&&(J="BT"),/.*>/.exec(J)&&(J="LR"),/.*v/.exec(J)&&(J="TB"),J==="TD"&&(J="TB")},"setDirection"),ke=l(function(e,r){for(const i of e.split(",")){const a=b1.get(i);a&&a.classes.push(r);const u=Ae.get(i);u&&u.classes.push(r)}},"setClass"),Wt=l(function(e,r){if(r!==void 0){r=ie(r);for(const i of e.split(","))be.set(se==="gen-1"?ae(i):i,r)}},"setTooltip"),zt=l(function(e,r,i){const a=ae(e);if(U1().securityLevel!=="loose"||r===void 0)return;let u=[];if(typeof i=="string"){u=i.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let g=0;g<u.length;g++){let D=u[g].trim();D.startsWith('"')&&D.endsWith('"')&&(D=D.substr(1,D.length-2)),u[g]=D}}u.length===0&&u.push(e);const d=b1.get(e);d&&(d.haveCallback=!0,re.push(function(){const g=document.querySelector(`[id="${a}"]`);g!==null&&g.addEventListener("click",function(){ge.runFunc(r,...u)},!1)}))},"setClickFun"),jt=l(function(e,r,i){e.split(",").forEach(function(a){const u=b1.get(a);u!==void 0&&(u.link=ge.formatUrl(r,M1),u.linkTarget=i)}),ke(e,"clickable")},"setLink"),et=l(function(e){return be.get(e)},"getTooltip"),Kt=l(function(e,r,i){e.split(",").forEach(function(a){zt(a,r,i)}),ke(e,"clickable")},"setClickEvent"),Yt=l(function(e){re.forEach(function(r){r(e)})},"bindFunctions"),tt=l(function(){return J.trim()},"getDirection"),st=l(function(){return b1},"getVertices"),rt=l(function(){return K},"getEdges"),qt=l(function(){return K1},"getClasses"),it=l(function(e){let r=C1(".mermaidTooltip");(r._groups||r)[0][0]===null&&(r=C1("body").append("div").attr("class","mermaidTooltip").style("opacity",0)),C1(e).select("svg").selectAll("g.node").on("mouseover",function(){const u=C1(this);if(u.attr("title")===null)return;const g=this==null?void 0:this.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(u.attr("title")).style("left",window.scrollX+g.left+(g.right-g.left)/2+"px").style("top",window.scrollY+g.bottom+"px"),r.html(r.html().replace(/&lt;br\/&gt;/g,"<br/>")),u.classed("hover",!0)}).on("mouseout",function(){r.transition().duration(500).style("opacity",0),C1(this).classed("hover",!1)})},"setupToolTips");re.push(it);var Ht=l(function(e="gen-1"){b1=new Map,K1=new Map,K=[],re=[it],p1=[],Ae=new Map,ee=0,be=new Map,pe=!0,se=e,M1=U1(),Ft()},"clear"),Xt=l(e=>{se=e||"gen-2"},"setGen"),Qt=l(function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"},"defaultStyle"),Jt=l(function(e,r,i){let a=e.text.trim(),u=i.text;e===i&&/\s/.exec(i.text)&&(a=void 0);function d(o){const v={boolean:{},number:{},string:{}},z=[];let _;return{nodeList:o.filter(function(b){const x=typeof b;return b.stmt&&b.stmt==="dir"?(_=b.value,!1):b.trim()===""?!1:x in v?v[x].hasOwnProperty(b)?!1:v[x][b]=!0:z.includes(b)?!1:z.push(b)}),dir:_}}l(d,"uniq");const{nodeList:g,dir:D}=d(r.flat());if(se==="gen-1")for(let o=0;o<g.length;o++)g[o]=ae(g[o]);a=a??"subGraph"+ee,u=u||"",u=ie(u),ee=ee+1;const c={id:a,n
`+G.showPosition()+`
Expecting `+$1.join(", ")+", got '"+(this.terminals_[j]||j)+"'":he="Parse error on line "+(X+1)+": Unexpected "+(j==Xe?"end of input":"'"+(this.terminals_[j]||j)+"'"),this.parseError(he,{text:G.match,token:this.terminals_[j]||j,line:G.yylineno,loc:oe,expected:$1})}if(Q[0]instanceof Array&&Q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x1+", token: "+j);switch(Q[0]){case 1:A.push(j),y.push(G.yytext),t.push(G.yylloc),A.push(Q[1]),j=null,He=G.yyleng,s=G.yytext,X=G.yylineno,oe=G.yylloc;break;case 2:if(d1=this.productions_[Q[1]][1],G1.$=y[y.length-d1],G1._$={first_line:t[t.length-(d1||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(d1||1)].first_column,last_column:t[t.length-1].last_column},pt&&(G1._$.range=[t[t.length-(d1||1)].range[0],t[t.length-1].range[1]]),ce=this.performAction.apply(G1,[s,He,X,D1.yy,Q[1],y,t].concat(dt)),typeof ce<"u")return ce;d1&&(A=A.slice(0,-1*d1*2),y=y.slice(0,-1*d1),t=t.slice(0,-1*d1)),A.push(this.productions_[Q[1]][0]),y.push(G1.$),t.push(G1._$),Je=z1[A[A.length-2]][A[A.length-1]],A.push(Je);break;case 3:return!0}}return!0},"parse")},ct=function(){var A1={EOF:1,parseError:l(function(f,A){if(this.yy.parser)this.yy.parser.parseError(f,A);else throw new Error(f)},"parseError"),setInput:l(function(p,f){return this.yy=f||this.yy||{},this._input=p,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:l(function(){var p=this._input[0];this.yytext+=p,this.yyleng++,this.offset++,this.match+=p,this.matched+=p;var f=p.match(/(?:\r\n?|\n).*/g);return f?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),p},"input"),unput:l(function(p){var f=p.length,A=p.split(/(?:\r\n?|\n)/g);this._input=p+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-f),this.offset-=f;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),A.length-1&&(this.yylineno-=A.length-1);var y=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:A?(A.length===n.length?this.yylloc.first_column:0)+n[n.length-A.length].length-A[0].length:this.yylloc.first_column-f},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-f]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(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:l(function(p){this.unput(this.match.slice(p))},"less"),pastInput:l(function(){var p=this.matched.substr(0,this.matched.length-this.match.length);return(p.length>20?"...":"")+p.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var p=this.match;return p.length<20&&(p+=this._input.substr(0,20-p.length)),(p.substr(0,20)+(p.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var p=this.pastInput(),f=new Array(p.length+1).join("-");return p+this.upcomingInput()+`
`+f+"^"},"showPosition"),test_match:l(function(p,f){var A,n,y;if(this.options.backtrack_lexer&&(y={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&&(y.yylloc.range=this.yylloc.range.slice(0))),n=p[0].match(/(?:\r\n?|\n).*/g),n&&(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+p[0].length},this.yytext+=p[0],this.match+=p[0],this.matches=p,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(p[0].length),this.matched+=p[0],A=this.performAction.call(this,this.yy,this,f,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),A)return A;if(this._backtrack){for(var t in y)this[t]=y[t];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var p,f,A,n;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),t=0;t<y.length;t++)if(A=this._input.match(this.rules[y[t]]),A&&(!f||A[0].length>f[0].length)){if(f=A,n=t,this.options.backtrack_lexer){if(p=this.test_match(A,y[t]),p!==!1)return p;if(this._backtrack){f=!1;continue}else return!1}else if(!this.options.flex)break}return f?(p=this.test_match(f,y[n]),p!==!1?p:!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:l(function(){var f=this.next();return f||this.lex()},"lex"),begin:l(function(f){this.conditionStack.push(f)},"begin"),popState:l(function(){var f=this.conditionStack.length-1;return f>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(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:l(function(f){return f=this.conditionStack.length-1-Math.abs(f||0),f>=0?this.conditionStack[f]:"INITIAL"},"topState"),pushState:l(function(f){this.begin(f)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:l(function(f,A,n,y){switch(n){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),A.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const t=/\n\s*/g;return A.yytext=A.yytext.replace(t,"<br/>"),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 94;case 17:this.popState();break;case 18:return 95;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 83;case 26:return 101;case 27:return 84;case 28:return 103;case 29:return 85;case 30:return 86;case 31:return 96;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 87;case 35:return f.lex.firstGraph()&&this.begin("dir"),12;case 36:return f.lex.firstGraph()&&this.begin("dir"),12;case 37:return f.lex.firstGraph()&&this.begin("dir"),12;case 38:return 27;case 39:return 32;case 40:return 97;case 41:return 97;case 42:return 97;case 43:return 97;case 44:return this.popState(),13;case 45:return this.popState(),14;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return 120;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 104;case 60:return 110;case 61:return 46;case 62:return 60;case 63:return 44;case 64:return 8;case 65:return 105;case 66:return 114;case 67:return this.popState(),77;case 68:return this.pushState("edgeText"),75;case 69:return 118;case 70:return this.popState(),77;case 71:return this.pushState("thickEdgeText"),75;case 72:return 118;case 73:return this.popState(),77;case 74:return this.pushState("dottedEdgeText"),75;case 75:return 118;case 76:return 77;case 77:return this.popState(),53;case 78:return"TEXT";case 79:return this.pushState("ellipseText"),52;case 80:return this.popState(),55;case 81:return this.pushState("text"),54;case 82:return this.popState(),57;case 83:return this.pushState("text"),56;case 84:return 58;case 85:return this.pushState("text"),67;case 86:return this.popState(),64;case 87:return this.pushState("text"),63;case 88:return this.popState(),49;case 89:return this.pushState("text"),48;case 90:return this.popState(),69;case 91:return this.popState(),71;case 92:return 116;case 93:return this.pushState("trapText"),68;case 94:return this.pushState("trapText"),70;case 95:return 117;case 96:return 67;case 97:return 89;case 98:return"SEP";case 99:return 88;case 100:return 114;case 101:return 110;case 102:return 44;case 103:return 108;case 104:return 113;case 105:return 115;case 106:return this.popState(),62;case
font-family: ${e.fontFamily};
color: ${e.nodeTextColor||e.textColor};
}
.cluster-label text {
fill: ${e.titleColor};
}
.cluster-label span {
color: ${e.titleColor};
}
.cluster-label span p {
background-color: transparent;
}
.label text,span {
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;
}
.rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {
text-anchor: middle;
}
// .flowchart-label .text-outer-tspan {
// text-anchor: middle;
// }
// .flowchart-label .text-inner-tspan {
// text-anchor: start;
// }
.node .katex path {
fill: #000;
stroke: #000;
stroke-width: 1px;
}
.rough-node .label,.node .label, .image-shape .label, .icon-shape .label {
text-align: center;
}
.node.clickable {
cursor: pointer;
}
.root .anchor path {
fill: ${e.lineColor} !important;
stroke-width: 0;
stroke: ${e.lineColor};
}
.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};
p {
background-color: ${e.edgeLabelBackground};
}
rect {
opacity: 0.5;
background-color: ${e.edgeLabelBackground};
fill: ${e.edgeLabelBackground};
}
text-align: center;
}
/* For html labels only */
.labelBkg {
background-color: ${As(e.edgeLabelBackground,.5)};
// background-color:
}
.cluster rect {
fill: ${e.clusterBkg};
stroke: ${e.clusterBorder};
stroke-width: 1px;
}
.cluster text {
fill: ${e.titleColor};
}
.cluster span {
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};
}
rect.text {
fill: none;
stroke-width: 0;
}
.icon-shape, .image-shape {
background-color: ${e.edgeLabelBackground};
p {
background-color: ${e.edgeLabelBackground};
padding: 2px;
}
rect {
opacity: 0.5;
background-color: ${e.edgeLabelBackground};
fill: ${e.edgeLabelBackground};
}
text-align: center;
}
`,"getStyles"),ks=bs,Ds={parser:gs,db:de,renderer:fs,styles:ks,init:l(e=>{e.flowchart||(e.flowchart={}),e.layout&&Ze({layout:e.layout}),e.flowchart.arrowMarkerAbsolute=e.arrowMarkerAbsolute,Ze({flowchart:{arrowMarkerAbsolute:e.arrowMarkerAbsolute}}),de.clear(),de.setGen("gen-2")},"init")};export{Ds as diagram};