//   // stroke:black;
  // }

  .flowchart-label text {
    text-anchor: middle;
  }

  ${EGe(i)}
`}},Symbol.toStringTag,{value:"Module"}));var xgt=function(){var i=function(it,et,st,pt){for(st=st||{},pt=it.length;pt--;st[it[pt]]=et);return st},a=[1,2],f=[1,5],p=[6,9,11,17,18,20,22,23,26,27,28],v=[1,15],m=[1,16],b=[1,17],E=[1,18],C=[1,19],D=[1,23],N=[1,24],B=[1,27],j=[4,6,9,11,17,18,20,22,23,26,27,28],R={trace:function(){},yy:{},symbols_:{error:2,start:3,timeline:4,document:5,EOF:6,directive:7,line:8,SPACE:9,statement:10,NEWLINE:11,openDirective:12,typeDirective:13,closeDirective:14,":":15,argDirective:16,title:17,acc_title:18,acc_title_value:19,acc_descr:20,acc_descr_value:21,acc_descr_multiline_value:22,section:23,period_statement:24,event_statement:25,period:26,event:27,open_directive:28,type_directive:29,arg_directive:30,close_directive:31,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",6:"EOF",9:"SPACE",11:"NEWLINE",15:":",17:"title",18:"acc_title",19:"acc_title_value",20:"acc_descr",21:"acc_descr_value",22:"acc_descr_multiline_value",23:"section",26:"period",27:"event",28:"open_directive",29:"type_directive",30:"arg_directive",31:"close_directive"},productions_:[0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,2],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[24,1],[25,1],[12,1],[13,1],[16,1],[14,1]],performAction:function(et,st,pt,Tt,kt,yt,ft){var mt=yt.length-1;switch(kt){case 1:return yt[mt-1];case 3:this.$=[];break;case 4:yt[mt-1].push(yt[mt]),this.$=yt[mt-1];break;case 5:case 6:this.$=yt[mt];break;case 7:case 8:this.$=[];break;case 11:Tt.getCommonDb().setDiagramTitle(yt[mt].substr(6)),this.$=yt[mt].substr(6);break;case 12:this.$=yt[mt].trim(),Tt.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=yt[mt].trim(),Tt.getCommonDb().setAccDescription(this.$);break;case 15:Tt.addSection(yt[mt].substr(8)),this.$=yt[mt].substr(8);break;case 19:Tt.addTask(yt[mt],0,""),this.$=yt[mt];break;case 20:Tt.addEvent(yt[mt].substr(2)),this.$=yt[mt];break;case 21:Tt.parseDirective("%%{","open_directive");break;case 22:Tt.parseDirective(yt[mt],"type_directive");break;case 23:yt[mt]=yt[mt].trim().replace(/'/g,'"'),Tt.parseDirective(yt[mt],"arg_directive");break;case 24:Tt.parseDirective("}%%","close_directive","timeline");break}},table:[{3:1,4:a,7:3,12:4,28:f},{1:[3]},i(p,[2,3],{5:6}),{3:7,4:a,7:3,12:4,28:f},{13:8,29:[1,9]},{29:[2,21]},{6:[1,10],7:22,8:11,9:[1,12],10:13,11:[1,14],12:4,17:v,18:m,20:b,22:E,23:C,24:20,25:21,26:D,27:N,28:f},{1:[2,2]},{14:25,15:[1,26],31:B},i([15,31],[2,22]),i(p,[2,8],{1:[2,1]}),i(p,[2,4]),{7:22,10:28,12:4,17:v,18:m,20:b,22:E,23:C,24:20,25:21,26:D,27:N,28:f},i(p,[2,6]),i(p,[2,7]),i(p,[2,11]),{19:[1,29]},{21:[1,30]},i(p,[2,14]),i(p,[2,15]),i(p,[2,16]),i(p,[2,17]),i(p,[2,18]),i(p,[2,19]),i(p,[2,20]),{11:[1,31]},{16:32,30:[1,33]},{11:[2,24]},i(p,[2,5]),i(p,[2,12]),i(p,[2,13]),i(j,[2,9]),{14:34,31:B},{31:[2,23]},{11:[1,35]},i(j,[2,10])],defaultActions:{5:[2,21],7:[2,2],27:[2,24],33:[2,23]},parseError:function(et,st){if(st.recoverable)this.trace(et);else{var pt=new Error(et);throw pt.hash=st,pt}},parse:function(et){var st=this,pt=[0],Tt=[],kt=[null],yt=[],ft=this.table,mt="",rt=0,wt=0,gt=2,ht=1,_t=yt.slice.call(arguments,1),X=Object.create(this.lexer),Rt={yy:{}};for(var lt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,lt)&&(Rt.yy[lt]=this.yy[lt]);X.setInput(et,Rt.yy),Rt.yy.lexer=X,Rt.yy.parser=this,typeof X.yylloc>"u"&&(X.yylloc={});var fe=X.yylloc;yt.push(fe);var J=X.options&&X.options.ranges;typeof Rt.yy.parseError=="function"?this.parseError=Rt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ae(){var Ee;return Ee=Tt.pop()||X.lex()||ht,typeof Ee!="number"&&(Ee instanceof Array&&(Tt=Ee,Ee=Tt.pop()),Ee=st.symbols_[Ee]||Ee),Ee}for(var Wt,It,Pt,me,Ue={},_n,_e,rr,Te;;){if(It=pt[pt.length-1],this.defaultActions[It]?Pt=this.defaultActions[It]:((Wt===null||typeof Wt>"u")&&(Wt=ae()),Pt=ft[It]&&ft[It][Wt]),typeof Pt>"u"||!Pt.length||!Pt[0]){var ne="";Te=[];for(_n in ft[It])this.terminals_[_n]&&_n>gt&&Te.push("'"+this.terminals_[_n]+"'");X.showPosition?ne="Parse error on line "+(rt+1)+`:
`+X.showPosition()+`
Expecting `+Te.join(", ")+", got '"+(this.terminals_[Wt]||Wt)+"'":ne="Parse error on line "+(rt+1)+": Unexpected "+(Wt==ht?"end of input":"'"+(this.terminals_[Wt]||Wt)+"'"),this.parseError(ne,{text:X.match,token:this.terminals_[Wt]||Wt,line:X.yylineno,loc:fe,expected:Te})}if(Pt[0]instanceof Array&&Pt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+It+", token: "+Wt);switch(Pt[0]){case 1:pt.push(Wt),kt.push(X.yytext),yt.push(X.yylloc),pt.push(Pt[1]),Wt=null,wt=X.yyleng,mt=X.yytext,rt=X.yylineno,fe=X.yylloc;break;case 2:if(_e=this.productions_[Pt[1]][1],Ue.$=kt[kt.length-_e],Ue._$={first_line:yt[yt.length-(_e||1)].first_line,last_line:yt[yt.length-1].last_line,first_column:yt[yt.length-(_e||1)].first_column,last_column:yt[yt.length-1].last_column},J&&(Ue._$.range=[yt[yt.length-(_e||1)].range[0],yt[yt.length-1].range[1]]),me=this.performAction.apply(Ue,[mt,wt,rt,Rt.yy,Pt[1],kt,yt].concat(_t)),typeof me<"u")return me;_e&&(pt=pt.slice(0,-1*_e*2),kt=kt.slice(0,-1*_e),yt=yt.slice(0,-1*_e)),pt.push(this.productions_[Pt[1]][0]),kt.push(Ue.$),yt.push(Ue._$),rr=ft[pt[pt.length-2]][pt[pt.length-1]],pt.push(rr);break;case 3:return!0}}return!0}},H=function(){var it={EOF:1,parseError:function(st,pt){if(this.yy.parser)this.yy.parser.parseError(st,pt);else throw new Error(st)},setInput:function(et,st){return this.yy=st||this.yy||{},this._input=et,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var et=this._input[0];this.yytext+=et,this.yyleng++,this.offset++,this.match+=et,this.matched+=et;var st=et.match(/(?:\r\n?|\n).*/g);return st?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),et},unput:function(et){var st=et.length,pt=et.split(/(?:\r\n?|\n)/g);this._input=et+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-st),this.offset-=st;var Tt=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),pt.length-1&&(this.yylineno-=pt.length-1);var kt=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:pt?(pt.length===Tt.length?this.yylloc.first_column:0)+Tt[Tt.length-pt.length].length-pt[0].length:this.yylloc.first_column-st},this.options.ranges&&(this.yylloc.range=[kt[0],kt[0]+this.yyleng-st]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(et){this.unput(this.match.slice(et))},pastInput:function(){var et=this.matched.substr(0,this.matched.length-this.match.length);return(et.length>20?"...":"")+et.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var et=this.match;return et.length<20&&(et+=this._input.substr(0,20-et.length)),(et.substr(0,20)+(et.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var et=this.pastInput(),st=new Array(et.length+1).join("-");return et+this.upcomingInput()+`
`+st+"^"},test_match:function(et,st){var pt,Tt,kt;if(this.options.backtrack_lexer&&(kt={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&&(kt.yylloc.range=this.yylloc.range.slice(0))),Tt=et[0].match(/(?:\r\n?|\n).*/g),Tt&&(this.yylineno+=Tt.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Tt?Tt[Tt.length-1].length-Tt[Tt.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+et[0].length},this.yytext+=et[0],this.match+=et[0],this.matches=et,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(et[0].length),this.matched+=et[0],pt=this.performAction.call(this,this.yy,this,st,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),pt)return pt;if(this._backtrack){for(var yt in kt)this[yt]=kt[yt];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var et,st,pt,Tt;this._more||(this.yytext="",this.match="");for(var kt=this._currentRules(),yt=0;yt<kt.length;yt++)if(pt=this._input.match(this.rules[kt[yt]]),pt&&(!st||pt[0].length>st[0].length)){if(st=pt,Tt=yt,this.options.backtrack_lexer){if(et=this.test_match(pt,kt[yt]),et!==!1)return et;if(this._backtrack){st=!1;continue}else return!1}else if(!this.options.flex)break}return st?(et=this.test_match(st,kt[Tt]),et!==!1?et:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var st=this.next();return st||this.lex()},begin:function(st){this.conditionStack.push(st)},popState:function(){var st=this.conditionStack.length-1;return st>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(st){return st=this.conditionStack.length-1-Math.abs(st||0),st>=0?this.conditionStack[st]:"INITIAL"},pushState:function(st){this.begin(st)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(st,pt,Tt,kt){switch(Tt){case 0:return this.begin("open_directive"),28;case 1:return this.begin("type_directive"),29;case 2:return this.popState(),this.begin("arg_directive"),15;case 3:return this.popState(),this.popState(),31;case 4:return 30;case 5:break;case 6:break;case 7:return 11;case 8:break;case 9:break;case 10:return 4;case 11:return 17;case 12:return this.begin("acc_title"),18;case 13:return this.popState(),"acc_title_value";case 14:return this.begin("acc_descr"),20;case 15:return this.popState(),"acc_descr_value";case 16:this.begin("acc_descr_multiline");break;case 17:this.popState();break;case 18:return"acc_descr_multiline_value";case 19:return 23;case 20:return 27;case 21:return 26;case 22:return 6;case 23:return"INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?::\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{open_directive:{rules:[1],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},acc_descr_multiline:{rules:[17,18],inclusive:!1},acc_descr:{rules:[15],inclusive:!1},acc_title:{rules:[13],inclusive:!1},INITIAL:{rules:[0,5,6,7,8,9,10,11,12,14,16,19,20,21,22,23],inclusive:!0}}};return it}();R.lexer=H;function Y(){this.yy={}}return Y.prototype=R,R.Parser=Y,new Y}();xgt.parser=xgt;const _Ge=xgt;let bL="",GRt=0;const kgt=[],RK=[],vL=[],URt=()=>rIt,WRt=(i,a,f)=>{H1t(globalThis,i,a,f)},KRt=function(){kgt.length=0,RK.length=0,bL="",vL.length=0,cg()},YRt=function(i){bL=i,kgt.push(i)},XRt=function(){return kgt},QRt=function(){let i=ejt();const a=100;let f=0;for(;!i&&f<a;)i=ejt(),f++;return RK.push(...vL),RK},ZRt=function(i,a,f){const p={id:GRt++,section:bL,type:bL,task:i,score:a||0,events:f?[f]:[]};vL.push(p)},JRt=function(i){vL.find(f=>f.id===GRt-1).events.push(i)},tjt=function(i){const a={section:bL,type:bL,description:i,task:i,classes:[]};RK.push(a)},ejt=function(){const i=function(f){return vL[f].processed};let a=!0;for(const[f,p]of vL.entries())i(f),a=a&&p.processed;return a},CGe=Object.freeze(Object.defineProperty({__proto__:null,addEvent:JRt,addSection:YRt,addTask:ZRt,addTaskOrg:tjt,clear:KRt,default:{clear:KRt,getCommonDb:URt,addSection:YRt,getSections:XRt,getTasks:QRt,addTask:ZRt,addTaskOrg:tjt,addEvent:JRt,parseDirective:WRt},getCommonDb:URt,getSections:XRt,getTasks:QRt,parseDirective:WRt},Symbol.toStringTag,{value:"Module"})),SGe=12,jK=function(i,a){const f=i.append("rect");return f.attr("x",a.x),f.attr("y",a.y),f.attr("fill",a.fill),f.attr("stroke",a.stroke),f.attr("width",a.width),f.attr("height",a.height),f.attr("rx",a.rx),f.attr("ry",a.ry),a.class!==void 0&&f.attr("class",a.class),f},AGe=function(i,a){const p=i.append("circle").attr("cx",a.cx).attr("cy",a.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),v=i.append("g");v.append("circle").attr("cx",a.cx-15/3).attr("cy",a.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),v.append("circle").attr("cx",a.cx+15/3).attr("cy",a.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function m(C){const D=CA().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);C.append("path").attr("class","mouth").attr("d",D).attr("transform","translate("+a.cx+","+(a.cy+2)+")")}function b(C){const D=CA().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);C.append("path").attr("class","mouth").attr("d",D).attr("transform","translate("+a.cx+","+(a.cy+7)+")")}function E(C){C.append("line").attr("class","mouth").attr("stroke",2).attr("x1",a.cx-5).attr("y1",a.cy+7).attr("x2",a.cx+5).attr("y2",a.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return a.score>3?m(v):a.score<3?b(v):E(v),p},LGe=function(i,a){const f=i.append("circle");return f.attr("cx",a.cx),f.attr("cy",a.cy),f.attr("class","actor-"+a.pos),f.attr("fill",a.fill),f.attr("stroke",a.stroke),f.attr("r",a.r),f.class!==void 0&&f.attr("class",f.class),a.title!==void 0&&f.append("title").text(a.title),f},njt=function(i,a){const f=a.text.replace(/<br\s*\/?>/gi," "),p=i.append("text");p.attr("x",a.x),p.attr("y",a.y),p.attr("class","legend"),p.style("text-anchor",a.anchor),a.class!==void 0&&p.attr("class",a.class);const v=p.append("tspan");return v.attr("x",a.x+a.textMargin*2),v.text(f),p},MGe=function(i,a){function f(v,m,b,E,C){return v+","+m+" "+(v+b)+","+m+" "+(v+b)+","+(m+E-C)+" "+(v+b-C*1.2)+","+(m+E)+" "+v+","+(m+E)}const p=i.append("polygon");p.attr("points",f(a.x,a.y,50,20,7)),p.attr("class","labelBox"),a.y=a.y+a.labelMargin,a.x=a.x+.5*a.labelMargin,njt(i,a)},DGe=function(i,a,f){const p=i.append("g"),v=Egt();v.x=a.x,v.y=a.y,v.fill=a.fill,v.width=f.width,v.height=f.height,v.class="journey-section section-type-"+a.num,v.rx=3,v.ry=3,jK(p,v),ijt(f)(a.text,p,v.x,v.y,v.width,v.height,{class:"journey-section section-type-"+a.num},f,a.colour)};let rjt=-1;const IGe=function(i,a,f){const p=a.x+f.width/2,v=i.append("g");rjt++;const m=300+5*30;v.append("line").attr("id","task"+rjt).attr("x1",p).attr("y1",a.y).attr("x2",p).attr("y2",m).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),AGe(v,{cx:p,cy:300+(5-a.score)*30,score:a.score});const b=Egt();b.x=a.x,b.y=a.y,b.fill=a.fill,b.width=f.width,b.height=f.height,b.class="task task-type-"+a.num,b.rx=3,b.ry=3,jK(v,b),a.x+14,ijt(f)(a.task,v,b.x,b.y,b.width,b.height,{class:"task"},f,a.colour)},OGe=function(i,a){jK(i,{x:a.startx,y:a.starty,width:a.stopx-a.startx,height:a.stopy-a.starty,fill:a.fill,class:"rect"}).lower()},PGe=function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},Egt=function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},ijt=function(){function i(v,m,b,E,C,D,N,B){const j=m.append("text").attr("x",b+C/2).attr("y",E+D/2+5).style("font-color",B).style("text-anchor","middle").text(v);p(j,N)}function a(v,m,b,E,C,D,N,B,j){const{taskFontSize:R,taskFontFamily:H}=B,Y=v.split(/<br\s*\/?>/gi);for(let it=0;it<Y.length;it++){const et=it*R-R*(Y.length-1)/2,st=m.append("text").attr("x",b+C/2).attr("y",E).attr("fill",j).style("text-anchor","middle").style("font-size",R).style("font-family",H);st.append("tspan").attr("x",b+C/2).attr("dy",et).text(Y[it]),st.attr("y",E+D/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),p(st,N)}}function f(v,m,b,E,C,D,N,B){const j=m.append("switch"),H=j.append("foreignObject").attr("x",b).attr("y",E).attr("width",C).attr("height",D).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");H.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(v),a(v,j,b,E,C,D,N,B),p(H,N)}function p(v,m){for(const b in m)b in m&&v.attr(b,m[b])}return function(v){return v.textPlacement==="fo"?f:v.textPlacement==="old"?i:a}}(),NGe=function(i){i.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")};function sjt(i,a){i.each(function(){var f=Mr(this),p=f.text().split(/(\s+|<br>)/).reverse(),v,m=[],b=1.1,E=f.attr("y"),C=parseFloat(f.attr("dy")),D=f.text(null).append("tspan").attr("x",0).attr("y",E).attr("dy",C+"em");for(let N=0;N<p.length;N++)v=p[p.length-1-N],m.push(v),D.text(m.join(" ").trim()),(D.node().getComputedTextLength()>a||v==="<br>")&&(m.pop(),D.text(m.join(" ").trim()),v==="<br>"?m=[""]:m=[v],D=f.append("tspan").attr("x",0).attr("y",E).attr("dy",b+"em").text(v))})}const FGe=function(i,a,f,p){const v=f%SGe-1,m=i.append("g");a.section=v,m.attr("class",(a.class?a.class+" ":"")+"timeline-node "+("section-"+v));const b=m.append("g"),E=m.append("g"),D=E.append("text").text(a.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(sjt,a.width).node().getBBox(),N=p.fontSize&&p.fontSize.replace?p.fontSize.replace("px",""):p.fontSize;return a.height=D.height+N*1.1*.5+a.padding,a.height=Math.max(a.height,a.maxHeight),a.width=a.width+2*a.padding,E.attr("transform","translate("+a.width/2+", "+a.padding/2+")"),RGe(b,a,v),a},BGe=function(i,a,f){const p=i.append("g"),m=p.append("text").text(a.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(sjt,a.width).node().getBBox(),b=f.fontSize&&f.fontSize.replace?f.fontSize.replace("px",""):f.fontSize;return p.remove(),m.height+b*1.1*.5+a.padding},RGe=function(i,a,f){i.append("path").attr("id","node-"+a.id).attr("class","node-bkg node-"+a.type).attr("d",`M0 ${a.height-5} v${-a.height+2*5} q0,-5 5,-5 h${a.width-2*5} q5,0 5,5 v${a.height-5} H0 Z`),i.append("line").attr("class","node-line-"+f).attr("x1",0).attr("y1",a.height).attr("x2",a.width).attr("y2",a.height)},kE={drawRect:jK,drawCircle:LGe,drawSection:DGe,drawText:njt,drawLabel:MGe,drawTask:IGe,drawBackgroundRect:OGe,getTextObj:PGe,getNoteRect:Egt,initGraphics:NGe,drawNode:FGe,getVirtualNodeHeight:BGe},jGe=function(i,a,f,p){var rt,wt,gt,ht;const v=Oe(),m=v.leftMargin??50;(wt=(rt=p.db).clear)==null||wt.call(rt),p.parser.parse(i+`
`),zt.debug("timeline",p.db);const b=v.securityLevel;let E;b==="sandbox"&&(E=Mr("#i"+a));const D=Mr(b==="sandbox"?E.nodes()[0].contentDocument.body:"body").select("#"+a);D.append("g");const N=p.db.getTasks(),B=p.db.getCommonDb().getDiagramTitle();zt.debug("task",N),kE.initGraphics(D);const j=p.db.getSections();zt.debug("sections",j);let R=0,H=0,Y=0,it=0,et=50+m,st=50;it=50;let pt=0,Tt=!0;j.forEach(function(_t){const X={number:pt,descr:_t,section:pt,width:150,padding:20,maxHeight:R},Rt=kE.getVirtualNodeHeight(D,X,v);zt.debug("sectionHeight before draw",Rt),R=Math.max(R,Rt+20)});let kt=0,yt=0;zt.debug("tasks.length",N.length);for(const[_t,X]of N.entries()){const Rt={number:_t,descr:X,section:X.section,width:150,padding:20,maxHeight:H},lt=kE.getVirtualNodeHeight(D,Rt,v);zt.debug("taskHeight before draw",lt),H=Math.max(H,lt+20),kt=Math.max(kt,X.events.length);let fe=0;for(let J=0;J<X.events.length;J++){const Wt={descr:X.events[J],section:X.section,number:X.section,width:150,padding:20,maxHeight:50};fe+=kE.getVirtualNodeHeight(D,Wt,v)}yt=Math.max(yt,fe)}zt.debug("maxSectionHeight before draw",R),zt.debug("maxTaskHeight before draw",H),j&&j.length>0?j.forEach(_t=>{const X=N.filter(J=>J.section===_t),Rt={number:pt,descr:_t,section:pt,width:200*Math.max(X.length,1)-50,padding:20,maxHeight:R};zt.debug("sectionNode",Rt);const lt=D.append("g"),fe=kE.drawNode(lt,Rt,pt,v);zt.debug("sectionNode output",fe),lt.attr("transform",`translate(${et}, ${it})`),st+=R+50,X.length>0&&ajt(D,X,pt,et,st,H,v,kt,yt,R,!1),et+=200*Math.max(X.length,1),st=it,pt++}):(Tt=!1,ajt(D,N,pt,et,st,H,v,kt,yt,R,!0));const ft=D.node().getBBox();zt.debug("bounds",ft),B&&D.append("text").text(B).attr("x",ft.width/2-m).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),Y=Tt?R+H+150:H+100,D.append("g").attr("class","lineWrapper").append("line").attr("x1",m).attr("y1",Y).attr("x2",ft.width+3*m).attr("y2",Y).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),J9(void 0,D,((gt=v.timeline)==null?void 0:gt.padding)??50,((ht=v.timeline)==null?void 0:ht.useMaxWidth)??!1)},ajt=function(i,a,f,p,v,m,b,E,C,D,N){var B;for(const j of a){const R={descr:j.task,section:f,number:f,width:150,padding:20,maxHeight:m};zt.debug("taskNode",R);const H=i.append("g").attr("class","taskWrapper"),it=kE.drawNode(H,R,f,b).height;if(zt.debug("taskHeight after draw",it),H.attr("transform",`translate(${p}, ${v})`),m=Math.max(m,it),j.events){const et=i.append("g").attr("class","lineWrapper");let st=m;v+=100,st=st+$Ge(i,j.events,f,p,v,b),v-=100,et.append("line").attr("x1",p+190/2).attr("y1",v+m).attr("x2",p+190/2).attr("y2",v+m+(N?m:D)+C+120).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}p=p+200,N&&!((B=b.timeline)!=null&&B.disableMulticolor)&&f++}v=v-10},$Ge=function(i,a,f,p,v,m){let b=0;const E=v;v=v+100;for(const C of a){const D={descr:C,section:f,number:f,width:150,padding:20,maxHeight:50};zt.debug("eventNode",D);const N=i.append("g").attr("class","eventWrapper"),j=kE.drawNode(N,D,f,m).height;b=b+j,N.attr("transform",`translate(${p}, ${v})`),v=v+10+j}return v=E,b},zGe={setConf:()=>{},draw:jGe},qGe=i=>{let a="";for(let f=0;f<i.THEME_COLOR_LIMIT;f++)i["lineColor"+f]=i["lineColor"+f]||i["cScaleInv"+f],Q9(i["lineColor"+f])?i["lineColor"+f]=Ds(i["lineColor"+f],20):i["lineColor"+f]=ta(i["lineColor"+f],20);for(let f=0;f<i.THEME_COLOR_LIMIT;f++){const p=""+(17-3*f);a+=`
    .section-${f-1} rect, .section-${f-1} path, .section-${f-1} circle, .section-${f-1} path  {
      fill: ${i["cScale"+f]};
    }
    .section-${f-1} text {
     fill: ${i["cScaleLabel"+f]};
    }
    .node-icon-${f-1} {
      font-size: 40px;
      color: ${i["cScaleLabel"+f]};
    }
    .section-edge-${f-1}{
      stroke: ${i["cScale"+f]};
    }
    .edge-depth-${f-1}{
      stroke-width: ${p};
    }
    .section-${f-1} line {
      stroke: ${i["cScaleInv"+f]} ;
      stroke-width: 3;
    }

    .lineWrapper line{
      stroke: ${i["cScaleLabel"+f]} ;
    }

    .disabled, .disabled circle, .disabled text {
      fill: lightgray;
    }
    .disabled text {
      fill: #efefef;
    }
    `}return a},HGe=Object.freeze(Object.defineProperty({__proto__:null,diagram:{db:CGe,renderer:zGe,parser:_Ge,styles:i=>`
  .edge {
    stroke-width: 3;
  }
  ${qGe(i)}
  .section-root rect, .section-root path, .section-root circle  {
    fill: ${i.git0};
  }
  .section-root text {
    fill: ${i.gitBranchLabel0};
  }
  .icon-container {
    height:100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .edge {
    fill: none;
  }
  .eventWrapper  {
   filter: brightness(120%);
  }
`}},Symbol.toStringTag,{value:"Module"}));var Tgt=function(){var i=function(Tt,kt,yt,ft){for(yt=yt||{},ft=Tt.length;ft--;yt[Tt[ft]]=kt);return yt},a=[1,4],f=[1,13],p=[1,12],v=[1,15],m=[1,16],b=[1,20],E=[1,19],C=[6,7,8],D=[1,26],N=[1,24],B=[1,25],j=[6,7,11],R=[1,6,13,15,16,19,22],H=[1,33],Y=[1,34],it=[1,6,7,11,13,15,16,19,22],et={trace:function(){},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:function(kt,yt,ft,mt,rt,wt,gt){var ht=wt.length-1;switch(rt){case 6:case 7:return mt;case 8:mt.getLogger().trace("Stop NL ");break;case 9:mt.getLogger().trace("Stop EOF ");break;case 11:mt.getLogger().trace("Stop NL2 ");break;case 12:mt.getLogger().trace("Stop EOF2 ");break;case 15:mt.getLogger().info("Node: ",wt[ht].id),mt.addNode(wt[ht-1].length,wt[ht].id,wt[ht].descr,wt[ht].type);break;case 16:mt.getLogger().trace("Icon: ",wt[ht]),mt.decorateNode({icon:wt[ht]});break;case 17:case 21:mt.decorateNode({class:wt[ht]});break;case 18:mt.getLogger().trace("SPACELIST");break;case 19:mt.getLogger().trace("Node: ",wt[ht].id),mt.addNode(0,wt[ht].id,wt[ht].descr,wt[ht].type);break;case 20:mt.decorateNode({icon:wt[ht]});break;case 25:mt.getLogger().trace("node found ..",wt[ht-2]),this.$={id:wt[ht-1],descr:wt[ht-1],type:mt.getType(wt[ht-2],wt[ht])};break;case 26:this.$={id:wt[ht],descr:wt[ht],type:mt.nodeType.DEFAULT};break;case 27:mt.getLogger().trace("node found ..",wt[ht-3]),this.$={id:wt[ht-3],descr:wt[ht-1],type:mt.getType(wt[ht-2],wt[ht])};break}},table:[{3:1,4:2,5:3,6:[1,5],8:a},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:a},{6:f,7:[1,10],9:9,12:11,13:p,14:14,15:v,16:m,17:17,18:18,19:b,22:E},i(C,[2,3]),{1:[2,2]},i(C,[2,4]),i(C,[2,5]),{1:[2,6],6:f,12:21,13:p,14:14,15:v,16:m,17:17,18:18,19:b,22:E},{6:f,9:22,12:11,13:p,14:14,15:v,16:m,17:17,18:18,19:b,22:E},{6:D,7:N,10:23,11:B},i(j,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:b,22:E}),i(j,[2,18]),i(j,[2,19]),i(j,[2,20]),i(j,[2,21]),i(j,[2,23]),i(j,[2,24]),i(j,[2,26],{19:[1,30]}),{20:[1,31]},{6:D,7:N,10:32,11:B},{1:[2,7],6:f,12:21,13:p,14:14,15:v,16:m,17:17,18:18,19:b,22:E},i(R,[2,14],{7:H,11:Y}),i(it,[2,8]),i(it,[2,9]),i(it,[2,10]),i(j,[2,15]),i(j,[2,16]),i(j,[2,17]),{20:[1,35]},{21:[1,36]},i(R,[2,13],{7:H,11:Y}),i(it,[2,11]),i(it,[2,12]),{21:[1,37]},i(j,[2,25]),i(j,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:function(kt,yt){if(yt.recoverable)this.trace(kt);else{var ft=new Error(kt);throw ft.hash=yt,ft}},parse:function(kt){var yt=this,ft=[0],mt=[],rt=[null],wt=[],gt=this.table,ht="",_t=0,X=0,Rt=2,lt=1,fe=wt.slice.call(arguments,1),J=Object.create(this.lexer),ae={yy:{}};for(var Wt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Wt)&&(ae.yy[Wt]=this.yy[Wt]);J.setInput(kt,ae.yy),ae.yy.lexer=J,ae.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var It=J.yylloc;wt.push(It);var Pt=J.options&&J.options.ranges;typeof ae.yy.parseError=="function"?this.parseError=ae.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function me(){var Gt;return Gt=mt.pop()||J.lex()||lt,typeof Gt!="number"&&(Gt instanceof Array&&(mt=Gt,Gt=mt.pop()),Gt=yt.symbols_[Gt]||Gt),Gt}for(var Ue,_n,_e,rr,Te={},ne,Ee,ye,Vt;;){if(_n=ft[ft.length-1],this.defaultActions[_n]?_e=this.defaultActions[_n]:((Ue===null||typeof Ue>"u")&&(Ue=me()),_e=gt[_n]&&gt[_n][Ue]),typeof _e>"u"||!_e.length||!_e[0]){var Ae="";Vt=[];for(ne in gt[_n])this.terminals_[ne]&&ne>Rt&&Vt.push("'"+this.terminals_[ne]+"'");J.showPosition?Ae="Parse error on line "+(_t+1)+`:
`+J.showPosition()+`
Expecting `+Vt.join(", ")+", got '"+(this.terminals_[Ue]||Ue)+"'":Ae="Parse error on line "+(_t+1)+": Unexpected "+(Ue==lt?"end of input":"'"+(this.terminals_[Ue]||Ue)+"'"),this.parseError(Ae,{text:J.match,token:this.terminals_[Ue]||Ue,line:J.yylineno,loc:It,expected:Vt})}if(_e[0]instanceof Array&&_e.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_n+", token: "+Ue);switch(_e[0]){case 1:ft.push(Ue),rt.push(J.yytext),wt.push(J.yylloc),ft.push(_e[1]),Ue=null,X=J.yyleng,ht=J.yytext,_t=J.yylineno,It=J.yylloc;break;case 2:if(Ee=this.productions_[_e[1]][1],Te.$=rt[rt.length-Ee],Te._$={first_line:wt[wt.length-(Ee||1)].first_line,last_line:wt[wt.length-1].last_line,first_column:wt[wt.length-(Ee||1)].first_column,last_column:wt[wt.length-1].last_column},Pt&&(Te._$.range=[wt[wt.length-(Ee||1)].range[0],wt[wt.length-1].range[1]]),rr=this.performAction.apply(Te,[ht,X,_t,ae.yy,_e[1],rt,wt].concat(fe)),typeof rr<"u")return rr;Ee&&(ft=ft.slice(0,-1*Ee*2),rt=rt.slice(0,-1*Ee),wt=wt.slice(0,-1*Ee)),ft.push(this.productions_[_e[1]][0]),rt.push(Te.$),wt.push(Te._$),ye=gt[ft[ft.length-2]][ft[ft.length-1]],ft.push(ye);break;case 3:return!0}}return!0}},st=function(){var Tt={EOF:1,parseError:function(yt,ft){if(this.yy.parser)this.yy.parser.parseError(yt,ft);else throw new Error(yt)},setInput:function(kt,yt){return this.yy=yt||this.yy||{},this._input=kt,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var kt=this._input[0];this.yytext+=kt,this.yyleng++,this.offset++,this.match+=kt,this.matched+=kt;var yt=kt.match(/(?:\r\n?|\n).*/g);return yt?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),kt},unput:function(kt){var yt=kt.length,ft=kt.split(/(?:\r\n?|\n)/g);this._input=kt+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-yt),this.offset-=yt;var mt=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),ft.length-1&&(this.yylineno-=ft.length-1);var rt=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:ft?(ft.length===mt.length?this.yylloc.first_column:0)+mt[mt.length-ft.length].length-ft[0].length:this.yylloc.first_column-yt},this.options.ranges&&(this.yylloc.range=[rt[0],rt[0]+this.yyleng-yt]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(kt){this.unput(this.match.slice(kt))},pastInput:function(){var kt=this.matched.substr(0,this.matched.length-this.match.length);return(kt.length>20?"...":"")+kt.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var kt=this.match;return kt.length<20&&(kt+=this._input.substr(0,20-kt.length)),(kt.substr(0,20)+(kt.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var kt=this.pastInput(),yt=new Array(kt.length+1).join("-");return kt+this.upcomingInput()+`
`+yt+"^"},test_match:function(kt,yt){var ft,mt,rt;if(this.options.backtrack_lexer&&(rt={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&&(rt.yylloc.range=this.yylloc.range.slice(0))),mt=kt[0].match(/(?:\r\n?|\n).*/g),mt&&(this.yylineno+=mt.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:mt?mt[mt.length-1].length-mt[mt.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+kt[0].length},this.yytext+=kt[0],this.match+=kt[0],this.matches=kt,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(kt[0].length),this.matched+=kt[0],ft=this.performAction.call(this,this.yy,this,yt,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ft)return ft;if(this._backtrack){for(var wt in rt)this[wt]=rt[wt];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var kt,yt,ft,mt;this._more||(this.yytext="",this.match="");for(var rt=this._currentRules(),wt=0;wt<rt.length;wt++)if(ft=this._input.match(this.rules[rt[wt]]),ft&&(!yt||ft[0].length>yt[0].length)){if(yt=ft,mt=wt,this.options.backtrack_lexer){if(kt=this.test_match(ft,rt[wt]),kt!==!1)return kt;if(this._backtrack){yt=!1;continue}else return!1}else if(!this.options.flex)break}return yt?(kt=this.test_match(yt,rt[mt]),kt!==!1?kt:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var yt=this.next();return yt||this.lex()},begin:function(yt){this.conditionStack.push(yt)},popState:function(){var yt=this.conditionStack.length-1;return yt>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(yt){return yt=this.conditionStack.length-1-Math.abs(yt||0),yt>=0?this.conditionStack[yt]:"INITIAL"},pushState:function(yt){this.begin(yt)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(yt,ft,mt,rt){switch(mt){case 0:return yt.getLogger().trace("Found comment",ft.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:yt.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return yt.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:yt.getLogger().trace("end icon"),this.popState();break;case 10:return yt.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return yt.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return yt.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return yt.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;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 23:this.popState();break;case 24:yt.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return yt.getLogger().trace("description:",ft.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),yt.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),yt.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),yt.getLogger().trace("node end ...",ft.yytext),"NODE_DEND";case 30:return this.popState(),yt.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),yt.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),yt.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),yt.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),yt.getLogger().trace("node end (("),"NODE_DEND";case 35:return yt.getLogger().trace("Long description:",ft.yytext),20;case 36:return yt.getLogger().trace("Long description:",ft.yytext),20}},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}}};return Tt}();et.lexer=st;function pt(){this.yy={}}return pt.prototype=et,et.Parser=pt,new pt}();Tgt.parser=Tgt;const VGe=Tgt,$N=i=>sg(i,Oe());let iv=[],ojt=0,_gt={};const GGe=()=>{iv=[],ojt=0,_gt={}},UGe=function(i){for(let a=iv.length-1;a>=0;a--)if(iv[a].level<i)return iv[a];return null},WGe=()=>iv.length>0?iv[0]:null,KGe=(i,a,f,p)=>{zt.info("addNode",i,a,f,p);const v=Oe(),m={id:ojt++,nodeId:$N(a),level:i,descr:$N(f),type:p,children:[],width:Oe().mindmap.maxNodeWidth};switch(m.type){case nl.ROUNDED_RECT:m.padding=2*v.mindmap.padding;break;case nl.RECT:m.padding=2*v.mindmap.padding;break;case nl.HEXAGON:m.padding=2*v.mindmap.padding;break;default:m.padding=v.mindmap.padding}const b=UGe(i);if(b)b.children.push(m),iv.push(m);else if(iv.length===0)iv.push(m);else{let E=new Error('There can be only one root. No parent could be found for ("'+m.descr+'")');throw E.hash={text:"branch "+name,token:"branch "+name,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:['"checkout '+name+'"']},E}},nl={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},YGe=(i,a)=>{switch(zt.debug("In get type",i,a),i){case"[":return nl.RECT;case"(":return a===")"?nl.ROUNDED_RECT:nl.CLOUD;case"((":return nl.CIRCLE;case")":return nl.CLOUD;case"))":return nl.BANG;case"{{":return nl.HEXAGON;default:return nl.DEFAULT}},cjt=(i,a)=>{_gt[i]=a},XGe=i=>{const a=iv[iv.length-1];i&&i.icon&&(a.icon=$N(i.icon)),i&&i.class&&(a.class=$N(i.class))},EE=i=>{switch(i){case nl.DEFAULT:return"no-border";case nl.RECT:return"rect";case nl.ROUNDED_RECT:return"rounded-rect";case nl.CIRCLE:return"circle";case nl.CLOUD:return"cloud";case nl.BANG:return"bang";case nl.HEXAGON:return"hexgon";default:return"no-border"}};let ujt;const QGe=i=>{ujt=i},ZGe=()=>zt,JGe=i=>iv[i],Cgt=i=>_gt[i],tUe=Object.freeze(Object.defineProperty({__proto__:null,addNode:KGe,clear:GGe,decorateNode:XGe,getElementById:Cgt,getLogger:ZGe,getMindmap:WGe,getNodeById:JGe,getType:YGe,nodeType:nl,get parseError(){return ujt},sanitizeText:$N,setElementForId:cjt,setErrorHandler:QGe,type2Str:EE},Symbol.toStringTag,{value:"Module"})),ljt=12,eUe=function(i,a,f){i.append("path").attr("id","node-"+a.id).attr("class","node-bkg node-"+EE(a.type)).attr("d",`M0 ${a.height-5} v${-a.height+2*5} q0,-5 5,-5 h${a.width-2*5} q5,0 5,5 v${a.height-5} H0 Z`),i.append("line").attr("class","node-line-"+f).attr("x1",0).attr("y1",a.height).attr("x2",a.width).attr("y2",a.height)},nUe=function(i,a){i.append("rect").attr("id","node-"+a.id).attr("class","node-bkg node-"+EE(a.type)).attr("height",a.height).attr("width",a.width)},rUe=function(i,a){const f=a.width,p=a.height,v=.15*f,m=.25*f,b=.35*f,E=.2*f;i.append("path").attr("id","node-"+a.id).attr("class","node-bkg node-"+EE(a.type)).attr("d",`M0 0 a${v},${v} 0 0,1 ${f*.25},${-1*f*.1}
      a${b},${b} 1 0,1 ${f*.4},${-1*f*.1}
      a${m},${m} 1 0,1 ${f*.35},${1*f*.2}

      a${v},${v} 1 0,1 ${f*.15},${1*p*.35}
      a${E},${E} 1 0,1 ${-1*f*.15},${1*p*.65}

      a${m},${v} 1 0,1 ${-1*f*.25},${f*.15}
      a${b},${b} 1 0,1 ${-1*f*.5},0
      a${v},${v} 1 0,1 ${-1*f*.25},${-1*f*.15}

      a${v},${v} 1 0,1 ${-1*f*.1},${-1*p*.35}
      a${E},${E} 1 0,1 ${f*.1},${-1*p*.65}

    H0 V0 Z`)},iUe=function(i,a){const f=a.width,p=a.height,v=.15*f;i.append("path").attr("id","node-"+a.id).attr("class","node-bkg node-"+EE(a.type)).attr("d",`M0 0 a${v},${v} 1 0,0 ${f*.25},${-1*p*.1}
      a${v},${v} 1 0,0 ${f*.25},0
      a${v},${v} 1 0,0 ${f*.25},0
      a${v},${v} 1 0,0 ${f*.25},${1*p*.1}

      a${v},${v} 1 0,0 ${f*.15},${1*p*.33}
      a${v*.8},${v*.8} 1 0,0 0,${1*p*.34}
      a${v},${v} 1 0,0 ${-1*f*.15},${1*p*.33}

      a${v},${v} 1 0,0 ${-1*f*.25},${p*.15}
      a${v},${v} 1 0,0 ${-1*f*.25},0
      a${v},${v} 1 0,0 ${-1*f*.25},0
      a${v},${v} 1 0,0 ${-1*f*.25},${-1*p*.15}

      a${v},${v} 1 0,0 ${-1*f*.1},${-1*p*.33}
      a${v*.8},${v*.8} 1 0,0 0,${-1*p*.34}
      a${v},${v} 1 0,0 ${f*.1},${-1*p*.33}

    H0 V0 Z`)},sUe=function(i,a){i.append("circle").attr("id","node-"+a.id).attr("class","node-bkg node-"+EE(a.type)).attr("r",a.width/2)};function aUe(i,a,f,p,v){return i.insert("polygon",":first-child").attr("points",p.map(function(m){return m.x+","+m.y}).join(" ")).attr("transform","translate("+(v.width-a)/2+", "+f+")")}const oUe=function(i,a){const f=a.height,v=f/4,m=a.width-a.padding+2*v,b=[{x:v,y:0},{x:m-v,y:0},{x:m,y:-f/2},{x:m-v,y:-f},{x:v,y:-f},{x:0,y:-f/2}];aUe(i,m,f,b,a)},cUe=function(i,a){i.append("rect").attr("id","node-"+a.id).attr("class","node-bkg node-"+EE(a.type)).attr("height",a.height).attr("rx",a.padding).attr("ry",a.padding).attr("width",a.width)},hjt={drawNode:function(i,a,f,p){const v=p.htmlLabels,m=f%(ljt-1),b=i.append("g");a.section=m;let E="section-"+m;m<0&&(E+=" section-root"),b.attr("class",(a.class?a.class+" ":"")+"mindmap-node "+E);const C=b.append("g"),D=b.append("g"),N=a.descr.replace(/(<br\/*>)/g,`
`);uK(D,N,{useHtmlLabels:v,width:a.width,classes:"mindmap-node-label"}),v||D.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");const B=D.node().getBBox(),j=p.fontSize.replace?p.fontSize.replace("px",""):p.fontSize;if(a.height=B.height+j*1.1*.5+a.padding,a.width=B.width+2*a.padding,a.icon)if(a.type===nl.CIRCLE)a.height+=50,a.width+=50,b.append("foreignObject").attr("height","50px").attr("width",a.width).attr("style","text-align: center;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+m+" "+a.icon),D.attr("transform","translate("+a.width/2+", "+(a.height/2-1.5*a.padding)+")");else{a.width+=50;const R=a.height;a.height=Math.max(R,60);const H=Math.abs(a.height-R);b.append("foreignObject").attr("width","60px").attr("height",a.height).attr("style","text-align: center;margin-top:"+H/2+"px;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+m+" "+a.icon),D.attr("transform","translate("+(25+a.width/2)+", "+(H/2+a.padding/2)+")")}else if(v){const R=(a.width-B.width)/2,H=(a.height-B.height)/2;D.attr("transform","translate("+R+", "+H+")")}else{const R=a.width/2,H=a.padding/2;D.attr("transform","translate("+R+", "+H+")")}switch(a.type){case nl.DEFAULT:eUe(C,a,m);break;case nl.ROUNDED_RECT:cUe(C,a);break;case nl.RECT:nUe(C,a);break;case nl.CIRCLE:C.attr("transform","translate("+a.width/2+", "+ +a.height/2+")"),sUe(C,a);break;case nl.CLOUD:rUe(C,a);break;case nl.BANG:iUe(C,a);break;case nl.HEXAGON:oUe(C,a);break}return cjt(a.id,b),a.height},positionNode:function(i){const a=Cgt(i.id),f=i.x||0,p=i.y||0;a.attr("transform","translate("+f+","+p+")")},drawEdge:function(a,f,p,v,m){const b=m%(ljt-1),E=p.x+p.width/2,C=p.y+p.height/2,D=f.x+f.width/2,N=f.y+f.height/2,B=D>E?E+Math.abs(E-D)/2:E-Math.abs(E-D)/2,j=N>C?C+Math.abs(C-N)/2:C-Math.abs(C-N)/2,R=D>E?Math.abs(E-B)/2+E:-Math.abs(E-B)/2+E,H=N>C?Math.abs(C-j)/2+C:-Math.abs(C-j)/2+C;a.append("path").attr("d",p.direction==="TB"||p.direction==="BT"?`M${E},${C} Q${E},${H} ${B},${j} T${D},${N}`:`M${E},${C} Q${R},${C} ${B},${j} T${D},${N}`).attr("class","edge section-edge-"+b+" edge-depth-"+v)}};var fjt={exports:{}};(function(i,a){(function(f,p){i.exports=p()})(b0,function(){function f(y){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},f(y)}function p(y,g){if(!(y instanceof g))throw new TypeError("Cannot call a class as a function")}function v(y,g){for(var x=0;x<g.length;x++){var T=g[x];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(y,T.key,T)}}function m(y,g,x){return g&&v(y.prototype,g),x&&v(y,x),Object.defineProperty(y,"prototype",{writable:!1}),y}function b(y,g,x){return g in y?Object.defineProperty(y,g,{value:x,enumerable:!0,configurable:!0,writable:!0}):y[g]=x,y}function E(y,g){return C(y)||D(y,g)||N(y,g)||j()}function C(y){if(Array.isArray(y))return y}function D(y,g){var x=y==null?null:typeof Symbol<"u"&&y[Symbol.iterator]||y["@@iterator"];if(x!=null){var T=[],A=!0,I=!1,O,$;try{for(x=x.call(y);!(A=(O=x.next()).done)&&(T.push(O.value),!(g&&T.length===g));A=!0);}catch(z){I=!0,$=z}finally{try{!A&&x.return!=null&&x.return()}finally{if(I)throw $}}return T}}function N(y,g){if(y){if(typeof y=="string")return B(y,g);var x=Object.prototype.toString.call(y).slice(8,-1);if(x==="Object"&&y.constructor&&(x=y.constructor.name),x==="Map"||x==="Set")return Array.from(y);if(x==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(x))return B(y,g)}}function B(y,g){(g==null||g>y.length)&&(g=y.length);for(var x=0,T=new Array(g);x<g;x++)T[x]=y[x];return T}function j(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var R=typeof window>"u"?null:window,H=R?R.navigator:null;R&&R.document;var Y=f(""),it=f({}),et=f(function(){}),st=typeof HTMLElement>"u"?"undefined":f(HTMLElement),pt=function(g){return g&&g.instanceString&&kt(g.instanceString)?g.instanceString():null},Tt=function(g){return g!=null&&f(g)==Y},kt=function(g){return g!=null&&f(g)===et},yt=function(g){return!ht(g)&&(Array.isArray?Array.isArray(g):g!=null&&g instanceof Array)},ft=function(g){return g!=null&&f(g)===it&&!yt(g)&&g.constructor===Object},mt=function(g){return g!=null&&f(g)===it},rt=function(g){return g!=null&&f(g)===f(1)&&!isNaN(g)},wt=function(g){return rt(g)&&Math.floor(g)===g},gt=function(g){if(st!=="undefined")return g!=null&&g instanceof HTMLElement},ht=function(g){return _t(g)||X(g)},_t=function(g){return pt(g)==="collection"&&g._private.single},X=function(g){return pt(g)==="collection"&&!g._private.single},Rt=function(g){return pt(g)==="core"},lt=function(g){return pt(g)==="stylesheet"},fe=function(g){return pt(g)==="event"},J=function(g){return g==null?!0:!!(g===""||g.match(/^\s+$/))},ae=function(g){return typeof HTMLElement>"u"?!1:g instanceof HTMLElement},Wt=function(g){return ft(g)&&rt(g.x1)&&rt(g.x2)&&rt(g.y1)&&rt(g.y2)},It=function(g){return mt(g)&&kt(g.then)},Pt=function(){return H&&H.userAgent.match(/msie|trident|edge/i)},me=function(g,x){x||(x=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var I=[],O=0;O<arguments.length;O++)I.push(arguments[O]);return I.join("$")});var T=function A(){var I=this,O=arguments,$,z=x.apply(I,O),S=A.cache;return($=S[z])||($=S[z]=g.apply(I,O)),$};return T.cache={},T},Ue=me(function(y){return y.replace(/([A-Z])/g,function(g){return"-"+g.toLowerCase()})}),_n=me(function(y){return y.replace(/(-\w)/g,function(g){return g[1].toUpperCase()})}),_e=me(function(y,g){return y+g[0].toUpperCase()+g.substring(1)},function(y,g){return y+"$"+g}),rr=function(g){return J(g)?g:g.charAt(0).toUpperCase()+g.substring(1)},Te="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",ne="rgb[a]?\\(("+Te+"[%]?)\\s*,\\s*("+Te+"[%]?)\\s*,\\s*("+Te+"[%]?)(?:\\s*,\\s*("+Te+"))?\\)",Ee="rgb[a]?\\((?:"+Te+"[%]?)\\s*,\\s*(?:"+Te+"[%]?)\\s*,\\s*(?:"+Te+"[%]?)(?:\\s*,\\s*(?:"+Te+"))?\\)",ye="hsl[a]?\\(("+Te+")\\s*,\\s*("+Te+"[%])\\s*,\\s*("+Te+"[%])(?:\\s*,\\s*("+Te+"))?\\)",Vt="hsl[a]?\\((?:"+Te+")\\s*,\\s*(?:"+Te+"[%])\\s*,\\s*(?:"+Te+"[%])(?:\\s*,\\s*(?:"+Te+"))?\\)",Ae="\\#[0-9a-fA-F]{3}",Gt="\\#[0-9a-fA-F]{6}",un=function(g,x){return g<x?-1:g>x?1:0},jt=function(g,x){return-1*un(g,x)},Ke=Object.assign!=null?Object.assign.bind(Object):function(y){for(var g=arguments,x=1;x<g.length;x++){var T=g[x];if(T!=null)for(var A=Object.keys(T),I=0;I<A.length;I++){var O=A[I];y[O]=T[O]}}return y},oe=function(g){if(!(!(g.length===4||g.length===7)||g[0]!=="#")){var x=g.length===4,T,A,I,O=16;return x?(T=parseInt(g[1]+g[1],O),A=parseInt(g[2]+g[2],O),I=parseInt(g[3]+g[3],O)):(T=parseInt(g[1]+g[2],O),A=parseInt(g[3]+g[4],O),I=parseInt(g[5]+g[6],O)),[T,A,I]}},Or=function(g){var x,T,A,I,O,$,z,S;function V(ut,dt,At){return At<0&&(At+=1),At>1&&(At-=1),At<1/6?ut+(dt-ut)*6*At:At<1/2?dt:At<2/3?ut+(dt-ut)*(2/3-At)*6:ut}var U=new RegExp("^"+ye+"$").exec(g);if(U){if(T=parseInt(U[1]),T<0?T=(360- -1*T%360)%360:T>360&&(T=T%360),T/=360,A=parseFloat(U[2]),A<0||A>100||(A=A/100,I=parseFloat(U[3]),I<0||I>100)||(I=I/100,O=U[4],O!==void 0&&(O=parseFloat(O),O<0||O>1)))return;if(A===0)$=z=S=Math.round(I*255);else{var tt=I<.5?I*(1+A):I+A-I*A,at=2*I-tt;$=Math.round(255*V(at,tt,T+1/3)),z=Math.round(255*V(at,tt,T)),S=Math.round(255*V(at,tt,T-1/3))}x=[$,z,S,O]}return x},Le=function(g){var x,T=new RegExp("^"+ne+"$").exec(g);if(T){x=[];for(var A=[],I=1;I<=3;I++){var O=T[I];if(O[O.length-1]==="%"&&(A[I]=!0),O=parseFloat(O),A[I]&&(O=O/100*255),O<0||O>255)return;x.push(Math.floor(O))}var $=A[1]||A[2]||A[3],z=A[1]&&A[2]&&A[3];if($&&!z)return;var S=T[4];if(S!==void 0){if(S=parseFloat(S),S<0||S>1)return;x.push(S)}}return x},Pr=function(g){return sr[g.toLowerCase()]},de=function(g){return(yt(g)?g:null)||Pr(g)||oe(g)||Le(g)||Or(g)},sr={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Yn=function(g){for(var x=g.map,T=g.keys,A=T.length,I=0;I<A;I++){var O=T[I];if(ft(O))throw Error("Tried to set map with object key");I<T.length-1?(x[O]==null&&(x[O]={}),x=x[O]):x[O]=g.value}},tr=function(g){for(var x=g.map,T=g.keys,A=T.length,I=0;I<A;I++){var O=T[I];if(ft(O))throw Error("Tried to get map with object key");if(x=x[O],x==null)return x}return x};function ur(y){var g=typeof y;return y!=null&&(g=="object"||g=="function")}var gn=ur,En=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof b0<"u"?b0:typeof self<"u"?self:{};function Dr(y,g){return g={exports:{}},y(g,g.exports),g.exports}var hr=typeof En=="object"&&En&&En.Object===Object&&En,Ki=hr,Is=typeof self=="object"&&self&&self.Object===Object&&self,Ha=Ki||Is||Function("return this")(),hi=Ha,qi=function(){return hi.Date.now()},zn=qi,Zn=/\s/;function Nr(y){for(var g=y.length;g--&&Zn.test(y.charAt(g)););return g}var On=Nr,xi=/^\s+/;function In(y){return y&&y.slice(0,On(y)+1).replace(xi,"")}var rc=In,qn=hi.Symbol,ss=qn,Aa=Object.prototype,Ya=Aa.hasOwnProperty,Ea=Aa.toString,ga=ss?ss.toStringTag:void 0;function Es(y){var g=Ya.call(y,ga),x=y[ga];try{y[ga]=void 0;var T=!0}catch{}var A=Ea.call(y);return T&&(g?y[ga]=x:delete y[ga]),A}var Bs=Es,Ta=Object.prototype,La=Ta.toString;function Va(y){return La.call(y)}var sv=Va,rl="[object Null]",mu="[object Undefined]",As=ss?ss.toStringTag:void 0;function gp(y){return y==null?y===void 0?mu:rl:As&&As in Object(y)?Bs(y):sv(y)}var sd=gp;function Rl(y){return y!=null&&typeof y=="object"}var $u=Rl,Gi="[object Symbol]";function He(y){return typeof y=="symbol"||$u(y)&&sd(y)==Gi}var Er=He,ci=0/0,Xa=/^[-+]0x[0-9a-f]+$/i,kc=/^0b[01]+$/i,yu=/^0o[0-7]+$/i,mo=parseInt;function xu(y){if(typeof y=="number")return y;if(Er(y))return ci;if(gn(y)){var g=typeof y.valueOf=="function"?y.valueOf():y;y=gn(g)?g+"":g}if(typeof y!="string")return y===0?y:+y;y=rc(y);var x=kc.test(y);return x||yu.test(y)?mo(y.slice(2),x?2:8):Xa.test(y)?ci:+y}var cf=xu,k3="Expected a function",v1=Math.max,E3=Math.min;function wL(y,g,x){var T,A,I,O,$,z,S=0,V=!1,U=!1,tt=!0;if(typeof y!="function")throw new TypeError(k3);g=cf(g)||0,gn(x)&&(V=!!x.leading,U="maxWait"in x,I=U?v1(cf(x.maxWait)||0,g):I,tt="trailing"in x?!!x.trailing:tt);function at(Kt){var $t=T,ee=A;return T=A=void 0,S=Kt,O=y.apply(ee,$t),O}function ut(Kt){return S=Kt,$=setTimeout(xt,g),V?at(Kt):O}function dt(Kt){var $t=Kt-z,ee=Kt-S,Ht=g-$t;return U?E3(Ht,I-ee):Ht}function At(Kt){var $t=Kt-z,ee=Kt-S;return z===void 0||$t>=g||$t<0||U&&ee>=I}function xt(){var Kt=zn();if(At(Kt))return Mt(Kt);$=setTimeout(xt,dt(Kt))}function Mt(Kt){return $=void 0,tt&&T?at(Kt):(T=A=void 0,O)}function Dt(){$!==void 0&&clearTimeout($),S=0,T=z=A=$=void 0}function Bt(){return $===void 0?O:Mt(zn())}function Zt(){var Kt=zn(),$t=At(Kt);if(T=arguments,A=this,z=Kt,$t){if($===void 0)return ut(z);if(U)return clearTimeout($),$=setTimeout(xt,g),at(z)}return $===void 0&&($=setTimeout(xt,g)),O}return Zt.cancel=Dt,Zt.flush=Bt,Zt}var um=wL,gg=R?R.performance:null,cs=gg&&gg.now?function(){return gg.now()}:function(){return Date.now()},zs=function(){if(R){if(R.requestAnimationFrame)return function(y){R.requestAnimationFrame(y)};if(R.mozRequestAnimationFrame)return function(y){R.mozRequestAnimationFrame(y)};if(R.webkitRequestAnimationFrame)return function(y){R.webkitRequestAnimationFrame(y)};if(R.msRequestAnimationFrame)return function(y){R.msRequestAnimationFrame(y)}}return function(y){y&&setTimeout(function(){y(cs())},1e3/60)}}(),Ma=function(g){return zs(g)},Ei=cs,Rc=9261,Pe=65599,pp=5381,We=function(g){for(var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Rc,T=x,A;A=g.next(),!A.done;)T=T*Pe+A.value|0;return T},uf=function(g){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Rc;return x*Pe+g|0},lm=function(g){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pp;return(x<<5)+x+g|0},TE=function(g,x){return g*2097152+x},bp=function(g){return g[0]*2097152+g[1]},B5=function(g,x){return[uf(g[0],x[0]),lm(g[1],x[1])]},ah=function(g,x){var T={value:0,done:!1},A=0,I=g.length,O={next:function(){return A<I?T.value=g[A++]:T.done=!0,T}};return We(O,x)},ad=function(g,x){var T={value:0,done:!1},A=0,I=g.length,O={next:function(){return A<I?T.value=g.charCodeAt(A++):T.done=!0,T}};return We(O,x)},R5=function(){return j5(arguments)},j5=function(g){for(var x,T=0;T<g.length;T++){var A=g[T];T===0?x=ad(A):x=ad(A,x)}return x},_E=!0,mL=console.warn!=null,w1=console.trace!=null,vp=Number.MAX_SAFE_INTEGER||9007199254740991,od=function(){return!0},hm=function(){return!1},av=function(){return 0},fm=function(){},Ec=function(g){throw new Error(g)},gk=function(g){if(g!==void 0)_E=!!g;else return _E},Wo=function(g){gk()&&(mL?console.warn(g):(console.log(g),w1&&console.trace()))},pk=function(g){return Ke({},g)},oh=function(g){return g==null?g:yt(g)?g.slice():ft(g)?pk(g):g},$K=function(g){return g.slice()},CE=function(g,x){for(x=g="";g++<36;x+=g*51&52?(g^15?8^Math.random()*(g^20?16:4):4).toString(16):"-");return x},zK={},zN=function(){return zK},Hf=function(g){var x=Object.keys(g);return function(T){for(var A={},I=0;I<x.length;I++){var O=x[I],$=T==null?void 0:T[O];A[O]=$===void 0?g[O]:$}return A}},dm=function(g,x,T){for(var A=g.length-1;A>=0&&!(g[A]===x&&(g.splice(A,1),T));A--);},yL=function(g){g.splice(0,g.length)},qN=function(g,x){for(var T=0;T<x.length;T++){var A=x[T];g.push(A)}},wp=function(g,x,T){return T&&(x=_e(T,x)),g[x]},gm=function(g,x,T,A){T&&(x=_e(T,x)),g[x]=A},qK=function(){function y(){p(this,y),this._obj={}}return m(y,[{key:"set",value:function(x,T){return this._obj[x]=T,this}},{key:"delete",value:function(x){return this._obj[x]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(x){return this._obj[x]!==void 0}},{key:"get",value:function(x){return this._obj[x]}}]),y}(),j2=typeof Map<"u"?Map:qK,HK="undefined",VK=function(){function y(g){if(p(this,y),this._obj=Object.create(null),this.size=0,g!=null){var x;g.instanceString!=null&&g.instanceString()===this.instanceString()?x=g.toArray():x=g;for(var T=0;T<x.length;T++)this.add(x[T])}}return m(y,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(x){var T=this._obj;T[x]!==1&&(T[x]=1,this.size++)}},{key:"delete",value:function(x){var T=this._obj;T[x]===1&&(T[x]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(x){return this._obj[x]===1}},{key:"toArray",value:function(){var x=this;return Object.keys(this._obj).filter(function(T){return x.has(T)})}},{key:"forEach",value:function(x,T){return this.toArray().forEach(x,T)}}]),y}(),$5=(typeof Set>"u"?"undefined":f(Set))!==HK?Set:VK,SE=function(g,x){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(g===void 0||x===void 0||!Rt(g)){Ec("An element must have a core reference and parameters set");return}var A=x.group;if(A==null&&(x.data&&x.data.source!=null&&x.data.target!=null?A="edges":A="nodes"),A!=="nodes"&&A!=="edges"){Ec("An element must be of type `nodes` or `edges`; you specified `"+A+"`");return}this.length=1,this[0]=this;var I=this._private={cy:g,single:!0,data:x.data||{},position:x.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:A,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!x.selected,selectable:x.selectable===void 0?!0:!!x.selectable,locked:!!x.locked,grabbed:!1,grabbable:x.grabbable===void 0?!0:!!x.grabbable,pannable:x.pannable===void 0?A==="edges":!!x.pannable,active:!1,classes:new $5,animation:{current:[],queue:[]},rscratch:{},scratch:x.scratch||{},edges:[],children:[],parent:x.parent&&x.parent.isNode()?x.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(I.position.x==null&&(I.position.x=0),I.position.y==null&&(I.position.y=0),x.renderedPosition){var O=x.renderedPosition,$=g.pan(),z=g.zoom();I.position={x:(O.x-$.x)/z,y:(O.y-$.y)/z}}var S=[];yt(x.classes)?S=x.classes:Tt(x.classes)&&(S=x.classes.split(/\s+/));for(var V=0,U=S.length;V<U;V++){var tt=S[V];!tt||tt===""||I.classes.add(tt)}this.createEmitter();var at=x.style||x.css;at&&(Wo("Setting a `style` bypass at element creation should be done only when absolutely necessary.  Try to use the stylesheet instead."),this.style(at)),(T===void 0||T)&&this.restore()},HN=function(g){return g={bfs:g.bfs||!g.dfs,dfs:g.dfs||!g.bfs},function(T,A,I){var O;ft(T)&&!ht(T)&&(O=T,T=O.roots||O.root,A=O.visit,I=O.directed),I=arguments.length===2&&!kt(A)?A:I,A=kt(A)?A:function(){};for(var $=this._private.cy,z=T=Tt(T)?this.filter(T):T,S=[],V=[],U={},tt={},at={},ut=0,dt,At=this.byGroup(),xt=At.nodes,Mt=At.edges,Dt=0;Dt<z.length;Dt++){var Bt=z[Dt],Zt=Bt.id();Bt.isNode()&&(S.unshift(Bt),g.bfs&&(at[Zt]=!0,V.push(Bt)),tt[Zt]=0)}for(var Kt=function(){var Ne=g.bfs?S.shift():S.pop(),ve=Ne.id();if(g.dfs){if(at[ve])return"continue";at[ve]=!0,V.push(Ne)}var fn=tt[ve],$e=U[ve],qe=$e!=null?$e.source():null,xn=$e!=null?$e.target():null,Pn=$e==null?void 0:Ne.same(qe)?xn[0]:qe[0],er=void 0;if(er=A(Ne,$e,Pn,ut++,fn),er===!0)return dt=Ne,"break";if(er===!1)return"break";for(var Sn=Ne.connectedEdges().filter(function(cr){return(!I||cr.source().same(Ne))&&Mt.has(cr)}),Jn=0;Jn<Sn.length;Jn++){var fr=Sn[Jn],Sr=fr.connectedNodes().filter(function(cr){return!cr.same(Ne)&&xt.has(cr)}),wr=Sr.id();Sr.length!==0&&!at[wr]&&(Sr=Sr[0],S.push(Sr),g.bfs&&(at[wr]=!0,V.push(Sr)),U[wr]=fr,tt[wr]=tt[ve]+1)}};S.length!==0;){var $t=Kt();if($t!=="continue"&&$t==="break")break}for(var ee=$.collection(),Ht=0;Ht<V.length;Ht++){var ge=V[Ht],be=U[ge.id()];be!=null&&ee.push(be),ee.push(ge)}return{path:$.collection(ee),found:$.collection(dt)}}},bk={breadthFirstSearch:HN({bfs:!0}),depthFirstSearch:HN({dfs:!0})};bk.bfs=bk.breadthFirstSearch,bk.dfs=bk.depthFirstSearch;var GK=Dr(function(y,g){(function(){var x,T,A,I,O,$,z,S,V,U,tt,at,ut,dt,At;A=Math.floor,U=Math.min,T=function(xt,Mt){return xt<Mt?-1:xt>Mt?1:0},V=function(xt,Mt,Dt,Bt,Zt){var Kt;if(Dt==null&&(Dt=0),Zt==null&&(Zt=T),Dt<0)throw new Error("lo must be non-negative");for(Bt==null&&(Bt=xt.length);Dt<Bt;)Kt=A((Dt+Bt)/2),Zt(Mt,xt[Kt])<0?Bt=Kt:Dt=Kt+1;return[].splice.apply(xt,[Dt,Dt-Dt].concat(Mt)),Mt},$=function(xt,Mt,Dt){return Dt==null&&(Dt=T),xt.push(Mt),dt(xt,0,xt.length-1,Dt)},O=function(xt,Mt){var Dt,Bt;return Mt==null&&(Mt=T),Dt=xt.pop(),xt.length?(Bt=xt[0],xt[0]=Dt,At(xt,0,Mt)):Bt=Dt,Bt},S=function(xt,Mt,Dt){var Bt;return Dt==null&&(Dt=T),Bt=xt[0],xt[0]=Mt,At(xt,0,Dt),Bt},z=function(xt,Mt,Dt){var Bt;return Dt==null&&(Dt=T),xt.length&&Dt(xt[0],Mt)<0&&(Bt=[xt[0],Mt],Mt=Bt[0],xt[0]=Bt[1],At(xt,0,Dt)),Mt},I=function(xt,Mt){var Dt,Bt,Zt,Kt,$t,ee;for(Mt==null&&(Mt=T),Kt=function(){ee=[];for(var Ht=0,ge=A(xt.length/2);0<=ge?Ht<ge:Ht>ge;0<=ge?Ht++:Ht--)ee.push(Ht);return ee}.apply(this).reverse(),$t=[],Bt=0,Zt=Kt.length;Bt<Zt;Bt++)Dt=Kt[Bt],$t.push(At(xt,Dt,Mt));return $t},ut=function(xt,Mt,Dt){var Bt;if(Dt==null&&(Dt=T),Bt=xt.indexOf(Mt),Bt!==-1)return dt(xt,0,Bt,Dt),At(xt,Bt,Dt)},tt=function(xt,Mt,Dt){var Bt,Zt,Kt,$t,ee;if(Dt==null&&(Dt=T),Zt=xt.slice(0,Mt),!Zt.length)return Zt;for(I(Zt,Dt),ee=xt.slice(Mt),Kt=0,$t=ee.length;Kt<$t;Kt++)Bt=ee[Kt],z(Zt,Bt,Dt);return Zt.sort(Dt).reverse()},at=function(xt,Mt,Dt){var Bt,Zt,Kt,$t,ee,Ht,ge,be,re;if(Dt==null&&(Dt=T),Mt*10<=xt.length){if(Kt=xt.slice(0,Mt).sort(Dt),!Kt.length)return Kt;for(Zt=Kt[Kt.length-1],ge=xt.slice(Mt),$t=0,Ht=ge.length;$t<Ht;$t++)Bt=ge[$t],Dt(Bt,Zt)<0&&(V(Kt,Bt,0,null,Dt),Kt.pop(),Zt=Kt[Kt.length-1]);return Kt}for(I(xt,Dt),re=[],ee=0,be=U(Mt,xt.length);0<=be?ee<be:ee>be;0<=be?++ee:--ee)re.push(O(xt,Dt));return re},dt=function(xt,Mt,Dt,Bt){var Zt,Kt,$t;for(Bt==null&&(Bt=T),Zt=xt[Dt];Dt>Mt;){if($t=Dt-1>>1,Kt=xt[$t],Bt(Zt,Kt)<0){xt[Dt]=Kt,Dt=$t;continue}break}return xt[Dt]=Zt},At=function(xt,Mt,Dt){var Bt,Zt,Kt,$t,ee;for(Dt==null&&(Dt=T),Zt=xt.length,ee=Mt,Kt=xt[Mt],Bt=2*Mt+1;Bt<Zt;)$t=Bt+1,$t<Zt&&!(Dt(xt[Bt],xt[$t])<0)&&(Bt=$t),xt[Mt]=xt[Bt],Mt=Bt,Bt=2*Mt+1;return xt[Mt]=Kt,dt(xt,ee,Mt,Dt)},x=function(){xt.push=$,xt.pop=O,xt.replace=S,xt.pushpop=z,xt.heapify=I,xt.updateItem=ut,xt.nlargest=tt,xt.nsmallest=at;function xt(Mt){this.cmp=Mt??T,this.nodes=[]}return xt.prototype.push=function(Mt){return $(this.nodes,Mt,this.cmp)},xt.prototype.pop=function(){return O(this.nodes,this.cmp)},xt.prototype.peek=function(){return this.nodes[0]},xt.prototype.contains=function(Mt){return this.nodes.indexOf(Mt)!==-1},xt.prototype.replace=function(Mt){return S(this.nodes,Mt,this.cmp)},xt.prototype.pushpop=function(Mt){return z(this.nodes,Mt,this.cmp)},xt.prototype.heapify=function(){return I(this.nodes,this.cmp)},xt.prototype.updateItem=function(Mt){return ut(this.nodes,Mt,this.cmp)},xt.prototype.clear=function(){return this.nodes=[]},xt.prototype.empty=function(){return this.nodes.length===0},xt.prototype.size=function(){return this.nodes.length},xt.prototype.clone=function(){var Mt;return Mt=new xt,Mt.nodes=this.nodes.slice(0),Mt},xt.prototype.toArray=function(){return this.nodes.slice(0)},xt.prototype.insert=xt.prototype.push,xt.prototype.top=xt.prototype.peek,xt.prototype.front=xt.prototype.peek,xt.prototype.has=xt.prototype.contains,xt.prototype.copy=xt.prototype.clone,xt}(),function(xt,Mt){return y.exports=Mt()}(this,function(){return x})}).call(En)}),vk=GK,UK=Hf({root:null,weight:function(g){return 1},directed:!1}),WK={dijkstra:function(g){if(!ft(g)){var x=arguments;g={root:x[0],weight:x[1],directed:x[2]}}var T=UK(g),A=T.root,I=T.weight,O=T.directed,$=this,z=I,S=Tt(A)?this.filter(A)[0]:A[0],V={},U={},tt={},at=this.byGroup(),ut=at.nodes,dt=at.edges;dt.unmergeBy(function(fn){return fn.isLoop()});for(var At=function($e){return V[$e.id()]},xt=function($e,qe){V[$e.id()]=qe,Mt.updateItem($e)},Mt=new vk(function(fn,$e){return At(fn)-At($e)}),Dt=0;Dt<ut.length;Dt++){var Bt=ut[Dt];V[Bt.id()]=Bt.same(S)?0:1/0,Mt.push(Bt)}for(var Zt=function($e,qe){for(var xn=(O?$e.edgesTo(qe):$e.edgesWith(qe)).intersect(dt),Pn=1/0,er,Sn=0;Sn<xn.length;Sn++){var Jn=xn[Sn],fr=z(Jn);(fr<Pn||!er)&&(Pn=fr,er=Jn)}return{edge:er,dist:Pn}};Mt.size()>0;){var Kt=Mt.pop(),$t=At(Kt),ee=Kt.id();if(tt[ee]=$t,$t!==1/0)for(var Ht=Kt.neighborhood().intersect(ut),ge=0;ge<Ht.length;ge++){var be=Ht[ge],re=be.id(),Ne=Zt(Kt,be),ve=$t+Ne.dist;ve<At(be)&&(xt(be,ve),U[re]={node:Kt,edge:Ne.edge})}}return{distanceTo:function($e){var qe=Tt($e)?ut.filter($e)[0]:$e[0];return tt[qe.id()]},pathTo:function($e){var qe=Tt($e)?ut.filter($e)[0]:$e[0],xn=[],Pn=qe,er=Pn.id();if(qe.length>0)for(xn.unshift(qe);U[er];){var Sn=U[er];xn.unshift(Sn.edge),xn.unshift(Sn.node),Pn=Sn.node,er=Pn.id()}return $.spawn(xn)}}}},KK={kruskal:function(g){g=g||function(Dt){return 1};for(var x=this.byGroup(),T=x.nodes,A=x.edges,I=T.length,O=new Array(I),$=T,z=function(Bt){for(var Zt=0;Zt<O.length;Zt++){var Kt=O[Zt];if(Kt.has(Bt))return Zt}},S=0;S<I;S++)O[S]=this.spawn(T[S]);for(var V=A.sort(function(Dt,Bt){return g(Dt)-g(Bt)}),U=0;U<V.length;U++){var tt=V[U],at=tt.source()[0],ut=tt.target()[0],dt=z(at),At=z(ut),xt=O[dt],Mt=O[At];dt!==At&&($.merge(tt),xt.merge(Mt),O.splice(At,1))}return $}},YK=Hf({root:null,goal:null,weight:function(g){return 1},heuristic:function(g){return 0},directed:!1}),XK={aStar:function(g){var x=this.cy(),T=YK(g),A=T.root,I=T.goal,O=T.heuristic,$=T.directed,z=T.weight;A=x.collection(A)[0],I=x.collection(I)[0];var S=A.id(),V=I.id(),U={},tt={},at={},ut=new vk(function(er,Sn){return tt[er.id()]-tt[Sn.id()]}),dt=new $5,At={},xt={},Mt=function(Sn,Jn){ut.push(Sn),dt.add(Jn)},Dt,Bt,Zt=function(){Dt=ut.pop(),Bt=Dt.id(),dt.delete(Bt)},Kt=function(Sn){return dt.has(Sn)};Mt(A,S),U[S]=0,tt[S]=O(A);for(var $t=0;ut.size()>0;){if(Zt(),$t++,Bt===V){for(var ee=[],Ht=I,ge=V,be=xt[ge];ee.unshift(Ht),be!=null&&ee.unshift(be),Ht=At[ge],Ht!=null;)ge=Ht.id(),be=xt[ge];return{found:!0,distance:U[Bt],path:this.spawn(ee),steps:$t}}at[Bt]=!0;for(var re=Dt._private.edges,Ne=0;Ne<re.length;Ne++){var ve=re[Ne];if(this.hasElementWithId(ve.id())&&!($&&ve.data("source")!==Bt)){var fn=ve.source(),$e=ve.target(),qe=fn.id()!==Bt?fn:$e,xn=qe.id();if(this.hasElementWithId(xn)&&!at[xn]){var Pn=U[Bt]+z(ve);if(!Kt(xn)){U[xn]=Pn,tt[xn]=Pn+O(qe),Mt(qe,xn),At[xn]=Dt,xt[xn]=ve;continue}Pn<U[xn]&&(U[xn]=Pn,tt[xn]=Pn+O(qe),At[xn]=Dt,xt[xn]=ve)}}}}return{found:!1,distance:void 0,path:void 0,steps:$t}}},QK=Hf({weight:function(g){return 1},directed:!1}),ZK={floydWarshall:function(g){for(var x=this.cy(),T=QK(g),A=T.weight,I=T.directed,O=A,$=this.byGroup(),z=$.nodes,S=$.edges,V=z.length,U=V*V,tt=function(fr){return z.indexOf(fr)},at=function(fr){return z[fr]},ut=new Array(U),dt=0;dt<U;dt++){var At=dt%V,xt=(dt-At)/V;xt===At?ut[dt]=0:ut[dt]=1/0}for(var Mt=new Array(U),Dt=new Array(U),Bt=0;Bt<S.length;Bt++){var Zt=S[Bt],Kt=Zt.source()[0],$t=Zt.target()[0];if(Kt!==$t){var ee=tt(Kt),Ht=tt($t),ge=ee*V+Ht,be=O(Zt);if(ut[ge]>be&&(ut[ge]=be,Mt[ge]=Ht,Dt[ge]=Zt),!I){var re=Ht*V+ee;!I&&ut[re]>be&&(ut[re]=be,Mt[re]=ee,Dt[re]=Zt)}}}for(var Ne=0;Ne<V;Ne++)for(var ve=0;ve<V;ve++)for(var fn=ve*V+Ne,$e=0;$e<V;$e++){var qe=ve*V+$e,xn=Ne*V+$e;ut[fn]+ut[xn]<ut[qe]&&(ut[qe]=ut[fn]+ut[xn],Mt[qe]=Mt[fn])}var Pn=function(fr){return(Tt(fr)?x.filter(fr):fr)[0]},er=function(fr){return tt(Pn(fr))},Sn={distance:function(fr,Sr){var wr=er(fr),cr=er(Sr);return ut[wr*V+cr]},path:function(fr,Sr){var wr=er(fr),cr=er(Sr),bn=at(wr);if(wr===cr)return bn.collection();if(Mt[wr*V+cr]==null)return x.collection();var Tr=x.collection(),xr=wr,fi;for(Tr.merge(bn);wr!==cr;)xr=wr,wr=Mt[wr*V+cr],fi=Dt[xr*V+wr],Tr.merge(fi),Tr.merge(at(wr));return Tr}};return Sn}},JK=Hf({weight:function(g){return 1},directed:!1,root:null}),tY={bellmanFord:function(g){var x=this,T=JK(g),A=T.weight,I=T.directed,O=T.root,$=A,z=this,S=this.cy(),V=this.byGroup(),U=V.edges,tt=V.nodes,at=tt.length,ut=new j2,dt=!1,At=[];O=S.collection(O)[0],U.unmergeBy(function(es){return es.isLoop()});for(var xt=U.length,Mt=function(Ri){var as=ut.get(Ri.id());return as||(as={},ut.set(Ri.id(),as)),as},Dt=function(Ri){return(Tt(Ri)?S.$(Ri):Ri)[0]},Bt=function(Ri){return Mt(Dt(Ri)).dist},Zt=function(Ri){for(var as=arguments.length>1&&arguments[1]!==void 0?arguments[1]:O,no=Dt(Ri),ca=[],ea=no;;){if(ea==null)return x.spawn();var Fr=Mt(ea),Qt=Fr.edge,Hn=Fr.pred;if(ca.unshift(ea[0]),ea.same(as)&&ca.length>0)break;Qt!=null&&ca.unshift(Qt),ea=Hn}return z.spawn(ca)},Kt=0;Kt<at;Kt++){var $t=tt[Kt],ee=Mt($t);$t.same(O)?ee.dist=0:ee.dist=1/0,ee.pred=null,ee.edge=null}for(var Ht=!1,ge=function(Ri,as,no,ca,ea,Fr){var Qt=ca.dist+Fr;Qt<ea.dist&&!no.same(ca.edge)&&(ea.dist=Qt,ea.pred=Ri,ea.edge=no,Ht=!0)},be=1;be<at;be++){Ht=!1;for(var re=0;re<xt;re++){var Ne=U[re],ve=Ne.source(),fn=Ne.target(),$e=$(Ne),qe=Mt(ve),xn=Mt(fn);ge(ve,fn,Ne,qe,xn,$e),I||ge(fn,ve,Ne,xn,qe,$e)}if(!Ht)break}if(Ht)for(var Pn=[],er=0;er<xt;er++){var Sn=U[er],Jn=Sn.source(),fr=Sn.target(),Sr=$(Sn),wr=Mt(Jn).dist,cr=Mt(fr).dist;if(wr+Sr<cr||!I&&cr+Sr<wr)if(dt||(Wo("Graph contains a negative weight cycle for Bellman-Ford"),dt=!0),g.findNegativeWeightCycles!==!1){var bn=[];wr+Sr<cr&&bn.push(Jn),!I&&cr+Sr<wr&&bn.push(fr);for(var Tr=bn.length,xr=0;xr<Tr;xr++){var fi=bn[xr],Ii=[fi];Ii.push(Mt(fi).edge);for(var oa=Mt(fi).pred;Ii.indexOf(oa)===-1;)Ii.push(oa),Ii.push(Mt(oa).edge),oa=Mt(oa).pred;Ii=Ii.slice(Ii.indexOf(oa));for(var Fa=Ii[0].id(),Fi=0,Ci=2;Ci<Ii.length;Ci+=2)Ii[Ci].id()<Fa&&(Fa=Ii[Ci].id(),Fi=Ci);Ii=Ii.slice(Fi).concat(Ii.slice(0,Fi)),Ii.push(Ii[0]);var Ls=Ii.map(function(es){return es.id()}).join(",");Pn.indexOf(Ls)===-1&&(At.push(z.spawn(Ii)),Pn.push(Ls))}}else break}return{distanceTo:Bt,pathTo:Zt,hasNegativeWeightCycle:dt,negativeWeightCycles:At}}},eY=Math.sqrt(2),nY=function(g,x,T){T.length===0&&Ec("Karger-Stein must be run on a connected (sub)graph");for(var A=T[g],I=A[1],O=A[2],$=x[I],z=x[O],S=T,V=S.length-1;V>=0;V--){var U=S[V],tt=U[1],at=U[2];(x[tt]===$&&x[at]===z||x[tt]===z&&x[at]===$)&&S.splice(V,1)}for(var ut=0;ut<S.length;ut++){var dt=S[ut];dt[1]===z?(S[ut]=dt.slice(),S[ut][1]=$):dt[2]===z&&(S[ut]=dt.slice(),S[ut][2]=$)}for(var At=0;At<x.length;At++)x[At]===z&&(x[At]=$);return S},xL=function(g,x,T,A){for(;T>A;){var I=Math.floor(Math.random()*x.length);x=nY(I,g,x),T--}return x},rY={kargerStein:function(){var g=this,x=this.byGroup(),T=x.nodes,A=x.edges;A.unmergeBy(function(xn){return xn.isLoop()});var I=T.length,O=A.length,$=Math.ceil(Math.pow(Math.log(I)/Math.LN2,2)),z=Math.floor(I/eY);if(I<2){Ec("At least 2 nodes are required for Karger-Stein algorithm");return}for(var S=[],V=0;V<O;V++){var U=A[V];S.push([V,T.indexOf(U.source()),T.indexOf(U.target())])}for(var tt=1/0,at=[],ut=new Array(I),dt=new Array(I),At=new Array(I),xt=function(Pn,er){for(var Sn=0;Sn<I;Sn++)er[Sn]=Pn[Sn]},Mt=0;Mt<=$;Mt++){for(var Dt=0;Dt<I;Dt++)dt[Dt]=Dt;var Bt=xL(dt,S.slice(),I,z),Zt=Bt.slice();xt(dt,At);var Kt=xL(dt,Bt,z,2),$t=xL(At,Zt,z,2);Kt.length<=$t.length&&Kt.length<tt?(tt=Kt.length,at=Kt,xt(dt,ut)):$t.length<=Kt.length&&$t.length<tt&&(tt=$t.length,at=$t,xt(At,ut))}for(var ee=this.spawn(at.map(function(xn){return A[xn[0]]})),Ht=this.spawn(),ge=this.spawn(),be=ut[0],re=0;re<ut.length;re++){var Ne=ut[re],ve=T[re];Ne===be?Ht.merge(ve):ge.merge(ve)}var fn=function(Pn){var er=g.spawn();return Pn.forEach(function(Sn){er.merge(Sn),Sn.connectedEdges().forEach(function(Jn){g.contains(Jn)&&!ee.contains(Jn)&&er.merge(Jn)})}),er},$e=[fn(Ht),fn(ge)],qe={cut:ee,components:$e,partition1:Ht,partition2:ge};return qe}},iY=function(g){return{x:g.x,y:g.y}},AE=function(g,x,T){return{x:g.x*x+T.x,y:g.y*x+T.y}},VN=function(g,x,T){return{x:(g.x-T.x)/x,y:(g.y-T.y)/x}},z5=function(g){return{x:g[0],y:g[1]}},sY=function(g){for(var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:g.length,A=1/0,I=x;I<T;I++){var O=g[I];isFinite(O)&&(A=Math.min(O,A))}return A},aY=function(g){for(var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:g.length,A=-1/0,I=x;I<T;I++){var O=g[I];isFinite(O)&&(A=Math.max(O,A))}return A},oY=function(g){for(var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:g.length,A=0,I=0,O=x;O<T;O++){var $=g[O];isFinite($)&&(A+=$,I++)}return A/I},cY=function(g){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:g.length,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,O=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;A?g=g.slice(x,T):(T<g.length&&g.splice(T,g.length-T),x>0&&g.splice(0,x));for(var $=0,z=g.length-1;z>=0;z--){var S=g[z];O?isFinite(S)||(g[z]=-1/0,$++):g.splice(z,1)}I&&g.sort(function(tt,at){return tt-at});var V=g.length,U=Math.floor(V/2);return V%2!==0?g[U+1+$]:(g[U-1+$]+g[U+$])/2},uY=function(g){return Math.PI*g/180},LE=function(g,x){return Math.atan2(x,g)-Math.PI/2},kL=Math.log2||function(y){return Math.log(y)/Math.log(2)},GN=function(g){return g>0?1:g<0?-1:0},T3=function(g,x){return Math.sqrt(_3(g,x))},_3=function(g,x){var T=x.x-g.x,A=x.y-g.y;return T*T+A*A},lY=function(g){for(var x=g.length,T=0,A=0;A<x;A++)T+=g[A];for(var I=0;I<x;I++)g[I]=g[I]/T;return g},lf=function(g,x,T,A){return(1-A)*(1-A)*g+2*(1-A)*A*x+A*A*T},q5=function(g,x,T,A){return{x:lf(g.x,x.x,T.x,A),y:lf(g.y,x.y,T.y,A)}},hY=function(g,x,T,A){var I={x:x.x-g.x,y:x.y-g.y},O=T3(g,x),$={x:I.x/O,y:I.y/O};return T=T??0,A=A??T*O,{x:g.x+$.x*A,y:g.y+$.y*A}},wk=function(g,x,T){return Math.max(g,Math.min(T,x))},zd=function(g){if(g==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(g.x1!=null&&g.y1!=null){if(g.x2!=null&&g.y2!=null&&g.x2>=g.x1&&g.y2>=g.y1)return{x1:g.x1,y1:g.y1,x2:g.x2,y2:g.y2,w:g.x2-g.x1,h:g.y2-g.y1};if(g.w!=null&&g.h!=null&&g.w>=0&&g.h>=0)return{x1:g.x1,y1:g.y1,x2:g.x1+g.w,y2:g.y1+g.h,w:g.w,h:g.h}}},fY=function(g){return{x1:g.x1,x2:g.x2,w:g.w,y1:g.y1,y2:g.y2,h:g.h}},dY=function(g){g.x1=1/0,g.y1=1/0,g.x2=-1/0,g.y2=-1/0,g.w=0,g.h=0},gY=function(g,x){g.x1=Math.min(g.x1,x.x1),g.x2=Math.max(g.x2,x.x2),g.w=g.x2-g.x1,g.y1=Math.min(g.y1,x.y1),g.y2=Math.max(g.y2,x.y2),g.h=g.y2-g.y1},pY=function(g,x,T){g.x1=Math.min(g.x1,x),g.x2=Math.max(g.x2,x),g.w=g.x2-g.x1,g.y1=Math.min(g.y1,T),g.y2=Math.max(g.y2,T),g.h=g.y2-g.y1},ME=function(g){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return g.x1-=x,g.x2+=x,g.y1-=x,g.y2+=x,g.w=g.x2-g.x1,g.h=g.y2-g.y1,g},EL=function(g){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],T,A,I,O;if(x.length===1)T=A=I=O=x[0];else if(x.length===2)T=I=x[0],O=A=x[1];else if(x.length===4){var $=E(x,4);T=$[0],A=$[1],I=$[2],O=$[3]}return g.x1-=O,g.x2+=A,g.y1-=T,g.y2+=I,g.w=g.x2-g.x1,g.h=g.y2-g.y1,g},UN=function(g,x){g.x1=x.x1,g.y1=x.y1,g.x2=x.x2,g.y2=x.y2,g.w=g.x2-g.x1,g.h=g.y2-g.y1},TL=function(g,x){return!(g.x1>x.x2||x.x1>g.x2||g.x2<x.x1||x.x2<g.x1||g.y2<x.y1||x.y2<g.y1||g.y1>x.y2||x.y1>g.y2)},H5=function(g,x,T){return g.x1<=x&&x<=g.x2&&g.y1<=T&&T<=g.y2},bY=function(g,x){return H5(g,x.x,x.y)},WN=function(g,x){return H5(g,x.x1,x.y1)&&H5(g,x.x2,x.y2)},KN=function(g,x,T,A,I,O,$){var z=xk(I,O),S=I/2,V=O/2,U;{var tt=T-S+z-$,at=A-V-$,ut=T+S-z+$,dt=at;if(U=pm(g,x,T,A,tt,at,ut,dt,!1),U.length>0)return U}{var At=T+S+$,xt=A-V+z-$,Mt=At,Dt=A+V-z+$;if(U=pm(g,x,T,A,At,xt,Mt,Dt,!1),U.length>0)return U}{var Bt=T-S+z-$,Zt=A+V+$,Kt=T+S-z+$,$t=Zt;if(U=pm(g,x,T,A,Bt,Zt,Kt,$t,!1),U.length>0)return U}{var ee=T-S-$,Ht=A-V+z-$,ge=ee,be=A+V-z+$;if(U=pm(g,x,T,A,ee,Ht,ge,be,!1),U.length>0)return U}var re;{var Ne=T-S+z,ve=A-V+z;if(re=mk(g,x,T,A,Ne,ve,z+$),re.length>0&&re[0]<=Ne&&re[1]<=ve)return[re[0],re[1]]}{var fn=T+S-z,$e=A-V+z;if(re=mk(g,x,T,A,fn,$e,z+$),re.length>0&&re[0]>=fn&&re[1]<=$e)return[re[0],re[1]]}{var qe=T+S-z,xn=A+V-z;if(re=mk(g,x,T,A,qe,xn,z+$),re.length>0&&re[0]>=qe&&re[1]>=xn)return[re[0],re[1]]}{var Pn=T-S+z,er=A+V-z;if(re=mk(g,x,T,A,Pn,er,z+$),re.length>0&&re[0]<=Pn&&re[1]>=er)return[re[0],re[1]]}return[]},vY=function(g,x,T,A,I,O,$){var z=$,S=Math.min(T,I),V=Math.max(T,I),U=Math.min(A,O),tt=Math.max(A,O);return S-z<=g&&g<=V+z&&U-z<=x&&x<=tt+z},wY=function(g,x,T,A,I,O,$,z,S){var V={x1:Math.min(T,$,I)-S,x2:Math.max(T,$,I)+S,y1:Math.min(A,z,O)-S,y2:Math.max(A,z,O)+S};return!(g<V.x1||g>V.x2||x<V.y1||x>V.y2)},mY=function(g,x,T,A){T-=A;var I=x*x-4*g*T;if(I<0)return[];var O=Math.sqrt(I),$=2*g,z=(-x+O)/$,S=(-x-O)/$;return[z,S]},yY=function(g,x,T,A,I){var O=1e-5;g===0&&(g=O),x/=g,T/=g,A/=g;var $,z,S,V,U,tt,at,ut;if(z=(3*T-x*x)/9,S=-(27*A)+x*(9*T-2*(x*x)),S/=54,$=z*z*z+S*S,I[1]=0,at=x/3,$>0){U=S+Math.sqrt($),U=U<0?-Math.pow(-U,1/3):Math.pow(U,1/3),tt=S-Math.sqrt($),tt=tt<0?-Math.pow(-tt,1/3):Math.pow(tt,1/3),I[0]=-at+U+tt,at+=(U+tt)/2,I[4]=I[2]=-at,at=Math.sqrt(3)*(-tt+U)/2,I[3]=at,I[5]=-at;return}if(I[5]=I[3]=0,$===0){ut=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),I[0]=-at+2*ut,I[4]=I[2]=-(ut+at);return}z=-z,V=z*z*z,V=Math.acos(S/Math.sqrt(V)),ut=2*Math.sqrt(z),I[0]=-at+ut*Math.cos(V/3),I[2]=-at+ut*Math.cos((V+2*Math.PI)/3),I[4]=-at+ut*Math.cos((V+4*Math.PI)/3)},xY=function(g,x,T,A,I,O,$,z){var S=1*T*T-4*T*I+2*T*$+4*I*I-4*I*$+$*$+A*A-4*A*O+2*A*z+4*O*O-4*O*z+z*z,V=1*9*T*I-3*T*T-3*T*$-6*I*I+3*I*$+9*A*O-3*A*A-3*A*z-6*O*O+3*O*z,U=1*3*T*T-6*T*I+T*$-T*g+2*I*I+2*I*g-$*g+3*A*A-6*A*O+A*z-A*x+2*O*O+2*O*x-z*x,tt=1*T*I-T*T+T*g-I*g+A*O-A*A+A*x-O*x,at=[];yY(S,V,U,tt,at);for(var ut=1e-7,dt=[],At=0;At<6;At+=2)Math.abs(at[At+1])<ut&&at[At]>=0&&at[At]<=1&&dt.push(at[At]);dt.push(1),dt.push(0);for(var xt=-1,Mt,Dt,Bt,Zt=0;Zt<dt.length;Zt++)Mt=Math.pow(1-dt[Zt],2)*T+2*(1-dt[Zt])*dt[Zt]*I+dt[Zt]*dt[Zt]*$,Dt=Math.pow(1-dt[Zt],2)*A+2*(1-dt[Zt])*dt[Zt]*O+dt[Zt]*dt[Zt]*z,Bt=Math.pow(Mt-g,2)+Math.pow(Dt-x,2),xt>=0?Bt<xt&&(xt=Bt):xt=Bt;return xt},kY=function(g,x,T,A,I,O){var $=[g-T,x-A],z=[I-T,O-A],S=z[0]*z[0]+z[1]*z[1],V=$[0]*$[0]+$[1]*$[1],U=$[0]*z[0]+$[1]*z[1],tt=U*U/S;return U<0?V:tt>S?(g-I)*(g-I)+(x-O)*(x-O):V-tt},qd=function(g,x,T){for(var A,I,O,$,z,S=0,V=0;V<T.length/2;V++)if(A=T[V*2],I=T[V*2+1],V+1<T.length/2?(O=T[(V+1)*2],$=T[(V+1)*2+1]):(O=T[(V+1-T.length/2)*2],$=T[(V+1-T.length/2)*2+1]),!(A==g&&O==g))if(A>=g&&g>=O||A<=g&&g<=O)z=(g-A)/(O-A)*($-I)+I,z>x&&S++;else continue;return S%2!==0},ov=function(g,x,T,A,I,O,$,z,S){var V=new Array(T.length),U;z[0]!=null?(U=Math.atan(z[1]/z[0]),z[0]<0?U=U+Math.PI/2:U=-U-Math.PI/2):U=z;for(var tt=Math.cos(-U),at=Math.sin(-U),ut=0;ut<V.length/2;ut++)V[ut*2]=O/2*(T[ut*2]*tt-T[ut*2+1]*at),V[ut*2+1]=$/2*(T[ut*2+1]*tt+T[ut*2]*at),V[ut*2]+=A,V[ut*2+1]+=I;var dt;if(S>0){var At=XN(V,-S);dt=YN(At)}else dt=V;return qd(g,x,dt)},EY=function(g,x,T,A,I,O,$){for(var z=new Array(T.length),S=O/2,V=$/2,U=SL(O,$),tt=U*U,at=0;at<T.length/4;at++){var ut=void 0,dt=void 0;at===0?ut=T.length-2:ut=at*4-2,dt=at*4+2;var At=A+S*T[at*4],xt=I+V*T[at*4+1],Mt=-T[ut]*T[dt]-T[ut+1]*T[dt+1],Dt=U/Math.tan(Math.acos(Mt)/2),Bt=At-Dt*T[ut],Zt=xt-Dt*T[ut+1],Kt=At+Dt*T[dt],$t=xt+Dt*T[dt+1];z[at*4]=Bt,z[at*4+1]=Zt,z[at*4+2]=Kt,z[at*4+3]=$t;var ee=T[ut+1],Ht=-T[ut],ge=ee*T[dt]+Ht*T[dt+1];ge<0&&(ee*=-1,Ht*=-1);var be=Bt+ee*U,re=Zt+Ht*U,Ne=Math.pow(be-g,2)+Math.pow(re-x,2);if(Ne<=tt)return!0}return qd(g,x,z)},YN=function(g){for(var x=new Array(g.length/2),T,A,I,O,$,z,S,V,U=0;U<g.length/4;U++){T=g[U*4],A=g[U*4+1],I=g[U*4+2],O=g[U*4+3],U<g.length/4-1?($=g[(U+1)*4],z=g[(U+1)*4+1],S=g[(U+1)*4+2],V=g[(U+1)*4+3]):($=g[0],z=g[1],S=g[2],V=g[3]);var tt=pm(T,A,I,O,$,z,S,V,!0);x[U*2]=tt[0],x[U*2+1]=tt[1]}return x},XN=function(g,x){for(var T=new Array(g.length*2),A,I,O,$,z=0;z<g.length/2;z++){A=g[z*2],I=g[z*2+1],z<g.length/2-1?(O=g[(z+1)*2],$=g[(z+1)*2+1]):(O=g[0],$=g[1]);var S=$-I,V=-(O-A),U=Math.sqrt(S*S+V*V),tt=S/U,at=V/U;T[z*4]=A+tt*x,T[z*4+1]=I+at*x,T[z*4+2]=O+tt*x,T[z*4+3]=$+at*x}return T},TY=function(g,x,T,A,I,O){var $=T-g,z=A-x;$/=I,z/=O;var S=Math.sqrt($*$+z*z),V=S-1;if(V<0)return[];var U=V/S;return[(T-g)*U+g,(A-x)*U+x]},C3=function(g,x,T,A,I,O,$){return g-=I,x-=O,g/=T/2+$,x/=A/2+$,g*g+x*x<=1},mk=function(g,x,T,A,I,O,$){var z=[T-g,A-x],S=[g-I,x-O],V=z[0]*z[0]+z[1]*z[1],U=2*(S[0]*z[0]+S[1]*z[1]),tt=S[0]*S[0]+S[1]*S[1]-$*$,at=U*U-4*V*tt;if(at<0)return[];var ut=(-U+Math.sqrt(at))/(2*V),dt=(-U-Math.sqrt(at))/(2*V),At=Math.min(ut,dt),xt=Math.max(ut,dt),Mt=[];if(At>=0&&At<=1&&Mt.push(At),xt>=0&&xt<=1&&Mt.push(xt),Mt.length===0)return[];var Dt=Mt[0]*z[0]+g,Bt=Mt[0]*z[1]+x;if(Mt.length>1){if(Mt[0]==Mt[1])return[Dt,Bt];var Zt=Mt[1]*z[0]+g,Kt=Mt[1]*z[1]+x;return[Dt,Bt,Zt,Kt]}else return[Dt,Bt]},_L=function(g,x,T){return x<=g&&g<=T||T<=g&&g<=x?g:g<=x&&x<=T||T<=x&&x<=g?x:T},pm=function(g,x,T,A,I,O,$,z,S){var V=g-I,U=T-g,tt=$-I,at=x-O,ut=A-x,dt=z-O,At=tt*at-dt*V,xt=U*at-ut*V,Mt=dt*U-tt*ut;if(Mt!==0){var Dt=At/Mt,Bt=xt/Mt,Zt=.001,Kt=0-Zt,$t=1+Zt;return Kt<=Dt&&Dt<=$t&&Kt<=Bt&&Bt<=$t?[g+Dt*U,x+Dt*ut]:S?[g+Dt*U,x+Dt*ut]:[]}else return At===0||xt===0?_L(g,T,$)===$?[$,z]:_L(g,T,I)===I?[I,O]:_L(I,$,T)===T?[T,A]:[]:[]},yk=function(g,x,T,A,I,O,$,z){var S=[],V,U=new Array(T.length),tt=!0;O==null&&(tt=!1);var at;if(tt){for(var ut=0;ut<U.length/2;ut++)U[ut*2]=T[ut*2]*O+A,U[ut*2+1]=T[ut*2+1]*$+I;if(z>0){var dt=XN(U,-z);at=YN(dt)}else at=U}else at=T;for(var At,xt,Mt,Dt,Bt=0;Bt<at.length/2;Bt++)At=at[Bt*2],xt=at[Bt*2+1],Bt<at.length/2-1?(Mt=at[(Bt+1)*2],Dt=at[(Bt+1)*2+1]):(Mt=at[0],Dt=at[1]),V=pm(g,x,A,I,At,xt,Mt,Dt),V.length!==0&&S.push(V[0],V[1]);return S},_Y=function(g,x,T,A,I,O,$,z){for(var S=[],V,U=new Array(T.length),tt=O/2,at=$/2,ut=SL(O,$),dt=0;dt<T.length/4;dt++){var At=void 0,xt=void 0;dt===0?At=T.length-2:At=dt*4-2,xt=dt*4+2;var Mt=A+tt*T[dt*4],Dt=I+at*T[dt*4+1],Bt=-T[At]*T[xt]-T[At+1]*T[xt+1],Zt=ut/Math.tan(Math.acos(Bt)/2),Kt=Mt-Zt*T[At],$t=Dt-Zt*T[At+1],ee=Mt+Zt*T[xt],Ht=Dt+Zt*T[xt+1];dt===0?(U[T.length-2]=Kt,U[T.length-1]=$t):(U[dt*4-2]=Kt,U[dt*4-1]=$t),U[dt*4]=ee,U[dt*4+1]=Ht;var ge=T[At+1],be=-T[At],re=ge*T[xt]+be*T[xt+1];re<0&&(ge*=-1,be*=-1);var Ne=Kt+ge*ut,ve=$t+be*ut;V=mk(g,x,A,I,Ne,ve,ut),V.length!==0&&S.push(V[0],V[1])}for(var fn=0;fn<U.length/4;fn++)V=pm(g,x,A,I,U[fn*4],U[fn*4+1],U[fn*4+2],U[fn*4+3],!1),V.length!==0&&S.push(V[0],V[1]);if(S.length>2){for(var $e=[S[0],S[1]],qe=Math.pow($e[0]-g,2)+Math.pow($e[1]-x,2),xn=1;xn<S.length/2;xn++){var Pn=Math.pow(S[xn*2]-g,2)+Math.pow(S[xn*2+1]-x,2);Pn<=qe&&($e[0]=S[xn*2],$e[1]=S[xn*2+1],qe=Pn)}return $e}return S},DE=function(g,x,T){var A=[g[0]-x[0],g[1]-x[1]],I=Math.sqrt(A[0]*A[0]+A[1]*A[1]),O=(I-T)/I;return O<0&&(O=1e-5),[x[0]+O*A[0],x[1]+O*A[1]]},cd=function(g,x){var T=CL(g,x);return T=QN(T),T},QN=function(g){for(var x,T,A=g.length/2,I=1/0,O=1/0,$=-1/0,z=-1/0,S=0;S<A;S++)x=g[2*S],T=g[2*S+1],I=Math.min(I,x),$=Math.max($,x),O=Math.min(O,T),z=Math.max(z,T);for(var V=2/($-I),U=2/(z-O),tt=0;tt<A;tt++)x=g[2*tt]=g[2*tt]*V,T=g[2*tt+1]=g[2*tt+1]*U,I=Math.min(I,x),$=Math.max($,x),O=Math.min(O,T),z=Math.max(z,T);if(O<-1)for(var at=0;at<A;at++)T=g[2*at+1]=g[2*at+1]+(-1-O);return g},CL=function(g,x){var T=1/g*2*Math.PI,A=g%2===0?Math.PI/2+T/2:Math.PI/2;A+=x;for(var I=new Array(g*2),O,$=0;$<g;$++)O=$*T+A,I[2*$]=Math.cos(O),I[2*$+1]=Math.sin(-O);return I},xk=function(g,x){return Math.min(g/4,x/4,8)},SL=function(g,x){return Math.min(g/10,x/10,8)},ZN=function(){return 8},CY=function(g,x,T){return[g-2*x+T,2*(x-g),g]},AL=function(g,x){return{heightOffset:Math.min(15,.05*x),widthOffset:Math.min(100,.25*g),ctrlPtOffsetPct:.05}},SY=Hf({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(g){return 1}}),AY={pageRank:function(g){for(var x=SY(g),T=x.dampingFactor,A=x.precision,I=x.iterations,O=x.weight,$=this._private.cy,z=this.byGroup(),S=z.nodes,V=z.edges,U=S.length,tt=U*U,at=V.length,ut=new Array(tt),dt=new Array(U),At=(1-T)/U,xt=0;xt<U;xt++){for(var Mt=0;Mt<U;Mt++){var Dt=xt*U+Mt;ut[Dt]=0}dt[xt]=0}for(var Bt=0;Bt<at;Bt++){var Zt=V[Bt],Kt=Zt.data("source"),$t=Zt.data("target");if(Kt!==$t){var ee=S.indexOfId(Kt),Ht=S.indexOfId($t),ge=O(Zt),be=Ht*U+ee;ut[be]+=ge,dt[ee]+=ge}}for(var re=1/U+At,Ne=0;Ne<U;Ne++)if(dt[Ne]===0)for(var ve=0;ve<U;ve++){var fn=ve*U+Ne;ut[fn]=re}else for(var $e=0;$e<U;$e++){var qe=$e*U+Ne;ut[qe]=ut[qe]/dt[Ne]+At}for(var xn=new Array(U),Pn=new Array(U),er,Sn=0;Sn<U;Sn++)xn[Sn]=1;for(var Jn=0;Jn<I;Jn++){for(var fr=0;fr<U;fr++)Pn[fr]=0;for(var Sr=0;Sr<U;Sr++)for(var wr=0;wr<U;wr++){var cr=Sr*U+wr;Pn[Sr]+=ut[cr]*xn[wr]}lY(Pn),er=xn,xn=Pn,Pn=er;for(var bn=0,Tr=0;Tr<U;Tr++){var xr=er[Tr]-xn[Tr];bn+=xr*xr}if(bn<A)break}var fi={rank:function(oa){return oa=$.collection(oa)[0],xn[S.indexOf(oa)]}};return fi}},JN=Hf({root:null,weight:function(g){return 1},directed:!1,alpha:0}),V5={degreeCentralityNormalized:function(g){g=JN(g);var x=this.cy(),T=this.nodes(),A=T.length;if(g.directed){for(var V={},U={},tt=0,at=0,ut=0;ut<A;ut++){var dt=T[ut],At=dt.id();g.root=dt;var xt=this.degreeCentrality(g);tt<xt.indegree&&(tt=xt.indegree),at<xt.outdegree&&(at=xt.outdegree),V[At]=xt.indegree,U[At]=xt.outdegree}return{indegree:function(Dt){return tt==0?0:(Tt(Dt)&&(Dt=x.filter(Dt)),V[Dt.id()]/tt)},outdegree:function(Dt){return at===0?0:(Tt(Dt)&&(Dt=x.filter(Dt)),U[Dt.id()]/at)}}}else{for(var I={},O=0,$=0;$<A;$++){var z=T[$];g.root=z;var S=this.degreeCentrality(g);O<S.degree&&(O=S.degree),I[z.id()]=S.degree}return{degree:function(Dt){return O===0?0:(Tt(Dt)&&(Dt=x.filter(Dt)),I[Dt.id()]/O)}}}},degreeCentrality:function(g){g=JN(g);var x=this.cy(),T=this,A=g,I=A.root,O=A.weight,$=A.directed,z=A.alpha;if(I=x.collection(I)[0],$){for(var at=I.connectedEdges(),ut=at.filter(function(Kt){return Kt.target().same(I)&&T.has(Kt)}),dt=at.filter(function(Kt){return Kt.source().same(I)&&T.has(Kt)}),At=ut.length,xt=dt.length,Mt=0,Dt=0,Bt=0;Bt<ut.length;Bt++)Mt+=O(ut[Bt]);for(var Zt=0;Zt<dt.length;Zt++)Dt+=O(dt[Zt]);return{indegree:Math.pow(At,1-z)*Math.pow(Mt,z),outdegree:Math.pow(xt,1-z)*Math.pow(Dt,z)}}else{for(var S=I.connectedEdges().intersection(T),V=S.length,U=0,tt=0;tt<S.length;tt++)U+=O(S[tt]);return{degree:Math.pow(V,1-z)*Math.pow(U,z)}}}};V5.dc=V5.degreeCentrality,V5.dcn=V5.degreeCentralityNormalised=V5.degreeCentralityNormalized;var tF=Hf({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),G5={closenessCentralityNormalized:function(g){for(var x=tF(g),T=x.harmonic,A=x.weight,I=x.directed,O=this.cy(),$={},z=0,S=this.nodes(),V=this.floydWarshall({weight:A,directed:I}),U=0;U<S.length;U++){for(var tt=0,at=S[U],ut=0;ut<S.length;ut++)if(U!==ut){var dt=V.distance(at,S[ut]);T?tt+=1/dt:tt+=dt}T||(tt=1/tt),z<tt&&(z=tt),$[at.id()]=tt}return{closeness:function(xt){return z==0?0:(Tt(xt)?xt=O.filter(xt)[0].id():xt=xt.id(),$[xt]/z)}}},closenessCentrality:function(g){var x=tF(g),T=x.root,A=x.weight,I=x.directed,O=x.harmonic;T=this.filter(T)[0];for(var $=this.dijkstra({root:T,weight:A,directed:I}),z=0,S=this.nodes(),V=0;V<S.length;V++){var U=S[V];if(!U.same(T)){var tt=$.distanceTo(U);O?z+=1/tt:z+=tt}}return O?z:1/z}};G5.cc=G5.closenessCentrality,G5.ccn=G5.closenessCentralityNormalised=G5.closenessCentralityNormalized;var LY=Hf({weight:null,directed:!1}),LL={betweennessCentrality:function(g){for(var x=LY(g),T=x.directed,A=x.weight,I=A!=null,O=this.cy(),$=this.nodes(),z={},S={},V=0,U={set:function(Dt,Bt){S[Dt]=Bt,Bt>V&&(V=Bt)},get:function(Dt){return S[Dt]}},tt=0;tt<$.length;tt++){var at=$[tt],ut=at.id();T?z[ut]=at.outgoers().nodes():z[ut]=at.openNeighborhood().nodes(),U.set(ut,0)}for(var dt=function(Dt){for(var Bt=$[Dt].id(),Zt=[],Kt={},$t={},ee={},Ht=new vk(function(wr,cr){return ee[wr]-ee[cr]}),ge=0;ge<$.length;ge++){var be=$[ge].id();Kt[be]=[],$t[be]=0,ee[be]=1/0}for($t[Bt]=1,ee[Bt]=0,Ht.push(Bt);!Ht.empty();){var re=Ht.pop();if(Zt.push(re),I)for(var Ne=0;Ne<z[re].length;Ne++){var ve=z[re][Ne],fn=O.getElementById(re),$e=void 0;fn.edgesTo(ve).length>0?$e=fn.edgesTo(ve)[0]:$e=ve.edgesTo(fn)[0];var qe=A($e);ve=ve.id(),ee[ve]>ee[re]+qe&&(ee[ve]=ee[re]+qe,Ht.nodes.indexOf(ve)<0?Ht.push(ve):Ht.updateItem(ve),$t[ve]=0,Kt[ve]=[]),ee[ve]==ee[re]+qe&&($t[ve]=$t[ve]+$t[re],Kt[ve].push(re))}else for(var xn=0;xn<z[re].length;xn++){var Pn=z[re][xn].id();ee[Pn]==1/0&&(Ht.push(Pn),ee[Pn]=ee[re]+1),ee[Pn]==ee[re]+1&&($t[Pn]=$t[Pn]+$t[re],Kt[Pn].push(re))}}for(var er={},Sn=0;Sn<$.length;Sn++)er[$[Sn].id()]=0;for(;Zt.length>0;){for(var Jn=Zt.pop(),fr=0;fr<Kt[Jn].length;fr++){var Sr=Kt[Jn][fr];er[Sr]=er[Sr]+$t[Sr]/$t[Jn]*(1+er[Jn])}Jn!=$[Dt].id()&&U.set(Jn,U.get(Jn)+er[Jn])}},At=0;At<$.length;At++)dt(At);var xt={betweenness:function(Dt){var Bt=O.collection(Dt).id();return U.get(Bt)},betweennessNormalized:function(Dt){if(V==0)return 0;var Bt=O.collection(Dt).id();return U.get(Bt)/V}};return xt.betweennessNormalised=xt.betweennessNormalized,xt}};LL.bc=LL.betweennessCentrality;var MY=Hf({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(y){return 1}]}),DY=function(g){return MY(g)},IY=function(g,x){for(var T=0,A=0;A<x.length;A++)T+=x[A](g);return T},OY=function(g,x,T){for(var A=0;A<x;A++)g[A*x+A]=T},eF=function(g,x){for(var T,A=0;A<x;A++){T=0;for(var I=0;I<x;I++)T+=g[I*x+A];for(var O=0;O<x;O++)g[O*x+A]=g[O*x+A]/T}},PY=function(g,x,T){for(var A=new Array(T*T),I=0;I<T;I++){for(var O=0;O<T;O++)A[I*T+O]=0;for(var $=0;$<T;$++)for(var z=0;z<T;z++)A[I*T+z]+=g[I*T+$]*x[$*T+z]}return A},NY=function(g,x,T){for(var A=g.slice(0),I=1;I<T;I++)g=PY(g,A,x);return g},FY=function(g,x,T){for(var A=new Array(x*x),I=0;I<x*x;I++)A[I]=Math.pow(g[I],T);return eF(A,x),A},nF=function(g,x,T,A){for(var I=0;I<T;I++){var O=Math.round(g[I]*Math.pow(10,A))/Math.pow(10,A),$=Math.round(x[I]*Math.pow(10,A))/Math.pow(10,A);if(O!==$)return!1}return!0},BY=function(g,x,T,A){for(var I=[],O=0;O<x;O++){for(var $=[],z=0;z<x;z++)Math.round(g[O*x+z]*1e3)/1e3>0&&$.push(T[z]);$.length!==0&&I.push(A.collection($))}return I},RY=function(g,x){for(var T=0;T<g.length;T++)if(!x[T]||g[T].id()!==x[T].id())return!1;return!0},jY=function(g){for(var x=0;x<g.length;x++)for(var T=0;T<g.length;T++)x!=T&&RY(g[x],g[T])&&g.splice(T,1);return g},rF=function(g){for(var x=this.nodes(),T=this.edges(),A=this.cy(),I=DY(g),O={},$=0;$<x.length;$++)O[x[$].id()]=$;for(var z=x.length,S=z*z,V=new Array(S),U,tt=0;tt<S;tt++)V[tt]=0;for(var at=0;at<T.length;at++){var ut=T[at],dt=O[ut.source().id()],At=O[ut.target().id()],xt=IY(ut,I.attributes);V[dt*z+At]+=xt,V[At*z+dt]+=xt}OY(V,z,I.multFactor),eF(V,z);for(var Mt=!0,Dt=0;Mt&&Dt<I.maxIterations;)Mt=!1,U=NY(V,z,I.expandFactor),V=FY(U,z,I.inflateFactor),nF(V,U,S,4)||(Mt=!0),Dt++;var Bt=BY(V,z,x,A);return Bt=jY(Bt),Bt},$Y={markovClustering:rF,mcl:rF},zY=function(g){return g},iF=function(g,x){return Math.abs(x-g)},sF=function(g,x,T){return g+iF(x,T)},aF=function(g,x,T){return g+Math.pow(T-x,2)},qY=function(g){return Math.sqrt(g)},HY=function(g,x,T){return Math.max(g,iF(x,T))},kk=function(g,x,T,A,I){for(var O=arguments.length>5&&arguments[5]!==void 0?arguments[5]:zY,$=A,z,S,V=0;V<g;V++)z=x(V),S=T(V),$=I($,z,S);return O($)},U5={euclidean:function(g,x,T){return g>=2?kk(g,x,T,0,aF,qY):kk(g,x,T,0,sF)},squaredEuclidean:function(g,x,T){return kk(g,x,T,0,aF)},manhattan:function(g,x,T){return kk(g,x,T,0,sF)},max:function(g,x,T){return kk(g,x,T,-1/0,HY)}};U5["squared-euclidean"]=U5.squaredEuclidean,U5.squaredeuclidean=U5.squaredEuclidean;function IE(y,g,x,T,A,I){var O;return kt(y)?O=y:O=U5[y]||U5.euclidean,g===0&&kt(y)?O(A,I):O(g,x,T,A,I)}var VY=Hf({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),ML=function(g){return VY(g)},OE=function(g,x,T,A,I){var O=I!=="kMedoids",$=O?function(U){return T[U]}:function(U){return A[U](T)},z=function(tt){return A[tt](x)},S=T,V=x;return IE(g,A.length,$,z,S,V)},DL=function(g,x,T){for(var A=T.length,I=new Array(A),O=new Array(A),$=new Array(x),z=null,S=0;S<A;S++)I[S]=g.min(T[S]).value,O[S]=g.max(T[S]).value;for(var V=0;V<x;V++){z=[];for(var U=0;U<A;U++)z[U]=Math.random()*(O[U]-I[U])+I[U];$[V]=z}return $},oF=function(g,x,T,A,I){for(var O=1/0,$=0,z=0;z<x.length;z++){var S=OE(T,g,x[z],A,I);S<O&&(O=S,$=z)}return $},cF=function(g,x,T){for(var A=[],I=null,O=0;O<x.length;O++)I=x[O],T[I.id()]===g&&A.push(I);return A},GY=function(g,x,T){return Math.abs(x-g)<=T},UY=function(g,x,T){for(var A=0;A<g.length;A++)for(var I=0;I<g[A].length;I++){var O=Math.abs(g[A][I]-x[A][I]);if(O>T)return!1}return!0},WY=function(g,x,T){for(var A=0;A<T;A++)if(g===x[A])return!0;return!1},uF=function(g,x){var T=new Array(x);if(g.length<50)for(var A=0;A<x;A++){for(var I=g[Math.floor(Math.random()*g.length)];WY(I,T,A);)I=g[Math.floor(Math.random()*g.length)];T[A]=I}else for(var O=0;O<x;O++)T[O]=g[Math.floor(Math.random()*g.length)];return T},lF=function(g,x,T){for(var A=0,I=0;I<x.length;I++)A+=OE("manhattan",x[I],g,T,"kMedoids");return A},KY=function(g){var x=this.cy(),T=this.nodes(),A=null,I=ML(g),O=new Array(I.k),$={},z;I.testMode?typeof I.testCentroids=="number"?(I.testCentroids,z=DL(T,I.k,I.attributes)):f(I.testCentroids)==="object"?z=I.testCentroids:z=DL(T,I.k,I.attributes):z=DL(T,I.k,I.attributes);for(var S=!0,V=0;S&&V<I.maxIterations;){for(var U=0;U<T.length;U++)A=T[U],$[A.id()]=oF(A,z,I.distance,I.attributes,"kMeans");S=!1;for(var tt=0;tt<I.k;tt++){var at=cF(tt,T,$);if(at.length!==0){for(var ut=I.attributes.length,dt=z[tt],At=new Array(ut),xt=new Array(ut),Mt=0;Mt<ut;Mt++){xt[Mt]=0;for(var Dt=0;Dt<at.length;Dt++)A=at[Dt],xt[Mt]+=I.attributes[Mt](A);At[Mt]=xt[Mt]/at.length,GY(At[Mt],dt[Mt],I.sensitivityThreshold)||(S=!0)}z[tt]=At,O[tt]=x.collection(at)}}V++}return O},YY=function(g){var x=this.cy(),T=this.nodes(),A=null,I=ML(g),O=new Array(I.k),$,z={},S,V=new Array(I.k);I.testMode?typeof I.testCentroids=="number"||(f(I.testCentroids)==="object"?$=I.testCentroids:$=uF(T,I.k)):$=uF(T,I.k);for(var U=!0,tt=0;U&&tt<I.maxIterations;){for(var at=0;at<T.length;at++)A=T[at],z[A.id()]=oF(A,$,I.distance,I.attributes,"kMedoids");U=!1;for(var ut=0;ut<$.length;ut++){var dt=cF(ut,T,z);if(dt.length!==0){V[ut]=lF($[ut],dt,I.attributes);for(var At=0;At<dt.length;At++)S=lF(dt[At],dt,I.attributes),S<V[ut]&&(V[ut]=S,$[ut]=dt[At],U=!0);O[ut]=x.collection(dt)}}tt++}return O},XY=function(g,x,T,A,I){for(var O,$,z=0;z<x.length;z++)for(var S=0;S<g.length;S++)A[z][S]=Math.pow(T[z][S],I.m);for(var V=0;V<g.length;V++)for(var U=0;U<I.attributes.length;U++){O=0,$=0;for(var tt=0;tt<x.length;tt++)O+=A[tt][V]*I.attributes[U](x[tt]),$+=A[tt][V];g[V][U]=O/$}},QY=function(g,x,T,A,I){for(var O=0;O<g.length;O++)x[O]=g[O].slice();for(var $,z,S,V=2/(I.m-1),U=0;U<T.length;U++)for(var tt=0;tt<A.length;tt++){$=0;for(var at=0;at<T.length;at++)z=OE(I.distance,A[tt],T[U],I.attributes,"cmeans"),S=OE(I.distance,A[tt],T[at],I.attributes,"cmeans"),$+=Math.pow(z/S,V);g[tt][U]=1/$}},ZY=function(g,x,T,A){for(var I=new Array(T.k),O=0;O<I.length;O++)I[O]=[];for(var $,z,S=0;S<x.length;S++){$=-1/0,z=-1;for(var V=0;V<x[0].length;V++)x[S][V]>$&&($=x[S][V],z=V);I[z].push(g[S])}for(var U=0;U<I.length;U++)I[U]=A.collection(I[U]);return I},hF=function(g){var x=this.cy(),T=this.nodes(),A=ML(g),I,O,$,z,S;z=new Array(T.length);for(var V=0;V<T.length;V++)z[V]=new Array(A.k);$=new Array(T.length);for(var U=0;U<T.length;U++)$[U]=new Array(A.k);for(var tt=0;tt<T.length;tt++){for(var at=0,ut=0;ut<A.k;ut++)$[tt][ut]=Math.random(),at+=$[tt][ut];for(var dt=0;dt<A.k;dt++)$[tt][dt]=$[tt][dt]/at}O=new Array(A.k);for(var At=0;At<A.k;At++)O[At]=new Array(A.attributes.length);S=new Array(T.length);for(var xt=0;xt<T.length;xt++)S[xt]=new Array(A.k);for(var Mt=!0,Dt=0;Mt&&Dt<A.maxIterations;)Mt=!1,XY(O,T,$,S,A),QY($,z,O,T,A),UY($,z,A.sensitivityThreshold)||(Mt=!0),Dt++;return I=ZY(T,$,A,x),{clusters:I,degreeOfMembership:$}},JY={kMeans:KY,kMedoids:YY,fuzzyCMeans:hF,fcm:hF},tX=Hf({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),eX={single:"min",complete:"max"},nX=function(g){var x=tX(g),T=eX[x.linkage];return T!=null&&(x.linkage=T),x},fF=function(g,x,T,A,I){for(var O=0,$=1/0,z,S=I.attributes,V=function(Ht,ge){return IE(I.distance,S.length,function(be){return S[be](Ht)},function(be){return S[be](ge)},Ht,ge)},U=0;U<g.length;U++){var tt=g[U].key,at=T[tt][A[tt]];at<$&&(O=tt,$=at)}if(I.mode==="threshold"&&$>=I.threshold||I.mode==="dendrogram"&&g.length===1)return!1;var ut=x[O],dt=x[A[O]],At;I.mode==="dendrogram"?At={left:ut,right:dt,key:ut.key}:At={value:ut.value.concat(dt.value),key:ut.key},g[ut.index]=At,g.splice(dt.index,1),x[ut.key]=At;for(var xt=0;xt<g.length;xt++){var Mt=g[xt];ut.key===Mt.key?z=1/0:I.linkage==="min"?(z=T[ut.key][Mt.key],T[ut.key][Mt.key]>T[dt.key][Mt.key]&&(z=T[dt.key][Mt.key])):I.linkage==="max"?(z=T[ut.key][Mt.key],T[ut.key][Mt.key]<T[dt.key][Mt.key]&&(z=T[dt.key][Mt.key])):I.linkage==="mean"?z=(T[ut.key][Mt.key]*ut.size+T[dt.key][Mt.key]*dt.size)/(ut.size+dt.size):I.mode==="dendrogram"?z=V(Mt.value,ut.value):z=V(Mt.value[0],ut.value[0]),T[ut.key][Mt.key]=T[Mt.key][ut.key]=z}for(var Dt=0;Dt<g.length;Dt++){var Bt=g[Dt].key;if(A[Bt]===ut.key||A[Bt]===dt.key){for(var Zt=Bt,Kt=0;Kt<g.length;Kt++){var $t=g[Kt].key;T[Bt][$t]<T[Bt][Zt]&&(Zt=$t)}A[Bt]=Zt}g[Dt].index=Dt}return ut.key=dt.key=ut.index=dt.index=null,!0},PE=function y(g,x,T){g&&(g.value?x.push(g.value):(g.left&&y(g.left,x),g.right&&y(g.right,x)))},rX=function y(g,x){if(!g)return"";if(g.left&&g.right){var T=y(g.left,x),A=y(g.right,x),I=x.add({group:"nodes",data:{id:T+","+A}});return x.add({group:"edges",data:{source:T,target:I.id()}}),x.add({group:"edges",data:{source:A,target:I.id()}}),I.id()}else if(g.value)return g.value.id()},iX=function y(g,x,T){if(!g)return[];var A=[],I=[],O=[];return x===0?(g.left&&PE(g.left,A),g.right&&PE(g.right,I),O=A.concat(I),[T.collection(O)]):x===1?g.value?[T.collection(g.value)]:(g.left&&PE(g.left,A),g.right&&PE(g.right,I),[T.collection(A),T.collection(I)]):g.value?[T.collection(g.value)]:(g.left&&(A=y(g.left,x-1,T)),g.right&&(I=y(g.right,x-1,T)),A.concat(I))},dF=function(g){for(var x=this.cy(),T=this.nodes(),A=nX(g),I=A.attributes,O=function(Dt,Bt){return IE(A.distance,I.length,function(Zt){return I[Zt](Dt)},function(Zt){return I[Zt](Bt)},Dt,Bt)},$=[],z=[],S=[],V=[],U=0;U<T.length;U++){var tt={value:A.mode==="dendrogram"?T[U]:[T[U]],key:U,index:U};$[U]=tt,V[U]=tt,z[U]=[],S[U]=0}for(var at=0;at<$.length;at++)for(var ut=0;ut<=at;ut++){var dt=void 0;A.mode==="dendrogram"?dt=at===ut?1/0:O($[at].value,$[ut].value):dt=at===ut?1/0:O($[at].value[0],$[ut].value[0]),z[at][ut]=dt,z[ut][at]=dt,dt<z[at][S[at]]&&(S[at]=ut)}for(var At=fF($,V,z,S,A);At;)At=fF($,V,z,S,A);var xt;return A.mode==="dendrogram"?(xt=iX($[0],A.dendrogramDepth,x),A.addDendrogram&&rX($[0],x)):(xt=new Array($.length),$.forEach(function(Mt,Dt){Mt.key=Mt.index=null,xt[Dt]=x.collection(Mt.value)})),xt},sX={hierarchicalClustering:dF,hca:dF},aX=Hf({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),oX=function(g){var x=g.damping,T=g.preference;.5<=x&&x<1||Ec("Damping must range on [0.5, 1).  Got: ".concat(x));var A=["median","mean","min","max"];return A.some(function(I){return I===T})||rt(T)||Ec("Preference must be one of [".concat(A.map(function(I){return"'".concat(I,"'")}).join(", "),"] or a number.  Got: ").concat(T)),aX(g)},cX=function(g,x,T,A){var I=function($,z){return A[z]($)};return-IE(g,A.length,function(O){return I(x,O)},function(O){return I(T,O)},x,T)},uX=function(g,x){var T=null;return x==="median"?T=cY(g):x==="mean"?T=oY(g):x==="min"?T=sY(g):x==="max"?T=aY(g):T=x,T},lX=function(g,x,T){for(var A=[],I=0;I<g;I++)x[I*g+I]+T[I*g+I]>0&&A.push(I);return A},gF=function(g,x,T){for(var A=[],I=0;I<g;I++){for(var O=-1,$=-1/0,z=0;z<T.length;z++){var S=T[z];x[I*g+S]>$&&(O=S,$=x[I*g+S])}O>0&&A.push(O)}for(var V=0;V<T.length;V++)A[T[V]]=T[V];return A},hX=function(g,x,T){for(var A=gF(g,x,T),I=0;I<T.length;I++){for(var O=[],$=0;$<A.length;$++)A[$]===T[I]&&O.push($);for(var z=-1,S=-1/0,V=0;V<O.length;V++){for(var U=0,tt=0;tt<O.length;tt++)U+=x[O[tt]*g+O[V]];U>S&&(z=V,S=U)}T[I]=O[z]}return A=gF(g,x,T),A},pF=function(g){for(var x=this.cy(),T=this.nodes(),A=oX(g),I={},O=0;O<T.length;O++)I[T[O].id()]=O;var $,z,S,V,U,tt;$=T.length,z=$*$,S=new Array(z);for(var at=0;at<z;at++)S[at]=-1/0;for(var ut=0;ut<$;ut++)for(var dt=0;dt<$;dt++)ut!==dt&&(S[ut*$+dt]=cX(A.distance,T[ut],T[dt],A.attributes));V=uX(S,A.preference);for(var At=0;At<$;At++)S[At*$+At]=V;U=new Array(z);for(var xt=0;xt<z;xt++)U[xt]=0;tt=new Array(z);for(var Mt=0;Mt<z;Mt++)tt[Mt]=0;for(var Dt=new Array($),Bt=new Array($),Zt=new Array($),Kt=0;Kt<$;Kt++)Dt[Kt]=0,Bt[Kt]=0,Zt[Kt]=0;for(var $t=new Array($*A.minIterations),ee=0;ee<$t.length;ee++)$t[ee]=0;var Ht;for(Ht=0;Ht<A.maxIterations;Ht++){for(var ge=0;ge<$;ge++){for(var be=-1/0,re=-1/0,Ne=-1,ve=0,fn=0;fn<$;fn++)Dt[fn]=U[ge*$+fn],ve=tt[ge*$+fn]+S[ge*$+fn],ve>=be?(re=be,be=ve,Ne=fn):ve>re&&(re=ve);for(var $e=0;$e<$;$e++)U[ge*$+$e]=(1-A.damping)*(S[ge*$+$e]-be)+A.damping*Dt[$e];U[ge*$+Ne]=(1-A.damping)*(S[ge*$+Ne]-re)+A.damping*Dt[Ne]}for(var qe=0;qe<$;qe++){for(var xn=0,Pn=0;Pn<$;Pn++)Dt[Pn]=tt[Pn*$+qe],Bt[Pn]=Math.max(0,U[Pn*$+qe]),xn+=Bt[Pn];xn-=Bt[qe],Bt[qe]=U[qe*$+qe],xn+=Bt[qe];for(var er=0;er<$;er++)tt[er*$+qe]=(1-A.damping)*Math.min(0,xn-Bt[er])+A.damping*Dt[er];tt[qe*$+qe]=(1-A.damping)*(xn-Bt[qe])+A.damping*Dt[qe]}for(var Sn=0,Jn=0;Jn<$;Jn++){var fr=tt[Jn*$+Jn]+U[Jn*$+Jn]>0?1:0;$t[Ht%A.minIterations*$+Jn]=fr,Sn+=fr}if(Sn>0&&(Ht>=A.minIterations-1||Ht==A.maxIterations-1)){for(var Sr=0,wr=0;wr<$;wr++){Zt[wr]=0;for(var cr=0;cr<A.minIterations;cr++)Zt[wr]+=$t[cr*$+wr];(Zt[wr]===0||Zt[wr]===A.minIterations)&&Sr++}if(Sr===$)break}}for(var bn=lX($,U,tt),Tr=hX($,S,bn),xr={},fi=0;fi<bn.length;fi++)xr[bn[fi]]=[];for(var Ii=0;Ii<T.length;Ii++){var oa=I[T[Ii].id()],Fa=Tr[oa];Fa!=null&&xr[Fa].push(T[Ii])}for(var Fi=new Array(bn.length),Ci=0;Ci<bn.length;Ci++)Fi[Ci]=x.collection(xr[bn[Ci]]);return Fi},fX={affinityPropagation:pF,ap:pF},dX=Hf({root:void 0,directed:!1}),gX={hierholzer:function(g){if(!ft(g)){var x=arguments;g={root:x[0],directed:x[1]}}var T=dX(g),A=T.root,I=T.directed,O=this,$=!1,z,S,V;A&&(V=Tt(A)?this.filter(A)[0].id():A[0].id());var U={},tt={};I?O.forEach(function(Mt){var Dt=Mt.id();if(Mt.isNode()){var Bt=Mt.indegree(!0),Zt=Mt.outdegree(!0),Kt=Bt-Zt,$t=Zt-Bt;Kt==1?z?$=!0:z=Dt:$t==1?S?$=!0:S=Dt:($t>1||Kt>1)&&($=!0),U[Dt]=[],Mt.outgoers().forEach(function(ee){ee.isEdge()&&U[Dt].push(ee.id())})}else tt[Dt]=[void 0,Mt.target().id()]}):O.forEach(function(Mt){var Dt=Mt.id();if(Mt.isNode()){var Bt=Mt.degree(!0);Bt%2&&(z?S?$=!0:S=Dt:z=Dt),U[Dt]=[],Mt.connectedEdges().forEach(function(Zt){return U[Dt].push(Zt.id())})}else tt[Dt]=[Mt.source().id(),Mt.target().id()]});var at={found:!1,trail:void 0};if($)return at;if(S&&z)if(I){if(V&&S!=V)return at;V=S}else{if(V&&S!=V&&z!=V)return at;V||(V=S)}else V||(V=O[0].id());var ut=function(Dt){for(var Bt=Dt,Zt=[Dt],Kt,$t,ee;U[Bt].length;)Kt=U[Bt].shift(),$t=tt[Kt][0],ee=tt[Kt][1],Bt!=ee?(U[ee]=U[ee].filter(function(Ht){return Ht!=Kt}),Bt=ee):!I&&Bt!=$t&&(U[$t]=U[$t].filter(function(Ht){return Ht!=Kt}),Bt=$t),Zt.unshift(Kt),Zt.unshift(Bt);return Zt},dt=[],At=[];for(At=ut(V);At.length!=1;)U[At[0]].length==0?(dt.unshift(O.getElementById(At.shift())),dt.unshift(O.getElementById(At.shift()))):At=ut(At.shift()).concat(At);dt.unshift(O.getElementById(At.shift()));for(var xt in U)if(U[xt].length)return at;return at.found=!0,at.trail=this.spawn(dt,!0),at}},NE=function(){var g=this,x={},T=0,A=0,I=[],O=[],$={},z=function(tt,at){for(var ut=O.length-1,dt=[],At=g.spawn();O[ut].x!=tt||O[ut].y!=at;)dt.push(O.pop().edge),ut--;dt.push(O.pop().edge),dt.forEach(function(xt){var Mt=xt.connectedNodes().intersection(g);At.merge(xt),Mt.forEach(function(Dt){var Bt=Dt.id(),Zt=Dt.connectedEdges().intersection(g);At.merge(Dt),x[Bt].cutVertex?At.merge(Zt.filter(function(Kt){return Kt.isLoop()})):At.merge(Zt)})}),I.push(At)},S=function U(tt,at,ut){tt===ut&&(A+=1),x[at]={id:T,low:T++,cutVertex:!1};var dt=g.getElementById(at).connectedEdges().intersection(g);if(dt.size()===0)I.push(g.spawn(g.getElementById(at)));else{var At,xt,Mt,Dt;dt.forEach(function(Bt){At=Bt.source().id(),xt=Bt.target().id(),Mt=At===at?xt:At,Mt!==ut&&(Dt=Bt.id(),$[Dt]||($[Dt]=!0,O.push({x:at,y:Mt,edge:Bt})),Mt in x?x[at].low=Math.min(x[at].low,x[Mt].id):(U(tt,Mt,at),x[at].low=Math.min(x[at].low,x[Mt].low),x[at].id<=x[Mt].low&&(x[at].cutVertex=!0,z(at,Mt))))})}};g.forEach(function(U){if(U.isNode()){var tt=U.id();tt in x||(A=0,S(tt,tt),x[tt].cutVertex=A>1)}});var V=Object.keys(x).filter(function(U){return x[U].cutVertex}).map(function(U){return g.getElementById(U)});return{cut:g.spawn(V),components:I}},pX={hopcroftTarjanBiconnected:NE,htbc:NE,htb:NE,hopcroftTarjanBiconnectedComponents:NE},FE=function(){var g=this,x={},T=0,A=[],I=[],O=g.spawn(g),$=function z(S){I.push(S),x[S]={index:T,low:T++,explored:!1};var V=g.getElementById(S).connectedEdges().intersection(g);if(V.forEach(function(dt){var At=dt.target().id();At!==S&&(At in x||z(At),x[At].explored||(x[S].low=Math.min(x[S].low,x[At].low)))}),x[S].index===x[S].low){for(var U=g.spawn();;){var tt=I.pop();if(U.merge(g.getElementById(tt)),x[tt].low=x[S].index,x[tt].explored=!0,tt===S)break}var at=U.edgesWith(U),ut=U.merge(at);A.push(ut),O=O.difference(ut)}};return g.forEach(function(z){if(z.isNode()){var S=z.id();S in x||$(S)}}),{cut:O,components:A}},bX={tarjanStronglyConnected:FE,tsc:FE,tscc:FE,tarjanStronglyConnectedComponents:FE},bF={};[bk,WK,KK,XK,ZK,tY,rY,AY,V5,G5,LL,$Y,JY,sX,fX,gX,pX,bX].forEach(function(y){Ke(bF,y)});/*!
Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
Licensed under The MIT License (http://opensource.org/licenses/MIT)
*/var vF=0,wF=1,mF=2,cv=function y(g){if(!(this instanceof y))return new y(g);this.id="Thenable/1.0.7",this.state=vF,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof g=="function"&&g.call(this,this.fulfill.bind(this),this.reject.bind(this))};cv.prototype={fulfill:function(g){return yF(this,wF,"fulfillValue",g)},reject:function(g){return yF(this,mF,"rejectReason",g)},then:function(g,x){var T=this,A=new cv;return T.onFulfilled.push(EF(g,A,"fulfill")),T.onRejected.push(EF(x,A,"reject")),xF(T),A.proxy}};var yF=function(g,x,T,A){return g.state===vF&&(g.state=x,g[T]=A,xF(g)),g},xF=function(g){g.state===wF?kF(g,"onFulfilled",g.fulfillValue):g.state===mF&&kF(g,"onRejected",g.rejectReason)},kF=function(g,x,T){if(g[x].length!==0){var A=g[x];g[x]=[];var I=function(){for(var $=0;$<A.length;$++)A[$](T)};typeof setImmediate=="function"?setImmediate(I):setTimeout(I,0)}},EF=function(g,x,T){return function(A){if(typeof g!="function")x[T].call(x,A);else{var I;try{I=g(A)}catch(O){x.reject(O);return}vX(x,I)}}},vX=function y(g,x){if(g===x||g.proxy===x){g.reject(new TypeError("cannot resolve promise with itself"));return}var T;if(f(x)==="object"&&x!==null||typeof x=="function")try{T=x.then}catch(I){g.reject(I);return}if(typeof T=="function"){var A=!1;try{T.call(x,function(I){A||(A=!0,I===x?g.reject(new TypeError("circular thenable chain")):y(g,I))},function(I){A||(A=!0,g.reject(I))})}catch(I){A||g.reject(I)}return}g.fulfill(x)};cv.all=function(y){return new cv(function(g,x){for(var T=new Array(y.length),A=0,I=function(z,S){T[z]=S,A++,A===y.length&&g(T)},O=0;O<y.length;O++)(function($){var z=y[$],S=z!=null&&z.then!=null;if(S)z.then(function(U){I($,U)},function(U){x(U)});else{var V=z;I($,V)}})(O)})},cv.resolve=function(y){return new cv(function(g,x){g(y)})},cv.reject=function(y){return new cv(function(g,x){x(y)})};var W5=typeof Promise<"u"?Promise:cv,BE=function(g,x,T){var A=Rt(g),I=!A,O=this._private=Ke({duration:1e3},x,T);if(O.target=g,O.style=O.style||O.css,O.started=!1,O.playing=!1,O.hooked=!1,O.applying=!1,O.progress=0,O.completes=[],O.frames=[],O.complete&&kt(O.complete)&&O.completes.push(O.complete),I){var $=g.position();O.startPosition=O.startPosition||{x:$.x,y:$.y},O.startStyle=O.startStyle||g.cy().style().getAnimationStartStyle(g,O.style)}if(A){var z=g.pan();O.startPan={x:z.x,y:z.y},O.startZoom=g.zoom()}this.length=1,this[0]=this},S3=BE.prototype;Ke(S3,{instanceString:function(){return"animation"},hook:function(){var g=this._private;if(!g.hooked){var x,T=g.target._private.animation;g.queue?x=T.queue:x=T.current,x.push(this),ht(g.target)&&g.target.cy().addToAnimationPool(g.target),g.hooked=!0}return this},play:function(){var g=this._private;return g.progress===1&&(g.progress=0),g.playing=!0,g.started=!1,g.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var g=this._private;return g.applying=!0,g.started=!1,g.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var g=this._private;return g.playing=!1,g.started=!1,this},stop:function(){var g=this._private;return g.playing=!1,g.started=!1,g.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(g){var x=this._private;return g===void 0?x.progress*x.duration:this.progress(g/x.duration)},progress:function(g){var x=this._private,T=x.playing;return g===void 0?x.progress:(T&&this.pause(),x.progress=g,x.started=!1,T&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var g=this._private,x=g.playing;x&&this.pause(),g.progress=1-g.progress,g.started=!1;var T=function(S,V){var U=g[S];U!=null&&(g[S]=g[V],g[V]=U)};if(T("zoom","startZoom"),T("pan","startPan"),T("position","startPosition"),g.style)for(var A=0;A<g.style.length;A++){var I=g.style[A],O=I.name,$=g.startStyle[O];g.startStyle[O]=I,g.style[A]=$}return x&&this.play(),this},promise:function(g){var x=this._private,T;switch(g){case"frame":T=x.frames;break;default:case"complete":case"completed":T=x.completes}return new W5(function(A,I){T.push(function(){A()})})}}),S3.complete=S3.completed,S3.run=S3.play,S3.running=S3.playing;var wX={animated:function(){return function(){var x=this,T=x.length!==void 0,A=T?x:[x],I=this._private.cy||this;if(!I.styleEnabled())return!1;var O=A[0];if(O)return O._private.animation.current.length>0}},clearQueue:function(){return function(){var x=this,T=x.length!==void 0,A=T?x:[x],I=this._private.cy||this;if(!I.styleEnabled())return this;for(var O=0;O<A.length;O++){var $=A[O];$._private.animation.queue=[]}return this}},delay:function(){return function(x,T){var A=this._private.cy||this;return A.styleEnabled()?this.animate({delay:x,duration:x,complete:T}):this}},delayAnimation:function(){return function(x,T){var A=this._private.cy||this;return A.styleEnabled()?this.animation({delay:x,duration:x,complete:T}):this}},animation:function(){return function(x,T){var A=this,I=A.length!==void 0,O=I?A:[A],$=this._private.cy||this,z=!I,S=!z;if(!$.styleEnabled())return this;var V=$.style();x=Ke({},x,T);var U=Object.keys(x).length===0;if(U)return new BE(O[0],x);switch(x.duration===void 0&&(x.duration=400),x.duration){case"slow":x.duration=600;break;case"fast":x.duration=200;break}if(S&&(x.style=V.getPropsList(x.style||x.css),x.css=void 0),S&&x.renderedPosition!=null){var tt=x.renderedPosition,at=$.pan(),ut=$.zoom();x.position=VN(tt,ut,at)}if(z&&x.panBy!=null){var dt=x.panBy,At=$.pan();x.pan={x:At.x+dt.x,y:At.y+dt.y}}var xt=x.center||x.centre;if(z&&xt!=null){var Mt=$.getCenterPan(xt.eles,x.zoom);Mt!=null&&(x.pan=Mt)}if(z&&x.fit!=null){var Dt=x.fit,Bt=$.getFitViewport(Dt.eles||Dt.boundingBox,Dt.padding);Bt!=null&&(x.pan=Bt.pan,x.zoom=Bt.zoom)}if(z&&ft(x.zoom)){var Zt=$.getZoomedViewport(x.zoom);Zt!=null?(Zt.zoomed&&(x.zoom=Zt.zoom),Zt.panned&&(x.pan=Zt.pan)):x.zoom=null}return new BE(O[0],x)}},animate:function(){return function(x,T){var A=this,I=A.length!==void 0,O=I?A:[A],$=this._private.cy||this;if(!$.styleEnabled())return this;T&&(x=Ke({},x,T));for(var z=0;z<O.length;z++){var S=O[z],V=S.animated()&&(x.queue===void 0||x.queue),U=S.animation(x,V?{queue:!0}:void 0);U.play()}return this}},stop:function(){return function(x,T){var A=this,I=A.length!==void 0,O=I?A:[A],$=this._private.cy||this;if(!$.styleEnabled())return this;for(var z=0;z<O.length;z++){for(var S=O[z],V=S._private,U=V.animation.current,tt=0;tt<U.length;tt++){var at=U[tt],ut=at._private;T&&(ut.duration=0)}x&&(V.animation.queue=[]),T||(V.animation.current=[])}return $.notify("draw"),this}}},mX=Array.isArray,RE=mX,yX=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xX=/^\w*$/;function kX(y,g){if(RE(y))return!1;var x=typeof y;return x=="number"||x=="symbol"||x=="boolean"||y==null||Er(y)?!0:xX.test(y)||!yX.test(y)||g!=null&&y in Object(g)}var EX=kX,TX="[object AsyncFunction]",_X="[object Function]",CX="[object GeneratorFunction]",SX="[object Proxy]";function AX(y){if(!gn(y))return!1;var g=sd(y);return g==_X||g==CX||g==TX||g==SX}var LX=AX,MX=hi["__core-js_shared__"],IL=MX,TF=function(){var y=/[^.]+$/.exec(IL&&IL.keys&&IL.keys.IE_PROTO||"");return y?"Symbol(src)_1."+y:""}();function DX(y){return!!TF&&TF in y}var IX=DX,OX=Function.prototype,_F=OX.toString;function PX(y){if(y!=null){try{return _F.call(y)}catch{}try{return y+""}catch{}}return""}var NX=PX,FX=/[\\^$.*+?()[\]{}|]/g,BX=/^\[object .+?Constructor\]$/,RX=Function.prototype,jX=Object.prototype,CF=RX.toString,SF=jX.hasOwnProperty,$X=RegExp("^"+CF.call(SF).replace(FX,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function AF(y){if(!gn(y)||IX(y))return!1;var g=LX(y)?$X:BX;return g.test(NX(y))}var LF=AF;function zX(y,g){return y==null?void 0:y[g]}var qX=zX;function HX(y,g){var x=qX(y,g);return LF(x)?x:void 0}var OL=HX,VX=OL(Object,"create"),Ek=VX;function GX(){this.__data__=Ek?Ek(null):{},this.size=0}var UX=GX;function WX(y){var g=this.has(y)&&delete this.__data__[y];return this.size-=g?1:0,g}var MF=WX,KX="__lodash_hash_undefined__",YX=Object.prototype,XX=YX.hasOwnProperty;function QX(y){var g=this.__data__;if(Ek){var x=g[y];return x===KX?void 0:x}return XX.call(g,y)?g[y]:void 0}var ZX=QX,JX=Object.prototype,tQ=JX.hasOwnProperty;function eQ(y){var g=this.__data__;return Ek?g[y]!==void 0:tQ.call(g,y)}var nQ=eQ,rQ="__lodash_hash_undefined__";function iQ(y,g){var x=this.__data__;return this.size+=this.has(y)?0:1,x[y]=Ek&&g===void 0?rQ:g,this}var sQ=iQ;function K5(y){var g=-1,x=y==null?0:y.length;for(this.clear();++g<x;){var T=y[g];this.set(T[0],T[1])}}K5.prototype.clear=UX,K5.prototype.delete=MF,K5.prototype.get=ZX,K5.prototype.has=nQ,K5.prototype.set=sQ;var DF=K5;function aQ(){this.__data__=[],this.size=0}var oQ=aQ;function cQ(y,g){return y===g||y!==y&&g!==g}var IF=cQ;function uQ(y,g){for(var x=y.length;x--;)if(IF(y[x][0],g))return x;return-1}var jE=uQ,lQ=Array.prototype,hQ=lQ.splice;function fQ(y){var g=this.__data__,x=jE(g,y);if(x<0)return!1;var T=g.length-1;return x==T?g.pop():hQ.call(g,x,1),--this.size,!0}var dQ=fQ;function gQ(y){var g=this.__data__,x=jE(g,y);return x<0?void 0:g[x][1]}var pQ=gQ;function bQ(y){return jE(this.__data__,y)>-1}var vQ=bQ;function wQ(y,g){var x=this.__data__,T=jE(x,y);return T<0?(++this.size,x.push([y,g])):x[T][1]=g,this}var mQ=wQ;function Y5(y){var g=-1,x=y==null?0:y.length;for(this.clear();++g<x;){var T=y[g];this.set(T[0],T[1])}}Y5.prototype.clear=oQ,Y5.prototype.delete=dQ,Y5.prototype.get=pQ,Y5.prototype.has=vQ,Y5.prototype.set=mQ;var yQ=Y5,xQ=OL(hi,"Map"),kQ=xQ;function EQ(){this.size=0,this.__data__={hash:new DF,map:new(kQ||yQ),string:new DF}}var TQ=EQ;function _Q(y){var g=typeof y;return g=="string"||g=="number"||g=="symbol"||g=="boolean"?y!=="__proto__":y===null}var CQ=_Q;function SQ(y,g){var x=y.__data__;return CQ(g)?x[typeof g=="string"?"string":"hash"]:x.map}var $E=SQ;function AQ(y){var g=$E(this,y).delete(y);return this.size-=g?1:0,g}var LQ=AQ;function MQ(y){return $E(this,y).get(y)}var DQ=MQ;function IQ(y){return $E(this,y).has(y)}var OQ=IQ;function PQ(y,g){var x=$E(this,y),T=x.size;return x.set(y,g),this.size+=x.size==T?0:1,this}var NQ=PQ;function X5(y){var g=-1,x=y==null?0:y.length;for(this.clear();++g<x;){var T=y[g];this.set(T[0],T[1])}}X5.prototype.clear=TQ,X5.prototype.delete=LQ,X5.prototype.get=DQ,X5.prototype.has=OQ,X5.prototype.set=NQ;var OF=X5,FQ="Expected a function";function PL(y,g){if(typeof y!="function"||g!=null&&typeof g!="function")throw new TypeError(FQ);var x=function(){var T=arguments,A=g?g.apply(this,T):T[0],I=x.cache;if(I.has(A))return I.get(A);var O=y.apply(this,T);return x.cache=I.set(A,O)||I,O};return x.cache=new(PL.Cache||OF),x}PL.Cache=OF;var BQ=PL,RQ=500;function jQ(y){var g=BQ(y,function(T){return x.size===RQ&&x.clear(),T}),x=g.cache;return g}var $Q=jQ,zQ=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qQ=/\\(\\)?/g,HQ=$Q(function(y){var g=[];return y.charCodeAt(0)===46&&g.push(""),y.replace(zQ,function(x,T,A,I){g.push(A?I.replace(qQ,"$1"):T||x)}),g}),PF=HQ;function VQ(y,g){for(var x=-1,T=y==null?0:y.length,A=Array(T);++x<T;)A[x]=g(y[x],x,y);return A}var NF=VQ,GQ=1/0,FF=ss?ss.prototype:void 0,BF=FF?FF.toString:void 0;function RF(y){if(typeof y=="string")return y;if(RE(y))return NF(y,RF)+"";if(Er(y))return BF?BF.call(y):"";var g=y+"";return g=="0"&&1/y==-GQ?"-0":g}var UQ=RF;function WQ(y){return y==null?"":UQ(y)}var zE=WQ;function NL(y,g){return RE(y)?y:EX(y,g)?[y]:PF(zE(y))}var qE=NL,KQ=1/0;function YQ(y){if(typeof y=="string"||Er(y))return y;var g=y+"";return g=="0"&&1/y==-KQ?"-0":g}var FL=YQ;function XQ(y,g){g=qE(g,y);for(var x=0,T=g.length;y!=null&&x<T;)y=y[FL(g[x++])];return x&&x==T?y:void 0}var QQ=XQ;function jF(y,g,x){var T=y==null?void 0:QQ(y,g);return T===void 0?x:T}var ZQ=jF,JQ=function(){try{var y=OL(Object,"defineProperty");return y({},"",{}),y}catch{}}(),tZ=JQ;function eZ(y,g,x){g=="__proto__"&&tZ?tZ(y,g,{configurable:!0,enumerable:!0,value:x,writable:!0}):y[g]=x}var nZ=eZ,rZ=Object.prototype,iZ=rZ.hasOwnProperty;function sZ(y,g,x){var T=y[g];(!(iZ.call(y,g)&&IF(T,x))||x===void 0&&!(g in y))&&nZ(y,g,x)}var aZ=sZ,oZ=9007199254740991,pg=/^(?:0|[1-9]\d*)$/;function cZ(y,g){var x=typeof y;return g=g??oZ,!!g&&(x=="number"||x!="symbol"&&pg.test(y))&&y>-1&&y%1==0&&y<g}var bm=cZ;function $F(y,g,x,T){if(!gn(y))return y;g=qE(g,y);for(var A=-1,I=g.length,O=I-1,$=y;$!=null&&++A<I;){var z=FL(g[A]),S=x;if(z==="__proto__"||z==="constructor"||z==="prototype")return y;if(A!=O){var V=$[z];S=T?T(V,z,$):void 0,S===void 0&&(S=gn(V)?V:bm(g[A+1])?[]:{})}aZ($,z,S),$=$[z]}return y}var uZ=$F;function lZ(y,g,x){return y==null?y:uZ(y,g,x)}var hZ=lZ;function fZ(y,g){var x=-1,T=y.length;for(g||(g=Array(T));++x<T;)g[x]=y[x];return g}var dZ=fZ;function gZ(y){return RE(y)?NF(y,FL):Er(y)?[y]:dZ(PF(zE(y)))}var pZ=gZ,bZ={data:function(g){var x={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(A){},beforeSet:function(A,I){},onSet:function(A){},canSet:function(A){return!0}};return g=Ke({},x,g),function(A,I){var O=g,$=this,z=$.length!==void 0,S=z?$:[$],V=z?$[0]:$;if(Tt(A)){var U=A.indexOf(".")!==-1,tt=U&&pZ(A);if(O.allowGetting&&I===void 0){var at;return V&&(O.beforeGet(V),tt&&V._private[O.field][A]===void 0?at=ZQ(V._private[O.field],tt):at=V._private[O.field][A]),at}else if(O.allowSetting&&I!==void 0){var ut=!O.immutableKeys[A];if(ut){var dt=b({},A,I);O.beforeSet($,dt);for(var At=0,xt=S.length;At<xt;At++){var Mt=S[At];O.canSet(Mt)&&(tt&&V._private[O.field][A]===void 0?hZ(Mt._private[O.field],tt,I):Mt._private[O.field][A]=I)}O.updateStyle&&$.updateStyle(),O.onSet($),O.settingTriggersEvent&&$[O.triggerFnName](O.settingEvent)}}}else if(O.allowSetting&&ft(A)){var Dt=A,Bt,Zt,Kt=Object.keys(Dt);O.beforeSet($,Dt);for(var $t=0;$t<Kt.length;$t++){Bt=Kt[$t],Zt=Dt[Bt];var ee=!O.immutableKeys[Bt];if(ee)for(var Ht=0;Ht<S.length;Ht++){var ge=S[Ht];O.canSet(ge)&&(ge._private[O.field][Bt]=Zt)}}O.updateStyle&&$.updateStyle(),O.onSet($),O.settingTriggersEvent&&$[O.triggerFnName](O.settingEvent)}else if(O.allowBinding&&kt(A)){var be=A;$.on(O.bindingEvent,be)}else if(O.allowGetting&&A===void 0){var re;return V&&(O.beforeGet(V),re=V._private[O.field]),re}return $}},removeData:function(g){var x={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return g=Ke({},x,g),function(A){var I=g,O=this,$=O.length!==void 0,z=$?O:[O];if(Tt(A)){for(var S=A.split(/\s+/),V=S.length,U=0;U<V;U++){var tt=S[U];if(!J(tt)){var at=!I.immutableKeys[tt];if(at)for(var ut=0,dt=z.length;ut<dt;ut++)z[ut]._private[I.field][tt]=void 0}}I.triggerEvent&&O[I.triggerFnName](I.event)}else if(A===void 0){for(var At=0,xt=z.length;At<xt;At++)for(var Mt=z[At]._private[I.field],Dt=Object.keys(Mt),Bt=0;Bt<Dt.length;Bt++){var Zt=Dt[Bt],Kt=!I.immutableKeys[Zt];Kt&&(Mt[Zt]=void 0)}I.triggerEvent&&O[I.triggerFnName](I.event)}return O}}},vZ={eventAliasesOn:function(g){var x=g;x.addListener=x.listen=x.bind=x.on,x.unlisten=x.unbind=x.off=x.removeListener,x.trigger=x.emit,x.pon=x.promiseOn=function(T,A){var I=this,O=Array.prototype.slice.call(arguments,0);return new W5(function($,z){var S=function(at){I.off.apply(I,U),$(at)},V=O.concat([S]),U=V.concat([]);I.on.apply(I,V)})}}},jc={};[wX,bZ,vZ].forEach(function(y){Ke(jc,y)});var wZ={animate:jc.animate(),animation:jc.animation(),animated:jc.animated(),clearQueue:jc.clearQueue(),delay:jc.delay(),delayAnimation:jc.delayAnimation(),stop:jc.stop()},HE={classes:function(g){var x=this;if(g===void 0){var T=[];return x[0]._private.classes.forEach(function(ut){return T.push(ut)}),T}else yt(g)||(g=(g||"").match(/\S+/g)||[]);for(var A=[],I=new $5(g),O=0;O<x.length;O++){for(var $=x[O],z=$._private,S=z.classes,V=!1,U=0;U<g.length;U++){var tt=g[U],at=S.has(tt);if(!at){V=!0;break}}V||(V=S.size!==g.length),V&&(z.classes=I,A.push($))}return A.length>0&&this.spawn(A).updateStyle().emit("class"),x},addClass:function(g){return this.toggleClass(g,!0)},hasClass:function(g){var x=this[0];return x!=null&&x._private.classes.has(g)},toggleClass:function(g,x){yt(g)||(g=g.match(/\S+/g)||[]);for(var T=this,A=x===void 0,I=[],O=0,$=T.length;O<$;O++)for(var z=T[O],S=z._private.classes,V=!1,U=0;U<g.length;U++){var tt=g[U],at=S.has(tt),ut=!1;x||A&&!at?(S.add(tt),ut=!0):(!x||A&&at)&&(S.delete(tt),ut=!0),!V&&ut&&(I.push(z),V=!0)}return I.length>0&&this.spawn(I).updateStyle().emit("class"),T},removeClass:function(g){return this.toggleClass(g,!1)},flashClass:function(g,x){var T=this;if(x==null)x=250;else if(x===0)return T;return T.addClass(g),setTimeout(function(){T.removeClass(g)},x),T}};HE.className=HE.classNames=HE.classes;var dc={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Te,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};dc.variable="(?:[\\w-.]|(?:\\\\"+dc.metaChar+"))+",dc.className="(?:[\\w-]|(?:\\\\"+dc.metaChar+"))+",dc.value=dc.string+"|"+dc.number,dc.id=dc.variable,function(){var y,g,x;for(y=dc.comparatorOp.split("|"),x=0;x<y.length;x++)g=y[x],dc.comparatorOp+="|@"+g;for(y=dc.comparatorOp.split("|"),x=0;x<y.length;x++)g=y[x],!(g.indexOf("!")>=0)&&g!=="="&&(dc.comparatorOp+="|\\!"+g)}();var ru=function(){return{checks:[]}},ts={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},BL=[{selector:":selected",matches:function(g){return g.selected()}},{selector:":unselected",matches:function(g){return!g.selected()}},{selector:":selectable",matches:function(g){return g.selectable()}},{selector:":unselectable",matches:function(g){return!g.selectable()}},{selector:":locked",matches:function(g){return g.locked()}},{selector:":unlocked",matches:function(g){return!g.locked()}},{selector:":visible",matches:function(g){return g.visible()}},{selector:":hidden",matches:function(g){return!g.visible()}},{selector:":transparent",matches:function(g){return g.transparent()}},{selector:":grabbed",matches:function(g){return g.grabbed()}},{selector:":free",matches:function(g){return!g.grabbed()}},{selector:":removed",matches:function(g){return g.removed()}},{selector:":inside",matches:function(g){return!g.removed()}},{selector:":grabbable",matches:function(g){return g.grabbable()}},{selector:":ungrabbable",matches:function(g){return!g.grabbable()}},{selector:":animated",matches:function(g){return g.animated()}},{selector:":unanimated",matches:function(g){return!g.animated()}},{selector:":parent",matches:function(g){return g.isParent()}},{selector:":childless",matches:function(g){return g.isChildless()}},{selector:":child",matches:function(g){return g.isChild()}},{selector:":orphan",matches:function(g){return g.isOrphan()}},{selector:":nonorphan",matches:function(g){return g.isChild()}},{selector:":compound",matches:function(g){return g.isNode()?g.isParent():g.source().isParent()||g.target().isParent()}},{selector:":loop",matches:function(g){return g.isLoop()}},{selector:":simple",matches:function(g){return g.isSimple()}},{selector:":active",matches:function(g){return g.active()}},{selector:":inactive",matches:function(g){return!g.active()}},{selector:":backgrounding",matches:function(g){return g.backgrounding()}},{selector:":nonbackgrounding",matches:function(g){return!g.backgrounding()}}].sort(function(y,g){return jt(y.selector,g.selector)}),mZ=function(){for(var y={},g,x=0;x<BL.length;x++)g=BL[x],y[g.selector]=g.matches;return y}(),yZ=function(g,x){return mZ[g](x)},xZ="("+BL.map(function(y){return y.selector}).join("|")+")",Q5=function(g){return g.replace(new RegExp("\\\\("+dc.metaChar+")","g"),function(x,T){return T})},vm=function(g,x,T){g[g.length-1]=T},Ve=[{name:"group",query:!0,regex:"("+dc.group+")",populate:function(g,x,T){var A=E(T,1),I=A[0];x.checks.push({type:ts.GROUP,value:I==="*"?I:I+"s"})}},{name:"state",query:!0,regex:xZ,populate:function(g,x,T){var A=E(T,1),I=A[0];x.checks.push({type:ts.STATE,value:I})}},{name:"id",query:!0,regex:"\\#("+dc.id+")",populate:function(g,x,T){var A=E(T,1),I=A[0];x.checks.push({type:ts.ID,value:Q5(I)})}},{name:"className",query:!0,regex:"\\.("+dc.className+")",populate:function(g,x,T){var A=E(T,1),I=A[0];x.checks.push({type:ts.CLASS,value:Q5(I)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+dc.variable+")\\s*\\]",populate:function(g,x,T){var A=E(T,1),I=A[0];x.checks.push({type:ts.DATA_EXIST,field:Q5(I)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+dc.variable+")\\s*("+dc.comparatorOp+")\\s*("+dc.value+")\\s*\\]",populate:function(g,x,T){var A=E(T,3),I=A[0],O=A[1],$=A[2],z=new RegExp("^"+dc.string+"$").exec($)!=null;z?$=$.substring(1,$.length-1):$=parseFloat($),x.checks.push({type:ts.DATA_COMPARE,field:Q5(I),operator:O,value:$})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+dc.boolOp+")\\s*("+dc.variable+")\\s*\\]",populate:function(g,x,T){var A=E(T,2),I=A[0],O=A[1];x.checks.push({type:ts.DATA_BOOL,field:Q5(O),operator:I})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+dc.meta+")\\s*("+dc.comparatorOp+")\\s*("+dc.number+")\\s*\\]\\]",populate:function(g,x,T){var A=E(T,3),I=A[0],O=A[1],$=A[2];x.checks.push({type:ts.META_COMPARE,field:Q5(I),operator:O,value:parseFloat($)})}},{name:"nextQuery",separator:!0,regex:dc.separator,populate:function(g,x){var T=g.currentSubject,A=g.edgeCount,I=g.compoundCount,O=g[g.length-1];T!=null&&(O.subject=T,g.currentSubject=null),O.edgeCount=A,O.compoundCount=I,g.edgeCount=0,g.compoundCount=0;var $=g[g.length++]=ru();return $}},{name:"directedEdge",separator:!0,regex:dc.directedEdge,populate:function(g,x){if(g.currentSubject==null){var T=ru(),A=x,I=ru();return T.checks.push({type:ts.DIRECTED_EDGE,source:A,target:I}),vm(g,x,T),g.edgeCount++,I}else{var O=ru(),$=x,z=ru();return O.checks.push({type:ts.NODE_SOURCE,source:$,target:z}),vm(g,x,O),g.edgeCount++,z}}},{name:"undirectedEdge",separator:!0,regex:dc.undirectedEdge,populate:function(g,x){if(g.currentSubject==null){var T=ru(),A=x,I=ru();return T.checks.push({type:ts.UNDIRECTED_EDGE,nodes:[A,I]}),vm(g,x,T),g.edgeCount++,I}else{var O=ru(),$=x,z=ru();return O.checks.push({type:ts.NODE_NEIGHBOR,node:$,neighbor:z}),vm(g,x,O),z}}},{name:"child",separator:!0,regex:dc.child,populate:function(g,x){if(g.currentSubject==null){var T=ru(),A=ru(),I=g[g.length-1];return T.checks.push({type:ts.CHILD,parent:I,child:A}),vm(g,x,T),g.compoundCount++,A}else if(g.currentSubject===x){var O=ru(),$=g[g.length-1],z=ru(),S=ru(),V=ru(),U=ru();return O.checks.push({type:ts.COMPOUND_SPLIT,left:$,right:z,subject:S}),S.checks=x.checks,x.checks=[{type:ts.TRUE}],U.checks.push({type:ts.TRUE}),z.checks.push({type:ts.PARENT,parent:U,child:V}),vm(g,$,O),g.currentSubject=S,g.compoundCount++,V}else{var tt=ru(),at=ru(),ut=[{type:ts.PARENT,parent:tt,child:at}];return tt.checks=x.checks,x.checks=ut,g.compoundCount++,at}}},{name:"descendant",separator:!0,regex:dc.descendant,populate:function(g,x){if(g.currentSubject==null){var T=ru(),A=ru(),I=g[g.length-1];return T.checks.push({type:ts.DESCENDANT,ancestor:I,descendant:A}),vm(g,x,T),g.compoundCount++,A}else if(g.currentSubject===x){var O=ru(),$=g[g.length-1],z=ru(),S=ru(),V=ru(),U=ru();return O.checks.push({type:ts.COMPOUND_SPLIT,left:$,right:z,subject:S}),S.checks=x.checks,x.checks=[{type:ts.TRUE}],U.checks.push({type:ts.TRUE}),z.checks.push({type:ts.ANCESTOR,ancestor:U,descendant:V}),vm(g,$,O),g.currentSubject=S,g.compoundCount++,V}else{var tt=ru(),at=ru(),ut=[{type:ts.ANCESTOR,ancestor:tt,descendant:at}];return tt.checks=x.checks,x.checks=ut,g.compoundCount++,at}}},{name:"subject",modifier:!0,regex:dc.subject,populate:function(g,x){if(g.currentSubject!=null&&g.currentSubject!==x)return Wo("Redefinition of subject in selector `"+g.toString()+"`"),!1;g.currentSubject=x;var T=g[g.length-1],A=T.checks[0],I=A==null?null:A.type;I===ts.DIRECTED_EDGE?A.type=ts.NODE_TARGET:I===ts.UNDIRECTED_EDGE&&(A.type=ts.NODE_NEIGHBOR,A.node=A.nodes[1],A.neighbor=A.nodes[0],A.nodes=null)}}];Ve.forEach(function(y){return y.regexObj=new RegExp("^"+y.regex)});var kZ=function(g){for(var x,T,A,I=0;I<Ve.length;I++){var O=Ve[I],$=O.name,z=g.match(O.regexObj);if(z!=null){T=z,x=O,A=$;var S=z[0];g=g.substring(S.length);break}}return{expr:x,match:T,name:A,remaining:g}},EZ=function(g){var x=g.match(/^\s+/);if(x){var T=x[0];g=g.substring(T.length)}return g},TZ=function(g){var x=this,T=x.inputText=g,A=x[0]=ru();for(x.length=1,T=EZ(T);;){var I=kZ(T);if(I.expr==null)return Wo("The selector `"+g+"`is invalid"),!1;var O=I.match.slice(1),$=I.expr.populate(x,A,O);if($===!1)return!1;if($!=null&&(A=$),T=I.remaining,T.match(/^\s*$/))break}var z=x[x.length-1];x.currentSubject!=null&&(z.subject=x.currentSubject),z.edgeCount=x.edgeCount,z.compoundCount=x.compoundCount;for(var S=0;S<x.length;S++){var V=x[S];if(V.compoundCount>0&&V.edgeCount>0)return Wo("The selector `"+g+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(V.edgeCount>1)return Wo("The selector `"+g+"` is invalid because it uses multiple edge selectors"),!1;V.edgeCount===1&&Wo("The selector `"+g+"` is deprecated.  Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons.  Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},_Z=function(){if(this.toStringCache!=null)return this.toStringCache;for(var g=function(V){return V??""},x=function(V){return Tt(V)?'"'+V+'"':g(V)},T=function(V){return" "+V+" "},A=function(V,U){var tt=V.type,at=V.value;switch(tt){case ts.GROUP:{var ut=g(at);return ut.substring(0,ut.length-1)}case ts.DATA_COMPARE:{var dt=V.field,At=V.operator;return"["+dt+T(g(At))+x(at)+"]"}case ts.DATA_BOOL:{var xt=V.operator,Mt=V.field;return"["+g(xt)+Mt+"]"}case ts.DATA_EXIST:{var Dt=V.field;return"["+Dt+"]"}case ts.META_COMPARE:{var Bt=V.operator,Zt=V.field;return"[["+Zt+T(g(Bt))+x(at)+"]]"}case ts.STATE:return at;case ts.ID:return"#"+at;case ts.CLASS:return"."+at;case ts.PARENT:case ts.CHILD:return I(V.parent,U)+T(">")+I(V.child,U);case ts.ANCESTOR:case ts.DESCENDANT:return I(V.ancestor,U)+" "+I(V.descendant,U);case ts.COMPOUND_SPLIT:{var Kt=I(V.left,U),$t=I(V.subject,U),ee=I(V.right,U);return Kt+(Kt.length>0?" ":"")+$t+ee}case ts.TRUE:return""}},I=function(V,U){return V.checks.reduce(function(tt,at,ut){return tt+(U===V&&ut===0?"$":"")+A(at,U)},"")},O="",$=0;$<this.length;$++){var z=this[$];O+=I(z,z.subject),this.length>1&&$<this.length-1&&(O+=", ")}return this.toStringCache=O,O},CZ={parse:TZ,toString:_Z},zF=function(g,x,T){var A,I=Tt(g),O=rt(g),$=Tt(T),z,S,V=!1,U=!1,tt=!1;switch(x.indexOf("!")>=0&&(x=x.replace("!",""),U=!0),x.indexOf("@")>=0&&(x=x.replace("@",""),V=!0),(I||$||V)&&(z=!I&&!O?"":""+g,S=""+T),V&&(g=z=z.toLowerCase(),T=S=S.toLowerCase()),x){case"*=":A=z.indexOf(S)>=0;break;case"$=":A=z.indexOf(S,z.length-S.length)>=0;break;case"^=":A=z.indexOf(S)===0;break;case"=":A=g===T;break;case">":tt=!0,A=g>T;break;case">=":tt=!0,A=g>=T;break;case"<":tt=!0,A=g<T;break;case"<=":tt=!0,A=g<=T;break;default:A=!1;break}return U&&(g!=null||!tt)&&(A=!A),A},SZ=function(g,x){switch(x){case"?":return!!g;case"!":return!g;case"^":return g===void 0}},AZ=function(g){return g!==void 0},RL=function(g,x){return g.data(x)},LZ=function(g,x){return g[x]()},il=[],zu=function(g,x){return g.checks.every(function(T){return il[T.type](T,x)})};il[ts.GROUP]=function(y,g){var x=y.value;return x==="*"||x===g.group()},il[ts.STATE]=function(y,g){var x=y.value;return yZ(x,g)},il[ts.ID]=function(y,g){var x=y.value;return g.id()===x},il[ts.CLASS]=function(y,g){var x=y.value;return g.hasClass(x)},il[ts.META_COMPARE]=function(y,g){var x=y.field,T=y.operator,A=y.value;return zF(LZ(g,x),T,A)},il[ts.DATA_COMPARE]=function(y,g){var x=y.field,T=y.operator,A=y.value;return zF(RL(g,x),T,A)},il[ts.DATA_BOOL]=function(y,g){var x=y.field,T=y.operator;return SZ(RL(g,x),T)},il[ts.DATA_EXIST]=function(y,g){var x=y.field;return y.operator,AZ(RL(g,x))},il[ts.UNDIRECTED_EDGE]=function(y,g){var x=y.nodes[0],T=y.nodes[1],A=g.source(),I=g.target();return zu(x,A)&&zu(T,I)||zu(T,A)&&zu(x,I)},il[ts.NODE_NEIGHBOR]=function(y,g){return zu(y.node,g)&&g.neighborhood().some(function(x){return x.isNode()&&zu(y.neighbor,x)})},il[ts.DIRECTED_EDGE]=function(y,g){return zu(y.source,g.source())&&zu(y.target,g.target())},il[ts.NODE_SOURCE]=function(y,g){return zu(y.source,g)&&g.outgoers().some(function(x){return x.isNode()&&zu(y.target,x)})},il[ts.NODE_TARGET]=function(y,g){return zu(y.target,g)&&g.incomers().some(function(x){return x.isNode()&&zu(y.source,x)})},il[ts.CHILD]=function(y,g){return zu(y.child,g)&&zu(y.parent,g.parent())},il[ts.PARENT]=function(y,g){return zu(y.parent,g)&&g.children().some(function(x){return zu(y.child,x)})},il[ts.DESCENDANT]=function(y,g){return zu(y.descendant,g)&&g.ancestors().some(function(x){return zu(y.ancestor,x)})},il[ts.ANCESTOR]=function(y,g){return zu(y.ancestor,g)&&g.descendants().some(function(x){return zu(y.descendant,x)})},il[ts.COMPOUND_SPLIT]=function(y,g){return zu(y.subject,g)&&zu(y.left,g)&&zu(y.right,g)},il[ts.TRUE]=function(){return!0},il[ts.COLLECTION]=function(y,g){var x=y.value;return x.has(g)},il[ts.FILTER]=function(y,g){var x=y.value;return x(g)};var MZ=function(g){var x=this;if(x.length===1&&x[0].checks.length===1&&x[0].checks[0].type===ts.ID)return g.getElementById(x[0].checks[0].value).collection();var T=function(I){for(var O=0;O<x.length;O++){var $=x[O];if(zu($,I))return!0}return!1};return x.text()==null&&(T=function(){return!0}),g.filter(T)},DZ=function(g){for(var x=this,T=0;T<x.length;T++){var A=x[T];if(zu(A,g))return!0}return!1},IZ={matches:DZ,filter:MZ},wm=function(g){this.inputText=g,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,g==null||Tt(g)&&g.match(/^\s*$/)||(ht(g)?this.addQuery({checks:[{type:ts.COLLECTION,value:g.collection()}]}):kt(g)?this.addQuery({checks:[{type:ts.FILTER,value:g}]}):Tt(g)?this.parse(g)||(this.invalid=!0):Ec("A selector must be created from a string; found "))},uv=wm.prototype;[CZ,IZ].forEach(function(y){return Ke(uv,y)}),uv.text=function(){return this.inputText},uv.size=function(){return this.length},uv.eq=function(y){return this[y]},uv.sameText=function(y){return!this.invalid&&!y.invalid&&this.text()===y.text()},uv.addQuery=function(y){this[this.length++]=y},uv.selector=uv.toString;var mp={allAre:function(g){var x=new wm(g);return this.every(function(T){return x.matches(T)})},is:function(g){var x=new wm(g);return this.some(function(T){return x.matches(T)})},some:function(g,x){for(var T=0;T<this.length;T++){var A=x?g.apply(x,[this[T],T,this]):g(this[T],T,this);if(A)return!0}return!1},every:function(g,x){for(var T=0;T<this.length;T++){var A=x?g.apply(x,[this[T],T,this]):g(this[T],T,this);if(!A)return!1}return!0},same:function(g){if(this===g)return!0;g=this.cy().collection(g);var x=this.length,T=g.length;return x!==T?!1:x===1?this[0]===g[0]:this.every(function(A){return g.hasElementWithId(A.id())})},anySame:function(g){return g=this.cy().collection(g),this.some(function(x){return g.hasElementWithId(x.id())})},allAreNeighbors:function(g){g=this.cy().collection(g);var x=this.neighborhood();return g.every(function(T){return x.hasElementWithId(T.id())})},contains:function(g){g=this.cy().collection(g);var x=this;return g.every(function(T){return x.hasElementWithId(T.id())})}};mp.allAreNeighbours=mp.allAreNeighbors,mp.has=mp.contains,mp.equal=mp.equals=mp.same;var ud=function(g,x){return function(A,I,O,$){var z=A,S=this,V;if(z==null?V="":ht(z)&&z.length===1&&(V=z.id()),S.length===1&&V){var U=S[0]._private,tt=U.traversalCache=U.traversalCache||{},at=tt[x]=tt[x]||[],ut=ad(V),dt=at[ut];return dt||(at[ut]=g.call(S,A,I,O,$))}else return g.call(S,A,I,O,$)}},Z5={parent:function(g){var x=[];if(this.length===1){var T=this[0]._private.parent;if(T)return T}for(var A=0;A<this.length;A++){var I=this[A],O=I._private.parent;O&&x.push(O)}return this.spawn(x,!0).filter(g)},parents:function(g){for(var x=[],T=this.parent();T.nonempty();){for(var A=0;A<T.length;A++){var I=T[A];x.push(I)}T=T.parent()}return this.spawn(x,!0).filter(g)},commonAncestors:function(g){for(var x,T=0;T<this.length;T++){var A=this[T],I=A.parents();x=x||I,x=x.intersect(I)}return x.filter(g)},orphans:function(g){return this.stdFilter(function(x){return x.isOrphan()}).filter(g)},nonorphans:function(g){return this.stdFilter(function(x){return x.isChild()}).filter(g)},children:ud(function(y){for(var g=[],x=0;x<this.length;x++)for(var T=this[x],A=T._private.children,I=0;I<A.length;I++)g.push(A[I]);return this.spawn(g,!0).filter(y)},"children"),siblings:function(g){return this.parent().children().not(this).filter(g)},isParent:function(){var g=this[0];if(g)return g.isNode()&&g._private.children.length!==0},isChildless:function(){var g=this[0];if(g)return g.isNode()&&g._private.children.length===0},isChild:function(){var g=this[0];if(g)return g.isNode()&&g._private.parent!=null},isOrphan:function(){var g=this[0];if(g)return g.isNode()&&g._private.parent==null},descendants:function(g){var x=[];function T(A){for(var I=0;I<A.length;I++){var O=A[I];x.push(O),O.children().nonempty()&&T(O.children())}}return T(this.children()),this.spawn(x,!0).filter(g)}};function VE(y,g,x,T){for(var A=[],I=new $5,O=y.cy(),$=O.hasCompoundNodes(),z=0;z<y.length;z++){var S=y[z];x?A.push(S):$&&T(A,I,S)}for(;A.length>0;){var V=A.shift();g(V),I.add(V.id()),$&&T(A,I,V)}return y}function Tk(y,g,x){if(x.isParent())for(var T=x._private.children,A=0;A<T.length;A++){var I=T[A];g.has(I.id())||y.push(I)}}Z5.forEachDown=function(y){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return VE(this,y,g,Tk)};function qF(y,g,x){if(x.isChild()){var T=x._private.parent;g.has(T.id())||y.push(T)}}Z5.forEachUp=function(y){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return VE(this,y,g,qF)};function OZ(y,g,x){qF(y,g,x),Tk(y,g,x)}Z5.forEachUpAndDown=function(y){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return VE(this,y,g,OZ)},Z5.ancestors=Z5.parents;var _k,HF;_k=HF={data:jc.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:jc.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:jc.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:jc.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:jc.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:jc.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var g=this[0];if(g)return g._private.data.id}},_k.attr=_k.data,_k.removeAttr=_k.removeData;var PZ=HF,GE={};function J5(y){return function(g){var x=this;if(g===void 0&&(g=!0),x.length!==0)if(x.isNode()&&!x.removed()){for(var T=0,A=x[0],I=A._private.edges,O=0;O<I.length;O++){var $=I[O];!g&&$.isLoop()||(T+=y(A,$))}return T}else return}}Ke(GE,{degree:J5(function(y,g){return g.source().same(g.target())?2:1}),indegree:J5(function(y,g){return g.target().same(y)?1:0}),outdegree:J5(function(y,g){return g.source().same(y)?1:0})});function t6(y,g){return function(x){for(var T,A=this.nodes(),I=0;I<A.length;I++){var O=A[I],$=O[y](x);$!==void 0&&(T===void 0||g($,T))&&(T=$)}return T}}Ke(GE,{minDegree:t6("degree",function(y,g){return y<g}),maxDegree:t6("degree",function(y,g){return y>g}),minIndegree:t6("indegree",function(y,g){return y<g}),maxIndegree:t6("indegree",function(y,g){return y>g}),minOutdegree:t6("outdegree",function(y,g){return y<g}),maxOutdegree:t6("outdegree",function(y,g){return y>g})}),Ke(GE,{totalDegree:function(g){for(var x=0,T=this.nodes(),A=0;A<T.length;A++)x+=T[A].degree(g);return x}});var yp,VF,Ck=function(g,x,T){for(var A=0;A<g.length;A++){var I=g[A];if(!I.locked()){var O=I._private.position,$={x:x.x!=null?x.x-O.x:0,y:x.y!=null?x.y-O.y:0};I.isParent()&&!($.x===0&&$.y===0)&&I.children().shift($,T),I.dirtyBoundingBoxCache()}}},GF={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(g){g.updateCompoundBounds()},beforeSet:function(g,x){Ck(g,x,!1)},onSet:function(g){g.dirtyCompoundBoundsCache()},canSet:function(g){return!g.locked()}};yp=VF={position:jc.data(GF),silentPosition:jc.data(Ke({},GF,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(g,x){Ck(g,x,!0)},onSet:function(g){g.dirtyCompoundBoundsCache()}})),positions:function(g,x){if(ft(g))x?this.silentPosition(g):this.position(g);else if(kt(g)){var T=g,A=this.cy();A.startBatch();for(var I=0;I<this.length;I++){var O=this[I],$=void 0;($=T(O,I))&&(x?O.silentPosition($):O.position($))}A.endBatch()}return this},silentPositions:function(g){return this.positions(g,!0)},shift:function(g,x,T){var A;if(ft(g)?(A={x:rt(g.x)?g.x:0,y:rt(g.y)?g.y:0},T=x):Tt(g)&&rt(x)&&(A={x:0,y:0},A[g]=x),A!=null){var I=this.cy();I.startBatch();for(var O=0;O<this.length;O++){var $=this[O];if(!(I.hasCompoundNodes()&&$.isChild()&&$.ancestors().anySame(this))){var z=$.position(),S={x:z.x+A.x,y:z.y+A.y};T?$.silentPosition(S):$.position(S)}}I.endBatch()}return this},silentShift:function(g,x){return ft(g)?this.shift(g,!0):Tt(g)&&rt(x)&&this.shift(g,x,!0),this},renderedPosition:function(g,x){var T=this[0],A=this.cy(),I=A.zoom(),O=A.pan(),$=ft(g)?g:void 0,z=$!==void 0||x!==void 0&&Tt(g);if(T&&T.isNode())if(z)for(var S=0;S<this.length;S++){var V=this[S];x!==void 0?V.position(g,(x-O[g])/I):$!==void 0&&V.position(VN($,I,O))}else{var U=T.position();return $=AE(U,I,O),g===void 0?$:$[g]}else if(!z)return;return this},relativePosition:function(g,x){var T=this[0],A=this.cy(),I=ft(g)?g:void 0,O=I!==void 0||x!==void 0&&Tt(g),$=A.hasCompoundNodes();if(T&&T.isNode())if(O)for(var z=0;z<this.length;z++){var S=this[z],V=$?S.parent():null,U=V&&V.length>0,tt=U;U&&(V=V[0]);var at=tt?V.position():{x:0,y:0};x!==void 0?S.position(g,x+at[g]):I!==void 0&&S.position({x:I.x+at.x,y:I.y+at.y})}else{var ut=T.position(),dt=$?T.parent():null,At=dt&&dt.length>0,xt=At;At&&(dt=dt[0]);var Mt=xt?dt.position():{x:0,y:0};return I={x:ut.x-Mt.x,y:ut.y-Mt.y},g===void 0?I:I[g]}else if(!O)return;return this}},yp.modelPosition=yp.point=yp.position,yp.modelPositions=yp.points=yp.positions,yp.renderedPoint=yp.renderedPosition,yp.relativePoint=yp.relativePosition;var UF=VF,e6,$2;e6=$2={},$2.renderedBoundingBox=function(y){var g=this.boundingBox(y),x=this.cy(),T=x.zoom(),A=x.pan(),I=g.x1*T+A.x,O=g.x2*T+A.x,$=g.y1*T+A.y,z=g.y2*T+A.y;return{x1:I,x2:O,y1:$,y2:z,w:O-I,h:z-$}},$2.dirtyCompoundBoundsCache=function(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,g=this.cy();return!g.styleEnabled()||!g.hasCompoundNodes()?this:(this.forEachUp(function(x){if(x.isParent()){var T=x._private;T.compoundBoundsClean=!1,T.bbCache=null,y||x.emitAndNotify("bounds")}}),this)},$2.updateCompoundBounds=function(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,g=this.cy();if(!g.styleEnabled()||!g.hasCompoundNodes())return this;if(!y&&g.batching())return this;function x(O){if(!O.isParent())return;var $=O._private,z=O.children(),S=O.pstyle("compound-sizing-wrt-labels").value==="include",V={width:{val:O.pstyle("min-width").pfValue,left:O.pstyle("min-width-bias-left"),right:O.pstyle("min-width-bias-right")},height:{val:O.pstyle("min-height").pfValue,top:O.pstyle("min-height-bias-top"),bottom:O.pstyle("min-height-bias-bottom")}},U=z.boundingBox({includeLabels:S,includeOverlays:!1,useCache:!1}),tt=$.position;(U.w===0||U.h===0)&&(U={w:O.pstyle("width").pfValue,h:O.pstyle("height").pfValue},U.x1=tt.x-U.w/2,U.x2=tt.x+U.w/2,U.y1=tt.y-U.h/2,U.y2=tt.y+U.h/2);function at(Ht,ge,be){var re=0,Ne=0,ve=ge+be;return Ht>0&&ve>0&&(re=ge/ve*Ht,Ne=be/ve*Ht),{biasDiff:re,biasComplementDiff:Ne}}function ut(Ht,ge,be,re){if(be.units==="%")switch(re){case"width":return Ht>0?be.pfValue*Ht:0;case"height":return ge>0?be.pfValue*ge:0;case"average":return Ht>0&&ge>0?be.pfValue*(Ht+ge)/2:0;case"min":return Ht>0&&ge>0?Ht>ge?be.pfValue*ge:be.pfValue*Ht:0;case"max":return Ht>0&&ge>0?Ht>ge?be.pfValue*Ht:be.pfValue*ge:0;default:return 0}else return be.units==="px"?be.pfValue:0}var dt=V.width.left.value;V.width.left.units==="px"&&V.width.val>0&&(dt=dt*100/V.width.val);var At=V.width.right.value;V.width.right.units==="px"&&V.width.val>0&&(At=At*100/V.width.val);var xt=V.height.top.value;V.height.top.units==="px"&&V.height.val>0&&(xt=xt*100/V.height.val);var Mt=V.height.bottom.value;V.height.bottom.units==="px"&&V.height.val>0&&(Mt=Mt*100/V.height.val);var Dt=at(V.width.val-U.w,dt,At),Bt=Dt.biasDiff,Zt=Dt.biasComplementDiff,Kt=at(V.height.val-U.h,xt,Mt),$t=Kt.biasDiff,ee=Kt.biasComplementDiff;$.autoPadding=ut(U.w,U.h,O.pstyle("padding"),O.pstyle("padding-relative-to").value),$.autoWidth=Math.max(U.w,V.width.val),tt.x=(-Bt+U.x1+U.x2+Zt)/2,$.autoHeight=Math.max(U.h,V.height.val),tt.y=(-$t+U.y1+U.y2+ee)/2}for(var T=0;T<this.length;T++){var A=this[T],I=A._private;(!I.compoundBoundsClean||y)&&(x(A),g.batching()||(I.compoundBoundsClean=!0))}return this};var T0=function(g){return g===1/0||g===-1/0?0:g},xp=function(g,x,T,A,I){A-x===0||I-T===0||x==null||T==null||A==null||I==null||(g.x1=x<g.x1?x:g.x1,g.x2=A>g.x2?A:g.x2,g.y1=T<g.y1?T:g.y1,g.y2=I>g.y2?I:g.y2,g.w=g.x2-g.x1,g.h=g.y2-g.y1)},A3=function(g,x){return x==null?g:xp(g,x.x1,x.y1,x.x2,x.y2)},Sk=function(g,x,T){return wp(g,x,T)},UE=function(g,x,T){if(!x.cy().headless()){var A=x._private,I=A.rstyle,O=I.arrowWidth/2,$=x.pstyle(T+"-arrow-shape").value,z,S;if($!=="none"){T==="source"?(z=I.srcX,S=I.srcY):T==="target"?(z=I.tgtX,S=I.tgtY):(z=I.midX,S=I.midY);var V=A.arrowBounds=A.arrowBounds||{},U=V[T]=V[T]||{};U.x1=z-O,U.y1=S-O,U.x2=z+O,U.y2=S+O,U.w=U.x2-U.x1,U.h=U.y2-U.y1,ME(U,1),xp(g,U.x1,U.y1,U.x2,U.y2)}}},WF=function(g,x,T){if(!x.cy().headless()){var A;T?A=T+"-":A="";var I=x._private,O=I.rstyle,$=x.pstyle(A+"label").strValue;if($){var z=x.pstyle("text-halign"),S=x.pstyle("text-valign"),V=Sk(O,"labelWidth",T),U=Sk(O,"labelHeight",T),tt=Sk(O,"labelX",T),at=Sk(O,"labelY",T),ut=x.pstyle(A+"text-margin-x").pfValue,dt=x.pstyle(A+"text-margin-y").pfValue,At=x.isEdge(),xt=x.pstyle(A+"text-rotation"),Mt=x.pstyle("text-outline-width").pfValue,Dt=x.pstyle("text-border-width").pfValue,Bt=Dt/2,Zt=x.pstyle("text-background-padding").pfValue,Kt=2,$t=U,ee=V,Ht=ee/2,ge=$t/2,be,re,Ne,ve;if(At)be=tt-Ht,re=tt+Ht,Ne=at-ge,ve=at+ge;else{switch(z.value){case"left":be=tt-ee,re=tt;break;case"center":be=tt-Ht,re=tt+Ht;break;case"right":be=tt,re=tt+ee;break}switch(S.value){case"top":Ne=at-$t,ve=at;break;case"center":Ne=at-ge,ve=at+ge;break;case"bottom":Ne=at,ve=at+$t;break}}be+=ut-Math.max(Mt,Bt)-Zt-Kt,re+=ut+Math.max(Mt,Bt)+Zt+Kt,Ne+=dt-Math.max(Mt,Bt)-Zt-Kt,ve+=dt+Math.max(Mt,Bt)+Zt+Kt;var fn=T||"main",$e=I.labelBounds,qe=$e[fn]=$e[fn]||{};qe.x1=be,qe.y1=Ne,qe.x2=re,qe.y2=ve,qe.w=re-be,qe.h=ve-Ne;var xn=At&&xt.strValue==="autorotate",Pn=xt.pfValue!=null&&xt.pfValue!==0;if(xn||Pn){var er=xn?Sk(I.rstyle,"labelAngle",T):xt.pfValue,Sn=Math.cos(er),Jn=Math.sin(er),fr=(be+re)/2,Sr=(Ne+ve)/2;if(!At){switch(z.value){case"left":fr=re;break;case"right":fr=be;break}switch(S.value){case"top":Sr=ve;break;case"bottom":Sr=Ne;break}}var wr=function(Fa,Fi){return Fa=Fa-fr,Fi=Fi-Sr,{x:Fa*Sn-Fi*Jn+fr,y:Fa*Jn+Fi*Sn+Sr}},cr=wr(be,Ne),bn=wr(be,ve),Tr=wr(re,Ne),xr=wr(re,ve);be=Math.min(cr.x,bn.x,Tr.x,xr.x),re=Math.max(cr.x,bn.x,Tr.x,xr.x),Ne=Math.min(cr.y,bn.y,Tr.y,xr.y),ve=Math.max(cr.y,bn.y,Tr.y,xr.y)}var fi=fn+"Rot",Ii=$e[fi]=$e[fi]||{};Ii.x1=be,Ii.y1=Ne,Ii.x2=re,Ii.y2=ve,Ii.w=re-be,Ii.h=ve-Ne,xp(g,be,Ne,re,ve),xp(I.labelBounds.all,be,Ne,re,ve)}return g}},NZ=function(g,x){var T=g._private.cy,A=T.styleEnabled(),I=T.headless(),O=zd(),$=g._private,z=g.isNode(),S=g.isEdge(),V,U,tt,at,ut,dt,At=$.rstyle,xt=z&&A?g.pstyle("bounds-expansion").pfValue:[0],Mt=function(Ls){return Ls.pstyle("display").value!=="none"},Dt=!A||Mt(g)&&(!S||Mt(g.source())&&Mt(g.target()));if(Dt){var Bt=0,Zt=0;A&&x.includeOverlays&&(Bt=g.pstyle("overlay-opacity").value,Bt!==0&&(Zt=g.pstyle("overlay-padding").value));var Kt=0,$t=0;A&&x.includeUnderlays&&(Kt=g.pstyle("underlay-opacity").value,Kt!==0&&($t=g.pstyle("underlay-padding").value));var ee=Math.max(Zt,$t),Ht=0,ge=0;if(A&&(Ht=g.pstyle("width").pfValue,ge=Ht/2),z&&x.includeNodes){var be=g.position();ut=be.x,dt=be.y;var re=g.outerWidth(),Ne=re/2,ve=g.outerHeight(),fn=ve/2;V=ut-Ne,U=ut+Ne,tt=dt-fn,at=dt+fn,xp(O,V,tt,U,at)}else if(S&&x.includeEdges)if(A&&!I){var $e=g.pstyle("curve-style").strValue;if(V=Math.min(At.srcX,At.midX,At.tgtX),U=Math.max(At.srcX,At.midX,At.tgtX),tt=Math.min(At.srcY,At.midY,At.tgtY),at=Math.max(At.srcY,At.midY,At.tgtY),V-=ge,U+=ge,tt-=ge,at+=ge,xp(O,V,tt,U,at),$e==="haystack"){var qe=At.haystackPts;if(qe&&qe.length===2){if(V=qe[0].x,tt=qe[0].y,U=qe[1].x,at=qe[1].y,V>U){var xn=V;V=U,U=xn}if(tt>at){var Pn=tt;tt=at,at=Pn}xp(O,V-ge,tt-ge,U+ge,at+ge)}}else if($e==="bezier"||$e==="unbundled-bezier"||$e==="segments"||$e==="taxi"){var er;switch($e){case"bezier":case"unbundled-bezier":er=At.bezierPts;break;case"segments":case"taxi":er=At.linePts;break}if(er!=null)for(var Sn=0;Sn<er.length;Sn++){var Jn=er[Sn];V=Jn.x-ge,U=Jn.x+ge,tt=Jn.y-ge,at=Jn.y+ge,xp(O,V,tt,U,at)}}}else{var fr=g.source(),Sr=fr.position(),wr=g.target(),cr=wr.position();if(V=Sr.x,U=cr.x,tt=Sr.y,at=cr.y,V>U){var bn=V;V=U,U=bn}if(tt>at){var Tr=tt;tt=at,at=Tr}V-=ge,U+=ge,tt-=ge,at+=ge,xp(O,V,tt,U,at)}if(A&&x.includeEdges&&S&&(UE(O,g,"mid-source"),UE(O,g,"mid-target"),UE(O,g,"source"),UE(O,g,"target")),A){var xr=g.pstyle("ghost").value==="yes";if(xr){var fi=g.pstyle("ghost-offset-x").pfValue,Ii=g.pstyle("ghost-offset-y").pfValue;xp(O,O.x1+fi,O.y1+Ii,O.x2+fi,O.y2+Ii)}}var oa=$.bodyBounds=$.bodyBounds||{};UN(oa,O),EL(oa,xt),ME(oa,1),A&&(V=O.x1,U=O.x2,tt=O.y1,at=O.y2,xp(O,V-ee,tt-ee,U+ee,at+ee));var Fa=$.overlayBounds=$.overlayBounds||{};UN(Fa,O),EL(Fa,xt),ME(Fa,1);var Fi=$.labelBounds=$.labelBounds||{};Fi.all!=null?dY(Fi.all):Fi.all=zd(),A&&x.includeLabels&&(x.includeMainLabels&&WF(O,g,null),S&&(x.includeSourceLabels&&WF(O,g,"source"),x.includeTargetLabels&&WF(O,g,"target")))}return O.x1=T0(O.x1),O.y1=T0(O.y1),O.x2=T0(O.x2),O.y2=T0(O.y2),O.w=T0(O.x2-O.x1),O.h=T0(O.y2-O.y1),O.w>0&&O.h>0&&Dt&&(EL(O,xt),ME(O,1)),O},KF=function(g){var x=0,T=function(O){return(O?1:0)<<x++},A=0;return A+=T(g.incudeNodes),A+=T(g.includeEdges),A+=T(g.includeLabels),A+=T(g.includeMainLabels),A+=T(g.includeSourceLabels),A+=T(g.includeTargetLabels),A+=T(g.includeOverlays),A},YF=function(g){if(g.isEdge()){var x=g.source().position(),T=g.target().position(),A=function(O){return Math.round(O)};return ah([A(x.x),A(x.y),A(T.x),A(T.y)])}else return 0},XF=function(g,x){var T=g._private,A,I=g.isEdge(),O=x==null?QF:KF(x),$=O===QF,z=YF(g),S=T.bbCachePosKey===z,V=x.useCache&&S,U=function(dt){return dt._private.bbCache==null||dt._private.styleDirty},tt=!V||U(g)||I&&U(g.source())||U(g.target());if(tt?(S||g.recalculateRenderedStyle(V),A=NZ(g,Ak),T.bbCache=A,T.bbCachePosKey=z):A=T.bbCache,!$){var at=g.isNode();A=zd(),(x.includeNodes&&at||x.includeEdges&&!at)&&(x.includeOverlays?A3(A,T.overlayBounds):A3(A,T.bodyBounds)),x.includeLabels&&(x.includeMainLabels&&(!I||x.includeSourceLabels&&x.includeTargetLabels)?A3(A,T.labelBounds.all):(x.includeMainLabels&&A3(A,T.labelBounds.mainRot),x.includeSourceLabels&&A3(A,T.labelBounds.sourceRot),x.includeTargetLabels&&A3(A,T.labelBounds.targetRot))),A.w=A.x2-A.x1,A.h=A.y2-A.y1}return A},Ak={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,useCache:!0},QF=KF(Ak),ZF=Hf(Ak);$2.boundingBox=function(y){var g;if(this.length===1&&this[0]._private.bbCache!=null&&!this[0]._private.styleDirty&&(y===void 0||y.useCache===void 0||y.useCache===!0))y===void 0?y=Ak:y=ZF(y),g=XF(this[0],y);else{g=zd(),y=y||Ak;var x=ZF(y),T=this,A=T.cy(),I=A.styleEnabled();if(I)for(var O=0;O<T.length;O++){var $=T[O],z=$._private,S=YF($),V=z.bbCachePosKey===S,U=x.useCache&&V&&!z.styleDirty;$.recalculateRenderedStyle(U)}this.updateCompoundBounds(!y.useCache);for(var tt=0;tt<T.length;tt++){var at=T[tt];A3(g,XF(at,x))}}return g.x1=T0(g.x1),g.y1=T0(g.y1),g.x2=T0(g.x2),g.y2=T0(g.y2),g.w=T0(g.x2-g.x1),g.h=T0(g.y2-g.y1),g},$2.dirtyBoundingBoxCache=function(){for(var y=0;y<this.length;y++){var g=this[y]._private;g.bbCache=null,g.bbCachePosKey=null,g.bodyBounds=null,g.overlayBounds=null,g.labelBounds.all=null,g.labelBounds.source=null,g.labelBounds.target=null,g.labelBounds.main=null,g.labelBounds.sourceRot=null,g.labelBounds.targetRot=null,g.labelBounds.mainRot=null,g.arrowBounds.source=null,g.arrowBounds.target=null,g.arrowBounds["mid-source"]=null,g.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this},$2.boundingBoxAt=function(y){var g=this.nodes(),x=this.cy(),T=x.hasCompoundNodes(),A=x.collection();if(T&&(A=g.filter(function(S){return S.isParent()}),g=g.not(A)),ft(y)){var I=y;y=function(){return I}}var O=function(V,U){return V._private.bbAtOldPos=y(V,U)},$=function(V){return V._private.bbAtOldPos};x.startBatch(),g.forEach(O).silentPositions(y),T&&(A.dirtyCompoundBoundsCache(),A.dirtyBoundingBoxCache(),A.updateCompoundBounds(!0));var z=fY(this.boundingBox({useCache:!1}));return g.silentPositions($),T&&(A.dirtyCompoundBoundsCache(),A.dirtyBoundingBoxCache(),A.updateCompoundBounds(!0)),x.endBatch(),z},e6.boundingbox=e6.bb=e6.boundingBox,e6.renderedBoundingbox=e6.renderedBoundingBox;var FZ=$2,Lk,Mk;Lk=Mk={};var mm=function(g){g.uppercaseName=rr(g.name),g.autoName="auto"+g.uppercaseName,g.labelName="label"+g.uppercaseName,g.outerName="outer"+g.uppercaseName,g.uppercaseOuterName=rr(g.outerName),Lk[g.name]=function(){var T=this[0],A=T._private,I=A.cy,O=I._private.styleEnabled;if(T)if(O){if(T.isParent())return T.updateCompoundBounds(),A[g.autoName]||0;var $=T.pstyle(g.name);switch($.strValue){case"label":return T.recalculateRenderedStyle(),A.rstyle[g.labelName]||0;default:return $.pfValue}}else return 1},Lk["outer"+g.uppercaseName]=function(){var T=this[0],A=T._private,I=A.cy,O=I._private.styleEnabled;if(T)if(O){var $=T[g.name](),z=T.pstyle("border-width").pfValue,S=2*T.padding();return $+z+S}else return 1},Lk["rendered"+g.uppercaseName]=function(){var T=this[0];if(T){var A=T[g.name]();return A*this.cy().zoom()}},Lk["rendered"+g.uppercaseOuterName]=function(){var T=this[0];if(T){var A=T[g.outerName]();return A*this.cy().zoom()}}};mm({name:"width"}),mm({name:"height"}),Mk.padding=function(){var y=this[0],g=y._private;return y.isParent()?(y.updateCompoundBounds(),g.autoPadding!==void 0?g.autoPadding:y.pstyle("padding").pfValue):y.pstyle("padding").pfValue},Mk.paddedHeight=function(){var y=this[0];return y.height()+2*y.padding()},Mk.paddedWidth=function(){var y=this[0];return y.width()+2*y.padding()};var jL=Mk,BZ=function(g,x){if(g.isEdge())return x(g)},RZ=function(g,x){if(g.isEdge()){var T=g.cy();return AE(x(g),T.zoom(),T.pan())}},jZ=function(g,x){if(g.isEdge()){var T=g.cy(),A=T.pan(),I=T.zoom();return x(g).map(function(O){return AE(O,I,A)})}},$Z=function(g){return g.renderer().getControlPoints(g)},zZ=function(g){return g.renderer().getSegmentPoints(g)},qZ=function(g){return g.renderer().getSourceEndpoint(g)},HZ=function(g){return g.renderer().getTargetEndpoint(g)},VZ=function(g){return g.renderer().getEdgeMidpoint(g)},JF={controlPoints:{get:$Z,mult:!0},segmentPoints:{get:zZ,mult:!0},sourceEndpoint:{get:qZ},targetEndpoint:{get:HZ},midpoint:{get:VZ}},GZ=function(g){return"rendered"+g[0].toUpperCase()+g.substr(1)},UZ=Object.keys(JF).reduce(function(y,g){var x=JF[g],T=GZ(g);return y[g]=function(){return BZ(this,x.get)},x.mult?y[T]=function(){return jZ(this,x.get)}:y[T]=function(){return RZ(this,x.get)},y},{}),WZ=Ke({},UF,FZ,jL,UZ);/*!
    	  Event object based on jQuery events, MIT license

    	  https://jquery.org/license/
    	  https://tldrlegal.com/license/mit-license
    	  https://github.com/jquery/jquery/blob/master/src/event.js
    	  */var tB=function(g,x){this.recycle(g,x)};function Dk(){return!1}function WE(){return!0}tB.prototype={instanceString:function(){return"event"},recycle:function(g,x){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Dk,g!=null&&g.preventDefault?(this.type=g.type,this.isDefaultPrevented=g.defaultPrevented?WE:Dk):g!=null&&g.type?x=g:this.type=g,x!=null&&(this.originalEvent=x.originalEvent,this.type=x.type!=null?x.type:this.type,this.cy=x.cy,this.target=x.target,this.position=x.position,this.renderedPosition=x.renderedPosition,this.namespace=x.namespace,this.layout=x.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var T=this.position,A=this.cy.zoom(),I=this.cy.pan();this.renderedPosition={x:T.x*A+I.x,y:T.y*A+I.y}}this.timeStamp=g&&g.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=WE;var g=this.originalEvent;g&&g.preventDefault&&g.preventDefault()},stopPropagation:function(){this.isPropagationStopped=WE;var g=this.originalEvent;g&&g.stopPropagation&&g.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=WE,this.stopPropagation()},isDefaultPrevented:Dk,isPropagationStopped:Dk,isImmediatePropagationStopped:Dk};var eB=/^([^.]+)(\.(?:[^.]+))?$/,KZ=".*",nB={qualifierCompare:function(g,x){return g===x},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(g){return g},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},rB=Object.keys(nB),YZ={};function KE(){for(var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:YZ,g=arguments.length>1?arguments[1]:void 0,x=0;x<rB.length;x++){var T=rB[x];this[T]=y[T]||nB[T]}this.context=g||this.context,this.listeners=[],this.emitting=0}var ym=KE.prototype,iB=function(g,x,T,A,I,O,$){kt(A)&&(I=A,A=null),$&&(O==null?O=$:O=Ke({},O,$));for(var z=yt(T)?T:T.split(/\s+/),S=0;S<z.length;S++){var V=z[S];if(!J(V)){var U=V.match(eB);if(U){var tt=U[1],at=U[2]?U[2]:null,ut=x(g,V,tt,at,A,I,O);if(ut===!1)break}}}},sB=function(g,x){return g.addEventFields(g.context,x),new tB(x.type,x)},XZ=function(g,x,T){if(fe(T)){x(g,T);return}else if(ft(T)){x(g,sB(g,T));return}for(var A=yt(T)?T:T.split(/\s+/),I=0;I<A.length;I++){var O=A[I];if(!J(O)){var $=O.match(eB);if($){var z=$[1],S=$[2]?$[2]:null,V=sB(g,{type:z,namespace:S,target:g.context});x(g,V)}}}};ym.on=ym.addListener=function(y,g,x,T,A){return iB(this,function(I,O,$,z,S,V,U){kt(V)&&I.listeners.push({event:O,callback:V,type:$,namespace:z,qualifier:S,conf:U})},y,g,x,T,A),this},ym.one=function(y,g,x,T){return this.on(y,g,x,T,{one:!0})},ym.removeListener=ym.off=function(y,g,x,T){var A=this;this.emitting!==0&&(this.listeners=$K(this.listeners));for(var I=this.listeners,O=function(S){var V=I[S];iB(A,function(U,tt,at,ut,dt,At){if((V.type===at||y==="*")&&(!ut&&V.namespace!==".*"||V.namespace===ut)&&(!dt||U.qualifierCompare(V.qualifier,dt))&&(!At||V.callback===At))return I.splice(S,1),!1},y,g,x,T)},$=I.length-1;$>=0;$--)O($);return this},ym.removeAllListeners=function(){return this.removeListener("*")},ym.emit=ym.trigger=function(y,g,x){var T=this.listeners,A=T.length;return this.emitting++,yt(g)||(g=[g]),XZ(this,function(I,O){x!=null&&(T=[{event:O.event,type:O.type,namespace:O.namespace,callback:x}],A=T.length);for(var $=function(V){var U=T[V];if(U.type===O.type&&(!U.namespace||U.namespace===O.namespace||U.namespace===KZ)&&I.eventMatches(I.context,U,O)){var tt=[O];g!=null&&qN(tt,g),I.beforeEmit(I.context,U,O),U.conf&&U.conf.one&&(I.listeners=I.listeners.filter(function(dt){return dt!==U}));var at=I.callbackContext(I.context,U,O),ut=U.callback.apply(at,tt);I.afterEmit(I.context,U,O),ut===!1&&(O.stopPropagation(),O.preventDefault())}},z=0;z<A;z++)$(z);I.bubble(I.context)&&!O.isPropagationStopped()&&I.parent(I.context).emit(O,g)},y),this.emitting--,this};var QZ={qualifierCompare:function(g,x){return g==null||x==null?g==null&&x==null:g.sameText(x)},eventMatches:function(g,x,T){var A=x.qualifier;return A!=null?g!==T.target&&_t(T.target)&&A.matches(T.target):!0},addEventFields:function(g,x){x.cy=g.cy(),x.target=g},callbackContext:function(g,x,T){return x.qualifier!=null?T.target:g},beforeEmit:function(g,x){x.conf&&x.conf.once&&x.conf.onceCollection.removeListener(x.event,x.qualifier,x.callback)},bubble:function(){return!0},parent:function(g){return g.isChild()?g.parent():g.cy()}},YE=function(g){return Tt(g)?new wm(g):g},aB={createEmitter:function(){for(var g=0;g<this.length;g++){var x=this[g],T=x._private;T.emitter||(T.emitter=new KE(QZ,x))}return this},emitter:function(){return this._private.emitter},on:function(g,x,T){for(var A=YE(x),I=0;I<this.length;I++){var O=this[I];O.emitter().on(g,A,T)}return this},removeListener:function(g,x,T){for(var A=YE(x),I=0;I<this.length;I++){var O=this[I];O.emitter().removeListener(g,A,T)}return this},removeAllListeners:function(){for(var g=0;g<this.length;g++){var x=this[g];x.emitter().removeAllListeners()}return this},one:function(g,x,T){for(var A=YE(x),I=0;I<this.length;I++){var O=this[I];O.emitter().one(g,A,T)}return this},once:function(g,x,T){for(var A=YE(x),I=0;I<this.length;I++){var O=this[I];O.emitter().on(g,A,T,{once:!0,onceCollection:this})}},emit:function(g,x){for(var T=0;T<this.length;T++){var A=this[T];A.emitter().emit(g,x)}return this},emitAndNotify:function(g,x){if(this.length!==0)return this.cy().notify(g,this),this.emit(g,x),this}};jc.eventAliasesOn(aB);var oB={nodes:function(g){return this.filter(function(x){return x.isNode()}).filter(g)},edges:function(g){return this.filter(function(x){return x.isEdge()}).filter(g)},byGroup:function(){for(var g=this.spawn(),x=this.spawn(),T=0;T<this.length;T++){var A=this[T];A.isNode()?g.push(A):x.push(A)}return{nodes:g,edges:x}},filter:function(g,x){if(g===void 0)return this;if(Tt(g)||ht(g))return new wm(g).filter(this);if(kt(g)){for(var T=this.spawn(),A=this,I=0;I<A.length;I++){var O=A[I],$=x?g.apply(x,[O,I,A]):g(O,I,A);$&&T.push(O)}return T}return this.spawn()},not:function(g){if(g){Tt(g)&&(g=this.filter(g));for(var x=this.spawn(),T=0;T<this.length;T++){var A=this[T],I=g.has(A);I||x.push(A)}return x}else return this},absoluteComplement:function(){var g=this.cy();return g.mutableElements().not(this)},intersect:function(g){if(Tt(g)){var x=g;return this.filter(x)}for(var T=this.spawn(),A=this,I=g,O=this.length<g.length,$=O?A:I,z=O?I:A,S=0;S<$.length;S++){var V=$[S];z.has(V)&&T.push(V)}return T},xor:function(g){var x=this._private.cy;Tt(g)&&(g=x.$(g));var T=this.spawn(),A=this,I=g,O=function(z,S){for(var V=0;V<z.length;V++){var U=z[V],tt=U._private.data.id,at=S.hasElementWithId(tt);at||T.push(U)}};return O(A,I),O(I,A),T},diff:function(g){var x=this._private.cy;Tt(g)&&(g=x.$(g));var T=this.spawn(),A=this.spawn(),I=this.spawn(),O=this,$=g,z=function(V,U,tt){for(var at=0;at<V.length;at++){var ut=V[at],dt=ut._private.data.id,At=U.hasElementWithId(dt);At?I.merge(ut):tt.push(ut)}};return z(O,$,T),z($,O,A),{left:T,right:A,both:I}},add:function(g){var x=this._private.cy;if(!g)return this;if(Tt(g)){var T=g;g=x.mutableElements().filter(T)}for(var A=this.spawnSelf(),I=0;I<g.length;I++){var O=g[I],$=!this.has(O);$&&A.push(O)}return A},merge:function(g){var x=this._private,T=x.cy;if(!g)return this;if(g&&Tt(g)){var A=g;g=T.mutableElements().filter(A)}for(var I=x.map,O=0;O<g.length;O++){var $=g[O],z=$._private.data.id,S=!I.has(z);if(S){var V=this.length++;this[V]=$,I.set(z,{ele:$,index:V})}}return this},unmergeAt:function(g){var x=this[g],T=x.id(),A=this._private,I=A.map;this[g]=void 0,I.delete(T);var O=g===this.length-1;if(this.length>1&&!O){var $=this.length-1,z=this[$],S=z._private.data.id;this[$]=void 0,this[g]=z,I.set(S,{ele:z,index:g})}return this.length--,this},unmergeOne:function(g){g=g[0];var x=this._private,T=g._private.data.id,A=x.map,I=A.get(T);if(!I)return this;var O=I.index;return this.unmergeAt(O),this},unmerge:function(g){var x=this._private.cy;if(!g)return this;if(g&&Tt(g)){var T=g;g=x.mutableElements().filter(T)}for(var A=0;A<g.length;A++)this.unmergeOne(g[A]);return this},unmergeBy:function(g){for(var x=this.length-1;x>=0;x--){var T=this[x];g(T)&&this.unmergeAt(x)}return this},map:function(g,x){for(var T=[],A=this,I=0;I<A.length;I++){var O=A[I],$=x?g.apply(x,[O,I,A]):g(O,I,A);T.push($)}return T},reduce:function(g,x){for(var T=x,A=this,I=0;I<A.length;I++)T=g(T,A[I],I,A);return T},max:function(g,x){for(var T=-1/0,A,I=this,O=0;O<I.length;O++){var $=I[O],z=x?g.apply(x,[$,O,I]):g($,O,I);z>T&&(T=z,A=$)}return{value:T,ele:A}},min:function(g,x){for(var T=1/0,A,I=this,O=0;O<I.length;O++){var $=I[O],z=x?g.apply(x,[$,O,I]):g($,O,I);z<T&&(T=z,A=$)}return{value:T,ele:A}}},Tc=oB;Tc.u=Tc["|"]=Tc["+"]=Tc.union=Tc.or=Tc.add,Tc["\\"]=Tc["!"]=Tc["-"]=Tc.difference=Tc.relativeComplement=Tc.subtract=Tc.not,Tc.n=Tc["&"]=Tc["."]=Tc.and=Tc.intersection=Tc.intersect,Tc["^"]=Tc["(+)"]=Tc["(-)"]=Tc.symmetricDifference=Tc.symdiff=Tc.xor,Tc.fnFilter=Tc.filterFn=Tc.stdFilter=Tc.filter,Tc.complement=Tc.abscomp=Tc.absoluteComplement;var ZZ={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var g=this[0];if(g)return g._private.group}},cB=function(g,x){var T=g.cy(),A=T.hasCompoundNodes();function I(V){var U=V.pstyle("z-compound-depth");return U.value==="auto"?A?V.zDepth():0:U.value==="bottom"?-1:U.value==="top"?vp:0}var O=I(g)-I(x);if(O!==0)return O;function $(V){var U=V.pstyle("z-index-compare");return U.value==="auto"&&V.isNode()?1:0}var z=$(g)-$(x);if(z!==0)return z;var S=g.pstyle("z-index").value-x.pstyle("z-index").value;return S!==0?S:g.poolIndex()-x.poolIndex()},XE={forEach:function(g,x){if(kt(g))for(var T=this.length,A=0;A<T;A++){var I=this[A],O=x?g.apply(x,[I,A,this]):g(I,A,this);if(O===!1)break}return this},toArray:function(){for(var g=[],x=0;x<this.length;x++)g.push(this[x]);return g},slice:function(g,x){var T=[],A=this.length;x==null&&(x=A),g==null&&(g=0),g<0&&(g=A+g),x<0&&(x=A+x);for(var I=g;I>=0&&I<x&&I<A;I++)T.push(this[I]);return this.spawn(T)},size:function(){return this.length},eq:function(g){return this[g]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(g){if(!kt(g))return this;var x=this.toArray().sort(g);return this.spawn(x)},sortByZIndex:function(){return this.sort(cB)},zDepth:function(){var g=this[0];if(g){var x=g._private,T=x.group;if(T==="nodes"){var A=x.data.parent?g.parents().size():0;return g.isParent()?A:vp-1}else{var I=x.source,O=x.target,$=I.zDepth(),z=O.zDepth();return Math.max($,z,0)}}}};XE.each=XE.forEach;var JZ=function(){var g="undefined",x=(typeof Symbol>"u"?"undefined":f(Symbol))!=g&&f(Symbol.iterator)!=g;x&&(XE[Symbol.iterator]=function(){var T=this,A={value:void 0,done:!1},I=0,O=this.length;return b({next:function(){return I<O?A.value=T[I++]:(A.value=void 0,A.done=!0),A}},Symbol.iterator,function(){return this})})};JZ();var tJ=Hf({nodeDimensionsIncludeLabels:!1}),QE={layoutDimensions:function(g){g=tJ(g);var x;if(!this.takesUpSpace())x={w:0,h:0};else if(g.nodeDimensionsIncludeLabels){var T=this.boundingBox();x={w:T.w,h:T.h}}else x={w:this.outerWidth(),h:this.outerHeight()};return(x.w===0||x.h===0)&&(x.w=x.h=1),x},layoutPositions:function(g,x,T){var A=this.nodes().filter(function(Zt){return!Zt.isParent()}),I=this.cy(),O=x.eles,$=function(Kt){return Kt.id()},z=me(T,$);g.emit({type:"layoutstart",layout:g}),g.animations=[];var S=function(Kt,$t,ee){var Ht={x:$t.x1+$t.w/2,y:$t.y1+$t.h/2},ge={x:(ee.x-Ht.x)*Kt,y:(ee.y-Ht.y)*Kt};return{x:Ht.x+ge.x,y:Ht.y+ge.y}},V=x.spacingFactor&&x.spacingFactor!==1,U=function(){if(!V)return null;for(var Kt=zd(),$t=0;$t<A.length;$t++){var ee=A[$t],Ht=z(ee,$t);pY(Kt,Ht.x,Ht.y)}return Kt},tt=U(),at=me(function(Zt,Kt){var $t=z(Zt,Kt);if(V){var ee=Math.abs(x.spacingFactor);$t=S(ee,tt,$t)}return x.transform!=null&&($t=x.transform(Zt,$t)),$t},$);if(x.animate){for(var ut=0;ut<A.length;ut++){var dt=A[ut],At=at(dt,ut),xt=x.animateFilter==null||x.animateFilter(dt,ut);if(xt){var Mt=dt.animation({position:At,duration:x.animationDuration,easing:x.animationEasing});g.animations.push(Mt)}else dt.position(At)}if(x.fit){var Dt=I.animation({fit:{boundingBox:O.boundingBoxAt(at),padding:x.padding},duration:x.animationDuration,easing:x.animationEasing});g.animations.push(Dt)}else if(x.zoom!==void 0&&x.pan!==void 0){var Bt=I.animation({zoom:x.zoom,pan:x.pan,duration:x.animationDuration,easing:x.animationEasing});g.animations.push(Bt)}g.animations.forEach(function(Zt){return Zt.play()}),g.one("layoutready",x.ready),g.emit({type:"layoutready",layout:g}),W5.all(g.animations.map(function(Zt){return Zt.promise()})).then(function(){g.one("layoutstop",x.stop),g.emit({type:"layoutstop",layout:g})})}else A.positions(at),x.fit&&I.fit(x.eles,x.padding),x.zoom!=null&&I.zoom(x.zoom),x.pan&&I.pan(x.pan),g.one("layoutready",x.ready),g.emit({type:"layoutready",layout:g}),g.one("layoutstop",x.stop),g.emit({type:"layoutstop",layout:g});return this},layout:function(g){var x=this.cy();return x.makeLayout(Ke({},g,{eles:this}))}};QE.createLayout=QE.makeLayout=QE.layout;function uB(y,g,x){var T=x._private,A=T.styleCache=T.styleCache||[],I;return(I=A[y])!=null||(I=A[y]=g(x)),I}function ZE(y,g){return y=ad(y),function(T){return uB(y,g,T)}}function JE(y,g){y=ad(y);var x=function(A){return g.call(A)};return function(){var A=this[0];if(A)return uB(y,x,A)}}var Vf={recalculateRenderedStyle:function(g){var x=this.cy(),T=x.renderer(),A=x.styleEnabled();return T&&A&&T.recalculateRenderedStyle(this,g),this},dirtyStyleCache:function(){var g=this.cy(),x=function(I){return I._private.styleCache=null};if(g.hasCompoundNodes()){var T;T=this.spawnSelf().merge(this.descendants()).merge(this.parents()),T.merge(T.connectedEdges()),T.forEach(x)}else this.forEach(function(A){x(A),A.connectedEdges().forEach(x)});return this},updateStyle:function(g){var x=this._private.cy;if(!x.styleEnabled())return this;if(x.batching()){var T=x._private.batchStyleEles;return T.merge(this),this}var A=x.hasCompoundNodes(),I=this;g=!!(g||g===void 0),A&&(I=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var O=I;return g?O.emitAndNotify("style"):O.emit("style"),I.forEach(function($){return $._private.styleDirty=!0}),this},cleanStyle:function(){var g=this.cy();if(g.styleEnabled())for(var x=0;x<this.length;x++){var T=this[x];T._private.styleDirty&&(T._private.styleDirty=!1,g.style().apply(T))}},parsedStyle:function(g){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,T=this[0],A=T.cy();if(A.styleEnabled()&&T){this.cleanStyle();var I=T._private.style[g];return I??(x?A.style().getDefaultProperty(g):null)}},numericStyle:function(g){var x=this[0];if(x.cy().styleEnabled()&&x){var T=x.pstyle(g);return T.pfValue!==void 0?T.pfValue:T.value}},numericStyleUnits:function(g){var x=this[0];if(x.cy().styleEnabled()&&x)return x.pstyle(g).units},renderedStyle:function(g){var x=this.cy();if(!x.styleEnabled())return this;var T=this[0];if(T)return x.style().getRenderedStyle(T,g)},style:function(g,x){var T=this.cy();if(!T.styleEnabled())return this;var A=!1,I=T.style();if(ft(g)){var O=g;I.applyBypass(this,O,A),this.emitAndNotify("style")}else if(Tt(g))if(x===void 0){var $=this[0];return $?I.getStylePropertyValue($,g):void 0}else I.applyBypass(this,g,x,A),this.emitAndNotify("style");else if(g===void 0){var z=this[0];return z?I.getRawStyle(z):void 0}return this},removeStyle:function(g){var x=this.cy();if(!x.styleEnabled())return this;var T=!1,A=x.style(),I=this;if(g===void 0)for(var O=0;O<I.length;O++){var $=I[O];A.removeAllBypasses($,T)}else{g=g.split(/\s+/);for(var z=0;z<I.length;z++){var S=I[z];A.removeBypasses(S,g,T)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var g=this.cy();if(!g.styleEnabled())return 1;var x=g.hasCompoundNodes(),T=this[0];if(T){var A=T._private,I=T.pstyle("opacity").value;if(!x)return I;var O=A.data.parent?T.parents():null;if(O)for(var $=0;$<O.length;$++){var z=O[$],S=z.pstyle("opacity").value;I=S*I}return I}},transparent:function(){var g=this.cy();if(!g.styleEnabled())return!1;var x=this[0],T=x.cy().hasCompoundNodes();if(x)return T?x.effectiveOpacity()===0:x.pstyle("opacity").value===0},backgrounding:function(){var g=this.cy();if(!g.styleEnabled())return!1;var x=this[0];return!!x._private.backgrounding}};function $L(y,g){var x=y._private,T=x.data.parent?y.parents():null;if(T)for(var A=0;A<T.length;A++){var I=T[A];if(!g(I))return!1}return!0}function zL(y){var g=y.ok,x=y.edgeOkViaNode||y.ok,T=y.parentOk||y.ok;return function(){var A=this.cy();if(!A.styleEnabled())return!0;var I=this[0],O=A.hasCompoundNodes();if(I){var $=I._private;if(!g(I))return!1;if(I.isNode())return!O||$L(I,T);var z=$.source,S=$.target;return x(z)&&(!O||$L(z,x))&&(z===S||x(S)&&(!O||$L(S,x)))}}}var n6=ZE("eleTakesUpSpace",function(y){return y.pstyle("display").value==="element"&&y.width()!==0&&(y.isNode()?y.height()!==0:!0)});Vf.takesUpSpace=JE("takesUpSpace",zL({ok:n6}));var eJ=ZE("eleInteractive",function(y){return y.pstyle("events").value==="yes"&&y.pstyle("visibility").value==="visible"&&n6(y)}),nJ=ZE("parentInteractive",function(y){return y.pstyle("visibility").value==="visible"&&n6(y)});Vf.interactive=JE("interactive",zL({ok:eJ,parentOk:nJ,edgeOkViaNode:n6})),Vf.noninteractive=function(){var y=this[0];if(y)return!y.interactive()};var rJ=ZE("eleVisible",function(y){return y.pstyle("visibility").value==="visible"&&y.pstyle("opacity").pfValue!==0&&n6(y)}),iJ=n6;Vf.visible=JE("visible",zL({ok:rJ,edgeOkViaNode:iJ})),Vf.hidden=function(){var y=this[0];if(y)return!y.visible()},Vf.isBundledBezier=JE("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1}),Vf.bypass=Vf.css=Vf.style,Vf.renderedCss=Vf.renderedStyle,Vf.removeBypass=Vf.removeCss=Vf.removeStyle,Vf.pstyle=Vf.parsedStyle;var xm={};function lB(y){return function(){var g=arguments,x=[];if(g.length===2){var T=g[0],A=g[1];this.on(y.event,T,A)}else if(g.length===1&&kt(g[0])){var I=g[0];this.on(y.event,I)}else if(g.length===0||g.length===1&&yt(g[0])){for(var O=g.length===1?g[0]:null,$=0;$<this.length;$++){var z=this[$],S=!y.ableField||z._private[y.ableField],V=z._private[y.field]!=y.value;if(y.overrideAble){var U=y.overrideAble(z);if(U!==void 0&&(S=U,!U))return this}S&&(z._private[y.field]=y.value,V&&x.push(z))}var tt=this.spawn(x);tt.updateStyle(),tt.emit(y.event),O&&tt.emit(O)}return this}}function r6(y){xm[y.field]=function(){var g=this[0];if(g){if(y.overrideField){var x=y.overrideField(g);if(x!==void 0)return x}return g._private[y.field]}},xm[y.on]=lB({event:y.on,field:y.field,ableField:y.ableField,overrideAble:y.overrideAble,value:!0}),xm[y.off]=lB({event:y.off,field:y.field,ableField:y.ableField,overrideAble:y.overrideAble,value:!1})}r6({field:"locked",overrideField:function(g){return g.cy().autolock()?!0:void 0},on:"lock",off:"unlock"}),r6({field:"grabbable",overrideField:function(g){return g.cy().autoungrabify()||g.pannable()?!1:void 0},on:"grabify",off:"ungrabify"}),r6({field:"selected",ableField:"selectable",overrideAble:function(g){return g.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"}),r6({field:"selectable",overrideField:function(g){return g.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"}),xm.deselect=xm.unselect,xm.grabbed=function(){var y=this[0];if(y)return y._private.grabbed},r6({field:"active",on:"activate",off:"unactivate"}),r6({field:"pannable",on:"panify",off:"unpanify"}),xm.inactive=function(){var y=this[0];if(y)return!y._private.active};var m1={},hB=function(g){return function(T){for(var A=this,I=[],O=0;O<A.length;O++){var $=A[O];if($.isNode()){for(var z=!1,S=$.connectedEdges(),V=0;V<S.length;V++){var U=S[V],tt=U.source(),at=U.target();if(g.noIncomingEdges&&at===$&&tt!==$||g.noOutgoingEdges&&tt===$&&at!==$){z=!0;break}}z||I.push($)}}return this.spawn(I,!0).filter(T)}},fB=function(g){return function(x){for(var T=this,A=[],I=0;I<T.length;I++){var O=T[I];if(O.isNode())for(var $=O.connectedEdges(),z=0;z<$.length;z++){var S=$[z],V=S.source(),U=S.target();g.outgoing&&V===O?(A.push(S),A.push(U)):g.incoming&&U===O&&(A.push(S),A.push(V))}}return this.spawn(A,!0).filter(x)}},dB=function(g){return function(x){for(var T=this,A=[],I={};;){var O=g.outgoing?T.outgoers():T.incomers();if(O.length===0)break;for(var $=!1,z=0;z<O.length;z++){var S=O[z],V=S.id();I[V]||(I[V]=!0,A.push(S),$=!0)}if(!$)break;T=O}return this.spawn(A,!0).filter(x)}};m1.clearTraversalCache=function(){for(var y=0;y<this.length;y++)this[y]._private.traversalCache=null},Ke(m1,{roots:hB({noIncomingEdges:!0}),leaves:hB({noOutgoingEdges:!0}),outgoers:ud(fB({outgoing:!0}),"outgoers"),successors:dB({outgoing:!0}),incomers:ud(fB({incoming:!0}),"incomers"),predecessors:dB({incoming:!0})}),Ke(m1,{neighborhood:ud(function(y){for(var g=[],x=this.nodes(),T=0;T<x.length;T++)for(var A=x[T],I=A.connectedEdges(),O=0;O<I.length;O++){var $=I[O],z=$.source(),S=$.target(),V=A===z?S:z;V.length>0&&g.push(V[0]),g.push($[0])}return this.spawn(g,!0).filter(y)},"neighborhood"),closedNeighborhood:function(g){return this.neighborhood().add(this).filter(g)},openNeighborhood:function(g){return this.neighborhood(g)}}),m1.neighbourhood=m1.neighborhood,m1.closedNeighbourhood=m1.closedNeighborhood,m1.openNeighbourhood=m1.openNeighborhood,Ke(m1,{source:ud(function(g){var x=this[0],T;return x&&(T=x._private.source||x.cy().collection()),T&&g?T.filter(g):T},"source"),target:ud(function(g){var x=this[0],T;return x&&(T=x._private.target||x.cy().collection()),T&&g?T.filter(g):T},"target"),sources:gB({attr:"source"}),targets:gB({attr:"target"})});function gB(y){return function(x){for(var T=[],A=0;A<this.length;A++){var I=this[A],O=I._private[y.attr];O&&T.push(O)}return this.spawn(T,!0).filter(x)}}Ke(m1,{edgesWith:ud(pB(),"edgesWith"),edgesTo:ud(pB({thisIsSrc:!0}),"edgesTo")});function pB(y){return function(x){var T=[],A=this._private.cy,I=y||{};Tt(x)&&(x=A.$(x));for(var O=0;O<x.length;O++)for(var $=x[O]._private.edges,z=0;z<$.length;z++){var S=$[z],V=S._private.data,U=this.hasElementWithId(V.source)&&x.hasElementWithId(V.target),tt=x.hasElementWithId(V.source)&&this.hasElementWithId(V.target),at=U||tt;at&&((I.thisIsSrc||I.thisIsTgt)&&(I.thisIsSrc&&!U||I.thisIsTgt&&!tt)||T.push(S))}return this.spawn(T,!0)}}Ke(m1,{connectedEdges:ud(function(y){for(var g=[],x=this,T=0;T<x.length;T++){var A=x[T];if(A.isNode())for(var I=A._private.edges,O=0;O<I.length;O++){var $=I[O];g.push($)}}return this.spawn(g,!0).filter(y)},"connectedEdges"),connectedNodes:ud(function(y){for(var g=[],x=this,T=0;T<x.length;T++){var A=x[T];A.isEdge()&&(g.push(A.source()[0]),g.push(A.target()[0]))}return this.spawn(g,!0).filter(y)},"connectedNodes"),parallelEdges:ud(bB(),"parallelEdges"),codirectedEdges:ud(bB({codirected:!0}),"codirectedEdges")});function bB(y){var g={codirected:!1};return y=Ke({},g,y),function(T){for(var A=[],I=this.edges(),O=y,$=0;$<I.length;$++)for(var z=I[$],S=z._private,V=S.source,U=V._private.data.id,tt=S.data.target,at=V._private.edges,ut=0;ut<at.length;ut++){var dt=at[ut],At=dt._private.data,xt=At.target,Mt=At.source,Dt=xt===tt&&Mt===U,Bt=U===xt&&tt===Mt;(O.codirected&&Dt||!O.codirected&&(Dt||Bt))&&A.push(dt)}return this.spawn(A,!0).filter(T)}}Ke(m1,{components:function(g){var x=this,T=x.cy(),A=T.collection(),I=g==null?x.nodes():g.nodes(),O=[];g!=null&&I.empty()&&(I=g.sources());var $=function(V,U){A.merge(V),I.unmerge(V),U.merge(V)};if(I.empty())return x.spawn();var z=function(){var V=T.collection();O.push(V);var U=I[0];$(U,V),x.bfs({directed:!1,roots:U,visit:function(at){return $(at,V)}}),V.forEach(function(tt){tt.connectedEdges().forEach(function(at){x.has(at)&&V.has(at.source())&&V.has(at.target())&&V.merge(at)})})};do z();while(I.length>0);return O},component:function(){var g=this[0];return g.cy().mutableElements().components(g)[0]}}),m1.componentsOf=m1.components;var Gf=function(g,x){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(g===void 0){Ec("A collection must have a reference to the core");return}var I=new j2,O=!1;if(!x)x=[];else if(x.length>0&&ft(x[0])&&!_t(x[0])){O=!0;for(var $=[],z=new $5,S=0,V=x.length;S<V;S++){var U=x[S];U.data==null&&(U.data={});var tt=U.data;if(tt.id==null)tt.id=CE();else if(g.hasElementWithId(tt.id)||z.has(tt.id))continue;var at=new SE(g,U,!1);$.push(at),z.add(tt.id)}x=$}this.length=0;for(var ut=0,dt=x.length;ut<dt;ut++){var At=x[ut][0];if(At!=null){var xt=At._private.data.id;(!T||!I.has(xt))&&(T&&I.set(xt,{index:this.length,ele:At}),this[this.length]=At,this.length++)}}this._private={eles:this,cy:g,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(Mt){this.lazyMap=Mt},rebuildMap:function(){for(var Dt=this.lazyMap=new j2,Bt=this.eles,Zt=0;Zt<Bt.length;Zt++){var Kt=Bt[Zt];Dt.set(Kt.id(),{index:Zt,ele:Kt})}}},T&&(this._private.map=I),O&&!A&&this.restore()},ku=SE.prototype=Gf.prototype=Object.create(Array.prototype);ku.instanceString=function(){return"collection"},ku.spawn=function(y,g){return new Gf(this.cy(),y,g)},ku.spawnSelf=function(){return this.spawn(this)},ku.cy=function(){return this._private.cy},ku.renderer=function(){return this._private.cy.renderer()},ku.element=function(){return this[0]},ku.collection=function(){return X(this)?this:new Gf(this._private.cy,[this])},ku.unique=function(){return new Gf(this._private.cy,this,!0)},ku.hasElementWithId=function(y){return y=""+y,this._private.map.has(y)},ku.getElementById=function(y){y=""+y;var g=this._private.cy,x=this._private.map.get(y);return x?x.ele:new Gf(g)},ku.$id=ku.getElementById,ku.poolIndex=function(){var y=this._private.cy,g=y._private.elements,x=this[0]._private.data.id;return g._private.map.get(x).index},ku.indexOf=function(y){var g=y[0]._private.data.id;return this._private.map.get(g).index},ku.indexOfId=function(y){return y=""+y,this._private.map.get(y).index},ku.json=function(y){var g=this.element(),x=this.cy();if(g==null&&y)return this;if(g!=null){var T=g._private;if(ft(y)){if(x.startBatch(),y.data){g.data(y.data);var A=T.data;if(g.isEdge()){var I=!1,O={},$=y.data.source,z=y.data.target;$!=null&&$!=A.source&&(O.source=""+$,I=!0),z!=null&&z!=A.target&&(O.target=""+z,I=!0),I&&(g=g.move(O))}else{var S="parent"in y.data,V=y.data.parent;S&&(V!=null||A.parent!=null)&&V!=A.parent&&(V===void 0&&(V=null),V!=null&&(V=""+V),g=g.move({parent:V}))}}y.position&&g.position(y.position);var U=function(dt,At,xt){var Mt=y[dt];Mt!=null&&Mt!==T[dt]&&(Mt?g[At]():g[xt]())};return U("removed","remove","restore"),U("selected","select","unselect"),U("selectable","selectify","unselectify"),U("locked","lock","unlock"),U("grabbable","grabify","ungrabify"),U("pannable","panify","unpanify"),y.classes!=null&&g.classes(y.classes),x.endBatch(),this}else if(y===void 0){var tt={data:oh(T.data),position:oh(T.position),group:T.group,removed:T.removed,selected:T.selected,selectable:T.selectable,locked:T.locked,grabbable:T.grabbable,pannable:T.pannable,classes:null};tt.classes="";var at=0;return T.classes.forEach(function(ut){return tt.classes+=at++===0?ut:" "+ut}),tt}}},ku.jsons=function(){for(var y=[],g=0;g<this.length;g++){var x=this[g],T=x.json();y.push(T)}return y},ku.clone=function(){for(var y=this.cy(),g=[],x=0;x<this.length;x++){var T=this[x],A=T.json(),I=new SE(y,A,!1);g.push(I)}return new Gf(y,g)},ku.copy=ku.clone,ku.restore=function(){for(var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,x=this,T=x.cy(),A=T._private,I=[],O=[],$,z=0,S=x.length;z<S;z++){var V=x[z];g&&!V.removed()||(V.isNode()?I.push(V):O.push(V))}$=I.concat(O);var U,tt=function(){$.splice(U,1),U--};for(U=0;U<$.length;U++){var at=$[U],ut=at._private,dt=ut.data;if(at.clearTraversalCache(),!(!g&&!ut.removed)){if(dt.id===void 0)dt.id=CE();else if(rt(dt.id))dt.id=""+dt.id;else if(J(dt.id)||!Tt(dt.id)){Ec("Can not create element with invalid string ID `"+dt.id+"`"),tt();continue}else if(T.hasElementWithId(dt.id)){Ec("Can not create second element with ID `"+dt.id+"`"),tt();continue}}var At=dt.id;if(at.isNode()){var xt=ut.position;xt.x==null&&(xt.x=0),xt.y==null&&(xt.y=0)}if(at.isEdge()){for(var Mt=at,Dt=["source","target"],Bt=Dt.length,Zt=!1,Kt=0;Kt<Bt;Kt++){var $t=Dt[Kt],ee=dt[$t];rt(ee)&&(ee=dt[$t]=""+dt[$t]),ee==null||ee===""?(Ec("Can not create edge `"+At+"` with unspecified "+$t),Zt=!0):T.hasElementWithId(ee)||(Ec("Can not create edge `"+At+"` with nonexistant "+$t+" `"+ee+"`"),Zt=!0)}if(Zt){tt();continue}var Ht=T.getElementById(dt.source),ge=T.getElementById(dt.target);Ht.same(ge)?Ht._private.edges.push(Mt):(Ht._private.edges.push(Mt),ge._private.edges.push(Mt)),Mt._private.source=Ht,Mt._private.target=ge}ut.map=new j2,ut.map.set(At,{ele:at,index:0}),ut.removed=!1,g&&T.addToPool(at)}for(var be=0;be<I.length;be++){var re=I[be],Ne=re._private.data;rt(Ne.parent)&&(Ne.parent=""+Ne.parent);var ve=Ne.parent,fn=ve!=null;if(fn||re._private.parent){var $e=re._private.parent?T.collection().merge(re._private.parent):T.getElementById(ve);if($e.empty())Ne.parent=void 0;else if($e[0].removed())Wo("Node added with missing parent, reference to parent removed"),Ne.parent=void 0,re._private.parent=null;else{for(var qe=!1,xn=$e;!xn.empty();){if(re.same(xn)){qe=!0,Ne.parent=void 0;break}xn=xn.parent()}qe||($e[0]._private.children.push(re),re._private.parent=$e[0],A.hasCompoundNodes=!0)}}}if($.length>0){for(var Pn=$.length===x.length?x:new Gf(T,$),er=0;er<Pn.length;er++){var Sn=Pn[er];Sn.isNode()||(Sn.parallelEdges().clearTraversalCache(),Sn.source().clearTraversalCache(),Sn.target().clearTraversalCache())}var Jn;A.hasCompoundNodes?Jn=T.collection().merge(Pn).merge(Pn.connectedNodes()).merge(Pn.parent()):Jn=Pn,Jn.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(y),y?Pn.emitAndNotify("add"):g&&Pn.emit("add")}return x},ku.removed=function(){var y=this[0];return y&&y._private.removed},ku.inside=function(){var y=this[0];return y&&!y._private.removed},ku.remove=function(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,x=this,T=[],A={},I=x._private.cy;function O(ve){for(var fn=ve._private.edges,$e=0;$e<fn.length;$e++)z(fn[$e])}function $(ve){for(var fn=ve._private.children,$e=0;$e<fn.length;$e++)z(fn[$e])}function z(ve){var fn=A[ve.id()];g&&ve.removed()||fn||(A[ve.id()]=!0,ve.isNode()?(T.push(ve),O(ve),$(ve)):T.unshift(ve))}for(var S=0,V=x.length;S<V;S++){var U=x[S];z(U)}function tt(ve,fn){var $e=ve._private.edges;dm($e,fn),ve.clearTraversalCache()}function at(ve){ve.clearTraversalCache()}var ut=[];ut.ids={};function dt(ve,fn){fn=fn[0],ve=ve[0];var $e=ve._private.children,qe=ve.id();dm($e,fn),fn._private.parent=null,ut.ids[qe]||(ut.ids[qe]=!0,ut.push(ve))}x.dirtyCompoundBoundsCache(),g&&I.removeFromPool(T);for(var At=0;At<T.length;At++){var xt=T[At];if(xt.isEdge()){var Mt=xt.source()[0],Dt=xt.target()[0];tt(Mt,xt),tt(Dt,xt);for(var Bt=xt.parallelEdges(),Zt=0;Zt<Bt.length;Zt++){var Kt=Bt[Zt];at(Kt),Kt.isBundledBezier()&&Kt.dirtyBoundingBoxCache()}}else{var $t=xt.parent();$t.length!==0&&dt($t,xt)}g&&(xt._private.removed=!0)}var ee=I._private.elements;I._private.hasCompoundNodes=!1;for(var Ht=0;Ht<ee.length;Ht++){var ge=ee[Ht];if(ge.isParent()){I._private.hasCompoundNodes=!0;break}}var be=new Gf(this.cy(),T);be.size()>0&&(y?be.emitAndNotify("remove"):g&&be.emit("remove"));for(var re=0;re<ut.length;re++){var Ne=ut[re];(!g||!Ne.removed())&&Ne.updateStyle()}return be},ku.move=function(y){var g=this._private.cy,x=this,T=!1,A=!1,I=function(ut){return ut==null?ut:""+ut};if(y.source!==void 0||y.target!==void 0){var O=I(y.source),$=I(y.target),z=O!=null&&g.hasElementWithId(O),S=$!=null&&g.hasElementWithId($);(z||S)&&(g.batch(function(){x.remove(T,A),x.emitAndNotify("moveout");for(var at=0;at<x.length;at++){var ut=x[at],dt=ut._private.data;ut.isEdge()&&(z&&(dt.source=O),S&&(dt.target=$))}x.restore(T,A)}),x.emitAndNotify("move"))}else if(y.parent!==void 0){var V=I(y.parent),U=V===null||g.hasElementWithId(V);if(U){var tt=V===null?void 0:V;g.batch(function(){var at=x.remove(T,A);at.emitAndNotify("moveout");for(var ut=0;ut<x.length;ut++){var dt=x[ut],At=dt._private.data;dt.isNode()&&(At.parent=tt)}at.restore(T,A)}),x.emitAndNotify("move")}}return this},[bF,wZ,HE,mp,Z5,PZ,GE,WZ,aB,oB,ZZ,XE,QE,Vf,xm,m1].forEach(function(y){Ke(ku,y)});var sJ={add:function(g){var x,T=this;if(ht(g)){var A=g;if(A._private.cy===T)x=A.restore();else{for(var I=[],O=0;O<A.length;O++){var $=A[O];I.push($.json())}x=new Gf(T,I)}}else if(yt(g)){var z=g;x=new Gf(T,z)}else if(ft(g)&&(yt(g.nodes)||yt(g.edges))){for(var S=g,V=[],U=["nodes","edges"],tt=0,at=U.length;tt<at;tt++){var ut=U[tt],dt=S[ut];if(yt(dt))for(var At=0,xt=dt.length;At<xt;At++){var Mt=Ke({group:ut},dt[At]);V.push(Mt)}}x=new Gf(T,V)}else{var Dt=g;x=new SE(T,Dt).collection()}return x},remove:function(g){if(!ht(g)){if(Tt(g)){var x=g;g=this.$(x)}}return g.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function aJ(y,g,x,T){var A=4,I=.001,O=1e-7,$=10,z=11,S=1/(z-1),V=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var U=0;U<4;++U)if(typeof arguments[U]!="number"||isNaN(arguments[U])||!isFinite(arguments[U]))return!1;y=Math.min(y,1),x=Math.min(x,1),y=Math.max(y,0),x=Math.max(x,0);var tt=V?new Float32Array(z):new Array(z);function at(ge,be){return 1-3*be+3*ge}function ut(ge,be){return 3*be-6*ge}function dt(ge){return 3*ge}function At(ge,be,re){return((at(be,re)*ge+ut(be,re))*ge+dt(be))*ge}function xt(ge,be,re){return 3*at(be,re)*ge*ge+2*ut(be,re)*ge+dt(be)}function Mt(ge,be){for(var re=0;re<A;++re){var Ne=xt(be,y,x);if(Ne===0)return be;var ve=At(be,y,x)-ge;be-=ve/Ne}return be}function Dt(){for(var ge=0;ge<z;++ge)tt[ge]=At(ge*S,y,x)}function Bt(ge,be,re){var Ne,ve,fn=0;do ve=be+(re-be)/2,Ne=At(ve,y,x)-ge,Ne>0?re=ve:be=ve;while(Math.abs(Ne)>O&&++fn<$);return ve}function Zt(ge){for(var be=0,re=1,Ne=z-1;re!==Ne&&tt[re]<=ge;++re)be+=S;--re;var ve=(ge-tt[re])/(tt[re+1]-tt[re]),fn=be+ve*S,$e=xt(fn,y,x);return $e>=I?Mt(ge,fn):$e===0?fn:Bt(ge,be,be+S)}var Kt=!1;function $t(){Kt=!0,(y!==g||x!==T)&&Dt()}var ee=function(be){return Kt||$t(),y===g&&x===T?be:be===0?0:be===1?1:At(Zt(be),g,T)};ee.getControlPoints=function(){return[{x:y,y:g},{x,y:T}]};var Ht="generateBezier("+[y,g,x,T]+")";return ee.toString=function(){return Ht},ee}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var oJ=function(){function y(T){return-T.tension*T.x-T.friction*T.v}function g(T,A,I){var O={x:T.x+I.dx*A,v:T.v+I.dv*A,tension:T.tension,friction:T.friction};return{dx:O.v,dv:y(O)}}function x(T,A){var I={dx:T.v,dv:y(T)},O=g(T,A*.5,I),$=g(T,A*.5,O),z=g(T,A,$),S=1/6*(I.dx+2*(O.dx+$.dx)+z.dx),V=1/6*(I.dv+2*(O.dv+$.dv)+z.dv);return T.x=T.x+S*A,T.v=T.v+V*A,T}return function T(A,I,O){var $={x:-1,v:0,tension:null,friction:null},z=[0],S=0,V=1/1e4,U=16/1e3,tt,at,ut;for(A=parseFloat(A)||500,I=parseFloat(I)||20,O=O||null,$.tension=A,$.friction=I,tt=O!==null,tt?(S=T(A,I),at=S/O*U):at=U;ut=x(ut||$,at),z.push(1+ut.x),S+=16,Math.abs(ut.x)>V&&Math.abs(ut.v)>V;);return tt?function(dt){return z[dt*(z.length-1)|0]}:S}}(),Eu=function(g,x,T,A){var I=aJ(g,x,T,A);return function(O,$,z){return O+($-O)*I(z)}},tT={linear:function(g,x,T){return g+(x-g)*T},ease:Eu(.25,.1,.25,1),"ease-in":Eu(.42,0,1,1),"ease-out":Eu(0,0,.58,1),"ease-in-out":Eu(.42,0,.58,1),"ease-in-sine":Eu(.47,0,.745,.715),"ease-out-sine":Eu(.39,.575,.565,1),"ease-in-out-sine":Eu(.445,.05,.55,.95),"ease-in-quad":Eu(.55,.085,.68,.53),"ease-out-quad":Eu(.25,.46,.45,.94),"ease-in-out-quad":Eu(.455,.03,.515,.955),"ease-in-cubic":Eu(.55,.055,.675,.19),"ease-out-cubic":Eu(.215,.61,.355,1),"ease-in-out-cubic":Eu(.645,.045,.355,1),"ease-in-quart":Eu(.895,.03,.685,.22),"ease-out-quart":Eu(.165,.84,.44,1),"ease-in-out-quart":Eu(.77,0,.175,1),"ease-in-quint":Eu(.755,.05,.855,.06),"ease-out-quint":Eu(.23,1,.32,1),"ease-in-out-quint":Eu(.86,0,.07,1),"ease-in-expo":Eu(.95,.05,.795,.035),"ease-out-expo":Eu(.19,1,.22,1),"ease-in-out-expo":Eu(1,0,0,1),"ease-in-circ":Eu(.6,.04,.98,.335),"ease-out-circ":Eu(.075,.82,.165,1),"ease-in-out-circ":Eu(.785,.135,.15,.86),spring:function(g,x,T){if(T===0)return tT.linear;var A=oJ(g,x,T);return function(I,O,$){return I+(O-I)*A($)}},"cubic-bezier":Eu};function vB(y,g,x,T,A){if(T===1||g===x)return x;var I=A(g,x,T);return y==null||((y.roundValue||y.color)&&(I=Math.round(I)),y.min!==void 0&&(I=Math.max(I,y.min)),y.max!==void 0&&(I=Math.min(I,y.max))),I}function wB(y,g){return y.pfValue!=null||y.value!=null?y.pfValue!=null&&(g==null||g.type.units!=="%")?y.pfValue:y.value:y}function i6(y,g,x,T,A){var I=A!=null?A.type:null;x<0?x=0:x>1&&(x=1);var O=wB(y,A),$=wB(g,A);if(rt(O)&&rt($))return vB(I,O,$,x,T);if(yt(O)&&yt($)){for(var z=[],S=0;S<$.length;S++){var V=O[S],U=$[S];if(V!=null&&U!=null){var tt=vB(I,V,U,x,T);z.push(tt)}else z.push(U)}return z}}function cJ(y,g,x,T){var A=!T,I=y._private,O=g._private,$=O.easing,z=O.startTime,S=T?y:y.cy(),V=S.style();if(!O.easingImpl)if($==null)O.easingImpl=tT.linear;else{var U;if(Tt($)){var tt=V.parse("transition-timing-function",$);U=tt.value}else U=$;var at,ut;Tt(U)?(at=U,ut=[]):(at=U[1],ut=U.slice(2).map(function(Pn){return+Pn})),ut.length>0?(at==="spring"&&ut.push(O.duration),O.easingImpl=tT[at].apply(null,ut)):O.easingImpl=tT[at]}var dt=O.easingImpl,At;if(O.duration===0?At=1:At=(x-z)/O.duration,O.applying&&(At=O.progress),At<0?At=0:At>1&&(At=1),O.delay==null){var xt=O.startPosition,Mt=O.position;if(Mt&&A&&!y.locked()){var Dt={};Ik(xt.x,Mt.x)&&(Dt.x=i6(xt.x,Mt.x,At,dt)),Ik(xt.y,Mt.y)&&(Dt.y=i6(xt.y,Mt.y,At,dt)),y.position(Dt)}var Bt=O.startPan,Zt=O.pan,Kt=I.pan,$t=Zt!=null&&T;$t&&(Ik(Bt.x,Zt.x)&&(Kt.x=i6(Bt.x,Zt.x,At,dt)),Ik(Bt.y,Zt.y)&&(Kt.y=i6(Bt.y,Zt.y,At,dt)),y.emit("pan"));var ee=O.startZoom,Ht=O.zoom,ge=Ht!=null&&T;ge&&(Ik(ee,Ht)&&(I.zoom=wk(I.minZoom,i6(ee,Ht,At,dt),I.maxZoom)),y.emit("zoom")),($t||ge)&&y.emit("viewport");var be=O.style;if(be&&be.length>0&&A){for(var re=0;re<be.length;re++){var Ne=be[re],ve=Ne.name,fn=Ne,$e=O.startStyle[ve],qe=V.properties[$e.name],xn=i6($e,fn,At,dt,qe);V.overrideBypass(y,ve,xn)}y.emit("style")}}return O.progress=At,At}function Ik(y,g){return y==null||g==null?!1:rt(y)&&rt(g)?!0:!!(y&&g)}function uJ(y,g,x,T){var A=g._private;A.started=!0,A.startTime=x-A.progress*A.duration}function mB(y,g){var x=g._private.aniEles,T=[];function A(V,U){var tt=V._private,at=tt.animation.current,ut=tt.animation.queue,dt=!1;if(at.length===0){var At=ut.shift();At&&at.push(At)}for(var xt=function(Kt){for(var $t=Kt.length-1;$t>=0;$t--){var ee=Kt[$t];ee()}Kt.splice(0,Kt.length)},Mt=at.length-1;Mt>=0;Mt--){var Dt=at[Mt],Bt=Dt._private;if(Bt.stopped){at.splice(Mt,1),Bt.hooked=!1,Bt.playing=!1,Bt.started=!1,xt(Bt.frames);continue}!Bt.playing&&!Bt.applying||(Bt.playing&&Bt.applying&&(Bt.applying=!1),Bt.started||uJ(V,Dt,y),cJ(V,Dt,y,U),Bt.applying&&(Bt.applying=!1),xt(Bt.frames),Bt.step!=null&&Bt.step(y),Dt.completed()&&(at.splice(Mt,1),Bt.hooked=!1,Bt.playing=!1,Bt.started=!1,xt(Bt.completes)),dt=!0)}return!U&&at.length===0&&ut.length===0&&T.push(V),dt}for(var I=!1,O=0;O<x.length;O++){var $=x[O],z=A($);I=I||z}var S=A(g,!0);(I||S)&&(x.length>0?g.notify("draw",x):g.notify("draw")),x.unmerge(T),g.emit("step")}var lJ={animate:jc.animate(),animation:jc.animation(),animated:jc.animated(),clearQueue:jc.clearQueue(),delay:jc.delay(),delayAnimation:jc.delayAnimation(),stop:jc.stop(),addToAnimationPool:function(g){var x=this;x.styleEnabled()&&x._private.aniEles.merge(g)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var g=this;if(g._private.animationsRunning=!0,!g.styleEnabled())return;function x(){g._private.animationsRunning&&Ma(function(I){mB(I,g),x()})}var T=g.renderer();T&&T.beforeRender?T.beforeRender(function(I,O){mB(O,g)},T.beforeRenderPriorities.animations):x()}},hJ={qualifierCompare:function(g,x){return g==null||x==null?g==null&&x==null:g.sameText(x)},eventMatches:function(g,x,T){var A=x.qualifier;return A!=null?g!==T.target&&_t(T.target)&&A.matches(T.target):!0},addEventFields:function(g,x){x.cy=g,x.target=g},callbackContext:function(g,x,T){return x.qualifier!=null?T.target:g}},eT=function(g){return Tt(g)?new wm(g):g},yB={createEmitter:function(){var g=this._private;return g.emitter||(g.emitter=new KE(hJ,this)),this},emitter:function(){return this._private.emitter},on:function(g,x,T){return this.emitter().on(g,eT(x),T),this},removeListener:function(g,x,T){return this.emitter().removeListener(g,eT(x),T),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(g,x,T){return this.emitter().one(g,eT(x),T),this},once:function(g,x,T){return this.emitter().one(g,eT(x),T),this},emit:function(g,x){return this.emitter().emit(g,x),this},emitAndNotify:function(g,x){return this.emit(g),this.notify(g,x),this}};jc.eventAliasesOn(yB);var qL={png:function(g){var x=this._private.renderer;return g=g||{},x.png(g)},jpg:function(g){var x=this._private.renderer;return g=g||{},g.bg=g.bg||"#fff",x.jpg(g)}};qL.jpeg=qL.jpg;var nT={layout:function(g){var x=this;if(g==null){Ec("Layout options must be specified to make a layout");return}if(g.name==null){Ec("A `name` must be specified to make a layout");return}var T=g.name,A=x.extension("layout",T);if(A==null){Ec("No such layout `"+T+"` found.  Did you forget to import it and `cytoscape.use()` it?");return}var I;Tt(g.eles)?I=x.$(g.eles):I=g.eles!=null?g.eles:x.$();var O=new A(Ke({},g,{cy:x,eles:I}));return O}};nT.createLayout=nT.makeLayout=nT.layout;var fJ={notify:function(g,x){var T=this._private;if(this.batching()){T.batchNotifications=T.batchNotifications||{};var A=T.batchNotifications[g]=T.batchNotifications[g]||this.collection();x!=null&&A.merge(x);return}if(T.notificationsEnabled){var I=this.renderer();this.destroyed()||!I||I.notify(g,x)}},notifications:function(g){var x=this._private;return g===void 0?x.notificationsEnabled:(x.notificationsEnabled=!!g,this)},noNotifications:function(g){this.notifications(!1),g(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var g=this._private;return g.batchCount==null&&(g.batchCount=0),g.batchCount===0&&(g.batchStyleEles=this.collection(),g.batchNotifications={}),g.batchCount++,this},endBatch:function(){var g=this._private;if(g.batchCount===0)return this;if(g.batchCount--,g.batchCount===0){g.batchStyleEles.updateStyle();var x=this.renderer();Object.keys(g.batchNotifications).forEach(function(T){var A=g.batchNotifications[T];A.empty()?x.notify(T):x.notify(T,A)})}return this},batch:function(g){return this.startBatch(),g(),this.endBatch(),this},batchData:function(g){var x=this;return this.batch(function(){for(var T=Object.keys(g),A=0;A<T.length;A++){var I=T[A],O=g[I],$=x.getElementById(I);$.data(O)}})}},dJ=Hf({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),HL={renderTo:function(g,x,T,A){var I=this._private.renderer;return I.renderTo(g,x,T,A),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(g){var x=this,T=x.extension("renderer",g.name);if(T==null){Ec("Can not initialise: No such renderer `".concat(g.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}g.wheelSensitivity!==void 0&&Wo("You have set a custom wheel sensitivity.  This will make your app zoom unnaturally when using mainstream mice.  You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var A=dJ(g);A.cy=x,x._private.renderer=new T(A),this.notify("init")},destroyRenderer:function(){var g=this;g.notify("destroy");var x=g.container();if(x)for(x._cyreg=null;x.childNodes.length>0;)x.removeChild(x.childNodes[0]);g._private.renderer=null,g.mutableElements().forEach(function(T){var A=T._private;A.rscratch={},A.rstyle={},A.animation.current=[],A.animation.queue=[]})},onRender:function(g){return this.on("render",g)},offRender:function(g){return this.off("render",g)}};HL.invalidateDimensions=HL.resize;var rT={collection:function(g,x){return Tt(g)?this.$(g):ht(g)?g.collection():yt(g)?(x||(x={}),new Gf(this,g,x.unique,x.removed)):new Gf(this)},nodes:function(g){var x=this.$(function(T){return T.isNode()});return g?x.filter(g):x},edges:function(g){var x=this.$(function(T){return T.isEdge()});return g?x.filter(g):x},$:function(g){var x=this._private.elements;return g?x.filter(g):x.spawnSelf()},mutableElements:function(){return this._private.elements}};rT.elements=rT.filter=rT.$;var y1={},Ok="t",gJ="f";y1.apply=function(y){for(var g=this,x=g._private,T=x.cy,A=T.collection(),I=0;I<y.length;I++){var O=y[I],$=g.getContextMeta(O);if(!$.empty){var z=g.getContextStyle($),S=g.applyContextStyle($,z,O);O._private.appliedInitStyle?g.updateTransitions(O,S.diffProps):O._private.appliedInitStyle=!0;var V=g.updateStyleHints(O);V&&A.push(O)}}return A},y1.getPropertiesDiff=function(y,g){var x=this,T=x._private.propDiffs=x._private.propDiffs||{},A=y+"-"+g,I=T[A];if(I)return I;for(var O=[],$={},z=0;z<x.length;z++){var S=x[z],V=y[z]===Ok,U=g[z]===Ok,tt=V!==U,at=S.mappedProperties.length>0;if(tt||U&&at){var ut=void 0;tt&&at||tt?ut=S.properties:at&&(ut=S.mappedProperties);for(var dt=0;dt<ut.length;dt++){for(var At=ut[dt],xt=At.name,Mt=!1,Dt=z+1;Dt<x.length;Dt++){var Bt=x[Dt],Zt=g[Dt]===Ok;if(Zt&&(Mt=Bt.properties[At.name]!=null,Mt))break}!$[xt]&&!Mt&&($[xt]=!0,O.push(xt))}}}return T[A]=O,O},y1.getContextMeta=function(y){for(var g=this,x="",T,A=y._private.styleCxtKey||"",I=0;I<g.length;I++){var O=g[I],$=O.selector&&O.selector.matches(y);$?x+=Ok:x+=gJ}return T=g.getPropertiesDiff(A,x),y._private.styleCxtKey=x,{key:x,diffPropNames:T,empty:T.length===0}},y1.getContextStyle=function(y){var g=y.key,x=this,T=this._private.contextStyles=this._private.contextStyles||{};if(T[g])return T[g];for(var A={_private:{key:g}},I=0;I<x.length;I++){var O=x[I],$=g[I]===Ok;if($)for(var z=0;z<O.properties.length;z++){var S=O.properties[z];A[S.name]=S}}return T[g]=A,A},y1.applyContextStyle=function(y,g,x){for(var T=this,A=y.diffPropNames,I={},O=T.types,$=0;$<A.length;$++){var z=A[$],S=g[z],V=x.pstyle(z);if(!S)if(V)V.bypass?S={name:z,deleteBypassed:!0}:S={name:z,delete:!0};else continue;if(V!==S){if(S.mapped===O.fn&&V!=null&&V.mapping!=null&&V.mapping.value===S.value){var U=V.mapping,tt=U.fnValue=S.value(x);if(tt===U.prevFnValue)continue}var at=I[z]={prev:V};T.applyParsedProperty(x,S),at.next=x.pstyle(z),at.next&&at.next.bypass&&(at.next=at.next.bypassed)}}return{diffProps:I}},y1.updateStyleHints=function(y){var g=y._private,x=this,T=x.propertyGroupNames,A=x.propertyGroupKeys,I=function(fi,Ii,oa){return x.getPropertiesHash(fi,Ii,oa)},O=g.styleKey;if(y.removed())return!1;var $=g.group==="nodes",z=y._private.style;T=Object.keys(z);for(var S=0;S<A.length;S++){var V=A[S];g.styleKeys[V]=[Rc,pp]}for(var U=function(fi,Ii){return g.styleKeys[Ii][0]=uf(fi,g.styleKeys[Ii][0])},tt=function(fi,Ii){return g.styleKeys[Ii][1]=lm(fi,g.styleKeys[Ii][1])},at=function(fi,Ii){U(fi,Ii),tt(fi,Ii)},ut=function(fi,Ii){for(var oa=0;oa<fi.length;oa++){var Fa=fi.charCodeAt(oa);U(Fa,Ii),tt(Fa,Ii)}},dt=2e9,At=function(fi){return-128<fi&&fi<128&&Math.floor(fi)!==fi?dt-(fi*1024|0):fi},xt=0;xt<T.length;xt++){var Mt=T[xt],Dt=z[Mt];if(Dt!=null){var Bt=this.properties[Mt],Zt=Bt.type,Kt=Bt.groupKey,$t=void 0;Bt.hashOverride!=null?$t=Bt.hashOverride(y,Dt):Dt.pfValue!=null&&($t=Dt.pfValue);var ee=Bt.enums==null?Dt.value:null,Ht=$t!=null,ge=ee!=null,be=Ht||ge,re=Dt.units;if(Zt.number&&be&&!Zt.multiple){var Ne=Ht?$t:ee;at(At(Ne),Kt),!Ht&&re!=null&&ut(re,Kt)}else ut(Dt.strValue,Kt)}}for(var ve=[Rc,pp],fn=0;fn<A.length;fn++){var $e=A[fn],qe=g.styleKeys[$e];ve[0]=uf(qe[0],ve[0]),ve[1]=lm(qe[1],ve[1])}g.styleKey=TE(ve[0],ve[1]);var xn=g.styleKeys;g.labelDimsKey=bp(xn.labelDimensions);var Pn=I(y,["label"],xn.labelDimensions);if(g.labelKey=bp(Pn),g.labelStyleKey=bp(B5(xn.commonLabel,Pn)),!$){var er=I(y,["source-label"],xn.labelDimensions);g.sourceLabelKey=bp(er),g.sourceLabelStyleKey=bp(B5(xn.commonLabel,er));var Sn=I(y,["target-label"],xn.labelDimensions);g.targetLabelKey=bp(Sn),g.targetLabelStyleKey=bp(B5(xn.commonLabel,Sn))}if($){var Jn=g.styleKeys,fr=Jn.nodeBody,Sr=Jn.nodeBorder,wr=Jn.backgroundImage,cr=Jn.compound,bn=Jn.pie,Tr=[fr,Sr,wr,cr,bn].filter(function(xr){return xr!=null}).reduce(B5,[Rc,pp]);g.nodeKey=bp(Tr),g.hasPie=bn!=null&&bn[0]!==Rc&&bn[1]!==pp}return O!==g.styleKey},y1.clearStyleHints=function(y){var g=y._private;g.styleCxtKey="",g.styleKeys={},g.styleKey=null,g.labelKey=null,g.labelStyleKey=null,g.sourceLabelKey=null,g.sourceLabelStyleKey=null,g.targetLabelKey=null,g.targetLabelStyleKey=null,g.nodeKey=null,g.hasPie=null},y1.applyParsedProperty=function(y,g){var x=this,T=g,A=y._private.style,I,O=x.types,$=x.properties[T.name].type,z=T.bypass,S=A[T.name],V=S&&S.bypass,U=y._private,tt="mapping",at=function(fr){return fr==null?null:fr.pfValue!=null?fr.pfValue:fr.value},ut=function(){var fr=at(S),Sr=at(T);x.checkTriggers(y,T.name,fr,Sr)};if(T&&T.name.substr(0,3)==="pie"&&Wo("The pie style properties are deprecated.  Create charts using background images instead."),g.name==="curve-style"&&y.isEdge()&&(g.value!=="bezier"&&y.isLoop()||g.value==="haystack"&&(y.source().isParent()||y.target().isParent()))&&(T=g=this.parse(g.name,"bezier",z)),T.delete)return A[T.name]=void 0,ut(),!0;if(T.deleteBypassed)return S?S.bypass?(S.bypassed=void 0,ut(),!0):!1:(ut(),!0);if(T.deleteBypass)return S?S.bypass?(A[T.name]=S.bypassed,ut(),!0):!1:(ut(),!0);var dt=function(){Wo("Do not assign mappings to elements without corresponding data (i.e. ele `"+y.id()+"` has no mapping for property `"+T.name+"` with data field `"+T.field+"`); try a `["+T.field+"]` selector to limit scope to elements with `"+T.field+"` defined")};switch(T.mapped){case O.mapData:{for(var At=T.field.split("."),xt=U.data,Mt=0;Mt<At.length&&xt;Mt++){var Dt=At[Mt];xt=xt[Dt]}if(xt==null)return dt(),!1;var Bt;if(rt(xt)){var Zt=T.fieldMax-T.fieldMin;Zt===0?Bt=0:Bt=(xt-T.fieldMin)/Zt}else return Wo("Do not use continuous mappers without specifying numeric data (i.e. `"+T.field+": "+xt+"` for `"+y.id()+"` is non-numeric)"),!1;if(Bt<0?Bt=0:Bt>1&&(Bt=1),$.color){var Kt=T.valueMin[0],$t=T.valueMax[0],ee=T.valueMin[1],Ht=T.valueMax[1],ge=T.valueMin[2],be=T.valueMax[2],re=T.valueMin[3]==null?1:T.valueMin[3],Ne=T.valueMax[3]==null?1:T.valueMax[3],ve=[Math.round(Kt+($t-Kt)*Bt),Math.round(ee+(Ht-ee)*Bt),Math.round(ge+(be-ge)*Bt),Math.round(re+(Ne-re)*Bt)];I={bypass:T.bypass,name:T.name,value:ve,strValue:"rgb("+ve[0]+", "+ve[1]+", "+ve[2]+")"}}else if($.number){var fn=T.valueMin+(T.valueMax-T.valueMin)*Bt;I=this.parse(T.name,fn,T.bypass,tt)}else return!1;if(!I)return dt(),!1;I.mapping=T,T=I;break}case O.data:{for(var $e=T.field.split("."),qe=U.data,xn=0;xn<$e.length&&qe;xn++){var Pn=$e[xn];qe=qe[Pn]}if(qe!=null&&(I=this.parse(T.name,qe,T.bypass,tt)),!I)return dt(),!1;I.mapping=T,T=I;break}case O.fn:{var er=T.value,Sn=T.fnValue!=null?T.fnValue:er(y);if(T.prevFnValue=Sn,Sn==null)return Wo("Custom function mappers may not return null (i.e. `"+T.name+"` for ele `"+y.id()+"` is null)"),!1;if(I=this.parse(T.name,Sn,T.bypass,tt),!I)return Wo("Custom function mappers may not return invalid values for the property type (i.e. `"+T.name+"` for ele `"+y.id()+"` is invalid)"),!1;I.mapping=oh(T),T=I;break}case void 0:break;default:return!1}return z?(V?T.bypassed=S.bypassed:T.bypassed=S,A[T.name]=T):V?S.bypassed=T:A[T.name]=T,ut(),!0},y1.cleanElements=function(y,g){for(var x=0;x<y.length;x++){var T=y[x];if(this.clearStyleHints(T),T.dirtyCompoundBoundsCache(),T.dirtyBoundingBoxCache(),!g)T._private.style={};else for(var A=T._private.style,I=Object.keys(A),O=0;O<I.length;O++){var $=I[O],z=A[$];z!=null&&(z.bypass?z.bypassed=null:A[$]=null)}}},y1.update=function(){var y=this._private.cy,g=y.mutableElements();g.updateStyle()},y1.updateTransitions=function(y,g){var x=this,T=y._private,A=y.pstyle("transition-property").value,I=y.pstyle("transition-duration").pfValue,O=y.pstyle("transition-delay").pfValue;if(A.length>0&&I>0){for(var $={},z=!1,S=0;S<A.length;S++){var V=A[S],U=y.pstyle(V),tt=g[V];if(tt){var at=tt.prev,ut=at,dt=tt.next!=null?tt.next:U,At=!1,xt=void 0,Mt=1e-6;ut&&(rt(ut.pfValue)&&rt(dt.pfValue)?(At=dt.pfValue-ut.pfValue,xt=ut.pfValue+Mt*At):rt(ut.value)&&rt(dt.value)?(At=dt.value-ut.value,xt=ut.value+Mt*At):yt(ut.value)&&yt(dt.value)&&(At=ut.value[0]!==dt.value[0]||ut.value[1]!==dt.value[1]||ut.value[2]!==dt.value[2],xt=ut.strValue),At&&($[V]=dt.strValue,this.applyBypass(y,V,xt),z=!0))}}if(!z)return;T.transitioning=!0,new W5(function(Dt){O>0?y.delayAnimation(O).play().promise().then(Dt):Dt()}).then(function(){return y.animation({style:$,duration:I,easing:y.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){x.removeBypasses(y,A),y.emitAndNotify("style"),T.transitioning=!1})}else T.transitioning&&(this.removeBypasses(y,A),y.emitAndNotify("style"),T.transitioning=!1)},y1.checkTrigger=function(y,g,x,T,A,I){var O=this.properties[g],$=A(O);$!=null&&$(x,T)&&I(O)},y1.checkZOrderTrigger=function(y,g,x,T){var A=this;this.checkTrigger(y,g,x,T,function(I){return I.triggersZOrder},function(){A._private.cy.notify("zorder",y)})},y1.checkBoundsTrigger=function(y,g,x,T){this.checkTrigger(y,g,x,T,function(A){return A.triggersBounds},function(A){y.dirtyCompoundBoundsCache(),y.dirtyBoundingBoxCache(),A.triggersBoundsOfParallelBeziers&&(g==="curve-style"&&(x==="bezier"||T==="bezier")||g==="display"&&(x==="none"||T==="none"))&&y.parallelEdges().forEach(function(I){I.isBundledBezier()&&I.dirtyBoundingBoxCache()})})},y1.checkTriggers=function(y,g,x,T){y.dirtyStyleCache(),this.checkZOrderTrigger(y,g,x,T),this.checkBoundsTrigger(y,g,x,T)};var Pk={};Pk.applyBypass=function(y,g,x,T){var A=this,I=[],O=!0;if(g==="*"||g==="**"){if(x!==void 0)for(var $=0;$<A.properties.length;$++){var z=A.properties[$],S=z.name,V=this.parse(S,x,!0);V&&I.push(V)}}else if(Tt(g)){var U=this.parse(g,x,!0);U&&I.push(U)}else if(ft(g)){var tt=g;T=x;for(var at=Object.keys(tt),ut=0;ut<at.length;ut++){var dt=at[ut],At=tt[dt];if(At===void 0&&(At=tt[_n(dt)]),At!==void 0){var xt=this.parse(dt,At,!0);xt&&I.push(xt)}}}else return!1;if(I.length===0)return!1;for(var Mt=!1,Dt=0;Dt<y.length;Dt++){for(var Bt=y[Dt],Zt={},Kt=void 0,$t=0;$t<I.length;$t++){var ee=I[$t];if(T){var Ht=Bt.pstyle(ee.name);Kt=Zt[ee.name]={prev:Ht}}Mt=this.applyParsedProperty(Bt,oh(ee))||Mt,T&&(Kt.next=Bt.pstyle(ee.name))}Mt&&this.updateStyleHints(Bt),T&&this.updateTransitions(Bt,Zt,O)}return Mt},Pk.overrideBypass=function(y,g,x){g=Ue(g);for(var T=0;T<y.length;T++){var A=y[T],I=A._private.style[g],O=this.properties[g].type,$=O.color,z=O.mutiple,S=I?I.pfValue!=null?I.pfValue:I.value:null;!I||!I.bypass?this.applyBypass(A,g,x):(I.value=x,I.pfValue!=null&&(I.pfValue=x),$?I.strValue="rgb("+x.join(",")+")":z?I.strValue=x.join(" "):I.strValue=""+x,this.updateStyleHints(A)),this.checkTriggers(A,g,S,x)}},Pk.removeAllBypasses=function(y,g){return this.removeBypasses(y,this.propertyNames,g)},Pk.removeBypasses=function(y,g,x){for(var T=!0,A=0;A<y.length;A++){for(var I=y[A],O={},$=0;$<g.length;$++){var z=g[$],S=this.properties[z],V=I.pstyle(S.name);if(!(!V||!V.bypass)){var U="",tt=this.parse(z,U,!0),at=O[S.name]={prev:V};this.applyParsedProperty(I,tt),at.next=I.pstyle(S.name)}}this.updateStyleHints(I),x&&this.updateTransitions(I,O,T)}};var VL={};VL.getEmSizeInPixels=function(){var y=this.containerCss("font-size");return y!=null?parseFloat(y):1},VL.containerCss=function(y){var g=this._private.cy,x=g.container();if(R&&x&&R.getComputedStyle)return R.getComputedStyle(x).getPropertyValue(y)};var z2={};z2.getRenderedStyle=function(y,g){return g?this.getStylePropertyValue(y,g,!0):this.getRawStyle(y,!0)},z2.getRawStyle=function(y,g){var x=this;if(y=y[0],y){for(var T={},A=0;A<x.properties.length;A++){var I=x.properties[A],O=x.getStylePropertyValue(y,I.name,g);O!=null&&(T[I.name]=O,T[_n(I.name)]=O)}return T}},z2.getIndexedStyle=function(y,g,x,T){var A=y.pstyle(g)[x][T];return A??y.cy().style().getDefaultProperty(g)[x][0]},z2.getStylePropertyValue=function(y,g,x){var T=this;if(y=y[0],y){var A=T.properties[g];A.alias&&(A=A.pointsTo);var I=A.type,O=y.pstyle(A.name);if(O){var $=O.value,z=O.units,S=O.strValue;if(x&&I.number&&$!=null&&rt($)){var V=y.cy().zoom(),U=function(At){return At*V},tt=function(At,xt){return U(At)+xt},at=yt($),ut=at?z.every(function(dt){return dt!=null}):z!=null;return ut?at?$.map(function(dt,At){return tt(dt,z[At])}).join(" "):tt($,z):at?$.map(function(dt){return Tt(dt)?dt:""+U(dt)}).join(" "):""+U($)}else if(S!=null)return S}return null}},z2.getAnimationStartStyle=function(y,g){for(var x={},T=0;T<g.length;T++){var A=g[T],I=A.name,O=y.pstyle(I);O!==void 0&&(ft(O)?O=this.parse(I,O.strValue):O=this.parse(I,O)),O&&(x[I]=O)}return x},z2.getPropsList=function(y){var g=this,x=[],T=y,A=g.properties;if(T)for(var I=Object.keys(T),O=0;O<I.length;O++){var $=I[O],z=T[$],S=A[$]||A[Ue($)],V=this.parse(S.name,z);V&&x.push(V)}return x},z2.getNonDefaultPropertiesHash=function(y,g,x){var T=x.slice(),A,I,O,$,z,S;for(z=0;z<g.length;z++)if(A=g[z],I=y.pstyle(A,!1),I!=null)if(I.pfValue!=null)T[0]=uf($,T[0]),T[1]=lm($,T[1]);else for(O=I.strValue,S=0;S<O.length;S++)$=O.charCodeAt(S),T[0]=uf($,T[0]),T[1]=lm($,T[1]);return T},z2.getPropertiesHash=z2.getNonDefaultPropertiesHash;var iT={};iT.appendFromJson=function(y){for(var g=this,x=0;x<y.length;x++){var T=y[x],A=T.selector,I=T.style||T.css,O=Object.keys(I);g.selector(A);for(var $=0;$<O.length;$++){var z=O[$],S=I[z];g.css(z,S)}}return g},iT.fromJson=function(y){var g=this;return g.resetToDefault(),g.appendFromJson(y),g},iT.json=function(){for(var y=[],g=this.defaultLength;g<this.length;g++){for(var x=this[g],T=x.selector,A=x.properties,I={},O=0;O<A.length;O++){var $=A[O];I[$.name]=$.strValue}y.push({selector:T?T.toString():"core",style:I})}return y};var GL={};GL.appendFromString=function(y){var g=this,x=this,T=""+y,A,I,O;T=T.replace(/[/][*](\s|.)+?[*][/]/g,"");function $(){T.length>A.length?T=T.substr(A.length):T=""}function z(){I.length>O.length?I=I.substr(O.length):I=""}for(;;){var S=T.match(/^\s*$/);if(S)break;var V=T.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!V){Wo("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+T);break}A=V[0];var U=V[1];if(U!=="core"){var tt=new wm(U);if(tt.invalid){Wo("Skipping parsing of block: Invalid selector found in string stylesheet: "+U),$();continue}}var at=V[2],ut=!1;I=at;for(var dt=[];;){var At=I.match(/^\s*$/);if(At)break;var xt=I.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!xt){Wo("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+at),ut=!0;break}O=xt[0];var Mt=xt[1],Dt=xt[2],Bt=g.properties[Mt];if(!Bt){Wo("Skipping property: Invalid property name in: "+O),z();continue}var Zt=x.parse(Mt,Dt);if(!Zt){Wo("Skipping property: Invalid property definition in: "+O),z();continue}dt.push({name:Mt,val:Dt}),z()}if(ut){$();break}x.selector(U);for(var Kt=0;Kt<dt.length;Kt++){var $t=dt[Kt];x.css($t.name,$t.val)}$()}return x},GL.fromString=function(y){var g=this;return g.resetToDefault(),g.appendFromString(y),g};var Uf={};(function(){var y=Te,g=Ee,x=Vt,T=Ae,A=Gt,I=function(Tr){return"^"+Tr+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},O=function(Tr){var xr=y+"|\\w+|"+g+"|"+x+"|"+T+"|"+A;return"^"+Tr+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+y+")\\s*\\,\\s*("+y+")\\s*,\\s*("+xr+")\\s*\\,\\s*("+xr+")\\)$"},$=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];Uf.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi"]},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:I("data")},layoutData:{mapping:!0,regex:I("layoutData")},scratch:{mapping:!0,regex:I("scratch")},mapData:{mapping:!0,regex:O("mapData")},mapLayoutData:{mapping:!0,regex:O("mapLayoutData")},mapScratch:{mapping:!0,regex:O("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:$,singleRegexMatchValue:!0},urls:{regexes:$,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(Tr,xr){switch(Tr.length){case 2:return xr[0]!=="deg"&&xr[0]!=="rad"&&xr[1]!=="deg"&&xr[1]!=="rad";case 1:return Tt(Tr[0])||xr[0]==="deg"||xr[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+y+")\\s*,\\s*("+y+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+y+")\\s*,\\s*("+y+")\\s*,\\s*("+y+")\\s*,\\s*("+y+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(Tr){var xr=Tr.length;return xr===1||xr===2||xr===4}}};var z={zeroNonZero:function(Tr,xr){return(Tr==null||xr==null)&&Tr!==xr||Tr==0&&xr!=0?!0:Tr!=0&&xr==0},any:function(Tr,xr){return Tr!=xr},emptyNonEmpty:function(Tr,xr){var fi=J(Tr),Ii=J(xr);return fi&&!Ii||!fi&&Ii}},S=Uf.types,V=[{name:"label",type:S.text,triggersBounds:z.any,triggersZOrder:z.emptyNonEmpty},{name:"text-rotation",type:S.textRotation,triggersBounds:z.any},{name:"text-margin-x",type:S.bidirectionalSize,triggersBounds:z.any},{name:"text-margin-y",type:S.bidirectionalSize,triggersBounds:z.any}],U=[{name:"source-label",type:S.text,triggersBounds:z.any},{name:"source-text-rotation",type:S.textRotation,triggersBounds:z.any},{name:"source-text-margin-x",type:S.bidirectionalSize,triggersBounds:z.any},{name:"source-text-margin-y",type:S.bidirectionalSize,triggersBounds:z.any},{name:"source-text-offset",type:S.size,triggersBounds:z.any}],tt=[{name:"target-label",type:S.text,triggersBounds:z.any},{name:"target-text-rotation",type:S.textRotation,triggersBounds:z.any},{name:"target-text-margin-x",type:S.bidirectionalSize,triggersBounds:z.any},{name:"target-text-margin-y",type:S.bidirectionalSize,triggersBounds:z.any},{name:"target-text-offset",type:S.size,triggersBounds:z.any}],at=[{name:"font-family",type:S.fontFamily,triggersBounds:z.any},{name:"font-style",type:S.fontStyle,triggersBounds:z.any},{name:"font-weight",type:S.fontWeight,triggersBounds:z.any},{name:"font-size",type:S.size,triggersBounds:z.any},{name:"text-transform",type:S.textTransform,triggersBounds:z.any},{name:"text-wrap",type:S.textWrap,triggersBounds:z.any},{name:"text-overflow-wrap",type:S.textOverflowWrap,triggersBounds:z.any},{name:"text-max-width",type:S.size,triggersBounds:z.any},{name:"text-outline-width",type:S.size,triggersBounds:z.any},{name:"line-height",type:S.positiveNumber,triggersBounds:z.any}],ut=[{name:"text-valign",type:S.valign,triggersBounds:z.any},{name:"text-halign",type:S.halign,triggersBounds:z.any},{name:"color",type:S.color},{name:"text-outline-color",type:S.color},{name:"text-outline-opacity",type:S.zeroOneNumber},{name:"text-background-color",type:S.color},{name:"text-background-opacity",type:S.zeroOneNumber},{name:"text-background-padding",type:S.size,triggersBounds:z.any},{name:"text-border-opacity",type:S.zeroOneNumber},{name:"text-border-color",type:S.color},{name:"text-border-width",type:S.size,triggersBounds:z.any},{name:"text-border-style",type:S.borderStyle,triggersBounds:z.any},{name:"text-background-shape",type:S.textBackgroundShape,triggersBounds:z.any},{name:"text-justification",type:S.justification}],dt=[{name:"events",type:S.bool},{name:"text-events",type:S.bool}],At=[{name:"display",type:S.display,triggersZOrder:z.any,triggersBounds:z.any,triggersBoundsOfParallelBeziers:!0},{name:"visibility",type:S.visibility,triggersZOrder:z.any},{name:"opacity",type:S.zeroOneNumber,triggersZOrder:z.zeroNonZero},{name:"text-opacity",type:S.zeroOneNumber},{name:"min-zoomed-font-size",type:S.size},{name:"z-compound-depth",type:S.zCompoundDepth,triggersZOrder:z.any},{name:"z-index-compare",type:S.zIndexCompare,triggersZOrder:z.any},{name:"z-index",type:S.nonNegativeInt,triggersZOrder:z.any}],xt=[{name:"overlay-padding",type:S.size,triggersBounds:z.any},{name:"overlay-color",type:S.color},{name:"overlay-opacity",type:S.zeroOneNumber,triggersBounds:z.zeroNonZero},{name:"overlay-shape",type:S.overlayShape,triggersBounds:z.any}],Mt=[{name:"underlay-padding",type:S.size,triggersBounds:z.any},{name:"underlay-color",type:S.color},{name:"underlay-opacity",type:S.zeroOneNumber,triggersBounds:z.zeroNonZero},{name:"underlay-shape",type:S.overlayShape,triggersBounds:z.any}],Dt=[{name:"transition-property",type:S.propList},{name:"transition-duration",type:S.time},{name:"transition-delay",type:S.time},{name:"transition-timing-function",type:S.easing}],Bt=function(Tr,xr){return xr.value==="label"?-Tr.poolIndex():xr.pfValue},Zt=[{name:"height",type:S.nodeSize,triggersBounds:z.any,hashOverride:Bt},{name:"width",type:S.nodeSize,triggersBounds:z.any,hashOverride:Bt},{name:"shape",type:S.nodeShape,triggersBounds:z.any},{name:"shape-polygon-points",type:S.polygonPointList,triggersBounds:z.any},{name:"background-color",type:S.color},{name:"background-fill",type:S.fill},{name:"background-opacity",type:S.zeroOneNumber},{name:"background-blacken",type:S.nOneOneNumber},{name:"background-gradient-stop-colors",type:S.colors},{name:"background-gradient-stop-positions",type:S.percentages},{name:"background-gradient-direction",type:S.gradientDirection},{name:"padding",type:S.sizeMaybePercent,triggersBounds:z.any},{name:"padding-relative-to",type:S.paddingRelativeTo,triggersBounds:z.any},{name:"bounds-expansion",type:S.boundsExpansion,triggersBounds:z.any}],Kt=[{name:"border-color",type:S.color},{name:"border-opacity",type:S.zeroOneNumber},{name:"border-width",type:S.size,triggersBounds:z.any},{name:"border-style",type:S.borderStyle}],$t=[{name:"background-image",type:S.urls},{name:"background-image-crossorigin",type:S.bgCrossOrigin},{name:"background-image-opacity",type:S.zeroOneNumbers},{name:"background-image-containment",type:S.bgContainment},{name:"background-image-smoothing",type:S.bools},{name:"background-position-x",type:S.bgPos},{name:"background-position-y",type:S.bgPos},{name:"background-width-relative-to",type:S.bgRelativeTo},{name:"background-height-relative-to",type:S.bgRelativeTo},{name:"background-repeat",type:S.bgRepeat},{name:"background-fit",type:S.bgFit},{name:"background-clip",type:S.bgClip},{name:"background-width",type:S.bgWH},{name:"background-height",type:S.bgWH},{name:"background-offset-x",type:S.bgPos},{name:"background-offset-y",type:S.bgPos}],ee=[{name:"position",type:S.position,triggersBounds:z.any},{name:"compound-sizing-wrt-labels",type:S.compoundIncludeLabels,triggersBounds:z.any},{name:"min-width",type:S.size,triggersBounds:z.any},{name:"min-width-bias-left",type:S.sizeMaybePercent,triggersBounds:z.any},{name:"min-width-bias-right",type:S.sizeMaybePercent,triggersBounds:z.any},{name:"min-height",type:S.size,triggersBounds:z.any},{name:"min-height-bias-top",type:S.sizeMaybePercent,triggersBounds:z.any},{name:"min-height-bias-bottom",type:S.sizeMaybePercent,triggersBounds:z.any}],Ht=[{name:"line-style",type:S.lineStyle},{name:"line-color",type:S.color},{name:"line-fill",type:S.fill},{name:"line-cap",type:S.lineCap},{name:"line-opacity",type:S.zeroOneNumber},{name:"line-dash-pattern",type:S.numbers},{name:"line-dash-offset",type:S.number},{name:"line-gradient-stop-colors",type:S.colors},{name:"line-gradient-stop-positions",type:S.percentages},{name:"curve-style",type:S.curveStyle,triggersBounds:z.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:S.zeroOneNumber,triggersBounds:z.any},{name:"source-endpoint",type:S.edgeEndpoint,triggersBounds:z.any},{name:"target-endpoint",type:S.edgeEndpoint,triggersBounds:z.any},{name:"control-point-step-size",type:S.size,triggersBounds:z.any},{name:"control-point-distances",type:S.bidirectionalSizes,triggersBounds:z.any},{name:"control-point-weights",type:S.numbers,triggersBounds:z.any},{name:"segment-distances",type:S.bidirectionalSizes,triggersBounds:z.any},{name:"segment-weights",type:S.numbers,triggersBounds:z.any},{name:"taxi-turn",type:S.bidirectionalSizeMaybePercent,triggersBounds:z.any},{name:"taxi-turn-min-distance",type:S.size,triggersBounds:z.any},{name:"taxi-direction",type:S.axisDirection,triggersBounds:z.any},{name:"edge-distances",type:S.edgeDistances,triggersBounds:z.any},{name:"arrow-scale",type:S.positiveNumber,triggersBounds:z.any},{name:"loop-direction",type:S.angle,triggersBounds:z.any},{name:"loop-sweep",type:S.angle,triggersBounds:z.any},{name:"source-distance-from-node",type:S.size,triggersBounds:z.any},{name:"target-distance-from-node",type:S.size,triggersBounds:z.any}],ge=[{name:"ghost",type:S.bool,triggersBounds:z.any},{name:"ghost-offset-x",type:S.bidirectionalSize,triggersBounds:z.any},{name:"ghost-offset-y",type:S.bidirectionalSize,triggersBounds:z.any},{name:"ghost-opacity",type:S.zeroOneNumber}],be=[{name:"selection-box-color",type:S.color},{name:"selection-box-opacity",type:S.zeroOneNumber},{name:"selection-box-border-color",type:S.color},{name:"selection-box-border-width",type:S.size},{name:"active-bg-color",type:S.color},{name:"active-bg-opacity",type:S.zeroOneNumber},{name:"active-bg-size",type:S.size},{name:"outside-texture-bg-color",type:S.color},{name:"outside-texture-bg-opacity",type:S.zeroOneNumber}],re=[];Uf.pieBackgroundN=16,re.push({name:"pie-size",type:S.sizeMaybePercent});for(var Ne=1;Ne<=Uf.pieBackgroundN;Ne++)re.push({name:"pie-"+Ne+"-background-color",type:S.color}),re.push({name:"pie-"+Ne+"-background-size",type:S.percent}),re.push({name:"pie-"+Ne+"-background-opacity",type:S.zeroOneNumber});var ve=[],fn=Uf.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:S.arrowShape,triggersBounds:z.any},{name:"arrow-color",type:S.color},{name:"arrow-fill",type:S.arrowFill}].forEach(function(bn){fn.forEach(function(Tr){var xr=Tr+"-"+bn.name,fi=bn.type,Ii=bn.triggersBounds;ve.push({name:xr,type:fi,triggersBounds:Ii})})},{});var $e=Uf.properties=[].concat(dt,Dt,At,xt,Mt,ge,ut,at,V,U,tt,Zt,Kt,$t,re,ee,Ht,ve,be),qe=Uf.propertyGroups={behavior:dt,transition:Dt,visibility:At,overlay:xt,underlay:Mt,ghost:ge,commonLabel:ut,labelDimensions:at,mainLabel:V,sourceLabel:U,targetLabel:tt,nodeBody:Zt,nodeBorder:Kt,backgroundImage:$t,pie:re,compound:ee,edgeLine:Ht,edgeArrow:ve,core:be},xn=Uf.propertyGroupNames={},Pn=Uf.propertyGroupKeys=Object.keys(qe);Pn.forEach(function(bn){xn[bn]=qe[bn].map(function(Tr){return Tr.name}),qe[bn].forEach(function(Tr){return Tr.groupKey=bn})});var er=Uf.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];Uf.propertyNames=$e.map(function(bn){return bn.name});for(var Sn=0;Sn<$e.length;Sn++){var Jn=$e[Sn];$e[Jn.name]=Jn}for(var fr=0;fr<er.length;fr++){var Sr=er[fr],wr=$e[Sr.pointsTo],cr={name:Sr.name,alias:!0,pointsTo:wr};$e.push(cr),$e[Sr.name]=cr}})(),Uf.getDefaultProperty=function(y){return this.getDefaultProperties()[y]},Uf.getDefaultProperties=function(){var y=this._private;if(y.defaultProperties!=null)return y.defaultProperties;for(var g=Ke({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1,   1, -1,   1, 1,   -1, 1","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(z,S){for(var V=1;V<=Uf.pieBackgroundN;V++){var U=S.name.replace("{{i}}",V),tt=S.value;z[U]=tt}return z},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"taxi-turn":"50%","taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"}].reduce(function(z,S){return Uf.arrowPrefixes.forEach(function(V){var U=V+"-"+S.name,tt=S.value;z[U]=tt}),z},{})),x={},T=0;T<this.properties.length;T++){var A=this.properties[T];if(!A.pointsTo){var I=A.name,O=g[I],$=this.parse(I,O);x[I]=$}}return y.defaultProperties=x,y.defaultProperties},Uf.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var sT={};sT.parse=function(y,g,x,T){var A=this;if(kt(g))return A.parseImplWarn(y,g,x,T);var I=T==="mapping"||T===!0||T===!1||T==null?"dontcare":T,O=x?"t":"f",$=""+g,z=R5(y,$,O,I),S=A.propCache=A.propCache||[],V;return(V=S[z])||(V=S[z]=A.parseImplWarn(y,g,x,T)),(x||T==="mapping")&&(V=oh(V),V&&(V.value=oh(V.value))),V},sT.parseImplWarn=function(y,g,x,T){var A=this.parseImpl(y,g,x,T);return!A&&g!=null&&Wo("The style property `".concat(y,": ").concat(g,"` is invalid")),A&&(A.name==="width"||A.name==="height")&&g==="label"&&Wo("The style value of `label` is deprecated for `"+A.name+"`"),A},sT.parseImpl=function(y,g,x,T){var A=this;y=Ue(y);var I=A.properties[y],O=g,$=A.types;if(!I||g===void 0)return null;I.alias&&(I=I.pointsTo,y=I.name);var z=Tt(g);z&&(g=g.trim());var S=I.type;if(!S)return null;if(x&&(g===""||g===null))return{name:y,value:g,bypass:!0,deleteBypass:!0};if(kt(g))return{name:y,value:g,strValue:"fn",mapped:$.fn,bypass:x};var V,U;if(!(!z||T||g.length<7||g[1]!=="a")){if(g.length>=7&&g[0]==="d"&&(V=new RegExp($.data.regex).exec(g))){if(x)return!1;var tt=$.data;return{name:y,value:V,strValue:""+g,mapped:tt,field:V[1],bypass:x}}else if(g.length>=10&&g[0]==="m"&&(U=new RegExp($.mapData.regex).exec(g))){if(x||S.multiple)return!1;var at=$.mapData;if(!(S.color||S.number))return!1;var ut=this.parse(y,U[4]);if(!ut||ut.mapped)return!1;var dt=this.parse(y,U[5]);if(!dt||dt.mapped)return!1;if(ut.pfValue===dt.pfValue||ut.strValue===dt.strValue)return Wo("`"+y+": "+g+"` is not a valid mapper because the output range is zero; converting to `"+y+": "+ut.strValue+"`"),this.parse(y,ut.strValue);if(S.color){var At=ut.value,xt=dt.value,Mt=At[0]===xt[0]&&At[1]===xt[1]&&At[2]===xt[2]&&(At[3]===xt[3]||(At[3]==null||At[3]===1)&&(xt[3]==null||xt[3]===1));if(Mt)return!1}return{name:y,value:U,strValue:""+g,mapped:at,field:U[1],fieldMin:parseFloat(U[2]),fieldMax:parseFloat(U[3]),valueMin:ut.value,valueMax:dt.value,bypass:x}}}if(S.multiple&&T!=="multiple"){var Dt;if(z?Dt=g.split(/\s+/):yt(g)?Dt=g:Dt=[g],S.evenMultiple&&Dt.length%2!==0)return null;for(var Bt=[],Zt=[],Kt=[],$t="",ee=!1,Ht=0;Ht<Dt.length;Ht++){var ge=A.parse(y,Dt[Ht],x,"multiple");ee=ee||Tt(ge.value),Bt.push(ge.value),Kt.push(ge.pfValue!=null?ge.pfValue:ge.value),Zt.push(ge.units),$t+=(Ht>0?" ":"")+ge.strValue}return S.validate&&!S.validate(Bt,Zt)?null:S.singleEnum&&ee?Bt.length===1&&Tt(Bt[0])?{name:y,value:Bt[0],strValue:Bt[0],bypass:x}:null:{name:y,value:Bt,pfValue:Kt,strValue:$t,bypass:x,units:Zt}}var be=function(){for(var xr=0;xr<S.enums.length;xr++){var fi=S.enums[xr];if(fi===g)return{name:y,value:g,strValue:""+g,bypass:x}}return null};if(S.number){var re,Ne="px";if(S.units&&(re=S.units),S.implicitUnits&&(Ne=S.implicitUnits),!S.unitless)if(z){var ve="px|em"+(S.allowPercent?"|\\%":"");re&&(ve=re);var fn=g.match("^("+Te+")("+ve+")?$");fn&&(g=fn[1],re=fn[2]||Ne)}else(!re||S.implicitUnits)&&(re=Ne);if(g=parseFloat(g),isNaN(g)&&S.enums===void 0)return null;if(isNaN(g)&&S.enums!==void 0)return g=O,be();if(S.integer&&!wt(g)||S.min!==void 0&&(g<S.min||S.strictMin&&g===S.min)||S.max!==void 0&&(g>S.max||S.strictMax&&g===S.max))return null;var $e={name:y,value:g,strValue:""+g+(re||""),units:re,bypass:x};return S.unitless||re!=="px"&&re!=="em"?$e.pfValue=g:$e.pfValue=re==="px"||!re?g:this.getEmSizeInPixels()*g,(re==="ms"||re==="s")&&($e.pfValue=re==="ms"?g:1e3*g),(re==="deg"||re==="rad")&&($e.pfValue=re==="rad"?g:uY(g)),re==="%"&&($e.pfValue=g/100),$e}else if(S.propList){var qe=[],xn=""+g;if(xn!=="none"){for(var Pn=xn.split(/\s*,\s*|\s+/),er=0;er<Pn.length;er++){var Sn=Pn[er].trim();A.properties[Sn]?qe.push(Sn):Wo("`"+Sn+"` is not a valid property name")}if(qe.length===0)return null}return{name:y,value:qe,strValue:qe.length===0?"none":qe.join(" "),bypass:x}}else if(S.color){var Jn=de(g);return Jn?{name:y,value:Jn,pfValue:Jn,strValue:"rgb("+Jn[0]+","+Jn[1]+","+Jn[2]+")",bypass:x}:null}else if(S.regex||S.regexes){if(S.enums){var fr=be();if(fr)return fr}for(var Sr=S.regexes?S.regexes:[S.regex],wr=0;wr<Sr.length;wr++){var cr=new RegExp(Sr[wr]),bn=cr.exec(g);if(bn)return{name:y,value:S.singleRegexMatchValue?bn[1]:bn,strValue:""+g,bypass:x}}return null}else return S.string?{name:y,value:""+g,strValue:""+g,bypass:x}:S.enums?be():null};var x1=function y(g){if(!(this instanceof y))return new y(g);if(!Rt(g)){Ec("A style must have a core reference");return}this._private={cy:g,coreStyle:{}},this.length=0,this.resetToDefault()},k1=x1.prototype;k1.instanceString=function(){return"style"},k1.clear=function(){for(var y=this._private,g=y.cy,x=g.elements(),T=0;T<this.length;T++)this[T]=void 0;return this.length=0,y.contextStyles={},y.propDiffs={},this.cleanElements(x,!0),x.forEach(function(A){var I=A[0]._private;I.styleDirty=!0,I.appliedInitStyle=!1}),this},k1.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},k1.core=function(y){return this._private.coreStyle[y]||this.getDefaultProperty(y)},k1.selector=function(y){var g=y==="core"?null:new wm(y),x=this.length++;return this[x]={selector:g,properties:[],mappedProperties:[],index:x},this},k1.css=function(){var y=this,g=arguments;if(g.length===1)for(var x=g[0],T=0;T<y.properties.length;T++){var A=y.properties[T],I=x[A.name];I===void 0&&(I=x[_n(A.name)]),I!==void 0&&this.cssRule(A.name,I)}else g.length===2&&this.cssRule(g[0],g[1]);return this},k1.style=k1.css,k1.cssRule=function(y,g){var x=this.parse(y,g);if(x){var T=this.length-1;this[T].properties.push(x),this[T].properties[x.name]=x,x.name.match(/pie-(\d+)-background-size/)&&x.value&&(this._private.hasPie=!0),x.mapped&&this[T].mappedProperties.push(x);var A=!this[T].selector;A&&(this._private.coreStyle[x.name]=x)}return this},k1.append=function(y){return lt(y)?y.appendToStyle(this):yt(y)?this.appendFromJson(y):Tt(y)&&this.appendFromString(y),this},x1.fromJson=function(y,g){var x=new x1(y);return x.fromJson(g),x},x1.fromString=function(y,g){return new x1(y).fromString(g)},[y1,Pk,VL,z2,iT,GL,Uf,sT].forEach(function(y){Ke(k1,y)}),x1.types=k1.types,x1.properties=k1.properties,x1.propertyGroups=k1.propertyGroups,x1.propertyGroupNames=k1.propertyGroupNames,x1.propertyGroupKeys=k1.propertyGroupKeys;var pJ={style:function(g){if(g){var x=this.setStyle(g);x.update()}return this._private.style},setStyle:function(g){var x=this._private;return lt(g)?x.style=g.generateStyle(this):yt(g)?x.style=x1.fromJson(this,g):Tt(g)?x.style=x1.fromString(this,g):x.style=x1(this),x.style},updateStyle:function(){this.mutableElements().updateStyle()}},bJ="single",L3={autolock:function(g){if(g!==void 0)this._private.autolock=!!g;else return this._private.autolock;return this},autoungrabify:function(g){if(g!==void 0)this._private.autoungrabify=!!g;else return this._private.autoungrabify;return this},autounselectify:function(g){if(g!==void 0)this._private.autounselectify=!!g;else return this._private.autounselectify;return this},selectionType:function(g){var x=this._private;if(x.selectionType==null&&(x.selectionType=bJ),g!==void 0)(g==="additive"||g==="single")&&(x.selectionType=g);else return x.selectionType;return this},panningEnabled:function(g){if(g!==void 0)this._private.panningEnabled=!!g;else return this._private.panningEnabled;return this},userPanningEnabled:function(g){if(g!==void 0)this._private.userPanningEnabled=!!g;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(g){if(g!==void 0)this._private.zoomingEnabled=!!g;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(g){if(g!==void 0)this._private.userZoomingEnabled=!!g;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(g){if(g!==void 0)this._private.boxSelectionEnabled=!!g;else return this._private.boxSelectionEnabled;return this},pan:function(){var g=arguments,x=this._private.pan,T,A,I,O,$;switch(g.length){case 0:return x;case 1:if(Tt(g[0]))return T=g[0],x[T];if(ft(g[0])){if(!this._private.panningEnabled)return this;I=g[0],O=I.x,$=I.y,rt(O)&&(x.x=O),rt($)&&(x.y=$),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;T=g[0],A=g[1],(T==="x"||T==="y")&&rt(A)&&(x[T]=A),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(g,x){var T=arguments,A=this._private.pan,I,O,$,z,S;if(!this._private.panningEnabled)return this;switch(T.length){case 1:ft(g)&&($=T[0],z=$.x,S=$.y,rt(z)&&(A.x+=z),rt(S)&&(A.y+=S),this.emit("pan viewport"));break;case 2:I=g,O=x,(I==="x"||I==="y")&&rt(O)&&(A[I]+=O),this.emit("pan viewport");break}return this.notify("viewport"),this},fit:function(g,x){var T=this.getFitViewport(g,x);if(T){var A=this._private;A.zoom=T.zoom,A.pan=T.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(g,x){if(rt(g)&&x===void 0&&(x=g,g=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var T;if(Tt(g)){var A=g;g=this.$(A)}else if(Wt(g)){var I=g;T={x1:I.x1,y1:I.y1,x2:I.x2,y2:I.y2},T.w=T.x2-T.x1,T.h=T.y2-T.y1}else ht(g)||(g=this.mutableElements());if(!(ht(g)&&g.empty())){T=T||g.boundingBox();var O=this.width(),$=this.height(),z;if(x=rt(x)?x:0,!isNaN(O)&&!isNaN($)&&O>0&&$>0&&!isNaN(T.w)&&!isNaN(T.h)&&T.w>0&&T.h>0){z=Math.min((O-2*x)/T.w,($-2*x)/T.h),z=z>this._private.maxZoom?this._private.maxZoom:z,z=z<this._private.minZoom?this._private.minZoom:z;var S={x:(O-z*(T.x1+T.x2))/2,y:($-z*(T.y1+T.y2))/2};return{zoom:z,pan:S}}}}},zoomRange:function(g,x){var T=this._private;if(x==null){var A=g;g=A.min,x=A.max}return rt(g)&&rt(x)&&g<=x?(T.minZoom=g,T.maxZoom=x):rt(g)&&x===void 0&&g<=T.maxZoom?T.minZoom=g:rt(x)&&g===void 0&&x>=T.minZoom&&(T.maxZoom=x),this},minZoom:function(g){return g===void 0?this._private.minZoom:this.zoomRange({min:g})},maxZoom:function(g){return g===void 0?this._private.maxZoom:this.zoomRange({max:g})},getZoomedViewport:function(g){var x=this._private,T=x.pan,A=x.zoom,I,O,$=!1;if(x.zoomingEnabled||($=!0),rt(g)?O=g:ft(g)&&(O=g.level,g.position!=null?I=AE(g.position,A,T):g.renderedPosition!=null&&(I=g.renderedPosition),I!=null&&!x.panningEnabled&&($=!0)),O=O>x.maxZoom?x.maxZoom:O,O=O<x.minZoom?x.minZoom:O,$||!rt(O)||O===A||I!=null&&(!rt(I.x)||!rt(I.y)))return null;if(I!=null){var z=T,S=A,V=O,U={x:-V/S*(I.x-z.x)+I.x,y:-V/S*(I.y-z.y)+I.y};return{zoomed:!0,panned:!0,zoom:V,pan:U}}else return{zoomed:!0,panned:!1,zoom:O,pan:T}},zoom:function(g){if(g===void 0)return this._private.zoom;var x=this.getZoomedViewport(g),T=this._private;return x==null||!x.zoomed?this:(T.zoom=x.zoom,x.panned&&(T.pan.x=x.pan.x,T.pan.y=x.pan.y),this.emit("zoom"+(x.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(g){var x=this._private,T=!0,A=!0,I=[],O=!1,$=!1;if(!g)return this;if(rt(g.zoom)||(T=!1),ft(g.pan)||(A=!1),!T&&!A)return this;if(T){var z=g.zoom;z<x.minZoom||z>x.maxZoom||!x.zoomingEnabled?O=!0:(x.zoom=z,I.push("zoom"))}if(A&&(!O||!g.cancelOnFailedZoom)&&x.panningEnabled){var S=g.pan;rt(S.x)&&(x.pan.x=S.x,$=!1),rt(S.y)&&(x.pan.y=S.y,$=!1),$||I.push("pan")}return I.length>0&&(I.push("viewport"),this.emit(I.join(" ")),this.notify("viewport")),this},center:function(g){var x=this.getCenterPan(g);return x&&(this._private.pan=x,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(g,x){if(this._private.panningEnabled){if(Tt(g)){var T=g;g=this.mutableElements().filter(T)}else ht(g)||(g=this.mutableElements());if(g.length!==0){var A=g.boundingBox(),I=this.width(),O=this.height();x=x===void 0?this._private.zoom:x;var $={x:(I-x*(A.x1+A.x2))/2,y:(O-x*(A.y1+A.y2))/2};return $}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var g=this._private,x=g.container;return g.sizeCache=g.sizeCache||(x?function(){var T=R.getComputedStyle(x),A=function(O){return parseFloat(T.getPropertyValue(O))};return{width:x.clientWidth-A("padding-left")-A("padding-right"),height:x.clientHeight-A("padding-top")-A("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var g=this._private.pan,x=this._private.zoom,T=this.renderedExtent(),A={x1:(T.x1-g.x)/x,x2:(T.x2-g.x)/x,y1:(T.y1-g.y)/x,y2:(T.y2-g.y)/x};return A.w=A.x2-A.x1,A.h=A.y2-A.y1,A},renderedExtent:function(){var g=this.width(),x=this.height();return{x1:0,y1:0,x2:g,y2:x,w:g,h:x}},multiClickDebounceTime:function(g){if(g)this._private.multiClickDebounceTime=g;else return this._private.multiClickDebounceTime;return this}};L3.centre=L3.center,L3.autolockNodes=L3.autolock,L3.autoungrabifyNodes=L3.autoungrabify;var Nk={data:jc.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:jc.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:jc.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:jc.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Nk.attr=Nk.data,Nk.removeAttr=Nk.removeData;var Fk=function(g){var x=this;g=Ke({},g);var T=g.container;T&&!gt(T)&&gt(T[0])&&(T=T[0]);var A=T?T._cyreg:null;A=A||{},A&&A.cy&&(A.cy.destroy(),A={});var I=A.readies=A.readies||[];T&&(T._cyreg=A),A.cy=x;var O=R!==void 0&&T!==void 0&&!g.headless,$=g;$.layout=Ke({name:O?"grid":"null"},$.layout),$.renderer=Ke({name:O?"canvas":"null"},$.renderer);var z=function(ut,dt,At){return dt!==void 0?dt:At!==void 0?At:ut},S=this._private={container:T,ready:!1,options:$,elements:new Gf(this),listeners:[],aniEles:new Gf(this),data:$.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:z(!0,$.zoomingEnabled),userZoomingEnabled:z(!0,$.userZoomingEnabled),panningEnabled:z(!0,$.panningEnabled),userPanningEnabled:z(!0,$.userPanningEnabled),boxSelectionEnabled:z(!0,$.boxSelectionEnabled),autolock:z(!1,$.autolock,$.autolockNodes),autoungrabify:z(!1,$.autoungrabify,$.autoungrabifyNodes),autounselectify:z(!1,$.autounselectify),styleEnabled:$.styleEnabled===void 0?O:$.styleEnabled,zoom:rt($.zoom)?$.zoom:1,pan:{x:ft($.pan)&&rt($.pan.x)?$.pan.x:0,y:ft($.pan)&&rt($.pan.y)?$.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:z(250,$.multiClickDebounceTime)};this.createEmitter(),this.selectionType($.selectionType),this.zoomRange({min:$.minZoom,max:$.maxZoom});var V=function(ut,dt){var At=ut.some(It);if(At)return W5.all(ut).then(dt);dt(ut)};S.styleEnabled&&x.setStyle([]);var U=Ke({},$,$.renderer);x.initRenderer(U);var tt=function(ut,dt,At){x.notifications(!1);var xt=x.mutableElements();xt.length>0&&xt.remove(),ut!=null&&(ft(ut)||yt(ut))&&x.add(ut),x.one("layoutready",function(Dt){x.notifications(!0),x.emit(Dt),x.one("load",dt),x.emitAndNotify("load")}).one("layoutstop",function(){x.one("done",At),x.emit("done")});var Mt=Ke({},x._private.options.layout);Mt.eles=x.elements(),x.layout(Mt).run()};V([$.style,$.elements],function(at){var ut=at[0],dt=at[1];S.styleEnabled&&x.style().append(ut),tt(dt,function(){x.startAnimationLoop(),S.ready=!0,kt($.ready)&&x.on("ready",$.ready);for(var At=0;At<I.length;At++){var xt=I[At];x.on("ready",xt)}A&&(A.readies=[]),x.emit("ready")},$.done)})},aT=Fk.prototype;Ke(aT,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(g){return this.isReady()?this.emitter().emit("ready",[],g):this.on("ready",g),this},destroy:function(){var g=this;if(!g.destroyed())return g.stopAnimationLoop(),g.destroyRenderer(),this.emit("destroy"),g._private.destroyed=!0,g},hasElementWithId:function(g){return this._private.elements.hasElementWithId(g)},getElementById:function(g){return this._private.elements.getElementById(g)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(g){return this._private.elements.merge(g),this},removeFromPool:function(g){return this._private.elements.unmerge(g),this},container:function(){return this._private.container||null},mount:function(g){if(g!=null){var x=this,T=x._private,A=T.options;return!gt(g)&&gt(g[0])&&(g=g[0]),x.stopAnimationLoop(),x.destroyRenderer(),T.container=g,T.styleEnabled=!0,x.invalidateSize(),x.initRenderer(Ke({},A,A.renderer,{name:A.renderer.name==="null"?"canvas":A.renderer.name})),x.startAnimationLoop(),x.style(A.style),x.emit("mount"),x}},unmount:function(){var g=this;return g.stopAnimationLoop(),g.destroyRenderer(),g.initRenderer({name:"null"}),g.emit("unmount"),g},options:function(){return oh(this._private.options)},json:function(g){var x=this,T=x._private,A=x.mutableElements(),I=function(Bt){return x.getElementById(Bt.id())};if(ft(g)){if(x.startBatch(),g.elements){var O={},$=function(Bt,Zt){for(var Kt=[],$t=[],ee=0;ee<Bt.length;ee++){var Ht=Bt[ee];if(!Ht.data.id){Wo("cy.json() cannot handle elements without an ID attribute");continue}var ge=""+Ht.data.id,be=x.getElementById(ge);O[ge]=!0,be.length!==0?$t.push({ele:be,json:Ht}):(Zt&&(Ht.group=Zt),Kt.push(Ht))}x.add(Kt);for(var re=0;re<$t.length;re++){var Ne=$t[re],ve=Ne.ele,fn=Ne.json;ve.json(fn)}};if(yt(g.elements))$(g.elements);else for(var z=["nodes","edges"],S=0;S<z.length;S++){var V=z[S],U=g.elements[V];yt(U)&&$(U,V)}var tt=x.collection();A.filter(function(Dt){return!O[Dt.id()]}).forEach(function(Dt){Dt.isParent()?tt.merge(Dt):Dt.remove()}),tt.forEach(function(Dt){return Dt.children().move({parent:null})}),tt.forEach(function(Dt){return I(Dt).remove()})}g.style&&x.style(g.style),g.zoom!=null&&g.zoom!==T.zoom&&x.zoom(g.zoom),g.pan&&(g.pan.x!==T.pan.x||g.pan.y!==T.pan.y)&&x.pan(g.pan),g.data&&x.data(g.data);for(var at=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],ut=0;ut<at.length;ut++){var dt=at[ut];g[dt]!=null&&x[dt](g[dt])}return x.endBatch(),this}else{var At=!!g,xt={};At?xt.elements=this.elements().map(function(Dt){return Dt.json()}):(xt.elements={},A.forEach(function(Dt){var Bt=Dt.group();xt.elements[Bt]||(xt.elements[Bt]=[]),xt.elements[Bt].push(Dt.json())})),this._private.styleEnabled&&(xt.style=x.style().json()),xt.data=oh(x.data());var Mt=T.options;return xt.zoomingEnabled=T.zoomingEnabled,xt.userZoomingEnabled=T.userZoomingEnabled,xt.zoom=T.zoom,xt.minZoom=T.minZoom,xt.maxZoom=T.maxZoom,xt.panningEnabled=T.panningEnabled,xt.userPanningEnabled=T.userPanningEnabled,xt.pan=oh(T.pan),xt.boxSelectionEnabled=T.boxSelectionEnabled,xt.renderer=oh(Mt.renderer),xt.hideEdgesOnViewport=Mt.hideEdgesOnViewport,xt.textureOnViewport=Mt.textureOnViewport,xt.wheelSensitivity=Mt.wheelSensitivity,xt.motionBlur=Mt.motionBlur,xt.multiClickDebounceTime=Mt.multiClickDebounceTime,xt}}}),aT.$id=aT.getElementById,[sJ,lJ,yB,qL,nT,fJ,HL,rT,pJ,L3,Nk].forEach(function(y){Ke(aT,y)});var vJ={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,maximal:!1,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(g,x){return!0},ready:void 0,stop:void 0,transform:function(g,x){return x}},s6=function(g){return g.scratch("breadthfirst")},UL=function(g,x){return g.scratch("breadthfirst",x)};function xB(y){this.options=Ke({},vJ,y)}xB.prototype.run=function(){var y=this.options,g=y,x=y.cy,T=g.eles,A=T.nodes().filter(function(Fi){return!Fi.isParent()}),I=T,O=g.directed,$=g.maximal||g.maximalAdjustments>0,z=zd(g.boundingBox?g.boundingBox:{x1:0,y1:0,w:x.width(),h:x.height()}),S;if(ht(g.roots))S=g.roots;else if(yt(g.roots)){for(var V=[],U=0;U<g.roots.length;U++){var tt=g.roots[U],at=x.getElementById(tt);V.push(at)}S=x.collection(V)}else if(Tt(g.roots))S=x.$(g.roots);else if(O)S=A.roots();else{var ut=T.components();S=x.collection();for(var dt=function(Ci){var Ls=ut[Ci],es=Ls.maxDegree(!1),Ri=Ls.filter(function(as){return as.degree(!1)===es});S=S.add(Ri)},At=0;At<ut.length;At++)dt(At)}var xt=[],Mt={},Dt=function(Ci,Ls){xt[Ls]==null&&(xt[Ls]=[]);var es=xt[Ls].length;xt[Ls].push(Ci),UL(Ci,{index:es,depth:Ls})},Bt=function(Ci,Ls){var es=s6(Ci),Ri=es.depth,as=es.index;xt[Ri][as]=null,Dt(Ci,Ls)};I.bfs({roots:S,directed:g.directed,visit:function(Ci,Ls,es,Ri,as){var no=Ci[0],ca=no.id();Dt(no,as),Mt[ca]=!0}});for(var Zt=[],Kt=0;Kt<A.length;Kt++){var $t=A[Kt];Mt[$t.id()]||Zt.push($t)}var ee=function(Ci){for(var Ls=xt[Ci],es=0;es<Ls.length;es++){var Ri=Ls[es];if(Ri==null){Ls.splice(es,1),es--;continue}UL(Ri,{depth:Ci,index:es})}},Ht=function(){for(var Ci=0;Ci<xt.length;Ci++)ee(Ci)},ge=function(Ci,Ls){for(var es=s6(Ci),Ri=Ci.incomers().filter(function(Qt){return Qt.isNode()&&T.has(Qt)}),as=-1,no=Ci.id(),ca=0;ca<Ri.length;ca++){var ea=Ri[ca],Fr=s6(ea);as=Math.max(as,Fr.depth)}return es.depth<=as?Ls[no]?null:(Bt(Ci,as+1),Ls[no]=!0,!0):!1};if(O&&$){var be=[],re={},Ne=function(Ci){return be.push(Ci)},ve=function(){return be.shift()};for(A.forEach(function(Fi){return be.push(Fi)});be.length>0;){var fn=ve(),$e=ge(fn,re);if($e)fn.outgoers().filter(function(Fi){return Fi.isNode()&&T.has(Fi)}).forEach(Ne);else if($e===null){Wo("Detected double maximal shift for node `"+fn.id()+"`.  Bailing maximal adjustment due to cycle.  Use `options.maximal: true` only on DAGs.");break}}}Ht();var qe=0;if(g.avoidOverlap)for(var xn=0;xn<A.length;xn++){var Pn=A[xn],er=Pn.layoutDimensions(g),Sn=er.w,Jn=er.h;qe=Math.max(qe,Sn,Jn)}var fr={},Sr=function(Ci){if(fr[Ci.id()])return fr[Ci.id()];for(var Ls=s6(Ci).depth,es=Ci.neighborhood(),Ri=0,as=0,no=0;no<es.length;no++){var ca=es[no];if(!(ca.isEdge()||ca.isParent()||!A.has(ca))){var ea=s6(ca);if(ea!=null){var Fr=ea.index,Qt=ea.depth;if(!(Fr==null||Qt==null)){var Hn=xt[Qt].length;Qt<Ls&&(Ri+=Fr/Hn,as++)}}}}return as=Math.max(1,as),Ri=Ri/as,as===0&&(Ri=0),fr[Ci.id()]=Ri,Ri},wr=function(Ci,Ls){var es=Sr(Ci),Ri=Sr(Ls),as=es-Ri;return as===0?un(Ci.id(),Ls.id()):as};g.depthSort!==void 0&&(wr=g.depthSort);for(var cr=0;cr<xt.length;cr++)xt[cr].sort(wr),ee(cr);for(var bn=[],Tr=0;Tr<Zt.length;Tr++)bn.push(Zt[Tr]);xt.unshift(bn),Ht();for(var xr=0,fi=0;fi<xt.length;fi++)xr=Math.max(xt[fi].length,xr);var Ii={x:z.x1+z.w/2,y:z.x1+z.h/2},oa=xt.reduce(function(Fi,Ci){return Math.max(Fi,Ci.length)},0),Fa=function(Ci){var Ls=s6(Ci),es=Ls.depth,Ri=Ls.index,as=xt[es].length,no=Math.max(z.w/((g.grid?oa:as)+1),qe),ca=Math.max(z.h/(xt.length+1),qe),ea=Math.min(z.w/2/xt.length,z.h/2/xt.length);if(ea=Math.max(ea,qe),g.circle){var Qt=ea*es+ea-(xt.length>0&&xt[0].length<=3?ea/2:0),Hn=2*Math.PI/xt[es].length*Ri;return es===0&&xt[0].length===1&&(Qt=1),{x:Ii.x+Qt*Math.cos(Hn),y:Ii.y+Qt*Math.sin(Hn)}}else{var Fr={x:Ii.x+(Ri+1-(as+1)/2)*no,y:(es+1)*ca};return Fr}};return T.nodes().layoutPositions(this,g,Fa),this};var wJ={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(g,x){return!0},ready:void 0,stop:void 0,transform:function(g,x){return x}};function oT(y){this.options=Ke({},wJ,y)}oT.prototype.run=function(){var y=this.options,g=y,x=y.cy,T=g.eles,A=g.counterclockwise!==void 0?!g.counterclockwise:g.clockwise,I=T.nodes().not(":parent");g.sort&&(I=I.sort(g.sort));for(var O=zd(g.boundingBox?g.boundingBox:{x1:0,y1:0,w:x.width(),h:x.height()}),$={x:O.x1+O.w/2,y:O.y1+O.h/2},z=g.sweep===void 0?2*Math.PI-2*Math.PI/I.length:g.sweep,S=z/Math.max(1,I.length-1),V,U=0,tt=0;tt<I.length;tt++){var at=I[tt],ut=at.layoutDimensions(g),dt=ut.w,At=ut.h;U=Math.max(U,dt,At)}if(rt(g.radius)?V=g.radius:I.length<=1?V=0:V=Math.min(O.h,O.w)/2-U,I.length>1&&g.avoidOverlap){U*=1.75;var xt=Math.cos(S)-Math.cos(0),Mt=Math.sin(S)-Math.sin(0),Dt=Math.sqrt(U*U/(xt*xt+Mt*Mt));V=Math.max(Dt,V)}var Bt=function(Kt,$t){var ee=g.startAngle+$t*S*(A?1:-1),Ht=V*Math.cos(ee),ge=V*Math.sin(ee),be={x:$.x+Ht,y:$.y+ge};return be};return T.nodes().layoutPositions(this,g,Bt),this};var mJ={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(g){return g.degree()},levelWidth:function(g){return g.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(g,x){return!0},ready:void 0,stop:void 0,transform:function(g,x){return x}};function kB(y){this.options=Ke({},mJ,y)}kB.prototype.run=function(){for(var y=this.options,g=y,x=g.counterclockwise!==void 0?!g.counterclockwise:g.clockwise,T=y.cy,A=g.eles,I=A.nodes().not(":parent"),O=zd(g.boundingBox?g.boundingBox:{x1:0,y1:0,w:T.width(),h:T.height()}),$={x:O.x1+O.w/2,y:O.y1+O.h/2},z=[],S=0,V=0;V<I.length;V++){var U=I[V],tt=void 0;tt=g.concentric(U),z.push({value:tt,node:U}),U._private.scratch.concentric=tt}I.updateStyle();for(var at=0;at<I.length;at++){var ut=I[at],dt=ut.layoutDimensions(g);S=Math.max(S,dt.w,dt.h)}z.sort(function(Fi,Ci){return Ci.value-Fi.value});for(var At=g.levelWidth(I),xt=[[]],Mt=xt[0],Dt=0;Dt<z.length;Dt++){var Bt=z[Dt];if(Mt.length>0){var Zt=Math.abs(Mt[0].value-Bt.value);Zt>=At&&(Mt=[],xt.push(Mt))}Mt.push(Bt)}var Kt=S+g.minNodeSpacing;if(!g.avoidOverlap){var $t=xt.length>0&&xt[0].length>1,ee=Math.min(O.w,O.h)/2-Kt,Ht=ee/(xt.length+$t?1:0);Kt=Math.min(Kt,Ht)}for(var ge=0,be=0;be<xt.length;be++){var re=xt[be],Ne=g.sweep===void 0?2*Math.PI-2*Math.PI/re.length:g.sweep,ve=re.dTheta=Ne/Math.max(1,re.length-1);if(re.length>1&&g.avoidOverlap){var fn=Math.cos(ve)-Math.cos(0),$e=Math.sin(ve)-Math.sin(0),qe=Math.sqrt(Kt*Kt/(fn*fn+$e*$e));ge=Math.max(qe,ge)}re.r=ge,ge+=Kt}if(g.equidistant){for(var xn=0,Pn=0,er=0;er<xt.length;er++){var Sn=xt[er],Jn=Sn.r-Pn;xn=Math.max(xn,Jn)}Pn=0;for(var fr=0;fr<xt.length;fr++){var Sr=xt[fr];fr===0&&(Pn=Sr.r),Sr.r=Pn,Pn+=xn}}for(var wr={},cr=0;cr<xt.length;cr++)for(var bn=xt[cr],Tr=bn.dTheta,xr=bn.r,fi=0;fi<bn.length;fi++){var Ii=bn[fi],oa=g.startAngle+(x?1:-1)*Tr*fi,Fa={x:$.x+xr*Math.cos(oa),y:$.y+xr*Math.sin(oa)};wr[Ii.node.id()]=Fa}return A.nodes().layoutPositions(this,g,function(Fi){var Ci=Fi.id();return wr[Ci]}),this};var WL,yJ={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(g,x){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(g){return 2048},nodeOverlap:4,idealEdgeLength:function(g){return 32},edgeElasticity:function(g){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function cT(y){this.options=Ke({},yJ,y),this.options.layout=this}cT.prototype.run=function(){var y=this.options,g=y.cy,x=this;x.stopped=!1,(y.animate===!0||y.animate===!1)&&x.emit({type:"layoutstart",layout:x}),y.debug===!0?WL=!0:WL=!1;var T=xJ(g,x,y);WL&&TJ(T),y.randomize&&_J(T);var A=Ei(),I=function(){CJ(T,g,y),y.fit===!0&&g.fit(y.padding)},O=function(tt){return!(x.stopped||tt>=y.numIter||(SJ(T,y),T.temperature=T.temperature*y.coolingFactor,T.temperature<y.minTemp))},$=function(){if(y.animate===!0||y.animate===!1)I(),x.one("layoutstop",y.stop),x.emit({type:"layoutstop",layout:x});else{var tt=y.eles.nodes(),at=EB(T,y,tt);tt.layoutPositions(x,y,at)}},z=0,S=!0;if(y.animate===!0){var V=function U(){for(var tt=0;S&&tt<y.refresh;)S=O(z),z++,tt++;if(!S)_B(T,y),$();else{var at=Ei();at-A>=y.animationThreshold&&I(),Ma(U)}};V()}else{for(;S;)S=O(z),z++;_B(T,y),$()}return this},cT.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},cT.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var xJ=function(g,x,T){for(var A=T.eles.edges(),I=T.eles.nodes(),O={isCompound:g.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:I.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:A.size(),temperature:T.initialTemp,clientWidth:g.width(),clientHeight:g.width(),boundingBox:zd(T.boundingBox?T.boundingBox:{x1:0,y1:0,w:g.width(),h:g.height()})},$=T.eles.components(),z={},S=0;S<$.length;S++)for(var V=$[S],U=0;U<V.length;U++){var tt=V[U];z[tt.id()]=S}for(var S=0;S<O.nodeSize;S++){var at=I[S],ut=at.layoutDimensions(T),dt={};dt.isLocked=at.locked(),dt.id=at.data("id"),dt.parentId=at.data("parent"),dt.cmptId=z[at.id()],dt.children=[],dt.positionX=at.position("x"),dt.positionY=at.position("y"),dt.offsetX=0,dt.offsetY=0,dt.height=ut.w,dt.width=ut.h,dt.maxX=dt.positionX+dt.width/2,dt.minX=dt.positionX-dt.width/2,dt.maxY=dt.positionY+dt.height/2,dt.minY=dt.positionY-dt.height/2,dt.padLeft=parseFloat(at.style("padding")),dt.padRight=parseFloat(at.style("padding")),dt.padTop=parseFloat(at.style("padding")),dt.padBottom=parseFloat(at.style("padding")),dt.nodeRepulsion=kt(T.nodeRepulsion)?T.nodeRepulsion(at):T.nodeRepulsion,O.layoutNodes.push(dt),O.idToIndex[dt.id]=S}for(var At=[],xt=0,Mt=-1,Dt=[],S=0;S<O.nodeSize;S++){var at=O.layoutNodes[S],Bt=at.parentId;Bt!=null?O.layoutNodes[O.idToIndex[Bt]].children.push(at.id):(At[++Mt]=at.id,Dt.push(at.id))}for(O.graphSet.push(Dt);xt<=Mt;){var Zt=At[xt++],Kt=O.idToIndex[Zt],tt=O.layoutNodes[Kt],$t=tt.children;if($t.length>0){O.graphSet.push($t);for(var S=0;S<$t.length;S++)At[++Mt]=$t[S]}}for(var S=0;S<O.graphSet.length;S++)for(var ee=O.graphSet[S],U=0;U<ee.length;U++){var Ht=O.idToIndex[ee[U]];O.indexToGraph[Ht]=S}for(var S=0;S<O.edgeSize;S++){var ge=A[S],be={};be.id=ge.data("id"),be.sourceId=ge.data("source"),be.targetId=ge.data("target");var re=kt(T.idealEdgeLength)?T.idealEdgeLength(ge):T.idealEdgeLength,Ne=kt(T.edgeElasticity)?T.edgeElasticity(ge):T.edgeElasticity,ve=O.idToIndex[be.sourceId],fn=O.idToIndex[be.targetId],$e=O.indexToGraph[ve],qe=O.indexToGraph[fn];if($e!=qe){for(var xn=kJ(be.sourceId,be.targetId,O),Pn=O.graphSet[xn],er=0,dt=O.layoutNodes[ve];Pn.indexOf(dt.id)===-1;)dt=O.layoutNodes[O.idToIndex[dt.parentId]],er++;for(dt=O.layoutNodes[fn];Pn.indexOf(dt.id)===-1;)dt=O.layoutNodes[O.idToIndex[dt.parentId]],er++;re*=er*T.nestingFactor}be.idealLength=re,be.elasticity=Ne,O.layoutEdges.push(be)}return O},kJ=function(g,x,T){var A=EJ(g,x,0,T);return 2>A.count?0:A.graph},EJ=function y(g,x,T,A){var I=A.graphSet[T];if(-1<I.indexOf(g)&&-1<I.indexOf(x))return{count:2,graph:T};for(var O=0,$=0;$<I.length;$++){var z=I[$],S=A.idToIndex[z],V=A.layoutNodes[S].children;if(V.length!==0){var U=A.indexToGraph[A.idToIndex[V[0]]],tt=y(g,x,U,A);if(tt.count!==0)if(tt.count===1){if(O++,O===2)break}else return tt}}return{count:O,graph:T}},TJ,_J=function(g,x){for(var T=g.clientWidth,A=g.clientHeight,I=0;I<g.nodeSize;I++){var O=g.layoutNodes[I];O.children.length===0&&!O.isLocked&&(O.positionX=Math.random()*T,O.positionY=Math.random()*A)}},EB=function(g,x,T){var A=g.boundingBox,I={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return x.boundingBox&&(T.forEach(function(O){var $=g.layoutNodes[g.idToIndex[O.data("id")]];I.x1=Math.min(I.x1,$.positionX),I.x2=Math.max(I.x2,$.positionX),I.y1=Math.min(I.y1,$.positionY),I.y2=Math.max(I.y2,$.positionY)}),I.w=I.x2-I.x1,I.h=I.y2-I.y1),function(O,$){var z=g.layoutNodes[g.idToIndex[O.data("id")]];if(x.boundingBox){var S=(z.positionX-I.x1)/I.w,V=(z.positionY-I.y1)/I.h;return{x:A.x1+S*A.w,y:A.y1+V*A.h}}else return{x:z.positionX,y:z.positionY}}},CJ=function(g,x,T){var A=T.layout,I=T.eles.nodes(),O=EB(g,T,I);I.positions(O),g.ready!==!0&&(g.ready=!0,A.one("layoutready",T.ready),A.emit({type:"layoutready",layout:this}))},SJ=function(g,x,T){AJ(g,x),DJ(g),IJ(g,x),OJ(g),PJ(g)},AJ=function(g,x){for(var T=0;T<g.graphSet.length;T++)for(var A=g.graphSet[T],I=A.length,O=0;O<I;O++)for(var $=g.layoutNodes[g.idToIndex[A[O]]],z=O+1;z<I;z++){var S=g.layoutNodes[g.idToIndex[A[z]]];LJ($,S,g,x)}},TB=function(g){return-g+2*g*Math.random()},LJ=function(g,x,T,A){var I=g.cmptId,O=x.cmptId;if(!(I!==O&&!T.isCompound)){var $=x.positionX-g.positionX,z=x.positionY-g.positionY,S=1;$===0&&z===0&&($=TB(S),z=TB(S));var V=MJ(g,x,$,z);if(V>0)var U=A.nodeOverlap*V,tt=Math.sqrt($*$+z*z),at=U*$/tt,ut=U*z/tt;else var dt=uT(g,$,z),At=uT(x,-1*$,-1*z),xt=At.x-dt.x,Mt=At.y-dt.y,Dt=xt*xt+Mt*Mt,tt=Math.sqrt(Dt),U=(g.nodeRepulsion+x.nodeRepulsion)/Dt,at=U*xt/tt,ut=U*Mt/tt;g.isLocked||(g.offsetX-=at,g.offsetY-=ut),x.isLocked||(x.offsetX+=at,x.offsetY+=ut)}},MJ=function(g,x,T,A){if(T>0)var I=g.maxX-x.minX;else var I=x.maxX-g.minX;if(A>0)var O=g.maxY-x.minY;else var O=x.maxY-g.minY;return I>=0&&O>=0?Math.sqrt(I*I+O*O):0},uT=function(g,x,T){var A=g.positionX,I=g.positionY,O=g.height||1,$=g.width||1,z=T/x,S=O/$,V={};return x===0&&0<T||x===0&&0>T?(V.x=A,V.y=I+O/2,V):0<x&&-1*S<=z&&z<=S?(V.x=A+$/2,V.y=I+$*T/2/x,V):0>x&&-1*S<=z&&z<=S?(V.x=A-$/2,V.y=I-$*T/2/x,V):0<T&&(z<=-1*S||z>=S)?(V.x=A+O*x/2/T,V.y=I+O/2,V):(0>T&&(z<=-1*S||z>=S)&&(V.x=A-O*x/2/T,V.y=I-O/2),V)},DJ=function(g,x){for(var T=0;T<g.edgeSize;T++){var A=g.layoutEdges[T],I=g.idToIndex[A.sourceId],O=g.layoutNodes[I],$=g.idToIndex[A.targetId],z=g.layoutNodes[$],S=z.positionX-O.positionX,V=z.positionY-O.positionY;if(!(S===0&&V===0)){var U=uT(O,S,V),tt=uT(z,-1*S,-1*V),at=tt.x-U.x,ut=tt.y-U.y,dt=Math.sqrt(at*at+ut*ut),At=Math.pow(A.idealLength-dt,2)/A.elasticity;if(dt!==0)var xt=At*at/dt,Mt=At*ut/dt;else var xt=0,Mt=0;O.isLocked||(O.offsetX+=xt,O.offsetY+=Mt),z.isLocked||(z.offsetX-=xt,z.offsetY-=Mt)}}},IJ=function(g,x){if(x.gravity!==0)for(var T=1,A=0;A<g.graphSet.length;A++){var I=g.graphSet[A],O=I.length;if(A===0)var $=g.clientHeight/2,z=g.clientWidth/2;else var S=g.layoutNodes[g.idToIndex[I[0]]],V=g.layoutNodes[g.idToIndex[S.parentId]],$=V.positionX,z=V.positionY;for(var U=0;U<O;U++){var tt=g.layoutNodes[g.idToIndex[I[U]]];if(!tt.isLocked){var at=$-tt.positionX,ut=z-tt.positionY,dt=Math.sqrt(at*at+ut*ut);if(dt>T){var At=x.gravity*at/dt,xt=x.gravity*ut/dt;tt.offsetX+=At,tt.offsetY+=xt}}}}},OJ=function(g,x){var T=[],A=0,I=-1;for(T.push.apply(T,g.graphSet[0]),I+=g.graphSet[0].length;A<=I;){var O=T[A++],$=g.idToIndex[O],z=g.layoutNodes[$],S=z.children;if(0<S.length&&!z.isLocked){for(var V=z.offsetX,U=z.offsetY,tt=0;tt<S.length;tt++){var at=g.layoutNodes[g.idToIndex[S[tt]]];at.offsetX+=V,at.offsetY+=U,T[++I]=S[tt]}z.offsetX=0,z.offsetY=0}}},PJ=function(g,x){for(var T=0;T<g.nodeSize;T++){var A=g.layoutNodes[T];0<A.children.length&&(A.maxX=void 0,A.minX=void 0,A.maxY=void 0,A.minY=void 0)}for(var T=0;T<g.nodeSize;T++){var A=g.layoutNodes[T];if(!(0<A.children.length||A.isLocked)){var I=NJ(A.offsetX,A.offsetY,g.temperature);A.positionX+=I.x,A.positionY+=I.y,A.offsetX=0,A.offsetY=0,A.minX=A.positionX-A.width,A.maxX=A.positionX+A.width,A.minY=A.positionY-A.height,A.maxY=A.positionY+A.height,FJ(A,g)}}for(var T=0;T<g.nodeSize;T++){var A=g.layoutNodes[T];0<A.children.length&&!A.isLocked&&(A.positionX=(A.maxX+A.minX)/2,A.positionY=(A.maxY+A.minY)/2,A.width=A.maxX-A.minX,A.height=A.maxY-A.minY)}},NJ=function(g,x,T){var A=Math.sqrt(g*g+x*x);if(A>T)var I={x:T*g/A,y:T*x/A};else var I={x:g,y:x};return I},FJ=function y(g,x){var T=g.parentId;if(T!=null){var A=x.layoutNodes[x.idToIndex[T]],I=!1;if((A.maxX==null||g.maxX+A.padRight>A.maxX)&&(A.maxX=g.maxX+A.padRight,I=!0),(A.minX==null||g.minX-A.padLeft<A.minX)&&(A.minX=g.minX-A.padLeft,I=!0),(A.maxY==null||g.maxY+A.padBottom>A.maxY)&&(A.maxY=g.maxY+A.padBottom,I=!0),(A.minY==null||g.minY-A.padTop<A.minY)&&(A.minY=g.minY-A.padTop,I=!0),I)return y(A,x)}},_B=function(g,x){for(var T=g.layoutNodes,A=[],I=0;I<T.length;I++){var O=T[I],$=O.cmptId,z=A[$]=A[$]||[];z.push(O)}for(var S=0,I=0;I<A.length;I++){var V=A[I];if(V){V.x1=1/0,V.x2=-1/0,V.y1=1/0,V.y2=-1/0;for(var U=0;U<V.length;U++){var tt=V[U];V.x1=Math.min(V.x1,tt.positionX-tt.width/2),V.x2=Math.max(V.x2,tt.positionX+tt.width/2),V.y1=Math.min(V.y1,tt.positionY-tt.height/2),V.y2=Math.max(V.y2,tt.positionY+tt.height/2)}V.w=V.x2-V.x1,V.h=V.y2-V.y1,S+=V.w*V.h}}A.sort(function(Mt,Dt){return Dt.w*Dt.h-Mt.w*Mt.h});for(var at=0,ut=0,dt=0,At=0,xt=Math.sqrt(S)*g.clientWidth/g.clientHeight,I=0;I<A.length;I++){var V=A[I];if(V){for(var U=0;U<V.length;U++){var tt=V[U];tt.isLocked||(tt.positionX+=at-V.x1,tt.positionY+=ut-V.y1)}at+=V.w+x.componentSpacing,dt+=V.w+x.componentSpacing,At=Math.max(At,V.h),dt>xt&&(ut+=At+x.componentSpacing,at=0,dt=0,At=0)}}},BJ={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(g){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(g,x){return!0},ready:void 0,stop:void 0,transform:function(g,x){return x}};function CB(y){this.options=Ke({},BJ,y)}CB.prototype.run=function(){var y=this.options,g=y,x=y.cy,T=g.eles,A=T.nodes().not(":parent");g.sort&&(A=A.sort(g.sort));var I=zd(g.boundingBox?g.boundingBox:{x1:0,y1:0,w:x.width(),h:x.height()});if(I.h===0||I.w===0)T.nodes().layoutPositions(this,g,function(fr){return{x:I.x1,y:I.y1}});else{var O=A.size(),$=Math.sqrt(O*I.h/I.w),z=Math.round($),S=Math.round(I.w/I.h*$),V=function(Sr){if(Sr==null)return Math.min(z,S);var wr=Math.min(z,S);wr==z?z=Sr:S=Sr},U=function(Sr){if(Sr==null)return Math.max(z,S);var wr=Math.max(z,S);wr==z?z=Sr:S=Sr},tt=g.rows,at=g.cols!=null?g.cols:g.columns;if(tt!=null&&at!=null)z=tt,S=at;else if(tt!=null&&at==null)z=tt,S=Math.ceil(O/z);else if(tt==null&&at!=null)S=at,z=Math.ceil(O/S);else if(S*z>O){var ut=V(),dt=U();(ut-1)*dt>=O?V(ut-1):(dt-1)*ut>=O&&U(dt-1)}else for(;S*z<O;){var At=V(),xt=U();(xt+1)*At>=O?U(xt+1):V(At+1)}var Mt=I.w/S,Dt=I.h/z;if(g.condense&&(Mt=0,Dt=0),g.avoidOverlap)for(var Bt=0;Bt<A.length;Bt++){var Zt=A[Bt],Kt=Zt._private.position;(Kt.x==null||Kt.y==null)&&(Kt.x=0,Kt.y=0);var $t=Zt.layoutDimensions(g),ee=g.avoidOverlapPadding,Ht=$t.w+ee,ge=$t.h+ee;Mt=Math.max(Mt,Ht),Dt=Math.max(Dt,ge)}for(var be={},re=function(Sr,wr){return!!be["c-"+Sr+"-"+wr]},Ne=function(Sr,wr){be["c-"+Sr+"-"+wr]=!0},ve=0,fn=0,$e=function(){fn++,fn>=S&&(fn=0,ve++)},qe={},xn=0;xn<A.length;xn++){var Pn=A[xn],er=g.position(Pn);if(er&&(er.row!==void 0||er.col!==void 0)){var Sn={row:er.row,col:er.col};if(Sn.col===void 0)for(Sn.col=0;re(Sn.row,Sn.col);)Sn.col++;else if(Sn.row===void 0)for(Sn.row=0;re(Sn.row,Sn.col);)Sn.row++;qe[Pn.id()]=Sn,Ne(Sn.row,Sn.col)}}var Jn=function(Sr,wr){var cr,bn;if(Sr.locked()||Sr.isParent())return!1;var Tr=qe[Sr.id()];if(Tr)cr=Tr.col*Mt+Mt/2+I.x1,bn=Tr.row*Dt+Dt/2+I.y1;else{for(;re(ve,fn);)$e();cr=fn*Mt+Mt/2+I.x1,bn=ve*Dt+Dt/2+I.y1,Ne(ve,fn),$e()}return{x:cr,y:bn}};A.layoutPositions(this,g,Jn)}return this};var RJ={ready:function(){},stop:function(){}};function KL(y){this.options=Ke({},RJ,y)}KL.prototype.run=function(){var y=this.options,g=y.eles,x=this;return y.cy,x.emit("layoutstart"),g.nodes().positions(function(){return{x:0,y:0}}),x.one("layoutready",y.ready),x.emit("layoutready"),x.one("layoutstop",y.stop),x.emit("layoutstop"),this},KL.prototype.stop=function(){return this};var jJ={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(g,x){return!0},ready:void 0,stop:void 0,transform:function(g,x){return x}};function SB(y){this.options=Ke({},jJ,y)}SB.prototype.run=function(){var y=this.options,g=y.eles,x=g.nodes(),T=kt(y.positions);function A(I){if(y.positions==null)return iY(I.position());if(T)return y.positions(I);var O=y.positions[I._private.data.id];return O??null}return x.layoutPositions(this,y,function(I,O){var $=A(I);return I.locked()||$==null?!1:$}),this};var $J={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(g,x){return!0},ready:void 0,stop:void 0,transform:function(g,x){return x}};function AB(y){this.options=Ke({},$J,y)}AB.prototype.run=function(){var y=this.options,g=y.cy,x=y.eles,T=zd(y.boundingBox?y.boundingBox:{x1:0,y1:0,w:g.width(),h:g.height()}),A=function(O,$){return{x:T.x1+Math.round(Math.random()*T.w),y:T.y1+Math.round(Math.random()*T.h)}};return x.nodes().layoutPositions(this,y,A),this};var zJ=[{name:"breadthfirst",impl:xB},{name:"circle",impl:oT},{name:"concentric",impl:kB},{name:"cose",impl:cT},{name:"grid",impl:CB},{name:"null",impl:KL},{name:"preset",impl:SB},{name:"random",impl:AB}];function LB(y){this.options=y,this.notifications=0}var MB=function(){},DB=function(){throw new Error("A headless instance can not render images")};LB.prototype={recalculateRenderedStyle:MB,notify:function(){this.notifications++},init:MB,isHeadless:function(){return!0},png:DB,jpg:DB};var YL={};YL.arrowShapeWidth=.3,YL.registerArrowShapes=function(){var y=this.arrowShapes={},g=this,x=function(S,V,U,tt,at,ut,dt){var At=at.x-U/2-dt,xt=at.x+U/2+dt,Mt=at.y-U/2-dt,Dt=at.y+U/2+dt,Bt=At<=S&&S<=xt&&Mt<=V&&V<=Dt;return Bt},T=function(S,V,U,tt,at){var ut=S*Math.cos(tt)-V*Math.sin(tt),dt=S*Math.sin(tt)+V*Math.cos(tt),At=ut*U,xt=dt*U,Mt=At+at.x,Dt=xt+at.y;return{x:Mt,y:Dt}},A=function(S,V,U,tt){for(var at=[],ut=0;ut<S.length;ut+=2){var dt=S[ut],At=S[ut+1];at.push(T(dt,At,V,U,tt))}return at},I=function(S){for(var V=[],U=0;U<S.length;U++){var tt=S[U];V.push(tt.x,tt.y)}return V},O=function(S){return S.pstyle("width").pfValue*S.pstyle("arrow-scale").pfValue*2},$=function(S,V){Tt(V)&&(V=y[V]),y[S]=Ke({name:S,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(tt,at,ut,dt,At,xt){var Mt=I(A(this.points,ut+2*xt,dt,At)),Dt=qd(tt,at,Mt);return Dt},roughCollide:x,draw:function(tt,at,ut,dt){var At=A(this.points,at,ut,dt);g.arrowShapeImpl("polygon")(tt,At)},spacing:function(tt){return 0},gap:O},V)};$("none",{collide:hm,roughCollide:hm,draw:fm,spacing:av,gap:av}),$("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),$("arrow","triangle"),$("triangle-backcurve",{points:y.triangle.points,controlPoint:[0,-.15],roughCollide:x,draw:function(S,V,U,tt,at){var ut=A(this.points,V,U,tt),dt=this.controlPoint,At=T(dt[0],dt[1],V,U,tt);g.arrowShapeImpl(this.name)(S,ut,At)},gap:function(S){return O(S)*.8}}),$("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(S,V,U,tt,at,ut,dt){var At=I(A(this.points,U+2*dt,tt,at)),xt=I(A(this.pointsTee,U+2*dt,tt,at)),Mt=qd(S,V,At)||qd(S,V,xt);return Mt},draw:function(S,V,U,tt,at){var ut=A(this.points,V,U,tt),dt=A(this.pointsTee,V,U,tt);g.arrowShapeImpl(this.name)(S,ut,dt)}}),$("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(S,V,U,tt,at,ut,dt){var At=at,xt=Math.pow(At.x-S,2)+Math.pow(At.y-V,2)<=Math.pow((U+2*dt)*this.radius,2),Mt=I(A(this.points,U+2*dt,tt,at));return qd(S,V,Mt)||xt},draw:function(S,V,U,tt,at){var ut=A(this.pointsTr,V,U,tt);g.arrowShapeImpl(this.name)(S,ut,tt.x,tt.y,this.radius*V)},spacing:function(S){return g.getArrowWidth(S.pstyle("width").pfValue,S.pstyle("arrow-scale").value)*this.radius}}),$("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(S,V){var U=this.baseCrossLinePts.slice(),tt=V/S,at=3,ut=5;return U[at]=U[at]-tt,U[ut]=U[ut]-tt,U},collide:function(S,V,U,tt,at,ut,dt){var At=I(A(this.points,U+2*dt,tt,at)),xt=I(A(this.crossLinePts(U,ut),U+2*dt,tt,at)),Mt=qd(S,V,At)||qd(S,V,xt);return Mt},draw:function(S,V,U,tt,at){var ut=A(this.points,V,U,tt),dt=A(this.crossLinePts(V,at),V,U,tt);g.arrowShapeImpl(this.name)(S,ut,dt)}}),$("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(S){return O(S)*.525}}),$("circle",{radius:.15,collide:function(S,V,U,tt,at,ut,dt){var At=at,xt=Math.pow(At.x-S,2)+Math.pow(At.y-V,2)<=Math.pow((U+2*dt)*this.radius,2);return xt},draw:function(S,V,U,tt,at){g.arrowShapeImpl(this.name)(S,tt.x,tt.y,this.radius*V)},spacing:function(S){return g.getArrowWidth(S.pstyle("width").pfValue,S.pstyle("arrow-scale").value)*this.radius}}),$("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(S){return 1},gap:function(S){return 1}}),$("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),$("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(S){return S.pstyle("width").pfValue*S.pstyle("arrow-scale").value}}),$("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(S){return .95*S.pstyle("width").pfValue*S.pstyle("arrow-scale").value}})};var M3={};M3.projectIntoViewport=function(y,g){var x=this.cy,T=this.findContainerClientCoords(),A=T[0],I=T[1],O=T[4],$=x.pan(),z=x.zoom(),S=((y-A)/O-$.x)/z,V=((g-I)/O-$.y)/z;return[S,V]},M3.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var y=this.container,g=y.getBoundingClientRect(),x=R.getComputedStyle(y),T=function(xt){return parseFloat(x.getPropertyValue(xt))},A={left:T("padding-left"),right:T("padding-right"),top:T("padding-top"),bottom:T("padding-bottom")},I={left:T("border-left-width"),right:T("border-right-width"),top:T("border-top-width"),bottom:T("border-bottom-width")},O=y.clientWidth,$=y.clientHeight,z=A.left+A.right,S=A.top+A.bottom,V=I.left+I.right,U=g.width/(O+V),tt=O-z,at=$-S,ut=g.left+A.left+I.left,dt=g.top+A.top+I.top;return this.containerBB=[ut,dt,tt,at,U]},M3.invalidateContainerClientCoordsCache=function(){this.containerBB=null},M3.findNearestElement=function(y,g,x,T){return this.findNearestElements(y,g,x,T)[0]},M3.findNearestElements=function(y,g,x,T){var A=this,I=this,O=I.getCachedZSortedEles(),$=[],z=I.cy.zoom(),S=I.cy.hasCompoundNodes(),V=(T?24:8)/z,U=(T?8:2)/z,tt=(T?8:2)/z,at=1/0,ut,dt;x&&(O=O.interactive);function At($t,ee){if($t.isNode()){if(dt)return;dt=$t,$.push($t)}if($t.isEdge()&&(ee==null||ee<at))if(ut){if(ut.pstyle("z-compound-depth").value===$t.pstyle("z-compound-depth").value&&ut.pstyle("z-compound-depth").value===$t.pstyle("z-compound-depth").value){for(var Ht=0;Ht<$.length;Ht++)if($[Ht].isEdge()){$[Ht]=$t,ut=$t,at=ee??at;break}}}else $.push($t),ut=$t,at=ee??at}function xt($t){var ee=$t.outerWidth()+2*U,Ht=$t.outerHeight()+2*U,ge=ee/2,be=Ht/2,re=$t.position();if(re.x-ge<=y&&y<=re.x+ge&&re.y-be<=g&&g<=re.y+be){var Ne=I.nodeShapes[A.getNodeShape($t)];if(Ne.checkPoint(y,g,0,ee,Ht,re.x,re.y))return At($t,0),!0}}function Mt($t){var ee=$t._private,Ht=ee.rscratch,ge=$t.pstyle("width").pfValue,be=$t.pstyle("arrow-scale").value,re=ge/2+V,Ne=re*re,ve=re*2,xn=ee.source,Pn=ee.target,fn;if(Ht.edgeType==="segments"||Ht.edgeType==="straight"||Ht.edgeType==="haystack"){for(var $e=Ht.allpts,qe=0;qe+3<$e.length;qe+=2)if(vY(y,g,$e[qe],$e[qe+1],$e[qe+2],$e[qe+3],ve)&&Ne>(fn=kY(y,g,$e[qe],$e[qe+1],$e[qe+2],$e[qe+3])))return At($t,fn),!0}else if(Ht.edgeType==="bezier"||Ht.edgeType==="multibezier"||Ht.edgeType==="self"||Ht.edgeType==="compound"){for(var $e=Ht.allpts,qe=0;qe+5<Ht.allpts.length;qe+=4)if(wY(y,g,$e[qe],$e[qe+1],$e[qe+2],$e[qe+3],$e[qe+4],$e[qe+5],ve)&&Ne>(fn=xY(y,g,$e[qe],$e[qe+1],$e[qe+2],$e[qe+3],$e[qe+4],$e[qe+5])))return At($t,fn),!0}for(var xn=xn||ee.source,Pn=Pn||ee.target,er=A.getArrowWidth(ge,be),Sn=[{name:"source",x:Ht.arrowStartX,y:Ht.arrowStartY,angle:Ht.srcArrowAngle},{name:"target",x:Ht.arrowEndX,y:Ht.arrowEndY,angle:Ht.tgtArrowAngle},{name:"mid-source",x:Ht.midX,y:Ht.midY,angle:Ht.midsrcArrowAngle},{name:"mid-target",x:Ht.midX,y:Ht.midY,angle:Ht.midtgtArrowAngle}],qe=0;qe<Sn.length;qe++){var Jn=Sn[qe],fr=I.arrowShapes[$t.pstyle(Jn.name+"-arrow-shape").value],Sr=$t.pstyle("width").pfValue;if(fr.roughCollide(y,g,er,Jn.angle,{x:Jn.x,y:Jn.y},Sr,V)&&fr.collide(y,g,er,Jn.angle,{x:Jn.x,y:Jn.y},Sr,V))return At($t),!0}S&&$.length>0&&(xt(xn),xt(Pn))}function Dt($t,ee,Ht){return wp($t,ee,Ht)}function Bt($t,ee){var Ht=$t._private,ge=tt,be;ee?be=ee+"-":be="",$t.boundingBox();var re=Ht.labelBounds[ee||"main"],Ne=$t.pstyle(be+"label").value,ve=$t.pstyle("text-events").strValue==="yes";if(!(!ve||!Ne)){var fn=Dt(Ht.rscratch,"labelX",ee),$e=Dt(Ht.rscratch,"labelY",ee),qe=Dt(Ht.rscratch,"labelAngle",ee),xn=$t.pstyle(be+"text-margin-x").pfValue,Pn=$t.pstyle(be+"text-margin-y").pfValue,er=re.x1-ge-xn,Sn=re.x2+ge-xn,Jn=re.y1-ge-Pn,fr=re.y2+ge-Pn;if(qe){var Sr=Math.cos(qe),wr=Math.sin(qe),cr=function(Fa,Fi){return Fa=Fa-fn,Fi=Fi-$e,{x:Fa*Sr-Fi*wr+fn,y:Fa*wr+Fi*Sr+$e}},bn=cr(er,Jn),Tr=cr(er,fr),xr=cr(Sn,Jn),fi=cr(Sn,fr),Ii=[bn.x+xn,bn.y+Pn,xr.x+xn,xr.y+Pn,fi.x+xn,fi.y+Pn,Tr.x+xn,Tr.y+Pn];if(qd(y,g,Ii))return At($t),!0}else if(H5(re,y,g))return At($t),!0}}for(var Zt=O.length-1;Zt>=0;Zt--){var Kt=O[Zt];Kt.isNode()?xt(Kt)||Bt(Kt):Mt(Kt)||Bt(Kt)||Bt(Kt,"source")||Bt(Kt,"target")}return $},M3.getAllInBox=function(y,g,x,T){var A=this.getCachedZSortedEles().interactive,I=[],O=Math.min(y,x),$=Math.max(y,x),z=Math.min(g,T),S=Math.max(g,T);y=O,x=$,g=z,T=S;for(var V=zd({x1:y,y1:g,x2:x,y2:T}),U=0;U<A.length;U++){var tt=A[U];if(tt.isNode()){var at=tt,ut=at.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});TL(V,ut)&&!WN(ut,V)&&I.push(at)}else{var dt=tt,At=dt._private,xt=At.rscratch;if(xt.startX!=null&&xt.startY!=null&&!H5(V,xt.startX,xt.startY)||xt.endX!=null&&xt.endY!=null&&!H5(V,xt.endX,xt.endY))continue;if(xt.edgeType==="bezier"||xt.edgeType==="multibezier"||xt.edgeType==="self"||xt.edgeType==="compound"||xt.edgeType==="segments"||xt.edgeType==="haystack"){for(var Mt=At.rstyle.bezierPts||At.rstyle.linePts||At.rstyle.haystackPts,Dt=!0,Bt=0;Bt<Mt.length;Bt++)if(!bY(V,Mt[Bt])){Dt=!1;break}Dt&&I.push(dt)}else(xt.edgeType==="haystack"||xt.edgeType==="straight")&&I.push(dt)}}return I};var lT={};lT.calculateArrowAngles=function(y){var g=y._private.rscratch,x=g.edgeType==="haystack",T=g.edgeType==="bezier",A=g.edgeType==="multibezier",I=g.edgeType==="segments",O=g.edgeType==="compound",$=g.edgeType==="self",z,S,V,U,tt,at,xt,Mt;if(x?(V=g.haystackPts[0],U=g.haystackPts[1],tt=g.haystackPts[2],at=g.haystackPts[3]):(V=g.arrowStartX,U=g.arrowStartY,tt=g.arrowEndX,at=g.arrowEndY),xt=g.midX,Mt=g.midY,I)z=V-g.segpts[0],S=U-g.segpts[1];else if(A||O||$||T){var ut=g.allpts,dt=lf(ut[0],ut[2],ut[4],.1),At=lf(ut[1],ut[3],ut[5],.1);z=V-dt,S=U-At}else z=V-xt,S=U-Mt;g.srcArrowAngle=LE(z,S);var xt=g.midX,Mt=g.midY;if(x&&(xt=(V+tt)/2,Mt=(U+at)/2),z=tt-V,S=at-U,I){var ut=g.allpts;if(ut.length/2%2===0){var Dt=ut.length/2,Bt=Dt-2;z=ut[Dt]-ut[Bt],S=ut[Dt+1]-ut[Bt+1]}else{var Dt=ut.length/2-1,Bt=Dt-2,Zt=Dt+2;z=ut[Dt]-ut[Bt],S=ut[Dt+1]-ut[Bt+1]}}else if(A||O||$){var ut=g.allpts,Kt=g.ctrlpts,$t,ee,Ht,ge;if(Kt.length/2%2===0){var be=ut.length/2-1,re=be+2,Ne=re+2;$t=lf(ut[be],ut[re],ut[Ne],0),ee=lf(ut[be+1],ut[re+1],ut[Ne+1],0),Ht=lf(ut[be],ut[re],ut[Ne],1e-4),ge=lf(ut[be+1],ut[re+1],ut[Ne+1],1e-4)}else{var re=ut.length/2-1,be=re-2,Ne=re+2;$t=lf(ut[be],ut[re],ut[Ne],.4999),ee=lf(ut[be+1],ut[re+1],ut[Ne+1],.4999),Ht=lf(ut[be],ut[re],ut[Ne],.5),ge=lf(ut[be+1],ut[re+1],ut[Ne+1],.5)}z=Ht-$t,S=ge-ee}if(g.midtgtArrowAngle=LE(z,S),g.midDispX=z,g.midDispY=S,z*=-1,S*=-1,I){var ut=g.allpts;if(ut.length/2%2!==0){var Dt=ut.length/2-1,Zt=Dt+2;z=-(ut[Zt]-ut[Dt]),S=-(ut[Zt+1]-ut[Dt+1])}}if(g.midsrcArrowAngle=LE(z,S),I)z=tt-g.segpts[g.segpts.length-2],S=at-g.segpts[g.segpts.length-1];else if(A||O||$||T){var ut=g.allpts,ve=ut.length,dt=lf(ut[ve-6],ut[ve-4],ut[ve-2],.9),At=lf(ut[ve-5],ut[ve-3],ut[ve-1],.9);z=tt-dt,S=at-At}else z=tt-xt,S=at-Mt;g.tgtArrowAngle=LE(z,S)},lT.getArrowWidth=lT.getArrowHeight=function(y,g){var x=this.arrowWidthCache=this.arrowWidthCache||{},T=x[y+", "+g];return T||(T=Math.max(Math.pow(y*13.37,.9),29)*g,x[y+", "+g]=T,T)};var ld={};ld.findHaystackPoints=function(y){for(var g=0;g<y.length;g++){var x=y[g],T=x._private,A=T.rscratch;if(!A.haystack){var I=Math.random()*2*Math.PI;A.source={x:Math.cos(I),y:Math.sin(I)},I=Math.random()*2*Math.PI,A.target={x:Math.cos(I),y:Math.sin(I)}}var O=T.source,$=T.target,z=O.position(),S=$.position(),V=O.width(),U=$.width(),tt=O.height(),at=$.height(),ut=x.pstyle("haystack-radius").value,dt=ut/2;A.haystackPts=A.allpts=[A.source.x*V*dt+z.x,A.source.y*tt*dt+z.y,A.target.x*U*dt+S.x,A.target.y*at*dt+S.y],A.midX=(A.allpts[0]+A.allpts[2])/2,A.midY=(A.allpts[1]+A.allpts[3])/2,A.edgeType="haystack",A.haystack=!0,this.storeEdgeProjections(x),this.calculateArrowAngles(x),this.recalculateEdgeLabelProjections(x),this.calculateLabelAngles(x)}},ld.findSegmentsPoints=function(y,g){var x=y._private.rscratch,T=g.posPts,A=g.intersectionPts,I=g.vectorNormInverse,O=y.pstyle("edge-distances").value,$=y.pstyle("segment-weights"),z=y.pstyle("segment-distances"),S=Math.min($.pfValue.length,z.pfValue.length);x.edgeType="segments",x.segpts=[];for(var V=0;V<S;V++){var U=$.pfValue[V],tt=z.pfValue[V],at=1-U,ut=U,dt=O==="node-position"?T:A,At={x:dt.x1*at+dt.x2*ut,y:dt.y1*at+dt.y2*ut};x.segpts.push(At.x+I.x*tt,At.y+I.y*tt)}},ld.findLoopPoints=function(y,g,x,T){var A=y._private.rscratch,I=g.dirCounts,O=g.srcPos,$=y.pstyle("control-point-distances"),z=$?$.pfValue[0]:void 0,S=y.pstyle("loop-direction").pfValue,V=y.pstyle("loop-sweep").pfValue,U=y.pstyle("control-point-step-size").pfValue;A.edgeType="self";var tt=x,at=U;T&&(tt=0,at=z);var ut=S-Math.PI/2,dt=ut-V/2,At=ut+V/2,xt=S+"_"+V;tt=I[xt]===void 0?I[xt]=0:++I[xt],A.ctrlpts=[O.x+Math.cos(dt)*1.4*at*(tt/3+1),O.y+Math.sin(dt)*1.4*at*(tt/3+1),O.x+Math.cos(At)*1.4*at*(tt/3+1),O.y+Math.sin(At)*1.4*at*(tt/3+1)]},ld.findCompoundLoopPoints=function(y,g,x,T){var A=y._private.rscratch;A.edgeType="compound";var I=g.srcPos,O=g.tgtPos,$=g.srcW,z=g.srcH,S=g.tgtW,V=g.tgtH,U=y.pstyle("control-point-step-size").pfValue,tt=y.pstyle("control-point-distances"),at=tt?tt.pfValue[0]:void 0,ut=x,dt=U;T&&(ut=0,dt=at);var At=50,xt={x:I.x-$/2,y:I.y-z/2},Mt={x:O.x-S/2,y:O.y-V/2},Dt={x:Math.min(xt.x,Mt.x),y:Math.min(xt.y,Mt.y)},Bt=.5,Zt=Math.max(Bt,Math.log($*.01)),Kt=Math.max(Bt,Math.log(S*.01));A.ctrlpts=[Dt.x,Dt.y-(1+Math.pow(At,1.12)/100)*dt*(ut/3+1)*Zt,Dt.x-(1+Math.pow(At,1.12)/100)*dt*(ut/3+1)*Kt,Dt.y]},ld.findStraightEdgePoints=function(y){y._private.rscratch.edgeType="straight"},ld.findBezierPoints=function(y,g,x,T,A){var I=y._private.rscratch,O=g.vectorNormInverse,$=g.posPts,z=g.intersectionPts,S=y.pstyle("edge-distances").value,V=y.pstyle("control-point-step-size").pfValue,U=y.pstyle("control-point-distances"),tt=y.pstyle("control-point-weights"),at=U&&tt?Math.min(U.value.length,tt.value.length):1,ut=U?U.pfValue[0]:void 0,dt=tt.value[0],At=T;I.edgeType=At?"multibezier":"bezier",I.ctrlpts=[];for(var xt=0;xt<at;xt++){var Mt=(.5-g.eles.length/2+x)*V*(A?-1:1),Dt=void 0,Bt=GN(Mt);At&&(ut=U?U.pfValue[xt]:V,dt=tt.value[xt]),T?Dt=ut:Dt=ut!==void 0?Bt*ut:void 0;var Zt=Dt!==void 0?Dt:Mt,Kt=1-dt,$t=dt,ee=S==="node-position"?$:z,Ht={x:ee.x1*Kt+ee.x2*$t,y:ee.y1*Kt+ee.y2*$t};I.ctrlpts.push(Ht.x+O.x*Zt,Ht.y+O.y*Zt)}},ld.findTaxiPoints=function(y,g){var x=y._private.rscratch;x.edgeType="segments";var T="vertical",A="horizontal",I="leftward",O="rightward",$="downward",z="upward",S="auto",V=g.posPts,U=g.srcW,tt=g.srcH,at=g.tgtW,ut=g.tgtH,dt=y.pstyle("edge-distances").value,At=dt!=="node-position",xt=y.pstyle("taxi-direction").value,Mt=xt,Dt=y.pstyle("taxi-turn"),Bt=Dt.units==="%",Zt=Dt.pfValue,Kt=Zt<0,$t=y.pstyle("taxi-turn-min-distance").pfValue,ee=At?(U+at)/2:0,Ht=At?(tt+ut)/2:0,ge=V.x2-V.x1,be=V.y2-V.y1,re=function(us,Ko){return us>0?Math.max(us-Ko,0):Math.min(us+Ko,0)},Ne=re(ge,ee),ve=re(be,Ht),fn=!1;Mt===S?xt=Math.abs(Ne)>Math.abs(ve)?A:T:Mt===z||Mt===$?(xt=T,fn=!0):(Mt===I||Mt===O)&&(xt=A,fn=!0);var $e=xt===T,qe=$e?ve:Ne,xn=$e?be:ge,Pn=GN(xn),er=!1;!(fn&&(Bt||Kt))&&(Mt===$&&xn<0||Mt===z&&xn>0||Mt===I&&xn>0||Mt===O&&xn<0)&&(Pn*=-1,qe=Pn*Math.abs(qe),er=!0);var Sn;if(Bt){var Jn=Zt<0?1+Zt:Zt;Sn=Jn*qe}else{var fr=Zt<0?qe:0;Sn=fr+Zt*Pn}var Sr=function(us){return Math.abs(us)<$t||Math.abs(us)>=Math.abs(qe)},wr=Sr(Sn),cr=Sr(Math.abs(qe)-Math.abs(Sn)),bn=wr||cr;if(bn&&!er)if($e){var Tr=Math.abs(xn)<=tt/2,xr=Math.abs(ge)<=at/2;if(Tr){var fi=(V.x1+V.x2)/2,Ii=V.y1,oa=V.y2;x.segpts=[fi,Ii,fi,oa]}else if(xr){var Fa=(V.y1+V.y2)/2,Fi=V.x1,Ci=V.x2;x.segpts=[Fi,Fa,Ci,Fa]}else x.segpts=[V.x1,V.y2]}else{var Ls=Math.abs(xn)<=U/2,es=Math.abs(be)<=ut/2;if(Ls){var Ri=(V.y1+V.y2)/2,as=V.x1,no=V.x2;x.segpts=[as,Ri,no,Ri]}else if(es){var ca=(V.x1+V.x2)/2,ea=V.y1,Fr=V.y2;x.segpts=[ca,ea,ca,Fr]}else x.segpts=[V.x2,V.y1]}else if($e){var Qt=V.y1+Sn+(At?tt/2*Pn:0),Hn=V.x1,jr=V.x2;x.segpts=[Hn,Qt,jr,Qt]}else{var dr=V.x1+Sn+(At?U/2*Pn:0),gr=V.y1,Ga=V.y2;x.segpts=[dr,gr,dr,Ga]}},ld.tryToCorrectInvalidPoints=function(y,g){var x=y._private.rscratch;if(x.edgeType==="bezier"){var T=g.srcPos,A=g.tgtPos,I=g.srcW,O=g.srcH,$=g.tgtW,z=g.tgtH,S=g.srcShape,V=g.tgtShape,U=!rt(x.startX)||!rt(x.startY),tt=!rt(x.arrowStartX)||!rt(x.arrowStartY),at=!rt(x.endX)||!rt(x.endY),ut=!rt(x.arrowEndX)||!rt(x.arrowEndY),dt=3,At=this.getArrowWidth(y.pstyle("width").pfValue,y.pstyle("arrow-scale").value)*this.arrowShapeWidth,xt=dt*At,Mt=T3({x:x.ctrlpts[0],y:x.ctrlpts[1]},{x:x.startX,y:x.startY}),Dt=Mt<xt,Bt=T3({x:x.ctrlpts[0],y:x.ctrlpts[1]},{x:x.endX,y:x.endY}),Zt=Bt<xt,Kt=!1;if(U||tt||Dt){Kt=!0;var $t={x:x.ctrlpts[0]-T.x,y:x.ctrlpts[1]-T.y},ee=Math.sqrt($t.x*$t.x+$t.y*$t.y),Ht={x:$t.x/ee,y:$t.y/ee},ge=Math.max(I,O),be={x:x.ctrlpts[0]+Ht.x*2*ge,y:x.ctrlpts[1]+Ht.y*2*ge},re=S.intersectLine(T.x,T.y,I,O,be.x,be.y,0);Dt?(x.ctrlpts[0]=x.ctrlpts[0]+Ht.x*(xt-Mt),x.ctrlpts[1]=x.ctrlpts[1]+Ht.y*(xt-Mt)):(x.ctrlpts[0]=re[0]+Ht.x*xt,x.ctrlpts[1]=re[1]+Ht.y*xt)}if(at||ut||Zt){Kt=!0;var Ne={x:x.ctrlpts[0]-A.x,y:x.ctrlpts[1]-A.y},ve=Math.sqrt(Ne.x*Ne.x+Ne.y*Ne.y),fn={x:Ne.x/ve,y:Ne.y/ve},$e=Math.max(I,O),qe={x:x.ctrlpts[0]+fn.x*2*$e,y:x.ctrlpts[1]+fn.y*2*$e},xn=V.intersectLine(A.x,A.y,$,z,qe.x,qe.y,0);Zt?(x.ctrlpts[0]=x.ctrlpts[0]+fn.x*(xt-Bt),x.ctrlpts[1]=x.ctrlpts[1]+fn.y*(xt-Bt)):(x.ctrlpts[0]=xn[0]+fn.x*xt,x.ctrlpts[1]=xn[1]+fn.y*xt)}Kt&&this.findEndpoints(y)}},ld.storeAllpts=function(y){var g=y._private.rscratch;if(g.edgeType==="multibezier"||g.edgeType==="bezier"||g.edgeType==="self"||g.edgeType==="compound"){g.allpts=[],g.allpts.push(g.startX,g.startY);for(var x=0;x+1<g.ctrlpts.length;x+=2)g.allpts.push(g.ctrlpts[x],g.ctrlpts[x+1]),x+3<g.ctrlpts.length&&g.allpts.push((g.ctrlpts[x]+g.ctrlpts[x+2])/2,(g.ctrlpts[x+1]+g.ctrlpts[x+3])/2);g.allpts.push(g.endX,g.endY);var T,A;g.ctrlpts.length/2%2===0?(T=g.allpts.length/2-1,g.midX=g.allpts[T],g.midY=g.allpts[T+1]):(T=g.allpts.length/2-3,A=.5,g.midX=lf(g.allpts[T],g.allpts[T+2],g.allpts[T+4],A),g.midY=lf(g.allpts[T+1],g.allpts[T+3],g.allpts[T+5],A))}else if(g.edgeType==="straight")g.allpts=[g.startX,g.startY,g.endX,g.endY],g.midX=(g.startX+g.endX+g.arrowStartX+g.arrowEndX)/4,g.midY=(g.startY+g.endY+g.arrowStartY+g.arrowEndY)/4;else if(g.edgeType==="segments")if(g.allpts=[],g.allpts.push(g.startX,g.startY),g.allpts.push.apply(g.allpts,g.segpts),g.allpts.push(g.endX,g.endY),g.segpts.length%4===0){var I=g.segpts.length/2,O=I-2;g.midX=(g.segpts[O]+g.segpts[I])/2,g.midY=(g.segpts[O+1]+g.segpts[I+1])/2}else{var $=g.segpts.length/2-1;g.midX=g.segpts[$],g.midY=g.segpts[$+1]}},ld.checkForInvalidEdgeWarning=function(y){var g=y[0]._private.rscratch;g.nodesOverlap||rt(g.startX)&&rt(g.startY)&&rt(g.endX)&&rt(g.endY)?g.loggedErr=!1:g.loggedErr||(g.loggedErr=!0,Wo("Edge `"+y.id()+"` has invalid endpoints and so it is impossible to draw.  Adjust your edge style (e.g. control points) accordingly or use an alternative edge type.  This is expected behaviour when the source node and the target node overlap."))},ld.findEdgeControlPoints=function(y){var g=this;if(!(!y||y.length===0)){for(var x=this,T=x.cy,A=T.hasCompoundNodes(),I={map:new j2,get:function($t){var ee=this.map.get($t[0]);return ee!=null?ee.get($t[1]):null},set:function($t,ee){var Ht=this.map.get($t[0]);Ht==null&&(Ht=new j2,this.map.set($t[0],Ht)),Ht.set($t[1],ee)}},O=[],$=[],z=0;z<y.length;z++){var S=y[z],V=S._private,U=S.pstyle("curve-style").value;if(!(S.removed()||!S.takesUpSpace())){if(U==="haystack"){$.push(S);continue}var tt=U==="unbundled-bezier"||U==="segments"||U==="straight"||U==="straight-triangle"||U==="taxi",at=U==="unbundled-bezier"||U==="bezier",ut=V.source,dt=V.target,At=ut.poolIndex(),xt=dt.poolIndex(),Mt=[At,xt].sort(),Dt=I.get(Mt);Dt==null&&(Dt={eles:[]},I.set(Mt,Dt),O.push(Mt)),Dt.eles.push(S),tt&&(Dt.hasUnbundled=!0),at&&(Dt.hasBezier=!0)}}for(var Bt=function($t){var ee=O[$t],Ht=I.get(ee),ge=void 0;if(!Ht.hasUnbundled){var be=Ht.eles[0].parallelEdges().filter(function(Fr){return Fr.isBundledBezier()});yL(Ht.eles),be.forEach(function(Fr){return Ht.eles.push(Fr)}),Ht.eles.sort(function(Fr,Qt){return Fr.poolIndex()-Qt.poolIndex()})}var re=Ht.eles[0],Ne=re.source(),ve=re.target();if(Ne.poolIndex()>ve.poolIndex()){var fn=Ne;Ne=ve,ve=fn}var $e=Ht.srcPos=Ne.position(),qe=Ht.tgtPos=ve.position(),xn=Ht.srcW=Ne.outerWidth(),Pn=Ht.srcH=Ne.outerHeight(),er=Ht.tgtW=ve.outerWidth(),Sn=Ht.tgtH=ve.outerHeight(),Jn=Ht.srcShape=x.nodeShapes[g.getNodeShape(Ne)],fr=Ht.tgtShape=x.nodeShapes[g.getNodeShape(ve)];Ht.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var Sr=0;Sr<Ht.eles.length;Sr++){var wr=Ht.eles[Sr],cr=wr[0]._private.rscratch,bn=wr.pstyle("curve-style").value,Tr=bn==="unbundled-bezier"||bn==="segments"||bn==="taxi",xr=!Ne.same(wr.source());if(!Ht.calculatedIntersection&&Ne!==ve&&(Ht.hasBezier||Ht.hasUnbundled)){Ht.calculatedIntersection=!0;var fi=Jn.intersectLine($e.x,$e.y,xn,Pn,qe.x,qe.y,0),Ii=Ht.srcIntn=fi,oa=fr.intersectLine(qe.x,qe.y,er,Sn,$e.x,$e.y,0),Fa=Ht.tgtIntn=oa,Fi=Ht.intersectionPts={x1:fi[0],x2:oa[0],y1:fi[1],y2:oa[1]},Ci=Ht.posPts={x1:$e.x,x2:qe.x,y1:$e.y,y2:qe.y},Ls=oa[1]-fi[1],es=oa[0]-fi[0],Ri=Math.sqrt(es*es+Ls*Ls),as=Ht.vector={x:es,y:Ls},no=Ht.vectorNorm={x:as.x/Ri,y:as.y/Ri},ca={x:-no.y,y:no.x};Ht.nodesOverlap=!rt(Ri)||fr.checkPoint(fi[0],fi[1],0,er,Sn,qe.x,qe.y)||Jn.checkPoint(oa[0],oa[1],0,xn,Pn,$e.x,$e.y),Ht.vectorNormInverse=ca,ge={nodesOverlap:Ht.nodesOverlap,dirCounts:Ht.dirCounts,calculatedIntersection:!0,hasBezier:Ht.hasBezier,hasUnbundled:Ht.hasUnbundled,eles:Ht.eles,srcPos:qe,tgtPos:$e,srcW:er,srcH:Sn,tgtW:xn,tgtH:Pn,srcIntn:Fa,tgtIntn:Ii,srcShape:fr,tgtShape:Jn,posPts:{x1:Ci.x2,y1:Ci.y2,x2:Ci.x1,y2:Ci.y1},intersectionPts:{x1:Fi.x2,y1:Fi.y2,x2:Fi.x1,y2:Fi.y1},vector:{x:-as.x,y:-as.y},vectorNorm:{x:-no.x,y:-no.y},vectorNormInverse:{x:-ca.x,y:-ca.y}}}var ea=xr?ge:Ht;cr.nodesOverlap=ea.nodesOverlap,cr.srcIntn=ea.srcIntn,cr.tgtIntn=ea.tgtIntn,A&&(Ne.isParent()||Ne.isChild()||ve.isParent()||ve.isChild())&&(Ne.parents().anySame(ve)||ve.parents().anySame(Ne)||Ne.same(ve)&&Ne.isParent())?g.findCompoundLoopPoints(wr,ea,Sr,Tr):Ne===ve?g.findLoopPoints(wr,ea,Sr,Tr):bn==="segments"?g.findSegmentsPoints(wr,ea):bn==="taxi"?g.findTaxiPoints(wr,ea):bn==="straight"||!Tr&&Ht.eles.length%2===1&&Sr===Math.floor(Ht.eles.length/2)?g.findStraightEdgePoints(wr):g.findBezierPoints(wr,ea,Sr,Tr,xr),g.findEndpoints(wr),g.tryToCorrectInvalidPoints(wr,ea),g.checkForInvalidEdgeWarning(wr),g.storeAllpts(wr),g.storeEdgeProjections(wr),g.calculateArrowAngles(wr),g.recalculateEdgeLabelProjections(wr),g.calculateLabelAngles(wr)}},Zt=0;Zt<O.length;Zt++)Bt(Zt);this.findHaystackPoints($)}};function IB(y){var g=[];if(y!=null){for(var x=0;x<y.length;x+=2){var T=y[x],A=y[x+1];g.push({x:T,y:A})}return g}}ld.getSegmentPoints=function(y){var g=y[0]._private.rscratch,x=g.edgeType;if(x==="segments")return this.recalculateRenderedStyle(y),IB(g.segpts)},ld.getControlPoints=function(y){var g=y[0]._private.rscratch,x=g.edgeType;if(x==="bezier"||x==="multibezier"||x==="self"||x==="compound")return this.recalculateRenderedStyle(y),IB(g.ctrlpts)},ld.getEdgeMidpoint=function(y){var g=y[0]._private.rscratch;return this.recalculateRenderedStyle(y),{x:g.midX,y:g.midY}};var Bk={};Bk.manualEndptToPx=function(y,g){var x=this,T=y.position(),A=y.outerWidth(),I=y.outerHeight();if(g.value.length===2){var O=[g.pfValue[0],g.pfValue[1]];return g.units[0]==="%"&&(O[0]=O[0]*A),g.units[1]==="%"&&(O[1]=O[1]*I),O[0]+=T.x,O[1]+=T.y,O}else{var $=g.pfValue[0];$=-Math.PI/2+$;var z=2*Math.max(A,I),S=[T.x+Math.cos($)*z,T.y+Math.sin($)*z];return x.nodeShapes[this.getNodeShape(y)].intersectLine(T.x,T.y,A,I,S[0],S[1],0)}},Bk.findEndpoints=function(y){var g=this,x,T=y.source()[0],A=y.target()[0],I=T.position(),O=A.position(),$=y.pstyle("target-arrow-shape").value,z=y.pstyle("source-arrow-shape").value,S=y.pstyle("target-distance-from-node").pfValue,V=y.pstyle("source-distance-from-node").pfValue,U=y.pstyle("curve-style").value,tt=y._private.rscratch,at=tt.edgeType,ut=U==="taxi",dt=at==="self"||at==="compound",At=at==="bezier"||at==="multibezier"||dt,xt=at!=="bezier",Mt=at==="straight"||at==="segments",Dt=at==="segments",Bt=At||xt||Mt,Zt=dt||ut,Kt=y.pstyle("source-endpoint"),$t=Zt?"outside-to-node":Kt.value,ee=y.pstyle("target-endpoint"),Ht=Zt?"outside-to-node":ee.value;tt.srcManEndpt=Kt,tt.tgtManEndpt=ee;var ge,be,re,Ne;if(At){var ve=[tt.ctrlpts[0],tt.ctrlpts[1]],fn=xt?[tt.ctrlpts[tt.ctrlpts.length-2],tt.ctrlpts[tt.ctrlpts.length-1]]:ve;ge=fn,be=ve}else if(Mt){var $e=Dt?tt.segpts.slice(0,2):[O.x,O.y],qe=Dt?tt.segpts.slice(tt.segpts.length-2):[I.x,I.y];ge=qe,be=$e}if(Ht==="inside-to-node")x=[O.x,O.y];else if(ee.units)x=this.manualEndptToPx(A,ee);else if(Ht==="outside-to-line")x=tt.tgtIntn;else if(Ht==="outside-to-node"||Ht==="outside-to-node-or-label"?re=ge:(Ht==="outside-to-line"||Ht==="outside-to-line-or-label")&&(re=[I.x,I.y]),x=g.nodeShapes[this.getNodeShape(A)].intersectLine(O.x,O.y,A.outerWidth(),A.outerHeight(),re[0],re[1],0),Ht==="outside-to-node-or-label"||Ht==="outside-to-line-or-label"){var xn=A._private.rscratch,Pn=xn.labelWidth,er=xn.labelHeight,Sn=xn.labelX,Jn=xn.labelY,fr=Pn/2,Sr=er/2,wr=A.pstyle("text-valign").value;wr==="top"?Jn-=Sr:wr==="bottom"&&(Jn+=Sr);var cr=A.pstyle("text-halign").value;cr==="left"?Sn-=fr:cr==="right"&&(Sn+=fr);var bn=yk(re[0],re[1],[Sn-fr,Jn-Sr,Sn+fr,Jn-Sr,Sn+fr,Jn+Sr,Sn-fr,Jn+Sr],O.x,O.y);if(bn.length>0){var Tr=I,xr=_3(Tr,z5(x)),fi=_3(Tr,z5(bn)),Ii=xr;if(fi<xr&&(x=bn,Ii=fi),bn.length>2){var oa=_3(Tr,{x:bn[2],y:bn[3]});oa<Ii&&(x=[bn[2],bn[3]])}}}var Fa=DE(x,ge,g.arrowShapes[$].spacing(y)+S),Fi=DE(x,ge,g.arrowShapes[$].gap(y)+S);if(tt.endX=Fi[0],tt.endY=Fi[1],tt.arrowEndX=Fa[0],tt.arrowEndY=Fa[1],$t==="inside-to-node")x=[I.x,I.y];else if(Kt.units)x=this.manualEndptToPx(T,Kt);else if($t==="outside-to-line")x=tt.srcIntn;else if($t==="outside-to-node"||$t==="outside-to-node-or-label"?Ne=be:($t==="outside-to-line"||$t==="outside-to-line-or-label")&&(Ne=[O.x,O.y]),x=g.nodeShapes[this.getNodeShape(T)].intersectLine(I.x,I.y,T.outerWidth(),T.outerHeight(),Ne[0],Ne[1],0),$t==="outside-to-node-or-label"||$t==="outside-to-line-or-label"){var Ci=T._private.rscratch,Ls=Ci.labelWidth,es=Ci.labelHeight,Ri=Ci.labelX,as=Ci.labelY,no=Ls/2,ca=es/2,ea=T.pstyle("text-valign").value;ea==="top"?as-=ca:ea==="bottom"&&(as+=ca);var Fr=T.pstyle("text-halign").value;Fr==="left"?Ri-=no:Fr==="right"&&(Ri+=no);var Qt=yk(Ne[0],Ne[1],[Ri-no,as-ca,Ri+no,as-ca,Ri+no,as+ca,Ri-no,as+ca],I.x,I.y);if(Qt.length>0){var Hn=O,jr=_3(Hn,z5(x)),dr=_3(Hn,z5(Qt)),gr=jr;if(dr<jr&&(x=[Qt[0],Qt[1]],gr=dr),Qt.length>2){var Ga=_3(Hn,{x:Qt[2],y:Qt[3]});Ga<gr&&(x=[Qt[2],Qt[3]])}}}var Zr=DE(x,be,g.arrowShapes[z].spacing(y)+V),us=DE(x,be,g.arrowShapes[z].gap(y)+V);tt.startX=us[0],tt.startY=us[1],tt.arrowStartX=Zr[0],tt.arrowStartY=Zr[1],Bt&&(!rt(tt.startX)||!rt(tt.startY)||!rt(tt.endX)||!rt(tt.endY)?tt.badLine=!0:tt.badLine=!1)},Bk.getSourceEndpoint=function(y){var g=y[0]._private.rscratch;switch(this.recalculateRenderedStyle(y),g.edgeType){case"haystack":return{x:g.haystackPts[0],y:g.haystackPts[1]};default:return{x:g.arrowStartX,y:g.arrowStartY}}},Bk.getTargetEndpoint=function(y){var g=y[0]._private.rscratch;switch(this.recalculateRenderedStyle(y),g.edgeType){case"haystack":return{x:g.haystackPts[2],y:g.haystackPts[3]};default:return{x:g.arrowEndX,y:g.arrowEndY}}};var XL={};function qJ(y,g,x){for(var T=function(S,V,U,tt){return lf(S,V,U,tt)},A=g._private,I=A.rstyle.bezierPts,O=0;O<y.bezierProjPcts.length;O++){var $=y.bezierProjPcts[O];I.push({x:T(x[0],x[2],x[4],$),y:T(x[1],x[3],x[5],$)})}}XL.storeEdgeProjections=function(y){var g=y._private,x=g.rscratch,T=x.edgeType;if(g.rstyle.bezierPts=null,g.rstyle.linePts=null,g.rstyle.haystackPts=null,T==="multibezier"||T==="bezier"||T==="self"||T==="compound"){g.rstyle.bezierPts=[];for(var A=0;A+5<x.allpts.length;A+=4)qJ(this,y,x.allpts.slice(A,A+6))}else if(T==="segments")for(var I=g.rstyle.linePts=[],A=0;A+1<x.allpts.length;A+=2)I.push({x:x.allpts[A],y:x.allpts[A+1]});else if(T==="haystack"){var O=x.haystackPts;g.rstyle.haystackPts=[{x:O[0],y:O[1]},{x:O[2],y:O[3]}]}g.rstyle.arrowWidth=this.getArrowWidth(y.pstyle("width").pfValue,y.pstyle("arrow-scale").value)*this.arrowShapeWidth},XL.recalculateEdgeProjections=function(y){this.findEdgeControlPoints(y)};var kp={};kp.recalculateNodeLabelProjection=function(y){var g=y.pstyle("label").strValue;if(!J(g)){var x,T,A=y._private,I=y.width(),O=y.height(),$=y.padding(),z=y.position(),S=y.pstyle("text-halign").strValue,V=y.pstyle("text-valign").strValue,U=A.rscratch,tt=A.rstyle;switch(S){case"left":x=z.x-I/2-$;break;case"right":x=z.x+I/2+$;break;default:x=z.x}switch(V){case"top":T=z.y-O/2-$;break;case"bottom":T=z.y+O/2+$;break;default:T=z.y}U.labelX=x,U.labelY=T,tt.labelX=x,tt.labelY=T,this.calculateLabelAngles(y),this.applyLabelDimensions(y)}};var OB=function(g,x){var T=Math.atan(x/g);return g===0&&T<0&&(T=T*-1),T},PB=function(g,x){var T=x.x-g.x,A=x.y-g.y;return OB(T,A)},NB=function(g,x,T,A){var I=wk(0,A-.001,1),O=wk(0,A+.001,1),$=q5(g,x,T,I),z=q5(g,x,T,O);return PB($,z)};kp.recalculateEdgeLabelProjections=function(y){var g,x=y._private,T=x.rscratch,A=this,I={mid:y.pstyle("label").strValue,source:y.pstyle("source-label").strValue,target:y.pstyle("target-label").strValue};if(I.mid||I.source||I.target){g={x:T.midX,y:T.midY};var O=function(U,tt,at){gm(x.rscratch,U,tt,at),gm(x.rstyle,U,tt,at)};O("labelX",null,g.x),O("labelY",null,g.y);var $=OB(T.midDispX,T.midDispY);O("labelAutoAngle",null,$);var z=function V(){if(V.cache)return V.cache;for(var U=[],tt=0;tt+5<T.allpts.length;tt+=4){var at={x:T.allpts[tt],y:T.allpts[tt+1]},ut={x:T.allpts[tt+2],y:T.allpts[tt+3]},dt={x:T.allpts[tt+4],y:T.allpts[tt+5]};U.push({p0:at,p1:ut,p2:dt,startDist:0,length:0,segments:[]})}var At=x.rstyle.bezierPts,xt=A.bezierProjPcts.length;function Mt($t,ee,Ht,ge,be){var re=T3(ee,Ht),Ne=$t.segments[$t.segments.length-1],ve={p0:ee,p1:Ht,t0:ge,t1:be,startDist:Ne?Ne.startDist+Ne.length:0,length:re};$t.segments.push(ve),$t.length+=re}for(var Dt=0;Dt<U.length;Dt++){var Bt=U[Dt],Zt=U[Dt-1];Zt&&(Bt.startDist=Zt.startDist+Zt.length),Mt(Bt,Bt.p0,At[Dt*xt],0,A.bezierProjPcts[0]);for(var Kt=0;Kt<xt-1;Kt++)Mt(Bt,At[Dt*xt+Kt],At[Dt*xt+Kt+1],A.bezierProjPcts[Kt],A.bezierProjPcts[Kt+1]);Mt(Bt,At[Dt*xt+xt-1],Bt.p2,A.bezierProjPcts[xt-1],1)}return V.cache=U},S=function(U){var tt,at=U==="source";if(I[U]){var ut=y.pstyle(U+"-text-offset").pfValue;switch(T.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var dt=z(),At,xt=0,Mt=0,Dt=0;Dt<dt.length;Dt++){for(var Bt=dt[at?Dt:dt.length-1-Dt],Zt=0;Zt<Bt.segments.length;Zt++){var Kt=Bt.segments[at?Zt:Bt.segments.length-1-Zt],$t=Dt===dt.length-1&&Zt===Bt.segments.length-1;if(xt=Mt,Mt+=Kt.length,Mt>=ut||$t){At={cp:Bt,segment:Kt};break}}if(At)break}var ee=At.cp,Ht=At.segment,ge=(ut-xt)/Ht.length,be=Ht.t1-Ht.t0,re=at?Ht.t0+be*ge:Ht.t1-be*ge;re=wk(0,re,1),g=q5(ee.p0,ee.p1,ee.p2,re),tt=NB(ee.p0,ee.p1,ee.p2,re);break}case"straight":case"segments":case"haystack":{for(var Ne=0,ve,fn,$e,qe,xn=T.allpts.length,Pn=0;Pn+3<xn&&(at?($e={x:T.allpts[Pn],y:T.allpts[Pn+1]},qe={x:T.allpts[Pn+2],y:T.allpts[Pn+3]}):($e={x:T.allpts[xn-2-Pn],y:T.allpts[xn-1-Pn]},qe={x:T.allpts[xn-4-Pn],y:T.allpts[xn-3-Pn]}),ve=T3($e,qe),fn=Ne,Ne+=ve,!(Ne>=ut));Pn+=2);var er=ut-fn,Sn=er/ve;Sn=wk(0,Sn,1),g=hY($e,qe,Sn),tt=PB($e,qe);break}}O("labelX",U,g.x),O("labelY",U,g.y),O("labelAutoAngle",U,tt)}};S("source"),S("target"),this.applyLabelDimensions(y)}},kp.applyLabelDimensions=function(y){this.applyPrefixedLabelDimensions(y),y.isEdge()&&(this.applyPrefixedLabelDimensions(y,"source"),this.applyPrefixedLabelDimensions(y,"target"))},kp.applyPrefixedLabelDimensions=function(y,g){var x=y._private,T=this.getLabelText(y,g),A=this.calculateLabelDimensions(y,T),I=y.pstyle("line-height").pfValue,O=y.pstyle("text-wrap").strValue,$=wp(x.rscratch,"labelWrapCachedLines",g)||[],z=O!=="wrap"?1:Math.max($.length,1),S=A.height/z,V=S*I,U=A.width,tt=A.height+(z-1)*(I-1)*S;gm(x.rstyle,"labelWidth",g,U),gm(x.rscratch,"labelWidth",g,U),gm(x.rstyle,"labelHeight",g,tt),gm(x.rscratch,"labelHeight",g,tt),gm(x.rscratch,"labelLineHeight",g,V)},kp.getLabelText=function(y,g){var x=y._private,T=g?g+"-":"",A=y.pstyle(T+"label").strValue,I=y.pstyle("text-transform").value,O=function(er,Sn){return Sn?(gm(x.rscratch,er,g,Sn),Sn):wp(x.rscratch,er,g)};if(!A)return"";I=="none"||(I=="uppercase"?A=A.toUpperCase():I=="lowercase"&&(A=A.toLowerCase()));var $=y.pstyle("text-wrap").value;if($==="wrap"){var z=O("labelKey");if(z!=null&&O("labelWrapKey")===z)return O("labelWrapCachedText");for(var S="​",V=A.split(`
`),U=y.pstyle("text-max-width").pfValue,tt=y.pstyle("text-overflow-wrap").value,at=tt==="anywhere",ut=[],dt=/[\s\u200b]+/,At=at?"":" ",xt=0;xt<V.length;xt++){var Mt=V[xt],Dt=this.calculateLabelDimensions(y,Mt),Bt=Dt.width;if(at){var Zt=Mt.split("").join(S);Mt=Zt}if(Bt>U){for(var Kt=Mt.split(dt),$t="",ee=0;ee<Kt.length;ee++){var Ht=Kt[ee],ge=$t.length===0?Ht:$t+At+Ht,be=this.calculateLabelDimensions(y,ge),re=be.width;re<=U?$t+=Ht+At:($t&&ut.push($t),$t=Ht+At)}$t.match(/^[\s\u200b]+$/)||ut.push($t)}else ut.push(Mt)}O("labelWrapCachedLines",ut),A=O("labelWrapCachedText",ut.join(`
`)),O("labelWrapKey",z)}else if($==="ellipsis"){var Ne=y.pstyle("text-max-width").pfValue,ve="",fn="…",$e=!1;if(this.calculateLabelDimensions(y,A).width<Ne)return A;for(var qe=0;qe<A.length;qe++){var xn=this.calculateLabelDimensions(y,ve+A[qe]+fn).width;if(xn>Ne)break;ve+=A[qe],qe===A.length-1&&($e=!0)}return $e||(ve+=fn),ve}return A},kp.getLabelJustification=function(y){var g=y.pstyle("text-justification").strValue,x=y.pstyle("text-halign").strValue;if(g==="auto")if(y.isNode())switch(x){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return g},kp.calculateLabelDimensions=function(y,g){var x=this,T=ad(g,y._private.labelDimsKey),A=x.labelDimCache||(x.labelDimCache=[]),I=A[T];if(I!=null)return I;var O=0,$=y.pstyle("font-style").strValue,z=y.pstyle("font-size").pfValue,S=y.pstyle("font-family").strValue,V=y.pstyle("font-weight").strValue,U=this.labelCalcCanvas,tt=this.labelCalcCanvasContext;if(!U){U=this.labelCalcCanvas=document.createElement("canvas"),tt=this.labelCalcCanvasContext=U.getContext("2d");var at=U.style;at.position="absolute",at.left="-9999px",at.top="-9999px",at.zIndex="-1",at.visibility="hidden",at.pointerEvents="none"}tt.font="".concat($," ").concat(V," ").concat(z,"px ").concat(S);for(var ut=0,dt=0,At=g.split(`
`),xt=0;xt<At.length;xt++){var Mt=At[xt],Dt=tt.measureText(Mt),Bt=Math.ceil(Dt.width),Zt=z;ut=Math.max(Bt,ut),dt+=Zt}return ut+=O,dt+=O,A[T]={width:ut,height:dt}},kp.calculateLabelAngle=function(y,g){var x=y._private,T=x.rscratch,A=y.isEdge(),I=g?g+"-":"",O=y.pstyle(I+"text-rotation"),$=O.strValue;return $==="none"?0:A&&$==="autorotate"?T.labelAutoAngle:$==="autorotate"?0:O.pfValue},kp.calculateLabelAngles=function(y){var g=this,x=y.isEdge(),T=y._private,A=T.rscratch;A.labelAngle=g.calculateLabelAngle(y),x&&(A.sourceLabelAngle=g.calculateLabelAngle(y,"source"),A.targetLabelAngle=g.calculateLabelAngle(y,"target"))};var ch={},QL=28,FB=!1;ch.getNodeShape=function(y){var g=this,x=y.pstyle("shape").value;if(x==="cutrectangle"&&(y.width()<QL||y.height()<QL))return FB||(Wo("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),FB=!0),"rectangle";if(y.isParent())return x==="rectangle"||x==="roundrectangle"||x==="round-rectangle"||x==="cutrectangle"||x==="cut-rectangle"||x==="barrel"?x:"rectangle";if(x==="polygon"){var T=y.pstyle("shape-polygon-points").value;return g.nodeShapes.makePolygon(T).name}return x};var Rk={};Rk.registerCalculationListeners=function(){var y=this.cy,g=y.collection(),x=this,T=function(O){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(g.merge(O),$)for(var z=0;z<O.length;z++){var S=O[z],V=S._private,U=V.rstyle;U.clean=!1,U.cleanConnected=!1}};x.binder(y).on("bounds.* dirty.*",function(O){var $=O.target;T($)}).on("style.* background.*",function(O){var $=O.target;T($,!1)});var A=function(O){if(O){var $=x.onUpdateEleCalcsFns;g.cleanStyle();for(var z=0;z<g.length;z++){var S=g[z],V=S._private.rstyle;S.isNode()&&!V.cleanConnected&&(T(S.connectedEdges()),V.cleanConnected=!0)}if($)for(var U=0;U<$.length;U++){var tt=$[U];tt(O,g)}x.recalculateRenderedStyle(g),g=y.collection()}};x.flushRenderedStyleQueue=function(){A(!0)},x.beforeRender(A,x.beforeRenderPriorities.eleCalcs)},Rk.onUpdateEleCalcs=function(y){var g=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];g.push(y)},Rk.recalculateRenderedStyle=function(y,g){var x=function(Bt){return Bt._private.rstyle.cleanConnected},T=[],A=[];if(!this.destroyed){g===void 0&&(g=!0);for(var I=0;I<y.length;I++){var O=y[I],$=O._private,z=$.rstyle;O.isEdge()&&(!x(O.source())||!x(O.target()))&&(z.clean=!1),!(g&&z.clean||O.removed())&&O.pstyle("display").value!=="none"&&($.group==="nodes"?A.push(O):T.push(O),z.clean=!0)}for(var S=0;S<A.length;S++){var V=A[S],U=V._private,tt=U.rstyle,at=V.position();this.recalculateNodeLabelProjection(V),tt.nodeX=at.x,tt.nodeY=at.y,tt.nodeW=V.pstyle("width").pfValue,tt.nodeH=V.pstyle("height").pfValue}this.recalculateEdgeProjections(T);for(var ut=0;ut<T.length;ut++){var dt=T[ut],At=dt._private,xt=At.rstyle,Mt=At.rscratch;xt.srcX=Mt.arrowStartX,xt.srcY=Mt.arrowStartY,xt.tgtX=Mt.arrowEndX,xt.tgtY=Mt.arrowEndY,xt.midX=Mt.midX,xt.midY=Mt.midY,xt.labelAngle=Mt.labelAngle,xt.sourceLabelAngle=Mt.sourceLabelAngle,xt.targetLabelAngle=Mt.targetLabelAngle}}};var hT={};hT.updateCachedGrabbedEles=function(){var y=this.cachedZSortedEles;if(y){y.drag=[],y.nondrag=[];for(var g=[],x=0;x<y.length;x++){var T=y[x],A=T._private.rscratch;T.grabbed()&&!T.isParent()?g.push(T):A.inDragLayer?y.drag.push(T):y.nondrag.push(T)}for(var x=0;x<g.length;x++){var T=g[x];y.drag.push(T)}}},hT.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},hT.getCachedZSortedEles=function(y){if(y||!this.cachedZSortedEles){var g=this.cy.mutableElements().toArray();g.sort(cB),g.interactive=g.filter(function(x){return x.interactive()}),this.cachedZSortedEles=g,this.updateCachedGrabbedEles()}else g=this.cachedZSortedEles;return g};var jk={};[M3,lT,ld,Bk,XL,kp,ch,Rk,hT].forEach(function(y){Ke(jk,y)});var BB={};BB.getCachedImage=function(y,g,x){var T=this,A=T.imageCache=T.imageCache||{},I=A[y];if(I)return I.image.complete||I.image.addEventListener("load",x),I.image;I=A[y]=A[y]||{};var O=I.image=new Image;O.addEventListener("load",x),O.addEventListener("error",function(){O.error=!0});var $="data:",z=y.substring(0,$.length).toLowerCase()===$;return z||(O.crossOrigin=g),O.src=y,O};var a6={};a6.registerBinding=function(y,g,x,T){var A=Array.prototype.slice.apply(arguments,[1]),I=this.binder(y);return I.on.apply(I,A)},a6.binder=function(y){var g=this,x=y===window||y===document||y===document.body||ae(y);if(g.supportsPassiveEvents==null){var T=!1;try{var A=Object.defineProperty({},"passive",{get:function(){return T=!0,!0}});window.addEventListener("test",null,A)}catch{}g.supportsPassiveEvents=T}var I=function($,z,S){var V=Array.prototype.slice.call(arguments);return x&&g.supportsPassiveEvents&&(V[2]={capture:S??!1,passive:!1,once:!1}),g.bindings.push({target:y,args:V}),(y.addEventListener||y.on).apply(y,V),this};return{on:I,addEventListener:I,addListener:I,bind:I}},a6.nodeIsDraggable=function(y){return y&&y.isNode()&&!y.locked()&&y.grabbable()},a6.nodeIsGrabbable=function(y){return this.nodeIsDraggable(y)&&y.interactive()},a6.load=function(){var y=this,g=function(Qt){return Qt.selected()},x=function(Qt,Hn,jr,dr){Qt==null&&(Qt=y.cy);for(var gr=0;gr<Hn.length;gr++){var Ga=Hn[gr];Qt.emit({originalEvent:jr,type:Ga,position:dr})}},T=function(Qt){return Qt.shiftKey||Qt.metaKey||Qt.ctrlKey},A=function(Qt,Hn){var jr=!0;if(y.cy.hasCompoundNodes()&&Qt&&Qt.pannable())for(var dr=0;Hn&&dr<Hn.length;dr++){var Qt=Hn[dr];if(Qt.isNode()&&Qt.isParent()&&!Qt.pannable()){jr=!1;break}}else jr=!0;return jr},I=function(Qt){Qt[0]._private.grabbed=!0},O=function(Qt){Qt[0]._private.grabbed=!1},$=function(Qt){Qt[0]._private.rscratch.inDragLayer=!0},z=function(Qt){Qt[0]._private.rscratch.inDragLayer=!1},S=function(Qt){Qt[0]._private.rscratch.isGrabTarget=!0},V=function(Qt){Qt[0]._private.rscratch.isGrabTarget=!1},U=function(Qt,Hn){var jr=Hn.addToList,dr=jr.has(Qt);!dr&&Qt.grabbable()&&!Qt.locked()&&(jr.merge(Qt),I(Qt))},tt=function(Qt,Hn){if(Qt.cy().hasCompoundNodes()&&!(Hn.inDragLayer==null&&Hn.addToList==null)){var jr=Qt.descendants();Hn.inDragLayer&&(jr.forEach($),jr.connectedEdges().forEach($)),Hn.addToList&&U(jr,Hn)}},at=function(Qt,Hn){Hn=Hn||{};var jr=Qt.cy().hasCompoundNodes();Hn.inDragLayer&&(Qt.forEach($),Qt.neighborhood().stdFilter(function(dr){return!jr||dr.isEdge()}).forEach($)),Hn.addToList&&Qt.forEach(function(dr){U(dr,Hn)}),tt(Qt,Hn),At(Qt,{inDragLayer:Hn.inDragLayer}),y.updateCachedGrabbedEles()},ut=at,dt=function(Qt){Qt&&(y.getCachedZSortedEles().forEach(function(Hn){O(Hn),z(Hn),V(Hn)}),y.updateCachedGrabbedEles())},At=function(Qt,Hn){if(!(Hn.inDragLayer==null&&Hn.addToList==null)&&Qt.cy().hasCompoundNodes()){var jr=Qt.ancestors().orphans();if(!jr.same(Qt)){var dr=jr.descendants().spawnSelf().merge(jr).unmerge(Qt).unmerge(Qt.descendants()),gr=dr.connectedEdges();Hn.inDragLayer&&(gr.forEach($),dr.forEach($)),Hn.addToList&&dr.forEach(function(Ga){U(Ga,Hn)})}}},xt=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},Mt=typeof MutationObserver<"u",Dt=typeof ResizeObserver<"u";Mt?(y.removeObserver=new MutationObserver(function(Fr){for(var Qt=0;Qt<Fr.length;Qt++){var Hn=Fr[Qt],jr=Hn.removedNodes;if(jr)for(var dr=0;dr<jr.length;dr++){var gr=jr[dr];if(gr===y.container){y.destroy();break}}}}),y.container.parentNode&&y.removeObserver.observe(y.container.parentNode,{childList:!0})):y.registerBinding(y.container,"DOMNodeRemoved",function(Fr){y.destroy()});var Bt=um(function(){y.cy.resize()},100);Mt&&(y.styleObserver=new MutationObserver(Bt),y.styleObserver.observe(y.container,{attributes:!0})),y.registerBinding(window,"resize",Bt),Dt&&(y.resizeObserver=new ResizeObserver(Bt),y.resizeObserver.observe(y.container));var Zt=function(Qt,Hn){for(;Qt!=null;)Hn(Qt),Qt=Qt.parentNode},Kt=function(){y.invalidateContainerClientCoordsCache()};Zt(y.container,function(Fr){y.registerBinding(Fr,"transitionend",Kt),y.registerBinding(Fr,"animationend",Kt),y.registerBinding(Fr,"scroll",Kt)}),y.registerBinding(y.container,"contextmenu",function(Fr){Fr.preventDefault()});var $t=function(){return y.selection[4]!==0},ee=function(Qt){for(var Hn=y.findContainerClientCoords(),jr=Hn[0],dr=Hn[1],gr=Hn[2],Ga=Hn[3],Zr=Qt.touches?Qt.touches:[Qt],us=!1,Ko=0;Ko<Zr.length;Ko++){var Vc=Zr[Ko];if(jr<=Vc.clientX&&Vc.clientX<=jr+gr&&dr<=Vc.clientY&&Vc.clientY<=dr+Ga){us=!0;break}}if(!us)return!1;for(var ho=y.container,Ic=Qt.target,Ba=Ic.parentNode,fo=!1;Ba;){if(Ba===ho){fo=!0;break}Ba=Ba.parentNode}return!!fo};y.registerBinding(y.container,"mousedown",function(Qt){if(ee(Qt)){Qt.preventDefault(),xt(),y.hoverData.capture=!0,y.hoverData.which=Qt.which;var Hn=y.cy,jr=[Qt.clientX,Qt.clientY],dr=y.projectIntoViewport(jr[0],jr[1]),gr=y.selection,Ga=y.findNearestElements(dr[0],dr[1],!0,!1),Zr=Ga[0],us=y.dragData.possibleDragElements;y.hoverData.mdownPos=dr,y.hoverData.mdownGPos=jr;var Ko=function(){y.hoverData.tapholdCancelled=!1,clearTimeout(y.hoverData.tapholdTimeout),y.hoverData.tapholdTimeout=setTimeout(function(){if(!y.hoverData.tapholdCancelled){var Sl=y.hoverData.down;Sl?Sl.emit({originalEvent:Qt,type:"taphold",position:{x:dr[0],y:dr[1]}}):Hn.emit({originalEvent:Qt,type:"taphold",position:{x:dr[0],y:dr[1]}})}},y.tapholdDuration)};if(Qt.which==3){y.hoverData.cxtStarted=!0;var Vc={originalEvent:Qt,type:"cxttapstart",position:{x:dr[0],y:dr[1]}};Zr?(Zr.activate(),Zr.emit(Vc),y.hoverData.down=Zr):Hn.emit(Vc),y.hoverData.downTime=new Date().getTime(),y.hoverData.cxtDragged=!1}else if(Qt.which==1){Zr&&Zr.activate();{if(Zr!=null&&y.nodeIsGrabbable(Zr)){var ho=function(Sl){return{originalEvent:Qt,type:Sl,position:{x:dr[0],y:dr[1]}}},Ic=function(Sl){Sl.emit(ho("grab"))};if(S(Zr),!Zr.selected())us=y.dragData.possibleDragElements=Hn.collection(),ut(Zr,{addToList:us}),Zr.emit(ho("grabon")).emit(ho("grab"));else{us=y.dragData.possibleDragElements=Hn.collection();var Ba=Hn.$(function(fo){return fo.isNode()&&fo.selected()&&y.nodeIsGrabbable(fo)});at(Ba,{addToList:us}),Zr.emit(ho("grabon")),Ba.forEach(Ic)}y.redrawHint("eles",!0),y.redrawHint("drag",!0)}y.hoverData.down=Zr,y.hoverData.downs=Ga,y.hoverData.downTime=new Date().getTime()}x(Zr,["mousedown","tapstart","vmousedown"],Qt,{x:dr[0],y:dr[1]}),Zr==null?(gr[4]=1,y.data.bgActivePosistion={x:dr[0],y:dr[1]},y.redrawHint("select",!0),y.redraw()):Zr.pannable()&&(gr[4]=1),Ko()}gr[0]=gr[2]=dr[0],gr[1]=gr[3]=dr[1]}},!1),y.registerBinding(window,"mousemove",function(Qt){var Hn=y.hoverData.capture;if(!(!Hn&&!ee(Qt))){var jr=!1,dr=y.cy,gr=dr.zoom(),Ga=[Qt.clientX,Qt.clientY],Zr=y.projectIntoViewport(Ga[0],Ga[1]),us=y.hoverData.mdownPos,Ko=y.hoverData.mdownGPos,Vc=y.selection,ho=null;!y.hoverData.draggingEles&&!y.hoverData.dragging&&!y.hoverData.selecting&&(ho=y.findNearestElement(Zr[0],Zr[1],!0,!1));var Ic=y.hoverData.last,Ba=y.hoverData.down,fo=[Zr[0]-Vc[2],Zr[1]-Vc[3]],Sl=y.dragData.possibleDragElements,Wf;if(Ko){var Ep=Ga[0]-Ko[0],Tp=Ep*Ep,Kf=Ga[1]-Ko[1],mg=Kf*Kf,hd=Tp+mg;y.hoverData.isOverThresholdDrag=Wf=hd>=y.desktopTapThreshold2}var dv=T(Qt);Wf&&(y.hoverData.tapholdCancelled=!0);var Tm=function(){var q2=y.hoverData.dragDelta=y.hoverData.dragDelta||[];q2.length===0?(q2.push(fo[0]),q2.push(fo[1])):(q2[0]+=fo[0],q2[1]+=fo[1])};jr=!0,x(ho,["mousemove","vmousemove","tapdrag"],Qt,{x:Zr[0],y:Zr[1]});var d6=function(){y.data.bgActivePosistion=void 0,y.hoverData.selecting||dr.emit({originalEvent:Qt,type:"boxstart",position:{x:Zr[0],y:Zr[1]}}),Vc[4]=1,y.hoverData.selecting=!0,y.redrawHint("select",!0),y.redraw()};if(y.hoverData.which===3){if(Wf){var P3={originalEvent:Qt,type:"cxtdrag",position:{x:Zr[0],y:Zr[1]}};Ba?Ba.emit(P3):dr.emit(P3),y.hoverData.cxtDragged=!0,(!y.hoverData.cxtOver||ho!==y.hoverData.cxtOver)&&(y.hoverData.cxtOver&&y.hoverData.cxtOver.emit({originalEvent:Qt,type:"cxtdragout",position:{x:Zr[0],y:Zr[1]}}),y.hoverData.cxtOver=ho,ho&&ho.emit({originalEvent:Qt,type:"cxtdragover",position:{x:Zr[0],y:Zr[1]}}))}}else if(y.hoverData.dragging){if(jr=!0,dr.panningEnabled()&&dr.userPanningEnabled()){var g6;if(y.hoverData.justStartedPan){var mT=y.hoverData.mdownPos;g6={x:(Zr[0]-mT[0])*gr,y:(Zr[1]-mT[1])*gr},y.hoverData.justStartedPan=!1}else g6={x:fo[0]*gr,y:fo[1]*gr};dr.panBy(g6),dr.emit("dragpan"),y.hoverData.dragged=!0}Zr=y.projectIntoViewport(Qt.clientX,Qt.clientY)}else if(Vc[4]==1&&(Ba==null||Ba.pannable())){if(Wf){if(!y.hoverData.dragging&&dr.boxSelectionEnabled()&&(dv||!dr.panningEnabled()||!dr.userPanningEnabled()))d6();else if(!y.hoverData.selecting&&dr.panningEnabled()&&dr.userPanningEnabled()){var N3=A(Ba,y.hoverData.downs);N3&&(y.hoverData.dragging=!0,y.hoverData.justStartedPan=!0,Vc[4]=0,y.data.bgActivePosistion=z5(us),y.redrawHint("select",!0),y.redraw())}Ba&&Ba.pannable()&&Ba.active()&&Ba.unactivate()}}else{if(Ba&&Ba.pannable()&&Ba.active()&&Ba.unactivate(),(!Ba||!Ba.grabbed())&&ho!=Ic&&(Ic&&x(Ic,["mouseout","tapdragout"],Qt,{x:Zr[0],y:Zr[1]}),ho&&x(ho,["mouseover","tapdragover"],Qt,{x:Zr[0],y:Zr[1]}),y.hoverData.last=ho),Ba)if(Wf){if(dr.boxSelectionEnabled()&&dv)Ba&&Ba.grabbed()&&(dt(Sl),Ba.emit("freeon"),Sl.emit("free"),y.dragData.didDrag&&(Ba.emit("dragfreeon"),Sl.emit("dragfree"))),d6();else if(Ba&&Ba.grabbed()&&y.nodeIsDraggable(Ba)){var Hd=!y.dragData.didDrag;Hd&&y.redrawHint("eles",!0),y.dragData.didDrag=!0,y.hoverData.draggingEles||at(Sl,{inDragLayer:!0});var C1={x:0,y:0};if(rt(fo[0])&&rt(fo[1])&&(C1.x+=fo[0],C1.y+=fo[1],Hd)){var Vd=y.hoverData.dragDelta;Vd&&rt(Vd[0])&&rt(Vd[1])&&(C1.x+=Vd[0],C1.y+=Vd[1])}y.hoverData.draggingEles=!0,Sl.silentShift(C1).emit("position drag"),y.redrawHint("drag",!0),y.redraw()}}else Tm();jr=!0}if(Vc[2]=Zr[0],Vc[3]=Zr[1],jr)return Qt.stopPropagation&&Qt.stopPropagation(),Qt.preventDefault&&Qt.preventDefault(),!1}},!1);var Ht,ge,be;y.registerBinding(window,"mouseup",function(Qt){var Hn=y.hoverData.capture;if(Hn){y.hoverData.capture=!1;var jr=y.cy,dr=y.projectIntoViewport(Qt.clientX,Qt.clientY),gr=y.selection,Ga=y.findNearestElement(dr[0],dr[1],!0,!1),Zr=y.dragData.possibleDragElements,us=y.hoverData.down,Ko=T(Qt);if(y.data.bgActivePosistion&&(y.redrawHint("select",!0),y.redraw()),y.hoverData.tapholdCancelled=!0,y.data.bgActivePosistion=void 0,us&&us.unactivate(),y.hoverData.which===3){var Vc={originalEvent:Qt,type:"cxttapend",position:{x:dr[0],y:dr[1]}};if(us?us.emit(Vc):jr.emit(Vc),!y.hoverData.cxtDragged){var ho={originalEvent:Qt,type:"cxttap",position:{x:dr[0],y:dr[1]}};us?us.emit(ho):jr.emit(ho)}y.hoverData.cxtDragged=!1,y.hoverData.which=null}else if(y.hoverData.which===1){if(x(Ga,["mouseup","tapend","vmouseup"],Qt,{x:dr[0],y:dr[1]}),!y.dragData.didDrag&&!y.hoverData.dragged&&!y.hoverData.selecting&&!y.hoverData.isOverThresholdDrag&&(x(us,["click","tap","vclick"],Qt,{x:dr[0],y:dr[1]}),ge=!1,Qt.timeStamp-be<=jr.multiClickDebounceTime()?(Ht&&clearTimeout(Ht),ge=!0,be=null,x(us,["dblclick","dbltap","vdblclick"],Qt,{x:dr[0],y:dr[1]})):(Ht=setTimeout(function(){ge||x(us,["oneclick","onetap","voneclick"],Qt,{x:dr[0],y:dr[1]})},jr.multiClickDebounceTime()),be=Qt.timeStamp)),us==null&&!y.dragData.didDrag&&!y.hoverData.selecting&&!y.hoverData.dragged&&!T(Qt)&&(jr.$(g).unselect(["tapunselect"]),Zr.length>0&&y.redrawHint("eles",!0),y.dragData.possibleDragElements=Zr=jr.collection()),Ga==us&&!y.dragData.didDrag&&!y.hoverData.selecting&&Ga!=null&&Ga._private.selectable&&(y.hoverData.dragging||(jr.selectionType()==="additive"||Ko?Ga.selected()?Ga.unselect(["tapunselect"]):Ga.select(["tapselect"]):Ko||(jr.$(g).unmerge(Ga).unselect(["tapunselect"]),Ga.select(["tapselect"]))),y.redrawHint("eles",!0)),y.hoverData.selecting){var Ic=jr.collection(y.getAllInBox(gr[0],gr[1],gr[2],gr[3]));y.redrawHint("select",!0),Ic.length>0&&y.redrawHint("eles",!0),jr.emit({type:"boxend",originalEvent:Qt,position:{x:dr[0],y:dr[1]}});var Ba=function(Wf){return Wf.selectable()&&!Wf.selected()};jr.selectionType()==="additive"||Ko||jr.$(g).unmerge(Ic).unselect(),Ic.emit("box").stdFilter(Ba).select().emit("boxselect"),y.redraw()}if(y.hoverData.dragging&&(y.hoverData.dragging=!1,y.redrawHint("select",!0),y.redrawHint("eles",!0),y.redraw()),!gr[4]){y.redrawHint("drag",!0),y.redrawHint("eles",!0);var fo=us&&us.grabbed();dt(Zr),fo&&(us.emit("freeon"),Zr.emit("free"),y.dragData.didDrag&&(us.emit("dragfreeon"),Zr.emit("dragfree")))}}gr[4]=0,y.hoverData.down=null,y.hoverData.cxtStarted=!1,y.hoverData.draggingEles=!1,y.hoverData.selecting=!1,y.hoverData.isOverThresholdDrag=!1,y.dragData.didDrag=!1,y.hoverData.dragged=!1,y.hoverData.dragDelta=[],y.hoverData.mdownPos=null,y.hoverData.mdownGPos=null}},!1);var re=function(Qt){if(!y.scrollingPage){var Hn=y.cy,jr=Hn.zoom(),dr=Hn.pan(),gr=y.projectIntoViewport(Qt.clientX,Qt.clientY),Ga=[gr[0]*jr+dr.x,gr[1]*jr+dr.y];if(y.hoverData.draggingEles||y.hoverData.dragging||y.hoverData.cxtStarted||$t()){Qt.preventDefault();return}if(Hn.panningEnabled()&&Hn.userPanningEnabled()&&Hn.zoomingEnabled()&&Hn.userZoomingEnabled()){Qt.preventDefault(),y.data.wheelZooming=!0,clearTimeout(y.data.wheelTimeout),y.data.wheelTimeout=setTimeout(function(){y.data.wheelZooming=!1,y.redrawHint("eles",!0),y.redraw()},150);var Zr;Qt.deltaY!=null?Zr=Qt.deltaY/-250:Qt.wheelDeltaY!=null?Zr=Qt.wheelDeltaY/1e3:Zr=Qt.wheelDelta/1e3,Zr=Zr*y.wheelSensitivity;var us=Qt.deltaMode===1;us&&(Zr*=33);var Ko=Hn.zoom()*Math.pow(10,Zr);Qt.type==="gesturechange"&&(Ko=y.gestureStartZoom*Qt.scale),Hn.zoom({level:Ko,renderedPosition:{x:Ga[0],y:Ga[1]}}),Hn.emit(Qt.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};y.registerBinding(y.container,"wheel",re,!0),y.registerBinding(window,"scroll",function(Qt){y.scrollingPage=!0,clearTimeout(y.scrollingPageTimeout),y.scrollingPageTimeout=setTimeout(function(){y.scrollingPage=!1},250)},!0),y.registerBinding(y.container,"gesturestart",function(Qt){y.gestureStartZoom=y.cy.zoom(),y.hasTouchStarted||Qt.preventDefault()},!0),y.registerBinding(y.container,"gesturechange",function(Fr){y.hasTouchStarted||re(Fr)},!0),y.registerBinding(y.container,"mouseout",function(Qt){var Hn=y.projectIntoViewport(Qt.clientX,Qt.clientY);y.cy.emit({originalEvent:Qt,type:"mouseout",position:{x:Hn[0],y:Hn[1]}})},!1),y.registerBinding(y.container,"mouseover",function(Qt){var Hn=y.projectIntoViewport(Qt.clientX,Qt.clientY);y.cy.emit({originalEvent:Qt,type:"mouseover",position:{x:Hn[0],y:Hn[1]}})},!1);var Ne,ve,fn,$e,qe,xn,Pn,er,Sn,Jn,fr,Sr,wr,cr=function(Qt,Hn,jr,dr){return Math.sqrt((jr-Qt)*(jr-Qt)+(dr-Hn)*(dr-Hn))},bn=function(Qt,Hn,jr,dr){return(jr-Qt)*(jr-Qt)+(dr-Hn)*(dr-Hn)},Tr;y.registerBinding(y.container,"touchstart",Tr=function(Qt){if(y.hasTouchStarted=!0,!!ee(Qt)){xt(),y.touchData.capture=!0,y.data.bgActivePosistion=void 0;var Hn=y.cy,jr=y.touchData.now,dr=y.touchData.earlier;if(Qt.touches[0]){var gr=y.projectIntoViewport(Qt.touches[0].clientX,Qt.touches[0].clientY);jr[0]=gr[0],jr[1]=gr[1]}if(Qt.touches[1]){var gr=y.projectIntoViewport(Qt.touches[1].clientX,Qt.touches[1].clientY);jr[2]=gr[0],jr[3]=gr[1]}if(Qt.touches[2]){var gr=y.projectIntoViewport(Qt.touches[2].clientX,Qt.touches[2].clientY);jr[4]=gr[0],jr[5]=gr[1]}if(Qt.touches[1]){y.touchData.singleTouchMoved=!0,dt(y.dragData.touchDragEles);var Ga=y.findContainerClientCoords();Sn=Ga[0],Jn=Ga[1],fr=Ga[2],Sr=Ga[3],Ne=Qt.touches[0].clientX-Sn,ve=Qt.touches[0].clientY-Jn,fn=Qt.touches[1].clientX-Sn,$e=Qt.touches[1].clientY-Jn,wr=0<=Ne&&Ne<=fr&&0<=fn&&fn<=fr&&0<=ve&&ve<=Sr&&0<=$e&&$e<=Sr;var Zr=Hn.pan(),us=Hn.zoom();qe=cr(Ne,ve,fn,$e),xn=bn(Ne,ve,fn,$e),Pn=[(Ne+fn)/2,(ve+$e)/2],er=[(Pn[0]-Zr.x)/us,(Pn[1]-Zr.y)/us];var Ko=200,Vc=Ko*Ko;if(xn<Vc&&!Qt.touches[2]){var ho=y.findNearestElement(jr[0],jr[1],!0,!0),Ic=y.findNearestElement(jr[2],jr[3],!0,!0);ho&&ho.isNode()?(ho.activate().emit({originalEvent:Qt,type:"cxttapstart",position:{x:jr[0],y:jr[1]}}),y.touchData.start=ho):Ic&&Ic.isNode()?(Ic.activate().emit({originalEvent:Qt,type:"cxttapstart",position:{x:jr[0],y:jr[1]}}),y.touchData.start=Ic):Hn.emit({originalEvent:Qt,type:"cxttapstart",position:{x:jr[0],y:jr[1]}}),y.touchData.start&&(y.touchData.start._private.grabbed=!1),y.touchData.cxt=!0,y.touchData.cxtDragged=!1,y.data.bgActivePosistion=void 0,y.redraw();return}}if(Qt.touches[2])Hn.boxSelectionEnabled()&&Qt.preventDefault();else if(!Qt.touches[1]){if(Qt.touches[0]){var Ba=y.findNearestElements(jr[0],jr[1],!0,!0),fo=Ba[0];if(fo!=null&&(fo.activate(),y.touchData.start=fo,y.touchData.starts=Ba,y.nodeIsGrabbable(fo))){var Sl=y.dragData.touchDragEles=Hn.collection(),Wf=null;y.redrawHint("eles",!0),y.redrawHint("drag",!0),fo.selected()?(Wf=Hn.$(function(hd){return hd.selected()&&y.nodeIsGrabbable(hd)}),at(Wf,{addToList:Sl})):ut(fo,{addToList:Sl}),S(fo);var Ep=function(dv){return{originalEvent:Qt,type:dv,position:{x:jr[0],y:jr[1]}}};fo.emit(Ep("grabon")),Wf?Wf.forEach(function(hd){hd.emit(Ep("grab"))}):fo.emit(Ep("grab"))}x(fo,["touchstart","tapstart","vmousedown"],Qt,{x:jr[0],y:jr[1]}),fo==null&&(y.data.bgActivePosistion={x:gr[0],y:gr[1]},y.redrawHint("select",!0),y.redraw()),y.touchData.singleTouchMoved=!1,y.touchData.singleTouchStartTime=+new Date,clearTimeout(y.touchData.tapholdTimeout),y.touchData.tapholdTimeout=setTimeout(function(){y.touchData.singleTouchMoved===!1&&!y.pinching&&!y.touchData.selecting&&x(y.touchData.start,["taphold"],Qt,{x:jr[0],y:jr[1]})},y.tapholdDuration)}}if(Qt.touches.length>=1){for(var Tp=y.touchData.startPosition=[],Kf=0;Kf<jr.length;Kf++)Tp[Kf]=dr[Kf]=jr[Kf];var mg=Qt.touches[0];y.touchData.startGPosition=[mg.clientX,mg.clientY]}}},!1);var xr;y.registerBinding(window,"touchmove",xr=function(Qt){var Hn=y.touchData.capture;if(!(!Hn&&!ee(Qt))){var jr=y.selection,dr=y.cy,gr=y.touchData.now,Ga=y.touchData.earlier,Zr=dr.zoom();if(Qt.touches[0]){var us=y.projectIntoViewport(Qt.touches[0].clientX,Qt.touches[0].clientY);gr[0]=us[0],gr[1]=us[1]}if(Qt.touches[1]){var us=y.projectIntoViewport(Qt.touches[1].clientX,Qt.touches[1].clientY);gr[2]=us[0],gr[3]=us[1]}if(Qt.touches[2]){var us=y.projectIntoViewport(Qt.touches[2].clientX,Qt.touches[2].clientY);gr[4]=us[0],gr[5]=us[1]}var Ko=y.touchData.startGPosition,Vc;if(Hn&&Qt.touches[0]&&Ko){for(var ho=[],Ic=0;Ic<gr.length;Ic++)ho[Ic]=gr[Ic]-Ga[Ic];var Ba=Qt.touches[0].clientX-Ko[0],fo=Ba*Ba,Sl=Qt.touches[0].clientY-Ko[1],Wf=Sl*Sl,Ep=fo+Wf;Vc=Ep>=y.touchTapThreshold2}if(Hn&&y.touchData.cxt){Qt.preventDefault();var Tp=Qt.touches[0].clientX-Sn,Kf=Qt.touches[0].clientY-Jn,mg=Qt.touches[1].clientX-Sn,hd=Qt.touches[1].clientY-Jn,dv=bn(Tp,Kf,mg,hd),Tm=dv/xn,d6=150,P3=d6*d6,g6=1.5,mT=g6*g6;if(Tm>=mT||dv>=P3){y.touchData.cxt=!1,y.data.bgActivePosistion=void 0,y.redrawHint("select",!0);var N3={originalEvent:Qt,type:"cxttapend",position:{x:gr[0],y:gr[1]}};y.touchData.start?(y.touchData.start.unactivate().emit(N3),y.touchData.start=null):dr.emit(N3)}}if(Hn&&y.touchData.cxt){var N3={originalEvent:Qt,type:"cxtdrag",position:{x:gr[0],y:gr[1]}};y.data.bgActivePosistion=void 0,y.redrawHint("select",!0),y.touchData.start?y.touchData.start.emit(N3):dr.emit(N3),y.touchData.start&&(y.touchData.start._private.grabbed=!1),y.touchData.cxtDragged=!0;var Hd=y.findNearestElement(gr[0],gr[1],!0,!0);(!y.touchData.cxtOver||Hd!==y.touchData.cxtOver)&&(y.touchData.cxtOver&&y.touchData.cxtOver.emit({originalEvent:Qt,type:"cxtdragout",position:{x:gr[0],y:gr[1]}}),y.touchData.cxtOver=Hd,Hd&&Hd.emit({originalEvent:Qt,type:"cxtdragover",position:{x:gr[0],y:gr[1]}}))}else if(Hn&&Qt.touches[2]&&dr.boxSelectionEnabled())Qt.preventDefault(),y.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,y.touchData.selecting||dr.emit({originalEvent:Qt,type:"boxstart",position:{x:gr[0],y:gr[1]}}),y.touchData.selecting=!0,y.touchData.didSelect=!0,jr[4]=1,!jr||jr.length===0||jr[0]===void 0?(jr[0]=(gr[0]+gr[2]+gr[4])/3,jr[1]=(gr[1]+gr[3]+gr[5])/3,jr[2]=(gr[0]+gr[2]+gr[4])/3+1,jr[3]=(gr[1]+gr[3]+gr[5])/3+1):(jr[2]=(gr[0]+gr[2]+gr[4])/3,jr[3]=(gr[1]+gr[3]+gr[5])/3),y.redrawHint("select",!0),y.redraw();else if(Hn&&Qt.touches[1]&&!y.touchData.didSelect&&dr.zoomingEnabled()&&dr.panningEnabled()&&dr.userZoomingEnabled()&&dr.userPanningEnabled()){Qt.preventDefault(),y.data.bgActivePosistion=void 0,y.redrawHint("select",!0);var C1=y.dragData.touchDragEles;if(C1){y.redrawHint("drag",!0);for(var Vd=0;Vd<C1.length;Vd++){var yT=C1[Vd]._private;yT.grabbed=!1,yT.rscratch.inDragLayer=!1}}var q2=y.touchData.start,Tp=Qt.touches[0].clientX-Sn,Kf=Qt.touches[0].clientY-Jn,mg=Qt.touches[1].clientX-Sn,hd=Qt.touches[1].clientY-Jn,YB=cr(Tp,Kf,mg,hd),ytt=YB/qe;if(wr){var xtt=Tp-Ne,ktt=Kf-ve,Ett=mg-fn,Ttt=hd-$e,_tt=(xtt+Ett)/2,Ctt=(ktt+Ttt)/2,Uk=dr.zoom(),aM=Uk*ytt,xT=dr.pan(),XB=er[0]*Uk+xT.x,QB=er[1]*Uk+xT.y,Stt={x:-aM/Uk*(XB-xT.x-_tt)+XB,y:-aM/Uk*(QB-xT.y-Ctt)+QB};if(q2&&q2.active()){var C1=y.dragData.touchDragEles;dt(C1),y.redrawHint("drag",!0),y.redrawHint("eles",!0),q2.unactivate().emit("freeon"),C1.emit("free"),y.dragData.didDrag&&(q2.emit("dragfreeon"),C1.emit("dragfree"))}dr.viewport({zoom:aM,pan:Stt,cancelOnFailedZoom:!0}),dr.emit("pinchzoom"),qe=YB,Ne=Tp,ve=Kf,fn=mg,$e=hd,y.pinching=!0}if(Qt.touches[0]){var us=y.projectIntoViewport(Qt.touches[0].clientX,Qt.touches[0].clientY);gr[0]=us[0],gr[1]=us[1]}if(Qt.touches[1]){var us=y.projectIntoViewport(Qt.touches[1].clientX,Qt.touches[1].clientY);gr[2]=us[0],gr[3]=us[1]}if(Qt.touches[2]){var us=y.projectIntoViewport(Qt.touches[2].clientX,Qt.touches[2].clientY);gr[4]=us[0],gr[5]=us[1]}}else if(Qt.touches[0]&&!y.touchData.didSelect){var _p=y.touchData.start,oM=y.touchData.last,Hd;if(!y.hoverData.draggingEles&&!y.swipePanning&&(Hd=y.findNearestElement(gr[0],gr[1],!0,!0)),Hn&&_p!=null&&Qt.preventDefault(),Hn&&_p!=null&&y.nodeIsDraggable(_p))if(Vc){var C1=y.dragData.touchDragEles,ZB=!y.dragData.didDrag;ZB&&at(C1,{inDragLayer:!0}),y.dragData.didDrag=!0;var Wk={x:0,y:0};if(rt(ho[0])&&rt(ho[1])&&(Wk.x+=ho[0],Wk.y+=ho[1],ZB)){y.redrawHint("eles",!0);var Cp=y.touchData.dragDelta;Cp&&rt(Cp[0])&&rt(Cp[1])&&(Wk.x+=Cp[0],Wk.y+=Cp[1])}y.hoverData.draggingEles=!0,C1.silentShift(Wk).emit("position drag"),y.redrawHint("drag",!0),y.touchData.startPosition[0]==Ga[0]&&y.touchData.startPosition[1]==Ga[1]&&y.redrawHint("eles",!0),y.redraw()}else{var Cp=y.touchData.dragDelta=y.touchData.dragDelta||[];Cp.length===0?(Cp.push(ho[0]),Cp.push(ho[1])):(Cp[0]+=ho[0],Cp[1]+=ho[1])}if(x(_p||Hd,["touchmove","tapdrag","vmousemove"],Qt,{x:gr[0],y:gr[1]}),(!_p||!_p.grabbed())&&Hd!=oM&&(oM&&oM.emit({originalEvent:Qt,type:"tapdragout",position:{x:gr[0],y:gr[1]}}),Hd&&Hd.emit({originalEvent:Qt,type:"tapdragover",position:{x:gr[0],y:gr[1]}})),y.touchData.last=Hd,Hn)for(var Vd=0;Vd<gr.length;Vd++)gr[Vd]&&y.touchData.startPosition[Vd]&&Vc&&(y.touchData.singleTouchMoved=!0);if(Hn&&(_p==null||_p.pannable())&&dr.panningEnabled()&&dr.userPanningEnabled()){var Att=A(_p,y.touchData.starts);Att&&(Qt.preventDefault(),y.data.bgActivePosistion||(y.data.bgActivePosistion=z5(y.touchData.startPosition)),y.swipePanning?(dr.panBy({x:ho[0]*Zr,y:ho[1]*Zr}),dr.emit("dragpan")):Vc&&(y.swipePanning=!0,dr.panBy({x:Ba*Zr,y:Sl*Zr}),dr.emit("dragpan"),_p&&(_p.unactivate(),y.redrawHint("select",!0),y.touchData.start=null)));var us=y.projectIntoViewport(Qt.touches[0].clientX,Qt.touches[0].clientY);gr[0]=us[0],gr[1]=us[1]}}for(var Ic=0;Ic<gr.length;Ic++)Ga[Ic]=gr[Ic];Hn&&Qt.touches.length>0&&!y.hoverData.draggingEles&&!y.swipePanning&&y.data.bgActivePosistion!=null&&(y.data.bgActivePosistion=void 0,y.redrawHint("select",!0),y.redraw())}},!1);var fi;y.registerBinding(window,"touchcancel",fi=function(Qt){var Hn=y.touchData.start;y.touchData.capture=!1,Hn&&Hn.unactivate()});var Ii,oa,Fa,Fi;if(y.registerBinding(window,"touchend",Ii=function(Qt){var Hn=y.touchData.start,jr=y.touchData.capture;if(jr)Qt.touches.length===0&&(y.touchData.capture=!1),Qt.preventDefault();else return;var dr=y.selection;y.swipePanning=!1,y.hoverData.draggingEles=!1;var gr=y.cy,Ga=gr.zoom(),Zr=y.touchData.now,us=y.touchData.earlier;if(Qt.touches[0]){var Ko=y.projectIntoViewport(Qt.touches[0].clientX,Qt.touches[0].clientY);Zr[0]=Ko[0],Zr[1]=Ko[1]}if(Qt.touches[1]){var Ko=y.projectIntoViewport(Qt.touches[1].clientX,Qt.touches[1].clientY);Zr[2]=Ko[0],Zr[3]=Ko[1]}if(Qt.touches[2]){var Ko=y.projectIntoViewport(Qt.touches[2].clientX,Qt.touches[2].clientY);Zr[4]=Ko[0],Zr[5]=Ko[1]}Hn&&Hn.unactivate();var Vc;if(y.touchData.cxt){if(Vc={originalEvent:Qt,type:"cxttapend",position:{x:Zr[0],y:Zr[1]}},Hn?Hn.emit(Vc):gr.emit(Vc),!y.touchData.cxtDragged){var ho={originalEvent:Qt,type:"cxttap",position:{x:Zr[0],y:Zr[1]}};Hn?Hn.emit(ho):gr.emit(ho)}y.touchData.start&&(y.touchData.start._private.grabbed=!1),y.touchData.cxt=!1,y.touchData.start=null,y.redraw();return}if(!Qt.touches[2]&&gr.boxSelectionEnabled()&&y.touchData.selecting){y.touchData.selecting=!1;var Ic=gr.collection(y.getAllInBox(dr[0],dr[1],dr[2],dr[3]));dr[0]=void 0,dr[1]=void 0,dr[2]=void 0,dr[3]=void 0,dr[4]=0,y.redrawHint("select",!0),gr.emit({type:"boxend",originalEvent:Qt,position:{x:Zr[0],y:Zr[1]}});var Ba=function(P3){return P3.selectable()&&!P3.selected()};Ic.emit("box").stdFilter(Ba).select().emit("boxselect"),Ic.nonempty()&&y.redrawHint("eles",!0),y.redraw()}if(Hn!=null&&Hn.unactivate(),Qt.touches[2])y.data.bgActivePosistion=void 0,y.redrawHint("select",!0);else if(!Qt.touches[1]){if(!Qt.touches[0]){if(!Qt.touches[0]){y.data.bgActivePosistion=void 0,y.redrawHint("select",!0);var fo=y.dragData.touchDragEles;if(Hn!=null){var Sl=Hn._private.grabbed;dt(fo),y.redrawHint("drag",!0),y.redrawHint("eles",!0),Sl&&(Hn.emit("freeon"),fo.emit("free"),y.dragData.didDrag&&(Hn.emit("dragfreeon"),fo.emit("dragfree"))),x(Hn,["touchend","tapend","vmouseup","tapdragout"],Qt,{x:Zr[0],y:Zr[1]}),Hn.unactivate(),y.touchData.start=null}else{var Wf=y.findNearestElement(Zr[0],Zr[1],!0,!0);x(Wf,["touchend","tapend","vmouseup","tapdragout"],Qt,{x:Zr[0],y:Zr[1]})}var Ep=y.touchData.startPosition[0]-Zr[0],Tp=Ep*Ep,Kf=y.touchData.startPosition[1]-Zr[1],mg=Kf*Kf,hd=Tp+mg,dv=hd*Ga*Ga;y.touchData.singleTouchMoved||(Hn||gr.$(":selected").unselect(["tapunselect"]),x(Hn,["tap","vclick"],Qt,{x:Zr[0],y:Zr[1]}),oa=!1,Qt.timeStamp-Fi<=gr.multiClickDebounceTime()?(Fa&&clearTimeout(Fa),oa=!0,Fi=null,x(Hn,["dbltap","vdblclick"],Qt,{x:Zr[0],y:Zr[1]})):(Fa=setTimeout(function(){oa||x(Hn,["onetap","voneclick"],Qt,{x:Zr[0],y:Zr[1]})},gr.multiClickDebounceTime()),Fi=Qt.timeStamp)),Hn!=null&&!y.dragData.didDrag&&Hn._private.selectable&&dv<y.touchTapThreshold2&&!y.pinching&&(gr.selectionType()==="single"?(gr.$(g).unmerge(Hn).unselect(["tapunselect"]),Hn.select(["tapselect"])):Hn.selected()?Hn.unselect(["tapunselect"]):Hn.select(["tapselect"]),y.redrawHint("eles",!0)),y.touchData.singleTouchMoved=!0}}}for(var Tm=0;Tm<Zr.length;Tm++)us[Tm]=Zr[Tm];y.dragData.didDrag=!1,Qt.touches.length===0&&(y.touchData.dragDelta=[],y.touchData.startPosition=null,y.touchData.startGPosition=null,y.touchData.didSelect=!1),Qt.touches.length<2&&(Qt.touches.length===1&&(y.touchData.startGPosition=[Qt.touches[0].clientX,Qt.touches[0].clientY]),y.pinching=!1,y.redrawHint("eles",!0),y.redraw())},!1),typeof TouchEvent>"u"){var Ci=[],Ls=function(Qt){return{clientX:Qt.clientX,clientY:Qt.clientY,force:1,identifier:Qt.pointerId,pageX:Qt.pageX,pageY:Qt.pageY,radiusX:Qt.width/2,radiusY:Qt.height/2,screenX:Qt.screenX,screenY:Qt.screenY,target:Qt.target}},es=function(Qt){return{event:Qt,touch:Ls(Qt)}},Ri=function(Qt){Ci.push(es(Qt))},as=function(Qt){for(var Hn=0;Hn<Ci.length;Hn++){var jr=Ci[Hn];if(jr.event.pointerId===Qt.pointerId){Ci.splice(Hn,1);return}}},no=function(Qt){var Hn=Ci.filter(function(jr){return jr.event.pointerId===Qt.pointerId})[0];Hn.event=Qt,Hn.touch=Ls(Qt)},ca=function(Qt){Qt.touches=Ci.map(function(Hn){return Hn.touch})},ea=function(Qt){return Qt.pointerType==="mouse"||Qt.pointerType===4};y.registerBinding(y.container,"pointerdown",function(Fr){ea(Fr)||(Fr.preventDefault(),Ri(Fr),ca(Fr),Tr(Fr))}),y.registerBinding(y.container,"pointerup",function(Fr){ea(Fr)||(as(Fr),ca(Fr),Ii(Fr))}),y.registerBinding(y.container,"pointercancel",function(Fr){ea(Fr)||(as(Fr),ca(Fr),fi(Fr))}),y.registerBinding(y.container,"pointermove",function(Fr){ea(Fr)||(Fr.preventDefault(),no(Fr),ca(Fr),xr(Fr))})}};var lv={};lv.generatePolygon=function(y,g){return this.nodeShapes[y]={renderer:this,name:y,points:g,draw:function(T,A,I,O,$){this.renderer.nodeShapeImpl("polygon",T,A,I,O,$,this.points)},intersectLine:function(T,A,I,O,$,z,S){return yk($,z,this.points,T,A,I/2,O/2,S)},checkPoint:function(T,A,I,O,$,z,S){return ov(T,A,this.points,z,S,O,$,[0,-1],I)}}},lv.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(g,x,T,A,I){this.renderer.nodeShapeImpl(this.name,g,x,T,A,I)},intersectLine:function(g,x,T,A,I,O,$){return TY(I,O,g,x,T/2+$,A/2+$)},checkPoint:function(g,x,T,A,I,O,$){return C3(g,x,A,I,O,$,T)}}},lv.generateRoundPolygon=function(y,g){for(var x=new Array(g.length*2),T=0;T<g.length/2;T++){var A=T*2,I=void 0;T<g.length/2-1?I=(T+1)*2:I=0,x[T*4]=g[A],x[T*4+1]=g[A+1];var O=g[I]-g[A],$=g[I+1]-g[A+1],z=Math.sqrt(O*O+$*$);x[T*4+2]=O/z,x[T*4+3]=$/z}return this.nodeShapes[y]={renderer:this,name:y,points:x,draw:function(V,U,tt,at,ut){this.renderer.nodeShapeImpl("round-polygon",V,U,tt,at,ut,this.points)},intersectLine:function(V,U,tt,at,ut,dt,At){return _Y(ut,dt,this.points,V,U,tt,at)},checkPoint:function(V,U,tt,at,ut,dt,At){return EY(V,U,this.points,dt,At,at,ut)}}},lv.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:cd(4,0),draw:function(g,x,T,A,I){this.renderer.nodeShapeImpl(this.name,g,x,T,A,I)},intersectLine:function(g,x,T,A,I,O,$){return KN(I,O,g,x,T,A,$)},checkPoint:function(g,x,T,A,I,O,$){var z=xk(A,I),S=z*2;return!!(ov(g,x,this.points,O,$,A,I-S,[0,-1],T)||ov(g,x,this.points,O,$,A-S,I,[0,-1],T)||C3(g,x,S,S,O-A/2+z,$-I/2+z,T)||C3(g,x,S,S,O+A/2-z,$-I/2+z,T)||C3(g,x,S,S,O+A/2-z,$+I/2-z,T)||C3(g,x,S,S,O-A/2+z,$+I/2-z,T))}}},lv.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:ZN(),points:cd(4,0),draw:function(g,x,T,A,I){this.renderer.nodeShapeImpl(this.name,g,x,T,A,I)},generateCutTrianglePts:function(g,x,T,A){var I=this.cornerLength,O=x/2,$=g/2,z=T-$,S=T+$,V=A-O,U=A+O;return{topLeft:[z,V+I,z+I,V,z+I,V+I],topRight:[S-I,V,S,V+I,S-I,V+I],bottomRight:[S,U-I,S-I,U,S-I,U-I],bottomLeft:[z+I,U,z,U-I,z+I,U-I]}},intersectLine:function(g,x,T,A,I,O,$){var z=this.generateCutTrianglePts(T+2*$,A+2*$,g,x),S=[].concat.apply([],[z.topLeft.splice(0,4),z.topRight.splice(0,4),z.bottomRight.splice(0,4),z.bottomLeft.splice(0,4)]);return yk(I,O,S,g,x)},checkPoint:function(g,x,T,A,I,O,$){if(ov(g,x,this.points,O,$,A,I-2*this.cornerLength,[0,-1],T)||ov(g,x,this.points,O,$,A-2*this.cornerLength,I,[0,-1],T))return!0;var z=this.generateCutTrianglePts(A,I,O,$);return qd(g,x,z.topLeft)||qd(g,x,z.topRight)||qd(g,x,z.bottomRight)||qd(g,x,z.bottomLeft)}}},lv.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:cd(4,0),draw:function(g,x,T,A,I){this.renderer.nodeShapeImpl(this.name,g,x,T,A,I)},intersectLine:function(g,x,T,A,I,O,$){var z=.15,S=.5,V=.85,U=this.generateBarrelBezierPts(T+2*$,A+2*$,g,x),tt=function(dt){var At=q5({x:dt[0],y:dt[1]},{x:dt[2],y:dt[3]},{x:dt[4],y:dt[5]},z),xt=q5({x:dt[0],y:dt[1]},{x:dt[2],y:dt[3]},{x:dt[4],y:dt[5]},S),Mt=q5({x:dt[0],y:dt[1]},{x:dt[2],y:dt[3]},{x:dt[4],y:dt[5]},V);return[dt[0],dt[1],At.x,At.y,xt.x,xt.y,Mt.x,Mt.y,dt[4],dt[5]]},at=[].concat(tt(U.topLeft),tt(U.topRight),tt(U.bottomRight),tt(U.bottomLeft));return yk(I,O,at,g,x)},generateBarrelBezierPts:function(g,x,T,A){var I=x/2,O=g/2,$=T-O,z=T+O,S=A-I,V=A+I,U=AL(g,x),tt=U.heightOffset,at=U.widthOffset,ut=U.ctrlPtOffsetPct*g,dt={topLeft:[$,S+tt,$+ut,S,$+at,S],topRight:[z-at,S,z-ut,S,z,S+tt],bottomRight:[z,V-tt,z-ut,V,z-at,V],bottomLeft:[$+at,V,$+ut,V,$,V-tt]};return dt.topLeft.isTop=!0,dt.topRight.isTop=!0,dt.bottomLeft.isBottom=!0,dt.bottomRight.isBottom=!0,dt},checkPoint:function(g,x,T,A,I,O,$){var z=AL(A,I),S=z.heightOffset,V=z.widthOffset;if(ov(g,x,this.points,O,$,A,I-2*S,[0,-1],T)||ov(g,x,this.points,O,$,A-2*V,I,[0,-1],T))return!0;for(var U=this.generateBarrelBezierPts(A,I,O,$),tt=function($t,ee,Ht){var ge=Ht[4],be=Ht[2],re=Ht[0],Ne=Ht[5],ve=Ht[1],fn=Math.min(ge,re),$e=Math.max(ge,re),qe=Math.min(Ne,ve),xn=Math.max(Ne,ve);if(fn<=$t&&$t<=$e&&qe<=ee&&ee<=xn){var Pn=CY(ge,be,re),er=mY(Pn[0],Pn[1],Pn[2],$t),Sn=er.filter(function(Jn){return 0<=Jn&&Jn<=1});if(Sn.length>0)return Sn[0]}return null},at=Object.keys(U),ut=0;ut<at.length;ut++){var dt=at[ut],At=U[dt],xt=tt(g,x,At);if(xt!=null){var Mt=At[5],Dt=At[3],Bt=At[1],Zt=lf(Mt,Dt,Bt,xt);if(At.isTop&&Zt<=x||At.isBottom&&x<=Zt)return!0}}return!1}}},lv.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:cd(4,0),draw:function(g,x,T,A,I){this.renderer.nodeShapeImpl(this.name,g,x,T,A,I)},intersectLine:function(g,x,T,A,I,O,$){var z=g-(T/2+$),S=x-(A/2+$),V=S,U=g+(T/2+$),tt=pm(I,O,g,x,z,S,U,V,!1);return tt.length>0?tt:KN(I,O,g,x,T,A,$)},checkPoint:function(g,x,T,A,I,O,$){var z=xk(A,I),S=2*z;if(ov(g,x,this.points,O,$,A,I-S,[0,-1],T)||ov(g,x,this.points,O,$,A-S,I,[0,-1],T))return!0;var V=A/2+2*T,U=I/2+2*T,tt=[O-V,$-U,O-V,$,O+V,$,O+V,$-U];return!!(qd(g,x,tt)||C3(g,x,S,S,O+A/2-z,$+I/2-z,T)||C3(g,x,S,S,O-A/2+z,$+I/2-z,T))}}},lv.registerNodeShapes=function(){var y=this.nodeShapes={},g=this;this.generateEllipse(),this.generatePolygon("triangle",cd(3,0)),this.generateRoundPolygon("round-triangle",cd(3,0)),this.generatePolygon("rectangle",cd(4,0)),y.square=y.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var x=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",x),this.generateRoundPolygon("round-diamond",x)}this.generatePolygon("pentagon",cd(5,0)),this.generateRoundPolygon("round-pentagon",cd(5,0)),this.generatePolygon("hexagon",cd(6,0)),this.generateRoundPolygon("round-hexagon",cd(6,0)),this.generatePolygon("heptagon",cd(7,0)),this.generateRoundPolygon("round-heptagon",cd(7,0)),this.generatePolygon("octagon",cd(8,0)),this.generateRoundPolygon("round-octagon",cd(8,0));var T=new Array(20);{var A=CL(5,0),I=CL(5,Math.PI/5),O=.5*(3-Math.sqrt(5));O*=1.57;for(var $=0;$<I.length/2;$++)I[$*2]*=O,I[$*2+1]*=O;for(var $=0;$<20/4;$++)T[$*4]=A[$*2],T[$*4+1]=A[$*2+1],T[$*4+2]=I[$*2],T[$*4+3]=I[$*2+1]}T=QN(T),this.generatePolygon("star",T),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var z=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",z),this.generateRoundPolygon("round-tag",z)}y.makePolygon=function(S){var V=S.join("$"),U="polygon-"+V,tt;return(tt=this[U])?tt:g.generatePolygon(U,S)}};var $k={};$k.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},$k.redraw=function(y){y=y||zN();var g=this;g.averageRedrawTime===void 0&&(g.averageRedrawTime=0),g.lastRedrawTime===void 0&&(g.lastRedrawTime=0),g.lastDrawTime===void 0&&(g.lastDrawTime=0),g.requestedFrame=!0,g.renderOptions=y},$k.beforeRender=function(y,g){if(!this.destroyed){g==null&&Ec("Priority is not optional for beforeRender");var x=this.beforeRenderCallbacks;x.push({fn:y,priority:g}),x.sort(function(T,A){return A.priority-T.priority})}};var RB=function(g,x,T){for(var A=g.beforeRenderCallbacks,I=0;I<A.length;I++)A[I].fn(x,T)};$k.startRenderLoop=function(){var y=this,g=y.cy;if(!y.renderLoopStarted){y.renderLoopStarted=!0;var x=function T(A){if(!y.destroyed){if(!g.batching())if(y.requestedFrame&&!y.skipFrame){RB(y,!0,A);var I=Ei();y.render(y.renderOptions);var O=y.lastDrawTime=Ei();y.averageRedrawTime===void 0&&(y.averageRedrawTime=O-I),y.redrawCount===void 0&&(y.redrawCount=0),y.redrawCount++,y.redrawTotalTime===void 0&&(y.redrawTotalTime=0);var $=O-I;y.redrawTotalTime+=$,y.lastRedrawTime=$,y.averageRedrawTime=y.averageRedrawTime/2+$/2,y.requestedFrame=!1}else RB(y,!1,A);y.skipFrame=!1,Ma(T)}};Ma(x)}};var HJ=function(g){this.init(g)},ZL=HJ,D3=ZL.prototype;D3.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],D3.init=function(y){var g=this;g.options=y,g.cy=y.cy;var x=g.container=y.cy.container();if(R){var T=R.document,A=T.head,I="__________cytoscape_stylesheet",O="__________cytoscape_container",$=T.getElementById(I)!=null;if(x.className.indexOf(O)<0&&(x.className=(x.className||"")+" "+O),!$){var z=T.createElement("style");z.id=I,z.innerHTML="."+O+" { position: relative; }",A.insertBefore(z,A.children[0])}var S=R.getComputedStyle(x),V=S.getPropertyValue("position");V==="static"&&Wo("A Cytoscape container has style position:static and so can not use UI extensions properly")}g.selection=[void 0,void 0,void 0,void 0,0],g.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],g.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},g.dragData={possibleDragElements:[]},g.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},g.redraws=0,g.showFps=y.showFps,g.debug=y.debug,g.hideEdgesOnViewport=y.hideEdgesOnViewport,g.textureOnViewport=y.textureOnViewport,g.wheelSensitivity=y.wheelSensitivity,g.motionBlurEnabled=y.motionBlur,g.forcedPixelRatio=rt(y.pixelRatio)?y.pixelRatio:null,g.motionBlur=y.motionBlur,g.motionBlurOpacity=y.motionBlurOpacity,g.motionBlurTransparency=1-g.motionBlurOpacity,g.motionBlurPxRatio=1,g.mbPxRBlurry=1,g.minMbLowQualFrames=4,g.fullQualityMb=!1,g.clearedForMotionBlur=[],g.desktopTapThreshold=y.desktopTapThreshold,g.desktopTapThreshold2=y.desktopTapThreshold*y.desktopTapThreshold,g.touchTapThreshold=y.touchTapThreshold,g.touchTapThreshold2=y.touchTapThreshold*y.touchTapThreshold,g.tapholdDuration=500,g.bindings=[],g.beforeRenderCallbacks=[],g.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},g.registerNodeShapes(),g.registerArrowShapes(),g.registerCalculationListeners()},D3.notify=function(y,g){var x=this,T=x.cy;if(!this.destroyed){if(y==="init"){x.load();return}if(y==="destroy"){x.destroy();return}(y==="add"||y==="remove"||y==="move"&&T.hasCompoundNodes()||y==="load"||y==="zorder"||y==="mount")&&x.invalidateCachedZSortedEles(),y==="viewport"&&x.redrawHint("select",!0),(y==="load"||y==="resize"||y==="mount")&&(x.invalidateContainerClientCoordsCache(),x.matchCanvasSize(x.container)),x.redrawHint("eles",!0),x.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}},D3.destroy=function(){var y=this;y.destroyed=!0,y.cy.stopAnimationLoop();for(var g=0;g<y.bindings.length;g++){var x=y.bindings[g],T=x,A=T.target;(A.off||A.removeEventListener).apply(A,T.args)}if(y.bindings=[],y.beforeRenderCallbacks=[],y.onUpdateEleCalcsFns=[],y.removeObserver&&y.removeObserver.disconnect(),y.styleObserver&&y.styleObserver.disconnect(),y.resizeObserver&&y.resizeObserver.disconnect(),y.labelCalcDiv)try{document.body.removeChild(y.labelCalcDiv)}catch{}},D3.isHeadless=function(){return!1},[YL,jk,BB,a6,lv,$k].forEach(function(y){Ke(D3,y)});var JL=1e3/60,fT={setupDequeueing:function(g){return function(){var T=this,A=this.renderer;if(!T.dequeueingSetup){T.dequeueingSetup=!0;var I=um(function(){A.redrawHint("eles",!0),A.redrawHint("drag",!0),A.redraw()},g.deqRedrawThreshold),O=function(S,V){var U=Ei(),tt=A.averageRedrawTime,at=A.lastRedrawTime,ut=[],dt=A.cy.extent(),At=A.getPixelRatio();for(S||A.flushRenderedStyleQueue();;){var xt=Ei(),Mt=xt-U,Dt=xt-V;if(at<JL){var Bt=JL-(S?tt:0);if(Dt>=g.deqFastCost*Bt)break}else if(S){if(Mt>=g.deqCost*at||Mt>=g.deqAvgCost*tt)break}else if(Dt>=g.deqNoDrawCost*JL)break;var Zt=g.deq(T,At,dt);if(Zt.length>0)for(var Kt=0;Kt<Zt.length;Kt++)ut.push(Zt[Kt]);else break}ut.length>0&&(g.onDeqd(T,ut),!S&&g.shouldRedraw(T,ut,At,dt)&&I())},$=g.priority||fm;A.beforeRender(O,$(T))}}}},VJ=function(){function y(g){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hm;p(this,y),this.idsByKey=new j2,this.keyForId=new j2,this.cachesByLvl=new j2,this.lvls=[],this.getKey=g,this.doesEleInvalidateKey=x}return m(y,[{key:"getIdsFor",value:function(x){x==null&&Ec("Can not get id list for null key");var T=this.idsByKey,A=this.idsByKey.get(x);return A||(A=new $5,T.set(x,A)),A}},{key:"addIdForKey",value:function(x,T){x!=null&&this.getIdsFor(x).add(T)}},{key:"deleteIdForKey",value:function(x,T){x!=null&&this.getIdsFor(x).delete(T)}},{key:"getNumberOfIdsForKey",value:function(x){return x==null?0:this.getIdsFor(x).size}},{key:"updateKeyMappingFor",value:function(x){var T=x.id(),A=this.keyForId.get(T),I=this.getKey(x);this.deleteIdForKey(A,T),this.addIdForKey(I,T),this.keyForId.set(T,I)}},{key:"deleteKeyMappingFor",value:function(x){var T=x.id(),A=this.keyForId.get(T);this.deleteIdForKey(A,T),this.keyForId.delete(T)}},{key:"keyHasChangedFor",value:function(x){var T=x.id(),A=this.keyForId.get(T),I=this.getKey(x);return A!==I}},{key:"isInvalid",value:function(x){return this.keyHasChangedFor(x)||this.doesEleInvalidateKey(x)}},{key:"getCachesAt",value:function(x){var T=this.cachesByLvl,A=this.lvls,I=T.get(x);return I||(I=new j2,T.set(x,I),A.push(x)),I}},{key:"getCache",value:function(x,T){return this.getCachesAt(T).get(x)}},{key:"get",value:function(x,T){var A=this.getKey(x),I=this.getCache(A,T);return I!=null&&this.updateKeyMappingFor(x),I}},{key:"getForCachedKey",value:function(x,T){var A=this.keyForId.get(x.id()),I=this.getCache(A,T);return I}},{key:"hasCache",value:function(x,T){return this.getCachesAt(T).has(x)}},{key:"has",value:function(x,T){var A=this.getKey(x);return this.hasCache(A,T)}},{key:"setCache",value:function(x,T,A){A.key=x,this.getCachesAt(T).set(x,A)}},{key:"set",value:function(x,T,A){var I=this.getKey(x);this.setCache(I,T,A),this.updateKeyMappingFor(x)}},{key:"deleteCache",value:function(x,T){this.getCachesAt(T).delete(x)}},{key:"delete",value:function(x,T){var A=this.getKey(x);this.deleteCache(A,T)}},{key:"invalidateKey",value:function(x){var T=this;this.lvls.forEach(function(A){return T.deleteCache(x,A)})}},{key:"invalidate",value:function(x){var T=x.id(),A=this.keyForId.get(T);this.deleteKeyMappingFor(x);var I=this.doesEleInvalidateKey(x);return I&&this.invalidateKey(A),I||this.getNumberOfIdsForKey(A)===0}}]),y}(),dT=25,gT=50,o6=-4,tM=3,eM=7.99,GJ=8,UJ=1024,WJ=1024,jB=1024,KJ=.2,YJ=.8,XJ=10,QJ=.15,ZJ=.1,JJ=.9,ttt=.9,ett=100,ntt=1,c6={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},rtt=Hf({getKey:null,doesEleInvalidateKey:hm,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:od,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),zk=function(g,x){var T=this;T.renderer=g,T.onDequeues=[];var A=rtt(x);Ke(T,A),T.lookup=new VJ(A.getKey,A.doesEleInvalidateKey),T.setupDequeueing()},Mh=zk.prototype;Mh.reasons=c6,Mh.getTextureQueue=function(y){var g=this;return g.eleImgCaches=g.eleImgCaches||{},g.eleImgCaches[y]=g.eleImgCaches[y]||[]},Mh.getRetiredTextureQueue=function(y){var g=this,x=g.eleImgCaches.retired=g.eleImgCaches.retired||{},T=x[y]=x[y]||[];return T},Mh.getElementQueue=function(){var y=this,g=y.eleCacheQueue=y.eleCacheQueue||new vk(function(x,T){return T.reqs-x.reqs});return g},Mh.getElementKeyToQueue=function(){var y=this,g=y.eleKeyToCacheQueue=y.eleKeyToCacheQueue||{};return g},Mh.getElement=function(y,g,x,T,A){var I=this,O=this.renderer,$=O.cy.zoom(),z=this.lookup;if(!g||g.w===0||g.h===0||isNaN(g.w)||isNaN(g.h)||!y.visible()||y.removed()||!I.allowEdgeTxrCaching&&y.isEdge()||!I.allowParentTxrCaching&&y.isParent())return null;if(T==null&&(T=Math.ceil(kL($*x))),T<o6)T=o6;else if($>=eM||T>tM)return null;var S=Math.pow(2,T),V=g.h*S,U=g.w*S,tt=O.eleTextBiggerThanMin(y,S);if(!this.isVisible(y,tt))return null;var at=z.get(y,T);if(at&&at.invalidated&&(at.invalidated=!1,at.texture.invalidatedWidth-=at.width),at)return at;var ut;if(V<=dT?ut=dT:V<=gT?ut=gT:ut=Math.ceil(V/gT)*gT,V>jB||U>WJ)return null;var dt=I.getTextureQueue(ut),At=dt[dt.length-2],xt=function(){return I.recycleTexture(ut,U)||I.addTexture(ut,U)};At||(At=dt[dt.length-1]),At||(At=xt()),At.width-At.usedWidth<U&&(At=xt());for(var Mt=function($e){return $e&&$e.scaledLabelShown===tt},Dt=A&&A===c6.dequeue,Bt=A&&A===c6.highQuality,Zt=A&&A===c6.downscale,Kt,$t=T+1;$t<=tM;$t++){var ee=z.get(y,$t);if(ee){Kt=ee;break}}var Ht=Kt&&Kt.level===T+1?Kt:null,ge=function(){At.context.drawImage(Ht.texture.canvas,Ht.x,0,Ht.width,Ht.height,At.usedWidth,0,U,V)};if(At.context.setTransform(1,0,0,1,0,0),At.context.clearRect(At.usedWidth,0,U,ut),Mt(Ht))ge();else if(Mt(Kt))if(Bt){for(var be=Kt.level;be>T;be--)Ht=I.getElement(y,g,x,be,c6.downscale);ge()}else return I.queueElement(y,Kt.level-1),Kt;else{var re;if(!Dt&&!Bt&&!Zt)for(var Ne=T-1;Ne>=o6;Ne--){var ve=z.get(y,Ne);if(ve){re=ve;break}}if(Mt(re))return I.queueElement(y,T),re;At.context.translate(At.usedWidth,0),At.context.scale(S,S),this.drawElement(At.context,y,g,tt,!1),At.context.scale(1/S,1/S),At.context.translate(-At.usedWidth,0)}return at={x:At.usedWidth,texture:At,level:T,scale:S,width:U,height:V,scaledLabelShown:tt},At.usedWidth+=Math.ceil(U+GJ),At.eleCaches.push(at),z.set(y,T,at),I.checkTextureFullness(At),at},Mh.invalidateElements=function(y){for(var g=0;g<y.length;g++)this.invalidateElement(y[g])},Mh.invalidateElement=function(y){var g=this,x=g.lookup,T=[],A=x.isInvalid(y);if(A){for(var I=o6;I<=tM;I++){var O=x.getForCachedKey(y,I);O&&T.push(O)}var $=x.invalidate(y);if($)for(var z=0;z<T.length;z++){var S=T[z],V=S.texture;V.invalidatedWidth+=S.width,S.invalidated=!0,g.checkTextureUtility(V)}g.removeFromQueue(y)}},Mh.checkTextureUtility=function(y){y.invalidatedWidth>=KJ*y.width&&this.retireTexture(y)},Mh.checkTextureFullness=function(y){var g=this,x=g.getTextureQueue(y.height);y.usedWidth/y.width>YJ&&y.fullnessChecks>=XJ?dm(x,y):y.fullnessChecks++},Mh.retireTexture=function(y){var g=this,x=y.height,T=g.getTextureQueue(x),A=this.lookup;dm(T,y),y.retired=!0;for(var I=y.eleCaches,O=0;O<I.length;O++){var $=I[O];A.deleteCache($.key,$.level)}yL(I);var z=g.getRetiredTextureQueue(x);z.push(y)},Mh.addTexture=function(y,g){var x=this,T=x.getTextureQueue(y),A={};return T.push(A),A.eleCaches=[],A.height=y,A.width=Math.max(UJ,g),A.usedWidth=0,A.invalidatedWidth=0,A.fullnessChecks=0,A.canvas=x.renderer.makeOffscreenCanvas(A.width,A.height),A.context=A.canvas.getContext("2d"),A},Mh.recycleTexture=function(y,g){for(var x=this,T=x.getTextureQueue(y),A=x.getRetiredTextureQueue(y),I=0;I<A.length;I++){var O=A[I];if(O.width>=g)return O.retired=!1,O.usedWidth=0,O.invalidatedWidth=0,O.fullnessChecks=0,yL(O.eleCaches),O.context.setTransform(1,0,0,1,0,0),O.context.clearRect(0,0,O.width,O.height),dm(A,O),T.push(O),O}},Mh.queueElement=function(y,g){var x=this,T=x.getElementQueue(),A=x.getElementKeyToQueue(),I=this.getKey(y),O=A[I];if(O)O.level=Math.max(O.level,g),O.eles.merge(y),O.reqs++,T.updateItem(O);else{var $={eles:y.spawn().merge(y),level:g,reqs:1,key:I};T.push($),A[I]=$}},Mh.dequeue=function(y){for(var g=this,x=g.getElementQueue(),T=g.getElementKeyToQueue(),A=[],I=g.lookup,O=0;O<ntt&&x.size()>0;O++){var $=x.pop(),z=$.key,S=$.eles[0],V=I.hasCache(S,$.level);if(T[z]=null,V)continue;A.push($);var U=g.getBoundingBox(S);g.getElement(S,U,y,$.level,c6.dequeue)}return A},Mh.removeFromQueue=function(y){var g=this,x=g.getElementQueue(),T=g.getElementKeyToQueue(),A=this.getKey(y),I=T[A];I!=null&&(I.eles.length===1?(I.reqs=vp,x.updateItem(I),x.pop(),T[A]=null):I.eles.unmerge(y))},Mh.onDequeue=function(y){this.onDequeues.push(y)},Mh.offDequeue=function(y){dm(this.onDequeues,y)},Mh.setupDequeueing=fT.setupDequeueing({deqRedrawThreshold:ett,deqCost:QJ,deqAvgCost:ZJ,deqNoDrawCost:JJ,deqFastCost:ttt,deq:function(g,x,T){return g.dequeue(x,T)},onDeqd:function(g,x){for(var T=0;T<g.onDequeues.length;T++){var A=g.onDequeues[T];A(x)}},shouldRedraw:function(g,x,T,A){for(var I=0;I<x.length;I++)for(var O=x[I].eles,$=0;$<O.length;$++){var z=O[$].boundingBox();if(TL(z,A))return!0}return!1},priority:function(g){return g.renderer.beforeRenderPriorities.eleTxrDeq}});var itt=1,u6=-4,qk=2,pT=3.99,Hk=50,bg=50,stt=.15,Lgt=.1,Mgt=.9,Dgt=.9,Igt=1,nM=250,Ogt=4e3*4e3,Pgt=!0,att=function(g){var x=this,T=x.renderer=g,A=T.cy;x.layersByLevel={},x.firstGet=!0,x.lastInvalidationTime=Ei()-2*nM,x.skipping=!1,x.eleTxrDeqs=A.collection(),x.scheduleElementRefinement=um(function(){x.refineElementTextures(x.eleTxrDeqs),x.eleTxrDeqs.unmerge(x.eleTxrDeqs)},bg),T.beforeRender(function(O,$){$-x.lastInvalidationTime<=nM?x.skipping=!0:x.skipping=!1},T.beforeRenderPriorities.lyrTxrSkip);var I=function($,z){return z.reqs-$.reqs};x.layersQueue=new vk(I),x.setupDequeueing()},E1=att.prototype,ott=0,Ngt=Math.pow(2,53)-1;E1.makeLayer=function(y,g){var x=Math.pow(2,g),T=Math.ceil(y.w*x),A=Math.ceil(y.h*x),I=this.renderer.makeOffscreenCanvas(T,A),O={id:ott=++ott%Ngt,bb:y,level:g,width:T,height:A,canvas:I,context:I.getContext("2d"),eles:[],elesQueue:[],reqs:0},$=O.context,z=-O.bb.x1,S=-O.bb.y1;return $.scale(x,x),$.translate(z,S),O},E1.getLayers=function(y,g,x){var T=this,A=T.renderer,I=A.cy,O=I.zoom(),$=T.firstGet;if(T.firstGet=!1,x==null){if(x=Math.ceil(kL(O*g)),x<u6)x=u6;else if(O>=pT||x>qk)return null}T.validateLayersElesOrdering(x,y);var z=T.layersByLevel,S=Math.pow(2,x),V=z[x]=z[x]||[],U,tt=T.levelIsComplete(x,y),at,ut=function(){var ge=function(fn){if(T.validateLayersElesOrdering(fn,y),T.levelIsComplete(fn,y))return at=z[fn],!0},be=function(fn){if(!at)for(var $e=x+fn;u6<=$e&&$e<=qk&&!ge($e);$e+=fn);};be(1),be(-1);for(var re=V.length-1;re>=0;re--){var Ne=V[re];Ne.invalid&&dm(V,Ne)}};if(!tt)ut();else return V;var dt=function(){if(!U){U=zd();for(var ge=0;ge<y.length;ge++)gY(U,y[ge].boundingBox())}return U},At=function(ge){ge=ge||{};var be=ge.after;dt();var re=U.w*S*(U.h*S);if(re>Ogt)return null;var Ne=T.makeLayer(U,x);if(be!=null){var ve=V.indexOf(be)+1;V.splice(ve,0,Ne)}else(ge.insert===void 0||ge.insert)&&V.unshift(Ne);return Ne};if(T.skipping&&!$)return null;for(var xt=null,Mt=y.length/itt,Dt=!$,Bt=0;Bt<y.length;Bt++){var Zt=y[Bt],Kt=Zt._private.rscratch,$t=Kt.imgLayerCaches=Kt.imgLayerCaches||{},ee=$t[x];if(ee){xt=ee;continue}if((!xt||xt.eles.length>=Mt||!WN(xt.bb,Zt.boundingBox()))&&(xt=At({insert:!0,after:xt}),!xt))return null;at||Dt?T.queueLayer(xt,Zt):T.drawEleInLayer(xt,Zt,x,g),xt.eles.push(Zt),$t[x]=xt}return at||(Dt?null:V)},E1.getEleLevelForLayerLevel=function(y,g){return y},E1.drawEleInLayer=function(y,g,x,T){var A=this,I=this.renderer,O=y.context,$=g.boundingBox();$.w===0||$.h===0||!g.visible()||(x=A.getEleLevelForLayerLevel(x,T),I.setImgSmoothing(O,!1),I.drawCachedElement(O,g,null,null,x,Pgt),I.setImgSmoothing(O,!0))},E1.levelIsComplete=function(y,g){var x=this,T=x.layersByLevel[y];if(!T||T.length===0)return!1;for(var A=0,I=0;I<T.length;I++){var O=T[I];if(O.reqs>0||O.invalid)return!1;A+=O.eles.length}return A===g.length},E1.validateLayersElesOrdering=function(y,g){var x=this.layersByLevel[y];if(x)for(var T=0;T<x.length;T++){for(var A=x[T],I=-1,O=0;O<g.length;O++)if(A.eles[0]===g[O]){I=O;break}if(I<0){this.invalidateLayer(A);continue}for(var $=I,O=0;O<A.eles.length;O++)if(A.eles[O]!==g[$+O]){this.invalidateLayer(A);break}}},E1.updateElementsInLayers=function(y,g){for(var x=this,T=_t(y[0]),A=0;A<y.length;A++)for(var I=T?null:y[A],O=T?y[A]:y[A].ele,$=O._private.rscratch,z=$.imgLayerCaches=$.imgLayerCaches||{},S=u6;S<=qk;S++){var V=z[S];V&&(I&&x.getEleLevelForLayerLevel(V.level)!==I.level||g(V,O,I))}},E1.haveLayers=function(){for(var y=this,g=!1,x=u6;x<=qk;x++){var T=y.layersByLevel[x];if(T&&T.length>0){g=!0;break}}return g},E1.invalidateElements=function(y){var g=this;y.length!==0&&(g.lastInvalidationTime=Ei(),!(y.length===0||!g.haveLayers())&&g.updateElementsInLayers(y,function(T,A,I){g.invalidateLayer(T)}))},E1.invalidateLayer=function(y){if(this.lastInvalidationTime=Ei(),!y.invalid){var g=y.level,x=y.eles,T=this.layersByLevel[g];dm(T,y),y.elesQueue=[],y.invalid=!0,y.replacement&&(y.replacement.invalid=!0);for(var A=0;A<x.length;A++){var I=x[A]._private.rscratch.imgLayerCaches;I&&(I[g]=null)}}},E1.refineElementTextures=function(y){var g=this;g.updateElementsInLayers(y,function(T,A,I){var O=T.replacement;if(O||(O=T.replacement=g.makeLayer(T.bb,T.level),O.replaces=T,O.eles=T.eles),!O.reqs)for(var $=0;$<O.eles.length;$++)g.queueLayer(O,O.eles[$])})},E1.enqueueElementRefinement=function(y){this.eleTxrDeqs.merge(y),this.scheduleElementRefinement()},E1.queueLayer=function(y,g){var x=this,T=x.layersQueue,A=y.elesQueue,I=A.hasId=A.hasId||{};if(!y.replacement){if(g){if(I[g.id()])return;A.push(g),I[g.id()]=!0}y.reqs?(y.reqs++,T.updateItem(y)):(y.reqs=1,T.push(y))}},E1.dequeue=function(y){for(var g=this,x=g.layersQueue,T=[],A=0;A<Igt&&x.size()!==0;){var I=x.peek();if(I.replacement){x.pop();continue}if(I.replaces&&I!==I.replaces.replacement){x.pop();continue}if(I.invalid){x.pop();continue}var O=I.elesQueue.shift();O&&(g.drawEleInLayer(I,O,I.level,y),A++),T.length===0&&T.push(!0),I.elesQueue.length===0&&(x.pop(),I.reqs=0,I.replaces&&g.applyLayerReplacement(I),g.requestRedraw())}return T},E1.applyLayerReplacement=function(y){var g=this,x=g.layersByLevel[y.level],T=y.replaces,A=x.indexOf(T);if(!(A<0||T.invalid)){x[A]=y;for(var I=0;I<y.eles.length;I++){var O=y.eles[I]._private,$=O.imgLayerCaches=O.imgLayerCaches||{};$&&($[y.level]=y)}g.requestRedraw()}},E1.requestRedraw=um(function(){var y=this.renderer;y.redrawHint("eles",!0),y.redrawHint("drag",!0),y.redraw()},100),E1.setupDequeueing=fT.setupDequeueing({deqRedrawThreshold:Hk,deqCost:stt,deqAvgCost:Lgt,deqNoDrawCost:Mgt,deqFastCost:Dgt,deq:function(g,x){return g.dequeue(x)},onDeqd:fm,shouldRedraw:od,priority:function(g){return g.renderer.beforeRenderPriorities.lyrTxrDeq}});var _0={},ctt;function $B(y,g){for(var x=0;x<g.length;x++){var T=g[x];y.lineTo(T.x,T.y)}}function zB(y,g,x){for(var T,A=0;A<g.length;A++){var I=g[A];A===0&&(T=I),y.lineTo(I.x,I.y)}y.quadraticCurveTo(x.x,x.y,T.x,T.y)}function utt(y,g,x){y.beginPath&&y.beginPath();for(var T=g,A=0;A<T.length;A++){var I=T[A];y.lineTo(I.x,I.y)}var O=x,$=x[0];y.moveTo($.x,$.y);for(var A=1;A<O.length;A++){var I=O[A];y.lineTo(I.x,I.y)}y.closePath&&y.closePath()}function Fgt(y,g,x,T,A){y.beginPath&&y.beginPath(),y.arc(x,T,A,0,Math.PI*2,!1);var I=g,O=I[0];y.moveTo(O.x,O.y);for(var $=0;$<I.length;$++){var z=I[$];y.lineTo(z.x,z.y)}y.closePath&&y.closePath()}function Bgt(y,g,x,T){y.arc(g,x,T,0,Math.PI*2,!1)}_0.arrowShapeImpl=function(y){return(ctt||(ctt={polygon:$B,"triangle-backcurve":zB,"triangle-tee":utt,"circle-triangle":Fgt,"triangle-cross":utt,circle:Bgt}))[y]};var hv={};hv.drawElement=function(y,g,x,T,A,I){var O=this;g.isNode()?O.drawNode(y,g,x,T,A,I):O.drawEdge(y,g,x,T,A,I)},hv.drawElementOverlay=function(y,g){var x=this;g.isNode()?x.drawNodeOverlay(y,g):x.drawEdgeOverlay(y,g)},hv.drawElementUnderlay=function(y,g){var x=this;g.isNode()?x.drawNodeUnderlay(y,g):x.drawEdgeUnderlay(y,g)},hv.drawCachedElementPortion=function(y,g,x,T,A,I,O,$){var z=this,S=x.getBoundingBox(g);if(!(S.w===0||S.h===0)){var V=x.getElement(g,S,T,A,I);if(V!=null){var U=$(z,g);if(U===0)return;var tt=O(z,g),at=S.x1,ut=S.y1,dt=S.w,At=S.h,xt,Mt,Dt,Bt,Zt;if(tt!==0){var Kt=x.getRotationPoint(g);Dt=Kt.x,Bt=Kt.y,y.translate(Dt,Bt),y.rotate(tt),Zt=z.getImgSmoothing(y),Zt||z.setImgSmoothing(y,!0);var $t=x.getRotationOffset(g);xt=$t.x,Mt=$t.y}else xt=at,Mt=ut;var ee;U!==1&&(ee=y.globalAlpha,y.globalAlpha=ee*U),y.drawImage(V.texture.canvas,V.x,0,V.width,V.height,xt,Mt,dt,At),U!==1&&(y.globalAlpha=ee),tt!==0&&(y.rotate(-tt),y.translate(-Dt,-Bt),Zt||z.setImgSmoothing(y,!1))}else x.drawElement(y,g)}};var rM=function(){return 0},bT=function(g,x){return g.getTextAngle(x,null)},qB=function(g,x){return g.getTextAngle(x,"source")},Rgt=function(g,x){return g.getTextAngle(x,"target")},jgt=function(g,x){return x.effectiveOpacity()},HB=function(g,x){return x.pstyle("text-opacity").pfValue*x.effectiveOpacity()};hv.drawCachedElement=function(y,g,x,T,A,I){var O=this,$=O.data,z=$.eleTxrCache,S=$.lblTxrCache,V=$.slbTxrCache,U=$.tlbTxrCache,tt=g.boundingBox(),at=I===!0?z.reasons.highQuality:null;if(!(tt.w===0||tt.h===0||!g.visible())&&(!T||TL(tt,T))){var ut=g.isEdge(),dt=g.element()._private.rscratch.badLine;O.drawElementUnderlay(y,g),O.drawCachedElementPortion(y,g,z,x,A,at,rM,jgt),(!ut||!dt)&&O.drawCachedElementPortion(y,g,S,x,A,at,bT,HB),ut&&!dt&&(O.drawCachedElementPortion(y,g,V,x,A,at,qB,HB),O.drawCachedElementPortion(y,g,U,x,A,at,Rgt,HB)),O.drawElementOverlay(y,g)}},hv.drawElements=function(y,g){for(var x=this,T=0;T<g.length;T++){var A=g[T];x.drawElement(y,A)}},hv.drawCachedElements=function(y,g,x,T){for(var A=this,I=0;I<g.length;I++){var O=g[I];A.drawCachedElement(y,O,x,T)}},hv.drawCachedNodes=function(y,g,x,T){for(var A=this,I=0;I<g.length;I++){var O=g[I];O.isNode()&&A.drawCachedElement(y,O,x,T)}},hv.drawLayeredElements=function(y,g,x,T){var A=this,I=A.data.lyrTxrCache.getLayers(g,x);if(I)for(var O=0;O<I.length;O++){var $=I[O],z=$.bb;z.w===0||z.h===0||y.drawImage($.canvas,z.x1,z.y1,z.w,z.h)}else A.drawCachedElements(y,g,x,T)};var fv={};fv.drawEdge=function(y,g,x){var T=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,A=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,I=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,O=this,$=g._private.rscratch;if(!(I&&!g.visible())&&!($.badLine||$.allpts==null||isNaN($.allpts[0]))){var z;x&&(z=x,y.translate(-z.x1,-z.y1));var S=I?g.pstyle("opacity").value:1,V=I?g.pstyle("line-opacity").value:1,U=g.pstyle("curve-style").value,tt=g.pstyle("line-style").value,at=g.pstyle("width").pfValue,ut=g.pstyle("line-cap").value,dt=S*V,At=S*V,xt=function(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:dt;U==="straight-triangle"?(O.eleStrokeStyle(y,g,re),O.drawEdgeTrianglePath(g,y,$.allpts)):(y.lineWidth=at,y.lineCap=ut,O.eleStrokeStyle(y,g,re),O.drawEdgePath(g,y,$.allpts,tt),y.lineCap="butt")},Mt=function(){A&&O.drawEdgeOverlay(y,g)},Dt=function(){A&&O.drawEdgeUnderlay(y,g)},Bt=function(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:At;O.drawArrowheads(y,g,re)},Zt=function(){O.drawElementText(y,g,null,T)};y.lineJoin="round";var Kt=g.pstyle("ghost").value==="yes";if(Kt){var $t=g.pstyle("ghost-offset-x").pfValue,ee=g.pstyle("ghost-offset-y").pfValue,Ht=g.pstyle("ghost-opacity").value,ge=dt*Ht;y.translate($t,ee),xt(ge),Bt(ge),y.translate(-$t,-ee)}Dt(),xt(),Bt(),Mt(),Zt(),x&&y.translate(z.x1,z.y1)}};var ltt=function(g){if(!["overlay","underlay"].includes(g))throw new Error("Invalid state");return function(x,T){if(T.visible()){var A=T.pstyle("".concat(g,"-opacity")).value;if(A!==0){var I=this,O=I.usePaths(),$=T._private.rscratch,z=T.pstyle("".concat(g,"-padding")).pfValue,S=2*z,V=T.pstyle("".concat(g,"-color")).value;x.lineWidth=S,$.edgeType==="self"&&!O?x.lineCap="butt":x.lineCap="round",I.colorStrokeStyle(x,V[0],V[1],V[2],A),I.drawEdgePath(T,x,$.allpts,"solid")}}}};fv.drawEdgeOverlay=ltt("overlay"),fv.drawEdgeUnderlay=ltt("underlay"),fv.drawEdgePath=function(y,g,x,T){var A=y._private.rscratch,I=g,O,$=!1,z=this.usePaths(),S=y.pstyle("line-dash-pattern").pfValue,V=y.pstyle("line-dash-offset").pfValue;if(z){var U=x.join("$"),tt=A.pathCacheKey&&A.pathCacheKey===U;tt?(O=g=A.pathCache,$=!0):(O=g=new Path2D,A.pathCacheKey=U,A.pathCache=O)}if(I.setLineDash)switch(T){case"dotted":I.setLineDash([1,1]);break;case"dashed":I.setLineDash(S),I.lineDashOffset=V;break;case"solid":I.setLineDash([]);break}if(!$&&!A.badLine)switch(g.beginPath&&g.beginPath(),g.moveTo(x[0],x[1]),A.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var at=2;at+3<x.length;at+=4)g.quadraticCurveTo(x[at],x[at+1],x[at+2],x[at+3]);break;case"straight":case"segments":case"haystack":for(var ut=2;ut+1<x.length;ut+=2)g.lineTo(x[ut],x[ut+1]);break}g=I,z?g.stroke(O):g.stroke(),g.setLineDash&&g.setLineDash([])},fv.drawEdgeTrianglePath=function(y,g,x){g.fillStyle=g.strokeStyle;for(var T=y.pstyle("width").pfValue,A=0;A+1<x.length;A+=2){var I=[x[A+2]-x[A],x[A+3]-x[A+1]],O=Math.sqrt(I[0]*I[0]+I[1]*I[1]),$=[I[1]/O,-I[0]/O],z=[$[0]*T/2,$[1]*T/2];g.beginPath(),g.moveTo(x[A]-z[0],x[A+1]-z[1]),g.lineTo(x[A]+z[0],x[A+1]+z[1]),g.lineTo(x[A+2],x[A+3]),g.closePath(),g.fill()}},fv.drawArrowheads=function(y,g,x){var T=g._private.rscratch,A=T.edgeType==="haystack";A||this.drawArrowhead(y,g,"source",T.arrowStartX,T.arrowStartY,T.srcArrowAngle,x),this.drawArrowhead(y,g,"mid-target",T.midX,T.midY,T.midtgtArrowAngle,x),this.drawArrowhead(y,g,"mid-source",T.midX,T.midY,T.midsrcArrowAngle,x),A||this.drawArrowhead(y,g,"target",T.arrowEndX,T.arrowEndY,T.tgtArrowAngle,x)},fv.drawArrowhead=function(y,g,x,T,A,I,O){if(!(isNaN(T)||T==null||isNaN(A)||A==null||isNaN(I)||I==null)){var $=this,z=g.pstyle(x+"-arrow-shape").value;if(z!=="none"){var S=g.pstyle(x+"-arrow-fill").value==="hollow"?"both":"filled",V=g.pstyle(x+"-arrow-fill").value,U=g.pstyle("width").pfValue,tt=g.pstyle("opacity").value;O===void 0&&(O=tt);var at=y.globalCompositeOperation;(O!==1||V==="hollow")&&(y.globalCompositeOperation="destination-out",$.colorFillStyle(y,255,255,255,1),$.colorStrokeStyle(y,255,255,255,1),$.drawArrowShape(g,y,S,U,z,T,A,I),y.globalCompositeOperation=at);var ut=g.pstyle(x+"-arrow-color").value;$.colorFillStyle(y,ut[0],ut[1],ut[2],O),$.colorStrokeStyle(y,ut[0],ut[1],ut[2],O),$.drawArrowShape(g,y,V,U,z,T,A,I)}}},fv.drawArrowShape=function(y,g,x,T,A,I,O,$){var z=this,S=this.usePaths()&&A!=="triangle-cross",V=!1,U,tt=g,at={x:I,y:O},ut=y.pstyle("arrow-scale").value,dt=this.getArrowWidth(T,ut),At=z.arrowShapes[A];if(S){var xt=z.arrowPathCache=z.arrowPathCache||[],Mt=ad(A),Dt=xt[Mt];Dt!=null?(U=g=Dt,V=!0):(U=g=new Path2D,xt[Mt]=U)}V||(g.beginPath&&g.beginPath(),S?At.draw(g,1,0,{x:0,y:0},1):At.draw(g,dt,$,at,T),g.closePath&&g.closePath()),g=tt,S&&(g.translate(I,O),g.rotate($),g.scale(dt,dt)),(x==="filled"||x==="both")&&(S?g.fill(U):g.fill()),(x==="hollow"||x==="both")&&(g.lineWidth=(At.matchEdgeWidth?T:1)/(S?dt:1),g.lineJoin="miter",S?g.stroke(U):g.stroke()),S&&(g.scale(1/dt,1/dt),g.rotate(-$),g.translate(-I,-O))};var vT={};vT.safeDrawImage=function(y,g,x,T,A,I,O,$,z,S){if(!(A<=0||I<=0||z<=0||S<=0))try{y.drawImage(g,x,T,A,I,O,$,z,S)}catch(V){Wo(V)}},vT.drawInscribedImage=function(y,g,x,T,A){var I=this,O=x.position(),$=O.x,z=O.y,S=x.cy().style(),V=S.getIndexedStyle.bind(S),U=V(x,"background-fit","value",T),tt=V(x,"background-repeat","value",T),at=x.width(),ut=x.height(),dt=x.padding()*2,At=at+(V(x,"background-width-relative-to","value",T)==="inner"?0:dt),xt=ut+(V(x,"background-height-relative-to","value",T)==="inner"?0:dt),Mt=x._private.rscratch,Dt=V(x,"background-clip","value",T),Bt=Dt==="node",Zt=V(x,"background-image-opacity","value",T)*A,Kt=V(x,"background-image-smoothing","value",T),$t=g.width||g.cachedW,ee=g.height||g.cachedH;($t==null||ee==null)&&(document.body.appendChild(g),$t=g.cachedW=g.width||g.offsetWidth,ee=g.cachedH=g.height||g.offsetHeight,document.body.removeChild(g));var Ht=$t,ge=ee;if(V(x,"background-width","value",T)!=="auto"&&(V(x,"background-width","units",T)==="%"?Ht=V(x,"background-width","pfValue",T)*At:Ht=V(x,"background-width","pfValue",T)),V(x,"background-height","value",T)!=="auto"&&(V(x,"background-height","units",T)==="%"?ge=V(x,"background-height","pfValue",T)*xt:ge=V(x,"background-height","pfValue",T)),!(Ht===0||ge===0)){if(U==="contain"){var be=Math.min(At/Ht,xt/ge);Ht*=be,ge*=be}else if(U==="cover"){var be=Math.max(At/Ht,xt/ge);Ht*=be,ge*=be}var re=$-At/2,Ne=V(x,"background-position-x","units",T),ve=V(x,"background-position-x","pfValue",T);Ne==="%"?re+=(At-Ht)*ve:re+=ve;var fn=V(x,"background-offset-x","units",T),$e=V(x,"background-offset-x","pfValue",T);fn==="%"?re+=(At-Ht)*$e:re+=$e;var qe=z-xt/2,xn=V(x,"background-position-y","units",T),Pn=V(x,"background-position-y","pfValue",T);xn==="%"?qe+=(xt-ge)*Pn:qe+=Pn;var er=V(x,"background-offset-y","units",T),Sn=V(x,"background-offset-y","pfValue",T);er==="%"?qe+=(xt-ge)*Sn:qe+=Sn,Mt.pathCache&&(re-=$,qe-=z,$=0,z=0);var Jn=y.globalAlpha;y.globalAlpha=Zt;var fr=I.getImgSmoothing(y),Sr=!1;if(Kt==="no"&&fr?(I.setImgSmoothing(y,!1),Sr=!0):Kt==="yes"&&!fr&&(I.setImgSmoothing(y,!0),Sr=!0),tt==="no-repeat")Bt&&(y.save(),Mt.pathCache?y.clip(Mt.pathCache):(I.nodeShapes[I.getNodeShape(x)].draw(y,$,z,At,xt),y.clip())),I.safeDrawImage(y,g,0,0,$t,ee,re,qe,Ht,ge),Bt&&y.restore();else{var wr=y.createPattern(g,tt);y.fillStyle=wr,I.nodeShapes[I.getNodeShape(x)].draw(y,$,z,At,xt),y.translate(re,qe),y.fill(),y.translate(-re,-qe)}y.globalAlpha=Jn,Sr&&I.setImgSmoothing(y,fr)}};var l6={};l6.eleTextBiggerThanMin=function(y,g){if(!g){var x=y.cy().zoom(),T=this.getPixelRatio(),A=Math.ceil(kL(x*T));g=Math.pow(2,A)}var I=y.pstyle("font-size").pfValue*g,O=y.pstyle("min-zoomed-font-size").pfValue;return!(I<O)},l6.drawElementText=function(y,g,x,T,A){var I=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,O=this;if(T==null){if(I&&!O.eleTextBiggerThanMin(g))return}else if(T===!1)return;if(g.isNode()){var $=g.pstyle("label");if(!$||!$.value)return;var z=O.getLabelJustification(g);y.textAlign=z,y.textBaseline="bottom"}else{var S=g.element()._private.rscratch.badLine,V=g.pstyle("label"),U=g.pstyle("source-label"),tt=g.pstyle("target-label");if(S||(!V||!V.value)&&(!U||!U.value)&&(!tt||!tt.value))return;y.textAlign="center",y.textBaseline="bottom"}var at=!x,ut;x&&(ut=x,y.translate(-ut.x1,-ut.y1)),A==null?(O.drawText(y,g,null,at,I),g.isEdge()&&(O.drawText(y,g,"source",at,I),O.drawText(y,g,"target",at,I))):O.drawText(y,g,A,at,I),x&&y.translate(ut.x1,ut.y1)},l6.getFontCache=function(y){var g;this.fontCaches=this.fontCaches||[];for(var x=0;x<this.fontCaches.length;x++)if(g=this.fontCaches[x],g.context===y)return g;return g={context:y},this.fontCaches.push(g),g},l6.setupTextStyle=function(y,g){var x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,T=g.pstyle("font-style").strValue,A=g.pstyle("font-size").pfValue+"px",I=g.pstyle("font-family").strValue,O=g.pstyle("font-weight").strValue,$=x?g.effectiveOpacity()*g.pstyle("text-opacity").value:1,z=g.pstyle("text-outline-opacity").value*$,S=g.pstyle("color").value,V=g.pstyle("text-outline-color").value;y.font=T+" "+O+" "+A+" "+I,y.lineJoin="round",this.colorFillStyle(y,S[0],S[1],S[2],$),this.colorStrokeStyle(y,V[0],V[1],V[2],z)};function $gt(y,g,x,T,A){var I=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5;y.beginPath(),y.moveTo(g+I,x),y.lineTo(g+T-I,x),y.quadraticCurveTo(g+T,x,g+T,x+I),y.lineTo(g+T,x+A-I),y.quadraticCurveTo(g+T,x+A,g+T-I,x+A),y.lineTo(g+I,x+A),y.quadraticCurveTo(g,x+A,g,x+A-I),y.lineTo(g,x+I),y.quadraticCurveTo(g,x,g+I,x),y.closePath(),y.fill()}l6.getTextAngle=function(y,g){var x,T=y._private,A=T.rscratch,I=g?g+"-":"",O=y.pstyle(I+"text-rotation"),$=wp(A,"labelAngle",g);return O.strValue==="autorotate"?x=y.isEdge()?$:0:O.strValue==="none"?x=0:x=O.pfValue,x},l6.drawText=function(y,g,x){var T=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,A=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,I=g._private,O=I.rscratch,$=A?g.effectiveOpacity():1;if(!(A&&($===0||g.pstyle("text-opacity").value===0))){x==="main"&&(x=null);var z=wp(O,"labelX",x),S=wp(O,"labelY",x),V,U,tt=this.getLabelText(g,x);if(tt!=null&&tt!==""&&!isNaN(z)&&!isNaN(S)){this.setupTextStyle(y,g,A);var at=x?x+"-":"",ut=wp(O,"labelWidth",x),dt=wp(O,"labelHeight",x),At=g.pstyle(at+"text-margin-x").pfValue,xt=g.pstyle(at+"text-margin-y").pfValue,Mt=g.isEdge(),Dt=g.pstyle("text-halign").value,Bt=g.pstyle("text-valign").value;Mt&&(Dt="center",Bt="center"),z+=At,S+=xt;var Zt;switch(T?Zt=this.getTextAngle(g,x):Zt=0,Zt!==0&&(V=z,U=S,y.translate(V,U),y.rotate(Zt),z=0,S=0),Bt){case"top":break;case"center":S+=dt/2;break;case"bottom":S+=dt;break}var Kt=g.pstyle("text-background-opacity").value,$t=g.pstyle("text-border-opacity").value,ee=g.pstyle("text-border-width").pfValue,Ht=g.pstyle("text-background-padding").pfValue;if(Kt>0||ee>0&&$t>0){var ge=z-Ht;switch(Dt){case"left":ge-=ut;break;case"center":ge-=ut/2;break}var be=S-dt-Ht,re=ut+2*Ht,Ne=dt+2*Ht;if(Kt>0){var ve=y.fillStyle,fn=g.pstyle("text-background-color").value;y.fillStyle="rgba("+fn[0]+","+fn[1]+","+fn[2]+","+Kt*$+")";var $e=g.pstyle("text-background-shape").strValue;$e.indexOf("round")===0?$gt(y,ge,be,re,Ne,2):y.fillRect(ge,be,re,Ne),y.fillStyle=ve}if(ee>0&&$t>0){var qe=y.strokeStyle,xn=y.lineWidth,Pn=g.pstyle("text-border-color").value,er=g.pstyle("text-border-style").value;if(y.strokeStyle="rgba("+Pn[0]+","+Pn[1]+","+Pn[2]+","+$t*$+")",y.lineWidth=ee,y.setLineDash)switch(er){case"dotted":y.setLineDash([1,1]);break;case"dashed":y.setLineDash([4,2]);break;case"double":y.lineWidth=ee/4,y.setLineDash([]);break;case"solid":y.setLineDash([]);break}if(y.strokeRect(ge,be,re,Ne),er==="double"){var Sn=ee/2;y.strokeRect(ge+Sn,be+Sn,re-Sn*2,Ne-Sn*2)}y.setLineDash&&y.setLineDash([]),y.lineWidth=xn,y.strokeStyle=qe}}var Jn=2*g.pstyle("text-outline-width").pfValue;if(Jn>0&&(y.lineWidth=Jn),g.pstyle("text-wrap").value==="wrap"){var fr=wp(O,"labelWrapCachedLines",x),Sr=wp(O,"labelLineHeight",x),wr=ut/2,cr=this.getLabelJustification(g);switch(cr==="auto"||(Dt==="left"?cr==="left"?z+=-ut:cr==="center"&&(z+=-wr):Dt==="center"?cr==="left"?z+=-wr:cr==="right"&&(z+=wr):Dt==="right"&&(cr==="center"?z+=wr:cr==="right"&&(z+=ut))),Bt){case"top":S-=(fr.length-1)*Sr;break;case"center":case"bottom":S-=(fr.length-1)*Sr;break}for(var bn=0;bn<fr.length;bn++)Jn>0&&y.strokeText(fr[bn],z,S),y.fillText(fr[bn],z,S),S+=Sr}else Jn>0&&y.strokeText(tt,z,S),y.fillText(tt,z,S);Zt!==0&&(y.rotate(-Zt),y.translate(-V,-U))}}};var Vk={};Vk.drawNode=function(y,g,x){var T=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,A=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,I=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,O=this,$,z,S=g._private,V=S.rscratch,U=g.position();if(!(!rt(U.x)||!rt(U.y))&&!(I&&!g.visible())){var tt=I?g.effectiveOpacity():1,at=O.usePaths(),ut,dt=!1,At=g.padding();$=g.width()+2*At,z=g.height()+2*At;var xt;x&&(xt=x,y.translate(-xt.x1,-xt.y1));for(var Mt=g.pstyle("background-image"),Dt=Mt.value,Bt=new Array(Dt.length),Zt=new Array(Dt.length),Kt=0,$t=0;$t<Dt.length;$t++){var ee=Dt[$t],Ht=Bt[$t]=ee!=null&&ee!=="none";if(Ht){var ge=g.cy().style().getIndexedStyle(g,"background-image-crossorigin","value",$t);Kt++,Zt[$t]=O.getCachedImage(ee,ge,function(){S.backgroundTimestamp=Date.now(),g.emitAndNotify("background")})}}var be=g.pstyle("background-blacken").value,re=g.pstyle("border-width").pfValue,Ne=g.pstyle("background-opacity").value*tt,ve=g.pstyle("border-color").value,fn=g.pstyle("border-style").value,$e=g.pstyle("border-opacity").value*tt;y.lineJoin="miter";var qe=function(){var Ri=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ne;O.eleFillStyle(y,g,Ri)},xn=function(){var Ri=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$e;O.colorStrokeStyle(y,ve[0],ve[1],ve[2],Ri)},Pn=g.pstyle("shape").strValue,er=g.pstyle("shape-polygon-points").pfValue;if(at){y.translate(U.x,U.y);var Sn=O.nodePathCache=O.nodePathCache||[],Jn=R5(Pn==="polygon"?Pn+","+er.join(","):Pn,""+z,""+$),fr=Sn[Jn];fr!=null?(ut=fr,dt=!0,V.pathCache=ut):(ut=new Path2D,Sn[Jn]=V.pathCache=ut)}var Sr=function(){if(!dt){var Ri=U;at&&(Ri={x:0,y:0}),O.nodeShapes[O.getNodeShape(g)].draw(ut||y,Ri.x,Ri.y,$,z)}at?y.fill(ut):y.fill()},wr=function(){for(var Ri=arguments.length>0&&arguments[0]!==void 0?arguments[0]:tt,as=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,no=S.backgrounding,ca=0,ea=0;ea<Zt.length;ea++){var Fr=g.cy().style().getIndexedStyle(g,"background-image-containment","value",ea);if(as&&Fr==="over"||!as&&Fr==="inside"){ca++;continue}Bt[ea]&&Zt[ea].complete&&!Zt[ea].error&&(ca++,O.drawInscribedImage(y,Zt[ea],g,ea,Ri))}S.backgrounding=ca!==Kt,no!==S.backgrounding&&g.updateStyle(!1)},cr=function(){var Ri=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,as=arguments.length>1&&arguments[1]!==void 0?arguments[1]:tt;O.hasPie(g)&&(O.drawPie(y,g,as),Ri&&(at||O.nodeShapes[O.getNodeShape(g)].draw(y,U.x,U.y,$,z)))},bn=function(){var Ri=arguments.length>0&&arguments[0]!==void 0?arguments[0]:tt,as=(be>0?be:-be)*Ri,no=be>0?0:255;be!==0&&(O.colorFillStyle(y,no,no,no,as),at?y.fill(ut):y.fill())},Tr=function(){if(re>0){if(y.lineWidth=re,y.lineCap="butt",y.setLineDash)switch(fn){case"dotted":y.setLineDash([1,1]);break;case"dashed":y.setLineDash([4,2]);break;case"solid":case"double":y.setLineDash([]);break}if(at?y.stroke(ut):y.stroke(),fn==="double"){y.lineWidth=re/3;var Ri=y.globalCompositeOperation;y.globalCompositeOperation="destination-out",at?y.stroke(ut):y.stroke(),y.globalCompositeOperation=Ri}y.setLineDash&&y.setLineDash([])}},xr=function(){A&&O.drawNodeOverlay(y,g,U,$,z)},fi=function(){A&&O.drawNodeUnderlay(y,g,U,$,z)},Ii=function(){O.drawElementText(y,g,null,T)},oa=g.pstyle("ghost").value==="yes";if(oa){var Fa=g.pstyle("ghost-offset-x").pfValue,Fi=g.pstyle("ghost-offset-y").pfValue,Ci=g.pstyle("ghost-opacity").value,Ls=Ci*tt;y.translate(Fa,Fi),qe(Ci*Ne),Sr(),wr(Ls,!0),xn(Ci*$e),Tr(),cr(be!==0||re!==0),wr(Ls,!1),bn(Ls),y.translate(-Fa,-Fi)}at&&y.translate(-U.x,-U.y),fi(),at&&y.translate(U.x,U.y),qe(),Sr(),wr(tt,!0),xn(),Tr(),cr(be!==0||re!==0),wr(tt,!1),bn(),at&&y.translate(-U.x,-U.y),Ii(),xr(),x&&y.translate(xt.x1,xt.y1)}};var htt=function(g){if(!["overlay","underlay"].includes(g))throw new Error("Invalid state");return function(x,T,A,I,O){var $=this;if(T.visible()){var z=T.pstyle("".concat(g,"-padding")).pfValue,S=T.pstyle("".concat(g,"-opacity")).value,V=T.pstyle("".concat(g,"-color")).value,U=T.pstyle("".concat(g,"-shape")).value;if(S>0){if(A=A||T.position(),I==null||O==null){var tt=T.padding();I=T.width()+2*tt,O=T.height()+2*tt}$.colorFillStyle(x,V[0],V[1],V[2],S),$.nodeShapes[U].draw(x,A.x,A.y,I+z*2,O+z*2),x.fill()}}}};Vk.drawNodeOverlay=htt("overlay"),Vk.drawNodeUnderlay=htt("underlay"),Vk.hasPie=function(y){return y=y[0],y._private.hasPie},Vk.drawPie=function(y,g,x,T){g=g[0],T=T||g.position();var A=g.cy().style(),I=g.pstyle("pie-size"),O=T.x,$=T.y,z=g.width(),S=g.height(),V=Math.min(z,S)/2,U=0,tt=this.usePaths();tt&&(O=0,$=0),I.units==="%"?V=V*I.pfValue:I.pfValue!==void 0&&(V=I.pfValue/2);for(var at=1;at<=A.pieBackgroundN;at++){var ut=g.pstyle("pie-"+at+"-background-size").value,dt=g.pstyle("pie-"+at+"-background-color").value,At=g.pstyle("pie-"+at+"-background-opacity").value*x,xt=ut/100;xt+U>1&&(xt=1-U);var Mt=1.5*Math.PI+2*Math.PI*U,Dt=2*Math.PI*xt,Bt=Mt+Dt;ut===0||U>=1||U+xt>1||(y.beginPath(),y.moveTo(O,$),y.arc(O,$,V,Mt,Bt),y.closePath(),this.colorFillStyle(y,dt[0],dt[1],dt[2],At),y.fill(),U+=xt)}};var vg={},zgt=100;vg.getPixelRatio=function(){var y=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var g=y.backingStorePixelRatio||y.webkitBackingStorePixelRatio||y.mozBackingStorePixelRatio||y.msBackingStorePixelRatio||y.oBackingStorePixelRatio||y.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/g},vg.paintCache=function(y){for(var g=this.paintCaches=this.paintCaches||[],x=!0,T,A=0;A<g.length;A++)if(T=g[A],T.context===y){x=!1;break}return x&&(T={context:y},g.push(T)),T},vg.createGradientStyleFor=function(y,g,x,T,A){var I,O=this.usePaths(),$=x.pstyle(g+"-gradient-stop-colors").value,z=x.pstyle(g+"-gradient-stop-positions").pfValue;if(T==="radial-gradient")if(x.isEdge()){var S=x.sourceEndpoint(),V=x.targetEndpoint(),U=x.midpoint(),tt=T3(S,U),at=T3(V,U);I=y.createRadialGradient(U.x,U.y,0,U.x,U.y,Math.max(tt,at))}else{var ut=O?{x:0,y:0}:x.position(),dt=x.paddedWidth(),At=x.paddedHeight();I=y.createRadialGradient(ut.x,ut.y,0,ut.x,ut.y,Math.max(dt,At))}else if(x.isEdge()){var xt=x.sourceEndpoint(),Mt=x.targetEndpoint();I=y.createLinearGradient(xt.x,xt.y,Mt.x,Mt.y)}else{var Dt=O?{x:0,y:0}:x.position(),Bt=x.paddedWidth(),Zt=x.paddedHeight(),Kt=Bt/2,$t=Zt/2,ee=x.pstyle("background-gradient-direction").value;switch(ee){case"to-bottom":I=y.createLinearGradient(Dt.x,Dt.y-$t,Dt.x,Dt.y+$t);break;case"to-top":I=y.createLinearGradient(Dt.x,Dt.y+$t,Dt.x,Dt.y-$t);break;case"to-left":I=y.createLinearGradient(Dt.x+Kt,Dt.y,Dt.x-Kt,Dt.y);break;case"to-right":I=y.createLinearGradient(Dt.x-Kt,Dt.y,Dt.x+Kt,Dt.y);break;case"to-bottom-right":case"to-right-bottom":I=y.createLinearGradient(Dt.x-Kt,Dt.y-$t,Dt.x+Kt,Dt.y+$t);break;case"to-top-right":case"to-right-top":I=y.createLinearGradient(Dt.x-Kt,Dt.y+$t,Dt.x+Kt,Dt.y-$t);break;case"to-bottom-left":case"to-left-bottom":I=y.createLinearGradient(Dt.x+Kt,Dt.y-$t,Dt.x-Kt,Dt.y+$t);break;case"to-top-left":case"to-left-top":I=y.createLinearGradient(Dt.x+Kt,Dt.y+$t,Dt.x-Kt,Dt.y-$t);break}}if(!I)return null;for(var Ht=z.length===$.length,ge=$.length,be=0;be<ge;be++)I.addColorStop(Ht?z[be]:be/(ge-1),"rgba("+$[be][0]+","+$[be][1]+","+$[be][2]+","+A+")");return I},vg.gradientFillStyle=function(y,g,x,T){var A=this.createGradientStyleFor(y,"background",g,x,T);if(!A)return null;y.fillStyle=A},vg.colorFillStyle=function(y,g,x,T,A){y.fillStyle="rgba("+g+","+x+","+T+","+A+")"},vg.eleFillStyle=function(y,g,x){var T=g.pstyle("background-fill").value;if(T==="linear-gradient"||T==="radial-gradient")this.gradientFillStyle(y,g,T,x);else{var A=g.pstyle("background-color").value;this.colorFillStyle(y,A[0],A[1],A[2],x)}},vg.gradientStrokeStyle=function(y,g,x,T){var A=this.createGradientStyleFor(y,"line",g,x,T);if(!A)return null;y.strokeStyle=A},vg.colorStrokeStyle=function(y,g,x,T,A){y.strokeStyle="rgba("+g+","+x+","+T+","+A+")"},vg.eleStrokeStyle=function(y,g,x){var T=g.pstyle("line-fill").value;if(T==="linear-gradient"||T==="radial-gradient")this.gradientStrokeStyle(y,g,T,x);else{var A=g.pstyle("line-color").value;this.colorStrokeStyle(y,A[0],A[1],A[2],x)}},vg.matchCanvasSize=function(y){var g=this,x=g.data,T=g.findContainerClientCoords(),A=T[2],I=T[3],O=g.getPixelRatio(),$=g.motionBlurPxRatio;(y===g.data.bufferCanvases[g.MOTIONBLUR_BUFFER_NODE]||y===g.data.bufferCanvases[g.MOTIONBLUR_BUFFER_DRAG])&&(O=$);var z=A*O,S=I*O,V;if(!(z===g.canvasWidth&&S===g.canvasHeight)){g.fontCaches=null;var U=x.canvasContainer;U.style.width=A+"px",U.style.height=I+"px";for(var tt=0;tt<g.CANVAS_LAYERS;tt++)V=x.canvases[tt],V.width=z,V.height=S,V.style.width=A+"px",V.style.height=I+"px";for(var tt=0;tt<g.BUFFER_COUNT;tt++)V=x.bufferCanvases[tt],V.width=z,V.height=S,V.style.width=A+"px",V.style.height=I+"px";g.textureMult=1,O<=1&&(V=x.bufferCanvases[g.TEXTURE_BUFFER],g.textureMult=2,V.width=z*g.textureMult,V.height=S*g.textureMult),g.canvasWidth=z,g.canvasHeight=S}},vg.renderTo=function(y,g,x,T){this.render({forcedContext:y,forcedZoom:g,forcedPan:x,drawAllLayers:!0,forcedPxRatio:T})},vg.render=function(y){y=y||zN();var g=y.forcedContext,x=y.drawAllLayers,T=y.drawOnlyNodeLayer,A=y.forcedZoom,I=y.forcedPan,O=this,$=y.forcedPxRatio===void 0?this.getPixelRatio():y.forcedPxRatio,z=O.cy,S=O.data,V=S.canvasNeedsRedraw,U=O.textureOnViewport&&!g&&(O.pinching||O.hoverData.dragging||O.swipePanning||O.data.wheelZooming),tt=y.motionBlur!==void 0?y.motionBlur:O.motionBlur,at=O.motionBlurPxRatio,ut=z.hasCompoundNodes(),dt=O.hoverData.draggingEles,At=!!(O.hoverData.selecting||O.touchData.selecting);tt=tt&&!g&&O.motionBlurEnabled&&!At;var xt=tt;g||(O.prevPxRatio!==$&&(O.invalidateContainerClientCoordsCache(),O.matchCanvasSize(O.container),O.redrawHint("eles",!0),O.redrawHint("drag",!0)),O.prevPxRatio=$),!g&&O.motionBlurTimeout&&clearTimeout(O.motionBlurTimeout),tt&&(O.mbFrames==null&&(O.mbFrames=0),O.mbFrames++,O.mbFrames<3&&(xt=!1),O.mbFrames>O.minMbLowQualFrames&&(O.motionBlurPxRatio=O.mbPxRBlurry)),O.clearingMotionBlur&&(O.motionBlurPxRatio=1),O.textureDrawLastFrame&&!U&&(V[O.NODE]=!0,V[O.SELECT_BOX]=!0);var Mt=z.style(),Dt=z.zoom(),Bt=A!==void 0?A:Dt,Zt=z.pan(),Kt={x:Zt.x,y:Zt.y},$t={zoom:Dt,pan:{x:Zt.x,y:Zt.y}},ee=O.prevViewport,Ht=ee===void 0||$t.zoom!==ee.zoom||$t.pan.x!==ee.pan.x||$t.pan.y!==ee.pan.y;!Ht&&!(dt&&!ut)&&(O.motionBlurPxRatio=1),I&&(Kt=I),Bt*=$,Kt.x*=$,Kt.y*=$;var ge=O.getCachedZSortedEles();function be(Fi,Ci,Ls,es,Ri){var as=Fi.globalCompositeOperation;Fi.globalCompositeOperation="destination-out",O.colorFillStyle(Fi,255,255,255,O.motionBlurTransparency),Fi.fillRect(Ci,Ls,es,Ri),Fi.globalCompositeOperation=as}function re(Fi,Ci){var Ls,es,Ri,as;!O.clearingMotionBlur&&(Fi===S.bufferContexts[O.MOTIONBLUR_BUFFER_NODE]||Fi===S.bufferContexts[O.MOTIONBLUR_BUFFER_DRAG])?(Ls={x:Zt.x*at,y:Zt.y*at},es=Dt*at,Ri=O.canvasWidth*at,as=O.canvasHeight*at):(Ls=Kt,es=Bt,Ri=O.canvasWidth,as=O.canvasHeight),Fi.setTransform(1,0,0,1,0,0),Ci==="motionBlur"?be(Fi,0,0,Ri,as):!g&&(Ci===void 0||Ci)&&Fi.clearRect(0,0,Ri,as),x||(Fi.translate(Ls.x,Ls.y),Fi.scale(es,es)),I&&Fi.translate(I.x,I.y),A&&Fi.scale(A,A)}if(U||(O.textureDrawLastFrame=!1),U){if(O.textureDrawLastFrame=!0,!O.textureCache){O.textureCache={},O.textureCache.bb=z.mutableElements().boundingBox(),O.textureCache.texture=O.data.bufferCanvases[O.TEXTURE_BUFFER];var Ne=O.data.bufferContexts[O.TEXTURE_BUFFER];Ne.setTransform(1,0,0,1,0,0),Ne.clearRect(0,0,O.canvasWidth*O.textureMult,O.canvasHeight*O.textureMult),O.render({forcedContext:Ne,drawOnlyNodeLayer:!0,forcedPxRatio:$*O.textureMult});var $t=O.textureCache.viewport={zoom:z.zoom(),pan:z.pan(),width:O.canvasWidth,height:O.canvasHeight};$t.mpan={x:(0-$t.pan.x)/$t.zoom,y:(0-$t.pan.y)/$t.zoom}}V[O.DRAG]=!1,V[O.NODE]=!1;var ve=S.contexts[O.NODE],fn=O.textureCache.texture,$t=O.textureCache.viewport;ve.setTransform(1,0,0,1,0,0),tt?be(ve,0,0,$t.width,$t.height):ve.clearRect(0,0,$t.width,$t.height);var $e=Mt.core("outside-texture-bg-color").value,qe=Mt.core("outside-texture-bg-opacity").value;O.colorFillStyle(ve,$e[0],$e[1],$e[2],qe),ve.fillRect(0,0,$t.width,$t.height);var Dt=z.zoom();re(ve,!1),ve.clearRect($t.mpan.x,$t.mpan.y,$t.width/$t.zoom/$,$t.height/$t.zoom/$),ve.drawImage(fn,$t.mpan.x,$t.mpan.y,$t.width/$t.zoom/$,$t.height/$t.zoom/$)}else O.textureOnViewport&&!g&&(O.textureCache=null);var xn=z.extent(),Pn=O.pinching||O.hoverData.dragging||O.swipePanning||O.data.wheelZooming||O.hoverData.draggingEles||O.cy.animated(),er=O.hideEdgesOnViewport&&Pn,Sn=[];if(Sn[O.NODE]=!V[O.NODE]&&tt&&!O.clearedForMotionBlur[O.NODE]||O.clearingMotionBlur,Sn[O.NODE]&&(O.clearedForMotionBlur[O.NODE]=!0),Sn[O.DRAG]=!V[O.DRAG]&&tt&&!O.clearedForMotionBlur[O.DRAG]||O.clearingMotionBlur,Sn[O.DRAG]&&(O.clearedForMotionBlur[O.DRAG]=!0),V[O.NODE]||x||T||Sn[O.NODE]){var Jn=tt&&!Sn[O.NODE]&&at!==1,ve=g||(Jn?O.data.bufferContexts[O.MOTIONBLUR_BUFFER_NODE]:S.contexts[O.NODE]),fr=tt&&!Jn?"motionBlur":void 0;re(ve,fr),er?O.drawCachedNodes(ve,ge.nondrag,$,xn):O.drawLayeredElements(ve,ge.nondrag,$,xn),O.debug&&O.drawDebugPoints(ve,ge.nondrag),!x&&!tt&&(V[O.NODE]=!1)}if(!T&&(V[O.DRAG]||x||Sn[O.DRAG])){var Jn=tt&&!Sn[O.DRAG]&&at!==1,ve=g||(Jn?O.data.bufferContexts[O.MOTIONBLUR_BUFFER_DRAG]:S.contexts[O.DRAG]);re(ve,tt&&!Jn?"motionBlur":void 0),er?O.drawCachedNodes(ve,ge.drag,$,xn):O.drawCachedElements(ve,ge.drag,$,xn),O.debug&&O.drawDebugPoints(ve,ge.drag),!x&&!tt&&(V[O.DRAG]=!1)}if(O.showFps||!T&&V[O.SELECT_BOX]&&!x){var ve=g||S.contexts[O.SELECT_BOX];if(re(ve),O.selection[4]==1&&(O.hoverData.selecting||O.touchData.selecting)){var Dt=O.cy.zoom(),Sr=Mt.core("selection-box-border-width").value/Dt;ve.lineWidth=Sr,ve.fillStyle="rgba("+Mt.core("selection-box-color").value[0]+","+Mt.core("selection-box-color").value[1]+","+Mt.core("selection-box-color").value[2]+","+Mt.core("selection-box-opacity").value+")",ve.fillRect(O.selection[0],O.selection[1],O.selection[2]-O.selection[0],O.selection[3]-O.selection[1]),Sr>0&&(ve.strokeStyle="rgba("+Mt.core("selection-box-border-color").value[0]+","+Mt.core("selection-box-border-color").value[1]+","+Mt.core("selection-box-border-color").value[2]+","+Mt.core("selection-box-opacity").value+")",ve.strokeRect(O.selection[0],O.selection[1],O.selection[2]-O.selection[0],O.selection[3]-O.selection[1]))}if(S.bgActivePosistion&&!O.hoverData.selecting){var Dt=O.cy.zoom(),wr=S.bgActivePosistion;ve.fillStyle="rgba("+Mt.core("active-bg-color").value[0]+","+Mt.core("active-bg-color").value[1]+","+Mt.core("active-bg-color").value[2]+","+Mt.core("active-bg-opacity").value+")",ve.beginPath(),ve.arc(wr.x,wr.y,Mt.core("active-bg-size").pfValue/Dt,0,2*Math.PI),ve.fill()}var cr=O.lastRedrawTime;if(O.showFps&&cr){cr=Math.round(cr);var bn=Math.round(1e3/cr);ve.setTransform(1,0,0,1,0,0),ve.fillStyle="rgba(255, 0, 0, 0.75)",ve.strokeStyle="rgba(255, 0, 0, 0.75)",ve.lineWidth=1,ve.fillText("1 frame = "+cr+" ms = "+bn+" fps",0,20);var Tr=60;ve.strokeRect(0,30,250,20),ve.fillRect(0,30,250*Math.min(bn/Tr,1),20)}x||(V[O.SELECT_BOX]=!1)}if(tt&&at!==1){var xr=S.contexts[O.NODE],fi=O.data.bufferCanvases[O.MOTIONBLUR_BUFFER_NODE],Ii=S.contexts[O.DRAG],oa=O.data.bufferCanvases[O.MOTIONBLUR_BUFFER_DRAG],Fa=function(Ci,Ls,es){Ci.setTransform(1,0,0,1,0,0),es||!xt?Ci.clearRect(0,0,O.canvasWidth,O.canvasHeight):be(Ci,0,0,O.canvasWidth,O.canvasHeight);var Ri=at;Ci.drawImage(Ls,0,0,O.canvasWidth*Ri,O.canvasHeight*Ri,0,0,O.canvasWidth,O.canvasHeight)};(V[O.NODE]||Sn[O.NODE])&&(Fa(xr,fi,Sn[O.NODE]),V[O.NODE]=!1),(V[O.DRAG]||Sn[O.DRAG])&&(Fa(Ii,oa,Sn[O.DRAG]),V[O.DRAG]=!1)}O.prevViewport=$t,O.clearingMotionBlur&&(O.clearingMotionBlur=!1,O.motionBlurCleared=!0,O.motionBlur=!0),tt&&(O.motionBlurTimeout=setTimeout(function(){O.motionBlurTimeout=null,O.clearedForMotionBlur[O.NODE]=!1,O.clearedForMotionBlur[O.DRAG]=!1,O.motionBlur=!1,O.clearingMotionBlur=!U,O.mbFrames=0,V[O.NODE]=!0,V[O.DRAG]=!0,O.redraw()},zgt)),g||z.emit("render")};var I3={};I3.drawPolygonPath=function(y,g,x,T,A,I){var O=T/2,$=A/2;y.beginPath&&y.beginPath(),y.moveTo(g+O*I[0],x+$*I[1]);for(var z=1;z<I.length/2;z++)y.lineTo(g+O*I[z*2],x+$*I[z*2+1]);y.closePath()},I3.drawRoundPolygonPath=function(y,g,x,T,A,I){var O=T/2,$=A/2,z=SL(T,A);y.beginPath&&y.beginPath();for(var S=0;S<I.length/4;S++){var V=void 0,U=void 0;S===0?V=I.length-2:V=S*4-2,U=S*4+2;var tt=g+O*I[S*4],at=x+$*I[S*4+1],ut=-I[V]*I[U]-I[V+1]*I[U+1],dt=z/Math.tan(Math.acos(ut)/2),At=tt-dt*I[V],xt=at-dt*I[V+1],Mt=tt+dt*I[U],Dt=at+dt*I[U+1];S===0?y.moveTo(At,xt):y.lineTo(At,xt),y.arcTo(tt,at,Mt,Dt,z)}y.closePath()},I3.drawRoundRectanglePath=function(y,g,x,T,A){var I=T/2,O=A/2,$=xk(T,A);y.beginPath&&y.beginPath(),y.moveTo(g,x-O),y.arcTo(g+I,x-O,g+I,x,$),y.arcTo(g+I,x+O,g,x+O,$),y.arcTo(g-I,x+O,g-I,x,$),y.arcTo(g-I,x-O,g,x-O,$),y.lineTo(g,x-O),y.closePath()},I3.drawBottomRoundRectanglePath=function(y,g,x,T,A){var I=T/2,O=A/2,$=xk(T,A);y.beginPath&&y.beginPath(),y.moveTo(g,x-O),y.lineTo(g+I,x-O),y.lineTo(g+I,x),y.arcTo(g+I,x+O,g,x+O,$),y.arcTo(g-I,x+O,g-I,x,$),y.lineTo(g-I,x-O),y.lineTo(g,x-O),y.closePath()},I3.drawCutRectanglePath=function(y,g,x,T,A){var I=T/2,O=A/2,$=ZN();y.beginPath&&y.beginPath(),y.moveTo(g-I+$,x-O),y.lineTo(g+I-$,x-O),y.lineTo(g+I,x-O+$),y.lineTo(g+I,x+O-$),y.lineTo(g+I-$,x+O),y.lineTo(g-I+$,x+O),y.lineTo(g-I,x+O-$),y.lineTo(g-I,x-O+$),y.closePath()},I3.drawBarrelPath=function(y,g,x,T,A){var I=T/2,O=A/2,$=g-I,z=g+I,S=x-O,V=x+O,U=AL(T,A),tt=U.widthOffset,at=U.heightOffset,ut=U.ctrlPtOffsetPct*tt;y.beginPath&&y.beginPath(),y.moveTo($,S+at),y.lineTo($,V-at),y.quadraticCurveTo($+ut,V,$+tt,V),y.lineTo(z-tt,V),y.quadraticCurveTo(z-ut,V,z,V-at),y.lineTo(z,S+at),y.quadraticCurveTo(z-ut,S,z-tt,S),y.lineTo($+tt,S),y.quadraticCurveTo($+ut,S,$,S+at),y.closePath()};for(var ftt=Math.sin(0),dtt=Math.cos(0),VB={},GB={},gtt=Math.PI/40,Gk=0*Math.PI;Gk<2*Math.PI;Gk+=gtt)VB[Gk]=Math.sin(Gk),GB[Gk]=Math.cos(Gk);I3.drawEllipsePath=function(y,g,x,T,A){if(y.beginPath&&y.beginPath(),y.ellipse)y.ellipse(g,x,T/2,A/2,0,0,2*Math.PI);else for(var I,O,$=T/2,z=A/2,S=0*Math.PI;S<2*Math.PI;S+=gtt)I=g-$*VB[S]*ftt+$*GB[S]*dtt,O=x+z*GB[S]*ftt+z*VB[S]*dtt,S===0?y.moveTo(I,O):y.lineTo(I,O);y.closePath()};var wT={};wT.createBuffer=function(y,g){var x=document.createElement("canvas");return x.width=y,x.height=g,[x,x.getContext("2d")]},wT.bufferCanvasImage=function(y){var g=this.cy,x=g.mutableElements(),T=x.boundingBox(),A=this.findContainerClientCoords(),I=y.full?Math.ceil(T.w):A[2],O=y.full?Math.ceil(T.h):A[3],$=rt(y.maxWidth)||rt(y.maxHeight),z=this.getPixelRatio(),S=1;if(y.scale!==void 0)I*=y.scale,O*=y.scale,S=y.scale;else if($){var V=1/0,U=1/0;rt(y.maxWidth)&&(V=S*y.maxWidth/I),rt(y.maxHeight)&&(U=S*y.maxHeight/O),S=Math.min(V,U),I*=S,O*=S}$||(I*=z,O*=z,S*=z);var tt=document.createElement("canvas");tt.width=I,tt.height=O,tt.style.width=I+"px",tt.style.height=O+"px";var at=tt.getContext("2d");if(I>0&&O>0){at.clearRect(0,0,I,O),at.globalCompositeOperation="source-over";var ut=this.getCachedZSortedEles();if(y.full)at.translate(-T.x1*S,-T.y1*S),at.scale(S,S),this.drawElements(at,ut),at.scale(1/S,1/S),at.translate(T.x1*S,T.y1*S);else{var dt=g.pan(),At={x:dt.x*S,y:dt.y*S};S*=g.zoom(),at.translate(At.x,At.y),at.scale(S,S),this.drawElements(at,ut),at.scale(1/S,1/S),at.translate(-At.x,-At.y)}y.bg&&(at.globalCompositeOperation="destination-over",at.fillStyle=y.bg,at.rect(0,0,I,O),at.fill())}return tt};function qgt(y,g){for(var x=atob(y),T=new ArrayBuffer(x.length),A=new Uint8Array(T),I=0;I<x.length;I++)A[I]=x.charCodeAt(I);return new Blob([T],{type:g})}function ptt(y){var g=y.indexOf(",");return y.substr(g+1)}function btt(y,g,x){var T=function(){return g.toDataURL(x,y.quality)};switch(y.output){case"blob-promise":return new W5(function(A,I){try{g.toBlob(function(O){O!=null?A(O):I(new Error("`canvas.toBlob()` sent a null value in its callback"))},x,y.quality)}catch(O){I(O)}});case"blob":return qgt(ptt(T()),x);case"base64":return ptt(T());case"base64uri":default:return T()}}wT.png=function(y){return btt(y,this.bufferCanvasImage(y),"image/png")},wT.jpg=function(y){return btt(y,this.bufferCanvasImage(y),"image/jpeg")};var vtt={};vtt.nodeShapeImpl=function(y,g,x,T,A,I,O){switch(y){case"ellipse":return this.drawEllipsePath(g,x,T,A,I);case"polygon":return this.drawPolygonPath(g,x,T,A,I,O);case"round-polygon":return this.drawRoundPolygonPath(g,x,T,A,I,O);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(g,x,T,A,I);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(g,x,T,A,I);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(g,x,T,A,I);case"barrel":return this.drawBarrelPath(g,x,T,A,I)}};var Hgt=UB,Dc=UB.prototype;Dc.CANVAS_LAYERS=3,Dc.SELECT_BOX=0,Dc.DRAG=1,Dc.NODE=2,Dc.BUFFER_COUNT=3,Dc.TEXTURE_BUFFER=0,Dc.MOTIONBLUR_BUFFER_NODE=1,Dc.MOTIONBLUR_BUFFER_DRAG=2;function UB(y){var g=this;g.data={canvases:new Array(Dc.CANVAS_LAYERS),contexts:new Array(Dc.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Dc.CANVAS_LAYERS),bufferCanvases:new Array(Dc.BUFFER_COUNT),bufferContexts:new Array(Dc.CANVAS_LAYERS)};var x="-webkit-tap-highlight-color",T="rgba(0,0,0,0)";g.data.canvasContainer=document.createElement("div");var A=g.data.canvasContainer.style;g.data.canvasContainer.style[x]=T,A.position="relative",A.zIndex="0",A.overflow="hidden";var I=y.cy.container();I.appendChild(g.data.canvasContainer),I.style[x]=T;var O={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};Pt()&&(O["-ms-touch-action"]="none",O["touch-action"]="none");for(var $=0;$<Dc.CANVAS_LAYERS;$++){var z=g.data.canvases[$]=document.createElement("canvas");g.data.contexts[$]=z.getContext("2d"),Object.keys(O).forEach(function(cr){z.style[cr]=O[cr]}),z.style.position="absolute",z.setAttribute("data-id","layer"+$),z.style.zIndex=String(Dc.CANVAS_LAYERS-$),g.data.canvasContainer.appendChild(z),g.data.canvasNeedsRedraw[$]=!1}g.data.topCanvas=g.data.canvases[0],g.data.canvases[Dc.NODE].setAttribute("data-id","layer"+Dc.NODE+"-node"),g.data.canvases[Dc.SELECT_BOX].setAttribute("data-id","layer"+Dc.SELECT_BOX+"-selectbox"),g.data.canvases[Dc.DRAG].setAttribute("data-id","layer"+Dc.DRAG+"-drag");for(var $=0;$<Dc.BUFFER_COUNT;$++)g.data.bufferCanvases[$]=document.createElement("canvas"),g.data.bufferContexts[$]=g.data.bufferCanvases[$].getContext("2d"),g.data.bufferCanvases[$].style.position="absolute",g.data.bufferCanvases[$].setAttribute("data-id","buffer"+$),g.data.bufferCanvases[$].style.zIndex=String(-$-1),g.data.bufferCanvases[$].style.visibility="hidden";g.pathsEnabled=!0;var S=zd(),V=function(bn){return{x:(bn.x1+bn.x2)/2,y:(bn.y1+bn.y2)/2}},U=function(bn){return{x:-bn.w/2,y:-bn.h/2}},tt=function(bn){var Tr=bn[0]._private,xr=Tr.oldBackgroundTimestamp===Tr.backgroundTimestamp;return!xr},at=function(bn){return bn[0]._private.nodeKey},ut=function(bn){return bn[0]._private.labelStyleKey},dt=function(bn){return bn[0]._private.sourceLabelStyleKey},At=function(bn){return bn[0]._private.targetLabelStyleKey},xt=function(bn,Tr,xr,fi,Ii){return g.drawElement(bn,Tr,xr,!1,!1,Ii)},Mt=function(bn,Tr,xr,fi,Ii){return g.drawElementText(bn,Tr,xr,fi,"main",Ii)},Dt=function(bn,Tr,xr,fi,Ii){return g.drawElementText(bn,Tr,xr,fi,"source",Ii)},Bt=function(bn,Tr,xr,fi,Ii){return g.drawElementText(bn,Tr,xr,fi,"target",Ii)},Zt=function(bn){return bn.boundingBox(),bn[0]._private.bodyBounds},Kt=function(bn){return bn.boundingBox(),bn[0]._private.labelBounds.main||S},$t=function(bn){return bn.boundingBox(),bn[0]._private.labelBounds.source||S},ee=function(bn){return bn.boundingBox(),bn[0]._private.labelBounds.target||S},Ht=function(bn,Tr){return Tr},ge=function(bn){return V(Zt(bn))},be=function(bn,Tr,xr){var fi=bn?bn+"-":"";return{x:Tr.x+xr.pstyle(fi+"text-margin-x").pfValue,y:Tr.y+xr.pstyle(fi+"text-margin-y").pfValue}},re=function(bn,Tr,xr){var fi=bn[0]._private.rscratch;return{x:fi[Tr],y:fi[xr]}},Ne=function(bn){return be("",re(bn,"labelX","labelY"),bn)},ve=function(bn){return be("source",re(bn,"sourceLabelX","sourceLabelY"),bn)},fn=function(bn){return be("target",re(bn,"targetLabelX","targetLabelY"),bn)},$e=function(bn){return U(Zt(bn))},qe=function(bn){return U($t(bn))},xn=function(bn){return U(ee(bn))},Pn=function(bn){var Tr=Kt(bn),xr=U(Kt(bn));if(bn.isNode()){switch(bn.pstyle("text-halign").value){case"left":xr.x=-Tr.w;break;case"right":xr.x=0;break}switch(bn.pstyle("text-valign").value){case"top":xr.y=-Tr.h;break;case"bottom":xr.y=0;break}}return xr},er=g.data.eleTxrCache=new zk(g,{getKey:at,doesEleInvalidateKey:tt,drawElement:xt,getBoundingBox:Zt,getRotationPoint:ge,getRotationOffset:$e,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),Sn=g.data.lblTxrCache=new zk(g,{getKey:ut,drawElement:Mt,getBoundingBox:Kt,getRotationPoint:Ne,getRotationOffset:Pn,isVisible:Ht}),Jn=g.data.slbTxrCache=new zk(g,{getKey:dt,drawElement:Dt,getBoundingBox:$t,getRotationPoint:ve,getRotationOffset:qe,isVisible:Ht}),fr=g.data.tlbTxrCache=new zk(g,{getKey:At,drawElement:Bt,getBoundingBox:ee,getRotationPoint:fn,getRotationOffset:xn,isVisible:Ht}),Sr=g.data.lyrTxrCache=new att(g);g.onUpdateEleCalcs(function(bn,Tr){er.invalidateElements(Tr),Sn.invalidateElements(Tr),Jn.invalidateElements(Tr),fr.invalidateElements(Tr),Sr.invalidateElements(Tr);for(var xr=0;xr<Tr.length;xr++){var fi=Tr[xr]._private;fi.oldBackgroundTimestamp=fi.backgroundTimestamp}});var wr=function(bn){for(var Tr=0;Tr<bn.length;Tr++)Sr.enqueueElementRefinement(bn[Tr].ele)};er.onDequeue(wr),Sn.onDequeue(wr),Jn.onDequeue(wr),fr.onDequeue(wr)}Dc.redrawHint=function(y,g){var x=this;switch(y){case"eles":x.data.canvasNeedsRedraw[Dc.NODE]=g;break;case"drag":x.data.canvasNeedsRedraw[Dc.DRAG]=g;break;case"select":x.data.canvasNeedsRedraw[Dc.SELECT_BOX]=g;break}};var wtt=typeof Path2D<"u";Dc.path2dEnabled=function(y){if(y===void 0)return this.pathsEnabled;this.pathsEnabled=!!y},Dc.usePaths=function(){return wtt&&this.pathsEnabled},Dc.setImgSmoothing=function(y,g){y.imageSmoothingEnabled!=null?y.imageSmoothingEnabled=g:(y.webkitImageSmoothingEnabled=g,y.mozImageSmoothingEnabled=g,y.msImageSmoothingEnabled=g)},Dc.getImgSmoothing=function(y){return y.imageSmoothingEnabled!=null?y.imageSmoothingEnabled:y.webkitImageSmoothingEnabled||y.mozImageSmoothingEnabled||y.msImageSmoothingEnabled},Dc.makeOffscreenCanvas=function(y,g){var x;return(typeof OffscreenCanvas>"u"?"undefined":f(OffscreenCanvas))!=="undefined"?x=new OffscreenCanvas(y,g):(x=document.createElement("canvas"),x.width=y,x.height=g),x},[_0,hv,fv,vT,l6,Vk,vg,I3,wT,vtt].forEach(function(y){Ke(Dc,y)});var h6=[{name:"null",impl:LB},{name:"base",impl:ZL},{name:"canvas",impl:Hgt}],wg=[{type:"layout",extensions:zJ},{type:"renderer",extensions:h6}],km={},iM={};function T1(y,g,x){var T=x,A=function(ee){Wo("Can not register `"+g+"` for `"+y+"` since `"+ee+"` already exists in the prototype and can not be overridden")};if(y==="core"){if(Fk.prototype[g])return A(g);Fk.prototype[g]=x}else if(y==="collection"){if(Gf.prototype[g])return A(g);Gf.prototype[g]=x}else if(y==="layout"){for(var I=function(ee){this.options=ee,x.call(this,ee),ft(this._private)||(this._private={}),this._private.cy=ee.cy,this._private.listeners=[],this.createEmitter()},O=I.prototype=Object.create(x.prototype),$=[],z=0;z<$.length;z++){var S=$[z];O[S]=O[S]||function(){return this}}O.start&&!O.run?O.run=function(){return this.start(),this}:!O.start&&O.run&&(O.start=function(){return this.run(),this});var V=x.prototype.stop;O.stop=function(){var $t=this.options;if($t&&$t.animate){var ee=this.animations;if(ee)for(var Ht=0;Ht<ee.length;Ht++)ee[Ht].stop()}return V?V.call(this):this.emit("layoutstop"),this},O.destroy||(O.destroy=function(){return this}),O.cy=function(){return this._private.cy};var U=function(ee){return ee._private.cy},tt={addEventFields:function(ee,Ht){Ht.layout=ee,Ht.cy=U(ee),Ht.target=ee},bubble:function(){return!0},parent:function(ee){return U(ee)}};Ke(O,{createEmitter:function(){return this._private.emitter=new KE(tt,this),this},emitter:function(){return this._private.emitter},on:function(ee,Ht){return this.emitter().on(ee,Ht),this},one:function(ee,Ht){return this.emitter().one(ee,Ht),this},once:function(ee,Ht){return this.emitter().one(ee,Ht),this},removeListener:function(ee,Ht){return this.emitter().removeListener(ee,Ht),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(ee,Ht){return this.emitter().emit(ee,Ht),this}}),jc.eventAliasesOn(O),T=I}else if(y==="renderer"&&g!=="null"&&g!=="base"){var at=f6("renderer","base"),ut=at.prototype,dt=x,At=x.prototype,xt=function(){at.apply(this,arguments),dt.apply(this,arguments)},Mt=xt.prototype;for(var Dt in ut){var Bt=ut[Dt],Zt=At[Dt]!=null;if(Zt)return A(Dt);Mt[Dt]=Bt}for(var Kt in At)Mt[Kt]=At[Kt];ut.clientFunctions.forEach(function($t){Mt[$t]=Mt[$t]||function(){Ec("Renderer does not implement `renderer."+$t+"()` on its prototype")}}),T=xt}else if(y==="__proto__"||y==="constructor"||y==="prototype")return Ec(y+" is an illegal type to be registered, possibly lead to prototype pollutions");return Yn({map:km,keys:[y,g],value:T})}function f6(y,g){return tr({map:km,keys:[y,g]})}function mtt(y,g,x,T,A){return Yn({map:iM,keys:[y,g,x,T],value:A})}function WB(y,g,x,T){return tr({map:iM,keys:[y,g,x,T]})}var O3=function(){if(arguments.length===2)return f6.apply(null,arguments);if(arguments.length===3)return T1.apply(null,arguments);if(arguments.length===4)return WB.apply(null,arguments);if(arguments.length===5)return mtt.apply(null,arguments);Ec("Invalid extension access syntax")};Fk.prototype.extension=O3,wg.forEach(function(y){y.extensions.forEach(function(g){T1(y.type,g.name,g.impl)})});var sM=function y(){if(!(this instanceof y))return new y;this.length=0},Em=sM.prototype;Em.instanceString=function(){return"stylesheet"},Em.selector=function(y){var g=this.length++;return this[g]={selector:y,properties:[]},this},Em.css=function(y,g){var x=this.length-1;if(Tt(y))this[x].properties.push({name:y,value:g});else if(ft(y))for(var T=y,A=Object.keys(T),I=0;I<A.length;I++){var O=A[I],$=T[O];if($!=null){var z=x1.properties[O]||x1.properties[_n(O)];if(z!=null){var S=z.name,V=$;this[x].properties.push({name:S,value:V})}}}return this},Em.style=Em.css,Em.generateStyle=function(y){var g=new x1(y);return this.appendToStyle(g)},Em.appendToStyle=function(y){for(var g=0;g<this.length;g++){var x=this[g],T=x.selector,A=x.properties;y.selector(T);for(var I=0;I<A.length;I++){var O=A[I];y.css(O.name,O.value)}}return y};var KB="3.23.0",_1=function(g){if(g===void 0&&(g={}),ft(g))return new Fk(g);if(Tt(g))return O3.apply(O3,arguments)};return _1.use=function(y){var g=Array.prototype.slice.call(arguments,1);return g.unshift(_1),y.apply(null,g),this},_1.warnings=function(y){return gk(y)},_1.version=KB,_1.stylesheet=_1.Stylesheet=sM,_1})})(fjt);var uUe=fjt.exports;const djt=B9(uUe);var gjt={exports:{}},Sgt={exports:{}},Agt={exports:{}},pjt;function lUe(){return pjt||(pjt=1,function(i,a){(function(p,v){i.exports=v()})(b0,function(){return function(f){var p={};function v(m){if(p[m])return p[m].exports;var b=p[m]={i:m,l:!1,exports:{}};return f[m].call(b.exports,b,b.exports,v),b.l=!0,b.exports}return v.m=f,v.c=p,v.i=function(m){return m},v.d=function(m,b,E){v.o(m,b)||Object.defineProperty(m,b,{configurable:!1,enumerable:!0,get:E})},v.n=function(m){var b=m&&m.__esModule?function(){return m.default}:function(){return m};return v.d(b,"a",b),b},v.o=function(m,b){return Object.prototype.hasOwnProperty.call(m,b)},v.p="",v(v.s=26)}([function(f,p,v){function m(){}m.QUALITY=1,m.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,m.DEFAULT_INCREMENTAL=!1,m.DEFAULT_ANIMATION_ON_LAYOUT=!0,m.DEFAULT_ANIMATION_DURING_LAYOUT=!1,m.DEFAULT_ANIMATION_PERIOD=50,m.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,m.DEFAULT_GRAPH_MARGIN=15,m.NODE_DIMENSIONS_INCLUDE_LABELS=!1,m.SIMPLE_NODE_SIZE=40,m.SIMPLE_NODE_HALF_SIZE=m.SIMPLE_NODE_SIZE/2,m.EMPTY_COMPOUND_NODE_SIZE=40,m.MIN_EDGE_LENGTH=1,m.WORLD_BOUNDARY=1e6,m.INITIAL_WORLD_BOUNDARY=m.WORLD_BOUNDARY/1e3,m.WORLD_CENTER_X=1200,m.WORLD_CENTER_Y=900,f.exports=m},function(f,p,v){var m=v(2),b=v(8),E=v(9);function C(N,B,j){m.call(this,j),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=j,this.bendpoints=[],this.source=N,this.target=B}C.prototype=Object.create(m.prototype);for(var D in m)C[D]=m[D];C.prototype.getSource=function(){return this.source},C.prototype.getTarget=function(){return this.target},C.prototype.isInterGraph=function(){return this.isInterGraph},C.prototype.getLength=function(){return this.length},C.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},C.prototype.getBendpoints=function(){return this.bendpoints},C.prototype.getLca=function(){return this.lca},C.prototype.getSourceInLca=function(){return this.sourceInLca},C.prototype.getTargetInLca=function(){return this.targetInLca},C.prototype.getOtherEnd=function(N){if(this.source===N)return this.target;if(this.target===N)return this.source;throw"Node is not incident with this edge"},C.prototype.getOtherEndInGraph=function(N,B){for(var j=this.getOtherEnd(N),R=B.getGraphManager().getRoot();;){if(j.getOwner()==B)return j;if(j.getOwner()==R)break;j=j.getOwner().getParent()}return null},C.prototype.updateLength=function(){var N=new Array(4);this.isOverlapingSourceAndTarget=b.getIntersection(this.target.getRect(),this.source.getRect(),N),this.isOverlapingSourceAndTarget||(this.lengthX=N[0]-N[2],this.lengthY=N[1]-N[3],Math.abs(this.lengthX)<1&&(this.lengthX=E.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=E.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},C.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=E.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=E.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},f.exports=C},function(f,p,v){function m(b){this.vGraphObject=b}f.exports=m},function(f,p,v){var m=v(2),b=v(10),E=v(13),C=v(0),D=v(16),N=v(4);function B(R,H,Y,it){Y==null&&it==null&&(it=H),m.call(this,it),R.graphManager!=null&&(R=R.graphManager),this.estimatedSize=b.MIN_VALUE,this.inclusionTreeDepth=b.MAX_VALUE,this.vGraphObject=it,this.edges=[],this.graphManager=R,Y!=null&&H!=null?this.rect=new E(H.x,H.y,Y.width,Y.height):this.rect=new E}B.prototype=Object.create(m.prototype);for(var j in m)B[j]=m[j];B.prototype.getEdges=function(){return this.edges},B.prototype.getChild=function(){return this.child},B.prototype.getOwner=function(){return this.owner},B.prototype.getWidth=function(){return this.rect.width},B.prototype.setWidth=function(R){this.rect.width=R},B.prototype.getHeight=function(){return this.rect.height},B.prototype.setHeight=function(R){this.rect.height=R},B.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},B.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},B.prototype.getCenter=function(){return new N(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},B.prototype.getLocation=function(){return new N(this.rect.x,this.rect.y)},B.prototype.getRect=function(){return this.rect},B.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},B.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},B.prototype.setRect=function(R,H){this.rect.x=R.x,this.rect.y=R.y,this.rect.width=H.width,this.rect.height=H.height},B.prototype.setCenter=function(R,H){this.rect.x=R-this.rect.width/2,this.rect.y=H-this.rect.height/2},B.prototype.setLocation=function(R,H){this.rect.x=R,this.rect.y=H},B.prototype.moveBy=function(R,H){this.rect.x+=R,this.rect.y+=H},B.prototype.getEdgeListToNode=function(R){var H=[],Y=this;return Y.edges.forEach(function(it){if(it.target==R){if(it.source!=Y)throw"Incorrect edge source!";H.push(it)}}),H},B.prototype.getEdgesBetween=function(R){var H=[],Y=this;return Y.edges.forEach(function(it){if(!(it.source==Y||it.target==Y))throw"Incorrect edge source and/or target";(it.target==R||it.source==R)&&H.push(it)}),H},B.prototype.getNeighborsList=function(){var R=new Set,H=this;return H.edges.forEach(function(Y){if(Y.source==H)R.add(Y.target);else{if(Y.target!=H)throw"Incorrect incidency!";R.add(Y.source)}}),R},B.prototype.withChildren=function(){var R=new Set,H,Y;if(R.add(this),this.child!=null)for(var it=this.child.getNodes(),et=0;et<it.length;et++)H=it[et],Y=H.withChildren(),Y.forEach(function(st){R.add(st)});return R},B.prototype.getNoOfChildren=function(){var R=0,H;if(this.child==null)R=1;else for(var Y=this.child.getNodes(),it=0;it<Y.length;it++)H=Y[it],R+=H.getNoOfChildren();return R==0&&(R=1),R},B.prototype.getEstimatedSize=function(){if(this.estimatedSize==b.MIN_VALUE)throw"assert failed";return this.estimatedSize},B.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},B.prototype.scatter=function(){var R,H,Y=-C.INITIAL_WORLD_BOUNDARY,it=C.INITIAL_WORLD_BOUNDARY;R=C.WORLD_CENTER_X+D.nextDouble()*(it-Y)+Y;var et=-C.INITIAL_WORLD_BOUNDARY,st=C.INITIAL_WORLD_BOUNDARY;H=C.WORLD_CENTER_Y+D.nextDouble()*(st-et)+et,this.rect.x=R,this.rect.y=H},B.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var R=this.getChild();if(R.updateBounds(!0),this.rect.x=R.getLeft(),this.rect.y=R.getTop(),this.setWidth(R.getRight()-R.getLeft()),this.setHeight(R.getBottom()-R.getTop()),C.NODE_DIMENSIONS_INCLUDE_LABELS){var H=R.getRight()-R.getLeft(),Y=R.getBottom()-R.getTop();this.labelWidth>H&&(this.rect.x-=(this.labelWidth-H)/2,this.setWidth(this.labelWidth)),this.labelHeight>Y&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-Y)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-Y),this.setHeight(this.labelHeight))}}},B.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==b.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},B.prototype.transform=function(R){var H=this.rect.x;H>C.WORLD_BOUNDARY?H=C.WORLD_BOUNDARY:H<-C.WORLD_BOUNDARY&&(H=-C.WORLD_BOUNDARY);var Y=this.rect.y;Y>C.WORLD_BOUNDARY?Y=C.WORLD_BOUNDARY:Y<-C.WORLD_BOUNDARY&&(Y=-C.WORLD_BOUNDARY);var it=new N(H,Y),et=R.inverseTransformPoint(it);this.setLocation(et.x,et.y)},B.prototype.getLeft=function(){return this.rect.x},B.prototype.getRight=function(){return this.rect.x+this.rect.width},B.prototype.getTop=function(){return this.rect.y},B.prototype.getBottom=function(){return this.rect.y+this.rect.height},B.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},f.exports=B},function(f,p,v){function m(b,E){b==null&&E==null?(this.x=0,this.y=0):(this.x=b,this.y=E)}m.prototype.getX=function(){return this.x},m.prototype.getY=function(){return this.y},m.prototype.setX=function(b){this.x=b},m.prototype.setY=function(b){this.y=b},m.prototype.getDifference=function(b){return new DimensionD(this.x-b.x,this.y-b.y)},m.prototype.getCopy=function(){return new m(this.x,this.y)},m.prototype.translate=function(b){return this.x+=b.width,this.y+=b.height,this},f.exports=m},function(f,p,v){var m=v(2),b=v(10),E=v(0),C=v(6),D=v(3),N=v(1),B=v(13),j=v(12),R=v(11);function H(it,et,st){m.call(this,st),this.estimatedSize=b.MIN_VALUE,this.margin=E.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=it,et!=null&&et instanceof C?this.graphManager=et:et!=null&&et instanceof Layout&&(this.graphManager=et.graphManager)}H.prototype=Object.create(m.prototype);for(var Y in m)H[Y]=m[Y];H.prototype.getNodes=function(){return this.nodes},H.prototype.getEdges=function(){return this.edges},H.prototype.getGraphManager=function(){return this.graphManager},H.prototype.getParent=function(){return this.parent},H.prototype.getLeft=function(){return this.left},H.prototype.getRight=function(){return this.right},H.prototype.getTop=function(){return this.top},H.prototype.getBottom=function(){return this.bottom},H.prototype.isConnected=function(){return this.isConnected},H.prototype.add=function(it,et,st){if(et==null&&st==null){var pt=it;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(pt)>-1)throw"Node already in graph!";return pt.owner=this,this.getNodes().push(pt),pt}else{var Tt=it;if(!(this.getNodes().indexOf(et)>-1&&this.getNodes().indexOf(st)>-1))throw"Source or target not in graph!";if(!(et.owner==st.owner&&et.owner==this))throw"Both owners must be this graph!";return et.owner!=st.owner?null:(Tt.source=et,Tt.target=st,Tt.isInterGraph=!1,this.getEdges().push(Tt),et.edges.push(Tt),st!=et&&st.edges.push(Tt),Tt)}},H.prototype.remove=function(it){var et=it;if(it instanceof D){if(et==null)throw"Node is null!";if(!(et.owner!=null&&et.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var st=et.edges.slice(),pt,Tt=st.length,kt=0;kt<Tt;kt++)pt=st[kt],pt.isInterGraph?this.graphManager.remove(pt):pt.source.owner.remove(pt);var yt=this.nodes.indexOf(et);if(yt==-1)throw"Node not in owner node list!";this.nodes.splice(yt,1)}else if(it instanceof N){var pt=it;if(pt==null)throw"Edge is null!";if(!(pt.source!=null&&pt.target!=null))throw"Source and/or target is null!";if(!(pt.source.owner!=null&&pt.target.owner!=null&&pt.source.owner==this&&pt.target.owner==this))throw"Source and/or target owner is invalid!";var ft=pt.source.edges.indexOf(pt),mt=pt.target.edges.indexOf(pt);if(!(ft>-1&&mt>-1))throw"Source and/or target doesn't know this edge!";pt.source.edges.splice(ft,1),pt.target!=pt.source&&pt.target.edges.splice(mt,1);var yt=pt.source.owner.getEdges().indexOf(pt);if(yt==-1)throw"Not in owner's edge list!";pt.source.owner.getEdges().splice(yt,1)}},H.prototype.updateLeftTop=function(){for(var it=b.MAX_VALUE,et=b.MAX_VALUE,st,pt,Tt,kt=this.getNodes(),yt=kt.length,ft=0;ft<yt;ft++){var mt=kt[ft];st=mt.getTop(),pt=mt.getLeft(),it>st&&(it=st),et>pt&&(et=pt)}return it==b.MAX_VALUE?null:(kt[0].getParent().paddingLeft!=null?Tt=kt[0].getParent().paddingLeft:Tt=this.margin,this.left=et-Tt,this.top=it-Tt,new j(this.left,this.top))},H.prototype.updateBounds=function(it){for(var et=b.MAX_VALUE,st=-b.MAX_VALUE,pt=b.MAX_VALUE,Tt=-b.MAX_VALUE,kt,yt,ft,mt,rt,wt=this.nodes,gt=wt.length,ht=0;ht<gt;ht++){var _t=wt[ht];it&&_t.child!=null&&_t.updateBounds(),kt=_t.getLeft(),yt=_t.getRight(),ft=_t.getTop(),mt=_t.getBottom(),et>kt&&(et=kt),st<yt&&(st=yt),pt>ft&&(pt=ft),Tt<mt&&(Tt=mt)}var X=new B(et,pt,st-et,Tt-pt);et==b.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),wt[0].getParent().paddingLeft!=null?rt=wt[0].getParent().paddingLeft:rt=this.margin,this.left=X.x-rt,this.right=X.x+X.width+rt,this.top=X.y-rt,this.bottom=X.y+X.height+rt},H.calculateBounds=function(it){for(var et=b.MAX_VALUE,st=-b.MAX_VALUE,pt=b.MAX_VALUE,Tt=-b.MAX_VALUE,kt,yt,ft,mt,rt=it.length,wt=0;wt<rt;wt++){var gt=it[wt];kt=gt.getLeft(),yt=gt.getRight(),ft=gt.getTop(),mt=gt.getBottom(),et>kt&&(et=kt),st<yt&&(st=yt),pt>ft&&(pt=ft),Tt<mt&&(Tt=mt)}var ht=new B(et,pt,st-et,Tt-pt);return ht},H.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},H.prototype.getEstimatedSize=function(){if(this.estimatedSize==b.MIN_VALUE)throw"assert failed";return this.estimatedSize},H.prototype.calcEstimatedSize=function(){for(var it=0,et=this.nodes,st=et.length,pt=0;pt<st;pt++){var Tt=et[pt];it+=Tt.calcEstimatedSize()}return it==0?this.estimatedSize=E.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=it/Math.sqrt(this.nodes.length),this.estimatedSize},H.prototype.updateConnected=function(){var it=this;if(this.nodes.length==0){this.isConnected=!0;return}var et=new R,st=new Set,pt=this.nodes[0],Tt,kt,yt=pt.withChildren();for(yt.forEach(function(ht){et.push(ht),st.add(ht)});et.length!==0;){pt=et.shift(),Tt=pt.getEdges();for(var ft=Tt.length,mt=0;mt<ft;mt++){var rt=Tt[mt];if(kt=rt.getOtherEndInGraph(pt,this),kt!=null&&!st.has(kt)){var wt=kt.withChildren();wt.forEach(function(ht){et.push(ht),st.add(ht)})}}}if(this.isConnected=!1,st.size>=this.nodes.length){var gt=0;st.forEach(function(ht){ht.owner==it&&gt++}),gt==this.nodes.length&&(this.isConnected=!0)}},f.exports=H},function(f,p,v){var m,b=v(1);function E(C){m=v(5),this.layout=C,this.graphs=[],this.edges=[]}E.prototype.addRoot=function(){var C=this.layout.newGraph(),D=this.layout.newNode(null),N=this.add(C,D);return this.setRootGraph(N),this.rootGraph},E.prototype.add=function(C,D,N,B,j){if(N==null&&B==null&&j==null){if(C==null)throw"Graph is null!";if(D==null)throw"Parent node is null!";if(this.graphs.indexOf(C)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(C),C.parent!=null)throw"Already has a parent!";if(D.child!=null)throw"Already has a child!";return C.parent=D,D.child=C,C}else{j=N,B=D,N=C;var R=B.getOwner(),H=j.getOwner();if(!(R!=null&&R.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(H!=null&&H.getGraphManager()==this))throw"Target not in this graph mgr!";if(R==H)return N.isInterGraph=!1,R.add(N,B,j);if(N.isInterGraph=!0,N.source=B,N.target=j,this.edges.indexOf(N)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(N),!(N.source!=null&&N.target!=null))throw"Edge source and/or target is null!";if(!(N.source.edges.indexOf(N)==-1&&N.target.edges.indexOf(N)==-1))throw"Edge already in source and/or target incidency list!";return N.source.edges.push(N),N.target.edges.push(N),N}},E.prototype.remove=function(C){if(C instanceof m){var D=C;if(D.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(D==this.rootGraph||D.parent!=null&&D.parent.graphManager==this))throw"Invalid parent node!";var N=[];N=N.concat(D.getEdges());for(var B,j=N.length,R=0;R<j;R++)B=N[R],D.remove(B);var H=[];H=H.concat(D.getNodes());var Y;j=H.length;for(var R=0;R<j;R++)Y=H[R],D.remove(Y);D==this.rootGraph&&this.setRootGraph(null);var it=this.graphs.indexOf(D);this.graphs.splice(it,1),D.parent=null}else if(C instanceof b){if(B=C,B==null)throw"Edge is null!";if(!B.isInterGraph)throw"Not an inter-graph edge!";if(!(B.source!=null&&B.target!=null))throw"Source and/or target is null!";if(!(B.source.edges.indexOf(B)!=-1&&B.target.edges.indexOf(B)!=-1))throw"Source and/or target doesn't know this edge!";var it=B.source.edges.indexOf(B);if(B.source.edges.splice(it,1),it=B.target.edges.indexOf(B),B.target.edges.splice(it,1),!(B.source.owner!=null&&B.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(B.source.owner.getGraphManager().edges.indexOf(B)==-1)throw"Not in owner graph manager's edge list!";var it=B.source.owner.getGraphManager().edges.indexOf(B);B.source.owner.getGraphManager().edges.splice(it,1)}},E.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},E.prototype.getGraphs=function(){return this.graphs},E.prototype.getAllNodes=function(){if(this.allNodes==null){for(var C=[],D=this.getGraphs(),N=D.length,B=0;B<N;B++)C=C.concat(D[B].getNodes());this.allNodes=C}return this.allNodes},E.prototype.resetAllNodes=function(){this.allNodes=null},E.prototype.resetAllEdges=function(){this.allEdges=null},E.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},E.prototype.getAllEdges=function(){if(this.allEdges==null){var C=[],D=this.getGraphs();D.length;for(var N=0;N<D.length;N++)C=C.concat(D[N].getEdges());C=C.concat(this.edges),this.allEdges=C}return this.allEdges},E.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},E.prototype.setAllNodesToApplyGravitation=function(C){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=C},E.prototype.getRoot=function(){return this.rootGraph},E.prototype.setRootGraph=function(C){if(C.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=C,C.parent==null&&(C.parent=this.layout.newNode("Root node"))},E.prototype.getLayout=function(){return this.layout},E.prototype.isOneAncestorOfOther=function(C,D){if(!(C!=null&&D!=null))throw"assert failed";if(C==D)return!0;var N=C.getOwner(),B;do{if(B=N.getParent(),B==null)break;if(B==D)return!0;if(N=B.getOwner(),N==null)break}while(!0);N=D.getOwner();do{if(B=N.getParent(),B==null)break;if(B==C)return!0;if(N=B.getOwner(),N==null)break}while(!0);return!1},E.prototype.calcLowestCommonAncestors=function(){for(var C,D,N,B,j,R=this.getAllEdges(),H=R.length,Y=0;Y<H;Y++){if(C=R[Y],D=C.source,N=C.target,C.lca=null,C.sourceInLca=D,C.targetInLca=N,D==N){C.lca=D.getOwner();continue}for(B=D.getOwner();C.lca==null;){for(C.targetInLca=N,j=N.getOwner();C.lca==null;){if(j==B){C.lca=j;break}if(j==this.rootGraph)break;if(C.lca!=null)throw"assert failed";C.targetInLca=j.getParent(),j=C.targetInLca.getOwner()}if(B==this.rootGraph)break;C.lca==null&&(C.sourceInLca=B.getParent(),B=C.sourceInLca.getOwner())}if(C.lca==null)throw"assert failed"}},E.prototype.calcLowestCommonAncestor=function(C,D){if(C==D)return C.getOwner();var N=C.getOwner();do{if(N==null)break;var B=D.getOwner();do{if(B==null)break;if(B==N)return B;B=B.getParent().getOwner()}while(!0);N=N.getParent().getOwner()}while(!0);return N},E.prototype.calcInclusionTreeDepths=function(C,D){C==null&&D==null&&(C=this.rootGraph,D=1);for(var N,B=C.getNodes(),j=B.length,R=0;R<j;R++)N=B[R],N.inclusionTreeDepth=D,N.child!=null&&this.calcInclusionTreeDepths(N.child,D+1)},E.prototype.includesInvalidEdge=function(){for(var C,D=this.edges.length,N=0;N<D;N++)if(C=this.edges[N],this.isOneAncestorOfOther(C.source,C.target))return!0;return!1},f.exports=E},function(f,p,v){var m=v(0);function b(){}for(var E in m)b[E]=m[E];b.MAX_ITERATIONS=2500,b.DEFAULT_EDGE_LENGTH=50,b.DEFAULT_SPRING_STRENGTH=.45,b.DEFAULT_REPULSION_STRENGTH=4500,b.DEFAULT_GRAVITY_STRENGTH=.4,b.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,b.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,b.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,b.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,b.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,b.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,b.COOLING_ADAPTATION_FACTOR=.33,b.ADAPTATION_LOWER_NODE_LIMIT=1e3,b.ADAPTATION_UPPER_NODE_LIMIT=5e3,b.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,b.MAX_NODE_DISPLACEMENT=b.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,b.MIN_REPULSION_DIST=b.DEFAULT_EDGE_LENGTH/10,b.CONVERGENCE_CHECK_PERIOD=100,b.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,b.MIN_EDGE_LENGTH=1,b.GRID_CALCULATION_CHECK_PERIOD=10,f.exports=b},function(f,p,v){var m=v(12);function b(){}b.calcSeparationAmount=function(E,C,D,N){if(!E.intersects(C))throw"assert failed";var B=new Array(2);this.decideDirectionsForOverlappingNodes(E,C,B),D[0]=Math.min(E.getRight(),C.getRight())-Math.max(E.x,C.x),D[1]=Math.min(E.getBottom(),C.getBottom())-Math.max(E.y,C.y),E.getX()<=C.getX()&&E.getRight()>=C.getRight()?D[0]+=Math.min(C.getX()-E.getX(),E.getRight()-C.getRight()):C.getX()<=E.getX()&&C.getRight()>=E.getRight()&&(D[0]+=Math.min(E.getX()-C.getX(),C.getRight()-E.getRight())),E.getY()<=C.getY()&&E.getBottom()>=C.getBottom()?D[1]+=Math.min(C.getY()-E.getY(),E.getBottom()-C.getBottom()):C.getY()<=E.getY()&&C.getBottom()>=E.getBottom()&&(D[1]+=Math.min(E.getY()-C.getY(),C.getBottom()-E.getBottom()));var j=Math.abs((C.getCenterY()-E.getCenterY())/(C.getCenterX()-E.getCenterX()));C.getCenterY()===E.getCenterY()&&C.getCenterX()===E.getCenterX()&&(j=1);var R=j*D[0],H=D[1]/j;D[0]<H?H=D[0]:R=D[1],D[0]=-1*B[0]*(H/2+N),D[1]=-1*B[1]*(R/2+N)},b.decideDirectionsForOverlappingNodes=function(E,C,D){E.getCenterX()<C.getCenterX()?D[0]=-1:D[0]=1,E.getCenterY()<C.getCenterY()?D[1]=-1:D[1]=1},b.getIntersection2=function(E,C,D){var N=E.getCenterX(),B=E.getCenterY(),j=C.getCenterX(),R=C.getCenterY();if(E.intersects(C))return D[0]=N,D[1]=B,D[2]=j,D[3]=R,!0;var H=E.getX(),Y=E.getY(),it=E.getRight(),et=E.getX(),st=E.getBottom(),pt=E.getRight(),Tt=E.getWidthHalf(),kt=E.getHeightHalf(),yt=C.getX(),ft=C.getY(),mt=C.getRight(),rt=C.getX(),wt=C.getBottom(),gt=C.getRight(),ht=C.getWidthHalf(),_t=C.getHeightHalf(),X=!1,Rt=!1;if(N===j){if(B>R)return D[0]=N,D[1]=Y,D[2]=j,D[3]=wt,!1;if(B<R)return D[0]=N,D[1]=st,D[2]=j,D[3]=ft,!1}else if(B===R){if(N>j)return D[0]=H,D[1]=B,D[2]=mt,D[3]=R,!1;if(N<j)return D[0]=it,D[1]=B,D[2]=yt,D[3]=R,!1}else{var lt=E.height/E.width,fe=C.height/C.width,J=(R-B)/(j-N),ae=void 0,Wt=void 0,It=void 0,Pt=void 0,me=void 0,Ue=void 0;if(-lt===J?N>j?(D[0]=et,D[1]=st,X=!0):(D[0]=it,D[1]=Y,X=!0):lt===J&&(N>j?(D[0]=H,D[1]=Y,X=!0):(D[0]=pt,D[1]=st,X=!0)),-fe===J?j>N?(D[2]=rt,D[3]=wt,Rt=!0):(D[2]=mt,D[3]=ft,Rt=!0):fe===J&&(j>N?(D[2]=yt,D[3]=ft,Rt=!0):(D[2]=gt,D[3]=wt,Rt=!0)),X&&Rt)return!1;if(N>j?B>R?(ae=this.getCardinalDirection(lt,J,4),Wt=this.getCardinalDirection(fe,J,2)):(ae=this.getCardinalDirection(-lt,J,3),Wt=this.getCardinalDirection(-fe,J,1)):B>R?(ae=this.getCardinalDirection(-lt,J,1),Wt=this.getCardinalDirection(-fe,J,3)):(ae=this.getCardinalDirection(lt,J,2),Wt=this.getCardinalDirection(fe,J,4)),!X)switch(ae){case 1:Pt=Y,It=N+-kt/J,D[0]=It,D[1]=Pt;break;case 2:It=pt,Pt=B+Tt*J,D[0]=It,D[1]=Pt;break;case 3:Pt=st,It=N+kt/J,D[0]=It,D[1]=Pt;break;case 4:It=et,Pt=B+-Tt*J,D[0]=It,D[1]=Pt;break}if(!Rt)switch(Wt){case 1:Ue=ft,me=j+-_t/J,D[2]=me,D[3]=Ue;break;case 2:me=gt,Ue=R+ht*J,D[2]=me,D[3]=Ue;break;case 3:Ue=wt,me=j+_t/J,D[2]=me,D[3]=Ue;break;case 4:me=rt,Ue=R+-ht*J,D[2]=me,D[3]=Ue;break}}return!1},b.getCardinalDirection=function(E,C,D){return E>C?D:1+D%4},b.getIntersection=function(E,C,D,N){if(N==null)return this.getIntersection2(E,C,D);var B=E.x,j=E.y,R=C.x,H=C.y,Y=D.x,it=D.y,et=N.x,st=N.y,pt=void 0,Tt=void 0,kt=void 0,yt=void 0,ft=void 0,mt=void 0,rt=void 0,wt=void 0,gt=void 0;return kt=H-j,ft=B-R,rt=R*j-B*H,yt=st-it,mt=Y-et,wt=et*it-Y*st,gt=kt*mt-yt*ft,gt===0?null:(pt=(ft*wt-mt*rt)/gt,Tt=(yt*rt-kt*wt)/gt,new m(pt,Tt))},b.angleOfVector=function(E,C,D,N){var B=void 0;return E!==D?(B=Math.atan((N-C)/(D-E)),D<E?B+=Math.PI:N<C&&(B+=this.TWO_PI)):N<C?B=this.ONE_AND_HALF_PI:B=this.HALF_PI,B},b.doIntersect=function(E,C,D,N){var B=E.x,j=E.y,R=C.x,H=C.y,Y=D.x,it=D.y,et=N.x,st=N.y,pt=(R-B)*(st-it)-(et-Y)*(H-j);if(pt===0)return!1;var Tt=((st-it)*(et-B)+(Y-et)*(st-j))/pt,kt=((j-H)*(et-B)+(R-B)*(st-j))/pt;return 0<Tt&&Tt<1&&0<kt&&kt<1},b.HALF_PI=.5*Math.PI,b.ONE_AND_HALF_PI=1.5*Math.PI,b.TWO_PI=2*Math.PI,b.THREE_PI=3*Math.PI,f.exports=b},function(f,p,v){function m(){}m.sign=function(b){return b>0?1:b<0?-1:0},m.floor=function(b){return b<0?Math.ceil(b):Math.floor(b)},m.ceil=function(b){return b<0?Math.floor(b):Math.ceil(b)},f.exports=m},function(f,p,v){function m(){}m.MAX_VALUE=2147483647,m.MIN_VALUE=-2147483648,f.exports=m},function(f,p,v){var m=function(){function B(j,R){for(var H=0;H<R.length;H++){var Y=R[H];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(j,Y.key,Y)}}return function(j,R,H){return R&&B(j.prototype,R),H&&B(j,H),j}}();function b(B,j){if(!(B instanceof j))throw new TypeError("Cannot call a class as a function")}var E=function(j){return{value:j,next:null,prev:null}},C=function(j,R,H,Y){return j!==null?j.next=R:Y.head=R,H!==null?H.prev=R:Y.tail=R,R.prev=j,R.next=H,Y.length++,R},D=function(j,R){var H=j.prev,Y=j.next;return H!==null?H.next=Y:R.head=Y,Y!==null?Y.prev=H:R.tail=H,j.prev=j.next=null,R.length--,j},N=function(){function B(j){var R=this;b(this,B),this.length=0,this.head=null,this.tail=null,j!=null&&j.forEach(function(H){return R.push(H)})}return m(B,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(R,H){return C(H.prev,E(R),H,this)}},{key:"insertAfter",value:function(R,H){return C(H,E(R),H.next,this)}},{key:"insertNodeBefore",value:function(R,H){return C(H.prev,R,H,this)}},{key:"insertNodeAfter",value:function(R,H){return C(H,R,H.next,this)}},{key:"push",value:function(R){return C(this.tail,E(R),null,this)}},{key:"unshift",value:function(R){return C(null,E(R),this.head,this)}},{key:"remove",value:function(R){return D(R,this)}},{key:"pop",value:function(){return D(this.tail,this).value}},{key:"popNode",value:function(){return D(this.tail,this)}},{key:"shift",value:function(){return D(this.head,this).value}},{key:"shiftNode",value:function(){return D(this.head,this)}},{key:"get_object_at",value:function(R){if(R<=this.length()){for(var H=1,Y=this.head;H<R;)Y=Y.next,H++;return Y.value}}},{key:"set_object_at",value:function(R,H){if(R<=this.length()){for(var Y=1,it=this.head;Y<R;)it=it.next,Y++;it.value=H}}}]),B}();f.exports=N},function(f,p,v){function m(b,E,C){this.x=null,this.y=null,b==null&&E==null&&C==null?(this.x=0,this.y=0):typeof b=="number"&&typeof E=="number"&&C==null?(this.x=b,this.y=E):b.constructor.name=="Point"&&E==null&&C==null&&(C=b,this.x=C.x,this.y=C.y)}m.prototype.getX=function(){return this.x},m.prototype.getY=function(){return this.y},m.prototype.getLocation=function(){return new m(this.x,this.y)},m.prototype.setLocation=function(b,E,C){b.constructor.name=="Point"&&E==null&&C==null?(C=b,this.setLocation(C.x,C.y)):typeof b=="number"&&typeof E=="number"&&C==null&&(parseInt(b)==b&&parseInt(E)==E?this.move(b,E):(this.x=Math.floor(b+.5),this.y=Math.floor(E+.5)))},m.prototype.move=function(b,E){this.x=b,this.y=E},m.prototype.translate=function(b,E){this.x+=b,this.y+=E},m.prototype.equals=function(b){if(b.constructor.name=="Point"){var E=b;return this.x==E.x&&this.y==E.y}return this==b},m.prototype.toString=function(){return new m().constructor.name+"[x="+this.x+",y="+this.y+"]"},f.exports=m},function(f,p,v){function m(b,E,C,D){this.x=0,this.y=0,this.width=0,this.height=0,b!=null&&E!=null&&C!=null&&D!=null&&(this.x=b,this.y=E,this.width=C,this.height=D)}m.prototype.getX=function(){return this.x},m.prototype.setX=function(b){this.x=b},m.prototype.getY=function(){return this.y},m.prototype.setY=function(b){this.y=b},m.prototype.getWidth=function(){return this.width},m.prototype.setWidth=function(b){this.width=b},m.prototype.getHeight=function(){return this.height},m.prototype.setHeight=function(b){this.height=b},m.prototype.getRight=function(){return this.x+this.width},m.prototype.getBottom=function(){return this.y+this.height},m.prototype.intersects=function(b){return!(this.getRight()<b.x||this.getBottom()<b.y||b.getRight()<this.x||b.getBottom()<this.y)},m.prototype.getCenterX=function(){return this.x+this.width/2},m.prototype.getMinX=function(){return this.getX()},m.prototype.getMaxX=function(){return this.getX()+this.width},m.prototype.getCenterY=function(){return this.y+this.height/2},m.prototype.getMinY=function(){return this.getY()},m.prototype.getMaxY=function(){return this.getY()+this.height},m.prototype.getWidthHalf=function(){return this.width/2},m.prototype.getHeightHalf=function(){return this.height/2},f.exports=m},function(f,p,v){var m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E};function b(){}b.lastID=0,b.createID=function(E){return b.isPrimitive(E)?E:(E.uniqueID!=null||(E.uniqueID=b.getString(),b.lastID++),E.uniqueID)},b.getString=function(E){return E==null&&(E=b.lastID),"Object#"+E},b.isPrimitive=function(E){var C=typeof E>"u"?"undefined":m(E);return E==null||C!="object"&&C!="function"},f.exports=b},function(f,p,v){function m(Y){if(Array.isArray(Y)){for(var it=0,et=Array(Y.length);it<Y.length;it++)et[it]=Y[it];return et}else return Array.from(Y)}var b=v(0),E=v(6),C=v(3),D=v(1),N=v(5),B=v(4),j=v(17),R=v(27);function H(Y){R.call(this),this.layoutQuality=b.QUALITY,this.createBendsAsNeeded=b.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=b.DEFAULT_INCREMENTAL,this.animationOnLayout=b.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=b.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=b.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=b.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new E(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,Y!=null&&(this.isRemoteUse=Y)}H.RANDOM_SEED=1,H.prototype=Object.create(R.prototype),H.prototype.getGraphManager=function(){return this.graphManager},H.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},H.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},H.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},H.prototype.newGraphManager=function(){var Y=new E(this);return this.graphManager=Y,Y},H.prototype.newGraph=function(Y){return new N(null,this.graphManager,Y)},H.prototype.newNode=function(Y){return new C(this.graphManager,Y)},H.prototype.newEdge=function(Y){return new D(null,null,Y)},H.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},H.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var Y;return this.checkLayoutSuccess()?Y=!1:Y=this.layout(),b.ANIMATE==="during"?!1:(Y&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,Y)},H.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},H.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var Y=this.graphManager.getAllEdges(),it=0;it<Y.length;it++)Y[it];for(var et=this.graphManager.getRoot().getNodes(),it=0;it<et.length;it++)et[it];this.update(this.graphManager.getRoot())}},H.prototype.update=function(Y){if(Y==null)this.update2();else if(Y instanceof C){var it=Y;if(it.getChild()!=null)for(var et=it.getChild().getNodes(),st=0;st<et.length;st++)update(et[st]);if(it.vGraphObject!=null){var pt=it.vGraphObject;pt.update(it)}}else if(Y instanceof D){var Tt=Y;if(Tt.vGraphObject!=null){var kt=Tt.vGraphObject;kt.update(Tt)}}else if(Y instanceof N){var yt=Y;if(yt.vGraphObject!=null){var ft=yt.vGraphObject;ft.update(yt)}}},H.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=b.QUALITY,this.animationDuringLayout=b.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=b.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=b.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=b.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=b.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=b.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},H.prototype.transform=function(Y){if(Y==null)this.transform(new B(0,0));else{var it=new j,et=this.graphManager.getRoot().updateLeftTop();if(et!=null){it.setWorldOrgX(Y.x),it.setWorldOrgY(Y.y),it.setDeviceOrgX(et.x),it.setDeviceOrgY(et.y);for(var st=this.getAllNodes(),pt,Tt=0;Tt<st.length;Tt++)pt=st[Tt],pt.transform(it)}}},H.prototype.positionNodesRandomly=function(Y){if(Y==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var it,et,st=Y.getNodes(),pt=0;pt<st.length;pt++)it=st[pt],et=it.getChild(),et==null||et.getNodes().length==0?it.scatter():(this.positionNodesRandomly(et),it.updateBounds())},H.prototype.getFlatForest=function(){for(var Y=[],it=!0,et=this.graphManager.getRoot().getNodes(),st=!0,pt=0;pt<et.length;pt++)et[pt].getChild()!=null&&(st=!1);if(!st)return Y;var Tt=new Set,kt=[],yt=new Map,ft=[];for(ft=ft.concat(et);ft.length>0&&it;){for(kt.push(ft[0]);kt.length>0&&it;){var mt=kt[0];kt.splice(0,1),Tt.add(mt);for(var rt=mt.getEdges(),pt=0;pt<rt.length;pt++){var wt=rt[pt].getOtherEnd(mt);if(yt.get(mt)!=wt)if(!Tt.has(wt))kt.push(wt),yt.set(wt,mt);else{it=!1;break}}}if(!it)Y=[];else{var gt=[].concat(m(Tt));Y.push(gt);for(var pt=0;pt<gt.length;pt++){var ht=gt[pt],_t=ft.indexOf(ht);_t>-1&&ft.splice(_t,1)}Tt=new Set,yt=new Map}}return Y},H.prototype.createDummyNodesForBendpoints=function(Y){for(var it=[],et=Y.source,st=this.graphManager.calcLowestCommonAncestor(Y.source,Y.target),pt=0;pt<Y.bendpoints.length;pt++){var Tt=this.newNode(null);Tt.setRect(new Point(0,0),new Dimension(1,1)),st.add(Tt);var kt=this.newEdge(null);this.graphManager.add(kt,et,Tt),it.add(Tt),et=Tt}var kt=this.newEdge(null);return this.graphManager.add(kt,et,Y.target),this.edgeToDummyNodes.set(Y,it),Y.isInterGraph()?this.graphManager.remove(Y):st.remove(Y),it},H.prototype.createBendpointsFromDummyNodes=function(){var Y=[];Y=Y.concat(this.graphManager.getAllEdges()),Y=[].concat(m(this.edgeToDummyNodes.keys())).concat(Y);for(var it=0;it<Y.length;it++){var et=Y[it];if(et.bendpoints.length>0){for(var st=this.edgeToDummyNodes.get(et),pt=0;pt<st.length;pt++){var Tt=st[pt],kt=new B(Tt.getCenterX(),Tt.getCenterY()),yt=et.bendpoints.get(pt);yt.x=kt.x,yt.y=kt.y,Tt.getOwner().remove(Tt)}this.graphManager.add(et,et.source,et.target)}}},H.transform=function(Y,it,et,st){if(et!=null&&st!=null){var pt=it;if(Y<=50){var Tt=it/et;pt-=(it-Tt)/50*(50-Y)}else{var kt=it*st;pt+=(kt-it)/50*(Y-50)}return pt}else{var yt,ft;return Y<=50?(yt=9*it/500,ft=it/10):(yt=9*it/50,ft=-8*it),yt*Y+ft}},H.findCenterOfTree=function(Y){var it=[];it=it.concat(Y);var et=[],st=new Map,pt=!1,Tt=null;(it.length==1||it.length==2)&&(pt=!0,Tt=it[0]);for(var kt=0;kt<it.length;kt++){var yt=it[kt],ft=yt.getNeighborsList().size;st.set(yt,yt.getNeighborsList().size),ft==1&&et.push(yt)}var mt=[];for(mt=mt.concat(et);!pt;){var rt=[];rt=rt.concat(mt),mt=[];for(var kt=0;kt<it.length;kt++){var yt=it[kt],wt=it.indexOf(yt);wt>=0&&it.splice(wt,1);var gt=yt.getNeighborsList();gt.forEach(function(X){if(et.indexOf(X)<0){var Rt=st.get(X),lt=Rt-1;lt==1&&mt.push(X),st.set(X,lt)}})}et=et.concat(mt),(it.length==1||it.length==2)&&(pt=!0,Tt=it[0])}return Tt},H.prototype.setGraphManager=function(Y){this.graphManager=Y},f.exports=H},function(f,p,v){function m(){}m.seed=1,m.x=0,m.nextDouble=function(){return m.x=Math.sin(m.seed++)*1e4,m.x-Math.floor(m.x)},f.exports=m},function(f,p,v){var m=v(4);function b(E,C){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}b.prototype.getWorldOrgX=function(){return this.lworldOrgX},b.prototype.setWorldOrgX=function(E){this.lworldOrgX=E},b.prototype.getWorldOrgY=function(){return this.lworldOrgY},b.prototype.setWorldOrgY=function(E){this.lworldOrgY=E},b.prototype.getWorldExtX=function(){return this.lworldExtX},b.prototype.setWorldExtX=function(E){this.lworldExtX=E},b.prototype.getWorldExtY=function(){return this.lworldExtY},b.prototype.setWorldExtY=function(E){this.lworldExtY=E},b.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},b.prototype.setDeviceOrgX=function(E){this.ldeviceOrgX=E},b.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},b.prototype.setDeviceOrgY=function(E){this.ldeviceOrgY=E},b.prototype.getDeviceExtX=function(){return this.ldeviceExtX},b.prototype.setDeviceExtX=function(E){this.ldeviceExtX=E},b.prototype.getDeviceExtY=function(){return this.ldeviceExtY},b.prototype.setDeviceExtY=function(E){this.ldeviceExtY=E},b.prototype.transformX=function(E){var C=0,D=this.lworldExtX;return D!=0&&(C=this.ldeviceOrgX+(E-this.lworldOrgX)*this.ldeviceExtX/D),C},b.prototype.transformY=function(E){var C=0,D=this.lworldExtY;return D!=0&&(C=this.ldeviceOrgY+(E-this.lworldOrgY)*this.ldeviceExtY/D),C},b.prototype.inverseTransformX=function(E){var C=0,D=this.ldeviceExtX;return D!=0&&(C=this.lworldOrgX+(E-this.ldeviceOrgX)*this.lworldExtX/D),C},b.prototype.inverseTransformY=function(E){var C=0,D=this.ldeviceExtY;return D!=0&&(C=this.lworldOrgY+(E-this.ldeviceOrgY)*this.lworldExtY/D),C},b.prototype.inverseTransformPoint=function(E){var C=new m(this.inverseTransformX(E.x),this.inverseTransformY(E.y));return C},f.exports=b},function(f,p,v){function m(R){if(Array.isArray(R)){for(var H=0,Y=Array(R.length);H<R.length;H++)Y[H]=R[H];return Y}else return Array.from(R)}var b=v(15),E=v(7),C=v(0),D=v(8),N=v(9);function B(){b.call(this),this.useSmartIdealEdgeLengthCalculation=E.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=E.DEFAULT_EDGE_LENGTH,this.springConstant=E.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=E.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=E.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=E.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=E.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=E.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*E.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=E.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=E.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=E.MAX_ITERATIONS}B.prototype=Object.create(b.prototype);for(var j in b)B[j]=b[j];B.prototype.initParameters=function(){b.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=E.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},B.prototype.calcIdealEdgeLengths=function(){for(var R,H,Y,it,et,st,pt=this.getGraphManager().getAllEdges(),Tt=0;Tt<pt.length;Tt++)R=pt[Tt],R.idealLength=this.idealEdgeLength,R.isInterGraph&&(Y=R.getSource(),it=R.getTarget(),et=R.getSourceInLca().getEstimatedSize(),st=R.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(R.idealLength+=et+st-2*C.SIMPLE_NODE_SIZE),H=R.getLca().getInclusionTreeDepth(),R.idealLength+=E.DEFAULT_EDGE_LENGTH*E.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(Y.getInclusionTreeDepth()+it.getInclusionTreeDepth()-2*H))},B.prototype.initSpringEmbedder=function(){var R=this.getAllNodes().length;this.incremental?(R>E.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*E.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(R-E.ADAPTATION_LOWER_NODE_LIMIT)/(E.ADAPTATION_UPPER_NODE_LIMIT-E.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-E.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=E.MAX_NODE_DISPLACEMENT_INCREMENTAL):(R>E.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(E.COOLING_ADAPTATION_FACTOR,1-(R-E.ADAPTATION_LOWER_NODE_LIMIT)/(E.ADAPTATION_UPPER_NODE_LIMIT-E.ADAPTATION_LOWER_NODE_LIMIT)*(1-E.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=E.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},B.prototype.calcSpringForces=function(){for(var R=this.getAllEdges(),H,Y=0;Y<R.length;Y++)H=R[Y],this.calcSpringForce(H,H.idealLength)},B.prototype.calcRepulsionForces=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Y,it,et,st,pt=this.getAllNodes(),Tt;if(this.useFRGridVariant)for(this.totalIterations%E.GRID_CALCULATION_CHECK_PERIOD==1&&R&&this.updateGrid(),Tt=new Set,Y=0;Y<pt.length;Y++)et=pt[Y],this.calculateRepulsionForceOfANode(et,Tt,R,H),Tt.add(et);else for(Y=0;Y<pt.length;Y++)for(et=pt[Y],it=Y+1;it<pt.length;it++)st=pt[it],et.getOwner()==st.getOwner()&&this.calcRepulsionForce(et,st)},B.prototype.calcGravitationalForces=function(){for(var R,H=this.getAllNodesToApplyGravitation(),Y=0;Y<H.length;Y++)R=H[Y],this.calcGravitationalForce(R)},B.prototype.moveNodes=function(){for(var R=this.getAllNodes(),H,Y=0;Y<R.length;Y++)H=R[Y],H.move()},B.prototype.calcSpringForce=function(R,H){var Y=R.getSource(),it=R.getTarget(),et,st,pt,Tt;if(this.uniformLeafNodeSizes&&Y.getChild()==null&&it.getChild()==null)R.updateLengthSimple();else if(R.updateLength(),R.isOverlapingSourceAndTarget)return;et=R.getLength(),et!=0&&(st=this.springConstant*(et-H),pt=st*(R.lengthX/et),Tt=st*(R.lengthY/et),Y.springForceX+=pt,Y.springForceY+=Tt,it.springForceX-=pt,it.springForceY-=Tt)},B.prototype.calcRepulsionForce=function(R,H){var Y=R.getRect(),it=H.getRect(),et=new Array(2),st=new Array(4),pt,Tt,kt,yt,ft,mt,rt;if(Y.intersects(it)){D.calcSeparationAmount(Y,it,et,E.DEFAULT_EDGE_LENGTH/2),mt=2*et[0],rt=2*et[1];var wt=R.noOfChildren*H.noOfChildren/(R.noOfChildren+H.noOfChildren);R.repulsionForceX-=wt*mt,R.repulsionForceY-=wt*rt,H.repulsionForceX+=wt*mt,H.repulsionForceY+=wt*rt}else this.uniformLeafNodeSizes&&R.getChild()==null&&H.getChild()==null?(pt=it.getCenterX()-Y.getCenterX(),Tt=it.getCenterY()-Y.getCenterY()):(D.getIntersection(Y,it,st),pt=st[2]-st[0],Tt=st[3]-st[1]),Math.abs(pt)<E.MIN_REPULSION_DIST&&(pt=N.sign(pt)*E.MIN_REPULSION_DIST),Math.abs(Tt)<E.MIN_REPULSION_DIST&&(Tt=N.sign(Tt)*E.MIN_REPULSION_DIST),kt=pt*pt+Tt*Tt,yt=Math.sqrt(kt),ft=this.repulsionConstant*R.noOfChildren*H.noOfChildren/kt,mt=ft*pt/yt,rt=ft*Tt/yt,R.repulsionForceX-=mt,R.repulsionForceY-=rt,H.repulsionForceX+=mt,H.repulsionForceY+=rt},B.prototype.calcGravitationalForce=function(R){var H,Y,it,et,st,pt,Tt,kt;H=R.getOwner(),Y=(H.getRight()+H.getLeft())/2,it=(H.getTop()+H.getBottom())/2,et=R.getCenterX()-Y,st=R.getCenterY()-it,pt=Math.abs(et)+R.getWidth()/2,Tt=Math.abs(st)+R.getHeight()/2,R.getOwner()==this.graphManager.getRoot()?(kt=H.getEstimatedSize()*this.gravityRangeFactor,(pt>kt||Tt>kt)&&(R.gravitationForceX=-this.gravityConstant*et,R.gravitationForceY=-this.gravityConstant*st)):(kt=H.getEstimatedSize()*this.compoundGravityRangeFactor,(pt>kt||Tt>kt)&&(R.gravitationForceX=-this.gravityConstant*et*this.compoundGravityConstant,R.gravitationForceY=-this.gravityConstant*st*this.compoundGravityConstant))},B.prototype.isConverged=function(){var R,H=!1;return this.totalIterations>this.maxIterations/3&&(H=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),R=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,R||H},B.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},B.prototype.calcNoOfChildrenForAllNodes=function(){for(var R,H=this.graphManager.getAllNodes(),Y=0;Y<H.length;Y++)R=H[Y],R.noOfChildren=R.getNoOfChildren()},B.prototype.calcGrid=function(R){var H=0,Y=0;H=parseInt(Math.ceil((R.getRight()-R.getLeft())/this.repulsionRange)),Y=parseInt(Math.ceil((R.getBottom()-R.getTop())/this.repulsionRange));for(var it=new Array(H),et=0;et<H;et++)it[et]=new Array(Y);for(var et=0;et<H;et++)for(var st=0;st<Y;st++)it[et][st]=new Array;return it},B.prototype.addNodeToGrid=function(R,H,Y){var it=0,et=0,st=0,pt=0;it=parseInt(Math.floor((R.getRect().x-H)/this.repulsionRange)),et=parseInt(Math.floor((R.getRect().width+R.getRect().x-H)/this.repulsionRange)),st=parseInt(Math.floor((R.getRect().y-Y)/this.repulsionRange)),pt=parseInt(Math.floor((R.getRect().height+R.getRect().y-Y)/this.repulsionRange));for(var Tt=it;Tt<=et;Tt++)for(var kt=st;kt<=pt;kt++)this.grid[Tt][kt].push(R),R.setGridCoordinates(it,et,st,pt)},B.prototype.updateGrid=function(){var R,H,Y=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),R=0;R<Y.length;R++)H=Y[R],this.addNodeToGrid(H,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},B.prototype.calculateRepulsionForceOfANode=function(R,H,Y,it){if(this.totalIterations%E.GRID_CALCULATION_CHECK_PERIOD==1&&Y||it){var et=new Set;R.surrounding=new Array;for(var st,pt=this.grid,Tt=R.startX-1;Tt<R.finishX+2;Tt++)for(var kt=R.startY-1;kt<R.finishY+2;kt++)if(!(Tt<0||kt<0||Tt>=pt.length||kt>=pt[0].length)){for(var yt=0;yt<pt[Tt][kt].length;yt++)if(st=pt[Tt][kt][yt],!(R.getOwner()!=st.getOwner()||R==st)&&!H.has(st)&&!et.has(st)){var ft=Math.abs(R.getCenterX()-st.getCenterX())-(R.getWidth()/2+st.getWidth()/2),mt=Math.abs(R.getCenterY()-st.getCenterY())-(R.getHeight()/2+st.getHeight()/2);ft<=this.repulsionRange&&mt<=this.repulsionRange&&et.add(st)}}R.surrounding=[].concat(m(et))}for(Tt=0;Tt<R.surrounding.length;Tt++)this.calcRepulsionForce(R,R.surrounding[Tt])},B.prototype.calcRepulsionRange=function(){return 0},f.exports=B},function(f,p,v){var m=v(1),b=v(7);function E(D,N,B){m.call(this,D,N,B),this.idealLength=b.DEFAULT_EDGE_LENGTH}E.prototype=Object.create(m.prototype);for(var C in m)E[C]=m[C];f.exports=E},function(f,p,v){var m=v(3);function b(C,D,N,B){m.call(this,C,D,N,B),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}b.prototype=Object.create(m.prototype);for(var E in m)b[E]=m[E];b.prototype.setGridCoordinates=function(C,D,N,B){this.startX=C,this.finishX=D,this.startY=N,this.finishY=B},f.exports=b},function(f,p,v){function m(b,E){this.width=0,this.height=0,b!==null&&E!==null&&(this.height=E,this.width=b)}m.prototype.getWidth=function(){return this.width},m.prototype.setWidth=function(b){this.width=b},m.prototype.getHeight=function(){return this.height},m.prototype.setHeight=function(b){this.height=b},f.exports=m},function(f,p,v){var m=v(14);function b(){this.map={},this.keys=[]}b.prototype.put=function(E,C){var D=m.createID(E);this.contains(D)||(this.map[D]=C,this.keys.push(E))},b.prototype.contains=function(E){return m.createID(E),this.map[E]!=null},b.prototype.get=function(E){var C=m.createID(E);return this.map[C]},b.prototype.keySet=function(){return this.keys},f.exports=b},function(f,p,v){var m=v(14);function b(){this.set={}}b.prototype.add=function(E){var C=m.createID(E);this.contains(C)||(this.set[C]=E)},b.prototype.remove=function(E){delete this.set[m.createID(E)]},b.prototype.clear=function(){this.set={}},b.prototype.contains=function(E){return this.set[m.createID(E)]==E},b.prototype.isEmpty=function(){return this.size()===0},b.prototype.size=function(){return Object.keys(this.set).length},b.prototype.addAllTo=function(E){for(var C=Object.keys(this.set),D=C.length,N=0;N<D;N++)E.push(this.set[C[N]])},b.prototype.size=function(){return Object.keys(this.set).length},b.prototype.addAll=function(E){for(var C=E.length,D=0;D<C;D++){var N=E[D];this.add(N)}},f.exports=b},function(f,p,v){var m=function(){function D(N,B){for(var j=0;j<B.length;j++){var R=B[j];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(N,R.key,R)}}return function(N,B,j){return B&&D(N.prototype,B),j&&D(N,j),N}}();function b(D,N){if(!(D instanceof N))throw new TypeError("Cannot call a class as a function")}var E=v(11),C=function(){function D(N,B){b(this,D),(B!==null||B!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var j=void 0;N instanceof E?j=N.size():j=N.length,this._quicksort(N,0,j-1)}return m(D,[{key:"_quicksort",value:function(B,j,R){if(j<R){var H=this._partition(B,j,R);this._quicksort(B,j,H),this._quicksort(B,H+1,R)}}},{key:"_partition",value:function(B,j,R){for(var H=this._get(B,j),Y=j,it=R;;){for(;this.compareFunction(H,this._get(B,it));)it--;for(;this.compareFunction(this._get(B,Y),H);)Y++;if(Y<it)this._swap(B,Y,it),Y++,it--;else return it}}},{key:"_get",value:function(B,j){return B instanceof E?B.get_object_at(j):B[j]}},{key:"_set",value:function(B,j,R){B instanceof E?B.set_object_at(j,R):B[j]=R}},{key:"_swap",value:function(B,j,R){var H=this._get(B,j);this._set(B,j,this._get(B,R)),this._set(B,R,H)}},{key:"_defaultCompareFunction",value:function(B,j){return j>B}}]),D}();f.exports=C},function(f,p,v){var m=function(){function C(D,N){for(var B=0;B<N.length;B++){var j=N[B];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(D,j.key,j)}}return function(D,N,B){return N&&C(D.prototype,N),B&&C(D,B),D}}();function b(C,D){if(!(C instanceof D))throw new TypeError("Cannot call a class as a function")}var E=function(){function C(D,N){var B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,j=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,R=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;b(this,C),this.sequence1=D,this.sequence2=N,this.match_score=B,this.mismatch_penalty=j,this.gap_penalty=R,this.iMax=D.length+1,this.jMax=N.length+1,this.grid=new Array(this.iMax);for(var H=0;H<this.iMax;H++){this.grid[H]=new Array(this.jMax);for(var Y=0;Y<this.jMax;Y++)this.grid[H][Y]=0}this.tracebackGrid=new Array(this.iMax);for(var it=0;it<this.iMax;it++){this.tracebackGrid[it]=new Array(this.jMax);for(var et=0;et<this.jMax;et++)this.tracebackGrid[it][et]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return m(C,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var N=1;N<this.jMax;N++)this.grid[0][N]=this.grid[0][N-1]+this.gap_penalty,this.tracebackGrid[0][N]=[!1,!1,!0];for(var B=1;B<this.iMax;B++)this.grid[B][0]=this.grid[B-1][0]+this.gap_penalty,this.tracebackGrid[B][0]=[!1,!0,!1];for(var j=1;j<this.iMax;j++)for(var R=1;R<this.jMax;R++){var H=void 0;this.sequence1[j-1]===this.sequence2[R-1]?H=this.grid[j-1][R-1]+this.match_score:H=this.grid[j-1][R-1]+this.mismatch_penalty;var Y=this.grid[j-1][R]+this.gap_penalty,it=this.grid[j][R-1]+this.gap_penalty,et=[H,Y,it],st=this.arrayAllMaxIndexes(et);this.grid[j][R]=et[st[0]],this.tracebackGrid[j][R]=[st.includes(0),st.includes(1),st.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var N=[];for(N.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});N[0];){var B=N[0],j=this.tracebackGrid[B.pos[0]][B.pos[1]];j[0]&&N.push({pos:[B.pos[0]-1,B.pos[1]-1],seq1:this.sequence1[B.pos[0]-1]+B.seq1,seq2:this.sequence2[B.pos[1]-1]+B.seq2}),j[1]&&N.push({pos:[B.pos[0]-1,B.pos[1]],seq1:this.sequence1[B.pos[0]-1]+B.seq1,seq2:"-"+B.seq2}),j[2]&&N.push({pos:[B.pos[0],B.pos[1]-1],seq1:"-"+B.seq1,seq2:this.sequence2[B.pos[1]-1]+B.seq2}),B.pos[0]===0&&B.pos[1]===0&&this.alignments.push({sequence1:B.seq1,sequence2:B.seq2}),N.shift()}return this.alignments}},{key:"getAllIndexes",value:function(N,B){for(var j=[],R=-1;(R=N.indexOf(B,R+1))!==-1;)j.push(R);return j}},{key:"arrayAllMaxIndexes",value:function(N){return this.getAllIndexes(N,Math.max.apply(null,N))}}]),C}();f.exports=E},function(f,p,v){var m=function(){};m.FDLayout=v(18),m.FDLayoutConstants=v(7),m.FDLayoutEdge=v(19),m.FDLayoutNode=v(20),m.DimensionD=v(21),m.HashMap=v(22),m.HashSet=v(23),m.IGeometry=v(8),m.IMath=v(9),m.Integer=v(10),m.Point=v(12),m.PointD=v(4),m.RandomSeed=v(16),m.RectangleD=v(13),m.Transform=v(17),m.UniqueIDGeneretor=v(14),m.Quicksort=v(24),m.LinkedList=v(11),m.LGraphObject=v(2),m.LGraph=v(5),m.LEdge=v(1),m.LGraphManager=v(6),m.LNode=v(3),m.Layout=v(15),m.LayoutConstants=v(0),m.NeedlemanWunsch=v(25),f.exports=m},function(f,p,v){function m(){this.listeners=[]}var b=m.prototype;b.addListener=function(E,C){this.listeners.push({event:E,callback:C})},b.removeListener=function(E,C){for(var D=this.listeners.length;D>=0;D--){var N=this.listeners[D];N.event===E&&N.callback===C&&this.listeners.splice(D,1)}},b.emit=function(E,C){for(var D=0;D<this.listeners.length;D++){var N=this.listeners[D];E===N.event&&N.callback(C)}},f.exports=m}])})}(Agt)),Agt.exports}var bjt;function hUe(){return bjt||(bjt=1,function(i,a){(function(p,v){i.exports=v(lUe())})(b0,function(f){return function(p){var v={};function m(b){if(v[b])return v[b].exports;var E=v[b]={i:b,l:!1,exports:{}};return p[b].call(E.exports,E,E.exports,m),E.l=!0,E.exports}return m.m=p,m.c=v,m.i=function(b){return b},m.d=function(b,E,C){m.o(b,E)||Object.defineProperty(b,E,{configurable:!1,enumerable:!0,get:C})},m.n=function(b){var E=b&&b.__esModule?function(){return b.default}:function(){return b};return m.d(E,"a",E),E},m.o=function(b,E){return Object.prototype.hasOwnProperty.call(b,E)},m.p="",m(m.s=7)}([function(p,v){p.exports=f},function(p,v,m){var b=m(0).FDLayoutConstants;function E(){}for(var C in b)E[C]=b[C];E.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,E.DEFAULT_RADIAL_SEPARATION=b.DEFAULT_EDGE_LENGTH,E.DEFAULT_COMPONENT_SEPERATION=60,E.TILE=!0,E.TILING_PADDING_VERTICAL=10,E.TILING_PADDING_HORIZONTAL=10,E.TREE_REDUCTION_ON_INCREMENTAL=!1,p.exports=E},function(p,v,m){var b=m(0).FDLayoutEdge;function E(D,N,B){b.call(this,D,N,B)}E.prototype=Object.create(b.prototype);for(var C in b)E[C]=b[C];p.exports=E},function(p,v,m){var b=m(0).LGraph;function E(D,N,B){b.call(this,D,N,B)}E.prototype=Object.create(b.prototype);for(var C in b)E[C]=b[C];p.exports=E},function(p,v,m){var b=m(0).LGraphManager;function E(D){b.call(this,D)}E.prototype=Object.create(b.prototype);for(var C in b)E[C]=b[C];p.exports=E},function(p,v,m){var b=m(0).FDLayoutNode,E=m(0).IMath;function C(N,B,j,R){b.call(this,N,B,j,R)}C.prototype=Object.create(b.prototype);for(var D in b)C[D]=b[D];C.prototype.move=function(){var N=this.graphManager.getLayout();this.displacementX=N.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=N.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>N.coolingFactor*N.maxNodeDisplacement&&(this.displacementX=N.coolingFactor*N.maxNodeDisplacement*E.sign(this.displacementX)),Math.abs(this.displacementY)>N.coolingFactor*N.maxNodeDisplacement&&(this.displacementY=N.coolingFactor*N.maxNodeDisplacement*E.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),N.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},C.prototype.propogateDisplacementToChildren=function(N,B){for(var j=this.getChild().getNodes(),R,H=0;H<j.length;H++)R=j[H],R.getChild()==null?(R.moveBy(N,B),R.displacementX+=N,R.displacementY+=B):R.propogateDisplacementToChildren(N,B)},C.prototype.setPred1=function(N){this.pred1=N},C.prototype.getPred1=function(){return pred1},C.prototype.getPred2=function(){return pred2},C.prototype.setNext=function(N){this.next=N},C.prototype.getNext=function(){return next},C.prototype.setProcessed=function(N){this.processed=N},C.prototype.isProcessed=function(){return processed},p.exports=C},function(p,v,m){var b=m(0).FDLayout,E=m(4),C=m(3),D=m(5),N=m(2),B=m(1),j=m(0).FDLayoutConstants,R=m(0).LayoutConstants,H=m(0).Point,Y=m(0).PointD,it=m(0).Layout,et=m(0).Integer,st=m(0).IGeometry,pt=m(0).LGraph,Tt=m(0).Transform;function kt(){b.call(this),this.toBeTiled={}}kt.prototype=Object.create(b.prototype);for(var yt in b)kt[yt]=b[yt];kt.prototype.newGraphManager=function(){var ft=new E(this);return this.graphManager=ft,ft},kt.prototype.newGraph=function(ft){return new C(null,this.graphManager,ft)},kt.prototype.newNode=function(ft){return new D(this.graphManager,ft)},kt.prototype.newEdge=function(ft){return new N(null,null,ft)},kt.prototype.initParameters=function(){b.prototype.initParameters.call(this,arguments),this.isSubLayout||(B.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=B.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=B.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=j.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=j.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=j.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=j.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=j.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=j.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/j.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=j.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},kt.prototype.layout=function(){var ft=R.DEFAULT_CREATE_BENDS_AS_NEEDED;return ft&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},kt.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(B.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var mt=new Set(this.getAllNodes()),rt=this.nodesWithGravity.filter(function(ht){return mt.has(ht)});this.graphManager.setAllNodesToApplyGravitation(rt)}}else{var ft=this.getFlatForest();if(ft.length>0)this.positionNodesRadially(ft);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var mt=new Set(this.getAllNodes()),rt=this.nodesWithGravity.filter(function(wt){return mt.has(wt)});this.graphManager.setAllNodesToApplyGravitation(rt),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},kt.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%j.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var ft=new Set(this.getAllNodes()),mt=this.nodesWithGravity.filter(function(gt){return ft.has(gt)});this.graphManager.setAllNodesToApplyGravitation(mt),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=j.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=j.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var rt=!this.isTreeGrowing&&!this.isGrowthFinished,wt=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(rt,wt),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},kt.prototype.getPositionsData=function(){for(var ft=this.graphManager.getAllNodes(),mt={},rt=0;rt<ft.length;rt++){var wt=ft[rt].rect,gt=ft[rt].id;mt[gt]={id:gt,x:wt.getCenterX(),y:wt.getCenterY(),w:wt.width,h:wt.height}}return mt},kt.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var ft=!1;if(j.ANIMATE==="during")this.emit("layoutstarted");else{for(;!ft;)ft=this.tick();this.graphManager.updateBounds()}},kt.prototype.calculateNodesToApplyGravitationTo=function(){var ft=[],mt,rt=this.graphManager.getGraphs(),wt=rt.length,gt;for(gt=0;gt<wt;gt++)mt=rt[gt],mt.updateConnected(),mt.isConnected||(ft=ft.concat(mt.getNodes()));return ft},kt.prototype.createBendpoints=function(){var ft=[];ft=ft.concat(this.graphManager.getAllEdges());var mt=new Set,rt;for(rt=0;rt<ft.length;rt++){var wt=ft[rt];if(!mt.has(wt)){var gt=wt.getSource(),ht=wt.getTarget();if(gt==ht)wt.getBendpoints().push(new Y),wt.getBendpoints().push(new Y),this.createDummyNodesForBendpoints(wt),mt.add(wt);else{var _t=[];if(_t=_t.concat(gt.getEdgeListToNode(ht)),_t=_t.concat(ht.getEdgeListToNode(gt)),!mt.has(_t[0])){if(_t.length>1){var X;for(X=0;X<_t.length;X++){var Rt=_t[X];Rt.getBendpoints().push(new Y),this.createDummyNodesForBendpoints(Rt)}}_t.forEach(function(lt){mt.add(lt)})}}}if(mt.size==ft.length)break}},kt.prototype.positionNodesRadially=function(ft){for(var mt=new H(0,0),rt=Math.ceil(Math.sqrt(ft.length)),wt=0,gt=0,ht=0,_t=new Y(0,0),X=0;X<ft.length;X++){X%rt==0&&(ht=0,gt=wt,X!=0&&(gt+=B.DEFAULT_COMPONENT_SEPERATION),wt=0);var Rt=ft[X],lt=it.findCenterOfTree(Rt);mt.x=ht,mt.y=gt,_t=kt.radialLayout(Rt,lt,mt),_t.y>wt&&(wt=Math.floor(_t.y)),ht=Math.floor(_t.x+B.DEFAULT_COMPONENT_SEPERATION)}this.transform(new Y(R.WORLD_CENTER_X-_t.x/2,R.WORLD_CENTER_Y-_t.y/2))},kt.radialLayout=function(ft,mt,rt){var wt=Math.max(this.maxDiagonalInTree(ft),B.DEFAULT_RADIAL_SEPARATION);kt.branchRadialLayout(mt,null,0,359,0,wt);var gt=pt.calculateBounds(ft),ht=new Tt;ht.setDeviceOrgX(gt.getMinX()),ht.setDeviceOrgY(gt.getMinY()),ht.setWorldOrgX(rt.x),ht.setWorldOrgY(rt.y);for(var _t=0;_t<ft.length;_t++){var X=ft[_t];X.transform(ht)}var Rt=new Y(gt.getMaxX(),gt.getMaxY());return ht.inverseTransformPoint(Rt)},kt.branchRadialLayout=function(ft,mt,rt,wt,gt,ht){var _t=(wt-rt+1)/2;_t<0&&(_t+=180);var X=(_t+rt)%360,Rt=X*st.TWO_PI/360,lt=gt*Math.cos(Rt),fe=gt*Math.sin(Rt);ft.setCenter(lt,fe);var J=[];J=J.concat(ft.getEdges());var ae=J.length;mt!=null&&ae--;for(var Wt=0,It=J.length,Pt,me=ft.getEdgesBetween(mt);me.length>1;){var Ue=me[0];me.splice(0,1);var _n=J.indexOf(Ue);_n>=0&&J.splice(_n,1),It--,ae--}mt!=null?Pt=(J.indexOf(me[0])+1)%It:Pt=0;for(var _e=Math.abs(wt-rt)/ae,rr=Pt;Wt!=ae;rr=++rr%It){var Te=J[rr].getOtherEnd(ft);if(Te!=mt){var ne=(rt+Wt*_e)%360,Ee=(ne+_e)%360;kt.branchRadialLayout(Te,ft,ne,Ee,gt+ht,ht),Wt++}}},kt.maxDiagonalInTree=function(ft){for(var mt=et.MIN_VALUE,rt=0;rt<ft.length;rt++){var wt=ft[rt],gt=wt.getDiagonal();gt>mt&&(mt=gt)}return mt},kt.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},kt.prototype.groupZeroDegreeMembers=function(){var ft=this,mt={};this.memberGroups={},this.idToDummyNode={};for(var rt=[],wt=this.graphManager.getAllNodes(),gt=0;gt<wt.length;gt++){var ht=wt[gt],_t=ht.getParent();this.getNodeDegreeWithChildren(ht)===0&&(_t.id==null||!this.getToBeTiled(_t))&&rt.push(ht)}for(var gt=0;gt<rt.length;gt++){var ht=rt[gt],X=ht.getParent().id;typeof mt[X]>"u"&&(mt[X]=[]),mt[X]=mt[X].concat(ht)}Object.keys(mt).forEach(function(Rt){if(mt[Rt].length>1){var lt="DummyCompound_"+Rt;ft.memberGroups[lt]=mt[Rt];var fe=mt[Rt][0].getParent(),J=new D(ft.graphManager);J.id=lt,J.paddingLeft=fe.paddingLeft||0,J.paddingRight=fe.paddingRight||0,J.paddingBottom=fe.paddingBottom||0,J.paddingTop=fe.paddingTop||0,ft.idToDummyNode[lt]=J;var ae=ft.getGraphManager().add(ft.newGraph(),J),Wt=fe.getChild();Wt.add(J);for(var It=0;It<mt[Rt].length;It++){var Pt=mt[Rt][It];Wt.remove(Pt),ae.add(Pt)}}})},kt.prototype.clearCompounds=function(){var ft={},mt={};this.performDFSOnCompounds();for(var rt=0;rt<this.compoundOrder.length;rt++)mt[this.compoundOrder[rt].id]=this.compoundOrder[rt],ft[this.compoundOrder[rt].id]=[].concat(this.compoundOrder[rt].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[rt].getChild()),this.compoundOrder[rt].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(ft,mt)},kt.prototype.clearZeroDegreeMembers=function(){var ft=this,mt=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(rt){var wt=ft.idToDummyNode[rt];mt[rt]=ft.tileNodes(ft.memberGroups[rt],wt.paddingLeft+wt.paddingRight),wt.rect.width=mt[rt].width,wt.rect.height=mt[rt].height})},kt.prototype.repopulateCompounds=function(){for(var ft=this.compoundOrder.length-1;ft>=0;ft--){var mt=this.compoundOrder[ft],rt=mt.id,wt=mt.paddingLeft,gt=mt.paddingTop;this.adjustLocations(this.tiledMemberPack[rt],mt.rect.x,mt.rect.y,wt,gt)}},kt.prototype.repopulateZeroDegreeMembers=function(){var ft=this,mt=this.tiledZeroDegreePack;Object.keys(mt).forEach(function(rt){var wt=ft.idToDummyNode[rt],gt=wt.paddingLeft,ht=wt.paddingTop;ft.adjustLocations(mt[rt],wt.rect.x,wt.rect.y,gt,ht)})},kt.prototype.getToBeTiled=function(ft){var mt=ft.id;if(this.toBeTiled[mt]!=null)return this.toBeTiled[mt];var rt=ft.getChild();if(rt==null)return this.toBeTiled[mt]=!1,!1;for(var wt=rt.getNodes(),gt=0;gt<wt.length;gt++){var ht=wt[gt];if(this.getNodeDegree(ht)>0)return this.toBeTiled[mt]=!1,!1;if(ht.getChild()==null){this.toBeTiled[ht.id]=!1;continue}if(!this.getToBeTiled(ht))return this.toBeTiled[mt]=!1,!1}return this.toBeTiled[mt]=!0,!0},kt.prototype.getNodeDegree=function(ft){ft.id;for(var mt=ft.getEdges(),rt=0,wt=0;wt<mt.length;wt++){var gt=mt[wt];gt.getSource().id!==gt.getTarget().id&&(rt=rt+1)}return rt},kt.prototype.getNodeDegreeWithChildren=function(ft){var mt=this.getNodeDegree(ft);if(ft.getChild()==null)return mt;for(var rt=ft.getChild().getNodes(),wt=0;wt<rt.length;wt++){var gt=rt[wt];mt+=this.getNodeDegreeWithChildren(gt)}return mt},kt.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},kt.prototype.fillCompexOrderByDFS=function(ft){for(var mt=0;mt<ft.length;mt++){var rt=ft[mt];rt.getChild()!=null&&this.fillCompexOrderByDFS(rt.getChild().getNodes()),this.getToBeTiled(rt)&&this.compoundOrder.push(rt)}},kt.prototype.adjustLocations=function(ft,mt,rt,wt,gt){mt+=wt,rt+=gt;for(var ht=mt,_t=0;_t<ft.rows.length;_t++){var X=ft.rows[_t];mt=ht;for(var Rt=0,lt=0;lt<X.length;lt++){var fe=X[lt];fe.rect.x=mt,fe.rect.y=rt,mt+=fe.rect.width+ft.horizontalPadding,fe.rect.height>Rt&&(Rt=fe.rect.height)}rt+=Rt+ft.verticalPadding}},kt.prototype.tileCompoundMembers=function(ft,mt){var rt=this;this.tiledMemberPack=[],Object.keys(ft).forEach(function(wt){var gt=mt[wt];rt.tiledMemberPack[wt]=rt.tileNodes(ft[wt],gt.paddingLeft+gt.paddingRight),gt.rect.width=rt.tiledMemberPack[wt].width,gt.rect.height=rt.tiledMemberPack[wt].height})},kt.prototype.tileNodes=function(ft,mt){var rt=B.TILING_PADDING_VERTICAL,wt=B.TILING_PADDING_HORIZONTAL,gt={rows:[],rowWidth:[],rowHeight:[],width:0,height:mt,verticalPadding:rt,horizontalPadding:wt};ft.sort(function(X,Rt){return X.rect.width*X.rect.height>Rt.rect.width*Rt.rect.height?-1:X.rect.width*X.rect.height<Rt.rect.width*Rt.rect.height?1:0});for(var ht=0;ht<ft.length;ht++){var _t=ft[ht];gt.rows.length==0?this.insertNodeToRow(gt,_t,0,mt):this.canAddHorizontal(gt,_t.rect.width,_t.rect.height)?this.insertNodeToRow(gt,_t,this.getShortestRowIndex(gt),mt):this.insertNodeToRow(gt,_t,gt.rows.length,mt),this.shiftToLastRow(gt)}return gt},kt.prototype.insertNodeToRow=function(ft,mt,rt,wt){var gt=wt;if(rt==ft.rows.length){var ht=[];ft.rows.push(ht),ft.rowWidth.push(gt),ft.rowHeight.push(0)}var _t=ft.rowWidth[rt]+mt.rect.width;ft.rows[rt].length>0&&(_t+=ft.horizontalPadding),ft.rowWidth[rt]=_t,ft.width<_t&&(ft.width=_t);var X=mt.rect.height;rt>0&&(X+=ft.verticalPadding);var Rt=0;X>ft.rowHeight[rt]&&(Rt=ft.rowHeight[rt],ft.rowHeight[rt]=X,Rt=ft.rowHeight[rt]-Rt),ft.height+=Rt,ft.rows[rt].push(mt)},kt.prototype.getShortestRowIndex=function(ft){for(var mt=-1,rt=Number.MAX_VALUE,wt=0;wt<ft.rows.length;wt++)ft.rowWidth[wt]<rt&&(mt=wt,rt=ft.rowWidth[wt]);return mt},kt.prototype.getLongestRowIndex=function(ft){for(var mt=-1,rt=Number.MIN_VALUE,wt=0;wt<ft.rows.length;wt++)ft.rowWidth[wt]>rt&&(mt=wt,rt=ft.rowWidth[wt]);return mt},kt.prototype.canAddHorizontal=function(ft,mt,rt){var wt=this.getShortestRowIndex(ft);if(wt<0)return!0;var gt=ft.rowWidth[wt];if(gt+ft.horizontalPadding+mt<=ft.width)return!0;var ht=0;ft.rowHeight[wt]<rt&&wt>0&&(ht=rt+ft.verticalPadding-ft.rowHeight[wt]);var _t;ft.width-gt>=mt+ft.horizontalPadding?_t=(ft.height+ht)/(gt+mt+ft.horizontalPadding):_t=(ft.height+ht)/ft.width,ht=rt+ft.verticalPadding;var X;return ft.width<mt?X=(ft.height+ht)/mt:X=(ft.height+ht)/ft.width,X<1&&(X=1/X),_t<1&&(_t=1/_t),_t<X},kt.prototype.shiftToLastRow=function(ft){var mt=this.getLongestRowIndex(ft),rt=ft.rowWidth.length-1,wt=ft.rows[mt],gt=wt[wt.length-1],ht=gt.width+ft.horizontalPadding;if(ft.width-ft.rowWidth[rt]>ht&&mt!=rt){wt.splice(-1,1),ft.rows[rt].push(gt),ft.rowWidth[mt]=ft.rowWidth[mt]-ht,ft.rowWidth[rt]=ft.rowWidth[rt]+ht,ft.width=ft.rowWidth[instance.getLongestRowIndex(ft)];for(var _t=Number.MIN_VALUE,X=0;X<wt.length;X++)wt[X].height>_t&&(_t=wt[X].height);mt>0&&(_t+=ft.verticalPadding);var Rt=ft.rowHeight[mt]+ft.rowHeight[rt];ft.rowHeight[mt]=_t,ft.rowHeight[rt]<gt.height+ft.verticalPadding&&(ft.rowHeight[rt]=gt.height+ft.verticalPadding);var lt=ft.rowHeight[mt]+ft.rowHeight[rt];ft.height+=lt-Rt,this.shiftToLastRow(ft)}},kt.prototype.tilingPreLayout=function(){B.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},kt.prototype.tilingPostLayout=function(){B.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},kt.prototype.reduceTrees=function(){for(var ft=[],mt=!0,rt;mt;){var wt=this.graphManager.getAllNodes(),gt=[];mt=!1;for(var ht=0;ht<wt.length;ht++)rt=wt[ht],rt.getEdges().length==1&&!rt.getEdges()[0].isInterGraph&&rt.getChild()==null&&(gt.push([rt,rt.getEdges()[0],rt.getOwner()]),mt=!0);if(mt==!0){for(var _t=[],X=0;X<gt.length;X++)gt[X][0].getEdges().length==1&&(_t.push(gt[X]),gt[X][0].getOwner().remove(gt[X][0]));ft.push(_t),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=ft},kt.prototype.growTree=function(ft){for(var mt=ft.length,rt=ft[mt-1],wt,gt=0;gt<rt.length;gt++)wt=rt[gt],this.findPlaceforPrunedNode(wt),wt[2].add(wt[0]),wt[2].add(wt[1],wt[1].source,wt[1].target);ft.splice(ft.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},kt.prototype.findPlaceforPrunedNode=function(ft){var mt,rt,wt=ft[0];wt==ft[1].source?rt=ft[1].target:rt=ft[1].source;var gt=rt.startX,ht=rt.finishX,_t=rt.startY,X=rt.finishY,Rt=0,lt=0,fe=0,J=0,ae=[Rt,fe,lt,J];if(_t>0)for(var Wt=gt;Wt<=ht;Wt++)ae[0]+=this.grid[Wt][_t-1].length+this.grid[Wt][_t].length-1;if(ht<this.grid.length-1)for(var Wt=_t;Wt<=X;Wt++)ae[1]+=this.grid[ht+1][Wt].length+this.grid[ht][Wt].length-1;if(X<this.grid[0].length-1)for(var Wt=gt;Wt<=ht;Wt++)ae[2]+=this.grid[Wt][X+1].length+this.grid[Wt][X].length-1;if(gt>0)for(var Wt=_t;Wt<=X;Wt++)ae[3]+=this.grid[gt-1][Wt].length+this.grid[gt][Wt].length-1;for(var It=et.MAX_VALUE,Pt,me,Ue=0;Ue<ae.length;Ue++)ae[Ue]<It?(It=ae[Ue],Pt=1,me=Ue):ae[Ue]==It&&Pt++;if(Pt==3&&It==0)ae[0]==0&&ae[1]==0&&ae[2]==0?mt=1:ae[0]==0&&ae[1]==0&&ae[3]==0?mt=0:ae[0]==0&&ae[2]==0&&ae[3]==0?mt=3:ae[1]==0&&ae[2]==0&&ae[3]==0&&(mt=2);else if(Pt==2&&It==0){var _n=Math.floor(Math.random()*2);ae[0]==0&&ae[1]==0?_n==0?mt=0:mt=1:ae[0]==0&&ae[2]==0?_n==0?mt=0:mt=2:ae[0]==0&&ae[3]==0?_n==0?mt=0:mt=3:ae[1]==0&&ae[2]==0?_n==0?mt=1:mt=2:ae[1]==0&&ae[3]==0?_n==0?mt=1:mt=3:_n==0?mt=2:mt=3}else if(Pt==4&&It==0){var _n=Math.floor(Math.random()*4);mt=_n}else mt=me;mt==0?wt.setCenter(rt.getCenterX(),rt.getCenterY()-rt.getHeight()/2-j.DEFAULT_EDGE_LENGTH-wt.getHeight()/2):mt==1?wt.setCenter(rt.getCenterX()+rt.getWidth()/2+j.DEFAULT_EDGE_LENGTH+wt.getWidth()/2,rt.getCenterY()):mt==2?wt.setCenter(rt.getCenterX(),rt.getCenterY()+rt.getHeight()/2+j.DEFAULT_EDGE_LENGTH+wt.getHeight()/2):wt.setCenter(rt.getCenterX()-rt.getWidth()/2-j.DEFAULT_EDGE_LENGTH-wt.getWidth()/2,rt.getCenterY())},p.exports=kt},function(p,v,m){var b={};b.layoutBase=m(0),b.CoSEConstants=m(1),b.CoSEEdge=m(2),b.CoSEGraph=m(3),b.CoSEGraphManager=m(4),b.CoSELayout=m(6),b.CoSENode=m(5),p.exports=b}])})}(Sgt)),Sgt.exports}(function(i,a){(function(p,v){i.exports=v(hUe())})(b0,function(f){return function(p){var v={};function m(b){if(v[b])return v[b].exports;var E=v[b]={i:b,l:!1,exports:{}};return p[b].call(E.exports,E,E.exports,m),E.l=!0,E.exports}return m.m=p,m.c=v,m.i=function(b){return b},m.d=function(b,E,C){m.o(b,E)||Object.defineProperty(b,E,{configurable:!1,enumerable:!0,get:C})},m.n=function(b){var E=b&&b.__esModule?function(){return b.default}:function(){return b};return m.d(E,"a",E),E},m.o=function(b,E){return Object.prototype.hasOwnProperty.call(b,E)},m.p="",m(m.s=1)}([function(p,v){p.exports=f},function(p,v,m){var b=m(0).layoutBase.LayoutConstants,E=m(0).layoutBase.FDLayoutConstants,C=m(0).CoSEConstants,D=m(0).CoSELayout,N=m(0).CoSENode,B=m(0).layoutBase.PointD,j=m(0).layoutBase.DimensionD,R={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function H(st,pt){var Tt={};for(var kt in st)Tt[kt]=st[kt];for(var kt in pt)Tt[kt]=pt[kt];return Tt}function Y(st){this.options=H(R,st),it(this.options)}var it=function(pt){pt.nodeRepulsion!=null&&(C.DEFAULT_REPULSION_STRENGTH=E.DEFAULT_REPULSION_STRENGTH=pt.nodeRepulsion),pt.idealEdgeLength!=null&&(C.DEFAULT_EDGE_LENGTH=E.DEFAULT_EDGE_LENGTH=pt.idealEdgeLength),pt.edgeElasticity!=null&&(C.DEFAULT_SPRING_STRENGTH=E.DEFAULT_SPRING_STRENGTH=pt.edgeElasticity),pt.nestingFactor!=null&&(C.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=E.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=pt.nestingFactor),pt.gravity!=null&&(C.DEFAULT_GRAVITY_STRENGTH=E.DEFAULT_GRAVITY_STRENGTH=pt.gravity),pt.numIter!=null&&(C.MAX_ITERATIONS=E.MAX_ITERATIONS=pt.numIter),pt.gravityRange!=null&&(C.DEFAULT_GRAVITY_RANGE_FACTOR=E.DEFAULT_GRAVITY_RANGE_FACTOR=pt.gravityRange),pt.gravityCompound!=null&&(C.DEFAULT_COMPOUND_GRAVITY_STRENGTH=E.DEFAULT_COMPOUND_GRAVITY_STRENGTH=pt.gravityCompound),pt.gravityRangeCompound!=null&&(C.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=E.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=pt.gravityRangeCompound),pt.initialEnergyOnIncremental!=null&&(C.DEFAULT_COOLING_FACTOR_INCREMENTAL=E.DEFAULT_COOLING_FACTOR_INCREMENTAL=pt.initialEnergyOnIncremental),pt.quality=="draft"?b.QUALITY=0:pt.quality=="proof"?b.QUALITY=2:b.QUALITY=1,C.NODE_DIMENSIONS_INCLUDE_LABELS=E.NODE_DIMENSIONS_INCLUDE_LABELS=b.NODE_DIMENSIONS_INCLUDE_LABELS=pt.nodeDimensionsIncludeLabels,C.DEFAULT_INCREMENTAL=E.DEFAULT_INCREMENTAL=b.DEFAULT_INCREMENTAL=!pt.randomize,C.ANIMATE=E.ANIMATE=b.ANIMATE=pt.animate,C.TILE=pt.tile,C.TILING_PADDING_VERTICAL=typeof pt.tilingPaddingVertical=="function"?pt.tilingPaddingVertical.call():pt.tilingPaddingVertical,C.TILING_PADDING_HORIZONTAL=typeof pt.tilingPaddingHorizontal=="function"?pt.tilingPaddingHorizontal.call():pt.tilingPaddingHorizontal};Y.prototype.run=function(){var st,pt,Tt=this.options;this.idToLNode={};var kt=this.layout=new D,yt=this;yt.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var ft=kt.newGraphManager();this.gm=ft;var mt=this.options.eles.nodes(),rt=this.options.eles.edges();this.root=ft.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(mt),kt);for(var wt=0;wt<rt.length;wt++){var gt=rt[wt],ht=this.idToLNode[gt.data("source")],_t=this.idToLNode[gt.data("target")];if(ht!==_t&&ht.getEdgesBetween(_t).length==0){var X=ft.add(kt.newEdge(),ht,_t);X.id=gt.id()}}var Rt=function(J,ae){typeof J=="number"&&(J=ae);var Wt=J.data("id"),It=yt.idToLNode[Wt];return{x:It.getRect().getCenterX(),y:It.getRect().getCenterY()}},lt=function fe(){for(var J=function(){Tt.fit&&Tt.cy.fit(Tt.eles,Tt.padding),st||(st=!0,yt.cy.one("layoutready",Tt.ready),yt.cy.trigger({type:"layoutready",layout:yt}))},ae=yt.options.refresh,Wt,It=0;It<ae&&!Wt;It++)Wt=yt.stopped||yt.layout.tick();if(Wt){kt.checkLayoutSuccess()&&!kt.isSubLayout&&kt.doPostLayout(),kt.tilingPostLayout&&kt.tilingPostLayout(),kt.isLayoutFinished=!0,yt.options.eles.nodes().positions(Rt),J(),yt.cy.one("layoutstop",yt.options.stop),yt.cy.trigger({type:"layoutstop",layout:yt}),pt&&cancelAnimationFrame(pt),st=!1;return}var Pt=yt.layout.getPositionsData();Tt.eles.nodes().positions(function(me,Ue){if(typeof me=="number"&&(me=Ue),!me.isParent()){for(var _n=me.id(),_e=Pt[_n],rr=me;_e==null&&(_e=Pt[rr.data("parent")]||Pt["DummyCompound_"+rr.data("parent")],Pt[_n]=_e,rr=rr.parent()[0],rr!=null););return _e!=null?{x:_e.x,y:_e.y}:{x:me.position("x"),y:me.position("y")}}}),J(),pt=requestAnimationFrame(fe)};return kt.addListener("layoutstarted",function(){yt.options.animate==="during"&&(pt=requestAnimationFrame(lt))}),kt.runLayout(),this.options.animate!=="during"&&(yt.options.eles.nodes().not(":parent").layoutPositions(yt,yt.options,Rt),st=!1),this},Y.prototype.getTopMostNodes=function(st){for(var pt={},Tt=0;Tt<st.length;Tt++)pt[st[Tt].id()]=!0;var kt=st.filter(function(yt,ft){typeof yt=="number"&&(yt=ft);for(var mt=yt.parent()[0];mt!=null;){if(pt[mt.id()])return!1;mt=mt.parent()[0]}return!0});return kt},Y.prototype.processChildrenList=function(st,pt,Tt){for(var kt=pt.length,yt=0;yt<kt;yt++){var ft=pt[yt],mt=ft.children(),rt,wt=ft.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(ft.outerWidth()!=null&&ft.outerHeight()!=null?rt=st.add(new N(Tt.graphManager,new B(ft.position("x")-wt.w/2,ft.position("y")-wt.h/2),new j(parseFloat(wt.w),parseFloat(wt.h)))):rt=st.add(new N(this.graphManager)),rt.id=ft.data("id"),rt.paddingLeft=parseInt(ft.css("padding")),rt.paddingTop=parseInt(ft.css("padding")),rt.paddingRight=parseInt(ft.css("padding")),rt.paddingBottom=parseInt(ft.css("padding")),this.options.nodeDimensionsIncludeLabels&&ft.isParent()){var gt=ft.boundingBox({includeLabels:!0,includeNodes:!1}).w,ht=ft.boundingBox({includeLabels:!0,includeNodes:!1}).h,_t=ft.css("text-halign");rt.labelWidth=gt,rt.labelHeight=ht,rt.labelPos=_t}if(this.idToLNode[ft.data("id")]=rt,isNaN(rt.rect.x)&&(rt.rect.x=0),isNaN(rt.rect.y)&&(rt.rect.y=0),mt!=null&&mt.length>0){var X;X=Tt.getGraphManager().add(Tt.newGraph(),rt),this.processChildrenList(X,mt,Tt)}}},Y.prototype.stop=function(){return this.stopped=!0,this};var et=function(pt){pt("layout","cose-bilkent",Y)};typeof cytoscape<"u"&&et(cytoscape),p.exports=et}])})})(gjt);var fUe=gjt.exports;const dUe=B9(fUe);djt.use(dUe);function vjt(i,a,f,p){hjt.drawNode(i,a,f,p),a.children&&a.children.forEach((v,m)=>{vjt(i,v,f<0?m:f,p)})}function gUe(i,a){a.edges().map((f,p)=>{const v=f.data();if(f[0]._private.bodyBounds){const m=f[0]._private.rscratch;zt.trace("Edge: ",p,v),i.insert("path").attr("d",`M ${m.startX},${m.startY} L ${m.midX},${m.midY} L${m.endX},${m.endY} `).attr("class","edge section-edge-"+v.section+" edge-depth-"+v.depth)}})}function wjt(i,a,f,p){a.add({group:"nodes",data:{id:i.id,labelText:i.descr,height:i.height,width:i.width,level:p,nodeId:i.id,padding:i.padding,type:i.type},position:{x:i.x,y:i.y}}),i.children&&i.children.forEach(v=>{wjt(v,a,f,p+1),a.add({group:"edges",data:{id:`${i.id}_${v.id}`,source:i.id,target:v.id,depth:p,section:v.section}})})}function pUe(i,a){return new Promise(f=>{const p=Mr("body").append("div").attr("id","cy").attr("style","display:none"),v=djt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});p.remove(),wjt(i,v,a,0),v.nodes().forEach(function(m){m.layoutDimensions=()=>{const b=m.data();return{w:b.width,h:b.height}}}),v.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),v.ready(m=>{zt.info("Ready",m),f(v)})})}function bUe(i){i.nodes().map((a,f)=>{const p=a.data();p.x=a.position().x,p.y=a.position().y,hjt.positionNode(p);const v=Cgt(p.nodeId);zt.info("Id:",f,"Position: (",a.position().x,", ",a.position().y,")",p),v.attr("transform",`translate(${a.position().x-p.width/2}, ${a.position().y-p.height/2})`),v.attr("attr",`apa-${f})`)})}const vUe={draw:async(i,a,f,p)=>{const v=Oe();v.htmlLabels=!1,p.db.clear(),p.parser.parse(i),zt.debug(`Rendering mindmap diagram
`+i,p.parser);const m=Oe().securityLevel;let b;m==="sandbox"&&(b=Mr("#i"+a));const C=Mr(m==="sandbox"?b.nodes()[0].contentDocument.body:"body").select("#"+a);C.append("g");const D=p.db.getMindmap(),N=C.append("g");N.attr("class","mindmap-edges");const B=C.append("g");B.attr("class","mindmap-nodes"),vjt(B,D,-1,v);const j=await pUe(D,v);gUe(N,j),bUe(j),J9(void 0,C,v.mindmap.padding,v.mindmap.useMaxWidth),Editor.mermaidToDrawio(j,"Mindmap")}},wUe=i=>{let a="";for(let f=0;f<i.THEME_COLOR_LIMIT;f++)i["lineColor"+f]=i["lineColor"+f]||i["cScaleInv"+f],Q9(i["lineColor"+f])?i["lineColor"+f]=Ds(i["lineColor"+f],20):i["lineColor"+f]=ta(i["lineColor"+f],20);for(let f=0;f<i.THEME_COLOR_LIMIT;f++){const p=""+(17-3*f);a+=`
    .section-${f-1} rect, .section-${f-1} path, .section-${f-1} circle, .section-${f-1} polygon, .section-${f-1} path  {
      fill: ${i["cScale"+f]};
    }
    .section-${f-1} text {
     fill: ${i["cScaleLabel"+f]};
    }
    .node-icon-${f-1} {
      font-size: 40px;
      color: ${i["cScaleLabel"+f]};
    }
    .section-edge-${f-1}{
      stroke: ${i["cScale"+f]};
    }
    .edge-depth-${f-1}{
      stroke-width: ${p};
    }
    .section-${f-1} line {
      stroke: ${i["cScaleInv"+f]} ;
      stroke-width: 3;
    }

    .disabled, .disabled circle, .disabled text {
      fill: lightgray;
    }
    .disabled text {
      fill: #efefef;
    }
    `}return a},mUe=Object.freeze(Object.defineProperty({__proto__:null,diagram:{db:tUe,renderer:vUe,parser:VGe,styles:i=>`
  .edge {
    stroke-width: 3;
  }
  ${wUe(i)}
  .section-root rect, .section-root path, .section-root circle, .section-root polygon  {
    fill: ${i.git0};
  }
  .section-root text {
    fill: ${i.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;
  }
`}},Symbol.toStringTag,{value:"Module"}));return N2});
/**
 * @version   : 15.6.0 - Bridge.NET
 * @author    : Object.NET, Inc. http://bridge.net/
 * @date      : 2016-12-12
 * @copyright : Copyright 2008-2016 Object.NET, Inc. http://object.net/
 * @license   : See license.txt and https://github.com/bridgedotnet/Bridge/blob/master/LICENSE.md
 */
(function(n){"use strict";var bt={global:n,emptyFn:function(){},identity:function(n){return n},geti:function(n,t,i){return Bridge.hasValue(n[t])?t:i},literal:function(n,t){return t.$getType=function(){return n},t},isPlainObject:function(n){if(typeof n=="object"&&n!==null){if(typeof Object.getPrototypeOf=="function"){var t=Object.getPrototypeOf(n);return t===Object.prototype||t===null}return Object.prototype.toString.call(n)==="[object Object]"}return!1},toPlain:function(n){var i,t,r,u,f;if(!n||Bridge.isPlainObject(n)||typeof n!="object")return n;if(typeof n.toJSON=="function")return n.toJSON();if(Bridge.isArray(n)){for(i=[],t=0;t<n.length;t++)i.push(Bridge.toPlain(n[t]));return i}r={};for(f in n)u=n[f],Bridge.isFunction(u)||(r[f]=u);return r},ref:function(n,t){Bridge.isArray(t)&&(t=System.Array.toIndex(n,t));var i={};return Object.defineProperty(i,"v",{get:function(){return n[t]},set:function(i){n[t]=i}}),i},property:function(n,t,i,r){n[t]=i;var s=t.charAt(0)==="$",f=s?t.slice(1):t,e="get"+f,o="set"+f,u=t.lastIndexOf("$"),h=u>0&&t.length-u-1>0&&!isNaN(parseInt(t.substr(u+1)));h&&(u=t.substring(0,u-1).lastIndexOf("$"));u>0&&u!==t.length-1&&(e=t.substring(0,u)+"get"+t.substr(u+1),o=t.substring(0,u)+"set"+t.substr(u+1));n[e]=function(n,t,i){return i?function(){return t[n]}:function(){return this[n]}}(t,n,r);n[o]=function(n,t,i){return i?function(i){t[n]=i}:function(t){this[n]=t}}(t,n,r)},event:function(n,t,i,r){n[t]=i;var s=t.charAt(0)==="$",f=s?t.slice(1):t,e="add"+f,o="remove"+f,u=t.lastIndexOf("$"),h=u>0&&t.length-u-1>0&&!isNaN(parseInt(t.substr(u+1)));h&&(u=t.substring(0,u-1).lastIndexOf("$"));u>0&&u!==t.length-1&&(e=t.substring(0,u)+"add"+t.substr(u+1),o=t.substring(0,u)+"remove"+t.substr(u+1));n[e]=function(n,t,i){return i?function(i){t[n]=Bridge.fn.combine(t[n],i)}:function(t){this[n]=Bridge.fn.combine(this[n],t)}}(t,n,r);n[o]=function(n,t,i){return i?function(i){t[n]=Bridge.fn.remove(t[n],i)}:function(t){this[n]=Bridge.fn.remove(this[n],t)}}(t,n,r)},createInstance:function(n,t){return n===System.Decimal?System.Decimal.Zero:n===System.Int64?System.Int64.Zero:n===System.UInt64?System.UInt64.Zero:n===System.Double||n===System.Single||n===System.Byte||n===System.SByte||n===System.Int16||n===System.UInt16||n===System.Int32||n===System.UInt32||n===Bridge.Int?0:typeof n.getDefaultValue=="function"?n.getDefaultValue():n===Boolean?!1:n===Date?new Date(0):n===Number?0:n===String?"":n&&n.$literal?n.ctor():t&&t.length>0?Bridge.Reflection.applyConstructor(n,t):new n},clone:function(n){if(Bridge.isArray(n))return System.Array.clone(n);if(Bridge.isString(n))return n;var t;return Bridge.isFunction(n[t="System$ICloneable$clone"])?n[t]():Bridge.is(n,System.ICloneable)?n.clone():null},copy:function(n,t,i,r){typeof i=="string"&&(i=i.split(/[,;\s]+/));for(var u,f=0,e=i?i.length:0;f<e;f++)u=i[f],(r!==!0||n[u]==undefined)&&(n[u]=Bridge.is(t[u],System.ICloneable)?Bridge.clone(t[u]):t[u]);return n},get:function(n){return n&&n.$staticInit!==null&&n.$staticInit(),n},ns:function(n,t){var r=n.split("."),i=0;for(t||(t=Bridge.global),i=0;i<r.length;i++)typeof t[r[i]]=="undefined"&&(t[r[i]]={}),t=t[r[i]];return t},ready:function(n,t){var i=function(){t?n.apply(t):n()};if(typeof Bridge.global.jQuery!="undefined")Bridge.global.jQuery(i);else if(typeof Bridge.global.document=="undefined"||Bridge.global.document.readyState==="complete"||Bridge.global.document.readyState==="loaded")i();else Bridge.on("DOMContentLoaded",Bridge.global.document,i)},on:function(n,t,i,r){var u=function(n){var t=i.apply(r||this,arguments);return t===!1&&(n.stopPropagation(),n.preventDefault()),t},f=function(){var n=i.call(r||t,Bridge.global.event);return n===!1&&(Bridge.global.event.returnValue=!1,Bridge.global.event.cancelBubble=!0),n};t.addEventListener?t.addEventListener(n,u,!1):t.attachEvent("on"+n,f)},addHash:function(n,t,i){if(isNaN(t)&&(t=17),isNaN(i)&&(i=23),Bridge.isArray(n)){for(var r=0;r<n.length;r++)t=t+((t*i|0)+(n[r]==null?0:Bridge.getHashCode(n[r])))|0;return t}return t+((t*i|0)+(n==null?0:Bridge.getHashCode(n)))|0},getHashCode:function(n,t,i){var o,u,f,r,s,e;if(Bridge.isEmpty(n,!0)){if(t)return 0;throw new System.InvalidOperationException("HashCode cannot be calculated for empty value");}if(i!==!1&&n.hasOwnProperty("item1")&&Bridge.isPlainObject(n)&&(i=!0),n.getHashCode&&Bridge.isFunction(n.getHashCode)&&!n.__insideHashCode&&n.getHashCode.length===0)return n.__insideHashCode=!0,o=n.getHashCode(),delete n.__insideHashCode,o;if(Bridge.isBoolean(n))return n?1:0;if(Bridge.isDate(n))return n.valueOf()&4294967295;if(n===Number.POSITIVE_INFINITY)return 2146435072;if(n===Number.NEGATIVE_INFINITY)return 4293918720;if(Bridge.isNumber(n)){if(Math.floor(n)===n)return n;n=n.toExponential()}if(Bridge.isString(n)){for(u=0,f=0;f<n.length;f++)u=(u<<5)-u+n.charCodeAt(f)&4294967295;return u}if(n.$$hashCode)return n.$$hashCode;if(i&&typeof n=="object"){r=0;for(e in n)n.hasOwnProperty(e)&&(s=Bridge.isEmpty(n[e],!0)?0:Bridge.getHashCode(n[e]),r=29*r+s);if(r!==0)return n.$$hashCode=r,r}return n.$$hashCode=Math.random()*4294967296|0,n.$$hashCode},getDefaultValue:function(n){return n.getDefaultValue&&n.getDefaultValue.length===0?n.getDefaultValue():n===Boolean?!1:n===Date?new Date(-864e13):n===Number?0:null},getTypeAlias:function(n){var t=n.$$name||Bridge.getTypeName(n);return t.replace(/[\.\(\)\,]/g,"$")},getTypeName:function(n){return Bridge.Reflection.getTypeFullName(n)},hasValue:function(n){return n!=null},hasValue$1:function(){if(arguments.length===0)return!1;var n=0;for(n;n<arguments.length;n++)if(arguments[n]==null)return!1;return!0},is:function(n,t,i,r){var u,e,o,s,f;if(n==null)return!!r;if(u=n.constructor,t.constructor===Function&&n instanceof t||u===t)return!0;if(e=u.$kind||u.$$inherits,o=t.$kind,e||o){if(s=t.$isInterface,s){if(e)return u.$isArrayEnumerator?System.Array.is(n,t):t.isAssignableFrom?t.isAssignableFrom(u):Bridge.Reflection.getInterfaces(u).indexOf(t)>=0;if(Bridge.isArray(n,u))return System.Array.is(n,t);if(u===String)return System.String.is(n,t)}return i!==!0&&t.$is?t.$is(n):t.$literal&&Bridge.isPlainObject(n)?n.$getType?Bridge.Reflection.isAssignableFrom(t,n.$getType()):!0:!1}if(f=typeof t,f==="boolean")return t;if(f==="string"&&(t=Bridge.unroll(t)),f==="function"&&Bridge.getType(n).prototype instanceof t)return!0;if(i!==!0){if(typeof t.$is=="function")return t.$is(n);if(typeof t.isAssignableFrom=="function")return t.isAssignableFrom(Bridge.getType(n))}return Bridge.isArray(n)?System.Array.is(n,t):f==="object"&&(u===t||n instanceof t)},as:function(n,t,i){return Bridge.is(n,t,!1,i)?n:null},cast:function(n,t,i){if(n==null)return n;var r=Bridge.is(n,t,!1,i)?n:null;if(r===null)throw new System.InvalidCastException("Unable to cast type "+(n?Bridge.getTypeName(n):"'null'")+" to type "+Bridge.getTypeName(t));return r},apply:function(n,t){for(var u=Bridge.getPropertyNames(t,!0),i,r=0;r<u.length;r++)i=u[r],typeof n[i]=="function"&&typeof t[i]!="function"?n[i](t[i]):n[i]=t[i];return n},merge:function(n,t,i,r){var u,o,f,h,c,e,s;if(n instanceof System.Decimal&&Bridge.isNumber(t))return new System.Decimal(t);if(n instanceof System.Int64&&Bridge.isNumber(t))return new System.Int64(t);if(n instanceof System.UInt64&&Bridge.isNumber(t))return new System.UInt64(t);if(n instanceof Boolean||Bridge.isBoolean(n)||n instanceof Number||Bridge.isNumber(n)||n instanceof String||Bridge.isString(n)||n instanceof Function||Bridge.isFunction(n)||n instanceof Date||Bridge.isDate(n)||Bridge.isNumber(n)||n instanceof System.Double||n instanceof System.Single||n instanceof System.Byte||n instanceof System.SByte||n instanceof System.Int16||n instanceof System.UInt16||n instanceof System.Int32||n instanceof System.UInt32||n instanceof Bridge.Int||n instanceof System.Decimal)return t;if(Bridge.isArray(t)&&Bridge.isFunction(n.add||n.push))for(c=Bridge.isArray(n)?n.push:n.add,o=0;o<t.length;o++)e=t[o],Bridge.isArray(e)||(e=[typeof r=="undefined"?e:Bridge.merge(r(),e)]),c.apply(n,e);else for(u in t)f=t[u],typeof n[u]=="function"?u.match(/^\s*get[A-Z]/)?Bridge.merge(n[u](),f):n[u](f):(s="set"+u.charAt(0).toUpperCase()+u.slice(1),typeof n[s]=="function"&&typeof f!="function"?n[s](f):f&&f.constructor===Object&&n[u]?(h=n[u],Bridge.merge(h,f)):n[u]=f);return i&&i.call(n,n),n},getEnumerator:function(n,t,i){if(typeof n=="string"&&(n=System.String.toCharArray(n)),arguments.length===2&&Bridge.isFunction(t)&&(i=t,t=null),t&&n&&n[t])return n[t].call(n);if(!i&&n&&n.getEnumerator)return n.getEnumerator();var r;if(i&&Bridge.isFunction(n[r="System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(i)+"$getEnumerator"])||Bridge.isFunction(n[r="System$Collections$IEnumerable$getEnumerator"]))return n[r]();if(i&&n&&n.getEnumerator)return n.getEnumerator();if(Object.prototype.toString.call(n)==="[object Array]"||n&&Bridge.isDefined(n.length))return new Bridge.ArrayEnumerator(n,i);throw new System.InvalidOperationException("Cannot create enumerator");},getPropertyNames:function(n,t){var i=[];for(var r in n)(t||typeof n[r]!="function")&&i.push(r);return i},isDefined:function(n,t){return typeof n!="undefined"&&(t?n!==null:!0)},isEmpty:function(n,t){return typeof n=="undefined"||n===null||(t?!1:n==="")||(!t&&Bridge.isArray(n)?n.length===0:!1)},toArray:function(n){var t,r,u,i=[];if(Bridge.isArray(n))for(t=0,u=n.length;t<u;++t)i.push(n[t]);else for(t=Bridge.getEnumerator(n);t.moveNext();)r=t.getCurrent(),i.push(r);return i},toList:function(n,t){return new(System.Collections.Generic.List$1(t||Object))(n)},arrayTypes:[n.Array,n.Uint8Array,n.Int8Array,n.Int16Array,n.Uint16Array,n.Int32Array,n.Uint32Array,n.Float32Array,n.Float64Array,n.Uint8ClampedArray],isArray:function(n,t){var i=t||(n!=null?n.constructor:null);return i?Bridge.arrayTypes.indexOf(i)>=0:!1},isFunction:function(n){return typeof n=="function"},isDate:function(n){return Object.prototype.toString.call(n)==="[object Date]"},isNull:function(n){return n===null||n===undefined},isBoolean:function(n){return typeof n=="boolean"},isNumber:function(n){return typeof n=="number"&&isFinite(n)},isString:function(n){return typeof n=="string"},unroll:function(n){var r=n.split("."),t=Bridge.global[r[0]],i=1;for(i;i<r.length;i++){if(!t)return null;t=t[r[i]]}return t},referenceEquals:function(n,t){return Bridge.hasValue(n)?n===t:!Bridge.hasValue(t)},staticEquals:function(n,t){return Bridge.hasValue(n)?Bridge.hasValue(t)?Bridge.equals(n,t):!1:!Bridge.hasValue(t)},equals:function(n,t){if(n==null&&t==null)return!0;if(n&&Bridge.isFunction(n.equals)&&n.equals.length===1)return n.equals(t);if(t&&Bridge.isFunction(t.equals)&&t.equals.length===1)return t.equals(n);if(Bridge.isDate(n)&&Bridge.isDate(t))return n.valueOf()===t.valueOf();if(Bridge.isNull(n)&&Bridge.isNull(t))return!0;if(Bridge.isNull(n)!==Bridge.isNull(t))return!1;var i=n===t;return!i&&typeof n=="object"&&typeof t=="object"&&n!==null&&t!==null&&n.$kind==="struct"&&t.$kind==="struct"&&n.$$name===t.$$name?Bridge.getHashCode(n)===Bridge.getHashCode(t)&&Bridge.objectEquals(n,t):!i&&n&&t&&n.hasOwnProperty("item1")&&Bridge.isPlainObject(n)&&t.hasOwnProperty("item1")&&Bridge.isPlainObject(t)?Bridge.objectEquals(n,t):i},objectEquals:function(n,t){Bridge.$$leftChain=[];Bridge.$$rightChain=[];var i=Bridge.deepEquals(n,t);return delete Bridge.$$leftChain,delete Bridge.$$rightChain,i},deepEquals:function(n,t){if(typeof n=="object"&&typeof t=="object"){if(n===t)return!0;if(Bridge.$$leftChain.indexOf(n)>-1||Bridge.$$rightChain.indexOf(t)>-1)return!1;for(var i in t)if(t.hasOwnProperty(i)!==n.hasOwnProperty(i)||typeof t[i]!=typeof n[i])return!1;for(i in n){if(t.hasOwnProperty(i)!==n.hasOwnProperty(i)||typeof n[i]!=typeof t[i])return!1;if(n[i]===t[i])continue;else if(typeof n[i]=="object"){if(Bridge.$$leftChain.push(n),Bridge.$$rightChain.push(t),!Bridge.deepEquals(n[i],t[i]))return!1;Bridge.$$leftChain.pop();Bridge.$$rightChain.pop()}else if(!Bridge.equals(n[i],t[i]))return!1}return!0}return Bridge.equals(n,t)},compare:function(n,t,i,r){if(Bridge.isDefined(n,!0)){if(Bridge.isNumber(n)||Bridge.isString(n)||Bridge.isBoolean(n))return Bridge.isString(n)&&!Bridge.hasValue(t)?1:n<t?-1:n>t?1:0;if(Bridge.isDate(n))return Bridge.compare(n.valueOf(),t.valueOf())}else{if(i)return 0;throw new System.NullReferenceException;}var u;if(r&&Bridge.isFunction(n[u="System$IComparable$1$"+Bridge.getTypeAlias(r)+"$compareTo"])||Bridge.isFunction(n[u="System$IComparable$compareTo"]))return n[u](t);if(Bridge.isFunction(n.compareTo))return n.compareTo(t);if(r&&Bridge.isFunction(t[u="System$IComparable$1$"+Bridge.getTypeAlias(r)+"$compareTo"])||Bridge.isFunction(t[u="System$IComparable$compareTo"]))return-t[u](n);if(Bridge.isFunction(t.compareTo))return-t.compareTo(n);if(i)return 0;throw new System.Exception("Cannot compare items");},equalsT:function(n,t,i){if(Bridge.isDefined(n,!0)){if(Bridge.isNumber(n)||Bridge.isString(n)||Bridge.isBoolean(n))return n===t;if(Bridge.isDate(n))return n.valueOf()===t.valueOf()}else throw new System.NullReferenceException;var r;return i&&n!=null&&Bridge.isFunction(n[r="System$IEquatable$1$"+Bridge.getTypeAlias(i)+"$equalsT"])?n[r](t):i&&t!=null&&Bridge.isFunction(t[r="System$IEquatable$1$"+Bridge.getTypeAlias(i)+"$equalsT"])?t[r](n):n.equalsT?n.equalsT(t):t.equalsT(n)},format:function(n,t,i){if(Bridge.isNumber(n))return Bridge.Int.format(n,t,i);if(Bridge.isDate(n))return Bridge.Date.format(n,t,i);var r;return Bridge.isFunction(n[r="System$IFormattable$format"])?n[r](t,i):n.format(t,i)},getType:function(n){if(n==null)throw new System.NullReferenceException("instance is null");if(typeof n=="number")return!isNaN(n)&&isFinite(n)&&Math.floor(n,0)===n?System.Int32:System.Double;if(n.$getType)return n.$getType();try{return n.constructor}catch(t){return Object}},isLower:function(n){var t=String.fromCharCode(n);return t===t.toLowerCase()&&t!==t.toUpperCase()},isUpper:function(n){var t=String.fromCharCode(n);return t!==t.toLowerCase()&&t===t.toUpperCase()},coalesce:function(n,t){return Bridge.hasValue(n)?n:t},fn:{equals:function(n){return this===n?!0:n==null||this.constructor!==n.constructor?!1:this.equals===n.equals&&this.$method===n.$method&&this.$scope===n.$scope},call:function(n,t){var i=Array.prototype.slice.call(arguments,2);return n=n||Bridge.global,n[t].apply(n,i)},makeFn:function(n,t){switch(t){case 0:return function(){return n.apply(this,arguments)};case 1:return function(){return n.apply(this,arguments)};case 2:return function(){return n.apply(this,arguments)};case 3:return function(){return n.apply(this,arguments)};case 4:return function(){return n.apply(this,arguments)};case 5:return function(){return n.apply(this,arguments)};case 6:return function(){return n.apply(this,arguments)};case 7:return function(){return n.apply(this,arguments)};case 8:return function(){return n.apply(this,arguments)};case 9:return function(){return n.apply(this,arguments)};case 10:return function(){return n.apply(this,arguments)};case 11:return function(){return n.apply(this,arguments)};case 12:return function(){return n.apply(this,arguments)};case 13:return function(){return n.apply(this,arguments)};case 14:return function(){return n.apply(this,arguments)};case 15:return function(){return n.apply(this,arguments)};case 16:return function(){return n.apply(this,arguments)};case 17:return function(){return n.apply(this,arguments)};case 18:return function(){return n.apply(this,arguments)};case 19:return function(){return n.apply(this,arguments)};default:return function(){return n.apply(this,arguments)}}},bind:function(n,t,i,r){var f,u;if(t&&t.$method===t&&t.$scope===n)return t;if(n&&n.$$bind)for(f=0;f<n.$$bind.length;f++)if(n.$$bind[f].$method===t)return n.$$bind[f];return u=arguments.length===2?Bridge.fn.makeFn(function(){Bridge.caller.unshift(this);var i=t.apply(n,arguments);return Bridge.caller.shift(this),i},t.length):Bridge.fn.makeFn(function(){var u=i||arguments,f;return r===!0?(u=Array.prototype.slice.call(arguments,0),u=u.concat(i)):typeof r=="number"&&(u=Array.prototype.slice.call(arguments,0),r===0?u.unshift.apply(u,i):r<u.length?u.splice.apply(u,[r,0].concat(i)):u.push.apply(u,i)),Bridge.caller.unshift(this),f=t.apply(n,u),Bridge.caller.shift(this),f},t.length),n&&(n.$$bind=n.$$bind||[],n.$$bind.push(u)),u.$method=t,u.$scope=n,u.equals=Bridge.fn.equals,u},bindScope:function(n,t){var i=Bridge.fn.makeFn(function(){var i=Array.prototype.slice.call(arguments,0),r;return i.unshift.apply(i,[n]),Bridge.caller.unshift(this),r=t.apply(n,i),Bridge.caller.shift(this),r},t.length);return i.$method=t,i.$scope=n,i.equals=Bridge.fn.equals,i},$build:function(n){var t=function(){for(var i=t.$invocationList,r=null,u,n=0;n<i.length;n++)u=i[n],r=u.apply(null,arguments);return r};return(t.$invocationList=n?Array.prototype.slice.call(n,0):[],t.$invocationList.length===0)?null:t},combine:function(n,t){if(!n||!t)return n||t;var i=n.$invocationList?n.$invocationList:[n],r=t.$invocationList?t.$invocationList:[t];return Bridge.fn.$build(i.concat(r))},getInvocationList:function(){},remove:function(n,t){if(!n||!t)return n||null;for(var r=n.$invocationList?n.$invocationList:[n],f=t.$invocationList?t.$invocationList:[t],e=[],o,u,i=r.length-1;i>=0;i--){for(o=!1,u=0;u<f.length;u++)if(r[i]===f[u]||r[i].$method&&r[i].$method===f[u].$method&&r[i].$scope&&r[i].$scope===f[u].$scope){o=!0;break}o||e.push(r[i])}return e.reverse(),Bridge.fn.$build(e)}},sleep:function(n,t){if(Bridge.hasValue(t)&&(n=t.getTotalMilliseconds()),isNaN(n)||n<-1||n>2147483647)throw new System.ArgumentOutOfRangeException("timeout","Number must be either non-negative and less than or equal to Int32.MaxValue or -1");n==-1&&(n=2147483647);for(var i=(new Date).getTime();(new Date).getTime()-i<n;)if((new Date).getTime()-i>2147483647)break},getMetadata:function(n){return n.$getMetadata?n.$getMetadata():n.$metadata}},nt,s,at,o,vt,yt,pt,k,wt,t;n.Bridge=bt;n.Bridge.caller=[];n.System={};n.System.Diagnostics={};n.System.Diagnostics.Contracts={};n.System.Threading={};nt={is:function(n,t){return Bridge.isString(n)?n.constructor===t||n instanceof t?!0:t===System.ICloneable||t===System.Collections.IEnumerable||t===System.Collections.Generic.IEnumerable$1(System.Char)||t===System.IComparable$1(String)||t===System.IEquatable$1(String)?!0:!1:!1},lastIndexOf:function(n,t,i,r){var u=n.lastIndexOf(t,i);return u<i-r+1?-1:u},lastIndexOfAny:function(n,t,i,r){var e=n.length,f,u;if(!e)return-1;for(t=String.fromCharCode.apply(null,t),i=i||e-1,r=r||e,f=i-r+1,f<0&&(f=0),u=i;u>=f;u--)if(t.indexOf(n.charAt(u))>=0)return u;return-1},isNullOrWhiteSpace:function(n){return n?System.Char.isWhiteSpace(n):!0},isNullOrEmpty:function(n){return!n},fromCharCount:function(n,t){if(t>=0)return String(Array(t+1).join(String.fromCharCode(n)));throw new System.ArgumentOutOfRangeException("count","cannot be less than zero");},format:function(n){return System.String._format(System.Globalization.CultureInfo.getCurrentCulture(),n,Array.prototype.slice.call(arguments,1))},formatProvider:function(n,t){return System.String._format(n,t,Array.prototype.slice.call(arguments,2))},_format:function(n,t,i){var u=this,f=i,r=this.decodeBraceSequence;return t.replace(/(\{+)((\d+|[a-zA-Z_$]\w+(?:\.[a-zA-Z_$]\w+|\[\d+\])*)(?:\,(-?\d*))?(?:\:([^\}]*))?)(\}+)|(\{+)|(\}+)/g,function(t,i,e,o,s,h,c,l,a){return l?r(l):a?r(a):i.length%2==0||c.length%2==0?r(i)+e+r(c):r(i,!0)+u.handleElement(n,o,s,h,f)+r(c,!0)})},handleElement:function(n,t,i,r,u){var f;if(t=parseInt(t,10),t>u.length-1)throw new System.FormatException("Input string was not in a correct format.");return f=u[t],f==null&&(f=""),f=r&&Bridge.is(f,System.IFormattable)?Bridge.format(f,r,n):""+f,i&&(i=parseInt(i,10),Bridge.isNumber(i)||(i=null)),System.String.alignString(f.toString(),i)},decodeBraceSequence:function(n,t){return n.substr(0,(n.length+(t?0:1))/2)},alignString:function(n,t,i,r,u){if(!n||!t)return n;if(i||(i=" "),Bridge.isNumber(i)&&(i=String.fromCharCode(i)),r||(r=t<0?1:2),t=Math.abs(t),u&&n.length>t&&(n=n.substring(0,t)),t+1>=n.length)switch(r){case 2:n=Array(t+1-n.length).join(i)+n;break;case 3:var f=t-n.length,e=Math.ceil(f/2),o=f-e;n=Array(o+1).join(i)+n+Array(e+1).join(i);break;case 1:default:n=n+Array(t+1-n.length).join(i)}return n},startsWith:function(n,t){return t.length?t.length>n.length?!1:(t=System.String.escape(t),n.match("^"+t)!==null):!0},endsWith:function(n,t){return t.length?t.length>n.length?!1:(t=System.String.escape(t),n.match(t+"$")!==null):!0},contains:function(n,t){if(t==null)throw new System.ArgumentNullException;return n==null?!1:n.indexOf(t)>-1},indexOfAny:function(n,t){var i,r,e,u,o,f;if(t==null)throw new System.ArgumentNullException;if(n==null||n==="")return-1;if(i=arguments.length>2?arguments[2]:0,i<0)throw new System.ArgumentOutOfRangeException("startIndex","startIndex cannot be less than zero");if(r=arguments.length>3?arguments[3]:n.length-i,r<0)throw new System.ArgumentOutOfRangeException("length","must be non-negative");if(r>n.length-i)throw new System.ArgumentOutOfRangeException("Index and length must refer to a location within the string");for(e=n.substr(i,r),u=0;u<t.length;u++)if(o=String.fromCharCode(t[u]),f=e.indexOf(o),f>-1)return f+i;return-1},indexOf:function(n,t){var i,u,f,r;if(t==null)throw new System.ArgumentNullException;if(n==null||n==="")return-1;if(i=arguments.length>2?arguments[2]:0,i<0||i>n.length)throw new System.ArgumentOutOfRangeException("startIndex","startIndex cannot be less than zero and must refer to a location within the string");if(t==="")return arguments.length>2?i:0;if(u=arguments.length>3?arguments[3]:n.length-i,u<0)throw new System.ArgumentOutOfRangeException("length","must be non-negative");if(u>n.length-i)throw new System.ArgumentOutOfRangeException("Index and length must refer to a location within the string");return(f=n.substr(i,u),r=arguments.length===5&&arguments[4]%2!=0?f.toLocaleUpperCase().indexOf(t.toLocaleUpperCase()):f.indexOf(t),r>-1)?arguments.length===5?System.String.compare(t,f.substr(r,t.length),arguments[4])===0?r+i:-1:r+i:-1},equals:function(){return System.String.compare.apply(this,arguments)===0},compare:function(n,t){if(n==null)return t==null?0:-1;if(t==null)return 1;if(arguments.length>=3)if(Bridge.isBoolean(arguments[2])){if(arguments[2]&&(n=n.toLocaleUpperCase(),t=t.toLocaleUpperCase()),arguments.length===4)return n.localeCompare(t,arguments[3].name)}else switch(arguments[2]){case 1:return n.localeCompare(t,System.Globalization.CultureInfo.getCurrentCulture().name,{sensitivity:"accent"});case 2:return n.localeCompare(t,System.Globalization.CultureInfo.invariantCulture.name);case 3:return n.localeCompare(t,System.Globalization.CultureInfo.invariantCulture.name,{sensitivity:"accent"});case 4:return n===t?0:n>t?1:-1;case 5:return n.toUpperCase()===t.toUpperCase()?0:n.toUpperCase()>t.toUpperCase()?1:-1}return n.localeCompare(t)},toCharArray:function(n,t,i){var u,r;if(t<0||t>n.length||t>n.length-i)throw new System.ArgumentOutOfRangeException("startIndex","startIndex cannot be less than zero and must refer to a location within the string");if(i<0)throw new System.ArgumentOutOfRangeException("length","must be non-negative");for(Bridge.hasValue(t)||(t=0),Bridge.hasValue(i)||(i=n.length),u=[],r=t;r<t+i;r++)u.push(n.charCodeAt(r));return u},escape:function(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},replaceAll:function(n,t,i){var r=new RegExp(System.String.escape(t),"g");return n.replace(r,i)},insert:function(n,t,i){return n>0?t.substring(0,n)+i+t.substring(n,t.length):i+t},remove:function(n,t,i){if(n==null)throw new System.NullReferenceException;if(t<0)throw new System.ArgumentOutOfRangeException("startIndex","StartIndex cannot be less than zero");if(i!=null){if(i<0)throw new System.ArgumentOutOfRangeException("count","Count cannot be less than zero");if(i>n.length-t)throw new System.ArgumentOutOfRangeException("count","Index and count must refer to a location within the string");}else if(t>=n.length)throw new System.ArgumentOutOfRangeException("startIndex","startIndex must be less than length of string");return i==null||t+i>n.length?n.substr(0,t):n.substr(0,t)+n.substr(t+i)},split:function(n,t,i,r){for(var o=!Bridge.hasValue(t)||t.length===0?new RegExp("\\s","g"):new RegExp(t.map(System.String.escape).join("|"),"g"),f=[],e,u=0;;u=o.lastIndex)if(e=o.exec(n)){if(r!==1||e.index>u){if(f.length===i-1)return f.push(n.substr(u)),f;f.push(n.substring(u,e.index))}}else return(r!==1||u!==n.length)&&f.push(n.substr(u)),f},trimEnd:function(n,t){return n.replace(t?new RegExp("["+System.String.escape(String.fromCharCode.apply(null,t))+"]+$"):/\s*$/,"")},trimStart:function(n,t){return n.replace(t?new RegExp("^["+System.String.escape(String.fromCharCode.apply(null,t))+"]+"):/^\s*/,"")},trim:function(n,t){return System.String.trimStart(System.String.trimEnd(n,t),t)},concat:function(){for(var t,i="",n=0;n<arguments.length;n++)t=arguments[n],i+=t==null?"":t;return i}};System.String=nt;s={nameEquals:function(n,t,i){return i?n.toLowerCase()===t.toLowerCase():n.charAt(0).toLowerCase()+n.slice(1)===t.charAt(0).toLowerCase()+t.slice(1)},checkEnumType:function(n){if(!n)throw new System.ArgumentNullException("enumType");if(n.prototype&&n.$kind!=="enum")throw new System.ArgumentException("","enumType");},toName:function(n){return n},parse:function(n,t,i,r){var o,f,e,v,h,u;if(System.Enum.checkEnumType(n),o={},System.Int32.tryParse(t,o))return o.v;if(f=n,n.prototype&&n.prototype.$flags){var c=t.split(","),l=0,a=!0;for(e=c.length-1;e>=0;e--){v=c[e].trim();h=!1;for(u in f)if(s.nameEquals(u,v,i)){l|=f[u];h=!0;break}if(!h){a=!1;break}}if(a)return l}else for(u in f)if(s.nameEquals(u,t,i))return f[u];if(r!==!0)throw new System.ArgumentException("Invalid Enumeration Value");return null},toString:function(n,t,i){var u,e,f,r;if(n===Number)return t.toString();if(System.Enum.checkEnumType(n),u=n,e=System.Int64.is64Bit(t),(n.prototype&&n.prototype.$flags||i===!0)&&t!==0){f=[];for(r in u)(e&&System.Int64.is64Bit(u[r])?!u[r].and(t).isZero():u[r]&t)&&f.push(s.toName(r));return f.length?f.join(", "):t.toString()}for(r in u)if(e&&System.Int64.is64Bit(u[r])?u[r].eq(t):u[r]===t)return s.toName(r);return t.toString()},getValues:function(n){var r,t,i;System.Enum.checkEnumType(n);r=[];t=n;for(i in t)t.hasOwnProperty(i)&&i.indexOf("$")<0&&typeof t[i]!="function"&&r.push(t[i]);return r},format:function(n,t,i){System.Enum.checkEnumType(n);var r;if(!Bridge.hasValue(t)&&(r="value")||!Bridge.hasValue(i)&&(r="format"))throw new System.ArgumentNullException(r);switch(i){case"G":case"g":return System.Enum.toString(n,t);case"x":case"X":return t.toString(16);case"d":case"D":return t.toString();case"f":case"F":return System.Enum.toString(n,t,!0);default:throw new System.FormatException;}},getNames:function(n){var r,i,t;System.Enum.checkEnumType(n);r=[];i=n;for(t in i)i.hasOwnProperty(t)&&t.indexOf("$")<0&&typeof i[t]!="function"&&r.push(s.toName(t));return r},getName:function(n,t){var r,i;System.Enum.checkEnumType(n);r=n;for(i in r)if(r[i]===t)return i.charAt(0).toUpperCase()+i.slice(1);return null},hasFlag:function(n,t){return!!(n&t)},isDefined:function(n,t){var i,u,r;System.Enum.checkEnumType(n);i=n;u=Bridge.isString(t);for(r in i)if(u?s.nameEquals(r,t,!1):i[r]===t)return!0;return!1},tryParse:function(n,t,i,r){return(i.v=0,i.v=s.parse(n,t,r,!0),i.v==null)?!1:!0}};System.Enum=s;var i=function(n){return n.test(navigator.userAgent.toLowerCase())},tt=Bridge.global.document&&Bridge.global.document.compatMode==="CSS1Compat",v=function(n,t){var i;return n&&(i=t.exec(navigator.userAgent.toLowerCase()))?parseFloat(i[1]):0},r=Bridge.global.document?Bridge.global.document.documentMode:null,p=i(/opera/),kt=p&&i(/version\/10\.5/),it=i(/\bchrome\b/),d=i(/webkit/),c=!it&&i(/safari/),dt=c&&i(/applewebkit\/4/),gt=c&&i(/version\/3/),ni=c&&i(/version\/4/),ti=c&&i(/version\/5\.0/),ii=c&&i(/version\/5/),u=!p&&(i(/msie/)||i(/trident/)),e=u&&(i(/msie 7/)&&r!==8&&r!==9&&r!==10||r===7),h=u&&(i(/msie 8/)&&r!==7&&r!==9&&r!==10||r===8),l=u&&(i(/msie 9/)&&r!==7&&r!==8&&r!==10||r===9),w=u&&(i(/msie 10/)&&r!==7&&r!==8&&r!==9||r===10),rt=u&&(i(/trident\/7\.0/)&&r!==7&&r!==8&&r!==9&&r!==10||r===11),f=u&&i(/msie 6/),y=!d&&!u&&i(/gecko/),b=y&&i(/rv:1\.9/),ri=y&&i(/rv:2\.0/),ui=y&&i(/rv:5\./),fi=y&&i(/rv:10\./),ei=b&&i(/rv:1\.9\.0/),oi=b&&i(/rv:1\.9\.1/),si=b&&i(/rv:1\.9\.2/),ut=i(/windows|win32/),ft=i(/macintosh|mac os x/),et=i(/linux/),hi=v(!0,/\bchrome\/(\d+\.\d+)/),a=v(!0,/\bfirefox\/(\d+\.\d+)/),ci=v(u,/msie (\d+\.\d+)/),li=v(p,/version\/(\d+\.\d+)/),ai=v(c,/version\/(\d+\.\d+)/),vi=v(d,/webkit\/(\d+\.\d+)/),yi=Bridge.global.location?/^https/i.test(Bridge.global.location.protocol):!1,ot=/iPhone/i.test(navigator.platform),st=/iPod/i.test(navigator.platform),g=/iPad/i.test(navigator.userAgent),pi=/Blackberry/i.test(navigator.userAgent),ht=/Android/i.test(navigator.userAgent),ct=ft||ut||et&&!ht,lt=g,wi=!ct&&!lt,bi={isStrict:tt,isIEQuirks:u&&!tt&&(f||e||h||l),isOpera:p,isOpera10_5:kt,isWebKit:d,isChrome:it,isSafari:c,isSafari3:gt,isSafari4:ni,isSafari5:ii,isSafari5_0:ti,isSafari2:dt,isIE:u,isIE6:f,isIE7:e,isIE7m:f||e,isIE7p:u&&!f,isIE8:h,isIE8m:f||e||h,isIE8p:u&&!(f||e),isIE9:l,isIE9m:f||e||h||l,isIE9p:u&&!(f||e||h),isIE10:w,isIE10m:f||e||h||l||w,isIE10p:u&&!(f||e||h||l),isIE11:rt,isIE11m:f||e||h||l||w||rt,isIE11p:u&&!(f||e||h||l||w),isGecko:y,isGecko3:b,isGecko4:ri,isGecko5:ui,isGecko10:fi,isFF3_0:ei,isFF3_5:oi,isFF3_6:si,isFF4:4<=a&&a<5,isFF5:5<=a&&a<6,isFF10:10<=a&&a<11,isLinux:et,isWindows:ut,isMac:ft,chromeVersion:hi,firefoxVersion:a,ieVersion:ci,operaVersion:li,safariVersion:ai,webKitVersion:vi,isSecure:yi,isiPhone:ot,isiPod:st,isiPad:g,isBlackberry:pi,isAndroid:ht,isDesktop:ct,isTablet:lt,isPhone:wi,iOS:ot||g||st,standalone:Bridge.global.navigator?!!Bridge.global.navigator.standalone:!1};Bridge.Browser=bi;at={_initialize:function(){this.$initialized||(this.$initialized=Bridge.emptyFn,this.$staticInit&&this.$staticInit(),this.$initMembers&&this.$initMembers())},initConfig:function(n,t,i,r,u,f){var s,e,o,h;if(i.fields)for(e in i.fields)u[e]=i.fields[e];if(i.properties)for(e in i.properties)Bridge.property(u,e,i.properties[e],r);if(i.events)for(e in i.events)Bridge.event(u,e,i.events[e],r);if(i.alias)for(o=0;o<i.alias.length;o++)h=u[i.alias[o]],h===undefined&&f&&(h=f[i.alias[o]]),u[i.alias[o+1]]=h,o++;i.init&&(s=i.init);(s||n&&!r&&t.$initMembers)&&(u.$initMembers=function(){n&&!r&&t.$initMembers&&t.$initMembers.call(this);s&&s.call(this)})},definei:function(n,t,i){(i===!0||!i)&&t?t.$kind="interface":i?i.$kind="interface":t={$kind:"interface"};var r=Bridge.define(n,t,i);return r.$kind="interface",r.$isInterface=!0,r},define:function(n,t,i,r){var l=!1,c,u,ft,nt,p,w,tt,b,k,d,st,it,rt,ut;if(i===!0?(l=!0,i=t,t=Bridge.global):i||(i=t,t=Bridge.global),Bridge.isFunction(i))return c=function(){var t,r,f,u;return(r=Bridge.Class.getCachedType(c,arguments),r)?r.type:(t=Array.prototype.slice.call(arguments),f=i.apply(null,t),u=Bridge.define(Bridge.Class.genericName(n,t),f,!0,{fn:c,args:t}),Bridge.Class.staticInitAllow||Bridge.Class.$queue.push(u),Bridge.get(u))},c.$cache=[],Bridge.Class.generic(n,t,c,i.length);l||(Bridge.Class.staticInitAllow=!1);i=i||{};var f=i.$inherits||i.inherits,o=i.$statics||i.statics,et=i.$entryPoint,a,h,v=i.$scope||t||Bridge.global,s,ot,g,y,e;if(i.$kind=i.$kind||"class",i.$inherits?delete i.$inherits:delete i.inherits,et&&delete i.$entryPoint,Bridge.isFunction(o)?o=null:i.$statics?delete i.$statics:delete i.statics,ft=i.hasOwnProperty("ctor")&&i.ctor,ft?u=ft:(u=i.$literal?function(n){return n=n||{},n.$getType=function(){return u},n}:function(){this.$initialize();u.$base&&(u.$$inherits&&u.$$inherits.length>0&&u.$$inherits[0].$staticInit&&u.$$inherits[0].$staticInit(),u.$base.ctor.call(this))},i.ctor=u),i.$literal&&(o&&o.getDefaultValue||(u.getDefaultValue=function(){var n={};return n.$getType=function(){return u},n}),u.$literal=!0,delete i.$literal),l||(v=Bridge.Class.set(v,n,u)),r&&r.fn.$cache.push({type:u,args:r.args}),u.$$name=n,u.$kind=i.$kind,r&&l){for(u.$genericTypeDefinition=r.fn,u.$typeArguments=r.args,u.$assembly=r.fn.$assembly||Bridge.$currentAssembly,nt=Bridge.Reflection.getTypeFullName(r.fn),s=0;s<r.args.length;s++)nt+=(s===0?"[":",")+"["+Bridge.Reflection.getTypeQName(r.args[s])+"]";nt+="]";u.$$fullname=nt}else u.$$fullname=u.$$name;if(f&&Bridge.isFunction(f)&&(f=f()),p=[],w=[],f)for(tt=0;tt<f.length;tt++){if(b=f[tt],k=(b.$interfaces||[]).concat(b.$baseInterfaces||[]),k.length>0)for(d=0;d<k.length;d++)w.indexOf(k[d])<0&&w.push(k[d]);b.$kind==="interface"&&p.push(b)}u.$baseInterfaces=w;u.$interfaces=p;u.$allInterfaces=p.concat(w);st=f?f[0].$kind==="interface":!0;st&&(f=null);a=f?f[0].prototype:this.prototype;u.$base=a;h=f?f[0].$$initCtor?new f[0].$$initCtor:new f[0]:{};u.$$initCtor=function(){};u.$$initCtor.prototype=h;u.$$initCtor.prototype.constructor=u;u.$$initCtor.prototype.$$fullname=r&&l?u.$$fullname:u.$$name;o&&(it=o.$config||o.config,it&&!Bridge.isFunction(it)&&(Bridge.Class.initConfig(f,a,it,!0,u),o.$config?delete o.$config:delete o.config));rt=i.$config||i.config;rt&&!Bridge.isFunction(rt)?(Bridge.Class.initConfig(f,a,rt,!1,i,h),i.$config?delete i.$config:delete i.config):f&&a.$initMembers&&(i.$initMembers=function(){a.$initMembers.call(this)});i.$initialize=Bridge.Class._initialize;ut=[];for(e in i)ut.push(e);for(s=0;s<ut.length;s++)e=ut[s],ot=i[e],g=e==="ctor",y=e,Bridge.isFunction(ot)&&(g||e.match("^\\$ctor")!==null)&&(g=!0),g?(u[y]=i[e],u[y].prototype=h,u[y].prototype.constructor=u,h[y]=i[e]):h[y]=i[e];if(h.$$name=n,o)for(e in o)e==="ctor"?u.$ctor=o[e]:u[e]=o[e];for(f||(f=[Object].concat(p)),u.$$inherits=f,s=0;s<f.length;s++)v=f[s],v.$$inheritors||(v.$$inheritors=[]),v.$$inheritors.push(u);return c=function(){Bridge.Class.staticInitAllow&&(u.$staticInit=null,u.$initMembers&&u.$initMembers(),u.$ctor&&u.$ctor())},(et||Bridge.isFunction(h.$main))&&Bridge.Class.$queueEntry.push(u),u.$staticInit=c,l||Bridge.Class.registerType(n,u),Bridge.Reflection&&(u.$getMetadata=Bridge.Reflection.getMetadata),u.$kind==="enum"&&(u.$is=function(n){var t=u.prototype.$utype;return t===System.String?typeof n=="string":t&&t.$is?t.$is(n):typeof n=="number"},u.getDefaultValue=function(){var n=u.prototype.$utype;return n===System.String?null:0}),u.$kind==="interface"&&(u.prototype.$variance&&(u.isAssignableFrom=Bridge.Class.varianceAssignable),u.$isInterface=!0),u},varianceAssignable:function(n){var r=function(n,t){var i;if(t.$genericTypeDefinition===n.$genericTypeDefinition&&t.$typeArguments.length===n.$typeArguments.length){for(i=0;i<n.$typeArguments.length;i++){var f=n.prototype.$variance[i],r=n.$typeArguments[i],u=t.$typeArguments[i];switch(f){case 1:if(!Bridge.Reflection.isAssignableFrom(r,u))return!1;break;case 2:if(!Bridge.Reflection.isAssignableFrom(u,r))return!1;break;default:if(u!==r)return!1}}return!0}return!1},i,t;if(n.$kind==="interface"&&r(this,n))return!0;for(i=Bridge.Reflection.getInterfaces(n),t=0;t<i.length;t++)if(i[t]===this||r(this,i[t]))return!0;return!1},registerType:function(n,t){Bridge.$currentAssembly&&(Bridge.$currentAssembly.$types[n]=t,t.$assembly=Bridge.$currentAssembly)},addExtend:function(n,t){var f,i,r,u;for(Array.prototype.push.apply(n.$$inherits,t),n.$interfaces=n.$interfaces||[],n.$baseInterfaces=n.$baseInterfaces||[],f=0;f<t.length;f++){if(i=t[f],i.$$inheritors||(i.$$inheritors=[]),i.$$inheritors.push(n),r=(i.$interfaces||[]).concat(i.$baseInterfaces||[]),r.length>0)for(u=0;u<r.length;u++)n.$baseInterfaces.indexOf(r[u])<0&&n.$baseInterfaces.push(r[u]);i.$kind==="interface"&&n.$interfaces.push(i)}n.$allInterfaces=n.$interfaces.concat(n.$baseInterfaces)},set:function(n,t,i,r){for(var u=t.split("."),o,h,e,s,f=0;f<u.length-1;f++)typeof n[u[f]]=="undefined"&&(n[u[f]]={}),n=n[u[f]];if(o=u[u.length-1],e=n[o],e){if(e.$$name===t)throw"Class '"+t+"' is already defined";for(h in e)s=e[h],typeof s=="function"&&s.$$name&&function(n,t,i){Object.defineProperty(n,t,{get:function(){return Bridge.Class.staticInitAllow&&(i.$staticInit&&i.$staticInit(),Bridge.Class.defineProperty(n,t,i)),i},set:function(n){i=n},enumerable:!0,configurable:!0})}(i,h,s)}return r!==!0?function(n,t,i){Object.defineProperty(n,t,{get:function(){return Bridge.Class.staticInitAllow&&(i.$staticInit&&i.$staticInit(),Bridge.Class.defineProperty(n,t,i)),i},set:function(n){i=n},enumerable:!0,configurable:!0})}(n,o,i):n[o]=i,n},defineProperty:function(n,t,i){Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0})},genericName:function(n,t){for(var r,u=n,i=0;i<t.length;i++)r=t[i],u+="$"+(r.$$name||Bridge.getTypeName(r));return u},getCachedType:function(n,t){for(var e=n.$cache,o=e.length,i,f,r,u=0;u<o;u++)if(i=e[u],i.args.length===t.length){for(f=!0,r=0;r<i.args.length;r++)if(i.args[r]!==t[r]){f=!1;break}if(f)return i}return null},generic:function(n,t,i,r){return i.$$name=n,i.$kind="class",Bridge.Class.set(t,n,i,!0),Bridge.Class.registerType(n,i),i.$typeArgumentCount=r,i.$isGenericTypeDefinition=!0,i.$getMetadata=Bridge.Reflection.getMetadata,i},init:function(n){var r,i,t;for(Bridge.Class.staticInitAllow=!0,r=Bridge.Class.$queue.concat(Bridge.Class.$queueEntry),i=0;i<r.length;i++)t=r[i],t.$staticInit&&t.$staticInit(),t.prototype.$main&&Bridge.ready(t.prototype.$main);Bridge.Class.$queue.length=0;Bridge.Class.$queueEntry.length=0;n&&n()}};Bridge.Class=at;Bridge.Class.$queue=[];Bridge.Class.$queueEntry=[];Bridge.define=Bridge.Class.define;Bridge.definei=Bridge.Class.definei;Bridge.init=Bridge.Class.init;Bridge.assembly=function(n,t,i){i||(i=t,t={});n=n||"Bridge.$Unknown";var r=System.Reflection.Assembly.assemblies[n];r?Bridge.apply(r.res,t||{}):r=new System.Reflection.Assembly(n,t);Bridge.$currentAssembly=r;i&&i.call(Bridge.global,r,Bridge.global);Bridge.init()};Bridge.define("System.Reflection.Assembly",{statics:{assemblies:{}},ctor:function(n,t){this.$initialize();this.name=n;this.res=t||{};this.$types={};this.$={};System.Reflection.Assembly.assemblies[n]=this},toString:function(){return this.name},getManifestResourceNames:function(){return Object.keys(this.res)},getManifestResourceDataAsBase64:function(n,t){return arguments.length===1&&(t=n,n=null),n&&(t=Bridge.Reflection.getTypeNamespace(n)+"."+t),this.res[t]||null},getManifestResourceData:function(n,t){arguments.length===1&&(t=n,n=null);n&&(t=Bridge.Reflection.getTypeNamespace(n)+"."+t);var i=this.res[t];return i?System.Convert.fromBase64String(i):null},getCustomAttributes:function(n){return n&&!Bridge.isBoolean(n)?this.attr.filter(function(t){return Bridge.is(t,n)}):this.attr}});Bridge.$currentAssembly=new System.Reflection.Assembly("mscorlib");Bridge.SystemAssembly=Bridge.$currentAssembly;Bridge.SystemAssembly.$types["System.Reflection.Assembly"]=System.Reflection.Assembly;System.Reflection.Assembly.$assembly=Bridge.SystemAssembly;o=Bridge.$currentAssembly,function(){Bridge.SystemAssembly.version="15.6.0";Bridge.SystemAssembly.compiler="15.6.0"}();Bridge.define("Bridge.Utils.SystemAssemblyVersion");Bridge.Reflection={setMetadata:function(n,t){n.$getMetadata=Bridge.Reflection.getMetadata;n.$metadata=t},initMetaData:function(n,t){var r,i;if(t.m)for(r=0;r<t.m.length;r++)i=t.m[r],i.td=n,i.ad&&(i.ad.td=n),i.r&&(i.r.td=n),i.g&&(i.g.td=n),i.s&&(i.s.td=n);n.$metadata=t;n.$initMetaData=!0},getMetadata:function(){var n,t,i,r;if(!this.$metadata&&this.$genericTypeDefinition&&(this.$metadata=this.$genericTypeDefinition.$factoryMetadata||this.$genericTypeDefinition.$metadata),n=this.$metadata,typeof n=="function")if(this.$isGenericTypeDefinition){for(i=this.$typeArgumentCount,r=new Array(i),t=0;t<i;t++)r[t]=Object;this.$factoryMetadata=this.$metadata;n=this.$metadata.apply(null,r)}else n=this.$typeArguments?this.$metadata.apply(null,this.$typeArguments):this.$metadata();return!this.$initMetaData&&n&&Bridge.Reflection.initMetaData(this,n),n},load:function(n){return System.Reflection.Assembly.assemblies[n]||require(n)},getGenericTypeDefinition:function(n){if(n.$isGenericTypeDefinition)return n;if(!n.$genericTypeDefinition)throw new System.InvalidOperationException("This operation is only valid on generic types.");return n.$genericTypeDefinition},getGenericParameterCount:function(n){return n.$typeArgumentCount||0},getGenericArguments:function(n){return n.$typeArguments||null},isGenericTypeDefinition:function(n){return n.$isGenericTypeDefinition||!1},getBaseType:function(n){var t,i;if(n===Object||n.$kind==="interface"||n.prototype==null)return null;if(Object.getPrototypeOf)return Object.getPrototypeOf(n.prototype).constructor;if(t=n.prototype,Object.prototype.hasOwnProperty.call(t,"constructor"))try{return i=t.constructor,delete t.constructor,t.constructor}finally{t.constructor=i}return t.constructor},getTypeFullName:function(n){var i,t;return n.$$fullname?n.$$fullname:n.$$name?n.$$name:(i=n.constructor===Function?n.toString():n.constructor.toString(),t=/function (.{1,})\(/.exec(i),t&&t.length>1?t[1]:"Object")},_makeQName:function(n,t){return n+(t?", "+t.name:"")},getTypeQName:function(n){return Bridge.Reflection._makeQName(Bridge.Reflection.getTypeFullName(n),n.$assembly)},getTypeName:function(n){var t=Bridge.Reflection.getTypeFullName(n),i=t.indexOf("["),r=t.lastIndexOf(".",i>=0?i:t.length);return r>0?t.substr(r+1):t},getTypeNamespace:function(n){var t=Bridge.Reflection.getTypeFullName(n),u=t.indexOf("["),f=t.lastIndexOf(".",u>=0?u:t.length),i=f>0?t.substr(0,f):"",r;return n.$assembly&&(r=Bridge.Reflection._getAssemblyType(n.$assembly,i),r&&(i=Bridge.Reflection.getTypeNamespace(r))),i},getTypeAssembly:function(n){return System.Array.contains([Date,Number,Boolean,String,Function,Array],n)?Bridge.SystemAssembly:n.$assembly||Bridge.SystemAssembly},_getAssemblyType:function(n,t){var e=!1,u,f,i,r;if(n||(n=Bridge.SystemAssembly,e=!0),n.$types){if(u=n.$types[t]||null,u)return u;if(n.name==="mscorlib")n=Bridge.global;else return null}for(f=t.split("."),i=n,r=0;r<f.length;r++)if(i=i[f[r]],!i)return null;return typeof i!="function"||!e&&i.$assembly&&n.name!==i.$assembly.name?null:i},getAssemblyTypes:function(n){var t=[],i,r;if(n.$types)for(i in n.$types)n.$types.hasOwnProperty(i)&&t.push(n.$types[i]);else r=function(n,i){for(var u in n)n.hasOwnProperty(u)&&r(n[u],u);typeof n=="function"&&Bridge.isUpper(i.charCodeAt(0))&&t.push(n)},r(n,"");return t},createAssemblyInstance:function(n,t){var i=Bridge.Reflection.getType(t,n);return i?Bridge.createInstance(i):null},getInterfaces:function(n){return n.$allInterfaces?n.$allInterfaces:n===Date?[System.IComparable$1(Date),System.IEquatable$1(Date),System.IComparable,System.IFormattable]:n===Number?[System.IComparable$1(Bridge.Int),System.IEquatable$1(Bridge.Int),System.IComparable,System.IFormattable]:n===Boolean?[System.IComparable$1(Boolean),System.IEquatable$1(Boolean),System.IComparable]:n===String?[System.IComparable$1(String),System.IEquatable$1(String),System.IComparable,System.ICloneable,System.Collections.IEnumerable,System.Collections.Generic.IEnumerable$1(System.Char)]:n===Array||System.Array._typedArrays[Bridge.getTypeName(n)]?[System.Collections.IEnumerable,System.Collections.ICollection,System.ICloneable,System.Collections.Generic.IEnumerable$1(Object),System.Collections.Generic.ICollection$1(Object),System.Collections.Generic.IList$1(Object)]:[]},isInstanceOfType:function(n,t){return Bridge.is(n,t)},isAssignableFrom:function(n,t){if(n==null)throw new System.NullReferenceException;if(t==null)return!1;if(n===t||n===Object)return!0;if(Bridge.isFunction(n.isAssignableFrom))return n.isAssignableFrom(t);if(t===Array)return System.Array.is([],n);if(Bridge.Reflection.isInterface(n)&&System.Array.contains(Bridge.Reflection.getInterfaces(t),n))return!0;var r=t.$$inherits,i,u;if(r)for(i=0;i<r.length;i++)if(u=Bridge.Reflection.isAssignableFrom(n,r[i]),u)return!0;return!1},isClass:function(n){return n.$kind==="class"||n===Array||n===Function||n===RegExp||n===String||n===Error||n===Object},isEnum:function(n){return n.$kind==="enum"},isFlags:function(n){return!!(n.prototype&&n.prototype.$flags)},isInterface:function(n){return n.$kind==="interface"},_getType:function(n,t,i){var s=!i;i=i||/[[,\]]/g;var o=i.lastIndex,r=i.exec(n),f,e=[],u;if(r){f=n.substring(o,r.index);switch(r[0]){case"[":if(n[r.index+1]!=="[")return null;for(;;){if(i.exec(n),u=Bridge.Reflection._getType(n,Bridge.SystemAssembly,i),!u)return null;if(e.push(u),r=i.exec(n),r[0]==="]")break;else if(r[0]!==",")return null}if(r=i.exec(n),r&&r[0]===","&&(i.exec(n),!(t=System.Reflection.Assembly.assemblies[(i.lastIndex>0?n.substring(r.index+1,i.lastIndex-1):n.substring(r.index+1)).trim()])))return null;break;case",":if(i.exec(n),!(t=System.Reflection.Assembly.assemblies[(i.lastIndex>0?n.substring(r.index+1,i.lastIndex-1):n.substring(r.index+1)).trim()]))return null}}else f=n.substring(o);return s&&i.lastIndex?null:(u=Bridge.Reflection._getAssemblyType(t,f.trim()),u=e.length?u.apply(null,e):u,u&&u.$staticInit&&u.$staticInit(),u)},getType:function(n,t){return n?Bridge.Reflection._getType(n,t):null},canAcceptNull:function(n){return n.$kind==="struct"||n===System.Decimal||n===System.Int64||n===System.UInt64||n===System.Double||n===System.Single||n===System.Byte||n===System.SByte||n===System.Int16||n===System.UInt16||n===System.Int32||n===System.UInt32||n===Bridge.Int||n===Boolean||n===Date||n===Number?!1:!0},applyConstructor:function(n,t){var a,f,s,h,e,i,r,c,o,u,l;if(!t||t.length===0)return new n;if(n.$$initCtor&&n.$kind!=="anonymous"){if(a=Bridge.getMetadata(n),f=0,a){for(s=Bridge.Reflection.getMembers(n,1,28),e=0;e<s.length;e++)if(i=s[e],i.p&&i.p.length===t.length){for(h=!0,r=0;r<i.p.length;r++)if(c=i.p[r],!Bridge.is(t[r],c)||t[r]==null&&!Bridge.Reflection.canAcceptNull(c)){h=!1;break}h&&(n=n[i.sn],f++)}}else if(Bridge.isFunction(n.ctor)&&n.ctor.length===t.length)n=n.ctor;else for(o="$ctor",u=1;Bridge.isFunction(n[o+u]);)n[o+u].length===t.length&&(n=n[o+u],f++),u++;if(f>1)throw new System.Exception("The ambiguous constructor call");}return l=function(){n.apply(this,t)},l.prototype=n.prototype,new l},getAttributes:function(n,t,i){var f=[],r,o,u,e,s,c,h;if(i&&(c=Bridge.Reflection.getBaseType(n),c))for(u=Bridge.Reflection.getAttributes(c,t,!0),r=0;r<u.length;r++)o=Bridge.getType(u[r]),e=Bridge.getMetadata(o),e&&e.ni||f.push(u[r]);if(s=Bridge.getMetadata(n),s&&s.at)for(r=0;r<s.at.length;r++)if(u=s.at[r],t==null||Bridge.Reflection.isInstanceOfType(u,t)){if(o=Bridge.getType(u),e=Bridge.getMetadata(o),!e||!e.am)for(h=f.length-1;h>=0;h--)Bridge.Reflection.isInstanceOfType(f[h],o)&&f.splice(h,1);f.push(u)}return f},getMembers:function(n,t,i,r,u){var e=[],l,a,o,y,h,c,v,s,f;if(((i&72)==72||(i&6)==4)&&(l=Bridge.Reflection.getBaseType(n),l&&(e=Bridge.Reflection.getMembers(l,t&-2,i&(i&64?255:247)&(i&2?251:255),r,u))),a=function(n){if(t&n.t&&(i&4&&!n.is||i&8&&n.is)&&(!r||n.n===r)){if(u){if((n.p||[]).length!==u.length)return;for(var f=0;f<u.length;f++)if(u[f]!==n.p[f])return}e.push(n)}},o=Bridge.getMetadata(n),o&&o.m)for(y=["g","s","ad","r"],f=0;f<o.m.length;f++)for(h=o.m[f],a(h),c=0;c<4;c++)v=y[c],h[v]&&a(h[v]);if(i&256){while(n){for(s=[],f=0;f<e.length;f++)e[f].td===n&&s.push(e[f]);if(s.length>1)throw new System.Reflection.AmbiguousMatchException("Ambiguous match");else if(s.length===1)return s[0];n=Bridge.Reflection.getBaseType(n)}return null}return e},midel:function(n,t,i){var r,u,f,e;if(n.is&&!!t)throw new System.ArgumentException("Cannot specify target for static method");else if(!n.is&&!t)throw new System.ArgumentException("Must specify target for instance method");if(n.fg)r=function(){return(n.is?n.td:this)[n.fg]};else if(n.fs)r=function(t){(n.is?n.td:this)[n.fs]=t};else{if(r=n.def||(n.is||n.sm?n.td[n.sn]:t[n.sn]),n.tpc){if(!i||i.length!==n.tpc)throw new System.ArgumentException("Wrong number of type arguments");u=r;r=function(){return u.apply(this,i.concat(Array.prototype.slice.call(arguments)))}}else if(i&&i.length)throw new System.ArgumentException("Cannot specify type arguments for non-generic method");n.exp&&(f=r,r=function(){return f.apply(this,Array.prototype.slice.call(arguments,0,arguments.length-1).concat(arguments[arguments.length-1]))});n.sm&&(e=r,r=function(){return e.apply(null,[this].concat(Array.prototype.slice.call(arguments)))})}return Bridge.fn.bind(t,r)},invokeCI:function(n,t){return n.exp&&(t=t.slice(0,t.length-1).concat(t[t.length-1])),n.def?n.def.apply(null,t):n.sm?n.td[n.sn].apply(null,t):Bridge.Reflection.applyConstructor(n.sn?n.td[n.sn]:n.td,t)},fieldAccess:function(n,t){if(n.is&&!!t)throw new System.ArgumentException("Cannot specify target for static field");else if(!n.is&&!t)throw new System.ArgumentException("Must specify target for instance field");if(t=n.is?n.td:t,arguments.length===3)t[n.sn]=arguments[2];else return t[n.sn]}};Bridge.setMetadata=Bridge.Reflection.setMetadata;System.Reflection.ConstructorInfo={$is:function(n){return n!=null&&n.t===1}};System.Reflection.EventInfo={$is:function(n){return n!=null&&n.t===2}};System.Reflection.FieldInfo={$is:function(n){return n!=null&&n.t===4}};System.Reflection.MethodBase={$is:function(n){return n!=null&&(n.t===1||n.t===8)}};System.Reflection.MethodInfo={$is:function(n){return n!=null&&n.t===8}};System.Reflection.PropertyInfo={$is:function(n){return n!=null&&n.t===16}};System.AppDomain={getAssemblies:function(){return Object.keys(System.Reflection.Assembly.assemblies).map(function(n){return System.Reflection.Assembly.assemblies[n]})}};Bridge.define("System.IFormattable",{$kind:"interface",statics:{$is:function(n){return Bridge.isNumber(n)||Bridge.isDate(n)?!0:Bridge.is(n,System.IFormattable,!0)}}});Bridge.define("System.IComparable",{$kind:"interface",statics:{$is:function(n){return Bridge.isNumber(n)||Bridge.isDate(n)||Bridge.isBoolean(n)||Bridge.isString(n)?!0:Bridge.is(n,System.IComparable,!0)}}});Bridge.define("System.IFormatProvider",{$kind:"interface"});Bridge.define("System.ICloneable",{$kind:"interface"});Bridge.define("System.IComparable$1",function(n){return{$kind:"interface",statics:{$is:function(t){return Bridge.isNumber(t)&&n.$number&&n.$is(t)||Bridge.isDate(t)&&n===Date||Bridge.isBoolean(t)&&n===Boolean||Bridge.isString(t)&&n===String?!0:Bridge.is(t,System.IComparable$1(n),!0)}}}});Bridge.define("System.IEquatable$1",function(n){return{$kind:"interface",statics:{$is:function(t){return Bridge.isNumber(t)&&n.$number&&n.$is(t)||Bridge.isDate(t)&&n===Date||Bridge.isBoolean(t)&&n===Boolean||Bridge.isString(t)&&n===String?!0:Bridge.is(t,System.IEquatable$1(n),!0)}}}});Bridge.define("Bridge.IPromise",{$kind:"interface"});Bridge.define("System.IDisposable",{$kind:"interface"});vt={hasValue:Bridge.hasValue,getValue:function(n){if(!Bridge.hasValue(n))throw new System.InvalidOperationException("Nullable instance doesn't have a value.");return n},getValueOrDefault:function(n,t){return Bridge.hasValue(n)?n:t},add:function(n,t){return Bridge.hasValue$1(n,t)?n+t:null},band:function(n,t){return Bridge.hasValue$1(n,t)?n&t:null},bor:function(n,t){return Bridge.hasValue$1(n,t)?n|t:null},and:function(n,t){return n===!0&&t===!0?!0:n===!1||t===!1?!1:null},or:function(n,t){return n===!0||t===!0?!0:n===!1&&t===!1?!1:null},div:function(n,t){return Bridge.hasValue$1(n,t)?n/t:null},eq:function(n,t){return Bridge.hasValue(n)?n===t:!Bridge.hasValue(t)},equals:function(n,t,i){return Bridge.hasValue(n)?i?i(n,t):Bridge.equals(n,t):!Bridge.hasValue(t)},toString:function(n,t){return Bridge.hasValue(n)?t?t(n):n.toString():""},getHashCode:function(n,t){return Bridge.hasValue(n)?t?t(n):Bridge.getHashCode(n):0},xor:function(n,t){return Bridge.hasValue$1(n,t)?n^t:null},gt:function(n,t){return Bridge.hasValue$1(n,t)&&n>t},gte:function(n,t){return Bridge.hasValue$1(n,t)&&n>=t},neq:function(n,t){return Bridge.hasValue(n)?n!==t:Bridge.hasValue(t)},lt:function(n,t){return Bridge.hasValue$1(n,t)&&n<t},lte:function(n,t){return Bridge.hasValue$1(n,t)&&n<=t},mod:function(n,t){return Bridge.hasValue$1(n,t)?n%t:null},mul:function(n,t){return Bridge.hasValue$1(n,t)?n*t:null},sl:function(n,t){return Bridge.hasValue$1(n,t)?n<<t:null},sr:function(n,t){return Bridge.hasValue$1(n,t)?n>>t:null},srr:function(n,t){return Bridge.hasValue$1(n,t)?n>>>t:null},sub:function(n,t){return Bridge.hasValue$1(n,t)?n-t:null},bnot:function(n){return Bridge.hasValue(n)?~n:null},neg:function(n){return Bridge.hasValue(n)?-n:null},not:function(n){return Bridge.hasValue(n)?!n:null},pos:function(n){return Bridge.hasValue(n)?+n:null},lift:function(){for(var n=1;n<arguments.length;n++)if(!Bridge.hasValue(arguments[n]))return null;return arguments[0]==null?null:arguments[0].apply==undefined?arguments[0]:arguments[0].apply(null,Array.prototype.slice.call(arguments,1))},lift1:function(n,t){return Bridge.hasValue(t)?typeof n=="function"?n.apply(null,Array.prototype.slice.call(arguments,1)):t[n].apply(t,Array.prototype.slice.call(arguments,2)):null},lift2:function(n,t,i){return Bridge.hasValue$1(t,i)?typeof n=="function"?n.apply(null,Array.prototype.slice.call(arguments,1)):t[n].apply(t,Array.prototype.slice.call(arguments,2)):null},liftcmp:function(n,t,i){return Bridge.hasValue$1(t,i)?typeof n=="function"?n.apply(null,Array.prototype.slice.call(arguments,1)):t[n].apply(t,Array.prototype.slice.call(arguments,2)):!1},lifteq:function(n,t,i){var r=Bridge.hasValue(t),u=Bridge.hasValue(i);return!r&&!u||r&&u&&(typeof n=="function"?n.apply(null,Array.prototype.slice.call(arguments,1)):t[n].apply(t,Array.prototype.slice.call(arguments,2)))},liftne:function(n,t,i){var r=Bridge.hasValue(t),u=Bridge.hasValue(i);return r!==u||r&&(typeof n=="function"?n.apply(null,Array.prototype.slice.call(arguments,1)):t[n].apply(t,Array.prototype.slice.call(arguments,2)))}};System.Nullable=vt;Bridge.define("System.Nullable$1",function(n){return{$kind:"struct",statics:{getDefaultValue:function(){return null},$is:function(t){return Bridge.is(t,n)}}}});Bridge.define("System.Char",{inherits:[System.IComparable,System.IFormattable],$kind:"struct",statics:{min:0,max:65535,$is:function(n){return typeof n=="number"&&Math.round(n,0)==n&&n>=System.Char.min&&n<=System.Char.max},getDefaultValue:function(){return 0},parse:function(n){if(!Bridge.hasValue(n))throw new System.ArgumentNullException("s");if(n.length!==1)throw new System.FormatException;return n.charCodeAt(0)},tryParse:function(n,t){var i=n&&n.length===1;return t.v=i?n.charCodeAt(0):0,i},format:function(n,t,i){return Bridge.Int.format(n,t,i)},charCodeAt:function(n,t){if(n==null)throw new System.ArgumentNullException;if(n.length!=1)throw new System.FormatException("String must be exactly one character long");return n.charCodeAt(t)},isWhiteSpace:function(n){return!/[^\s\x09-\x0D\x85\xA0]/.test(n)},isDigit:function(n){return n<256?n>=48&&n<=57:new RegExp("[0-90-9٠-٩۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹０-９]").test(String.fromCharCode(n))},isLetter:function(n){return n<256?n>=65&&n<=90||n>=97&&n<=122:new RegExp("[A-Za-za-zµß-öø-ÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıĳĵķĸĺļľŀłńņňŉŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷźżž-ƀƃƅƈƌƍƒƕƙ-ƛƞơƣƥƨƪƫƭưƴƶƹƺƽ-ƿǆǉǌǎǐǒǔǖǘǚǜǝǟǡǣǥǧǩǫǭǯǰǳǵǹǻǽǿȁȃȅȇȉȋȍȏȑȓȕȗșțȝȟȡȣȥȧȩȫȭȯȱȳ-ȹȼȿɀɂɇɉɋɍɏ-ʓʕ-ʯͱͳͷͻ-ͽΐά-ώϐϑϕ-ϗϙϛϝϟϡϣϥϧϩϫϭϯ-ϳϵϸϻϼа-џѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҋҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӂӄӆӈӊӌӎӏӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӷӹӻӽӿԁԃԅԇԉԋԍԏԑԓԕԗԙԛԝԟԡԣԥԧա-ևᴀ-ᴫᵫ-ᵷᵹ-ᶚḁḃḅḇḉḋḍḏḑḓḕḗḙḛḝḟḡḣḥḧḩḫḭḯḱḳḵḷḹḻḽḿṁṃṅṇṉṋṍṏṑṓṕṗṙṛṝṟṡṣṥṧṩṫṭṯṱṳṵṷṹṻṽṿẁẃẅẇẉẋẍẏẑẓẕ-ẝẟạảấầẩẫậắằẳẵặẹẻẽếềểễệỉịọỏốồổỗộớờởỡợụủứừửữựỳỵỷỹỻỽỿ-ἇἐ-ἕἠ-ἧἰ-ἷὀ-ὅὐ-ὗὠ-ὧὰ-ώᾀ-ᾇᾐ-ᾗᾠ-ᾧᾰ-ᾴᾶᾷιῂ-ῄῆῇῐ-ΐῖῗῠ-ῧῲ-ῴῶῷℊℎℏℓℯℴℹℼℽⅆ-ⅉⅎↄⰰ-ⱞⱡⱥⱦⱨⱪⱬⱱⱳⱴⱶ-ⱻⲁⲃⲅⲇⲉⲋⲍⲏⲑⲓⲕⲗⲙⲛⲝⲟⲡⲣⲥⲧⲩⲫⲭⲯⲱⲳⲵⲷⲹⲻⲽⲿⳁⳃⳅⳇⳉⳋⳍⳏⳑⳓⳕⳗⳙⳛⳝⳟⳡⳣⳤⳬⳮⳳⴀ-ⴥⴧⴭꙁꙃꙅꙇꙉꙋꙍꙏꙑꙓꙕꙗꙙꙛꙝꙟꙡꙣꙥꙧꙩꙫꙭꚁꚃꚅꚇꚉꚋꚍꚏꚑꚓꚕꚗꜣꜥꜧꜩꜫꜭꜯ-ꜱꜳꜵꜷꜹꜻꜽꜿꝁꝃꝅꝇꝉꝋꝍꝏꝑꝓꝕꝗꝙꝛꝝꝟꝡꝣꝥꝧꝩꝫꝭꝯꝱ-ꝸꝺꝼꝿꞁꞃꞅꞇꞌꞎꞑꞓꞡꞣꞥꞧꞩꟺﬀ-ﬆﬓ-ﬗａ-ｚA-ZÀ-ÖØ-ÞĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮİĲĴĶĹĻĽĿŁŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸŹŻŽƁƂƄƆƇƉ-ƋƎ-ƑƓƔƖ-ƘƜƝƟƠƢƤƦƧƩƬƮƯƱ-ƳƵƷƸƼǄǇǊǍǏǑǓǕǗǙǛǞǠǢǤǦǨǪǬǮǱǴǶ-ǸǺǼǾȀȂȄȆȈȊȌȎȐȒȔȖȘȚȜȞȠȢȤȦȨȪȬȮȰȲȺȻȽȾɁɃ-ɆɈɊɌɎͰͲͶΆΈ-ΊΌΎΏΑ-ΡΣ-ΫϏϒ-ϔϘϚϜϞϠϢϤϦϨϪϬϮϴϷϹϺϽ-ЯѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӀӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӶӸӺӼӾԀԂԄԆԈԊԌԎԐԒԔԖԘԚԜԞԠԢԤԦԱ-ՖႠ-ჅჇჍḀḂḄḆḈḊḌḎḐḒḔḖḘḚḜḞḠḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾṀṂṄṆṈṊṌṎṐṒṔṖṘṚṜṞṠṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾẀẂẄẆẈẊẌẎẐẒẔẞẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾỀỂỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪỬỮỰỲỴỶỸỺỼỾἈ-ἏἘ-ἝἨ-ἯἸ-ἿὈ-ὍὙὛὝὟὨ-ὯᾸ-ΆῈ-ΉῘ-ΊῨ-ῬῸ-Ώℂℇℋ-ℍℐ-ℒℕℙ-ℝℤΩℨK-ℭℰ-ℳℾℿⅅↃⰀ-ⰮⱠⱢ-ⱤⱧⱩⱫⱭ-ⱰⱲⱵⱾ-ⲀⲂⲄⲆⲈⲊⲌⲎⲐⲒⲔⲖⲘⲚⲜⲞⲠⲢⲤⲦⲨⲪⲬⲮⲰⲲⲴⲶⲸⲺⲼⲾⳀⳂⳄⳆⳈⳊⳌⳎⳐⳒⳔⳖⳘⳚⳜⳞⳠⳢⳫⳭⳲꙀꙂꙄꙆꙈꙊꙌꙎꙐꙒꙔꙖꙘꙚꙜꙞꙠꙢꙤꙦꙨꙪꙬꚀꚂꚄꚆꚈꚊꚌꚎꚐꚒꚔꚖꜢꜤꜦꜨꜪꜬꜮꜲꜴꜶꜸꜺꜼꜾꝀꝂꝄꝆꝈꝊꝌꝎꝐꝒꝔꝖꝘꝚꝜꝞꝠꝢꝤꝦꝨꝪꝬꝮꝹꝻꝽꝾꞀꞂꞄꞆꞋꞍꞐꞒꞠꞢꞤꞦꞨꞪＡ-Ｚǅǈǋǲᾈ-ᾏᾘ-ᾟᾨ-ᾯᾼῌῼʰ-ˁˆ-ˑˠ-ˤˬˮʹͺՙـۥۦߴߵߺࠚࠤࠨॱๆໆჼៗᡃᪧᱸ-ᱽᴬ-ᵪᵸᶛ-ᶿⁱⁿₐ-ₜⱼⱽⵯⸯ々〱-〵〻ゝゞー-ヾꀕꓸ-ꓽꘌꙿꜗ-ꜟꝰꞈꟸꟹꧏꩰꫝꫳꫴｰﾞﾟªºƻǀ-ǃʔא-תװ-ײؠ-ؿف-يٮٯٱ-ۓەۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪࠀ-ࠕࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॲ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๅກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎა-ჺჽ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៜᠠ-ᡂᡄ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱷᳩ-ᳬᳮ-ᳱᳵᳶℵ-ℸⴰ-ⵧⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ〆〼ぁ-ゖゟァ-ヺヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꀔꀖ-ꒌꓐ-ꓷꔀ-ꘋꘐ-ꘟꘪꘫꙮꚠ-ꛥꟻ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩯꩱ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛꫜꫠ-ꫪꫲꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎יִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼｦ-ｯｱ-ﾝﾠ-ﾾￂ-ￇￊ-ￏￒ-ￗￚ-ￜ]").test(String.fromCharCode(n))},isHighSurrogate:function(n){return new RegExp("[\uD800-\uDBFF]").test(String.fromCharCode(n))},isLowSurrogate:function(n){return new RegExp("[\uDC00-\uDFFF]").test(String.fromCharCode(n))},isSurrogate:function(n){return new RegExp("[\uD800-\uDFFF]").test(String.fromCharCode(n))},isNull:function(n){return new RegExp("\x00").test(String.fromCharCode(n))},isSymbol:function(n){return n<256?[36,43,60,61,62,94,96,124,126,162,163,164,165,166,167,168,169,172,174,175,176,177,180,182,184,215,247].indexOf(n)!=-1:new RegExp("[₠-⃏⃐-⃿℀-⅏⅐-↏←-⇿∀-⋿⌀-⏿■-◿☀-⛿✀-➿⟀-⟯⟰-⟿⠀-⣿⤀-⥿⦀-⧿⨀-⫿⬀-⯿]").test(String.fromCharCode(n))},isSeparator:function(n){return n<256?n==32||n==160:new RegExp("[\u2028\u2029   ᠎ -   　]").test(String.fromCharCode(n))},isPunctuation:function(n){return n<256?[33,34,35,37,38,39,40,41,42,44,45,46,47,58,59,63,64,91,92,93,95,123,125,161,171,173,183,187,191].indexOf(n)!=-1:new RegExp("[!-#%-*,-/:;?@[-]_{}¡§«¶·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰૰෴๏๚๛༄-༒༔༺-༽྅࿐-࿔࿙࿚၊-၏჻፠-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳀-᳇᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰-⸻、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꫰꫱꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫！-＃％-＊，-／：；？＠［-］＿｛｝｟-･-֊־᐀᠆‐-―⸗⸚⸺⸻〜〰゠︱︲﹘﹣－([{༺༼᚛‚„⁅⁽₍〈❨❪❬❮❰❲❴⟅⟦⟨⟪⟬⟮⦃⦅⦇⦉⦋⦍⦏⦑⦓⦕⦗⧘⧚⧼⸢⸤⸦⸨〈《「『【〔〖〘〚〝﴾︗︵︷︹︻︽︿﹁﹃﹇﹙﹛﹝（［｛｟｢)]}༻༽᚜⁆⁾₎〉❩❫❭❯❱❳❵⟆⟧⟩⟫⟭⟯⦄⦆⦈⦊⦌⦎⦐⦒⦔⦖⦘⧙⧛⧽⸣⸥⸧⸩〉》」』】〕〗〙〛〞〟﴿︘︶︸︺︼︾﹀﹂﹄﹈﹚﹜﹞）］｝｠｣«‘‛“‟‹⸂⸄⸉⸌⸜⸠»’”›⸃⸅⸊⸍⸝⸡_‿⁀⁔︳︴﹍-﹏＿!-#%-'*,./:;?@\\¡§¶·¿;·՚-՟։׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰૰෴๏๚๛༄-༒༔྅࿐-࿔࿙࿚၊-၏჻፠-፨᙭᙮᛫-᛭᜵᜶។-៖៘-៚᠀-᠅᠇-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳀-᳇᳓‖‗†-‧‰-‸※-‾⁁-⁃⁇-⁑⁓⁕-⁞⳹-⳼⳾⳿⵰⸀⸁⸆-⸈⸋⸎-⸖⸘⸙⸛⸞⸟⸪-⸮⸰-⸹、-〃〽・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꫰꫱꯫︐-︖︙︰﹅﹆﹉-﹌﹐-﹒﹔-﹗﹟-﹡﹨﹪﹫！-＃％-＇＊，．／：；？＠＼｡､･]").test(String.fromCharCode(n))},isNumber:function(n){return n<256?[48,49,50,51,52,53,54,55,56,57,178,179,185,188,189,190].indexOf(n)!=-1:new RegExp("[0-9²³¹¼-¾٠-٩۰-۹߀-߉०-९০-৯৴-৹੦-੯૦-૯୦-୯୲-୷௦-௲౦-౯౸-౾೦-೯൦-൵๐-๙໐-໙༠-༳၀-၉႐-႙፩-፼ᛮ-ᛰ០-៩៰-៹᠐-᠙᥆-᥏᧐-᧚᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙⁰⁴-⁹₀-₉⅐-ↂↅ-↉①-⒛⓪-⓿❶-➓⳽〇〡-〩〸-〺㆒-㆕㈠-㈩㉈-㉏㉑-㉟㊀-㊉㊱-㊿꘠-꘩ꛦ-ꛯ꠰-꠵꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹０-９0-9٠-٩۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹０-９ᛮ-ᛰⅠ-ↂↅ-ↈ〇〡-〩〸-〺ꛦ-ꛯ²³¹¼-¾৴-৹୲-୷௰-௲౸-౾൰-൵༪-༳፩-፼៰-៹᧚⁰⁴-⁹₀-₉⅐-⅟↉①-⒛⓪-⓿❶-➓⳽㆒-㆕㈠-㈩㉈-㉏㉑-㉟㊀-㊉㊱-㊿꠰-꠵]").test(String.fromCharCode(n))},isControl:function(n){return n<256?n>=0&&n<=31||n>=127&&n<=159:new RegExp("[\x00-\x1f