You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
14 KiB
JavaScript

9 months ago
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9480],{79480:function(e,t,a){a.d(t,{diagram:function(){return S}});var r=a(9490),n=a(36783),o=a(33549),l=a(51893),i=a(97908);a(89539),a(99824),a(68985);let s=(e,t,a)=>{let{parentById:r}=a,n=new Set,o=e;for(;o;){if(n.add(o),o===t)return o;o=r[o]}for(o=t;o;){if(n.has(o))return o;o=r[o]}return"root"},c=new i,d={},h={},p={},u=async function(e,t,a,r,n,i,s){let c=a.select('[id="'.concat(t,'"]')).insert("g").attr("class","nodes"),d=Object.keys(e);return await Promise.all(d.map(async function(t){let a,s;let d=e[t],h="default";d.classes.length>0&&(h=d.classes.join(" ")),h+=" flowchart-label";let u=(0,l.k)(d.styles),b=void 0!==d.text?d.text:d.id,g={width:0,height:0},y=[{id:d.id+"-west",layoutOptions:{"port.side":"WEST"}},{id:d.id+"-east",layoutOptions:{"port.side":"EAST"}},{id:d.id+"-south",layoutOptions:{"port.side":"SOUTH"}},{id:d.id+"-north",layoutOptions:{"port.side":"NORTH"}}],w=0,k="",f={};switch(d.type){case"round":w=5,k="rect";break;case"square":case"group":default:k="rect";break;case"diamond":k="question",f={portConstraints:"FIXED_SIDE"};break;case"hexagon":k="hexagon";break;case"odd":case"odd_right":k="rect_left_inv_arrow";break;case"lean_right":k="lean_right";break;case"lean_left":k="lean_left";break;case"trapezoid":k="trapezoid";break;case"inv_trapezoid":k="inv_trapezoid";break;case"circle":k="circle";break;case"ellipse":k="ellipse";break;case"stadium":k="stadium";break;case"subroutine":k="subroutine";break;case"cylinder":k="cylinder";break;case"doublecircle":k="doublecircle"}let x={labelStyle:u.labelStyle,shape:k,labelText:b,labelType:d.labelType,rx:w,ry:w,class:h,style:u.style,id:d.id,link:d.link,linkTarget:d.linkTarget,tooltip:n.db.getTooltip(d.id)||"",domId:n.db.lookUpDomId(d.id),haveCallback:d.haveCallback,width:"group"===d.type?500:void 0,dir:d.dir,type:d.type,props:d.props,padding:(0,l.E)().flowchart.padding};if("group"!==x.type)a=(s=await (0,o.e)(c,x,d.dir)).node().getBBox();else{r.createElementNS("http://www.w3.org/2000/svg","text");let{shapeSvg:e,bbox:t}=await (0,o.l)(c,x,void 0,!0);g.width=t.width,g.wrappingWidth=(0,l.E)().flowchart.wrappingWidth,g.height=t.height,g.labelNode=e.node(),x.labelData=g}let m={id:d.id,ports:"diamond"===d.type?y:[],layoutOptions:f,labelText:b,labelData:g,domId:n.db.lookUpDomId(d.id),width:null==a?void 0:a.width,height:null==a?void 0:a.height,type:d.type,el:s,parent:i.parentById[d.id]};p[x.id]=m})),s},b=(e,t,a)=>{let r={TB:{in:{north:"north"},out:{south:"west",west:"east",east:"south"}},LR:{in:{west:"west"},out:{east:"south",south:"north",north:"east"}},RL:{in:{east:"east"},out:{west:"north",north:"south",south:"west"}},BT:{in:{south:"south"},out:{north:"east",east:"west",west:"north"}}};return r.TD=r.TB,l.l.info("abc88",a,t,e),r[a][t][e]},g=(e,t,a)=>{if(l.l.info("getNextPort abc88",{node:e,edgeDirection:t,graphDirection:a}),!d[e])switch(a){case"TB":case"TD":d[e]={inPosition:"north",outPosition:"south"};break;case"BT":d[e]={inPosition:"south",outPosition:"north"};break;case"RL":d[e]={inPosition:"east",outPosition:"west"};break;case"LR":d[e]={inPosition:"west",outPosition:"east"}}let r="in"===t?d[e].inPosition:d[e].outPosition;return"in"===t?d[e].inPosition=b(d[e].inPosition,t,a):d[e].outPosition=b(d[e].outPosition,t,a),r},y=(e,t)=>{let a=e.start,r=e.end,n=a,o=r,l=p[a],i=p[r];return l&&i?("diamond"===l.type&&(a="".concat(a,"-").concat(g(a,"out",t))),"diamond"===i.type&&(r="".concat(r,"-").concat(g(r,"in",t))),{source:a,target:r,sourceId:n,targetId:o}):{source:a,target:r}},w=function(e,t,a,r){let i,s;l.l.info("abc78 edges = ",e);let c=r.insert("g").attr("class","edgeLabels"),d={},p=t.db.getDirection();if(void 0!==e.defaultStyle){let t=(0,l.k)(e.defaultStyle);i=t.style,s=t.labelStyle}return e.forEach(function(t){let r="L-"+t.start+"-"+t.end;void 0===d[r]?d[r]=0:d[r]++,l.l.info("abc78 new entry",r,d[r]);let u=r+"-"+d[r];l.l.info("abc78 new link id to be used is",r,u,d[r]);let b="LS-"+t.start,g="LE-"+t.end,w={style:"",labelStyle:""};switch(w.minlen=t.length||1,"arrow_open"===t.type?w.arrowhead="none":w.arrowhead="nor