=d||x){p={cp:C,segment:w};break}}if(p)break}var T=p.cp,D=p.segment,S=(d-g)/D.length,A=D.t1-D.t0,L=v?D.t0+A*S:D.t1-A*S;L=ya(0,L,1),e=Rr(T.p0,T.p1,T.p2,L),c=sp(T.p0,T.p1,T.p2,L);break}case"straight":case"segments":case"haystack":{for(var I=0,O,k,R,M,P=a.allpts.length,F=0;F+3=d));F+=2);var V=d-k,G=V/O;G=ya(0,G,1),e=hh(R,M,G),c=zu(R,M);break}}s("labelX",h,e.x),s("labelY",h,e.y),s("labelAutoAngle",h,c)}};u("source"),u("target"),this.applyLabelDimensions(t)}};Gt.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};Gt.applyPrefixedLabelDimensions=function(t,e){var r=t._private,a=this.getLabelText(t,e),n=this.calculateLabelDimensions(t,a),i=t.pstyle("line-height").pfValue,s=t.pstyle("text-wrap").strValue,o=At(r.rscratch,"labelWrapCachedLines",e)||[],l=s!=="wrap"?1:Math.max(o.length,1),u=n.height/l,f=u*i,h=n.width,c=n.height+(l-1)*(i-1)*u;Qt(r.rstyle,"labelWidth",e,h),Qt(r.rscratch,"labelWidth",e,h),Qt(r.rstyle,"labelHeight",e,c),Qt(r.rscratch,"labelHeight",e,c),Qt(r.rscratch,"labelLineHeight",e,f)};Gt.getLabelText=function(t,e){var r=t._private,a=e?e+"-":"",n=t.pstyle(a+"label").strValue,i=t.pstyle("text-transform").value,s=function($,q){return q?(Qt(r.rscratch,$,e,q),q):At(r.rscratch,$,e)};if(!n)return"";i=="none"||(i=="uppercase"?n=n.toUpperCase():i=="lowercase"&&(n=n.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var u="\u200B",f=n.split(`
+`),h=t.pstyle("text-max-width").pfValue,c=t.pstyle("text-overflow-wrap").value,v=c==="anywhere",d=[],y=/[\s\u200b]+|$/g,p=0;ph){var E=g.matchAll(y),w="",x=0,T=wo(E),D;try{for(T.s();!(D=T.n()).done;){var S=D.value,A=S[0],L=g.substring(x,S.index);x=S.index+A.length;var I=w.length===0?L:w+L+A,O=this.calculateLabelDimensions(t,I),k=O.width;k<=h?w+=L+A:(w&&d.push(w),w=L+A)}}catch(B){T.e(B)}finally{T.f()}w.match(/^[\s\u200b]+$/)||d.push(w)}else d.push(g)}s("labelWrapCachedLines",d),n=s("labelWrapCachedText",d.join(`
+`)),s("labelWrapKey",l)}else if(o==="ellipsis"){var R=t.pstyle("text-max-width").pfValue,M="",P="\u2026",F=!1;if(this.calculateLabelDimensions(t,n).widthR)break;M+=n[V],V===n.length-1&&(F=!0)}return F||(M+=P),M}return n};Gt.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())switch(r){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e};Gt.calculateLabelDimensions=function(t,e){var r=this,a=r.cy.window(),n=a.document,i=pr(e,t._private.labelDimsKey),s=r.labelDimCache||(r.labelDimCache=[]),o=s[i];if(o!=null)return o;var l=0,u=t.pstyle("font-style").strValue,f=t.pstyle("font-size").pfValue,h=t.pstyle("font-family").strValue,c=t.pstyle("font-weight").strValue,v=this.labelCalcCanvas,d=this.labelCalcCanvasContext;if(!v){v=this.labelCalcCanvas=n.createElement("canvas"),d=this.labelCalcCanvasContext=v.getContext("2d");var y=v.style;y.position="absolute",y.left="-9999px",y.top="-9999px",y.zIndex="-1",y.visibility="hidden",y.pointerEvents="none"}d.font="".concat(u," ").concat(c," ").concat(f,"px ").concat(h);for(var p=0,g=0,m=e.split(`
+`),b=0;b1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l=t.desktopTapThreshold2}var ft=n(N);Me&&(t.hoverData.tapholdCancelled=!0);var xt=function(){var Mt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Mt.length===0?(Mt.push(ge[0]),Mt.push(ge[1])):(Mt[0]+=ge[0],Mt[1]+=ge[1])};J=!0,a(he,["mousemove","vmousemove","tapdrag"],N,{x:K[0],y:K[1]});var mt=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||X.emit({originalEvent:N,type:"boxstart",position:{x:K[0],y:K[1]}}),me[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(Me){var vt={originalEvent:N,type:"cxtdrag",position:{x:K[0],y:K[1]}};le?le.emit(vt):X.emit(vt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||he!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit({originalEvent:N,type:"cxtdragout",position:{x:K[0],y:K[1]}}),t.hoverData.cxtOver=he,he&&he.emit({originalEvent:N,type:"cxtdragover",position:{x:K[0],y:K[1]}}))}}else if(t.hoverData.dragging){if(J=!0,X.panningEnabled()&&X.userPanningEnabled()){var It;if(t.hoverData.justStartedPan){var Vt=t.hoverData.mdownPos;It={x:(K[0]-Vt[0])*_,y:(K[1]-Vt[1])*_},t.hoverData.justStartedPan=!1}else It={x:ge[0]*_,y:ge[1]*_};X.panBy(It),X.emit("dragpan"),t.hoverData.dragged=!0}K=t.projectIntoViewport(N.clientX,N.clientY)}else if(me[4]==1&&(le==null||le.pannable())){if(Me){if(!t.hoverData.dragging&&X.boxSelectionEnabled()&&(ft||!X.panningEnabled()||!X.userPanningEnabled()))mt();else if(!t.hoverData.selecting&&X.panningEnabled()&&X.userPanningEnabled()){var Tt=i(le,t.hoverData.downs);Tt&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,me[4]=0,t.data.bgActivePosistion=Ir(re),t.redrawHint("select",!0),t.redraw())}le&&le.pannable()&&le.active()&&le.unactivate()}}else{if(le&&le.pannable()&&le.active()&&le.unactivate(),(!le||!le.grabbed())&&he!=Ee&&(Ee&&a(Ee,["mouseout","tapdragout"],N,{x:K[0],y:K[1]}),he&&a(he,["mouseover","tapdragover"],N,{x:K[0],y:K[1]}),t.hoverData.last=he),le)if(Me){if(X.boxSelectionEnabled()&&ft)le&&le.grabbed()&&(p(Fe),le.emit("freeon"),Fe.emit("free"),t.dragData.didDrag&&(le.emit("dragfreeon"),Fe.emit("dragfree"))),mt();else if(le&&le.grabbed()&&t.nodeIsDraggable(le)){var $e=!t.dragData.didDrag;$e&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||d(Fe,{inDragLayer:!0});var We={x:0,y:0};if(ie(ge[0])&&ie(ge[1])&&(We.x+=ge[0],We.y+=ge[1],$e)){var at=t.hoverData.dragDelta;at&&ie(at[0])&&ie(at[1])&&(We.x+=at[0],We.y+=at[1])}t.hoverData.draggingEles=!0,Fe.silentShift(We).emit("position drag"),t.redrawHint("drag",!0),t.redraw()}}else xt();J=!0}if(me[2]=K[0],me[3]=K[1],J)return N.stopPropagation&&N.stopPropagation(),N.preventDefault&&N.preventDefault(),!1}},!1);var S,A,L;t.registerBinding(e,"mouseup",function(N){if(!(t.hoverData.which===1&&N.which!==1&&t.hoverData.capture)){var U=t.hoverData.capture;if(U){t.hoverData.capture=!1;var J=t.cy,X=t.projectIntoViewport(N.clientX,N.clientY),_=t.selection,ae=t.findNearestElement(X[0],X[1],!0,!1),K=t.dragData.possibleDragElements,re=t.hoverData.down,ye=n(N);if(t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,re&&re.unactivate(),t.hoverData.which===3){var me={originalEvent:N,type:"cxttapend",position:{x:X[0],y:X[1]}};if(re?re.emit(me):J.emit(me),!t.hoverData.cxtDragged){var he={originalEvent:N,type:"cxttap",position:{x:X[0],y:X[1]}};re?re.emit(he):J.emit(he)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(a(ae,["mouseup","tapend","vmouseup"],N,{x:X[0],y:X[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(a(re,["click","tap","vclick"],N,{x:X[0],y:X[1]}),A=!1,N.timeStamp-L<=J.multiClickDebounceTime()?(S&&clearTimeout(S),A=!0,L=null,a(re,["dblclick","dbltap","vdblclick"],N,{x:X[0],y:X[1]})):(S=setTimeout(function(){A||a(re,["oneclick","onetap","voneclick"],N,{x:X[0],y:X[1]})},J.multiClickDebounceTime()),L=N.timeStamp)),re==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!n(N)&&(J.$(r).unselect(["tapunselect"]),K.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=K=J.collection()),ae==re&&!t.dragData.didDrag&&!t.hoverData.selecting&&ae!=null&&ae._private.selectable&&(t.hoverData.dragging||(J.selectionType()==="additive"||ye?ae.selected()?ae.unselect(["tapunselect"]):ae.select(["tapselect"]):ye||(J.$(r).unmerge(ae).unselect(["tapunselect"]),ae.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Ee=J.collection(t.getAllInBox(_[0],_[1],_[2],_[3]));t.redrawHint("select",!0),Ee.length>0&&t.redrawHint("eles",!0),J.emit({type:"boxend",originalEvent:N,position:{x:X[0],y:X[1]}});var le=function(Me){return Me.selectable()&&!Me.selected()};J.selectionType()==="additive"||ye||J.$(r).unmerge(Ee).unselect(),Ee.emit("box").stdFilter(le).select().emit("boxselect"),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!_[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var ge=re&&re.grabbed();p(K),ge&&(re.emit("freeon"),K.emit("free"),t.dragData.didDrag&&(re.emit("dragfreeon"),K.emit("dragfree")))}}_[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var I=function(N){if(!t.scrollingPage){var U=t.cy,J=U.zoom(),X=U.pan(),_=t.projectIntoViewport(N.clientX,N.clientY),ae=[_[0]*J+X.x,_[1]*J+X.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||T()){N.preventDefault();return}if(U.panningEnabled()&&U.userPanningEnabled()&&U.zoomingEnabled()&&U.userZoomingEnabled()){N.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var K;N.deltaY!=null?K=N.deltaY/-250:N.wheelDeltaY!=null?K=N.wheelDeltaY/1e3:K=N.wheelDelta/1e3,K=K*t.wheelSensitivity;var re=N.deltaMode===1;re&&(K*=33);var ye=U.zoom()*Math.pow(10,K);N.type==="gesturechange"&&(ye=t.gestureStartZoom*N.scale),U.zoom({level:ye,renderedPosition:{x:ae[0],y:ae[1]}}),U.emit(N.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};t.registerBinding(t.container,"wheel",I,!0),t.registerBinding(e,"scroll",function(N){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(N){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||N.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(j){t.hasTouchStarted||I(j)},!0),t.registerBinding(t.container,"mouseout",function(N){var U=t.projectIntoViewport(N.clientX,N.clientY);t.cy.emit({originalEvent:N,type:"mouseout",position:{x:U[0],y:U[1]}})},!1),t.registerBinding(t.container,"mouseover",function(N){var U=t.projectIntoViewport(N.clientX,N.clientY);t.cy.emit({originalEvent:N,type:"mouseover",position:{x:U[0],y:U[1]}})},!1);var O,k,R,M,P,F,V,G,B,$,q,Z,W,ee=function(N,U,J,X){return Math.sqrt((J-N)*(J-N)+(X-U)*(X-U))},Y=function(N,U,J,X){return(J-N)*(J-N)+(X-U)*(X-U)},z;t.registerBinding(t.container,"touchstart",z=function(N){if(t.hasTouchStarted=!0,!!D(N)){m(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var U=t.cy,J=t.touchData.now,X=t.touchData.earlier;if(N.touches[0]){var _=t.projectIntoViewport(N.touches[0].clientX,N.touches[0].clientY);J[0]=_[0],J[1]=_[1]}if(N.touches[1]){var _=t.projectIntoViewport(N.touches[1].clientX,N.touches[1].clientY);J[2]=_[0],J[3]=_[1]}if(N.touches[2]){var _=t.projectIntoViewport(N.touches[2].clientX,N.touches[2].clientY);J[4]=_[0],J[5]=_[1]}if(N.touches[1]){t.touchData.singleTouchMoved=!0,p(t.dragData.touchDragEles);var ae=t.findContainerClientCoords();B=ae[0],$=ae[1],q=ae[2],Z=ae[3],O=N.touches[0].clientX-B,k=N.touches[0].clientY-$,R=N.touches[1].clientX-B,M=N.touches[1].clientY-$,W=0<=O&&O<=q&&0<=R&&R<=q&&0<=k&&k<=Z&&0<=M&&M<=Z;var K=U.pan(),re=U.zoom();P=ee(O,k,R,M),F=Y(O,k,R,M),V=[(O+R)/2,(k+M)/2],G=[(V[0]-K.x)/re,(V[1]-K.y)/re];var ye=200,me=ye*ye;if(F=1){for(var Ze=t.touchData.startPosition=[null,null,null,null,null,null],Ue=0;Ue=t.touchTapThreshold2}if(U&&t.touchData.cxt){N.preventDefault();var Ze=N.touches[0].clientX-B,Ue=N.touches[0].clientY-$,ct=N.touches[1].clientX-B,Qe=N.touches[1].clientY-$,ft=Y(Ze,Ue,ct,Qe),xt=ft/F,mt=150,vt=mt*mt,It=1.5,Vt=It*It;if(xt>=Vt||ft>=vt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Tt={originalEvent:N,type:"cxttapend",position:{x:_[0],y:_[1]}};t.touchData.start?(t.touchData.start.unactivate().emit(Tt),t.touchData.start=null):X.emit(Tt)}}if(U&&t.touchData.cxt){var Tt={originalEvent:N,type:"cxtdrag",position:{x:_[0],y:_[1]}};t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Tt):X.emit(Tt),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var $e=t.findNearestElement(_[0],_[1],!0,!0);(!t.touchData.cxtOver||$e!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:N,type:"cxtdragout",position:{x:_[0],y:_[1]}}),t.touchData.cxtOver=$e,$e&&$e.emit({originalEvent:N,type:"cxtdragover",position:{x:_[0],y:_[1]}}))}else if(U&&N.touches[2]&&X.boxSelectionEnabled())N.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||X.emit({originalEvent:N,type:"boxstart",position:{x:_[0],y:_[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,J[4]=1,!J||J.length===0||J[0]===void 0?(J[0]=(_[0]+_[2]+_[4])/3,J[1]=(_[1]+_[3]+_[5])/3,J[2]=(_[0]+_[2]+_[4])/3+1,J[3]=(_[1]+_[3]+_[5])/3+1):(J[2]=(_[0]+_[2]+_[4])/3,J[3]=(_[1]+_[3]+_[5])/3),t.redrawHint("select",!0),t.redraw();else if(U&&N.touches[1]&&!t.touchData.didSelect&&X.zoomingEnabled()&&X.panningEnabled()&&X.userZoomingEnabled()&&X.userPanningEnabled()){N.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var We=t.dragData.touchDragEles;if(We){t.redrawHint("drag",!0);for(var at=0;at0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var Q;t.registerBinding(e,"touchcancel",Q=function(N){var U=t.touchData.start;t.touchData.capture=!1,U&&U.unactivate()});var ne,ce,te,se;if(t.registerBinding(e,"touchend",ne=function(N){var U=t.touchData.start,J=t.touchData.capture;if(J)N.touches.length===0&&(t.touchData.capture=!1),N.preventDefault();else return;var X=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var _=t.cy,ae=_.zoom(),K=t.touchData.now,re=t.touchData.earlier;if(N.touches[0]){var ye=t.projectIntoViewport(N.touches[0].clientX,N.touches[0].clientY);K[0]=ye[0],K[1]=ye[1]}if(N.touches[1]){var ye=t.projectIntoViewport(N.touches[1].clientX,N.touches[1].clientY);K[2]=ye[0],K[3]=ye[1]}if(N.touches[2]){var ye=t.projectIntoViewport(N.touches[2].clientX,N.touches[2].clientY);K[4]=ye[0],K[5]=ye[1]}U&&U.unactivate();var me;if(t.touchData.cxt){if(me={originalEvent:N,type:"cxttapend",position:{x:K[0],y:K[1]}},U?U.emit(me):_.emit(me),!t.touchData.cxtDragged){var he={originalEvent:N,type:"cxttap",position:{x:K[0],y:K[1]}};U?U.emit(he):_.emit(he)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!N.touches[2]&&_.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Ee=_.collection(t.getAllInBox(X[0],X[1],X[2],X[3]));X[0]=void 0,X[1]=void 0,X[2]=void 0,X[3]=void 0,X[4]=0,t.redrawHint("select",!0),_.emit({type:"boxend",originalEvent:N,position:{x:K[0],y:K[1]}});var le=function(vt){return vt.selectable()&&!vt.selected()};Ee.emit("box").stdFilter(le).select().emit("boxselect"),Ee.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(U?.unactivate(),N.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!N.touches[1]){if(!N.touches[0]){if(!N.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var ge=t.dragData.touchDragEles;if(U!=null){var Fe=U._private.grabbed;p(ge),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Fe&&(U.emit("freeon"),ge.emit("free"),t.dragData.didDrag&&(U.emit("dragfreeon"),ge.emit("dragfree"))),a(U,["touchend","tapend","vmouseup","tapdragout"],N,{x:K[0],y:K[1]}),U.unactivate(),t.touchData.start=null}else{var Me=t.findNearestElement(K[0],K[1],!0,!0);a(Me,["touchend","tapend","vmouseup","tapdragout"],N,{x:K[0],y:K[1]})}var lt=t.touchData.startPosition[0]-K[0],Ze=lt*lt,Ue=t.touchData.startPosition[1]-K[1],ct=Ue*Ue,Qe=Ze+ct,ft=Qe*ae*ae;t.touchData.singleTouchMoved||(U||_.$(":selected").unselect(["tapunselect"]),a(U,["tap","vclick"],N,{x:K[0],y:K[1]}),ce=!1,N.timeStamp-se<=_.multiClickDebounceTime()?(te&&clearTimeout(te),ce=!0,se=null,a(U,["dbltap","vdblclick"],N,{x:K[0],y:K[1]})):(te=setTimeout(function(){ce||a(U,["onetap","voneclick"],N,{x:K[0],y:K[1]})},_.multiClickDebounceTime()),se=N.timeStamp)),U!=null&&!t.dragData.didDrag&&U._private.selectable&&ft"u"){var ue=[],ve=function(N){return{clientX:N.clientX,clientY:N.clientY,force:1,identifier:N.pointerId,pageX:N.pageX,pageY:N.pageY,radiusX:N.width/2,radiusY:N.height/2,screenX:N.screenX,screenY:N.screenY,target:N.target}},fe=function(N){return{event:N,touch:ve(N)}},pe=function(N){ue.push(fe(N))},Ae=function(N){for(var U=0;U0)return B[0]}return null},d=Object.keys(c),y=0;y0?v:Yo(i,s,e,r,a,n,o,l)},checkPoint:function(e,r,a,n,i,s,o,l){l=l==="auto"?mr(n,i):l;var u=2*l;if(Yt(e,r,this.points,s,o,n,i-u,[0,-1],a)||Yt(e,r,this.points,s,o,n-u,i,[0,-1],a))return!0;var f=n/2+2*a,h=i/2+2*a,c=[s-f,o-h,s-f,o,s+f,o,s+f,o-h];return!!(dt(e,r,c)||dr(e,r,u,u,s+n/2-l,o+i/2-l,a)||dr(e,r,u,u,s-n/2+l,o+i/2-l,a))}}};Xt.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",ht(3,0)),this.generateRoundPolygon("round-triangle",ht(3,0)),this.generatePolygon("rectangle",ht(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",ht(5,0)),this.generateRoundPolygon("round-pentagon",ht(5,0)),this.generatePolygon("hexagon",ht(6,0)),this.generateRoundPolygon("round-hexagon",ht(6,0)),this.generatePolygon("heptagon",ht(7,0)),this.generateRoundPolygon("round-heptagon",ht(7,0)),this.generatePolygon("octagon",ht(8,0)),this.generateRoundPolygon("round-octagon",ht(8,0));var a=new Array(20);{var n=Jn(5,0),i=Jn(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=e.deqFastCost*C)break}else if(u){if(m>=e.deqCost*v||m>=e.deqAvgCost*c)break}else if(b>=e.deqNoDrawCost*Kn)break;var E=e.deq(a,p,y);if(E.length>0)for(var w=0;w0&&(e.onDeqd(a,d),!u&&e.shouldRedraw(a,d,p,y)&&i())},o=e.priority||bi;n.beforeRender(s,o(a))}}}},up=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ln;di(this,t),this.idsByKey=new Bt,this.keyForId=new Bt,this.cachesByLvl=new Bt,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return gi(t,[{key:"getIdsFor",value:function(r){r==null&&ze("Can not get id list for null key");var a=this.idsByKey,n=this.idsByKey.get(r);return n||(n=new Ur,a.set(r,n)),n}},{key:"addIdForKey",value:function(r,a){r!=null&&this.getIdsFor(r).add(a)}},{key:"deleteIdForKey",value:function(r,a){r!=null&&this.getIdsFor(r).delete(a)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var a=r.id(),n=this.keyForId.get(a),i=this.getKey(r);this.deleteIdForKey(n,a),this.addIdForKey(i,a),this.keyForId.set(a,i)}},{key:"deleteKeyMappingFor",value:function(r){var a=r.id(),n=this.keyForId.get(a);this.deleteIdForKey(n,a),this.keyForId.delete(a)}},{key:"keyHasChangedFor",value:function(r){var a=r.id(),n=this.keyForId.get(a),i=this.getKey(r);return n!==i}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var a=this.cachesByLvl,n=this.lvls,i=a.get(r);return i||(i=new Bt,a.set(r,i),n.push(r)),i}},{key:"getCache",value:function(r,a){return this.getCachesAt(a).get(r)}},{key:"get",value:function(r,a){var n=this.getKey(r),i=this.getCache(n,a);return i!=null&&this.updateKeyMappingFor(r),i}},{key:"getForCachedKey",value:function(r,a){var n=this.keyForId.get(r.id()),i=this.getCache(n,a);return i}},{key:"hasCache",value:function(r,a){return this.getCachesAt(a).has(r)}},{key:"has",value:function(r,a){var n=this.getKey(r);return this.hasCache(n,a)}},{key:"setCache",value:function(r,a,n){n.key=r,this.getCachesAt(a).set(r,n)}},{key:"set",value:function(r,a,n){var i=this.getKey(r);this.setCache(i,a,n),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,a){this.getCachesAt(a).delete(r)}},{key:"delete",value:function(r,a){var n=this.getKey(r);this.deleteCache(n,a)}},{key:"invalidateKey",value:function(r){var a=this;this.lvls.forEach(function(n){return a.deleteCache(r,n)})}},{key:"invalidate",value:function(r){var a=r.id(),n=this.keyForId.get(a);this.deleteKeyMappingFor(r);var i=this.doesEleInvalidateKey(r);return i&&this.invalidateKey(n),i||this.getNumberOfIdsForKey(n)===0}}]),t}(),fo=25,Za=50,sn=-4,fi=3,lp=7.99,fp=8,hp=1024,cp=1024,vp=1024,dp=.2,gp=.8,pp=10,yp=.15,mp=.1,bp=.9,Ep=.9,wp=100,xp=1,Mr={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Tp=tt({getKey:null,doesEleInvalidateKey:ln,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Po,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),fa=function(e,r){var a=this;a.renderer=e,a.onDequeues=[];var n=Tp(r);be(a,n),a.lookup=new up(n.getKey,n.doesEleInvalidateKey),a.setupDequeueing()},Xe=fa.prototype;Xe.reasons=Mr;Xe.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};Xe.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},a=r[t]=r[t]||[];return a};Xe.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new La(function(r,a){return a.reqs-r.reqs});return e};Xe.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};Xe.getElement=function(t,e,r,a,n){var i=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!i.allowEdgeTxrCaching&&t.isEdge()||!i.allowParentTxrCaching&&t.isParent())return null;if(a==null&&(a=Math.ceil(wi(o*r))),a=lp||a>fi)return null;var u=Math.pow(2,a),f=e.h*u,h=e.w*u,c=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,c))return null;var v=l.get(t,a);if(v&&v.invalidated&&(v.invalidated=!1,v.texture.invalidatedWidth-=v.width),v)return v;var d;if(f<=fo?d=fo:f<=Za?d=Za:d=Math.ceil(f/Za)*Za,f>vp||h>cp)return null;var y=i.getTextureQueue(d),p=y[y.length-2],g=function(){return i.recycleTexture(d,h)||i.addTexture(d,h)};p||(p=y[y.length-1]),p||(p=g()),p.width-p.usedWidtha;A--)D=i.getElement(t,e,r,A,Mr.downscale);S()}else return i.queueElement(t,w.level-1),w;else{var L;if(!b&&!C&&!E)for(var I=a-1;I>=sn;I--){var O=l.get(t,I);if(O){L=O;break}}if(m(L))return i.queueElement(t,a),L;p.context.translate(p.usedWidth,0),p.context.scale(u,u),this.drawElement(p.context,t,e,c,!1),p.context.scale(1/u,1/u),p.context.translate(-p.usedWidth,0)}return v={x:p.usedWidth,texture:p,level:a,scale:u,width:h,height:f,scaledLabelShown:c},p.usedWidth+=Math.ceil(h+fp),p.eleCaches.push(v),l.set(t,a,v),i.checkTextureFullness(p),v};Xe.invalidateElements=function(t){for(var e=0;e=dp*t.width&&this.retireTexture(t)};Xe.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>gp&&t.fullnessChecks>=pp?rr(r,t):t.fullnessChecks++};Xe.retireTexture=function(t){var e=this,r=t.height,a=e.getTextureQueue(r),n=this.lookup;rr(a,t),t.retired=!0;for(var i=t.eleCaches,s=0;s=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,Ei(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),rr(n,s),a.push(s),s}};Xe.queueElement=function(t,e){var r=this,a=r.getElementQueue(),n=r.getElementKeyToQueue(),i=this.getKey(t),s=n[i];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,a.updateItem(s);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:i};a.push(o),n[i]=o}};Xe.dequeue=function(t){for(var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=[],i=e.lookup,s=0;s0;s++){var o=r.pop(),l=o.key,u=o.eles[0],f=i.hasCache(u,o.level);if(a[l]=null,f)continue;n.push(o);var h=e.getBoundingBox(u);e.getElement(u,h,t,o.level,Mr.dequeue)}return n};Xe.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=this.getKey(t),i=a[n];i!=null&&(i.eles.length===1?(i.reqs=mi,r.updateItem(i),r.pop(),a[n]=null):i.eles.unmerge(t))};Xe.onDequeue=function(t){this.onDequeues.push(t)};Xe.offDequeue=function(t){rr(this.onDequeues,t)};Xe.setupDequeueing=_u.setupDequeueing({deqRedrawThreshold:wp,deqCost:yp,deqAvgCost:mp,deqNoDrawCost:bp,deqFastCost:Ep,deq:function(e,r,a){return e.dequeue(r,a)},onDeqd:function(e,r){for(var a=0;a=Dp||r>yn)return null}a.validateLayersElesOrdering(r,t);var l=a.layersByLevel,u=Math.pow(2,r),f=l[r]=l[r]||[],h,c=a.levelIsComplete(r,t),v,d=function(){var S=function(k){if(a.validateLayersElesOrdering(k,t),a.levelIsComplete(k,t))return v=l[k],!0},A=function(k){if(!v)for(var R=r+k;ca<=R&&R<=yn&&!S(R);R+=k);};A(1),A(-1);for(var L=f.length-1;L>=0;L--){var I=f[L];I.invalid&&rr(f,I)}};if(!c)d();else return f;var y=function(){if(!h){h=gt();for(var S=0;SRp)return null;var I=a.makeLayer(h,r);if(A!=null){var O=f.indexOf(A)+1;f.splice(O,0,I)}else(S.insert===void 0||S.insert)&&f.unshift(I);return I};if(a.skipping&&!o)return null;for(var g=null,m=t.length/Cp,b=!o,C=0;C=m||!$o(g.bb,E.boundingBox()))&&(g=p({insert:!0,after:g}),!g))return null;v||b?a.queueLayer(g,E):a.drawEleInLayer(g,E,r,e),g.eles.push(E),x[r]=g}return v||(b?null:f)};rt.getEleLevelForLayerLevel=function(t,e){return t};rt.drawEleInLayer=function(t,e,r,a){var n=this,i=this.renderer,s=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=n.getEleLevelForLayerLevel(r,a),i.setImgSmoothing(s,!1),i.drawCachedElement(s,e,null,null,r,kp),i.setImgSmoothing(s,!0))};rt.levelIsComplete=function(t,e){var r=this,a=r.layersByLevel[t];if(!a||a.length===0)return!1;for(var n=0,i=0;i0||s.invalid)return!1;n+=s.eles.length}return n===e.length};rt.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var a=0;a0){e=!0;break}}return e};rt.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=$t(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(a,n,i){e.invalidateLayer(a)}))};rt.invalidateLayer=function(t){if(this.lastInvalidationTime=$t(),!t.invalid){var e=t.level,r=t.eles,a=this.layersByLevel[e];rr(a,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var n=0;n3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(i&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=i?e.pstyle("opacity").value:1,f=i?e.pstyle("line-opacity").value:1,h=e.pstyle("curve-style").value,c=e.pstyle("line-style").value,v=e.pstyle("width").pfValue,d=e.pstyle("line-cap").value,y=e.pstyle("line-outline-width").value,p=e.pstyle("line-outline-color").value,g=u*f,m=u*f,b=function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g;h==="straight-triangle"?(s.eleStrokeStyle(t,e,k),s.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=v,t.lineCap=d,s.eleStrokeStyle(t,e,k),s.drawEdgePath(e,t,o.allpts,c),t.lineCap="butt")},C=function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g;if(t.lineWidth=v+y,t.lineCap=d,y>0)s.colorStrokeStyle(t,p[0],p[1],p[2],k);else{t.lineCap="butt";return}h==="straight-triangle"?s.drawEdgeTrianglePath(e,t,o.allpts):(s.drawEdgePath(e,t,o.allpts,c),t.lineCap="butt")},E=function(){n&&s.drawEdgeOverlay(t,e)},w=function(){n&&s.drawEdgeUnderlay(t,e)},x=function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;s.drawArrowheads(t,e,k)},T=function(){s.drawElementText(t,e,null,a)};t.lineJoin="round";var D=e.pstyle("ghost").value==="yes";if(D){var S=e.pstyle("ghost-offset-x").pfValue,A=e.pstyle("ghost-offset-y").pfValue,L=e.pstyle("ghost-opacity").value,I=g*L;t.translate(S,A),b(I),x(I),t.translate(-S,-A)}else C();w(),b(),x(),E(),T(),r&&t.translate(l.x1,l.y1)}};var qu=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,a){if(a.visible()){var n=a.pstyle("".concat(e,"-opacity")).value;if(n!==0){var i=this,s=i.usePaths(),o=a._private.rscratch,l=a.pstyle("".concat(e,"-padding")).pfValue,u=2*l,f=a.pstyle("".concat(e,"-color")).value;r.lineWidth=u,o.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",i.colorStrokeStyle(r,f[0],f[1],f[2],n),i.drawEdgePath(a,r,o.allpts,"solid")}}}};qt.drawEdgeOverlay=qu("overlay");qt.drawEdgeUnderlay=qu("underlay");qt.drawEdgePath=function(t,e,r,a){var n=t._private.rscratch,i=e,s,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,f=t.pstyle("line-dash-offset").pfValue;if(l){var h=r.join("$"),c=n.pathCacheKey&&n.pathCacheKey===h;c?(s=e=n.pathCache,o=!0):(s=e=new Path2D,n.pathCacheKey=h,n.pathCache=s)}if(i.setLineDash)switch(a){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(u),i.lineDashOffset=f;break;case"solid":i.setLineDash([]);break}if(!o&&!n.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),n.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var v=2;v+35&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(a==null){if(i&&!s.eleTextBiggerThanMin(e))return}else if(a===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e);t.textAlign=l,t.textBaseline="bottom"}else{var u=e.element()._private.rscratch.badLine,f=e.pstyle("label"),h=e.pstyle("source-label"),c=e.pstyle("target-label");if(u||(!f||!f.value)&&(!h||!h.value)&&(!c||!c.value))return;t.textAlign="center",t.textBaseline="bottom"}var v=!r,d;r&&(d=r,t.translate(-d.x1,-d.y1)),n==null?(s.drawText(t,e,null,v,i),e.isEdge()&&(s.drawText(t,e,"source",v,i),s.drawText(t,e,"target",v,i))):s.drawText(t,e,n,v,i),r&&t.translate(d.x1,d.y1)};Tr.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!0,a=e.pstyle("font-style").strValue,n=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,f=e.pstyle("text-outline-color").value;t.font=a+" "+s+" "+n+" "+i,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,f[0],f[1],f[2],l)};function Qn(t,e,r,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=arguments.length>6?arguments[6]:void 0;t.beginPath(),t.moveTo(e+i,r),t.lineTo(e+a-i,r),t.quadraticCurveTo(e+a,r,e+a,r+i),t.lineTo(e+a,r+n-i),t.quadraticCurveTo(e+a,r+n,e+a-i,r+n),t.lineTo(e+i,r+n),t.quadraticCurveTo(e,r+n,e,r+n-i),t.lineTo(e,r+i),t.quadraticCurveTo(e,r,e+i,r),t.closePath(),s?t.stroke():t.fill()}Tr.getTextAngle=function(t,e){var r,a=t._private,n=a.rscratch,i=e?e+"-":"",s=t.pstyle(i+"text-rotation"),o=At(n,"labelAngle",e);return s.strValue==="autorotate"?r=t.isEdge()?o:0:s.strValue==="none"?r=0:r=s.pfValue,r};Tr.drawText=function(t,e,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,s=i.rscratch,o=n?e.effectiveOpacity():1;if(!(n&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=At(s,"labelX",r),u=At(s,"labelY",r),f,h,c=this.getLabelText(e,r);if(c!=null&&c!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,n);var v=r?r+"-":"",d=At(s,"labelWidth",r),y=At(s,"labelHeight",r),p=e.pstyle(v+"text-margin-x").pfValue,g=e.pstyle(v+"text-margin-y").pfValue,m=e.isEdge(),b=e.pstyle("text-halign").value,C=e.pstyle("text-valign").value;m&&(b="center",C="center"),l+=p,u+=g;var E;switch(a?E=this.getTextAngle(e,r):E=0,E!==0&&(f=l,h=u,t.translate(f,h),t.rotate(E),l=0,u=0),C){case"top":break;case"center":u+=y/2;break;case"bottom":u+=y;break}var w=e.pstyle("text-background-opacity").value,x=e.pstyle("text-border-opacity").value,T=e.pstyle("text-border-width").pfValue,D=e.pstyle("text-background-padding").pfValue,S=e.pstyle("text-background-shape").strValue,A=S.indexOf("round")===0,L=2;if(w>0||T>0&&x>0){var I=l-D;switch(b){case"left":I-=d;break;case"center":I-=d/2;break}var O=u-y-D,k=d+2*D,R=y+2*D;if(w>0){var M=t.fillStyle,P=e.pstyle("text-background-color").value;t.fillStyle="rgba("+P[0]+","+P[1]+","+P[2]+","+w*o+")",A?Qn(t,I,O,k,R,L):t.fillRect(I,O,k,R),t.fillStyle=M}if(T>0&&x>0){var F=t.strokeStyle,V=t.lineWidth,G=e.pstyle("text-border-color").value,B=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+G[0]+","+G[1]+","+G[2]+","+x*o+")",t.lineWidth=T,t.setLineDash)switch(B){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=T/4,t.setLineDash([]);break;case"solid":t.setLineDash([]);break}if(A?Qn(t,I,O,k,R,L,"stroke"):t.strokeRect(I,O,k,R),B==="double"){var $=T/2;A?Qn(t,I+$,O+$,k-$*2,R-$*2,L,"stroke"):t.strokeRect(I+$,O+$,k-$*2,R-$*2)}t.setLineDash&&t.setLineDash([]),t.lineWidth=V,t.strokeStyle=F}}var q=2*e.pstyle("text-outline-width").pfValue;if(q>0&&(t.lineWidth=q),e.pstyle("text-wrap").value==="wrap"){var Z=At(s,"labelWrapCachedLines",r),W=At(s,"labelLineHeight",r),ee=d/2,Y=this.getLabelJustification(e);switch(Y==="auto"||(b==="left"?Y==="left"?l+=-d:Y==="center"&&(l+=-ee):b==="center"?Y==="left"?l+=-ee:Y==="right"&&(l+=ee):b==="right"&&(Y==="center"?l+=ee:Y==="right"&&(l+=d))),C){case"top":u-=(Z.length-1)*W;break;case"center":case"bottom":u-=(Z.length-1)*W;break}for(var z=0;z0&&t.strokeText(Z[z],l,u),t.fillText(Z[z],l,u),u+=W}else q>0&&t.strokeText(c,l,u),t.fillText(c,l,u);E!==0&&(t.rotate(-E),t.translate(-f,-h))}}};var Zr={};Zr.drawNode=function(t,e,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,u=e._private,f=u.rscratch,h=e.position();if(!(!ie(h.x)||!ie(h.y))&&!(i&&!e.visible())){var c=i?e.effectiveOpacity():1,v=s.usePaths(),d,y=!1,p=e.padding();o=e.width()+2*p,l=e.height()+2*p;var g;r&&(g=r,t.translate(-g.x1,-g.y1));for(var m=e.pstyle("background-image"),b=m.value,C=new Array(b.length),E=new Array(b.length),w=0,x=0;x0&&arguments[0]!==void 0?arguments[0]:I;s.eleFillStyle(t,e,ae)},z=function(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G;s.colorStrokeStyle(t,O[0],O[1],O[2],ae)},H=function(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Z;s.colorStrokeStyle(t,$[0],$[1],$[2],ae)},Q=function(ae,K,re,ye){var me=s.nodePathCache=s.nodePathCache||[],he=ko(re==="polygon"?re+","+ye.join(","):re,""+K,""+ae,""+ee),Ee=me[he],le,ge=!1;return Ee!=null?(le=Ee,ge=!0,f.pathCache=le):(le=new Path2D,me[he]=f.pathCache=le),{path:le,cacheHit:ge}},ne=e.pstyle("shape").strValue,ce=e.pstyle("shape-polygon-points").pfValue;if(v){t.translate(h.x,h.y);var te=Q(o,l,ne,ce);d=te.path,y=te.cacheHit}var se=function(){if(!y){var ae=h;v&&(ae={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(d||t,ae.x,ae.y,o,l,ee,f)}v?t.fill(d):t.fill()},ue=function(){for(var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c,K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,re=u.backgrounding,ye=0,me=0;me0&&arguments[0]!==void 0?arguments[0]:!1,K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;s.hasPie(e)&&(s.drawPie(t,e,K),ae&&(v||s.nodeShapes[s.getNodeShape(e)].draw(t,h.x,h.y,o,l,ee,f)))},fe=function(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c,K=(A>0?A:-A)*ae,re=A>0?0:255;A!==0&&(s.colorFillStyle(t,re,re,re,K),v?t.fill(d):t.fill())},pe=function(){if(L>0){if(t.lineWidth=L,t.lineCap=M,t.lineJoin=R,t.setLineDash)switch(k){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(F),t.lineDashOffset=V;break;case"solid":case"double":t.setLineDash([]);break}if(P!=="center"){if(t.save(),t.lineWidth*=2,P==="inside")v?t.clip(d):t.clip();else{var ae=new Path2D;ae.rect(-o/2-L,-l/2-L,o+2*L,l+2*L),ae.addPath(d),t.clip(ae,"evenodd")}v?t.stroke(d):t.stroke(),t.restore()}else v?t.stroke(d):t.stroke();if(k==="double"){t.lineWidth=L/3;var K=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(d):t.stroke(),t.globalCompositeOperation=K}t.setLineDash&&t.setLineDash([])}},Ae=function(){if(B>0){if(t.lineWidth=B,t.lineCap="butt",t.setLineDash)switch(q){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var ae=h;v&&(ae={x:0,y:0});var K=s.getNodeShape(e),re=L;P==="inside"&&(re=0),P==="outside"&&(re*=2);var ye=(o+re+(B+W))/o,me=(l+re+(B+W))/l,he=o*ye,Ee=l*me,le=s.nodeShapes[K].points,ge;if(v){var Fe=Q(he,Ee,K,le);ge=Fe.path}if(K==="ellipse")s.drawEllipsePath(ge||t,ae.x,ae.y,he,Ee);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(K)){var Me=0,lt=0,Ze=0;K==="round-diamond"?Me=(re+W+B)*1.4:K==="round-heptagon"?(Me=(re+W+B)*1.075,Ze=-(re/2+W+B)/35):K==="round-hexagon"?Me=(re+W+B)*1.12:K==="round-pentagon"?(Me=(re+W+B)*1.13,Ze=-(re/2+W+B)/15):K==="round-tag"?(Me=(re+W+B)*1.12,lt=(re/2+B+W)*.07):K==="round-triangle"&&(Me=(re+W+B)*(Math.PI/2),Ze=-(re+W/2+B)/Math.PI),Me!==0&&(ye=(o+Me)/o,he=o*ye,["round-hexagon","round-tag"].includes(K)||(me=(l+Me)/l,Ee=l*me)),ee=ee==="auto"?Ho(he,Ee):ee;for(var Ue=he/2,ct=Ee/2,Qe=ee+(re+B+W)/2,ft=new Array(le.length/2),xt=new Array(le.length/2),mt=0;mt0){if(n=n||a.position(),i==null||s==null){var v=a.padding();i=a.width()+2*v,s=a.height()+2*v}o.colorFillStyle(r,f[0],f[1],f[2],u),o.nodeShapes[h].draw(r,n.x,n.y,i+l*2,s+l*2,c),r.fill()}}}};Zr.drawNodeOverlay=Wu("overlay");Zr.drawNodeUnderlay=Wu("underlay");Zr.hasPie=function(t){return t=t[0],t._private.hasPie};Zr.drawPie=function(t,e,r,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=e.pstyle("pie-size"),s=a.x,o=a.y,l=e.width(),u=e.height(),f=Math.min(l,u)/2,h=0,c=this.usePaths();c&&(s=0,o=0),i.units==="%"?f=f*i.pfValue:i.pfValue!==void 0&&(f=i.pfValue/2);for(var v=1;v<=n.pieBackgroundN;v++){var d=e.pstyle("pie-"+v+"-background-size").value,y=e.pstyle("pie-"+v+"-background-color").value,p=e.pstyle("pie-"+v+"-background-opacity").value*r,g=d/100;g+h>1&&(g=1-h);var m=1.5*Math.PI+2*Math.PI*h,b=2*Math.PI*g,C=m+b;d===0||h>=1||h+g>1||(t.beginPath(),t.moveTo(s,o),t.arc(s,o,f,m,C),t.closePath(),this.colorFillStyle(t,y[0],y[1],y[2],p),t.fill(),h+=g)}};var yt={},Hp=100;yt.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r};yt.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,a,n=0;ns.minMbLowQualFrames&&(s.motionBlurPxRatio=s.mbPxRBlurry)),s.clearingMotionBlur&&(s.motionBlurPxRatio=1),s.textureDrawLastFrame&&!h&&(f[s.NODE]=!0,f[s.SELECT_BOX]=!0);var m=l.style(),b=l.zoom(),C=n!==void 0?n:b,E=l.pan(),w={x:E.x,y:E.y},x={zoom:b,pan:{x:E.x,y:E.y}},T=s.prevViewport,D=T===void 0||x.zoom!==T.zoom||x.pan.x!==T.pan.x||x.pan.y!==T.pan.y;!D&&!(y&&!d)&&(s.motionBlurPxRatio=1),i&&(w=i),C*=o,w.x*=o,w.y*=o;var S=s.getCachedZSortedEles();function A(te,se,ue,ve,fe){var pe=te.globalCompositeOperation;te.globalCompositeOperation="destination-out",s.colorFillStyle(te,255,255,255,s.motionBlurTransparency),te.fillRect(se,ue,ve,fe),te.globalCompositeOperation=pe}function L(te,se){var ue,ve,fe,pe;!s.clearingMotionBlur&&(te===u.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]||te===u.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG])?(ue={x:E.x*v,y:E.y*v},ve=b*v,fe=s.canvasWidth*v,pe=s.canvasHeight*v):(ue=w,ve=C,fe=s.canvasWidth,pe=s.canvasHeight),te.setTransform(1,0,0,1,0,0),se==="motionBlur"?A(te,0,0,fe,pe):!e&&(se===void 0||se)&&te.clearRect(0,0,fe,pe),r||(te.translate(ue.x,ue.y),te.scale(ve,ve)),i&&te.translate(i.x,i.y),n&&te.scale(n,n)}if(h||(s.textureDrawLastFrame=!1),h){if(s.textureDrawLastFrame=!0,!s.textureCache){s.textureCache={},s.textureCache.bb=l.mutableElements().boundingBox(),s.textureCache.texture=s.data.bufferCanvases[s.TEXTURE_BUFFER];var I=s.data.bufferContexts[s.TEXTURE_BUFFER];I.setTransform(1,0,0,1,0,0),I.clearRect(0,0,s.canvasWidth*s.textureMult,s.canvasHeight*s.textureMult),s.render({forcedContext:I,drawOnlyNodeLayer:!0,forcedPxRatio:o*s.textureMult});var x=s.textureCache.viewport={zoom:l.zoom(),pan:l.pan(),width:s.canvasWidth,height:s.canvasHeight};x.mpan={x:(0-x.pan.x)/x.zoom,y:(0-x.pan.y)/x.zoom}}f[s.DRAG]=!1,f[s.NODE]=!1;var O=u.contexts[s.NODE],k=s.textureCache.texture,x=s.textureCache.viewport;O.setTransform(1,0,0,1,0,0),c?A(O,0,0,x.width,x.height):O.clearRect(0,0,x.width,x.height);var R=m.core("outside-texture-bg-color").value,M=m.core("outside-texture-bg-opacity").value;s.colorFillStyle(O,R[0],R[1],R[2],M),O.fillRect(0,0,x.width,x.height);var b=l.zoom();L(O,!1),O.clearRect(x.mpan.x,x.mpan.y,x.width/x.zoom/o,x.height/x.zoom/o),O.drawImage(k,x.mpan.x,x.mpan.y,x.width/x.zoom/o,x.height/x.zoom/o)}else s.textureOnViewport&&!e&&(s.textureCache=null);var P=l.extent(),F=s.pinching||s.hoverData.dragging||s.swipePanning||s.data.wheelZooming||s.hoverData.draggingEles||s.cy.animated(),V=s.hideEdgesOnViewport&&F,G=[];if(G[s.NODE]=!f[s.NODE]&&c&&!s.clearedForMotionBlur[s.NODE]||s.clearingMotionBlur,G[s.NODE]&&(s.clearedForMotionBlur[s.NODE]=!0),G[s.DRAG]=!f[s.DRAG]&&c&&!s.clearedForMotionBlur[s.DRAG]||s.clearingMotionBlur,G[s.DRAG]&&(s.clearedForMotionBlur[s.DRAG]=!0),f[s.NODE]||r||a||G[s.NODE]){var B=c&&!G[s.NODE]&&v!==1,O=e||(B?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]:u.contexts[s.NODE]),$=c&&!B?"motionBlur":void 0;L(O,$),V?s.drawCachedNodes(O,S.nondrag,o,P):s.drawLayeredElements(O,S.nondrag,o,P),s.debug&&s.drawDebugPoints(O,S.nondrag),!r&&!c&&(f[s.NODE]=!1)}if(!a&&(f[s.DRAG]||r||G[s.DRAG])){var B=c&&!G[s.DRAG]&&v!==1,O=e||(B?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG]:u.contexts[s.DRAG]);L(O,c&&!B?"motionBlur":void 0),V?s.drawCachedNodes(O,S.drag,o,P):s.drawCachedElements(O,S.drag,o,P),s.debug&&s.drawDebugPoints(O,S.drag),!r&&!c&&(f[s.DRAG]=!1)}if(s.showFps||!a&&f[s.SELECT_BOX]&&!r){var O=e||u.contexts[s.SELECT_BOX];if(L(O),s.selection[4]==1&&(s.hoverData.selecting||s.touchData.selecting)){var b=s.cy.zoom(),q=m.core("selection-box-border-width").value/b;O.lineWidth=q,O.fillStyle="rgba("+m.core("selection-box-color").value[0]+","+m.core("selection-box-color").value[1]+","+m.core("selection-box-color").value[2]+","+m.core("selection-box-opacity").value+")",O.fillRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]),q>0&&(O.strokeStyle="rgba("+m.core("selection-box-border-color").value[0]+","+m.core("selection-box-border-color").value[1]+","+m.core("selection-box-border-color").value[2]+","+m.core("selection-box-opacity").value+")",O.strokeRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]))}if(u.bgActivePosistion&&!s.hoverData.selecting){var b=s.cy.zoom(),Z=u.bgActivePosistion;O.fillStyle="rgba("+m.core("active-bg-color").value[0]+","+m.core("active-bg-color").value[1]+","+m.core("active-bg-color").value[2]+","+m.core("active-bg-opacity").value+")",O.beginPath(),O.arc(Z.x,Z.y,m.core("active-bg-size").pfValue/b,0,2*Math.PI),O.fill()}var W=s.lastRedrawTime;if(s.showFps&&W){W=Math.round(W);var ee=Math.round(1e3/W);O.setTransform(1,0,0,1,0,0),O.fillStyle="rgba(255, 0, 0, 0.75)",O.strokeStyle="rgba(255, 0, 0, 0.75)",O.lineWidth=1,O.fillText("1 frame = "+W+" ms = "+ee+" fps",0,20);var Y=60;O.strokeRect(0,30,250,20),O.fillRect(0,30,250*Math.min(ee/Y,1),20)}r||(f[s.SELECT_BOX]=!1)}if(c&&v!==1){var z=u.contexts[s.NODE],H=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_NODE],Q=u.contexts[s.DRAG],ne=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_DRAG],ce=function(se,ue,ve){se.setTransform(1,0,0,1,0,0),ve||!g?se.clearRect(0,0,s.canvasWidth,s.canvasHeight):A(se,0,0,s.canvasWidth,s.canvasHeight);var fe=v;se.drawImage(ue,0,0,s.canvasWidth*fe,s.canvasHeight*fe,0,0,s.canvasWidth,s.canvasHeight)};(f[s.NODE]||G[s.NODE])&&(ce(z,H,G[s.NODE]),f[s.NODE]=!1),(f[s.DRAG]||G[s.DRAG])&&(ce(Q,ne,G[s.DRAG]),f[s.DRAG]=!1)}s.prevViewport=x,s.clearingMotionBlur&&(s.clearingMotionBlur=!1,s.motionBlurCleared=!0,s.motionBlur=!0),c&&(s.motionBlurTimeout=setTimeout(function(){s.motionBlurTimeout=null,s.clearedForMotionBlur[s.NODE]=!1,s.clearedForMotionBlur[s.DRAG]=!1,s.motionBlur=!1,s.clearingMotionBlur=!h,s.mbFrames=0,f[s.NODE]=!0,f[s.DRAG]=!0,s.redraw()},Hp)),e||l.emit("render")};var or={};or.drawPolygonPath=function(t,e,r,a,n,i){var s=a/2,o=n/2;t.beginPath&&t.beginPath(),t.moveTo(e+s*i[0],r+o*i[1]);for(var l=1;l0&&s>0){v.clearRect(0,0,i,s),v.globalCompositeOperation="source-over";var d=this.getCachedZSortedEles();if(t.full)v.translate(-a.x1*u,-a.y1*u),v.scale(u,u),this.drawElements(v,d),v.scale(1/u,1/u),v.translate(a.x1*u,a.y1*u);else{var y=e.pan(),p={x:y.x*u,y:y.y*u};u*=e.zoom(),v.translate(p.x,p.y),v.scale(u,u),this.drawElements(v,d),v.scale(1/u,1/u),v.translate(-p.x,-p.y)}t.bg&&(v.globalCompositeOperation="destination-over",v.fillStyle=t.bg,v.rect(0,0,i,s),v.fill())}return c};function Xp(t,e){for(var r=atob(t),a=new ArrayBuffer(r.length),n=new Uint8Array(a),i=0;i"u"?"undefined":He(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var a=this.cy.window(),n=a.document;r=n.createElement("canvas"),r.width=t,r.height=e}return r};[Xu,zt,qt,Fi,Tr,Zr,yt,or,Ma,Qu].forEach(function(t){be(Se,t)});var Kp=[{name:"null",impl:Ru},{name:"base",impl:Yu},{name:"canvas",impl:qp}],Zp=[{type:"layout",extensions:rp},{type:"renderer",extensions:Kp}],ju={},el={};function tl(t,e,r){var a=r,n=function(T){Ne("Can not register `"+e+"` for `"+t+"` since `"+T+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(Ta.prototype[e])return n(e);Ta.prototype[e]=r}else if(t==="collection"){if(et.prototype[e])return n(e);et.prototype[e]=r}else if(t==="layout"){for(var i=function(T){this.options=T,r.call(this,T),Ce(this._private)||(this._private={}),this._private.cy=T.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(r.prototype),o=[],l=0;l"u"&&(P.yylloc={});var G=P.yylloc;S.push(G);var B=P.options&&P.options.ranges;typeof F.yy.parseError=="function"?this.parseError=F.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function $(){var te;return te=T.pop()||P.lex()||R,typeof te!="number"&&(te instanceof Array&&(T=te,te=T.pop()),te=w.symbols_[te]||te),te}for(var q,Z,W,ee,Y={},z,H,Q,ne;;){if(Z=x[x.length-1],this.defaultActions[Z]?W=this.defaultActions[Z]:((q===null||typeof q>"u")&&(q=$()),W=A[Z]&&A[Z][q]),typeof W>"u"||!W.length||!W[0]){var ce="";ne=[];for(z in A[Z])this.terminals_[z]&&z>k&&ne.push("'"+this.terminals_[z]+"'");P.showPosition?ce="Parse error on line "+(I+1)+`:
+`+P.showPosition()+`
+Expecting `+ne.join(", ")+", got '"+(this.terminals_[q]||q)+"'":ce="Parse error on line "+(I+1)+": Unexpected "+(q==R?"end of input":"'"+(this.terminals_[q]||q)+"'"),this.parseError(ce,{text:P.match,token:this.terminals_[q]||q,line:P.yylineno,loc:G,expected:ne})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Z+", token: "+q);switch(W[0]){case 1:x.push(q),D.push(P.yytext),S.push(P.yylloc),x.push(W[1]),q=null,O=P.yyleng,L=P.yytext,I=P.yylineno,G=P.yylloc;break;case 2:if(H=this.productions_[W[1]][1],Y.$=D[D.length-H],Y._$={first_line:S[S.length-(H||1)].first_line,last_line:S[S.length-1].last_line,first_column:S[S.length-(H||1)].first_column,last_column:S[S.length-1].last_column},B&&(Y._$.range=[S[S.length-(H||1)].range[0],S[S.length-1].range[1]]),ee=this.performAction.apply(Y,[L,O,I,F.yy,W[1],D,S].concat(M)),typeof ee<"u")return ee;H&&(x=x.slice(0,-1*H*2),D=D.slice(0,-1*H),S=S.slice(0,-1*H)),x.push(this.productions_[W[1]][0]),D.push(Y.$),S.push(Y._$),Q=A[x[x.length-2]][x[x.length-1]],x.push(Q);break;case 3:return!0}}return!0}},m=function(){var C={EOF:1,parseError:function(w,x){if(this.yy.parser)this.yy.parser.parseError(w,x);else throw new Error(w)},setInput:function(E,w){return this.yy=w||this.yy||{},this._input=E,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var E=this._input[0];this.yytext+=E,this.yyleng++,this.offset++,this.match+=E,this.matched+=E;var w=E.match(/(?:\r\n?|\n).*/g);return w?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),E},unput:function(E){var w=E.length,x=E.split(/(?:\r\n?|\n)/g);this._input=E+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-w),this.offset-=w;var T=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),x.length-1&&(this.yylineno-=x.length-1);var D=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:x?(x.length===T.length?this.yylloc.first_column:0)+T[T.length-x.length].length-x[0].length:this.yylloc.first_column-w},this.options.ranges&&(this.yylloc.range=[D[0],D[0]+this.yyleng-w]),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(E){this.unput(this.match.slice(E))},pastInput:function(){var E=this.matched.substr(0,this.matched.length-this.match.length);return(E.length>20?"...":"")+E.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var E=this.match;return E.length<20&&(E+=this._input.substr(0,20-E.length)),(E.substr(0,20)+(E.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var E=this.pastInput(),w=new Array(E.length+1).join("-");return E+this.upcomingInput()+`
+`+w+"^"},test_match:function(E,w){var x,T,D;if(this.options.backtrack_lexer&&(D={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&&(D.yylloc.range=this.yylloc.range.slice(0))),T=E[0].match(/(?:\r\n?|\n).*/g),T&&(this.yylineno+=T.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:T?T[T.length-1].length-T[T.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+E[0].length},this.yytext+=E[0],this.match+=E[0],this.matches=E,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(E[0].length),this.matched+=E[0],x=this.performAction.call(this,this.yy,this,w,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var S in D)this[S]=D[S];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var E,w,x,T;this._more||(this.yytext="",this.match="");for(var D=this._currentRules(),S=0;Sw[0].length)){if(w=x,T=S,this.options.backtrack_lexer){if(E=this.test_match(x,D[S]),E!==!1)return E;if(this._backtrack){w=!1;continue}else return!1}else if(!this.options.flex)break}return w?(E=this.test_match(w,D[T]),E!==!1?E:!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 w=this.next();return w||this.lex()},begin:function(w){this.conditionStack.push(w)},popState:function(){var w=this.conditionStack.length-1;return w>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(w){return w=this.conditionStack.length-1-Math.abs(w||0),w>=0?this.conditionStack[w]:"INITIAL"},pushState:function(w){this.begin(w)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(w,x,T,D){switch(T){case 0:return w.getLogger().trace("Found comment",x.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:w.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return w.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:w.getLogger().trace("end icon"),this.popState();break;case 10:return w.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return w.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return w.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return w.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:w.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return w.getLogger().trace("description:",x.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),w.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),w.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),w.getLogger().trace("node end ...",x.yytext),"NODE_DEND";case 30:return this.popState(),w.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),w.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),w.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),w.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),w.getLogger().trace("node end (("),"NODE_DEND";case 35:return w.getLogger().trace("Long description:",x.yytext),20;case 36:return w.getLogger().trace("Long description:",x.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 C}();g.lexer=m;function b(){this.yy={}}return b.prototype=g,g.Parser=b,new b}();Yi.parser=Yi;var ey=Yi,Nt=[],sl=0,_i={},ty=()=>{Nt=[],sl=0,_i={}},ry=function(t){for(let e=Nt.length-1;e>=0;e--)if(Nt[e].levelNt.length>0?Nt[0]:null,ny=(t,e,r,a)=>{var n,i;Wt.info("addNode",t,e,r,a);let s=Ga(),o=((n=s.mindmap)==null?void 0:n.padding)??ea.mindmap.padding;switch(a){case qe.ROUNDED_RECT:case qe.RECT:case qe.HEXAGON:o*=2}let l={id:sl++,nodeId:jr(e,s),level:t,descr:jr(r,s),type:a,children:[],width:((i=s.mindmap)==null?void 0:i.maxNodeWidth)??ea.mindmap.maxNodeWidth,padding:o},u=ry(t);if(u)u.children.push(l),Nt.push(l);else if(Nt.length===0)Nt.push(l);else throw new Error('There can be only one root. No parent could be found for ("'+l.descr+'")')},qe={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},iy=(t,e)=>{switch(Wt.debug("In get type",t,e),t){case"[":return qe.RECT;case"(":return e===")"?qe.ROUNDED_RECT:qe.CLOUD;case"((":return qe.CIRCLE;case")":return qe.CLOUD;case"))":return qe.BANG;case"{{":return qe.HEXAGON;default:return qe.DEFAULT}},sy=(t,e)=>{_i[t]=e},oy=t=>{if(!t)return;let e=Ga(),r=Nt[Nt.length-1];t.icon&&(r.icon=jr(t.icon,e)),t.class&&(r.class=jr(t.class,e))},uy=t=>{switch(t){case qe.DEFAULT:return"no-border";case qe.RECT:return"rect";case qe.ROUNDED_RECT:return"rounded-rect";case qe.CIRCLE:return"circle";case qe.CLOUD:return"cloud";case qe.BANG:return"bang";case qe.HEXAGON:return"hexgon";default:return"no-border"}},ly=()=>Wt,fy=t=>_i[t],hy={clear:ty,addNode:ny,getMindmap:ay,nodeType:qe,getType:iy,setElementForId:sy,decorateNode:oy,type2Str:uy,getLogger:ly,getElementById:fy},cy=hy,vy=12,dy=function(t,e,r,a){e.append("path").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("d",`M0 ${r.height-5} v${-r.height+2*5} q0,-5 5,-5 h${r.width-2*5} q5,0 5,5 v${r.height-5} H0 Z`),e.append("line").attr("class","node-line-"+a).attr("x1",0).attr("y1",r.height).attr("x2",r.width).attr("y2",r.height)},gy=function(t,e,r){e.append("rect").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("height",r.height).attr("width",r.width)},py=function(t,e,r){let a=r.width,n=r.height,i=.15*a,s=.25*a,o=.35*a,l=.2*a;e.append("path").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("d",`M0 0 a${i},${i} 0 0,1 ${a*.25},${-1*a*.1}
+ a${o},${o} 1 0,1 ${a*.4},${-1*a*.1}
+ a${s},${s} 1 0,1 ${a*.35},${1*a*.2}
+
+ a${i},${i} 1 0,1 ${a*.15},${1*n*.35}
+ a${l},${l} 1 0,1 ${-1*a*.15},${1*n*.65}
+
+ a${s},${i} 1 0,1 ${-1*a*.25},${a*.15}
+ a${o},${o} 1 0,1 ${-1*a*.5},0
+ a${i},${i} 1 0,1 ${-1*a*.25},${-1*a*.15}
+
+ a${i},${i} 1 0,1 ${-1*a*.1},${-1*n*.35}
+ a${l},${l} 1 0,1 ${a*.1},${-1*n*.65}
+
+ H0 V0 Z`)},yy=function(t,e,r){let a=r.width,n=r.height,i=.15*a;e.append("path").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("d",`M0 0 a${i},${i} 1 0,0 ${a*.25},${-1*n*.1}
+ a${i},${i} 1 0,0 ${a*.25},0
+ a${i},${i} 1 0,0 ${a*.25},0
+ a${i},${i} 1 0,0 ${a*.25},${1*n*.1}
+
+ a${i},${i} 1 0,0 ${a*.15},${1*n*.33}
+ a${i*.8},${i*.8} 1 0,0 0,${1*n*.34}
+ a${i},${i} 1 0,0 ${-1*a*.15},${1*n*.33}
+
+ a${i},${i} 1 0,0 ${-1*a*.25},${n*.15}
+ a${i},${i} 1 0,0 ${-1*a*.25},0
+ a${i},${i} 1 0,0 ${-1*a*.25},0
+ a${i},${i} 1 0,0 ${-1*a*.25},${-1*n*.15}
+
+ a${i},${i} 1 0,0 ${-1*a*.1},${-1*n*.33}
+ a${i*.8},${i*.8} 1 0,0 0,${-1*n*.34}
+ a${i},${i} 1 0,0 ${a*.1},${-1*n*.33}
+
+ H0 V0 Z`)},my=function(t,e,r){e.append("circle").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("r",r.width/2)};function by(t,e,r,a,n){return t.insert("polygon",":first-child").attr("points",a.map(function(i){return i.x+","+i.y}).join(" ")).attr("transform","translate("+(n.width-e)/2+", "+r+")")}var Ey=function(t,e,r){let a=r.height,i=a/4,s=r.width-r.padding+2*i,o=[{x:i,y:0},{x:s-i,y:0},{x:s,y:-a/2},{x:s-i,y:-a},{x:i,y:-a},{x:0,y:-a/2}];by(e,s,a,o,r)},wy=function(t,e,r){e.append("rect").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("height",r.height).attr("rx",r.padding).attr("ry",r.padding).attr("width",r.width)},xy=function(t,e,r,a,n){let i=n.htmlLabels,s=a%(vy-1),o=e.append("g");r.section=s;let l="section-"+s;s<0&&(l+=" section-root"),o.attr("class",(r.class?r.class+" ":"")+"mindmap-node "+l);let u=o.append("g"),f=o.append("g"),h=r.descr.replace(/(
)/g,`
+`);es(f,h,{useHtmlLabels:i,width:r.width,classes:"mindmap-node-label"}),i||f.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");let c=f.node().getBBox(),[v]=ts(n.fontSize);if(r.height=c.height+v*1.1*.5+r.padding,r.width=c.width+2*r.padding,r.icon)if(r.type===t.nodeType.CIRCLE)r.height+=50,r.width+=50,o.append("foreignObject").attr("height","50px").attr("width",r.width).attr("style","text-align: center;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+s+" "+r.icon),f.attr("transform","translate("+r.width/2+", "+(r.height/2-1.5*r.padding)+")");else{r.width+=50;let d=r.height;r.height=Math.max(d,60);let y=Math.abs(r.height-d);o.append("foreignObject").attr("width","60px").attr("height",r.height).attr("style","text-align: center;margin-top:"+y/2+"px;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+s+" "+r.icon),f.attr("transform","translate("+(25+r.width/2)+", "+(y/2+r.padding/2)+")")}else if(i){let d=(r.width-c.width)/2,y=(r.height-c.height)/2;f.attr("transform","translate("+d+", "+y+")")}else{let d=r.width/2,y=r.padding/2;f.attr("transform","translate("+d+", "+y+")")}switch(r.type){case t.nodeType.DEFAULT:dy(t,u,r,s);break;case t.nodeType.ROUNDED_RECT:wy(t,u,r);break;case t.nodeType.RECT:gy(t,u,r);break;case t.nodeType.CIRCLE:u.attr("transform","translate("+r.width/2+", "+ +r.height/2+")"),my(t,u,r);break;case t.nodeType.CLOUD:py(t,u,r);break;case t.nodeType.BANG:yy(t,u,r);break;case t.nodeType.HEXAGON:Ey(t,u,r);break}return t.setElementForId(r.id,o),r.height},Ty=function(t,e){let r=t.getElementById(e.id),a=e.x||0,n=e.y||0;r.attr("transform","translate("+a+","+n+")")};Ht.use(il.default);function ol(t,e,r,a,n){xy(t,e,r,a,n),r.children&&r.children.forEach((i,s)=>{ol(t,e,i,a<0?s:a,n)})}function Cy(t,e){e.edges().map((r,a)=>{let n=r.data();if(r[0]._private.bodyBounds){let i=r[0]._private.rscratch;Wt.trace("Edge: ",a,n),t.insert("path").attr("d",`M ${i.startX},${i.startY} L ${i.midX},${i.midY} L${i.endX},${i.endY} `).attr("class","edge section-edge-"+n.section+" edge-depth-"+n.depth)}})}function ul(t,e,r,a){e.add({group:"nodes",data:{id:t.id.toString(),labelText:t.descr,height:t.height,width:t.width,level:a,nodeId:t.id,padding:t.padding,type:t.type},position:{x:t.x,y:t.y}}),t.children&&t.children.forEach(n=>{ul(n,e,r,a+1),e.add({group:"edges",data:{id:`${t.id}_${n.id}`,source:t.id,target:n.id,depth:a,section:n.section}})})}function Dy(t,e){return new Promise(r=>{let a=Zi("body").append("div").attr("id","cy").attr("style","display:none"),n=Ht({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});a.remove(),ul(t,n,e,0),n.nodes().forEach(function(i){i.layoutDimensions=()=>{let s=i.data();return{w:s.width,h:s.height}}}),n.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),n.ready(i=>{Wt.info("Ready",i),r(n)})})}function Sy(t,e){e.nodes().map((r,a)=>{let n=r.data();n.x=r.position().x,n.y=r.position().y,Ty(t,n);let i=t.getElementById(n.nodeId);Wt.info("Id:",a,"Position: (",r.position().x,", ",r.position().y,")",n),i.attr("transform",`translate(${r.position().x-n.width/2}, ${r.position().y-n.height/2})`),i.attr("attr",`apa-${a})`)})}var Ly=(t,e,r,a)=>Ki(void 0,null,function*(){var n,i;Wt.debug(`Rendering mindmap diagram
+`+t);let s=a.db,o=s.getMindmap();if(!o)return;let l=Ga();l.htmlLabels=!1;let u=as(e),f=u.append("g");f.attr("class","mindmap-edges");let h=u.append("g");h.attr("class","mindmap-nodes"),ol(s,h,o,-1,l);let c=yield Dy(o,l);Cy(f,c),Sy(s,c),rs(void 0,u,((n=l.mindmap)==null?void 0:n.padding)??ea.mindmap.padding,((i=l.mindmap)==null?void 0:i.useMaxWidth)??ea.mindmap.useMaxWidth)}),Ay={draw:Ly},Oy=t=>{let e="";for(let r=0;r`
+ .edge {
+ stroke-width: 3;
+ }
+ ${Oy(t)}
+ .section-root rect, .section-root path, .section-root circle, .section-root polygon {
+ fill: ${t.git0};
+ }
+ .section-root text {
+ fill: ${t.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;
+ }
+`,Iy=Ny,$y={db:cy,renderer:Ay,parser:ey,styles:Iy};export{$y as diagram};
diff --git a/chunk-46O34XZL.js b/chunk-46O34XZL.js
new file mode 100644
index 0000000..057afd6
--- /dev/null
+++ b/chunk-46O34XZL.js
@@ -0,0 +1 @@
+import{a}from"./chunk-TXXHGJV5.js";import"./chunk-BQWXLU4Q.js";export{a as default};
diff --git a/chunk-5M3CLUJZ.js b/chunk-5M3CLUJZ.js
new file mode 100644
index 0000000..c2bd4eb
--- /dev/null
+++ b/chunk-5M3CLUJZ.js
@@ -0,0 +1 @@
+import{g as i,h as p}from"./chunk-CQVAQ55I.js";import{a as m,b as o}from"./chunk-NGMUA4L4.js";import"./chunk-RO3B3EJX.js";import"./chunk-CC42F4JY.js";import"./chunk-CCJAG5I3.js";import"./chunk-BZUL2CAN.js";import"./chunk-JPQTZ3GI.js";import"./chunk-G7BBE3HQ.js";import{J as l,b as a,c as s,ob as e}from"./chunk-KD4BWX4B.js";import{g as t}from"./chunk-BQWXLU4Q.js";var g=t(a(),1),n=t(s(),1),c=t(l(),1);var y={parser:m,db:o,renderer:i,styles:p,init:r=>{r.flowchart||(r.flowchart={}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,e({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}}),i.setConf(r.flowchart),o.clear(),o.setGen("gen-2")}};export{y as diagram};
diff --git a/chunk-6YCDLEDG.js b/chunk-6YCDLEDG.js
new file mode 100644
index 0000000..3b56236
--- /dev/null
+++ b/chunk-6YCDLEDG.js
@@ -0,0 +1,7 @@
+import{a as Et}from"./chunk-CCJAG5I3.js";import"./chunk-BZUL2CAN.js";import{$a as ut,G as lt,Ga as ct,Ia as vt,J as ri,Pa as Vt,Qa as It,b as oi,c as hi,cb as G,db as Mt,fb as Wt,gb as Ot,hb as zt,ib as Bt,jb as Ft,kb as Nt,lb as gt,m as ht,n as rt,rb as Xt}from"./chunk-KD4BWX4B.js";import{g as ot}from"./chunk-BQWXLU4Q.js";var vi=ot(oi(),1),Vi=ot(hi(),1),Ii=ot(ri(),1);var xt=function(){var e=function(M,o,l,c){for(l=l||{},c=M.length;c--;l[M[c]]=o);return l},t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],n=[1,5],h=[1,6],g=[1,7],f=[1,5,10,12,14,16,18,19,21,23,34,35,36],y=[1,25],L=[1,26],_=[1,28],C=[1,29],P=[1,30],E=[1,31],k=[1,32],v=[1,33],d=[1,34],w=[1,35],r=[1,36],R=[1,37],B=[1,43],Ct=[1,42],Rt=[1,47],U=[1,50],b=[1,10,12,14,16,18,19,21,23,34,35,36],J=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],T=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],Tt=[1,64],tt={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:function(o,l,c,u,m,a,F){var x=a.length-1;switch(m){case 5:u.setOrientation(a[x]);break;case 9:u.setDiagramTitle(a[x].text.trim());break;case 12:u.setLineData({text:"",type:"text"},a[x]);break;case 13:u.setLineData(a[x-1],a[x]);break;case 14:u.setBarData({text:"",type:"text"},a[x]);break;case 15:u.setBarData(a[x-1],a[x]);break;case 16:this.$=a[x].trim(),u.setAccTitle(this.$);break;case 17:case 18:this.$=a[x].trim(),u.setAccDescription(this.$);break;case 19:this.$=a[x-1];break;case 20:this.$=[Number(a[x-2]),...a[x]];break;case 21:this.$=[Number(a[x])];break;case 22:u.setXAxisTitle(a[x]);break;case 23:u.setXAxisTitle(a[x-1]);break;case 24:u.setXAxisTitle({type:"text",text:""});break;case 25:u.setXAxisBand(a[x]);break;case 26:u.setXAxisRangeData(Number(a[x-2]),Number(a[x]));break;case 27:this.$=a[x-1];break;case 28:this.$=[a[x-2],...a[x]];break;case 29:this.$=[a[x]];break;case 30:u.setYAxisTitle(a[x]);break;case 31:u.setYAxisTitle(a[x-1]);break;case 32:u.setYAxisTitle({type:"text",text:""});break;case 33:u.setYAxisRangeData(Number(a[x-2]),Number(a[x]));break;case 37:this.$={text:a[x],type:"text"};break;case 38:this.$={text:a[x],type:"text"};break;case 39:this.$={text:a[x],type:"markdown"};break;case 40:this.$=a[x];break;case 41:this.$=a[x-1]+""+a[x];break}},table:[e(t,i,{3:1,4:2,7:4,5:s,34:n,35:h,36:g}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,34:n,35:h,36:g}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:n,35:h,36:g}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(f,[2,34]),e(f,[2,35]),e(f,[2,36]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,34:n,35:h,36:g}),{1:[2,3]},e(f,[2,5]),e(t,[2,7],{4:22,34:n,35:h,36:g}),{11:23,37:24,38:y,39:L,40:27,41:_,42:C,43:P,44:E,45:k,46:v,47:d,48:w,49:r,50:R},{11:39,13:38,24:B,27:Ct,29:40,30:41,37:24,38:y,39:L,40:27,41:_,42:C,43:P,44:E,45:k,46:v,47:d,48:w,49:r,50:R},{11:45,15:44,27:Rt,33:46,37:24,38:y,39:L,40:27,41:_,42:C,43:P,44:E,45:k,46:v,47:d,48:w,49:r,50:R},{11:49,17:48,24:U,37:24,38:y,39:L,40:27,41:_,42:C,43:P,44:E,45:k,46:v,47:d,48:w,49:r,50:R},{11:52,17:51,24:U,37:24,38:y,39:L,40:27,41:_,42:C,43:P,44:E,45:k,46:v,47:d,48:w,49:r,50:R},{20:[1,53]},{22:[1,54]},e(b,[2,18]),{1:[2,2]},e(b,[2,8]),e(b,[2,9]),e(J,[2,37],{40:55,41:_,42:C,43:P,44:E,45:k,46:v,47:d,48:w,49:r,50:R}),e(J,[2,38]),e(J,[2,39]),e(T,[2,40]),e(T,[2,42]),e(T,[2,43]),e(T,[2,44]),e(T,[2,45]),e(T,[2,46]),e(T,[2,47]),e(T,[2,48]),e(T,[2,49]),e(T,[2,50]),e(T,[2,51]),e(b,[2,10]),e(b,[2,22],{30:41,29:56,24:B,27:Ct}),e(b,[2,24]),e(b,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:y,39:L,40:27,41:_,42:C,43:P,44:E,45:k,46:v,47:d,48:w,49:r,50:R},e(b,[2,11]),e(b,[2,30],{33:60,27:Rt}),e(b,[2,32]),{31:[1,61]},e(b,[2,12]),{17:62,24:U},{25:63,27:Tt},e(b,[2,14]),{17:65,24:U},e(b,[2,16]),e(b,[2,17]),e(T,[2,41]),e(b,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(b,[2,31]),{27:[1,69]},e(b,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(b,[2,15]),e(b,[2,26]),e(b,[2,27]),{11:59,32:72,37:24,38:y,39:L,40:27,41:_,42:C,43:P,44:E,45:k,46:v,47:d,48:w,49:r,50:R},e(b,[2,33]),e(b,[2,19]),{25:73,27:Tt},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:function(o,l){if(l.recoverable)this.trace(o);else{var c=new Error(o);throw c.hash=l,c}},parse:function(o){var l=this,c=[0],u=[],m=[null],a=[],F=this.table,x="",$=0,Dt=0,ei=2,Lt=1,si=a.slice.call(arguments,1),A=Object.create(this.lexer),W={yy:{}};for(var et in this.yy)Object.prototype.hasOwnProperty.call(this.yy,et)&&(W.yy[et]=this.yy[et]);A.setInput(o,W.yy),W.yy.lexer=A,W.yy.parser=this,typeof A.yylloc>"u"&&(A.yylloc={});var st=A.yylloc;a.push(st);var ni=A.options&&A.options.ranges;typeof W.yy.parseError=="function"?this.parseError=W.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ai(){var I;return I=u.pop()||A.lex()||Lt,typeof I!="number"&&(I instanceof Array&&(u=I,I=u.pop()),I=l.symbols_[I]||I),I}for(var S,O,D,nt,z={},q,V,Pt,j;;){if(O=c[c.length-1],this.defaultActions[O]?D=this.defaultActions[O]:((S===null||typeof S>"u")&&(S=ai()),D=F[O]&&F[O][S]),typeof D>"u"||!D.length||!D[0]){var at="";j=[];for(q in F[O])this.terminals_[q]&&q>ei&&j.push("'"+this.terminals_[q]+"'");A.showPosition?at="Parse error on line "+($+1)+`:
+`+A.showPosition()+`
+Expecting `+j.join(", ")+", got '"+(this.terminals_[S]||S)+"'":at="Parse error on line "+($+1)+": Unexpected "+(S==Lt?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(at,{text:A.match,token:this.terminals_[S]||S,line:A.yylineno,loc:st,expected:j})}if(D[0]instanceof Array&&D.length>1)throw new Error("Parse Error: multiple actions possible at state: "+O+", token: "+S);switch(D[0]){case 1:c.push(S),m.push(A.yytext),a.push(A.yylloc),c.push(D[1]),S=null,Dt=A.yyleng,x=A.yytext,$=A.yylineno,st=A.yylloc;break;case 2:if(V=this.productions_[D[1]][1],z.$=m[m.length-V],z._$={first_line:a[a.length-(V||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(V||1)].first_column,last_column:a[a.length-1].last_column},ni&&(z._$.range=[a[a.length-(V||1)].range[0],a[a.length-1].range[1]]),nt=this.performAction.apply(z,[x,Dt,$,W.yy,D[1],m,a].concat(si)),typeof nt<"u")return nt;V&&(c=c.slice(0,-1*V*2),m=m.slice(0,-1*V),a=a.slice(0,-1*V)),c.push(this.productions_[D[1]][0]),m.push(z.$),a.push(z._$),Pt=F[c[c.length-2]][c[c.length-1]],c.push(Pt);break;case 3:return!0}}return!0}},ii=function(){var M={EOF:1,parseError:function(l,c){if(this.yy.parser)this.yy.parser.parseError(l,c);else throw new Error(l)},setInput:function(o,l){return this.yy=l||this.yy||{},this._input=o,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 o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var l=o.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},unput:function(o){var l=o.length,c=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var u=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),c.length-1&&(this.yylineno-=c.length-1);var m=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:c?(c.length===u.length?this.yylloc.first_column:0)+u[u.length-c.length].length-c[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[m[0],m[0]+this.yyleng-l]),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(o){this.unput(this.match.slice(o))},pastInput:function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var o=this.pastInput(),l=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
+`+l+"^"},test_match:function(o,l){var c,u,m;if(this.options.backtrack_lexer&&(m={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&&(m.yylloc.range=this.yylloc.range.slice(0))),u=o[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,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(o[0].length),this.matched+=o[0],c=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var a in m)this[a]=m[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,l,c,u;this._more||(this.yytext="",this.match="");for(var m=this._currentRules(),a=0;al[0].length)){if(l=c,u=a,this.options.backtrack_lexer){if(o=this.test_match(c,m[a]),o!==!1)return o;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(o=this.test_match(l,m[u]),o!==!1?o:!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 l=this.next();return l||this.lex()},begin:function(l){this.conditionStack.push(l)},popState:function(){var l=this.conditionStack.length-1;return l>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(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},pushState:function(l){this.begin(l)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(l,c,u,m){switch(u){case 0:break;case 1:break;case 2:return this.popState(),34;case 3:return this.popState(),34;case 4:return 34;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 8;case 16:return this.pushState("axis_data"),"X_AXIS";case 17:return this.pushState("axis_data"),"Y_AXIS";case 18:return this.pushState("axis_band_data"),24;case 19:return 31;case 20:return this.pushState("data"),16;case 21:return this.pushState("data"),18;case 22:return this.pushState("data_inner"),24;case 23:return 27;case 24:return this.popState(),26;case 25:this.popState();break;case 26:this.pushState("string");break;case 27:this.popState();break;case 28:return"STR";case 29:return 24;case 30:return 26;case 31:return 43;case 32:return"COLON";case 33:return 44;case 34:return 28;case 35:return 45;case 36:return 46;case 37:return 48;case 38:return 50;case 39:return 47;case 40:return 41;case 41:return 49;case 42:return 42;case 43:break;case 44:return 35;case 45:return 36}},rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\{)/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,23,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,20,21,22,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,23,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[27,28],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0}}};return M}();tt.lexer=ii;function it(){this.yy={}}return it.prototype=tt,tt.Parser=it,new it}();xt.parser=xt;var li=xt;function Yt(e){return e.type==="bar"}function qt(e){return e.type==="band"}function N(e){return e.type==="linear"}var Q=class{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((h,g)=>Math.max(g.length,h),0)*i,height:i};let s={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(let h of t){let g=Et(n,1,h),f=g?g.width:h.length*i,y=g?g.height:i;s.width=Math.max(s.width,f),s.height=Math.max(s.height,y)}return n.remove(),s}},Ht=.7,Ut=.2,K=class{constructor(t,i,s,n){this.axisConfig=t,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}setRange(t){this.range=t,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){let t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){Ht*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(Ht*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let s=this.getLabelDimension(),n=Ut*t.width;this.outerPadding=Math.min(s.width/2,n);let h=s.height+this.axisConfig.labelPadding*2;this.labelTextHeight=s.height,h<=i&&(i-=h,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,n<=i&&(i-=n,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let s=this.getLabelDimension(),n=Ut*t.height;this.outerPadding=Math.min(s.height/2,n);let h=s.width+this.axisConfig.labelPadding*2;h<=i&&(i-=h,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,n<=i&&(i-=n,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){let t=[];if(this.showAxisLine){let i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){let i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${i},${this.getScaleValue(s)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){let t=[];if(this.showAxisLine){let i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){let i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){let t=[];if(this.showAxisLine){let i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){let i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${this.getScaleValue(s)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},pt=class extends K{constructor(t,i,s,n,h){super(t,n,h,i),this.categories=s,this.scale=ht().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=ht().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),ct.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)||this.getRange()[0]}},dt=class extends K{constructor(t,i,s,n,h){super(t,n,h,i),this.domain=s,this.scale=rt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=rt().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}};function $t(e,t,i,s){let n=new Q(s);return qt(e)?new pt(t,i,e.categories,e.title,n):new dt(t,i,[e.min,e.max],e.title,n)}var ft=class{constructor(t,i,s,n){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){let i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,t.width),n=i.height+2*this.chartConfig.titlePadding;return i.width<=s&&i.height<=n&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=s,this.boundingRect.height=n,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}};function ci(e,t,i,s){let n=new Q(s);return new ft(n,e,t,i)}var yt=class{constructor(t,i,s,n,h){this.plotData=t,this.xAxis=i,this.yAxis=s,this.orientation=n,this.plotIndex=h}getDrawableElement(){let t=this.plotData.data.map(s=>[this.xAxis.getScaleValue(s[0]),this.yAxis.getScaleValue(s[1])]),i;return this.orientation==="horizontal"?i=lt().y(s=>s[0]).x(s=>s[1])(t):i=lt().x(s=>s[0]).y(s=>s[1])(t),i?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},mt=class{constructor(t,i,s,n,h,g){this.barData=t,this.boundingRect=i,this.xAxis=s,this.yAxis=n,this.orientation=h,this.plotIndex=g}getDrawableElement(){let t=this.barData.data.map(h=>[this.xAxis.getScaleValue(h[0]),this.yAxis.getScaleValue(h[1])]),s=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),n=s/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(h=>({x:this.boundingRect.x,y:h[0]-n,height:s,width:h[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(h=>({x:h[0]-n,y:h[1],width:s,height:this.boundingRect.y+this.boundingRect.height-h[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},bt=class{constructor(t,i,s){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");let t=[];for(let[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{let n=new yt(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...n.getDrawableElement())}break;case"bar":{let n=new mt(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...n.getDrawableElement())}break}return t}};function ui(e,t,i){return new bt(e,t,i)}var At=class{constructor(t,i,s,n){this.chartConfig=t,this.chartData=i,this.componentStore={title:ci(t,i,s,n),plot:ui(t,i,s),xAxis:$t(i.xAxis,t.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},n),yAxis:$t(i.yAxis,t.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},n)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,h=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),g=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),f=this.componentStore.plot.calculateSpace({width:h,height:g});t-=f.width,i-=f.height,f=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),n=f.height,i-=f.height,this.componentStore.xAxis.setAxisPosition("bottom"),f=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=f.height,this.componentStore.yAxis.setAxisPosition("left"),f=this.componentStore.yAxis.calculateSpace({width:t,height:i}),s=f.width,t-=f.width,t>0&&(h+=t,t=0),i>0&&(g+=i,i=0),this.componentStore.plot.calculateSpace({width:h,height:g}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.xAxis.setRange([s,s+h]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:n+g}),this.componentStore.yAxis.setRange([n,n+g]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some(y=>Yt(y))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,h=0,g=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),f=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),y=this.componentStore.plot.calculateSpace({width:g,height:f});t-=y.width,i-=y.height,y=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=y.height,i-=y.height,this.componentStore.xAxis.setAxisPosition("left"),y=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=y.width,n=y.width,this.componentStore.yAxis.setAxisPosition("top"),y=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=y.height,h=s+y.height,t>0&&(g+=t,t=0),i>0&&(f+=i,i=0),this.componentStore.plot.calculateSpace({width:g,height:f}),this.componentStore.plot.setBoundingBoxXY({x:n,y:h}),this.componentStore.yAxis.setRange([n,n+g]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:s}),this.componentStore.xAxis.setRange([h,h+f]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:h}),this.chartData.plots.some(L=>Yt(L))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}},wt=class{static build(t,i,s,n){return new At(t,i,s,n).getDrawableElement()}},X=0,jt,Y=Qt(),H=Gt(),p=Kt(),St=H.plotColorPalette.split(",").map(e=>e.trim()),Z=!1,_t=!1;function Gt(){let e=Vt(),t=G();return ut(e.xyChart,t.themeVariables.xyChart)}function Qt(){let e=G();return ut(It.xyChart,e.xyChart)}function Kt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function kt(e){let t=G();return vt(e.trim(),t)}function gi(e){jt=e}function xi(e){e==="horizontal"?Y.chartOrientation="horizontal":Y.chartOrientation="vertical"}function pi(e){p.xAxis.title=kt(e.text)}function Zt(e,t){p.xAxis={type:"linear",title:p.xAxis.title,min:e,max:t},Z=!0}function di(e){p.xAxis={type:"band",title:p.xAxis.title,categories:e.map(t=>kt(t.text))},Z=!0}function fi(e){p.yAxis.title=kt(e.text)}function yi(e,t){p.yAxis={type:"linear",title:p.yAxis.title,min:e,max:t},_t=!0}function mi(e){let t=Math.min(...e),i=Math.max(...e),s=N(p.yAxis)?p.yAxis.min:1/0,n=N(p.yAxis)?p.yAxis.max:-1/0;p.yAxis={type:"linear",title:p.yAxis.title,min:Math.min(s,t),max:Math.max(n,i)}}function Jt(e){let t=[];if(e.length===0)return t;if(!Z){let i=N(p.xAxis)?p.xAxis.min:1/0,s=N(p.xAxis)?p.xAxis.max:-1/0;Zt(Math.min(i,1),Math.max(s,e.length))}if(_t||mi(e),qt(p.xAxis)&&(t=p.xAxis.categories.map((i,s)=>[i,e[s]])),N(p.xAxis)){let i=p.xAxis.min,s=p.xAxis.max,n=(s-i+1)/e.length,h=[];for(let g=i;g<=s;g+=n)h.push(`${g}`);t=h.map((g,f)=>[g,e[f]])}return t}function ti(e){return St[e===0?0:e%St.length]}function bi(e,t){let i=Jt(t);p.plots.push({type:"line",strokeFill:ti(X),strokeWidth:2,data:i}),X++}function Ai(e,t){let i=Jt(t);p.plots.push({type:"bar",fill:ti(X),data:i}),X++}function wi(){if(p.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return p.title=gt(),wt.build(Y,p,H,jt)}function Si(){return H}function _i(){return Y}var ki=function(){Wt(),X=0,Y=Qt(),p=Kt(),H=Gt(),St=H.plotColorPalette.split(",").map(e=>e.trim()),Z=!1,_t=!1},Ci={getDrawableElem:wi,clear:ki,setAccTitle:Ot,getAccTitle:zt,setDiagramTitle:Nt,getDiagramTitle:gt,getAccDescription:Ft,setAccDescription:Bt,setOrientation:xi,setXAxisTitle:pi,setXAxisRangeData:Zt,setXAxisBand:di,setYAxisTitle:fi,setYAxisRangeData:yi,setLineData:bi,setBarData:Ai,setTmpSVGG:gi,getChartThemeConfig:Si,getChartConfig:_i},Ri=(e,t,i,s)=>{let n=s.db,h=n.getChartThemeConfig(),g=n.getChartConfig();function f(d){return d==="top"?"text-before-edge":"middle"}function y(d){return d==="left"?"start":d==="right"?"end":"middle"}function L(d){return`translate(${d.x}, ${d.y}) rotate(${d.rotation||0})`}ct.debug(`Rendering xychart chart
+`+e);let _=Xt(t),C=_.append("g").attr("class","main"),P=C.append("rect").attr("width",g.width).attr("height",g.height).attr("class","background");Mt(_,g.height,g.width,!0),_.attr("viewBox",`0 0 ${g.width} ${g.height}`),P.attr("fill",h.backgroundColor),n.setTmpSVGG(_.append("g").attr("class","mermaid-tmp-group"));let E=n.getDrawableElem(),k={};function v(d){let w=C,r="";for(let[R]of d.entries()){let B=C;R>0&&k[r]&&(B=k[r]),r+=d[R],w=k[r],w||(w=k[r]=B.append("g").attr("class",d[R]))}return w}for(let d of E){if(d.data.length===0)continue;let w=v(d.groupTexts);switch(d.type){case"rect":w.selectAll("rect").data(d.data).enter().append("rect").attr("x",r=>r.x).attr("y",r=>r.y).attr("width",r=>r.width).attr("height",r=>r.height).attr("fill",r=>r.fill).attr("stroke",r=>r.strokeFill).attr("stroke-width",r=>r.strokeWidth);break;case"text":w.selectAll("text").data(d.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",r=>r.fill).attr("font-size",r=>r.fontSize).attr("dominant-baseline",r=>f(r.verticalPos)).attr("text-anchor",r=>y(r.horizontalPos)).attr("transform",r=>L(r)).text(r=>r.text);break;case"path":w.selectAll("path").data(d.data).enter().append("path").attr("d",r=>r.path).attr("fill",r=>r.fill?r.fill:"none").attr("stroke",r=>r.strokeFill).attr("stroke-width",r=>r.strokeWidth);break}}},Ti={draw:Ri},Mi={parser:li,db:Ci,renderer:Ti};export{Mi as diagram};
diff --git a/chunk-BQWXLU4Q.js b/chunk-BQWXLU4Q.js
new file mode 100644
index 0000000..2e9097b
--- /dev/null
+++ b/chunk-BQWXLU4Q.js
@@ -0,0 +1 @@
+var q=Object.create;var k=Object.defineProperty,r=Object.defineProperties,s=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertyNames,j=Object.getOwnPropertySymbols,v=Object.getPrototypeOf,n=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable;var m=(b,a)=>(a=Symbol[b])?a:Symbol.for("Symbol."+b);var o=(b,a,c)=>a in b?k(b,a,{enumerable:!0,configurable:!0,writable:!0,value:c}):b[a]=c,y=(b,a)=>{for(var c in a||={})n.call(a,c)&&o(b,c,a[c]);if(j)for(var c of j(a))p.call(a,c)&&o(b,c,a[c]);return b},z=(b,a)=>r(b,t(a));var A=(b=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(b,{get:(a,c)=>(typeof require<"u"?require:a)[c]}):b)(function(b){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+b+'" is not supported')});var B=(b,a)=>{var c={};for(var d in b)n.call(b,d)&&a.indexOf(d)<0&&(c[d]=b[d]);if(b!=null&&j)for(var d of j(b))a.indexOf(d)<0&&p.call(b,d)&&(c[d]=b[d]);return c};var C=(b,a)=>()=>(a||b((a={exports:{}}).exports,a),a.exports),D=(b,a)=>{for(var c in a)k(b,c,{get:a[c],enumerable:!0})},w=(b,a,c,d)=>{if(a&&typeof a=="object"||typeof a=="function")for(let e of u(a))!n.call(b,e)&&e!==c&&k(b,e,{get:()=>a[e],enumerable:!(d=s(a,e))||d.enumerable});return b};var E=(b,a,c)=>(c=b!=null?q(v(b)):{},w(a||!b||!b.__esModule?k(c,"default",{value:b,enumerable:!0}):c,b));var F=(b,a,c)=>new Promise((d,e)=>{var f=g=>{try{i(c.next(g))}catch(l){e(l)}},h=g=>{try{i(c.throw(g))}catch(l){e(l)}},i=g=>g.done?d(g.value):Promise.resolve(g.value).then(f,h);i((c=c.apply(b,a)).next())}),x=function(b,a){this[0]=b,this[1]=a};var G=b=>{var a=b[m("asyncIterator")],c=!1,d,e={};return a==null?(a=b[m("iterator")](),d=f=>e[f]=h=>a[f](h)):(a=a.call(b),d=f=>e[f]=h=>{if(c){if(c=!1,f==="throw")throw h;return h}return c=!0,{done:!1,value:new x(new Promise(i=>{var g=a[f](h);if(!(g instanceof Object))throw TypeError("Object expected");i(g)}),1)}}),e[m("iterator")]=()=>e,d("next"),"throw"in a?d("throw"):e.throw=f=>{throw f},"return"in a&&d("return"),e};export{y as a,z as b,A as c,B as d,C as e,D as f,E as g,F as h,G as i};
diff --git a/chunk-BVETK4XD.js b/chunk-BVETK4XD.js
new file mode 100644
index 0000000..478bf78
--- /dev/null
+++ b/chunk-BVETK4XD.js
@@ -0,0 +1 @@
+import{Ha as o,c}from"./chunk-KD4BWX4B.js";import{g as l}from"./chunk-BQWXLU4Q.js";var i=l(c(),1);var x=(s,t)=>{let r=s.append("rect");if(r.attr("x",t.x),r.attr("y",t.y),r.attr("fill",t.fill),r.attr("stroke",t.stroke),r.attr("width",t.width),r.attr("height",t.height),t.name&&r.attr("name",t.name),t.rx!==void 0&&r.attr("rx",t.rx),t.ry!==void 0&&r.attr("ry",t.ry),t.attrs!==void 0)for(let e in t.attrs)r.attr(e,t.attrs[e]);return t.class!==void 0&&r.attr("class",t.class),r},h=(s,t)=>{let r={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(s,r).lower()},y=(s,t)=>{let r=t.text.replace(o," "),e=s.append("text");e.attr("x",t.x),e.attr("y",t.y),e.attr("class","legend"),e.style("text-anchor",t.anchor),t.class!==void 0&&e.attr("class",t.class);let n=e.append("tspan");return n.attr("x",t.x+t.textMargin*2),n.text(r),e},m=(s,t,r,e)=>{let n=s.append("image");n.attr("x",t),n.attr("y",r);let a=(0,i.sanitizeUrl)(e);n.attr("xlink:href",a)},p=(s,t,r,e)=>{let n=s.append("use");n.attr("x",t),n.attr("y",r);let a=(0,i.sanitizeUrl)(e);n.attr("xlink:href",`#${a}`)},g=()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),f=()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0});export{x as a,h as b,y as c,m as d,p as e,g as f,f as g};
diff --git a/chunk-BZUL2CAN.js b/chunk-BZUL2CAN.js
new file mode 100644
index 0000000..3f41acb
--- /dev/null
+++ b/chunk-BZUL2CAN.js
@@ -0,0 +1 @@
+var r=document.createElement("i");function c(t){let n="&"+t+";";r.innerHTML=n;let e=r.textContent;return e.charCodeAt(e.length-1)===59&&t!=="semi"||e===n?!1:e}export{c as a};
diff --git a/chunk-C7NBI5XT.js b/chunk-C7NBI5XT.js
new file mode 100644
index 0000000..bef7945
--- /dev/null
+++ b/chunk-C7NBI5XT.js
@@ -0,0 +1,4 @@
+import{a as X,b as F,c as _,d as q,e as b,f as Q,g as St,h as _t}from"./chunk-CQVAQ55I.js";import{a as gt,b as Y}from"./chunk-NGMUA4L4.js";import"./chunk-RO3B3EJX.js";import"./chunk-CC42F4JY.js";import"./chunk-CCJAG5I3.js";import"./chunk-BZUL2CAN.js";import{a as kt}from"./chunk-JPQTZ3GI.js";import{A as bt,e as R,g as lt,m as w,t as vt,u as xt,y as wt}from"./chunk-G7BBE3HQ.js";import{F as P,G as yt,Ga as G,J as ae,Ja as ct,Na as dt,Oa as pt,Ta as K,Ua as J,b as ee,c as re,eb as Lt,h as y,i as ft,k as mt,nb as U}from"./chunk-KD4BWX4B.js";import{g as ot,h as H}from"./chunk-BQWXLU4Q.js";var Z={normal:ne,vee:se,undirected:ie};function Tt(r){Z=r}function ne(r,e,t,n){var a=r.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),s=a.append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("stroke-width",1).style("stroke-dasharray","1,0");_(s,t[n+"Style"]),t[n+"Class"]&&s.attr("class",t[n+"Class"])}function se(r,e,t,n){var a=r.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),s=a.append("path").attr("d","M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width",1).style("stroke-dasharray","1,0");_(s,t[n+"Style"]),t[n+"Class"]&&s.attr("class",t[n+"Class"])}function ie(r,e,t,n){var a=r.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),s=a.append("path").attr("d","M 0 5 L 10 5").style("stroke-width",1).style("stroke-dasharray","1,0");_(s,t[n+"Style"]),t[n+"Class"]&&s.attr("class",t[n+"Class"])}function Et(r,e){var t=r;return t.node().appendChild(e.label),_(t,e.labelStyle),t}function Nt(r,e){for(var t=r.append("text"),n=oe(e.label).split(`
+`),a=0;a0}function E(r,e,t){var n=r.x,a=r.y,s=[],i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;e.forEach(function(f){i=Math.min(i,f.x),o=Math.min(o,f.y)});for(var c=n-r.width/2-i,d=a-r.height/2-o,l=0;l1&&s.sort(function(f,v){var h=f.x-t.x,g=f.y-t.y,L=Math.sqrt(h*h+g*g),M=v.x-t.x,N=v.y-t.y,st=Math.sqrt(M*M+N*N);return LMath.abs(a)*o?(s<0&&(o=-o),c=s===0?0:o*a/s,d=o):(a<0&&(i=-i),c=i,d=a===0?0:i*s/a),{x:t+c,y:n+d}}var nt={rect:ve,ellipse:xe,circle:we,diamond:be};function Vt(r){nt=r}function ve(r,e,t){var n=r.insert("rect",":first-child").attr("rx",t.rx).attr("ry",t.ry).attr("x",-e.width/2).attr("y",-e.height/2).attr("width",e.width).attr("height",e.height);return t.intersect=function(a){return V(t,a)},n}function xe(r,e,t){var n=e.width/2,a=e.height/2,s=r.insert("ellipse",":first-child").attr("x",-e.width/2).attr("y",-e.height/2).attr("rx",n).attr("ry",a);return t.intersect=function(i){return at(t,n,a,i)},s}function we(r,e,t){var n=Math.max(e.width,e.height)/2,a=r.insert("circle",":first-child").attr("x",-e.width/2).attr("y",-e.height/2).attr("r",n);return t.intersect=function(s){return Gt(t,n,s)},a}function be(r,e,t){var n=e.width*Math.SQRT2/2,a=e.height*Math.SQRT2/2,s=[{x:0,y:-a},{x:-n,y:0},{x:0,y:a},{x:n,y:0}],i=r.insert("polygon",":first-child").attr("points",s.map(function(o){return o.x+","+o.y}).join(" "));return t.intersect=function(o){return E(t,s,o)},i}function ht(){var r=function(e,t){_e(t);var n=$(e,"output"),a=$(n,"clusters"),s=$(n,"edgePaths"),i=tt($(n,"edgeLabels"),t),o=rt($(n,"nodes"),t,nt);kt(t),Rt(o,t),Pt(i,t),et(s,t,Z);var c=O(a,t);Dt(c,t),Le(t)};return r.createNodes=function(e){return arguments.length?(Mt(e),r):rt},r.createClusters=function(e){return arguments.length?(Ct(e),r):O},r.createEdgeLabels=function(e){return arguments.length?(At(e),r):tt},r.createEdgePaths=function(e){return arguments.length?(It(e),r):et},r.shapes=function(e){return arguments.length?(Vt(e),r):nt},r.arrows=function(e){return arguments.length?(Tt(e),r):Z},r}var ke={paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10,rx:0,ry:0,shape:"rect"},Se={arrowhead:"normal",curve:P};function _e(r){r.nodes().forEach(function(e){var t=r.node(e);!w(t,"label")&&!r.children(e).length&&(t.label=e),w(t,"paddingX")&&R(t,{paddingLeft:t.paddingX,paddingRight:t.paddingX}),w(t,"paddingY")&&R(t,{paddingTop:t.paddingY,paddingBottom:t.paddingY}),w(t,"padding")&&R(t,{paddingLeft:t.padding,paddingRight:t.padding,paddingTop:t.padding,paddingBottom:t.padding}),R(t,ke),lt(["paddingLeft","paddingRight","paddingTop","paddingBottom"],function(n){t[n]=Number(t[n])}),w(t,"width")&&(t._prevWidth=t.width),w(t,"height")&&(t._prevHeight=t.height)}),r.edges().forEach(function(e){var t=r.edge(e);w(t,"label")||(t.label=""),R(t,Se)})}function Le(r){lt(r.nodes(),function(e){var t=r.node(e);w(t,"_prevWidth")?t.width=t._prevWidth:delete t.width,w(t,"_prevHeight")?t.height=t._prevHeight:delete t.height,delete t._prevWidth,delete t._prevHeight})}function $(r,e){var t=r.select("g."+e);return t.empty()&&(t=r.append("g").attr("class",e)),t}var Ar=ot(ee(),1),Ir=ot(re(),1),Br=ot(ae(),1);function $t(r,e,t){let n=e.width,a=e.height,s=(n+a)*.9,i=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}],o=A(r,s,s,i);return t.intersect=function(c){return E(t,i,c)},o}function zt(r,e,t){let a=e.height,s=a/4,i=e.width+2*s,o=[{x:s,y:0},{x:i-s,y:0},{x:i,y:-a/2},{x:i-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}],c=A(r,i,a,o);return t.intersect=function(d){return E(t,o,d)},c}function Ht(r,e,t){let n=e.width,a=e.height,s=[{x:-a/2,y:0},{x:n,y:0},{x:n,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}],i=A(r,n,a,s);return t.intersect=function(o){return E(t,s,o)},i}function Yt(r,e,t){let n=e.width,a=e.height,s=[{x:-2*a/6,y:0},{x:n-a/6,y:0},{x:n+2*a/6,y:-a},{x:a/6,y:-a}],i=A(r,n,a,s);return t.intersect=function(o){return E(t,s,o)},i}function Xt(r,e,t){let n=e.width,a=e.height,s=[{x:2*a/6,y:0},{x:n+a/6,y:0},{x:n-2*a/6,y:-a},{x:-a/6,y:-a}],i=A(r,n,a,s);return t.intersect=function(o){return E(t,s,o)},i}function Ft(r,e,t){let n=e.width,a=e.height,s=[{x:-2*a/6,y:0},{x:n+2*a/6,y:0},{x:n-a/6,y:-a},{x:a/6,y:-a}],i=A(r,n,a,s);return t.intersect=function(o){return E(t,s,o)},i}function qt(r,e,t){let n=e.width,a=e.height,s=[{x:a/6,y:0},{x:n-a/6,y:0},{x:n+2*a/6,y:-a},{x:-2*a/6,y:-a}],i=A(r,n,a,s);return t.intersect=function(o){return E(t,s,o)},i}function Qt(r,e,t){let n=e.width,a=e.height,s=[{x:0,y:0},{x:n+a/2,y:0},{x:n,y:-a/2},{x:n+a/2,y:-a},{x:0,y:-a}],i=A(r,n,a,s);return t.intersect=function(o){return E(t,s,o)},i}function Kt(r,e,t){let n=e.height,a=e.width+n/4,s=r.insert("rect",":first-child").attr("rx",n/2).attr("ry",n/2).attr("x",-a/2).attr("y",-n/2).attr("width",a).attr("height",n);return t.intersect=function(i){return V(t,i)},s}function Jt(r,e,t){let n=e.width,a=e.height,s=[{x:0,y:0},{x:n,y:0},{x:n,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:n+8,y:0},{x:n+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],i=A(r,n,a,s);return t.intersect=function(o){return E(t,s,o)},i}function Zt(r,e,t){let n=e.width,a=n/2,s=a/(2.5+n/50),i=e.height+s,o="M 0,"+s+" a "+a+","+s+" 0,0,0 "+n+" 0 a "+a+","+s+" 0,0,0 "+-n+" 0 l 0,"+i+" a "+a+","+s+" 0,0,0 "+n+" 0 l 0,"+-i,c=r.attr("label-offset-y",s).insert("path",":first-child").attr("d",o).attr("transform","translate("+-n/2+","+-(i/2+s)+")");return t.intersect=function(d){let l=V(t,d),m=l.x-t.x;if(a!=0&&(Math.abs(m)t.height/2-s)){let p=s*s*(1-m*m/(a*a));p!=0&&(p=Math.sqrt(p)),p=s-p,d.y-t.y>0&&(p=-p),l.y+=p}return l},c}function Ne(r){r.shapes().question=$t,r.shapes().hexagon=zt,r.shapes().stadium=Kt,r.shapes().subroutine=Jt,r.shapes().cylinder=Zt,r.shapes().rect_left_inv_arrow=Ht,r.shapes().lean_right=Yt,r.shapes().lean_left=Xt,r.shapes().trapezoid=Ft,r.shapes().inv_trapezoid=qt,r.shapes().rect_right_inv_arrow=Qt}function Ce(r){r({question:$t}),r({hexagon:zt}),r({stadium:Kt}),r({subroutine:Jt}),r({cylinder:Zt}),r({rect_left_inv_arrow:Ht}),r({lean_right:Yt}),r({lean_left:Xt}),r({trapezoid:Ft}),r({inv_trapezoid:qt}),r({rect_right_inv_arrow:Qt})}function A(r,e,t,n){return r.insert("polygon",":first-child").attr("points",n.map(function(a){return a.x+","+a.y}).join(" ")).attr("transform","translate("+-e/2+","+t/2+")")}var Ae={addToRender:Ne,addToRenderV2:Ce},Ot={},Ie=function(r){let e=Object.keys(r);for(let t of e)Ot[t]=r[t]},jt=function(r,e,t,n,a,s){return H(this,null,function*(){let i=n?n.select(`[id="${t}"]`):y(`[id="${t}"]`),o=a||document,c=Object.keys(r);for(let d of c){let l=r[d],m="default";l.classes.length>0&&(m=l.classes.join(" "));let p=J(l.styles),u=l.text!==void 0?l.text:l.id,f;if(ct(U().flowchart.htmlLabels)){let g={label:yield dt(u.replace(/fa[blrs]?:fa-[\w-]+/g,L=>``),U())};f=Q(i,g).node(),f.parentNode.removeChild(f)}else{let g=o.createElementNS("http://www.w3.org/2000/svg","text");g.setAttribute("style",p.labelStyle.replace("color:","fill:"));let L=u.split(pt.lineBreakRegex);for(let M of L){let N=o.createElementNS("http://www.w3.org/2000/svg","tspan");N.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),N.setAttribute("dy","1em"),N.setAttribute("x","1"),N.textContent=M,g.appendChild(N)}f=g}let v=0,h="";switch(l.type){case"round":v=5,h="rect";break;case"square":h="rect";break;case"diamond":h="question";break;case"hexagon":h="hexagon";break;case"odd":h="rect_left_inv_arrow";break;case"lean_right":h="lean_right";break;case"lean_left":h="lean_left";break;case"trapezoid":h="trapezoid";break;case"inv_trapezoid":h="inv_trapezoid";break;case"odd_right":h="rect_left_inv_arrow";break;case"circle":h="circle";break;case"ellipse":h="ellipse";break;case"stadium":h="stadium";break;case"subroutine":h="subroutine";break;case"cylinder":h="cylinder";break;case"group":h="rect";break;default:h="rect"}G.warn("Adding node",l.id,l.domId),e.setNode(s.db.lookUpDomId(l.id),{labelType:"svg",labelStyle:p.labelStyle,shape:h,label:f,rx:v,ry:v,class:m,style:p.style,id:s.db.lookUpDomId(l.id)})}})},te=function(r,e,t){return H(this,null,function*(){let n=0,a,s;if(r.defaultStyle!==void 0){let i=J(r.defaultStyle);a=i.style,s=i.labelStyle}for(let i of r){n++;let o="L-"+i.start+"-"+i.end,c="LS-"+i.start,d="LE-"+i.end,l={};i.type==="arrow_open"?l.arrowhead="none":l.arrowhead="normal";let m="",p="";if(i.style!==void 0){let u=J(i.style);m=u.style,p=u.labelStyle}else switch(i.stroke){case"normal":m="fill:none",a!==void 0&&(m=a),s!==void 0&&(p=s);break;case"dotted":m="fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":m=" stroke-width: 3.5px;fill:none";break}l.style=m,l.labelStyle=p,i.interpolate!==void 0?l.curve=K(i.interpolate,P):r.defaultInterpolate!==void 0?l.curve=K(r.defaultInterpolate,P):l.curve=K(Ot.curve,P),i.text===void 0?i.style!==void 0&&(l.arrowheadStyle="fill: #333"):(l.arrowheadStyle="fill: #333",l.labelpos="c",ct(U().flowchart.htmlLabels)?(l.labelType="html",l.label=`${yield dt(i.text.replace(/fa[blrs]?:fa-[\w-]+/g,u=>``),U())}`):(l.labelType="text",l.label=i.text.replace(pt.lineBreakRegex,`
+`),i.style===void 0&&(l.style=l.style||"stroke: #333; stroke-width: 1.5px;fill:none"),l.labelStyle=l.labelStyle.replace("color:","fill:"))),l.id=o,l.class=c+" "+d,l.minlen=i.length||1,e.setEdge(t.db.lookUpDomId(i.start),t.db.lookUpDomId(i.end),l,n)}})},Be=function(r,e){return G.info("Extracting classes"),e.db.getClasses()},Me=function(r,e,t,n){return H(this,null,function*(){G.info("Drawing flowchart");let{securityLevel:a,flowchart:s}=U(),i;a==="sandbox"&&(i=y("#i"+e));let o=a==="sandbox"?y(i.nodes()[0].contentDocument.body):y("body"),c=a==="sandbox"?i.nodes()[0].contentDocument:document,d=n.db.getDirection();d===void 0&&(d="TD");let l=s.nodeSpacing||50,m=s.rankSpacing||50,p=new bt({multigraph:!0,compound:!0}).setGraph({rankdir:d,nodesep:l,ranksep:m,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),u,f=n.db.getSubGraphs();for(let x=f.length-1;x>=0;x--)u=f[x],n.db.addVertex(u.id,u.title,"group",void 0,u.classes);let v=n.db.getVertices();G.warn("Get vertices",v);let h=n.db.getEdges(),g=0;for(g=f.length-1;g>=0;g--){u=f[g],ft("cluster").append("text");for(let x=0;x{r.flowchart||(r.flowchart={}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,De.setConf(r.flowchart),Y.clear(),Y.setGen("gen-1")}};export{Pr as diagram};
diff --git a/chunk-CC42F4JY.js b/chunk-CC42F4JY.js
new file mode 100644
index 0000000..1230f0f
--- /dev/null
+++ b/chunk-CC42F4JY.js
@@ -0,0 +1,4 @@
+import{b as q}from"./chunk-CCJAG5I3.js";import{G as P,Ga as g,I as tt,Ia as J,Ja as I,ab as D,bb as z,h as B,nb as b}from"./chunk-KD4BWX4B.js";import{h as v}from"./chunk-BQWXLU4Q.js";var ot=(e,t,a,i)=>{t.forEach(l=>{mt[l](e,a,i)})},yt=(e,t,a)=>{g.trace("Making markers for ",a),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},pt=(e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},ft=(e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},xt=(e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},dt=(e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},gt=(e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},ut=(e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},bt=(e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},wt=(e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},mt={extension:yt,composition:pt,aggregation:ft,dependency:xt,lollipop:dt,point:gt,circle:ut,cross:bt,barb:wt},or=ot;function kt(e,t){t&&e.attr("style",t)}function vt(e){let t=B(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),a=t.append("xhtml:div"),i=e.label,l=e.isNode?"nodeLabel":"edgeLabel";return a.html('"+i+""),kt(a,e.labelStyle),a.style("display","inline-block"),a.style("white-space","nowrap"),a.attr("xmlns","http://www.w3.org/1999/xhtml"),t.node()}var Lt=(e,t,a,i)=>{let l=e||"";if(typeof l=="object"&&(l=l[0]),I(b().flowchart.htmlLabels)){l=l.replace(/\\n|\n/g,"
"),g.debug("vertexText"+l);let r={isNode:i,label:z(l).replace(/fa[blrs]?:fa-[\w-]+/g,n=>``),labelStyle:t.replace("fill:","color:")};return vt(r)}else{let r=document.createElementNS("http://www.w3.org/2000/svg","text");r.setAttribute("style",t.replace("color:","fill:"));let s=[];typeof l=="string"?s=l.split(/\\n|\n|
/gi):Array.isArray(l)?s=l:s=[];for(let n of s){let c=document.createElementNS("http://www.w3.org/2000/svg","tspan");c.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),c.setAttribute("dy","1em"),c.setAttribute("x","0"),a?c.setAttribute("class","title-row"):c.setAttribute("class","row"),c.textContent=n.trim(),r.appendChild(c)}return r}},H=Lt,T=(e,t,a,i)=>v(void 0,null,function*(){let l,r=t.useHtmlLabels||I(b().flowchart.htmlLabels);a?l=a:l="node default";let s=e.insert("g").attr("class",l).attr("id",t.domId||t.id),n=s.insert("g").attr("class","label").attr("style",t.labelStyle),c;t.labelText===void 0?c="":c=typeof t.labelText=="string"?t.labelText:t.labelText[0];let o=n.node(),h;t.labelType==="markdown"?h=q(n,J(z(c),b()),{useHtmlLabels:r,width:t.width||b().flowchart.wrappingWidth,classes:"markdown-node-label"}):h=o.appendChild(H(J(z(c),b()),t.labelStyle,!1,i));let y=h.getBBox(),f=t.padding/2;if(I(b().flowchart.htmlLabels)){let p=h.children[0],d=B(h),k=p.getElementsByTagName("img");if(k){let x=c.replace(/]*>/g,"").trim()==="";yield Promise.all([...k].map(u=>new Promise(M=>{function C(){if(u.style.display="flex",u.style.flexDirection="column",x){let $=b().fontSize?b().fontSize:window.getComputedStyle(document.body).fontSize,j=parseInt($,10)*5+"px";u.style.minWidth=j,u.style.maxWidth=j}else u.style.width="100%";M(u)}setTimeout(()=>{u.complete&&C()}),u.addEventListener("error",C),u.addEventListener("load",C)})))}y=p.getBoundingClientRect(),d.attr("width",y.width),d.attr("height",y.height)}return r?n.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"):n.attr("transform","translate(0, "+-y.height/2+")"),t.centerLabel&&n.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),n.insert("rect",":first-child"),{shapeSvg:s,bbox:y,halfPadding:f,label:n}}),m=(e,t)=>{let a=t.node().getBBox();e.width=a.width,e.height=a.height};function N(e,t,a,i){return e.insert("polygon",":first-child").attr("points",i.map(function(l){return l.x+","+l.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+a/2+")")}function St(e,t){return e.intersect(t)}function ct(e,t,a,i){var l=e.x,r=e.y,s=l-i.x,n=r-i.y,c=Math.sqrt(t*t*n*n+a*a*s*s),o=Math.abs(t*a*s/c);i.x0}function Bt(e,t,a){var i=e.x,l=e.y,r=[],s=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(d){s=Math.min(s,d.x),n=Math.min(n,d.y)}):(s=Math.min(s,t.x),n=Math.min(n,t.y));for(var c=i-e.width/2-s,o=l-e.height/2-n,h=0;h1&&r.sort(function(d,k){var x=d.x-a.x,u=d.y-a.y,M=Math.sqrt(x*x+u*u),C=k.x-a.x,$=k.y-a.y,Y=Math.sqrt(C*C+$*$);return M{var a=e.x,i=e.y,l=t.x-a,r=t.y-i,s=e.width/2,n=e.height/2,c,o;return Math.abs(r)*s>Math.abs(l)*n?(r<0&&(n=-n),c=r===0?0:n*l/r,o=n):(l<0&&(s=-s),c=s,o=l===0?0:s*r/l),{x:a+c,y:i+o}},Ct=Et,w={node:St,circle:Mt,ellipse:ct,polygon:Bt,rect:Ct},$t=(e,t)=>v(void 0,null,function*(){t.useHtmlLabels||b().flowchart.htmlLabels||(t.centerLabel=!0);let{shapeSvg:i,bbox:l,halfPadding:r}=yield T(e,t,"node "+t.classes,!0);g.info("Classes = ",t.classes);let s=i.insert("rect",":first-child");return s.attr("rx",t.rx).attr("ry",t.ry).attr("x",-l.width/2-r).attr("y",-l.height/2-r).attr("width",l.width+t.padding).attr("height",l.height+t.padding),m(t,s),t.intersect=function(n){return w.rect(t,n)},i}),_t=$t,Rt=e=>{let t=new Set;for(let a of e)switch(a){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(a);break}return t},Ht=(e,t,a)=>{let i=Rt(e),l=2,r=t.height+2*a.padding,s=r/l,n=t.width+2*s+a.padding,c=a.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:s,y:0},{x:n/2,y:2*c},{x:n-s,y:0},{x:n,y:0},{x:n,y:-r/3},{x:n+2*c,y:-r/2},{x:n,y:-2*r/3},{x:n,y:-r},{x:n-s,y:-r},{x:n/2,y:-r-2*c},{x:s,y:-r},{x:0,y:-r},{x:0,y:-2*r/3},{x:-2*c,y:-r/2},{x:0,y:-r/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:s,y:0},{x:n-s,y:0},{x:n,y:-r/2},{x:n-s,y:-r},{x:s,y:-r},{x:0,y:-r/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:s,y:-r},{x:n-s,y:-r},{x:n,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:n,y:-s},{x:n,y:-r+s},{x:0,y:-r}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:n,y:0},{x:0,y:-s},{x:0,y:-r+s},{x:n,y:-r}]:i.has("right")&&i.has("left")?[{x:s,y:0},{x:s,y:-c},{x:n-s,y:-c},{x:n-s,y:0},{x:n,y:-r/2},{x:n-s,y:-r},{x:n-s,y:-r+c},{x:s,y:-r+c},{x:s,y:-r},{x:0,y:-r/2}]:i.has("up")&&i.has("down")?[{x:n/2,y:0},{x:0,y:-c},{x:s,y:-c},{x:s,y:-r+c},{x:0,y:-r+c},{x:n/2,y:-r},{x:n,y:-r+c},{x:n-s,y:-r+c},{x:n-s,y:-c},{x:n,y:-c}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:n,y:-s},{x:0,y:-r}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:n,y:0},{x:0,y:-r}]:i.has("left")&&i.has("up")?[{x:n,y:0},{x:0,y:-s},{x:n,y:-r}]:i.has("left")&&i.has("down")?[{x:n,y:0},{x:0,y:0},{x:n,y:-r}]:i.has("right")?[{x:s,y:-c},{x:s,y:-c},{x:n-s,y:-c},{x:n-s,y:0},{x:n,y:-r/2},{x:n-s,y:-r},{x:n-s,y:-r+c},{x:s,y:-r+c},{x:s,y:-r+c}]:i.has("left")?[{x:s,y:0},{x:s,y:-c},{x:n-s,y:-c},{x:n-s,y:-r+c},{x:s,y:-r+c},{x:s,y:-r},{x:0,y:-r/2}]:i.has("up")?[{x:s,y:-c},{x:s,y:-r+c},{x:0,y:-r+c},{x:n/2,y:-r},{x:n,y:-r+c},{x:n-s,y:-r+c},{x:n-s,y:-c}]:i.has("down")?[{x:n/2,y:0},{x:0,y:-c},{x:s,y:-c},{x:s,y:-r+c},{x:n-s,y:-r+c},{x:n-s,y:-c},{x:n,y:-c}]:[{x:0,y:0}]},at=e=>e?" "+e:"",R=(e,t)=>`${t||"node default"}${at(e.classes)} ${at(e.class)}`,et=(e,t)=>v(void 0,null,function*(){let{shapeSvg:a,bbox:i}=yield T(e,t,R(t,void 0),!0),l=i.width+t.padding,r=i.height+t.padding,s=l+r,n=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];g.info("Question main (Circle)");let c=N(a,s,s,n);return c.attr("style",t.style),m(t,c),t.intersect=function(o){return g.warn("Intersect called"),w.polygon(t,n,o)},a}),It=(e,t)=>{let a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=28,l=[{x:0,y:i/2},{x:i/2,y:0},{x:0,y:-i/2},{x:-i/2,y:0}];return a.insert("polygon",":first-child").attr("points",l.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(s){return w.circle(t,14,s)},a},Nt=(e,t)=>v(void 0,null,function*(){let{shapeSvg:a,bbox:i}=yield T(e,t,R(t,void 0),!0),l=4,r=i.height+t.padding,s=r/l,n=i.width+2*s+t.padding,c=[{x:s,y:0},{x:n-s,y:0},{x:n,y:-r/2},{x:n-s,y:-r},{x:s,y:-r},{x:0,y:-r/2}],o=N(a,n,r,c);return o.attr("style",t.style),m(t,o),t.intersect=function(h){return w.polygon(t,c,h)},a}),Ot=(e,t)=>v(void 0,null,function*(){let{shapeSvg:a,bbox:i}=yield T(e,t,void 0,!0),l=2,r=i.height+2*t.padding,s=r/l,n=i.width+2*s+t.padding,c=Ht(t.directions,i,t),o=N(a,n,r,c);return o.attr("style",t.style),m(t,o),t.intersect=function(h){return w.polygon(t,c,h)},a}),Wt=(e,t)=>v(void 0,null,function*(){let{shapeSvg:a,bbox:i}=yield T(e,t,R(t,void 0),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:-r/2,y:0},{x:l,y:0},{x:l,y:-r},{x:-r/2,y:-r},{x:0,y:-r/2}];return N(a,l,r,s).attr("style",t.style),t.width=l+r,t.height=r,t.intersect=function(c){return w.polygon(t,s,c)},a}),Xt=(e,t)=>v(void 0,null,function*(){let{shapeSvg:a,bbox:i}=yield T(e,t,R(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:-2*r/6,y:0},{x:l-r/6,y:0},{x:l+2*r/6,y:-r},{x:r/6,y:-r}],n=N(a,l,r,s);return n.attr("style",t.style),m(t,n),t.intersect=function(c){return w.polygon(t,s,c)},a}),Yt=(e,t)=>v(void 0,null,function*(){let{shapeSvg:a,bbox:i}=yield T(e,t,R(t,void 0),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:2*r/6,y:0},{x:l+r/6,y:0},{x:l-2*r/6,y:-r},{x:-r/6,y:-r}],n=N(a,l,r,s);return n.attr("style",t.style),m(t,n),t.intersect=function(c){return w.polygon(t,s,c)},a}),Dt=(e,t)=>v(void 0,null,function*(){let{shapeSvg:a,bbox:i}=yield T(e,t,R(t,void 0),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:-2*r/6,y:0},{x:l+2*r/6,y:0},{x:l-r/6,y:-r},{x:r/6,y:-r}],n=N(a,l,r,s);return n.attr("style",t.style),m(t,n),t.intersect=function(c){return w.polygon(t,s,c)},a}),At=(e,t)=>v(void 0,null,function*(){let{shapeSvg:a,bbox:i}=yield T(e,t,R(t,void 0),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:r/6,y:0},{x:l-r/6,y:0},{x:l+2*r/6,y:-r},{x:-2*r/6,y:-r}],n=N(a,l,r,s);return n.attr("style",t.style),m(t,n),t.intersect=function(c){return w.polygon(t,s,c)},a}),jt=(e,t)=>v(void 0,null,function*(){let{shapeSvg:a,bbox:i}=yield T(e,t,R(t,void 0),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:0,y:0},{x:l+r/2,y:0},{x:l,y:-r/2},{x:l+r/2,y:-r},{x:0,y:-r}],n=N(a,l,r,s);return n.attr("style",t.style),m(t,n),t.intersect=function(c){return w.polygon(t,s,c)},a}),Ut=(e,t)=>v(void 0,null,function*(){let{shapeSvg:a,bbox:i}=yield T(e,t,R(t,void 0),!0),l=i.width+t.padding,r=l/2,s=r/(2.5+l/50),n=i.height+s+t.padding,c="M 0,"+s+" a "+r+","+s+" 0,0,0 "+l+" 0 a "+r+","+s+" 0,0,0 "+-l+" 0 l 0,"+n+" a "+r+","+s+" 0,0,0 "+l+" 0 l 0,"+-n,o=a.attr("label-offset-y",s).insert("path",":first-child").attr("style",t.style).attr("d",c).attr("transform","translate("+-l/2+","+-(n/2+s)+")");return m(t,o),t.intersect=function(h){let y=w.rect(t,h),f=y.x-t.x;if(r!=0&&(Math.abs(f)t.height/2-s)){let p=s*s*(1-f*f/(r*r));p!=0&&(p=Math.sqrt(p)),p=s-p,h.y-t.y>0&&(p=-p),y.y+=p}return y},a}),zt=(e,t)=>v(void 0,null,function*(){let{shapeSvg:a,bbox:i,halfPadding:l}=yield T(e,t,"node "+t.classes+" "+t.class,!0),r=a.insert("rect",":first-child"),s=t.positioned?t.width:i.width+t.padding,n=t.positioned?t.height:i.height+t.padding,c=t.positioned?-s/2:-i.width/2-l,o=t.positioned?-n/2:-i.height/2-l;if(r.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",c).attr("y",o).attr("width",s).attr("height",n),t.props){let h=new Set(Object.keys(t.props));t.props.borders&&(K(r,t.props.borders,s,n),h.delete("borders")),h.forEach(y=>{g.warn(`Unknown node property ${y}`)})}return m(t,r),t.intersect=function(h){return w.rect(t,h)},a}),Zt=(e,t)=>v(void 0,null,function*(){let{shapeSvg:a,bbox:i,halfPadding:l}=yield T(e,t,"node "+t.classes,!0),r=a.insert("rect",":first-child"),s=t.positioned?t.width:i.width+t.padding,n=t.positioned?t.height:i.height+t.padding,c=t.positioned?-s/2:-i.width/2-l,o=t.positioned?-n/2:-i.height/2-l;if(r.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",c).attr("y",o).attr("width",s).attr("height",n),t.props){let h=new Set(Object.keys(t.props));t.props.borders&&(K(r,t.props.borders,s,n),h.delete("borders")),h.forEach(y=>{g.warn(`Unknown node property ${y}`)})}return m(t,r),t.intersect=function(h){return w.rect(t,h)},a}),Gt=(e,t)=>v(void 0,null,function*(){let{shapeSvg:a}=yield T(e,t,"label",!0);g.trace("Classes = ",t.class);let i=a.insert("rect",":first-child"),l=0,r=0;if(i.attr("width",l).attr("height",r),a.attr("class","label edgeLabel"),t.props){let s=new Set(Object.keys(t.props));t.props.borders&&(K(i,t.props.borders,l,r),s.delete("borders")),s.forEach(n=>{g.warn(`Unknown node property ${n}`)})}return m(t,i),t.intersect=function(s){return w.rect(t,s)},a});function K(e,t,a,i){let l=[],r=n=>{l.push(n,0)},s=n=>{l.push(0,n)};t.includes("t")?(g.debug("add top border"),r(a)):s(a),t.includes("r")?(g.debug("add right border"),r(i)):s(i),t.includes("b")?(g.debug("add bottom border"),r(a)):s(a),t.includes("l")?(g.debug("add left border"),r(i)):s(i),e.attr("stroke-dasharray",l.join(" "))}var Ft=(e,t)=>{let a;t.classes?a="node "+t.classes:a="node default";let i=e.insert("g").attr("class",a).attr("id",t.domId||t.id),l=i.insert("rect",":first-child"),r=i.insert("line"),s=i.insert("g").attr("class","label"),n=t.labelText.flat?t.labelText.flat():t.labelText,c="";typeof n=="object"?c=n[0]:c=n,g.info("Label text abc79",c,n,typeof n=="object");let o=s.node().appendChild(H(c,t.labelStyle,!0,!0)),h={width:0,height:0};if(I(b().flowchart.htmlLabels)){let k=o.children[0],x=B(o);h=k.getBoundingClientRect(),x.attr("width",h.width),x.attr("height",h.height)}g.info("Text 2",n);let y=n.slice(1,n.length),f=o.getBBox(),p=s.node().appendChild(H(y.join?y.join("
"):y,t.labelStyle,!0,!0));if(I(b().flowchart.htmlLabels)){let k=p.children[0],x=B(p);h=k.getBoundingClientRect(),x.attr("width",h.width),x.attr("height",h.height)}let d=t.padding/2;return B(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+d+5)+")"),B(o).attr("transform","translate( "+(h.widthv(void 0,null,function*(){let{shapeSvg:a,bbox:i}=yield T(e,t,R(t,void 0),!0),l=i.height+t.padding,r=i.width+l/4+t.padding,s=a.insert("rect",":first-child").attr("style",t.style).attr("rx",l/2).attr("ry",l/2).attr("x",-r/2).attr("y",-l/2).attr("width",r).attr("height",l);return m(t,s),t.intersect=function(n){return w.rect(t,n)},a}),Vt=(e,t)=>v(void 0,null,function*(){let{shapeSvg:a,bbox:i,halfPadding:l}=yield T(e,t,R(t,void 0),!0),r=a.insert("circle",":first-child");return r.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l).attr("width",i.width+t.padding).attr("height",i.height+t.padding),g.info("Circle main"),m(t,r),t.intersect=function(s){return g.info("Circle intersect",t,i.width/2+l,s),w.circle(t,i.width/2+l,s)},a}),qt=(e,t)=>v(void 0,null,function*(){let{shapeSvg:a,bbox:i,halfPadding:l}=yield T(e,t,R(t,void 0),!0),r=5,s=a.insert("g",":first-child"),n=s.insert("circle"),c=s.insert("circle");return s.attr("class",t.class),n.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l+r).attr("width",i.width+t.padding+r*2).attr("height",i.height+t.padding+r*2),c.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l).attr("width",i.width+t.padding).attr("height",i.height+t.padding),g.info("DoubleCircle main"),m(t,n),t.intersect=function(o){return g.info("DoubleCircle intersect",t,i.width/2+l+r,o),w.circle(t,i.width/2+l+r,o)},a}),Jt=(e,t)=>v(void 0,null,function*(){let{shapeSvg:a,bbox:i}=yield T(e,t,R(t,void 0),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:0,y:0},{x:l,y:0},{x:l,y:-r},{x:0,y:-r},{x:0,y:0},{x:-8,y:0},{x:l+8,y:0},{x:l+8,y:-r},{x:-8,y:-r},{x:-8,y:0}],n=N(a,l,r,s);return n.attr("style",t.style),m(t,n),t.intersect=function(c){return w.polygon(t,s,c)},a}),Kt=(e,t)=>{let a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=a.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),m(t,i),t.intersect=function(l){return w.circle(t,7,l)},a},st=(e,t,a)=>{let i=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),l=70,r=10;a==="LR"&&(l=10,r=70);let s=i.append("rect").attr("x",-1*l/2).attr("y",-1*r/2).attr("width",l).attr("height",r).attr("class","fork-join");return m(t,s),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(n){return w.rect(t,n)},i},Pt=(e,t)=>{let a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=a.insert("circle",":first-child"),l=a.insert("circle",":first-child");return l.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),i.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),m(t,l),t.intersect=function(r){return w.circle(t,7,r)},a},tr=(e,t)=>{let a=t.padding/2,i=4,l=8,r;t.classes?r="node "+t.classes:r="node default";let s=e.insert("g").attr("class",r).attr("id",t.domId||t.id),n=s.insert("rect",":first-child"),c=s.insert("line"),o=s.insert("line"),h=0,y=i,f=s.insert("g").attr("class","label"),p=0,d=t.classData.annotations&&t.classData.annotations[0],k=t.classData.annotations[0]?"\xAB"+t.classData.annotations[0]+"\xBB":"",x=f.node().appendChild(H(k,t.labelStyle,!0,!0)),u=x.getBBox();if(I(b().flowchart.htmlLabels)){let L=x.children[0],S=B(x);u=L.getBoundingClientRect(),S.attr("width",u.width),S.attr("height",u.height)}t.classData.annotations[0]&&(y+=u.height+i,h+=u.width);let M=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(b().flowchart.htmlLabels?M+="<"+t.classData.type+">":M+="<"+t.classData.type+">");let C=f.node().appendChild(H(M,t.labelStyle,!0,!0));B(C).attr("class","classTitle");let $=C.getBBox();if(I(b().flowchart.htmlLabels)){let L=C.children[0],S=B(C);$=L.getBoundingClientRect(),S.attr("width",$.width),S.attr("height",$.height)}y+=$.height+i,$.width>h&&(h=$.width);let Y=[];t.classData.members.forEach(L=>{let S=L.getDisplayDetails(),X=S.displayText;b().flowchart.htmlLabels&&(X=X.replace(/